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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (346) hide show
  1. package/README.md +75 -1
  2. package/lib/api/api-doc.js +1 -1
  3. package/lib/api/fetch-model-list.js +1 -1
  4. package/lib/api/generate-api-file.js +1 -1
  5. package/lib/api/generate-sdk-config-file.d.ts +0 -1
  6. package/lib/api/generate-sdk-config-file.js +1 -1
  7. package/lib/auth/auth-server-ui.js +1 -1
  8. package/lib/auth/auth-server.js +1 -1
  9. package/lib/auth/constant.js +1 -1
  10. package/lib/auth/get-cookie.js +1 -1
  11. package/lib/auth/get-session-user.js +1 -1
  12. package/lib/auth/is-session-valid.js +1 -1
  13. package/lib/auth/login-success-html.js +1 -1
  14. package/lib/auth/logout.js +1 -1
  15. package/lib/cli-flags.js +1 -1
  16. package/lib/cli.js +1 -1
  17. package/lib/commands/api/generate.js +1 -1
  18. package/lib/commands/api/index.js +1 -1
  19. package/lib/commands/api/list.js +1 -1
  20. package/lib/commands/api/pull.js +1 -1
  21. package/lib/commands/api/shared.js +1 -1
  22. package/lib/commands/app/index.js +1 -1
  23. package/lib/commands/app/list.js +1 -1
  24. package/lib/commands/app/members-list.js +1 -1
  25. package/lib/commands/app/remote-directory.js +1 -1
  26. package/lib/commands/app/shared.js +1 -1
  27. package/lib/commands/app-config/delete.js +1 -1
  28. package/lib/commands/app-config/get.js +1 -1
  29. package/lib/commands/app-config/index.js +1 -1
  30. package/lib/commands/app-config/list.js +1 -1
  31. package/lib/commands/app-config/set.js +1 -1
  32. package/lib/commands/app-config/shared.js +1 -1
  33. package/lib/commands/auth/index.js +1 -1
  34. package/lib/commands/bff/create.js +1 -1
  35. package/lib/commands/bff/delete.js +1 -1
  36. package/lib/commands/bff/detail.js +1 -1
  37. package/lib/commands/bff/index.js +1 -1
  38. package/lib/commands/bff/list.js +1 -1
  39. package/lib/commands/bff/pull.js +1 -1
  40. package/lib/commands/bff/push.js +1 -1
  41. package/lib/commands/bff/status.js +1 -1
  42. package/lib/commands/cli-skill/index.js +1 -1
  43. package/lib/commands/cli-update.js +1 -1
  44. package/lib/commands/codegen/index.js +1 -1
  45. package/lib/commands/codegen/sdk.js +1 -1
  46. package/lib/commands/codegen/sql.js +1 -1
  47. package/lib/commands/common/app-registry.js +1 -1
  48. package/lib/commands/common/app-selector.js +1 -1
  49. package/lib/commands/common/async-task.js +1 -1
  50. package/lib/commands/common/dry-run.js +1 -1
  51. package/lib/commands/common/flags.d.ts +2 -0
  52. package/lib/commands/common/flags.js +1 -1
  53. package/lib/commands/common/local-file.js +1 -1
  54. package/lib/commands/common/validate.js +1 -1
  55. package/lib/commands/config/delete.js +1 -1
  56. package/lib/commands/config/get.js +1 -1
  57. package/lib/commands/config/index.js +1 -1
  58. package/lib/commands/config/init.d.ts +3 -1
  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 +38 -2
  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 -6
  239. package/lib/constant/domain.js +1 -1
  240. package/lib/constant/env.js +1 -1
  241. package/lib/constant/output.js +1 -1
  242. package/lib/constant/paths.js +1 -1
  243. package/lib/constant/region.d.ts +4 -1
  244. package/lib/constant/region.js +1 -1
  245. package/lib/constant/risk.js +1 -1
  246. package/lib/constant/routing-profile.d.ts +43 -49
  247. package/lib/constant/routing-profile.js +1 -1
  248. package/lib/context/app-resolver.js +1 -1
  249. package/lib/context/auth-resolver.js +1 -1
  250. package/lib/context/config-loader.js +1 -1
  251. package/lib/context.d.ts +2 -0
  252. package/lib/context.js +1 -1
  253. package/lib/core/alias-resolver.js +1 -1
  254. package/lib/core/api-client.d.ts +37 -0
  255. package/lib/core/api-client.js +1 -1
  256. package/lib/core/bff/config.js +1 -1
  257. package/lib/core/bff/file-system.js +1 -1
  258. package/lib/core/bff/hash.js +1 -1
  259. package/lib/core/bff/lock.js +1 -1
  260. package/lib/core/bff/utils.js +1 -1
  261. package/lib/core/db-resolver.js +1 -1
  262. package/lib/core/page/file-system.js +1 -1
  263. package/lib/core/page/hash.js +1 -1
  264. package/lib/core/page/lock.js +1 -1
  265. package/lib/core/sql-index-auditor.js +1 -1
  266. package/lib/core/sql-sync/config.js +1 -1
  267. package/lib/core/sql-sync/file-system.js +1 -1
  268. package/lib/core/sql-sync/hash.js +1 -1
  269. package/lib/core/sql-sync/lock.js +1 -1
  270. package/lib/core/sql-sync/utils.js +1 -1
  271. package/lib/core/sql-validator.js +1 -1
  272. package/lib/errors.js +1 -1
  273. package/lib/framework/build-all-flags.js +1 -1
  274. package/lib/framework/error-output.js +1 -1
  275. package/lib/framework/explicit-yes.js +1 -1
  276. package/lib/framework/flags.js +1 -1
  277. package/lib/framework/help.js +1 -1
  278. package/lib/framework/index.js +1 -1
  279. package/lib/framework/output.js +1 -1
  280. package/lib/framework/response.js +1 -1
  281. package/lib/framework/runner-alias.js +1 -1
  282. package/lib/framework/runner.js +1 -1
  283. package/lib/framework/schema-export.js +1 -1
  284. package/lib/framework/types.d.ts +0 -1
  285. package/lib/framework/types.js +1 -1
  286. package/lib/generated/build-info.d.ts +4 -4
  287. package/lib/generated/build-info.js +1 -1
  288. package/lib/generated/official-routing.d.ts +83 -0
  289. package/lib/generated/official-routing.js +1 -0
  290. package/lib/generated/routing-contract.d.ts +9 -0
  291. package/lib/generated/routing-contract.js +1 -0
  292. package/lib/help.js +1 -1
  293. package/lib/postinstall.js +1 -1
  294. package/lib/runtime/confirmation.js +1 -1
  295. package/lib/runtime/event.js +1 -1
  296. package/lib/runtime/index.js +1 -1
  297. package/lib/runtime/queue.js +1 -1
  298. package/lib/runtime/resolve.js +1 -1
  299. package/lib/skills/builtin-skill.js +1 -1
  300. package/lib/skills/main.js +1 -1
  301. package/lib/skills/npx-skills-add.js +1 -1
  302. package/lib/skills/skill-presence.js +1 -1
  303. package/lib/telemetry/cli-command-trace.js +1 -1
  304. package/lib/telemetry/cli-help-trace.js +1 -1
  305. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  306. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  307. package/lib/telemetry/send-cli-trace-log.js +1 -1
  308. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  309. package/lib/types/index.d.ts +0 -1
  310. package/lib/utils/ai_config.js +1 -1
  311. package/lib/utils/apply-jq-filter.js +1 -1
  312. package/lib/utils/cdn-config.js +1 -1
  313. package/lib/utils/check-sdk-version.js +1 -1
  314. package/lib/utils/cli-version-check.js +1 -1
  315. package/lib/utils/cli-version-policy.js +1 -1
  316. package/lib/utils/config.js +1 -1
  317. package/lib/utils/entity-with-id.js +1 -1
  318. package/lib/utils/file-utils.js +1 -1
  319. package/lib/utils/guides-cdn.js +1 -1
  320. package/lib/utils/http-client.js +1 -1
  321. package/lib/utils/is-non-interactive.js +1 -1
  322. package/lib/utils/logger.js +1 -1
  323. package/lib/utils/params.js +1 -1
  324. package/lib/utils/platform.js +1 -1
  325. package/lib/utils/sleep.js +1 -1
  326. package/lib/utils/template-replacer.js +1 -1
  327. package/lib/utils/update-notice.js +1 -1
  328. package/lib/utils/version.js +1 -1
  329. package/lib/utils/with-active-cookie.js +1 -1
  330. package/lib/utils/write-cli-side-channel.js +1 -1
  331. package/package.json +2 -1
  332. package/skills/rabetbase/SKILL.md +16 -13
  333. package/skills/rabetbase/guides/sdk-client-generation.md +10 -8
  334. package/skills/rabetbase/references/rabetbase-api-pull.md +16 -11
  335. package/skills/rabetbase/references/rabetbase-config.md +3 -6
  336. package/skills/rabetbase/references/rabetbase-doctor.md +2 -1
  337. package/skills/rabetbase/references/rabetbase-init.md +32 -10
  338. package/skills/rabetbase/references/rabetbase-kb.md +7 -7
  339. package/skills/rabetbase/references/rabetbase-project-create.md +33 -8
  340. package/skills/rabetbase/references/rabetbase-project-domain-routing-sync.md +28 -0
  341. package/skills/rabetbase/references/rabetbase-rule.md +49 -0
  342. package/skills/rabetbase.manifest.json +5 -3
  343. package/lib/config/project-routing.d.ts +0 -30
  344. package/lib/config/project-routing.js +0 -1
  345. package/lib/core/kb-search-client.d.ts +0 -30
  346. package/lib/core/kb-search-client.js +0 -1
@@ -1 +1 @@
1
- const a197_0x218fea=a197_0x12eb;(function(_0x1d920b,_0x4bfa13){const _0x1ec733=a197_0x12eb,_0x49d24c=_0x1d920b();while(!![]){try{const _0x1a5505=parseInt(_0x1ec733(0x1fa))/0x1*(parseInt(_0x1ec733(0x1f7))/0x2)+parseInt(_0x1ec733(0x1ea))/0x3+parseInt(_0x1ec733(0x208))/0x4*(parseInt(_0x1ec733(0x218))/0x5)+-parseInt(_0x1ec733(0x1f4))/0x6*(parseInt(_0x1ec733(0x1ff))/0x7)+-parseInt(_0x1ec733(0x21d))/0x8*(-parseInt(_0x1ec733(0x20d))/0x9)+parseInt(_0x1ec733(0x217))/0xa+parseInt(_0x1ec733(0x1f2))/0xb*(-parseInt(_0x1ec733(0x1f9))/0xc);if(_0x1a5505===_0x4bfa13)break;else _0x49d24c['push'](_0x49d24c['shift']());}catch(_0x5c3990){_0x49d24c['push'](_0x49d24c['shift']());}}}(a197_0x39f5,0x82ed1));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';function a197_0x12eb(_0x457d37,_0xfb6a1a){_0x457d37=_0x457d37-0x1e3;const _0x39f5b5=a197_0x39f5();let _0x12eb7a=_0x39f5b5[_0x457d37];return _0x12eb7a;}import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';import{automaticDeploymentSyncSucceeded,buildAutomaticDeploymentSyncPreview,runAutomaticDeploymentSync,validateAutomaticDeploymentSync}from'../../commands/deployment/auto-sync.js';async function getTargetSqlQueries(_0x437961,_0x529357,_0x3d664f){const _0x5b1251=a197_0x12eb,_0xe138c7=await scanLocalSqlQueries(_0x437961),_0x2b2aa7=new Map();for(const _0x1e4587 of _0xe138c7){if(_0x3d664f&&_0x1e4587[_0x5b1251(0x22a)]!==_0x3d664f)continue;const _0x543e38=_0x2b2aa7[_0x5b1251(0x20f)](_0x1e4587[_0x5b1251(0x22a)])??[];_0x543e38['push'](_0x1e4587),_0x2b2aa7[_0x5b1251(0x211)](_0x1e4587[_0x5b1251(0x22a)],_0x543e38);}if(_0x3d664f&&!_0x2b2aa7[_0x5b1251(0x1e5)](_0x3d664f))throw CliErrors[_0x5b1251(0x210)](_0x5b1251(0x226)+_0x3d664f);const _0x47eeae=[];for(const [_0x251b51,_0x14f781]of _0x2b2aa7[_0x5b1251(0x21c)]()){if(_0x14f781[_0x5b1251(0x228)]===0x1){_0x47eeae[_0x5b1251(0x1fd)](_0x14f781[0x0]);continue;}const _0x4df72b=_0x529357[_0x5b1251(0x1eb)][_0x251b51],_0x128da4=_0x4df72b?.[_0x5b1251(0x1e6)],_0xb3faea=_0x128da4?_0x14f781['filter'](_0x4523eb=>_0x4523eb['relativePath']!==_0x128da4):_0x14f781;if(_0x4df72b&&_0xb3faea[_0x5b1251(0x228)]===0x1){_0x47eeae[_0x5b1251(0x1fd)](_0xb3faea[0x0]);continue;}throw CliErrors[_0x5b1251(0x210)](_0x5b1251(0x1f8)+_0x251b51+_0x5b1251(0x207));}return _0x47eeae;}export const sqlPush={'service':a197_0x218fea(0x203),'command':a197_0x218fea(0x1fd),'description':a197_0x218fea(0x223),'risk':'write','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a197_0x218fea(0x221),'type':a197_0x218fea(0x20c),'description':'Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock'}],async 'validate'(_0x167abc){validateAutomaticDeploymentSync(_0x167abc);},async 'dryRun'(_0x42c486){const _0x26dff5=a197_0x218fea,_0x14de50=loadSqlProjectConfig(_0x42c486[_0x26dff5(0x213)]),_0x15e649=await readSqlLockFile(_0x14de50[_0x26dff5(0x20b)]),{appLock:_0x506f38}=ensureSqlLockScope(_0x15e649??createEmptySqlLock(),_0x42c486[_0x26dff5(0x213)],_0x14de50['sqlRoot'],_0x26dff5(0x1fd)),_0x5872da=await getTargetSqlQueries(_0x14de50,_0x506f38,_0x42c486[_0x26dff5(0x204)](_0x26dff5(0x219))||undefined),_0x4ef504=[];for(const _0xc4426a of _0x5872da){const _0x1ff7d1=await computeSqlFileHash(_0xc4426a[_0x26dff5(0x216)]),_0x3ac69f=_0x506f38[_0x26dff5(0x1eb)][_0xc4426a[_0x26dff5(0x22a)]],_0x482878=!!_0x3ac69f&&(_0x3ac69f[_0x26dff5(0x1e6)]!==_0xc4426a[_0x26dff5(0x212)]||!!_0xc4426a['sqlName']&&_0x3ac69f[_0x26dff5(0x1f3)]!==_0xc4426a[_0x26dff5(0x1f3)]);if(!_0x42c486['bool'](_0x26dff5(0x221))&&_0x3ac69f&&_0x3ac69f['hash']===_0x1ff7d1&&!_0x482878)continue;_0x4ef504[_0x26dff5(0x1fd)](_0xc4426a[_0x26dff5(0x22a)]);}return{'method':'POST','url':_0x26dff5(0x227),'deploymentSync':buildAutomaticDeploymentSyncPreview(_0x42c486,_0x26dff5(0x203),_0x4ef504),'body':{'sqlCodes':_0x4ef504,'appCode':_0x42c486[_0x26dff5(0x213)]},'description':_0x26dff5(0x1ed)+_0x4ef504[_0x26dff5(0x228)]+_0x26dff5(0x20e)};},async 'execute'(_0x489975){const _0x281b5e=a197_0x218fea,_0x56bc2d=loadSqlProjectConfig(_0x489975[_0x281b5e(0x213)]),_0x3657e5=await readSqlLockFile(_0x56bc2d[_0x281b5e(0x20b)]),{lockData:_0x379930,appLock:_0x497e35}=ensureSqlLockScope(_0x3657e5??createEmptySqlLock(),_0x489975[_0x281b5e(0x213)],_0x56bc2d[_0x281b5e(0x200)],_0x281b5e(0x1fd)),_0x2c58bd=await getTargetSqlQueries(_0x56bc2d,_0x497e35,_0x489975[_0x281b5e(0x204)](_0x281b5e(0x219))||undefined);if(_0x2c58bd[_0x281b5e(0x228)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x281b5e(0x215)};const _0x53aa9c=[],_0x3e7842=[],_0x33b768=[];for(const _0x211623 of _0x2c58bd){const _0x2aa292=_0x497e35['sqls'][_0x211623[_0x281b5e(0x22a)]];if(!_0x2aa292){_0x33b768[_0x281b5e(0x1fd)]({'sqlCode':_0x211623['sqlCode'],'error':_0x281b5e(0x21e)});continue;}try{const _0x3d7be1=await computeSqlFileHash(_0x211623['filePath']),_0x2d7a83=_0x2aa292[_0x281b5e(0x1e6)]!==_0x211623[_0x281b5e(0x212)]||!!_0x211623[_0x281b5e(0x1f3)]&&_0x2aa292[_0x281b5e(0x1f3)]!==_0x211623[_0x281b5e(0x1f3)];if(!_0x489975[_0x281b5e(0x1fe)]('force')&&_0x2aa292[_0x281b5e(0x220)]===_0x3d7be1&&!_0x2d7a83){_0x3e7842[_0x281b5e(0x1fd)]({'sqlCode':_0x211623['sqlCode'],'reason':_0x281b5e(0x214)});continue;}if(_0x2aa292[_0x281b5e(0x1fc)]==null){_0x33b768[_0x281b5e(0x1fd)]({'sqlCode':_0x211623['sqlCode'],'error':'missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first'});continue;}const _0x4cd890=await readFile(_0x211623[_0x281b5e(0x216)],_0x281b5e(0x1e9)),_0x239945=stripLocalSqlMetadata(_0x4cd890,_0x211623[_0x281b5e(0x202)]),_0x4fb51f=_0x211623[_0x281b5e(0x1f3)]||_0x2aa292[_0x281b5e(0x1f3)],_0x4fe1f1=await resolveTargetDbBinding(_0x489975[_0x281b5e(0x213)],_0x211623,_0x2aa292),_0x1cd52e=await updateSqlQuery({'id':_0x2aa292['remoteId'],'appCode':_0x489975[_0x281b5e(0x213)],'sqlCode':_0x211623['sqlCode'],'sqlName':_0x4fb51f,'dbId':_0x4fe1f1['dbId'],'version':_0x2aa292[_0x281b5e(0x1fc)],'sqlContent':_0x239945,'sqlConfig':_0x2aa292[_0x281b5e(0x20a)]??undefined}),_0x37df69=_0x1cd52e[_0x281b5e(0x21a)]?await getDbName(_0x489975[_0x281b5e(0x213)],Number(_0x1cd52e[_0x281b5e(0x21a)]))[_0x281b5e(0x1ee)](()=>_0x4fe1f1[_0x281b5e(0x1e4)]):_0x4fe1f1[_0x281b5e(0x1e4)];_0x497e35[_0x281b5e(0x1eb)][_0x211623['sqlCode']]={...buildSqlLockEntry(_0x1cd52e,_0x239945,_0x3d7be1,{'dbName':_0x37df69}),'path':_0x211623[_0x281b5e(0x212)],'mode':_0x2aa292['mode']},await archivePreviousSqlFileIfNeeded(_0x56bc2d,_0x2aa292[_0x281b5e(0x1e6)],_0x211623[_0x281b5e(0x212)]),_0x53aa9c['push']({'sqlCode':_0x211623['sqlCode'],'remoteId':_0x2aa292[_0x281b5e(0x1f5)]});}catch(_0x952a99){_0x33b768[_0x281b5e(0x1fd)]({'sqlCode':_0x211623[_0x281b5e(0x22a)],'error':_0x952a99 instanceof Error?_0x952a99['message']:String(_0x952a99)});}}_0x497e35['lastSync']=new Date()['toISOString'](),await writeSqlLockFile(_0x56bc2d[_0x281b5e(0x20b)],_0x379930);const _0x286b8a=_0x33b768[_0x281b5e(0x228)]===0x0,_0x3eb34d=await runAutomaticDeploymentSync(_0x489975,_0x281b5e(0x203),_0x53aa9c['map'](_0x2947ab=>_0x2947ab[_0x281b5e(0x22a)]),_0x286b8a),_0x59b5d7=_0x286b8a&&automaticDeploymentSyncSucceeded(_0x3eb34d),_0x2bae0=_0x3eb34d[_0x281b5e(0x21f)]?_0x281b5e(0x222)+_0x3eb34d[_0x281b5e(0x201)]:'';return{'ok':_0x59b5d7,'data':{'pushed':_0x53aa9c,'skipped':_0x3e7842,'failed':_0x33b768,'deploymentSync':_0x3eb34d},'message':_0x281b5e(0x1e3)+_0x53aa9c[_0x281b5e(0x228)]+_0x281b5e(0x1ec)+_0x3e7842['length']+_0x281b5e(0x209)+_0x33b768[_0x281b5e(0x228)]+'\x20failed'+_0x2bae0};}};async function archivePreviousSqlFileIfNeeded(_0xcf343b,_0x37d667,_0x547b70){const _0x3adc4a=a197_0x218fea;if(!_0x37d667||_0x37d667===_0x547b70)return;const _0x1e8150=join(_0xcf343b['sqlRootDir'],_0x37d667);if(!await fileExists(_0x1e8150))return;const _0x42f6c9=await moveToTrash(_0xcf343b[_0x3adc4a(0x225)],_0xcf343b[_0x3adc4a(0x21b)],_0x1e8150);await cleanupEmptyDirectories(dirname(_0x1e8150),_0xcf343b[_0x3adc4a(0x1fb)]),void _0x42f6c9;}async function moveToTrash(_0xfa1770,_0x4f7664,_0x36fe67){const _0x405a67=a197_0x218fea,_0xa47bf4=new Date()['toISOString']()[_0x405a67(0x205)](/[:.]/g,'-'),_0x5cd74b=relative(_0xfa1770,_0x36fe67),_0xd940c9=join(_0x4f7664,_0xa47bf4,_0x5cd74b);return await mkdir(dirname(_0xd940c9),{'recursive':!![]}),await rename(_0x36fe67,_0xd940c9),_0xd940c9;}async function cleanupEmptyDirectories(_0x20e399,_0x529449){const _0x48ec98=a197_0x218fea;let _0x51192e=resolve(_0x20e399);const _0x46bf18=resolve(_0x529449);while(_0x51192e[_0x48ec98(0x206)](''+_0x46bf18+sep)||_0x51192e===_0x46bf18){if(_0x51192e===_0x46bf18)return;try{const _0x262651=await readdir(_0x51192e);if(_0x262651[_0x48ec98(0x228)]>0x0)return;await rmdir(_0x51192e);}catch{return;}_0x51192e=dirname(_0x51192e);}}async function resolveTargetDbBinding(_0x34e4dd,_0x1eb64c,_0x149a0c){const _0x23151b=a197_0x218fea,_0x559c66=_0x1eb64c['dbDirectory'];if(!_0x559c66)return{'dbId':_0x149a0c['dbId'],'dbName':_0x149a0c[_0x23151b(0x1e4)]};const _0x8cfe61=buildDbDirectoryName(_0x149a0c[_0x23151b(0x1e4)],_0x149a0c['dbId']);if(_0x559c66===_0x8cfe61)return{'dbId':_0x149a0c[_0x23151b(0x21a)],'dbName':_0x149a0c[_0x23151b(0x1e4)]};const _0x29ef08=parseExplicitDbDirectory(_0x559c66);if(_0x29ef08!=null)return{'dbId':_0x29ef08,'dbName':await getDbName(_0x34e4dd,_0x29ef08)[_0x23151b(0x1ee)](()=>undefined)};const _0x4afc99=await listDatabases(_0x34e4dd),_0xc7486a=_0x4afc99[_0x23151b(0x1f6)](_0x1b8028=>buildDbDirectoryName(_0x1b8028['dbName'],_0x1b8028[_0x23151b(0x21a)])===_0x559c66);if(_0xc7486a['length']===0x1)return{'dbId':_0xc7486a[0x0][_0x23151b(0x21a)],'dbName':_0xc7486a[0x0]['dbName']};if(_0xc7486a[_0x23151b(0x228)]===0x0)throw CliErrors[_0x23151b(0x210)](_0x23151b(0x1ef)+_0x559c66+_0x23151b(0x1e7)+_0x1eb64c['sqlCode']+'.');const _0x11af72=_0xc7486a[_0x23151b(0x229)](_0x1eaa16=>_0x1eaa16[_0x23151b(0x1e4)]+'\x20('+_0x1eaa16[_0x23151b(0x21a)]+')')[_0x23151b(0x224)](',\x20');throw CliErrors[_0x23151b(0x210)](_0x23151b(0x1f0)+_0x559c66+'\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20'+_0x1eb64c[_0x23151b(0x22a)]+':\x20'+_0x11af72);}function a197_0x39f5(){const _0x6ea6b0=['72DEXAPr','\x20SQL\x20file(s)','get','validation','set','relativePath','appCode','unchanged','No\x20local\x20SQL\x20files\x20found.','filePath','6208940pIhNBZ','244230nPUbus','sqlcode','dbId','trashDir','entries','1015064mJvRjI','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','configured','hash','force',',\x20deployment\x20sync\x20','Push\x20local\x20SQL\x20files\x20to\x20remote','join','projectRoot','Local\x20SQL\x20not\x20found:\x20','/smartapi/custom/updateUserCustomSql','length','map','sqlCode','Push\x20complete:\x20','dbName','has','path','\x22\x20for\x20sqlCode\x20','exec','utf8','90543FAFqfx','sqls','\x20pushed,\x20','Would\x20push\x20','catch','No\x20database\x20matches\x20local\x20directory\x20\x22','Local\x20directory\x20\x22','isFinite','14984717urrmaO','sqlName','5252658OjcfFB','remoteId','filter','2mhhSpf','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','12NkiXeA','668210ntAehn','sqlRootDir','version','push','bool','7lOPylU','sqlRoot','status','mode','sql','str','replace','startsWith','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','36qpbGqu','\x20skipped,\x20','sqlConfig','lockFilePath','boolean'];a197_0x39f5=function(){return _0x6ea6b0;};return a197_0x39f5();}function parseExplicitDbDirectory(_0x9aa7e4){const _0x34c1a0=a197_0x218fea,_0x3e337c=/^db-(\d+)$/[_0x34c1a0(0x1e8)](_0x9aa7e4);if(!_0x3e337c)return null;const _0xf6f0a0=Number(_0x3e337c[0x1]);return Number[_0x34c1a0(0x1f1)](_0xf6f0a0)&&_0xf6f0a0>0x0?_0xf6f0a0:null;}
1
+ const a203_0x430d9f=a203_0x54b5;(function(_0x3e4705,_0x1c0f85){const _0x71dd6e=a203_0x54b5,_0x18c812=_0x3e4705();while(!![]){try{const _0x34502c=parseInt(_0x71dd6e(0xeb))/0x1*(-parseInt(_0x71dd6e(0xe6))/0x2)+-parseInt(_0x71dd6e(0xb6))/0x3*(-parseInt(_0x71dd6e(0xbc))/0x4)+parseInt(_0x71dd6e(0xdf))/0x5+parseInt(_0x71dd6e(0xe5))/0x6*(parseInt(_0x71dd6e(0xc0))/0x7)+parseInt(_0x71dd6e(0xc3))/0x8+parseInt(_0x71dd6e(0xdc))/0x9*(parseInt(_0x71dd6e(0xd6))/0xa)+-parseInt(_0x71dd6e(0xe8))/0xb;if(_0x34502c===_0x1c0f85)break;else _0x18c812['push'](_0x18c812['shift']());}catch(_0x42567f){_0x18c812['push'](_0x18c812['shift']());}}}(a203_0x504b,0xb285b));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';function a203_0x54b5(_0x847a93,_0x56b475){_0x847a93=_0x847a93-0xa9;const _0x504bba=a203_0x504b();let _0x54b5c3=_0x504bba[_0x847a93];return _0x54b5c3;}import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';function a203_0x504b(){const _0x277c38=['No\x20local\x20SQL\x20files\x20found.','3BhaXyx','toISOString','sql','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','path','message','bool','sqlCode','catch','replace','write','dbDirectory','exec','sqlConfig','sqlName','sqls','boolean','6zhQkoO','relativePath','\x22\x20for\x20sqlCode\x20','force','POST','mode','2472184OJzSjm','unchanged','Would\x20push\x20','get','464709StGKNd','lockFilePath','sqlRoot','8614944BJHyYM','No\x20database\x20matches\x20local\x20directory\x20\x22','/smartapi/custom/updateUserCustomSql','validation','sqlcode','\x20failed','appCode','status','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','Push\x20local\x20SQL\x20files\x20to\x20remote','dbName','sqlRootDir','join','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','\x20skipped,\x20','isFinite','filePath','Local\x20directory\x20\x22','length','14690scZCit','set','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','lastSync','filter','remoteId','3744Obekpo','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','has','2503695qGBdqr','push','\x20pushed,\x20','map','entries','str','12gxQDte','181294kGbFel','version','28098499hrAwwG','dbId'];a203_0x504b=function(){return _0x277c38;};return a203_0x504b();}import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';import{automaticDeploymentSyncSucceeded,buildAutomaticDeploymentSyncPreview,runAutomaticDeploymentSync,validateAutomaticDeploymentSync}from'../../commands/deployment/auto-sync.js';async function getTargetSqlQueries(_0x380576,_0x6110b,_0x381f44){const _0x52710b=a203_0x54b5,_0x387214=await scanLocalSqlQueries(_0x380576),_0x302bdc=new Map();for(const _0x5edade of _0x387214){if(_0x381f44&&_0x5edade[_0x52710b(0xac)]!==_0x381f44)continue;const _0x4aea67=_0x302bdc[_0x52710b(0xbf)](_0x5edade[_0x52710b(0xac)])??[];_0x4aea67[_0x52710b(0xe0)](_0x5edade),_0x302bdc[_0x52710b(0xd7)](_0x5edade['sqlCode'],_0x4aea67);}if(_0x381f44&&!_0x302bdc[_0x52710b(0xde)](_0x381f44))throw CliErrors[_0x52710b(0xc6)]('Local\x20SQL\x20not\x20found:\x20'+_0x381f44);const _0xbcc388=[];for(const [_0x2840ba,_0x11ff92]of _0x302bdc[_0x52710b(0xe3)]()){if(_0x11ff92[_0x52710b(0xd5)]===0x1){_0xbcc388[_0x52710b(0xe0)](_0x11ff92[0x0]);continue;}const _0x35b810=_0x6110b['sqls'][_0x2840ba],_0x1cfa27=_0x35b810?.['path'],_0x5328b7=_0x1cfa27?_0x11ff92[_0x52710b(0xda)](_0x4e3110=>_0x4e3110[_0x52710b(0xb7)]!==_0x1cfa27):_0x11ff92;if(_0x35b810&&_0x5328b7['length']===0x1){_0xbcc388[_0x52710b(0xe0)](_0x5328b7[0x0]);continue;}throw CliErrors[_0x52710b(0xc6)](_0x52710b(0xdd)+_0x2840ba+_0x52710b(0xcb));}return _0xbcc388;}export const sqlPush={'service':a203_0x430d9f(0xed),'command':a203_0x430d9f(0xe0),'description':a203_0x430d9f(0xcc),'risk':a203_0x430d9f(0xaf),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':'force','type':a203_0x430d9f(0xb5),'description':a203_0x430d9f(0xd8)}],async 'validate'(_0x4c407a){validateAutomaticDeploymentSync(_0x4c407a);},async 'dryRun'(_0x48e6da){const _0x376cf5=a203_0x430d9f,_0x3e2889=loadSqlProjectConfig(_0x48e6da[_0x376cf5(0xc9)]),_0x410875=await readSqlLockFile(_0x3e2889[_0x376cf5(0xc1)]),{appLock:_0x33ab00}=ensureSqlLockScope(_0x410875??createEmptySqlLock(),_0x48e6da[_0x376cf5(0xc9)],_0x3e2889[_0x376cf5(0xc2)],_0x376cf5(0xe0)),_0x26a645=await getTargetSqlQueries(_0x3e2889,_0x33ab00,_0x48e6da[_0x376cf5(0xe4)]('sqlcode')||undefined),_0x256a66=[];for(const _0x4c6faa of _0x26a645){const _0xd50a3a=await computeSqlFileHash(_0x4c6faa[_0x376cf5(0xd3)]),_0x224387=_0x33ab00[_0x376cf5(0xb4)][_0x4c6faa[_0x376cf5(0xac)]],_0x4502bf=!!_0x224387&&(_0x224387[_0x376cf5(0xa9)]!==_0x4c6faa[_0x376cf5(0xb7)]||!!_0x4c6faa[_0x376cf5(0xb3)]&&_0x224387[_0x376cf5(0xb3)]!==_0x4c6faa['sqlName']);if(!_0x48e6da[_0x376cf5(0xab)]('force')&&_0x224387&&_0x224387['hash']===_0xd50a3a&&!_0x4502bf)continue;_0x256a66[_0x376cf5(0xe0)](_0x4c6faa[_0x376cf5(0xac)]);}return{'method':_0x376cf5(0xba),'url':_0x376cf5(0xc5),'deploymentSync':buildAutomaticDeploymentSyncPreview(_0x48e6da,_0x376cf5(0xed),_0x256a66),'body':{'sqlCodes':_0x256a66,'appCode':_0x48e6da[_0x376cf5(0xc9)]},'description':_0x376cf5(0xbe)+_0x256a66[_0x376cf5(0xd5)]+'\x20SQL\x20file(s)'};},async 'execute'(_0x5bef55){const _0xdecf27=a203_0x430d9f,_0x5293f6=loadSqlProjectConfig(_0x5bef55[_0xdecf27(0xc9)]),_0x454f57=await readSqlLockFile(_0x5293f6[_0xdecf27(0xc1)]),{lockData:_0x2dda38,appLock:_0x1098c0}=ensureSqlLockScope(_0x454f57??createEmptySqlLock(),_0x5bef55[_0xdecf27(0xc9)],_0x5293f6[_0xdecf27(0xc2)],_0xdecf27(0xe0)),_0xcce273=await getTargetSqlQueries(_0x5293f6,_0x1098c0,_0x5bef55['str'](_0xdecf27(0xc7))||undefined);if(_0xcce273[_0xdecf27(0xd5)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0xdecf27(0xea)};const _0x30eecc=[],_0x2006f7=[],_0x59172f=[];for(const _0xcf1650 of _0xcce273){const _0x18c196=_0x1098c0['sqls'][_0xcf1650['sqlCode']];if(!_0x18c196){_0x59172f[_0xdecf27(0xe0)]({'sqlCode':_0xcf1650[_0xdecf27(0xac)],'error':'local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first'});continue;}try{const _0x676dba=await computeSqlFileHash(_0xcf1650[_0xdecf27(0xd3)]),_0xd1d4d9=_0x18c196[_0xdecf27(0xa9)]!==_0xcf1650['relativePath']||!!_0xcf1650['sqlName']&&_0x18c196[_0xdecf27(0xb3)]!==_0xcf1650[_0xdecf27(0xb3)];if(!_0x5bef55[_0xdecf27(0xab)](_0xdecf27(0xb9))&&_0x18c196['hash']===_0x676dba&&!_0xd1d4d9){_0x2006f7[_0xdecf27(0xe0)]({'sqlCode':_0xcf1650[_0xdecf27(0xac)],'reason':_0xdecf27(0xbd)});continue;}if(_0x18c196['version']==null){_0x59172f['push']({'sqlCode':_0xcf1650[_0xdecf27(0xac)],'error':_0xdecf27(0xee)});continue;}const _0x463259=await readFile(_0xcf1650[_0xdecf27(0xd3)],'utf8'),_0x3ad01e=stripLocalSqlMetadata(_0x463259,_0xcf1650[_0xdecf27(0xbb)]),_0x3d1c4f=_0xcf1650['sqlName']||_0x18c196['sqlName'],_0x1725fd=await resolveTargetDbBinding(_0x5bef55[_0xdecf27(0xc9)],_0xcf1650,_0x18c196),_0x3263fa=await updateSqlQuery({'id':_0x18c196[_0xdecf27(0xdb)],'appCode':_0x5bef55[_0xdecf27(0xc9)],'sqlCode':_0xcf1650[_0xdecf27(0xac)],'sqlName':_0x3d1c4f,'dbId':_0x1725fd[_0xdecf27(0xe9)],'version':_0x18c196[_0xdecf27(0xe7)],'sqlContent':_0x3ad01e,'sqlConfig':_0x18c196[_0xdecf27(0xb2)]??undefined}),_0x284daf=_0x3263fa[_0xdecf27(0xe9)]?await getDbName(_0x5bef55[_0xdecf27(0xc9)],Number(_0x3263fa['dbId']))[_0xdecf27(0xad)](()=>_0x1725fd[_0xdecf27(0xcd)]):_0x1725fd['dbName'];_0x1098c0[_0xdecf27(0xb4)][_0xcf1650[_0xdecf27(0xac)]]={...buildSqlLockEntry(_0x3263fa,_0x3ad01e,_0x676dba,{'dbName':_0x284daf}),'path':_0xcf1650[_0xdecf27(0xb7)],'mode':_0x18c196[_0xdecf27(0xbb)]},await archivePreviousSqlFileIfNeeded(_0x5293f6,_0x18c196[_0xdecf27(0xa9)],_0xcf1650[_0xdecf27(0xb7)]),_0x30eecc[_0xdecf27(0xe0)]({'sqlCode':_0xcf1650[_0xdecf27(0xac)],'remoteId':_0x18c196[_0xdecf27(0xdb)]});}catch(_0x2ddef5){_0x59172f[_0xdecf27(0xe0)]({'sqlCode':_0xcf1650['sqlCode'],'error':_0x2ddef5 instanceof Error?_0x2ddef5[_0xdecf27(0xaa)]:String(_0x2ddef5)});}}_0x1098c0[_0xdecf27(0xd9)]=new Date()[_0xdecf27(0xec)](),await writeSqlLockFile(_0x5293f6[_0xdecf27(0xc1)],_0x2dda38);const _0x42d49c=_0x59172f[_0xdecf27(0xd5)]===0x0,_0x254c21=await runAutomaticDeploymentSync(_0x5bef55,'sql',_0x30eecc[_0xdecf27(0xe2)](_0x2ffc5b=>_0x2ffc5b['sqlCode']),_0x42d49c),_0x3bbdf5=_0x42d49c&&automaticDeploymentSyncSucceeded(_0x254c21),_0x312c69=_0x254c21['configured']?',\x20deployment\x20sync\x20'+_0x254c21[_0xdecf27(0xca)]:'';return{'ok':_0x3bbdf5,'data':{'pushed':_0x30eecc,'skipped':_0x2006f7,'failed':_0x59172f,'deploymentSync':_0x254c21},'message':'Push\x20complete:\x20'+_0x30eecc[_0xdecf27(0xd5)]+_0xdecf27(0xe1)+_0x2006f7[_0xdecf27(0xd5)]+_0xdecf27(0xd1)+_0x59172f[_0xdecf27(0xd5)]+_0xdecf27(0xc8)+_0x312c69};}};async function archivePreviousSqlFileIfNeeded(_0x518632,_0x15d08c,_0xffbdb2){const _0x498f45=a203_0x430d9f;if(!_0x15d08c||_0x15d08c===_0xffbdb2)return;const _0x5f36e1=join(_0x518632[_0x498f45(0xce)],_0x15d08c);if(!await fileExists(_0x5f36e1))return;const _0x192dbd=await moveToTrash(_0x518632['projectRoot'],_0x518632['trashDir'],_0x5f36e1);await cleanupEmptyDirectories(dirname(_0x5f36e1),_0x518632['sqlRootDir']),void _0x192dbd;}async function moveToTrash(_0x321507,_0x143b11,_0x340429){const _0x1966ec=a203_0x430d9f,_0x537eec=new Date()['toISOString']()[_0x1966ec(0xae)](/[:.]/g,'-'),_0xc1a0be=relative(_0x321507,_0x340429),_0x3b5a73=join(_0x143b11,_0x537eec,_0xc1a0be);return await mkdir(dirname(_0x3b5a73),{'recursive':!![]}),await rename(_0x340429,_0x3b5a73),_0x3b5a73;}async function cleanupEmptyDirectories(_0x7b5bdb,_0x4343b7){const _0x5b3595=a203_0x430d9f;let _0x5daad2=resolve(_0x7b5bdb);const _0xfd18b1=resolve(_0x4343b7);while(_0x5daad2['startsWith'](''+_0xfd18b1+sep)||_0x5daad2===_0xfd18b1){if(_0x5daad2===_0xfd18b1)return;try{const _0x71fac8=await readdir(_0x5daad2);if(_0x71fac8[_0x5b3595(0xd5)]>0x0)return;await rmdir(_0x5daad2);}catch{return;}_0x5daad2=dirname(_0x5daad2);}}async function resolveTargetDbBinding(_0xe2eea6,_0x4f6ba6,_0x458e85){const _0xe7bead=a203_0x430d9f,_0x35e7aa=_0x4f6ba6[_0xe7bead(0xb0)];if(!_0x35e7aa)return{'dbId':_0x458e85['dbId'],'dbName':_0x458e85[_0xe7bead(0xcd)]};const _0x20c85b=buildDbDirectoryName(_0x458e85[_0xe7bead(0xcd)],_0x458e85[_0xe7bead(0xe9)]);if(_0x35e7aa===_0x20c85b)return{'dbId':_0x458e85[_0xe7bead(0xe9)],'dbName':_0x458e85[_0xe7bead(0xcd)]};const _0x339294=parseExplicitDbDirectory(_0x35e7aa);if(_0x339294!=null)return{'dbId':_0x339294,'dbName':await getDbName(_0xe2eea6,_0x339294)[_0xe7bead(0xad)](()=>undefined)};const _0x562b71=await listDatabases(_0xe2eea6),_0x342aa7=_0x562b71[_0xe7bead(0xda)](_0x3f6178=>buildDbDirectoryName(_0x3f6178[_0xe7bead(0xcd)],_0x3f6178[_0xe7bead(0xe9)])===_0x35e7aa);if(_0x342aa7[_0xe7bead(0xd5)]===0x1)return{'dbId':_0x342aa7[0x0][_0xe7bead(0xe9)],'dbName':_0x342aa7[0x0][_0xe7bead(0xcd)]};if(_0x342aa7[_0xe7bead(0xd5)]===0x0)throw CliErrors['validation'](_0xe7bead(0xc4)+_0x35e7aa+_0xe7bead(0xb8)+_0x4f6ba6[_0xe7bead(0xac)]+'.');const _0x27db1a=_0x342aa7['map'](_0x4f8255=>_0x4f8255['dbName']+'\x20('+_0x4f8255['dbId']+')')[_0xe7bead(0xcf)](',\x20');throw CliErrors[_0xe7bead(0xc6)](_0xe7bead(0xd4)+_0x35e7aa+_0xe7bead(0xd0)+_0x4f6ba6[_0xe7bead(0xac)]+':\x20'+_0x27db1a);}function parseExplicitDbDirectory(_0x5041b8){const _0x20fc7b=a203_0x430d9f,_0x3c1baf=/^db-(\d+)$/[_0x20fc7b(0xb1)](_0x5041b8);if(!_0x3c1baf)return null;const _0x4a6f5b=Number(_0x3c1baf[0x1]);return Number[_0x20fc7b(0xd2)](_0x4a6f5b)&&_0x4a6f5b>0x0?_0x4a6f5b:null;}
@@ -1 +1 @@
1
- function a198_0x40b6(_0x2f0969,_0x23c5c9){_0x2f0969=_0x2f0969-0x18c;const _0x170b69=a198_0x170b();let _0x40b624=_0x170b69[_0x2f0969];return _0x40b624;}const a198_0x1630b0=a198_0x40b6;(function(_0x4dd1a0,_0x4456f8){const _0x4eec4a=a198_0x40b6,_0x4e2ee7=_0x4dd1a0();while(!![]){try{const _0x4fc53d=parseInt(_0x4eec4a(0x18f))/0x1*(parseInt(_0x4eec4a(0x1a4))/0x2)+-parseInt(_0x4eec4a(0x197))/0x3+-parseInt(_0x4eec4a(0x191))/0x4*(-parseInt(_0x4eec4a(0x19d))/0x5)+parseInt(_0x4eec4a(0x1b2))/0x6+-parseInt(_0x4eec4a(0x1af))/0x7*(parseInt(_0x4eec4a(0x1ac))/0x8)+parseInt(_0x4eec4a(0x18d))/0x9*(-parseInt(_0x4eec4a(0x19b))/0xa)+parseInt(_0x4eec4a(0x1ab))/0xb*(parseInt(_0x4eec4a(0x1a5))/0xc);if(_0x4fc53d===_0x4456f8)break;else _0x4e2ee7['push'](_0x4e2ee7['shift']());}catch(_0x328f62){_0x4e2ee7['push'](_0x4e2ee7['shift']());}}}(a198_0x170b,0xeef1d));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_0x1630b0(0x194);export function buildSqlLockEntry(_0x39aacf,_0x2448f3,_0x1f55eb,_0xf29a50){const _0x154077=a198_0x1630b0,_0x302cc5=detectSqlMode(_0x2448f3);return{'path':buildSqlRelativePath(_0x39aacf[_0x154077(0x19e)],_0x39aacf[_0x154077(0x18c)],_0xf29a50?.[_0x154077(0x196)],_0x302cc5,_0x39aacf[_0x154077(0x1aa)]),'hash':_0x1f55eb,'remoteId':_0x39aacf['id'],'version':_0x39aacf[_0x154077(0x19f)],'dbId':Number(_0x39aacf[_0x154077(0x1aa)]),'dbName':_0xf29a50?.['dbName'],'sqlName':_0x39aacf[_0x154077(0x18c)],'sqlConfig':_0x39aacf[_0x154077(0x1a0)]??undefined,'mode':_0x302cc5};}export function cloneSqlLockData(_0x154152){const _0x41e88f=a198_0x1630b0;return{'apps':Object[_0x41e88f(0x1b4)](Object[_0x41e88f(0x1a8)](_0x154152[_0x41e88f(0x195)])[_0x41e88f(0x1b1)](([_0x26a69b,_0x2486cc])=>[_0x26a69b,{'sqlRoot':_0x2486cc[_0x41e88f(0x1ae)],'lastSync':_0x2486cc[_0x41e88f(0x1b3)],'sqls':{..._0x2486cc[_0x41e88f(0x1a7)]}}]))};}export function ensureRemoteSqlContent(_0x2fe419){const _0x22b652=a198_0x1630b0;return _0x2fe419[_0x22b652(0x1a3)]??'';}function a198_0x170b(){const _0xb1939d=['12trvSOu','filter','sqls','entries','syncedAt','dbId','28970392yjqJRl','184zbKZIf','toLowerCase','sqlRoot','416591FsKTVT','path','map','4182738Qitfbc','lastSync','fromEntries','join','length','sqlName','45tiLkwr','question','352646PpBFau','<!--\x20@lovrabet.','4ygCTwh','trim','mode','.rabetbase/sql','apps','dbName','4675401cRGVjg','test','description','trimStart','1016700EOsEfJ','close','128000QhnkQm','sqlCode','version','sqlConfig','\x20-->','mybatisXml','sqlContent','6Vnrufi'];a198_0x170b=function(){return _0xb1939d;};return a198_0x170b();}export function buildLocalSqlFileContent(_0x4fc412,_0x11a271,_0x8c9cf){const _0x1a2794=a198_0x1630b0,_0x26b77a=_0x8c9cf?.[_0x1a2794(0x193)]??detectSqlMode(_0x11a271),_0x51074=stripLocalSqlMetadata(_0x11a271,_0x26b77a)[_0x1a2794(0x192)](),_0x20b5d5=[...buildMetadataHeaderLines({'sqlCode':_0x4fc412[_0x1a2794(0x19e)],'sqlName':_0x4fc412[_0x1a2794(0x18c)],'dbId':_0x4fc412['dbId'],'dbName':_0x8c9cf?.[_0x1a2794(0x196)],'mode':_0x26b77a,'syncedAt':_0x8c9cf?.[_0x1a2794(0x1a9)],'description':_0x8c9cf?.[_0x1a2794(0x199)]},_0x26b77a),'',_0x51074],_0x369a0e=_0x20b5d5[_0x1a2794(0x1b5)]('\x0a');return _0x369a0e['endsWith']('\x0a')?_0x369a0e:_0x369a0e+'\x0a';}export function stripLocalSqlMetadata(_0x58c62d,_0x3db721){const _0x4d067d=a198_0x1630b0,_0x30cd32=_0x58c62d['replace'](/\r\n/g,'\x0a')['split']('\x0a'),_0xe4739e=[];let _0x18d561=0x0;if(_0x3db721===_0x4d067d(0x1a2))while(_0x18d561<_0x30cd32[_0x4d067d(0x1b6)]){const _0x3be4e0=_0x30cd32[_0x18d561]??'';if(/^\s*<!--\s*@lovrabet\./[_0x4d067d(0x198)](_0x3be4e0)){_0x18d561++;continue;}if(_0x3be4e0[_0x4d067d(0x192)]()===''&&_0x18d561>0x0){_0x18d561++;continue;}break;}else while(_0x18d561<_0x30cd32[_0x4d067d(0x1b6)]){const _0x447bab=_0x30cd32[_0x18d561]??'';if(/^\s*--\s*@lovrabet\./['test'](_0x447bab)){_0x18d561++;continue;}if(_0x447bab['trim']()===''&&_0x18d561>0x0){_0x18d561++;continue;}break;}for(;_0x18d561<_0x30cd32[_0x4d067d(0x1b6)];_0x18d561++){_0xe4739e['push'](_0x30cd32[_0x18d561]);}return _0xe4739e['join']('\x0a')[_0x4d067d(0x19a)]();}export function resolveSqlMode(_0x474650,_0x5914f0){const _0x5aaefb=a198_0x1630b0;if(_0x5914f0?.[_0x5aaefb(0x193)])return _0x5914f0[_0x5aaefb(0x193)];return detectSqlMode(_0x474650);}export function resolveSqlFileName(_0x2678dd,_0xdc9e0b,_0x18114a){const _0xdce2fd=a198_0x1630b0;if(_0x18114a?.[_0xdce2fd(0x1b0)])return _0x18114a[_0xdce2fd(0x1b0)];if(_0x18114a?.[_0xdce2fd(0x18c)]||_0x18114a?.[_0xdce2fd(0x196)])return buildSqlRelativePath(_0x2678dd,_0x18114a?.[_0xdce2fd(0x18c)],_0x18114a?.[_0xdce2fd(0x196)],resolveSqlMode(_0xdc9e0b,_0x18114a),_0x18114a?.[_0xdce2fd(0x1aa)]);return buildDefaultSqlFileName(_0x2678dd,resolveSqlMode(_0xdc9e0b,_0x18114a));}export function resolveSqlLocalDir(_0x2a4760,_0x47ae14){return join(_0x2a4760,SQL_LOCAL_REL_DIR,_0x47ae14);}export async function confirmForceOverwrite(_0xaa57b1){const _0x478169=a198_0x1630b0,_0x574cb6=createInterface({'input':process['stdin'],'output':process['stderr']}),_0x219d2d=await new Promise(_0x2cec7e=>{const _0x156325=a198_0x40b6;_0x574cb6[_0x156325(0x18e)](_0xaa57b1+'\x20[y/N]\x20',_0x2cec7e);});return _0x574cb6[_0x478169(0x19c)](),['y','yes']['includes'](_0x219d2d['trim']()[_0x478169(0x1ad)]());}export function findSqlLockScope(_0x3c4b56,_0x399a6f){const _0x5793fd=a198_0x1630b0;return _0x3c4b56[_0x5793fd(0x195)][_0x399a6f];}function buildMetadataHeaderLines(_0x258ee0,_0x71a7df){const _0x117bd1=a198_0x1630b0,_0x325bf9=[['sqlCode',_0x258ee0[_0x117bd1(0x19e)]],[_0x117bd1(0x18c),_0x258ee0[_0x117bd1(0x18c)]],[_0x117bd1(0x1aa),_0x258ee0['dbId']],[_0x117bd1(0x196),_0x258ee0[_0x117bd1(0x196)]],['mode',_0x258ee0[_0x117bd1(0x193)]],[_0x117bd1(0x1a9),_0x258ee0[_0x117bd1(0x1a9)]],['description',_0x258ee0['description']]];if(_0x71a7df===_0x117bd1(0x1a2))return _0x325bf9[_0x117bd1(0x1a6)](([,_0x495080])=>_0x495080!==undefined&&_0x495080!==null&&String(_0x495080)[_0x117bd1(0x192)]()!=='')[_0x117bd1(0x1b1)](([_0x4f7d35,_0x3f5760])=>_0x117bd1(0x190)+_0x4f7d35+':\x20'+String(_0x3f5760)+_0x117bd1(0x1a1));return _0x325bf9['filter'](([,_0x1bf2a9])=>_0x1bf2a9!==undefined&&_0x1bf2a9!==null&&String(_0x1bf2a9)[_0x117bd1(0x192)]()!=='')[_0x117bd1(0x1b1)](([_0xbc9c02,_0x474210])=>'--\x20@lovrabet.'+_0xbc9c02+':\x20'+String(_0x474210));}
1
+ const a204_0x23ecdd=a204_0x2321;function a204_0x2321(_0x2e3367,_0x6db48a){_0x2e3367=_0x2e3367-0xfc;const _0xe020d7=a204_0xe020();let _0x2321c1=_0xe020d7[_0x2e3367];return _0x2321c1;}(function(_0x3f43e0,_0x265645){const _0x2486b3=a204_0x2321,_0x3d7043=_0x3f43e0();while(!![]){try{const _0x1db213=-parseInt(_0x2486b3(0x105))/0x1*(-parseInt(_0x2486b3(0x11a))/0x2)+parseInt(_0x2486b3(0x10d))/0x3*(-parseInt(_0x2486b3(0xfd))/0x4)+-parseInt(_0x2486b3(0x104))/0x5+parseInt(_0x2486b3(0x10e))/0x6*(-parseInt(_0x2486b3(0x109))/0x7)+parseInt(_0x2486b3(0x11c))/0x8*(parseInt(_0x2486b3(0x120))/0x9)+-parseInt(_0x2486b3(0x10b))/0xa*(-parseInt(_0x2486b3(0x106))/0xb)+parseInt(_0x2486b3(0x129))/0xc;if(_0x1db213===_0x265645)break;else _0x3d7043['push'](_0x3d7043['shift']());}catch(_0x2de9c1){_0x3d7043['push'](_0x3d7043['shift']());}}}(a204_0xe020,0xdc5a2));import{createInterface}from'node:readline';import{join}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';export const SQL_LOCAL_REL_DIR=a204_0x23ecdd(0x100);export function buildSqlLockEntry(_0x153fad,_0xb23d73,_0x2a8189,_0x587106){const _0x24e24a=a204_0x23ecdd,_0x51114f=detectSqlMode(_0xb23d73);return{'path':buildSqlRelativePath(_0x153fad[_0x24e24a(0xfe)],_0x153fad['sqlName'],_0x587106?.[_0x24e24a(0x117)],_0x51114f,_0x153fad[_0x24e24a(0x124)]),'hash':_0x2a8189,'remoteId':_0x153fad['id'],'version':_0x153fad[_0x24e24a(0x103)],'dbId':Number(_0x153fad[_0x24e24a(0x124)]),'dbName':_0x587106?.[_0x24e24a(0x117)],'sqlName':_0x153fad[_0x24e24a(0x11f)],'sqlConfig':_0x153fad['sqlConfig']??undefined,'mode':_0x51114f};}export function cloneSqlLockData(_0x57a992){const _0x567832=a204_0x23ecdd;return{'apps':Object[_0x567832(0x111)](Object[_0x567832(0x110)](_0x57a992[_0x567832(0x102)])[_0x567832(0x11b)](([_0x32abea,_0x578461])=>[_0x32abea,{'sqlRoot':_0x578461[_0x567832(0x128)],'lastSync':_0x578461[_0x567832(0x118)],'sqls':{..._0x578461[_0x567832(0x113)]}}]))};}export function ensureRemoteSqlContent(_0x1f5cc9){return _0x1f5cc9['sqlContent']??'';}export function buildLocalSqlFileContent(_0x23f57d,_0x180245,_0xfcc808){const _0x537eb3=a204_0x23ecdd,_0x2410d4=_0xfcc808?.[_0x537eb3(0x114)]??detectSqlMode(_0x180245),_0x1de802=stripLocalSqlMetadata(_0x180245,_0x2410d4)[_0x537eb3(0x115)](),_0x440ab9=[...buildMetadataHeaderLines({'sqlCode':_0x23f57d['sqlCode'],'sqlName':_0x23f57d[_0x537eb3(0x11f)],'dbId':_0x23f57d[_0x537eb3(0x124)],'dbName':_0xfcc808?.['dbName'],'mode':_0x2410d4,'syncedAt':_0xfcc808?.[_0x537eb3(0xfc)],'description':_0xfcc808?.[_0x537eb3(0x116)]},_0x2410d4),'',_0x1de802],_0x105daf=_0x440ab9[_0x537eb3(0x126)]('\x0a');return _0x105daf['endsWith']('\x0a')?_0x105daf:_0x105daf+'\x0a';}export function stripLocalSqlMetadata(_0xb284b2,_0x30c804){const _0x4a3f30=a204_0x23ecdd,_0x6caa68=_0xb284b2[_0x4a3f30(0x101)](/\r\n/g,'\x0a')[_0x4a3f30(0x108)]('\x0a'),_0x190084=[];let _0x45bd5b=0x0;if(_0x30c804===_0x4a3f30(0x122))while(_0x45bd5b<_0x6caa68[_0x4a3f30(0x11d)]){const _0x26ac2a=_0x6caa68[_0x45bd5b]??'';if(/^\s*<!--\s*@lovrabet\./[_0x4a3f30(0x127)](_0x26ac2a)){_0x45bd5b++;continue;}if(_0x26ac2a[_0x4a3f30(0x115)]()===''&&_0x45bd5b>0x0){_0x45bd5b++;continue;}break;}else while(_0x45bd5b<_0x6caa68[_0x4a3f30(0x11d)]){const _0xd7e206=_0x6caa68[_0x45bd5b]??'';if(/^\s*--\s*@lovrabet\./[_0x4a3f30(0x127)](_0xd7e206)){_0x45bd5b++;continue;}if(_0xd7e206[_0x4a3f30(0x115)]()===''&&_0x45bd5b>0x0){_0x45bd5b++;continue;}break;}for(;_0x45bd5b<_0x6caa68[_0x4a3f30(0x11d)];_0x45bd5b++){_0x190084[_0x4a3f30(0x107)](_0x6caa68[_0x45bd5b]);}return _0x190084[_0x4a3f30(0x126)]('\x0a')[_0x4a3f30(0xff)]();}export function resolveSqlMode(_0x37a50b,_0x483331){const _0x1ca1ee=a204_0x23ecdd;if(_0x483331?.[_0x1ca1ee(0x114)])return _0x483331[_0x1ca1ee(0x114)];return detectSqlMode(_0x37a50b);}export function resolveSqlFileName(_0x105242,_0x5c741b,_0x1b6ad8){const _0x1cffad=a204_0x23ecdd;if(_0x1b6ad8?.[_0x1cffad(0x10a)])return _0x1b6ad8[_0x1cffad(0x10a)];if(_0x1b6ad8?.[_0x1cffad(0x11f)]||_0x1b6ad8?.[_0x1cffad(0x117)])return buildSqlRelativePath(_0x105242,_0x1b6ad8?.[_0x1cffad(0x11f)],_0x1b6ad8?.[_0x1cffad(0x117)],resolveSqlMode(_0x5c741b,_0x1b6ad8),_0x1b6ad8?.[_0x1cffad(0x124)]);return buildDefaultSqlFileName(_0x105242,resolveSqlMode(_0x5c741b,_0x1b6ad8));}function a204_0xe020(){const _0x4606ce=['map','2221160BtSLIX','length','stderr','sqlName','18nDHgsM','toLowerCase','mybatisXml','includes','dbId','filter','join','test','sqlRoot','33132168InmYkF','syncedAt','5836228XRjVji','sqlCode','trimStart','.rabetbase/sql','replace','apps','version','8926035icGoTz','1iyEYcZ','11JHLPrf','push','split','28toWLjs','path','8659430jgmeai','\x20[y/N]\x20','3VdTmfM','185118RIxxKg','close','entries','fromEntries','<!--\x20@lovrabet.','sqls','mode','trim','description','dbName','lastSync','stdin','175982JGmeHa'];a204_0xe020=function(){return _0x4606ce;};return a204_0xe020();}export function resolveSqlLocalDir(_0x2fbd13,_0x46f7cf){return join(_0x2fbd13,SQL_LOCAL_REL_DIR,_0x46f7cf);}export async function confirmForceOverwrite(_0x33b6eb){const _0x23fbef=a204_0x23ecdd,_0xe730cb=createInterface({'input':process[_0x23fbef(0x119)],'output':process[_0x23fbef(0x11e)]}),_0x56915f=await new Promise(_0x245c52=>{const _0x8263ed=_0x23fbef;_0xe730cb['question'](_0x33b6eb+_0x8263ed(0x10c),_0x245c52);});return _0xe730cb[_0x23fbef(0x10f)](),['y','yes'][_0x23fbef(0x123)](_0x56915f['trim']()[_0x23fbef(0x121)]());}export function findSqlLockScope(_0x21602c,_0x585ef3){const _0x546eca=a204_0x23ecdd;return _0x21602c[_0x546eca(0x102)][_0x585ef3];}function buildMetadataHeaderLines(_0x17da0c,_0x5832c9){const _0x42715f=a204_0x23ecdd,_0x3ca6d1=[[_0x42715f(0xfe),_0x17da0c[_0x42715f(0xfe)]],[_0x42715f(0x11f),_0x17da0c['sqlName']],[_0x42715f(0x124),_0x17da0c['dbId']],['dbName',_0x17da0c['dbName']],[_0x42715f(0x114),_0x17da0c['mode']],[_0x42715f(0xfc),_0x17da0c[_0x42715f(0xfc)]],[_0x42715f(0x116),_0x17da0c[_0x42715f(0x116)]]];if(_0x5832c9===_0x42715f(0x122))return _0x3ca6d1[_0x42715f(0x125)](([,_0x36e9a1])=>_0x36e9a1!==undefined&&_0x36e9a1!==null&&String(_0x36e9a1)['trim']()!=='')[_0x42715f(0x11b)](([_0x2c84ac,_0x1e9064])=>_0x42715f(0x112)+_0x2c84ac+':\x20'+String(_0x1e9064)+'\x20-->');return _0x3ca6d1[_0x42715f(0x125)](([,_0x1f3398])=>_0x1f3398!==undefined&&_0x1f3398!==null&&String(_0x1f3398)['trim']()!=='')[_0x42715f(0x11b)](([_0x459ba9,_0x5a0036])=>'--\x20@lovrabet.'+_0x459ba9+':\x20'+String(_0x5a0036));}
@@ -1 +1 @@
1
- const a199_0x1fafe3=a199_0x1067;function a199_0x1067(_0x13042b,_0x1dfc11){_0x13042b=_0x13042b-0x7e;const _0x22f94f=a199_0x22f9();let _0x1067c9=_0x22f94f[_0x13042b];return _0x1067c9;}(function(_0x58cd96,_0x544a7d){const _0x521a71=a199_0x1067,_0x53721a=_0x58cd96();while(!![]){try{const _0x5c2119=parseInt(_0x521a71(0x95))/0x1+parseInt(_0x521a71(0x94))/0x2*(-parseInt(_0x521a71(0x8e))/0x3)+-parseInt(_0x521a71(0xa3))/0x4*(-parseInt(_0x521a71(0x8a))/0x5)+-parseInt(_0x521a71(0x98))/0x6*(parseInt(_0x521a71(0xa2))/0x7)+-parseInt(_0x521a71(0x9d))/0x8*(parseInt(_0x521a71(0x81))/0x9)+-parseInt(_0x521a71(0x9f))/0xa*(-parseInt(_0x521a71(0x83))/0xb)+-parseInt(_0x521a71(0x93))/0xc*(-parseInt(_0x521a71(0x9b))/0xd);if(_0x5c2119===_0x544a7d)break;else _0x53721a['push'](_0x53721a['shift']());}catch(_0x57d09f){_0x53721a['push'](_0x53721a['shift']());}}}(a199_0x22f9,0x913a4));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(_0x532594){const _0x2d0722=a199_0x1067,_0x34bfad=[];let _0x4c2085=0x1;while(!![]){const _0x2b6df3=await listSqlQueries(_0x532594,{'currentPage':_0x4c2085,'pageSize':PAGE_SIZE}),_0x368519=_0x2b6df3[_0x2d0722(0x8b)]??[];_0x34bfad[_0x2d0722(0x82)](..._0x368519[_0x2d0722(0x9c)](_0x42b8eb=>_0x42b8eb[_0x2d0722(0x8f)]));if(_0x368519[_0x2d0722(0x91)]===0x0)break;const _0x113c41=_0x2b6df3[_0x2d0722(0x88)]?.[_0x2d0722(0x86)];if(_0x113c41!=null?_0x34bfad[_0x2d0722(0x91)]>=_0x113c41:_0x368519['length']<PAGE_SIZE)break;_0x4c2085++;}return _0x34bfad;}export const sqlStatus={'service':a199_0x1fafe3(0x87),'command':'status','description':a199_0x1fafe3(0x9e),'risk':a199_0x1fafe3(0x92),'flags':[{'name':'remote','type':a199_0x1fafe3(0x99),'description':a199_0x1fafe3(0x7e)}],async 'execute'(_0x408ed2){const _0x2c60e1=a199_0x1fafe3,_0x39995c=loadSqlProjectConfig(_0x408ed2[_0x2c60e1(0x89)]),_0x1af65f=await readSqlLockFile(_0x39995c['lockFilePath']),{appLock:_0x1d9898}=ensureSqlLockScope(_0x1af65f??createEmptySqlLock(),_0x39995c['appCode'],_0x39995c['sqlRoot'],'status'),_0x263e70=await scanLocalSqlQueries(_0x39995c),_0x1c522e=[],_0x5245ce=[],_0x57f9e4=[],_0x483d18=[],_0x18bc05=new Set(_0x263e70[_0x2c60e1(0x9c)](_0x4dd15f=>_0x4dd15f[_0x2c60e1(0x80)]));for(const _0x47498d of _0x263e70){const _0x41edd0=await computeSqlFileHash(_0x47498d[_0x2c60e1(0x7f)]),_0x5b4954=_0x1d9898[_0x2c60e1(0x97)][_0x47498d[_0x2c60e1(0x80)]],_0x7bf17b=!!_0x5b4954&&_0x5b4954[_0x2c60e1(0xa4)]!==_0x47498d[_0x2c60e1(0x96)],_0x18bbf7=!!_0x5b4954&&!!_0x47498d[_0x2c60e1(0xa1)]&&_0x5b4954[_0x2c60e1(0xa1)]!==_0x47498d[_0x2c60e1(0xa1)];if(!_0x5b4954)_0x1c522e[_0x2c60e1(0x82)](_0x47498d['lockKey']);else _0x5b4954['hash']!==_0x41edd0||_0x7bf17b||_0x18bbf7?_0x5245ce[_0x2c60e1(0x82)](_0x47498d[_0x2c60e1(0x80)]):_0x57f9e4[_0x2c60e1(0x82)](_0x47498d[_0x2c60e1(0x80)]);}for(const _0x3f94b7 of Object['keys'](_0x1d9898[_0x2c60e1(0x97)])){!_0x18bc05[_0x2c60e1(0xa0)](_0x3f94b7)&&_0x483d18['push'](_0x3f94b7);}const _0x180d9a=[];if(_0x408ed2[_0x2c60e1(0xa5)](_0x2c60e1(0x8c))){const _0xc9bae2=await fetchAllSqlCodes(_0x408ed2[_0x2c60e1(0x89)]);for(const _0x47985d of _0xc9bae2){!_0x18bc05[_0x2c60e1(0xa0)](_0x47985d)&&!_0x1d9898['sqls'][_0x47985d]&&_0x180d9a['push'](_0x47985d);}}const _0x4ffbb7=_0x1c522e[_0x2c60e1(0x91)]===0x0&&_0x5245ce[_0x2c60e1(0x91)]===0x0&&_0x483d18['length']===0x0&&_0x180d9a[_0x2c60e1(0x91)]===0x0;return{'ok':!![],'data':{'added':_0x1c522e,'modified':_0x5245ce,'missing':_0x483d18,'unchanged':_0x57f9e4,'remoteOnly':_0x180d9a},'message':_0x4ffbb7?_0x2c60e1(0x8d):_0x1c522e[_0x2c60e1(0x91)]+_0x2c60e1(0x85)+_0x5245ce[_0x2c60e1(0x91)]+'\x20modified,\x20'+_0x483d18[_0x2c60e1(0x91)]+_0x2c60e1(0x9a)+_0x57f9e4[_0x2c60e1(0x91)]+_0x2c60e1(0x84)+(_0x180d9a[_0x2c60e1(0x91)]>0x0?',\x20'+_0x180d9a[_0x2c60e1(0x91)]+_0x2c60e1(0x90):'')};}};function a199_0x22f9(){const _0x5f47a5=['sqlName','273CpeXno','84IXyojD','path','bool','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','filePath','lockKey','9CfMlAV','push','2860peDmGS','\x20unchanged','\x20added,\x20','totalCount','sql','paging','appCode','32305arKXfE','tableData','remote','All\x20SQL\x20queries\x20are\x20in\x20sync.','4359rpuoHy','sqlCode','\x20remote-only','length','read','12xihqNm','1466JwKEdG','621717MyxkGN','relativePath','sqls','9474dWONpv','boolean','\x20missing,\x20','13353847UmFwsz','map','2578840DSiYyv','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','9970gsXmkZ','has'];a199_0x22f9=function(){return _0x5f47a5;};return a199_0x22f9();}
1
+ const a205_0x35064e=a205_0x3899;(function(_0x3b69dd,_0x583310){const _0x1026a5=a205_0x3899,_0xd58bd4=_0x3b69dd();while(!![]){try{const _0x1ac0d9=-parseInt(_0x1026a5(0x1a3))/0x1+-parseInt(_0x1026a5(0x184))/0x2*(-parseInt(_0x1026a5(0x17e))/0x3)+parseInt(_0x1026a5(0x19d))/0x4*(-parseInt(_0x1026a5(0x17d))/0x5)+-parseInt(_0x1026a5(0x185))/0x6*(parseInt(_0x1026a5(0x194))/0x7)+parseInt(_0x1026a5(0x183))/0x8*(parseInt(_0x1026a5(0x190))/0x9)+parseInt(_0x1026a5(0x18e))/0xa*(-parseInt(_0x1026a5(0x1a2))/0xb)+parseInt(_0x1026a5(0x192))/0xc*(parseInt(_0x1026a5(0x191))/0xd);if(_0x1ac0d9===_0x583310)break;else _0xd58bd4['push'](_0xd58bd4['shift']());}catch(_0x565af3){_0xd58bd4['push'](_0xd58bd4['shift']());}}}(a205_0x423e,0x9b789));import{listSqlQueries}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';function a205_0x3899(_0x5b75ee,_0x3a6497){_0x5b75ee=_0x5b75ee-0x17d;const _0x423e45=a205_0x423e();let _0x3899dc=_0x423e45[_0x5b75ee];return _0x3899dc;}import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;async function fetchAllSqlCodes(_0x365d3c){const _0x1e2da7=a205_0x3899,_0x29e393=[];let _0x140f88=0x1;while(!![]){const _0x3636ca=await listSqlQueries(_0x365d3c,{'currentPage':_0x140f88,'pageSize':PAGE_SIZE}),_0x18b880=_0x3636ca['tableData']??[];_0x29e393[_0x1e2da7(0x18d)](..._0x18b880['map'](_0x45ff22=>_0x45ff22['sqlCode']));if(_0x18b880[_0x1e2da7(0x17f)]===0x0)break;const _0x3aca3a=_0x3636ca['paging']?.[_0x1e2da7(0x18a)];if(_0x3aca3a!=null?_0x29e393['length']>=_0x3aca3a:_0x18b880[_0x1e2da7(0x17f)]<PAGE_SIZE)break;_0x140f88++;}return _0x29e393;}export const sqlStatus={'service':a205_0x35064e(0x186),'command':'status','description':'Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','risk':a205_0x35064e(0x198),'flags':[{'name':a205_0x35064e(0x180),'type':a205_0x35064e(0x19e),'description':a205_0x35064e(0x18f)}],async 'execute'(_0x189c34){const _0x27266b=a205_0x35064e,_0x4283e0=loadSqlProjectConfig(_0x189c34[_0x27266b(0x188)]),_0x29d140=await readSqlLockFile(_0x4283e0[_0x27266b(0x181)]),{appLock:_0x18cb1f}=ensureSqlLockScope(_0x29d140??createEmptySqlLock(),_0x4283e0[_0x27266b(0x188)],_0x4283e0[_0x27266b(0x19b)],'status'),_0x5516b5=await scanLocalSqlQueries(_0x4283e0),_0x179182=[],_0x55bdc4=[],_0x586e4e=[],_0x323a76=[],_0x305e3e=new Set(_0x5516b5[_0x27266b(0x197)](_0x1fd48e=>_0x1fd48e[_0x27266b(0x182)]));for(const _0x43f54b of _0x5516b5){const _0x172011=await computeSqlFileHash(_0x43f54b[_0x27266b(0x195)]),_0x131c03=_0x18cb1f[_0x27266b(0x1a0)][_0x43f54b[_0x27266b(0x182)]],_0x4fe937=!!_0x131c03&&_0x131c03['path']!==_0x43f54b[_0x27266b(0x19a)],_0x5ac6a8=!!_0x131c03&&!!_0x43f54b['sqlName']&&_0x131c03['sqlName']!==_0x43f54b[_0x27266b(0x1a1)];if(!_0x131c03)_0x179182['push'](_0x43f54b['lockKey']);else _0x131c03[_0x27266b(0x18c)]!==_0x172011||_0x4fe937||_0x5ac6a8?_0x55bdc4[_0x27266b(0x18d)](_0x43f54b[_0x27266b(0x182)]):_0x586e4e[_0x27266b(0x18d)](_0x43f54b['lockKey']);}for(const _0x4b58d8 of Object[_0x27266b(0x189)](_0x18cb1f[_0x27266b(0x1a0)])){!_0x305e3e['has'](_0x4b58d8)&&_0x323a76['push'](_0x4b58d8);}const _0x417793=[];if(_0x189c34[_0x27266b(0x19f)](_0x27266b(0x180))){const _0x221c03=await fetchAllSqlCodes(_0x189c34['appCode']);for(const _0x488e2b of _0x221c03){!_0x305e3e[_0x27266b(0x196)](_0x488e2b)&&!_0x18cb1f[_0x27266b(0x1a0)][_0x488e2b]&&_0x417793['push'](_0x488e2b);}}const _0x3f0354=_0x179182[_0x27266b(0x17f)]===0x0&&_0x55bdc4[_0x27266b(0x17f)]===0x0&&_0x323a76[_0x27266b(0x17f)]===0x0&&_0x417793[_0x27266b(0x17f)]===0x0;return{'ok':!![],'data':{'added':_0x179182,'modified':_0x55bdc4,'missing':_0x323a76,'unchanged':_0x586e4e,'remoteOnly':_0x417793},'message':_0x3f0354?_0x27266b(0x193):_0x179182[_0x27266b(0x17f)]+_0x27266b(0x19c)+_0x55bdc4['length']+_0x27266b(0x18b)+_0x323a76[_0x27266b(0x17f)]+_0x27266b(0x187)+_0x586e4e[_0x27266b(0x17f)]+_0x27266b(0x199)+(_0x417793[_0x27266b(0x17f)]>0x0?',\x20'+_0x417793[_0x27266b(0x17f)]+'\x20remote-only':'')};}};function a205_0x423e(){const _0x41858e=['13OsJIrf','487164JcqgTi','All\x20SQL\x20queries\x20are\x20in\x20sync.','25809yjLoCb','filePath','has','map','read','\x20unchanged','relativePath','sqlRoot','\x20added,\x20','4168wqfPTj','boolean','bool','sqls','sqlName','2412091hOvRfA','402117nnHPaB','70vBBKSO','3OOlwIg','length','remote','lockFilePath','lockKey','152qpNBUL','2033398awCZBI','186MDajOA','sql','\x20missing,\x20','appCode','keys','totalCount','\x20modified,\x20','hash','push','40tMMKzm','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','467829lqsdwA'];a205_0x423e=function(){return _0x41858e;};return a205_0x423e();}
@@ -1 +1 @@
1
- const a200_0x10564e=a200_0x4788;(function(_0x261f35,_0x23f7f1){const _0xa73d4d=a200_0x4788,_0x3d0d88=_0x261f35();while(!![]){try{const _0x2107ce=-parseInt(_0xa73d4d(0x10c))/0x1+-parseInt(_0xa73d4d(0x118))/0x2+parseInt(_0xa73d4d(0x130))/0x3*(-parseInt(_0xa73d4d(0x14b))/0x4)+-parseInt(_0xa73d4d(0x11e))/0x5*(parseInt(_0xa73d4d(0x131))/0x6)+-parseInt(_0xa73d4d(0x128))/0x7*(-parseInt(_0xa73d4d(0x13f))/0x8)+-parseInt(_0xa73d4d(0x10b))/0x9+-parseInt(_0xa73d4d(0x10d))/0xa*(-parseInt(_0xa73d4d(0x11f))/0xb);if(_0x2107ce===_0x23f7f1)break;else _0x3d0d88['push'](_0x3d0d88['shift']());}catch(_0x2063de){_0x3d0d88['push'](_0x3d0d88['shift']());}}}(a200_0x2d8d,0x95d4f));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';function a200_0x2d8d(){const _0x14abe5=['schemaWarnings','map','validation','Audit\x20top-level\x20JOIN\x20equality\x20predicates\x20against\x20dataset\x20index\x20metadata','1628pxrLUw','schemas','type','unshift','4866264WrEUmh','132465pACTAo','40FeoGpn','sqlType','get','joinAudit','read','columns','dataset','toLowerCase','split','\x22\x20not\x20found\x20or\x20not\x20accessible','pkField','201634AmShxC','index_columns','isArray','appCode','reason','cwd','10IjKIHo','6807691UkDXoG','filter','Provide\x20--file\x20or\x20--sql','isSelectOnly','trim','columnNames','str','validate','sql','7mQeAvw','indexName','check-indexes','flatMap','index_type','find','indexes','tableName','2742qQCSmR','3167316MeWQHN','schema:','string','size','length','flagMissing','push','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','index_name','fields','Dataset\x20\x22','from','file','message','2719480LFIJWk','dbtableConfig','parameters','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','Table\x20\x22','valid','bool','tables'];a200_0x2d8d=function(){return _0x14abe5;};return a200_0x2d8d();}function a200_0x4788(_0x4b5ab9,_0x1bed53){_0x4b5ab9=_0x4b5ab9-0x108;const _0x2d8d3a=a200_0x2d8d();let _0x47881d=_0x2d8d3a[_0x4b5ab9];return _0x47881d;}import{validateSql}from'../../core/sql-validator.js';import{auditSqlJoinIndexes}from'../../core/sql-index-auditor.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{assertDatasetIsDbTableBacked,filterDbTableBackedDatasets}from'../../commands/dataset/capability.js';export const sqlValidate={'service':'sql','command':a200_0x10564e(0x126),'description':a200_0x10564e(0x138),'risk':a200_0x10564e(0x111),'flags':[{'name':a200_0x10564e(0x13d),'type':a200_0x10564e(0x133),'description':a200_0x10564e(0x142)},{'name':a200_0x10564e(0x127),'type':a200_0x10564e(0x133),'description':'Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)'},{'name':'schemas','type':a200_0x10564e(0x133),'description':'Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against'},{'name':a200_0x10564e(0x12a),'type':'boolean','description':a200_0x10564e(0x14a)}],async 'execute'(_0x5233b1){const _0xbb602c=a200_0x10564e,_0x3ef74a=_0x5233b1['str'](_0xbb602c(0x13d)),_0x3234e6=_0x5233b1[_0xbb602c(0x125)](_0xbb602c(0x127)),_0x211830=_0x5233b1['str'](_0xbb602c(0x108)),_0x495bd5=_0x5233b1[_0xbb602c(0x145)](_0xbb602c(0x12a));if(!_0x3ef74a&&!_0x3234e6)throw CliErrors[_0xbb602c(0x136)](_0xbb602c(0x13d),_0xbb602c(0x121));if(_0x495bd5&&!_0x211830)throw CliErrors[_0xbb602c(0x149)]('--check-indexes\x20requires\x20--schemas.');let _0x545a31;if(_0x3ef74a){const _0x1401ad=resolve(process[_0xbb602c(0x11d)](),_0x3ef74a);if(!existsSync(_0x1401ad))throw CliErrors[_0xbb602c(0x149)]('File\x20not\x20found:\x20'+_0x1401ad);_0x545a31=readFileSync(_0x1401ad,'utf-8');}else _0x545a31=_0x3234e6;const _0x5cf05c=validateSql(_0x545a31),_0x146b71={'valid':_0x5cf05c['valid'],'sqlType':_0x5cf05c['sqlType']['type'],'isSelectOnly':_0x5cf05c[_0xbb602c(0x10e)][_0xbb602c(0x122)],'isDangerous':_0x5cf05c[_0xbb602c(0x10e)]['isDangerous'],'tables':_0x5cf05c['tables'],'parameters':_0x5cf05c[_0xbb602c(0x141)],'message':_0x5cf05c['message']};_0x5cf05c[_0xbb602c(0x10e)][_0xbb602c(0x11c)]&&(_0x146b71[_0xbb602c(0x11c)]=_0x5cf05c['sqlType']['reason']);if(_0x211830&&_0x5cf05c['valid']){const _0x285c5f=_0x211830['split'](',')[_0xbb602c(0x148)](_0x16280d=>_0x16280d[_0xbb602c(0x123)]())['filter'](Boolean),_0x456876=[],_0x4d0580=[],_0x4cd3d9=filterDbTableBackedDatasets(await listDatasets(_0x5233b1[_0xbb602c(0x11b)])),_0x1b4194=new Map(_0x4cd3d9[_0xbb602c(0x148)](_0x123780=>[_0x123780[_0xbb602c(0x140)]?.[_0xbb602c(0x12f)]?.[_0xbb602c(0x114)](),_0x123780]));for(const _0x6fab4e of _0x5cf05c[_0xbb602c(0x146)]){const _0x1404f8=_0x1b4194[_0xbb602c(0x10f)](_0x6fab4e['toLowerCase']());!_0x1404f8&&_0x456876[_0xbb602c(0x137)](_0xbb602c(0x143)+_0x6fab4e+'\x22\x20not\x20found\x20in\x20any\x20dataset');}for(const _0x542199 of _0x285c5f){let _0x581a68;try{_0x581a68=await getDatasetDetail(_0x542199);}catch{_0x456876[_0xbb602c(0x137)](_0xbb602c(0x13b)+_0x542199+_0xbb602c(0x116));continue;}assertDatasetIsDbTableBacked(_0x581a68,'SQL\x20schema\x20validation');const _0x58479c=Array[_0xbb602c(0x11a)](_0x581a68[_0xbb602c(0x13a)])?_0x581a68[_0xbb602c(0x13a)]:[],_0x328b01=new Set(_0x58479c[_0xbb602c(0x148)](_0x1736b2=>_0x1736b2['name']?.[_0xbb602c(0x114)]())),_0x255e42=_0x581a68[_0xbb602c(0x140)]?.[_0xbb602c(0x12f)]||_0x581a68[_0xbb602c(0x12f)]||_0x542199;_0x146b71[_0xbb602c(0x132)+_0x255e42]={'code':_0x542199,'tableName':_0x255e42,'fieldCount':_0x328b01[_0xbb602c(0x134)],'fields':Array[_0xbb602c(0x13c)](_0x328b01)};if(_0x495bd5){const _0x23d5a0=normalizeDatasetIndexes(_0x581a68);_0x4d0580['push']({'tableName':_0x255e42,..._0x23d5a0});}}_0x456876[_0xbb602c(0x135)]>0x0&&(_0x146b71[_0xbb602c(0x147)]=_0x456876),_0x495bd5&&(_0x146b71[_0xbb602c(0x110)]=auditSqlJoinIndexes(_0x545a31,_0x4d0580));}return{'ok':_0x5cf05c[_0xbb602c(0x144)],'data':_0x146b71,'message':_0x5cf05c[_0xbb602c(0x13e)]};}};function normalizeDatasetIndexes(_0x2bf005){const _0x1ac5b7=a200_0x10564e,_0x4fece4=Array['isArray'](_0x2bf005?.['dataset']?.[_0x1ac5b7(0x12e)])?_0x2bf005[_0x1ac5b7(0x113)][_0x1ac5b7(0x12e)]:Array[_0x1ac5b7(0x11a)](_0x2bf005?.[_0x1ac5b7(0x12e)])?_0x2bf005[_0x1ac5b7(0x12e)]:[],_0x4a10ee=_0x4fece4[_0x1ac5b7(0x12b)](_0x37790d=>{const _0x5089ec=_0x1ac5b7,_0x2d4bef=Array[_0x5089ec(0x11a)](_0x37790d?.[_0x5089ec(0x119)])?_0x37790d[_0x5089ec(0x119)]:Array['isArray'](_0x37790d?.['columnNames'])?_0x37790d[_0x5089ec(0x124)]:Array[_0x5089ec(0x11a)](_0x37790d?.['columns'])?_0x37790d[_0x5089ec(0x112)]:[],_0x11910a=_0x2d4bef[_0x5089ec(0x120)](_0x106ff=>typeof _0x106ff===_0x5089ec(0x133))['map'](_0xbf1ae=>_0xbf1ae[_0x5089ec(0x123)]())[_0x5089ec(0x120)](Boolean);if(_0x11910a[_0x5089ec(0x135)]===0x0)return[];const _0x1d999c=[_0x37790d?.[_0x5089ec(0x129)],_0x37790d?.[_0x5089ec(0x139)],_0x37790d?.['name']]['find'](_0x3dc47a=>typeof _0x3dc47a===_0x5089ec(0x133)&&_0x3dc47a[_0x5089ec(0x123)]()),_0x327ef2=[_0x37790d?.[_0x5089ec(0x12c)],_0x37790d?.[_0x5089ec(0x109)]][_0x5089ec(0x12d)](_0x23804e=>typeof _0x23804e==='string'&&_0x23804e[_0x5089ec(0x123)]());return[{..._0x1d999c?{'name':_0x1d999c['trim']()}:{},..._0x327ef2?{'type':_0x327ef2[_0x5089ec(0x123)]()}:{},'columns':_0x11910a}];}),_0x99eb4c=[..._0x4a10ee],_0x44e1ab=typeof _0x2bf005?.[_0x1ac5b7(0x140)]?.[_0x1ac5b7(0x117)]===_0x1ac5b7(0x133)?_0x2bf005[_0x1ac5b7(0x140)][_0x1ac5b7(0x117)][_0x1ac5b7(0x115)](',')['map'](_0x445c20=>_0x445c20[_0x1ac5b7(0x123)]())[_0x1ac5b7(0x120)](Boolean):[];return _0x44e1ab['length']>0x0&&_0x99eb4c[_0x1ac5b7(0x10a)]({'type':'primary','columns':_0x44e1ab}),{'indexes':_0x99eb4c,'metadataAvailable':_0x4a10ee['length']>0x0};}
1
+ function a206_0x1e95(){const _0x21267e=['flagMissing','Dataset\x20\x22','\x22\x20not\x20found\x20or\x20not\x20accessible','index_type','588087qewYPY','10bYrXnB','528610zccPTa','bool','valid','map','name','index_name','message','trim','820308Bvstbu','isSelectOnly','192782UDmTBX','columnNames','schemas','12RyYFMt','fields','51732Bltycc','sqlType','Audit\x20top-level\x20JOIN\x20equality\x20predicates\x20against\x20dataset\x20index\x20metadata','SQL\x20schema\x20validation','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','dbtableConfig','1239892XKaCWJ','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','type','parameters','split','isDangerous','filter','size','unshift','File\x20not\x20found:\x20','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','validation','66nbfRAM','schema:','526112AakifH','columns','tables','utf-8','toLowerCase','Table\x20\x22','pkField','primary','14dKbjgR','isArray','push','\x22\x20not\x20found\x20in\x20any\x20dataset','string','find','dataset','tableName','Provide\x20--file\x20or\x20--sql','index_columns','file','flatMap','indexes','str','indexName','sql','cwd','length','reason','schemaWarnings','--check-indexes\x20requires\x20--schemas.','117IhJVvQ','read'];a206_0x1e95=function(){return _0x21267e;};return a206_0x1e95();}const a206_0x5e6cdc=a206_0x2f49;(function(_0x579e7b,_0x1e3e16){const _0x3ac189=a206_0x2f49,_0x554965=_0x579e7b();while(!![]){try{const _0xa976c9=parseInt(_0x3ac189(0xd8))/0x1+parseInt(_0x3ac189(0xe4))/0x2*(parseInt(_0x3ac189(0xe7))/0x3)+-parseInt(_0x3ac189(0xef))/0x4+parseInt(_0x3ac189(0xd9))/0x5*(parseInt(_0x3ac189(0xe9))/0x6)+parseInt(_0x3ac189(0xbd))/0x7*(parseInt(_0x3ac189(0xb5))/0x8)+-parseInt(_0x3ac189(0xd2))/0x9*(parseInt(_0x3ac189(0xda))/0xa)+-parseInt(_0x3ac189(0xb3))/0xb*(-parseInt(_0x3ac189(0xe2))/0xc);if(_0xa976c9===_0x1e3e16)break;else _0x554965['push'](_0x554965['shift']());}catch(_0xc5c79e){_0x554965['push'](_0x554965['shift']());}}}(a206_0x1e95,0x82b73));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';import{auditSqlJoinIndexes}from'../../core/sql-index-auditor.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';function a206_0x2f49(_0x10db58,_0x5a3ef5){_0x10db58=_0x10db58-0xb2;const _0x1e95a9=a206_0x1e95();let _0x2f49ab=_0x1e95a9[_0x10db58];return _0x2f49ab;}import{CliErrors}from'../../errors.js';import{assertDatasetIsDbTableBacked,filterDbTableBackedDatasets}from'../../commands/dataset/capability.js';export const sqlValidate={'service':'sql','command':'validate','description':a206_0x5e6cdc(0xed),'risk':a206_0x5e6cdc(0xd3),'flags':[{'name':a206_0x5e6cdc(0xc7),'type':a206_0x5e6cdc(0xc1),'description':a206_0x5e6cdc(0xf0)},{'name':a206_0x5e6cdc(0xcc),'type':a206_0x5e6cdc(0xc1),'description':a206_0x5e6cdc(0xf9)},{'name':'schemas','type':a206_0x5e6cdc(0xc1),'description':'Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against'},{'name':'check-indexes','type':'boolean','description':a206_0x5e6cdc(0xeb)}],async 'execute'(_0x24c65f){const _0x4e808c=a206_0x5e6cdc,_0x1d209d=_0x24c65f[_0x4e808c(0xca)]('file'),_0x38fdee=_0x24c65f[_0x4e808c(0xca)]('sql'),_0x5e8fa5=_0x24c65f[_0x4e808c(0xca)](_0x4e808c(0xe6)),_0x246cab=_0x24c65f[_0x4e808c(0xdb)]('check-indexes');if(!_0x1d209d&&!_0x38fdee)throw CliErrors[_0x4e808c(0xd4)](_0x4e808c(0xc7),_0x4e808c(0xc5));if(_0x246cab&&!_0x5e8fa5)throw CliErrors[_0x4e808c(0xb2)](_0x4e808c(0xd1));let _0x4e9897;if(_0x1d209d){const _0x2daa47=resolve(process[_0x4e808c(0xcd)](),_0x1d209d);if(!existsSync(_0x2daa47))throw CliErrors[_0x4e808c(0xb2)](_0x4e808c(0xf8)+_0x2daa47);_0x4e9897=readFileSync(_0x2daa47,_0x4e808c(0xb8));}else _0x4e9897=_0x38fdee;const _0x2733b4=validateSql(_0x4e9897),_0x26671d={'valid':_0x2733b4['valid'],'sqlType':_0x2733b4[_0x4e808c(0xea)][_0x4e808c(0xf1)],'isSelectOnly':_0x2733b4['sqlType'][_0x4e808c(0xe3)],'isDangerous':_0x2733b4[_0x4e808c(0xea)][_0x4e808c(0xf4)],'tables':_0x2733b4[_0x4e808c(0xb7)],'parameters':_0x2733b4[_0x4e808c(0xf2)],'message':_0x2733b4[_0x4e808c(0xe0)]};_0x2733b4[_0x4e808c(0xea)][_0x4e808c(0xcf)]&&(_0x26671d[_0x4e808c(0xcf)]=_0x2733b4[_0x4e808c(0xea)][_0x4e808c(0xcf)]);if(_0x5e8fa5&&_0x2733b4[_0x4e808c(0xdc)]){const _0x557a64=_0x5e8fa5['split'](',')[_0x4e808c(0xdd)](_0x44ed5e=>_0x44ed5e['trim']())[_0x4e808c(0xf5)](Boolean),_0x18d5ed=[],_0x2867ba=[],_0x3fb6df=filterDbTableBackedDatasets(await listDatasets(_0x24c65f['appCode'])),_0x1f2fa2=new Map(_0x3fb6df['map'](_0x1d1eb6=>[_0x1d1eb6[_0x4e808c(0xee)]?.[_0x4e808c(0xc4)]?.[_0x4e808c(0xb9)](),_0x1d1eb6]));for(const _0x54faab of _0x2733b4['tables']){const _0x5e8cf1=_0x1f2fa2['get'](_0x54faab[_0x4e808c(0xb9)]());!_0x5e8cf1&&_0x18d5ed['push'](_0x4e808c(0xba)+_0x54faab+_0x4e808c(0xc0));}for(const _0xa27d19 of _0x557a64){let _0x310c0c;try{_0x310c0c=await getDatasetDetail(_0xa27d19);}catch{_0x18d5ed[_0x4e808c(0xbf)](_0x4e808c(0xd5)+_0xa27d19+_0x4e808c(0xd6));continue;}assertDatasetIsDbTableBacked(_0x310c0c,_0x4e808c(0xec));const _0x171439=Array[_0x4e808c(0xbe)](_0x310c0c[_0x4e808c(0xe8)])?_0x310c0c[_0x4e808c(0xe8)]:[],_0x550f78=new Set(_0x171439[_0x4e808c(0xdd)](_0x1f3da1=>_0x1f3da1[_0x4e808c(0xde)]?.['toLowerCase']())),_0x48618e=_0x310c0c[_0x4e808c(0xee)]?.[_0x4e808c(0xc4)]||_0x310c0c[_0x4e808c(0xc4)]||_0xa27d19;_0x26671d[_0x4e808c(0xb4)+_0x48618e]={'code':_0xa27d19,'tableName':_0x48618e,'fieldCount':_0x550f78[_0x4e808c(0xf6)],'fields':Array['from'](_0x550f78)};if(_0x246cab){const _0x34ab1c=normalizeDatasetIndexes(_0x310c0c);_0x2867ba['push']({'tableName':_0x48618e,..._0x34ab1c});}}_0x18d5ed['length']>0x0&&(_0x26671d[_0x4e808c(0xd0)]=_0x18d5ed),_0x246cab&&(_0x26671d['joinAudit']=auditSqlJoinIndexes(_0x4e9897,_0x2867ba));}return{'ok':_0x2733b4[_0x4e808c(0xdc)],'data':_0x26671d,'message':_0x2733b4[_0x4e808c(0xe0)]};}};function normalizeDatasetIndexes(_0x37d6c5){const _0x8f71c7=a206_0x5e6cdc,_0x1f655c=Array[_0x8f71c7(0xbe)](_0x37d6c5?.[_0x8f71c7(0xc3)]?.[_0x8f71c7(0xc9)])?_0x37d6c5[_0x8f71c7(0xc3)][_0x8f71c7(0xc9)]:Array[_0x8f71c7(0xbe)](_0x37d6c5?.[_0x8f71c7(0xc9)])?_0x37d6c5[_0x8f71c7(0xc9)]:[],_0x3a8a4f=_0x1f655c[_0x8f71c7(0xc8)](_0x5f48a2=>{const _0x30f5e0=_0x8f71c7,_0x2f913a=Array['isArray'](_0x5f48a2?.[_0x30f5e0(0xc6)])?_0x5f48a2[_0x30f5e0(0xc6)]:Array[_0x30f5e0(0xbe)](_0x5f48a2?.[_0x30f5e0(0xe5)])?_0x5f48a2[_0x30f5e0(0xe5)]:Array[_0x30f5e0(0xbe)](_0x5f48a2?.['columns'])?_0x5f48a2[_0x30f5e0(0xb6)]:[],_0x271225=_0x2f913a['filter'](_0x218400=>typeof _0x218400===_0x30f5e0(0xc1))[_0x30f5e0(0xdd)](_0x121aa3=>_0x121aa3[_0x30f5e0(0xe1)]())[_0x30f5e0(0xf5)](Boolean);if(_0x271225[_0x30f5e0(0xce)]===0x0)return[];const _0x1b7808=[_0x5f48a2?.[_0x30f5e0(0xcb)],_0x5f48a2?.[_0x30f5e0(0xdf)],_0x5f48a2?.[_0x30f5e0(0xde)]][_0x30f5e0(0xc2)](_0x4d8d6d=>typeof _0x4d8d6d===_0x30f5e0(0xc1)&&_0x4d8d6d[_0x30f5e0(0xe1)]()),_0x31e09b=[_0x5f48a2?.[_0x30f5e0(0xd7)],_0x5f48a2?.[_0x30f5e0(0xf1)]][_0x30f5e0(0xc2)](_0x2f0e13=>typeof _0x2f0e13===_0x30f5e0(0xc1)&&_0x2f0e13[_0x30f5e0(0xe1)]());return[{..._0x1b7808?{'name':_0x1b7808[_0x30f5e0(0xe1)]()}:{},..._0x31e09b?{'type':_0x31e09b[_0x30f5e0(0xe1)]()}:{},'columns':_0x271225}];}),_0x18b56c=[..._0x3a8a4f],_0x571867=typeof _0x37d6c5?.['dbtableConfig']?.['pkField']===_0x8f71c7(0xc1)?_0x37d6c5[_0x8f71c7(0xee)][_0x8f71c7(0xbb)][_0x8f71c7(0xf3)](',')[_0x8f71c7(0xdd)](_0x325003=>_0x325003[_0x8f71c7(0xe1)]())['filter'](Boolean):[];return _0x571867[_0x8f71c7(0xce)]>0x0&&_0x18b56c[_0x8f71c7(0xf7)]({'type':_0x8f71c7(0xbc),'columns':_0x571867}),{'indexes':_0x18b56c,'metadataAvailable':_0x3a8a4f[_0x8f71c7(0xce)]>0x0};}
@@ -1 +1 @@
1
- (function(_0x105f5f,_0x3010c3){const _0x167e8d=a201_0x40f2,_0x449b9b=_0x105f5f();while(!![]){try{const _0x12b94b=parseInt(_0x167e8d(0x18f))/0x1*(-parseInt(_0x167e8d(0x188))/0x2)+parseInt(_0x167e8d(0x18c))/0x3*(parseInt(_0x167e8d(0x18b))/0x4)+parseInt(_0x167e8d(0x18a))/0x5+parseInt(_0x167e8d(0x191))/0x6+-parseInt(_0x167e8d(0x192))/0x7*(parseInt(_0x167e8d(0x190))/0x8)+parseInt(_0x167e8d(0x18e))/0x9+parseInt(_0x167e8d(0x189))/0xa*(-parseInt(_0x167e8d(0x18d))/0xb);if(_0x12b94b===_0x3010c3)break;else _0x449b9b['push'](_0x449b9b['shift']());}catch(_0x1723c3){_0x449b9b['push'](_0x449b9b['shift']());}}}(a201_0x1279,0xaa2f2));function a201_0x40f2(_0x799262,_0x5250c6){_0x799262=_0x799262-0x188;const _0x127930=a201_0x1279();let _0x40f2b1=_0x127930[_0x799262];return _0x40f2b1;}import{taskStatus}from'../../commands/task/status.js';export const taskDefinitions=[taskStatus];function a201_0x1279(){const _0x2e7994=['1072SboUqV','45090YPQfKN','4857295dppjOt','4118388sMfwJf','3PgNyWN','3982rQBKyT','7506522NvKkDI','1757tTdUgL','40zKJYGD','7313610BGTvPs','1096151NbLhmV'];a201_0x1279=function(){return _0x2e7994;};return a201_0x1279();}
1
+ (function(_0x25fb9e,_0x1a7bac){const _0x18aedf=a207_0x14f5,_0x25b798=_0x25fb9e();while(!![]){try{const _0x48e4c7=parseInt(_0x18aedf(0x1cf))/0x1*(-parseInt(_0x18aedf(0x1d0))/0x2)+parseInt(_0x18aedf(0x1d7))/0x3*(parseInt(_0x18aedf(0x1da))/0x4)+parseInt(_0x18aedf(0x1d2))/0x5*(-parseInt(_0x18aedf(0x1d4))/0x6)+-parseInt(_0x18aedf(0x1d1))/0x7*(-parseInt(_0x18aedf(0x1d5))/0x8)+parseInt(_0x18aedf(0x1d3))/0x9*(-parseInt(_0x18aedf(0x1d9))/0xa)+parseInt(_0x18aedf(0x1d6))/0xb+parseInt(_0x18aedf(0x1ce))/0xc*(parseInt(_0x18aedf(0x1d8))/0xd);if(_0x48e4c7===_0x1a7bac)break;else _0x25b798['push'](_0x25b798['shift']());}catch(_0x30f856){_0x25b798['push'](_0x25b798['shift']());}}}(a207_0x2411,0xc28d7));import{taskStatus}from'../../commands/task/status.js';function a207_0x2411(){const _0x5a09a0=['3qUNmLT','2109991KGxYeH','170WijlcY','2552848Vckiuo','96kIapCt','1491715wdMSZi','2yqsHzp','7117733ziYuLl','5cfawxP','682551eXTYVm','2615622ilrtvE','8EogSFJ','11663465VWcMir'];a207_0x2411=function(){return _0x5a09a0;};return a207_0x2411();}function a207_0x14f5(_0x48024c,_0x2c39e0){_0x48024c=_0x48024c-0x1ce;const _0x2411a3=a207_0x2411();let _0x14f5a9=_0x2411a3[_0x48024c];return _0x14f5a9;}export const taskDefinitions=[taskStatus];
@@ -1 +1 @@
1
- function a202_0x9668(_0xc4588,_0x41475b){_0xc4588=_0xc4588-0x108;const _0x41e42a=a202_0x41e4();let _0x96682f=_0x41e42a[_0xc4588];return _0x96682f;}const a202_0x8cef89=a202_0x9668;(function(_0x516b8e,_0x34db07){const _0x17b7be=a202_0x9668,_0x3bcf3e=_0x516b8e();while(!![]){try{const _0xfb515d=parseInt(_0x17b7be(0x10e))/0x1+parseInt(_0x17b7be(0x111))/0x2+parseInt(_0x17b7be(0x10c))/0x3+-parseInt(_0x17b7be(0x118))/0x4+-parseInt(_0x17b7be(0x112))/0x5+-parseInt(_0x17b7be(0x110))/0x6+parseInt(_0x17b7be(0x115))/0x7;if(_0xfb515d===_0x34db07)break;else _0x3bcf3e['push'](_0x3bcf3e['shift']());}catch(_0x47ef2b){_0x3bcf3e['push'](_0x3bcf3e['shift']());}}}(a202_0x41e4,0x6c4e5));function a202_0x41e4(){const _0x4e5010=['1496016IFDkcc','1672740frrBPd','appCode','status','2845892cLdUzH','trim','isTerminal','2512672rLKMKe','Task\x20id\x20returned\x20by\x20an\x20asynchronous\x20platform\x20command','string','Task\x20status\x20response\x20id\x20mismatch:\x20requested\x20','task-id','cookie','Query\x20an\x20asynchronous\x20task;\x20repeat\x20for\x20PENDING\x20or\x20PROCESSING\x20until\x20SUCCESS\x20or\x20FAILED','2265990XgAElU','str','49906BwbBvR','taskId','3320778ilCQkx'];a202_0x41e4=function(){return _0x4e5010;};return a202_0x41e4();}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';export const taskStatus={'service':'task','command':a202_0x8cef89(0x114),'description':a202_0x8cef89(0x10b),'risk':'read','defaultOutputFormat':'compress','structuredErrors':!![],'flags':[{'name':a202_0x8cef89(0x109),'type':a202_0x8cef89(0x11a),'required':!![],'description':a202_0x8cef89(0x119)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x31ba14){const _0x47070d=a202_0x8cef89;if(!_0x31ba14['str'](_0x47070d(0x109))[_0x47070d(0x116)]())throw CliErrors['flagMissing'](_0x47070d(0x109));},async 'execute'(_0x1d7321){const _0x1881ed=a202_0x8cef89,_0x1b0d83=_0x1d7321[_0x1881ed(0x10d)](_0x1881ed(0x109))[_0x1881ed(0x116)](),_0x3242d5=normalizeAsyncTask(await getAsyncTaskStatus(_0x1b0d83,_0x1d7321['appCode'],_0x1d7321[_0x1881ed(0x10a)]));if(_0x3242d5[_0x1881ed(0x10f)]!==_0x1b0d83)throw CliErrors['apiError'](_0x1881ed(0x108)+_0x1b0d83+',\x20received\x20'+_0x3242d5[_0x1881ed(0x10f)]+'.');const _0x3979b2=buildAsyncTaskStatusCommand(_0x3242d5[_0x1881ed(0x10f)],_0x1d7321[_0x1881ed(0x113)]);return{'ok':!![],'message':asyncTaskMessage(_0x3242d5),'data':{'appCode':_0x1d7321[_0x1881ed(0x113)],..._0x3242d5,'query':_0x3242d5[_0x1881ed(0x117)]?null:{'command':_0x3979b2}}};}};
1
+ function a208_0x2641(_0x53f808,_0x4e9599){_0x53f808=_0x53f808-0x15e;const _0x39770d=a208_0x3977();let _0x2641a0=_0x39770d[_0x53f808];return _0x2641a0;}const a208_0x1426f7=a208_0x2641;(function(_0x423d54,_0x2dd04d){const _0xba3bdc=a208_0x2641,_0x166a53=_0x423d54();while(!![]){try{const _0x34cde2=parseInt(_0xba3bdc(0x174))/0x1+parseInt(_0xba3bdc(0x16b))/0x2*(parseInt(_0xba3bdc(0x172))/0x3)+-parseInt(_0xba3bdc(0x168))/0x4*(-parseInt(_0xba3bdc(0x16c))/0x5)+-parseInt(_0xba3bdc(0x170))/0x6*(parseInt(_0xba3bdc(0x176))/0x7)+-parseInt(_0xba3bdc(0x15e))/0x8+parseInt(_0xba3bdc(0x167))/0x9*(parseInt(_0xba3bdc(0x16d))/0xa)+parseInt(_0xba3bdc(0x173))/0xb*(-parseInt(_0xba3bdc(0x171))/0xc);if(_0x34cde2===_0x2dd04d)break;else _0x166a53['push'](_0x166a53['shift']());}catch(_0x3a3ce2){_0x166a53['push'](_0x166a53['shift']());}}}(a208_0x3977,0x76179));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asyncTaskMessage,buildAsyncTaskStatusCommand,normalizeAsyncTask}from'../../commands/common/async-task.js';function a208_0x3977(){const _0x5e2b09=['taskId','trim','1999410QSiXar','1008bAwYjz','3ipCmvG','128546aCPXFd','514102jOKtQZ','task','7mcArSY','1034504jdNCpW','appCode','read','Query\x20an\x20asynchronous\x20task;\x20repeat\x20for\x20PENDING\x20or\x20PROCESSING\x20until\x20SUCCESS\x20or\x20FAILED','flagMissing','isTerminal','Task\x20status\x20response\x20id\x20mismatch:\x20requested\x20','apiError','task-id','558zqZwbX','4dfewFE','status','str','717638tZqnaH','3432140nPpMwt','59440BkENuy'];a208_0x3977=function(){return _0x5e2b09;};return a208_0x3977();}import{getAsyncTaskStatus}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const taskStatus={'service':a208_0x1426f7(0x175),'command':a208_0x1426f7(0x169),'description':a208_0x1426f7(0x161),'risk':a208_0x1426f7(0x160),'defaultOutputFormat':'compress','structuredErrors':!![],'flags':[{'name':a208_0x1426f7(0x166),'type':'string','required':!![],'description':'Task\x20id\x20returned\x20by\x20an\x20asynchronous\x20platform\x20command'},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x45d950){const _0x1919f8=a208_0x1426f7;if(!_0x45d950[_0x1919f8(0x16a)](_0x1919f8(0x166))['trim']())throw CliErrors[_0x1919f8(0x162)](_0x1919f8(0x166));},async 'execute'(_0x27371c){const _0x37196b=a208_0x1426f7,_0x180d9e=_0x27371c['str'](_0x37196b(0x166))[_0x37196b(0x16f)](),_0x466182=normalizeAsyncTask(await getAsyncTaskStatus(_0x180d9e,_0x27371c[_0x37196b(0x15f)],_0x27371c['cookie']));if(_0x466182[_0x37196b(0x16e)]!==_0x180d9e)throw CliErrors[_0x37196b(0x165)](_0x37196b(0x164)+_0x180d9e+',\x20received\x20'+_0x466182[_0x37196b(0x16e)]+'.');const _0x21ceb6=buildAsyncTaskStatusCommand(_0x466182[_0x37196b(0x16e)],_0x27371c['appCode']);return{'ok':!![],'message':asyncTaskMessage(_0x466182),'data':{'appCode':_0x27371c['appCode'],..._0x466182,'query':_0x466182[_0x37196b(0x163)]?null:{'command':_0x21ceb6}}};}};
@@ -1 +1 @@
1
- function a203_0x70fb(){const _0x5ec1f7=['8266cbexdk','16RGhQTW','6276rSmdqr','413136FodHPU','12FKrOio','20HHdNoV','955LHseGN','100541scgFVD','1389553LhOujq','164070xWVPAf','10MfvwnR','118869RrvmiQ'];a203_0x70fb=function(){return _0x5ec1f7;};return a203_0x70fb();}(function(_0x1d9293,_0x10b20a){const _0x3414a5=a203_0x46c9,_0x55ae8d=_0x1d9293();while(!![]){try{const _0x4a3067=parseInt(_0x3414a5(0x104))/0x1*(-parseInt(_0x3414a5(0x108))/0x2)+-parseInt(_0x3414a5(0x103))/0x3*(parseInt(_0x3414a5(0xfd))/0x4)+-parseInt(_0x3414a5(0xfe))/0x5*(-parseInt(_0x3414a5(0x106))/0x6)+-parseInt(_0x3414a5(0xff))/0x7*(-parseInt(_0x3414a5(0x105))/0x8)+-parseInt(_0x3414a5(0x101))/0x9*(parseInt(_0x3414a5(0x102))/0xa)+parseInt(_0x3414a5(0x100))/0xb+parseInt(_0x3414a5(0x107))/0xc;if(_0x4a3067===_0x10b20a)break;else _0x55ae8d['push'](_0x55ae8d['shift']());}catch(_0x256d7f){_0x55ae8d['push'](_0x55ae8d['shift']());}}}(a203_0x70fb,0x1e1ba));import{tenantMembersListDefinition}from'../../commands/tenant/members-list.js';function a203_0x46c9(_0x2ac70f,_0x5bc2ad){_0x2ac70f=_0x2ac70f-0xfd;const _0x70fba7=a203_0x70fb();let _0x46c9e4=_0x70fba7[_0x2ac70f];return _0x46c9e4;}export const tenantDefinitions=[tenantMembersListDefinition];
1
+ (function(_0x154e99,_0x5ef9d5){const _0x134c81=a209_0x3832,_0xb1debf=_0x154e99();while(!![]){try{const _0x135445=parseInt(_0x134c81(0x17a))/0x1*(parseInt(_0x134c81(0x17c))/0x2)+-parseInt(_0x134c81(0x180))/0x3+-parseInt(_0x134c81(0x17f))/0x4*(-parseInt(_0x134c81(0x17b))/0x5)+-parseInt(_0x134c81(0x17d))/0x6*(-parseInt(_0x134c81(0x181))/0x7)+-parseInt(_0x134c81(0x182))/0x8*(-parseInt(_0x134c81(0x179))/0x9)+parseInt(_0x134c81(0x17e))/0xa+-parseInt(_0x134c81(0x183))/0xb;if(_0x135445===_0x5ef9d5)break;else _0xb1debf['push'](_0xb1debf['shift']());}catch(_0xed91c6){_0xb1debf['push'](_0xb1debf['shift']());}}}(a209_0x19ec,0x6fd55));import{tenantMembersListDefinition}from'../../commands/tenant/members-list.js';function a209_0x3832(_0x931532,_0x414f80){_0x931532=_0x931532-0x179;const _0x19ecbd=a209_0x19ec();let _0x383291=_0x19ecbd[_0x931532];return _0x383291;}function a209_0x19ec(){const _0x1a14ef=['429669szBpSD','478817mKuRhf','13105PGwBbT','2MCfKEQ','6OcDOxh','4995010KRJyOg','80YLnknL','692364PPNYlE','340011sJGZKb','24IaeYPm','5870447RlJdtv'];a209_0x19ec=function(){return _0x1a14ef;};return a209_0x19ec();}export const tenantDefinitions=[tenantMembersListDefinition];
@@ -1 +1 @@
1
- const a204_0x13ace9=a204_0x2d36;(function(_0x4a1a72,_0x2085cb){const _0x5b0e38=a204_0x2d36,_0x1e4501=_0x4a1a72();while(!![]){try{const _0x520356=-parseInt(_0x5b0e38(0xe4))/0x1+-parseInt(_0x5b0e38(0xed))/0x2+parseInt(_0x5b0e38(0xf1))/0x3+parseInt(_0x5b0e38(0xe8))/0x4*(parseInt(_0x5b0e38(0xea))/0x5)+parseInt(_0x5b0e38(0xe2))/0x6*(parseInt(_0x5b0e38(0xf0))/0x7)+parseInt(_0x5b0e38(0xe3))/0x8+-parseInt(_0x5b0e38(0xe1))/0x9;if(_0x520356===_0x2085cb)break;else _0x1e4501['push'](_0x1e4501['shift']());}catch(_0x232eb2){_0x1e4501['push'](_0x1e4501['shift']());}}}(a204_0x49b5,0x5db46));function a204_0x49b5(){const _0x1cea51=['read','length','flagMissing','1916PrSXxM','\x20tenant\x20member(s)','2065AoSqGH','members-list','tenant-code','741388pCkVMQ','Pass\x20--tenant-code\x20<code>.','str','119ostfaj','1322037zFGuus','tenant','Exact\x20tenant\x20code','string','1087119nFwBQA','12846ciKgZt','5352104KSOmTJ','468617mLPcwH'];a204_0x49b5=function(){return _0x1cea51;};return a204_0x49b5();}import{listCurrentUserTenantMemberships,listTenantDirectoryMembers}from'../../core/api-client.js';function a204_0x2d36(_0x560af8,_0x235f0a){_0x560af8=_0x560af8-0xdf;const _0x49b51c=a204_0x49b5();let _0x2d3680=_0x49b51c[_0x560af8];return _0x2d3680;}import{CliErrors}from'../../errors.js';import{assertTenantAccessible,projectTenantMembers}from'../../commands/tenant/shared.js';export const tenantMembersListDefinition={'service':a204_0x13ace9(0xf2),'command':a204_0x13ace9(0xeb),'description':'List\x20members\x20of\x20a\x20tenant\x20available\x20to\x20the\x20current\x20account','risk':a204_0x13ace9(0xe5),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a204_0x13ace9(0xec),'type':a204_0x13ace9(0xe0),'required':!![],'description':a204_0x13ace9(0xdf)}],async 'validate'(_0x3934aa){const _0x380db5=a204_0x13ace9;if(!_0x3934aa[_0x380db5(0xef)](_0x380db5(0xec))['trim']())throw CliErrors[_0x380db5(0xe7)](_0x380db5(0xec),_0x380db5(0xee));},async 'execute'(_0x131538){const _0x53caad=a204_0x13ace9,_0x5c35f2=_0x131538['str']('tenant-code')['trim'](),_0x575f89=await listCurrentUserTenantMemberships();assertTenantAccessible(_0x5c35f2,_0x575f89);const _0x3abac3=projectTenantMembers(await listTenantDirectoryMembers(_0x5c35f2));return{'ok':!![],'data':{'tenantCode':_0x5c35f2,'items':_0x3abac3,'totalCount':_0x3abac3[_0x53caad(0xe6)]},'message':'Found\x20'+_0x3abac3[_0x53caad(0xe6)]+_0x53caad(0xe9)};}};
1
+ const a210_0x48396f=a210_0x3df2;(function(_0x381e0c,_0x3343e0){const _0x57582f=a210_0x3df2,_0x4caf79=_0x381e0c();while(!![]){try{const _0xac2baf=parseInt(_0x57582f(0x16e))/0x1*(-parseInt(_0x57582f(0x171))/0x2)+-parseInt(_0x57582f(0x163))/0x3*(-parseInt(_0x57582f(0x16f))/0x4)+-parseInt(_0x57582f(0x170))/0x5+-parseInt(_0x57582f(0x165))/0x6*(parseInt(_0x57582f(0x172))/0x7)+parseInt(_0x57582f(0x169))/0x8+-parseInt(_0x57582f(0x161))/0x9+parseInt(_0x57582f(0x16b))/0xa;if(_0xac2baf===_0x3343e0)break;else _0x4caf79['push'](_0x4caf79['shift']());}catch(_0x111c46){_0x4caf79['push'](_0x4caf79['shift']());}}}(a210_0x1168,0x514bb));function a210_0x3df2(_0x1d6ae1,_0x30e509){_0x1d6ae1=_0x1d6ae1-0x15d;const _0x1168f5=a210_0x1168();let _0x3df25e=_0x1168f5[_0x1d6ae1];return _0x3df25e;}import{listCurrentUserTenantMemberships,listTenantDirectoryMembers}from'../../core/api-client.js';function a210_0x1168(){const _0x5c95ba=['List\x20members\x20of\x20a\x20tenant\x20available\x20to\x20the\x20current\x20account','6eWbbsS','length','Exact\x20tenant\x20code','read','1477032qYxBfa','Pass\x20--tenant-code\x20<code>.','11736380qpEXun','tenant','trim','3JFTycQ','1294780dDFxRJ','2913300IifSkE','39588Jltuhu','4020331ytrqxn','members-list','flagMissing','tenant-code','\x20tenant\x20member(s)','string','str','4106655KEMqUU','Found\x20','6mGBSwV'];a210_0x1168=function(){return _0x5c95ba;};return a210_0x1168();}import{CliErrors}from'../../errors.js';import{assertTenantAccessible,projectTenantMembers}from'../../commands/tenant/shared.js';export const tenantMembersListDefinition={'service':a210_0x48396f(0x16c),'command':a210_0x48396f(0x173),'description':a210_0x48396f(0x164),'risk':a210_0x48396f(0x168),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a210_0x48396f(0x15d),'type':a210_0x48396f(0x15f),'required':!![],'description':a210_0x48396f(0x167)}],async 'validate'(_0x493247){const _0x2e3f0f=a210_0x48396f;if(!_0x493247[_0x2e3f0f(0x160)](_0x2e3f0f(0x15d))[_0x2e3f0f(0x16d)]())throw CliErrors[_0x2e3f0f(0x174)](_0x2e3f0f(0x15d),_0x2e3f0f(0x16a));},async 'execute'(_0x3403b0){const _0x32df77=a210_0x48396f,_0x675604=_0x3403b0[_0x32df77(0x160)](_0x32df77(0x15d))[_0x32df77(0x16d)](),_0x29a6c4=await listCurrentUserTenantMemberships();assertTenantAccessible(_0x675604,_0x29a6c4);const _0x41ad75=projectTenantMembers(await listTenantDirectoryMembers(_0x675604));return{'ok':!![],'data':{'tenantCode':_0x675604,'items':_0x41ad75,'totalCount':_0x41ad75[_0x32df77(0x166)]},'message':_0x32df77(0x162)+_0x41ad75['length']+_0x32df77(0x15e)};}};
@@ -1 +1 @@
1
- function a205_0x4b89(_0x393109,_0x4bf208){_0x393109=_0x393109-0x17d;const _0xb0db7a=a205_0xb0db();let _0x4b89a9=_0xb0db7a[_0x393109];return _0x4b89a9;}(function(_0x1ba793,_0x5672e5){const _0xaf1eb1=a205_0x4b89,_0x4e4044=_0x1ba793();while(!![]){try{const _0x12b134=parseInt(_0xaf1eb1(0x190))/0x1+parseInt(_0xaf1eb1(0x18c))/0x2+-parseInt(_0xaf1eb1(0x18d))/0x3+-parseInt(_0xaf1eb1(0x196))/0x4+-parseInt(_0xaf1eb1(0x180))/0x5*(-parseInt(_0xaf1eb1(0x186))/0x6)+parseInt(_0xaf1eb1(0x17d))/0x7+-parseInt(_0xaf1eb1(0x181))/0x8;if(_0x12b134===_0x5672e5)break;else _0x4e4044['push'](_0x4e4044['shift']());}catch(_0x3688c6){_0x4e4044['push'](_0x4e4044['shift']());}}}(a205_0xb0db,0xf1fb6));import{CliErrors}from'../../errors.js';function a205_0xb0db(){const _0x2fdbf6=['154506AMpWpl','sort','Tenant\x20\x22','ADMIN','values','MEMBER','2175106tDLpOE','3122679rVerUx','username','status','1027237AVDSZv','adminFlag','userId','some','validation','\x22\x20is\x20not\x20available\x20to\x20the\x20current\x20account.','7539664bbRSqD','7912387ZeoEyM','get','role','255FNZgOR','5131720lUWiJw','isFinite','set','displayName','tenantCode'];a205_0xb0db=function(){return _0x2fdbf6;};return a205_0xb0db();}function textOrNull(_0x52fa4f){const _0x408007=_0x52fa4f?.['trim']();return _0x408007?_0x408007:null;}export function projectTenantMembers(_0xd8f5f0){const _0x54d863=a205_0x4b89,_0x3e461c=new Map();for(const _0x3ffc80 of _0xd8f5f0){const _0x2a402d=Number(_0x3ffc80[_0x54d863(0x192)]);if(!Number[_0x54d863(0x182)](_0x2a402d)||_0x2a402d<=0x0)continue;const _0x2b2d70={'userId':_0x2a402d,'username':textOrNull(_0x3ffc80[_0x54d863(0x18e)]),'displayName':textOrNull(_0x3ffc80['nickname']),'role':_0x3ffc80[_0x54d863(0x191)]===!![]?_0x54d863(0x189):_0x54d863(0x18b),'status':textOrNull(_0x3ffc80[_0x54d863(0x18f)])},_0x21725d=_0x3e461c[_0x54d863(0x17e)](_0x2a402d);if(!_0x21725d){_0x3e461c[_0x54d863(0x183)](_0x2a402d,_0x2b2d70);continue;}_0x21725d['username']??=_0x2b2d70[_0x54d863(0x18e)],_0x21725d[_0x54d863(0x184)]??=_0x2b2d70[_0x54d863(0x184)],_0x21725d[_0x54d863(0x18f)]??=_0x2b2d70[_0x54d863(0x18f)];if(_0x2b2d70[_0x54d863(0x17f)]===_0x54d863(0x189))_0x21725d[_0x54d863(0x17f)]=_0x54d863(0x189);}return[..._0x3e461c[_0x54d863(0x18a)]()][_0x54d863(0x187)]((_0x30efe1,_0x3a8815)=>_0x30efe1[_0x54d863(0x192)]-_0x3a8815['userId']);}export function assertTenantAccessible(_0x4af66f,_0x286037){const _0x1687c6=a205_0x4b89;if(_0x286037[_0x1687c6(0x193)](_0x384f56=>_0x384f56[_0x1687c6(0x185)]===_0x4af66f))return;throw CliErrors[_0x1687c6(0x194)](_0x1687c6(0x188)+_0x4af66f+_0x1687c6(0x195),'Check\x20--tenant-code\x20or\x20login\x20with\x20an\x20account\x20that\x20belongs\x20to\x20this\x20tenant.');}
1
+ function a211_0x5cc9(_0xeb6b7f,_0x4ca448){_0xeb6b7f=_0xeb6b7f-0x7b;const _0x3b0354=a211_0x3b03();let _0x5cc9ae=_0x3b0354[_0xeb6b7f];return _0x5cc9ae;}function a211_0x3b03(){const _0x58e17c=['22vugBTM','sort','tenantCode','trim','username','validation','some','status','Tenant\x20\x22','578237eYOjpr','3FEfOVP','\x22\x20is\x20not\x20available\x20to\x20the\x20current\x20account.','Check\x20--tenant-code\x20or\x20login\x20with\x20an\x20account\x20that\x20belongs\x20to\x20this\x20tenant.','values','ADMIN','adminFlag','4585004OGxvuE','nickname','14973867eiHoFt','31932tnVPtO','set','displayName','9302175Xscuie','role','8cBupUH','2729126aCDljO','userId','2527VEmuvP','8963380mhUkdX'];a211_0x3b03=function(){return _0x58e17c;};return a211_0x3b03();}(function(_0x3bbecb,_0x147bca){const _0x2680e1=a211_0x5cc9,_0x3c209f=_0x3bbecb();while(!![]){try{const _0x3ad8c7=parseInt(_0x2680e1(0x80))/0x1+parseInt(_0x2680e1(0x90))/0x2*(parseInt(_0x2680e1(0x81))/0x3)+-parseInt(_0x2680e1(0x87))/0x4+-parseInt(_0x2680e1(0x8d))/0x5+parseInt(_0x2680e1(0x8a))/0x6*(parseInt(_0x2680e1(0x92))/0x7)+parseInt(_0x2680e1(0x8f))/0x8*(-parseInt(_0x2680e1(0x89))/0x9)+-parseInt(_0x2680e1(0x93))/0xa*(-parseInt(_0x2680e1(0x94))/0xb);if(_0x3ad8c7===_0x147bca)break;else _0x3c209f['push'](_0x3c209f['shift']());}catch(_0x1cf440){_0x3c209f['push'](_0x3c209f['shift']());}}}(a211_0x3b03,0xf0c9d));import{CliErrors}from'../../errors.js';function textOrNull(_0x3314e8){const _0x5a26d7=a211_0x5cc9,_0xca3e42=_0x3314e8?.[_0x5a26d7(0x97)]();return _0xca3e42?_0xca3e42:null;}export function projectTenantMembers(_0x6b11bc){const _0x4c1f13=a211_0x5cc9,_0x4a69bc=new Map();for(const _0x1e5763 of _0x6b11bc){const _0x3e6bf0=Number(_0x1e5763[_0x4c1f13(0x91)]);if(!Number['isFinite'](_0x3e6bf0)||_0x3e6bf0<=0x0)continue;const _0x5570a5={'userId':_0x3e6bf0,'username':textOrNull(_0x1e5763[_0x4c1f13(0x7b)]),'displayName':textOrNull(_0x1e5763[_0x4c1f13(0x88)]),'role':_0x1e5763[_0x4c1f13(0x86)]===!![]?'ADMIN':'MEMBER','status':textOrNull(_0x1e5763[_0x4c1f13(0x7e)])},_0x35603a=_0x4a69bc['get'](_0x3e6bf0);if(!_0x35603a){_0x4a69bc[_0x4c1f13(0x8b)](_0x3e6bf0,_0x5570a5);continue;}_0x35603a[_0x4c1f13(0x7b)]??=_0x5570a5[_0x4c1f13(0x7b)],_0x35603a[_0x4c1f13(0x8c)]??=_0x5570a5[_0x4c1f13(0x8c)],_0x35603a[_0x4c1f13(0x7e)]??=_0x5570a5[_0x4c1f13(0x7e)];if(_0x5570a5['role']===_0x4c1f13(0x85))_0x35603a[_0x4c1f13(0x8e)]=_0x4c1f13(0x85);}return[..._0x4a69bc[_0x4c1f13(0x84)]()][_0x4c1f13(0x95)]((_0xac0358,_0x2521e5)=>_0xac0358[_0x4c1f13(0x91)]-_0x2521e5[_0x4c1f13(0x91)]);}export function assertTenantAccessible(_0x7f8a97,_0x3f2120){const _0x201205=a211_0x5cc9;if(_0x3f2120[_0x201205(0x7d)](_0x135a55=>_0x135a55[_0x201205(0x96)]===_0x7f8a97))return;throw CliErrors[_0x201205(0x7c)](_0x201205(0x7f)+_0x7f8a97+_0x201205(0x82),_0x201205(0x83));}
@@ -1 +1 @@
1
- const a206_0xb86a4b=a206_0xbbf6;(function(_0x1182cd,_0x459921){const _0x44b9c5=a206_0xbbf6,_0x2bb2e1=_0x1182cd();while(!![]){try{const _0x53a3c7=parseInt(_0x44b9c5(0x204))/0x1+-parseInt(_0x44b9c5(0x1fa))/0x2*(parseInt(_0x44b9c5(0x1f4))/0x3)+parseInt(_0x44b9c5(0x1fd))/0x4+parseInt(_0x44b9c5(0x209))/0x5*(-parseInt(_0x44b9c5(0x20d))/0x6)+parseInt(_0x44b9c5(0x1f7))/0x7*(-parseInt(_0x44b9c5(0x207))/0x8)+-parseInt(_0x44b9c5(0x1f6))/0x9*(-parseInt(_0x44b9c5(0x1f3))/0xa)+parseInt(_0x44b9c5(0x206))/0xb*(parseInt(_0x44b9c5(0x1f8))/0xc);if(_0x53a3c7===_0x459921)break;else _0x2bb2e1['push'](_0x2bb2e1['shift']());}catch(_0x4aee55){_0x2bb2e1['push'](_0x2bb2e1['shift']());}}}(a206_0xf5b9,0x44f11));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';const PROVIDER_ID=a206_0xb86a4b(0x1f9),CURRENT_BINDING_WARNING=a206_0xb86a4b(0x1fc);function readDingTalkUserId(_0x2c7106){const _0x1f2c48=a206_0xb86a4b,_0x17def4=_0x2c7106[_0x1f2c48(0x203)](_0x1f2c48(0x208))[_0x1f2c48(0x20a)]();if(!_0x17def4)throw CliErrors[_0x1f2c48(0x1fb)]('--ding-talk-user-id\x20cannot\x20be\x20empty.',_0x1f2c48(0x202));return _0x17def4;}function a206_0xbbf6(_0x40920d,_0x17ab7b){_0x40920d=_0x40920d-0x1f3;const _0xf5b93=a206_0xf5b9();let _0xbbf631=_0xf5b93[_0x40920d];return _0xbbf631;}function buildBindingData(_0x261dcd,_0x59dd82){const _0x47d4f1=a206_0xb86a4b;return{'operation':_0x47d4f1(0x20c),'selector':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x261dcd},'before':null,'after':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x261dcd,'bound':!![]},'dryRun':_0x59dd82,'backend':{'method':_0x47d4f1(0x200),'path':DING_TALK_SANDBOX_BIND_PATH},'warnings':[CURRENT_BINDING_WARNING]};}export const dingTalkSandboxBind={'service':a206_0xb86a4b(0x201),'command':a206_0xb86a4b(0x1f5),'description':a206_0xb86a4b(0x20b),'risk':a206_0xb86a4b(0x20e),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a206_0xb86a4b(0x208),'type':'string','required':!![],'description':a206_0xb86a4b(0x1fe)}],async 'validate'(_0x181f02){readDingTalkUserId(_0x181f02);},async 'dryRun'(_0x451d76){const _0x20efcc=a206_0xb86a4b,_0x63c1df=readDingTalkUserId(_0x451d76);return asDryRunResult(buildBindingData(_0x63c1df,!![]),{'method':_0x20efcc(0x200),'url':DING_TALK_SANDBOX_BIND_PATH});},async 'execute'(_0x24dafa){const _0x1e6581=a206_0xb86a4b,_0x11e6b7=readDingTalkUserId(_0x24dafa),_0x14eacc=await bindDingTalkSandboxAccount(_0x11e6b7);if(_0x14eacc!==!![])throw CliErrors['apiError'](_0x1e6581(0x1ff),_0x1e6581(0x205));return{'ok':!![],'data':buildBindingData(_0x11e6b7,![]),'message':'Bound\x20current\x20user\x20to\x20DingTalk\x20sandbox\x20account.'};}};function a206_0xf5b9(){const _0x3fadb3=['ding-talk-user-id','95GjbTIs','trim','Bind\x20the\x20current\x20platform\x20user\x20to\x20a\x20DingTalk\x20sandbox\x20account','bind','111666rgTchZ','write','2240lVYvgs','9EqgxGx','dingding-sandbox-bind','15354BCubEx','448iapvcI','13836Hyaarb','dingtalk','119722xBLzkN','validation','The\x20current\x20binding\x20is\x20not\x20exposed\x20by\x20the\x20server;\x20before\x20is\x20unavailable.','701448rrsCNz','DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox','DingTalk\x20sandbox\x20account\x20binding\x20was\x20not\x20confirmed.','POST','user-account','Pass\x20the\x20DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox.','str','151921DJGvjB','Retry\x20with\x20the\x20same\x20--ding-talk-user-id\x20only\x20after\x20checking\x20the\x20current\x20platform\x20session.','4642oQRcTr','47552yoUnMb'];a206_0xf5b9=function(){return _0x3fadb3;};return a206_0xf5b9();}
1
+ const a212_0x3c1fe2=a212_0x1d6d;(function(_0x58e3a4,_0x2d486f){const _0x4d0eec=a212_0x1d6d,_0x234d16=_0x58e3a4();while(!![]){try{const _0x4bfba9=parseInt(_0x4d0eec(0x7e))/0x1+parseInt(_0x4d0eec(0x7c))/0x2*(-parseInt(_0x4d0eec(0x6d))/0x3)+-parseInt(_0x4d0eec(0x74))/0x4+-parseInt(_0x4d0eec(0x79))/0x5*(parseInt(_0x4d0eec(0x6c))/0x6)+-parseInt(_0x4d0eec(0x70))/0x7*(-parseInt(_0x4d0eec(0x75))/0x8)+-parseInt(_0x4d0eec(0x80))/0x9+parseInt(_0x4d0eec(0x7d))/0xa;if(_0x4bfba9===_0x2d486f)break;else _0x234d16['push'](_0x234d16['shift']());}catch(_0x2eb800){_0x234d16['push'](_0x234d16['shift']());}}}(a212_0xd493,0xb99f7));import{asDryRunResult}from'../../commands/common/dry-run.js';function a212_0x1d6d(_0x352838,_0x54c7a2){_0x352838=_0x352838-0x6b;const _0xd49370=a212_0xd493();let _0x1d6d6f=_0xd49370[_0x352838];return _0x1d6d6f;}import{bindDingTalkSandboxAccount,DING_TALK_SANDBOX_BIND_PATH}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const PROVIDER_ID='dingtalk',CURRENT_BINDING_WARNING=a212_0x3c1fe2(0x78);function a212_0xd493(){const _0x54ec1d=['6hZNYZV','49701oyGOlj','ding-talk-user-id','str','3558751iRCYIC','write','trim','--ding-talk-user-id\x20cannot\x20be\x20empty.','5882584QAbyXb','16KHiaAB','Retry\x20with\x20the\x20same\x20--ding-talk-user-id\x20only\x20after\x20checking\x20the\x20current\x20platform\x20session.','Pass\x20the\x20DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox.','The\x20current\x20binding\x20is\x20not\x20exposed\x20by\x20the\x20server;\x20before\x20is\x20unavailable.','7106065whywqX','validation','apiError','182GagUrP','42761530DIvdtH','1370455kaGAGc','DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox','13532643PVWmCj','Bind\x20the\x20current\x20platform\x20user\x20to\x20a\x20DingTalk\x20sandbox\x20account','POST','bind'];a212_0xd493=function(){return _0x54ec1d;};return a212_0xd493();}function readDingTalkUserId(_0x1f12ff){const _0x1cf416=a212_0x3c1fe2,_0x4031a3=_0x1f12ff[_0x1cf416(0x6f)](_0x1cf416(0x6e))[_0x1cf416(0x72)]();if(!_0x4031a3)throw CliErrors[_0x1cf416(0x7a)](_0x1cf416(0x73),_0x1cf416(0x77));return _0x4031a3;}function buildBindingData(_0xa73ff4,_0x509fbe){const _0x2aab86=a212_0x3c1fe2;return{'operation':_0x2aab86(0x6b),'selector':{'providerId':PROVIDER_ID,'dingTalkUserId':_0xa73ff4},'before':null,'after':{'providerId':PROVIDER_ID,'dingTalkUserId':_0xa73ff4,'bound':!![]},'dryRun':_0x509fbe,'backend':{'method':_0x2aab86(0x82),'path':DING_TALK_SANDBOX_BIND_PATH},'warnings':[CURRENT_BINDING_WARNING]};}export const dingTalkSandboxBind={'service':'user-account','command':'dingding-sandbox-bind','description':a212_0x3c1fe2(0x81),'risk':a212_0x3c1fe2(0x71),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a212_0x3c1fe2(0x6e),'type':'string','required':!![],'description':a212_0x3c1fe2(0x7f)}],async 'validate'(_0x5e19fc){readDingTalkUserId(_0x5e19fc);},async 'dryRun'(_0x300469){const _0x10d785=a212_0x3c1fe2,_0x3c2520=readDingTalkUserId(_0x300469);return asDryRunResult(buildBindingData(_0x3c2520,!![]),{'method':_0x10d785(0x82),'url':DING_TALK_SANDBOX_BIND_PATH});},async 'execute'(_0x2a331a){const _0x32a927=a212_0x3c1fe2,_0x4d199f=readDingTalkUserId(_0x2a331a),_0x51f1e8=await bindDingTalkSandboxAccount(_0x4d199f);if(_0x51f1e8!==!![])throw CliErrors[_0x32a927(0x7b)]('DingTalk\x20sandbox\x20account\x20binding\x20was\x20not\x20confirmed.',_0x32a927(0x76));return{'ok':!![],'data':buildBindingData(_0x4d199f,![]),'message':'Bound\x20current\x20user\x20to\x20DingTalk\x20sandbox\x20account.'};}};
@@ -1 +1 @@
1
- (function(_0x5d8d27,_0x34e156){const _0x151484=a207_0xbf6f,_0x174611=_0x5d8d27();while(!![]){try{const _0x3dae33=-parseInt(_0x151484(0x87))/0x1*(parseInt(_0x151484(0x8d))/0x2)+-parseInt(_0x151484(0x8c))/0x3*(-parseInt(_0x151484(0x8a))/0x4)+-parseInt(_0x151484(0x85))/0x5*(-parseInt(_0x151484(0x88))/0x6)+-parseInt(_0x151484(0x81))/0x7*(parseInt(_0x151484(0x84))/0x8)+parseInt(_0x151484(0x80))/0x9*(parseInt(_0x151484(0x83))/0xa)+parseInt(_0x151484(0x8b))/0xb*(-parseInt(_0x151484(0x82))/0xc)+parseInt(_0x151484(0x89))/0xd*(parseInt(_0x151484(0x86))/0xe);if(_0x3dae33===_0x34e156)break;else _0x174611['push'](_0x174611['shift']());}catch(_0x584998){_0x174611['push'](_0x174611['shift']());}}}(a207_0x2ca5,0x21a05));import{dingTalkSandboxBind}from'../../commands/user-account/dingding-sandbox-bind.js';function a207_0xbf6f(_0x23582f,_0x41197d){_0x23582f=_0x23582f-0x80;const _0x2ca5ad=a207_0x2ca5();let _0xbf6fea=_0x2ca5ad[_0x23582f];return _0xbf6fea;}function a207_0x2ca5(){const _0x5ebbd1=['1864AInusM','1277565WLICCs','120134FyfTCG','3ozCeqw','6gMqvDw','117ICMRGm','868OgbYTE','77CzwVUT','3507IOMQBN','170842KMBRUD','9VLkocW','2422UkCWbR','430800XFpiAC','1394990Wgrymt'];a207_0x2ca5=function(){return _0x5ebbd1;};return a207_0x2ca5();}export const userAccountDefinitions=[dingTalkSandboxBind];
1
+ (function(_0xf30678,_0x2d38c7){const _0x5e6958=a213_0x274b,_0x445a3=_0xf30678();while(!![]){try{const _0x2985b3=parseInt(_0x5e6958(0x69))/0x1+-parseInt(_0x5e6958(0x6b))/0x2*(-parseInt(_0x5e6958(0x70))/0x3)+-parseInt(_0x5e6958(0x6f))/0x4+-parseInt(_0x5e6958(0x74))/0x5*(parseInt(_0x5e6958(0x6e))/0x6)+-parseInt(_0x5e6958(0x6d))/0x7*(parseInt(_0x5e6958(0x6a))/0x8)+-parseInt(_0x5e6958(0x72))/0x9*(-parseInt(_0x5e6958(0x6c))/0xa)+-parseInt(_0x5e6958(0x73))/0xb*(-parseInt(_0x5e6958(0x71))/0xc);if(_0x2985b3===_0x2d38c7)break;else _0x445a3['push'](_0x445a3['shift']());}catch(_0x4512b7){_0x445a3['push'](_0x445a3['shift']());}}}(a213_0xa006,0x36fda));import{dingTalkSandboxBind}from'../../commands/user-account/dingding-sandbox-bind.js';function a213_0x274b(_0x55e6bb,_0x170b86){_0x55e6bb=_0x55e6bb-0x69;const _0xa0064b=a213_0xa006();let _0x274b63=_0xa0064b[_0x55e6bb];return _0x274b63;}export const userAccountDefinitions=[dingTalkSandboxBind];function a213_0xa006(){const _0x54f7a9=['1561030bwVIbU','324466dLfOCg','6424RpYDfj','98QXAECV','891190WtjyWQ','3661BOjOUd','6owHVpU','144684QwASCt','15837Tzinep','35376zGoHvU','9itfctU','1199djPxfz'];a213_0xa006=function(){return _0x54f7a9;};return a213_0xa006();}
@@ -1 +1 @@
1
- const a208_0x298892=a208_0x4f44;function a208_0x2782(){const _0x488d24=['472284ZyGzBT','6LZVmYk','28ASoyEp','workspace\x20add','520055oiBimX','name','App\x20profile\x20name','536562vGTBbg','1030808SeUmng','workspace','1206317wlGOup','Register\x20an\x20app\x20profile\x20in\x20the\x20current\x20workspace\x20(or\x20--global)','10698660NpTFGB','write','119589GuDuEc'];a208_0x2782=function(){return _0x488d24;};return a208_0x2782();}(function(_0x15e2ac,_0x5a2e36){const _0x8dc395=a208_0x4f44,_0xe6bae0=_0x15e2ac();while(!![]){try{const _0xb703f=-parseInt(_0x8dc395(0x192))/0x1+-parseInt(_0x8dc395(0x18a))/0x2+-parseInt(_0x8dc395(0x191))/0x3+-parseInt(_0x8dc395(0x194))/0x4*(-parseInt(_0x8dc395(0x187))/0x5)+-parseInt(_0x8dc395(0x193))/0x6*(parseInt(_0x8dc395(0x18d))/0x7)+-parseInt(_0x8dc395(0x18b))/0x8+parseInt(_0x8dc395(0x18f))/0x9;if(_0xb703f===_0x5a2e36)break;else _0xe6bae0['push'](_0xe6bae0['shift']());}catch(_0x5da27d){_0xe6bae0['push'](_0xe6bae0['shift']());}}}(a208_0x2782,0xcbe87));function a208_0x4f44(_0x2bf1d4,_0xd095fb){_0x2bf1d4=_0x2bf1d4-0x186;const _0x2782ac=a208_0x2782();let _0x4f44ae=_0x2782ac[_0x2bf1d4];return _0x4f44ae;}import{buildAppAddFlags,runAppAdd,validateAppName}from'../../commands/common/app-registry.js';export const workspaceAddDefinition={'service':a208_0x298892(0x18c),'command':'add','description':a208_0x298892(0x18e),'risk':a208_0x298892(0x190),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a208_0x298892(0x188),'description':a208_0x298892(0x189),'required':!![]}],'flags':buildAppAddFlags(),'validate':_0xb4cd4f=>validateAppName(_0xb4cd4f,a208_0x298892(0x186)),'execute':_0x3b6acd=>runAppAdd(_0x3b6acd,a208_0x298892(0x186))};
1
+ function a214_0x1214(_0x225123,_0x203333){_0x225123=_0x225123-0x19d;const _0x51abaf=a214_0x51ab();let _0x1214aa=_0x51abaf[_0x225123];return _0x1214aa;}const a214_0xff0c27=a214_0x1214;function a214_0x51ab(){const _0x5f1cc3=['9VGMLxd','4734NgEmvm','Register\x20an\x20app\x20profile\x20in\x20the\x20current\x20workspace\x20(or\x20--global)','973ihaxrB','68210sgQCEh','1ZqJebn','workspace','20dqSrur','25688etuFZm','18883980wEerRl','5405cETwhi','workspace\x20add','name','3874574kmHDom','490344JjyxFR','1553526pekXXd'];a214_0x51ab=function(){return _0x5f1cc3;};return a214_0x51ab();}(function(_0x58887f,_0x1ba130){const _0x21b962=a214_0x1214,_0x29b006=_0x58887f();while(!![]){try{const _0x5846a7=-parseInt(_0x21b962(0x1a9))/0x1*(parseInt(_0x21b962(0x1a8))/0x2)+-parseInt(_0x21b962(0x1a4))/0x3*(parseInt(_0x21b962(0x1a2))/0x4)+parseInt(_0x21b962(0x19e))/0x5*(-parseInt(_0x21b962(0x1a5))/0x6)+-parseInt(_0x21b962(0x1a7))/0x7*(parseInt(_0x21b962(0x1ac))/0x8)+parseInt(_0x21b962(0x1a3))/0x9+parseInt(_0x21b962(0x1ab))/0xa*(parseInt(_0x21b962(0x1a1))/0xb)+parseInt(_0x21b962(0x19d))/0xc;if(_0x5846a7===_0x1ba130)break;else _0x29b006['push'](_0x29b006['shift']());}catch(_0x33f647){_0x29b006['push'](_0x29b006['shift']());}}}(a214_0x51ab,0xb704e));import{buildAppAddFlags,runAppAdd,validateAppName}from'../../commands/common/app-registry.js';export const workspaceAddDefinition={'service':a214_0xff0c27(0x1aa),'command':'add','description':a214_0xff0c27(0x1a6),'risk':'write','requiresAuth':![],'requiresAppCode':![],'args':[{'name':a214_0xff0c27(0x1a0),'description':'App\x20profile\x20name','required':!![]}],'flags':buildAppAddFlags(),'validate':_0x3b542d=>validateAppName(_0x3b542d,a214_0xff0c27(0x19f)),'execute':_0x24fd8e=>runAppAdd(_0x24fd8e,a214_0xff0c27(0x19f))};
@@ -1 +1 @@
1
- const a209_0x469172=a209_0x45c8;(function(_0x1c5dea,_0x5a1fe3){const _0x10214d=a209_0x45c8,_0x289663=_0x1c5dea();while(!![]){try{const _0x43f97c=parseInt(_0x10214d(0x1ca))/0x1*(parseInt(_0x10214d(0x1cb))/0x2)+parseInt(_0x10214d(0x1b5))/0x3*(parseInt(_0x10214d(0x1c1))/0x4)+-parseInt(_0x10214d(0x1a7))/0x5*(-parseInt(_0x10214d(0x19e))/0x6)+-parseInt(_0x10214d(0x192))/0x7+parseInt(_0x10214d(0x197))/0x8+-parseInt(_0x10214d(0x1ad))/0x9*(-parseInt(_0x10214d(0x1ba))/0xa)+-parseInt(_0x10214d(0x1a3))/0xb*(parseInt(_0x10214d(0x1b9))/0xc);if(_0x43f97c===_0x5a1fe3)break;else _0x289663['push'](_0x289663['shift']());}catch(_0x346b8a){_0x289663['push'](_0x289663['shift']());}}}(a209_0x1743,0xc000b));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{RABETBASE_ENV_VALUES}from'../../constant/env.js';import{RABETBASE_OUTPUT_FORMAT_VALUES}from'../../constant/output.js';import{RISK_LEVEL_VALUES}from'../../constant/risk.js';import{validateAppcode}from'../../commands/common/validate.js';import{readConfigFile,readRawConfigWithLayers,resolveWriteConfigPath,writeConfigFile}from'../../context.js';import{workspaceAddDefinition}from'../../commands/workspace/add.js';import{workspaceRemoveDefinition}from'../../commands/workspace/remove.js';import{normalizeStoredDefaultApp}from'../../config/schema.js';import{collectDeploymentSyncProfile,getDeploymentSyncProfileFlagDefs}from'../../config/deployment-sync.js';const WORKSPACE_USAGE=CLI_BIN_NAME+a209_0x469172(0x199),SAFE_PROFILE_KEYS=[a209_0x469172(0x1bc),a209_0x469172(0x19b),a209_0x469172(0x1a6),a209_0x469172(0x1c8),a209_0x469172(0x1b4),a209_0x469172(0x1ae),a209_0x469172(0x1ac),a209_0x469172(0x1c2)],workspaceFlags=[{'name':'app','type':a209_0x469172(0x1c9),'description':'App\x20profile\x20name\x20to\x20use\x20in\x20this\x20workspace'},{'name':'appcode','type':a209_0x469172(0x1c9),'description':a209_0x469172(0x19c)},{'name':a209_0x469172(0x19b),'type':a209_0x469172(0x1c9),'description':a209_0x469172(0x1a2),'enum':[...RABETBASE_ENV_VALUES]},{'name':a209_0x469172(0x1a6),'type':a209_0x469172(0x1c9),'description':a209_0x469172(0x1b3)},{'name':a209_0x469172(0x19d),'type':'string','description':'Default\x20output\x20format\x20for\x20this\x20workspace\x20app\x20profile','enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':'pageSize','type':a209_0x469172(0x1c6),'description':a209_0x469172(0x191)},{'name':a209_0x469172(0x1ae),'type':a209_0x469172(0x1c9),'description':'Risk\x20level\x20for\x20this\x20workspace\x20app\x20profile','enum':[...RISK_LEVEL_VALUES]},{'name':a209_0x469172(0x1ac),'type':a209_0x469172(0x1c9),'description':a209_0x469172(0x1c5)},...getDeploymentSyncProfileFlagDefs()];function isRecord(_0x4f0d31){const _0x1f83bc=a209_0x469172;return!!_0x4f0d31&&typeof _0x4f0d31===_0x1f83bc(0x19f)&&!Array[_0x1f83bc(0x198)](_0x4f0d31);}function assertValidAppcode(_0x59358b){const _0x2785ff=a209_0x469172,{valid:_0x21b9f8,message:_0x3a29b4}=validateAppcode(_0x59358b);if(!_0x21b9f8)throw CliErrors[_0x2785ff(0x1bf)](_0x2785ff(0x1c0)+_0x59358b,_0x3a29b4);}function a209_0x1743(){const _0x566ad1=['isArray','\x20workspace\x20<init|use>\x20--app\x20<name>\x20[--appcode\x20<code>]',').\x20Config:\x20','env','App\x20code\x20to\x20bind\x20to\x20this\x20workspace','defaultFormat','6dEuiuN','object','workspace.','use','Target\x20environment','386661kKKlJH','.\x20Credentials:\x20not\x20written.','trim','apiDir','7783235tiBylN','\x20--appcode\x20<code>`.','workspace','updated','app','locale','3222927YcpKER','riskLevel','Missing\x20workspace\x20app\x20selector.','Workspace\x20','initialized','str','API\x20directory\x20path\x20for\x20this\x20workspace\x20app\x20profile','pageSize','2775IreNsQ','globalConfig','Initialize\x20the\x20current\x20workspace\x20app\x20binding','apps','1296JrrdPS','20NgdNFa','Use\x20`','appcode','write','\x20(appcode:\x20','validation','Invalid\x20appcode:\x20','6788PNYqhu','deploymentSync','Switch\x20the\x20current\x20workspace\x20app\x20binding','\x20workspace\x20','App\x20locale\x20for\x20this\x20workspace\x20app\x20profile\x20(not\x20CLI\x20language;\x20reserved\x20for\x20later\x20app\x20use)','number','\x20--app\x20','format','string','859642eRlvGi','2jKwpWW','Default\x20page\x20size\x20for\x20this\x20workspace\x20app\x20profile','7643139UmSXMu','\x22\x20not\x20found.','Pass\x20--appcode\x20<code>,\x20or\x20choose\x20one\x20of:\x20','\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`','init','7779264tcrkjf'];a209_0x1743=function(){return _0x566ad1;};return a209_0x1743();}function sanitizeProfile(_0x13569d){if(!isRecord(_0x13569d))return{};const _0x3eee79={};for(const _0x2186f5 of SAFE_PROFILE_KEYS){if(_0x13569d[_0x2186f5]!==undefined)_0x3eee79[_0x2186f5]=_0x13569d[_0x2186f5];}return _0x3eee79;}function cloneProfile(_0x53c854){return isRecord(_0x53c854)?{..._0x53c854}:{};}function collectWorkspaceProfileOverrides(_0x185855){const _0x39717f=a209_0x469172,_0x210c40={},_0x38f8c7=_0x185855[_0x39717f(0x1b2)]('env'),_0x5c22bf=_0x185855[_0x39717f(0x1b2)]('apiDir'),_0x366694=_0x185855[_0x39717f(0x1b2)](_0x39717f(0x19d)),_0x14bfa7=_0x185855['flag'](_0x39717f(0x1b4)),_0x139b7b=_0x185855[_0x39717f(0x1b2)](_0x39717f(0x1ae)),_0x18c8f1=_0x185855[_0x39717f(0x1b2)]('locale');if(_0x38f8c7)_0x210c40[_0x39717f(0x19b)]=_0x38f8c7;if(_0x5c22bf)_0x210c40[_0x39717f(0x1a6)]=_0x5c22bf;if(_0x366694)_0x210c40[_0x39717f(0x1c8)]=_0x366694;if(_0x14bfa7!==undefined&&_0x14bfa7!=='')_0x210c40[_0x39717f(0x1b4)]=Number(_0x14bfa7);if(_0x139b7b)_0x210c40[_0x39717f(0x1ae)]=_0x139b7b;if(_0x18c8f1)_0x210c40[_0x39717f(0x1ac)]=_0x18c8f1;const _0xc78fa9=collectDeploymentSyncProfile(_0x5e5254=>_0x185855[_0x39717f(0x1b2)](_0x5e5254));if(_0xc78fa9)_0x210c40['deploymentSync']=_0xc78fa9;return _0x210c40;}async function validateWorkspaceArgs(_0x2477fd){const _0x5c20a3=a209_0x469172,_0x11187c=_0x2477fd[_0x5c20a3(0x1b2)](_0x5c20a3(0x1ab))[_0x5c20a3(0x1a5)](),_0x206867=_0x2477fd[_0x5c20a3(0x1b2)](_0x5c20a3(0x1bc))[_0x5c20a3(0x1a5)]();if(!_0x11187c&&!_0x206867)throw CliErrors[_0x5c20a3(0x1bf)](_0x5c20a3(0x1af),_0x5c20a3(0x1bb)+CLI_BIN_NAME+_0x5c20a3(0x195)+CLI_BIN_NAME+'\x20workspace\x20use\x20--app\x20<name>`.');if(_0x206867)assertValidAppcode(_0x206867);}function a209_0x45c8(_0x4925d1,_0xbf1d6a){_0x4925d1=_0x4925d1-0x191;const _0x1743ab=a209_0x1743();let _0x45c8b9=_0x1743ab[_0x4925d1];return _0x45c8b9;}function resolveKnownApps(){const _0x614c9e=a209_0x469172,{config:_0x2f4468,layers:_0x443d40}=readRawConfigWithLayers(),_0xf00b80=isRecord(_0x2f4468[_0x614c9e(0x1b8)])?_0x2f4468[_0x614c9e(0x1b8)]:{},_0x1a0302=isRecord(_0x443d40[_0x614c9e(0x1b6)]['apps'])?_0x443d40[_0x614c9e(0x1b6)][_0x614c9e(0x1b8)]:{};return{..._0x1a0302,..._0xf00b80};}async function configureWorkspace(_0x53fa7f,_0x2d204d){const _0x57dce8=a209_0x469172,_0x2dcf8f=_0x53fa7f[_0x57dce8(0x1b2)]('app')[_0x57dce8(0x1a5)](),_0x36f1f5=_0x53fa7f[_0x57dce8(0x1b2)](_0x57dce8(0x1bc))[_0x57dce8(0x1a5)](),_0x3b4201=_0x2dcf8f||_0x36f1f5;if(!_0x3b4201)throw CliErrors[_0x57dce8(0x1bf)](_0x57dce8(0x1af),_0x57dce8(0x1bb)+CLI_BIN_NAME+_0x57dce8(0x195)+CLI_BIN_NAME+'\x20workspace\x20use\x20--app\x20<name>`.');if(_0x36f1f5)assertValidAppcode(_0x36f1f5);const _0x1f7501=resolveWriteConfigPath('project'),_0x23d012=readConfigFile(_0x1f7501),_0x1eda55=resolveKnownApps(),_0x104550=isRecord(_0x23d012[_0x57dce8(0x1b8)])?{..._0x23d012['apps']}:{},_0x43afa7=cloneProfile(_0x104550[_0x3b4201]),_0x2672cc=sanitizeProfile(_0x1eda55[_0x3b4201]),_0x5cc13e=_0x36f1f5?{}:_0x2672cc,_0x50b66b=_0x36f1f5||_0x5cc13e['appcode'];if(!_0x50b66b){const _0x421553=Object['keys'](_0x1eda55),_0x504edc=_0x421553['length']===0x0?'Use\x20`'+CLI_BIN_NAME+_0x57dce8(0x1c4)+_0x2d204d+_0x57dce8(0x1c7)+_0x3b4201+_0x57dce8(0x1a8):_0x57dce8(0x194)+_0x421553['join'](',\x20');throw CliErrors['validation']('App\x20\x22'+_0x3b4201+_0x57dce8(0x193),_0x504edc);}assertValidAppcode(String(_0x50b66b));const _0x1a1234={..._0x5cc13e,..._0x43afa7,'appcode':String(_0x50b66b),...collectWorkspaceProfileOverrides(_0x53fa7f)};return _0x104550[_0x3b4201]=_0x1a1234,_0x23d012[_0x57dce8(0x1b8)]=_0x104550,normalizeStoredDefaultApp(_0x23d012,_0x3b4201),delete _0x23d012[_0x57dce8(0x1bc)],delete _0x23d012[_0x57dce8(0x1ab)],_0x1a1234[_0x57dce8(0x19b)]&&(_0x23d012[_0x57dce8(0x19b)]=_0x1a1234[_0x57dce8(0x19b)]),writeConfigFile(_0x1f7501,_0x23d012),{'ok':!![],'message':_0x57dce8(0x1b0)+(_0x2d204d===_0x57dce8(0x196)?_0x57dce8(0x1b1):_0x57dce8(0x1aa))+':\x20'+_0x3b4201+_0x57dce8(0x1be)+_0x1a1234[_0x57dce8(0x1bc)]+_0x57dce8(0x19a)+_0x1f7501+_0x57dce8(0x1a4),'data':{'operation':_0x57dce8(0x1a0)+_0x2d204d,'configPath':_0x1f7501,'app':_0x3b4201,'appcode':_0x1a1234[_0x57dce8(0x1bc)],'env':_0x1a1234['env']??null,'credentialsWritten':![]}};}const workspaceInitDefinition={'service':a209_0x469172(0x1a9),'command':'init','description':a209_0x469172(0x1b7),'risk':a209_0x469172(0x1bd),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x4bb5f6=>configureWorkspace(_0x4bb5f6,a209_0x469172(0x196))},workspaceUseDefinition={'service':a209_0x469172(0x1a9),'command':'use','description':a209_0x469172(0x1c3),'risk':'write','requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0xcb9edb=>configureWorkspace(_0xcb9edb,a209_0x469172(0x1a1))};export const workspaceDefinitions=[workspaceInitDefinition,workspaceUseDefinition,workspaceAddDefinition,workspaceRemoveDefinition];export{WORKSPACE_USAGE};
1
+ const a215_0x2572ff=a215_0x51d2;(function(_0x5f256d,_0x3ce979){const _0x4c76d0=a215_0x51d2,_0x185751=_0x5f256d();while(!![]){try{const _0x5f27be=-parseInt(_0x4c76d0(0x143))/0x1*(parseInt(_0x4c76d0(0x14b))/0x2)+parseInt(_0x4c76d0(0x153))/0x3+-parseInt(_0x4c76d0(0x138))/0x4+-parseInt(_0x4c76d0(0x158))/0x5*(parseInt(_0x4c76d0(0x135))/0x6)+-parseInt(_0x4c76d0(0x152))/0x7*(-parseInt(_0x4c76d0(0x13d))/0x8)+-parseInt(_0x4c76d0(0x12d))/0x9*(-parseInt(_0x4c76d0(0x13a))/0xa)+parseInt(_0x4c76d0(0x132))/0xb;if(_0x5f27be===_0x3ce979)break;else _0x185751['push'](_0x185751['shift']());}catch(_0x45bb25){_0x185751['push'](_0x185751['shift']());}}}(a215_0x4dd1,0xce792));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{RABETBASE_ENV_VALUES}from'../../constant/env.js';import{RABETBASE_OUTPUT_FORMAT_VALUES}from'../../constant/output.js';import{RISK_LEVEL_VALUES}from'../../constant/risk.js';import{validateAppcode}from'../../commands/common/validate.js';import{readConfigFile,readRawConfigWithLayers,resolveWriteConfigPath,writeConfigFile}from'../../context.js';import{workspaceAddDefinition}from'../../commands/workspace/add.js';import{workspaceRemoveDefinition}from'../../commands/workspace/remove.js';import{normalizeStoredDefaultApp}from'../../config/schema.js';import{collectDeploymentSyncProfile,getDeploymentSyncProfileFlagDefs}from'../../config/deployment-sync.js';const WORKSPACE_USAGE=CLI_BIN_NAME+a215_0x2572ff(0x151),SAFE_PROFILE_KEYS=[a215_0x2572ff(0x124),a215_0x2572ff(0x128),a215_0x2572ff(0x14c),a215_0x2572ff(0x12b),'pageSize',a215_0x2572ff(0x11e),a215_0x2572ff(0x12e),a215_0x2572ff(0x148)],workspaceFlags=[{'name':a215_0x2572ff(0x13c),'type':a215_0x2572ff(0x136),'description':a215_0x2572ff(0x150)},{'name':a215_0x2572ff(0x124),'type':a215_0x2572ff(0x136),'description':a215_0x2572ff(0x134)},{'name':a215_0x2572ff(0x128),'type':a215_0x2572ff(0x136),'description':a215_0x2572ff(0x159),'enum':[...RABETBASE_ENV_VALUES]},{'name':a215_0x2572ff(0x14c),'type':'string','description':a215_0x2572ff(0x141)},{'name':'defaultFormat','type':'string','description':a215_0x2572ff(0x145),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':a215_0x2572ff(0x14f),'type':a215_0x2572ff(0x147),'description':a215_0x2572ff(0x142)},{'name':'riskLevel','type':a215_0x2572ff(0x136),'description':a215_0x2572ff(0x126),'enum':[...RISK_LEVEL_VALUES]},{'name':a215_0x2572ff(0x12e),'type':a215_0x2572ff(0x136),'description':'App\x20locale\x20for\x20this\x20workspace\x20app\x20profile\x20(not\x20CLI\x20language;\x20reserved\x20for\x20later\x20app\x20use)'},...getDeploymentSyncProfileFlagDefs()];function a215_0x51d2(_0x4cfde2,_0x10aa06){_0x4cfde2=_0x4cfde2-0x11d;const _0x4dd19f=a215_0x4dd1();let _0x51d274=_0x4dd19f[_0x4cfde2];return _0x51d274;}function isRecord(_0x3ab684){const _0x2cdf8d=a215_0x2572ff;return!!_0x3ab684&&typeof _0x3ab684==='object'&&!Array[_0x2cdf8d(0x12c)](_0x3ab684);}function a215_0x4dd1(){const _0x140d6b=['riskLevel','Invalid\x20appcode:\x20','updated','\x20(appcode:\x20','str','flag','appcode','\x20workspace\x20use\x20--app\x20<name>`.','Risk\x20level\x20for\x20this\x20workspace\x20app\x20profile','write','env','Switch\x20the\x20current\x20workspace\x20app\x20binding','Missing\x20workspace\x20app\x20selector.','format','isArray','9239859keGyiF','locale','Use\x20`','Pass\x20--appcode\x20<code>,\x20or\x20choose\x20one\x20of:\x20',').\x20Config:\x20','19699636VRRMvx','defaultFormat','App\x20code\x20to\x20bind\x20to\x20this\x20workspace','6JVAvdl','string','\x20--app\x20','1907592keuNAC','trim','10joBxOd','init','app','3216GOZiaZ','\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`','\x20workspace\x20','project','API\x20directory\x20path\x20for\x20this\x20workspace\x20app\x20profile','Default\x20page\x20size\x20for\x20this\x20workspace\x20app\x20profile','1erExRJ','Initialize\x20the\x20current\x20workspace\x20app\x20binding','Default\x20output\x20format\x20for\x20this\x20workspace\x20app\x20profile','\x22\x20not\x20found.','number','deploymentSync','initialized','workspace','1811758RnLxUP','apiDir','validation','Workspace\x20','pageSize','App\x20profile\x20name\x20to\x20use\x20in\x20this\x20workspace','\x20workspace\x20<init|use>\x20--app\x20<name>\x20[--appcode\x20<code>]','6629IbOVvp','1996920JRqSsj','apps','keys','\x20--appcode\x20<code>`.','workspace.','8176850mcFrDm','Target\x20environment','globalConfig','use'];a215_0x4dd1=function(){return _0x140d6b;};return a215_0x4dd1();}function assertValidAppcode(_0x5d062b){const _0x10504e=a215_0x2572ff,{valid:_0x25126,message:_0x16f076}=validateAppcode(_0x5d062b);if(!_0x25126)throw CliErrors[_0x10504e(0x14d)](_0x10504e(0x11f)+_0x5d062b,_0x16f076);}function sanitizeProfile(_0x45cf89){if(!isRecord(_0x45cf89))return{};const _0x8650b4={};for(const _0x2f0805 of SAFE_PROFILE_KEYS){if(_0x45cf89[_0x2f0805]!==undefined)_0x8650b4[_0x2f0805]=_0x45cf89[_0x2f0805];}return _0x8650b4;}function cloneProfile(_0x4b459b){return isRecord(_0x4b459b)?{..._0x4b459b}:{};}function collectWorkspaceProfileOverrides(_0x8a3725){const _0x30ba71=a215_0x2572ff,_0x1a8fbb={},_0x4c196b=_0x8a3725[_0x30ba71(0x122)]('env'),_0x26847c=_0x8a3725[_0x30ba71(0x122)](_0x30ba71(0x14c)),_0x4ad66f=_0x8a3725[_0x30ba71(0x122)](_0x30ba71(0x133)),_0x32d13d=_0x8a3725[_0x30ba71(0x123)](_0x30ba71(0x14f)),_0x278203=_0x8a3725[_0x30ba71(0x122)](_0x30ba71(0x11e)),_0x1be093=_0x8a3725[_0x30ba71(0x122)](_0x30ba71(0x12e));if(_0x4c196b)_0x1a8fbb[_0x30ba71(0x128)]=_0x4c196b;if(_0x26847c)_0x1a8fbb[_0x30ba71(0x14c)]=_0x26847c;if(_0x4ad66f)_0x1a8fbb[_0x30ba71(0x12b)]=_0x4ad66f;if(_0x32d13d!==undefined&&_0x32d13d!=='')_0x1a8fbb[_0x30ba71(0x14f)]=Number(_0x32d13d);if(_0x278203)_0x1a8fbb[_0x30ba71(0x11e)]=_0x278203;if(_0x1be093)_0x1a8fbb[_0x30ba71(0x12e)]=_0x1be093;const _0x514c43=collectDeploymentSyncProfile(_0x81a4da=>_0x8a3725[_0x30ba71(0x122)](_0x81a4da));if(_0x514c43)_0x1a8fbb[_0x30ba71(0x148)]=_0x514c43;return _0x1a8fbb;}async function validateWorkspaceArgs(_0x57c84a){const _0x3a010b=a215_0x2572ff,_0x5cd249=_0x57c84a[_0x3a010b(0x122)]('app')['trim'](),_0x5ecbb0=_0x57c84a[_0x3a010b(0x122)]('appcode')[_0x3a010b(0x139)]();if(!_0x5cd249&&!_0x5ecbb0)throw CliErrors['validation'](_0x3a010b(0x12a),_0x3a010b(0x12f)+CLI_BIN_NAME+_0x3a010b(0x13e)+CLI_BIN_NAME+'\x20workspace\x20use\x20--app\x20<name>`.');if(_0x5ecbb0)assertValidAppcode(_0x5ecbb0);}function resolveKnownApps(){const _0x461a3a=a215_0x2572ff,{config:_0x56cc83,layers:_0x241663}=readRawConfigWithLayers(),_0x38f845=isRecord(_0x56cc83[_0x461a3a(0x154)])?_0x56cc83['apps']:{},_0x41c1f8=isRecord(_0x241663[_0x461a3a(0x15a)][_0x461a3a(0x154)])?_0x241663[_0x461a3a(0x15a)]['apps']:{};return{..._0x41c1f8,..._0x38f845};}async function configureWorkspace(_0x329234,_0x80caeb){const _0x312815=a215_0x2572ff,_0x228a4b=_0x329234[_0x312815(0x122)]('app')['trim'](),_0x55f8ac=_0x329234[_0x312815(0x122)](_0x312815(0x124))[_0x312815(0x139)](),_0x443cf5=_0x228a4b||_0x55f8ac;if(!_0x443cf5)throw CliErrors[_0x312815(0x14d)](_0x312815(0x12a),'Use\x20`'+CLI_BIN_NAME+'\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`'+CLI_BIN_NAME+_0x312815(0x125));if(_0x55f8ac)assertValidAppcode(_0x55f8ac);const _0xe56b40=resolveWriteConfigPath(_0x312815(0x140)),_0x29585b=readConfigFile(_0xe56b40),_0x4320ee=resolveKnownApps(),_0x48889f=isRecord(_0x29585b[_0x312815(0x154)])?{..._0x29585b['apps']}:{},_0x12a30c=cloneProfile(_0x48889f[_0x443cf5]),_0x2eadf9=sanitizeProfile(_0x4320ee[_0x443cf5]),_0x3b5873=_0x55f8ac?{}:_0x2eadf9,_0x2b7a02=_0x55f8ac||_0x3b5873[_0x312815(0x124)];if(!_0x2b7a02){const _0x29d117=Object[_0x312815(0x155)](_0x4320ee),_0x56f177=_0x29d117['length']===0x0?_0x312815(0x12f)+CLI_BIN_NAME+_0x312815(0x13f)+_0x80caeb+_0x312815(0x137)+_0x443cf5+_0x312815(0x156):_0x312815(0x130)+_0x29d117['join'](',\x20');throw CliErrors[_0x312815(0x14d)]('App\x20\x22'+_0x443cf5+_0x312815(0x146),_0x56f177);}assertValidAppcode(String(_0x2b7a02));const _0x15654a={..._0x3b5873,..._0x12a30c,'appcode':String(_0x2b7a02),...collectWorkspaceProfileOverrides(_0x329234)};return _0x48889f[_0x443cf5]=_0x15654a,_0x29585b[_0x312815(0x154)]=_0x48889f,normalizeStoredDefaultApp(_0x29585b,_0x443cf5),delete _0x29585b[_0x312815(0x124)],delete _0x29585b[_0x312815(0x13c)],_0x15654a[_0x312815(0x128)]&&(_0x29585b[_0x312815(0x128)]=_0x15654a[_0x312815(0x128)]),writeConfigFile(_0xe56b40,_0x29585b),{'ok':!![],'message':_0x312815(0x14e)+(_0x80caeb===_0x312815(0x13b)?_0x312815(0x149):_0x312815(0x120))+':\x20'+_0x443cf5+_0x312815(0x121)+_0x15654a[_0x312815(0x124)]+_0x312815(0x131)+_0xe56b40+'.\x20Credentials:\x20not\x20written.','data':{'operation':_0x312815(0x157)+_0x80caeb,'configPath':_0xe56b40,'app':_0x443cf5,'appcode':_0x15654a[_0x312815(0x124)],'env':_0x15654a[_0x312815(0x128)]??null,'credentialsWritten':![]}};}const workspaceInitDefinition={'service':a215_0x2572ff(0x14a),'command':'init','description':a215_0x2572ff(0x144),'risk':a215_0x2572ff(0x127),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x46a4f6=>configureWorkspace(_0x46a4f6,a215_0x2572ff(0x13b))},workspaceUseDefinition={'service':a215_0x2572ff(0x14a),'command':a215_0x2572ff(0x11d),'description':a215_0x2572ff(0x129),'risk':'write','requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x22088d=>configureWorkspace(_0x22088d,a215_0x2572ff(0x11d))};export const workspaceDefinitions=[workspaceInitDefinition,workspaceUseDefinition,workspaceAddDefinition,workspaceRemoveDefinition];export{WORKSPACE_USAGE};
@@ -1 +1 @@
1
- function a210_0xfc76(_0x2dc9b7,_0x48335b){_0x2dc9b7=_0x2dc9b7-0xcb;const _0x3b8e10=a210_0x3b8e();let _0xfc7676=_0x3b8e10[_0x2dc9b7];return _0xfc7676;}const a210_0x3f14f0=a210_0xfc76;function a210_0x3b8e(){const _0x52754e=['4750UhlSOg','35ILiwzn','remove','70551inBdhL','Remove\x20an\x20app\x20profile\x20from\x20the\x20current\x20workspace\x20(or\x20--global)','552AYdSOe','write','8150mseLJk','workspace\x20remove','4xhwBGu','333174JXKlSv','3727867WmfEAA','1199418cSldwX','3447DyTEUN','184YcDeKO'];a210_0x3b8e=function(){return _0x52754e;};return a210_0x3b8e();}(function(_0x13ba22,_0x1e562d){const _0x1bfb80=a210_0xfc76,_0x3b162a=_0x13ba22();while(!![]){try{const _0x2cca80=parseInt(_0x1bfb80(0xcd))/0x1+parseInt(_0x1bfb80(0xd3))/0x2*(-parseInt(_0x1bfb80(0xd4))/0x3)+-parseInt(_0x1bfb80(0xcf))/0x4*(parseInt(_0x1bfb80(0xd9))/0x5)+-parseInt(_0x1bfb80(0xd6))/0x6+parseInt(_0x1bfb80(0xcb))/0x7*(-parseInt(_0x1bfb80(0xd8))/0x8)+parseInt(_0x1bfb80(0xd7))/0x9*(parseInt(_0x1bfb80(0xd1))/0xa)+parseInt(_0x1bfb80(0xd5))/0xb;if(_0x2cca80===_0x1e562d)break;else _0x3b162a['push'](_0x3b162a['shift']());}catch(_0x2fb846){_0x3b162a['push'](_0x3b162a['shift']());}}}(a210_0x3b8e,0x291a7));import{buildAppRemoveFlags,runAppRemove,validateAppName}from'../../commands/common/app-registry.js';export const workspaceRemoveDefinition={'service':'workspace','command':a210_0x3f14f0(0xcc),'description':a210_0x3f14f0(0xce),'risk':a210_0x3f14f0(0xd0),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':'name','description':'App\x20profile\x20name\x20to\x20remove','required':!![]}],'flags':buildAppRemoveFlags(),'validate':_0x53ccbd=>validateAppName(_0x53ccbd,a210_0x3f14f0(0xd2)),'execute':_0x26316e=>runAppRemove(_0x26316e,a210_0x3f14f0(0xd2))};
1
+ const a216_0x17590e=a216_0x32a7;(function(_0xb66164,_0x406559){const _0x4e1068=a216_0x32a7,_0x13b914=_0xb66164();while(!![]){try{const _0x1c0b2d=parseInt(_0x4e1068(0x10d))/0x1+parseInt(_0x4e1068(0x10e))/0x2+-parseInt(_0x4e1068(0x103))/0x3*(-parseInt(_0x4e1068(0x10f))/0x4)+-parseInt(_0x4e1068(0x104))/0x5*(parseInt(_0x4e1068(0x10a))/0x6)+-parseInt(_0x4e1068(0x108))/0x7+parseInt(_0x4e1068(0x112))/0x8*(-parseInt(_0x4e1068(0x105))/0x9)+parseInt(_0x4e1068(0x10b))/0xa*(-parseInt(_0x4e1068(0x111))/0xb);if(_0x1c0b2d===_0x406559)break;else _0x13b914['push'](_0x13b914['shift']());}catch(_0x194d17){_0x13b914['push'](_0x13b914['shift']());}}}(a216_0x4cc9,0x846e8));import{buildAppRemoveFlags,runAppRemove,validateAppName}from'../../commands/common/app-registry.js';export const workspaceRemoveDefinition={'service':'workspace','command':a216_0x17590e(0x10c),'description':a216_0x17590e(0x109),'risk':a216_0x17590e(0x102),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a216_0x17590e(0x106),'description':a216_0x17590e(0x110),'required':!![]}],'flags':buildAppRemoveFlags(),'validate':_0x8b63f7=>validateAppName(_0x8b63f7,a216_0x17590e(0x107)),'execute':_0x49bdc1=>runAppRemove(_0x49bdc1,a216_0x17590e(0x107))};function a216_0x32a7(_0x243469,_0x1c643d){_0x243469=_0x243469-0x102;const _0x4cc9d2=a216_0x4cc9();let _0x32a7bc=_0x4cc9d2[_0x243469];return _0x32a7bc;}function a216_0x4cc9(){const _0xcb4238=['90UXgTjP','remove','652988lGQewc','81018BJnMDf','184yyvdlE','App\x20profile\x20name\x20to\x20remove','626923pVpSsl','180632RtczPW','write','65505IKzFpl','38455EiHBaU','36hiVPka','name','workspace\x20remove','581441ztNfaU','Remove\x20an\x20app\x20profile\x20from\x20the\x20current\x20workspace\x20(or\x20--global)','366JFXbmU'];a216_0x4cc9=function(){return _0xcb4238;};return a216_0x4cc9();}
@@ -1 +1 @@
1
- const a211_0x505755=a211_0x3a5d;(function(_0xea7ebb,_0xaf1e9c){const _0x8de9ec=a211_0x3a5d,_0x3a185c=_0xea7ebb();while(!![]){try{const _0x14dc81=-parseInt(_0x8de9ec(0xa1))/0x1+-parseInt(_0x8de9ec(0xb7))/0x2*(parseInt(_0x8de9ec(0xa6))/0x3)+parseInt(_0x8de9ec(0xb4))/0x4+parseInt(_0x8de9ec(0xaa))/0x5+-parseInt(_0x8de9ec(0xa0))/0x6+parseInt(_0x8de9ec(0xae))/0x7+-parseInt(_0x8de9ec(0xb0))/0x8;if(_0x14dc81===_0xaf1e9c)break;else _0x3a185c['push'](_0x3a185c['shift']());}catch(_0x2ce8a7){_0x3a185c['push'](_0x3a185c['shift']());}}}(a211_0x3f8c,0x7f74a));import{CliErrors}from'../errors.js';export const AUTO_DEPLOYMENT_TARGET_ENVS=['dev',a211_0x505755(0xb3),a211_0x505755(0xaf)];export function getDeploymentSyncProfileFlagDefs(){const _0x3576b8=a211_0x505755;return[{'name':_0x3576b8(0xa5),'type':_0x3576b8(0xa7),'description':_0x3576b8(0xb1)},{'name':_0x3576b8(0xb2),'type':'string','enum':[...AUTO_DEPLOYMENT_TARGET_ENVS],'description':_0x3576b8(0x9f)}];}export function collectDeploymentSyncProfile(_0x322581){const _0x228a8a=a211_0x505755,_0x2b2702=_0x322581('deployment-db-id')[_0x228a8a(0x9e)](),_0x1deea7=_0x322581(_0x228a8a(0xb2))[_0x228a8a(0x9e)]();if(!_0x2b2702&&!_0x1deea7)return undefined;return validateDeploymentSyncProfile({'dbLinkId':_0x2b2702?Number(_0x2b2702):undefined,'targetEnv':_0x1deea7||undefined});}function a211_0x3f8c(){const _0x155b60=['object','validation','deployment-db-id','6pSdyjG','number','isArray','join','2097915gsRSbq','deploymentSync\x20must\x20contain\x20dbLinkId\x20and\x20targetEnv.','Production\x20and\x20direct\x20targets\x20must\x20use\x20`rabetbase\x20deployment\x20sync`\x20with\x20explicit\x20confirmation.','string','4640468KRFAHR','pre','100120wUZNdG','Base\x20dblink\x20ID\x20whose\x20server-side\x20environment\x20mapping\x20selects\x20the\x20automatic\x20sync\x20target','deployment-target-env','test','2590460CpObXj','includes','targetEnv','26426CtsDJi','--deployment-db-id\x20must\x20be\x20a\x20positive\x20safe\x20integer.','trim','Non-production\x20target\x20selected\x20by\x20the\x20server-side\x20environment\x20mapping','3915654ThnKkn','516514jPMEKe','--deployment-target-env\x20must\x20be\x20one\x20of:\x20'];a211_0x3f8c=function(){return _0x155b60;};return a211_0x3f8c();}function a211_0x3a5d(_0x591e1b,_0x5317d6){_0x591e1b=_0x591e1b-0x9d;const _0x3f8cf8=a211_0x3f8c();let _0x3a5d3e=_0x3f8cf8[_0x591e1b];return _0x3a5d3e;}export function validateDeploymentSyncProfile(_0x493eca){const _0x297809=a211_0x505755;if(!_0x493eca||typeof _0x493eca!==_0x297809(0xa3)||Array[_0x297809(0xa8)](_0x493eca))throw CliErrors[_0x297809(0xa4)](_0x297809(0xab));const _0x5d6600=_0x493eca,_0x499c71=Number(_0x5d6600['dbLinkId']);if(!Number['isSafeInteger'](_0x499c71)||_0x499c71<=0x0)throw CliErrors[_0x297809(0xa4)](_0x297809(0x9d));const _0x4b3672=typeof _0x5d6600[_0x297809(0xb6)]===_0x297809(0xad)?_0x5d6600[_0x297809(0xb6)][_0x297809(0x9e)]():'';if(!AUTO_DEPLOYMENT_TARGET_ENVS[_0x297809(0xb5)](_0x4b3672))throw CliErrors['validation'](_0x297809(0xa2)+AUTO_DEPLOYMENT_TARGET_ENVS[_0x297809(0xa9)](',\x20')+'.',_0x297809(0xac));return{'dbLinkId':_0x499c71,'targetEnv':_0x4b3672};}
1
+ function a217_0x2b10(_0x26d5c4,_0x33791c){_0x26d5c4=_0x26d5c4-0x1a4;const _0x25a6c6=a217_0x25a6();let _0x2b1018=_0x25a6c6[_0x26d5c4];return _0x2b1018;}const a217_0x636b8e=a217_0x2b10;function a217_0x25a6(){const _0x3651dd=['Non-production\x20target\x20selected\x20by\x20the\x20server-side\x20environment\x20mapping','8Ctoujx','object','deployment-target-env','1960824MweATR','validation','--deployment-db-id\x20must\x20be\x20a\x20positive\x20safe\x20integer.','Production\x20and\x20direct\x20targets\x20must\x20use\x20`rabetbase\x20deployment\x20sync`\x20with\x20explicit\x20confirmation.','1425219QxjjuA','deploymentSync\x20must\x20contain\x20dbLinkId\x20and\x20targetEnv.','520352JBXyZd','Base\x20dblink\x20ID\x20whose\x20server-side\x20environment\x20mapping\x20selects\x20the\x20automatic\x20sync\x20target','trim','dev','714378DvlLsl','78YLRINn','targetEnv','includes','dbLinkId','27BknaQP','string','--deployment-target-env\x20must\x20be\x20one\x20of:\x20','9829150ztdOrA','pre','number','isSafeInteger','deployment-db-id','4147241iomQuq','81645CMKwkK'];a217_0x25a6=function(){return _0x3651dd;};return a217_0x25a6();}(function(_0x27e955,_0x1ef5c2){const _0x3bb660=a217_0x2b10,_0x1f5caa=_0x27e955();while(!![]){try{const _0x51e7fc=-parseInt(_0x3bb660(0x1aa))/0x1+-parseInt(_0x3bb660(0x1ae))/0x2+-parseInt(_0x3bb660(0x1a8))/0x3+-parseInt(_0x3bb660(0x1a4))/0x4+-parseInt(_0x3bb660(0x1bc))/0x5*(parseInt(_0x3bb660(0x1af))/0x6)+-parseInt(_0x3bb660(0x1bb))/0x7*(parseInt(_0x3bb660(0x1be))/0x8)+-parseInt(_0x3bb660(0x1b3))/0x9*(-parseInt(_0x3bb660(0x1b6))/0xa);if(_0x51e7fc===_0x1ef5c2)break;else _0x1f5caa['push'](_0x1f5caa['shift']());}catch(_0x4459ef){_0x1f5caa['push'](_0x1f5caa['shift']());}}}(a217_0x25a6,0x49881));import{CliErrors}from'../errors.js';export const AUTO_DEPLOYMENT_TARGET_ENVS=[a217_0x636b8e(0x1ad),'test',a217_0x636b8e(0x1b7)];export function getDeploymentSyncProfileFlagDefs(){const _0x3b8c66=a217_0x636b8e;return[{'name':_0x3b8c66(0x1ba),'type':_0x3b8c66(0x1b8),'description':_0x3b8c66(0x1ab)},{'name':_0x3b8c66(0x1c0),'type':_0x3b8c66(0x1b4),'enum':[...AUTO_DEPLOYMENT_TARGET_ENVS],'description':_0x3b8c66(0x1bd)}];}export function collectDeploymentSyncProfile(_0x2cfe67){const _0x466f79=a217_0x636b8e,_0x109fe9=_0x2cfe67('deployment-db-id')[_0x466f79(0x1ac)](),_0x9b5a2d=_0x2cfe67('deployment-target-env')[_0x466f79(0x1ac)]();if(!_0x109fe9&&!_0x9b5a2d)return undefined;return validateDeploymentSyncProfile({'dbLinkId':_0x109fe9?Number(_0x109fe9):undefined,'targetEnv':_0x9b5a2d||undefined});}export function validateDeploymentSyncProfile(_0x3050ea){const _0x4e51d3=a217_0x636b8e;if(!_0x3050ea||typeof _0x3050ea!==_0x4e51d3(0x1bf)||Array['isArray'](_0x3050ea))throw CliErrors['validation'](_0x4e51d3(0x1a9));const _0x1ed3ec=_0x3050ea,_0x2886d3=Number(_0x1ed3ec[_0x4e51d3(0x1b2)]);if(!Number[_0x4e51d3(0x1b9)](_0x2886d3)||_0x2886d3<=0x0)throw CliErrors['validation'](_0x4e51d3(0x1a6));const _0x5ba2b5=typeof _0x1ed3ec[_0x4e51d3(0x1b0)]===_0x4e51d3(0x1b4)?_0x1ed3ec[_0x4e51d3(0x1b0)][_0x4e51d3(0x1ac)]():'';if(!AUTO_DEPLOYMENT_TARGET_ENVS[_0x4e51d3(0x1b1)](_0x5ba2b5))throw CliErrors[_0x4e51d3(0x1a5)](_0x4e51d3(0x1b5)+AUTO_DEPLOYMENT_TARGET_ENVS['join'](',\x20')+'.',_0x4e51d3(0x1a7));return{'dbLinkId':_0x2886d3,'targetEnv':_0x5ba2b5};}
@@ -1,10 +1,46 @@
1
- export declare const DOMAIN_CONFIG_FIELDS: readonly ["userDomain", "apiDomain", "runtimeDomain", "skillDomain", "kbDomain", "kbSearchDomain", "appDomain", "localDomain", "certificateDomain"];
1
+ import { ENTERPRISE_ROUTING_CDN_FIELDS, ENTERPRISE_ROUTING_DOMAIN_FIELDS, ENTERPRISE_ROUTING_CONSUMERS } from "../generated/routing-contract.js";
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
+ }>;