@lovrabet/rabetbase-cli 2.5.4 → 2.5.5-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 (379) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/api-group.js +1 -1
  3. package/lib/api/fetch-model-list.js +1 -1
  4. package/lib/api/generate-api-file.js +1 -1
  5. package/lib/api/generate-sdk-config-file.js +1 -1
  6. package/lib/api/legacy-api-file.js +1 -1
  7. package/lib/api/model-registry-file.js +1 -1
  8. package/lib/api/model-registry-scaffold.js +1 -1
  9. package/lib/api/model-source.js +1 -1
  10. package/lib/auth/auth-server-ui.js +1 -1
  11. package/lib/auth/auth-server.js +1 -1
  12. package/lib/auth/constant.js +1 -1
  13. package/lib/auth/get-cookie.js +1 -1
  14. package/lib/auth/get-session-user.js +1 -1
  15. package/lib/auth/is-session-valid.js +1 -1
  16. package/lib/auth/login-success-html.js +1 -1
  17. package/lib/auth/logout.js +1 -1
  18. package/lib/cli-flags.js +1 -1
  19. package/lib/cli.js +1 -1
  20. package/lib/commands/api/generate.js +1 -1
  21. package/lib/commands/api/index.js +1 -1
  22. package/lib/commands/api/list.js +1 -1
  23. package/lib/commands/api/pull.js +1 -1
  24. package/lib/commands/api/shared.js +1 -1
  25. package/lib/commands/app/detail.js +1 -1
  26. package/lib/commands/app/index.js +1 -1
  27. package/lib/commands/app/list.js +1 -1
  28. package/lib/commands/app/members-list.js +1 -1
  29. package/lib/commands/app/remote-directory.js +1 -1
  30. package/lib/commands/app/shared.js +1 -1
  31. package/lib/commands/app-config/delete.js +1 -1
  32. package/lib/commands/app-config/get.js +1 -1
  33. package/lib/commands/app-config/index.js +1 -1
  34. package/lib/commands/app-config/list.js +1 -1
  35. package/lib/commands/app-config/set.js +1 -1
  36. package/lib/commands/app-config/shared.js +1 -1
  37. package/lib/commands/auth/index.js +1 -1
  38. package/lib/commands/bff/create.js +1 -1
  39. package/lib/commands/bff/delete.js +1 -1
  40. package/lib/commands/bff/detail.js +1 -1
  41. package/lib/commands/bff/index.js +1 -1
  42. package/lib/commands/bff/list.js +1 -1
  43. package/lib/commands/bff/logs.js +1 -1
  44. package/lib/commands/bff/pull.js +1 -1
  45. package/lib/commands/bff/push.js +1 -1
  46. package/lib/commands/bff/status.js +1 -1
  47. package/lib/commands/cli-skill/index.js +1 -1
  48. package/lib/commands/cli-update.js +1 -1
  49. package/lib/commands/codegen/index.js +1 -1
  50. package/lib/commands/codegen/sdk.js +1 -1
  51. package/lib/commands/codegen/sql.js +1 -1
  52. package/lib/commands/common/app-registry.js +1 -1
  53. package/lib/commands/common/app-selector.js +1 -1
  54. package/lib/commands/common/async-task.js +1 -1
  55. package/lib/commands/common/dry-run.js +1 -1
  56. package/lib/commands/common/flags.js +1 -1
  57. package/lib/commands/common/local-file.js +1 -1
  58. package/lib/commands/common/validate.js +1 -1
  59. package/lib/commands/config/delete.js +1 -1
  60. package/lib/commands/config/get.js +1 -1
  61. package/lib/commands/config/index.js +1 -1
  62. package/lib/commands/config/init.js +1 -1
  63. package/lib/commands/config/list.js +1 -1
  64. package/lib/commands/config/set.js +1 -1
  65. package/lib/commands/config/shared.js +1 -1
  66. package/lib/commands/dataset/batch-design.js +1 -1
  67. package/lib/commands/dataset/business-group-update.js +1 -1
  68. package/lib/commands/dataset/business-groups.js +1 -1
  69. package/lib/commands/dataset/capability.js +1 -1
  70. package/lib/commands/dataset/cross-relation-create.js +1 -1
  71. package/lib/commands/dataset/cross-relation-delete.js +1 -1
  72. package/lib/commands/dataset/cross-relation-list.js +1 -1
  73. package/lib/commands/dataset/cross-relation-shared.js +1 -1
  74. package/lib/commands/dataset/cross-relation-update.js +1 -1
  75. package/lib/commands/dataset/delete.js +1 -1
  76. package/lib/commands/dataset/detail.js +1 -1
  77. package/lib/commands/dataset/extend-update.js +1 -1
  78. package/lib/commands/dataset/field-restore.js +1 -1
  79. package/lib/commands/dataset/field-update.js +1 -1
  80. package/lib/commands/dataset/generate.js +1 -1
  81. package/lib/commands/dataset/index.js +1 -1
  82. package/lib/commands/dataset/list.js +1 -1
  83. package/lib/commands/dataset/operations.js +1 -1
  84. package/lib/commands/dataset/relation-audit.js +1 -1
  85. package/lib/commands/dataset/relation-create.js +1 -1
  86. package/lib/commands/dataset/relation-delete.js +1 -1
  87. package/lib/commands/dataset/relation-shared.js +1 -1
  88. package/lib/commands/dataset/relation-update.js +1 -1
  89. package/lib/commands/dataset/relations.js +1 -1
  90. package/lib/commands/dataset/rename.js +1 -1
  91. package/lib/commands/dataset/restore.js +1 -1
  92. package/lib/commands/dataset/user-deleted-field-list.js +1 -1
  93. package/lib/commands/db/analysis-batching.js +1 -1
  94. package/lib/commands/db/analyze-batch-plan.js +1 -1
  95. package/lib/commands/db/analyze-cancel.js +1 -1
  96. package/lib/commands/db/analyze-start.js +1 -1
  97. package/lib/commands/db/analyze-status.js +1 -1
  98. package/lib/commands/db/create.js +1 -1
  99. package/lib/commands/db/delete.js +1 -1
  100. package/lib/commands/db/detail.js +1 -1
  101. package/lib/commands/db/diff-refresh-start.js +1 -1
  102. package/lib/commands/db/diff-refresh-status.js +1 -1
  103. package/lib/commands/db/diff.js +1 -1
  104. package/lib/commands/db/index.js +1 -1
  105. package/lib/commands/db/list.js +1 -1
  106. package/lib/commands/db/shared.js +1 -1
  107. package/lib/commands/db/table-diff-shared.js +1 -1
  108. package/lib/commands/db/tables.js +1 -1
  109. package/lib/commands/db/test.js +1 -1
  110. package/lib/commands/db/update.js +1 -1
  111. package/lib/commands/deployment/index.js +1 -1
  112. package/lib/commands/deployment/sync-all.js +1 -1
  113. package/lib/commands/deployment/sync-jobs.js +1 -1
  114. package/lib/commands/deployment/sync-status.js +1 -1
  115. package/lib/commands/doctor.js +1 -1
  116. package/lib/commands/file/index.js +1 -1
  117. package/lib/commands/flow/create.js +1 -1
  118. package/lib/commands/flow/detail.js +1 -1
  119. package/lib/commands/flow/index.js +1 -1
  120. package/lib/commands/flow/list.js +1 -1
  121. package/lib/commands/flow/publish.js +1 -1
  122. package/lib/commands/flow/runtime-resources-shared.js +1 -1
  123. package/lib/commands/flow/runtime-role-list.js +1 -1
  124. package/lib/commands/flow/runtime-role-user-list.js +1 -1
  125. package/lib/commands/flow/runtime-user-search.js +1 -1
  126. package/lib/commands/flow/shared.js +1 -1
  127. package/lib/commands/flow/update.js +1 -1
  128. package/lib/commands/flow/validate.js +1 -1
  129. package/lib/commands/instant-api-policy/current.js +1 -1
  130. package/lib/commands/instant-api-policy/index.js +1 -1
  131. package/lib/commands/instant-api-policy/init.js +1 -1
  132. package/lib/commands/instant-api-policy/publish.js +1 -1
  133. package/lib/commands/instant-api-policy/pull.js +1 -1
  134. package/lib/commands/instant-api-policy/revision.js +1 -1
  135. package/lib/commands/instant-api-policy/revisions.js +1 -1
  136. package/lib/commands/instant-api-policy/rollback.js +1 -1
  137. package/lib/commands/instant-api-policy/shared.js +1 -1
  138. package/lib/commands/instant-api-policy/validate.js +1 -1
  139. package/lib/commands/issue/index.js +1 -1
  140. package/lib/commands/issue/nudge.js +1 -1
  141. package/lib/commands/issue/report.js +1 -1
  142. package/lib/commands/issue/shared.js +1 -1
  143. package/lib/commands/kb/create.js +1 -1
  144. package/lib/commands/kb/delete.js +1 -1
  145. package/lib/commands/kb/detail.js +1 -1
  146. package/lib/commands/kb/index.js +1 -1
  147. package/lib/commands/kb/list.js +1 -1
  148. package/lib/commands/kb/search.js +1 -1
  149. package/lib/commands/kb/shared.js +1 -1
  150. package/lib/commands/kb/update.js +1 -1
  151. package/lib/commands/logs/index.js +1 -1
  152. package/lib/commands/menu/asset-update.js +1 -1
  153. package/lib/commands/menu/delete.js +1 -1
  154. package/lib/commands/menu/external-link-create.js +1 -1
  155. package/lib/commands/menu/external-link-update.js +1 -1
  156. package/lib/commands/menu/group-create.js +1 -1
  157. package/lib/commands/menu/group-update.js +1 -1
  158. package/lib/commands/menu/index.js +1 -1
  159. package/lib/commands/menu/list.js +1 -1
  160. package/lib/commands/menu/move.js +1 -1
  161. package/lib/commands/menu/regroup-start.js +1 -1
  162. package/lib/commands/menu/rename.js +1 -1
  163. package/lib/commands/menu/shared/compare-table.js +1 -1
  164. package/lib/commands/menu/shared/delete-plan.js +1 -1
  165. package/lib/commands/menu/shared/facts.js +1 -1
  166. package/lib/commands/menu/shared/index.js +1 -1
  167. package/lib/commands/menu/shared/inquirer.js +1 -1
  168. package/lib/commands/menu/shared/local-pages.js +1 -1
  169. package/lib/commands/menu/shared/logic.js +1 -1
  170. package/lib/commands/menu/shared/mutations.js +1 -1
  171. package/lib/commands/menu/shared/path.js +1 -1
  172. package/lib/commands/menu/shared/service.js +1 -1
  173. package/lib/commands/menu/shared/subapp-assets.js +1 -1
  174. package/lib/commands/menu/shared/sync-core.js +1 -1
  175. package/lib/commands/menu/shared/update-core.js +1 -1
  176. package/lib/commands/menu/shared/valid-url.js +1 -1
  177. package/lib/commands/menu/subapp-assets-status.js +1 -1
  178. package/lib/commands/menu/subapp-assets-update.js +1 -1
  179. package/lib/commands/menu/sync.js +1 -1
  180. package/lib/commands/menu/visibility-update.js +1 -1
  181. package/lib/commands/notification/config-create.js +1 -1
  182. package/lib/commands/notification/config-delete.js +1 -1
  183. package/lib/commands/notification/config-list.js +1 -1
  184. package/lib/commands/notification/config-update.js +1 -1
  185. package/lib/commands/notification/index.js +1 -1
  186. package/lib/commands/notification/shared.js +1 -1
  187. package/lib/commands/ocr/index.js +1 -1
  188. package/lib/commands/page/create.js +1 -1
  189. package/lib/commands/page/custom/detail.js +1 -1
  190. package/lib/commands/page/custom/list.js +1 -1
  191. package/lib/commands/page/custom/publish.js +1 -1
  192. package/lib/commands/page/custom/shared.js +1 -1
  193. package/lib/commands/page/custom/syntax.js +1 -1
  194. package/lib/commands/page/custom/update.js +1 -1
  195. package/lib/commands/page/data-list-status.js +1 -1
  196. package/lib/commands/page/generate-start.js +1 -1
  197. package/lib/commands/page/generate-status.js +1 -1
  198. package/lib/commands/page/index.js +1 -1
  199. package/lib/commands/page/pull.js +1 -1
  200. package/lib/commands/page/push.js +1 -1
  201. package/lib/commands/page/relation-audit.js +1 -1
  202. package/lib/commands/page/restore.js +1 -1
  203. package/lib/commands/page/shared.js +1 -1
  204. package/lib/commands/page/sync.js +1 -1
  205. package/lib/commands/project/api-architecture-upgrade.js +1 -1
  206. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  207. package/lib/commands/project/create/format-elapsed.js +1 -1
  208. package/lib/commands/project/create/main.js +1 -1
  209. package/lib/commands/project/create/materialize-project-template.js +1 -1
  210. package/lib/commands/project/create/project-name.js +1 -1
  211. package/lib/commands/project/create/project-template-archive.js +1 -1
  212. package/lib/commands/project/create/project-template-path.js +1 -1
  213. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  214. package/lib/commands/project/create/use-format-code.js +1 -1
  215. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  216. package/lib/commands/project/domain-routing-sync.js +1 -1
  217. package/lib/commands/project/index.js +1 -1
  218. package/lib/commands/project/upgrade.js +1 -1
  219. package/lib/commands/registry.js +1 -1
  220. package/lib/commands/role/delete.js +1 -1
  221. package/lib/commands/role/detail.js +1 -1
  222. package/lib/commands/role/index.js +1 -1
  223. package/lib/commands/role/list.js +1 -1
  224. package/lib/commands/role/shared.js +1 -1
  225. package/lib/commands/role/update.js +1 -1
  226. package/lib/commands/role/user-add.js +1 -1
  227. package/lib/commands/role/user-remove.js +1 -1
  228. package/lib/commands/role/user-resolve.js +1 -1
  229. package/lib/commands/rule/get.js +1 -1
  230. package/lib/commands/rule/index.js +1 -1
  231. package/lib/commands/rule/list.js +1 -1
  232. package/lib/commands/rule/set.js +1 -1
  233. package/lib/commands/rule/shared.js +1 -1
  234. package/lib/commands/run/index.js +1 -1
  235. package/lib/commands/schema.js +1 -1
  236. package/lib/commands/sql/create.js +1 -1
  237. package/lib/commands/sql/delete.js +1 -1
  238. package/lib/commands/sql/detail.js +1 -1
  239. package/lib/commands/sql/exec.js +1 -1
  240. package/lib/commands/sql/index.js +1 -1
  241. package/lib/commands/sql/list.js +1 -1
  242. package/lib/commands/sql/pull.js +1 -1
  243. package/lib/commands/sql/push.js +1 -1
  244. package/lib/commands/sql/shared.js +1 -1
  245. package/lib/commands/sql/status.js +1 -1
  246. package/lib/commands/sql/validate.js +1 -1
  247. package/lib/commands/task/index.js +1 -1
  248. package/lib/commands/task/status.js +1 -1
  249. package/lib/commands/tenant/index.js +1 -1
  250. package/lib/commands/tenant/members-list.js +1 -1
  251. package/lib/commands/tenant/shared.js +1 -1
  252. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  253. package/lib/commands/user-account/feishu-bind.js +1 -1
  254. package/lib/commands/user-account/index.js +1 -1
  255. package/lib/commands/workspace/add.js +1 -1
  256. package/lib/commands/workspace/index.js +1 -1
  257. package/lib/commands/workspace/remove.js +1 -1
  258. package/lib/config/domain-config.js +1 -1
  259. package/lib/config/project-domain-routing.js +1 -1
  260. package/lib/config/region-config.js +1 -1
  261. package/lib/config/schema.js +1 -1
  262. package/lib/constant/cdn.js +1 -1
  263. package/lib/constant/cli.js +1 -1
  264. package/lib/constant/defaults.js +1 -1
  265. package/lib/constant/domain.js +1 -1
  266. package/lib/constant/env.js +1 -1
  267. package/lib/constant/output.js +1 -1
  268. package/lib/constant/paths.js +1 -1
  269. package/lib/constant/region.js +1 -1
  270. package/lib/constant/risk.js +1 -1
  271. package/lib/constant/routing-profile.js +1 -1
  272. package/lib/context/app-resolver.js +1 -1
  273. package/lib/context/auth-resolver.js +1 -1
  274. package/lib/context/config-loader.js +1 -1
  275. package/lib/context.js +1 -1
  276. package/lib/core/alias-resolver.js +1 -1
  277. package/lib/core/api-client.js +1 -1
  278. package/lib/core/bff/config.js +1 -1
  279. package/lib/core/bff/file-system.js +1 -1
  280. package/lib/core/bff/hash.js +1 -1
  281. package/lib/core/bff/hook-directory.js +1 -1
  282. package/lib/core/bff/lock.js +1 -1
  283. package/lib/core/bff/utils.js +1 -1
  284. package/lib/core/cross-db-relation.js +1 -1
  285. package/lib/core/db-resolver.js +1 -1
  286. package/lib/core/flow-config.js +1 -1
  287. package/lib/core/instant-api-policy/config.js +1 -1
  288. package/lib/core/kb-search-client.js +1 -1
  289. package/lib/core/page/file-system.js +1 -1
  290. package/lib/core/page/hash.js +1 -1
  291. package/lib/core/page/lock.js +1 -1
  292. package/lib/core/page/lr-smart-jsx.js +1 -1
  293. package/lib/core/sql-index-auditor.js +1 -1
  294. package/lib/core/sql-sync/config.js +1 -1
  295. package/lib/core/sql-sync/file-system.js +1 -1
  296. package/lib/core/sql-sync/hash.js +1 -1
  297. package/lib/core/sql-sync/lock.js +1 -1
  298. package/lib/core/sql-sync/utils.js +1 -1
  299. package/lib/core/sql-validator.js +1 -1
  300. package/lib/errors.js +1 -1
  301. package/lib/framework/build-all-flags.js +1 -1
  302. package/lib/framework/error-output.js +1 -1
  303. package/lib/framework/explicit-yes.js +1 -1
  304. package/lib/framework/flags.js +1 -1
  305. package/lib/framework/help.js +1 -1
  306. package/lib/framework/index.js +1 -1
  307. package/lib/framework/output.js +1 -1
  308. package/lib/framework/response.js +1 -1
  309. package/lib/framework/runner-alias.js +1 -1
  310. package/lib/framework/runner.js +1 -1
  311. package/lib/framework/schema-export.js +1 -1
  312. package/lib/framework/supported-flags.js +1 -1
  313. package/lib/framework/types.js +1 -1
  314. package/lib/generated/build-info.d.ts +4 -4
  315. package/lib/generated/build-info.js +1 -1
  316. package/lib/generated/official-routing.js +1 -1
  317. package/lib/generated/routing-contract.js +1 -1
  318. package/lib/help.js +1 -1
  319. package/lib/postinstall.js +1 -1
  320. package/lib/runtime/confirmation.js +1 -1
  321. package/lib/runtime/event.js +1 -1
  322. package/lib/runtime/index.js +1 -1
  323. package/lib/runtime/queue.js +1 -1
  324. package/lib/runtime/resolve.js +1 -1
  325. package/lib/skills/builtin-skill.js +1 -1
  326. package/lib/skills/main.js +1 -1
  327. package/lib/skills/npx-skills-add.js +1 -1
  328. package/lib/skills/skill-presence.js +1 -1
  329. package/lib/telemetry/cli-command-trace.js +1 -1
  330. package/lib/telemetry/cli-help-trace.js +1 -1
  331. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  332. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  333. package/lib/telemetry/send-cli-trace-log.js +1 -1
  334. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  335. package/lib/utils/ai_config.js +1 -1
  336. package/lib/utils/apply-jq-filter.js +1 -1
  337. package/lib/utils/cdn-config.js +1 -1
  338. package/lib/utils/check-sdk-version.js +1 -1
  339. package/lib/utils/cli-version-check.js +1 -1
  340. package/lib/utils/cli-version-policy.js +1 -1
  341. package/lib/utils/config.js +1 -1
  342. package/lib/utils/entity-with-id.js +1 -1
  343. package/lib/utils/file-utils.js +1 -1
  344. package/lib/utils/guides-cdn.js +1 -1
  345. package/lib/utils/http-client.js +1 -1
  346. package/lib/utils/is-non-interactive.js +1 -1
  347. package/lib/utils/logger.js +1 -1
  348. package/lib/utils/params.js +1 -1
  349. package/lib/utils/platform.js +1 -1
  350. package/lib/utils/sleep.js +1 -1
  351. package/lib/utils/template-replacer.js +1 -1
  352. package/lib/utils/update-notice.js +1 -1
  353. package/lib/utils/version.js +1 -1
  354. package/lib/utils/with-active-cookie.js +1 -1
  355. package/lib/utils/write-cli-side-channel.js +1 -1
  356. package/package.json +2 -1
  357. package/skills/rabetbase/SKILL.md +1 -1
  358. package/skills/rabetbase-page-generation/SKILL.md +35 -0
  359. package/skills/rabetbase-page-generation/references/component-baseline.md +18 -0
  360. package/skills/rabetbase-page-generation/references/generation.md +77 -0
  361. package/skills/rabetbase-page-generation/templates/onepage/build.mjs +63 -0
  362. package/skills/rabetbase-page-generation/templates/onepage/create/README.md +20 -0
  363. package/skills/rabetbase-page-generation/templates/onepage/create/index.jsx +4 -0
  364. package/skills/rabetbase-page-generation/templates/onepage/create/preview.png +0 -0
  365. package/skills/rabetbase-page-generation/templates/onepage/detail/README.md +20 -0
  366. package/skills/rabetbase-page-generation/templates/onepage/detail/index.jsx +194 -0
  367. package/skills/rabetbase-page-generation/templates/onepage/detail/preview.png +0 -0
  368. package/skills/rabetbase-page-generation/templates/onepage/list/README.md +20 -0
  369. package/skills/rabetbase-page-generation/templates/onepage/list/index.jsx +717 -0
  370. package/skills/rabetbase-page-generation/templates/onepage/list/preview.png +0 -0
  371. package/skills/rabetbase-page-generation/templates/onepage/shared/editor.jsx +395 -0
  372. package/skills/rabetbase-page-generation/templates/onepage/shared/model.js +141 -0
  373. package/skills/rabetbase-page-generation/templates/onepage/shared/page.css +377 -0
  374. package/skills/rabetbase-page-generation/templates/onepage/shared/record-layout.jsx +90 -0
  375. package/skills/rabetbase-page-generation/templates/onepage/shared/responsive.jsx +70 -0
  376. package/skills/rabetbase-page-generation/templates/onepage/update/README.md +21 -0
  377. package/skills/rabetbase-page-generation/templates/onepage/update/index.jsx +4 -0
  378. package/skills/rabetbase-page-generation/templates/onepage/update/preview.png +0 -0
  379. package/skills/rabetbase.manifest.json +3 -3
@@ -1 +1 @@
1
- const a224_0x13a989=a224_0x3862;(function(_0x3d750c,_0x3eeaf8){const _0x1ec2ad=a224_0x3862,_0x1278ef=_0x3d750c();while(!![]){try{const _0x3b27a7=parseInt(_0x1ec2ad(0xb8))/0x1+-parseInt(_0x1ec2ad(0xc7))/0x2+-parseInt(_0x1ec2ad(0xeb))/0x3+parseInt(_0x1ec2ad(0xd2))/0x4*(-parseInt(_0x1ec2ad(0xc5))/0x5)+parseInt(_0x1ec2ad(0xba))/0x6+-parseInt(_0x1ec2ad(0xd1))/0x7*(parseInt(_0x1ec2ad(0xea))/0x8)+parseInt(_0x1ec2ad(0xd3))/0x9;if(_0x3b27a7===_0x3eeaf8)break;else _0x1278ef['push'](_0x1278ef['shift']());}catch(_0x5df6ab){_0x1278ef['push'](_0x1278ef['shift']());}}}(a224_0x10bc,0x3e6ca));import{getTenantMembers,listDevUserRoleRelations,listAppRoles}from'../../core/api-client.js';import{getSessionUserInfo}from'../../auth/get-session-user.js';import{CliErrors}from'../../errors.js';function a224_0x10bc(){const _0x3491d8=['flagMissing','Role\x20name','string','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','expectUserCount','No\x20tenant\x20member\x20matches\x20\x22','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','Disambiguate\x20with\x20--role\x20<id>.','nickname','push','Missing\x20user\x20reference.','Pass\x20--role\x20<id|name>.','Role\x20id\x20or\x20exact\x20role\x20name','Anti-drift\x20check\x20failed:\x20expected\x20','Pass\x20--user\x20<id|name>.','Cannot\x20',';\x20no\x20change.','Use\x20the\x20platform\x20ownership-transfer\x20workflow\x20to\x20change\x20the\x20application\x20owner.','ADMIN','user','510258dDlwqm','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','2081046pQSyMt','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','includes','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','dryRun','OWNER','role','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','\x20duplicate\x20memberships\x20for\x20user\x20','validation','\x20is\x20already\x20a\x20member\x20of\x20role\x20','720740HxFwQT','remark','391520doLJaB','/smartapi/permit/user-role/create','dev','totalCount','appCode','user-add','expect-user-count','test','DEV','\x20members\x20of\x20the\x20OWNER\x20role.','8218IwaZoF','12gDrkHQ','5955597rMrNMk','filter','name','trim','map','userId','\x20built-in\x20role\x20','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','Multiple\x20tenant\x20members\x20match\x20\x22','\x22:\x20','tenant_code','str','Role\x20name\x20\x22','Role\x20id\x20','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','username','CUSTOM','toLowerCase','roleType','number','roleName','Check\x20the\x20nickname/username.\x20','User\x20','1552zXDLQT','1221546EpSTxM','length','join','\x20is\x20not\x20a\x20member\x20of\x20role\x20'];a224_0x10bc=function(){return _0x3491d8;};return a224_0x10bc();}export const ROLE_ID_FLAG={'name':'id','type':'number','required':!![],'description':'Role\x20id\x20(from\x20`role\x20list`)'};export const ROLE_REF_FLAG={'name':a224_0x13a989(0xc0),'type':a224_0x13a989(0xf1),'required':!![],'description':a224_0x13a989(0xfb)};export const USER_REF_FLAG={'name':'user','type':a224_0x13a989(0xf1),'required':!![],'description':a224_0x13a989(0xda)};export const NAME_FLAG={'name':a224_0x13a989(0xd5),'type':a224_0x13a989(0xf1),'required':!![],'description':a224_0x13a989(0xf0)};export const USER_NAME_FLAG={'name':a224_0x13a989(0xd5),'type':a224_0x13a989(0xf1),'required':!![],'description':a224_0x13a989(0xc1)};export const REMARK_FLAG={'name':a224_0x13a989(0xc6),'type':'string','required':![],'description':'Optional\x20role\x20remark/description'};export const EXPECT_USER_COUNT_FLAG={'name':a224_0x13a989(0xcd),'type':a224_0x13a989(0xe6),'required':![],'description':a224_0x13a989(0xbd)};export const BUILTIN_ROLE_TYPES=[a224_0x13a989(0x101),a224_0x13a989(0xcf),a224_0x13a989(0xbf)];export function isBuiltinRole(_0x34331b){return BUILTIN_ROLE_TYPES['includes'](_0x34331b);}export function assertCustomRole(_0x558208,_0x1058e0){const _0x20f4e4=a224_0x13a989;if(_0x558208[_0x20f4e4(0xe5)]!==_0x20f4e4(0xe3))throw CliErrors[_0x20f4e4(0xc3)](_0x20f4e4(0xfe)+_0x1058e0+_0x20f4e4(0xd9)+_0x558208['roleName']+'\x20('+_0x558208[_0x20f4e4(0xe5)]+').',_0x20f4e4(0xbb));}export function projectRole(_0x552e1e){const _0x32f6c7=a224_0x13a989;return{'id':_0x552e1e['id'],'roleName':_0x552e1e['roleName'],'roleType':_0x552e1e[_0x32f6c7(0xe5)],'remark':_0x552e1e[_0x32f6c7(0xc6)],'userCount':_0x552e1e['userCount'],'permitCount':_0x552e1e['permitCount'],'builtin':isBuiltinRole(_0x552e1e[_0x32f6c7(0xe5)])};}export async function resolveRoleRef(_0x4fbf47,_0x38a803){const _0x246ddc=a224_0x13a989,_0x2f5085=_0x38a803[_0x246ddc(0xd6)]();if(!_0x2f5085)throw CliErrors[_0x246ddc(0xc3)]('Missing\x20role\x20reference.',_0x246ddc(0xfa));if(/^\d+$/[_0x246ddc(0xce)](_0x2f5085))return getRoleById(_0x4fbf47,Number(_0x2f5085));const _0xe52568=await listAllAppRoles(_0x4fbf47),_0x215c81=_0xe52568['filter'](_0x4ba6ed=>_0x4ba6ed[_0x246ddc(0xe7)]===_0x2f5085);if(_0x215c81[_0x246ddc(0xec)]===0x0)throw CliErrors[_0x246ddc(0xc3)](_0x246ddc(0xdf)+_0x2f5085+'\x22\x20not\x20found\x20in\x20app\x20'+_0x4fbf47+'.',_0x246ddc(0xf2));if(_0x215c81['length']>0x1){const _0x10da1f=_0x215c81[_0x246ddc(0xd7)](_0x8f35f9=>_0x8f35f9['id'])[_0x246ddc(0xed)](',\x20');throw CliErrors[_0x246ddc(0xc3)](_0x246ddc(0xdf)+_0x2f5085+'\x22\x20is\x20ambiguous\x20(ids:\x20'+_0x10da1f+').',_0x246ddc(0xf6));}return _0x215c81[0x0];}export async function getRoleById(_0x89ead5,_0x385935){const _0x5164b2=a224_0x13a989,_0x29527c=await listAllAppRoles(_0x89ead5),_0x5ed7ae=_0x29527c['filter'](_0x1ae5b6=>_0x1ae5b6['id']===_0x385935&&(!_0x1ae5b6[_0x5164b2(0xcb)]||_0x1ae5b6[_0x5164b2(0xcb)]===_0x89ead5));if(_0x5ed7ae['length']!==0x1)throw CliErrors[_0x5164b2(0xc3)](_0x5164b2(0xe0)+_0x385935+'\x20not\x20found\x20in\x20app\x20'+_0x89ead5+'.',_0x5164b2(0xb9));return _0x5ed7ae[0x0];}async function listAllAppRoles(_0x11b06a){const _0x3e5722=a224_0x13a989,_0x4b3298=0x64,_0x1844b1=[];for(let _0x5dddd8=0x1;;_0x5dddd8+=0x1){const {items:_0x233a77,paging:_0x5588b6}=await listAppRoles(_0x11b06a,{'currentPage':_0x5dddd8,'pageSize':_0x4b3298});_0x1844b1[_0x3e5722(0xf8)](..._0x233a77);if(_0x233a77['length']<_0x4b3298||_0x5588b6&&_0x1844b1[_0x3e5722(0xec)]>=_0x5588b6[_0x3e5722(0xca)])return _0x1844b1;}}export async function resolveTenantCode(){const _0xd467eb=a224_0x13a989,_0x183c70=await getSessionUserInfo(),_0x49a378=_0x183c70?.[_0xd467eb(0x102)]?.['tenant']?.[_0xd467eb(0xdd)];if(!_0x49a378)throw CliErrors['authRequired'](_0xd467eb(0xe1));return _0x49a378;}function matchMember(_0x177ee8,_0x284817){const _0x43e3ff=a224_0x13a989,_0x3ad84b=_0x284817['trim']()[_0x43e3ff(0xe4)]();return(_0x177ee8[_0x43e3ff(0xf7)]??'')[_0x43e3ff(0xe4)]()===_0x3ad84b||(_0x177ee8['username']??'')[_0x43e3ff(0xe4)]()===_0x3ad84b;}export async function resolveUserRef(_0x282482,_0x229115='Pass\x20--user\x20<id>.'){const _0x25187c=a224_0x13a989,_0x47f415=_0x282482[_0x25187c(0xd6)]();if(!_0x47f415)throw CliErrors['validation'](_0x25187c(0xf9),'Pass\x20--user\x20<id|name>.');const _0xf39834=await resolveTenantCode(),_0x47811e=await getTenantMembers(_0xf39834);if(/^\d+$/['test'](_0x47f415)){const _0x4a59ad=Number(_0x47f415),_0x5c1567=_0x47811e['find'](_0x80ec02=>_0x80ec02[_0x25187c(0xd8)]===_0x4a59ad);return{'userId':_0x4a59ad,'username':_0x5c1567?.[_0x25187c(0xe2)]??String(_0x4a59ad),'nickname':_0x5c1567?.[_0x25187c(0xf7)],'matchedBy':'id'};}const _0x38d031=_0x47811e[_0x25187c(0xd4)](_0x448984=>matchMember(_0x448984,_0x47f415));if(_0x38d031['length']===0x0)throw CliErrors[_0x25187c(0xc3)](_0x25187c(0xf4)+_0x47f415+'\x22.',_0x25187c(0xe8)+_0x229115);if(_0x38d031[_0x25187c(0xec)]>0x1){const _0x243847=_0x38d031[_0x25187c(0xd7)](_0x2b63dd=>(_0x2b63dd[_0x25187c(0xf7)]??_0x2b63dd[_0x25187c(0xe2)]??'?')+'('+_0x2b63dd[_0x25187c(0xd8)]+')')[_0x25187c(0xed)](',\x20');throw CliErrors['validation'](_0x25187c(0xdb)+_0x47f415+_0x25187c(0xdc)+_0x243847+'.',_0x229115);}const _0x4b3668=_0x38d031[0x0];return{'userId':_0x4b3668[_0x25187c(0xd8)],'username':_0x4b3668[_0x25187c(0xe2)]??String(_0x4b3668['userId']),'nickname':_0x4b3668['nickname'],'matchedBy':_0x25187c(0xd5)};}export const CREATE_USER_ROLE_PATH=a224_0x13a989(0xc8);export const DELETE_USER_ROLE_PATH='/smartapi/permit/user-role/delete';function a224_0x3862(_0x560146,_0x5a7f4e){_0x560146=_0x560146-0xb8;const _0x10bce1=a224_0x10bc();let _0x3862b4=_0x10bce1[_0x560146];return _0x3862b4;}export function computeRoleUserMutation(_0x7c936f){const _0x4bd4fc=a224_0x13a989,{operation:_0x3dc7e7,appCode:_0x4a19fd,role:_0x2a4949,relations:_0x5bf429,user:_0x103820}=_0x7c936f,_0x4003c2=[...new Set(_0x5bf429[_0x4bd4fc(0xd7)](_0x402a16=>_0x402a16['userId']))],_0x21c3d2=[];if(_0x7c936f[_0x4bd4fc(0xf3)]!==undefined&&_0x7c936f[_0x4bd4fc(0xf3)]!==_0x4003c2['length'])throw CliErrors[_0x4bd4fc(0xc3)](_0x4bd4fc(0xfc)+_0x7c936f[_0x4bd4fc(0xf3)]+'\x20member(s)\x20but\x20role\x20has\x20'+_0x4003c2[_0x4bd4fc(0xec)]+'.',_0x4bd4fc(0xf5));const _0x405259=_0x4003c2[_0x4bd4fc(0xbc)](_0x103820[_0x4bd4fc(0xd8)]),_0x42fdaa=_0x5bf429[_0x4bd4fc(0xd4)](_0x4252bb=>_0x4252bb[_0x4bd4fc(0xd8)]===_0x103820[_0x4bd4fc(0xd8)])[_0x4bd4fc(0xd7)](_0x5a5718=>_0x5a5718['id']),_0x14cc8f=_0x3dc7e7===_0x4bd4fc(0xcc)?!_0x405259:_0x405259;let _0xdef93c=_0x4003c2;_0x3dc7e7==='user-add'?_0x405259?_0x21c3d2[_0x4bd4fc(0xf8)](_0x4bd4fc(0xe9)+_0x103820['userId']+_0x4bd4fc(0xc4)+_0x2a4949[_0x4bd4fc(0xe7)]+_0x4bd4fc(0xff)):_0xdef93c=[..._0x4003c2,_0x103820[_0x4bd4fc(0xd8)]]:!_0x405259?_0x21c3d2['push'](_0x4bd4fc(0xe9)+_0x103820[_0x4bd4fc(0xd8)]+_0x4bd4fc(0xee)+_0x2a4949[_0x4bd4fc(0xe7)]+';\x20no\x20change.'):(_0xdef93c=_0x4003c2[_0x4bd4fc(0xd4)](_0x2fde82=>_0x2fde82!==_0x103820[_0x4bd4fc(0xd8)]),_0x42fdaa[_0x4bd4fc(0xec)]>0x1&&_0x21c3d2['push']('Removed\x20'+_0x42fdaa['length']+_0x4bd4fc(0xc2)+_0x103820[_0x4bd4fc(0xd8)]+'.'));const _0xfef06d={'scope':_0x4bd4fc(0xc9),'operation':_0x3dc7e7,'selector':{'appCode':_0x4a19fd,'roleId':_0x2a4949['id'],'roleName':_0x2a4949[_0x4bd4fc(0xe7)],'userId':_0x103820[_0x4bd4fc(0xd8)]},'before':{'userIds':_0x4003c2},'after':{'userIds':_0xdef93c},'dryRun':_0x7c936f[_0x4bd4fc(0xbe)],'backend':{'method':'POST','path':_0x3dc7e7===_0x4bd4fc(0xcc)?CREATE_USER_ROLE_PATH:DELETE_USER_ROLE_PATH},'warnings':_0x21c3d2};return{'mutation':_0xfef06d,'changed':_0x14cc8f,'matchingRelationIds':_0x42fdaa};}export async function loadDevRoleRelations(_0x346e4a,_0x484887){const _0x2cafde=a224_0x13a989,_0x4f479f=0x64,_0x197634=[];for(let _0xd44399=0x1;;_0xd44399+=0x1){const {items:_0x102670,paging:_0x461099}=await listDevUserRoleRelations(_0x346e4a,{'roleId':_0x484887,'currentPage':_0xd44399,'pageSize':_0x4f479f});_0x197634['push'](..._0x102670);if(_0x102670[_0x2cafde(0xec)]<_0x4f479f||_0x461099&&_0x197634[_0x2cafde(0xec)]>=_0x461099[_0x2cafde(0xca)])return _0x197634;}}export function readRoleRef(_0xfd6f83){const _0x1ebec6=a224_0x13a989,_0x14c8da=_0xfd6f83[_0x1ebec6(0xde)](_0x1ebec6(0xc0))[_0x1ebec6(0xd6)]();if(!_0x14c8da)throw CliErrors[_0x1ebec6(0xef)](_0x1ebec6(0xc0),_0x1ebec6(0xfa));return _0x14c8da;}export async function prepareUserMutation(_0x1110c4,_0x42870c,_0x5aebe9){const _0x2e52e6=a224_0x13a989,_0x29adf8=readRoleRef(_0x1110c4),_0x4cc5c3=_0x1110c4[_0x2e52e6(0xde)](_0x2e52e6(0x102))[_0x2e52e6(0xd6)]();if(!_0x4cc5c3)throw CliErrors[_0x2e52e6(0xef)](_0x2e52e6(0x102),_0x2e52e6(0xfd));const _0x488be6=_0x1110c4['flag'](_0x2e52e6(0xcd)),_0x15cd91=_0x488be6===undefined||_0x488be6===null?undefined:Number(_0x488be6),_0xe39348=await resolveRoleRef(_0x1110c4[_0x2e52e6(0xcb)],_0x29adf8);if(_0xe39348['roleType']===_0x2e52e6(0xbf))throw CliErrors['validation'](_0x2e52e6(0xfe)+_0x42870c+_0x2e52e6(0xd0),_0x2e52e6(0x100));const _0x161078=await resolveUserRef(_0x4cc5c3),_0x33f0ae=await loadDevRoleRelations(_0x1110c4['appCode'],_0xe39348['id']);return{...computeRoleUserMutation({'operation':_0x42870c,'appCode':_0x1110c4[_0x2e52e6(0xcb)],'role':_0xe39348,'relations':_0x33f0ae,'user':{'userId':_0x161078[_0x2e52e6(0xd8)],'username':_0x161078[_0x2e52e6(0xe2)],'nickname':_0x161078['nickname']},'dryRun':_0x5aebe9,..._0x15cd91!==undefined?{'expectUserCount':_0x15cd91}:{}}),'role':_0xe39348,'user':_0x161078};}
1
+ const a224_0xe63d8b=a224_0x2ff9;(function(_0x3043d7,_0x16e255){const _0x16198e=a224_0x2ff9,_0x20997e=_0x3043d7();while(!![]){try{const _0x225867=parseInt(_0x16198e(0x1e3))/0x1+-parseInt(_0x16198e(0x208))/0x2*(parseInt(_0x16198e(0x20d))/0x3)+parseInt(_0x16198e(0x218))/0x4+-parseInt(_0x16198e(0x212))/0x5*(-parseInt(_0x16198e(0x1ea))/0x6)+parseInt(_0x16198e(0x219))/0x7*(-parseInt(_0x16198e(0x1e2))/0x8)+-parseInt(_0x16198e(0x1fb))/0x9*(-parseInt(_0x16198e(0x207))/0xa)+-parseInt(_0x16198e(0x1f7))/0xb*(parseInt(_0x16198e(0x1dc))/0xc);if(_0x225867===_0x16e255)break;else _0x20997e['push'](_0x20997e['shift']());}catch(_0x45d4ed){_0x20997e['push'](_0x20997e['shift']());}}}(a224_0x4ccf,0xc9ed0));import{getTenantMembers,listDevUserRoleRelations,listAppRoles}from'../../core/api-client.js';import{getSessionUserInfo}from'../../auth/get-session-user.js';import{CliErrors}from'../../errors.js';export const ROLE_ID_FLAG={'name':'id','type':a224_0xe63d8b(0x1e6),'required':!![],'description':'Role\x20id\x20(from\x20`role\x20list`)'};export const ROLE_REF_FLAG={'name':a224_0xe63d8b(0x1eb),'type':a224_0xe63d8b(0x205),'required':!![],'description':a224_0xe63d8b(0x20c)};export const USER_REF_FLAG={'name':a224_0xe63d8b(0x1cf),'type':a224_0xe63d8b(0x205),'required':!![],'description':a224_0xe63d8b(0x1d9)};export const NAME_FLAG={'name':a224_0xe63d8b(0x1e8),'type':a224_0xe63d8b(0x205),'required':!![],'description':a224_0xe63d8b(0x213)};export const USER_NAME_FLAG={'name':'name','type':a224_0xe63d8b(0x205),'required':!![],'description':a224_0xe63d8b(0x1e5)};export const REMARK_FLAG={'name':'remark','type':a224_0xe63d8b(0x205),'required':![],'description':a224_0xe63d8b(0x1f0)};export const EXPECT_USER_COUNT_FLAG={'name':a224_0xe63d8b(0x1df),'type':a224_0xe63d8b(0x1e6),'required':![],'description':a224_0xe63d8b(0x214)};export const BUILTIN_ROLE_TYPES=['ADMIN',a224_0xe63d8b(0x1d8),a224_0xe63d8b(0x1ff)];export function isBuiltinRole(_0x5282ff){const _0x54db7b=a224_0xe63d8b;return BUILTIN_ROLE_TYPES[_0x54db7b(0x1ec)](_0x5282ff);}export function assertCustomRole(_0xd237f7,_0x4d9a32){const _0x8935cb=a224_0xe63d8b;if(_0xd237f7[_0x8935cb(0x1e9)]!==_0x8935cb(0x1fa))throw CliErrors[_0x8935cb(0x21a)](_0x8935cb(0x1f8)+_0x4d9a32+_0x8935cb(0x1f2)+_0xd237f7[_0x8935cb(0x1d5)]+'\x20('+_0xd237f7[_0x8935cb(0x1e9)]+').',_0x8935cb(0x204));}export function projectRole(_0x329267){const _0x1ebd6e=a224_0xe63d8b;return{'id':_0x329267['id'],'roleName':_0x329267[_0x1ebd6e(0x1d5)],'roleType':_0x329267[_0x1ebd6e(0x1e9)],'remark':_0x329267[_0x1ebd6e(0x1e1)],'userCount':_0x329267[_0x1ebd6e(0x210)],'permitCount':_0x329267['permitCount'],'builtin':isBuiltinRole(_0x329267[_0x1ebd6e(0x1e9)])};}export async function resolveRoleRef(_0x105bca,_0x47818a){const _0x1078ec=a224_0xe63d8b,_0x27e385=_0x47818a[_0x1078ec(0x1f4)]();if(!_0x27e385)throw CliErrors['validation']('Missing\x20role\x20reference.','Pass\x20--role\x20<id|name>.');if(/^\d+$/[_0x1078ec(0x1cb)](_0x27e385))return getRoleById(_0x105bca,Number(_0x27e385));const _0x2ed0d2=await listAllAppRoles(_0x105bca),_0x7d7034=_0x2ed0d2[_0x1078ec(0x217)](_0x39dd41=>_0x39dd41['roleName']===_0x27e385);if(_0x7d7034[_0x1078ec(0x1cc)]===0x0)throw CliErrors[_0x1078ec(0x21a)](_0x1078ec(0x1f1)+_0x27e385+_0x1078ec(0x1ee)+_0x105bca+'.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.');if(_0x7d7034[_0x1078ec(0x1cc)]>0x1){const _0x1ed56b=_0x7d7034['map'](_0x472640=>_0x472640['id'])[_0x1078ec(0x206)](',\x20');throw CliErrors['validation'](_0x1078ec(0x1f1)+_0x27e385+_0x1078ec(0x1e0)+_0x1ed56b+').','Disambiguate\x20with\x20--role\x20<id>.');}return _0x7d7034[0x0];}function a224_0x4ccf(){const _0x508dc6=['186QVfxqC','role','includes','username','\x22\x20not\x20found\x20in\x20app\x20','tenant_code','Optional\x20role\x20remark/description','Role\x20name\x20\x22','\x20built-in\x20role\x20','\x20duplicate\x20memberships\x20for\x20user\x20','trim','\x20not\x20found\x20in\x20app\x20','push','633941nbySKV','Cannot\x20','dev','CUSTOM','33633GdhZvC','totalCount','flagMissing','expectUserCount','OWNER','Removed\x20','\x22:\x20','Missing\x20user\x20reference.','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','string','join','4110VlHaSE','3194566wBoGcV','user-add','nickname','userId','Role\x20id\x20or\x20exact\x20role\x20name','3iHUvxQ','\x20members\x20of\x20the\x20OWNER\x20role.','\x20is\x20already\x20a\x20member\x20of\x20role\x20','userCount','Role\x20id\x20','167065UQNeLZ','Role\x20name','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','Use\x20the\x20platform\x20ownership-transfer\x20workflow\x20to\x20change\x20the\x20application\x20owner.','authRequired','filter','6249812wKEnCX','82467BBMdhs','validation','\x20member(s)\x20but\x20role\x20has\x20','test','length','toLowerCase','\x20is\x20not\x20a\x20member\x20of\x20role\x20','user',';\x20no\x20change.','map','flag','/smartapi/permit/user-role/create','Check\x20the\x20nickname/username.\x20','roleName','User\x20','str','DEV','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','appCode','Pass\x20--user\x20<id|name>.','552ozJqgs','Anti-drift\x20check\x20failed:\x20expected\x20','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','expect-user-count','\x22\x20is\x20ambiguous\x20(ids:\x20','remark','24xjbZDb','976577HGIFlw','tenant','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','number','find','name','roleType'];a224_0x4ccf=function(){return _0x508dc6;};return a224_0x4ccf();}export async function getRoleById(_0x5a0837,_0x5e5e4c){const _0x559b12=a224_0xe63d8b,_0x1195a3=await listAllAppRoles(_0x5a0837),_0x569f5b=_0x1195a3[_0x559b12(0x217)](_0x3247c5=>_0x3247c5['id']===_0x5e5e4c&&(!_0x3247c5[_0x559b12(0x1da)]||_0x3247c5[_0x559b12(0x1da)]===_0x5a0837));if(_0x569f5b[_0x559b12(0x1cc)]!==0x1)throw CliErrors[_0x559b12(0x21a)](_0x559b12(0x211)+_0x5e5e4c+_0x559b12(0x1f5)+_0x5a0837+'.',_0x559b12(0x1de));return _0x569f5b[0x0];}async function listAllAppRoles(_0x110da4){const _0x1e0d3f=a224_0xe63d8b,_0x2256b5=0x64,_0x4ca534=[];for(let _0xcc907e=0x1;;_0xcc907e+=0x1){const {items:_0x2d3a0b,paging:_0x14f67d}=await listAppRoles(_0x110da4,{'currentPage':_0xcc907e,'pageSize':_0x2256b5});_0x4ca534[_0x1e0d3f(0x1f6)](..._0x2d3a0b);if(_0x2d3a0b[_0x1e0d3f(0x1cc)]<_0x2256b5||_0x14f67d&&_0x4ca534[_0x1e0d3f(0x1cc)]>=_0x14f67d['totalCount'])return _0x4ca534;}}export async function resolveTenantCode(){const _0x1888ba=a224_0xe63d8b,_0x2c3a5f=await getSessionUserInfo(),_0x272948=_0x2c3a5f?.[_0x1888ba(0x1cf)]?.[_0x1888ba(0x1e4)]?.[_0x1888ba(0x1ef)];if(!_0x272948)throw CliErrors[_0x1888ba(0x216)]('Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.');return _0x272948;}function matchMember(_0x24e435,_0xfd3bb1){const _0x137d3c=a224_0xe63d8b,_0x227803=_0xfd3bb1[_0x137d3c(0x1f4)]()[_0x137d3c(0x1cd)]();return(_0x24e435[_0x137d3c(0x20a)]??'')[_0x137d3c(0x1cd)]()===_0x227803||(_0x24e435[_0x137d3c(0x1ed)]??'')['toLowerCase']()===_0x227803;}export async function resolveUserRef(_0x47f7cb,_0x46c672='Pass\x20--user\x20<id>.'){const _0x2aa30b=a224_0xe63d8b,_0x196f91=_0x47f7cb[_0x2aa30b(0x1f4)]();if(!_0x196f91)throw CliErrors[_0x2aa30b(0x21a)](_0x2aa30b(0x202),_0x2aa30b(0x1db));const _0x53731c=await resolveTenantCode(),_0x1e69a3=await getTenantMembers(_0x53731c);if(/^\d+$/['test'](_0x196f91)){const _0x1d02fc=Number(_0x196f91),_0x4b26c9=_0x1e69a3[_0x2aa30b(0x1e7)](_0x1da114=>_0x1da114[_0x2aa30b(0x20b)]===_0x1d02fc);return{'userId':_0x1d02fc,'username':_0x4b26c9?.[_0x2aa30b(0x1ed)]??String(_0x1d02fc),'nickname':_0x4b26c9?.['nickname'],'matchedBy':'id'};}const _0x5a2c91=_0x1e69a3['filter'](_0x3efb1d=>matchMember(_0x3efb1d,_0x196f91));if(_0x5a2c91[_0x2aa30b(0x1cc)]===0x0)throw CliErrors['validation']('No\x20tenant\x20member\x20matches\x20\x22'+_0x196f91+'\x22.',_0x2aa30b(0x1d4)+_0x46c672);if(_0x5a2c91[_0x2aa30b(0x1cc)]>0x1){const _0x4844d3=_0x5a2c91[_0x2aa30b(0x1d1)](_0x59587d=>(_0x59587d[_0x2aa30b(0x20a)]??_0x59587d[_0x2aa30b(0x1ed)]??'?')+'('+_0x59587d[_0x2aa30b(0x20b)]+')')[_0x2aa30b(0x206)](',\x20');throw CliErrors[_0x2aa30b(0x21a)]('Multiple\x20tenant\x20members\x20match\x20\x22'+_0x196f91+_0x2aa30b(0x201)+_0x4844d3+'.',_0x46c672);}const _0x14d127=_0x5a2c91[0x0];return{'userId':_0x14d127['userId'],'username':_0x14d127['username']??String(_0x14d127[_0x2aa30b(0x20b)]),'nickname':_0x14d127[_0x2aa30b(0x20a)],'matchedBy':'name'};}function a224_0x2ff9(_0x20860d,_0x70a63a){_0x20860d=_0x20860d-0x1cb;const _0x4ccfe0=a224_0x4ccf();let _0x2ff9e7=_0x4ccfe0[_0x20860d];return _0x2ff9e7;}export const CREATE_USER_ROLE_PATH=a224_0xe63d8b(0x1d3);export const DELETE_USER_ROLE_PATH='/smartapi/permit/user-role/delete';export function computeRoleUserMutation(_0x5629fb){const _0x4b3ea1=a224_0xe63d8b,{operation:_0x4007dc,appCode:_0x164d5b,role:_0x107023,relations:_0x57c513,user:_0x201483}=_0x5629fb,_0x2682d=[...new Set(_0x57c513[_0x4b3ea1(0x1d1)](_0x8b8d1c=>_0x8b8d1c[_0x4b3ea1(0x20b)]))],_0x2b4dcd=[];if(_0x5629fb[_0x4b3ea1(0x1fe)]!==undefined&&_0x5629fb[_0x4b3ea1(0x1fe)]!==_0x2682d[_0x4b3ea1(0x1cc)])throw CliErrors[_0x4b3ea1(0x21a)](_0x4b3ea1(0x1dd)+_0x5629fb[_0x4b3ea1(0x1fe)]+_0x4b3ea1(0x21b)+_0x2682d[_0x4b3ea1(0x1cc)]+'.',_0x4b3ea1(0x203));const _0x1149f3=_0x2682d[_0x4b3ea1(0x1ec)](_0x201483['userId']),_0xdd23ff=_0x57c513[_0x4b3ea1(0x217)](_0x2419f2=>_0x2419f2['userId']===_0x201483[_0x4b3ea1(0x20b)])['map'](_0x212778=>_0x212778['id']),_0xdfe9c=_0x4007dc==='user-add'?!_0x1149f3:_0x1149f3;let _0x3e6823=_0x2682d;_0x4007dc===_0x4b3ea1(0x209)?_0x1149f3?_0x2b4dcd[_0x4b3ea1(0x1f6)](_0x4b3ea1(0x1d6)+_0x201483[_0x4b3ea1(0x20b)]+_0x4b3ea1(0x20f)+_0x107023[_0x4b3ea1(0x1d5)]+_0x4b3ea1(0x1d0)):_0x3e6823=[..._0x2682d,_0x201483[_0x4b3ea1(0x20b)]]:!_0x1149f3?_0x2b4dcd[_0x4b3ea1(0x1f6)]('User\x20'+_0x201483[_0x4b3ea1(0x20b)]+_0x4b3ea1(0x1ce)+_0x107023['roleName']+';\x20no\x20change.'):(_0x3e6823=_0x2682d[_0x4b3ea1(0x217)](_0xd35c8b=>_0xd35c8b!==_0x201483['userId']),_0xdd23ff[_0x4b3ea1(0x1cc)]>0x1&&_0x2b4dcd[_0x4b3ea1(0x1f6)](_0x4b3ea1(0x200)+_0xdd23ff[_0x4b3ea1(0x1cc)]+_0x4b3ea1(0x1f3)+_0x201483['userId']+'.'));const _0x3a0dff={'scope':_0x4b3ea1(0x1f9),'operation':_0x4007dc,'selector':{'appCode':_0x164d5b,'roleId':_0x107023['id'],'roleName':_0x107023[_0x4b3ea1(0x1d5)],'userId':_0x201483[_0x4b3ea1(0x20b)]},'before':{'userIds':_0x2682d},'after':{'userIds':_0x3e6823},'dryRun':_0x5629fb['dryRun'],'backend':{'method':'POST','path':_0x4007dc===_0x4b3ea1(0x209)?CREATE_USER_ROLE_PATH:DELETE_USER_ROLE_PATH},'warnings':_0x2b4dcd};return{'mutation':_0x3a0dff,'changed':_0xdfe9c,'matchingRelationIds':_0xdd23ff};}export async function loadDevRoleRelations(_0x5c7cf9,_0x4249f0){const _0x45a4ff=a224_0xe63d8b,_0x411d86=0x64,_0x2a32e8=[];for(let _0x22af83=0x1;;_0x22af83+=0x1){const {items:_0x1d4acd,paging:_0x4d3fb9}=await listDevUserRoleRelations(_0x5c7cf9,{'roleId':_0x4249f0,'currentPage':_0x22af83,'pageSize':_0x411d86});_0x2a32e8[_0x45a4ff(0x1f6)](..._0x1d4acd);if(_0x1d4acd['length']<_0x411d86||_0x4d3fb9&&_0x2a32e8[_0x45a4ff(0x1cc)]>=_0x4d3fb9[_0x45a4ff(0x1fc)])return _0x2a32e8;}}export function readRoleRef(_0x84966b){const _0x250d99=a224_0xe63d8b,_0x35c1a3=_0x84966b[_0x250d99(0x1d7)](_0x250d99(0x1eb))[_0x250d99(0x1f4)]();if(!_0x35c1a3)throw CliErrors['flagMissing'](_0x250d99(0x1eb),'Pass\x20--role\x20<id|name>.');return _0x35c1a3;}export async function prepareUserMutation(_0x26d485,_0x12f7d7,_0x49f6d0){const _0x478a77=a224_0xe63d8b,_0xbe0eac=readRoleRef(_0x26d485),_0x2a16c7=_0x26d485['str']('user')[_0x478a77(0x1f4)]();if(!_0x2a16c7)throw CliErrors[_0x478a77(0x1fd)]('user',_0x478a77(0x1db));const _0x42446d=_0x26d485[_0x478a77(0x1d2)](_0x478a77(0x1df)),_0x41e1fb=_0x42446d===undefined||_0x42446d===null?undefined:Number(_0x42446d),_0x4354be=await resolveRoleRef(_0x26d485[_0x478a77(0x1da)],_0xbe0eac);if(_0x4354be[_0x478a77(0x1e9)]===_0x478a77(0x1ff))throw CliErrors['validation'](_0x478a77(0x1f8)+_0x12f7d7+_0x478a77(0x20e),_0x478a77(0x215));const _0x312c1a=await resolveUserRef(_0x2a16c7),_0x141717=await loadDevRoleRelations(_0x26d485[_0x478a77(0x1da)],_0x4354be['id']);return{...computeRoleUserMutation({'operation':_0x12f7d7,'appCode':_0x26d485[_0x478a77(0x1da)],'role':_0x4354be,'relations':_0x141717,'user':{'userId':_0x312c1a['userId'],'username':_0x312c1a[_0x478a77(0x1ed)],'nickname':_0x312c1a[_0x478a77(0x20a)]},'dryRun':_0x49f6d0,..._0x41e1fb!==undefined?{'expectUserCount':_0x41e1fb}:{}}),'role':_0x4354be,'user':_0x312c1a};}
@@ -1 +1 @@
1
- const a225_0x4f7d4f=a225_0x50c9;function a225_0x50c9(_0x3d79f1,_0x2c667e){_0x3d79f1=_0x3d79f1-0x1bb;const _0x73f32a=a225_0x73f3();let _0x50c9e4=_0x73f32a[_0x3d79f1];return _0x50c9e4;}function a225_0x73f3(){const _0x179e80=['New\x20role\x20name','dev','roleName','94JrVxvG','349745uUinBO','validation','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(built-in\x20roles\x20rejected)','/smartapi/permit/role/update','trim','length','16019ypKZIp','update','10lJZquF','remark','7581717pFHDfQ','num','name','8ZIzTYH','776PxwlDQ','flag','role','--name\x20cannot\x20be\x20empty.','40859687flZjra','POST','appCode','2730225wJDuGa','48937EwixiF','Nothing\x20to\x20update.','write','5151276DGXmKR','\x20(id=','Role\x20name\x20cannot\x20exceed\x2064\x20characters.'];a225_0x73f3=function(){return _0x179e80;};return a225_0x73f3();}(function(_0x579f06,_0x99e4f3){const _0x2c9ad9=a225_0x50c9,_0x4a6ce6=_0x579f06();while(!![]){try{const _0x28041a=-parseInt(_0x2c9ad9(0x1d0))/0x1*(-parseInt(_0x2c9ad9(0x1c9))/0x2)+parseInt(_0x2c9ad9(0x1bf))/0x3+parseInt(_0x2c9ad9(0x1d7))/0x4*(parseInt(_0x2c9ad9(0x1ca))/0x5)+parseInt(_0x2c9ad9(0x1c3))/0x6+-parseInt(_0x2c9ad9(0x1c0))/0x7*(-parseInt(_0x2c9ad9(0x1d8))/0x8)+parseInt(_0x2c9ad9(0x1d4))/0x9+-parseInt(_0x2c9ad9(0x1d2))/0xa*(parseInt(_0x2c9ad9(0x1bc))/0xb);if(_0x28041a===_0x99e4f3)break;else _0x4a6ce6['push'](_0x4a6ce6['shift']());}catch(_0x4b895c){_0x4a6ce6['push'](_0x4a6ce6['shift']());}}}(a225_0x73f3,0x721eb));import{updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,REMARK_FLAG,ROLE_ID_FLAG}from'../../commands/role/shared.js';const UPDATE_PATH=a225_0x4f7d4f(0x1cd);function readPatch(_0x1eff98){const _0x10cdea=a225_0x4f7d4f,_0x1bc04e=_0x1eff98[_0x10cdea(0x1d9)](_0x10cdea(0x1d6)),_0x7fd07e=_0x1eff98[_0x10cdea(0x1d9)]('remark'),_0xf4a86c={};if(_0x1bc04e!==undefined&&_0x1bc04e!==null){const _0x38320d=String(_0x1bc04e)[_0x10cdea(0x1ce)]();if(!_0x38320d)throw CliErrors[_0x10cdea(0x1cb)](_0x10cdea(0x1bb));if(_0x38320d[_0x10cdea(0x1cf)]>0x40)throw CliErrors['validation'](_0x10cdea(0x1c5));_0xf4a86c[_0x10cdea(0x1c8)]=_0x38320d;}_0x7fd07e!==undefined&&_0x7fd07e!==null&&(_0xf4a86c[_0x10cdea(0x1d3)]=String(_0x7fd07e));if(_0xf4a86c['roleName']===undefined&&_0xf4a86c['remark']===undefined)throw CliErrors[_0x10cdea(0x1cb)](_0x10cdea(0x1c1),'Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.');return _0xf4a86c;}export const roleUpdate={'service':a225_0x4f7d4f(0x1da),'command':'update','description':a225_0x4f7d4f(0x1cc),'risk':a225_0x4f7d4f(0x1c2),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a225_0x4f7d4f(0x1d6),'type':'string','required':![],'description':a225_0x4f7d4f(0x1c6)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x1737d8){readPatch(_0x1737d8);},async 'dryRun'(_0x468e7d){const _0x103ef0=a225_0x4f7d4f,_0x5687ac=_0x468e7d[_0x103ef0(0x1d5)]('id'),_0x1179fe=readPatch(_0x468e7d),_0x234a94=await getRoleById(_0x468e7d[_0x103ef0(0x1be)],_0x5687ac);return assertCustomRole(_0x234a94,_0x103ef0(0x1d1)),asDryRunResult({'scope':'dev','operation':_0x103ef0(0x1d1),'selector':{'appCode':_0x468e7d['appCode'],'roleId':_0x5687ac,'roleName':_0x234a94['roleName']},'before':projectRole(_0x234a94),'after':projectRole({..._0x234a94,..._0x1179fe['roleName']!==undefined?{'roleName':_0x1179fe[_0x103ef0(0x1c8)]}:{},..._0x1179fe[_0x103ef0(0x1d3)]!==undefined?{'remark':_0x1179fe[_0x103ef0(0x1d3)]}:{}}),'dryRun':!![],'backend':{'method':_0x103ef0(0x1bd),'path':UPDATE_PATH},'warnings':[]},{'method':_0x103ef0(0x1bd),'url':UPDATE_PATH});},async 'execute'(_0x39ca27){const _0x537942=a225_0x4f7d4f,_0x6b9051=_0x39ca27[_0x537942(0x1d5)]('id'),_0x142342=readPatch(_0x39ca27),_0x33e37a=await getRoleById(_0x39ca27[_0x537942(0x1be)],_0x6b9051);assertCustomRole(_0x33e37a,_0x537942(0x1d1)),await updateAppRole({'id':_0x6b9051,'appCode':_0x39ca27[_0x537942(0x1be)],..._0x142342['roleName']!==undefined?{'roleName':_0x142342[_0x537942(0x1c8)]}:{},..._0x142342[_0x537942(0x1d3)]!==undefined?{'remark':_0x142342[_0x537942(0x1d3)]}:{}});const _0xc00cba=await getRoleById(_0x39ca27[_0x537942(0x1be)],_0x6b9051);return{'ok':!![],'data':{'scope':_0x537942(0x1c7),'operation':'update','selector':{'appCode':_0x39ca27[_0x537942(0x1be)],'roleId':_0x6b9051,'roleName':_0xc00cba[_0x537942(0x1c8)]},'before':projectRole(_0x33e37a),'after':projectRole(_0xc00cba),'dryRun':![],'backend':{'method':_0x537942(0x1bd),'path':UPDATE_PATH},'warnings':[]},'message':'Updated\x20role\x20'+_0xc00cba['roleName']+_0x537942(0x1c4)+_0x6b9051+')'};}};
1
+ function a225_0x4185(_0x520636,_0x27b4fb){_0x520636=_0x520636-0x92;const _0x21e85d=a225_0x21e8();let _0x4185d4=_0x21e85d[_0x520636];return _0x4185d4;}const a225_0x5ab77b=a225_0x4185;(function(_0x37ee38,_0x295e9e){const _0x1e4925=a225_0x4185,_0x1b6191=_0x37ee38();while(!![]){try{const _0x4751d6=parseInt(_0x1e4925(0x9b))/0x1*(parseInt(_0x1e4925(0x97))/0x2)+-parseInt(_0x1e4925(0xab))/0x3+-parseInt(_0x1e4925(0x92))/0x4*(-parseInt(_0x1e4925(0xb0))/0x5)+-parseInt(_0x1e4925(0x93))/0x6*(parseInt(_0x1e4925(0xac))/0x7)+parseInt(_0x1e4925(0xa3))/0x8*(parseInt(_0x1e4925(0xa2))/0x9)+parseInt(_0x1e4925(0xa5))/0xa*(parseInt(_0x1e4925(0x98))/0xb)+parseInt(_0x1e4925(0x99))/0xc*(-parseInt(_0x1e4925(0xa4))/0xd);if(_0x4751d6===_0x295e9e)break;else _0x1b6191['push'](_0x1b6191['shift']());}catch(_0x24f005){_0x1b6191['push'](_0x1b6191['shift']());}}}(a225_0x21e8,0xa04c5));import{updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,REMARK_FLAG,ROLE_ID_FLAG}from'../../commands/role/shared.js';function a225_0x21e8(){const _0x327939=['dev','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','153900TCPvFx','240wZKhvY','39dtcqWZ','1943500FBMeOv','roleName','role','validation','name','trim','297951fRSfQP','7cCBrDR','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','\x20(id=','remark','10gqYYuw','/smartapi/permit/role/update','num','1169204XbjsbF','7198890JBKKYA','write','POST','update','1923692DyXhYD','55kULjIu','4301940qpslla','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(built-in\x20roles\x20rejected)','1JrwCHa','Nothing\x20to\x20update.','New\x20role\x20name','appCode','Updated\x20role\x20'];a225_0x21e8=function(){return _0x327939;};return a225_0x21e8();}const UPDATE_PATH=a225_0x5ab77b(0xb1);function readPatch(_0xce9cd1){const _0x477840=a225_0x5ab77b,_0x5ea24f=_0xce9cd1['flag'](_0x477840(0xa9)),_0x11297f=_0xce9cd1['flag'](_0x477840(0xaf)),_0x1275f9={};if(_0x5ea24f!==undefined&&_0x5ea24f!==null){const _0x3b5003=String(_0x5ea24f)[_0x477840(0xaa)]();if(!_0x3b5003)throw CliErrors[_0x477840(0xa8)]('--name\x20cannot\x20be\x20empty.');if(_0x3b5003['length']>0x40)throw CliErrors[_0x477840(0xa8)](_0x477840(0xa1));_0x1275f9[_0x477840(0xa6)]=_0x3b5003;}_0x11297f!==undefined&&_0x11297f!==null&&(_0x1275f9[_0x477840(0xaf)]=String(_0x11297f));if(_0x1275f9[_0x477840(0xa6)]===undefined&&_0x1275f9[_0x477840(0xaf)]===undefined)throw CliErrors[_0x477840(0xa8)](_0x477840(0x9c),_0x477840(0xad));return _0x1275f9;}export const roleUpdate={'service':a225_0x5ab77b(0xa7),'command':a225_0x5ab77b(0x96),'description':a225_0x5ab77b(0x9a),'risk':a225_0x5ab77b(0x94),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a225_0x5ab77b(0xa9),'type':'string','required':![],'description':a225_0x5ab77b(0x9d)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x23436d){readPatch(_0x23436d);},async 'dryRun'(_0x4d8485){const _0x5018fa=a225_0x5ab77b,_0x4cc250=_0x4d8485[_0x5018fa(0xb2)]('id'),_0x4b8ad5=readPatch(_0x4d8485),_0x52d178=await getRoleById(_0x4d8485[_0x5018fa(0x9e)],_0x4cc250);return assertCustomRole(_0x52d178,_0x5018fa(0x96)),asDryRunResult({'scope':_0x5018fa(0xa0),'operation':_0x5018fa(0x96),'selector':{'appCode':_0x4d8485[_0x5018fa(0x9e)],'roleId':_0x4cc250,'roleName':_0x52d178[_0x5018fa(0xa6)]},'before':projectRole(_0x52d178),'after':projectRole({..._0x52d178,..._0x4b8ad5[_0x5018fa(0xa6)]!==undefined?{'roleName':_0x4b8ad5[_0x5018fa(0xa6)]}:{},..._0x4b8ad5[_0x5018fa(0xaf)]!==undefined?{'remark':_0x4b8ad5[_0x5018fa(0xaf)]}:{}}),'dryRun':!![],'backend':{'method':'POST','path':UPDATE_PATH},'warnings':[]},{'method':_0x5018fa(0x95),'url':UPDATE_PATH});},async 'execute'(_0x33fd21){const _0x582c76=a225_0x5ab77b,_0x54d1c8=_0x33fd21['num']('id'),_0x39f558=readPatch(_0x33fd21),_0x513095=await getRoleById(_0x33fd21[_0x582c76(0x9e)],_0x54d1c8);assertCustomRole(_0x513095,_0x582c76(0x96)),await updateAppRole({'id':_0x54d1c8,'appCode':_0x33fd21[_0x582c76(0x9e)],..._0x39f558[_0x582c76(0xa6)]!==undefined?{'roleName':_0x39f558['roleName']}:{},..._0x39f558[_0x582c76(0xaf)]!==undefined?{'remark':_0x39f558[_0x582c76(0xaf)]}:{}});const _0x406aa3=await getRoleById(_0x33fd21[_0x582c76(0x9e)],_0x54d1c8);return{'ok':!![],'data':{'scope':'dev','operation':_0x582c76(0x96),'selector':{'appCode':_0x33fd21[_0x582c76(0x9e)],'roleId':_0x54d1c8,'roleName':_0x406aa3[_0x582c76(0xa6)]},'before':projectRole(_0x513095),'after':projectRole(_0x406aa3),'dryRun':![],'backend':{'method':'POST','path':UPDATE_PATH},'warnings':[]},'message':_0x582c76(0x9f)+_0x406aa3[_0x582c76(0xa6)]+_0x582c76(0xae)+_0x54d1c8+')'};}};
@@ -1 +1 @@
1
- function a226_0x24c1(_0xbe052b,_0x53afb3){_0xbe052b=_0xbe052b-0x7d;const _0x3685ce=a226_0x3685();let _0x24c105=_0x3685ce[_0xbe052b];return _0x24c105;}const a226_0x59bc1b=a226_0x24c1;(function(_0x688a11,_0x2f9551){const _0x41bb5e=a226_0x24c1,_0x4fb034=_0x688a11();while(!![]){try{const _0x5118d0=parseInt(_0x41bb5e(0x89))/0x1*(-parseInt(_0x41bb5e(0x95))/0x2)+parseInt(_0x41bb5e(0x7d))/0x3+-parseInt(_0x41bb5e(0x83))/0x4*(parseInt(_0x41bb5e(0x91))/0x5)+parseInt(_0x41bb5e(0x8a))/0x6*(parseInt(_0x41bb5e(0x8c))/0x7)+-parseInt(_0x41bb5e(0x7e))/0x8*(parseInt(_0x41bb5e(0x7f))/0x9)+-parseInt(_0x41bb5e(0x88))/0xa+-parseInt(_0x41bb5e(0x8f))/0xb*(-parseInt(_0x41bb5e(0x85))/0xc);if(_0x5118d0===_0x2f9551)break;else _0x4fb034['push'](_0x4fb034['shift']());}catch(_0x33ea92){_0x4fb034['push'](_0x4fb034['shift']());}}}(a226_0x3685,0x6e27a));import{createDevUserRole}from'../../core/api-client.js';function a226_0x3685(){const _0x1ef3c7=['31048LTwaKJ','1449HsKQVk','userId','No\x20change:\x20user\x20','Added\x20user\x20','124808vIJrxO','roleId','12WHlvRW','username','roleType','6729690OQUOMH','11959ARBmWt','114IZnukK','\x20to\x20role\x20','294616HRBVkR','roleName','user-add','20186584uQGfPG','Add\x20a\x20user\x20to\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','70cdUzvi','appCode','POST','selector','76IzSroU','high-risk-write','16374MGUfbe'];a226_0x3685=function(){return _0x1ef3c7;};return a226_0x3685();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,CREATE_USER_ROLE_PATH,prepareUserMutation,ROLE_REF_FLAG,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserAdd={'service':'role','command':a226_0x59bc1b(0x8e),'description':a226_0x59bc1b(0x90),'risk':a226_0x59bc1b(0x96),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x315036){const _0x48d903=a226_0x59bc1b,{mutation:_0x35d0c3}=await prepareUserMutation(_0x315036,_0x48d903(0x8e),!![]);return asDryRunResult(_0x35d0c3,{'method':_0x48d903(0x93),'url':CREATE_USER_ROLE_PATH});},async 'execute'(_0x1c74f7){const _0x29bf5a=a226_0x59bc1b,{mutation:_0x44cca0,changed:_0x3c58c1,role:_0x57ec25,user:_0x9ac33e}=await prepareUserMutation(_0x1c74f7,'user-add',![]);return _0x3c58c1&&await createDevUserRole({'appCode':_0x1c74f7[_0x29bf5a(0x92)],'userId':_0x9ac33e[_0x29bf5a(0x80)],'username':_0x9ac33e[_0x29bf5a(0x86)],'roleType':_0x57ec25[_0x29bf5a(0x87)],'roleId':_0x44cca0[_0x29bf5a(0x94)][_0x29bf5a(0x84)]}),{'ok':!![],'data':_0x44cca0,'message':_0x3c58c1?_0x29bf5a(0x82)+_0x44cca0[_0x29bf5a(0x94)][_0x29bf5a(0x80)]+_0x29bf5a(0x8b)+_0x44cca0[_0x29bf5a(0x94)][_0x29bf5a(0x8d)]:_0x29bf5a(0x81)+_0x44cca0[_0x29bf5a(0x94)]['userId']+'\x20already\x20in\x20role\x20'+_0x44cca0[_0x29bf5a(0x94)]['roleName']};}};
1
+ const a226_0xef7d19=a226_0x174a;(function(_0x469f95,_0xc63ac){const _0x322594=a226_0x174a,_0x4a26c0=_0x469f95();while(!![]){try{const _0x3555db=parseInt(_0x322594(0x1ef))/0x1+-parseInt(_0x322594(0x1f4))/0x2+-parseInt(_0x322594(0x1f9))/0x3+-parseInt(_0x322594(0x1fd))/0x4+-parseInt(_0x322594(0x1ed))/0x5+parseInt(_0x322594(0x1fe))/0x6*(-parseInt(_0x322594(0x1f8))/0x7)+-parseInt(_0x322594(0x1fb))/0x8*(-parseInt(_0x322594(0x1f2))/0x9);if(_0x3555db===_0xc63ac)break;else _0x4a26c0['push'](_0x4a26c0['shift']());}catch(_0x305e71){_0x4a26c0['push'](_0x4a26c0['shift']());}}}(a226_0x5a66,0xd0596));import{createDevUserRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a226_0x5a66(){const _0x2be456=['96945JlIULV','roleType','userId','8741889KyXUzc','POST','1093654fncvvB','user-add','roleId','\x20to\x20role\x20','427pqHcps','1622097tGNqkt','high-risk-write','40hFaRbX','No\x20change:\x20user\x20','6792424kXUNMX','23934ygoZVN','selector','roleName','Added\x20user\x20','5355955mdlFgP','Add\x20a\x20user\x20to\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes'];a226_0x5a66=function(){return _0x2be456;};return a226_0x5a66();}function a226_0x174a(_0x2baa4d,_0x8f9bb0){_0x2baa4d=_0x2baa4d-0x1ec;const _0x5a668e=a226_0x5a66();let _0x174af1=_0x5a668e[_0x2baa4d];return _0x174af1;}import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,CREATE_USER_ROLE_PATH,prepareUserMutation,ROLE_REF_FLAG,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserAdd={'service':'role','command':a226_0xef7d19(0x1f5),'description':a226_0xef7d19(0x1ee),'risk':a226_0xef7d19(0x1fa),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0xc075a6){const _0x482d18=a226_0xef7d19,{mutation:_0x53dcc1}=await prepareUserMutation(_0xc075a6,_0x482d18(0x1f5),!![]);return asDryRunResult(_0x53dcc1,{'method':_0x482d18(0x1f3),'url':CREATE_USER_ROLE_PATH});},async 'execute'(_0x1c42b6){const _0xd7ec6f=a226_0xef7d19,{mutation:_0x4a60b8,changed:_0x53c708,role:_0x5672ee,user:_0x393cf9}=await prepareUserMutation(_0x1c42b6,_0xd7ec6f(0x1f5),![]);return _0x53c708&&await createDevUserRole({'appCode':_0x1c42b6['appCode'],'userId':_0x393cf9[_0xd7ec6f(0x1f1)],'username':_0x393cf9['username'],'roleType':_0x5672ee[_0xd7ec6f(0x1f0)],'roleId':_0x4a60b8[_0xd7ec6f(0x1ff)][_0xd7ec6f(0x1f6)]}),{'ok':!![],'data':_0x4a60b8,'message':_0x53c708?_0xd7ec6f(0x1ec)+_0x4a60b8[_0xd7ec6f(0x1ff)][_0xd7ec6f(0x1f1)]+_0xd7ec6f(0x1f7)+_0x4a60b8[_0xd7ec6f(0x1ff)][_0xd7ec6f(0x200)]:_0xd7ec6f(0x1fc)+_0x4a60b8[_0xd7ec6f(0x1ff)][_0xd7ec6f(0x1f1)]+'\x20already\x20in\x20role\x20'+_0x4a60b8['selector'][_0xd7ec6f(0x200)]};}};
@@ -1 +1 @@
1
- const a227_0x39bf9b=a227_0x311a;(function(_0x1c5e17,_0x1bc4e2){const _0x119988=a227_0x311a,_0x10ec19=_0x1c5e17();while(!![]){try{const _0x28b554=parseInt(_0x119988(0x194))/0x1*(parseInt(_0x119988(0x19b))/0x2)+-parseInt(_0x119988(0x197))/0x3*(parseInt(_0x119988(0x199))/0x4)+parseInt(_0x119988(0x1a0))/0x5*(-parseInt(_0x119988(0x19f))/0x6)+-parseInt(_0x119988(0x19e))/0x7+-parseInt(_0x119988(0x192))/0x8+parseInt(_0x119988(0x198))/0x9*(-parseInt(_0x119988(0x18b))/0xa)+parseInt(_0x119988(0x18f))/0xb;if(_0x28b554===_0x1bc4e2)break;else _0x10ec19['push'](_0x10ec19['shift']());}catch(_0x23af57){_0x10ec19['push'](_0x10ec19['shift']());}}}(a227_0x12ef,0x4986f));function a227_0x12ef(){const _0xafa19b=['selector','1211DcYzfc','high-risk-write','user-remove','330tJjSHn','4266909YWfIDw','6824xSPiyj','roleName','436IwzXXV','POST','Removed\x20user\x20','3334499kHpfZk','318fEKJMU','51415UKVQkN','10bahvit','role','\x20from\x20role\x20','No\x20change:\x20user\x20','24612973aqOsRI','\x20not\x20in\x20role\x20','userId','4138056nXwWZo'];a227_0x12ef=function(){return _0xafa19b;};return a227_0x12ef();}import{deleteDevUserRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,DELETE_USER_ROLE_PATH,prepareUserMutation,ROLE_REF_FLAG,USER_REF_FLAG}from'../../commands/role/shared.js';function a227_0x311a(_0x2b1417,_0x310b10){_0x2b1417=_0x2b1417-0x18b;const _0x12ef26=a227_0x12ef();let _0x311a8d=_0x12ef26[_0x2b1417];return _0x311a8d;}export const roleUserRemove={'service':a227_0x39bf9b(0x18c),'command':a227_0x39bf9b(0x196),'description':'Remove\x20a\x20user\x20from\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','risk':a227_0x39bf9b(0x195),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x5542ce){const _0x103701=a227_0x39bf9b,{mutation:_0x41ac39}=await prepareUserMutation(_0x5542ce,_0x103701(0x196),!![]);return asDryRunResult(_0x41ac39,{'method':_0x103701(0x19c),'url':DELETE_USER_ROLE_PATH});},async 'execute'(_0x33ba46){const _0x284fc2=a227_0x39bf9b,{matchingRelationIds:_0x4f856e,mutation:_0x325871,changed:_0x3bc160}=await prepareUserMutation(_0x33ba46,'user-remove',![]);if(_0x3bc160)for(const _0x404385 of _0x4f856e){await deleteDevUserRole(_0x404385);}return{'ok':!![],'data':_0x325871,'message':_0x3bc160?_0x284fc2(0x19d)+_0x325871[_0x284fc2(0x193)][_0x284fc2(0x191)]+_0x284fc2(0x18d)+_0x325871[_0x284fc2(0x193)][_0x284fc2(0x19a)]:_0x284fc2(0x18e)+_0x325871['selector'][_0x284fc2(0x191)]+_0x284fc2(0x190)+_0x325871[_0x284fc2(0x193)][_0x284fc2(0x19a)]};}};
1
+ const a227_0x39805c=a227_0x2f59;(function(_0x2de7de,_0xf95000){const _0xa16d7c=a227_0x2f59,_0xad1059=_0x2de7de();while(!![]){try{const _0x4c14bc=-parseInt(_0xa16d7c(0x1d7))/0x1+-parseInt(_0xa16d7c(0x1e3))/0x2*(-parseInt(_0xa16d7c(0x1e1))/0x3)+parseInt(_0xa16d7c(0x1d9))/0x4+parseInt(_0xa16d7c(0x1db))/0x5*(-parseInt(_0xa16d7c(0x1de))/0x6)+parseInt(_0xa16d7c(0x1e2))/0x7*(-parseInt(_0xa16d7c(0x1e6))/0x8)+-parseInt(_0xa16d7c(0x1e5))/0x9*(-parseInt(_0xa16d7c(0x1d4))/0xa)+parseInt(_0xa16d7c(0x1d6))/0xb*(parseInt(_0xa16d7c(0x1d3))/0xc);if(_0x4c14bc===_0xf95000)break;else _0xad1059['push'](_0xad1059['shift']());}catch(_0x566086){_0xad1059['push'](_0xad1059['shift']());}}}(a227_0x32ef,0x78150));import{deleteDevUserRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';function a227_0x2f59(_0x479ebb,_0xbd9f8c){_0x479ebb=_0x479ebb-0x1d3;const _0x32ef3d=a227_0x32ef();let _0x2f59cd=_0x32ef3d[_0x479ebb];return _0x2f59cd;}function a227_0x32ef(){const _0x178025=['7HXunlM','64iCnUeY','selector','17703BAFvXb','4244632NXpNUK','role','24Fyxbbb','130WQtBzW','No\x20change:\x20user\x20','5389571qJylOk','887444FbfpCt','POST','2628044gDyAlf','userId','5QfrJWH','Removed\x20user\x20','user-remove','497382iyBeXz','high-risk-write','roleName','30963VpDegj'];a227_0x32ef=function(){return _0x178025;};return a227_0x32ef();}import{EXPECT_USER_COUNT_FLAG,DELETE_USER_ROLE_PATH,prepareUserMutation,ROLE_REF_FLAG,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserRemove={'service':a227_0x39805c(0x1e7),'command':'user-remove','description':'Remove\x20a\x20user\x20from\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','risk':a227_0x39805c(0x1df),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x3cf1b2){const _0x44625d=a227_0x39805c,{mutation:_0x1a2f40}=await prepareUserMutation(_0x3cf1b2,'user-remove',!![]);return asDryRunResult(_0x1a2f40,{'method':_0x44625d(0x1d8),'url':DELETE_USER_ROLE_PATH});},async 'execute'(_0x3d65bc){const _0x151f65=a227_0x39805c,{matchingRelationIds:_0x3395b8,mutation:_0x287a55,changed:_0x407c71}=await prepareUserMutation(_0x3d65bc,_0x151f65(0x1dd),![]);if(_0x407c71)for(const _0x4b7c07 of _0x3395b8){await deleteDevUserRole(_0x4b7c07);}return{'ok':!![],'data':_0x287a55,'message':_0x407c71?_0x151f65(0x1dc)+_0x287a55[_0x151f65(0x1e4)][_0x151f65(0x1da)]+'\x20from\x20role\x20'+_0x287a55[_0x151f65(0x1e4)][_0x151f65(0x1e0)]:_0x151f65(0x1d5)+_0x287a55['selector'][_0x151f65(0x1da)]+'\x20not\x20in\x20role\x20'+_0x287a55[_0x151f65(0x1e4)][_0x151f65(0x1e0)]};}};
@@ -1 +1 @@
1
- const a228_0x3a5805=a228_0x151a;(function(_0x1cd5dc,_0x6e6ba4){const _0x354320=a228_0x151a,_0x7aa84e=_0x1cd5dc();while(!![]){try{const _0x351028=-parseInt(_0x354320(0x1f9))/0x1+parseInt(_0x354320(0x202))/0x2+parseInt(_0x354320(0x1fb))/0x3+parseInt(_0x354320(0x203))/0x4*(parseInt(_0x354320(0x206))/0x5)+parseInt(_0x354320(0x1f3))/0x6*(parseInt(_0x354320(0x1f4))/0x7)+-parseInt(_0x354320(0x1f2))/0x8*(parseInt(_0x354320(0x1fc))/0x9)+-parseInt(_0x354320(0x1fa))/0xa;if(_0x351028===_0x6e6ba4)break;else _0x7aa84e['push'](_0x7aa84e['shift']());}catch(_0x48893e){_0x7aa84e['push'](_0x7aa84e['shift']());}}}(a228_0x2d8d,0xb34e2));import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a228_0x151a(_0xf78f98,_0xb1c517){_0xf78f98=_0xf78f98-0x1f0;const _0x2d8d27=a228_0x2d8d();let _0x151a24=_0x2d8d27[_0xf78f98];return _0x151a24;}import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';function a228_0x2d8d(){const _0x4f3f37=['38322gviEvE','matchedBy','nickname','Select\x20a\x20listed\x20userId,\x20then\x20pass\x20it\x20to\x20`role\x20user-add`\x20or\x20`role\x20user-remove`\x20with\x20--user\x20<id>.','role','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','1432828Mclnqy','5785204rXXVjs','Resolved\x20\x22','flagMissing','5lfRMYg','trim','read','520MxObQZ','583014rXymTV','7ueUNKB','name','str','\x22\x20→\x20userId\x20','Pass\x20--name\x20<nickname|username>.','1306878kDyCey','6901640QDySIR','2245086GZiTGD'];a228_0x2d8d=function(){return _0x4f3f37;};return a228_0x2d8d();}export const roleUserResolve={'service':a228_0x3a5805(0x200),'command':'user-resolve','description':a228_0x3a5805(0x201),'risk':a228_0x3a5805(0x1f1),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x1f7dd5){const _0x45a248=a228_0x3a5805;if(!_0x1f7dd5[_0x45a248(0x1f6)](_0x45a248(0x1f5))['trim']())throw CliErrors[_0x45a248(0x205)](_0x45a248(0x1f5),_0x45a248(0x1f8));},async 'execute'(_0x2c8d51){const _0x4b83b7=a228_0x3a5805,_0xa6badb=_0x2c8d51[_0x4b83b7(0x1f6)](_0x4b83b7(0x1f5))[_0x4b83b7(0x1f0)](),_0x4e09d4=await resolveUserRef(_0xa6badb,_0x4b83b7(0x1ff));return{'ok':!![],'data':{'user':{'userId':_0x4e09d4['userId'],'username':_0x4e09d4['username'],'nickname':_0x4e09d4[_0x4b83b7(0x1fe)],'matchedBy':_0x4e09d4[_0x4b83b7(0x1fd)]}},'message':_0x4b83b7(0x204)+_0xa6badb+_0x4b83b7(0x1f7)+_0x4e09d4['userId']};}};
1
+ const a228_0x284a86=a228_0x3ad4;(function(_0x30e36e,_0x480d67){const _0x3fd0cc=a228_0x3ad4,_0x249859=_0x30e36e();while(!![]){try{const _0x294512=-parseInt(_0x3fd0cc(0x17d))/0x1+-parseInt(_0x3fd0cc(0x171))/0x2*(-parseInt(_0x3fd0cc(0x177))/0x3)+parseInt(_0x3fd0cc(0x16d))/0x4+parseInt(_0x3fd0cc(0x17a))/0x5*(parseInt(_0x3fd0cc(0x173))/0x6)+parseInt(_0x3fd0cc(0x16a))/0x7+parseInt(_0x3fd0cc(0x16b))/0x8+-parseInt(_0x3fd0cc(0x176))/0x9;if(_0x294512===_0x480d67)break;else _0x249859['push'](_0x249859['shift']());}catch(_0x9e3b20){_0x249859['push'](_0x249859['shift']());}}}(a228_0x53e2,0x3f08b));function a228_0x3ad4(_0x54da51,_0x830029){_0x54da51=_0x54da51-0x168;const _0x53e25f=a228_0x53e2();let _0x3ad408=_0x53e25f[_0x54da51];return _0x3ad408;}import{CliErrors}from'../../errors.js';function a228_0x53e2(){const _0x3f1494=['11057760IDWBhB','3dWGaZp','flagMissing','Pass\x20--name\x20<nickname|username>.','1201415VPCDTy','matchedBy','read','132685tzVOCB','nickname','name','3243009vWPEku','1981976xKCKTQ','str','1071156SuVelN','Select\x20a\x20listed\x20userId,\x20then\x20pass\x20it\x20to\x20`role\x20user-add`\x20or\x20`role\x20user-remove`\x20with\x20--user\x20<id>.','Resolved\x20\x22','trim','320246TBtnkj','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','12DTbYuM','userId','username'];a228_0x53e2=function(){return _0x3f1494;};return a228_0x53e2();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';export const roleUserResolve={'service':'role','command':'user-resolve','description':a228_0x284a86(0x172),'risk':a228_0x284a86(0x17c),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x4c4e9b){const _0x5de25b=a228_0x284a86;if(!_0x4c4e9b[_0x5de25b(0x16c)](_0x5de25b(0x169))[_0x5de25b(0x170)]())throw CliErrors[_0x5de25b(0x178)](_0x5de25b(0x169),_0x5de25b(0x179));},async 'execute'(_0x55e428){const _0xb067af=a228_0x284a86,_0x36275c=_0x55e428['str'](_0xb067af(0x169))[_0xb067af(0x170)](),_0xfb0f87=await resolveUserRef(_0x36275c,_0xb067af(0x16e));return{'ok':!![],'data':{'user':{'userId':_0xfb0f87[_0xb067af(0x174)],'username':_0xfb0f87[_0xb067af(0x175)],'nickname':_0xfb0f87[_0xb067af(0x168)],'matchedBy':_0xfb0f87[_0xb067af(0x17b)]}},'message':_0xb067af(0x16f)+_0x36275c+'\x22\x20→\x20userId\x20'+_0xfb0f87[_0xb067af(0x174)]};}};
@@ -1 +1 @@
1
- function a229_0x4ceb(){const _0x6c45d7=['13660641XWDDqc','read','5499rJgaln','3093910anurAS','926112RLKCiq','Loaded\x20','content','\x20is\x20not\x20configured\x20for\x20app\x20','2000WefNDD','Create\x20it\x20with\x20`rabetbase\x20rule\x20set\x20--type\x20','appCode','Get\x20one\x20agent\x20context\x20rule\x20for\x20the\x20resolved\x20app','\x20for\x20','31395zZqvDe','2919008PObvLW','158nzGOLT','rule','450078qpvPqD'];a229_0x4ceb=function(){return _0x6c45d7;};return a229_0x4ceb();}const a229_0x47af6d=a229_0x440e;(function(_0x26ea98,_0x3e249b){const _0x6026ac=a229_0x440e,_0x48aeb3=_0x26ea98();while(!![]){try{const _0x4f99f0=-parseInt(_0x6026ac(0xcb))/0x1+parseInt(_0x6026ac(0xc4))/0x2*(parseInt(_0x6026ac(0xc9))/0x3)+-parseInt(_0x6026ac(0xc3))/0x4+-parseInt(_0x6026ac(0xca))/0x5+parseInt(_0x6026ac(0xc6))/0x6+-parseInt(_0x6026ac(0xc2))/0x7*(-parseInt(_0x6026ac(0xbd))/0x8)+parseInt(_0x6026ac(0xc7))/0x9;if(_0x4f99f0===_0x3e249b)break;else _0x48aeb3['push'](_0x48aeb3['shift']());}catch(_0x24a2de){_0x48aeb3['push'](_0x48aeb3['shift']());}}}(a229_0x4ceb,0x8ea51));function a229_0x440e(_0x5646cd,_0x258242){_0x5646cd=_0x5646cd-0xbb;const _0x4ceb39=a229_0x4ceb();let _0x440e42=_0x4ceb39[_0x5646cd];return _0x440e42;}import{getAppRule}from'../../core/api-client.js';import{APP_RULE_TYPE_FLAG,appRuleError,appRuleFileName,projectAppRule,readAppRuleType}from'../../commands/rule/shared.js';export const ruleGet={'service':a229_0x47af6d(0xc5),'command':'get','description':a229_0x47af6d(0xc0),'risk':a229_0x47af6d(0xc8),'requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG],async 'validate'(_0x573013){readAppRuleType(_0x573013);},async 'execute'(_0x39d82f){const _0x4b35cb=a229_0x47af6d,_0x5212db=readAppRuleType(_0x39d82f),_0x2fed62=await getAppRule(_0x39d82f['cookie'],{'appCode':_0x39d82f['appCode'],'type':_0x5212db});if(!_0x2fed62)throw appRuleError('app_rule_not_found',appRuleFileName(_0x5212db)+_0x4b35cb(0xbc)+_0x39d82f[_0x4b35cb(0xbf)]+'.',_0x4b35cb(0xbe)+_0x5212db+'\x20--file\x20<path>\x20--dry-run`.');return{'ok':!![],'data':{'rule':{...projectAppRule(_0x5212db,_0x2fed62),'content':_0x2fed62[_0x4b35cb(0xbb)]}},'message':_0x4b35cb(0xcc)+appRuleFileName(_0x5212db)+_0x4b35cb(0xc1)+_0x39d82f[_0x4b35cb(0xbf)]};}};
1
+ const a229_0xf64df8=a229_0x5422;(function(_0x17156c,_0x2b085c){const _0x272c66=a229_0x5422,_0x1a7a65=_0x17156c();while(!![]){try{const _0x235396=parseInt(_0x272c66(0xcc))/0x1*(-parseInt(_0x272c66(0xcf))/0x2)+-parseInt(_0x272c66(0xd0))/0x3+parseInt(_0x272c66(0xce))/0x4*(-parseInt(_0x272c66(0xc9))/0x5)+parseInt(_0x272c66(0xca))/0x6+-parseInt(_0x272c66(0xc3))/0x7*(-parseInt(_0x272c66(0xd4))/0x8)+-parseInt(_0x272c66(0xcb))/0x9*(parseInt(_0x272c66(0xc5))/0xa)+parseInt(_0x272c66(0xc7))/0xb;if(_0x235396===_0x2b085c)break;else _0x1a7a65['push'](_0x1a7a65['shift']());}catch(_0x1861ed){_0x1a7a65['push'](_0x1a7a65['shift']());}}}(a229_0x1f27,0x25c4f));import{getAppRule}from'../../core/api-client.js';function a229_0x5422(_0xdf897a,_0x188ead){_0xdf897a=_0xdf897a-0xc3;const _0x1f2757=a229_0x1f27();let _0x5422af=_0x1f2757[_0xdf897a];return _0x5422af;}import{APP_RULE_TYPE_FLAG,appRuleError,appRuleFileName,projectAppRule,readAppRuleType}from'../../commands/rule/shared.js';function a229_0x1f27(){const _0x1491fa=['8TaBNxC','Create\x20it\x20with\x20`rabetbase\x20rule\x20set\x20--type\x20','\x20for\x20','rule','Loaded\x20','1872171XxVaKo','app_rule_not_found','243790HIlYWI','content','3586627LEqamh','Get\x20one\x20agent\x20context\x20rule\x20for\x20the\x20resolved\x20app','45415FsZAKM','1423644TnZPgF','99NjMzCS','125693WaxCKz','read','4EWLWBu','2txnwDw','819408cNzYbC','cookie','\x20--file\x20<path>\x20--dry-run`.','appCode'];a229_0x1f27=function(){return _0x1491fa;};return a229_0x1f27();}export const ruleGet={'service':a229_0xf64df8(0xd7),'command':'get','description':a229_0xf64df8(0xc8),'risk':a229_0xf64df8(0xcd),'requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG],async 'validate'(_0x578a95){readAppRuleType(_0x578a95);},async 'execute'(_0x3d8f80){const _0x106970=a229_0xf64df8,_0x4197cf=readAppRuleType(_0x3d8f80),_0x3d7b2c=await getAppRule(_0x3d8f80[_0x106970(0xd1)],{'appCode':_0x3d8f80[_0x106970(0xd3)],'type':_0x4197cf});if(!_0x3d7b2c)throw appRuleError(_0x106970(0xc4),appRuleFileName(_0x4197cf)+'\x20is\x20not\x20configured\x20for\x20app\x20'+_0x3d8f80[_0x106970(0xd3)]+'.',_0x106970(0xd5)+_0x4197cf+_0x106970(0xd2));return{'ok':!![],'data':{'rule':{...projectAppRule(_0x4197cf,_0x3d7b2c),'content':_0x3d7b2c[_0x106970(0xc6)]}},'message':_0x106970(0xd8)+appRuleFileName(_0x4197cf)+_0x106970(0xd6)+_0x3d8f80[_0x106970(0xd3)]};}};
@@ -1 +1 @@
1
- function a230_0x5b9a(_0x14c777,_0x4b7a47){_0x14c777=_0x14c777-0x1e2;const _0x558598=a230_0x5585();let _0x5b9aa2=_0x558598[_0x14c777];return _0x5b9aa2;}function a230_0x5585(){const _0x32f302=['1556224SOBKsV','75GiKuoS','1526744EfRXUU','430588TJmfRU','130upRpvg','3110715JoSHVC','1456355JierAs','1064106wInFvt','56KKJWhj','3459705CTryfl'];a230_0x5585=function(){return _0x32f302;};return a230_0x5585();}(function(_0x443add,_0x164124){const _0xd524fa=a230_0x5b9a,_0x3e0946=_0x443add();while(!![]){try{const _0x2989e6=-parseInt(_0xd524fa(0x1eb))/0x1+-parseInt(_0xd524fa(0x1e5))/0x2+-parseInt(_0xd524fa(0x1e4))/0x3+parseInt(_0xd524fa(0x1e8))/0x4*(-parseInt(_0xd524fa(0x1e6))/0x5)+-parseInt(_0xd524fa(0x1e2))/0x6+-parseInt(_0xd524fa(0x1e3))/0x7*(-parseInt(_0xd524fa(0x1e7))/0x8)+-parseInt(_0xd524fa(0x1ea))/0x9*(-parseInt(_0xd524fa(0x1e9))/0xa);if(_0x2989e6===_0x164124)break;else _0x3e0946['push'](_0x3e0946['shift']());}catch(_0x59bd2a){_0x3e0946['push'](_0x3e0946['shift']());}}}(a230_0x5585,0xcd231));import{ruleGet}from'../../commands/rule/get.js';import{ruleList}from'../../commands/rule/list.js';import{ruleSet}from'../../commands/rule/set.js';export const ruleDefinitions=[ruleList,ruleGet,ruleSet];
1
+ (function(_0x4f52a2,_0x181602){const _0x403a99=a230_0x47d8,_0x2992ad=_0x4f52a2();while(!![]){try{const _0x2d0ff4=-parseInt(_0x403a99(0xb5))/0x1+parseInt(_0x403a99(0xb2))/0x2*(-parseInt(_0x403a99(0xb9))/0x3)+parseInt(_0x403a99(0xb4))/0x4+-parseInt(_0x403a99(0xbb))/0x5*(-parseInt(_0x403a99(0xb1))/0x6)+-parseInt(_0x403a99(0xb3))/0x7*(-parseInt(_0x403a99(0xba))/0x8)+-parseInt(_0x403a99(0xb7))/0x9+parseInt(_0x403a99(0xb6))/0xa*(parseInt(_0x403a99(0xb8))/0xb);if(_0x2d0ff4===_0x181602)break;else _0x2992ad['push'](_0x2992ad['shift']());}catch(_0x2d59b9){_0x2992ad['push'](_0x2992ad['shift']());}}}(a230_0x4274,0xa19c6));function a230_0x4274(){const _0x515599=['3ecdlcN','19216oauetV','255BECCtM','73530sKgagE','1537880xnHntD','2681OladFv','1586476nquhsh','393441edZyuK','7150Fecatx','9748944BjkgDO','14861MsbvuY'];a230_0x4274=function(){return _0x515599;};return a230_0x4274();}import{ruleGet}from'../../commands/rule/get.js';function a230_0x47d8(_0x38916e,_0x564027){_0x38916e=_0x38916e-0xb1;const _0x42749c=a230_0x4274();let _0x47d8d5=_0x42749c[_0x38916e];return _0x47d8d5;}import{ruleList}from'../../commands/rule/list.js';import{ruleSet}from'../../commands/rule/set.js';export const ruleDefinitions=[ruleList,ruleGet,ruleSet];
@@ -1 +1 @@
1
- const a231_0x4f8345=a231_0x8b23;function a231_0x8b23(_0x3782e6,_0x37e2d4){_0x3782e6=_0x3782e6-0x72;const _0x5002ba=a231_0x5002();let _0x8b232b=_0x5002ba[_0x3782e6];return _0x8b232b;}(function(_0x5a564a,_0x2306d2){const _0x5d60ae=a231_0x8b23,_0x32d65c=_0x5a564a();while(!![]){try{const _0x2c2bdc=parseInt(_0x5d60ae(0x7b))/0x1+parseInt(_0x5d60ae(0x7a))/0x2*(-parseInt(_0x5d60ae(0x75))/0x3)+-parseInt(_0x5d60ae(0x80))/0x4*(parseInt(_0x5d60ae(0x74))/0x5)+parseInt(_0x5d60ae(0x7c))/0x6+parseInt(_0x5d60ae(0x7d))/0x7+-parseInt(_0x5d60ae(0x7f))/0x8*(parseInt(_0x5d60ae(0x79))/0x9)+parseInt(_0x5d60ae(0x7e))/0xa*(-parseInt(_0x5d60ae(0x84))/0xb);if(_0x2c2bdc===_0x2306d2)break;else _0x32d65c['push'](_0x32d65c['shift']());}catch(_0x29b680){_0x32d65c['push'](_0x32d65c['shift']());}}}(a231_0x5002,0x5062a));import{getAppRule}from'../../core/api-client.js';function a231_0x5002(){const _0x3ad577=['all','Loaded\x20app\x20rule\x20configuration\x20for\x20','4653nmXxZn','104086VzYiWK','576738PwKOCH','2528574CMyjLS','3721207FXxPZN','150BlpSnp','4768ElyHbF','1309908OkCDkX','appCode','rule','read','337931YlCncI','cookie','List\x20agent\x20context\x20rules\x20for\x20the\x20resolved\x20app','5ETVRFL','6FzYkxE','length'];a231_0x5002=function(){return _0x3ad577;};return a231_0x5002();}import{APP_RULE_TYPES,projectAppRule}from'../../commands/rule/shared.js';export const ruleList={'service':a231_0x4f8345(0x82),'command':'list','description':a231_0x4f8345(0x73),'risk':a231_0x4f8345(0x83),'requiresAppCode':!![],'structuredErrors':!![],'flags':[],async 'execute'(_0x31907e){const _0x3fd99e=a231_0x4f8345,_0x499eb6=await Promise[_0x3fd99e(0x77)](APP_RULE_TYPES['map'](_0x3859b8=>getAppRule(_0x31907e[_0x3fd99e(0x72)],{'appCode':_0x31907e[_0x3fd99e(0x81)],'type':_0x3859b8}))),_0x3e832c=APP_RULE_TYPES['map']((_0x1b15b6,_0x5c8a82)=>projectAppRule(_0x1b15b6,_0x499eb6[_0x5c8a82]??null));return{'ok':!![],'data':{'total':_0x3e832c[_0x3fd99e(0x76)],'rules':_0x3e832c},'message':_0x3fd99e(0x78)+_0x31907e[_0x3fd99e(0x81)]};}};
1
+ const a231_0x28b172=a231_0x1ce5;function a231_0x1ce5(_0x2aaddf,_0x5e5649){_0x2aaddf=_0x2aaddf-0x1da;const _0x381cc1=a231_0x381c();let _0x1ce50e=_0x381cc1[_0x2aaddf];return _0x1ce50e;}(function(_0x7e8733,_0x5678f6){const _0x26da73=a231_0x1ce5,_0x5d0e6e=_0x7e8733();while(!![]){try{const _0x52ed37=parseInt(_0x26da73(0x1ec))/0x1+parseInt(_0x26da73(0x1e3))/0x2+-parseInt(_0x26da73(0x1de))/0x3*(-parseInt(_0x26da73(0x1e0))/0x4)+parseInt(_0x26da73(0x1e2))/0x5*(parseInt(_0x26da73(0x1db))/0x6)+parseInt(_0x26da73(0x1dd))/0x7+-parseInt(_0x26da73(0x1e4))/0x8*(-parseInt(_0x26da73(0x1e7))/0x9)+-parseInt(_0x26da73(0x1df))/0xa*(parseInt(_0x26da73(0x1dc))/0xb);if(_0x52ed37===_0x5678f6)break;else _0x5d0e6e['push'](_0x5d0e6e['shift']());}catch(_0x541caf){_0x5d0e6e['push'](_0x5d0e6e['shift']());}}}(a231_0x381c,0x317c5));import{getAppRule}from'../../core/api-client.js';import{APP_RULE_TYPES,projectAppRule}from'../../commands/rule/shared.js';function a231_0x381c(){const _0x51f7b2=['Loaded\x20app\x20rule\x20configuration\x20for\x20','340233mvyuIy','appCode','67362koboTM','415437qxpLbQ','2323909ZIjbZO','15Bkatdk','250tEpqLK','32572AscYPz','rule','105qtlKJY','100764WlFgpP','591136zxrqnr','List\x20agent\x20context\x20rules\x20for\x20the\x20resolved\x20app','all','18pYtToL','list','read','map'];a231_0x381c=function(){return _0x51f7b2;};return a231_0x381c();}export const ruleList={'service':a231_0x28b172(0x1e1),'command':a231_0x28b172(0x1e8),'description':a231_0x28b172(0x1e5),'risk':a231_0x28b172(0x1e9),'requiresAppCode':!![],'structuredErrors':!![],'flags':[],async 'execute'(_0x30c80b){const _0x3ddc1d=a231_0x28b172,_0x4d0d44=await Promise[_0x3ddc1d(0x1e6)](APP_RULE_TYPES[_0x3ddc1d(0x1ea)](_0x175c38=>getAppRule(_0x30c80b['cookie'],{'appCode':_0x30c80b[_0x3ddc1d(0x1da)],'type':_0x175c38}))),_0x1fa598=APP_RULE_TYPES[_0x3ddc1d(0x1ea)]((_0x59f00e,_0x43915d)=>projectAppRule(_0x59f00e,_0x4d0d44[_0x43915d]??null));return{'ok':!![],'data':{'total':_0x1fa598['length'],'rules':_0x1fa598},'message':_0x3ddc1d(0x1eb)+_0x30c80b[_0x3ddc1d(0x1da)]};}};
@@ -1 +1 @@
1
- const a232_0x4bf09e=a232_0x2801;function a232_0x2801(_0x53fe50,_0x54e131){_0x53fe50=_0x53fe50-0xcd;const _0x4aa26c=a232_0x4aa2();let _0x2801af=_0x4aa26c[_0x53fe50];return _0x2801af;}(function(_0xada9e,_0x29add9){const _0x58357a=a232_0x2801,_0x4d7c6f=_0xada9e();while(!![]){try{const _0x4bd29e=-parseInt(_0x58357a(0xcd))/0x1+parseInt(_0x58357a(0xdc))/0x2*(parseInt(_0x58357a(0xd6))/0x3)+parseInt(_0x58357a(0x101))/0x4*(-parseInt(_0x58357a(0xf3))/0x5)+-parseInt(_0x58357a(0xe2))/0x6+parseInt(_0x58357a(0xfd))/0x7+parseInt(_0x58357a(0xce))/0x8+parseInt(_0x58357a(0x104))/0x9;if(_0x4bd29e===_0x29add9)break;else _0x4d7c6f['push'](_0x4d7c6f['shift']());}catch(_0x23475a){_0x4d7c6f['push'](_0x4d7c6f['shift']());}}}(a232_0x4aa2,0xb897c));import{getAppRule,isPlatformTransportFailure,saveAppRule}from'../../core/api-client.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{APP_RULE_TYPE_FLAG,appRuleContextScope,appRuleError,appRuleFileName,inspectAppRuleContent,projectAppRule,readAppRuleFile,readAppRuleType}from'../../commands/rule/shared.js';const SAVE_PATH=a232_0x4bf09e(0xd1),NON_ATOMIC_WARNING=a232_0x4bf09e(0xe7);function readSetInput(_0x5ee6a7){const _0x40e0e7=a232_0x4bf09e,_0x44782b=readAppRuleType(_0x5ee6a7),_0x4c1747=_0x5ee6a7[_0x40e0e7(0xf9)](_0x40e0e7(0xd2))[_0x40e0e7(0xe6)]();if(!_0x4c1747)throw appRuleError(_0x40e0e7(0x102),_0x40e0e7(0xf7),'Pass\x20a\x20UTF-8\x20Markdown\x20file.');const _0x363b0a=_0x5ee6a7[_0x40e0e7(0xfa)](_0x40e0e7(0xe4));let _0x116135;if(_0x363b0a!==undefined){_0x116135=Number(_0x363b0a);if(!Number['isSafeInteger'](_0x116135)||_0x116135<0x0)throw appRuleError(_0x40e0e7(0xe0),_0x40e0e7(0xf1));}return{'type':_0x44782b,'file':_0x4c1747,'expectedVersion':_0x116135};}function a232_0x4aa2(){const _0x3ca7a4=['trim','--expected-version\x20is\x20a\x20non-atomic\x20read-before-write\x20assertion;\x20the\x20server\x20save\x20contract\x20has\x20no\x20version\x20predicate.','verified','replacement','Set\x20response\x20was\x20unavailable;\x20verified\x20the\x20exact\x20content\x20readback\x20without\x20resubmitting.','app_rule_set_outcome_unknown','\x20version\x20changed\x20before\x20write.','Non-atomic\x20preflight\x20assertion\x20for\x20the\x20current\x20version','version','UTF-8\x20Markdown\x20file\x20(maximum\x205\x20MiB)','rules','--expected-version\x20must\x20be\x20a\x20non-negative\x20safe\x20integer.','unconfigured','5wkdZyV','defineProperty','contentHash','POST','--file\x20is\x20required.','set','str','flag','type','rabetbase\x20rule\x20get\x20--type\x20','8841889eSFVuT','cause','number','push','3242584XBWfZa','app_rule_file_required','appCode','11940633yzhzgZ','planned','1045913ZWnTHD','6005968JeCVGq','\x20--format\x20compress','\x20for\x20','/smartapi/knowledge-base/save','file','Do\x20not\x20resubmit\x20automatically.\x20Inspect\x20the\x20exact\x20rule\x20state\x20before\x20retrying.','cookie','app_rule_verification_failed','9777LdjYQx','Set\x20an\x20agent\x20context\x20rule\x20from\x20a\x20UTF-8\x20Markdown\x20file','\x20does\x20not\x20prove\x20the\x20requested\x20set\x20state.','expectedVersion','Inspect\x20it\x20with\x20`rabetbase\x20rule\x20get\x20--type\x20','string','136qFHVjD','app_rule_version_mismatch',';\x20current\x20version\x20is\x20','before','app_rule_expected_version_invalid','\x20--format\x20compress`;\x20do\x20not\x20resubmit\x20automatically.','5697426tnpWGD','input','expected-version','content'];a232_0x4aa2=function(){return _0x3ca7a4;};return a232_0x4aa2();}async function prepareSet(_0x4d76d8){const _0x53837d=a232_0x4bf09e,_0x40d70c=readSetInput(_0x4d76d8),_0x11c442=await readAppRuleFile(_0x40d70c[_0x53837d(0xd2)]),_0x5bd628=await getAppRule(_0x4d76d8[_0x53837d(0xd4)],{'appCode':_0x4d76d8[_0x53837d(0x103)],'type':_0x40d70c[_0x53837d(0xfb)]});if(_0x40d70c['expectedVersion']!==undefined&&_0x5bd628?.[_0x53837d(0xee)]!==_0x40d70c[_0x53837d(0xd9)])throw appRuleError(_0x53837d(0xdd),appRuleFileName(_0x40d70c[_0x53837d(0xfb)])+_0x53837d(0xec),'Expected\x20'+_0x40d70c[_0x53837d(0xd9)]+_0x53837d(0xde)+(_0x5bd628?.[_0x53837d(0xee)]??_0x53837d(0xf2))+'.\x20Run\x20rule\x20get\x20and\x20review\x20before\x20retrying.');return{'input':_0x40d70c,'replacement':_0x11c442,'beforeRecord':_0x5bd628,'before':projectAppRule(_0x40d70c['type'],_0x5bd628),'planned':{'type':_0x40d70c[_0x53837d(0xfb)],'fileName':appRuleFileName(_0x40d70c[_0x53837d(0xfb)]),'contextScope':appRuleContextScope(_0x40d70c['type']),'enabled':!![],'appCode':_0x4d76d8['appCode'],'scope':'rules','contentByteSize':_0x11c442['byteSize'],'contentHash':_0x11c442[_0x53837d(0xf5)]}};}function warningsFor(_0x319a88){return _0x319a88===undefined?[]:[NON_ATOMIC_WARNING];}export const ruleSet={'service':'rule','command':'set','description':a232_0x4bf09e(0xd7),'risk':'write','requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG,{'name':a232_0x4bf09e(0xd2),'type':a232_0x4bf09e(0xdb),'required':!![],'description':a232_0x4bf09e(0xef)},{'name':'expected-version','type':a232_0x4bf09e(0xff),'required':![],'description':a232_0x4bf09e(0xed)}],async 'validate'(_0x15073f){readSetInput(_0x15073f);},async 'dryRun'(_0x1cda51){const _0x6da87a=a232_0x4bf09e,_0x500d7e=await prepareSet(_0x1cda51);return asDryRunResult({'operation':_0x6da87a(0xf8),'selector':{'appCode':_0x1cda51['appCode'],'scope':_0x6da87a(0xf0),'type':_0x500d7e['input'][_0x6da87a(0xfb)]},'before':_0x500d7e[_0x6da87a(0xdf)],'after':_0x500d7e[_0x6da87a(0x105)],'dryRun':!![],'backend':{'method':_0x6da87a(0xf6),'path':SAVE_PATH},'warnings':warningsFor(_0x500d7e[_0x6da87a(0xe3)]['expectedVersion']),'verification':{'expectedVersion':_0x500d7e[_0x6da87a(0xe3)][_0x6da87a(0xd9)]??null,'atomicCompareAndSet':![],'lookupCommand':_0x6da87a(0xfc)+_0x500d7e[_0x6da87a(0xe3)]['type']+'\x20--format\x20compress'}},{'method':_0x6da87a(0xf6),'url':SAVE_PATH});},async 'execute'(_0x23d724){const _0x26fde7=a232_0x4bf09e,_0x720555=await prepareSet(_0x23d724);let _0xa65b12=![];try{await saveAppRule(_0x23d724[_0x26fde7(0xd4)],{'appCode':_0x23d724['appCode'],'type':_0x720555[_0x26fde7(0xe3)]['type'],'content':_0x720555['replacement'][_0x26fde7(0xe5)]});}catch(_0xe8de4c){if(!isPlatformTransportFailure(_0xe8de4c))throw _0xe8de4c;_0xa65b12=!![];}let _0x172699;try{_0x172699=await getAppRule(_0x23d724[_0x26fde7(0xd4)],{'appCode':_0x23d724[_0x26fde7(0x103)],'type':_0x720555['input']['type']});}catch(_0x5e8a36){const _0xf51787=appRuleError(_0xa65b12?_0x26fde7(0xeb):'app_rule_verification_unavailable','The\x20set\x20request\x20was\x20sent,\x20but\x20'+appRuleFileName(_0x720555[_0x26fde7(0xe3)][_0x26fde7(0xfb)])+'\x20could\x20not\x20be\x20verified.',_0x26fde7(0xd3));Object[_0x26fde7(0xf4)](_0xf51787,_0x26fde7(0xfe),{'value':_0x5e8a36,'enumerable':![]});throw _0xf51787;}const _0x4e47c8=_0x172699&&inspectAppRuleContent(_0x172699['content'])[_0x26fde7(0xf5)]===_0x720555[_0x26fde7(0xe9)]['contentHash'],_0x166185=_0x172699&&(_0x720555['beforeRecord']===null||_0x172699['version']>_0x720555['beforeRecord'][_0x26fde7(0xee)]);if(!_0x172699||!_0x4e47c8||!_0x166185)throw appRuleError(_0xa65b12?_0x26fde7(0xeb):_0x26fde7(0xd5),appRuleFileName(_0x720555[_0x26fde7(0xe3)][_0x26fde7(0xfb)])+_0x26fde7(0xd8),_0x26fde7(0xda)+_0x720555[_0x26fde7(0xe3)][_0x26fde7(0xfb)]+_0x26fde7(0xe1));const _0x440520=warningsFor(_0x720555['input'][_0x26fde7(0xd9)]);_0xa65b12&&_0x440520[_0x26fde7(0x100)](_0x26fde7(0xea));const _0x155f96=projectAppRule(_0x720555[_0x26fde7(0xe3)]['type'],_0x172699);return{'ok':!![],'data':{'operation':'set','selector':{'appCode':_0x23d724[_0x26fde7(0x103)],'scope':_0x26fde7(0xf0),'type':_0x720555[_0x26fde7(0xe3)]['type']},'before':_0x720555['before'],'after':_0x155f96,'dryRun':![],'backend':{'method':_0x26fde7(0xf6),'path':SAVE_PATH},'warnings':_0x440520,'verification':{'status':_0x26fde7(0xe8),'recoveredAfterUnknownResponse':_0xa65b12,'expectedVersion':_0x720555[_0x26fde7(0xe3)]['expectedVersion']??null,'atomicCompareAndSet':![],'lookupCommand':_0x26fde7(0xfc)+_0x720555[_0x26fde7(0xe3)][_0x26fde7(0xfb)]+_0x26fde7(0xcf)}},'message':'Set\x20'+appRuleFileName(_0x720555['input'][_0x26fde7(0xfb)])+_0x26fde7(0xd0)+_0x23d724[_0x26fde7(0x103)]};}};
1
+ const a232_0x4ce663=a232_0x1d22;(function(_0x2e1a93,_0x112a70){const _0x2cf3d2=a232_0x1d22,_0x21f212=_0x2e1a93();while(!![]){try{const _0x5d59a4=-parseInt(_0x2cf3d2(0x1fd))/0x1+-parseInt(_0x2cf3d2(0x209))/0x2+-parseInt(_0x2cf3d2(0x201))/0x3+-parseInt(_0x2cf3d2(0x20d))/0x4+-parseInt(_0x2cf3d2(0x1f9))/0x5*(parseInt(_0x2cf3d2(0x205))/0x6)+parseInt(_0x2cf3d2(0x220))/0x7+parseInt(_0x2cf3d2(0x1e9))/0x8;if(_0x5d59a4===_0x112a70)break;else _0x21f212['push'](_0x21f212['shift']());}catch(_0xe08223){_0x21f212['push'](_0x21f212['shift']());}}}(a232_0x14cc,0x95a10));import{getAppRule,isPlatformTransportFailure,saveAppRule}from'../../core/api-client.js';function a232_0x1d22(_0x1a4b8e,_0xedfa01){_0x1a4b8e=_0x1a4b8e-0x1e8;const _0x14cc9a=a232_0x14cc();let _0x1d22e3=_0x14cc9a[_0x1a4b8e];return _0x1d22e3;}import{asDryRunResult}from'../../commands/common/dry-run.js';import{APP_RULE_TYPE_FLAG,appRuleContextScope,appRuleError,appRuleFileName,inspectAppRuleContent,projectAppRule,readAppRuleFile,readAppRuleType}from'../../commands/rule/shared.js';const SAVE_PATH='/smartapi/knowledge-base/save',NON_ATOMIC_WARNING=a232_0x4ce663(0x20b);function a232_0x14cc(){const _0x57fa40=['The\x20set\x20request\x20was\x20sent,\x20but\x20','app_rule_file_required','8221500cDHrvk','app_rule_verification_failed','before','cause','17559920kxmCmL','input','trim','rule','\x20version\x20changed\x20before\x20write.','expectedVersion','version','POST','set','write','string','flag','expected-version','defineProperty','cookie','Inspect\x20it\x20with\x20`rabetbase\x20rule\x20get\x20--type\x20','225enLfBk','byteSize','contentHash','Set\x20an\x20agent\x20context\x20rule\x20from\x20a\x20UTF-8\x20Markdown\x20file','1182771WQeHRY','file','Set\x20','Do\x20not\x20resubmit\x20automatically.\x20Inspect\x20the\x20exact\x20rule\x20state\x20before\x20retrying.','1113459RrTZTj',';\x20current\x20version\x20is\x20','\x20does\x20not\x20prove\x20the\x20requested\x20set\x20state.','--expected-version\x20must\x20be\x20a\x20non-negative\x20safe\x20integer.','1926SgKdTt','content','--file\x20is\x20required.','type','1097148HUWaoo','planned','--expected-version\x20is\x20a\x20non-atomic\x20read-before-write\x20assertion;\x20the\x20server\x20save\x20contract\x20has\x20no\x20version\x20predicate.','Expected\x20','2558668wnVyNv','\x20could\x20not\x20be\x20verified.','\x20--format\x20compress','\x20for\x20','UTF-8\x20Markdown\x20file\x20(maximum\x205\x20MiB)','Pass\x20a\x20UTF-8\x20Markdown\x20file.','appCode','beforeRecord','replacement','isSafeInteger','rules','app_rule_set_outcome_unknown','rabetbase\x20rule\x20get\x20--type\x20','Non-atomic\x20preflight\x20assertion\x20for\x20the\x20current\x20version','str','push','verified'];a232_0x14cc=function(){return _0x57fa40;};return a232_0x14cc();}function readSetInput(_0x5d1fd0){const _0x2f210=a232_0x4ce663,_0x164f44=readAppRuleType(_0x5d1fd0),_0x4581af=_0x5d1fd0[_0x2f210(0x21b)]('file')[_0x2f210(0x1eb)]();if(!_0x4581af)throw appRuleError(_0x2f210(0x21f),_0x2f210(0x207),_0x2f210(0x212));const _0x132dba=_0x5d1fd0[_0x2f210(0x1f4)](_0x2f210(0x1f5));let _0x4e6d94;if(_0x132dba!==undefined){_0x4e6d94=Number(_0x132dba);if(!Number[_0x2f210(0x216)](_0x4e6d94)||_0x4e6d94<0x0)throw appRuleError('app_rule_expected_version_invalid',_0x2f210(0x204));}return{'type':_0x164f44,'file':_0x4581af,'expectedVersion':_0x4e6d94};}async function prepareSet(_0x461490){const _0x2c1bc3=a232_0x4ce663,_0x35cc7f=readSetInput(_0x461490),_0x595a60=await readAppRuleFile(_0x35cc7f[_0x2c1bc3(0x1fe)]),_0x18d54d=await getAppRule(_0x461490['cookie'],{'appCode':_0x461490['appCode'],'type':_0x35cc7f[_0x2c1bc3(0x208)]});if(_0x35cc7f['expectedVersion']!==undefined&&_0x18d54d?.[_0x2c1bc3(0x1ef)]!==_0x35cc7f['expectedVersion'])throw appRuleError('app_rule_version_mismatch',appRuleFileName(_0x35cc7f['type'])+_0x2c1bc3(0x1ed),_0x2c1bc3(0x20c)+_0x35cc7f['expectedVersion']+_0x2c1bc3(0x202)+(_0x18d54d?.[_0x2c1bc3(0x1ef)]??'unconfigured')+'.\x20Run\x20rule\x20get\x20and\x20review\x20before\x20retrying.');return{'input':_0x35cc7f,'replacement':_0x595a60,'beforeRecord':_0x18d54d,'before':projectAppRule(_0x35cc7f[_0x2c1bc3(0x208)],_0x18d54d),'planned':{'type':_0x35cc7f['type'],'fileName':appRuleFileName(_0x35cc7f[_0x2c1bc3(0x208)]),'contextScope':appRuleContextScope(_0x35cc7f['type']),'enabled':!![],'appCode':_0x461490[_0x2c1bc3(0x213)],'scope':_0x2c1bc3(0x217),'contentByteSize':_0x595a60[_0x2c1bc3(0x1fa)],'contentHash':_0x595a60[_0x2c1bc3(0x1fb)]}};}function warningsFor(_0x2edbe8){return _0x2edbe8===undefined?[]:[NON_ATOMIC_WARNING];}export const ruleSet={'service':a232_0x4ce663(0x1ec),'command':'set','description':a232_0x4ce663(0x1fc),'risk':a232_0x4ce663(0x1f2),'requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG,{'name':a232_0x4ce663(0x1fe),'type':a232_0x4ce663(0x1f3),'required':!![],'description':a232_0x4ce663(0x211)},{'name':a232_0x4ce663(0x1f5),'type':'number','required':![],'description':a232_0x4ce663(0x21a)}],async 'validate'(_0x538526){readSetInput(_0x538526);},async 'dryRun'(_0x4a7357){const _0x5c9522=a232_0x4ce663,_0x158e68=await prepareSet(_0x4a7357);return asDryRunResult({'operation':_0x5c9522(0x1f1),'selector':{'appCode':_0x4a7357['appCode'],'scope':_0x5c9522(0x217),'type':_0x158e68[_0x5c9522(0x1ea)][_0x5c9522(0x208)]},'before':_0x158e68[_0x5c9522(0x222)],'after':_0x158e68[_0x5c9522(0x20a)],'dryRun':!![],'backend':{'method':'POST','path':SAVE_PATH},'warnings':warningsFor(_0x158e68['input']['expectedVersion']),'verification':{'expectedVersion':_0x158e68['input'][_0x5c9522(0x1ee)]??null,'atomicCompareAndSet':![],'lookupCommand':_0x5c9522(0x219)+_0x158e68['input'][_0x5c9522(0x208)]+_0x5c9522(0x20f)}},{'method':_0x5c9522(0x1f0),'url':SAVE_PATH});},async 'execute'(_0x91830f){const _0x25ca39=a232_0x4ce663,_0x5d3d9d=await prepareSet(_0x91830f);let _0x1449ce=![];try{await saveAppRule(_0x91830f[_0x25ca39(0x1f7)],{'appCode':_0x91830f[_0x25ca39(0x213)],'type':_0x5d3d9d[_0x25ca39(0x1ea)][_0x25ca39(0x208)],'content':_0x5d3d9d[_0x25ca39(0x215)][_0x25ca39(0x206)]});}catch(_0x53cf0b){if(!isPlatformTransportFailure(_0x53cf0b))throw _0x53cf0b;_0x1449ce=!![];}let _0x3771ab;try{_0x3771ab=await getAppRule(_0x91830f[_0x25ca39(0x1f7)],{'appCode':_0x91830f[_0x25ca39(0x213)],'type':_0x5d3d9d[_0x25ca39(0x1ea)][_0x25ca39(0x208)]});}catch(_0x47255a){const _0x5ef42f=appRuleError(_0x1449ce?'app_rule_set_outcome_unknown':'app_rule_verification_unavailable',_0x25ca39(0x21e)+appRuleFileName(_0x5d3d9d[_0x25ca39(0x1ea)][_0x25ca39(0x208)])+_0x25ca39(0x20e),_0x25ca39(0x200));Object[_0x25ca39(0x1f6)](_0x5ef42f,_0x25ca39(0x1e8),{'value':_0x47255a,'enumerable':![]});throw _0x5ef42f;}const _0x2e7648=_0x3771ab&&inspectAppRuleContent(_0x3771ab[_0x25ca39(0x206)])[_0x25ca39(0x1fb)]===_0x5d3d9d[_0x25ca39(0x215)][_0x25ca39(0x1fb)],_0x360dfd=_0x3771ab&&(_0x5d3d9d['beforeRecord']===null||_0x3771ab[_0x25ca39(0x1ef)]>_0x5d3d9d[_0x25ca39(0x214)][_0x25ca39(0x1ef)]);if(!_0x3771ab||!_0x2e7648||!_0x360dfd)throw appRuleError(_0x1449ce?_0x25ca39(0x218):_0x25ca39(0x221),appRuleFileName(_0x5d3d9d[_0x25ca39(0x1ea)][_0x25ca39(0x208)])+_0x25ca39(0x203),_0x25ca39(0x1f8)+_0x5d3d9d[_0x25ca39(0x1ea)][_0x25ca39(0x208)]+'\x20--format\x20compress`;\x20do\x20not\x20resubmit\x20automatically.');const _0x3f6197=warningsFor(_0x5d3d9d[_0x25ca39(0x1ea)][_0x25ca39(0x1ee)]);_0x1449ce&&_0x3f6197[_0x25ca39(0x21c)]('Set\x20response\x20was\x20unavailable;\x20verified\x20the\x20exact\x20content\x20readback\x20without\x20resubmitting.');const _0x27cf90=projectAppRule(_0x5d3d9d[_0x25ca39(0x1ea)]['type'],_0x3771ab);return{'ok':!![],'data':{'operation':_0x25ca39(0x1f1),'selector':{'appCode':_0x91830f[_0x25ca39(0x213)],'scope':_0x25ca39(0x217),'type':_0x5d3d9d['input'][_0x25ca39(0x208)]},'before':_0x5d3d9d['before'],'after':_0x27cf90,'dryRun':![],'backend':{'method':'POST','path':SAVE_PATH},'warnings':_0x3f6197,'verification':{'status':_0x25ca39(0x21d),'recoveredAfterUnknownResponse':_0x1449ce,'expectedVersion':_0x5d3d9d[_0x25ca39(0x1ea)][_0x25ca39(0x1ee)]??null,'atomicCompareAndSet':![],'lookupCommand':'rabetbase\x20rule\x20get\x20--type\x20'+_0x5d3d9d[_0x25ca39(0x1ea)][_0x25ca39(0x208)]+_0x25ca39(0x20f)}},'message':_0x25ca39(0x1ff)+appRuleFileName(_0x5d3d9d[_0x25ca39(0x1ea)][_0x25ca39(0x208)])+_0x25ca39(0x210)+_0x91830f[_0x25ca39(0x213)]};}};
@@ -1 +1 @@
1
- const a233_0x26382b=a233_0x5a8d;function a233_0x5a8d(_0x1a6351,_0x26b93d){_0x1a6351=_0x1a6351-0x79;const _0x5ea92f=a233_0x5ea9();let _0x5a8d4e=_0x5ea92f[_0x1a6351];return _0x5a8d4e;}(function(_0x5ae463,_0x5bf4d6){const _0x287f15=a233_0x5a8d,_0x5b12e9=_0x5ae463();while(!![]){try{const _0x2b0771=-parseInt(_0x287f15(0xa9))/0x1+parseInt(_0x287f15(0x9c))/0x2+-parseInt(_0x287f15(0x87))/0x3+parseInt(_0x287f15(0x7b))/0x4*(-parseInt(_0x287f15(0x88))/0x5)+parseInt(_0x287f15(0x98))/0x6*(-parseInt(_0x287f15(0x89))/0x7)+-parseInt(_0x287f15(0x93))/0x8+-parseInt(_0x287f15(0x80))/0x9*(-parseInt(_0x287f15(0xa5))/0xa);if(_0x2b0771===_0x5bf4d6)break;else _0x5b12e9['push'](_0x5b12e9['shift']());}catch(_0x10f07a){_0x5b12e9['push'](_0x5b12e9['shift']());}}}(a233_0x5ea9,0x29e5c));import{createHash}from'node:crypto';import{readFile,stat}from'node:fs/promises';import{resolve}from'node:path';import{TextDecoder}from'node:util';import{CliError}from'../../errors.js';export const APP_RULE_TYPES=[a233_0x26382b(0x8d),'database'];function a233_0x5ea9(){const _0x1245fe=['content','App\x20rule\x20file\x20is\x20blank:\x20','7790910tWjGKi','Context\x20rule\x20type:\x20rules\x20for\x20page/API\x20development\x20agents\x20(DB\x20Agent\x20excluded),\x20database\x20for\x20DB\x20Agent\x20database\x20analysis','scope','contentHash','116428jDgFtj','app_rule_type_invalid','update','createTime','version','530844ygMYrb','app_rule_file_required','Pass\x20a\x20UTF-8\x20Markdown\x20file.','size','sha256','9cEgBaS','App\x20rule\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','toLowerCase','page-api-development','message','App\x20rule\x20content\x20exceeds\x20the\x205\x20MiB\x20server\x20limit.','type','633621unkaUa','5tmTICn','900242Afelng','app_rule_file_invalid','App\x20rule\x20file\x20is\x20not\x20valid\x20UTF-8:\x20','app_rule_content_invalid','rules','RULES.md','utf8','app_rule_file_unreadable','byteLength','from','1366688IIWXBj','Cannot\x20access\x20app\x20rule\x20file:\x20','Cannot\x20read\x20app\x20rule\x20file:\x20','updateTime','decode','6lzwPiQ','str','database','byteSize','304618EkfwNz','sha256:','app_rule_content_too_large','trim','hex','appCode','database-analysis'];a233_0x5ea9=function(){return _0x1245fe;};return a233_0x5ea9();}export const MAX_APP_RULE_BYTES=0x5*0x400*0x400;const APP_RULE_FILES={'rules':a233_0x26382b(0x8e),'database':'DATABASE.md'},APP_RULE_CONTEXT_SCOPES={'rules':a233_0x26382b(0x83),'database':a233_0x26382b(0xa2)};export function appRuleError(_0x1a4a4d,_0x4fd732,_0x2d2f9b){return new CliError(_0x1a4a4d,0x1,_0x4fd732,_0x2d2f9b);}export function readAppRuleType(_0x18fd38){const _0x34541b=a233_0x26382b,_0xc5ec15=_0x18fd38[_0x34541b(0x99)](_0x34541b(0x86))['trim']()[_0x34541b(0x82)]();if(_0xc5ec15!==_0x34541b(0x8d)&&_0xc5ec15!==_0x34541b(0x9a))throw appRuleError(_0x34541b(0xaa),'--type\x20must\x20be\x20either\x20rules\x20or\x20database.');return _0xc5ec15;}export function appRuleFileName(_0x2e0487){return APP_RULE_FILES[_0x2e0487];}export function appRuleContextScope(_0x283f23){return APP_RULE_CONTEXT_SCOPES[_0x283f23];}export function inspectAppRuleContent(_0x4cbcdf){const _0x2dd3f6=a233_0x26382b,_0x117064=Buffer[_0x2dd3f6(0x92)](_0x4cbcdf,_0x2dd3f6(0x8f));return{'content':_0x4cbcdf,'byteSize':_0x117064[_0x2dd3f6(0x91)],'contentHash':_0x2dd3f6(0x9d)+createHash(_0x2dd3f6(0x7f))[_0x2dd3f6(0xab)](_0x117064)['digest'](_0x2dd3f6(0xa0))};}export async function readAppRuleFile(_0x47356e){const _0x2fd226=a233_0x26382b,_0x28c8c9=_0x47356e[_0x2fd226(0x9f)]();if(!_0x28c8c9)throw appRuleError(_0x2fd226(0x7c),'--file\x20is\x20required.',_0x2fd226(0x7d));const _0x2f035d=resolve(_0x28c8c9);let _0x4e503;try{_0x4e503=await stat(_0x2f035d);}catch(_0xea325d){throw appRuleError(_0x2fd226(0x90),_0x2fd226(0x94)+_0x28c8c9,_0xea325d instanceof Error?_0xea325d['message']:String(_0xea325d));}if(!_0x4e503['isFile']())throw appRuleError(_0x2fd226(0x8a),_0x2fd226(0x81)+_0x28c8c9);if(_0x4e503[_0x2fd226(0x7e)]>MAX_APP_RULE_BYTES)throw appRuleError(_0x2fd226(0x9e),_0x2fd226(0x85));let _0x5ba523;try{_0x5ba523=await readFile(_0x2f035d);}catch(_0x1716d1){throw appRuleError(_0x2fd226(0x90),_0x2fd226(0x95)+_0x28c8c9,_0x1716d1 instanceof Error?_0x1716d1[_0x2fd226(0x84)]:String(_0x1716d1));}if(_0x5ba523['byteLength']>MAX_APP_RULE_BYTES)throw appRuleError(_0x2fd226(0x9e),_0x2fd226(0x85));let _0x2823d7;try{_0x2823d7=new TextDecoder('utf-8',{'fatal':!![],'ignoreBOM':!![]})[_0x2fd226(0x97)](_0x5ba523);}catch{throw appRuleError(_0x2fd226(0x8c),_0x2fd226(0x8b)+_0x28c8c9);}if(!_0x2823d7[_0x2fd226(0x9f)]())throw appRuleError(_0x2fd226(0x8c),_0x2fd226(0xa4)+_0x28c8c9);return inspectAppRuleContent(_0x2823d7);}export function projectAppRule(_0x2e9234,_0x2f6981){const _0x843809=a233_0x26382b;if(!_0x2f6981)return{'type':_0x2e9234,'fileName':appRuleFileName(_0x2e9234),'contextScope':appRuleContextScope(_0x2e9234),'enabled':![]};const _0x1f0e43=inspectAppRuleContent(_0x2f6981[_0x843809(0xa3)]);return{'type':_0x2e9234,'fileName':appRuleFileName(_0x2e9234),'contextScope':appRuleContextScope(_0x2e9234),'enabled':!![],'id':_0x2f6981['id'],'scope':_0x2f6981[_0x843809(0xa7)],'appCode':_0x2f6981[_0x843809(0xa1)],'version':_0x2f6981[_0x843809(0x7a)],'contentByteSize':_0x1f0e43[_0x843809(0x9b)],'contentHash':_0x1f0e43[_0x843809(0xa8)],..._0x2f6981[_0x843809(0x79)]!==undefined&&_0x2f6981['createTime']!==null?{'createTime':_0x2f6981[_0x843809(0x79)]}:{},..._0x2f6981['updateTime']!==undefined&&_0x2f6981[_0x843809(0x96)]!==null?{'updateTime':_0x2f6981[_0x843809(0x96)]}:{}};}export const APP_RULE_TYPE_FLAG={'name':a233_0x26382b(0x86),'type':'string','required':!![],'description':a233_0x26382b(0xa6),'enum':[...APP_RULE_TYPES]};
1
+ const a233_0x49873a=a233_0x3ce8;(function(_0x4d2ccf,_0x40d475){const _0x2e84fd=a233_0x3ce8,_0x27fc41=_0x4d2ccf();while(!![]){try{const _0x44ecb7=-parseInt(_0x2e84fd(0x13d))/0x1*(parseInt(_0x2e84fd(0x131))/0x2)+-parseInt(_0x2e84fd(0x122))/0x3*(parseInt(_0x2e84fd(0x12c))/0x4)+parseInt(_0x2e84fd(0x11a))/0x5+parseInt(_0x2e84fd(0x12d))/0x6*(parseInt(_0x2e84fd(0x144))/0x7)+parseInt(_0x2e84fd(0x149))/0x8*(parseInt(_0x2e84fd(0x12f))/0x9)+-parseInt(_0x2e84fd(0x124))/0xa*(-parseInt(_0x2e84fd(0x11d))/0xb)+-parseInt(_0x2e84fd(0x130))/0xc;if(_0x44ecb7===_0x40d475)break;else _0x27fc41['push'](_0x27fc41['shift']());}catch(_0x19be3a){_0x27fc41['push'](_0x27fc41['shift']());}}}(a233_0x236e,0xb9d4e));import{createHash}from'node:crypto';function a233_0x236e(){const _0x517fe3=['version','--type\x20must\x20be\x20either\x20rules\x20or\x20database.','sha256','app_rule_content_invalid','decode','Context\x20rule\x20type:\x20rules\x20for\x20page/API\x20development\x20agents\x20(DB\x20Agent\x20excluded),\x20database\x20for\x20DB\x20Agent\x20database\x20analysis','1268zwgVFM','7913832yAwqad','app_rule_type_invalid','12628323SaSeYg','20790516jfeins','2129036WpTpVu','size','app_rule_file_unreadable','hex','update','digest','message','page-api-development','type','utf-8','App\x20rule\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','app_rule_file_invalid','1BRGlXq','app_rule_content_too_large','createTime','DATABASE.md','Cannot\x20access\x20app\x20rule\x20file:\x20','updateTime','App\x20rule\x20file\x20is\x20not\x20valid\x20UTF-8:\x20','7baKAqz','isFile','App\x20rule\x20file\x20is\x20blank:\x20','sha256:','toLowerCase','8PBYTcI','RULES.md','App\x20rule\x20content\x20exceeds\x20the\x205\x20MiB\x20server\x20limit.','database','appCode','content','scope','5554100LHptYI','byteSize','Pass\x20a\x20UTF-8\x20Markdown\x20file.','2522498XNXkWc','rules','trim','database-analysis','str','4770yaWixD','--file\x20is\x20required.','10hsmgKI','utf8'];a233_0x236e=function(){return _0x517fe3;};return a233_0x236e();}import{readFile,stat}from'node:fs/promises';import{resolve}from'node:path';import{TextDecoder}from'node:util';import{CliError}from'../../errors.js';export const APP_RULE_TYPES=[a233_0x49873a(0x11e),a233_0x49873a(0x14c)];export const MAX_APP_RULE_BYTES=0x5*0x400*0x400;const APP_RULE_FILES={'rules':a233_0x49873a(0x14a),'database':a233_0x49873a(0x140)},APP_RULE_CONTEXT_SCOPES={'rules':a233_0x49873a(0x138),'database':a233_0x49873a(0x120)};export function appRuleError(_0x267fff,_0x58543c,_0x401095){return new CliError(_0x267fff,0x1,_0x58543c,_0x401095);}export function readAppRuleType(_0x3afc81){const _0x705d46=a233_0x49873a,_0x539bd5=_0x3afc81[_0x705d46(0x121)](_0x705d46(0x139))[_0x705d46(0x11f)]()[_0x705d46(0x148)]();if(_0x539bd5!==_0x705d46(0x11e)&&_0x539bd5!==_0x705d46(0x14c))throw appRuleError(_0x705d46(0x12e),_0x705d46(0x127));return _0x539bd5;}export function appRuleFileName(_0x59d070){return APP_RULE_FILES[_0x59d070];}export function appRuleContextScope(_0x29a76a){return APP_RULE_CONTEXT_SCOPES[_0x29a76a];}export function inspectAppRuleContent(_0x4eca0c){const _0x2fd97a=a233_0x49873a,_0x4f52a7=Buffer['from'](_0x4eca0c,_0x2fd97a(0x125));return{'content':_0x4eca0c,'byteSize':_0x4f52a7['byteLength'],'contentHash':_0x2fd97a(0x147)+createHash(_0x2fd97a(0x128))[_0x2fd97a(0x135)](_0x4f52a7)[_0x2fd97a(0x136)](_0x2fd97a(0x134))};}export async function readAppRuleFile(_0x302e6f){const _0x2537e7=a233_0x49873a,_0x3e0bab=_0x302e6f[_0x2537e7(0x11f)]();if(!_0x3e0bab)throw appRuleError('app_rule_file_required',_0x2537e7(0x123),_0x2537e7(0x11c));const _0x3c5b5a=resolve(_0x3e0bab);let _0x1c84b5;try{_0x1c84b5=await stat(_0x3c5b5a);}catch(_0x47d438){throw appRuleError(_0x2537e7(0x133),_0x2537e7(0x141)+_0x3e0bab,_0x47d438 instanceof Error?_0x47d438[_0x2537e7(0x137)]:String(_0x47d438));}if(!_0x1c84b5[_0x2537e7(0x145)]())throw appRuleError(_0x2537e7(0x13c),_0x2537e7(0x13b)+_0x3e0bab);if(_0x1c84b5[_0x2537e7(0x132)]>MAX_APP_RULE_BYTES)throw appRuleError('app_rule_content_too_large',_0x2537e7(0x14b));let _0x1eb023;try{_0x1eb023=await readFile(_0x3c5b5a);}catch(_0xca61ba){throw appRuleError('app_rule_file_unreadable','Cannot\x20read\x20app\x20rule\x20file:\x20'+_0x3e0bab,_0xca61ba instanceof Error?_0xca61ba[_0x2537e7(0x137)]:String(_0xca61ba));}if(_0x1eb023['byteLength']>MAX_APP_RULE_BYTES)throw appRuleError(_0x2537e7(0x13e),_0x2537e7(0x14b));let _0xa9ea0;try{_0xa9ea0=new TextDecoder(_0x2537e7(0x13a),{'fatal':!![],'ignoreBOM':!![]})[_0x2537e7(0x12a)](_0x1eb023);}catch{throw appRuleError('app_rule_content_invalid',_0x2537e7(0x143)+_0x3e0bab);}if(!_0xa9ea0[_0x2537e7(0x11f)]())throw appRuleError(_0x2537e7(0x129),_0x2537e7(0x146)+_0x3e0bab);return inspectAppRuleContent(_0xa9ea0);}function a233_0x3ce8(_0x1f7f0f,_0x149a34){_0x1f7f0f=_0x1f7f0f-0x11a;const _0x236e25=a233_0x236e();let _0x3ce824=_0x236e25[_0x1f7f0f];return _0x3ce824;}export function projectAppRule(_0x5cdcbb,_0x1a78ba){const _0xafe061=a233_0x49873a;if(!_0x1a78ba)return{'type':_0x5cdcbb,'fileName':appRuleFileName(_0x5cdcbb),'contextScope':appRuleContextScope(_0x5cdcbb),'enabled':![]};const _0x252f43=inspectAppRuleContent(_0x1a78ba[_0xafe061(0x14e)]);return{'type':_0x5cdcbb,'fileName':appRuleFileName(_0x5cdcbb),'contextScope':appRuleContextScope(_0x5cdcbb),'enabled':!![],'id':_0x1a78ba['id'],'scope':_0x1a78ba[_0xafe061(0x14f)],'appCode':_0x1a78ba[_0xafe061(0x14d)],'version':_0x1a78ba[_0xafe061(0x126)],'contentByteSize':_0x252f43[_0xafe061(0x11b)],'contentHash':_0x252f43['contentHash'],..._0x1a78ba[_0xafe061(0x13f)]!==undefined&&_0x1a78ba['createTime']!==null?{'createTime':_0x1a78ba['createTime']}:{},..._0x1a78ba[_0xafe061(0x142)]!==undefined&&_0x1a78ba[_0xafe061(0x142)]!==null?{'updateTime':_0x1a78ba[_0xafe061(0x142)]}:{}};}export const APP_RULE_TYPE_FLAG={'name':'type','type':'string','required':!![],'description':a233_0x49873a(0x12b),'enum':[...APP_RULE_TYPES]};
@@ -1 +1 @@
1
- const a234_0x53374d=a234_0x6c1e;(function(_0xef83ba,_0x2d8978){const _0xf38b=a234_0x6c1e,_0x272098=_0xef83ba();while(!![]){try{const _0x3d1789=-parseInt(_0xf38b(0x133))/0x1*(-parseInt(_0xf38b(0x137))/0x2)+-parseInt(_0xf38b(0x124))/0x3*(-parseInt(_0xf38b(0x164))/0x4)+-parseInt(_0xf38b(0x15f))/0x5+parseInt(_0xf38b(0x12e))/0x6*(parseInt(_0xf38b(0x126))/0x7)+-parseInt(_0xf38b(0x147))/0x8*(-parseInt(_0xf38b(0x156))/0x9)+-parseInt(_0xf38b(0x15c))/0xa*(-parseInt(_0xf38b(0x140))/0xb)+parseInt(_0xf38b(0x154))/0xc*(-parseInt(_0xf38b(0x139))/0xd);if(_0x3d1789===_0x2d8978)break;else _0x272098['push'](_0x272098['shift']());}catch(_0x3a3ace){_0x272098['push'](_0x272098['shift']());}}}(a234_0x2d77,0x6ba71));import{readFileSync,existsSync}from'node:fs';import{CLI_BIN_NAME}from'../../constant/cli.js';import{resolve,delimiter,join}from'node:path';import{spawn}from'node:child_process';import{CliErrors}from'../../errors.js';import{findProjectRootDirectory,resolveConfigPath}from'../../context/config-loader.js';import{writeProjectDomainRoutingManifest}from'../../config/project-domain-routing.js';import{checkSdkVersion,printSdkUpgradeWarning}from'../../utils/check-sdk-version.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../utils/cli-version-check.js';function a234_0x2d77(){const _0x3be63e=['\x22\x20not\x20found\x20in\x20package.json.','scripts','write','433292VcyYjZ','bun','(none)','yarn','4IXwlxD','run','14524887xObedJ','inherit','\x0a\x20\x20Usage:\x20','yarn.lock','changed','\x20run\x20','has','11zpJIID','Enable\x20watch\x20mode\x20for\x20preview','vite','pnpm','.bin','\x20run\x20start','bun.lock','485592VCXdcE','log','\x0a\x20\x20Available\x20scripts:\x0a','args','path','error','bool','close','build','Available:\x20','\x20run\x20<script>\x0a','node_modules','--watch','12Pvlwge','script','27gFZoTB','\x20\x20EXAMPLES','start','push','\x20run\x20preview','Script\x20\x22','4788280fKXpsb','pnpm-lock.yaml','No\x20scripts\x20defined\x20in\x20package.json.','3963390JzQTlE','\x20run\x20preview\x20--watch','\x20\x20\x20\x20','dev','cwd','4QOYkGn','No\x20package.json\x20found\x20in\x20current\x20directory.','preview','utf-8','vite\x20preview\x20exited\x20with\x20code\x20','1147071xSAQiY','needsUpgrade','1078znrOVx','join','validation','keys','Run\x20a\x20package.json\x20script','Domain\x20routing\x20synchronized:\x20','\x20run\x20build','bun.lockb','17184vXwsTb','watch'];a234_0x2d77=function(){return _0x3be63e;};return a234_0x2d77();}const VERSION_CHECK_SCRIPTS=new Set([a234_0x53374d(0x158),a234_0x53374d(0x162)]),DOMAIN_ROUTING_SYNC_SCRIPTS=new Set([a234_0x53374d(0x158),a234_0x53374d(0x162),a234_0x53374d(0x14f),a234_0x53374d(0x166)]);export function syncProjectDomainRoutingBeforeScript(_0x2f3918,_0x511bed){const _0x55b9ff=a234_0x53374d;if(!DOMAIN_ROUTING_SYNC_SCRIPTS[_0x55b9ff(0x13f)](_0x511bed))return null;const _0x1ccf6b=findProjectRootDirectory(_0x2f3918);if(!resolveConfigPath(_0x1ccf6b))return null;const _0x4b9b98=writeProjectDomainRoutingManifest(_0x1ccf6b);return{'path':_0x4b9b98['path'],'changed':_0x4b9b98[_0x55b9ff(0x13d)]};}function readPackageScripts(_0x357581){const _0x5da456=a234_0x53374d,_0x2fe336=resolve(_0x357581,'package.json');if(!existsSync(_0x2fe336))return null;try{const _0x22a1a8=JSON['parse'](readFileSync(_0x2fe336,_0x5da456(0x167)));return _0x22a1a8[_0x5da456(0x131)]??{};}catch{return null;}}function detectPackageManager(_0x1dc83c){const _0x4d5aba=a234_0x53374d;if(existsSync(resolve(_0x1dc83c,_0x4d5aba(0x12d)))||existsSync(resolve(_0x1dc83c,_0x4d5aba(0x146))))return _0x4d5aba(0x134);if(existsSync(resolve(_0x1dc83c,_0x4d5aba(0x15d))))return _0x4d5aba(0x143);if(existsSync(resolve(_0x1dc83c,_0x4d5aba(0x13c))))return _0x4d5aba(0x136);return'npm';}async function versionCheck(_0x5e5dda){const _0xffcf9c=a234_0x53374d,_0x29d8e7=await checkCliVersion();(_0x29d8e7['needsUpgrade']||_0x29d8e7['belowMinimum'])&&(printCliUpgradeWarning(_0x29d8e7),assertCliVersionSupported(_0x29d8e7));const _0x59bd54=await checkSdkVersion(_0x5e5dda);if(_0x59bd54[_0xffcf9c(0x125)])printSdkUpgradeWarning(_0x59bd54);}function a234_0x6c1e(_0x27bcb0,_0x4a6140){_0x27bcb0=_0x27bcb0-0x123;const _0x2d77ad=a234_0x2d77();let _0x6c1e0b=_0x2d77ad[_0x27bcb0];return _0x6c1e0b;}function spawnScript(_0x3fe2ea,_0xcbb93d,_0x1955c3,_0x2a141e){return new Promise((_0x745466,_0xaa9e52)=>{const _0x385579=a234_0x6c1e,_0x51a1ee=['run',_0xcbb93d,..._0x1955c3],_0x30b903=spawn(_0x3fe2ea,_0x51a1ee,{'cwd':_0x2a141e,'stdio':_0x385579(0x13a),'shell':!![],'env':{...process.env,'PATH':''+join(_0x2a141e,_0x385579(0x152),_0x385579(0x144))+delimiter+process.env.PATH}});_0x30b903['on'](_0x385579(0x14e),_0x5017dd=>{const _0x4fba3e=_0x385579;if(_0x5017dd===0x0||_0x5017dd===null)_0x745466();else _0xaa9e52(new Error(_0x3fe2ea+_0x4fba3e(0x13e)+_0xcbb93d+'\x20exited\x20with\x20code\x20'+_0x5017dd));}),_0x30b903['on'](_0x385579(0x14c),_0xaa9e52);});}function spawnViteBuildWatch(_0xb705c3){return new Promise((_0x4e3f73,_0xeefba6)=>{const _0x385a61=a234_0x6c1e,_0x12622f=spawn(_0x385a61(0x142),[_0x385a61(0x14f),_0x385a61(0x153)],{'cwd':_0xb705c3,'stdio':_0x385a61(0x13a),'shell':!![],'env':{...process.env,'PATH':''+join(_0xb705c3,_0x385a61(0x152),_0x385a61(0x144))+delimiter+process.env.PATH}});_0x12622f['on']('close',_0x75b6a1=>{if(_0x75b6a1===0x0||_0x75b6a1===null)_0x4e3f73();else _0xeefba6(new Error('vite\x20build\x20--watch\x20exited\x20with\x20code\x20'+_0x75b6a1));}),_0x12622f['on']('error',_0xeefba6);});}function spawnVitePreview(_0x3e3757){return new Promise((_0x322d2b,_0x269642)=>{const _0x18f8a5=a234_0x6c1e,_0x2ad049=spawn('vite',[_0x18f8a5(0x166)],{'cwd':_0x3e3757,'stdio':_0x18f8a5(0x13a),'shell':!![],'env':{...process.env,'PATH':''+join(_0x3e3757,'node_modules',_0x18f8a5(0x144))+delimiter+process.env.PATH}});_0x2ad049['on'](_0x18f8a5(0x14e),_0xe92859=>{const _0x5b57ca=_0x18f8a5;if(_0xe92859===0x0||_0xe92859===null)_0x322d2b();else _0x269642(new Error(_0x5b57ca(0x123)+_0xe92859));}),_0x2ad049['on'](_0x18f8a5(0x14c),_0x269642);});}const runFlags=[{'name':a234_0x53374d(0x12f),'type':'boolean','description':a234_0x53374d(0x141),'default':![]}];export const runDefinition={'service':a234_0x53374d(0x138),'command':a234_0x53374d(0x138),'description':a234_0x53374d(0x12a),'risk':a234_0x53374d(0x132),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a234_0x53374d(0x155),'description':'Script\x20name\x20defined\x20in\x20package.json','required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x22a42e=a234_0x53374d,_0x522bef=[];return _0x522bef[_0x22a42e(0x159)](_0x22a42e(0x157)),_0x522bef[_0x22a42e(0x159)]('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x22a42e(0x145)),_0x522bef[_0x22a42e(0x159)](_0x22a42e(0x161)+CLI_BIN_NAME+_0x22a42e(0x12c)),_0x522bef[_0x22a42e(0x159)](_0x22a42e(0x161)+CLI_BIN_NAME+_0x22a42e(0x15a)),_0x522bef[_0x22a42e(0x159)](_0x22a42e(0x161)+CLI_BIN_NAME+_0x22a42e(0x160)),_0x522bef['join']('\x0a');},async 'execute'(_0x439db1){const _0x12b62b=a234_0x53374d,_0x370692=process[_0x12b62b(0x163)](),_0x2eb927=_0x439db1[_0x12b62b(0x14a)][0x0],_0x4a23c2=_0x439db1[_0x12b62b(0x14a)]['slice'](0x1),_0x3a4ca7=readPackageScripts(_0x370692);if(!_0x3a4ca7)throw CliErrors[_0x12b62b(0x128)](_0x12b62b(0x165));if(!_0x2eb927){const _0x30f84b=Object[_0x12b62b(0x129)](_0x3a4ca7);if(_0x30f84b['length']===0x0)console['log'](_0x12b62b(0x15e));else{console['log'](_0x12b62b(0x149));for(const _0x4f8627 of _0x30f84b){console[_0x12b62b(0x148)](_0x12b62b(0x161)+_0x4f8627);}console[_0x12b62b(0x148)](_0x12b62b(0x13b)+CLI_BIN_NAME+_0x12b62b(0x151));}return{'ok':!![]};}if(!_0x3a4ca7[_0x2eb927])throw CliErrors['validation'](_0x12b62b(0x15b)+_0x2eb927+_0x12b62b(0x130),_0x12b62b(0x150)+(Object[_0x12b62b(0x129)](_0x3a4ca7)[_0x12b62b(0x127)](',\x20')||_0x12b62b(0x135)));const _0xe0042d=detectPackageManager(_0x370692),_0x1d61b8=syncProjectDomainRoutingBeforeScript(_0x370692,_0x2eb927);_0x1d61b8?.[_0x12b62b(0x13d)]&&console['error'](_0x12b62b(0x12b)+_0x1d61b8[_0x12b62b(0x14b)]);VERSION_CHECK_SCRIPTS[_0x12b62b(0x13f)](_0x2eb927)&&await versionCheck(_0x370692);if(_0x2eb927===_0x12b62b(0x166)&&_0x439db1[_0x12b62b(0x14d)](_0x12b62b(0x12f)))return await Promise['all']([spawnViteBuildWatch(_0x370692),spawnVitePreview(_0x370692)]),{'ok':!![]};return await spawnScript(_0xe0042d,_0x2eb927,_0x4a23c2,_0x370692),{'ok':!![]};}};
1
+ const a234_0xe707ed=a234_0xa91e;(function(_0x91b94,_0x5ad450){const _0x5e7e5d=a234_0xa91e,_0x5ca4fc=_0x91b94();while(!![]){try{const _0x4bba92=-parseInt(_0x5e7e5d(0x1d4))/0x1+-parseInt(_0x5e7e5d(0x1f8))/0x2+-parseInt(_0x5e7e5d(0x1cf))/0x3+parseInt(_0x5e7e5d(0x1f7))/0x4+-parseInt(_0x5e7e5d(0x1f6))/0x5+parseInt(_0x5e7e5d(0x1c4))/0x6*(-parseInt(_0x5e7e5d(0x1f5))/0x7)+-parseInt(_0x5e7e5d(0x1ef))/0x8*(-parseInt(_0x5e7e5d(0x1de))/0x9);if(_0x4bba92===_0x5ad450)break;else _0x5ca4fc['push'](_0x5ca4fc['shift']());}catch(_0x189247){_0x5ca4fc['push'](_0x5ca4fc['shift']());}}}(a234_0x5709,0x72a11));import{readFileSync,existsSync}from'node:fs';function a234_0x5709(){const _0x2f77bc=['\x20run\x20start','watch','Run\x20a\x20package.json\x20script','bun.lockb','has','length','inherit','2326920VjTFxy','run','package.json','.bin','dev','546945swVfNP','boolean','log','keys','cwd','\x20\x20\x20\x20','Domain\x20routing\x20synchronized:\x20','join','utf-8','preview','9kUAyBV','path','changed','\x20run\x20','error','validation','parse','\x20run\x20<script>\x0a','\x20run\x20preview','bun.lock','\x20exited\x20with\x20code\x20','No\x20scripts\x20defined\x20in\x20package.json.','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','node_modules','belowMinimum','build','(none)','20883608GEFMEV','Available:\x20','\x0a\x20\x20Usage:\x20','npm','needsUpgrade','scripts','19733IWsFIx','2522040gCElpS','2042956JZooNf','1249054ADszCE','\x20\x20EXAMPLES','args','vite','close','Script\x20\x22','push','pnpm','yarn.lock','Enable\x20watch\x20mode\x20for\x20preview','426irlsHE','start','yarn','bool'];a234_0x5709=function(){return _0x2f77bc;};return a234_0x5709();}import{CLI_BIN_NAME}from'../../constant/cli.js';import{resolve,delimiter,join}from'node:path';import{spawn}from'node:child_process';import{CliErrors}from'../../errors.js';import{findProjectRootDirectory,resolveConfigPath}from'../../context/config-loader.js';import{writeProjectDomainRoutingManifest}from'../../config/project-domain-routing.js';import{checkSdkVersion,printSdkUpgradeWarning}from'../../utils/check-sdk-version.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../utils/cli-version-check.js';const VERSION_CHECK_SCRIPTS=new Set([a234_0xe707ed(0x1c5),a234_0xe707ed(0x1d3)]),DOMAIN_ROUTING_SYNC_SCRIPTS=new Set([a234_0xe707ed(0x1c5),a234_0xe707ed(0x1d3),a234_0xe707ed(0x1ed),a234_0xe707ed(0x1dd)]);export function syncProjectDomainRoutingBeforeScript(_0x27daff,_0x6dc0bf){const _0x2df99a=a234_0xe707ed;if(!DOMAIN_ROUTING_SYNC_SCRIPTS[_0x2df99a(0x1cc)](_0x6dc0bf))return null;const _0x1d83b3=findProjectRootDirectory(_0x27daff);if(!resolveConfigPath(_0x1d83b3))return null;const _0x2e1865=writeProjectDomainRoutingManifest(_0x1d83b3);return{'path':_0x2e1865[_0x2df99a(0x1df)],'changed':_0x2e1865[_0x2df99a(0x1e0)]};}function a234_0xa91e(_0x2f71b5,_0x1ec80e){_0x2f71b5=_0x2f71b5-0x1bb;const _0x570986=a234_0x5709();let _0xa91e18=_0x570986[_0x2f71b5];return _0xa91e18;}function readPackageScripts(_0x2fd26d){const _0x5559cc=a234_0xe707ed,_0x2c1abf=resolve(_0x2fd26d,_0x5559cc(0x1d1));if(!existsSync(_0x2c1abf))return null;try{const _0x18efed=JSON[_0x5559cc(0x1e4)](readFileSync(_0x2c1abf,_0x5559cc(0x1dc)));return _0x18efed[_0x5559cc(0x1f4)]??{};}catch{return null;}}function detectPackageManager(_0x4b01a5){const _0x2426d1=a234_0xe707ed;if(existsSync(resolve(_0x4b01a5,_0x2426d1(0x1cb)))||existsSync(resolve(_0x4b01a5,_0x2426d1(0x1e7))))return'bun';if(existsSync(resolve(_0x4b01a5,'pnpm-lock.yaml')))return _0x2426d1(0x1c1);if(existsSync(resolve(_0x4b01a5,_0x2426d1(0x1c2))))return _0x2426d1(0x1c6);return _0x2426d1(0x1f2);}async function versionCheck(_0x3f56d0){const _0x587991=a234_0xe707ed,_0x4f18a9=await checkCliVersion();(_0x4f18a9[_0x587991(0x1f3)]||_0x4f18a9[_0x587991(0x1ec)])&&(printCliUpgradeWarning(_0x4f18a9),assertCliVersionSupported(_0x4f18a9));const _0x355a97=await checkSdkVersion(_0x3f56d0);if(_0x355a97['needsUpgrade'])printSdkUpgradeWarning(_0x355a97);}function spawnScript(_0x5e6007,_0x52a794,_0x1a161f,_0x33b945){return new Promise((_0x5df588,_0x4a4b29)=>{const _0x446c0e=a234_0xa91e,_0x2ff5d5=['run',_0x52a794,..._0x1a161f],_0x4b8977=spawn(_0x5e6007,_0x2ff5d5,{'cwd':_0x33b945,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x33b945,'node_modules',_0x446c0e(0x1d2))+delimiter+process.env.PATH}});_0x4b8977['on'](_0x446c0e(0x1be),_0x5426f9=>{const _0x4bbbc4=_0x446c0e;if(_0x5426f9===0x0||_0x5426f9===null)_0x5df588();else _0x4a4b29(new Error(_0x5e6007+_0x4bbbc4(0x1e1)+_0x52a794+_0x4bbbc4(0x1e8)+_0x5426f9));}),_0x4b8977['on'](_0x446c0e(0x1e2),_0x4a4b29);});}function spawnViteBuildWatch(_0x319a99){return new Promise((_0x43a3f5,_0x21d441)=>{const _0x320a95=a234_0xa91e,_0xe0a189=spawn(_0x320a95(0x1bd),[_0x320a95(0x1ed),'--watch'],{'cwd':_0x319a99,'stdio':_0x320a95(0x1ce),'shell':!![],'env':{...process.env,'PATH':''+join(_0x319a99,_0x320a95(0x1eb),'.bin')+delimiter+process.env.PATH}});_0xe0a189['on'](_0x320a95(0x1be),_0x464800=>{const _0x5f5bb6=_0x320a95;if(_0x464800===0x0||_0x464800===null)_0x43a3f5();else _0x21d441(new Error(_0x5f5bb6(0x1ea)+_0x464800));}),_0xe0a189['on'](_0x320a95(0x1e2),_0x21d441);});}function spawnVitePreview(_0x5d0090){return new Promise((_0x181bc0,_0x4978e6)=>{const _0x4a6a00=a234_0xa91e,_0x33bc49=spawn(_0x4a6a00(0x1bd),[_0x4a6a00(0x1dd)],{'cwd':_0x5d0090,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x5d0090,'node_modules',_0x4a6a00(0x1d2))+delimiter+process.env.PATH}});_0x33bc49['on'](_0x4a6a00(0x1be),_0x46340c=>{if(_0x46340c===0x0||_0x46340c===null)_0x181bc0();else _0x4978e6(new Error('vite\x20preview\x20exited\x20with\x20code\x20'+_0x46340c));}),_0x33bc49['on'](_0x4a6a00(0x1e2),_0x4978e6);});}const runFlags=[{'name':'watch','type':a234_0xe707ed(0x1d5),'description':a234_0xe707ed(0x1c3),'default':![]}];export const runDefinition={'service':'run','command':a234_0xe707ed(0x1d0),'description':a234_0xe707ed(0x1ca),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'script','description':'Script\x20name\x20defined\x20in\x20package.json','required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x4d1204=a234_0xe707ed,_0x5ac213=[];return _0x5ac213['push'](_0x4d1204(0x1bb)),_0x5ac213['push'](_0x4d1204(0x1d9)+CLI_BIN_NAME+_0x4d1204(0x1c8)),_0x5ac213[_0x4d1204(0x1c0)]('\x20\x20\x20\x20'+CLI_BIN_NAME+'\x20run\x20build'),_0x5ac213[_0x4d1204(0x1c0)]('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x4d1204(0x1e6)),_0x5ac213[_0x4d1204(0x1c0)]('\x20\x20\x20\x20'+CLI_BIN_NAME+'\x20run\x20preview\x20--watch'),_0x5ac213[_0x4d1204(0x1db)]('\x0a');},async 'execute'(_0x3f5330){const _0x338e33=a234_0xe707ed,_0x1e8132=process[_0x338e33(0x1d8)](),_0x530d4e=_0x3f5330['args'][0x0],_0x149433=_0x3f5330[_0x338e33(0x1bc)]['slice'](0x1),_0x13811c=readPackageScripts(_0x1e8132);if(!_0x13811c)throw CliErrors[_0x338e33(0x1e3)]('No\x20package.json\x20found\x20in\x20current\x20directory.');if(!_0x530d4e){const _0x3f0d8a=Object[_0x338e33(0x1d7)](_0x13811c);if(_0x3f0d8a[_0x338e33(0x1cd)]===0x0)console[_0x338e33(0x1d6)](_0x338e33(0x1e9));else{console[_0x338e33(0x1d6)]('\x0a\x20\x20Available\x20scripts:\x0a');for(const _0x2d58c6 of _0x3f0d8a){console[_0x338e33(0x1d6)](_0x338e33(0x1d9)+_0x2d58c6);}console[_0x338e33(0x1d6)](_0x338e33(0x1f1)+CLI_BIN_NAME+_0x338e33(0x1e5));}return{'ok':!![]};}if(!_0x13811c[_0x530d4e])throw CliErrors['validation'](_0x338e33(0x1bf)+_0x530d4e+'\x22\x20not\x20found\x20in\x20package.json.',_0x338e33(0x1f0)+(Object[_0x338e33(0x1d7)](_0x13811c)['join'](',\x20')||_0x338e33(0x1ee)));const _0x86ab5a=detectPackageManager(_0x1e8132),_0x3d9761=syncProjectDomainRoutingBeforeScript(_0x1e8132,_0x530d4e);_0x3d9761?.[_0x338e33(0x1e0)]&&console[_0x338e33(0x1e2)](_0x338e33(0x1da)+_0x3d9761[_0x338e33(0x1df)]);VERSION_CHECK_SCRIPTS[_0x338e33(0x1cc)](_0x530d4e)&&await versionCheck(_0x1e8132);if(_0x530d4e===_0x338e33(0x1dd)&&_0x3f5330[_0x338e33(0x1c7)](_0x338e33(0x1c9)))return await Promise['all']([spawnViteBuildWatch(_0x1e8132),spawnVitePreview(_0x1e8132)]),{'ok':!![]};return await spawnScript(_0x86ab5a,_0x530d4e,_0x149433,_0x1e8132),{'ok':!![]};}};
@@ -1 +1 @@
1
- const a235_0x4dcecc=a235_0x12c9;(function(_0x8cf7e4,_0x99822e){const _0x89c125=a235_0x12c9,_0x222da1=_0x8cf7e4();while(!![]){try{const _0x35e81e=parseInt(_0x89c125(0x138))/0x1*(parseInt(_0x89c125(0x134))/0x2)+parseInt(_0x89c125(0x139))/0x3+-parseInt(_0x89c125(0x12e))/0x4*(parseInt(_0x89c125(0x130))/0x5)+parseInt(_0x89c125(0x136))/0x6*(parseInt(_0x89c125(0x132))/0x7)+parseInt(_0x89c125(0x133))/0x8+-parseInt(_0x89c125(0x13a))/0x9+parseInt(_0x89c125(0x135))/0xa*(parseInt(_0x89c125(0x137))/0xb);if(_0x35e81e===_0x99822e)break;else _0x222da1['push'](_0x222da1['shift']());}catch(_0x3db4e3){_0x222da1['push'](_0x222da1['shift']());}}}(a235_0x141f,0xd716f));function a235_0x141f(){const _0xfaf159=['schema','5AAXezW','Export\x20machine-readable\x20command\x20schema\x20(JSON)','20020XoCHwP','7370240iNamzc','4OczjoA','44300shvVZe','1494GCaVmR','352XDLtrv','74552QcmzHb','986217UUBhPM','5867001uyBGMO','read','json','2880508ZtdPXu'];a235_0x141f=function(){return _0xfaf159;};return a235_0x141f();}import{buildSchemaPayload}from'../framework/schema-export.js';function a235_0x12c9(_0x5f03c9,_0x540bef){_0x5f03c9=_0x5f03c9-0x12c;const _0x141fbb=a235_0x141f();let _0x12c942=_0x141fbb[_0x5f03c9];return _0x12c942;}async function execute(_0x50743e){const _0x4ff271=await buildSchemaPayload();return{'ok':!![],'data':_0x4ff271};}export const schemaDefinition={'service':a235_0x4dcecc(0x12f),'command':'export','description':a235_0x4dcecc(0x131),'risk':a235_0x4dcecc(0x12c),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a235_0x4dcecc(0x12d),'flags':[],'execute':execute};
1
+ function a235_0x1378(_0x78e9d5,_0x2faaaa){_0x78e9d5=_0x78e9d5-0x93;const _0x455f9e=a235_0x455f();let _0x13787c=_0x455f9e[_0x78e9d5];return _0x13787c;}const a235_0x30f963=a235_0x1378;(function(_0x1da63c,_0xd2c8f2){const _0x1e2194=a235_0x1378,_0x3435fe=_0x1da63c();while(!![]){try{const _0x672e58=parseInt(_0x1e2194(0x97))/0x1+parseInt(_0x1e2194(0x9b))/0x2*(-parseInt(_0x1e2194(0x9e))/0x3)+-parseInt(_0x1e2194(0x99))/0x4+-parseInt(_0x1e2194(0x9f))/0x5+-parseInt(_0x1e2194(0x9c))/0x6*(-parseInt(_0x1e2194(0x98))/0x7)+parseInt(_0x1e2194(0x9d))/0x8*(-parseInt(_0x1e2194(0x95))/0x9)+parseInt(_0x1e2194(0x94))/0xa*(parseInt(_0x1e2194(0xa0))/0xb);if(_0x672e58===_0xd2c8f2)break;else _0x3435fe['push'](_0x3435fe['shift']());}catch(_0x5ae38c){_0x3435fe['push'](_0x3435fe['shift']());}}}(a235_0x455f,0x7b7f3));function a235_0x455f(){const _0x384dac=['read','546711zysaaR','1894655rzKJCD','946388CuFtrR','json','6DczjWN','6DQxtwm','417400ddYOHF','967728YDhVdK','1340580UzxLKk','49027YorWWD','schema','3190kICXXo','45ZnPAfM'];a235_0x455f=function(){return _0x384dac;};return a235_0x455f();}import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x22df2e){const _0x2597f6=await buildSchemaPayload();return{'ok':!![],'data':_0x2597f6};}export const schemaDefinition={'service':a235_0x30f963(0x93),'command':'export','description':'Export\x20machine-readable\x20command\x20schema\x20(JSON)','risk':a235_0x30f963(0x96),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a235_0x30f963(0x9a),'flags':[],'execute':execute};
@@ -1 +1 @@
1
- const a236_0x56c34f=a236_0x4b53;(function(_0xf85d38,_0x523f7f){const _0x3a56b0=a236_0x4b53,_0x4a1d70=_0xf85d38();while(!![]){try{const _0xa91b85=-parseInt(_0x3a56b0(0x145))/0x1*(-parseInt(_0x3a56b0(0x16d))/0x2)+parseInt(_0x3a56b0(0x12d))/0x3*(-parseInt(_0x3a56b0(0x15b))/0x4)+-parseInt(_0x3a56b0(0x16e))/0x5*(-parseInt(_0x3a56b0(0x15c))/0x6)+parseInt(_0x3a56b0(0x157))/0x7+parseInt(_0x3a56b0(0x151))/0x8*(parseInt(_0x3a56b0(0x168))/0x9)+-parseInt(_0x3a56b0(0x130))/0xa*(parseInt(_0x3a56b0(0x15a))/0xb)+parseInt(_0x3a56b0(0x139))/0xc*(-parseInt(_0x3a56b0(0x138))/0xd);if(_0xa91b85===_0x523f7f)break;else _0x4a1d70['push'](_0x4a1d70['shift']());}catch(_0x14b55a){_0x4a1d70['push'](_0x4a1d70['shift']());}}}(a236_0x33ae,0x71127));import{writeFile}from'node:fs/promises';function a236_0x33ae(){const _0xf659e3=['dbId\x20must\x20be\x20a\x20positive\x20integer','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','SQL\x20name:','Invalid\x20database\x20selection\x20payload:\x20','flagMissing','description','Select\x20the\x20local\x20SQL\x20mode:','</select>','isFinite','2AJowOu','sqlCode','number','str','lockFilePath','SQL\x20name\x20cannot\x20be\x20empty','Target\x20database\x20dbId:','length','✎\x20Enter\x20dbId\x20manually','join','toISOString','mode','5961688xnUwKs','\x20\x20SELECT\x201\x20AS\x20id','For\x20MyBatis\x20XML\x20SQL\x20with\x20dynamic\x20tags','sqlRootDir','mybatisXml','appCode','1652889NQqNnk','sqlName','dbId\x20cannot\x20be\x20empty','1639957VnJkdm','156KyESce','102eBriRr','dbName','utf8','isInteger','Target\x20database\x20ID','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','sqls','trim','dbId','validation','POST','File\x20already\x20exists:\x20','9WxHAkL','string','new','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','MyBatis\x20XML\x20(mybatisXml)','529798diTJcF','157615GIAzoR','db-id','name','catch','Select\x20the\x20target\x20database:','nonInteractive','46356LVYxSZ','<server-generated-sqlCode>','parse','60LSeTJI','Created\x20SQL\x20query\x20','Local\x20SQL\x20file\x20mode','lastSync','__manual__','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','sqlRoot','sql','1127542GIBArK','12rBWqTe','/smartapi/custom/saveUserCustomSql','create'];a236_0x33ae=function(){return _0xf659e3;};return a236_0x33ae();}import{input,select}from'@inquirer/prompts';import{createSqlQuery}from'../../core/api-client.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{buildSqlRelativePath}from'../../core/sql-sync/utils.js';import{CliErrors}from'../../errors.js';import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function generateSqlTemplate(_0x5386f9){const _0x22d0c6=a236_0x4b53;if(_0x5386f9===_0x22d0c6(0x155))return['<select\x20id=\x22query\x22\x20resultType=\x22map\x22>',_0x22d0c6(0x152),_0x22d0c6(0x143),'']['join']('\x0a');return['SELECT\x201\x20AS\x20id;',''][_0x22d0c6(0x14e)]('\x0a');}export const sqlCreate={'service':'sql','command':a236_0x56c34f(0x13b),'description':a236_0x56c34f(0x135),'risk':'write','flags':[{'name':a236_0x56c34f(0x170),'type':'string','description':'SQL\x20query\x20display\x20name'},{'name':a236_0x56c34f(0x16f),'type':a236_0x56c34f(0x147),'description':a236_0x56c34f(0x160)},{'name':a236_0x56c34f(0x150),'type':a236_0x56c34f(0x169),'enum':[a236_0x56c34f(0x137),a236_0x56c34f(0x155)],'description':a236_0x56c34f(0x132)}],async 'validate'(_0x38e9de){const _0x2baa77=a236_0x56c34f;if(!_0x38e9de[_0x2baa77(0x12c)])return;if(!_0x38e9de[_0x2baa77(0x148)](_0x2baa77(0x170))[_0x2baa77(0x163)]())throw CliErrors['flagMissing'](_0x2baa77(0x170),_0x2baa77(0x161));const _0x1e18cf=resolveProvidedDbId(_0x38e9de);if(typeof _0x1e18cf!==_0x2baa77(0x147)||!Number['isFinite'](_0x1e18cf)||_0x1e18cf<=0x0)throw CliErrors['flagMissing'](_0x2baa77(0x16f),_0x2baa77(0x16b));if(!_0x38e9de[_0x2baa77(0x148)](_0x2baa77(0x150))[_0x2baa77(0x163)]())throw CliErrors[_0x2baa77(0x140)](_0x2baa77(0x150),'--mode\x20is\x20required\x20in\x20non-interactive\x20mode.');},async 'dryRun'(_0x517ee4){const _0x5ae061=a236_0x56c34f,_0x2af7da=loadSqlProjectConfig(_0x517ee4[_0x5ae061(0x156)]),{sqlName:_0xfe88e5,dbId:_0x40d473,dbName:_0x165cdd,mode:_0x14cb41}=await resolveSqlNewInputs(_0x517ee4),_0x455d0d=buildSqlRelativePath(_0x5ae061(0x12e),_0xfe88e5,_0x165cdd,_0x14cb41,_0x40d473),_0x2b7f40=_0x2af7da[_0x5ae061(0x154)]+'/'+_0x455d0d;return{'method':_0x5ae061(0x166),'url':_0x5ae061(0x13a),'body':{'appCode':_0x517ee4[_0x5ae061(0x156)],'sqlName':_0xfe88e5,'dbId':_0x40d473,'mode':_0x14cb41,'localPath':_0x2b7f40},'description':'Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20'+_0x2af7da[_0x5ae061(0x154)]};},async 'execute'(_0xd33b3b){const _0x235f5a=a236_0x56c34f,_0x5c7687=loadSqlProjectConfig(_0xd33b3b[_0x235f5a(0x156)]),{sqlName:_0x1deb48,dbId:_0x3f3e9e,dbName:_0x249b92,mode:_0x57269f}=await resolveSqlNewInputs(_0xd33b3b),_0xc9c76=generateSqlTemplate(_0x57269f),_0x1485ce=await createSqlQuery({'appCode':_0xd33b3b[_0x235f5a(0x156)],'sqlName':_0x1deb48,'dbId':_0x3f3e9e,'sqlContent':_0xc9c76}),_0x577225=ensureRemoteSqlContent(_0x1485ce),_0x2c14de=_0x249b92||await getDbName(_0xd33b3b['appCode'],_0x3f3e9e)[_0x235f5a(0x171)](()=>undefined),_0x15a23c=buildSqlRelativePath(_0x1485ce[_0x235f5a(0x146)],_0x1485ce[_0x235f5a(0x158)],_0x2c14de,_0x57269f,_0x3f3e9e),_0x4a03b7=_0x5c7687[_0x235f5a(0x154)]+'/'+_0x15a23c,_0x25df59=buildLocalSqlFileContent({'sqlCode':_0x1485ce['sqlCode'],'sqlName':_0x1485ce['sqlName'],'dbId':_0x1485ce['dbId']},_0x577225,{'dbName':_0x2c14de,'mode':_0x57269f,'syncedAt':new Date()[_0x235f5a(0x14f)](),'description':_0x1485ce[_0x235f5a(0x141)]});if(await fileExists(_0x4a03b7))throw CliErrors[_0x235f5a(0x165)](_0x235f5a(0x167)+_0x4a03b7);await ensureParentDirectory(_0x4a03b7),await writeFile(_0x4a03b7,_0x25df59,_0x235f5a(0x15e));const _0x14c0af=await readSqlLockFile(_0x5c7687[_0x235f5a(0x149)]),{lockData:_0x20b8d3,appLock:_0x42c8af}=ensureSqlLockScope(_0x14c0af??createEmptySqlLock(),_0x5c7687[_0x235f5a(0x156)],_0x5c7687[_0x235f5a(0x136)],_0x235f5a(0x16a));return _0x42c8af[_0x235f5a(0x162)][_0x1485ce[_0x235f5a(0x146)]]={...buildSqlLockEntry(_0x1485ce,_0x577225,computeSqlContentHash(_0x25df59),{'dbName':_0x2c14de}),'path':_0x15a23c,'mode':_0x57269f},_0x42c8af[_0x235f5a(0x133)]=new Date()[_0x235f5a(0x14f)](),await writeSqlLockFile(_0x5c7687[_0x235f5a(0x149)],_0x20b8d3),{'ok':!![],'data':{'id':_0x1485ce['id'],'sqlCode':_0x1485ce[_0x235f5a(0x146)],'sqlName':_0x1485ce[_0x235f5a(0x158)],'dbId':_0x1485ce[_0x235f5a(0x164)],'path':_0x4a03b7,'mode':_0x57269f},'message':_0x235f5a(0x131)+_0x1485ce[_0x235f5a(0x146)]};}};function a236_0x4b53(_0x28f032,_0x47125d){_0x28f032=_0x28f032-0x12c;const _0x33ae65=a236_0x33ae();let _0x4b5386=_0x33ae65[_0x28f032];return _0x4b5386;}async function resolveSqlNewInputs(_0x5324b4){const _0x227703=await resolveSqlNameInput(_0x5324b4),{dbId:_0x4f7e85,dbName:_0x576658}=await resolveDbSelection(_0x5324b4),_0xb2c645=await resolveSqlModeInput(_0x5324b4);return{'sqlName':_0x227703,'dbId':_0x4f7e85,'dbName':_0x576658,'mode':_0xb2c645};}async function resolveSqlNameInput(_0x350dc7){const _0x586407=a236_0x56c34f,_0x20f9f5=_0x350dc7[_0x586407(0x148)](_0x586407(0x170))[_0x586407(0x163)]();if(_0x20f9f5)return _0x20f9f5;if(_0x350dc7[_0x586407(0x12c)])throw CliErrors['flagMissing'](_0x586407(0x170),'--name\x20is\x20required\x20in\x20non-interactive\x20mode.');return(await input({'message':_0x586407(0x13e),'validate':_0x1f20f9=>_0x1f20f9['trim']()?!![]:_0x586407(0x14a)}))[_0x586407(0x163)]();}async function resolveDbSelection(_0x1e5dd1){const _0x54191d=a236_0x56c34f,_0x3124f7=resolveProvidedDbId(_0x1e5dd1);if(typeof _0x3124f7===_0x54191d(0x147)&&Number[_0x54191d(0x144)](_0x3124f7)&&_0x3124f7>0x0)return{'dbId':_0x3124f7,'dbName':await getDbName(_0x1e5dd1['appCode'],_0x3124f7)[_0x54191d(0x171)](()=>undefined)};if(_0x1e5dd1[_0x54191d(0x12c)])throw CliErrors[_0x54191d(0x140)](_0x54191d(0x16f),_0x54191d(0x16b));const _0x186d01=await listDatabases(_0x1e5dd1[_0x54191d(0x156)])[_0x54191d(0x171)](()=>[]);if(_0x186d01[_0x54191d(0x14c)]===0x1)return{'dbId':_0x186d01[0x0]['dbId'],'dbName':_0x186d01[0x0][_0x54191d(0x15d)]};if(_0x186d01[_0x54191d(0x14c)]>0x1){const _0x4167d0=await select({'message':_0x54191d(0x172),'choices':[..._0x186d01['map'](_0x4dc9f1=>({'name':_0x4dc9f1[_0x54191d(0x15d)]+'\x20('+_0x4dc9f1['dbId']+')','value':serializeDbSelection(_0x4dc9f1)})),{'name':_0x54191d(0x14d),'value':_0x54191d(0x134)}]});if(_0x4167d0!==_0x54191d(0x134))return deserializeDbSelection(_0x4167d0);}const _0x3a3bc5=await input({'message':_0x54191d(0x14b),'validate':_0x46028c=>{const _0x671f5e=_0x54191d,_0x3cf2e2=_0x46028c[_0x671f5e(0x163)]();if(!_0x3cf2e2)return _0x671f5e(0x159);const _0x59bf67=Number(_0x3cf2e2);if(!Number[_0x671f5e(0x15f)](_0x59bf67)||_0x59bf67<=0x0)return _0x671f5e(0x13c);return!![];}});return{'dbId':Number(_0x3a3bc5['trim']())};}async function resolveSqlModeInput(_0xe9a7fd){const _0x223ea1=a236_0x56c34f,_0x7e14a5=_0xe9a7fd[_0x223ea1(0x148)](_0x223ea1(0x150))[_0x223ea1(0x163)]();if(_0x7e14a5==='sql'||_0x7e14a5===_0x223ea1(0x155))return _0x7e14a5;if(_0xe9a7fd['nonInteractive'])throw CliErrors['flagMissing'](_0x223ea1(0x150),_0x223ea1(0x13d));return await select({'message':_0x223ea1(0x142),'choices':[{'name':'Plain\x20SQL\x20(sql)','value':'sql','description':'For\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20statements\x20that\x20run\x20directly'},{'name':_0x223ea1(0x16c),'value':_0x223ea1(0x155),'description':_0x223ea1(0x153)}]});}function serializeDbSelection(_0x195fd0){const _0x18d6c3=a236_0x56c34f;return JSON['stringify']({'dbId':_0x195fd0[_0x18d6c3(0x164)],'dbName':_0x195fd0[_0x18d6c3(0x15d)]});}function deserializeDbSelection(_0x29a9df){const _0x22f87b=a236_0x56c34f;try{const _0x3e4cc8=JSON[_0x22f87b(0x12f)](_0x29a9df);if(typeof _0x3e4cc8[_0x22f87b(0x164)]===_0x22f87b(0x147)&&Number['isFinite'](_0x3e4cc8['dbId']))return{'dbId':_0x3e4cc8[_0x22f87b(0x164)],'dbName':_0x3e4cc8[_0x22f87b(0x15d)]};}catch{}throw CliErrors[_0x22f87b(0x165)](_0x22f87b(0x13f)+_0x29a9df);}function resolveProvidedDbId(_0x4de77c){const _0x1b5308=a236_0x56c34f,_0x53439d=_0x4de77c['flag'](_0x1b5308(0x16f));if(typeof _0x53439d===_0x1b5308(0x147)&&Number[_0x1b5308(0x144)](_0x53439d))return _0x53439d;return undefined;}
1
+ const a236_0x1c20ff=a236_0x5cfa;function a236_0x5cfa(_0x2e12a8,_0x45522b){_0x2e12a8=_0x2e12a8-0x11b;const _0xb2aae2=a236_0xb2aa();let _0x5cfab2=_0xb2aae2[_0x2e12a8];return _0x5cfab2;}(function(_0x2ae1af,_0x121762){const _0x39175a=a236_0x5cfa,_0x36a738=_0x2ae1af();while(!![]){try{const _0x54ed99=-parseInt(_0x39175a(0x134))/0x1*(-parseInt(_0x39175a(0x11d))/0x2)+parseInt(_0x39175a(0x129))/0x3+parseInt(_0x39175a(0x140))/0x4+-parseInt(_0x39175a(0x15a))/0x5+-parseInt(_0x39175a(0x125))/0x6*(-parseInt(_0x39175a(0x12c))/0x7)+parseInt(_0x39175a(0x13f))/0x8*(-parseInt(_0x39175a(0x124))/0x9)+-parseInt(_0x39175a(0x157))/0xa*(-parseInt(_0x39175a(0x15d))/0xb);if(_0x54ed99===_0x121762)break;else _0x36a738['push'](_0x36a738['shift']());}catch(_0x3ffea3){_0x36a738['push'](_0x36a738['shift']());}}}(a236_0xb2aa,0x83537));import{writeFile}from'node:fs/promises';import{input,select}from'@inquirer/prompts';function a236_0xb2aa(){const _0x4cf32d=['dbId\x20must\x20be\x20a\x20positive\x20integer','str','sqlCode','join','MyBatis\x20XML\x20(mybatisXml)','lastSync','number','flag','Plain\x20SQL\x20(sql)','Target\x20database\x20dbId:','name','✎\x20Enter\x20dbId\x20manually','flagMissing','trim','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','db-id','3340tlNKyZ','nonInteractive','File\x20already\x20exists:\x20','1413095Azhtbb','description','sql','1254IJkKlp','length','isFinite','SELECT\x201\x20AS\x20id;','For\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20statements\x20that\x20run\x20directly','mybatisXml','stringify','9248ZWqUWf','toISOString','</select>','lockFilePath','dbName','Invalid\x20database\x20selection\x20payload:\x20','Select\x20the\x20target\x20database:','414eTerbV','18CdqtaX','dbId\x20cannot\x20be\x20empty','validation','Local\x20SQL\x20file\x20mode','1741254SwBpDT','__manual__','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','108143qdoTME','Created\x20SQL\x20query\x20','parse','sqlName','For\x20MyBatis\x20XML\x20SQL\x20with\x20dynamic\x20tags','<server-generated-sqlCode>','new','SQL\x20name\x20cannot\x20be\x20empty','63leUehy','POST','\x20\x20SELECT\x201\x20AS\x20id','catch','/smartapi/custom/saveUserCustomSql','Select\x20the\x20local\x20SQL\x20mode:','string','sqls','mode','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','dbId','134200HBrrBT','2544108aBKPyy','sqlRootDir','map','appCode','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','isInteger'];a236_0xb2aa=function(){return _0x4cf32d;};return a236_0xb2aa();}import{createSqlQuery}from'../../core/api-client.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{buildSqlRelativePath}from'../../core/sql-sync/utils.js';import{CliErrors}from'../../errors.js';import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function generateSqlTemplate(_0x400352){const _0x1b3a4b=a236_0x5cfa;if(_0x400352===_0x1b3a4b(0x11b))return[_0x1b3a4b(0x145),_0x1b3a4b(0x136),_0x1b3a4b(0x11f),'']['join']('\x0a');return[_0x1b3a4b(0x160),''][_0x1b3a4b(0x14a)]('\x0a');}export const sqlCreate={'service':'sql','command':'create','description':a236_0x1c20ff(0x12b),'risk':'write','flags':[{'name':a236_0x1c20ff(0x151),'type':a236_0x1c20ff(0x13a),'description':'SQL\x20query\x20display\x20name'},{'name':a236_0x1c20ff(0x156),'type':a236_0x1c20ff(0x14d),'description':'Target\x20database\x20ID'},{'name':a236_0x1c20ff(0x13c),'type':'string','enum':[a236_0x1c20ff(0x15c),a236_0x1c20ff(0x11b)],'description':a236_0x1c20ff(0x128)}],async 'validate'(_0x1c9420){const _0x623109=a236_0x1c20ff;if(!_0x1c9420[_0x623109(0x158)])return;if(!_0x1c9420[_0x623109(0x148)]('name')['trim']())throw CliErrors[_0x623109(0x153)](_0x623109(0x151),_0x623109(0x13d));const _0x3ce426=resolveProvidedDbId(_0x1c9420);if(typeof _0x3ce426!=='number'||!Number[_0x623109(0x15f)](_0x3ce426)||_0x3ce426<=0x0)throw CliErrors['flagMissing'](_0x623109(0x156),_0x623109(0x144));if(!_0x1c9420[_0x623109(0x148)](_0x623109(0x13c))[_0x623109(0x154)]())throw CliErrors[_0x623109(0x153)](_0x623109(0x13c),'--mode\x20is\x20required\x20in\x20non-interactive\x20mode.');},async 'dryRun'(_0x2238fa){const _0x37eaf3=a236_0x1c20ff,_0x5aac33=loadSqlProjectConfig(_0x2238fa[_0x37eaf3(0x143)]),{sqlName:_0xa19b18,dbId:_0x4da386,dbName:_0x273cbd,mode:_0x1d7689}=await resolveSqlNewInputs(_0x2238fa),_0x3d2046=buildSqlRelativePath(_0x37eaf3(0x131),_0xa19b18,_0x273cbd,_0x1d7689,_0x4da386),_0x17f7a2=_0x5aac33[_0x37eaf3(0x141)]+'/'+_0x3d2046;return{'method':_0x37eaf3(0x135),'url':_0x37eaf3(0x138),'body':{'appCode':_0x2238fa['appCode'],'sqlName':_0xa19b18,'dbId':_0x4da386,'mode':_0x1d7689,'localPath':_0x17f7a2},'description':_0x37eaf3(0x155)+_0x5aac33['sqlRootDir']};},async 'execute'(_0x3a0a4b){const _0x2a882a=a236_0x1c20ff,_0x3501da=loadSqlProjectConfig(_0x3a0a4b['appCode']),{sqlName:_0x33c481,dbId:_0x1bb2e8,dbName:_0x5f2b25,mode:_0x5bb08c}=await resolveSqlNewInputs(_0x3a0a4b),_0x5b064d=generateSqlTemplate(_0x5bb08c),_0xbd04dd=await createSqlQuery({'appCode':_0x3a0a4b['appCode'],'sqlName':_0x33c481,'dbId':_0x1bb2e8,'sqlContent':_0x5b064d}),_0x18b9f4=ensureRemoteSqlContent(_0xbd04dd),_0x2a6551=_0x5f2b25||await getDbName(_0x3a0a4b['appCode'],_0x1bb2e8)[_0x2a882a(0x137)](()=>undefined),_0x2a00f9=buildSqlRelativePath(_0xbd04dd['sqlCode'],_0xbd04dd[_0x2a882a(0x12f)],_0x2a6551,_0x5bb08c,_0x1bb2e8),_0x93daf9=_0x3501da[_0x2a882a(0x141)]+'/'+_0x2a00f9,_0x146866=buildLocalSqlFileContent({'sqlCode':_0xbd04dd[_0x2a882a(0x149)],'sqlName':_0xbd04dd[_0x2a882a(0x12f)],'dbId':_0xbd04dd['dbId']},_0x18b9f4,{'dbName':_0x2a6551,'mode':_0x5bb08c,'syncedAt':new Date()['toISOString'](),'description':_0xbd04dd[_0x2a882a(0x15b)]});if(await fileExists(_0x93daf9))throw CliErrors[_0x2a882a(0x127)](_0x2a882a(0x159)+_0x93daf9);await ensureParentDirectory(_0x93daf9),await writeFile(_0x93daf9,_0x146866,'utf8');const _0x520f22=await readSqlLockFile(_0x3501da[_0x2a882a(0x120)]),{lockData:_0x1297e2,appLock:_0x47a3a0}=ensureSqlLockScope(_0x520f22??createEmptySqlLock(),_0x3501da[_0x2a882a(0x143)],_0x3501da['sqlRoot'],_0x2a882a(0x132));return _0x47a3a0[_0x2a882a(0x13b)][_0xbd04dd[_0x2a882a(0x149)]]={...buildSqlLockEntry(_0xbd04dd,_0x18b9f4,computeSqlContentHash(_0x146866),{'dbName':_0x2a6551}),'path':_0x2a00f9,'mode':_0x5bb08c},_0x47a3a0[_0x2a882a(0x14c)]=new Date()[_0x2a882a(0x11e)](),await writeSqlLockFile(_0x3501da[_0x2a882a(0x120)],_0x1297e2),{'ok':!![],'data':{'id':_0xbd04dd['id'],'sqlCode':_0xbd04dd['sqlCode'],'sqlName':_0xbd04dd['sqlName'],'dbId':_0xbd04dd['dbId'],'path':_0x93daf9,'mode':_0x5bb08c},'message':_0x2a882a(0x12d)+_0xbd04dd['sqlCode']};}};async function resolveSqlNewInputs(_0x2c6616){const _0x2d1de0=await resolveSqlNameInput(_0x2c6616),{dbId:_0x9829be,dbName:_0x43941a}=await resolveDbSelection(_0x2c6616),_0x23939a=await resolveSqlModeInput(_0x2c6616);return{'sqlName':_0x2d1de0,'dbId':_0x9829be,'dbName':_0x43941a,'mode':_0x23939a};}async function resolveSqlNameInput(_0x4366fd){const _0x3a0e76=a236_0x1c20ff,_0x3a8ee3=_0x4366fd[_0x3a0e76(0x148)](_0x3a0e76(0x151))[_0x3a0e76(0x154)]();if(_0x3a8ee3)return _0x3a8ee3;if(_0x4366fd[_0x3a0e76(0x158)])throw CliErrors['flagMissing'](_0x3a0e76(0x151),_0x3a0e76(0x13d));return(await input({'message':'SQL\x20name:','validate':_0x5c9510=>_0x5c9510[_0x3a0e76(0x154)]()?!![]:_0x3a0e76(0x133)}))[_0x3a0e76(0x154)]();}async function resolveDbSelection(_0x312a16){const _0x4811b5=a236_0x1c20ff,_0x24ec91=resolveProvidedDbId(_0x312a16);if(typeof _0x24ec91===_0x4811b5(0x14d)&&Number[_0x4811b5(0x15f)](_0x24ec91)&&_0x24ec91>0x0)return{'dbId':_0x24ec91,'dbName':await getDbName(_0x312a16[_0x4811b5(0x143)],_0x24ec91)[_0x4811b5(0x137)](()=>undefined)};if(_0x312a16[_0x4811b5(0x158)])throw CliErrors['flagMissing']('db-id','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.');const _0x1213e1=await listDatabases(_0x312a16[_0x4811b5(0x143)])['catch'](()=>[]);if(_0x1213e1[_0x4811b5(0x15e)]===0x1)return{'dbId':_0x1213e1[0x0][_0x4811b5(0x13e)],'dbName':_0x1213e1[0x0]['dbName']};if(_0x1213e1[_0x4811b5(0x15e)]>0x1){const _0x452db4=await select({'message':_0x4811b5(0x123),'choices':[..._0x1213e1[_0x4811b5(0x142)](_0x2db259=>({'name':_0x2db259[_0x4811b5(0x121)]+'\x20('+_0x2db259[_0x4811b5(0x13e)]+')','value':serializeDbSelection(_0x2db259)})),{'name':_0x4811b5(0x152),'value':_0x4811b5(0x12a)}]});if(_0x452db4!==_0x4811b5(0x12a))return deserializeDbSelection(_0x452db4);}const _0x290741=await input({'message':_0x4811b5(0x150),'validate':_0x6ead5f=>{const _0x507d1f=_0x4811b5,_0x3e51a8=_0x6ead5f[_0x507d1f(0x154)]();if(!_0x3e51a8)return _0x507d1f(0x126);const _0x39be29=Number(_0x3e51a8);if(!Number[_0x507d1f(0x146)](_0x39be29)||_0x39be29<=0x0)return _0x507d1f(0x147);return!![];}});return{'dbId':Number(_0x290741[_0x4811b5(0x154)]())};}async function resolveSqlModeInput(_0xaaedb3){const _0x4950ce=a236_0x1c20ff,_0x4147b4=_0xaaedb3[_0x4950ce(0x148)](_0x4950ce(0x13c))[_0x4950ce(0x154)]();if(_0x4147b4===_0x4950ce(0x15c)||_0x4147b4===_0x4950ce(0x11b))return _0x4147b4;if(_0xaaedb3[_0x4950ce(0x158)])throw CliErrors[_0x4950ce(0x153)](_0x4950ce(0x13c),'--mode\x20is\x20required\x20in\x20non-interactive\x20mode.');return await select({'message':_0x4950ce(0x139),'choices':[{'name':_0x4950ce(0x14f),'value':_0x4950ce(0x15c),'description':_0x4950ce(0x161)},{'name':_0x4950ce(0x14b),'value':'mybatisXml','description':_0x4950ce(0x130)}]});}function serializeDbSelection(_0x4e3b62){const _0x19a9b7=a236_0x1c20ff;return JSON[_0x19a9b7(0x11c)]({'dbId':_0x4e3b62['dbId'],'dbName':_0x4e3b62[_0x19a9b7(0x121)]});}function deserializeDbSelection(_0x359a6e){const _0x95a24b=a236_0x1c20ff;try{const _0x200a14=JSON[_0x95a24b(0x12e)](_0x359a6e);if(typeof _0x200a14[_0x95a24b(0x13e)]===_0x95a24b(0x14d)&&Number[_0x95a24b(0x15f)](_0x200a14[_0x95a24b(0x13e)]))return{'dbId':_0x200a14['dbId'],'dbName':_0x200a14[_0x95a24b(0x121)]};}catch{}throw CliErrors[_0x95a24b(0x127)](_0x95a24b(0x122)+_0x359a6e);}function resolveProvidedDbId(_0x1b838c){const _0x5cb3a4=a236_0x1c20ff,_0x3de2b0=_0x1b838c[_0x5cb3a4(0x14e)](_0x5cb3a4(0x156));if(typeof _0x3de2b0==='number'&&Number['isFinite'](_0x3de2b0))return _0x3de2b0;return undefined;}
@@ -1 +1 @@
1
- function a237_0x26a8(){const _0x280d26=['lastSync','trashDir','projectRoot','length','validation','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','145355iWMJia','9148QLAGJs','466713ktlNwu','replace','remoteId','5019212YsLCtH','high-risk-write','toISOString','SQL\x20lock\x20file\x20not\x20found.','997780hbkVcD','2569084qCReUe','sqls','94LXppdu','appCode','sql','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','delete','lockFilePath','1210539HCHNsI','sqlRoot','102aGQKer','sqlRootDir','sqlcode','/smartapi/custom/deleteUserCustomSql','POST','40ockWbz','entries','trashedTo','Deleted\x20','fromEntries','110MmvtNb','\x20(local\x20file\x20moved\x20to\x20trash)','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20'];a237_0x26a8=function(){return _0x280d26;};return a237_0x26a8();}const a237_0x53d290=a237_0x28a9;(function(_0x24de0e,_0x36da60){const _0x115cb0=a237_0x28a9,_0x5d68f8=_0x24de0e();while(!![]){try{const _0x1e4031=-parseInt(_0x115cb0(0x138))/0x1*(-parseInt(_0x115cb0(0x143))/0x2)+-parseInt(_0x115cb0(0x122))/0x3+-parseInt(_0x115cb0(0x141))/0x4+parseInt(_0x115cb0(0x137))/0x5*(parseInt(_0x115cb0(0x124))/0x6)+parseInt(_0x115cb0(0x140))/0x7*(parseInt(_0x115cb0(0x129))/0x8)+-parseInt(_0x115cb0(0x139))/0x9*(parseInt(_0x115cb0(0x12e))/0xa)+parseInt(_0x115cb0(0x13c))/0xb;if(_0x1e4031===_0x36da60)break;else _0x5d68f8['push'](_0x5d68f8['shift']());}catch(_0x40fe4d){_0x5d68f8['push'](_0x5d68f8['shift']());}}}(a237_0x26a8,0x74710));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';function a237_0x28a9(_0x40d4d3,_0x1ccb7a){_0x40d4d3=_0x40d4d3-0x122;const _0x26a87b=a237_0x26a8();let _0x28a932=_0x26a87b[_0x40d4d3];return _0x28a932;}import{dirname,join,relative,resolve,sep}from'node:path';import{deleteSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{fileExists}from'../../core/bff/file-system.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDelete={'service':a237_0x53d290(0x145),'command':a237_0x53d290(0x147),'description':'Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','risk':a237_0x53d290(0x13d),'flags':[SQLCODE_FLAG],async 'validate'(_0x32009c){const _0xef56a2=a237_0x53d290,_0x56d529=loadSqlProjectConfig(_0x32009c[_0xef56a2(0x144)]),_0x2fb808=await readSqlLockFile(_0x56d529['lockFilePath']);if(!_0x2fb808)throw CliErrors[_0xef56a2(0x135)](_0xef56a2(0x146));},async 'dryRun'(_0x3c8069){const _0x101aa6=a237_0x53d290,_0x179203=loadSqlProjectConfig(_0x3c8069[_0x101aa6(0x144)]),_0x2a1395=await readSqlLockFile(_0x179203['lockFilePath']);if(!_0x2a1395)throw CliErrors['validation'](_0x101aa6(0x146));const {appLock:_0x4812e}=ensureSqlLockScope(_0x2a1395,_0x3c8069[_0x101aa6(0x144)],_0x179203[_0x101aa6(0x123)],_0x101aa6(0x147)),_0x4778e8=_0x3c8069['str'](_0x101aa6(0x126)),_0x57ef0f=_0x4812e[_0x101aa6(0x142)][_0x4778e8];if(!_0x57ef0f)throw CliErrors[_0x101aa6(0x135)](_0x101aa6(0x136)+_0x4778e8+'\x22.');return{'method':_0x101aa6(0x128),'url':_0x101aa6(0x127),'body':{'sqlCode':_0x4778e8,'id':_0x57ef0f['remoteId'],'localPath':resolveLocalSqlFilePath(_0x179203,_0x4778e8,_0x57ef0f)},'description':'Would\x20delete\x20SQL\x20'+_0x4778e8+_0x101aa6(0x130)+_0x179203[_0x101aa6(0x132)]};},async 'execute'(_0x3bbc48){const _0x3d83c5=a237_0x53d290,_0x5a516a=loadSqlProjectConfig(_0x3bbc48[_0x3d83c5(0x144)]),_0x4675a8=await readSqlLockFile(_0x5a516a['lockFilePath']);if(!_0x4675a8)throw CliErrors['validation'](_0x3d83c5(0x13f));const {lockData:_0x47e3ba,appLock:_0x2e3650}=ensureSqlLockScope(_0x4675a8,_0x3bbc48['appCode'],_0x5a516a[_0x3d83c5(0x123)],_0x3d83c5(0x147)),_0x35b23b=_0x3bbc48['str'](_0x3d83c5(0x126)),_0x27e31e=_0x2e3650[_0x3d83c5(0x142)][_0x35b23b];if(!_0x27e31e)throw CliErrors['validation']('No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22'+_0x35b23b+'\x22.');await deleteSqlQuery({'id':_0x27e31e[_0x3d83c5(0x13b)],'sqlCode':_0x35b23b}),_0x2e3650['sqls']=Object[_0x3d83c5(0x12d)](Object[_0x3d83c5(0x12a)](_0x2e3650['sqls'])['filter'](([_0xb0b447])=>_0xb0b447!==_0x35b23b)),_0x2e3650[_0x3d83c5(0x131)]=new Date()[_0x3d83c5(0x13e)](),await writeSqlLockFile(_0x5a516a[_0x3d83c5(0x148)],_0x47e3ba);const _0x3687af=resolveLocalSqlFilePath(_0x5a516a,_0x35b23b,_0x27e31e);let _0x5da5ae;await fileExists(_0x3687af)&&(_0x5da5ae=await moveToTrash(_0x5a516a[_0x3d83c5(0x133)],_0x5a516a[_0x3d83c5(0x132)],_0x3687af),await cleanupEmptyDirectories(dirname(_0x3687af),_0x5a516a[_0x3d83c5(0x125)]));const _0x371bbd={'deleted':_0x35b23b,'remoteId':_0x27e31e[_0x3d83c5(0x13b)]};if(_0x5da5ae)_0x371bbd[_0x3d83c5(0x12b)]=_0x5da5ae;return{'ok':!![],'data':_0x371bbd,'message':_0x3d83c5(0x12c)+_0x35b23b+(_0x5da5ae?_0x3d83c5(0x12f):'')};}};async function moveToTrash(_0x37ee74,_0x2d570a,_0x31a8a1){const _0x8e82af=a237_0x53d290,_0x329928=new Date()[_0x8e82af(0x13e)]()[_0x8e82af(0x13a)](/[:.]/g,'-'),_0x1acfe9=relative(_0x37ee74,_0x31a8a1),_0x304ab8=join(_0x2d570a,_0x329928,_0x1acfe9);return await mkdir(dirname(_0x304ab8),{'recursive':!![]}),await rename(_0x31a8a1,_0x304ab8),_0x304ab8;}async function cleanupEmptyDirectories(_0x3cd6c0,_0x2e2cdc){const _0x3e8065=a237_0x53d290;let _0x260e8b=resolve(_0x3cd6c0);const _0x2394e3=resolve(_0x2e2cdc);while(_0x260e8b['startsWith'](''+_0x2394e3+sep)||_0x260e8b===_0x2394e3){if(_0x260e8b===_0x2394e3)return;try{const _0xdb796c=await readdir(_0x260e8b);if(_0xdb796c[_0x3e8065(0x134)]>0x0)return;await rmdir(_0x260e8b);}catch{return;}_0x260e8b=dirname(_0x260e8b);}}
1
+ const a237_0x2ae4a7=a237_0x5160;function a237_0x3eaf(){const _0x4b26d7=['projectRoot','Deleted\x20','166265gnYeRE','4931694WaiQJT','\x20(local\x20file\x20moved\x20to\x20trash)','105464qGYsUC','trashedTo','Would\x20delete\x20SQL\x20','479525TVYxUT','15HEmFXz','fromEntries','Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','408106wWkAsx','sqlRoot','str','remoteId','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','appCode','POST','sqlcode','delete','lockFilePath','replace','toISOString','sqls','66IHTOVp','validation','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','length','3969160kbCouy','entries','startsWith','trashDir','sql','2008524mJJrKg','lastSync','SQL\x20lock\x20file\x20not\x20found.'];a237_0x3eaf=function(){return _0x4b26d7;};return a237_0x3eaf();}(function(_0x170554,_0x41132e){const _0x5716d2=a237_0x5160,_0x37b901=_0x170554();while(!![]){try{const _0x3c2a5c=-parseInt(_0x5716d2(0xfc))/0x1+parseInt(_0x5716d2(0x100))/0x2+parseInt(_0x5716d2(0xfd))/0x3*(-parseInt(_0x5716d2(0xf9))/0x4)+parseInt(_0x5716d2(0xf6))/0x5*(parseInt(_0x5716d2(0xe8))/0x6)+parseInt(_0x5716d2(0xf1))/0x7+-parseInt(_0x5716d2(0xec))/0x8+parseInt(_0x5716d2(0xf7))/0x9;if(_0x3c2a5c===_0x41132e)break;else _0x37b901['push'](_0x37b901['shift']());}catch(_0x3fb6d8){_0x37b901['push'](_0x37b901['shift']());}}}(a237_0x3eaf,0x48912));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{fileExists}from'../../core/bff/file-system.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';function a237_0x5160(_0x2c372f,_0x328277){_0x2c372f=_0x2c372f-0xdc;const _0x3eaf7f=a237_0x3eaf();let _0x5160e5=_0x3eaf7f[_0x2c372f];return _0x5160e5;}import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDelete={'service':a237_0x2ae4a7(0xf0),'command':a237_0x2ae4a7(0xe3),'description':a237_0x2ae4a7(0xff),'risk':'high-risk-write','flags':[SQLCODE_FLAG],async 'validate'(_0x416892){const _0x1f1959=a237_0x2ae4a7,_0x7a513e=loadSqlProjectConfig(_0x416892[_0x1f1959(0xe0)]),_0x103c74=await readSqlLockFile(_0x7a513e[_0x1f1959(0xe4)]);if(!_0x103c74)throw CliErrors[_0x1f1959(0xe9)]('SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.');},async 'dryRun'(_0x4cc618){const _0x3c2255=a237_0x2ae4a7,_0x93fc2b=loadSqlProjectConfig(_0x4cc618['appCode']),_0x248ec8=await readSqlLockFile(_0x93fc2b[_0x3c2255(0xe4)]);if(!_0x248ec8)throw CliErrors[_0x3c2255(0xe9)](_0x3c2255(0xea));const {appLock:_0xb64430}=ensureSqlLockScope(_0x248ec8,_0x4cc618['appCode'],_0x93fc2b[_0x3c2255(0xdc)],_0x3c2255(0xe3)),_0x15f09e=_0x4cc618[_0x3c2255(0xdd)](_0x3c2255(0xe2)),_0x54dc2b=_0xb64430[_0x3c2255(0xe7)][_0x15f09e];if(!_0x54dc2b)throw CliErrors[_0x3c2255(0xe9)](_0x3c2255(0xdf)+_0x15f09e+'\x22.');return{'method':_0x3c2255(0xe1),'url':'/smartapi/custom/deleteUserCustomSql','body':{'sqlCode':_0x15f09e,'id':_0x54dc2b[_0x3c2255(0xde)],'localPath':resolveLocalSqlFilePath(_0x93fc2b,_0x15f09e,_0x54dc2b)},'description':_0x3c2255(0xfb)+_0x15f09e+'\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20'+_0x93fc2b['trashDir']};},async 'execute'(_0x47175b){const _0x20b813=a237_0x2ae4a7,_0x30a6d6=loadSqlProjectConfig(_0x47175b['appCode']),_0x168789=await readSqlLockFile(_0x30a6d6[_0x20b813(0xe4)]);if(!_0x168789)throw CliErrors[_0x20b813(0xe9)](_0x20b813(0xf3));const {lockData:_0x4acc3e,appLock:_0x595548}=ensureSqlLockScope(_0x168789,_0x47175b[_0x20b813(0xe0)],_0x30a6d6[_0x20b813(0xdc)],'delete'),_0xca7945=_0x47175b[_0x20b813(0xdd)]('sqlcode'),_0x2e762c=_0x595548[_0x20b813(0xe7)][_0xca7945];if(!_0x2e762c)throw CliErrors['validation'](_0x20b813(0xdf)+_0xca7945+'\x22.');await deleteSqlQuery({'id':_0x2e762c[_0x20b813(0xde)],'sqlCode':_0xca7945}),_0x595548['sqls']=Object[_0x20b813(0xfe)](Object[_0x20b813(0xed)](_0x595548[_0x20b813(0xe7)])['filter'](([_0x29785c])=>_0x29785c!==_0xca7945)),_0x595548[_0x20b813(0xf2)]=new Date()['toISOString'](),await writeSqlLockFile(_0x30a6d6[_0x20b813(0xe4)],_0x4acc3e);const _0xfb9659=resolveLocalSqlFilePath(_0x30a6d6,_0xca7945,_0x2e762c);let _0x2be04e;await fileExists(_0xfb9659)&&(_0x2be04e=await moveToTrash(_0x30a6d6[_0x20b813(0xf4)],_0x30a6d6[_0x20b813(0xef)],_0xfb9659),await cleanupEmptyDirectories(dirname(_0xfb9659),_0x30a6d6['sqlRootDir']));const _0x4c04cb={'deleted':_0xca7945,'remoteId':_0x2e762c[_0x20b813(0xde)]};if(_0x2be04e)_0x4c04cb[_0x20b813(0xfa)]=_0x2be04e;return{'ok':!![],'data':_0x4c04cb,'message':_0x20b813(0xf5)+_0xca7945+(_0x2be04e?_0x20b813(0xf8):'')};}};async function moveToTrash(_0x1f5a2b,_0x3aa2b2,_0x4f999b){const _0x21282c=a237_0x2ae4a7,_0x161bac=new Date()[_0x21282c(0xe6)]()[_0x21282c(0xe5)](/[:.]/g,'-'),_0x111bbd=relative(_0x1f5a2b,_0x4f999b),_0x2c6b56=join(_0x3aa2b2,_0x161bac,_0x111bbd);return await mkdir(dirname(_0x2c6b56),{'recursive':!![]}),await rename(_0x4f999b,_0x2c6b56),_0x2c6b56;}async function cleanupEmptyDirectories(_0x1abcc8,_0x31afdc){const _0x2e8d0f=a237_0x2ae4a7;let _0x45ed52=resolve(_0x1abcc8);const _0x2777e9=resolve(_0x31afdc);while(_0x45ed52[_0x2e8d0f(0xee)](''+_0x2777e9+sep)||_0x45ed52===_0x2777e9){if(_0x45ed52===_0x2777e9)return;try{const _0x2ca40d=await readdir(_0x45ed52);if(_0x2ca40d[_0x2e8d0f(0xeb)]>0x0)return;await rmdir(_0x45ed52);}catch{return;}_0x45ed52=dirname(_0x45ed52);}}
@@ -1 +1 @@
1
- const a238_0x19d200=a238_0xd731;function a238_0x180e(){const _0x4ffec3=['57445056rwYXfX','36AmodZp','1590425MEftUk','detail','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','bool','175kZkGmS','appCode','sqlcode','description','9wDhgSx','365865FHLgfN','484341TKilEN','3HKQfrx','2696002zqLKsa','boolean','read','dbId','sqlContent','10912528fSxbPY','sqlCode','sqlName','verbose','180ndTaYs','266082GcRFgP'];a238_0x180e=function(){return _0x4ffec3;};return a238_0x180e();}(function(_0x3d2264,_0x41f56b){const _0x478c30=a238_0xd731,_0x407024=_0x3d2264();while(!![]){try{const _0x1aa7dc=-parseInt(_0x478c30(0x113))/0x1+parseInt(_0x478c30(0x106))/0x2*(-parseInt(_0x478c30(0x105))/0x3)+-parseInt(_0x478c30(0x112))/0x4*(-parseInt(_0x478c30(0x103))/0x5)+-parseInt(_0x478c30(0x110))/0x6*(parseInt(_0x478c30(0x117))/0x7)+parseInt(_0x478c30(0x10b))/0x8*(-parseInt(_0x478c30(0x11b))/0x9)+-parseInt(_0x478c30(0x10f))/0xa*(-parseInt(_0x478c30(0x104))/0xb)+parseInt(_0x478c30(0x111))/0xc;if(_0x1aa7dc===_0x41f56b)break;else _0x407024['push'](_0x407024['shift']());}catch(_0x83ff6){_0x407024['push'](_0x407024['shift']());}}}(a238_0x180e,0xc9e9c));import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a238_0xd731(_0x31b2f4,_0x2c1a05){_0x31b2f4=_0x31b2f4-0x103;const _0x180ea3=a238_0x180e();let _0xd73188=_0x180ea3[_0x31b2f4];return _0xd73188;}export const sqlDetail={'service':'sql','command':a238_0x19d200(0x114),'description':a238_0x19d200(0x115),'risk':a238_0x19d200(0x108),'flags':[SQLCODE_FLAG,{'name':a238_0x19d200(0x10e),'type':a238_0x19d200(0x107),'description':'Return\x20full\x20raw\x20SQL\x20query\x20object'}],async 'execute'(_0x44b4fa){const _0x3ceb5a=a238_0x19d200,_0x35901b=await getSqlQueryInfo(_0x44b4fa['appCode'],_0x44b4fa['str'](_0x3ceb5a(0x119))),_0x15f5b9=_0x44b4fa[_0x3ceb5a(0x116)](_0x3ceb5a(0x10e));if(_0x15f5b9)return{'ok':!![],'data':_0x35901b};const _0x13cad5=_0x35901b[_0x3ceb5a(0x109)]?await getDbName(_0x44b4fa[_0x3ceb5a(0x118)],_0x35901b[_0x3ceb5a(0x109)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x35901b[_0x3ceb5a(0x10c)],'sqlName':_0x35901b[_0x3ceb5a(0x10d)],'db':_0x13cad5?_0x13cad5+'\x20('+_0x35901b[_0x3ceb5a(0x109)]+')':_0x35901b[_0x3ceb5a(0x109)]??'','description':_0x35901b[_0x3ceb5a(0x11a)]??'','sqlContent':_0x35901b[_0x3ceb5a(0x10a)]??''}};}};
1
+ const a238_0xffcc97=a238_0x46d9;function a238_0x46d9(_0x547741,_0x15ae4a){_0x547741=_0x547741-0x184;const _0x32b09e=a238_0x32b0();let _0x46d9db=_0x32b09e[_0x547741];return _0x46d9db;}(function(_0x4ac6c4,_0x2d6bf9){const _0x24c40c=a238_0x46d9,_0x38f35e=_0x4ac6c4();while(!![]){try{const _0x1382ad=parseInt(_0x24c40c(0x195))/0x1+parseInt(_0x24c40c(0x197))/0x2*(-parseInt(_0x24c40c(0x190))/0x3)+-parseInt(_0x24c40c(0x192))/0x4*(-parseInt(_0x24c40c(0x185))/0x5)+-parseInt(_0x24c40c(0x187))/0x6+parseInt(_0x24c40c(0x19a))/0x7*(-parseInt(_0x24c40c(0x186))/0x8)+-parseInt(_0x24c40c(0x19d))/0x9*(parseInt(_0x24c40c(0x18c))/0xa)+-parseInt(_0x24c40c(0x194))/0xb*(-parseInt(_0x24c40c(0x18d))/0xc);if(_0x1382ad===_0x2d6bf9)break;else _0x38f35e['push'](_0x38f35e['shift']());}catch(_0x3d172b){_0x38f35e['push'](_0x38f35e['shift']());}}}(a238_0x32b0,0xd8438));import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a238_0x32b0(){const _0x25efb8=['7430166xBYbGZ','sql','sqlName','sqlCode','Return\x20full\x20raw\x20SQL\x20query\x20object','10190goqOvb','12Psjgnj','dbId','sqlcode','177nNStWF','read','36PNnWXz','detail','42189785PzUXOY','810726WbtViS','description','43046FjHUaG','boolean','appCode','1808240sOzUvq','sqlContent','verbose','15606kklwXK','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','860055XHfIaX','32fQtaZI'];a238_0x32b0=function(){return _0x25efb8;};return a238_0x32b0();}export const sqlDetail={'service':a238_0xffcc97(0x188),'command':a238_0xffcc97(0x193),'description':a238_0xffcc97(0x184),'risk':a238_0xffcc97(0x191),'flags':[SQLCODE_FLAG,{'name':a238_0xffcc97(0x19c),'type':a238_0xffcc97(0x198),'description':a238_0xffcc97(0x18b)}],async 'execute'(_0x587edc){const _0x3e902b=a238_0xffcc97,_0x551fd7=await getSqlQueryInfo(_0x587edc[_0x3e902b(0x199)],_0x587edc['str'](_0x3e902b(0x18f))),_0x33d136=_0x587edc['bool']('verbose');if(_0x33d136)return{'ok':!![],'data':_0x551fd7};const _0x52ae6a=_0x551fd7[_0x3e902b(0x18e)]?await getDbName(_0x587edc[_0x3e902b(0x199)],_0x551fd7[_0x3e902b(0x18e)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x551fd7[_0x3e902b(0x18a)],'sqlName':_0x551fd7[_0x3e902b(0x189)],'db':_0x52ae6a?_0x52ae6a+'\x20('+_0x551fd7[_0x3e902b(0x18e)]+')':_0x551fd7[_0x3e902b(0x18e)]??'','description':_0x551fd7[_0x3e902b(0x196)]??'','sqlContent':_0x551fd7[_0x3e902b(0x19b)]??''}};}};