@lovrabet/rabetbase-cli 2.2.4-beta.5 → 2.2.4-beta.6

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 (209) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/fetch-model-list.js +1 -1
  3. package/lib/api/generate-api-file.js +1 -1
  4. package/lib/auth/auth-server-ui.js +1 -1
  5. package/lib/auth/auth-server.js +1 -1
  6. package/lib/auth/constant.js +1 -1
  7. package/lib/auth/get-cookie.js +1 -1
  8. package/lib/auth/get-session-user.js +1 -1
  9. package/lib/auth/is-session-valid.js +1 -1
  10. package/lib/auth/login-success-html.js +1 -1
  11. package/lib/auth/logout.js +1 -1
  12. package/lib/cli-flags.js +1 -1
  13. package/lib/cli.js +1 -1
  14. package/lib/commands/api/generate.js +1 -1
  15. package/lib/commands/api/index.js +1 -1
  16. package/lib/commands/api/list.js +1 -1
  17. package/lib/commands/api/pull.js +1 -1
  18. package/lib/commands/api/shared.js +1 -1
  19. package/lib/commands/app/add.js +1 -1
  20. package/lib/commands/app/discover.js +1 -1
  21. package/lib/commands/app/index.js +1 -1
  22. package/lib/commands/app/list.js +1 -1
  23. package/lib/commands/app/remove.js +1 -1
  24. package/lib/commands/app/shared.js +1 -1
  25. package/lib/commands/app/use.js +1 -1
  26. package/lib/commands/auth/index.js +1 -1
  27. package/lib/commands/bff/create.js +1 -1
  28. package/lib/commands/bff/delete.js +1 -1
  29. package/lib/commands/bff/detail.js +1 -1
  30. package/lib/commands/bff/index.js +1 -1
  31. package/lib/commands/bff/list.js +1 -1
  32. package/lib/commands/bff/pull.js +1 -1
  33. package/lib/commands/bff/push.js +1 -1
  34. package/lib/commands/bff/status.js +1 -1
  35. package/lib/commands/cli-update.js +1 -1
  36. package/lib/commands/codegen/index.js +1 -1
  37. package/lib/commands/codegen/sdk.js +1 -1
  38. package/lib/commands/codegen/sql.js +1 -1
  39. package/lib/commands/common/app-selector.js +1 -1
  40. package/lib/commands/common/flags.js +1 -1
  41. package/lib/commands/common/validate.js +1 -1
  42. package/lib/commands/config/get.js +1 -1
  43. package/lib/commands/config/index.js +1 -1
  44. package/lib/commands/config/list.js +1 -1
  45. package/lib/commands/config/set.js +1 -1
  46. package/lib/commands/config/shared.js +1 -1
  47. package/lib/commands/data/filter.js +1 -1
  48. package/lib/commands/data/getOne.js +1 -1
  49. package/lib/commands/data/index.js +1 -1
  50. package/lib/commands/data/shared.js +1 -1
  51. package/lib/commands/dataset/capability.js +1 -1
  52. package/lib/commands/dataset/delete.js +1 -1
  53. package/lib/commands/dataset/detail.js +1 -1
  54. package/lib/commands/dataset/extend-update.js +1 -1
  55. package/lib/commands/dataset/field-update.js +1 -1
  56. package/lib/commands/dataset/index.js +1 -1
  57. package/lib/commands/dataset/list.js +1 -1
  58. package/lib/commands/dataset/operations.js +1 -1
  59. package/lib/commands/dataset/relation-create.js +1 -1
  60. package/lib/commands/dataset/relation-delete.js +1 -1
  61. package/lib/commands/dataset/relation-shared.js +1 -1
  62. package/lib/commands/dataset/relation-update.js +1 -1
  63. package/lib/commands/dataset/relations.js +1 -1
  64. package/lib/commands/dataset/rename.js +1 -1
  65. package/lib/commands/db/analyze-cancel.js +1 -1
  66. package/lib/commands/db/analyze-start.js +1 -1
  67. package/lib/commands/db/analyze-status.js +1 -1
  68. package/lib/commands/db/create.js +1 -1
  69. package/lib/commands/db/delete.js +1 -1
  70. package/lib/commands/db/detail.js +1 -1
  71. package/lib/commands/db/diff.js +1 -1
  72. package/lib/commands/db/index.js +1 -1
  73. package/lib/commands/db/list.js +1 -1
  74. package/lib/commands/db/shared.js +1 -1
  75. package/lib/commands/db/tables.js +1 -1
  76. package/lib/commands/db/test.js +1 -1
  77. package/lib/commands/db/update.js +1 -1
  78. package/lib/commands/doctor.js +1 -1
  79. package/lib/commands/init/index.js +1 -1
  80. package/lib/commands/issue/index.js +1 -1
  81. package/lib/commands/issue/nudge.js +1 -1
  82. package/lib/commands/issue/report.js +1 -1
  83. package/lib/commands/issue/shared.js +1 -1
  84. package/lib/commands/logs/index.js +1 -1
  85. package/lib/commands/menu/index.js +1 -1
  86. package/lib/commands/menu/list.js +1 -1
  87. package/lib/commands/menu/shared/compare-table.js +1 -1
  88. package/lib/commands/menu/shared/index.js +1 -1
  89. package/lib/commands/menu/shared/inquirer.js +1 -1
  90. package/lib/commands/menu/shared/local-pages.js +1 -1
  91. package/lib/commands/menu/shared/logic.js +1 -1
  92. package/lib/commands/menu/shared/service.js +1 -1
  93. package/lib/commands/menu/shared/sync-core.js +1 -1
  94. package/lib/commands/menu/shared/update-core.js +1 -1
  95. package/lib/commands/menu/shared/valid-url.js +1 -1
  96. package/lib/commands/menu/sync.js +1 -1
  97. package/lib/commands/menu/update.js +1 -1
  98. package/lib/commands/page/generate-start.js +1 -1
  99. package/lib/commands/page/generate-status.js +1 -1
  100. package/lib/commands/page/index.js +1 -1
  101. package/lib/commands/page/pull.js +1 -1
  102. package/lib/commands/page/push.js +1 -1
  103. package/lib/commands/page/relation-audit.js +1 -1
  104. package/lib/commands/page/shared.js +1 -1
  105. package/lib/commands/page/standard-page-status.js +1 -1
  106. package/lib/commands/page/sync.js +1 -1
  107. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  108. package/lib/commands/project/create/format-elapsed.js +1 -1
  109. package/lib/commands/project/create/main.js +1 -1
  110. package/lib/commands/project/create/non-interactive.js +1 -1
  111. package/lib/commands/project/create/project-template-path.js +1 -1
  112. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  113. package/lib/commands/project/create/use-format-code.js +1 -1
  114. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  115. package/lib/commands/project/index.js +1 -1
  116. package/lib/commands/project/init.js +1 -1
  117. package/lib/commands/project/upgrade.js +1 -1
  118. package/lib/commands/registry.js +1 -1
  119. package/lib/commands/run/index.js +1 -1
  120. package/lib/commands/schema.js +1 -1
  121. package/lib/commands/skill/index.js +1 -1
  122. package/lib/commands/sql/create.js +1 -1
  123. package/lib/commands/sql/delete.js +1 -1
  124. package/lib/commands/sql/detail.js +1 -1
  125. package/lib/commands/sql/exec.js +1 -1
  126. package/lib/commands/sql/index.js +1 -1
  127. package/lib/commands/sql/list.js +1 -1
  128. package/lib/commands/sql/pull.js +1 -1
  129. package/lib/commands/sql/push.js +1 -1
  130. package/lib/commands/sql/save.js +1 -1
  131. package/lib/commands/sql/shared.js +1 -1
  132. package/lib/commands/sql/status.js +1 -1
  133. package/lib/commands/sql/validate.js +1 -1
  134. package/lib/commands/workspace/index.js +1 -0
  135. package/lib/config/schema.js +1 -1
  136. package/lib/constant/cdn.js +1 -1
  137. package/lib/constant/cli.js +1 -1
  138. package/lib/constant/defaults.js +1 -1
  139. package/lib/constant/domain.js +1 -1
  140. package/lib/constant/env.js +1 -1
  141. package/lib/constant/output.js +1 -1
  142. package/lib/constant/paths.js +1 -1
  143. package/lib/constant/risk.js +1 -1
  144. package/lib/context/app-resolver.js +1 -1
  145. package/lib/context/auth-resolver.js +1 -1
  146. package/lib/context/config-loader.js +1 -1
  147. package/lib/context.js +1 -1
  148. package/lib/core/alias-resolver.js +1 -1
  149. package/lib/core/api-client.js +1 -1
  150. package/lib/core/bff/config.js +1 -1
  151. package/lib/core/bff/file-system.js +1 -1
  152. package/lib/core/bff/hash.js +1 -1
  153. package/lib/core/bff/lock.js +1 -1
  154. package/lib/core/bff/utils.js +1 -1
  155. package/lib/core/db-resolver.js +1 -1
  156. package/lib/core/page/file-system.js +1 -1
  157. package/lib/core/page/hash.js +1 -1
  158. package/lib/core/page/lock.js +1 -1
  159. package/lib/core/sql-sync/config.js +1 -1
  160. package/lib/core/sql-sync/file-system.js +1 -1
  161. package/lib/core/sql-sync/hash.js +1 -1
  162. package/lib/core/sql-sync/lock.js +1 -1
  163. package/lib/core/sql-sync/utils.js +1 -1
  164. package/lib/core/sql-validator.js +1 -1
  165. package/lib/errors.js +1 -1
  166. package/lib/framework/build-all-flags.js +1 -1
  167. package/lib/framework/flags.js +1 -1
  168. package/lib/framework/help.js +1 -1
  169. package/lib/framework/index.js +1 -1
  170. package/lib/framework/output.js +1 -1
  171. package/lib/framework/response.js +1 -1
  172. package/lib/framework/runner-alias.js +1 -1
  173. package/lib/framework/runner.js +1 -1
  174. package/lib/framework/schema-export.js +1 -1
  175. package/lib/framework/types.js +1 -1
  176. package/lib/generated/build-info.js +1 -1
  177. package/lib/help.js +1 -1
  178. package/lib/skills/main.js +1 -1
  179. package/lib/skills/npx-skills-add.js +1 -1
  180. package/lib/telemetry/cli-command-trace.js +1 -1
  181. package/lib/telemetry/cli-help-trace.js +1 -1
  182. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  183. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  184. package/lib/telemetry/send-cli-trace-log.js +1 -1
  185. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  186. package/lib/utils/ai_config.js +1 -1
  187. package/lib/utils/apply-jq-filter.js +1 -1
  188. package/lib/utils/cdn-config.js +1 -1
  189. package/lib/utils/check-sdk-version.js +1 -1
  190. package/lib/utils/cli-version-check.js +1 -1
  191. package/lib/utils/cli-version-policy.js +1 -1
  192. package/lib/utils/config.js +1 -1
  193. package/lib/utils/copy-directory.js +1 -1
  194. package/lib/utils/entity-with-id.js +1 -1
  195. package/lib/utils/file-utils.js +1 -1
  196. package/lib/utils/guides-cdn.js +1 -1
  197. package/lib/utils/http-client.js +1 -1
  198. package/lib/utils/is-non-interactive.js +1 -1
  199. package/lib/utils/logger.js +1 -1
  200. package/lib/utils/params.js +1 -1
  201. package/lib/utils/platform.js +1 -1
  202. package/lib/utils/rules-cdn.js +1 -1
  203. package/lib/utils/sleep.js +1 -1
  204. package/lib/utils/template-replacer.js +1 -1
  205. package/lib/utils/update-notice.js +1 -1
  206. package/lib/utils/version.js +1 -1
  207. package/lib/utils/with-active-cookie.js +1 -1
  208. package/lib/utils/write-cli-side-channel.js +1 -1
  209. package/package.json +1 -1
@@ -1 +1 @@
1
- const a123_0x117a8c=a123_0x1b74;(function(_0x519b41,_0x445372){const _0x3d33eb=a123_0x1b74,_0x103cc6=_0x519b41();while(!![]){try{const _0x1aa19c=parseInt(_0x3d33eb(0x168))/0x1+parseInt(_0x3d33eb(0x17a))/0x2*(-parseInt(_0x3d33eb(0x188))/0x3)+-parseInt(_0x3d33eb(0x16a))/0x4*(-parseInt(_0x3d33eb(0x179))/0x5)+parseInt(_0x3d33eb(0x165))/0x6+-parseInt(_0x3d33eb(0x167))/0x7*(-parseInt(_0x3d33eb(0x187))/0x8)+-parseInt(_0x3d33eb(0x181))/0x9*(parseInt(_0x3d33eb(0x172))/0xa)+-parseInt(_0x3d33eb(0x186))/0xb;if(_0x1aa19c===_0x445372)break;else _0x103cc6['push'](_0x103cc6['shift']());}catch(_0x5d582c){_0x103cc6['push'](_0x103cc6['shift']());}}}(a123_0x2551,0x48831));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';function a123_0x2551(){const _0x2fb287=['532sFaFBX','418574FZkBvE','high-risk-write','44IGelzT','length','filter','toISOString','lockFilePath','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20','sqlcode','sql','311670WUykoO','sqlRootDir','trashDir','trashedTo','Would\x20delete\x20SQL\x20','startsWith','sqls','68415cqFAoS','11342ctHVmW','Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','str','delete','SQL\x20lock\x20file\x20not\x20found.','entries','\x20(local\x20file\x20moved\x20to\x20trash)','18bujZgL','remoteId','sqlRoot','lastSync','validation','4849812MBouyY','8376sLdHvP','117tLCfCM','POST','replace','2236470xoHIdD','appCode'];a123_0x2551=function(){return _0x2fb287;};return a123_0x2551();}import{deleteSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{fileExists}from'../../core/bff/file-system.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDelete={'service':a123_0x117a8c(0x171),'command':a123_0x117a8c(0x17d),'description':a123_0x117a8c(0x17b),'risk':a123_0x117a8c(0x169),'flags':[SQLCODE_FLAG],async 'validate'(_0x5c442b){const _0x459fe9=a123_0x117a8c,_0x502376=loadSqlProjectConfig(_0x5c442b[_0x459fe9(0x166)]),_0xa057a1=await readSqlLockFile(_0x502376[_0x459fe9(0x16e)]);if(!_0xa057a1)throw CliErrors[_0x459fe9(0x185)]('SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.');},async 'dryRun'(_0x2f8f57){const _0x4a1354=a123_0x117a8c,_0x29fa80=loadSqlProjectConfig(_0x2f8f57[_0x4a1354(0x166)]),_0x19c482=await readSqlLockFile(_0x29fa80['lockFilePath']);if(!_0x19c482)throw CliErrors['validation']('SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.');const {appLock:_0x1e479d}=ensureSqlLockScope(_0x19c482,_0x2f8f57[_0x4a1354(0x166)],_0x29fa80[_0x4a1354(0x183)],_0x4a1354(0x17d)),_0x19786f=_0x2f8f57[_0x4a1354(0x17c)](_0x4a1354(0x170)),_0x525a00=_0x1e479d['sqls'][_0x19786f];if(!_0x525a00)throw CliErrors[_0x4a1354(0x185)]('No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22'+_0x19786f+'\x22.');return{'method':_0x4a1354(0x189),'url':'/smartapi/custom/deleteUserCustomSql','body':{'sqlCode':_0x19786f,'id':_0x525a00[_0x4a1354(0x182)],'localPath':resolveLocalSqlFilePath(_0x29fa80,_0x19786f,_0x525a00)},'description':_0x4a1354(0x176)+_0x19786f+_0x4a1354(0x16f)+_0x29fa80[_0x4a1354(0x174)]};},async 'execute'(_0x45877d){const _0xefec2f=a123_0x117a8c,_0x168ceb=loadSqlProjectConfig(_0x45877d[_0xefec2f(0x166)]),_0x20ca7d=await readSqlLockFile(_0x168ceb['lockFilePath']);if(!_0x20ca7d)throw CliErrors[_0xefec2f(0x185)](_0xefec2f(0x17e));const {lockData:_0x4d115a,appLock:_0x144378}=ensureSqlLockScope(_0x20ca7d,_0x45877d[_0xefec2f(0x166)],_0x168ceb['sqlRoot'],_0xefec2f(0x17d)),_0x164566=_0x45877d[_0xefec2f(0x17c)](_0xefec2f(0x170)),_0xad4c2b=_0x144378[_0xefec2f(0x178)][_0x164566];if(!_0xad4c2b)throw CliErrors[_0xefec2f(0x185)]('No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22'+_0x164566+'\x22.');await deleteSqlQuery({'id':_0xad4c2b['remoteId'],'sqlCode':_0x164566}),_0x144378[_0xefec2f(0x178)]=Object['fromEntries'](Object[_0xefec2f(0x17f)](_0x144378[_0xefec2f(0x178)])[_0xefec2f(0x16c)](([_0x495af2])=>_0x495af2!==_0x164566)),_0x144378[_0xefec2f(0x184)]=new Date()[_0xefec2f(0x16d)](),await writeSqlLockFile(_0x168ceb[_0xefec2f(0x16e)],_0x4d115a);const _0x4cb311=resolveLocalSqlFilePath(_0x168ceb,_0x164566,_0xad4c2b);let _0x446307;await fileExists(_0x4cb311)&&(_0x446307=await moveToTrash(_0x168ceb['projectRoot'],_0x168ceb[_0xefec2f(0x174)],_0x4cb311),await cleanupEmptyDirectories(dirname(_0x4cb311),_0x168ceb[_0xefec2f(0x173)]));const _0x3cb668={'deleted':_0x164566,'remoteId':_0xad4c2b['remoteId']};if(_0x446307)_0x3cb668[_0xefec2f(0x175)]=_0x446307;return{'ok':!![],'data':_0x3cb668,'message':'Deleted\x20'+_0x164566+(_0x446307?_0xefec2f(0x180):'')};}};async function moveToTrash(_0x9cf456,_0x4f9fbf,_0x57b700){const _0x5dd831=a123_0x117a8c,_0x4b350b=new Date()['toISOString']()[_0x5dd831(0x18a)](/[:.]/g,'-'),_0x23dd8a=relative(_0x9cf456,_0x57b700),_0x3dd3c1=join(_0x4f9fbf,_0x4b350b,_0x23dd8a);return await mkdir(dirname(_0x3dd3c1),{'recursive':!![]}),await rename(_0x57b700,_0x3dd3c1),_0x3dd3c1;}function a123_0x1b74(_0x2bdbb8,_0x432e81){_0x2bdbb8=_0x2bdbb8-0x165;const _0x2551d0=a123_0x2551();let _0x1b746e=_0x2551d0[_0x2bdbb8];return _0x1b746e;}async function cleanupEmptyDirectories(_0x3f25d9,_0x2ed108){const _0x2d6734=a123_0x117a8c;let _0x5b3996=resolve(_0x3f25d9);const _0x24fe77=resolve(_0x2ed108);while(_0x5b3996[_0x2d6734(0x177)](''+_0x24fe77+sep)||_0x5b3996===_0x24fe77){if(_0x5b3996===_0x24fe77)return;try{const _0x3dd3d4=await readdir(_0x5b3996);if(_0x3dd3d4[_0x2d6734(0x16b)]>0x0)return;await rmdir(_0x5b3996);}catch{return;}_0x5b3996=dirname(_0x5b3996);}}
1
+ const a123_0x3e6019=a123_0x5eb7;(function(_0x116b37,_0x4b9f76){const _0x3d2aa8=a123_0x5eb7,_0x5d9aad=_0x116b37();while(!![]){try{const _0x9a9423=-parseInt(_0x3d2aa8(0x7e))/0x1+-parseInt(_0x3d2aa8(0x94))/0x2*(parseInt(_0x3d2aa8(0x9a))/0x3)+-parseInt(_0x3d2aa8(0x96))/0x4*(parseInt(_0x3d2aa8(0x90))/0x5)+-parseInt(_0x3d2aa8(0x8e))/0x6*(parseInt(_0x3d2aa8(0x83))/0x7)+parseInt(_0x3d2aa8(0x8d))/0x8*(-parseInt(_0x3d2aa8(0x9d))/0x9)+parseInt(_0x3d2aa8(0x7f))/0xa+parseInt(_0x3d2aa8(0x8f))/0xb;if(_0x9a9423===_0x4b9f76)break;else _0x5d9aad['push'](_0x5d9aad['shift']());}catch(_0x11a460){_0x5d9aad['push'](_0x5d9aad['shift']());}}}(a123_0x2042,0x86947));function a123_0x2042(){const _0x50950b=['fromEntries','trashDir','77385RlmaCF','6750720isvEpL','projectRoot','length','Would\x20delete\x20SQL\x20','175091uSXfHv','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','toISOString','replace','trashedTo','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20','appCode','SQL\x20lock\x20file\x20not\x20found.','sqlRoot','entries','6069928MslYQF','156KLDdvh','27163818KnpHBU','155315MgUkKt','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','validation','remoteId','88EqYYTp','str','52fBmPAx','Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','lockFilePath','Deleted\x20','47931PtRiFT','\x20(local\x20file\x20moved\x20to\x20trash)','sqlcode','9VqbBlX','filter','delete','sqls'];a123_0x2042=function(){return _0x50950b;};return a123_0x2042();}import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{fileExists}from'../../core/bff/file-system.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDelete={'service':'sql','command':'delete','description':a123_0x3e6019(0x97),'risk':'high-risk-write','flags':[SQLCODE_FLAG],async 'validate'(_0x99653a){const _0x1a4b73=a123_0x3e6019,_0x1869b2=loadSqlProjectConfig(_0x99653a[_0x1a4b73(0x89)]),_0xfbd179=await readSqlLockFile(_0x1869b2[_0x1a4b73(0x98)]);if(!_0xfbd179)throw CliErrors[_0x1a4b73(0x92)](_0x1a4b73(0x91));},async 'dryRun'(_0x2d052e){const _0x3405e8=a123_0x3e6019,_0x5cb903=loadSqlProjectConfig(_0x2d052e[_0x3405e8(0x89)]),_0x2615ce=await readSqlLockFile(_0x5cb903[_0x3405e8(0x98)]);if(!_0x2615ce)throw CliErrors['validation'](_0x3405e8(0x91));const {appLock:_0x326e1d}=ensureSqlLockScope(_0x2615ce,_0x2d052e[_0x3405e8(0x89)],_0x5cb903[_0x3405e8(0x8b)],_0x3405e8(0x9f)),_0x4c76b5=_0x2d052e[_0x3405e8(0x95)](_0x3405e8(0x9c)),_0x1d9f83=_0x326e1d[_0x3405e8(0xa0)][_0x4c76b5];if(!_0x1d9f83)throw CliErrors['validation'](_0x3405e8(0x84)+_0x4c76b5+'\x22.');return{'method':'POST','url':'/smartapi/custom/deleteUserCustomSql','body':{'sqlCode':_0x4c76b5,'id':_0x1d9f83[_0x3405e8(0x93)],'localPath':resolveLocalSqlFilePath(_0x5cb903,_0x4c76b5,_0x1d9f83)},'description':_0x3405e8(0x82)+_0x4c76b5+_0x3405e8(0x88)+_0x5cb903[_0x3405e8(0xa2)]};},async 'execute'(_0x2837a1){const _0x572646=a123_0x3e6019,_0x13cdd6=loadSqlProjectConfig(_0x2837a1['appCode']),_0x5e68a9=await readSqlLockFile(_0x13cdd6[_0x572646(0x98)]);if(!_0x5e68a9)throw CliErrors[_0x572646(0x92)](_0x572646(0x8a));const {lockData:_0x1ed652,appLock:_0x259d0b}=ensureSqlLockScope(_0x5e68a9,_0x2837a1[_0x572646(0x89)],_0x13cdd6[_0x572646(0x8b)],_0x572646(0x9f)),_0x100c8=_0x2837a1[_0x572646(0x95)](_0x572646(0x9c)),_0x21bf71=_0x259d0b[_0x572646(0xa0)][_0x100c8];if(!_0x21bf71)throw CliErrors[_0x572646(0x92)](_0x572646(0x84)+_0x100c8+'\x22.');await deleteSqlQuery({'id':_0x21bf71[_0x572646(0x93)],'sqlCode':_0x100c8}),_0x259d0b[_0x572646(0xa0)]=Object[_0x572646(0xa1)](Object[_0x572646(0x8c)](_0x259d0b[_0x572646(0xa0)])[_0x572646(0x9e)](([_0x552e20])=>_0x552e20!==_0x100c8)),_0x259d0b['lastSync']=new Date()[_0x572646(0x85)](),await writeSqlLockFile(_0x13cdd6[_0x572646(0x98)],_0x1ed652);const _0x384032=resolveLocalSqlFilePath(_0x13cdd6,_0x100c8,_0x21bf71);let _0x5190cd;await fileExists(_0x384032)&&(_0x5190cd=await moveToTrash(_0x13cdd6[_0x572646(0x80)],_0x13cdd6[_0x572646(0xa2)],_0x384032),await cleanupEmptyDirectories(dirname(_0x384032),_0x13cdd6['sqlRootDir']));const _0xfb69b={'deleted':_0x100c8,'remoteId':_0x21bf71['remoteId']};if(_0x5190cd)_0xfb69b[_0x572646(0x87)]=_0x5190cd;return{'ok':!![],'data':_0xfb69b,'message':_0x572646(0x99)+_0x100c8+(_0x5190cd?_0x572646(0x9b):'')};}};async function moveToTrash(_0x11d8a4,_0x11b150,_0x2e1691){const _0xc5b286=a123_0x3e6019,_0x3de805=new Date()[_0xc5b286(0x85)]()[_0xc5b286(0x86)](/[:.]/g,'-'),_0x5a7137=relative(_0x11d8a4,_0x2e1691),_0x5564be=join(_0x11b150,_0x3de805,_0x5a7137);return await mkdir(dirname(_0x5564be),{'recursive':!![]}),await rename(_0x2e1691,_0x5564be),_0x5564be;}function a123_0x5eb7(_0x5b07c4,_0x33ea81){_0x5b07c4=_0x5b07c4-0x7e;const _0x2042c2=a123_0x2042();let _0x5eb79e=_0x2042c2[_0x5b07c4];return _0x5eb79e;}async function cleanupEmptyDirectories(_0x4cdbe4,_0x3d0495){const _0x48cf26=a123_0x3e6019;let _0x3ac5b5=resolve(_0x4cdbe4);const _0x5be660=resolve(_0x3d0495);while(_0x3ac5b5['startsWith'](''+_0x5be660+sep)||_0x3ac5b5===_0x5be660){if(_0x3ac5b5===_0x5be660)return;try{const _0x9b61be=await readdir(_0x3ac5b5);if(_0x9b61be[_0x48cf26(0x81)]>0x0)return;await rmdir(_0x3ac5b5);}catch{return;}_0x3ac5b5=dirname(_0x3ac5b5);}}
@@ -1 +1 @@
1
- const a124_0x44054d=a124_0x113f;function a124_0x113f(_0x36893a,_0x59ba2e){_0x36893a=_0x36893a-0xf5;const _0x19bd02=a124_0x19bd();let _0x113fa1=_0x19bd02[_0x36893a];return _0x113fa1;}(function(_0x5b32c7,_0x6d5cac){const _0x40637d=a124_0x113f,_0x1a2fd9=_0x5b32c7();while(!![]){try{const _0x25c317=parseInt(_0x40637d(0x107))/0x1+parseInt(_0x40637d(0xf9))/0x2*(-parseInt(_0x40637d(0xfc))/0x3)+parseInt(_0x40637d(0x10b))/0x4*(-parseInt(_0x40637d(0xfe))/0x5)+parseInt(_0x40637d(0xfb))/0x6+-parseInt(_0x40637d(0x10a))/0x7*(-parseInt(_0x40637d(0x106))/0x8)+-parseInt(_0x40637d(0x109))/0x9*(-parseInt(_0x40637d(0xff))/0xa)+-parseInt(_0x40637d(0xfd))/0xb;if(_0x25c317===_0x6d5cac)break;else _0x1a2fd9['push'](_0x1a2fd9['shift']());}catch(_0x10a5c3){_0x1a2fd9['push'](_0x1a2fd9['shift']());}}}(a124_0x19bd,0x2eefb));import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':a124_0x44054d(0x100),'command':a124_0x44054d(0xf5),'description':'Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','risk':a124_0x44054d(0x103),'flags':[SQLCODE_FLAG,{'name':'verbose','type':a124_0x44054d(0x102),'description':a124_0x44054d(0x104)}],async 'execute'(_0x50de3d){const _0x488cb1=a124_0x44054d,_0x394479=await getSqlQueryInfo(_0x50de3d[_0x488cb1(0xf7)],_0x50de3d[_0x488cb1(0x10c)](_0x488cb1(0x108))),_0x1cb670=_0x50de3d[_0x488cb1(0xfa)](_0x488cb1(0xf8));if(_0x1cb670)return{'ok':!![],'data':_0x394479};const _0x2056ac=_0x394479[_0x488cb1(0xf6)]?await getDbName(_0x50de3d[_0x488cb1(0xf7)],_0x394479[_0x488cb1(0xf6)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x394479['sqlCode'],'sqlName':_0x394479[_0x488cb1(0x10d)],'db':_0x2056ac?_0x2056ac+'\x20('+_0x394479[_0x488cb1(0xf6)]+')':_0x394479[_0x488cb1(0xf6)]??'','description':_0x394479[_0x488cb1(0x105)]??'','sqlContent':_0x394479[_0x488cb1(0x101)]??''}};}};function a124_0x19bd(){const _0x2eec39=['verbose','22gucFcZ','bool','1540788QtRVux','31911ATVZnz','961686opxpwe','850880srYQWx','458270orZIhL','sql','sqlContent','boolean','read','Return\x20full\x20raw\x20SQL\x20query\x20object','description','13656VQaJzG','240599CYyEgs','sqlcode','36VrODOk','231MBbYBx','8OUxbYY','str','sqlName','detail','dbId','appCode'];a124_0x19bd=function(){return _0x2eec39;};return a124_0x19bd();}
1
+ const a124_0x5a307f=a124_0xc2cd;(function(_0x2dd3a5,_0x31966d){const _0x5f1c04=a124_0xc2cd,_0x1077cd=_0x2dd3a5();while(!![]){try{const _0x1e9ffd=-parseInt(_0x5f1c04(0x1f9))/0x1+parseInt(_0x5f1c04(0x1f8))/0x2*(parseInt(_0x5f1c04(0x1fb))/0x3)+parseInt(_0x5f1c04(0x1ee))/0x4+-parseInt(_0x5f1c04(0x1fd))/0x5*(-parseInt(_0x5f1c04(0x1f1))/0x6)+parseInt(_0x5f1c04(0x1fc))/0x7*(parseInt(_0x5f1c04(0x1fe))/0x8)+-parseInt(_0x5f1c04(0x1ea))/0x9*(parseInt(_0x5f1c04(0x1f0))/0xa)+parseInt(_0x5f1c04(0x1ed))/0xb;if(_0x1e9ffd===_0x31966d)break;else _0x1077cd['push'](_0x1077cd['shift']());}catch(_0x5aac1d){_0x1077cd['push'](_0x1077cd['shift']());}}}(a124_0x59c3,0x5128e));import{getSqlQueryInfo}from'../../core/api-client.js';function a124_0xc2cd(_0x249c9a,_0x578234){_0x249c9a=_0x249c9a-0x1e6;const _0x59c3ff=a124_0x59c3();let _0xc2cda1=_0x59c3ff[_0x249c9a];return _0xc2cda1;}function a124_0x59c3(){const _0x1a40e4=['Return\x20full\x20raw\x20SQL\x20query\x20object','64rchdIO','581667puXhFk','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','9267GyaQVv','29813whkubR','1335380gRyHyP','808aTFSfx','str','sql','sqlContent','bool','1221183kfWNSZ','sqlCode','sqlcode','4160024wLnhfN','1130312cbiuWI','appCode','40kPnOVI','6EKIKsO','verbose','sqlName','dbId','boolean','read'];a124_0x59c3=function(){return _0x1a40e4;};return a124_0x59c3();}import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':a124_0x5a307f(0x1e7),'command':'detail','description':a124_0x5a307f(0x1fa),'risk':a124_0x5a307f(0x1f6),'flags':[SQLCODE_FLAG,{'name':a124_0x5a307f(0x1f2),'type':a124_0x5a307f(0x1f5),'description':a124_0x5a307f(0x1f7)}],async 'execute'(_0x5af581){const _0x122615=a124_0x5a307f,_0x27eb4b=await getSqlQueryInfo(_0x5af581[_0x122615(0x1ef)],_0x5af581[_0x122615(0x1e6)](_0x122615(0x1ec))),_0x42b08e=_0x5af581[_0x122615(0x1e9)](_0x122615(0x1f2));if(_0x42b08e)return{'ok':!![],'data':_0x27eb4b};const _0x224d68=_0x27eb4b[_0x122615(0x1f4)]?await getDbName(_0x5af581['appCode'],_0x27eb4b[_0x122615(0x1f4)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x27eb4b[_0x122615(0x1eb)],'sqlName':_0x27eb4b[_0x122615(0x1f3)],'db':_0x224d68?_0x224d68+'\x20('+_0x27eb4b[_0x122615(0x1f4)]+')':_0x27eb4b[_0x122615(0x1f4)]??'','description':_0x27eb4b['description']??'','sqlContent':_0x27eb4b[_0x122615(0x1e8)]??''}};}};
@@ -1 +1 @@
1
- const a125_0x548a5d=a125_0x2d9a;function a125_0x2633(){const _0x49e900=['length','params','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','str','string','8PENmAv','Returned\x20','1887765JsQAyY','execError','2570640IEjPKO','905246hbcjQk','sql','read','1062111pxYxcD','now','4156593ZkQSOc','execResult','332176nlvWFw','sqlcode','isArray','appCode','execSuccess','SQL\x20execution\x20failed','645480PEBGZN'];a125_0x2633=function(){return _0x49e900;};return a125_0x2633();}(function(_0x46dc8a,_0x2aecf5){const _0x54656e=a125_0x2d9a,_0x16c5e5=_0x46dc8a();while(!![]){try{const _0x25c37d=-parseInt(_0x54656e(0xe8))/0x1+-parseInt(_0x54656e(0xf9))/0x2+parseInt(_0x54656e(0xe4))/0x3*(parseInt(_0x54656e(0xf4))/0x4)+-parseInt(_0x54656e(0xf6))/0x5+parseInt(_0x54656e(0xf8))/0x6+parseInt(_0x54656e(0xe6))/0x7+parseInt(_0x54656e(0xee))/0x8;if(_0x25c37d===_0x2aecf5)break;else _0x16c5e5['push'](_0x16c5e5['shift']());}catch(_0xa8fc19){_0x16c5e5['push'](_0x16c5e5['shift']());}}}(a125_0x2633,0x9e5c6));import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';function a125_0x2d9a(_0x56585f,_0x40e063){_0x56585f=_0x56585f-0xe3;const _0x2633db=a125_0x2633();let _0x2d9ae0=_0x2633db[_0x56585f];return _0x2d9ae0;}export const sqlExec={'service':a125_0x548a5d(0xfa),'command':'exec','description':'Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','risk':a125_0x548a5d(0xe3),'flags':[SQLCODE_FLAG,{'name':a125_0x548a5d(0xf0),'type':a125_0x548a5d(0xf3),'description':a125_0x548a5d(0xf1)}],async 'execute'(_0x26aa58){const _0x4ee104=a125_0x548a5d,_0x3a14bf=parseJsonParams(_0x26aa58['str'](_0x4ee104(0xf0))),_0x240fe1=Date[_0x4ee104(0xe5)](),_0x38ff9e=await executeSql(_0x26aa58[_0x4ee104(0xeb)],_0x26aa58[_0x4ee104(0xf2)](_0x4ee104(0xe9)),_0x3a14bf),_0x408822=Date[_0x4ee104(0xe5)]()-_0x240fe1,_0xc6179a=_0x38ff9e?.[_0x4ee104(0xe7)]??_0x38ff9e,_0x325158=_0x38ff9e?.[_0x4ee104(0xec)]??!![];if(!_0x325158)return{'ok':![],'data':{'error':_0x38ff9e?.[_0x4ee104(0xf7)]||_0x4ee104(0xed),'elapsed':_0x408822},'message':'SQL\x20execution\x20failed'};const _0x576051=Array[_0x4ee104(0xea)](_0xc6179a)?_0xc6179a:[];return{'ok':!![],'data':{'rows':_0x576051,'rowCount':_0x576051[_0x4ee104(0xef)],'elapsed':_0x408822},'message':_0x4ee104(0xf5)+_0x576051['length']+'\x20row(s)\x20in\x20'+_0x408822+'ms'};}};
1
+ const a125_0x36d5c3=a125_0x24cb;(function(_0x28d1f7,_0x17beea){const _0x3903df=a125_0x24cb,_0x569138=_0x28d1f7();while(!![]){try{const _0x2ec4a5=parseInt(_0x3903df(0x98))/0x1*(parseInt(_0x3903df(0x90))/0x2)+-parseInt(_0x3903df(0x97))/0x3+parseInt(_0x3903df(0x8b))/0x4+parseInt(_0x3903df(0x80))/0x5+parseInt(_0x3903df(0x82))/0x6*(-parseInt(_0x3903df(0x85))/0x7)+-parseInt(_0x3903df(0x86))/0x8+parseInt(_0x3903df(0x99))/0x9*(-parseInt(_0x3903df(0x84))/0xa);if(_0x2ec4a5===_0x17beea)break;else _0x569138['push'](_0x569138['shift']());}catch(_0xe66a9){_0x569138['push'](_0x569138['shift']());}}}(a125_0x1646,0xca44f));import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a125_0x1646(){const _0x591d0a=['SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','20cuDiWh','8796711ovCYSu','2732856vmHWnL','appCode','isArray','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','string','3161324xCHSDS','str','exec','execResult','read','12cSVUMq','\x20row(s)\x20in\x20','Returned\x20','execSuccess','sql','SQL\x20execution\x20failed','now','1258554mhDjiJ','126313mGPTzy','446526ToeCOv','params','length','6986560pzHcwx','sqlcode','6xFmUtw'];a125_0x1646=function(){return _0x591d0a;};return a125_0x1646();}function a125_0x24cb(_0x474294,_0x210ed7){_0x474294=_0x474294-0x7e;const _0x164617=a125_0x1646();let _0x24cb52=_0x164617[_0x474294];return _0x24cb52;}import{parseJsonParams}from'../../utils/params.js';export const sqlExec={'service':a125_0x36d5c3(0x94),'command':a125_0x36d5c3(0x8d),'description':a125_0x36d5c3(0x89),'risk':a125_0x36d5c3(0x8f),'flags':[SQLCODE_FLAG,{'name':a125_0x36d5c3(0x7e),'type':a125_0x36d5c3(0x8a),'description':a125_0x36d5c3(0x83)}],async 'execute'(_0x396cec){const _0x17ae1f=a125_0x36d5c3,_0x230df7=parseJsonParams(_0x396cec['str'](_0x17ae1f(0x7e))),_0x163c8e=Date[_0x17ae1f(0x96)](),_0x4ff15e=await executeSql(_0x396cec[_0x17ae1f(0x87)],_0x396cec[_0x17ae1f(0x8c)](_0x17ae1f(0x81)),_0x230df7),_0xf77b7=Date[_0x17ae1f(0x96)]()-_0x163c8e,_0x203201=_0x4ff15e?.[_0x17ae1f(0x8e)]??_0x4ff15e,_0x113120=_0x4ff15e?.[_0x17ae1f(0x93)]??!![];if(!_0x113120)return{'ok':![],'data':{'error':_0x4ff15e?.['execError']||_0x17ae1f(0x95),'elapsed':_0xf77b7},'message':_0x17ae1f(0x95)};const _0x6d37ad=Array[_0x17ae1f(0x88)](_0x203201)?_0x203201:[];return{'ok':!![],'data':{'rows':_0x6d37ad,'rowCount':_0x6d37ad[_0x17ae1f(0x7f)],'elapsed':_0xf77b7},'message':_0x17ae1f(0x92)+_0x6d37ad[_0x17ae1f(0x7f)]+_0x17ae1f(0x91)+_0xf77b7+'ms'};}};
@@ -1 +1 @@
1
- (function(_0x185afd,_0x59aec0){const _0x4d8f53=a126_0x23c9,_0xf8a1cf=_0x185afd();while(!![]){try{const _0x5627ba=-parseInt(_0x4d8f53(0xd1))/0x1*(-parseInt(_0x4d8f53(0xd5))/0x2)+parseInt(_0x4d8f53(0xcb))/0x3+-parseInt(_0x4d8f53(0xcc))/0x4*(parseInt(_0x4d8f53(0xd4))/0x5)+parseInt(_0x4d8f53(0xd6))/0x6*(-parseInt(_0x4d8f53(0xd3))/0x7)+-parseInt(_0x4d8f53(0xd0))/0x8*(-parseInt(_0x4d8f53(0xcf))/0x9)+-parseInt(_0x4d8f53(0xce))/0xa*(-parseInt(_0x4d8f53(0xd2))/0xb)+parseInt(_0x4d8f53(0xcd))/0xc;if(_0x5627ba===_0x59aec0)break;else _0xf8a1cf['push'](_0xf8a1cf['shift']());}catch(_0x26a990){_0xf8a1cf['push'](_0xf8a1cf['shift']());}}}(a126_0x283c,0x20585));import{sqlList}from'../../commands/sql/list.js';import{sqlDetail}from'../../commands/sql/detail.js';import{sqlValidate}from'../../commands/sql/validate.js';import{sqlSave}from'../../commands/sql/save.js';function a126_0x23c9(_0x18cf02,_0x534e6b){_0x18cf02=_0x18cf02-0xcb;const _0x283c04=a126_0x283c();let _0x23c9ed=_0x283c04[_0x18cf02];return _0x23c9ed;}import{sqlExec}from'../../commands/sql/exec.js';import{sqlPull}from'../../commands/sql/pull.js';import{sqlCreate}from'../../commands/sql/create.js';import{sqlStatus}from'../../commands/sql/status.js';import{sqlPush}from'../../commands/sql/push.js';function a126_0x283c(){const _0x4e3606=['1542132gntGYa','8aXJsbM','27737yMUTDu','33kFVYRx','91329GLNMgZ','5rUgRoh','6cofIVG','114iykpGH','568281IIYtji','789920bZumMD','653976qRmRNi','264580CIKpAh'];a126_0x283c=function(){return _0x4e3606;};return a126_0x283c();}import{sqlDelete}from'../../commands/sql/delete.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlSave,sqlExec,sqlPull,sqlDelete];
1
+ function a126_0x2139(){const _0x3e6413=['21986tfVFaz','16845201zWbmCc','3mRYXwR','1848SvIUzI','3398256Vyzudg','1122207hHlJHh','5901UiiUCt','2213620Cilzem','3010128YOgnXR'];a126_0x2139=function(){return _0x3e6413;};return a126_0x2139();}(function(_0x5923ae,_0x2ca328){const _0x1585f0=a126_0x542b,_0x12d0f9=_0x5923ae();while(!![]){try{const _0x4a647a=parseInt(_0x1585f0(0x137))/0x1+parseInt(_0x1585f0(0x132))/0x2*(-parseInt(_0x1585f0(0x134))/0x3)+parseInt(_0x1585f0(0x13a))/0x4+parseInt(_0x1585f0(0x139))/0x5+-parseInt(_0x1585f0(0x135))/0x6*(parseInt(_0x1585f0(0x138))/0x7)+parseInt(_0x1585f0(0x136))/0x8+-parseInt(_0x1585f0(0x133))/0x9;if(_0x4a647a===_0x2ca328)break;else _0x12d0f9['push'](_0x12d0f9['shift']());}catch(_0x335a30){_0x12d0f9['push'](_0x12d0f9['shift']());}}}(a126_0x2139,0x9276f));import{sqlList}from'../../commands/sql/list.js';function a126_0x542b(_0x1b285d,_0x90afd0){_0x1b285d=_0x1b285d-0x132;const _0x21399e=a126_0x2139();let _0x542b6c=_0x21399e[_0x1b285d];return _0x542b6c;}import{sqlDetail}from'../../commands/sql/detail.js';import{sqlValidate}from'../../commands/sql/validate.js';import{sqlSave}from'../../commands/sql/save.js';import{sqlExec}from'../../commands/sql/exec.js';import{sqlPull}from'../../commands/sql/pull.js';import{sqlCreate}from'../../commands/sql/create.js';import{sqlStatus}from'../../commands/sql/status.js';import{sqlPush}from'../../commands/sql/push.js';import{sqlDelete}from'../../commands/sql/delete.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlSave,sqlExec,sqlPull,sqlDelete];
@@ -1 +1 @@
1
- const a127_0x239692=a127_0x4561;(function(_0x5a3795,_0x1a5e56){const _0x312133=a127_0x4561,_0x3bfe2c=_0x5a3795();while(!![]){try{const _0x43ea1d=-parseInt(_0x312133(0xa5))/0x1*(parseInt(_0x312133(0x89))/0x2)+-parseInt(_0x312133(0xa9))/0x3*(parseInt(_0x312133(0x98))/0x4)+-parseInt(_0x312133(0x9f))/0x5*(-parseInt(_0x312133(0x8b))/0x6)+-parseInt(_0x312133(0xa7))/0x7+parseInt(_0x312133(0xac))/0x8+-parseInt(_0x312133(0xab))/0x9*(-parseInt(_0x312133(0xa1))/0xa)+-parseInt(_0x312133(0x8c))/0xb*(-parseInt(_0x312133(0x90))/0xc);if(_0x43ea1d===_0x1a5e56)break;else _0x3bfe2c['push'](_0x3bfe2c['shift']());}catch(_0x34b181){_0x3bfe2c['push'](_0x3bfe2c['shift']());}}}(a127_0x56d1,0x5f7d6));import{listSqlQueries}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a127_0x56d1(){const _0x4d2b0b=['3685qjfkMJ','No\x20custom\x20SQL\x20queries\x20found.','10cWphia','str','description','appCode','8vshKyw','Page\x20number','3539032CoxatG','sql','141GYIiAR','Page\x20size','609597tGcENj','6251520VQQTcq','List\x20custom\x20SQL\x20queries','read','7014qhxnSk','\x20SQL\x20queries\x20(total:\x20','918bNPFFX','1925wKGFoy','pagesize','sqlCode','number','48156ehuyGG','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','sqlcode','num','verbose','dbId','length','map','62932xBMIyu','page','string','name','sqlName','boolean','paging'];a127_0x56d1=function(){return _0x4d2b0b;};return a127_0x56d1();}function a127_0x4561(_0x1fbfd4,_0x4318e7){_0x1fbfd4=_0x1fbfd4-0x87;const _0x56d1df=a127_0x56d1();let _0x45616b=_0x56d1df[_0x1fbfd4];return _0x45616b;}export const sqlList={'service':a127_0x239692(0xa8),'command':'list','description':a127_0x239692(0x87),'risk':a127_0x239692(0x88),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a127_0x239692(0x9b),'type':a127_0x239692(0x9a),'description':'Filter\x20by\x20SQL\x20name'},{'name':a127_0x239692(0x99),'type':'number','description':a127_0x239692(0xa6),'default':0x1},{'name':a127_0x239692(0x8d),'type':a127_0x239692(0x8f),'description':a127_0x239692(0xaa)},{'name':a127_0x239692(0x94),'type':a127_0x239692(0x9d),'description':a127_0x239692(0x91)}],async 'execute'(_0x3f6c7d){const _0x2964c1=a127_0x239692,_0x294227=await listSqlQueries(_0x3f6c7d[_0x2964c1(0xa4)],{'sqlCode':_0x3f6c7d[_0x2964c1(0xa2)](_0x2964c1(0x92))||undefined,'sqlName':_0x3f6c7d[_0x2964c1(0xa2)](_0x2964c1(0x9b))||undefined,'currentPage':_0x3f6c7d[_0x2964c1(0x93)](_0x2964c1(0x99)),'pageSize':_0x3f6c7d[_0x2964c1(0x93)](_0x2964c1(0x8d),0x32)}),_0x4f704d=_0x3f6c7d['bool']('verbose'),_0x2a37da=_0x294227['tableData']??[],_0x13fb5d=_0x294227[_0x2964c1(0x9e)]?.['totalCount']??_0x2a37da[_0x2964c1(0x96)];let _0x86060;return _0x4f704d?_0x86060=_0x2a37da:_0x86060=await Promise['all'](_0x2a37da[_0x2964c1(0x97)](async _0x201583=>{const _0x27b017=_0x2964c1;let _0x5d0798;try{_0x5d0798=_0x201583[_0x27b017(0x95)]?await getDbName(_0x3f6c7d[_0x27b017(0xa4)],_0x201583[_0x27b017(0x95)]):undefined;}catch{}return{'sqlCode':_0x201583[_0x27b017(0x8e)],'sqlName':_0x201583[_0x27b017(0x9c)],'description':_0x201583[_0x27b017(0xa3)]??'','db':_0x5d0798?_0x5d0798+'\x20('+_0x201583[_0x27b017(0x95)]+')':_0x201583['dbId']??''};})),{'ok':!![],'data':_0x86060,'message':_0x2a37da['length']===0x0?_0x2964c1(0xa0):'Found\x20'+_0x2a37da[_0x2964c1(0x96)]+_0x2964c1(0x8a)+_0x13fb5d+').'};}};
1
+ const a127_0x561b9a=a127_0x5b1b;(function(_0x229d2a,_0x4d57a3){const _0x1c592c=a127_0x5b1b,_0xfb4cc0=_0x229d2a();while(!![]){try{const _0x5e3020=parseInt(_0x1c592c(0x1f5))/0x1*(parseInt(_0x1c592c(0x1f2))/0x2)+-parseInt(_0x1c592c(0x20c))/0x3+parseInt(_0x1c592c(0x1fe))/0x4*(parseInt(_0x1c592c(0x209))/0x5)+parseInt(_0x1c592c(0x1f8))/0x6*(-parseInt(_0x1c592c(0x1ff))/0x7)+parseInt(_0x1c592c(0x1f9))/0x8+parseInt(_0x1c592c(0x206))/0x9+-parseInt(_0x1c592c(0x1f7))/0xa*(parseInt(_0x1c592c(0x1f1))/0xb);if(_0x5e3020===_0x4d57a3)break;else _0xfb4cc0['push'](_0xfb4cc0['shift']());}catch(_0x2ff7e2){_0xfb4cc0['push'](_0xfb4cc0['shift']());}}}(a127_0x31f9,0x99750));import{listSqlQueries}from'../../core/api-client.js';function a127_0x5b1b(_0x3f0795,_0x36e277){_0x3f0795=_0x3f0795-0x1ed;const _0x31f920=a127_0x31f9();let _0x5b1b46=_0x31f920[_0x3f0795];return _0x5b1b46;}import{getDbName}from'../../core/db-resolver.js';function a127_0x31f9(){const _0x1ac763=['tableData','8783217SRhPip','appCode','Page\x20number','4905yiAWUf','sqlcode','page','2802684UmUoRT','num','name','read','length','sqlCode','dbId','verbose','description','Found\x20','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','11ifQmVm','62834OXadWP','bool','Filter\x20by\x20SQL\x20name','27tMjgsG','number','5684110TxPyOF','162iZniha','6255440XjHeBV','Page\x20size','sql','sqlName','str','1968AxsHkd','248255ZyldKf','paging','pagesize','\x20SQL\x20queries\x20(total:\x20','all','list'];a127_0x31f9=function(){return _0x1ac763;};return a127_0x31f9();}import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlList={'service':a127_0x561b9a(0x1fb),'command':a127_0x561b9a(0x204),'description':'List\x20custom\x20SQL\x20queries','risk':a127_0x561b9a(0x20f),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':'name','type':'string','description':a127_0x561b9a(0x1f4)},{'name':a127_0x561b9a(0x20b),'type':'number','description':a127_0x561b9a(0x208),'default':0x1},{'name':a127_0x561b9a(0x201),'type':a127_0x561b9a(0x1f6),'description':a127_0x561b9a(0x1fa)},{'name':a127_0x561b9a(0x1ed),'type':'boolean','description':a127_0x561b9a(0x1f0)}],async 'execute'(_0x1fac3d){const _0x561000=a127_0x561b9a,_0x1abd6a=await listSqlQueries(_0x1fac3d[_0x561000(0x207)],{'sqlCode':_0x1fac3d['str'](_0x561000(0x20a))||undefined,'sqlName':_0x1fac3d[_0x561000(0x1fd)](_0x561000(0x20e))||undefined,'currentPage':_0x1fac3d[_0x561000(0x20d)](_0x561000(0x20b)),'pageSize':_0x1fac3d[_0x561000(0x20d)](_0x561000(0x201),0x32)}),_0x227e8b=_0x1fac3d[_0x561000(0x1f3)]('verbose'),_0x188878=_0x1abd6a[_0x561000(0x205)]??[],_0xbf07d=_0x1abd6a[_0x561000(0x200)]?.['totalCount']??_0x188878['length'];let _0xc06b7a;return _0x227e8b?_0xc06b7a=_0x188878:_0xc06b7a=await Promise[_0x561000(0x203)](_0x188878['map'](async _0x281333=>{const _0x309de1=_0x561000;let _0x3d8c6b;try{_0x3d8c6b=_0x281333[_0x309de1(0x212)]?await getDbName(_0x1fac3d[_0x309de1(0x207)],_0x281333[_0x309de1(0x212)]):undefined;}catch{}return{'sqlCode':_0x281333[_0x309de1(0x211)],'sqlName':_0x281333[_0x309de1(0x1fc)],'description':_0x281333[_0x309de1(0x1ee)]??'','db':_0x3d8c6b?_0x3d8c6b+'\x20('+_0x281333[_0x309de1(0x212)]+')':_0x281333[_0x309de1(0x212)]??''};})),{'ok':!![],'data':_0xc06b7a,'message':_0x188878[_0x561000(0x210)]===0x0?'No\x20custom\x20SQL\x20queries\x20found.':_0x561000(0x1ef)+_0x188878['length']+_0x561000(0x202)+_0xbf07d+').'};}};
@@ -1 +1 @@
1
- const a128_0x2590c4=a128_0x5a2b;(function(_0x4bc362,_0x4cdfd8){const _0x441a16=a128_0x5a2b,_0x5942ac=_0x4bc362();while(!![]){try{const _0x4b1848=parseInt(_0x441a16(0xdf))/0x1+parseInt(_0x441a16(0xf8))/0x2*(-parseInt(_0x441a16(0x100))/0x3)+parseInt(_0x441a16(0x101))/0x4*(parseInt(_0x441a16(0x110))/0x5)+parseInt(_0x441a16(0xee))/0x6+-parseInt(_0x441a16(0xf5))/0x7+parseInt(_0x441a16(0xf3))/0x8+-parseInt(_0x441a16(0xd9))/0x9*(parseInt(_0x441a16(0xd3))/0xa);if(_0x4b1848===_0x4cdfd8)break;else _0x5942ac['push'](_0x5942ac['shift']());}catch(_0x5f3828){_0x5942ac['push'](_0x5942ac['shift']());}}}(a128_0x1425,0x42ee5));import{readFile,rm,writeFile}from'node:fs/promises';import{join}from'node:path';import{getSqlQueryDetail,listSqlQueries}from'../../core/api-client.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{getDbName}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildLocalSqlFileContent,buildSqlLockEntry,cloneSqlLockData,confirmForceOverwrite,ensureRemoteSqlContent,stripLocalSqlMetadata}from'./shared.js';const PAGE_SIZE=0x64;function a128_0x5a2b(_0x49e1f5,_0x4bb810){_0x49e1f5=_0x49e1f5-0xd3;const _0x142584=a128_0x1425();let _0x5a2b69=_0x142584[_0x49e1f5];return _0x5a2b69;}async function fetchAllSqlQueries(_0x36f633,_0x45b3c6){const _0x27d95d=a128_0x5a2b,_0x4c10b0=[];let _0x573af0=0x1;while(!![]){const _0x33d091=await listSqlQueries(_0x36f633,{'currentPage':_0x573af0,'pageSize':PAGE_SIZE,'sqlCode':_0x45b3c6['sqlCode'],'sqlName':_0x45b3c6[_0x27d95d(0xe5)]}),_0x509404=_0x33d091[_0x27d95d(0x10a)]??[];_0x4c10b0[_0x27d95d(0xe3)](..._0x509404);if(_0x509404[_0x27d95d(0x108)]===0x0)break;const _0x4e7642=_0x33d091['paging']?.[_0x27d95d(0xe7)];if(_0x4e7642!=null?_0x4c10b0[_0x27d95d(0x108)]>=_0x4e7642:_0x509404[_0x27d95d(0x108)]<PAGE_SIZE)break;_0x573af0++;}return _0x4c10b0;}async function ensureSqlContent(_0x4385a8){const _0x370cd6=a128_0x5a2b;if(_0x4385a8[_0x370cd6(0xd6)]!=null&&String(_0x4385a8[_0x370cd6(0xd6)])['length']>0x0)return _0x4385a8;return getSqlQueryDetail(_0x4385a8[_0x370cd6(0xf6)]);}function a128_0x1425(){const _0x9d98d3=['Pull\x20complete:\x20','totalCount','test','nonInteractive','sql','filter','sqlcode','path','1645992nmgtmp','trimStart','\x20written,\x20','\x20SQL\x20file(s)\x20into\x20','Filter\x20by\x20SQL\x20display\x20name','2000688skuXXj','message','1297863XXrGEB','sqlCode','name','2Tlhpwq','No\x20remote\x20SQL\x20queries\x20matched.','Force\x20overwrite\x20local\x20unsynced\x20changes','skipped','POST','conflict','str','unchanged','1033761nZYKTt','14244UarwPi','description','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','utf8','bool','boolean','catch','length','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','tableData','toISOString','join','lastSync','\x20failed','dbId','335MkVnzN','lockFilePath','60JbyQpe','string','sqls','sqlContent','appCode','replace','718587rzwalh','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','pull','sqlRoot','sqlRootDir','mybatisXml','520198deEKri','force','split','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','push','would_pull','sqlName'];a128_0x1425=function(){return _0x9d98d3;};return a128_0x1425();}export const sqlPull={'service':a128_0x2590c4(0xea),'command':'pull','description':a128_0x2590c4(0x109),'risk':'write','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a128_0x2590c4(0xf7),'type':a128_0x2590c4(0xd4),'description':a128_0x2590c4(0xf2)},{'name':a128_0x2590c4(0xe0),'type':a128_0x2590c4(0x106),'description':a128_0x2590c4(0xfa)}],async 'dryRun'(_0x27245a){const _0x18b4bd=a128_0x2590c4,_0x2a896c=loadSqlProjectConfig(_0x27245a[_0x18b4bd(0xd7)]),_0xf74422=await readSqlLockFile(_0x2a896c[_0x18b4bd(0x111)]),{appLock:_0x3f003f}=ensureSqlLockScope(_0xf74422??createEmptySqlLock(),_0x2a896c[_0x18b4bd(0xd7)],_0x2a896c[_0x18b4bd(0xdc)],'pull'),_0x481de5=await fetchAllSqlQueries(_0x27245a[_0x18b4bd(0xd7)],{'sqlCode':_0x27245a[_0x18b4bd(0xfe)]('sqlcode')||undefined,'sqlName':_0x27245a[_0x18b4bd(0xfe)](_0x18b4bd(0xf7))||undefined}),_0x3eab6a=[];for(const _0x20767b of _0x481de5){const _0x492fd1=await ensureSqlContent(_0x20767b),_0x3f7363=ensureRemoteSqlContent(_0x492fd1),_0x465e5e=detectModeFromSql(_0x492fd1),_0x1f9baf=_0x492fd1['dbId']?await getDbName(_0x27245a['appCode'],Number(_0x492fd1[_0x18b4bd(0x10f)]))['catch'](()=>undefined):undefined,_0x5951d6=buildLocalSqlFileContent({'sqlCode':_0x492fd1[_0x18b4bd(0xf6)],'sqlName':_0x492fd1['sqlName'],'dbId':_0x492fd1[_0x18b4bd(0x10f)]},_0x3f7363,{'dbName':_0x1f9baf,'mode':_0x465e5e,'syncedAt':new Date()[_0x18b4bd(0x10b)](),'description':_0x492fd1[_0x18b4bd(0x102)]}),_0x314c90=buildSqlLockEntry(_0x492fd1,_0x3f7363,'',{'dbName':_0x1f9baf}),_0x239459=resolveLocalSqlFilePath(_0x2a896c,_0x492fd1[_0x18b4bd(0xf6)],_0x314c90);let _0x471c48=_0x18b4bd(0xe4),_0x245efc;if(await fileExists(_0x239459)){const _0x564bef=await readFile(_0x239459,_0x18b4bd(0x104));isEquivalentPulledSqlFile(_0x564bef,_0x5951d6,_0x465e5e)?(_0x471c48=_0x18b4bd(0xfb),_0x245efc=_0x18b4bd(0xff)):(_0x471c48=_0x18b4bd(0xfd),_0x245efc=_0x18b4bd(0xda));}_0x3eab6a[_0x18b4bd(0xe3)]({'sqlCode':_0x492fd1['sqlCode'],'sqlName':_0x492fd1[_0x18b4bd(0xe5)],'filePath':_0x239459,'status':_0x471c48,'reason':_0x245efc});}return{'method':_0x18b4bd(0xfc),'url':_0x18b4bd(0x103),'body':{'appCode':_0x27245a[_0x18b4bd(0xd7)],'sqlCode':_0x27245a[_0x18b4bd(0xfe)](_0x18b4bd(0xec))||null,'sqlName':_0x27245a[_0x18b4bd(0xfe)](_0x18b4bd(0xf7))||null,'files':_0x3eab6a},'description':'Would\x20pull\x20'+_0x3eab6a[_0x18b4bd(0x108)]+_0x18b4bd(0xf1)+_0x2a896c[_0x18b4bd(0xdd)]};},async 'execute'(_0x86186f){const _0x56904b=a128_0x2590c4,_0x13b48b=loadSqlProjectConfig(_0x86186f['appCode']),_0x51791f=await readSqlLockFile(_0x13b48b[_0x56904b(0x111)]),{lockData:_0x598012,appLock:_0x3a4e9e}=ensureSqlLockScope(_0x51791f??createEmptySqlLock(),_0x13b48b[_0x56904b(0xd7)],_0x13b48b[_0x56904b(0xdc)],_0x56904b(0xdb)),_0x5068fb=_0x86186f[_0x56904b(0x105)](_0x56904b(0xe0)),_0x607433=await fetchAllSqlQueries(_0x86186f[_0x56904b(0xd7)],{'sqlCode':_0x86186f['str'](_0x56904b(0xec))||undefined,'sqlName':_0x86186f[_0x56904b(0xfe)]('name')||undefined});if(_0x607433[_0x56904b(0x108)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x56904b(0xf9)};const _0x40bea5=[],_0x39dff5=[];for(const _0x2142fe of _0x607433){try{_0x40bea5[_0x56904b(0xe3)](await ensureSqlContent(_0x2142fe));}catch(_0x2dec84){_0x39dff5[_0x56904b(0xe3)]({'sqlCode':_0x2142fe[_0x56904b(0xf6)],'error':_0x2dec84 instanceof Error?_0x2dec84[_0x56904b(0xf4)]:String(_0x2dec84)});}}if(_0x5068fb&&!_0x86186f[_0x56904b(0xe9)]){let _0xc6936e=![];for(const _0x5abade of _0x40bea5){const _0x395c3f=detectModeFromSql(_0x5abade),_0x11fecd=_0x5abade['dbId']?await getDbName(_0x86186f[_0x56904b(0xd7)],Number(_0x5abade[_0x56904b(0x10f)]))[_0x56904b(0x107)](()=>undefined):undefined,_0x5b2394=buildLocalSqlFileContent({'sqlCode':_0x5abade[_0x56904b(0xf6)],'sqlName':_0x5abade[_0x56904b(0xe5)],'dbId':_0x5abade[_0x56904b(0x10f)]},ensureRemoteSqlContent(_0x5abade),{'dbName':_0x11fecd,'mode':_0x395c3f,'syncedAt':new Date()[_0x56904b(0x10b)](),'description':_0x5abade[_0x56904b(0x102)]}),_0x331850=resolveLocalSqlFilePath(_0x13b48b,_0x5abade[_0x56904b(0xf6)],buildSqlLockEntry(_0x5abade,ensureRemoteSqlContent(_0x5abade),'',{'dbName':_0x11fecd}));if(await fileExists(_0x331850)){const _0x767167=await readFile(_0x331850,_0x56904b(0x104));if(!isEquivalentPulledSqlFile(_0x767167,_0x5b2394,_0x395c3f)){_0xc6936e=!![];break;}}}if(_0xc6936e){const _0x859a6b=await confirmForceOverwrite(_0x56904b(0xe2));if(!_0x859a6b)throw CliErrors['cancelled']('Force\x20pull\x20cancelled.');}}const _0x3cbd07=cloneSqlLockData(_0x598012),_0x831a0e=_0x3cbd07['apps'][_0x13b48b[_0x56904b(0xd7)]],_0x4c2ab5=[],_0x5ce76a=[];for(const _0x52e301 of _0x40bea5){const _0xdd82a3=_0x831a0e['sqls'][_0x52e301[_0x56904b(0xf6)]],_0x11e25d=ensureRemoteSqlContent(_0x52e301),_0x43f0c6=detectModeFromSql(_0x52e301),_0x161352=_0x52e301['dbId']?await getDbName(_0x86186f[_0x56904b(0xd7)],Number(_0x52e301[_0x56904b(0x10f)]))[_0x56904b(0x107)](()=>undefined):undefined,_0x5699db=buildLocalSqlFileContent({'sqlCode':_0x52e301[_0x56904b(0xf6)],'sqlName':_0x52e301[_0x56904b(0xe5)],'dbId':_0x52e301['dbId']},_0x11e25d,{'dbName':_0x161352,'mode':_0x43f0c6,'syncedAt':new Date()[_0x56904b(0x10b)](),'description':_0x52e301[_0x56904b(0x102)]}),_0x47fe97=buildSqlLockEntry(_0x52e301,_0x11e25d,computeSqlContentHash(_0x5699db),{'dbName':_0x161352}),_0x1bd02d=_0x47fe97['path'],_0x42e26d=join(_0x13b48b[_0x56904b(0xdd)],_0x1bd02d);try{if(await fileExists(_0x42e26d)){const _0x5c85be=await readFile(_0x42e26d,_0x56904b(0x104));if(isEquivalentPulledSqlFile(_0x5c85be,_0x5699db,_0x43f0c6)){_0x5ce76a[_0x56904b(0xe3)]({'sqlCode':_0x52e301[_0x56904b(0xf6)],'reason':_0x56904b(0xff)}),_0x831a0e['sqls'][_0x52e301['sqlCode']]={..._0x47fe97,'hash':computeSqlContentHash(_0x5c85be),'path':_0x1bd02d};continue;}if(!_0x5068fb){_0x5ce76a[_0x56904b(0xe3)]({'sqlCode':_0x52e301[_0x56904b(0xf6)],'reason':'local\x20differs\x20from\x20remote'});continue;}}const _0x1ab393=_0xdd82a3?.[_0x56904b(0xed)]?join(_0x13b48b[_0x56904b(0xdd)],_0xdd82a3[_0x56904b(0xed)]):undefined;_0x1ab393&&_0x1ab393!==_0x42e26d&&await fileExists(_0x1ab393)&&await rm(_0x1ab393,{'force':!![]}),await ensureParentDirectory(_0x42e26d),await writeFile(_0x42e26d,_0x5699db,'utf8'),_0x831a0e[_0x56904b(0xd5)][_0x52e301[_0x56904b(0xf6)]]={..._0x47fe97,'path':_0x1bd02d},_0x4c2ab5[_0x56904b(0xe3)]({'sqlCode':_0x52e301[_0x56904b(0xf6)],'filePath':_0x42e26d});}catch(_0x432eab){_0x39dff5['push']({'sqlCode':_0x52e301[_0x56904b(0xf6)],'error':_0x432eab instanceof Error?_0x432eab['message']:String(_0x432eab)});}}return _0x831a0e[_0x56904b(0x10d)]=new Date()['toISOString'](),await writeSqlLockFile(_0x13b48b[_0x56904b(0x111)],_0x3cbd07),{'ok':_0x39dff5[_0x56904b(0x108)]===0x0,'data':{'pulled':_0x4c2ab5,'skipped':_0x5ce76a,'failed':_0x39dff5},'message':_0x56904b(0xe6)+_0x4c2ab5[_0x56904b(0x108)]+_0x56904b(0xf0)+_0x5ce76a[_0x56904b(0x108)]+'\x20skipped,\x20'+_0x39dff5[_0x56904b(0x108)]+_0x56904b(0x10e)};}};function detectModeFromSql(_0xe3aeef){const _0xf11613=a128_0x2590c4,_0x9f905d=ensureRemoteSqlContent(_0xe3aeef),_0x4f4c7e=stripLocalSqlMetadata(_0x9f905d,_0xf11613(0xde))[_0xf11613(0xef)]();if(/^<(select|insert|update|delete)\b/i[_0xf11613(0xe8)](_0x4f4c7e))return'mybatisXml';return'sql';}function isEquivalentPulledSqlFile(_0x4fd151,_0x3acd5c,_0x385487){return normalizePullComparableContent(_0x4fd151,_0x385487)===normalizePullComparableContent(_0x3acd5c,_0x385487);}function normalizePullComparableContent(_0x2e0d18,_0xab60dd){const _0x1a7a82=a128_0x2590c4,_0x21b526=_0x2e0d18[_0x1a7a82(0xd8)](/\r\n/g,'\x0a')[_0x1a7a82(0xe1)]('\x0a'),_0x245586=_0x21b526[_0x1a7a82(0xeb)](_0x2b2c93=>!isSyncedAtMetadataLine(_0x2b2c93,_0xab60dd));return _0x245586[_0x1a7a82(0x10c)]('\x0a');}function isSyncedAtMetadataLine(_0x54acf5,_0x45901d){const _0x33d75c=a128_0x2590c4;if(_0x45901d===_0x33d75c(0xde))return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0x33d75c(0xe8)](_0x54acf5);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x33d75c(0xe8)](_0x54acf5);}
1
+ const a128_0x4a67ee=a128_0x5533;(function(_0x1fe79c,_0x44c7fe){const _0x251c5c=a128_0x5533,_0x4bb6ca=_0x1fe79c();while(!![]){try{const _0x1b6485=-parseInt(_0x251c5c(0xe0))/0x1*(-parseInt(_0x251c5c(0xe4))/0x2)+-parseInt(_0x251c5c(0xf0))/0x3+parseInt(_0x251c5c(0xb7))/0x4+-parseInt(_0x251c5c(0xc0))/0x5*(-parseInt(_0x251c5c(0xc8))/0x6)+-parseInt(_0x251c5c(0xe6))/0x7*(-parseInt(_0x251c5c(0xec))/0x8)+parseInt(_0x251c5c(0xed))/0x9+-parseInt(_0x251c5c(0xbb))/0xa*(parseInt(_0x251c5c(0xcd))/0xb);if(_0x1b6485===_0x44c7fe)break;else _0x4bb6ca['push'](_0x4bb6ca['shift']());}catch(_0x2f881c){_0x4bb6ca['push'](_0x4bb6ca['shift']());}}}(a128_0x1b52,0x8f3d0));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';function a128_0x1b52(){const _0x10ff52=['\x20skipped,\x20','lockFilePath','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','description','1104UoOsCS','utf8','catch','sqls','replace','1969VRNFcP','sqlCode','appCode','string','split','tableData','\x20written,\x20','force','sqlName','cancelled','dbId','sqlContent','sqlRoot','bool','sqlRootDir','toISOString','length','No\x20remote\x20SQL\x20queries\x20matched.','totalCount','15063KTiRSQ','test','boolean','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','82jNydzF','POST','1736SuSxip','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','message','mybatisXml','path','nonInteractive','22024sgYduN','9626193KSckql','unchanged','filter','3410727itiaIU','Pull\x20complete:\x20','write','Force\x20overwrite\x20local\x20unsynced\x20changes','\x20failed','would_pull','Would\x20pull\x20','sqlcode','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','Force\x20pull\x20cancelled.','join','2759224vqlweb','str','name','pull','138590WTOrsb','apps','sql','trimStart','skipped','31105ncoprt','Filter\x20by\x20SQL\x20display\x20name','push','local\x20differs\x20from\x20remote'];a128_0x1b52=function(){return _0x10ff52;};return a128_0x1b52();}import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a128_0x5533(_0x5af6ee,_0xddf42a){_0x5af6ee=_0x5af6ee-0xae;const _0x1b5237=a128_0x1b52();let _0x5533e3=_0x1b5237[_0x5af6ee];return _0x5533e3;}import{buildLocalSqlFileContent,buildSqlLockEntry,cloneSqlLockData,confirmForceOverwrite,ensureRemoteSqlContent,stripLocalSqlMetadata}from'./shared.js';const PAGE_SIZE=0x64;async function fetchAllSqlQueries(_0x5d313c,_0x3ece7d){const _0x1314a6=a128_0x5533,_0x260236=[];let _0xd11f2b=0x1;while(!![]){const _0x381751=await listSqlQueries(_0x5d313c,{'currentPage':_0xd11f2b,'pageSize':PAGE_SIZE,'sqlCode':_0x3ece7d[_0x1314a6(0xce)],'sqlName':_0x3ece7d[_0x1314a6(0xd5)]}),_0x593470=_0x381751[_0x1314a6(0xd2)]??[];_0x260236['push'](..._0x593470);if(_0x593470[_0x1314a6(0xdd)]===0x0)break;const _0x2f4f52=_0x381751['paging']?.[_0x1314a6(0xdf)];if(_0x2f4f52!=null?_0x260236[_0x1314a6(0xdd)]>=_0x2f4f52:_0x593470[_0x1314a6(0xdd)]<PAGE_SIZE)break;_0xd11f2b++;}return _0x260236;}async function ensureSqlContent(_0x20b551){const _0x8ddf2b=a128_0x5533;if(_0x20b551[_0x8ddf2b(0xd8)]!=null&&String(_0x20b551[_0x8ddf2b(0xd8)])['length']>0x0)return _0x20b551;return getSqlQueryDetail(_0x20b551[_0x8ddf2b(0xce)]);}export const sqlPull={'service':a128_0x4a67ee(0xbd),'command':a128_0x4a67ee(0xba),'description':a128_0x4a67ee(0xe7),'risk':a128_0x4a67ee(0xae),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':'name','type':a128_0x4a67ee(0xd0),'description':a128_0x4a67ee(0xc1)},{'name':a128_0x4a67ee(0xd4),'type':a128_0x4a67ee(0xe2),'description':a128_0x4a67ee(0xaf)}],async 'dryRun'(_0x4802f8){const _0x13de8f=a128_0x4a67ee,_0x2fea65=loadSqlProjectConfig(_0x4802f8[_0x13de8f(0xcf)]),_0x52f7de=await readSqlLockFile(_0x2fea65[_0x13de8f(0xc5)]),{appLock:_0x4cbc29}=ensureSqlLockScope(_0x52f7de??createEmptySqlLock(),_0x2fea65[_0x13de8f(0xcf)],_0x2fea65[_0x13de8f(0xd9)],_0x13de8f(0xba)),_0x55049f=await fetchAllSqlQueries(_0x4802f8[_0x13de8f(0xcf)],{'sqlCode':_0x4802f8[_0x13de8f(0xb8)](_0x13de8f(0xb3))||undefined,'sqlName':_0x4802f8[_0x13de8f(0xb8)](_0x13de8f(0xb9))||undefined}),_0x6d4065=[];for(const _0x5f0c9d of _0x55049f){const _0x3df09e=await ensureSqlContent(_0x5f0c9d),_0x27fa34=ensureRemoteSqlContent(_0x3df09e),_0x436510=detectModeFromSql(_0x3df09e),_0x2c11f4=_0x3df09e[_0x13de8f(0xd7)]?await getDbName(_0x4802f8[_0x13de8f(0xcf)],Number(_0x3df09e[_0x13de8f(0xd7)]))['catch'](()=>undefined):undefined,_0x3bed4a=buildLocalSqlFileContent({'sqlCode':_0x3df09e['sqlCode'],'sqlName':_0x3df09e[_0x13de8f(0xd5)],'dbId':_0x3df09e['dbId']},_0x27fa34,{'dbName':_0x2c11f4,'mode':_0x436510,'syncedAt':new Date()['toISOString'](),'description':_0x3df09e[_0x13de8f(0xc7)]}),_0x1f9654=buildSqlLockEntry(_0x3df09e,_0x27fa34,'',{'dbName':_0x2c11f4}),_0x2742f8=resolveLocalSqlFilePath(_0x2fea65,_0x3df09e[_0x13de8f(0xce)],_0x1f9654);let _0x195477=_0x13de8f(0xb1),_0x592713;if(await fileExists(_0x2742f8)){const _0x36fa53=await readFile(_0x2742f8,_0x13de8f(0xc9));isEquivalentPulledSqlFile(_0x36fa53,_0x3bed4a,_0x436510)?(_0x195477=_0x13de8f(0xbf),_0x592713='unchanged'):(_0x195477='conflict',_0x592713=_0x13de8f(0xc6));}_0x6d4065[_0x13de8f(0xc2)]({'sqlCode':_0x3df09e[_0x13de8f(0xce)],'sqlName':_0x3df09e['sqlName'],'filePath':_0x2742f8,'status':_0x195477,'reason':_0x592713});}return{'method':_0x13de8f(0xe5),'url':_0x13de8f(0xe3),'body':{'appCode':_0x4802f8['appCode'],'sqlCode':_0x4802f8[_0x13de8f(0xb8)]('sqlcode')||null,'sqlName':_0x4802f8[_0x13de8f(0xb8)](_0x13de8f(0xb9))||null,'files':_0x6d4065},'description':_0x13de8f(0xb2)+_0x6d4065[_0x13de8f(0xdd)]+'\x20SQL\x20file(s)\x20into\x20'+_0x2fea65[_0x13de8f(0xdb)]};},async 'execute'(_0x100f7d){const _0x248f86=a128_0x4a67ee,_0x2151c5=loadSqlProjectConfig(_0x100f7d[_0x248f86(0xcf)]),_0x1927a3=await readSqlLockFile(_0x2151c5['lockFilePath']),{lockData:_0x399733,appLock:_0x3124aa}=ensureSqlLockScope(_0x1927a3??createEmptySqlLock(),_0x2151c5[_0x248f86(0xcf)],_0x2151c5[_0x248f86(0xd9)],_0x248f86(0xba)),_0x7aa648=_0x100f7d[_0x248f86(0xda)](_0x248f86(0xd4)),_0x4ec65c=await fetchAllSqlQueries(_0x100f7d['appCode'],{'sqlCode':_0x100f7d[_0x248f86(0xb8)](_0x248f86(0xb3))||undefined,'sqlName':_0x100f7d['str'](_0x248f86(0xb9))||undefined});if(_0x4ec65c['length']===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x248f86(0xde)};const _0x486e68=[],_0x450af2=[];for(const _0x92975 of _0x4ec65c){try{_0x486e68[_0x248f86(0xc2)](await ensureSqlContent(_0x92975));}catch(_0x3aff26){_0x450af2['push']({'sqlCode':_0x92975[_0x248f86(0xce)],'error':_0x3aff26 instanceof Error?_0x3aff26[_0x248f86(0xe8)]:String(_0x3aff26)});}}if(_0x7aa648&&!_0x100f7d[_0x248f86(0xeb)]){let _0x3cde90=![];for(const _0x34dfe8 of _0x486e68){const _0x4f1dc=detectModeFromSql(_0x34dfe8),_0x3427dc=_0x34dfe8[_0x248f86(0xd7)]?await getDbName(_0x100f7d[_0x248f86(0xcf)],Number(_0x34dfe8['dbId']))['catch'](()=>undefined):undefined,_0x377c0a=buildLocalSqlFileContent({'sqlCode':_0x34dfe8[_0x248f86(0xce)],'sqlName':_0x34dfe8['sqlName'],'dbId':_0x34dfe8['dbId']},ensureRemoteSqlContent(_0x34dfe8),{'dbName':_0x3427dc,'mode':_0x4f1dc,'syncedAt':new Date()[_0x248f86(0xdc)](),'description':_0x34dfe8[_0x248f86(0xc7)]}),_0x7d3526=resolveLocalSqlFilePath(_0x2151c5,_0x34dfe8[_0x248f86(0xce)],buildSqlLockEntry(_0x34dfe8,ensureRemoteSqlContent(_0x34dfe8),'',{'dbName':_0x3427dc}));if(await fileExists(_0x7d3526)){const _0x272a95=await readFile(_0x7d3526,_0x248f86(0xc9));if(!isEquivalentPulledSqlFile(_0x272a95,_0x377c0a,_0x4f1dc)){_0x3cde90=!![];break;}}}if(_0x3cde90){const _0x527344=await confirmForceOverwrite(_0x248f86(0xb4));if(!_0x527344)throw CliErrors[_0x248f86(0xd6)](_0x248f86(0xb5));}}const _0x27765b=cloneSqlLockData(_0x399733),_0x4b73fc=_0x27765b[_0x248f86(0xbc)][_0x2151c5['appCode']],_0x2082e6=[],_0x35a354=[];for(const _0x36e9a4 of _0x486e68){const _0x29921d=_0x4b73fc[_0x248f86(0xcb)][_0x36e9a4[_0x248f86(0xce)]],_0x5adc70=ensureRemoteSqlContent(_0x36e9a4),_0x540019=detectModeFromSql(_0x36e9a4),_0x2879ce=_0x36e9a4[_0x248f86(0xd7)]?await getDbName(_0x100f7d[_0x248f86(0xcf)],Number(_0x36e9a4[_0x248f86(0xd7)]))[_0x248f86(0xca)](()=>undefined):undefined,_0x42a4dd=buildLocalSqlFileContent({'sqlCode':_0x36e9a4['sqlCode'],'sqlName':_0x36e9a4[_0x248f86(0xd5)],'dbId':_0x36e9a4[_0x248f86(0xd7)]},_0x5adc70,{'dbName':_0x2879ce,'mode':_0x540019,'syncedAt':new Date()[_0x248f86(0xdc)](),'description':_0x36e9a4[_0x248f86(0xc7)]}),_0x362cdd=buildSqlLockEntry(_0x36e9a4,_0x5adc70,computeSqlContentHash(_0x42a4dd),{'dbName':_0x2879ce}),_0xab4f59=_0x362cdd[_0x248f86(0xea)],_0x54e80b=join(_0x2151c5[_0x248f86(0xdb)],_0xab4f59);try{if(await fileExists(_0x54e80b)){const _0x4f3560=await readFile(_0x54e80b,_0x248f86(0xc9));if(isEquivalentPulledSqlFile(_0x4f3560,_0x42a4dd,_0x540019)){_0x35a354['push']({'sqlCode':_0x36e9a4[_0x248f86(0xce)],'reason':_0x248f86(0xee)}),_0x4b73fc[_0x248f86(0xcb)][_0x36e9a4['sqlCode']]={..._0x362cdd,'hash':computeSqlContentHash(_0x4f3560),'path':_0xab4f59};continue;}if(!_0x7aa648){_0x35a354[_0x248f86(0xc2)]({'sqlCode':_0x36e9a4['sqlCode'],'reason':_0x248f86(0xc3)});continue;}}const _0x1bf4c5=_0x29921d?.[_0x248f86(0xea)]?join(_0x2151c5[_0x248f86(0xdb)],_0x29921d[_0x248f86(0xea)]):undefined;_0x1bf4c5&&_0x1bf4c5!==_0x54e80b&&await fileExists(_0x1bf4c5)&&await rm(_0x1bf4c5,{'force':!![]}),await ensureParentDirectory(_0x54e80b),await writeFile(_0x54e80b,_0x42a4dd,_0x248f86(0xc9)),_0x4b73fc[_0x248f86(0xcb)][_0x36e9a4[_0x248f86(0xce)]]={..._0x362cdd,'path':_0xab4f59},_0x2082e6[_0x248f86(0xc2)]({'sqlCode':_0x36e9a4['sqlCode'],'filePath':_0x54e80b});}catch(_0x1e9084){_0x450af2[_0x248f86(0xc2)]({'sqlCode':_0x36e9a4[_0x248f86(0xce)],'error':_0x1e9084 instanceof Error?_0x1e9084['message']:String(_0x1e9084)});}}return _0x4b73fc['lastSync']=new Date()[_0x248f86(0xdc)](),await writeSqlLockFile(_0x2151c5[_0x248f86(0xc5)],_0x27765b),{'ok':_0x450af2[_0x248f86(0xdd)]===0x0,'data':{'pulled':_0x2082e6,'skipped':_0x35a354,'failed':_0x450af2},'message':_0x248f86(0xf1)+_0x2082e6[_0x248f86(0xdd)]+_0x248f86(0xd3)+_0x35a354[_0x248f86(0xdd)]+_0x248f86(0xc4)+_0x450af2['length']+_0x248f86(0xb0)};}};function detectModeFromSql(_0x5606f9){const _0x4c2263=a128_0x4a67ee,_0x5b704f=ensureRemoteSqlContent(_0x5606f9),_0x14d424=stripLocalSqlMetadata(_0x5b704f,_0x4c2263(0xe9))[_0x4c2263(0xbe)]();if(/^<(select|insert|update|delete)\b/i['test'](_0x14d424))return'mybatisXml';return _0x4c2263(0xbd);}function isEquivalentPulledSqlFile(_0x3f1458,_0x147954,_0x51486e){return normalizePullComparableContent(_0x3f1458,_0x51486e)===normalizePullComparableContent(_0x147954,_0x51486e);}function normalizePullComparableContent(_0x2021e9,_0x3e40fa){const _0x1d12e6=a128_0x4a67ee,_0xb9fad4=_0x2021e9[_0x1d12e6(0xcc)](/\r\n/g,'\x0a')[_0x1d12e6(0xd1)]('\x0a'),_0xe38bd2=_0xb9fad4[_0x1d12e6(0xef)](_0x5093e4=>!isSyncedAtMetadataLine(_0x5093e4,_0x3e40fa));return _0xe38bd2[_0x1d12e6(0xb6)]('\x0a');}function isSyncedAtMetadataLine(_0x74ae51,_0x528351){const _0x559d41=a128_0x4a67ee;if(_0x528351===_0x559d41(0xe9))return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0x559d41(0xe1)](_0x74ae51);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x559d41(0xe1)](_0x74ae51);}
@@ -1 +1 @@
1
- const a129_0x2cdf91=a129_0x5b83;(function(_0x1feacb,_0x559003){const _0x24598e=a129_0x5b83,_0x1c4d53=_0x1feacb();while(!![]){try{const _0x411a1e=parseInt(_0x24598e(0x182))/0x1+parseInt(_0x24598e(0x19d))/0x2*(parseInt(_0x24598e(0x193))/0x3)+parseInt(_0x24598e(0x181))/0x4+-parseInt(_0x24598e(0x1a2))/0x5*(-parseInt(_0x24598e(0x17b))/0x6)+-parseInt(_0x24598e(0x17a))/0x7*(parseInt(_0x24598e(0x175))/0x8)+-parseInt(_0x24598e(0x194))/0x9*(parseInt(_0x24598e(0x1a9))/0xa)+-parseInt(_0x24598e(0x17c))/0xb*(parseInt(_0x24598e(0x199))/0xc);if(_0x411a1e===_0x559003)break;else _0x1c4d53['push'](_0x1c4d53['shift']());}catch(_0x49d21a){_0x1c4d53['push'](_0x1c4d53['shift']());}}}(a129_0x50aa,0x52582));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';function a129_0x5b83(_0x580bc5,_0x4f9edb){_0x580bc5=_0x580bc5-0x175;const _0x50aa54=a129_0x50aa();let _0x5b8378=_0x50aa54[_0x580bc5];return _0x5b8378;}async function getTargetSqlQueries(_0x41b7ef,_0x1eff87,_0x250095){const _0x1a067a=a129_0x5b83,_0xb83e71=await scanLocalSqlQueries(_0x41b7ef),_0x5e56b2=new Map();for(const _0x49103c of _0xb83e71){if(_0x250095&&_0x49103c[_0x1a067a(0x1a1)]!==_0x250095)continue;const _0x43c2ea=_0x5e56b2[_0x1a067a(0x179)](_0x49103c[_0x1a067a(0x1a1)])??[];_0x43c2ea[_0x1a067a(0x1af)](_0x49103c),_0x5e56b2['set'](_0x49103c[_0x1a067a(0x1a1)],_0x43c2ea);}if(_0x250095&&!_0x5e56b2[_0x1a067a(0x178)](_0x250095))throw CliErrors[_0x1a067a(0x1ba)](_0x1a067a(0x1ab)+_0x250095);const _0x62f44d=[];for(const [_0x6f5e92,_0x1e64a7]of _0x5e56b2[_0x1a067a(0x18a)]()){if(_0x1e64a7['length']===0x1){_0x62f44d[_0x1a067a(0x1af)](_0x1e64a7[0x0]);continue;}const _0x5f339d=_0x1eff87['sqls'][_0x6f5e92],_0x13edeb=_0x5f339d?.[_0x1a067a(0x190)],_0x5756f1=_0x13edeb?_0x1e64a7[_0x1a067a(0x1ac)](_0x1c089a=>_0x1c089a['relativePath']!==_0x13edeb):_0x1e64a7;if(_0x5f339d&&_0x5756f1[_0x1a067a(0x18c)]===0x1){_0x62f44d['push'](_0x5756f1[0x0]);continue;}throw CliErrors[_0x1a067a(0x1ba)](_0x1a067a(0x192)+_0x6f5e92+_0x1a067a(0x19c));}return _0x62f44d;}export const sqlPush={'service':'sql','command':a129_0x2cdf91(0x1af),'description':a129_0x2cdf91(0x188),'risk':a129_0x2cdf91(0x177),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a129_0x2cdf91(0x18b),'type':a129_0x2cdf91(0x1ae),'description':a129_0x2cdf91(0x1a0)}],async 'dryRun'(_0x186181){const _0x16bfab=a129_0x2cdf91,_0x2b9abf=loadSqlProjectConfig(_0x186181[_0x16bfab(0x1b4)]),_0x520849=await readSqlLockFile(_0x2b9abf[_0x16bfab(0x1b6)]),{appLock:_0x4ca04d}=ensureSqlLockScope(_0x520849??createEmptySqlLock(),_0x186181[_0x16bfab(0x1b4)],_0x2b9abf[_0x16bfab(0x18f)],_0x16bfab(0x1af)),_0xe9dcbc=await getTargetSqlQueries(_0x2b9abf,_0x4ca04d,_0x186181[_0x16bfab(0x1b3)](_0x16bfab(0x18d))||undefined),_0x930814=[];for(const _0x2522fa of _0xe9dcbc){const _0x431ff6=await computeSqlFileHash(_0x2522fa[_0x16bfab(0x17d)]),_0x255810=_0x4ca04d[_0x16bfab(0x1ad)][_0x2522fa[_0x16bfab(0x1a1)]],_0x1ed86b=!!_0x255810&&(_0x255810['path']!==_0x2522fa[_0x16bfab(0x197)]||!!_0x2522fa[_0x16bfab(0x17f)]&&_0x255810['sqlName']!==_0x2522fa[_0x16bfab(0x17f)]);if(!_0x186181[_0x16bfab(0x180)](_0x16bfab(0x18b))&&_0x255810&&_0x255810[_0x16bfab(0x1b5)]===_0x431ff6&&!_0x1ed86b)continue;_0x930814[_0x16bfab(0x1af)](_0x2522fa[_0x16bfab(0x1a1)]);}return{'method':_0x16bfab(0x176),'url':_0x16bfab(0x19a),'body':{'sqlCodes':_0x930814,'appCode':_0x186181[_0x16bfab(0x1b4)]},'description':_0x16bfab(0x19e)+_0x930814[_0x16bfab(0x18c)]+_0x16bfab(0x18e)};},async 'execute'(_0x99d084){const _0x9631d5=a129_0x2cdf91,_0x3f481a=loadSqlProjectConfig(_0x99d084[_0x9631d5(0x1b4)]),_0xef8719=await readSqlLockFile(_0x3f481a[_0x9631d5(0x1b6)]),{lockData:_0x3c394d,appLock:_0x38132b}=ensureSqlLockScope(_0xef8719??createEmptySqlLock(),_0x99d084[_0x9631d5(0x1b4)],_0x3f481a['sqlRoot'],_0x9631d5(0x1af)),_0x4fa5f0=await getTargetSqlQueries(_0x3f481a,_0x38132b,_0x99d084['str'](_0x9631d5(0x18d))||undefined);if(_0x4fa5f0[_0x9631d5(0x18c)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':'No\x20local\x20SQL\x20files\x20found.'};const _0x552bad=[],_0x30bb43=[],_0x4ed446=[];for(const _0x26755c of _0x4fa5f0){const _0x53c967=_0x38132b[_0x9631d5(0x1ad)][_0x26755c[_0x9631d5(0x1a1)]];if(!_0x53c967){_0x4ed446['push']({'sqlCode':_0x26755c[_0x9631d5(0x1a1)],'error':_0x9631d5(0x1b7)});continue;}try{const _0x9f3946=await computeSqlFileHash(_0x26755c[_0x9631d5(0x17d)]),_0xae1c7=_0x53c967['path']!==_0x26755c[_0x9631d5(0x197)]||!!_0x26755c[_0x9631d5(0x17f)]&&_0x53c967['sqlName']!==_0x26755c['sqlName'];if(!_0x99d084['bool'](_0x9631d5(0x18b))&&_0x53c967['hash']===_0x9f3946&&!_0xae1c7){_0x30bb43['push']({'sqlCode':_0x26755c[_0x9631d5(0x1a1)],'reason':_0x9631d5(0x17e)});continue;}if(_0x53c967[_0x9631d5(0x195)]==null){_0x4ed446[_0x9631d5(0x1af)]({'sqlCode':_0x26755c[_0x9631d5(0x1a1)],'error':'missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first'});continue;}const _0x375f03=await readFile(_0x26755c[_0x9631d5(0x17d)],_0x9631d5(0x1a5)),_0x444d59=stripLocalSqlMetadata(_0x375f03,_0x26755c[_0x9631d5(0x1b9)]),_0x5af140=_0x26755c['sqlName']||_0x53c967['sqlName'],_0x5624c3=await resolveTargetDbBinding(_0x99d084['appCode'],_0x26755c,_0x53c967),_0x514444=await updateSqlQuery({'id':_0x53c967['remoteId'],'appCode':_0x99d084['appCode'],'sqlCode':_0x26755c[_0x9631d5(0x1a1)],'sqlName':_0x5af140,'dbId':_0x5624c3['dbId'],'version':_0x53c967['version'],'sqlContent':_0x444d59,'sqlConfig':_0x53c967[_0x9631d5(0x1aa)]??undefined}),_0x1a5094=_0x514444[_0x9631d5(0x186)]?await getDbName(_0x99d084['appCode'],Number(_0x514444[_0x9631d5(0x186)]))[_0x9631d5(0x196)](()=>_0x5624c3[_0x9631d5(0x1b0)]):_0x5624c3[_0x9631d5(0x1b0)];_0x38132b['sqls'][_0x26755c[_0x9631d5(0x1a1)]]={...buildSqlLockEntry(_0x514444,_0x444d59,_0x9f3946,{'dbName':_0x1a5094}),'path':_0x26755c['relativePath'],'mode':_0x53c967[_0x9631d5(0x1b9)]},await archivePreviousSqlFileIfNeeded(_0x3f481a,_0x53c967[_0x9631d5(0x190)],_0x26755c['relativePath']),_0x552bad[_0x9631d5(0x1af)]({'sqlCode':_0x26755c[_0x9631d5(0x1a1)],'remoteId':_0x53c967[_0x9631d5(0x1a4)]});}catch(_0x4b23df){_0x4ed446['push']({'sqlCode':_0x26755c[_0x9631d5(0x1a1)],'error':_0x4b23df instanceof Error?_0x4b23df['message']:String(_0x4b23df)});}}return _0x38132b[_0x9631d5(0x19f)]=new Date()['toISOString'](),await writeSqlLockFile(_0x3f481a[_0x9631d5(0x1b6)],_0x3c394d),{'ok':_0x4ed446[_0x9631d5(0x18c)]===0x0,'data':{'pushed':_0x552bad,'skipped':_0x30bb43,'failed':_0x4ed446},'message':_0x9631d5(0x1a6)+_0x552bad[_0x9631d5(0x18c)]+_0x9631d5(0x1b1)+_0x30bb43[_0x9631d5(0x18c)]+_0x9631d5(0x198)+_0x4ed446['length']+_0x9631d5(0x1b2)};}};async function archivePreviousSqlFileIfNeeded(_0x28998b,_0x1f46db,_0x1991da){const _0x4e7dd8=a129_0x2cdf91;if(!_0x1f46db||_0x1f46db===_0x1991da)return;const _0x1c6538=join(_0x28998b[_0x4e7dd8(0x1a7)],_0x1f46db);if(!await fileExists(_0x1c6538))return;const _0x5a77aa=await moveToTrash(_0x28998b[_0x4e7dd8(0x183)],_0x28998b[_0x4e7dd8(0x19b)],_0x1c6538);await cleanupEmptyDirectories(dirname(_0x1c6538),_0x28998b[_0x4e7dd8(0x1a7)]),void _0x5a77aa;}async function moveToTrash(_0x35701c,_0x429111,_0x561c73){const _0x371afe=new Date()['toISOString']()['replace'](/[:.]/g,'-'),_0x2db237=relative(_0x35701c,_0x561c73),_0x1d4bfe=join(_0x429111,_0x371afe,_0x2db237);return await mkdir(dirname(_0x1d4bfe),{'recursive':!![]}),await rename(_0x561c73,_0x1d4bfe),_0x1d4bfe;}function a129_0x50aa(){const _0xcdbcd=['startsWith','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','33SISzJU','873oKCmeW','version','catch','relativePath','\x20skipped,\x20','300fFiWGI','/smartapi/custom/updateUserCustomSql','trashDir','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','92604lErDDo','Would\x20push\x20','lastSync','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','sqlCode','5opndUK','map','remoteId','utf8','Push\x20complete:\x20','sqlRootDir','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','10370iLcgRU','sqlConfig','Local\x20SQL\x20not\x20found:\x20','filter','sqls','boolean','push','dbName','\x20pushed,\x20','\x20failed','str','appCode','hash','lockFilePath','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','exec','mode','validation','3286600manzfu','POST','high-risk-write','has','get','7yaXgwD','2202324SLllBJ','385957biSBzf','filePath','unchanged','sqlName','bool','2182232tJOEFo','303937ekMsew','projectRoot','No\x20database\x20matches\x20local\x20directory\x20\x22','Local\x20directory\x20\x22','dbId','\x22\x20for\x20sqlCode\x20','Push\x20local\x20SQL\x20files\x20to\x20remote','isFinite','entries','force','length','sqlcode','\x20SQL\x20file(s)','sqlRoot','path'];a129_0x50aa=function(){return _0xcdbcd;};return a129_0x50aa();}async function cleanupEmptyDirectories(_0x10da0c,_0x12fb97){const _0x499f19=a129_0x2cdf91;let _0x52f890=resolve(_0x10da0c);const _0x1174cf=resolve(_0x12fb97);while(_0x52f890[_0x499f19(0x191)](''+_0x1174cf+sep)||_0x52f890===_0x1174cf){if(_0x52f890===_0x1174cf)return;try{const _0x48a1fb=await readdir(_0x52f890);if(_0x48a1fb[_0x499f19(0x18c)]>0x0)return;await rmdir(_0x52f890);}catch{return;}_0x52f890=dirname(_0x52f890);}}async function resolveTargetDbBinding(_0xda2a58,_0x395795,_0x47a87c){const _0x33a3c6=a129_0x2cdf91,_0x4c270e=_0x395795['dbDirectory'];if(!_0x4c270e)return{'dbId':_0x47a87c['dbId'],'dbName':_0x47a87c[_0x33a3c6(0x1b0)]};const _0x126bc7=buildDbDirectoryName(_0x47a87c[_0x33a3c6(0x1b0)],_0x47a87c[_0x33a3c6(0x186)]);if(_0x4c270e===_0x126bc7)return{'dbId':_0x47a87c[_0x33a3c6(0x186)],'dbName':_0x47a87c[_0x33a3c6(0x1b0)]};const _0x539754=parseExplicitDbDirectory(_0x4c270e);if(_0x539754!=null)return{'dbId':_0x539754,'dbName':await getDbName(_0xda2a58,_0x539754)['catch'](()=>undefined)};const _0x2b86cf=await listDatabases(_0xda2a58),_0x9eba44=_0x2b86cf[_0x33a3c6(0x1ac)](_0x48dbff=>buildDbDirectoryName(_0x48dbff[_0x33a3c6(0x1b0)],_0x48dbff[_0x33a3c6(0x186)])===_0x4c270e);if(_0x9eba44[_0x33a3c6(0x18c)]===0x1)return{'dbId':_0x9eba44[0x0][_0x33a3c6(0x186)],'dbName':_0x9eba44[0x0][_0x33a3c6(0x1b0)]};if(_0x9eba44['length']===0x0)throw CliErrors[_0x33a3c6(0x1ba)](_0x33a3c6(0x184)+_0x4c270e+_0x33a3c6(0x187)+_0x395795['sqlCode']+'.');const _0x206dd1=_0x9eba44[_0x33a3c6(0x1a3)](_0x2cf331=>_0x2cf331['dbName']+'\x20('+_0x2cf331[_0x33a3c6(0x186)]+')')['join'](',\x20');throw CliErrors[_0x33a3c6(0x1ba)](_0x33a3c6(0x185)+_0x4c270e+_0x33a3c6(0x1a8)+_0x395795[_0x33a3c6(0x1a1)]+':\x20'+_0x206dd1);}function parseExplicitDbDirectory(_0xf18756){const _0x569ea0=a129_0x2cdf91,_0x959229=/^db-(\d+)$/[_0x569ea0(0x1b8)](_0xf18756);if(!_0x959229)return null;const _0x43051e=Number(_0x959229[0x1]);return Number[_0x569ea0(0x189)](_0x43051e)&&_0x43051e>0x0?_0x43051e:null;}
1
+ const a129_0x13dab6=a129_0x543d;(function(_0x54ec09,_0x3fbb95){const _0x4e1efc=a129_0x543d,_0x4ae4ab=_0x54ec09();while(!![]){try{const _0x68775e=-parseInt(_0x4e1efc(0x178))/0x1+parseInt(_0x4e1efc(0x16f))/0x2+parseInt(_0x4e1efc(0x17e))/0x3*(parseInt(_0x4e1efc(0x18e))/0x4)+parseInt(_0x4e1efc(0x169))/0x5*(-parseInt(_0x4e1efc(0x168))/0x6)+parseInt(_0x4e1efc(0x17a))/0x7*(-parseInt(_0x4e1efc(0x160))/0x8)+parseInt(_0x4e1efc(0x161))/0x9+parseInt(_0x4e1efc(0x187))/0xa*(parseInt(_0x4e1efc(0x17b))/0xb);if(_0x68775e===_0x3fbb95)break;else _0x4ae4ab['push'](_0x4ae4ab['shift']());}catch(_0x5225d8){_0x4ae4ab['push'](_0x4ae4ab['shift']());}}}(a129_0x4308,0x9700b));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';function a129_0x4308(){const _0x13cc5d=['1057xAZJZj','22IJwlMt','/smartapi/custom/updateUserCustomSql','sqls','8502MaEZRy','sqlRoot','dbDirectory','appCode','catch','\x20skipped,\x20','path','\x20pushed,\x20','sqlRootDir','2608090gLfmcs','Would\x20push\x20','validation','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','sqlConfig','push','remoteId','652qHBUmE','Push\x20local\x20SQL\x20files\x20to\x20remote','entries','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','No\x20local\x20SQL\x20files\x20found.','Local\x20SQL\x20not\x20found:\x20','Local\x20directory\x20\x22','sqlcode','relativePath','join','unchanged','lastSync','sqlName','\x20failed','sqlCode','\x22\x20for\x20sqlCode\x20','trashDir','length','message','isFinite','dbId','44896zpPFjQ','9808569JVVuns','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','dbName','projectRoot','Push\x20complete:\x20','str','replace','2536554nnmyOr','5QweDCY','boolean','set','toISOString','lockFilePath','force','802570FysRKP','exec','map','hash','has','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','filePath','get','mode','586008CAshJZ','filter'];a129_0x4308=function(){return _0x13cc5d;};return a129_0x4308();}import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a129_0x543d(_0x4b6684,_0x444aac){_0x4b6684=_0x4b6684-0x14c;const _0x4308e7=a129_0x4308();let _0x543d17=_0x4308e7[_0x4b6684];return _0x543d17;}import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x2a28b9,_0x4cb643,_0x257254){const _0x3edfe7=a129_0x543d,_0x56d25a=await scanLocalSqlQueries(_0x2a28b9),_0x17ea98=new Map();for(const _0x29e79c of _0x56d25a){if(_0x257254&&_0x29e79c[_0x3edfe7(0x159)]!==_0x257254)continue;const _0x2a172b=_0x17ea98[_0x3edfe7(0x176)](_0x29e79c[_0x3edfe7(0x159)])??[];_0x2a172b[_0x3edfe7(0x18c)](_0x29e79c),_0x17ea98[_0x3edfe7(0x16b)](_0x29e79c[_0x3edfe7(0x159)],_0x2a172b);}if(_0x257254&&!_0x17ea98[_0x3edfe7(0x173)](_0x257254))throw CliErrors[_0x3edfe7(0x189)](_0x3edfe7(0x150)+_0x257254);const _0x1604c7=[];for(const [_0x566e1b,_0x41ed3a]of _0x17ea98[_0x3edfe7(0x14d)]()){if(_0x41ed3a[_0x3edfe7(0x15c)]===0x1){_0x1604c7[_0x3edfe7(0x18c)](_0x41ed3a[0x0]);continue;}const _0x5909bc=_0x4cb643[_0x3edfe7(0x17d)][_0x566e1b],_0x3f4227=_0x5909bc?.[_0x3edfe7(0x184)],_0x345ede=_0x3f4227?_0x41ed3a[_0x3edfe7(0x179)](_0x48e77f=>_0x48e77f['relativePath']!==_0x3f4227):_0x41ed3a;if(_0x5909bc&&_0x345ede[_0x3edfe7(0x15c)]===0x1){_0x1604c7['push'](_0x345ede[0x0]);continue;}throw CliErrors[_0x3edfe7(0x189)](_0x3edfe7(0x174)+_0x566e1b+_0x3edfe7(0x18a));}return _0x1604c7;}export const sqlPush={'service':'sql','command':a129_0x13dab6(0x18c),'description':a129_0x13dab6(0x14c),'risk':'high-risk-write','flags':[SQLCODE_FLAG_OPTIONAL,{'name':'force','type':a129_0x13dab6(0x16a),'description':a129_0x13dab6(0x14e)}],async 'dryRun'(_0x5647eb){const _0x2af581=a129_0x13dab6,_0x566270=loadSqlProjectConfig(_0x5647eb['appCode']),_0x432877=await readSqlLockFile(_0x566270[_0x2af581(0x16d)]),{appLock:_0x4d138b}=ensureSqlLockScope(_0x432877??createEmptySqlLock(),_0x5647eb[_0x2af581(0x181)],_0x566270[_0x2af581(0x17f)],_0x2af581(0x18c)),_0x1363b6=await getTargetSqlQueries(_0x566270,_0x4d138b,_0x5647eb[_0x2af581(0x166)]('sqlcode')||undefined),_0x51233b=[];for(const _0x45c03c of _0x1363b6){const _0x346010=await computeSqlFileHash(_0x45c03c[_0x2af581(0x175)]),_0x3eaa41=_0x4d138b[_0x2af581(0x17d)][_0x45c03c[_0x2af581(0x159)]],_0x4b7759=!!_0x3eaa41&&(_0x3eaa41[_0x2af581(0x184)]!==_0x45c03c['relativePath']||!!_0x45c03c[_0x2af581(0x157)]&&_0x3eaa41[_0x2af581(0x157)]!==_0x45c03c[_0x2af581(0x157)]);if(!_0x5647eb['bool'](_0x2af581(0x16e))&&_0x3eaa41&&_0x3eaa41[_0x2af581(0x172)]===_0x346010&&!_0x4b7759)continue;_0x51233b[_0x2af581(0x18c)](_0x45c03c[_0x2af581(0x159)]);}return{'method':'POST','url':_0x2af581(0x17c),'body':{'sqlCodes':_0x51233b,'appCode':_0x5647eb[_0x2af581(0x181)]},'description':_0x2af581(0x188)+_0x51233b[_0x2af581(0x15c)]+'\x20SQL\x20file(s)'};},async 'execute'(_0x3ecb48){const _0x20adb2=a129_0x13dab6,_0x20b279=loadSqlProjectConfig(_0x3ecb48[_0x20adb2(0x181)]),_0x20e0de=await readSqlLockFile(_0x20b279['lockFilePath']),{lockData:_0x16db8c,appLock:_0x3cf53e}=ensureSqlLockScope(_0x20e0de??createEmptySqlLock(),_0x3ecb48[_0x20adb2(0x181)],_0x20b279[_0x20adb2(0x17f)],_0x20adb2(0x18c)),_0x2913c5=await getTargetSqlQueries(_0x20b279,_0x3cf53e,_0x3ecb48[_0x20adb2(0x166)](_0x20adb2(0x152))||undefined);if(_0x2913c5[_0x20adb2(0x15c)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x20adb2(0x14f)};const _0x1b58d8=[],_0x4f8a8f=[],_0x196d1d=[];for(const _0x253ce4 of _0x2913c5){const _0x1e8576=_0x3cf53e[_0x20adb2(0x17d)][_0x253ce4[_0x20adb2(0x159)]];if(!_0x1e8576){_0x196d1d[_0x20adb2(0x18c)]({'sqlCode':_0x253ce4[_0x20adb2(0x159)],'error':'local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first'});continue;}try{const _0x406a5a=await computeSqlFileHash(_0x253ce4[_0x20adb2(0x175)]),_0x45f849=_0x1e8576[_0x20adb2(0x184)]!==_0x253ce4[_0x20adb2(0x153)]||!!_0x253ce4[_0x20adb2(0x157)]&&_0x1e8576['sqlName']!==_0x253ce4[_0x20adb2(0x157)];if(!_0x3ecb48['bool']('force')&&_0x1e8576[_0x20adb2(0x172)]===_0x406a5a&&!_0x45f849){_0x4f8a8f[_0x20adb2(0x18c)]({'sqlCode':_0x253ce4[_0x20adb2(0x159)],'reason':_0x20adb2(0x155)});continue;}if(_0x1e8576['version']==null){_0x196d1d[_0x20adb2(0x18c)]({'sqlCode':_0x253ce4['sqlCode'],'error':'missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first'});continue;}const _0xd24cae=await readFile(_0x253ce4[_0x20adb2(0x175)],'utf8'),_0x2ac5cd=stripLocalSqlMetadata(_0xd24cae,_0x253ce4[_0x20adb2(0x177)]),_0x53db37=_0x253ce4[_0x20adb2(0x157)]||_0x1e8576[_0x20adb2(0x157)],_0x8f2518=await resolveTargetDbBinding(_0x3ecb48[_0x20adb2(0x181)],_0x253ce4,_0x1e8576),_0x244054=await updateSqlQuery({'id':_0x1e8576['remoteId'],'appCode':_0x3ecb48[_0x20adb2(0x181)],'sqlCode':_0x253ce4[_0x20adb2(0x159)],'sqlName':_0x53db37,'dbId':_0x8f2518[_0x20adb2(0x15f)],'version':_0x1e8576['version'],'sqlContent':_0x2ac5cd,'sqlConfig':_0x1e8576[_0x20adb2(0x18b)]??undefined}),_0x323f46=_0x244054[_0x20adb2(0x15f)]?await getDbName(_0x3ecb48[_0x20adb2(0x181)],Number(_0x244054['dbId']))[_0x20adb2(0x182)](()=>_0x8f2518[_0x20adb2(0x163)]):_0x8f2518['dbName'];_0x3cf53e[_0x20adb2(0x17d)][_0x253ce4[_0x20adb2(0x159)]]={...buildSqlLockEntry(_0x244054,_0x2ac5cd,_0x406a5a,{'dbName':_0x323f46}),'path':_0x253ce4[_0x20adb2(0x153)],'mode':_0x1e8576[_0x20adb2(0x177)]},await archivePreviousSqlFileIfNeeded(_0x20b279,_0x1e8576[_0x20adb2(0x184)],_0x253ce4['relativePath']),_0x1b58d8[_0x20adb2(0x18c)]({'sqlCode':_0x253ce4['sqlCode'],'remoteId':_0x1e8576[_0x20adb2(0x18d)]});}catch(_0x251c8a){_0x196d1d[_0x20adb2(0x18c)]({'sqlCode':_0x253ce4[_0x20adb2(0x159)],'error':_0x251c8a instanceof Error?_0x251c8a[_0x20adb2(0x15d)]:String(_0x251c8a)});}}return _0x3cf53e[_0x20adb2(0x156)]=new Date()[_0x20adb2(0x16c)](),await writeSqlLockFile(_0x20b279['lockFilePath'],_0x16db8c),{'ok':_0x196d1d[_0x20adb2(0x15c)]===0x0,'data':{'pushed':_0x1b58d8,'skipped':_0x4f8a8f,'failed':_0x196d1d},'message':_0x20adb2(0x165)+_0x1b58d8[_0x20adb2(0x15c)]+_0x20adb2(0x185)+_0x4f8a8f[_0x20adb2(0x15c)]+_0x20adb2(0x183)+_0x196d1d[_0x20adb2(0x15c)]+_0x20adb2(0x158)};}};async function archivePreviousSqlFileIfNeeded(_0x587ed2,_0x3b46d3,_0x295e8e){const _0x2168a9=a129_0x13dab6;if(!_0x3b46d3||_0x3b46d3===_0x295e8e)return;const _0x3d74ee=join(_0x587ed2[_0x2168a9(0x186)],_0x3b46d3);if(!await fileExists(_0x3d74ee))return;const _0x532597=await moveToTrash(_0x587ed2[_0x2168a9(0x164)],_0x587ed2[_0x2168a9(0x15b)],_0x3d74ee);await cleanupEmptyDirectories(dirname(_0x3d74ee),_0x587ed2[_0x2168a9(0x186)]),void _0x532597;}async function moveToTrash(_0x49f302,_0x3942ab,_0xc5078b){const _0x3beaeb=a129_0x13dab6,_0xec40f6=new Date()[_0x3beaeb(0x16c)]()[_0x3beaeb(0x167)](/[:.]/g,'-'),_0x1d40c7=relative(_0x49f302,_0xc5078b),_0x50a7cf=join(_0x3942ab,_0xec40f6,_0x1d40c7);return await mkdir(dirname(_0x50a7cf),{'recursive':!![]}),await rename(_0xc5078b,_0x50a7cf),_0x50a7cf;}async function cleanupEmptyDirectories(_0x4b057c,_0x28a57e){let _0x2c8c19=resolve(_0x4b057c);const _0x5d2315=resolve(_0x28a57e);while(_0x2c8c19['startsWith'](''+_0x5d2315+sep)||_0x2c8c19===_0x5d2315){if(_0x2c8c19===_0x5d2315)return;try{const _0x41734c=await readdir(_0x2c8c19);if(_0x41734c['length']>0x0)return;await rmdir(_0x2c8c19);}catch{return;}_0x2c8c19=dirname(_0x2c8c19);}}async function resolveTargetDbBinding(_0x462961,_0xc6240,_0xd27483){const _0x6ad936=a129_0x13dab6,_0xf8be02=_0xc6240[_0x6ad936(0x180)];if(!_0xf8be02)return{'dbId':_0xd27483['dbId'],'dbName':_0xd27483[_0x6ad936(0x163)]};const _0x3fe79f=buildDbDirectoryName(_0xd27483[_0x6ad936(0x163)],_0xd27483['dbId']);if(_0xf8be02===_0x3fe79f)return{'dbId':_0xd27483[_0x6ad936(0x15f)],'dbName':_0xd27483[_0x6ad936(0x163)]};const _0x10a2b4=parseExplicitDbDirectory(_0xf8be02);if(_0x10a2b4!=null)return{'dbId':_0x10a2b4,'dbName':await getDbName(_0x462961,_0x10a2b4)[_0x6ad936(0x182)](()=>undefined)};const _0x561ebb=await listDatabases(_0x462961),_0xf6ad4a=_0x561ebb[_0x6ad936(0x179)](_0x209712=>buildDbDirectoryName(_0x209712[_0x6ad936(0x163)],_0x209712[_0x6ad936(0x15f)])===_0xf8be02);if(_0xf6ad4a[_0x6ad936(0x15c)]===0x1)return{'dbId':_0xf6ad4a[0x0][_0x6ad936(0x15f)],'dbName':_0xf6ad4a[0x0]['dbName']};if(_0xf6ad4a['length']===0x0)throw CliErrors['validation']('No\x20database\x20matches\x20local\x20directory\x20\x22'+_0xf8be02+_0x6ad936(0x15a)+_0xc6240[_0x6ad936(0x159)]+'.');const _0x294996=_0xf6ad4a[_0x6ad936(0x171)](_0x4b7a9b=>_0x4b7a9b[_0x6ad936(0x163)]+'\x20('+_0x4b7a9b[_0x6ad936(0x15f)]+')')[_0x6ad936(0x154)](',\x20');throw CliErrors[_0x6ad936(0x189)](_0x6ad936(0x151)+_0xf8be02+_0x6ad936(0x162)+_0xc6240['sqlCode']+':\x20'+_0x294996);}function parseExplicitDbDirectory(_0x245baf){const _0xa5671f=a129_0x13dab6,_0xb85142=/^db-(\d+)$/[_0xa5671f(0x170)](_0x245baf);if(!_0xb85142)return null;const _0x47a6ec=Number(_0xb85142[0x1]);return Number[_0xa5671f(0x15e)](_0x47a6ec)&&_0x47a6ec>0x0?_0x47a6ec:null;}
@@ -1 +1 @@
1
- const a130_0x410c60=a130_0x45f5;function a130_0x45f5(_0x3feb04,_0x22eeb6){_0x3feb04=_0x3feb04-0x126;const _0x54888=a130_0x5488();let _0x45f558=_0x54888[_0x3feb04];return _0x45f558;}function a130_0x5488(){const _0xf88057=['869136eRqGuj','save','5OSzYto','348984BWKHtN','776260curhlq','285573ISKvMA','validation','write','description','3120dMTZfU','sqlname','Create\x20new\x20SQL\x20with\x20`rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml`.','Query\x20description','Deprecated:\x20use\x20sql\x20create\x20to\x20create\x20and\x20sql\x20push\x20to\x20update','sql','191795wkqTho','`rabetbase\x20sql\x20save`\x20has\x20been\x20deprecated.','406XtWVsS','file','318340aGjuwy','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`.','join','string','Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)'];a130_0x5488=function(){return _0xf88057;};return a130_0x5488();}(function(_0x241a94,_0x509e07){const _0x5ed2ba=a130_0x45f5,_0x3ad031=_0x241a94();while(!![]){try{const _0x46312b=parseInt(_0x5ed2ba(0x12c))/0x1+-parseInt(_0x5ed2ba(0x130))/0x2+parseInt(_0x5ed2ba(0x13a))/0x3+parseInt(_0x5ed2ba(0x139))/0x4*(parseInt(_0x5ed2ba(0x137))/0x5)+-parseInt(_0x5ed2ba(0x135))/0x6+parseInt(_0x5ed2ba(0x12e))/0x7*(-parseInt(_0x5ed2ba(0x126))/0x8)+-parseInt(_0x5ed2ba(0x138))/0x9;if(_0x46312b===_0x509e07)break;else _0x3ad031['push'](_0x3ad031['shift']());}catch(_0x386f54){_0x3ad031['push'](_0x3ad031['shift']());}}}(a130_0x5488,0x1c3ad));import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';const SQL_SAVE_DEPRECATED_HINT=[a130_0x410c60(0x12d),a130_0x410c60(0x128),a130_0x410c60(0x131)][a130_0x410c60(0x132)]('\x0a');export const sqlSave={'service':a130_0x410c60(0x12b),'command':a130_0x410c60(0x136),'description':a130_0x410c60(0x12a),'risk':a130_0x410c60(0x13c),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a130_0x410c60(0x12f),'type':a130_0x410c60(0x133),'required':!![],'description':'Path\x20to\x20the\x20SQL\x20file'},SQLCODE_FLAG_OPTIONAL,{'name':a130_0x410c60(0x127),'type':a130_0x410c60(0x133),'description':'SQL\x20query\x20display\x20name'},{'name':'db','type':a130_0x410c60(0x133),'description':a130_0x410c60(0x134)},{'name':a130_0x410c60(0x13d),'type':'string','description':a130_0x410c60(0x129)}],async 'validate'(){const _0x51fe4e=a130_0x410c60;throw CliErrors[_0x51fe4e(0x13b)](SQL_SAVE_DEPRECATED_HINT);},async 'execute'(){throw CliErrors['validation'](SQL_SAVE_DEPRECATED_HINT);}};
1
+ const a130_0x4813a0=a130_0x285d;function a130_0x285d(_0x1539d6,_0x258169){_0x1539d6=_0x1539d6-0xe5;const _0x91b2a6=a130_0x91b2();let _0x285d5d=_0x91b2a6[_0x1539d6];return _0x285d5d;}(function(_0x12d802,_0x3796ef){const _0x35188c=a130_0x285d,_0x4e0fbd=_0x12d802();while(!![]){try{const _0x2b42dc=parseInt(_0x35188c(0xfc))/0x1*(parseInt(_0x35188c(0xee))/0x2)+parseInt(_0x35188c(0xed))/0x3*(-parseInt(_0x35188c(0xeb))/0x4)+-parseInt(_0x35188c(0xf1))/0x5*(-parseInt(_0x35188c(0xf0))/0x6)+-parseInt(_0x35188c(0xe7))/0x7*(parseInt(_0x35188c(0xfb))/0x8)+parseInt(_0x35188c(0xe9))/0x9*(parseInt(_0x35188c(0xef))/0xa)+parseInt(_0x35188c(0xf5))/0xb*(parseInt(_0x35188c(0xfd))/0xc)+-parseInt(_0x35188c(0xfe))/0xd*(parseInt(_0x35188c(0xe5))/0xe);if(_0x2b42dc===_0x3796ef)break;else _0x4e0fbd['push'](_0x4e0fbd['shift']());}catch(_0x2bbad9){_0x4e0fbd['push'](_0x4e0fbd['shift']());}}}(a130_0x91b2,0xcec75));import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';const SQL_SAVE_DEPRECATED_HINT=[a130_0x4813a0(0xf6),a130_0x4813a0(0xf7),'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`.'][a130_0x4813a0(0xf2)]('\x0a');function a130_0x91b2(){const _0x496b10=['48747fMKjar','573958iNbCXi','1419330wvUfED','12mQcFlX','3793975SoKszP','join','Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)','SQL\x20query\x20display\x20name','4521tEIBLF','`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`.','write','validation','file','8JuKBPQ','2MxUaHQ','22068jwmQVU','7946029aZKngK','70kbyuHv','sql','922481oUQRMk','sqlname','99CWhWBQ','string','92krHJXS','Query\x20description'];a130_0x91b2=function(){return _0x496b10;};return a130_0x91b2();}export const sqlSave={'service':a130_0x4813a0(0xe6),'command':'save','description':'Deprecated:\x20use\x20sql\x20create\x20to\x20create\x20and\x20sql\x20push\x20to\x20update','risk':a130_0x4813a0(0xf8),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a130_0x4813a0(0xfa),'type':a130_0x4813a0(0xea),'required':!![],'description':'Path\x20to\x20the\x20SQL\x20file'},SQLCODE_FLAG_OPTIONAL,{'name':a130_0x4813a0(0xe8),'type':'string','description':a130_0x4813a0(0xf4)},{'name':'db','type':'string','description':a130_0x4813a0(0xf3)},{'name':'description','type':a130_0x4813a0(0xea),'description':a130_0x4813a0(0xec)}],async 'validate'(){const _0x5264c1=a130_0x4813a0;throw CliErrors[_0x5264c1(0xf9)](SQL_SAVE_DEPRECATED_HINT);},async 'execute'(){const _0x5868c3=a130_0x4813a0;throw CliErrors[_0x5868c3(0xf9)](SQL_SAVE_DEPRECATED_HINT);}};
@@ -1 +1 @@
1
- function a131_0x3a44(){const _0x9719d0=['3232755nrpcDo','stderr','endsWith','join','6336IrtCLd','8704377hOkqln','8397xIYFLz','sqlConfig','map','10JSANjr','572284HJgflU','push','--\x20@lovrabet.','stdin','entries','7662MOaXHr','trimStart','description','341002qbdfIN','dbId','trim','mode','sqlCode','6JpIljj','.rabetbase/sql','apps','question','syncedAt','\x20[y/N]\x20','test','mybatisXml','includes','path','length','dbName','version','2039700BLAphj','sqlName','5313pUfyNV','filter'];a131_0x3a44=function(){return _0x9719d0;};return a131_0x3a44();}const a131_0x91b36d=a131_0x415b;function a131_0x415b(_0x340713,_0x183b7b){_0x340713=_0x340713-0xba;const _0x3a44eb=a131_0x3a44();let _0x415b1a=_0x3a44eb[_0x340713];return _0x415b1a;}(function(_0x245d20,_0x19db63){const _0x124588=a131_0x415b,_0x398ae5=_0x245d20();while(!![]){try{const _0x231c2f=-parseInt(_0x124588(0xbb))/0x1+parseInt(_0x124588(0xcd))/0x2+-parseInt(_0x124588(0xc0))/0x3*(parseInt(_0x124588(0xdb))/0x4)+-parseInt(_0x124588(0xd1))/0x5+-parseInt(_0x124588(0xe0))/0x6*(-parseInt(_0x124588(0xcf))/0x7)+-parseInt(_0x124588(0xd5))/0x8*(-parseInt(_0x124588(0xd7))/0x9)+-parseInt(_0x124588(0xda))/0xa*(parseInt(_0x124588(0xd6))/0xb);if(_0x231c2f===_0x19db63)break;else _0x398ae5['push'](_0x398ae5['shift']());}catch(_0x2538bd){_0x398ae5['push'](_0x398ae5['shift']());}}}(a131_0x3a44,0xa1df3));import{createInterface}from'node:readline';import{join}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';export const SQL_LOCAL_REL_DIR=a131_0x91b36d(0xc1);export function buildSqlLockEntry(_0x40db47,_0x211558,_0x531ba2,_0x14ded){const _0x4fb825=a131_0x91b36d,_0x48a3e7=detectSqlMode(_0x211558);return{'path':buildSqlRelativePath(_0x40db47[_0x4fb825(0xbf)],_0x40db47[_0x4fb825(0xce)],_0x14ded?.[_0x4fb825(0xcb)],_0x48a3e7,_0x40db47['dbId']),'hash':_0x531ba2,'remoteId':_0x40db47['id'],'version':_0x40db47[_0x4fb825(0xcc)],'dbId':Number(_0x40db47['dbId']),'dbName':_0x14ded?.[_0x4fb825(0xcb)],'sqlName':_0x40db47['sqlName'],'sqlConfig':_0x40db47[_0x4fb825(0xd8)]??undefined,'mode':_0x48a3e7};}export function cloneSqlLockData(_0xd036bd){const _0x38aa73=a131_0x91b36d;return{'apps':Object['fromEntries'](Object[_0x38aa73(0xdf)](_0xd036bd[_0x38aa73(0xc2)])['map'](([_0x3117db,_0x152928])=>[_0x3117db,{'sqlRoot':_0x152928['sqlRoot'],'lastSync':_0x152928['lastSync'],'sqls':{..._0x152928['sqls']}}]))};}export function ensureRemoteSqlContent(_0x1da5f2){return _0x1da5f2['sqlContent']??'';}export function buildLocalSqlFileContent(_0x27a509,_0xe7178b,_0x366138){const _0x5b0e46=a131_0x91b36d,_0x39d66c=_0x366138?.[_0x5b0e46(0xbe)]??detectSqlMode(_0xe7178b),_0x425107=stripLocalSqlMetadata(_0xe7178b,_0x39d66c)[_0x5b0e46(0xbd)](),_0x288827=[...buildMetadataHeaderLines({'sqlCode':_0x27a509[_0x5b0e46(0xbf)],'sqlName':_0x27a509[_0x5b0e46(0xce)],'dbId':_0x27a509[_0x5b0e46(0xbc)],'dbName':_0x366138?.['dbName'],'mode':_0x39d66c,'syncedAt':_0x366138?.[_0x5b0e46(0xc4)],'description':_0x366138?.[_0x5b0e46(0xba)]},_0x39d66c),'',_0x425107],_0x9f1519=_0x288827[_0x5b0e46(0xd4)]('\x0a');return _0x9f1519[_0x5b0e46(0xd3)]('\x0a')?_0x9f1519:_0x9f1519+'\x0a';}export function stripLocalSqlMetadata(_0x473833,_0x5a8bc4){const _0x55f289=a131_0x91b36d,_0x405cc8=_0x473833['replace'](/\r\n/g,'\x0a')['split']('\x0a'),_0x4b24f3=[];let _0x2e2a42=0x0;if(_0x5a8bc4===_0x55f289(0xc7))while(_0x2e2a42<_0x405cc8[_0x55f289(0xca)]){const _0x3595ce=_0x405cc8[_0x2e2a42]??'';if(/^\s*<!--\s*@lovrabet\./[_0x55f289(0xc6)](_0x3595ce)){_0x2e2a42++;continue;}if(_0x3595ce[_0x55f289(0xbd)]()===''&&_0x2e2a42>0x0){_0x2e2a42++;continue;}break;}else while(_0x2e2a42<_0x405cc8['length']){const _0x1d24d5=_0x405cc8[_0x2e2a42]??'';if(/^\s*--\s*@lovrabet\./[_0x55f289(0xc6)](_0x1d24d5)){_0x2e2a42++;continue;}if(_0x1d24d5['trim']()===''&&_0x2e2a42>0x0){_0x2e2a42++;continue;}break;}for(;_0x2e2a42<_0x405cc8[_0x55f289(0xca)];_0x2e2a42++){_0x4b24f3[_0x55f289(0xdc)](_0x405cc8[_0x2e2a42]);}return _0x4b24f3[_0x55f289(0xd4)]('\x0a')[_0x55f289(0xe1)]();}export function resolveSqlMode(_0x2dccf3,_0x2c12f7){const _0xcaf27c=a131_0x91b36d;if(_0x2c12f7?.[_0xcaf27c(0xbe)])return _0x2c12f7['mode'];return detectSqlMode(_0x2dccf3);}export function resolveSqlFileName(_0x1a70ea,_0x24c9b4,_0x8d0f9a){const _0x2345b4=a131_0x91b36d;if(_0x8d0f9a?.[_0x2345b4(0xc9)])return _0x8d0f9a[_0x2345b4(0xc9)];if(_0x8d0f9a?.[_0x2345b4(0xce)]||_0x8d0f9a?.[_0x2345b4(0xcb)])return buildSqlRelativePath(_0x1a70ea,_0x8d0f9a?.[_0x2345b4(0xce)],_0x8d0f9a?.[_0x2345b4(0xcb)],resolveSqlMode(_0x24c9b4,_0x8d0f9a),_0x8d0f9a?.['dbId']);return buildDefaultSqlFileName(_0x1a70ea,resolveSqlMode(_0x24c9b4,_0x8d0f9a));}export function resolveSqlLocalDir(_0x384802,_0xdb0c78){return join(_0x384802,SQL_LOCAL_REL_DIR,_0xdb0c78);}export async function confirmForceOverwrite(_0x294352){const _0x19cdf0=a131_0x91b36d,_0x4a3177=createInterface({'input':process[_0x19cdf0(0xde)],'output':process[_0x19cdf0(0xd2)]}),_0xb36d59=await new Promise(_0x232287=>{const _0x50dc69=_0x19cdf0;_0x4a3177[_0x50dc69(0xc3)](_0x294352+_0x50dc69(0xc5),_0x232287);});return _0x4a3177['close'](),['y','yes'][_0x19cdf0(0xc8)](_0xb36d59[_0x19cdf0(0xbd)]()['toLowerCase']());}export function findSqlLockScope(_0x6d43a6,_0x3ec5e5){const _0x21e383=a131_0x91b36d;return _0x6d43a6[_0x21e383(0xc2)][_0x3ec5e5];}function buildMetadataHeaderLines(_0x3a1dd2,_0x30c0f6){const _0x56c6d7=a131_0x91b36d,_0x2d180d=[['sqlCode',_0x3a1dd2['sqlCode']],[_0x56c6d7(0xce),_0x3a1dd2[_0x56c6d7(0xce)]],[_0x56c6d7(0xbc),_0x3a1dd2[_0x56c6d7(0xbc)]],[_0x56c6d7(0xcb),_0x3a1dd2['dbName']],[_0x56c6d7(0xbe),_0x3a1dd2[_0x56c6d7(0xbe)]],['syncedAt',_0x3a1dd2[_0x56c6d7(0xc4)]],[_0x56c6d7(0xba),_0x3a1dd2[_0x56c6d7(0xba)]]];if(_0x30c0f6===_0x56c6d7(0xc7))return _0x2d180d[_0x56c6d7(0xd0)](([,_0x121666])=>_0x121666!==undefined&&_0x121666!==null&&String(_0x121666)['trim']()!=='')[_0x56c6d7(0xd9)](([_0xb7d4f7,_0x1d9250])=>'<!--\x20@lovrabet.'+_0xb7d4f7+':\x20'+String(_0x1d9250)+'\x20-->');return _0x2d180d[_0x56c6d7(0xd0)](([,_0x2d0945])=>_0x2d0945!==undefined&&_0x2d0945!==null&&String(_0x2d0945)['trim']()!=='')['map'](([_0x1a8c85,_0x2e35d9])=>_0x56c6d7(0xdd)+_0x1a8c85+':\x20'+String(_0x2e35d9));}
1
+ const a131_0x2c98af=a131_0x3f7f;(function(_0x4fcdc5,_0xe192d8){const _0x4c7453=a131_0x3f7f,_0x5b401c=_0x4fcdc5();while(!![]){try{const _0x51635=parseInt(_0x4c7453(0x1b6))/0x1+parseInt(_0x4c7453(0x1b3))/0x2*(-parseInt(_0x4c7453(0x1c2))/0x3)+-parseInt(_0x4c7453(0x1b5))/0x4+-parseInt(_0x4c7453(0x1ca))/0x5+-parseInt(_0x4c7453(0x1a2))/0x6+parseInt(_0x4c7453(0x1ac))/0x7*(-parseInt(_0x4c7453(0x1ae))/0x8)+parseInt(_0x4c7453(0x1ad))/0x9;if(_0x51635===_0xe192d8)break;else _0x5b401c['push'](_0x5b401c['shift']());}catch(_0x343c21){_0x5b401c['push'](_0x5b401c['shift']());}}}(a131_0x1f1d,0xc8b74));import{createInterface}from'node:readline';import{join}from'node:path';function a131_0x1f1d(){const _0x5a6ccf=['apps','850460WxDWFV','test','dbName','lastSync','129000ywzqxh','split','--\x20@lovrabet.','entries','map','<!--\x20@lovrabet.','fromEntries','length','endsWith','sqlConfig','140SQIQZF','27742050dBTzCU','206824aXMaqW','path','syncedAt','stderr','trim','2UnJGen','includes','2542468eLJefF','417465XCTBXm','question','\x20[y/N]\x20','stdin','dbId','trimStart','description','sqlCode','join','toLowerCase','close','sqlName','4000542nabDJx','version','.rabetbase/sql','filter','mybatisXml','mode','\x20-->'];a131_0x1f1d=function(){return _0x5a6ccf;};return a131_0x1f1d();}import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';export const SQL_LOCAL_REL_DIR=a131_0x2c98af(0x1c4);export function buildSqlLockEntry(_0x3aa6fd,_0x5628ae,_0x5bb0b6,_0x1d58f5){const _0x5e7057=a131_0x2c98af,_0x46c9c0=detectSqlMode(_0x5628ae);return{'path':buildSqlRelativePath(_0x3aa6fd[_0x5e7057(0x1bd)],_0x3aa6fd['sqlName'],_0x1d58f5?.[_0x5e7057(0x1cc)],_0x46c9c0,_0x3aa6fd[_0x5e7057(0x1ba)]),'hash':_0x5bb0b6,'remoteId':_0x3aa6fd['id'],'version':_0x3aa6fd[_0x5e7057(0x1c3)],'dbId':Number(_0x3aa6fd['dbId']),'dbName':_0x1d58f5?.[_0x5e7057(0x1cc)],'sqlName':_0x3aa6fd[_0x5e7057(0x1c1)],'sqlConfig':_0x3aa6fd[_0x5e7057(0x1ab)]??undefined,'mode':_0x46c9c0};}export function cloneSqlLockData(_0x402125){const _0x2bc1f7=a131_0x2c98af;return{'apps':Object[_0x2bc1f7(0x1a8)](Object[_0x2bc1f7(0x1a5)](_0x402125[_0x2bc1f7(0x1c9)])[_0x2bc1f7(0x1a6)](([_0x55a639,_0x3086d5])=>[_0x55a639,{'sqlRoot':_0x3086d5['sqlRoot'],'lastSync':_0x3086d5[_0x2bc1f7(0x1a1)],'sqls':{..._0x3086d5['sqls']}}]))};}export function ensureRemoteSqlContent(_0x332efb){return _0x332efb['sqlContent']??'';}export function buildLocalSqlFileContent(_0x57de72,_0x114116,_0x4edac7){const _0x4798e6=a131_0x2c98af,_0x857e3d=_0x4edac7?.[_0x4798e6(0x1c7)]??detectSqlMode(_0x114116),_0x59c142=stripLocalSqlMetadata(_0x114116,_0x857e3d)['trim'](),_0x55a89a=[...buildMetadataHeaderLines({'sqlCode':_0x57de72[_0x4798e6(0x1bd)],'sqlName':_0x57de72[_0x4798e6(0x1c1)],'dbId':_0x57de72['dbId'],'dbName':_0x4edac7?.[_0x4798e6(0x1cc)],'mode':_0x857e3d,'syncedAt':_0x4edac7?.['syncedAt'],'description':_0x4edac7?.[_0x4798e6(0x1bc)]},_0x857e3d),'',_0x59c142],_0x47d5b0=_0x55a89a[_0x4798e6(0x1be)]('\x0a');return _0x47d5b0[_0x4798e6(0x1aa)]('\x0a')?_0x47d5b0:_0x47d5b0+'\x0a';}export function stripLocalSqlMetadata(_0x45ce47,_0x48cd79){const _0x20439d=a131_0x2c98af,_0x548432=_0x45ce47['replace'](/\r\n/g,'\x0a')[_0x20439d(0x1a3)]('\x0a'),_0x3df404=[];let _0x210b4f=0x0;if(_0x48cd79===_0x20439d(0x1c6))while(_0x210b4f<_0x548432[_0x20439d(0x1a9)]){const _0x139ab1=_0x548432[_0x210b4f]??'';if(/^\s*<!--\s*@lovrabet\./['test'](_0x139ab1)){_0x210b4f++;continue;}if(_0x139ab1[_0x20439d(0x1b2)]()===''&&_0x210b4f>0x0){_0x210b4f++;continue;}break;}else while(_0x210b4f<_0x548432[_0x20439d(0x1a9)]){const _0x22b8a7=_0x548432[_0x210b4f]??'';if(/^\s*--\s*@lovrabet\./[_0x20439d(0x1cb)](_0x22b8a7)){_0x210b4f++;continue;}if(_0x22b8a7[_0x20439d(0x1b2)]()===''&&_0x210b4f>0x0){_0x210b4f++;continue;}break;}for(;_0x210b4f<_0x548432[_0x20439d(0x1a9)];_0x210b4f++){_0x3df404['push'](_0x548432[_0x210b4f]);}return _0x3df404[_0x20439d(0x1be)]('\x0a')[_0x20439d(0x1bb)]();}export function resolveSqlMode(_0x205e91,_0xbee340){const _0x578967=a131_0x2c98af;if(_0xbee340?.[_0x578967(0x1c7)])return _0xbee340[_0x578967(0x1c7)];return detectSqlMode(_0x205e91);}export function resolveSqlFileName(_0x4dcea8,_0x2041d1,_0x357634){const _0xa1faa7=a131_0x2c98af;if(_0x357634?.[_0xa1faa7(0x1af)])return _0x357634['path'];if(_0x357634?.[_0xa1faa7(0x1c1)]||_0x357634?.[_0xa1faa7(0x1cc)])return buildSqlRelativePath(_0x4dcea8,_0x357634?.[_0xa1faa7(0x1c1)],_0x357634?.[_0xa1faa7(0x1cc)],resolveSqlMode(_0x2041d1,_0x357634),_0x357634?.['dbId']);return buildDefaultSqlFileName(_0x4dcea8,resolveSqlMode(_0x2041d1,_0x357634));}function a131_0x3f7f(_0x1619f1,_0x2e9af4){_0x1619f1=_0x1619f1-0x1a1;const _0x1f1da4=a131_0x1f1d();let _0x3f7f20=_0x1f1da4[_0x1619f1];return _0x3f7f20;}export function resolveSqlLocalDir(_0xb352a3,_0x16dca6){return join(_0xb352a3,SQL_LOCAL_REL_DIR,_0x16dca6);}export async function confirmForceOverwrite(_0x3c2437){const _0x267bba=a131_0x2c98af,_0x323186=createInterface({'input':process[_0x267bba(0x1b9)],'output':process[_0x267bba(0x1b1)]}),_0x368a1e=await new Promise(_0x2bef75=>{const _0x43912e=_0x267bba;_0x323186[_0x43912e(0x1b7)](_0x3c2437+_0x43912e(0x1b8),_0x2bef75);});return _0x323186[_0x267bba(0x1c0)](),['y','yes'][_0x267bba(0x1b4)](_0x368a1e['trim']()[_0x267bba(0x1bf)]());}export function findSqlLockScope(_0xe20ee0,_0x46dea6){const _0x163301=a131_0x2c98af;return _0xe20ee0[_0x163301(0x1c9)][_0x46dea6];}function buildMetadataHeaderLines(_0x587cb3,_0x2c5ce7){const _0x1a2dc7=a131_0x2c98af,_0xfe1905=[[_0x1a2dc7(0x1bd),_0x587cb3[_0x1a2dc7(0x1bd)]],[_0x1a2dc7(0x1c1),_0x587cb3[_0x1a2dc7(0x1c1)]],['dbId',_0x587cb3[_0x1a2dc7(0x1ba)]],[_0x1a2dc7(0x1cc),_0x587cb3[_0x1a2dc7(0x1cc)]],[_0x1a2dc7(0x1c7),_0x587cb3['mode']],[_0x1a2dc7(0x1b0),_0x587cb3[_0x1a2dc7(0x1b0)]],[_0x1a2dc7(0x1bc),_0x587cb3[_0x1a2dc7(0x1bc)]]];if(_0x2c5ce7===_0x1a2dc7(0x1c6))return _0xfe1905[_0x1a2dc7(0x1c5)](([,_0xadeb8])=>_0xadeb8!==undefined&&_0xadeb8!==null&&String(_0xadeb8)[_0x1a2dc7(0x1b2)]()!=='')[_0x1a2dc7(0x1a6)](([_0x323f74,_0x4948df])=>_0x1a2dc7(0x1a7)+_0x323f74+':\x20'+String(_0x4948df)+_0x1a2dc7(0x1c8));return _0xfe1905[_0x1a2dc7(0x1c5)](([,_0x1cf98f])=>_0x1cf98f!==undefined&&_0x1cf98f!==null&&String(_0x1cf98f)[_0x1a2dc7(0x1b2)]()!=='')[_0x1a2dc7(0x1a6)](([_0x3c70bd,_0x3aa38e])=>_0x1a2dc7(0x1a4)+_0x3c70bd+':\x20'+String(_0x3aa38e));}
@@ -1 +1 @@
1
- const a132_0x76ad84=a132_0x1ddf;function a132_0x5078(){const _0x3151ac=['3031640ZiWYdM','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','\x20added,\x20','relativePath','paging','sql','lockFilePath','27153YoBKYk','filePath','1102548PwveIK','bool','\x20modified,\x20','remote','lockKey','3OEGHBj','sqlCode','totalCount','length','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','797ZeGPuq','531dFJTed','sqls','517605OzeLSh','22MTSgwW','\x20unchanged','546prhlQr','36336HFcCQP','tableData','appCode','sqlName','map','hash','status','\x20missing,\x20','push','237596EvxrDf','680obnNVU','sqlRoot','keys'];a132_0x5078=function(){return _0x3151ac;};return a132_0x5078();}(function(_0x271fb6,_0x7800ef){const _0x5b4ddc=a132_0x1ddf,_0x1a7890=_0x271fb6();while(!![]){try{const _0x4cddb0=-parseInt(_0x5b4ddc(0x1bd))/0x1*(-parseInt(_0x5b4ddc(0x1ce))/0x2)+-parseInt(_0x5b4ddc(0x1b8))/0x3*(-parseInt(_0x5b4ddc(0x1cd))/0x4)+parseInt(_0x5b4ddc(0x1c0))/0x5+-parseInt(_0x5b4ddc(0x1c3))/0x6*(parseInt(_0x5b4ddc(0x1d8))/0x7)+-parseInt(_0x5b4ddc(0x1c4))/0x8*(-parseInt(_0x5b4ddc(0x1be))/0x9)+-parseInt(_0x5b4ddc(0x1d1))/0xa+-parseInt(_0x5b4ddc(0x1c1))/0xb*(-parseInt(_0x5b4ddc(0x1da))/0xc);if(_0x4cddb0===_0x7800ef)break;else _0x1a7890['push'](_0x1a7890['shift']());}catch(_0x48dca1){_0x1a7890['push'](_0x1a7890['shift']());}}}(a132_0x5078,0x3806b));import{listSqlQueries}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';function a132_0x1ddf(_0x3ea74f,_0x5c2975){_0x3ea74f=_0x3ea74f-0x1b8;const _0x507884=a132_0x5078();let _0x1ddf7d=_0x507884[_0x3ea74f];return _0x1ddf7d;}import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;async function fetchAllSqlCodes(_0x48f36e){const _0x5665e3=a132_0x1ddf,_0xecee0f=[];let _0x46b5ab=0x1;while(!![]){const _0x35fbb5=await listSqlQueries(_0x48f36e,{'currentPage':_0x46b5ab,'pageSize':PAGE_SIZE}),_0x25e0cc=_0x35fbb5[_0x5665e3(0x1c5)]??[];_0xecee0f['push'](..._0x25e0cc[_0x5665e3(0x1c8)](_0xeb73eb=>_0xeb73eb[_0x5665e3(0x1b9)]));if(_0x25e0cc[_0x5665e3(0x1bb)]===0x0)break;const _0x2a671b=_0x35fbb5[_0x5665e3(0x1d5)]?.[_0x5665e3(0x1ba)];if(_0x2a671b!=null?_0xecee0f[_0x5665e3(0x1bb)]>=_0x2a671b:_0x25e0cc['length']<PAGE_SIZE)break;_0x46b5ab++;}return _0xecee0f;}export const sqlStatus={'service':a132_0x76ad84(0x1d6),'command':a132_0x76ad84(0x1ca),'description':a132_0x76ad84(0x1bc),'risk':'read','flags':[{'name':a132_0x76ad84(0x1dd),'type':'boolean','description':a132_0x76ad84(0x1d2)}],async 'execute'(_0x557094){const _0x34b345=a132_0x76ad84,_0x230f01=loadSqlProjectConfig(_0x557094[_0x34b345(0x1c6)]),_0x4880ae=await readSqlLockFile(_0x230f01[_0x34b345(0x1d7)]),{appLock:_0x9a992c}=ensureSqlLockScope(_0x4880ae??createEmptySqlLock(),_0x230f01['appCode'],_0x230f01[_0x34b345(0x1cf)],_0x34b345(0x1ca)),_0x5b4435=await scanLocalSqlQueries(_0x230f01),_0x541dda=[],_0xa83b4c=[],_0x5e7781=[],_0x39a2ac=[],_0x31a68e=new Set(_0x5b4435[_0x34b345(0x1c8)](_0xba1775=>_0xba1775[_0x34b345(0x1de)]));for(const _0x3a02e4 of _0x5b4435){const _0x1f3ec6=await computeSqlFileHash(_0x3a02e4[_0x34b345(0x1d9)]),_0x590cb8=_0x9a992c[_0x34b345(0x1bf)][_0x3a02e4[_0x34b345(0x1de)]],_0x11c9de=!!_0x590cb8&&_0x590cb8['path']!==_0x3a02e4[_0x34b345(0x1d4)],_0x4cea75=!!_0x590cb8&&!!_0x3a02e4[_0x34b345(0x1c7)]&&_0x590cb8['sqlName']!==_0x3a02e4[_0x34b345(0x1c7)];if(!_0x590cb8)_0x541dda['push'](_0x3a02e4[_0x34b345(0x1de)]);else _0x590cb8[_0x34b345(0x1c9)]!==_0x1f3ec6||_0x11c9de||_0x4cea75?_0xa83b4c[_0x34b345(0x1cc)](_0x3a02e4['lockKey']):_0x5e7781[_0x34b345(0x1cc)](_0x3a02e4[_0x34b345(0x1de)]);}for(const _0x22de37 of Object[_0x34b345(0x1d0)](_0x9a992c[_0x34b345(0x1bf)])){!_0x31a68e['has'](_0x22de37)&&_0x39a2ac[_0x34b345(0x1cc)](_0x22de37);}const _0x2dd6ed=[];if(_0x557094[_0x34b345(0x1db)](_0x34b345(0x1dd))){const _0x2e56d4=await fetchAllSqlCodes(_0x557094['appCode']);for(const _0x2911ed of _0x2e56d4){!_0x31a68e['has'](_0x2911ed)&&!_0x9a992c['sqls'][_0x2911ed]&&_0x2dd6ed[_0x34b345(0x1cc)](_0x2911ed);}}const _0x1dd5cb=_0x541dda[_0x34b345(0x1bb)]===0x0&&_0xa83b4c[_0x34b345(0x1bb)]===0x0&&_0x39a2ac[_0x34b345(0x1bb)]===0x0&&_0x2dd6ed[_0x34b345(0x1bb)]===0x0;return{'ok':!![],'data':{'added':_0x541dda,'modified':_0xa83b4c,'missing':_0x39a2ac,'unchanged':_0x5e7781,'remoteOnly':_0x2dd6ed},'message':_0x1dd5cb?'All\x20SQL\x20queries\x20are\x20in\x20sync.':_0x541dda['length']+_0x34b345(0x1d3)+_0xa83b4c[_0x34b345(0x1bb)]+_0x34b345(0x1dc)+_0x39a2ac[_0x34b345(0x1bb)]+_0x34b345(0x1cb)+_0x5e7781[_0x34b345(0x1bb)]+_0x34b345(0x1c2)+(_0x2dd6ed[_0x34b345(0x1bb)]>0x0?',\x20'+_0x2dd6ed['length']+'\x20remote-only':'')};}};
1
+ function a132_0x564a(_0x150a51,_0x1a4b12){_0x150a51=_0x150a51-0x191;const _0x4778e2=a132_0x4778();let _0x564a2d=_0x4778e2[_0x150a51];return _0x564a2d;}const a132_0x177c0f=a132_0x564a;(function(_0x73dcb1,_0x51f332){const _0x3c6f5b=a132_0x564a,_0xa6afe9=_0x73dcb1();while(!![]){try{const _0x5e7df8=-parseInt(_0x3c6f5b(0x1a9))/0x1+parseInt(_0x3c6f5b(0x1a4))/0x2*(-parseInt(_0x3c6f5b(0x1ab))/0x3)+parseInt(_0x3c6f5b(0x196))/0x4*(-parseInt(_0x3c6f5b(0x195))/0x5)+parseInt(_0x3c6f5b(0x19f))/0x6*(parseInt(_0x3c6f5b(0x1ac))/0x7)+-parseInt(_0x3c6f5b(0x197))/0x8*(-parseInt(_0x3c6f5b(0x198))/0x9)+parseInt(_0x3c6f5b(0x193))/0xa+parseInt(_0x3c6f5b(0x1b3))/0xb;if(_0x5e7df8===_0x51f332)break;else _0xa6afe9['push'](_0xa6afe9['shift']());}catch(_0x455b04){_0xa6afe9['push'](_0xa6afe9['shift']());}}}(a132_0x4778,0xd1008));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(_0x147d7a){const _0xaf9110=a132_0x564a,_0x172ae7=[];let _0x34f713=0x1;while(!![]){const _0x3a4ae1=await listSqlQueries(_0x147d7a,{'currentPage':_0x34f713,'pageSize':PAGE_SIZE}),_0x2a73b1=_0x3a4ae1[_0xaf9110(0x1b5)]??[];_0x172ae7[_0xaf9110(0x1af)](..._0x2a73b1['map'](_0x4c97c2=>_0x4c97c2[_0xaf9110(0x1ad)]));if(_0x2a73b1[_0xaf9110(0x19d)]===0x0)break;const _0x8322=_0x3a4ae1[_0xaf9110(0x192)]?.['totalCount'];if(_0x8322!=null?_0x172ae7[_0xaf9110(0x19d)]>=_0x8322:_0x2a73b1[_0xaf9110(0x19d)]<PAGE_SIZE)break;_0x34f713++;}return _0x172ae7;}function a132_0x4778(){const _0x2081ff=['sqls','length','\x20missing,\x20','911562luzXRC','\x20unchanged','path','remote','bool','2eWQzNR','sqlRoot','filePath','relativePath','read','1346869gMXsLk','\x20remote-only','3537447ElFNoq','7ewPdCE','sqlCode','sql','push','has','appCode','\x20modified,\x20','37060925cgtSDz','status','tableData','sqlName','paging','5544110kMvmQJ','lockKey','767420MwdGdp','32toVkyg','8kJnhFw','4810041XRhEfJ','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','keys','\x20added,\x20'];a132_0x4778=function(){return _0x2081ff;};return a132_0x4778();}export const sqlStatus={'service':a132_0x177c0f(0x1ae),'command':a132_0x177c0f(0x1b4),'description':a132_0x177c0f(0x199),'risk':a132_0x177c0f(0x1a8),'flags':[{'name':a132_0x177c0f(0x1a2),'type':'boolean','description':'Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally'}],async 'execute'(_0x314eab){const _0x5975b5=a132_0x177c0f,_0x3cf3e7=loadSqlProjectConfig(_0x314eab[_0x5975b5(0x1b1)]),_0x477822=await readSqlLockFile(_0x3cf3e7['lockFilePath']),{appLock:_0x5bc346}=ensureSqlLockScope(_0x477822??createEmptySqlLock(),_0x3cf3e7[_0x5975b5(0x1b1)],_0x3cf3e7[_0x5975b5(0x1a5)],'status'),_0x2b5152=await scanLocalSqlQueries(_0x3cf3e7),_0x495879=[],_0x3454f2=[],_0x230f9b=[],_0x350563=[],_0x2a02ca=new Set(_0x2b5152['map'](_0x3b8285=>_0x3b8285[_0x5975b5(0x194)]));for(const _0xff57f7 of _0x2b5152){const _0xdbd78c=await computeSqlFileHash(_0xff57f7[_0x5975b5(0x1a6)]),_0xbe1f9b=_0x5bc346[_0x5975b5(0x19c)][_0xff57f7['lockKey']],_0x1f9f40=!!_0xbe1f9b&&_0xbe1f9b[_0x5975b5(0x1a1)]!==_0xff57f7[_0x5975b5(0x1a7)],_0x56e243=!!_0xbe1f9b&&!!_0xff57f7[_0x5975b5(0x191)]&&_0xbe1f9b[_0x5975b5(0x191)]!==_0xff57f7[_0x5975b5(0x191)];if(!_0xbe1f9b)_0x495879[_0x5975b5(0x1af)](_0xff57f7[_0x5975b5(0x194)]);else _0xbe1f9b['hash']!==_0xdbd78c||_0x1f9f40||_0x56e243?_0x3454f2[_0x5975b5(0x1af)](_0xff57f7[_0x5975b5(0x194)]):_0x230f9b[_0x5975b5(0x1af)](_0xff57f7[_0x5975b5(0x194)]);}for(const _0x108cec of Object[_0x5975b5(0x19a)](_0x5bc346[_0x5975b5(0x19c)])){!_0x2a02ca[_0x5975b5(0x1b0)](_0x108cec)&&_0x350563[_0x5975b5(0x1af)](_0x108cec);}const _0x1c2d9b=[];if(_0x314eab[_0x5975b5(0x1a3)]('remote')){const _0x58f097=await fetchAllSqlCodes(_0x314eab[_0x5975b5(0x1b1)]);for(const _0x1d0c7a of _0x58f097){!_0x2a02ca['has'](_0x1d0c7a)&&!_0x5bc346[_0x5975b5(0x19c)][_0x1d0c7a]&&_0x1c2d9b[_0x5975b5(0x1af)](_0x1d0c7a);}}const _0x61d95d=_0x495879[_0x5975b5(0x19d)]===0x0&&_0x3454f2[_0x5975b5(0x19d)]===0x0&&_0x350563[_0x5975b5(0x19d)]===0x0&&_0x1c2d9b[_0x5975b5(0x19d)]===0x0;return{'ok':!![],'data':{'added':_0x495879,'modified':_0x3454f2,'missing':_0x350563,'unchanged':_0x230f9b,'remoteOnly':_0x1c2d9b},'message':_0x61d95d?'All\x20SQL\x20queries\x20are\x20in\x20sync.':_0x495879[_0x5975b5(0x19d)]+_0x5975b5(0x19b)+_0x3454f2[_0x5975b5(0x19d)]+_0x5975b5(0x1b2)+_0x350563['length']+_0x5975b5(0x19e)+_0x230f9b[_0x5975b5(0x19d)]+_0x5975b5(0x1a0)+(_0x1c2d9b['length']>0x0?',\x20'+_0x1c2d9b[_0x5975b5(0x19d)]+_0x5975b5(0x1aa):'')};}};
@@ -1 +1 @@
1
- const a133_0x11d929=a133_0xd071;(function(_0x1a0079,_0x181bd1){const _0x347dc2=a133_0xd071,_0x440f26=_0x1a0079();while(!![]){try{const _0x3732bb=-parseInt(_0x347dc2(0x1d9))/0x1+parseInt(_0x347dc2(0x203))/0x2+-parseInt(_0x347dc2(0x202))/0x3+-parseInt(_0x347dc2(0x1d8))/0x4*(parseInt(_0x347dc2(0x1ff))/0x5)+-parseInt(_0x347dc2(0x200))/0x6+parseInt(_0x347dc2(0x1fa))/0x7*(-parseInt(_0x347dc2(0x1de))/0x8)+-parseInt(_0x347dc2(0x1d3))/0x9*(-parseInt(_0x347dc2(0x1dd))/0xa);if(_0x3732bb===_0x181bd1)break;else _0x440f26['push'](_0x440f26['shift']());}catch(_0x3b2326){_0x440f26['push'](_0x440f26['shift']());}}}(a133_0x44ec,0x4e893));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{assertDatasetIsDbTableBacked,filterDbTableBackedDatasets}from'../../commands/dataset/capability.js';function a133_0x44ec(){const _0x462612=['schemaWarnings','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','message','2155qlSWhU','1969056uccRCi','flagMissing','1571601jLlcfA','1025514hEFwWB','file','name','2043xzZgqH','filter','from','toLowerCase','isArray','5672LzIdXv','147627kVzgQI','dbtableConfig','map','SQL\x20schema\x20validation','78220XLCdcu','320WIwJvz','valid','validate','length','push','isDangerous','trim','Table\x20\x22','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','isSelectOnly','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','sql','fields','str','string','\x22\x20not\x20found\x20or\x20not\x20accessible','tables','Provide\x20--file\x20or\x20--sql','type','Dataset\x20\x22','reason','File\x20not\x20found:\x20','sqlType','schemas','tableName','cwd','\x22\x20not\x20found\x20in\x20any\x20dataset','parameters','62272fmqLyu','validation'];a133_0x44ec=function(){return _0x462612;};return a133_0x44ec();}function a133_0xd071(_0x5ac3da,_0x181f72){_0x5ac3da=_0x5ac3da-0x1d3;const _0x44ece8=a133_0x44ec();let _0xd07162=_0x44ece8[_0x5ac3da];return _0xd07162;}export const sqlValidate={'service':a133_0x11d929(0x1e9),'command':a133_0x11d929(0x1e0),'description':a133_0x11d929(0x1fd),'risk':'read','flags':[{'name':a133_0x11d929(0x204),'type':a133_0x11d929(0x1ec),'description':a133_0x11d929(0x1e6)},{'name':a133_0x11d929(0x1e9),'type':a133_0x11d929(0x1ec),'description':a133_0x11d929(0x1e8)},{'name':'schemas','type':'string','description':'Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against'}],async 'execute'(_0x5b4808){const _0x334957=a133_0x11d929,_0x138333=_0x5b4808[_0x334957(0x1eb)](_0x334957(0x204)),_0xe70a1d=_0x5b4808[_0x334957(0x1eb)](_0x334957(0x1e9));if(!_0x138333&&!_0xe70a1d)throw CliErrors[_0x334957(0x201)](_0x334957(0x204),_0x334957(0x1ef));let _0x102197;if(_0x138333){const _0x3b3c4c=resolve(process[_0x334957(0x1f7)](),_0x138333);if(!existsSync(_0x3b3c4c))throw CliErrors[_0x334957(0x1fb)](_0x334957(0x1f3)+_0x3b3c4c);_0x102197=readFileSync(_0x3b3c4c,'utf-8');}else _0x102197=_0xe70a1d;const _0x522ad7=validateSql(_0x102197),_0x2b8d34={'valid':_0x522ad7[_0x334957(0x1df)],'sqlType':_0x522ad7['sqlType'][_0x334957(0x1f0)],'isSelectOnly':_0x522ad7['sqlType'][_0x334957(0x1e7)],'isDangerous':_0x522ad7[_0x334957(0x1f4)][_0x334957(0x1e3)],'tables':_0x522ad7[_0x334957(0x1ee)],'parameters':_0x522ad7[_0x334957(0x1f9)],'message':_0x522ad7[_0x334957(0x1fe)]};_0x522ad7[_0x334957(0x1f4)][_0x334957(0x1f2)]&&(_0x2b8d34[_0x334957(0x1f2)]=_0x522ad7[_0x334957(0x1f4)][_0x334957(0x1f2)]);const _0x3d5b4a=_0x5b4808[_0x334957(0x1eb)](_0x334957(0x1f5));if(_0x3d5b4a&&_0x522ad7['valid']){const _0x34a686=_0x3d5b4a['split'](',')[_0x334957(0x1db)](_0x4662a8=>_0x4662a8[_0x334957(0x1e4)]())[_0x334957(0x1d4)](Boolean),_0x6cd47d=[],_0x4fd4e7=filterDbTableBackedDatasets(await listDatasets(_0x5b4808['appCode'])),_0x1f7d8f=new Map(_0x4fd4e7[_0x334957(0x1db)](_0x313fe8=>[_0x313fe8[_0x334957(0x1da)]?.[_0x334957(0x1f6)]?.[_0x334957(0x1d6)](),_0x313fe8]));for(const _0x4dbc37 of _0x522ad7[_0x334957(0x1ee)]){const _0x1ce944=_0x1f7d8f['get'](_0x4dbc37[_0x334957(0x1d6)]());!_0x1ce944&&_0x6cd47d[_0x334957(0x1e2)](_0x334957(0x1e5)+_0x4dbc37+_0x334957(0x1f8));}for(const _0x3322d4 of _0x34a686){let _0x21daf0;try{_0x21daf0=await getDatasetDetail(_0x3322d4);}catch{_0x6cd47d[_0x334957(0x1e2)](_0x334957(0x1f1)+_0x3322d4+_0x334957(0x1ed));continue;}assertDatasetIsDbTableBacked(_0x21daf0,_0x334957(0x1dc));const _0x503381=Array[_0x334957(0x1d7)](_0x21daf0[_0x334957(0x1ea)])?_0x21daf0[_0x334957(0x1ea)]:[],_0x286d3e=new Set(_0x503381[_0x334957(0x1db)](_0x38ba9d=>_0x38ba9d[_0x334957(0x205)]?.[_0x334957(0x1d6)]())),_0x49a7e6=_0x21daf0[_0x334957(0x1da)]?.[_0x334957(0x1f6)]||_0x21daf0[_0x334957(0x1f6)]||_0x3322d4;_0x2b8d34['schema:'+_0x49a7e6]={'code':_0x3322d4,'tableName':_0x49a7e6,'fieldCount':_0x286d3e['size'],'fields':Array[_0x334957(0x1d5)](_0x286d3e)};}_0x6cd47d[_0x334957(0x1e1)]>0x0&&(_0x2b8d34[_0x334957(0x1fc)]=_0x6cd47d);}return{'ok':_0x522ad7[_0x334957(0x1df)],'data':_0x2b8d34,'message':_0x522ad7['message']};}};
1
+ const a133_0x28b140=a133_0x35a0;function a133_0x1dc6(){const _0x8b3023=['toLowerCase','filter','Provide\x20--file\x20or\x20--sql','isArray','push','validate','type','sql','isDangerous','valid','utf-8','reason','str','18dhjgLn','file','1716770DIbUZl','140991DDZUSL','cwd','isSelectOnly','7292956AOqQZx','schemas','size','12niCwlo','tableName','381670oyeQeA','sqlType','tables','Dataset\x20\x22','2656200rNtpZG','length','2hXZrul','212876qLdIsl','from','trim','read','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','validation','12LFfTdJ','File\x20not\x20found:\x20','split','map','message','dbtableConfig','18tYWuRK','fields','72590qPYqiY','schema:','schemaWarnings','string','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','\x22\x20not\x20found\x20in\x20any\x20dataset'];a133_0x1dc6=function(){return _0x8b3023;};return a133_0x1dc6();}(function(_0x41b84b,_0x39755f){const _0x35f6e3=a133_0x35a0,_0x416000=_0x41b84b();while(!![]){try{const _0x72b766=parseInt(_0x35f6e3(0x170))/0x1*(parseInt(_0x35f6e3(0x171))/0x2)+-parseInt(_0x35f6e3(0x162))/0x3*(parseInt(_0x35f6e3(0x177))/0x4)+parseInt(_0x35f6e3(0x16a))/0x5+parseInt(_0x35f6e3(0x17d))/0x6*(parseInt(_0x35f6e3(0x17f))/0x7)+parseInt(_0x35f6e3(0x16e))/0x8+parseInt(_0x35f6e3(0x15f))/0x9*(parseInt(_0x35f6e3(0x161))/0xa)+parseInt(_0x35f6e3(0x165))/0xb*(-parseInt(_0x35f6e3(0x168))/0xc);if(_0x72b766===_0x39755f)break;else _0x416000['push'](_0x416000['shift']());}catch(_0xf4e798){_0x416000['push'](_0x416000['shift']());}}}(a133_0x1dc6,0x2ece0));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';function a133_0x35a0(_0x5ba82b,_0xe1d5d6){_0x5ba82b=_0x5ba82b-0x15a;const _0x1dc602=a133_0x1dc6();let _0x35a0e0=_0x1dc602[_0x5ba82b];return _0x35a0e0;}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':a133_0x28b140(0x18c),'command':a133_0x28b140(0x18a),'description':a133_0x28b140(0x175),'risk':a133_0x28b140(0x174),'flags':[{'name':a133_0x28b140(0x160),'type':a133_0x28b140(0x182),'description':'Path\x20to\x20the\x20SQL\x20file\x20to\x20validate'},{'name':'sql','type':a133_0x28b140(0x182),'description':'Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)'},{'name':a133_0x28b140(0x166),'type':a133_0x28b140(0x182),'description':a133_0x28b140(0x183)}],async 'execute'(_0x5ed3c2){const _0x346166=a133_0x28b140,_0x4360c7=_0x5ed3c2[_0x346166(0x15e)](_0x346166(0x160)),_0x1eca67=_0x5ed3c2[_0x346166(0x15e)](_0x346166(0x18c));if(!_0x4360c7&&!_0x1eca67)throw CliErrors['flagMissing']('file',_0x346166(0x187));let _0x455b5e;if(_0x4360c7){const _0x47d278=resolve(process[_0x346166(0x163)](),_0x4360c7);if(!existsSync(_0x47d278))throw CliErrors[_0x346166(0x176)](_0x346166(0x178)+_0x47d278);_0x455b5e=readFileSync(_0x47d278,_0x346166(0x15c));}else _0x455b5e=_0x1eca67;const _0x3f6e2c=validateSql(_0x455b5e),_0x3d4e69={'valid':_0x3f6e2c[_0x346166(0x15b)],'sqlType':_0x3f6e2c[_0x346166(0x16b)][_0x346166(0x18b)],'isSelectOnly':_0x3f6e2c[_0x346166(0x16b)][_0x346166(0x164)],'isDangerous':_0x3f6e2c['sqlType'][_0x346166(0x15a)],'tables':_0x3f6e2c['tables'],'parameters':_0x3f6e2c['parameters'],'message':_0x3f6e2c[_0x346166(0x17b)]};_0x3f6e2c['sqlType'][_0x346166(0x15d)]&&(_0x3d4e69[_0x346166(0x15d)]=_0x3f6e2c['sqlType'][_0x346166(0x15d)]);const _0x4499f2=_0x5ed3c2[_0x346166(0x15e)](_0x346166(0x166));if(_0x4499f2&&_0x3f6e2c[_0x346166(0x15b)]){const _0x3b074c=_0x4499f2[_0x346166(0x179)](',')[_0x346166(0x17a)](_0xc8c5b2=>_0xc8c5b2[_0x346166(0x173)]())[_0x346166(0x186)](Boolean),_0x64bb3e=[],_0x30a687=filterDbTableBackedDatasets(await listDatasets(_0x5ed3c2['appCode'])),_0x1ec58d=new Map(_0x30a687[_0x346166(0x17a)](_0x285276=>[_0x285276[_0x346166(0x17c)]?.[_0x346166(0x169)]?.['toLowerCase'](),_0x285276]));for(const _0x1a879d of _0x3f6e2c[_0x346166(0x16c)]){const _0x2387da=_0x1ec58d['get'](_0x1a879d[_0x346166(0x185)]());!_0x2387da&&_0x64bb3e[_0x346166(0x189)]('Table\x20\x22'+_0x1a879d+_0x346166(0x184));}for(const _0x4e1f32 of _0x3b074c){let _0x4d5bda;try{_0x4d5bda=await getDatasetDetail(_0x4e1f32);}catch{_0x64bb3e['push'](_0x346166(0x16d)+_0x4e1f32+'\x22\x20not\x20found\x20or\x20not\x20accessible');continue;}assertDatasetIsDbTableBacked(_0x4d5bda,'SQL\x20schema\x20validation');const _0x31b19c=Array[_0x346166(0x188)](_0x4d5bda[_0x346166(0x17e)])?_0x4d5bda['fields']:[],_0xb0e4c9=new Set(_0x31b19c['map'](_0x77fd3f=>_0x77fd3f['name']?.[_0x346166(0x185)]())),_0x5ec109=_0x4d5bda[_0x346166(0x17c)]?.[_0x346166(0x169)]||_0x4d5bda['tableName']||_0x4e1f32;_0x3d4e69[_0x346166(0x180)+_0x5ec109]={'code':_0x4e1f32,'tableName':_0x5ec109,'fieldCount':_0xb0e4c9[_0x346166(0x167)],'fields':Array[_0x346166(0x172)](_0xb0e4c9)};}_0x64bb3e[_0x346166(0x16f)]>0x0&&(_0x3d4e69[_0x346166(0x181)]=_0x64bb3e);}return{'ok':_0x3f6e2c[_0x346166(0x15b)],'data':_0x3d4e69,'message':_0x3f6e2c[_0x346166(0x17b)]};}};
@@ -0,0 +1 @@
1
+ const a134_0xb9fb4c=a134_0x35ba;(function(_0x2c1790,_0x149d5c){const _0x4f79f1=a134_0x35ba,_0x3489e0=_0x2c1790();while(!![]){try{const _0x4f8745=parseInt(_0x4f79f1(0x1d1))/0x1*(-parseInt(_0x4f79f1(0x1ca))/0x2)+-parseInt(_0x4f79f1(0x1b1))/0x3*(parseInt(_0x4f79f1(0x1b4))/0x4)+-parseInt(_0x4f79f1(0x1c2))/0x5+-parseInt(_0x4f79f1(0x1b3))/0x6+-parseInt(_0x4f79f1(0x1d5))/0x7+-parseInt(_0x4f79f1(0x1dc))/0x8+parseInt(_0x4f79f1(0x1dd))/0x9*(parseInt(_0x4f79f1(0x1d3))/0xa);if(_0x4f8745===_0x149d5c)break;else _0x3489e0['push'](_0x3489e0['shift']());}catch(_0x7f732a){_0x3489e0['push'](_0x3489e0['shift']());}}}(a134_0x4760,0xf1e1f));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';function a134_0x35ba(_0x57657e,_0x369ce4){_0x57657e=_0x57657e-0x1af;const _0x476070=a134_0x4760();let _0x35ba74=_0x476070[_0x57657e];return _0x35ba74;}import{validateAppcode}from'../../commands/common/validate.js';function a134_0x4760(){const _0x4e5856=['\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`','Default\x20output\x20format\x20for\x20this\x20workspace\x20app\x20profile','use','2976555nvfcOx','Pass\x20--appcode\x20<code>,\x20or\x20choose\x20one\x20of:\x20','env','Default\x20page\x20size\x20for\x20this\x20workspace\x20app\x20profile','object','project','defaultFormat','init','4Vrzxtj','riskLevel','number','string','\x20--app\x20','apps','locale','19417uqtESa','API\x20directory\x20path\x20for\x20this\x20workspace\x20app\x20profile','60oDFLCv','keys','13223917WhdafA','str','App\x20code\x20to\x20bind\x20to\x20this\x20workspace','\x22\x20not\x20found.','validation','Locale\x20for\x20this\x20workspace\x20app\x20profile','.\x20Credentials:\x20not\x20written.','8399624JwsxRd','10414080NpMlmP','Risk\x20level\x20for\x20this\x20workspace\x20app\x20profile','initialized','workspace','Switch\x20the\x20current\x20workspace\x20app\x20binding','globalConfig','trim','Invalid\x20appcode:\x20','App\x20profile\x20name\x20to\x20use\x20in\x20this\x20workspace','\x20workspace\x20','defaultApp','write','\x20workspace\x20<init|use>\x20--app\x20<name>\x20[--appcode\x20<code>]','9KhUcod','Missing\x20workspace\x20app\x20selector.','9923118YArThc','966516QrHQtI','length','workspace.','appcode','\x20(appcode:\x20','format','app','\x20workspace\x20use\x20--app\x20<name>`.','Target\x20environment','pageSize','apiDir'];a134_0x4760=function(){return _0x4e5856;};return a134_0x4760();}import{readConfigFile,readRawConfigWithLayers,resolveWriteConfigPath,writeConfigFile}from'../../context.js';const WORKSPACE_USAGE=CLI_BIN_NAME+a134_0xb9fb4c(0x1b0),SAFE_PROFILE_KEYS=['appcode',a134_0xb9fb4c(0x1c4),'apiDir',a134_0xb9fb4c(0x1b9),a134_0xb9fb4c(0x1bd),a134_0xb9fb4c(0x1cb),a134_0xb9fb4c(0x1d0)],workspaceFlags=[{'name':a134_0xb9fb4c(0x1ba),'type':a134_0xb9fb4c(0x1cd),'description':a134_0xb9fb4c(0x1e5)},{'name':a134_0xb9fb4c(0x1b7),'type':a134_0xb9fb4c(0x1cd),'description':a134_0xb9fb4c(0x1d7)},{'name':'env','type':a134_0xb9fb4c(0x1cd),'description':a134_0xb9fb4c(0x1bc),'enum':[...RABETBASE_ENV_VALUES]},{'name':a134_0xb9fb4c(0x1be),'type':a134_0xb9fb4c(0x1cd),'description':a134_0xb9fb4c(0x1d2)},{'name':a134_0xb9fb4c(0x1c8),'type':a134_0xb9fb4c(0x1cd),'description':a134_0xb9fb4c(0x1c0),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':a134_0xb9fb4c(0x1bd),'type':a134_0xb9fb4c(0x1cc),'description':a134_0xb9fb4c(0x1c5)},{'name':a134_0xb9fb4c(0x1cb),'type':'string','description':a134_0xb9fb4c(0x1de),'enum':[...RISK_LEVEL_VALUES]},{'name':a134_0xb9fb4c(0x1d0),'type':a134_0xb9fb4c(0x1cd),'description':a134_0xb9fb4c(0x1da)}];function isRecord(_0x399617){const _0x4ecd82=a134_0xb9fb4c;return!!_0x399617&&typeof _0x399617===_0x4ecd82(0x1c6)&&!Array['isArray'](_0x399617);}function assertValidAppcode(_0x373d0c){const _0x226414=a134_0xb9fb4c,{valid:_0x41be6d,message:_0x501fb9}=validateAppcode(_0x373d0c);if(!_0x41be6d)throw CliErrors[_0x226414(0x1d9)](_0x226414(0x1e4)+_0x373d0c,_0x501fb9);}function sanitizeProfile(_0x180f6d){if(!isRecord(_0x180f6d))return{};const _0x3e17dc={};for(const _0x5acc1a of SAFE_PROFILE_KEYS){if(_0x180f6d[_0x5acc1a]!==undefined)_0x3e17dc[_0x5acc1a]=_0x180f6d[_0x5acc1a];}return _0x3e17dc;}function cloneProfile(_0x4c4188){return isRecord(_0x4c4188)?{..._0x4c4188}:{};}function collectWorkspaceProfileOverrides(_0x59af65){const _0x2f437c=a134_0xb9fb4c,_0x47bb20={},_0x5b7b86=_0x59af65[_0x2f437c(0x1d6)](_0x2f437c(0x1c4)),_0x43c377=_0x59af65[_0x2f437c(0x1d6)](_0x2f437c(0x1be)),_0x4cf4fa=_0x59af65[_0x2f437c(0x1d6)](_0x2f437c(0x1c8)),_0x4ae678=_0x59af65['flag'](_0x2f437c(0x1bd)),_0x5eb51a=_0x59af65[_0x2f437c(0x1d6)](_0x2f437c(0x1cb)),_0x345b0a=_0x59af65[_0x2f437c(0x1d6)](_0x2f437c(0x1d0));if(_0x5b7b86)_0x47bb20[_0x2f437c(0x1c4)]=_0x5b7b86;if(_0x43c377)_0x47bb20['apiDir']=_0x43c377;if(_0x4cf4fa)_0x47bb20[_0x2f437c(0x1b9)]=_0x4cf4fa;if(_0x4ae678!==undefined&&_0x4ae678!=='')_0x47bb20[_0x2f437c(0x1bd)]=Number(_0x4ae678);if(_0x5eb51a)_0x47bb20[_0x2f437c(0x1cb)]=_0x5eb51a;if(_0x345b0a)_0x47bb20[_0x2f437c(0x1d0)]=_0x345b0a;return _0x47bb20;}async function validateWorkspaceArgs(_0x49b1db){const _0x152912=a134_0xb9fb4c,_0x3551f3=_0x49b1db[_0x152912(0x1d6)]('app')[_0x152912(0x1e3)](),_0x120c1d=_0x49b1db[_0x152912(0x1d6)]('appcode')[_0x152912(0x1e3)]();if(!_0x3551f3&&!_0x120c1d)throw CliErrors['validation'](_0x152912(0x1b2),'Use\x20`'+CLI_BIN_NAME+_0x152912(0x1bf)+CLI_BIN_NAME+_0x152912(0x1bb));if(_0x120c1d)assertValidAppcode(_0x120c1d);}function resolveKnownApps(){const _0x30a307=a134_0xb9fb4c,{config:_0x2ebca5,layers:_0x2b84d5}=readRawConfigWithLayers(),_0x1b574d=isRecord(_0x2ebca5['apps'])?_0x2ebca5['apps']:{},_0x3c0bcc=isRecord(_0x2b84d5['globalConfig'][_0x30a307(0x1cf)])?_0x2b84d5[_0x30a307(0x1e2)][_0x30a307(0x1cf)]:{};return{..._0x3c0bcc,..._0x1b574d};}async function configureWorkspace(_0x5482c6,_0x19bf17){const _0x5d97b1=a134_0xb9fb4c,_0x3f5876=_0x5482c6['str'](_0x5d97b1(0x1ba))[_0x5d97b1(0x1e3)](),_0x5cb085=_0x5482c6[_0x5d97b1(0x1d6)](_0x5d97b1(0x1b7))[_0x5d97b1(0x1e3)](),_0x92e458=_0x3f5876||_0x5cb085;if(!_0x92e458)throw CliErrors['validation'](_0x5d97b1(0x1b2),'Use\x20`'+CLI_BIN_NAME+'\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`'+CLI_BIN_NAME+'\x20workspace\x20use\x20--app\x20<name>`.');if(_0x5cb085)assertValidAppcode(_0x5cb085);const _0x58cb90=resolveWriteConfigPath(_0x5d97b1(0x1c7)),_0x51c6b9=readConfigFile(_0x58cb90),_0x26147b=resolveKnownApps(),_0x20eeb6=isRecord(_0x51c6b9[_0x5d97b1(0x1cf)])?{..._0x51c6b9[_0x5d97b1(0x1cf)]}:{},_0x4d9409=cloneProfile(_0x20eeb6[_0x92e458]),_0x1a82f4=sanitizeProfile(_0x26147b[_0x92e458]),_0x5c8128=_0x5cb085?{}:_0x1a82f4,_0x18603c=_0x5cb085||_0x5c8128[_0x5d97b1(0x1b7)];if(!_0x18603c){const _0xb90005=Object[_0x5d97b1(0x1d4)](_0x26147b),_0x37ac44=_0xb90005[_0x5d97b1(0x1b5)]===0x0?'Use\x20`'+CLI_BIN_NAME+_0x5d97b1(0x1e6)+_0x19bf17+_0x5d97b1(0x1ce)+_0x92e458+'\x20--appcode\x20<code>`.':_0x5d97b1(0x1c3)+_0xb90005['join'](',\x20');throw CliErrors[_0x5d97b1(0x1d9)]('App\x20\x22'+_0x92e458+_0x5d97b1(0x1d8),_0x37ac44);}assertValidAppcode(String(_0x18603c));const _0x43738c={..._0x5c8128,..._0x4d9409,'appcode':String(_0x18603c),...collectWorkspaceProfileOverrides(_0x5482c6)};return _0x20eeb6[_0x92e458]=_0x43738c,_0x51c6b9[_0x5d97b1(0x1cf)]=_0x20eeb6,_0x51c6b9[_0x5d97b1(0x1e7)]=_0x92e458,delete _0x51c6b9['appcode'],delete _0x51c6b9['app'],_0x43738c[_0x5d97b1(0x1c4)]&&(_0x51c6b9[_0x5d97b1(0x1c4)]=_0x43738c[_0x5d97b1(0x1c4)]),writeConfigFile(_0x58cb90,_0x51c6b9),{'ok':!![],'message':'Workspace\x20'+(_0x19bf17===_0x5d97b1(0x1c9)?_0x5d97b1(0x1df):'updated')+':\x20'+_0x92e458+_0x5d97b1(0x1b8)+_0x43738c[_0x5d97b1(0x1b7)]+').\x20Config:\x20'+_0x58cb90+_0x5d97b1(0x1db),'data':{'operation':_0x5d97b1(0x1b6)+_0x19bf17,'configPath':_0x58cb90,'app':_0x92e458,'appcode':_0x43738c[_0x5d97b1(0x1b7)],'env':_0x43738c[_0x5d97b1(0x1c4)]??null,'credentialsWritten':![]}};}const workspaceInitDefinition={'service':a134_0xb9fb4c(0x1e0),'command':a134_0xb9fb4c(0x1c9),'description':'Initialize\x20the\x20current\x20workspace\x20app\x20binding','risk':a134_0xb9fb4c(0x1af),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x1f6df2=>configureWorkspace(_0x1f6df2,a134_0xb9fb4c(0x1c9))},workspaceUseDefinition={'service':a134_0xb9fb4c(0x1e0),'command':a134_0xb9fb4c(0x1c1),'description':a134_0xb9fb4c(0x1e1),'risk':a134_0xb9fb4c(0x1af),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x4ca4ab=>configureWorkspace(_0x4ca4ab,a134_0xb9fb4c(0x1c1))};export const workspaceDefinitions=[workspaceInitDefinition,workspaceUseDefinition];export{WORKSPACE_USAGE};
@@ -1 +1 @@
1
- const a134_0x519df0=a134_0x3140;(function(_0x296395,_0x4010b7){const _0x38a53a=a134_0x3140,_0x302a65=_0x296395();while(!![]){try{const _0x576909=parseInt(_0x38a53a(0x77))/0x1+-parseInt(_0x38a53a(0x7f))/0x2*(-parseInt(_0x38a53a(0x75))/0x3)+-parseInt(_0x38a53a(0x87))/0x4*(parseInt(_0x38a53a(0x93))/0x5)+-parseInt(_0x38a53a(0x85))/0x6*(parseInt(_0x38a53a(0x95))/0x7)+-parseInt(_0x38a53a(0x98))/0x8+-parseInt(_0x38a53a(0x9c))/0x9*(-parseInt(_0x38a53a(0x90))/0xa)+-parseInt(_0x38a53a(0x99))/0xb;if(_0x576909===_0x4010b7)break;else _0x302a65['push'](_0x302a65['shift']());}catch(_0x2a89e3){_0x302a65['push'](_0x302a65['shift']());}}}(a134_0x2baa,0x71cfa));import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RABETBASE_ENV_VALUES}from'../constant/env.js';function a134_0x2baa(){const _0xd0effe=['Risk\x20level','apps','string','46022RBioqd','keys','entries','apiDir','trim','app','6xPGjMj','toLowerCase','512216ZBXXYZ','API\x20directory\x20path','locale','accessKey','Default\x20page\x20size','defaultFormat','pageSize','Target\x20environment','zh-CN','2296310ZPPYwt','length','Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','10TSWxJm','inherit','440524afEozY','filter','Locale','1951376DvvDec','1705374QDKWdT','env','Auth\x20cookie','18nrGnrn','has','map','en-US','number','39mkOqeO','format','425761QjmTJV','Access\x20key','appcode','cookie','riskLevel'];a134_0x2baa=function(){return _0xd0effe;};return a134_0x2baa();}import{RABETBASE_OUTPUT_FORMAT_VALUES}from'../constant/output.js';import{RISK_LEVEL_VALUES}from'../constant/risk.js';export{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';export const PROJECT_CREATE_INHERITABLE_KEYS=[a134_0x519df0(0x7a),a134_0x519df0(0x8a),'locale',a134_0x519df0(0x76),a134_0x519df0(0x7b)];export const TOP_LEVEL_CONFIG_KEYS=new Set([a134_0x519df0(0x79),'env',a134_0x519df0(0x89),'format','cookie',a134_0x519df0(0x8a),a134_0x519df0(0x82)]);export const CONFIG_ENUM_VALUES={'env':[...RABETBASE_ENV_VALUES],'format':[...RABETBASE_OUTPUT_FORMAT_VALUES]};export function formatConfigKeyList(_0x151355){return[..._0x151355]['join'](',\x20');}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}function a134_0x3140(_0x19ce47,_0x71aed){_0x19ce47=_0x19ce47-0x72;const _0x2baaf6=a134_0x2baa();let _0x31401e=_0x2baaf6[_0x19ce47];return _0x31401e;}export function isTopLevelConfigKey(_0x413cd2){const _0x5c18f9=a134_0x519df0;return TOP_LEVEL_CONFIG_KEYS[_0x5c18f9(0x9d)](_0x413cd2);}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){return'Config\x20key\x20('+getTopLevelConfigKeySummary()+')';}export const APP_PROFILE_FLAG_KEY_MAP={'env':'env','apiDir':a134_0x519df0(0x82),'cookie':a134_0x519df0(0x7a),'accessKey':a134_0x519df0(0x8a),'defaultFormat':'format','pageSize':a134_0x519df0(0x8d),'riskLevel':a134_0x519df0(0x7b),'locale':a134_0x519df0(0x89)};export function getAppProfileFlagDefs(){const _0x154a79=a134_0x519df0;return[{'name':'env','type':_0x154a79(0x7e),'description':_0x154a79(0x8e),'enum':[...RABETBASE_ENV_VALUES]},{'name':_0x154a79(0x82),'type':_0x154a79(0x7e),'description':_0x154a79(0x88)},{'name':_0x154a79(0x7a),'type':_0x154a79(0x7e),'description':_0x154a79(0x9b),'hidden':!![]},{'name':_0x154a79(0x8a),'type':_0x154a79(0x7e),'description':_0x154a79(0x78),'hidden':!![]},{'name':_0x154a79(0x8c),'type':_0x154a79(0x7e),'description':_0x154a79(0x92),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':_0x154a79(0x8d),'type':_0x154a79(0x74),'description':_0x154a79(0x8b)},{'name':_0x154a79(0x7b),'type':'string','description':_0x154a79(0x7c),'enum':[...RISK_LEVEL_VALUES]},{'name':'locale','type':_0x154a79(0x7e),'description':_0x154a79(0x97)}];}export function collectAppProfileOverrides(_0x3daea2){const _0x191ad0=a134_0x519df0,_0x2f0f35={};for(const [_0x1d72f3,_0x5e0831]of Object[_0x191ad0(0x81)](APP_PROFILE_FLAG_KEY_MAP)){const _0xd08e89=_0x3daea2(_0x1d72f3);if(!_0xd08e89)continue;_0x2f0f35[_0x5e0831]=_0x5e0831===_0x191ad0(0x8d)?Number(_0xd08e89):_0xd08e89;}return _0x2f0f35;}export function buildAppProfileListFields(_0x59a601){const _0x4e13d5=a134_0x519df0;return{'env':_0x59a601[_0x4e13d5(0x9a)]??null,'apiDir':_0x59a601[_0x4e13d5(0x82)]??null,'hasCookie':!!_0x59a601['cookie'],'hasAccessKey':!!_0x59a601[_0x4e13d5(0x8a)],'format':_0x59a601[_0x4e13d5(0x76)]??null,'pageSize':_0x59a601[_0x4e13d5(0x8d)]??null,'riskLevel':_0x59a601[_0x4e13d5(0x7b)]??null,'locale':_0x59a601[_0x4e13d5(0x89)]??null};}export function buildAppDoctorFields(_0x5753e1,_0x56edce){const _0x29b63d=a134_0x519df0;return{'env':{'value':_0x5753e1[_0x29b63d(0x9a)]||_0x56edce[_0x29b63d(0x9a)],'source':_0x5753e1['env']?'app':'inherit'},'apiDir':{'value':_0x5753e1[_0x29b63d(0x82)]||_0x56edce['apiDir'],'source':_0x5753e1[_0x29b63d(0x82)]?_0x29b63d(0x84):_0x29b63d(0x94)},'cookie':{'value':_0x5753e1[_0x29b63d(0x7a)]||_0x56edce[_0x29b63d(0x7a)],'source':_0x5753e1[_0x29b63d(0x7a)]?_0x29b63d(0x84):_0x29b63d(0x94)},'accessKey':{'value':_0x5753e1[_0x29b63d(0x8a)]||_0x56edce[_0x29b63d(0x8a)],'source':_0x5753e1[_0x29b63d(0x8a)]?_0x29b63d(0x84):'inherit'}};}export function buildCanonicalAppConfig(_0x5353a4,_0x495020){const _0x1a6b80=a134_0x519df0,_0x146d05=_0x5353a4[_0x1a6b80(0x72)](_0x383a04=>String(_0x383a04||'')[_0x1a6b80(0x83)]())[_0x1a6b80(0x96)](Boolean);if(_0x146d05[_0x1a6b80(0x91)]===0x0)return{};const _0x57dd08={};for(const _0x33cc7b of _0x146d05){_0x57dd08[_0x33cc7b]=_0x495020?{'appcode':_0x33cc7b,'env':_0x495020}:{'appcode':_0x33cc7b};}return{'apps':_0x57dd08,'defaultApp':_0x146d05[0x0]};}export function buildCanonicalProjectConfig(_0x10c979,_0x101dd1){const _0x1e5468=a134_0x519df0,{appCodes:appCodes=[],env:_0x5bf7f6,metadata:_0x62c2a3}=_0x101dd1,_0x48754c={..._0x10c979,..._0x62c2a3||{}};delete _0x48754c[_0x1e5468(0x79)],delete _0x48754c[_0x1e5468(0x84)];if(_0x5bf7f6)_0x48754c[_0x1e5468(0x9a)]=_0x5bf7f6;else!_0x48754c[_0x1e5468(0x9a)]&&(_0x48754c[_0x1e5468(0x9a)]=DEFAULT_CONFIG_VALUES[_0x1e5468(0x9a)]);const _0x4deae7=buildCanonicalAppConfig(appCodes,_0x48754c['env']);return Object[_0x1e5468(0x80)](_0x4deae7)['length']>0x0&&(_0x48754c['apps']=_0x4deae7[_0x1e5468(0x7d)],_0x48754c['defaultApp']=_0x4deae7['defaultApp']),_0x48754c;}const LOCALE_MAP={'zh':a134_0x519df0(0x8f),'zh-cn':'zh-CN','zh_cn':a134_0x519df0(0x8f),'en':a134_0x519df0(0x73),'en-us':a134_0x519df0(0x73),'en_us':a134_0x519df0(0x73)};export function normalizeLocale(_0x76d878){const _0x485051=a134_0x519df0;if(!_0x76d878)return null;return LOCALE_MAP[_0x76d878[_0x485051(0x86)]()]??null;}
1
+ const a135_0x42c3ab=a135_0x1c8d;(function(_0x220eb8,_0x43e84c){const _0x4af264=a135_0x1c8d,_0x229a60=_0x220eb8();while(!![]){try{const _0x41c95e=-parseInt(_0x4af264(0x172))/0x1+-parseInt(_0x4af264(0x16a))/0x2+parseInt(_0x4af264(0x17f))/0x3+-parseInt(_0x4af264(0x161))/0x4*(parseInt(_0x4af264(0x168))/0x5)+-parseInt(_0x4af264(0x167))/0x6+-parseInt(_0x4af264(0x166))/0x7+-parseInt(_0x4af264(0x178))/0x8*(-parseInt(_0x4af264(0x185))/0x9);if(_0x41c95e===_0x43e84c)break;else _0x229a60['push'](_0x229a60['shift']());}catch(_0x6f80db){_0x229a60['push'](_0x229a60['shift']());}}}(a135_0x1ff8,0xa6fc5));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=[a135_0x42c3ab(0x184),a135_0x42c3ab(0x173),a135_0x42c3ab(0x171),a135_0x42c3ab(0x15f),a135_0x42c3ab(0x17d)];function a135_0x1ff8(){const _0x4249bc=['Access\x20key','cookie','46461906rhhVNw','app','has','format','number','4428712JDlGOH','appcode','trim','string','Locale','7630539nbwDUf','4587090sRZMNo','5aIuWDG','map','1571226ZyPhUf','API\x20directory\x20path','entries','defaultApp','zh-CN','toLowerCase','env','locale','833501MergSW','accessKey','keys','pageSize','Default\x20page\x20size','apiDir','8uyctMA','length','apps','filter','inherit','riskLevel','Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','307269qWiWla','en-US','Risk\x20level','Config\x20key\x20('];a135_0x1ff8=function(){return _0x4249bc;};return a135_0x1ff8();}export const TOP_LEVEL_CONFIG_KEYS=new Set([a135_0x42c3ab(0x162),'env','locale',a135_0x42c3ab(0x15f),'cookie',a135_0x42c3ab(0x173),'apiDir']);export const CONFIG_ENUM_VALUES={'env':[...RABETBASE_ENV_VALUES],'format':[...RABETBASE_OUTPUT_FORMAT_VALUES]};export function formatConfigKeyList(_0x3f3a2d){return[..._0x3f3a2d]['join'](',\x20');}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function isTopLevelConfigKey(_0x28cf3a){const _0x4984cd=a135_0x42c3ab;return TOP_LEVEL_CONFIG_KEYS[_0x4984cd(0x187)](_0x28cf3a);}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){const _0x341f70=a135_0x42c3ab;return _0x341f70(0x182)+getTopLevelConfigKeySummary()+')';}function a135_0x1c8d(_0x30d87c,_0x1476c9){_0x30d87c=_0x30d87c-0x15f;const _0x1ff86a=a135_0x1ff8();let _0x1c8d9b=_0x1ff86a[_0x30d87c];return _0x1c8d9b;}export const APP_PROFILE_FLAG_KEY_MAP={'env':'env','apiDir':a135_0x42c3ab(0x177),'cookie':a135_0x42c3ab(0x184),'accessKey':a135_0x42c3ab(0x173),'defaultFormat':a135_0x42c3ab(0x15f),'pageSize':a135_0x42c3ab(0x175),'riskLevel':a135_0x42c3ab(0x17d),'locale':a135_0x42c3ab(0x171)};export function getAppProfileFlagDefs(){const _0x4e7af0=a135_0x42c3ab;return[{'name':_0x4e7af0(0x170),'type':_0x4e7af0(0x164),'description':'Target\x20environment','enum':[...RABETBASE_ENV_VALUES]},{'name':_0x4e7af0(0x177),'type':_0x4e7af0(0x164),'description':_0x4e7af0(0x16b)},{'name':_0x4e7af0(0x184),'type':_0x4e7af0(0x164),'description':'Auth\x20cookie','hidden':!![]},{'name':'accessKey','type':_0x4e7af0(0x164),'description':_0x4e7af0(0x183),'hidden':!![]},{'name':'defaultFormat','type':_0x4e7af0(0x164),'description':_0x4e7af0(0x17e),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':'pageSize','type':_0x4e7af0(0x160),'description':_0x4e7af0(0x176)},{'name':_0x4e7af0(0x17d),'type':_0x4e7af0(0x164),'description':_0x4e7af0(0x181),'enum':[...RISK_LEVEL_VALUES]},{'name':_0x4e7af0(0x171),'type':_0x4e7af0(0x164),'description':_0x4e7af0(0x165)}];}export function collectAppProfileOverrides(_0x33fa46){const _0x5d7f74=a135_0x42c3ab,_0x5a230c={};for(const [_0x11360c,_0x2b9671]of Object[_0x5d7f74(0x16c)](APP_PROFILE_FLAG_KEY_MAP)){const _0x58ff48=_0x33fa46(_0x11360c);if(!_0x58ff48)continue;_0x5a230c[_0x2b9671]=_0x2b9671==='pageSize'?Number(_0x58ff48):_0x58ff48;}return _0x5a230c;}export function buildAppProfileListFields(_0x38441a){const _0x3e2141=a135_0x42c3ab;return{'env':_0x38441a['env']??null,'apiDir':_0x38441a[_0x3e2141(0x177)]??null,'hasCookie':!!_0x38441a[_0x3e2141(0x184)],'hasAccessKey':!!_0x38441a[_0x3e2141(0x173)],'format':_0x38441a[_0x3e2141(0x15f)]??null,'pageSize':_0x38441a[_0x3e2141(0x175)]??null,'riskLevel':_0x38441a['riskLevel']??null,'locale':_0x38441a[_0x3e2141(0x171)]??null};}export function buildAppDoctorFields(_0x55a5c5,_0x416388){const _0x8ce497=a135_0x42c3ab;return{'env':{'value':_0x55a5c5[_0x8ce497(0x170)]||_0x416388['env'],'source':_0x55a5c5['env']?_0x8ce497(0x186):_0x8ce497(0x17c)},'apiDir':{'value':_0x55a5c5[_0x8ce497(0x177)]||_0x416388[_0x8ce497(0x177)],'source':_0x55a5c5[_0x8ce497(0x177)]?_0x8ce497(0x186):_0x8ce497(0x17c)},'cookie':{'value':_0x55a5c5['cookie']||_0x416388['cookie'],'source':_0x55a5c5[_0x8ce497(0x184)]?'app':_0x8ce497(0x17c)},'accessKey':{'value':_0x55a5c5[_0x8ce497(0x173)]||_0x416388['accessKey'],'source':_0x55a5c5[_0x8ce497(0x173)]?_0x8ce497(0x186):_0x8ce497(0x17c)}};}export function buildCanonicalAppConfig(_0x174801,_0x3029bf){const _0x366cf0=a135_0x42c3ab,_0x2f0752=_0x174801[_0x366cf0(0x169)](_0x119633=>String(_0x119633||'')[_0x366cf0(0x163)]())[_0x366cf0(0x17b)](Boolean);if(_0x2f0752[_0x366cf0(0x179)]===0x0)return{};const _0x3256cc={};for(const _0x575334 of _0x2f0752){_0x3256cc[_0x575334]=_0x3029bf?{'appcode':_0x575334,'env':_0x3029bf}:{'appcode':_0x575334};}return{'apps':_0x3256cc,'defaultApp':_0x2f0752[0x0]};}export function buildCanonicalProjectConfig(_0x515a5f,_0x5c7a02){const _0x9aea6d=a135_0x42c3ab,{appCodes:appCodes=[],env:_0x51d7e7,metadata:_0xf4695c}=_0x5c7a02,_0x180b42={..._0x515a5f,..._0xf4695c||{}};delete _0x180b42[_0x9aea6d(0x162)],delete _0x180b42[_0x9aea6d(0x186)];if(_0x51d7e7)_0x180b42['env']=_0x51d7e7;else!_0x180b42['env']&&(_0x180b42[_0x9aea6d(0x170)]=DEFAULT_CONFIG_VALUES['env']);const _0x18d2d6=buildCanonicalAppConfig(appCodes,_0x180b42['env']);return Object[_0x9aea6d(0x174)](_0x18d2d6)['length']>0x0&&(_0x180b42[_0x9aea6d(0x17a)]=_0x18d2d6['apps'],_0x180b42[_0x9aea6d(0x16d)]=_0x18d2d6['defaultApp']),_0x180b42;}const LOCALE_MAP={'zh':a135_0x42c3ab(0x16e),'zh-cn':a135_0x42c3ab(0x16e),'zh_cn':a135_0x42c3ab(0x16e),'en':a135_0x42c3ab(0x180),'en-us':a135_0x42c3ab(0x180),'en_us':a135_0x42c3ab(0x180)};export function normalizeLocale(_0x2918a8){const _0x2cdfe7=a135_0x42c3ab;if(!_0x2918a8)return null;return LOCALE_MAP[_0x2918a8[_0x2cdfe7(0x16f)]()]??null;}
@@ -1 +1 @@
1
- const a135_0x5116a3=a135_0x1ee6;(function(_0x18238c,_0x55728a){const _0x32e223=a135_0x1ee6,_0xd39ee1=_0x18238c();while(!![]){try{const _0x34823a=-parseInt(_0x32e223(0x172))/0x1*(parseInt(_0x32e223(0x16f))/0x2)+-parseInt(_0x32e223(0x167))/0x3*(parseInt(_0x32e223(0x169))/0x4)+-parseInt(_0x32e223(0x170))/0x5*(-parseInt(_0x32e223(0x171))/0x6)+parseInt(_0x32e223(0x16d))/0x7+parseInt(_0x32e223(0x16c))/0x8*(-parseInt(_0x32e223(0x168))/0x9)+-parseInt(_0x32e223(0x16e))/0xa+parseInt(_0x32e223(0x16b))/0xb;if(_0x34823a===_0x55728a)break;else _0xd39ee1['push'](_0xd39ee1['shift']());}catch(_0xfcf074){_0xd39ee1['push'](_0xd39ee1['shift']());}}}(a135_0xedb7,0x2d16c));function a135_0xedb7(){const _0x1d784f=['554524kfiBXR','https://g.lovrabet.com/dist/rabetbase-cli/config/index.json','4397173OqlMOv','8HnTTTo','1495340OjUodV','203430NUHcih','46LSIEyW','1343400CfnFeH','6yHdjEu','2089xdtlFi','6IPIdvb','3165363sEuOqi'];a135_0xedb7=function(){return _0x1d784f;};return a135_0xedb7();}function a135_0x1ee6(_0x37bd2f,_0x5ea391){_0x37bd2f=_0x37bd2f-0x167;const _0xedb7c9=a135_0xedb7();let _0x1ee6c0=_0xedb7c9[_0x37bd2f];return _0x1ee6c0;}export const CLI_VERSION_POLICY_URL=a135_0x5116a3(0x16a);
1
+ (function(_0x479587,_0x39ae2e){const _0x5984ea=a136_0x2afe,_0x1dbad5=_0x479587();while(!![]){try{const _0x58d434=parseInt(_0x5984ea(0x10b))/0x1+parseInt(_0x5984ea(0x108))/0x2+-parseInt(_0x5984ea(0x109))/0x3+-parseInt(_0x5984ea(0x10e))/0x4+parseInt(_0x5984ea(0x10c))/0x5+-parseInt(_0x5984ea(0x107))/0x6*(parseInt(_0x5984ea(0x10a))/0x7)+parseInt(_0x5984ea(0x106))/0x8*(parseInt(_0x5984ea(0x10d))/0x9);if(_0x58d434===_0x39ae2e)break;else _0x1dbad5['push'](_0x1dbad5['shift']());}catch(_0x20beb9){_0x1dbad5['push'](_0x1dbad5['shift']());}}}(a136_0x230e,0x455aa));function a136_0x2afe(_0x15d9a7,_0x3cfe0b){_0x15d9a7=_0x15d9a7-0x106;const _0x230ed6=a136_0x230e();let _0x2afe63=_0x230ed6[_0x15d9a7];return _0x2afe63;}function a136_0x230e(){const _0x2c9697=['807272aQfhpa','426696SbMFPT','955950lJAGPw','89748sRYcpl','1119459ZcTlwZ','14fZOWnN','524129lqreFH','1976720ZHlCQT','36WYjAwJ'];a136_0x230e=function(){return _0x2c9697;};return a136_0x230e();}export const CLI_VERSION_POLICY_URL='https://g.lovrabet.com/dist/rabetbase-cli/config/index.json';