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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (344) 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 +21 -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/kb-search-client.js +1 -1
  263. package/lib/core/page/file-system.js +1 -1
  264. package/lib/core/page/hash.js +1 -1
  265. package/lib/core/page/lock.js +1 -1
  266. package/lib/core/sql-index-auditor.js +1 -1
  267. package/lib/core/sql-sync/config.js +1 -1
  268. package/lib/core/sql-sync/file-system.js +1 -1
  269. package/lib/core/sql-sync/hash.js +1 -1
  270. package/lib/core/sql-sync/lock.js +1 -1
  271. package/lib/core/sql-sync/utils.js +1 -1
  272. package/lib/core/sql-validator.js +1 -1
  273. package/lib/errors.js +1 -1
  274. package/lib/framework/build-all-flags.js +1 -1
  275. package/lib/framework/error-output.js +1 -1
  276. package/lib/framework/explicit-yes.js +1 -1
  277. package/lib/framework/flags.js +1 -1
  278. package/lib/framework/help.js +1 -1
  279. package/lib/framework/index.js +1 -1
  280. package/lib/framework/output.js +1 -1
  281. package/lib/framework/response.js +1 -1
  282. package/lib/framework/runner-alias.js +1 -1
  283. package/lib/framework/runner.js +1 -1
  284. package/lib/framework/schema-export.js +1 -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 +15 -12
  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 +3 -3
  336. package/skills/rabetbase/references/rabetbase-database-template.md +36 -0
  337. package/skills/rabetbase/references/rabetbase-doctor.md +1 -0
  338. package/skills/rabetbase/references/rabetbase-init.md +32 -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 +64 -0
  342. package/skills/rabetbase.manifest.json +6 -3
  343. package/lib/config/project-routing.d.ts +0 -30
  344. package/lib/config/project-routing.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_0x43f694=a203_0x2235;(function(_0x46c978,_0x509d32){const _0x1b7543=a203_0x2235,_0x48ee5e=_0x46c978();while(!![]){try{const _0x265926=-parseInt(_0x1b7543(0xa5))/0x1*(-parseInt(_0x1b7543(0xb5))/0x2)+-parseInt(_0x1b7543(0xd6))/0x3+parseInt(_0x1b7543(0xd2))/0x4*(-parseInt(_0x1b7543(0xdc))/0x5)+-parseInt(_0x1b7543(0xa7))/0x6+-parseInt(_0x1b7543(0xbf))/0x7+parseInt(_0x1b7543(0xd7))/0x8+parseInt(_0x1b7543(0xb0))/0x9;if(_0x265926===_0x509d32)break;else _0x48ee5e['push'](_0x48ee5e['shift']());}catch(_0x55fb4a){_0x48ee5e['push'](_0x48ee5e['shift']());}}}(a203_0x5796,0x8974f));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';function a203_0x2235(_0x129965,_0x3bea44){_0x129965=_0x129965-0x9d;const _0x57969c=a203_0x5796();let _0x22358b=_0x57969c[_0x129965];return _0x22358b;}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(_0x2bef72,_0x375b6c,_0x333cca){const _0x4d7229=a203_0x2235,_0x6b177e=await scanLocalSqlQueries(_0x2bef72),_0x33116c=new Map();for(const _0x2bc1b4 of _0x6b177e){if(_0x333cca&&_0x2bc1b4[_0x4d7229(0xac)]!==_0x333cca)continue;const _0x2c248c=_0x33116c[_0x4d7229(0xa1)](_0x2bc1b4[_0x4d7229(0xac)])??[];_0x2c248c[_0x4d7229(0xb7)](_0x2bc1b4),_0x33116c[_0x4d7229(0xbd)](_0x2bc1b4[_0x4d7229(0xac)],_0x2c248c);}if(_0x333cca&&!_0x33116c[_0x4d7229(0xa6)](_0x333cca))throw CliErrors['validation'](_0x4d7229(0xb3)+_0x333cca);const _0x3160a5=[];for(const [_0x5a4d39,_0x1bbb51]of _0x33116c[_0x4d7229(0xcc)]()){if(_0x1bbb51['length']===0x1){_0x3160a5[_0x4d7229(0xb7)](_0x1bbb51[0x0]);continue;}const _0x2e38b0=_0x375b6c['sqls'][_0x5a4d39],_0x2462ac=_0x2e38b0?.[_0x4d7229(0xa3)],_0x5cee43=_0x2462ac?_0x1bbb51[_0x4d7229(0xc2)](_0x49b124=>_0x49b124[_0x4d7229(0x9e)]!==_0x2462ac):_0x1bbb51;if(_0x2e38b0&&_0x5cee43[_0x4d7229(0xc5)]===0x1){_0x3160a5[_0x4d7229(0xb7)](_0x5cee43[0x0]);continue;}throw CliErrors[_0x4d7229(0xad)](_0x4d7229(0xbc)+_0x5a4d39+'.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.');}return _0x3160a5;}export const sqlPush={'service':a203_0x43f694(0xaa),'command':a203_0x43f694(0xb7),'description':'Push\x20local\x20SQL\x20files\x20to\x20remote','risk':a203_0x43f694(0xe1),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a203_0x43f694(0xcf),'type':a203_0x43f694(0xbb),'description':'Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock'}],async 'validate'(_0x5eb535){validateAutomaticDeploymentSync(_0x5eb535);},async 'dryRun'(_0x131d29){const _0x1b2af1=a203_0x43f694,_0x215125=loadSqlProjectConfig(_0x131d29['appCode']),_0x322930=await readSqlLockFile(_0x215125['lockFilePath']),{appLock:_0x9aa4c1}=ensureSqlLockScope(_0x322930??createEmptySqlLock(),_0x131d29[_0x1b2af1(0xcb)],_0x215125[_0x1b2af1(0xda)],_0x1b2af1(0xb7)),_0x5bf605=await getTargetSqlQueries(_0x215125,_0x9aa4c1,_0x131d29[_0x1b2af1(0xde)](_0x1b2af1(0xce))||undefined),_0x447b8c=[];for(const _0x45859c of _0x5bf605){const _0x78e785=await computeSqlFileHash(_0x45859c[_0x1b2af1(0xc0)]),_0x529e2c=_0x9aa4c1[_0x1b2af1(0xd9)][_0x45859c['sqlCode']],_0x5be3d5=!!_0x529e2c&&(_0x529e2c[_0x1b2af1(0xa3)]!==_0x45859c[_0x1b2af1(0x9e)]||!!_0x45859c['sqlName']&&_0x529e2c[_0x1b2af1(0xb6)]!==_0x45859c[_0x1b2af1(0xb6)]);if(!_0x131d29['bool'](_0x1b2af1(0xcf))&&_0x529e2c&&_0x529e2c[_0x1b2af1(0xbe)]===_0x78e785&&!_0x5be3d5)continue;_0x447b8c[_0x1b2af1(0xb7)](_0x45859c['sqlCode']);}return{'method':_0x1b2af1(0xc8),'url':_0x1b2af1(0xd3),'deploymentSync':buildAutomaticDeploymentSyncPreview(_0x131d29,_0x1b2af1(0xaa),_0x447b8c),'body':{'sqlCodes':_0x447b8c,'appCode':_0x131d29['appCode']},'description':_0x1b2af1(0x9d)+_0x447b8c[_0x1b2af1(0xc5)]+'\x20SQL\x20file(s)'};},async 'execute'(_0x113296){const _0x5bbc99=a203_0x43f694,_0x325c35=loadSqlProjectConfig(_0x113296['appCode']),_0xa91b64=await readSqlLockFile(_0x325c35[_0x5bbc99(0xd0)]),{lockData:_0x5dddee,appLock:_0x1511d2}=ensureSqlLockScope(_0xa91b64??createEmptySqlLock(),_0x113296[_0x5bbc99(0xcb)],_0x325c35[_0x5bbc99(0xda)],_0x5bbc99(0xb7)),_0x3414a7=await getTargetSqlQueries(_0x325c35,_0x1511d2,_0x113296['str'](_0x5bbc99(0xce))||undefined);if(_0x3414a7['length']===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x5bbc99(0xca)};const _0x43dfbb=[],_0x1ff811=[],_0x3958bf=[];for(const _0x3f003a of _0x3414a7){const _0x1b65d5=_0x1511d2['sqls'][_0x3f003a['sqlCode']];if(!_0x1b65d5){_0x3958bf[_0x5bbc99(0xb7)]({'sqlCode':_0x3f003a[_0x5bbc99(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 _0xd4b703=await computeSqlFileHash(_0x3f003a[_0x5bbc99(0xc0)]),_0x1e9352=_0x1b65d5[_0x5bbc99(0xa3)]!==_0x3f003a[_0x5bbc99(0x9e)]||!!_0x3f003a['sqlName']&&_0x1b65d5[_0x5bbc99(0xb6)]!==_0x3f003a[_0x5bbc99(0xb6)];if(!_0x113296['bool'](_0x5bbc99(0xcf))&&_0x1b65d5[_0x5bbc99(0xbe)]===_0xd4b703&&!_0x1e9352){_0x1ff811[_0x5bbc99(0xb7)]({'sqlCode':_0x3f003a[_0x5bbc99(0xac)],'reason':_0x5bbc99(0xc1)});continue;}if(_0x1b65d5[_0x5bbc99(0xb8)]==null){_0x3958bf['push']({'sqlCode':_0x3f003a[_0x5bbc99(0xac)],'error':_0x5bbc99(0xdb)});continue;}const _0x87e539=await readFile(_0x3f003a['filePath'],_0x5bbc99(0xd8)),_0x54a461=stripLocalSqlMetadata(_0x87e539,_0x3f003a[_0x5bbc99(0xb9)]),_0x262999=_0x3f003a['sqlName']||_0x1b65d5[_0x5bbc99(0xb6)],_0x5b4ba1=await resolveTargetDbBinding(_0x113296[_0x5bbc99(0xcb)],_0x3f003a,_0x1b65d5),_0x2459c6=await updateSqlQuery({'id':_0x1b65d5['remoteId'],'appCode':_0x113296['appCode'],'sqlCode':_0x3f003a[_0x5bbc99(0xac)],'sqlName':_0x262999,'dbId':_0x5b4ba1[_0x5bbc99(0xd5)],'version':_0x1b65d5[_0x5bbc99(0xb8)],'sqlContent':_0x54a461,'sqlConfig':_0x1b65d5[_0x5bbc99(0xdd)]??undefined}),_0x1f46b9=_0x2459c6[_0x5bbc99(0xd5)]?await getDbName(_0x113296['appCode'],Number(_0x2459c6['dbId']))[_0x5bbc99(0xc4)](()=>_0x5b4ba1['dbName']):_0x5b4ba1['dbName'];_0x1511d2[_0x5bbc99(0xd9)][_0x3f003a[_0x5bbc99(0xac)]]={...buildSqlLockEntry(_0x2459c6,_0x54a461,_0xd4b703,{'dbName':_0x1f46b9}),'path':_0x3f003a[_0x5bbc99(0x9e)],'mode':_0x1b65d5[_0x5bbc99(0xb9)]},await archivePreviousSqlFileIfNeeded(_0x325c35,_0x1b65d5[_0x5bbc99(0xa3)],_0x3f003a['relativePath']),_0x43dfbb[_0x5bbc99(0xb7)]({'sqlCode':_0x3f003a[_0x5bbc99(0xac)],'remoteId':_0x1b65d5[_0x5bbc99(0xd1)]});}catch(_0x299b02){_0x3958bf[_0x5bbc99(0xb7)]({'sqlCode':_0x3f003a['sqlCode'],'error':_0x299b02 instanceof Error?_0x299b02[_0x5bbc99(0xb1)]:String(_0x299b02)});}}_0x1511d2[_0x5bbc99(0xb4)]=new Date()[_0x5bbc99(0xa8)](),await writeSqlLockFile(_0x325c35[_0x5bbc99(0xd0)],_0x5dddee);const _0x46d204=_0x3958bf[_0x5bbc99(0xc5)]===0x0,_0x494a03=await runAutomaticDeploymentSync(_0x113296,_0x5bbc99(0xaa),_0x43dfbb[_0x5bbc99(0xaf)](_0x571dec=>_0x571dec[_0x5bbc99(0xac)]),_0x46d204),_0x39be04=_0x46d204&&automaticDeploymentSyncSucceeded(_0x494a03),_0x883083=_0x494a03[_0x5bbc99(0x9f)]?_0x5bbc99(0xae)+_0x494a03[_0x5bbc99(0xa9)]:'';return{'ok':_0x39be04,'data':{'pushed':_0x43dfbb,'skipped':_0x1ff811,'failed':_0x3958bf,'deploymentSync':_0x494a03},'message':_0x5bbc99(0xa2)+_0x43dfbb[_0x5bbc99(0xc5)]+_0x5bbc99(0xc3)+_0x1ff811[_0x5bbc99(0xc5)]+'\x20skipped,\x20'+_0x3958bf['length']+_0x5bbc99(0xc7)+_0x883083};}};async function archivePreviousSqlFileIfNeeded(_0x53274e,_0x1394c2,_0x1fc694){const _0x51d9ec=a203_0x43f694;if(!_0x1394c2||_0x1394c2===_0x1fc694)return;const _0x378689=join(_0x53274e[_0x51d9ec(0xdf)],_0x1394c2);if(!await fileExists(_0x378689))return;const _0x77bb9b=await moveToTrash(_0x53274e[_0x51d9ec(0xba)],_0x53274e[_0x51d9ec(0xb2)],_0x378689);await cleanupEmptyDirectories(dirname(_0x378689),_0x53274e[_0x51d9ec(0xdf)]),void _0x77bb9b;}function a203_0x5796(){const _0x330417=['remoteId','12eYJTIM','/smartapi/custom/updateUserCustomSql','join','dbId','711936NXZAFw','1836848KkaQHP','utf8','sqls','sqlRoot','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','1403555JcGEzj','sqlConfig','str','sqlRootDir','replace','write','Would\x20push\x20','relativePath','configured','startsWith','get','Push\x20complete:\x20','path','exec','235573rAehbW','has','2430456eNVGHe','toISOString','status','sql','\x22\x20for\x20sqlCode\x20','sqlCode','validation',',\x20deployment\x20sync\x20','map','11059659anPMHc','message','trashDir','Local\x20SQL\x20not\x20found:\x20','lastSync','6IwufCB','sqlName','push','version','mode','projectRoot','boolean','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','set','hash','823424bzpSSv','filePath','unchanged','filter','\x20pushed,\x20','catch','length','Local\x20directory\x20\x22','\x20failed','POST','dbName','No\x20local\x20SQL\x20files\x20found.','appCode','entries','dbDirectory','sqlcode','force','lockFilePath'];a203_0x5796=function(){return _0x330417;};return a203_0x5796();}async function moveToTrash(_0x31a55f,_0x2a95e4,_0x426285){const _0x16f3df=a203_0x43f694,_0x3f4ba6=new Date()[_0x16f3df(0xa8)]()[_0x16f3df(0xe0)](/[:.]/g,'-'),_0x5247fc=relative(_0x31a55f,_0x426285),_0x5de2e9=join(_0x2a95e4,_0x3f4ba6,_0x5247fc);return await mkdir(dirname(_0x5de2e9),{'recursive':!![]}),await rename(_0x426285,_0x5de2e9),_0x5de2e9;}async function cleanupEmptyDirectories(_0x2bfad7,_0x20e32c){const _0x4952a3=a203_0x43f694;let _0x199782=resolve(_0x2bfad7);const _0x12df9c=resolve(_0x20e32c);while(_0x199782[_0x4952a3(0xa0)](''+_0x12df9c+sep)||_0x199782===_0x12df9c){if(_0x199782===_0x12df9c)return;try{const _0x426187=await readdir(_0x199782);if(_0x426187[_0x4952a3(0xc5)]>0x0)return;await rmdir(_0x199782);}catch{return;}_0x199782=dirname(_0x199782);}}async function resolveTargetDbBinding(_0xad83a1,_0x37a124,_0x552b5a){const _0x2369df=a203_0x43f694,_0x40f314=_0x37a124[_0x2369df(0xcd)];if(!_0x40f314)return{'dbId':_0x552b5a[_0x2369df(0xd5)],'dbName':_0x552b5a[_0x2369df(0xc9)]};const _0x3d2c38=buildDbDirectoryName(_0x552b5a[_0x2369df(0xc9)],_0x552b5a[_0x2369df(0xd5)]);if(_0x40f314===_0x3d2c38)return{'dbId':_0x552b5a['dbId'],'dbName':_0x552b5a[_0x2369df(0xc9)]};const _0x538a7a=parseExplicitDbDirectory(_0x40f314);if(_0x538a7a!=null)return{'dbId':_0x538a7a,'dbName':await getDbName(_0xad83a1,_0x538a7a)['catch'](()=>undefined)};const _0x4e18f9=await listDatabases(_0xad83a1),_0x3c49db=_0x4e18f9[_0x2369df(0xc2)](_0x513709=>buildDbDirectoryName(_0x513709[_0x2369df(0xc9)],_0x513709[_0x2369df(0xd5)])===_0x40f314);if(_0x3c49db[_0x2369df(0xc5)]===0x1)return{'dbId':_0x3c49db[0x0]['dbId'],'dbName':_0x3c49db[0x0][_0x2369df(0xc9)]};if(_0x3c49db[_0x2369df(0xc5)]===0x0)throw CliErrors[_0x2369df(0xad)]('No\x20database\x20matches\x20local\x20directory\x20\x22'+_0x40f314+_0x2369df(0xab)+_0x37a124['sqlCode']+'.');const _0x1c70d0=_0x3c49db['map'](_0x37e402=>_0x37e402['dbName']+'\x20('+_0x37e402[_0x2369df(0xd5)]+')')[_0x2369df(0xd4)](',\x20');throw CliErrors[_0x2369df(0xad)](_0x2369df(0xc6)+_0x40f314+'\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20'+_0x37a124[_0x2369df(0xac)]+':\x20'+_0x1c70d0);}function parseExplicitDbDirectory(_0xbb8240){const _0x49efeb=a203_0x43f694,_0xd24cf2=/^db-(\d+)$/[_0x49efeb(0xa4)](_0xbb8240);if(!_0xd24cf2)return null;const _0x47cc78=Number(_0xd24cf2[0x1]);return Number['isFinite'](_0x47cc78)&&_0x47cc78>0x0?_0x47cc78: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_0x4bab36=a204_0x7244;(function(_0x5d323f,_0x485566){const _0x15ad71=a204_0x7244,_0x3bd5a6=_0x5d323f();while(!![]){try{const _0x115282=parseInt(_0x15ad71(0x194))/0x1*(-parseInt(_0x15ad71(0x18a))/0x2)+-parseInt(_0x15ad71(0x182))/0x3*(-parseInt(_0x15ad71(0x189))/0x4)+parseInt(_0x15ad71(0x197))/0x5+-parseInt(_0x15ad71(0x187))/0x6*(-parseInt(_0x15ad71(0x18b))/0x7)+-parseInt(_0x15ad71(0x179))/0x8*(-parseInt(_0x15ad71(0x18d))/0x9)+-parseInt(_0x15ad71(0x184))/0xa+parseInt(_0x15ad71(0x191))/0xb*(-parseInt(_0x15ad71(0x176))/0xc);if(_0x115282===_0x485566)break;else _0x3bd5a6['push'](_0x3bd5a6['shift']());}catch(_0x1d1c09){_0x3bd5a6['push'](_0x3bd5a6['shift']());}}}(a204_0x8614,0x9b4af));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_0x4bab36(0x17f);export function buildSqlLockEntry(_0xf795c6,_0x323c35,_0x21c1bd,_0x536868){const _0x2d9d0d=a204_0x4bab36,_0x97d155=detectSqlMode(_0x323c35);return{'path':buildSqlRelativePath(_0xf795c6[_0x2d9d0d(0x18f)],_0xf795c6[_0x2d9d0d(0x178)],_0x536868?.[_0x2d9d0d(0x181)],_0x97d155,_0xf795c6[_0x2d9d0d(0x18e)]),'hash':_0x21c1bd,'remoteId':_0xf795c6['id'],'version':_0xf795c6[_0x2d9d0d(0x16f)],'dbId':Number(_0xf795c6[_0x2d9d0d(0x18e)]),'dbName':_0x536868?.[_0x2d9d0d(0x181)],'sqlName':_0xf795c6['sqlName'],'sqlConfig':_0xf795c6['sqlConfig']??undefined,'mode':_0x97d155};}function a204_0x8614(){const _0x3610d0=['apps','.rabetbase/sql','length','dbName','3ovpYZA','close','10478950KOweXY','fromEntries','mode','6375966YgWoNs','question','3642308BWjzxp','321766VvmMRb','7qBDcFx','filter','133659Dogevt','dbId','sqlCode','join','713779uSDoNl','syncedAt','split','7gtrXAa','map','includes','5808100XLtrGb','sqls','push','mybatisXml','stderr','\x20-->','version','entries','lastSync','<!--\x20@lovrabet.','trim','path','sqlRoot','288nzQihc','endsWith','sqlName','664KuzsJu','toLowerCase','description','trimStart','replace'];a204_0x8614=function(){return _0x3610d0;};return a204_0x8614();}function a204_0x7244(_0x52fd32,_0x5dd50b){_0x52fd32=_0x52fd32-0x16f;const _0x8614f6=a204_0x8614();let _0x7244c4=_0x8614f6[_0x52fd32];return _0x7244c4;}export function cloneSqlLockData(_0x7f3d62){const _0x29c8fb=a204_0x4bab36;return{'apps':Object[_0x29c8fb(0x185)](Object[_0x29c8fb(0x170)](_0x7f3d62[_0x29c8fb(0x17e)])[_0x29c8fb(0x195)](([_0x2a0afc,_0x1dc5a0])=>[_0x2a0afc,{'sqlRoot':_0x1dc5a0[_0x29c8fb(0x175)],'lastSync':_0x1dc5a0[_0x29c8fb(0x171)],'sqls':{..._0x1dc5a0[_0x29c8fb(0x198)]}}]))};}export function ensureRemoteSqlContent(_0x4654d5){return _0x4654d5['sqlContent']??'';}export function buildLocalSqlFileContent(_0x14c0ae,_0x54f4ef,_0x2b6b2a){const _0x165d6f=a204_0x4bab36,_0x674fc1=_0x2b6b2a?.['mode']??detectSqlMode(_0x54f4ef),_0xfeb1bf=stripLocalSqlMetadata(_0x54f4ef,_0x674fc1)[_0x165d6f(0x173)](),_0x43ed14=[...buildMetadataHeaderLines({'sqlCode':_0x14c0ae[_0x165d6f(0x18f)],'sqlName':_0x14c0ae[_0x165d6f(0x178)],'dbId':_0x14c0ae['dbId'],'dbName':_0x2b6b2a?.[_0x165d6f(0x181)],'mode':_0x674fc1,'syncedAt':_0x2b6b2a?.[_0x165d6f(0x192)],'description':_0x2b6b2a?.['description']},_0x674fc1),'',_0xfeb1bf],_0x15e076=_0x43ed14[_0x165d6f(0x190)]('\x0a');return _0x15e076[_0x165d6f(0x177)]('\x0a')?_0x15e076:_0x15e076+'\x0a';}export function stripLocalSqlMetadata(_0x44db2d,_0x4be80c){const _0x3a57c3=a204_0x4bab36,_0x4c081b=_0x44db2d[_0x3a57c3(0x17d)](/\r\n/g,'\x0a')[_0x3a57c3(0x193)]('\x0a'),_0x46e8ef=[];let _0x57c825=0x0;if(_0x4be80c===_0x3a57c3(0x19a))while(_0x57c825<_0x4c081b[_0x3a57c3(0x180)]){const _0x21dd2d=_0x4c081b[_0x57c825]??'';if(/^\s*<!--\s*@lovrabet\./['test'](_0x21dd2d)){_0x57c825++;continue;}if(_0x21dd2d[_0x3a57c3(0x173)]()===''&&_0x57c825>0x0){_0x57c825++;continue;}break;}else while(_0x57c825<_0x4c081b[_0x3a57c3(0x180)]){const _0x31ad7a=_0x4c081b[_0x57c825]??'';if(/^\s*--\s*@lovrabet\./['test'](_0x31ad7a)){_0x57c825++;continue;}if(_0x31ad7a['trim']()===''&&_0x57c825>0x0){_0x57c825++;continue;}break;}for(;_0x57c825<_0x4c081b[_0x3a57c3(0x180)];_0x57c825++){_0x46e8ef[_0x3a57c3(0x199)](_0x4c081b[_0x57c825]);}return _0x46e8ef[_0x3a57c3(0x190)]('\x0a')[_0x3a57c3(0x17c)]();}export function resolveSqlMode(_0xd05681,_0x57f9f9){const _0x5df71a=a204_0x4bab36;if(_0x57f9f9?.[_0x5df71a(0x186)])return _0x57f9f9[_0x5df71a(0x186)];return detectSqlMode(_0xd05681);}export function resolveSqlFileName(_0x194296,_0x5ca1bf,_0x4f2b74){const _0x5535dc=a204_0x4bab36;if(_0x4f2b74?.['path'])return _0x4f2b74[_0x5535dc(0x174)];if(_0x4f2b74?.['sqlName']||_0x4f2b74?.[_0x5535dc(0x181)])return buildSqlRelativePath(_0x194296,_0x4f2b74?.[_0x5535dc(0x178)],_0x4f2b74?.[_0x5535dc(0x181)],resolveSqlMode(_0x5ca1bf,_0x4f2b74),_0x4f2b74?.[_0x5535dc(0x18e)]);return buildDefaultSqlFileName(_0x194296,resolveSqlMode(_0x5ca1bf,_0x4f2b74));}export function resolveSqlLocalDir(_0x43548c,_0x3ddb05){return join(_0x43548c,SQL_LOCAL_REL_DIR,_0x3ddb05);}export async function confirmForceOverwrite(_0x3637e8){const _0x903afc=a204_0x4bab36,_0x289904=createInterface({'input':process['stdin'],'output':process[_0x903afc(0x19b)]}),_0x3fe351=await new Promise(_0x28a03c=>{const _0x307b69=_0x903afc;_0x289904[_0x307b69(0x188)](_0x3637e8+'\x20[y/N]\x20',_0x28a03c);});return _0x289904[_0x903afc(0x183)](),['y','yes'][_0x903afc(0x196)](_0x3fe351[_0x903afc(0x173)]()[_0x903afc(0x17a)]());}export function findSqlLockScope(_0xc8e67d,_0x12ea91){const _0x575aa4=a204_0x4bab36;return _0xc8e67d[_0x575aa4(0x17e)][_0x12ea91];}function buildMetadataHeaderLines(_0x233275,_0xb57f6f){const _0x36215b=a204_0x4bab36,_0x550c51=[[_0x36215b(0x18f),_0x233275[_0x36215b(0x18f)]],[_0x36215b(0x178),_0x233275[_0x36215b(0x178)]],['dbId',_0x233275['dbId']],[_0x36215b(0x181),_0x233275[_0x36215b(0x181)]],[_0x36215b(0x186),_0x233275[_0x36215b(0x186)]],[_0x36215b(0x192),_0x233275[_0x36215b(0x192)]],[_0x36215b(0x17b),_0x233275[_0x36215b(0x17b)]]];if(_0xb57f6f===_0x36215b(0x19a))return _0x550c51[_0x36215b(0x18c)](([,_0x5f2695])=>_0x5f2695!==undefined&&_0x5f2695!==null&&String(_0x5f2695)[_0x36215b(0x173)]()!=='')['map'](([_0x14cc84,_0x5cb79e])=>_0x36215b(0x172)+_0x14cc84+':\x20'+String(_0x5cb79e)+_0x36215b(0x19c));return _0x550c51[_0x36215b(0x18c)](([,_0x4544f6])=>_0x4544f6!==undefined&&_0x4544f6!==null&&String(_0x4544f6)[_0x36215b(0x173)]()!=='')[_0x36215b(0x195)](([_0x27d210,_0x342a5e])=>'--\x20@lovrabet.'+_0x27d210+':\x20'+String(_0x342a5e));}
@@ -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_0x4d3e6b=a205_0x3911;(function(_0xbe2052,_0x417482){const _0x4bab55=a205_0x3911,_0x373646=_0xbe2052();while(!![]){try{const _0x3ecbcb=-parseInt(_0x4bab55(0xdb))/0x1*(-parseInt(_0x4bab55(0xc6))/0x2)+parseInt(_0x4bab55(0xc7))/0x3+-parseInt(_0x4bab55(0xdf))/0x4+parseInt(_0x4bab55(0xcd))/0x5+parseInt(_0x4bab55(0xd9))/0x6+-parseInt(_0x4bab55(0xd5))/0x7*(parseInt(_0x4bab55(0xd8))/0x8)+parseInt(_0x4bab55(0xd4))/0x9;if(_0x3ecbcb===_0x417482)break;else _0x373646['push'](_0x373646['shift']());}catch(_0x567d03){_0x373646['push'](_0x373646['shift']());}}}(a205_0x48e7,0x9971a));function a205_0x48e7(){const _0x4b5385=['sqlName','sqls','728bqwgsU','922347hGMyMu','bool','has','sqlRoot','\x20added,\x20','keys','3906530muJLhB','push','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','length','hash','boolean','filePath','32733WwvEZr','299873NjChge','tableData','sqlCode','88SqrqIv','494076HsKyFH','lockKey','2469dQKUzR','relativePath','\x20remote-only','read','3894876LknzRt','sql','appCode','paging','status','\x20missing,\x20','All\x20SQL\x20queries\x20are\x20in\x20sync.','lockFilePath'];a205_0x48e7=function(){return _0x4b5385;};return a205_0x48e7();}import{listSqlQueries}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;async function fetchAllSqlCodes(_0x33d9ca){const _0x4c7d2e=a205_0x3911,_0x3ee730=[];let _0x4e9035=0x1;while(!![]){const _0x1f884b=await listSqlQueries(_0x33d9ca,{'currentPage':_0x4e9035,'pageSize':PAGE_SIZE}),_0xc99798=_0x1f884b[_0x4c7d2e(0xd6)]??[];_0x3ee730['push'](..._0xc99798['map'](_0x1b52c9=>_0x1b52c9[_0x4c7d2e(0xd7)]));if(_0xc99798[_0x4c7d2e(0xd0)]===0x0)break;const _0x4fd2ae=_0x1f884b[_0x4c7d2e(0xbf)]?.['totalCount'];if(_0x4fd2ae!=null?_0x3ee730[_0x4c7d2e(0xd0)]>=_0x4fd2ae:_0xc99798[_0x4c7d2e(0xd0)]<PAGE_SIZE)break;_0x4e9035++;}return _0x3ee730;}function a205_0x3911(_0x80da66,_0x5d71d2){_0x80da66=_0x80da66-0xbe;const _0x48e74f=a205_0x48e7();let _0x3911d7=_0x48e74f[_0x80da66];return _0x3911d7;}export const sqlStatus={'service':a205_0x4d3e6b(0xe0),'command':a205_0x4d3e6b(0xc0),'description':'Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','risk':a205_0x4d3e6b(0xde),'flags':[{'name':'remote','type':a205_0x4d3e6b(0xd2),'description':a205_0x4d3e6b(0xcf)}],async 'execute'(_0x51254e){const _0x471592=a205_0x4d3e6b,_0x496af6=loadSqlProjectConfig(_0x51254e[_0x471592(0xbe)]),_0x495b8f=await readSqlLockFile(_0x496af6[_0x471592(0xc3)]),{appLock:_0x14a262}=ensureSqlLockScope(_0x495b8f??createEmptySqlLock(),_0x496af6[_0x471592(0xbe)],_0x496af6[_0x471592(0xca)],_0x471592(0xc0)),_0x3699e4=await scanLocalSqlQueries(_0x496af6),_0x93ded9=[],_0x4ae058=[],_0xc1e20=[],_0x3a598f=[],_0x35846a=new Set(_0x3699e4['map'](_0x19844f=>_0x19844f['lockKey']));for(const _0x36aa14 of _0x3699e4){const _0x367069=await computeSqlFileHash(_0x36aa14[_0x471592(0xd3)]),_0x110e9e=_0x14a262[_0x471592(0xc5)][_0x36aa14[_0x471592(0xda)]],_0x445722=!!_0x110e9e&&_0x110e9e['path']!==_0x36aa14[_0x471592(0xdc)],_0x5e188e=!!_0x110e9e&&!!_0x36aa14[_0x471592(0xc4)]&&_0x110e9e[_0x471592(0xc4)]!==_0x36aa14[_0x471592(0xc4)];if(!_0x110e9e)_0x93ded9['push'](_0x36aa14[_0x471592(0xda)]);else _0x110e9e[_0x471592(0xd1)]!==_0x367069||_0x445722||_0x5e188e?_0x4ae058[_0x471592(0xce)](_0x36aa14[_0x471592(0xda)]):_0xc1e20[_0x471592(0xce)](_0x36aa14[_0x471592(0xda)]);}for(const _0x166d08 of Object[_0x471592(0xcc)](_0x14a262[_0x471592(0xc5)])){!_0x35846a[_0x471592(0xc9)](_0x166d08)&&_0x3a598f[_0x471592(0xce)](_0x166d08);}const _0x457974=[];if(_0x51254e[_0x471592(0xc8)]('remote')){const _0x1b35bc=await fetchAllSqlCodes(_0x51254e[_0x471592(0xbe)]);for(const _0x48523f of _0x1b35bc){!_0x35846a['has'](_0x48523f)&&!_0x14a262[_0x471592(0xc5)][_0x48523f]&&_0x457974[_0x471592(0xce)](_0x48523f);}}const _0x2eaaa4=_0x93ded9[_0x471592(0xd0)]===0x0&&_0x4ae058[_0x471592(0xd0)]===0x0&&_0x3a598f['length']===0x0&&_0x457974[_0x471592(0xd0)]===0x0;return{'ok':!![],'data':{'added':_0x93ded9,'modified':_0x4ae058,'missing':_0x3a598f,'unchanged':_0xc1e20,'remoteOnly':_0x457974},'message':_0x2eaaa4?_0x471592(0xc2):_0x93ded9[_0x471592(0xd0)]+_0x471592(0xcb)+_0x4ae058[_0x471592(0xd0)]+'\x20modified,\x20'+_0x3a598f[_0x471592(0xd0)]+_0x471592(0xc1)+_0xc1e20[_0x471592(0xd0)]+'\x20unchanged'+(_0x457974[_0x471592(0xd0)]>0x0?',\x20'+_0x457974[_0x471592(0xd0)]+_0x471592(0xdd):'')};}};
@@ -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
+ const a206_0x19c904=a206_0x6941;(function(_0x4d3068,_0x185dc8){const _0x3638bb=a206_0x6941,_0x30579c=_0x4d3068();while(!![]){try{const _0x4d91f5=parseInt(_0x3638bb(0x19f))/0x1*(-parseInt(_0x3638bb(0x1b5))/0x2)+-parseInt(_0x3638bb(0x194))/0x3*(parseInt(_0x3638bb(0x18d))/0x4)+-parseInt(_0x3638bb(0x1b9))/0x5+parseInt(_0x3638bb(0x188))/0x6*(parseInt(_0x3638bb(0x18c))/0x7)+parseInt(_0x3638bb(0x1a0))/0x8+parseInt(_0x3638bb(0x1bb))/0x9+parseInt(_0x3638bb(0x19d))/0xa;if(_0x4d91f5===_0x185dc8)break;else _0x30579c['push'](_0x30579c['shift']());}catch(_0x119b1f){_0x30579c['push'](_0x30579c['shift']());}}}(a206_0x3ca8,0xed349));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';function a206_0x6941(_0x4686f9,_0x11299b){_0x4686f9=_0x4686f9-0x17a;const _0x3ca86f=a206_0x3ca8();let _0x694114=_0x3ca86f[_0x4686f9];return _0x694114;}import{auditSqlJoinIndexes}from'../../core/sql-index-auditor.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';function a206_0x3ca8(){const _0x1a80be=['size','split','tables','toLowerCase','valid','3373818xzPSsw','read','name','schemaWarnings','7VTMazT','44dhRLTE','bool','reason','indexes','columnNames','trim','File\x20not\x20found:\x20','8400DwZWON','schemas','dbtableConfig','flatMap','check-indexes','unshift','boolean','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','tableName','8608760UQzraI','Table\x20\x22','1uYEtSA','4002736phlmkR','parameters','joinAudit','from','index_columns','index_type','validate','cwd','index_name','type','fields','Provide\x20--file\x20or\x20--sql','get','sqlType','SQL\x20schema\x20validation','push','map','find','primary','Dataset\x20\x22','file','1123618ybzFBG','\x22\x20not\x20found\x20or\x20not\x20accessible','isDangerous','filter','2028075KtTxbK','flagMissing','416664DssbcD','sql','utf-8','columns','appCode','string','str','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','message','validation','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','length','isArray','pkField','dataset','Audit\x20top-level\x20JOIN\x20equality\x20predicates\x20against\x20dataset\x20index\x20metadata'];a206_0x3ca8=function(){return _0x1a80be;};return a206_0x3ca8();}import{CliErrors}from'../../errors.js';import{assertDatasetIsDbTableBacked,filterDbTableBackedDatasets}from'../../commands/dataset/capability.js';export const sqlValidate={'service':a206_0x19c904(0x1bc),'command':a206_0x19c904(0x1a6),'description':a206_0x19c904(0x17d),'risk':a206_0x19c904(0x189),'flags':[{'name':a206_0x19c904(0x1b4),'type':'string','description':a206_0x19c904(0x19b)},{'name':a206_0x19c904(0x1bc),'type':a206_0x19c904(0x1c0),'description':a206_0x19c904(0x17a)},{'name':a206_0x19c904(0x195),'type':a206_0x19c904(0x1c0),'description':'Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against'},{'name':a206_0x19c904(0x198),'type':a206_0x19c904(0x19a),'description':a206_0x19c904(0x182)}],async 'execute'(_0xba3f66){const _0x217620=a206_0x19c904,_0x1fe1f1=_0xba3f66[_0x217620(0x1c1)](_0x217620(0x1b4)),_0xa4a61c=_0xba3f66['str']('sql'),_0x4d9311=_0xba3f66[_0x217620(0x1c1)](_0x217620(0x195)),_0x58b220=_0xba3f66[_0x217620(0x18e)](_0x217620(0x198));if(!_0x1fe1f1&&!_0xa4a61c)throw CliErrors[_0x217620(0x1ba)](_0x217620(0x1b4),_0x217620(0x1ab));if(_0x58b220&&!_0x4d9311)throw CliErrors[_0x217620(0x17c)]('--check-indexes\x20requires\x20--schemas.');let _0xb807ce;if(_0x1fe1f1){const _0x5413c0=resolve(process[_0x217620(0x1a7)](),_0x1fe1f1);if(!existsSync(_0x5413c0))throw CliErrors[_0x217620(0x17c)](_0x217620(0x193)+_0x5413c0);_0xb807ce=readFileSync(_0x5413c0,_0x217620(0x1bd));}else _0xb807ce=_0xa4a61c;const _0x3c18ff=validateSql(_0xb807ce),_0x10c49b={'valid':_0x3c18ff['valid'],'sqlType':_0x3c18ff[_0x217620(0x1ad)][_0x217620(0x1a9)],'isSelectOnly':_0x3c18ff[_0x217620(0x1ad)]['isSelectOnly'],'isDangerous':_0x3c18ff[_0x217620(0x1ad)][_0x217620(0x1b7)],'tables':_0x3c18ff[_0x217620(0x185)],'parameters':_0x3c18ff[_0x217620(0x1a1)],'message':_0x3c18ff['message']};_0x3c18ff[_0x217620(0x1ad)][_0x217620(0x18f)]&&(_0x10c49b[_0x217620(0x18f)]=_0x3c18ff[_0x217620(0x1ad)][_0x217620(0x18f)]);if(_0x4d9311&&_0x3c18ff[_0x217620(0x187)]){const _0x1087d7=_0x4d9311['split'](',')[_0x217620(0x1b0)](_0x11b405=>_0x11b405[_0x217620(0x192)]())[_0x217620(0x1b8)](Boolean),_0x1f3973=[],_0x3a0e1d=[],_0x3b952e=filterDbTableBackedDatasets(await listDatasets(_0xba3f66[_0x217620(0x1bf)])),_0x24b00f=new Map(_0x3b952e[_0x217620(0x1b0)](_0x45de79=>[_0x45de79[_0x217620(0x196)]?.[_0x217620(0x19c)]?.[_0x217620(0x186)](),_0x45de79]));for(const _0x4a5e7d of _0x3c18ff[_0x217620(0x185)]){const _0x2215ae=_0x24b00f[_0x217620(0x1ac)](_0x4a5e7d[_0x217620(0x186)]());!_0x2215ae&&_0x1f3973[_0x217620(0x1af)](_0x217620(0x19e)+_0x4a5e7d+'\x22\x20not\x20found\x20in\x20any\x20dataset');}for(const _0xd2be6b of _0x1087d7){let _0xf1cd1c;try{_0xf1cd1c=await getDatasetDetail(_0xd2be6b);}catch{_0x1f3973[_0x217620(0x1af)](_0x217620(0x1b3)+_0xd2be6b+_0x217620(0x1b6));continue;}assertDatasetIsDbTableBacked(_0xf1cd1c,_0x217620(0x1ae));const _0x2773e4=Array[_0x217620(0x17f)](_0xf1cd1c['fields'])?_0xf1cd1c[_0x217620(0x1aa)]:[],_0x358521=new Set(_0x2773e4['map'](_0x195364=>_0x195364[_0x217620(0x18a)]?.[_0x217620(0x186)]())),_0x24322e=_0xf1cd1c[_0x217620(0x196)]?.[_0x217620(0x19c)]||_0xf1cd1c['tableName']||_0xd2be6b;_0x10c49b['schema:'+_0x24322e]={'code':_0xd2be6b,'tableName':_0x24322e,'fieldCount':_0x358521[_0x217620(0x183)],'fields':Array[_0x217620(0x1a3)](_0x358521)};if(_0x58b220){const _0x4b4a7f=normalizeDatasetIndexes(_0xf1cd1c);_0x3a0e1d['push']({'tableName':_0x24322e,..._0x4b4a7f});}}_0x1f3973[_0x217620(0x17e)]>0x0&&(_0x10c49b[_0x217620(0x18b)]=_0x1f3973),_0x58b220&&(_0x10c49b[_0x217620(0x1a2)]=auditSqlJoinIndexes(_0xb807ce,_0x3a0e1d));}return{'ok':_0x3c18ff[_0x217620(0x187)],'data':_0x10c49b,'message':_0x3c18ff[_0x217620(0x17b)]};}};function normalizeDatasetIndexes(_0x1682a0){const _0x5e85b5=a206_0x19c904,_0x28acc4=Array[_0x5e85b5(0x17f)](_0x1682a0?.[_0x5e85b5(0x181)]?.[_0x5e85b5(0x190)])?_0x1682a0[_0x5e85b5(0x181)][_0x5e85b5(0x190)]:Array['isArray'](_0x1682a0?.[_0x5e85b5(0x190)])?_0x1682a0['indexes']:[],_0x12e3c9=_0x28acc4[_0x5e85b5(0x197)](_0x5d498e=>{const _0x1ae502=_0x5e85b5,_0x305dc4=Array[_0x1ae502(0x17f)](_0x5d498e?.[_0x1ae502(0x1a4)])?_0x5d498e[_0x1ae502(0x1a4)]:Array[_0x1ae502(0x17f)](_0x5d498e?.[_0x1ae502(0x191)])?_0x5d498e[_0x1ae502(0x191)]:Array['isArray'](_0x5d498e?.[_0x1ae502(0x1be)])?_0x5d498e[_0x1ae502(0x1be)]:[],_0x69b567=_0x305dc4[_0x1ae502(0x1b8)](_0x2b382f=>typeof _0x2b382f===_0x1ae502(0x1c0))[_0x1ae502(0x1b0)](_0x4bde8b=>_0x4bde8b[_0x1ae502(0x192)]())['filter'](Boolean);if(_0x69b567[_0x1ae502(0x17e)]===0x0)return[];const _0x5ddb06=[_0x5d498e?.['indexName'],_0x5d498e?.[_0x1ae502(0x1a8)],_0x5d498e?.['name']][_0x1ae502(0x1b1)](_0x2193b6=>typeof _0x2193b6==='string'&&_0x2193b6['trim']()),_0xee409b=[_0x5d498e?.[_0x1ae502(0x1a5)],_0x5d498e?.['type']][_0x1ae502(0x1b1)](_0x1eaa5c=>typeof _0x1eaa5c===_0x1ae502(0x1c0)&&_0x1eaa5c[_0x1ae502(0x192)]());return[{..._0x5ddb06?{'name':_0x5ddb06[_0x1ae502(0x192)]()}:{},..._0xee409b?{'type':_0xee409b[_0x1ae502(0x192)]()}:{},'columns':_0x69b567}];}),_0x1982c6=[..._0x12e3c9],_0x3be22a=typeof _0x1682a0?.[_0x5e85b5(0x196)]?.[_0x5e85b5(0x180)]==='string'?_0x1682a0[_0x5e85b5(0x196)]['pkField'][_0x5e85b5(0x184)](',')[_0x5e85b5(0x1b0)](_0x43b3e2=>_0x43b3e2['trim']())[_0x5e85b5(0x1b8)](Boolean):[];return _0x3be22a[_0x5e85b5(0x17e)]>0x0&&_0x1982c6[_0x5e85b5(0x199)]({'type':_0x5e85b5(0x1b2),'columns':_0x3be22a}),{'indexes':_0x1982c6,'metadataAvailable':_0x12e3c9[_0x5e85b5(0x17e)]>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 a207_0x2c83(_0x30fe9e,_0x123919){_0x30fe9e=_0x30fe9e-0xf3;const _0x13cd55=a207_0x13cd();let _0x2c83f0=_0x13cd55[_0x30fe9e];return _0x2c83f0;}(function(_0x26d1bd,_0x45f90d){const _0x2214c3=a207_0x2c83,_0x48d7cf=_0x26d1bd();while(!![]){try{const _0x3e0ce0=parseInt(_0x2214c3(0xfa))/0x1*(-parseInt(_0x2214c3(0xf4))/0x2)+parseInt(_0x2214c3(0xf6))/0x3+-parseInt(_0x2214c3(0xf8))/0x4*(-parseInt(_0x2214c3(0xf5))/0x5)+-parseInt(_0x2214c3(0xfc))/0x6+-parseInt(_0x2214c3(0xfb))/0x7+parseInt(_0x2214c3(0xf9))/0x8+-parseInt(_0x2214c3(0xf7))/0x9*(-parseInt(_0x2214c3(0xf3))/0xa);if(_0x3e0ce0===_0x45f90d)break;else _0x48d7cf['push'](_0x48d7cf['shift']());}catch(_0x361d09){_0x48d7cf['push'](_0x48d7cf['shift']());}}}(a207_0x13cd,0xd62e9));import{taskStatus}from'../../commands/task/status.js';function a207_0x13cd(){const _0x21d5af=['9pMJmQW','4990559QPPXei','10246674QXhjjn','280jOfrXX','144428GlPdAC','5HAxcuT','1557660CKfzMA','624411aNaVGz','4268144HJVscs','3352504vYJEtF'];a207_0x13cd=function(){return _0x21d5af;};return a207_0x13cd();}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
+ const a208_0x38ba53=a208_0x14df;(function(_0x3359e1,_0x4a4475){const _0x59a872=a208_0x14df,_0x31c1eb=_0x3359e1();while(!![]){try{const _0xeef54e=-parseInt(_0x59a872(0x194))/0x1+parseInt(_0x59a872(0x1a1))/0x2*(parseInt(_0x59a872(0x1a5))/0x3)+-parseInt(_0x59a872(0x196))/0x4*(parseInt(_0x59a872(0x19f))/0x5)+parseInt(_0x59a872(0x19c))/0x6+-parseInt(_0x59a872(0x191))/0x7*(parseInt(_0x59a872(0x1a6))/0x8)+parseInt(_0x59a872(0x190))/0x9*(parseInt(_0x59a872(0x1a2))/0xa)+parseInt(_0x59a872(0x1a7))/0xb*(parseInt(_0x59a872(0x192))/0xc);if(_0xeef54e===_0x4a4475)break;else _0x31c1eb['push'](_0x31c1eb['shift']());}catch(_0x1721d6){_0x31c1eb['push'](_0x31c1eb['shift']());}}}(a208_0x4066,0x835de));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asyncTaskMessage,buildAsyncTaskStatusCommand,normalizeAsyncTask}from'../../commands/common/async-task.js';import{getAsyncTaskStatus}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a208_0x14df(_0xad8358,_0x901f0c){_0xad8358=_0xad8358-0x18f;const _0x406678=a208_0x4066();let _0x14dfc8=_0x406678[_0xad8358];return _0x14dfc8;}function a208_0x4066(){const _0x551327=['Query\x20an\x20asynchronous\x20task;\x20repeat\x20for\x20PENDING\x20or\x20PROCESSING\x20until\x20SUCCESS\x20or\x20FAILED','string','5NYYhrT','trim','2LBqqjt','5037530LdHcYy','flagMissing','str','2539359maSTFi','8OwDxYq','201586GBoADp','task','compress','9sPPumS','65261ncRXIf','84wAipWV','status','995588iaYVSN','Task\x20status\x20response\x20id\x20mismatch:\x20requested\x20','3812884VvggSb','Task\x20id\x20returned\x20by\x20an\x20asynchronous\x20platform\x20command','cookie','taskId','task-id','appCode','6106332QyMshZ'];a208_0x4066=function(){return _0x551327;};return a208_0x4066();}export const taskStatus={'service':a208_0x38ba53(0x1a8),'command':a208_0x38ba53(0x193),'description':a208_0x38ba53(0x19d),'risk':'read','defaultOutputFormat':a208_0x38ba53(0x18f),'structuredErrors':!![],'flags':[{'name':a208_0x38ba53(0x19a),'type':a208_0x38ba53(0x19e),'required':!![],'description':a208_0x38ba53(0x197)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x5d17de){const _0x413a56=a208_0x38ba53;if(!_0x5d17de[_0x413a56(0x1a4)](_0x413a56(0x19a))['trim']())throw CliErrors[_0x413a56(0x1a3)](_0x413a56(0x19a));},async 'execute'(_0x4607db){const _0x2de561=a208_0x38ba53,_0x254e1e=_0x4607db[_0x2de561(0x1a4)](_0x2de561(0x19a))[_0x2de561(0x1a0)](),_0x10af25=normalizeAsyncTask(await getAsyncTaskStatus(_0x254e1e,_0x4607db[_0x2de561(0x19b)],_0x4607db[_0x2de561(0x198)]));if(_0x10af25['taskId']!==_0x254e1e)throw CliErrors['apiError'](_0x2de561(0x195)+_0x254e1e+',\x20received\x20'+_0x10af25[_0x2de561(0x199)]+'.');const _0x20fed6=buildAsyncTaskStatusCommand(_0x10af25['taskId'],_0x4607db['appCode']);return{'ok':!![],'message':asyncTaskMessage(_0x10af25),'data':{'appCode':_0x4607db[_0x2de561(0x19b)],..._0x10af25,'query':_0x10af25['isTerminal']?null:{'command':_0x20fed6}}};}};
@@ -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(_0x2552e0,_0x186bf1){const _0xd9b156=a209_0xd67a,_0x23b72b=_0x2552e0();while(!![]){try{const _0x270139=-parseInt(_0xd9b156(0x8a))/0x1+parseInt(_0xd9b156(0x8f))/0x2*(parseInt(_0xd9b156(0x85))/0x3)+parseInt(_0xd9b156(0x8d))/0x4*(parseInt(_0xd9b156(0x8c))/0x5)+-parseInt(_0xd9b156(0x8e))/0x6+parseInt(_0xd9b156(0x86))/0x7*(parseInt(_0xd9b156(0x87))/0x8)+-parseInt(_0xd9b156(0x8b))/0x9*(parseInt(_0xd9b156(0x89))/0xa)+parseInt(_0xd9b156(0x90))/0xb*(-parseInt(_0xd9b156(0x88))/0xc);if(_0x270139===_0x186bf1)break;else _0x23b72b['push'](_0x23b72b['shift']());}catch(_0x4ff7a9){_0x23b72b['push'](_0x23b72b['shift']());}}}(a209_0x3533,0x74610));function a209_0xd67a(_0x6f385c,_0x42855c){_0x6f385c=_0x6f385c-0x85;const _0x3533a3=a209_0x3533();let _0xd67a2e=_0x3533a3[_0x6f385c];return _0xd67a2e;}function a209_0x3533(){const _0x1ae3d6=['4425219rsyNhV','25rrSgum','451088TDiJWv','2047788gjIeZA','4lFOReu','3389881eTCXnF','905244gguWtA','77CqjKJC','380696MTZIhW','12tKplwc','10LVRfJO','72965VBxXpL'];a209_0x3533=function(){return _0x1ae3d6;};return a209_0x3533();}import{tenantMembersListDefinition}from'../../commands/tenant/members-list.js';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_0x2217c3=a210_0x574a;(function(_0x20a361,_0x183598){const _0x1de8c2=a210_0x574a,_0x26c030=_0x20a361();while(!![]){try{const _0x384b38=parseInt(_0x1de8c2(0x8d))/0x1+-parseInt(_0x1de8c2(0x90))/0x2*(parseInt(_0x1de8c2(0x8c))/0x3)+parseInt(_0x1de8c2(0x88))/0x4+-parseInt(_0x1de8c2(0x7f))/0x5*(-parseInt(_0x1de8c2(0x86))/0x6)+parseInt(_0x1de8c2(0x8f))/0x7*(-parseInt(_0x1de8c2(0x80))/0x8)+parseInt(_0x1de8c2(0x81))/0x9+parseInt(_0x1de8c2(0x8e))/0xa;if(_0x384b38===_0x183598)break;else _0x26c030['push'](_0x26c030['shift']());}catch(_0x552d71){_0x26c030['push'](_0x26c030['shift']());}}}(a210_0x3391,0x6cb1b));import{listCurrentUserTenantMemberships,listTenantDirectoryMembers}from'../../core/api-client.js';function a210_0x3391(){const _0x544c74=['str','35hoFqFE','1064OSLwrZ','6538221YFlLsl','Found\x20','read','trim','tenant-code','330354KRslMp','Pass\x20--tenant-code\x20<code>.','722080eDXvvx','List\x20members\x20of\x20a\x20tenant\x20available\x20to\x20the\x20current\x20account','flagMissing','string','37227eZXLAE','48002jedvaR','3384290LKCQZH','18557xwMHTs','142EuFoUg','length'];a210_0x3391=function(){return _0x544c74;};return a210_0x3391();}function a210_0x574a(_0x25ae62,_0x5164b2){_0x25ae62=_0x25ae62-0x7e;const _0x339177=a210_0x3391();let _0x574a0e=_0x339177[_0x25ae62];return _0x574a0e;}import{CliErrors}from'../../errors.js';import{assertTenantAccessible,projectTenantMembers}from'../../commands/tenant/shared.js';export const tenantMembersListDefinition={'service':'tenant','command':'members-list','description':a210_0x2217c3(0x89),'risk':a210_0x2217c3(0x83),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a210_0x2217c3(0x85),'type':a210_0x2217c3(0x8b),'required':!![],'description':'Exact\x20tenant\x20code'}],async 'validate'(_0x5118a5){const _0xca3bb4=a210_0x2217c3;if(!_0x5118a5[_0xca3bb4(0x7e)](_0xca3bb4(0x85))[_0xca3bb4(0x84)]())throw CliErrors[_0xca3bb4(0x8a)]('tenant-code',_0xca3bb4(0x87));},async 'execute'(_0x26d8c6){const _0x470628=a210_0x2217c3,_0x5b48f2=_0x26d8c6[_0x470628(0x7e)](_0x470628(0x85))[_0x470628(0x84)](),_0x4a0f6e=await listCurrentUserTenantMemberships();assertTenantAccessible(_0x5b48f2,_0x4a0f6e);const _0x1d403e=projectTenantMembers(await listTenantDirectoryMembers(_0x5b48f2));return{'ok':!![],'data':{'tenantCode':_0x5b48f2,'items':_0x1d403e,'totalCount':_0x1d403e['length']},'message':_0x470628(0x82)+_0x1d403e[_0x470628(0x91)]+'\x20tenant\x20member(s)'};}};
@@ -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_0xad1a(){const _0x30b5b5=['displayName','7100kpgPxp','get','trim','adminFlag','Check\x20--tenant-code\x20or\x20login\x20with\x20an\x20account\x20that\x20belongs\x20to\x20this\x20tenant.','1707003KLzSNK','3AryUbe','values','1962qIfveU','status','5950704kDEegz','set','1298374sIfkON','role','isFinite','334028wMvCcn','username','tenantCode','97910uVeySs','124ZKrNiE','154914IqeIGd','nickname','ADMIN','MEMBER','Tenant\x20\x22','validation','userId','sort'];a211_0xad1a=function(){return _0x30b5b5;};return a211_0xad1a();}(function(_0xe6b071,_0x49d6c7){const _0x17743b=a211_0x5a22,_0x48e5c3=_0xe6b071();while(!![]){try{const _0x3c2170=-parseInt(_0x17743b(0x167))/0x1*(-parseInt(_0x17743b(0x170))/0x2)+-parseInt(_0x17743b(0x166))/0x3+-parseInt(_0x17743b(0x174))/0x4*(parseInt(_0x17743b(0x173))/0x5)+-parseInt(_0x17743b(0x175))/0x6+parseInt(_0x17743b(0x16d))/0x7+parseInt(_0x17743b(0x16b))/0x8+-parseInt(_0x17743b(0x169))/0x9*(-parseInt(_0x17743b(0x161))/0xa);if(_0x3c2170===_0x49d6c7)break;else _0x48e5c3['push'](_0x48e5c3['shift']());}catch(_0x162fe7){_0x48e5c3['push'](_0x48e5c3['shift']());}}}(a211_0xad1a,0x5d930));import{CliErrors}from'../../errors.js';function textOrNull(_0x244665){const _0x1e796d=a211_0x5a22,_0x191a7e=_0x244665?.[_0x1e796d(0x163)]();return _0x191a7e?_0x191a7e:null;}export function projectTenantMembers(_0x408aa6){const _0x5c7242=a211_0x5a22,_0x3d5d10=new Map();for(const _0x28472e of _0x408aa6){const _0x20bd41=Number(_0x28472e[_0x5c7242(0x15e)]);if(!Number[_0x5c7242(0x16f)](_0x20bd41)||_0x20bd41<=0x0)continue;const _0xab2636={'userId':_0x20bd41,'username':textOrNull(_0x28472e[_0x5c7242(0x171)]),'displayName':textOrNull(_0x28472e[_0x5c7242(0x176)]),'role':_0x28472e[_0x5c7242(0x164)]===!![]?_0x5c7242(0x177):_0x5c7242(0x178),'status':textOrNull(_0x28472e[_0x5c7242(0x16a)])},_0x2e6bb9=_0x3d5d10[_0x5c7242(0x162)](_0x20bd41);if(!_0x2e6bb9){_0x3d5d10[_0x5c7242(0x16c)](_0x20bd41,_0xab2636);continue;}_0x2e6bb9[_0x5c7242(0x171)]??=_0xab2636[_0x5c7242(0x171)],_0x2e6bb9[_0x5c7242(0x160)]??=_0xab2636['displayName'],_0x2e6bb9['status']??=_0xab2636[_0x5c7242(0x16a)];if(_0xab2636['role']===_0x5c7242(0x177))_0x2e6bb9[_0x5c7242(0x16e)]=_0x5c7242(0x177);}return[..._0x3d5d10[_0x5c7242(0x168)]()][_0x5c7242(0x15f)]((_0x3cf180,_0xe5d6e7)=>_0x3cf180[_0x5c7242(0x15e)]-_0xe5d6e7['userId']);}function a211_0x5a22(_0x41eeb7,_0x1ed699){_0x41eeb7=_0x41eeb7-0x15e;const _0xad1adf=a211_0xad1a();let _0x5a223f=_0xad1adf[_0x41eeb7];return _0x5a223f;}export function assertTenantAccessible(_0x4a0fb4,_0x36167d){const _0x4d6d44=a211_0x5a22;if(_0x36167d['some'](_0xedd939=>_0xedd939[_0x4d6d44(0x172)]===_0x4a0fb4))return;throw CliErrors[_0x4d6d44(0x17a)](_0x4d6d44(0x179)+_0x4a0fb4+'\x22\x20is\x20not\x20available\x20to\x20the\x20current\x20account.',_0x4d6d44(0x165));}
@@ -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_0x4d2733=a212_0x4a9e;(function(_0x34ee4e,_0x5e4c59){const _0x220115=a212_0x4a9e,_0x3e1885=_0x34ee4e();while(!![]){try{const _0x858058=parseInt(_0x220115(0x105))/0x1*(parseInt(_0x220115(0xf6))/0x2)+parseInt(_0x220115(0xfb))/0x3+parseInt(_0x220115(0xf5))/0x4*(-parseInt(_0x220115(0xf4))/0x5)+parseInt(_0x220115(0xff))/0x6+parseInt(_0x220115(0xf2))/0x7*(parseInt(_0x220115(0xfd))/0x8)+-parseInt(_0x220115(0xf1))/0x9+-parseInt(_0x220115(0xee))/0xa;if(_0x858058===_0x5e4c59)break;else _0x3e1885['push'](_0x3e1885['shift']());}catch(_0x5434e8){_0x3e1885['push'](_0x3e1885['shift']());}}}(a212_0x1956,0x80dfa));import{asDryRunResult}from'../../commands/common/dry-run.js';import{bindDingTalkSandboxAccount,DING_TALK_SANDBOX_BIND_PATH}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a212_0x4a9e(_0x2a0913,_0x446618){_0x2a0913=_0x2a0913-0xee;const _0x195621=a212_0x1956();let _0x4a9ee2=_0x195621[_0x2a0913];return _0x4a9ee2;}const PROVIDER_ID=a212_0x4d2733(0x104),CURRENT_BINDING_WARNING='The\x20current\x20binding\x20is\x20not\x20exposed\x20by\x20the\x20server;\x20before\x20is\x20unavailable.';function readDingTalkUserId(_0x1dd616){const _0x30ef66=a212_0x4d2733,_0x47fa63=_0x1dd616[_0x30ef66(0x100)]('ding-talk-user-id')[_0x30ef66(0x103)]();if(!_0x47fa63)throw CliErrors[_0x30ef66(0x101)]('--ding-talk-user-id\x20cannot\x20be\x20empty.',_0x30ef66(0xf9));return _0x47fa63;}function buildBindingData(_0xac83d3,_0x4b0549){const _0x306e26=a212_0x4d2733;return{'operation':_0x306e26(0xf0),'selector':{'providerId':PROVIDER_ID,'dingTalkUserId':_0xac83d3},'before':null,'after':{'providerId':PROVIDER_ID,'dingTalkUserId':_0xac83d3,'bound':!![]},'dryRun':_0x4b0549,'backend':{'method':'POST','path':DING_TALK_SANDBOX_BIND_PATH},'warnings':[CURRENT_BINDING_WARNING]};}export const dingTalkSandboxBind={'service':a212_0x4d2733(0xf8),'command':a212_0x4d2733(0xfa),'description':a212_0x4d2733(0xf3),'risk':a212_0x4d2733(0xfe),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a212_0x4d2733(0xf7),'type':'string','required':!![],'description':a212_0x4d2733(0x102)}],async 'validate'(_0x250a0a){readDingTalkUserId(_0x250a0a);},async 'dryRun'(_0x16993e){const _0x1b6e08=readDingTalkUserId(_0x16993e);return asDryRunResult(buildBindingData(_0x1b6e08,!![]),{'method':'POST','url':DING_TALK_SANDBOX_BIND_PATH});},async 'execute'(_0x5095bd){const _0x1ee6be=a212_0x4d2733,_0x30433c=readDingTalkUserId(_0x5095bd),_0x8e0b60=await bindDingTalkSandboxAccount(_0x30433c);if(_0x8e0b60!==!![])throw CliErrors[_0x1ee6be(0xfc)]('DingTalk\x20sandbox\x20account\x20binding\x20was\x20not\x20confirmed.',_0x1ee6be(0xef));return{'ok':!![],'data':buildBindingData(_0x30433c,![]),'message':'Bound\x20current\x20user\x20to\x20DingTalk\x20sandbox\x20account.'};}};function a212_0x1956(){const _0x579e75=['5887208SumKsO','write','6046614UmNgFD','str','validation','DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox','trim','dingtalk','3DGUwbH','15352460YqGLls','Retry\x20with\x20the\x20same\x20--ding-talk-user-id\x20only\x20after\x20checking\x20the\x20current\x20platform\x20session.','bind','3462615QnpEBB','7tuHiRC','Bind\x20the\x20current\x20platform\x20user\x20to\x20a\x20DingTalk\x20sandbox\x20account','5755WODTXy','2180TyfmuS','600744fOfhCF','ding-talk-user-id','user-account','Pass\x20the\x20DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox.','dingding-sandbox-bind','1291068mUhybs','apiError'];a212_0x1956=function(){return _0x579e75;};return a212_0x1956();}
@@ -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(_0x5014cd,_0x2cedde){const _0x3c824f=a213_0x5e0f,_0x429fe3=_0x5014cd();while(!![]){try{const _0x3fc766=-parseInt(_0x3c824f(0x6e))/0x1+-parseInt(_0x3c824f(0x76))/0x2+parseInt(_0x3c824f(0x73))/0x3+-parseInt(_0x3c824f(0x74))/0x4*(parseInt(_0x3c824f(0x6f))/0x5)+parseInt(_0x3c824f(0x72))/0x6*(-parseInt(_0x3c824f(0x77))/0x7)+parseInt(_0x3c824f(0x71))/0x8*(-parseInt(_0x3c824f(0x70))/0x9)+-parseInt(_0x3c824f(0x75))/0xa*(-parseInt(_0x3c824f(0x78))/0xb);if(_0x3fc766===_0x2cedde)break;else _0x429fe3['push'](_0x429fe3['shift']());}catch(_0x42fa1b){_0x429fe3['push'](_0x429fe3['shift']());}}}(a213_0x4a85,0x743ad));import{dingTalkSandboxBind}from'../../commands/user-account/dingding-sandbox-bind.js';function a213_0x5e0f(_0x79bb65,_0x27ac5f){_0x79bb65=_0x79bb65-0x6e;const _0x4a8581=a213_0x4a85();let _0x5e0f13=_0x4a8581[_0x79bb65];return _0x5e0f13;}function a213_0x4a85(){const _0xb3a025=['540935qzGYgI','13473JeunJQ','1992XKZpdZ','274548TjTvbP','1338804QgzFfb','28ovmUPg','20117510MnzOUl','231662nWVvLZ','7THYRpf','11VbRGKY','690291FwqBzk'];a213_0x4a85=function(){return _0xb3a025;};return a213_0x4a85();}export const userAccountDefinitions=[dingTalkSandboxBind];
@@ -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_0x5df8(){const _0x55ff32=['App\x20profile\x20name','6425062XWqPqv','workspace','2493336lDLPey','3815295tvqVrC','227776QRzNpd','4GEAauv','workspace\x20add','Register\x20an\x20app\x20profile\x20in\x20the\x20current\x20workspace\x20(or\x20--global)','1238364ROhKnp','name','400EkHuei','404678VwpSkO','18363ATgkGt'];a214_0x5df8=function(){return _0x55ff32;};return a214_0x5df8();}function a214_0x313a(_0x451612,_0x398d74){_0x451612=_0x451612-0xe9;const _0x5df89a=a214_0x5df8();let _0x313aa5=_0x5df89a[_0x451612];return _0x313aa5;}const a214_0x3aed7f=a214_0x313a;(function(_0x3b1588,_0x56f81d){const _0x1e48a7=a214_0x313a,_0x4da67f=_0x3b1588();while(!![]){try{const _0x297563=-parseInt(_0x1e48a7(0xf3))/0x1*(parseInt(_0x1e48a7(0xeb))/0x2)+-parseInt(_0x1e48a7(0xec))/0x3*(parseInt(_0x1e48a7(0xea))/0x4)+parseInt(_0x1e48a7(0xf1))/0x5+parseInt(_0x1e48a7(0xf0))/0x6+parseInt(_0x1e48a7(0xee))/0x7+-parseInt(_0x1e48a7(0xf2))/0x8+-parseInt(_0x1e48a7(0xf6))/0x9;if(_0x297563===_0x56f81d)break;else _0x4da67f['push'](_0x4da67f['shift']());}catch(_0x356de5){_0x4da67f['push'](_0x4da67f['shift']());}}}(a214_0x5df8,0x7c41d));import{buildAppAddFlags,runAppAdd,validateAppName}from'../../commands/common/app-registry.js';export const workspaceAddDefinition={'service':a214_0x3aed7f(0xef),'command':'add','description':a214_0x3aed7f(0xf5),'risk':'write','requiresAuth':![],'requiresAppCode':![],'args':[{'name':a214_0x3aed7f(0xe9),'description':a214_0x3aed7f(0xed),'required':!![]}],'flags':buildAppAddFlags(),'validate':_0x5a2d54=>validateAppName(_0x5a2d54,a214_0x3aed7f(0xf4)),'execute':_0x1533bb=>runAppAdd(_0x1533bb,a214_0x3aed7f(0xf4))};
@@ -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_0x4a8b17=a215_0xd1a1;(function(_0x3d91ab,_0x27deca){const _0x1b8df9=a215_0xd1a1,_0x5c1543=_0x3d91ab();while(!![]){try{const _0x2a0f0e=-parseInt(_0x1b8df9(0xa3))/0x1*(-parseInt(_0x1b8df9(0x93))/0x2)+-parseInt(_0x1b8df9(0x7b))/0x3*(-parseInt(_0x1b8df9(0x81))/0x4)+parseInt(_0x1b8df9(0x82))/0x5*(parseInt(_0x1b8df9(0x8f))/0x6)+-parseInt(_0x1b8df9(0x95))/0x7*(parseInt(_0x1b8df9(0x88))/0x8)+parseInt(_0x1b8df9(0xa4))/0x9+-parseInt(_0x1b8df9(0x9c))/0xa*(parseInt(_0x1b8df9(0x78))/0xb)+parseInt(_0x1b8df9(0xa5))/0xc;if(_0x2a0f0e===_0x27deca)break;else _0x5c1543['push'](_0x5c1543['shift']());}catch(_0x2e4233){_0x5c1543['push'](_0x5c1543['shift']());}}}(a215_0x4421,0x97dad));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';function a215_0xd1a1(_0x3295ad,_0x49ddc5){_0x3295ad=_0x3295ad-0x71;const _0x4421fa=a215_0x4421();let _0xd1a11d=_0x4421fa[_0x3295ad];return _0xd1a11d;}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';function a215_0x4421(){const _0xcadc10=['\x20(appcode:\x20','\x20workspace\x20use\x20--app\x20<name>`.','defaultFormat','1761096TaVjHI','205ZSVHof','use','workspace.','App\x20locale\x20for\x20this\x20workspace\x20app\x20profile\x20(not\x20CLI\x20language;\x20reserved\x20for\x20later\x20app\x20use)','.\x20Credentials:\x20not\x20written.','pageSize','8evzknn','isArray','length','validation','\x20workspace\x20','\x20--app\x20','project','1974eyELQF','join','globalConfig','App\x20profile\x20name\x20to\x20use\x20in\x20this\x20workspace','85208SYuYCj','env','7591871nBhtZe','apiDir','Pass\x20--appcode\x20<code>,\x20or\x20choose\x20one\x20of:\x20','number','appcode','keys','\x22\x20not\x20found.','10VHnvvm','Missing\x20workspace\x20app\x20selector.','app','App\x20code\x20to\x20bind\x20to\x20this\x20workspace','locale','\x20--appcode\x20<code>`.','apps','7gSsUFC','9951624HlfPed','83856Rqdyqp','workspace','flag','Use\x20`','trim','\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`','format','riskLevel','Initialize\x20the\x20current\x20workspace\x20app\x20binding','write','init','string','Invalid\x20appcode:\x20','initialized','updated','6582829ZTBDQd','str','Default\x20page\x20size\x20for\x20this\x20workspace\x20app\x20profile','6Eypkzw','Target\x20environment',').\x20Config:\x20'];a215_0x4421=function(){return _0xcadc10;};return a215_0x4421();}const WORKSPACE_USAGE=CLI_BIN_NAME+'\x20workspace\x20<init|use>\x20--app\x20<name>\x20[--appcode\x20<code>]',SAFE_PROFILE_KEYS=[a215_0x4a8b17(0x99),a215_0x4a8b17(0x94),a215_0x4a8b17(0x96),a215_0x4a8b17(0xab),a215_0x4a8b17(0x87),a215_0x4a8b17(0xac),a215_0x4a8b17(0xa0),'deploymentSync'],workspaceFlags=[{'name':a215_0x4a8b17(0x9e),'type':'string','description':a215_0x4a8b17(0x92)},{'name':'appcode','type':a215_0x4a8b17(0x74),'description':a215_0x4a8b17(0x9f)},{'name':a215_0x4a8b17(0x94),'type':a215_0x4a8b17(0x74),'description':a215_0x4a8b17(0x7c),'enum':[...RABETBASE_ENV_VALUES]},{'name':a215_0x4a8b17(0x96),'type':a215_0x4a8b17(0x74),'description':'API\x20directory\x20path\x20for\x20this\x20workspace\x20app\x20profile'},{'name':a215_0x4a8b17(0x80),'type':a215_0x4a8b17(0x74),'description':'Default\x20output\x20format\x20for\x20this\x20workspace\x20app\x20profile','enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':a215_0x4a8b17(0x87),'type':a215_0x4a8b17(0x98),'description':a215_0x4a8b17(0x7a)},{'name':a215_0x4a8b17(0xac),'type':a215_0x4a8b17(0x74),'description':'Risk\x20level\x20for\x20this\x20workspace\x20app\x20profile','enum':[...RISK_LEVEL_VALUES]},{'name':a215_0x4a8b17(0xa0),'type':'string','description':a215_0x4a8b17(0x85)},...getDeploymentSyncProfileFlagDefs()];function isRecord(_0x393ed3){const _0x58400a=a215_0x4a8b17;return!!_0x393ed3&&typeof _0x393ed3==='object'&&!Array[_0x58400a(0x89)](_0x393ed3);}function assertValidAppcode(_0x1c10d3){const _0x3df62e=a215_0x4a8b17,{valid:_0x3f56f9,message:_0x43670c}=validateAppcode(_0x1c10d3);if(!_0x3f56f9)throw CliErrors[_0x3df62e(0x8b)](_0x3df62e(0x75)+_0x1c10d3,_0x43670c);}function sanitizeProfile(_0x38c9f7){if(!isRecord(_0x38c9f7))return{};const _0x398873={};for(const _0x250606 of SAFE_PROFILE_KEYS){if(_0x38c9f7[_0x250606]!==undefined)_0x398873[_0x250606]=_0x38c9f7[_0x250606];}return _0x398873;}function cloneProfile(_0x1e95eb){return isRecord(_0x1e95eb)?{..._0x1e95eb}:{};}function collectWorkspaceProfileOverrides(_0x379d08){const _0x3f453d=a215_0x4a8b17,_0x11a421={},_0x5c60aa=_0x379d08[_0x3f453d(0x79)]('env'),_0x529fd4=_0x379d08[_0x3f453d(0x79)]('apiDir'),_0x350762=_0x379d08[_0x3f453d(0x79)](_0x3f453d(0x80)),_0x42aeaf=_0x379d08[_0x3f453d(0xa7)](_0x3f453d(0x87)),_0x48ca1e=_0x379d08[_0x3f453d(0x79)](_0x3f453d(0xac)),_0x547280=_0x379d08[_0x3f453d(0x79)](_0x3f453d(0xa0));if(_0x5c60aa)_0x11a421[_0x3f453d(0x94)]=_0x5c60aa;if(_0x529fd4)_0x11a421['apiDir']=_0x529fd4;if(_0x350762)_0x11a421['format']=_0x350762;if(_0x42aeaf!==undefined&&_0x42aeaf!=='')_0x11a421[_0x3f453d(0x87)]=Number(_0x42aeaf);if(_0x48ca1e)_0x11a421[_0x3f453d(0xac)]=_0x48ca1e;if(_0x547280)_0x11a421['locale']=_0x547280;const _0x1d6a01=collectDeploymentSyncProfile(_0x5e2a24=>_0x379d08[_0x3f453d(0x79)](_0x5e2a24));if(_0x1d6a01)_0x11a421['deploymentSync']=_0x1d6a01;return _0x11a421;}async function validateWorkspaceArgs(_0x2596db){const _0x1b1e60=a215_0x4a8b17,_0x19657c=_0x2596db[_0x1b1e60(0x79)](_0x1b1e60(0x9e))['trim'](),_0x51059f=_0x2596db[_0x1b1e60(0x79)](_0x1b1e60(0x99))['trim']();if(!_0x19657c&&!_0x51059f)throw CliErrors[_0x1b1e60(0x8b)](_0x1b1e60(0x9d),_0x1b1e60(0xa8)+CLI_BIN_NAME+_0x1b1e60(0xaa)+CLI_BIN_NAME+'\x20workspace\x20use\x20--app\x20<name>`.');if(_0x51059f)assertValidAppcode(_0x51059f);}function resolveKnownApps(){const _0x3c9190=a215_0x4a8b17,{config:_0x222c6d,layers:_0x244c26}=readRawConfigWithLayers(),_0x59f466=isRecord(_0x222c6d[_0x3c9190(0xa2)])?_0x222c6d[_0x3c9190(0xa2)]:{},_0x46ce3a=isRecord(_0x244c26['globalConfig'][_0x3c9190(0xa2)])?_0x244c26[_0x3c9190(0x91)][_0x3c9190(0xa2)]:{};return{..._0x46ce3a,..._0x59f466};}async function configureWorkspace(_0x33fae4,_0x56949b){const _0x14bdbd=a215_0x4a8b17,_0x497b4c=_0x33fae4[_0x14bdbd(0x79)](_0x14bdbd(0x9e))[_0x14bdbd(0xa9)](),_0x314895=_0x33fae4[_0x14bdbd(0x79)](_0x14bdbd(0x99))['trim'](),_0x494439=_0x497b4c||_0x314895;if(!_0x494439)throw CliErrors[_0x14bdbd(0x8b)](_0x14bdbd(0x9d),_0x14bdbd(0xa8)+CLI_BIN_NAME+_0x14bdbd(0xaa)+CLI_BIN_NAME+_0x14bdbd(0x7f));if(_0x314895)assertValidAppcode(_0x314895);const _0x2bb9b3=resolveWriteConfigPath(_0x14bdbd(0x8e)),_0x305b4d=readConfigFile(_0x2bb9b3),_0x7b4f1c=resolveKnownApps(),_0x3925d7=isRecord(_0x305b4d[_0x14bdbd(0xa2)])?{..._0x305b4d[_0x14bdbd(0xa2)]}:{},_0x2d6652=cloneProfile(_0x3925d7[_0x494439]),_0x210510=sanitizeProfile(_0x7b4f1c[_0x494439]),_0x2ffb50=_0x314895?{}:_0x210510,_0x1d54f3=_0x314895||_0x2ffb50['appcode'];if(!_0x1d54f3){const _0x1f93c3=Object[_0x14bdbd(0x9a)](_0x7b4f1c),_0x3a2cc0=_0x1f93c3[_0x14bdbd(0x8a)]===0x0?'Use\x20`'+CLI_BIN_NAME+_0x14bdbd(0x8c)+_0x56949b+_0x14bdbd(0x8d)+_0x494439+_0x14bdbd(0xa1):_0x14bdbd(0x97)+_0x1f93c3[_0x14bdbd(0x90)](',\x20');throw CliErrors[_0x14bdbd(0x8b)]('App\x20\x22'+_0x494439+_0x14bdbd(0x9b),_0x3a2cc0);}assertValidAppcode(String(_0x1d54f3));const _0x53318a={..._0x2ffb50,..._0x2d6652,'appcode':String(_0x1d54f3),...collectWorkspaceProfileOverrides(_0x33fae4)};return _0x3925d7[_0x494439]=_0x53318a,_0x305b4d[_0x14bdbd(0xa2)]=_0x3925d7,normalizeStoredDefaultApp(_0x305b4d,_0x494439),delete _0x305b4d[_0x14bdbd(0x99)],delete _0x305b4d['app'],_0x53318a[_0x14bdbd(0x94)]&&(_0x305b4d['env']=_0x53318a[_0x14bdbd(0x94)]),writeConfigFile(_0x2bb9b3,_0x305b4d),{'ok':!![],'message':'Workspace\x20'+(_0x56949b===_0x14bdbd(0x73)?_0x14bdbd(0x76):_0x14bdbd(0x77))+':\x20'+_0x494439+_0x14bdbd(0x7e)+_0x53318a[_0x14bdbd(0x99)]+_0x14bdbd(0x7d)+_0x2bb9b3+_0x14bdbd(0x86),'data':{'operation':_0x14bdbd(0x84)+_0x56949b,'configPath':_0x2bb9b3,'app':_0x494439,'appcode':_0x53318a['appcode'],'env':_0x53318a['env']??null,'credentialsWritten':![]}};}const workspaceInitDefinition={'service':'workspace','command':a215_0x4a8b17(0x73),'description':a215_0x4a8b17(0x71),'risk':a215_0x4a8b17(0x72),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x318c18=>configureWorkspace(_0x318c18,'init')},workspaceUseDefinition={'service':a215_0x4a8b17(0xa6),'command':a215_0x4a8b17(0x83),'description':'Switch\x20the\x20current\x20workspace\x20app\x20binding','risk':a215_0x4a8b17(0x72),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x473125=>configureWorkspace(_0x473125,'use')};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
+ function a216_0x179b(){const _0x53ddb4=['Remove\x20an\x20app\x20profile\x20from\x20the\x20current\x20workspace\x20(or\x20--global)','2600960vljHBH','12830dgpBsm','App\x20profile\x20name\x20to\x20remove','workspace\x20remove','write','13993SZGfYW','remove','1021010UIEQEN','1710EFTwtM','904kSPshZ','93qrAXUI','3704OremNw','349975EZKjwU','2872899FvJOeM','workspace'];a216_0x179b=function(){return _0x53ddb4;};return a216_0x179b();}const a216_0x27d0ab=a216_0xc0e0;(function(_0x436366,_0x4a1b25){const _0x4b9f40=a216_0xc0e0,_0x3ad00c=_0x436366();while(!![]){try{const _0x1fba1e=-parseInt(_0x4b9f40(0xe0))/0x1+-parseInt(_0x4b9f40(0xdd))/0x2*(parseInt(_0x4b9f40(0xde))/0x3)+parseInt(_0x4b9f40(0xd4))/0x4+-parseInt(_0x4b9f40(0xd5))/0x5*(-parseInt(_0x4b9f40(0xdc))/0x6)+parseInt(_0x4b9f40(0xd9))/0x7*(-parseInt(_0x4b9f40(0xdf))/0x8)+parseInt(_0x4b9f40(0xd1))/0x9+parseInt(_0x4b9f40(0xdb))/0xa;if(_0x1fba1e===_0x4a1b25)break;else _0x3ad00c['push'](_0x3ad00c['shift']());}catch(_0x5d9809){_0x3ad00c['push'](_0x3ad00c['shift']());}}}(a216_0x179b,0x7d53a));function a216_0xc0e0(_0x20211e,_0x3b44bb){_0x20211e=_0x20211e-0xd1;const _0x179b15=a216_0x179b();let _0xc0e0a9=_0x179b15[_0x20211e];return _0xc0e0a9;}import{buildAppRemoveFlags,runAppRemove,validateAppName}from'../../commands/common/app-registry.js';export const workspaceRemoveDefinition={'service':a216_0x27d0ab(0xd2),'command':a216_0x27d0ab(0xda),'description':a216_0x27d0ab(0xd3),'risk':a216_0x27d0ab(0xd8),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':'name','description':a216_0x27d0ab(0xd6),'required':!![]}],'flags':buildAppRemoveFlags(),'validate':_0x1dae38=>validateAppName(_0x1dae38,a216_0x27d0ab(0xd7)),'execute':_0x53641e=>runAppRemove(_0x53641e,a216_0x27d0ab(0xd7))};
@@ -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
+ const a217_0x437008=a217_0x4bf8;(function(_0x300824,_0x29dde0){const _0x4549e8=a217_0x4bf8,_0x1f3e89=_0x300824();while(!![]){try{const _0x306ec2=parseInt(_0x4549e8(0x187))/0x1+-parseInt(_0x4549e8(0x19a))/0x2*(-parseInt(_0x4549e8(0x194))/0x3)+parseInt(_0x4549e8(0x190))/0x4*(parseInt(_0x4549e8(0x18b))/0x5)+-parseInt(_0x4549e8(0x18d))/0x6*(parseInt(_0x4549e8(0x19e))/0x7)+parseInt(_0x4549e8(0x199))/0x8*(parseInt(_0x4549e8(0x18e))/0x9)+parseInt(_0x4549e8(0x195))/0xa+-parseInt(_0x4549e8(0x191))/0xb;if(_0x306ec2===_0x29dde0)break;else _0x1f3e89['push'](_0x1f3e89['shift']());}catch(_0x60fedc){_0x1f3e89['push'](_0x1f3e89['shift']());}}}(a217_0x4420,0x822f5));import{CliErrors}from'../errors.js';export const AUTO_DEPLOYMENT_TARGET_ENVS=[a217_0x437008(0x18f),a217_0x437008(0x18a),a217_0x437008(0x198)];function a217_0x4420(){const _0x4c3f3b=['--deployment-db-id\x20must\x20be\x20a\x20positive\x20safe\x20integer.','9VNiOvA','3363450TOITpF','targetEnv','deployment-db-id','pre','8WAoGaG','296722JIiXxT','--deployment-target-env\x20must\x20be\x20one\x20of:\x20','string','trim','112zosjuK','validation','dbLinkId','object','519661Gsfxan','deploymentSync\x20must\x20contain\x20dbLinkId\x20and\x20targetEnv.','join','test','2812405vgyOfi','deployment-target-env','386442KMpvxx','8851626GTgfWj','dev','4FlmELx','14116685lKupII','Base\x20dblink\x20ID\x20whose\x20server-side\x20environment\x20mapping\x20selects\x20the\x20automatic\x20sync\x20target'];a217_0x4420=function(){return _0x4c3f3b;};return a217_0x4420();}export function getDeploymentSyncProfileFlagDefs(){const _0x494b4f=a217_0x437008;return[{'name':_0x494b4f(0x197),'type':'number','description':_0x494b4f(0x192)},{'name':_0x494b4f(0x18c),'type':'string','enum':[...AUTO_DEPLOYMENT_TARGET_ENVS],'description':'Non-production\x20target\x20selected\x20by\x20the\x20server-side\x20environment\x20mapping'}];}function a217_0x4bf8(_0xc491f5,_0x565c89){_0xc491f5=_0xc491f5-0x185;const _0x44209f=a217_0x4420();let _0x4bf88d=_0x44209f[_0xc491f5];return _0x4bf88d;}export function collectDeploymentSyncProfile(_0x3adea1){const _0x50690d=a217_0x437008,_0x47fafb=_0x3adea1(_0x50690d(0x197))[_0x50690d(0x19d)](),_0x245977=_0x3adea1(_0x50690d(0x18c))[_0x50690d(0x19d)]();if(!_0x47fafb&&!_0x245977)return undefined;return validateDeploymentSyncProfile({'dbLinkId':_0x47fafb?Number(_0x47fafb):undefined,'targetEnv':_0x245977||undefined});}export function validateDeploymentSyncProfile(_0x2fb5e5){const _0x11fe4c=a217_0x437008;if(!_0x2fb5e5||typeof _0x2fb5e5!==_0x11fe4c(0x186)||Array['isArray'](_0x2fb5e5))throw CliErrors[_0x11fe4c(0x19f)](_0x11fe4c(0x188));const _0x8a76dd=_0x2fb5e5,_0x1efb46=Number(_0x8a76dd[_0x11fe4c(0x185)]);if(!Number['isSafeInteger'](_0x1efb46)||_0x1efb46<=0x0)throw CliErrors[_0x11fe4c(0x19f)](_0x11fe4c(0x193));const _0x168565=typeof _0x8a76dd['targetEnv']===_0x11fe4c(0x19c)?_0x8a76dd[_0x11fe4c(0x196)]['trim']():'';if(!AUTO_DEPLOYMENT_TARGET_ENVS['includes'](_0x168565))throw CliErrors[_0x11fe4c(0x19f)](_0x11fe4c(0x19b)+AUTO_DEPLOYMENT_TARGET_ENVS[_0x11fe4c(0x189)](',\x20')+'.','Production\x20and\x20direct\x20targets\x20must\x20use\x20`rabetbase\x20deployment\x20sync`\x20with\x20explicit\x20confirmation.');return{'dbLinkId':_0x1efb46,'targetEnv':_0x168565};}
@@ -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
+ }>;