@lovrabet/rabetbase-cli 2.5.0-beta.3 → 2.5.0-beta.5

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 (303) hide show
  1. package/README.md +28 -0
  2. package/lib/api/api-doc.js +1 -1
  3. package/lib/api/fetch-model-list.js +1 -1
  4. package/lib/api/generate-api-file.js +1 -1
  5. package/lib/api/generate-sdk-config-file.js +1 -1
  6. package/lib/auth/auth-server-ui.js +1 -1
  7. package/lib/auth/auth-server.js +1 -1
  8. package/lib/auth/constant.js +1 -1
  9. package/lib/auth/get-cookie.js +1 -1
  10. package/lib/auth/get-session-user.js +1 -1
  11. package/lib/auth/is-session-valid.js +1 -1
  12. package/lib/auth/login-success-html.js +1 -1
  13. package/lib/auth/logout.js +1 -1
  14. package/lib/cli-flags.js +1 -1
  15. package/lib/cli.js +1 -1
  16. package/lib/commands/api/generate.js +1 -1
  17. package/lib/commands/api/index.js +1 -1
  18. package/lib/commands/api/list.js +1 -1
  19. package/lib/commands/api/pull.js +1 -1
  20. package/lib/commands/api/shared.js +1 -1
  21. package/lib/commands/app/index.js +1 -1
  22. package/lib/commands/app/list.js +1 -1
  23. package/lib/commands/app/members-list.js +1 -1
  24. package/lib/commands/app/remote-directory.js +1 -1
  25. package/lib/commands/app/shared.js +1 -1
  26. package/lib/commands/app-config/delete.js +1 -1
  27. package/lib/commands/app-config/get.js +1 -1
  28. package/lib/commands/app-config/index.js +1 -1
  29. package/lib/commands/app-config/list.js +1 -1
  30. package/lib/commands/app-config/set.js +1 -1
  31. package/lib/commands/app-config/shared.js +1 -1
  32. package/lib/commands/auth/index.js +1 -1
  33. package/lib/commands/bff/create.js +1 -1
  34. package/lib/commands/bff/delete.js +1 -1
  35. package/lib/commands/bff/detail.js +1 -1
  36. package/lib/commands/bff/index.js +1 -1
  37. package/lib/commands/bff/list.js +1 -1
  38. package/lib/commands/bff/pull.js +1 -1
  39. package/lib/commands/bff/push.js +1 -1
  40. package/lib/commands/bff/status.js +1 -1
  41. package/lib/commands/cli-skill/index.js +1 -1
  42. package/lib/commands/cli-update.js +1 -1
  43. package/lib/commands/codegen/index.js +1 -1
  44. package/lib/commands/codegen/sdk.js +1 -1
  45. package/lib/commands/codegen/sql.js +1 -1
  46. package/lib/commands/common/app-registry.js +1 -1
  47. package/lib/commands/common/app-selector.js +1 -1
  48. package/lib/commands/common/async-task.js +1 -1
  49. package/lib/commands/common/dry-run.js +1 -1
  50. package/lib/commands/common/flags.js +1 -1
  51. package/lib/commands/common/local-file.js +1 -1
  52. package/lib/commands/common/validate.js +1 -1
  53. package/lib/commands/config/delete.js +1 -1
  54. package/lib/commands/config/get.js +1 -1
  55. package/lib/commands/config/index.js +1 -1
  56. package/lib/commands/config/init.js +1 -1
  57. package/lib/commands/config/list.js +1 -1
  58. package/lib/commands/config/set.js +1 -1
  59. package/lib/commands/config/shared.js +1 -1
  60. package/lib/commands/dataset/business-group-update.js +1 -1
  61. package/lib/commands/dataset/business-groups.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-refresh-start.js +1 -1
  88. package/lib/commands/db/diff-refresh-status.js +1 -1
  89. package/lib/commands/db/diff.js +1 -1
  90. package/lib/commands/db/index.js +1 -1
  91. package/lib/commands/db/list.js +1 -1
  92. package/lib/commands/db/shared.js +1 -1
  93. package/lib/commands/db/table-diff-shared.d.ts +13 -0
  94. package/lib/commands/db/table-diff-shared.js +1 -0
  95. package/lib/commands/db/tables.js +1 -1
  96. package/lib/commands/db/test.js +1 -1
  97. package/lib/commands/db/update.js +1 -1
  98. package/lib/commands/doctor.js +1 -1
  99. package/lib/commands/file/index.js +1 -1
  100. package/lib/commands/issue/index.js +1 -1
  101. package/lib/commands/issue/nudge.js +1 -1
  102. package/lib/commands/issue/report.js +1 -1
  103. package/lib/commands/issue/shared.js +1 -1
  104. package/lib/commands/kb/create.js +1 -1
  105. package/lib/commands/kb/delete.js +1 -1
  106. package/lib/commands/kb/detail.js +1 -1
  107. package/lib/commands/kb/index.js +1 -1
  108. package/lib/commands/kb/list.js +1 -1
  109. package/lib/commands/kb/search.js +1 -1
  110. package/lib/commands/kb/shared.js +1 -1
  111. package/lib/commands/kb/update.js +1 -1
  112. package/lib/commands/logs/index.js +1 -1
  113. package/lib/commands/menu/asset-update.js +1 -1
  114. package/lib/commands/menu/delete.js +1 -1
  115. package/lib/commands/menu/external-link-create.js +1 -1
  116. package/lib/commands/menu/external-link-update.js +1 -1
  117. package/lib/commands/menu/group-create.js +1 -1
  118. package/lib/commands/menu/group-update.js +1 -1
  119. package/lib/commands/menu/index.js +1 -1
  120. package/lib/commands/menu/list.js +1 -1
  121. package/lib/commands/menu/move.js +1 -1
  122. package/lib/commands/menu/regroup-start.js +1 -1
  123. package/lib/commands/menu/rename.js +1 -1
  124. package/lib/commands/menu/shared/compare-table.js +1 -1
  125. package/lib/commands/menu/shared/delete-plan.js +1 -1
  126. package/lib/commands/menu/shared/facts.js +1 -1
  127. package/lib/commands/menu/shared/index.js +1 -1
  128. package/lib/commands/menu/shared/inquirer.js +1 -1
  129. package/lib/commands/menu/shared/local-pages.js +1 -1
  130. package/lib/commands/menu/shared/logic.js +1 -1
  131. package/lib/commands/menu/shared/mutations.js +1 -1
  132. package/lib/commands/menu/shared/service.js +1 -1
  133. package/lib/commands/menu/shared/sync-core.js +1 -1
  134. package/lib/commands/menu/shared/update-core.js +1 -1
  135. package/lib/commands/menu/shared/valid-url.js +1 -1
  136. package/lib/commands/menu/sync.js +1 -1
  137. package/lib/commands/menu/visibility-update.js +1 -1
  138. package/lib/commands/notification/config-create.js +1 -1
  139. package/lib/commands/notification/config-delete.js +1 -1
  140. package/lib/commands/notification/config-list.js +1 -1
  141. package/lib/commands/notification/config-update.js +1 -1
  142. package/lib/commands/notification/index.js +1 -1
  143. package/lib/commands/notification/shared.js +1 -1
  144. package/lib/commands/ocr/index.js +1 -1
  145. package/lib/commands/page/create.js +1 -1
  146. package/lib/commands/page/custom/detail.js +1 -1
  147. package/lib/commands/page/custom/list.js +1 -1
  148. package/lib/commands/page/custom/publish.js +1 -1
  149. package/lib/commands/page/custom/shared.js +1 -1
  150. package/lib/commands/page/custom/syntax.js +1 -1
  151. package/lib/commands/page/custom/template.js +1 -1
  152. package/lib/commands/page/custom/update.js +1 -1
  153. package/lib/commands/page/data-list-status.js +1 -1
  154. package/lib/commands/page/generate-start.js +1 -1
  155. package/lib/commands/page/generate-status.js +1 -1
  156. package/lib/commands/page/index.js +1 -1
  157. package/lib/commands/page/pull.js +1 -1
  158. package/lib/commands/page/push.js +1 -1
  159. package/lib/commands/page/relation-audit.js +1 -1
  160. package/lib/commands/page/restore.js +1 -1
  161. package/lib/commands/page/shared.js +1 -1
  162. package/lib/commands/page/sync.js +1 -1
  163. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  164. package/lib/commands/project/create/format-elapsed.js +1 -1
  165. package/lib/commands/project/create/main.js +1 -1
  166. package/lib/commands/project/create/materialize-project-template.js +1 -1
  167. package/lib/commands/project/create/project-name.js +1 -1
  168. package/lib/commands/project/create/project-template-archive.js +1 -1
  169. package/lib/commands/project/create/project-template-path.js +1 -1
  170. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  171. package/lib/commands/project/create/use-format-code.js +1 -1
  172. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  173. package/lib/commands/project/index.js +1 -1
  174. package/lib/commands/project/upgrade.js +1 -1
  175. package/lib/commands/registry.js +1 -1
  176. package/lib/commands/role/delete.js +1 -1
  177. package/lib/commands/role/detail.js +1 -1
  178. package/lib/commands/role/index.js +1 -1
  179. package/lib/commands/role/list.js +1 -1
  180. package/lib/commands/role/shared.js +1 -1
  181. package/lib/commands/role/update.js +1 -1
  182. package/lib/commands/role/user-add.js +1 -1
  183. package/lib/commands/role/user-remove.js +1 -1
  184. package/lib/commands/role/user-resolve.js +1 -1
  185. package/lib/commands/run/index.js +1 -1
  186. package/lib/commands/schema.js +1 -1
  187. package/lib/commands/sql/create.js +1 -1
  188. package/lib/commands/sql/delete.js +1 -1
  189. package/lib/commands/sql/detail.js +1 -1
  190. package/lib/commands/sql/exec.js +1 -1
  191. package/lib/commands/sql/index.js +1 -1
  192. package/lib/commands/sql/list.js +1 -1
  193. package/lib/commands/sql/pull.js +1 -1
  194. package/lib/commands/sql/push.js +1 -1
  195. package/lib/commands/sql/shared.js +1 -1
  196. package/lib/commands/sql/status.js +1 -1
  197. package/lib/commands/sql/validate.js +1 -1
  198. package/lib/commands/task/index.js +1 -1
  199. package/lib/commands/task/status.js +1 -1
  200. package/lib/commands/tenant/index.js +1 -1
  201. package/lib/commands/tenant/members-list.js +1 -1
  202. package/lib/commands/tenant/shared.js +1 -1
  203. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  204. package/lib/commands/user-account/index.js +1 -1
  205. package/lib/commands/workspace/add.js +1 -1
  206. package/lib/commands/workspace/index.js +1 -1
  207. package/lib/commands/workspace/remove.js +1 -1
  208. package/lib/config/domain-config.js +1 -1
  209. package/lib/config/schema.js +1 -1
  210. package/lib/constant/cdn.js +1 -1
  211. package/lib/constant/cli.js +1 -1
  212. package/lib/constant/defaults.js +1 -1
  213. package/lib/constant/domain.js +1 -1
  214. package/lib/constant/env.js +1 -1
  215. package/lib/constant/output.js +1 -1
  216. package/lib/constant/paths.js +1 -1
  217. package/lib/constant/region.js +1 -1
  218. package/lib/constant/risk.js +1 -1
  219. package/lib/context/app-resolver.js +1 -1
  220. package/lib/context/auth-resolver.js +1 -1
  221. package/lib/context/config-loader.js +1 -1
  222. package/lib/context.js +1 -1
  223. package/lib/core/alias-resolver.js +1 -1
  224. package/lib/core/api-client.d.ts +1 -7
  225. package/lib/core/api-client.js +1 -1
  226. package/lib/core/bff/config.js +1 -1
  227. package/lib/core/bff/file-system.js +1 -1
  228. package/lib/core/bff/hash.js +1 -1
  229. package/lib/core/bff/lock.js +1 -1
  230. package/lib/core/bff/utils.js +1 -1
  231. package/lib/core/db-resolver.js +1 -1
  232. package/lib/core/page/file-system.js +1 -1
  233. package/lib/core/page/hash.js +1 -1
  234. package/lib/core/page/lock.js +1 -1
  235. package/lib/core/sql-index-auditor.js +1 -1
  236. package/lib/core/sql-sync/config.js +1 -1
  237. package/lib/core/sql-sync/file-system.js +1 -1
  238. package/lib/core/sql-sync/hash.js +1 -1
  239. package/lib/core/sql-sync/lock.js +1 -1
  240. package/lib/core/sql-sync/utils.js +1 -1
  241. package/lib/core/sql-validator.js +1 -1
  242. package/lib/errors.js +1 -1
  243. package/lib/framework/build-all-flags.js +1 -1
  244. package/lib/framework/error-output.js +1 -1
  245. package/lib/framework/explicit-yes.js +1 -1
  246. package/lib/framework/flags.js +1 -1
  247. package/lib/framework/help.js +1 -1
  248. package/lib/framework/index.js +1 -1
  249. package/lib/framework/output.js +1 -1
  250. package/lib/framework/response.js +1 -1
  251. package/lib/framework/runner-alias.js +1 -1
  252. package/lib/framework/runner.js +1 -1
  253. package/lib/framework/schema-export.js +1 -1
  254. package/lib/framework/types.js +1 -1
  255. package/lib/generated/build-info.d.ts +4 -4
  256. package/lib/generated/build-info.js +1 -1
  257. package/lib/help.js +1 -1
  258. package/lib/postinstall.js +1 -1
  259. package/lib/runtime/confirmation.js +1 -1
  260. package/lib/runtime/event.js +1 -1
  261. package/lib/runtime/index.js +1 -1
  262. package/lib/runtime/queue.js +1 -1
  263. package/lib/runtime/resolve.js +1 -1
  264. package/lib/skills/builtin-skill.js +1 -1
  265. package/lib/skills/main.js +1 -1
  266. package/lib/skills/npx-skills-add.js +1 -1
  267. package/lib/skills/skill-presence.js +1 -1
  268. package/lib/telemetry/cli-command-trace.js +1 -1
  269. package/lib/telemetry/cli-help-trace.js +1 -1
  270. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  271. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  272. package/lib/telemetry/send-cli-trace-log.js +1 -1
  273. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  274. package/lib/utils/ai_config.js +1 -1
  275. package/lib/utils/apply-jq-filter.js +1 -1
  276. package/lib/utils/cdn-config.js +1 -1
  277. package/lib/utils/check-sdk-version.js +1 -1
  278. package/lib/utils/cli-version-check.js +1 -1
  279. package/lib/utils/cli-version-policy.js +1 -1
  280. package/lib/utils/config.js +1 -1
  281. package/lib/utils/entity-with-id.js +1 -1
  282. package/lib/utils/file-utils.js +1 -1
  283. package/lib/utils/guides-cdn.js +1 -1
  284. package/lib/utils/http-client.js +1 -1
  285. package/lib/utils/is-non-interactive.js +1 -1
  286. package/lib/utils/logger.js +1 -1
  287. package/lib/utils/params.js +1 -1
  288. package/lib/utils/platform.js +1 -1
  289. package/lib/utils/sleep.js +1 -1
  290. package/lib/utils/template-replacer.js +1 -1
  291. package/lib/utils/update-notice.js +1 -1
  292. package/lib/utils/version.js +1 -1
  293. package/lib/utils/with-active-cookie.js +1 -1
  294. package/lib/utils/write-cli-side-channel.js +1 -1
  295. package/package.json +1 -1
  296. package/skills/rabetbase/SKILL.md +6 -6
  297. package/skills/rabetbase/guides/database-connection-workflow.md +9 -9
  298. package/skills/rabetbase/references/rabetbase-config.md +2 -3
  299. package/skills/rabetbase/references/rabetbase-db-analyze.md +2 -2
  300. package/skills/rabetbase/references/rabetbase-db-diff-refresh.md +4 -3
  301. package/skills/rabetbase/references/rabetbase-db-diff.md +7 -22
  302. package/skills/rabetbase/references/rabetbase-db-tables.md +14 -2
  303. package/skills/rabetbase.manifest.json +3 -3
@@ -1 +1 @@
1
- const a190_0x2e499d=a190_0x7364;(function(_0x223586,_0x3e41ee){const _0x59b4e1=a190_0x7364,_0x4f1332=_0x223586();while(!![]){try{const _0x316092=parseInt(_0x59b4e1(0x1eb))/0x1*(-parseInt(_0x59b4e1(0x1f1))/0x2)+-parseInt(_0x59b4e1(0x1f2))/0x3+parseInt(_0x59b4e1(0x1ce))/0x4*(-parseInt(_0x59b4e1(0x1c6))/0x5)+-parseInt(_0x59b4e1(0x1d1))/0x6*(-parseInt(_0x59b4e1(0x1b7))/0x7)+-parseInt(_0x59b4e1(0x1c8))/0x8*(-parseInt(_0x59b4e1(0x1bc))/0x9)+-parseInt(_0x59b4e1(0x1e6))/0xa+parseInt(_0x59b4e1(0x1e4))/0xb;if(_0x316092===_0x3e41ee)break;else _0x4f1332['push'](_0x4f1332['shift']());}catch(_0x528ba8){_0x4f1332['push'](_0x4f1332['shift']());}}}(a190_0x10d0,0x706e9));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(_0x17e51d,_0x40a66c){const _0x4091ec=a190_0x7364,_0x4fe4a1=[];let _0x82c8f2=0x1;while(!![]){const _0x5a69a0=await listSqlQueries(_0x17e51d,{'currentPage':_0x82c8f2,'pageSize':PAGE_SIZE,'sqlCode':_0x40a66c[_0x4091ec(0x1f4)],'sqlName':_0x40a66c['sqlName']}),_0x1a3923=_0x5a69a0[_0x4091ec(0x1c0)]??[];_0x4fe4a1[_0x4091ec(0x1b6)](..._0x1a3923);if(_0x1a3923['length']===0x0)break;const _0x462d7d=_0x5a69a0[_0x4091ec(0x1ea)]?.['totalCount'];if(_0x462d7d!=null?_0x4fe4a1['length']>=_0x462d7d:_0x1a3923[_0x4091ec(0x1e7)]<PAGE_SIZE)break;_0x82c8f2++;}return _0x4fe4a1;}function a190_0x10d0(){const _0x470466=['sqlcode','415IzsJYn','Force\x20overwrite\x20local\x20unsynced\x20changes','13992YTgKrb','description','catch','name','force','\x20skipped,\x20','13052yNdcEz','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','appCode','1858206NBJSml','str','\x20failed','lastSync','string','unchanged','POST','Pull\x20complete:\x20','read','sqls','apps','dbId','bool','filter','lockFilePath','pull','path','split','Force\x20pull\x20cancelled.','19890948qxlSzX','join','5998400kfyxAS','length','sql','trimStart','paging','2nZpgwV','sqlName','cancelled','nonInteractive','sqlContent','test','736018CIFdTs','2739054yuLvyI','toISOString','sqlCode','mybatisXml','local\x20differs\x20from\x20remote','push','7lVVHPF','skipped','\x20SQL\x20file(s)\x20into\x20','sqlRoot','message','4437EOklGd','sqlRootDir','utf8','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','tableData','conflict','would_pull','Filter\x20by\x20SQL\x20display\x20name','Would\x20pull\x20'];a190_0x10d0=function(){return _0x470466;};return a190_0x10d0();}function a190_0x7364(_0x102c98,_0x1425fa){_0x102c98=_0x102c98-0x1b6;const _0x10d00c=a190_0x10d0();let _0x73641c=_0x10d00c[_0x102c98];return _0x73641c;}async function ensureSqlContent(_0x477bd8){const _0x4130b1=a190_0x7364;if(_0x477bd8[_0x4130b1(0x1ef)]!=null&&String(_0x477bd8[_0x4130b1(0x1ef)])['length']>0x0)return _0x477bd8;return getSqlQueryDetail(_0x477bd8[_0x4130b1(0x1f4)]);}export const sqlPull={'service':a190_0x2e499d(0x1e8),'command':a190_0x2e499d(0x1e0),'description':a190_0x2e499d(0x1bf),'risk':a190_0x2e499d(0x1d9),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':'name','type':a190_0x2e499d(0x1d5),'description':a190_0x2e499d(0x1c3)},{'name':a190_0x2e499d(0x1cc),'type':'boolean','description':a190_0x2e499d(0x1c7)}],async 'dryRun'(_0x1de47a){const _0x313b56=a190_0x2e499d,_0x3a8fb0=loadSqlProjectConfig(_0x1de47a[_0x313b56(0x1d0)]),_0x55b76d=await readSqlLockFile(_0x3a8fb0[_0x313b56(0x1df)]),{appLock:_0x177816}=ensureSqlLockScope(_0x55b76d??createEmptySqlLock(),_0x3a8fb0[_0x313b56(0x1d0)],_0x3a8fb0[_0x313b56(0x1ba)],'pull'),_0x80965a=await fetchAllSqlQueries(_0x1de47a[_0x313b56(0x1d0)],{'sqlCode':_0x1de47a[_0x313b56(0x1d2)](_0x313b56(0x1c5))||undefined,'sqlName':_0x1de47a[_0x313b56(0x1d2)](_0x313b56(0x1cb))||undefined}),_0x45fcfa=[];for(const _0x553d1a of _0x80965a){const _0x284e14=await ensureSqlContent(_0x553d1a),_0x591baa=ensureRemoteSqlContent(_0x284e14),_0x12ba71=detectModeFromSql(_0x284e14),_0x5db8eb=_0x284e14[_0x313b56(0x1dc)]?await getDbName(_0x1de47a['appCode'],Number(_0x284e14[_0x313b56(0x1dc)]))[_0x313b56(0x1ca)](()=>undefined):undefined,_0x5cc3c3=buildLocalSqlFileContent({'sqlCode':_0x284e14[_0x313b56(0x1f4)],'sqlName':_0x284e14[_0x313b56(0x1ec)],'dbId':_0x284e14[_0x313b56(0x1dc)]},_0x591baa,{'dbName':_0x5db8eb,'mode':_0x12ba71,'syncedAt':new Date()[_0x313b56(0x1f3)](),'description':_0x284e14[_0x313b56(0x1c9)]}),_0x18b470=buildSqlLockEntry(_0x284e14,_0x591baa,'',{'dbName':_0x5db8eb}),_0x31920f=resolveLocalSqlFilePath(_0x3a8fb0,_0x284e14[_0x313b56(0x1f4)],_0x18b470);let _0x1020d8=_0x313b56(0x1c2),_0x36a537;if(await fileExists(_0x31920f)){const _0xa2ab2=await readFile(_0x31920f,_0x313b56(0x1be));isEquivalentPulledSqlFile(_0xa2ab2,_0x5cc3c3,_0x12ba71)?(_0x1020d8=_0x313b56(0x1b8),_0x36a537=_0x313b56(0x1d6)):(_0x1020d8=_0x313b56(0x1c1),_0x36a537=_0x313b56(0x1cf));}_0x45fcfa[_0x313b56(0x1b6)]({'sqlCode':_0x284e14[_0x313b56(0x1f4)],'sqlName':_0x284e14[_0x313b56(0x1ec)],'filePath':_0x31920f,'status':_0x1020d8,'reason':_0x36a537});}return{'method':_0x313b56(0x1d7),'url':'/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','body':{'appCode':_0x1de47a[_0x313b56(0x1d0)],'sqlCode':_0x1de47a['str'](_0x313b56(0x1c5))||null,'sqlName':_0x1de47a[_0x313b56(0x1d2)](_0x313b56(0x1cb))||null,'files':_0x45fcfa},'description':_0x313b56(0x1c4)+_0x45fcfa[_0x313b56(0x1e7)]+_0x313b56(0x1b9)+_0x3a8fb0[_0x313b56(0x1bd)]};},async 'execute'(_0x155b4c){const _0x2638d0=a190_0x2e499d,_0xc451ff=loadSqlProjectConfig(_0x155b4c['appCode']),_0x88789=await readSqlLockFile(_0xc451ff[_0x2638d0(0x1df)]),{lockData:_0xf8cde,appLock:_0x299589}=ensureSqlLockScope(_0x88789??createEmptySqlLock(),_0xc451ff[_0x2638d0(0x1d0)],_0xc451ff[_0x2638d0(0x1ba)],_0x2638d0(0x1e0)),_0x33bd33=_0x155b4c[_0x2638d0(0x1dd)](_0x2638d0(0x1cc)),_0xbc0434=await fetchAllSqlQueries(_0x155b4c[_0x2638d0(0x1d0)],{'sqlCode':_0x155b4c[_0x2638d0(0x1d2)]('sqlcode')||undefined,'sqlName':_0x155b4c[_0x2638d0(0x1d2)](_0x2638d0(0x1cb))||undefined});if(_0xbc0434[_0x2638d0(0x1e7)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':'No\x20remote\x20SQL\x20queries\x20matched.'};const _0x416824=[],_0x4cbb1b=[];for(const _0x404c7d of _0xbc0434){try{_0x416824[_0x2638d0(0x1b6)](await ensureSqlContent(_0x404c7d));}catch(_0x1ca4f5){_0x4cbb1b[_0x2638d0(0x1b6)]({'sqlCode':_0x404c7d[_0x2638d0(0x1f4)],'error':_0x1ca4f5 instanceof Error?_0x1ca4f5['message']:String(_0x1ca4f5)});}}if(_0x33bd33&&!_0x155b4c[_0x2638d0(0x1ee)]){let _0x53566f=![];for(const _0x47b572 of _0x416824){const _0x58d63f=detectModeFromSql(_0x47b572),_0x4749ea=_0x47b572[_0x2638d0(0x1dc)]?await getDbName(_0x155b4c[_0x2638d0(0x1d0)],Number(_0x47b572['dbId']))[_0x2638d0(0x1ca)](()=>undefined):undefined,_0x5ea44d=buildLocalSqlFileContent({'sqlCode':_0x47b572[_0x2638d0(0x1f4)],'sqlName':_0x47b572[_0x2638d0(0x1ec)],'dbId':_0x47b572[_0x2638d0(0x1dc)]},ensureRemoteSqlContent(_0x47b572),{'dbName':_0x4749ea,'mode':_0x58d63f,'syncedAt':new Date()[_0x2638d0(0x1f3)](),'description':_0x47b572[_0x2638d0(0x1c9)]}),_0x164507=resolveLocalSqlFilePath(_0xc451ff,_0x47b572[_0x2638d0(0x1f4)],buildSqlLockEntry(_0x47b572,ensureRemoteSqlContent(_0x47b572),'',{'dbName':_0x4749ea}));if(await fileExists(_0x164507)){const _0x40a0a4=await readFile(_0x164507,_0x2638d0(0x1be));if(!isEquivalentPulledSqlFile(_0x40a0a4,_0x5ea44d,_0x58d63f)){_0x53566f=!![];break;}}}if(_0x53566f){const _0x2b1a6b=await confirmForceOverwrite('Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.');if(!_0x2b1a6b)throw CliErrors[_0x2638d0(0x1ed)](_0x2638d0(0x1e3));}}const _0x3a470f=cloneSqlLockData(_0xf8cde),_0x1fc603=_0x3a470f[_0x2638d0(0x1db)][_0xc451ff[_0x2638d0(0x1d0)]],_0xd65312=[],_0x815524=[];for(const _0x51e151 of _0x416824){const _0x1032dc=_0x1fc603[_0x2638d0(0x1da)][_0x51e151[_0x2638d0(0x1f4)]],_0x63f7b0=ensureRemoteSqlContent(_0x51e151),_0xe40d8a=detectModeFromSql(_0x51e151),_0x1731a6=_0x51e151[_0x2638d0(0x1dc)]?await getDbName(_0x155b4c['appCode'],Number(_0x51e151[_0x2638d0(0x1dc)]))[_0x2638d0(0x1ca)](()=>undefined):undefined,_0xc05393=buildLocalSqlFileContent({'sqlCode':_0x51e151[_0x2638d0(0x1f4)],'sqlName':_0x51e151['sqlName'],'dbId':_0x51e151['dbId']},_0x63f7b0,{'dbName':_0x1731a6,'mode':_0xe40d8a,'syncedAt':new Date()['toISOString'](),'description':_0x51e151[_0x2638d0(0x1c9)]}),_0xdaa5eb=buildSqlLockEntry(_0x51e151,_0x63f7b0,computeSqlContentHash(_0xc05393),{'dbName':_0x1731a6}),_0x38dc17=_0xdaa5eb['path'],_0xe34eec=join(_0xc451ff['sqlRootDir'],_0x38dc17);try{if(await fileExists(_0xe34eec)){const _0x3380ec=await readFile(_0xe34eec,'utf8');if(isEquivalentPulledSqlFile(_0x3380ec,_0xc05393,_0xe40d8a)){_0x815524[_0x2638d0(0x1b6)]({'sqlCode':_0x51e151[_0x2638d0(0x1f4)],'reason':'unchanged'}),_0x1fc603['sqls'][_0x51e151[_0x2638d0(0x1f4)]]={..._0xdaa5eb,'hash':computeSqlContentHash(_0x3380ec),'path':_0x38dc17};continue;}if(!_0x33bd33){_0x815524[_0x2638d0(0x1b6)]({'sqlCode':_0x51e151[_0x2638d0(0x1f4)],'reason':_0x2638d0(0x1f6)});continue;}}const _0x259194=_0x1032dc?.[_0x2638d0(0x1e1)]?join(_0xc451ff[_0x2638d0(0x1bd)],_0x1032dc[_0x2638d0(0x1e1)]):undefined;_0x259194&&_0x259194!==_0xe34eec&&await fileExists(_0x259194)&&await rm(_0x259194,{'force':!![]}),await ensureParentDirectory(_0xe34eec),await writeFile(_0xe34eec,_0xc05393,_0x2638d0(0x1be)),_0x1fc603['sqls'][_0x51e151[_0x2638d0(0x1f4)]]={..._0xdaa5eb,'path':_0x38dc17},_0xd65312[_0x2638d0(0x1b6)]({'sqlCode':_0x51e151[_0x2638d0(0x1f4)],'filePath':_0xe34eec});}catch(_0x12b253){_0x4cbb1b[_0x2638d0(0x1b6)]({'sqlCode':_0x51e151[_0x2638d0(0x1f4)],'error':_0x12b253 instanceof Error?_0x12b253[_0x2638d0(0x1bb)]:String(_0x12b253)});}}return _0x1fc603[_0x2638d0(0x1d4)]=new Date()[_0x2638d0(0x1f3)](),await writeSqlLockFile(_0xc451ff[_0x2638d0(0x1df)],_0x3a470f),{'ok':_0x4cbb1b[_0x2638d0(0x1e7)]===0x0,'data':{'pulled':_0xd65312,'skipped':_0x815524,'failed':_0x4cbb1b},'message':_0x2638d0(0x1d8)+_0xd65312[_0x2638d0(0x1e7)]+'\x20written,\x20'+_0x815524[_0x2638d0(0x1e7)]+_0x2638d0(0x1cd)+_0x4cbb1b[_0x2638d0(0x1e7)]+_0x2638d0(0x1d3)};}};function detectModeFromSql(_0x39c6a6){const _0x22ba1d=a190_0x2e499d,_0x1723c5=ensureRemoteSqlContent(_0x39c6a6),_0x3fbc9d=stripLocalSqlMetadata(_0x1723c5,_0x22ba1d(0x1f5))[_0x22ba1d(0x1e9)]();if(/^<(select|insert|update|delete)\b/i[_0x22ba1d(0x1f0)](_0x3fbc9d))return _0x22ba1d(0x1f5);return _0x22ba1d(0x1e8);}function isEquivalentPulledSqlFile(_0x1e3ba3,_0x4f0d0f,_0x453832){return normalizePullComparableContent(_0x1e3ba3,_0x453832)===normalizePullComparableContent(_0x4f0d0f,_0x453832);}function normalizePullComparableContent(_0xb69160,_0x4a9e83){const _0x49fc2f=a190_0x2e499d,_0x43b858=_0xb69160['replace'](/\r\n/g,'\x0a')[_0x49fc2f(0x1e2)]('\x0a'),_0x23ea9f=_0x43b858[_0x49fc2f(0x1de)](_0xa06901=>!isSyncedAtMetadataLine(_0xa06901,_0x4a9e83));return _0x23ea9f[_0x49fc2f(0x1e5)]('\x0a');}function isSyncedAtMetadataLine(_0x5da558,_0x527d17){const _0x15ae91=a190_0x2e499d;if(_0x527d17===_0x15ae91(0x1f5))return/^\s*<!--\s*@lovrabet\.syncedAt:/['test'](_0x5da558);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x15ae91(0x1f0)](_0x5da558);}
1
+ const a191_0x16900d=a191_0x1647;(function(_0x4714cb,_0x297929){const _0x625372=a191_0x1647,_0x301b2e=_0x4714cb();while(!![]){try{const _0x3c14e2=parseInt(_0x625372(0x147))/0x1*(-parseInt(_0x625372(0x13a))/0x2)+parseInt(_0x625372(0x139))/0x3+parseInt(_0x625372(0x145))/0x4*(-parseInt(_0x625372(0x13b))/0x5)+-parseInt(_0x625372(0x14a))/0x6+-parseInt(_0x625372(0x16c))/0x7+-parseInt(_0x625372(0x142))/0x8+parseInt(_0x625372(0x146))/0x9;if(_0x3c14e2===_0x297929)break;else _0x301b2e['push'](_0x301b2e['shift']());}catch(_0x17f9c9){_0x301b2e['push'](_0x301b2e['shift']());}}}(a191_0x57ab,0x33566));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';function a191_0x57ab(){const _0x33846c=['split','apps','sqlContent','sqls','join','path','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','catch','No\x20remote\x20SQL\x20queries\x20matched.','name','Pull\x20complete:\x20','\x20SQL\x20file(s)\x20into\x20','length','sqlRoot','local\x20differs\x20from\x20remote','\x20skipped,\x20','470155bWyyMb','sqlRootDir','utf8','lockFilePath','skipped','845481KtuoKK','644230SHbKvT','67415iuYWSj','sql','sqlcode','unchanged','test','pull','dbId','1704584lhHELx','nonInteractive','cancelled','24Rinisz','6308127pQvFUg','1rIvNLG','force','sqlCode','535206xDtavk','\x20written,\x20','sqlName','read','toISOString','trimStart','Would\x20pull\x20','mybatisXml','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','push','lastSync','replace','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','\x20failed','str','description','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','appCode'];a191_0x57ab=function(){return _0x33846c;};return a191_0x57ab();}import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildLocalSqlFileContent,buildSqlLockEntry,cloneSqlLockData,confirmForceOverwrite,ensureRemoteSqlContent,stripLocalSqlMetadata}from'./shared.js';const PAGE_SIZE=0x64;function a191_0x1647(_0x127087,_0x528f46){_0x127087=_0x127087-0x139;const _0x57abc5=a191_0x57ab();let _0x16479b=_0x57abc5[_0x127087];return _0x16479b;}async function fetchAllSqlQueries(_0x47f226,_0xd4d4){const _0x172bc4=a191_0x1647,_0x19b515=[];let _0x3f3f85=0x1;while(!![]){const _0x922679=await listSqlQueries(_0x47f226,{'currentPage':_0x3f3f85,'pageSize':PAGE_SIZE,'sqlCode':_0xd4d4[_0x172bc4(0x149)],'sqlName':_0xd4d4[_0x172bc4(0x14c)]}),_0x100847=_0x922679['tableData']??[];_0x19b515[_0x172bc4(0x153)](..._0x100847);if(_0x100847[_0x172bc4(0x168)]===0x0)break;const _0x247794=_0x922679['paging']?.['totalCount'];if(_0x247794!=null?_0x19b515[_0x172bc4(0x168)]>=_0x247794:_0x100847[_0x172bc4(0x168)]<PAGE_SIZE)break;_0x3f3f85++;}return _0x19b515;}async function ensureSqlContent(_0x14c299){const _0x124e43=a191_0x1647;if(_0x14c299['sqlContent']!=null&&String(_0x14c299[_0x124e43(0x15e)])['length']>0x0)return _0x14c299;return getSqlQueryDetail(_0x14c299[_0x124e43(0x149)]);}export const sqlPull={'service':a191_0x16900d(0x13c),'command':'pull','description':a191_0x16900d(0x152),'risk':a191_0x16900d(0x14d),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a191_0x16900d(0x165),'type':'string','description':'Filter\x20by\x20SQL\x20display\x20name'},{'name':a191_0x16900d(0x148),'type':'boolean','description':'Force\x20overwrite\x20local\x20unsynced\x20changes'}],async 'dryRun'(_0x54485d){const _0x4356e7=a191_0x16900d,_0x5893a8=loadSqlProjectConfig(_0x54485d['appCode']),_0x11063a=await readSqlLockFile(_0x5893a8['lockFilePath']),{appLock:_0x5e3f0b}=ensureSqlLockScope(_0x11063a??createEmptySqlLock(),_0x5893a8['appCode'],_0x5893a8[_0x4356e7(0x169)],_0x4356e7(0x140)),_0x552031=await fetchAllSqlQueries(_0x54485d[_0x4356e7(0x15b)],{'sqlCode':_0x54485d[_0x4356e7(0x158)](_0x4356e7(0x13d))||undefined,'sqlName':_0x54485d[_0x4356e7(0x158)](_0x4356e7(0x165))||undefined}),_0x2a0638=[];for(const _0x1d81fe of _0x552031){const _0x3a5784=await ensureSqlContent(_0x1d81fe),_0x11816a=ensureRemoteSqlContent(_0x3a5784),_0x68b56c=detectModeFromSql(_0x3a5784),_0x5d0bd1=_0x3a5784['dbId']?await getDbName(_0x54485d[_0x4356e7(0x15b)],Number(_0x3a5784[_0x4356e7(0x141)]))[_0x4356e7(0x163)](()=>undefined):undefined,_0x78ae3d=buildLocalSqlFileContent({'sqlCode':_0x3a5784['sqlCode'],'sqlName':_0x3a5784[_0x4356e7(0x14c)],'dbId':_0x3a5784[_0x4356e7(0x141)]},_0x11816a,{'dbName':_0x5d0bd1,'mode':_0x68b56c,'syncedAt':new Date()[_0x4356e7(0x14e)](),'description':_0x3a5784[_0x4356e7(0x159)]}),_0x28d3f9=buildSqlLockEntry(_0x3a5784,_0x11816a,'',{'dbName':_0x5d0bd1}),_0x2c5828=resolveLocalSqlFilePath(_0x5893a8,_0x3a5784[_0x4356e7(0x149)],_0x28d3f9);let _0xce1d08='would_pull',_0xaa1e0a;if(await fileExists(_0x2c5828)){const _0x1de376=await readFile(_0x2c5828,_0x4356e7(0x16e));isEquivalentPulledSqlFile(_0x1de376,_0x78ae3d,_0x68b56c)?(_0xce1d08=_0x4356e7(0x170),_0xaa1e0a=_0x4356e7(0x13e)):(_0xce1d08='conflict',_0xaa1e0a=_0x4356e7(0x15a));}_0x2a0638[_0x4356e7(0x153)]({'sqlCode':_0x3a5784[_0x4356e7(0x149)],'sqlName':_0x3a5784[_0x4356e7(0x14c)],'filePath':_0x2c5828,'status':_0xce1d08,'reason':_0xaa1e0a});}return{'method':'POST','url':_0x4356e7(0x156),'body':{'appCode':_0x54485d[_0x4356e7(0x15b)],'sqlCode':_0x54485d[_0x4356e7(0x158)]('sqlcode')||null,'sqlName':_0x54485d[_0x4356e7(0x158)](_0x4356e7(0x165))||null,'files':_0x2a0638},'description':_0x4356e7(0x150)+_0x2a0638[_0x4356e7(0x168)]+_0x4356e7(0x167)+_0x5893a8['sqlRootDir']};},async 'execute'(_0x1bbc8a){const _0x4d6a21=a191_0x16900d,_0xce1401=loadSqlProjectConfig(_0x1bbc8a[_0x4d6a21(0x15b)]),_0x186fdc=await readSqlLockFile(_0xce1401[_0x4d6a21(0x16f)]),{lockData:_0x47ed9d,appLock:_0x40974c}=ensureSqlLockScope(_0x186fdc??createEmptySqlLock(),_0xce1401[_0x4d6a21(0x15b)],_0xce1401['sqlRoot'],_0x4d6a21(0x140)),_0x2363c=_0x1bbc8a['bool'](_0x4d6a21(0x148)),_0x3179eb=await fetchAllSqlQueries(_0x1bbc8a[_0x4d6a21(0x15b)],{'sqlCode':_0x1bbc8a['str'](_0x4d6a21(0x13d))||undefined,'sqlName':_0x1bbc8a['str']('name')||undefined});if(_0x3179eb[_0x4d6a21(0x168)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x4d6a21(0x164)};const _0x3275e9=[],_0xea552e=[];for(const _0x5dbf55 of _0x3179eb){try{_0x3275e9[_0x4d6a21(0x153)](await ensureSqlContent(_0x5dbf55));}catch(_0x35e31b){_0xea552e['push']({'sqlCode':_0x5dbf55[_0x4d6a21(0x149)],'error':_0x35e31b instanceof Error?_0x35e31b['message']:String(_0x35e31b)});}}if(_0x2363c&&!_0x1bbc8a[_0x4d6a21(0x143)]){let _0x5711a5=![];for(const _0x5dd278 of _0x3275e9){const _0x324b71=detectModeFromSql(_0x5dd278),_0x2e5c02=_0x5dd278[_0x4d6a21(0x141)]?await getDbName(_0x1bbc8a[_0x4d6a21(0x15b)],Number(_0x5dd278[_0x4d6a21(0x141)]))[_0x4d6a21(0x163)](()=>undefined):undefined,_0x166ff1=buildLocalSqlFileContent({'sqlCode':_0x5dd278[_0x4d6a21(0x149)],'sqlName':_0x5dd278[_0x4d6a21(0x14c)],'dbId':_0x5dd278[_0x4d6a21(0x141)]},ensureRemoteSqlContent(_0x5dd278),{'dbName':_0x2e5c02,'mode':_0x324b71,'syncedAt':new Date()['toISOString'](),'description':_0x5dd278[_0x4d6a21(0x159)]}),_0x56a4ed=resolveLocalSqlFilePath(_0xce1401,_0x5dd278['sqlCode'],buildSqlLockEntry(_0x5dd278,ensureRemoteSqlContent(_0x5dd278),'',{'dbName':_0x2e5c02}));if(await fileExists(_0x56a4ed)){const _0x4515d0=await readFile(_0x56a4ed,_0x4d6a21(0x16e));if(!isEquivalentPulledSqlFile(_0x4515d0,_0x166ff1,_0x324b71)){_0x5711a5=!![];break;}}}if(_0x5711a5){const _0x157545=await confirmForceOverwrite(_0x4d6a21(0x162));if(!_0x157545)throw CliErrors[_0x4d6a21(0x144)]('Force\x20pull\x20cancelled.');}}const _0x1f3caa=cloneSqlLockData(_0x47ed9d),_0x5a22b7=_0x1f3caa[_0x4d6a21(0x15d)][_0xce1401[_0x4d6a21(0x15b)]],_0x1be0e5=[],_0x48c8a3=[];for(const _0x2b2deb of _0x3275e9){const _0x2167dc=_0x5a22b7['sqls'][_0x2b2deb[_0x4d6a21(0x149)]],_0x633535=ensureRemoteSqlContent(_0x2b2deb),_0x5bae6f=detectModeFromSql(_0x2b2deb),_0x5753c5=_0x2b2deb[_0x4d6a21(0x141)]?await getDbName(_0x1bbc8a[_0x4d6a21(0x15b)],Number(_0x2b2deb['dbId']))[_0x4d6a21(0x163)](()=>undefined):undefined,_0x25790d=buildLocalSqlFileContent({'sqlCode':_0x2b2deb['sqlCode'],'sqlName':_0x2b2deb['sqlName'],'dbId':_0x2b2deb[_0x4d6a21(0x141)]},_0x633535,{'dbName':_0x5753c5,'mode':_0x5bae6f,'syncedAt':new Date()['toISOString'](),'description':_0x2b2deb[_0x4d6a21(0x159)]}),_0x1390a3=buildSqlLockEntry(_0x2b2deb,_0x633535,computeSqlContentHash(_0x25790d),{'dbName':_0x5753c5}),_0x168f39=_0x1390a3['path'],_0x4b18ad=join(_0xce1401['sqlRootDir'],_0x168f39);try{if(await fileExists(_0x4b18ad)){const _0x3ef75d=await readFile(_0x4b18ad,_0x4d6a21(0x16e));if(isEquivalentPulledSqlFile(_0x3ef75d,_0x25790d,_0x5bae6f)){_0x48c8a3[_0x4d6a21(0x153)]({'sqlCode':_0x2b2deb[_0x4d6a21(0x149)],'reason':'unchanged'}),_0x5a22b7[_0x4d6a21(0x15f)][_0x2b2deb['sqlCode']]={..._0x1390a3,'hash':computeSqlContentHash(_0x3ef75d),'path':_0x168f39};continue;}if(!_0x2363c){_0x48c8a3['push']({'sqlCode':_0x2b2deb[_0x4d6a21(0x149)],'reason':_0x4d6a21(0x16a)});continue;}}const _0x32b74d=_0x2167dc?.['path']?join(_0xce1401[_0x4d6a21(0x16d)],_0x2167dc[_0x4d6a21(0x161)]):undefined;_0x32b74d&&_0x32b74d!==_0x4b18ad&&await fileExists(_0x32b74d)&&await rm(_0x32b74d,{'force':!![]}),await ensureParentDirectory(_0x4b18ad),await writeFile(_0x4b18ad,_0x25790d,_0x4d6a21(0x16e)),_0x5a22b7[_0x4d6a21(0x15f)][_0x2b2deb[_0x4d6a21(0x149)]]={..._0x1390a3,'path':_0x168f39},_0x1be0e5[_0x4d6a21(0x153)]({'sqlCode':_0x2b2deb[_0x4d6a21(0x149)],'filePath':_0x4b18ad});}catch(_0x57d8a8){_0xea552e[_0x4d6a21(0x153)]({'sqlCode':_0x2b2deb[_0x4d6a21(0x149)],'error':_0x57d8a8 instanceof Error?_0x57d8a8['message']:String(_0x57d8a8)});}}return _0x5a22b7[_0x4d6a21(0x154)]=new Date()[_0x4d6a21(0x14e)](),await writeSqlLockFile(_0xce1401[_0x4d6a21(0x16f)],_0x1f3caa),{'ok':_0xea552e[_0x4d6a21(0x168)]===0x0,'data':{'pulled':_0x1be0e5,'skipped':_0x48c8a3,'failed':_0xea552e},'message':_0x4d6a21(0x166)+_0x1be0e5[_0x4d6a21(0x168)]+_0x4d6a21(0x14b)+_0x48c8a3['length']+_0x4d6a21(0x16b)+_0xea552e['length']+_0x4d6a21(0x157)};}};function detectModeFromSql(_0x36f75e){const _0x3efa31=a191_0x16900d,_0x2ba589=ensureRemoteSqlContent(_0x36f75e),_0x16450d=stripLocalSqlMetadata(_0x2ba589,_0x3efa31(0x151))[_0x3efa31(0x14f)]();if(/^<(select|insert|update|delete)\b/i[_0x3efa31(0x13f)](_0x16450d))return _0x3efa31(0x151);return'sql';}function isEquivalentPulledSqlFile(_0x1ba76e,_0x30b73f,_0xdd3d49){return normalizePullComparableContent(_0x1ba76e,_0xdd3d49)===normalizePullComparableContent(_0x30b73f,_0xdd3d49);}function normalizePullComparableContent(_0x2a4668,_0x8e90cc){const _0x4365c3=a191_0x16900d,_0x3530f1=_0x2a4668[_0x4365c3(0x155)](/\r\n/g,'\x0a')[_0x4365c3(0x15c)]('\x0a'),_0x475b9f=_0x3530f1['filter'](_0x1e2e70=>!isSyncedAtMetadataLine(_0x1e2e70,_0x8e90cc));return _0x475b9f[_0x4365c3(0x160)]('\x0a');}function isSyncedAtMetadataLine(_0x20feed,_0x1d22b9){const _0x526094=a191_0x16900d;if(_0x1d22b9===_0x526094(0x151))return/^\s*<!--\s*@lovrabet\.syncedAt:/['test'](_0x20feed);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x526094(0x13f)](_0x20feed);}
@@ -1 +1 @@
1
- const a191_0x577dcc=a191_0x5e8a;(function(_0x25ea97,_0x1eb60c){const _0x560115=a191_0x5e8a,_0x383b32=_0x25ea97();while(!![]){try{const _0x20cc71=-parseInt(_0x560115(0xbb))/0x1+-parseInt(_0x560115(0xa8))/0x2*(parseInt(_0x560115(0xb7))/0x3)+-parseInt(_0x560115(0xde))/0x4+-parseInt(_0x560115(0xd7))/0x5+parseInt(_0x560115(0xb9))/0x6*(parseInt(_0x560115(0xa0))/0x7)+-parseInt(_0x560115(0xa2))/0x8+parseInt(_0x560115(0xbd))/0x9*(parseInt(_0x560115(0xd5))/0xa);if(_0x20cc71===_0x1eb60c)break;else _0x383b32['push'](_0x383b32['shift']());}catch(_0x493018){_0x383b32['push'](_0x383b32['shift']());}}}(a191_0x2ef2,0xccdc6));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';function a191_0x2ef2(){const _0x3e4912=['local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','Local\x20directory\x20\x22','map','103827IbIABn','message','204648ENcVvb','str','928359wqzBmC','utf8','18GVymgQ','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','toISOString','sqlName','trashDir','write','boolean','No\x20database\x20matches\x20local\x20directory\x20\x22','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','validation','mode','dbDirectory','\x20SQL\x20file(s)','get','version','length','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','filePath','replace','isFinite','Push\x20local\x20SQL\x20files\x20to\x20remote','Would\x20push\x20','sqlRootDir','force','24826460aZScXZ','sqlRoot','4702615IUzxyZ','relativePath','catch','bool','hash','Push\x20complete:\x20','has','5414360aDIHzz','set','\x20skipped,\x20','lastSync','path','lockFilePath','exec','filter','remoteId','join','sqlCode','91CFPCPQ','\x20pushed,\x20','2193880JUIBbq','sqls','dbId','entries','\x22\x20for\x20sqlCode\x20','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','62CTdAeZ','appCode','push','unchanged','/smartapi/custom/updateUserCustomSql','sqlcode','startsWith','No\x20local\x20SQL\x20files\x20found.','\x20failed','sql','dbName','POST'];a191_0x2ef2=function(){return _0x3e4912;};return a191_0x2ef2();}function a191_0x5e8a(_0x310c1d,_0x222f8f){_0x310c1d=_0x310c1d-0x9c;const _0x2ef212=a191_0x2ef2();let _0x5e8ada=_0x2ef212[_0x310c1d];return _0x5e8ada;}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(_0x435557,_0x3e9d3f,_0x2afca8){const _0x4bf66c=a191_0x5e8a,_0x242b0c=await scanLocalSqlQueries(_0x435557),_0xdd92d3=new Map();for(const _0x54a877 of _0x242b0c){if(_0x2afca8&&_0x54a877[_0x4bf66c(0x9f)]!==_0x2afca8)continue;const _0x1dd921=_0xdd92d3[_0x4bf66c(0xca)](_0x54a877['sqlCode'])??[];_0x1dd921[_0x4bf66c(0xaa)](_0x54a877),_0xdd92d3[_0x4bf66c(0xdf)](_0x54a877[_0x4bf66c(0x9f)],_0x1dd921);}if(_0x2afca8&&!_0xdd92d3[_0x4bf66c(0xdd)](_0x2afca8))throw CliErrors[_0x4bf66c(0xc6)]('Local\x20SQL\x20not\x20found:\x20'+_0x2afca8);const _0x36d211=[];for(const [_0x13505d,_0x54d87a]of _0xdd92d3[_0x4bf66c(0xa5)]()){if(_0x54d87a['length']===0x1){_0x36d211[_0x4bf66c(0xaa)](_0x54d87a[0x0]);continue;}const _0x2ab843=_0x3e9d3f[_0x4bf66c(0xa3)][_0x13505d],_0x474a87=_0x2ab843?.['path'],_0x29b8d0=_0x474a87?_0x54d87a[_0x4bf66c(0x9c)](_0x48b2d3=>_0x48b2d3[_0x4bf66c(0xd8)]!==_0x474a87):_0x54d87a;if(_0x2ab843&&_0x29b8d0[_0x4bf66c(0xcc)]===0x1){_0x36d211[_0x4bf66c(0xaa)](_0x29b8d0[0x0]);continue;}throw CliErrors[_0x4bf66c(0xc6)](_0x4bf66c(0xc5)+_0x13505d+'.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.');}return _0x36d211;}export const sqlPush={'service':a191_0x577dcc(0xb1),'command':a191_0x577dcc(0xaa),'description':a191_0x577dcc(0xd1),'risk':a191_0x577dcc(0xc2),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':'force','type':a191_0x577dcc(0xc3),'description':a191_0x577dcc(0xa7)}],async 'dryRun'(_0xfb4c08){const _0x16d135=a191_0x577dcc,_0x3b2e14=loadSqlProjectConfig(_0xfb4c08[_0x16d135(0xa9)]),_0x47ec60=await readSqlLockFile(_0x3b2e14['lockFilePath']),{appLock:_0x2bebc3}=ensureSqlLockScope(_0x47ec60??createEmptySqlLock(),_0xfb4c08[_0x16d135(0xa9)],_0x3b2e14[_0x16d135(0xd6)],_0x16d135(0xaa)),_0x337797=await getTargetSqlQueries(_0x3b2e14,_0x2bebc3,_0xfb4c08['str'](_0x16d135(0xad))||undefined),_0x4562bb=[];for(const _0x5797e7 of _0x337797){const _0x5c9561=await computeSqlFileHash(_0x5797e7[_0x16d135(0xce)]),_0x4db946=_0x2bebc3[_0x16d135(0xa3)][_0x5797e7[_0x16d135(0x9f)]],_0x3571f5=!!_0x4db946&&(_0x4db946[_0x16d135(0xe2)]!==_0x5797e7[_0x16d135(0xd8)]||!!_0x5797e7[_0x16d135(0xc0)]&&_0x4db946[_0x16d135(0xc0)]!==_0x5797e7[_0x16d135(0xc0)]);if(!_0xfb4c08[_0x16d135(0xda)](_0x16d135(0xd4))&&_0x4db946&&_0x4db946[_0x16d135(0xdb)]===_0x5c9561&&!_0x3571f5)continue;_0x4562bb[_0x16d135(0xaa)](_0x5797e7[_0x16d135(0x9f)]);}return{'method':_0x16d135(0xb3),'url':_0x16d135(0xac),'body':{'sqlCodes':_0x4562bb,'appCode':_0xfb4c08[_0x16d135(0xa9)]},'description':_0x16d135(0xd2)+_0x4562bb[_0x16d135(0xcc)]+_0x16d135(0xc9)};},async 'execute'(_0x461f66){const _0x279e73=a191_0x577dcc,_0x1031c7=loadSqlProjectConfig(_0x461f66[_0x279e73(0xa9)]),_0x50d089=await readSqlLockFile(_0x1031c7['lockFilePath']),{lockData:_0x41eb97,appLock:_0x3f523b}=ensureSqlLockScope(_0x50d089??createEmptySqlLock(),_0x461f66[_0x279e73(0xa9)],_0x1031c7[_0x279e73(0xd6)],'push'),_0x3a8455=await getTargetSqlQueries(_0x1031c7,_0x3f523b,_0x461f66[_0x279e73(0xba)](_0x279e73(0xad))||undefined);if(_0x3a8455['length']===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x279e73(0xaf)};const _0x107908=[],_0x3a7a8a=[],_0x17c9bc=[];for(const _0x30e784 of _0x3a8455){const _0x1e73c6=_0x3f523b[_0x279e73(0xa3)][_0x30e784[_0x279e73(0x9f)]];if(!_0x1e73c6){_0x17c9bc[_0x279e73(0xaa)]({'sqlCode':_0x30e784[_0x279e73(0x9f)],'error':_0x279e73(0xb4)});continue;}try{const _0xe7179b=await computeSqlFileHash(_0x30e784[_0x279e73(0xce)]),_0x3492c0=_0x1e73c6[_0x279e73(0xe2)]!==_0x30e784[_0x279e73(0xd8)]||!!_0x30e784['sqlName']&&_0x1e73c6[_0x279e73(0xc0)]!==_0x30e784[_0x279e73(0xc0)];if(!_0x461f66[_0x279e73(0xda)](_0x279e73(0xd4))&&_0x1e73c6[_0x279e73(0xdb)]===_0xe7179b&&!_0x3492c0){_0x3a7a8a['push']({'sqlCode':_0x30e784[_0x279e73(0x9f)],'reason':_0x279e73(0xab)});continue;}if(_0x1e73c6[_0x279e73(0xcb)]==null){_0x17c9bc['push']({'sqlCode':_0x30e784[_0x279e73(0x9f)],'error':_0x279e73(0xbe)});continue;}const _0x26feeb=await readFile(_0x30e784['filePath'],_0x279e73(0xbc)),_0x4f4d4e=stripLocalSqlMetadata(_0x26feeb,_0x30e784[_0x279e73(0xc7)]),_0xe7a2ad=_0x30e784[_0x279e73(0xc0)]||_0x1e73c6['sqlName'],_0x43b4c3=await resolveTargetDbBinding(_0x461f66[_0x279e73(0xa9)],_0x30e784,_0x1e73c6),_0x17905f=await updateSqlQuery({'id':_0x1e73c6[_0x279e73(0x9d)],'appCode':_0x461f66[_0x279e73(0xa9)],'sqlCode':_0x30e784[_0x279e73(0x9f)],'sqlName':_0xe7a2ad,'dbId':_0x43b4c3[_0x279e73(0xa4)],'version':_0x1e73c6[_0x279e73(0xcb)],'sqlContent':_0x4f4d4e,'sqlConfig':_0x1e73c6['sqlConfig']??undefined}),_0xe9f0a5=_0x17905f['dbId']?await getDbName(_0x461f66[_0x279e73(0xa9)],Number(_0x17905f['dbId']))['catch'](()=>_0x43b4c3[_0x279e73(0xb2)]):_0x43b4c3[_0x279e73(0xb2)];_0x3f523b[_0x279e73(0xa3)][_0x30e784[_0x279e73(0x9f)]]={...buildSqlLockEntry(_0x17905f,_0x4f4d4e,_0xe7179b,{'dbName':_0xe9f0a5}),'path':_0x30e784[_0x279e73(0xd8)],'mode':_0x1e73c6[_0x279e73(0xc7)]},await archivePreviousSqlFileIfNeeded(_0x1031c7,_0x1e73c6[_0x279e73(0xe2)],_0x30e784[_0x279e73(0xd8)]),_0x107908[_0x279e73(0xaa)]({'sqlCode':_0x30e784[_0x279e73(0x9f)],'remoteId':_0x1e73c6[_0x279e73(0x9d)]});}catch(_0x1b8c02){_0x17c9bc[_0x279e73(0xaa)]({'sqlCode':_0x30e784[_0x279e73(0x9f)],'error':_0x1b8c02 instanceof Error?_0x1b8c02[_0x279e73(0xb8)]:String(_0x1b8c02)});}}return _0x3f523b[_0x279e73(0xe1)]=new Date()[_0x279e73(0xbf)](),await writeSqlLockFile(_0x1031c7[_0x279e73(0xe3)],_0x41eb97),{'ok':_0x17c9bc['length']===0x0,'data':{'pushed':_0x107908,'skipped':_0x3a7a8a,'failed':_0x17c9bc},'message':_0x279e73(0xdc)+_0x107908[_0x279e73(0xcc)]+_0x279e73(0xa1)+_0x3a7a8a['length']+_0x279e73(0xe0)+_0x17c9bc['length']+_0x279e73(0xb0)};}};async function archivePreviousSqlFileIfNeeded(_0x587429,_0x58ad43,_0x3d4f84){const _0x1ccdaa=a191_0x577dcc;if(!_0x58ad43||_0x58ad43===_0x3d4f84)return;const _0x27324a=join(_0x587429['sqlRootDir'],_0x58ad43);if(!await fileExists(_0x27324a))return;const _0x286ee7=await moveToTrash(_0x587429['projectRoot'],_0x587429[_0x1ccdaa(0xc1)],_0x27324a);await cleanupEmptyDirectories(dirname(_0x27324a),_0x587429[_0x1ccdaa(0xd3)]),void _0x286ee7;}async function moveToTrash(_0x1aef43,_0x16e99f,_0x32b5f3){const _0x4d7f40=a191_0x577dcc,_0x102582=new Date()[_0x4d7f40(0xbf)]()[_0x4d7f40(0xcf)](/[:.]/g,'-'),_0x520afa=relative(_0x1aef43,_0x32b5f3),_0x1e421a=join(_0x16e99f,_0x102582,_0x520afa);return await mkdir(dirname(_0x1e421a),{'recursive':!![]}),await rename(_0x32b5f3,_0x1e421a),_0x1e421a;}async function cleanupEmptyDirectories(_0x37d4f9,_0x3d6ef1){const _0x46573b=a191_0x577dcc;let _0x476507=resolve(_0x37d4f9);const _0x39908f=resolve(_0x3d6ef1);while(_0x476507[_0x46573b(0xae)](''+_0x39908f+sep)||_0x476507===_0x39908f){if(_0x476507===_0x39908f)return;try{const _0x27b36f=await readdir(_0x476507);if(_0x27b36f[_0x46573b(0xcc)]>0x0)return;await rmdir(_0x476507);}catch{return;}_0x476507=dirname(_0x476507);}}async function resolveTargetDbBinding(_0x2c2eb7,_0x4cdfa9,_0x4c9221){const _0x5f0dc2=a191_0x577dcc,_0x161de=_0x4cdfa9[_0x5f0dc2(0xc8)];if(!_0x161de)return{'dbId':_0x4c9221[_0x5f0dc2(0xa4)],'dbName':_0x4c9221[_0x5f0dc2(0xb2)]};const _0x37d0e8=buildDbDirectoryName(_0x4c9221['dbName'],_0x4c9221[_0x5f0dc2(0xa4)]);if(_0x161de===_0x37d0e8)return{'dbId':_0x4c9221['dbId'],'dbName':_0x4c9221[_0x5f0dc2(0xb2)]};const _0x4a93a7=parseExplicitDbDirectory(_0x161de);if(_0x4a93a7!=null)return{'dbId':_0x4a93a7,'dbName':await getDbName(_0x2c2eb7,_0x4a93a7)[_0x5f0dc2(0xd9)](()=>undefined)};const _0xaf503=await listDatabases(_0x2c2eb7),_0x4e4b42=_0xaf503['filter'](_0xfd4385=>buildDbDirectoryName(_0xfd4385[_0x5f0dc2(0xb2)],_0xfd4385[_0x5f0dc2(0xa4)])===_0x161de);if(_0x4e4b42[_0x5f0dc2(0xcc)]===0x1)return{'dbId':_0x4e4b42[0x0][_0x5f0dc2(0xa4)],'dbName':_0x4e4b42[0x0][_0x5f0dc2(0xb2)]};if(_0x4e4b42[_0x5f0dc2(0xcc)]===0x0)throw CliErrors[_0x5f0dc2(0xc6)](_0x5f0dc2(0xc4)+_0x161de+_0x5f0dc2(0xa6)+_0x4cdfa9['sqlCode']+'.');const _0x28e84a=_0x4e4b42[_0x5f0dc2(0xb6)](_0x563239=>_0x563239[_0x5f0dc2(0xb2)]+'\x20('+_0x563239[_0x5f0dc2(0xa4)]+')')[_0x5f0dc2(0x9e)](',\x20');throw CliErrors['validation'](_0x5f0dc2(0xb5)+_0x161de+_0x5f0dc2(0xcd)+_0x4cdfa9['sqlCode']+':\x20'+_0x28e84a);}function parseExplicitDbDirectory(_0x40aa01){const _0x2a8e19=a191_0x577dcc,_0x55480d=/^db-(\d+)$/[_0x2a8e19(0xe4)](_0x40aa01);if(!_0x55480d)return null;const _0x120c88=Number(_0x55480d[0x1]);return Number[_0x2a8e19(0xd0)](_0x120c88)&&_0x120c88>0x0?_0x120c88:null;}
1
+ const a192_0x1c918f=a192_0x469e;(function(_0x2c7e8a,_0x143285){const _0x11d916=a192_0x469e,_0x462502=_0x2c7e8a();while(!![]){try{const _0x529ef7=-parseInt(_0x11d916(0xd0))/0x1+-parseInt(_0x11d916(0xcd))/0x2*(parseInt(_0x11d916(0xcb))/0x3)+-parseInt(_0x11d916(0xd7))/0x4+parseInt(_0x11d916(0xb1))/0x5*(-parseInt(_0x11d916(0xa5))/0x6)+-parseInt(_0x11d916(0xd5))/0x7*(-parseInt(_0x11d916(0xd2))/0x8)+-parseInt(_0x11d916(0xb2))/0x9*(parseInt(_0x11d916(0xc0))/0xa)+-parseInt(_0x11d916(0xd1))/0xb*(-parseInt(_0x11d916(0xbd))/0xc);if(_0x529ef7===_0x143285)break;else _0x462502['push'](_0x462502['shift']());}catch(_0x508807){_0x462502['push'](_0x462502['shift']());}}}(a192_0x32c2,0xa83a4));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';function a192_0x469e(_0x564dc3,_0x212258){_0x564dc3=_0x564dc3-0x9b;const _0x32c2cc=a192_0x32c2();let _0x469ee2=_0x32c2cc[_0x564dc3];return _0x469ee2;}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';function a192_0x32c2(){const _0x972d46=['Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','bool','\x20skipped,\x20','156CEnnqL','mode','unchanged','492880QUOyDC','filter','get','map','write','/smartapi/custom/updateUserCustomSql','sqlCode','toISOString','set','dbName','Local\x20SQL\x20not\x20found:\x20','1965HFxtkn','exec','2594FhfCwW','dbId','\x20pushed,\x20','192036UyGvVB','2900711BlolsL','541752urUEkY','Push\x20complete:\x20','trashDir','28AQYXPL','sqlRoot','223604HYYzyK','utf8','message','relativePath','filePath','push','path','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','remoteId','sqlConfig','join','sqlRootDir','startsWith','force','Would\x20push\x20','sqlcode','catch','entries','45726CaFpnF','hash','has','Push\x20local\x20SQL\x20files\x20to\x20remote','lastSync','length','boolean','No\x20local\x20SQL\x20files\x20found.','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','appCode','lockFilePath','validation','705vlhLPS','153AePlVn','version','Local\x20directory\x20\x22','\x20failed','sqls','isFinite','str','sqlName'];a192_0x32c2=function(){return _0x972d46;};return a192_0x32c2();}import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x4eb643,_0x33cf80,_0x359310){const _0x128a81=a192_0x469e,_0x1dedb0=await scanLocalSqlQueries(_0x4eb643),_0x1694ad=new Map();for(const _0x507a73 of _0x1dedb0){if(_0x359310&&_0x507a73[_0x128a81(0xc6)]!==_0x359310)continue;const _0x320a8d=_0x1694ad[_0x128a81(0xc2)](_0x507a73['sqlCode'])??[];_0x320a8d['push'](_0x507a73),_0x1694ad[_0x128a81(0xc8)](_0x507a73[_0x128a81(0xc6)],_0x320a8d);}if(_0x359310&&!_0x1694ad[_0x128a81(0xa7)](_0x359310))throw CliErrors[_0x128a81(0xb0)](_0x128a81(0xca)+_0x359310);const _0xc21f42=[];for(const [_0x58b599,_0x50718e]of _0x1694ad[_0x128a81(0xa4)]()){if(_0x50718e[_0x128a81(0xaa)]===0x1){_0xc21f42[_0x128a81(0xdc)](_0x50718e[0x0]);continue;}const _0x2b183c=_0x33cf80[_0x128a81(0xb6)][_0x58b599],_0x3fdc25=_0x2b183c?.['path'],_0x7d1a4f=_0x3fdc25?_0x50718e[_0x128a81(0xc1)](_0x500c78=>_0x500c78[_0x128a81(0xda)]!==_0x3fdc25):_0x50718e;if(_0x2b183c&&_0x7d1a4f[_0x128a81(0xaa)]===0x1){_0xc21f42[_0x128a81(0xdc)](_0x7d1a4f[0x0]);continue;}throw CliErrors['validation'](_0x128a81(0xad)+_0x58b599+_0x128a81(0xde));}return _0xc21f42;}export const sqlPush={'service':'sql','command':a192_0x1c918f(0xdc),'description':a192_0x1c918f(0xa8),'risk':a192_0x1c918f(0xc4),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':'force','type':a192_0x1c918f(0xab),'description':a192_0x1c918f(0xba)}],async 'dryRun'(_0x7c9afb){const _0x1d8c85=a192_0x1c918f,_0x17c592=loadSqlProjectConfig(_0x7c9afb[_0x1d8c85(0xae)]),_0x44bc71=await readSqlLockFile(_0x17c592[_0x1d8c85(0xaf)]),{appLock:_0x353e16}=ensureSqlLockScope(_0x44bc71??createEmptySqlLock(),_0x7c9afb['appCode'],_0x17c592[_0x1d8c85(0xd6)],_0x1d8c85(0xdc)),_0x5038e9=await getTargetSqlQueries(_0x17c592,_0x353e16,_0x7c9afb[_0x1d8c85(0xb8)]('sqlcode')||undefined),_0xcf6864=[];for(const _0x270e28 of _0x5038e9){const _0x336283=await computeSqlFileHash(_0x270e28[_0x1d8c85(0xdb)]),_0x5e8757=_0x353e16[_0x1d8c85(0xb6)][_0x270e28[_0x1d8c85(0xc6)]],_0x18a8ce=!!_0x5e8757&&(_0x5e8757[_0x1d8c85(0xdd)]!==_0x270e28[_0x1d8c85(0xda)]||!!_0x270e28[_0x1d8c85(0xb9)]&&_0x5e8757['sqlName']!==_0x270e28['sqlName']);if(!_0x7c9afb[_0x1d8c85(0xbb)](_0x1d8c85(0xa0))&&_0x5e8757&&_0x5e8757[_0x1d8c85(0xa6)]===_0x336283&&!_0x18a8ce)continue;_0xcf6864[_0x1d8c85(0xdc)](_0x270e28['sqlCode']);}return{'method':'POST','url':_0x1d8c85(0xc5),'body':{'sqlCodes':_0xcf6864,'appCode':_0x7c9afb[_0x1d8c85(0xae)]},'description':_0x1d8c85(0xa1)+_0xcf6864[_0x1d8c85(0xaa)]+'\x20SQL\x20file(s)'};},async 'execute'(_0x55554c){const _0x23c488=a192_0x1c918f,_0x2482bb=loadSqlProjectConfig(_0x55554c[_0x23c488(0xae)]),_0x1789bc=await readSqlLockFile(_0x2482bb[_0x23c488(0xaf)]),{lockData:_0x2c7944,appLock:_0x4b758a}=ensureSqlLockScope(_0x1789bc??createEmptySqlLock(),_0x55554c[_0x23c488(0xae)],_0x2482bb[_0x23c488(0xd6)],'push'),_0x49ad33=await getTargetSqlQueries(_0x2482bb,_0x4b758a,_0x55554c[_0x23c488(0xb8)](_0x23c488(0xa2))||undefined);if(_0x49ad33[_0x23c488(0xaa)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x23c488(0xac)};const _0x24e5be=[],_0x2ec8b3=[],_0x4da585=[];for(const _0x1a2659 of _0x49ad33){const _0x12feb3=_0x4b758a['sqls'][_0x1a2659[_0x23c488(0xc6)]];if(!_0x12feb3){_0x4da585[_0x23c488(0xdc)]({'sqlCode':_0x1a2659[_0x23c488(0xc6)],'error':'local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first'});continue;}try{const _0x235123=await computeSqlFileHash(_0x1a2659[_0x23c488(0xdb)]),_0x3dbfaf=_0x12feb3[_0x23c488(0xdd)]!==_0x1a2659[_0x23c488(0xda)]||!!_0x1a2659[_0x23c488(0xb9)]&&_0x12feb3['sqlName']!==_0x1a2659['sqlName'];if(!_0x55554c[_0x23c488(0xbb)](_0x23c488(0xa0))&&_0x12feb3[_0x23c488(0xa6)]===_0x235123&&!_0x3dbfaf){_0x2ec8b3['push']({'sqlCode':_0x1a2659[_0x23c488(0xc6)],'reason':_0x23c488(0xbf)});continue;}if(_0x12feb3[_0x23c488(0xb3)]==null){_0x4da585[_0x23c488(0xdc)]({'sqlCode':_0x1a2659[_0x23c488(0xc6)],'error':'missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first'});continue;}const _0x3d933e=await readFile(_0x1a2659[_0x23c488(0xdb)],_0x23c488(0xd8)),_0x515952=stripLocalSqlMetadata(_0x3d933e,_0x1a2659[_0x23c488(0xbe)]),_0xae03bb=_0x1a2659[_0x23c488(0xb9)]||_0x12feb3[_0x23c488(0xb9)],_0x5d97e2=await resolveTargetDbBinding(_0x55554c[_0x23c488(0xae)],_0x1a2659,_0x12feb3),_0x1ccccf=await updateSqlQuery({'id':_0x12feb3[_0x23c488(0x9b)],'appCode':_0x55554c[_0x23c488(0xae)],'sqlCode':_0x1a2659[_0x23c488(0xc6)],'sqlName':_0xae03bb,'dbId':_0x5d97e2[_0x23c488(0xce)],'version':_0x12feb3[_0x23c488(0xb3)],'sqlContent':_0x515952,'sqlConfig':_0x12feb3[_0x23c488(0x9c)]??undefined}),_0x2cd8fa=_0x1ccccf[_0x23c488(0xce)]?await getDbName(_0x55554c[_0x23c488(0xae)],Number(_0x1ccccf['dbId']))['catch'](()=>_0x5d97e2[_0x23c488(0xc9)]):_0x5d97e2[_0x23c488(0xc9)];_0x4b758a['sqls'][_0x1a2659['sqlCode']]={...buildSqlLockEntry(_0x1ccccf,_0x515952,_0x235123,{'dbName':_0x2cd8fa}),'path':_0x1a2659[_0x23c488(0xda)],'mode':_0x12feb3[_0x23c488(0xbe)]},await archivePreviousSqlFileIfNeeded(_0x2482bb,_0x12feb3[_0x23c488(0xdd)],_0x1a2659[_0x23c488(0xda)]),_0x24e5be[_0x23c488(0xdc)]({'sqlCode':_0x1a2659['sqlCode'],'remoteId':_0x12feb3[_0x23c488(0x9b)]});}catch(_0x4db2b7){_0x4da585[_0x23c488(0xdc)]({'sqlCode':_0x1a2659[_0x23c488(0xc6)],'error':_0x4db2b7 instanceof Error?_0x4db2b7[_0x23c488(0xd9)]:String(_0x4db2b7)});}}return _0x4b758a[_0x23c488(0xa9)]=new Date()[_0x23c488(0xc7)](),await writeSqlLockFile(_0x2482bb[_0x23c488(0xaf)],_0x2c7944),{'ok':_0x4da585[_0x23c488(0xaa)]===0x0,'data':{'pushed':_0x24e5be,'skipped':_0x2ec8b3,'failed':_0x4da585},'message':_0x23c488(0xd3)+_0x24e5be[_0x23c488(0xaa)]+_0x23c488(0xcf)+_0x2ec8b3[_0x23c488(0xaa)]+_0x23c488(0xbc)+_0x4da585[_0x23c488(0xaa)]+_0x23c488(0xb5)};}};async function archivePreviousSqlFileIfNeeded(_0x4c42a4,_0x25404c,_0x24a3bd){const _0x4159ce=a192_0x1c918f;if(!_0x25404c||_0x25404c===_0x24a3bd)return;const _0x38d73b=join(_0x4c42a4[_0x4159ce(0x9e)],_0x25404c);if(!await fileExists(_0x38d73b))return;const _0x3b5d68=await moveToTrash(_0x4c42a4['projectRoot'],_0x4c42a4[_0x4159ce(0xd4)],_0x38d73b);await cleanupEmptyDirectories(dirname(_0x38d73b),_0x4c42a4[_0x4159ce(0x9e)]),void _0x3b5d68;}async function moveToTrash(_0x3e63f2,_0x170ae0,_0x160636){const _0x306463=a192_0x1c918f,_0x4484d4=new Date()[_0x306463(0xc7)]()['replace'](/[:.]/g,'-'),_0x17c3ec=relative(_0x3e63f2,_0x160636),_0x4a2b90=join(_0x170ae0,_0x4484d4,_0x17c3ec);return await mkdir(dirname(_0x4a2b90),{'recursive':!![]}),await rename(_0x160636,_0x4a2b90),_0x4a2b90;}async function cleanupEmptyDirectories(_0x17ba6f,_0x1ab24f){const _0x2e46e9=a192_0x1c918f;let _0x48f784=resolve(_0x17ba6f);const _0x1c895d=resolve(_0x1ab24f);while(_0x48f784[_0x2e46e9(0x9f)](''+_0x1c895d+sep)||_0x48f784===_0x1c895d){if(_0x48f784===_0x1c895d)return;try{const _0x100dc5=await readdir(_0x48f784);if(_0x100dc5['length']>0x0)return;await rmdir(_0x48f784);}catch{return;}_0x48f784=dirname(_0x48f784);}}async function resolveTargetDbBinding(_0x54ecc3,_0x478f15,_0x2155cd){const _0x3c1f26=a192_0x1c918f,_0x2912b9=_0x478f15['dbDirectory'];if(!_0x2912b9)return{'dbId':_0x2155cd[_0x3c1f26(0xce)],'dbName':_0x2155cd[_0x3c1f26(0xc9)]};const _0x21fe75=buildDbDirectoryName(_0x2155cd[_0x3c1f26(0xc9)],_0x2155cd[_0x3c1f26(0xce)]);if(_0x2912b9===_0x21fe75)return{'dbId':_0x2155cd['dbId'],'dbName':_0x2155cd[_0x3c1f26(0xc9)]};const _0x2529d1=parseExplicitDbDirectory(_0x2912b9);if(_0x2529d1!=null)return{'dbId':_0x2529d1,'dbName':await getDbName(_0x54ecc3,_0x2529d1)[_0x3c1f26(0xa3)](()=>undefined)};const _0xf2d021=await listDatabases(_0x54ecc3),_0x41e899=_0xf2d021[_0x3c1f26(0xc1)](_0x37afff=>buildDbDirectoryName(_0x37afff['dbName'],_0x37afff[_0x3c1f26(0xce)])===_0x2912b9);if(_0x41e899['length']===0x1)return{'dbId':_0x41e899[0x0]['dbId'],'dbName':_0x41e899[0x0][_0x3c1f26(0xc9)]};if(_0x41e899[_0x3c1f26(0xaa)]===0x0)throw CliErrors['validation']('No\x20database\x20matches\x20local\x20directory\x20\x22'+_0x2912b9+'\x22\x20for\x20sqlCode\x20'+_0x478f15[_0x3c1f26(0xc6)]+'.');const _0x5ed45c=_0x41e899[_0x3c1f26(0xc3)](_0x4cf736=>_0x4cf736[_0x3c1f26(0xc9)]+'\x20('+_0x4cf736[_0x3c1f26(0xce)]+')')[_0x3c1f26(0x9d)](',\x20');throw CliErrors[_0x3c1f26(0xb0)](_0x3c1f26(0xb4)+_0x2912b9+'\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20'+_0x478f15[_0x3c1f26(0xc6)]+':\x20'+_0x5ed45c);}function parseExplicitDbDirectory(_0x248e8d){const _0x54cb61=a192_0x1c918f,_0x25c1b8=/^db-(\d+)$/[_0x54cb61(0xcc)](_0x248e8d);if(!_0x25c1b8)return null;const _0x78fa49=Number(_0x25c1b8[0x1]);return Number[_0x54cb61(0xb7)](_0x78fa49)&&_0x78fa49>0x0?_0x78fa49:null;}
@@ -1 +1 @@
1
- (function(_0x587b95,_0x37b15b){const _0x586866=a192_0x1382,_0x556dab=_0x587b95();while(!![]){try{const _0x34a64c=-parseInt(_0x586866(0x8e))/0x1+-parseInt(_0x586866(0x7d))/0x2*(-parseInt(_0x586866(0x76))/0x3)+parseInt(_0x586866(0x97))/0x4+-parseInt(_0x586866(0x86))/0x5*(parseInt(_0x586866(0x71))/0x6)+-parseInt(_0x586866(0x75))/0x7+-parseInt(_0x586866(0x7e))/0x8*(-parseInt(_0x586866(0x74))/0x9)+-parseInt(_0x586866(0x8d))/0xa;if(_0x34a64c===_0x37b15b)break;else _0x556dab['push'](_0x556dab['shift']());}catch(_0x215d76){_0x556dab['push'](_0x556dab['shift']());}}}(a192_0x18ba,0xa85bd));import{createInterface}from'node:readline';import{join}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';export const SQL_LOCAL_REL_DIR='.rabetbase/sql';export function buildSqlLockEntry(_0x3616c5,_0x1363fa,_0x473fef,_0x57265c){const _0x1dfbad=a192_0x1382,_0x3e0237=detectSqlMode(_0x1363fa);return{'path':buildSqlRelativePath(_0x3616c5[_0x1dfbad(0x81)],_0x3616c5[_0x1dfbad(0x70)],_0x57265c?.[_0x1dfbad(0x73)],_0x3e0237,_0x3616c5[_0x1dfbad(0x8c)]),'hash':_0x473fef,'remoteId':_0x3616c5['id'],'version':_0x3616c5[_0x1dfbad(0x7f)],'dbId':Number(_0x3616c5[_0x1dfbad(0x8c)]),'dbName':_0x57265c?.['dbName'],'sqlName':_0x3616c5[_0x1dfbad(0x70)],'sqlConfig':_0x3616c5[_0x1dfbad(0x84)]??undefined,'mode':_0x3e0237};}export function cloneSqlLockData(_0x5eb88c){const _0x2ce909=a192_0x1382;return{'apps':Object[_0x2ce909(0x82)](Object[_0x2ce909(0x77)](_0x5eb88c[_0x2ce909(0x78)])[_0x2ce909(0x87)](([_0x24cf16,_0x217ef2])=>[_0x24cf16,{'sqlRoot':_0x217ef2['sqlRoot'],'lastSync':_0x217ef2['lastSync'],'sqls':{..._0x217ef2[_0x2ce909(0x96)]}}]))};}export function ensureRemoteSqlContent(_0x38cc1a){return _0x38cc1a['sqlContent']??'';}export function buildLocalSqlFileContent(_0x38c4bb,_0x1f51db,_0x4f61b6){const _0x285a7d=a192_0x1382,_0x369a93=_0x4f61b6?.[_0x285a7d(0x92)]??detectSqlMode(_0x1f51db),_0x38c841=stripLocalSqlMetadata(_0x1f51db,_0x369a93)['trim'](),_0x433b67=[...buildMetadataHeaderLines({'sqlCode':_0x38c4bb[_0x285a7d(0x81)],'sqlName':_0x38c4bb[_0x285a7d(0x70)],'dbId':_0x38c4bb['dbId'],'dbName':_0x4f61b6?.[_0x285a7d(0x73)],'mode':_0x369a93,'syncedAt':_0x4f61b6?.[_0x285a7d(0x72)],'description':_0x4f61b6?.[_0x285a7d(0x7b)]},_0x369a93),'',_0x38c841],_0x92ca67=_0x433b67[_0x285a7d(0x95)]('\x0a');return _0x92ca67[_0x285a7d(0x80)]('\x0a')?_0x92ca67:_0x92ca67+'\x0a';}export function stripLocalSqlMetadata(_0x8a601b,_0x2d30b0){const _0x26569d=a192_0x1382,_0x65d7=_0x8a601b['replace'](/\r\n/g,'\x0a')[_0x26569d(0x90)]('\x0a'),_0x27bd1b=[];let _0x1f69df=0x0;if(_0x2d30b0===_0x26569d(0x89))while(_0x1f69df<_0x65d7[_0x26569d(0x6f)]){const _0x172a25=_0x65d7[_0x1f69df]??'';if(/^\s*<!--\s*@lovrabet\./[_0x26569d(0x8a)](_0x172a25)){_0x1f69df++;continue;}if(_0x172a25[_0x26569d(0x93)]()===''&&_0x1f69df>0x0){_0x1f69df++;continue;}break;}else while(_0x1f69df<_0x65d7[_0x26569d(0x6f)]){const _0x588f87=_0x65d7[_0x1f69df]??'';if(/^\s*--\s*@lovrabet\./['test'](_0x588f87)){_0x1f69df++;continue;}if(_0x588f87['trim']()===''&&_0x1f69df>0x0){_0x1f69df++;continue;}break;}for(;_0x1f69df<_0x65d7['length'];_0x1f69df++){_0x27bd1b[_0x26569d(0x88)](_0x65d7[_0x1f69df]);}return _0x27bd1b['join']('\x0a')[_0x26569d(0x7c)]();}function a192_0x18ba(){const _0x8abfa2=['map','push','mybatisXml','test','--\x20@lovrabet.','dbId','844070jaoFSe','552569CMCUqc','stderr','split','toLowerCase','mode','trim','filter','join','sqls','1842852TquZDB','question','length','sqlName','1758UJkGal','syncedAt','dbName','9CpJXhN','64274UyoKNb','78pxddQj','entries','apps','\x20-->','includes','description','trimStart','34078AvVRXv','3664840NzwbcQ','version','endsWith','sqlCode','fromEntries','path','sqlConfig','\x20[y/N]\x20','445QzLWPt'];a192_0x18ba=function(){return _0x8abfa2;};return a192_0x18ba();}export function resolveSqlMode(_0x4cebc3,_0x115613){const _0x48e993=a192_0x1382;if(_0x115613?.[_0x48e993(0x92)])return _0x115613['mode'];return detectSqlMode(_0x4cebc3);}export function resolveSqlFileName(_0x41c9c6,_0x25b7fa,_0xcc1f68){const _0x2e1101=a192_0x1382;if(_0xcc1f68?.[_0x2e1101(0x83)])return _0xcc1f68[_0x2e1101(0x83)];if(_0xcc1f68?.[_0x2e1101(0x70)]||_0xcc1f68?.[_0x2e1101(0x73)])return buildSqlRelativePath(_0x41c9c6,_0xcc1f68?.['sqlName'],_0xcc1f68?.['dbName'],resolveSqlMode(_0x25b7fa,_0xcc1f68),_0xcc1f68?.['dbId']);return buildDefaultSqlFileName(_0x41c9c6,resolveSqlMode(_0x25b7fa,_0xcc1f68));}export function resolveSqlLocalDir(_0x166630,_0x14c18d){return join(_0x166630,SQL_LOCAL_REL_DIR,_0x14c18d);}export async function confirmForceOverwrite(_0x144c30){const _0xb63007=a192_0x1382,_0x389340=createInterface({'input':process['stdin'],'output':process[_0xb63007(0x8f)]}),_0x38f41c=await new Promise(_0x389bcc=>{const _0x257400=_0xb63007;_0x389340[_0x257400(0x98)](_0x144c30+_0x257400(0x85),_0x389bcc);});return _0x389340['close'](),['y','yes'][_0xb63007(0x7a)](_0x38f41c['trim']()[_0xb63007(0x91)]());}function a192_0x1382(_0x219eaa,_0x5f4cd6){_0x219eaa=_0x219eaa-0x6f;const _0x18ba40=a192_0x18ba();let _0x138225=_0x18ba40[_0x219eaa];return _0x138225;}export function findSqlLockScope(_0x2c4cca,_0x2ad8bf){return _0x2c4cca['apps'][_0x2ad8bf];}function buildMetadataHeaderLines(_0x6c1cbf,_0x2073e9){const _0x3e131a=a192_0x1382,_0x2b4cc7=[[_0x3e131a(0x81),_0x6c1cbf[_0x3e131a(0x81)]],[_0x3e131a(0x70),_0x6c1cbf[_0x3e131a(0x70)]],[_0x3e131a(0x8c),_0x6c1cbf[_0x3e131a(0x8c)]],[_0x3e131a(0x73),_0x6c1cbf[_0x3e131a(0x73)]],[_0x3e131a(0x92),_0x6c1cbf[_0x3e131a(0x92)]],[_0x3e131a(0x72),_0x6c1cbf[_0x3e131a(0x72)]],[_0x3e131a(0x7b),_0x6c1cbf[_0x3e131a(0x7b)]]];if(_0x2073e9==='mybatisXml')return _0x2b4cc7[_0x3e131a(0x94)](([,_0x3f3127])=>_0x3f3127!==undefined&&_0x3f3127!==null&&String(_0x3f3127)[_0x3e131a(0x93)]()!=='')[_0x3e131a(0x87)](([_0x114d60,_0xb8d245])=>'<!--\x20@lovrabet.'+_0x114d60+':\x20'+String(_0xb8d245)+_0x3e131a(0x79));return _0x2b4cc7['filter'](([,_0x2a1cc6])=>_0x2a1cc6!==undefined&&_0x2a1cc6!==null&&String(_0x2a1cc6)[_0x3e131a(0x93)]()!=='')[_0x3e131a(0x87)](([_0x13beed,_0x1834b9])=>_0x3e131a(0x8b)+_0x13beed+':\x20'+String(_0x1834b9));}
1
+ const a193_0x26fece=a193_0x32ea;(function(_0x4de378,_0x4484f2){const _0x52deaf=a193_0x32ea,_0xf41d7f=_0x4de378();while(!![]){try{const _0x3d72ba=parseInt(_0x52deaf(0x8c))/0x1*(parseInt(_0x52deaf(0x8e))/0x2)+-parseInt(_0x52deaf(0xb1))/0x3+-parseInt(_0x52deaf(0xab))/0x4*(parseInt(_0x52deaf(0x91))/0x5)+-parseInt(_0x52deaf(0xa6))/0x6+parseInt(_0x52deaf(0xaf))/0x7*(-parseInt(_0x52deaf(0x8a))/0x8)+parseInt(_0x52deaf(0x9c))/0x9+parseInt(_0x52deaf(0xa3))/0xa;if(_0x3d72ba===_0x4484f2)break;else _0xf41d7f['push'](_0xf41d7f['shift']());}catch(_0x580ecb){_0xf41d7f['push'](_0xf41d7f['shift']());}}}(a193_0x1f8d,0x678eb));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=a193_0x26fece(0x8b);export function buildSqlLockEntry(_0x17b7bd,_0x3b4c2c,_0x41f22c,_0x26aa0d){const _0x10b449=a193_0x26fece,_0x3e5e0c=detectSqlMode(_0x3b4c2c);return{'path':buildSqlRelativePath(_0x17b7bd[_0x10b449(0xb0)],_0x17b7bd[_0x10b449(0x88)],_0x26aa0d?.[_0x10b449(0xa9)],_0x3e5e0c,_0x17b7bd[_0x10b449(0x99)]),'hash':_0x41f22c,'remoteId':_0x17b7bd['id'],'version':_0x17b7bd[_0x10b449(0x97)],'dbId':Number(_0x17b7bd[_0x10b449(0x99)]),'dbName':_0x26aa0d?.[_0x10b449(0xa9)],'sqlName':_0x17b7bd[_0x10b449(0x88)],'sqlConfig':_0x17b7bd[_0x10b449(0x94)]??undefined,'mode':_0x3e5e0c};}export function cloneSqlLockData(_0x269308){const _0x5afc2d=a193_0x26fece;return{'apps':Object['fromEntries'](Object['entries'](_0x269308[_0x5afc2d(0xa5)])[_0x5afc2d(0xad)](([_0x282989,_0x4e1894])=>[_0x282989,{'sqlRoot':_0x4e1894[_0x5afc2d(0xae)],'lastSync':_0x4e1894['lastSync'],'sqls':{..._0x4e1894[_0x5afc2d(0xa1)]}}]))};}export function ensureRemoteSqlContent(_0x537971){const _0x26cc21=a193_0x26fece;return _0x537971[_0x26cc21(0x9a)]??'';}export function buildLocalSqlFileContent(_0x4b320a,_0x2fd1ca,_0x3bf874){const _0x45c90e=a193_0x26fece,_0x407440=_0x3bf874?.[_0x45c90e(0x93)]??detectSqlMode(_0x2fd1ca),_0x59ba13=stripLocalSqlMetadata(_0x2fd1ca,_0x407440)[_0x45c90e(0x89)](),_0x111e56=[...buildMetadataHeaderLines({'sqlCode':_0x4b320a[_0x45c90e(0xb0)],'sqlName':_0x4b320a[_0x45c90e(0x88)],'dbId':_0x4b320a[_0x45c90e(0x99)],'dbName':_0x3bf874?.[_0x45c90e(0xa9)],'mode':_0x407440,'syncedAt':_0x3bf874?.[_0x45c90e(0x9d)],'description':_0x3bf874?.[_0x45c90e(0x9f)]},_0x407440),'',_0x59ba13],_0x2045ec=_0x111e56['join']('\x0a');return _0x2045ec[_0x45c90e(0xa7)]('\x0a')?_0x2045ec:_0x2045ec+'\x0a';}function a193_0x32ea(_0x40bae7,_0x35d175){_0x40bae7=_0x40bae7-0x88;const _0x1f8d6a=a193_0x1f8d();let _0x32eaae=_0x1f8d6a[_0x40bae7];return _0x32eaae;}export function stripLocalSqlMetadata(_0x1c421b,_0x3cc134){const _0x55460a=a193_0x26fece,_0x4d72ca=_0x1c421b['replace'](/\r\n/g,'\x0a')[_0x55460a(0x9b)]('\x0a'),_0x2fde12=[];let _0x1db617=0x0;if(_0x3cc134===_0x55460a(0x92))while(_0x1db617<_0x4d72ca[_0x55460a(0xa8)]){const _0x4d14e0=_0x4d72ca[_0x1db617]??'';if(/^\s*<!--\s*@lovrabet\./[_0x55460a(0xa2)](_0x4d14e0)){_0x1db617++;continue;}if(_0x4d14e0[_0x55460a(0x89)]()===''&&_0x1db617>0x0){_0x1db617++;continue;}break;}else while(_0x1db617<_0x4d72ca[_0x55460a(0xa8)]){const _0x42bdc0=_0x4d72ca[_0x1db617]??'';if(/^\s*--\s*@lovrabet\./[_0x55460a(0xa2)](_0x42bdc0)){_0x1db617++;continue;}if(_0x42bdc0[_0x55460a(0x89)]()===''&&_0x1db617>0x0){_0x1db617++;continue;}break;}for(;_0x1db617<_0x4d72ca[_0x55460a(0xa8)];_0x1db617++){_0x2fde12['push'](_0x4d72ca[_0x1db617]);}return _0x2fde12[_0x55460a(0x8f)]('\x0a')['trimStart']();}export function resolveSqlMode(_0x1293a5,_0x3bbacb){const _0x45b35c=a193_0x26fece;if(_0x3bbacb?.[_0x45b35c(0x93)])return _0x3bbacb['mode'];return detectSqlMode(_0x1293a5);}export function resolveSqlFileName(_0x5604bd,_0x81bd9d,_0x1a2007){const _0x552caf=a193_0x26fece;if(_0x1a2007?.[_0x552caf(0xb2)])return _0x1a2007[_0x552caf(0xb2)];if(_0x1a2007?.[_0x552caf(0x88)]||_0x1a2007?.['dbName'])return buildSqlRelativePath(_0x5604bd,_0x1a2007?.[_0x552caf(0x88)],_0x1a2007?.[_0x552caf(0xa9)],resolveSqlMode(_0x81bd9d,_0x1a2007),_0x1a2007?.['dbId']);return buildDefaultSqlFileName(_0x5604bd,resolveSqlMode(_0x81bd9d,_0x1a2007));}export function resolveSqlLocalDir(_0x3860cf,_0xdc3419){return join(_0x3860cf,SQL_LOCAL_REL_DIR,_0xdc3419);}export async function confirmForceOverwrite(_0x1787b9){const _0x1f14a8=a193_0x26fece,_0x44691=createInterface({'input':process[_0x1f14a8(0xa4)],'output':process[_0x1f14a8(0x90)]}),_0x48a9c1=await new Promise(_0x2a8748=>{_0x44691['question'](_0x1787b9+'\x20[y/N]\x20',_0x2a8748);});return _0x44691[_0x1f14a8(0x95)](),['y',_0x1f14a8(0xac)][_0x1f14a8(0x96)](_0x48a9c1[_0x1f14a8(0x89)]()[_0x1f14a8(0xa0)]());}export function findSqlLockScope(_0x29cd47,_0x11b819){const _0x164a87=a193_0x26fece;return _0x29cd47[_0x164a87(0xa5)][_0x11b819];}function buildMetadataHeaderLines(_0x38b4a5,_0xf5cda1){const _0x582b87=a193_0x26fece,_0x3d2225=[['sqlCode',_0x38b4a5[_0x582b87(0xb0)]],[_0x582b87(0x88),_0x38b4a5[_0x582b87(0x88)]],['dbId',_0x38b4a5[_0x582b87(0x99)]],[_0x582b87(0xa9),_0x38b4a5[_0x582b87(0xa9)]],[_0x582b87(0x93),_0x38b4a5['mode']],[_0x582b87(0x9d),_0x38b4a5[_0x582b87(0x9d)]],[_0x582b87(0x9f),_0x38b4a5['description']]];if(_0xf5cda1==='mybatisXml')return _0x3d2225[_0x582b87(0x9e)](([,_0x2d6181])=>_0x2d6181!==undefined&&_0x2d6181!==null&&String(_0x2d6181)[_0x582b87(0x89)]()!=='')[_0x582b87(0xad)](([_0x6967aa,_0x4cd243])=>_0x582b87(0x98)+_0x6967aa+':\x20'+String(_0x4cd243)+_0x582b87(0x8d));return _0x3d2225[_0x582b87(0x9e)](([,_0x4861a7])=>_0x4861a7!==undefined&&_0x4861a7!==null&&String(_0x4861a7)['trim']()!=='')['map'](([_0x20845b,_0x36afa9])=>_0x582b87(0xaa)+_0x20845b+':\x20'+String(_0x36afa9));}function a193_0x1f8d(){const _0x3ad1a=['1242969ZmAYWC','path','sqlName','trim','76536fSMjwb','.rabetbase/sql','1DMhYFa','\x20-->','54878VkmqdJ','join','stderr','5WyVlHx','mybatisXml','mode','sqlConfig','close','includes','version','<!--\x20@lovrabet.','dbId','sqlContent','split','3078306anHoZv','syncedAt','filter','description','toLowerCase','sqls','test','22098070iMccvt','stdin','apps','3164358TzFsuH','endsWith','length','dbName','--\x20@lovrabet.','2060008mtEsYy','yes','map','sqlRoot','511Zfqyto','sqlCode'];a193_0x1f8d=function(){return _0x3ad1a;};return a193_0x1f8d();}
@@ -1 +1 @@
1
- function a193_0x2009(){const _0x2769fb=['All\x20SQL\x20queries\x20are\x20in\x20sync.','7227783oCqzCi','length','278439MwJXWt','sql','sqlCode','push','\x20unchanged','read','hash','sqlName','\x20added,\x20','boolean','relativePath','33555CkQQYm','filePath','7396014EqozTt','\x20remote-only','path','lockFilePath','sqls','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','has','paging','\x20missing,\x20','164wvWWcX','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','bool','tableData','map','2431850DKSZdl','3580176VmYEvu','remote','\x20modified,\x20','96YWTVPV','status','8aTMYVF','appCode','541016QTtlpH','lockKey'];a193_0x2009=function(){return _0x2769fb;};return a193_0x2009();}const a193_0x3c4370=a193_0x2b4d;function a193_0x2b4d(_0x4dc138,_0x2407b8){_0x4dc138=_0x4dc138-0x112;const _0x2009c6=a193_0x2009();let _0x2b4d47=_0x2009c6[_0x4dc138];return _0x2b4d47;}(function(_0x342c86,_0x3ae24d){const _0x3ebf24=a193_0x2b4d,_0x5893ba=_0x342c86();while(!![]){try{const _0x302418=parseInt(_0x3ebf24(0x12b))/0x1*(-parseInt(_0x3ebf24(0x124))/0x2)+-parseInt(_0x3ebf24(0x11f))/0x3+parseInt(_0x3ebf24(0x119))/0x4*(-parseInt(_0x3ebf24(0x136))/0x5)+parseInt(_0x3ebf24(0x138))/0x6+-parseInt(_0x3ebf24(0x126))/0x7*(-parseInt(_0x3ebf24(0x122))/0x8)+parseInt(_0x3ebf24(0x129))/0x9+parseInt(_0x3ebf24(0x11e))/0xa;if(_0x302418===_0x3ae24d)break;else _0x5893ba['push'](_0x5893ba['shift']());}catch(_0x13727a){_0x5893ba['push'](_0x5893ba['shift']());}}}(a193_0x2009,0x985e2));import{listSqlQueries}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;async function fetchAllSqlCodes(_0x27c3d2){const _0x108af7=a193_0x2b4d,_0x9aba9e=[];let _0x3d032b=0x1;while(!![]){const _0x3b1ada=await listSqlQueries(_0x27c3d2,{'currentPage':_0x3d032b,'pageSize':PAGE_SIZE}),_0x117fd8=_0x3b1ada[_0x108af7(0x11c)]??[];_0x9aba9e[_0x108af7(0x12e)](..._0x117fd8[_0x108af7(0x11d)](_0x1efa79=>_0x1efa79[_0x108af7(0x12d)]));if(_0x117fd8[_0x108af7(0x12a)]===0x0)break;const _0xa0d567=_0x3b1ada[_0x108af7(0x117)]?.['totalCount'];if(_0xa0d567!=null?_0x9aba9e['length']>=_0xa0d567:_0x117fd8[_0x108af7(0x12a)]<PAGE_SIZE)break;_0x3d032b++;}return _0x9aba9e;}export const sqlStatus={'service':a193_0x3c4370(0x12c),'command':a193_0x3c4370(0x123),'description':a193_0x3c4370(0x115),'risk':a193_0x3c4370(0x130),'flags':[{'name':a193_0x3c4370(0x120),'type':a193_0x3c4370(0x134),'description':a193_0x3c4370(0x11a)}],async 'execute'(_0x1c3b37){const _0x59c089=a193_0x3c4370,_0x2074a5=loadSqlProjectConfig(_0x1c3b37[_0x59c089(0x125)]),_0x20c267=await readSqlLockFile(_0x2074a5[_0x59c089(0x113)]),{appLock:_0x291469}=ensureSqlLockScope(_0x20c267??createEmptySqlLock(),_0x2074a5['appCode'],_0x2074a5['sqlRoot'],'status'),_0x6a8d7e=await scanLocalSqlQueries(_0x2074a5),_0x570288=[],_0x350770=[],_0x169f78=[],_0xfe461f=[],_0x5dc51a=new Set(_0x6a8d7e[_0x59c089(0x11d)](_0x4d426b=>_0x4d426b['lockKey']));for(const _0x28be72 of _0x6a8d7e){const _0x2bef82=await computeSqlFileHash(_0x28be72[_0x59c089(0x137)]),_0x5e424d=_0x291469['sqls'][_0x28be72[_0x59c089(0x127)]],_0x5b1f94=!!_0x5e424d&&_0x5e424d[_0x59c089(0x112)]!==_0x28be72[_0x59c089(0x135)],_0x2af518=!!_0x5e424d&&!!_0x28be72[_0x59c089(0x132)]&&_0x5e424d['sqlName']!==_0x28be72['sqlName'];if(!_0x5e424d)_0x570288[_0x59c089(0x12e)](_0x28be72[_0x59c089(0x127)]);else _0x5e424d[_0x59c089(0x131)]!==_0x2bef82||_0x5b1f94||_0x2af518?_0x350770[_0x59c089(0x12e)](_0x28be72[_0x59c089(0x127)]):_0x169f78[_0x59c089(0x12e)](_0x28be72[_0x59c089(0x127)]);}for(const _0x1d7725 of Object['keys'](_0x291469['sqls'])){!_0x5dc51a[_0x59c089(0x116)](_0x1d7725)&&_0xfe461f[_0x59c089(0x12e)](_0x1d7725);}const _0x232ef5=[];if(_0x1c3b37[_0x59c089(0x11b)](_0x59c089(0x120))){const _0x21a595=await fetchAllSqlCodes(_0x1c3b37[_0x59c089(0x125)]);for(const _0x20a53a of _0x21a595){!_0x5dc51a[_0x59c089(0x116)](_0x20a53a)&&!_0x291469[_0x59c089(0x114)][_0x20a53a]&&_0x232ef5[_0x59c089(0x12e)](_0x20a53a);}}const _0x3baf95=_0x570288[_0x59c089(0x12a)]===0x0&&_0x350770[_0x59c089(0x12a)]===0x0&&_0xfe461f[_0x59c089(0x12a)]===0x0&&_0x232ef5['length']===0x0;return{'ok':!![],'data':{'added':_0x570288,'modified':_0x350770,'missing':_0xfe461f,'unchanged':_0x169f78,'remoteOnly':_0x232ef5},'message':_0x3baf95?_0x59c089(0x128):_0x570288[_0x59c089(0x12a)]+_0x59c089(0x133)+_0x350770[_0x59c089(0x12a)]+_0x59c089(0x121)+_0xfe461f[_0x59c089(0x12a)]+_0x59c089(0x118)+_0x169f78[_0x59c089(0x12a)]+_0x59c089(0x12f)+(_0x232ef5['length']>0x0?',\x20'+_0x232ef5[_0x59c089(0x12a)]+_0x59c089(0x139):'')};}};
1
+ const a194_0x3687e7=a194_0x4bc0;(function(_0x2c7d2c,_0x25fdb0){const _0xb4a39=a194_0x4bc0,_0x4028cc=_0x2c7d2c();while(!![]){try{const _0x310c35=parseInt(_0xb4a39(0x141))/0x1*(-parseInt(_0xb4a39(0x137))/0x2)+parseInt(_0xb4a39(0x150))/0x3+parseInt(_0xb4a39(0x149))/0x4*(-parseInt(_0xb4a39(0x14a))/0x5)+-parseInt(_0xb4a39(0x14c))/0x6*(-parseInt(_0xb4a39(0x136))/0x7)+-parseInt(_0xb4a39(0x13b))/0x8*(-parseInt(_0xb4a39(0x14d))/0x9)+parseInt(_0xb4a39(0x145))/0xa+-parseInt(_0xb4a39(0x139))/0xb;if(_0x310c35===_0x25fdb0)break;else _0x4028cc['push'](_0x4028cc['shift']());}catch(_0x54380e){_0x4028cc['push'](_0x4028cc['shift']());}}}(a194_0x1f6f,0xcb0c1));import{listSqlQueries}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';function a194_0x4bc0(_0x5621b1,_0x493424){_0x5621b1=_0x5621b1-0x136;const _0x1f6fea=a194_0x1f6f();let _0x4bc0ce=_0x1f6fea[_0x5621b1];return _0x4bc0ce;}import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;async function fetchAllSqlCodes(_0xa6f0a6){const _0x135d0e=a194_0x4bc0,_0x2d9821=[];let _0x26f72d=0x1;while(!![]){const _0x211898=await listSqlQueries(_0xa6f0a6,{'currentPage':_0x26f72d,'pageSize':PAGE_SIZE}),_0x3d857b=_0x211898['tableData']??[];_0x2d9821[_0x135d0e(0x140)](..._0x3d857b[_0x135d0e(0x143)](_0x1e46ea=>_0x1e46ea['sqlCode']));if(_0x3d857b[_0x135d0e(0x13a)]===0x0)break;const _0x1a35e6=_0x211898['paging']?.[_0x135d0e(0x13f)];if(_0x1a35e6!=null?_0x2d9821[_0x135d0e(0x13a)]>=_0x1a35e6:_0x3d857b['length']<PAGE_SIZE)break;_0x26f72d++;}return _0x2d9821;}export const sqlStatus={'service':'sql','command':a194_0x3687e7(0x13c),'description':'Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','risk':a194_0x3687e7(0x153),'flags':[{'name':'remote','type':a194_0x3687e7(0x14e),'description':a194_0x3687e7(0x148)}],async 'execute'(_0x58dec4){const _0x3436c0=a194_0x3687e7,_0x50bd76=loadSqlProjectConfig(_0x58dec4[_0x3436c0(0x13e)]),_0x5b81df=await readSqlLockFile(_0x50bd76[_0x3436c0(0x14f)]),{appLock:_0x5bb1c1}=ensureSqlLockScope(_0x5b81df??createEmptySqlLock(),_0x50bd76[_0x3436c0(0x13e)],_0x50bd76[_0x3436c0(0x144)],'status'),_0xdfd14b=await scanLocalSqlQueries(_0x50bd76),_0x4f737b=[],_0x222468=[],_0x5be02a=[],_0x42a91f=[],_0x4a3b35=new Set(_0xdfd14b[_0x3436c0(0x143)](_0x24cf70=>_0x24cf70[_0x3436c0(0x147)]));for(const _0x169a2b of _0xdfd14b){const _0x5b60c8=await computeSqlFileHash(_0x169a2b['filePath']),_0x550c68=_0x5bb1c1['sqls'][_0x169a2b[_0x3436c0(0x147)]],_0x1abd31=!!_0x550c68&&_0x550c68['path']!==_0x169a2b['relativePath'],_0x1d1236=!!_0x550c68&&!!_0x169a2b[_0x3436c0(0x13d)]&&_0x550c68[_0x3436c0(0x13d)]!==_0x169a2b['sqlName'];if(!_0x550c68)_0x4f737b[_0x3436c0(0x140)](_0x169a2b[_0x3436c0(0x147)]);else _0x550c68['hash']!==_0x5b60c8||_0x1abd31||_0x1d1236?_0x222468[_0x3436c0(0x140)](_0x169a2b[_0x3436c0(0x147)]):_0x5be02a[_0x3436c0(0x140)](_0x169a2b[_0x3436c0(0x147)]);}for(const _0x20325d of Object[_0x3436c0(0x142)](_0x5bb1c1[_0x3436c0(0x138)])){!_0x4a3b35[_0x3436c0(0x146)](_0x20325d)&&_0x42a91f[_0x3436c0(0x140)](_0x20325d);}const _0x1b0c86=[];if(_0x58dec4[_0x3436c0(0x152)](_0x3436c0(0x14b))){const _0x3b6e74=await fetchAllSqlCodes(_0x58dec4[_0x3436c0(0x13e)]);for(const _0x28b8d9 of _0x3b6e74){!_0x4a3b35[_0x3436c0(0x146)](_0x28b8d9)&&!_0x5bb1c1[_0x3436c0(0x138)][_0x28b8d9]&&_0x1b0c86[_0x3436c0(0x140)](_0x28b8d9);}}const _0x3489ab=_0x4f737b[_0x3436c0(0x13a)]===0x0&&_0x222468['length']===0x0&&_0x42a91f[_0x3436c0(0x13a)]===0x0&&_0x1b0c86[_0x3436c0(0x13a)]===0x0;return{'ok':!![],'data':{'added':_0x4f737b,'modified':_0x222468,'missing':_0x42a91f,'unchanged':_0x5be02a,'remoteOnly':_0x1b0c86},'message':_0x3489ab?'All\x20SQL\x20queries\x20are\x20in\x20sync.':_0x4f737b[_0x3436c0(0x13a)]+_0x3436c0(0x154)+_0x222468[_0x3436c0(0x13a)]+'\x20modified,\x20'+_0x42a91f[_0x3436c0(0x13a)]+'\x20missing,\x20'+_0x5be02a['length']+'\x20unchanged'+(_0x1b0c86[_0x3436c0(0x13a)]>0x0?',\x20'+_0x1b0c86[_0x3436c0(0x13a)]+_0x3436c0(0x151):'')};}};function a194_0x1f6f(){const _0x373ca3=['read','\x20added,\x20','7kcBLhI','947038eiDmUP','sqls','27984374zsVfNB','length','24uZBOTm','status','sqlName','appCode','totalCount','push','2kbmnbt','keys','map','sqlRoot','16074460fVsnut','has','lockKey','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','28YyFehE','781790CoOaHF','remote','9212730geWCbT','2439189DiVRLU','boolean','lockFilePath','4383885FGkotJ','\x20remote-only','bool'];a194_0x1f6f=function(){return _0x373ca3;};return a194_0x1f6f();}
@@ -1 +1 @@
1
- const a194_0x208272=a194_0x3623;(function(_0x128c54,_0x112c81){const _0x55114=a194_0x3623,_0x1ab2d6=_0x128c54();while(!![]){try{const _0x544a3b=-parseInt(_0x55114(0x130))/0x1*(parseInt(_0x55114(0x139))/0x2)+-parseInt(_0x55114(0x123))/0x3+parseInt(_0x55114(0x113))/0x4+parseInt(_0x55114(0x11c))/0x5+parseInt(_0x55114(0x12a))/0x6*(-parseInt(_0x55114(0x11d))/0x7)+parseInt(_0x55114(0x142))/0x8*(-parseInt(_0x55114(0x10c))/0x9)+parseInt(_0x55114(0x128))/0xa;if(_0x544a3b===_0x112c81)break;else _0x1ab2d6['push'](_0x1ab2d6['shift']());}catch(_0x183074){_0x1ab2d6['push'](_0x1ab2d6['shift']());}}}(a194_0x387a,0x58e25));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':a194_0x208272(0x115),'command':a194_0x208272(0x12f),'description':a194_0x208272(0x140),'risk':a194_0x208272(0x14b),'flags':[{'name':a194_0x208272(0x13e),'type':a194_0x208272(0x125),'description':'Path\x20to\x20the\x20SQL\x20file\x20to\x20validate'},{'name':a194_0x208272(0x115),'type':a194_0x208272(0x125),'description':a194_0x208272(0x13a)},{'name':a194_0x208272(0x131),'type':a194_0x208272(0x125),'description':a194_0x208272(0x12d)},{'name':'check-indexes','type':a194_0x208272(0x11e),'description':a194_0x208272(0x141)}],async 'execute'(_0x3c96ec){const _0x4df205=a194_0x208272,_0xd39c9=_0x3c96ec['str'](_0x4df205(0x13e)),_0x254909=_0x3c96ec['str'](_0x4df205(0x115)),_0x55697f=_0x3c96ec[_0x4df205(0x10f)](_0x4df205(0x131)),_0x882353=_0x3c96ec['bool'](_0x4df205(0x120));if(!_0xd39c9&&!_0x254909)throw CliErrors['flagMissing'](_0x4df205(0x13e),_0x4df205(0x13f));if(_0x882353&&!_0x55697f)throw CliErrors['validation'](_0x4df205(0x10b));let _0x10c97f;if(_0xd39c9){const _0x388c5b=resolve(process[_0x4df205(0x10d)](),_0xd39c9);if(!existsSync(_0x388c5b))throw CliErrors[_0x4df205(0x147)](_0x4df205(0x146)+_0x388c5b);_0x10c97f=readFileSync(_0x388c5b,'utf-8');}else _0x10c97f=_0x254909;const _0x272ff0=validateSql(_0x10c97f),_0x19084d={'valid':_0x272ff0[_0x4df205(0x109)],'sqlType':_0x272ff0[_0x4df205(0x135)][_0x4df205(0x11b)],'isSelectOnly':_0x272ff0[_0x4df205(0x135)]['isSelectOnly'],'isDangerous':_0x272ff0[_0x4df205(0x135)][_0x4df205(0x117)],'tables':_0x272ff0['tables'],'parameters':_0x272ff0[_0x4df205(0x121)],'message':_0x272ff0[_0x4df205(0x148)]};_0x272ff0[_0x4df205(0x135)][_0x4df205(0x126)]&&(_0x19084d[_0x4df205(0x126)]=_0x272ff0['sqlType'][_0x4df205(0x126)]);if(_0x55697f&&_0x272ff0[_0x4df205(0x109)]){const _0x559a58=_0x55697f[_0x4df205(0x122)](',')['map'](_0x5aae24=>_0x5aae24[_0x4df205(0x110)]())['filter'](Boolean),_0x6c2035=[],_0x549cf4=[],_0x50c918=filterDbTableBackedDatasets(await listDatasets(_0x3c96ec['appCode'])),_0x3aefbb=new Map(_0x50c918[_0x4df205(0x111)](_0xf4b94c=>[_0xf4b94c[_0x4df205(0x12c)]?.['tableName']?.[_0x4df205(0x138)](),_0xf4b94c]));for(const _0x4a054f of _0x272ff0[_0x4df205(0x133)]){const _0x441eb7=_0x3aefbb[_0x4df205(0x136)](_0x4a054f[_0x4df205(0x138)]());!_0x441eb7&&_0x6c2035[_0x4df205(0x129)](_0x4df205(0x132)+_0x4a054f+_0x4df205(0x11a));}for(const _0x42251c of _0x559a58){let _0xe5ca47;try{_0xe5ca47=await getDatasetDetail(_0x42251c);}catch{_0x6c2035[_0x4df205(0x129)](_0x4df205(0x11f)+_0x42251c+_0x4df205(0x118));continue;}assertDatasetIsDbTableBacked(_0xe5ca47,_0x4df205(0x116));const _0x561320=Array[_0x4df205(0x119)](_0xe5ca47[_0x4df205(0x13c)])?_0xe5ca47[_0x4df205(0x13c)]:[],_0x5a3baf=new Set(_0x561320[_0x4df205(0x111)](_0x2d288b=>_0x2d288b[_0x4df205(0x124)]?.['toLowerCase']())),_0x4e4c29=_0xe5ca47[_0x4df205(0x12c)]?.[_0x4df205(0x137)]||_0xe5ca47[_0x4df205(0x137)]||_0x42251c;_0x19084d['schema:'+_0x4e4c29]={'code':_0x42251c,'tableName':_0x4e4c29,'fieldCount':_0x5a3baf[_0x4df205(0x107)],'fields':Array[_0x4df205(0x10a)](_0x5a3baf)};if(_0x882353){const _0x2980a3=normalizeDatasetIndexes(_0xe5ca47);_0x549cf4[_0x4df205(0x129)]({'tableName':_0x4e4c29,..._0x2980a3});}}_0x6c2035[_0x4df205(0x134)]>0x0&&(_0x19084d[_0x4df205(0x149)]=_0x6c2035),_0x882353&&(_0x19084d[_0x4df205(0x12b)]=auditSqlJoinIndexes(_0x10c97f,_0x549cf4));}return{'ok':_0x272ff0[_0x4df205(0x109)],'data':_0x19084d,'message':_0x272ff0[_0x4df205(0x148)]};}};function a194_0x3623(_0x9e1e71,_0x1bc3d7){_0x9e1e71=_0x9e1e71-0x107;const _0x387ab2=a194_0x387a();let _0x3623fe=_0x387ab2[_0x9e1e71];return _0x3623fe;}function a194_0x387a(){const _0x5a6b87=['string','reason','filter','15511870eBzVgB','push','54OCOYds','joinAudit','dbtableConfig','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','columns','validate','643623zecwgw','schemas','Table\x20\x22','tables','length','sqlType','get','tableName','toLowerCase','2ICgpcw','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','find','fields','flatMap','file','Provide\x20--file\x20or\x20--sql','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','Audit\x20top-level\x20JOIN\x20equality\x20predicates\x20against\x20dataset\x20index\x20metadata','126544uyqKLY','index_type','unshift','indexName','File\x20not\x20found:\x20','validation','message','schemaWarnings','pkField','read','primary','size','index_name','valid','from','--check-indexes\x20requires\x20--schemas.','72muzkPa','cwd','index_columns','str','trim','map','indexes','1139212SYbBIl','dataset','sql','SQL\x20schema\x20validation','isDangerous','\x22\x20not\x20found\x20or\x20not\x20accessible','isArray','\x22\x20not\x20found\x20in\x20any\x20dataset','type','1516415mKRwVE','558803UDBkOo','boolean','Dataset\x20\x22','check-indexes','parameters','split','859728cQcHCh','name'];a194_0x387a=function(){return _0x5a6b87;};return a194_0x387a();}function normalizeDatasetIndexes(_0x124e00){const _0x45fab3=a194_0x208272,_0x19738e=Array[_0x45fab3(0x119)](_0x124e00?.['dataset']?.[_0x45fab3(0x112)])?_0x124e00[_0x45fab3(0x114)][_0x45fab3(0x112)]:Array[_0x45fab3(0x119)](_0x124e00?.[_0x45fab3(0x112)])?_0x124e00[_0x45fab3(0x112)]:[],_0xc33789=_0x19738e[_0x45fab3(0x13d)](_0x52cefe=>{const _0xe24209=_0x45fab3,_0x1da056=Array[_0xe24209(0x119)](_0x52cefe?.[_0xe24209(0x10e)])?_0x52cefe[_0xe24209(0x10e)]:Array[_0xe24209(0x119)](_0x52cefe?.['columnNames'])?_0x52cefe['columnNames']:Array[_0xe24209(0x119)](_0x52cefe?.[_0xe24209(0x12e)])?_0x52cefe[_0xe24209(0x12e)]:[],_0x57bc4e=_0x1da056['filter'](_0x5ba7e1=>typeof _0x5ba7e1===_0xe24209(0x125))[_0xe24209(0x111)](_0x238d40=>_0x238d40[_0xe24209(0x110)]())[_0xe24209(0x127)](Boolean);if(_0x57bc4e[_0xe24209(0x134)]===0x0)return[];const _0x368df0=[_0x52cefe?.[_0xe24209(0x145)],_0x52cefe?.[_0xe24209(0x108)],_0x52cefe?.[_0xe24209(0x124)]][_0xe24209(0x13b)](_0x50b820=>typeof _0x50b820===_0xe24209(0x125)&&_0x50b820['trim']()),_0x51869c=[_0x52cefe?.[_0xe24209(0x143)],_0x52cefe?.['type']][_0xe24209(0x13b)](_0x2d3c17=>typeof _0x2d3c17===_0xe24209(0x125)&&_0x2d3c17[_0xe24209(0x110)]());return[{..._0x368df0?{'name':_0x368df0[_0xe24209(0x110)]()}:{},..._0x51869c?{'type':_0x51869c[_0xe24209(0x110)]()}:{},'columns':_0x57bc4e}];}),_0x121e0a=[..._0xc33789],_0x3fda42=typeof _0x124e00?.[_0x45fab3(0x12c)]?.[_0x45fab3(0x14a)]===_0x45fab3(0x125)?_0x124e00[_0x45fab3(0x12c)][_0x45fab3(0x14a)][_0x45fab3(0x122)](',')[_0x45fab3(0x111)](_0x506fa1=>_0x506fa1['trim']())['filter'](Boolean):[];return _0x3fda42[_0x45fab3(0x134)]>0x0&&_0x121e0a[_0x45fab3(0x144)]({'type':_0x45fab3(0x14c),'columns':_0x3fda42}),{'indexes':_0x121e0a,'metadataAvailable':_0xc33789[_0x45fab3(0x134)]>0x0};}
1
+ const a195_0x2b7273=a195_0x589c;(function(_0x17203e,_0x48e8c9){const _0xcc40f2=a195_0x589c,_0x1db952=_0x17203e();while(!![]){try{const _0x1e19ae=parseInt(_0xcc40f2(0x1a3))/0x1*(-parseInt(_0xcc40f2(0x1c3))/0x2)+-parseInt(_0xcc40f2(0x19d))/0x3*(-parseInt(_0xcc40f2(0x1c8))/0x4)+-parseInt(_0xcc40f2(0x1a7))/0x5+parseInt(_0xcc40f2(0x1ca))/0x6*(parseInt(_0xcc40f2(0x1ac))/0x7)+-parseInt(_0xcc40f2(0x1d3))/0x8*(-parseInt(_0xcc40f2(0x1ad))/0x9)+-parseInt(_0xcc40f2(0x1d6))/0xa+-parseInt(_0xcc40f2(0x1bc))/0xb*(-parseInt(_0xcc40f2(0x1e1))/0xc);if(_0x1e19ae===_0x48e8c9)break;else _0x1db952['push'](_0x1db952['shift']());}catch(_0x543028){_0x1db952['push'](_0x1db952['shift']());}}}(a195_0x5853,0x67b1b));import{readFileSync,existsSync}from'node:fs';function a195_0x589c(_0x4a3cf7,_0x37086b){_0x4a3cf7=_0x4a3cf7-0x19d;const _0x5853fa=a195_0x5853();let _0x589c27=_0x5853fa[_0x4a3cf7];return _0x589c27;}import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';import{auditSqlJoinIndexes}from'../../core/sql-index-auditor.js';function a195_0x5853(){const _0x94f6d9=['2mqWxJC','columns','flagMissing','indexName','reason','20FpdvOQ','index_name','174OCbxvB','from','\x22\x20not\x20found\x20or\x20not\x20accessible','length','file','dbtableConfig','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','name','indexes','24SSaJZK','Table\x20\x22','message','1150100wGEBCi','schema:','isArray','tableName','sql','utf-8','isDangerous','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','unshift','index_columns','string','16368wVLoyM','Audit\x20top-level\x20JOIN\x20equality\x20predicates\x20against\x20dataset\x20index\x20metadata','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','331122AhumHl','filter','trim','--check-indexes\x20requires\x20--schemas.','schemas','fields','534901wApepu','str','columnNames','Provide\x20--file\x20or\x20--sql','89325CVKFZp','check-indexes','appCode','valid','dataset','88529kTsyYv','484794PvPQzF','validation','validate','push','map','toLowerCase','parameters','flatMap','bool','pkField','isSelectOnly','SQL\x20schema\x20validation','split','boolean','Dataset\x20\x22','99ZWwDpg','cwd','File\x20not\x20found:\x20','type','schemaWarnings','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','sqlType'];a195_0x5853=function(){return _0x94f6d9;};return a195_0x5853();}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':a195_0x2b7273(0x1da),'command':a195_0x2b7273(0x1af),'description':a195_0x2b7273(0x1d0),'risk':'read','flags':[{'name':a195_0x2b7273(0x1ce),'type':a195_0x2b7273(0x1e0),'description':a195_0x2b7273(0x1c1)},{'name':a195_0x2b7273(0x1da),'type':a195_0x2b7273(0x1e0),'description':a195_0x2b7273(0x1dd)},{'name':a195_0x2b7273(0x1a1),'type':a195_0x2b7273(0x1e0),'description':a195_0x2b7273(0x1e3)},{'name':'check-indexes','type':a195_0x2b7273(0x1ba),'description':a195_0x2b7273(0x1e2)}],async 'execute'(_0x5aa0f3){const _0xdeddc4=a195_0x2b7273,_0x4613c3=_0x5aa0f3['str'](_0xdeddc4(0x1ce)),_0x102c38=_0x5aa0f3['str']('sql'),_0x3b3bdd=_0x5aa0f3[_0xdeddc4(0x1a4)](_0xdeddc4(0x1a1)),_0x3fd671=_0x5aa0f3[_0xdeddc4(0x1b5)](_0xdeddc4(0x1a8));if(!_0x4613c3&&!_0x102c38)throw CliErrors[_0xdeddc4(0x1c5)]('file',_0xdeddc4(0x1a6));if(_0x3fd671&&!_0x3b3bdd)throw CliErrors[_0xdeddc4(0x1ae)](_0xdeddc4(0x1a0));let _0x5ee648;if(_0x4613c3){const _0x336bec=resolve(process[_0xdeddc4(0x1bd)](),_0x4613c3);if(!existsSync(_0x336bec))throw CliErrors['validation'](_0xdeddc4(0x1be)+_0x336bec);_0x5ee648=readFileSync(_0x336bec,_0xdeddc4(0x1db));}else _0x5ee648=_0x102c38;const _0xe9390a=validateSql(_0x5ee648),_0x527fdb={'valid':_0xe9390a[_0xdeddc4(0x1aa)],'sqlType':_0xe9390a[_0xdeddc4(0x1c2)][_0xdeddc4(0x1bf)],'isSelectOnly':_0xe9390a['sqlType'][_0xdeddc4(0x1b7)],'isDangerous':_0xe9390a['sqlType'][_0xdeddc4(0x1dc)],'tables':_0xe9390a['tables'],'parameters':_0xe9390a[_0xdeddc4(0x1b3)],'message':_0xe9390a[_0xdeddc4(0x1d5)]};_0xe9390a['sqlType'][_0xdeddc4(0x1c7)]&&(_0x527fdb[_0xdeddc4(0x1c7)]=_0xe9390a['sqlType'][_0xdeddc4(0x1c7)]);if(_0x3b3bdd&&_0xe9390a[_0xdeddc4(0x1aa)]){const _0x4f0017=_0x3b3bdd[_0xdeddc4(0x1b9)](',')[_0xdeddc4(0x1b1)](_0x41a729=>_0x41a729[_0xdeddc4(0x19f)]())[_0xdeddc4(0x19e)](Boolean),_0x1471ce=[],_0x9c97bb=[],_0x2e6e6e=filterDbTableBackedDatasets(await listDatasets(_0x5aa0f3[_0xdeddc4(0x1a9)])),_0x231939=new Map(_0x2e6e6e[_0xdeddc4(0x1b1)](_0x19ac9b=>[_0x19ac9b[_0xdeddc4(0x1cf)]?.[_0xdeddc4(0x1d9)]?.[_0xdeddc4(0x1b2)](),_0x19ac9b]));for(const _0x35c837 of _0xe9390a['tables']){const _0xbf6188=_0x231939['get'](_0x35c837[_0xdeddc4(0x1b2)]());!_0xbf6188&&_0x1471ce['push'](_0xdeddc4(0x1d4)+_0x35c837+'\x22\x20not\x20found\x20in\x20any\x20dataset');}for(const _0x3479a6 of _0x4f0017){let _0x40111c;try{_0x40111c=await getDatasetDetail(_0x3479a6);}catch{_0x1471ce[_0xdeddc4(0x1b0)](_0xdeddc4(0x1bb)+_0x3479a6+_0xdeddc4(0x1cc));continue;}assertDatasetIsDbTableBacked(_0x40111c,_0xdeddc4(0x1b8));const _0x19ff9d=Array[_0xdeddc4(0x1d8)](_0x40111c['fields'])?_0x40111c[_0xdeddc4(0x1a2)]:[],_0x323daa=new Set(_0x19ff9d[_0xdeddc4(0x1b1)](_0x514f8a=>_0x514f8a['name']?.[_0xdeddc4(0x1b2)]())),_0xd0a5d4=_0x40111c['dbtableConfig']?.[_0xdeddc4(0x1d9)]||_0x40111c[_0xdeddc4(0x1d9)]||_0x3479a6;_0x527fdb[_0xdeddc4(0x1d7)+_0xd0a5d4]={'code':_0x3479a6,'tableName':_0xd0a5d4,'fieldCount':_0x323daa['size'],'fields':Array[_0xdeddc4(0x1cb)](_0x323daa)};if(_0x3fd671){const _0x4953b1=normalizeDatasetIndexes(_0x40111c);_0x9c97bb[_0xdeddc4(0x1b0)]({'tableName':_0xd0a5d4,..._0x4953b1});}}_0x1471ce[_0xdeddc4(0x1cd)]>0x0&&(_0x527fdb[_0xdeddc4(0x1c0)]=_0x1471ce),_0x3fd671&&(_0x527fdb['joinAudit']=auditSqlJoinIndexes(_0x5ee648,_0x9c97bb));}return{'ok':_0xe9390a[_0xdeddc4(0x1aa)],'data':_0x527fdb,'message':_0xe9390a[_0xdeddc4(0x1d5)]};}};function normalizeDatasetIndexes(_0x5e99a9){const _0x148651=a195_0x2b7273,_0x492228=Array['isArray'](_0x5e99a9?.[_0x148651(0x1ab)]?.[_0x148651(0x1d2)])?_0x5e99a9[_0x148651(0x1ab)][_0x148651(0x1d2)]:Array[_0x148651(0x1d8)](_0x5e99a9?.[_0x148651(0x1d2)])?_0x5e99a9['indexes']:[],_0x16ff12=_0x492228[_0x148651(0x1b4)](_0x48333a=>{const _0x4d9b27=_0x148651,_0x419720=Array['isArray'](_0x48333a?.[_0x4d9b27(0x1df)])?_0x48333a['index_columns']:Array[_0x4d9b27(0x1d8)](_0x48333a?.[_0x4d9b27(0x1a5)])?_0x48333a[_0x4d9b27(0x1a5)]:Array[_0x4d9b27(0x1d8)](_0x48333a?.['columns'])?_0x48333a[_0x4d9b27(0x1c4)]:[],_0xa32b98=_0x419720[_0x4d9b27(0x19e)](_0x2dcb26=>typeof _0x2dcb26===_0x4d9b27(0x1e0))[_0x4d9b27(0x1b1)](_0xd6aecd=>_0xd6aecd[_0x4d9b27(0x19f)]())[_0x4d9b27(0x19e)](Boolean);if(_0xa32b98[_0x4d9b27(0x1cd)]===0x0)return[];const _0x3eebfb=[_0x48333a?.[_0x4d9b27(0x1c6)],_0x48333a?.[_0x4d9b27(0x1c9)],_0x48333a?.[_0x4d9b27(0x1d1)]]['find'](_0x2857ea=>typeof _0x2857ea===_0x4d9b27(0x1e0)&&_0x2857ea[_0x4d9b27(0x19f)]()),_0x5c9401=[_0x48333a?.['index_type'],_0x48333a?.['type']]['find'](_0x21a61f=>typeof _0x21a61f===_0x4d9b27(0x1e0)&&_0x21a61f[_0x4d9b27(0x19f)]());return[{..._0x3eebfb?{'name':_0x3eebfb[_0x4d9b27(0x19f)]()}:{},..._0x5c9401?{'type':_0x5c9401[_0x4d9b27(0x19f)]()}:{},'columns':_0xa32b98}];}),_0x147988=[..._0x16ff12],_0x123156=typeof _0x5e99a9?.[_0x148651(0x1cf)]?.[_0x148651(0x1b6)]===_0x148651(0x1e0)?_0x5e99a9[_0x148651(0x1cf)]['pkField']['split'](',')[_0x148651(0x1b1)](_0x37fe35=>_0x37fe35[_0x148651(0x19f)]())[_0x148651(0x19e)](Boolean):[];return _0x123156[_0x148651(0x1cd)]>0x0&&_0x147988[_0x148651(0x1de)]({'type':'primary','columns':_0x123156}),{'indexes':_0x147988,'metadataAvailable':_0x16ff12['length']>0x0};}
@@ -1 +1 @@
1
- (function(_0x5f3900,_0x5784ec){const _0x3ae45e=a195_0x4543,_0x4938ce=_0x5f3900();while(!![]){try{const _0x448baf=parseInt(_0x3ae45e(0x105))/0x1+-parseInt(_0x3ae45e(0x100))/0x2*(parseInt(_0x3ae45e(0x101))/0x3)+parseInt(_0x3ae45e(0xff))/0x4+parseInt(_0x3ae45e(0x103))/0x5*(parseInt(_0x3ae45e(0xfe))/0x6)+parseInt(_0x3ae45e(0x106))/0x7+parseInt(_0x3ae45e(0x102))/0x8+-parseInt(_0x3ae45e(0x104))/0x9;if(_0x448baf===_0x5784ec)break;else _0x4938ce['push'](_0x4938ce['shift']());}catch(_0x3cc613){_0x4938ce['push'](_0x4938ce['shift']());}}}(a195_0x417e,0x2b52e));import{taskStatus}from'../../commands/task/status.js';export const taskDefinitions=[taskStatus];function a195_0x4543(_0x13ce1d,_0x528ad4){_0x13ce1d=_0x13ce1d-0xfe;const _0x417e5f=a195_0x417e();let _0x4543b7=_0x417e5f[_0x13ce1d];return _0x4543b7;}function a195_0x417e(){const _0x2ac1d6=['6495120GNauXQ','3278ZHEBhu','93996qIDvzj','1530666qtTjjn','1403992DblyiN','976LnCljT','186CouGxa','2452600UuUUCx','5vhwiEg'];a195_0x417e=function(){return _0x2ac1d6;};return a195_0x417e();}
1
+ function a196_0x1b4d(){const _0x2eedc2=['725820DJpddd','84bEVjvx','4nkeNqM','12933256egwFXX','2131014dXyabb','2493205KQylqT','1580352cWKqvr','73236348zBcuFe','2888688RQiGaU'];a196_0x1b4d=function(){return _0x2eedc2;};return a196_0x1b4d();}function a196_0x423e(_0x15c9ea,_0x11cf65){_0x15c9ea=_0x15c9ea-0x11b;const _0x1b4d03=a196_0x1b4d();let _0x423e51=_0x1b4d03[_0x15c9ea];return _0x423e51;}(function(_0x517b8f,_0x4c4d8b){const _0x337a44=a196_0x423e,_0x46c7b3=_0x517b8f();while(!![]){try{const _0x24e9a7=-parseInt(_0x337a44(0x11f))/0x1+-parseInt(_0x337a44(0x121))/0x2+parseInt(_0x337a44(0x11d))/0x3*(-parseInt(_0x337a44(0x11b))/0x4)+-parseInt(_0x337a44(0x11e))/0x5+-parseInt(_0x337a44(0x122))/0x6*(parseInt(_0x337a44(0x123))/0x7)+-parseInt(_0x337a44(0x11c))/0x8+parseInt(_0x337a44(0x120))/0x9;if(_0x24e9a7===_0x4c4d8b)break;else _0x46c7b3['push'](_0x46c7b3['shift']());}catch(_0xb97637){_0x46c7b3['push'](_0x46c7b3['shift']());}}}(a196_0x1b4d,0xcbf48));import{taskStatus}from'../../commands/task/status.js';export const taskDefinitions=[taskStatus];
@@ -1 +1 @@
1
- function a196_0x343a(_0x246f9a,_0x5c61c7){_0x246f9a=_0x246f9a-0x73;const _0x5e9b30=a196_0x5e9b();let _0x343a1f=_0x5e9b30[_0x246f9a];return _0x343a1f;}const a196_0x29f276=a196_0x343a;(function(_0x372789,_0x1e5618){const _0x11bdee=a196_0x343a,_0x2749a9=_0x372789();while(!![]){try{const _0x430ed8=-parseInt(_0x11bdee(0x81))/0x1+parseInt(_0x11bdee(0x7a))/0x2*(-parseInt(_0x11bdee(0x86))/0x3)+parseInt(_0x11bdee(0x77))/0x4+-parseInt(_0x11bdee(0x82))/0x5*(-parseInt(_0x11bdee(0x84))/0x6)+parseInt(_0x11bdee(0x79))/0x7*(-parseInt(_0x11bdee(0x80))/0x8)+parseInt(_0x11bdee(0x7e))/0x9*(parseInt(_0x11bdee(0x85))/0xa)+parseInt(_0x11bdee(0x73))/0xb;if(_0x430ed8===_0x1e5618)break;else _0x2749a9['push'](_0x2749a9['shift']());}catch(_0x535154){_0x2749a9['push'](_0x2749a9['shift']());}}}(a196_0x5e9b,0xee7a3));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asyncTaskMessage,buildAsyncTaskStatusCommand,normalizeAsyncTask}from'../../commands/common/async-task.js';function a196_0x5e9b(){const _0x7588af=['str','10133992zzEHrG','isTerminal','taskId','flagMissing','5272128PeZHAy','cookie','315fpzdIm','2036lDSGUo','trim',',\x20received\x20','apiError','7677mCvYBN','Task\x20id\x20returned\x20by\x20an\x20asynchronous\x20platform\x20command','278176uiccxJ','713542xejjgM','162965PUNvHu','read','192NGoJYR','15530XbgKtF','3984wegHWK','string','task-id','appCode','Task\x20status\x20response\x20id\x20mismatch:\x20requested\x20'];a196_0x5e9b=function(){return _0x7588af;};return a196_0x5e9b();}import{getAsyncTaskStatus}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const taskStatus={'service':'task','command':'status','description':'Query\x20an\x20asynchronous\x20task;\x20repeat\x20for\x20PENDING\x20or\x20PROCESSING\x20until\x20SUCCESS\x20or\x20FAILED','risk':a196_0x29f276(0x83),'defaultOutputFormat':'compress','structuredErrors':!![],'flags':[{'name':a196_0x29f276(0x88),'type':a196_0x29f276(0x87),'required':!![],'description':a196_0x29f276(0x7f)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x4b3674){const _0x39b48d=a196_0x29f276;if(!_0x4b3674[_0x39b48d(0x8b)](_0x39b48d(0x88))[_0x39b48d(0x7b)]())throw CliErrors[_0x39b48d(0x76)](_0x39b48d(0x88));},async 'execute'(_0x2ce29b){const _0xc4d0d5=a196_0x29f276,_0x3d5f12=_0x2ce29b[_0xc4d0d5(0x8b)](_0xc4d0d5(0x88))[_0xc4d0d5(0x7b)](),_0x424c5e=normalizeAsyncTask(await getAsyncTaskStatus(_0x3d5f12,_0x2ce29b[_0xc4d0d5(0x89)],_0x2ce29b[_0xc4d0d5(0x78)]));if(_0x424c5e[_0xc4d0d5(0x75)]!==_0x3d5f12)throw CliErrors[_0xc4d0d5(0x7d)](_0xc4d0d5(0x8a)+_0x3d5f12+_0xc4d0d5(0x7c)+_0x424c5e[_0xc4d0d5(0x75)]+'.');const _0x370744=buildAsyncTaskStatusCommand(_0x424c5e['taskId'],_0x2ce29b[_0xc4d0d5(0x89)]);return{'ok':!![],'message':asyncTaskMessage(_0x424c5e),'data':{'appCode':_0x2ce29b[_0xc4d0d5(0x89)],..._0x424c5e,'query':_0x424c5e[_0xc4d0d5(0x74)]?null:{'command':_0x370744}}};}};
1
+ const a197_0x86ef15=a197_0x39a7;(function(_0x2da726,_0x240a29){const _0x5b5a4d=a197_0x39a7,_0x1f83cc=_0x2da726();while(!![]){try{const _0x511ae5=parseInt(_0x5b5a4d(0x117))/0x1+-parseInt(_0x5b5a4d(0x11f))/0x2+parseInt(_0x5b5a4d(0x11c))/0x3*(parseInt(_0x5b5a4d(0x11d))/0x4)+-parseInt(_0x5b5a4d(0x124))/0x5+-parseInt(_0x5b5a4d(0x126))/0x6+parseInt(_0x5b5a4d(0x12c))/0x7*(parseInt(_0x5b5a4d(0x12b))/0x8)+parseInt(_0x5b5a4d(0x121))/0x9;if(_0x511ae5===_0x240a29)break;else _0x1f83cc['push'](_0x1f83cc['shift']());}catch(_0x51ea85){_0x1f83cc['push'](_0x1f83cc['shift']());}}}(a197_0x37a8,0x5a7b3));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 a197_0x37a8(){const _0x403858=['33HBTYej','79796mEdyRB','cookie','1132248GsJoHr','Query\x20an\x20asynchronous\x20task;\x20repeat\x20for\x20PENDING\x20or\x20PROCESSING\x20until\x20SUCCESS\x20or\x20FAILED','9436194znLlYF','trim','appCode','1448110oGnAaf','taskId','3762492FnbDJD','isTerminal','str','compress','Task\x20status\x20response\x20id\x20mismatch:\x20requested\x20','3128432SnsTQh','7Capaem','apiError','Task\x20id\x20returned\x20by\x20an\x20asynchronous\x20platform\x20command','flagMissing','194480JOFkWm','task-id','read','task','string'];a197_0x37a8=function(){return _0x403858;};return a197_0x37a8();}function a197_0x39a7(_0x5a0cae,_0x4a0a1a){_0x5a0cae=_0x5a0cae-0x116;const _0x37a898=a197_0x37a8();let _0x39a7f4=_0x37a898[_0x5a0cae];return _0x39a7f4;}export const taskStatus={'service':a197_0x86ef15(0x11a),'command':'status','description':a197_0x86ef15(0x120),'risk':a197_0x86ef15(0x119),'defaultOutputFormat':a197_0x86ef15(0x129),'structuredErrors':!![],'flags':[{'name':a197_0x86ef15(0x118),'type':a197_0x86ef15(0x11b),'required':!![],'description':a197_0x86ef15(0x12e)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x3fc11a){const _0x3b7da6=a197_0x86ef15;if(!_0x3fc11a[_0x3b7da6(0x128)](_0x3b7da6(0x118))[_0x3b7da6(0x122)]())throw CliErrors[_0x3b7da6(0x116)]('task-id');},async 'execute'(_0x33912b){const _0x3f3223=a197_0x86ef15,_0x43bb59=_0x33912b[_0x3f3223(0x128)]('task-id')[_0x3f3223(0x122)](),_0x466bff=normalizeAsyncTask(await getAsyncTaskStatus(_0x43bb59,_0x33912b[_0x3f3223(0x123)],_0x33912b[_0x3f3223(0x11e)]));if(_0x466bff[_0x3f3223(0x125)]!==_0x43bb59)throw CliErrors[_0x3f3223(0x12d)](_0x3f3223(0x12a)+_0x43bb59+',\x20received\x20'+_0x466bff['taskId']+'.');const _0x45e860=buildAsyncTaskStatusCommand(_0x466bff[_0x3f3223(0x125)],_0x33912b[_0x3f3223(0x123)]);return{'ok':!![],'message':asyncTaskMessage(_0x466bff),'data':{'appCode':_0x33912b[_0x3f3223(0x123)],..._0x466bff,'query':_0x466bff[_0x3f3223(0x127)]?null:{'command':_0x45e860}}};}};
@@ -1 +1 @@
1
- (function(_0x47d189,_0x328eb6){const _0x48ceb4=a197_0x2857,_0x1e0bd2=_0x47d189();while(!![]){try{const _0x2c818f=parseInt(_0x48ceb4(0x170))/0x1*(parseInt(_0x48ceb4(0x168))/0x2)+parseInt(_0x48ceb4(0x171))/0x3+parseInt(_0x48ceb4(0x172))/0x4+parseInt(_0x48ceb4(0x169))/0x5*(-parseInt(_0x48ceb4(0x16f))/0x6)+parseInt(_0x48ceb4(0x16d))/0x7+parseInt(_0x48ceb4(0x16e))/0x8*(-parseInt(_0x48ceb4(0x16a))/0x9)+parseInt(_0x48ceb4(0x16c))/0xa*(-parseInt(_0x48ceb4(0x16b))/0xb);if(_0x2c818f===_0x328eb6)break;else _0x1e0bd2['push'](_0x1e0bd2['shift']());}catch(_0x1c011a){_0x1e0bd2['push'](_0x1e0bd2['shift']());}}}(a197_0x4b11,0x3c811));function a197_0x2857(_0x4f869b,_0x51f8dc){_0x4f869b=_0x4f869b-0x168;const _0x4b119b=a197_0x4b11();let _0x2857ad=_0x4b119b[_0x4f869b];return _0x2857ad;}function a197_0x4b11(){const _0x470c96=['93827DXwHwv','42273SUWesl','394696GyeyXV','4jMrGMe','1350715EUGjHH','180738iBPYbf','132zauktK','8160haIPXm','2294257jmTLDe','40ccVIId','6ZYNDix'];a197_0x4b11=function(){return _0x470c96;};return a197_0x4b11();}import{tenantMembersListDefinition}from'../../commands/tenant/members-list.js';export const tenantDefinitions=[tenantMembersListDefinition];
1
+ function a198_0x2f15(_0x1717c9,_0x4af7c8){_0x1717c9=_0x1717c9-0x17a;const _0x4db4c6=a198_0x4db4();let _0x2f1521=_0x4db4c6[_0x1717c9];return _0x2f1521;}(function(_0x5a0601,_0x2834e1){const _0x408823=a198_0x2f15,_0xbc6763=_0x5a0601();while(!![]){try{const _0xf36b28=parseInt(_0x408823(0x180))/0x1*(parseInt(_0x408823(0x17d))/0x2)+parseInt(_0x408823(0x182))/0x3+parseInt(_0x408823(0x185))/0x4+-parseInt(_0x408823(0x183))/0x5*(parseInt(_0x408823(0x17f))/0x6)+parseInt(_0x408823(0x17e))/0x7*(parseInt(_0x408823(0x181))/0x8)+-parseInt(_0x408823(0x184))/0x9*(parseInt(_0x408823(0x17b))/0xa)+-parseInt(_0x408823(0x17c))/0xb*(parseInt(_0x408823(0x17a))/0xc);if(_0xf36b28===_0x2834e1)break;else _0xbc6763['push'](_0xbc6763['shift']());}catch(_0x46dcee){_0xbc6763['push'](_0xbc6763['shift']());}}}(a198_0x4db4,0xd2f80));import{tenantMembersListDefinition}from'../../commands/tenant/members-list.js';export const tenantDefinitions=[tenantMembersListDefinition];function a198_0x4db4(){const _0x38fffe=['2440491YsabpS','5yfsOty','12344607nMVtnK','4993940WYlvzJ','24JXTcIf','10KJllDi','4443901VemtZE','526LyhocT','707qhumTl','5421732mZrKoW','1934bwHnmN','109048YbGQHZ'];a198_0x4db4=function(){return _0x38fffe;};return a198_0x4db4();}
@@ -1 +1 @@
1
- function a198_0x5173(){const _0x5d389b=['150LPzTwk','str','Exact\x20tenant\x20code','\x20tenant\x20member(s)','273188EdlaxF','380785MhJBRs','2903096Tktufg','List\x20members\x20of\x20a\x20tenant\x20available\x20to\x20the\x20current\x20account','Pass\x20--tenant-code\x20<code>.','length','1886853CaWXph','664860CYXUJV','1118178FupTYR','36uyBSix','185017hWzcWx','tenant-code','flagMissing','string','trim','read'];a198_0x5173=function(){return _0x5d389b;};return a198_0x5173();}const a198_0x39866d=a198_0x3997;function a198_0x3997(_0x1c68fc,_0x35181f){_0x1c68fc=_0x1c68fc-0xc5;const _0x5173a4=a198_0x5173();let _0x399770=_0x5173a4[_0x1c68fc];return _0x399770;}(function(_0x4ad7df,_0xb8b20e){const _0x219b10=a198_0x3997,_0x58b07a=_0x4ad7df();while(!![]){try{const _0x403402=parseInt(_0x219b10(0xd0))/0x1+parseInt(_0x219b10(0xd7))/0x2+parseInt(_0x219b10(0xd6))/0x3+-parseInt(_0x219b10(0xc5))/0x4*(parseInt(_0x219b10(0xd1))/0x5)+-parseInt(_0x219b10(0xcc))/0x6*(parseInt(_0x219b10(0xc6))/0x7)+parseInt(_0x219b10(0xd2))/0x8+parseInt(_0x219b10(0xd8))/0x9;if(_0x403402===_0xb8b20e)break;else _0x58b07a['push'](_0x58b07a['shift']());}catch(_0x204095){_0x58b07a['push'](_0x58b07a['shift']());}}}(a198_0x5173,0x5bad6));import{listCurrentUserTenantMemberships,listTenantDirectoryMembers}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{assertTenantAccessible,projectTenantMembers}from'../../commands/tenant/shared.js';export const tenantMembersListDefinition={'service':'tenant','command':'members-list','description':a198_0x39866d(0xd3),'risk':a198_0x39866d(0xcb),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a198_0x39866d(0xc7),'type':a198_0x39866d(0xc9),'required':!![],'description':a198_0x39866d(0xce)}],async 'validate'(_0x35e314){const _0x3f84e3=a198_0x39866d;if(!_0x35e314[_0x3f84e3(0xcd)](_0x3f84e3(0xc7))[_0x3f84e3(0xca)]())throw CliErrors[_0x3f84e3(0xc8)](_0x3f84e3(0xc7),_0x3f84e3(0xd4));},async 'execute'(_0x38bedb){const _0x4cbe55=a198_0x39866d,_0x2088ec=_0x38bedb[_0x4cbe55(0xcd)](_0x4cbe55(0xc7))['trim'](),_0x36f67e=await listCurrentUserTenantMemberships();assertTenantAccessible(_0x2088ec,_0x36f67e);const _0x1fa215=projectTenantMembers(await listTenantDirectoryMembers(_0x2088ec));return{'ok':!![],'data':{'tenantCode':_0x2088ec,'items':_0x1fa215,'totalCount':_0x1fa215[_0x4cbe55(0xd5)]},'message':'Found\x20'+_0x1fa215[_0x4cbe55(0xd5)]+_0x4cbe55(0xcf)};}};
1
+ const a199_0x3a7cf0=a199_0xd2b7;(function(_0xe495d0,_0x50b7d8){const _0x49113b=a199_0xd2b7,_0x33c50d=_0xe495d0();while(!![]){try{const _0x29c7b1=parseInt(_0x49113b(0x118))/0x1+parseInt(_0x49113b(0x113))/0x2+-parseInt(_0x49113b(0x11a))/0x3+parseInt(_0x49113b(0x117))/0x4+parseInt(_0x49113b(0x115))/0x5*(parseInt(_0x49113b(0x112))/0x6)+parseInt(_0x49113b(0x11f))/0x7*(-parseInt(_0x49113b(0x11d))/0x8)+parseInt(_0x49113b(0x114))/0x9*(-parseInt(_0x49113b(0x122))/0xa);if(_0x29c7b1===_0x50b7d8)break;else _0x33c50d['push'](_0x33c50d['shift']());}catch(_0x1267e2){_0x33c50d['push'](_0x33c50d['shift']());}}}(a199_0x479a,0x95e6d));function a199_0x479a(){const _0x50ddea=['42088eHwsAT','read','826QogaWg','Found\x20','List\x20members\x20of\x20a\x20tenant\x20available\x20to\x20the\x20current\x20account','1436430KsBwci','str','string','tenant-code','18294WQVWNg','741374WaErwp','117rNalUW','1685XdXvlk','Pass\x20--tenant-code\x20<code>.','3225300mEAdeb','1188593xFSqpZ','tenant','872892KnZDJC','trim','length'];a199_0x479a=function(){return _0x50ddea;};return a199_0x479a();}import{listCurrentUserTenantMemberships,listTenantDirectoryMembers}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a199_0xd2b7(_0x6ed401,_0x20cce1){_0x6ed401=_0x6ed401-0x10f;const _0x479a79=a199_0x479a();let _0xd2b727=_0x479a79[_0x6ed401];return _0xd2b727;}import{assertTenantAccessible,projectTenantMembers}from'../../commands/tenant/shared.js';export const tenantMembersListDefinition={'service':a199_0x3a7cf0(0x119),'command':'members-list','description':a199_0x3a7cf0(0x121),'risk':a199_0x3a7cf0(0x11e),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a199_0x3a7cf0(0x111),'type':a199_0x3a7cf0(0x110),'required':!![],'description':'Exact\x20tenant\x20code'}],async 'validate'(_0x17ec24){const _0x59b57c=a199_0x3a7cf0;if(!_0x17ec24[_0x59b57c(0x10f)](_0x59b57c(0x111))['trim']())throw CliErrors['flagMissing']('tenant-code',_0x59b57c(0x116));},async 'execute'(_0x3e405){const _0x4833c9=a199_0x3a7cf0,_0x40ae23=_0x3e405[_0x4833c9(0x10f)]('tenant-code')[_0x4833c9(0x11b)](),_0x4789e1=await listCurrentUserTenantMemberships();assertTenantAccessible(_0x40ae23,_0x4789e1);const _0x3fb9d1=projectTenantMembers(await listTenantDirectoryMembers(_0x40ae23));return{'ok':!![],'data':{'tenantCode':_0x40ae23,'items':_0x3fb9d1,'totalCount':_0x3fb9d1[_0x4833c9(0x11c)]},'message':_0x4833c9(0x120)+_0x3fb9d1[_0x4833c9(0x11c)]+'\x20tenant\x20member(s)'};}};
@@ -1 +1 @@
1
- (function(_0x99c767,_0x499c9d){const _0x133252=a199_0x2b19,_0x59258e=_0x99c767();while(!![]){try{const _0x2274b2=parseInt(_0x133252(0x207))/0x1+-parseInt(_0x133252(0x1f4))/0x2*(-parseInt(_0x133252(0x202))/0x3)+parseInt(_0x133252(0x1f7))/0x4*(-parseInt(_0x133252(0x1f6))/0x5)+-parseInt(_0x133252(0x1fc))/0x6+parseInt(_0x133252(0x1f1))/0x7+-parseInt(_0x133252(0x1f9))/0x8+parseInt(_0x133252(0x204))/0x9;if(_0x2274b2===_0x499c9d)break;else _0x59258e['push'](_0x59258e['shift']());}catch(_0x3f2a25){_0x59258e['push'](_0x59258e['shift']());}}}(a199_0x1998,0xb0716));import{CliErrors}from'../../errors.js';function a199_0x2b19(_0xee56c5,_0x59691e){_0xee56c5=_0xee56c5-0x1f1;const _0x199842=a199_0x1998();let _0x2b1912=_0x199842[_0xee56c5];return _0x2b1912;}function textOrNull(_0x19fdff){const _0x1ae2a5=a199_0x2b19,_0x5f304d=_0x19fdff?.[_0x1ae2a5(0x1ff)]();return _0x5f304d?_0x5f304d:null;}function a199_0x1998(){const _0x3e6c8e=['992904XuppzO','role','validation','7465236KkUhwD','status','username','trim','displayName','Tenant\x20\x22','972BjSvNy','some','13894884ayUmZr','userId','ADMIN','977bImBfh','set','1568056vXFIih','sort','tenantCode','8318JFJFPR','MEMBER','2563370UxSKXP','8ARvwjy','isFinite'];a199_0x1998=function(){return _0x3e6c8e;};return a199_0x1998();}export function projectTenantMembers(_0x5b45b1){const _0x143d16=a199_0x2b19,_0x1eb2d3=new Map();for(const _0x524af4 of _0x5b45b1){const _0x97d3f9=Number(_0x524af4[_0x143d16(0x205)]);if(!Number[_0x143d16(0x1f8)](_0x97d3f9)||_0x97d3f9<=0x0)continue;const _0x546d04={'userId':_0x97d3f9,'username':textOrNull(_0x524af4[_0x143d16(0x1fe)]),'displayName':textOrNull(_0x524af4['nickname']),'role':_0x524af4['adminFlag']===!![]?_0x143d16(0x206):_0x143d16(0x1f5),'status':textOrNull(_0x524af4['status'])},_0x38fda5=_0x1eb2d3['get'](_0x97d3f9);if(!_0x38fda5){_0x1eb2d3[_0x143d16(0x208)](_0x97d3f9,_0x546d04);continue;}_0x38fda5['username']??=_0x546d04[_0x143d16(0x1fe)],_0x38fda5[_0x143d16(0x200)]??=_0x546d04[_0x143d16(0x200)],_0x38fda5[_0x143d16(0x1fd)]??=_0x546d04[_0x143d16(0x1fd)];if(_0x546d04[_0x143d16(0x1fa)]===_0x143d16(0x206))_0x38fda5[_0x143d16(0x1fa)]=_0x143d16(0x206);}return[..._0x1eb2d3['values']()][_0x143d16(0x1f2)]((_0x440507,_0x5cb21a)=>_0x440507[_0x143d16(0x205)]-_0x5cb21a[_0x143d16(0x205)]);}export function assertTenantAccessible(_0x5ce7a0,_0x25a9cb){const _0x5aef6c=a199_0x2b19;if(_0x25a9cb[_0x5aef6c(0x203)](_0x5d7701=>_0x5d7701[_0x5aef6c(0x1f3)]===_0x5ce7a0))return;throw CliErrors[_0x5aef6c(0x1fb)](_0x5aef6c(0x201)+_0x5ce7a0+'\x22\x20is\x20not\x20available\x20to\x20the\x20current\x20account.','Check\x20--tenant-code\x20or\x20login\x20with\x20an\x20account\x20that\x20belongs\x20to\x20this\x20tenant.');}
1
+ (function(_0x1dd1e0,_0x98c4b8){const _0x3a3957=a200_0x3cef,_0xf822f2=_0x1dd1e0();while(!![]){try{const _0x89194c=parseInt(_0x3a3957(0x6a))/0x1+-parseInt(_0x3a3957(0x7d))/0x2+parseInt(_0x3a3957(0x74))/0x3+-parseInt(_0x3a3957(0x81))/0x4+-parseInt(_0x3a3957(0x73))/0x5*(-parseInt(_0x3a3957(0x67))/0x6)+parseInt(_0x3a3957(0x76))/0x7*(-parseInt(_0x3a3957(0x77))/0x8)+-parseInt(_0x3a3957(0x6d))/0x9*(-parseInt(_0x3a3957(0x68))/0xa);if(_0x89194c===_0x98c4b8)break;else _0xf822f2['push'](_0xf822f2['shift']());}catch(_0x41896a){_0xf822f2['push'](_0xf822f2['shift']());}}}(a200_0x3819,0xd2852));import{CliErrors}from'../../errors.js';function textOrNull(_0x1ce447){const _0x289bb6=a200_0x3cef,_0x406a4e=_0x1ce447?.[_0x289bb6(0x72)]();return _0x406a4e?_0x406a4e:null;}export function projectTenantMembers(_0x1e5cda){const _0x3534a5=a200_0x3cef,_0x40208c=new Map();for(const _0x47f12c of _0x1e5cda){const _0xaff99e=Number(_0x47f12c['userId']);if(!Number[_0x3534a5(0x7c)](_0xaff99e)||_0xaff99e<=0x0)continue;const _0x1d77fd={'userId':_0xaff99e,'username':textOrNull(_0x47f12c['username']),'displayName':textOrNull(_0x47f12c[_0x3534a5(0x7b)]),'role':_0x47f12c[_0x3534a5(0x7e)]===!![]?'ADMIN':_0x3534a5(0x66),'status':textOrNull(_0x47f12c[_0x3534a5(0x6e)])},_0x27f1f3=_0x40208c[_0x3534a5(0x78)](_0xaff99e);if(!_0x27f1f3){_0x40208c[_0x3534a5(0x80)](_0xaff99e,_0x1d77fd);continue;}_0x27f1f3['username']??=_0x1d77fd['username'],_0x27f1f3[_0x3534a5(0x70)]??=_0x1d77fd[_0x3534a5(0x70)],_0x27f1f3['status']??=_0x1d77fd[_0x3534a5(0x6e)];if(_0x1d77fd[_0x3534a5(0x6f)]===_0x3534a5(0x69))_0x27f1f3[_0x3534a5(0x6f)]=_0x3534a5(0x69);}return[..._0x40208c[_0x3534a5(0x71)]()][_0x3534a5(0x6b)]((_0x34a679,_0x47c6d2)=>_0x34a679[_0x3534a5(0x7a)]-_0x47c6d2[_0x3534a5(0x7a)]);}function a200_0x3cef(_0x1f4009,_0x5b368d){_0x1f4009=_0x1f4009-0x66;const _0x381968=a200_0x3819();let _0x3cefdb=_0x381968[_0x1f4009];return _0x3cefdb;}export function assertTenantAccessible(_0x3e8ab6,_0x1f8376){const _0x235f4a=a200_0x3cef;if(_0x1f8376[_0x235f4a(0x6c)](_0x2bf294=>_0x2bf294[_0x235f4a(0x7f)]===_0x3e8ab6))return;throw CliErrors[_0x235f4a(0x79)]('Tenant\x20\x22'+_0x3e8ab6+_0x235f4a(0x75),'Check\x20--tenant-code\x20or\x20login\x20with\x20an\x20account\x20that\x20belongs\x20to\x20this\x20tenant.');}function a200_0x3819(){const _0x50f681=['status','role','displayName','values','trim','124680coJZkd','983013TrJZMw','\x22\x20is\x20not\x20available\x20to\x20the\x20current\x20account.','959DqYQkd','74384bPDCKn','get','validation','userId','nickname','isFinite','278194lcmuKI','adminFlag','tenantCode','set','5168208ImHpYg','MEMBER','198QMmYwE','1270EDxCXq','ADMIN','899818jZQGWL','sort','some','107496QxKjRn'];a200_0x3819=function(){return _0x50f681;};return a200_0x3819();}
@@ -1 +1 @@
1
- const a200_0x140818=a200_0x1a59;(function(_0xd88c02,_0x31c842){const _0x1f109f=a200_0x1a59,_0x3a4030=_0xd88c02();while(!![]){try{const _0xb4d0c1=-parseInt(_0x1f109f(0xcc))/0x1+-parseInt(_0x1f109f(0xc8))/0x2+-parseInt(_0x1f109f(0xcb))/0x3+-parseInt(_0x1f109f(0xc6))/0x4*(-parseInt(_0x1f109f(0xc1))/0x5)+-parseInt(_0x1f109f(0xc7))/0x6+-parseInt(_0x1f109f(0xba))/0x7*(-parseInt(_0x1f109f(0xd1))/0x8)+parseInt(_0x1f109f(0xc4))/0x9;if(_0xb4d0c1===_0x31c842)break;else _0x3a4030['push'](_0x3a4030['shift']());}catch(_0x53f3b8){_0x3a4030['push'](_0x3a4030['shift']());}}}(a200_0x1fbb,0xd3f97));function a200_0x1a59(_0x4ea1fd,_0x135a0c){_0x4ea1fd=_0x4ea1fd-0xb9;const _0x1fbbab=a200_0x1fbb();let _0x1a593e=_0x1fbbab[_0x4ea1fd];return _0x1a593e;}import{asDryRunResult}from'../../commands/common/dry-run.js';import{bindDingTalkSandboxAccount,DING_TALK_SANDBOX_BIND_PATH}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a200_0x1fbb(){const _0x463a85=['DingTalk\x20sandbox\x20account\x20binding\x20was\x20not\x20confirmed.','The\x20current\x20binding\x20is\x20not\x20exposed\x20by\x20the\x20server;\x20before\x20is\x20unavailable.','Pass\x20the\x20DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox.','Bound\x20current\x20user\x20to\x20DingTalk\x20sandbox\x20account.','user-account','write','45IiYQkn','--ding-talk-user-id\x20cannot\x20be\x20empty.','Retry\x20with\x20the\x20same\x20--ding-talk-user-id\x20only\x20after\x20checking\x20the\x20current\x20platform\x20session.','33830910DXHtgU','apiError','120260cpysMU','6840576pZvlnC','2594816AiVMCb','dingding-sandbox-bind','Bind\x20the\x20current\x20platform\x20user\x20to\x20a\x20DingTalk\x20sandbox\x20account','3429801eyzfuj','435252dxzIfO','POST','ding-talk-user-id','dingtalk','str','1367512qBChjm','string','bind','35ABrDXy'];a200_0x1fbb=function(){return _0x463a85;};return a200_0x1fbb();}const PROVIDER_ID=a200_0x140818(0xcf),CURRENT_BINDING_WARNING=a200_0x140818(0xbc);function readDingTalkUserId(_0x31aa9c){const _0x39b491=a200_0x140818,_0x396e62=_0x31aa9c[_0x39b491(0xd0)](_0x39b491(0xce))['trim']();if(!_0x396e62)throw CliErrors['validation'](_0x39b491(0xc2),_0x39b491(0xbd));return _0x396e62;}function buildBindingData(_0x3a2bcc,_0x637dad){const _0x324212=a200_0x140818;return{'operation':_0x324212(0xb9),'selector':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x3a2bcc},'before':null,'after':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x3a2bcc,'bound':!![]},'dryRun':_0x637dad,'backend':{'method':_0x324212(0xcd),'path':DING_TALK_SANDBOX_BIND_PATH},'warnings':[CURRENT_BINDING_WARNING]};}export const dingTalkSandboxBind={'service':a200_0x140818(0xbf),'command':a200_0x140818(0xc9),'description':a200_0x140818(0xca),'risk':a200_0x140818(0xc0),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a200_0x140818(0xce),'type':a200_0x140818(0xd2),'required':!![],'description':'DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox'}],async 'validate'(_0xa3508b){readDingTalkUserId(_0xa3508b);},async 'dryRun'(_0x48a8eb){const _0x2a5c60=a200_0x140818,_0x4d9ec9=readDingTalkUserId(_0x48a8eb);return asDryRunResult(buildBindingData(_0x4d9ec9,!![]),{'method':_0x2a5c60(0xcd),'url':DING_TALK_SANDBOX_BIND_PATH});},async 'execute'(_0x46bfeb){const _0x51d789=a200_0x140818,_0x59d0b6=readDingTalkUserId(_0x46bfeb),_0x1cc713=await bindDingTalkSandboxAccount(_0x59d0b6);if(_0x1cc713!==!![])throw CliErrors[_0x51d789(0xc5)](_0x51d789(0xbb),_0x51d789(0xc3));return{'ok':!![],'data':buildBindingData(_0x59d0b6,![]),'message':_0x51d789(0xbe)};}};
1
+ const a201_0x4a97f7=a201_0x28ab;(function(_0x24d7dc,_0x47d162){const _0x25c7d8=a201_0x28ab,_0x5de18f=_0x24d7dc();while(!![]){try{const _0x180e3f=-parseInt(_0x25c7d8(0x1b1))/0x1*(parseInt(_0x25c7d8(0x1ac))/0x2)+parseInt(_0x25c7d8(0x19c))/0x3*(parseInt(_0x25c7d8(0x1ae))/0x4)+-parseInt(_0x25c7d8(0x1aa))/0x5+parseInt(_0x25c7d8(0x1ab))/0x6+-parseInt(_0x25c7d8(0x1a5))/0x7+parseInt(_0x25c7d8(0x1a9))/0x8*(parseInt(_0x25c7d8(0x1a7))/0x9)+parseInt(_0x25c7d8(0x19d))/0xa;if(_0x180e3f===_0x47d162)break;else _0x5de18f['push'](_0x5de18f['shift']());}catch(_0x10b500){_0x5de18f['push'](_0x5de18f['shift']());}}}(a201_0x532b,0xc0719));import{asDryRunResult}from'../../commands/common/dry-run.js';import{bindDingTalkSandboxAccount,DING_TALK_SANDBOX_BIND_PATH}from'../../core/api-client.js';function a201_0x28ab(_0x9c7e70,_0x3baafe){_0x9c7e70=_0x9c7e70-0x19c;const _0x532b82=a201_0x532b();let _0x28ab47=_0x532b82[_0x9c7e70];return _0x28ab47;}import{CliErrors}from'../../errors.js';function a201_0x532b(){const _0x4b886b=['5131511IyRZDl','dingding-sandbox-bind','645237MIhbVp','Pass\x20the\x20DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox.','152IyQMLg','3078570UdzCpp','3655260LUTTnk','26814mwiqzJ','Bound\x20current\x20user\x20to\x20DingTalk\x20sandbox\x20account.','524zNXnae','POST','dingtalk','106ZmddLF','20985AkqEFU','6704560RdZnpw','apiError','string','Bind\x20the\x20current\x20platform\x20user\x20to\x20a\x20DingTalk\x20sandbox\x20account','DingTalk\x20sandbox\x20account\x20binding\x20was\x20not\x20confirmed.','validation','The\x20current\x20binding\x20is\x20not\x20exposed\x20by\x20the\x20server;\x20before\x20is\x20unavailable.','Retry\x20with\x20the\x20same\x20--ding-talk-user-id\x20only\x20after\x20checking\x20the\x20current\x20platform\x20session.'];a201_0x532b=function(){return _0x4b886b;};return a201_0x532b();}const PROVIDER_ID=a201_0x4a97f7(0x1b0),CURRENT_BINDING_WARNING=a201_0x4a97f7(0x1a3);function readDingTalkUserId(_0x598744){const _0x418d14=a201_0x4a97f7,_0x902e92=_0x598744['str']('ding-talk-user-id')['trim']();if(!_0x902e92)throw CliErrors[_0x418d14(0x1a2)]('--ding-talk-user-id\x20cannot\x20be\x20empty.',_0x418d14(0x1a8));return _0x902e92;}function buildBindingData(_0x350279,_0x548aa2){const _0x564d6b=a201_0x4a97f7;return{'operation':'bind','selector':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x350279},'before':null,'after':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x350279,'bound':!![]},'dryRun':_0x548aa2,'backend':{'method':_0x564d6b(0x1af),'path':DING_TALK_SANDBOX_BIND_PATH},'warnings':[CURRENT_BINDING_WARNING]};}export const dingTalkSandboxBind={'service':'user-account','command':a201_0x4a97f7(0x1a6),'description':a201_0x4a97f7(0x1a0),'risk':'write','requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':'ding-talk-user-id','type':a201_0x4a97f7(0x19f),'required':!![],'description':'DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox'}],async 'validate'(_0x545a89){readDingTalkUserId(_0x545a89);},async 'dryRun'(_0x1f95e2){const _0x2e12f8=readDingTalkUserId(_0x1f95e2);return asDryRunResult(buildBindingData(_0x2e12f8,!![]),{'method':'POST','url':DING_TALK_SANDBOX_BIND_PATH});},async 'execute'(_0x3f0056){const _0x476089=a201_0x4a97f7,_0x43e982=readDingTalkUserId(_0x3f0056),_0x3b8f38=await bindDingTalkSandboxAccount(_0x43e982);if(_0x3b8f38!==!![])throw CliErrors[_0x476089(0x19e)](_0x476089(0x1a1),_0x476089(0x1a4));return{'ok':!![],'data':buildBindingData(_0x43e982,![]),'message':_0x476089(0x1ad)};}};
@@ -1 +1 @@
1
- function a201_0x2b1a(){const _0x69b06=['528105YSmpmC','2242WJRUli','6225669lUyVBf','948935zshkbe','671652fBpYHV','4TnltfP','856240XVBaTA','1170040NluvxB','177xBUGDu'];a201_0x2b1a=function(){return _0x69b06;};return a201_0x2b1a();}(function(_0x817ac9,_0xc7cb97){const _0x1064f0=a201_0x15ce,_0x2ba937=_0x817ac9();while(!![]){try{const _0x233851=parseInt(_0x1064f0(0xcd))/0x1*(-parseInt(_0x1064f0(0xc6))/0x2)+-parseInt(_0x1064f0(0xc5))/0x3+-parseInt(_0x1064f0(0xca))/0x4*(-parseInt(_0x1064f0(0xc8))/0x5)+-parseInt(_0x1064f0(0xc9))/0x6+-parseInt(_0x1064f0(0xcb))/0x7+-parseInt(_0x1064f0(0xcc))/0x8+parseInt(_0x1064f0(0xc7))/0x9;if(_0x233851===_0xc7cb97)break;else _0x2ba937['push'](_0x2ba937['shift']());}catch(_0x2de6a4){_0x2ba937['push'](_0x2ba937['shift']());}}}(a201_0x2b1a,0x1ee5f));function a201_0x15ce(_0x59789f,_0x5bc728){_0x59789f=_0x59789f-0xc5;const _0x2b1a02=a201_0x2b1a();let _0x15ce00=_0x2b1a02[_0x59789f];return _0x15ce00;}import{dingTalkSandboxBind}from'../../commands/user-account/dingding-sandbox-bind.js';export const userAccountDefinitions=[dingTalkSandboxBind];
1
+ (function(_0x375dce,_0x228487){const _0xe18c3b=a202_0x3fd3,_0x2f605f=_0x375dce();while(!![]){try{const _0x4bf05a=-parseInt(_0xe18c3b(0x7b))/0x1*(-parseInt(_0xe18c3b(0x80))/0x2)+parseInt(_0xe18c3b(0x7c))/0x3*(-parseInt(_0xe18c3b(0x7f))/0x4)+-parseInt(_0xe18c3b(0x81))/0x5*(-parseInt(_0xe18c3b(0x82))/0x6)+-parseInt(_0xe18c3b(0x7e))/0x7+parseInt(_0xe18c3b(0x7a))/0x8+-parseInt(_0xe18c3b(0x83))/0x9+-parseInt(_0xe18c3b(0x84))/0xa*(-parseInt(_0xe18c3b(0x7d))/0xb);if(_0x4bf05a===_0x228487)break;else _0x2f605f['push'](_0x2f605f['shift']());}catch(_0x169831){_0x2f605f['push'](_0x2f605f['shift']());}}}(a202_0x3cde,0x84b99));function a202_0x3cde(){const _0x140719=['6586336gvdneD','1dLJQpb','3xpkpss','1815OUncTz','3753638nNtGsK','4033036EOAkKa','1980614fwbgch','3985vlRWhG','4686PiIJfH','6860133DwwiLo','25110oIuKkU'];a202_0x3cde=function(){return _0x140719;};return a202_0x3cde();}import{dingTalkSandboxBind}from'../../commands/user-account/dingding-sandbox-bind.js';function a202_0x3fd3(_0x6c9c06,_0x1d93da){_0x6c9c06=_0x6c9c06-0x7a;const _0x3cde88=a202_0x3cde();let _0x3fd3b0=_0x3cde88[_0x6c9c06];return _0x3fd3b0;}export const userAccountDefinitions=[dingTalkSandboxBind];
@@ -1 +1 @@
1
- const a202_0x42cd04=a202_0x1e2f;function a202_0x1e2f(_0x191fd2,_0x5b3e86){_0x191fd2=_0x191fd2-0x145;const _0x5c5cf0=a202_0x5c5c();let _0x1e2f8e=_0x5c5cf0[_0x191fd2];return _0x1e2f8e;}function a202_0x5c5c(){const _0x32cf3a=['444647cIZKKJ','231uEBaxR','3895533kKnBoc','812DrlAid','Register\x20an\x20app\x20profile\x20in\x20the\x20current\x20workspace\x20(or\x20--global)','workspace','write','add','2016312huTXDk','35680yjFFue','3228GSuaRi','2424mIvASK','457360tgowlt','4935AhgEDN','174dvjzEF'];a202_0x5c5c=function(){return _0x32cf3a;};return a202_0x5c5c();}(function(_0x14b463,_0x44dca5){const _0x1027ef=a202_0x1e2f,_0x372b20=_0x14b463();while(!![]){try{const _0x531fbf=parseInt(_0x1027ef(0x14b))/0x1+parseInt(_0x1027ef(0x147))/0x2*(-parseInt(_0x1027ef(0x14a))/0x3)+parseInt(_0x1027ef(0x153))/0x4+parseInt(_0x1027ef(0x149))/0x5*(-parseInt(_0x1027ef(0x146))/0x6)+-parseInt(_0x1027ef(0x14e))/0x7*(-parseInt(_0x1027ef(0x145))/0x8)+parseInt(_0x1027ef(0x14d))/0x9+parseInt(_0x1027ef(0x148))/0xa*(-parseInt(_0x1027ef(0x14c))/0xb);if(_0x531fbf===_0x44dca5)break;else _0x372b20['push'](_0x372b20['shift']());}catch(_0x3d7631){_0x372b20['push'](_0x372b20['shift']());}}}(a202_0x5c5c,0x5250c));import{buildAppAddFlags,runAppAdd,validateAppName}from'../../commands/common/app-registry.js';export const workspaceAddDefinition={'service':a202_0x42cd04(0x150),'command':a202_0x42cd04(0x152),'description':a202_0x42cd04(0x14f),'risk':a202_0x42cd04(0x151),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':'name','description':'App\x20profile\x20name','required':!![]}],'flags':buildAppAddFlags(),'validate':_0x1ef907=>validateAppName(_0x1ef907,'workspace\x20add'),'execute':_0x47ff42=>runAppAdd(_0x47ff42,'workspace\x20add')};
1
+ const a203_0x3a592d=a203_0x4446;(function(_0x3c6767,_0x470877){const _0x5ef493=a203_0x4446,_0x476402=_0x3c6767();while(!![]){try{const _0x35931b=-parseInt(_0x5ef493(0xb7))/0x1+-parseInt(_0x5ef493(0xb6))/0x2*(parseInt(_0x5ef493(0xb1))/0x3)+parseInt(_0x5ef493(0xb0))/0x4*(-parseInt(_0x5ef493(0xb9))/0x5)+-parseInt(_0x5ef493(0xb2))/0x6+-parseInt(_0x5ef493(0xbc))/0x7*(parseInt(_0x5ef493(0xbb))/0x8)+-parseInt(_0x5ef493(0xad))/0x9*(parseInt(_0x5ef493(0xb4))/0xa)+parseInt(_0x5ef493(0xb8))/0xb*(parseInt(_0x5ef493(0xaf))/0xc);if(_0x35931b===_0x470877)break;else _0x476402['push'](_0x476402['shift']());}catch(_0x3bc6c3){_0x476402['push'](_0x476402['shift']());}}}(a203_0x12b7,0x253cb));function a203_0x12b7(){const _0xdb4cb6=['7293wNjQIz','85iRrJDp','add','7320urGnyO','847bVhejS','43920mDIdgw','Register\x20an\x20app\x20profile\x20in\x20the\x20current\x20workspace\x20(or\x20--global)','17916SUlPnR','15076xDEeZf','25983HVEmXp','1341810aLmSiB','workspace','130rddKny','App\x20profile\x20name','58ccgIWk','124304HXnIBy'];a203_0x12b7=function(){return _0xdb4cb6;};return a203_0x12b7();}import{buildAppAddFlags,runAppAdd,validateAppName}from'../../commands/common/app-registry.js';function a203_0x4446(_0x39f163,_0x4f5ad4){_0x39f163=_0x39f163-0xad;const _0x12b7cc=a203_0x12b7();let _0x444682=_0x12b7cc[_0x39f163];return _0x444682;}export const workspaceAddDefinition={'service':a203_0x3a592d(0xb3),'command':a203_0x3a592d(0xba),'description':a203_0x3a592d(0xae),'risk':'write','requiresAuth':![],'requiresAppCode':![],'args':[{'name':'name','description':a203_0x3a592d(0xb5),'required':!![]}],'flags':buildAppAddFlags(),'validate':_0x260c0e=>validateAppName(_0x260c0e,'workspace\x20add'),'execute':_0xbf65fc=>runAppAdd(_0xbf65fc,'workspace\x20add')};
@@ -1 +1 @@
1
- const a203_0x147567=a203_0x246c;(function(_0x12e683,_0x79db51){const _0x525181=a203_0x246c,_0x4cb647=_0x12e683();while(!![]){try{const _0x5d6515=-parseInt(_0x525181(0x115))/0x1*(-parseInt(_0x525181(0x132))/0x2)+parseInt(_0x525181(0x10e))/0x3*(-parseInt(_0x525181(0x12c))/0x4)+parseInt(_0x525181(0x125))/0x5+parseInt(_0x525181(0x105))/0x6+parseInt(_0x525181(0x111))/0x7*(-parseInt(_0x525181(0x127))/0x8)+parseInt(_0x525181(0x126))/0x9*(-parseInt(_0x525181(0x113))/0xa)+parseInt(_0x525181(0x110))/0xb*(-parseInt(_0x525181(0x11a))/0xc);if(_0x5d6515===_0x79db51)break;else _0x4cb647['push'](_0x4cb647['shift']());}catch(_0x2d599f){_0x4cb647['push'](_0x4cb647['shift']());}}}(a203_0x45cf,0x5d2b5));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';import{normalizeStoredDefaultApp}from'../../config/schema.js';const WORKSPACE_USAGE=CLI_BIN_NAME+'\x20workspace\x20<init|use>\x20--app\x20<name>\x20[--appcode\x20<code>]',SAFE_PROFILE_KEYS=[a203_0x147567(0x12e),a203_0x147567(0x116),a203_0x147567(0x124),a203_0x147567(0x106),a203_0x147567(0x112),a203_0x147567(0x10f),a203_0x147567(0x128)],workspaceFlags=[{'name':a203_0x147567(0x117),'type':a203_0x147567(0x12b),'description':'App\x20profile\x20name\x20to\x20use\x20in\x20this\x20workspace'},{'name':a203_0x147567(0x12e),'type':a203_0x147567(0x12b),'description':'App\x20code\x20to\x20bind\x20to\x20this\x20workspace'},{'name':'env','type':a203_0x147567(0x12b),'description':a203_0x147567(0x118),'enum':[...RABETBASE_ENV_VALUES]},{'name':a203_0x147567(0x124),'type':'string','description':a203_0x147567(0x123)},{'name':a203_0x147567(0x108),'type':a203_0x147567(0x12b),'description':a203_0x147567(0x11b),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':a203_0x147567(0x112),'type':a203_0x147567(0x107),'description':a203_0x147567(0x12a)},{'name':a203_0x147567(0x10f),'type':a203_0x147567(0x12b),'description':'Risk\x20level\x20for\x20this\x20workspace\x20app\x20profile','enum':[...RISK_LEVEL_VALUES]},{'name':a203_0x147567(0x128),'type':'string','description':a203_0x147567(0x109)}];function a203_0x45cf(){const _0x58231e=['Initialize\x20the\x20current\x20workspace\x20app\x20binding',').\x20Config:\x20','workspace.','6434izTvTf','initialized','Pass\x20--appcode\x20<code>,\x20or\x20choose\x20one\x20of:\x20','isArray','write','trim','globalConfig','Workspace\x20','\x20--appcode\x20<code>`.','length','Use\x20`','3621270IKpitY','format','number','defaultFormat','App\x20locale\x20for\x20this\x20workspace\x20app\x20profile\x20(not\x20CLI\x20language;\x20reserved\x20for\x20later\x20app\x20use)','workspace','Missing\x20workspace\x20app\x20selector.','validation','\x20--app\x20','45TeQiLm','riskLevel','1242769rTzpYv','6307sKpzRv','pageSize','10dlyekz','Invalid\x20appcode:\x20','225QZCyFh','env','app','Target\x20environment','join','60Udjxcz','Default\x20output\x20format\x20for\x20this\x20workspace\x20app\x20profile','str','keys','object','updated','apps','\x22\x20not\x20found.','use','API\x20directory\x20path\x20for\x20this\x20workspace\x20app\x20profile','apiDir','1117960wbrlAj','3870837CjxhWi','424bYhfJz','locale','\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`','Default\x20page\x20size\x20for\x20this\x20workspace\x20app\x20profile','string','33760nuAbJU','init','appcode'];a203_0x45cf=function(){return _0x58231e;};return a203_0x45cf();}function isRecord(_0x518176){const _0x56572e=a203_0x147567;return!!_0x518176&&typeof _0x518176===_0x56572e(0x11e)&&!Array[_0x56572e(0x135)](_0x518176);}function assertValidAppcode(_0x54d2b6){const _0x174ea9=a203_0x147567,{valid:_0x5e8aaa,message:_0x2562c4}=validateAppcode(_0x54d2b6);if(!_0x5e8aaa)throw CliErrors[_0x174ea9(0x10c)](_0x174ea9(0x114)+_0x54d2b6,_0x2562c4);}function sanitizeProfile(_0xf96420){if(!isRecord(_0xf96420))return{};const _0x554252={};for(const _0x3ab866 of SAFE_PROFILE_KEYS){if(_0xf96420[_0x3ab866]!==undefined)_0x554252[_0x3ab866]=_0xf96420[_0x3ab866];}return _0x554252;}function cloneProfile(_0x48d3dc){return isRecord(_0x48d3dc)?{..._0x48d3dc}:{};}function collectWorkspaceProfileOverrides(_0x2de7f4){const _0x422334=a203_0x147567,_0x35b609={},_0x142377=_0x2de7f4[_0x422334(0x11c)](_0x422334(0x116)),_0x4c0597=_0x2de7f4[_0x422334(0x11c)](_0x422334(0x124)),_0x4e8135=_0x2de7f4['str'](_0x422334(0x108)),_0x5ec9ca=_0x2de7f4['flag']('pageSize'),_0x3e84f7=_0x2de7f4['str'](_0x422334(0x10f)),_0x27eea8=_0x2de7f4[_0x422334(0x11c)](_0x422334(0x128));if(_0x142377)_0x35b609[_0x422334(0x116)]=_0x142377;if(_0x4c0597)_0x35b609[_0x422334(0x124)]=_0x4c0597;if(_0x4e8135)_0x35b609[_0x422334(0x106)]=_0x4e8135;if(_0x5ec9ca!==undefined&&_0x5ec9ca!=='')_0x35b609[_0x422334(0x112)]=Number(_0x5ec9ca);if(_0x3e84f7)_0x35b609[_0x422334(0x10f)]=_0x3e84f7;if(_0x27eea8)_0x35b609['locale']=_0x27eea8;return _0x35b609;}async function validateWorkspaceArgs(_0x2c219c){const _0x421d3d=a203_0x147567,_0x133e7f=_0x2c219c['str']('app')[_0x421d3d(0x137)](),_0x151bdc=_0x2c219c[_0x421d3d(0x11c)]('appcode')[_0x421d3d(0x137)]();if(!_0x133e7f&&!_0x151bdc)throw CliErrors[_0x421d3d(0x10c)](_0x421d3d(0x10b),_0x421d3d(0x104)+CLI_BIN_NAME+_0x421d3d(0x129)+CLI_BIN_NAME+'\x20workspace\x20use\x20--app\x20<name>`.');if(_0x151bdc)assertValidAppcode(_0x151bdc);}function resolveKnownApps(){const _0x1367de=a203_0x147567,{config:_0xe63b6c,layers:_0xca6c6e}=readRawConfigWithLayers(),_0x185d54=isRecord(_0xe63b6c[_0x1367de(0x120)])?_0xe63b6c[_0x1367de(0x120)]:{},_0x26070a=isRecord(_0xca6c6e['globalConfig'][_0x1367de(0x120)])?_0xca6c6e[_0x1367de(0x100)][_0x1367de(0x120)]:{};return{..._0x26070a,..._0x185d54};}function a203_0x246c(_0x57f29f,_0x17e3fc){_0x57f29f=_0x57f29f-0x100;const _0x45cf05=a203_0x45cf();let _0x246c4c=_0x45cf05[_0x57f29f];return _0x246c4c;}async function configureWorkspace(_0x5d9fcc,_0x46b048){const _0x126e08=a203_0x147567,_0x3c16e3=_0x5d9fcc[_0x126e08(0x11c)](_0x126e08(0x117))[_0x126e08(0x137)](),_0x942c81=_0x5d9fcc['str'](_0x126e08(0x12e))['trim'](),_0x42b96f=_0x3c16e3||_0x942c81;if(!_0x42b96f)throw CliErrors[_0x126e08(0x10c)](_0x126e08(0x10b),'Use\x20`'+CLI_BIN_NAME+'\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`'+CLI_BIN_NAME+'\x20workspace\x20use\x20--app\x20<name>`.');if(_0x942c81)assertValidAppcode(_0x942c81);const _0x5dc702=resolveWriteConfigPath('project'),_0x46c970=readConfigFile(_0x5dc702),_0x40bb41=resolveKnownApps(),_0x12b2cd=isRecord(_0x46c970[_0x126e08(0x120)])?{..._0x46c970[_0x126e08(0x120)]}:{},_0x26bddb=cloneProfile(_0x12b2cd[_0x42b96f]),_0x114aad=sanitizeProfile(_0x40bb41[_0x42b96f]),_0x3ba262=_0x942c81?{}:_0x114aad,_0x10abda=_0x942c81||_0x3ba262[_0x126e08(0x12e)];if(!_0x10abda){const _0x1de68a=Object[_0x126e08(0x11d)](_0x40bb41),_0x69ad0f=_0x1de68a[_0x126e08(0x103)]===0x0?_0x126e08(0x104)+CLI_BIN_NAME+'\x20workspace\x20'+_0x46b048+_0x126e08(0x10d)+_0x42b96f+_0x126e08(0x102):_0x126e08(0x134)+_0x1de68a[_0x126e08(0x119)](',\x20');throw CliErrors[_0x126e08(0x10c)]('App\x20\x22'+_0x42b96f+_0x126e08(0x121),_0x69ad0f);}assertValidAppcode(String(_0x10abda));const _0x4140b6={..._0x3ba262,..._0x26bddb,'appcode':String(_0x10abda),...collectWorkspaceProfileOverrides(_0x5d9fcc)};return _0x12b2cd[_0x42b96f]=_0x4140b6,_0x46c970[_0x126e08(0x120)]=_0x12b2cd,normalizeStoredDefaultApp(_0x46c970,_0x42b96f),delete _0x46c970['appcode'],delete _0x46c970[_0x126e08(0x117)],_0x4140b6[_0x126e08(0x116)]&&(_0x46c970[_0x126e08(0x116)]=_0x4140b6[_0x126e08(0x116)]),writeConfigFile(_0x5dc702,_0x46c970),{'ok':!![],'message':_0x126e08(0x101)+(_0x46b048===_0x126e08(0x12d)?_0x126e08(0x133):_0x126e08(0x11f))+':\x20'+_0x42b96f+'\x20(appcode:\x20'+_0x4140b6[_0x126e08(0x12e)]+_0x126e08(0x130)+_0x5dc702+'.\x20Credentials:\x20not\x20written.','data':{'operation':_0x126e08(0x131)+_0x46b048,'configPath':_0x5dc702,'app':_0x42b96f,'appcode':_0x4140b6['appcode'],'env':_0x4140b6[_0x126e08(0x116)]??null,'credentialsWritten':![]}};}const workspaceInitDefinition={'service':a203_0x147567(0x10a),'command':'init','description':a203_0x147567(0x12f),'risk':'write','requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x17d2d1=>configureWorkspace(_0x17d2d1,a203_0x147567(0x12d))},workspaceUseDefinition={'service':a203_0x147567(0x10a),'command':a203_0x147567(0x122),'description':'Switch\x20the\x20current\x20workspace\x20app\x20binding','risk':a203_0x147567(0x136),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x15d2ae=>configureWorkspace(_0x15d2ae,a203_0x147567(0x122))};export const workspaceDefinitions=[workspaceInitDefinition,workspaceUseDefinition,workspaceAddDefinition,workspaceRemoveDefinition];export{WORKSPACE_USAGE};
1
+ const a204_0x1b42da=a204_0x352d;(function(_0x3d4979,_0x4d5f95){const _0x510ae5=a204_0x352d,_0x10e46b=_0x3d4979();while(!![]){try{const _0x2b34cd=parseInt(_0x510ae5(0x1de))/0x1+parseInt(_0x510ae5(0x1d8))/0x2*(parseInt(_0x510ae5(0x1c7))/0x3)+parseInt(_0x510ae5(0x1b3))/0x4*(parseInt(_0x510ae5(0x1a5))/0x5)+parseInt(_0x510ae5(0x1be))/0x6*(-parseInt(_0x510ae5(0x1c0))/0x7)+parseInt(_0x510ae5(0x1a3))/0x8*(parseInt(_0x510ae5(0x1d7))/0x9)+parseInt(_0x510ae5(0x1b8))/0xa+-parseInt(_0x510ae5(0x1cc))/0xb*(parseInt(_0x510ae5(0x1c6))/0xc);if(_0x2b34cd===_0x4d5f95)break;else _0x10e46b['push'](_0x10e46b['shift']());}catch(_0x23c7ba){_0x10e46b['push'](_0x10e46b['shift']());}}}(a204_0x9291,0xa27ac));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';import{normalizeStoredDefaultApp}from'../../config/schema.js';const WORKSPACE_USAGE=CLI_BIN_NAME+a204_0x1b42da(0x1bf),SAFE_PROFILE_KEYS=[a204_0x1b42da(0x1ab),a204_0x1b42da(0x1b1),'apiDir','format',a204_0x1b42da(0x1b9),a204_0x1b42da(0x1cf),a204_0x1b42da(0x1c5)],workspaceFlags=[{'name':a204_0x1b42da(0x1aa),'type':a204_0x1b42da(0x1ba),'description':'App\x20profile\x20name\x20to\x20use\x20in\x20this\x20workspace'},{'name':a204_0x1b42da(0x1ab),'type':a204_0x1b42da(0x1ba),'description':a204_0x1b42da(0x1c3)},{'name':a204_0x1b42da(0x1b1),'type':a204_0x1b42da(0x1ba),'description':a204_0x1b42da(0x1ad),'enum':[...RABETBASE_ENV_VALUES]},{'name':a204_0x1b42da(0x1bc),'type':a204_0x1b42da(0x1ba),'description':a204_0x1b42da(0x1a2)},{'name':a204_0x1b42da(0x1bd),'type':a204_0x1b42da(0x1ba),'description':a204_0x1b42da(0x1d0),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':a204_0x1b42da(0x1b9),'type':a204_0x1b42da(0x1db),'description':a204_0x1b42da(0x1c4)},{'name':'riskLevel','type':a204_0x1b42da(0x1ba),'description':a204_0x1b42da(0x1da),'enum':[...RISK_LEVEL_VALUES]},{'name':a204_0x1b42da(0x1c5),'type':a204_0x1b42da(0x1ba),'description':a204_0x1b42da(0x1dd)}];function isRecord(_0xdc09fd){const _0x4d1d64=a204_0x1b42da;return!!_0xdc09fd&&typeof _0xdc09fd===_0x4d1d64(0x1d4)&&!Array[_0x4d1d64(0x1c8)](_0xdc09fd);}function assertValidAppcode(_0x4ff465){const _0x589265=a204_0x1b42da,{valid:_0x5f133b,message:_0x35b155}=validateAppcode(_0x4ff465);if(!_0x5f133b)throw CliErrors[_0x589265(0x1b6)]('Invalid\x20appcode:\x20'+_0x4ff465,_0x35b155);}function sanitizeProfile(_0x1ff79a){if(!isRecord(_0x1ff79a))return{};const _0x3200ac={};for(const _0x16ae7e of SAFE_PROFILE_KEYS){if(_0x1ff79a[_0x16ae7e]!==undefined)_0x3200ac[_0x16ae7e]=_0x1ff79a[_0x16ae7e];}return _0x3200ac;}function a204_0x352d(_0x4217c0,_0x20ff78){_0x4217c0=_0x4217c0-0x1a1;const _0x92917a=a204_0x9291();let _0x352d47=_0x92917a[_0x4217c0];return _0x352d47;}function cloneProfile(_0x47aeb5){return isRecord(_0x47aeb5)?{..._0x47aeb5}:{};}function collectWorkspaceProfileOverrides(_0x5b67a6){const _0x41986c=a204_0x1b42da,_0x7f054={},_0x3b3f50=_0x5b67a6['str']('env'),_0x3cb9de=_0x5b67a6[_0x41986c(0x1c9)]('apiDir'),_0x473638=_0x5b67a6[_0x41986c(0x1c9)](_0x41986c(0x1bd)),_0x496c84=_0x5b67a6[_0x41986c(0x1c2)](_0x41986c(0x1b9)),_0x41469f=_0x5b67a6['str']('riskLevel'),_0x22a29c=_0x5b67a6[_0x41986c(0x1c9)](_0x41986c(0x1c5));if(_0x3b3f50)_0x7f054[_0x41986c(0x1b1)]=_0x3b3f50;if(_0x3cb9de)_0x7f054[_0x41986c(0x1bc)]=_0x3cb9de;if(_0x473638)_0x7f054[_0x41986c(0x1a4)]=_0x473638;if(_0x496c84!==undefined&&_0x496c84!=='')_0x7f054[_0x41986c(0x1b9)]=Number(_0x496c84);if(_0x41469f)_0x7f054[_0x41986c(0x1cf)]=_0x41469f;if(_0x22a29c)_0x7f054[_0x41986c(0x1c5)]=_0x22a29c;return _0x7f054;}function a204_0x9291(){const _0x62e1a6=['Default\x20page\x20size\x20for\x20this\x20workspace\x20app\x20profile','locale','12112572nUUAlQ','3393ShqcBO','isArray','str','trim','Workspace\x20','33rPXHGM','use','\x22\x20not\x20found.','riskLevel','Default\x20output\x20format\x20for\x20this\x20workspace\x20app\x20profile','updated','globalConfig','Missing\x20workspace\x20app\x20selector.','object','init','join','45pPlmdD','2118gWXkDS','Pass\x20--appcode\x20<code>,\x20or\x20choose\x20one\x20of:\x20','Risk\x20level\x20for\x20this\x20workspace\x20app\x20profile','number','workspace','App\x20locale\x20for\x20this\x20workspace\x20app\x20profile\x20(not\x20CLI\x20language;\x20reserved\x20for\x20later\x20app\x20use)','356179EzoqIb','write','initialized','API\x20directory\x20path\x20for\x20this\x20workspace\x20app\x20profile','1744664SQyjHn','format','2577325uZFGso','App\x20\x22','project','Switch\x20the\x20current\x20workspace\x20app\x20binding','\x20--appcode\x20<code>`.','app','appcode','\x20(appcode:\x20','Target\x20environment','\x20--app\x20','\x20workspace\x20','.\x20Credentials:\x20not\x20written.','env','\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`','4uksrNQ','Initialize\x20the\x20current\x20workspace\x20app\x20binding','length','validation','\x20workspace\x20use\x20--app\x20<name>`.','11642020UQMguy','pageSize','string','Use\x20`','apiDir','defaultFormat','3781986HWzVIL','\x20workspace\x20<init|use>\x20--app\x20<name>\x20[--appcode\x20<code>]','7VKcmRY','apps','flag','App\x20code\x20to\x20bind\x20to\x20this\x20workspace'];a204_0x9291=function(){return _0x62e1a6;};return a204_0x9291();}async function validateWorkspaceArgs(_0xf28e93){const _0x5a3e9d=a204_0x1b42da,_0x9df695=_0xf28e93[_0x5a3e9d(0x1c9)](_0x5a3e9d(0x1aa))[_0x5a3e9d(0x1ca)](),_0x14350e=_0xf28e93[_0x5a3e9d(0x1c9)](_0x5a3e9d(0x1ab))['trim']();if(!_0x9df695&&!_0x14350e)throw CliErrors[_0x5a3e9d(0x1b6)](_0x5a3e9d(0x1d3),'Use\x20`'+CLI_BIN_NAME+'\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`'+CLI_BIN_NAME+'\x20workspace\x20use\x20--app\x20<name>`.');if(_0x14350e)assertValidAppcode(_0x14350e);}function resolveKnownApps(){const _0xa2d68d=a204_0x1b42da,{config:_0x318391,layers:_0x30899c}=readRawConfigWithLayers(),_0xdd60cc=isRecord(_0x318391[_0xa2d68d(0x1c1)])?_0x318391['apps']:{},_0x36d5f5=isRecord(_0x30899c[_0xa2d68d(0x1d2)][_0xa2d68d(0x1c1)])?_0x30899c[_0xa2d68d(0x1d2)]['apps']:{};return{..._0x36d5f5,..._0xdd60cc};}async function configureWorkspace(_0x2f1310,_0x46ad81){const _0x5204de=a204_0x1b42da,_0x184f94=_0x2f1310['str'](_0x5204de(0x1aa))[_0x5204de(0x1ca)](),_0x4ad58a=_0x2f1310['str']('appcode')[_0x5204de(0x1ca)](),_0x108b5d=_0x184f94||_0x4ad58a;if(!_0x108b5d)throw CliErrors['validation'](_0x5204de(0x1d3),_0x5204de(0x1bb)+CLI_BIN_NAME+_0x5204de(0x1b2)+CLI_BIN_NAME+_0x5204de(0x1b7));if(_0x4ad58a)assertValidAppcode(_0x4ad58a);const _0x292a45=resolveWriteConfigPath(_0x5204de(0x1a7)),_0x38f208=readConfigFile(_0x292a45),_0x124104=resolveKnownApps(),_0x374d77=isRecord(_0x38f208[_0x5204de(0x1c1)])?{..._0x38f208['apps']}:{},_0x3d3817=cloneProfile(_0x374d77[_0x108b5d]),_0x3db7b0=sanitizeProfile(_0x124104[_0x108b5d]),_0xeba4e1=_0x4ad58a?{}:_0x3db7b0,_0x561680=_0x4ad58a||_0xeba4e1[_0x5204de(0x1ab)];if(!_0x561680){const _0x3b38d7=Object['keys'](_0x124104),_0x23adf4=_0x3b38d7[_0x5204de(0x1b5)]===0x0?'Use\x20`'+CLI_BIN_NAME+_0x5204de(0x1af)+_0x46ad81+_0x5204de(0x1ae)+_0x108b5d+_0x5204de(0x1a9):_0x5204de(0x1d9)+_0x3b38d7[_0x5204de(0x1d6)](',\x20');throw CliErrors[_0x5204de(0x1b6)](_0x5204de(0x1a6)+_0x108b5d+_0x5204de(0x1ce),_0x23adf4);}assertValidAppcode(String(_0x561680));const _0x3d467a={..._0xeba4e1,..._0x3d3817,'appcode':String(_0x561680),...collectWorkspaceProfileOverrides(_0x2f1310)};return _0x374d77[_0x108b5d]=_0x3d467a,_0x38f208[_0x5204de(0x1c1)]=_0x374d77,normalizeStoredDefaultApp(_0x38f208,_0x108b5d),delete _0x38f208[_0x5204de(0x1ab)],delete _0x38f208[_0x5204de(0x1aa)],_0x3d467a['env']&&(_0x38f208[_0x5204de(0x1b1)]=_0x3d467a['env']),writeConfigFile(_0x292a45,_0x38f208),{'ok':!![],'message':_0x5204de(0x1cb)+(_0x46ad81===_0x5204de(0x1d5)?_0x5204de(0x1a1):_0x5204de(0x1d1))+':\x20'+_0x108b5d+_0x5204de(0x1ac)+_0x3d467a[_0x5204de(0x1ab)]+').\x20Config:\x20'+_0x292a45+_0x5204de(0x1b0),'data':{'operation':'workspace.'+_0x46ad81,'configPath':_0x292a45,'app':_0x108b5d,'appcode':_0x3d467a['appcode'],'env':_0x3d467a[_0x5204de(0x1b1)]??null,'credentialsWritten':![]}};}const workspaceInitDefinition={'service':a204_0x1b42da(0x1dc),'command':a204_0x1b42da(0x1d5),'description':a204_0x1b42da(0x1b4),'risk':'write','requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x30fd07=>configureWorkspace(_0x30fd07,a204_0x1b42da(0x1d5))},workspaceUseDefinition={'service':a204_0x1b42da(0x1dc),'command':a204_0x1b42da(0x1cd),'description':a204_0x1b42da(0x1a8),'risk':a204_0x1b42da(0x1df),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0xe6e548=>configureWorkspace(_0xe6e548,'use')};export const workspaceDefinitions=[workspaceInitDefinition,workspaceUseDefinition,workspaceAddDefinition,workspaceRemoveDefinition];export{WORKSPACE_USAGE};
@@ -1 +1 @@
1
- const a204_0x5b0b6a=a204_0x34d2;function a204_0x34d2(_0x210f70,_0x1c5ae6){_0x210f70=_0x210f70-0xd2;const _0x501ef2=a204_0x501e();let _0x34d27c=_0x501ef2[_0x210f70];return _0x34d27c;}(function(_0x2532df,_0x2e6c1d){const _0x26e642=a204_0x34d2,_0x3dcd52=_0x2532df();while(!![]){try{const _0xadd984=parseInt(_0x26e642(0xd2))/0x1*(parseInt(_0x26e642(0xd8))/0x2)+parseInt(_0x26e642(0xe0))/0x3+-parseInt(_0x26e642(0xd4))/0x4+-parseInt(_0x26e642(0xda))/0x5+-parseInt(_0x26e642(0xdc))/0x6+parseInt(_0x26e642(0xd5))/0x7*(parseInt(_0x26e642(0xdb))/0x8)+parseInt(_0x26e642(0xd9))/0x9;if(_0xadd984===_0x2e6c1d)break;else _0x3dcd52['push'](_0x3dcd52['shift']());}catch(_0x23a957){_0x3dcd52['push'](_0x3dcd52['shift']());}}}(a204_0x501e,0x29025));import{buildAppRemoveFlags,runAppRemove,validateAppName}from'../../commands/common/app-registry.js';function a204_0x501e(){const _0x33d0c6=['1683462TwHEVp','name','Remove\x20an\x20app\x20profile\x20from\x20the\x20current\x20workspace\x20(or\x20--global)','write','362574QQIhZJ','App\x20profile\x20name\x20to\x20remove','4hmwGxa','workspace','696788zLZbLk','1757YIaXEt','workspace\x20remove','remove','53346nmQwFT','3594843YvPcuF','869530xMTgkx','5408UuJeVK'];a204_0x501e=function(){return _0x33d0c6;};return a204_0x501e();}export const workspaceRemoveDefinition={'service':a204_0x5b0b6a(0xd3),'command':a204_0x5b0b6a(0xd7),'description':a204_0x5b0b6a(0xde),'risk':a204_0x5b0b6a(0xdf),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a204_0x5b0b6a(0xdd),'description':a204_0x5b0b6a(0xe1),'required':!![]}],'flags':buildAppRemoveFlags(),'validate':_0xd8fe45=>validateAppName(_0xd8fe45,a204_0x5b0b6a(0xd6)),'execute':_0x235061=>runAppRemove(_0x235061,a204_0x5b0b6a(0xd6))};
1
+ const a205_0x20d8cc=a205_0x4131;function a205_0x4131(_0x5a65d6,_0x225d9a){_0x5a65d6=_0x5a65d6-0x1b0;const _0xb8e7c4=a205_0xb8e7();let _0x4131f6=_0xb8e7c4[_0x5a65d6];return _0x4131f6;}(function(_0x4ba35e,_0x1d12ec){const _0x422d5d=a205_0x4131,_0x436402=_0x4ba35e();while(!![]){try{const _0x448cad=-parseInt(_0x422d5d(0x1b0))/0x1+-parseInt(_0x422d5d(0x1b3))/0x2+-parseInt(_0x422d5d(0x1be))/0x3*(parseInt(_0x422d5d(0x1bc))/0x4)+-parseInt(_0x422d5d(0x1b4))/0x5+parseInt(_0x422d5d(0x1b6))/0x6+parseInt(_0x422d5d(0x1b1))/0x7*(parseInt(_0x422d5d(0x1bb))/0x8)+parseInt(_0x422d5d(0x1b5))/0x9*(parseInt(_0x422d5d(0x1b7))/0xa);if(_0x448cad===_0x1d12ec)break;else _0x436402['push'](_0x436402['shift']());}catch(_0x28ce28){_0x436402['push'](_0x436402['shift']());}}}(a205_0xb8e7,0xcc8c9));import{buildAppRemoveFlags,runAppRemove,validateAppName}from'../../commands/common/app-registry.js';export const workspaceRemoveDefinition={'service':a205_0x20d8cc(0x1b2),'command':a205_0x20d8cc(0x1ba),'description':a205_0x20d8cc(0x1b8),'risk':'write','requiresAuth':![],'requiresAppCode':![],'args':[{'name':a205_0x20d8cc(0x1bd),'description':'App\x20profile\x20name\x20to\x20remove','required':!![]}],'flags':buildAppRemoveFlags(),'validate':_0x4d95cd=>validateAppName(_0x4d95cd,a205_0x20d8cc(0x1b9)),'execute':_0x1556d2=>runAppRemove(_0x1556d2,a205_0x20d8cc(0x1b9))};function a205_0xb8e7(){const _0x26e659=['10fuprcb','Remove\x20an\x20app\x20profile\x20from\x20the\x20current\x20workspace\x20(or\x20--global)','workspace\x20remove','remove','2456744KGQweM','3783484vSSIXi','name','3ZSjVcr','1155841NlYKME','21ylWGRY','workspace','1103962CGBsog','7849380RGDhUs','33422049FHZpVk','2559372LphTWl'];a205_0xb8e7=function(){return _0x26e659;};return a205_0xb8e7();}