@lovrabet/rabetbase-cli 2.3.11-beta.1 → 2.3.12-beta.1

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 (260) 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/index.js +1 -1
  21. package/lib/commands/app/list.js +1 -1
  22. package/lib/commands/app/remote-directory.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-config/delete.js +1 -1
  26. package/lib/commands/app-config/get.js +1 -1
  27. package/lib/commands/app-config/index.js +1 -1
  28. package/lib/commands/app-config/list.js +1 -1
  29. package/lib/commands/app-config/set.js +1 -1
  30. package/lib/commands/app-config/shared.js +1 -1
  31. package/lib/commands/auth/index.js +1 -1
  32. package/lib/commands/bff/create.js +1 -1
  33. package/lib/commands/bff/delete.js +1 -1
  34. package/lib/commands/bff/detail.js +1 -1
  35. package/lib/commands/bff/index.js +1 -1
  36. package/lib/commands/bff/list.js +1 -1
  37. package/lib/commands/bff/pull.js +1 -1
  38. package/lib/commands/bff/push.js +1 -1
  39. package/lib/commands/bff/status.js +1 -1
  40. package/lib/commands/cli-skill/index.js +1 -1
  41. package/lib/commands/cli-update.js +1 -1
  42. package/lib/commands/codegen/index.js +1 -1
  43. package/lib/commands/codegen/sdk.js +1 -1
  44. package/lib/commands/codegen/sql.js +1 -1
  45. package/lib/commands/common/app-registry.js +1 -1
  46. package/lib/commands/common/app-selector.js +1 -1
  47. package/lib/commands/common/async-task.js +1 -1
  48. package/lib/commands/common/dry-run.js +1 -1
  49. package/lib/commands/common/flags.js +1 -1
  50. package/lib/commands/common/local-file.js +1 -1
  51. package/lib/commands/common/validate.js +1 -1
  52. package/lib/commands/config/get.js +1 -1
  53. package/lib/commands/config/index.js +1 -1
  54. package/lib/commands/config/list.js +1 -1
  55. package/lib/commands/config/set.js +1 -1
  56. package/lib/commands/config/shared.js +1 -1
  57. package/lib/commands/data/filter.js +1 -1
  58. package/lib/commands/data/getOne.js +1 -1
  59. package/lib/commands/data/index.js +1 -1
  60. package/lib/commands/data/shared.js +1 -1
  61. package/lib/commands/dataset/business-group-update.js +1 -1
  62. package/lib/commands/dataset/capability.js +1 -1
  63. package/lib/commands/dataset/delete.js +1 -1
  64. package/lib/commands/dataset/detail.js +1 -1
  65. package/lib/commands/dataset/extend-update.js +1 -1
  66. package/lib/commands/dataset/field-update.js +1 -1
  67. package/lib/commands/dataset/generate.js +1 -1
  68. package/lib/commands/dataset/index.js +1 -1
  69. package/lib/commands/dataset/list.js +1 -1
  70. package/lib/commands/dataset/operations.js +1 -1
  71. package/lib/commands/dataset/relation-audit.js +1 -1
  72. package/lib/commands/dataset/relation-create.js +1 -1
  73. package/lib/commands/dataset/relation-delete.js +1 -1
  74. package/lib/commands/dataset/relation-shared.js +1 -1
  75. package/lib/commands/dataset/relation-update.js +1 -1
  76. package/lib/commands/dataset/relations.js +1 -1
  77. package/lib/commands/dataset/rename.js +1 -1
  78. package/lib/commands/dataset/restore.js +1 -1
  79. package/lib/commands/db/analysis-batching.js +1 -1
  80. package/lib/commands/db/analyze-batch-plan.js +1 -1
  81. package/lib/commands/db/analyze-cancel.js +1 -1
  82. package/lib/commands/db/analyze-start.js +1 -1
  83. package/lib/commands/db/analyze-status.js +1 -1
  84. package/lib/commands/db/create.js +1 -1
  85. package/lib/commands/db/delete.js +1 -1
  86. package/lib/commands/db/detail.js +1 -1
  87. package/lib/commands/db/diff.js +1 -1
  88. package/lib/commands/db/index.js +1 -1
  89. package/lib/commands/db/list.js +1 -1
  90. package/lib/commands/db/shared.js +1 -1
  91. package/lib/commands/db/tables.js +1 -1
  92. package/lib/commands/db/test.js +1 -1
  93. package/lib/commands/db/update.js +1 -1
  94. package/lib/commands/doctor.js +1 -1
  95. package/lib/commands/file/index.js +1 -1
  96. package/lib/commands/init/index.js +1 -1
  97. package/lib/commands/issue/index.js +1 -1
  98. package/lib/commands/issue/nudge.js +1 -1
  99. package/lib/commands/issue/report.js +1 -1
  100. package/lib/commands/issue/shared.js +1 -1
  101. package/lib/commands/logs/index.js +1 -1
  102. package/lib/commands/menu/delete.js +1 -1
  103. package/lib/commands/menu/external-link-create.js +1 -1
  104. package/lib/commands/menu/group-create.js +1 -1
  105. package/lib/commands/menu/group-update.js +1 -1
  106. package/lib/commands/menu/index.js +1 -1
  107. package/lib/commands/menu/list.js +1 -1
  108. package/lib/commands/menu/move.js +1 -1
  109. package/lib/commands/menu/regroup-start.js +1 -1
  110. package/lib/commands/menu/shared/compare-table.js +1 -1
  111. package/lib/commands/menu/shared/delete-plan.js +1 -1
  112. package/lib/commands/menu/shared/facts.js +1 -1
  113. package/lib/commands/menu/shared/index.js +1 -1
  114. package/lib/commands/menu/shared/inquirer.js +1 -1
  115. package/lib/commands/menu/shared/local-pages.js +1 -1
  116. package/lib/commands/menu/shared/logic.js +1 -1
  117. package/lib/commands/menu/shared/mutations.js +1 -1
  118. package/lib/commands/menu/shared/service.js +1 -1
  119. package/lib/commands/menu/shared/sync-core.js +1 -1
  120. package/lib/commands/menu/shared/update-core.js +1 -1
  121. package/lib/commands/menu/shared/valid-url.js +1 -1
  122. package/lib/commands/menu/sync.js +1 -1
  123. package/lib/commands/menu/update.js +1 -1
  124. package/lib/commands/notification/config-list.js +1 -1
  125. package/lib/commands/notification/index.js +1 -1
  126. package/lib/commands/page/generate-start.js +1 -1
  127. package/lib/commands/page/generate-status.js +1 -1
  128. package/lib/commands/page/index.js +1 -1
  129. package/lib/commands/page/pull.js +1 -1
  130. package/lib/commands/page/push.js +1 -1
  131. package/lib/commands/page/relation-audit.js +1 -1
  132. package/lib/commands/page/shared.js +1 -1
  133. package/lib/commands/page/standard-page-status.js +1 -1
  134. package/lib/commands/page/sync.js +1 -1
  135. package/lib/commands/permit/index.js +1 -1
  136. package/lib/commands/permit/page-get.js +1 -1
  137. package/lib/commands/permit/page-set.js +1 -1
  138. package/lib/commands/permit/role-apis-set.js +1 -1
  139. package/lib/commands/permit/role-menus-set.js +1 -1
  140. package/lib/commands/permit/role-menus.js +1 -1
  141. package/lib/commands/permit/shared.js +1 -1
  142. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  143. package/lib/commands/project/create/format-elapsed.js +1 -1
  144. package/lib/commands/project/create/main.js +1 -1
  145. package/lib/commands/project/create/non-interactive.js +1 -1
  146. package/lib/commands/project/create/project-template-path.js +1 -1
  147. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  148. package/lib/commands/project/create/use-format-code.js +1 -1
  149. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  150. package/lib/commands/project/index.js +1 -1
  151. package/lib/commands/project/init.js +1 -1
  152. package/lib/commands/project/upgrade.js +1 -1
  153. package/lib/commands/registry.js +1 -1
  154. package/lib/commands/role/create.js +1 -1
  155. package/lib/commands/role/delete.js +1 -1
  156. package/lib/commands/role/detail.js +1 -1
  157. package/lib/commands/role/index.js +1 -1
  158. package/lib/commands/role/list.js +1 -1
  159. package/lib/commands/role/shared.js +1 -1
  160. package/lib/commands/role/update.js +1 -1
  161. package/lib/commands/role/user-add.js +1 -1
  162. package/lib/commands/role/user-remove.js +1 -1
  163. package/lib/commands/role/user-resolve.js +1 -1
  164. package/lib/commands/run/index.js +1 -1
  165. package/lib/commands/schema.js +1 -1
  166. package/lib/commands/sql/create.js +1 -1
  167. package/lib/commands/sql/delete.js +1 -1
  168. package/lib/commands/sql/detail.js +1 -1
  169. package/lib/commands/sql/exec.js +1 -1
  170. package/lib/commands/sql/index.js +1 -1
  171. package/lib/commands/sql/list.js +1 -1
  172. package/lib/commands/sql/pull.js +1 -1
  173. package/lib/commands/sql/push.js +1 -1
  174. package/lib/commands/sql/save.js +1 -1
  175. package/lib/commands/sql/shared.js +1 -1
  176. package/lib/commands/sql/status.js +1 -1
  177. package/lib/commands/sql/validate.js +1 -1
  178. package/lib/commands/task/index.js +1 -1
  179. package/lib/commands/task/status.js +1 -1
  180. package/lib/commands/workspace/add.js +1 -1
  181. package/lib/commands/workspace/index.js +1 -1
  182. package/lib/commands/workspace/remove.js +1 -1
  183. package/lib/config/schema.js +1 -1
  184. package/lib/constant/cdn.js +1 -1
  185. package/lib/constant/cli.js +1 -1
  186. package/lib/constant/defaults.js +1 -1
  187. package/lib/constant/domain.js +1 -1
  188. package/lib/constant/env.js +1 -1
  189. package/lib/constant/output.js +1 -1
  190. package/lib/constant/paths.js +1 -1
  191. package/lib/constant/risk.js +1 -1
  192. package/lib/context/app-resolver.js +1 -1
  193. package/lib/context/auth-resolver.js +1 -1
  194. package/lib/context/config-loader.js +1 -1
  195. package/lib/context.js +1 -1
  196. package/lib/core/alias-resolver.js +1 -1
  197. package/lib/core/api-client.js +1 -1
  198. package/lib/core/bff/config.js +1 -1
  199. package/lib/core/bff/file-system.js +1 -1
  200. package/lib/core/bff/hash.js +1 -1
  201. package/lib/core/bff/lock.js +1 -1
  202. package/lib/core/bff/utils.js +1 -1
  203. package/lib/core/db-resolver.js +1 -1
  204. package/lib/core/page/file-system.js +1 -1
  205. package/lib/core/page/hash.js +1 -1
  206. package/lib/core/page/lock.js +1 -1
  207. package/lib/core/sql-index-auditor.js +1 -1
  208. package/lib/core/sql-sync/config.js +1 -1
  209. package/lib/core/sql-sync/file-system.js +1 -1
  210. package/lib/core/sql-sync/hash.js +1 -1
  211. package/lib/core/sql-sync/lock.js +1 -1
  212. package/lib/core/sql-sync/utils.js +1 -1
  213. package/lib/core/sql-validator.js +1 -1
  214. package/lib/errors.js +1 -1
  215. package/lib/framework/build-all-flags.js +1 -1
  216. package/lib/framework/error-output.js +1 -1
  217. package/lib/framework/explicit-yes.js +1 -1
  218. package/lib/framework/flags.js +1 -1
  219. package/lib/framework/help.js +1 -1
  220. package/lib/framework/index.js +1 -1
  221. package/lib/framework/output.js +1 -1
  222. package/lib/framework/response.js +1 -1
  223. package/lib/framework/runner-alias.js +1 -1
  224. package/lib/framework/runner.js +1 -1
  225. package/lib/framework/schema-export.js +1 -1
  226. package/lib/framework/types.js +1 -1
  227. package/lib/generated/build-info.js +1 -1
  228. package/lib/help.js +1 -1
  229. package/lib/skills/main.js +1 -1
  230. package/lib/skills/npx-skills-add.js +1 -1
  231. package/lib/telemetry/cli-command-trace.js +1 -1
  232. package/lib/telemetry/cli-help-trace.js +1 -1
  233. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  234. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  235. package/lib/telemetry/send-cli-trace-log.js +1 -1
  236. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  237. package/lib/utils/ai_config.js +1 -1
  238. package/lib/utils/apply-jq-filter.js +1 -1
  239. package/lib/utils/cdn-config.js +1 -1
  240. package/lib/utils/check-sdk-version.js +1 -1
  241. package/lib/utils/cli-version-check.js +1 -1
  242. package/lib/utils/cli-version-policy.js +1 -1
  243. package/lib/utils/config.js +1 -1
  244. package/lib/utils/copy-directory.js +1 -1
  245. package/lib/utils/entity-with-id.js +1 -1
  246. package/lib/utils/file-utils.js +1 -1
  247. package/lib/utils/guides-cdn.js +1 -1
  248. package/lib/utils/http-client.js +1 -1
  249. package/lib/utils/is-non-interactive.js +1 -1
  250. package/lib/utils/logger.js +1 -1
  251. package/lib/utils/params.js +1 -1
  252. package/lib/utils/platform.js +1 -1
  253. package/lib/utils/rules-cdn.js +1 -1
  254. package/lib/utils/sleep.js +1 -1
  255. package/lib/utils/template-replacer.js +1 -1
  256. package/lib/utils/update-notice.js +1 -1
  257. package/lib/utils/version.js +1 -1
  258. package/lib/utils/with-active-cookie.js +1 -1
  259. package/lib/utils/write-cli-side-channel.js +1 -1
  260. package/package.json +1 -1
@@ -1 +1 @@
1
- const a172_0x11b6c7=a172_0x2cbc;(function(_0x1c4461,_0xa5c385){const _0x1f5ccf=a172_0x2cbc,_0x5ada5d=_0x1c4461();while(!![]){try{const _0x2e0f1e=-parseInt(_0x1f5ccf(0x86))/0x1*(-parseInt(_0x1f5ccf(0xb4))/0x2)+-parseInt(_0x1f5ccf(0x85))/0x3*(-parseInt(_0x1f5ccf(0x91))/0x4)+parseInt(_0x1f5ccf(0xb6))/0x5*(parseInt(_0x1f5ccf(0x8e))/0x6)+parseInt(_0x1f5ccf(0xa3))/0x7*(-parseInt(_0x1f5ccf(0x9d))/0x8)+-parseInt(_0x1f5ccf(0x84))/0x9*(parseInt(_0x1f5ccf(0xa7))/0xa)+parseInt(_0x1f5ccf(0xae))/0xb*(parseInt(_0x1f5ccf(0x9c))/0xc)+-parseInt(_0x1f5ccf(0x8a))/0xd;if(_0x2e0f1e===_0xa5c385)break;else _0x5ada5d['push'](_0x5ada5d['shift']());}catch(_0xaea6ee){_0x5ada5d['push'](_0x5ada5d['shift']());}}}(a172_0x3e60,0x81eb9));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;async function fetchAllSqlQueries(_0x5ce6ae,_0x1dc06e){const _0x4000e3=a172_0x2cbc,_0x50b151=[];let _0x2fa0c8=0x1;while(!![]){const _0x1a03b7=await listSqlQueries(_0x5ce6ae,{'currentPage':_0x2fa0c8,'pageSize':PAGE_SIZE,'sqlCode':_0x1dc06e[_0x4000e3(0x83)],'sqlName':_0x1dc06e[_0x4000e3(0xb3)]}),_0x15c665=_0x1a03b7['tableData']??[];_0x50b151[_0x4000e3(0xb2)](..._0x15c665);if(_0x15c665[_0x4000e3(0xba)]===0x0)break;const _0x3cb53a=_0x1a03b7[_0x4000e3(0xb0)]?.['totalCount'];if(_0x3cb53a!=null?_0x50b151[_0x4000e3(0xba)]>=_0x3cb53a:_0x15c665[_0x4000e3(0xba)]<PAGE_SIZE)break;_0x2fa0c8++;}return _0x50b151;}async function ensureSqlContent(_0x2d5d3f){const _0x5cc6e7=a172_0x2cbc;if(_0x2d5d3f['sqlContent']!=null&&String(_0x2d5d3f['sqlContent'])[_0x5cc6e7(0xba)]>0x0)return _0x2d5d3f;return getSqlQueryDetail(_0x2d5d3f[_0x5cc6e7(0x83)]);}export const sqlPull={'service':'sql','command':a172_0x11b6c7(0x7e),'description':'Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','risk':a172_0x11b6c7(0x99),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a172_0x11b6c7(0x90),'type':'string','description':'Filter\x20by\x20SQL\x20display\x20name'},{'name':a172_0x11b6c7(0x9f),'type':a172_0x11b6c7(0x8f),'description':a172_0x11b6c7(0x92)}],async 'dryRun'(_0x3145b8){const _0x4afbe0=a172_0x11b6c7,_0x24e6c0=loadSqlProjectConfig(_0x3145b8['appCode']),_0x2a664=await readSqlLockFile(_0x24e6c0['lockFilePath']),{appLock:_0x16a5c3}=ensureSqlLockScope(_0x2a664??createEmptySqlLock(),_0x24e6c0[_0x4afbe0(0x94)],_0x24e6c0[_0x4afbe0(0x8b)],_0x4afbe0(0x7e)),_0x42ac03=await fetchAllSqlQueries(_0x3145b8[_0x4afbe0(0x94)],{'sqlCode':_0x3145b8[_0x4afbe0(0x93)]('sqlcode')||undefined,'sqlName':_0x3145b8['str']('name')||undefined}),_0x2da737=[];for(const _0x455a6c of _0x42ac03){const _0x84325c=await ensureSqlContent(_0x455a6c),_0x50eb9d=ensureRemoteSqlContent(_0x84325c),_0x35c694=detectModeFromSql(_0x84325c),_0x195565=_0x84325c[_0x4afbe0(0x8c)]?await getDbName(_0x3145b8['appCode'],Number(_0x84325c[_0x4afbe0(0x8c)]))[_0x4afbe0(0x87)](()=>undefined):undefined,_0x28fec0=buildLocalSqlFileContent({'sqlCode':_0x84325c['sqlCode'],'sqlName':_0x84325c[_0x4afbe0(0xb3)],'dbId':_0x84325c[_0x4afbe0(0x8c)]},_0x50eb9d,{'dbName':_0x195565,'mode':_0x35c694,'syncedAt':new Date()[_0x4afbe0(0x88)](),'description':_0x84325c[_0x4afbe0(0xa5)]}),_0x3b0a3e=buildSqlLockEntry(_0x84325c,_0x50eb9d,'',{'dbName':_0x195565}),_0x42f558=resolveLocalSqlFilePath(_0x24e6c0,_0x84325c['sqlCode'],_0x3b0a3e);let _0x5148bc='would_pull',_0x39fad1;if(await fileExists(_0x42f558)){const _0xb1c70b=await readFile(_0x42f558,'utf8');isEquivalentPulledSqlFile(_0xb1c70b,_0x28fec0,_0x35c694)?(_0x5148bc=_0x4afbe0(0xb5),_0x39fad1=_0x4afbe0(0xb1)):(_0x5148bc=_0x4afbe0(0x9a),_0x39fad1=_0x4afbe0(0x80));}_0x2da737[_0x4afbe0(0xb2)]({'sqlCode':_0x84325c[_0x4afbe0(0x83)],'sqlName':_0x84325c[_0x4afbe0(0xb3)],'filePath':_0x42f558,'status':_0x5148bc,'reason':_0x39fad1});}return{'method':'POST','url':_0x4afbe0(0x98),'body':{'appCode':_0x3145b8[_0x4afbe0(0x94)],'sqlCode':_0x3145b8[_0x4afbe0(0x93)](_0x4afbe0(0x97))||null,'sqlName':_0x3145b8[_0x4afbe0(0x93)]('name')||null,'files':_0x2da737},'description':'Would\x20pull\x20'+_0x2da737[_0x4afbe0(0xba)]+_0x4afbe0(0xb9)+_0x24e6c0[_0x4afbe0(0x95)]};},async 'execute'(_0x296e55){const _0x4ea2ee=a172_0x11b6c7,_0x65dd7c=loadSqlProjectConfig(_0x296e55['appCode']),_0x2aa7cd=await readSqlLockFile(_0x65dd7c[_0x4ea2ee(0x96)]),{lockData:_0x2fb71e,appLock:_0x37a350}=ensureSqlLockScope(_0x2aa7cd??createEmptySqlLock(),_0x65dd7c['appCode'],_0x65dd7c[_0x4ea2ee(0x8b)],'pull'),_0x4b2d43=_0x296e55[_0x4ea2ee(0xb8)](_0x4ea2ee(0x9f)),_0x413248=await fetchAllSqlQueries(_0x296e55['appCode'],{'sqlCode':_0x296e55[_0x4ea2ee(0x93)](_0x4ea2ee(0x97))||undefined,'sqlName':_0x296e55[_0x4ea2ee(0x93)](_0x4ea2ee(0x90))||undefined});if(_0x413248[_0x4ea2ee(0xba)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x4ea2ee(0x81)};const _0x5589e2=[],_0x5a6460=[];for(const _0xd14cd5 of _0x413248){try{_0x5589e2[_0x4ea2ee(0xb2)](await ensureSqlContent(_0xd14cd5));}catch(_0x2ce045){_0x5a6460['push']({'sqlCode':_0xd14cd5[_0x4ea2ee(0x83)],'error':_0x2ce045 instanceof Error?_0x2ce045[_0x4ea2ee(0x7f)]:String(_0x2ce045)});}}if(_0x4b2d43&&!_0x296e55[_0x4ea2ee(0xa1)]){let _0x424598=![];for(const _0x5c77c3 of _0x5589e2){const _0x502b3f=detectModeFromSql(_0x5c77c3),_0x2cb210=_0x5c77c3[_0x4ea2ee(0x8c)]?await getDbName(_0x296e55[_0x4ea2ee(0x94)],Number(_0x5c77c3['dbId']))[_0x4ea2ee(0x87)](()=>undefined):undefined,_0x317a83=buildLocalSqlFileContent({'sqlCode':_0x5c77c3[_0x4ea2ee(0x83)],'sqlName':_0x5c77c3[_0x4ea2ee(0xb3)],'dbId':_0x5c77c3[_0x4ea2ee(0x8c)]},ensureRemoteSqlContent(_0x5c77c3),{'dbName':_0x2cb210,'mode':_0x502b3f,'syncedAt':new Date()[_0x4ea2ee(0x88)](),'description':_0x5c77c3[_0x4ea2ee(0xa5)]}),_0x4bae88=resolveLocalSqlFilePath(_0x65dd7c,_0x5c77c3['sqlCode'],buildSqlLockEntry(_0x5c77c3,ensureRemoteSqlContent(_0x5c77c3),'',{'dbName':_0x2cb210}));if(await fileExists(_0x4bae88)){const _0x4cea38=await readFile(_0x4bae88,_0x4ea2ee(0xa2));if(!isEquivalentPulledSqlFile(_0x4cea38,_0x317a83,_0x502b3f)){_0x424598=!![];break;}}}if(_0x424598){const _0x5a7042=await confirmForceOverwrite(_0x4ea2ee(0xaf));if(!_0x5a7042)throw CliErrors[_0x4ea2ee(0xa4)](_0x4ea2ee(0x8d));}}const _0x1acf45=cloneSqlLockData(_0x2fb71e),_0x142b5f=_0x1acf45[_0x4ea2ee(0x82)][_0x65dd7c[_0x4ea2ee(0x94)]],_0x525665=[],_0x19ffff=[];for(const _0xd1f52 of _0x5589e2){const _0x1a0983=_0x142b5f[_0x4ea2ee(0xb7)][_0xd1f52['sqlCode']],_0x4ffbbd=ensureRemoteSqlContent(_0xd1f52),_0x159ec2=detectModeFromSql(_0xd1f52),_0x1135ac=_0xd1f52[_0x4ea2ee(0x8c)]?await getDbName(_0x296e55[_0x4ea2ee(0x94)],Number(_0xd1f52[_0x4ea2ee(0x8c)]))[_0x4ea2ee(0x87)](()=>undefined):undefined,_0x213bde=buildLocalSqlFileContent({'sqlCode':_0xd1f52[_0x4ea2ee(0x83)],'sqlName':_0xd1f52['sqlName'],'dbId':_0xd1f52[_0x4ea2ee(0x8c)]},_0x4ffbbd,{'dbName':_0x1135ac,'mode':_0x159ec2,'syncedAt':new Date()[_0x4ea2ee(0x88)](),'description':_0xd1f52['description']}),_0x42d4c0=buildSqlLockEntry(_0xd1f52,_0x4ffbbd,computeSqlContentHash(_0x213bde),{'dbName':_0x1135ac}),_0x2fd3ea=_0x42d4c0['path'],_0x38f93f=join(_0x65dd7c[_0x4ea2ee(0x95)],_0x2fd3ea);try{if(await fileExists(_0x38f93f)){const _0x10ab23=await readFile(_0x38f93f,_0x4ea2ee(0xa2));if(isEquivalentPulledSqlFile(_0x10ab23,_0x213bde,_0x159ec2)){_0x19ffff[_0x4ea2ee(0xb2)]({'sqlCode':_0xd1f52[_0x4ea2ee(0x83)],'reason':_0x4ea2ee(0xb1)}),_0x142b5f[_0x4ea2ee(0xb7)][_0xd1f52[_0x4ea2ee(0x83)]]={..._0x42d4c0,'hash':computeSqlContentHash(_0x10ab23),'path':_0x2fd3ea};continue;}if(!_0x4b2d43){_0x19ffff[_0x4ea2ee(0xb2)]({'sqlCode':_0xd1f52[_0x4ea2ee(0x83)],'reason':'local\x20differs\x20from\x20remote'});continue;}}const _0x49a385=_0x1a0983?.[_0x4ea2ee(0x9b)]?join(_0x65dd7c[_0x4ea2ee(0x95)],_0x1a0983[_0x4ea2ee(0x9b)]):undefined;_0x49a385&&_0x49a385!==_0x38f93f&&await fileExists(_0x49a385)&&await rm(_0x49a385,{'force':!![]}),await ensureParentDirectory(_0x38f93f),await writeFile(_0x38f93f,_0x213bde,_0x4ea2ee(0xa2)),_0x142b5f['sqls'][_0xd1f52['sqlCode']]={..._0x42d4c0,'path':_0x2fd3ea},_0x525665[_0x4ea2ee(0xb2)]({'sqlCode':_0xd1f52['sqlCode'],'filePath':_0x38f93f});}catch(_0x1f4abe){_0x5a6460[_0x4ea2ee(0xb2)]({'sqlCode':_0xd1f52['sqlCode'],'error':_0x1f4abe instanceof Error?_0x1f4abe[_0x4ea2ee(0x7f)]:String(_0x1f4abe)});}}return _0x142b5f['lastSync']=new Date()[_0x4ea2ee(0x88)](),await writeSqlLockFile(_0x65dd7c['lockFilePath'],_0x1acf45),{'ok':_0x5a6460[_0x4ea2ee(0xba)]===0x0,'data':{'pulled':_0x525665,'skipped':_0x19ffff,'failed':_0x5a6460},'message':_0x4ea2ee(0x89)+_0x525665[_0x4ea2ee(0xba)]+_0x4ea2ee(0xac)+_0x19ffff[_0x4ea2ee(0xba)]+'\x20skipped,\x20'+_0x5a6460[_0x4ea2ee(0xba)]+_0x4ea2ee(0xa6)};}};function detectModeFromSql(_0x11c370){const _0x4c4ef7=a172_0x11b6c7,_0x500542=ensureRemoteSqlContent(_0x11c370),_0x49dd56=stripLocalSqlMetadata(_0x500542,_0x4c4ef7(0xa0))[_0x4c4ef7(0xad)]();if(/^<(select|insert|update|delete)\b/i[_0x4c4ef7(0xa9)](_0x49dd56))return'mybatisXml';return _0x4c4ef7(0xaa);}function a172_0x3e60(){const _0x526d50=['boolean','name','8dgQahY','Force\x20overwrite\x20local\x20unsynced\x20changes','str','appCode','sqlRootDir','lockFilePath','sqlcode','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','write','conflict','path','882180UMeZyK','8dopSVH','split','force','mybatisXml','nonInteractive','utf8','6839651SZZmeQ','cancelled','description','\x20failed','2010QlKURM','filter','test','sql','join','\x20written,\x20','trimStart','88VxfNxH','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','paging','unchanged','push','sqlName','263234dhoQkk','skipped','1415mOYXvI','sqls','bool','\x20SQL\x20file(s)\x20into\x20','length','pull','message','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','No\x20remote\x20SQL\x20queries\x20matched.','apps','sqlCode','13968OExcNF','119355ROZXdE','4bOAKsc','catch','toISOString','Pull\x20complete:\x20','19539xlcZPJ','sqlRoot','dbId','Force\x20pull\x20cancelled.','13326AZziXQ'];a172_0x3e60=function(){return _0x526d50;};return a172_0x3e60();}function isEquivalentPulledSqlFile(_0x382650,_0x29d4ea,_0x473bc5){return normalizePullComparableContent(_0x382650,_0x473bc5)===normalizePullComparableContent(_0x29d4ea,_0x473bc5);}function normalizePullComparableContent(_0x376fd5,_0x197a24){const _0x302f41=a172_0x11b6c7,_0x1e923f=_0x376fd5['replace'](/\r\n/g,'\x0a')[_0x302f41(0x9e)]('\x0a'),_0x331e05=_0x1e923f[_0x302f41(0xa8)](_0x2149a2=>!isSyncedAtMetadataLine(_0x2149a2,_0x197a24));return _0x331e05[_0x302f41(0xab)]('\x0a');}function a172_0x2cbc(_0x54fcff,_0x4c317e){_0x54fcff=_0x54fcff-0x7e;const _0x3e6059=a172_0x3e60();let _0x2cbc9d=_0x3e6059[_0x54fcff];return _0x2cbc9d;}function isSyncedAtMetadataLine(_0x3aa05b,_0x376740){const _0x4d05ca=a172_0x11b6c7;if(_0x376740===_0x4d05ca(0xa0))return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0x4d05ca(0xa9)](_0x3aa05b);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x4d05ca(0xa9)](_0x3aa05b);}
1
+ const a172_0x5be294=a172_0x7049;(function(_0x4acaff,_0x5eedd4){const _0x4836fb=a172_0x7049,_0x5c63e3=_0x4acaff();while(!![]){try{const _0x429018=parseInt(_0x4836fb(0x1f4))/0x1+parseInt(_0x4836fb(0x1d5))/0x2+parseInt(_0x4836fb(0x1e3))/0x3*(-parseInt(_0x4836fb(0x207))/0x4)+-parseInt(_0x4836fb(0x1fe))/0x5*(parseInt(_0x4836fb(0x1fa))/0x6)+-parseInt(_0x4836fb(0x202))/0x7*(parseInt(_0x4836fb(0x1e5))/0x8)+-parseInt(_0x4836fb(0x1db))/0x9+-parseInt(_0x4836fb(0x1d3))/0xa*(-parseInt(_0x4836fb(0x206))/0xb);if(_0x429018===_0x5eedd4)break;else _0x5c63e3['push'](_0x5c63e3['shift']());}catch(_0x473356){_0x5c63e3['push'](_0x5c63e3['shift']());}}}(a172_0x59d1,0x5d85b));import{readFile,rm,writeFile}from'node:fs/promises';import{join}from'node:path';function a172_0x7049(_0x740445,_0x50f38e){_0x740445=_0x740445-0x1ce;const _0x59d10f=a172_0x59d1();let _0x7049bd=_0x59d10f[_0x740445];return _0x7049bd;}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 a172_0x59d1(){const _0x382da8=['Force\x20pull\x20cancelled.','apps','59838ClOnbO','appCode','length','toISOString','265BGeKdb','pull','Pull\x20complete:\x20','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','419223WFXGut','Would\x20pull\x20','filter','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','22EtbadP','1222472XukNVk','POST','name','write','unchanged','path','push','sqlRoot','8019590BxGwbO','tableData','1004528JVhdrt','utf8','sqls','mybatisXml','dbId','test','4973760qXORnI','sql','sqlRootDir','cancelled','sqlcode','sqlContent','lockFilePath','trimStart','6ywVvHH','Force\x20overwrite\x20local\x20unsynced\x20changes','88uELttE','No\x20remote\x20SQL\x20queries\x20matched.','split','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','sqlName','force','string','nonInteractive','lastSync','paging','boolean','catch','\x20SQL\x20file(s)\x20into\x20','str','sqlCode','628109DuXuGg','\x20failed','message','replace'];a172_0x59d1=function(){return _0x382da8;};return a172_0x59d1();}import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildLocalSqlFileContent,buildSqlLockEntry,cloneSqlLockData,confirmForceOverwrite,ensureRemoteSqlContent,stripLocalSqlMetadata}from'./shared.js';const PAGE_SIZE=0x64;async function fetchAllSqlQueries(_0x1a41a2,_0x3025a2){const _0x990949=a172_0x7049,_0x4c24dd=[];let _0x119c28=0x1;while(!![]){const _0x42c274=await listSqlQueries(_0x1a41a2,{'currentPage':_0x119c28,'pageSize':PAGE_SIZE,'sqlCode':_0x3025a2['sqlCode'],'sqlName':_0x3025a2['sqlName']}),_0x18c0ad=_0x42c274[_0x990949(0x1d4)]??[];_0x4c24dd['push'](..._0x18c0ad);if(_0x18c0ad[_0x990949(0x1fc)]===0x0)break;const _0x4adffa=_0x42c274[_0x990949(0x1ee)]?.['totalCount'];if(_0x4adffa!=null?_0x4c24dd[_0x990949(0x1fc)]>=_0x4adffa:_0x18c0ad[_0x990949(0x1fc)]<PAGE_SIZE)break;_0x119c28++;}return _0x4c24dd;}async function ensureSqlContent(_0x1270ea){const _0x46d2ec=a172_0x7049;if(_0x1270ea[_0x46d2ec(0x1e0)]!=null&&String(_0x1270ea[_0x46d2ec(0x1e0)])['length']>0x0)return _0x1270ea;return getSqlQueryDetail(_0x1270ea[_0x46d2ec(0x1f3)]);}export const sqlPull={'service':a172_0x5be294(0x1dc),'command':a172_0x5be294(0x1ff),'description':a172_0x5be294(0x1e8),'risk':a172_0x5be294(0x1ce),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a172_0x5be294(0x209),'type':a172_0x5be294(0x1eb),'description':'Filter\x20by\x20SQL\x20display\x20name'},{'name':a172_0x5be294(0x1ea),'type':a172_0x5be294(0x1ef),'description':a172_0x5be294(0x1e4)}],async 'dryRun'(_0x1a3fa6){const _0x1ed66e=a172_0x5be294,_0x599127=loadSqlProjectConfig(_0x1a3fa6[_0x1ed66e(0x1fb)]),_0x390b6f=await readSqlLockFile(_0x599127[_0x1ed66e(0x1e1)]),{appLock:_0x1e7fea}=ensureSqlLockScope(_0x390b6f??createEmptySqlLock(),_0x599127[_0x1ed66e(0x1fb)],_0x599127[_0x1ed66e(0x1d2)],_0x1ed66e(0x1ff)),_0x4fb3cf=await fetchAllSqlQueries(_0x1a3fa6[_0x1ed66e(0x1fb)],{'sqlCode':_0x1a3fa6[_0x1ed66e(0x1f2)]('sqlcode')||undefined,'sqlName':_0x1a3fa6['str'](_0x1ed66e(0x209))||undefined}),_0x24e14e=[];for(const _0xc1a635 of _0x4fb3cf){const _0x6cce35=await ensureSqlContent(_0xc1a635),_0x443399=ensureRemoteSqlContent(_0x6cce35),_0x18cafb=detectModeFromSql(_0x6cce35),_0x9de1c4=_0x6cce35[_0x1ed66e(0x1d9)]?await getDbName(_0x1a3fa6['appCode'],Number(_0x6cce35[_0x1ed66e(0x1d9)]))['catch'](()=>undefined):undefined,_0x35de20=buildLocalSqlFileContent({'sqlCode':_0x6cce35[_0x1ed66e(0x1f3)],'sqlName':_0x6cce35['sqlName'],'dbId':_0x6cce35['dbId']},_0x443399,{'dbName':_0x9de1c4,'mode':_0x18cafb,'syncedAt':new Date()[_0x1ed66e(0x1fd)](),'description':_0x6cce35['description']}),_0x1a4b3a=buildSqlLockEntry(_0x6cce35,_0x443399,'',{'dbName':_0x9de1c4}),_0x32b7a3=resolveLocalSqlFilePath(_0x599127,_0x6cce35[_0x1ed66e(0x1f3)],_0x1a4b3a);let _0x4f561d='would_pull',_0x241f3c;if(await fileExists(_0x32b7a3)){const _0x8afb1c=await readFile(_0x32b7a3,_0x1ed66e(0x1d6));isEquivalentPulledSqlFile(_0x8afb1c,_0x35de20,_0x18cafb)?(_0x4f561d='skipped',_0x241f3c='unchanged'):(_0x4f561d='conflict',_0x241f3c=_0x1ed66e(0x205));}_0x24e14e[_0x1ed66e(0x1d1)]({'sqlCode':_0x6cce35['sqlCode'],'sqlName':_0x6cce35[_0x1ed66e(0x1e9)],'filePath':_0x32b7a3,'status':_0x4f561d,'reason':_0x241f3c});}return{'method':_0x1ed66e(0x208),'url':_0x1ed66e(0x201),'body':{'appCode':_0x1a3fa6['appCode'],'sqlCode':_0x1a3fa6[_0x1ed66e(0x1f2)](_0x1ed66e(0x1df))||null,'sqlName':_0x1a3fa6['str']('name')||null,'files':_0x24e14e},'description':_0x1ed66e(0x203)+_0x24e14e[_0x1ed66e(0x1fc)]+_0x1ed66e(0x1f1)+_0x599127['sqlRootDir']};},async 'execute'(_0x5a8d20){const _0x32103d=a172_0x5be294,_0x2628ab=loadSqlProjectConfig(_0x5a8d20[_0x32103d(0x1fb)]),_0x275910=await readSqlLockFile(_0x2628ab[_0x32103d(0x1e1)]),{lockData:_0xb1cd73,appLock:_0x10f00a}=ensureSqlLockScope(_0x275910??createEmptySqlLock(),_0x2628ab[_0x32103d(0x1fb)],_0x2628ab[_0x32103d(0x1d2)],_0x32103d(0x1ff)),_0x368f11=_0x5a8d20['bool']('force'),_0x5abc02=await fetchAllSqlQueries(_0x5a8d20[_0x32103d(0x1fb)],{'sqlCode':_0x5a8d20[_0x32103d(0x1f2)](_0x32103d(0x1df))||undefined,'sqlName':_0x5a8d20[_0x32103d(0x1f2)](_0x32103d(0x209))||undefined});if(_0x5abc02['length']===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x32103d(0x1e6)};const _0x4f0604=[],_0x3215db=[];for(const _0x51bd36 of _0x5abc02){try{_0x4f0604[_0x32103d(0x1d1)](await ensureSqlContent(_0x51bd36));}catch(_0x5b1a2e){_0x3215db[_0x32103d(0x1d1)]({'sqlCode':_0x51bd36[_0x32103d(0x1f3)],'error':_0x5b1a2e instanceof Error?_0x5b1a2e[_0x32103d(0x1f6)]:String(_0x5b1a2e)});}}if(_0x368f11&&!_0x5a8d20[_0x32103d(0x1ec)]){let _0x297d54=![];for(const _0x50f1d3 of _0x4f0604){const _0x157255=detectModeFromSql(_0x50f1d3),_0x464627=_0x50f1d3['dbId']?await getDbName(_0x5a8d20['appCode'],Number(_0x50f1d3['dbId']))[_0x32103d(0x1f0)](()=>undefined):undefined,_0x180b52=buildLocalSqlFileContent({'sqlCode':_0x50f1d3[_0x32103d(0x1f3)],'sqlName':_0x50f1d3['sqlName'],'dbId':_0x50f1d3[_0x32103d(0x1d9)]},ensureRemoteSqlContent(_0x50f1d3),{'dbName':_0x464627,'mode':_0x157255,'syncedAt':new Date()['toISOString'](),'description':_0x50f1d3['description']}),_0x280e45=resolveLocalSqlFilePath(_0x2628ab,_0x50f1d3['sqlCode'],buildSqlLockEntry(_0x50f1d3,ensureRemoteSqlContent(_0x50f1d3),'',{'dbName':_0x464627}));if(await fileExists(_0x280e45)){const _0x1f30b2=await readFile(_0x280e45,_0x32103d(0x1d6));if(!isEquivalentPulledSqlFile(_0x1f30b2,_0x180b52,_0x157255)){_0x297d54=!![];break;}}}if(_0x297d54){const _0x113b00=await confirmForceOverwrite('Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.');if(!_0x113b00)throw CliErrors[_0x32103d(0x1de)](_0x32103d(0x1f8));}}const _0x15cd7f=cloneSqlLockData(_0xb1cd73),_0x2444da=_0x15cd7f[_0x32103d(0x1f9)][_0x2628ab[_0x32103d(0x1fb)]],_0x120401=[],_0x15cf41=[];for(const _0x2bd5e5 of _0x4f0604){const _0x585da8=_0x2444da['sqls'][_0x2bd5e5[_0x32103d(0x1f3)]],_0x29057c=ensureRemoteSqlContent(_0x2bd5e5),_0x3f150c=detectModeFromSql(_0x2bd5e5),_0x25735a=_0x2bd5e5['dbId']?await getDbName(_0x5a8d20[_0x32103d(0x1fb)],Number(_0x2bd5e5[_0x32103d(0x1d9)]))[_0x32103d(0x1f0)](()=>undefined):undefined,_0x171286=buildLocalSqlFileContent({'sqlCode':_0x2bd5e5[_0x32103d(0x1f3)],'sqlName':_0x2bd5e5[_0x32103d(0x1e9)],'dbId':_0x2bd5e5['dbId']},_0x29057c,{'dbName':_0x25735a,'mode':_0x3f150c,'syncedAt':new Date()['toISOString'](),'description':_0x2bd5e5['description']}),_0x4d4ad4=buildSqlLockEntry(_0x2bd5e5,_0x29057c,computeSqlContentHash(_0x171286),{'dbName':_0x25735a}),_0x41bf29=_0x4d4ad4['path'],_0x135aca=join(_0x2628ab['sqlRootDir'],_0x41bf29);try{if(await fileExists(_0x135aca)){const _0x389bdb=await readFile(_0x135aca,_0x32103d(0x1d6));if(isEquivalentPulledSqlFile(_0x389bdb,_0x171286,_0x3f150c)){_0x15cf41[_0x32103d(0x1d1)]({'sqlCode':_0x2bd5e5[_0x32103d(0x1f3)],'reason':_0x32103d(0x1cf)}),_0x2444da[_0x32103d(0x1d7)][_0x2bd5e5[_0x32103d(0x1f3)]]={..._0x4d4ad4,'hash':computeSqlContentHash(_0x389bdb),'path':_0x41bf29};continue;}if(!_0x368f11){_0x15cf41[_0x32103d(0x1d1)]({'sqlCode':_0x2bd5e5[_0x32103d(0x1f3)],'reason':'local\x20differs\x20from\x20remote'});continue;}}const _0x36f2c4=_0x585da8?.[_0x32103d(0x1d0)]?join(_0x2628ab[_0x32103d(0x1dd)],_0x585da8[_0x32103d(0x1d0)]):undefined;_0x36f2c4&&_0x36f2c4!==_0x135aca&&await fileExists(_0x36f2c4)&&await rm(_0x36f2c4,{'force':!![]}),await ensureParentDirectory(_0x135aca),await writeFile(_0x135aca,_0x171286,_0x32103d(0x1d6)),_0x2444da['sqls'][_0x2bd5e5['sqlCode']]={..._0x4d4ad4,'path':_0x41bf29},_0x120401[_0x32103d(0x1d1)]({'sqlCode':_0x2bd5e5[_0x32103d(0x1f3)],'filePath':_0x135aca});}catch(_0x359f14){_0x3215db['push']({'sqlCode':_0x2bd5e5[_0x32103d(0x1f3)],'error':_0x359f14 instanceof Error?_0x359f14[_0x32103d(0x1f6)]:String(_0x359f14)});}}return _0x2444da[_0x32103d(0x1ed)]=new Date()['toISOString'](),await writeSqlLockFile(_0x2628ab[_0x32103d(0x1e1)],_0x15cd7f),{'ok':_0x3215db[_0x32103d(0x1fc)]===0x0,'data':{'pulled':_0x120401,'skipped':_0x15cf41,'failed':_0x3215db},'message':_0x32103d(0x200)+_0x120401[_0x32103d(0x1fc)]+'\x20written,\x20'+_0x15cf41['length']+'\x20skipped,\x20'+_0x3215db[_0x32103d(0x1fc)]+_0x32103d(0x1f5)};}};function detectModeFromSql(_0x288a71){const _0x4dbccb=a172_0x5be294,_0x271b9f=ensureRemoteSqlContent(_0x288a71),_0x1a3d01=stripLocalSqlMetadata(_0x271b9f,_0x4dbccb(0x1d8))[_0x4dbccb(0x1e2)]();if(/^<(select|insert|update|delete)\b/i[_0x4dbccb(0x1da)](_0x1a3d01))return _0x4dbccb(0x1d8);return'sql';}function isEquivalentPulledSqlFile(_0x44f7cc,_0x48afea,_0x17f323){return normalizePullComparableContent(_0x44f7cc,_0x17f323)===normalizePullComparableContent(_0x48afea,_0x17f323);}function normalizePullComparableContent(_0xb66c69,_0x54948a){const _0x497ca1=a172_0x5be294,_0x4d1c44=_0xb66c69[_0x497ca1(0x1f7)](/\r\n/g,'\x0a')[_0x497ca1(0x1e7)]('\x0a'),_0x5dbdcd=_0x4d1c44[_0x497ca1(0x204)](_0x208daa=>!isSyncedAtMetadataLine(_0x208daa,_0x54948a));return _0x5dbdcd['join']('\x0a');}function isSyncedAtMetadataLine(_0x227fd5,_0x2b14aa){const _0x3f9024=a172_0x5be294;if(_0x2b14aa==='mybatisXml')return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0x3f9024(0x1da)](_0x227fd5);return/^\s*--\s*@lovrabet\.syncedAt:/['test'](_0x227fd5);}
@@ -1 +1 @@
1
- const a173_0x948c4d=a173_0x1c1c;(function(_0x39e5e1,_0x4c7d3b){const _0x447393=a173_0x1c1c,_0x45a3c7=_0x39e5e1();while(!![]){try{const _0x123c64=parseInt(_0x447393(0x1e0))/0x1+-parseInt(_0x447393(0x1f4))/0x2+-parseInt(_0x447393(0x1df))/0x3*(parseInt(_0x447393(0x1d5))/0x4)+-parseInt(_0x447393(0x204))/0x5+-parseInt(_0x447393(0x1d1))/0x6+parseInt(_0x447393(0x1f5))/0x7+parseInt(_0x447393(0x1da))/0x8*(parseInt(_0x447393(0x1e4))/0x9);if(_0x123c64===_0x4c7d3b)break;else _0x45a3c7['push'](_0x45a3c7['shift']());}catch(_0x5e3e2f){_0x45a3c7['push'](_0x45a3c7['shift']());}}}(a173_0x31c7,0x47830));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';function a173_0x31c7(){const _0x5b0ec5=['1412VxNlXL','lockFilePath','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','projectRoot','force','859128pTAiMa','filter','length','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','remoteId','309nhFvqo','2328zAOqPd','lastSync','toISOString','str','45RwqRJM','Local\x20SQL\x20not\x20found:\x20','isFinite','has','trashDir','\x20SQL\x20file(s)','Push\x20local\x20SQL\x20files\x20to\x20remote','join','Push\x20complete:\x20','entries','hash','No\x20local\x20SQL\x20files\x20found.','POST','unchanged','\x20pushed,\x20','filePath','468688ffsjXX','2850106DvgYfZ','message','sqlName','dbDirectory','dbId','catch','push','Local\x20directory\x20\x22','bool','sqlRoot','\x22\x20for\x20sqlCode\x20','path','relativePath','sqlRootDir','appCode','1436725PvCaMb','dbName','map','sql','version','\x20skipped,\x20','sqls','sqlCode','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','utf8','validation','sqlcode','startsWith','high-risk-write','572886ZiiuXB','No\x20database\x20matches\x20local\x20directory\x20\x22','replace','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock'];a173_0x31c7=function(){return _0x5b0ec5;};return a173_0x31c7();}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';function a173_0x1c1c(_0x5a600d,_0x397c3f){_0x5a600d=_0x5a600d-0x1c5;const _0x31c7d9=a173_0x31c7();let _0x1c1c6f=_0x31c7d9[_0x5a600d];return _0x1c1c6f;}import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x1caddf,_0x527097,_0x172ff8){const _0x19031b=a173_0x1c1c,_0x259010=await scanLocalSqlQueries(_0x1caddf),_0x4eeda0=new Map();for(const _0x312567 of _0x259010){if(_0x172ff8&&_0x312567[_0x19031b(0x1ca)]!==_0x172ff8)continue;const _0x2180af=_0x4eeda0['get'](_0x312567[_0x19031b(0x1ca)])??[];_0x2180af[_0x19031b(0x1fb)](_0x312567),_0x4eeda0['set'](_0x312567[_0x19031b(0x1ca)],_0x2180af);}if(_0x172ff8&&!_0x4eeda0[_0x19031b(0x1e7)](_0x172ff8))throw CliErrors[_0x19031b(0x1cd)](_0x19031b(0x1e5)+_0x172ff8);const _0xb9a470=[];for(const [_0x29908d,_0xbc98d7]of _0x4eeda0[_0x19031b(0x1ed)]()){if(_0xbc98d7['length']===0x1){_0xb9a470[_0x19031b(0x1fb)](_0xbc98d7[0x0]);continue;}const _0x27b686=_0x527097[_0x19031b(0x1c9)][_0x29908d],_0x11c926=_0x27b686?.[_0x19031b(0x200)],_0x325406=_0x11c926?_0xbc98d7[_0x19031b(0x1db)](_0x1c856e=>_0x1c856e['relativePath']!==_0x11c926):_0xbc98d7;if(_0x27b686&&_0x325406[_0x19031b(0x1dc)]===0x1){_0xb9a470['push'](_0x325406[0x0]);continue;}throw CliErrors[_0x19031b(0x1cd)](_0x19031b(0x1dd)+_0x29908d+'.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.');}return _0xb9a470;}export const sqlPush={'service':a173_0x948c4d(0x1c6),'command':a173_0x948c4d(0x1fb),'description':a173_0x948c4d(0x1ea),'risk':a173_0x948c4d(0x1d0),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a173_0x948c4d(0x1d9),'type':'boolean','description':a173_0x948c4d(0x1d4)}],async 'dryRun'(_0x359b80){const _0x52332e=a173_0x948c4d,_0x45385f=loadSqlProjectConfig(_0x359b80['appCode']),_0x4ca9c4=await readSqlLockFile(_0x45385f[_0x52332e(0x1d6)]),{appLock:_0x1deac0}=ensureSqlLockScope(_0x4ca9c4??createEmptySqlLock(),_0x359b80[_0x52332e(0x203)],_0x45385f['sqlRoot'],_0x52332e(0x1fb)),_0x3d7f03=await getTargetSqlQueries(_0x45385f,_0x1deac0,_0x359b80[_0x52332e(0x1e3)](_0x52332e(0x1ce))||undefined),_0x52e5f0=[];for(const _0x429912 of _0x3d7f03){const _0x1217aa=await computeSqlFileHash(_0x429912[_0x52332e(0x1f3)]),_0x15f89e=_0x1deac0[_0x52332e(0x1c9)][_0x429912[_0x52332e(0x1ca)]],_0x279462=!!_0x15f89e&&(_0x15f89e['path']!==_0x429912[_0x52332e(0x201)]||!!_0x429912[_0x52332e(0x1f7)]&&_0x15f89e[_0x52332e(0x1f7)]!==_0x429912[_0x52332e(0x1f7)]);if(!_0x359b80[_0x52332e(0x1fd)](_0x52332e(0x1d9))&&_0x15f89e&&_0x15f89e[_0x52332e(0x1ee)]===_0x1217aa&&!_0x279462)continue;_0x52e5f0[_0x52332e(0x1fb)](_0x429912[_0x52332e(0x1ca)]);}return{'method':_0x52332e(0x1f0),'url':'/smartapi/custom/updateUserCustomSql','body':{'sqlCodes':_0x52e5f0,'appCode':_0x359b80['appCode']},'description':'Would\x20push\x20'+_0x52e5f0[_0x52332e(0x1dc)]+_0x52332e(0x1e9)};},async 'execute'(_0x27d60e){const _0x4a4630=a173_0x948c4d,_0x476f1a=loadSqlProjectConfig(_0x27d60e['appCode']),_0x4c1ee0=await readSqlLockFile(_0x476f1a['lockFilePath']),{lockData:_0x21c598,appLock:_0x665578}=ensureSqlLockScope(_0x4c1ee0??createEmptySqlLock(),_0x27d60e[_0x4a4630(0x203)],_0x476f1a[_0x4a4630(0x1fe)],_0x4a4630(0x1fb)),_0x5b373a=await getTargetSqlQueries(_0x476f1a,_0x665578,_0x27d60e[_0x4a4630(0x1e3)](_0x4a4630(0x1ce))||undefined);if(_0x5b373a[_0x4a4630(0x1dc)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x4a4630(0x1ef)};const _0x2d2dd3=[],_0x4483d0=[],_0x3a8a48=[];for(const _0x5163aa of _0x5b373a){const _0x83afd6=_0x665578[_0x4a4630(0x1c9)][_0x5163aa[_0x4a4630(0x1ca)]];if(!_0x83afd6){_0x3a8a48[_0x4a4630(0x1fb)]({'sqlCode':_0x5163aa['sqlCode'],'error':_0x4a4630(0x1cb)});continue;}try{const _0x3e2d64=await computeSqlFileHash(_0x5163aa['filePath']),_0x10a1ae=_0x83afd6[_0x4a4630(0x200)]!==_0x5163aa['relativePath']||!!_0x5163aa['sqlName']&&_0x83afd6['sqlName']!==_0x5163aa[_0x4a4630(0x1f7)];if(!_0x27d60e['bool'](_0x4a4630(0x1d9))&&_0x83afd6['hash']===_0x3e2d64&&!_0x10a1ae){_0x4483d0[_0x4a4630(0x1fb)]({'sqlCode':_0x5163aa[_0x4a4630(0x1ca)],'reason':_0x4a4630(0x1f1)});continue;}if(_0x83afd6[_0x4a4630(0x1c7)]==null){_0x3a8a48[_0x4a4630(0x1fb)]({'sqlCode':_0x5163aa[_0x4a4630(0x1ca)],'error':'missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first'});continue;}const _0x557a15=await readFile(_0x5163aa[_0x4a4630(0x1f3)],_0x4a4630(0x1cc)),_0x30cf7b=stripLocalSqlMetadata(_0x557a15,_0x5163aa['mode']),_0x516328=_0x5163aa[_0x4a4630(0x1f7)]||_0x83afd6[_0x4a4630(0x1f7)],_0x13ba78=await resolveTargetDbBinding(_0x27d60e['appCode'],_0x5163aa,_0x83afd6),_0x424ebb=await updateSqlQuery({'id':_0x83afd6[_0x4a4630(0x1de)],'appCode':_0x27d60e[_0x4a4630(0x203)],'sqlCode':_0x5163aa['sqlCode'],'sqlName':_0x516328,'dbId':_0x13ba78['dbId'],'version':_0x83afd6[_0x4a4630(0x1c7)],'sqlContent':_0x30cf7b,'sqlConfig':_0x83afd6['sqlConfig']??undefined}),_0x518472=_0x424ebb[_0x4a4630(0x1f9)]?await getDbName(_0x27d60e[_0x4a4630(0x203)],Number(_0x424ebb[_0x4a4630(0x1f9)]))[_0x4a4630(0x1fa)](()=>_0x13ba78[_0x4a4630(0x205)]):_0x13ba78[_0x4a4630(0x205)];_0x665578[_0x4a4630(0x1c9)][_0x5163aa[_0x4a4630(0x1ca)]]={...buildSqlLockEntry(_0x424ebb,_0x30cf7b,_0x3e2d64,{'dbName':_0x518472}),'path':_0x5163aa['relativePath'],'mode':_0x83afd6['mode']},await archivePreviousSqlFileIfNeeded(_0x476f1a,_0x83afd6[_0x4a4630(0x200)],_0x5163aa[_0x4a4630(0x201)]),_0x2d2dd3[_0x4a4630(0x1fb)]({'sqlCode':_0x5163aa[_0x4a4630(0x1ca)],'remoteId':_0x83afd6['remoteId']});}catch(_0x382b03){_0x3a8a48['push']({'sqlCode':_0x5163aa[_0x4a4630(0x1ca)],'error':_0x382b03 instanceof Error?_0x382b03[_0x4a4630(0x1f6)]:String(_0x382b03)});}}return _0x665578[_0x4a4630(0x1e1)]=new Date()[_0x4a4630(0x1e2)](),await writeSqlLockFile(_0x476f1a[_0x4a4630(0x1d6)],_0x21c598),{'ok':_0x3a8a48[_0x4a4630(0x1dc)]===0x0,'data':{'pushed':_0x2d2dd3,'skipped':_0x4483d0,'failed':_0x3a8a48},'message':_0x4a4630(0x1ec)+_0x2d2dd3['length']+_0x4a4630(0x1f2)+_0x4483d0[_0x4a4630(0x1dc)]+_0x4a4630(0x1c8)+_0x3a8a48[_0x4a4630(0x1dc)]+'\x20failed'};}};async function archivePreviousSqlFileIfNeeded(_0x403d9a,_0x120a8a,_0x15179b){const _0x520f45=a173_0x948c4d;if(!_0x120a8a||_0x120a8a===_0x15179b)return;const _0x980eb3=join(_0x403d9a[_0x520f45(0x202)],_0x120a8a);if(!await fileExists(_0x980eb3))return;const _0x20c4e6=await moveToTrash(_0x403d9a[_0x520f45(0x1d8)],_0x403d9a[_0x520f45(0x1e8)],_0x980eb3);await cleanupEmptyDirectories(dirname(_0x980eb3),_0x403d9a[_0x520f45(0x202)]),void _0x20c4e6;}async function moveToTrash(_0x54504f,_0xa02a4b,_0x1262b6){const _0x3ed83c=a173_0x948c4d,_0x4ee370=new Date()[_0x3ed83c(0x1e2)]()[_0x3ed83c(0x1d3)](/[:.]/g,'-'),_0x56f422=relative(_0x54504f,_0x1262b6),_0x567e00=join(_0xa02a4b,_0x4ee370,_0x56f422);return await mkdir(dirname(_0x567e00),{'recursive':!![]}),await rename(_0x1262b6,_0x567e00),_0x567e00;}async function cleanupEmptyDirectories(_0x2f42a7,_0x41c03f){const _0x1c4dd9=a173_0x948c4d;let _0x808a65=resolve(_0x2f42a7);const _0x221461=resolve(_0x41c03f);while(_0x808a65[_0x1c4dd9(0x1cf)](''+_0x221461+sep)||_0x808a65===_0x221461){if(_0x808a65===_0x221461)return;try{const _0x54e9bf=await readdir(_0x808a65);if(_0x54e9bf[_0x1c4dd9(0x1dc)]>0x0)return;await rmdir(_0x808a65);}catch{return;}_0x808a65=dirname(_0x808a65);}}async function resolveTargetDbBinding(_0x84ce24,_0x182c4e,_0x3a2069){const _0x591710=a173_0x948c4d,_0x2a89ef=_0x182c4e[_0x591710(0x1f8)];if(!_0x2a89ef)return{'dbId':_0x3a2069[_0x591710(0x1f9)],'dbName':_0x3a2069[_0x591710(0x205)]};const _0x1609b3=buildDbDirectoryName(_0x3a2069['dbName'],_0x3a2069[_0x591710(0x1f9)]);if(_0x2a89ef===_0x1609b3)return{'dbId':_0x3a2069[_0x591710(0x1f9)],'dbName':_0x3a2069[_0x591710(0x205)]};const _0x38a982=parseExplicitDbDirectory(_0x2a89ef);if(_0x38a982!=null)return{'dbId':_0x38a982,'dbName':await getDbName(_0x84ce24,_0x38a982)[_0x591710(0x1fa)](()=>undefined)};const _0x35a9a7=await listDatabases(_0x84ce24),_0x3d407a=_0x35a9a7[_0x591710(0x1db)](_0x586928=>buildDbDirectoryName(_0x586928[_0x591710(0x205)],_0x586928[_0x591710(0x1f9)])===_0x2a89ef);if(_0x3d407a['length']===0x1)return{'dbId':_0x3d407a[0x0]['dbId'],'dbName':_0x3d407a[0x0][_0x591710(0x205)]};if(_0x3d407a[_0x591710(0x1dc)]===0x0)throw CliErrors[_0x591710(0x1cd)](_0x591710(0x1d2)+_0x2a89ef+_0x591710(0x1ff)+_0x182c4e[_0x591710(0x1ca)]+'.');const _0x24151f=_0x3d407a[_0x591710(0x1c5)](_0x534550=>_0x534550[_0x591710(0x205)]+'\x20('+_0x534550[_0x591710(0x1f9)]+')')[_0x591710(0x1eb)](',\x20');throw CliErrors[_0x591710(0x1cd)](_0x591710(0x1fc)+_0x2a89ef+_0x591710(0x1d7)+_0x182c4e[_0x591710(0x1ca)]+':\x20'+_0x24151f);}function parseExplicitDbDirectory(_0x159152){const _0x80af1e=a173_0x948c4d,_0x59ae9e=/^db-(\d+)$/['exec'](_0x159152);if(!_0x59ae9e)return null;const _0x28d57e=Number(_0x59ae9e[0x1]);return Number[_0x80af1e(0x1e6)](_0x28d57e)&&_0x28d57e>0x0?_0x28d57e:null;}
1
+ const a173_0x1839b9=a173_0x4ab2;(function(_0x4e4a00,_0x176912){const _0x54eb03=a173_0x4ab2,_0x2f2e2a=_0x4e4a00();while(!![]){try{const _0x20de16=-parseInt(_0x54eb03(0x1b5))/0x1+-parseInt(_0x54eb03(0x1b6))/0x2*(-parseInt(_0x54eb03(0x1a8))/0x3)+-parseInt(_0x54eb03(0x1a9))/0x4+parseInt(_0x54eb03(0x1c5))/0x5+parseInt(_0x54eb03(0x1b9))/0x6+parseInt(_0x54eb03(0x1ae))/0x7+parseInt(_0x54eb03(0x1ba))/0x8;if(_0x20de16===_0x176912)break;else _0x2f2e2a['push'](_0x2f2e2a['shift']());}catch(_0x500938){_0x2f2e2a['push'](_0x2f2e2a['shift']());}}}(a173_0x4d07,0xb11ba));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x49c6a0,_0x49c781,_0x16ed82){const _0x402b79=a173_0x4ab2,_0xc1d513=await scanLocalSqlQueries(_0x49c6a0),_0x2ed495=new Map();for(const _0x1844bc of _0xc1d513){if(_0x16ed82&&_0x1844bc[_0x402b79(0x1d2)]!==_0x16ed82)continue;const _0x1b0e3f=_0x2ed495['get'](_0x1844bc['sqlCode'])??[];_0x1b0e3f[_0x402b79(0x1c7)](_0x1844bc),_0x2ed495[_0x402b79(0x1b1)](_0x1844bc[_0x402b79(0x1d2)],_0x1b0e3f);}if(_0x16ed82&&!_0x2ed495[_0x402b79(0x1bd)](_0x16ed82))throw CliErrors[_0x402b79(0x1df)](_0x402b79(0x1b8)+_0x16ed82);const _0x13ed8a=[];for(const [_0x16c361,_0x154b48]of _0x2ed495[_0x402b79(0x1de)]()){if(_0x154b48['length']===0x1){_0x13ed8a[_0x402b79(0x1c7)](_0x154b48[0x0]);continue;}const _0x46dbaf=_0x49c781['sqls'][_0x16c361],_0x3d2f13=_0x46dbaf?.[_0x402b79(0x1cf)],_0x34beb9=_0x3d2f13?_0x154b48[_0x402b79(0x1d5)](_0x4828c2=>_0x4828c2[_0x402b79(0x1dc)]!==_0x3d2f13):_0x154b48;if(_0x46dbaf&&_0x34beb9['length']===0x1){_0x13ed8a['push'](_0x34beb9[0x0]);continue;}throw CliErrors['validation'](_0x402b79(0x1bf)+_0x16c361+'.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.');}return _0x13ed8a;}export const sqlPush={'service':a173_0x1839b9(0x1dd),'command':a173_0x1839b9(0x1c7),'description':a173_0x1839b9(0x1d6),'risk':a173_0x1839b9(0x1c4),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a173_0x1839b9(0x1c6),'type':a173_0x1839b9(0x1cb),'description':a173_0x1839b9(0x1ab)}],async 'dryRun'(_0x51006e){const _0x579cfd=a173_0x1839b9,_0x4242c0=loadSqlProjectConfig(_0x51006e[_0x579cfd(0x1e5)]),_0x9bf743=await readSqlLockFile(_0x4242c0[_0x579cfd(0x1da)]),{appLock:_0x546f71}=ensureSqlLockScope(_0x9bf743??createEmptySqlLock(),_0x51006e[_0x579cfd(0x1e5)],_0x4242c0[_0x579cfd(0x1c9)],_0x579cfd(0x1c7)),_0x16c233=await getTargetSqlQueries(_0x4242c0,_0x546f71,_0x51006e['str'](_0x579cfd(0x1c1))||undefined),_0x51851c=[];for(const _0x32dc7a of _0x16c233){const _0x41e885=await computeSqlFileHash(_0x32dc7a['filePath']),_0x3bae87=_0x546f71[_0x579cfd(0x1ce)][_0x32dc7a[_0x579cfd(0x1d2)]],_0x19405c=!!_0x3bae87&&(_0x3bae87[_0x579cfd(0x1cf)]!==_0x32dc7a[_0x579cfd(0x1dc)]||!!_0x32dc7a[_0x579cfd(0x1d9)]&&_0x3bae87['sqlName']!==_0x32dc7a[_0x579cfd(0x1d9)]);if(!_0x51006e[_0x579cfd(0x1db)]('force')&&_0x3bae87&&_0x3bae87['hash']===_0x41e885&&!_0x19405c)continue;_0x51851c[_0x579cfd(0x1c7)](_0x32dc7a[_0x579cfd(0x1d2)]);}return{'method':_0x579cfd(0x1af),'url':_0x579cfd(0x1ca),'body':{'sqlCodes':_0x51851c,'appCode':_0x51006e[_0x579cfd(0x1e5)]},'description':_0x579cfd(0x1e8)+_0x51851c[_0x579cfd(0x1e9)]+_0x579cfd(0x1d1)};},async 'execute'(_0x5ad2e3){const _0x5be17a=a173_0x1839b9,_0x15efec=loadSqlProjectConfig(_0x5ad2e3[_0x5be17a(0x1e5)]),_0x1c6de3=await readSqlLockFile(_0x15efec['lockFilePath']),{lockData:_0x203a26,appLock:_0x751eb9}=ensureSqlLockScope(_0x1c6de3??createEmptySqlLock(),_0x5ad2e3[_0x5be17a(0x1e5)],_0x15efec['sqlRoot'],_0x5be17a(0x1c7)),_0x357842=await getTargetSqlQueries(_0x15efec,_0x751eb9,_0x5ad2e3[_0x5be17a(0x1ac)](_0x5be17a(0x1c1))||undefined);if(_0x357842[_0x5be17a(0x1e9)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x5be17a(0x1d7)};const _0x1f2c08=[],_0x21aa2e=[],_0x4074b7=[];for(const _0x4df687 of _0x357842){const _0x13e3cc=_0x751eb9[_0x5be17a(0x1ce)][_0x4df687[_0x5be17a(0x1d2)]];if(!_0x13e3cc){_0x4074b7[_0x5be17a(0x1c7)]({'sqlCode':_0x4df687[_0x5be17a(0x1d2)],'error':'local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first'});continue;}try{const _0x231d9d=await computeSqlFileHash(_0x4df687[_0x5be17a(0x1e6)]),_0x396737=_0x13e3cc[_0x5be17a(0x1cf)]!==_0x4df687['relativePath']||!!_0x4df687[_0x5be17a(0x1d9)]&&_0x13e3cc[_0x5be17a(0x1d9)]!==_0x4df687[_0x5be17a(0x1d9)];if(!_0x5ad2e3[_0x5be17a(0x1db)](_0x5be17a(0x1c6))&&_0x13e3cc[_0x5be17a(0x1e0)]===_0x231d9d&&!_0x396737){_0x21aa2e['push']({'sqlCode':_0x4df687[_0x5be17a(0x1d2)],'reason':'unchanged'});continue;}if(_0x13e3cc[_0x5be17a(0x1e7)]==null){_0x4074b7[_0x5be17a(0x1c7)]({'sqlCode':_0x4df687[_0x5be17a(0x1d2)],'error':_0x5be17a(0x1b3)});continue;}const _0x4d9e38=await readFile(_0x4df687[_0x5be17a(0x1e6)],_0x5be17a(0x1d3)),_0x1d1f7e=stripLocalSqlMetadata(_0x4d9e38,_0x4df687[_0x5be17a(0x1c2)]),_0x549d61=_0x4df687['sqlName']||_0x13e3cc[_0x5be17a(0x1d9)],_0x4dc4bd=await resolveTargetDbBinding(_0x5ad2e3[_0x5be17a(0x1e5)],_0x4df687,_0x13e3cc),_0x332976=await updateSqlQuery({'id':_0x13e3cc['remoteId'],'appCode':_0x5ad2e3[_0x5be17a(0x1e5)],'sqlCode':_0x4df687['sqlCode'],'sqlName':_0x549d61,'dbId':_0x4dc4bd['dbId'],'version':_0x13e3cc[_0x5be17a(0x1e7)],'sqlContent':_0x1d1f7e,'sqlConfig':_0x13e3cc[_0x5be17a(0x1e4)]??undefined}),_0x1b439d=_0x332976[_0x5be17a(0x1c3)]?await getDbName(_0x5ad2e3[_0x5be17a(0x1e5)],Number(_0x332976[_0x5be17a(0x1c3)]))[_0x5be17a(0x1e2)](()=>_0x4dc4bd[_0x5be17a(0x1be)]):_0x4dc4bd[_0x5be17a(0x1be)];_0x751eb9[_0x5be17a(0x1ce)][_0x4df687['sqlCode']]={...buildSqlLockEntry(_0x332976,_0x1d1f7e,_0x231d9d,{'dbName':_0x1b439d}),'path':_0x4df687[_0x5be17a(0x1dc)],'mode':_0x13e3cc['mode']},await archivePreviousSqlFileIfNeeded(_0x15efec,_0x13e3cc['path'],_0x4df687[_0x5be17a(0x1dc)]),_0x1f2c08['push']({'sqlCode':_0x4df687[_0x5be17a(0x1d2)],'remoteId':_0x13e3cc['remoteId']});}catch(_0x7265e9){_0x4074b7[_0x5be17a(0x1c7)]({'sqlCode':_0x4df687[_0x5be17a(0x1d2)],'error':_0x7265e9 instanceof Error?_0x7265e9[_0x5be17a(0x1b2)]:String(_0x7265e9)});}}return _0x751eb9[_0x5be17a(0x1b0)]=new Date()['toISOString'](),await writeSqlLockFile(_0x15efec['lockFilePath'],_0x203a26),{'ok':_0x4074b7[_0x5be17a(0x1e9)]===0x0,'data':{'pushed':_0x1f2c08,'skipped':_0x21aa2e,'failed':_0x4074b7},'message':_0x5be17a(0x1cc)+_0x1f2c08[_0x5be17a(0x1e9)]+_0x5be17a(0x1d4)+_0x21aa2e[_0x5be17a(0x1e9)]+_0x5be17a(0x1b7)+_0x4074b7['length']+_0x5be17a(0x1c8)};}};function a173_0x4d07(){const _0x2354a8=['990026dmbdrj','\x20skipped,\x20','Local\x20SQL\x20not\x20found:\x20','2188098GkqNjS','9325880bqIbts','isFinite','join','has','dbName','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','\x22\x20for\x20sqlCode\x20','sqlcode','mode','dbId','high-risk-write','127310lHhrpM','force','push','\x20failed','sqlRoot','/smartapi/custom/updateUserCustomSql','boolean','Push\x20complete:\x20','toISOString','sqls','path','replace','\x20SQL\x20file(s)','sqlCode','utf8','\x20pushed,\x20','filter','Push\x20local\x20SQL\x20files\x20to\x20remote','No\x20local\x20SQL\x20files\x20found.','sqlRootDir','sqlName','lockFilePath','bool','relativePath','sql','entries','validation','hash','trashDir','catch','No\x20database\x20matches\x20local\x20directory\x20\x22','sqlConfig','appCode','filePath','version','Would\x20push\x20','length','exec','3zJdbxT','3139020vteTOG','startsWith','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','str','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','6095152CiEhxC','POST','lastSync','set','message','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','projectRoot','1411440VKboer'];a173_0x4d07=function(){return _0x2354a8;};return a173_0x4d07();}function a173_0x4ab2(_0x46573c,_0x5401ec){_0x46573c=_0x46573c-0x1a8;const _0x4d07a0=a173_0x4d07();let _0x4ab24b=_0x4d07a0[_0x46573c];return _0x4ab24b;}async function archivePreviousSqlFileIfNeeded(_0x1d9705,_0x17611c,_0x4c3bc1){const _0x59aa34=a173_0x1839b9;if(!_0x17611c||_0x17611c===_0x4c3bc1)return;const _0x585135=join(_0x1d9705['sqlRootDir'],_0x17611c);if(!await fileExists(_0x585135))return;const _0x191caa=await moveToTrash(_0x1d9705[_0x59aa34(0x1b4)],_0x1d9705[_0x59aa34(0x1e1)],_0x585135);await cleanupEmptyDirectories(dirname(_0x585135),_0x1d9705[_0x59aa34(0x1d8)]),void _0x191caa;}async function moveToTrash(_0x22710a,_0x3e81a4,_0x21176b){const _0x3ee9b8=a173_0x1839b9,_0x59b0c4=new Date()[_0x3ee9b8(0x1cd)]()[_0x3ee9b8(0x1d0)](/[:.]/g,'-'),_0xeb372d=relative(_0x22710a,_0x21176b),_0x9b88cc=join(_0x3e81a4,_0x59b0c4,_0xeb372d);return await mkdir(dirname(_0x9b88cc),{'recursive':!![]}),await rename(_0x21176b,_0x9b88cc),_0x9b88cc;}async function cleanupEmptyDirectories(_0x3eab05,_0x19adf1){const _0x109e45=a173_0x1839b9;let _0x2f1e4e=resolve(_0x3eab05);const _0x145892=resolve(_0x19adf1);while(_0x2f1e4e[_0x109e45(0x1aa)](''+_0x145892+sep)||_0x2f1e4e===_0x145892){if(_0x2f1e4e===_0x145892)return;try{const _0x53f95d=await readdir(_0x2f1e4e);if(_0x53f95d[_0x109e45(0x1e9)]>0x0)return;await rmdir(_0x2f1e4e);}catch{return;}_0x2f1e4e=dirname(_0x2f1e4e);}}async function resolveTargetDbBinding(_0x3188ef,_0x4ad894,_0x34202b){const _0x1de28c=a173_0x1839b9,_0x440ac4=_0x4ad894['dbDirectory'];if(!_0x440ac4)return{'dbId':_0x34202b[_0x1de28c(0x1c3)],'dbName':_0x34202b[_0x1de28c(0x1be)]};const _0x3b815c=buildDbDirectoryName(_0x34202b[_0x1de28c(0x1be)],_0x34202b['dbId']);if(_0x440ac4===_0x3b815c)return{'dbId':_0x34202b['dbId'],'dbName':_0x34202b[_0x1de28c(0x1be)]};const _0x52375d=parseExplicitDbDirectory(_0x440ac4);if(_0x52375d!=null)return{'dbId':_0x52375d,'dbName':await getDbName(_0x3188ef,_0x52375d)['catch'](()=>undefined)};const _0x48f845=await listDatabases(_0x3188ef),_0x4596f8=_0x48f845[_0x1de28c(0x1d5)](_0x1d6783=>buildDbDirectoryName(_0x1d6783['dbName'],_0x1d6783[_0x1de28c(0x1c3)])===_0x440ac4);if(_0x4596f8[_0x1de28c(0x1e9)]===0x1)return{'dbId':_0x4596f8[0x0][_0x1de28c(0x1c3)],'dbName':_0x4596f8[0x0][_0x1de28c(0x1be)]};if(_0x4596f8['length']===0x0)throw CliErrors['validation'](_0x1de28c(0x1e3)+_0x440ac4+_0x1de28c(0x1c0)+_0x4ad894[_0x1de28c(0x1d2)]+'.');const _0x5ebc6a=_0x4596f8['map'](_0xb53095=>_0xb53095[_0x1de28c(0x1be)]+'\x20('+_0xb53095['dbId']+')')[_0x1de28c(0x1bc)](',\x20');throw CliErrors[_0x1de28c(0x1df)]('Local\x20directory\x20\x22'+_0x440ac4+_0x1de28c(0x1ad)+_0x4ad894['sqlCode']+':\x20'+_0x5ebc6a);}function parseExplicitDbDirectory(_0x571bdd){const _0x58afc8=a173_0x1839b9,_0xe4a8b7=/^db-(\d+)$/[_0x58afc8(0x1ea)](_0x571bdd);if(!_0xe4a8b7)return null;const _0x153dca=Number(_0xe4a8b7[0x1]);return Number[_0x58afc8(0x1bb)](_0x153dca)&&_0x153dca>0x0?_0x153dca:null;}
@@ -1 +1 @@
1
- const a174_0xf25f30=a174_0x121b;(function(_0x9d284d,_0x156058){const _0x5ae68a=a174_0x121b,_0x4786b8=_0x9d284d();while(!![]){try{const _0x3ba475=-parseInt(_0x5ae68a(0x131))/0x1+-parseInt(_0x5ae68a(0x13f))/0x2+-parseInt(_0x5ae68a(0x139))/0x3*(-parseInt(_0x5ae68a(0x135))/0x4)+parseInt(_0x5ae68a(0x13e))/0x5*(parseInt(_0x5ae68a(0x13a))/0x6)+parseInt(_0x5ae68a(0x134))/0x7+-parseInt(_0x5ae68a(0x12e))/0x8*(-parseInt(_0x5ae68a(0x13c))/0x9)+-parseInt(_0x5ae68a(0x138))/0xa;if(_0x3ba475===_0x156058)break;else _0x4786b8['push'](_0x4786b8['shift']());}catch(_0x3d006b){_0x4786b8['push'](_0x4786b8['shift']());}}}(a174_0x315d,0x8f9ec));function a174_0x121b(_0x5437e5,_0x401125){_0x5437e5=_0x5437e5-0x12d;const _0x315df8=a174_0x315d();let _0x121b05=_0x315df8[_0x5437e5];return _0x121b05;}import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';const SQL_SAVE_DEPRECATED_HINT=[a174_0xf25f30(0x140),a174_0xf25f30(0x12f),'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']('\x0a');export const sqlSave={'service':a174_0xf25f30(0x141),'command':a174_0xf25f30(0x130),'description':a174_0xf25f30(0x136),'risk':'write','requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a174_0xf25f30(0x12d),'type':a174_0xf25f30(0x133),'required':!![],'description':'Path\x20to\x20the\x20SQL\x20file'},SQLCODE_FLAG_OPTIONAL,{'name':a174_0xf25f30(0x13d),'type':'string','description':a174_0xf25f30(0x13b)},{'name':'db','type':a174_0xf25f30(0x133),'description':a174_0xf25f30(0x137)},{'name':'description','type':'string','description':'Query\x20description'}],async 'validate'(){const _0x179354=a174_0xf25f30;throw CliErrors[_0x179354(0x132)](SQL_SAVE_DEPRECATED_HINT);},async 'execute'(){const _0x1f5e69=a174_0xf25f30;throw CliErrors[_0x1f5e69(0x132)](SQL_SAVE_DEPRECATED_HINT);}};function a174_0x315d(){const _0x2fab62=['SQL\x20query\x20display\x20name','198SioJZy','sqlname','10yVruPd','807670DPDYuv','`rabetbase\x20sql\x20save`\x20has\x20been\x20deprecated.','sql','file','311768fcaSLl','Create\x20new\x20SQL\x20with\x20`rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml`.','save','811824pMVkcX','validation','string','5199922mEnhjs','4yFYzdd','Deprecated:\x20use\x20sql\x20create\x20to\x20create\x20and\x20sql\x20push\x20to\x20update','Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)','2193180Ciphol','498831jCWQJL','770280KhmyVl'];a174_0x315d=function(){return _0x2fab62;};return a174_0x315d();}
1
+ const a174_0x226cf1=a174_0x12b6;(function(_0x5a8760,_0x78c429){const _0x46da75=a174_0x12b6,_0x252600=_0x5a8760();while(!![]){try{const _0x19f2aa=-parseInt(_0x46da75(0x173))/0x1*(-parseInt(_0x46da75(0x183))/0x2)+parseInt(_0x46da75(0x17d))/0x3*(-parseInt(_0x46da75(0x180))/0x4)+-parseInt(_0x46da75(0x170))/0x5+parseInt(_0x46da75(0x176))/0x6*(parseInt(_0x46da75(0x184))/0x7)+parseInt(_0x46da75(0x182))/0x8+parseInt(_0x46da75(0x178))/0x9+-parseInt(_0x46da75(0x172))/0xa;if(_0x19f2aa===_0x78c429)break;else _0x252600['push'](_0x252600['shift']());}catch(_0x50c881){_0x252600['push'](_0x252600['shift']());}}}(a174_0x28ad,0x24826));function a174_0x28ad(){const _0x13c164=['write','string','786279CPodxr','Query\x20description','join','4BHaOkN','file','2325976YbMyVT','2yGZvit','22162EXDitL','sql','`rabetbase\x20sql\x20save`\x20has\x20been\x20deprecated.','737435giBhag','SQL\x20query\x20display\x20name','2197390CWtOrV','163019fsnUGf','sqlname','validation','396rhsxou','Create\x20new\x20SQL\x20with\x20`rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml`.','1045251Mtvtbi','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`.','Path\x20to\x20the\x20SQL\x20file'];a174_0x28ad=function(){return _0x13c164;};return a174_0x28ad();}import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a174_0x12b6(_0x2bb56d,_0x66edcb){_0x2bb56d=_0x2bb56d-0x16f;const _0x28ad08=a174_0x28ad();let _0x12b6a2=_0x28ad08[_0x2bb56d];return _0x12b6a2;}const SQL_SAVE_DEPRECATED_HINT=[a174_0x226cf1(0x16f),a174_0x226cf1(0x177),a174_0x226cf1(0x179)][a174_0x226cf1(0x17f)]('\x0a');export const sqlSave={'service':a174_0x226cf1(0x185),'command':'save','description':'Deprecated:\x20use\x20sql\x20create\x20to\x20create\x20and\x20sql\x20push\x20to\x20update','risk':a174_0x226cf1(0x17b),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a174_0x226cf1(0x181),'type':a174_0x226cf1(0x17c),'required':!![],'description':a174_0x226cf1(0x17a)},SQLCODE_FLAG_OPTIONAL,{'name':a174_0x226cf1(0x174),'type':'string','description':a174_0x226cf1(0x171)},{'name':'db','type':a174_0x226cf1(0x17c),'description':'Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)'},{'name':'description','type':'string','description':a174_0x226cf1(0x17e)}],async 'validate'(){const _0x457aa4=a174_0x226cf1;throw CliErrors[_0x457aa4(0x175)](SQL_SAVE_DEPRECATED_HINT);},async 'execute'(){const _0x4f82e5=a174_0x226cf1;throw CliErrors[_0x4f82e5(0x175)](SQL_SAVE_DEPRECATED_HINT);}};
@@ -1 +1 @@
1
- function a175_0x384c(_0x5b647b,_0x44f54b){_0x5b647b=_0x5b647b-0x6b;const _0x5f3490=a175_0x5f34();let _0x384c34=_0x5f3490[_0x5b647b];return _0x384c34;}const a175_0x4a22fe=a175_0x384c;(function(_0xbe112e,_0x2d5535){const _0x220576=a175_0x384c,_0x2aac16=_0xbe112e();while(!![]){try{const _0x66471d=parseInt(_0x220576(0x6e))/0x1*(-parseInt(_0x220576(0x72))/0x2)+parseInt(_0x220576(0x6c))/0x3*(-parseInt(_0x220576(0x97))/0x4)+-parseInt(_0x220576(0x99))/0x5*(-parseInt(_0x220576(0x71))/0x6)+-parseInt(_0x220576(0x80))/0x7+-parseInt(_0x220576(0x96))/0x8+parseInt(_0x220576(0x87))/0x9*(parseInt(_0x220576(0x91))/0xa)+parseInt(_0x220576(0x86))/0xb;if(_0x66471d===_0x2d5535)break;else _0x2aac16['push'](_0x2aac16['shift']());}catch(_0x3616fd){_0x2aac16['push'](_0x2aac16['shift']());}}}(a175_0x5f34,0xe5b87));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=a175_0x4a22fe(0x6f);export function buildSqlLockEntry(_0x2cd7a9,_0x462278,_0xea5a12,_0x116ba9){const _0x5df8db=a175_0x4a22fe,_0x493067=detectSqlMode(_0x462278);return{'path':buildSqlRelativePath(_0x2cd7a9[_0x5df8db(0x7c)],_0x2cd7a9[_0x5df8db(0x82)],_0x116ba9?.[_0x5df8db(0x95)],_0x493067,_0x2cd7a9['dbId']),'hash':_0xea5a12,'remoteId':_0x2cd7a9['id'],'version':_0x2cd7a9['version'],'dbId':Number(_0x2cd7a9['dbId']),'dbName':_0x116ba9?.[_0x5df8db(0x95)],'sqlName':_0x2cd7a9['sqlName'],'sqlConfig':_0x2cd7a9['sqlConfig']??undefined,'mode':_0x493067};}export function cloneSqlLockData(_0x4ba5d7){const _0x1cc974=a175_0x4a22fe;return{'apps':Object[_0x1cc974(0x7d)](Object[_0x1cc974(0x88)](_0x4ba5d7[_0x1cc974(0x8e)])['map'](([_0x2d0a7b,_0x38b680])=>[_0x2d0a7b,{'sqlRoot':_0x38b680[_0x1cc974(0x79)],'lastSync':_0x38b680[_0x1cc974(0x92)],'sqls':{..._0x38b680[_0x1cc974(0x6b)]}}]))};}export function ensureRemoteSqlContent(_0x43e907){const _0xcb395=a175_0x4a22fe;return _0x43e907[_0xcb395(0x83)]??'';}export function buildLocalSqlFileContent(_0x29ac86,_0x4f3aa4,_0x456999){const _0x4024b5=a175_0x4a22fe,_0x487472=_0x456999?.[_0x4024b5(0x74)]??detectSqlMode(_0x4f3aa4),_0x3639a8=stripLocalSqlMetadata(_0x4f3aa4,_0x487472)['trim'](),_0x3aa998=[...buildMetadataHeaderLines({'sqlCode':_0x29ac86['sqlCode'],'sqlName':_0x29ac86['sqlName'],'dbId':_0x29ac86[_0x4024b5(0x94)],'dbName':_0x456999?.[_0x4024b5(0x95)],'mode':_0x487472,'syncedAt':_0x456999?.[_0x4024b5(0x7f)],'description':_0x456999?.[_0x4024b5(0x6d)]},_0x487472),'',_0x3639a8],_0x106aa6=_0x3aa998[_0x4024b5(0x8d)]('\x0a');return _0x106aa6[_0x4024b5(0x93)]('\x0a')?_0x106aa6:_0x106aa6+'\x0a';}export function stripLocalSqlMetadata(_0x27d582,_0xfd792b){const _0x4f7ee1=a175_0x4a22fe,_0x1d2944=_0x27d582[_0x4f7ee1(0x8b)](/\r\n/g,'\x0a')[_0x4f7ee1(0x98)]('\x0a'),_0x192431=[];let _0x2c999a=0x0;if(_0xfd792b==='mybatisXml')while(_0x2c999a<_0x1d2944['length']){const _0xc2ad46=_0x1d2944[_0x2c999a]??'';if(/^\s*<!--\s*@lovrabet\./[_0x4f7ee1(0x85)](_0xc2ad46)){_0x2c999a++;continue;}if(_0xc2ad46['trim']()===''&&_0x2c999a>0x0){_0x2c999a++;continue;}break;}else while(_0x2c999a<_0x1d2944[_0x4f7ee1(0x84)]){const _0x1fa321=_0x1d2944[_0x2c999a]??'';if(/^\s*--\s*@lovrabet\./[_0x4f7ee1(0x85)](_0x1fa321)){_0x2c999a++;continue;}if(_0x1fa321[_0x4f7ee1(0x73)]()===''&&_0x2c999a>0x0){_0x2c999a++;continue;}break;}for(;_0x2c999a<_0x1d2944[_0x4f7ee1(0x84)];_0x2c999a++){_0x192431['push'](_0x1d2944[_0x2c999a]);}return _0x192431['join']('\x0a')[_0x4f7ee1(0x77)]();}export function resolveSqlMode(_0x1e33d9,_0x161289){const _0x5f174e=a175_0x4a22fe;if(_0x161289?.[_0x5f174e(0x74)])return _0x161289[_0x5f174e(0x74)];return detectSqlMode(_0x1e33d9);}export function resolveSqlFileName(_0x21f73e,_0x21fd1e,_0x42d212){const _0x451537=a175_0x4a22fe;if(_0x42d212?.['path'])return _0x42d212[_0x451537(0x7a)];if(_0x42d212?.['sqlName']||_0x42d212?.[_0x451537(0x95)])return buildSqlRelativePath(_0x21f73e,_0x42d212?.['sqlName'],_0x42d212?.[_0x451537(0x95)],resolveSqlMode(_0x21fd1e,_0x42d212),_0x42d212?.[_0x451537(0x94)]);return buildDefaultSqlFileName(_0x21f73e,resolveSqlMode(_0x21fd1e,_0x42d212));}export function resolveSqlLocalDir(_0x592ae6,_0x3ad71e){return join(_0x592ae6,SQL_LOCAL_REL_DIR,_0x3ad71e);}export async function confirmForceOverwrite(_0x2a3b47){const _0x38dcb6=a175_0x4a22fe,_0x22f15f=createInterface({'input':process[_0x38dcb6(0x78)],'output':process['stderr']}),_0x28309f=await new Promise(_0xb82e01=>{const _0x5995aa=_0x38dcb6;_0x22f15f[_0x5995aa(0x7b)](_0x2a3b47+_0x5995aa(0x76),_0xb82e01);});return _0x22f15f[_0x38dcb6(0x8c)](),['y',_0x38dcb6(0x70)][_0x38dcb6(0x89)](_0x28309f[_0x38dcb6(0x73)]()['toLowerCase']());}function a175_0x5f34(){const _0x26c1a4=['close','join','apps','mybatisXml','filter','1850rprvSt','lastSync','endsWith','dbId','dbName','4971296ZxFdBn','4678588AYsORu','split','78775zktRGB','sqls','3OFBKwR','description','13ykpkIr','.rabetbase/sql','yes','606yiqLHb','189644IguViD','trim','mode','map','\x20[y/N]\x20','trimStart','stdin','sqlRoot','path','question','sqlCode','fromEntries','--\x20@lovrabet.','syncedAt','4879847YeaAEk','\x20-->','sqlName','sqlContent','length','test','29130101TVNtfo','20547otrrxv','entries','includes','<!--\x20@lovrabet.','replace'];a175_0x5f34=function(){return _0x26c1a4;};return a175_0x5f34();}export function findSqlLockScope(_0x5255ad,_0x4034a6){const _0x1d192b=a175_0x4a22fe;return _0x5255ad[_0x1d192b(0x8e)][_0x4034a6];}function buildMetadataHeaderLines(_0x32621f,_0x5c6d4d){const _0x1b8b1c=a175_0x4a22fe,_0x100101=[[_0x1b8b1c(0x7c),_0x32621f['sqlCode']],['sqlName',_0x32621f[_0x1b8b1c(0x82)]],[_0x1b8b1c(0x94),_0x32621f[_0x1b8b1c(0x94)]],[_0x1b8b1c(0x95),_0x32621f[_0x1b8b1c(0x95)]],[_0x1b8b1c(0x74),_0x32621f[_0x1b8b1c(0x74)]],[_0x1b8b1c(0x7f),_0x32621f[_0x1b8b1c(0x7f)]],[_0x1b8b1c(0x6d),_0x32621f[_0x1b8b1c(0x6d)]]];if(_0x5c6d4d===_0x1b8b1c(0x8f))return _0x100101[_0x1b8b1c(0x90)](([,_0x10ea87])=>_0x10ea87!==undefined&&_0x10ea87!==null&&String(_0x10ea87)[_0x1b8b1c(0x73)]()!=='')[_0x1b8b1c(0x75)](([_0x301a73,_0x31fba1])=>_0x1b8b1c(0x8a)+_0x301a73+':\x20'+String(_0x31fba1)+_0x1b8b1c(0x81));return _0x100101['filter'](([,_0x109c77])=>_0x109c77!==undefined&&_0x109c77!==null&&String(_0x109c77)[_0x1b8b1c(0x73)]()!=='')[_0x1b8b1c(0x75)](([_0x4f9a4a,_0x61797a])=>_0x1b8b1c(0x7e)+_0x4f9a4a+':\x20'+String(_0x61797a));}
1
+ const a175_0x454287=a175_0x401d;(function(_0x4cfd46,_0x109656){const _0x147fa3=a175_0x401d,_0x1ec9c0=_0x4cfd46();while(!![]){try{const _0x1f6cf1=-parseInt(_0x147fa3(0x79))/0x1+-parseInt(_0x147fa3(0x66))/0x2*(parseInt(_0x147fa3(0x8f))/0x3)+-parseInt(_0x147fa3(0x80))/0x4*(parseInt(_0x147fa3(0x91))/0x5)+-parseInt(_0x147fa3(0x81))/0x6+parseInt(_0x147fa3(0x72))/0x7+parseInt(_0x147fa3(0x77))/0x8+parseInt(_0x147fa3(0x76))/0x9;if(_0x1f6cf1===_0x109656)break;else _0x1ec9c0['push'](_0x1ec9c0['shift']());}catch(_0x161f12){_0x1ec9c0['push'](_0x1ec9c0['shift']());}}}(a175_0x3001,0xc9918));function a175_0x401d(_0x21c90e,_0x574445){_0x21c90e=_0x21c90e-0x65;const _0x3001d7=a175_0x3001();let _0x401d4a=_0x3001d7[_0x21c90e];return _0x401d4a;}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=a175_0x454287(0x73);export function buildSqlLockEntry(_0x2d64f8,_0x3850b3,_0x2b22e8,_0x571fc7){const _0x4f9c51=a175_0x454287,_0xebf4d9=detectSqlMode(_0x3850b3);return{'path':buildSqlRelativePath(_0x2d64f8[_0x4f9c51(0x83)],_0x2d64f8['sqlName'],_0x571fc7?.[_0x4f9c51(0x69)],_0xebf4d9,_0x2d64f8[_0x4f9c51(0x6f)]),'hash':_0x2b22e8,'remoteId':_0x2d64f8['id'],'version':_0x2d64f8[_0x4f9c51(0x87)],'dbId':Number(_0x2d64f8[_0x4f9c51(0x6f)]),'dbName':_0x571fc7?.[_0x4f9c51(0x69)],'sqlName':_0x2d64f8['sqlName'],'sqlConfig':_0x2d64f8[_0x4f9c51(0x6c)]??undefined,'mode':_0xebf4d9};}export function cloneSqlLockData(_0x2a2845){const _0x434b19=a175_0x454287;return{'apps':Object[_0x434b19(0x75)](Object[_0x434b19(0x84)](_0x2a2845['apps'])[_0x434b19(0x74)](([_0x1506b9,_0x5d9a3c])=>[_0x1506b9,{'sqlRoot':_0x5d9a3c['sqlRoot'],'lastSync':_0x5d9a3c[_0x434b19(0x8b)],'sqls':{..._0x5d9a3c['sqls']}}]))};}export function ensureRemoteSqlContent(_0x3fe3cb){return _0x3fe3cb['sqlContent']??'';}export function buildLocalSqlFileContent(_0x410db5,_0x233d2c,_0x10ed9c){const _0x21f3ca=a175_0x454287,_0x46e706=_0x10ed9c?.['mode']??detectSqlMode(_0x233d2c),_0x2c8d09=stripLocalSqlMetadata(_0x233d2c,_0x46e706)[_0x21f3ca(0x85)](),_0x13a82a=[...buildMetadataHeaderLines({'sqlCode':_0x410db5['sqlCode'],'sqlName':_0x410db5[_0x21f3ca(0x67)],'dbId':_0x410db5[_0x21f3ca(0x6f)],'dbName':_0x10ed9c?.[_0x21f3ca(0x69)],'mode':_0x46e706,'syncedAt':_0x10ed9c?.[_0x21f3ca(0x7d)],'description':_0x10ed9c?.[_0x21f3ca(0x70)]},_0x46e706),'',_0x2c8d09],_0x5d1dd5=_0x13a82a[_0x21f3ca(0x65)]('\x0a');return _0x5d1dd5[_0x21f3ca(0x89)]('\x0a')?_0x5d1dd5:_0x5d1dd5+'\x0a';}export function stripLocalSqlMetadata(_0x29a4e8,_0xa2dc02){const _0x2ce52a=a175_0x454287,_0x566641=_0x29a4e8[_0x2ce52a(0x7c)](/\r\n/g,'\x0a')[_0x2ce52a(0x68)]('\x0a'),_0x356457=[];let _0x57bdf4=0x0;if(_0xa2dc02===_0x2ce52a(0x78))while(_0x57bdf4<_0x566641[_0x2ce52a(0x90)]){const _0x437625=_0x566641[_0x57bdf4]??'';if(/^\s*<!--\s*@lovrabet\./[_0x2ce52a(0x86)](_0x437625)){_0x57bdf4++;continue;}if(_0x437625['trim']()===''&&_0x57bdf4>0x0){_0x57bdf4++;continue;}break;}else while(_0x57bdf4<_0x566641[_0x2ce52a(0x90)]){const _0x3d2dc2=_0x566641[_0x57bdf4]??'';if(/^\s*--\s*@lovrabet\./[_0x2ce52a(0x86)](_0x3d2dc2)){_0x57bdf4++;continue;}if(_0x3d2dc2['trim']()===''&&_0x57bdf4>0x0){_0x57bdf4++;continue;}break;}for(;_0x57bdf4<_0x566641[_0x2ce52a(0x90)];_0x57bdf4++){_0x356457[_0x2ce52a(0x88)](_0x566641[_0x57bdf4]);}return _0x356457[_0x2ce52a(0x65)]('\x0a')[_0x2ce52a(0x6a)]();}export function resolveSqlMode(_0xb6724,_0x5a03b3){if(_0x5a03b3?.['mode'])return _0x5a03b3['mode'];return detectSqlMode(_0xb6724);}function a175_0x3001(){const _0x456edb=['sqlConfig','question','includes','dbId','description','path','2345560LEAEeC','.rabetbase/sql','map','fromEntries','17097867YdyOqd','11588920LigAhD','mybatisXml','395198zoBVpp','filter','mode','replace','syncedAt','\x20[y/N]\x20','close','4lwBeRc','4182528qLXOyc','toLowerCase','sqlCode','entries','trim','test','version','push','endsWith','\x20-->','lastSync','apps','yes','stdin','1576866mhPddX','length','6199630syhktI','join','2nKoGbl','sqlName','split','dbName','trimStart','--\x20@lovrabet.'];a175_0x3001=function(){return _0x456edb;};return a175_0x3001();}export function resolveSqlFileName(_0x4ea6de,_0x4bd37e,_0x4c579f){const _0x5823ec=a175_0x454287;if(_0x4c579f?.[_0x5823ec(0x71)])return _0x4c579f[_0x5823ec(0x71)];if(_0x4c579f?.[_0x5823ec(0x67)]||_0x4c579f?.[_0x5823ec(0x69)])return buildSqlRelativePath(_0x4ea6de,_0x4c579f?.[_0x5823ec(0x67)],_0x4c579f?.['dbName'],resolveSqlMode(_0x4bd37e,_0x4c579f),_0x4c579f?.['dbId']);return buildDefaultSqlFileName(_0x4ea6de,resolveSqlMode(_0x4bd37e,_0x4c579f));}export function resolveSqlLocalDir(_0x37357b,_0xb701d2){return join(_0x37357b,SQL_LOCAL_REL_DIR,_0xb701d2);}export async function confirmForceOverwrite(_0x2f11eb){const _0x35413d=a175_0x454287,_0x2a54cb=createInterface({'input':process[_0x35413d(0x8e)],'output':process['stderr']}),_0x5ad00f=await new Promise(_0x251d28=>{const _0x31d83b=_0x35413d;_0x2a54cb[_0x31d83b(0x6d)](_0x2f11eb+_0x31d83b(0x7e),_0x251d28);});return _0x2a54cb[_0x35413d(0x7f)](),['y',_0x35413d(0x8d)][_0x35413d(0x6e)](_0x5ad00f[_0x35413d(0x85)]()[_0x35413d(0x82)]());}export function findSqlLockScope(_0x1672b3,_0x54c717){const _0x5064ee=a175_0x454287;return _0x1672b3[_0x5064ee(0x8c)][_0x54c717];}function buildMetadataHeaderLines(_0x2ee808,_0x125a4d){const _0x2192ba=a175_0x454287,_0x41d8eb=[[_0x2192ba(0x83),_0x2ee808['sqlCode']],[_0x2192ba(0x67),_0x2ee808[_0x2192ba(0x67)]],[_0x2192ba(0x6f),_0x2ee808[_0x2192ba(0x6f)]],[_0x2192ba(0x69),_0x2ee808[_0x2192ba(0x69)]],[_0x2192ba(0x7b),_0x2ee808['mode']],[_0x2192ba(0x7d),_0x2ee808[_0x2192ba(0x7d)]],[_0x2192ba(0x70),_0x2ee808[_0x2192ba(0x70)]]];if(_0x125a4d==='mybatisXml')return _0x41d8eb[_0x2192ba(0x7a)](([,_0x39875c])=>_0x39875c!==undefined&&_0x39875c!==null&&String(_0x39875c)['trim']()!=='')[_0x2192ba(0x74)](([_0x467208,_0x5e8966])=>'<!--\x20@lovrabet.'+_0x467208+':\x20'+String(_0x5e8966)+_0x2192ba(0x8a));return _0x41d8eb[_0x2192ba(0x7a)](([,_0x226bdc])=>_0x226bdc!==undefined&&_0x226bdc!==null&&String(_0x226bdc)[_0x2192ba(0x85)]()!=='')[_0x2192ba(0x74)](([_0x3d992c,_0x18cc6e])=>_0x2192ba(0x6b)+_0x3d992c+':\x20'+String(_0x18cc6e));}
@@ -1 +1 @@
1
- const a176_0x591f7e=a176_0x2bbf;(function(_0x299565,_0x2649b7){const _0x485202=a176_0x2bbf,_0x2b3765=_0x299565();while(!![]){try{const _0x1777ea=-parseInt(_0x485202(0x15e))/0x1+-parseInt(_0x485202(0x168))/0x2*(-parseInt(_0x485202(0x156))/0x3)+parseInt(_0x485202(0x161))/0x4+parseInt(_0x485202(0x16e))/0x5+-parseInt(_0x485202(0x163))/0x6+-parseInt(_0x485202(0x175))/0x7*(-parseInt(_0x485202(0x16b))/0x8)+-parseInt(_0x485202(0x16a))/0x9;if(_0x1777ea===_0x2649b7)break;else _0x2b3765['push'](_0x2b3765['shift']());}catch(_0x1f7975){_0x2b3765['push'](_0x2b3765['shift']());}}}(a176_0x540e,0x2e62b));import{listSqlQueries}from'../../core/api-client.js';function a176_0x2bbf(_0x15a2e4,_0x1d8cdd){_0x15a2e4=_0x15a2e4-0x154;const _0x540ec4=a176_0x540e();let _0x2bbf6c=_0x540ec4[_0x15a2e4];return _0x2bbf6c;}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(_0x48b88a){const _0x12bb37=a176_0x2bbf,_0x5002c0=[];let _0x6b9835=0x1;while(!![]){const _0x260d7d=await listSqlQueries(_0x48b88a,{'currentPage':_0x6b9835,'pageSize':PAGE_SIZE}),_0x291fb3=_0x260d7d[_0x12bb37(0x157)]??[];_0x5002c0[_0x12bb37(0x169)](..._0x291fb3[_0x12bb37(0x15c)](_0x1b1d92=>_0x1b1d92['sqlCode']));if(_0x291fb3['length']===0x0)break;const _0x5a233c=_0x260d7d[_0x12bb37(0x155)]?.['totalCount'];if(_0x5a233c!=null?_0x5002c0[_0x12bb37(0x173)]>=_0x5a233c:_0x291fb3[_0x12bb37(0x173)]<PAGE_SIZE)break;_0x6b9835++;}return _0x5002c0;}export const sqlStatus={'service':a176_0x591f7e(0x15a),'command':a176_0x591f7e(0x162),'description':a176_0x591f7e(0x171),'risk':'read','flags':[{'name':a176_0x591f7e(0x159),'type':a176_0x591f7e(0x166),'description':'Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally'}],async 'execute'(_0x3ce0ec){const _0x20dae5=a176_0x591f7e,_0x524080=loadSqlProjectConfig(_0x3ce0ec[_0x20dae5(0x172)]),_0x1a8559=await readSqlLockFile(_0x524080[_0x20dae5(0x176)]),{appLock:_0x31db38}=ensureSqlLockScope(_0x1a8559??createEmptySqlLock(),_0x524080[_0x20dae5(0x172)],_0x524080[_0x20dae5(0x16c)],_0x20dae5(0x162)),_0xab0370=await scanLocalSqlQueries(_0x524080),_0x46272c=[],_0x53cdfc=[],_0x527d1f=[],_0x9c7660=[],_0x4abeb1=new Set(_0xab0370[_0x20dae5(0x15c)](_0x3487a3=>_0x3487a3[_0x20dae5(0x164)]));for(const _0x275648 of _0xab0370){const _0x16a59c=await computeSqlFileHash(_0x275648[_0x20dae5(0x165)]),_0x28ba31=_0x31db38[_0x20dae5(0x167)][_0x275648[_0x20dae5(0x164)]],_0x3daf58=!!_0x28ba31&&_0x28ba31['path']!==_0x275648[_0x20dae5(0x16d)],_0x2f3949=!!_0x28ba31&&!!_0x275648['sqlName']&&_0x28ba31[_0x20dae5(0x154)]!==_0x275648['sqlName'];if(!_0x28ba31)_0x46272c[_0x20dae5(0x169)](_0x275648[_0x20dae5(0x164)]);else _0x28ba31['hash']!==_0x16a59c||_0x3daf58||_0x2f3949?_0x53cdfc['push'](_0x275648[_0x20dae5(0x164)]):_0x527d1f[_0x20dae5(0x169)](_0x275648[_0x20dae5(0x164)]);}for(const _0x365fce of Object[_0x20dae5(0x158)](_0x31db38[_0x20dae5(0x167)])){!_0x4abeb1[_0x20dae5(0x174)](_0x365fce)&&_0x9c7660[_0x20dae5(0x169)](_0x365fce);}const _0x2fbd36=[];if(_0x3ce0ec[_0x20dae5(0x15b)](_0x20dae5(0x159))){const _0x20463b=await fetchAllSqlCodes(_0x3ce0ec['appCode']);for(const _0x44dfe4 of _0x20463b){!_0x4abeb1[_0x20dae5(0x174)](_0x44dfe4)&&!_0x31db38[_0x20dae5(0x167)][_0x44dfe4]&&_0x2fbd36['push'](_0x44dfe4);}}const _0x418477=_0x46272c[_0x20dae5(0x173)]===0x0&&_0x53cdfc['length']===0x0&&_0x9c7660[_0x20dae5(0x173)]===0x0&&_0x2fbd36[_0x20dae5(0x173)]===0x0;return{'ok':!![],'data':{'added':_0x46272c,'modified':_0x53cdfc,'missing':_0x9c7660,'unchanged':_0x527d1f,'remoteOnly':_0x2fbd36},'message':_0x418477?'All\x20SQL\x20queries\x20are\x20in\x20sync.':_0x46272c[_0x20dae5(0x173)]+_0x20dae5(0x16f)+_0x53cdfc['length']+_0x20dae5(0x160)+_0x9c7660[_0x20dae5(0x173)]+_0x20dae5(0x15f)+_0x527d1f[_0x20dae5(0x173)]+_0x20dae5(0x170)+(_0x2fbd36[_0x20dae5(0x173)]>0x0?',\x20'+_0x2fbd36[_0x20dae5(0x173)]+_0x20dae5(0x15d):'')};}};function a176_0x540e(){const _0x51abec=['has','21NFbCfV','lockFilePath','sqlName','paging','39phHZLU','tableData','keys','remote','sql','bool','map','\x20remote-only','202619wpxylJ','\x20missing,\x20','\x20modified,\x20','371556jnzoxK','status','1235442FBUhno','lockKey','filePath','boolean','sqls','33938hzOyoB','push','3582396XBVDhG','972184qrMBFX','sqlRoot','relativePath','1592550uCrlUj','\x20added,\x20','\x20unchanged','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','appCode','length'];a176_0x540e=function(){return _0x51abec;};return a176_0x540e();}
1
+ const a176_0x26594b=a176_0x5ee4;(function(_0x2006cb,_0x43993e){const _0x2c1c83=a176_0x5ee4,_0xd20ed6=_0x2006cb();while(!![]){try{const _0x15b802=parseInt(_0x2c1c83(0x199))/0x1+-parseInt(_0x2c1c83(0x189))/0x2*(parseInt(_0x2c1c83(0x184))/0x3)+parseInt(_0x2c1c83(0x190))/0x4*(-parseInt(_0x2c1c83(0x187))/0x5)+-parseInt(_0x2c1c83(0x188))/0x6+-parseInt(_0x2c1c83(0x1a4))/0x7+parseInt(_0x2c1c83(0x183))/0x8+-parseInt(_0x2c1c83(0x195))/0x9*(-parseInt(_0x2c1c83(0x1a3))/0xa);if(_0x15b802===_0x43993e)break;else _0xd20ed6['push'](_0xd20ed6['shift']());}catch(_0x32aff5){_0xd20ed6['push'](_0xd20ed6['shift']());}}}(a176_0x350d,0x3e69b));import{listSqlQueries}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';function a176_0x350d(){const _0x413d18=['\x20added,\x20','sqlCode','3062628OahtnP','sqlRoot','keys','has','84343aJMSkM','path','sqls','\x20unchanged','paging','read','relativePath','filePath','status','totalCount','20usskyj','1292130MYlxUJ','\x20modified,\x20','remote','appCode','3064272uQRheq','243sqZdvq','sqlName','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','225dJdYgG','1700322xNXwsZ','5052EUJMcI','map','tableData','\x20missing,\x20','All\x20SQL\x20queries\x20are\x20in\x20sync.','lockKey','push','19532dYhKQy','sql','length'];a176_0x350d=function(){return _0x413d18;};return a176_0x350d();}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';function a176_0x5ee4(_0x591b7a,_0x8697f2){_0x591b7a=_0x591b7a-0x183;const _0x350d1f=a176_0x350d();let _0x5ee4e3=_0x350d1f[_0x591b7a];return _0x5ee4e3;}const PAGE_SIZE=0x64;async function fetchAllSqlCodes(_0x5bdc32){const _0x130ef3=a176_0x5ee4,_0x3e8d35=[];let _0x109574=0x1;while(!![]){const _0x905b32=await listSqlQueries(_0x5bdc32,{'currentPage':_0x109574,'pageSize':PAGE_SIZE}),_0x21c5b7=_0x905b32[_0x130ef3(0x18b)]??[];_0x3e8d35[_0x130ef3(0x18f)](..._0x21c5b7[_0x130ef3(0x18a)](_0x4b0b9b=>_0x4b0b9b[_0x130ef3(0x194)]));if(_0x21c5b7['length']===0x0)break;const _0x437955=_0x905b32[_0x130ef3(0x19d)]?.[_0x130ef3(0x1a2)];if(_0x437955!=null?_0x3e8d35[_0x130ef3(0x192)]>=_0x437955:_0x21c5b7[_0x130ef3(0x192)]<PAGE_SIZE)break;_0x109574++;}return _0x3e8d35;}export const sqlStatus={'service':a176_0x26594b(0x191),'command':a176_0x26594b(0x1a1),'description':a176_0x26594b(0x186),'risk':a176_0x26594b(0x19e),'flags':[{'name':a176_0x26594b(0x1a6),'type':'boolean','description':'Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally'}],async 'execute'(_0x4349a6){const _0x488251=a176_0x26594b,_0x506100=loadSqlProjectConfig(_0x4349a6['appCode']),_0x20d54a=await readSqlLockFile(_0x506100['lockFilePath']),{appLock:_0x33b341}=ensureSqlLockScope(_0x20d54a??createEmptySqlLock(),_0x506100[_0x488251(0x1a7)],_0x506100[_0x488251(0x196)],_0x488251(0x1a1)),_0x313889=await scanLocalSqlQueries(_0x506100),_0x38f698=[],_0x3389c8=[],_0x20211f=[],_0x535649=[],_0x42bf83=new Set(_0x313889[_0x488251(0x18a)](_0x3eb024=>_0x3eb024[_0x488251(0x18e)]));for(const _0x58285d of _0x313889){const _0x1a37af=await computeSqlFileHash(_0x58285d[_0x488251(0x1a0)]),_0x10c223=_0x33b341['sqls'][_0x58285d[_0x488251(0x18e)]],_0x54442b=!!_0x10c223&&_0x10c223[_0x488251(0x19a)]!==_0x58285d[_0x488251(0x19f)],_0x1ae8a6=!!_0x10c223&&!!_0x58285d['sqlName']&&_0x10c223[_0x488251(0x185)]!==_0x58285d[_0x488251(0x185)];if(!_0x10c223)_0x38f698[_0x488251(0x18f)](_0x58285d[_0x488251(0x18e)]);else _0x10c223['hash']!==_0x1a37af||_0x54442b||_0x1ae8a6?_0x3389c8[_0x488251(0x18f)](_0x58285d[_0x488251(0x18e)]):_0x20211f[_0x488251(0x18f)](_0x58285d[_0x488251(0x18e)]);}for(const _0x37bb12 of Object[_0x488251(0x197)](_0x33b341[_0x488251(0x19b)])){!_0x42bf83[_0x488251(0x198)](_0x37bb12)&&_0x535649[_0x488251(0x18f)](_0x37bb12);}const _0x44e464=[];if(_0x4349a6['bool'](_0x488251(0x1a6))){const _0x1466d9=await fetchAllSqlCodes(_0x4349a6[_0x488251(0x1a7)]);for(const _0x202817 of _0x1466d9){!_0x42bf83['has'](_0x202817)&&!_0x33b341[_0x488251(0x19b)][_0x202817]&&_0x44e464[_0x488251(0x18f)](_0x202817);}}const _0x42ca94=_0x38f698[_0x488251(0x192)]===0x0&&_0x3389c8['length']===0x0&&_0x535649[_0x488251(0x192)]===0x0&&_0x44e464[_0x488251(0x192)]===0x0;return{'ok':!![],'data':{'added':_0x38f698,'modified':_0x3389c8,'missing':_0x535649,'unchanged':_0x20211f,'remoteOnly':_0x44e464},'message':_0x42ca94?_0x488251(0x18d):_0x38f698['length']+_0x488251(0x193)+_0x3389c8[_0x488251(0x192)]+_0x488251(0x1a5)+_0x535649[_0x488251(0x192)]+_0x488251(0x18c)+_0x20211f[_0x488251(0x192)]+_0x488251(0x19c)+(_0x44e464[_0x488251(0x192)]>0x0?',\x20'+_0x44e464[_0x488251(0x192)]+'\x20remote-only':'')};}};
@@ -1 +1 @@
1
- const a177_0x6c22d1=a177_0x451a;(function(_0x28596a,_0x533f32){const _0x40819c=a177_0x451a,_0x434b60=_0x28596a();while(!![]){try{const _0x543321=parseInt(_0x40819c(0x1d7))/0x1+-parseInt(_0x40819c(0x1da))/0x2*(parseInt(_0x40819c(0x1e5))/0x3)+-parseInt(_0x40819c(0x1e7))/0x4*(-parseInt(_0x40819c(0x1f4))/0x5)+-parseInt(_0x40819c(0x1cc))/0x6*(-parseInt(_0x40819c(0x1f8))/0x7)+-parseInt(_0x40819c(0x1ec))/0x8*(-parseInt(_0x40819c(0x1e0))/0x9)+-parseInt(_0x40819c(0x1d8))/0xa*(parseInt(_0x40819c(0x1f9))/0xb)+-parseInt(_0x40819c(0x1d5))/0xc*(parseInt(_0x40819c(0x1ea))/0xd);if(_0x543321===_0x533f32)break;else _0x434b60['push'](_0x434b60['shift']());}catch(_0x16a276){_0x434b60['push'](_0x434b60['shift']());}}}(a177_0x2fb1,0x630b6));function a177_0x451a(_0x341b93,_0x3a6db9){_0x341b93=_0x341b93-0x1bd;const _0x2fb12f=a177_0x2fb1();let _0x451a62=_0x2fb12f[_0x341b93];return _0x451a62;}import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';import{auditSqlJoinIndexes}from'../../core/sql-index-auditor.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{assertDatasetIsDbTableBacked,filterDbTableBackedDatasets}from'../../commands/dataset/capability.js';export const sqlValidate={'service':a177_0x6c22d1(0x1ce),'command':a177_0x6c22d1(0x1bf),'description':a177_0x6c22d1(0x1dc),'risk':'read','flags':[{'name':a177_0x6c22d1(0x1c2),'type':a177_0x6c22d1(0x1df),'description':'Path\x20to\x20the\x20SQL\x20file\x20to\x20validate'},{'name':a177_0x6c22d1(0x1ce),'type':a177_0x6c22d1(0x1df),'description':a177_0x6c22d1(0x1e8)},{'name':a177_0x6c22d1(0x1fc),'type':a177_0x6c22d1(0x1df),'description':a177_0x6c22d1(0x1f5)},{'name':a177_0x6c22d1(0x1fb),'type':a177_0x6c22d1(0x1ed),'description':'Audit\x20top-level\x20JOIN\x20equality\x20predicates\x20against\x20dataset\x20index\x20metadata'}],async 'execute'(_0x55e814){const _0x52b5ad=a177_0x6c22d1,_0x4de195=_0x55e814['str'](_0x52b5ad(0x1c2)),_0x373b49=_0x55e814[_0x52b5ad(0x1c8)](_0x52b5ad(0x1ce)),_0x267d70=_0x55e814[_0x52b5ad(0x1c8)](_0x52b5ad(0x1fc)),_0x40639b=_0x55e814['bool'](_0x52b5ad(0x1fb));if(!_0x4de195&&!_0x373b49)throw CliErrors['flagMissing'](_0x52b5ad(0x1c2),_0x52b5ad(0x1e9));if(_0x40639b&&!_0x267d70)throw CliErrors[_0x52b5ad(0x1c7)](_0x52b5ad(0x1cf));let _0x42b4d1;if(_0x4de195){const _0x17822e=resolve(process[_0x52b5ad(0x1d6)](),_0x4de195);if(!existsSync(_0x17822e))throw CliErrors['validation'](_0x52b5ad(0x1c3)+_0x17822e);_0x42b4d1=readFileSync(_0x17822e,_0x52b5ad(0x1f3));}else _0x42b4d1=_0x373b49;const _0x46589d=validateSql(_0x42b4d1),_0x5deaf6={'valid':_0x46589d[_0x52b5ad(0x1f2)],'sqlType':_0x46589d['sqlType'][_0x52b5ad(0x1ee)],'isSelectOnly':_0x46589d[_0x52b5ad(0x1c0)][_0x52b5ad(0x1d3)],'isDangerous':_0x46589d[_0x52b5ad(0x1c0)]['isDangerous'],'tables':_0x46589d[_0x52b5ad(0x1ef)],'parameters':_0x46589d['parameters'],'message':_0x46589d[_0x52b5ad(0x1c9)]};_0x46589d['sqlType']['reason']&&(_0x5deaf6[_0x52b5ad(0x1c6)]=_0x46589d[_0x52b5ad(0x1c0)][_0x52b5ad(0x1c6)]);if(_0x267d70&&_0x46589d[_0x52b5ad(0x1f2)]){const _0x523187=_0x267d70[_0x52b5ad(0x1cd)](',')[_0x52b5ad(0x1e3)](_0x52f57a=>_0x52f57a[_0x52b5ad(0x1bd)]())[_0x52b5ad(0x1f0)](Boolean),_0x3f6384=[],_0x51ece7=[],_0x431a84=filterDbTableBackedDatasets(await listDatasets(_0x55e814[_0x52b5ad(0x1d2)])),_0x349fe8=new Map(_0x431a84[_0x52b5ad(0x1e3)](_0x57d577=>[_0x57d577[_0x52b5ad(0x1eb)]?.[_0x52b5ad(0x1f1)]?.[_0x52b5ad(0x1e4)](),_0x57d577]));for(const _0x3f421c of _0x46589d['tables']){const _0x5d294d=_0x349fe8[_0x52b5ad(0x1ff)](_0x3f421c[_0x52b5ad(0x1e4)]());!_0x5d294d&&_0x3f6384[_0x52b5ad(0x1be)]('Table\x20\x22'+_0x3f421c+_0x52b5ad(0x1dd));}for(const _0x441b80 of _0x523187){let _0x4c1a81;try{_0x4c1a81=await getDatasetDetail(_0x441b80);}catch{_0x3f6384[_0x52b5ad(0x1be)](_0x52b5ad(0x1c5)+_0x441b80+_0x52b5ad(0x1f7));continue;}assertDatasetIsDbTableBacked(_0x4c1a81,_0x52b5ad(0x1d4));const _0x47a222=Array[_0x52b5ad(0x1e1)](_0x4c1a81[_0x52b5ad(0x1e6)])?_0x4c1a81[_0x52b5ad(0x1e6)]:[],_0x25e0d3=new Set(_0x47a222['map'](_0x5a18a1=>_0x5a18a1['name']?.[_0x52b5ad(0x1e4)]())),_0x1e900d=_0x4c1a81[_0x52b5ad(0x1eb)]?.[_0x52b5ad(0x1f1)]||_0x4c1a81['tableName']||_0x441b80;_0x5deaf6[_0x52b5ad(0x1d0)+_0x1e900d]={'code':_0x441b80,'tableName':_0x1e900d,'fieldCount':_0x25e0d3[_0x52b5ad(0x1f6)],'fields':Array[_0x52b5ad(0x1ca)](_0x25e0d3)};if(_0x40639b){const _0x494d87=normalizeDatasetIndexes(_0x4c1a81);_0x51ece7[_0x52b5ad(0x1be)]({'tableName':_0x1e900d,..._0x494d87});}}_0x3f6384[_0x52b5ad(0x1d9)]>0x0&&(_0x5deaf6['schemaWarnings']=_0x3f6384),_0x40639b&&(_0x5deaf6[_0x52b5ad(0x1fe)]=auditSqlJoinIndexes(_0x42b4d1,_0x51ece7));}return{'ok':_0x46589d[_0x52b5ad(0x1f2)],'data':_0x5deaf6,'message':_0x46589d[_0x52b5ad(0x1c9)]};}};function normalizeDatasetIndexes(_0x20279d){const _0x5bbcdd=a177_0x6c22d1,_0x45d167=Array[_0x5bbcdd(0x1e1)](_0x20279d?.[_0x5bbcdd(0x1c1)]?.[_0x5bbcdd(0x1cb)])?_0x20279d[_0x5bbcdd(0x1c1)][_0x5bbcdd(0x1cb)]:Array[_0x5bbcdd(0x1e1)](_0x20279d?.[_0x5bbcdd(0x1cb)])?_0x20279d[_0x5bbcdd(0x1cb)]:[],_0x4b4503=_0x45d167['flatMap'](_0xc6f6c9=>{const _0x1fb2d5=_0x5bbcdd,_0x1c56c4=Array[_0x1fb2d5(0x1e1)](_0xc6f6c9?.['index_columns'])?_0xc6f6c9[_0x1fb2d5(0x1fd)]:Array[_0x1fb2d5(0x1e1)](_0xc6f6c9?.[_0x1fb2d5(0x1e2)])?_0xc6f6c9['columnNames']:Array['isArray'](_0xc6f6c9?.['columns'])?_0xc6f6c9[_0x1fb2d5(0x1de)]:[],_0x4f2ae6=_0x1c56c4['filter'](_0x4e8b65=>typeof _0x4e8b65===_0x1fb2d5(0x1df))[_0x1fb2d5(0x1e3)](_0x182327=>_0x182327[_0x1fb2d5(0x1bd)]())['filter'](Boolean);if(_0x4f2ae6[_0x1fb2d5(0x1d9)]===0x0)return[];const _0x49645f=[_0xc6f6c9?.[_0x1fb2d5(0x1c4)],_0xc6f6c9?.['index_name'],_0xc6f6c9?.[_0x1fb2d5(0x1db)]]['find'](_0xbb73c3=>typeof _0xbb73c3===_0x1fb2d5(0x1df)&&_0xbb73c3[_0x1fb2d5(0x1bd)]()),_0x51557c=[_0xc6f6c9?.['index_type'],_0xc6f6c9?.[_0x1fb2d5(0x1ee)]][_0x1fb2d5(0x1d1)](_0x554f4a=>typeof _0x554f4a===_0x1fb2d5(0x1df)&&_0x554f4a[_0x1fb2d5(0x1bd)]());return[{..._0x49645f?{'name':_0x49645f[_0x1fb2d5(0x1bd)]()}:{},..._0x51557c?{'type':_0x51557c[_0x1fb2d5(0x1bd)]()}:{},'columns':_0x4f2ae6}];}),_0x3a42a9=[..._0x4b4503],_0xf952b7=typeof _0x20279d?.['dbtableConfig']?.[_0x5bbcdd(0x1fa)]===_0x5bbcdd(0x1df)?_0x20279d['dbtableConfig']['pkField']['split'](',')[_0x5bbcdd(0x1e3)](_0x57c9f3=>_0x57c9f3[_0x5bbcdd(0x1bd)]())[_0x5bbcdd(0x1f0)](Boolean):[];return _0xf952b7[_0x5bbcdd(0x1d9)]>0x0&&_0x3a42a9['unshift']({'type':'primary','columns':_0xf952b7}),{'indexes':_0x3a42a9,'metadataAvailable':_0x4b4503[_0x5bbcdd(0x1d9)]>0x0};}function a177_0x2fb1(){const _0x76aa79=['utf-8','100XBdPzR','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','size','\x22\x20not\x20found\x20or\x20not\x20accessible','7ayKSNS','5687473IMjpsX','pkField','check-indexes','schemas','index_columns','joinAudit','get','trim','push','validate','sqlType','dataset','file','File\x20not\x20found:\x20','indexName','Dataset\x20\x22','reason','validation','str','message','from','indexes','2231022uRsJkX','split','sql','--check-indexes\x20requires\x20--schemas.','schema:','find','appCode','isSelectOnly','SQL\x20schema\x20validation','279684GKoLhG','cwd','643501hlLiXx','10WSwKkT','length','157582ZNobXH','name','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','\x22\x20not\x20found\x20in\x20any\x20dataset','columns','string','789597bAUlhy','isArray','columnNames','map','toLowerCase','3PAZGno','fields','133516ytpXUw','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','Provide\x20--file\x20or\x20--sql','429JwtpIg','dbtableConfig','8diIihB','boolean','type','tables','filter','tableName','valid'];a177_0x2fb1=function(){return _0x76aa79;};return a177_0x2fb1();}
1
+ const a177_0x5ba0a6=a177_0x13ef;function a177_0x13ef(_0x423b05,_0x293b20){_0x423b05=_0x423b05-0x12d;const _0xc7fe9=a177_0xc7fe();let _0x13ef3c=_0xc7fe9[_0x423b05];return _0x13ef3c;}(function(_0xb0c1b2,_0x326ccb){const _0xe6b4d=a177_0x13ef,_0x598f8d=_0xb0c1b2();while(!![]){try{const _0x516652=parseInt(_0xe6b4d(0x144))/0x1+parseInt(_0xe6b4d(0x140))/0x2+parseInt(_0xe6b4d(0x154))/0x3+parseInt(_0xe6b4d(0x132))/0x4*(parseInt(_0xe6b4d(0x16b))/0x5)+parseInt(_0xe6b4d(0x142))/0x6+parseInt(_0xe6b4d(0x161))/0x7*(-parseInt(_0xe6b4d(0x148))/0x8)+-parseInt(_0xe6b4d(0x133))/0x9;if(_0x516652===_0x326ccb)break;else _0x598f8d['push'](_0x598f8d['shift']());}catch(_0x3a7f5b){_0x598f8d['push'](_0x598f8d['shift']());}}}(a177_0xc7fe,0x67fd2));import{readFileSync,existsSync}from'node:fs';function a177_0xc7fe(){const _0x5859c3=['1764183TyPUle','Table\x20\x22','string','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','unshift','cwd','tables','split','name','File\x20not\x20found:\x20','dbtableConfig','type','35XYNQLx','size','utf-8','sql','read','length','Dataset\x20\x22','index_name','reason','isArray','193405dEqnuQ','validate','primary','SQL\x20schema\x20validation','tableName','valid','fields','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','index_columns','indexName','isSelectOnly','16gFzHvr','13100013pYPwer','file','isDangerous','filter','map','pkField','flagMissing','\x22\x20not\x20found\x20in\x20any\x20dataset','str','push','Audit\x20top-level\x20JOIN\x20equality\x20predicates\x20against\x20dataset\x20index\x20metadata','trim','toLowerCase','1257148ShRVLD','\x22\x20not\x20found\x20or\x20not\x20accessible','3904296JQKWHc','validation','78410WiRCcB','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','schemaWarnings','joinAudit','350384AnmjnY','columnNames','sqlType','message','--check-indexes\x20requires\x20--schemas.','columns','find','schema:','indexes','dataset','appCode','bool'];a177_0xc7fe=function(){return _0x5859c3;};return a177_0xc7fe();}import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';import{auditSqlJoinIndexes}from'../../core/sql-index-auditor.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{assertDatasetIsDbTableBacked,filterDbTableBackedDatasets}from'../../commands/dataset/capability.js';export const sqlValidate={'service':'sql','command':a177_0x5ba0a6(0x16c),'description':a177_0x5ba0a6(0x158),'risk':a177_0x5ba0a6(0x165),'flags':[{'name':a177_0x5ba0a6(0x134),'type':'string','description':a177_0x5ba0a6(0x157)},{'name':a177_0x5ba0a6(0x164),'type':a177_0x5ba0a6(0x156),'description':a177_0x5ba0a6(0x12e)},{'name':'schemas','type':a177_0x5ba0a6(0x156),'description':a177_0x5ba0a6(0x145)},{'name':'check-indexes','type':'boolean','description':a177_0x5ba0a6(0x13d)}],async 'execute'(_0x2ef567){const _0x271630=a177_0x5ba0a6,_0x235eef=_0x2ef567[_0x271630(0x13b)]('file'),_0x39a8a0=_0x2ef567['str'](_0x271630(0x164)),_0x23c65f=_0x2ef567[_0x271630(0x13b)]('schemas'),_0x4d0a26=_0x2ef567[_0x271630(0x153)]('check-indexes');if(!_0x235eef&&!_0x39a8a0)throw CliErrors[_0x271630(0x139)]('file','Provide\x20--file\x20or\x20--sql');if(_0x4d0a26&&!_0x23c65f)throw CliErrors[_0x271630(0x143)](_0x271630(0x14c));let _0x225469;if(_0x235eef){const _0x22db05=resolve(process[_0x271630(0x15a)](),_0x235eef);if(!existsSync(_0x22db05))throw CliErrors[_0x271630(0x143)](_0x271630(0x15e)+_0x22db05);_0x225469=readFileSync(_0x22db05,_0x271630(0x163));}else _0x225469=_0x39a8a0;const _0x1f4f87=validateSql(_0x225469),_0x4825a4={'valid':_0x1f4f87[_0x271630(0x170)],'sqlType':_0x1f4f87[_0x271630(0x14a)][_0x271630(0x160)],'isSelectOnly':_0x1f4f87[_0x271630(0x14a)][_0x271630(0x131)],'isDangerous':_0x1f4f87[_0x271630(0x14a)][_0x271630(0x135)],'tables':_0x1f4f87[_0x271630(0x15b)],'parameters':_0x1f4f87['parameters'],'message':_0x1f4f87[_0x271630(0x14b)]};_0x1f4f87['sqlType']['reason']&&(_0x4825a4[_0x271630(0x169)]=_0x1f4f87[_0x271630(0x14a)][_0x271630(0x169)]);if(_0x23c65f&&_0x1f4f87[_0x271630(0x170)]){const _0x30bd02=_0x23c65f[_0x271630(0x15c)](',')[_0x271630(0x137)](_0x30830f=>_0x30830f['trim']())['filter'](Boolean),_0x2bfa36=[],_0x407120=[],_0x3b3f56=filterDbTableBackedDatasets(await listDatasets(_0x2ef567[_0x271630(0x152)])),_0x258477=new Map(_0x3b3f56['map'](_0x55ad43=>[_0x55ad43[_0x271630(0x15f)]?.[_0x271630(0x16f)]?.[_0x271630(0x13f)](),_0x55ad43]));for(const _0x246594 of _0x1f4f87[_0x271630(0x15b)]){const _0x47a230=_0x258477['get'](_0x246594['toLowerCase']());!_0x47a230&&_0x2bfa36[_0x271630(0x13c)](_0x271630(0x155)+_0x246594+_0x271630(0x13a));}for(const _0x27c46a of _0x30bd02){let _0x77201d;try{_0x77201d=await getDatasetDetail(_0x27c46a);}catch{_0x2bfa36['push'](_0x271630(0x167)+_0x27c46a+_0x271630(0x141));continue;}assertDatasetIsDbTableBacked(_0x77201d,_0x271630(0x16e));const _0x487d54=Array[_0x271630(0x16a)](_0x77201d[_0x271630(0x12d)])?_0x77201d['fields']:[],_0x2cecbb=new Set(_0x487d54[_0x271630(0x137)](_0x50f5c7=>_0x50f5c7['name']?.[_0x271630(0x13f)]())),_0x2b6f83=_0x77201d['dbtableConfig']?.['tableName']||_0x77201d[_0x271630(0x16f)]||_0x27c46a;_0x4825a4[_0x271630(0x14f)+_0x2b6f83]={'code':_0x27c46a,'tableName':_0x2b6f83,'fieldCount':_0x2cecbb[_0x271630(0x162)],'fields':Array['from'](_0x2cecbb)};if(_0x4d0a26){const _0xd0fdc6=normalizeDatasetIndexes(_0x77201d);_0x407120[_0x271630(0x13c)]({'tableName':_0x2b6f83,..._0xd0fdc6});}}_0x2bfa36[_0x271630(0x166)]>0x0&&(_0x4825a4[_0x271630(0x146)]=_0x2bfa36),_0x4d0a26&&(_0x4825a4[_0x271630(0x147)]=auditSqlJoinIndexes(_0x225469,_0x407120));}return{'ok':_0x1f4f87[_0x271630(0x170)],'data':_0x4825a4,'message':_0x1f4f87[_0x271630(0x14b)]};}};function normalizeDatasetIndexes(_0x311dbf){const _0x3432a7=a177_0x5ba0a6,_0x2b7a18=Array[_0x3432a7(0x16a)](_0x311dbf?.['dataset']?.[_0x3432a7(0x150)])?_0x311dbf[_0x3432a7(0x151)][_0x3432a7(0x150)]:Array['isArray'](_0x311dbf?.[_0x3432a7(0x150)])?_0x311dbf['indexes']:[],_0x46a843=_0x2b7a18['flatMap'](_0xb2c781=>{const _0x4dd727=_0x3432a7,_0x5a07b0=Array[_0x4dd727(0x16a)](_0xb2c781?.[_0x4dd727(0x12f)])?_0xb2c781[_0x4dd727(0x12f)]:Array['isArray'](_0xb2c781?.[_0x4dd727(0x149)])?_0xb2c781[_0x4dd727(0x149)]:Array[_0x4dd727(0x16a)](_0xb2c781?.[_0x4dd727(0x14d)])?_0xb2c781[_0x4dd727(0x14d)]:[],_0x1ad05b=_0x5a07b0[_0x4dd727(0x136)](_0x56d6ca=>typeof _0x56d6ca===_0x4dd727(0x156))[_0x4dd727(0x137)](_0x348d3a=>_0x348d3a[_0x4dd727(0x13e)]())[_0x4dd727(0x136)](Boolean);if(_0x1ad05b[_0x4dd727(0x166)]===0x0)return[];const _0x20c985=[_0xb2c781?.[_0x4dd727(0x130)],_0xb2c781?.[_0x4dd727(0x168)],_0xb2c781?.[_0x4dd727(0x15d)]][_0x4dd727(0x14e)](_0x55e7ee=>typeof _0x55e7ee==='string'&&_0x55e7ee[_0x4dd727(0x13e)]()),_0x3bfa04=[_0xb2c781?.['index_type'],_0xb2c781?.[_0x4dd727(0x160)]][_0x4dd727(0x14e)](_0x64c876=>typeof _0x64c876===_0x4dd727(0x156)&&_0x64c876[_0x4dd727(0x13e)]());return[{..._0x20c985?{'name':_0x20c985[_0x4dd727(0x13e)]()}:{},..._0x3bfa04?{'type':_0x3bfa04['trim']()}:{},'columns':_0x1ad05b}];}),_0x4be95b=[..._0x46a843],_0x35cd30=typeof _0x311dbf?.[_0x3432a7(0x15f)]?.[_0x3432a7(0x138)]===_0x3432a7(0x156)?_0x311dbf[_0x3432a7(0x15f)][_0x3432a7(0x138)][_0x3432a7(0x15c)](',')['map'](_0x2bc520=>_0x2bc520['trim']())[_0x3432a7(0x136)](Boolean):[];return _0x35cd30[_0x3432a7(0x166)]>0x0&&_0x4be95b[_0x3432a7(0x159)]({'type':_0x3432a7(0x16d),'columns':_0x35cd30}),{'indexes':_0x4be95b,'metadataAvailable':_0x46a843[_0x3432a7(0x166)]>0x0};}
@@ -1 +1 @@
1
- function a178_0x20b1(_0x278fbe,_0x5ae455){_0x278fbe=_0x278fbe-0x188;const _0x444bd7=a178_0x444b();let _0x20b140=_0x444bd7[_0x278fbe];return _0x20b140;}(function(_0x25b8da,_0x488cc0){const _0xf57435=a178_0x20b1,_0x4441a7=_0x25b8da();while(!![]){try{const _0x2f7b3c=parseInt(_0xf57435(0x18c))/0x1+-parseInt(_0xf57435(0x18a))/0x2+parseInt(_0xf57435(0x188))/0x3+-parseInt(_0xf57435(0x18b))/0x4+-parseInt(_0xf57435(0x18e))/0x5+parseInt(_0xf57435(0x18d))/0x6+-parseInt(_0xf57435(0x189))/0x7;if(_0x2f7b3c===_0x488cc0)break;else _0x4441a7['push'](_0x4441a7['shift']());}catch(_0x114b3c){_0x4441a7['push'](_0x4441a7['shift']());}}}(a178_0x444b,0xe1e65));import{taskStatus}from'../../commands/task/status.js';function a178_0x444b(){const _0x5eed2b=['1704860LiDqhj','9425226GGYUdO','2816485KRpfYo','3498504IsbtUQ','11293569VkcdEA','362946fURhLO','4633908DPZiQW'];a178_0x444b=function(){return _0x5eed2b;};return a178_0x444b();}export const taskDefinitions=[taskStatus];
1
+ (function(_0x3e4e70,_0xfc9252){const _0x9e7fe=a178_0x3db5,_0x45a4fc=_0x3e4e70();while(!![]){try{const _0x2f0457=parseInt(_0x9e7fe(0x8a))/0x1+parseInt(_0x9e7fe(0x8c))/0x2*(parseInt(_0x9e7fe(0x89))/0x3)+-parseInt(_0x9e7fe(0x88))/0x4*(parseInt(_0x9e7fe(0x94))/0x5)+parseInt(_0x9e7fe(0x8b))/0x6*(-parseInt(_0x9e7fe(0x90))/0x7)+-parseInt(_0x9e7fe(0x91))/0x8*(parseInt(_0x9e7fe(0x93))/0x9)+-parseInt(_0x9e7fe(0x92))/0xa*(parseInt(_0x9e7fe(0x8d))/0xb)+parseInt(_0x9e7fe(0x8f))/0xc*(parseInt(_0x9e7fe(0x8e))/0xd);if(_0x2f0457===_0xfc9252)break;else _0x45a4fc['push'](_0x45a4fc['shift']());}catch(_0x48db33){_0x45a4fc['push'](_0x45a4fc['shift']());}}}(a178_0x11c5,0xca657));function a178_0x3db5(_0x29c06d,_0x1c02f2){_0x29c06d=_0x29c06d-0x88;const _0x11c5e9=a178_0x11c5();let _0x3db5fe=_0x11c5e9[_0x29c06d];return _0x3db5fe;}function a178_0x11c5(){const _0x4f281b=['16gTIapn','6178670RuqJxa','5472783PtpcrP','80zMAqeC','164596zOINYO','10311SrORpY','312805KcRrRO','6WGoULh','470SFVFIT','11sXKIhy','468LsEhnM','960060umGsdr','4754680kfjZkH'];a178_0x11c5=function(){return _0x4f281b;};return a178_0x11c5();}import{taskStatus}from'../../commands/task/status.js';export const taskDefinitions=[taskStatus];
@@ -1 +1 @@
1
- const a179_0x686ccb=a179_0x27d6;function a179_0x51db(){const _0x22bf43=['213352nvSBJK',',\x20received\x20','1274TgRCOC','task-id','str','flagMissing','3009wFkevX','string','compress','330JsyvBq','Task\x20status\x20response\x20id\x20mismatch:\x20requested\x20','apiError','read','567485nFisjU','Task\x20id\x20returned\x20by\x20an\x20asynchronous\x20platform\x20command','cookie','Query\x20an\x20asynchronous\x20task;\x20repeat\x20for\x20PENDING\x20or\x20PROCESSING\x20until\x20SUCCESS\x20or\x20FAILED','64504WlAjqg','4251030jZxjBe','trim','1771696ntHUHx','taskId','12FvwpuN','130955oRGhgz','45kdlhTm','appCode'];a179_0x51db=function(){return _0x22bf43;};return a179_0x51db();}(function(_0x1a623f,_0x1effd5){const _0x2d9a5c=a179_0x27d6,_0x15d457=_0x1a623f();while(!![]){try{const _0x3bc8f4=-parseInt(_0x2d9a5c(0x78))/0x1+-parseInt(_0x2d9a5c(0x69))/0x2*(-parseInt(_0x2d9a5c(0x6d))/0x3)+parseInt(_0x2d9a5c(0x7b))/0x4+parseInt(_0x2d9a5c(0x74))/0x5*(parseInt(_0x2d9a5c(0x7d))/0x6)+-parseInt(_0x2d9a5c(0x79))/0x7+parseInt(_0x2d9a5c(0x81))/0x8*(parseInt(_0x2d9a5c(0x7f))/0x9)+-parseInt(_0x2d9a5c(0x70))/0xa*(parseInt(_0x2d9a5c(0x7e))/0xb);if(_0x3bc8f4===_0x1effd5)break;else _0x15d457['push'](_0x15d457['shift']());}catch(_0x1985cf){_0x15d457['push'](_0x15d457['shift']());}}}(a179_0x51db,0x5c2ab));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asyncTaskMessage,buildAsyncTaskStatusCommand,normalizeAsyncTask}from'../../commands/common/async-task.js';import{getAsyncTaskStatus}from'../../core/api-client.js';function a179_0x27d6(_0x4da5ce,_0x2e23f5){_0x4da5ce=_0x4da5ce-0x68;const _0x51db28=a179_0x51db();let _0x27d63c=_0x51db28[_0x4da5ce];return _0x27d63c;}import{CliErrors}from'../../errors.js';export const taskStatus={'service':'task','command':'status','description':a179_0x686ccb(0x77),'risk':a179_0x686ccb(0x73),'defaultOutputFormat':a179_0x686ccb(0x6f),'structuredErrors':!![],'flags':[{'name':a179_0x686ccb(0x6a),'type':a179_0x686ccb(0x6e),'required':!![],'description':a179_0x686ccb(0x75)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x5cf168){const _0x45ad0d=a179_0x686ccb;if(!_0x5cf168[_0x45ad0d(0x6b)](_0x45ad0d(0x6a))[_0x45ad0d(0x7a)]())throw CliErrors[_0x45ad0d(0x6c)](_0x45ad0d(0x6a));},async 'execute'(_0x309f1d){const _0x300d25=a179_0x686ccb,_0x50a044=_0x309f1d[_0x300d25(0x6b)](_0x300d25(0x6a))['trim'](),_0x146d19=normalizeAsyncTask(await getAsyncTaskStatus(_0x50a044,_0x309f1d[_0x300d25(0x80)],_0x309f1d[_0x300d25(0x76)]));if(_0x146d19[_0x300d25(0x7c)]!==_0x50a044)throw CliErrors[_0x300d25(0x72)](_0x300d25(0x71)+_0x50a044+_0x300d25(0x68)+_0x146d19[_0x300d25(0x7c)]+'.');const _0x5323f1=buildAsyncTaskStatusCommand(_0x146d19[_0x300d25(0x7c)],_0x309f1d[_0x300d25(0x80)]);return{'ok':!![],'message':asyncTaskMessage(_0x146d19),'data':{'appCode':_0x309f1d[_0x300d25(0x80)],..._0x146d19,'query':_0x146d19['isTerminal']?null:{'command':_0x5323f1}}};}};
1
+ const a179_0x3f1ecd=a179_0x496b;(function(_0x46805f,_0x11cbf1){const _0x563b79=a179_0x496b,_0x474e6b=_0x46805f();while(!![]){try{const _0x11c0ec=-parseInt(_0x563b79(0x1f5))/0x1+parseInt(_0x563b79(0x1f8))/0x2*(parseInt(_0x563b79(0x204))/0x3)+parseInt(_0x563b79(0x1fd))/0x4+-parseInt(_0x563b79(0x202))/0x5+-parseInt(_0x563b79(0x209))/0x6*(parseInt(_0x563b79(0x1fa))/0x7)+-parseInt(_0x563b79(0x207))/0x8+parseInt(_0x563b79(0x1f6))/0x9;if(_0x11c0ec===_0x11cbf1)break;else _0x474e6b['push'](_0x474e6b['shift']());}catch(_0x4d50a4){_0x474e6b['push'](_0x474e6b['shift']());}}}(a179_0x364e,0x48709));function a179_0x496b(_0x3640cb,_0x2c4bb9){_0x3640cb=_0x3640cb-0x1f1;const _0x364e3f=a179_0x364e();let _0x496bd5=_0x364e3f[_0x3640cb];return _0x496bd5;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asyncTaskMessage,buildAsyncTaskStatusCommand,normalizeAsyncTask}from'../../commands/common/async-task.js';import{getAsyncTaskStatus}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a179_0x364e(){const _0x3cf77b=['2877228daTJTw','task','346lilJaH',',\x20received\x20','77SZNljy','Task\x20id\x20returned\x20by\x20an\x20asynchronous\x20platform\x20command','apiError','999612DhEbOx','trim','string','cookie','read','1035130uXKqPn','isTerminal','8868VyVSnq','Query\x20an\x20asynchronous\x20task;\x20repeat\x20for\x20PENDING\x20or\x20PROCESSING\x20until\x20SUCCESS\x20or\x20FAILED','flagMissing','2622088HOhPvW','appCode','7206YJjJmg','taskId','status','str','task-id','236272mdbQVN'];a179_0x364e=function(){return _0x3cf77b;};return a179_0x364e();}export const taskStatus={'service':a179_0x3f1ecd(0x1f7),'command':a179_0x3f1ecd(0x1f2),'description':a179_0x3f1ecd(0x205),'risk':a179_0x3f1ecd(0x201),'defaultOutputFormat':'compress','structuredErrors':!![],'flags':[{'name':a179_0x3f1ecd(0x1f4),'type':a179_0x3f1ecd(0x1ff),'required':!![],'description':a179_0x3f1ecd(0x1fb)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x32af57){const _0x486742=a179_0x3f1ecd;if(!_0x32af57[_0x486742(0x1f3)](_0x486742(0x1f4))[_0x486742(0x1fe)]())throw CliErrors[_0x486742(0x206)](_0x486742(0x1f4));},async 'execute'(_0x2b8fb6){const _0x271049=a179_0x3f1ecd,_0x3b4dd1=_0x2b8fb6[_0x271049(0x1f3)](_0x271049(0x1f4))[_0x271049(0x1fe)](),_0x5f4267=normalizeAsyncTask(await getAsyncTaskStatus(_0x3b4dd1,_0x2b8fb6[_0x271049(0x208)],_0x2b8fb6[_0x271049(0x200)]));if(_0x5f4267['taskId']!==_0x3b4dd1)throw CliErrors[_0x271049(0x1fc)]('Task\x20status\x20response\x20id\x20mismatch:\x20requested\x20'+_0x3b4dd1+_0x271049(0x1f9)+_0x5f4267[_0x271049(0x1f1)]+'.');const _0x2a4fd6=buildAsyncTaskStatusCommand(_0x5f4267[_0x271049(0x1f1)],_0x2b8fb6[_0x271049(0x208)]);return{'ok':!![],'message':asyncTaskMessage(_0x5f4267),'data':{'appCode':_0x2b8fb6[_0x271049(0x208)],..._0x5f4267,'query':_0x5f4267[_0x271049(0x203)]?null:{'command':_0x2a4fd6}}};}};
@@ -1 +1 @@
1
- function a180_0x3f0f(_0x587140,_0x306b6b){_0x587140=_0x587140-0x109;const _0x3ef80a=a180_0x3ef8();let _0x3f0f6d=_0x3ef80a[_0x587140];return _0x3f0f6d;}function a180_0x3ef8(){const _0x4de2bb=['65yZcUqw','6738420NkfYrO','424816osYwdU','4485666kVuOzh','App\x20profile\x20name','add','write','Register\x20an\x20app\x20profile\x20in\x20the\x20current\x20workspace\x20(or\x20--global)','7015512ppJqsr','workspace\x20add','8pWkXCn','14694993vIGNdb','40266820pEJFsA','1132231UEheQA','2mssyvs'];a180_0x3ef8=function(){return _0x4de2bb;};return a180_0x3ef8();}const a180_0x55b962=a180_0x3f0f;(function(_0x4287ab,_0x11c561){const _0x6cbe80=a180_0x3f0f,_0x55e966=_0x4287ab();while(!![]){try{const _0x318cc4=parseInt(_0x6cbe80(0x114))/0x1*(parseInt(_0x6cbe80(0x115))/0x2)+parseInt(_0x6cbe80(0x10a))/0x3+parseInt(_0x6cbe80(0x109))/0x4*(-parseInt(_0x6cbe80(0x116))/0x5)+parseInt(_0x6cbe80(0x117))/0x6+parseInt(_0x6cbe80(0x10f))/0x7+-parseInt(_0x6cbe80(0x111))/0x8*(-parseInt(_0x6cbe80(0x112))/0x9)+-parseInt(_0x6cbe80(0x113))/0xa;if(_0x318cc4===_0x11c561)break;else _0x55e966['push'](_0x55e966['shift']());}catch(_0x41e690){_0x55e966['push'](_0x55e966['shift']());}}}(a180_0x3ef8,0xeed06));import{buildAppAddFlags,runAppAdd,validateAppName}from'../../commands/common/app-registry.js';export const workspaceAddDefinition={'service':'workspace','command':a180_0x55b962(0x10c),'description':a180_0x55b962(0x10e),'risk':a180_0x55b962(0x10d),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':'name','description':a180_0x55b962(0x10b),'required':!![]}],'flags':buildAppAddFlags(),'validate':_0x4d9fd1=>validateAppName(_0x4d9fd1,a180_0x55b962(0x110)),'execute':_0x141061=>runAppAdd(_0x141061,a180_0x55b962(0x110))};
1
+ const a180_0xe48f08=a180_0x3c04;(function(_0x196eb3,_0xef70a3){const _0x516d10=a180_0x3c04,_0x513cfa=_0x196eb3();while(!![]){try{const _0x535462=-parseInt(_0x516d10(0x94))/0x1+parseInt(_0x516d10(0x8e))/0x2+parseInt(_0x516d10(0x8f))/0x3+-parseInt(_0x516d10(0x91))/0x4*(parseInt(_0x516d10(0x96))/0x5)+parseInt(_0x516d10(0x93))/0x6+parseInt(_0x516d10(0x92))/0x7+-parseInt(_0x516d10(0x95))/0x8;if(_0x535462===_0xef70a3)break;else _0x513cfa['push'](_0x513cfa['shift']());}catch(_0x5a4bc6){_0x513cfa['push'](_0x513cfa['shift']());}}}(a180_0x1da1,0x704c0));function a180_0x3c04(_0x33a4b4,_0x2daec7){_0x33a4b4=_0x33a4b4-0x8a;const _0x1da15e=a180_0x1da1();let _0x3c0422=_0x1da15e[_0x33a4b4];return _0x3c0422;}import{buildAppAddFlags,runAppAdd,validateAppName}from'../../commands/common/app-registry.js';function a180_0x1da1(){const _0xcaf71d=['write','workspace\x20add','add','1127170ayCyLG','2108901WyvTCm','App\x20profile\x20name','289924ZXrrAK','4768456YKIVnr','2576634LADrIg','858979wYQFRS','7306320LmpDWi','10wjfOVV','Register\x20an\x20app\x20profile\x20in\x20the\x20current\x20workspace\x20(or\x20--global)'];a180_0x1da1=function(){return _0xcaf71d;};return a180_0x1da1();}export const workspaceAddDefinition={'service':'workspace','command':a180_0xe48f08(0x8d),'description':a180_0xe48f08(0x8a),'risk':a180_0xe48f08(0x8b),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':'name','description':a180_0xe48f08(0x90),'required':!![]}],'flags':buildAppAddFlags(),'validate':_0x4d6184=>validateAppName(_0x4d6184,'workspace\x20add'),'execute':_0xc5918d=>runAppAdd(_0xc5918d,a180_0xe48f08(0x8c))};
@@ -1 +1 @@
1
- const a181_0x5a0dc1=a181_0x22a9;(function(_0x528095,_0x267095){const _0x459dbc=a181_0x22a9,_0x265ff3=_0x528095();while(!![]){try{const _0x1350c8=parseInt(_0x459dbc(0x185))/0x1*(parseInt(_0x459dbc(0x188))/0x2)+-parseInt(_0x459dbc(0x186))/0x3+-parseInt(_0x459dbc(0x17c))/0x4*(parseInt(_0x459dbc(0x18a))/0x5)+-parseInt(_0x459dbc(0x18e))/0x6*(parseInt(_0x459dbc(0x171))/0x7)+parseInt(_0x459dbc(0x190))/0x8*(parseInt(_0x459dbc(0x19d))/0x9)+parseInt(_0x459dbc(0x196))/0xa*(parseInt(_0x459dbc(0x176))/0xb)+parseInt(_0x459dbc(0x172))/0xc;if(_0x1350c8===_0x267095)break;else _0x265ff3['push'](_0x265ff3['shift']());}catch(_0x17bdcd){_0x265ff3['push'](_0x265ff3['shift']());}}}(a181_0x5aef,0xc286c));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 a181_0x22a9(_0x2f342b,_0x4be18b){_0x2f342b=_0x2f342b-0x167;const _0x5aef20=a181_0x5aef();let _0x22a902=_0x5aef20[_0x2f342b];return _0x22a902;}import{validateAppcode}from'../../commands/common/validate.js';import{readConfigFile,readRawConfigWithLayers,resolveWriteConfigPath,writeConfigFile}from'../../context.js';import{workspaceAddDefinition}from'../../commands/workspace/add.js';import{workspaceRemoveDefinition}from'../../commands/workspace/remove.js';const WORKSPACE_USAGE=CLI_BIN_NAME+a181_0x5a0dc1(0x16d),SAFE_PROFILE_KEYS=['appcode',a181_0x5a0dc1(0x19f),a181_0x5a0dc1(0x173),a181_0x5a0dc1(0x197),a181_0x5a0dc1(0x17a),a181_0x5a0dc1(0x183),a181_0x5a0dc1(0x192)],workspaceFlags=[{'name':a181_0x5a0dc1(0x182),'type':'string','description':'App\x20profile\x20name\x20to\x20use\x20in\x20this\x20workspace'},{'name':'appcode','type':a181_0x5a0dc1(0x178),'description':a181_0x5a0dc1(0x18d)},{'name':a181_0x5a0dc1(0x19f),'type':'string','description':'Target\x20environment','enum':[...RABETBASE_ENV_VALUES]},{'name':'apiDir','type':a181_0x5a0dc1(0x178),'description':a181_0x5a0dc1(0x189)},{'name':a181_0x5a0dc1(0x191),'type':a181_0x5a0dc1(0x178),'description':a181_0x5a0dc1(0x181),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':a181_0x5a0dc1(0x17a),'type':a181_0x5a0dc1(0x170),'description':'Default\x20page\x20size\x20for\x20this\x20workspace\x20app\x20profile'},{'name':a181_0x5a0dc1(0x183),'type':a181_0x5a0dc1(0x178),'description':a181_0x5a0dc1(0x198),'enum':[...RISK_LEVEL_VALUES]},{'name':a181_0x5a0dc1(0x192),'type':a181_0x5a0dc1(0x178),'description':'Locale\x20for\x20this\x20workspace\x20app\x20profile'}];function isRecord(_0xe84daa){const _0x488f5d=a181_0x5a0dc1;return!!_0xe84daa&&typeof _0xe84daa===_0x488f5d(0x179)&&!Array[_0x488f5d(0x168)](_0xe84daa);}function assertValidAppcode(_0x366523){const _0x25bd0a=a181_0x5a0dc1,{valid:_0x1636a7,message:_0xca3d83}=validateAppcode(_0x366523);if(!_0x1636a7)throw CliErrors['validation'](_0x25bd0a(0x19a)+_0x366523,_0xca3d83);}function sanitizeProfile(_0x35348f){if(!isRecord(_0x35348f))return{};const _0x51a3fb={};for(const _0x5ddc05 of SAFE_PROFILE_KEYS){if(_0x35348f[_0x5ddc05]!==undefined)_0x51a3fb[_0x5ddc05]=_0x35348f[_0x5ddc05];}return _0x51a3fb;}function cloneProfile(_0x4c7db3){return isRecord(_0x4c7db3)?{..._0x4c7db3}:{};}function collectWorkspaceProfileOverrides(_0x561c0d){const _0x2dfb8d=a181_0x5a0dc1,_0x4b4361={},_0xe609cb=_0x561c0d[_0x2dfb8d(0x187)]('env'),_0x15b340=_0x561c0d[_0x2dfb8d(0x187)]('apiDir'),_0x2eee2a=_0x561c0d['str']('defaultFormat'),_0x9544da=_0x561c0d[_0x2dfb8d(0x195)](_0x2dfb8d(0x17a)),_0x4ec7ab=_0x561c0d[_0x2dfb8d(0x187)](_0x2dfb8d(0x183)),_0x27e5ce=_0x561c0d[_0x2dfb8d(0x187)]('locale');if(_0xe609cb)_0x4b4361[_0x2dfb8d(0x19f)]=_0xe609cb;if(_0x15b340)_0x4b4361[_0x2dfb8d(0x173)]=_0x15b340;if(_0x2eee2a)_0x4b4361['format']=_0x2eee2a;if(_0x9544da!==undefined&&_0x9544da!=='')_0x4b4361[_0x2dfb8d(0x17a)]=Number(_0x9544da);if(_0x4ec7ab)_0x4b4361['riskLevel']=_0x4ec7ab;if(_0x27e5ce)_0x4b4361[_0x2dfb8d(0x192)]=_0x27e5ce;return _0x4b4361;}async function validateWorkspaceArgs(_0x14f09b){const _0x85a208=a181_0x5a0dc1,_0x2eacf6=_0x14f09b[_0x85a208(0x187)](_0x85a208(0x182))[_0x85a208(0x18b)](),_0x31f8ab=_0x14f09b[_0x85a208(0x187)](_0x85a208(0x194))[_0x85a208(0x18b)]();if(!_0x2eacf6&&!_0x31f8ab)throw CliErrors[_0x85a208(0x19c)](_0x85a208(0x180),_0x85a208(0x199)+CLI_BIN_NAME+_0x85a208(0x17d)+CLI_BIN_NAME+'\x20workspace\x20use\x20--app\x20<name>`.');if(_0x31f8ab)assertValidAppcode(_0x31f8ab);}function resolveKnownApps(){const _0x3b0d09=a181_0x5a0dc1,{config:_0x4ceab3,layers:_0x3fd923}=readRawConfigWithLayers(),_0x143f96=isRecord(_0x4ceab3[_0x3b0d09(0x193)])?_0x4ceab3['apps']:{},_0x37ee1c=isRecord(_0x3fd923[_0x3b0d09(0x16c)]['apps'])?_0x3fd923[_0x3b0d09(0x16c)][_0x3b0d09(0x193)]:{};return{..._0x37ee1c,..._0x143f96};}async function configureWorkspace(_0x3c0fad,_0x41cc76){const _0x37832e=a181_0x5a0dc1,_0xd0303a=_0x3c0fad[_0x37832e(0x187)]('app')[_0x37832e(0x18b)](),_0x2691ee=_0x3c0fad[_0x37832e(0x187)]('appcode')[_0x37832e(0x18b)](),_0x5b35c9=_0xd0303a||_0x2691ee;if(!_0x5b35c9)throw CliErrors[_0x37832e(0x19c)]('Missing\x20workspace\x20app\x20selector.','Use\x20`'+CLI_BIN_NAME+_0x37832e(0x17d)+CLI_BIN_NAME+_0x37832e(0x174));if(_0x2691ee)assertValidAppcode(_0x2691ee);const _0x1f2580=resolveWriteConfigPath('project'),_0x318099=readConfigFile(_0x1f2580),_0x2d9710=resolveKnownApps(),_0x5e0f6f=isRecord(_0x318099[_0x37832e(0x193)])?{..._0x318099['apps']}:{},_0x5904e2=cloneProfile(_0x5e0f6f[_0x5b35c9]),_0x5ee603=sanitizeProfile(_0x2d9710[_0x5b35c9]),_0x479210=_0x2691ee?{}:_0x5ee603,_0x5f4921=_0x2691ee||_0x479210[_0x37832e(0x194)];if(!_0x5f4921){const _0x3170c2=Object[_0x37832e(0x169)](_0x2d9710),_0x43c501=_0x3170c2[_0x37832e(0x175)]===0x0?'Use\x20`'+CLI_BIN_NAME+'\x20workspace\x20'+_0x41cc76+_0x37832e(0x16f)+_0x5b35c9+_0x37832e(0x16b):'Pass\x20--appcode\x20<code>,\x20or\x20choose\x20one\x20of:\x20'+_0x3170c2[_0x37832e(0x177)](',\x20');throw CliErrors[_0x37832e(0x19c)](_0x37832e(0x17b)+_0x5b35c9+'\x22\x20not\x20found.',_0x43c501);}assertValidAppcode(String(_0x5f4921));const _0xe232c1={..._0x479210,..._0x5904e2,'appcode':String(_0x5f4921),...collectWorkspaceProfileOverrides(_0x3c0fad)};return _0x5e0f6f[_0x5b35c9]=_0xe232c1,_0x318099[_0x37832e(0x193)]=_0x5e0f6f,_0x318099[_0x37832e(0x19e)]=_0x5b35c9,delete _0x318099[_0x37832e(0x194)],delete _0x318099['app'],_0xe232c1['env']&&(_0x318099[_0x37832e(0x19f)]=_0xe232c1[_0x37832e(0x19f)]),writeConfigFile(_0x1f2580,_0x318099),{'ok':!![],'message':_0x37832e(0x184)+(_0x41cc76===_0x37832e(0x19b)?'initialized':_0x37832e(0x18f))+':\x20'+_0x5b35c9+_0x37832e(0x167)+_0xe232c1[_0x37832e(0x194)]+_0x37832e(0x17f)+_0x1f2580+_0x37832e(0x16e),'data':{'operation':'workspace.'+_0x41cc76,'configPath':_0x1f2580,'app':_0x5b35c9,'appcode':_0xe232c1[_0x37832e(0x194)],'env':_0xe232c1['env']??null,'credentialsWritten':![]}};}const workspaceInitDefinition={'service':'workspace','command':a181_0x5a0dc1(0x19b),'description':a181_0x5a0dc1(0x16a),'risk':a181_0x5a0dc1(0x17e),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x18e95d=>configureWorkspace(_0x18e95d,'init')},workspaceUseDefinition={'service':a181_0x5a0dc1(0x18c),'command':a181_0x5a0dc1(0x1a0),'description':'Switch\x20the\x20current\x20workspace\x20app\x20binding','risk':a181_0x5a0dc1(0x17e),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x509a05=>configureWorkspace(_0x509a05,a181_0x5a0dc1(0x1a0))};export const workspaceDefinitions=[workspaceInitDefinition,workspaceUseDefinition,workspaceAddDefinition,workspaceRemoveDefinition];export{WORKSPACE_USAGE};function a181_0x5aef(){const _0x3e3a76=['2PnsVqN','API\x20directory\x20path\x20for\x20this\x20workspace\x20app\x20profile','53555tZctpD','trim','workspace','App\x20code\x20to\x20bind\x20to\x20this\x20workspace','3558072YHugyv','updated','184NmqLLw','defaultFormat','locale','apps','appcode','flag','11575470EWpBRq','format','Risk\x20level\x20for\x20this\x20workspace\x20app\x20profile','Use\x20`','Invalid\x20appcode:\x20','init','validation','53820BMeFPS','defaultApp','env','use','\x20(appcode:\x20','isArray','keys','Initialize\x20the\x20current\x20workspace\x20app\x20binding','\x20--appcode\x20<code>`.','globalConfig','\x20workspace\x20<init|use>\x20--app\x20<name>\x20[--appcode\x20<code>]','.\x20Credentials:\x20not\x20written.','\x20--app\x20','number','7zmUIHB','12876108YmNmfe','apiDir','\x20workspace\x20use\x20--app\x20<name>`.','length','11WhMqcZ','join','string','object','pageSize','App\x20\x22','332HNwrKE','\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`','write',').\x20Config:\x20','Missing\x20workspace\x20app\x20selector.','Default\x20output\x20format\x20for\x20this\x20workspace\x20app\x20profile','app','riskLevel','Workspace\x20','1217933MIeyla','3921672CSmCIh','str'];a181_0x5aef=function(){return _0x3e3a76;};return a181_0x5aef();}
1
+ function a181_0x5c4d(){const _0x22cc1a=['64YmIWYO','Risk\x20level\x20for\x20this\x20workspace\x20app\x20profile','str','19582qjmuMR','app','App\x20profile\x20name\x20to\x20use\x20in\x20this\x20workspace','295827YxCrBX','apiDir','\x20workspace\x20use\x20--app\x20<name>`.','trim','\x22\x20not\x20found.','use','join','16kbecXb','Missing\x20workspace\x20app\x20selector.','5Yxfhva','.\x20Credentials:\x20not\x20written.','project','format','App\x20\x22','number','17141399reYyco','Target\x20environment','validation','Use\x20`','1046715yWiKIG','workspace','string','appcode','Switch\x20the\x20current\x20workspace\x20app\x20binding','Invalid\x20appcode:\x20','Workspace\x20','pageSize','locale','App\x20code\x20to\x20bind\x20to\x20this\x20workspace','keys','Initialize\x20the\x20current\x20workspace\x20app\x20binding','\x20workspace\x20<init|use>\x20--app\x20<name>\x20[--appcode\x20<code>]','workspace.','object','write','defaultApp','env','init','\x20(appcode:\x20','3862470ppfyby','1130630GeXQsX','apps','81JpgJFE','riskLevel','442107kEhlTQ','\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`','\x20--appcode\x20<code>`.','isArray','API\x20directory\x20path\x20for\x20this\x20workspace\x20app\x20profile','flag','globalConfig','\x20workspace\x20','Default\x20page\x20size\x20for\x20this\x20workspace\x20app\x20profile'];a181_0x5c4d=function(){return _0x22cc1a;};return a181_0x5c4d();}const a181_0x36751e=a181_0x7a0f;(function(_0x28aa23,_0x30f6b7){const _0x5185ac=a181_0x7a0f,_0x5c0feb=_0x28aa23();while(!![]){try{const _0x3344b7=parseInt(_0x5185ac(0x114))/0x1*(parseInt(_0x5185ac(0xe7))/0x2)+parseInt(_0x5185ac(0xfd))/0x3*(-parseInt(_0x5185ac(0xf1))/0x4)+parseInt(_0x5185ac(0xf3))/0x5*(-parseInt(_0x5185ac(0x111))/0x6)+parseInt(_0x5185ac(0xea))/0x7*(parseInt(_0x5185ac(0x11f))/0x8)+-parseInt(_0x5185ac(0x116))/0x9+parseInt(_0x5185ac(0x112))/0xa+parseInt(_0x5185ac(0xf9))/0xb;if(_0x3344b7===_0x30f6b7)break;else _0x5c0feb['push'](_0x5c0feb['shift']());}catch(_0x2486af){_0x5c0feb['push'](_0x5c0feb['shift']());}}}(a181_0x5c4d,0xae53b));function a181_0x7a0f(_0x38d276,_0x2f2db7){_0x38d276=_0x38d276-0xe6;const _0x5c4d48=a181_0x5c4d();let _0x7a0f5b=_0x5c4d48[_0x38d276];return _0x7a0f5b;}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{RABETBASE_ENV_VALUES}from'../../constant/env.js';import{RABETBASE_OUTPUT_FORMAT_VALUES}from'../../constant/output.js';import{RISK_LEVEL_VALUES}from'../../constant/risk.js';import{validateAppcode}from'../../commands/common/validate.js';import{readConfigFile,readRawConfigWithLayers,resolveWriteConfigPath,writeConfigFile}from'../../context.js';import{workspaceAddDefinition}from'../../commands/workspace/add.js';import{workspaceRemoveDefinition}from'../../commands/workspace/remove.js';const WORKSPACE_USAGE=CLI_BIN_NAME+a181_0x36751e(0x109),SAFE_PROFILE_KEYS=[a181_0x36751e(0x100),a181_0x36751e(0x10e),a181_0x36751e(0xeb),a181_0x36751e(0xf6),'pageSize',a181_0x36751e(0x115),a181_0x36751e(0x105)],workspaceFlags=[{'name':a181_0x36751e(0xe8),'type':'string','description':a181_0x36751e(0xe9)},{'name':a181_0x36751e(0x100),'type':a181_0x36751e(0xff),'description':a181_0x36751e(0x106)},{'name':a181_0x36751e(0x10e),'type':'string','description':a181_0x36751e(0xfa),'enum':[...RABETBASE_ENV_VALUES]},{'name':a181_0x36751e(0xeb),'type':'string','description':a181_0x36751e(0x11a)},{'name':'defaultFormat','type':a181_0x36751e(0xff),'description':'Default\x20output\x20format\x20for\x20this\x20workspace\x20app\x20profile','enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':a181_0x36751e(0x104),'type':a181_0x36751e(0xf8),'description':a181_0x36751e(0x11e)},{'name':a181_0x36751e(0x115),'type':a181_0x36751e(0xff),'description':a181_0x36751e(0x120),'enum':[...RISK_LEVEL_VALUES]},{'name':a181_0x36751e(0x105),'type':a181_0x36751e(0xff),'description':'Locale\x20for\x20this\x20workspace\x20app\x20profile'}];function isRecord(_0x56a87e){const _0x16c4d7=a181_0x36751e;return!!_0x56a87e&&typeof _0x56a87e===_0x16c4d7(0x10b)&&!Array[_0x16c4d7(0x119)](_0x56a87e);}function assertValidAppcode(_0x5c3418){const _0x3334f9=a181_0x36751e,{valid:_0x8c9633,message:_0x25bb2e}=validateAppcode(_0x5c3418);if(!_0x8c9633)throw CliErrors[_0x3334f9(0xfb)](_0x3334f9(0x102)+_0x5c3418,_0x25bb2e);}function sanitizeProfile(_0x26dfaf){if(!isRecord(_0x26dfaf))return{};const _0x4efcf9={};for(const _0x54ecce of SAFE_PROFILE_KEYS){if(_0x26dfaf[_0x54ecce]!==undefined)_0x4efcf9[_0x54ecce]=_0x26dfaf[_0x54ecce];}return _0x4efcf9;}function cloneProfile(_0x11a57c){return isRecord(_0x11a57c)?{..._0x11a57c}:{};}function collectWorkspaceProfileOverrides(_0x59b1fb){const _0x2bd4aa=a181_0x36751e,_0x247a2e={},_0x3463c7=_0x59b1fb['str'](_0x2bd4aa(0x10e)),_0x50aeff=_0x59b1fb[_0x2bd4aa(0xe6)](_0x2bd4aa(0xeb)),_0x40719f=_0x59b1fb[_0x2bd4aa(0xe6)]('defaultFormat'),_0x28267f=_0x59b1fb[_0x2bd4aa(0x11b)](_0x2bd4aa(0x104)),_0x13446f=_0x59b1fb['str'](_0x2bd4aa(0x115)),_0x59cbf1=_0x59b1fb[_0x2bd4aa(0xe6)](_0x2bd4aa(0x105));if(_0x3463c7)_0x247a2e[_0x2bd4aa(0x10e)]=_0x3463c7;if(_0x50aeff)_0x247a2e[_0x2bd4aa(0xeb)]=_0x50aeff;if(_0x40719f)_0x247a2e['format']=_0x40719f;if(_0x28267f!==undefined&&_0x28267f!=='')_0x247a2e[_0x2bd4aa(0x104)]=Number(_0x28267f);if(_0x13446f)_0x247a2e[_0x2bd4aa(0x115)]=_0x13446f;if(_0x59cbf1)_0x247a2e[_0x2bd4aa(0x105)]=_0x59cbf1;return _0x247a2e;}async function validateWorkspaceArgs(_0x2a5057){const _0x326c0d=a181_0x36751e,_0x5c78b=_0x2a5057[_0x326c0d(0xe6)](_0x326c0d(0xe8))['trim'](),_0x3279f6=_0x2a5057[_0x326c0d(0xe6)](_0x326c0d(0x100))['trim']();if(!_0x5c78b&&!_0x3279f6)throw CliErrors['validation']('Missing\x20workspace\x20app\x20selector.',_0x326c0d(0xfc)+CLI_BIN_NAME+_0x326c0d(0x117)+CLI_BIN_NAME+_0x326c0d(0xec));if(_0x3279f6)assertValidAppcode(_0x3279f6);}function resolveKnownApps(){const _0x1fb8e0=a181_0x36751e,{config:_0x5c89f1,layers:_0x13a514}=readRawConfigWithLayers(),_0x157306=isRecord(_0x5c89f1['apps'])?_0x5c89f1[_0x1fb8e0(0x113)]:{},_0x2c072d=isRecord(_0x13a514[_0x1fb8e0(0x11c)][_0x1fb8e0(0x113)])?_0x13a514[_0x1fb8e0(0x11c)][_0x1fb8e0(0x113)]:{};return{..._0x2c072d,..._0x157306};}async function configureWorkspace(_0x52ecd3,_0x520cc7){const _0x5b170e=a181_0x36751e,_0x211840=_0x52ecd3['str'](_0x5b170e(0xe8))[_0x5b170e(0xed)](),_0x209f4c=_0x52ecd3[_0x5b170e(0xe6)](_0x5b170e(0x100))[_0x5b170e(0xed)](),_0x57929e=_0x211840||_0x209f4c;if(!_0x57929e)throw CliErrors['validation'](_0x5b170e(0xf2),_0x5b170e(0xfc)+CLI_BIN_NAME+_0x5b170e(0x117)+CLI_BIN_NAME+_0x5b170e(0xec));if(_0x209f4c)assertValidAppcode(_0x209f4c);const _0xbc4185=resolveWriteConfigPath(_0x5b170e(0xf5)),_0x397211=readConfigFile(_0xbc4185),_0x1db72a=resolveKnownApps(),_0x22766e=isRecord(_0x397211[_0x5b170e(0x113)])?{..._0x397211[_0x5b170e(0x113)]}:{},_0x221740=cloneProfile(_0x22766e[_0x57929e]),_0x25fa4a=sanitizeProfile(_0x1db72a[_0x57929e]),_0xcbc499=_0x209f4c?{}:_0x25fa4a,_0x2af131=_0x209f4c||_0xcbc499['appcode'];if(!_0x2af131){const _0x4337a4=Object[_0x5b170e(0x107)](_0x1db72a),_0x585af1=_0x4337a4['length']===0x0?_0x5b170e(0xfc)+CLI_BIN_NAME+_0x5b170e(0x11d)+_0x520cc7+'\x20--app\x20'+_0x57929e+_0x5b170e(0x118):'Pass\x20--appcode\x20<code>,\x20or\x20choose\x20one\x20of:\x20'+_0x4337a4[_0x5b170e(0xf0)](',\x20');throw CliErrors[_0x5b170e(0xfb)](_0x5b170e(0xf7)+_0x57929e+_0x5b170e(0xee),_0x585af1);}assertValidAppcode(String(_0x2af131));const _0x226347={..._0xcbc499,..._0x221740,'appcode':String(_0x2af131),...collectWorkspaceProfileOverrides(_0x52ecd3)};return _0x22766e[_0x57929e]=_0x226347,_0x397211[_0x5b170e(0x113)]=_0x22766e,_0x397211[_0x5b170e(0x10d)]=_0x57929e,delete _0x397211[_0x5b170e(0x100)],delete _0x397211[_0x5b170e(0xe8)],_0x226347[_0x5b170e(0x10e)]&&(_0x397211[_0x5b170e(0x10e)]=_0x226347[_0x5b170e(0x10e)]),writeConfigFile(_0xbc4185,_0x397211),{'ok':!![],'message':_0x5b170e(0x103)+(_0x520cc7==='init'?'initialized':'updated')+':\x20'+_0x57929e+_0x5b170e(0x110)+_0x226347[_0x5b170e(0x100)]+').\x20Config:\x20'+_0xbc4185+_0x5b170e(0xf4),'data':{'operation':_0x5b170e(0x10a)+_0x520cc7,'configPath':_0xbc4185,'app':_0x57929e,'appcode':_0x226347[_0x5b170e(0x100)],'env':_0x226347[_0x5b170e(0x10e)]??null,'credentialsWritten':![]}};}const workspaceInitDefinition={'service':'workspace','command':a181_0x36751e(0x10f),'description':a181_0x36751e(0x108),'risk':a181_0x36751e(0x10c),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x555005=>configureWorkspace(_0x555005,a181_0x36751e(0x10f))},workspaceUseDefinition={'service':a181_0x36751e(0xfe),'command':a181_0x36751e(0xef),'description':a181_0x36751e(0x101),'risk':'write','requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x8a20d8=>configureWorkspace(_0x8a20d8,a181_0x36751e(0xef))};export const workspaceDefinitions=[workspaceInitDefinition,workspaceUseDefinition,workspaceAddDefinition,workspaceRemoveDefinition];export{WORKSPACE_USAGE};
@@ -1 +1 @@
1
- const a182_0x39c5e7=a182_0x3781;function a182_0x3fa5(){const _0x3c4b39=['remove','720OqaEDq','Remove\x20an\x20app\x20profile\x20from\x20the\x20current\x20workspace\x20(or\x20--global)','49605gjpMmk','2040yDPrtF','22BUlysb','4ldFtTj','574713fvfRgM','483YuLLgz','570DedGmX','high-risk-write','5848rHAxmy','5549621TdYZML','12588SazmGi','2576480ADUaEH','workspace\x20remove','101881UXeZFm','App\x20profile\x20name\x20to\x20remove'];a182_0x3fa5=function(){return _0x3c4b39;};return a182_0x3fa5();}function a182_0x3781(_0x182c20,_0x53db38){_0x182c20=_0x182c20-0x141;const _0x3fa524=a182_0x3fa5();let _0x3781cc=_0x3fa524[_0x182c20];return _0x3781cc;}(function(_0x42832a,_0x3c2abe){const _0x2fbaea=a182_0x3781,_0x275500=_0x42832a();while(!![]){try{const _0xe25d6e=parseInt(_0x2fbaea(0x146))/0x1*(parseInt(_0x2fbaea(0x145))/0x2)+-parseInt(_0x2fbaea(0x147))/0x3*(parseInt(_0x2fbaea(0x14c))/0x4)+parseInt(_0x2fbaea(0x142))/0x5*(parseInt(_0x2fbaea(0x148))/0x6)+parseInt(_0x2fbaea(0x14b))/0x7+-parseInt(_0x2fbaea(0x14a))/0x8*(-parseInt(_0x2fbaea(0x152))/0x9)+parseInt(_0x2fbaea(0x14d))/0xa*(-parseInt(_0x2fbaea(0x144))/0xb)+parseInt(_0x2fbaea(0x143))/0xc*(-parseInt(_0x2fbaea(0x14f))/0xd);if(_0xe25d6e===_0x3c2abe)break;else _0x275500['push'](_0x275500['shift']());}catch(_0x587145){_0x275500['push'](_0x275500['shift']());}}}(a182_0x3fa5,0x8fc97));import{buildAppRemoveFlags,runAppRemove,validateAppName}from'../../commands/common/app-registry.js';export const workspaceRemoveDefinition={'service':'workspace','command':a182_0x39c5e7(0x151),'description':a182_0x39c5e7(0x141),'risk':a182_0x39c5e7(0x149),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':'name','description':a182_0x39c5e7(0x150),'required':!![]}],'flags':buildAppRemoveFlags(),'validate':_0x196e08=>validateAppName(_0x196e08,'workspace\x20remove'),'execute':_0x2e7f11=>runAppRemove(_0x2e7f11,a182_0x39c5e7(0x14e))};
1
+ function a182_0x5df3(){const _0x53d6f9=['Remove\x20an\x20app\x20profile\x20from\x20the\x20current\x20workspace\x20(or\x20--global)','workspace','3773862vcMWFT','4390992VeTjcZ','16PPFlFF','1201930epySbV','492264eGtXKr','34982PkiBRZ','2087085HNhKKI','431324YqxESy','high-risk-write','name','3AWnWQu','remove'];a182_0x5df3=function(){return _0x53d6f9;};return a182_0x5df3();}function a182_0x1f4d(_0x35890c,_0x439258){_0x35890c=_0x35890c-0xf8;const _0x5df3ca=a182_0x5df3();let _0x1f4d6e=_0x5df3ca[_0x35890c];return _0x1f4d6e;}const a182_0x3cc9e2=a182_0x1f4d;(function(_0x4e7d5b,_0x449c60){const _0x47721e=a182_0x1f4d,_0x12d79d=_0x4e7d5b();while(!![]){try{const _0x1dac1d=parseInt(_0x47721e(0xfc))/0x1+-parseInt(_0x47721e(0xfd))/0x2*(-parseInt(_0x47721e(0x102))/0x3)+parseInt(_0x47721e(0xff))/0x4+-parseInt(_0x47721e(0xfb))/0x5+parseInt(_0x47721e(0xf8))/0x6+parseInt(_0x47721e(0xfe))/0x7+-parseInt(_0x47721e(0xfa))/0x8*(parseInt(_0x47721e(0xf9))/0x9);if(_0x1dac1d===_0x449c60)break;else _0x12d79d['push'](_0x12d79d['shift']());}catch(_0xff35cf){_0x12d79d['push'](_0x12d79d['shift']());}}}(a182_0x5df3,0x5036c));import{buildAppRemoveFlags,runAppRemove,validateAppName}from'../../commands/common/app-registry.js';export const workspaceRemoveDefinition={'service':a182_0x3cc9e2(0x105),'command':a182_0x3cc9e2(0x103),'description':a182_0x3cc9e2(0x104),'risk':a182_0x3cc9e2(0x100),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a182_0x3cc9e2(0x101),'description':'App\x20profile\x20name\x20to\x20remove','required':!![]}],'flags':buildAppRemoveFlags(),'validate':_0x25beb9=>validateAppName(_0x25beb9,'workspace\x20remove'),'execute':_0x21aebd=>runAppRemove(_0x21aebd,'workspace\x20remove')};
@@ -1 +1 @@
1
- const a183_0x13dab5=a183_0x523a;(function(_0x2a1a17,_0xb7749d){const _0x563fe6=a183_0x523a,_0x9ecab4=_0x2a1a17();while(!![]){try{const _0x55edfd=-parseInt(_0x563fe6(0xc1))/0x1*(parseInt(_0x563fe6(0xc6))/0x2)+parseInt(_0x563fe6(0xb0))/0x3+-parseInt(_0x563fe6(0xaa))/0x4*(-parseInt(_0x563fe6(0xba))/0x5)+-parseInt(_0x563fe6(0x9f))/0x6+parseInt(_0x563fe6(0xa1))/0x7+-parseInt(_0x563fe6(0xac))/0x8+parseInt(_0x563fe6(0xad))/0x9*(-parseInt(_0x563fe6(0xc5))/0xa);if(_0x55edfd===_0xb7749d)break;else _0x9ecab4['push'](_0x9ecab4['shift']());}catch(_0x4d4cdf){_0x9ecab4['push'](_0x9ecab4['shift']());}}}(a183_0x1440,0x8bee4));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=[a183_0x13dab5(0xb6),a183_0x13dab5(0xbe),'locale','format',a183_0x13dab5(0xb2)];export const TOP_LEVEL_CONFIG_KEYS=new Set(['appcode',a183_0x13dab5(0xa2),'locale',a183_0x13dab5(0xbb),a183_0x13dab5(0xb6),a183_0x13dab5(0xbe),a183_0x13dab5(0xc3)]);export const CONFIG_ENUM_VALUES={'env':[...RABETBASE_ENV_VALUES],'format':[...RABETBASE_OUTPUT_FORMAT_VALUES]};export function formatConfigKeyList(_0x1922db){return[..._0x1922db]['join'](',\x20');}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function isTopLevelConfigKey(_0x4df1e9){const _0x47df90=a183_0x13dab5;return TOP_LEVEL_CONFIG_KEYS[_0x47df90(0xc7)](_0x4df1e9);}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){const _0xb168b3=a183_0x13dab5;return _0xb168b3(0xc4)+getTopLevelConfigKeySummary()+')';}function a183_0x523a(_0x37cb2a,_0x5c59e3){_0x37cb2a=_0x37cb2a-0x9f;const _0x14409f=a183_0x1440();let _0x523a4d=_0x14409f[_0x37cb2a];return _0x523a4d;}export const APP_PROFILE_FLAG_KEY_MAP={'env':a183_0x13dab5(0xa2),'apiDir':'apiDir','cookie':a183_0x13dab5(0xb6),'accessKey':a183_0x13dab5(0xbe),'defaultFormat':'format','pageSize':a183_0x13dab5(0xb1),'riskLevel':a183_0x13dab5(0xb2),'locale':a183_0x13dab5(0xa6)};function a183_0x1440(){const _0x24ece9=['zh-CN','apps','Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','cookie','inherit','Risk\x20level','API\x20directory\x20path','4825tIqOYs','format','entries','toLowerCase','accessKey','filter','string','1733zWAhEs','Access\x20key','apiDir','Config\x20key\x20(','1510AaisUB','452oUKgAJ','has','2825256wgZSWo','Default\x20page\x20size','5745117iWSssD','env','en-US','keys','Auth\x20cookie','locale','defaultApp','length','appcode','3460WEUUrM','defaultFormat','8722880bXbxUI','4626CWUMHv','trim','app','2844624OjeMZP','pageSize','riskLevel'];a183_0x1440=function(){return _0x24ece9;};return a183_0x1440();}export function getAppProfileFlagDefs(){const _0x5782a8=a183_0x13dab5;return[{'name':_0x5782a8(0xa2),'type':'string','description':'Target\x20environment','enum':[...RABETBASE_ENV_VALUES]},{'name':'apiDir','type':'string','description':_0x5782a8(0xb9)},{'name':_0x5782a8(0xb6),'type':_0x5782a8(0xc0),'description':_0x5782a8(0xa5),'hidden':!![]},{'name':_0x5782a8(0xbe),'type':_0x5782a8(0xc0),'description':_0x5782a8(0xc2),'hidden':!![]},{'name':_0x5782a8(0xab),'type':'string','description':_0x5782a8(0xb5),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':'pageSize','type':'number','description':_0x5782a8(0xa0)},{'name':_0x5782a8(0xb2),'type':_0x5782a8(0xc0),'description':_0x5782a8(0xb8),'enum':[...RISK_LEVEL_VALUES]},{'name':_0x5782a8(0xa6),'type':_0x5782a8(0xc0),'description':'Locale'}];}export function collectAppProfileOverrides(_0x338d84){const _0x4ebd51=a183_0x13dab5,_0x5646f2={};for(const [_0x4b2b68,_0x46697d]of Object[_0x4ebd51(0xbc)](APP_PROFILE_FLAG_KEY_MAP)){const _0x4410d6=_0x338d84(_0x4b2b68);if(!_0x4410d6)continue;_0x5646f2[_0x46697d]=_0x46697d==='pageSize'?Number(_0x4410d6):_0x4410d6;}return _0x5646f2;}export function buildAppProfileListFields(_0x1c12c5){const _0x2e734f=a183_0x13dab5;return{'env':_0x1c12c5['env']??null,'apiDir':_0x1c12c5[_0x2e734f(0xc3)]??null,'hasCookie':!!_0x1c12c5['cookie'],'hasAccessKey':!!_0x1c12c5[_0x2e734f(0xbe)],'format':_0x1c12c5['format']??null,'pageSize':_0x1c12c5[_0x2e734f(0xb1)]??null,'riskLevel':_0x1c12c5[_0x2e734f(0xb2)]??null,'locale':_0x1c12c5[_0x2e734f(0xa6)]??null};}export function buildAppDoctorFields(_0x277bac,_0x2f8c0b){const _0x4cc5be=a183_0x13dab5;return{'env':{'value':_0x277bac['env']||_0x2f8c0b[_0x4cc5be(0xa2)],'source':_0x277bac[_0x4cc5be(0xa2)]?_0x4cc5be(0xaf):'inherit'},'apiDir':{'value':_0x277bac[_0x4cc5be(0xc3)]||_0x2f8c0b['apiDir'],'source':_0x277bac[_0x4cc5be(0xc3)]?_0x4cc5be(0xaf):'inherit'},'cookie':{'value':_0x277bac[_0x4cc5be(0xb6)]||_0x2f8c0b[_0x4cc5be(0xb6)],'source':_0x277bac[_0x4cc5be(0xb6)]?_0x4cc5be(0xaf):'inherit'},'accessKey':{'value':_0x277bac[_0x4cc5be(0xbe)]||_0x2f8c0b[_0x4cc5be(0xbe)],'source':_0x277bac['accessKey']?_0x4cc5be(0xaf):_0x4cc5be(0xb7)}};}export function buildCanonicalAppConfig(_0x16ad38,_0x352bad){const _0x3fa860=a183_0x13dab5,_0x53dc85=_0x16ad38['map'](_0x352423=>String(_0x352423||'')[_0x3fa860(0xae)]())[_0x3fa860(0xbf)](Boolean);if(_0x53dc85[_0x3fa860(0xa8)]===0x0)return{};const _0x511615={};for(const _0x21c44f of _0x53dc85){_0x511615[_0x21c44f]=_0x352bad?{'appcode':_0x21c44f,'env':_0x352bad}:{'appcode':_0x21c44f};}return{'apps':_0x511615,'defaultApp':_0x53dc85[0x0]};}export function buildCanonicalProjectConfig(_0x2d4c0c,_0x3bb69e){const _0xd9dd42=a183_0x13dab5,{appCodes:appCodes=[],env:_0x33fcd3,metadata:_0x48423a}=_0x3bb69e,_0x4634a1={..._0x2d4c0c,..._0x48423a||{}};delete _0x4634a1[_0xd9dd42(0xa9)],delete _0x4634a1[_0xd9dd42(0xaf)];if(_0x33fcd3)_0x4634a1[_0xd9dd42(0xa2)]=_0x33fcd3;else!_0x4634a1[_0xd9dd42(0xa2)]&&(_0x4634a1['env']=DEFAULT_CONFIG_VALUES[_0xd9dd42(0xa2)]);const _0x1c9778=buildCanonicalAppConfig(appCodes,_0x4634a1[_0xd9dd42(0xa2)]);return Object[_0xd9dd42(0xa4)](_0x1c9778)[_0xd9dd42(0xa8)]>0x0&&(_0x4634a1[_0xd9dd42(0xb4)]=_0x1c9778[_0xd9dd42(0xb4)],_0x4634a1[_0xd9dd42(0xa7)]=_0x1c9778[_0xd9dd42(0xa7)]),_0x4634a1;}const LOCALE_MAP={'zh':'zh-CN','zh-cn':a183_0x13dab5(0xb3),'zh_cn':a183_0x13dab5(0xb3),'en':a183_0x13dab5(0xa3),'en-us':'en-US','en_us':'en-US'};export function normalizeLocale(_0x2601d8){const _0x11cdc8=a183_0x13dab5;if(!_0x2601d8)return null;return LOCALE_MAP[_0x2601d8[_0x11cdc8(0xbd)]()]??null;}
1
+ const a183_0x1cbbb2=a183_0x1bb3;(function(_0x19f015,_0x4c9f2c){const _0x47049e=a183_0x1bb3,_0x470a98=_0x19f015();while(!![]){try{const _0x1c61c4=parseInt(_0x47049e(0x1f0))/0x1+parseInt(_0x47049e(0x1fc))/0x2*(-parseInt(_0x47049e(0x209))/0x3)+-parseInt(_0x47049e(0x1fb))/0x4+-parseInt(_0x47049e(0x207))/0x5+-parseInt(_0x47049e(0x204))/0x6+-parseInt(_0x47049e(0x213))/0x7*(-parseInt(_0x47049e(0x210))/0x8)+parseInt(_0x47049e(0x20a))/0x9*(parseInt(_0x47049e(0x1f9))/0xa);if(_0x1c61c4===_0x4c9f2c)break;else _0x470a98['push'](_0x470a98['shift']());}catch(_0x2a5efd){_0x470a98['push'](_0x470a98['shift']());}}}(a183_0x7eba,0xb4693));import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RABETBASE_ENV_VALUES}from'../constant/env.js';import{RABETBASE_OUTPUT_FORMAT_VALUES}from'../constant/output.js';import{RISK_LEVEL_VALUES}from'../constant/risk.js';export{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';export const PROJECT_CREATE_INHERITABLE_KEYS=['cookie',a183_0x1cbbb2(0x214),a183_0x1cbbb2(0x1f8),a183_0x1cbbb2(0x1f3),a183_0x1cbbb2(0x201)];function a183_0x7eba(){const _0x1a7702=['5360892OkjPIF','148102WDGjAr','app','defaultFormat','trim','filter','riskLevel','appcode','pageSize','1737168dxdlbT','Config\x20key\x20(','entries','2981065ioWZQz','defaultApp','15yyCilN','10633203azPSGQ','number','zh-CN','cookie','Target\x20environment','env','152ONyCwp','apiDir','length','283024hzfcrs','accessKey','toLowerCase','Risk\x20level','apps','Locale','1385507jBfyOA','string','Auth\x20cookie','format','map','inherit','Access\x20key','has','locale','10kUozWe','en-US'];a183_0x7eba=function(){return _0x1a7702;};return a183_0x7eba();}export const TOP_LEVEL_CONFIG_KEYS=new Set([a183_0x1cbbb2(0x202),a183_0x1cbbb2(0x20f),a183_0x1cbbb2(0x1f8),a183_0x1cbbb2(0x1f3),a183_0x1cbbb2(0x20d),'accessKey',a183_0x1cbbb2(0x211)]);export const CONFIG_ENUM_VALUES={'env':[...RABETBASE_ENV_VALUES],'format':[...RABETBASE_OUTPUT_FORMAT_VALUES]};export function formatConfigKeyList(_0x287d1c){return[..._0x287d1c]['join'](',\x20');}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function isTopLevelConfigKey(_0x3bd955){const _0x557696=a183_0x1cbbb2;return TOP_LEVEL_CONFIG_KEYS[_0x557696(0x1f7)](_0x3bd955);}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){const _0x23b0a6=a183_0x1cbbb2;return _0x23b0a6(0x205)+getTopLevelConfigKeySummary()+')';}export const APP_PROFILE_FLAG_KEY_MAP={'env':a183_0x1cbbb2(0x20f),'apiDir':a183_0x1cbbb2(0x211),'cookie':a183_0x1cbbb2(0x20d),'accessKey':a183_0x1cbbb2(0x214),'defaultFormat':a183_0x1cbbb2(0x1f3),'pageSize':a183_0x1cbbb2(0x203),'riskLevel':a183_0x1cbbb2(0x201),'locale':'locale'};export function getAppProfileFlagDefs(){const _0x18f492=a183_0x1cbbb2;return[{'name':_0x18f492(0x20f),'type':_0x18f492(0x1f1),'description':_0x18f492(0x20e),'enum':[...RABETBASE_ENV_VALUES]},{'name':_0x18f492(0x211),'type':'string','description':'API\x20directory\x20path'},{'name':_0x18f492(0x20d),'type':_0x18f492(0x1f1),'description':_0x18f492(0x1f2),'hidden':!![]},{'name':_0x18f492(0x214),'type':_0x18f492(0x1f1),'description':_0x18f492(0x1f6),'hidden':!![]},{'name':_0x18f492(0x1fe),'type':_0x18f492(0x1f1),'description':'Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':_0x18f492(0x203),'type':_0x18f492(0x20b),'description':'Default\x20page\x20size'},{'name':_0x18f492(0x201),'type':_0x18f492(0x1f1),'description':_0x18f492(0x216),'enum':[...RISK_LEVEL_VALUES]},{'name':_0x18f492(0x1f8),'type':'string','description':_0x18f492(0x218)}];}export function collectAppProfileOverrides(_0x48ce21){const _0x192992=a183_0x1cbbb2,_0x570852={};for(const [_0x448177,_0x1b52d5]of Object[_0x192992(0x206)](APP_PROFILE_FLAG_KEY_MAP)){const _0x71b332=_0x48ce21(_0x448177);if(!_0x71b332)continue;_0x570852[_0x1b52d5]=_0x1b52d5===_0x192992(0x203)?Number(_0x71b332):_0x71b332;}return _0x570852;}export function buildAppProfileListFields(_0x14b72e){const _0x5f2e3a=a183_0x1cbbb2;return{'env':_0x14b72e['env']??null,'apiDir':_0x14b72e['apiDir']??null,'hasCookie':!!_0x14b72e[_0x5f2e3a(0x20d)],'hasAccessKey':!!_0x14b72e[_0x5f2e3a(0x214)],'format':_0x14b72e[_0x5f2e3a(0x1f3)]??null,'pageSize':_0x14b72e[_0x5f2e3a(0x203)]??null,'riskLevel':_0x14b72e[_0x5f2e3a(0x201)]??null,'locale':_0x14b72e['locale']??null};}export function buildAppDoctorFields(_0x24ad27,_0x2c0a01){const _0x4d2317=a183_0x1cbbb2;return{'env':{'value':_0x24ad27['env']||_0x2c0a01[_0x4d2317(0x20f)],'source':_0x24ad27['env']?_0x4d2317(0x1fd):_0x4d2317(0x1f5)},'apiDir':{'value':_0x24ad27[_0x4d2317(0x211)]||_0x2c0a01[_0x4d2317(0x211)],'source':_0x24ad27['apiDir']?_0x4d2317(0x1fd):_0x4d2317(0x1f5)},'cookie':{'value':_0x24ad27[_0x4d2317(0x20d)]||_0x2c0a01[_0x4d2317(0x20d)],'source':_0x24ad27[_0x4d2317(0x20d)]?_0x4d2317(0x1fd):_0x4d2317(0x1f5)},'accessKey':{'value':_0x24ad27['accessKey']||_0x2c0a01[_0x4d2317(0x214)],'source':_0x24ad27[_0x4d2317(0x214)]?_0x4d2317(0x1fd):_0x4d2317(0x1f5)}};}export function buildCanonicalAppConfig(_0x17f2a8,_0x5776ef){const _0x5e327d=a183_0x1cbbb2,_0x1ae078=_0x17f2a8[_0x5e327d(0x1f4)](_0x143182=>String(_0x143182||'')[_0x5e327d(0x1ff)]())[_0x5e327d(0x200)](Boolean);if(_0x1ae078[_0x5e327d(0x212)]===0x0)return{};const _0x5e9260={};for(const _0x8fce83 of _0x1ae078){_0x5e9260[_0x8fce83]=_0x5776ef?{'appcode':_0x8fce83,'env':_0x5776ef}:{'appcode':_0x8fce83};}return{'apps':_0x5e9260,'defaultApp':_0x1ae078[0x0]};}export function buildCanonicalProjectConfig(_0x4f9fee,_0x3fbc1e){const _0x38082d=a183_0x1cbbb2,{appCodes:appCodes=[],env:_0x329f97,metadata:_0x97a313}=_0x3fbc1e,_0x4efe91={..._0x4f9fee,..._0x97a313||{}};delete _0x4efe91['appcode'],delete _0x4efe91[_0x38082d(0x1fd)];if(_0x329f97)_0x4efe91[_0x38082d(0x20f)]=_0x329f97;else!_0x4efe91[_0x38082d(0x20f)]&&(_0x4efe91[_0x38082d(0x20f)]=DEFAULT_CONFIG_VALUES[_0x38082d(0x20f)]);const _0xcc81c5=buildCanonicalAppConfig(appCodes,_0x4efe91[_0x38082d(0x20f)]);return Object['keys'](_0xcc81c5)['length']>0x0&&(_0x4efe91['apps']=_0xcc81c5[_0x38082d(0x217)],_0x4efe91[_0x38082d(0x208)]=_0xcc81c5[_0x38082d(0x208)]),_0x4efe91;}function a183_0x1bb3(_0x447a81,_0x41d2da){_0x447a81=_0x447a81-0x1f0;const _0x7ebad8=a183_0x7eba();let _0x1bb3ad=_0x7ebad8[_0x447a81];return _0x1bb3ad;}const LOCALE_MAP={'zh':'zh-CN','zh-cn':a183_0x1cbbb2(0x20c),'zh_cn':a183_0x1cbbb2(0x20c),'en':a183_0x1cbbb2(0x1fa),'en-us':a183_0x1cbbb2(0x1fa),'en_us':'en-US'};export function normalizeLocale(_0x28d329){const _0x538c05=a183_0x1cbbb2;if(!_0x28d329)return null;return LOCALE_MAP[_0x28d329[_0x538c05(0x215)]()]??null;}
@@ -1 +1 @@
1
- function a184_0x5bdb(){const _0x2ef0ad=['13RqhPvT','367410qlGkuf','72jWtTCF','https://g.lovrabet.com/dist/rabetbase-cli/config/index.json','1026135iUKZRk','525160vpKTKM','197484HcpRwk','34048356CnCnXt','220ERAbue','3920795nrgzPk','4cGasVp','355822jTeSfI','18GfugZX','5vJKuRO'];a184_0x5bdb=function(){return _0x2ef0ad;};return a184_0x5bdb();}const a184_0xebdfaf=a184_0x47a8;(function(_0xd7f5d1,_0x28dc4b){const _0x300a51=a184_0x47a8,_0x557836=_0xd7f5d1();while(!![]){try{const _0x271b43=parseInt(_0x300a51(0x15d))/0x1*(parseInt(_0x300a51(0x15b))/0x2)+-parseInt(_0x300a51(0x151))/0x3+-parseInt(_0x300a51(0x15a))/0x4*(parseInt(_0x300a51(0x159))/0x5)+-parseInt(_0x300a51(0x15c))/0x6*(-parseInt(_0x300a51(0x156))/0x7)+-parseInt(_0x300a51(0x152))/0x8*(parseInt(_0x300a51(0x154))/0x9)+parseInt(_0x300a51(0x155))/0xa*(-parseInt(_0x300a51(0x158))/0xb)+parseInt(_0x300a51(0x157))/0xc*(parseInt(_0x300a51(0x150))/0xd);if(_0x271b43===_0x28dc4b)break;else _0x557836['push'](_0x557836['shift']());}catch(_0x3a12a0){_0x557836['push'](_0x557836['shift']());}}}(a184_0x5bdb,0xca436));function a184_0x47a8(_0x2ad877,_0x180d57){_0x2ad877=_0x2ad877-0x150;const _0x5bdb11=a184_0x5bdb();let _0x47a8a6=_0x5bdb11[_0x2ad877];return _0x47a8a6;}export const CLI_VERSION_POLICY_URL=a184_0xebdfaf(0x153);
1
+ const a184_0xeca7d2=a184_0x1e50;function a184_0x1e50(_0x2d8fb1,_0x1fe31b){_0x2d8fb1=_0x2d8fb1-0xc3;const _0x2cabe6=a184_0x2cab();let _0x1e5072=_0x2cabe6[_0x2d8fb1];return _0x1e5072;}(function(_0x3dd6cc,_0x6595fe){const _0xd4de7=a184_0x1e50,_0x290996=_0x3dd6cc();while(!![]){try{const _0x277662=parseInt(_0xd4de7(0xc7))/0x1+-parseInt(_0xd4de7(0xc3))/0x2+parseInt(_0xd4de7(0xcb))/0x3+-parseInt(_0xd4de7(0xc6))/0x4*(parseInt(_0xd4de7(0xc8))/0x5)+parseInt(_0xd4de7(0xc9))/0x6+parseInt(_0xd4de7(0xc4))/0x7+parseInt(_0xd4de7(0xc5))/0x8;if(_0x277662===_0x6595fe)break;else _0x290996['push'](_0x290996['shift']());}catch(_0x32d0aa){_0x290996['push'](_0x290996['shift']());}}}(a184_0x2cab,0x95126));export const CLI_VERSION_POLICY_URL=a184_0xeca7d2(0xca);function a184_0x2cab(){const _0x524cb1=['1495690xktpTd','2637460AFDfky','3134672CtOKGg','52oxXGHQ','593991wyeKYH','299900SIurob','3568428jMEsHf','https://g.lovrabet.com/dist/rabetbase-cli/config/index.json','542520BliwQq'];a184_0x2cab=function(){return _0x524cb1;};return a184_0x2cab();}