@lovrabet/rabetbase-cli 2.5.10-beta.1 → 2.5.10-beta.2

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 (382) 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/design-context.js +1 -1
  77. package/lib/commands/dataset/design-start.js +1 -1
  78. package/lib/commands/dataset/design-status.js +1 -1
  79. package/lib/commands/dataset/design-sync-retry.js +1 -1
  80. package/lib/commands/dataset/design-sync-status.js +1 -1
  81. package/lib/commands/dataset/design-validate.js +1 -1
  82. package/lib/commands/dataset/detail.js +1 -1
  83. package/lib/commands/dataset/extend-update.js +1 -1
  84. package/lib/commands/dataset/field-restore.js +1 -1
  85. package/lib/commands/dataset/field-update.js +1 -1
  86. package/lib/commands/dataset/generate.js +1 -1
  87. package/lib/commands/dataset/index.js +1 -1
  88. package/lib/commands/dataset/list.js +1 -1
  89. package/lib/commands/dataset/operations.js +1 -1
  90. package/lib/commands/dataset/relation-audit.js +1 -1
  91. package/lib/commands/dataset/relation-create.js +1 -1
  92. package/lib/commands/dataset/relation-delete.js +1 -1
  93. package/lib/commands/dataset/relation-shared.js +1 -1
  94. package/lib/commands/dataset/relation-update.js +1 -1
  95. package/lib/commands/dataset/relations.js +1 -1
  96. package/lib/commands/dataset/rename.js +1 -1
  97. package/lib/commands/dataset/restore.js +1 -1
  98. package/lib/commands/dataset/user-deleted-field-list.js +1 -1
  99. package/lib/commands/db/analysis-batching.js +1 -1
  100. package/lib/commands/db/analyze-batch-plan.js +1 -1
  101. package/lib/commands/db/analyze-cancel.js +1 -1
  102. package/lib/commands/db/analyze-start.js +1 -1
  103. package/lib/commands/db/analyze-status.js +1 -1
  104. package/lib/commands/db/create.js +1 -1
  105. package/lib/commands/db/cross-db-analysis-shared.js +1 -1
  106. package/lib/commands/db/cross-db-analyze-latest.js +1 -1
  107. package/lib/commands/db/cross-db-analyze-start.js +1 -1
  108. package/lib/commands/db/cross-db-analyze-status.js +1 -1
  109. package/lib/commands/db/delete.js +1 -1
  110. package/lib/commands/db/detail.js +1 -1
  111. package/lib/commands/db/diff-refresh-start.js +1 -1
  112. package/lib/commands/db/diff-refresh-status.js +1 -1
  113. package/lib/commands/db/diff.js +1 -1
  114. package/lib/commands/db/index.js +1 -1
  115. package/lib/commands/db/list.js +1 -1
  116. package/lib/commands/db/shared.js +1 -1
  117. package/lib/commands/db/table-diff-shared.js +1 -1
  118. package/lib/commands/db/tables.js +1 -1
  119. package/lib/commands/db/test.js +1 -1
  120. package/lib/commands/db/update.js +1 -1
  121. package/lib/commands/deployment/index.js +1 -1
  122. package/lib/commands/deployment/sync-all.js +1 -1
  123. package/lib/commands/deployment/sync-jobs.js +1 -1
  124. package/lib/commands/deployment/sync-status.js +1 -1
  125. package/lib/commands/doctor.js +1 -1
  126. package/lib/commands/file/index.js +1 -1
  127. package/lib/commands/flow/create.js +1 -1
  128. package/lib/commands/flow/detail.js +1 -1
  129. package/lib/commands/flow/index.js +1 -1
  130. package/lib/commands/flow/list.js +1 -1
  131. package/lib/commands/flow/page-list.js +1 -1
  132. package/lib/commands/flow/publish.js +1 -1
  133. package/lib/commands/flow/runtime-resources-shared.js +1 -1
  134. package/lib/commands/flow/runtime-role-list.js +1 -1
  135. package/lib/commands/flow/runtime-role-user-list.js +1 -1
  136. package/lib/commands/flow/runtime-user-search.js +1 -1
  137. package/lib/commands/flow/shared.js +1 -1
  138. package/lib/commands/flow/update.js +1 -1
  139. package/lib/commands/flow/validate.js +1 -1
  140. package/lib/commands/instant-api-policy/current.js +1 -1
  141. package/lib/commands/instant-api-policy/index.js +1 -1
  142. package/lib/commands/instant-api-policy/init.js +1 -1
  143. package/lib/commands/instant-api-policy/publish.js +1 -1
  144. package/lib/commands/instant-api-policy/pull.js +1 -1
  145. package/lib/commands/instant-api-policy/revision.js +1 -1
  146. package/lib/commands/instant-api-policy/revisions.js +1 -1
  147. package/lib/commands/instant-api-policy/rollback.js +1 -1
  148. package/lib/commands/instant-api-policy/shared.d.ts +1 -1
  149. package/lib/commands/instant-api-policy/shared.js +1 -1
  150. package/lib/commands/instant-api-policy/validate.js +1 -1
  151. package/lib/commands/issue/index.js +1 -1
  152. package/lib/commands/issue/nudge.js +1 -1
  153. package/lib/commands/issue/report.js +1 -1
  154. package/lib/commands/issue/shared.js +1 -1
  155. package/lib/commands/kb/create.js +1 -1
  156. package/lib/commands/kb/delete.js +1 -1
  157. package/lib/commands/kb/detail.js +1 -1
  158. package/lib/commands/kb/index.js +1 -1
  159. package/lib/commands/kb/list.js +1 -1
  160. package/lib/commands/kb/search.js +1 -1
  161. package/lib/commands/kb/shared.js +1 -1
  162. package/lib/commands/kb/update.js +1 -1
  163. package/lib/commands/logs/index.js +1 -1
  164. package/lib/commands/menu/asset-update.js +1 -1
  165. package/lib/commands/menu/delete.js +1 -1
  166. package/lib/commands/menu/external-link-create.js +1 -1
  167. package/lib/commands/menu/external-link-update.js +1 -1
  168. package/lib/commands/menu/group-create.js +1 -1
  169. package/lib/commands/menu/group-update.js +1 -1
  170. package/lib/commands/menu/index.js +1 -1
  171. package/lib/commands/menu/list.js +1 -1
  172. package/lib/commands/menu/move.js +1 -1
  173. package/lib/commands/menu/regroup-start.js +1 -1
  174. package/lib/commands/menu/rename.js +1 -1
  175. package/lib/commands/menu/shared/compare-table.js +1 -1
  176. package/lib/commands/menu/shared/delete-plan.js +1 -1
  177. package/lib/commands/menu/shared/facts.js +1 -1
  178. package/lib/commands/menu/shared/index.js +1 -1
  179. package/lib/commands/menu/shared/inquirer.js +1 -1
  180. package/lib/commands/menu/shared/local-pages.js +1 -1
  181. package/lib/commands/menu/shared/logic.js +1 -1
  182. package/lib/commands/menu/shared/mutations.js +1 -1
  183. package/lib/commands/menu/shared/path.js +1 -1
  184. package/lib/commands/menu/shared/service.js +1 -1
  185. package/lib/commands/menu/shared/subapp-assets.js +1 -1
  186. package/lib/commands/menu/shared/sync-core.js +1 -1
  187. package/lib/commands/menu/shared/update-core.js +1 -1
  188. package/lib/commands/menu/shared/valid-url.js +1 -1
  189. package/lib/commands/menu/subapp-assets-status.js +1 -1
  190. package/lib/commands/menu/subapp-assets-update.js +1 -1
  191. package/lib/commands/menu/sync.js +1 -1
  192. package/lib/commands/menu/visibility-update.js +1 -1
  193. package/lib/commands/notification/config-create.js +1 -1
  194. package/lib/commands/notification/config-delete.js +1 -1
  195. package/lib/commands/notification/config-list.js +1 -1
  196. package/lib/commands/notification/config-update.js +1 -1
  197. package/lib/commands/notification/index.js +1 -1
  198. package/lib/commands/notification/shared.js +1 -1
  199. package/lib/commands/ocr/index.js +1 -1
  200. package/lib/commands/page/create.js +1 -1
  201. package/lib/commands/page/custom/detail.js +1 -1
  202. package/lib/commands/page/custom/list.js +1 -1
  203. package/lib/commands/page/custom/publish.js +1 -1
  204. package/lib/commands/page/custom/shared.js +1 -1
  205. package/lib/commands/page/custom/syntax.js +1 -1
  206. package/lib/commands/page/custom/update.js +1 -1
  207. package/lib/commands/page/data-list-status.js +1 -1
  208. package/lib/commands/page/generate-start.js +1 -1
  209. package/lib/commands/page/generate-status.js +1 -1
  210. package/lib/commands/page/index.js +1 -1
  211. package/lib/commands/page/pull.js +1 -1
  212. package/lib/commands/page/push.js +1 -1
  213. package/lib/commands/page/relation-audit.js +1 -1
  214. package/lib/commands/page/restore.js +1 -1
  215. package/lib/commands/page/shared.js +1 -1
  216. package/lib/commands/page/sync.js +1 -1
  217. package/lib/commands/project/api-architecture-upgrade.js +1 -1
  218. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  219. package/lib/commands/project/create/format-elapsed.js +1 -1
  220. package/lib/commands/project/create/main.js +1 -1
  221. package/lib/commands/project/create/materialize-project-template.js +1 -1
  222. package/lib/commands/project/create/project-name.js +1 -1
  223. package/lib/commands/project/create/project-template-archive.js +1 -1
  224. package/lib/commands/project/create/project-template-path.js +1 -1
  225. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  226. package/lib/commands/project/create/use-format-code.js +1 -1
  227. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  228. package/lib/commands/project/domain-routing-sync.js +1 -1
  229. package/lib/commands/project/index.js +1 -1
  230. package/lib/commands/project/upgrade.js +1 -1
  231. package/lib/commands/registry.js +1 -1
  232. package/lib/commands/role/delete.js +1 -1
  233. package/lib/commands/role/detail.js +1 -1
  234. package/lib/commands/role/index.js +1 -1
  235. package/lib/commands/role/list.js +1 -1
  236. package/lib/commands/role/shared.js +1 -1
  237. package/lib/commands/role/update.js +1 -1
  238. package/lib/commands/role/user-add.js +1 -1
  239. package/lib/commands/role/user-remove.js +1 -1
  240. package/lib/commands/role/user-resolve.js +1 -1
  241. package/lib/commands/rule/get.js +1 -1
  242. package/lib/commands/rule/index.js +1 -1
  243. package/lib/commands/rule/list.js +1 -1
  244. package/lib/commands/rule/set.js +1 -1
  245. package/lib/commands/rule/shared.js +1 -1
  246. package/lib/commands/run/index.js +1 -1
  247. package/lib/commands/schema.js +1 -1
  248. package/lib/commands/sql/create.js +1 -1
  249. package/lib/commands/sql/delete.js +1 -1
  250. package/lib/commands/sql/detail.js +1 -1
  251. package/lib/commands/sql/exec.js +1 -1
  252. package/lib/commands/sql/index.js +1 -1
  253. package/lib/commands/sql/list.js +1 -1
  254. package/lib/commands/sql/pull.js +1 -1
  255. package/lib/commands/sql/push.js +1 -1
  256. package/lib/commands/sql/shared.js +1 -1
  257. package/lib/commands/sql/status.js +1 -1
  258. package/lib/commands/sql/validate.js +1 -1
  259. package/lib/commands/task/index.js +1 -1
  260. package/lib/commands/task/status.js +1 -1
  261. package/lib/commands/tenant/index.js +1 -1
  262. package/lib/commands/tenant/members-list.js +1 -1
  263. package/lib/commands/tenant/shared.js +1 -1
  264. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  265. package/lib/commands/user-account/feishu-bind.js +1 -1
  266. package/lib/commands/user-account/index.js +1 -1
  267. package/lib/commands/workspace/add.js +1 -1
  268. package/lib/commands/workspace/index.js +1 -1
  269. package/lib/commands/workspace/remove.js +1 -1
  270. package/lib/config/domain-config.js +1 -1
  271. package/lib/config/project-domain-routing.js +1 -1
  272. package/lib/config/region-config.js +1 -1
  273. package/lib/config/schema.js +1 -1
  274. package/lib/constant/cdn.js +1 -1
  275. package/lib/constant/cli.js +1 -1
  276. package/lib/constant/defaults.js +1 -1
  277. package/lib/constant/domain.js +1 -1
  278. package/lib/constant/env.js +1 -1
  279. package/lib/constant/output.js +1 -1
  280. package/lib/constant/paths.js +1 -1
  281. package/lib/constant/region.js +1 -1
  282. package/lib/constant/risk.js +1 -1
  283. package/lib/constant/routing-profile.js +1 -1
  284. package/lib/context/app-resolver.js +1 -1
  285. package/lib/context/auth-resolver.js +1 -1
  286. package/lib/context/config-loader.js +1 -1
  287. package/lib/context.js +1 -1
  288. package/lib/core/alias-resolver.js +1 -1
  289. package/lib/core/api-client.d.ts +0 -28
  290. package/lib/core/api-client.js +1 -1
  291. package/lib/core/bff/config.js +1 -1
  292. package/lib/core/bff/file-system.js +1 -1
  293. package/lib/core/bff/hash.js +1 -1
  294. package/lib/core/bff/hook-directory.js +1 -1
  295. package/lib/core/bff/lock.js +1 -1
  296. package/lib/core/bff/utils.js +1 -1
  297. package/lib/core/cross-db-analysis.js +1 -1
  298. package/lib/core/cross-db-relation.js +1 -1
  299. package/lib/core/db-resolver.js +1 -1
  300. package/lib/core/flow-config.js +1 -1
  301. package/lib/core/instant-api-policy/config.js +1 -1
  302. package/lib/core/instant-api-policy/endpoints.d.ts +8 -0
  303. package/lib/core/instant-api-policy/endpoints.js +1 -0
  304. package/lib/core/kb-management-client.d.ts +3 -9
  305. package/lib/core/kb-management-client.js +1 -1
  306. package/lib/core/kb-search-client.d.ts +1 -4
  307. package/lib/core/kb-search-client.js +1 -1
  308. package/lib/core/page/file-system.js +1 -1
  309. package/lib/core/page/hash.js +1 -1
  310. package/lib/core/page/lock.js +1 -1
  311. package/lib/core/page/lr-smart-jsx.js +1 -1
  312. package/lib/core/sql-index-auditor.js +1 -1
  313. package/lib/core/sql-sync/config.js +1 -1
  314. package/lib/core/sql-sync/file-system.js +1 -1
  315. package/lib/core/sql-sync/hash.js +1 -1
  316. package/lib/core/sql-sync/lock.js +1 -1
  317. package/lib/core/sql-sync/utils.js +1 -1
  318. package/lib/core/sql-validator.js +1 -1
  319. package/lib/errors.js +1 -1
  320. package/lib/framework/build-all-flags.js +1 -1
  321. package/lib/framework/error-output.js +1 -1
  322. package/lib/framework/explicit-yes.js +1 -1
  323. package/lib/framework/flags.js +1 -1
  324. package/lib/framework/help.js +1 -1
  325. package/lib/framework/index.js +1 -1
  326. package/lib/framework/output.js +1 -1
  327. package/lib/framework/response.js +1 -1
  328. package/lib/framework/runner-alias.js +1 -1
  329. package/lib/framework/runner.js +1 -1
  330. package/lib/framework/schema-export.js +1 -1
  331. package/lib/framework/supported-flags.js +1 -1
  332. package/lib/framework/types.js +1 -1
  333. package/lib/generated/build-info.d.ts +4 -4
  334. package/lib/generated/build-info.js +1 -1
  335. package/lib/generated/official-routing.js +1 -1
  336. package/lib/generated/routing-contract.js +1 -1
  337. package/lib/help.js +1 -1
  338. package/lib/postinstall.js +1 -1
  339. package/lib/runtime/confirmation.js +1 -1
  340. package/lib/runtime/event.js +1 -1
  341. package/lib/runtime/index.js +1 -1
  342. package/lib/runtime/queue.js +1 -1
  343. package/lib/runtime/resolve.js +1 -1
  344. package/lib/services/dataset-design/checkpoint.js +1 -1
  345. package/lib/services/dataset-design/commands.js +1 -1
  346. package/lib/services/dataset-design/contract.js +1 -1
  347. package/lib/skills/builtin-skill.js +1 -1
  348. package/lib/skills/main.js +1 -1
  349. package/lib/skills/npx-skills-add.js +1 -1
  350. package/lib/skills/skill-presence.js +1 -1
  351. package/lib/telemetry/cli-command-trace.js +1 -1
  352. package/lib/telemetry/cli-help-trace.js +1 -1
  353. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  354. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  355. package/lib/telemetry/send-cli-trace-log.js +1 -1
  356. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  357. package/lib/utils/ai_config.js +1 -1
  358. package/lib/utils/apply-jq-filter.js +1 -1
  359. package/lib/utils/cdn-config.js +1 -1
  360. package/lib/utils/check-sdk-version.js +1 -1
  361. package/lib/utils/cli-version-check.js +1 -1
  362. package/lib/utils/cli-version-policy.js +1 -1
  363. package/lib/utils/config.js +1 -1
  364. package/lib/utils/entity-with-id.js +1 -1
  365. package/lib/utils/file-utils.js +1 -1
  366. package/lib/utils/guides-cdn.js +1 -1
  367. package/lib/utils/http-client.js +1 -1
  368. package/lib/utils/is-non-interactive.js +1 -1
  369. package/lib/utils/logger.js +1 -1
  370. package/lib/utils/params.js +1 -1
  371. package/lib/utils/platform.js +1 -1
  372. package/lib/utils/sleep.js +1 -1
  373. package/lib/utils/template-replacer.js +1 -1
  374. package/lib/utils/update-notice.js +1 -1
  375. package/lib/utils/version.js +1 -1
  376. package/lib/utils/with-active-cookie.js +1 -1
  377. package/lib/utils/write-cli-side-channel.js +1 -1
  378. package/package.json +2 -1
  379. package/skills/rabetbase/SKILL.md +1 -1
  380. package/skills/rabetbase-dataset-generation/SKILL.md +1 -1
  381. package/skills/rabetbase-page-generation/SKILL.md +1 -1
  382. package/skills/rabetbase.manifest.json +3 -3
@@ -1 +1 @@
1
- const a232_0x32da8a=a232_0x28f2;function a232_0x28f2(_0x418067,_0x5298f4){_0x418067=_0x418067-0xa2;const _0x486164=a232_0x4861();let _0x28f2b5=_0x486164[_0x418067];return _0x28f2b5;}function a232_0x4861(){const _0x6fc870=['role','Role\x20','1634124NEnWSA','Show\x20a\x20single\x20role\x27s\x20detail','2997293OhzbNR','detail','11ZWEQgz','num','1980pRizzu','3hFWFKn','2725289KhfGij','354443KBOhKf','18CuPSjJ','2rsxvyF','8250lkSILJ','826852gnCgSg','8ciJdty','appCode','roleType','432105XcBjgL','roleName'];a232_0x4861=function(){return _0x6fc870;};return a232_0x4861();}(function(_0x137128,_0xea7b2f){const _0x1681a0=a232_0x28f2,_0x80a8de=_0x137128();while(!![]){try{const _0x16ee3a=parseInt(_0x1681a0(0xb5))/0x1*(parseInt(_0x1681a0(0xa2))/0x2)+parseInt(_0x1681a0(0xb3))/0x3*(-parseInt(_0x1681a0(0xa4))/0x4)+-parseInt(_0x1681a0(0xa8))/0x5*(parseInt(_0x1681a0(0xb6))/0x6)+parseInt(_0x1681a0(0xb4))/0x7*(parseInt(_0x1681a0(0xa5))/0x8)+-parseInt(_0x1681a0(0xb2))/0x9*(-parseInt(_0x1681a0(0xa3))/0xa)+parseInt(_0x1681a0(0xb0))/0xb*(parseInt(_0x1681a0(0xac))/0xc)+-parseInt(_0x1681a0(0xae))/0xd;if(_0x16ee3a===_0xea7b2f)break;else _0x80a8de['push'](_0x80a8de['shift']());}catch(_0x18d9fa){_0x80a8de['push'](_0x80a8de['shift']());}}}(a232_0x4861,0x5916e));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';export const roleDetail={'service':a232_0x32da8a(0xaa),'command':a232_0x32da8a(0xaf),'description':a232_0x32da8a(0xad),'risk':'read','flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x35556e){const _0x334e37=a232_0x32da8a,_0x1ac9cb=_0x35556e[_0x334e37(0xb1)]('id'),_0x1ba3f9=await getRoleById(_0x35556e[_0x334e37(0xa6)],_0x1ac9cb);return{'ok':!![],'data':{'scope':'dev','role':projectRole(_0x1ba3f9)},'message':_0x334e37(0xab)+_0x1ba3f9[_0x334e37(0xa9)]+'\x20('+_0x1ba3f9[_0x334e37(0xa7)]+')'};}};
1
+ function a232_0x1b46(_0x4805bb,_0x1ce8df){_0x4805bb=_0x4805bb-0xd6;const _0x58bb24=a232_0x58bb();let _0x1b469b=_0x58bb24[_0x4805bb];return _0x1b469b;}const a232_0x2b4ce6=a232_0x1b46;(function(_0x39cc10,_0x279e0d){const _0xf01062=a232_0x1b46,_0x7b25da=_0x39cc10();while(!![]){try{const _0x3fbfa3=parseInt(_0xf01062(0xd6))/0x1*(parseInt(_0xf01062(0xe0))/0x2)+parseInt(_0xf01062(0xdb))/0x3*(parseInt(_0xf01062(0xde))/0x4)+-parseInt(_0xf01062(0xe1))/0x5*(-parseInt(_0xf01062(0xe5))/0x6)+parseInt(_0xf01062(0xe2))/0x7*(parseInt(_0xf01062(0xe3))/0x8)+-parseInt(_0xf01062(0xd7))/0x9+parseInt(_0xf01062(0xe6))/0xa+-parseInt(_0xf01062(0xd9))/0xb*(parseInt(_0xf01062(0xdd))/0xc);if(_0x3fbfa3===_0x279e0d)break;else _0x7b25da['push'](_0x7b25da['shift']());}catch(_0x542333){_0x7b25da['push'](_0x7b25da['shift']());}}}(a232_0x58bb,0xe60e0));function a232_0x58bb(){const _0x5b9a6b=['Role\x20','37861MrDSvn','9507069DxOBGE','read','210122ZHtJpc','role','603JIHzDF','appCode','1572QDMaIO','37384uwhoaX','num','6iAXcEi','2230eShiNe','7nCtUyO','13021632bOKMzp','roleName','4566iIDyuw','5417680LkiAxK','detail'];a232_0x58bb=function(){return _0x5b9a6b;};return a232_0x58bb();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';export const roleDetail={'service':a232_0x2b4ce6(0xda),'command':a232_0x2b4ce6(0xe7),'description':'Show\x20a\x20single\x20role\x27s\x20detail','risk':a232_0x2b4ce6(0xd8),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x1ce672){const _0x4d09b3=a232_0x2b4ce6,_0x5ce034=_0x1ce672[_0x4d09b3(0xdf)]('id'),_0x2b695e=await getRoleById(_0x1ce672[_0x4d09b3(0xdc)],_0x5ce034);return{'ok':!![],'data':{'scope':'dev','role':projectRole(_0x2b695e)},'message':_0x4d09b3(0xe8)+_0x2b695e[_0x4d09b3(0xe4)]+'\x20('+_0x2b695e['roleType']+')'};}};
@@ -1 +1 @@
1
- (function(_0x1721d7,_0x2d4e6f){const _0x3d25d5=a233_0x7e10,_0x36e064=_0x1721d7();while(!![]){try{const _0x4a12b2=parseInt(_0x3d25d5(0x1ea))/0x1*(parseInt(_0x3d25d5(0x1ed))/0x2)+-parseInt(_0x3d25d5(0x1ef))/0x3*(parseInt(_0x3d25d5(0x1f0))/0x4)+parseInt(_0x3d25d5(0x1e9))/0x5+parseInt(_0x3d25d5(0x1eb))/0x6*(parseInt(_0x3d25d5(0x1e8))/0x7)+-parseInt(_0x3d25d5(0x1ec))/0x8*(-parseInt(_0x3d25d5(0x1ee))/0x9)+parseInt(_0x3d25d5(0x1f2))/0xa+-parseInt(_0x3d25d5(0x1f1))/0xb;if(_0x4a12b2===_0x2d4e6f)break;else _0x36e064['push'](_0x36e064['shift']());}catch(_0x9179ad){_0x36e064['push'](_0x36e064['shift']());}}}(a233_0x4c11,0xdd6cb));function a233_0x7e10(_0x11192c,_0x2b75f0){_0x11192c=_0x11192c-0x1e8;const _0x4c1147=a233_0x4c11();let _0x7e1056=_0x4c1147[_0x11192c];return _0x7e1056;}import{roleList}from'../../commands/role/list.js';import{roleDetail}from'../../commands/role/detail.js';import{roleUpdate}from'../../commands/role/update.js';import{roleDelete}from'../../commands/role/delete.js';import{roleUserResolve}from'../../commands/role/user-resolve.js';function a233_0x4c11(){const _0x69aaf1=['91dSOtva','453895zbWuTc','941vPISat','472674yEajOk','1356232AOSzkU','3026BoSvCR','18qQQVIP','12sGXNZm','427236nauZQU','18427849tsohBl','1317530fOMycu'];a233_0x4c11=function(){return _0x69aaf1;};return a233_0x4c11();}import{roleUserAdd}from'../../commands/role/user-add.js';import{roleUserRemove}from'../../commands/role/user-remove.js';export const roleDefinitions=[roleList,roleDetail,roleUpdate,roleDelete,roleUserResolve,roleUserAdd,roleUserRemove];
1
+ (function(_0x119071,_0x494bc7){const _0x1bd7d7=a233_0x2085,_0x1af5ba=_0x119071();while(!![]){try{const _0x5a13c9=-parseInt(_0x1bd7d7(0x194))/0x1+-parseInt(_0x1bd7d7(0x19c))/0x2+parseInt(_0x1bd7d7(0x198))/0x3*(-parseInt(_0x1bd7d7(0x19b))/0x4)+parseInt(_0x1bd7d7(0x193))/0x5*(-parseInt(_0x1bd7d7(0x195))/0x6)+parseInt(_0x1bd7d7(0x196))/0x7+parseInt(_0x1bd7d7(0x197))/0x8+parseInt(_0x1bd7d7(0x19a))/0x9*(parseInt(_0x1bd7d7(0x199))/0xa);if(_0x5a13c9===_0x494bc7)break;else _0x1af5ba['push'](_0x1af5ba['shift']());}catch(_0x5ccbba){_0x1af5ba['push'](_0x1af5ba['shift']());}}}(a233_0x70a8,0x2bbba));import{roleList}from'../../commands/role/list.js';import{roleDetail}from'../../commands/role/detail.js';function a233_0x70a8(){const _0x3ff5e2=['13410UcTffq','1314sclBND','433084jReePj','119510HyhVKu','115cYuqoC','80466bCcFIX','46842TgGppI','1278494HKVyeu','2696208KwDbKG','6GJPocJ'];a233_0x70a8=function(){return _0x3ff5e2;};return a233_0x70a8();}import{roleUpdate}from'../../commands/role/update.js';import{roleDelete}from'../../commands/role/delete.js';import{roleUserResolve}from'../../commands/role/user-resolve.js';import{roleUserAdd}from'../../commands/role/user-add.js';function a233_0x2085(_0x47af1c,_0x3808d6){_0x47af1c=_0x47af1c-0x193;const _0x70a83d=a233_0x70a8();let _0x208539=_0x70a83d[_0x47af1c];return _0x208539;}import{roleUserRemove}from'../../commands/role/user-remove.js';export const roleDefinitions=[roleList,roleDetail,roleUpdate,roleDelete,roleUserResolve,roleUserAdd,roleUserRemove];
@@ -1 +1 @@
1
- const a234_0xe43c35=a234_0x58fe;(function(_0x5f00ca,_0x2514ab){const _0x446b89=a234_0x58fe,_0x2e3e7f=_0x5f00ca();while(!![]){try{const _0x545675=parseInt(_0x446b89(0x8b))/0x1+-parseInt(_0x446b89(0x73))/0x2+-parseInt(_0x446b89(0x79))/0x3+parseInt(_0x446b89(0x88))/0x4*(parseInt(_0x446b89(0x83))/0x5)+-parseInt(_0x446b89(0x71))/0x6+-parseInt(_0x446b89(0x90))/0x7+parseInt(_0x446b89(0x84))/0x8;if(_0x545675===_0x2514ab)break;else _0x2e3e7f['push'](_0x2e3e7f['shift']());}catch(_0x5199cd){_0x2e3e7f['push'](_0x2e3e7f['shift']());}}}(a234_0xe6fe,0xe7612));function a234_0x58fe(_0x5d46e3,_0x52a0c0){_0x5d46e3=_0x5d46e3-0x70;const _0xe6fede=a234_0xe6fe();let _0x58fea4=_0xe6fede[_0x5d46e3];return _0x58fea4;}import{listAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectRole}from'../../commands/role/shared.js';function a234_0xe6fe(){const _0x26191f=['includes','722599EeVpYO','str','trim','--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.','number','7424060RiqRcP','Found\x20','appCode','7515780aMQjrV','roleType','2954324wjRhgt','--pagesize\x20must\x20be\x20between\x201\x20and\x20100.','Filter\x20by\x20role\x20type','string','Use\x20one\x20of:\x20','type','97551QPpRSz','length','toUpperCase','ADMIN','pagesize','role','num','DEV','map','Page\x20index\x20(1-based)','45ZqSYOH','26284536SUJleC','page','read','validation','338868SNFVzq','OWNER'];a234_0xe6fe=function(){return _0x26191f;};return a234_0xe6fe();}const ROLE_TYPES=[a234_0xe43c35(0x7c),a234_0xe43c35(0x80),a234_0xe43c35(0x89),'CUSTOM'];export const roleList={'service':a234_0xe43c35(0x7e),'command':'list','description':'List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','risk':a234_0xe43c35(0x86),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a234_0xe43c35(0x78),'type':a234_0xe43c35(0x76),'required':![],'description':a234_0xe43c35(0x75),'enum':ROLE_TYPES},{'name':a234_0xe43c35(0x85),'type':a234_0xe43c35(0x8f),'description':a234_0xe43c35(0x82),'default':0x1},{'name':a234_0xe43c35(0x7d),'type':a234_0xe43c35(0x8f),'description':'Page\x20size\x20(1-100)','default':0x64}],async 'validate'(_0x14ccf2){const _0x2d9eda=a234_0xe43c35,_0x347e2e=_0x14ccf2[_0x2d9eda(0x8c)](_0x2d9eda(0x78))[_0x2d9eda(0x8d)]();if(_0x347e2e&&!ROLE_TYPES[_0x2d9eda(0x8a)](_0x347e2e[_0x2d9eda(0x7b)]()))throw CliErrors[_0x2d9eda(0x87)]('Invalid\x20--type\x20\x22'+_0x347e2e+'\x22.',_0x2d9eda(0x77)+ROLE_TYPES['join'](',\x20')+'.');const _0x4fb004=_0x14ccf2['num'](_0x2d9eda(0x85),0x1),_0x301f58=_0x14ccf2[_0x2d9eda(0x7f)]('pagesize',0x64);if(_0x4fb004<0x1)throw CliErrors[_0x2d9eda(0x87)](_0x2d9eda(0x8e));if(_0x301f58<0x1||_0x301f58>0x64)throw CliErrors[_0x2d9eda(0x87)](_0x2d9eda(0x74));},async 'execute'(_0x2c5d36){const _0x1bfeea=a234_0xe43c35,_0x11e8d7=_0x2c5d36[_0x1bfeea(0x7f)]('page',0x1)||0x1,_0x3b9a7a=_0x2c5d36[_0x1bfeea(0x7f)]('pagesize',0x64)||0x64,_0x50bf7f=_0x2c5d36[_0x1bfeea(0x8c)]('type')[_0x1bfeea(0x8d)]()['toUpperCase'](),{items:_0x353a88,paging:_0x3a53ec}=await listAppRoles(_0x2c5d36[_0x1bfeea(0x70)],{'currentPage':_0x11e8d7,'pageSize':_0x3b9a7a}),_0x21d68a=_0x50bf7f?_0x353a88['filter'](_0x304134=>_0x304134[_0x1bfeea(0x72)]===_0x50bf7f):_0x353a88,_0xfb8395=_0x21d68a[_0x1bfeea(0x81)](projectRole);return{'ok':!![],'data':{'scope':'dev','roles':_0xfb8395,'paging':_0x3a53ec},'message':_0x1bfeea(0x91)+_0xfb8395[_0x1bfeea(0x7a)]+'\x20role(s)'};}};
1
+ const a234_0x382da7=a234_0x3884;(function(_0x15e2b1,_0x329c1b){const _0x2a0a81=a234_0x3884,_0xf7592f=_0x15e2b1();while(!![]){try{const _0x542d10=-parseInt(_0x2a0a81(0x1bc))/0x1+-parseInt(_0x2a0a81(0x1b7))/0x2+parseInt(_0x2a0a81(0x1b4))/0x3+-parseInt(_0x2a0a81(0x1c3))/0x4*(-parseInt(_0x2a0a81(0x1c6))/0x5)+-parseInt(_0x2a0a81(0x1ba))/0x6*(-parseInt(_0x2a0a81(0x1c5))/0x7)+parseInt(_0x2a0a81(0x1be))/0x8+-parseInt(_0x2a0a81(0x1b0))/0x9*(parseInt(_0x2a0a81(0x1b9))/0xa);if(_0x542d10===_0x329c1b)break;else _0xf7592f['push'](_0xf7592f['shift']());}catch(_0x1ccb9e){_0xf7592f['push'](_0xf7592f['shift']());}}}(a234_0x2f9a,0xeff64));function a234_0x3884(_0x383f5c,_0x40a450){_0x383f5c=_0x383f5c-0x1a7;const _0x2f9a4c=a234_0x2f9a();let _0x388452=_0x2f9a4c[_0x383f5c];return _0x388452;}import{listAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a234_0x2f9a(){const _0x2a055c=['22782rkJEQa','includes','497134btFlSR','number','7940520nOAQPy','join','pagesize','toUpperCase','\x20role(s)','1053736AnXrka','page','1946pMctwm','5mfSYjA','validation','dev','Use\x20one\x20of:\x20','type','num','map','ADMIN','roleType','read','length','string','17152083jkLWwK','--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.','trim','Page\x20size\x20(1-100)','4027224euRKOz','Found\x20','List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','536336ILcWXy','--pagesize\x20must\x20be\x20between\x201\x20and\x20100.','10UIMPZg'];a234_0x2f9a=function(){return _0x2a055c;};return a234_0x2f9a();}import{projectRole}from'../../commands/role/shared.js';const ROLE_TYPES=[a234_0x382da7(0x1ab),'DEV','OWNER','CUSTOM'];export const roleList={'service':'role','command':'list','description':a234_0x382da7(0x1b6),'risk':a234_0x382da7(0x1ad),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a234_0x382da7(0x1a8),'type':a234_0x382da7(0x1af),'required':![],'description':'Filter\x20by\x20role\x20type','enum':ROLE_TYPES},{'name':'page','type':'number','description':'Page\x20index\x20(1-based)','default':0x1},{'name':a234_0x382da7(0x1c0),'type':a234_0x382da7(0x1bd),'description':a234_0x382da7(0x1b3),'default':0x64}],async 'validate'(_0x22e455){const _0x55d51c=a234_0x382da7,_0x36cbe4=_0x22e455['str'](_0x55d51c(0x1a8))[_0x55d51c(0x1b2)]();if(_0x36cbe4&&!ROLE_TYPES[_0x55d51c(0x1bb)](_0x36cbe4[_0x55d51c(0x1c1)]()))throw CliErrors[_0x55d51c(0x1c7)]('Invalid\x20--type\x20\x22'+_0x36cbe4+'\x22.',_0x55d51c(0x1a7)+ROLE_TYPES[_0x55d51c(0x1bf)](',\x20')+'.');const _0x55ded9=_0x22e455[_0x55d51c(0x1a9)](_0x55d51c(0x1c4),0x1),_0x2d8137=_0x22e455['num'](_0x55d51c(0x1c0),0x64);if(_0x55ded9<0x1)throw CliErrors['validation'](_0x55d51c(0x1b1));if(_0x2d8137<0x1||_0x2d8137>0x64)throw CliErrors['validation'](_0x55d51c(0x1b8));},async 'execute'(_0x279004){const _0x35c0f8=a234_0x382da7,_0x982f33=_0x279004[_0x35c0f8(0x1a9)](_0x35c0f8(0x1c4),0x1)||0x1,_0x5110c4=_0x279004[_0x35c0f8(0x1a9)](_0x35c0f8(0x1c0),0x64)||0x64,_0x285bf0=_0x279004['str'](_0x35c0f8(0x1a8))[_0x35c0f8(0x1b2)]()[_0x35c0f8(0x1c1)](),{items:_0x8c2052,paging:_0x2770ab}=await listAppRoles(_0x279004['appCode'],{'currentPage':_0x982f33,'pageSize':_0x5110c4}),_0x2a8987=_0x285bf0?_0x8c2052['filter'](_0x1ce987=>_0x1ce987[_0x35c0f8(0x1ac)]===_0x285bf0):_0x8c2052,_0x3f38e2=_0x2a8987[_0x35c0f8(0x1aa)](projectRole);return{'ok':!![],'data':{'scope':_0x35c0f8(0x1c8),'roles':_0x3f38e2,'paging':_0x2770ab},'message':_0x35c0f8(0x1b5)+_0x3f38e2[_0x35c0f8(0x1ae)]+_0x35c0f8(0x1c2)};}};
@@ -1 +1 @@
1
- const a235_0x42bd67=a235_0x4864;(function(_0x237c02,_0x53a09f){const _0x1322e6=a235_0x4864,_0x25c73c=_0x237c02();while(!![]){try{const _0xd23871=parseInt(_0x1322e6(0xa1))/0x1*(-parseInt(_0x1322e6(0xb5))/0x2)+parseInt(_0x1322e6(0x93))/0x3+parseInt(_0x1322e6(0xb8))/0x4+-parseInt(_0x1322e6(0xd6))/0x5+parseInt(_0x1322e6(0x8b))/0x6+-parseInt(_0x1322e6(0x9e))/0x7+-parseInt(_0x1322e6(0xd1))/0x8*(-parseInt(_0x1322e6(0x8c))/0x9);if(_0xd23871===_0x53a09f)break;else _0x25c73c['push'](_0x25c73c['shift']());}catch(_0x1fb85f){_0x25c73c['push'](_0x25c73c['shift']());}}}(a235_0x103a,0x904a3));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':a235_0x42bd67(0x90),'required':!![],'description':a235_0x42bd67(0xc8)};export const ROLE_REF_FLAG={'name':a235_0x42bd67(0xc9),'type':'string','required':!![],'description':a235_0x42bd67(0xce)};export const USER_REF_FLAG={'name':a235_0x42bd67(0x89),'type':a235_0x42bd67(0x91),'required':!![],'description':a235_0x42bd67(0xa8)};export const NAME_FLAG={'name':a235_0x42bd67(0x9d),'type':a235_0x42bd67(0x91),'required':!![],'description':'Role\x20name'};function a235_0x103a(){const _0xf54554=['user-add','552PugeIz','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','join','CUSTOM','Anti-drift\x20check\x20failed:\x20expected\x20','1793720uaNcMW','appCode','Missing\x20user\x20reference.','expectUserCount','flagMissing','user','tenant_code','1716834jYgKGC','154863PXJQUD','Pass\x20--user\x20<id|name>.','OWNER','Role\x20id\x20','number','string','Missing\x20role\x20reference.','280491vurPGA','test','Multiple\x20tenant\x20members\x20match\x20\x22','roleName','\x20is\x20not\x20a\x20member\x20of\x20role\x20','nickname','\x20member(s)\x20but\x20role\x20has\x20','toLowerCase','/smartapi/permit/user-role/create','permitCount','name','4074518BfaLuF','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','totalCount','93239cYqQyI','trim','userCount','Check\x20the\x20nickname/username.\x20','\x20built-in\x20role\x20','includes','\x22\x20is\x20ambiguous\x20(ids:\x20','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','ADMIN','map','\x22:\x20','User\x20','length','validation','No\x20tenant\x20member\x20matches\x20\x22','flag','expect-user-count','Role\x20name\x20\x22','userId','Pass\x20--role\x20<id|name>.','10WpTcNp','Pass\x20--user\x20<id>.','push','1724420jdXKSa','authRequired','Optional\x20role\x20remark/description','POST','Cannot\x20','tenant','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','Disambiguate\x20with\x20--role\x20<id>.','remark','username',';\x20no\x20change.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','find','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','filter','\x20duplicate\x20memberships\x20for\x20user\x20','Role\x20id\x20(from\x20`role\x20list`)','role','\x20not\x20found\x20in\x20app\x20','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','roleType','DEV','Role\x20id\x20or\x20exact\x20role\x20name','Removed\x20'];a235_0x103a=function(){return _0xf54554;};return a235_0x103a();}export const USER_NAME_FLAG={'name':a235_0x42bd67(0x9d),'type':a235_0x42bd67(0x91),'required':!![],'description':a235_0x42bd67(0xd2)};export const REMARK_FLAG={'name':a235_0x42bd67(0xc0),'type':'string','required':![],'description':a235_0x42bd67(0xba)};export const EXPECT_USER_COUNT_FLAG={'name':a235_0x42bd67(0xb1),'type':a235_0x42bd67(0x90),'required':![],'description':a235_0x42bd67(0xbe)};export const BUILTIN_ROLE_TYPES=[a235_0x42bd67(0xa9),a235_0x42bd67(0xcd),a235_0x42bd67(0x8e)];export function isBuiltinRole(_0x28b1cb){return BUILTIN_ROLE_TYPES['includes'](_0x28b1cb);}export function assertCustomRole(_0x1b1b01,_0x387efa){const _0x48b835=a235_0x42bd67;if(_0x1b1b01['roleType']!==_0x48b835(0xd4))throw CliErrors[_0x48b835(0xae)](_0x48b835(0xbc)+_0x387efa+_0x48b835(0xa5)+_0x1b1b01[_0x48b835(0x96)]+'\x20('+_0x1b1b01[_0x48b835(0xcc)]+').','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.');}export function projectRole(_0xc535c9){const _0x40a547=a235_0x42bd67;return{'id':_0xc535c9['id'],'roleName':_0xc535c9[_0x40a547(0x96)],'roleType':_0xc535c9['roleType'],'remark':_0xc535c9[_0x40a547(0xc0)],'userCount':_0xc535c9[_0x40a547(0xa3)],'permitCount':_0xc535c9[_0x40a547(0x9c)],'builtin':isBuiltinRole(_0xc535c9[_0x40a547(0xcc)])};}export async function resolveRoleRef(_0x121349,_0xe27f86){const _0x2ae1f3=a235_0x42bd67,_0x8d91b7=_0xe27f86['trim']();if(!_0x8d91b7)throw CliErrors[_0x2ae1f3(0xae)](_0x2ae1f3(0x92),_0x2ae1f3(0xb4));if(/^\d+$/['test'](_0x8d91b7))return getRoleById(_0x121349,Number(_0x8d91b7));const _0x33810a=await listAllAppRoles(_0x121349),_0x417e4b=_0x33810a[_0x2ae1f3(0xc6)](_0x163c4f=>_0x163c4f[_0x2ae1f3(0x96)]===_0x8d91b7);if(_0x417e4b[_0x2ae1f3(0xad)]===0x0)throw CliErrors['validation'](_0x2ae1f3(0xb2)+_0x8d91b7+'\x22\x20not\x20found\x20in\x20app\x20'+_0x121349+'.',_0x2ae1f3(0xcb));if(_0x417e4b[_0x2ae1f3(0xad)]>0x1){const _0x59166c=_0x417e4b[_0x2ae1f3(0xaa)](_0xef81e2=>_0xef81e2['id'])[_0x2ae1f3(0xd3)](',\x20');throw CliErrors[_0x2ae1f3(0xae)](_0x2ae1f3(0xb2)+_0x8d91b7+_0x2ae1f3(0xa7)+_0x59166c+').',_0x2ae1f3(0xbf));}return _0x417e4b[0x0];}export async function getRoleById(_0x523218,_0x15b212){const _0x4add52=a235_0x42bd67,_0x3c8cd0=await listAllAppRoles(_0x523218),_0x23bc0d=_0x3c8cd0['filter'](_0x22bdc1=>_0x22bdc1['id']===_0x15b212&&(!_0x22bdc1[_0x4add52(0x85)]||_0x22bdc1[_0x4add52(0x85)]===_0x523218));if(_0x23bc0d[_0x4add52(0xad)]!==0x1)throw CliErrors[_0x4add52(0xae)](_0x4add52(0x8f)+_0x15b212+_0x4add52(0xca)+_0x523218+'.',_0x4add52(0xc3));return _0x23bc0d[0x0];}async function listAllAppRoles(_0xd3b1e6){const _0x2fb27f=a235_0x42bd67,_0x5c459f=0x64,_0x2a9a1c=[];for(let _0xfbd09c=0x1;;_0xfbd09c+=0x1){const {items:_0x19d964,paging:_0xed3432}=await listAppRoles(_0xd3b1e6,{'currentPage':_0xfbd09c,'pageSize':_0x5c459f});_0x2a9a1c[_0x2fb27f(0xb7)](..._0x19d964);if(_0x19d964[_0x2fb27f(0xad)]<_0x5c459f||_0xed3432&&_0x2a9a1c['length']>=_0xed3432[_0x2fb27f(0xa0)])return _0x2a9a1c;}}function a235_0x4864(_0x3a1f79,_0x3c14a1){_0x3a1f79=_0x3a1f79-0x85;const _0x103a43=a235_0x103a();let _0x4864d0=_0x103a43[_0x3a1f79];return _0x4864d0;}export async function resolveTenantCode(){const _0x384555=a235_0x42bd67,_0xa2f55=await getSessionUserInfo(),_0x50301f=_0xa2f55?.[_0x384555(0x89)]?.[_0x384555(0xbd)]?.[_0x384555(0x8a)];if(!_0x50301f)throw CliErrors[_0x384555(0xb9)](_0x384555(0xc5));return _0x50301f;}function matchMember(_0x4a95b3,_0x4368d1){const _0x5be8c1=a235_0x42bd67,_0x3da6f2=_0x4368d1[_0x5be8c1(0xa2)]()[_0x5be8c1(0x9a)]();return(_0x4a95b3[_0x5be8c1(0x98)]??'')[_0x5be8c1(0x9a)]()===_0x3da6f2||(_0x4a95b3[_0x5be8c1(0xc1)]??'')[_0x5be8c1(0x9a)]()===_0x3da6f2;}export async function resolveUserRef(_0x352d58,_0x5b57d2=a235_0x42bd67(0xb6)){const _0x4e26c1=a235_0x42bd67,_0x411576=_0x352d58['trim']();if(!_0x411576)throw CliErrors[_0x4e26c1(0xae)](_0x4e26c1(0x86),_0x4e26c1(0x8d));const _0x4569d1=await resolveTenantCode(),_0x55cdcf=await getTenantMembers(_0x4569d1);if(/^\d+$/[_0x4e26c1(0x94)](_0x411576)){const _0x4926e4=Number(_0x411576),_0x364a7c=_0x55cdcf[_0x4e26c1(0xc4)](_0xbae12a=>_0xbae12a[_0x4e26c1(0xb3)]===_0x4926e4);return{'userId':_0x4926e4,'username':_0x364a7c?.[_0x4e26c1(0xc1)]??String(_0x4926e4),'nickname':_0x364a7c?.['nickname'],'matchedBy':'id'};}const _0x58d967=_0x55cdcf[_0x4e26c1(0xc6)](_0x6bfbad=>matchMember(_0x6bfbad,_0x411576));if(_0x58d967['length']===0x0)throw CliErrors[_0x4e26c1(0xae)](_0x4e26c1(0xaf)+_0x411576+'\x22.',_0x4e26c1(0xa4)+_0x5b57d2);if(_0x58d967[_0x4e26c1(0xad)]>0x1){const _0x10eacd=_0x58d967[_0x4e26c1(0xaa)](_0x28487e=>(_0x28487e['nickname']??_0x28487e[_0x4e26c1(0xc1)]??'?')+'('+_0x28487e[_0x4e26c1(0xb3)]+')')[_0x4e26c1(0xd3)](',\x20');throw CliErrors[_0x4e26c1(0xae)](_0x4e26c1(0x95)+_0x411576+_0x4e26c1(0xab)+_0x10eacd+'.',_0x5b57d2);}const _0x27b813=_0x58d967[0x0];return{'userId':_0x27b813[_0x4e26c1(0xb3)],'username':_0x27b813[_0x4e26c1(0xc1)]??String(_0x27b813[_0x4e26c1(0xb3)]),'nickname':_0x27b813['nickname'],'matchedBy':_0x4e26c1(0x9d)};}export const CREATE_USER_ROLE_PATH=a235_0x42bd67(0x9b);export const DELETE_USER_ROLE_PATH='/smartapi/permit/user-role/delete';export function computeRoleUserMutation(_0x5a7143){const _0x4023e8=a235_0x42bd67,{operation:_0x58ae3b,appCode:_0x1324c6,role:_0x34e7be,relations:_0x1a53da,user:_0x527c27}=_0x5a7143,_0x55c7a0=[...new Set(_0x1a53da[_0x4023e8(0xaa)](_0x5da81f=>_0x5da81f[_0x4023e8(0xb3)]))],_0xf7165=[];if(_0x5a7143[_0x4023e8(0x87)]!==undefined&&_0x5a7143['expectUserCount']!==_0x55c7a0[_0x4023e8(0xad)])throw CliErrors[_0x4023e8(0xae)](_0x4023e8(0xd5)+_0x5a7143[_0x4023e8(0x87)]+_0x4023e8(0x99)+_0x55c7a0['length']+'.',_0x4023e8(0x9f));const _0x57cb0a=_0x55c7a0[_0x4023e8(0xa6)](_0x527c27[_0x4023e8(0xb3)]),_0x4ed776=_0x1a53da[_0x4023e8(0xc6)](_0x124c66=>_0x124c66[_0x4023e8(0xb3)]===_0x527c27[_0x4023e8(0xb3)])[_0x4023e8(0xaa)](_0x1392d6=>_0x1392d6['id']),_0x1d4867=_0x58ae3b==='user-add'?!_0x57cb0a:_0x57cb0a;let _0x3e2a87=_0x55c7a0;_0x58ae3b===_0x4023e8(0xd0)?_0x57cb0a?_0xf7165[_0x4023e8(0xb7)]('User\x20'+_0x527c27[_0x4023e8(0xb3)]+'\x20is\x20already\x20a\x20member\x20of\x20role\x20'+_0x34e7be['roleName']+_0x4023e8(0xc2)):_0x3e2a87=[..._0x55c7a0,_0x527c27[_0x4023e8(0xb3)]]:!_0x57cb0a?_0xf7165[_0x4023e8(0xb7)](_0x4023e8(0xac)+_0x527c27[_0x4023e8(0xb3)]+_0x4023e8(0x97)+_0x34e7be['roleName']+_0x4023e8(0xc2)):(_0x3e2a87=_0x55c7a0[_0x4023e8(0xc6)](_0x530301=>_0x530301!==_0x527c27[_0x4023e8(0xb3)]),_0x4ed776[_0x4023e8(0xad)]>0x1&&_0xf7165[_0x4023e8(0xb7)](_0x4023e8(0xcf)+_0x4ed776[_0x4023e8(0xad)]+_0x4023e8(0xc7)+_0x527c27[_0x4023e8(0xb3)]+'.'));const _0x9f3048={'scope':'dev','operation':_0x58ae3b,'selector':{'appCode':_0x1324c6,'roleId':_0x34e7be['id'],'roleName':_0x34e7be[_0x4023e8(0x96)],'userId':_0x527c27[_0x4023e8(0xb3)]},'before':{'userIds':_0x55c7a0},'after':{'userIds':_0x3e2a87},'dryRun':_0x5a7143['dryRun'],'backend':{'method':_0x4023e8(0xbb),'path':_0x58ae3b===_0x4023e8(0xd0)?CREATE_USER_ROLE_PATH:DELETE_USER_ROLE_PATH},'warnings':_0xf7165};return{'mutation':_0x9f3048,'changed':_0x1d4867,'matchingRelationIds':_0x4ed776};}export async function loadDevRoleRelations(_0x1f7adc,_0x121792){const _0x27638d=a235_0x42bd67,_0x304540=0x64,_0x4eb877=[];for(let _0x3efe88=0x1;;_0x3efe88+=0x1){const {items:_0x1669b0,paging:_0x1ca54b}=await listDevUserRoleRelations(_0x1f7adc,{'roleId':_0x121792,'currentPage':_0x3efe88,'pageSize':_0x304540});_0x4eb877[_0x27638d(0xb7)](..._0x1669b0);if(_0x1669b0[_0x27638d(0xad)]<_0x304540||_0x1ca54b&&_0x4eb877['length']>=_0x1ca54b[_0x27638d(0xa0)])return _0x4eb877;}}export function readRoleRef(_0x49c1de){const _0x59b4a1=a235_0x42bd67,_0x5ef821=_0x49c1de['str']('role')[_0x59b4a1(0xa2)]();if(!_0x5ef821)throw CliErrors[_0x59b4a1(0x88)](_0x59b4a1(0xc9),_0x59b4a1(0xb4));return _0x5ef821;}export async function prepareUserMutation(_0x2020b6,_0x1c43ad,_0x8b4aa){const _0x5e2518=a235_0x42bd67,_0x44e120=readRoleRef(_0x2020b6),_0x1a6ffc=_0x2020b6['str']('user')['trim']();if(!_0x1a6ffc)throw CliErrors[_0x5e2518(0x88)](_0x5e2518(0x89),'Pass\x20--user\x20<id|name>.');const _0x24c225=_0x2020b6[_0x5e2518(0xb0)]('expect-user-count'),_0x4dd89a=_0x24c225===undefined||_0x24c225===null?undefined:Number(_0x24c225),_0x50f9f8=await resolveRoleRef(_0x2020b6[_0x5e2518(0x85)],_0x44e120);if(_0x50f9f8[_0x5e2518(0xcc)]==='OWNER')throw CliErrors[_0x5e2518(0xae)](_0x5e2518(0xbc)+_0x1c43ad+'\x20members\x20of\x20the\x20OWNER\x20role.','Use\x20the\x20platform\x20ownership-transfer\x20workflow\x20to\x20change\x20the\x20application\x20owner.');const _0x47eaec=await resolveUserRef(_0x1a6ffc),_0x377187=await loadDevRoleRelations(_0x2020b6[_0x5e2518(0x85)],_0x50f9f8['id']);return{...computeRoleUserMutation({'operation':_0x1c43ad,'appCode':_0x2020b6[_0x5e2518(0x85)],'role':_0x50f9f8,'relations':_0x377187,'user':{'userId':_0x47eaec[_0x5e2518(0xb3)],'username':_0x47eaec['username'],'nickname':_0x47eaec[_0x5e2518(0x98)]},'dryRun':_0x8b4aa,..._0x4dd89a!==undefined?{'expectUserCount':_0x4dd89a}:{}}),'role':_0x50f9f8,'user':_0x47eaec};}
1
+ function a235_0x1d92(_0x50d2f3,_0x4c9964){_0x50d2f3=_0x50d2f3-0x89;const _0x631f9d=a235_0x631f();let _0x1d9240=_0x631f9d[_0x50d2f3];return _0x1d9240;}const a235_0x166d90=a235_0x1d92;(function(_0xf617f9,_0x5f2cc7){const _0x2f7d0f=a235_0x1d92,_0x504785=_0xf617f9();while(!![]){try{const _0x54dfe7=parseInt(_0x2f7d0f(0xad))/0x1+-parseInt(_0x2f7d0f(0xaa))/0x2*(-parseInt(_0x2f7d0f(0x8f))/0x3)+parseInt(_0x2f7d0f(0x93))/0x4+-parseInt(_0x2f7d0f(0xd0))/0x5+parseInt(_0x2f7d0f(0xc5))/0x6*(-parseInt(_0x2f7d0f(0xab))/0x7)+-parseInt(_0x2f7d0f(0xcf))/0x8*(-parseInt(_0x2f7d0f(0xc4))/0x9)+-parseInt(_0x2f7d0f(0xd8))/0xa;if(_0x54dfe7===_0x5f2cc7)break;else _0x504785['push'](_0x504785['shift']());}catch(_0x3ba0d7){_0x504785['push'](_0x504785['shift']());}}}(a235_0x631f,0xb3159));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':a235_0x166d90(0x9b),'required':!![],'description':'Role\x20id\x20(from\x20`role\x20list`)'};export const ROLE_REF_FLAG={'name':'role','type':'string','required':!![],'description':a235_0x166d90(0xc7)};export const USER_REF_FLAG={'name':'user','type':a235_0x166d90(0xc9),'required':!![],'description':a235_0x166d90(0xa5)};export const NAME_FLAG={'name':a235_0x166d90(0xa2),'type':a235_0x166d90(0xc9),'required':!![],'description':'Role\x20name'};export const USER_NAME_FLAG={'name':'name','type':a235_0x166d90(0xc9),'required':!![],'description':a235_0x166d90(0xa3)};export const REMARK_FLAG={'name':'remark','type':a235_0x166d90(0xc9),'required':![],'description':'Optional\x20role\x20remark/description'};export const EXPECT_USER_COUNT_FLAG={'name':a235_0x166d90(0x9f),'type':'number','required':![],'description':'Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs'};export const BUILTIN_ROLE_TYPES=[a235_0x166d90(0xbf),a235_0x166d90(0xb9),'OWNER'];export function isBuiltinRole(_0x25bc26){const _0x480808=a235_0x166d90;return BUILTIN_ROLE_TYPES[_0x480808(0xb1)](_0x25bc26);}export function assertCustomRole(_0x33d62d,_0x469f93){const _0x1c95c4=a235_0x166d90;if(_0x33d62d[_0x1c95c4(0xb7)]!==_0x1c95c4(0x8a))throw CliErrors[_0x1c95c4(0xa7)]('Cannot\x20'+_0x469f93+_0x1c95c4(0xb8)+_0x33d62d[_0x1c95c4(0xd9)]+'\x20('+_0x33d62d[_0x1c95c4(0xb7)]+').',_0x1c95c4(0x92));}export function projectRole(_0x30e993){const _0x8351ac=a235_0x166d90;return{'id':_0x30e993['id'],'roleName':_0x30e993[_0x8351ac(0xd9)],'roleType':_0x30e993['roleType'],'remark':_0x30e993['remark'],'userCount':_0x30e993[_0x8351ac(0xcd)],'permitCount':_0x30e993[_0x8351ac(0xd2)],'builtin':isBuiltinRole(_0x30e993[_0x8351ac(0xb7)])};}export async function resolveRoleRef(_0x3edba0,_0x5791fe){const _0x452a32=a235_0x166d90,_0x4974d0=_0x5791fe[_0x452a32(0xb3)]();if(!_0x4974d0)throw CliErrors[_0x452a32(0xa7)](_0x452a32(0xb0),'Pass\x20--role\x20<id|name>.');if(/^\d+$/[_0x452a32(0xba)](_0x4974d0))return getRoleById(_0x3edba0,Number(_0x4974d0));const _0x46ed05=await listAllAppRoles(_0x3edba0),_0x15b229=_0x46ed05[_0x452a32(0xb5)](_0x5875e4=>_0x5875e4[_0x452a32(0xd9)]===_0x4974d0);if(_0x15b229['length']===0x0)throw CliErrors[_0x452a32(0xa7)](_0x452a32(0xcc)+_0x4974d0+_0x452a32(0xd5)+_0x3edba0+'.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.');if(_0x15b229[_0x452a32(0xc8)]>0x1){const _0xb4afec=_0x15b229[_0x452a32(0xa9)](_0x13eb99=>_0x13eb99['id'])[_0x452a32(0x8b)](',\x20');throw CliErrors[_0x452a32(0xa7)](_0x452a32(0xcc)+_0x4974d0+_0x452a32(0x8d)+_0xb4afec+').',_0x452a32(0xaf));}return _0x15b229[0x0];}export async function getRoleById(_0x4e7537,_0x415039){const _0x40378c=a235_0x166d90,_0x2a068e=await listAllAppRoles(_0x4e7537),_0x3cb3f7=_0x2a068e[_0x40378c(0xb5)](_0x41ca6b=>_0x41ca6b['id']===_0x415039&&(!_0x41ca6b['appCode']||_0x41ca6b[_0x40378c(0x8e)]===_0x4e7537));if(_0x3cb3f7[_0x40378c(0xc8)]!==0x1)throw CliErrors[_0x40378c(0xa7)](_0x40378c(0x94)+_0x415039+'\x20not\x20found\x20in\x20app\x20'+_0x4e7537+'.',_0x40378c(0xbe));return _0x3cb3f7[0x0];}async function listAllAppRoles(_0x176af8){const _0xa205a8=a235_0x166d90,_0x59110b=0x64,_0x47bc19=[];for(let _0x4a6efc=0x1;;_0x4a6efc+=0x1){const {items:_0x146c98,paging:_0x1ee05d}=await listAppRoles(_0x176af8,{'currentPage':_0x4a6efc,'pageSize':_0x59110b});_0x47bc19[_0xa205a8(0xa6)](..._0x146c98);if(_0x146c98[_0xa205a8(0xc8)]<_0x59110b||_0x1ee05d&&_0x47bc19[_0xa205a8(0xc8)]>=_0x1ee05d[_0xa205a8(0xa8)])return _0x47bc19;}}export async function resolveTenantCode(){const _0x52f6ea=a235_0x166d90,_0x4f08ff=await getSessionUserInfo(),_0x3be4d4=_0x4f08ff?.['user']?.[_0x52f6ea(0x95)]?.[_0x52f6ea(0xc3)];if(!_0x3be4d4)throw CliErrors['authRequired'](_0x52f6ea(0xd4));return _0x3be4d4;}function matchMember(_0xe67eca,_0x25734f){const _0x3e97a4=a235_0x166d90,_0x1b8435=_0x25734f[_0x3e97a4(0xb3)]()[_0x3e97a4(0xd1)]();return(_0xe67eca[_0x3e97a4(0x96)]??'')['toLowerCase']()===_0x1b8435||(_0xe67eca[_0x3e97a4(0x9e)]??'')[_0x3e97a4(0xd1)]()===_0x1b8435;}export async function resolveUserRef(_0x54a16f,_0xf9244f=a235_0x166d90(0x9a)){const _0x20f75d=a235_0x166d90,_0x31add0=_0x54a16f[_0x20f75d(0xb3)]();if(!_0x31add0)throw CliErrors[_0x20f75d(0xa7)](_0x20f75d(0x99),_0x20f75d(0xb6));const _0x5e2f1d=await resolveTenantCode(),_0x3ccab8=await getTenantMembers(_0x5e2f1d);if(/^\d+$/[_0x20f75d(0xba)](_0x31add0)){const _0xfb408=Number(_0x31add0),_0x851d87=_0x3ccab8[_0x20f75d(0x8c)](_0x53b5b9=>_0x53b5b9['userId']===_0xfb408);return{'userId':_0xfb408,'username':_0x851d87?.[_0x20f75d(0x9e)]??String(_0xfb408),'nickname':_0x851d87?.[_0x20f75d(0x96)],'matchedBy':'id'};}const _0x54849a=_0x3ccab8[_0x20f75d(0xb5)](_0x460e94=>matchMember(_0x460e94,_0x31add0));if(_0x54849a[_0x20f75d(0xc8)]===0x0)throw CliErrors[_0x20f75d(0xa7)]('No\x20tenant\x20member\x20matches\x20\x22'+_0x31add0+'\x22.',_0x20f75d(0xae)+_0xf9244f);if(_0x54849a[_0x20f75d(0xc8)]>0x1){const _0x3742b8=_0x54849a[_0x20f75d(0xa9)](_0x59dc4a=>(_0x59dc4a[_0x20f75d(0x96)]??_0x59dc4a[_0x20f75d(0x9e)]??'?')+'('+_0x59dc4a[_0x20f75d(0x89)]+')')[_0x20f75d(0x8b)](',\x20');throw CliErrors[_0x20f75d(0xa7)]('Multiple\x20tenant\x20members\x20match\x20\x22'+_0x31add0+_0x20f75d(0xac)+_0x3742b8+'.',_0xf9244f);}const _0x4a8003=_0x54849a[0x0];return{'userId':_0x4a8003['userId'],'username':_0x4a8003[_0x20f75d(0x9e)]??String(_0x4a8003['userId']),'nickname':_0x4a8003[_0x20f75d(0x96)],'matchedBy':'name'};}export const CREATE_USER_ROLE_PATH=a235_0x166d90(0xb4);export const DELETE_USER_ROLE_PATH=a235_0x166d90(0x97);function a235_0x631f(){const _0x26d94c=['769432LsyDEI','4360980wDtZCO','toLowerCase','permitCount','Use\x20the\x20platform\x20ownership-transfer\x20workflow\x20to\x20change\x20the\x20application\x20owner.','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','\x22\x20not\x20found\x20in\x20app\x20','POST','flag','19887950vnBBeo','roleName','userId','CUSTOM','join','find','\x22\x20is\x20ambiguous\x20(ids:\x20','appCode','3LbzpxR','\x20duplicate\x20memberships\x20for\x20user\x20','User\x20','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','4971072cAQWfu','Role\x20id\x20','tenant','nickname','/smartapi/permit/user-role/delete','Anti-drift\x20check\x20failed:\x20expected\x20','Missing\x20user\x20reference.','Pass\x20--user\x20<id>.','number','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','Cannot\x20','username','expect-user-count','OWNER','flagMissing','name','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','expectUserCount','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','push','validation','totalCount','map','1039146Qvxzjf','1844836FyGZnL','\x22:\x20','1443686jtDhfH','Check\x20the\x20nickname/username.\x20','Disambiguate\x20with\x20--role\x20<id>.','Missing\x20role\x20reference.','includes','\x20is\x20already\x20a\x20member\x20of\x20role\x20','trim','/smartapi/permit/user-role/create','filter','Pass\x20--user\x20<id|name>.','roleType','\x20built-in\x20role\x20','DEV','test','dev','dryRun','user-add','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','ADMIN','\x20members\x20of\x20the\x20OWNER\x20role.','\x20is\x20not\x20a\x20member\x20of\x20role\x20','str','tenant_code','135exRcVS','24uzNNXd','user','Role\x20id\x20or\x20exact\x20role\x20name','length','string','role',';\x20no\x20change.','Role\x20name\x20\x22','userCount','\x20member(s)\x20but\x20role\x20has\x20'];a235_0x631f=function(){return _0x26d94c;};return a235_0x631f();}export function computeRoleUserMutation(_0x395bfb){const _0x28c0ed=a235_0x166d90,{operation:_0x18d905,appCode:_0x3fffd8,role:_0x37ffa9,relations:_0x1ac5ba,user:_0x2f23c5}=_0x395bfb,_0x234c64=[...new Set(_0x1ac5ba[_0x28c0ed(0xa9)](_0xcf9fc0=>_0xcf9fc0[_0x28c0ed(0x89)]))],_0x1b9b33=[];if(_0x395bfb[_0x28c0ed(0xa4)]!==undefined&&_0x395bfb[_0x28c0ed(0xa4)]!==_0x234c64[_0x28c0ed(0xc8)])throw CliErrors[_0x28c0ed(0xa7)](_0x28c0ed(0x98)+_0x395bfb[_0x28c0ed(0xa4)]+_0x28c0ed(0xce)+_0x234c64[_0x28c0ed(0xc8)]+'.',_0x28c0ed(0x9c));const _0x10c6a5=_0x234c64[_0x28c0ed(0xb1)](_0x2f23c5[_0x28c0ed(0x89)]),_0x1a160c=_0x1ac5ba['filter'](_0x1be26e=>_0x1be26e[_0x28c0ed(0x89)]===_0x2f23c5[_0x28c0ed(0x89)])['map'](_0x2adbee=>_0x2adbee['id']),_0x585083=_0x18d905===_0x28c0ed(0xbd)?!_0x10c6a5:_0x10c6a5;let _0x3905d0=_0x234c64;_0x18d905===_0x28c0ed(0xbd)?_0x10c6a5?_0x1b9b33[_0x28c0ed(0xa6)](_0x28c0ed(0x91)+_0x2f23c5['userId']+_0x28c0ed(0xb2)+_0x37ffa9[_0x28c0ed(0xd9)]+';\x20no\x20change.'):_0x3905d0=[..._0x234c64,_0x2f23c5[_0x28c0ed(0x89)]]:!_0x10c6a5?_0x1b9b33[_0x28c0ed(0xa6)](_0x28c0ed(0x91)+_0x2f23c5[_0x28c0ed(0x89)]+_0x28c0ed(0xc1)+_0x37ffa9[_0x28c0ed(0xd9)]+_0x28c0ed(0xcb)):(_0x3905d0=_0x234c64[_0x28c0ed(0xb5)](_0x4af92d=>_0x4af92d!==_0x2f23c5[_0x28c0ed(0x89)]),_0x1a160c[_0x28c0ed(0xc8)]>0x1&&_0x1b9b33[_0x28c0ed(0xa6)]('Removed\x20'+_0x1a160c[_0x28c0ed(0xc8)]+_0x28c0ed(0x90)+_0x2f23c5[_0x28c0ed(0x89)]+'.'));const _0x1e53c3={'scope':_0x28c0ed(0xbb),'operation':_0x18d905,'selector':{'appCode':_0x3fffd8,'roleId':_0x37ffa9['id'],'roleName':_0x37ffa9['roleName'],'userId':_0x2f23c5[_0x28c0ed(0x89)]},'before':{'userIds':_0x234c64},'after':{'userIds':_0x3905d0},'dryRun':_0x395bfb[_0x28c0ed(0xbc)],'backend':{'method':_0x28c0ed(0xd6),'path':_0x18d905===_0x28c0ed(0xbd)?CREATE_USER_ROLE_PATH:DELETE_USER_ROLE_PATH},'warnings':_0x1b9b33};return{'mutation':_0x1e53c3,'changed':_0x585083,'matchingRelationIds':_0x1a160c};}export async function loadDevRoleRelations(_0x13f877,_0x15927e){const _0x35fe7b=a235_0x166d90,_0x4c6d4d=0x64,_0x5f58b0=[];for(let _0x14b8a0=0x1;;_0x14b8a0+=0x1){const {items:_0x3ba842,paging:_0x43f0a2}=await listDevUserRoleRelations(_0x13f877,{'roleId':_0x15927e,'currentPage':_0x14b8a0,'pageSize':_0x4c6d4d});_0x5f58b0[_0x35fe7b(0xa6)](..._0x3ba842);if(_0x3ba842['length']<_0x4c6d4d||_0x43f0a2&&_0x5f58b0[_0x35fe7b(0xc8)]>=_0x43f0a2['totalCount'])return _0x5f58b0;}}export function readRoleRef(_0x580f78){const _0x3b25c4=a235_0x166d90,_0x2f4113=_0x580f78[_0x3b25c4(0xc2)](_0x3b25c4(0xca))[_0x3b25c4(0xb3)]();if(!_0x2f4113)throw CliErrors[_0x3b25c4(0xa1)](_0x3b25c4(0xca),'Pass\x20--role\x20<id|name>.');return _0x2f4113;}export async function prepareUserMutation(_0x534889,_0x124f4b,_0x2ee37a){const _0x15e6c8=a235_0x166d90,_0x12c92d=readRoleRef(_0x534889),_0x51f0f4=_0x534889[_0x15e6c8(0xc2)](_0x15e6c8(0xc6))[_0x15e6c8(0xb3)]();if(!_0x51f0f4)throw CliErrors[_0x15e6c8(0xa1)](_0x15e6c8(0xc6),_0x15e6c8(0xb6));const _0x2f025a=_0x534889[_0x15e6c8(0xd7)](_0x15e6c8(0x9f)),_0x20ea89=_0x2f025a===undefined||_0x2f025a===null?undefined:Number(_0x2f025a),_0x48fd32=await resolveRoleRef(_0x534889[_0x15e6c8(0x8e)],_0x12c92d);if(_0x48fd32['roleType']===_0x15e6c8(0xa0))throw CliErrors[_0x15e6c8(0xa7)](_0x15e6c8(0x9d)+_0x124f4b+_0x15e6c8(0xc0),_0x15e6c8(0xd3));const _0x48dc57=await resolveUserRef(_0x51f0f4),_0x2c8738=await loadDevRoleRelations(_0x534889[_0x15e6c8(0x8e)],_0x48fd32['id']);return{...computeRoleUserMutation({'operation':_0x124f4b,'appCode':_0x534889[_0x15e6c8(0x8e)],'role':_0x48fd32,'relations':_0x2c8738,'user':{'userId':_0x48dc57[_0x15e6c8(0x89)],'username':_0x48dc57[_0x15e6c8(0x9e)],'nickname':_0x48dc57[_0x15e6c8(0x96)]},'dryRun':_0x2ee37a,..._0x20ea89!==undefined?{'expectUserCount':_0x20ea89}:{}}),'role':_0x48fd32,'user':_0x48dc57};}
@@ -1 +1 @@
1
- const a236_0xc7d84b=a236_0x3bdd;function a236_0x300a(){const _0x3a0f80=['2393867oipBtT','write','name','Nothing\x20to\x20update.','num','2036504OtPEfH','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','string','170401djWaXq','flag','1555UWIZgR','length','update','\x20(id=','6ZZynoS','remark','role','2346192FGkJll','New\x20role\x20name','dev','appCode','validation','Updated\x20role\x20','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','roleName','472414ubfizJ','POST','3504pgZzbP','trim','13860513VKMgPS'];a236_0x300a=function(){return _0x3a0f80;};return a236_0x300a();}(function(_0x5a0b13,_0x440c2e){const _0x852b79=a236_0x3bdd,_0x1e9b30=_0x5a0b13();while(!![]){try{const _0x4d4a71=-parseInt(_0x852b79(0x1d9))/0x1+-parseInt(_0x852b79(0x1ea))/0x2*(parseInt(_0x852b79(0x1df))/0x3)+parseInt(_0x852b79(0x1ce))/0x4*(-parseInt(_0x852b79(0x1db))/0x5)+parseInt(_0x852b79(0x1e2))/0x6+-parseInt(_0x852b79(0x1d1))/0x7+-parseInt(_0x852b79(0x1d6))/0x8+parseInt(_0x852b79(0x1d0))/0x9;if(_0x4d4a71===_0x440c2e)break;else _0x1e9b30['push'](_0x1e9b30['shift']());}catch(_0x52a3b9){_0x1e9b30['push'](_0x1e9b30['shift']());}}}(a236_0x300a,0x665de));function a236_0x3bdd(_0x459399,_0x5311f9){_0x459399=_0x459399-0x1cd;const _0x300a82=a236_0x300a();let _0x3bdd2e=_0x300a82[_0x459399];return _0x3bdd2e;}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='/smartapi/permit/role/update';function readPatch(_0x3a226f){const _0x2ec5e5=a236_0x3bdd,_0x16aaeb=_0x3a226f[_0x2ec5e5(0x1da)](_0x2ec5e5(0x1d3)),_0x339d90=_0x3a226f[_0x2ec5e5(0x1da)](_0x2ec5e5(0x1e0)),_0xb07edc={};if(_0x16aaeb!==undefined&&_0x16aaeb!==null){const _0xe7afec=String(_0x16aaeb)[_0x2ec5e5(0x1cf)]();if(!_0xe7afec)throw CliErrors[_0x2ec5e5(0x1e6)]('--name\x20cannot\x20be\x20empty.');if(_0xe7afec[_0x2ec5e5(0x1dc)]>0x40)throw CliErrors[_0x2ec5e5(0x1e6)](_0x2ec5e5(0x1d7));_0xb07edc[_0x2ec5e5(0x1e9)]=_0xe7afec;}_0x339d90!==undefined&&_0x339d90!==null&&(_0xb07edc[_0x2ec5e5(0x1e0)]=String(_0x339d90));if(_0xb07edc['roleName']===undefined&&_0xb07edc[_0x2ec5e5(0x1e0)]===undefined)throw CliErrors[_0x2ec5e5(0x1e6)](_0x2ec5e5(0x1d4),_0x2ec5e5(0x1e8));return _0xb07edc;}export const roleUpdate={'service':a236_0xc7d84b(0x1e1),'command':a236_0xc7d84b(0x1dd),'description':'Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(built-in\x20roles\x20rejected)','risk':a236_0xc7d84b(0x1d2),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':'name','type':a236_0xc7d84b(0x1d8),'required':![],'description':a236_0xc7d84b(0x1e3)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x535166){readPatch(_0x535166);},async 'dryRun'(_0x36808b){const _0x547f85=a236_0xc7d84b,_0x47acbf=_0x36808b[_0x547f85(0x1d5)]('id'),_0x40d1fb=readPatch(_0x36808b),_0x156609=await getRoleById(_0x36808b[_0x547f85(0x1e5)],_0x47acbf);return assertCustomRole(_0x156609,_0x547f85(0x1dd)),asDryRunResult({'scope':_0x547f85(0x1e4),'operation':_0x547f85(0x1dd),'selector':{'appCode':_0x36808b[_0x547f85(0x1e5)],'roleId':_0x47acbf,'roleName':_0x156609[_0x547f85(0x1e9)]},'before':projectRole(_0x156609),'after':projectRole({..._0x156609,..._0x40d1fb[_0x547f85(0x1e9)]!==undefined?{'roleName':_0x40d1fb['roleName']}:{},..._0x40d1fb[_0x547f85(0x1e0)]!==undefined?{'remark':_0x40d1fb[_0x547f85(0x1e0)]}:{}}),'dryRun':!![],'backend':{'method':_0x547f85(0x1cd),'path':UPDATE_PATH},'warnings':[]},{'method':_0x547f85(0x1cd),'url':UPDATE_PATH});},async 'execute'(_0xc9a5a){const _0x5e1427=a236_0xc7d84b,_0x2de37e=_0xc9a5a[_0x5e1427(0x1d5)]('id'),_0x46eba1=readPatch(_0xc9a5a),_0x57ab9a=await getRoleById(_0xc9a5a[_0x5e1427(0x1e5)],_0x2de37e);assertCustomRole(_0x57ab9a,_0x5e1427(0x1dd)),await updateAppRole({'id':_0x2de37e,'appCode':_0xc9a5a[_0x5e1427(0x1e5)],..._0x46eba1[_0x5e1427(0x1e9)]!==undefined?{'roleName':_0x46eba1['roleName']}:{},..._0x46eba1[_0x5e1427(0x1e0)]!==undefined?{'remark':_0x46eba1[_0x5e1427(0x1e0)]}:{}});const _0x109688=await getRoleById(_0xc9a5a[_0x5e1427(0x1e5)],_0x2de37e);return{'ok':!![],'data':{'scope':'dev','operation':_0x5e1427(0x1dd),'selector':{'appCode':_0xc9a5a[_0x5e1427(0x1e5)],'roleId':_0x2de37e,'roleName':_0x109688[_0x5e1427(0x1e9)]},'before':projectRole(_0x57ab9a),'after':projectRole(_0x109688),'dryRun':![],'backend':{'method':'POST','path':UPDATE_PATH},'warnings':[]},'message':_0x5e1427(0x1e7)+_0x109688['roleName']+_0x5e1427(0x1de)+_0x2de37e+')'};}};
1
+ function a236_0x27a7(_0x29e97e,_0x477ba5){_0x29e97e=_0x29e97e-0x19b;const _0x548350=a236_0x5483();let _0x27a7ec=_0x548350[_0x29e97e];return _0x27a7ec;}const a236_0xfed65d=a236_0x27a7;(function(_0x39a551,_0x4a6338){const _0x4e675a=a236_0x27a7,_0x257068=_0x39a551();while(!![]){try{const _0x49593e=parseInt(_0x4e675a(0x1af))/0x1+-parseInt(_0x4e675a(0x1a7))/0x2*(-parseInt(_0x4e675a(0x1b0))/0x3)+-parseInt(_0x4e675a(0x1b1))/0x4+-parseInt(_0x4e675a(0x1ae))/0x5*(parseInt(_0x4e675a(0x1b9))/0x6)+parseInt(_0x4e675a(0x1a5))/0x7*(-parseInt(_0x4e675a(0x1b4))/0x8)+-parseInt(_0x4e675a(0x1ab))/0x9*(-parseInt(_0x4e675a(0x19f))/0xa)+-parseInt(_0x4e675a(0x1a0))/0xb;if(_0x49593e===_0x4a6338)break;else _0x257068['push'](_0x257068['shift']());}catch(_0x3a13a8){_0x257068['push'](_0x257068['shift']());}}}(a236_0x5483,0xb6f81));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 a236_0x5483(){const _0x17a0bd=['name','5877pOduDn','dev','appCode','2011155bImJXY','1320712vzKAjX','125841UnoQBH','189020cIlScJ','POST','validation','192GdCzCY','\x20(id=','Nothing\x20to\x20update.','/smartapi/permit/role/update','--name\x20cannot\x20be\x20empty.','12CvwOuq','update','flag','roleName','role','10940FoHsjk','16595623cjfVvw','remark','Updated\x20role\x20','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(built-in\x20roles\x20rejected)','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','65800kkAany','num','62uegwyc','New\x20role\x20name','write'];a236_0x5483=function(){return _0x17a0bd;};return a236_0x5483();}const UPDATE_PATH=a236_0xfed65d(0x1b7);function readPatch(_0x598887){const _0x5695bc=a236_0xfed65d,_0x2a2413=_0x598887['flag'](_0x5695bc(0x1aa)),_0x4d14cf=_0x598887[_0x5695bc(0x19c)](_0x5695bc(0x1a1)),_0x1836ac={};if(_0x2a2413!==undefined&&_0x2a2413!==null){const _0xdb1231=String(_0x2a2413)['trim']();if(!_0xdb1231)throw CliErrors['validation'](_0x5695bc(0x1b8));if(_0xdb1231['length']>0x40)throw CliErrors['validation'](_0x5695bc(0x1a4));_0x1836ac[_0x5695bc(0x19d)]=_0xdb1231;}_0x4d14cf!==undefined&&_0x4d14cf!==null&&(_0x1836ac[_0x5695bc(0x1a1)]=String(_0x4d14cf));if(_0x1836ac[_0x5695bc(0x19d)]===undefined&&_0x1836ac['remark']===undefined)throw CliErrors[_0x5695bc(0x1b3)](_0x5695bc(0x1b6),'Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.');return _0x1836ac;}export const roleUpdate={'service':a236_0xfed65d(0x19e),'command':'update','description':a236_0xfed65d(0x1a3),'risk':a236_0xfed65d(0x1a9),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a236_0xfed65d(0x1aa),'type':'string','required':![],'description':a236_0xfed65d(0x1a8)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x2cd8a2){readPatch(_0x2cd8a2);},async 'dryRun'(_0x4c0fb2){const _0x470b00=a236_0xfed65d,_0x2525a5=_0x4c0fb2[_0x470b00(0x1a6)]('id'),_0x107119=readPatch(_0x4c0fb2),_0x4c5689=await getRoleById(_0x4c0fb2[_0x470b00(0x1ad)],_0x2525a5);return assertCustomRole(_0x4c5689,_0x470b00(0x19b)),asDryRunResult({'scope':_0x470b00(0x1ac),'operation':_0x470b00(0x19b),'selector':{'appCode':_0x4c0fb2[_0x470b00(0x1ad)],'roleId':_0x2525a5,'roleName':_0x4c5689[_0x470b00(0x19d)]},'before':projectRole(_0x4c5689),'after':projectRole({..._0x4c5689,..._0x107119[_0x470b00(0x19d)]!==undefined?{'roleName':_0x107119[_0x470b00(0x19d)]}:{},..._0x107119[_0x470b00(0x1a1)]!==undefined?{'remark':_0x107119['remark']}:{}}),'dryRun':!![],'backend':{'method':_0x470b00(0x1b2),'path':UPDATE_PATH},'warnings':[]},{'method':_0x470b00(0x1b2),'url':UPDATE_PATH});},async 'execute'(_0x2c8627){const _0x1a24e6=a236_0xfed65d,_0x423ad5=_0x2c8627[_0x1a24e6(0x1a6)]('id'),_0x493c52=readPatch(_0x2c8627),_0x58a36e=await getRoleById(_0x2c8627['appCode'],_0x423ad5);assertCustomRole(_0x58a36e,_0x1a24e6(0x19b)),await updateAppRole({'id':_0x423ad5,'appCode':_0x2c8627[_0x1a24e6(0x1ad)],..._0x493c52[_0x1a24e6(0x19d)]!==undefined?{'roleName':_0x493c52[_0x1a24e6(0x19d)]}:{},..._0x493c52['remark']!==undefined?{'remark':_0x493c52[_0x1a24e6(0x1a1)]}:{}});const _0xd0af3f=await getRoleById(_0x2c8627[_0x1a24e6(0x1ad)],_0x423ad5);return{'ok':!![],'data':{'scope':_0x1a24e6(0x1ac),'operation':'update','selector':{'appCode':_0x2c8627[_0x1a24e6(0x1ad)],'roleId':_0x423ad5,'roleName':_0xd0af3f[_0x1a24e6(0x19d)]},'before':projectRole(_0x58a36e),'after':projectRole(_0xd0af3f),'dryRun':![],'backend':{'method':_0x1a24e6(0x1b2),'path':UPDATE_PATH},'warnings':[]},'message':_0x1a24e6(0x1a2)+_0xd0af3f[_0x1a24e6(0x19d)]+_0x1a24e6(0x1b5)+_0x423ad5+')'};}};
@@ -1 +1 @@
1
- function a237_0x345e(){const _0x39781c=['role','appCode','543034gemnEa','No\x20change:\x20user\x20','roleName','8IAceSK','12265749lvsJGg','7739424DzBGOG','5910110vbMdqw','roleId','Added\x20user\x20','Add\x20a\x20user\x20to\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','selector','username','2252548qPVQEC','1OvYOIQ','10kxOcdq','\x20to\x20role\x20','userId','POST','913176idFuVB','\x20already\x20in\x20role\x20','6813695VByHbK','user-add'];a237_0x345e=function(){return _0x39781c;};return a237_0x345e();}function a237_0x3499(_0x2657c0,_0x2d2729){_0x2657c0=_0x2657c0-0x8c;const _0x345ed5=a237_0x345e();let _0x349958=_0x345ed5[_0x2657c0];return _0x349958;}const a237_0xa153b=a237_0x3499;(function(_0xd63a7f,_0x42278d){const _0x3383f6=a237_0x3499,_0x541c73=_0xd63a7f();while(!![]){try{const _0xb5e24e=parseInt(_0x3383f6(0xa1))/0x1*(-parseInt(_0x3383f6(0x94))/0x2)+parseInt(_0x3383f6(0x8e))/0x3+-parseInt(_0x3383f6(0xa0))/0x4*(-parseInt(_0x3383f6(0xa2))/0x5)+parseInt(_0x3383f6(0x99))/0x6+-parseInt(_0x3383f6(0x90))/0x7+-parseInt(_0x3383f6(0x97))/0x8*(parseInt(_0x3383f6(0x98))/0x9)+parseInt(_0x3383f6(0x9a))/0xa;if(_0xb5e24e===_0x42278d)break;else _0x541c73['push'](_0x541c73['shift']());}catch(_0x18e612){_0x541c73['push'](_0x541c73['shift']());}}}(a237_0x345e,0xabd4a));import{createDevUserRole}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,CREATE_USER_ROLE_PATH,prepareUserMutation,ROLE_REF_FLAG,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserAdd={'service':a237_0xa153b(0x92),'command':'user-add','description':a237_0xa153b(0x9d),'risk':'high-risk-write','flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x3763f9){const _0x2bb581=a237_0xa153b,{mutation:_0x5d87b0}=await prepareUserMutation(_0x3763f9,_0x2bb581(0x91),!![]);return asDryRunResult(_0x5d87b0,{'method':_0x2bb581(0x8d),'url':CREATE_USER_ROLE_PATH});},async 'execute'(_0x12a78c){const _0x1db9a1=a237_0xa153b,{mutation:_0x4526fa,changed:_0x3bab2a,role:_0x15987c,user:_0x43eae3}=await prepareUserMutation(_0x12a78c,'user-add',![]);return _0x3bab2a&&await createDevUserRole({'appCode':_0x12a78c[_0x1db9a1(0x93)],'userId':_0x43eae3[_0x1db9a1(0x8c)],'username':_0x43eae3[_0x1db9a1(0x9f)],'roleType':_0x15987c['roleType'],'roleId':_0x4526fa[_0x1db9a1(0x9e)][_0x1db9a1(0x9b)]}),{'ok':!![],'data':_0x4526fa,'message':_0x3bab2a?_0x1db9a1(0x9c)+_0x4526fa['selector'][_0x1db9a1(0x8c)]+_0x1db9a1(0xa3)+_0x4526fa[_0x1db9a1(0x9e)]['roleName']:_0x1db9a1(0x95)+_0x4526fa[_0x1db9a1(0x9e)][_0x1db9a1(0x8c)]+_0x1db9a1(0x8f)+_0x4526fa[_0x1db9a1(0x9e)][_0x1db9a1(0x96)]};}};
1
+ const a237_0x5a59d3=a237_0x5c84;function a237_0x5c84(_0x3a0cf4,_0x7c5af8){_0x3a0cf4=_0x3a0cf4-0x75;const _0x1349f7=a237_0x1349();let _0x5c8431=_0x1349f7[_0x3a0cf4];return _0x5c8431;}(function(_0x47950e,_0x1897f1){const _0x4beea4=a237_0x5c84,_0x2e2def=_0x47950e();while(!![]){try{const _0x3b84f7=-parseInt(_0x4beea4(0x80))/0x1*(parseInt(_0x4beea4(0x83))/0x2)+parseInt(_0x4beea4(0x87))/0x3*(parseInt(_0x4beea4(0x7f))/0x4)+parseInt(_0x4beea4(0x81))/0x5*(-parseInt(_0x4beea4(0x85))/0x6)+-parseInt(_0x4beea4(0x8e))/0x7*(-parseInt(_0x4beea4(0x8d))/0x8)+-parseInt(_0x4beea4(0x76))/0x9*(-parseInt(_0x4beea4(0x7a))/0xa)+parseInt(_0x4beea4(0x88))/0xb+-parseInt(_0x4beea4(0x86))/0xc;if(_0x3b84f7===_0x1897f1)break;else _0x2e2def['push'](_0x2e2def['shift']());}catch(_0x27c684){_0x2e2def['push'](_0x2e2def['shift']());}}}(a237_0x1349,0xd4603));import{createDevUserRole}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,CREATE_USER_ROLE_PATH,prepareUserMutation,ROLE_REF_FLAG,USER_REF_FLAG}from'../../commands/role/shared.js';function a237_0x1349(){const _0x2c45e6=['\x20already\x20in\x20role\x20','POST','12MclFhZ','14437HzQmJF','2584675LkdLBm','\x20to\x20role\x20','22nlZGXo','No\x20change:\x20user\x20','6sSTIlm','25977528Rsxwdh','718173IeAizm','14948956thIJqA','userId','appCode','selector','high-risk-write','8VWxQnM','4609045YnxMZQ','role','8773407sRVqzI','Added\x20user\x20','roleName','user-add','10ahJfDp','username','roleType'];a237_0x1349=function(){return _0x2c45e6;};return a237_0x1349();}export const roleUserAdd={'service':a237_0x5a59d3(0x75),'command':a237_0x5a59d3(0x79),'description':'Add\x20a\x20user\x20to\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','risk':a237_0x5a59d3(0x8c),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0xbd61f8){const _0x77fd38=a237_0x5a59d3,{mutation:_0x149fe0}=await prepareUserMutation(_0xbd61f8,'user-add',!![]);return asDryRunResult(_0x149fe0,{'method':_0x77fd38(0x7e),'url':CREATE_USER_ROLE_PATH});},async 'execute'(_0x1b52ae){const _0x4ae38d=a237_0x5a59d3,{mutation:_0x35dbff,changed:_0x3dd12e,role:_0x784608,user:_0x43c57a}=await prepareUserMutation(_0x1b52ae,_0x4ae38d(0x79),![]);return _0x3dd12e&&await createDevUserRole({'appCode':_0x1b52ae[_0x4ae38d(0x8a)],'userId':_0x43c57a[_0x4ae38d(0x89)],'username':_0x43c57a[_0x4ae38d(0x7b)],'roleType':_0x784608[_0x4ae38d(0x7c)],'roleId':_0x35dbff['selector']['roleId']}),{'ok':!![],'data':_0x35dbff,'message':_0x3dd12e?_0x4ae38d(0x77)+_0x35dbff['selector'][_0x4ae38d(0x89)]+_0x4ae38d(0x82)+_0x35dbff[_0x4ae38d(0x8b)][_0x4ae38d(0x78)]:_0x4ae38d(0x84)+_0x35dbff[_0x4ae38d(0x8b)][_0x4ae38d(0x89)]+_0x4ae38d(0x7d)+_0x35dbff[_0x4ae38d(0x8b)][_0x4ae38d(0x78)]};}};
@@ -1 +1 @@
1
- const a238_0x40d8c7=a238_0x3960;(function(_0x61923d,_0x2fe730){const _0xf1f517=a238_0x3960,_0x25f794=_0x61923d();while(!![]){try{const _0x132627=parseInt(_0xf1f517(0xc1))/0x1+-parseInt(_0xf1f517(0xbe))/0x2+parseInt(_0xf1f517(0xb0))/0x3+-parseInt(_0xf1f517(0xba))/0x4*(parseInt(_0xf1f517(0xbb))/0x5)+-parseInt(_0xf1f517(0xb6))/0x6*(-parseInt(_0xf1f517(0xc2))/0x7)+parseInt(_0xf1f517(0xb8))/0x8+-parseInt(_0xf1f517(0xbc))/0x9*(parseInt(_0xf1f517(0xb3))/0xa);if(_0x132627===_0x2fe730)break;else _0x25f794['push'](_0x25f794['shift']());}catch(_0x30e0ec){_0x25f794['push'](_0x25f794['shift']());}}}(a238_0x21de,0x6434c));import{deleteDevUserRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a238_0x3960(_0x21a759,_0x283d71){_0x21a759=_0x21a759-0xaf;const _0x21dee4=a238_0x21de();let _0x396035=_0x21dee4[_0x21a759];return _0x396035;}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';export const roleUserRemove={'service':'role','command':a238_0x40d8c7(0xb2),'description':a238_0x40d8c7(0xaf),'risk':a238_0x40d8c7(0xb4),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x343440){const _0x51ea45=a238_0x40d8c7,{mutation:_0x1302a2}=await prepareUserMutation(_0x343440,_0x51ea45(0xb2),!![]);return asDryRunResult(_0x1302a2,{'method':_0x51ea45(0xbd),'url':DELETE_USER_ROLE_PATH});},async 'execute'(_0x470fde){const _0x57a766=a238_0x40d8c7,{matchingRelationIds:_0x3eb5ff,mutation:_0x3461c1,changed:_0x4eb68b}=await prepareUserMutation(_0x470fde,_0x57a766(0xb2),![]);if(_0x4eb68b)for(const _0x581e04 of _0x3eb5ff){await deleteDevUserRole(_0x581e04);}return{'ok':!![],'data':_0x3461c1,'message':_0x4eb68b?_0x57a766(0xb5)+_0x3461c1[_0x57a766(0xb9)][_0x57a766(0xb7)]+_0x57a766(0xbf)+_0x3461c1[_0x57a766(0xb9)][_0x57a766(0xb1)]:_0x57a766(0xc0)+_0x3461c1['selector'][_0x57a766(0xb7)]+'\x20not\x20in\x20role\x20'+_0x3461c1[_0x57a766(0xb9)][_0x57a766(0xb1)]};}};function a238_0x21de(){const _0x4bc903=['POST','1597700mhMGOi','\x20from\x20role\x20','No\x20change:\x20user\x20','487227eFuTZM','7xleILa','Remove\x20a\x20user\x20from\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','1191222nTAvIA','roleName','user-remove','10lpBFWq','high-risk-write','Removed\x20user\x20','4882230KCuZMK','userId','1774464pIFUtG','selector','460748ZDxesr','5qrqWZD','5357997DWEVuV'];a238_0x21de=function(){return _0x4bc903;};return a238_0x21de();}
1
+ function a238_0xd290(_0x5ef776,_0x361343){_0x5ef776=_0x5ef776-0xb2;const _0x4c4291=a238_0x4c42();let _0xd2902c=_0x4c4291[_0x5ef776];return _0xd2902c;}function a238_0x4c42(){const _0xf14151=['72PKLcLY','user-remove','POST','29334822gxUwfb','117fvrJrS','5QrZocy','roleName','3044764CrdxZQ','Remove\x20a\x20user\x20from\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','349722UkRVRv','No\x20change:\x20user\x20','541583bfVaYf','31630zgzbUQ','2RmYHbx','userId','selector','2994693UYakPg','549707xozdUz','role'];a238_0x4c42=function(){return _0xf14151;};return a238_0x4c42();}const a238_0xc489c2=a238_0xd290;(function(_0x5e6779,_0x158da4){const _0x59f62c=a238_0xd290,_0x57c923=_0x5e6779();while(!![]){try{const _0x55faa5=-parseInt(_0x59f62c(0xb9))/0x1*(-parseInt(_0x59f62c(0xb5))/0x2)+-parseInt(_0x59f62c(0xb8))/0x3+-parseInt(_0x59f62c(0xc2))/0x4+-parseInt(_0x59f62c(0xc0))/0x5*(-parseInt(_0x59f62c(0xc4))/0x6)+parseInt(_0x59f62c(0xb3))/0x7*(-parseInt(_0x59f62c(0xbb))/0x8)+parseInt(_0x59f62c(0xbf))/0x9*(-parseInt(_0x59f62c(0xb4))/0xa)+parseInt(_0x59f62c(0xbe))/0xb;if(_0x55faa5===_0x158da4)break;else _0x57c923['push'](_0x57c923['shift']());}catch(_0x8cc630){_0x57c923['push'](_0x57c923['shift']());}}}(a238_0x4c42,0xbdece));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';export const roleUserRemove={'service':a238_0xc489c2(0xba),'command':a238_0xc489c2(0xbc),'description':a238_0xc489c2(0xc3),'risk':'high-risk-write','flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x2b47a6){const _0x27d369=a238_0xc489c2,{mutation:_0x216757}=await prepareUserMutation(_0x2b47a6,_0x27d369(0xbc),!![]);return asDryRunResult(_0x216757,{'method':_0x27d369(0xbd),'url':DELETE_USER_ROLE_PATH});},async 'execute'(_0x5a5394){const _0x33c565=a238_0xc489c2,{matchingRelationIds:_0x188327,mutation:_0x47d610,changed:_0x4cca2c}=await prepareUserMutation(_0x5a5394,'user-remove',![]);if(_0x4cca2c)for(const _0x5ef420 of _0x188327){await deleteDevUserRole(_0x5ef420);}return{'ok':!![],'data':_0x47d610,'message':_0x4cca2c?'Removed\x20user\x20'+_0x47d610[_0x33c565(0xb7)]['userId']+'\x20from\x20role\x20'+_0x47d610['selector'][_0x33c565(0xc1)]:_0x33c565(0xb2)+_0x47d610[_0x33c565(0xb7)][_0x33c565(0xb6)]+'\x20not\x20in\x20role\x20'+_0x47d610[_0x33c565(0xb7)][_0x33c565(0xc1)]};}};
@@ -1 +1 @@
1
- const a239_0x233f2e=a239_0x1bcf;function a239_0x1bcf(_0x5110cf,_0x1f30fd){_0x5110cf=_0x5110cf-0xc7;const _0x264455=a239_0x2644();let _0x1bcf1e=_0x264455[_0x5110cf];return _0x1bcf1e;}function a239_0x2644(){const _0x3460ba=['2066450acYhWS','3219165AekVHb','19089207kGlPON','Resolved\x20\x22','matchedBy','userId','flagMissing','\x22\x20→\x20userId\x20','15SmgTwp','6819968yZLMZi','6hFrvge','name','str','user-resolve','read','trim','1399556rBiiLm','7350308dgfoEH','nickname','username','176420rdpvgJ'];a239_0x2644=function(){return _0x3460ba;};return a239_0x2644();}(function(_0x5f4def,_0x308eb3){const _0x105644=a239_0x1bcf,_0x402b1f=_0x5f4def();while(!![]){try{const _0x1ee5af=-parseInt(_0x105644(0xcf))/0x1+parseInt(_0x105644(0xd0))/0x2+parseInt(_0x105644(0xd1))/0x3+parseInt(_0x105644(0xcb))/0x4*(parseInt(_0x105644(0xd8))/0x5)+parseInt(_0x105644(0xda))/0x6*(-parseInt(_0x105644(0xcc))/0x7)+parseInt(_0x105644(0xd9))/0x8+-parseInt(_0x105644(0xd2))/0x9;if(_0x1ee5af===_0x308eb3)break;else _0x402b1f['push'](_0x402b1f['shift']());}catch(_0x552f5a){_0x402b1f['push'](_0x402b1f['shift']());}}}(a239_0x2644,0xa15dc));import{CliErrors}from'../../errors.js';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':a239_0x233f2e(0xc8),'description':'Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','risk':a239_0x233f2e(0xc9),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x3ae378){const _0x1ce625=a239_0x233f2e;if(!_0x3ae378[_0x1ce625(0xc7)](_0x1ce625(0xdb))[_0x1ce625(0xca)]())throw CliErrors[_0x1ce625(0xd6)]('name','Pass\x20--name\x20<nickname|username>.');},async 'execute'(_0x332bda){const _0x4354d8=a239_0x233f2e,_0x2db747=_0x332bda[_0x4354d8(0xc7)](_0x4354d8(0xdb))[_0x4354d8(0xca)](),_0x37439f=await resolveUserRef(_0x2db747,'Select\x20a\x20listed\x20userId,\x20then\x20pass\x20it\x20to\x20`role\x20user-add`\x20or\x20`role\x20user-remove`\x20with\x20--user\x20<id>.');return{'ok':!![],'data':{'user':{'userId':_0x37439f[_0x4354d8(0xd5)],'username':_0x37439f[_0x4354d8(0xce)],'nickname':_0x37439f[_0x4354d8(0xcd)],'matchedBy':_0x37439f[_0x4354d8(0xd4)]}},'message':_0x4354d8(0xd3)+_0x2db747+_0x4354d8(0xd7)+_0x37439f[_0x4354d8(0xd5)]};}};
1
+ const a239_0x2fb4ba=a239_0x1b5e;(function(_0x13c649,_0x409e8c){const _0x581d8a=a239_0x1b5e,_0x2cc054=_0x13c649();while(!![]){try{const _0x3d3397=-parseInt(_0x581d8a(0xbe))/0x1+parseInt(_0x581d8a(0xc7))/0x2+-parseInt(_0x581d8a(0xcc))/0x3+-parseInt(_0x581d8a(0xb8))/0x4*(parseInt(_0x581d8a(0xcb))/0x5)+parseInt(_0x581d8a(0xbf))/0x6*(parseInt(_0x581d8a(0xc3))/0x7)+-parseInt(_0x581d8a(0xc8))/0x8*(parseInt(_0x581d8a(0xc6))/0x9)+parseInt(_0x581d8a(0xbc))/0xa*(parseInt(_0x581d8a(0xc2))/0xb);if(_0x3d3397===_0x409e8c)break;else _0x2cc054['push'](_0x2cc054['shift']());}catch(_0x4bec1e){_0x2cc054['push'](_0x2cc054['shift']());}}}(a239_0x375e,0x4fc5b));import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a239_0x375e(){const _0x297513=['name','Select\x20a\x20listed\x20userId,\x20then\x20pass\x20it\x20to\x20`role\x20user-add`\x20or\x20`role\x20user-remove`\x20with\x20--user\x20<id>.','638xaRlQA','14EsNFoa','\x22\x20→\x20userId\x20','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','9eLGdHM','225940tMqbsG','1786696yBXSMU','matchedBy','trim','2360ompipQ','1605453zxDUmO','4596tMwiqu','userId','str','flagMissing','256510ZaXNCs','user-resolve','312409PBdobq','1017732mWSLWQ'];a239_0x375e=function(){return _0x297513;};return a239_0x375e();}function a239_0x1b5e(_0x115b7a,_0x30149d){_0x115b7a=_0x115b7a-0xb8;const _0x375eb4=a239_0x375e();let _0x1b5e5e=_0x375eb4[_0x115b7a];return _0x1b5e5e;}import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';export const roleUserResolve={'service':'role','command':a239_0x2fb4ba(0xbd),'description':a239_0x2fb4ba(0xc5),'risk':'read','flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x28f268){const _0x1c1daa=a239_0x2fb4ba;if(!_0x28f268[_0x1c1daa(0xba)]('name')[_0x1c1daa(0xca)]())throw CliErrors[_0x1c1daa(0xbb)](_0x1c1daa(0xc0),'Pass\x20--name\x20<nickname|username>.');},async 'execute'(_0xee2862){const _0x4d223b=a239_0x2fb4ba,_0x1f9420=_0xee2862[_0x4d223b(0xba)](_0x4d223b(0xc0))['trim'](),_0x5bd558=await resolveUserRef(_0x1f9420,_0x4d223b(0xc1));return{'ok':!![],'data':{'user':{'userId':_0x5bd558['userId'],'username':_0x5bd558['username'],'nickname':_0x5bd558['nickname'],'matchedBy':_0x5bd558[_0x4d223b(0xc9)]}},'message':'Resolved\x20\x22'+_0x1f9420+_0x4d223b(0xc4)+_0x5bd558[_0x4d223b(0xb9)]};}};
@@ -1 +1 @@
1
- function a240_0x21eb(){const _0x324cc6=['1340gKdUqe','60ZdKWDe','appCode','259548uXyDCe','app_rule_not_found','90qUwcvi','352947FNxQPb','1778820NZHEus','32YZbjDu','\x20--file\x20<path>\x20--dry-run`.','47456UdJxna','content','666642mIAnrB','Create\x20it\x20with\x20`rabetbase\x20rule\x20set\x20--type\x20','66TxQkwq','30442ahAJzd','Loaded\x20','rule','70yaMpUs','\x20for\x20','read'];a240_0x21eb=function(){return _0x324cc6;};return a240_0x21eb();}const a240_0x2d18de=a240_0x4ffc;(function(_0x35a6b7,_0x221a7c){const _0x37e52c=a240_0x4ffc,_0x27851b=_0x35a6b7();while(!![]){try{const _0x3f73b1=parseInt(_0x37e52c(0x13b))/0x1*(parseInt(_0x37e52c(0x134))/0x2)+parseInt(_0x37e52c(0x132))/0x3+-parseInt(_0x37e52c(0x141))/0x4*(-parseInt(_0x37e52c(0x12d))/0x5)+-parseInt(_0x37e52c(0x138))/0x6*(-parseInt(_0x37e52c(0x13e))/0x7)+parseInt(_0x37e52c(0x136))/0x8*(parseInt(_0x37e52c(0x131))/0x9)+parseInt(_0x37e52c(0x133))/0xa*(-parseInt(_0x37e52c(0x13a))/0xb)+parseInt(_0x37e52c(0x12f))/0xc;if(_0x3f73b1===_0x221a7c)break;else _0x27851b['push'](_0x27851b['shift']());}catch(_0x5bd52f){_0x27851b['push'](_0x27851b['shift']());}}}(a240_0x21eb,0xb311c));import{getAppRule}from'../../core/api-client.js';function a240_0x4ffc(_0x4a12de,_0x281841){_0x4a12de=_0x4a12de-0x12d;const _0x21eba0=a240_0x21eb();let _0x4ffc48=_0x21eba0[_0x4a12de];return _0x4ffc48;}import{APP_RULE_TYPE_FLAG,appRuleError,appRuleFileName,projectAppRule,readAppRuleType}from'../../commands/rule/shared.js';export const ruleGet={'service':a240_0x2d18de(0x13d),'command':'get','description':'Get\x20one\x20agent\x20context\x20rule\x20for\x20the\x20resolved\x20app','risk':a240_0x2d18de(0x140),'requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG],async 'validate'(_0x2d58c0){readAppRuleType(_0x2d58c0);},async 'execute'(_0x396e2e){const _0x3449b2=a240_0x2d18de,_0x1d04d0=readAppRuleType(_0x396e2e),_0x1548ad=await getAppRule(_0x396e2e['cookie'],{'appCode':_0x396e2e[_0x3449b2(0x12e)],'type':_0x1d04d0});if(!_0x1548ad)throw appRuleError(_0x3449b2(0x130),appRuleFileName(_0x1d04d0)+'\x20is\x20not\x20configured\x20for\x20app\x20'+_0x396e2e['appCode']+'.',_0x3449b2(0x139)+_0x1d04d0+_0x3449b2(0x135));return{'ok':!![],'data':{'rule':{...projectAppRule(_0x1d04d0,_0x1548ad),'content':_0x1548ad[_0x3449b2(0x137)]}},'message':_0x3449b2(0x13c)+appRuleFileName(_0x1d04d0)+_0x3449b2(0x13f)+_0x396e2e[_0x3449b2(0x12e)]};}};
1
+ const a240_0x9ee366=a240_0x21b1;function a240_0x21b1(_0x5b6648,_0x2c1eb6){_0x5b6648=_0x5b6648-0x18a;const _0x1f23c5=a240_0x1f23();let _0x21b1ce=_0x1f23c5[_0x5b6648];return _0x21b1ce;}(function(_0x1d34bd,_0x4d8b18){const _0x2b0f6b=a240_0x21b1,_0x45e927=_0x1d34bd();while(!![]){try{const _0x4068e1=-parseInt(_0x2b0f6b(0x199))/0x1*(parseInt(_0x2b0f6b(0x190))/0x2)+parseInt(_0x2b0f6b(0x18e))/0x3*(parseInt(_0x2b0f6b(0x18f))/0x4)+-parseInt(_0x2b0f6b(0x194))/0x5*(parseInt(_0x2b0f6b(0x191))/0x6)+-parseInt(_0x2b0f6b(0x195))/0x7*(parseInt(_0x2b0f6b(0x193))/0x8)+parseInt(_0x2b0f6b(0x18b))/0x9+-parseInt(_0x2b0f6b(0x18c))/0xa+parseInt(_0x2b0f6b(0x18d))/0xb*(parseInt(_0x2b0f6b(0x19b))/0xc);if(_0x4068e1===_0x4d8b18)break;else _0x45e927['push'](_0x45e927['shift']());}catch(_0x45c3e3){_0x45e927['push'](_0x45e927['shift']());}}}(a240_0x1f23,0x4b099));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':'rule','command':'get','description':'Get\x20one\x20agent\x20context\x20rule\x20for\x20the\x20resolved\x20app','risk':a240_0x9ee366(0x19d),'requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG],async 'validate'(_0x59f0a9){readAppRuleType(_0x59f0a9);},async 'execute'(_0x6b0df7){const _0x4852d0=a240_0x9ee366,_0x344297=readAppRuleType(_0x6b0df7),_0x40e253=await getAppRule(_0x6b0df7[_0x4852d0(0x19a)],{'appCode':_0x6b0df7[_0x4852d0(0x197)],'type':_0x344297});if(!_0x40e253)throw appRuleError('app_rule_not_found',appRuleFileName(_0x344297)+_0x4852d0(0x18a)+_0x6b0df7[_0x4852d0(0x197)]+'.',_0x4852d0(0x19c)+_0x344297+'\x20--file\x20<path>\x20--dry-run`.');return{'ok':!![],'data':{'rule':{...projectAppRule(_0x344297,_0x40e253),'content':_0x40e253[_0x4852d0(0x192)]}},'message':_0x4852d0(0x196)+appRuleFileName(_0x344297)+_0x4852d0(0x198)+_0x6b0df7[_0x4852d0(0x197)]};}};function a240_0x1f23(){const _0x21e1c5=['47407BOkddt','cookie','6038676ldFqma','Create\x20it\x20with\x20`rabetbase\x20rule\x20set\x20--type\x20','read','\x20is\x20not\x20configured\x20for\x20app\x20','383220hhwequ','844670TVIKQU','11ARmPXv','5820vjrybG','1132vPvzBg','6UkDHAs','2406QpzcYO','content','88OHTkpa','4215XWsosh','141743BUvphd','Loaded\x20','appCode','\x20for\x20'];a240_0x1f23=function(){return _0x21e1c5;};return a240_0x1f23();}
@@ -1 +1 @@
1
- const a241_0x49c3eb=a241_0x1e2e;(function(_0x10e065,_0x2755c8){const _0x3f58d6=a241_0x1e2e,_0x564ae6=_0x10e065();while(!![]){try{const _0x50be7f=-parseInt(_0x3f58d6(0x174))/0x1*(-parseInt(_0x3f58d6(0x178))/0x2)+-parseInt(_0x3f58d6(0x17b))/0x3+-parseInt(_0x3f58d6(0x176))/0x4+parseInt(_0x3f58d6(0x17a))/0x5+-parseInt(_0x3f58d6(0x17f))/0x6+-parseInt(_0x3f58d6(0x17e))/0x7*(parseInt(_0x3f58d6(0x179))/0x8)+parseInt(_0x3f58d6(0x173))/0x9;if(_0x50be7f===_0x2755c8)break;else _0x564ae6['push'](_0x564ae6['shift']());}catch(_0x2fe899){_0x564ae6['push'](_0x564ae6['shift']());}}}(a241_0x866b,0x31f8b));import{withKbManagementSession}from'../../core/kb-management-client.js';import{ruleGet}from'../../commands/rule/get.js';import{ruleList}from'../../commands/rule/list.js';function a241_0x866b(){const _0x117595=['map','2gxZxeZ','256Yucgkh','122240unTQsI','687450VQgGcG','signal','execute','66577BJwVPq','569556vQMRRy','6316767lfCumm','399963TOOoxz','dryRun','1172652GWaClv'];a241_0x866b=function(){return _0x117595;};return a241_0x866b();}function a241_0x1e2e(_0x2b0ac5,_0x2f1648){_0x2b0ac5=_0x2b0ac5-0x173;const _0x866b8a=a241_0x866b();let _0x1e2e5c=_0x866b8a[_0x2b0ac5];return _0x1e2e5c;}import{ruleSet}from'../../commands/rule/set.js';export const ruleDefinitions=[ruleList,ruleGet,ruleSet][a241_0x49c3eb(0x177)](_0x5345f6=>({..._0x5345f6,'execute':_0x240c3b=>withKbManagementSession(_0x240c3b[a241_0x49c3eb(0x17c)],()=>_0x5345f6[a241_0x49c3eb(0x17d)](_0x240c3b)),..._0x5345f6[a241_0x49c3eb(0x175)]?{'dryRun':_0x4d3837=>withKbManagementSession(_0x4d3837[a241_0x49c3eb(0x17c)],()=>_0x5345f6[a241_0x49c3eb(0x175)](_0x4d3837))}:{}}));
1
+ function a241_0x5d25(_0x5b98da,_0x147554){_0x5b98da=_0x5b98da-0x7b;const _0x27fe3f=a241_0x27fe();let _0x5d256b=_0x27fe3f[_0x5b98da];return _0x5d256b;}const a241_0x689b2b=a241_0x5d25;(function(_0x1c73cc,_0x141bb2){const _0x1b1b7f=a241_0x5d25,_0x48345d=_0x1c73cc();while(!![]){try{const _0x38f3f9=-parseInt(_0x1b1b7f(0x85))/0x1+parseInt(_0x1b1b7f(0x84))/0x2*(-parseInt(_0x1b1b7f(0x86))/0x3)+parseInt(_0x1b1b7f(0x88))/0x4*(-parseInt(_0x1b1b7f(0x81))/0x5)+parseInt(_0x1b1b7f(0x83))/0x6+-parseInt(_0x1b1b7f(0x7d))/0x7*(parseInt(_0x1b1b7f(0x82))/0x8)+parseInt(_0x1b1b7f(0x7f))/0x9+parseInt(_0x1b1b7f(0x7b))/0xa;if(_0x38f3f9===_0x141bb2)break;else _0x48345d['push'](_0x48345d['shift']());}catch(_0x2429df){_0x48345d['push'](_0x48345d['shift']());}}}(a241_0x27fe,0xc95e1));import{withKbManagementSession}from'../../core/kb-management-client.js';function a241_0x27fe(){const _0x38fd01=['2997828hHIcHN','execute','2095924vlwONZ','28252720amROrB','dryRun','343wqMKlE','signal','8072082UDObcZ','map','5suqhmA','195536ajcwNs','7602276lkdnkm','2EeEsQb','1443500sanWzj'];a241_0x27fe=function(){return _0x38fd01;};return a241_0x27fe();}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][a241_0x689b2b(0x80)](_0x53ec3e=>({..._0x53ec3e,'execute':_0x57afdd=>withKbManagementSession(_0x57afdd[a241_0x689b2b(0x7e)],()=>_0x53ec3e[a241_0x689b2b(0x87)](_0x57afdd)),..._0x53ec3e[a241_0x689b2b(0x7c)]?{'dryRun':_0x38c239=>withKbManagementSession(_0x38c239['signal'],()=>_0x53ec3e[a241_0x689b2b(0x7c)](_0x38c239))}:{}}));
@@ -1 +1 @@
1
- function a242_0x3053(_0x32a44b,_0x50e677){_0x32a44b=_0x32a44b-0x116;const _0x594fbc=a242_0x594f();let _0x30530b=_0x594fbc[_0x32a44b];return _0x30530b;}const a242_0x4c76cd=a242_0x3053;(function(_0x2ca80e,_0x58b8e6){const _0x29ce23=a242_0x3053,_0x251c69=_0x2ca80e();while(!![]){try{const _0x526f5d=parseInt(_0x29ce23(0x122))/0x1*(parseInt(_0x29ce23(0x121))/0x2)+-parseInt(_0x29ce23(0x11c))/0x3+parseInt(_0x29ce23(0x129))/0x4*(-parseInt(_0x29ce23(0x127))/0x5)+-parseInt(_0x29ce23(0x11d))/0x6*(-parseInt(_0x29ce23(0x119))/0x7)+-parseInt(_0x29ce23(0x124))/0x8*(-parseInt(_0x29ce23(0x11e))/0x9)+-parseInt(_0x29ce23(0x11a))/0xa+parseInt(_0x29ce23(0x126))/0xb*(parseInt(_0x29ce23(0x116))/0xc);if(_0x526f5d===_0x58b8e6)break;else _0x251c69['push'](_0x251c69['shift']());}catch(_0x1785ac){_0x251c69['push'](_0x251c69['shift']());}}}(a242_0x594f,0x63ab2));import{getAppRule}from'../../core/api-client.js';function a242_0x594f(){const _0xe4a97=['Loaded\x20app\x20rule\x20configuration\x20for\x20','759256oxLUOG','map','7909oBxArO','9865BUeUNx','List\x20agent\x20context\x20rules\x20for\x20the\x20resolved\x20app','1324lULRov','all','7656TXeLZV','appCode','length','50582hicXbG','408590gnlCDo','rule','1161897GBChmd','48FesITJ','18yQcpIE','read','list','1566238MYqFbe','1MeruyF'];a242_0x594f=function(){return _0xe4a97;};return a242_0x594f();}import{APP_RULE_TYPES,projectAppRule}from'../../commands/rule/shared.js';export const ruleList={'service':a242_0x4c76cd(0x11b),'command':a242_0x4c76cd(0x120),'description':a242_0x4c76cd(0x128),'risk':a242_0x4c76cd(0x11f),'requiresAppCode':!![],'structuredErrors':!![],'flags':[],async 'execute'(_0x236def){const _0x36c307=a242_0x4c76cd,_0x3eff5c=await Promise[_0x36c307(0x12a)](APP_RULE_TYPES[_0x36c307(0x125)](_0x15fee7=>getAppRule(_0x236def['cookie'],{'appCode':_0x236def[_0x36c307(0x117)],'type':_0x15fee7}))),_0x351af9=APP_RULE_TYPES[_0x36c307(0x125)]((_0x410c36,_0x106f04)=>projectAppRule(_0x410c36,_0x3eff5c[_0x106f04]??null));return{'ok':!![],'data':{'total':_0x351af9[_0x36c307(0x118)],'rules':_0x351af9},'message':_0x36c307(0x123)+_0x236def['appCode']};}};
1
+ const a242_0x1f562a=a242_0x18c1;(function(_0xa0fc95,_0x1494e1){const _0x4134db=a242_0x18c1,_0x4f0478=_0xa0fc95();while(!![]){try{const _0x1b1db7=-parseInt(_0x4134db(0xfa))/0x1*(parseInt(_0x4134db(0xf0))/0x2)+-parseInt(_0x4134db(0xfe))/0x3+parseInt(_0x4134db(0xf9))/0x4+-parseInt(_0x4134db(0xfb))/0x5+-parseInt(_0x4134db(0xff))/0x6+-parseInt(_0x4134db(0xfd))/0x7*(parseInt(_0x4134db(0xef))/0x8)+parseInt(_0x4134db(0xf6))/0x9;if(_0x1b1db7===_0x1494e1)break;else _0x4f0478['push'](_0x4f0478['shift']());}catch(_0x228918){_0x4f0478['push'](_0x4f0478['shift']());}}}(a242_0x3c0b,0xa2123));function a242_0x3c0b(){const _0x24fc21=['8278JgUIGr','5093905ELegch','list','7JAtRTk','3469080DSlegr','1578906xfwXxs','6669304iUitIz','286gEGCvS','cookie','map','List\x20agent\x20context\x20rules\x20for\x20the\x20resolved\x20app','length','appCode','41469831Etbkic','Loaded\x20app\x20rule\x20configuration\x20for\x20','rule','2047172DKloaq'];a242_0x3c0b=function(){return _0x24fc21;};return a242_0x3c0b();}function a242_0x18c1(_0x1b8e05,_0x1cc2b4){_0x1b8e05=_0x1b8e05-0xef;const _0x3c0b47=a242_0x3c0b();let _0x18c16a=_0x3c0b47[_0x1b8e05];return _0x18c16a;}import{getAppRule}from'../../core/api-client.js';import{APP_RULE_TYPES,projectAppRule}from'../../commands/rule/shared.js';export const ruleList={'service':a242_0x1f562a(0xf8),'command':a242_0x1f562a(0xfc),'description':a242_0x1f562a(0xf3),'risk':'read','requiresAppCode':!![],'structuredErrors':!![],'flags':[],async 'execute'(_0x23557e){const _0xa93b10=a242_0x1f562a,_0x1b2650=await Promise['all'](APP_RULE_TYPES[_0xa93b10(0xf2)](_0x4f8fe6=>getAppRule(_0x23557e[_0xa93b10(0xf1)],{'appCode':_0x23557e[_0xa93b10(0xf5)],'type':_0x4f8fe6}))),_0x491d49=APP_RULE_TYPES[_0xa93b10(0xf2)]((_0xf1411e,_0x138246)=>projectAppRule(_0xf1411e,_0x1b2650[_0x138246]??null));return{'ok':!![],'data':{'total':_0x491d49[_0xa93b10(0xf4)],'rules':_0x491d49},'message':_0xa93b10(0xf7)+_0x23557e[_0xa93b10(0xf5)]};}};
@@ -1 +1 @@
1
- function a243_0x428e(){const _0x48d1ea=['1eWwShJ',';\x20current\x20version\x20is\x20','\x20for\x20','length','unconfigured','planned','str','app_rule_set_outcome_unknown','set','.\x20Run\x20rule\x20get\x20and\x20review\x20before\x20retrying.','app_rule_verification_failed','content','beforeRecord','Do\x20not\x20resubmit\x20automatically.\x20Inspect\x20the\x20exact\x20rule\x20state\x20before\x20retrying.','DATABASE','defineProperty','rabetbase\x20rule\x20get\x20--type\x20','before','Set\x20response\x20was\x20unavailable;\x20verified\x20the\x20exact\x20content\x20readback\x20without\x20resubmitting.','write','222zxTLNY','app_rule_verification_unavailable','rules','\x20does\x20not\x20prove\x20the\x20requested\x20set\x20state.','Set\x20','10coBiup','type','isSafeInteger','cookie','\x20--format\x20compress`;\x20do\x20not\x20resubmit\x20automatically.','1112duvxZi','87UEUgpx','verified','\x20version\x20changed\x20before\x20write.','expected-version','195979kgTbmS','6793776BAGGTe','app_rule_content_too_large','\x20--format\x20compress','appCode','update','--expected-version\x20must\x20be\x20a\x20non-negative\x20safe\x20integer.','contentHash','8409807XarnAO','app_rule_expected_version_invalid','Set\x20an\x20agent\x20context\x20rule\x20from\x20a\x20UTF-8\x20Markdown\x20file','9972457YwwmKc','create','replacement','push','RULES\x20content\x20exceeds\x202000\x20UTF-16\x20units.','input','byteSize','version','The\x20set\x20request\x20was\x20sent,\x20but\x20','The\x20received\x20rule\x20state\x20contradicts\x20the\x20requested\x20changes.','2617298oeMOsC','757115TRTHiW','rule','POST','string','expectedVersion','RULES','app_rule_file_required','Expected\x20','file'];a243_0x428e=function(){return _0x48d1ea;};return a243_0x428e();}const a243_0x1dffdb=a243_0xd82a;(function(_0x2961d0,_0x403472){const _0x32c3af=a243_0xd82a,_0x48b68e=_0x2961d0();while(!![]){try{const _0x51ad04=parseInt(_0x32c3af(0x14e))/0x1*(parseInt(_0x32c3af(0x144))/0x2)+-parseInt(_0x32c3af(0x12b))/0x3*(-parseInt(_0x32c3af(0x12a))/0x4)+-parseInt(_0x32c3af(0x145))/0x5+parseInt(_0x32c3af(0x162))/0x6*(-parseInt(_0x32c3af(0x12f))/0x7)+parseInt(_0x32c3af(0x130))/0x8+-parseInt(_0x32c3af(0x137))/0x9+parseInt(_0x32c3af(0x125))/0xa*(parseInt(_0x32c3af(0x13a))/0xb);if(_0x51ad04===_0x403472)break;else _0x48b68e['push'](_0x48b68e['shift']());}catch(_0x583c9a){_0x48b68e['push'](_0x48b68e['shift']());}}}(a243_0x428e,0xe8201));import{knowledgeDocumentsPath}from'../../core/api-client.js';function a243_0xd82a(_0x2b02ef,_0x29f0fb){_0x2b02ef=_0x2b02ef-0x123;const _0x428e71=a243_0x428e();let _0xd82a83=_0x428e71[_0x2b02ef];return _0xd82a83;}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';function readSetInput(_0x359c22){const _0x1c8f2d=a243_0xd82a,_0x1e4d84=readAppRuleType(_0x359c22),_0x56d49a=_0x359c22[_0x1c8f2d(0x154)](_0x1c8f2d(0x14d))['trim']();if(!_0x56d49a)throw appRuleError(_0x1c8f2d(0x14b),'--file\x20is\x20required.','Pass\x20a\x20UTF-8\x20Markdown\x20file.');const _0x3b2457=_0x359c22['flag'](_0x1c8f2d(0x12e));let _0x5e87b6;if(_0x3b2457!==undefined){_0x5e87b6=Number(_0x3b2457);if(!Number[_0x1c8f2d(0x127)](_0x5e87b6)||_0x5e87b6<0x0)throw appRuleError(_0x1c8f2d(0x138),_0x1c8f2d(0x135));}return{'type':_0x1e4d84,'file':_0x56d49a,'expectedVersion':_0x5e87b6};}async function prepareSet(_0x4282cc){const _0x40682d=a243_0xd82a,_0x1459db=readSetInput(_0x4282cc),_0x5a2bd1=await readAppRuleFile(_0x1459db[_0x40682d(0x14d)]);if(_0x1459db['type']===_0x40682d(0x164)&&_0x5a2bd1[_0x40682d(0x159)][_0x40682d(0x151)]>0x7d0)throw appRuleError(_0x40682d(0x131),_0x40682d(0x13e));const _0x5c02c8=await getAppRule(_0x4282cc['cookie'],{'appCode':_0x4282cc[_0x40682d(0x133)],'type':_0x1459db[_0x40682d(0x126)]});if(_0x1459db[_0x40682d(0x149)]!==undefined&&(_0x5c02c8?.[_0x40682d(0x141)]??0x0)!==_0x1459db[_0x40682d(0x149)])throw appRuleError('app_rule_version_mismatch',appRuleFileName(_0x1459db[_0x40682d(0x126)])+_0x40682d(0x12d),_0x40682d(0x14c)+_0x1459db[_0x40682d(0x149)]+_0x40682d(0x14f)+(_0x5c02c8?.['version']??_0x40682d(0x152))+_0x40682d(0x157));return{'input':_0x1459db,'replacement':_0x5a2bd1,'beforeRecord':_0x5c02c8,'before':projectAppRule(_0x1459db['type'],_0x5c02c8),'planned':{'type':_0x1459db[_0x40682d(0x126)],'fileName':appRuleFileName(_0x1459db[_0x40682d(0x126)]),'contextScope':appRuleContextScope(_0x1459db['type']),'enabled':!![],'appCode':_0x4282cc[_0x40682d(0x133)],'scope':_0x40682d(0x164),'contentByteSize':_0x5a2bd1[_0x40682d(0x140)],'contentHash':_0x5a2bd1['contentHash']}};}function warningsFor(_0x2ff0c6){return[];}export const ruleSet={'service':a243_0x1dffdb(0x146),'command':a243_0x1dffdb(0x156),'description':a243_0x1dffdb(0x139),'risk':a243_0x1dffdb(0x161),'requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG,{'name':a243_0x1dffdb(0x14d),'type':a243_0x1dffdb(0x148),'required':!![],'description':'UTF-8\x20Markdown\x20file\x20(RULES:\x202000\x20UTF-16\x20units;\x20DATABASE:\x205242880\x20units)'},{'name':a243_0x1dffdb(0x12e),'type':'number','required':![],'description':'Require\x20the\x20current\x20version\x20before\x20atomic\x20compare-and-set'}],async 'validate'(_0x33f649){readSetInput(_0x33f649);},async 'dryRun'(_0x5d889c){const _0x8be733=a243_0x1dffdb,_0x387549=await prepareSet(_0x5d889c);return asDryRunResult({'operation':_0x8be733(0x156),'selector':{'appCode':_0x5d889c['appCode'],'scope':_0x8be733(0x164),'type':_0x387549[_0x8be733(0x13f)][_0x8be733(0x126)]},'before':_0x387549[_0x8be733(0x15f)],'after':_0x387549[_0x8be733(0x153)],'dryRun':!![],'backend':{'method':'POST','path':knowledgeDocumentsPath('rules',_0x387549[_0x8be733(0x15a)]?'update':_0x8be733(0x13b)),'body':{'appCode':_0x5d889c[_0x8be733(0x133)],..._0x387549[_0x8be733(0x15a)]?{'id':_0x387549[_0x8be733(0x15a)]['id']}:{},'title':_0x387549[_0x8be733(0x13f)]['type']===_0x8be733(0x164)?_0x8be733(0x14a):_0x8be733(0x15c),'contentHash':_0x387549[_0x8be733(0x13c)][_0x8be733(0x136)],'contentByteSize':_0x387549[_0x8be733(0x13c)][_0x8be733(0x140)],..._0x387549[_0x8be733(0x15a)]?{'expectedVersion':_0x387549[_0x8be733(0x15a)]['version']}:{}}},'warnings':warningsFor(_0x387549[_0x8be733(0x13f)][_0x8be733(0x149)]),'verification':{'expectedVersion':_0x387549['beforeRecord']?.['version']??0x0,'atomicCompareAndSet':!![],'lookupCommand':'rabetbase\x20rule\x20get\x20--type\x20'+_0x387549['input']['type']+_0x8be733(0x132)}},{'method':_0x8be733(0x147),'url':knowledgeDocumentsPath(_0x8be733(0x164),_0x387549[_0x8be733(0x15a)]?_0x8be733(0x134):'create')});},async 'execute'(_0x296c7a){const _0xf29bae=a243_0x1dffdb,_0x3abdcb=await prepareSet(_0x296c7a),_0x46316a=_0x3abdcb[_0xf29bae(0x15a)]===null?0x1:_0x3abdcb[_0xf29bae(0x15a)][_0xf29bae(0x141)]+(_0x3abdcb[_0xf29bae(0x15a)][_0xf29bae(0x159)]===_0x3abdcb[_0xf29bae(0x13c)]['content']?0x0:0x1);let _0x354017,_0x1c57dd=![];try{_0x354017=await saveAppRule(_0x296c7a[_0xf29bae(0x128)],{'appCode':_0x296c7a[_0xf29bae(0x133)],'type':_0x3abdcb[_0xf29bae(0x13f)][_0xf29bae(0x126)],'content':_0x3abdcb[_0xf29bae(0x13c)][_0xf29bae(0x159)],'expectedVersion':_0x3abdcb[_0xf29bae(0x15a)]?.[_0xf29bae(0x141)]??0x0,..._0x3abdcb[_0xf29bae(0x15a)]?{'id':_0x3abdcb['beforeRecord']['id']}:{}});if(_0x354017[_0xf29bae(0x141)]!==_0x46316a||_0x354017[_0xf29bae(0x159)]!==_0x3abdcb[_0xf29bae(0x13c)][_0xf29bae(0x159)]||_0x3abdcb[_0xf29bae(0x15a)]!==null&&_0x354017['id']!==_0x3abdcb['beforeRecord']['id'])throw appRuleError(_0xf29bae(0x158),_0xf29bae(0x143),'Use\x20read-only\x20rule\x20reconciliation;\x20do\x20not\x20resubmit\x20automatically.');}catch(_0x554edf){if(!isPlatformTransportFailure(_0x554edf))throw _0x554edf;_0x1c57dd=!![];}let _0x34833e;try{_0x34833e=await getAppRule(_0x296c7a['cookie'],{'appCode':_0x296c7a[_0xf29bae(0x133)],'type':_0x3abdcb[_0xf29bae(0x13f)][_0xf29bae(0x126)]});}catch(_0x460cdb){const _0x1d6ce0=appRuleError(_0x1c57dd?_0xf29bae(0x155):_0xf29bae(0x163),_0xf29bae(0x142)+appRuleFileName(_0x3abdcb[_0xf29bae(0x13f)]['type'])+'\x20could\x20not\x20be\x20verified.',_0xf29bae(0x15b));Object[_0xf29bae(0x15d)](_0x1d6ce0,'cause',{'value':_0x460cdb,'enumerable':![]});throw _0x1d6ce0;}const _0x1bcbbc=_0x34833e&&inspectAppRuleContent(_0x34833e[_0xf29bae(0x159)])[_0xf29bae(0x136)]===_0x3abdcb[_0xf29bae(0x13c)][_0xf29bae(0x136)],_0xe8f9eb=_0x34833e&&_0x34833e['version']===_0x46316a&&(!_0x354017||_0x34833e['id']===_0x354017['id']&&_0x34833e[_0xf29bae(0x141)]===_0x354017[_0xf29bae(0x141)]);if(!_0x34833e||!_0x1bcbbc||!_0xe8f9eb||_0x3abdcb[_0xf29bae(0x15a)]!==null&&_0x34833e['id']!==_0x3abdcb[_0xf29bae(0x15a)]['id'])throw appRuleError(_0x1c57dd?_0xf29bae(0x155):_0xf29bae(0x158),appRuleFileName(_0x3abdcb[_0xf29bae(0x13f)][_0xf29bae(0x126)])+_0xf29bae(0x123),'Inspect\x20it\x20with\x20`rabetbase\x20rule\x20get\x20--type\x20'+_0x3abdcb[_0xf29bae(0x13f)][_0xf29bae(0x126)]+_0xf29bae(0x129));const _0x2bf700=warningsFor(_0x3abdcb[_0xf29bae(0x13f)]['expectedVersion']);_0x1c57dd&&_0x2bf700[_0xf29bae(0x13d)](_0xf29bae(0x160));const _0x4bb6fd=projectAppRule(_0x3abdcb[_0xf29bae(0x13f)][_0xf29bae(0x126)],_0x34833e);return{'ok':!![],'data':{'operation':'set','selector':{'appCode':_0x296c7a['appCode'],'scope':'rules','type':_0x3abdcb['input']['type']},'before':_0x3abdcb[_0xf29bae(0x15f)],'after':_0x4bb6fd,'dryRun':![],'backend':{'method':'POST','path':knowledgeDocumentsPath(_0xf29bae(0x164),_0x3abdcb[_0xf29bae(0x15a)]?_0xf29bae(0x134):_0xf29bae(0x13b))},'warnings':_0x2bf700,'verification':{'status':_0xf29bae(0x12c),'recoveredAfterUnknownResponse':_0x1c57dd,'expectedVersion':_0x3abdcb[_0xf29bae(0x15a)]?.['version']??0x0,'atomicCompareAndSet':!![],'lookupCommand':_0xf29bae(0x15e)+_0x3abdcb['input']['type']+_0xf29bae(0x132)}},'message':_0xf29bae(0x124)+appRuleFileName(_0x3abdcb[_0xf29bae(0x13f)][_0xf29bae(0x126)])+_0xf29bae(0x150)+_0x296c7a[_0xf29bae(0x133)]};}};
1
+ function a243_0x4c1c(){const _0x207ae0=['Set\x20an\x20agent\x20context\x20rule\x20from\x20a\x20UTF-8\x20Markdown\x20file','file','expected-version','12zWghQS','app_rule_verification_failed','cookie',';\x20current\x20version\x20is\x20','\x20version\x20changed\x20before\x20write.','flag','460884IlTMRY','POST','before','The\x20set\x20request\x20was\x20sent,\x20but\x20','DATABASE','5825865GBQfAO','\x20--format\x20compress`;\x20do\x20not\x20resubmit\x20automatically.','unconfigured','create','type','version','The\x20received\x20rule\x20state\x20contradicts\x20the\x20requested\x20changes.','set','defineProperty','716588StjGsB','RULES\x20content\x20exceeds\x202000\x20UTF-16\x20units.','Set\x20response\x20was\x20unavailable;\x20verified\x20the\x20exact\x20content\x20readback\x20without\x20resubmitting.','rabetbase\x20rule\x20get\x20--type\x20','--file\x20is\x20required.','replacement','app_rule_set_outcome_unknown','app_rule_content_too_large','trim','2OkxlEu','app_rule_verification_unavailable','expectedVersion','\x20could\x20not\x20be\x20verified.','contentHash','string','UTF-8\x20Markdown\x20file\x20(RULES:\x202000\x20UTF-16\x20units;\x20DATABASE:\x205242880\x20units)','write','input','19481LVqBhP','isSafeInteger','update','appCode','beforeRecord','verified','Do\x20not\x20resubmit\x20automatically.\x20Inspect\x20the\x20exact\x20rule\x20state\x20before\x20retrying.','28EdLxjK','byteSize','--expected-version\x20must\x20be\x20a\x20non-negative\x20safe\x20integer.','18228wJvbZm','content','1685994qLvUrk','13350490liLoCI','RULES','9431472LMqvQT','Inspect\x20it\x20with\x20`rabetbase\x20rule\x20get\x20--type\x20','rules','\x20for\x20','Pass\x20a\x20UTF-8\x20Markdown\x20file.','Expected\x20','app_rule_file_required','9mHtvod','Require\x20the\x20current\x20version\x20before\x20atomic\x20compare-and-set'];a243_0x4c1c=function(){return _0x207ae0;};return a243_0x4c1c();}const a243_0x29ae8e=a243_0x484f;(function(_0x5acf1d,_0x5b9b7f){const _0x1e5724=a243_0x484f,_0x35f800=_0x5acf1d();while(!![]){try{const _0xc69b78=-parseInt(_0x1e5724(0x19d))/0x1*(-parseInt(_0x1e5724(0x1a6))/0x2)+parseInt(_0x1e5724(0x18f))/0x3*(-parseInt(_0x1e5724(0x189))/0x4)+-parseInt(_0x1e5724(0x194))/0x5+-parseInt(_0x1e5724(0x1bb))/0x6*(parseInt(_0x1e5724(0x1b6))/0x7)+-parseInt(_0x1e5724(0x1be))/0x8+-parseInt(_0x1e5724(0x184))/0x9*(-parseInt(_0x1e5724(0x1bc))/0xa)+parseInt(_0x1e5724(0x1af))/0xb*(parseInt(_0x1e5724(0x1b9))/0xc);if(_0xc69b78===_0x5b9b7f)break;else _0x35f800['push'](_0x35f800['shift']());}catch(_0x3a10a5){_0x35f800['push'](_0x35f800['shift']());}}}(a243_0x4c1c,0xc66ff));import{knowledgeDocumentsPath}from'../../core/api-client.js';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';function readSetInput(_0x3c185f){const _0x1e825e=a243_0x484f,_0xf852d1=readAppRuleType(_0x3c185f),_0x2dea44=_0x3c185f['str'](_0x1e825e(0x187))[_0x1e825e(0x1a5)]();if(!_0x2dea44)throw appRuleError(_0x1e825e(0x183),_0x1e825e(0x1a1),_0x1e825e(0x1c2));const _0x5ae5d4=_0x3c185f[_0x1e825e(0x18e)]('expected-version');let _0x62a1dc;if(_0x5ae5d4!==undefined){_0x62a1dc=Number(_0x5ae5d4);if(!Number[_0x1e825e(0x1b0)](_0x62a1dc)||_0x62a1dc<0x0)throw appRuleError('app_rule_expected_version_invalid',_0x1e825e(0x1b8));}return{'type':_0xf852d1,'file':_0x2dea44,'expectedVersion':_0x62a1dc};}async function prepareSet(_0x51ecd0){const _0x38b423=a243_0x484f,_0x218674=readSetInput(_0x51ecd0),_0x43941c=await readAppRuleFile(_0x218674['file']);if(_0x218674[_0x38b423(0x198)]===_0x38b423(0x1c0)&&_0x43941c[_0x38b423(0x1ba)]['length']>0x7d0)throw appRuleError(_0x38b423(0x1a4),_0x38b423(0x19e));const _0x5de74a=await getAppRule(_0x51ecd0['cookie'],{'appCode':_0x51ecd0['appCode'],'type':_0x218674[_0x38b423(0x198)]});if(_0x218674[_0x38b423(0x1a8)]!==undefined&&(_0x5de74a?.[_0x38b423(0x199)]??0x0)!==_0x218674[_0x38b423(0x1a8)])throw appRuleError('app_rule_version_mismatch',appRuleFileName(_0x218674[_0x38b423(0x198)])+_0x38b423(0x18d),_0x38b423(0x1c3)+_0x218674[_0x38b423(0x1a8)]+_0x38b423(0x18c)+(_0x5de74a?.[_0x38b423(0x199)]??_0x38b423(0x196))+'.\x20Run\x20rule\x20get\x20and\x20review\x20before\x20retrying.');return{'input':_0x218674,'replacement':_0x43941c,'beforeRecord':_0x5de74a,'before':projectAppRule(_0x218674[_0x38b423(0x198)],_0x5de74a),'planned':{'type':_0x218674['type'],'fileName':appRuleFileName(_0x218674[_0x38b423(0x198)]),'contextScope':appRuleContextScope(_0x218674[_0x38b423(0x198)]),'enabled':!![],'appCode':_0x51ecd0[_0x38b423(0x1b2)],'scope':_0x38b423(0x1c0),'contentByteSize':_0x43941c[_0x38b423(0x1b7)],'contentHash':_0x43941c[_0x38b423(0x1aa)]}};}function warningsFor(_0x47e968){return[];}function a243_0x484f(_0x4d3fe0,_0x98d6ba){_0x4d3fe0=_0x4d3fe0-0x183;const _0x4c1cf9=a243_0x4c1c();let _0x484f9c=_0x4c1cf9[_0x4d3fe0];return _0x484f9c;}export const ruleSet={'service':'rule','command':a243_0x29ae8e(0x19b),'description':a243_0x29ae8e(0x186),'risk':a243_0x29ae8e(0x1ad),'requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG,{'name':a243_0x29ae8e(0x187),'type':a243_0x29ae8e(0x1ab),'required':!![],'description':a243_0x29ae8e(0x1ac)},{'name':a243_0x29ae8e(0x188),'type':'number','required':![],'description':a243_0x29ae8e(0x185)}],async 'validate'(_0x505a81){readSetInput(_0x505a81);},async 'dryRun'(_0x241b68){const _0x146ad1=a243_0x29ae8e,_0x5aca7c=await prepareSet(_0x241b68);return asDryRunResult({'operation':_0x146ad1(0x19b),'selector':{'appCode':_0x241b68[_0x146ad1(0x1b2)],'scope':_0x146ad1(0x1c0),'type':_0x5aca7c['input'][_0x146ad1(0x198)]},'before':_0x5aca7c[_0x146ad1(0x191)],'after':_0x5aca7c['planned'],'dryRun':!![],'backend':{'method':_0x146ad1(0x190),'path':knowledgeDocumentsPath('rules',_0x5aca7c[_0x146ad1(0x1b3)]?_0x146ad1(0x1b1):_0x146ad1(0x197)),'body':{'appCode':_0x241b68[_0x146ad1(0x1b2)],..._0x5aca7c['beforeRecord']?{'id':_0x5aca7c['beforeRecord']['id']}:{},'title':_0x5aca7c[_0x146ad1(0x1ae)]['type']===_0x146ad1(0x1c0)?_0x146ad1(0x1bd):_0x146ad1(0x193),'contentHash':_0x5aca7c[_0x146ad1(0x1a2)][_0x146ad1(0x1aa)],'contentByteSize':_0x5aca7c['replacement'][_0x146ad1(0x1b7)],..._0x5aca7c[_0x146ad1(0x1b3)]?{'expectedVersion':_0x5aca7c['beforeRecord']['version']}:{}}},'warnings':warningsFor(_0x5aca7c[_0x146ad1(0x1ae)]['expectedVersion']),'verification':{'expectedVersion':_0x5aca7c[_0x146ad1(0x1b3)]?.[_0x146ad1(0x199)]??0x0,'atomicCompareAndSet':!![],'lookupCommand':_0x146ad1(0x1a0)+_0x5aca7c['input'][_0x146ad1(0x198)]+'\x20--format\x20compress'}},{'method':_0x146ad1(0x190),'url':knowledgeDocumentsPath(_0x146ad1(0x1c0),_0x5aca7c[_0x146ad1(0x1b3)]?_0x146ad1(0x1b1):_0x146ad1(0x197))});},async 'execute'(_0x4ede9f){const _0x26f7dc=a243_0x29ae8e,_0xbc2c2b=await prepareSet(_0x4ede9f),_0x26065f=_0xbc2c2b[_0x26f7dc(0x1b3)]===null?0x1:_0xbc2c2b[_0x26f7dc(0x1b3)]['version']+(_0xbc2c2b[_0x26f7dc(0x1b3)][_0x26f7dc(0x1ba)]===_0xbc2c2b[_0x26f7dc(0x1a2)]['content']?0x0:0x1);let _0x35a2df,_0x1400fc=![];try{_0x35a2df=await saveAppRule(_0x4ede9f['cookie'],{'appCode':_0x4ede9f[_0x26f7dc(0x1b2)],'type':_0xbc2c2b[_0x26f7dc(0x1ae)][_0x26f7dc(0x198)],'content':_0xbc2c2b[_0x26f7dc(0x1a2)][_0x26f7dc(0x1ba)],'expectedVersion':_0xbc2c2b[_0x26f7dc(0x1b3)]?.[_0x26f7dc(0x199)]??0x0,..._0xbc2c2b[_0x26f7dc(0x1b3)]?{'id':_0xbc2c2b[_0x26f7dc(0x1b3)]['id']}:{}});if(_0x35a2df[_0x26f7dc(0x199)]!==_0x26065f||_0x35a2df[_0x26f7dc(0x1ba)]!==_0xbc2c2b['replacement']['content']||_0xbc2c2b['beforeRecord']!==null&&_0x35a2df['id']!==_0xbc2c2b[_0x26f7dc(0x1b3)]['id'])throw appRuleError('app_rule_verification_failed',_0x26f7dc(0x19a),'Use\x20read-only\x20rule\x20reconciliation;\x20do\x20not\x20resubmit\x20automatically.');}catch(_0x3b00d6){if(!isPlatformTransportFailure(_0x3b00d6))throw _0x3b00d6;_0x1400fc=!![];}let _0x31ddd6;try{_0x31ddd6=await getAppRule(_0x4ede9f[_0x26f7dc(0x18b)],{'appCode':_0x4ede9f['appCode'],'type':_0xbc2c2b[_0x26f7dc(0x1ae)]['type']});}catch(_0x5b0e19){const _0x576e26=appRuleError(_0x1400fc?_0x26f7dc(0x1a3):_0x26f7dc(0x1a7),_0x26f7dc(0x192)+appRuleFileName(_0xbc2c2b[_0x26f7dc(0x1ae)]['type'])+_0x26f7dc(0x1a9),_0x26f7dc(0x1b5));Object[_0x26f7dc(0x19c)](_0x576e26,'cause',{'value':_0x5b0e19,'enumerable':![]});throw _0x576e26;}const _0x599817=_0x31ddd6&&inspectAppRuleContent(_0x31ddd6[_0x26f7dc(0x1ba)])['contentHash']===_0xbc2c2b[_0x26f7dc(0x1a2)][_0x26f7dc(0x1aa)],_0x312d3f=_0x31ddd6&&_0x31ddd6[_0x26f7dc(0x199)]===_0x26065f&&(!_0x35a2df||_0x31ddd6['id']===_0x35a2df['id']&&_0x31ddd6[_0x26f7dc(0x199)]===_0x35a2df[_0x26f7dc(0x199)]);if(!_0x31ddd6||!_0x599817||!_0x312d3f||_0xbc2c2b[_0x26f7dc(0x1b3)]!==null&&_0x31ddd6['id']!==_0xbc2c2b[_0x26f7dc(0x1b3)]['id'])throw appRuleError(_0x1400fc?'app_rule_set_outcome_unknown':_0x26f7dc(0x18a),appRuleFileName(_0xbc2c2b['input'][_0x26f7dc(0x198)])+'\x20does\x20not\x20prove\x20the\x20requested\x20set\x20state.',_0x26f7dc(0x1bf)+_0xbc2c2b[_0x26f7dc(0x1ae)][_0x26f7dc(0x198)]+_0x26f7dc(0x195));const _0x320160=warningsFor(_0xbc2c2b['input']['expectedVersion']);_0x1400fc&&_0x320160['push'](_0x26f7dc(0x19f));const _0x5ae8dc=projectAppRule(_0xbc2c2b['input'][_0x26f7dc(0x198)],_0x31ddd6);return{'ok':!![],'data':{'operation':_0x26f7dc(0x19b),'selector':{'appCode':_0x4ede9f[_0x26f7dc(0x1b2)],'scope':_0x26f7dc(0x1c0),'type':_0xbc2c2b[_0x26f7dc(0x1ae)]['type']},'before':_0xbc2c2b[_0x26f7dc(0x191)],'after':_0x5ae8dc,'dryRun':![],'backend':{'method':'POST','path':knowledgeDocumentsPath('rules',_0xbc2c2b[_0x26f7dc(0x1b3)]?_0x26f7dc(0x1b1):'create')},'warnings':_0x320160,'verification':{'status':_0x26f7dc(0x1b4),'recoveredAfterUnknownResponse':_0x1400fc,'expectedVersion':_0xbc2c2b[_0x26f7dc(0x1b3)]?.[_0x26f7dc(0x199)]??0x0,'atomicCompareAndSet':!![],'lookupCommand':_0x26f7dc(0x1a0)+_0xbc2c2b[_0x26f7dc(0x1ae)][_0x26f7dc(0x198)]+'\x20--format\x20compress'}},'message':'Set\x20'+appRuleFileName(_0xbc2c2b[_0x26f7dc(0x1ae)][_0x26f7dc(0x198)])+_0x26f7dc(0x1c1)+_0x4ede9f[_0x26f7dc(0x1b2)]};}};
@@ -1 +1 @@
1
- const a244_0x26c376=a244_0x1dab;(function(_0x491cc2,_0x2d5cbd){const _0x364204=a244_0x1dab,_0x1c195f=_0x491cc2();while(!![]){try{const _0xa0c985=-parseInt(_0x364204(0x162))/0x1+-parseInt(_0x364204(0x178))/0x2+parseInt(_0x364204(0x177))/0x3*(parseInt(_0x364204(0x172))/0x4)+-parseInt(_0x364204(0x17e))/0x5+-parseInt(_0x364204(0x173))/0x6+parseInt(_0x364204(0x165))/0x7+parseInt(_0x364204(0x15e))/0x8;if(_0xa0c985===_0x2d5cbd)break;else _0x1c195f['push'](_0x1c195f['shift']());}catch(_0x189170){_0x1c195f['push'](_0x1c195f['shift']());}}}(a244_0x2d39,0x80a2f));function a244_0x1dab(_0xf503a0,_0x517523){_0xf503a0=_0xf503a0-0x151;const _0x2d391c=a244_0x2d39();let _0x1dab18=_0x2d391c[_0xf503a0];return _0x1dab18;}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=['rules',a244_0x26c376(0x151)];export const MAX_APP_RULE_UNITS=0x5*0x400*0x400;export const MAX_APP_RULE_BYTES=MAX_APP_RULE_UNITS*0x4;const APP_RULE_FILES={'rules':a244_0x26c376(0x179),'database':a244_0x26c376(0x152)},APP_RULE_CONTEXT_SCOPES={'rules':a244_0x26c376(0x16b),'database':a244_0x26c376(0x176)};export function appRuleError(_0x509803,_0x161931,_0x4e82f7){return new CliError(_0x509803,0x1,_0x161931,_0x4e82f7);}export function readAppRuleType(_0x4340e6){const _0x1169a1=a244_0x26c376,_0x311bf6=_0x4340e6[_0x1169a1(0x15f)]('type')[_0x1169a1(0x169)]()['toLowerCase']();if(_0x311bf6!==_0x1169a1(0x16a)&&_0x311bf6!==_0x1169a1(0x151))throw appRuleError('app_rule_type_invalid','--type\x20must\x20be\x20either\x20rules\x20or\x20database.');return _0x311bf6;}export function appRuleFileName(_0x4b74e5){return APP_RULE_FILES[_0x4b74e5];}export function appRuleContextScope(_0x37cf28){return APP_RULE_CONTEXT_SCOPES[_0x37cf28];}export function inspectAppRuleContent(_0x433a02){const _0x15b859=a244_0x26c376,_0x13c8f7=Buffer[_0x15b859(0x168)](_0x433a02,_0x15b859(0x15a));return{'content':_0x433a02,'byteSize':_0x13c8f7[_0x15b859(0x17b)],'contentHash':_0x15b859(0x17c)+createHash(_0x15b859(0x182))[_0x15b859(0x166)](_0x13c8f7)[_0x15b859(0x16d)](_0x15b859(0x159))};}function a244_0x2d39(){const _0x5630de=['createTime','173555WkwVeN','string','--file\x20is\x20required.','Context\x20rule\x20type:\x20rules\x20for\x20page/API\x20development\x20agents\x20(DB\x20Agent\x20excluded),\x20database\x20for\x20DB\x20Agent\x20database\x20analysis','sha256','app_rule_content_too_large','database','DATABASE.md','appCode','App\x20rule\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','app_rule_file_unreadable','App\x20rule\x20content\x20exceeds\x20the\x20bounded\x20UTF-8\x20file\x20limit.','App\x20rule\x20file\x20is\x20blank:\x20','message','hex','utf8','app_rule_file_invalid','Pass\x20a\x20UTF-8\x20Markdown\x20file.','indexStatus','14543144CwOSQC','str','updateTime','isFile','846162EoypeO','app_rule_content_invalid','scope','1842575PRnpNe','update','type','from','trim','rules','page-api-development','content','digest','Cannot\x20access\x20app\x20rule\x20file:\x20','App\x20rule\x20content\x20exceeds\x205242880\x20UTF-16\x20units.','app_rule_file_required','Cannot\x20read\x20app\x20rule\x20file:\x20','72MVKzPo','3574470fBepwn','version','byteSize','database-analysis','116151eGfAhZ','1549022wotCPM','RULES.md','utf-8','byteLength','sha256:'];a244_0x2d39=function(){return _0x5630de;};return a244_0x2d39();}export async function readAppRuleFile(_0x3f3ce0){const _0x579d18=a244_0x26c376,_0x52148c=_0x3f3ce0[_0x579d18(0x169)]();if(!_0x52148c)throw appRuleError(_0x579d18(0x170),_0x579d18(0x180),_0x579d18(0x15c));const _0x546b4c=resolve(_0x52148c);let _0x2ddd3e;try{_0x2ddd3e=await stat(_0x546b4c);}catch(_0x54790c){throw appRuleError('app_rule_file_unreadable',_0x579d18(0x16e)+_0x52148c,_0x54790c instanceof Error?_0x54790c[_0x579d18(0x158)]:String(_0x54790c));}if(!_0x2ddd3e[_0x579d18(0x161)]())throw appRuleError(_0x579d18(0x15b),_0x579d18(0x154)+_0x52148c);if(_0x2ddd3e['size']>MAX_APP_RULE_BYTES)throw appRuleError('app_rule_content_too_large',_0x579d18(0x156));let _0x5c4a4a;try{_0x5c4a4a=await readFile(_0x546b4c);}catch(_0x40101d){throw appRuleError(_0x579d18(0x155),_0x579d18(0x171)+_0x52148c,_0x40101d instanceof Error?_0x40101d['message']:String(_0x40101d));}if(_0x5c4a4a[_0x579d18(0x17b)]>MAX_APP_RULE_BYTES)throw appRuleError(_0x579d18(0x183),'App\x20rule\x20content\x20exceeds\x20the\x20bounded\x20UTF-8\x20file\x20limit.');let _0x4e4238;try{_0x4e4238=new TextDecoder(_0x579d18(0x17a),{'fatal':!![],'ignoreBOM':!![]})['decode'](_0x5c4a4a);}catch{throw appRuleError(_0x579d18(0x163),'App\x20rule\x20file\x20is\x20not\x20valid\x20UTF-8:\x20'+_0x52148c);}if(_0x4e4238['length']>MAX_APP_RULE_UNITS)throw appRuleError('app_rule_content_too_large',_0x579d18(0x16f));if(!_0x4e4238[_0x579d18(0x169)]())throw appRuleError(_0x579d18(0x163),_0x579d18(0x157)+_0x52148c);return inspectAppRuleContent(_0x4e4238);}export function projectAppRule(_0xaac238,_0x1c7fce){const _0x5c4e83=a244_0x26c376;if(!_0x1c7fce)return{'type':_0xaac238,'fileName':appRuleFileName(_0xaac238),'contextScope':appRuleContextScope(_0xaac238),'enabled':![]};const _0x6edd1f=inspectAppRuleContent(_0x1c7fce[_0x5c4e83(0x16c)]);return{'type':_0xaac238,'fileName':appRuleFileName(_0xaac238),'contextScope':appRuleContextScope(_0xaac238),'enabled':!![],'id':_0x1c7fce['id'],'scope':_0x1c7fce[_0x5c4e83(0x164)],'appCode':_0x1c7fce[_0x5c4e83(0x153)],'version':_0x1c7fce[_0x5c4e83(0x174)],..._0x1c7fce[_0x5c4e83(0x15d)]!==undefined?{'indexStatus':_0x1c7fce[_0x5c4e83(0x15d)]}:{},'contentByteSize':_0x6edd1f[_0x5c4e83(0x175)],'contentHash':_0x6edd1f['contentHash'],..._0x1c7fce[_0x5c4e83(0x17d)]!==undefined&&_0x1c7fce[_0x5c4e83(0x17d)]!==null?{'createTime':_0x1c7fce[_0x5c4e83(0x17d)]}:{},..._0x1c7fce[_0x5c4e83(0x160)]!==undefined&&_0x1c7fce[_0x5c4e83(0x160)]!==null?{'updateTime':_0x1c7fce[_0x5c4e83(0x160)]}:{}};}export const APP_RULE_TYPE_FLAG={'name':a244_0x26c376(0x167),'type':a244_0x26c376(0x17f),'required':!![],'description':a244_0x26c376(0x181),'enum':[...APP_RULE_TYPES]};
1
+ const a244_0x535b2f=a244_0x41eb;(function(_0x53c17f,_0x2cec4d){const _0x25e2b5=a244_0x41eb,_0x125ded=_0x53c17f();while(!![]){try{const _0x2e252=-parseInt(_0x25e2b5(0x117))/0x1+-parseInt(_0x25e2b5(0x12b))/0x2*(parseInt(_0x25e2b5(0x12e))/0x3)+parseInt(_0x25e2b5(0x122))/0x4+parseInt(_0x25e2b5(0x102))/0x5+-parseInt(_0x25e2b5(0x100))/0x6+-parseInt(_0x25e2b5(0x107))/0x7+-parseInt(_0x25e2b5(0x10e))/0x8*(-parseInt(_0x25e2b5(0x106))/0x9);if(_0x2e252===_0x2cec4d)break;else _0x125ded['push'](_0x125ded['shift']());}catch(_0x1406ef){_0x125ded['push'](_0x125ded['shift']());}}}(a244_0x1ed9,0x79760));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=[a244_0x535b2f(0x118),a244_0x535b2f(0x114)];export const MAX_APP_RULE_UNITS=0x5*0x400*0x400;export const MAX_APP_RULE_BYTES=MAX_APP_RULE_UNITS*0x4;const APP_RULE_FILES={'rules':a244_0x535b2f(0x108),'database':a244_0x535b2f(0x101)},APP_RULE_CONTEXT_SCOPES={'rules':'page-api-development','database':a244_0x535b2f(0x123)};export function appRuleError(_0x45e3b0,_0xe82f7b,_0x209dab){return new CliError(_0x45e3b0,0x1,_0xe82f7b,_0x209dab);}export function readAppRuleType(_0x449e6e){const _0x162ae2=a244_0x535b2f,_0x2f1b16=_0x449e6e[_0x162ae2(0x126)](_0x162ae2(0x10d))[_0x162ae2(0x111)]()[_0x162ae2(0x116)]();if(_0x2f1b16!=='rules'&&_0x2f1b16!==_0x162ae2(0x114))throw appRuleError(_0x162ae2(0x12d),'--type\x20must\x20be\x20either\x20rules\x20or\x20database.');return _0x2f1b16;}export function appRuleFileName(_0x1184bb){return APP_RULE_FILES[_0x1184bb];}export function appRuleContextScope(_0x7c8689){return APP_RULE_CONTEXT_SCOPES[_0x7c8689];}export function inspectAppRuleContent(_0x15761e){const _0x35e18f=a244_0x535b2f,_0x4522ab=Buffer[_0x35e18f(0x120)](_0x15761e,_0x35e18f(0x119));return{'content':_0x15761e,'byteSize':_0x4522ab[_0x35e18f(0x112)],'contentHash':'sha256:'+createHash(_0x35e18f(0x121))[_0x35e18f(0x115)](_0x4522ab)[_0x35e18f(0x11d)]('hex')};}export async function readAppRuleFile(_0x31acd1){const _0x3dac62=a244_0x535b2f,_0x43a809=_0x31acd1[_0x3dac62(0x111)]();if(!_0x43a809)throw appRuleError('app_rule_file_required',_0x3dac62(0x128),_0x3dac62(0x105));const _0x5936dc=resolve(_0x43a809);let _0x4cdf6a;try{_0x4cdf6a=await stat(_0x5936dc);}catch(_0x1d6eb7){throw appRuleError('app_rule_file_unreadable',_0x3dac62(0x113)+_0x43a809,_0x1d6eb7 instanceof Error?_0x1d6eb7[_0x3dac62(0x125)]:String(_0x1d6eb7));}if(!_0x4cdf6a[_0x3dac62(0x127)]())throw appRuleError(_0x3dac62(0x109),_0x3dac62(0x103)+_0x43a809);if(_0x4cdf6a[_0x3dac62(0x10f)]>MAX_APP_RULE_BYTES)throw appRuleError('app_rule_content_too_large',_0x3dac62(0x11e));let _0xda9611;try{_0xda9611=await readFile(_0x5936dc);}catch(_0x2bee0b){throw appRuleError(_0x3dac62(0x110),'Cannot\x20read\x20app\x20rule\x20file:\x20'+_0x43a809,_0x2bee0b instanceof Error?_0x2bee0b['message']:String(_0x2bee0b));}if(_0xda9611[_0x3dac62(0x112)]>MAX_APP_RULE_BYTES)throw appRuleError(_0x3dac62(0x11f),_0x3dac62(0x11e));let _0x38adab;try{_0x38adab=new TextDecoder(_0x3dac62(0x104),{'fatal':!![],'ignoreBOM':!![]})['decode'](_0xda9611);}catch{throw appRuleError(_0x3dac62(0x11c),_0x3dac62(0x10b)+_0x43a809);}if(_0x38adab['length']>MAX_APP_RULE_UNITS)throw appRuleError(_0x3dac62(0x11f),_0x3dac62(0x10c));if(!_0x38adab[_0x3dac62(0x111)]())throw appRuleError(_0x3dac62(0x11c),'App\x20rule\x20file\x20is\x20blank:\x20'+_0x43a809);return inspectAppRuleContent(_0x38adab);}export function projectAppRule(_0xfca9f8,_0x41edc6){const _0x49ea44=a244_0x535b2f;if(!_0x41edc6)return{'type':_0xfca9f8,'fileName':appRuleFileName(_0xfca9f8),'contextScope':appRuleContextScope(_0xfca9f8),'enabled':![]};const _0x57c990=inspectAppRuleContent(_0x41edc6[_0x49ea44(0x129)]);return{'type':_0xfca9f8,'fileName':appRuleFileName(_0xfca9f8),'contextScope':appRuleContextScope(_0xfca9f8),'enabled':!![],'id':_0x41edc6['id'],'scope':_0x41edc6[_0x49ea44(0x11a)],'appCode':_0x41edc6[_0x49ea44(0x10a)],'version':_0x41edc6['version'],..._0x41edc6[_0x49ea44(0x12a)]!==undefined?{'indexStatus':_0x41edc6['indexStatus']}:{},'contentByteSize':_0x57c990['byteSize'],'contentHash':_0x57c990[_0x49ea44(0x12c)],..._0x41edc6[_0x49ea44(0x124)]!==undefined&&_0x41edc6[_0x49ea44(0x124)]!==null?{'createTime':_0x41edc6[_0x49ea44(0x124)]}:{},..._0x41edc6[_0x49ea44(0x12f)]!==undefined&&_0x41edc6[_0x49ea44(0x12f)]!==null?{'updateTime':_0x41edc6[_0x49ea44(0x12f)]}:{}};}function a244_0x1ed9(){const _0x1877a7=['from','sha256','3703524hhKqEb','database-analysis','createTime','message','str','isFile','--file\x20is\x20required.','content','indexStatus','358pSScLl','contentHash','app_rule_type_invalid','12306SKKkoO','updateTime','string','4201416iIHKrZ','DATABASE.md','1675790KUsziY','App\x20rule\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','utf-8','Pass\x20a\x20UTF-8\x20Markdown\x20file.','17619957eJqXhW','2410142CEoNnQ','RULES.md','app_rule_file_invalid','appCode','App\x20rule\x20file\x20is\x20not\x20valid\x20UTF-8:\x20','App\x20rule\x20content\x20exceeds\x205242880\x20UTF-16\x20units.','type','8YFyVdC','size','app_rule_file_unreadable','trim','byteLength','Cannot\x20access\x20app\x20rule\x20file:\x20','database','update','toLowerCase','942508NBcXGI','rules','utf8','scope','Context\x20rule\x20type:\x20rules\x20for\x20page/API\x20development\x20agents\x20(DB\x20Agent\x20excluded),\x20database\x20for\x20DB\x20Agent\x20database\x20analysis','app_rule_content_invalid','digest','App\x20rule\x20content\x20exceeds\x20the\x20bounded\x20UTF-8\x20file\x20limit.','app_rule_content_too_large'];a244_0x1ed9=function(){return _0x1877a7;};return a244_0x1ed9();}function a244_0x41eb(_0x4e38e7,_0x1bd9f7){_0x4e38e7=_0x4e38e7-0x100;const _0x1ed9b4=a244_0x1ed9();let _0x41ebd4=_0x1ed9b4[_0x4e38e7];return _0x41ebd4;}export const APP_RULE_TYPE_FLAG={'name':'type','type':a244_0x535b2f(0x130),'required':!![],'description':a244_0x535b2f(0x11b),'enum':[...APP_RULE_TYPES]};
@@ -1 +1 @@
1
- const a245_0x5d0921=a245_0x1e80;(function(_0x584659,_0x28e2ee){const _0x40cbbe=a245_0x1e80,_0x4bd63b=_0x584659();while(!![]){try{const _0x20b525=parseInt(_0x40cbbe(0xd9))/0x1+parseInt(_0x40cbbe(0xec))/0x2+-parseInt(_0x40cbbe(0xe3))/0x3*(-parseInt(_0x40cbbe(0xee))/0x4)+parseInt(_0x40cbbe(0xfc))/0x5+parseInt(_0x40cbbe(0xe7))/0x6+-parseInt(_0x40cbbe(0x109))/0x7*(-parseInt(_0x40cbbe(0x10b))/0x8)+-parseInt(_0x40cbbe(0xfd))/0x9;if(_0x20b525===_0x28e2ee)break;else _0x4bd63b['push'](_0x4bd63b['shift']());}catch(_0x3e8511){_0x4bd63b['push'](_0x4bd63b['shift']());}}}(a245_0x3bc9,0x5bb71));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';function a245_0x3bc9(){const _0x3634aa=['\x20run\x20','No\x20scripts\x20defined\x20in\x20package.json.','Script\x20name\x20defined\x20in\x20package.json','\x20\x20\x20\x20','run','353305DYvWaN','9453546CLZVxj','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','\x0a\x20\x20Available\x20scripts:\x0a','belowMinimum','bun','\x20run\x20preview\x20--watch','args','write','start','dev','error','\x20run\x20build','14qyRvee','(none)','86224DOOAhs','\x22\x20not\x20found\x20in\x20package.json.','has','log','--watch','path','.bin','inherit','Script\x20\x22','\x20run\x20start','575647BjrMuT','keys','validation','build','boolean','npm','preview','\x20run\x20preview','parse','close','69wrKpAF','Available:\x20','\x20run\x20<script>\x0a','push','759654YzAqde','\x0a\x20\x20Usage:\x20','bun.lockb','\x20\x20EXAMPLES','pnpm','498882GXXZdM','vite','66460rronOC','Domain\x20routing\x20synchronized:\x20','slice','node_modules','scripts','changed','all','No\x20package.json\x20found\x20in\x20current\x20directory.','watch'];a245_0x3bc9=function(){return _0x3634aa;};return a245_0x3bc9();}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([a245_0x5d0921(0x105),'dev']),DOMAIN_ROUTING_SYNC_SCRIPTS=new Set([a245_0x5d0921(0x105),a245_0x5d0921(0x106),a245_0x5d0921(0xdc),a245_0x5d0921(0xdf)]);export function syncProjectDomainRoutingBeforeScript(_0x3f4750,_0x3bbaf7){const _0x187d3f=a245_0x5d0921;if(!DOMAIN_ROUTING_SYNC_SCRIPTS[_0x187d3f(0x10d)](_0x3bbaf7))return null;const _0x450ce5=findProjectRootDirectory(_0x3f4750);if(!resolveConfigPath(_0x450ce5))return null;const _0x59d6a7=writeProjectDomainRoutingManifest(_0x450ce5);return{'path':_0x59d6a7['path'],'changed':_0x59d6a7[_0x187d3f(0xf3)]};}function readPackageScripts(_0x11e47f){const _0x3d53fa=a245_0x5d0921,_0xc2b5bd=resolve(_0x11e47f,'package.json');if(!existsSync(_0xc2b5bd))return null;try{const _0xa44b39=JSON[_0x3d53fa(0xe1)](readFileSync(_0xc2b5bd,'utf-8'));return _0xa44b39[_0x3d53fa(0xf2)]??{};}catch{return null;}}function detectPackageManager(_0x994d67){const _0x4d1854=a245_0x5d0921;if(existsSync(resolve(_0x994d67,_0x4d1854(0xe9)))||existsSync(resolve(_0x994d67,'bun.lock')))return _0x4d1854(0x101);if(existsSync(resolve(_0x994d67,'pnpm-lock.yaml')))return _0x4d1854(0xeb);if(existsSync(resolve(_0x994d67,'yarn.lock')))return'yarn';return _0x4d1854(0xde);}async function versionCheck(_0x354f3b){const _0xe98876=a245_0x5d0921,_0x13b5ed=await checkCliVersion();(_0x13b5ed['needsUpgrade']||_0x13b5ed[_0xe98876(0x100)])&&(printCliUpgradeWarning(_0x13b5ed),assertCliVersionSupported(_0x13b5ed));const _0xd9f97e=await checkSdkVersion(_0x354f3b);if(_0xd9f97e['needsUpgrade'])printSdkUpgradeWarning(_0xd9f97e);}function spawnScript(_0x45831b,_0x29c96e,_0x580c51,_0x714d73){return new Promise((_0x3a3604,_0x3d28df)=>{const _0x26b705=a245_0x1e80,_0x1e84e1=[_0x26b705(0xfb),_0x29c96e,..._0x580c51],_0x4fb714=spawn(_0x45831b,_0x1e84e1,{'cwd':_0x714d73,'stdio':_0x26b705(0xd6),'shell':!![],'env':{...process.env,'PATH':''+join(_0x714d73,_0x26b705(0xf1),_0x26b705(0xd5))+delimiter+process.env.PATH}});_0x4fb714['on'](_0x26b705(0xe2),_0x285a0b=>{const _0x2f739a=_0x26b705;if(_0x285a0b===0x0||_0x285a0b===null)_0x3a3604();else _0x3d28df(new Error(_0x45831b+_0x2f739a(0xf7)+_0x29c96e+'\x20exited\x20with\x20code\x20'+_0x285a0b));}),_0x4fb714['on']('error',_0x3d28df);});}function a245_0x1e80(_0xf05e5a,_0x9fbe17){_0xf05e5a=_0xf05e5a-0xd4;const _0x3bc991=a245_0x3bc9();let _0x1e803c=_0x3bc991[_0xf05e5a];return _0x1e803c;}function spawnViteBuildWatch(_0x570e57){return new Promise((_0x52481d,_0x1b43f9)=>{const _0x3fb403=a245_0x1e80,_0x3588ca=spawn(_0x3fb403(0xed),[_0x3fb403(0xdc),_0x3fb403(0x10f)],{'cwd':_0x570e57,'stdio':_0x3fb403(0xd6),'shell':!![],'env':{...process.env,'PATH':''+join(_0x570e57,'node_modules',_0x3fb403(0xd5))+delimiter+process.env.PATH}});_0x3588ca['on'](_0x3fb403(0xe2),_0x5c0ca8=>{const _0x1db0c9=_0x3fb403;if(_0x5c0ca8===0x0||_0x5c0ca8===null)_0x52481d();else _0x1b43f9(new Error(_0x1db0c9(0xfe)+_0x5c0ca8));}),_0x3588ca['on'](_0x3fb403(0x107),_0x1b43f9);});}function spawnVitePreview(_0x597593){return new Promise((_0xc01cfd,_0x345b70)=>{const _0x25509c=a245_0x1e80,_0x259b65=spawn(_0x25509c(0xed),[_0x25509c(0xdf)],{'cwd':_0x597593,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x597593,_0x25509c(0xf1),'.bin')+delimiter+process.env.PATH}});_0x259b65['on']('close',_0x21b0ae=>{if(_0x21b0ae===0x0||_0x21b0ae===null)_0xc01cfd();else _0x345b70(new Error('vite\x20preview\x20exited\x20with\x20code\x20'+_0x21b0ae));}),_0x259b65['on']('error',_0x345b70);});}const runFlags=[{'name':a245_0x5d0921(0xf6),'type':a245_0x5d0921(0xdd),'description':'Enable\x20watch\x20mode\x20for\x20preview','default':![]}];export const runDefinition={'service':a245_0x5d0921(0xfb),'command':'run','description':'Run\x20a\x20package.json\x20script','risk':a245_0x5d0921(0x104),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'script','description':a245_0x5d0921(0xf9),'required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x4a4076=a245_0x5d0921,_0x3b78b2=[];return _0x3b78b2[_0x4a4076(0xe6)](_0x4a4076(0xea)),_0x3b78b2[_0x4a4076(0xe6)]('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x4a4076(0xd8)),_0x3b78b2[_0x4a4076(0xe6)]('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x4a4076(0x108)),_0x3b78b2[_0x4a4076(0xe6)]('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x4a4076(0xe0)),_0x3b78b2['push']('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x4a4076(0x102)),_0x3b78b2['join']('\x0a');},async 'execute'(_0x183f5){const _0x3c5664=a245_0x5d0921,_0x46647f=process['cwd'](),_0x4c00a5=_0x183f5[_0x3c5664(0x103)][0x0],_0xd24b09=_0x183f5[_0x3c5664(0x103)][_0x3c5664(0xf0)](0x1),_0x48c3ff=readPackageScripts(_0x46647f);if(!_0x48c3ff)throw CliErrors[_0x3c5664(0xdb)](_0x3c5664(0xf5));if(!_0x4c00a5){const _0x564772=Object[_0x3c5664(0xda)](_0x48c3ff);if(_0x564772['length']===0x0)console[_0x3c5664(0x10e)](_0x3c5664(0xf8));else{console['log'](_0x3c5664(0xff));for(const _0x363e08 of _0x564772){console[_0x3c5664(0x10e)](_0x3c5664(0xfa)+_0x363e08);}console[_0x3c5664(0x10e)](_0x3c5664(0xe8)+CLI_BIN_NAME+_0x3c5664(0xe5));}return{'ok':!![]};}if(!_0x48c3ff[_0x4c00a5])throw CliErrors['validation'](_0x3c5664(0xd7)+_0x4c00a5+_0x3c5664(0x10c),_0x3c5664(0xe4)+(Object[_0x3c5664(0xda)](_0x48c3ff)['join'](',\x20')||_0x3c5664(0x10a)));const _0x111e5a=detectPackageManager(_0x46647f),_0x3be9a4=syncProjectDomainRoutingBeforeScript(_0x46647f,_0x4c00a5);_0x3be9a4?.[_0x3c5664(0xf3)]&&console[_0x3c5664(0x107)](_0x3c5664(0xef)+_0x3be9a4[_0x3c5664(0xd4)]);VERSION_CHECK_SCRIPTS[_0x3c5664(0x10d)](_0x4c00a5)&&await versionCheck(_0x46647f);if(_0x4c00a5===_0x3c5664(0xdf)&&_0x183f5['bool']('watch'))return await Promise[_0x3c5664(0xf4)]([spawnViteBuildWatch(_0x46647f),spawnVitePreview(_0x46647f)]),{'ok':!![]};return await spawnScript(_0x111e5a,_0x4c00a5,_0xd24b09,_0x46647f),{'ok':!![]};}};
1
+ const a245_0x1c223f=a245_0xc861;(function(_0xa508c,_0x442a77){const _0x1f76e5=a245_0xc861,_0x44e515=_0xa508c();while(!![]){try{const _0xd1f8fc=-parseInt(_0x1f76e5(0xfd))/0x1*(-parseInt(_0x1f76e5(0xdf))/0x2)+-parseInt(_0x1f76e5(0xd3))/0x3+-parseInt(_0x1f76e5(0xeb))/0x4*(-parseInt(_0x1f76e5(0xea))/0x5)+-parseInt(_0x1f76e5(0xe6))/0x6+-parseInt(_0x1f76e5(0xfa))/0x7*(parseInt(_0x1f76e5(0xc4))/0x8)+-parseInt(_0x1f76e5(0xc5))/0x9*(-parseInt(_0x1f76e5(0xd1))/0xa)+-parseInt(_0x1f76e5(0xf6))/0xb*(-parseInt(_0x1f76e5(0xcb))/0xc);if(_0xd1f8fc===_0x442a77)break;else _0x44e515['push'](_0x44e515['shift']());}catch(_0x1b355a){_0x44e515['push'](_0x44e515['shift']());}}}(a245_0x13cb,0x1c789));import{readFileSync,existsSync}from'node:fs';import{CLI_BIN_NAME}from'../../constant/cli.js';function a245_0xc861(_0x4df541,_0x48a59d){_0x4df541=_0x4df541-0xbc;const _0x13cbe1=a245_0x13cb();let _0xc861b7=_0x13cbe1[_0x4df541];return _0xc861b7;}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([a245_0x1c223f(0xe2),a245_0x1c223f(0xf5)]),DOMAIN_ROUTING_SYNC_SCRIPTS=new Set([a245_0x1c223f(0xe2),a245_0x1c223f(0xf5),'build','preview']);function a245_0x13cb(){const _0x1b0a69=['\x20run\x20<script>\x0a','utf-8','No\x20scripts\x20defined\x20in\x20package.json.','\x22\x20not\x20found\x20in\x20package.json.','Available:\x20','1488csVAbh','watch','all','build','\x20\x20\x20\x20','script','84130eNTFLF','path','128397oVIhPN','close','\x20run\x20build','join','\x20run\x20start','error','Run\x20a\x20package.json\x20script','\x20run\x20preview\x20--watch','Script\x20\x22','npm','pnpm-lock.yaml','keys','288974OQgyZH','\x20run\x20','\x0a\x20\x20Available\x20scripts:\x0a','start','bun','\x20\x20EXAMPLES','\x20exited\x20with\x20code\x20','710724NajmDq','preview','Domain\x20routing\x20synchronized:\x20','yarn','5fjtres','23452zWZtMR','parse','cwd','inherit','bun.lockb','(none)','No\x20package.json\x20found\x20in\x20current\x20directory.','--watch','write','vite\x20preview\x20exited\x20with\x20code\x20','dev','16841qbSaXm','has','needsUpgrade','bun.lock','44513hYPLjI','vite','slice','1hhBIWt','push','run','changed','Enable\x20watch\x20mode\x20for\x20preview','belowMinimum','.bin','node_modules','log','validation','216ouWPog','117inVorS'];a245_0x13cb=function(){return _0x1b0a69;};return a245_0x13cb();}export function syncProjectDomainRoutingBeforeScript(_0x28b49d,_0x23499a){const _0x43781b=a245_0x1c223f;if(!DOMAIN_ROUTING_SYNC_SCRIPTS[_0x43781b(0xf7)](_0x23499a))return null;const _0x322982=findProjectRootDirectory(_0x28b49d);if(!resolveConfigPath(_0x322982))return null;const _0x2a0305=writeProjectDomainRoutingManifest(_0x322982);return{'path':_0x2a0305[_0x43781b(0xd2)],'changed':_0x2a0305[_0x43781b(0xbd)]};}function readPackageScripts(_0x25def5){const _0x316710=a245_0x1c223f,_0x15238a=resolve(_0x25def5,'package.json');if(!existsSync(_0x15238a))return null;try{const _0x522621=JSON[_0x316710(0xec)](readFileSync(_0x15238a,_0x316710(0xc7)));return _0x522621['scripts']??{};}catch{return null;}}function detectPackageManager(_0x52c647){const _0x5f0a05=a245_0x1c223f;if(existsSync(resolve(_0x52c647,_0x5f0a05(0xef)))||existsSync(resolve(_0x52c647,_0x5f0a05(0xf9))))return _0x5f0a05(0xe3);if(existsSync(resolve(_0x52c647,_0x5f0a05(0xdd))))return'pnpm';if(existsSync(resolve(_0x52c647,'yarn.lock')))return _0x5f0a05(0xe9);return _0x5f0a05(0xdc);}async function versionCheck(_0x4c1e79){const _0x5496b0=a245_0x1c223f,_0x58764a=await checkCliVersion();(_0x58764a['needsUpgrade']||_0x58764a[_0x5496b0(0xbf)])&&(printCliUpgradeWarning(_0x58764a),assertCliVersionSupported(_0x58764a));const _0x54c0d2=await checkSdkVersion(_0x4c1e79);if(_0x54c0d2[_0x5496b0(0xf8)])printSdkUpgradeWarning(_0x54c0d2);}function spawnScript(_0x3ab1bd,_0x3b593b,_0x328b4f,_0x397f0f){return new Promise((_0x701202,_0x5022ae)=>{const _0x3ece45=a245_0xc861,_0x46ba0a=[_0x3ece45(0xbc),_0x3b593b,..._0x328b4f],_0x268df9=spawn(_0x3ab1bd,_0x46ba0a,{'cwd':_0x397f0f,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x397f0f,_0x3ece45(0xc1),_0x3ece45(0xc0))+delimiter+process.env.PATH}});_0x268df9['on'](_0x3ece45(0xd4),_0x77e9c2=>{const _0x5d5f41=_0x3ece45;if(_0x77e9c2===0x0||_0x77e9c2===null)_0x701202();else _0x5022ae(new Error(_0x3ab1bd+_0x5d5f41(0xe0)+_0x3b593b+_0x5d5f41(0xe5)+_0x77e9c2));}),_0x268df9['on'](_0x3ece45(0xd8),_0x5022ae);});}function spawnViteBuildWatch(_0x1d3c7a){return new Promise((_0x4e97e6,_0x386d2a)=>{const _0x2761bd=a245_0xc861,_0x4a8d34=spawn(_0x2761bd(0xfb),[_0x2761bd(0xce),_0x2761bd(0xf2)],{'cwd':_0x1d3c7a,'stdio':_0x2761bd(0xee),'shell':!![],'env':{...process.env,'PATH':''+join(_0x1d3c7a,_0x2761bd(0xc1),'.bin')+delimiter+process.env.PATH}});_0x4a8d34['on'](_0x2761bd(0xd4),_0x52900f=>{if(_0x52900f===0x0||_0x52900f===null)_0x4e97e6();else _0x386d2a(new Error('vite\x20build\x20--watch\x20exited\x20with\x20code\x20'+_0x52900f));}),_0x4a8d34['on'](_0x2761bd(0xd8),_0x386d2a);});}function spawnVitePreview(_0x313701){return new Promise((_0x1480c5,_0x39cbc0)=>{const _0x22a237=a245_0xc861,_0xb70005=spawn('vite',[_0x22a237(0xe7)],{'cwd':_0x313701,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x313701,_0x22a237(0xc1),'.bin')+delimiter+process.env.PATH}});_0xb70005['on']('close',_0x273ee8=>{const _0x13cf14=_0x22a237;if(_0x273ee8===0x0||_0x273ee8===null)_0x1480c5();else _0x39cbc0(new Error(_0x13cf14(0xf4)+_0x273ee8));}),_0xb70005['on'](_0x22a237(0xd8),_0x39cbc0);});}const runFlags=[{'name':a245_0x1c223f(0xcc),'type':'boolean','description':a245_0x1c223f(0xbe),'default':![]}];export const runDefinition={'service':a245_0x1c223f(0xbc),'command':a245_0x1c223f(0xbc),'description':a245_0x1c223f(0xd9),'risk':a245_0x1c223f(0xf3),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a245_0x1c223f(0xd0),'description':'Script\x20name\x20defined\x20in\x20package.json','required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x120d1f=a245_0x1c223f,_0x5a62c8=[];return _0x5a62c8[_0x120d1f(0xfe)](_0x120d1f(0xe4)),_0x5a62c8[_0x120d1f(0xfe)](_0x120d1f(0xcf)+CLI_BIN_NAME+_0x120d1f(0xd7)),_0x5a62c8[_0x120d1f(0xfe)](_0x120d1f(0xcf)+CLI_BIN_NAME+_0x120d1f(0xd5)),_0x5a62c8[_0x120d1f(0xfe)](_0x120d1f(0xcf)+CLI_BIN_NAME+'\x20run\x20preview'),_0x5a62c8[_0x120d1f(0xfe)]('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x120d1f(0xda)),_0x5a62c8[_0x120d1f(0xd6)]('\x0a');},async 'execute'(_0x4c1f95){const _0x567278=a245_0x1c223f,_0x1077e=process[_0x567278(0xed)](),_0xcff2d0=_0x4c1f95['args'][0x0],_0x51ef88=_0x4c1f95['args'][_0x567278(0xfc)](0x1),_0xbe331e=readPackageScripts(_0x1077e);if(!_0xbe331e)throw CliErrors[_0x567278(0xc3)](_0x567278(0xf1));if(!_0xcff2d0){const _0x47272e=Object['keys'](_0xbe331e);if(_0x47272e['length']===0x0)console[_0x567278(0xc2)](_0x567278(0xc8));else{console[_0x567278(0xc2)](_0x567278(0xe1));for(const _0x4db9f3 of _0x47272e){console['log'](_0x567278(0xcf)+_0x4db9f3);}console[_0x567278(0xc2)]('\x0a\x20\x20Usage:\x20'+CLI_BIN_NAME+_0x567278(0xc6));}return{'ok':!![]};}if(!_0xbe331e[_0xcff2d0])throw CliErrors[_0x567278(0xc3)](_0x567278(0xdb)+_0xcff2d0+_0x567278(0xc9),_0x567278(0xca)+(Object[_0x567278(0xde)](_0xbe331e)['join'](',\x20')||_0x567278(0xf0)));const _0x461446=detectPackageManager(_0x1077e),_0x27c1ef=syncProjectDomainRoutingBeforeScript(_0x1077e,_0xcff2d0);_0x27c1ef?.[_0x567278(0xbd)]&&console[_0x567278(0xd8)](_0x567278(0xe8)+_0x27c1ef[_0x567278(0xd2)]);VERSION_CHECK_SCRIPTS['has'](_0xcff2d0)&&await versionCheck(_0x1077e);if(_0xcff2d0===_0x567278(0xe7)&&_0x4c1f95['bool'](_0x567278(0xcc)))return await Promise[_0x567278(0xcd)]([spawnViteBuildWatch(_0x1077e),spawnVitePreview(_0x1077e)]),{'ok':!![]};return await spawnScript(_0x461446,_0xcff2d0,_0x51ef88,_0x1077e),{'ok':!![]};}};
@@ -1 +1 @@
1
- const a246_0x265190=a246_0x4f70;function a246_0x4f70(_0xf66ab1,_0x383848){_0xf66ab1=_0xf66ab1-0x1c3;const _0x2a3e8d=a246_0x2a3e();let _0x4f70f3=_0x2a3e8d[_0xf66ab1];return _0x4f70f3;}function a246_0x2a3e(){const _0x317792=['5RIynXQ','3052347mjUNjY','4303208KlXVaS','json','17368587ntKsqH','18379WXNJaZ','export','5378032loggSr','5857145EXDWET','Export\x20machine-readable\x20command\x20schema\x20(JSON)','3839592KNKaKg','44RnHbse'];a246_0x2a3e=function(){return _0x317792;};return a246_0x2a3e();}(function(_0x588191,_0x14016c){const _0x1b6d2f=a246_0x4f70,_0x300087=_0x588191();while(!![]){try{const _0x11b3cb=parseInt(_0x1b6d2f(0x1c8))/0x1*(-parseInt(_0x1b6d2f(0x1ce))/0x2)+-parseInt(_0x1b6d2f(0x1c4))/0x3+parseInt(_0x1b6d2f(0x1c5))/0x4+parseInt(_0x1b6d2f(0x1c3))/0x5*(-parseInt(_0x1b6d2f(0x1cd))/0x6)+-parseInt(_0x1b6d2f(0x1cb))/0x7+parseInt(_0x1b6d2f(0x1ca))/0x8+parseInt(_0x1b6d2f(0x1c7))/0x9;if(_0x11b3cb===_0x14016c)break;else _0x300087['push'](_0x300087['shift']());}catch(_0x384316){_0x300087['push'](_0x300087['shift']());}}}(a246_0x2a3e,0xbe4b5));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x9321a7){const _0x20ea14=await buildSchemaPayload();return{'ok':!![],'data':_0x20ea14};}export const schemaDefinition={'service':'schema','command':a246_0x265190(0x1c9),'description':a246_0x265190(0x1cc),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a246_0x265190(0x1c6),'flags':[],'execute':execute};
1
+ function a246_0x134b(_0x3688fa,_0x4eeca1){_0x3688fa=_0x3688fa-0x1c0;const _0x36ec7b=a246_0x36ec();let _0x134b5b=_0x36ec7b[_0x3688fa];return _0x134b5b;}const a246_0x4bc652=a246_0x134b;(function(_0x40e6cd,_0xf2c737){const _0x51128f=a246_0x134b,_0x550f9a=_0x40e6cd();while(!![]){try{const _0x20fb1f=-parseInt(_0x51128f(0x1c7))/0x1*(-parseInt(_0x51128f(0x1c2))/0x2)+parseInt(_0x51128f(0x1c1))/0x3+parseInt(_0x51128f(0x1cc))/0x4+-parseInt(_0x51128f(0x1ca))/0x5+parseInt(_0x51128f(0x1c4))/0x6+-parseInt(_0x51128f(0x1c8))/0x7*(parseInt(_0x51128f(0x1c0))/0x8)+-parseInt(_0x51128f(0x1cb))/0x9;if(_0x20fb1f===_0xf2c737)break;else _0x550f9a['push'](_0x550f9a['shift']());}catch(_0x5db6b1){_0x550f9a['push'](_0x550f9a['shift']());}}}(a246_0x36ec,0x820a9));function a246_0x36ec(){const _0x536496=['15658119zchDNk','4224532LDWVzl','1510752IPPeMR','2620899PDzDcj','26296ZfUMmo','json','482172qpmttD','Export\x20machine-readable\x20command\x20schema\x20(JSON)','read','58KqVrBz','14YLfpWf','schema','612920IfLRgD'];a246_0x36ec=function(){return _0x536496;};return a246_0x36ec();}import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x50ab76){const _0x3b422d=await buildSchemaPayload();return{'ok':!![],'data':_0x3b422d};}export const schemaDefinition={'service':a246_0x4bc652(0x1c9),'command':'export','description':a246_0x4bc652(0x1c5),'risk':a246_0x4bc652(0x1c6),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a246_0x4bc652(0x1c3),'flags':[],'execute':execute};
@@ -1 +1 @@
1
- const a247_0x3eb7e4=a247_0x40f4;(function(_0x302020,_0x5f3841){const _0x3604d4=a247_0x40f4,_0x283970=_0x302020();while(!![]){try{const _0x4c07bb=-parseInt(_0x3604d4(0x1a7))/0x1+parseInt(_0x3604d4(0x1bf))/0x2*(parseInt(_0x3604d4(0x19b))/0x3)+parseInt(_0x3604d4(0x1d2))/0x4*(parseInt(_0x3604d4(0x196))/0x5)+parseInt(_0x3604d4(0x1c5))/0x6+parseInt(_0x3604d4(0x1b1))/0x7*(-parseInt(_0x3604d4(0x1ad))/0x8)+parseInt(_0x3604d4(0x1c0))/0x9+-parseInt(_0x3604d4(0x1b9))/0xa;if(_0x4c07bb===_0x5f3841)break;else _0x283970['push'](_0x283970['shift']());}catch(_0x25e9c2){_0x283970['push'](_0x283970['shift']());}}}(a247_0x165c,0x8b60e));import{writeFile}from'node:fs/promises';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 a247_0x165c(){const _0x411d8e=['SQL\x20name:','sqlRootDir','join','mybatisXml','</select>','flagMissing','213484FOwEaO','For\x20MyBatis\x20XML\x20SQL\x20with\x20dynamic\x20tags','number','isInteger','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','string','30DvfzhG','lockFilePath','sql','SQL\x20name\x20cannot\x20be\x20empty','toISOString','158511BszgHl','trim','dbId\x20must\x20be\x20a\x20positive\x20integer','nonInteractive','stringify','Select\x20the\x20local\x20SQL\x20mode:','<server-generated-sqlCode>','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','Plain\x20SQL\x20(sql)','map','utf8','dbName','614608GwqwrT','validation','Select\x20the\x20target\x20database:','sqlName','description','str','138536cXQAaC','__manual__','flag','Local\x20SQL\x20file\x20mode','84tXpAfn','length','catch','new','File\x20already\x20exists:\x20','SELECT\x201\x20AS\x20id;','dbId\x20cannot\x20be\x20empty','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','5336250GkLBpu','create','sqls','name','Created\x20SQL\x20query\x20','/smartapi/custom/saveUserCustomSql','26XjnJGb','1794303LWdFQd','appCode','db-id','isFinite','write','4322742POKezn','mode','Target\x20database\x20dbId:','sqlCode','parse','Invalid\x20database\x20selection\x20payload:\x20','dbId'];a247_0x165c=function(){return _0x411d8e;};return a247_0x165c();}function generateSqlTemplate(_0x376681){const _0x1cdbaf=a247_0x40f4;if(_0x376681===_0x1cdbaf(0x1cf))return['<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','\x20\x20SELECT\x201\x20AS\x20id',_0x1cdbaf(0x1d0),''][_0x1cdbaf(0x1ce)]('\x0a');return[_0x1cdbaf(0x1b6),'']['join']('\x0a');}export const sqlCreate={'service':'sql','command':a247_0x3eb7e4(0x1ba),'description':'Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','risk':a247_0x3eb7e4(0x1c4),'flags':[{'name':a247_0x3eb7e4(0x1bc),'type':a247_0x3eb7e4(0x195),'description':'SQL\x20query\x20display\x20name'},{'name':'db-id','type':'number','description':'Target\x20database\x20ID'},{'name':a247_0x3eb7e4(0x1c6),'type':a247_0x3eb7e4(0x195),'enum':[a247_0x3eb7e4(0x198),a247_0x3eb7e4(0x1cf)],'description':a247_0x3eb7e4(0x1b0)}],async 'validate'(_0x3ada23){const _0x2c225e=a247_0x3eb7e4;if(!_0x3ada23[_0x2c225e(0x19e)])return;if(!_0x3ada23[_0x2c225e(0x1ac)](_0x2c225e(0x1bc))[_0x2c225e(0x19c)]())throw CliErrors['flagMissing'](_0x2c225e(0x1bc),_0x2c225e(0x194));const _0x56223b=resolveProvidedDbId(_0x3ada23);if(typeof _0x56223b!==_0x2c225e(0x192)||!Number['isFinite'](_0x56223b)||_0x56223b<=0x0)throw CliErrors['flagMissing'](_0x2c225e(0x1c2),'--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.');if(!_0x3ada23[_0x2c225e(0x1ac)](_0x2c225e(0x1c6))[_0x2c225e(0x19c)]())throw CliErrors[_0x2c225e(0x1d1)](_0x2c225e(0x1c6),_0x2c225e(0x1b8));},async 'dryRun'(_0x244e8c){const _0x5f252c=a247_0x3eb7e4,_0x2fd121=loadSqlProjectConfig(_0x244e8c[_0x5f252c(0x1c1)]),{sqlName:_0x4738ef,dbId:_0x2bee5e,dbName:_0x5b40b7,mode:_0x1ef672}=await resolveSqlNewInputs(_0x244e8c),_0x599757=buildSqlRelativePath(_0x5f252c(0x1a1),_0x4738ef,_0x5b40b7,_0x1ef672,_0x2bee5e),_0x432f52=_0x2fd121[_0x5f252c(0x1cd)]+'/'+_0x599757;return{'method':'POST','url':_0x5f252c(0x1be),'body':{'appCode':_0x244e8c[_0x5f252c(0x1c1)],'sqlName':_0x4738ef,'dbId':_0x2bee5e,'mode':_0x1ef672,'localPath':_0x432f52},'description':'Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20'+_0x2fd121[_0x5f252c(0x1cd)]};},async 'execute'(_0x501e7b){const _0x2d8704=a247_0x3eb7e4,_0xb95c7f=loadSqlProjectConfig(_0x501e7b[_0x2d8704(0x1c1)]),{sqlName:_0x44bdae,dbId:_0x3dab7d,dbName:_0x7bba24,mode:_0x412a70}=await resolveSqlNewInputs(_0x501e7b),_0xd2781a=generateSqlTemplate(_0x412a70),_0x2d2284=await createSqlQuery({'appCode':_0x501e7b[_0x2d8704(0x1c1)],'sqlName':_0x44bdae,'dbId':_0x3dab7d,'sqlContent':_0xd2781a}),_0x261523=ensureRemoteSqlContent(_0x2d2284),_0x36dac0=_0x7bba24||await getDbName(_0x501e7b[_0x2d8704(0x1c1)],_0x3dab7d)['catch'](()=>undefined),_0x2b821e=buildSqlRelativePath(_0x2d2284[_0x2d8704(0x1c8)],_0x2d2284[_0x2d8704(0x1aa)],_0x36dac0,_0x412a70,_0x3dab7d),_0x731e59=_0xb95c7f['sqlRootDir']+'/'+_0x2b821e,_0x4c3512=buildLocalSqlFileContent({'sqlCode':_0x2d2284[_0x2d8704(0x1c8)],'sqlName':_0x2d2284[_0x2d8704(0x1aa)],'dbId':_0x2d2284[_0x2d8704(0x1cb)]},_0x261523,{'dbName':_0x36dac0,'mode':_0x412a70,'syncedAt':new Date()[_0x2d8704(0x19a)](),'description':_0x2d2284[_0x2d8704(0x1ab)]});if(await fileExists(_0x731e59))throw CliErrors[_0x2d8704(0x1a8)](_0x2d8704(0x1b5)+_0x731e59);await ensureParentDirectory(_0x731e59),await writeFile(_0x731e59,_0x4c3512,_0x2d8704(0x1a5));const _0x3febbc=await readSqlLockFile(_0xb95c7f[_0x2d8704(0x197)]),{lockData:_0x3a116e,appLock:_0x24ee2f}=ensureSqlLockScope(_0x3febbc??createEmptySqlLock(),_0xb95c7f[_0x2d8704(0x1c1)],_0xb95c7f['sqlRoot'],_0x2d8704(0x1b4));return _0x24ee2f[_0x2d8704(0x1bb)][_0x2d2284['sqlCode']]={...buildSqlLockEntry(_0x2d2284,_0x261523,computeSqlContentHash(_0x4c3512),{'dbName':_0x36dac0}),'path':_0x2b821e,'mode':_0x412a70},_0x24ee2f['lastSync']=new Date()['toISOString'](),await writeSqlLockFile(_0xb95c7f[_0x2d8704(0x197)],_0x3a116e),{'ok':!![],'data':{'id':_0x2d2284['id'],'sqlCode':_0x2d2284[_0x2d8704(0x1c8)],'sqlName':_0x2d2284[_0x2d8704(0x1aa)],'dbId':_0x2d2284[_0x2d8704(0x1cb)],'path':_0x731e59,'mode':_0x412a70},'message':_0x2d8704(0x1bd)+_0x2d2284[_0x2d8704(0x1c8)]};}};async function resolveSqlNewInputs(_0x4800f6){const _0x1e94ca=await resolveSqlNameInput(_0x4800f6),{dbId:_0x27d286,dbName:_0x4d0493}=await resolveDbSelection(_0x4800f6),_0x25376b=await resolveSqlModeInput(_0x4800f6);return{'sqlName':_0x1e94ca,'dbId':_0x27d286,'dbName':_0x4d0493,'mode':_0x25376b};}async function resolveSqlNameInput(_0x59d65e){const _0x4977cc=a247_0x3eb7e4,_0x1fe493=_0x59d65e[_0x4977cc(0x1ac)](_0x4977cc(0x1bc))[_0x4977cc(0x19c)]();if(_0x1fe493)return _0x1fe493;if(_0x59d65e['nonInteractive'])throw CliErrors['flagMissing']('name',_0x4977cc(0x194));return(await input({'message':_0x4977cc(0x1cc),'validate':_0x11fb30=>_0x11fb30[_0x4977cc(0x19c)]()?!![]:_0x4977cc(0x199)}))[_0x4977cc(0x19c)]();}async function resolveDbSelection(_0x4e2bc6){const _0x2b2715=a247_0x3eb7e4,_0xb40d06=resolveProvidedDbId(_0x4e2bc6);if(typeof _0xb40d06===_0x2b2715(0x192)&&Number[_0x2b2715(0x1c3)](_0xb40d06)&&_0xb40d06>0x0)return{'dbId':_0xb40d06,'dbName':await getDbName(_0x4e2bc6[_0x2b2715(0x1c1)],_0xb40d06)[_0x2b2715(0x1b3)](()=>undefined)};if(_0x4e2bc6[_0x2b2715(0x19e)])throw CliErrors[_0x2b2715(0x1d1)]('db-id',_0x2b2715(0x1a2));const _0x13ed55=await listDatabases(_0x4e2bc6[_0x2b2715(0x1c1)])[_0x2b2715(0x1b3)](()=>[]);if(_0x13ed55[_0x2b2715(0x1b2)]===0x1)return{'dbId':_0x13ed55[0x0][_0x2b2715(0x1cb)],'dbName':_0x13ed55[0x0]['dbName']};if(_0x13ed55[_0x2b2715(0x1b2)]>0x1){const _0x3b785c=await select({'message':_0x2b2715(0x1a9),'choices':[..._0x13ed55[_0x2b2715(0x1a4)](_0x12d19d=>({'name':_0x12d19d[_0x2b2715(0x1a6)]+'\x20('+_0x12d19d['dbId']+')','value':serializeDbSelection(_0x12d19d)})),{'name':'✎\x20Enter\x20dbId\x20manually','value':_0x2b2715(0x1ae)}]});if(_0x3b785c!==_0x2b2715(0x1ae))return deserializeDbSelection(_0x3b785c);}const _0x17ff91=await input({'message':_0x2b2715(0x1c7),'validate':_0x1ede53=>{const _0x28a30d=_0x2b2715,_0xe804e=_0x1ede53[_0x28a30d(0x19c)]();if(!_0xe804e)return _0x28a30d(0x1b7);const _0x1d7d0d=Number(_0xe804e);if(!Number[_0x28a30d(0x193)](_0x1d7d0d)||_0x1d7d0d<=0x0)return _0x28a30d(0x19d);return!![];}});return{'dbId':Number(_0x17ff91[_0x2b2715(0x19c)]())};}async function resolveSqlModeInput(_0x495d84){const _0x570ab0=a247_0x3eb7e4,_0xee67be=_0x495d84[_0x570ab0(0x1ac)](_0x570ab0(0x1c6))[_0x570ab0(0x19c)]();if(_0xee67be==='sql'||_0xee67be===_0x570ab0(0x1cf))return _0xee67be;if(_0x495d84[_0x570ab0(0x19e)])throw CliErrors[_0x570ab0(0x1d1)](_0x570ab0(0x1c6),_0x570ab0(0x1b8));return await select({'message':_0x570ab0(0x1a0),'choices':[{'name':_0x570ab0(0x1a3),'value':_0x570ab0(0x198),'description':'For\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20statements\x20that\x20run\x20directly'},{'name':'MyBatis\x20XML\x20(mybatisXml)','value':_0x570ab0(0x1cf),'description':_0x570ab0(0x191)}]});}function a247_0x40f4(_0x47c5ff,_0x4cfaee){_0x47c5ff=_0x47c5ff-0x191;const _0x165c5f=a247_0x165c();let _0x40f40f=_0x165c5f[_0x47c5ff];return _0x40f40f;}function serializeDbSelection(_0x3df7f0){const _0xfcd255=a247_0x3eb7e4;return JSON[_0xfcd255(0x19f)]({'dbId':_0x3df7f0[_0xfcd255(0x1cb)],'dbName':_0x3df7f0[_0xfcd255(0x1a6)]});}function deserializeDbSelection(_0xf69d10){const _0x3a2bc0=a247_0x3eb7e4;try{const _0x523796=JSON[_0x3a2bc0(0x1c9)](_0xf69d10);if(typeof _0x523796['dbId']==='number'&&Number[_0x3a2bc0(0x1c3)](_0x523796[_0x3a2bc0(0x1cb)]))return{'dbId':_0x523796[_0x3a2bc0(0x1cb)],'dbName':_0x523796[_0x3a2bc0(0x1a6)]};}catch{}throw CliErrors[_0x3a2bc0(0x1a8)](_0x3a2bc0(0x1ca)+_0xf69d10);}function resolveProvidedDbId(_0x1e669d){const _0x13c028=a247_0x3eb7e4,_0x22b0b4=_0x1e669d[_0x13c028(0x1af)](_0x13c028(0x1c2));if(typeof _0x22b0b4===_0x13c028(0x192)&&Number[_0x13c028(0x1c3)](_0x22b0b4))return _0x22b0b4;return undefined;}
1
+ const a247_0x54982a=a247_0x2581;(function(_0x1d6587,_0x1b2356){const _0x53ae59=a247_0x2581,_0x44bb6a=_0x1d6587();while(!![]){try{const _0x3a6f2c=parseInt(_0x53ae59(0x86))/0x1+-parseInt(_0x53ae59(0xb0))/0x2*(parseInt(_0x53ae59(0x9d))/0x3)+parseInt(_0x53ae59(0x8c))/0x4*(parseInt(_0x53ae59(0xb6))/0x5)+-parseInt(_0x53ae59(0xaa))/0x6+-parseInt(_0x53ae59(0x8b))/0x7+-parseInt(_0x53ae59(0x88))/0x8+parseInt(_0x53ae59(0xab))/0x9*(parseInt(_0x53ae59(0x99))/0xa);if(_0x3a6f2c===_0x1b2356)break;else _0x44bb6a['push'](_0x44bb6a['shift']());}catch(_0x24bd41){_0x44bb6a['push'](_0x44bb6a['shift']());}}}(a247_0x5b82,0x576fc));function a247_0x2581(_0x11c36e,_0x4f981d){_0x11c36e=_0x11c36e-0x76;const _0x5b82ec=a247_0x5b82();let _0x258111=_0x5b82ec[_0x11c36e];return _0x258111;}import{writeFile}from'node:fs/promises';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';function a247_0x5b82(){const _0x623017=['flagMissing','✎\x20Enter\x20dbId\x20manually','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','File\x20already\x20exists:\x20','Local\x20SQL\x20file\x20mode','Target\x20database\x20dbId:','/smartapi/custom/saveUserCustomSql','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','mode','utf8','23667gEQWCt','parse','1033248KJbUsW','Target\x20database\x20ID','SQL\x20name:','2269925RmadUC','468548nvaEzZ','length','trim','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','description','MyBatis\x20XML\x20(mybatisXml)','Plain\x20SQL\x20(sql)','sqlName','name','dbId','SELECT\x201\x20AS\x20id;','join','map','170wZXiKt','sqlRootDir','nonInteractive','__manual__','10515aWbwFM','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','string','lastSync','appCode','Created\x20SQL\x20query\x20','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','Invalid\x20database\x20selection\x20payload:\x20','sqlCode','db-id','mybatisXml','For\x20MyBatis\x20XML\x20SQL\x20with\x20dynamic\x20tags','number','2175666AbocUL','715941ILpkUB','isFinite','sql','catch','flag','182JwedtZ','isInteger','<server-generated-sqlCode>','Select\x20the\x20target\x20database:','For\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20statements\x20that\x20run\x20directly','dbId\x20must\x20be\x20a\x20positive\x20integer','5weDTBV','str','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','write','sqls','\x20\x20SELECT\x201\x20AS\x20id','dbName'];a247_0x5b82=function(){return _0x623017;};return a247_0x5b82();}import{buildSqlRelativePath}from'../../core/sql-sync/utils.js';import{CliErrors}from'../../errors.js';import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function generateSqlTemplate(_0x3ddd7d){const _0x1150f4=a247_0x2581;if(_0x3ddd7d===_0x1150f4(0xa7))return[_0x1150f4(0x8f),_0x1150f4(0x7a),'</select>',''][_0x1150f4(0x97)]('\x0a');return[_0x1150f4(0x96),'']['join']('\x0a');}export const sqlCreate={'service':a247_0x54982a(0xad),'command':'create','description':a247_0x54982a(0x83),'risk':a247_0x54982a(0x78),'flags':[{'name':'name','type':a247_0x54982a(0x9f),'description':'SQL\x20query\x20display\x20name'},{'name':a247_0x54982a(0xa6),'type':a247_0x54982a(0xa9),'description':a247_0x54982a(0x89)},{'name':a247_0x54982a(0x84),'type':a247_0x54982a(0x9f),'enum':[a247_0x54982a(0xad),'mybatisXml'],'description':a247_0x54982a(0x80)}],async 'validate'(_0x1f4596){const _0x5971c9=a247_0x54982a;if(!_0x1f4596['nonInteractive'])return;if(!_0x1f4596[_0x5971c9(0x76)](_0x5971c9(0x94))[_0x5971c9(0x8e)]())throw CliErrors[_0x5971c9(0x7c)]('name',_0x5971c9(0x77));const _0x2a08b0=resolveProvidedDbId(_0x1f4596);if(typeof _0x2a08b0!==_0x5971c9(0xa9)||!Number['isFinite'](_0x2a08b0)||_0x2a08b0<=0x0)throw CliErrors[_0x5971c9(0x7c)](_0x5971c9(0xa6),_0x5971c9(0xa3));if(!_0x1f4596[_0x5971c9(0x76)](_0x5971c9(0x84))[_0x5971c9(0x8e)]())throw CliErrors['flagMissing'](_0x5971c9(0x84),_0x5971c9(0x9e));},async 'dryRun'(_0x27b95e){const _0x32dea2=a247_0x54982a,_0x465852=loadSqlProjectConfig(_0x27b95e[_0x32dea2(0xa1)]),{sqlName:_0x71ae0,dbId:_0x566ae8,dbName:_0x2b888a,mode:_0x6190dc}=await resolveSqlNewInputs(_0x27b95e),_0x390580=buildSqlRelativePath(_0x32dea2(0xb2),_0x71ae0,_0x2b888a,_0x6190dc,_0x566ae8),_0x33edaa=_0x465852[_0x32dea2(0x9a)]+'/'+_0x390580;return{'method':'POST','url':_0x32dea2(0x82),'body':{'appCode':_0x27b95e[_0x32dea2(0xa1)],'sqlName':_0x71ae0,'dbId':_0x566ae8,'mode':_0x6190dc,'localPath':_0x33edaa},'description':_0x32dea2(0x7e)+_0x465852[_0x32dea2(0x9a)]};},async 'execute'(_0x2a6c90){const _0x4b611f=a247_0x54982a,_0x5b47ad=loadSqlProjectConfig(_0x2a6c90[_0x4b611f(0xa1)]),{sqlName:_0x1e7a9e,dbId:_0x522ca3,dbName:_0x2d0b35,mode:_0x462d18}=await resolveSqlNewInputs(_0x2a6c90),_0x5d0c51=generateSqlTemplate(_0x462d18),_0x458b81=await createSqlQuery({'appCode':_0x2a6c90[_0x4b611f(0xa1)],'sqlName':_0x1e7a9e,'dbId':_0x522ca3,'sqlContent':_0x5d0c51}),_0x5e276f=ensureRemoteSqlContent(_0x458b81),_0x749272=_0x2d0b35||await getDbName(_0x2a6c90[_0x4b611f(0xa1)],_0x522ca3)['catch'](()=>undefined),_0x43132d=buildSqlRelativePath(_0x458b81[_0x4b611f(0xa5)],_0x458b81[_0x4b611f(0x93)],_0x749272,_0x462d18,_0x522ca3),_0x569016=_0x5b47ad[_0x4b611f(0x9a)]+'/'+_0x43132d,_0x631ba5=buildLocalSqlFileContent({'sqlCode':_0x458b81[_0x4b611f(0xa5)],'sqlName':_0x458b81[_0x4b611f(0x93)],'dbId':_0x458b81['dbId']},_0x5e276f,{'dbName':_0x749272,'mode':_0x462d18,'syncedAt':new Date()['toISOString'](),'description':_0x458b81[_0x4b611f(0x90)]});if(await fileExists(_0x569016))throw CliErrors['validation'](_0x4b611f(0x7f)+_0x569016);await ensureParentDirectory(_0x569016),await writeFile(_0x569016,_0x631ba5,_0x4b611f(0x85));const _0x8a3c40=await readSqlLockFile(_0x5b47ad['lockFilePath']),{lockData:_0x4c8717,appLock:_0x343373}=ensureSqlLockScope(_0x8a3c40??createEmptySqlLock(),_0x5b47ad[_0x4b611f(0xa1)],_0x5b47ad['sqlRoot'],'new');return _0x343373[_0x4b611f(0x79)][_0x458b81[_0x4b611f(0xa5)]]={...buildSqlLockEntry(_0x458b81,_0x5e276f,computeSqlContentHash(_0x631ba5),{'dbName':_0x749272}),'path':_0x43132d,'mode':_0x462d18},_0x343373[_0x4b611f(0xa0)]=new Date()['toISOString'](),await writeSqlLockFile(_0x5b47ad['lockFilePath'],_0x4c8717),{'ok':!![],'data':{'id':_0x458b81['id'],'sqlCode':_0x458b81[_0x4b611f(0xa5)],'sqlName':_0x458b81[_0x4b611f(0x93)],'dbId':_0x458b81[_0x4b611f(0x95)],'path':_0x569016,'mode':_0x462d18},'message':_0x4b611f(0xa2)+_0x458b81[_0x4b611f(0xa5)]};}};async function resolveSqlNewInputs(_0x12e997){const _0x337261=await resolveSqlNameInput(_0x12e997),{dbId:_0x85ee76,dbName:_0x12391d}=await resolveDbSelection(_0x12e997),_0x146c38=await resolveSqlModeInput(_0x12e997);return{'sqlName':_0x337261,'dbId':_0x85ee76,'dbName':_0x12391d,'mode':_0x146c38};}async function resolveSqlNameInput(_0x4e2095){const _0x5a176d=a247_0x54982a,_0x199a14=_0x4e2095['str'](_0x5a176d(0x94))[_0x5a176d(0x8e)]();if(_0x199a14)return _0x199a14;if(_0x4e2095[_0x5a176d(0x9b)])throw CliErrors['flagMissing']('name',_0x5a176d(0x77));return(await input({'message':_0x5a176d(0x8a),'validate':_0x9bdc3f=>_0x9bdc3f['trim']()?!![]:'SQL\x20name\x20cannot\x20be\x20empty'}))['trim']();}async function resolveDbSelection(_0x289853){const _0x3363f2=a247_0x54982a,_0x1ef555=resolveProvidedDbId(_0x289853);if(typeof _0x1ef555===_0x3363f2(0xa9)&&Number[_0x3363f2(0xac)](_0x1ef555)&&_0x1ef555>0x0)return{'dbId':_0x1ef555,'dbName':await getDbName(_0x289853[_0x3363f2(0xa1)],_0x1ef555)[_0x3363f2(0xae)](()=>undefined)};if(_0x289853[_0x3363f2(0x9b)])throw CliErrors['flagMissing']('db-id',_0x3363f2(0xa3));const _0x3ec53a=await listDatabases(_0x289853['appCode'])[_0x3363f2(0xae)](()=>[]);if(_0x3ec53a[_0x3363f2(0x8d)]===0x1)return{'dbId':_0x3ec53a[0x0][_0x3363f2(0x95)],'dbName':_0x3ec53a[0x0][_0x3363f2(0x7b)]};if(_0x3ec53a[_0x3363f2(0x8d)]>0x1){const _0x6b4ecd=await select({'message':_0x3363f2(0xb3),'choices':[..._0x3ec53a[_0x3363f2(0x98)](_0x54944f=>({'name':_0x54944f[_0x3363f2(0x7b)]+'\x20('+_0x54944f[_0x3363f2(0x95)]+')','value':serializeDbSelection(_0x54944f)})),{'name':_0x3363f2(0x7d),'value':_0x3363f2(0x9c)}]});if(_0x6b4ecd!==_0x3363f2(0x9c))return deserializeDbSelection(_0x6b4ecd);}const _0x383fd6=await input({'message':_0x3363f2(0x81),'validate':_0x3f0994=>{const _0x2087a8=_0x3363f2,_0x915939=_0x3f0994[_0x2087a8(0x8e)]();if(!_0x915939)return'dbId\x20cannot\x20be\x20empty';const _0x42e0aa=Number(_0x915939);if(!Number[_0x2087a8(0xb1)](_0x42e0aa)||_0x42e0aa<=0x0)return _0x2087a8(0xb5);return!![];}});return{'dbId':Number(_0x383fd6[_0x3363f2(0x8e)]())};}async function resolveSqlModeInput(_0x3b2254){const _0x27314e=a247_0x54982a,_0xf57b7e=_0x3b2254[_0x27314e(0x76)](_0x27314e(0x84))[_0x27314e(0x8e)]();if(_0xf57b7e===_0x27314e(0xad)||_0xf57b7e===_0x27314e(0xa7))return _0xf57b7e;if(_0x3b2254['nonInteractive'])throw CliErrors[_0x27314e(0x7c)](_0x27314e(0x84),_0x27314e(0x9e));return await select({'message':'Select\x20the\x20local\x20SQL\x20mode:','choices':[{'name':_0x27314e(0x92),'value':_0x27314e(0xad),'description':_0x27314e(0xb4)},{'name':_0x27314e(0x91),'value':_0x27314e(0xa7),'description':_0x27314e(0xa8)}]});}function serializeDbSelection(_0x2cbf9a){const _0x1698e9=a247_0x54982a;return JSON['stringify']({'dbId':_0x2cbf9a[_0x1698e9(0x95)],'dbName':_0x2cbf9a[_0x1698e9(0x7b)]});}function deserializeDbSelection(_0x166de7){const _0x4e4d33=a247_0x54982a;try{const _0x4ab865=JSON[_0x4e4d33(0x87)](_0x166de7);if(typeof _0x4ab865['dbId']===_0x4e4d33(0xa9)&&Number[_0x4e4d33(0xac)](_0x4ab865[_0x4e4d33(0x95)]))return{'dbId':_0x4ab865[_0x4e4d33(0x95)],'dbName':_0x4ab865[_0x4e4d33(0x7b)]};}catch{}throw CliErrors['validation'](_0x4e4d33(0xa4)+_0x166de7);}function resolveProvidedDbId(_0x447830){const _0x341214=a247_0x54982a,_0x7467be=_0x447830[_0x341214(0xaf)](_0x341214(0xa6));if(typeof _0x7467be===_0x341214(0xa9)&&Number[_0x341214(0xac)](_0x7467be))return _0x7467be;return undefined;}