@lovrabet/rabetbase-cli 2.4.5-beta.1 → 2.4.6-beta.1

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 (342) hide show
  1. package/README.md +3 -2
  2. package/lib/api/api-doc.js +1 -1
  3. package/lib/api/fetch-model-list.js +1 -1
  4. package/lib/api/generate-api-file.js +1 -1
  5. package/lib/auth/auth-server-ui.js +1 -1
  6. package/lib/auth/auth-server.js +1 -1
  7. package/lib/auth/constant.js +1 -1
  8. package/lib/auth/get-cookie.js +1 -1
  9. package/lib/auth/get-session-user.js +1 -1
  10. package/lib/auth/is-session-valid.js +1 -1
  11. package/lib/auth/login-success-html.js +1 -1
  12. package/lib/auth/logout.js +1 -1
  13. package/lib/cli-flags.js +1 -1
  14. package/lib/cli.js +1 -1
  15. package/lib/commands/api/generate.js +1 -1
  16. package/lib/commands/api/index.js +1 -1
  17. package/lib/commands/api/list.js +1 -1
  18. package/lib/commands/api/pull.js +1 -1
  19. package/lib/commands/api/shared.js +1 -1
  20. package/lib/commands/app/index.js +1 -1
  21. package/lib/commands/app/list.js +1 -1
  22. package/lib/commands/app/members-list.js +1 -1
  23. package/lib/commands/app/remote-directory.js +1 -1
  24. package/lib/commands/app/shared.js +1 -1
  25. package/lib/commands/app-config/delete.js +1 -1
  26. package/lib/commands/app-config/get.js +1 -1
  27. package/lib/commands/app-config/index.js +1 -1
  28. package/lib/commands/app-config/list.js +1 -1
  29. package/lib/commands/app-config/set.js +1 -1
  30. package/lib/commands/app-config/shared.js +1 -1
  31. package/lib/commands/auth/index.js +1 -1
  32. package/lib/commands/bff/create.js +1 -1
  33. package/lib/commands/bff/delete.js +1 -1
  34. package/lib/commands/bff/detail.js +1 -1
  35. package/lib/commands/bff/index.js +1 -1
  36. package/lib/commands/bff/list.js +1 -1
  37. package/lib/commands/bff/pull.js +1 -1
  38. package/lib/commands/bff/push.js +1 -1
  39. package/lib/commands/bff/status.js +1 -1
  40. package/lib/commands/cli-skill/index.js +1 -1
  41. package/lib/commands/cli-update.js +1 -1
  42. package/lib/commands/codegen/index.js +1 -1
  43. package/lib/commands/codegen/sdk.js +1 -1
  44. package/lib/commands/codegen/sql.js +1 -1
  45. package/lib/commands/common/app-registry.js +1 -1
  46. package/lib/commands/common/app-selector.js +1 -1
  47. package/lib/commands/common/async-task.js +1 -1
  48. package/lib/commands/common/dry-run.js +1 -1
  49. package/lib/commands/common/flags.js +1 -1
  50. package/lib/commands/common/local-file.js +1 -1
  51. package/lib/commands/common/validate.js +1 -1
  52. package/lib/commands/config/get.js +1 -1
  53. package/lib/commands/config/index.js +1 -1
  54. package/lib/commands/config/list.js +1 -1
  55. package/lib/commands/config/set.js +1 -1
  56. package/lib/commands/config/shared.js +1 -1
  57. package/lib/commands/data/filter.js +1 -1
  58. package/lib/commands/data/getOne.js +1 -1
  59. package/lib/commands/data/index.js +1 -1
  60. package/lib/commands/data/shared.js +1 -1
  61. package/lib/commands/dataset/business-group-update.js +1 -1
  62. package/lib/commands/dataset/business-groups.js +1 -1
  63. package/lib/commands/dataset/capability.js +1 -1
  64. package/lib/commands/dataset/delete.js +1 -1
  65. package/lib/commands/dataset/detail.js +1 -1
  66. package/lib/commands/dataset/extend-update.js +1 -1
  67. package/lib/commands/dataset/field-update.js +1 -1
  68. package/lib/commands/dataset/generate.js +1 -1
  69. package/lib/commands/dataset/index.js +1 -1
  70. package/lib/commands/dataset/list.js +1 -1
  71. package/lib/commands/dataset/operations.js +1 -1
  72. package/lib/commands/dataset/relation-audit.js +1 -1
  73. package/lib/commands/dataset/relation-create.js +1 -1
  74. package/lib/commands/dataset/relation-delete.js +1 -1
  75. package/lib/commands/dataset/relation-shared.js +1 -1
  76. package/lib/commands/dataset/relation-update.js +1 -1
  77. package/lib/commands/dataset/relations.js +1 -1
  78. package/lib/commands/dataset/rename.js +1 -1
  79. package/lib/commands/dataset/restore.js +1 -1
  80. package/lib/commands/db/analysis-batching.js +1 -1
  81. package/lib/commands/db/analyze-batch-plan.js +1 -1
  82. package/lib/commands/db/analyze-cancel.js +1 -1
  83. package/lib/commands/db/analyze-start.js +1 -1
  84. package/lib/commands/db/analyze-status.js +1 -1
  85. package/lib/commands/db/create.js +1 -1
  86. package/lib/commands/db/delete.js +1 -1
  87. package/lib/commands/db/detail.js +1 -1
  88. package/lib/commands/db/diff-refresh-start.js +1 -1
  89. package/lib/commands/db/diff-refresh-status.js +1 -1
  90. package/lib/commands/db/diff.js +1 -1
  91. package/lib/commands/db/index.js +1 -1
  92. package/lib/commands/db/list.js +1 -1
  93. package/lib/commands/db/shared.js +1 -1
  94. package/lib/commands/db/tables.js +1 -1
  95. package/lib/commands/db/test.js +1 -1
  96. package/lib/commands/db/update.js +1 -1
  97. package/lib/commands/doctor.js +1 -1
  98. package/lib/commands/file/index.js +1 -1
  99. package/lib/commands/init/index.js +1 -1
  100. package/lib/commands/issue/index.js +1 -1
  101. package/lib/commands/issue/nudge.js +1 -1
  102. package/lib/commands/issue/report.js +1 -1
  103. package/lib/commands/issue/shared.js +1 -1
  104. package/lib/commands/kb/create.js +1 -1
  105. package/lib/commands/kb/delete.js +1 -1
  106. package/lib/commands/kb/detail.js +1 -1
  107. package/lib/commands/kb/index.js +1 -1
  108. package/lib/commands/kb/list.js +1 -1
  109. package/lib/commands/kb/shared.js +1 -1
  110. package/lib/commands/kb/update.js +1 -1
  111. package/lib/commands/logs/index.js +1 -1
  112. package/lib/commands/menu/asset-update.js +1 -1
  113. package/lib/commands/menu/delete.js +1 -1
  114. package/lib/commands/menu/external-link-create.js +1 -1
  115. package/lib/commands/menu/external-link-update.js +1 -1
  116. package/lib/commands/menu/group-create.js +1 -1
  117. package/lib/commands/menu/group-update.js +1 -1
  118. package/lib/commands/menu/index.js +1 -1
  119. package/lib/commands/menu/list.js +1 -1
  120. package/lib/commands/menu/move.js +1 -1
  121. package/lib/commands/menu/regroup-start.js +1 -1
  122. package/lib/commands/menu/rename.js +1 -1
  123. package/lib/commands/menu/shared/compare-table.js +1 -1
  124. package/lib/commands/menu/shared/delete-plan.js +1 -1
  125. package/lib/commands/menu/shared/facts.js +1 -1
  126. package/lib/commands/menu/shared/index.js +1 -1
  127. package/lib/commands/menu/shared/inquirer.js +1 -1
  128. package/lib/commands/menu/shared/local-pages.js +1 -1
  129. package/lib/commands/menu/shared/logic.js +1 -1
  130. package/lib/commands/menu/shared/mutations.js +1 -1
  131. package/lib/commands/menu/shared/service.js +1 -1
  132. package/lib/commands/menu/shared/sync-core.js +1 -1
  133. package/lib/commands/menu/shared/update-core.js +1 -1
  134. package/lib/commands/menu/shared/valid-url.js +1 -1
  135. package/lib/commands/menu/sync.js +1 -1
  136. package/lib/commands/notification/config-create.js +1 -1
  137. package/lib/commands/notification/config-delete.js +1 -1
  138. package/lib/commands/notification/config-list.js +1 -1
  139. package/lib/commands/notification/config-update.js +1 -1
  140. package/lib/commands/notification/index.js +1 -1
  141. package/lib/commands/notification/shared.js +1 -1
  142. package/lib/commands/ocr/index.js +1 -1
  143. package/lib/commands/page/{standard-page-status.d.ts → create.d.ts} +1 -1
  144. package/lib/commands/page/create.js +1 -0
  145. package/lib/commands/page/{react → custom}/detail.d.ts +1 -1
  146. package/lib/commands/page/custom/detail.js +1 -0
  147. package/lib/commands/page/{react → custom}/list.d.ts +1 -1
  148. package/lib/commands/page/custom/list.js +1 -0
  149. package/lib/commands/page/{react → custom}/publish.d.ts +1 -1
  150. package/lib/commands/page/custom/publish.js +1 -0
  151. package/lib/commands/page/{react → custom}/shared.d.ts +15 -15
  152. package/lib/commands/page/custom/shared.js +1 -0
  153. package/lib/commands/page/{react → custom}/syntax.d.ts +2 -2
  154. package/lib/commands/page/custom/syntax.js +1 -0
  155. package/lib/commands/page/custom/template.js +1 -0
  156. package/lib/commands/page/{react → custom}/update.d.ts +1 -1
  157. package/lib/commands/page/custom/update.js +1 -0
  158. package/lib/commands/page/data-list-status.d.ts +2 -0
  159. package/lib/commands/page/data-list-status.js +1 -0
  160. package/lib/commands/page/generate-start.js +1 -1
  161. package/lib/commands/page/generate-status.js +1 -1
  162. package/lib/commands/page/index.js +1 -1
  163. package/lib/commands/page/pull.js +1 -1
  164. package/lib/commands/page/push.js +1 -1
  165. package/lib/commands/page/relation-audit.js +1 -1
  166. package/lib/commands/page/restore.js +1 -1
  167. package/lib/commands/page/shared.d.ts +18 -18
  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.js +1 -1
  173. package/lib/commands/project/create/materialize-project-template.js +1 -1
  174. package/lib/commands/project/create/project-name.js +1 -1
  175. package/lib/commands/project/create/project-template-archive.js +1 -1
  176. package/lib/commands/project/create/project-template-path.js +1 -1
  177. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  178. package/lib/commands/project/create/use-format-code.js +1 -1
  179. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  180. package/lib/commands/project/index.js +1 -1
  181. package/lib/commands/project/upgrade.js +1 -1
  182. package/lib/commands/registry.js +1 -1
  183. package/lib/commands/role/delete.js +1 -1
  184. package/lib/commands/role/detail.js +1 -1
  185. package/lib/commands/role/index.js +1 -1
  186. package/lib/commands/role/list.js +1 -1
  187. package/lib/commands/role/shared.js +1 -1
  188. package/lib/commands/role/update.js +1 -1
  189. package/lib/commands/role/user-add.js +1 -1
  190. package/lib/commands/role/user-remove.js +1 -1
  191. package/lib/commands/role/user-resolve.js +1 -1
  192. package/lib/commands/run/index.js +1 -1
  193. package/lib/commands/schema.js +1 -1
  194. package/lib/commands/sql/create.js +1 -1
  195. package/lib/commands/sql/delete.js +1 -1
  196. package/lib/commands/sql/detail.js +1 -1
  197. package/lib/commands/sql/exec.js +1 -1
  198. package/lib/commands/sql/index.js +1 -1
  199. package/lib/commands/sql/list.js +1 -1
  200. package/lib/commands/sql/pull.js +1 -1
  201. package/lib/commands/sql/push.js +1 -1
  202. package/lib/commands/sql/shared.js +1 -1
  203. package/lib/commands/sql/status.js +1 -1
  204. package/lib/commands/sql/validate.js +1 -1
  205. package/lib/commands/task/index.js +1 -1
  206. package/lib/commands/task/status.js +1 -1
  207. package/lib/commands/tenant/index.js +1 -1
  208. package/lib/commands/tenant/members-list.js +1 -1
  209. package/lib/commands/tenant/shared.js +1 -1
  210. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  211. package/lib/commands/user-account/index.js +1 -1
  212. package/lib/commands/workspace/add.js +1 -1
  213. package/lib/commands/workspace/index.js +1 -1
  214. package/lib/commands/workspace/remove.js +1 -1
  215. package/lib/config/schema.js +1 -1
  216. package/lib/constant/cdn.js +1 -1
  217. package/lib/constant/cli.js +1 -1
  218. package/lib/constant/defaults.js +1 -1
  219. package/lib/constant/domain.js +1 -1
  220. package/lib/constant/env.js +1 -1
  221. package/lib/constant/output.js +1 -1
  222. package/lib/constant/paths.js +1 -1
  223. package/lib/constant/risk.js +1 -1
  224. package/lib/context/app-resolver.js +1 -1
  225. package/lib/context/auth-resolver.js +1 -1
  226. package/lib/context/config-loader.js +1 -1
  227. package/lib/context.js +1 -1
  228. package/lib/core/alias-resolver.js +1 -1
  229. package/lib/core/api-client.d.ts +43 -43
  230. package/lib/core/api-client.js +1 -1
  231. package/lib/core/bff/config.js +1 -1
  232. package/lib/core/bff/file-system.js +1 -1
  233. package/lib/core/bff/hash.js +1 -1
  234. package/lib/core/bff/lock.js +1 -1
  235. package/lib/core/bff/utils.d.ts +3 -1
  236. package/lib/core/bff/utils.js +1 -1
  237. package/lib/core/db-resolver.js +1 -1
  238. package/lib/core/page/file-system.js +1 -1
  239. package/lib/core/page/hash.js +1 -1
  240. package/lib/core/page/lock.js +1 -1
  241. package/lib/core/sql-index-auditor.js +1 -1
  242. package/lib/core/sql-sync/config.js +1 -1
  243. package/lib/core/sql-sync/file-system.js +1 -1
  244. package/lib/core/sql-sync/hash.js +1 -1
  245. package/lib/core/sql-sync/lock.js +1 -1
  246. package/lib/core/sql-sync/utils.js +1 -1
  247. package/lib/core/sql-validator.js +1 -1
  248. package/lib/errors.js +1 -1
  249. package/lib/framework/build-all-flags.js +1 -1
  250. package/lib/framework/error-output.js +1 -1
  251. package/lib/framework/explicit-yes.js +1 -1
  252. package/lib/framework/flags.js +1 -1
  253. package/lib/framework/help.js +1 -1
  254. package/lib/framework/index.js +1 -1
  255. package/lib/framework/output.js +1 -1
  256. package/lib/framework/response.js +1 -1
  257. package/lib/framework/runner-alias.js +1 -1
  258. package/lib/framework/runner.js +1 -1
  259. package/lib/framework/schema-export.js +1 -1
  260. package/lib/framework/types.js +1 -1
  261. package/lib/generated/build-info.d.ts +4 -4
  262. package/lib/generated/build-info.js +1 -1
  263. package/lib/help.js +1 -1
  264. package/lib/postinstall.js +1 -1
  265. package/lib/runtime/confirmation.js +1 -1
  266. package/lib/runtime/event.js +1 -1
  267. package/lib/runtime/index.js +1 -1
  268. package/lib/runtime/queue.js +1 -1
  269. package/lib/runtime/resolve.js +1 -1
  270. package/lib/skills/builtin-skill.js +1 -1
  271. package/lib/skills/main.js +1 -1
  272. package/lib/skills/npx-skills-add.js +1 -1
  273. package/lib/skills/skill-presence.js +1 -1
  274. package/lib/telemetry/cli-command-trace.js +1 -1
  275. package/lib/telemetry/cli-help-trace.js +1 -1
  276. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  277. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  278. package/lib/telemetry/send-cli-trace-log.js +1 -1
  279. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  280. package/lib/utils/ai_config.js +1 -1
  281. package/lib/utils/apply-jq-filter.js +1 -1
  282. package/lib/utils/cdn-config.js +1 -1
  283. package/lib/utils/check-sdk-version.js +1 -1
  284. package/lib/utils/cli-version-check.js +1 -1
  285. package/lib/utils/cli-version-policy.js +1 -1
  286. package/lib/utils/config.js +1 -1
  287. package/lib/utils/entity-with-id.js +1 -1
  288. package/lib/utils/file-utils.js +1 -1
  289. package/lib/utils/guides-cdn.js +1 -1
  290. package/lib/utils/http-client.js +1 -1
  291. package/lib/utils/is-non-interactive.js +1 -1
  292. package/lib/utils/logger.js +1 -1
  293. package/lib/utils/params.js +1 -1
  294. package/lib/utils/platform.js +1 -1
  295. package/lib/utils/rules-cdn.js +1 -1
  296. package/lib/utils/sleep.js +1 -1
  297. package/lib/utils/template-replacer.js +1 -1
  298. package/lib/utils/update-notice.js +1 -1
  299. package/lib/utils/version.js +1 -1
  300. package/lib/utils/with-active-cookie.js +1 -1
  301. package/lib/utils/write-cli-side-channel.js +1 -1
  302. package/package.json +1 -1
  303. package/skills/rabetbase/SKILL.md +34 -34
  304. package/skills/rabetbase/guides/backend-function.md +63 -18
  305. package/skills/rabetbase/guides/bff-creation-workflow.md +2 -0
  306. package/skills/rabetbase/guides/{react-custom-page-workflow.md → custom-page-workflow.md} +45 -45
  307. package/skills/rabetbase/guides/page-development-workflow.md +22 -22
  308. package/skills/rabetbase/knowledge/{react-page → custom-page}/components.md +2 -2
  309. package/skills/rabetbase/knowledge/{react-page → custom-page}/generation-standards.md +6 -6
  310. package/skills/rabetbase/knowledge/page-schema/LrSmartTable.md +6 -6
  311. package/skills/rabetbase/knowledge/page-schema/external-resources-usage.md +1 -1
  312. package/skills/rabetbase/references/rabetbase-bff-create.md +2 -0
  313. package/skills/rabetbase/references/{rabetbase-standard-page-status.md → rabetbase-data-list-status.md} +6 -6
  314. package/skills/rabetbase/references/rabetbase-dataset-generate.md +1 -1
  315. package/skills/rabetbase/references/rabetbase-dataset-relation-mutations.md +1 -1
  316. package/skills/rabetbase/references/rabetbase-dataset-relations.md +1 -1
  317. package/skills/rabetbase/references/rabetbase-dataset-restore.md +1 -1
  318. package/skills/rabetbase/references/rabetbase-menu-list.md +1 -1
  319. package/skills/rabetbase/references/rabetbase-page-create.md +31 -0
  320. package/skills/rabetbase/references/{rabetbase-page-react-detail.md → rabetbase-page-custom-detail.md} +5 -5
  321. package/skills/rabetbase/references/{rabetbase-page-react-list.md → rabetbase-page-custom-list.md} +4 -4
  322. package/skills/rabetbase/references/{rabetbase-page-react-publish.md → rabetbase-page-custom-publish.md} +6 -6
  323. package/skills/rabetbase/references/{rabetbase-page-react-update.md → rabetbase-page-custom-update.md} +6 -6
  324. package/skills/rabetbase/references/rabetbase-page-generate-start.md +5 -4
  325. package/skills/rabetbase/references/rabetbase-page-generate-status.md +4 -4
  326. package/skills/rabetbase/references/rabetbase-page-pull.md +2 -2
  327. package/skills/rabetbase/references/rabetbase-page-relation-binding.md +1 -1
  328. package/skills/rabetbase/references/rabetbase-page-restore.md +7 -7
  329. package/skills/rabetbase/references/rabetbase-page-sync.md +3 -3
  330. package/skills/rabetbase.manifest.json +12 -12
  331. package/lib/commands/page/react/create.d.ts +0 -2
  332. package/lib/commands/page/react/create.js +0 -1
  333. package/lib/commands/page/react/detail.js +0 -1
  334. package/lib/commands/page/react/list.js +0 -1
  335. package/lib/commands/page/react/publish.js +0 -1
  336. package/lib/commands/page/react/shared.js +0 -1
  337. package/lib/commands/page/react/syntax.js +0 -1
  338. package/lib/commands/page/react/template.js +0 -1
  339. package/lib/commands/page/react/update.js +0 -1
  340. package/lib/commands/page/standard-page-status.js +0 -1
  341. package/skills/rabetbase/references/rabetbase-page-react-create.md +0 -29
  342. /package/lib/commands/page/{react → custom}/template.d.ts +0 -0
@@ -1 +1 @@
1
- const a191_0x445a58=a191_0x5960;(function(_0x446792,_0x132c10){const _0x54faaf=a191_0x5960,_0x928946=_0x446792();while(!![]){try{const _0x47aa6c=parseInt(_0x54faaf(0x1ed))/0x1*(-parseInt(_0x54faaf(0x1dd))/0x2)+-parseInt(_0x54faaf(0x1c6))/0x3+parseInt(_0x54faaf(0x1ba))/0x4*(parseInt(_0x54faaf(0x1ee))/0x5)+parseInt(_0x54faaf(0x1d2))/0x6*(parseInt(_0x54faaf(0x1c2))/0x7)+-parseInt(_0x54faaf(0x1df))/0x8*(-parseInt(_0x54faaf(0x1b1))/0x9)+parseInt(_0x54faaf(0x1d1))/0xa+-parseInt(_0x54faaf(0x1b2))/0xb;if(_0x47aa6c===_0x132c10)break;else _0x928946['push'](_0x928946['shift']());}catch(_0x5b3e0b){_0x928946['push'](_0x928946['shift']());}}}(a191_0x19c2,0x62b15));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';function a191_0x5960(_0x126de7,_0x3443b1){_0x126de7=_0x126de7-0x1ab;const _0x19c235=a191_0x19c2();let _0x59608c=_0x19c235[_0x126de7];return _0x59608c;}import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x102d4e,_0x470bef,_0x1757c3){const _0x29540b=a191_0x5960,_0x5c46d6=await scanLocalSqlQueries(_0x102d4e),_0x5070ec=new Map();for(const _0x22f8e0 of _0x5c46d6){if(_0x1757c3&&_0x22f8e0[_0x29540b(0x1ea)]!==_0x1757c3)continue;const _0x1a73da=_0x5070ec['get'](_0x22f8e0[_0x29540b(0x1ea)])??[];_0x1a73da['push'](_0x22f8e0),_0x5070ec[_0x29540b(0x1c3)](_0x22f8e0['sqlCode'],_0x1a73da);}if(_0x1757c3&&!_0x5070ec[_0x29540b(0x1e2)](_0x1757c3))throw CliErrors[_0x29540b(0x1e4)](_0x29540b(0x1b3)+_0x1757c3);const _0x5572ef=[];for(const [_0x1fb43d,_0x15c68e]of _0x5070ec[_0x29540b(0x1eb)]()){if(_0x15c68e['length']===0x1){_0x5572ef[_0x29540b(0x1cd)](_0x15c68e[0x0]);continue;}const _0x223e5b=_0x470bef[_0x29540b(0x1ef)][_0x1fb43d],_0x3310e6=_0x223e5b?.[_0x29540b(0x1b5)],_0x4080eb=_0x3310e6?_0x15c68e[_0x29540b(0x1ac)](_0x5e0a69=>_0x5e0a69[_0x29540b(0x1d6)]!==_0x3310e6):_0x15c68e;if(_0x223e5b&&_0x4080eb[_0x29540b(0x1c1)]===0x1){_0x5572ef[_0x29540b(0x1cd)](_0x4080eb[0x0]);continue;}throw CliErrors[_0x29540b(0x1e4)](_0x29540b(0x1ab)+_0x1fb43d+_0x29540b(0x1d4));}return _0x5572ef;}export const sqlPush={'service':a191_0x445a58(0x1cb),'command':a191_0x445a58(0x1cd),'description':'Push\x20local\x20SQL\x20files\x20to\x20remote','risk':a191_0x445a58(0x1ca),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':'force','type':a191_0x445a58(0x1b9),'description':a191_0x445a58(0x1ae)}],async 'dryRun'(_0x343567){const _0xd9946a=a191_0x445a58,_0x19fd5b=loadSqlProjectConfig(_0x343567[_0xd9946a(0x1d0)]),_0x3abd2c=await readSqlLockFile(_0x19fd5b[_0xd9946a(0x1c7)]),{appLock:_0x128f4b}=ensureSqlLockScope(_0x3abd2c??createEmptySqlLock(),_0x343567[_0xd9946a(0x1d0)],_0x19fd5b[_0xd9946a(0x1d9)],_0xd9946a(0x1cd)),_0x6e6ada=await getTargetSqlQueries(_0x19fd5b,_0x128f4b,_0x343567[_0xd9946a(0x1b4)](_0xd9946a(0x1c8))||undefined),_0x59deb2=[];for(const _0x8028d3 of _0x6e6ada){const _0x97b16f=await computeSqlFileHash(_0x8028d3[_0xd9946a(0x1da)]),_0x15d8c1=_0x128f4b['sqls'][_0x8028d3[_0xd9946a(0x1ea)]],_0x18c675=!!_0x15d8c1&&(_0x15d8c1[_0xd9946a(0x1b5)]!==_0x8028d3['relativePath']||!!_0x8028d3[_0xd9946a(0x1e1)]&&_0x15d8c1[_0xd9946a(0x1e1)]!==_0x8028d3[_0xd9946a(0x1e1)]);if(!_0x343567[_0xd9946a(0x1c9)](_0xd9946a(0x1cc))&&_0x15d8c1&&_0x15d8c1[_0xd9946a(0x1ec)]===_0x97b16f&&!_0x18c675)continue;_0x59deb2[_0xd9946a(0x1cd)](_0x8028d3['sqlCode']);}return{'method':_0xd9946a(0x1e7),'url':_0xd9946a(0x1e8),'body':{'sqlCodes':_0x59deb2,'appCode':_0x343567[_0xd9946a(0x1d0)]},'description':_0xd9946a(0x1b6)+_0x59deb2[_0xd9946a(0x1c1)]+_0xd9946a(0x1bd)};},async 'execute'(_0x23e476){const _0x35d804=a191_0x445a58,_0x1d5c32=loadSqlProjectConfig(_0x23e476['appCode']),_0x3b33db=await readSqlLockFile(_0x1d5c32['lockFilePath']),{lockData:_0x270c11,appLock:_0x173a63}=ensureSqlLockScope(_0x3b33db??createEmptySqlLock(),_0x23e476[_0x35d804(0x1d0)],_0x1d5c32[_0x35d804(0x1d9)],_0x35d804(0x1cd)),_0x1a2f76=await getTargetSqlQueries(_0x1d5c32,_0x173a63,_0x23e476['str']('sqlcode')||undefined);if(_0x1a2f76[_0x35d804(0x1c1)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x35d804(0x1c4)};const _0x6eeb4e=[],_0x1a28b3=[],_0x561048=[];for(const _0xd646ab of _0x1a2f76){const _0x534851=_0x173a63['sqls'][_0xd646ab['sqlCode']];if(!_0x534851){_0x561048[_0x35d804(0x1cd)]({'sqlCode':_0xd646ab[_0x35d804(0x1ea)],'error':_0x35d804(0x1c5)});continue;}try{const _0x22486a=await computeSqlFileHash(_0xd646ab[_0x35d804(0x1da)]),_0x3e7fa6=_0x534851[_0x35d804(0x1b5)]!==_0xd646ab[_0x35d804(0x1d6)]||!!_0xd646ab['sqlName']&&_0x534851[_0x35d804(0x1e1)]!==_0xd646ab[_0x35d804(0x1e1)];if(!_0x23e476[_0x35d804(0x1c9)](_0x35d804(0x1cc))&&_0x534851[_0x35d804(0x1ec)]===_0x22486a&&!_0x3e7fa6){_0x1a28b3['push']({'sqlCode':_0xd646ab[_0x35d804(0x1ea)],'reason':_0x35d804(0x1af)});continue;}if(_0x534851[_0x35d804(0x1e0)]==null){_0x561048[_0x35d804(0x1cd)]({'sqlCode':_0xd646ab[_0x35d804(0x1ea)],'error':'missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first'});continue;}const _0x12c5ab=await readFile(_0xd646ab[_0x35d804(0x1da)],_0x35d804(0x1de)),_0x5def3a=stripLocalSqlMetadata(_0x12c5ab,_0xd646ab['mode']),_0x26d1b3=_0xd646ab[_0x35d804(0x1e1)]||_0x534851[_0x35d804(0x1e1)],_0x2c5f10=await resolveTargetDbBinding(_0x23e476[_0x35d804(0x1d0)],_0xd646ab,_0x534851),_0x10a802=await updateSqlQuery({'id':_0x534851[_0x35d804(0x1d3)],'appCode':_0x23e476[_0x35d804(0x1d0)],'sqlCode':_0xd646ab['sqlCode'],'sqlName':_0x26d1b3,'dbId':_0x2c5f10[_0x35d804(0x1d5)],'version':_0x534851['version'],'sqlContent':_0x5def3a,'sqlConfig':_0x534851[_0x35d804(0x1e5)]??undefined}),_0x5b34ef=_0x10a802['dbId']?await getDbName(_0x23e476['appCode'],Number(_0x10a802['dbId']))['catch'](()=>_0x2c5f10[_0x35d804(0x1b0)]):_0x2c5f10['dbName'];_0x173a63[_0x35d804(0x1ef)][_0xd646ab[_0x35d804(0x1ea)]]={...buildSqlLockEntry(_0x10a802,_0x5def3a,_0x22486a,{'dbName':_0x5b34ef}),'path':_0xd646ab['relativePath'],'mode':_0x534851[_0x35d804(0x1ce)]},await archivePreviousSqlFileIfNeeded(_0x1d5c32,_0x534851[_0x35d804(0x1b5)],_0xd646ab[_0x35d804(0x1d6)]),_0x6eeb4e[_0x35d804(0x1cd)]({'sqlCode':_0xd646ab[_0x35d804(0x1ea)],'remoteId':_0x534851['remoteId']});}catch(_0x2f49a0){_0x561048[_0x35d804(0x1cd)]({'sqlCode':_0xd646ab[_0x35d804(0x1ea)],'error':_0x2f49a0 instanceof Error?_0x2f49a0[_0x35d804(0x1f0)]:String(_0x2f49a0)});}}return _0x173a63[_0x35d804(0x1cf)]=new Date()[_0x35d804(0x1bf)](),await writeSqlLockFile(_0x1d5c32[_0x35d804(0x1c7)],_0x270c11),{'ok':_0x561048['length']===0x0,'data':{'pushed':_0x6eeb4e,'skipped':_0x1a28b3,'failed':_0x561048},'message':_0x35d804(0x1c0)+_0x6eeb4e[_0x35d804(0x1c1)]+_0x35d804(0x1f1)+_0x1a28b3[_0x35d804(0x1c1)]+_0x35d804(0x1e6)+_0x561048[_0x35d804(0x1c1)]+'\x20failed'};}};async function archivePreviousSqlFileIfNeeded(_0x2d4db9,_0x43a7a4,_0xf0d7c1){const _0x206bcd=a191_0x445a58;if(!_0x43a7a4||_0x43a7a4===_0xf0d7c1)return;const _0x550b75=join(_0x2d4db9['sqlRootDir'],_0x43a7a4);if(!await fileExists(_0x550b75))return;const _0x53a5b9=await moveToTrash(_0x2d4db9['projectRoot'],_0x2d4db9[_0x206bcd(0x1dc)],_0x550b75);await cleanupEmptyDirectories(dirname(_0x550b75),_0x2d4db9[_0x206bcd(0x1bc)]),void _0x53a5b9;}async function moveToTrash(_0x4b0bd6,_0x8f60d0,_0x1976fe){const _0x4743a3=a191_0x445a58,_0x3c9f6d=new Date()[_0x4743a3(0x1bf)]()[_0x4743a3(0x1b7)](/[:.]/g,'-'),_0x43b2df=relative(_0x4b0bd6,_0x1976fe),_0x202c14=join(_0x8f60d0,_0x3c9f6d,_0x43b2df);return await mkdir(dirname(_0x202c14),{'recursive':!![]}),await rename(_0x1976fe,_0x202c14),_0x202c14;}function a191_0x19c2(){const _0x518b5c=['.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','dbId','relativePath','map','exec','sqlRoot','filePath','Local\x20directory\x20\x22','trashDir','1696VBeobr','utf8','272Abqemw','version','sqlName','has','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','validation','sqlConfig','\x20skipped,\x20','POST','/smartapi/custom/updateUserCustomSql','\x22\x20for\x20sqlCode\x20','sqlCode','entries','hash','21iYtIQt','259085fhsTOQ','sqls','message','\x20pushed,\x20','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','filter','isFinite','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','unchanged','dbName','102519YSKXOp','17319665uKvIwf','Local\x20SQL\x20not\x20found:\x20','str','path','Would\x20push\x20','replace','No\x20database\x20matches\x20local\x20directory\x20\x22','boolean','44RnRnUr','join','sqlRootDir','\x20SQL\x20file(s)','dbDirectory','toISOString','Push\x20complete:\x20','length','14zeOcOw','set','No\x20local\x20SQL\x20files\x20found.','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','30159AGUnxP','lockFilePath','sqlcode','bool','write','sql','force','push','mode','lastSync','appCode','5900900LVTIeB','1377750aMnrdW','remoteId'];a191_0x19c2=function(){return _0x518b5c;};return a191_0x19c2();}async function cleanupEmptyDirectories(_0x2c1acc,_0x127fd5){let _0x4e6f01=resolve(_0x2c1acc);const _0x57269c=resolve(_0x127fd5);while(_0x4e6f01['startsWith'](''+_0x57269c+sep)||_0x4e6f01===_0x57269c){if(_0x4e6f01===_0x57269c)return;try{const _0x2969f5=await readdir(_0x4e6f01);if(_0x2969f5['length']>0x0)return;await rmdir(_0x4e6f01);}catch{return;}_0x4e6f01=dirname(_0x4e6f01);}}async function resolveTargetDbBinding(_0x5dd1eb,_0x6245a,_0x34ef27){const _0x28dd48=a191_0x445a58,_0x149913=_0x6245a[_0x28dd48(0x1be)];if(!_0x149913)return{'dbId':_0x34ef27[_0x28dd48(0x1d5)],'dbName':_0x34ef27[_0x28dd48(0x1b0)]};const _0xfea5c8=buildDbDirectoryName(_0x34ef27[_0x28dd48(0x1b0)],_0x34ef27[_0x28dd48(0x1d5)]);if(_0x149913===_0xfea5c8)return{'dbId':_0x34ef27[_0x28dd48(0x1d5)],'dbName':_0x34ef27[_0x28dd48(0x1b0)]};const _0x115dfd=parseExplicitDbDirectory(_0x149913);if(_0x115dfd!=null)return{'dbId':_0x115dfd,'dbName':await getDbName(_0x5dd1eb,_0x115dfd)['catch'](()=>undefined)};const _0x1c8d6e=await listDatabases(_0x5dd1eb),_0x2f9cdb=_0x1c8d6e[_0x28dd48(0x1ac)](_0x2c7e29=>buildDbDirectoryName(_0x2c7e29[_0x28dd48(0x1b0)],_0x2c7e29[_0x28dd48(0x1d5)])===_0x149913);if(_0x2f9cdb[_0x28dd48(0x1c1)]===0x1)return{'dbId':_0x2f9cdb[0x0][_0x28dd48(0x1d5)],'dbName':_0x2f9cdb[0x0][_0x28dd48(0x1b0)]};if(_0x2f9cdb['length']===0x0)throw CliErrors[_0x28dd48(0x1e4)](_0x28dd48(0x1b8)+_0x149913+_0x28dd48(0x1e9)+_0x6245a[_0x28dd48(0x1ea)]+'.');const _0x147e47=_0x2f9cdb[_0x28dd48(0x1d7)](_0x166e3d=>_0x166e3d[_0x28dd48(0x1b0)]+'\x20('+_0x166e3d[_0x28dd48(0x1d5)]+')')[_0x28dd48(0x1bb)](',\x20');throw CliErrors[_0x28dd48(0x1e4)](_0x28dd48(0x1db)+_0x149913+_0x28dd48(0x1e3)+_0x6245a[_0x28dd48(0x1ea)]+':\x20'+_0x147e47);}function parseExplicitDbDirectory(_0xe45f6f){const _0x37683a=a191_0x445a58,_0x2d4cca=/^db-(\d+)$/[_0x37683a(0x1d8)](_0xe45f6f);if(!_0x2d4cca)return null;const _0x1e1ae4=Number(_0x2d4cca[0x1]);return Number[_0x37683a(0x1ad)](_0x1e1ae4)&&_0x1e1ae4>0x0?_0x1e1ae4:null;}
1
+ function a191_0x4b71(_0x5321ff,_0x5f5d45){_0x5321ff=_0x5321ff-0x14c;const _0x5ea0b7=a191_0x5ea0();let _0x4b714a=_0x5ea0b7[_0x5321ff];return _0x4b714a;}function a191_0x5ea0(){const _0x1d1a95=['appCode','162jlknFw','\x22\x20for\x20sqlCode\x20','boolean','relativePath','Would\x20push\x20','utf8','write','hash','lastSync','Push\x20complete:\x20','validation','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','sqlName','6038560HrwNIT','6BWsYHB','468618adjOCj','dbDirectory','version','dbName','unchanged','message','sqlRoot','Local\x20directory\x20\x22','sql','Push\x20local\x20SQL\x20files\x20to\x20remote','5214604Dioiyy','\x20SQL\x20file(s)','str','\x20skipped,\x20','catch','remoteId','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','push','Local\x20SQL\x20not\x20found:\x20','dbId','\x20failed','5829875EnnDrY','has','1312787IYVtlo','No\x20database\x20matches\x20local\x20directory\x20\x22','/smartapi/custom/updateUserCustomSql','440jXNZoh','length','48141CHAuyr','mode','sqlcode','join','force','trashDir','No\x20local\x20SQL\x20files\x20found.','sqlRootDir','toISOString','\x20pushed,\x20','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','set','lockFilePath','sqlConfig','path','projectRoot','sqls','POST','bool','sqlCode','5963LrjYac','filePath','startsWith'];a191_0x5ea0=function(){return _0x1d1a95;};return a191_0x5ea0();}const a191_0x30e32f=a191_0x4b71;(function(_0x3c9cc0,_0x51ea80){const _0x551015=a191_0x4b71,_0x3ec9cc=_0x3c9cc0();while(!![]){try{const _0x511544=parseInt(_0x551015(0x14c))/0x1*(-parseInt(_0x551015(0x150))/0x2)+-parseInt(_0x551015(0x15f))/0x3+parseInt(_0x551015(0x169))/0x4+parseInt(_0x551015(0x174))/0x5*(-parseInt(_0x551015(0x15e))/0x6)+parseInt(_0x551015(0x176))/0x7+parseInt(_0x551015(0x15d))/0x8+-parseInt(_0x551015(0x17b))/0x9*(-parseInt(_0x551015(0x179))/0xa);if(_0x511544===_0x51ea80)break;else _0x3ec9cc['push'](_0x3ec9cc['shift']());}catch(_0x13b981){_0x3ec9cc['push'](_0x3ec9cc['shift']());}}}(a191_0x5ea0,0xa5158));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x18768b,_0x52fcce,_0x3346b2){const _0x1d76fe=a191_0x4b71,_0x905c75=await scanLocalSqlQueries(_0x18768b),_0xcd198c=new Map();for(const _0x2d25c7 of _0x905c75){if(_0x3346b2&&_0x2d25c7[_0x1d76fe(0x18e)]!==_0x3346b2)continue;const _0x1f19fa=_0xcd198c['get'](_0x2d25c7[_0x1d76fe(0x18e)])??[];_0x1f19fa['push'](_0x2d25c7),_0xcd198c[_0x1d76fe(0x186)](_0x2d25c7[_0x1d76fe(0x18e)],_0x1f19fa);}if(_0x3346b2&&!_0xcd198c[_0x1d76fe(0x175)](_0x3346b2))throw CliErrors[_0x1d76fe(0x15a)](_0x1d76fe(0x171)+_0x3346b2);const _0x48d6ac=[];for(const [_0x398820,_0x165f65]of _0xcd198c['entries']()){if(_0x165f65[_0x1d76fe(0x17a)]===0x1){_0x48d6ac[_0x1d76fe(0x170)](_0x165f65[0x0]);continue;}const _0x1c57ac=_0x52fcce[_0x1d76fe(0x18b)][_0x398820],_0xffa7d2=_0x1c57ac?.[_0x1d76fe(0x189)],_0x4eaedf=_0xffa7d2?_0x165f65['filter'](_0x5535c9=>_0x5535c9[_0x1d76fe(0x153)]!==_0xffa7d2):_0x165f65;if(_0x1c57ac&&_0x4eaedf[_0x1d76fe(0x17a)]===0x1){_0x48d6ac[_0x1d76fe(0x170)](_0x4eaedf[0x0]);continue;}throw CliErrors[_0x1d76fe(0x15a)]('Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20'+_0x398820+'.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.');}return _0x48d6ac;}export const sqlPush={'service':a191_0x30e32f(0x167),'command':a191_0x30e32f(0x170),'description':a191_0x30e32f(0x168),'risk':a191_0x30e32f(0x156),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a191_0x30e32f(0x17f),'type':a191_0x30e32f(0x152),'description':a191_0x30e32f(0x16f)}],async 'dryRun'(_0x5e340e){const _0x4fe06a=a191_0x30e32f,_0x5b1e08=loadSqlProjectConfig(_0x5e340e[_0x4fe06a(0x14f)]),_0x38f2ae=await readSqlLockFile(_0x5b1e08['lockFilePath']),{appLock:_0x1d3ff6}=ensureSqlLockScope(_0x38f2ae??createEmptySqlLock(),_0x5e340e['appCode'],_0x5b1e08[_0x4fe06a(0x165)],_0x4fe06a(0x170)),_0x2d593c=await getTargetSqlQueries(_0x5b1e08,_0x1d3ff6,_0x5e340e[_0x4fe06a(0x16b)](_0x4fe06a(0x17d))||undefined),_0x5ea96e=[];for(const _0x35efbd of _0x2d593c){const _0x27c453=await computeSqlFileHash(_0x35efbd[_0x4fe06a(0x14d)]),_0xe419fd=_0x1d3ff6[_0x4fe06a(0x18b)][_0x35efbd[_0x4fe06a(0x18e)]],_0x1aaffc=!!_0xe419fd&&(_0xe419fd[_0x4fe06a(0x189)]!==_0x35efbd[_0x4fe06a(0x153)]||!!_0x35efbd[_0x4fe06a(0x15c)]&&_0xe419fd[_0x4fe06a(0x15c)]!==_0x35efbd['sqlName']);if(!_0x5e340e['bool'](_0x4fe06a(0x17f))&&_0xe419fd&&_0xe419fd['hash']===_0x27c453&&!_0x1aaffc)continue;_0x5ea96e['push'](_0x35efbd[_0x4fe06a(0x18e)]);}return{'method':_0x4fe06a(0x18c),'url':_0x4fe06a(0x178),'body':{'sqlCodes':_0x5ea96e,'appCode':_0x5e340e[_0x4fe06a(0x14f)]},'description':_0x4fe06a(0x154)+_0x5ea96e['length']+_0x4fe06a(0x16a)};},async 'execute'(_0x2bda13){const _0x4acfda=a191_0x30e32f,_0x3ba4de=loadSqlProjectConfig(_0x2bda13[_0x4acfda(0x14f)]),_0x42248c=await readSqlLockFile(_0x3ba4de[_0x4acfda(0x187)]),{lockData:_0x314930,appLock:_0x12d267}=ensureSqlLockScope(_0x42248c??createEmptySqlLock(),_0x2bda13[_0x4acfda(0x14f)],_0x3ba4de['sqlRoot'],_0x4acfda(0x170)),_0x2f0986=await getTargetSqlQueries(_0x3ba4de,_0x12d267,_0x2bda13[_0x4acfda(0x16b)](_0x4acfda(0x17d))||undefined);if(_0x2f0986[_0x4acfda(0x17a)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x4acfda(0x181)};const _0x3719db=[],_0x123713=[],_0x52024d=[];for(const _0x506003 of _0x2f0986){const _0x50eac7=_0x12d267[_0x4acfda(0x18b)][_0x506003['sqlCode']];if(!_0x50eac7){_0x52024d[_0x4acfda(0x170)]({'sqlCode':_0x506003[_0x4acfda(0x18e)],'error':_0x4acfda(0x15b)});continue;}try{const _0x1dc0de=await computeSqlFileHash(_0x506003['filePath']),_0x4484cc=_0x50eac7['path']!==_0x506003[_0x4acfda(0x153)]||!!_0x506003['sqlName']&&_0x50eac7['sqlName']!==_0x506003[_0x4acfda(0x15c)];if(!_0x2bda13[_0x4acfda(0x18d)]('force')&&_0x50eac7[_0x4acfda(0x157)]===_0x1dc0de&&!_0x4484cc){_0x123713['push']({'sqlCode':_0x506003[_0x4acfda(0x18e)],'reason':_0x4acfda(0x163)});continue;}if(_0x50eac7[_0x4acfda(0x161)]==null){_0x52024d[_0x4acfda(0x170)]({'sqlCode':_0x506003[_0x4acfda(0x18e)],'error':'missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first'});continue;}const _0x5d2a77=await readFile(_0x506003['filePath'],_0x4acfda(0x155)),_0x377407=stripLocalSqlMetadata(_0x5d2a77,_0x506003[_0x4acfda(0x17c)]),_0x1f1f14=_0x506003[_0x4acfda(0x15c)]||_0x50eac7['sqlName'],_0x15244e=await resolveTargetDbBinding(_0x2bda13[_0x4acfda(0x14f)],_0x506003,_0x50eac7),_0x493f13=await updateSqlQuery({'id':_0x50eac7['remoteId'],'appCode':_0x2bda13['appCode'],'sqlCode':_0x506003[_0x4acfda(0x18e)],'sqlName':_0x1f1f14,'dbId':_0x15244e[_0x4acfda(0x172)],'version':_0x50eac7[_0x4acfda(0x161)],'sqlContent':_0x377407,'sqlConfig':_0x50eac7[_0x4acfda(0x188)]??undefined}),_0x585b9c=_0x493f13[_0x4acfda(0x172)]?await getDbName(_0x2bda13[_0x4acfda(0x14f)],Number(_0x493f13[_0x4acfda(0x172)]))[_0x4acfda(0x16d)](()=>_0x15244e[_0x4acfda(0x162)]):_0x15244e['dbName'];_0x12d267['sqls'][_0x506003[_0x4acfda(0x18e)]]={...buildSqlLockEntry(_0x493f13,_0x377407,_0x1dc0de,{'dbName':_0x585b9c}),'path':_0x506003[_0x4acfda(0x153)],'mode':_0x50eac7[_0x4acfda(0x17c)]},await archivePreviousSqlFileIfNeeded(_0x3ba4de,_0x50eac7[_0x4acfda(0x189)],_0x506003['relativePath']),_0x3719db[_0x4acfda(0x170)]({'sqlCode':_0x506003[_0x4acfda(0x18e)],'remoteId':_0x50eac7[_0x4acfda(0x16e)]});}catch(_0x5a36f0){_0x52024d[_0x4acfda(0x170)]({'sqlCode':_0x506003[_0x4acfda(0x18e)],'error':_0x5a36f0 instanceof Error?_0x5a36f0[_0x4acfda(0x164)]:String(_0x5a36f0)});}}return _0x12d267[_0x4acfda(0x158)]=new Date()[_0x4acfda(0x183)](),await writeSqlLockFile(_0x3ba4de[_0x4acfda(0x187)],_0x314930),{'ok':_0x52024d[_0x4acfda(0x17a)]===0x0,'data':{'pushed':_0x3719db,'skipped':_0x123713,'failed':_0x52024d},'message':_0x4acfda(0x159)+_0x3719db[_0x4acfda(0x17a)]+_0x4acfda(0x184)+_0x123713[_0x4acfda(0x17a)]+_0x4acfda(0x16c)+_0x52024d[_0x4acfda(0x17a)]+_0x4acfda(0x173)};}};async function archivePreviousSqlFileIfNeeded(_0x1edb9c,_0x41d3e5,_0x5d892a){const _0x3912b7=a191_0x30e32f;if(!_0x41d3e5||_0x41d3e5===_0x5d892a)return;const _0x167735=join(_0x1edb9c[_0x3912b7(0x182)],_0x41d3e5);if(!await fileExists(_0x167735))return;const _0x1d4850=await moveToTrash(_0x1edb9c[_0x3912b7(0x18a)],_0x1edb9c[_0x3912b7(0x180)],_0x167735);await cleanupEmptyDirectories(dirname(_0x167735),_0x1edb9c[_0x3912b7(0x182)]),void _0x1d4850;}async function moveToTrash(_0xde4e3f,_0x2c7532,_0xcc153f){const _0x1545da=a191_0x30e32f,_0x9f7303=new Date()[_0x1545da(0x183)]()['replace'](/[:.]/g,'-'),_0x1a0cbe=relative(_0xde4e3f,_0xcc153f),_0x1de6d5=join(_0x2c7532,_0x9f7303,_0x1a0cbe);return await mkdir(dirname(_0x1de6d5),{'recursive':!![]}),await rename(_0xcc153f,_0x1de6d5),_0x1de6d5;}async function cleanupEmptyDirectories(_0x5418ce,_0xde6996){const _0x4c3bbd=a191_0x30e32f;let _0x4cefe9=resolve(_0x5418ce);const _0xfaaa5e=resolve(_0xde6996);while(_0x4cefe9[_0x4c3bbd(0x14e)](''+_0xfaaa5e+sep)||_0x4cefe9===_0xfaaa5e){if(_0x4cefe9===_0xfaaa5e)return;try{const _0x1f56d3=await readdir(_0x4cefe9);if(_0x1f56d3['length']>0x0)return;await rmdir(_0x4cefe9);}catch{return;}_0x4cefe9=dirname(_0x4cefe9);}}async function resolveTargetDbBinding(_0x5e4fcd,_0x5ebc9b,_0x3c9772){const _0xcd4a95=a191_0x30e32f,_0x1bce3d=_0x5ebc9b[_0xcd4a95(0x160)];if(!_0x1bce3d)return{'dbId':_0x3c9772[_0xcd4a95(0x172)],'dbName':_0x3c9772[_0xcd4a95(0x162)]};const _0x128ae2=buildDbDirectoryName(_0x3c9772[_0xcd4a95(0x162)],_0x3c9772[_0xcd4a95(0x172)]);if(_0x1bce3d===_0x128ae2)return{'dbId':_0x3c9772[_0xcd4a95(0x172)],'dbName':_0x3c9772[_0xcd4a95(0x162)]};const _0x3b4954=parseExplicitDbDirectory(_0x1bce3d);if(_0x3b4954!=null)return{'dbId':_0x3b4954,'dbName':await getDbName(_0x5e4fcd,_0x3b4954)[_0xcd4a95(0x16d)](()=>undefined)};const _0x3506a8=await listDatabases(_0x5e4fcd),_0x2ed114=_0x3506a8['filter'](_0x496b84=>buildDbDirectoryName(_0x496b84[_0xcd4a95(0x162)],_0x496b84['dbId'])===_0x1bce3d);if(_0x2ed114[_0xcd4a95(0x17a)]===0x1)return{'dbId':_0x2ed114[0x0][_0xcd4a95(0x172)],'dbName':_0x2ed114[0x0][_0xcd4a95(0x162)]};if(_0x2ed114[_0xcd4a95(0x17a)]===0x0)throw CliErrors[_0xcd4a95(0x15a)](_0xcd4a95(0x177)+_0x1bce3d+_0xcd4a95(0x151)+_0x5ebc9b[_0xcd4a95(0x18e)]+'.');const _0x2670db=_0x2ed114['map'](_0x2e6304=>_0x2e6304[_0xcd4a95(0x162)]+'\x20('+_0x2e6304[_0xcd4a95(0x172)]+')')[_0xcd4a95(0x17e)](',\x20');throw CliErrors[_0xcd4a95(0x15a)](_0xcd4a95(0x166)+_0x1bce3d+_0xcd4a95(0x185)+_0x5ebc9b[_0xcd4a95(0x18e)]+':\x20'+_0x2670db);}function parseExplicitDbDirectory(_0x16eaab){const _0x5a446e=/^db-(\d+)$/['exec'](_0x16eaab);if(!_0x5a446e)return null;const _0x5de6a6=Number(_0x5a446e[0x1]);return Number['isFinite'](_0x5de6a6)&&_0x5de6a6>0x0?_0x5de6a6:null;}
@@ -1 +1 @@
1
- (function(_0xe45b9c,_0x24d27d){const _0x1a2a10=a192_0x16c7,_0x54f3e2=_0xe45b9c();while(!![]){try{const _0x24c913=parseInt(_0x1a2a10(0x127))/0x1*(parseInt(_0x1a2a10(0x134))/0x2)+-parseInt(_0x1a2a10(0x13c))/0x3*(parseInt(_0x1a2a10(0x11a))/0x4)+parseInt(_0x1a2a10(0x12f))/0x5*(-parseInt(_0x1a2a10(0x131))/0x6)+-parseInt(_0x1a2a10(0x13a))/0x7+parseInt(_0x1a2a10(0x11c))/0x8+parseInt(_0x1a2a10(0x125))/0x9+parseInt(_0x1a2a10(0x12e))/0xa*(parseInt(_0x1a2a10(0x11b))/0xb);if(_0x24c913===_0x24d27d)break;else _0x54f3e2['push'](_0x54f3e2['shift']());}catch(_0x73d1be){_0x54f3e2['push'](_0x54f3e2['shift']());}}}(a192_0x5481,0xceae9));import{createInterface}from'node:readline';import{join}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';export const SQL_LOCAL_REL_DIR='.rabetbase/sql';function a192_0x16c7(_0x53a0aa,_0x501423){_0x53a0aa=_0x53a0aa-0x110;const _0x548139=a192_0x5481();let _0x16c73e=_0x548139[_0x53a0aa];return _0x16c73e;}function a192_0x5481(){const _0x4f7498=['2rWozSP','sqlName','sqlContent','mode','dbName','mybatisXml','6121962cIAhpK','apps','118977Udbuhs','path','stdin','yes','syncedAt','close','description','lastSync','includes','sqls','sqlCode','104GcVQwd','25219634BCQBrp','2995144DkcZmD','trim','entries','test','map','trimStart','\x20[y/N]\x20','sqlConfig','split','7963578tPnwBR','endsWith','550931EWEotC','filter','length','--\x20@lovrabet.','fromEntries','dbId','push','10cVZJxa','613905wLqfJL','sqlRoot','66mPAmwV','stderr','join'];a192_0x5481=function(){return _0x4f7498;};return a192_0x5481();}export function buildSqlLockEntry(_0x4bde7b,_0x194960,_0x12f177,_0x5d5e88){const _0x56b56a=a192_0x16c7,_0x2080a0=detectSqlMode(_0x194960);return{'path':buildSqlRelativePath(_0x4bde7b[_0x56b56a(0x119)],_0x4bde7b[_0x56b56a(0x135)],_0x5d5e88?.[_0x56b56a(0x138)],_0x2080a0,_0x4bde7b[_0x56b56a(0x12c)]),'hash':_0x12f177,'remoteId':_0x4bde7b['id'],'version':_0x4bde7b['version'],'dbId':Number(_0x4bde7b['dbId']),'dbName':_0x5d5e88?.[_0x56b56a(0x138)],'sqlName':_0x4bde7b[_0x56b56a(0x135)],'sqlConfig':_0x4bde7b[_0x56b56a(0x123)]??undefined,'mode':_0x2080a0};}export function cloneSqlLockData(_0xa28cc8){const _0xaa9680=a192_0x16c7;return{'apps':Object[_0xaa9680(0x12b)](Object[_0xaa9680(0x11e)](_0xa28cc8[_0xaa9680(0x13b)])[_0xaa9680(0x120)](([_0x27b6b,_0x400118])=>[_0x27b6b,{'sqlRoot':_0x400118[_0xaa9680(0x130)],'lastSync':_0x400118[_0xaa9680(0x116)],'sqls':{..._0x400118[_0xaa9680(0x118)]}}]))};}export function ensureRemoteSqlContent(_0x3e466c){const _0xcd3b6b=a192_0x16c7;return _0x3e466c[_0xcd3b6b(0x136)]??'';}export function buildLocalSqlFileContent(_0x10c68a,_0x1ba8d8,_0x2fae74){const _0x2ddf2e=a192_0x16c7,_0x2ad335=_0x2fae74?.[_0x2ddf2e(0x137)]??detectSqlMode(_0x1ba8d8),_0x1bbe7d=stripLocalSqlMetadata(_0x1ba8d8,_0x2ad335)[_0x2ddf2e(0x11d)](),_0x2e8c2c=[...buildMetadataHeaderLines({'sqlCode':_0x10c68a['sqlCode'],'sqlName':_0x10c68a[_0x2ddf2e(0x135)],'dbId':_0x10c68a[_0x2ddf2e(0x12c)],'dbName':_0x2fae74?.[_0x2ddf2e(0x138)],'mode':_0x2ad335,'syncedAt':_0x2fae74?.[_0x2ddf2e(0x113)],'description':_0x2fae74?.[_0x2ddf2e(0x115)]},_0x2ad335),'',_0x1bbe7d],_0x587547=_0x2e8c2c[_0x2ddf2e(0x133)]('\x0a');return _0x587547[_0x2ddf2e(0x126)]('\x0a')?_0x587547:_0x587547+'\x0a';}export function stripLocalSqlMetadata(_0x722588,_0x5cd4c5){const _0x3444e9=a192_0x16c7,_0x432613=_0x722588['replace'](/\r\n/g,'\x0a')[_0x3444e9(0x124)]('\x0a'),_0x258f4d=[];let _0x2225bb=0x0;if(_0x5cd4c5==='mybatisXml')while(_0x2225bb<_0x432613[_0x3444e9(0x129)]){const _0x40a19d=_0x432613[_0x2225bb]??'';if(/^\s*<!--\s*@lovrabet\./['test'](_0x40a19d)){_0x2225bb++;continue;}if(_0x40a19d[_0x3444e9(0x11d)]()===''&&_0x2225bb>0x0){_0x2225bb++;continue;}break;}else while(_0x2225bb<_0x432613[_0x3444e9(0x129)]){const _0x3db748=_0x432613[_0x2225bb]??'';if(/^\s*--\s*@lovrabet\./[_0x3444e9(0x11f)](_0x3db748)){_0x2225bb++;continue;}if(_0x3db748[_0x3444e9(0x11d)]()===''&&_0x2225bb>0x0){_0x2225bb++;continue;}break;}for(;_0x2225bb<_0x432613['length'];_0x2225bb++){_0x258f4d[_0x3444e9(0x12d)](_0x432613[_0x2225bb]);}return _0x258f4d['join']('\x0a')[_0x3444e9(0x121)]();}export function resolveSqlMode(_0x5dd49c,_0x368da5){const _0x4c0261=a192_0x16c7;if(_0x368da5?.[_0x4c0261(0x137)])return _0x368da5[_0x4c0261(0x137)];return detectSqlMode(_0x5dd49c);}export function resolveSqlFileName(_0x18b434,_0x550028,_0x32e61a){const _0x37a390=a192_0x16c7;if(_0x32e61a?.[_0x37a390(0x110)])return _0x32e61a[_0x37a390(0x110)];if(_0x32e61a?.[_0x37a390(0x135)]||_0x32e61a?.[_0x37a390(0x138)])return buildSqlRelativePath(_0x18b434,_0x32e61a?.[_0x37a390(0x135)],_0x32e61a?.['dbName'],resolveSqlMode(_0x550028,_0x32e61a),_0x32e61a?.['dbId']);return buildDefaultSqlFileName(_0x18b434,resolveSqlMode(_0x550028,_0x32e61a));}export function resolveSqlLocalDir(_0x418f8e,_0x1196f0){return join(_0x418f8e,SQL_LOCAL_REL_DIR,_0x1196f0);}export async function confirmForceOverwrite(_0x1be92d){const _0x18222a=a192_0x16c7,_0x5e3e72=createInterface({'input':process[_0x18222a(0x111)],'output':process[_0x18222a(0x132)]}),_0x13c987=await new Promise(_0x3ea5cc=>{const _0x53c81f=_0x18222a;_0x5e3e72['question'](_0x1be92d+_0x53c81f(0x122),_0x3ea5cc);});return _0x5e3e72[_0x18222a(0x114)](),['y',_0x18222a(0x112)][_0x18222a(0x117)](_0x13c987[_0x18222a(0x11d)]()['toLowerCase']());}export function findSqlLockScope(_0x12da49,_0x4aef32){const _0x3bf873=a192_0x16c7;return _0x12da49[_0x3bf873(0x13b)][_0x4aef32];}function buildMetadataHeaderLines(_0xbff397,_0x51330a){const _0x11c2a4=a192_0x16c7,_0x2ed238=[['sqlCode',_0xbff397[_0x11c2a4(0x119)]],[_0x11c2a4(0x135),_0xbff397['sqlName']],[_0x11c2a4(0x12c),_0xbff397[_0x11c2a4(0x12c)]],[_0x11c2a4(0x138),_0xbff397['dbName']],[_0x11c2a4(0x137),_0xbff397[_0x11c2a4(0x137)]],['syncedAt',_0xbff397['syncedAt']],[_0x11c2a4(0x115),_0xbff397['description']]];if(_0x51330a===_0x11c2a4(0x139))return _0x2ed238[_0x11c2a4(0x128)](([,_0x5b8061])=>_0x5b8061!==undefined&&_0x5b8061!==null&&String(_0x5b8061)[_0x11c2a4(0x11d)]()!=='')[_0x11c2a4(0x120)](([_0x1b836c,_0x3cc4d8])=>'<!--\x20@lovrabet.'+_0x1b836c+':\x20'+String(_0x3cc4d8)+'\x20-->');return _0x2ed238[_0x11c2a4(0x128)](([,_0x3c549b])=>_0x3c549b!==undefined&&_0x3c549b!==null&&String(_0x3c549b)[_0x11c2a4(0x11d)]()!=='')['map'](([_0x111607,_0x342271])=>_0x11c2a4(0x12a)+_0x111607+':\x20'+String(_0x342271));}
1
+ const a192_0x4444b0=a192_0x1fd2;(function(_0x3e0a69,_0x19a5b8){const _0x38aa58=a192_0x1fd2,_0x5888bc=_0x3e0a69();while(!![]){try{const _0x303696=-parseInt(_0x38aa58(0x108))/0x1*(-parseInt(_0x38aa58(0x11d))/0x2)+-parseInt(_0x38aa58(0x101))/0x3+-parseInt(_0x38aa58(0x102))/0x4+parseInt(_0x38aa58(0x122))/0x5+parseInt(_0x38aa58(0x113))/0x6+parseInt(_0x38aa58(0x123))/0x7*(-parseInt(_0x38aa58(0x111))/0x8)+parseInt(_0x38aa58(0x109))/0x9;if(_0x303696===_0x19a5b8)break;else _0x5888bc['push'](_0x5888bc['shift']());}catch(_0x2bc66c){_0x5888bc['push'](_0x5888bc['shift']());}}}(a192_0x45ce,0xbc028));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=a192_0x4444b0(0x128);export function buildSqlLockEntry(_0x3b98fd,_0x20b148,_0x3e0298,_0x3e3dc7){const _0x2474c8=a192_0x4444b0,_0x1974ba=detectSqlMode(_0x20b148);return{'path':buildSqlRelativePath(_0x3b98fd[_0x2474c8(0x112)],_0x3b98fd['sqlName'],_0x3e3dc7?.[_0x2474c8(0xff)],_0x1974ba,_0x3b98fd[_0x2474c8(0x126)]),'hash':_0x3e0298,'remoteId':_0x3b98fd['id'],'version':_0x3b98fd['version'],'dbId':Number(_0x3b98fd[_0x2474c8(0x126)]),'dbName':_0x3e3dc7?.['dbName'],'sqlName':_0x3b98fd[_0x2474c8(0x107)],'sqlConfig':_0x3b98fd[_0x2474c8(0x10e)]??undefined,'mode':_0x1974ba};}function a192_0x45ce(){const _0xebc481=['1204200issjcv','sqlContent','map','--\x20@lovrabet.','\x20[y/N]\x20','push','sqls','yes','length','path','116828AketKe','question','sqlRoot','trim','replace','5340040lbMcVi','14lYGkRi','trimStart','stderr','dbId','test','.rabetbase/sql','dbName','syncedAt','1605831xNpoXq','3824524yMUIzT','<!--\x20@lovrabet.','mybatisXml','apps','filter','sqlName','4sHypWO','20670822oQEzge','entries','split','\x20-->','description','sqlConfig','lastSync','mode','6150504IkOyqr','sqlCode'];a192_0x45ce=function(){return _0xebc481;};return a192_0x45ce();}export function cloneSqlLockData(_0x5ba7ff){const _0x3822fc=a192_0x4444b0;return{'apps':Object['fromEntries'](Object[_0x3822fc(0x10a)](_0x5ba7ff[_0x3822fc(0x105)])[_0x3822fc(0x115)](([_0x187fe7,_0x531641])=>[_0x187fe7,{'sqlRoot':_0x531641[_0x3822fc(0x11f)],'lastSync':_0x531641[_0x3822fc(0x10f)],'sqls':{..._0x531641[_0x3822fc(0x119)]}}]))};}export function ensureRemoteSqlContent(_0x3d608f){const _0x5570be=a192_0x4444b0;return _0x3d608f[_0x5570be(0x114)]??'';}export function buildLocalSqlFileContent(_0x11667c,_0x444be4,_0x35bacd){const _0x4ea140=a192_0x4444b0,_0x1699f8=_0x35bacd?.[_0x4ea140(0x110)]??detectSqlMode(_0x444be4),_0x432da3=stripLocalSqlMetadata(_0x444be4,_0x1699f8)[_0x4ea140(0x120)](),_0x372445=[...buildMetadataHeaderLines({'sqlCode':_0x11667c[_0x4ea140(0x112)],'sqlName':_0x11667c[_0x4ea140(0x107)],'dbId':_0x11667c[_0x4ea140(0x126)],'dbName':_0x35bacd?.[_0x4ea140(0xff)],'mode':_0x1699f8,'syncedAt':_0x35bacd?.[_0x4ea140(0x100)],'description':_0x35bacd?.[_0x4ea140(0x10d)]},_0x1699f8),'',_0x432da3],_0x445375=_0x372445['join']('\x0a');return _0x445375['endsWith']('\x0a')?_0x445375:_0x445375+'\x0a';}export function stripLocalSqlMetadata(_0x1da141,_0x142c30){const _0x427df8=a192_0x4444b0,_0x3b5c93=_0x1da141[_0x427df8(0x121)](/\r\n/g,'\x0a')[_0x427df8(0x10b)]('\x0a'),_0x537fe0=[];let _0xbfe10c=0x0;if(_0x142c30===_0x427df8(0x104))while(_0xbfe10c<_0x3b5c93[_0x427df8(0x11b)]){const _0x5257b2=_0x3b5c93[_0xbfe10c]??'';if(/^\s*<!--\s*@lovrabet\./[_0x427df8(0x127)](_0x5257b2)){_0xbfe10c++;continue;}if(_0x5257b2['trim']()===''&&_0xbfe10c>0x0){_0xbfe10c++;continue;}break;}else while(_0xbfe10c<_0x3b5c93['length']){const _0x1d33b7=_0x3b5c93[_0xbfe10c]??'';if(/^\s*--\s*@lovrabet\./['test'](_0x1d33b7)){_0xbfe10c++;continue;}if(_0x1d33b7[_0x427df8(0x120)]()===''&&_0xbfe10c>0x0){_0xbfe10c++;continue;}break;}for(;_0xbfe10c<_0x3b5c93['length'];_0xbfe10c++){_0x537fe0[_0x427df8(0x118)](_0x3b5c93[_0xbfe10c]);}return _0x537fe0['join']('\x0a')[_0x427df8(0x124)]();}export function resolveSqlMode(_0x1b0b44,_0x1cbb47){const _0x3d65e5=a192_0x4444b0;if(_0x1cbb47?.[_0x3d65e5(0x110)])return _0x1cbb47[_0x3d65e5(0x110)];return detectSqlMode(_0x1b0b44);}export function resolveSqlFileName(_0x7f103e,_0x2a9ac5,_0x329778){const _0x3c554e=a192_0x4444b0;if(_0x329778?.[_0x3c554e(0x11c)])return _0x329778['path'];if(_0x329778?.[_0x3c554e(0x107)]||_0x329778?.[_0x3c554e(0xff)])return buildSqlRelativePath(_0x7f103e,_0x329778?.[_0x3c554e(0x107)],_0x329778?.[_0x3c554e(0xff)],resolveSqlMode(_0x2a9ac5,_0x329778),_0x329778?.[_0x3c554e(0x126)]);return buildDefaultSqlFileName(_0x7f103e,resolveSqlMode(_0x2a9ac5,_0x329778));}export function resolveSqlLocalDir(_0x2ece77,_0x4cd61c){return join(_0x2ece77,SQL_LOCAL_REL_DIR,_0x4cd61c);}export async function confirmForceOverwrite(_0x420436){const _0x1dfe0c=a192_0x4444b0,_0x49bed5=createInterface({'input':process['stdin'],'output':process[_0x1dfe0c(0x125)]}),_0x51cf6a=await new Promise(_0x30980c=>{const _0x1fe33d=_0x1dfe0c;_0x49bed5[_0x1fe33d(0x11e)](_0x420436+_0x1fe33d(0x117),_0x30980c);});return _0x49bed5['close'](),['y',_0x1dfe0c(0x11a)]['includes'](_0x51cf6a['trim']()['toLowerCase']());}export function findSqlLockScope(_0x444dcd,_0x471d7c){const _0x34a940=a192_0x4444b0;return _0x444dcd[_0x34a940(0x105)][_0x471d7c];}function a192_0x1fd2(_0x23d9db,_0x1f523f){_0x23d9db=_0x23d9db-0xff;const _0x45ce97=a192_0x45ce();let _0x1fd243=_0x45ce97[_0x23d9db];return _0x1fd243;}function buildMetadataHeaderLines(_0x12e247,_0x4639b0){const _0x10c012=a192_0x4444b0,_0x2ca6af=[['sqlCode',_0x12e247[_0x10c012(0x112)]],[_0x10c012(0x107),_0x12e247[_0x10c012(0x107)]],['dbId',_0x12e247[_0x10c012(0x126)]],[_0x10c012(0xff),_0x12e247[_0x10c012(0xff)]],[_0x10c012(0x110),_0x12e247[_0x10c012(0x110)]],[_0x10c012(0x100),_0x12e247[_0x10c012(0x100)]],[_0x10c012(0x10d),_0x12e247[_0x10c012(0x10d)]]];if(_0x4639b0===_0x10c012(0x104))return _0x2ca6af[_0x10c012(0x106)](([,_0x391ea3])=>_0x391ea3!==undefined&&_0x391ea3!==null&&String(_0x391ea3)[_0x10c012(0x120)]()!=='')['map'](([_0x2fd910,_0x5121a4])=>_0x10c012(0x103)+_0x2fd910+':\x20'+String(_0x5121a4)+_0x10c012(0x10c));return _0x2ca6af[_0x10c012(0x106)](([,_0xc8c4e5])=>_0xc8c4e5!==undefined&&_0xc8c4e5!==null&&String(_0xc8c4e5)[_0x10c012(0x120)]()!=='')[_0x10c012(0x115)](([_0x352190,_0x566170])=>_0x10c012(0x116)+_0x352190+':\x20'+String(_0x566170));}
@@ -1 +1 @@
1
- const a193_0x1ca1c1=a193_0x5948;(function(_0x1de720,_0x1fee27){const _0x2c5df4=a193_0x5948,_0x2f242b=_0x1de720();while(!![]){try{const _0x1d4698=parseInt(_0x2c5df4(0xc9))/0x1*(-parseInt(_0x2c5df4(0xe3))/0x2)+-parseInt(_0x2c5df4(0xdf))/0x3*(-parseInt(_0x2c5df4(0xdd))/0x4)+parseInt(_0x2c5df4(0xc7))/0x5*(-parseInt(_0x2c5df4(0xe2))/0x6)+parseInt(_0x2c5df4(0xdb))/0x7+parseInt(_0x2c5df4(0xe5))/0x8+-parseInt(_0x2c5df4(0xca))/0x9*(-parseInt(_0x2c5df4(0xd0))/0xa)+-parseInt(_0x2c5df4(0xd6))/0xb;if(_0x1d4698===_0x1fee27)break;else _0x2f242b['push'](_0x2f242b['shift']());}catch(_0x243380){_0x2f242b['push'](_0x2f242b['shift']());}}}(a193_0x3ad7,0x4033f));import{listSqlQueries}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';function a193_0x5948(_0xc1bcde,_0x319c85){_0xc1bcde=_0xc1bcde-0xc2;const _0x3ad734=a193_0x3ad7();let _0x594801=_0x3ad734[_0xc1bcde];return _0x594801;}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(_0x1fa17c){const _0xf741d7=a193_0x5948,_0x4195bd=[];let _0x53d4f8=0x1;while(!![]){const _0x10f10b=await listSqlQueries(_0x1fa17c,{'currentPage':_0x53d4f8,'pageSize':PAGE_SIZE}),_0x383d71=_0x10f10b[_0xf741d7(0xd4)]??[];_0x4195bd[_0xf741d7(0xe6)](..._0x383d71[_0xf741d7(0xcc)](_0xdedd95=>_0xdedd95[_0xf741d7(0xc4)]));if(_0x383d71[_0xf741d7(0xe0)]===0x0)break;const _0x905e02=_0x10f10b[_0xf741d7(0xe1)]?.[_0xf741d7(0xc2)];if(_0x905e02!=null?_0x4195bd[_0xf741d7(0xe0)]>=_0x905e02:_0x383d71[_0xf741d7(0xe0)]<PAGE_SIZE)break;_0x53d4f8++;}return _0x4195bd;}function a193_0x3ad7(){const _0x4ed731=['8349440unKbbo','\x20missing,\x20','has','\x20added,\x20','lockKey','1306935uMmvra','\x20modified,\x20','3148fvbUnZ','lockFilePath','1770VckNBj','length','paging','12zOBhAW','804986HSdEmz','sqlRoot','2176616ZreOnk','push','totalCount','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','sqlCode','appCode','sqlName','34060eTftnJ','remote','1ZwhsVe','99WqAJoJ','All\x20SQL\x20queries\x20are\x20in\x20sync.','map','\x20remote-only','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','hash','468200jJMPzQ','status','sqls','filePath','tableData','boolean'];a193_0x3ad7=function(){return _0x4ed731;};return a193_0x3ad7();}export const sqlStatus={'service':'sql','command':'status','description':a193_0x1ca1c1(0xc3),'risk':'read','flags':[{'name':a193_0x1ca1c1(0xc8),'type':a193_0x1ca1c1(0xd5),'description':a193_0x1ca1c1(0xce)}],async 'execute'(_0x572a3e){const _0x32e47a=a193_0x1ca1c1,_0x5006a7=loadSqlProjectConfig(_0x572a3e[_0x32e47a(0xc5)]),_0x31439b=await readSqlLockFile(_0x5006a7[_0x32e47a(0xde)]),{appLock:_0x2d0a35}=ensureSqlLockScope(_0x31439b??createEmptySqlLock(),_0x5006a7[_0x32e47a(0xc5)],_0x5006a7[_0x32e47a(0xe4)],_0x32e47a(0xd1)),_0x52143e=await scanLocalSqlQueries(_0x5006a7),_0x329b89=[],_0x4bd31d=[],_0x6852a9=[],_0x388750=[],_0x2ad0e9=new Set(_0x52143e['map'](_0x22a77e=>_0x22a77e[_0x32e47a(0xda)]));for(const _0x4b78d4 of _0x52143e){const _0x26d34b=await computeSqlFileHash(_0x4b78d4[_0x32e47a(0xd3)]),_0x5d8977=_0x2d0a35[_0x32e47a(0xd2)][_0x4b78d4['lockKey']],_0x23ee04=!!_0x5d8977&&_0x5d8977['path']!==_0x4b78d4['relativePath'],_0x40d89d=!!_0x5d8977&&!!_0x4b78d4[_0x32e47a(0xc6)]&&_0x5d8977[_0x32e47a(0xc6)]!==_0x4b78d4[_0x32e47a(0xc6)];if(!_0x5d8977)_0x329b89[_0x32e47a(0xe6)](_0x4b78d4[_0x32e47a(0xda)]);else _0x5d8977[_0x32e47a(0xcf)]!==_0x26d34b||_0x23ee04||_0x40d89d?_0x4bd31d[_0x32e47a(0xe6)](_0x4b78d4['lockKey']):_0x6852a9[_0x32e47a(0xe6)](_0x4b78d4[_0x32e47a(0xda)]);}for(const _0x5b193e of Object['keys'](_0x2d0a35['sqls'])){!_0x2ad0e9[_0x32e47a(0xd8)](_0x5b193e)&&_0x388750[_0x32e47a(0xe6)](_0x5b193e);}const _0x51d296=[];if(_0x572a3e['bool'](_0x32e47a(0xc8))){const _0x50d14b=await fetchAllSqlCodes(_0x572a3e[_0x32e47a(0xc5)]);for(const _0x51943b of _0x50d14b){!_0x2ad0e9[_0x32e47a(0xd8)](_0x51943b)&&!_0x2d0a35[_0x32e47a(0xd2)][_0x51943b]&&_0x51d296['push'](_0x51943b);}}const _0x283f7f=_0x329b89[_0x32e47a(0xe0)]===0x0&&_0x4bd31d[_0x32e47a(0xe0)]===0x0&&_0x388750[_0x32e47a(0xe0)]===0x0&&_0x51d296[_0x32e47a(0xe0)]===0x0;return{'ok':!![],'data':{'added':_0x329b89,'modified':_0x4bd31d,'missing':_0x388750,'unchanged':_0x6852a9,'remoteOnly':_0x51d296},'message':_0x283f7f?_0x32e47a(0xcb):_0x329b89[_0x32e47a(0xe0)]+_0x32e47a(0xd9)+_0x4bd31d[_0x32e47a(0xe0)]+_0x32e47a(0xdc)+_0x388750[_0x32e47a(0xe0)]+_0x32e47a(0xd7)+_0x6852a9['length']+'\x20unchanged'+(_0x51d296[_0x32e47a(0xe0)]>0x0?',\x20'+_0x51d296[_0x32e47a(0xe0)]+_0x32e47a(0xcd):'')};}};
1
+ const a193_0x571bed=a193_0x14b3;(function(_0xe9a421,_0x39ddb3){const _0x4a25c0=a193_0x14b3,_0xbc43d8=_0xe9a421();while(!![]){try{const _0x3f6458=-parseInt(_0x4a25c0(0xd4))/0x1*(-parseInt(_0x4a25c0(0xca))/0x2)+parseInt(_0x4a25c0(0xdb))/0x3*(parseInt(_0x4a25c0(0xe2))/0x4)+-parseInt(_0x4a25c0(0xda))/0x5*(-parseInt(_0x4a25c0(0xd2))/0x6)+parseInt(_0x4a25c0(0xdc))/0x7*(parseInt(_0x4a25c0(0xd9))/0x8)+-parseInt(_0x4a25c0(0xdf))/0x9+-parseInt(_0x4a25c0(0xd6))/0xa*(-parseInt(_0x4a25c0(0xe6))/0xb)+parseInt(_0x4a25c0(0xd5))/0xc*(-parseInt(_0x4a25c0(0xde))/0xd);if(_0x3f6458===_0x39ddb3)break;else _0xbc43d8['push'](_0xbc43d8['shift']());}catch(_0x2fbaed){_0xbc43d8['push'](_0xbc43d8['shift']());}}}(a193_0x89c6,0x6e9ba));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;function a193_0x14b3(_0x111e1f,_0x46295b){_0x111e1f=_0x111e1f-0xc2;const _0x89c647=a193_0x89c6();let _0x14b34c=_0x89c647[_0x111e1f];return _0x14b34c;}async function fetchAllSqlCodes(_0x4534a2){const _0x588c96=a193_0x14b3,_0x58d3a7=[];let _0x18547d=0x1;while(!![]){const _0x194182=await listSqlQueries(_0x4534a2,{'currentPage':_0x18547d,'pageSize':PAGE_SIZE}),_0x54f93c=_0x194182[_0x588c96(0xe0)]??[];_0x58d3a7[_0x588c96(0xe3)](..._0x54f93c[_0x588c96(0xc9)](_0x48642b=>_0x48642b['sqlCode']));if(_0x54f93c[_0x588c96(0xc2)]===0x0)break;const _0xe561fc=_0x194182[_0x588c96(0xcb)]?.[_0x588c96(0xd3)];if(_0xe561fc!=null?_0x58d3a7['length']>=_0xe561fc:_0x54f93c[_0x588c96(0xc2)]<PAGE_SIZE)break;_0x18547d++;}return _0x58d3a7;}export const sqlStatus={'service':'sql','command':a193_0x571bed(0xe9),'description':a193_0x571bed(0xd8),'risk':a193_0x571bed(0xcf),'flags':[{'name':a193_0x571bed(0xd7),'type':'boolean','description':a193_0x571bed(0xc4)}],async 'execute'(_0x281291){const _0x545850=a193_0x571bed,_0x173678=loadSqlProjectConfig(_0x281291[_0x545850(0xdd)]),_0x51a6d7=await readSqlLockFile(_0x173678[_0x545850(0xe4)]),{appLock:_0xdc4fbb}=ensureSqlLockScope(_0x51a6d7??createEmptySqlLock(),_0x173678[_0x545850(0xdd)],_0x173678[_0x545850(0xc3)],_0x545850(0xe9)),_0x5cc53d=await scanLocalSqlQueries(_0x173678),_0x788e5b=[],_0x1ccadf=[],_0x12f554=[],_0x5d3a60=[],_0xa29c62=new Set(_0x5cc53d[_0x545850(0xc9)](_0x55d6c7=>_0x55d6c7[_0x545850(0xe7)]));for(const _0x1dab18 of _0x5cc53d){const _0x14f012=await computeSqlFileHash(_0x1dab18[_0x545850(0xcc)]),_0x3b2021=_0xdc4fbb[_0x545850(0xc7)][_0x1dab18[_0x545850(0xe7)]],_0x4596b7=!!_0x3b2021&&_0x3b2021[_0x545850(0xc8)]!==_0x1dab18[_0x545850(0xe1)],_0x2d10e6=!!_0x3b2021&&!!_0x1dab18[_0x545850(0xc5)]&&_0x3b2021[_0x545850(0xc5)]!==_0x1dab18[_0x545850(0xc5)];if(!_0x3b2021)_0x788e5b[_0x545850(0xe3)](_0x1dab18[_0x545850(0xe7)]);else _0x3b2021[_0x545850(0xc6)]!==_0x14f012||_0x4596b7||_0x2d10e6?_0x1ccadf['push'](_0x1dab18['lockKey']):_0x12f554[_0x545850(0xe3)](_0x1dab18[_0x545850(0xe7)]);}for(const _0xff23a1 of Object[_0x545850(0xe5)](_0xdc4fbb[_0x545850(0xc7)])){!_0xa29c62[_0x545850(0xcd)](_0xff23a1)&&_0x5d3a60[_0x545850(0xe3)](_0xff23a1);}const _0x13c416=[];if(_0x281291[_0x545850(0xce)]('remote')){const _0x1ee9f6=await fetchAllSqlCodes(_0x281291[_0x545850(0xdd)]);for(const _0x4ed0be of _0x1ee9f6){!_0xa29c62['has'](_0x4ed0be)&&!_0xdc4fbb['sqls'][_0x4ed0be]&&_0x13c416[_0x545850(0xe3)](_0x4ed0be);}}const _0x4d205e=_0x788e5b[_0x545850(0xc2)]===0x0&&_0x1ccadf['length']===0x0&&_0x5d3a60[_0x545850(0xc2)]===0x0&&_0x13c416['length']===0x0;return{'ok':!![],'data':{'added':_0x788e5b,'modified':_0x1ccadf,'missing':_0x5d3a60,'unchanged':_0x12f554,'remoteOnly':_0x13c416},'message':_0x4d205e?_0x545850(0xd1):_0x788e5b[_0x545850(0xc2)]+_0x545850(0xe8)+_0x1ccadf[_0x545850(0xc2)]+_0x545850(0xd0)+_0x5d3a60[_0x545850(0xc2)]+'\x20missing,\x20'+_0x12f554['length']+'\x20unchanged'+(_0x13c416['length']>0x0?',\x20'+_0x13c416[_0x545850(0xc2)]+'\x20remote-only':'')};}};function a193_0x89c6(){const _0x1603bb=['55fzHGwa','86001IWUFdx','553tFNOvT','appCode','143MBtsxB','109818raQlEy','tableData','relativePath','92eqFJGF','push','lockFilePath','keys','3847767bEZbQZ','lockKey','\x20added,\x20','status','length','sqlRoot','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','sqlName','hash','sqls','path','map','1717834NRZnWT','paging','filePath','has','bool','read','\x20modified,\x20','All\x20SQL\x20queries\x20are\x20in\x20sync.','272958PqQNbu','totalCount','1fOQcmc','2661852fRqqJG','10UVnGSZ','remote','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','54360GwyGmM'];a193_0x89c6=function(){return _0x1603bb;};return a193_0x89c6();}
@@ -1 +1 @@
1
- const a194_0x2210d3=a194_0x1bd1;(function(_0x3da535,_0x2c6320){const _0x327c55=a194_0x1bd1,_0x30abd5=_0x3da535();while(!![]){try{const _0x355d29=parseInt(_0x327c55(0x148))/0x1+parseInt(_0x327c55(0x15c))/0x2+-parseInt(_0x327c55(0x167))/0x3+-parseInt(_0x327c55(0x14c))/0x4*(-parseInt(_0x327c55(0x159))/0x5)+parseInt(_0x327c55(0x152))/0x6*(-parseInt(_0x327c55(0x15b))/0x7)+parseInt(_0x327c55(0x15d))/0x8+parseInt(_0x327c55(0x144))/0x9*(-parseInt(_0x327c55(0x13e))/0xa);if(_0x355d29===_0x2c6320)break;else _0x30abd5['push'](_0x30abd5['shift']());}catch(_0x5d9ed5){_0x30abd5['push'](_0x30abd5['shift']());}}}(a194_0x26f8,0xca1b1));function a194_0x26f8(){const _0x30eb1a=['Audit\x20top-level\x20JOIN\x20equality\x20predicates\x20against\x20dataset\x20index\x20metadata','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','flagMissing','push','Provide\x20--file\x20or\x20--sql','schema:','indexes','200eTfYhI','schemas','parameters','map','sqlType','pkField','120816eZDdye','Dataset\x20\x22','dbtableConfig','isArray','511478iDuuIy','indexName','index_name','bool','44alJtXc','file','length','trim','message','flatMap','56004KAcovk','filter','size','dataset','--check-indexes\x20requires\x20--schemas.','tables','\x22\x20not\x20found\x20or\x20not\x20accessible','207300eiSnPr','index_columns','483QpDORH','1321746CFFDTb','10684056pvFzVV','Table\x20\x22','tableName','columns','string','index_type','utf-8','get','str','split','3670701VUStwV','read','unshift','reason','check-indexes','columnNames','type','isSelectOnly','toLowerCase','find','schemaWarnings','SQL\x20schema\x20validation','valid','File\x20not\x20found:\x20','isDangerous','validation','sql','name','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','\x22\x20not\x20found\x20in\x20any\x20dataset','validate','joinAudit','fields'];a194_0x26f8=function(){return _0x30eb1a;};return a194_0x26f8();}import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';function a194_0x1bd1(_0x4a5ec5,_0x58ad2f){_0x4a5ec5=_0x4a5ec5-0x122;const _0x26f8fc=a194_0x26f8();let _0x1bd13b=_0x26f8fc[_0x4a5ec5];return _0x1bd13b;}import{auditSqlJoinIndexes}from'../../core/sql-index-auditor.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{assertDatasetIsDbTableBacked,filterDbTableBackedDatasets}from'../../commands/dataset/capability.js';export const sqlValidate={'service':a194_0x2210d3(0x130),'command':a194_0x2210d3(0x134),'description':'Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','risk':a194_0x2210d3(0x168),'flags':[{'name':a194_0x2210d3(0x14d),'type':a194_0x2210d3(0x161),'description':a194_0x2210d3(0x132)},{'name':'sql','type':a194_0x2210d3(0x161),'description':a194_0x2210d3(0x138)},{'name':a194_0x2210d3(0x13f),'type':'string','description':'Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against'},{'name':a194_0x2210d3(0x124),'type':'boolean','description':a194_0x2210d3(0x137)}],async 'execute'(_0x24e13a){const _0x21a004=a194_0x2210d3,_0x2cce8c=_0x24e13a[_0x21a004(0x165)](_0x21a004(0x14d)),_0x423faa=_0x24e13a[_0x21a004(0x165)](_0x21a004(0x130)),_0xd97136=_0x24e13a['str'](_0x21a004(0x13f)),_0x1bddad=_0x24e13a[_0x21a004(0x14b)](_0x21a004(0x124));if(!_0x2cce8c&&!_0x423faa)throw CliErrors[_0x21a004(0x139)]('file',_0x21a004(0x13b));if(_0x1bddad&&!_0xd97136)throw CliErrors[_0x21a004(0x12f)](_0x21a004(0x156));let _0x414de5;if(_0x2cce8c){const _0x5aacdf=resolve(process['cwd'](),_0x2cce8c);if(!existsSync(_0x5aacdf))throw CliErrors[_0x21a004(0x12f)](_0x21a004(0x12d)+_0x5aacdf);_0x414de5=readFileSync(_0x5aacdf,_0x21a004(0x163));}else _0x414de5=_0x423faa;const _0xe873e6=validateSql(_0x414de5),_0x2fe89d={'valid':_0xe873e6[_0x21a004(0x12c)],'sqlType':_0xe873e6[_0x21a004(0x142)][_0x21a004(0x126)],'isSelectOnly':_0xe873e6[_0x21a004(0x142)][_0x21a004(0x127)],'isDangerous':_0xe873e6[_0x21a004(0x142)][_0x21a004(0x12e)],'tables':_0xe873e6['tables'],'parameters':_0xe873e6[_0x21a004(0x140)],'message':_0xe873e6['message']};_0xe873e6[_0x21a004(0x142)]['reason']&&(_0x2fe89d[_0x21a004(0x123)]=_0xe873e6[_0x21a004(0x142)]['reason']);if(_0xd97136&&_0xe873e6[_0x21a004(0x12c)]){const _0x2e3b34=_0xd97136[_0x21a004(0x166)](',')[_0x21a004(0x141)](_0x13a5dd=>_0x13a5dd[_0x21a004(0x14f)]())[_0x21a004(0x153)](Boolean),_0x495e39=[],_0x507d45=[],_0x2f3b2a=filterDbTableBackedDatasets(await listDatasets(_0x24e13a['appCode'])),_0x52e2a3=new Map(_0x2f3b2a[_0x21a004(0x141)](_0x3ff41e=>[_0x3ff41e['dbtableConfig']?.[_0x21a004(0x15f)]?.[_0x21a004(0x128)](),_0x3ff41e]));for(const _0xa38bb8 of _0xe873e6[_0x21a004(0x157)]){const _0x4be4f1=_0x52e2a3[_0x21a004(0x164)](_0xa38bb8['toLowerCase']());!_0x4be4f1&&_0x495e39[_0x21a004(0x13a)](_0x21a004(0x15e)+_0xa38bb8+_0x21a004(0x133));}for(const _0x2c220e of _0x2e3b34){let _0x52262b;try{_0x52262b=await getDatasetDetail(_0x2c220e);}catch{_0x495e39[_0x21a004(0x13a)](_0x21a004(0x145)+_0x2c220e+_0x21a004(0x158));continue;}assertDatasetIsDbTableBacked(_0x52262b,_0x21a004(0x12b));const _0x54092d=Array[_0x21a004(0x147)](_0x52262b[_0x21a004(0x136)])?_0x52262b[_0x21a004(0x136)]:[],_0x3ab62d=new Set(_0x54092d[_0x21a004(0x141)](_0x3fb517=>_0x3fb517[_0x21a004(0x131)]?.[_0x21a004(0x128)]())),_0x10c826=_0x52262b[_0x21a004(0x146)]?.[_0x21a004(0x15f)]||_0x52262b[_0x21a004(0x15f)]||_0x2c220e;_0x2fe89d[_0x21a004(0x13c)+_0x10c826]={'code':_0x2c220e,'tableName':_0x10c826,'fieldCount':_0x3ab62d[_0x21a004(0x154)],'fields':Array['from'](_0x3ab62d)};if(_0x1bddad){const _0x4b0786=normalizeDatasetIndexes(_0x52262b);_0x507d45['push']({'tableName':_0x10c826,..._0x4b0786});}}_0x495e39[_0x21a004(0x14e)]>0x0&&(_0x2fe89d[_0x21a004(0x12a)]=_0x495e39),_0x1bddad&&(_0x2fe89d[_0x21a004(0x135)]=auditSqlJoinIndexes(_0x414de5,_0x507d45));}return{'ok':_0xe873e6[_0x21a004(0x12c)],'data':_0x2fe89d,'message':_0xe873e6[_0x21a004(0x150)]};}};function normalizeDatasetIndexes(_0x2c0363){const _0x514712=a194_0x2210d3,_0x1311c7=Array[_0x514712(0x147)](_0x2c0363?.[_0x514712(0x155)]?.['indexes'])?_0x2c0363[_0x514712(0x155)]['indexes']:Array[_0x514712(0x147)](_0x2c0363?.[_0x514712(0x13d)])?_0x2c0363[_0x514712(0x13d)]:[],_0x219889=_0x1311c7[_0x514712(0x151)](_0x188842=>{const _0x5e9d99=_0x514712,_0x2b8daa=Array[_0x5e9d99(0x147)](_0x188842?.[_0x5e9d99(0x15a)])?_0x188842[_0x5e9d99(0x15a)]:Array[_0x5e9d99(0x147)](_0x188842?.[_0x5e9d99(0x125)])?_0x188842[_0x5e9d99(0x125)]:Array[_0x5e9d99(0x147)](_0x188842?.[_0x5e9d99(0x160)])?_0x188842[_0x5e9d99(0x160)]:[],_0xa97569=_0x2b8daa[_0x5e9d99(0x153)](_0x4b0335=>typeof _0x4b0335===_0x5e9d99(0x161))[_0x5e9d99(0x141)](_0x37e4df=>_0x37e4df[_0x5e9d99(0x14f)]())[_0x5e9d99(0x153)](Boolean);if(_0xa97569[_0x5e9d99(0x14e)]===0x0)return[];const _0xc766e=[_0x188842?.[_0x5e9d99(0x149)],_0x188842?.[_0x5e9d99(0x14a)],_0x188842?.[_0x5e9d99(0x131)]][_0x5e9d99(0x129)](_0x4d5ec1=>typeof _0x4d5ec1===_0x5e9d99(0x161)&&_0x4d5ec1[_0x5e9d99(0x14f)]()),_0x16549a=[_0x188842?.[_0x5e9d99(0x162)],_0x188842?.[_0x5e9d99(0x126)]][_0x5e9d99(0x129)](_0x1484d7=>typeof _0x1484d7===_0x5e9d99(0x161)&&_0x1484d7[_0x5e9d99(0x14f)]());return[{..._0xc766e?{'name':_0xc766e[_0x5e9d99(0x14f)]()}:{},..._0x16549a?{'type':_0x16549a[_0x5e9d99(0x14f)]()}:{},'columns':_0xa97569}];}),_0x22dcdb=[..._0x219889],_0x177374=typeof _0x2c0363?.[_0x514712(0x146)]?.[_0x514712(0x143)]===_0x514712(0x161)?_0x2c0363[_0x514712(0x146)]['pkField']['split'](',')[_0x514712(0x141)](_0xa97ca6=>_0xa97ca6[_0x514712(0x14f)]())[_0x514712(0x153)](Boolean):[];return _0x177374['length']>0x0&&_0x22dcdb[_0x514712(0x122)]({'type':'primary','columns':_0x177374}),{'indexes':_0x22dcdb,'metadataAvailable':_0x219889[_0x514712(0x14e)]>0x0};}
1
+ const a194_0x2030ad=a194_0x501e;function a194_0x59b4(){const _0x2b5749=['push','sql','read','find','fields','joinAudit','flatMap','schema:','reason','Provide\x20--file\x20or\x20--sql','30310qUzRAt','tables','toLowerCase','name','valid','map','--check-indexes\x20requires\x20--schemas.','File\x20not\x20found:\x20','716QZHYtB','2564580vctyIL','from','7645atuhpF','Dataset\x20\x22','bool','index_columns','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','primary','\x22\x20not\x20found\x20in\x20any\x20dataset','file','index_name','parameters','tableName','string','1234135wvpJgR','isDangerous','schemaWarnings','8HSOpgR','Audit\x20top-level\x20JOIN\x20equality\x20predicates\x20against\x20dataset\x20index\x20metadata','str','dataset','cwd','trim','validation','message','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','length','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','isArray','pkField','filter','check-indexes','get','261546fzxcUJ','dbtableConfig','split','SQL\x20schema\x20validation','schemas','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','isSelectOnly','3JiiAqy','\x22\x20not\x20found\x20or\x20not\x20accessible','8679yHwsGa','size','appCode','sqlType','5012973iOOPXT','type','indexes','4479965wjXcrU','validate','columns','unshift'];a194_0x59b4=function(){return _0x2b5749;};return a194_0x59b4();}(function(_0x44051a,_0x4f6281){const _0x37bb57=a194_0x501e,_0x53c815=_0x44051a();while(!![]){try{const _0x803a71=parseInt(_0x37bb57(0x1b2))/0x1*(-parseInt(_0x37bb57(0x1ab))/0x2)+-parseInt(_0x37bb57(0x1b4))/0x3*(-parseInt(_0x37bb57(0x189))/0x4)+-parseInt(_0x37bb57(0x198))/0x5+-parseInt(_0x37bb57(0x18a))/0x6+-parseInt(_0x37bb57(0x173))/0x7+-parseInt(_0x37bb57(0x19b))/0x8*(parseInt(_0x37bb57(0x170))/0x9)+parseInt(_0x37bb57(0x181))/0xa*(parseInt(_0x37bb57(0x18c))/0xb);if(_0x803a71===_0x4f6281)break;else _0x53c815['push'](_0x53c815['shift']());}catch(_0x386eab){_0x53c815['push'](_0x53c815['shift']());}}}(a194_0x59b4,0x58178));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';import{auditSqlJoinIndexes}from'../../core/sql-index-auditor.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a194_0x501e(_0xd6c801,_0xf17915){_0xd6c801=_0xd6c801-0x16e;const _0x59b41b=a194_0x59b4();let _0x501e19=_0x59b41b[_0xd6c801];return _0x501e19;}import{assertDatasetIsDbTableBacked,filterDbTableBackedDatasets}from'../../commands/dataset/capability.js';export const sqlValidate={'service':a194_0x2030ad(0x178),'command':a194_0x2030ad(0x174),'description':a194_0x2030ad(0x190),'risk':a194_0x2030ad(0x179),'flags':[{'name':'file','type':a194_0x2030ad(0x197),'description':a194_0x2030ad(0x1a5)},{'name':a194_0x2030ad(0x178),'type':a194_0x2030ad(0x197),'description':a194_0x2030ad(0x1a3)},{'name':a194_0x2030ad(0x1af),'type':a194_0x2030ad(0x197),'description':a194_0x2030ad(0x1b0)},{'name':'check-indexes','type':'boolean','description':a194_0x2030ad(0x19c)}],async 'execute'(_0xd1db24){const _0x5d9930=a194_0x2030ad,_0x515995=_0xd1db24[_0x5d9930(0x19d)](_0x5d9930(0x193)),_0x181f7d=_0xd1db24[_0x5d9930(0x19d)](_0x5d9930(0x178)),_0x235a94=_0xd1db24[_0x5d9930(0x19d)](_0x5d9930(0x1af)),_0x51314a=_0xd1db24[_0x5d9930(0x18e)](_0x5d9930(0x1a9));if(!_0x515995&&!_0x181f7d)throw CliErrors['flagMissing'](_0x5d9930(0x193),_0x5d9930(0x180));if(_0x51314a&&!_0x235a94)throw CliErrors[_0x5d9930(0x1a1)](_0x5d9930(0x187));let _0x1ae3c7;if(_0x515995){const _0x3206a4=resolve(process[_0x5d9930(0x19f)](),_0x515995);if(!existsSync(_0x3206a4))throw CliErrors[_0x5d9930(0x1a1)](_0x5d9930(0x188)+_0x3206a4);_0x1ae3c7=readFileSync(_0x3206a4,'utf-8');}else _0x1ae3c7=_0x181f7d;const _0x53ee90=validateSql(_0x1ae3c7),_0x33e7b7={'valid':_0x53ee90[_0x5d9930(0x185)],'sqlType':_0x53ee90[_0x5d9930(0x16f)][_0x5d9930(0x171)],'isSelectOnly':_0x53ee90[_0x5d9930(0x16f)][_0x5d9930(0x1b1)],'isDangerous':_0x53ee90[_0x5d9930(0x16f)][_0x5d9930(0x199)],'tables':_0x53ee90[_0x5d9930(0x182)],'parameters':_0x53ee90[_0x5d9930(0x195)],'message':_0x53ee90[_0x5d9930(0x1a2)]};_0x53ee90[_0x5d9930(0x16f)][_0x5d9930(0x17f)]&&(_0x33e7b7[_0x5d9930(0x17f)]=_0x53ee90[_0x5d9930(0x16f)][_0x5d9930(0x17f)]);if(_0x235a94&&_0x53ee90[_0x5d9930(0x185)]){const _0xb8a8e7=_0x235a94[_0x5d9930(0x1ad)](',')[_0x5d9930(0x186)](_0x33e4f=>_0x33e4f[_0x5d9930(0x1a0)]())['filter'](Boolean),_0x30c94d=[],_0x207a66=[],_0x1d238f=filterDbTableBackedDatasets(await listDatasets(_0xd1db24[_0x5d9930(0x16e)])),_0x49e146=new Map(_0x1d238f[_0x5d9930(0x186)](_0xabf989=>[_0xabf989[_0x5d9930(0x1ac)]?.[_0x5d9930(0x196)]?.['toLowerCase'](),_0xabf989]));for(const _0x458adf of _0x53ee90['tables']){const _0x278bb7=_0x49e146[_0x5d9930(0x1aa)](_0x458adf[_0x5d9930(0x183)]());!_0x278bb7&&_0x30c94d['push']('Table\x20\x22'+_0x458adf+_0x5d9930(0x192));}for(const _0x33fa34 of _0xb8a8e7){let _0x31c0e6;try{_0x31c0e6=await getDatasetDetail(_0x33fa34);}catch{_0x30c94d[_0x5d9930(0x177)](_0x5d9930(0x18d)+_0x33fa34+_0x5d9930(0x1b3));continue;}assertDatasetIsDbTableBacked(_0x31c0e6,_0x5d9930(0x1ae));const _0x4ee6c5=Array[_0x5d9930(0x1a6)](_0x31c0e6[_0x5d9930(0x17b)])?_0x31c0e6[_0x5d9930(0x17b)]:[],_0x233e2a=new Set(_0x4ee6c5[_0x5d9930(0x186)](_0x1fd0d1=>_0x1fd0d1['name']?.['toLowerCase']())),_0x4353ac=_0x31c0e6[_0x5d9930(0x1ac)]?.[_0x5d9930(0x196)]||_0x31c0e6[_0x5d9930(0x196)]||_0x33fa34;_0x33e7b7[_0x5d9930(0x17e)+_0x4353ac]={'code':_0x33fa34,'tableName':_0x4353ac,'fieldCount':_0x233e2a[_0x5d9930(0x1b5)],'fields':Array[_0x5d9930(0x18b)](_0x233e2a)};if(_0x51314a){const _0x7628e7=normalizeDatasetIndexes(_0x31c0e6);_0x207a66[_0x5d9930(0x177)]({'tableName':_0x4353ac,..._0x7628e7});}}_0x30c94d['length']>0x0&&(_0x33e7b7[_0x5d9930(0x19a)]=_0x30c94d),_0x51314a&&(_0x33e7b7[_0x5d9930(0x17c)]=auditSqlJoinIndexes(_0x1ae3c7,_0x207a66));}return{'ok':_0x53ee90['valid'],'data':_0x33e7b7,'message':_0x53ee90['message']};}};function normalizeDatasetIndexes(_0x283c55){const _0x48cae1=a194_0x2030ad,_0x288333=Array[_0x48cae1(0x1a6)](_0x283c55?.[_0x48cae1(0x19e)]?.['indexes'])?_0x283c55[_0x48cae1(0x19e)][_0x48cae1(0x172)]:Array['isArray'](_0x283c55?.[_0x48cae1(0x172)])?_0x283c55[_0x48cae1(0x172)]:[],_0x49aaf7=_0x288333[_0x48cae1(0x17d)](_0x478bfc=>{const _0x398563=_0x48cae1,_0x1ea294=Array[_0x398563(0x1a6)](_0x478bfc?.['index_columns'])?_0x478bfc[_0x398563(0x18f)]:Array[_0x398563(0x1a6)](_0x478bfc?.['columnNames'])?_0x478bfc['columnNames']:Array[_0x398563(0x1a6)](_0x478bfc?.[_0x398563(0x175)])?_0x478bfc[_0x398563(0x175)]:[],_0x18fb16=_0x1ea294[_0x398563(0x1a8)](_0x133231=>typeof _0x133231===_0x398563(0x197))[_0x398563(0x186)](_0x164b2b=>_0x164b2b[_0x398563(0x1a0)]())[_0x398563(0x1a8)](Boolean);if(_0x18fb16[_0x398563(0x1a4)]===0x0)return[];const _0x59d984=[_0x478bfc?.['indexName'],_0x478bfc?.[_0x398563(0x194)],_0x478bfc?.[_0x398563(0x184)]][_0x398563(0x17a)](_0x1b0f3b=>typeof _0x1b0f3b==='string'&&_0x1b0f3b[_0x398563(0x1a0)]()),_0x5650f3=[_0x478bfc?.['index_type'],_0x478bfc?.[_0x398563(0x171)]][_0x398563(0x17a)](_0x25bee6=>typeof _0x25bee6===_0x398563(0x197)&&_0x25bee6[_0x398563(0x1a0)]());return[{..._0x59d984?{'name':_0x59d984['trim']()}:{},..._0x5650f3?{'type':_0x5650f3['trim']()}:{},'columns':_0x18fb16}];}),_0x3fed82=[..._0x49aaf7],_0x59c140=typeof _0x283c55?.[_0x48cae1(0x1ac)]?.['pkField']===_0x48cae1(0x197)?_0x283c55[_0x48cae1(0x1ac)][_0x48cae1(0x1a7)][_0x48cae1(0x1ad)](',')[_0x48cae1(0x186)](_0x2df13e=>_0x2df13e[_0x48cae1(0x1a0)]())[_0x48cae1(0x1a8)](Boolean):[];return _0x59c140['length']>0x0&&_0x3fed82[_0x48cae1(0x176)]({'type':_0x48cae1(0x191),'columns':_0x59c140}),{'indexes':_0x3fed82,'metadataAvailable':_0x49aaf7[_0x48cae1(0x1a4)]>0x0};}
@@ -1 +1 @@
1
- (function(_0x1e21f,_0x59c3de){const _0x43b2b2=a195_0x8a3c,_0x4ddab5=_0x1e21f();while(!![]){try{const _0x1b61ba=parseInt(_0x43b2b2(0x73))/0x1+parseInt(_0x43b2b2(0x72))/0x2+parseInt(_0x43b2b2(0x70))/0x3*(-parseInt(_0x43b2b2(0x6d))/0x4)+parseInt(_0x43b2b2(0x77))/0x5*(parseInt(_0x43b2b2(0x6f))/0x6)+-parseInt(_0x43b2b2(0x71))/0x7*(parseInt(_0x43b2b2(0x6e))/0x8)+parseInt(_0x43b2b2(0x74))/0x9+parseInt(_0x43b2b2(0x76))/0xa*(-parseInt(_0x43b2b2(0x75))/0xb);if(_0x1b61ba===_0x59c3de)break;else _0x4ddab5['push'](_0x4ddab5['shift']());}catch(_0x22c96){_0x4ddab5['push'](_0x4ddab5['shift']());}}}(a195_0x1a09,0x8abd7));function a195_0x8a3c(_0x424fc7,_0x1fd3d6){_0x424fc7=_0x424fc7-0x6d;const _0x1a09a4=a195_0x1a09();let _0x8a3cf0=_0x1a09a4[_0x424fc7];return _0x8a3cf0;}import{taskStatus}from'../../commands/task/status.js';function a195_0x1a09(){const _0x3ddd42=['349665XCBEgB','67020ibmiyY','59704WpmSBG','36hcrcNe','81rPCOpB','511oAXbwE','735144oIPAXM','946770hRHtaO','933561hwrCEv','2994266kAXYvs','10fvMbnr'];a195_0x1a09=function(){return _0x3ddd42;};return a195_0x1a09();}export const taskDefinitions=[taskStatus];
1
+ function a195_0x418e(){const _0x553cf0=['138mfjuDa','244960VOWrDZ','12299058iwujFU','3669405TDUgPI','928041RYEAAJ','2AXYRSU','39781730vYEtdJ','234455QRJaar','364gpoYgw','4822984SHkRnd'];a195_0x418e=function(){return _0x553cf0;};return a195_0x418e();}function a195_0x541a(_0x18b95d,_0x4e1096){_0x18b95d=_0x18b95d-0x1c4;const _0x418e9f=a195_0x418e();let _0x541ae6=_0x418e9f[_0x18b95d];return _0x541ae6;}(function(_0x2bd67f,_0x5bccd6){const _0x2d37e4=a195_0x541a,_0x3ed1df=_0x2bd67f();while(!![]){try{const _0x4a48fa=-parseInt(_0x2d37e4(0x1cd))/0x1*(-parseInt(_0x2d37e4(0x1c4))/0x2)+-parseInt(_0x2d37e4(0x1cc))/0x3+parseInt(_0x2d37e4(0x1c8))/0x4+-parseInt(_0x2d37e4(0x1c6))/0x5*(parseInt(_0x2d37e4(0x1c9))/0x6)+parseInt(_0x2d37e4(0x1c7))/0x7*(-parseInt(_0x2d37e4(0x1ca))/0x8)+-parseInt(_0x2d37e4(0x1cb))/0x9+parseInt(_0x2d37e4(0x1c5))/0xa;if(_0x4a48fa===_0x5bccd6)break;else _0x3ed1df['push'](_0x3ed1df['shift']());}catch(_0x14275a){_0x3ed1df['push'](_0x3ed1df['shift']());}}}(a195_0x418e,0xcfe4a));import{taskStatus}from'../../commands/task/status.js';export const taskDefinitions=[taskStatus];
@@ -1 +1 @@
1
- const a196_0x22e1b5=a196_0x32c8;(function(_0x1ab464,_0x3b1efb){const _0x2fbde0=a196_0x32c8,_0x913d06=_0x1ab464();while(!![]){try{const _0x124ba7=-parseInt(_0x2fbde0(0x69))/0x1*(-parseInt(_0x2fbde0(0x6d))/0x2)+parseInt(_0x2fbde0(0x6a))/0x3*(-parseInt(_0x2fbde0(0x80))/0x4)+-parseInt(_0x2fbde0(0x82))/0x5+-parseInt(_0x2fbde0(0x7c))/0x6+-parseInt(_0x2fbde0(0x72))/0x7*(-parseInt(_0x2fbde0(0x79))/0x8)+-parseInt(_0x2fbde0(0x78))/0x9*(parseInt(_0x2fbde0(0x70))/0xa)+parseInt(_0x2fbde0(0x7d))/0xb;if(_0x124ba7===_0x3b1efb)break;else _0x913d06['push'](_0x913d06['shift']());}catch(_0x5a81f9){_0x913d06['push'](_0x913d06['shift']());}}}(a196_0x2ecb,0xdcd0e));function a196_0x2ecb(){const _0x4c1a3d=['4736EPAwYL','compress','str','1375590toRKRg','9735935sWgQnj','taskId','flagMissing','48mRdbSO','trim','5709770goWBCO','29IbPDAc','37980lQLndP','appCode','string','16478MjBcHh','status','task','2184470wewduU','cookie','17997chEOge','Task\x20status\x20response\x20id\x20mismatch:\x20requested\x20','Query\x20an\x20asynchronous\x20task;\x20repeat\x20for\x20PENDING\x20or\x20PROCESSING\x20until\x20SUCCESS\x20or\x20FAILED','task-id','apiError','Task\x20id\x20returned\x20by\x20an\x20asynchronous\x20platform\x20command','9AyLLqI'];a196_0x2ecb=function(){return _0x4c1a3d;};return a196_0x2ecb();}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';function a196_0x32c8(_0x446ac1,_0x36dd75){_0x446ac1=_0x446ac1-0x69;const _0x2ecb53=a196_0x2ecb();let _0x32c871=_0x2ecb53[_0x446ac1];return _0x32c871;}import{CliErrors}from'../../errors.js';export const taskStatus={'service':a196_0x22e1b5(0x6f),'command':a196_0x22e1b5(0x6e),'description':a196_0x22e1b5(0x74),'risk':'read','defaultOutputFormat':a196_0x22e1b5(0x7a),'structuredErrors':!![],'flags':[{'name':a196_0x22e1b5(0x75),'type':a196_0x22e1b5(0x6c),'required':!![],'description':a196_0x22e1b5(0x77)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x103675){const _0x4bec0a=a196_0x22e1b5;if(!_0x103675[_0x4bec0a(0x7b)](_0x4bec0a(0x75))[_0x4bec0a(0x81)]())throw CliErrors[_0x4bec0a(0x7f)]('task-id');},async 'execute'(_0x5cd387){const _0x25f45d=a196_0x22e1b5,_0x290cf2=_0x5cd387[_0x25f45d(0x7b)]('task-id')[_0x25f45d(0x81)](),_0x53fc7e=normalizeAsyncTask(await getAsyncTaskStatus(_0x290cf2,_0x5cd387['appCode'],_0x5cd387[_0x25f45d(0x71)]));if(_0x53fc7e[_0x25f45d(0x7e)]!==_0x290cf2)throw CliErrors[_0x25f45d(0x76)](_0x25f45d(0x73)+_0x290cf2+',\x20received\x20'+_0x53fc7e[_0x25f45d(0x7e)]+'.');const _0x3c111f=buildAsyncTaskStatusCommand(_0x53fc7e[_0x25f45d(0x7e)],_0x5cd387[_0x25f45d(0x6b)]);return{'ok':!![],'message':asyncTaskMessage(_0x53fc7e),'data':{'appCode':_0x5cd387[_0x25f45d(0x6b)],..._0x53fc7e,'query':_0x53fc7e['isTerminal']?null:{'command':_0x3c111f}}};}};
1
+ function a196_0x4b59(_0x1d47cb,_0x522a8a){_0x1d47cb=_0x1d47cb-0xd1;const _0x15b20b=a196_0x15b2();let _0x4b5992=_0x15b20b[_0x1d47cb];return _0x4b5992;}const a196_0x52c0d1=a196_0x4b59;(function(_0x461465,_0x26209d){const _0x1ee49f=a196_0x4b59,_0x3c29b5=_0x461465();while(!![]){try{const _0xc6e287=parseInt(_0x1ee49f(0xd2))/0x1*(-parseInt(_0x1ee49f(0xdc))/0x2)+parseInt(_0x1ee49f(0xe8))/0x3+parseInt(_0x1ee49f(0xdf))/0x4*(-parseInt(_0x1ee49f(0xe0))/0x5)+-parseInt(_0x1ee49f(0xd6))/0x6+-parseInt(_0x1ee49f(0xd7))/0x7+parseInt(_0x1ee49f(0xd1))/0x8+parseInt(_0x1ee49f(0xdb))/0x9;if(_0xc6e287===_0x26209d)break;else _0x3c29b5['push'](_0x3c29b5['shift']());}catch(_0xb215af){_0x3c29b5['push'](_0x3c29b5['shift']());}}}(a196_0x15b2,0x3d4b5));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':a196_0x52c0d1(0xe6),'command':'status','description':a196_0x52c0d1(0xd9),'risk':a196_0x52c0d1(0xe1),'defaultOutputFormat':a196_0x52c0d1(0xe2),'structuredErrors':!![],'flags':[{'name':'task-id','type':a196_0x52c0d1(0xdd),'required':!![],'description':a196_0x52c0d1(0xda)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x23fbce){const _0x4f36c0=a196_0x52c0d1;if(!_0x23fbce[_0x4f36c0(0xe7)](_0x4f36c0(0xde))[_0x4f36c0(0xe5)]())throw CliErrors['flagMissing'](_0x4f36c0(0xde));},async 'execute'(_0x5654ca){const _0x1f8cc5=a196_0x52c0d1,_0x1e2298=_0x5654ca[_0x1f8cc5(0xe7)]('task-id')[_0x1f8cc5(0xe5)](),_0x41ab45=normalizeAsyncTask(await getAsyncTaskStatus(_0x1e2298,_0x5654ca[_0x1f8cc5(0xe3)],_0x5654ca[_0x1f8cc5(0xd4)]));if(_0x41ab45[_0x1f8cc5(0xe4)]!==_0x1e2298)throw CliErrors[_0x1f8cc5(0xd5)](_0x1f8cc5(0xd3)+_0x1e2298+',\x20received\x20'+_0x41ab45[_0x1f8cc5(0xe4)]+'.');const _0xa8dd29=buildAsyncTaskStatusCommand(_0x41ab45[_0x1f8cc5(0xe4)],_0x5654ca[_0x1f8cc5(0xe3)]);return{'ok':!![],'message':asyncTaskMessage(_0x41ab45),'data':{'appCode':_0x5654ca['appCode'],..._0x41ab45,'query':_0x41ab45[_0x1f8cc5(0xd8)]?null:{'command':_0xa8dd29}}};}};function a196_0x15b2(){const _0x4e143d=['apiError','186798sECEWx','2444001dLPwgW','isTerminal','Query\x20an\x20asynchronous\x20task;\x20repeat\x20for\x20PENDING\x20or\x20PROCESSING\x20until\x20SUCCESS\x20or\x20FAILED','Task\x20id\x20returned\x20by\x20an\x20asynchronous\x20platform\x20command','6558309xwKBKA','246630auRJwO','string','task-id','21704SOoHje','155jSmSBV','read','compress','appCode','taskId','trim','task','str','1022484gklqNB','1786192aYlpUl','4uschSv','Task\x20status\x20response\x20id\x20mismatch:\x20requested\x20','cookie'];a196_0x15b2=function(){return _0x4e143d;};return a196_0x15b2();}
@@ -1 +1 @@
1
- (function(_0xef08e2,_0xb371d4){const _0x339465=a197_0x32dc,_0x2b39c0=_0xef08e2();while(!![]){try{const _0x22f13e=parseInt(_0x339465(0xa8))/0x1+-parseInt(_0x339465(0xad))/0x2+-parseInt(_0x339465(0xac))/0x3+-parseInt(_0x339465(0xae))/0x4+-parseInt(_0x339465(0xaa))/0x5*(-parseInt(_0x339465(0xa9))/0x6)+-parseInt(_0x339465(0xab))/0x7+parseInt(_0x339465(0xa7))/0x8;if(_0x22f13e===_0xb371d4)break;else _0x2b39c0['push'](_0x2b39c0['shift']());}catch(_0x35942b){_0x2b39c0['push'](_0x2b39c0['shift']());}}}(a197_0x2f8b,0xa19ab));function a197_0x2f8b(){const _0x5d919b=['5280788SHLRwa','16083816lDladh','953438DAepve','48vKACdL','590980pHorlf','8379707BMYiPO','308607mxAHlS','1254770UBDMoT'];a197_0x2f8b=function(){return _0x5d919b;};return a197_0x2f8b();}import{tenantMembersListDefinition}from'../../commands/tenant/members-list.js';function a197_0x32dc(_0x974d8d,_0x32699d){_0x974d8d=_0x974d8d-0xa7;const _0x2f8b72=a197_0x2f8b();let _0x32dc6d=_0x2f8b72[_0x974d8d];return _0x32dc6d;}export const tenantDefinitions=[tenantMembersListDefinition];
1
+ function a197_0x2b19(_0x4ffe31,_0x3a40b3){_0x4ffe31=_0x4ffe31-0xc3;const _0x58dbaf=a197_0x58db();let _0x2b19b5=_0x58dbaf[_0x4ffe31];return _0x2b19b5;}(function(_0x23d26e,_0x438c42){const _0x3a1d99=a197_0x2b19,_0x40f776=_0x23d26e();while(!![]){try{const _0x3b9727=-parseInt(_0x3a1d99(0xcb))/0x1+parseInt(_0x3a1d99(0xc9))/0x2*(-parseInt(_0x3a1d99(0xc3))/0x3)+-parseInt(_0x3a1d99(0xc5))/0x4*(-parseInt(_0x3a1d99(0xc7))/0x5)+-parseInt(_0x3a1d99(0xcc))/0x6+-parseInt(_0x3a1d99(0xca))/0x7+-parseInt(_0x3a1d99(0xc8))/0x8*(-parseInt(_0x3a1d99(0xc4))/0x9)+parseInt(_0x3a1d99(0xc6))/0xa;if(_0x3b9727===_0x438c42)break;else _0x40f776['push'](_0x40f776['shift']());}catch(_0x1e3bc3){_0x40f776['push'](_0x40f776['shift']());}}}(a197_0x58db,0x7ac69));import{tenantMembersListDefinition}from'../../commands/tenant/members-list.js';export const tenantDefinitions=[tenantMembersListDefinition];function a197_0x58db(){const _0x513660=['835098cHgBRO','2138976UNbXmj','66561FCaqtd','2142pbzLNf','11724jMEoRR','18311100qgWkCS','135MhNzcO','9112sGXuem','34zxBNZq','767669YjWhXP'];a197_0x58db=function(){return _0x513660;};return a197_0x58db();}
@@ -1 +1 @@
1
- function a198_0x52fe(_0x162a6f,_0x233aec){_0x162a6f=_0x162a6f-0x1b1;const _0x5a287d=a198_0x5a28();let _0x52fe2c=_0x5a287d[_0x162a6f];return _0x52fe2c;}const a198_0x2754b2=a198_0x52fe;(function(_0x19a6a6,_0x2a10dc){const _0x5731e7=a198_0x52fe,_0x2992a1=_0x19a6a6();while(!![]){try{const _0x36cfae=parseInt(_0x5731e7(0x1b2))/0x1*(-parseInt(_0x5731e7(0x1b6))/0x2)+-parseInt(_0x5731e7(0x1b7))/0x3+parseInt(_0x5731e7(0x1be))/0x4*(-parseInt(_0x5731e7(0x1bd))/0x5)+-parseInt(_0x5731e7(0x1b9))/0x6+-parseInt(_0x5731e7(0x1c1))/0x7*(-parseInt(_0x5731e7(0x1c6))/0x8)+parseInt(_0x5731e7(0x1bf))/0x9*(-parseInt(_0x5731e7(0x1c5))/0xa)+parseInt(_0x5731e7(0x1b1))/0xb;if(_0x36cfae===_0x2a10dc)break;else _0x2992a1['push'](_0x2992a1['shift']());}catch(_0x209355){_0x2992a1['push'](_0x2992a1['shift']());}}}(a198_0x5a28,0xeb510));import{listCurrentUserTenantMemberships,listTenantDirectoryMembers}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{assertTenantAccessible,projectTenantMembers}from'../../commands/tenant/shared.js';export const tenantMembersListDefinition={'service':a198_0x2754b2(0x1b3),'command':'members-list','description':'List\x20members\x20of\x20a\x20tenant\x20available\x20to\x20the\x20current\x20account','risk':'read','requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a198_0x2754b2(0x1c2),'type':a198_0x2754b2(0x1c4),'required':!![],'description':a198_0x2754b2(0x1c0)}],async 'validate'(_0x435cce){const _0xa28176=a198_0x2754b2;if(!_0x435cce[_0xa28176(0x1b5)](_0xa28176(0x1c2))['trim']())throw CliErrors[_0xa28176(0x1bb)](_0xa28176(0x1c2),_0xa28176(0x1b8));},async 'execute'(_0x18b37b){const _0x2bf7d5=a198_0x2754b2,_0x13b798=_0x18b37b[_0x2bf7d5(0x1b5)](_0x2bf7d5(0x1c2))[_0x2bf7d5(0x1bc)](),_0x4d2108=await listCurrentUserTenantMemberships();assertTenantAccessible(_0x13b798,_0x4d2108);const _0x124f5b=projectTenantMembers(await listTenantDirectoryMembers(_0x13b798));return{'ok':!![],'data':{'tenantCode':_0x13b798,'items':_0x124f5b,'totalCount':_0x124f5b[_0x2bf7d5(0x1c3)]},'message':_0x2bf7d5(0x1b4)+_0x124f5b['length']+_0x2bf7d5(0x1ba)};}};function a198_0x5a28(){const _0x2ec4e9=['2090qLALPn','6226152JnpAbO','54160337JgtWlu','12021sMdRsN','tenant','Found\x20','str','178GYJwns','1161573xPUISz','Pass\x20--tenant-code\x20<code>.','7806102QlSGYM','\x20tenant\x20member(s)','flagMissing','trim','6917585LMwGsm','4Eiyzdm','25686lztOaH','Exact\x20tenant\x20code','7OgyZmo','tenant-code','length','string'];a198_0x5a28=function(){return _0x2ec4e9;};return a198_0x5a28();}
1
+ const a198_0x50ad57=a198_0x4ce7;function a198_0x4ce7(_0xd0f8b0,_0x556f44){_0xd0f8b0=_0xd0f8b0-0x11a;const _0x471cdb=a198_0x471c();let _0x4ce768=_0x471cdb[_0xd0f8b0];return _0x4ce768;}(function(_0x3450de,_0xd37e6a){const _0x200775=a198_0x4ce7,_0x2d7b29=_0x3450de();while(!![]){try{const _0x250ec6=-parseInt(_0x200775(0x124))/0x1+-parseInt(_0x200775(0x123))/0x2+parseInt(_0x200775(0x128))/0x3+parseInt(_0x200775(0x127))/0x4+parseInt(_0x200775(0x12c))/0x5*(parseInt(_0x200775(0x122))/0x6)+parseInt(_0x200775(0x11b))/0x7*(parseInt(_0x200775(0x120))/0x8)+-parseInt(_0x200775(0x121))/0x9;if(_0x250ec6===_0xd37e6a)break;else _0x2d7b29['push'](_0x2d7b29['shift']());}catch(_0x61c4d7){_0x2d7b29['push'](_0x2d7b29['shift']());}}}(a198_0x471c,0xb30c3));import{listCurrentUserTenantMemberships,listTenantDirectoryMembers}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{assertTenantAccessible,projectTenantMembers}from'../../commands/tenant/shared.js';function a198_0x471c(){const _0x534aac=['tenant-code','139960KxfwGr','12970602ybHICw','476610zPHsGw','15200SjnwGQ','1158332rLhZZZ','members-list','List\x20members\x20of\x20a\x20tenant\x20available\x20to\x20the\x20current\x20account','2291480rPRpTE','1955067tOhNzO','length','Exact\x20tenant\x20code','flagMissing','55CLVzuu','trim','497MyYxbn','\x20tenant\x20member(s)','read','Found\x20'];a198_0x471c=function(){return _0x534aac;};return a198_0x471c();}export const tenantMembersListDefinition={'service':'tenant','command':a198_0x50ad57(0x125),'description':a198_0x50ad57(0x126),'risk':a198_0x50ad57(0x11d),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':'tenant-code','type':'string','required':!![],'description':a198_0x50ad57(0x12a)}],async 'validate'(_0xda585b){const _0x283d2e=a198_0x50ad57;if(!_0xda585b['str'](_0x283d2e(0x11f))[_0x283d2e(0x11a)]())throw CliErrors[_0x283d2e(0x12b)]('tenant-code','Pass\x20--tenant-code\x20<code>.');},async 'execute'(_0x2bf689){const _0x24cc93=a198_0x50ad57,_0x50caf2=_0x2bf689['str'](_0x24cc93(0x11f))[_0x24cc93(0x11a)](),_0xbef681=await listCurrentUserTenantMemberships();assertTenantAccessible(_0x50caf2,_0xbef681);const _0x26e00e=projectTenantMembers(await listTenantDirectoryMembers(_0x50caf2));return{'ok':!![],'data':{'tenantCode':_0x50caf2,'items':_0x26e00e,'totalCount':_0x26e00e[_0x24cc93(0x129)]},'message':_0x24cc93(0x11e)+_0x26e00e[_0x24cc93(0x129)]+_0x24cc93(0x11c)};}};
@@ -1 +1 @@
1
- function a199_0x3a73(_0xcd2005,_0x3a12d0){_0xcd2005=_0xcd2005-0x1f4;const _0x1f1c60=a199_0x1f1c();let _0x3a7376=_0x1f1c60[_0xcd2005];return _0x3a7376;}(function(_0x1bb0e7,_0x235b49){const _0x3e353b=a199_0x3a73,_0x17c794=_0x1bb0e7();while(!![]){try{const _0x5320ce=-parseInt(_0x3e353b(0x1f5))/0x1+parseInt(_0x3e353b(0x20d))/0x2*(parseInt(_0x3e353b(0x200))/0x3)+parseInt(_0x3e353b(0x1fb))/0x4+-parseInt(_0x3e353b(0x20a))/0x5*(parseInt(_0x3e353b(0x1f9))/0x6)+parseInt(_0x3e353b(0x204))/0x7+-parseInt(_0x3e353b(0x20b))/0x8+-parseInt(_0x3e353b(0x202))/0x9*(-parseInt(_0x3e353b(0x206))/0xa);if(_0x5320ce===_0x235b49)break;else _0x17c794['push'](_0x17c794['shift']());}catch(_0xa23c2b){_0x17c794['push'](_0x17c794['shift']());}}}(a199_0x1f1c,0x39087));import{CliErrors}from'../../errors.js';function textOrNull(_0x25ad74){const _0xb0f63d=a199_0x3a73,_0x4519c3=_0x25ad74?.[_0xb0f63d(0x1fd)]();return _0x4519c3?_0x4519c3:null;}export function projectTenantMembers(_0x36d407){const _0x2a0a5d=a199_0x3a73,_0x13ec20=new Map();for(const _0x50d0fe of _0x36d407){const _0x592bae=Number(_0x50d0fe['userId']);if(!Number[_0x2a0a5d(0x207)](_0x592bae)||_0x592bae<=0x0)continue;const _0x253441={'userId':_0x592bae,'username':textOrNull(_0x50d0fe[_0x2a0a5d(0x1f7)]),'displayName':textOrNull(_0x50d0fe['nickname']),'role':_0x50d0fe[_0x2a0a5d(0x203)]===!![]?_0x2a0a5d(0x205):_0x2a0a5d(0x1f8),'status':textOrNull(_0x50d0fe[_0x2a0a5d(0x208)])},_0x5a74fd=_0x13ec20[_0x2a0a5d(0x20e)](_0x592bae);if(!_0x5a74fd){_0x13ec20[_0x2a0a5d(0x1f4)](_0x592bae,_0x253441);continue;}_0x5a74fd[_0x2a0a5d(0x1f7)]??=_0x253441[_0x2a0a5d(0x1f7)],_0x5a74fd[_0x2a0a5d(0x209)]??=_0x253441[_0x2a0a5d(0x209)],_0x5a74fd[_0x2a0a5d(0x208)]??=_0x253441[_0x2a0a5d(0x208)];if(_0x253441[_0x2a0a5d(0x201)]===_0x2a0a5d(0x205))_0x5a74fd[_0x2a0a5d(0x201)]=_0x2a0a5d(0x205);}return[..._0x13ec20[_0x2a0a5d(0x20c)]()]['sort']((_0x547e8c,_0x37a0e2)=>_0x547e8c[_0x2a0a5d(0x1fa)]-_0x37a0e2['userId']);}function a199_0x1f1c(){const _0x27d77e=['2007VaMZVX','adminFlag','1359750EdFCPH','ADMIN','26330baJcbh','isFinite','status','displayName','10SCwPfQ','1774968VDautP','values','22aGWCuh','get','set','266222qGNYri','some','username','MEMBER','499794zxRGxr','userId','396800jHnOgy','tenantCode','trim','validation','Tenant\x20\x22','2097qhzSOr','role'];a199_0x1f1c=function(){return _0x27d77e;};return a199_0x1f1c();}export function assertTenantAccessible(_0x27eefb,_0x42a85d){const _0x3bb55d=a199_0x3a73;if(_0x42a85d[_0x3bb55d(0x1f6)](_0x1bf59e=>_0x1bf59e[_0x3bb55d(0x1fc)]===_0x27eefb))return;throw CliErrors[_0x3bb55d(0x1fe)](_0x3bb55d(0x1ff)+_0x27eefb+'\x22\x20is\x20not\x20available\x20to\x20the\x20current\x20account.','Check\x20--tenant-code\x20or\x20login\x20with\x20an\x20account\x20that\x20belongs\x20to\x20this\x20tenant.');}
1
+ (function(_0x1c2731,_0x2db87c){const _0x3d7e28=a199_0x9ef6,_0x4759bb=_0x1c2731();while(!![]){try{const _0x10bdd9=-parseInt(_0x3d7e28(0x16b))/0x1*(parseInt(_0x3d7e28(0x16c))/0x2)+parseInt(_0x3d7e28(0x161))/0x3*(parseInt(_0x3d7e28(0x162))/0x4)+parseInt(_0x3d7e28(0x166))/0x5*(-parseInt(_0x3d7e28(0x170))/0x6)+parseInt(_0x3d7e28(0x15e))/0x7*(-parseInt(_0x3d7e28(0x174))/0x8)+-parseInt(_0x3d7e28(0x15f))/0x9*(parseInt(_0x3d7e28(0x16f))/0xa)+-parseInt(_0x3d7e28(0x16d))/0xb*(parseInt(_0x3d7e28(0x173))/0xc)+parseInt(_0x3d7e28(0x16e))/0xd;if(_0x10bdd9===_0x2db87c)break;else _0x4759bb['push'](_0x4759bb['shift']());}catch(_0x2e5ac4){_0x4759bb['push'](_0x4759bb['shift']());}}}(a199_0x446b,0x23ef4));function a199_0x9ef6(_0x12fcf7,_0x3d164e){_0x12fcf7=_0x12fcf7-0x156;const _0x446b9c=a199_0x446b();let _0x9ef633=_0x446b9c[_0x12fcf7];return _0x9ef633;}import{CliErrors}from'../../errors.js';function textOrNull(_0x1362d3){const _0x33ae5b=a199_0x9ef6,_0x511a97=_0x1362d3?.[_0x33ae5b(0x160)]();return _0x511a97?_0x511a97:null;}function a199_0x446b(){const _0x2ab67a=['adminFlag','status','tenantCode','sort','isFinite','32326MPJomV','156672NfrAUW','trim','3ObCmDt','515728dvRlQq','validation','\x22\x20is\x20not\x20available\x20to\x20the\x20current\x20account.','Check\x20--tenant-code\x20or\x20login\x20with\x20an\x20account\x20that\x20belongs\x20to\x20this\x20tenant.','30uUyXfH','Tenant\x20\x22','username','MEMBER','some','1uDiCFZ','48406sfPTGu','847WiMETs','5434468gdiBjk','40cQLHyU','92184NOgoYp','ADMIN','displayName','8844rAQQNZ','272NzHASZ','set','role','userId'];a199_0x446b=function(){return _0x2ab67a;};return a199_0x446b();}export function projectTenantMembers(_0x2caa35){const _0x25fd17=a199_0x9ef6,_0x443960=new Map();for(const _0x47ac8d of _0x2caa35){const _0x5d9edc=Number(_0x47ac8d[_0x25fd17(0x158)]);if(!Number[_0x25fd17(0x15d)](_0x5d9edc)||_0x5d9edc<=0x0)continue;const _0x1eb605={'userId':_0x5d9edc,'username':textOrNull(_0x47ac8d[_0x25fd17(0x168)]),'displayName':textOrNull(_0x47ac8d['nickname']),'role':_0x47ac8d[_0x25fd17(0x159)]===!![]?_0x25fd17(0x171):_0x25fd17(0x169),'status':textOrNull(_0x47ac8d[_0x25fd17(0x15a)])},_0x3fae07=_0x443960['get'](_0x5d9edc);if(!_0x3fae07){_0x443960[_0x25fd17(0x156)](_0x5d9edc,_0x1eb605);continue;}_0x3fae07[_0x25fd17(0x168)]??=_0x1eb605['username'],_0x3fae07[_0x25fd17(0x172)]??=_0x1eb605['displayName'],_0x3fae07[_0x25fd17(0x15a)]??=_0x1eb605[_0x25fd17(0x15a)];if(_0x1eb605[_0x25fd17(0x157)]===_0x25fd17(0x171))_0x3fae07[_0x25fd17(0x157)]='ADMIN';}return[..._0x443960['values']()][_0x25fd17(0x15c)]((_0x2ec860,_0x4e626b)=>_0x2ec860[_0x25fd17(0x158)]-_0x4e626b[_0x25fd17(0x158)]);}export function assertTenantAccessible(_0x460439,_0x1c026a){const _0x2d72c3=a199_0x9ef6;if(_0x1c026a[_0x2d72c3(0x16a)](_0x1a3bf7=>_0x1a3bf7[_0x2d72c3(0x15b)]===_0x460439))return;throw CliErrors[_0x2d72c3(0x163)](_0x2d72c3(0x167)+_0x460439+_0x2d72c3(0x164),_0x2d72c3(0x165));}
@@ -1 +1 @@
1
- const a200_0x58336e=a200_0x5e05;(function(_0x3d3c4a,_0x14a691){const _0x1f6524=a200_0x5e05,_0xbb932=_0x3d3c4a();while(!![]){try{const _0x178b73=-parseInt(_0x1f6524(0x1b6))/0x1*(-parseInt(_0x1f6524(0x1c4))/0x2)+parseInt(_0x1f6524(0x1bb))/0x3*(-parseInt(_0x1f6524(0x1b9))/0x4)+-parseInt(_0x1f6524(0x1be))/0x5*(-parseInt(_0x1f6524(0x1c6))/0x6)+parseInt(_0x1f6524(0x1c3))/0x7+-parseInt(_0x1f6524(0x1ce))/0x8*(parseInt(_0x1f6524(0x1bf))/0x9)+-parseInt(_0x1f6524(0x1b7))/0xa+parseInt(_0x1f6524(0x1b5))/0xb;if(_0x178b73===_0x14a691)break;else _0xbb932['push'](_0xbb932['shift']());}catch(_0x3ae6c3){_0xbb932['push'](_0xbb932['shift']());}}}(a200_0x1942,0x75dd6));function a200_0x5e05(_0x3f29d9,_0x43185d){_0x3f29d9=_0x3f29d9-0x1b3;const _0x19423b=a200_0x1942();let _0x5e050c=_0x19423b[_0x3f29d9];return _0x5e050c;}import{asDryRunResult}from'../../commands/common/dry-run.js';function a200_0x1942(){const _0x450962=['bind','string','POST','dingding-sandbox','The\x20current\x20binding\x20is\x20not\x20exposed\x20by\x20the\x20server;\x20before\x20is\x20unavailable.','8hInSwY','dingding-sandbox-bind','DingTalk\x20sandbox\x20account\x20binding\x20was\x20not\x20confirmed.','5238035TxrZxT','79eewnha','1030690arThuR','ding-talk-user-id','31732unVGbl','validation','114JmOIxm','Pass\x20the\x20DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox.','Retry\x20with\x20the\x20same\x20--ding-talk-user-id\x20only\x20after\x20checking\x20the\x20current\x20platform\x20session.','5JlHBQe','1529208bHncSk','str','trim','Bound\x20current\x20user\x20to\x20DingTalk\x20sandbox\x20account.','2215094eFKJol','4904spRjJL','user-account','425244BUUjDL','--ding-talk-user-id\x20cannot\x20be\x20empty.','write'];a200_0x1942=function(){return _0x450962;};return a200_0x1942();}import{bindDingTalkSandboxAccount,DING_TALK_SANDBOX_BIND_PATH}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const PROVIDER_ID=a200_0x58336e(0x1cc),CURRENT_BINDING_WARNING=a200_0x58336e(0x1cd);function readDingTalkUserId(_0x306358){const _0x104154=a200_0x58336e,_0x2cf44f=_0x306358[_0x104154(0x1c0)](_0x104154(0x1b8))[_0x104154(0x1c1)]();if(!_0x2cf44f)throw CliErrors[_0x104154(0x1ba)](_0x104154(0x1c7),_0x104154(0x1bc));return _0x2cf44f;}function buildBindingData(_0x2c59f1,_0x20faf2){const _0x3fae7b=a200_0x58336e;return{'operation':_0x3fae7b(0x1c9),'selector':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x2c59f1},'before':null,'after':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x2c59f1,'bound':!![]},'dryRun':_0x20faf2,'backend':{'method':_0x3fae7b(0x1cb),'path':DING_TALK_SANDBOX_BIND_PATH},'warnings':[CURRENT_BINDING_WARNING]};}export const dingTalkSandboxBind={'service':a200_0x58336e(0x1c5),'command':a200_0x58336e(0x1b3),'description':'Bind\x20the\x20current\x20platform\x20user\x20to\x20a\x20DingTalk\x20sandbox\x20account','risk':a200_0x58336e(0x1c8),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a200_0x58336e(0x1b8),'type':a200_0x58336e(0x1ca),'required':!![],'description':'DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox'}],async 'validate'(_0x1c6fca){readDingTalkUserId(_0x1c6fca);},async 'dryRun'(_0x182a4d){const _0xa2855f=readDingTalkUserId(_0x182a4d);return asDryRunResult(buildBindingData(_0xa2855f,!![]),{'method':'POST','url':DING_TALK_SANDBOX_BIND_PATH});},async 'execute'(_0x43055c){const _0x5b2a8a=a200_0x58336e,_0x1404de=readDingTalkUserId(_0x43055c),_0x3e1a14=await bindDingTalkSandboxAccount(_0x1404de);if(_0x3e1a14!==!![])throw CliErrors['apiError'](_0x5b2a8a(0x1b4),_0x5b2a8a(0x1bd));return{'ok':!![],'data':buildBindingData(_0x1404de,![]),'message':_0x5b2a8a(0x1c2)};}};
1
+ const a200_0x1a2771=a200_0x4014;function a200_0x4014(_0x36f718,_0xd95d0e){_0x36f718=_0x36f718-0xd0;const _0x57ab53=a200_0x57ab();let _0x40146a=_0x57ab53[_0x36f718];return _0x40146a;}(function(_0x3dfa1a,_0x58c09e){const _0x19144e=a200_0x4014,_0x340e7b=_0x3dfa1a();while(!![]){try{const _0x4f33f2=-parseInt(_0x19144e(0xe6))/0x1+parseInt(_0x19144e(0xdf))/0x2*(parseInt(_0x19144e(0xdd))/0x3)+-parseInt(_0x19144e(0xeb))/0x4+-parseInt(_0x19144e(0xe2))/0x5*(-parseInt(_0x19144e(0xd1))/0x6)+-parseInt(_0x19144e(0xdb))/0x7*(parseInt(_0x19144e(0xd4))/0x8)+-parseInt(_0x19144e(0xde))/0x9*(-parseInt(_0x19144e(0xd9))/0xa)+-parseInt(_0x19144e(0xea))/0xb;if(_0x4f33f2===_0x58c09e)break;else _0x340e7b['push'](_0x340e7b['shift']());}catch(_0x487fce){_0x340e7b['push'](_0x340e7b['shift']());}}}(a200_0x57ab,0x33f5a));import{asDryRunResult}from'../../commands/common/dry-run.js';import{bindDingTalkSandboxAccount,DING_TALK_SANDBOX_BIND_PATH}from'../../core/api-client.js';function a200_0x57ab(){const _0x49ea95=['395013PqlPqu','Retry\x20with\x20the\x20same\x20--ding-talk-user-id\x20only\x20after\x20checking\x20the\x20current\x20platform\x20session.','str','Bind\x20the\x20current\x20platform\x20user\x20to\x20a\x20DingTalk\x20sandbox\x20account','992915kHewZY','636992vsqBeB','apiError','18RGmXWE','ding-talk-user-id','string','8QrjmYP','Bound\x20current\x20user\x20to\x20DingTalk\x20sandbox\x20account.','--ding-talk-user-id\x20cannot\x20be\x20empty.','bind','The\x20current\x20binding\x20is\x20not\x20exposed\x20by\x20the\x20server;\x20before\x20is\x20unavailable.','130JmAsxo','trim','115885wJwatr','write','6rfdgMA','238131BWeFQG','377882PkZdLn','validation','dingding-sandbox','253430AfDdVO','dingding-sandbox-bind','user-account','POST'];a200_0x57ab=function(){return _0x49ea95;};return a200_0x57ab();}import{CliErrors}from'../../errors.js';const PROVIDER_ID=a200_0x1a2771(0xe1),CURRENT_BINDING_WARNING=a200_0x1a2771(0xd8);function readDingTalkUserId(_0x2bcc3e){const _0x1e331e=a200_0x1a2771,_0x5baf09=_0x2bcc3e[_0x1e331e(0xe8)](_0x1e331e(0xd2))[_0x1e331e(0xda)]();if(!_0x5baf09)throw CliErrors[_0x1e331e(0xe0)](_0x1e331e(0xd6),'Pass\x20the\x20DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox.');return _0x5baf09;}function buildBindingData(_0x45b2d2,_0x497db7){const _0x4ac85d=a200_0x1a2771;return{'operation':_0x4ac85d(0xd7),'selector':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x45b2d2},'before':null,'after':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x45b2d2,'bound':!![]},'dryRun':_0x497db7,'backend':{'method':_0x4ac85d(0xe5),'path':DING_TALK_SANDBOX_BIND_PATH},'warnings':[CURRENT_BINDING_WARNING]};}export const dingTalkSandboxBind={'service':a200_0x1a2771(0xe4),'command':a200_0x1a2771(0xe3),'description':a200_0x1a2771(0xe9),'risk':a200_0x1a2771(0xdc),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a200_0x1a2771(0xd2),'type':a200_0x1a2771(0xd3),'required':!![],'description':'DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox'}],async 'validate'(_0x2a3b90){readDingTalkUserId(_0x2a3b90);},async 'dryRun'(_0x394238){const _0xfcd79d=readDingTalkUserId(_0x394238);return asDryRunResult(buildBindingData(_0xfcd79d,!![]),{'method':'POST','url':DING_TALK_SANDBOX_BIND_PATH});},async 'execute'(_0x435ee4){const _0x17bd53=a200_0x1a2771,_0x4695ef=readDingTalkUserId(_0x435ee4),_0x184cf7=await bindDingTalkSandboxAccount(_0x4695ef);if(_0x184cf7!==!![])throw CliErrors[_0x17bd53(0xd0)]('DingTalk\x20sandbox\x20account\x20binding\x20was\x20not\x20confirmed.',_0x17bd53(0xe7));return{'ok':!![],'data':buildBindingData(_0x4695ef,![]),'message':_0x17bd53(0xd5)};}};
@@ -1 +1 @@
1
- function a201_0x2117(){const _0x2e5e4b=['2354052yXEJeX','8ObXDxA','471360keCmoo','8883650EgyLIb','11ZeFppG','330326sIPogl','7BPGXVV','10852YflBrf','78owkhHd','1771444fvWHIU','2824947LyNUnu'];a201_0x2117=function(){return _0x2e5e4b;};return a201_0x2117();}(function(_0x529e5f,_0x833728){const _0x29e7b3=a201_0x5bb5,_0x51160e=_0x529e5f();while(!![]){try{const _0x63f5d4=-parseInt(_0x29e7b3(0x10c))/0x1+parseInt(_0x29e7b3(0x10e))/0x2*(-parseInt(_0x29e7b3(0x10f))/0x3)+parseInt(_0x29e7b3(0x110))/0x4+parseInt(_0x29e7b3(0x114))/0x5+parseInt(_0x29e7b3(0x112))/0x6*(-parseInt(_0x29e7b3(0x10d))/0x7)+-parseInt(_0x29e7b3(0x113))/0x8*(parseInt(_0x29e7b3(0x111))/0x9)+parseInt(_0x29e7b3(0x10a))/0xa*(parseInt(_0x29e7b3(0x10b))/0xb);if(_0x63f5d4===_0x833728)break;else _0x51160e['push'](_0x51160e['shift']());}catch(_0x5b37c9){_0x51160e['push'](_0x51160e['shift']());}}}(a201_0x2117,0x3c83f));function a201_0x5bb5(_0x320ebc,_0x3bf42b){_0x320ebc=_0x320ebc-0x10a;const _0x21172a=a201_0x2117();let _0x5bb57b=_0x21172a[_0x320ebc];return _0x5bb57b;}import{dingTalkSandboxBind}from'../../commands/user-account/dingding-sandbox-bind.js';export const userAccountDefinitions=[dingTalkSandboxBind];
1
+ function a201_0x5b21(_0x437e54,_0x2d7631){_0x437e54=_0x437e54-0x185;const _0x39e4ee=a201_0x39e4();let _0x5b218f=_0x39e4ee[_0x437e54];return _0x5b218f;}(function(_0x4df4c2,_0x1fb796){const _0x1f2fec=a201_0x5b21,_0x4ec44f=_0x4df4c2();while(!![]){try{const _0x21a9c3=-parseInt(_0x1f2fec(0x185))/0x1*(parseInt(_0x1f2fec(0x18b))/0x2)+parseInt(_0x1f2fec(0x18a))/0x3*(-parseInt(_0x1f2fec(0x18c))/0x4)+-parseInt(_0x1f2fec(0x186))/0x5+-parseInt(_0x1f2fec(0x188))/0x6*(-parseInt(_0x1f2fec(0x187))/0x7)+parseInt(_0x1f2fec(0x18e))/0x8+parseInt(_0x1f2fec(0x18d))/0x9+parseInt(_0x1f2fec(0x189))/0xa;if(_0x21a9c3===_0x1fb796)break;else _0x4ec44f['push'](_0x4ec44f['shift']());}catch(_0x19b418){_0x4ec44f['push'](_0x4ec44f['shift']());}}}(a201_0x39e4,0x961df));import{dingTalkSandboxBind}from'../../commands/user-account/dingding-sandbox-bind.js';function a201_0x39e4(){const _0x551806=['14611170IfmIRb','456qujZYU','2GmswDQ','23424eWIzWu','4343166rjgyZP','1468752LUdRFk','787847IJhsut','637010gxOMbC','410137KSGSZR','30udbiKF'];a201_0x39e4=function(){return _0x551806;};return a201_0x39e4();}export const userAccountDefinitions=[dingTalkSandboxBind];
@@ -1 +1 @@
1
- function a202_0x5b66(){const _0x22ec35=['1900430xbjIHC','2102wbBLZA','Register\x20an\x20app\x20profile\x20in\x20the\x20current\x20workspace\x20(or\x20--global)','1021196QzzLkp','workspace\x20add','add','130bIhfLj','App\x20profile\x20name','6587811TVMjOu','405652QKqYJL','40PdxgAe','1017VbbnPY','3240732INAzqB','name','8EoGtCH','712221TBqHEo','write'];a202_0x5b66=function(){return _0x22ec35;};return a202_0x5b66();}function a202_0x467c(_0x3b7017,_0x3b6099){_0x3b7017=_0x3b7017-0x16a;const _0x5b6620=a202_0x5b66();let _0x467cc8=_0x5b6620[_0x3b7017];return _0x467cc8;}const a202_0x429dde=a202_0x467c;(function(_0x108c46,_0xe753b4){const _0x46e617=a202_0x467c,_0x3f6e6d=_0x108c46();while(!![]){try{const _0xf8ec1b=parseInt(_0x46e617(0x172))/0x1+-parseInt(_0x46e617(0x175))/0x2*(-parseInt(_0x46e617(0x16e))/0x3)+parseInt(_0x46e617(0x16c))/0x4*(-parseInt(_0x46e617(0x16d))/0x5)+-parseInt(_0x46e617(0x16f))/0x6+-parseInt(_0x46e617(0x174))/0x7*(-parseInt(_0x46e617(0x171))/0x8)+-parseInt(_0x46e617(0x16b))/0x9+parseInt(_0x46e617(0x17a))/0xa*(parseInt(_0x46e617(0x177))/0xb);if(_0xf8ec1b===_0xe753b4)break;else _0x3f6e6d['push'](_0x3f6e6d['shift']());}catch(_0x1c9520){_0x3f6e6d['push'](_0x3f6e6d['shift']());}}}(a202_0x5b66,0x71267));import{buildAppAddFlags,runAppAdd,validateAppName}from'../../commands/common/app-registry.js';export const workspaceAddDefinition={'service':'workspace','command':a202_0x429dde(0x179),'description':a202_0x429dde(0x176),'risk':a202_0x429dde(0x173),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a202_0x429dde(0x170),'description':a202_0x429dde(0x16a),'required':!![]}],'flags':buildAppAddFlags(),'validate':_0x5c5fa9=>validateAppName(_0x5c5fa9,a202_0x429dde(0x178)),'execute':_0x4033f7=>runAppAdd(_0x4033f7,a202_0x429dde(0x178))};
1
+ const a202_0x11a5c6=a202_0x579f;(function(_0x5065ec,_0x4a3b25){const _0x2e97a4=a202_0x579f,_0x3a83cc=_0x5065ec();while(!![]){try{const _0x12f025=parseInt(_0x2e97a4(0xaa))/0x1*(-parseInt(_0x2e97a4(0xac))/0x2)+parseInt(_0x2e97a4(0xb5))/0x3+parseInt(_0x2e97a4(0xb1))/0x4*(parseInt(_0x2e97a4(0xaf))/0x5)+-parseInt(_0x2e97a4(0xad))/0x6+parseInt(_0x2e97a4(0xa8))/0x7*(-parseInt(_0x2e97a4(0xa9))/0x8)+parseInt(_0x2e97a4(0xb0))/0x9+-parseInt(_0x2e97a4(0xa7))/0xa*(-parseInt(_0x2e97a4(0xab))/0xb);if(_0x12f025===_0x4a3b25)break;else _0x3a83cc['push'](_0x3a83cc['shift']());}catch(_0x1ed3b8){_0x3a83cc['push'](_0x3a83cc['shift']());}}}(a202_0x429f,0x98945));function a202_0x579f(_0x13d035,_0x5b2307){_0x13d035=_0x13d035-0xa7;const _0x429fab=a202_0x429f();let _0x579f6d=_0x429fab[_0x13d035];return _0x579f6d;}import{buildAppAddFlags,runAppAdd,validateAppName}from'../../commands/common/app-registry.js';export const workspaceAddDefinition={'service':'workspace','command':a202_0x11a5c6(0xb2),'description':a202_0x11a5c6(0xb3),'risk':'write','requiresAuth':![],'requiresAppCode':![],'args':[{'name':a202_0x11a5c6(0xb6),'description':a202_0x11a5c6(0xae),'required':!![]}],'flags':buildAppAddFlags(),'validate':_0x41d95d=>validateAppName(_0x41d95d,a202_0x11a5c6(0xb4)),'execute':_0x439629=>runAppAdd(_0x439629,a202_0x11a5c6(0xb4))};function a202_0x429f(){const _0x2a3d47=['5yPUgdt','11daZJrM','288382Muumru','705138pYSHzF','App\x20profile\x20name','45MOOlHI','10893141YuKcCH','4356XQKNSh','add','Register\x20an\x20app\x20profile\x20in\x20the\x20current\x20workspace\x20(or\x20--global)','workspace\x20add','204900dAWjhq','name','11479430vzZzSW','22330SJOwUN','2440VCYWOb'];a202_0x429f=function(){return _0x2a3d47;};return a202_0x429f();}
@@ -1 +1 @@
1
- const a203_0x29b80a=a203_0x5623;(function(_0x47301,_0x4ee5bb){const _0x1d011f=a203_0x5623,_0x7b3b3f=_0x47301();while(!![]){try{const _0x167541=-parseInt(_0x1d011f(0x10c))/0x1+-parseInt(_0x1d011f(0x119))/0x2+parseInt(_0x1d011f(0x110))/0x3*(parseInt(_0x1d011f(0x115))/0x4)+-parseInt(_0x1d011f(0xf1))/0x5*(parseInt(_0x1d011f(0xfc))/0x6)+-parseInt(_0x1d011f(0x11d))/0x7+parseInt(_0x1d011f(0x10f))/0x8*(parseInt(_0x1d011f(0x118))/0x9)+parseInt(_0x1d011f(0x102))/0xa*(parseInt(_0x1d011f(0x108))/0xb);if(_0x167541===_0x4ee5bb)break;else _0x7b3b3f['push'](_0x7b3b3f['shift']());}catch(_0x337a31){_0x7b3b3f['push'](_0x7b3b3f['shift']());}}}(a203_0x3f0f,0xe3387));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';function a203_0x3f0f(){const _0x43764d=['workspace','flag','\x20--appcode\x20<code>`.','6544433qssPDl','riskLevel','Target\x20environment','trim','object','locale','Default\x20output\x20format\x20for\x20this\x20workspace\x20app\x20profile','\x20(appcode:\x20','apiDir','format','8982065yWqoYu','Pass\x20--appcode\x20<code>,\x20or\x20choose\x20one\x20of:\x20','number','Risk\x20level\x20for\x20this\x20workspace\x20app\x20profile','appcode','defaultFormat','length','env','workspace.','pageSize','App\x20\x22','6biRAbV','apps','Initialize\x20the\x20current\x20workspace\x20app\x20binding','Switch\x20the\x20current\x20workspace\x20app\x20binding','\x20workspace\x20use\x20--app\x20<name>`.','app','10cdeElS','validation','Use\x20`','\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`','Locale\x20for\x20this\x20workspace\x20app\x20profile','init','60268197hCzmjG','\x20--app\x20','keys','use','1585888rDXxEu','API\x20directory\x20path\x20for\x20this\x20workspace\x20app\x20profile','str','5624096CPsHAL','15BrJABV','globalConfig','Default\x20page\x20size\x20for\x20this\x20workspace\x20app\x20profile','\x20workspace\x20<init|use>\x20--app\x20<name>\x20[--appcode\x20<code>]','Missing\x20workspace\x20app\x20selector.','286792eZZOHa','string','write','9oPpebe','2585028MchtNr'];a203_0x3f0f=function(){return _0x43764d;};return a203_0x3f0f();}function a203_0x5623(_0x3d6934,_0x41dbb4){_0x3d6934=_0x3d6934-0xee;const _0x3f0f34=a203_0x3f0f();let _0x562364=_0x3f0f34[_0x3d6934];return _0x562364;}const WORKSPACE_USAGE=CLI_BIN_NAME+a203_0x29b80a(0x113),SAFE_PROFILE_KEYS=['appcode','env','apiDir',a203_0x29b80a(0xf0),a203_0x29b80a(0xfa),a203_0x29b80a(0x11e),a203_0x29b80a(0x122)],workspaceFlags=[{'name':a203_0x29b80a(0x101),'type':a203_0x29b80a(0x116),'description':'App\x20profile\x20name\x20to\x20use\x20in\x20this\x20workspace'},{'name':'appcode','type':'string','description':'App\x20code\x20to\x20bind\x20to\x20this\x20workspace'},{'name':a203_0x29b80a(0xf8),'type':'string','description':a203_0x29b80a(0x11f),'enum':[...RABETBASE_ENV_VALUES]},{'name':'apiDir','type':'string','description':a203_0x29b80a(0x10d)},{'name':a203_0x29b80a(0xf6),'type':a203_0x29b80a(0x116),'description':a203_0x29b80a(0x123),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':'pageSize','type':a203_0x29b80a(0xf3),'description':a203_0x29b80a(0x112)},{'name':a203_0x29b80a(0x11e),'type':a203_0x29b80a(0x116),'description':a203_0x29b80a(0xf4),'enum':[...RISK_LEVEL_VALUES]},{'name':a203_0x29b80a(0x122),'type':a203_0x29b80a(0x116),'description':a203_0x29b80a(0x106)}];function isRecord(_0x4732c8){const _0x17b09e=a203_0x29b80a;return!!_0x4732c8&&typeof _0x4732c8===_0x17b09e(0x121)&&!Array['isArray'](_0x4732c8);}function assertValidAppcode(_0x249e8f){const _0x44abce=a203_0x29b80a,{valid:_0x154775,message:_0x417ea9}=validateAppcode(_0x249e8f);if(!_0x154775)throw CliErrors[_0x44abce(0x103)]('Invalid\x20appcode:\x20'+_0x249e8f,_0x417ea9);}function sanitizeProfile(_0x2660da){if(!isRecord(_0x2660da))return{};const _0x25b20d={};for(const _0x34a2b4 of SAFE_PROFILE_KEYS){if(_0x2660da[_0x34a2b4]!==undefined)_0x25b20d[_0x34a2b4]=_0x2660da[_0x34a2b4];}return _0x25b20d;}function cloneProfile(_0x39842e){return isRecord(_0x39842e)?{..._0x39842e}:{};}function collectWorkspaceProfileOverrides(_0x3e4cbf){const _0x499b86=a203_0x29b80a,_0x190568={},_0xf2915f=_0x3e4cbf['str'](_0x499b86(0xf8)),_0x5cd1c0=_0x3e4cbf['str']('apiDir'),_0x5d9bcd=_0x3e4cbf[_0x499b86(0x10e)](_0x499b86(0xf6)),_0x88384f=_0x3e4cbf[_0x499b86(0x11b)]('pageSize'),_0xf34247=_0x3e4cbf[_0x499b86(0x10e)]('riskLevel'),_0x1e8ce7=_0x3e4cbf[_0x499b86(0x10e)](_0x499b86(0x122));if(_0xf2915f)_0x190568[_0x499b86(0xf8)]=_0xf2915f;if(_0x5cd1c0)_0x190568[_0x499b86(0xef)]=_0x5cd1c0;if(_0x5d9bcd)_0x190568[_0x499b86(0xf0)]=_0x5d9bcd;if(_0x88384f!==undefined&&_0x88384f!=='')_0x190568['pageSize']=Number(_0x88384f);if(_0xf34247)_0x190568[_0x499b86(0x11e)]=_0xf34247;if(_0x1e8ce7)_0x190568['locale']=_0x1e8ce7;return _0x190568;}async function validateWorkspaceArgs(_0x2fdcbf){const _0x23351c=a203_0x29b80a,_0x484df8=_0x2fdcbf[_0x23351c(0x10e)](_0x23351c(0x101))[_0x23351c(0x120)](),_0x30e407=_0x2fdcbf[_0x23351c(0x10e)](_0x23351c(0xf5))[_0x23351c(0x120)]();if(!_0x484df8&&!_0x30e407)throw CliErrors['validation'](_0x23351c(0x114),_0x23351c(0x104)+CLI_BIN_NAME+'\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`'+CLI_BIN_NAME+_0x23351c(0x100));if(_0x30e407)assertValidAppcode(_0x30e407);}function resolveKnownApps(){const _0x52b505=a203_0x29b80a,{config:_0x351695,layers:_0x587bfe}=readRawConfigWithLayers(),_0x2708b5=isRecord(_0x351695['apps'])?_0x351695[_0x52b505(0xfd)]:{},_0x4ff698=isRecord(_0x587bfe['globalConfig'][_0x52b505(0xfd)])?_0x587bfe[_0x52b505(0x111)][_0x52b505(0xfd)]:{};return{..._0x4ff698,..._0x2708b5};}async function configureWorkspace(_0xd92d6c,_0x384fff){const _0x303cd8=a203_0x29b80a,_0x1c53b0=_0xd92d6c[_0x303cd8(0x10e)](_0x303cd8(0x101))[_0x303cd8(0x120)](),_0x578c19=_0xd92d6c['str'](_0x303cd8(0xf5))['trim'](),_0x452292=_0x1c53b0||_0x578c19;if(!_0x452292)throw CliErrors[_0x303cd8(0x103)](_0x303cd8(0x114),'Use\x20`'+CLI_BIN_NAME+_0x303cd8(0x105)+CLI_BIN_NAME+_0x303cd8(0x100));if(_0x578c19)assertValidAppcode(_0x578c19);const _0x446b4e=resolveWriteConfigPath('project'),_0x301fde=readConfigFile(_0x446b4e),_0x25df8e=resolveKnownApps(),_0x23b70d=isRecord(_0x301fde[_0x303cd8(0xfd)])?{..._0x301fde[_0x303cd8(0xfd)]}:{},_0x1cf75d=cloneProfile(_0x23b70d[_0x452292]),_0x50b96d=sanitizeProfile(_0x25df8e[_0x452292]),_0x301a16=_0x578c19?{}:_0x50b96d,_0x1997b4=_0x578c19||_0x301a16['appcode'];if(!_0x1997b4){const _0x11f962=Object[_0x303cd8(0x10a)](_0x25df8e),_0x2c5a1b=_0x11f962[_0x303cd8(0xf7)]===0x0?_0x303cd8(0x104)+CLI_BIN_NAME+'\x20workspace\x20'+_0x384fff+_0x303cd8(0x109)+_0x452292+_0x303cd8(0x11c):_0x303cd8(0xf2)+_0x11f962['join'](',\x20');throw CliErrors['validation'](_0x303cd8(0xfb)+_0x452292+'\x22\x20not\x20found.',_0x2c5a1b);}assertValidAppcode(String(_0x1997b4));const _0x10724e={..._0x301a16,..._0x1cf75d,'appcode':String(_0x1997b4),...collectWorkspaceProfileOverrides(_0xd92d6c)};return _0x23b70d[_0x452292]=_0x10724e,_0x301fde['apps']=_0x23b70d,_0x301fde['defaultApp']=_0x452292,delete _0x301fde[_0x303cd8(0xf5)],delete _0x301fde[_0x303cd8(0x101)],_0x10724e[_0x303cd8(0xf8)]&&(_0x301fde[_0x303cd8(0xf8)]=_0x10724e[_0x303cd8(0xf8)]),writeConfigFile(_0x446b4e,_0x301fde),{'ok':!![],'message':'Workspace\x20'+(_0x384fff===_0x303cd8(0x107)?'initialized':'updated')+':\x20'+_0x452292+_0x303cd8(0xee)+_0x10724e['appcode']+').\x20Config:\x20'+_0x446b4e+'.\x20Credentials:\x20not\x20written.','data':{'operation':_0x303cd8(0xf9)+_0x384fff,'configPath':_0x446b4e,'app':_0x452292,'appcode':_0x10724e[_0x303cd8(0xf5)],'env':_0x10724e[_0x303cd8(0xf8)]??null,'credentialsWritten':![]}};}const workspaceInitDefinition={'service':a203_0x29b80a(0x11a),'command':a203_0x29b80a(0x107),'description':a203_0x29b80a(0xfe),'risk':a203_0x29b80a(0x117),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x4147e1=>configureWorkspace(_0x4147e1,a203_0x29b80a(0x107))},workspaceUseDefinition={'service':a203_0x29b80a(0x11a),'command':a203_0x29b80a(0x10b),'description':a203_0x29b80a(0xff),'risk':a203_0x29b80a(0x117),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x9d6464=>configureWorkspace(_0x9d6464,'use')};export const workspaceDefinitions=[workspaceInitDefinition,workspaceUseDefinition,workspaceAddDefinition,workspaceRemoveDefinition];export{WORKSPACE_USAGE};
1
+ const a203_0x31f5d3=a203_0x245c;(function(_0x102a1d,_0x96ab4f){const _0x8a178e=a203_0x245c,_0x4390d3=_0x102a1d();while(!![]){try{const _0x54c2a7=-parseInt(_0x8a178e(0xfa))/0x1+parseInt(_0x8a178e(0xf1))/0x2*(-parseInt(_0x8a178e(0xde))/0x3)+parseInt(_0x8a178e(0x107))/0x4*(parseInt(_0x8a178e(0xe8))/0x5)+-parseInt(_0x8a178e(0xd8))/0x6*(parseInt(_0x8a178e(0x105))/0x7)+-parseInt(_0x8a178e(0xe2))/0x8*(-parseInt(_0x8a178e(0x103))/0x9)+parseInt(_0x8a178e(0xe6))/0xa*(parseInt(_0x8a178e(0xf8))/0xb)+-parseInt(_0x8a178e(0xe9))/0xc*(-parseInt(_0x8a178e(0xf7))/0xd);if(_0x54c2a7===_0x96ab4f)break;else _0x4390d3['push'](_0x4390d3['shift']());}catch(_0x568378){_0x4390d3['push'](_0x4390d3['shift']());}}}(a203_0x4840,0xb41f1));import{CliErrors}from'../../errors.js';function a203_0x245c(_0x26cc0b,_0x51d233){_0x26cc0b=_0x26cc0b-0xd2;const _0x48406c=a203_0x4840();let _0x245cfb=_0x48406c[_0x26cc0b];return _0x245cfb;}import{CLI_BIN_NAME}from'../../constant/cli.js';import{RABETBASE_ENV_VALUES}from'../../constant/env.js';import{RABETBASE_OUTPUT_FORMAT_VALUES}from'../../constant/output.js';import{RISK_LEVEL_VALUES}from'../../constant/risk.js';import{validateAppcode}from'../../commands/common/validate.js';import{readConfigFile,readRawConfigWithLayers,resolveWriteConfigPath,writeConfigFile}from'../../context.js';import{workspaceAddDefinition}from'../../commands/workspace/add.js';import{workspaceRemoveDefinition}from'../../commands/workspace/remove.js';const WORKSPACE_USAGE=CLI_BIN_NAME+'\x20workspace\x20<init|use>\x20--app\x20<name>\x20[--appcode\x20<code>]',SAFE_PROFILE_KEYS=['appcode','env',a203_0x31f5d3(0xe4),a203_0x31f5d3(0xd7),a203_0x31f5d3(0xec),'riskLevel',a203_0x31f5d3(0x10c)],workspaceFlags=[{'name':a203_0x31f5d3(0x10b),'type':a203_0x31f5d3(0xef),'description':a203_0x31f5d3(0x102)},{'name':a203_0x31f5d3(0xf3),'type':a203_0x31f5d3(0xef),'description':a203_0x31f5d3(0xfc)},{'name':'env','type':a203_0x31f5d3(0xef),'description':a203_0x31f5d3(0xdb),'enum':[...RABETBASE_ENV_VALUES]},{'name':a203_0x31f5d3(0xe4),'type':a203_0x31f5d3(0xef),'description':a203_0x31f5d3(0xf6)},{'name':'defaultFormat','type':a203_0x31f5d3(0xef),'description':a203_0x31f5d3(0xf2),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':a203_0x31f5d3(0xec),'type':a203_0x31f5d3(0xe3),'description':a203_0x31f5d3(0xdc)},{'name':a203_0x31f5d3(0xfb),'type':a203_0x31f5d3(0xef),'description':a203_0x31f5d3(0x10a),'enum':[...RISK_LEVEL_VALUES]},{'name':a203_0x31f5d3(0x10c),'type':a203_0x31f5d3(0xef),'description':'Locale\x20for\x20this\x20workspace\x20app\x20profile'}];function isRecord(_0x2703e4){const _0xf295de=a203_0x31f5d3;return!!_0x2703e4&&typeof _0x2703e4===_0xf295de(0x109)&&!Array[_0xf295de(0xfe)](_0x2703e4);}function assertValidAppcode(_0x3d63f7){const _0x796ff0=a203_0x31f5d3,{valid:_0x47ce4d,message:_0x5d2712}=validateAppcode(_0x3d63f7);if(!_0x47ce4d)throw CliErrors[_0x796ff0(0xe5)](_0x796ff0(0xeb)+_0x3d63f7,_0x5d2712);}function sanitizeProfile(_0x477666){if(!isRecord(_0x477666))return{};const _0x2a5b4e={};for(const _0x18bcb2 of SAFE_PROFILE_KEYS){if(_0x477666[_0x18bcb2]!==undefined)_0x2a5b4e[_0x18bcb2]=_0x477666[_0x18bcb2];}return _0x2a5b4e;}function cloneProfile(_0x21695f){return isRecord(_0x21695f)?{..._0x21695f}:{};}function collectWorkspaceProfileOverrides(_0x584169){const _0x2a3971=a203_0x31f5d3,_0x1d7de7={},_0x561183=_0x584169[_0x2a3971(0xe1)](_0x2a3971(0xea)),_0x20d864=_0x584169[_0x2a3971(0xe1)]('apiDir'),_0x1610e5=_0x584169[_0x2a3971(0xe1)](_0x2a3971(0xf4)),_0x1ff810=_0x584169['flag'](_0x2a3971(0xec)),_0xa138d6=_0x584169[_0x2a3971(0xe1)](_0x2a3971(0xfb)),_0x57945c=_0x584169[_0x2a3971(0xe1)](_0x2a3971(0x10c));if(_0x561183)_0x1d7de7['env']=_0x561183;if(_0x20d864)_0x1d7de7[_0x2a3971(0xe4)]=_0x20d864;if(_0x1610e5)_0x1d7de7[_0x2a3971(0xd7)]=_0x1610e5;if(_0x1ff810!==undefined&&_0x1ff810!=='')_0x1d7de7[_0x2a3971(0xec)]=Number(_0x1ff810);if(_0xa138d6)_0x1d7de7['riskLevel']=_0xa138d6;if(_0x57945c)_0x1d7de7[_0x2a3971(0x10c)]=_0x57945c;return _0x1d7de7;}async function validateWorkspaceArgs(_0x459b41){const _0x50d603=a203_0x31f5d3,_0x304d57=_0x459b41['str']('app')[_0x50d603(0xf5)](),_0x486fd7=_0x459b41['str'](_0x50d603(0xf3))['trim']();if(!_0x304d57&&!_0x486fd7)throw CliErrors['validation']('Missing\x20workspace\x20app\x20selector.','Use\x20`'+CLI_BIN_NAME+_0x50d603(0xd3)+CLI_BIN_NAME+_0x50d603(0xee));if(_0x486fd7)assertValidAppcode(_0x486fd7);}function resolveKnownApps(){const _0x173720=a203_0x31f5d3,{config:_0x1a019a,layers:_0xaf1886}=readRawConfigWithLayers(),_0x2094b5=isRecord(_0x1a019a[_0x173720(0xd9)])?_0x1a019a[_0x173720(0xd9)]:{},_0xcf0c31=isRecord(_0xaf1886[_0x173720(0xf0)][_0x173720(0xd9)])?_0xaf1886[_0x173720(0xf0)][_0x173720(0xd9)]:{};return{..._0xcf0c31,..._0x2094b5};}async function configureWorkspace(_0x958aa,_0x103d16){const _0xe7d303=a203_0x31f5d3,_0x3aa7da=_0x958aa[_0xe7d303(0xe1)](_0xe7d303(0x10b))['trim'](),_0x3a95d9=_0x958aa['str'](_0xe7d303(0xf3))[_0xe7d303(0xf5)](),_0x5a2758=_0x3aa7da||_0x3a95d9;if(!_0x5a2758)throw CliErrors[_0xe7d303(0xe5)]('Missing\x20workspace\x20app\x20selector.',_0xe7d303(0x100)+CLI_BIN_NAME+'\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`'+CLI_BIN_NAME+_0xe7d303(0xee));if(_0x3a95d9)assertValidAppcode(_0x3a95d9);const _0xae8e7a=resolveWriteConfigPath('project'),_0x39958f=readConfigFile(_0xae8e7a),_0x5aa0ed=resolveKnownApps(),_0x42dcc1=isRecord(_0x39958f[_0xe7d303(0xd9)])?{..._0x39958f[_0xe7d303(0xd9)]}:{},_0x11e7df=cloneProfile(_0x42dcc1[_0x5a2758]),_0x38884c=sanitizeProfile(_0x5aa0ed[_0x5a2758]),_0x2f11b6=_0x3a95d9?{}:_0x38884c,_0x288e10=_0x3a95d9||_0x2f11b6[_0xe7d303(0xf3)];if(!_0x288e10){const _0x45f2bd=Object[_0xe7d303(0xdd)](_0x5aa0ed),_0x1818d8=_0x45f2bd[_0xe7d303(0xd5)]===0x0?'Use\x20`'+CLI_BIN_NAME+'\x20workspace\x20'+_0x103d16+'\x20--app\x20'+_0x5a2758+_0xe7d303(0xfd):_0xe7d303(0x104)+_0x45f2bd[_0xe7d303(0xe7)](',\x20');throw CliErrors[_0xe7d303(0xe5)]('App\x20\x22'+_0x5a2758+_0xe7d303(0x106),_0x1818d8);}assertValidAppcode(String(_0x288e10));const _0x1a9807={..._0x2f11b6,..._0x11e7df,'appcode':String(_0x288e10),...collectWorkspaceProfileOverrides(_0x958aa)};return _0x42dcc1[_0x5a2758]=_0x1a9807,_0x39958f['apps']=_0x42dcc1,_0x39958f[_0xe7d303(0xd2)]=_0x5a2758,delete _0x39958f[_0xe7d303(0xf3)],delete _0x39958f['app'],_0x1a9807[_0xe7d303(0xea)]&&(_0x39958f[_0xe7d303(0xea)]=_0x1a9807['env']),writeConfigFile(_0xae8e7a,_0x39958f),{'ok':!![],'message':_0xe7d303(0xdf)+(_0x103d16===_0xe7d303(0x101)?_0xe7d303(0xd6):'updated')+':\x20'+_0x5a2758+_0xe7d303(0xff)+_0x1a9807['appcode']+_0xe7d303(0x108)+_0xae8e7a+_0xe7d303(0xd4),'data':{'operation':'workspace.'+_0x103d16,'configPath':_0xae8e7a,'app':_0x5a2758,'appcode':_0x1a9807[_0xe7d303(0xf3)],'env':_0x1a9807[_0xe7d303(0xea)]??null,'credentialsWritten':![]}};}const workspaceInitDefinition={'service':a203_0x31f5d3(0xda),'command':a203_0x31f5d3(0x101),'description':'Initialize\x20the\x20current\x20workspace\x20app\x20binding','risk':a203_0x31f5d3(0xed),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x23c95a=>configureWorkspace(_0x23c95a,a203_0x31f5d3(0x101))},workspaceUseDefinition={'service':a203_0x31f5d3(0xda),'command':a203_0x31f5d3(0xe0),'description':a203_0x31f5d3(0xf9),'risk':a203_0x31f5d3(0xed),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x46d43d=>configureWorkspace(_0x46d43d,a203_0x31f5d3(0xe0))};export const workspaceDefinitions=[workspaceInitDefinition,workspaceUseDefinition,workspaceAddDefinition,workspaceRemoveDefinition];export{WORKSPACE_USAGE};function a203_0x4840(){const _0x3693ec=['Use\x20`','init','App\x20profile\x20name\x20to\x20use\x20in\x20this\x20workspace','9Yggaap','Pass\x20--appcode\x20<code>,\x20or\x20choose\x20one\x20of:\x20','112mxZrlB','\x22\x20not\x20found.','132092Sxucbd',').\x20Config:\x20','object','Risk\x20level\x20for\x20this\x20workspace\x20app\x20profile','app','locale','defaultApp','\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`','.\x20Credentials:\x20not\x20written.','length','initialized','format','350712wshgyD','apps','workspace','Target\x20environment','Default\x20page\x20size\x20for\x20this\x20workspace\x20app\x20profile','keys','3JocDHT','Workspace\x20','use','str','7433328MDvbYY','number','apiDir','validation','318540qiVIIU','join','175rwmtpQ','276WAdAzS','env','Invalid\x20appcode:\x20','pageSize','write','\x20workspace\x20use\x20--app\x20<name>`.','string','globalConfig','1374430WziLNm','Default\x20output\x20format\x20for\x20this\x20workspace\x20app\x20profile','appcode','defaultFormat','trim','API\x20directory\x20path\x20for\x20this\x20workspace\x20app\x20profile','701415jFqgrD','11esApnO','Switch\x20the\x20current\x20workspace\x20app\x20binding','997566uGRIAB','riskLevel','App\x20code\x20to\x20bind\x20to\x20this\x20workspace','\x20--appcode\x20<code>`.','isArray','\x20(appcode:\x20'];a203_0x4840=function(){return _0x3693ec;};return a203_0x4840();}
@@ -1 +1 @@
1
- const a204_0x4305c7=a204_0x567d;function a204_0x567d(_0x319d42,_0x3d9d32){_0x319d42=_0x319d42-0x19c;const _0x262c6a=a204_0x262c();let _0x567daf=_0x262c6a[_0x319d42];return _0x567daf;}(function(_0x6d2c6,_0x2008da){const _0x1b4e1c=a204_0x567d,_0x2ec167=_0x6d2c6();while(!![]){try{const _0x428af9=-parseInt(_0x1b4e1c(0x1a0))/0x1*(parseInt(_0x1b4e1c(0x1a9))/0x2)+-parseInt(_0x1b4e1c(0x1a8))/0x3*(parseInt(_0x1b4e1c(0x1a1))/0x4)+parseInt(_0x1b4e1c(0x19e))/0x5+-parseInt(_0x1b4e1c(0x1ac))/0x6*(-parseInt(_0x1b4e1c(0x1a2))/0x7)+parseInt(_0x1b4e1c(0x19d))/0x8+parseInt(_0x1b4e1c(0x1a5))/0x9+-parseInt(_0x1b4e1c(0x1ab))/0xa*(parseInt(_0x1b4e1c(0x1a4))/0xb);if(_0x428af9===_0x2008da)break;else _0x2ec167['push'](_0x2ec167['shift']());}catch(_0x1b42b1){_0x2ec167['push'](_0x2ec167['shift']());}}}(a204_0x262c,0x38428));import{buildAppRemoveFlags,runAppRemove,validateAppName}from'../../commands/common/app-registry.js';function a204_0x262c(){const _0x56e89b=['10Urvnqm','48RxJRlG','write','574600xGNWSn','19680VwFIBE','App\x20profile\x20name\x20to\x20remove','12cxzIuT','212UQpswQ','284977PPBUXw','name','2613391iocAIT','4078917PZNwla','remove','Remove\x20an\x20app\x20profile\x20from\x20the\x20current\x20workspace\x20(or\x20--global)','3039vXxvGr','55492oiigkk','workspace\x20remove'];a204_0x262c=function(){return _0x56e89b;};return a204_0x262c();}export const workspaceRemoveDefinition={'service':'workspace','command':a204_0x4305c7(0x1a6),'description':a204_0x4305c7(0x1a7),'risk':a204_0x4305c7(0x19c),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a204_0x4305c7(0x1a3),'description':a204_0x4305c7(0x19f),'required':!![]}],'flags':buildAppRemoveFlags(),'validate':_0x3bfdf9=>validateAppName(_0x3bfdf9,'workspace\x20remove'),'execute':_0x30287d=>runAppRemove(_0x30287d,a204_0x4305c7(0x1aa))};
1
+ function a204_0x26d1(_0x2229b9,_0x420cc3){_0x2229b9=_0x2229b9-0x18e;const _0x295d52=a204_0x295d();let _0x26d105=_0x295d52[_0x2229b9];return _0x26d105;}const a204_0x285482=a204_0x26d1;function a204_0x295d(){const _0x3d6f3d=['776988GOFMlT','312901BHyEgY','write','1025664aIinnj','5770044jBiphs','27gEEoFU','5951950CkFTIZ','6768042ppNwIJ','App\x20profile\x20name\x20to\x20remove','6910168LYsqLg','8vREoTV','workspace','name','remove','Remove\x20an\x20app\x20profile\x20from\x20the\x20current\x20workspace\x20(or\x20--global)'];a204_0x295d=function(){return _0x3d6f3d;};return a204_0x295d();}(function(_0x3c3aaf,_0x2c0e32){const _0x161466=a204_0x26d1,_0x4855c0=_0x3c3aaf();while(!![]){try{const _0x446483=-parseInt(_0x161466(0x196))/0x1*(parseInt(_0x161466(0x190))/0x2)+parseInt(_0x161466(0x198))/0x3+parseInt(_0x161466(0x195))/0x4+-parseInt(_0x161466(0x19b))/0x5+parseInt(_0x161466(0x19c))/0x6+-parseInt(_0x161466(0x199))/0x7+parseInt(_0x161466(0x18f))/0x8*(parseInt(_0x161466(0x19a))/0x9);if(_0x446483===_0x2c0e32)break;else _0x4855c0['push'](_0x4855c0['shift']());}catch(_0x896be7){_0x4855c0['push'](_0x4855c0['shift']());}}}(a204_0x295d,0xf17f1));import{buildAppRemoveFlags,runAppRemove,validateAppName}from'../../commands/common/app-registry.js';export const workspaceRemoveDefinition={'service':a204_0x285482(0x191),'command':a204_0x285482(0x193),'description':a204_0x285482(0x194),'risk':a204_0x285482(0x197),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a204_0x285482(0x192),'description':a204_0x285482(0x18e),'required':!![]}],'flags':buildAppRemoveFlags(),'validate':_0x494274=>validateAppName(_0x494274,'workspace\x20remove'),'execute':_0x536004=>runAppRemove(_0x536004,'workspace\x20remove')};
@@ -1 +1 @@
1
- const a205_0x2a2608=a205_0x3536;(function(_0x1fe300,_0xc51b32){const _0xb22d81=a205_0x3536,_0x203104=_0x1fe300();while(!![]){try{const _0x78544b=-parseInt(_0xb22d81(0x1c9))/0x1+-parseInt(_0xb22d81(0x1bc))/0x2*(-parseInt(_0xb22d81(0x1cc))/0x3)+parseInt(_0xb22d81(0x1d7))/0x4*(-parseInt(_0xb22d81(0x1b4))/0x5)+parseInt(_0xb22d81(0x1d5))/0x6*(parseInt(_0xb22d81(0x1c7))/0x7)+parseInt(_0xb22d81(0x1bb))/0x8*(parseInt(_0xb22d81(0x1d3))/0x9)+parseInt(_0xb22d81(0x1c8))/0xa+-parseInt(_0xb22d81(0x1c2))/0xb;if(_0x78544b===_0xc51b32)break;else _0x203104['push'](_0x203104['shift']());}catch(_0x40d601){_0x203104['push'](_0x203104['shift']());}}}(a205_0x11e4,0x970b1));import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.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';function a205_0x11e4(){const _0x35924d=['3640VhVlHR','Default\x20page\x20size','inherit','length','Access\x20key','format','apiDir','riskLevel','2545yYAimc','accessKey','cookie','Config\x20key\x20(','app','en-US','locale','9242536xvtQgN','567718HapnLW','zh-CN','map','has','Locale','entries','7817458avhBeA','Auth\x20cookie','toLowerCase','env','Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','7QiQQKz','4895730igDeDa','918185DdgzGe','apps','defaultApp','3yoXVZh','Target\x20environment','API\x20directory\x20path','string','filter','pageSize','keys','9FegoTU','appcode','4691862weKlNf','Risk\x20level'];a205_0x11e4=function(){return _0x35924d;};return a205_0x11e4();}export{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';export const PROJECT_CREATE_INHERITABLE_KEYS=['cookie',a205_0x2a2608(0x1b5),a205_0x2a2608(0x1ba),a205_0x2a2608(0x1dc),a205_0x2a2608(0x1de)];export const TOP_LEVEL_CONFIG_KEYS=new Set([a205_0x2a2608(0x1d4),a205_0x2a2608(0x1c5),a205_0x2a2608(0x1ba),'format',a205_0x2a2608(0x1b6),a205_0x2a2608(0x1b5),'apiDir']);export const CONFIG_ENUM_VALUES={'env':[...RABETBASE_ENV_VALUES],'format':[...RABETBASE_OUTPUT_FORMAT_VALUES]};export function formatConfigKeyList(_0x5c72c0){return[..._0x5c72c0]['join'](',\x20');}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function isTopLevelConfigKey(_0x183985){const _0x29e9fd=a205_0x2a2608;return TOP_LEVEL_CONFIG_KEYS[_0x29e9fd(0x1bf)](_0x183985);}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}function a205_0x3536(_0xb17dc6,_0x2a7a89){_0xb17dc6=_0xb17dc6-0x1b4;const _0x11e494=a205_0x11e4();let _0x3536f0=_0x11e494[_0xb17dc6];return _0x3536f0;}export function getConfigCommandKeyDescription(){const _0x50b102=a205_0x2a2608;return _0x50b102(0x1b7)+getTopLevelConfigKeySummary()+')';}export const APP_PROFILE_FLAG_KEY_MAP={'env':a205_0x2a2608(0x1c5),'apiDir':a205_0x2a2608(0x1dd),'cookie':a205_0x2a2608(0x1b6),'accessKey':'accessKey','defaultFormat':a205_0x2a2608(0x1dc),'pageSize':a205_0x2a2608(0x1d1),'riskLevel':a205_0x2a2608(0x1de),'locale':'locale'};export function getAppProfileFlagDefs(){const _0x59d973=a205_0x2a2608;return[{'name':_0x59d973(0x1c5),'type':'string','description':_0x59d973(0x1cd),'enum':[...RABETBASE_ENV_VALUES]},{'name':_0x59d973(0x1dd),'type':'string','description':_0x59d973(0x1ce)},{'name':_0x59d973(0x1b6),'type':'string','description':_0x59d973(0x1c3),'hidden':!![]},{'name':_0x59d973(0x1b5),'type':_0x59d973(0x1cf),'description':_0x59d973(0x1db),'hidden':!![]},{'name':'defaultFormat','type':_0x59d973(0x1cf),'description':_0x59d973(0x1c6),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':_0x59d973(0x1d1),'type':'number','description':_0x59d973(0x1d8)},{'name':_0x59d973(0x1de),'type':'string','description':_0x59d973(0x1d6),'enum':[...RISK_LEVEL_VALUES]},{'name':_0x59d973(0x1ba),'type':_0x59d973(0x1cf),'description':_0x59d973(0x1c0)}];}export function collectAppProfileOverrides(_0x2ca2e3){const _0x259120=a205_0x2a2608,_0x25f20c={};for(const [_0x1716d6,_0x5adf94]of Object[_0x259120(0x1c1)](APP_PROFILE_FLAG_KEY_MAP)){const _0x31bb11=_0x2ca2e3(_0x1716d6);if(!_0x31bb11)continue;_0x25f20c[_0x5adf94]=_0x5adf94==='pageSize'?Number(_0x31bb11):_0x31bb11;}return _0x25f20c;}export function buildAppProfileListFields(_0x5aa890){const _0x4d1c78=a205_0x2a2608;return{'env':_0x5aa890[_0x4d1c78(0x1c5)]??null,'apiDir':_0x5aa890['apiDir']??null,'hasCookie':!!_0x5aa890[_0x4d1c78(0x1b6)],'hasAccessKey':!!_0x5aa890[_0x4d1c78(0x1b5)],'format':_0x5aa890[_0x4d1c78(0x1dc)]??null,'pageSize':_0x5aa890['pageSize']??null,'riskLevel':_0x5aa890[_0x4d1c78(0x1de)]??null,'locale':_0x5aa890[_0x4d1c78(0x1ba)]??null};}export function buildAppDoctorFields(_0x44d971,_0x273efc){const _0x26b04=a205_0x2a2608;return{'env':{'value':_0x44d971[_0x26b04(0x1c5)]||_0x273efc[_0x26b04(0x1c5)],'source':_0x44d971[_0x26b04(0x1c5)]?'app':'inherit'},'apiDir':{'value':_0x44d971[_0x26b04(0x1dd)]||_0x273efc[_0x26b04(0x1dd)],'source':_0x44d971['apiDir']?_0x26b04(0x1b8):_0x26b04(0x1d9)},'cookie':{'value':_0x44d971['cookie']||_0x273efc[_0x26b04(0x1b6)],'source':_0x44d971['cookie']?'app':'inherit'},'accessKey':{'value':_0x44d971['accessKey']||_0x273efc['accessKey'],'source':_0x44d971[_0x26b04(0x1b5)]?_0x26b04(0x1b8):_0x26b04(0x1d9)}};}export function buildCanonicalAppConfig(_0x571b2f,_0x2d6d72){const _0x5f2537=a205_0x2a2608,_0x4596d7=_0x571b2f[_0x5f2537(0x1be)](_0x5ccda8=>String(_0x5ccda8||'')['trim']())[_0x5f2537(0x1d0)](Boolean);if(_0x4596d7[_0x5f2537(0x1da)]===0x0)return{};const _0x1afac3={};for(const _0x129dda of _0x4596d7){_0x1afac3[_0x129dda]=_0x2d6d72?{'appcode':_0x129dda,'env':_0x2d6d72}:{'appcode':_0x129dda};}return{'apps':_0x1afac3,'defaultApp':_0x4596d7[0x0]};}export function buildCanonicalProjectConfig(_0x5d558c,_0x5acb6d){const _0x5a44ae=a205_0x2a2608,{appCodes:appCodes=[],env:_0x399f8a,metadata:_0x25d2c2}=_0x5acb6d,_0x3e81c4={..._0x5d558c,..._0x25d2c2||{}};delete _0x3e81c4['appcode'],delete _0x3e81c4['app'];if(_0x399f8a)_0x3e81c4[_0x5a44ae(0x1c5)]=_0x399f8a;else!_0x3e81c4[_0x5a44ae(0x1c5)]&&(_0x3e81c4[_0x5a44ae(0x1c5)]=DEFAULT_CONFIG_VALUES[_0x5a44ae(0x1c5)]);const _0x25f350=buildCanonicalAppConfig(appCodes,_0x3e81c4[_0x5a44ae(0x1c5)]);return Object[_0x5a44ae(0x1d2)](_0x25f350)[_0x5a44ae(0x1da)]>0x0&&(_0x3e81c4[_0x5a44ae(0x1ca)]=_0x25f350[_0x5a44ae(0x1ca)],_0x3e81c4[_0x5a44ae(0x1cb)]=_0x25f350[_0x5a44ae(0x1cb)]),_0x3e81c4;}const LOCALE_MAP={'zh':a205_0x2a2608(0x1bd),'zh-cn':'zh-CN','zh_cn':a205_0x2a2608(0x1bd),'en':'en-US','en-us':'en-US','en_us':a205_0x2a2608(0x1b9)};export function normalizeLocale(_0x4ab4e2){const _0x7fc565=a205_0x2a2608;if(!_0x4ab4e2)return null;return LOCALE_MAP[_0x4ab4e2[_0x7fc565(0x1c4)]()]??null;}
1
+ const a205_0x1c5592=a205_0x96a6;function a205_0x3554(){const _0x38bcd6=['apiDir','Locale','88005IGoRGj','app','toLowerCase','Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','4606077DHPapq','defaultApp','84384ASdJlq','defaultFormat','1690164JlMLGz','locale','186tfEjLI','string','Config\x20key\x20(','map','646236hhOQaE','env','Access\x20key','Default\x20page\x20size','309194hDPrhn','riskLevel','API\x20directory\x20path','en-US','accessKey','keys','has','Auth\x20cookie','length','Target\x20environment','cookie','apps','Risk\x20level','pageSize','inherit','filter','appcode','zh-CN','format','1574235XHIaZC','join','entries'];a205_0x3554=function(){return _0x38bcd6;};return a205_0x3554();}(function(_0x105385,_0x2c33a5){const _0x361512=a205_0x96a6,_0xf0de81=_0x105385();while(!![]){try{const _0x598d15=-parseInt(_0x361512(0x1a9))/0x1+-parseInt(_0x361512(0x1a5))/0x2+-parseInt(_0x361512(0x1bc))/0x3+parseInt(_0x361512(0x19f))/0x4+parseInt(_0x361512(0x1c1))/0x5*(parseInt(_0x361512(0x1a1))/0x6)+parseInt(_0x361512(0x1c5))/0x7+parseInt(_0x361512(0x1c7))/0x8;if(_0x598d15===_0x2c33a5)break;else _0xf0de81['push'](_0xf0de81['shift']());}catch(_0x380b0a){_0xf0de81['push'](_0xf0de81['shift']());}}}(a205_0x3554,0x751ba));import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.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';export{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';export const PROJECT_CREATE_INHERITABLE_KEYS=[a205_0x1c5592(0x1b3),a205_0x1c5592(0x1ad),a205_0x1c5592(0x1a0),'format',a205_0x1c5592(0x1aa)];export const TOP_LEVEL_CONFIG_KEYS=new Set([a205_0x1c5592(0x1b9),'env',a205_0x1c5592(0x1a0),a205_0x1c5592(0x1bb),'cookie','accessKey',a205_0x1c5592(0x1bf)]);export const CONFIG_ENUM_VALUES={'env':[...RABETBASE_ENV_VALUES],'format':[...RABETBASE_OUTPUT_FORMAT_VALUES]};export function formatConfigKeyList(_0x34cdd6){const _0x55d9f3=a205_0x1c5592;return[..._0x34cdd6][_0x55d9f3(0x1bd)](',\x20');}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function isTopLevelConfigKey(_0x4619df){const _0x451631=a205_0x1c5592;return TOP_LEVEL_CONFIG_KEYS[_0x451631(0x1af)](_0x4619df);}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){const _0x16a673=a205_0x1c5592;return _0x16a673(0x1a3)+getTopLevelConfigKeySummary()+')';}export const APP_PROFILE_FLAG_KEY_MAP={'env':a205_0x1c5592(0x1a6),'apiDir':'apiDir','cookie':a205_0x1c5592(0x1b3),'accessKey':a205_0x1c5592(0x1ad),'defaultFormat':a205_0x1c5592(0x1bb),'pageSize':'pageSize','riskLevel':a205_0x1c5592(0x1aa),'locale':a205_0x1c5592(0x1a0)};export function getAppProfileFlagDefs(){const _0x425844=a205_0x1c5592;return[{'name':_0x425844(0x1a6),'type':_0x425844(0x1a2),'description':_0x425844(0x1b2),'enum':[...RABETBASE_ENV_VALUES]},{'name':'apiDir','type':_0x425844(0x1a2),'description':_0x425844(0x1ab)},{'name':_0x425844(0x1b3),'type':'string','description':_0x425844(0x1b0),'hidden':!![]},{'name':_0x425844(0x1ad),'type':_0x425844(0x1a2),'description':_0x425844(0x1a7),'hidden':!![]},{'name':_0x425844(0x19e),'type':'string','description':_0x425844(0x1c4),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':'pageSize','type':'number','description':_0x425844(0x1a8)},{'name':_0x425844(0x1aa),'type':_0x425844(0x1a2),'description':_0x425844(0x1b5),'enum':[...RISK_LEVEL_VALUES]},{'name':'locale','type':_0x425844(0x1a2),'description':_0x425844(0x1c0)}];}export function collectAppProfileOverrides(_0x532544){const _0x4cd6ef=a205_0x1c5592,_0x42b587={};for(const [_0x2827d,_0x23d665]of Object[_0x4cd6ef(0x1be)](APP_PROFILE_FLAG_KEY_MAP)){const _0xd70e56=_0x532544(_0x2827d);if(!_0xd70e56)continue;_0x42b587[_0x23d665]=_0x23d665===_0x4cd6ef(0x1b6)?Number(_0xd70e56):_0xd70e56;}return _0x42b587;}export function buildAppProfileListFields(_0x1e4f15){const _0x17c7ec=a205_0x1c5592;return{'env':_0x1e4f15[_0x17c7ec(0x1a6)]??null,'apiDir':_0x1e4f15[_0x17c7ec(0x1bf)]??null,'hasCookie':!!_0x1e4f15[_0x17c7ec(0x1b3)],'hasAccessKey':!!_0x1e4f15[_0x17c7ec(0x1ad)],'format':_0x1e4f15[_0x17c7ec(0x1bb)]??null,'pageSize':_0x1e4f15[_0x17c7ec(0x1b6)]??null,'riskLevel':_0x1e4f15[_0x17c7ec(0x1aa)]??null,'locale':_0x1e4f15[_0x17c7ec(0x1a0)]??null};}function a205_0x96a6(_0x2fac12,_0x658d4e){_0x2fac12=_0x2fac12-0x19e;const _0x3554cf=a205_0x3554();let _0x96a6c1=_0x3554cf[_0x2fac12];return _0x96a6c1;}export function buildAppDoctorFields(_0x3ab0ea,_0x205f54){const _0x112d61=a205_0x1c5592;return{'env':{'value':_0x3ab0ea[_0x112d61(0x1a6)]||_0x205f54[_0x112d61(0x1a6)],'source':_0x3ab0ea[_0x112d61(0x1a6)]?_0x112d61(0x1c2):_0x112d61(0x1b7)},'apiDir':{'value':_0x3ab0ea[_0x112d61(0x1bf)]||_0x205f54['apiDir'],'source':_0x3ab0ea[_0x112d61(0x1bf)]?_0x112d61(0x1c2):_0x112d61(0x1b7)},'cookie':{'value':_0x3ab0ea[_0x112d61(0x1b3)]||_0x205f54[_0x112d61(0x1b3)],'source':_0x3ab0ea[_0x112d61(0x1b3)]?'app':_0x112d61(0x1b7)},'accessKey':{'value':_0x3ab0ea['accessKey']||_0x205f54[_0x112d61(0x1ad)],'source':_0x3ab0ea['accessKey']?'app':_0x112d61(0x1b7)}};}export function buildCanonicalAppConfig(_0x5c5172,_0x90f89){const _0x234281=a205_0x1c5592,_0x2651de=_0x5c5172[_0x234281(0x1a4)](_0x5b66a5=>String(_0x5b66a5||'')['trim']())[_0x234281(0x1b8)](Boolean);if(_0x2651de[_0x234281(0x1b1)]===0x0)return{};const _0x122486={};for(const _0x488db4 of _0x2651de){_0x122486[_0x488db4]=_0x90f89?{'appcode':_0x488db4,'env':_0x90f89}:{'appcode':_0x488db4};}return{'apps':_0x122486,'defaultApp':_0x2651de[0x0]};}export function buildCanonicalProjectConfig(_0x5a201a,_0x21931d){const _0x5cfb2c=a205_0x1c5592,{appCodes:appCodes=[],env:_0x525fe,metadata:_0x4595b1}=_0x21931d,_0x36767c={..._0x5a201a,..._0x4595b1||{}};delete _0x36767c[_0x5cfb2c(0x1b9)],delete _0x36767c[_0x5cfb2c(0x1c2)];if(_0x525fe)_0x36767c[_0x5cfb2c(0x1a6)]=_0x525fe;else!_0x36767c[_0x5cfb2c(0x1a6)]&&(_0x36767c['env']=DEFAULT_CONFIG_VALUES['env']);const _0x120b8a=buildCanonicalAppConfig(appCodes,_0x36767c[_0x5cfb2c(0x1a6)]);return Object[_0x5cfb2c(0x1ae)](_0x120b8a)[_0x5cfb2c(0x1b1)]>0x0&&(_0x36767c['apps']=_0x120b8a[_0x5cfb2c(0x1b4)],_0x36767c[_0x5cfb2c(0x1c6)]=_0x120b8a[_0x5cfb2c(0x1c6)]),_0x36767c;}const LOCALE_MAP={'zh':a205_0x1c5592(0x1ba),'zh-cn':a205_0x1c5592(0x1ba),'zh_cn':a205_0x1c5592(0x1ba),'en':a205_0x1c5592(0x1ac),'en-us':'en-US','en_us':a205_0x1c5592(0x1ac)};export function normalizeLocale(_0x4f5e81){const _0x32d9ef=a205_0x1c5592;if(!_0x4f5e81)return null;return LOCALE_MAP[_0x4f5e81[_0x32d9ef(0x1c3)]()]??null;}
@@ -1 +1 @@
1
- const a206_0x34f8c9=a206_0x141c;(function(_0x52517b,_0x224fdb){const _0x354846=a206_0x141c,_0x2f4c52=_0x52517b();while(!![]){try{const _0x34d7c7=-parseInt(_0x354846(0x105))/0x1*(parseInt(_0x354846(0xfb))/0x2)+-parseInt(_0x354846(0xf6))/0x3*(parseInt(_0x354846(0xfe))/0x4)+-parseInt(_0x354846(0x101))/0x5*(parseInt(_0x354846(0xfa))/0x6)+-parseInt(_0x354846(0x100))/0x7*(parseInt(_0x354846(0xff))/0x8)+-parseInt(_0x354846(0x103))/0x9*(parseInt(_0x354846(0xf8))/0xa)+parseInt(_0x354846(0xf7))/0xb+-parseInt(_0x354846(0xf9))/0xc*(-parseInt(_0x354846(0xfc))/0xd);if(_0x34d7c7===_0x224fdb)break;else _0x2f4c52['push'](_0x2f4c52['shift']());}catch(_0x352a1e){_0x2f4c52['push'](_0x2f4c52['shift']());}}}(a206_0x21bd,0x2d110));export const RABETBASE_CDN_BASE_URL=a206_0x34f8c9(0x104);export const CLI_VERSION_POLICY_URL=RABETBASE_CDN_BASE_URL+a206_0x34f8c9(0xfd);function a206_0x21bd(){const _0x46cac1=['27339bHypzu','87UeLsAq','2995553CtouAQ','5410gDTaJT','76872BbDXdu','216DuxlGy','2IFeSpa','1703yQUooM','/config/index.json','37740jzRDYL','24zpqENA','558033oTBtEX','27725oaXTkX','/templates/projects','3114DQATOR','https://g.lovrabet.com/dist/rabetbase-cli'];a206_0x21bd=function(){return _0x46cac1;};return a206_0x21bd();}function a206_0x141c(_0x2d5dde,_0x1d8598){_0x2d5dde=_0x2d5dde-0xf6;const _0x21bdc0=a206_0x21bd();let _0x141c53=_0x21bdc0[_0x2d5dde];return _0x141c53;}export const PROJECT_TEMPLATE_ASSET_BASE_URL=RABETBASE_CDN_BASE_URL+a206_0x34f8c9(0x102);
1
+ const a206_0x391fad=a206_0x7cc2;(function(_0x818115,_0x333f5d){const _0x191325=a206_0x7cc2,_0x366a83=_0x818115();while(!![]){try{const _0x1125a4=parseInt(_0x191325(0x1ca))/0x1+-parseInt(_0x191325(0x1cf))/0x2*(-parseInt(_0x191325(0x1cc))/0x3)+-parseInt(_0x191325(0x1cb))/0x4+-parseInt(_0x191325(0x1c8))/0x5+parseInt(_0x191325(0x1c6))/0x6*(-parseInt(_0x191325(0x1cd))/0x7)+parseInt(_0x191325(0x1c3))/0x8*(parseInt(_0x191325(0x1c4))/0x9)+-parseInt(_0x191325(0x1c2))/0xa*(-parseInt(_0x191325(0x1c7))/0xb);if(_0x1125a4===_0x333f5d)break;else _0x366a83['push'](_0x366a83['shift']());}catch(_0x1f3345){_0x366a83['push'](_0x366a83['shift']());}}}(a206_0x35a0,0x9f483));function a206_0x35a0(){const _0x14c7e9=['7qDqbmW','https://g.lovrabet.com/dist/rabetbase-cli','560IIdFpL','20714500GTRRZL','8RJCEdD','1598238wucBGA','/templates/projects','6295866TWdzDZ','11iTQPLF','5900745tbbOqA','/config/index.json','722930IWEbBC','3960012aoDCHi','9642UWGCMr'];a206_0x35a0=function(){return _0x14c7e9;};return a206_0x35a0();}export const RABETBASE_CDN_BASE_URL=a206_0x391fad(0x1ce);function a206_0x7cc2(_0x1e558f,_0x3c73d7){_0x1e558f=_0x1e558f-0x1c2;const _0x35a0da=a206_0x35a0();let _0x7cc2d1=_0x35a0da[_0x1e558f];return _0x7cc2d1;}export const CLI_VERSION_POLICY_URL=RABETBASE_CDN_BASE_URL+a206_0x391fad(0x1c9);export const PROJECT_TEMPLATE_ASSET_BASE_URL=RABETBASE_CDN_BASE_URL+a206_0x391fad(0x1c5);