@lovrabet/rabetbase-cli 2.4.7-beta.1 → 2.4.7

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 (329) hide show
  1. package/README.md +4 -4
  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/auth/auth-server-ui.js +1 -1
  6. package/lib/auth/auth-server.js +1 -1
  7. package/lib/auth/constant.js +1 -1
  8. package/lib/auth/get-cookie.js +1 -1
  9. package/lib/auth/get-session-user.js +1 -1
  10. package/lib/auth/is-session-valid.js +1 -1
  11. package/lib/auth/login-success-html.js +1 -1
  12. package/lib/auth/logout.js +1 -1
  13. package/lib/cli-flags.js +1 -1
  14. package/lib/cli.js +1 -1
  15. package/lib/commands/api/generate.js +1 -1
  16. package/lib/commands/api/index.js +1 -1
  17. package/lib/commands/api/list.js +1 -1
  18. package/lib/commands/api/pull.js +1 -1
  19. package/lib/commands/api/shared.js +1 -1
  20. package/lib/commands/app/index.js +1 -1
  21. package/lib/commands/app/list.js +1 -1
  22. package/lib/commands/app/members-list.js +1 -1
  23. package/lib/commands/app/remote-directory.js +1 -1
  24. package/lib/commands/app/shared.js +1 -1
  25. package/lib/commands/app-config/delete.js +1 -1
  26. package/lib/commands/app-config/get.js +1 -1
  27. package/lib/commands/app-config/index.js +1 -1
  28. package/lib/commands/app-config/list.js +1 -1
  29. package/lib/commands/app-config/set.js +1 -1
  30. package/lib/commands/app-config/shared.js +1 -1
  31. package/lib/commands/auth/index.js +1 -1
  32. package/lib/commands/bff/create.js +1 -1
  33. package/lib/commands/bff/delete.js +1 -1
  34. package/lib/commands/bff/detail.js +1 -1
  35. package/lib/commands/bff/index.js +1 -1
  36. package/lib/commands/bff/list.js +1 -1
  37. package/lib/commands/bff/pull.js +1 -1
  38. package/lib/commands/bff/push.js +1 -1
  39. package/lib/commands/bff/status.js +1 -1
  40. package/lib/commands/cli-skill/index.js +1 -1
  41. package/lib/commands/cli-update.js +1 -1
  42. package/lib/commands/codegen/index.js +1 -1
  43. package/lib/commands/codegen/sdk.js +1 -1
  44. package/lib/commands/codegen/sql.js +1 -1
  45. package/lib/commands/common/app-registry.js +1 -1
  46. package/lib/commands/common/app-selector.js +1 -1
  47. package/lib/commands/common/async-task.js +1 -1
  48. package/lib/commands/common/dry-run.js +1 -1
  49. package/lib/commands/common/flags.d.ts +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/get.js +1 -1
  54. package/lib/commands/config/index.js +1 -1
  55. package/lib/commands/config/list.js +1 -1
  56. package/lib/commands/config/set.js +1 -1
  57. package/lib/commands/config/shared.js +1 -1
  58. package/lib/commands/data/filter.js +1 -1
  59. package/lib/commands/data/getOne.js +1 -1
  60. package/lib/commands/data/index.js +1 -1
  61. package/lib/commands/data/shared.js +1 -1
  62. package/lib/commands/dataset/business-group-update.js +1 -1
  63. package/lib/commands/dataset/business-groups.js +1 -1
  64. package/lib/commands/dataset/capability.js +1 -1
  65. package/lib/commands/dataset/delete.js +1 -1
  66. package/lib/commands/dataset/detail.js +1 -1
  67. package/lib/commands/dataset/extend-update.js +1 -1
  68. package/lib/commands/dataset/field-update.js +1 -1
  69. package/lib/commands/dataset/generate.js +1 -1
  70. package/lib/commands/dataset/index.js +1 -1
  71. package/lib/commands/dataset/list.js +1 -1
  72. package/lib/commands/dataset/operations.js +1 -1
  73. package/lib/commands/dataset/relation-audit.js +1 -1
  74. package/lib/commands/dataset/relation-create.js +1 -1
  75. package/lib/commands/dataset/relation-delete.js +1 -1
  76. package/lib/commands/dataset/relation-shared.js +1 -1
  77. package/lib/commands/dataset/relation-update.js +1 -1
  78. package/lib/commands/dataset/relations.js +1 -1
  79. package/lib/commands/dataset/rename.js +1 -1
  80. package/lib/commands/dataset/restore.js +1 -1
  81. package/lib/commands/db/analysis-batching.js +1 -1
  82. package/lib/commands/db/analyze-batch-plan.js +1 -1
  83. package/lib/commands/db/analyze-cancel.js +1 -1
  84. package/lib/commands/db/analyze-start.js +1 -1
  85. package/lib/commands/db/analyze-status.js +1 -1
  86. package/lib/commands/db/create.js +1 -1
  87. package/lib/commands/db/delete.js +1 -1
  88. package/lib/commands/db/detail.js +1 -1
  89. package/lib/commands/db/diff-refresh-start.js +1 -1
  90. package/lib/commands/db/diff-refresh-status.js +1 -1
  91. package/lib/commands/db/diff.js +1 -1
  92. package/lib/commands/db/index.js +1 -1
  93. package/lib/commands/db/list.js +1 -1
  94. package/lib/commands/db/shared.js +1 -1
  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/init/index.js +1 -1
  101. package/lib/commands/issue/index.js +1 -1
  102. package/lib/commands/issue/nudge.js +1 -1
  103. package/lib/commands/issue/report.js +1 -1
  104. package/lib/commands/issue/shared.js +1 -1
  105. package/lib/commands/kb/create.js +1 -1
  106. package/lib/commands/kb/delete.js +1 -1
  107. package/lib/commands/kb/detail.js +1 -1
  108. package/lib/commands/kb/index.js +1 -1
  109. package/lib/commands/kb/list.js +1 -1
  110. package/lib/commands/kb/search.js +1 -1
  111. package/lib/commands/kb/shared.js +1 -1
  112. package/lib/commands/kb/update.js +1 -1
  113. package/lib/commands/logs/index.js +1 -1
  114. package/lib/commands/menu/asset-update.js +1 -1
  115. package/lib/commands/menu/delete.js +1 -1
  116. package/lib/commands/menu/external-link-create.js +1 -1
  117. package/lib/commands/menu/external-link-update.js +1 -1
  118. package/lib/commands/menu/group-create.js +1 -1
  119. package/lib/commands/menu/group-update.js +1 -1
  120. package/lib/commands/menu/index.js +1 -1
  121. package/lib/commands/menu/list.js +1 -1
  122. package/lib/commands/menu/move.js +1 -1
  123. package/lib/commands/menu/regroup-start.js +1 -1
  124. package/lib/commands/menu/rename.js +1 -1
  125. package/lib/commands/menu/shared/compare-table.js +1 -1
  126. package/lib/commands/menu/shared/delete-plan.js +1 -1
  127. package/lib/commands/menu/shared/facts.js +1 -1
  128. package/lib/commands/menu/shared/index.js +1 -1
  129. package/lib/commands/menu/shared/inquirer.js +1 -1
  130. package/lib/commands/menu/shared/local-pages.js +1 -1
  131. package/lib/commands/menu/shared/logic.js +1 -1
  132. package/lib/commands/menu/shared/mutations.js +1 -1
  133. package/lib/commands/menu/shared/service.js +1 -1
  134. package/lib/commands/menu/shared/sync-core.js +1 -1
  135. package/lib/commands/menu/shared/update-core.js +1 -1
  136. package/lib/commands/menu/shared/valid-url.js +1 -1
  137. package/lib/commands/menu/sync.js +1 -1
  138. package/lib/commands/menu/visibility-update.js +1 -1
  139. package/lib/commands/notification/config-create.js +1 -1
  140. package/lib/commands/notification/config-delete.js +1 -1
  141. package/lib/commands/notification/config-list.js +1 -1
  142. package/lib/commands/notification/config-update.js +1 -1
  143. package/lib/commands/notification/index.js +1 -1
  144. package/lib/commands/notification/shared.js +1 -1
  145. package/lib/commands/ocr/index.js +1 -1
  146. package/lib/commands/page/create.js +1 -1
  147. package/lib/commands/page/custom/detail.js +1 -1
  148. package/lib/commands/page/custom/list.js +1 -1
  149. package/lib/commands/page/custom/publish.js +1 -1
  150. package/lib/commands/page/custom/shared.js +1 -1
  151. package/lib/commands/page/custom/syntax.js +1 -1
  152. package/lib/commands/page/custom/template.js +1 -1
  153. package/lib/commands/page/custom/update.js +1 -1
  154. package/lib/commands/page/data-list-status.js +1 -1
  155. package/lib/commands/page/generate-start.js +1 -1
  156. package/lib/commands/page/generate-status.js +1 -1
  157. package/lib/commands/page/index.js +1 -1
  158. package/lib/commands/page/pull.js +1 -1
  159. package/lib/commands/page/push.js +1 -1
  160. package/lib/commands/page/relation-audit.js +1 -1
  161. package/lib/commands/page/restore.js +1 -1
  162. package/lib/commands/page/shared.js +1 -1
  163. package/lib/commands/page/sync.js +1 -1
  164. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  165. package/lib/commands/project/create/format-elapsed.js +1 -1
  166. package/lib/commands/project/create/main.js +1 -1
  167. package/lib/commands/project/create/materialize-project-template.js +1 -1
  168. package/lib/commands/project/create/project-name.js +1 -1
  169. package/lib/commands/project/create/project-template-archive.js +1 -1
  170. package/lib/commands/project/create/project-template-path.js +1 -1
  171. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  172. package/lib/commands/project/create/use-format-code.js +1 -1
  173. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  174. package/lib/commands/project/index.js +1 -1
  175. package/lib/commands/project/upgrade.js +1 -1
  176. package/lib/commands/registry.js +1 -1
  177. package/lib/commands/role/delete.js +1 -1
  178. package/lib/commands/role/detail.js +1 -1
  179. package/lib/commands/role/index.js +1 -1
  180. package/lib/commands/role/list.js +1 -1
  181. package/lib/commands/role/shared.js +1 -1
  182. package/lib/commands/role/update.js +1 -1
  183. package/lib/commands/role/user-add.js +1 -1
  184. package/lib/commands/role/user-remove.js +1 -1
  185. package/lib/commands/role/user-resolve.js +1 -1
  186. package/lib/commands/run/index.js +1 -1
  187. package/lib/commands/schema.js +1 -1
  188. package/lib/commands/sql/create.js +1 -1
  189. package/lib/commands/sql/delete.js +1 -1
  190. package/lib/commands/sql/detail.js +1 -1
  191. package/lib/commands/sql/exec.js +1 -1
  192. package/lib/commands/sql/index.js +1 -1
  193. package/lib/commands/sql/list.js +1 -1
  194. package/lib/commands/sql/pull.js +1 -1
  195. package/lib/commands/sql/push.js +1 -1
  196. package/lib/commands/sql/shared.js +1 -1
  197. package/lib/commands/sql/status.js +1 -1
  198. package/lib/commands/sql/validate.js +1 -1
  199. package/lib/commands/task/index.js +1 -1
  200. package/lib/commands/task/status.js +1 -1
  201. package/lib/commands/tenant/index.js +1 -1
  202. package/lib/commands/tenant/members-list.js +1 -1
  203. package/lib/commands/tenant/shared.js +1 -1
  204. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  205. package/lib/commands/user-account/index.js +1 -1
  206. package/lib/commands/workspace/add.js +1 -1
  207. package/lib/commands/workspace/index.js +1 -1
  208. package/lib/commands/workspace/remove.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/risk.js +1 -1
  218. package/lib/context/app-resolver.js +1 -1
  219. package/lib/context/auth-resolver.js +1 -1
  220. package/lib/context/config-loader.js +1 -1
  221. package/lib/context.js +1 -1
  222. package/lib/core/alias-resolver.js +1 -1
  223. package/lib/core/api-client.d.ts +1 -1
  224. package/lib/core/api-client.js +1 -1
  225. package/lib/core/bff/config.d.ts +1 -1
  226. package/lib/core/bff/config.js +1 -1
  227. package/lib/core/bff/file-system.d.ts +1 -1
  228. package/lib/core/bff/file-system.js +1 -1
  229. package/lib/core/bff/hash.d.ts +1 -1
  230. package/lib/core/bff/hash.js +1 -1
  231. package/lib/core/bff/lock.d.ts +2 -2
  232. package/lib/core/bff/lock.js +1 -1
  233. package/lib/core/bff/types.d.ts +1 -1
  234. package/lib/core/bff/utils.d.ts +2 -2
  235. package/lib/core/bff/utils.js +1 -1
  236. package/lib/core/db-resolver.js +1 -1
  237. package/lib/core/page/file-system.js +1 -1
  238. package/lib/core/page/hash.js +1 -1
  239. package/lib/core/page/lock.js +1 -1
  240. package/lib/core/sql-index-auditor.js +1 -1
  241. package/lib/core/sql-sync/config.js +1 -1
  242. package/lib/core/sql-sync/file-system.js +1 -1
  243. package/lib/core/sql-sync/hash.js +1 -1
  244. package/lib/core/sql-sync/lock.js +1 -1
  245. package/lib/core/sql-sync/utils.js +1 -1
  246. package/lib/core/sql-validator.js +1 -1
  247. package/lib/errors.js +1 -1
  248. package/lib/framework/build-all-flags.js +1 -1
  249. package/lib/framework/error-output.js +1 -1
  250. package/lib/framework/explicit-yes.js +1 -1
  251. package/lib/framework/flags.js +1 -1
  252. package/lib/framework/help.js +1 -1
  253. package/lib/framework/index.js +1 -1
  254. package/lib/framework/output.js +1 -1
  255. package/lib/framework/response.js +1 -1
  256. package/lib/framework/runner-alias.js +1 -1
  257. package/lib/framework/runner.js +1 -1
  258. package/lib/framework/schema-export.js +1 -1
  259. package/lib/framework/types.js +1 -1
  260. package/lib/generated/build-info.d.ts +4 -4
  261. package/lib/generated/build-info.js +1 -1
  262. package/lib/help.js +1 -1
  263. package/lib/postinstall.js +1 -1
  264. package/lib/runtime/confirmation.js +1 -1
  265. package/lib/runtime/event.js +1 -1
  266. package/lib/runtime/index.js +1 -1
  267. package/lib/runtime/queue.js +1 -1
  268. package/lib/runtime/resolve.js +1 -1
  269. package/lib/skills/builtin-skill.js +1 -1
  270. package/lib/skills/main.js +1 -1
  271. package/lib/skills/npx-skills-add.js +1 -1
  272. package/lib/skills/skill-presence.js +1 -1
  273. package/lib/telemetry/cli-command-trace.js +1 -1
  274. package/lib/telemetry/cli-help-trace.js +1 -1
  275. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  276. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  277. package/lib/telemetry/send-cli-trace-log.js +1 -1
  278. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  279. package/lib/utils/ai_config.js +1 -1
  280. package/lib/utils/apply-jq-filter.js +1 -1
  281. package/lib/utils/cdn-config.js +1 -1
  282. package/lib/utils/check-sdk-version.js +1 -1
  283. package/lib/utils/cli-version-check.js +1 -1
  284. package/lib/utils/cli-version-policy.js +1 -1
  285. package/lib/utils/config.js +1 -1
  286. package/lib/utils/entity-with-id.js +1 -1
  287. package/lib/utils/file-utils.js +1 -1
  288. package/lib/utils/guides-cdn.js +1 -1
  289. package/lib/utils/http-client.js +1 -1
  290. package/lib/utils/is-non-interactive.js +1 -1
  291. package/lib/utils/logger.js +1 -1
  292. package/lib/utils/params.js +1 -1
  293. package/lib/utils/platform.js +1 -1
  294. package/lib/utils/rules-cdn.js +1 -1
  295. package/lib/utils/sleep.js +1 -1
  296. package/lib/utils/template-replacer.js +1 -1
  297. package/lib/utils/update-notice.js +1 -1
  298. package/lib/utils/version.js +1 -1
  299. package/lib/utils/with-active-cookie.js +1 -1
  300. package/lib/utils/write-cli-side-channel.js +1 -1
  301. package/package.json +2 -2
  302. package/sidecar/flags.json +1 -1
  303. package/skills/rabetbase/SKILL.md +28 -28
  304. package/skills/rabetbase/guides/backend-function.md +30 -30
  305. package/skills/rabetbase/guides/best-practices.md +8 -8
  306. package/skills/rabetbase/guides/bff-creation-workflow.md +16 -16
  307. package/skills/rabetbase/guides/conflict-detection.md +3 -3
  308. package/skills/rabetbase/guides/custom-page-workflow.md +8 -8
  309. package/skills/rabetbase/guides/data-api-guidelines.md +6 -6
  310. package/skills/rabetbase/guides/legacy-application-blueprint-workflow.md +8 -8
  311. package/skills/rabetbase/guides/sql-creation-workflow.md +2 -2
  312. package/skills/rabetbase/guides/troubleshooting.md +6 -6
  313. package/skills/rabetbase/guides/typescript-sdk.md +10 -10
  314. package/skills/rabetbase/knowledge/page-schema/LrSmartTable.md +1 -1
  315. package/skills/rabetbase/knowledge/page-schema/external-resources-usage.md +10 -10
  316. package/skills/rabetbase/references/rabetbase-app-config.md +2 -2
  317. package/skills/rabetbase/references/rabetbase-bff-create.md +3 -3
  318. package/skills/rabetbase/references/rabetbase-bff-delete.md +1 -1
  319. package/skills/rabetbase/references/rabetbase-bff-detail.md +4 -4
  320. package/skills/rabetbase/references/rabetbase-bff-list.md +8 -8
  321. package/skills/rabetbase/references/rabetbase-bff-pull.md +1 -1
  322. package/skills/rabetbase/references/rabetbase-bff-push.md +3 -3
  323. package/skills/rabetbase/references/rabetbase-bff-status.md +1 -1
  324. package/skills/rabetbase/references/rabetbase-codegen-sql.md +3 -3
  325. package/skills/rabetbase/references/rabetbase-dataset-detail.md +1 -1
  326. package/skills/rabetbase/references/rabetbase-notification-config-list.md +3 -3
  327. package/skills/rabetbase.manifest.json +3 -3
  328. package/templates/rules/lovrabet_rules.mdc.tpl +7 -7
  329. package/templates/skill/SKILL.md.tpl +12 -12
@@ -1 +1 @@
1
- const a192_0x31a16e=a192_0x4950;(function(_0x4fc993,_0x570ee7){const _0x11843b=a192_0x4950,_0x345665=_0x4fc993();while(!![]){try{const _0x39e117=-parseInt(_0x11843b(0x147))/0x1*(-parseInt(_0x11843b(0x149))/0x2)+parseInt(_0x11843b(0x161))/0x3*(parseInt(_0x11843b(0x145))/0x4)+parseInt(_0x11843b(0x146))/0x5+-parseInt(_0x11843b(0x139))/0x6+-parseInt(_0x11843b(0x166))/0x7*(-parseInt(_0x11843b(0x138))/0x8)+parseInt(_0x11843b(0x14b))/0x9+-parseInt(_0x11843b(0x154))/0xa;if(_0x39e117===_0x570ee7)break;else _0x345665['push'](_0x345665['shift']());}catch(_0x15a956){_0x345665['push'](_0x345665['shift']());}}}(a192_0x2804,0x2909f));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';function a192_0x4950(_0xb96f5b,_0x2a8740){_0xb96f5b=_0xb96f5b-0x133;const _0x280418=a192_0x2804();let _0x495064=_0x280418[_0xb96f5b];return _0x495064;}const PAGE_SIZE=0x64;async function fetchAllSqlQueries(_0x248299,_0x425bd1){const _0x5332ca=a192_0x4950,_0x562c81=[];let _0x183776=0x1;while(!![]){const _0x57323f=await listSqlQueries(_0x248299,{'currentPage':_0x183776,'pageSize':PAGE_SIZE,'sqlCode':_0x425bd1[_0x5332ca(0x13a)],'sqlName':_0x425bd1['sqlName']}),_0x303406=_0x57323f['tableData']??[];_0x562c81[_0x5332ca(0x165)](..._0x303406);if(_0x303406[_0x5332ca(0x134)]===0x0)break;const _0x40ee2e=_0x57323f[_0x5332ca(0x159)]?.[_0x5332ca(0x14f)];if(_0x40ee2e!=null?_0x562c81[_0x5332ca(0x134)]>=_0x40ee2e:_0x303406[_0x5332ca(0x134)]<PAGE_SIZE)break;_0x183776++;}return _0x562c81;}async function ensureSqlContent(_0x4de109){const _0x17987d=a192_0x4950;if(_0x4de109[_0x17987d(0x13c)]!=null&&String(_0x4de109[_0x17987d(0x13c)])[_0x17987d(0x134)]>0x0)return _0x4de109;return getSqlQueryDetail(_0x4de109[_0x17987d(0x13a)]);}export const sqlPull={'service':a192_0x31a16e(0x140),'command':a192_0x31a16e(0x137),'description':'Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','risk':a192_0x31a16e(0x162),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a192_0x31a16e(0x14d),'type':'string','description':a192_0x31a16e(0x133)},{'name':'force','type':'boolean','description':'Force\x20overwrite\x20local\x20unsynced\x20changes'}],async 'dryRun'(_0x385fa3){const _0x5a4d2a=a192_0x31a16e,_0x3d288d=loadSqlProjectConfig(_0x385fa3[_0x5a4d2a(0x143)]),_0x441b44=await readSqlLockFile(_0x3d288d[_0x5a4d2a(0x164)]),{appLock:_0x3600db}=ensureSqlLockScope(_0x441b44??createEmptySqlLock(),_0x3d288d[_0x5a4d2a(0x143)],_0x3d288d[_0x5a4d2a(0x15c)],'pull'),_0x12b88f=await fetchAllSqlQueries(_0x385fa3[_0x5a4d2a(0x143)],{'sqlCode':_0x385fa3[_0x5a4d2a(0x160)](_0x5a4d2a(0x142))||undefined,'sqlName':_0x385fa3[_0x5a4d2a(0x160)](_0x5a4d2a(0x14d))||undefined}),_0x11f302=[];for(const _0x1da2ff of _0x12b88f){const _0x31996a=await ensureSqlContent(_0x1da2ff),_0x10c48b=ensureRemoteSqlContent(_0x31996a),_0x150219=detectModeFromSql(_0x31996a),_0x4f625b=_0x31996a[_0x5a4d2a(0x168)]?await getDbName(_0x385fa3[_0x5a4d2a(0x143)],Number(_0x31996a[_0x5a4d2a(0x168)]))[_0x5a4d2a(0x13f)](()=>undefined):undefined,_0x3ff9cd=buildLocalSqlFileContent({'sqlCode':_0x31996a['sqlCode'],'sqlName':_0x31996a[_0x5a4d2a(0x14a)],'dbId':_0x31996a[_0x5a4d2a(0x168)]},_0x10c48b,{'dbName':_0x4f625b,'mode':_0x150219,'syncedAt':new Date()[_0x5a4d2a(0x14c)](),'description':_0x31996a[_0x5a4d2a(0x141)]}),_0x153c59=buildSqlLockEntry(_0x31996a,_0x10c48b,'',{'dbName':_0x4f625b}),_0x13cfba=resolveLocalSqlFilePath(_0x3d288d,_0x31996a[_0x5a4d2a(0x13a)],_0x153c59);let _0x238cb2='would_pull',_0x474867;if(await fileExists(_0x13cfba)){const _0x11720a=await readFile(_0x13cfba,_0x5a4d2a(0x13d));isEquivalentPulledSqlFile(_0x11720a,_0x3ff9cd,_0x150219)?(_0x238cb2=_0x5a4d2a(0x144),_0x474867=_0x5a4d2a(0x157)):(_0x238cb2=_0x5a4d2a(0x148),_0x474867=_0x5a4d2a(0x13b));}_0x11f302[_0x5a4d2a(0x165)]({'sqlCode':_0x31996a[_0x5a4d2a(0x13a)],'sqlName':_0x31996a[_0x5a4d2a(0x14a)],'filePath':_0x13cfba,'status':_0x238cb2,'reason':_0x474867});}return{'method':_0x5a4d2a(0x151),'url':_0x5a4d2a(0x15d),'body':{'appCode':_0x385fa3[_0x5a4d2a(0x143)],'sqlCode':_0x385fa3[_0x5a4d2a(0x160)](_0x5a4d2a(0x142))||null,'sqlName':_0x385fa3[_0x5a4d2a(0x160)](_0x5a4d2a(0x14d))||null,'files':_0x11f302},'description':_0x5a4d2a(0x136)+_0x11f302[_0x5a4d2a(0x134)]+_0x5a4d2a(0x163)+_0x3d288d[_0x5a4d2a(0x14e)]};},async 'execute'(_0x5b7e23){const _0x20514e=a192_0x31a16e,_0x2d9a86=loadSqlProjectConfig(_0x5b7e23[_0x20514e(0x143)]),_0x4de9c1=await readSqlLockFile(_0x2d9a86[_0x20514e(0x164)]),{lockData:_0x118542,appLock:_0x45667c}=ensureSqlLockScope(_0x4de9c1??createEmptySqlLock(),_0x2d9a86[_0x20514e(0x143)],_0x2d9a86[_0x20514e(0x15c)],'pull'),_0x1c5835=_0x5b7e23[_0x20514e(0x158)]('force'),_0x3420bb=await fetchAllSqlQueries(_0x5b7e23[_0x20514e(0x143)],{'sqlCode':_0x5b7e23[_0x20514e(0x160)](_0x20514e(0x142))||undefined,'sqlName':_0x5b7e23[_0x20514e(0x160)](_0x20514e(0x14d))||undefined});if(_0x3420bb[_0x20514e(0x134)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x20514e(0x155)};const _0x854567=[],_0x572bd2=[];for(const _0x393fd9 of _0x3420bb){try{_0x854567['push'](await ensureSqlContent(_0x393fd9));}catch(_0x34d42f){_0x572bd2[_0x20514e(0x165)]({'sqlCode':_0x393fd9[_0x20514e(0x13a)],'error':_0x34d42f instanceof Error?_0x34d42f[_0x20514e(0x153)]:String(_0x34d42f)});}}if(_0x1c5835&&!_0x5b7e23['nonInteractive']){let _0x23ac94=![];for(const _0x47893a of _0x854567){const _0x5b66fc=detectModeFromSql(_0x47893a),_0x1fbfa8=_0x47893a['dbId']?await getDbName(_0x5b7e23[_0x20514e(0x143)],Number(_0x47893a[_0x20514e(0x168)]))['catch'](()=>undefined):undefined,_0x570b90=buildLocalSqlFileContent({'sqlCode':_0x47893a[_0x20514e(0x13a)],'sqlName':_0x47893a[_0x20514e(0x14a)],'dbId':_0x47893a[_0x20514e(0x168)]},ensureRemoteSqlContent(_0x47893a),{'dbName':_0x1fbfa8,'mode':_0x5b66fc,'syncedAt':new Date()[_0x20514e(0x14c)](),'description':_0x47893a['description']}),_0x1afc92=resolveLocalSqlFilePath(_0x2d9a86,_0x47893a['sqlCode'],buildSqlLockEntry(_0x47893a,ensureRemoteSqlContent(_0x47893a),'',{'dbName':_0x1fbfa8}));if(await fileExists(_0x1afc92)){const _0x89978b=await readFile(_0x1afc92,'utf8');if(!isEquivalentPulledSqlFile(_0x89978b,_0x570b90,_0x5b66fc)){_0x23ac94=!![];break;}}}if(_0x23ac94){const _0x44b8d3=await confirmForceOverwrite('Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.');if(!_0x44b8d3)throw CliErrors[_0x20514e(0x156)]('Force\x20pull\x20cancelled.');}}const _0x4c19da=cloneSqlLockData(_0x118542),_0x5b6e16=_0x4c19da['apps'][_0x2d9a86[_0x20514e(0x143)]],_0x4ec1e4=[],_0x561362=[];for(const _0x25aed7 of _0x854567){const _0x402df2=_0x5b6e16[_0x20514e(0x15a)][_0x25aed7['sqlCode']],_0x36054e=ensureRemoteSqlContent(_0x25aed7),_0x15e0dd=detectModeFromSql(_0x25aed7),_0x40a40c=_0x25aed7[_0x20514e(0x168)]?await getDbName(_0x5b7e23[_0x20514e(0x143)],Number(_0x25aed7['dbId']))['catch'](()=>undefined):undefined,_0x1cd2a1=buildLocalSqlFileContent({'sqlCode':_0x25aed7[_0x20514e(0x13a)],'sqlName':_0x25aed7[_0x20514e(0x14a)],'dbId':_0x25aed7[_0x20514e(0x168)]},_0x36054e,{'dbName':_0x40a40c,'mode':_0x15e0dd,'syncedAt':new Date()['toISOString'](),'description':_0x25aed7[_0x20514e(0x141)]}),_0x16fdd0=buildSqlLockEntry(_0x25aed7,_0x36054e,computeSqlContentHash(_0x1cd2a1),{'dbName':_0x40a40c}),_0x2ab329=_0x16fdd0[_0x20514e(0x152)],_0x4022b4=join(_0x2d9a86[_0x20514e(0x14e)],_0x2ab329);try{if(await fileExists(_0x4022b4)){const _0x2a64f6=await readFile(_0x4022b4,_0x20514e(0x13d));if(isEquivalentPulledSqlFile(_0x2a64f6,_0x1cd2a1,_0x15e0dd)){_0x561362['push']({'sqlCode':_0x25aed7[_0x20514e(0x13a)],'reason':_0x20514e(0x157)}),_0x5b6e16[_0x20514e(0x15a)][_0x25aed7[_0x20514e(0x13a)]]={..._0x16fdd0,'hash':computeSqlContentHash(_0x2a64f6),'path':_0x2ab329};continue;}if(!_0x1c5835){_0x561362[_0x20514e(0x165)]({'sqlCode':_0x25aed7['sqlCode'],'reason':_0x20514e(0x15b)});continue;}}const _0x34a970=_0x402df2?.[_0x20514e(0x152)]?join(_0x2d9a86[_0x20514e(0x14e)],_0x402df2['path']):undefined;_0x34a970&&_0x34a970!==_0x4022b4&&await fileExists(_0x34a970)&&await rm(_0x34a970,{'force':!![]}),await ensureParentDirectory(_0x4022b4),await writeFile(_0x4022b4,_0x1cd2a1,_0x20514e(0x13d)),_0x5b6e16['sqls'][_0x25aed7[_0x20514e(0x13a)]]={..._0x16fdd0,'path':_0x2ab329},_0x4ec1e4['push']({'sqlCode':_0x25aed7['sqlCode'],'filePath':_0x4022b4});}catch(_0x4ba36e){_0x572bd2[_0x20514e(0x165)]({'sqlCode':_0x25aed7[_0x20514e(0x13a)],'error':_0x4ba36e instanceof Error?_0x4ba36e['message']:String(_0x4ba36e)});}}return _0x5b6e16[_0x20514e(0x135)]=new Date()[_0x20514e(0x14c)](),await writeSqlLockFile(_0x2d9a86[_0x20514e(0x164)],_0x4c19da),{'ok':_0x572bd2[_0x20514e(0x134)]===0x0,'data':{'pulled':_0x4ec1e4,'skipped':_0x561362,'failed':_0x572bd2},'message':_0x20514e(0x150)+_0x4ec1e4['length']+_0x20514e(0x15f)+_0x561362['length']+'\x20skipped,\x20'+_0x572bd2[_0x20514e(0x134)]+'\x20failed'};}};function a192_0x2804(){const _0x341844=['3klijnR','conflict','141254QSViBE','sqlName','1806606cmcEOx','toISOString','name','sqlRootDir','totalCount','Pull\x20complete:\x20','POST','path','message','6201360WIqmDg','No\x20remote\x20SQL\x20queries\x20matched.','cancelled','unchanged','bool','paging','sqls','local\x20differs\x20from\x20remote','sqlRoot','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','mybatisXml','\x20written,\x20','str','120768uVEQBn','read','\x20SQL\x20file(s)\x20into\x20','lockFilePath','push','1113126ZcMtNT','test','dbId','Filter\x20by\x20SQL\x20display\x20name','length','lastSync','Would\x20pull\x20','pull','8RjxNdo','1267080nCWdGX','sqlCode','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','sqlContent','utf8','trimStart','catch','sql','description','sqlcode','appCode','skipped','24WaBhHO','931210sDkSdA'];a192_0x2804=function(){return _0x341844;};return a192_0x2804();}function detectModeFromSql(_0x5dea40){const _0x510ea1=a192_0x31a16e,_0xb268e3=ensureRemoteSqlContent(_0x5dea40),_0x57da95=stripLocalSqlMetadata(_0xb268e3,'mybatisXml')[_0x510ea1(0x13e)]();if(/^<(select|insert|update|delete)\b/i[_0x510ea1(0x167)](_0x57da95))return'mybatisXml';return _0x510ea1(0x140);}function isEquivalentPulledSqlFile(_0x3ca97e,_0x935234,_0x4f24f2){return normalizePullComparableContent(_0x3ca97e,_0x4f24f2)===normalizePullComparableContent(_0x935234,_0x4f24f2);}function normalizePullComparableContent(_0x119bbc,_0x2f970d){const _0x54badd=_0x119bbc['replace'](/\r\n/g,'\x0a')['split']('\x0a'),_0x4c4224=_0x54badd['filter'](_0x180793=>!isSyncedAtMetadataLine(_0x180793,_0x2f970d));return _0x4c4224['join']('\x0a');}function isSyncedAtMetadataLine(_0x2d270d,_0x42ed1d){const _0x45e6fd=a192_0x31a16e;if(_0x42ed1d===_0x45e6fd(0x15e))return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0x45e6fd(0x167)](_0x2d270d);return/^\s*--\s*@lovrabet\.syncedAt:/['test'](_0x2d270d);}
1
+ const a192_0xbf43bb=a192_0x1e27;(function(_0xd2033a,_0x1980eb){const _0x2caf1a=a192_0x1e27,_0x190d45=_0xd2033a();while(!![]){try{const _0x5a851c=parseInt(_0x2caf1a(0xdb))/0x1+parseInt(_0x2caf1a(0xd5))/0x2+-parseInt(_0x2caf1a(0xd3))/0x3+parseInt(_0x2caf1a(0xf4))/0x4+-parseInt(_0x2caf1a(0xe0))/0x5*(parseInt(_0x2caf1a(0xc6))/0x6)+-parseInt(_0x2caf1a(0xc7))/0x7*(parseInt(_0x2caf1a(0xe9))/0x8)+parseInt(_0x2caf1a(0xc8))/0x9*(parseInt(_0x2caf1a(0xd6))/0xa);if(_0x5a851c===_0x1980eb)break;else _0x190d45['push'](_0x190d45['shift']());}catch(_0x4b7827){_0x190d45['push'](_0x190d45['shift']());}}}(a192_0xfc93,0x4596d));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';function a192_0x1e27(_0x28bc5f,_0x121772){_0x28bc5f=_0x28bc5f-0xc6;const _0xfc930=a192_0xfc93();let _0x1e27f9=_0xfc930[_0x28bc5f];return _0x1e27f9;}import{getDbName}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{CliErrors}from'../../errors.js';function a192_0xfc93(){const _0xc68114=['1254717GeJBHz','dbId','Force\x20pull\x20cancelled.','push','bool','sqlName','length','catch','sqls','appCode','toISOString','1316022OSydXQ','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','86774tiNQWg','10SMrCIC','name','\x20skipped,\x20','Would\x20pull\x20','trimStart','498280EHOaiw','str','force','Pull\x20complete:\x20','mybatisXml','5UtTXuM','sqlCode','utf8','boolean','\x20failed','join','pull','read','No\x20remote\x20SQL\x20queries\x20matched.','664712eJSftf','totalCount','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','sqlContent','path','cancelled','sql','replace','apps','paging','would_pull','1690816mKDhWr','sqlRootDir','conflict','split','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','sqlRoot','message','lockFilePath','filter','local\x20differs\x20from\x20remote','tableData','string','sqlcode','description','test','286302SHUwUl','28tIREDK'];a192_0xfc93=function(){return _0xc68114;};return a192_0xfc93();}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(_0x2cb5e9,_0x351067){const _0x153705=a192_0x1e27,_0x56d9e1=[];let _0x520a05=0x1;while(!![]){const _0xfad0de=await listSqlQueries(_0x2cb5e9,{'currentPage':_0x520a05,'pageSize':PAGE_SIZE,'sqlCode':_0x351067[_0x153705(0xe1)],'sqlName':_0x351067[_0x153705(0xcd)]}),_0x5f1c10=_0xfad0de[_0x153705(0xfe)]??[];_0x56d9e1[_0x153705(0xcb)](..._0x5f1c10);if(_0x5f1c10['length']===0x0)break;const _0x562354=_0xfad0de[_0x153705(0xf2)]?.[_0x153705(0xea)];if(_0x562354!=null?_0x56d9e1['length']>=_0x562354:_0x5f1c10[_0x153705(0xce)]<PAGE_SIZE)break;_0x520a05++;}return _0x56d9e1;}async function ensureSqlContent(_0x1c9c16){const _0x60958d=a192_0x1e27;if(_0x1c9c16['sqlContent']!=null&&String(_0x1c9c16[_0x60958d(0xec)])[_0x60958d(0xce)]>0x0)return _0x1c9c16;return getSqlQueryDetail(_0x1c9c16[_0x60958d(0xe1)]);}export const sqlPull={'service':'sql','command':a192_0xbf43bb(0xe6),'description':'Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','risk':a192_0xbf43bb(0xe7),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a192_0xbf43bb(0xd7),'type':a192_0xbf43bb(0xff),'description':'Filter\x20by\x20SQL\x20display\x20name'},{'name':a192_0xbf43bb(0xdd),'type':a192_0xbf43bb(0xe3),'description':'Force\x20overwrite\x20local\x20unsynced\x20changes'}],async 'dryRun'(_0x5bc1f8){const _0x5d2253=a192_0xbf43bb,_0xed4496=loadSqlProjectConfig(_0x5bc1f8[_0x5d2253(0xd1)]),_0xae8e51=await readSqlLockFile(_0xed4496['lockFilePath']),{appLock:_0x20a185}=ensureSqlLockScope(_0xae8e51??createEmptySqlLock(),_0xed4496[_0x5d2253(0xd1)],_0xed4496[_0x5d2253(0xf9)],_0x5d2253(0xe6)),_0x11fc78=await fetchAllSqlQueries(_0x5bc1f8[_0x5d2253(0xd1)],{'sqlCode':_0x5bc1f8[_0x5d2253(0xdc)](_0x5d2253(0x100))||undefined,'sqlName':_0x5bc1f8[_0x5d2253(0xdc)](_0x5d2253(0xd7))||undefined}),_0x1560b8=[];for(const _0x4cf171 of _0x11fc78){const _0x574f3d=await ensureSqlContent(_0x4cf171),_0x562f65=ensureRemoteSqlContent(_0x574f3d),_0x48d12d=detectModeFromSql(_0x574f3d),_0x1340b2=_0x574f3d['dbId']?await getDbName(_0x5bc1f8[_0x5d2253(0xd1)],Number(_0x574f3d[_0x5d2253(0xc9)]))['catch'](()=>undefined):undefined,_0x5007b5=buildLocalSqlFileContent({'sqlCode':_0x574f3d[_0x5d2253(0xe1)],'sqlName':_0x574f3d['sqlName'],'dbId':_0x574f3d[_0x5d2253(0xc9)]},_0x562f65,{'dbName':_0x1340b2,'mode':_0x48d12d,'syncedAt':new Date()[_0x5d2253(0xd2)](),'description':_0x574f3d['description']}),_0x3a69a0=buildSqlLockEntry(_0x574f3d,_0x562f65,'',{'dbName':_0x1340b2}),_0x36e775=resolveLocalSqlFilePath(_0xed4496,_0x574f3d[_0x5d2253(0xe1)],_0x3a69a0);let _0x47dd82=_0x5d2253(0xf3),_0x236b16;if(await fileExists(_0x36e775)){const _0x1c3854=await readFile(_0x36e775,'utf8');isEquivalentPulledSqlFile(_0x1c3854,_0x5007b5,_0x48d12d)?(_0x47dd82='skipped',_0x236b16='unchanged'):(_0x47dd82=_0x5d2253(0xf6),_0x236b16=_0x5d2253(0xd4));}_0x1560b8[_0x5d2253(0xcb)]({'sqlCode':_0x574f3d[_0x5d2253(0xe1)],'sqlName':_0x574f3d[_0x5d2253(0xcd)],'filePath':_0x36e775,'status':_0x47dd82,'reason':_0x236b16});}return{'method':'POST','url':_0x5d2253(0xeb),'body':{'appCode':_0x5bc1f8[_0x5d2253(0xd1)],'sqlCode':_0x5bc1f8[_0x5d2253(0xdc)](_0x5d2253(0x100))||null,'sqlName':_0x5bc1f8[_0x5d2253(0xdc)](_0x5d2253(0xd7))||null,'files':_0x1560b8},'description':_0x5d2253(0xd9)+_0x1560b8[_0x5d2253(0xce)]+'\x20SQL\x20file(s)\x20into\x20'+_0xed4496['sqlRootDir']};},async 'execute'(_0x2d5c4f){const _0x12c457=a192_0xbf43bb,_0x3bd95a=loadSqlProjectConfig(_0x2d5c4f['appCode']),_0x21f6e1=await readSqlLockFile(_0x3bd95a[_0x12c457(0xfb)]),{lockData:_0x107e77,appLock:_0x21f37a}=ensureSqlLockScope(_0x21f6e1??createEmptySqlLock(),_0x3bd95a['appCode'],_0x3bd95a['sqlRoot'],'pull'),_0x4147b8=_0x2d5c4f[_0x12c457(0xcc)](_0x12c457(0xdd)),_0x550ac4=await fetchAllSqlQueries(_0x2d5c4f['appCode'],{'sqlCode':_0x2d5c4f[_0x12c457(0xdc)](_0x12c457(0x100))||undefined,'sqlName':_0x2d5c4f[_0x12c457(0xdc)](_0x12c457(0xd7))||undefined});if(_0x550ac4['length']===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x12c457(0xe8)};const _0x295f07=[],_0x29485d=[];for(const _0x44ca02 of _0x550ac4){try{_0x295f07[_0x12c457(0xcb)](await ensureSqlContent(_0x44ca02));}catch(_0x3f9003){_0x29485d[_0x12c457(0xcb)]({'sqlCode':_0x44ca02[_0x12c457(0xe1)],'error':_0x3f9003 instanceof Error?_0x3f9003[_0x12c457(0xfa)]:String(_0x3f9003)});}}if(_0x4147b8&&!_0x2d5c4f['nonInteractive']){let _0x1879f9=![];for(const _0x431102 of _0x295f07){const _0x478d46=detectModeFromSql(_0x431102),_0x5abaa3=_0x431102[_0x12c457(0xc9)]?await getDbName(_0x2d5c4f[_0x12c457(0xd1)],Number(_0x431102['dbId']))[_0x12c457(0xcf)](()=>undefined):undefined,_0x17d1fb=buildLocalSqlFileContent({'sqlCode':_0x431102['sqlCode'],'sqlName':_0x431102[_0x12c457(0xcd)],'dbId':_0x431102['dbId']},ensureRemoteSqlContent(_0x431102),{'dbName':_0x5abaa3,'mode':_0x478d46,'syncedAt':new Date()[_0x12c457(0xd2)](),'description':_0x431102[_0x12c457(0x101)]}),_0xbdc3ed=resolveLocalSqlFilePath(_0x3bd95a,_0x431102['sqlCode'],buildSqlLockEntry(_0x431102,ensureRemoteSqlContent(_0x431102),'',{'dbName':_0x5abaa3}));if(await fileExists(_0xbdc3ed)){const _0x4f0614=await readFile(_0xbdc3ed,_0x12c457(0xe2));if(!isEquivalentPulledSqlFile(_0x4f0614,_0x17d1fb,_0x478d46)){_0x1879f9=!![];break;}}}if(_0x1879f9){const _0x264ba4=await confirmForceOverwrite(_0x12c457(0xf8));if(!_0x264ba4)throw CliErrors[_0x12c457(0xee)](_0x12c457(0xca));}}const _0x24f311=cloneSqlLockData(_0x107e77),_0x321dcb=_0x24f311[_0x12c457(0xf1)][_0x3bd95a['appCode']],_0xd5dd3f=[],_0x5e213e=[];for(const _0x171ac9 of _0x295f07){const _0x16d4b3=_0x321dcb['sqls'][_0x171ac9['sqlCode']],_0xb15f86=ensureRemoteSqlContent(_0x171ac9),_0x517b21=detectModeFromSql(_0x171ac9),_0x3fb37d=_0x171ac9[_0x12c457(0xc9)]?await getDbName(_0x2d5c4f['appCode'],Number(_0x171ac9['dbId']))[_0x12c457(0xcf)](()=>undefined):undefined,_0x58a1d3=buildLocalSqlFileContent({'sqlCode':_0x171ac9[_0x12c457(0xe1)],'sqlName':_0x171ac9[_0x12c457(0xcd)],'dbId':_0x171ac9[_0x12c457(0xc9)]},_0xb15f86,{'dbName':_0x3fb37d,'mode':_0x517b21,'syncedAt':new Date()[_0x12c457(0xd2)](),'description':_0x171ac9[_0x12c457(0x101)]}),_0x37ab2b=buildSqlLockEntry(_0x171ac9,_0xb15f86,computeSqlContentHash(_0x58a1d3),{'dbName':_0x3fb37d}),_0x43853e=_0x37ab2b['path'],_0x5533f0=join(_0x3bd95a[_0x12c457(0xf5)],_0x43853e);try{if(await fileExists(_0x5533f0)){const _0x6d4a6d=await readFile(_0x5533f0,_0x12c457(0xe2));if(isEquivalentPulledSqlFile(_0x6d4a6d,_0x58a1d3,_0x517b21)){_0x5e213e[_0x12c457(0xcb)]({'sqlCode':_0x171ac9['sqlCode'],'reason':'unchanged'}),_0x321dcb['sqls'][_0x171ac9[_0x12c457(0xe1)]]={..._0x37ab2b,'hash':computeSqlContentHash(_0x6d4a6d),'path':_0x43853e};continue;}if(!_0x4147b8){_0x5e213e[_0x12c457(0xcb)]({'sqlCode':_0x171ac9['sqlCode'],'reason':_0x12c457(0xfd)});continue;}}const _0x2f76bb=_0x16d4b3?.[_0x12c457(0xed)]?join(_0x3bd95a['sqlRootDir'],_0x16d4b3['path']):undefined;_0x2f76bb&&_0x2f76bb!==_0x5533f0&&await fileExists(_0x2f76bb)&&await rm(_0x2f76bb,{'force':!![]}),await ensureParentDirectory(_0x5533f0),await writeFile(_0x5533f0,_0x58a1d3,_0x12c457(0xe2)),_0x321dcb[_0x12c457(0xd0)][_0x171ac9['sqlCode']]={..._0x37ab2b,'path':_0x43853e},_0xd5dd3f[_0x12c457(0xcb)]({'sqlCode':_0x171ac9[_0x12c457(0xe1)],'filePath':_0x5533f0});}catch(_0x1a634d){_0x29485d[_0x12c457(0xcb)]({'sqlCode':_0x171ac9['sqlCode'],'error':_0x1a634d instanceof Error?_0x1a634d[_0x12c457(0xfa)]:String(_0x1a634d)});}}return _0x321dcb['lastSync']=new Date()[_0x12c457(0xd2)](),await writeSqlLockFile(_0x3bd95a[_0x12c457(0xfb)],_0x24f311),{'ok':_0x29485d[_0x12c457(0xce)]===0x0,'data':{'pulled':_0xd5dd3f,'skipped':_0x5e213e,'failed':_0x29485d},'message':_0x12c457(0xde)+_0xd5dd3f['length']+'\x20written,\x20'+_0x5e213e[_0x12c457(0xce)]+_0x12c457(0xd8)+_0x29485d[_0x12c457(0xce)]+_0x12c457(0xe4)};}};function detectModeFromSql(_0xbf937e){const _0xfd8509=a192_0xbf43bb,_0x1c48b6=ensureRemoteSqlContent(_0xbf937e),_0x3bd863=stripLocalSqlMetadata(_0x1c48b6,'mybatisXml')[_0xfd8509(0xda)]();if(/^<(select|insert|update|delete)\b/i[_0xfd8509(0x102)](_0x3bd863))return _0xfd8509(0xdf);return _0xfd8509(0xef);}function isEquivalentPulledSqlFile(_0x2cca1f,_0x1cb368,_0x19ed2e){return normalizePullComparableContent(_0x2cca1f,_0x19ed2e)===normalizePullComparableContent(_0x1cb368,_0x19ed2e);}function normalizePullComparableContent(_0x577c5a,_0x757556){const _0x49defd=a192_0xbf43bb,_0x512a1a=_0x577c5a[_0x49defd(0xf0)](/\r\n/g,'\x0a')[_0x49defd(0xf7)]('\x0a'),_0x1f2b26=_0x512a1a[_0x49defd(0xfc)](_0x1496bd=>!isSyncedAtMetadataLine(_0x1496bd,_0x757556));return _0x1f2b26[_0x49defd(0xe5)]('\x0a');}function isSyncedAtMetadataLine(_0x3a8e3d,_0x5b5946){if(_0x5b5946==='mybatisXml')return/^\s*<!--\s*@lovrabet\.syncedAt:/['test'](_0x3a8e3d);return/^\s*--\s*@lovrabet\.syncedAt:/['test'](_0x3a8e3d);}
@@ -1 +1 @@
1
- const a193_0x579b6e=a193_0x1b34;(function(_0x237eb6,_0x1e6c45){const _0x1a4cb2=a193_0x1b34,_0x3ea555=_0x237eb6();while(!![]){try{const _0x536f32=-parseInt(_0x1a4cb2(0x178))/0x1*(-parseInt(_0x1a4cb2(0x17e))/0x2)+-parseInt(_0x1a4cb2(0x194))/0x3*(-parseInt(_0x1a4cb2(0x19f))/0x4)+-parseInt(_0x1a4cb2(0x1b6))/0x5*(parseInt(_0x1a4cb2(0x17a))/0x6)+-parseInt(_0x1a4cb2(0x175))/0x7*(-parseInt(_0x1a4cb2(0x1b3))/0x8)+parseInt(_0x1a4cb2(0x19d))/0x9+parseInt(_0x1a4cb2(0x1a9))/0xa*(-parseInt(_0x1a4cb2(0x1af))/0xb)+-parseInt(_0x1a4cb2(0x193))/0xc;if(_0x536f32===_0x1e6c45)break;else _0x3ea555['push'](_0x3ea555['shift']());}catch(_0x52c1fe){_0x3ea555['push'](_0x3ea555['shift']());}}}(a193_0x4592,0xb2506));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x38d9fb,_0x252221,_0xd702a){const _0x3fd558=a193_0x1b34,_0x5863eb=await scanLocalSqlQueries(_0x38d9fb),_0x2b7ba8=new Map();for(const _0x3398ad of _0x5863eb){if(_0xd702a&&_0x3398ad[_0x3fd558(0x17d)]!==_0xd702a)continue;const _0xe26764=_0x2b7ba8[_0x3fd558(0x1a3)](_0x3398ad[_0x3fd558(0x17d)])??[];_0xe26764['push'](_0x3398ad),_0x2b7ba8['set'](_0x3398ad[_0x3fd558(0x17d)],_0xe26764);}if(_0xd702a&&!_0x2b7ba8[_0x3fd558(0x177)](_0xd702a))throw CliErrors[_0x3fd558(0x181)](_0x3fd558(0x1a0)+_0xd702a);const _0x285c7c=[];for(const [_0x210651,_0x3b951f]of _0x2b7ba8[_0x3fd558(0x1b1)]()){if(_0x3b951f[_0x3fd558(0x192)]===0x1){_0x285c7c['push'](_0x3b951f[0x0]);continue;}const _0x4a40dc=_0x252221[_0x3fd558(0x184)][_0x210651],_0x1addbc=_0x4a40dc?.['path'],_0x14ba34=_0x1addbc?_0x3b951f[_0x3fd558(0x17f)](_0x2a76c2=>_0x2a76c2[_0x3fd558(0x1ab)]!==_0x1addbc):_0x3b951f;if(_0x4a40dc&&_0x14ba34[_0x3fd558(0x192)]===0x1){_0x285c7c['push'](_0x14ba34[0x0]);continue;}throw CliErrors[_0x3fd558(0x181)](_0x3fd558(0x18b)+_0x210651+_0x3fd558(0x180));}return _0x285c7c;}function a193_0x4592(){const _0x5db434=['Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','exec','\x20pushed,\x20','mode','boolean','hash','write','length','20156700XmcKXY','28893XWrcKk','sql','POST','push','\x20failed','startsWith','utf8','bool','projectRoot','4482360FJsyya','dbName','292BGiaNk','Local\x20SQL\x20not\x20found:\x20','No\x20local\x20SQL\x20files\x20found.','\x22\x20for\x20sqlCode\x20','get','catch','Push\x20local\x20SQL\x20files\x20to\x20remote','lockFilePath','path','toISOString','115670gxplcE','/smartapi/custom/updateUserCustomSql','relativePath','str','message','dbDirectory','88OkDiZz','dbId','entries','trashDir','240bkzWKs','replace','sqlConfig','5SnlGaA','Push\x20complete:\x20','327747ogbJtm','map','has','1516DkMMhS','No\x20database\x20matches\x20local\x20directory\x20\x22','2164908HrHDOf','force','remoteId','sqlCode','340eBZfMh','filter','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','validation','appCode','filePath','sqls','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','sqlName','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','version','sqlRoot','Local\x20directory\x20\x22'];a193_0x4592=function(){return _0x5db434;};return a193_0x4592();}export const sqlPush={'service':a193_0x579b6e(0x195),'command':a193_0x579b6e(0x197),'description':a193_0x579b6e(0x1a5),'risk':a193_0x579b6e(0x191),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a193_0x579b6e(0x17b),'type':a193_0x579b6e(0x18f),'description':'Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock'}],async 'dryRun'(_0x4b0ea4){const _0x3c8f15=a193_0x579b6e,_0xff6731=loadSqlProjectConfig(_0x4b0ea4[_0x3c8f15(0x182)]),_0x423c92=await readSqlLockFile(_0xff6731[_0x3c8f15(0x1a6)]),{appLock:_0x861581}=ensureSqlLockScope(_0x423c92??createEmptySqlLock(),_0x4b0ea4[_0x3c8f15(0x182)],_0xff6731['sqlRoot'],_0x3c8f15(0x197)),_0x44bad6=await getTargetSqlQueries(_0xff6731,_0x861581,_0x4b0ea4[_0x3c8f15(0x1ac)]('sqlcode')||undefined),_0x35349b=[];for(const _0x47bbf7 of _0x44bad6){const _0x217b87=await computeSqlFileHash(_0x47bbf7[_0x3c8f15(0x183)]),_0x12f89b=_0x861581['sqls'][_0x47bbf7[_0x3c8f15(0x17d)]],_0x467100=!!_0x12f89b&&(_0x12f89b[_0x3c8f15(0x1a7)]!==_0x47bbf7[_0x3c8f15(0x1ab)]||!!_0x47bbf7[_0x3c8f15(0x186)]&&_0x12f89b['sqlName']!==_0x47bbf7[_0x3c8f15(0x186)]);if(!_0x4b0ea4['bool'](_0x3c8f15(0x17b))&&_0x12f89b&&_0x12f89b[_0x3c8f15(0x190)]===_0x217b87&&!_0x467100)continue;_0x35349b[_0x3c8f15(0x197)](_0x47bbf7[_0x3c8f15(0x17d)]);}return{'method':_0x3c8f15(0x196),'url':_0x3c8f15(0x1aa),'body':{'sqlCodes':_0x35349b,'appCode':_0x4b0ea4[_0x3c8f15(0x182)]},'description':'Would\x20push\x20'+_0x35349b[_0x3c8f15(0x192)]+'\x20SQL\x20file(s)'};},async 'execute'(_0x3aa027){const _0x6577bc=a193_0x579b6e,_0x24ba01=loadSqlProjectConfig(_0x3aa027[_0x6577bc(0x182)]),_0xe239c5=await readSqlLockFile(_0x24ba01['lockFilePath']),{lockData:_0x530083,appLock:_0x518dcb}=ensureSqlLockScope(_0xe239c5??createEmptySqlLock(),_0x3aa027[_0x6577bc(0x182)],_0x24ba01[_0x6577bc(0x189)],_0x6577bc(0x197)),_0x1e9671=await getTargetSqlQueries(_0x24ba01,_0x518dcb,_0x3aa027[_0x6577bc(0x1ac)]('sqlcode')||undefined);if(_0x1e9671[_0x6577bc(0x192)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x6577bc(0x1a1)};const _0x47228e=[],_0x7cee38=[],_0x16185f=[];for(const _0x35a73e of _0x1e9671){const _0x3174b4=_0x518dcb[_0x6577bc(0x184)][_0x35a73e[_0x6577bc(0x17d)]];if(!_0x3174b4){_0x16185f['push']({'sqlCode':_0x35a73e[_0x6577bc(0x17d)],'error':_0x6577bc(0x185)});continue;}try{const _0x36b1d3=await computeSqlFileHash(_0x35a73e[_0x6577bc(0x183)]),_0x11f315=_0x3174b4[_0x6577bc(0x1a7)]!==_0x35a73e[_0x6577bc(0x1ab)]||!!_0x35a73e[_0x6577bc(0x186)]&&_0x3174b4[_0x6577bc(0x186)]!==_0x35a73e[_0x6577bc(0x186)];if(!_0x3aa027[_0x6577bc(0x19b)](_0x6577bc(0x17b))&&_0x3174b4[_0x6577bc(0x190)]===_0x36b1d3&&!_0x11f315){_0x7cee38[_0x6577bc(0x197)]({'sqlCode':_0x35a73e[_0x6577bc(0x17d)],'reason':'unchanged'});continue;}if(_0x3174b4[_0x6577bc(0x188)]==null){_0x16185f[_0x6577bc(0x197)]({'sqlCode':_0x35a73e[_0x6577bc(0x17d)],'error':_0x6577bc(0x187)});continue;}const _0x143ed9=await readFile(_0x35a73e[_0x6577bc(0x183)],_0x6577bc(0x19a)),_0x30850f=stripLocalSqlMetadata(_0x143ed9,_0x35a73e[_0x6577bc(0x18e)]),_0x5bf308=_0x35a73e[_0x6577bc(0x186)]||_0x3174b4['sqlName'],_0x6c9e29=await resolveTargetDbBinding(_0x3aa027[_0x6577bc(0x182)],_0x35a73e,_0x3174b4),_0x33642f=await updateSqlQuery({'id':_0x3174b4[_0x6577bc(0x17c)],'appCode':_0x3aa027[_0x6577bc(0x182)],'sqlCode':_0x35a73e['sqlCode'],'sqlName':_0x5bf308,'dbId':_0x6c9e29[_0x6577bc(0x1b0)],'version':_0x3174b4[_0x6577bc(0x188)],'sqlContent':_0x30850f,'sqlConfig':_0x3174b4[_0x6577bc(0x1b5)]??undefined}),_0x53fecf=_0x33642f[_0x6577bc(0x1b0)]?await getDbName(_0x3aa027['appCode'],Number(_0x33642f[_0x6577bc(0x1b0)]))[_0x6577bc(0x1a4)](()=>_0x6c9e29[_0x6577bc(0x19e)]):_0x6c9e29['dbName'];_0x518dcb[_0x6577bc(0x184)][_0x35a73e['sqlCode']]={...buildSqlLockEntry(_0x33642f,_0x30850f,_0x36b1d3,{'dbName':_0x53fecf}),'path':_0x35a73e['relativePath'],'mode':_0x3174b4['mode']},await archivePreviousSqlFileIfNeeded(_0x24ba01,_0x3174b4[_0x6577bc(0x1a7)],_0x35a73e['relativePath']),_0x47228e['push']({'sqlCode':_0x35a73e[_0x6577bc(0x17d)],'remoteId':_0x3174b4[_0x6577bc(0x17c)]});}catch(_0x22d675){_0x16185f[_0x6577bc(0x197)]({'sqlCode':_0x35a73e['sqlCode'],'error':_0x22d675 instanceof Error?_0x22d675[_0x6577bc(0x1ad)]:String(_0x22d675)});}}return _0x518dcb['lastSync']=new Date()[_0x6577bc(0x1a8)](),await writeSqlLockFile(_0x24ba01['lockFilePath'],_0x530083),{'ok':_0x16185f[_0x6577bc(0x192)]===0x0,'data':{'pushed':_0x47228e,'skipped':_0x7cee38,'failed':_0x16185f},'message':_0x6577bc(0x1b7)+_0x47228e[_0x6577bc(0x192)]+_0x6577bc(0x18d)+_0x7cee38['length']+'\x20skipped,\x20'+_0x16185f[_0x6577bc(0x192)]+_0x6577bc(0x198)};}};async function archivePreviousSqlFileIfNeeded(_0xdec34a,_0x481dfe,_0x31575e){const _0x368851=a193_0x579b6e;if(!_0x481dfe||_0x481dfe===_0x31575e)return;const _0x2524dd=join(_0xdec34a['sqlRootDir'],_0x481dfe);if(!await fileExists(_0x2524dd))return;const _0x4f0bb7=await moveToTrash(_0xdec34a[_0x368851(0x19c)],_0xdec34a[_0x368851(0x1b2)],_0x2524dd);await cleanupEmptyDirectories(dirname(_0x2524dd),_0xdec34a['sqlRootDir']),void _0x4f0bb7;}async function moveToTrash(_0x5ab7e5,_0x5d5a94,_0x16bc92){const _0x37d783=a193_0x579b6e,_0x3052cd=new Date()[_0x37d783(0x1a8)]()[_0x37d783(0x1b4)](/[:.]/g,'-'),_0x2e9fac=relative(_0x5ab7e5,_0x16bc92),_0x3fb03c=join(_0x5d5a94,_0x3052cd,_0x2e9fac);return await mkdir(dirname(_0x3fb03c),{'recursive':!![]}),await rename(_0x16bc92,_0x3fb03c),_0x3fb03c;}async function cleanupEmptyDirectories(_0x57e586,_0x2704d6){const _0x2dffd1=a193_0x579b6e;let _0x4fa84e=resolve(_0x57e586);const _0x2b529d=resolve(_0x2704d6);while(_0x4fa84e[_0x2dffd1(0x199)](''+_0x2b529d+sep)||_0x4fa84e===_0x2b529d){if(_0x4fa84e===_0x2b529d)return;try{const _0x747775=await readdir(_0x4fa84e);if(_0x747775[_0x2dffd1(0x192)]>0x0)return;await rmdir(_0x4fa84e);}catch{return;}_0x4fa84e=dirname(_0x4fa84e);}}function a193_0x1b34(_0x5679c8,_0x4479ea){_0x5679c8=_0x5679c8-0x175;const _0x459243=a193_0x4592();let _0x1b3408=_0x459243[_0x5679c8];return _0x1b3408;}async function resolveTargetDbBinding(_0x5a889f,_0x3b98a0,_0x588b7f){const _0x8eb8d5=a193_0x579b6e,_0x34475f=_0x3b98a0[_0x8eb8d5(0x1ae)];if(!_0x34475f)return{'dbId':_0x588b7f['dbId'],'dbName':_0x588b7f['dbName']};const _0x5a43d8=buildDbDirectoryName(_0x588b7f[_0x8eb8d5(0x19e)],_0x588b7f[_0x8eb8d5(0x1b0)]);if(_0x34475f===_0x5a43d8)return{'dbId':_0x588b7f['dbId'],'dbName':_0x588b7f[_0x8eb8d5(0x19e)]};const _0x3509a5=parseExplicitDbDirectory(_0x34475f);if(_0x3509a5!=null)return{'dbId':_0x3509a5,'dbName':await getDbName(_0x5a889f,_0x3509a5)[_0x8eb8d5(0x1a4)](()=>undefined)};const _0x4a7ef1=await listDatabases(_0x5a889f),_0x49b11d=_0x4a7ef1['filter'](_0x4dfd0c=>buildDbDirectoryName(_0x4dfd0c['dbName'],_0x4dfd0c[_0x8eb8d5(0x1b0)])===_0x34475f);if(_0x49b11d[_0x8eb8d5(0x192)]===0x1)return{'dbId':_0x49b11d[0x0][_0x8eb8d5(0x1b0)],'dbName':_0x49b11d[0x0][_0x8eb8d5(0x19e)]};if(_0x49b11d[_0x8eb8d5(0x192)]===0x0)throw CliErrors[_0x8eb8d5(0x181)](_0x8eb8d5(0x179)+_0x34475f+_0x8eb8d5(0x1a2)+_0x3b98a0[_0x8eb8d5(0x17d)]+'.');const _0x188bc0=_0x49b11d[_0x8eb8d5(0x176)](_0x40a4eb=>_0x40a4eb['dbName']+'\x20('+_0x40a4eb[_0x8eb8d5(0x1b0)]+')')['join'](',\x20');throw CliErrors['validation'](_0x8eb8d5(0x18a)+_0x34475f+'\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20'+_0x3b98a0[_0x8eb8d5(0x17d)]+':\x20'+_0x188bc0);}function parseExplicitDbDirectory(_0x2f198e){const _0x364e89=a193_0x579b6e,_0x446b4c=/^db-(\d+)$/[_0x364e89(0x18c)](_0x2f198e);if(!_0x446b4c)return null;const _0x4472dc=Number(_0x446b4c[0x1]);return Number['isFinite'](_0x4472dc)&&_0x4472dc>0x0?_0x4472dc:null;}
1
+ const a193_0x5e27b5=a193_0x48d3;(function(_0xca9cb5,_0xa1c372){const _0x39f77c=a193_0x48d3,_0x2a963a=_0xca9cb5();while(!![]){try{const _0x5d4fe3=parseInt(_0x39f77c(0xf3))/0x1+parseInt(_0x39f77c(0xde))/0x2*(parseInt(_0x39f77c(0x110))/0x3)+-parseInt(_0x39f77c(0xd3))/0x4*(-parseInt(_0x39f77c(0x10f))/0x5)+parseInt(_0x39f77c(0xfb))/0x6+parseInt(_0x39f77c(0x10c))/0x7*(parseInt(_0x39f77c(0x10d))/0x8)+parseInt(_0x39f77c(0xe7))/0x9+-parseInt(_0x39f77c(0x104))/0xa;if(_0x5d4fe3===_0xa1c372)break;else _0x2a963a['push'](_0x2a963a['shift']());}catch(_0x55d071){_0x2a963a['push'](_0x2a963a['shift']());}}}(a193_0x48e8,0x79e81));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';function a193_0x48e8(){const _0x737e45=['sqlRoot','dbDirectory','entries','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','path','toISOString','1336626ZbSPfN','filePath','str','lockFilePath','unchanged','\x20pushed,\x20','remoteId','write','join','sqlRootDir','replace','has','63461FNyRSz','push','length','dbId','set','boolean','sqlName','POST','1095966XJffFI','appCode','\x20skipped,\x20','Local\x20directory\x20\x22','Local\x20SQL\x20not\x20found:\x20','relativePath','filter','sqlcode','mode','21728350YhRWUt','sqls','get','\x20failed','sqlCode','Would\x20push\x20','version','\x20SQL\x20file(s)','6587gpghVd','7768xNFnxt','force','5tAGyyK','6qKZgYP','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','sqlConfig','/smartapi/custom/updateUserCustomSql','validation','bool','isFinite','Push\x20local\x20SQL\x20files\x20to\x20remote','map','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','projectRoot','1465036PiXDhn','trashDir','sql','startsWith','No\x20database\x20matches\x20local\x20directory\x20\x22','exec','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','catch','lastSync','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','\x22\x20for\x20sqlCode\x20','997558UyvcFW','utf8','dbName'];a193_0x48e8=function(){return _0x737e45;};return a193_0x48e8();}import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';function a193_0x48d3(_0x596f68,_0x299f86){_0x596f68=_0x596f68-0xcd;const _0x48e8c8=a193_0x48e8();let _0x48d363=_0x48e8c8[_0x596f68];return _0x48d363;}import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x48d447,_0xd56eb5,_0x17be02){const _0x4cb2a6=a193_0x48d3,_0x4a1946=await scanLocalSqlQueries(_0x48d447),_0x3ed23=new Map();for(const _0x588da0 of _0x4a1946){if(_0x17be02&&_0x588da0[_0x4cb2a6(0x108)]!==_0x17be02)continue;const _0x2207b3=_0x3ed23[_0x4cb2a6(0x106)](_0x588da0[_0x4cb2a6(0x108)])??[];_0x2207b3['push'](_0x588da0),_0x3ed23[_0x4cb2a6(0xf7)](_0x588da0[_0x4cb2a6(0x108)],_0x2207b3);}if(_0x17be02&&!_0x3ed23[_0x4cb2a6(0xf2)](_0x17be02))throw CliErrors['validation'](_0x4cb2a6(0xff)+_0x17be02);const _0x273146=[];for(const [_0x1bbf22,_0x3945e1]of _0x3ed23[_0x4cb2a6(0xe3)]()){if(_0x3945e1[_0x4cb2a6(0xf5)]===0x1){_0x273146['push'](_0x3945e1[0x0]);continue;}const _0x4d9cd8=_0xd56eb5[_0x4cb2a6(0x105)][_0x1bbf22],_0x532458=_0x4d9cd8?.[_0x4cb2a6(0xe5)],_0xe19b7=_0x532458?_0x3945e1[_0x4cb2a6(0x101)](_0x1f048c=>_0x1f048c[_0x4cb2a6(0x100)]!==_0x532458):_0x3945e1;if(_0x4d9cd8&&_0xe19b7[_0x4cb2a6(0xf5)]===0x1){_0x273146['push'](_0xe19b7[0x0]);continue;}throw CliErrors['validation'](_0x4cb2a6(0xdc)+_0x1bbf22+_0x4cb2a6(0x111));}return _0x273146;}export const sqlPush={'service':a193_0x5e27b5(0xd5),'command':a193_0x5e27b5(0xf4),'description':a193_0x5e27b5(0xcf),'risk':a193_0x5e27b5(0xee),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a193_0x5e27b5(0x10e),'type':a193_0x5e27b5(0xf8),'description':a193_0x5e27b5(0xd1)}],async 'dryRun'(_0xaa211d){const _0x2cb902=a193_0x5e27b5,_0x41a02a=loadSqlProjectConfig(_0xaa211d[_0x2cb902(0xfc)]),_0x91e697=await readSqlLockFile(_0x41a02a[_0x2cb902(0xea)]),{appLock:_0x3d6b8c}=ensureSqlLockScope(_0x91e697??createEmptySqlLock(),_0xaa211d[_0x2cb902(0xfc)],_0x41a02a[_0x2cb902(0xe1)],_0x2cb902(0xf4)),_0x556179=await getTargetSqlQueries(_0x41a02a,_0x3d6b8c,_0xaa211d[_0x2cb902(0xe9)](_0x2cb902(0x102))||undefined),_0x6c76c2=[];for(const _0x13b46e of _0x556179){const _0x5938f7=await computeSqlFileHash(_0x13b46e[_0x2cb902(0xe8)]),_0x28c9a6=_0x3d6b8c[_0x2cb902(0x105)][_0x13b46e[_0x2cb902(0x108)]],_0x254a94=!!_0x28c9a6&&(_0x28c9a6[_0x2cb902(0xe5)]!==_0x13b46e[_0x2cb902(0x100)]||!!_0x13b46e[_0x2cb902(0xf9)]&&_0x28c9a6[_0x2cb902(0xf9)]!==_0x13b46e[_0x2cb902(0xf9)]);if(!_0xaa211d[_0x2cb902(0xcd)](_0x2cb902(0x10e))&&_0x28c9a6&&_0x28c9a6['hash']===_0x5938f7&&!_0x254a94)continue;_0x6c76c2[_0x2cb902(0xf4)](_0x13b46e[_0x2cb902(0x108)]);}return{'method':_0x2cb902(0xfa),'url':_0x2cb902(0x113),'body':{'sqlCodes':_0x6c76c2,'appCode':_0xaa211d['appCode']},'description':_0x2cb902(0x109)+_0x6c76c2[_0x2cb902(0xf5)]+_0x2cb902(0x10b)};},async 'execute'(_0x28983c){const _0x24b2f9=a193_0x5e27b5,_0x3f0741=loadSqlProjectConfig(_0x28983c['appCode']),_0x27cad9=await readSqlLockFile(_0x3f0741[_0x24b2f9(0xea)]),{lockData:_0x142e7a,appLock:_0x454a7f}=ensureSqlLockScope(_0x27cad9??createEmptySqlLock(),_0x28983c[_0x24b2f9(0xfc)],_0x3f0741[_0x24b2f9(0xe1)],_0x24b2f9(0xf4)),_0x467402=await getTargetSqlQueries(_0x3f0741,_0x454a7f,_0x28983c[_0x24b2f9(0xe9)](_0x24b2f9(0x102))||undefined);if(_0x467402['length']===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':'No\x20local\x20SQL\x20files\x20found.'};const _0x4cd916=[],_0x5ef433=[],_0x2fe303=[];for(const _0x114010 of _0x467402){const _0x5abbc5=_0x454a7f[_0x24b2f9(0x105)][_0x114010[_0x24b2f9(0x108)]];if(!_0x5abbc5){_0x2fe303['push']({'sqlCode':_0x114010[_0x24b2f9(0x108)],'error':_0x24b2f9(0xd9)});continue;}try{const _0x3f908c=await computeSqlFileHash(_0x114010[_0x24b2f9(0xe8)]),_0x5e74be=_0x5abbc5[_0x24b2f9(0xe5)]!==_0x114010[_0x24b2f9(0x100)]||!!_0x114010[_0x24b2f9(0xf9)]&&_0x5abbc5['sqlName']!==_0x114010[_0x24b2f9(0xf9)];if(!_0x28983c[_0x24b2f9(0xcd)](_0x24b2f9(0x10e))&&_0x5abbc5['hash']===_0x3f908c&&!_0x5e74be){_0x5ef433[_0x24b2f9(0xf4)]({'sqlCode':_0x114010[_0x24b2f9(0x108)],'reason':_0x24b2f9(0xeb)});continue;}if(_0x5abbc5[_0x24b2f9(0x10a)]==null){_0x2fe303['push']({'sqlCode':_0x114010['sqlCode'],'error':_0x24b2f9(0xe4)});continue;}const _0x5df560=await readFile(_0x114010[_0x24b2f9(0xe8)],_0x24b2f9(0xdf)),_0x1220f5=stripLocalSqlMetadata(_0x5df560,_0x114010[_0x24b2f9(0x103)]),_0x2057d8=_0x114010[_0x24b2f9(0xf9)]||_0x5abbc5[_0x24b2f9(0xf9)],_0x890d89=await resolveTargetDbBinding(_0x28983c[_0x24b2f9(0xfc)],_0x114010,_0x5abbc5),_0x1ab299=await updateSqlQuery({'id':_0x5abbc5[_0x24b2f9(0xed)],'appCode':_0x28983c[_0x24b2f9(0xfc)],'sqlCode':_0x114010[_0x24b2f9(0x108)],'sqlName':_0x2057d8,'dbId':_0x890d89['dbId'],'version':_0x5abbc5[_0x24b2f9(0x10a)],'sqlContent':_0x1220f5,'sqlConfig':_0x5abbc5[_0x24b2f9(0x112)]??undefined}),_0xea21b9=_0x1ab299[_0x24b2f9(0xf6)]?await getDbName(_0x28983c[_0x24b2f9(0xfc)],Number(_0x1ab299[_0x24b2f9(0xf6)]))[_0x24b2f9(0xda)](()=>_0x890d89['dbName']):_0x890d89[_0x24b2f9(0xe0)];_0x454a7f[_0x24b2f9(0x105)][_0x114010['sqlCode']]={...buildSqlLockEntry(_0x1ab299,_0x1220f5,_0x3f908c,{'dbName':_0xea21b9}),'path':_0x114010[_0x24b2f9(0x100)],'mode':_0x5abbc5[_0x24b2f9(0x103)]},await archivePreviousSqlFileIfNeeded(_0x3f0741,_0x5abbc5[_0x24b2f9(0xe5)],_0x114010[_0x24b2f9(0x100)]),_0x4cd916[_0x24b2f9(0xf4)]({'sqlCode':_0x114010[_0x24b2f9(0x108)],'remoteId':_0x5abbc5['remoteId']});}catch(_0x512467){_0x2fe303[_0x24b2f9(0xf4)]({'sqlCode':_0x114010[_0x24b2f9(0x108)],'error':_0x512467 instanceof Error?_0x512467['message']:String(_0x512467)});}}return _0x454a7f[_0x24b2f9(0xdb)]=new Date()[_0x24b2f9(0xe6)](),await writeSqlLockFile(_0x3f0741[_0x24b2f9(0xea)],_0x142e7a),{'ok':_0x2fe303['length']===0x0,'data':{'pushed':_0x4cd916,'skipped':_0x5ef433,'failed':_0x2fe303},'message':'Push\x20complete:\x20'+_0x4cd916[_0x24b2f9(0xf5)]+_0x24b2f9(0xec)+_0x5ef433[_0x24b2f9(0xf5)]+_0x24b2f9(0xfd)+_0x2fe303[_0x24b2f9(0xf5)]+_0x24b2f9(0x107)};}};async function archivePreviousSqlFileIfNeeded(_0x13294d,_0x173554,_0x38f91c){const _0x472474=a193_0x5e27b5;if(!_0x173554||_0x173554===_0x38f91c)return;const _0x508f94=join(_0x13294d[_0x472474(0xf0)],_0x173554);if(!await fileExists(_0x508f94))return;const _0x3fa174=await moveToTrash(_0x13294d[_0x472474(0xd2)],_0x13294d[_0x472474(0xd4)],_0x508f94);await cleanupEmptyDirectories(dirname(_0x508f94),_0x13294d[_0x472474(0xf0)]),void _0x3fa174;}async function moveToTrash(_0x22c799,_0x39a0ba,_0x589fcf){const _0x35f591=a193_0x5e27b5,_0x1daeec=new Date()[_0x35f591(0xe6)]()[_0x35f591(0xf1)](/[:.]/g,'-'),_0x5c1ff0=relative(_0x22c799,_0x589fcf),_0x143f0b=join(_0x39a0ba,_0x1daeec,_0x5c1ff0);return await mkdir(dirname(_0x143f0b),{'recursive':!![]}),await rename(_0x589fcf,_0x143f0b),_0x143f0b;}async function cleanupEmptyDirectories(_0x568fa8,_0x22af6a){const _0x59d6e6=a193_0x5e27b5;let _0x3df0fc=resolve(_0x568fa8);const _0x220b76=resolve(_0x22af6a);while(_0x3df0fc[_0x59d6e6(0xd6)](''+_0x220b76+sep)||_0x3df0fc===_0x220b76){if(_0x3df0fc===_0x220b76)return;try{const _0x34a35a=await readdir(_0x3df0fc);if(_0x34a35a[_0x59d6e6(0xf5)]>0x0)return;await rmdir(_0x3df0fc);}catch{return;}_0x3df0fc=dirname(_0x3df0fc);}}async function resolveTargetDbBinding(_0x3e510e,_0x1b65c6,_0x1fdfc8){const _0x3edae2=a193_0x5e27b5,_0x10b23b=_0x1b65c6[_0x3edae2(0xe2)];if(!_0x10b23b)return{'dbId':_0x1fdfc8[_0x3edae2(0xf6)],'dbName':_0x1fdfc8[_0x3edae2(0xe0)]};const _0x3192b2=buildDbDirectoryName(_0x1fdfc8[_0x3edae2(0xe0)],_0x1fdfc8['dbId']);if(_0x10b23b===_0x3192b2)return{'dbId':_0x1fdfc8['dbId'],'dbName':_0x1fdfc8[_0x3edae2(0xe0)]};const _0x42431e=parseExplicitDbDirectory(_0x10b23b);if(_0x42431e!=null)return{'dbId':_0x42431e,'dbName':await getDbName(_0x3e510e,_0x42431e)[_0x3edae2(0xda)](()=>undefined)};const _0x20f145=await listDatabases(_0x3e510e),_0x140dc5=_0x20f145[_0x3edae2(0x101)](_0x50693b=>buildDbDirectoryName(_0x50693b['dbName'],_0x50693b[_0x3edae2(0xf6)])===_0x10b23b);if(_0x140dc5[_0x3edae2(0xf5)]===0x1)return{'dbId':_0x140dc5[0x0][_0x3edae2(0xf6)],'dbName':_0x140dc5[0x0]['dbName']};if(_0x140dc5['length']===0x0)throw CliErrors['validation'](_0x3edae2(0xd7)+_0x10b23b+_0x3edae2(0xdd)+_0x1b65c6[_0x3edae2(0x108)]+'.');const _0xa65b24=_0x140dc5[_0x3edae2(0xd0)](_0x594d0e=>_0x594d0e[_0x3edae2(0xe0)]+'\x20('+_0x594d0e[_0x3edae2(0xf6)]+')')[_0x3edae2(0xef)](',\x20');throw CliErrors[_0x3edae2(0x114)](_0x3edae2(0xfe)+_0x10b23b+'\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20'+_0x1b65c6[_0x3edae2(0x108)]+':\x20'+_0xa65b24);}function parseExplicitDbDirectory(_0x569bb1){const _0x1d023d=a193_0x5e27b5,_0x4e5b90=/^db-(\d+)$/[_0x1d023d(0xd8)](_0x569bb1);if(!_0x4e5b90)return null;const _0x5ba52a=Number(_0x4e5b90[0x1]);return Number[_0x1d023d(0xce)](_0x5ba52a)&&_0x5ba52a>0x0?_0x5ba52a:null;}
@@ -1 +1 @@
1
- const a194_0x2aa7ca=a194_0x557d;(function(_0x1914f0,_0x2b8bac){const _0x694fb2=a194_0x557d,_0x3bd2f0=_0x1914f0();while(!![]){try{const _0x38520a=parseInt(_0x694fb2(0x203))/0x1*(parseInt(_0x694fb2(0x207))/0x2)+-parseInt(_0x694fb2(0x1fd))/0x3*(parseInt(_0x694fb2(0x20b))/0x4)+parseInt(_0x694fb2(0x210))/0x5*(parseInt(_0x694fb2(0x1eb))/0x6)+parseInt(_0x694fb2(0x1fa))/0x7*(parseInt(_0x694fb2(0x1e7))/0x8)+-parseInt(_0x694fb2(0x1ff))/0x9*(-parseInt(_0x694fb2(0x20a))/0xa)+parseInt(_0x694fb2(0x1f1))/0xb+-parseInt(_0x694fb2(0x20f))/0xc;if(_0x38520a===_0x2b8bac)break;else _0x3bd2f0['push'](_0x3bd2f0['shift']());}catch(_0x222e2d){_0x3bd2f0['push'](_0x3bd2f0['shift']());}}}(a194_0xdb83,0x5fece));import{createInterface}from'node:readline';import{join}from'node:path';function a194_0x557d(_0x373494,_0x234348){_0x373494=_0x373494-0x1e4;const _0xdb839e=a194_0xdb83();let _0x557daa=_0xdb839e[_0x373494];return _0x557daa;}import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';export const SQL_LOCAL_REL_DIR=a194_0x2aa7ca(0x1ec);export function buildSqlLockEntry(_0x2efe20,_0x52a644,_0x5b8f87,_0x3d3056){const _0x585c34=a194_0x2aa7ca,_0x1e51c6=detectSqlMode(_0x52a644);return{'path':buildSqlRelativePath(_0x2efe20[_0x585c34(0x20e)],_0x2efe20['sqlName'],_0x3d3056?.['dbName'],_0x1e51c6,_0x2efe20['dbId']),'hash':_0x5b8f87,'remoteId':_0x2efe20['id'],'version':_0x2efe20['version'],'dbId':Number(_0x2efe20['dbId']),'dbName':_0x3d3056?.[_0x585c34(0x1e8)],'sqlName':_0x2efe20[_0x585c34(0x201)],'sqlConfig':_0x2efe20[_0x585c34(0x1f3)]??undefined,'mode':_0x1e51c6};}export function cloneSqlLockData(_0x35e728){const _0x10b33f=a194_0x2aa7ca;return{'apps':Object[_0x10b33f(0x1ed)](Object[_0x10b33f(0x1e6)](_0x35e728[_0x10b33f(0x1e4)])[_0x10b33f(0x1f4)](([_0x2bb70c,_0x457603])=>[_0x2bb70c,{'sqlRoot':_0x457603['sqlRoot'],'lastSync':_0x457603[_0x10b33f(0x1fb)],'sqls':{..._0x457603[_0x10b33f(0x1f7)]}}]))};}export function ensureRemoteSqlContent(_0x5d66c1){const _0xb1a21a=a194_0x2aa7ca;return _0x5d66c1[_0xb1a21a(0x206)]??'';}export function buildLocalSqlFileContent(_0x51a58a,_0x3e4654,_0x43e6c4){const _0x34cc12=a194_0x2aa7ca,_0x564f71=_0x43e6c4?.['mode']??detectSqlMode(_0x3e4654),_0x501b83=stripLocalSqlMetadata(_0x3e4654,_0x564f71)[_0x34cc12(0x1f2)](),_0x68ec86=[...buildMetadataHeaderLines({'sqlCode':_0x51a58a[_0x34cc12(0x20e)],'sqlName':_0x51a58a[_0x34cc12(0x201)],'dbId':_0x51a58a[_0x34cc12(0x208)],'dbName':_0x43e6c4?.[_0x34cc12(0x1e8)],'mode':_0x564f71,'syncedAt':_0x43e6c4?.['syncedAt'],'description':_0x43e6c4?.[_0x34cc12(0x1f5)]},_0x564f71),'',_0x501b83],_0x941043=_0x68ec86[_0x34cc12(0x202)]('\x0a');return _0x941043[_0x34cc12(0x204)]('\x0a')?_0x941043:_0x941043+'\x0a';}export function stripLocalSqlMetadata(_0x4111a0,_0x51636b){const _0x58fca0=a194_0x2aa7ca,_0x5b2ec5=_0x4111a0['replace'](/\r\n/g,'\x0a')['split']('\x0a'),_0x50ea88=[];let _0x375771=0x0;if(_0x51636b==='mybatisXml')while(_0x375771<_0x5b2ec5[_0x58fca0(0x1fe)]){const _0x2032ad=_0x5b2ec5[_0x375771]??'';if(/^\s*<!--\s*@lovrabet\./['test'](_0x2032ad)){_0x375771++;continue;}if(_0x2032ad[_0x58fca0(0x1f2)]()===''&&_0x375771>0x0){_0x375771++;continue;}break;}else while(_0x375771<_0x5b2ec5[_0x58fca0(0x1fe)]){const _0x4c9c9a=_0x5b2ec5[_0x375771]??'';if(/^\s*--\s*@lovrabet\./['test'](_0x4c9c9a)){_0x375771++;continue;}if(_0x4c9c9a[_0x58fca0(0x1f2)]()===''&&_0x375771>0x0){_0x375771++;continue;}break;}for(;_0x375771<_0x5b2ec5[_0x58fca0(0x1fe)];_0x375771++){_0x50ea88['push'](_0x5b2ec5[_0x375771]);}return _0x50ea88[_0x58fca0(0x202)]('\x0a')[_0x58fca0(0x200)]();}function a194_0xdb83(){const _0x437072=['10imSHJw','51416AKYohw','mybatisXml','yes','sqlCode','12966012xvChru','5xeUXtn','path','apps','mode','entries','16LlyDqC','dbName','toLowerCase','<!--\x20@lovrabet.','4189908KiXWLW','.rabetbase/sql','fromEntries','syncedAt','stdin','\x20[y/N]\x20','205777mfeeUK','trim','sqlConfig','map','description','\x20-->','sqls','filter','stderr','2030266UPHmaR','lastSync','--\x20@lovrabet.','57SVICnh','length','1212669ueBujN','trimStart','sqlName','join','3ztKvAn','endsWith','question','sqlContent','190530kbxGTz','dbId','close'];a194_0xdb83=function(){return _0x437072;};return a194_0xdb83();}export function resolveSqlMode(_0x518b24,_0x24a6c9){const _0x286a75=a194_0x2aa7ca;if(_0x24a6c9?.[_0x286a75(0x1e5)])return _0x24a6c9[_0x286a75(0x1e5)];return detectSqlMode(_0x518b24);}export function resolveSqlFileName(_0x6bf0a1,_0x2369bb,_0x43cba1){const _0x5cdfb7=a194_0x2aa7ca;if(_0x43cba1?.[_0x5cdfb7(0x211)])return _0x43cba1[_0x5cdfb7(0x211)];if(_0x43cba1?.['sqlName']||_0x43cba1?.['dbName'])return buildSqlRelativePath(_0x6bf0a1,_0x43cba1?.[_0x5cdfb7(0x201)],_0x43cba1?.['dbName'],resolveSqlMode(_0x2369bb,_0x43cba1),_0x43cba1?.[_0x5cdfb7(0x208)]);return buildDefaultSqlFileName(_0x6bf0a1,resolveSqlMode(_0x2369bb,_0x43cba1));}export function resolveSqlLocalDir(_0x38b80c,_0x262ebb){return join(_0x38b80c,SQL_LOCAL_REL_DIR,_0x262ebb);}export async function confirmForceOverwrite(_0x1c6ce0){const _0x549d4b=a194_0x2aa7ca,_0x2f0233=createInterface({'input':process[_0x549d4b(0x1ef)],'output':process[_0x549d4b(0x1f9)]}),_0x4611ac=await new Promise(_0x27ac29=>{const _0x5de3a5=_0x549d4b;_0x2f0233[_0x5de3a5(0x205)](_0x1c6ce0+_0x5de3a5(0x1f0),_0x27ac29);});return _0x2f0233[_0x549d4b(0x209)](),['y',_0x549d4b(0x20d)]['includes'](_0x4611ac['trim']()[_0x549d4b(0x1e9)]());}export function findSqlLockScope(_0x14ab52,_0x54c73d){return _0x14ab52['apps'][_0x54c73d];}function buildMetadataHeaderLines(_0x12f066,_0x497726){const _0x4f3e18=a194_0x2aa7ca,_0x56b539=[[_0x4f3e18(0x20e),_0x12f066['sqlCode']],[_0x4f3e18(0x201),_0x12f066['sqlName']],[_0x4f3e18(0x208),_0x12f066[_0x4f3e18(0x208)]],[_0x4f3e18(0x1e8),_0x12f066['dbName']],[_0x4f3e18(0x1e5),_0x12f066[_0x4f3e18(0x1e5)]],[_0x4f3e18(0x1ee),_0x12f066[_0x4f3e18(0x1ee)]],[_0x4f3e18(0x1f5),_0x12f066[_0x4f3e18(0x1f5)]]];if(_0x497726===_0x4f3e18(0x20c))return _0x56b539[_0x4f3e18(0x1f8)](([,_0x407a62])=>_0x407a62!==undefined&&_0x407a62!==null&&String(_0x407a62)[_0x4f3e18(0x1f2)]()!=='')['map'](([_0x3fac44,_0x4b4742])=>_0x4f3e18(0x1ea)+_0x3fac44+':\x20'+String(_0x4b4742)+_0x4f3e18(0x1f6));return _0x56b539[_0x4f3e18(0x1f8)](([,_0x53f8da])=>_0x53f8da!==undefined&&_0x53f8da!==null&&String(_0x53f8da)[_0x4f3e18(0x1f2)]()!=='')[_0x4f3e18(0x1f4)](([_0x591364,_0x40685c])=>_0x4f3e18(0x1fc)+_0x591364+':\x20'+String(_0x40685c));}
1
+ const a194_0x203904=a194_0x3128;(function(_0x2f0b1e,_0x26f93b){const _0x16da1a=a194_0x3128,_0x587d40=_0x2f0b1e();while(!![]){try{const _0x56fca1=parseInt(_0x16da1a(0xa1))/0x1*(-parseInt(_0x16da1a(0xb3))/0x2)+-parseInt(_0x16da1a(0x9b))/0x3+parseInt(_0x16da1a(0x99))/0x4*(parseInt(_0x16da1a(0x94))/0x5)+-parseInt(_0x16da1a(0x9e))/0x6+-parseInt(_0x16da1a(0xa2))/0x7+-parseInt(_0x16da1a(0x9c))/0x8*(-parseInt(_0x16da1a(0x91))/0x9)+parseInt(_0x16da1a(0xac))/0xa;if(_0x56fca1===_0x26f93b)break;else _0x587d40['push'](_0x587d40['shift']());}catch(_0x2685c2){_0x587d40['push'](_0x587d40['shift']());}}}(a194_0x5d1b,0x2e803));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=a194_0x203904(0xb5);export function buildSqlLockEntry(_0x114091,_0x44572b,_0x5d6409,_0x21d2d9){const _0x104031=a194_0x203904,_0x40cbf7=detectSqlMode(_0x44572b);return{'path':buildSqlRelativePath(_0x114091['sqlCode'],_0x114091[_0x104031(0x96)],_0x21d2d9?.[_0x104031(0x9d)],_0x40cbf7,_0x114091[_0x104031(0xaa)]),'hash':_0x5d6409,'remoteId':_0x114091['id'],'version':_0x114091[_0x104031(0xb4)],'dbId':Number(_0x114091[_0x104031(0xaa)]),'dbName':_0x21d2d9?.[_0x104031(0x9d)],'sqlName':_0x114091[_0x104031(0x96)],'sqlConfig':_0x114091[_0x104031(0x98)]??undefined,'mode':_0x40cbf7};}export function cloneSqlLockData(_0x312b70){const _0x2d1998=a194_0x203904;return{'apps':Object['fromEntries'](Object[_0x2d1998(0xb1)](_0x312b70[_0x2d1998(0xb2)])[_0x2d1998(0xa5)](([_0xe05c8f,_0x42df05])=>[_0xe05c8f,{'sqlRoot':_0x42df05[_0x2d1998(0x92)],'lastSync':_0x42df05[_0x2d1998(0xa4)],'sqls':{..._0x42df05[_0x2d1998(0xa8)]}}]))};}export function ensureRemoteSqlContent(_0x5864c4){const _0x442fb2=a194_0x203904;return _0x5864c4[_0x442fb2(0x97)]??'';}export function buildLocalSqlFileContent(_0x340d11,_0x58d088,_0x4375b7){const _0x16ab09=a194_0x203904,_0x586a35=_0x4375b7?.['mode']??detectSqlMode(_0x58d088),_0xd13f4=stripLocalSqlMetadata(_0x58d088,_0x586a35)[_0x16ab09(0xab)](),_0x2a286c=[...buildMetadataHeaderLines({'sqlCode':_0x340d11[_0x16ab09(0x95)],'sqlName':_0x340d11[_0x16ab09(0x96)],'dbId':_0x340d11[_0x16ab09(0xaa)],'dbName':_0x4375b7?.[_0x16ab09(0x9d)],'mode':_0x586a35,'syncedAt':_0x4375b7?.[_0x16ab09(0x8f)],'description':_0x4375b7?.[_0x16ab09(0xaf)]},_0x586a35),'',_0xd13f4],_0xf591e3=_0x2a286c[_0x16ab09(0xa6)]('\x0a');return _0xf591e3[_0x16ab09(0xad)]('\x0a')?_0xf591e3:_0xf591e3+'\x0a';}export function stripLocalSqlMetadata(_0x5686bb,_0x3bce7c){const _0xfabeac=a194_0x203904,_0x58123d=_0x5686bb[_0xfabeac(0xae)](/\r\n/g,'\x0a')['split']('\x0a'),_0x238904=[];let _0x37f0b0=0x0;if(_0x3bce7c===_0xfabeac(0x8e))while(_0x37f0b0<_0x58123d[_0xfabeac(0xb0)]){const _0x3164e6=_0x58123d[_0x37f0b0]??'';if(/^\s*<!--\s*@lovrabet\./['test'](_0x3164e6)){_0x37f0b0++;continue;}if(_0x3164e6[_0xfabeac(0xab)]()===''&&_0x37f0b0>0x0){_0x37f0b0++;continue;}break;}else while(_0x37f0b0<_0x58123d['length']){const _0x3d8448=_0x58123d[_0x37f0b0]??'';if(/^\s*--\s*@lovrabet\./[_0xfabeac(0x8c)](_0x3d8448)){_0x37f0b0++;continue;}if(_0x3d8448[_0xfabeac(0xab)]()===''&&_0x37f0b0>0x0){_0x37f0b0++;continue;}break;}for(;_0x37f0b0<_0x58123d['length'];_0x37f0b0++){_0x238904[_0xfabeac(0xa9)](_0x58123d[_0x37f0b0]);}return _0x238904[_0xfabeac(0xa6)]('\x0a')[_0xfabeac(0xa3)]();}export function resolveSqlMode(_0x540df1,_0x439f5c){const _0x34e5a8=a194_0x203904;if(_0x439f5c?.['mode'])return _0x439f5c[_0x34e5a8(0x90)];return detectSqlMode(_0x540df1);}export function resolveSqlFileName(_0x44b52d,_0x453728,_0x48a70d){const _0x18880b=a194_0x203904;if(_0x48a70d?.['path'])return _0x48a70d[_0x18880b(0xa7)];if(_0x48a70d?.[_0x18880b(0x96)]||_0x48a70d?.[_0x18880b(0x9d)])return buildSqlRelativePath(_0x44b52d,_0x48a70d?.[_0x18880b(0x96)],_0x48a70d?.[_0x18880b(0x9d)],resolveSqlMode(_0x453728,_0x48a70d),_0x48a70d?.['dbId']);return buildDefaultSqlFileName(_0x44b52d,resolveSqlMode(_0x453728,_0x48a70d));}export function resolveSqlLocalDir(_0x4171f2,_0x4c53cb){return join(_0x4171f2,SQL_LOCAL_REL_DIR,_0x4c53cb);}export async function confirmForceOverwrite(_0x3b5bfc){const _0x2a38bc=a194_0x203904,_0x2248fb=createInterface({'input':process[_0x2a38bc(0x8d)],'output':process[_0x2a38bc(0x93)]}),_0x4b9986=await new Promise(_0x284a2e=>{_0x2248fb['question'](_0x3b5bfc+'\x20[y/N]\x20',_0x284a2e);});return _0x2248fb['close'](),['y','yes'][_0x2a38bc(0x9f)](_0x4b9986[_0x2a38bc(0xab)]()[_0x2a38bc(0xa0)]());}function a194_0x5d1b(){const _0x387f2a=['sqls','push','dbId','trim','8121830QysTgI','endsWith','replace','description','length','entries','apps','396632TScafP','version','.rabetbase/sql','test','stdin','mybatisXml','syncedAt','mode','333810GQKdON','sqlRoot','stderr','75pCORoU','sqlCode','sqlName','sqlContent','sqlConfig','5532PKEQiR','\x20-->','363954MhXNhD','40qiCSOI','dbName','1198620WGwNxk','includes','toLowerCase','1LqLIpe','2159549WNUJLj','trimStart','lastSync','map','join','path'];a194_0x5d1b=function(){return _0x387f2a;};return a194_0x5d1b();}export function findSqlLockScope(_0x346c50,_0x112967){return _0x346c50['apps'][_0x112967];}function a194_0x3128(_0x2b7d9d,_0x23cb31){_0x2b7d9d=_0x2b7d9d-0x8c;const _0x5d1b2f=a194_0x5d1b();let _0x31287e=_0x5d1b2f[_0x2b7d9d];return _0x31287e;}function buildMetadataHeaderLines(_0x323803,_0x40a16d){const _0x5ef6b1=a194_0x203904,_0x2a78cb=[['sqlCode',_0x323803['sqlCode']],[_0x5ef6b1(0x96),_0x323803[_0x5ef6b1(0x96)]],['dbId',_0x323803[_0x5ef6b1(0xaa)]],['dbName',_0x323803[_0x5ef6b1(0x9d)]],[_0x5ef6b1(0x90),_0x323803[_0x5ef6b1(0x90)]],[_0x5ef6b1(0x8f),_0x323803[_0x5ef6b1(0x8f)]],[_0x5ef6b1(0xaf),_0x323803[_0x5ef6b1(0xaf)]]];if(_0x40a16d==='mybatisXml')return _0x2a78cb['filter'](([,_0x1df49f])=>_0x1df49f!==undefined&&_0x1df49f!==null&&String(_0x1df49f)[_0x5ef6b1(0xab)]()!=='')[_0x5ef6b1(0xa5)](([_0x1d4674,_0x4b12e1])=>'<!--\x20@lovrabet.'+_0x1d4674+':\x20'+String(_0x4b12e1)+_0x5ef6b1(0x9a));return _0x2a78cb['filter'](([,_0x10e61c])=>_0x10e61c!==undefined&&_0x10e61c!==null&&String(_0x10e61c)['trim']()!=='')[_0x5ef6b1(0xa5)](([_0x2a8ecf,_0x129ab2])=>'--\x20@lovrabet.'+_0x2a8ecf+':\x20'+String(_0x129ab2));}
@@ -1 +1 @@
1
- function a195_0x3569(){const _0xfbf471=['status','bool','sqls','filePath','sqlRoot','33334RznsnU','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','push','387684xZWWGv','hash','lockFilePath','lockKey','981HiQSht','keys','paging','remote','\x20modified,\x20','1084988NoULwV','length','sqlCode','76552HuvCNk','sqlName','\x20remote-only','174xuRxIR','168446jfrknH','304308buPljO','has','relativePath','path','\x20missing,\x20','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','appCode','\x20added,\x20','2589890lYhjgh','map','All\x20SQL\x20queries\x20are\x20in\x20sync.','read','totalCount','boolean'];a195_0x3569=function(){return _0xfbf471;};return a195_0x3569();}const a195_0x5a864b=a195_0x1d4b;(function(_0x5397a1,_0x3f1a31){const _0x2902cd=a195_0x1d4b,_0x1373c9=_0x5397a1();while(!![]){try{const _0x551214=parseInt(_0x2902cd(0x1ed))/0x1+parseInt(_0x2902cd(0x20d))/0x2+-parseInt(_0x2902cd(0x1ee))/0x3+parseInt(_0x2902cd(0x204))/0x4+parseInt(_0x2902cd(0x1f6))/0x5+parseInt(_0x2902cd(0x1ec))/0x6*(parseInt(_0x2902cd(0x201))/0x7)+parseInt(_0x2902cd(0x1e9))/0x8*(-parseInt(_0x2902cd(0x208))/0x9);if(_0x551214===_0x3f1a31)break;else _0x1373c9['push'](_0x1373c9['shift']());}catch(_0x2bd108){_0x1373c9['push'](_0x1373c9['shift']());}}}(a195_0x3569,0x4dff8));import{listSqlQueries}from'../../core/api-client.js';function a195_0x1d4b(_0x291b7a,_0x4f42d8){_0x291b7a=_0x291b7a-0x1e9;const _0x35693d=a195_0x3569();let _0x1d4b71=_0x35693d[_0x291b7a];return _0x1d4b71;}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(_0x4859e5){const _0x114188=a195_0x1d4b,_0x4a31df=[];let _0x701a3b=0x1;while(!![]){const _0x55bd36=await listSqlQueries(_0x4859e5,{'currentPage':_0x701a3b,'pageSize':PAGE_SIZE}),_0x2d4b5b=_0x55bd36['tableData']??[];_0x4a31df[_0x114188(0x203)](..._0x2d4b5b[_0x114188(0x1f7)](_0x3bf154=>_0x3bf154[_0x114188(0x20f)]));if(_0x2d4b5b['length']===0x0)break;const _0x4a4acc=_0x55bd36[_0x114188(0x20a)]?.[_0x114188(0x1fa)];if(_0x4a4acc!=null?_0x4a31df[_0x114188(0x20e)]>=_0x4a4acc:_0x2d4b5b[_0x114188(0x20e)]<PAGE_SIZE)break;_0x701a3b++;}return _0x4a31df;}export const sqlStatus={'service':'sql','command':'status','description':a195_0x5a864b(0x1f3),'risk':a195_0x5a864b(0x1f9),'flags':[{'name':a195_0x5a864b(0x20b),'type':a195_0x5a864b(0x1fb),'description':a195_0x5a864b(0x202)}],async 'execute'(_0x5d8de1){const _0x2c43e4=a195_0x5a864b,_0x34a925=loadSqlProjectConfig(_0x5d8de1[_0x2c43e4(0x1f4)]),_0x4495df=await readSqlLockFile(_0x34a925[_0x2c43e4(0x206)]),{appLock:_0x345d9d}=ensureSqlLockScope(_0x4495df??createEmptySqlLock(),_0x34a925[_0x2c43e4(0x1f4)],_0x34a925[_0x2c43e4(0x200)],_0x2c43e4(0x1fc)),_0x19c28b=await scanLocalSqlQueries(_0x34a925),_0x69d7f3=[],_0x3e9b31=[],_0x1ea744=[],_0x4d7a29=[],_0x405000=new Set(_0x19c28b[_0x2c43e4(0x1f7)](_0x2e8435=>_0x2e8435['lockKey']));for(const _0x49e850 of _0x19c28b){const _0x4a9eb8=await computeSqlFileHash(_0x49e850[_0x2c43e4(0x1ff)]),_0x5196d2=_0x345d9d['sqls'][_0x49e850[_0x2c43e4(0x207)]],_0x3e90c4=!!_0x5196d2&&_0x5196d2[_0x2c43e4(0x1f1)]!==_0x49e850[_0x2c43e4(0x1f0)],_0x3e3693=!!_0x5196d2&&!!_0x49e850[_0x2c43e4(0x1ea)]&&_0x5196d2[_0x2c43e4(0x1ea)]!==_0x49e850[_0x2c43e4(0x1ea)];if(!_0x5196d2)_0x69d7f3[_0x2c43e4(0x203)](_0x49e850[_0x2c43e4(0x207)]);else _0x5196d2[_0x2c43e4(0x205)]!==_0x4a9eb8||_0x3e90c4||_0x3e3693?_0x3e9b31[_0x2c43e4(0x203)](_0x49e850[_0x2c43e4(0x207)]):_0x1ea744['push'](_0x49e850[_0x2c43e4(0x207)]);}for(const _0x4288c7 of Object[_0x2c43e4(0x209)](_0x345d9d[_0x2c43e4(0x1fe)])){!_0x405000[_0x2c43e4(0x1ef)](_0x4288c7)&&_0x4d7a29[_0x2c43e4(0x203)](_0x4288c7);}const _0x1637ee=[];if(_0x5d8de1[_0x2c43e4(0x1fd)](_0x2c43e4(0x20b))){const _0x15bfd6=await fetchAllSqlCodes(_0x5d8de1[_0x2c43e4(0x1f4)]);for(const _0xb5ec37 of _0x15bfd6){!_0x405000[_0x2c43e4(0x1ef)](_0xb5ec37)&&!_0x345d9d[_0x2c43e4(0x1fe)][_0xb5ec37]&&_0x1637ee[_0x2c43e4(0x203)](_0xb5ec37);}}const _0x524c55=_0x69d7f3[_0x2c43e4(0x20e)]===0x0&&_0x3e9b31[_0x2c43e4(0x20e)]===0x0&&_0x4d7a29[_0x2c43e4(0x20e)]===0x0&&_0x1637ee[_0x2c43e4(0x20e)]===0x0;return{'ok':!![],'data':{'added':_0x69d7f3,'modified':_0x3e9b31,'missing':_0x4d7a29,'unchanged':_0x1ea744,'remoteOnly':_0x1637ee},'message':_0x524c55?_0x2c43e4(0x1f8):_0x69d7f3['length']+_0x2c43e4(0x1f5)+_0x3e9b31[_0x2c43e4(0x20e)]+_0x2c43e4(0x20c)+_0x4d7a29[_0x2c43e4(0x20e)]+_0x2c43e4(0x1f2)+_0x1ea744['length']+'\x20unchanged'+(_0x1637ee['length']>0x0?',\x20'+_0x1637ee['length']+_0x2c43e4(0x1eb):'')};}};
1
+ function a195_0x2596(){const _0x1ccfb0=['boolean','56892anGBfd','861755NUcrki','remote','lockFilePath','445856ipWhJx','relativePath','status','All\x20SQL\x20queries\x20are\x20in\x20sync.','read','lockKey','\x20remote-only','keys','540504gJoeuI','sqls','sql','sqlRoot','bool','path','length','4690jSZqrI','push','map','sqlName','\x20missing,\x20','has','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','446258srqvCb','appCode','totalCount','\x20unchanged','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','filePath','sqlCode','2672Sybdzh','336198CNFohJ'];a195_0x2596=function(){return _0x1ccfb0;};return a195_0x2596();}const a195_0x578fd2=a195_0x45c9;(function(_0x4523a9,_0x355bcc){const _0x1732ba=a195_0x45c9,_0x24fc88=_0x4523a9();while(!![]){try{const _0x17bf1d=parseInt(_0x1732ba(0x109))/0x1+-parseInt(_0x1732ba(0xff))/0x2+parseInt(_0x1732ba(0xf1))/0x3+parseInt(_0x1732ba(0xe9))/0x4+-parseInt(_0x1732ba(0x10a))/0x5+-parseInt(_0x1732ba(0x107))/0x6+-parseInt(_0x1732ba(0xf8))/0x7*(-parseInt(_0x1732ba(0x106))/0x8);if(_0x17bf1d===_0x355bcc)break;else _0x24fc88['push'](_0x24fc88['shift']());}catch(_0x348905){_0x24fc88['push'](_0x24fc88['shift']());}}}(a195_0x2596,0x1d7d7));import{listSqlQueries}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';function a195_0x45c9(_0x321bde,_0xbe1547){_0x321bde=_0x321bde-0xe7;const _0x259646=a195_0x2596();let _0x45c9dc=_0x259646[_0x321bde];return _0x45c9dc;}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(_0x34870a){const _0x3bd849=a195_0x45c9,_0x3c5ff9=[];let _0x45c997=0x1;while(!![]){const _0x227835=await listSqlQueries(_0x34870a,{'currentPage':_0x45c997,'pageSize':PAGE_SIZE}),_0x2ade70=_0x227835['tableData']??[];_0x3c5ff9['push'](..._0x2ade70[_0x3bd849(0xfa)](_0x20ccb9=>_0x20ccb9[_0x3bd849(0x105)]));if(_0x2ade70['length']===0x0)break;const _0x19b5fe=_0x227835['paging']?.[_0x3bd849(0x101)];if(_0x19b5fe!=null?_0x3c5ff9[_0x3bd849(0xf7)]>=_0x19b5fe:_0x2ade70[_0x3bd849(0xf7)]<PAGE_SIZE)break;_0x45c997++;}return _0x3c5ff9;}export const sqlStatus={'service':a195_0x578fd2(0xf3),'command':a195_0x578fd2(0xeb),'description':a195_0x578fd2(0x103),'risk':a195_0x578fd2(0xed),'flags':[{'name':a195_0x578fd2(0xe7),'type':a195_0x578fd2(0x108),'description':a195_0x578fd2(0xfe)}],async 'execute'(_0x26a978){const _0x42ed41=a195_0x578fd2,_0x2e6386=loadSqlProjectConfig(_0x26a978[_0x42ed41(0x100)]),_0x3963e3=await readSqlLockFile(_0x2e6386[_0x42ed41(0xe8)]),{appLock:_0x104317}=ensureSqlLockScope(_0x3963e3??createEmptySqlLock(),_0x2e6386[_0x42ed41(0x100)],_0x2e6386[_0x42ed41(0xf4)],_0x42ed41(0xeb)),_0x153589=await scanLocalSqlQueries(_0x2e6386),_0xe76e6e=[],_0x1226c1=[],_0x1e40bc=[],_0x551559=[],_0x2b25c2=new Set(_0x153589[_0x42ed41(0xfa)](_0x5d1f75=>_0x5d1f75[_0x42ed41(0xee)]));for(const _0x54940b of _0x153589){const _0x5779fd=await computeSqlFileHash(_0x54940b[_0x42ed41(0x104)]),_0x4e5ca4=_0x104317[_0x42ed41(0xf2)][_0x54940b['lockKey']],_0x2fc0c6=!!_0x4e5ca4&&_0x4e5ca4[_0x42ed41(0xf6)]!==_0x54940b[_0x42ed41(0xea)],_0x2458ed=!!_0x4e5ca4&&!!_0x54940b[_0x42ed41(0xfb)]&&_0x4e5ca4[_0x42ed41(0xfb)]!==_0x54940b[_0x42ed41(0xfb)];if(!_0x4e5ca4)_0xe76e6e['push'](_0x54940b['lockKey']);else _0x4e5ca4['hash']!==_0x5779fd||_0x2fc0c6||_0x2458ed?_0x1226c1[_0x42ed41(0xf9)](_0x54940b[_0x42ed41(0xee)]):_0x1e40bc['push'](_0x54940b[_0x42ed41(0xee)]);}for(const _0x50dc78 of Object[_0x42ed41(0xf0)](_0x104317[_0x42ed41(0xf2)])){!_0x2b25c2[_0x42ed41(0xfd)](_0x50dc78)&&_0x551559[_0x42ed41(0xf9)](_0x50dc78);}const _0x5973c9=[];if(_0x26a978[_0x42ed41(0xf5)](_0x42ed41(0xe7))){const _0x438d54=await fetchAllSqlCodes(_0x26a978[_0x42ed41(0x100)]);for(const _0x35e2bc of _0x438d54){!_0x2b25c2['has'](_0x35e2bc)&&!_0x104317[_0x42ed41(0xf2)][_0x35e2bc]&&_0x5973c9[_0x42ed41(0xf9)](_0x35e2bc);}}const _0x29e8f2=_0xe76e6e[_0x42ed41(0xf7)]===0x0&&_0x1226c1[_0x42ed41(0xf7)]===0x0&&_0x551559[_0x42ed41(0xf7)]===0x0&&_0x5973c9[_0x42ed41(0xf7)]===0x0;return{'ok':!![],'data':{'added':_0xe76e6e,'modified':_0x1226c1,'missing':_0x551559,'unchanged':_0x1e40bc,'remoteOnly':_0x5973c9},'message':_0x29e8f2?_0x42ed41(0xec):_0xe76e6e[_0x42ed41(0xf7)]+'\x20added,\x20'+_0x1226c1[_0x42ed41(0xf7)]+'\x20modified,\x20'+_0x551559[_0x42ed41(0xf7)]+_0x42ed41(0xfc)+_0x1e40bc[_0x42ed41(0xf7)]+_0x42ed41(0x102)+(_0x5973c9[_0x42ed41(0xf7)]>0x0?',\x20'+_0x5973c9['length']+_0x42ed41(0xef):'')};}};
@@ -1 +1 @@
1
- function a196_0x5d4a(){const _0x592bf1=['push','Provide\x20--file\x20or\x20--sql','reason','read','381DVsYoe','dataset','File\x20not\x20found:\x20','6ujIjLS','unshift','validate','schemas','pkField','indexName','SQL\x20schema\x20validation','flagMissing','schema:','16004PfSFBe','appCode','check-indexes','validation','bool','utf-8','type','isDangerous','split','from','columnNames','indexes','1688700MGQlQD','size','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','isSelectOnly','length','joinAudit','tables','Table\x20\x22','isArray','index_columns','get','filter','name','trim','\x22\x20not\x20found\x20or\x20not\x20accessible','primary','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','columns','1635256kXzXLx','string','411530AHHDfj','sql','find','20168cXRMqN','tableName','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','dbtableConfig','sqlType','parameters','str','valid','1075KwXZQG','1251mRuklm','schemaWarnings','index_name','696dEEibn','cwd','1831705IzvMTJ','index_type','message','99GtvObW','--check-indexes\x20requires\x20--schemas.','file','fields','toLowerCase','map','\x22\x20not\x20found\x20in\x20any\x20dataset'];a196_0x5d4a=function(){return _0x592bf1;};return a196_0x5d4a();}const a196_0x49b37f=a196_0x3cd7;(function(_0x44d0c3,_0x420a3a){const _0x3c7e69=a196_0x3cd7,_0x51704e=_0x44d0c3();while(!![]){try{const _0x2a2818=-parseInt(_0x3c7e69(0x1b4))/0x1*(-parseInt(_0x3c7e69(0x1b8))/0x2)+-parseInt(_0x3c7e69(0x1c8))/0x3*(parseInt(_0x3c7e69(0x1d4))/0x4)+parseInt(_0x3c7e69(0x1ba))/0x5*(parseInt(_0x3c7e69(0x1cb))/0x6)+parseInt(_0x3c7e69(0x1a7))/0x7+parseInt(_0x3c7e69(0x1ac))/0x8*(-parseInt(_0x3c7e69(0x1b5))/0x9)+parseInt(_0x3c7e69(0x1a9))/0xa*(parseInt(_0x3c7e69(0x1bd))/0xb)+-parseInt(_0x3c7e69(0x1e0))/0xc;if(_0x2a2818===_0x420a3a)break;else _0x51704e['push'](_0x51704e['shift']());}catch(_0x1dcb13){_0x51704e['push'](_0x51704e['shift']());}}}(a196_0x5d4a,0x54443));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';function a196_0x3cd7(_0x1aee4f,_0x583ea7){_0x1aee4f=_0x1aee4f-0x19a;const _0x5d4a30=a196_0x5d4a();let _0x3cd749=_0x5d4a30[_0x1aee4f];return _0x3cd749;}import{CliErrors}from'../../errors.js';import{assertDatasetIsDbTableBacked,filterDbTableBackedDatasets}from'../../commands/dataset/capability.js';export const sqlValidate={'service':a196_0x49b37f(0x1aa),'command':a196_0x49b37f(0x1cd),'description':a196_0x49b37f(0x1a5),'risk':a196_0x49b37f(0x1c7),'flags':[{'name':a196_0x49b37f(0x1bf),'type':a196_0x49b37f(0x1a8),'description':a196_0x49b37f(0x1e2)},{'name':a196_0x49b37f(0x1aa),'type':a196_0x49b37f(0x1a8),'description':'Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)'},{'name':a196_0x49b37f(0x1ce),'type':a196_0x49b37f(0x1a8),'description':a196_0x49b37f(0x1ae)},{'name':'check-indexes','type':'boolean','description':'Audit\x20top-level\x20JOIN\x20equality\x20predicates\x20against\x20dataset\x20index\x20metadata'}],async 'execute'(_0x1e0259){const _0x4a71d5=a196_0x49b37f,_0x8ebc8d=_0x1e0259[_0x4a71d5(0x1b2)]('file'),_0x23bca7=_0x1e0259[_0x4a71d5(0x1b2)]('sql'),_0x4510a9=_0x1e0259[_0x4a71d5(0x1b2)](_0x4a71d5(0x1ce)),_0x1db20d=_0x1e0259[_0x4a71d5(0x1d8)](_0x4a71d5(0x1d6));if(!_0x8ebc8d&&!_0x23bca7)throw CliErrors[_0x4a71d5(0x1d2)](_0x4a71d5(0x1bf),_0x4a71d5(0x1c5));if(_0x1db20d&&!_0x4510a9)throw CliErrors[_0x4a71d5(0x1d7)](_0x4a71d5(0x1be));let _0x508787;if(_0x8ebc8d){const _0x59b843=resolve(process[_0x4a71d5(0x1b9)](),_0x8ebc8d);if(!existsSync(_0x59b843))throw CliErrors['validation'](_0x4a71d5(0x1ca)+_0x59b843);_0x508787=readFileSync(_0x59b843,_0x4a71d5(0x1d9));}else _0x508787=_0x23bca7;const _0x40f720=validateSql(_0x508787),_0x221929={'valid':_0x40f720[_0x4a71d5(0x1b3)],'sqlType':_0x40f720[_0x4a71d5(0x1b0)][_0x4a71d5(0x1da)],'isSelectOnly':_0x40f720[_0x4a71d5(0x1b0)][_0x4a71d5(0x1e3)],'isDangerous':_0x40f720[_0x4a71d5(0x1b0)][_0x4a71d5(0x1db)],'tables':_0x40f720[_0x4a71d5(0x19b)],'parameters':_0x40f720[_0x4a71d5(0x1b1)],'message':_0x40f720[_0x4a71d5(0x1bc)]};_0x40f720[_0x4a71d5(0x1b0)][_0x4a71d5(0x1c6)]&&(_0x221929[_0x4a71d5(0x1c6)]=_0x40f720['sqlType'][_0x4a71d5(0x1c6)]);if(_0x4510a9&&_0x40f720['valid']){const _0x4b4c1b=_0x4510a9[_0x4a71d5(0x1dc)](',')['map'](_0x5b7583=>_0x5b7583[_0x4a71d5(0x1a2)]())['filter'](Boolean),_0x2cd82c=[],_0x370a6e=[],_0x388298=filterDbTableBackedDatasets(await listDatasets(_0x1e0259[_0x4a71d5(0x1d5)])),_0xebcb53=new Map(_0x388298[_0x4a71d5(0x1c2)](_0x2cb959=>[_0x2cb959['dbtableConfig']?.[_0x4a71d5(0x1ad)]?.[_0x4a71d5(0x1c1)](),_0x2cb959]));for(const _0x5a4ebb of _0x40f720[_0x4a71d5(0x19b)]){const _0x600fb8=_0xebcb53[_0x4a71d5(0x19f)](_0x5a4ebb[_0x4a71d5(0x1c1)]());!_0x600fb8&&_0x2cd82c['push'](_0x4a71d5(0x19c)+_0x5a4ebb+_0x4a71d5(0x1c3));}for(const _0x310538 of _0x4b4c1b){let _0x33bc95;try{_0x33bc95=await getDatasetDetail(_0x310538);}catch{_0x2cd82c[_0x4a71d5(0x1c4)]('Dataset\x20\x22'+_0x310538+_0x4a71d5(0x1a3));continue;}assertDatasetIsDbTableBacked(_0x33bc95,_0x4a71d5(0x1d1));const _0x3eda5f=Array[_0x4a71d5(0x19d)](_0x33bc95[_0x4a71d5(0x1c0)])?_0x33bc95[_0x4a71d5(0x1c0)]:[],_0x1b946c=new Set(_0x3eda5f[_0x4a71d5(0x1c2)](_0x1f243b=>_0x1f243b[_0x4a71d5(0x1a1)]?.[_0x4a71d5(0x1c1)]())),_0x15586e=_0x33bc95[_0x4a71d5(0x1af)]?.[_0x4a71d5(0x1ad)]||_0x33bc95[_0x4a71d5(0x1ad)]||_0x310538;_0x221929[_0x4a71d5(0x1d3)+_0x15586e]={'code':_0x310538,'tableName':_0x15586e,'fieldCount':_0x1b946c[_0x4a71d5(0x1e1)],'fields':Array[_0x4a71d5(0x1dd)](_0x1b946c)};if(_0x1db20d){const _0x40b8fe=normalizeDatasetIndexes(_0x33bc95);_0x370a6e[_0x4a71d5(0x1c4)]({'tableName':_0x15586e,..._0x40b8fe});}}_0x2cd82c[_0x4a71d5(0x1e4)]>0x0&&(_0x221929[_0x4a71d5(0x1b6)]=_0x2cd82c),_0x1db20d&&(_0x221929[_0x4a71d5(0x19a)]=auditSqlJoinIndexes(_0x508787,_0x370a6e));}return{'ok':_0x40f720[_0x4a71d5(0x1b3)],'data':_0x221929,'message':_0x40f720[_0x4a71d5(0x1bc)]};}};function normalizeDatasetIndexes(_0x1fed22){const _0x2bc9b8=a196_0x49b37f,_0x1bbfdf=Array[_0x2bc9b8(0x19d)](_0x1fed22?.[_0x2bc9b8(0x1c9)]?.['indexes'])?_0x1fed22['dataset'][_0x2bc9b8(0x1df)]:Array[_0x2bc9b8(0x19d)](_0x1fed22?.[_0x2bc9b8(0x1df)])?_0x1fed22[_0x2bc9b8(0x1df)]:[],_0x26c6f0=_0x1bbfdf['flatMap'](_0x40e1e6=>{const _0x183eab=_0x2bc9b8,_0x2b0c51=Array[_0x183eab(0x19d)](_0x40e1e6?.['index_columns'])?_0x40e1e6[_0x183eab(0x19e)]:Array['isArray'](_0x40e1e6?.['columnNames'])?_0x40e1e6[_0x183eab(0x1de)]:Array[_0x183eab(0x19d)](_0x40e1e6?.[_0x183eab(0x1a6)])?_0x40e1e6[_0x183eab(0x1a6)]:[],_0x25b0aa=_0x2b0c51['filter'](_0x13a40d=>typeof _0x13a40d===_0x183eab(0x1a8))[_0x183eab(0x1c2)](_0x9f8aae=>_0x9f8aae[_0x183eab(0x1a2)]())[_0x183eab(0x1a0)](Boolean);if(_0x25b0aa[_0x183eab(0x1e4)]===0x0)return[];const _0x60c880=[_0x40e1e6?.[_0x183eab(0x1d0)],_0x40e1e6?.[_0x183eab(0x1b7)],_0x40e1e6?.[_0x183eab(0x1a1)]][_0x183eab(0x1ab)](_0x4779d7=>typeof _0x4779d7==='string'&&_0x4779d7[_0x183eab(0x1a2)]()),_0x8a63cb=[_0x40e1e6?.[_0x183eab(0x1bb)],_0x40e1e6?.[_0x183eab(0x1da)]][_0x183eab(0x1ab)](_0x42fecb=>typeof _0x42fecb===_0x183eab(0x1a8)&&_0x42fecb[_0x183eab(0x1a2)]());return[{..._0x60c880?{'name':_0x60c880[_0x183eab(0x1a2)]()}:{},..._0x8a63cb?{'type':_0x8a63cb[_0x183eab(0x1a2)]()}:{},'columns':_0x25b0aa}];}),_0x48fa42=[..._0x26c6f0],_0x2f0d16=typeof _0x1fed22?.[_0x2bc9b8(0x1af)]?.[_0x2bc9b8(0x1cf)]===_0x2bc9b8(0x1a8)?_0x1fed22[_0x2bc9b8(0x1af)][_0x2bc9b8(0x1cf)][_0x2bc9b8(0x1dc)](',')['map'](_0x471ee8=>_0x471ee8['trim']())[_0x2bc9b8(0x1a0)](Boolean):[];return _0x2f0d16[_0x2bc9b8(0x1e4)]>0x0&&_0x48fa42[_0x2bc9b8(0x1cc)]({'type':_0x2bc9b8(0x1a4),'columns':_0x2f0d16}),{'indexes':_0x48fa42,'metadataAvailable':_0x26c6f0[_0x2bc9b8(0x1e4)]>0x0};}
1
+ const a196_0x2674c1=a196_0x5ee3;function a196_0x5ee3(_0x3a3a1f,_0x401424){_0x3a3a1f=_0x3a3a1f-0x142;const _0x330031=a196_0x3300();let _0x5ee313=_0x330031[_0x3a3a1f];return _0x5ee313;}(function(_0x4199fa,_0x1c53ae){const _0x53505a=a196_0x5ee3,_0x392c8c=_0x4199fa();while(!![]){try{const _0x124ea8=parseInt(_0x53505a(0x160))/0x1*(parseInt(_0x53505a(0x173))/0x2)+parseInt(_0x53505a(0x147))/0x3*(-parseInt(_0x53505a(0x14b))/0x4)+-parseInt(_0x53505a(0x16f))/0x5*(-parseInt(_0x53505a(0x181))/0x6)+-parseInt(_0x53505a(0x179))/0x7+-parseInt(_0x53505a(0x167))/0x8*(parseInt(_0x53505a(0x17b))/0x9)+parseInt(_0x53505a(0x182))/0xa*(parseInt(_0x53505a(0x163))/0xb)+-parseInt(_0x53505a(0x15c))/0xc*(-parseInt(_0x53505a(0x14f))/0xd);if(_0x124ea8===_0x1c53ae)break;else _0x392c8c['push'](_0x392c8c['shift']());}catch(_0x470cae){_0x392c8c['push'](_0x392c8c['shift']());}}}(a196_0x3300,0x3bf9b));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';function a196_0x3300(){const _0x244bec=['columnNames','fields','boolean','tableName','9hCDdwX','indexes','indexName','unshift','491820NCwBcj','type','validate','validation','52esCeqj','string','pkField','valid','index_type','sqlType','columns','Dataset\x20\x22','str','flatMap','filter','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','1049340RYgYAC','isArray','\x22\x20not\x20found\x20or\x20not\x20accessible','sql','52eENVfu','map','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','4805779gxEMgB','dataset','toLowerCase','dbtableConfig','1009456dMyHiM','trim','read','check-indexes','\x22\x20not\x20found\x20in\x20any\x20dataset','reason','bool','push','76060DzCJgg','Audit\x20top-level\x20JOIN\x20equality\x20predicates\x20against\x20dataset\x20index\x20metadata','schema:','File\x20not\x20found:\x20','17870OVsZWi','index_columns','tables','find','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','Provide\x20--file\x20or\x20--sql','1914017HqZrVy','--check-indexes\x20requires\x20--schemas.','27NlcRwM','utf-8','Table\x20\x22','name','appCode','schemaWarnings','6zEQEgX','10XjGgFg','isSelectOnly','message','file','length','split','schemas'];a196_0x3300=function(){return _0x244bec;};return a196_0x3300();}import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{assertDatasetIsDbTableBacked,filterDbTableBackedDatasets}from'../../commands/dataset/capability.js';export const sqlValidate={'service':'sql','command':a196_0x2674c1(0x14d),'description':a196_0x2674c1(0x15a),'risk':a196_0x2674c1(0x169),'flags':[{'name':a196_0x2674c1(0x185),'type':'string','description':a196_0x2674c1(0x177)},{'name':a196_0x2674c1(0x15f),'type':'string','description':a196_0x2674c1(0x15b)},{'name':a196_0x2674c1(0x142),'type':a196_0x2674c1(0x150),'description':a196_0x2674c1(0x162)},{'name':a196_0x2674c1(0x16a),'type':a196_0x2674c1(0x145),'description':a196_0x2674c1(0x170)}],async 'execute'(_0x5c8d16){const _0x5c5001=a196_0x2674c1,_0x3625cd=_0x5c8d16[_0x5c5001(0x157)]('file'),_0x3a6e1=_0x5c8d16['str'](_0x5c5001(0x15f)),_0x19f568=_0x5c8d16[_0x5c5001(0x157)](_0x5c5001(0x142)),_0x453bec=_0x5c8d16[_0x5c5001(0x16d)]('check-indexes');if(!_0x3625cd&&!_0x3a6e1)throw CliErrors['flagMissing'](_0x5c5001(0x185),_0x5c5001(0x178));if(_0x453bec&&!_0x19f568)throw CliErrors[_0x5c5001(0x14e)](_0x5c5001(0x17a));let _0x30bd44;if(_0x3625cd){const _0x2f9383=resolve(process['cwd'](),_0x3625cd);if(!existsSync(_0x2f9383))throw CliErrors['validation'](_0x5c5001(0x172)+_0x2f9383);_0x30bd44=readFileSync(_0x2f9383,_0x5c5001(0x17c));}else _0x30bd44=_0x3a6e1;const _0x52e73f=validateSql(_0x30bd44),_0x49be1f={'valid':_0x52e73f['valid'],'sqlType':_0x52e73f[_0x5c5001(0x154)][_0x5c5001(0x14c)],'isSelectOnly':_0x52e73f['sqlType'][_0x5c5001(0x183)],'isDangerous':_0x52e73f[_0x5c5001(0x154)]['isDangerous'],'tables':_0x52e73f['tables'],'parameters':_0x52e73f['parameters'],'message':_0x52e73f['message']};_0x52e73f[_0x5c5001(0x154)][_0x5c5001(0x16c)]&&(_0x49be1f['reason']=_0x52e73f[_0x5c5001(0x154)][_0x5c5001(0x16c)]);if(_0x19f568&&_0x52e73f[_0x5c5001(0x152)]){const _0x34a53f=_0x19f568[_0x5c5001(0x187)](',')[_0x5c5001(0x161)](_0x35c959=>_0x35c959[_0x5c5001(0x168)]())[_0x5c5001(0x159)](Boolean),_0x39241e=[],_0xf56022=[],_0x15d3e6=filterDbTableBackedDatasets(await listDatasets(_0x5c8d16[_0x5c5001(0x17f)])),_0x12de23=new Map(_0x15d3e6['map'](_0x316459=>[_0x316459[_0x5c5001(0x166)]?.[_0x5c5001(0x146)]?.['toLowerCase'](),_0x316459]));for(const _0x4eaa60 of _0x52e73f[_0x5c5001(0x175)]){const _0x942d96=_0x12de23['get'](_0x4eaa60[_0x5c5001(0x165)]());!_0x942d96&&_0x39241e[_0x5c5001(0x16e)](_0x5c5001(0x17d)+_0x4eaa60+_0x5c5001(0x16b));}for(const _0x3e7439 of _0x34a53f){let _0x54a61b;try{_0x54a61b=await getDatasetDetail(_0x3e7439);}catch{_0x39241e['push'](_0x5c5001(0x156)+_0x3e7439+_0x5c5001(0x15e));continue;}assertDatasetIsDbTableBacked(_0x54a61b,'SQL\x20schema\x20validation');const _0xa1da25=Array['isArray'](_0x54a61b[_0x5c5001(0x144)])?_0x54a61b['fields']:[],_0x14390e=new Set(_0xa1da25[_0x5c5001(0x161)](_0x4e762a=>_0x4e762a['name']?.['toLowerCase']())),_0x48e7da=_0x54a61b[_0x5c5001(0x166)]?.[_0x5c5001(0x146)]||_0x54a61b[_0x5c5001(0x146)]||_0x3e7439;_0x49be1f[_0x5c5001(0x171)+_0x48e7da]={'code':_0x3e7439,'tableName':_0x48e7da,'fieldCount':_0x14390e['size'],'fields':Array['from'](_0x14390e)};if(_0x453bec){const _0x4f9c=normalizeDatasetIndexes(_0x54a61b);_0xf56022[_0x5c5001(0x16e)]({'tableName':_0x48e7da,..._0x4f9c});}}_0x39241e[_0x5c5001(0x186)]>0x0&&(_0x49be1f[_0x5c5001(0x180)]=_0x39241e),_0x453bec&&(_0x49be1f['joinAudit']=auditSqlJoinIndexes(_0x30bd44,_0xf56022));}return{'ok':_0x52e73f[_0x5c5001(0x152)],'data':_0x49be1f,'message':_0x52e73f[_0x5c5001(0x184)]};}};function normalizeDatasetIndexes(_0x51c745){const _0xc03637=a196_0x2674c1,_0x14c9a3=Array[_0xc03637(0x15d)](_0x51c745?.[_0xc03637(0x164)]?.[_0xc03637(0x148)])?_0x51c745[_0xc03637(0x164)][_0xc03637(0x148)]:Array[_0xc03637(0x15d)](_0x51c745?.[_0xc03637(0x148)])?_0x51c745[_0xc03637(0x148)]:[],_0x1aac86=_0x14c9a3[_0xc03637(0x158)](_0x286fa5=>{const _0x579c09=_0xc03637,_0x530d17=Array[_0x579c09(0x15d)](_0x286fa5?.[_0x579c09(0x174)])?_0x286fa5[_0x579c09(0x174)]:Array[_0x579c09(0x15d)](_0x286fa5?.[_0x579c09(0x143)])?_0x286fa5[_0x579c09(0x143)]:Array[_0x579c09(0x15d)](_0x286fa5?.['columns'])?_0x286fa5[_0x579c09(0x155)]:[],_0x374c38=_0x530d17[_0x579c09(0x159)](_0x6cd7b1=>typeof _0x6cd7b1===_0x579c09(0x150))['map'](_0x5e78d7=>_0x5e78d7[_0x579c09(0x168)]())[_0x579c09(0x159)](Boolean);if(_0x374c38[_0x579c09(0x186)]===0x0)return[];const _0x176648=[_0x286fa5?.[_0x579c09(0x149)],_0x286fa5?.['index_name'],_0x286fa5?.[_0x579c09(0x17e)]][_0x579c09(0x176)](_0x5ccd7e=>typeof _0x5ccd7e===_0x579c09(0x150)&&_0x5ccd7e[_0x579c09(0x168)]()),_0x54a5e8=[_0x286fa5?.[_0x579c09(0x153)],_0x286fa5?.[_0x579c09(0x14c)]][_0x579c09(0x176)](_0x50edf7=>typeof _0x50edf7===_0x579c09(0x150)&&_0x50edf7[_0x579c09(0x168)]());return[{..._0x176648?{'name':_0x176648[_0x579c09(0x168)]()}:{},..._0x54a5e8?{'type':_0x54a5e8['trim']()}:{},'columns':_0x374c38}];}),_0x2620fd=[..._0x1aac86],_0x58d790=typeof _0x51c745?.[_0xc03637(0x166)]?.[_0xc03637(0x151)]===_0xc03637(0x150)?_0x51c745[_0xc03637(0x166)][_0xc03637(0x151)][_0xc03637(0x187)](',')[_0xc03637(0x161)](_0x1fcc22=>_0x1fcc22[_0xc03637(0x168)]())[_0xc03637(0x159)](Boolean):[];return _0x58d790[_0xc03637(0x186)]>0x0&&_0x2620fd[_0xc03637(0x14a)]({'type':'primary','columns':_0x58d790}),{'indexes':_0x2620fd,'metadataAvailable':_0x1aac86[_0xc03637(0x186)]>0x0};}
@@ -1 +1 @@
1
- function a197_0x3caa(_0x244b56,_0x4d6f5e){_0x244b56=_0x244b56-0x8e;const _0x1c64be=a197_0x1c64();let _0x3caa81=_0x1c64be[_0x244b56];return _0x3caa81;}(function(_0x595879,_0x23da6b){const _0x43e11c=a197_0x3caa,_0x29793c=_0x595879();while(!![]){try{const _0x5931cc=parseInt(_0x43e11c(0x95))/0x1+-parseInt(_0x43e11c(0x92))/0x2+-parseInt(_0x43e11c(0x8f))/0x3+-parseInt(_0x43e11c(0x90))/0x4+-parseInt(_0x43e11c(0x93))/0x5+parseInt(_0x43e11c(0x8e))/0x6+-parseInt(_0x43e11c(0x94))/0x7*(-parseInt(_0x43e11c(0x91))/0x8);if(_0x5931cc===_0x23da6b)break;else _0x29793c['push'](_0x29793c['shift']());}catch(_0x243e7d){_0x29793c['push'](_0x29793c['shift']());}}}(a197_0x1c64,0x60b01));import{taskStatus}from'../../commands/task/status.js';function a197_0x1c64(){const _0x14e6ce=['1625605hiRZqM','8287937PaQsSD','13513gsKEfp','4405878smLOfa','417966WgDxcd','1207284PlgguU','8ECnJiF','1539040ycghqK'];a197_0x1c64=function(){return _0x14e6ce;};return a197_0x1c64();}export const taskDefinitions=[taskStatus];
1
+ function a197_0x7271(_0x24289d,_0x4d87fb){_0x24289d=_0x24289d-0x85;const _0x40579f=a197_0x4057();let _0x72710=_0x40579f[_0x24289d];return _0x72710;}(function(_0x2bd533,_0x42af76){const _0x385ac8=a197_0x7271,_0x173784=_0x2bd533();while(!![]){try{const _0x33b46b=-parseInt(_0x385ac8(0x89))/0x1*(-parseInt(_0x385ac8(0x86))/0x2)+-parseInt(_0x385ac8(0x8c))/0x3*(-parseInt(_0x385ac8(0x87))/0x4)+parseInt(_0x385ac8(0x8a))/0x5*(-parseInt(_0x385ac8(0x8f))/0x6)+parseInt(_0x385ac8(0x85))/0x7*(parseInt(_0x385ac8(0x88))/0x8)+-parseInt(_0x385ac8(0x8b))/0x9+-parseInt(_0x385ac8(0x8e))/0xa+-parseInt(_0x385ac8(0x8d))/0xb;if(_0x33b46b===_0x42af76)break;else _0x173784['push'](_0x173784['shift']());}catch(_0x15a4a4){_0x173784['push'](_0x173784['shift']());}}}(a197_0x4057,0x7ef3e));import{taskStatus}from'../../commands/task/status.js';function a197_0x4057(){const _0xffbfa9=['3414CasUYs','190612XQgKeF','699592ANADBZ','19xIkYJk','5485bXiFhq','93474kpwniE','51rpZJVM','11134255TeUFtX','1861910dDmUki','414RXZEKt','77UQflNg'];a197_0x4057=function(){return _0xffbfa9;};return a197_0x4057();}export const taskDefinitions=[taskStatus];
@@ -1 +1 @@
1
- const a198_0xeef410=a198_0x2892;(function(_0x1d730e,_0x563c62){const _0x23e1bb=a198_0x2892,_0xe60908=_0x1d730e();while(!![]){try{const _0x129a5d=-parseInt(_0x23e1bb(0xb5))/0x1+parseInt(_0x23e1bb(0xaf))/0x2*(parseInt(_0x23e1bb(0xa3))/0x3)+-parseInt(_0x23e1bb(0xa7))/0x4+-parseInt(_0x23e1bb(0x9f))/0x5*(-parseInt(_0x23e1bb(0xa2))/0x6)+-parseInt(_0x23e1bb(0xb3))/0x7*(-parseInt(_0x23e1bb(0xab))/0x8)+-parseInt(_0x23e1bb(0xb0))/0x9+parseInt(_0x23e1bb(0xad))/0xa*(parseInt(_0x23e1bb(0xaa))/0xb);if(_0x129a5d===_0x563c62)break;else _0xe60908['push'](_0xe60908['shift']());}catch(_0x1bbba2){_0xe60908['push'](_0xe60908['shift']());}}}(a198_0x25c6,0x1b613));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asyncTaskMessage,buildAsyncTaskStatusCommand,normalizeAsyncTask}from'../../commands/common/async-task.js';function a198_0x25c6(){const _0x1d61d8=['25392qqddHM','31062RTFUyr','task-id','Query\x20an\x20asynchronous\x20task;\x20repeat\x20for\x20PENDING\x20or\x20PROCESSING\x20until\x20SUCCESS\x20or\x20FAILED','cookie','26576meDTpl','read','compress','77NeBWQi','82664IJGNbN','apiError','122930tWjwlC','trim','10PFqEyw','991125sxgmOh','Task\x20status\x20response\x20id\x20mismatch:\x20requested\x20','appCode','28YpGJCz','string','30645teytCl','taskId','task','95oaBziE','str','status'];a198_0x25c6=function(){return _0x1d61d8;};return a198_0x25c6();}import{getAsyncTaskStatus}from'../../core/api-client.js';function a198_0x2892(_0x20cdc3,_0x2f6a4c){_0x20cdc3=_0x20cdc3-0x9d;const _0x25c6ed=a198_0x25c6();let _0x289260=_0x25c6ed[_0x20cdc3];return _0x289260;}import{CliErrors}from'../../errors.js';export const taskStatus={'service':a198_0xeef410(0x9e),'command':a198_0xeef410(0xa1),'description':a198_0xeef410(0xa5),'risk':a198_0xeef410(0xa8),'defaultOutputFormat':a198_0xeef410(0xa9),'structuredErrors':!![],'flags':[{'name':a198_0xeef410(0xa4),'type':a198_0xeef410(0xb4),'required':!![],'description':'Task\x20id\x20returned\x20by\x20an\x20asynchronous\x20platform\x20command'},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x579a48){const _0x51519a=a198_0xeef410;if(!_0x579a48[_0x51519a(0xa0)](_0x51519a(0xa4))[_0x51519a(0xae)]())throw CliErrors['flagMissing'](_0x51519a(0xa4));},async 'execute'(_0x18b44c){const _0x4ed67c=a198_0xeef410,_0x1e7528=_0x18b44c['str']('task-id')['trim'](),_0x9ce7=normalizeAsyncTask(await getAsyncTaskStatus(_0x1e7528,_0x18b44c['appCode'],_0x18b44c[_0x4ed67c(0xa6)]));if(_0x9ce7[_0x4ed67c(0x9d)]!==_0x1e7528)throw CliErrors[_0x4ed67c(0xac)](_0x4ed67c(0xb1)+_0x1e7528+',\x20received\x20'+_0x9ce7[_0x4ed67c(0x9d)]+'.');const _0x34a5ca=buildAsyncTaskStatusCommand(_0x9ce7['taskId'],_0x18b44c[_0x4ed67c(0xb2)]);return{'ok':!![],'message':asyncTaskMessage(_0x9ce7),'data':{'appCode':_0x18b44c[_0x4ed67c(0xb2)],..._0x9ce7,'query':_0x9ce7['isTerminal']?null:{'command':_0x34a5ca}}};}};
1
+ const a198_0x2c6eb4=a198_0xe0e9;(function(_0xe7c3a9,_0x5f2ed3){const _0x2528c0=a198_0xe0e9,_0x3a63d7=_0xe7c3a9();while(!![]){try{const _0x3125e5=parseInt(_0x2528c0(0xcb))/0x1*(-parseInt(_0x2528c0(0xc3))/0x2)+parseInt(_0x2528c0(0xbd))/0x3+parseInt(_0x2528c0(0xba))/0x4+-parseInt(_0x2528c0(0xc1))/0x5*(-parseInt(_0x2528c0(0xc0))/0x6)+-parseInt(_0x2528c0(0xcf))/0x7*(-parseInt(_0x2528c0(0xbe))/0x8)+parseInt(_0x2528c0(0xb8))/0x9+-parseInt(_0x2528c0(0xcc))/0xa*(parseInt(_0x2528c0(0xc5))/0xb);if(_0x3125e5===_0x5f2ed3)break;else _0x3a63d7['push'](_0x3a63d7['shift']());}catch(_0x4dc9b6){_0x3a63d7['push'](_0x3a63d7['shift']());}}}(a198_0x3c9c,0xdddd0));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asyncTaskMessage,buildAsyncTaskStatusCommand,normalizeAsyncTask}from'../../commands/common/async-task.js';function a198_0xe0e9(_0x5bf9d0,_0x2d757b){_0x5bf9d0=_0x5bf9d0-0xb8;const _0x3c9c2b=a198_0x3c9c();let _0xe0e9d3=_0x3c9c2b[_0x5bf9d0];return _0xe0e9d3;}import{getAsyncTaskStatus}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const taskStatus={'service':'task','command':a198_0x2c6eb4(0xc6),'description':'Query\x20an\x20asynchronous\x20task;\x20repeat\x20for\x20PENDING\x20or\x20PROCESSING\x20until\x20SUCCESS\x20or\x20FAILED','risk':'read','defaultOutputFormat':a198_0x2c6eb4(0xc8),'structuredErrors':!![],'flags':[{'name':'task-id','type':a198_0x2c6eb4(0xbc),'required':!![],'description':a198_0x2c6eb4(0xc9)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x3175c0){const _0x32cd91=a198_0x2c6eb4;if(!_0x3175c0[_0x32cd91(0xbb)]('task-id')[_0x32cd91(0xc2)]())throw CliErrors[_0x32cd91(0xb9)](_0x32cd91(0xca));},async 'execute'(_0x50d280){const _0x506ee1=a198_0x2c6eb4,_0x35828d=_0x50d280[_0x506ee1(0xbb)](_0x506ee1(0xca))[_0x506ee1(0xc2)](),_0x4fd109=normalizeAsyncTask(await getAsyncTaskStatus(_0x35828d,_0x50d280[_0x506ee1(0xce)],_0x50d280[_0x506ee1(0xcd)]));if(_0x4fd109[_0x506ee1(0xc7)]!==_0x35828d)throw CliErrors['apiError'](_0x506ee1(0xc4)+_0x35828d+',\x20received\x20'+_0x4fd109[_0x506ee1(0xc7)]+'.');const _0x4d9e1e=buildAsyncTaskStatusCommand(_0x4fd109[_0x506ee1(0xc7)],_0x50d280[_0x506ee1(0xce)]);return{'ok':!![],'message':asyncTaskMessage(_0x4fd109),'data':{'appCode':_0x50d280[_0x506ee1(0xce)],..._0x4fd109,'query':_0x4fd109[_0x506ee1(0xbf)]?null:{'command':_0x4d9e1e}}};}};function a198_0x3c9c(){const _0x5a8da5=['flagMissing','5821200XBciMG','str','string','3838863TrTiUh','232LINRqP','isTerminal','6BdpaLQ','72115ZYedYo','trim','4iZcfoG','Task\x20status\x20response\x20id\x20mismatch:\x20requested\x20','5665rqkLId','status','taskId','compress','Task\x20id\x20returned\x20by\x20an\x20asynchronous\x20platform\x20command','task-id','640364HQwqjJ','30250qOfPLk','cookie','appCode','236593eSxVBc','160560fBZTrW'];a198_0x3c9c=function(){return _0x5a8da5;};return a198_0x3c9c();}
@@ -1 +1 @@
1
- (function(_0x53a7ac,_0x50a0a0){const _0x2ed1d8=a199_0x218f,_0x55dd71=_0x53a7ac();while(!![]){try{const _0x2badaf=parseInt(_0x2ed1d8(0xec))/0x1*(parseInt(_0x2ed1d8(0xe8))/0x2)+parseInt(_0x2ed1d8(0xe6))/0x3+-parseInt(_0x2ed1d8(0xeb))/0x4+-parseInt(_0x2ed1d8(0xe9))/0x5+parseInt(_0x2ed1d8(0xe7))/0x6+-parseInt(_0x2ed1d8(0xea))/0x7+parseInt(_0x2ed1d8(0xe5))/0x8;if(_0x2badaf===_0x50a0a0)break;else _0x55dd71['push'](_0x55dd71['shift']());}catch(_0x2bffc5){_0x55dd71['push'](_0x55dd71['shift']());}}}(a199_0x5433,0xed46a));function a199_0x5433(){const _0x3b00d5=['439596KYpKNw','100815sqAstX','13107598ThTgjw','4847512qIKUxq','7BKssoI','7376528OOmgnr','537393OZMnNp','8619924VpmAHu'];a199_0x5433=function(){return _0x3b00d5;};return a199_0x5433();}function a199_0x218f(_0x5f1691,_0x57b06f){_0x5f1691=_0x5f1691-0xe5;const _0x54339d=a199_0x5433();let _0x218f61=_0x54339d[_0x5f1691];return _0x218f61;}import{tenantMembersListDefinition}from'../../commands/tenant/members-list.js';export const tenantDefinitions=[tenantMembersListDefinition];
1
+ function a199_0x9ec9(_0x3fedf5,_0x596b0f){_0x3fedf5=_0x3fedf5-0x66;const _0x51014e=a199_0x5101();let _0x9ec9c4=_0x51014e[_0x3fedf5];return _0x9ec9c4;}(function(_0x1cc587,_0x34e8eb){const _0x298ae7=a199_0x9ec9,_0x43e9d8=_0x1cc587();while(!![]){try{const _0x37a05e=-parseInt(_0x298ae7(0x6e))/0x1+parseInt(_0x298ae7(0x6d))/0x2*(-parseInt(_0x298ae7(0x6c))/0x3)+-parseInt(_0x298ae7(0x68))/0x4+parseInt(_0x298ae7(0x6b))/0x5+-parseInt(_0x298ae7(0x6a))/0x6+-parseInt(_0x298ae7(0x67))/0x7*(parseInt(_0x298ae7(0x69))/0x8)+parseInt(_0x298ae7(0x66))/0x9;if(_0x37a05e===_0x34e8eb)break;else _0x43e9d8['push'](_0x43e9d8['shift']());}catch(_0xcee77){_0x43e9d8['push'](_0x43e9d8['shift']());}}}(a199_0x5101,0x1fe52));import{tenantMembersListDefinition}from'../../commands/tenant/members-list.js';export const tenantDefinitions=[tenantMembersListDefinition];function a199_0x5101(){const _0x1aeea8=['7245HNfCgv','3263067RyLnRG','22904AhFTRV','358544sSIwAX','416hPppeC','548442WqXZLs','1258785UwQDPk','17079zzpbCD','44TQankZ'];a199_0x5101=function(){return _0x1aeea8;};return a199_0x5101();}
@@ -1 +1 @@
1
- const a200_0x2a4097=a200_0x189d;(function(_0x49545f,_0x55dc26){const _0x139b45=a200_0x189d,_0x56dd08=_0x49545f();while(!![]){try{const _0x50a58a=parseInt(_0x139b45(0x13a))/0x1*(-parseInt(_0x139b45(0x142))/0x2)+-parseInt(_0x139b45(0x139))/0x3*(-parseInt(_0x139b45(0x13e))/0x4)+parseInt(_0x139b45(0x131))/0x5+parseInt(_0x139b45(0x135))/0x6*(-parseInt(_0x139b45(0x13c))/0x7)+parseInt(_0x139b45(0x141))/0x8+parseInt(_0x139b45(0x143))/0x9*(parseInt(_0x139b45(0x13d))/0xa)+-parseInt(_0x139b45(0x145))/0xb;if(_0x50a58a===_0x55dc26)break;else _0x56dd08['push'](_0x56dd08['shift']());}catch(_0x287030){_0x56dd08['push'](_0x56dd08['shift']());}}}(a200_0x283c,0xf2079));function a200_0x283c(){const _0x1f02ab=['Found\x20','35160hASkHu','List\x20members\x20of\x20a\x20tenant\x20available\x20to\x20the\x20current\x20account','str','tenant','56817ByNegp','660799eBvhqf','Exact\x20tenant\x20code','861sQfvgW','10RSkixz','164iQcNUe','string','trim','625960pmusML','2KAxPBW','5221773PjHIFD','length','6888816NGeYPf','members-list','7821235yXpNno','tenant-code','flagMissing'];a200_0x283c=function(){return _0x1f02ab;};return a200_0x283c();}import{listCurrentUserTenantMemberships,listTenantDirectoryMembers}from'../../core/api-client.js';function a200_0x189d(_0x325866,_0xebe29a){_0x325866=_0x325866-0x131;const _0x283cc5=a200_0x283c();let _0x189d17=_0x283cc5[_0x325866];return _0x189d17;}import{CliErrors}from'../../errors.js';import{assertTenantAccessible,projectTenantMembers}from'../../commands/tenant/shared.js';export const tenantMembersListDefinition={'service':a200_0x2a4097(0x138),'command':a200_0x2a4097(0x146),'description':a200_0x2a4097(0x136),'risk':'read','requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a200_0x2a4097(0x132),'type':a200_0x2a4097(0x13f),'required':!![],'description':a200_0x2a4097(0x13b)}],async 'validate'(_0x33ef4f){const _0x4ad933=a200_0x2a4097;if(!_0x33ef4f[_0x4ad933(0x137)]('tenant-code')[_0x4ad933(0x140)]())throw CliErrors[_0x4ad933(0x133)]('tenant-code','Pass\x20--tenant-code\x20<code>.');},async 'execute'(_0x4f5952){const _0x1e4a6b=a200_0x2a4097,_0x56c86b=_0x4f5952[_0x1e4a6b(0x137)]('tenant-code')[_0x1e4a6b(0x140)](),_0x2d4766=await listCurrentUserTenantMemberships();assertTenantAccessible(_0x56c86b,_0x2d4766);const _0x22960d=projectTenantMembers(await listTenantDirectoryMembers(_0x56c86b));return{'ok':!![],'data':{'tenantCode':_0x56c86b,'items':_0x22960d,'totalCount':_0x22960d[_0x1e4a6b(0x144)]},'message':_0x1e4a6b(0x134)+_0x22960d[_0x1e4a6b(0x144)]+'\x20tenant\x20member(s)'};}};
1
+ const a200_0x521102=a200_0xfe41;function a200_0x1e06(){const _0x1f6107=['4234965RzONfm','47122WsXRdf','Exact\x20tenant\x20code','\x20tenant\x20member(s)','trim','flagMissing','21GKHJhB','Found\x20','members-list','5787387PZSnUs','232323bnyWGf','length','4623642vSpAtx','read','838060pGVDoq','259208BUGSiP','Pass\x20--tenant-code\x20<code>.','List\x20members\x20of\x20a\x20tenant\x20available\x20to\x20the\x20current\x20account','str','tenant-code','5yggUwV','string'];a200_0x1e06=function(){return _0x1f6107;};return a200_0x1e06();}(function(_0x155694,_0x3c792d){const _0x4f6ae1=a200_0xfe41,_0xada0d6=_0x155694();while(!![]){try{const _0x1e28f0=-parseInt(_0x4f6ae1(0x16a))/0x1+parseInt(_0x4f6ae1(0x177))/0x2*(parseInt(_0x4f6ae1(0x166))/0x3)+parseInt(_0x4f6ae1(0x16e))/0x4*(-parseInt(_0x4f6ae1(0x174))/0x5)+parseInt(_0x4f6ae1(0x16c))/0x6+parseInt(_0x4f6ae1(0x176))/0x7+-parseInt(_0x4f6ae1(0x16f))/0x8+-parseInt(_0x4f6ae1(0x169))/0x9;if(_0x1e28f0===_0x3c792d)break;else _0xada0d6['push'](_0xada0d6['shift']());}catch(_0x2e2e7c){_0xada0d6['push'](_0xada0d6['shift']());}}}(a200_0x1e06,0x6754f));import{listCurrentUserTenantMemberships,listTenantDirectoryMembers}from'../../core/api-client.js';function a200_0xfe41(_0x3afa8f,_0x156879){_0x3afa8f=_0x3afa8f-0x165;const _0x1e06ea=a200_0x1e06();let _0xfe417c=_0x1e06ea[_0x3afa8f];return _0xfe417c;}import{CliErrors}from'../../errors.js';import{assertTenantAccessible,projectTenantMembers}from'../../commands/tenant/shared.js';export const tenantMembersListDefinition={'service':'tenant','command':a200_0x521102(0x168),'description':a200_0x521102(0x171),'risk':a200_0x521102(0x16d),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a200_0x521102(0x173),'type':a200_0x521102(0x175),'required':!![],'description':a200_0x521102(0x178)}],async 'validate'(_0x1ddd78){const _0x231337=a200_0x521102;if(!_0x1ddd78['str'](_0x231337(0x173))[_0x231337(0x17a)]())throw CliErrors[_0x231337(0x165)](_0x231337(0x173),_0x231337(0x170));},async 'execute'(_0xfbe065){const _0x42d35d=a200_0x521102,_0x1471e5=_0xfbe065[_0x42d35d(0x172)](_0x42d35d(0x173))[_0x42d35d(0x17a)](),_0x29f342=await listCurrentUserTenantMemberships();assertTenantAccessible(_0x1471e5,_0x29f342);const _0x1aaee1=projectTenantMembers(await listTenantDirectoryMembers(_0x1471e5));return{'ok':!![],'data':{'tenantCode':_0x1471e5,'items':_0x1aaee1,'totalCount':_0x1aaee1[_0x42d35d(0x16b)]},'message':_0x42d35d(0x167)+_0x1aaee1[_0x42d35d(0x16b)]+_0x42d35d(0x179)};}};
@@ -1 +1 @@
1
- function a201_0x4c64(_0x199c8d,_0x171e71){_0x199c8d=_0x199c8d-0x1ae;const _0x37fdb4=a201_0x37fd();let _0x4c64e6=_0x37fdb4[_0x199c8d];return _0x4c64e6;}(function(_0x98bd,_0xb00745){const _0x38603e=a201_0x4c64,_0x4f1989=_0x98bd();while(!![]){try{const _0xea2b94=-parseInt(_0x38603e(0x1b4))/0x1+parseInt(_0x38603e(0x1bc))/0x2+parseInt(_0x38603e(0x1bb))/0x3*(parseInt(_0x38603e(0x1ba))/0x4)+parseInt(_0x38603e(0x1c4))/0x5*(-parseInt(_0x38603e(0x1b6))/0x6)+-parseInt(_0x38603e(0x1c5))/0x7*(-parseInt(_0x38603e(0x1b1))/0x8)+-parseInt(_0x38603e(0x1c3))/0x9+-parseInt(_0x38603e(0x1c6))/0xa*(-parseInt(_0x38603e(0x1ae))/0xb);if(_0xea2b94===_0xb00745)break;else _0x4f1989['push'](_0x4f1989['shift']());}catch(_0x183190){_0x4f1989['push'](_0x4f1989['shift']());}}}(a201_0x37fd,0x2eefb));function a201_0x37fd(){const _0x1e0cfd=['311824UWYSYJ','username','ADMIN','253013iogWao','Check\x20--tenant-code\x20or\x20login\x20with\x20an\x20account\x20that\x20belongs\x20to\x20this\x20tenant.','6eDBcHl','status','trim','some','712304qnUaxe','6RERIfx','455330ajPihM','isFinite','\x22\x20is\x20not\x20available\x20to\x20the\x20current\x20account.','displayName','set','adminFlag','userId','3035331uUEkru','1753375aMdetw','14YASCqw','8650mbTmpN','5995ZmQlKA','Tenant\x20\x22','sort'];a201_0x37fd=function(){return _0x1e0cfd;};return a201_0x37fd();}import{CliErrors}from'../../errors.js';function textOrNull(_0xf5c907){const _0x194bf4=a201_0x4c64,_0x2c677e=_0xf5c907?.[_0x194bf4(0x1b8)]();return _0x2c677e?_0x2c677e:null;}export function projectTenantMembers(_0x5715ea){const _0x12d60c=a201_0x4c64,_0x218b78=new Map();for(const _0x4f493b of _0x5715ea){const _0x2c2636=Number(_0x4f493b[_0x12d60c(0x1c2)]);if(!Number[_0x12d60c(0x1bd)](_0x2c2636)||_0x2c2636<=0x0)continue;const _0x42b135={'userId':_0x2c2636,'username':textOrNull(_0x4f493b[_0x12d60c(0x1b2)]),'displayName':textOrNull(_0x4f493b['nickname']),'role':_0x4f493b[_0x12d60c(0x1c1)]===!![]?_0x12d60c(0x1b3):'MEMBER','status':textOrNull(_0x4f493b[_0x12d60c(0x1b7)])},_0x3a830=_0x218b78['get'](_0x2c2636);if(!_0x3a830){_0x218b78[_0x12d60c(0x1c0)](_0x2c2636,_0x42b135);continue;}_0x3a830[_0x12d60c(0x1b2)]??=_0x42b135[_0x12d60c(0x1b2)],_0x3a830[_0x12d60c(0x1bf)]??=_0x42b135['displayName'],_0x3a830[_0x12d60c(0x1b7)]??=_0x42b135[_0x12d60c(0x1b7)];if(_0x42b135['role']===_0x12d60c(0x1b3))_0x3a830['role']=_0x12d60c(0x1b3);}return[..._0x218b78['values']()][_0x12d60c(0x1b0)]((_0x5752e4,_0x2b55a2)=>_0x5752e4[_0x12d60c(0x1c2)]-_0x2b55a2[_0x12d60c(0x1c2)]);}export function assertTenantAccessible(_0xb244d0,_0x5dfbce){const _0x367941=a201_0x4c64;if(_0x5dfbce[_0x367941(0x1b9)](_0x23e2fc=>_0x23e2fc['tenantCode']===_0xb244d0))return;throw CliErrors['validation'](_0x367941(0x1af)+_0xb244d0+_0x367941(0x1be),_0x367941(0x1b5));}
1
+ (function(_0x35b40d,_0x5e1112){const _0x34a90a=a201_0x3022,_0x13bf58=_0x35b40d();while(!![]){try{const _0x4ff12e=parseInt(_0x34a90a(0x7a))/0x1*(-parseInt(_0x34a90a(0x6c))/0x2)+parseInt(_0x34a90a(0x6e))/0x3*(parseInt(_0x34a90a(0x73))/0x4)+parseInt(_0x34a90a(0x7f))/0x5*(-parseInt(_0x34a90a(0x6f))/0x6)+-parseInt(_0x34a90a(0x75))/0x7+parseInt(_0x34a90a(0x77))/0x8+-parseInt(_0x34a90a(0x7e))/0x9*(-parseInt(_0x34a90a(0x80))/0xa)+parseInt(_0x34a90a(0x76))/0xb;if(_0x4ff12e===_0x5e1112)break;else _0x13bf58['push'](_0x13bf58['shift']());}catch(_0x29a15d){_0x13bf58['push'](_0x13bf58['shift']());}}}(a201_0x207a,0x7f907));function a201_0x3022(_0x50a205,_0x2c17ab){_0x50a205=_0x50a205-0x69;const _0x207adb=a201_0x207a();let _0x302274=_0x207adb[_0x50a205];return _0x302274;}import{CliErrors}from'../../errors.js';function a201_0x207a(){const _0x56026a=['nickname','53YwxXlA','Check\x20--tenant-code\x20or\x20login\x20with\x20an\x20account\x20that\x20belongs\x20to\x20this\x20tenant.','values','adminFlag','884673cnPAMT','5aIzwbe','60gjQmdN','role','trim','isFinite','status','userId','displayName','ADMIN','tenantCode','21106IgXael','validation','1893jZjvZl','3357918nukEKy','Tenant\x20\x22','\x22\x20is\x20not\x20available\x20to\x20the\x20current\x20account.','get','1732uvoOce','username','3403694gsGxGw','12959023zCxZqa','692872pcLmPf','MEMBER'];a201_0x207a=function(){return _0x56026a;};return a201_0x207a();}function textOrNull(_0x4a0a3b){const _0x4e1bf3=a201_0x3022,_0x4c0648=_0x4a0a3b?.[_0x4e1bf3(0x82)]();return _0x4c0648?_0x4c0648:null;}export function projectTenantMembers(_0x376983){const _0x47ca9c=a201_0x3022,_0x5b8ac2=new Map();for(const _0x20d5e1 of _0x376983){const _0xfb370b=Number(_0x20d5e1[_0x47ca9c(0x85)]);if(!Number[_0x47ca9c(0x83)](_0xfb370b)||_0xfb370b<=0x0)continue;const _0x2c7ac5={'userId':_0xfb370b,'username':textOrNull(_0x20d5e1[_0x47ca9c(0x74)]),'displayName':textOrNull(_0x20d5e1[_0x47ca9c(0x79)]),'role':_0x20d5e1[_0x47ca9c(0x7d)]===!![]?_0x47ca9c(0x6a):_0x47ca9c(0x78),'status':textOrNull(_0x20d5e1[_0x47ca9c(0x84)])},_0x68ac0c=_0x5b8ac2[_0x47ca9c(0x72)](_0xfb370b);if(!_0x68ac0c){_0x5b8ac2['set'](_0xfb370b,_0x2c7ac5);continue;}_0x68ac0c[_0x47ca9c(0x74)]??=_0x2c7ac5[_0x47ca9c(0x74)],_0x68ac0c[_0x47ca9c(0x69)]??=_0x2c7ac5[_0x47ca9c(0x69)],_0x68ac0c[_0x47ca9c(0x84)]??=_0x2c7ac5[_0x47ca9c(0x84)];if(_0x2c7ac5[_0x47ca9c(0x81)]===_0x47ca9c(0x6a))_0x68ac0c[_0x47ca9c(0x81)]=_0x47ca9c(0x6a);}return[..._0x5b8ac2[_0x47ca9c(0x7c)]()]['sort']((_0x3a19b5,_0x293343)=>_0x3a19b5[_0x47ca9c(0x85)]-_0x293343[_0x47ca9c(0x85)]);}export function assertTenantAccessible(_0x4f3b7e,_0x20f4a6){const _0x3ae8c9=a201_0x3022;if(_0x20f4a6['some'](_0x257fbe=>_0x257fbe[_0x3ae8c9(0x6b)]===_0x4f3b7e))return;throw CliErrors[_0x3ae8c9(0x6d)](_0x3ae8c9(0x70)+_0x4f3b7e+_0x3ae8c9(0x71),_0x3ae8c9(0x7b));}
@@ -1 +1 @@
1
- const a202_0xd2d60b=a202_0x417d;(function(_0x3f892b,_0x2b66cd){const _0x321c1f=a202_0x417d,_0xa216ac=_0x3f892b();while(!![]){try{const _0x55d38b=parseInt(_0x321c1f(0xe4))/0x1*(parseInt(_0x321c1f(0xf8))/0x2)+parseInt(_0x321c1f(0xe7))/0x3+parseInt(_0x321c1f(0xe9))/0x4*(-parseInt(_0x321c1f(0xe6))/0x5)+-parseInt(_0x321c1f(0xfc))/0x6*(parseInt(_0x321c1f(0xf5))/0x7)+-parseInt(_0x321c1f(0xf7))/0x8+parseInt(_0x321c1f(0xfa))/0x9*(parseInt(_0x321c1f(0xef))/0xa)+-parseInt(_0x321c1f(0xf2))/0xb;if(_0x55d38b===_0x2b66cd)break;else _0xa216ac['push'](_0xa216ac['shift']());}catch(_0x2f6965){_0xa216ac['push'](_0xa216ac['shift']());}}}(a202_0x36a8,0x88946));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 a202_0x417d(_0x241129,_0x55e309){_0x241129=_0x241129-0xe4;const _0x36a865=a202_0x36a8();let _0x417d3f=_0x36a865[_0x241129];return _0x417d3f;}const PROVIDER_ID=a202_0xd2d60b(0xf9),CURRENT_BINDING_WARNING=a202_0xd2d60b(0xf1);function readDingTalkUserId(_0x104730){const _0x5b8d73=a202_0xd2d60b,_0xda7316=_0x104730['str'](_0x5b8d73(0xe8))['trim']();if(!_0xda7316)throw CliErrors[_0x5b8d73(0xf6)](_0x5b8d73(0xee),_0x5b8d73(0xed));return _0xda7316;}function a202_0x36a8(){const _0x3c2a90=['43515XONEZN','bind','5111844dbEHqJ','217941thKfBd','write','88105GWjmGH','1729467vGghqJ','ding-talk-user-id','52ozuuMF','Bound\x20current\x20user\x20to\x20DingTalk\x20sandbox\x20account.','Retry\x20with\x20the\x20same\x20--ding-talk-user-id\x20only\x20after\x20checking\x20the\x20current\x20platform\x20session.','dingding-sandbox-bind','Pass\x20the\x20DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox.','--ding-talk-user-id\x20cannot\x20be\x20empty.','1130zXWmUo','user-account','The\x20current\x20binding\x20is\x20not\x20exposed\x20by\x20the\x20server;\x20before\x20is\x20unavailable.','4551272xvkSFm','string','Bind\x20the\x20current\x20platform\x20user\x20to\x20a\x20DingTalk\x20sandbox\x20account','7noaQaH','validation','1266560bPWECv','10bzVHUR','dingding-sandbox'];a202_0x36a8=function(){return _0x3c2a90;};return a202_0x36a8();}function buildBindingData(_0x10aa6f,_0x198131){const _0x2c9d44=a202_0xd2d60b;return{'operation':_0x2c9d44(0xfb),'selector':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x10aa6f},'before':null,'after':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x10aa6f,'bound':!![]},'dryRun':_0x198131,'backend':{'method':'POST','path':DING_TALK_SANDBOX_BIND_PATH},'warnings':[CURRENT_BINDING_WARNING]};}export const dingTalkSandboxBind={'service':a202_0xd2d60b(0xf0),'command':a202_0xd2d60b(0xec),'description':a202_0xd2d60b(0xf4),'risk':a202_0xd2d60b(0xe5),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a202_0xd2d60b(0xe8),'type':a202_0xd2d60b(0xf3),'required':!![],'description':'DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox'}],async 'validate'(_0x2780c7){readDingTalkUserId(_0x2780c7);},async 'dryRun'(_0x1e1f72){const _0xc92e41=readDingTalkUserId(_0x1e1f72);return asDryRunResult(buildBindingData(_0xc92e41,!![]),{'method':'POST','url':DING_TALK_SANDBOX_BIND_PATH});},async 'execute'(_0x113bc0){const _0x296113=a202_0xd2d60b,_0x19b7e6=readDingTalkUserId(_0x113bc0),_0x2f619e=await bindDingTalkSandboxAccount(_0x19b7e6);if(_0x2f619e!==!![])throw CliErrors['apiError']('DingTalk\x20sandbox\x20account\x20binding\x20was\x20not\x20confirmed.',_0x296113(0xeb));return{'ok':!![],'data':buildBindingData(_0x19b7e6,![]),'message':_0x296113(0xea)};}};
1
+ const a202_0x34079e=a202_0x3151;(function(_0x2fdfca,_0xf49c3c){const _0xf74639=a202_0x3151,_0x4d85f1=_0x2fdfca();while(!![]){try{const _0x51b559=-parseInt(_0xf74639(0xc8))/0x1*(parseInt(_0xf74639(0xd8))/0x2)+parseInt(_0xf74639(0xc6))/0x3*(-parseInt(_0xf74639(0xd1))/0x4)+parseInt(_0xf74639(0xcd))/0x5+parseInt(_0xf74639(0xc4))/0x6+-parseInt(_0xf74639(0xcf))/0x7+parseInt(_0xf74639(0xc3))/0x8+parseInt(_0xf74639(0xca))/0x9*(parseInt(_0xf74639(0xd5))/0xa);if(_0x51b559===_0xf49c3c)break;else _0x4d85f1['push'](_0x4d85f1['shift']());}catch(_0xc0d37f){_0x4d85f1['push'](_0x4d85f1['shift']());}}}(a202_0xb693,0xc1547));import{asDryRunResult}from'../../commands/common/dry-run.js';import{bindDingTalkSandboxAccount,DING_TALK_SANDBOX_BIND_PATH}from'../../core/api-client.js';function a202_0x3151(_0x2d6c1c,_0x1410f2){_0x2d6c1c=_0x2d6c1c-0xc3;const _0xb6938b=a202_0xb693();let _0x3151ea=_0xb6938b[_0x2d6c1c];return _0x3151ea;}import{CliErrors}from'../../errors.js';const PROVIDER_ID='dingding-sandbox',CURRENT_BINDING_WARNING=a202_0x34079e(0xc9);function readDingTalkUserId(_0x522ce6){const _0x5b0eb3=a202_0x34079e,_0x4a4ff2=_0x522ce6[_0x5b0eb3(0xce)](_0x5b0eb3(0xd0))[_0x5b0eb3(0xcb)]();if(!_0x4a4ff2)throw CliErrors[_0x5b0eb3(0xd4)]('--ding-talk-user-id\x20cannot\x20be\x20empty.','Pass\x20the\x20DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox.');return _0x4a4ff2;}function a202_0xb693(){const _0x4d1f7d=['The\x20current\x20binding\x20is\x20not\x20exposed\x20by\x20the\x20server;\x20before\x20is\x20unavailable.','45oLkHqc','trim','bind','3328125dBomYN','str','3633252YCASrW','ding-talk-user-id','8tCnjav','dingding-sandbox-bind','apiError','validation','1851260jyXTwL','Retry\x20with\x20the\x20same\x20--ding-talk-user-id\x20only\x20after\x20checking\x20the\x20current\x20platform\x20session.','Bind\x20the\x20current\x20platform\x20user\x20to\x20a\x20DingTalk\x20sandbox\x20account','2302610WrHVab','DingTalk\x20sandbox\x20account\x20binding\x20was\x20not\x20confirmed.','Bound\x20current\x20user\x20to\x20DingTalk\x20sandbox\x20account.','8920920oGKzcO','5753976gTAicA','user-account','1804719bqqKeH','string','1SkUClw'];a202_0xb693=function(){return _0x4d1f7d;};return a202_0xb693();}function buildBindingData(_0x380dcd,_0x1bbd51){const _0x40b497=a202_0x34079e;return{'operation':_0x40b497(0xcc),'selector':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x380dcd},'before':null,'after':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x380dcd,'bound':!![]},'dryRun':_0x1bbd51,'backend':{'method':'POST','path':DING_TALK_SANDBOX_BIND_PATH},'warnings':[CURRENT_BINDING_WARNING]};}export const dingTalkSandboxBind={'service':a202_0x34079e(0xc5),'command':a202_0x34079e(0xd2),'description':a202_0x34079e(0xd7),'risk':'write','requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a202_0x34079e(0xd0),'type':a202_0x34079e(0xc7),'required':!![],'description':'DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox'}],async 'validate'(_0xe78937){readDingTalkUserId(_0xe78937);},async 'dryRun'(_0x46c516){const _0x314c7f=readDingTalkUserId(_0x46c516);return asDryRunResult(buildBindingData(_0x314c7f,!![]),{'method':'POST','url':DING_TALK_SANDBOX_BIND_PATH});},async 'execute'(_0x1539e1){const _0x136de2=a202_0x34079e,_0x4ffb5c=readDingTalkUserId(_0x1539e1),_0x2395ea=await bindDingTalkSandboxAccount(_0x4ffb5c);if(_0x2395ea!==!![])throw CliErrors[_0x136de2(0xd3)](_0x136de2(0xd9),_0x136de2(0xd6));return{'ok':!![],'data':buildBindingData(_0x4ffb5c,![]),'message':_0x136de2(0xda)};}};
@@ -1 +1 @@
1
- (function(_0x1addc5,_0x2b691e){const _0x784e98=a203_0x37d5,_0xbd2bac=_0x1addc5();while(!![]){try{const _0x3b7059=-parseInt(_0x784e98(0xd6))/0x1*(-parseInt(_0x784e98(0xd7))/0x2)+parseInt(_0x784e98(0xdc))/0x3+parseInt(_0x784e98(0xda))/0x4+-parseInt(_0x784e98(0xd9))/0x5+-parseInt(_0x784e98(0xdb))/0x6*(parseInt(_0x784e98(0xde))/0x7)+parseInt(_0x784e98(0xd5))/0x8*(-parseInt(_0x784e98(0xd8))/0x9)+-parseInt(_0x784e98(0xdd))/0xa;if(_0x3b7059===_0x2b691e)break;else _0xbd2bac['push'](_0xbd2bac['shift']());}catch(_0x445030){_0xbd2bac['push'](_0xbd2bac['shift']());}}}(a203_0x5d61,0x25abe));function a203_0x5d61(){const _0x247c68=['40pMGmuv','14836lVmrmF','30NOdHHk','389979SkLFzV','405gMNGpg','685388nlLApk','89142YGmHvg','884037qONjSn','946730CMMmXK','105INdYqJ'];a203_0x5d61=function(){return _0x247c68;};return a203_0x5d61();}function a203_0x37d5(_0x38c97e,_0x3351c2){_0x38c97e=_0x38c97e-0xd5;const _0x5d6199=a203_0x5d61();let _0x37d563=_0x5d6199[_0x38c97e];return _0x37d563;}import{dingTalkSandboxBind}from'../../commands/user-account/dingding-sandbox-bind.js';export const userAccountDefinitions=[dingTalkSandboxBind];
1
+ (function(_0x5391de,_0x52fc0e){const _0x1dbdab=a203_0x4ede,_0x4dd87f=_0x5391de();while(!![]){try{const _0x1beb7a=parseInt(_0x1dbdab(0xe7))/0x1*(-parseInt(_0x1dbdab(0xe5))/0x2)+parseInt(_0x1dbdab(0xe4))/0x3+-parseInt(_0x1dbdab(0xe8))/0x4+-parseInt(_0x1dbdab(0xe6))/0x5+-parseInt(_0x1dbdab(0xeb))/0x6+parseInt(_0x1dbdab(0xea))/0x7*(-parseInt(_0x1dbdab(0xe9))/0x8)+parseInt(_0x1dbdab(0xe3))/0x9;if(_0x1beb7a===_0x52fc0e)break;else _0x4dd87f['push'](_0x4dd87f['shift']());}catch(_0x4cb93d){_0x4dd87f['push'](_0x4dd87f['shift']());}}}(a203_0x2bd3,0x85f0f));function a203_0x2bd3(){const _0x22cf99=['8ixVvNH','1282162poJftg','2003208mGYLiA','18209151JiCxTT','2081469cGIjbs','12674KvtUoB','801130etcTvM','170ivsQuS','1655556ZBbMJc'];a203_0x2bd3=function(){return _0x22cf99;};return a203_0x2bd3();}import{dingTalkSandboxBind}from'../../commands/user-account/dingding-sandbox-bind.js';function a203_0x4ede(_0x4f9c72,_0xa1cf4){_0x4f9c72=_0x4f9c72-0xe3;const _0x2bd3fe=a203_0x2bd3();let _0x4ede55=_0x2bd3fe[_0x4f9c72];return _0x4ede55;}export const userAccountDefinitions=[dingTalkSandboxBind];
@@ -1 +1 @@
1
- const a204_0x18e530=a204_0x2dc1;function a204_0x2dc1(_0x56c9a7,_0x56b3de){_0x56c9a7=_0x56c9a7-0x103;const _0xbed823=a204_0xbed8();let _0x2dc124=_0xbed823[_0x56c9a7];return _0x2dc124;}(function(_0x22de2f,_0x76d3f0){const _0x501a76=a204_0x2dc1,_0x360a9a=_0x22de2f();while(!![]){try{const _0x462f0f=-parseInt(_0x501a76(0x112))/0x1+-parseInt(_0x501a76(0x106))/0x2*(-parseInt(_0x501a76(0x10d))/0x3)+parseInt(_0x501a76(0x107))/0x4+parseInt(_0x501a76(0x10a))/0x5*(-parseInt(_0x501a76(0x111))/0x6)+parseInt(_0x501a76(0x10c))/0x7*(parseInt(_0x501a76(0x105))/0x8)+-parseInt(_0x501a76(0x10f))/0x9+-parseInt(_0x501a76(0x110))/0xa*(-parseInt(_0x501a76(0x10e))/0xb);if(_0x462f0f===_0x76d3f0)break;else _0x360a9a['push'](_0x360a9a['shift']());}catch(_0x522224){_0x360a9a['push'](_0x360a9a['shift']());}}}(a204_0xbed8,0x6509e));import{buildAppAddFlags,runAppAdd,validateAppName}from'../../commands/common/app-registry.js';function a204_0xbed8(){const _0x465d4e=['477462ZuBGWa','Register\x20an\x20app\x20profile\x20in\x20the\x20current\x20workspace\x20(or\x20--global)','name','2392400qVvwRV','2928ebWvIs','333380SiRqhj','workspace','App\x20profile\x20name','33260EsWWdK','workspace\x20add','7cCmUvj','207rMArFm','602525ApZwmt','166950fwFcxv','90UFULWe','60MTnJyL'];a204_0xbed8=function(){return _0x465d4e;};return a204_0xbed8();}export const workspaceAddDefinition={'service':a204_0x18e530(0x108),'command':'add','description':a204_0x18e530(0x103),'risk':'write','requiresAuth':![],'requiresAppCode':![],'args':[{'name':a204_0x18e530(0x104),'description':a204_0x18e530(0x109),'required':!![]}],'flags':buildAppAddFlags(),'validate':_0x23c444=>validateAppName(_0x23c444,a204_0x18e530(0x10b)),'execute':_0xac2f76=>runAppAdd(_0xac2f76,a204_0x18e530(0x10b))};
1
+ const a204_0x3f6e53=a204_0x279f;(function(_0x147ed2,_0x5aaf3a){const _0x1da658=a204_0x279f,_0x21a59b=_0x147ed2();while(!![]){try{const _0x2f255f=-parseInt(_0x1da658(0x11e))/0x1*(parseInt(_0x1da658(0x114))/0x2)+-parseInt(_0x1da658(0x118))/0x3*(-parseInt(_0x1da658(0x11c))/0x4)+-parseInt(_0x1da658(0x120))/0x5*(-parseInt(_0x1da658(0x111))/0x6)+parseInt(_0x1da658(0x11d))/0x7*(-parseInt(_0x1da658(0x119))/0x8)+-parseInt(_0x1da658(0x121))/0x9*(parseInt(_0x1da658(0x11a))/0xa)+-parseInt(_0x1da658(0x11b))/0xb*(-parseInt(_0x1da658(0x116))/0xc)+parseInt(_0x1da658(0x11f))/0xd;if(_0x2f255f===_0x5aaf3a)break;else _0x21a59b['push'](_0x21a59b['shift']());}catch(_0x325024){_0x21a59b['push'](_0x21a59b['shift']());}}}(a204_0x57b7,0x7d4ce));function a204_0x57b7(){const _0x3adedd=['24KEvKhY','name','workspace','2lQtcXP','workspace\x20add','37416bvwVQx','add','201lFsUGO','16vGnbxl','60UglsfO','737TgAyVe','31888YERjGL','1923159LundsA','440890AtkvXF','12911470CWbFYE','336420KUysfW','752643ZYDydH','Register\x20an\x20app\x20profile\x20in\x20the\x20current\x20workspace\x20(or\x20--global)','App\x20profile\x20name'];a204_0x57b7=function(){return _0x3adedd;};return a204_0x57b7();}import{buildAppAddFlags,runAppAdd,validateAppName}from'../../commands/common/app-registry.js';function a204_0x279f(_0x13fc4f,_0x3e672a){_0x13fc4f=_0x13fc4f-0x10f;const _0x57b738=a204_0x57b7();let _0x279f2e=_0x57b738[_0x13fc4f];return _0x279f2e;}export const workspaceAddDefinition={'service':a204_0x3f6e53(0x113),'command':a204_0x3f6e53(0x117),'description':a204_0x3f6e53(0x10f),'risk':'write','requiresAuth':![],'requiresAppCode':![],'args':[{'name':a204_0x3f6e53(0x112),'description':a204_0x3f6e53(0x110),'required':!![]}],'flags':buildAppAddFlags(),'validate':_0xda17f=>validateAppName(_0xda17f,a204_0x3f6e53(0x115)),'execute':_0x1a9b5e=>runAppAdd(_0x1a9b5e,'workspace\x20add')};
@@ -1 +1 @@
1
- const a205_0x1bab41=a205_0x4f6b;(function(_0x4efe61,_0x55ba46){const _0x5cff9e=a205_0x4f6b,_0x2d5571=_0x4efe61();while(!![]){try{const _0xf6cce4=-parseInt(_0x5cff9e(0xa3))/0x1*(-parseInt(_0x5cff9e(0xa9))/0x2)+-parseInt(_0x5cff9e(0xa6))/0x3*(-parseInt(_0x5cff9e(0xc5))/0x4)+-parseInt(_0x5cff9e(0xcb))/0x5+parseInt(_0x5cff9e(0xb3))/0x6*(parseInt(_0x5cff9e(0xa7))/0x7)+parseInt(_0x5cff9e(0xb0))/0x8+parseInt(_0x5cff9e(0xc8))/0x9+-parseInt(_0x5cff9e(0xab))/0xa*(parseInt(_0x5cff9e(0xbd))/0xb);if(_0xf6cce4===_0x55ba46)break;else _0x2d5571['push'](_0x2d5571['shift']());}catch(_0xd6efaa){_0x2d5571['push'](_0x2d5571['shift']());}}}(a205_0x22a1,0x1c4e7));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';function a205_0x4f6b(_0x4460a8,_0x3abc2c){_0x4460a8=_0x4460a8-0x97;const _0x22a1fe=a205_0x22a1();let _0x4f6b02=_0x22a1fe[_0x4460a8];return _0x4f6b02;}import{workspaceRemoveDefinition}from'../../commands/workspace/remove.js';const WORKSPACE_USAGE=CLI_BIN_NAME+a205_0x1bab41(0xa2),SAFE_PROFILE_KEYS=[a205_0x1bab41(0xc4),'env',a205_0x1bab41(0xa8),'format',a205_0x1bab41(0xd5),a205_0x1bab41(0xc3),a205_0x1bab41(0xae)],workspaceFlags=[{'name':a205_0x1bab41(0xb6),'type':a205_0x1bab41(0xc9),'description':a205_0x1bab41(0xd1)},{'name':'appcode','type':a205_0x1bab41(0xc9),'description':a205_0x1bab41(0x99)},{'name':a205_0x1bab41(0xc0),'type':a205_0x1bab41(0xc9),'description':a205_0x1bab41(0xaf),'enum':[...RABETBASE_ENV_VALUES]},{'name':a205_0x1bab41(0xa8),'type':'string','description':a205_0x1bab41(0xb1)},{'name':a205_0x1bab41(0xc2),'type':a205_0x1bab41(0xc9),'description':a205_0x1bab41(0xac),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':a205_0x1bab41(0xd5),'type':a205_0x1bab41(0xcf),'description':a205_0x1bab41(0xba)},{'name':'riskLevel','type':'string','description':a205_0x1bab41(0xd0),'enum':[...RISK_LEVEL_VALUES]},{'name':a205_0x1bab41(0xae),'type':'string','description':a205_0x1bab41(0xc6)}];function isRecord(_0x45ab73){const _0x4eca41=a205_0x1bab41;return!!_0x45ab73&&typeof _0x45ab73===_0x4eca41(0xb7)&&!Array['isArray'](_0x45ab73);}function assertValidAppcode(_0x20be77){const _0x103a94=a205_0x1bab41,{valid:_0x150681,message:_0x230166}=validateAppcode(_0x20be77);if(!_0x150681)throw CliErrors[_0x103a94(0xcc)](_0x103a94(0xb5)+_0x20be77,_0x230166);}function sanitizeProfile(_0x1d85df){if(!isRecord(_0x1d85df))return{};const _0x4e392c={};for(const _0x2ba029 of SAFE_PROFILE_KEYS){if(_0x1d85df[_0x2ba029]!==undefined)_0x4e392c[_0x2ba029]=_0x1d85df[_0x2ba029];}return _0x4e392c;}function cloneProfile(_0x4ff30f){return isRecord(_0x4ff30f)?{..._0x4ff30f}:{};}function collectWorkspaceProfileOverrides(_0x4e5a87){const _0x15179d=a205_0x1bab41,_0x26b4cc={},_0x631e0=_0x4e5a87[_0x15179d(0xbf)](_0x15179d(0xc0)),_0xe5db82=_0x4e5a87[_0x15179d(0xbf)](_0x15179d(0xa8)),_0xca9c43=_0x4e5a87['str'](_0x15179d(0xc2)),_0xaf3457=_0x4e5a87[_0x15179d(0xa0)](_0x15179d(0xd5)),_0x22ab4f=_0x4e5a87[_0x15179d(0xbf)](_0x15179d(0xc3)),_0x5694cb=_0x4e5a87[_0x15179d(0xbf)](_0x15179d(0xae));if(_0x631e0)_0x26b4cc['env']=_0x631e0;if(_0xe5db82)_0x26b4cc[_0x15179d(0xa8)]=_0xe5db82;if(_0xca9c43)_0x26b4cc[_0x15179d(0xb8)]=_0xca9c43;if(_0xaf3457!==undefined&&_0xaf3457!=='')_0x26b4cc['pageSize']=Number(_0xaf3457);if(_0x22ab4f)_0x26b4cc[_0x15179d(0xc3)]=_0x22ab4f;if(_0x5694cb)_0x26b4cc[_0x15179d(0xae)]=_0x5694cb;return _0x26b4cc;}async function validateWorkspaceArgs(_0x121917){const _0x25e8be=a205_0x1bab41,_0x48db93=_0x121917['str']('app')['trim'](),_0x2e78c6=_0x121917[_0x25e8be(0xbf)](_0x25e8be(0xc4))[_0x25e8be(0xa5)]();if(!_0x48db93&&!_0x2e78c6)throw CliErrors['validation'](_0x25e8be(0xca),_0x25e8be(0xc1)+CLI_BIN_NAME+'\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`'+CLI_BIN_NAME+_0x25e8be(0xbc));if(_0x2e78c6)assertValidAppcode(_0x2e78c6);}function resolveKnownApps(){const _0x15f297=a205_0x1bab41,{config:_0x485daf,layers:_0x486b33}=readRawConfigWithLayers(),_0x4ebf13=isRecord(_0x485daf[_0x15f297(0xaa)])?_0x485daf[_0x15f297(0xaa)]:{},_0x2d1696=isRecord(_0x486b33[_0x15f297(0x9b)]['apps'])?_0x486b33[_0x15f297(0x9b)][_0x15f297(0xaa)]:{};return{..._0x2d1696,..._0x4ebf13};}function a205_0x22a1(){const _0x276b17=['App\x20\x22','globalConfig','length','workspace.','defaultApp','\x20(appcode:\x20','flag','\x22\x20not\x20found.','\x20workspace\x20<init|use>\x20--app\x20<name>\x20[--appcode\x20<code>]','3qLqhkL','initialized','trim','367851KIdXSE','84qyUrPp','apiDir','52626IGOTtz','apps','1690ZhmVLu','Default\x20output\x20format\x20for\x20this\x20workspace\x20app\x20profile','join','locale','Target\x20environment','686744ZlFXUt','API\x20directory\x20path\x20for\x20this\x20workspace\x20app\x20profile',').\x20Config:\x20','1866nVQgRX','write','Invalid\x20appcode:\x20','app','object','format','use','Default\x20page\x20size\x20for\x20this\x20workspace\x20app\x20profile','Workspace\x20','\x20workspace\x20use\x20--app\x20<name>`.','14861LMoRQG','\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`','str','env','Use\x20`','defaultFormat','riskLevel','appcode','4CryXDi','Locale\x20for\x20this\x20workspace\x20app\x20profile','Initialize\x20the\x20current\x20workspace\x20app\x20binding','1780776xLYGAo','string','Missing\x20workspace\x20app\x20selector.','723665qyWPQU','validation','project','Switch\x20the\x20current\x20workspace\x20app\x20binding','number','Risk\x20level\x20for\x20this\x20workspace\x20app\x20profile','App\x20profile\x20name\x20to\x20use\x20in\x20this\x20workspace','\x20workspace\x20','Pass\x20--appcode\x20<code>,\x20or\x20choose\x20one\x20of:\x20','.\x20Credentials:\x20not\x20written.','pageSize','workspace','init','App\x20code\x20to\x20bind\x20to\x20this\x20workspace'];a205_0x22a1=function(){return _0x276b17;};return a205_0x22a1();}async function configureWorkspace(_0x144657,_0x386037){const _0x8c72bb=a205_0x1bab41,_0x3e2bc3=_0x144657[_0x8c72bb(0xbf)](_0x8c72bb(0xb6))['trim'](),_0x28da5c=_0x144657['str']('appcode')[_0x8c72bb(0xa5)](),_0x2e0c0b=_0x3e2bc3||_0x28da5c;if(!_0x2e0c0b)throw CliErrors[_0x8c72bb(0xcc)](_0x8c72bb(0xca),'Use\x20`'+CLI_BIN_NAME+_0x8c72bb(0xbe)+CLI_BIN_NAME+_0x8c72bb(0xbc));if(_0x28da5c)assertValidAppcode(_0x28da5c);const _0x597cea=resolveWriteConfigPath(_0x8c72bb(0xcd)),_0xf40023=readConfigFile(_0x597cea),_0x5946e2=resolveKnownApps(),_0x1109d8=isRecord(_0xf40023['apps'])?{..._0xf40023[_0x8c72bb(0xaa)]}:{},_0x3fcf74=cloneProfile(_0x1109d8[_0x2e0c0b]),_0x56c0a2=sanitizeProfile(_0x5946e2[_0x2e0c0b]),_0x174d52=_0x28da5c?{}:_0x56c0a2,_0x555f0d=_0x28da5c||_0x174d52[_0x8c72bb(0xc4)];if(!_0x555f0d){const _0x528cca=Object['keys'](_0x5946e2),_0x4c9ffa=_0x528cca[_0x8c72bb(0x9c)]===0x0?'Use\x20`'+CLI_BIN_NAME+_0x8c72bb(0xd2)+_0x386037+'\x20--app\x20'+_0x2e0c0b+'\x20--appcode\x20<code>`.':_0x8c72bb(0xd3)+_0x528cca[_0x8c72bb(0xad)](',\x20');throw CliErrors[_0x8c72bb(0xcc)](_0x8c72bb(0x9a)+_0x2e0c0b+_0x8c72bb(0xa1),_0x4c9ffa);}assertValidAppcode(String(_0x555f0d));const _0x5b7e9c={..._0x174d52,..._0x3fcf74,'appcode':String(_0x555f0d),...collectWorkspaceProfileOverrides(_0x144657)};return _0x1109d8[_0x2e0c0b]=_0x5b7e9c,_0xf40023[_0x8c72bb(0xaa)]=_0x1109d8,_0xf40023[_0x8c72bb(0x9e)]=_0x2e0c0b,delete _0xf40023['appcode'],delete _0xf40023[_0x8c72bb(0xb6)],_0x5b7e9c[_0x8c72bb(0xc0)]&&(_0xf40023['env']=_0x5b7e9c['env']),writeConfigFile(_0x597cea,_0xf40023),{'ok':!![],'message':_0x8c72bb(0xbb)+(_0x386037===_0x8c72bb(0x98)?_0x8c72bb(0xa4):'updated')+':\x20'+_0x2e0c0b+_0x8c72bb(0x9f)+_0x5b7e9c[_0x8c72bb(0xc4)]+_0x8c72bb(0xb2)+_0x597cea+_0x8c72bb(0xd4),'data':{'operation':_0x8c72bb(0x9d)+_0x386037,'configPath':_0x597cea,'app':_0x2e0c0b,'appcode':_0x5b7e9c[_0x8c72bb(0xc4)],'env':_0x5b7e9c[_0x8c72bb(0xc0)]??null,'credentialsWritten':![]}};}const workspaceInitDefinition={'service':a205_0x1bab41(0x97),'command':a205_0x1bab41(0x98),'description':a205_0x1bab41(0xc7),'risk':a205_0x1bab41(0xb4),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0xb11bbe=>configureWorkspace(_0xb11bbe,'init')},workspaceUseDefinition={'service':a205_0x1bab41(0x97),'command':'use','description':a205_0x1bab41(0xce),'risk':a205_0x1bab41(0xb4),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x1e0c6e=>configureWorkspace(_0x1e0c6e,a205_0x1bab41(0xb9))};export const workspaceDefinitions=[workspaceInitDefinition,workspaceUseDefinition,workspaceAddDefinition,workspaceRemoveDefinition];export{WORKSPACE_USAGE};
1
+ function a205_0x4f67(_0x4a49ff,_0x9c9264){_0x4a49ff=_0x4a49ff-0x125;const _0x576cf9=a205_0x576c();let _0x4f678c=_0x576cf9[_0x4a49ff];return _0x4f678c;}const a205_0x25ce2e=a205_0x4f67;(function(_0x1a593c,_0x3f007e){const _0x36d0a7=a205_0x4f67,_0x40a93a=_0x1a593c();while(!![]){try{const _0x4f88ed=parseInt(_0x36d0a7(0x13f))/0x1+-parseInt(_0x36d0a7(0x134))/0x2*(-parseInt(_0x36d0a7(0x153))/0x3)+-parseInt(_0x36d0a7(0x152))/0x4*(-parseInt(_0x36d0a7(0x150))/0x5)+parseInt(_0x36d0a7(0x132))/0x6*(parseInt(_0x36d0a7(0x13c))/0x7)+parseInt(_0x36d0a7(0x129))/0x8+-parseInt(_0x36d0a7(0x154))/0x9*(parseInt(_0x36d0a7(0x15a))/0xa)+-parseInt(_0x36d0a7(0x146))/0xb*(parseInt(_0x36d0a7(0x138))/0xc);if(_0x4f88ed===_0x3f007e)break;else _0x40a93a['push'](_0x40a93a['shift']());}catch(_0x1be6d8){_0x40a93a['push'](_0x40a93a['shift']());}}}(a205_0x576c,0x7c996));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{RABETBASE_ENV_VALUES}from'../../constant/env.js';import{RABETBASE_OUTPUT_FORMAT_VALUES}from'../../constant/output.js';import{RISK_LEVEL_VALUES}from'../../constant/risk.js';import{validateAppcode}from'../../commands/common/validate.js';import{readConfigFile,readRawConfigWithLayers,resolveWriteConfigPath,writeConfigFile}from'../../context.js';import{workspaceAddDefinition}from'../../commands/workspace/add.js';import{workspaceRemoveDefinition}from'../../commands/workspace/remove.js';const WORKSPACE_USAGE=CLI_BIN_NAME+a205_0x25ce2e(0x141),SAFE_PROFILE_KEYS=['appcode','env',a205_0x25ce2e(0x12b),a205_0x25ce2e(0x12e),a205_0x25ce2e(0x156),a205_0x25ce2e(0x14b),a205_0x25ce2e(0x133)],workspaceFlags=[{'name':a205_0x25ce2e(0x137),'type':a205_0x25ce2e(0x126),'description':a205_0x25ce2e(0x15c)},{'name':a205_0x25ce2e(0x144),'type':a205_0x25ce2e(0x126),'description':'App\x20code\x20to\x20bind\x20to\x20this\x20workspace'},{'name':'env','type':a205_0x25ce2e(0x126),'description':'Target\x20environment','enum':[...RABETBASE_ENV_VALUES]},{'name':a205_0x25ce2e(0x12b),'type':a205_0x25ce2e(0x126),'description':a205_0x25ce2e(0x14c)},{'name':a205_0x25ce2e(0x139),'type':a205_0x25ce2e(0x126),'description':a205_0x25ce2e(0x14d),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':a205_0x25ce2e(0x156),'type':'number','description':'Default\x20page\x20size\x20for\x20this\x20workspace\x20app\x20profile'},{'name':'riskLevel','type':a205_0x25ce2e(0x126),'description':'Risk\x20level\x20for\x20this\x20workspace\x20app\x20profile','enum':[...RISK_LEVEL_VALUES]},{'name':a205_0x25ce2e(0x133),'type':'string','description':'Locale\x20for\x20this\x20workspace\x20app\x20profile'}];function isRecord(_0x262648){const _0x5a5824=a205_0x25ce2e;return!!_0x262648&&typeof _0x262648===_0x5a5824(0x128)&&!Array['isArray'](_0x262648);}function assertValidAppcode(_0x1d9b00){const _0x48b64c=a205_0x25ce2e,{valid:_0x1f2b51,message:_0x9c4324}=validateAppcode(_0x1d9b00);if(!_0x1f2b51)throw CliErrors[_0x48b64c(0x127)](_0x48b64c(0x159)+_0x1d9b00,_0x9c4324);}function sanitizeProfile(_0x537fe2){if(!isRecord(_0x537fe2))return{};const _0x3bd11b={};for(const _0x2400c8 of SAFE_PROFILE_KEYS){if(_0x537fe2[_0x2400c8]!==undefined)_0x3bd11b[_0x2400c8]=_0x537fe2[_0x2400c8];}return _0x3bd11b;}function cloneProfile(_0x364e30){return isRecord(_0x364e30)?{..._0x364e30}:{};}function collectWorkspaceProfileOverrides(_0x4316aa){const _0x589176=a205_0x25ce2e,_0x302094={},_0xe2aa99=_0x4316aa[_0x589176(0x13b)](_0x589176(0x149)),_0x3c30fa=_0x4316aa['str']('apiDir'),_0x1d625f=_0x4316aa[_0x589176(0x13b)]('defaultFormat'),_0x43464e=_0x4316aa['flag'](_0x589176(0x156)),_0x1f3b2f=_0x4316aa[_0x589176(0x13b)](_0x589176(0x14b)),_0x16f179=_0x4316aa['str'](_0x589176(0x133));if(_0xe2aa99)_0x302094[_0x589176(0x149)]=_0xe2aa99;if(_0x3c30fa)_0x302094[_0x589176(0x12b)]=_0x3c30fa;if(_0x1d625f)_0x302094[_0x589176(0x12e)]=_0x1d625f;if(_0x43464e!==undefined&&_0x43464e!=='')_0x302094[_0x589176(0x156)]=Number(_0x43464e);if(_0x1f3b2f)_0x302094[_0x589176(0x14b)]=_0x1f3b2f;if(_0x16f179)_0x302094['locale']=_0x16f179;return _0x302094;}async function validateWorkspaceArgs(_0x3d3b6a){const _0x1a3943=a205_0x25ce2e,_0x5dd37b=_0x3d3b6a['str'](_0x1a3943(0x137))['trim'](),_0xd6d423=_0x3d3b6a[_0x1a3943(0x13b)](_0x1a3943(0x144))[_0x1a3943(0x15d)]();if(!_0x5dd37b&&!_0xd6d423)throw CliErrors[_0x1a3943(0x127)](_0x1a3943(0x14f),_0x1a3943(0x148)+CLI_BIN_NAME+'\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`'+CLI_BIN_NAME+_0x1a3943(0x13a));if(_0xd6d423)assertValidAppcode(_0xd6d423);}function resolveKnownApps(){const _0x232119=a205_0x25ce2e,{config:_0x42d696,layers:_0x51b4b3}=readRawConfigWithLayers(),_0xebfb26=isRecord(_0x42d696[_0x232119(0x155)])?_0x42d696[_0x232119(0x155)]:{},_0x4d9583=isRecord(_0x51b4b3[_0x232119(0x158)][_0x232119(0x155)])?_0x51b4b3[_0x232119(0x158)][_0x232119(0x155)]:{};return{..._0x4d9583,..._0xebfb26};}async function configureWorkspace(_0x396f32,_0x3885ce){const _0x5d86e3=a205_0x25ce2e,_0x4c3158=_0x396f32['str']('app')[_0x5d86e3(0x15d)](),_0x6cc5fd=_0x396f32['str'](_0x5d86e3(0x144))[_0x5d86e3(0x15d)](),_0x763945=_0x4c3158||_0x6cc5fd;if(!_0x763945)throw CliErrors['validation'](_0x5d86e3(0x14f),'Use\x20`'+CLI_BIN_NAME+_0x5d86e3(0x140)+CLI_BIN_NAME+_0x5d86e3(0x13a));if(_0x6cc5fd)assertValidAppcode(_0x6cc5fd);const _0x120c57=resolveWriteConfigPath('project'),_0x53027d=readConfigFile(_0x120c57),_0x4a4a8a=resolveKnownApps(),_0x489bd4=isRecord(_0x53027d['apps'])?{..._0x53027d[_0x5d86e3(0x155)]}:{},_0x44317c=cloneProfile(_0x489bd4[_0x763945]),_0x24ceeb=sanitizeProfile(_0x4a4a8a[_0x763945]),_0xc1df1b=_0x6cc5fd?{}:_0x24ceeb,_0x497086=_0x6cc5fd||_0xc1df1b['appcode'];if(!_0x497086){const _0x12d27e=Object[_0x5d86e3(0x143)](_0x4a4a8a),_0x2e5a67=_0x12d27e[_0x5d86e3(0x15e)]===0x0?_0x5d86e3(0x148)+CLI_BIN_NAME+_0x5d86e3(0x13d)+_0x3885ce+_0x5d86e3(0x157)+_0x763945+'\x20--appcode\x20<code>`.':_0x5d86e3(0x14e)+_0x12d27e[_0x5d86e3(0x147)](',\x20');throw CliErrors[_0x5d86e3(0x127)](_0x5d86e3(0x14a)+_0x763945+_0x5d86e3(0x131),_0x2e5a67);}assertValidAppcode(String(_0x497086));const _0x183c10={..._0xc1df1b,..._0x44317c,'appcode':String(_0x497086),...collectWorkspaceProfileOverrides(_0x396f32)};return _0x489bd4[_0x763945]=_0x183c10,_0x53027d[_0x5d86e3(0x155)]=_0x489bd4,_0x53027d[_0x5d86e3(0x130)]=_0x763945,delete _0x53027d['appcode'],delete _0x53027d['app'],_0x183c10[_0x5d86e3(0x149)]&&(_0x53027d[_0x5d86e3(0x149)]=_0x183c10[_0x5d86e3(0x149)]),writeConfigFile(_0x120c57,_0x53027d),{'ok':!![],'message':_0x5d86e3(0x145)+(_0x3885ce===_0x5d86e3(0x135)?_0x5d86e3(0x12a):_0x5d86e3(0x12c))+':\x20'+_0x763945+_0x5d86e3(0x12d)+_0x183c10[_0x5d86e3(0x144)]+_0x5d86e3(0x125)+_0x120c57+_0x5d86e3(0x15b),'data':{'operation':_0x5d86e3(0x142)+_0x3885ce,'configPath':_0x120c57,'app':_0x763945,'appcode':_0x183c10[_0x5d86e3(0x144)],'env':_0x183c10[_0x5d86e3(0x149)]??null,'credentialsWritten':![]}};}const workspaceInitDefinition={'service':a205_0x25ce2e(0x13e),'command':a205_0x25ce2e(0x135),'description':a205_0x25ce2e(0x151),'risk':a205_0x25ce2e(0x12f),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x135773=>configureWorkspace(_0x135773,a205_0x25ce2e(0x135))},workspaceUseDefinition={'service':a205_0x25ce2e(0x13e),'command':'use','description':a205_0x25ce2e(0x136),'risk':a205_0x25ce2e(0x12f),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x129ad1=>configureWorkspace(_0x129ad1,'use')};export const workspaceDefinitions=[workspaceInitDefinition,workspaceUseDefinition,workspaceAddDefinition,workspaceRemoveDefinition];export{WORKSPACE_USAGE};function a205_0x576c(){const _0x510e7a=['386727zLGWXR','join','Use\x20`','env','App\x20\x22','riskLevel','API\x20directory\x20path\x20for\x20this\x20workspace\x20app\x20profile','Default\x20output\x20format\x20for\x20this\x20workspace\x20app\x20profile','Pass\x20--appcode\x20<code>,\x20or\x20choose\x20one\x20of:\x20','Missing\x20workspace\x20app\x20selector.','517755oGGKju','Initialize\x20the\x20current\x20workspace\x20app\x20binding','16DVZIsV','3drgBmH','7643763uiXEmj','apps','pageSize','\x20--app\x20','globalConfig','Invalid\x20appcode:\x20','10FiGOeC','.\x20Credentials:\x20not\x20written.','App\x20profile\x20name\x20to\x20use\x20in\x20this\x20workspace','trim','length',').\x20Config:\x20','string','validation','object','3089160kApaLS','initialized','apiDir','updated','\x20(appcode:\x20','format','write','defaultApp','\x22\x20not\x20found.','624sbTHtW','locale','519182YhYcuq','init','Switch\x20the\x20current\x20workspace\x20app\x20binding','app','84segWBy','defaultFormat','\x20workspace\x20use\x20--app\x20<name>`.','str','6986ytZZbA','\x20workspace\x20','workspace','442032cVfvlj','\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`','\x20workspace\x20<init|use>\x20--app\x20<name>\x20[--appcode\x20<code>]','workspace.','keys','appcode','Workspace\x20'];a205_0x576c=function(){return _0x510e7a;};return a205_0x576c();}
@@ -1 +1 @@
1
- const a206_0x14c215=a206_0x4f70;(function(_0x356074,_0x359db9){const _0xaf48ca=a206_0x4f70,_0x58ddcd=_0x356074();while(!![]){try{const _0x587290=-parseInt(_0xaf48ca(0x10d))/0x1*(parseInt(_0xaf48ca(0x110))/0x2)+parseInt(_0xaf48ca(0x113))/0x3+-parseInt(_0xaf48ca(0x10b))/0x4+parseInt(_0xaf48ca(0x116))/0x5+parseInt(_0xaf48ca(0x10a))/0x6*(parseInt(_0xaf48ca(0x111))/0x7)+-parseInt(_0xaf48ca(0x109))/0x8+-parseInt(_0xaf48ca(0x115))/0x9;if(_0x587290===_0x359db9)break;else _0x58ddcd['push'](_0x58ddcd['shift']());}catch(_0x23d74e){_0x58ddcd['push'](_0x58ddcd['shift']());}}}(a206_0x2eaf,0xc16c7));import{buildAppRemoveFlags,runAppRemove,validateAppName}from'../../commands/common/app-registry.js';function a206_0x4f70(_0x3025cb,_0x455828){_0x3025cb=_0x3025cb-0x109;const _0x2eaf22=a206_0x2eaf();let _0x4f70f3=_0x2eaf22[_0x3025cb];return _0x4f70f3;}function a206_0x2eaf(){const _0x2abdf8=['remove','25115gJmGIr','Remove\x20an\x20app\x20profile\x20from\x20the\x20current\x20workspace\x20(or\x20--global)','App\x20profile\x20name\x20to\x20remove','22ZKyJcO','7qxYrDJ','name','3232782nGGZMj','workspace','2522079JsiSow','1939980krDNWQ','5328416FuYCgI','3512304yJbqKG','144652dnZLgI'];a206_0x2eaf=function(){return _0x2abdf8;};return a206_0x2eaf();}export const workspaceRemoveDefinition={'service':a206_0x14c215(0x114),'command':a206_0x14c215(0x10c),'description':a206_0x14c215(0x10e),'risk':'write','requiresAuth':![],'requiresAppCode':![],'args':[{'name':a206_0x14c215(0x112),'description':a206_0x14c215(0x10f),'required':!![]}],'flags':buildAppRemoveFlags(),'validate':_0x386fb2=>validateAppName(_0x386fb2,'workspace\x20remove'),'execute':_0x4f5639=>runAppRemove(_0x4f5639,'workspace\x20remove')};
1
+ const a206_0x35b373=a206_0x2396;function a206_0x2396(_0x128837,_0x390033){_0x128837=_0x128837-0x14a;const _0x3291bb=a206_0x3291();let _0x2396a5=_0x3291bb[_0x128837];return _0x2396a5;}(function(_0x341992,_0x53344a){const _0x27de4f=a206_0x2396,_0xa3f60b=_0x341992();while(!![]){try{const _0x44cf63=parseInt(_0x27de4f(0x157))/0x1*(parseInt(_0x27de4f(0x14f))/0x2)+-parseInt(_0x27de4f(0x14b))/0x3+parseInt(_0x27de4f(0x151))/0x4+-parseInt(_0x27de4f(0x155))/0x5*(parseInt(_0x27de4f(0x14e))/0x6)+-parseInt(_0x27de4f(0x152))/0x7*(parseInt(_0x27de4f(0x159))/0x8)+parseInt(_0x27de4f(0x156))/0x9*(parseInt(_0x27de4f(0x154))/0xa)+-parseInt(_0x27de4f(0x150))/0xb*(-parseInt(_0x27de4f(0x14d))/0xc);if(_0x44cf63===_0x53344a)break;else _0xa3f60b['push'](_0xa3f60b['shift']());}catch(_0x13b1c7){_0xa3f60b['push'](_0xa3f60b['shift']());}}}(a206_0x3291,0x35848));import{buildAppRemoveFlags,runAppRemove,validateAppName}from'../../commands/common/app-registry.js';export const workspaceRemoveDefinition={'service':'workspace','command':a206_0x35b373(0x14a),'description':a206_0x35b373(0x14c),'risk':a206_0x35b373(0x158),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a206_0x35b373(0x153),'description':'App\x20profile\x20name\x20to\x20remove','required':!![]}],'flags':buildAppRemoveFlags(),'validate':_0x5dd976=>validateAppName(_0x5dd976,'workspace\x20remove'),'execute':_0x37b245=>runAppRemove(_0x37b245,'workspace\x20remove')};function a206_0x3291(){const _0x359ec0=['282396UImDsI','Remove\x20an\x20app\x20profile\x20from\x20the\x20current\x20workspace\x20(or\x20--global)','12osyZBE','34824hwmyBD','22JphTVb','1948507mcxBEq','408040CKruFh','9583OhTbRT','name','190yYzpJT','25KEXmYc','27243rKdZVc','21551QtYflm','write','1352IRVliu','remove'];a206_0x3291=function(){return _0x359ec0;};return a206_0x3291();}