@lovrabet/rabetbase-cli 2.5.1-beta.4 → 2.5.1-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (346) hide show
  1. package/README.md +75 -1
  2. package/lib/api/api-doc.js +1 -1
  3. package/lib/api/fetch-model-list.js +1 -1
  4. package/lib/api/generate-api-file.js +1 -1
  5. package/lib/api/generate-sdk-config-file.d.ts +0 -1
  6. package/lib/api/generate-sdk-config-file.js +1 -1
  7. package/lib/auth/auth-server-ui.js +1 -1
  8. package/lib/auth/auth-server.js +1 -1
  9. package/lib/auth/constant.js +1 -1
  10. package/lib/auth/get-cookie.js +1 -1
  11. package/lib/auth/get-session-user.js +1 -1
  12. package/lib/auth/is-session-valid.js +1 -1
  13. package/lib/auth/login-success-html.js +1 -1
  14. package/lib/auth/logout.js +1 -1
  15. package/lib/cli-flags.js +1 -1
  16. package/lib/cli.js +1 -1
  17. package/lib/commands/api/generate.js +1 -1
  18. package/lib/commands/api/index.js +1 -1
  19. package/lib/commands/api/list.js +1 -1
  20. package/lib/commands/api/pull.js +1 -1
  21. package/lib/commands/api/shared.js +1 -1
  22. package/lib/commands/app/index.js +1 -1
  23. package/lib/commands/app/list.js +1 -1
  24. package/lib/commands/app/members-list.js +1 -1
  25. package/lib/commands/app/remote-directory.js +1 -1
  26. package/lib/commands/app/shared.js +1 -1
  27. package/lib/commands/app-config/delete.js +1 -1
  28. package/lib/commands/app-config/get.js +1 -1
  29. package/lib/commands/app-config/index.js +1 -1
  30. package/lib/commands/app-config/list.js +1 -1
  31. package/lib/commands/app-config/set.js +1 -1
  32. package/lib/commands/app-config/shared.js +1 -1
  33. package/lib/commands/auth/index.js +1 -1
  34. package/lib/commands/bff/create.js +1 -1
  35. package/lib/commands/bff/delete.js +1 -1
  36. package/lib/commands/bff/detail.js +1 -1
  37. package/lib/commands/bff/index.js +1 -1
  38. package/lib/commands/bff/list.js +1 -1
  39. package/lib/commands/bff/pull.js +1 -1
  40. package/lib/commands/bff/push.js +1 -1
  41. package/lib/commands/bff/status.js +1 -1
  42. package/lib/commands/cli-skill/index.js +1 -1
  43. package/lib/commands/cli-update.js +1 -1
  44. package/lib/commands/codegen/index.js +1 -1
  45. package/lib/commands/codegen/sdk.js +1 -1
  46. package/lib/commands/codegen/sql.js +1 -1
  47. package/lib/commands/common/app-registry.js +1 -1
  48. package/lib/commands/common/app-selector.js +1 -1
  49. package/lib/commands/common/async-task.js +1 -1
  50. package/lib/commands/common/dry-run.js +1 -1
  51. package/lib/commands/common/flags.d.ts +2 -0
  52. package/lib/commands/common/flags.js +1 -1
  53. package/lib/commands/common/local-file.js +1 -1
  54. package/lib/commands/common/validate.js +1 -1
  55. package/lib/commands/config/delete.js +1 -1
  56. package/lib/commands/config/get.js +1 -1
  57. package/lib/commands/config/index.js +1 -1
  58. package/lib/commands/config/init.d.ts +2 -0
  59. package/lib/commands/config/init.js +1 -1
  60. package/lib/commands/config/list.js +1 -1
  61. package/lib/commands/config/set.js +1 -1
  62. package/lib/commands/config/shared.js +1 -1
  63. package/lib/commands/dataset/business-group-update.js +1 -1
  64. package/lib/commands/dataset/business-groups.js +1 -1
  65. package/lib/commands/dataset/capability.js +1 -1
  66. package/lib/commands/dataset/delete.js +1 -1
  67. package/lib/commands/dataset/detail.js +1 -1
  68. package/lib/commands/dataset/extend-update.js +1 -1
  69. package/lib/commands/dataset/field-restore.js +1 -1
  70. package/lib/commands/dataset/field-update.js +1 -1
  71. package/lib/commands/dataset/generate.js +1 -1
  72. package/lib/commands/dataset/index.js +1 -1
  73. package/lib/commands/dataset/list.js +1 -1
  74. package/lib/commands/dataset/operations.js +1 -1
  75. package/lib/commands/dataset/relation-audit.js +1 -1
  76. package/lib/commands/dataset/relation-create.js +1 -1
  77. package/lib/commands/dataset/relation-delete.js +1 -1
  78. package/lib/commands/dataset/relation-shared.js +1 -1
  79. package/lib/commands/dataset/relation-update.js +1 -1
  80. package/lib/commands/dataset/relations.js +1 -1
  81. package/lib/commands/dataset/rename.js +1 -1
  82. package/lib/commands/dataset/restore.js +1 -1
  83. package/lib/commands/dataset/user-deleted-field-list.js +1 -1
  84. package/lib/commands/db/analysis-batching.js +1 -1
  85. package/lib/commands/db/analyze-batch-plan.js +1 -1
  86. package/lib/commands/db/analyze-cancel.js +1 -1
  87. package/lib/commands/db/analyze-start.js +1 -1
  88. package/lib/commands/db/analyze-status.js +1 -1
  89. package/lib/commands/db/create.js +1 -1
  90. package/lib/commands/db/delete.js +1 -1
  91. package/lib/commands/db/detail.js +1 -1
  92. package/lib/commands/db/diff-refresh-start.js +1 -1
  93. package/lib/commands/db/diff-refresh-status.js +1 -1
  94. package/lib/commands/db/diff.js +1 -1
  95. package/lib/commands/db/index.js +1 -1
  96. package/lib/commands/db/list.js +1 -1
  97. package/lib/commands/db/shared.js +1 -1
  98. package/lib/commands/db/table-diff-shared.js +1 -1
  99. package/lib/commands/db/tables.js +1 -1
  100. package/lib/commands/db/test.js +1 -1
  101. package/lib/commands/db/update.js +1 -1
  102. package/lib/commands/deployment/auto-sync.js +1 -1
  103. package/lib/commands/deployment/index.js +1 -1
  104. package/lib/commands/deployment/sync.js +1 -1
  105. package/lib/commands/doctor.js +1 -1
  106. package/lib/commands/file/index.js +1 -1
  107. package/lib/commands/issue/index.js +1 -1
  108. package/lib/commands/issue/nudge.js +1 -1
  109. package/lib/commands/issue/report.js +1 -1
  110. package/lib/commands/issue/shared.js +1 -1
  111. package/lib/commands/kb/create.js +1 -1
  112. package/lib/commands/kb/delete.js +1 -1
  113. package/lib/commands/kb/detail.js +1 -1
  114. package/lib/commands/kb/index.js +1 -1
  115. package/lib/commands/kb/list.js +1 -1
  116. package/lib/commands/kb/search.js +1 -1
  117. package/lib/commands/kb/shared.js +1 -1
  118. package/lib/commands/kb/update.js +1 -1
  119. package/lib/commands/logs/index.js +1 -1
  120. package/lib/commands/menu/asset-update.js +1 -1
  121. package/lib/commands/menu/delete.js +1 -1
  122. package/lib/commands/menu/external-link-create.js +1 -1
  123. package/lib/commands/menu/external-link-update.js +1 -1
  124. package/lib/commands/menu/group-create.js +1 -1
  125. package/lib/commands/menu/group-update.js +1 -1
  126. package/lib/commands/menu/index.js +1 -1
  127. package/lib/commands/menu/list.js +1 -1
  128. package/lib/commands/menu/move.js +1 -1
  129. package/lib/commands/menu/regroup-start.js +1 -1
  130. package/lib/commands/menu/rename.js +1 -1
  131. package/lib/commands/menu/shared/compare-table.js +1 -1
  132. package/lib/commands/menu/shared/delete-plan.js +1 -1
  133. package/lib/commands/menu/shared/facts.js +1 -1
  134. package/lib/commands/menu/shared/index.js +1 -1
  135. package/lib/commands/menu/shared/inquirer.js +1 -1
  136. package/lib/commands/menu/shared/local-pages.js +1 -1
  137. package/lib/commands/menu/shared/logic.js +1 -1
  138. package/lib/commands/menu/shared/mutations.js +1 -1
  139. package/lib/commands/menu/shared/service.js +1 -1
  140. package/lib/commands/menu/shared/sync-core.js +1 -1
  141. package/lib/commands/menu/shared/update-core.js +1 -1
  142. package/lib/commands/menu/shared/valid-url.js +1 -1
  143. package/lib/commands/menu/sync.js +1 -1
  144. package/lib/commands/menu/visibility-update.js +1 -1
  145. package/lib/commands/notification/config-create.js +1 -1
  146. package/lib/commands/notification/config-delete.js +1 -1
  147. package/lib/commands/notification/config-list.js +1 -1
  148. package/lib/commands/notification/config-update.js +1 -1
  149. package/lib/commands/notification/index.js +1 -1
  150. package/lib/commands/notification/shared.js +1 -1
  151. package/lib/commands/ocr/index.js +1 -1
  152. package/lib/commands/page/create.js +1 -1
  153. package/lib/commands/page/custom/detail.js +1 -1
  154. package/lib/commands/page/custom/list.js +1 -1
  155. package/lib/commands/page/custom/publish.js +1 -1
  156. package/lib/commands/page/custom/shared.js +1 -1
  157. package/lib/commands/page/custom/syntax.js +1 -1
  158. package/lib/commands/page/custom/template.js +1 -1
  159. package/lib/commands/page/custom/update.js +1 -1
  160. package/lib/commands/page/data-list-status.js +1 -1
  161. package/lib/commands/page/generate-start.js +1 -1
  162. package/lib/commands/page/generate-status.js +1 -1
  163. package/lib/commands/page/index.js +1 -1
  164. package/lib/commands/page/pull.js +1 -1
  165. package/lib/commands/page/push.js +1 -1
  166. package/lib/commands/page/relation-audit.js +1 -1
  167. package/lib/commands/page/restore.js +1 -1
  168. package/lib/commands/page/shared.js +1 -1
  169. package/lib/commands/page/sync.js +1 -1
  170. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  171. package/lib/commands/project/create/format-elapsed.js +1 -1
  172. package/lib/commands/project/create/main.d.ts +1 -0
  173. package/lib/commands/project/create/main.js +1 -1
  174. package/lib/commands/project/create/materialize-project-template.js +1 -1
  175. package/lib/commands/project/create/project-name.js +1 -1
  176. package/lib/commands/project/create/project-template-archive.js +1 -1
  177. package/lib/commands/project/create/project-template-path.js +1 -1
  178. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  179. package/lib/commands/project/create/use-format-code.js +1 -1
  180. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  181. package/lib/commands/project/domain-routing-sync.d.ts +2 -0
  182. package/lib/commands/project/domain-routing-sync.js +1 -0
  183. package/lib/commands/project/index.js +1 -1
  184. package/lib/commands/project/upgrade.js +1 -1
  185. package/lib/commands/registry.js +1 -1
  186. package/lib/commands/role/delete.js +1 -1
  187. package/lib/commands/role/detail.js +1 -1
  188. package/lib/commands/role/index.js +1 -1
  189. package/lib/commands/role/list.js +1 -1
  190. package/lib/commands/role/shared.js +1 -1
  191. package/lib/commands/role/update.js +1 -1
  192. package/lib/commands/role/user-add.js +1 -1
  193. package/lib/commands/role/user-remove.js +1 -1
  194. package/lib/commands/role/user-resolve.js +1 -1
  195. package/lib/commands/rule/get.d.ts +2 -0
  196. package/lib/commands/rule/get.js +1 -0
  197. package/lib/commands/rule/index.d.ts +2 -0
  198. package/lib/commands/rule/index.js +1 -0
  199. package/lib/commands/rule/list.d.ts +2 -0
  200. package/lib/commands/rule/list.js +1 -0
  201. package/lib/commands/rule/set.d.ts +2 -0
  202. package/lib/commands/rule/set.js +1 -0
  203. package/lib/commands/rule/shared.d.ts +43 -0
  204. package/lib/commands/rule/shared.js +1 -0
  205. package/lib/commands/run/index.js +1 -1
  206. package/lib/commands/schema.js +1 -1
  207. package/lib/commands/sql/create.js +1 -1
  208. package/lib/commands/sql/delete.js +1 -1
  209. package/lib/commands/sql/detail.js +1 -1
  210. package/lib/commands/sql/exec.js +1 -1
  211. package/lib/commands/sql/index.js +1 -1
  212. package/lib/commands/sql/list.js +1 -1
  213. package/lib/commands/sql/pull.js +1 -1
  214. package/lib/commands/sql/push.js +1 -1
  215. package/lib/commands/sql/shared.js +1 -1
  216. package/lib/commands/sql/status.js +1 -1
  217. package/lib/commands/sql/validate.js +1 -1
  218. package/lib/commands/task/index.js +1 -1
  219. package/lib/commands/task/status.js +1 -1
  220. package/lib/commands/tenant/index.js +1 -1
  221. package/lib/commands/tenant/members-list.js +1 -1
  222. package/lib/commands/tenant/shared.js +1 -1
  223. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  224. package/lib/commands/user-account/index.js +1 -1
  225. package/lib/commands/workspace/add.js +1 -1
  226. package/lib/commands/workspace/index.js +1 -1
  227. package/lib/commands/workspace/remove.js +1 -1
  228. package/lib/config/deployment-sync.js +1 -1
  229. package/lib/config/domain-config.d.ts +37 -1
  230. package/lib/config/domain-config.js +1 -1
  231. package/lib/config/project-domain-routing.d.ts +27 -0
  232. package/lib/config/project-domain-routing.js +1 -0
  233. package/lib/config/schema.d.ts +1 -1
  234. package/lib/config/schema.js +1 -1
  235. package/lib/constant/cdn.js +1 -1
  236. package/lib/constant/cli.js +1 -1
  237. package/lib/constant/defaults.js +1 -1
  238. package/lib/constant/domain.d.ts +10 -4
  239. package/lib/constant/domain.js +1 -1
  240. package/lib/constant/env.js +1 -1
  241. package/lib/constant/output.js +1 -1
  242. package/lib/constant/paths.js +1 -1
  243. package/lib/constant/region.d.ts +4 -1
  244. package/lib/constant/region.js +1 -1
  245. package/lib/constant/risk.js +1 -1
  246. package/lib/constant/routing-profile.d.ts +43 -49
  247. package/lib/constant/routing-profile.js +1 -1
  248. package/lib/context/app-resolver.js +1 -1
  249. package/lib/context/auth-resolver.js +1 -1
  250. package/lib/context/config-loader.js +1 -1
  251. package/lib/context.d.ts +2 -0
  252. package/lib/context.js +1 -1
  253. package/lib/core/alias-resolver.js +1 -1
  254. package/lib/core/api-client.d.ts +37 -0
  255. package/lib/core/api-client.js +1 -1
  256. package/lib/core/bff/config.js +1 -1
  257. package/lib/core/bff/file-system.js +1 -1
  258. package/lib/core/bff/hash.js +1 -1
  259. package/lib/core/bff/lock.js +1 -1
  260. package/lib/core/bff/utils.js +1 -1
  261. package/lib/core/db-resolver.js +1 -1
  262. package/lib/core/page/file-system.js +1 -1
  263. package/lib/core/page/hash.js +1 -1
  264. package/lib/core/page/lock.js +1 -1
  265. package/lib/core/sql-index-auditor.js +1 -1
  266. package/lib/core/sql-sync/config.js +1 -1
  267. package/lib/core/sql-sync/file-system.js +1 -1
  268. package/lib/core/sql-sync/hash.js +1 -1
  269. package/lib/core/sql-sync/lock.js +1 -1
  270. package/lib/core/sql-sync/utils.js +1 -1
  271. package/lib/core/sql-validator.js +1 -1
  272. package/lib/errors.js +1 -1
  273. package/lib/framework/build-all-flags.js +1 -1
  274. package/lib/framework/error-output.js +1 -1
  275. package/lib/framework/explicit-yes.js +1 -1
  276. package/lib/framework/flags.js +1 -1
  277. package/lib/framework/help.js +1 -1
  278. package/lib/framework/index.js +1 -1
  279. package/lib/framework/output.js +1 -1
  280. package/lib/framework/response.js +1 -1
  281. package/lib/framework/runner-alias.js +1 -1
  282. package/lib/framework/runner.js +1 -1
  283. package/lib/framework/schema-export.js +1 -1
  284. package/lib/framework/types.d.ts +0 -1
  285. package/lib/framework/types.js +1 -1
  286. package/lib/generated/build-info.d.ts +4 -4
  287. package/lib/generated/build-info.js +1 -1
  288. package/lib/generated/official-routing.d.ts +83 -0
  289. package/lib/generated/official-routing.js +1 -0
  290. package/lib/generated/routing-contract.d.ts +9 -0
  291. package/lib/generated/routing-contract.js +1 -0
  292. package/lib/help.js +1 -1
  293. package/lib/postinstall.js +1 -1
  294. package/lib/runtime/confirmation.js +1 -1
  295. package/lib/runtime/event.js +1 -1
  296. package/lib/runtime/index.js +1 -1
  297. package/lib/runtime/queue.js +1 -1
  298. package/lib/runtime/resolve.js +1 -1
  299. package/lib/skills/builtin-skill.js +1 -1
  300. package/lib/skills/main.js +1 -1
  301. package/lib/skills/npx-skills-add.js +1 -1
  302. package/lib/skills/skill-presence.js +1 -1
  303. package/lib/telemetry/cli-command-trace.js +1 -1
  304. package/lib/telemetry/cli-help-trace.js +1 -1
  305. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  306. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  307. package/lib/telemetry/send-cli-trace-log.js +1 -1
  308. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  309. package/lib/types/index.d.ts +0 -1
  310. package/lib/utils/ai_config.js +1 -1
  311. package/lib/utils/apply-jq-filter.js +1 -1
  312. package/lib/utils/cdn-config.js +1 -1
  313. package/lib/utils/check-sdk-version.js +1 -1
  314. package/lib/utils/cli-version-check.js +1 -1
  315. package/lib/utils/cli-version-policy.js +1 -1
  316. package/lib/utils/config.js +1 -1
  317. package/lib/utils/entity-with-id.js +1 -1
  318. package/lib/utils/file-utils.js +1 -1
  319. package/lib/utils/guides-cdn.js +1 -1
  320. package/lib/utils/http-client.js +1 -1
  321. package/lib/utils/is-non-interactive.js +1 -1
  322. package/lib/utils/logger.js +1 -1
  323. package/lib/utils/params.js +1 -1
  324. package/lib/utils/platform.js +1 -1
  325. package/lib/utils/sleep.js +1 -1
  326. package/lib/utils/template-replacer.js +1 -1
  327. package/lib/utils/update-notice.js +1 -1
  328. package/lib/utils/version.js +1 -1
  329. package/lib/utils/with-active-cookie.js +1 -1
  330. package/lib/utils/write-cli-side-channel.js +1 -1
  331. package/package.json +2 -1
  332. package/skills/rabetbase/SKILL.md +16 -13
  333. package/skills/rabetbase/guides/sdk-client-generation.md +10 -8
  334. package/skills/rabetbase/references/rabetbase-api-pull.md +16 -11
  335. package/skills/rabetbase/references/rabetbase-config.md +4 -4
  336. package/skills/rabetbase/references/rabetbase-doctor.md +2 -1
  337. package/skills/rabetbase/references/rabetbase-init.md +32 -8
  338. package/skills/rabetbase/references/rabetbase-kb.md +7 -8
  339. package/skills/rabetbase/references/rabetbase-project-create.md +33 -8
  340. package/skills/rabetbase/references/rabetbase-project-domain-routing-sync.md +28 -0
  341. package/skills/rabetbase/references/rabetbase-rule.md +49 -0
  342. package/skills/rabetbase.manifest.json +5 -3
  343. package/lib/config/project-routing.d.ts +0 -30
  344. package/lib/config/project-routing.js +0 -1
  345. package/lib/core/kb-search-client.d.ts +0 -30
  346. package/lib/core/kb-search-client.js +0 -1
@@ -1 +1 @@
1
- const a197_0x14d926=a197_0x39d9;(function(_0x590045,_0x1fa13d){const _0x1c4f2f=a197_0x39d9,_0x2bc8f3=_0x590045();while(!![]){try{const _0x1876c2=-parseInt(_0x1c4f2f(0x7a))/0x1*(parseInt(_0x1c4f2f(0x7c))/0x2)+parseInt(_0x1c4f2f(0x89))/0x3+-parseInt(_0x1c4f2f(0x85))/0x4+parseInt(_0x1c4f2f(0xa7))/0x5+-parseInt(_0x1c4f2f(0x84))/0x6*(parseInt(_0x1c4f2f(0x81))/0x7)+-parseInt(_0x1c4f2f(0x93))/0x8+parseInt(_0x1c4f2f(0x8d))/0x9*(parseInt(_0x1c4f2f(0xa2))/0xa);if(_0x1876c2===_0x1fa13d)break;else _0x2bc8f3['push'](_0x2bc8f3['shift']());}catch(_0x36bc43){_0x2bc8f3['push'](_0x2bc8f3['shift']());}}}(a197_0x3f49,0xd2dab));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';function a197_0x3f49(){const _0x2782ef=['toISOString','status','20UTHESm','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','filter','str','set','7077000iJhEOR','remoteId','force','sql','map','entries','version','lockFilePath','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','sqlConfig','appCode','get','relativePath','push','filePath','No\x20local\x20SQL\x20files\x20found.','dbName','trashDir','\x20pushed,\x20','Push\x20local\x20SQL\x20files\x20to\x20remote','Local\x20directory\x20\x22','\x22\x20for\x20sqlCode\x20','dbId','378239EgiMju','lastSync','2bfzuJf','sqlcode','projectRoot','Local\x20SQL\x20not\x20found:\x20',',\x20deployment\x20sync\x20','786520mBbVTT','Push\x20complete:\x20','\x20skipped,\x20','24FKbVLx','2029032RBVTLx','Would\x20push\x20','hash','isFinite','45306OPRrHm','path','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','bool','3832047aSmyRC','join','validation','No\x20database\x20matches\x20local\x20directory\x20\x22','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','catch','667776aCgZHP','\x20failed','sqlCode','sqlRootDir','/smartapi/custom/updateUserCustomSql','utf8','sqlRoot','configured','dbDirectory','length','unchanged','sqlName','sqls'];a197_0x3f49=function(){return _0x2782ef;};return a197_0x3f49();}import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';function a197_0x39d9(_0x1aedef,_0x3b9bbf){_0x1aedef=_0x1aedef-0x6e;const _0x3f49c7=a197_0x3f49();let _0x39d910=_0x3f49c7[_0x1aedef];return _0x39d910;}import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';import{automaticDeploymentSyncSucceeded,buildAutomaticDeploymentSyncPreview,runAutomaticDeploymentSync,validateAutomaticDeploymentSync}from'../../commands/deployment/auto-sync.js';async function getTargetSqlQueries(_0x4426b4,_0x11d32,_0x4d94c5){const _0x486970=a197_0x39d9,_0x2410b8=await scanLocalSqlQueries(_0x4426b4),_0x5d77a8=new Map();for(const _0x273215 of _0x2410b8){if(_0x4d94c5&&_0x273215[_0x486970(0x95)]!==_0x4d94c5)continue;const _0x49bac5=_0x5d77a8[_0x486970(0x6e)](_0x273215[_0x486970(0x95)])??[];_0x49bac5[_0x486970(0x70)](_0x273215),_0x5d77a8[_0x486970(0xa6)](_0x273215[_0x486970(0x95)],_0x49bac5);}if(_0x4d94c5&&!_0x5d77a8['has'](_0x4d94c5))throw CliErrors[_0x486970(0x8f)](_0x486970(0x7f)+_0x4d94c5);const _0x2da6ac=[];for(const [_0x1a5be4,_0xca8d85]of _0x5d77a8[_0x486970(0xac)]()){if(_0xca8d85[_0x486970(0x9c)]===0x1){_0x2da6ac['push'](_0xca8d85[0x0]);continue;}const _0x5e6b8c=_0x11d32[_0x486970(0x9f)][_0x1a5be4],_0x1642d0=_0x5e6b8c?.[_0x486970(0x8a)],_0x469c31=_0x1642d0?_0xca8d85[_0x486970(0xa4)](_0x11bd44=>_0x11bd44[_0x486970(0x6f)]!==_0x1642d0):_0xca8d85;if(_0x5e6b8c&&_0x469c31[_0x486970(0x9c)]===0x1){_0x2da6ac[_0x486970(0x70)](_0x469c31[0x0]);continue;}throw CliErrors[_0x486970(0x8f)](_0x486970(0x91)+_0x1a5be4+'.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.');}return _0x2da6ac;}export const sqlPush={'service':'sql','command':'push','description':a197_0x14d926(0x76),'risk':'write','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a197_0x14d926(0xa9),'type':'boolean','description':a197_0x14d926(0x8b)}],async 'validate'(_0x1fa264){validateAutomaticDeploymentSync(_0x1fa264);},async 'dryRun'(_0x5dd4de){const _0x5723fe=a197_0x14d926,_0x30265d=loadSqlProjectConfig(_0x5dd4de[_0x5723fe(0xb1)]),_0x54234c=await readSqlLockFile(_0x30265d[_0x5723fe(0xae)]),{appLock:_0x49765d}=ensureSqlLockScope(_0x54234c??createEmptySqlLock(),_0x5dd4de[_0x5723fe(0xb1)],_0x30265d[_0x5723fe(0x99)],_0x5723fe(0x70)),_0x572325=await getTargetSqlQueries(_0x30265d,_0x49765d,_0x5dd4de[_0x5723fe(0xa5)](_0x5723fe(0x7d))||undefined),_0x475010=[];for(const _0x23ec93 of _0x572325){const _0x2fc26d=await computeSqlFileHash(_0x23ec93[_0x5723fe(0x71)]),_0x33456e=_0x49765d[_0x5723fe(0x9f)][_0x23ec93[_0x5723fe(0x95)]],_0x34c34e=!!_0x33456e&&(_0x33456e[_0x5723fe(0x8a)]!==_0x23ec93[_0x5723fe(0x6f)]||!!_0x23ec93['sqlName']&&_0x33456e[_0x5723fe(0x9e)]!==_0x23ec93[_0x5723fe(0x9e)]);if(!_0x5dd4de[_0x5723fe(0x8c)]('force')&&_0x33456e&&_0x33456e[_0x5723fe(0x87)]===_0x2fc26d&&!_0x34c34e)continue;_0x475010[_0x5723fe(0x70)](_0x23ec93[_0x5723fe(0x95)]);}return{'method':'POST','url':_0x5723fe(0x97),'deploymentSync':buildAutomaticDeploymentSyncPreview(_0x5dd4de,_0x5723fe(0xaa),_0x475010),'body':{'sqlCodes':_0x475010,'appCode':_0x5dd4de['appCode']},'description':_0x5723fe(0x86)+_0x475010['length']+'\x20SQL\x20file(s)'};},async 'execute'(_0x84d532){const _0x34fb4d=a197_0x14d926,_0x2d6990=loadSqlProjectConfig(_0x84d532[_0x34fb4d(0xb1)]),_0x2eb9cf=await readSqlLockFile(_0x2d6990[_0x34fb4d(0xae)]),{lockData:_0x1c7807,appLock:_0x409f6f}=ensureSqlLockScope(_0x2eb9cf??createEmptySqlLock(),_0x84d532['appCode'],_0x2d6990[_0x34fb4d(0x99)],_0x34fb4d(0x70)),_0x195157=await getTargetSqlQueries(_0x2d6990,_0x409f6f,_0x84d532[_0x34fb4d(0xa5)](_0x34fb4d(0x7d))||undefined);if(_0x195157['length']===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x34fb4d(0x72)};const _0x4252c6=[],_0x353c8d=[],_0x5635c5=[];for(const _0x21d31b of _0x195157){const _0x475323=_0x409f6f['sqls'][_0x21d31b[_0x34fb4d(0x95)]];if(!_0x475323){_0x5635c5[_0x34fb4d(0x70)]({'sqlCode':_0x21d31b[_0x34fb4d(0x95)],'error':_0x34fb4d(0xa3)});continue;}try{const _0x384db0=await computeSqlFileHash(_0x21d31b[_0x34fb4d(0x71)]),_0x5d96bd=_0x475323[_0x34fb4d(0x8a)]!==_0x21d31b[_0x34fb4d(0x6f)]||!!_0x21d31b[_0x34fb4d(0x9e)]&&_0x475323[_0x34fb4d(0x9e)]!==_0x21d31b[_0x34fb4d(0x9e)];if(!_0x84d532[_0x34fb4d(0x8c)]('force')&&_0x475323[_0x34fb4d(0x87)]===_0x384db0&&!_0x5d96bd){_0x353c8d[_0x34fb4d(0x70)]({'sqlCode':_0x21d31b['sqlCode'],'reason':_0x34fb4d(0x9d)});continue;}if(_0x475323['version']==null){_0x5635c5[_0x34fb4d(0x70)]({'sqlCode':_0x21d31b[_0x34fb4d(0x95)],'error':'missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first'});continue;}const _0x92597d=await readFile(_0x21d31b[_0x34fb4d(0x71)],_0x34fb4d(0x98)),_0x18fe91=stripLocalSqlMetadata(_0x92597d,_0x21d31b['mode']),_0x3ba0a4=_0x21d31b[_0x34fb4d(0x9e)]||_0x475323[_0x34fb4d(0x9e)],_0x3bfa93=await resolveTargetDbBinding(_0x84d532['appCode'],_0x21d31b,_0x475323),_0x44f608=await updateSqlQuery({'id':_0x475323[_0x34fb4d(0xa8)],'appCode':_0x84d532[_0x34fb4d(0xb1)],'sqlCode':_0x21d31b['sqlCode'],'sqlName':_0x3ba0a4,'dbId':_0x3bfa93['dbId'],'version':_0x475323[_0x34fb4d(0xad)],'sqlContent':_0x18fe91,'sqlConfig':_0x475323[_0x34fb4d(0xb0)]??undefined}),_0x3251c3=_0x44f608['dbId']?await getDbName(_0x84d532[_0x34fb4d(0xb1)],Number(_0x44f608['dbId']))[_0x34fb4d(0x92)](()=>_0x3bfa93[_0x34fb4d(0x73)]):_0x3bfa93[_0x34fb4d(0x73)];_0x409f6f[_0x34fb4d(0x9f)][_0x21d31b['sqlCode']]={...buildSqlLockEntry(_0x44f608,_0x18fe91,_0x384db0,{'dbName':_0x3251c3}),'path':_0x21d31b[_0x34fb4d(0x6f)],'mode':_0x475323['mode']},await archivePreviousSqlFileIfNeeded(_0x2d6990,_0x475323[_0x34fb4d(0x8a)],_0x21d31b[_0x34fb4d(0x6f)]),_0x4252c6[_0x34fb4d(0x70)]({'sqlCode':_0x21d31b[_0x34fb4d(0x95)],'remoteId':_0x475323[_0x34fb4d(0xa8)]});}catch(_0xfd67ea){_0x5635c5[_0x34fb4d(0x70)]({'sqlCode':_0x21d31b[_0x34fb4d(0x95)],'error':_0xfd67ea instanceof Error?_0xfd67ea['message']:String(_0xfd67ea)});}}_0x409f6f[_0x34fb4d(0x7b)]=new Date()[_0x34fb4d(0xa0)](),await writeSqlLockFile(_0x2d6990['lockFilePath'],_0x1c7807);const _0x25c9b0=_0x5635c5['length']===0x0,_0x37f0bd=await runAutomaticDeploymentSync(_0x84d532,_0x34fb4d(0xaa),_0x4252c6[_0x34fb4d(0xab)](_0xa9521c=>_0xa9521c[_0x34fb4d(0x95)]),_0x25c9b0),_0x2dcf66=_0x25c9b0&&automaticDeploymentSyncSucceeded(_0x37f0bd),_0x3449b1=_0x37f0bd[_0x34fb4d(0x9a)]?_0x34fb4d(0x80)+_0x37f0bd[_0x34fb4d(0xa1)]:'';return{'ok':_0x2dcf66,'data':{'pushed':_0x4252c6,'skipped':_0x353c8d,'failed':_0x5635c5,'deploymentSync':_0x37f0bd},'message':_0x34fb4d(0x82)+_0x4252c6[_0x34fb4d(0x9c)]+_0x34fb4d(0x75)+_0x353c8d[_0x34fb4d(0x9c)]+_0x34fb4d(0x83)+_0x5635c5[_0x34fb4d(0x9c)]+_0x34fb4d(0x94)+_0x3449b1};}};async function archivePreviousSqlFileIfNeeded(_0x2dcbe7,_0x21bc0f,_0x9c81d){const _0x2241e2=a197_0x14d926;if(!_0x21bc0f||_0x21bc0f===_0x9c81d)return;const _0x5aa91a=join(_0x2dcbe7[_0x2241e2(0x96)],_0x21bc0f);if(!await fileExists(_0x5aa91a))return;const _0x312cf7=await moveToTrash(_0x2dcbe7[_0x2241e2(0x7e)],_0x2dcbe7[_0x2241e2(0x74)],_0x5aa91a);await cleanupEmptyDirectories(dirname(_0x5aa91a),_0x2dcbe7[_0x2241e2(0x96)]),void _0x312cf7;}async function moveToTrash(_0x53ca76,_0x5d8f83,_0x3d0466){const _0x552349=a197_0x14d926,_0x5751e3=new Date()[_0x552349(0xa0)]()['replace'](/[:.]/g,'-'),_0x2c48ab=relative(_0x53ca76,_0x3d0466),_0x4fb3bd=join(_0x5d8f83,_0x5751e3,_0x2c48ab);return await mkdir(dirname(_0x4fb3bd),{'recursive':!![]}),await rename(_0x3d0466,_0x4fb3bd),_0x4fb3bd;}async function cleanupEmptyDirectories(_0x3227a3,_0x2005b6){const _0x495dc4=a197_0x14d926;let _0x37422d=resolve(_0x3227a3);const _0x224784=resolve(_0x2005b6);while(_0x37422d['startsWith'](''+_0x224784+sep)||_0x37422d===_0x224784){if(_0x37422d===_0x224784)return;try{const _0x2c02dd=await readdir(_0x37422d);if(_0x2c02dd[_0x495dc4(0x9c)]>0x0)return;await rmdir(_0x37422d);}catch{return;}_0x37422d=dirname(_0x37422d);}}async function resolveTargetDbBinding(_0x18f215,_0x1338bf,_0x4e4fb7){const _0x493f2e=a197_0x14d926,_0x58fe9e=_0x1338bf[_0x493f2e(0x9b)];if(!_0x58fe9e)return{'dbId':_0x4e4fb7[_0x493f2e(0x79)],'dbName':_0x4e4fb7['dbName']};const _0x3a10c8=buildDbDirectoryName(_0x4e4fb7['dbName'],_0x4e4fb7[_0x493f2e(0x79)]);if(_0x58fe9e===_0x3a10c8)return{'dbId':_0x4e4fb7[_0x493f2e(0x79)],'dbName':_0x4e4fb7[_0x493f2e(0x73)]};const _0x542510=parseExplicitDbDirectory(_0x58fe9e);if(_0x542510!=null)return{'dbId':_0x542510,'dbName':await getDbName(_0x18f215,_0x542510)['catch'](()=>undefined)};const _0x41e7e4=await listDatabases(_0x18f215),_0x532d60=_0x41e7e4['filter'](_0x119d98=>buildDbDirectoryName(_0x119d98['dbName'],_0x119d98[_0x493f2e(0x79)])===_0x58fe9e);if(_0x532d60[_0x493f2e(0x9c)]===0x1)return{'dbId':_0x532d60[0x0]['dbId'],'dbName':_0x532d60[0x0][_0x493f2e(0x73)]};if(_0x532d60['length']===0x0)throw CliErrors[_0x493f2e(0x8f)](_0x493f2e(0x90)+_0x58fe9e+_0x493f2e(0x78)+_0x1338bf[_0x493f2e(0x95)]+'.');const _0x23be67=_0x532d60[_0x493f2e(0xab)](_0x42c2aa=>_0x42c2aa[_0x493f2e(0x73)]+'\x20('+_0x42c2aa['dbId']+')')[_0x493f2e(0x8e)](',\x20');throw CliErrors[_0x493f2e(0x8f)](_0x493f2e(0x77)+_0x58fe9e+_0x493f2e(0xaf)+_0x1338bf[_0x493f2e(0x95)]+':\x20'+_0x23be67);}function parseExplicitDbDirectory(_0x2a537e){const _0x47e6d1=a197_0x14d926,_0x3d0d1e=/^db-(\d+)$/['exec'](_0x2a537e);if(!_0x3d0d1e)return null;const _0x29d9b0=Number(_0x3d0d1e[0x1]);return Number[_0x47e6d1(0x88)](_0x29d9b0)&&_0x29d9b0>0x0?_0x29d9b0:null;}
1
+ const a203_0x430d9f=a203_0x54b5;(function(_0x3e4705,_0x1c0f85){const _0x71dd6e=a203_0x54b5,_0x18c812=_0x3e4705();while(!![]){try{const _0x34502c=parseInt(_0x71dd6e(0xeb))/0x1*(-parseInt(_0x71dd6e(0xe6))/0x2)+-parseInt(_0x71dd6e(0xb6))/0x3*(-parseInt(_0x71dd6e(0xbc))/0x4)+parseInt(_0x71dd6e(0xdf))/0x5+parseInt(_0x71dd6e(0xe5))/0x6*(parseInt(_0x71dd6e(0xc0))/0x7)+parseInt(_0x71dd6e(0xc3))/0x8+parseInt(_0x71dd6e(0xdc))/0x9*(parseInt(_0x71dd6e(0xd6))/0xa)+-parseInt(_0x71dd6e(0xe8))/0xb;if(_0x34502c===_0x1c0f85)break;else _0x18c812['push'](_0x18c812['shift']());}catch(_0x42567f){_0x18c812['push'](_0x18c812['shift']());}}}(a203_0x504b,0xb285b));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';function a203_0x54b5(_0x847a93,_0x56b475){_0x847a93=_0x847a93-0xa9;const _0x504bba=a203_0x504b();let _0x54b5c3=_0x504bba[_0x847a93];return _0x54b5c3;}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';function a203_0x504b(){const _0x277c38=['No\x20local\x20SQL\x20files\x20found.','3BhaXyx','toISOString','sql','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','path','message','bool','sqlCode','catch','replace','write','dbDirectory','exec','sqlConfig','sqlName','sqls','boolean','6zhQkoO','relativePath','\x22\x20for\x20sqlCode\x20','force','POST','mode','2472184OJzSjm','unchanged','Would\x20push\x20','get','464709StGKNd','lockFilePath','sqlRoot','8614944BJHyYM','No\x20database\x20matches\x20local\x20directory\x20\x22','/smartapi/custom/updateUserCustomSql','validation','sqlcode','\x20failed','appCode','status','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','Push\x20local\x20SQL\x20files\x20to\x20remote','dbName','sqlRootDir','join','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','\x20skipped,\x20','isFinite','filePath','Local\x20directory\x20\x22','length','14690scZCit','set','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','lastSync','filter','remoteId','3744Obekpo','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','has','2503695qGBdqr','push','\x20pushed,\x20','map','entries','str','12gxQDte','181294kGbFel','version','28098499hrAwwG','dbId'];a203_0x504b=function(){return _0x277c38;};return a203_0x504b();}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';import{automaticDeploymentSyncSucceeded,buildAutomaticDeploymentSyncPreview,runAutomaticDeploymentSync,validateAutomaticDeploymentSync}from'../../commands/deployment/auto-sync.js';async function getTargetSqlQueries(_0x380576,_0x6110b,_0x381f44){const _0x52710b=a203_0x54b5,_0x387214=await scanLocalSqlQueries(_0x380576),_0x302bdc=new Map();for(const _0x5edade of _0x387214){if(_0x381f44&&_0x5edade[_0x52710b(0xac)]!==_0x381f44)continue;const _0x4aea67=_0x302bdc[_0x52710b(0xbf)](_0x5edade[_0x52710b(0xac)])??[];_0x4aea67[_0x52710b(0xe0)](_0x5edade),_0x302bdc[_0x52710b(0xd7)](_0x5edade['sqlCode'],_0x4aea67);}if(_0x381f44&&!_0x302bdc[_0x52710b(0xde)](_0x381f44))throw CliErrors[_0x52710b(0xc6)]('Local\x20SQL\x20not\x20found:\x20'+_0x381f44);const _0xbcc388=[];for(const [_0x2840ba,_0x11ff92]of _0x302bdc[_0x52710b(0xe3)]()){if(_0x11ff92[_0x52710b(0xd5)]===0x1){_0xbcc388[_0x52710b(0xe0)](_0x11ff92[0x0]);continue;}const _0x35b810=_0x6110b['sqls'][_0x2840ba],_0x1cfa27=_0x35b810?.['path'],_0x5328b7=_0x1cfa27?_0x11ff92[_0x52710b(0xda)](_0x4e3110=>_0x4e3110[_0x52710b(0xb7)]!==_0x1cfa27):_0x11ff92;if(_0x35b810&&_0x5328b7['length']===0x1){_0xbcc388[_0x52710b(0xe0)](_0x5328b7[0x0]);continue;}throw CliErrors[_0x52710b(0xc6)](_0x52710b(0xdd)+_0x2840ba+_0x52710b(0xcb));}return _0xbcc388;}export const sqlPush={'service':a203_0x430d9f(0xed),'command':a203_0x430d9f(0xe0),'description':a203_0x430d9f(0xcc),'risk':a203_0x430d9f(0xaf),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':'force','type':a203_0x430d9f(0xb5),'description':a203_0x430d9f(0xd8)}],async 'validate'(_0x4c407a){validateAutomaticDeploymentSync(_0x4c407a);},async 'dryRun'(_0x48e6da){const _0x376cf5=a203_0x430d9f,_0x3e2889=loadSqlProjectConfig(_0x48e6da[_0x376cf5(0xc9)]),_0x410875=await readSqlLockFile(_0x3e2889[_0x376cf5(0xc1)]),{appLock:_0x33ab00}=ensureSqlLockScope(_0x410875??createEmptySqlLock(),_0x48e6da[_0x376cf5(0xc9)],_0x3e2889[_0x376cf5(0xc2)],_0x376cf5(0xe0)),_0x26a645=await getTargetSqlQueries(_0x3e2889,_0x33ab00,_0x48e6da[_0x376cf5(0xe4)]('sqlcode')||undefined),_0x256a66=[];for(const _0x4c6faa of _0x26a645){const _0xd50a3a=await computeSqlFileHash(_0x4c6faa[_0x376cf5(0xd3)]),_0x224387=_0x33ab00[_0x376cf5(0xb4)][_0x4c6faa[_0x376cf5(0xac)]],_0x4502bf=!!_0x224387&&(_0x224387[_0x376cf5(0xa9)]!==_0x4c6faa[_0x376cf5(0xb7)]||!!_0x4c6faa[_0x376cf5(0xb3)]&&_0x224387[_0x376cf5(0xb3)]!==_0x4c6faa['sqlName']);if(!_0x48e6da[_0x376cf5(0xab)]('force')&&_0x224387&&_0x224387['hash']===_0xd50a3a&&!_0x4502bf)continue;_0x256a66[_0x376cf5(0xe0)](_0x4c6faa[_0x376cf5(0xac)]);}return{'method':_0x376cf5(0xba),'url':_0x376cf5(0xc5),'deploymentSync':buildAutomaticDeploymentSyncPreview(_0x48e6da,_0x376cf5(0xed),_0x256a66),'body':{'sqlCodes':_0x256a66,'appCode':_0x48e6da[_0x376cf5(0xc9)]},'description':_0x376cf5(0xbe)+_0x256a66[_0x376cf5(0xd5)]+'\x20SQL\x20file(s)'};},async 'execute'(_0x5bef55){const _0xdecf27=a203_0x430d9f,_0x5293f6=loadSqlProjectConfig(_0x5bef55[_0xdecf27(0xc9)]),_0x454f57=await readSqlLockFile(_0x5293f6[_0xdecf27(0xc1)]),{lockData:_0x2dda38,appLock:_0x1098c0}=ensureSqlLockScope(_0x454f57??createEmptySqlLock(),_0x5bef55[_0xdecf27(0xc9)],_0x5293f6[_0xdecf27(0xc2)],_0xdecf27(0xe0)),_0xcce273=await getTargetSqlQueries(_0x5293f6,_0x1098c0,_0x5bef55['str'](_0xdecf27(0xc7))||undefined);if(_0xcce273[_0xdecf27(0xd5)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0xdecf27(0xea)};const _0x30eecc=[],_0x2006f7=[],_0x59172f=[];for(const _0xcf1650 of _0xcce273){const _0x18c196=_0x1098c0['sqls'][_0xcf1650['sqlCode']];if(!_0x18c196){_0x59172f[_0xdecf27(0xe0)]({'sqlCode':_0xcf1650[_0xdecf27(0xac)],'error':'local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first'});continue;}try{const _0x676dba=await computeSqlFileHash(_0xcf1650[_0xdecf27(0xd3)]),_0xd1d4d9=_0x18c196[_0xdecf27(0xa9)]!==_0xcf1650['relativePath']||!!_0xcf1650['sqlName']&&_0x18c196[_0xdecf27(0xb3)]!==_0xcf1650[_0xdecf27(0xb3)];if(!_0x5bef55[_0xdecf27(0xab)](_0xdecf27(0xb9))&&_0x18c196['hash']===_0x676dba&&!_0xd1d4d9){_0x2006f7[_0xdecf27(0xe0)]({'sqlCode':_0xcf1650[_0xdecf27(0xac)],'reason':_0xdecf27(0xbd)});continue;}if(_0x18c196['version']==null){_0x59172f['push']({'sqlCode':_0xcf1650[_0xdecf27(0xac)],'error':_0xdecf27(0xee)});continue;}const _0x463259=await readFile(_0xcf1650[_0xdecf27(0xd3)],'utf8'),_0x3ad01e=stripLocalSqlMetadata(_0x463259,_0xcf1650[_0xdecf27(0xbb)]),_0x3d1c4f=_0xcf1650['sqlName']||_0x18c196['sqlName'],_0x1725fd=await resolveTargetDbBinding(_0x5bef55[_0xdecf27(0xc9)],_0xcf1650,_0x18c196),_0x3263fa=await updateSqlQuery({'id':_0x18c196[_0xdecf27(0xdb)],'appCode':_0x5bef55[_0xdecf27(0xc9)],'sqlCode':_0xcf1650[_0xdecf27(0xac)],'sqlName':_0x3d1c4f,'dbId':_0x1725fd[_0xdecf27(0xe9)],'version':_0x18c196[_0xdecf27(0xe7)],'sqlContent':_0x3ad01e,'sqlConfig':_0x18c196[_0xdecf27(0xb2)]??undefined}),_0x284daf=_0x3263fa[_0xdecf27(0xe9)]?await getDbName(_0x5bef55[_0xdecf27(0xc9)],Number(_0x3263fa['dbId']))[_0xdecf27(0xad)](()=>_0x1725fd[_0xdecf27(0xcd)]):_0x1725fd['dbName'];_0x1098c0[_0xdecf27(0xb4)][_0xcf1650[_0xdecf27(0xac)]]={...buildSqlLockEntry(_0x3263fa,_0x3ad01e,_0x676dba,{'dbName':_0x284daf}),'path':_0xcf1650[_0xdecf27(0xb7)],'mode':_0x18c196[_0xdecf27(0xbb)]},await archivePreviousSqlFileIfNeeded(_0x5293f6,_0x18c196[_0xdecf27(0xa9)],_0xcf1650[_0xdecf27(0xb7)]),_0x30eecc[_0xdecf27(0xe0)]({'sqlCode':_0xcf1650[_0xdecf27(0xac)],'remoteId':_0x18c196[_0xdecf27(0xdb)]});}catch(_0x2ddef5){_0x59172f[_0xdecf27(0xe0)]({'sqlCode':_0xcf1650['sqlCode'],'error':_0x2ddef5 instanceof Error?_0x2ddef5[_0xdecf27(0xaa)]:String(_0x2ddef5)});}}_0x1098c0[_0xdecf27(0xd9)]=new Date()[_0xdecf27(0xec)](),await writeSqlLockFile(_0x5293f6[_0xdecf27(0xc1)],_0x2dda38);const _0x42d49c=_0x59172f[_0xdecf27(0xd5)]===0x0,_0x254c21=await runAutomaticDeploymentSync(_0x5bef55,'sql',_0x30eecc[_0xdecf27(0xe2)](_0x2ffc5b=>_0x2ffc5b['sqlCode']),_0x42d49c),_0x3bbdf5=_0x42d49c&&automaticDeploymentSyncSucceeded(_0x254c21),_0x312c69=_0x254c21['configured']?',\x20deployment\x20sync\x20'+_0x254c21[_0xdecf27(0xca)]:'';return{'ok':_0x3bbdf5,'data':{'pushed':_0x30eecc,'skipped':_0x2006f7,'failed':_0x59172f,'deploymentSync':_0x254c21},'message':'Push\x20complete:\x20'+_0x30eecc[_0xdecf27(0xd5)]+_0xdecf27(0xe1)+_0x2006f7[_0xdecf27(0xd5)]+_0xdecf27(0xd1)+_0x59172f[_0xdecf27(0xd5)]+_0xdecf27(0xc8)+_0x312c69};}};async function archivePreviousSqlFileIfNeeded(_0x518632,_0x15d08c,_0xffbdb2){const _0x498f45=a203_0x430d9f;if(!_0x15d08c||_0x15d08c===_0xffbdb2)return;const _0x5f36e1=join(_0x518632[_0x498f45(0xce)],_0x15d08c);if(!await fileExists(_0x5f36e1))return;const _0x192dbd=await moveToTrash(_0x518632['projectRoot'],_0x518632['trashDir'],_0x5f36e1);await cleanupEmptyDirectories(dirname(_0x5f36e1),_0x518632['sqlRootDir']),void _0x192dbd;}async function moveToTrash(_0x321507,_0x143b11,_0x340429){const _0x1966ec=a203_0x430d9f,_0x537eec=new Date()['toISOString']()[_0x1966ec(0xae)](/[:.]/g,'-'),_0xc1a0be=relative(_0x321507,_0x340429),_0x3b5a73=join(_0x143b11,_0x537eec,_0xc1a0be);return await mkdir(dirname(_0x3b5a73),{'recursive':!![]}),await rename(_0x340429,_0x3b5a73),_0x3b5a73;}async function cleanupEmptyDirectories(_0x7b5bdb,_0x4343b7){const _0x5b3595=a203_0x430d9f;let _0x5daad2=resolve(_0x7b5bdb);const _0xfd18b1=resolve(_0x4343b7);while(_0x5daad2['startsWith'](''+_0xfd18b1+sep)||_0x5daad2===_0xfd18b1){if(_0x5daad2===_0xfd18b1)return;try{const _0x71fac8=await readdir(_0x5daad2);if(_0x71fac8[_0x5b3595(0xd5)]>0x0)return;await rmdir(_0x5daad2);}catch{return;}_0x5daad2=dirname(_0x5daad2);}}async function resolveTargetDbBinding(_0xe2eea6,_0x4f6ba6,_0x458e85){const _0xe7bead=a203_0x430d9f,_0x35e7aa=_0x4f6ba6[_0xe7bead(0xb0)];if(!_0x35e7aa)return{'dbId':_0x458e85['dbId'],'dbName':_0x458e85[_0xe7bead(0xcd)]};const _0x20c85b=buildDbDirectoryName(_0x458e85[_0xe7bead(0xcd)],_0x458e85[_0xe7bead(0xe9)]);if(_0x35e7aa===_0x20c85b)return{'dbId':_0x458e85[_0xe7bead(0xe9)],'dbName':_0x458e85[_0xe7bead(0xcd)]};const _0x339294=parseExplicitDbDirectory(_0x35e7aa);if(_0x339294!=null)return{'dbId':_0x339294,'dbName':await getDbName(_0xe2eea6,_0x339294)[_0xe7bead(0xad)](()=>undefined)};const _0x562b71=await listDatabases(_0xe2eea6),_0x342aa7=_0x562b71[_0xe7bead(0xda)](_0x3f6178=>buildDbDirectoryName(_0x3f6178[_0xe7bead(0xcd)],_0x3f6178[_0xe7bead(0xe9)])===_0x35e7aa);if(_0x342aa7[_0xe7bead(0xd5)]===0x1)return{'dbId':_0x342aa7[0x0][_0xe7bead(0xe9)],'dbName':_0x342aa7[0x0][_0xe7bead(0xcd)]};if(_0x342aa7[_0xe7bead(0xd5)]===0x0)throw CliErrors['validation'](_0xe7bead(0xc4)+_0x35e7aa+_0xe7bead(0xb8)+_0x4f6ba6[_0xe7bead(0xac)]+'.');const _0x27db1a=_0x342aa7['map'](_0x4f8255=>_0x4f8255['dbName']+'\x20('+_0x4f8255['dbId']+')')[_0xe7bead(0xcf)](',\x20');throw CliErrors[_0xe7bead(0xc6)](_0xe7bead(0xd4)+_0x35e7aa+_0xe7bead(0xd0)+_0x4f6ba6[_0xe7bead(0xac)]+':\x20'+_0x27db1a);}function parseExplicitDbDirectory(_0x5041b8){const _0x20fc7b=a203_0x430d9f,_0x3c1baf=/^db-(\d+)$/[_0x20fc7b(0xb1)](_0x5041b8);if(!_0x3c1baf)return null;const _0x4a6f5b=Number(_0x3c1baf[0x1]);return Number[_0x20fc7b(0xd2)](_0x4a6f5b)&&_0x4a6f5b>0x0?_0x4a6f5b:null;}
@@ -1 +1 @@
1
- const a198_0x16af62=a198_0x17c3;(function(_0x93786a,_0x54a888){const _0x1aeb78=a198_0x17c3,_0x5052df=_0x93786a();while(!![]){try{const _0x2e9ff2=-parseInt(_0x1aeb78(0xac))/0x1*(parseInt(_0x1aeb78(0x9a))/0x2)+parseInt(_0x1aeb78(0x80))/0x3+-parseInt(_0x1aeb78(0xa3))/0x4*(-parseInt(_0x1aeb78(0x94))/0x5)+-parseInt(_0x1aeb78(0xa6))/0x6+parseInt(_0x1aeb78(0xa9))/0x7*(parseInt(_0x1aeb78(0x9d))/0x8)+parseInt(_0x1aeb78(0x81))/0x9*(-parseInt(_0x1aeb78(0x97))/0xa)+parseInt(_0x1aeb78(0x87))/0xb;if(_0x2e9ff2===_0x54a888)break;else _0x5052df['push'](_0x5052df['shift']());}catch(_0x2f7218){_0x5052df['push'](_0x5052df['shift']());}}}(a198_0x4297,0x8a472));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=a198_0x16af62(0x82);export function buildSqlLockEntry(_0x458d69,_0x2ec3c0,_0x12f207,_0x5a5b8f){const _0x14670b=a198_0x16af62,_0x510994=detectSqlMode(_0x2ec3c0);return{'path':buildSqlRelativePath(_0x458d69['sqlCode'],_0x458d69[_0x14670b(0x95)],_0x5a5b8f?.[_0x14670b(0x88)],_0x510994,_0x458d69[_0x14670b(0xa0)]),'hash':_0x12f207,'remoteId':_0x458d69['id'],'version':_0x458d69[_0x14670b(0xad)],'dbId':Number(_0x458d69[_0x14670b(0xa0)]),'dbName':_0x5a5b8f?.[_0x14670b(0x88)],'sqlName':_0x458d69[_0x14670b(0x95)],'sqlConfig':_0x458d69[_0x14670b(0x93)]??undefined,'mode':_0x510994};}export function cloneSqlLockData(_0x5815ad){const _0x5c8729=a198_0x16af62;return{'apps':Object[_0x5c8729(0x91)](Object['entries'](_0x5815ad[_0x5c8729(0xab)])[_0x5c8729(0x9e)](([_0x156bc2,_0x49ade9])=>[_0x156bc2,{'sqlRoot':_0x49ade9['sqlRoot'],'lastSync':_0x49ade9[_0x5c8729(0x9c)],'sqls':{..._0x49ade9[_0x5c8729(0x8b)]}}]))};}function a198_0x4297(){const _0xa740f=['1203513sofBWf','481392JcAchE','.rabetbase/sql','toLowerCase','trimStart','trim','filter','7746101tIlyhm','dbName','sqlContent','description','sqls','test','--\x20@lovrabet.','question','includes','mybatisXml','fromEntries','replace','sqlConfig','5geGLGf','sqlName','push','60jwaKRh','path','endsWith','6azCIyp','syncedAt','lastSync','5999096yNFqdA','map','length','dbId','\x20-->','join','2971132FriNtN','close','sqlCode','6096462CBzSrD','mode','\x20[y/N]\x20','7BHAAje','split','apps','231547WKFlsE','version'];a198_0x4297=function(){return _0xa740f;};return a198_0x4297();}export function ensureRemoteSqlContent(_0x4e9325){const _0x5d247f=a198_0x16af62;return _0x4e9325[_0x5d247f(0x89)]??'';}export function buildLocalSqlFileContent(_0x5b0521,_0x418a19,_0x18207d){const _0x2ceb33=a198_0x16af62,_0x99b06d=_0x18207d?.['mode']??detectSqlMode(_0x418a19),_0x1961fd=stripLocalSqlMetadata(_0x418a19,_0x99b06d)['trim'](),_0x1dbf2c=[...buildMetadataHeaderLines({'sqlCode':_0x5b0521['sqlCode'],'sqlName':_0x5b0521['sqlName'],'dbId':_0x5b0521[_0x2ceb33(0xa0)],'dbName':_0x18207d?.[_0x2ceb33(0x88)],'mode':_0x99b06d,'syncedAt':_0x18207d?.[_0x2ceb33(0x9b)],'description':_0x18207d?.[_0x2ceb33(0x8a)]},_0x99b06d),'',_0x1961fd],_0x4a7029=_0x1dbf2c[_0x2ceb33(0xa2)]('\x0a');return _0x4a7029[_0x2ceb33(0x99)]('\x0a')?_0x4a7029:_0x4a7029+'\x0a';}export function stripLocalSqlMetadata(_0x42d76f,_0x41e20a){const _0x3906a9=a198_0x16af62,_0x1d23db=_0x42d76f[_0x3906a9(0x92)](/\r\n/g,'\x0a')[_0x3906a9(0xaa)]('\x0a'),_0x59f00d=[];let _0x1bec55=0x0;if(_0x41e20a==='mybatisXml')while(_0x1bec55<_0x1d23db[_0x3906a9(0x9f)]){const _0x153983=_0x1d23db[_0x1bec55]??'';if(/^\s*<!--\s*@lovrabet\./['test'](_0x153983)){_0x1bec55++;continue;}if(_0x153983[_0x3906a9(0x85)]()===''&&_0x1bec55>0x0){_0x1bec55++;continue;}break;}else while(_0x1bec55<_0x1d23db[_0x3906a9(0x9f)]){const _0x4e2482=_0x1d23db[_0x1bec55]??'';if(/^\s*--\s*@lovrabet\./[_0x3906a9(0x8c)](_0x4e2482)){_0x1bec55++;continue;}if(_0x4e2482[_0x3906a9(0x85)]()===''&&_0x1bec55>0x0){_0x1bec55++;continue;}break;}for(;_0x1bec55<_0x1d23db[_0x3906a9(0x9f)];_0x1bec55++){_0x59f00d[_0x3906a9(0x96)](_0x1d23db[_0x1bec55]);}return _0x59f00d[_0x3906a9(0xa2)]('\x0a')[_0x3906a9(0x84)]();}export function resolveSqlMode(_0x58e347,_0x5bad06){const _0x594e29=a198_0x16af62;if(_0x5bad06?.[_0x594e29(0xa7)])return _0x5bad06[_0x594e29(0xa7)];return detectSqlMode(_0x58e347);}export function resolveSqlFileName(_0x333267,_0x4012e9,_0x54039d){const _0x549ae3=a198_0x16af62;if(_0x54039d?.[_0x549ae3(0x98)])return _0x54039d[_0x549ae3(0x98)];if(_0x54039d?.[_0x549ae3(0x95)]||_0x54039d?.['dbName'])return buildSqlRelativePath(_0x333267,_0x54039d?.[_0x549ae3(0x95)],_0x54039d?.[_0x549ae3(0x88)],resolveSqlMode(_0x4012e9,_0x54039d),_0x54039d?.[_0x549ae3(0xa0)]);return buildDefaultSqlFileName(_0x333267,resolveSqlMode(_0x4012e9,_0x54039d));}function a198_0x17c3(_0x149ce7,_0x30856a){_0x149ce7=_0x149ce7-0x80;const _0x42979f=a198_0x4297();let _0x17c335=_0x42979f[_0x149ce7];return _0x17c335;}export function resolveSqlLocalDir(_0x19975f,_0x273ea1){return join(_0x19975f,SQL_LOCAL_REL_DIR,_0x273ea1);}export async function confirmForceOverwrite(_0x421f20){const _0x178a9c=a198_0x16af62,_0x430a93=createInterface({'input':process['stdin'],'output':process['stderr']}),_0x4e0821=await new Promise(_0x1a798b=>{const _0x5077b9=a198_0x17c3;_0x430a93[_0x5077b9(0x8e)](_0x421f20+_0x5077b9(0xa8),_0x1a798b);});return _0x430a93[_0x178a9c(0xa4)](),['y','yes'][_0x178a9c(0x8f)](_0x4e0821[_0x178a9c(0x85)]()[_0x178a9c(0x83)]());}export function findSqlLockScope(_0x52aed6,_0x42cb17){const _0x4a42f0=a198_0x16af62;return _0x52aed6[_0x4a42f0(0xab)][_0x42cb17];}function buildMetadataHeaderLines(_0x2c11f7,_0x112274){const _0x5253c0=a198_0x16af62,_0x1c7161=[['sqlCode',_0x2c11f7[_0x5253c0(0xa5)]],[_0x5253c0(0x95),_0x2c11f7[_0x5253c0(0x95)]],[_0x5253c0(0xa0),_0x2c11f7[_0x5253c0(0xa0)]],[_0x5253c0(0x88),_0x2c11f7['dbName']],['mode',_0x2c11f7[_0x5253c0(0xa7)]],['syncedAt',_0x2c11f7[_0x5253c0(0x9b)]],[_0x5253c0(0x8a),_0x2c11f7[_0x5253c0(0x8a)]]];if(_0x112274===_0x5253c0(0x90))return _0x1c7161[_0x5253c0(0x86)](([,_0x2220ef])=>_0x2220ef!==undefined&&_0x2220ef!==null&&String(_0x2220ef)['trim']()!=='')[_0x5253c0(0x9e)](([_0x167173,_0x4ad573])=>'<!--\x20@lovrabet.'+_0x167173+':\x20'+String(_0x4ad573)+_0x5253c0(0xa1));return _0x1c7161[_0x5253c0(0x86)](([,_0x2cd5a4])=>_0x2cd5a4!==undefined&&_0x2cd5a4!==null&&String(_0x2cd5a4)['trim']()!=='')[_0x5253c0(0x9e)](([_0x5149bc,_0x3c5c78])=>_0x5253c0(0x8d)+_0x5149bc+':\x20'+String(_0x3c5c78));}
1
+ const a204_0x23ecdd=a204_0x2321;function a204_0x2321(_0x2e3367,_0x6db48a){_0x2e3367=_0x2e3367-0xfc;const _0xe020d7=a204_0xe020();let _0x2321c1=_0xe020d7[_0x2e3367];return _0x2321c1;}(function(_0x3f43e0,_0x265645){const _0x2486b3=a204_0x2321,_0x3d7043=_0x3f43e0();while(!![]){try{const _0x1db213=-parseInt(_0x2486b3(0x105))/0x1*(-parseInt(_0x2486b3(0x11a))/0x2)+parseInt(_0x2486b3(0x10d))/0x3*(-parseInt(_0x2486b3(0xfd))/0x4)+-parseInt(_0x2486b3(0x104))/0x5+parseInt(_0x2486b3(0x10e))/0x6*(-parseInt(_0x2486b3(0x109))/0x7)+parseInt(_0x2486b3(0x11c))/0x8*(parseInt(_0x2486b3(0x120))/0x9)+-parseInt(_0x2486b3(0x10b))/0xa*(-parseInt(_0x2486b3(0x106))/0xb)+parseInt(_0x2486b3(0x129))/0xc;if(_0x1db213===_0x265645)break;else _0x3d7043['push'](_0x3d7043['shift']());}catch(_0x2de9c1){_0x3d7043['push'](_0x3d7043['shift']());}}}(a204_0xe020,0xdc5a2));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=a204_0x23ecdd(0x100);export function buildSqlLockEntry(_0x153fad,_0xb23d73,_0x2a8189,_0x587106){const _0x24e24a=a204_0x23ecdd,_0x51114f=detectSqlMode(_0xb23d73);return{'path':buildSqlRelativePath(_0x153fad[_0x24e24a(0xfe)],_0x153fad['sqlName'],_0x587106?.[_0x24e24a(0x117)],_0x51114f,_0x153fad[_0x24e24a(0x124)]),'hash':_0x2a8189,'remoteId':_0x153fad['id'],'version':_0x153fad[_0x24e24a(0x103)],'dbId':Number(_0x153fad[_0x24e24a(0x124)]),'dbName':_0x587106?.[_0x24e24a(0x117)],'sqlName':_0x153fad[_0x24e24a(0x11f)],'sqlConfig':_0x153fad['sqlConfig']??undefined,'mode':_0x51114f};}export function cloneSqlLockData(_0x57a992){const _0x567832=a204_0x23ecdd;return{'apps':Object[_0x567832(0x111)](Object[_0x567832(0x110)](_0x57a992[_0x567832(0x102)])[_0x567832(0x11b)](([_0x32abea,_0x578461])=>[_0x32abea,{'sqlRoot':_0x578461[_0x567832(0x128)],'lastSync':_0x578461[_0x567832(0x118)],'sqls':{..._0x578461[_0x567832(0x113)]}}]))};}export function ensureRemoteSqlContent(_0x1f5cc9){return _0x1f5cc9['sqlContent']??'';}export function buildLocalSqlFileContent(_0x23f57d,_0x180245,_0xfcc808){const _0x537eb3=a204_0x23ecdd,_0x2410d4=_0xfcc808?.[_0x537eb3(0x114)]??detectSqlMode(_0x180245),_0x1de802=stripLocalSqlMetadata(_0x180245,_0x2410d4)[_0x537eb3(0x115)](),_0x440ab9=[...buildMetadataHeaderLines({'sqlCode':_0x23f57d['sqlCode'],'sqlName':_0x23f57d[_0x537eb3(0x11f)],'dbId':_0x23f57d[_0x537eb3(0x124)],'dbName':_0xfcc808?.['dbName'],'mode':_0x2410d4,'syncedAt':_0xfcc808?.[_0x537eb3(0xfc)],'description':_0xfcc808?.[_0x537eb3(0x116)]},_0x2410d4),'',_0x1de802],_0x105daf=_0x440ab9[_0x537eb3(0x126)]('\x0a');return _0x105daf['endsWith']('\x0a')?_0x105daf:_0x105daf+'\x0a';}export function stripLocalSqlMetadata(_0xb284b2,_0x30c804){const _0x4a3f30=a204_0x23ecdd,_0x6caa68=_0xb284b2[_0x4a3f30(0x101)](/\r\n/g,'\x0a')[_0x4a3f30(0x108)]('\x0a'),_0x190084=[];let _0x45bd5b=0x0;if(_0x30c804===_0x4a3f30(0x122))while(_0x45bd5b<_0x6caa68[_0x4a3f30(0x11d)]){const _0x26ac2a=_0x6caa68[_0x45bd5b]??'';if(/^\s*<!--\s*@lovrabet\./[_0x4a3f30(0x127)](_0x26ac2a)){_0x45bd5b++;continue;}if(_0x26ac2a[_0x4a3f30(0x115)]()===''&&_0x45bd5b>0x0){_0x45bd5b++;continue;}break;}else while(_0x45bd5b<_0x6caa68[_0x4a3f30(0x11d)]){const _0xd7e206=_0x6caa68[_0x45bd5b]??'';if(/^\s*--\s*@lovrabet\./[_0x4a3f30(0x127)](_0xd7e206)){_0x45bd5b++;continue;}if(_0xd7e206[_0x4a3f30(0x115)]()===''&&_0x45bd5b>0x0){_0x45bd5b++;continue;}break;}for(;_0x45bd5b<_0x6caa68[_0x4a3f30(0x11d)];_0x45bd5b++){_0x190084[_0x4a3f30(0x107)](_0x6caa68[_0x45bd5b]);}return _0x190084[_0x4a3f30(0x126)]('\x0a')[_0x4a3f30(0xff)]();}export function resolveSqlMode(_0x37a50b,_0x483331){const _0x1ca1ee=a204_0x23ecdd;if(_0x483331?.[_0x1ca1ee(0x114)])return _0x483331[_0x1ca1ee(0x114)];return detectSqlMode(_0x37a50b);}export function resolveSqlFileName(_0x105242,_0x5c741b,_0x1b6ad8){const _0x1cffad=a204_0x23ecdd;if(_0x1b6ad8?.[_0x1cffad(0x10a)])return _0x1b6ad8[_0x1cffad(0x10a)];if(_0x1b6ad8?.[_0x1cffad(0x11f)]||_0x1b6ad8?.[_0x1cffad(0x117)])return buildSqlRelativePath(_0x105242,_0x1b6ad8?.[_0x1cffad(0x11f)],_0x1b6ad8?.[_0x1cffad(0x117)],resolveSqlMode(_0x5c741b,_0x1b6ad8),_0x1b6ad8?.[_0x1cffad(0x124)]);return buildDefaultSqlFileName(_0x105242,resolveSqlMode(_0x5c741b,_0x1b6ad8));}function a204_0xe020(){const _0x4606ce=['map','2221160BtSLIX','length','stderr','sqlName','18nDHgsM','toLowerCase','mybatisXml','includes','dbId','filter','join','test','sqlRoot','33132168InmYkF','syncedAt','5836228XRjVji','sqlCode','trimStart','.rabetbase/sql','replace','apps','version','8926035icGoTz','1iyEYcZ','11JHLPrf','push','split','28toWLjs','path','8659430jgmeai','\x20[y/N]\x20','3VdTmfM','185118RIxxKg','close','entries','fromEntries','<!--\x20@lovrabet.','sqls','mode','trim','description','dbName','lastSync','stdin','175982JGmeHa'];a204_0xe020=function(){return _0x4606ce;};return a204_0xe020();}export function resolveSqlLocalDir(_0x2fbd13,_0x46f7cf){return join(_0x2fbd13,SQL_LOCAL_REL_DIR,_0x46f7cf);}export async function confirmForceOverwrite(_0x33b6eb){const _0x23fbef=a204_0x23ecdd,_0xe730cb=createInterface({'input':process[_0x23fbef(0x119)],'output':process[_0x23fbef(0x11e)]}),_0x56915f=await new Promise(_0x245c52=>{const _0x8263ed=_0x23fbef;_0xe730cb['question'](_0x33b6eb+_0x8263ed(0x10c),_0x245c52);});return _0xe730cb[_0x23fbef(0x10f)](),['y','yes'][_0x23fbef(0x123)](_0x56915f['trim']()[_0x23fbef(0x121)]());}export function findSqlLockScope(_0x21602c,_0x585ef3){const _0x546eca=a204_0x23ecdd;return _0x21602c[_0x546eca(0x102)][_0x585ef3];}function buildMetadataHeaderLines(_0x17da0c,_0x5832c9){const _0x42715f=a204_0x23ecdd,_0x3ca6d1=[[_0x42715f(0xfe),_0x17da0c[_0x42715f(0xfe)]],[_0x42715f(0x11f),_0x17da0c['sqlName']],[_0x42715f(0x124),_0x17da0c['dbId']],['dbName',_0x17da0c['dbName']],[_0x42715f(0x114),_0x17da0c['mode']],[_0x42715f(0xfc),_0x17da0c[_0x42715f(0xfc)]],[_0x42715f(0x116),_0x17da0c[_0x42715f(0x116)]]];if(_0x5832c9===_0x42715f(0x122))return _0x3ca6d1[_0x42715f(0x125)](([,_0x36e9a1])=>_0x36e9a1!==undefined&&_0x36e9a1!==null&&String(_0x36e9a1)['trim']()!=='')[_0x42715f(0x11b)](([_0x2c84ac,_0x1e9064])=>_0x42715f(0x112)+_0x2c84ac+':\x20'+String(_0x1e9064)+'\x20-->');return _0x3ca6d1[_0x42715f(0x125)](([,_0x1f3398])=>_0x1f3398!==undefined&&_0x1f3398!==null&&String(_0x1f3398)['trim']()!=='')[_0x42715f(0x11b)](([_0x459ba9,_0x5a0036])=>'--\x20@lovrabet.'+_0x459ba9+':\x20'+String(_0x5a0036));}
@@ -1 +1 @@
1
- const a199_0x1ce234=a199_0x4494;(function(_0x28d858,_0x4c795a){const _0xac3120=a199_0x4494,_0x24b81b=_0x28d858();while(!![]){try{const _0x5b10c5=-parseInt(_0xac3120(0x83))/0x1+parseInt(_0xac3120(0x88))/0x2*(parseInt(_0xac3120(0x93))/0x3)+parseInt(_0xac3120(0x8b))/0x4*(parseInt(_0xac3120(0x9f))/0x5)+-parseInt(_0xac3120(0xa5))/0x6+-parseInt(_0xac3120(0x7e))/0x7*(-parseInt(_0xac3120(0x9e))/0x8)+parseInt(_0xac3120(0x82))/0x9*(-parseInt(_0xac3120(0x8d))/0xa)+parseInt(_0xac3120(0x85))/0xb*(parseInt(_0xac3120(0x80))/0xc);if(_0x5b10c5===_0x4c795a)break;else _0x24b81b['push'](_0x24b81b['shift']());}catch(_0x243caa){_0x24b81b['push'](_0x24b81b['shift']());}}}(a199_0x218c,0xe9303));function a199_0x218c(){const _0x249226=['status','\x20missing,\x20','sqls','\x20modified,\x20','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','paging','\x20remote-only','sqlName','totalCount','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','252304iWzXvL','209555zdbtqp','length','sql','boolean','lockFilePath','appCode','2058606bsbaHq','259hIZMPX','remote','696uwwnPF','lockKey','8532QWOuAE','981163LaBmXx','map','221639cALAlf','hash','sqlRoot','93066kEmwxq','relativePath','sqlCode','48DdkAxi','filePath','7370wMHnrL','\x20added,\x20','\x20unchanged','push','tableData','has','9Qnappg'];a199_0x218c=function(){return _0x249226;};return a199_0x218c();}import{listSqlQueries}from'../../core/api-client.js';function a199_0x4494(_0x48d4b7,_0x4fde61){_0x48d4b7=_0x48d4b7-0x7e;const _0x218c1f=a199_0x218c();let _0x4494fc=_0x218c1f[_0x48d4b7];return _0x4494fc;}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(_0x4c725b){const _0x1d3da5=a199_0x4494,_0x34732a=[];let _0x5e2c80=0x1;while(!![]){const _0x496572=await listSqlQueries(_0x4c725b,{'currentPage':_0x5e2c80,'pageSize':PAGE_SIZE}),_0x3e7509=_0x496572[_0x1d3da5(0x91)]??[];_0x34732a[_0x1d3da5(0x90)](..._0x3e7509[_0x1d3da5(0x84)](_0x17c234=>_0x17c234[_0x1d3da5(0x8a)]));if(_0x3e7509[_0x1d3da5(0xa0)]===0x0)break;const _0x549e26=_0x496572[_0x1d3da5(0x99)]?.[_0x1d3da5(0x9c)];if(_0x549e26!=null?_0x34732a[_0x1d3da5(0xa0)]>=_0x549e26:_0x3e7509[_0x1d3da5(0xa0)]<PAGE_SIZE)break;_0x5e2c80++;}return _0x34732a;}export const sqlStatus={'service':a199_0x1ce234(0xa1),'command':a199_0x1ce234(0x94),'description':a199_0x1ce234(0x98),'risk':'read','flags':[{'name':'remote','type':a199_0x1ce234(0xa2),'description':a199_0x1ce234(0x9d)}],async 'execute'(_0x23c303){const _0x3bb166=a199_0x1ce234,_0x2af0ad=loadSqlProjectConfig(_0x23c303['appCode']),_0x1c83c9=await readSqlLockFile(_0x2af0ad[_0x3bb166(0xa3)]),{appLock:_0x4e5cd1}=ensureSqlLockScope(_0x1c83c9??createEmptySqlLock(),_0x2af0ad['appCode'],_0x2af0ad[_0x3bb166(0x87)],_0x3bb166(0x94)),_0x63ec4b=await scanLocalSqlQueries(_0x2af0ad),_0x4dd94f=[],_0x5c9da9=[],_0x76dec4=[],_0x58a549=[],_0x1cee69=new Set(_0x63ec4b[_0x3bb166(0x84)](_0x377ea4=>_0x377ea4[_0x3bb166(0x81)]));for(const _0x118d6a of _0x63ec4b){const _0x13bc54=await computeSqlFileHash(_0x118d6a[_0x3bb166(0x8c)]),_0x523117=_0x4e5cd1[_0x3bb166(0x96)][_0x118d6a[_0x3bb166(0x81)]],_0x466dd1=!!_0x523117&&_0x523117['path']!==_0x118d6a[_0x3bb166(0x89)],_0x224601=!!_0x523117&&!!_0x118d6a[_0x3bb166(0x9b)]&&_0x523117['sqlName']!==_0x118d6a[_0x3bb166(0x9b)];if(!_0x523117)_0x4dd94f[_0x3bb166(0x90)](_0x118d6a[_0x3bb166(0x81)]);else _0x523117[_0x3bb166(0x86)]!==_0x13bc54||_0x466dd1||_0x224601?_0x5c9da9[_0x3bb166(0x90)](_0x118d6a[_0x3bb166(0x81)]):_0x76dec4[_0x3bb166(0x90)](_0x118d6a[_0x3bb166(0x81)]);}for(const _0x1d53c2 of Object['keys'](_0x4e5cd1['sqls'])){!_0x1cee69[_0x3bb166(0x92)](_0x1d53c2)&&_0x58a549[_0x3bb166(0x90)](_0x1d53c2);}const _0x56112a=[];if(_0x23c303['bool'](_0x3bb166(0x7f))){const _0x357c63=await fetchAllSqlCodes(_0x23c303[_0x3bb166(0xa4)]);for(const _0x3cab5c of _0x357c63){!_0x1cee69[_0x3bb166(0x92)](_0x3cab5c)&&!_0x4e5cd1['sqls'][_0x3cab5c]&&_0x56112a['push'](_0x3cab5c);}}const _0x276624=_0x4dd94f[_0x3bb166(0xa0)]===0x0&&_0x5c9da9[_0x3bb166(0xa0)]===0x0&&_0x58a549['length']===0x0&&_0x56112a[_0x3bb166(0xa0)]===0x0;return{'ok':!![],'data':{'added':_0x4dd94f,'modified':_0x5c9da9,'missing':_0x58a549,'unchanged':_0x76dec4,'remoteOnly':_0x56112a},'message':_0x276624?'All\x20SQL\x20queries\x20are\x20in\x20sync.':_0x4dd94f[_0x3bb166(0xa0)]+_0x3bb166(0x8e)+_0x5c9da9[_0x3bb166(0xa0)]+_0x3bb166(0x97)+_0x58a549['length']+_0x3bb166(0x95)+_0x76dec4[_0x3bb166(0xa0)]+_0x3bb166(0x8f)+(_0x56112a['length']>0x0?',\x20'+_0x56112a[_0x3bb166(0xa0)]+_0x3bb166(0x9a):'')};}};
1
+ const a205_0x35064e=a205_0x3899;(function(_0x3b69dd,_0x583310){const _0x1026a5=a205_0x3899,_0xd58bd4=_0x3b69dd();while(!![]){try{const _0x1ac0d9=-parseInt(_0x1026a5(0x1a3))/0x1+-parseInt(_0x1026a5(0x184))/0x2*(-parseInt(_0x1026a5(0x17e))/0x3)+parseInt(_0x1026a5(0x19d))/0x4*(-parseInt(_0x1026a5(0x17d))/0x5)+-parseInt(_0x1026a5(0x185))/0x6*(parseInt(_0x1026a5(0x194))/0x7)+parseInt(_0x1026a5(0x183))/0x8*(parseInt(_0x1026a5(0x190))/0x9)+parseInt(_0x1026a5(0x18e))/0xa*(-parseInt(_0x1026a5(0x1a2))/0xb)+parseInt(_0x1026a5(0x192))/0xc*(parseInt(_0x1026a5(0x191))/0xd);if(_0x1ac0d9===_0x583310)break;else _0xd58bd4['push'](_0xd58bd4['shift']());}catch(_0x565af3){_0xd58bd4['push'](_0xd58bd4['shift']());}}}(a205_0x423e,0x9b789));import{listSqlQueries}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';function a205_0x3899(_0x5b75ee,_0x3a6497){_0x5b75ee=_0x5b75ee-0x17d;const _0x423e45=a205_0x423e();let _0x3899dc=_0x423e45[_0x5b75ee];return _0x3899dc;}import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;async function fetchAllSqlCodes(_0x365d3c){const _0x1e2da7=a205_0x3899,_0x29e393=[];let _0x140f88=0x1;while(!![]){const _0x3636ca=await listSqlQueries(_0x365d3c,{'currentPage':_0x140f88,'pageSize':PAGE_SIZE}),_0x18b880=_0x3636ca['tableData']??[];_0x29e393[_0x1e2da7(0x18d)](..._0x18b880['map'](_0x45ff22=>_0x45ff22['sqlCode']));if(_0x18b880[_0x1e2da7(0x17f)]===0x0)break;const _0x3aca3a=_0x3636ca['paging']?.[_0x1e2da7(0x18a)];if(_0x3aca3a!=null?_0x29e393['length']>=_0x3aca3a:_0x18b880[_0x1e2da7(0x17f)]<PAGE_SIZE)break;_0x140f88++;}return _0x29e393;}export const sqlStatus={'service':a205_0x35064e(0x186),'command':'status','description':'Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','risk':a205_0x35064e(0x198),'flags':[{'name':a205_0x35064e(0x180),'type':a205_0x35064e(0x19e),'description':a205_0x35064e(0x18f)}],async 'execute'(_0x189c34){const _0x27266b=a205_0x35064e,_0x4283e0=loadSqlProjectConfig(_0x189c34[_0x27266b(0x188)]),_0x29d140=await readSqlLockFile(_0x4283e0[_0x27266b(0x181)]),{appLock:_0x18cb1f}=ensureSqlLockScope(_0x29d140??createEmptySqlLock(),_0x4283e0[_0x27266b(0x188)],_0x4283e0[_0x27266b(0x19b)],'status'),_0x5516b5=await scanLocalSqlQueries(_0x4283e0),_0x179182=[],_0x55bdc4=[],_0x586e4e=[],_0x323a76=[],_0x305e3e=new Set(_0x5516b5[_0x27266b(0x197)](_0x1fd48e=>_0x1fd48e[_0x27266b(0x182)]));for(const _0x43f54b of _0x5516b5){const _0x172011=await computeSqlFileHash(_0x43f54b[_0x27266b(0x195)]),_0x131c03=_0x18cb1f[_0x27266b(0x1a0)][_0x43f54b[_0x27266b(0x182)]],_0x4fe937=!!_0x131c03&&_0x131c03['path']!==_0x43f54b[_0x27266b(0x19a)],_0x5ac6a8=!!_0x131c03&&!!_0x43f54b['sqlName']&&_0x131c03['sqlName']!==_0x43f54b[_0x27266b(0x1a1)];if(!_0x131c03)_0x179182['push'](_0x43f54b['lockKey']);else _0x131c03[_0x27266b(0x18c)]!==_0x172011||_0x4fe937||_0x5ac6a8?_0x55bdc4[_0x27266b(0x18d)](_0x43f54b[_0x27266b(0x182)]):_0x586e4e[_0x27266b(0x18d)](_0x43f54b['lockKey']);}for(const _0x4b58d8 of Object[_0x27266b(0x189)](_0x18cb1f[_0x27266b(0x1a0)])){!_0x305e3e['has'](_0x4b58d8)&&_0x323a76['push'](_0x4b58d8);}const _0x417793=[];if(_0x189c34[_0x27266b(0x19f)](_0x27266b(0x180))){const _0x221c03=await fetchAllSqlCodes(_0x189c34['appCode']);for(const _0x488e2b of _0x221c03){!_0x305e3e[_0x27266b(0x196)](_0x488e2b)&&!_0x18cb1f[_0x27266b(0x1a0)][_0x488e2b]&&_0x417793['push'](_0x488e2b);}}const _0x3f0354=_0x179182[_0x27266b(0x17f)]===0x0&&_0x55bdc4[_0x27266b(0x17f)]===0x0&&_0x323a76[_0x27266b(0x17f)]===0x0&&_0x417793[_0x27266b(0x17f)]===0x0;return{'ok':!![],'data':{'added':_0x179182,'modified':_0x55bdc4,'missing':_0x323a76,'unchanged':_0x586e4e,'remoteOnly':_0x417793},'message':_0x3f0354?_0x27266b(0x193):_0x179182[_0x27266b(0x17f)]+_0x27266b(0x19c)+_0x55bdc4['length']+_0x27266b(0x18b)+_0x323a76[_0x27266b(0x17f)]+_0x27266b(0x187)+_0x586e4e[_0x27266b(0x17f)]+_0x27266b(0x199)+(_0x417793[_0x27266b(0x17f)]>0x0?',\x20'+_0x417793[_0x27266b(0x17f)]+'\x20remote-only':'')};}};function a205_0x423e(){const _0x41858e=['13OsJIrf','487164JcqgTi','All\x20SQL\x20queries\x20are\x20in\x20sync.','25809yjLoCb','filePath','has','map','read','\x20unchanged','relativePath','sqlRoot','\x20added,\x20','4168wqfPTj','boolean','bool','sqls','sqlName','2412091hOvRfA','402117nnHPaB','70vBBKSO','3OOlwIg','length','remote','lockFilePath','lockKey','152qpNBUL','2033398awCZBI','186MDajOA','sql','\x20missing,\x20','appCode','keys','totalCount','\x20modified,\x20','hash','push','40tMMKzm','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','467829lqsdwA'];a205_0x423e=function(){return _0x41858e;};return a205_0x423e();}
@@ -1 +1 @@
1
- const a200_0x117e9f=a200_0x3b51;(function(_0x2ec054,_0x5f4d02){const _0x209a2c=a200_0x3b51,_0x5465f5=_0x2ec054();while(!![]){try{const _0x29c703=-parseInt(_0x209a2c(0x228))/0x1+parseInt(_0x209a2c(0x214))/0x2*(parseInt(_0x209a2c(0x22c))/0x3)+parseInt(_0x209a2c(0x21d))/0x4+parseInt(_0x209a2c(0x227))/0x5+-parseInt(_0x209a2c(0x1f5))/0x6*(-parseInt(_0x209a2c(0x1fa))/0x7)+-parseInt(_0x209a2c(0x225))/0x8*(-parseInt(_0x209a2c(0x223))/0x9)+-parseInt(_0x209a2c(0x1fe))/0xa;if(_0x29c703===_0x5f4d02)break;else _0x5465f5['push'](_0x5465f5['shift']());}catch(_0x58794b){_0x5465f5['push'](_0x5465f5['shift']());}}}(a200_0x3025,0xe7790));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';function a200_0x3025(){const _0xe477a=['3231728xBVAlC','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','string','tables','indexes','Provide\x20--file\x20or\x20--sql','252BgERYZ','length','131776WJrjOE','type','8930480DlAqMd','1666079iCZdhB','validate','columnNames','cwd','3FzvCHx','schemas','Dataset\x20\x22','appCode','Audit\x20top-level\x20JOIN\x20equality\x20predicates\x20against\x20dataset\x20index\x20metadata','trim','from','message','flagMissing','sql','get','reason','filter','push','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','flatMap','1686FbGBqy','size','pkField','index_name','dbtableConfig','39186fGGsCB','File\x20not\x20found:\x20','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','unshift','34984680VFGHdt','file','utf-8','toLowerCase','primary','\x22\x20not\x20found\x20in\x20any\x20dataset','split','index_columns','validation','parameters','sqlType','str','bool','isSelectOnly','isDangerous','columns','tableName','indexName','dataset','map','\x22\x20not\x20found\x20or\x20not\x20accessible','schemaWarnings','2968754yoASMv','isArray','valid','name','joinAudit','fields','read','find','check-indexes'];a200_0x3025=function(){return _0xe477a;};return a200_0x3025();}import{auditSqlJoinIndexes}from'../../core/sql-index-auditor.js';function a200_0x3b51(_0x525386,_0x485acc){_0x525386=_0x525386-0x1e6;const _0x3025d5=a200_0x3025();let _0x3b512f=_0x3025d5[_0x525386];return _0x3b512f;}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':a200_0x117e9f(0x1ee),'command':a200_0x117e9f(0x229),'description':a200_0x117e9f(0x21e),'risk':a200_0x117e9f(0x21a),'flags':[{'name':a200_0x117e9f(0x1ff),'type':a200_0x117e9f(0x21f),'description':a200_0x117e9f(0x1f3)},{'name':a200_0x117e9f(0x1ee),'type':a200_0x117e9f(0x21f),'description':a200_0x117e9f(0x1fc)},{'name':a200_0x117e9f(0x1e6),'type':'string','description':'Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against'},{'name':a200_0x117e9f(0x21c),'type':'boolean','description':a200_0x117e9f(0x1e9)}],async 'execute'(_0x526cdf){const _0x46135b=a200_0x117e9f,_0x5ad3a1=_0x526cdf['str']('file'),_0x5ddba5=_0x526cdf[_0x46135b(0x209)](_0x46135b(0x1ee)),_0x51c5b7=_0x526cdf[_0x46135b(0x209)](_0x46135b(0x1e6)),_0x42459a=_0x526cdf[_0x46135b(0x20a)]('check-indexes');if(!_0x5ad3a1&&!_0x5ddba5)throw CliErrors[_0x46135b(0x1ed)](_0x46135b(0x1ff),_0x46135b(0x222));if(_0x42459a&&!_0x51c5b7)throw CliErrors[_0x46135b(0x206)]('--check-indexes\x20requires\x20--schemas.');let _0x59561f;if(_0x5ad3a1){const _0x4e0778=resolve(process[_0x46135b(0x22b)](),_0x5ad3a1);if(!existsSync(_0x4e0778))throw CliErrors[_0x46135b(0x206)](_0x46135b(0x1fb)+_0x4e0778);_0x59561f=readFileSync(_0x4e0778,_0x46135b(0x200));}else _0x59561f=_0x5ddba5;const _0x1d232a=validateSql(_0x59561f),_0x47ec2a={'valid':_0x1d232a[_0x46135b(0x216)],'sqlType':_0x1d232a[_0x46135b(0x208)][_0x46135b(0x226)],'isSelectOnly':_0x1d232a[_0x46135b(0x208)][_0x46135b(0x20b)],'isDangerous':_0x1d232a['sqlType'][_0x46135b(0x20c)],'tables':_0x1d232a[_0x46135b(0x220)],'parameters':_0x1d232a[_0x46135b(0x207)],'message':_0x1d232a[_0x46135b(0x1ec)]};_0x1d232a['sqlType'][_0x46135b(0x1f0)]&&(_0x47ec2a[_0x46135b(0x1f0)]=_0x1d232a['sqlType'][_0x46135b(0x1f0)]);if(_0x51c5b7&&_0x1d232a[_0x46135b(0x216)]){const _0xee5ccb=_0x51c5b7[_0x46135b(0x204)](',')['map'](_0x2b3361=>_0x2b3361[_0x46135b(0x1ea)]())[_0x46135b(0x1f1)](Boolean),_0xcd760a=[],_0x23cf7e=[],_0x83f2ca=filterDbTableBackedDatasets(await listDatasets(_0x526cdf[_0x46135b(0x1e8)])),_0x2cdebf=new Map(_0x83f2ca[_0x46135b(0x211)](_0x851114=>[_0x851114['dbtableConfig']?.[_0x46135b(0x20e)]?.[_0x46135b(0x201)](),_0x851114]));for(const _0x44df9e of _0x1d232a['tables']){const _0x578928=_0x2cdebf[_0x46135b(0x1ef)](_0x44df9e[_0x46135b(0x201)]());!_0x578928&&_0xcd760a[_0x46135b(0x1f2)]('Table\x20\x22'+_0x44df9e+_0x46135b(0x203));}for(const _0x37c0a7 of _0xee5ccb){let _0x4befaa;try{_0x4befaa=await getDatasetDetail(_0x37c0a7);}catch{_0xcd760a[_0x46135b(0x1f2)](_0x46135b(0x1e7)+_0x37c0a7+_0x46135b(0x212));continue;}assertDatasetIsDbTableBacked(_0x4befaa,'SQL\x20schema\x20validation');const _0x8a9f5d=Array[_0x46135b(0x215)](_0x4befaa[_0x46135b(0x219)])?_0x4befaa[_0x46135b(0x219)]:[],_0x2bbd6c=new Set(_0x8a9f5d[_0x46135b(0x211)](_0xcd9b06=>_0xcd9b06[_0x46135b(0x217)]?.[_0x46135b(0x201)]())),_0x5785db=_0x4befaa[_0x46135b(0x1f9)]?.[_0x46135b(0x20e)]||_0x4befaa[_0x46135b(0x20e)]||_0x37c0a7;_0x47ec2a['schema:'+_0x5785db]={'code':_0x37c0a7,'tableName':_0x5785db,'fieldCount':_0x2bbd6c[_0x46135b(0x1f6)],'fields':Array[_0x46135b(0x1eb)](_0x2bbd6c)};if(_0x42459a){const _0x318f7b=normalizeDatasetIndexes(_0x4befaa);_0x23cf7e[_0x46135b(0x1f2)]({'tableName':_0x5785db,..._0x318f7b});}}_0xcd760a['length']>0x0&&(_0x47ec2a[_0x46135b(0x213)]=_0xcd760a),_0x42459a&&(_0x47ec2a[_0x46135b(0x218)]=auditSqlJoinIndexes(_0x59561f,_0x23cf7e));}return{'ok':_0x1d232a['valid'],'data':_0x47ec2a,'message':_0x1d232a[_0x46135b(0x1ec)]};}};function normalizeDatasetIndexes(_0x19d048){const _0x591d4e=a200_0x117e9f,_0x53989d=Array[_0x591d4e(0x215)](_0x19d048?.[_0x591d4e(0x210)]?.[_0x591d4e(0x221)])?_0x19d048[_0x591d4e(0x210)][_0x591d4e(0x221)]:Array[_0x591d4e(0x215)](_0x19d048?.[_0x591d4e(0x221)])?_0x19d048[_0x591d4e(0x221)]:[],_0x55e357=_0x53989d[_0x591d4e(0x1f4)](_0x2fa03e=>{const _0x48c631=_0x591d4e,_0x2ad5bc=Array['isArray'](_0x2fa03e?.[_0x48c631(0x205)])?_0x2fa03e[_0x48c631(0x205)]:Array['isArray'](_0x2fa03e?.[_0x48c631(0x22a)])?_0x2fa03e['columnNames']:Array[_0x48c631(0x215)](_0x2fa03e?.[_0x48c631(0x20d)])?_0x2fa03e['columns']:[],_0x204369=_0x2ad5bc['filter'](_0x52a608=>typeof _0x52a608===_0x48c631(0x21f))[_0x48c631(0x211)](_0x4ee1b6=>_0x4ee1b6[_0x48c631(0x1ea)]())[_0x48c631(0x1f1)](Boolean);if(_0x204369[_0x48c631(0x224)]===0x0)return[];const _0x97ccf2=[_0x2fa03e?.[_0x48c631(0x20f)],_0x2fa03e?.[_0x48c631(0x1f8)],_0x2fa03e?.[_0x48c631(0x217)]][_0x48c631(0x21b)](_0x53dfb3=>typeof _0x53dfb3===_0x48c631(0x21f)&&_0x53dfb3[_0x48c631(0x1ea)]()),_0x2e832f=[_0x2fa03e?.['index_type'],_0x2fa03e?.['type']][_0x48c631(0x21b)](_0x387d9e=>typeof _0x387d9e===_0x48c631(0x21f)&&_0x387d9e[_0x48c631(0x1ea)]());return[{..._0x97ccf2?{'name':_0x97ccf2[_0x48c631(0x1ea)]()}:{},..._0x2e832f?{'type':_0x2e832f['trim']()}:{},'columns':_0x204369}];}),_0x37657f=[..._0x55e357],_0x3dc48d=typeof _0x19d048?.[_0x591d4e(0x1f9)]?.[_0x591d4e(0x1f7)]===_0x591d4e(0x21f)?_0x19d048[_0x591d4e(0x1f9)][_0x591d4e(0x1f7)][_0x591d4e(0x204)](',')[_0x591d4e(0x211)](_0x513fae=>_0x513fae[_0x591d4e(0x1ea)]())[_0x591d4e(0x1f1)](Boolean):[];return _0x3dc48d[_0x591d4e(0x224)]>0x0&&_0x37657f[_0x591d4e(0x1fd)]({'type':_0x591d4e(0x202),'columns':_0x3dc48d}),{'indexes':_0x37657f,'metadataAvailable':_0x55e357['length']>0x0};}
1
+ function a206_0x1e95(){const _0x21267e=['flagMissing','Dataset\x20\x22','\x22\x20not\x20found\x20or\x20not\x20accessible','index_type','588087qewYPY','10bYrXnB','528610zccPTa','bool','valid','map','name','index_name','message','trim','820308Bvstbu','isSelectOnly','192782UDmTBX','columnNames','schemas','12RyYFMt','fields','51732Bltycc','sqlType','Audit\x20top-level\x20JOIN\x20equality\x20predicates\x20against\x20dataset\x20index\x20metadata','SQL\x20schema\x20validation','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','dbtableConfig','1239892XKaCWJ','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','type','parameters','split','isDangerous','filter','size','unshift','File\x20not\x20found:\x20','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','validation','66nbfRAM','schema:','526112AakifH','columns','tables','utf-8','toLowerCase','Table\x20\x22','pkField','primary','14dKbjgR','isArray','push','\x22\x20not\x20found\x20in\x20any\x20dataset','string','find','dataset','tableName','Provide\x20--file\x20or\x20--sql','index_columns','file','flatMap','indexes','str','indexName','sql','cwd','length','reason','schemaWarnings','--check-indexes\x20requires\x20--schemas.','117IhJVvQ','read'];a206_0x1e95=function(){return _0x21267e;};return a206_0x1e95();}const a206_0x5e6cdc=a206_0x2f49;(function(_0x579e7b,_0x1e3e16){const _0x3ac189=a206_0x2f49,_0x554965=_0x579e7b();while(!![]){try{const _0xa976c9=parseInt(_0x3ac189(0xd8))/0x1+parseInt(_0x3ac189(0xe4))/0x2*(parseInt(_0x3ac189(0xe7))/0x3)+-parseInt(_0x3ac189(0xef))/0x4+parseInt(_0x3ac189(0xd9))/0x5*(parseInt(_0x3ac189(0xe9))/0x6)+parseInt(_0x3ac189(0xbd))/0x7*(parseInt(_0x3ac189(0xb5))/0x8)+-parseInt(_0x3ac189(0xd2))/0x9*(parseInt(_0x3ac189(0xda))/0xa)+-parseInt(_0x3ac189(0xb3))/0xb*(-parseInt(_0x3ac189(0xe2))/0xc);if(_0xa976c9===_0x1e3e16)break;else _0x554965['push'](_0x554965['shift']());}catch(_0xc5c79e){_0x554965['push'](_0x554965['shift']());}}}(a206_0x1e95,0x82b73));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 a206_0x2f49(_0x10db58,_0x5a3ef5){_0x10db58=_0x10db58-0xb2;const _0x1e95a9=a206_0x1e95();let _0x2f49ab=_0x1e95a9[_0x10db58];return _0x2f49ab;}import{CliErrors}from'../../errors.js';import{assertDatasetIsDbTableBacked,filterDbTableBackedDatasets}from'../../commands/dataset/capability.js';export const sqlValidate={'service':'sql','command':'validate','description':a206_0x5e6cdc(0xed),'risk':a206_0x5e6cdc(0xd3),'flags':[{'name':a206_0x5e6cdc(0xc7),'type':a206_0x5e6cdc(0xc1),'description':a206_0x5e6cdc(0xf0)},{'name':a206_0x5e6cdc(0xcc),'type':a206_0x5e6cdc(0xc1),'description':a206_0x5e6cdc(0xf9)},{'name':'schemas','type':a206_0x5e6cdc(0xc1),'description':'Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against'},{'name':'check-indexes','type':'boolean','description':a206_0x5e6cdc(0xeb)}],async 'execute'(_0x24c65f){const _0x4e808c=a206_0x5e6cdc,_0x1d209d=_0x24c65f[_0x4e808c(0xca)]('file'),_0x38fdee=_0x24c65f[_0x4e808c(0xca)]('sql'),_0x5e8fa5=_0x24c65f[_0x4e808c(0xca)](_0x4e808c(0xe6)),_0x246cab=_0x24c65f[_0x4e808c(0xdb)]('check-indexes');if(!_0x1d209d&&!_0x38fdee)throw CliErrors[_0x4e808c(0xd4)](_0x4e808c(0xc7),_0x4e808c(0xc5));if(_0x246cab&&!_0x5e8fa5)throw CliErrors[_0x4e808c(0xb2)](_0x4e808c(0xd1));let _0x4e9897;if(_0x1d209d){const _0x2daa47=resolve(process[_0x4e808c(0xcd)](),_0x1d209d);if(!existsSync(_0x2daa47))throw CliErrors[_0x4e808c(0xb2)](_0x4e808c(0xf8)+_0x2daa47);_0x4e9897=readFileSync(_0x2daa47,_0x4e808c(0xb8));}else _0x4e9897=_0x38fdee;const _0x2733b4=validateSql(_0x4e9897),_0x26671d={'valid':_0x2733b4['valid'],'sqlType':_0x2733b4[_0x4e808c(0xea)][_0x4e808c(0xf1)],'isSelectOnly':_0x2733b4['sqlType'][_0x4e808c(0xe3)],'isDangerous':_0x2733b4[_0x4e808c(0xea)][_0x4e808c(0xf4)],'tables':_0x2733b4[_0x4e808c(0xb7)],'parameters':_0x2733b4[_0x4e808c(0xf2)],'message':_0x2733b4[_0x4e808c(0xe0)]};_0x2733b4[_0x4e808c(0xea)][_0x4e808c(0xcf)]&&(_0x26671d[_0x4e808c(0xcf)]=_0x2733b4[_0x4e808c(0xea)][_0x4e808c(0xcf)]);if(_0x5e8fa5&&_0x2733b4[_0x4e808c(0xdc)]){const _0x557a64=_0x5e8fa5['split'](',')[_0x4e808c(0xdd)](_0x44ed5e=>_0x44ed5e['trim']())[_0x4e808c(0xf5)](Boolean),_0x18d5ed=[],_0x2867ba=[],_0x3fb6df=filterDbTableBackedDatasets(await listDatasets(_0x24c65f['appCode'])),_0x1f2fa2=new Map(_0x3fb6df['map'](_0x1d1eb6=>[_0x1d1eb6[_0x4e808c(0xee)]?.[_0x4e808c(0xc4)]?.[_0x4e808c(0xb9)](),_0x1d1eb6]));for(const _0x54faab of _0x2733b4['tables']){const _0x5e8cf1=_0x1f2fa2['get'](_0x54faab[_0x4e808c(0xb9)]());!_0x5e8cf1&&_0x18d5ed['push'](_0x4e808c(0xba)+_0x54faab+_0x4e808c(0xc0));}for(const _0xa27d19 of _0x557a64){let _0x310c0c;try{_0x310c0c=await getDatasetDetail(_0xa27d19);}catch{_0x18d5ed[_0x4e808c(0xbf)](_0x4e808c(0xd5)+_0xa27d19+_0x4e808c(0xd6));continue;}assertDatasetIsDbTableBacked(_0x310c0c,_0x4e808c(0xec));const _0x171439=Array[_0x4e808c(0xbe)](_0x310c0c[_0x4e808c(0xe8)])?_0x310c0c[_0x4e808c(0xe8)]:[],_0x550f78=new Set(_0x171439[_0x4e808c(0xdd)](_0x1f3da1=>_0x1f3da1[_0x4e808c(0xde)]?.['toLowerCase']())),_0x48618e=_0x310c0c[_0x4e808c(0xee)]?.[_0x4e808c(0xc4)]||_0x310c0c[_0x4e808c(0xc4)]||_0xa27d19;_0x26671d[_0x4e808c(0xb4)+_0x48618e]={'code':_0xa27d19,'tableName':_0x48618e,'fieldCount':_0x550f78[_0x4e808c(0xf6)],'fields':Array['from'](_0x550f78)};if(_0x246cab){const _0x34ab1c=normalizeDatasetIndexes(_0x310c0c);_0x2867ba['push']({'tableName':_0x48618e,..._0x34ab1c});}}_0x18d5ed['length']>0x0&&(_0x26671d[_0x4e808c(0xd0)]=_0x18d5ed),_0x246cab&&(_0x26671d['joinAudit']=auditSqlJoinIndexes(_0x4e9897,_0x2867ba));}return{'ok':_0x2733b4[_0x4e808c(0xdc)],'data':_0x26671d,'message':_0x2733b4[_0x4e808c(0xe0)]};}};function normalizeDatasetIndexes(_0x37d6c5){const _0x8f71c7=a206_0x5e6cdc,_0x1f655c=Array[_0x8f71c7(0xbe)](_0x37d6c5?.[_0x8f71c7(0xc3)]?.[_0x8f71c7(0xc9)])?_0x37d6c5[_0x8f71c7(0xc3)][_0x8f71c7(0xc9)]:Array[_0x8f71c7(0xbe)](_0x37d6c5?.[_0x8f71c7(0xc9)])?_0x37d6c5[_0x8f71c7(0xc9)]:[],_0x3a8a4f=_0x1f655c[_0x8f71c7(0xc8)](_0x5f48a2=>{const _0x30f5e0=_0x8f71c7,_0x2f913a=Array['isArray'](_0x5f48a2?.[_0x30f5e0(0xc6)])?_0x5f48a2[_0x30f5e0(0xc6)]:Array[_0x30f5e0(0xbe)](_0x5f48a2?.[_0x30f5e0(0xe5)])?_0x5f48a2[_0x30f5e0(0xe5)]:Array[_0x30f5e0(0xbe)](_0x5f48a2?.['columns'])?_0x5f48a2[_0x30f5e0(0xb6)]:[],_0x271225=_0x2f913a['filter'](_0x218400=>typeof _0x218400===_0x30f5e0(0xc1))[_0x30f5e0(0xdd)](_0x121aa3=>_0x121aa3[_0x30f5e0(0xe1)]())[_0x30f5e0(0xf5)](Boolean);if(_0x271225[_0x30f5e0(0xce)]===0x0)return[];const _0x1b7808=[_0x5f48a2?.[_0x30f5e0(0xcb)],_0x5f48a2?.[_0x30f5e0(0xdf)],_0x5f48a2?.[_0x30f5e0(0xde)]][_0x30f5e0(0xc2)](_0x4d8d6d=>typeof _0x4d8d6d===_0x30f5e0(0xc1)&&_0x4d8d6d[_0x30f5e0(0xe1)]()),_0x31e09b=[_0x5f48a2?.[_0x30f5e0(0xd7)],_0x5f48a2?.[_0x30f5e0(0xf1)]][_0x30f5e0(0xc2)](_0x2f0e13=>typeof _0x2f0e13===_0x30f5e0(0xc1)&&_0x2f0e13[_0x30f5e0(0xe1)]());return[{..._0x1b7808?{'name':_0x1b7808[_0x30f5e0(0xe1)]()}:{},..._0x31e09b?{'type':_0x31e09b[_0x30f5e0(0xe1)]()}:{},'columns':_0x271225}];}),_0x18b56c=[..._0x3a8a4f],_0x571867=typeof _0x37d6c5?.['dbtableConfig']?.['pkField']===_0x8f71c7(0xc1)?_0x37d6c5[_0x8f71c7(0xee)][_0x8f71c7(0xbb)][_0x8f71c7(0xf3)](',')[_0x8f71c7(0xdd)](_0x325003=>_0x325003[_0x8f71c7(0xe1)]())['filter'](Boolean):[];return _0x571867[_0x8f71c7(0xce)]>0x0&&_0x18b56c[_0x8f71c7(0xf7)]({'type':_0x8f71c7(0xbc),'columns':_0x571867}),{'indexes':_0x18b56c,'metadataAvailable':_0x3a8a4f[_0x8f71c7(0xce)]>0x0};}
@@ -1 +1 @@
1
- function a201_0x24cb(){const _0x47eecb=['558682xgQuxX','490936TbKtNh','3787805FXLrOs','3399184phzVkm','5rbDTIP','33249mBVtCQ','603hPoZtr','3472188sCiIBA','1611714NoAbyw'];a201_0x24cb=function(){return _0x47eecb;};return a201_0x24cb();}function a201_0xb77a(_0xc0aa20,_0xe4f30b){_0xc0aa20=_0xc0aa20-0x1e9;const _0x24cb73=a201_0x24cb();let _0xb77a26=_0x24cb73[_0xc0aa20];return _0xb77a26;}(function(_0x45d5d9,_0x4163b9){const _0x182966=a201_0xb77a,_0x17b2c2=_0x45d5d9();while(!![]){try{const _0x2ec1d8=-parseInt(_0x182966(0x1ea))/0x1+parseInt(_0x182966(0x1eb))/0x2+parseInt(_0x182966(0x1f0))/0x3+-parseInt(_0x182966(0x1ee))/0x4+parseInt(_0x182966(0x1ef))/0x5*(-parseInt(_0x182966(0x1e9))/0x6)+-parseInt(_0x182966(0x1ed))/0x7+-parseInt(_0x182966(0x1ec))/0x8*(-parseInt(_0x182966(0x1f1))/0x9);if(_0x2ec1d8===_0x4163b9)break;else _0x17b2c2['push'](_0x17b2c2['shift']());}catch(_0x48bcca){_0x17b2c2['push'](_0x17b2c2['shift']());}}}(a201_0x24cb,0xc85d2));import{taskStatus}from'../../commands/task/status.js';export const taskDefinitions=[taskStatus];
1
+ (function(_0x25fb9e,_0x1a7bac){const _0x18aedf=a207_0x14f5,_0x25b798=_0x25fb9e();while(!![]){try{const _0x48e4c7=parseInt(_0x18aedf(0x1cf))/0x1*(-parseInt(_0x18aedf(0x1d0))/0x2)+parseInt(_0x18aedf(0x1d7))/0x3*(parseInt(_0x18aedf(0x1da))/0x4)+parseInt(_0x18aedf(0x1d2))/0x5*(-parseInt(_0x18aedf(0x1d4))/0x6)+-parseInt(_0x18aedf(0x1d1))/0x7*(-parseInt(_0x18aedf(0x1d5))/0x8)+parseInt(_0x18aedf(0x1d3))/0x9*(-parseInt(_0x18aedf(0x1d9))/0xa)+parseInt(_0x18aedf(0x1d6))/0xb+parseInt(_0x18aedf(0x1ce))/0xc*(parseInt(_0x18aedf(0x1d8))/0xd);if(_0x48e4c7===_0x1a7bac)break;else _0x25b798['push'](_0x25b798['shift']());}catch(_0x30f856){_0x25b798['push'](_0x25b798['shift']());}}}(a207_0x2411,0xc28d7));import{taskStatus}from'../../commands/task/status.js';function a207_0x2411(){const _0x5a09a0=['3qUNmLT','2109991KGxYeH','170WijlcY','2552848Vckiuo','96kIapCt','1491715wdMSZi','2yqsHzp','7117733ziYuLl','5cfawxP','682551eXTYVm','2615622ilrtvE','8EogSFJ','11663465VWcMir'];a207_0x2411=function(){return _0x5a09a0;};return a207_0x2411();}function a207_0x14f5(_0x48024c,_0x2c39e0){_0x48024c=_0x48024c-0x1ce;const _0x2411a3=a207_0x2411();let _0x14f5a9=_0x2411a3[_0x48024c];return _0x14f5a9;}export const taskDefinitions=[taskStatus];
@@ -1 +1 @@
1
- const a202_0x11513a=a202_0x1df4;(function(_0x3e09d2,_0x3cbf7e){const _0x362c5b=a202_0x1df4,_0x14de13=_0x3e09d2();while(!![]){try{const _0x5c33ae=-parseInt(_0x362c5b(0xac))/0x1+parseInt(_0x362c5b(0xb0))/0x2*(-parseInt(_0x362c5b(0xaa))/0x3)+parseInt(_0x362c5b(0xb3))/0x4*(parseInt(_0x362c5b(0x9f))/0x5)+-parseInt(_0x362c5b(0xa2))/0x6+-parseInt(_0x362c5b(0xab))/0x7*(-parseInt(_0x362c5b(0xb1))/0x8)+-parseInt(_0x362c5b(0xa6))/0x9*(parseInt(_0x362c5b(0x9b))/0xa)+parseInt(_0x362c5b(0xa9))/0xb;if(_0x5c33ae===_0x3cbf7e)break;else _0x14de13['push'](_0x14de13['shift']());}catch(_0x3a8d53){_0x14de13['push'](_0x14de13['shift']());}}}(a202_0x9d79,0x5a90d));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asyncTaskMessage,buildAsyncTaskStatusCommand,normalizeAsyncTask}from'../../commands/common/async-task.js';function a202_0x9d79(){const _0x5d6f39=['3501aIUfzk','Task\x20status\x20response\x20id\x20mismatch:\x20requested\x20','read','9331091ZuvWDW','1192749NziveW','259609GDaNHU','306263kPTGvR','apiError','Query\x20an\x20asynchronous\x20task;\x20repeat\x20for\x20PENDING\x20or\x20PROCESSING\x20until\x20SUCCESS\x20or\x20FAILED','Task\x20id\x20returned\x20by\x20an\x20asynchronous\x20platform\x20command','2kzCkBC','96GxFvVa','taskId','347092qUhAvW','cookie','14230VPmofN','task','string','flagMissing','25cLqgSC','str','task-id','593040ugtMJX','isTerminal','appCode','compress'];a202_0x9d79=function(){return _0x5d6f39;};return a202_0x9d79();}import{getAsyncTaskStatus}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a202_0x1df4(_0x14db8f,_0x18c7a2){_0x14db8f=_0x14db8f-0x9b;const _0x9d7909=a202_0x9d79();let _0x1df4a6=_0x9d7909[_0x14db8f];return _0x1df4a6;}export const taskStatus={'service':a202_0x11513a(0x9c),'command':'status','description':a202_0x11513a(0xae),'risk':a202_0x11513a(0xa8),'defaultOutputFormat':a202_0x11513a(0xa5),'structuredErrors':!![],'flags':[{'name':'task-id','type':a202_0x11513a(0x9d),'required':!![],'description':a202_0x11513a(0xaf)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x586f1e){const _0x186230=a202_0x11513a;if(!_0x586f1e[_0x186230(0xa0)](_0x186230(0xa1))['trim']())throw CliErrors[_0x186230(0x9e)](_0x186230(0xa1));},async 'execute'(_0x3ec3fb){const _0x58cae1=a202_0x11513a,_0x167216=_0x3ec3fb[_0x58cae1(0xa0)](_0x58cae1(0xa1))['trim'](),_0x160396=normalizeAsyncTask(await getAsyncTaskStatus(_0x167216,_0x3ec3fb[_0x58cae1(0xa4)],_0x3ec3fb[_0x58cae1(0xb4)]));if(_0x160396[_0x58cae1(0xb2)]!==_0x167216)throw CliErrors[_0x58cae1(0xad)](_0x58cae1(0xa7)+_0x167216+',\x20received\x20'+_0x160396[_0x58cae1(0xb2)]+'.');const _0x33ce97=buildAsyncTaskStatusCommand(_0x160396['taskId'],_0x3ec3fb[_0x58cae1(0xa4)]);return{'ok':!![],'message':asyncTaskMessage(_0x160396),'data':{'appCode':_0x3ec3fb[_0x58cae1(0xa4)],..._0x160396,'query':_0x160396[_0x58cae1(0xa3)]?null:{'command':_0x33ce97}}};}};
1
+ function a208_0x2641(_0x53f808,_0x4e9599){_0x53f808=_0x53f808-0x15e;const _0x39770d=a208_0x3977();let _0x2641a0=_0x39770d[_0x53f808];return _0x2641a0;}const a208_0x1426f7=a208_0x2641;(function(_0x423d54,_0x2dd04d){const _0xba3bdc=a208_0x2641,_0x166a53=_0x423d54();while(!![]){try{const _0x34cde2=parseInt(_0xba3bdc(0x174))/0x1+parseInt(_0xba3bdc(0x16b))/0x2*(parseInt(_0xba3bdc(0x172))/0x3)+-parseInt(_0xba3bdc(0x168))/0x4*(-parseInt(_0xba3bdc(0x16c))/0x5)+-parseInt(_0xba3bdc(0x170))/0x6*(parseInt(_0xba3bdc(0x176))/0x7)+-parseInt(_0xba3bdc(0x15e))/0x8+parseInt(_0xba3bdc(0x167))/0x9*(parseInt(_0xba3bdc(0x16d))/0xa)+parseInt(_0xba3bdc(0x173))/0xb*(-parseInt(_0xba3bdc(0x171))/0xc);if(_0x34cde2===_0x2dd04d)break;else _0x166a53['push'](_0x166a53['shift']());}catch(_0x3a3ce2){_0x166a53['push'](_0x166a53['shift']());}}}(a208_0x3977,0x76179));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asyncTaskMessage,buildAsyncTaskStatusCommand,normalizeAsyncTask}from'../../commands/common/async-task.js';function a208_0x3977(){const _0x5e2b09=['taskId','trim','1999410QSiXar','1008bAwYjz','3ipCmvG','128546aCPXFd','514102jOKtQZ','task','7mcArSY','1034504jdNCpW','appCode','read','Query\x20an\x20asynchronous\x20task;\x20repeat\x20for\x20PENDING\x20or\x20PROCESSING\x20until\x20SUCCESS\x20or\x20FAILED','flagMissing','isTerminal','Task\x20status\x20response\x20id\x20mismatch:\x20requested\x20','apiError','task-id','558zqZwbX','4dfewFE','status','str','717638tZqnaH','3432140nPpMwt','59440BkENuy'];a208_0x3977=function(){return _0x5e2b09;};return a208_0x3977();}import{getAsyncTaskStatus}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const taskStatus={'service':a208_0x1426f7(0x175),'command':a208_0x1426f7(0x169),'description':a208_0x1426f7(0x161),'risk':a208_0x1426f7(0x160),'defaultOutputFormat':'compress','structuredErrors':!![],'flags':[{'name':a208_0x1426f7(0x166),'type':'string','required':!![],'description':'Task\x20id\x20returned\x20by\x20an\x20asynchronous\x20platform\x20command'},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x45d950){const _0x1919f8=a208_0x1426f7;if(!_0x45d950[_0x1919f8(0x16a)](_0x1919f8(0x166))['trim']())throw CliErrors[_0x1919f8(0x162)](_0x1919f8(0x166));},async 'execute'(_0x27371c){const _0x37196b=a208_0x1426f7,_0x180d9e=_0x27371c['str'](_0x37196b(0x166))[_0x37196b(0x16f)](),_0x466182=normalizeAsyncTask(await getAsyncTaskStatus(_0x180d9e,_0x27371c[_0x37196b(0x15f)],_0x27371c['cookie']));if(_0x466182[_0x37196b(0x16e)]!==_0x180d9e)throw CliErrors[_0x37196b(0x165)](_0x37196b(0x164)+_0x180d9e+',\x20received\x20'+_0x466182[_0x37196b(0x16e)]+'.');const _0x21ceb6=buildAsyncTaskStatusCommand(_0x466182[_0x37196b(0x16e)],_0x27371c['appCode']);return{'ok':!![],'message':asyncTaskMessage(_0x466182),'data':{'appCode':_0x27371c['appCode'],..._0x466182,'query':_0x466182[_0x37196b(0x163)]?null:{'command':_0x21ceb6}}};}};
@@ -1 +1 @@
1
- function a203_0x553a(_0x4b4555,_0x6d0248){_0x4b4555=_0x4b4555-0xfe;const _0x4c7ecd=a203_0x4c7e();let _0x553aa5=_0x4c7ecd[_0x4b4555];return _0x553aa5;}(function(_0x1d7ba6,_0x273d25){const _0x5724f1=a203_0x553a,_0x33b936=_0x1d7ba6();while(!![]){try{const _0x1ce355=-parseInt(_0x5724f1(0x100))/0x1+-parseInt(_0x5724f1(0x106))/0x2+parseInt(_0x5724f1(0x105))/0x3*(-parseInt(_0x5724f1(0xfe))/0x4)+-parseInt(_0x5724f1(0x104))/0x5+parseInt(_0x5724f1(0x103))/0x6*(parseInt(_0x5724f1(0x102))/0x7)+-parseInt(_0x5724f1(0x101))/0x8+parseInt(_0x5724f1(0xff))/0x9;if(_0x1ce355===_0x273d25)break;else _0x33b936['push'](_0x33b936['shift']());}catch(_0x265cb6){_0x33b936['push'](_0x33b936['shift']());}}}(a203_0x4c7e,0x29bb3));import{tenantMembersListDefinition}from'../../commands/tenant/members-list.js';function a203_0x4c7e(){const _0x44c7b9=['51614cHWNrn','452JbbvWa','5907024nTrrGr','233777gcqvYu','361808siNPfD','343wzRWKI','29922YALoaQ','909475lUsLps','6453muyChj'];a203_0x4c7e=function(){return _0x44c7b9;};return a203_0x4c7e();}export const tenantDefinitions=[tenantMembersListDefinition];
1
+ (function(_0x154e99,_0x5ef9d5){const _0x134c81=a209_0x3832,_0xb1debf=_0x154e99();while(!![]){try{const _0x135445=parseInt(_0x134c81(0x17a))/0x1*(parseInt(_0x134c81(0x17c))/0x2)+-parseInt(_0x134c81(0x180))/0x3+-parseInt(_0x134c81(0x17f))/0x4*(-parseInt(_0x134c81(0x17b))/0x5)+-parseInt(_0x134c81(0x17d))/0x6*(-parseInt(_0x134c81(0x181))/0x7)+-parseInt(_0x134c81(0x182))/0x8*(-parseInt(_0x134c81(0x179))/0x9)+parseInt(_0x134c81(0x17e))/0xa+-parseInt(_0x134c81(0x183))/0xb;if(_0x135445===_0x5ef9d5)break;else _0xb1debf['push'](_0xb1debf['shift']());}catch(_0xed91c6){_0xb1debf['push'](_0xb1debf['shift']());}}}(a209_0x19ec,0x6fd55));import{tenantMembersListDefinition}from'../../commands/tenant/members-list.js';function a209_0x3832(_0x931532,_0x414f80){_0x931532=_0x931532-0x179;const _0x19ecbd=a209_0x19ec();let _0x383291=_0x19ecbd[_0x931532];return _0x383291;}function a209_0x19ec(){const _0x1a14ef=['429669szBpSD','478817mKuRhf','13105PGwBbT','2MCfKEQ','6OcDOxh','4995010KRJyOg','80YLnknL','692364PPNYlE','340011sJGZKb','24IaeYPm','5870447RlJdtv'];a209_0x19ec=function(){return _0x1a14ef;};return a209_0x19ec();}export const tenantDefinitions=[tenantMembersListDefinition];
@@ -1 +1 @@
1
- const a204_0x4784d4=a204_0x1a69;function a204_0x5790(){const _0x350f9e=['length','Pass\x20--tenant-code\x20<code>.','1brlVfx','4ZVrVNv','string','11eesnKw','693860zDTxXE','List\x20members\x20of\x20a\x20tenant\x20available\x20to\x20the\x20current\x20account','21688fwtvDx','457386UWWJRy','read','trim','654DzLgOh','tenant','11626236rwuOHG','5858315eocsni','str','Found\x20','927RpumrG','68376AivQWX','tenant-code','1409277bBlbnF'];a204_0x5790=function(){return _0x350f9e;};return a204_0x5790();}function a204_0x1a69(_0x5413cc,_0x26d56b){_0x5413cc=_0x5413cc-0x1df;const _0x579044=a204_0x5790();let _0x1a6966=_0x579044[_0x5413cc];return _0x1a6966;}(function(_0x117925,_0x29b485){const _0x272e96=a204_0x1a69,_0x2ac581=_0x117925();while(!![]){try{const _0x1f16ed=parseInt(_0x272e96(0x1e5))/0x1*(-parseInt(_0x272e96(0x1ec))/0x2)+parseInt(_0x272e96(0x1e2))/0x3*(-parseInt(_0x272e96(0x1e6))/0x4)+parseInt(_0x272e96(0x1f2))/0x5+parseInt(_0x272e96(0x1ef))/0x6*(-parseInt(_0x272e96(0x1e0))/0x7)+parseInt(_0x272e96(0x1eb))/0x8*(parseInt(_0x272e96(0x1df))/0x9)+parseInt(_0x272e96(0x1e9))/0xa+-parseInt(_0x272e96(0x1e8))/0xb*(-parseInt(_0x272e96(0x1f1))/0xc);if(_0x1f16ed===_0x29b485)break;else _0x2ac581['push'](_0x2ac581['shift']());}catch(_0x5defa9){_0x2ac581['push'](_0x2ac581['shift']());}}}(a204_0x5790,0xb13d3));import{listCurrentUserTenantMemberships,listTenantDirectoryMembers}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{assertTenantAccessible,projectTenantMembers}from'../../commands/tenant/shared.js';export const tenantMembersListDefinition={'service':a204_0x4784d4(0x1f0),'command':'members-list','description':a204_0x4784d4(0x1ea),'risk':a204_0x4784d4(0x1ed),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':'tenant-code','type':a204_0x4784d4(0x1e7),'required':!![],'description':'Exact\x20tenant\x20code'}],async 'validate'(_0x134a6c){const _0x3d158d=a204_0x4784d4;if(!_0x134a6c[_0x3d158d(0x1f3)](_0x3d158d(0x1e1))[_0x3d158d(0x1ee)]())throw CliErrors['flagMissing']('tenant-code',_0x3d158d(0x1e4));},async 'execute'(_0x2f9aab){const _0x4e4b5b=a204_0x4784d4,_0x1fccb4=_0x2f9aab[_0x4e4b5b(0x1f3)](_0x4e4b5b(0x1e1))[_0x4e4b5b(0x1ee)](),_0x5455f6=await listCurrentUserTenantMemberships();assertTenantAccessible(_0x1fccb4,_0x5455f6);const _0x36b807=projectTenantMembers(await listTenantDirectoryMembers(_0x1fccb4));return{'ok':!![],'data':{'tenantCode':_0x1fccb4,'items':_0x36b807,'totalCount':_0x36b807[_0x4e4b5b(0x1e3)]},'message':_0x4e4b5b(0x1f4)+_0x36b807[_0x4e4b5b(0x1e3)]+'\x20tenant\x20member(s)'};}};
1
+ const a210_0x48396f=a210_0x3df2;(function(_0x381e0c,_0x3343e0){const _0x57582f=a210_0x3df2,_0x4caf79=_0x381e0c();while(!![]){try{const _0xac2baf=parseInt(_0x57582f(0x16e))/0x1*(-parseInt(_0x57582f(0x171))/0x2)+-parseInt(_0x57582f(0x163))/0x3*(-parseInt(_0x57582f(0x16f))/0x4)+-parseInt(_0x57582f(0x170))/0x5+-parseInt(_0x57582f(0x165))/0x6*(parseInt(_0x57582f(0x172))/0x7)+parseInt(_0x57582f(0x169))/0x8+-parseInt(_0x57582f(0x161))/0x9+parseInt(_0x57582f(0x16b))/0xa;if(_0xac2baf===_0x3343e0)break;else _0x4caf79['push'](_0x4caf79['shift']());}catch(_0x111c46){_0x4caf79['push'](_0x4caf79['shift']());}}}(a210_0x1168,0x514bb));function a210_0x3df2(_0x1d6ae1,_0x30e509){_0x1d6ae1=_0x1d6ae1-0x15d;const _0x1168f5=a210_0x1168();let _0x3df25e=_0x1168f5[_0x1d6ae1];return _0x3df25e;}import{listCurrentUserTenantMemberships,listTenantDirectoryMembers}from'../../core/api-client.js';function a210_0x1168(){const _0x5c95ba=['List\x20members\x20of\x20a\x20tenant\x20available\x20to\x20the\x20current\x20account','6eWbbsS','length','Exact\x20tenant\x20code','read','1477032qYxBfa','Pass\x20--tenant-code\x20<code>.','11736380qpEXun','tenant','trim','3JFTycQ','1294780dDFxRJ','2913300IifSkE','39588Jltuhu','4020331ytrqxn','members-list','flagMissing','tenant-code','\x20tenant\x20member(s)','string','str','4106655KEMqUU','Found\x20','6mGBSwV'];a210_0x1168=function(){return _0x5c95ba;};return a210_0x1168();}import{CliErrors}from'../../errors.js';import{assertTenantAccessible,projectTenantMembers}from'../../commands/tenant/shared.js';export const tenantMembersListDefinition={'service':a210_0x48396f(0x16c),'command':a210_0x48396f(0x173),'description':a210_0x48396f(0x164),'risk':a210_0x48396f(0x168),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a210_0x48396f(0x15d),'type':a210_0x48396f(0x15f),'required':!![],'description':a210_0x48396f(0x167)}],async 'validate'(_0x493247){const _0x2e3f0f=a210_0x48396f;if(!_0x493247[_0x2e3f0f(0x160)](_0x2e3f0f(0x15d))[_0x2e3f0f(0x16d)]())throw CliErrors[_0x2e3f0f(0x174)](_0x2e3f0f(0x15d),_0x2e3f0f(0x16a));},async 'execute'(_0x3403b0){const _0x32df77=a210_0x48396f,_0x675604=_0x3403b0[_0x32df77(0x160)](_0x32df77(0x15d))[_0x32df77(0x16d)](),_0x29a6c4=await listCurrentUserTenantMemberships();assertTenantAccessible(_0x675604,_0x29a6c4);const _0x41ad75=projectTenantMembers(await listTenantDirectoryMembers(_0x675604));return{'ok':!![],'data':{'tenantCode':_0x675604,'items':_0x41ad75,'totalCount':_0x41ad75[_0x32df77(0x166)]},'message':_0x32df77(0x162)+_0x41ad75['length']+_0x32df77(0x15e)};}};
@@ -1 +1 @@
1
- (function(_0x434e93,_0x1c94a0){const _0x404f94=a205_0x4199,_0x4c38ab=_0x434e93();while(!![]){try{const _0x1b18e7=parseInt(_0x404f94(0x104))/0x1+parseInt(_0x404f94(0x116))/0x2+parseInt(_0x404f94(0x103))/0x3+-parseInt(_0x404f94(0x106))/0x4+-parseInt(_0x404f94(0x115))/0x5*(parseInt(_0x404f94(0x108))/0x6)+parseInt(_0x404f94(0x113))/0x7*(parseInt(_0x404f94(0x10e))/0x8)+-parseInt(_0x404f94(0x101))/0x9*(-parseInt(_0x404f94(0x10f))/0xa);if(_0x1b18e7===_0x1c94a0)break;else _0x4c38ab['push'](_0x4c38ab['shift']());}catch(_0x22ee8e){_0x4c38ab['push'](_0x4c38ab['shift']());}}}(a205_0x51f4,0x1d9bd));import{CliErrors}from'../../errors.js';function textOrNull(_0x570a89){const _0x143558=a205_0x4199,_0x560312=_0x570a89?.[_0x143558(0x102)]();return _0x560312?_0x560312:null;}export function projectTenantMembers(_0x3e90bd){const _0x4afc1f=a205_0x4199,_0x12076a=new Map();for(const _0x1f908e of _0x3e90bd){const _0x43d2f0=Number(_0x1f908e[_0x4afc1f(0x109)]);if(!Number['isFinite'](_0x43d2f0)||_0x43d2f0<=0x0)continue;const _0x16ad1b={'userId':_0x43d2f0,'username':textOrNull(_0x1f908e[_0x4afc1f(0x10c)]),'displayName':textOrNull(_0x1f908e[_0x4afc1f(0x112)]),'role':_0x1f908e['adminFlag']===!![]?'ADMIN':_0x4afc1f(0x118),'status':textOrNull(_0x1f908e[_0x4afc1f(0x110)])},_0x4055a1=_0x12076a[_0x4afc1f(0x111)](_0x43d2f0);if(!_0x4055a1){_0x12076a[_0x4afc1f(0x114)](_0x43d2f0,_0x16ad1b);continue;}_0x4055a1[_0x4afc1f(0x10c)]??=_0x16ad1b[_0x4afc1f(0x10c)],_0x4055a1[_0x4afc1f(0x105)]??=_0x16ad1b[_0x4afc1f(0x105)],_0x4055a1[_0x4afc1f(0x110)]??=_0x16ad1b[_0x4afc1f(0x110)];if(_0x16ad1b[_0x4afc1f(0x107)]===_0x4afc1f(0x10a))_0x4055a1[_0x4afc1f(0x107)]=_0x4afc1f(0x10a);}return[..._0x12076a[_0x4afc1f(0x117)]()]['sort']((_0x1c5cb9,_0x2eb7b0)=>_0x1c5cb9[_0x4afc1f(0x109)]-_0x2eb7b0['userId']);}function a205_0x4199(_0x3f1ef3,_0x5dcc4d){_0x3f1ef3=_0x3f1ef3-0x101;const _0x51f48d=a205_0x51f4();let _0x419914=_0x51f48d[_0x3f1ef3];return _0x419914;}export function assertTenantAccessible(_0xa19cc7,_0x2ab357){const _0x2a7af3=a205_0x4199;if(_0x2ab357[_0x2a7af3(0x10d)](_0x19ee7f=>_0x19ee7f['tenantCode']===_0xa19cc7))return;throw CliErrors[_0x2a7af3(0x10b)]('Tenant\x20\x22'+_0xa19cc7+'\x22\x20is\x20not\x20available\x20to\x20the\x20current\x20account.','Check\x20--tenant-code\x20or\x20login\x20with\x20an\x20account\x20that\x20belongs\x20to\x20this\x20tenant.');}function a205_0x51f4(){const _0x3e5bae=['nickname','7ZFVUJM','set','105265RUQHSq','309384bfJJIQ','values','MEMBER','940527sZWsKB','trim','29328ySMXjy','56578QixtMN','displayName','723320yEYKHe','role','18MVXPUT','userId','ADMIN','validation','username','some','317736oXCnnm','10DLBgit','status','get'];a205_0x51f4=function(){return _0x3e5bae;};return a205_0x51f4();}
1
+ function a211_0x5cc9(_0xeb6b7f,_0x4ca448){_0xeb6b7f=_0xeb6b7f-0x7b;const _0x3b0354=a211_0x3b03();let _0x5cc9ae=_0x3b0354[_0xeb6b7f];return _0x5cc9ae;}function a211_0x3b03(){const _0x58e17c=['22vugBTM','sort','tenantCode','trim','username','validation','some','status','Tenant\x20\x22','578237eYOjpr','3FEfOVP','\x22\x20is\x20not\x20available\x20to\x20the\x20current\x20account.','Check\x20--tenant-code\x20or\x20login\x20with\x20an\x20account\x20that\x20belongs\x20to\x20this\x20tenant.','values','ADMIN','adminFlag','4585004OGxvuE','nickname','14973867eiHoFt','31932tnVPtO','set','displayName','9302175Xscuie','role','8cBupUH','2729126aCDljO','userId','2527VEmuvP','8963380mhUkdX'];a211_0x3b03=function(){return _0x58e17c;};return a211_0x3b03();}(function(_0x3bbecb,_0x147bca){const _0x2680e1=a211_0x5cc9,_0x3c209f=_0x3bbecb();while(!![]){try{const _0x3ad8c7=parseInt(_0x2680e1(0x80))/0x1+parseInt(_0x2680e1(0x90))/0x2*(parseInt(_0x2680e1(0x81))/0x3)+-parseInt(_0x2680e1(0x87))/0x4+-parseInt(_0x2680e1(0x8d))/0x5+parseInt(_0x2680e1(0x8a))/0x6*(parseInt(_0x2680e1(0x92))/0x7)+parseInt(_0x2680e1(0x8f))/0x8*(-parseInt(_0x2680e1(0x89))/0x9)+-parseInt(_0x2680e1(0x93))/0xa*(-parseInt(_0x2680e1(0x94))/0xb);if(_0x3ad8c7===_0x147bca)break;else _0x3c209f['push'](_0x3c209f['shift']());}catch(_0x1cf440){_0x3c209f['push'](_0x3c209f['shift']());}}}(a211_0x3b03,0xf0c9d));import{CliErrors}from'../../errors.js';function textOrNull(_0x3314e8){const _0x5a26d7=a211_0x5cc9,_0xca3e42=_0x3314e8?.[_0x5a26d7(0x97)]();return _0xca3e42?_0xca3e42:null;}export function projectTenantMembers(_0x6b11bc){const _0x4c1f13=a211_0x5cc9,_0x4a69bc=new Map();for(const _0x1e5763 of _0x6b11bc){const _0x3e6bf0=Number(_0x1e5763[_0x4c1f13(0x91)]);if(!Number['isFinite'](_0x3e6bf0)||_0x3e6bf0<=0x0)continue;const _0x5570a5={'userId':_0x3e6bf0,'username':textOrNull(_0x1e5763[_0x4c1f13(0x7b)]),'displayName':textOrNull(_0x1e5763[_0x4c1f13(0x88)]),'role':_0x1e5763[_0x4c1f13(0x86)]===!![]?'ADMIN':'MEMBER','status':textOrNull(_0x1e5763[_0x4c1f13(0x7e)])},_0x35603a=_0x4a69bc['get'](_0x3e6bf0);if(!_0x35603a){_0x4a69bc[_0x4c1f13(0x8b)](_0x3e6bf0,_0x5570a5);continue;}_0x35603a[_0x4c1f13(0x7b)]??=_0x5570a5[_0x4c1f13(0x7b)],_0x35603a[_0x4c1f13(0x8c)]??=_0x5570a5[_0x4c1f13(0x8c)],_0x35603a[_0x4c1f13(0x7e)]??=_0x5570a5[_0x4c1f13(0x7e)];if(_0x5570a5['role']===_0x4c1f13(0x85))_0x35603a[_0x4c1f13(0x8e)]=_0x4c1f13(0x85);}return[..._0x4a69bc[_0x4c1f13(0x84)]()][_0x4c1f13(0x95)]((_0xac0358,_0x2521e5)=>_0xac0358[_0x4c1f13(0x91)]-_0x2521e5[_0x4c1f13(0x91)]);}export function assertTenantAccessible(_0x7f8a97,_0x3f2120){const _0x201205=a211_0x5cc9;if(_0x3f2120[_0x201205(0x7d)](_0x135a55=>_0x135a55[_0x201205(0x96)]===_0x7f8a97))return;throw CliErrors[_0x201205(0x7c)](_0x201205(0x7f)+_0x7f8a97+_0x201205(0x82),_0x201205(0x83));}
@@ -1 +1 @@
1
- function a206_0x2c30(){const _0x530df4=['Pass\x20the\x20DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox.','963ywUSJl','6082240fesWwe','1462yFzXYH','apiError','bind','trim','POST','24bHUlsF','449855relzSi','1115188VAHosC','107248TXQnHP','string','user-account','The\x20current\x20binding\x20is\x20not\x20exposed\x20by\x20the\x20server;\x20before\x20is\x20unavailable.','18iCJJNU','dingtalk','Retry\x20with\x20the\x20same\x20--ding-talk-user-id\x20only\x20after\x20checking\x20the\x20current\x20platform\x20session.','ding-talk-user-id','442835YpOvLe','validation','--ding-talk-user-id\x20cannot\x20be\x20empty.','DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox','2744244EeDrUB','dingding-sandbox-bind'];a206_0x2c30=function(){return _0x530df4;};return a206_0x2c30();}const a206_0x118af3=a206_0x1fea;(function(_0x215624,_0x4def78){const _0x4f6a73=a206_0x1fea,_0x53740c=_0x215624();while(!![]){try{const _0xb27806=-parseInt(_0x4f6a73(0x1c7))/0x1+-parseInt(_0x4f6a73(0x1bf))/0x2*(-parseInt(_0x4f6a73(0x1bd))/0x3)+parseInt(_0x4f6a73(0x1c6))/0x4+parseInt(_0x4f6a73(0x1cf))/0x5*(parseInt(_0x4f6a73(0x1cb))/0x6)+-parseInt(_0x4f6a73(0x1c5))/0x7*(parseInt(_0x4f6a73(0x1c4))/0x8)+parseInt(_0x4f6a73(0x1d3))/0x9+-parseInt(_0x4f6a73(0x1be))/0xa;if(_0xb27806===_0x4def78)break;else _0x53740c['push'](_0x53740c['shift']());}catch(_0x560d48){_0x53740c['push'](_0x53740c['shift']());}}}(a206_0x2c30,0x2aeb6));import{asDryRunResult}from'../../commands/common/dry-run.js';function a206_0x1fea(_0x2c2416,_0x153d07){_0x2c2416=_0x2c2416-0x1bd;const _0x2c30b4=a206_0x2c30();let _0x1fea3b=_0x2c30b4[_0x2c2416];return _0x1fea3b;}import{bindDingTalkSandboxAccount,DING_TALK_SANDBOX_BIND_PATH}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const PROVIDER_ID=a206_0x118af3(0x1cc),CURRENT_BINDING_WARNING=a206_0x118af3(0x1ca);function readDingTalkUserId(_0x30ea39){const _0x52808d=a206_0x118af3,_0x220cc4=_0x30ea39['str']('ding-talk-user-id')[_0x52808d(0x1c2)]();if(!_0x220cc4)throw CliErrors[_0x52808d(0x1d0)](_0x52808d(0x1d1),_0x52808d(0x1d5));return _0x220cc4;}function buildBindingData(_0x109984,_0x474b01){const _0x35c8bf=a206_0x118af3;return{'operation':_0x35c8bf(0x1c1),'selector':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x109984},'before':null,'after':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x109984,'bound':!![]},'dryRun':_0x474b01,'backend':{'method':_0x35c8bf(0x1c3),'path':DING_TALK_SANDBOX_BIND_PATH},'warnings':[CURRENT_BINDING_WARNING]};}export const dingTalkSandboxBind={'service':a206_0x118af3(0x1c9),'command':a206_0x118af3(0x1d4),'description':'Bind\x20the\x20current\x20platform\x20user\x20to\x20a\x20DingTalk\x20sandbox\x20account','risk':'write','requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a206_0x118af3(0x1ce),'type':a206_0x118af3(0x1c8),'required':!![],'description':a206_0x118af3(0x1d2)}],async 'validate'(_0x29344c){readDingTalkUserId(_0x29344c);},async 'dryRun'(_0x492e49){const _0x41e15c=readDingTalkUserId(_0x492e49);return asDryRunResult(buildBindingData(_0x41e15c,!![]),{'method':'POST','url':DING_TALK_SANDBOX_BIND_PATH});},async 'execute'(_0x379296){const _0x55c27c=a206_0x118af3,_0x4f9606=readDingTalkUserId(_0x379296),_0x1664bb=await bindDingTalkSandboxAccount(_0x4f9606);if(_0x1664bb!==!![])throw CliErrors[_0x55c27c(0x1c0)]('DingTalk\x20sandbox\x20account\x20binding\x20was\x20not\x20confirmed.',_0x55c27c(0x1cd));return{'ok':!![],'data':buildBindingData(_0x4f9606,![]),'message':'Bound\x20current\x20user\x20to\x20DingTalk\x20sandbox\x20account.'};}};
1
+ const a212_0x3c1fe2=a212_0x1d6d;(function(_0x58e3a4,_0x2d486f){const _0x4d0eec=a212_0x1d6d,_0x234d16=_0x58e3a4();while(!![]){try{const _0x4bfba9=parseInt(_0x4d0eec(0x7e))/0x1+parseInt(_0x4d0eec(0x7c))/0x2*(-parseInt(_0x4d0eec(0x6d))/0x3)+-parseInt(_0x4d0eec(0x74))/0x4+-parseInt(_0x4d0eec(0x79))/0x5*(parseInt(_0x4d0eec(0x6c))/0x6)+-parseInt(_0x4d0eec(0x70))/0x7*(-parseInt(_0x4d0eec(0x75))/0x8)+-parseInt(_0x4d0eec(0x80))/0x9+parseInt(_0x4d0eec(0x7d))/0xa;if(_0x4bfba9===_0x2d486f)break;else _0x234d16['push'](_0x234d16['shift']());}catch(_0x2eb800){_0x234d16['push'](_0x234d16['shift']());}}}(a212_0xd493,0xb99f7));import{asDryRunResult}from'../../commands/common/dry-run.js';function a212_0x1d6d(_0x352838,_0x54c7a2){_0x352838=_0x352838-0x6b;const _0xd49370=a212_0xd493();let _0x1d6d6f=_0xd49370[_0x352838];return _0x1d6d6f;}import{bindDingTalkSandboxAccount,DING_TALK_SANDBOX_BIND_PATH}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const PROVIDER_ID='dingtalk',CURRENT_BINDING_WARNING=a212_0x3c1fe2(0x78);function a212_0xd493(){const _0x54ec1d=['6hZNYZV','49701oyGOlj','ding-talk-user-id','str','3558751iRCYIC','write','trim','--ding-talk-user-id\x20cannot\x20be\x20empty.','5882584QAbyXb','16KHiaAB','Retry\x20with\x20the\x20same\x20--ding-talk-user-id\x20only\x20after\x20checking\x20the\x20current\x20platform\x20session.','Pass\x20the\x20DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox.','The\x20current\x20binding\x20is\x20not\x20exposed\x20by\x20the\x20server;\x20before\x20is\x20unavailable.','7106065whywqX','validation','apiError','182GagUrP','42761530DIvdtH','1370455kaGAGc','DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox','13532643PVWmCj','Bind\x20the\x20current\x20platform\x20user\x20to\x20a\x20DingTalk\x20sandbox\x20account','POST','bind'];a212_0xd493=function(){return _0x54ec1d;};return a212_0xd493();}function readDingTalkUserId(_0x1f12ff){const _0x1cf416=a212_0x3c1fe2,_0x4031a3=_0x1f12ff[_0x1cf416(0x6f)](_0x1cf416(0x6e))[_0x1cf416(0x72)]();if(!_0x4031a3)throw CliErrors[_0x1cf416(0x7a)](_0x1cf416(0x73),_0x1cf416(0x77));return _0x4031a3;}function buildBindingData(_0xa73ff4,_0x509fbe){const _0x2aab86=a212_0x3c1fe2;return{'operation':_0x2aab86(0x6b),'selector':{'providerId':PROVIDER_ID,'dingTalkUserId':_0xa73ff4},'before':null,'after':{'providerId':PROVIDER_ID,'dingTalkUserId':_0xa73ff4,'bound':!![]},'dryRun':_0x509fbe,'backend':{'method':_0x2aab86(0x82),'path':DING_TALK_SANDBOX_BIND_PATH},'warnings':[CURRENT_BINDING_WARNING]};}export const dingTalkSandboxBind={'service':'user-account','command':'dingding-sandbox-bind','description':a212_0x3c1fe2(0x81),'risk':a212_0x3c1fe2(0x71),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a212_0x3c1fe2(0x6e),'type':'string','required':!![],'description':a212_0x3c1fe2(0x7f)}],async 'validate'(_0x5e19fc){readDingTalkUserId(_0x5e19fc);},async 'dryRun'(_0x300469){const _0x10d785=a212_0x3c1fe2,_0x3c2520=readDingTalkUserId(_0x300469);return asDryRunResult(buildBindingData(_0x3c2520,!![]),{'method':_0x10d785(0x82),'url':DING_TALK_SANDBOX_BIND_PATH});},async 'execute'(_0x2a331a){const _0x32a927=a212_0x3c1fe2,_0x4d199f=readDingTalkUserId(_0x2a331a),_0x51f1e8=await bindDingTalkSandboxAccount(_0x4d199f);if(_0x51f1e8!==!![])throw CliErrors[_0x32a927(0x7b)]('DingTalk\x20sandbox\x20account\x20binding\x20was\x20not\x20confirmed.',_0x32a927(0x76));return{'ok':!![],'data':buildBindingData(_0x4d199f,![]),'message':'Bound\x20current\x20user\x20to\x20DingTalk\x20sandbox\x20account.'};}};
@@ -1 +1 @@
1
- function a207_0x2a0f(){const _0x3f328e=['197770AKFWFH','444nKAOaF','720guKrUD','1886232LeXMiP','5783393Mtuuli','554449Wenwng','1281928tUSAqP','5XyBTIU','4405062nAbhrK','12951RSUKra'];a207_0x2a0f=function(){return _0x3f328e;};return a207_0x2a0f();}(function(_0x4eb865,_0xf85219){const _0x5866b7=a207_0x358f,_0x5fe0a5=_0x4eb865();while(!![]){try{const _0x4c8280=parseInt(_0x5866b7(0xdf))/0x1+-parseInt(_0x5866b7(0xe0))/0x2+parseInt(_0x5866b7(0xe3))/0x3*(parseInt(_0x5866b7(0xe5))/0x4)+-parseInt(_0x5866b7(0xe1))/0x5*(-parseInt(_0x5866b7(0xe2))/0x6)+parseInt(_0x5866b7(0xde))/0x7+parseInt(_0x5866b7(0xdd))/0x8+-parseInt(_0x5866b7(0xe6))/0x9*(parseInt(_0x5866b7(0xe4))/0xa);if(_0x4c8280===_0xf85219)break;else _0x5fe0a5['push'](_0x5fe0a5['shift']());}catch(_0x5c2f08){_0x5fe0a5['push'](_0x5fe0a5['shift']());}}}(a207_0x2a0f,0x941cb));import{dingTalkSandboxBind}from'../../commands/user-account/dingding-sandbox-bind.js';function a207_0x358f(_0x54a9a0,_0x4779fa){_0x54a9a0=_0x54a9a0-0xdd;const _0x2a0f75=a207_0x2a0f();let _0x358f22=_0x2a0f75[_0x54a9a0];return _0x358f22;}export const userAccountDefinitions=[dingTalkSandboxBind];
1
+ (function(_0xf30678,_0x2d38c7){const _0x5e6958=a213_0x274b,_0x445a3=_0xf30678();while(!![]){try{const _0x2985b3=parseInt(_0x5e6958(0x69))/0x1+-parseInt(_0x5e6958(0x6b))/0x2*(-parseInt(_0x5e6958(0x70))/0x3)+-parseInt(_0x5e6958(0x6f))/0x4+-parseInt(_0x5e6958(0x74))/0x5*(parseInt(_0x5e6958(0x6e))/0x6)+-parseInt(_0x5e6958(0x6d))/0x7*(parseInt(_0x5e6958(0x6a))/0x8)+-parseInt(_0x5e6958(0x72))/0x9*(-parseInt(_0x5e6958(0x6c))/0xa)+-parseInt(_0x5e6958(0x73))/0xb*(-parseInt(_0x5e6958(0x71))/0xc);if(_0x2985b3===_0x2d38c7)break;else _0x445a3['push'](_0x445a3['shift']());}catch(_0x4512b7){_0x445a3['push'](_0x445a3['shift']());}}}(a213_0xa006,0x36fda));import{dingTalkSandboxBind}from'../../commands/user-account/dingding-sandbox-bind.js';function a213_0x274b(_0x55e6bb,_0x170b86){_0x55e6bb=_0x55e6bb-0x69;const _0xa0064b=a213_0xa006();let _0x274b63=_0xa0064b[_0x55e6bb];return _0x274b63;}export const userAccountDefinitions=[dingTalkSandboxBind];function a213_0xa006(){const _0x54f7a9=['1561030bwVIbU','324466dLfOCg','6424RpYDfj','98QXAECV','891190WtjyWQ','3661BOjOUd','6owHVpU','144684QwASCt','15837Tzinep','35376zGoHvU','9itfctU','1199djPxfz'];a213_0xa006=function(){return _0x54f7a9;};return a213_0xa006();}
@@ -1 +1 @@
1
- const a208_0x422e03=a208_0x1f1c;function a208_0x1f1c(_0x2f09e6,_0x2463c5){_0x2f09e6=_0x2f09e6-0x158;const _0x285189=a208_0x2851();let _0x1f1ca=_0x285189[_0x2f09e6];return _0x1f1ca;}(function(_0x472282,_0x40af32){const _0xedbbfe=a208_0x1f1c,_0x204ebb=_0x472282();while(!![]){try{const _0x3313d2=parseInt(_0xedbbfe(0x15b))/0x1*(parseInt(_0xedbbfe(0x163))/0x2)+parseInt(_0xedbbfe(0x167))/0x3+parseInt(_0xedbbfe(0x15d))/0x4*(parseInt(_0xedbbfe(0x15e))/0x5)+-parseInt(_0xedbbfe(0x15a))/0x6*(parseInt(_0xedbbfe(0x164))/0x7)+-parseInt(_0xedbbfe(0x166))/0x8+parseInt(_0xedbbfe(0x162))/0x9*(-parseInt(_0xedbbfe(0x158))/0xa)+parseInt(_0xedbbfe(0x15f))/0xb;if(_0x3313d2===_0x40af32)break;else _0x204ebb['push'](_0x204ebb['shift']());}catch(_0x47ed7a){_0x204ebb['push'](_0x204ebb['shift']());}}}(a208_0x2851,0x82e61));import{buildAppAddFlags,runAppAdd,validateAppName}from'../../commands/common/app-registry.js';function a208_0x2851(){const _0x5f2f7d=['2598376rWukTp','109821qsHOWD','20iKgxLV','add','4995786AxxeRA','5WPLoiy','write','364huNhjQ','45635EZedqb','20191369HeJjfy','App\x20profile\x20name','workspace\x20add','4562748STtgIn','1916VcrBfg','7JqBLtD','name'];a208_0x2851=function(){return _0x5f2f7d;};return a208_0x2851();}export const workspaceAddDefinition={'service':'workspace','command':a208_0x422e03(0x159),'description':'Register\x20an\x20app\x20profile\x20in\x20the\x20current\x20workspace\x20(or\x20--global)','risk':a208_0x422e03(0x15c),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a208_0x422e03(0x165),'description':a208_0x422e03(0x160),'required':!![]}],'flags':buildAppAddFlags(),'validate':_0x23a229=>validateAppName(_0x23a229,a208_0x422e03(0x161)),'execute':_0x58369e=>runAppAdd(_0x58369e,'workspace\x20add')};
1
+ function a214_0x1214(_0x225123,_0x203333){_0x225123=_0x225123-0x19d;const _0x51abaf=a214_0x51ab();let _0x1214aa=_0x51abaf[_0x225123];return _0x1214aa;}const a214_0xff0c27=a214_0x1214;function a214_0x51ab(){const _0x5f1cc3=['9VGMLxd','4734NgEmvm','Register\x20an\x20app\x20profile\x20in\x20the\x20current\x20workspace\x20(or\x20--global)','973ihaxrB','68210sgQCEh','1ZqJebn','workspace','20dqSrur','25688etuFZm','18883980wEerRl','5405cETwhi','workspace\x20add','name','3874574kmHDom','490344JjyxFR','1553526pekXXd'];a214_0x51ab=function(){return _0x5f1cc3;};return a214_0x51ab();}(function(_0x58887f,_0x1ba130){const _0x21b962=a214_0x1214,_0x29b006=_0x58887f();while(!![]){try{const _0x5846a7=-parseInt(_0x21b962(0x1a9))/0x1*(parseInt(_0x21b962(0x1a8))/0x2)+-parseInt(_0x21b962(0x1a4))/0x3*(parseInt(_0x21b962(0x1a2))/0x4)+parseInt(_0x21b962(0x19e))/0x5*(-parseInt(_0x21b962(0x1a5))/0x6)+-parseInt(_0x21b962(0x1a7))/0x7*(parseInt(_0x21b962(0x1ac))/0x8)+parseInt(_0x21b962(0x1a3))/0x9+parseInt(_0x21b962(0x1ab))/0xa*(parseInt(_0x21b962(0x1a1))/0xb)+parseInt(_0x21b962(0x19d))/0xc;if(_0x5846a7===_0x1ba130)break;else _0x29b006['push'](_0x29b006['shift']());}catch(_0x33f647){_0x29b006['push'](_0x29b006['shift']());}}}(a214_0x51ab,0xb704e));import{buildAppAddFlags,runAppAdd,validateAppName}from'../../commands/common/app-registry.js';export const workspaceAddDefinition={'service':a214_0xff0c27(0x1aa),'command':'add','description':a214_0xff0c27(0x1a6),'risk':'write','requiresAuth':![],'requiresAppCode':![],'args':[{'name':a214_0xff0c27(0x1a0),'description':'App\x20profile\x20name','required':!![]}],'flags':buildAppAddFlags(),'validate':_0x3b542d=>validateAppName(_0x3b542d,a214_0xff0c27(0x19f)),'execute':_0x24fd8e=>runAppAdd(_0x24fd8e,a214_0xff0c27(0x19f))};
@@ -1 +1 @@
1
- const a209_0x43a6ae=a209_0x4bee;(function(_0x5a593d,_0x5d2e8b){const _0x48af6c=a209_0x4bee,_0x5773b5=_0x5a593d();while(!![]){try{const _0x2bec97=-parseInt(_0x48af6c(0x205))/0x1*(parseInt(_0x48af6c(0x1ee))/0x2)+parseInt(_0x48af6c(0x216))/0x3*(-parseInt(_0x48af6c(0x209))/0x4)+parseInt(_0x48af6c(0x1ec))/0x5+parseInt(_0x48af6c(0x1f9))/0x6*(-parseInt(_0x48af6c(0x1ff))/0x7)+parseInt(_0x48af6c(0x220))/0x8*(-parseInt(_0x48af6c(0x202))/0x9)+parseInt(_0x48af6c(0x1fb))/0xa+parseInt(_0x48af6c(0x208))/0xb;if(_0x2bec97===_0x5d2e8b)break;else _0x5773b5['push'](_0x5773b5['shift']());}catch(_0x24a0af){_0x5773b5['push'](_0x5773b5['shift']());}}}(a209_0x438e,0x826db));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{RABETBASE_ENV_VALUES}from'../../constant/env.js';import{RABETBASE_OUTPUT_FORMAT_VALUES}from'../../constant/output.js';import{RISK_LEVEL_VALUES}from'../../constant/risk.js';import{validateAppcode}from'../../commands/common/validate.js';import{readConfigFile,readRawConfigWithLayers,resolveWriteConfigPath,writeConfigFile}from'../../context.js';import{workspaceAddDefinition}from'../../commands/workspace/add.js';import{workspaceRemoveDefinition}from'../../commands/workspace/remove.js';import{normalizeStoredDefaultApp}from'../../config/schema.js';function a209_0x438e(){const _0x10c27b=['deploymentSync','\x20workspace\x20use\x20--app\x20<name>`.','1823675akmWwU','\x22\x20not\x20found.','2ImuMLq','workspace.','apps','string','\x20--app\x20','use','workspace','app','.\x20Credentials:\x20not\x20written.','Use\x20`','trim','50916EdHfXU','init','10347850EXLSGM','Initialize\x20the\x20current\x20workspace\x20app\x20binding','isArray','apiDir','434PUgMst','API\x20directory\x20path\x20for\x20this\x20workspace\x20app\x20profile','riskLevel','9ZhXHBa','env','validation','159305nFiPPt','updated','object','7852229RdsiHp','35648UdbHxx','Missing\x20workspace\x20app\x20selector.','initialized','number','Default\x20output\x20format\x20for\x20this\x20workspace\x20app\x20profile','write','\x20workspace\x20','format','str','\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`','Risk\x20level\x20for\x20this\x20workspace\x20app\x20profile','App\x20code\x20to\x20bind\x20to\x20this\x20workspace','globalConfig','198HZeYHD','appcode','App\x20locale\x20for\x20this\x20workspace\x20app\x20profile\x20(not\x20CLI\x20language;\x20reserved\x20for\x20later\x20app\x20use)','Target\x20environment','project','pageSize','\x20--appcode\x20<code>`.','defaultFormat','\x20(appcode:\x20','flag','2443960HFVcHQ','keys','locale','join','Workspace\x20','Switch\x20the\x20current\x20workspace\x20app\x20binding'];a209_0x438e=function(){return _0x10c27b;};return a209_0x438e();}import{collectDeploymentSyncProfile,getDeploymentSyncProfileFlagDefs}from'../../config/deployment-sync.js';const WORKSPACE_USAGE=CLI_BIN_NAME+'\x20workspace\x20<init|use>\x20--app\x20<name>\x20[--appcode\x20<code>]',SAFE_PROFILE_KEYS=[a209_0x43a6ae(0x217),'env',a209_0x43a6ae(0x1fe),a209_0x43a6ae(0x210),'pageSize',a209_0x43a6ae(0x201),a209_0x43a6ae(0x1e6),a209_0x43a6ae(0x1ea)],workspaceFlags=[{'name':a209_0x43a6ae(0x1f5),'type':'string','description':'App\x20profile\x20name\x20to\x20use\x20in\x20this\x20workspace'},{'name':a209_0x43a6ae(0x217),'type':'string','description':a209_0x43a6ae(0x214)},{'name':a209_0x43a6ae(0x203),'type':a209_0x43a6ae(0x1f1),'description':a209_0x43a6ae(0x219),'enum':[...RABETBASE_ENV_VALUES]},{'name':a209_0x43a6ae(0x1fe),'type':a209_0x43a6ae(0x1f1),'description':a209_0x43a6ae(0x200)},{'name':a209_0x43a6ae(0x21d),'type':a209_0x43a6ae(0x1f1),'description':a209_0x43a6ae(0x20d),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':a209_0x43a6ae(0x21b),'type':a209_0x43a6ae(0x20c),'description':'Default\x20page\x20size\x20for\x20this\x20workspace\x20app\x20profile'},{'name':a209_0x43a6ae(0x201),'type':'string','description':a209_0x43a6ae(0x213),'enum':[...RISK_LEVEL_VALUES]},{'name':a209_0x43a6ae(0x1e6),'type':'string','description':a209_0x43a6ae(0x218)},...getDeploymentSyncProfileFlagDefs()];function a209_0x4bee(_0x13bb61,_0x550dab){_0x13bb61=_0x13bb61-0x1e5;const _0x438e0c=a209_0x438e();let _0x4beec2=_0x438e0c[_0x13bb61];return _0x4beec2;}function isRecord(_0x21dc91){const _0x546caa=a209_0x43a6ae;return!!_0x21dc91&&typeof _0x21dc91===_0x546caa(0x207)&&!Array[_0x546caa(0x1fd)](_0x21dc91);}function assertValidAppcode(_0x48cdff){const _0x5a5998=a209_0x43a6ae,{valid:_0x260235,message:_0x50d6b3}=validateAppcode(_0x48cdff);if(!_0x260235)throw CliErrors[_0x5a5998(0x204)]('Invalid\x20appcode:\x20'+_0x48cdff,_0x50d6b3);}function sanitizeProfile(_0x3bc436){if(!isRecord(_0x3bc436))return{};const _0x2818b2={};for(const _0x55e05f of SAFE_PROFILE_KEYS){if(_0x3bc436[_0x55e05f]!==undefined)_0x2818b2[_0x55e05f]=_0x3bc436[_0x55e05f];}return _0x2818b2;}function cloneProfile(_0x2acdab){return isRecord(_0x2acdab)?{..._0x2acdab}:{};}function collectWorkspaceProfileOverrides(_0x27b0ad){const _0x424f99=a209_0x43a6ae,_0x37166b={},_0x4c9adf=_0x27b0ad[_0x424f99(0x211)](_0x424f99(0x203)),_0x1763da=_0x27b0ad[_0x424f99(0x211)](_0x424f99(0x1fe)),_0x2aae7c=_0x27b0ad['str'](_0x424f99(0x21d)),_0x311de5=_0x27b0ad[_0x424f99(0x21f)](_0x424f99(0x21b)),_0x316a93=_0x27b0ad['str'](_0x424f99(0x201)),_0x123bfc=_0x27b0ad[_0x424f99(0x211)]('locale');if(_0x4c9adf)_0x37166b[_0x424f99(0x203)]=_0x4c9adf;if(_0x1763da)_0x37166b[_0x424f99(0x1fe)]=_0x1763da;if(_0x2aae7c)_0x37166b[_0x424f99(0x210)]=_0x2aae7c;if(_0x311de5!==undefined&&_0x311de5!=='')_0x37166b['pageSize']=Number(_0x311de5);if(_0x316a93)_0x37166b['riskLevel']=_0x316a93;if(_0x123bfc)_0x37166b[_0x424f99(0x1e6)]=_0x123bfc;const _0x21fec1=collectDeploymentSyncProfile(_0x534a17=>_0x27b0ad[_0x424f99(0x211)](_0x534a17));if(_0x21fec1)_0x37166b['deploymentSync']=_0x21fec1;return _0x37166b;}async function validateWorkspaceArgs(_0x510c54){const _0x44b681=a209_0x43a6ae,_0xbd2775=_0x510c54[_0x44b681(0x211)](_0x44b681(0x1f5))[_0x44b681(0x1f8)](),_0x5e6fb4=_0x510c54[_0x44b681(0x211)](_0x44b681(0x217))[_0x44b681(0x1f8)]();if(!_0xbd2775&&!_0x5e6fb4)throw CliErrors[_0x44b681(0x204)]('Missing\x20workspace\x20app\x20selector.',_0x44b681(0x1f7)+CLI_BIN_NAME+_0x44b681(0x212)+CLI_BIN_NAME+_0x44b681(0x1eb));if(_0x5e6fb4)assertValidAppcode(_0x5e6fb4);}function resolveKnownApps(){const _0x49264d=a209_0x43a6ae,{config:_0x345f53,layers:_0x6b74f4}=readRawConfigWithLayers(),_0x30d540=isRecord(_0x345f53[_0x49264d(0x1f0)])?_0x345f53[_0x49264d(0x1f0)]:{},_0x592c1f=isRecord(_0x6b74f4[_0x49264d(0x215)]['apps'])?_0x6b74f4['globalConfig'][_0x49264d(0x1f0)]:{};return{..._0x592c1f,..._0x30d540};}async function configureWorkspace(_0x5d938b,_0x47bc21){const _0x3bf17b=a209_0x43a6ae,_0xcf5b49=_0x5d938b[_0x3bf17b(0x211)](_0x3bf17b(0x1f5))['trim'](),_0x541538=_0x5d938b[_0x3bf17b(0x211)](_0x3bf17b(0x217))[_0x3bf17b(0x1f8)](),_0x295fde=_0xcf5b49||_0x541538;if(!_0x295fde)throw CliErrors[_0x3bf17b(0x204)](_0x3bf17b(0x20a),_0x3bf17b(0x1f7)+CLI_BIN_NAME+_0x3bf17b(0x212)+CLI_BIN_NAME+_0x3bf17b(0x1eb));if(_0x541538)assertValidAppcode(_0x541538);const _0x5930cf=resolveWriteConfigPath(_0x3bf17b(0x21a)),_0x85b2d6=readConfigFile(_0x5930cf),_0xb23ec7=resolveKnownApps(),_0x928d74=isRecord(_0x85b2d6['apps'])?{..._0x85b2d6[_0x3bf17b(0x1f0)]}:{},_0x10557e=cloneProfile(_0x928d74[_0x295fde]),_0x2ff968=sanitizeProfile(_0xb23ec7[_0x295fde]),_0x38f422=_0x541538?{}:_0x2ff968,_0x4e1c97=_0x541538||_0x38f422['appcode'];if(!_0x4e1c97){const _0x19ab16=Object[_0x3bf17b(0x1e5)](_0xb23ec7),_0x1df1a9=_0x19ab16['length']===0x0?'Use\x20`'+CLI_BIN_NAME+_0x3bf17b(0x20f)+_0x47bc21+_0x3bf17b(0x1f2)+_0x295fde+_0x3bf17b(0x21c):'Pass\x20--appcode\x20<code>,\x20or\x20choose\x20one\x20of:\x20'+_0x19ab16[_0x3bf17b(0x1e7)](',\x20');throw CliErrors['validation']('App\x20\x22'+_0x295fde+_0x3bf17b(0x1ed),_0x1df1a9);}assertValidAppcode(String(_0x4e1c97));const _0x261604={..._0x38f422,..._0x10557e,'appcode':String(_0x4e1c97),...collectWorkspaceProfileOverrides(_0x5d938b)};return _0x928d74[_0x295fde]=_0x261604,_0x85b2d6[_0x3bf17b(0x1f0)]=_0x928d74,normalizeStoredDefaultApp(_0x85b2d6,_0x295fde),delete _0x85b2d6[_0x3bf17b(0x217)],delete _0x85b2d6[_0x3bf17b(0x1f5)],_0x261604[_0x3bf17b(0x203)]&&(_0x85b2d6[_0x3bf17b(0x203)]=_0x261604[_0x3bf17b(0x203)]),writeConfigFile(_0x5930cf,_0x85b2d6),{'ok':!![],'message':_0x3bf17b(0x1e8)+(_0x47bc21==='init'?_0x3bf17b(0x20b):_0x3bf17b(0x206))+':\x20'+_0x295fde+_0x3bf17b(0x21e)+_0x261604[_0x3bf17b(0x217)]+').\x20Config:\x20'+_0x5930cf+_0x3bf17b(0x1f6),'data':{'operation':_0x3bf17b(0x1ef)+_0x47bc21,'configPath':_0x5930cf,'app':_0x295fde,'appcode':_0x261604['appcode'],'env':_0x261604[_0x3bf17b(0x203)]??null,'credentialsWritten':![]}};}const workspaceInitDefinition={'service':'workspace','command':'init','description':a209_0x43a6ae(0x1fc),'risk':'write','requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x5b957e=>configureWorkspace(_0x5b957e,a209_0x43a6ae(0x1fa))},workspaceUseDefinition={'service':a209_0x43a6ae(0x1f4),'command':a209_0x43a6ae(0x1f3),'description':a209_0x43a6ae(0x1e9),'risk':a209_0x43a6ae(0x20e),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0xb9c9b4=>configureWorkspace(_0xb9c9b4,a209_0x43a6ae(0x1f3))};export const workspaceDefinitions=[workspaceInitDefinition,workspaceUseDefinition,workspaceAddDefinition,workspaceRemoveDefinition];export{WORKSPACE_USAGE};
1
+ const a215_0x2572ff=a215_0x51d2;(function(_0x5f256d,_0x3ce979){const _0x4c76d0=a215_0x51d2,_0x185751=_0x5f256d();while(!![]){try{const _0x5f27be=-parseInt(_0x4c76d0(0x143))/0x1*(parseInt(_0x4c76d0(0x14b))/0x2)+parseInt(_0x4c76d0(0x153))/0x3+-parseInt(_0x4c76d0(0x138))/0x4+-parseInt(_0x4c76d0(0x158))/0x5*(parseInt(_0x4c76d0(0x135))/0x6)+-parseInt(_0x4c76d0(0x152))/0x7*(-parseInt(_0x4c76d0(0x13d))/0x8)+-parseInt(_0x4c76d0(0x12d))/0x9*(-parseInt(_0x4c76d0(0x13a))/0xa)+parseInt(_0x4c76d0(0x132))/0xb;if(_0x5f27be===_0x3ce979)break;else _0x185751['push'](_0x185751['shift']());}catch(_0x45bb25){_0x185751['push'](_0x185751['shift']());}}}(a215_0x4dd1,0xce792));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{RABETBASE_ENV_VALUES}from'../../constant/env.js';import{RABETBASE_OUTPUT_FORMAT_VALUES}from'../../constant/output.js';import{RISK_LEVEL_VALUES}from'../../constant/risk.js';import{validateAppcode}from'../../commands/common/validate.js';import{readConfigFile,readRawConfigWithLayers,resolveWriteConfigPath,writeConfigFile}from'../../context.js';import{workspaceAddDefinition}from'../../commands/workspace/add.js';import{workspaceRemoveDefinition}from'../../commands/workspace/remove.js';import{normalizeStoredDefaultApp}from'../../config/schema.js';import{collectDeploymentSyncProfile,getDeploymentSyncProfileFlagDefs}from'../../config/deployment-sync.js';const WORKSPACE_USAGE=CLI_BIN_NAME+a215_0x2572ff(0x151),SAFE_PROFILE_KEYS=[a215_0x2572ff(0x124),a215_0x2572ff(0x128),a215_0x2572ff(0x14c),a215_0x2572ff(0x12b),'pageSize',a215_0x2572ff(0x11e),a215_0x2572ff(0x12e),a215_0x2572ff(0x148)],workspaceFlags=[{'name':a215_0x2572ff(0x13c),'type':a215_0x2572ff(0x136),'description':a215_0x2572ff(0x150)},{'name':a215_0x2572ff(0x124),'type':a215_0x2572ff(0x136),'description':a215_0x2572ff(0x134)},{'name':a215_0x2572ff(0x128),'type':a215_0x2572ff(0x136),'description':a215_0x2572ff(0x159),'enum':[...RABETBASE_ENV_VALUES]},{'name':a215_0x2572ff(0x14c),'type':'string','description':a215_0x2572ff(0x141)},{'name':'defaultFormat','type':'string','description':a215_0x2572ff(0x145),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':a215_0x2572ff(0x14f),'type':a215_0x2572ff(0x147),'description':a215_0x2572ff(0x142)},{'name':'riskLevel','type':a215_0x2572ff(0x136),'description':a215_0x2572ff(0x126),'enum':[...RISK_LEVEL_VALUES]},{'name':a215_0x2572ff(0x12e),'type':a215_0x2572ff(0x136),'description':'App\x20locale\x20for\x20this\x20workspace\x20app\x20profile\x20(not\x20CLI\x20language;\x20reserved\x20for\x20later\x20app\x20use)'},...getDeploymentSyncProfileFlagDefs()];function a215_0x51d2(_0x4cfde2,_0x10aa06){_0x4cfde2=_0x4cfde2-0x11d;const _0x4dd19f=a215_0x4dd1();let _0x51d274=_0x4dd19f[_0x4cfde2];return _0x51d274;}function isRecord(_0x3ab684){const _0x2cdf8d=a215_0x2572ff;return!!_0x3ab684&&typeof _0x3ab684==='object'&&!Array[_0x2cdf8d(0x12c)](_0x3ab684);}function a215_0x4dd1(){const _0x140d6b=['riskLevel','Invalid\x20appcode:\x20','updated','\x20(appcode:\x20','str','flag','appcode','\x20workspace\x20use\x20--app\x20<name>`.','Risk\x20level\x20for\x20this\x20workspace\x20app\x20profile','write','env','Switch\x20the\x20current\x20workspace\x20app\x20binding','Missing\x20workspace\x20app\x20selector.','format','isArray','9239859keGyiF','locale','Use\x20`','Pass\x20--appcode\x20<code>,\x20or\x20choose\x20one\x20of:\x20',').\x20Config:\x20','19699636VRRMvx','defaultFormat','App\x20code\x20to\x20bind\x20to\x20this\x20workspace','6JVAvdl','string','\x20--app\x20','1907592keuNAC','trim','10joBxOd','init','app','3216GOZiaZ','\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`','\x20workspace\x20','project','API\x20directory\x20path\x20for\x20this\x20workspace\x20app\x20profile','Default\x20page\x20size\x20for\x20this\x20workspace\x20app\x20profile','1erExRJ','Initialize\x20the\x20current\x20workspace\x20app\x20binding','Default\x20output\x20format\x20for\x20this\x20workspace\x20app\x20profile','\x22\x20not\x20found.','number','deploymentSync','initialized','workspace','1811758RnLxUP','apiDir','validation','Workspace\x20','pageSize','App\x20profile\x20name\x20to\x20use\x20in\x20this\x20workspace','\x20workspace\x20<init|use>\x20--app\x20<name>\x20[--appcode\x20<code>]','6629IbOVvp','1996920JRqSsj','apps','keys','\x20--appcode\x20<code>`.','workspace.','8176850mcFrDm','Target\x20environment','globalConfig','use'];a215_0x4dd1=function(){return _0x140d6b;};return a215_0x4dd1();}function assertValidAppcode(_0x5d062b){const _0x10504e=a215_0x2572ff,{valid:_0x25126,message:_0x16f076}=validateAppcode(_0x5d062b);if(!_0x25126)throw CliErrors[_0x10504e(0x14d)](_0x10504e(0x11f)+_0x5d062b,_0x16f076);}function sanitizeProfile(_0x45cf89){if(!isRecord(_0x45cf89))return{};const _0x8650b4={};for(const _0x2f0805 of SAFE_PROFILE_KEYS){if(_0x45cf89[_0x2f0805]!==undefined)_0x8650b4[_0x2f0805]=_0x45cf89[_0x2f0805];}return _0x8650b4;}function cloneProfile(_0x4b459b){return isRecord(_0x4b459b)?{..._0x4b459b}:{};}function collectWorkspaceProfileOverrides(_0x8a3725){const _0x30ba71=a215_0x2572ff,_0x1a8fbb={},_0x4c196b=_0x8a3725[_0x30ba71(0x122)]('env'),_0x26847c=_0x8a3725[_0x30ba71(0x122)](_0x30ba71(0x14c)),_0x4ad66f=_0x8a3725[_0x30ba71(0x122)](_0x30ba71(0x133)),_0x32d13d=_0x8a3725[_0x30ba71(0x123)](_0x30ba71(0x14f)),_0x278203=_0x8a3725[_0x30ba71(0x122)](_0x30ba71(0x11e)),_0x1be093=_0x8a3725[_0x30ba71(0x122)](_0x30ba71(0x12e));if(_0x4c196b)_0x1a8fbb[_0x30ba71(0x128)]=_0x4c196b;if(_0x26847c)_0x1a8fbb[_0x30ba71(0x14c)]=_0x26847c;if(_0x4ad66f)_0x1a8fbb[_0x30ba71(0x12b)]=_0x4ad66f;if(_0x32d13d!==undefined&&_0x32d13d!=='')_0x1a8fbb[_0x30ba71(0x14f)]=Number(_0x32d13d);if(_0x278203)_0x1a8fbb[_0x30ba71(0x11e)]=_0x278203;if(_0x1be093)_0x1a8fbb[_0x30ba71(0x12e)]=_0x1be093;const _0x514c43=collectDeploymentSyncProfile(_0x81a4da=>_0x8a3725[_0x30ba71(0x122)](_0x81a4da));if(_0x514c43)_0x1a8fbb[_0x30ba71(0x148)]=_0x514c43;return _0x1a8fbb;}async function validateWorkspaceArgs(_0x57c84a){const _0x3a010b=a215_0x2572ff,_0x5cd249=_0x57c84a[_0x3a010b(0x122)]('app')['trim'](),_0x5ecbb0=_0x57c84a[_0x3a010b(0x122)]('appcode')[_0x3a010b(0x139)]();if(!_0x5cd249&&!_0x5ecbb0)throw CliErrors['validation'](_0x3a010b(0x12a),_0x3a010b(0x12f)+CLI_BIN_NAME+_0x3a010b(0x13e)+CLI_BIN_NAME+'\x20workspace\x20use\x20--app\x20<name>`.');if(_0x5ecbb0)assertValidAppcode(_0x5ecbb0);}function resolveKnownApps(){const _0x461a3a=a215_0x2572ff,{config:_0x56cc83,layers:_0x241663}=readRawConfigWithLayers(),_0x38f845=isRecord(_0x56cc83[_0x461a3a(0x154)])?_0x56cc83['apps']:{},_0x41c1f8=isRecord(_0x241663[_0x461a3a(0x15a)][_0x461a3a(0x154)])?_0x241663[_0x461a3a(0x15a)]['apps']:{};return{..._0x41c1f8,..._0x38f845};}async function configureWorkspace(_0x329234,_0x80caeb){const _0x312815=a215_0x2572ff,_0x228a4b=_0x329234[_0x312815(0x122)]('app')['trim'](),_0x55f8ac=_0x329234[_0x312815(0x122)](_0x312815(0x124))[_0x312815(0x139)](),_0x443cf5=_0x228a4b||_0x55f8ac;if(!_0x443cf5)throw CliErrors[_0x312815(0x14d)](_0x312815(0x12a),'Use\x20`'+CLI_BIN_NAME+'\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`'+CLI_BIN_NAME+_0x312815(0x125));if(_0x55f8ac)assertValidAppcode(_0x55f8ac);const _0xe56b40=resolveWriteConfigPath(_0x312815(0x140)),_0x29585b=readConfigFile(_0xe56b40),_0x4320ee=resolveKnownApps(),_0x48889f=isRecord(_0x29585b[_0x312815(0x154)])?{..._0x29585b['apps']}:{},_0x12a30c=cloneProfile(_0x48889f[_0x443cf5]),_0x2eadf9=sanitizeProfile(_0x4320ee[_0x443cf5]),_0x3b5873=_0x55f8ac?{}:_0x2eadf9,_0x2b7a02=_0x55f8ac||_0x3b5873[_0x312815(0x124)];if(!_0x2b7a02){const _0x29d117=Object[_0x312815(0x155)](_0x4320ee),_0x56f177=_0x29d117['length']===0x0?_0x312815(0x12f)+CLI_BIN_NAME+_0x312815(0x13f)+_0x80caeb+_0x312815(0x137)+_0x443cf5+_0x312815(0x156):_0x312815(0x130)+_0x29d117['join'](',\x20');throw CliErrors[_0x312815(0x14d)]('App\x20\x22'+_0x443cf5+_0x312815(0x146),_0x56f177);}assertValidAppcode(String(_0x2b7a02));const _0x15654a={..._0x3b5873,..._0x12a30c,'appcode':String(_0x2b7a02),...collectWorkspaceProfileOverrides(_0x329234)};return _0x48889f[_0x443cf5]=_0x15654a,_0x29585b[_0x312815(0x154)]=_0x48889f,normalizeStoredDefaultApp(_0x29585b,_0x443cf5),delete _0x29585b[_0x312815(0x124)],delete _0x29585b[_0x312815(0x13c)],_0x15654a[_0x312815(0x128)]&&(_0x29585b[_0x312815(0x128)]=_0x15654a[_0x312815(0x128)]),writeConfigFile(_0xe56b40,_0x29585b),{'ok':!![],'message':_0x312815(0x14e)+(_0x80caeb===_0x312815(0x13b)?_0x312815(0x149):_0x312815(0x120))+':\x20'+_0x443cf5+_0x312815(0x121)+_0x15654a[_0x312815(0x124)]+_0x312815(0x131)+_0xe56b40+'.\x20Credentials:\x20not\x20written.','data':{'operation':_0x312815(0x157)+_0x80caeb,'configPath':_0xe56b40,'app':_0x443cf5,'appcode':_0x15654a[_0x312815(0x124)],'env':_0x15654a[_0x312815(0x128)]??null,'credentialsWritten':![]}};}const workspaceInitDefinition={'service':a215_0x2572ff(0x14a),'command':'init','description':a215_0x2572ff(0x144),'risk':a215_0x2572ff(0x127),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x46a4f6=>configureWorkspace(_0x46a4f6,a215_0x2572ff(0x13b))},workspaceUseDefinition={'service':a215_0x2572ff(0x14a),'command':a215_0x2572ff(0x11d),'description':a215_0x2572ff(0x129),'risk':'write','requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x22088d=>configureWorkspace(_0x22088d,a215_0x2572ff(0x11d))};export const workspaceDefinitions=[workspaceInitDefinition,workspaceUseDefinition,workspaceAddDefinition,workspaceRemoveDefinition];export{WORKSPACE_USAGE};
@@ -1 +1 @@
1
- function a210_0x243f(_0x57c137,_0x20e2ee){_0x57c137=_0x57c137-0x99;const _0x128448=a210_0x1284();let _0x243fef=_0x128448[_0x57c137];return _0x243fef;}const a210_0x198827=a210_0x243f;(function(_0x46a3b8,_0x4af17a){const _0x13ae90=a210_0x243f,_0x64efd9=_0x46a3b8();while(!![]){try{const _0x49fbd9=-parseInt(_0x13ae90(0x99))/0x1*(parseInt(_0x13ae90(0x9e))/0x2)+-parseInt(_0x13ae90(0x9d))/0x3+-parseInt(_0x13ae90(0xa2))/0x4+parseInt(_0x13ae90(0x9b))/0x5*(parseInt(_0x13ae90(0xa5))/0x6)+-parseInt(_0x13ae90(0xa3))/0x7*(parseInt(_0x13ae90(0x9a))/0x8)+-parseInt(_0x13ae90(0xa6))/0x9+parseInt(_0x13ae90(0xa1))/0xa*(parseInt(_0x13ae90(0xa4))/0xb);if(_0x49fbd9===_0x4af17a)break;else _0x64efd9['push'](_0x64efd9['shift']());}catch(_0x1704d3){_0x64efd9['push'](_0x64efd9['shift']());}}}(a210_0x1284,0x39afa));function a210_0x1284(){const _0x4353a5=['1784960FvWydb','name','146535plqkzX','4OUjixg','workspace\x20remove','workspace','220ymQUkR','6844HcWlbj','7qvdVQH','346852ivrDEt','6PkbPBR','2612430OOFmEl','Remove\x20an\x20app\x20profile\x20from\x20the\x20current\x20workspace\x20(or\x20--global)','remove','214481TNxElz','357008KmSKlr'];a210_0x1284=function(){return _0x4353a5;};return a210_0x1284();}import{buildAppRemoveFlags,runAppRemove,validateAppName}from'../../commands/common/app-registry.js';export const workspaceRemoveDefinition={'service':a210_0x198827(0xa0),'command':a210_0x198827(0xa8),'description':a210_0x198827(0xa7),'risk':'write','requiresAuth':![],'requiresAppCode':![],'args':[{'name':a210_0x198827(0x9c),'description':'App\x20profile\x20name\x20to\x20remove','required':!![]}],'flags':buildAppRemoveFlags(),'validate':_0x5c254a=>validateAppName(_0x5c254a,a210_0x198827(0x9f)),'execute':_0x516513=>runAppRemove(_0x516513,a210_0x198827(0x9f))};
1
+ const a216_0x17590e=a216_0x32a7;(function(_0xb66164,_0x406559){const _0x4e1068=a216_0x32a7,_0x13b914=_0xb66164();while(!![]){try{const _0x1c0b2d=parseInt(_0x4e1068(0x10d))/0x1+parseInt(_0x4e1068(0x10e))/0x2+-parseInt(_0x4e1068(0x103))/0x3*(-parseInt(_0x4e1068(0x10f))/0x4)+-parseInt(_0x4e1068(0x104))/0x5*(parseInt(_0x4e1068(0x10a))/0x6)+-parseInt(_0x4e1068(0x108))/0x7+parseInt(_0x4e1068(0x112))/0x8*(-parseInt(_0x4e1068(0x105))/0x9)+parseInt(_0x4e1068(0x10b))/0xa*(-parseInt(_0x4e1068(0x111))/0xb);if(_0x1c0b2d===_0x406559)break;else _0x13b914['push'](_0x13b914['shift']());}catch(_0x194d17){_0x13b914['push'](_0x13b914['shift']());}}}(a216_0x4cc9,0x846e8));import{buildAppRemoveFlags,runAppRemove,validateAppName}from'../../commands/common/app-registry.js';export const workspaceRemoveDefinition={'service':'workspace','command':a216_0x17590e(0x10c),'description':a216_0x17590e(0x109),'risk':a216_0x17590e(0x102),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a216_0x17590e(0x106),'description':a216_0x17590e(0x110),'required':!![]}],'flags':buildAppRemoveFlags(),'validate':_0x8b63f7=>validateAppName(_0x8b63f7,a216_0x17590e(0x107)),'execute':_0x49bdc1=>runAppRemove(_0x49bdc1,a216_0x17590e(0x107))};function a216_0x32a7(_0x243469,_0x1c643d){_0x243469=_0x243469-0x102;const _0x4cc9d2=a216_0x4cc9();let _0x32a7bc=_0x4cc9d2[_0x243469];return _0x32a7bc;}function a216_0x4cc9(){const _0xcb4238=['90UXgTjP','remove','652988lGQewc','81018BJnMDf','184yyvdlE','App\x20profile\x20name\x20to\x20remove','626923pVpSsl','180632RtczPW','write','65505IKzFpl','38455EiHBaU','36hiVPka','name','workspace\x20remove','581441ztNfaU','Remove\x20an\x20app\x20profile\x20from\x20the\x20current\x20workspace\x20(or\x20--global)','366JFXbmU'];a216_0x4cc9=function(){return _0xcb4238;};return a216_0x4cc9();}
@@ -1 +1 @@
1
- function a211_0x4388(_0x153333,_0x35ed88){_0x153333=_0x153333-0x194;const _0x15330c=a211_0x1533();let _0x43880f=_0x15330c[_0x153333];return _0x43880f;}const a211_0x31dc7b=a211_0x4388;(function(_0x4799d6,_0x1e2387){const _0x548d15=a211_0x4388,_0x2cf645=_0x4799d6();while(!![]){try{const _0x3bdbd1=-parseInt(_0x548d15(0x19e))/0x1+-parseInt(_0x548d15(0x1a8))/0x2*(parseInt(_0x548d15(0x1a3))/0x3)+-parseInt(_0x548d15(0x1a5))/0x4*(-parseInt(_0x548d15(0x1aa))/0x5)+-parseInt(_0x548d15(0x1a1))/0x6*(parseInt(_0x548d15(0x1ab))/0x7)+-parseInt(_0x548d15(0x19b))/0x8+parseInt(_0x548d15(0x198))/0x9*(parseInt(_0x548d15(0x195))/0xa)+parseInt(_0x548d15(0x19a))/0xb;if(_0x3bdbd1===_0x1e2387)break;else _0x2cf645['push'](_0x2cf645['shift']());}catch(_0xd20c00){_0x2cf645['push'](_0x2cf645['shift']());}}}(a211_0x1533,0x2afbb));import{CliErrors}from'../errors.js';export const AUTO_DEPLOYMENT_TARGET_ENVS=[a211_0x31dc7b(0x196),'test',a211_0x31dc7b(0x19f)];export function getDeploymentSyncProfileFlagDefs(){const _0x39e375=a211_0x31dc7b;return[{'name':_0x39e375(0x199),'type':_0x39e375(0x1a0),'description':'Base\x20dblink\x20ID\x20whose\x20server-side\x20environment\x20mapping\x20selects\x20the\x20automatic\x20sync\x20target'},{'name':_0x39e375(0x19c),'type':_0x39e375(0x1a2),'enum':[...AUTO_DEPLOYMENT_TARGET_ENVS],'description':_0x39e375(0x197)}];}export function collectDeploymentSyncProfile(_0x5358b5){const _0x3c2570=a211_0x31dc7b,_0x32e408=_0x5358b5('deployment-db-id')[_0x3c2570(0x1a7)](),_0x2487dd=_0x5358b5(_0x3c2570(0x19c))[_0x3c2570(0x1a7)]();if(!_0x32e408&&!_0x2487dd)return undefined;return validateDeploymentSyncProfile({'dbLinkId':_0x32e408?Number(_0x32e408):undefined,'targetEnv':_0x2487dd||undefined});}function a211_0x1533(){const _0x361ab1=['4VXZrrK','--deployment-db-id\x20must\x20be\x20a\x20positive\x20safe\x20integer.','trim','4MqqFwz','Production\x20and\x20direct\x20targets\x20must\x20use\x20`rabetbase\x20deployment\x20sync`\x20with\x20explicit\x20confirmation.','390855sUmpmD','34174nezrrj','deploymentSync\x20must\x20contain\x20dbLinkId\x20and\x20targetEnv.','validation','isSafeInteger','targetEnv','10LqPcGC','dev','Non-production\x20target\x20selected\x20by\x20the\x20server-side\x20environment\x20mapping','12501itdchg','deployment-db-id','9749751IpXQuo','2546904IfaOBo','deployment-target-env','--deployment-target-env\x20must\x20be\x20one\x20of:\x20','188225WwHLFM','pre','number','246dlVptp','string','124638pQdTft','object'];a211_0x1533=function(){return _0x361ab1;};return a211_0x1533();}export function validateDeploymentSyncProfile(_0x388930){const _0x426a20=a211_0x31dc7b;if(!_0x388930||typeof _0x388930!==_0x426a20(0x1a4)||Array['isArray'](_0x388930))throw CliErrors[_0x426a20(0x1ad)](_0x426a20(0x1ac));const _0x5268df=_0x388930,_0x2120b2=Number(_0x5268df['dbLinkId']);if(!Number[_0x426a20(0x1ae)](_0x2120b2)||_0x2120b2<=0x0)throw CliErrors['validation'](_0x426a20(0x1a6));const _0x27b656=typeof _0x5268df[_0x426a20(0x194)]===_0x426a20(0x1a2)?_0x5268df['targetEnv']['trim']():'';if(!AUTO_DEPLOYMENT_TARGET_ENVS['includes'](_0x27b656))throw CliErrors[_0x426a20(0x1ad)](_0x426a20(0x19d)+AUTO_DEPLOYMENT_TARGET_ENVS['join'](',\x20')+'.',_0x426a20(0x1a9));return{'dbLinkId':_0x2120b2,'targetEnv':_0x27b656};}
1
+ function a217_0x2b10(_0x26d5c4,_0x33791c){_0x26d5c4=_0x26d5c4-0x1a4;const _0x25a6c6=a217_0x25a6();let _0x2b1018=_0x25a6c6[_0x26d5c4];return _0x2b1018;}const a217_0x636b8e=a217_0x2b10;function a217_0x25a6(){const _0x3651dd=['Non-production\x20target\x20selected\x20by\x20the\x20server-side\x20environment\x20mapping','8Ctoujx','object','deployment-target-env','1960824MweATR','validation','--deployment-db-id\x20must\x20be\x20a\x20positive\x20safe\x20integer.','Production\x20and\x20direct\x20targets\x20must\x20use\x20`rabetbase\x20deployment\x20sync`\x20with\x20explicit\x20confirmation.','1425219QxjjuA','deploymentSync\x20must\x20contain\x20dbLinkId\x20and\x20targetEnv.','520352JBXyZd','Base\x20dblink\x20ID\x20whose\x20server-side\x20environment\x20mapping\x20selects\x20the\x20automatic\x20sync\x20target','trim','dev','714378DvlLsl','78YLRINn','targetEnv','includes','dbLinkId','27BknaQP','string','--deployment-target-env\x20must\x20be\x20one\x20of:\x20','9829150ztdOrA','pre','number','isSafeInteger','deployment-db-id','4147241iomQuq','81645CMKwkK'];a217_0x25a6=function(){return _0x3651dd;};return a217_0x25a6();}(function(_0x27e955,_0x1ef5c2){const _0x3bb660=a217_0x2b10,_0x1f5caa=_0x27e955();while(!![]){try{const _0x51e7fc=-parseInt(_0x3bb660(0x1aa))/0x1+-parseInt(_0x3bb660(0x1ae))/0x2+-parseInt(_0x3bb660(0x1a8))/0x3+-parseInt(_0x3bb660(0x1a4))/0x4+-parseInt(_0x3bb660(0x1bc))/0x5*(parseInt(_0x3bb660(0x1af))/0x6)+-parseInt(_0x3bb660(0x1bb))/0x7*(parseInt(_0x3bb660(0x1be))/0x8)+-parseInt(_0x3bb660(0x1b3))/0x9*(-parseInt(_0x3bb660(0x1b6))/0xa);if(_0x51e7fc===_0x1ef5c2)break;else _0x1f5caa['push'](_0x1f5caa['shift']());}catch(_0x4459ef){_0x1f5caa['push'](_0x1f5caa['shift']());}}}(a217_0x25a6,0x49881));import{CliErrors}from'../errors.js';export const AUTO_DEPLOYMENT_TARGET_ENVS=[a217_0x636b8e(0x1ad),'test',a217_0x636b8e(0x1b7)];export function getDeploymentSyncProfileFlagDefs(){const _0x3b8c66=a217_0x636b8e;return[{'name':_0x3b8c66(0x1ba),'type':_0x3b8c66(0x1b8),'description':_0x3b8c66(0x1ab)},{'name':_0x3b8c66(0x1c0),'type':_0x3b8c66(0x1b4),'enum':[...AUTO_DEPLOYMENT_TARGET_ENVS],'description':_0x3b8c66(0x1bd)}];}export function collectDeploymentSyncProfile(_0x2cfe67){const _0x466f79=a217_0x636b8e,_0x109fe9=_0x2cfe67('deployment-db-id')[_0x466f79(0x1ac)](),_0x9b5a2d=_0x2cfe67('deployment-target-env')[_0x466f79(0x1ac)]();if(!_0x109fe9&&!_0x9b5a2d)return undefined;return validateDeploymentSyncProfile({'dbLinkId':_0x109fe9?Number(_0x109fe9):undefined,'targetEnv':_0x9b5a2d||undefined});}export function validateDeploymentSyncProfile(_0x3050ea){const _0x4e51d3=a217_0x636b8e;if(!_0x3050ea||typeof _0x3050ea!==_0x4e51d3(0x1bf)||Array['isArray'](_0x3050ea))throw CliErrors['validation'](_0x4e51d3(0x1a9));const _0x1ed3ec=_0x3050ea,_0x2886d3=Number(_0x1ed3ec[_0x4e51d3(0x1b2)]);if(!Number[_0x4e51d3(0x1b9)](_0x2886d3)||_0x2886d3<=0x0)throw CliErrors['validation'](_0x4e51d3(0x1a6));const _0x5ba2b5=typeof _0x1ed3ec[_0x4e51d3(0x1b0)]===_0x4e51d3(0x1b4)?_0x1ed3ec[_0x4e51d3(0x1b0)][_0x4e51d3(0x1ac)]():'';if(!AUTO_DEPLOYMENT_TARGET_ENVS[_0x4e51d3(0x1b1)](_0x5ba2b5))throw CliErrors[_0x4e51d3(0x1a5)](_0x4e51d3(0x1b5)+AUTO_DEPLOYMENT_TARGET_ENVS['join'](',\x20')+'.',_0x4e51d3(0x1a7));return{'dbLinkId':_0x2886d3,'targetEnv':_0x5ba2b5};}
@@ -1,10 +1,46 @@
1
+ import { ENTERPRISE_ROUTING_CDN_FIELDS, ENTERPRISE_ROUTING_DOMAIN_FIELDS, ENTERPRISE_ROUTING_CONSUMERS } from "../generated/routing-contract.js";
1
2
  export declare const DOMAIN_CONFIG_FIELDS: readonly ["userDomain", "apiDomain", "runtimeDomain", "skillDomain", "kbDomain", "appDomain", "localDomain", "certificateDomain"];
2
3
  export type DomainConfigField = (typeof DOMAIN_CONFIG_FIELDS)[number];
3
4
  export type DomainConfig = Partial<Record<DomainConfigField, string>>;
5
+ export type EnterpriseRoutingDomainField = (typeof ENTERPRISE_ROUTING_DOMAIN_FIELDS)[number];
6
+ export type EnterpriseRoutingConsumer = (typeof ENTERPRISE_ROUTING_CONSUMERS)[number];
7
+ export type EnterpriseRoutingDomainOverrides = Partial<Record<"default" | EnterpriseRoutingConsumer, string>>;
8
+ export type EnterpriseRoutingDomainValue = string | EnterpriseRoutingDomainOverrides;
9
+ export type EnterpriseRoutingDomains = Record<EnterpriseRoutingDomainField, EnterpriseRoutingDomainValue | undefined>;
10
+ export type EnterpriseRoutingCdnField = (typeof ENTERPRISE_ROUTING_CDN_FIELDS)[number];
11
+ export type EnterpriseRoutingCdn = Record<EnterpriseRoutingCdnField, string>;
12
+ export type DomainConfigInput = {
13
+ mode: "legacy";
14
+ domains: DomainConfig;
15
+ } | {
16
+ mode: "enterprise-v1";
17
+ domains: DomainConfig;
18
+ manifestDomains: EnterpriseRoutingDomains;
19
+ cdn: EnterpriseRoutingCdn;
20
+ };
4
21
  /** Old domain keys accepted only while reading existing configuration. */
5
22
  export declare const LEGACY_DOMAIN_CONFIG_FIELDS: readonly ["agentDomain", "platformDomain", "skillHubDomain"];
6
- export declare function normalizeDomainOrigin(field: DomainConfigField, input: unknown): string;
23
+ export declare function normalizeDomainOrigin(field: DomainConfigField | EnterpriseRoutingDomainField, input: unknown): string;
24
+ export declare function normalizeRoutingDomainValue(field: EnterpriseRoutingDomainField, input: unknown): EnterpriseRoutingDomainValue;
25
+ export declare function normalizeCdnBaseUrl(field: EnterpriseRoutingCdnField, input: unknown): string;
26
+ /**
27
+ * Parse the optional enterprise routing value stored in CLI configuration.
28
+ * Presence is strict: malformed values must never silently fall back to an
29
+ * official service route.
30
+ */
31
+ export declare function resolveEnterpriseRoutingConfig(input: unknown): DomainConfig | undefined;
32
+ export declare function resolveEnterpriseRoutingManifest(input: unknown): Extract<DomainConfigInput, {
33
+ mode: "enterprise-v1";
34
+ }> | undefined;
35
+ export declare function resolveRoutingDomainValue(field: EnterpriseRoutingDomainField, value: EnterpriseRoutingDomainValue, consumer: EnterpriseRoutingConsumer): string;
36
+ export declare function readDomainConfigInput(filePath: string): DomainConfigInput;
7
37
  export declare function readDomainConfig(filePath: string): DomainConfig;
38
+ export declare function resolveDomainConfigInput(ctx: {
39
+ str(name: string): string;
40
+ }): DomainConfigInput;
8
41
  export declare function resolveDomainFlags(ctx: {
9
42
  str(name: string): string;
10
43
  }): DomainConfig;
44
+ export declare function parseEnterpriseRoutingManifest(source: Record<string, unknown>): Extract<DomainConfigInput, {
45
+ mode: "enterprise-v1";
46
+ }>;