@lovrabet/rabetbase-cli 2.5.12 → 2.5.13-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (380) 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.js +1 -1
  149. package/lib/commands/instant-api-policy/validate.js +1 -1
  150. package/lib/commands/issue/context.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/kb/create.js +1 -1
  155. package/lib/commands/kb/delete.js +1 -1
  156. package/lib/commands/kb/detail.js +1 -1
  157. package/lib/commands/kb/index.js +1 -1
  158. package/lib/commands/kb/list.js +1 -1
  159. package/lib/commands/kb/search.js +1 -1
  160. package/lib/commands/kb/shared.js +1 -1
  161. package/lib/commands/kb/update.js +1 -1
  162. package/lib/commands/logs/index.js +1 -1
  163. package/lib/commands/menu/asset-update.js +1 -1
  164. package/lib/commands/menu/delete.js +1 -1
  165. package/lib/commands/menu/external-link-create.js +1 -1
  166. package/lib/commands/menu/external-link-update.js +1 -1
  167. package/lib/commands/menu/group-create.js +1 -1
  168. package/lib/commands/menu/group-update.js +1 -1
  169. package/lib/commands/menu/index.js +1 -1
  170. package/lib/commands/menu/list.js +1 -1
  171. package/lib/commands/menu/move.js +1 -1
  172. package/lib/commands/menu/regroup-start.js +1 -1
  173. package/lib/commands/menu/rename.js +1 -1
  174. package/lib/commands/menu/shared/compare-table.js +1 -1
  175. package/lib/commands/menu/shared/delete-plan.js +1 -1
  176. package/lib/commands/menu/shared/facts.js +1 -1
  177. package/lib/commands/menu/shared/index.js +1 -1
  178. package/lib/commands/menu/shared/inquirer.js +1 -1
  179. package/lib/commands/menu/shared/local-pages.js +1 -1
  180. package/lib/commands/menu/shared/logic.js +1 -1
  181. package/lib/commands/menu/shared/mutations.js +1 -1
  182. package/lib/commands/menu/shared/path.js +1 -1
  183. package/lib/commands/menu/shared/service.js +1 -1
  184. package/lib/commands/menu/shared/subapp-assets.js +1 -1
  185. package/lib/commands/menu/shared/sync-core.js +1 -1
  186. package/lib/commands/menu/shared/update-core.js +1 -1
  187. package/lib/commands/menu/shared/valid-url.js +1 -1
  188. package/lib/commands/menu/subapp-assets-status.js +1 -1
  189. package/lib/commands/menu/subapp-assets-update.js +1 -1
  190. package/lib/commands/menu/sync.js +1 -1
  191. package/lib/commands/menu/visibility-update.js +1 -1
  192. package/lib/commands/notification/config-create.js +1 -1
  193. package/lib/commands/notification/config-delete.js +1 -1
  194. package/lib/commands/notification/config-list.js +1 -1
  195. package/lib/commands/notification/config-update.js +1 -1
  196. package/lib/commands/notification/index.js +1 -1
  197. package/lib/commands/notification/shared.js +1 -1
  198. package/lib/commands/ocr/index.js +1 -1
  199. package/lib/commands/page/create.js +1 -1
  200. package/lib/commands/page/custom/detail.js +1 -1
  201. package/lib/commands/page/custom/list.js +1 -1
  202. package/lib/commands/page/custom/publish.js +1 -1
  203. package/lib/commands/page/custom/shared.js +1 -1
  204. package/lib/commands/page/custom/syntax.js +1 -1
  205. package/lib/commands/page/custom/update.js +1 -1
  206. package/lib/commands/page/data-list-status.js +1 -1
  207. package/lib/commands/page/generate-start.js +1 -1
  208. package/lib/commands/page/generate-status.js +1 -1
  209. package/lib/commands/page/index.js +1 -1
  210. package/lib/commands/page/pull.js +1 -1
  211. package/lib/commands/page/push.js +1 -1
  212. package/lib/commands/page/relation-audit.js +1 -1
  213. package/lib/commands/page/restore.js +1 -1
  214. package/lib/commands/page/shared.js +1 -1
  215. package/lib/commands/page/sync.js +1 -1
  216. package/lib/commands/project/api-architecture-upgrade.js +1 -1
  217. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  218. package/lib/commands/project/create/format-elapsed.js +1 -1
  219. package/lib/commands/project/create/main.js +1 -1
  220. package/lib/commands/project/create/materialize-project-template.js +1 -1
  221. package/lib/commands/project/create/project-name.js +1 -1
  222. package/lib/commands/project/create/project-template-archive.js +1 -1
  223. package/lib/commands/project/create/project-template-path.js +1 -1
  224. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  225. package/lib/commands/project/create/use-format-code.js +1 -1
  226. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  227. package/lib/commands/project/domain-routing-sync.js +1 -1
  228. package/lib/commands/project/index.js +1 -1
  229. package/lib/commands/project/upgrade.js +1 -1
  230. package/lib/commands/registry.js +1 -1
  231. package/lib/commands/role/delete.js +1 -1
  232. package/lib/commands/role/detail.js +1 -1
  233. package/lib/commands/role/index.js +1 -1
  234. package/lib/commands/role/list.js +1 -1
  235. package/lib/commands/role/shared.js +1 -1
  236. package/lib/commands/role/update.js +1 -1
  237. package/lib/commands/role/user-add.js +1 -1
  238. package/lib/commands/role/user-remove.js +1 -1
  239. package/lib/commands/role/user-resolve.js +1 -1
  240. package/lib/commands/rule/get.js +1 -1
  241. package/lib/commands/rule/index.js +1 -1
  242. package/lib/commands/rule/list.js +1 -1
  243. package/lib/commands/rule/set.js +1 -1
  244. package/lib/commands/rule/shared.js +1 -1
  245. package/lib/commands/run/index.js +1 -1
  246. package/lib/commands/schema.js +1 -1
  247. package/lib/commands/sql/create.js +1 -1
  248. package/lib/commands/sql/delete.js +1 -1
  249. package/lib/commands/sql/detail.js +1 -1
  250. package/lib/commands/sql/exec.js +1 -1
  251. package/lib/commands/sql/index.js +1 -1
  252. package/lib/commands/sql/list.js +1 -1
  253. package/lib/commands/sql/pull.js +1 -1
  254. package/lib/commands/sql/push.js +1 -1
  255. package/lib/commands/sql/shared.js +1 -1
  256. package/lib/commands/sql/status.js +1 -1
  257. package/lib/commands/sql/validate.js +1 -1
  258. package/lib/commands/task/index.js +1 -1
  259. package/lib/commands/task/status.js +1 -1
  260. package/lib/commands/tenant/index.js +1 -1
  261. package/lib/commands/tenant/members-list.js +1 -1
  262. package/lib/commands/tenant/shared.js +1 -1
  263. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  264. package/lib/commands/user-account/feishu-bind.js +1 -1
  265. package/lib/commands/user-account/index.js +1 -1
  266. package/lib/commands/workspace/add.js +1 -1
  267. package/lib/commands/workspace/index.js +1 -1
  268. package/lib/commands/workspace/remove.js +1 -1
  269. package/lib/config/domain-config.js +1 -1
  270. package/lib/config/project-domain-routing.js +1 -1
  271. package/lib/config/region-config.js +1 -1
  272. package/lib/config/schema.js +1 -1
  273. package/lib/constant/cdn.js +1 -1
  274. package/lib/constant/cli.js +1 -1
  275. package/lib/constant/defaults.js +1 -1
  276. package/lib/constant/domain.js +1 -1
  277. package/lib/constant/env.js +1 -1
  278. package/lib/constant/output.js +1 -1
  279. package/lib/constant/paths.js +1 -1
  280. package/lib/constant/region.js +1 -1
  281. package/lib/constant/risk.js +1 -1
  282. package/lib/constant/routing-profile.js +1 -1
  283. package/lib/context/app-resolver.js +1 -1
  284. package/lib/context/auth-resolver.js +1 -1
  285. package/lib/context/config-loader.js +1 -1
  286. package/lib/context.js +1 -1
  287. package/lib/core/alias-resolver.js +1 -1
  288. package/lib/core/api-client.js +1 -1
  289. package/lib/core/bff/config.js +1 -1
  290. package/lib/core/bff/file-system.js +1 -1
  291. package/lib/core/bff/hash.js +1 -1
  292. package/lib/core/bff/hook-directory.js +1 -1
  293. package/lib/core/bff/lock.js +1 -1
  294. package/lib/core/bff/utils.js +1 -1
  295. package/lib/core/cross-db-analysis.js +1 -1
  296. package/lib/core/cross-db-relation.js +1 -1
  297. package/lib/core/db-resolver.js +1 -1
  298. package/lib/core/flow-config.js +1 -1
  299. package/lib/core/instant-api-policy/config.js +1 -1
  300. package/lib/core/instant-api-policy/endpoints.js +1 -1
  301. package/lib/core/kb-management-client.js +1 -1
  302. package/lib/core/kb-search-client.js +1 -1
  303. package/lib/core/page/file-system.js +1 -1
  304. package/lib/core/page/hash.js +1 -1
  305. package/lib/core/page/lock.js +1 -1
  306. package/lib/core/page/lr-smart-jsx.js +1 -1
  307. package/lib/core/sql-index-auditor.js +1 -1
  308. package/lib/core/sql-sync/config.js +1 -1
  309. package/lib/core/sql-sync/file-system.js +1 -1
  310. package/lib/core/sql-sync/hash.js +1 -1
  311. package/lib/core/sql-sync/lock.js +1 -1
  312. package/lib/core/sql-sync/utils.js +1 -1
  313. package/lib/core/sql-validator.js +1 -1
  314. package/lib/errors.js +1 -1
  315. package/lib/framework/build-all-flags.js +1 -1
  316. package/lib/framework/error-output.js +1 -1
  317. package/lib/framework/explicit-yes.js +1 -1
  318. package/lib/framework/flags.js +1 -1
  319. package/lib/framework/help.js +1 -1
  320. package/lib/framework/index.js +1 -1
  321. package/lib/framework/output.js +1 -1
  322. package/lib/framework/response.js +1 -1
  323. package/lib/framework/runner-alias.js +1 -1
  324. package/lib/framework/runner.js +1 -1
  325. package/lib/framework/schema-export.js +1 -1
  326. package/lib/framework/supported-flags.js +1 -1
  327. package/lib/framework/types.js +1 -1
  328. package/lib/generated/build-info.d.ts +4 -4
  329. package/lib/generated/build-info.js +1 -1
  330. package/lib/generated/official-routing.js +1 -1
  331. package/lib/generated/routing-contract.js +1 -1
  332. package/lib/help.js +1 -1
  333. package/lib/postinstall.js +1 -1
  334. package/lib/runtime/confirmation.js +1 -1
  335. package/lib/runtime/event.js +1 -1
  336. package/lib/runtime/index.js +1 -1
  337. package/lib/runtime/queue.js +1 -1
  338. package/lib/runtime/resolve.js +1 -1
  339. package/lib/services/dataset-design/checkpoint.js +1 -1
  340. package/lib/services/dataset-design/commands.js +1 -1
  341. package/lib/services/dataset-design/contract.js +1 -1
  342. package/lib/skills/builtin-skill.js +1 -1
  343. package/lib/skills/main.js +1 -1
  344. package/lib/skills/npx-skills-add.js +1 -1
  345. package/lib/skills/skill-presence.js +1 -1
  346. package/lib/telemetry/cli-command-trace.js +1 -1
  347. package/lib/telemetry/cli-help-trace.js +1 -1
  348. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  349. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  350. package/lib/telemetry/send-cli-trace-log.js +1 -1
  351. package/lib/utils/ai_config.js +1 -1
  352. package/lib/utils/apply-jq-filter.js +1 -1
  353. package/lib/utils/cdn-config.js +1 -1
  354. package/lib/utils/check-sdk-version.js +1 -1
  355. package/lib/utils/cli-version-check.js +1 -1
  356. package/lib/utils/cli-version-policy.js +1 -1
  357. package/lib/utils/config.js +1 -1
  358. package/lib/utils/entity-with-id.js +1 -1
  359. package/lib/utils/file-utils.js +1 -1
  360. package/lib/utils/guides-cdn.js +1 -1
  361. package/lib/utils/http-client.js +1 -1
  362. package/lib/utils/is-non-interactive.js +1 -1
  363. package/lib/utils/logger.js +1 -1
  364. package/lib/utils/params.js +1 -1
  365. package/lib/utils/platform.js +1 -1
  366. package/lib/utils/sleep.js +1 -1
  367. package/lib/utils/template-replacer.js +1 -1
  368. package/lib/utils/update-notice.js +1 -1
  369. package/lib/utils/version.js +1 -1
  370. package/lib/utils/with-active-cookie.js +1 -1
  371. package/lib/utils/write-cli-side-channel.js +1 -1
  372. package/package.json +1 -1
  373. package/skills/rabetbase/SKILL.md +1 -1
  374. package/skills/rabetbase/guides/custom-page-workflow.md +32 -2
  375. package/skills/rabetbase/knowledge/custom-page/generation-standards.md +106 -6
  376. package/skills/rabetbase-dataset-generation/SKILL.md +1 -1
  377. package/skills/rabetbase-page-generation/SKILL.md +1 -1
  378. package/skills/rabetbase.manifest.json +3 -3
  379. package/templates/custom-pages/blank.json +1 -1
  380. package/templates/custom-pages/dashboard.json +1 -1
@@ -1 +1 @@
1
- const a231_0x1d08f2=a231_0x451b;(function(_0x5cfbd2,_0x24e058){const _0x335a45=a231_0x451b,_0x394495=_0x5cfbd2();while(!![]){try{const _0x56fb9a=-parseInt(_0x335a45(0x14d))/0x1+-parseInt(_0x335a45(0x145))/0x2+parseInt(_0x335a45(0x143))/0x3+parseInt(_0x335a45(0x156))/0x4*(parseInt(_0x335a45(0x14c))/0x5)+parseInt(_0x335a45(0x14b))/0x6*(parseInt(_0x335a45(0x158))/0x7)+parseInt(_0x335a45(0x14a))/0x8+-parseInt(_0x335a45(0x147))/0x9;if(_0x56fb9a===_0x24e058)break;else _0x394495['push'](_0x394495['shift']());}catch(_0x4710bc){_0x394495['push'](_0x394495['shift']());}}}(a231_0x5a96,0x27d3e));import{deleteAppRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';function a231_0x451b(_0x4795f5,_0x5ee773){_0x4795f5=_0x4795f5-0x143;const _0x5a9695=a231_0x5a96();let _0x451be5=_0x5a9695[_0x4795f5];return _0x451be5;}const DELETE_PATH='/smartapi/permit/role/delete';function a231_0x5a96(){const _0x1bb6ac=['\x20member(s);\x20they\x20will\x20lose\x20this\x20group.','POST','delete','1244248SkykeD','num','23758Unnxyk','252354DYbrqy','Role\x20still\x20has\x20','536434PtTgPE','high-risk-write','2604618KwfrCW','roleName','Deleted\x20role\x20','1722720lbLOZZ','300tDKNmx','5eyLYPM','59467VuyLcF','dev','userCount','Delete\x20a\x20CUSTOM\x20role\x20(built-in\x20roles\x20rejected);\x20requires\x20--yes','appCode','role'];a231_0x5a96=function(){return _0x1bb6ac;};return a231_0x5a96();}export const roleDelete={'service':a231_0x1d08f2(0x152),'command':a231_0x1d08f2(0x155),'description':a231_0x1d08f2(0x150),'risk':a231_0x1d08f2(0x146),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x178af3){const _0x4f676a=a231_0x1d08f2,_0x4691d1=_0x178af3[_0x4f676a(0x157)]('id'),_0x160c62=await getRoleById(_0x178af3[_0x4f676a(0x151)],_0x4691d1);return assertCustomRole(_0x160c62,_0x4f676a(0x155)),asDryRunResult({'scope':_0x4f676a(0x14e),'operation':'delete','selector':{'appCode':_0x178af3['appCode'],'roleId':_0x4691d1,'roleName':_0x160c62[_0x4f676a(0x148)]},'before':projectRole(_0x160c62),'after':null,'dryRun':!![],'backend':{'method':'POST','path':DELETE_PATH},'warnings':_0x160c62[_0x4f676a(0x14f)]>0x0?[_0x4f676a(0x144)+_0x160c62['userCount']+_0x4f676a(0x153)]:[]},{'method':_0x4f676a(0x154),'url':DELETE_PATH});},async 'execute'(_0x2db50d){const _0x50b8c5=a231_0x1d08f2,_0x2db351=_0x2db50d[_0x50b8c5(0x157)]('id'),_0x7b98c9=await getRoleById(_0x2db50d[_0x50b8c5(0x151)],_0x2db351);return assertCustomRole(_0x7b98c9,_0x50b8c5(0x155)),await deleteAppRole(_0x2db351),{'ok':!![],'data':{'scope':_0x50b8c5(0x14e),'operation':_0x50b8c5(0x155),'selector':{'appCode':_0x2db50d['appCode'],'roleId':_0x2db351,'roleName':_0x7b98c9[_0x50b8c5(0x148)]},'before':projectRole(_0x7b98c9),'after':null,'dryRun':![],'backend':{'method':'POST','path':DELETE_PATH},'warnings':[]},'message':_0x50b8c5(0x149)+_0x7b98c9['roleName']+'\x20(id='+_0x2db351+')'};}};
1
+ const a231_0x41e548=a231_0x2738;(function(_0x3ddb56,_0x3cb45a){const _0x3b2310=a231_0x2738,_0x1295b1=_0x3ddb56();while(!![]){try{const _0x473259=-parseInt(_0x3b2310(0xa6))/0x1*(-parseInt(_0x3b2310(0xa0))/0x2)+-parseInt(_0x3b2310(0xa2))/0x3*(parseInt(_0x3b2310(0x95))/0x4)+-parseInt(_0x3b2310(0x99))/0x5+-parseInt(_0x3b2310(0xa1))/0x6+-parseInt(_0x3b2310(0x97))/0x7+-parseInt(_0x3b2310(0x98))/0x8+parseInt(_0x3b2310(0x9c))/0x9*(parseInt(_0x3b2310(0x96))/0xa);if(_0x473259===_0x3cb45a)break;else _0x1295b1['push'](_0x1295b1['shift']());}catch(_0x39771b){_0x1295b1['push'](_0x1295b1['shift']());}}}(a231_0x1fd9,0xa311e));import{deleteAppRole}from'../../core/api-client.js';function a231_0x2738(_0x46f0a2,_0x3f8be7){_0x46f0a2=_0x46f0a2-0x94;const _0x1fd98f=a231_0x1fd9();let _0x2738d0=_0x1fd98f[_0x46f0a2];return _0x2738d0;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';function a231_0x1fd9(){const _0x2cf883=['dev','userCount','roleName','/smartapi/permit/role/delete','52BTzomn','117660WNDiEz','5982438afUMuv','2182568GXmXij','5025295KxFTyt','\x20member(s);\x20they\x20will\x20lose\x20this\x20group.','\x20(id=','3330EBJSab','appCode','Delete\x20a\x20CUSTOM\x20role\x20(built-in\x20roles\x20rejected);\x20requires\x20--yes','delete','20BMVlnT','3757410RwUIml','231417nCpFdn','role','num','Deleted\x20role\x20','7607KCtHjT','POST'];a231_0x1fd9=function(){return _0x2cf883;};return a231_0x1fd9();}const DELETE_PATH=a231_0x41e548(0x94);export const roleDelete={'service':a231_0x41e548(0xa3),'command':a231_0x41e548(0x9f),'description':a231_0x41e548(0x9e),'risk':'high-risk-write','flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x4ed174){const _0x3fd68b=a231_0x41e548,_0x26dd75=_0x4ed174[_0x3fd68b(0xa4)]('id'),_0x24f89b=await getRoleById(_0x4ed174[_0x3fd68b(0x9d)],_0x26dd75);return assertCustomRole(_0x24f89b,'delete'),asDryRunResult({'scope':'dev','operation':_0x3fd68b(0x9f),'selector':{'appCode':_0x4ed174[_0x3fd68b(0x9d)],'roleId':_0x26dd75,'roleName':_0x24f89b[_0x3fd68b(0xaa)]},'before':projectRole(_0x24f89b),'after':null,'dryRun':!![],'backend':{'method':_0x3fd68b(0xa7),'path':DELETE_PATH},'warnings':_0x24f89b[_0x3fd68b(0xa9)]>0x0?['Role\x20still\x20has\x20'+_0x24f89b[_0x3fd68b(0xa9)]+_0x3fd68b(0x9a)]:[]},{'method':'POST','url':DELETE_PATH});},async 'execute'(_0x17bfcf){const _0x419109=a231_0x41e548,_0x299598=_0x17bfcf['num']('id'),_0x3837a7=await getRoleById(_0x17bfcf[_0x419109(0x9d)],_0x299598);return assertCustomRole(_0x3837a7,_0x419109(0x9f)),await deleteAppRole(_0x299598),{'ok':!![],'data':{'scope':_0x419109(0xa8),'operation':_0x419109(0x9f),'selector':{'appCode':_0x17bfcf[_0x419109(0x9d)],'roleId':_0x299598,'roleName':_0x3837a7['roleName']},'before':projectRole(_0x3837a7),'after':null,'dryRun':![],'backend':{'method':_0x419109(0xa7),'path':DELETE_PATH},'warnings':[]},'message':_0x419109(0xa5)+_0x3837a7['roleName']+_0x419109(0x9b)+_0x299598+')'};}};
@@ -1 +1 @@
1
- const a232_0x3f8c6b=a232_0x550f;(function(_0x4659d4,_0x1cacf8){const _0xdca87e=a232_0x550f,_0x17cac8=_0x4659d4();while(!![]){try{const _0x12bd46=parseInt(_0xdca87e(0xc3))/0x1*(parseInt(_0xdca87e(0xc6))/0x2)+parseInt(_0xdca87e(0xc4))/0x3+-parseInt(_0xdca87e(0xca))/0x4+parseInt(_0xdca87e(0xcc))/0x5+parseInt(_0xdca87e(0xcf))/0x6+parseInt(_0xdca87e(0xcd))/0x7+-parseInt(_0xdca87e(0xc2))/0x8;if(_0x12bd46===_0x1cacf8)break;else _0x17cac8['push'](_0x17cac8['shift']());}catch(_0x549242){_0x17cac8['push'](_0x17cac8['shift']());}}}(a232_0x33f2,0x7d286));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a232_0x33f2(){const _0x319faa=['detail','num','3313348fZmRXK','Show\x20a\x20single\x20role\x27s\x20detail','2577230TOnDWf','6749218KlOxTK','role','2080500JDDEzv','12631984VcpGVd','160258snUiTn','396189NjwCvK','roleType','12sGpVwa','Role\x20'];a232_0x33f2=function(){return _0x319faa;};return a232_0x33f2();}function a232_0x550f(_0x28b83e,_0xc01b98){_0x28b83e=_0x28b83e-0xc2;const _0x33f24e=a232_0x33f2();let _0x550f14=_0x33f24e[_0x28b83e];return _0x550f14;}import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';export const roleDetail={'service':a232_0x3f8c6b(0xce),'command':a232_0x3f8c6b(0xc8),'description':a232_0x3f8c6b(0xcb),'risk':'read','flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x4a0f86){const _0x27375d=a232_0x3f8c6b,_0x54a92a=_0x4a0f86[_0x27375d(0xc9)]('id'),_0xd33523=await getRoleById(_0x4a0f86['appCode'],_0x54a92a);return{'ok':!![],'data':{'scope':'dev','role':projectRole(_0xd33523)},'message':_0x27375d(0xc7)+_0xd33523['roleName']+'\x20('+_0xd33523[_0x27375d(0xc5)]+')'};}};
1
+ const a232_0x4f8159=a232_0x5894;(function(_0x1d55a0,_0x420278){const _0x14e5df=a232_0x5894,_0x136315=_0x1d55a0();while(!![]){try{const _0xd4a58c=parseInt(_0x14e5df(0x157))/0x1+-parseInt(_0x14e5df(0x156))/0x2+-parseInt(_0x14e5df(0x14f))/0x3+parseInt(_0x14e5df(0x152))/0x4+-parseInt(_0x14e5df(0x154))/0x5*(parseInt(_0x14e5df(0x14b))/0x6)+parseInt(_0x14e5df(0x14c))/0x7+parseInt(_0x14e5df(0x14e))/0x8;if(_0xd4a58c===_0x420278)break;else _0x136315['push'](_0x136315['shift']());}catch(_0x5a59fc){_0x136315['push'](_0x136315['shift']());}}}(a232_0x25f5,0xe910e));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a232_0x5894(_0x57ac08,_0x3af0e9){_0x57ac08=_0x57ac08-0x14b;const _0x25f58d=a232_0x25f5();let _0x5894bc=_0x25f58d[_0x57ac08];return _0x5894bc;}import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';function a232_0x25f5(){const _0x57c5aa=['num','detail','2270100JyPQAA','8528520LpnqPe','dev','12243040DTevZx','5128896oEMcbi','role','Role\x20','5090820Jgoizj','read','20vdUPUi','roleName','1870924gktWxL','1091687SWxZIw','roleType'];a232_0x25f5=function(){return _0x57c5aa;};return a232_0x25f5();}export const roleDetail={'service':a232_0x4f8159(0x150),'command':a232_0x4f8159(0x15a),'description':'Show\x20a\x20single\x20role\x27s\x20detail','risk':a232_0x4f8159(0x153),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x51df83){const _0x19e308=a232_0x4f8159,_0xe00ba5=_0x51df83[_0x19e308(0x159)]('id'),_0x366dd5=await getRoleById(_0x51df83['appCode'],_0xe00ba5);return{'ok':!![],'data':{'scope':_0x19e308(0x14d),'role':projectRole(_0x366dd5)},'message':_0x19e308(0x151)+_0x366dd5[_0x19e308(0x155)]+'\x20('+_0x366dd5[_0x19e308(0x158)]+')'};}};
@@ -1 +1 @@
1
- (function(_0x3505e1,_0x2903f6){const _0x42bfe0=a233_0xf881,_0x559d30=_0x3505e1();while(!![]){try{const _0x3a7c11=parseInt(_0x42bfe0(0xe7))/0x1*(-parseInt(_0x42bfe0(0xf2))/0x2)+-parseInt(_0x42bfe0(0xee))/0x3+parseInt(_0x42bfe0(0xec))/0x4+parseInt(_0x42bfe0(0xf0))/0x5*(-parseInt(_0x42bfe0(0xef))/0x6)+-parseInt(_0x42bfe0(0xf1))/0x7*(-parseInt(_0x42bfe0(0xed))/0x8)+parseInt(_0x42bfe0(0xeb))/0x9*(parseInt(_0x42bfe0(0xea))/0xa)+-parseInt(_0x42bfe0(0xe8))/0xb*(parseInt(_0x42bfe0(0xe9))/0xc);if(_0x3a7c11===_0x2903f6)break;else _0x559d30['push'](_0x559d30['shift']());}catch(_0x9be29){_0x559d30['push'](_0x559d30['shift']());}}}(a233_0x12be,0xa9893));import{roleList}from'../../commands/role/list.js';function a233_0x12be(){const _0x3a6a19=['2UgNhcA','1052447HuevHA','166705YImQKX','12YtsFJf','10OcOYwr','5236299UkfZfG','1448664CLjNPY','864cInIKn','477702bEmzDL','750zWccBC','1910ZTDepy','66437kquqaO'];a233_0x12be=function(){return _0x3a6a19;};return a233_0x12be();}function a233_0xf881(_0x2dba13,_0x4b991a){_0x2dba13=_0x2dba13-0xe7;const _0x12be8d=a233_0x12be();let _0xf88179=_0x12be8d[_0x2dba13];return _0xf88179;}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';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(_0x4ad6d4,_0x1937f5){const _0xe62e2b=a233_0x3f28,_0x485cf8=_0x4ad6d4();while(!![]){try{const _0x477760=parseInt(_0xe62e2b(0x75))/0x1*(parseInt(_0xe62e2b(0x7a))/0x2)+parseInt(_0xe62e2b(0x79))/0x3+parseInt(_0xe62e2b(0x74))/0x4*(parseInt(_0xe62e2b(0x7c))/0x5)+parseInt(_0xe62e2b(0x73))/0x6+-parseInt(_0xe62e2b(0x77))/0x7+parseInt(_0xe62e2b(0x7d))/0x8*(-parseInt(_0xe62e2b(0x78))/0x9)+parseInt(_0xe62e2b(0x76))/0xa*(-parseInt(_0xe62e2b(0x7b))/0xb);if(_0x477760===_0x1937f5)break;else _0x485cf8['push'](_0x485cf8['shift']());}catch(_0x47bd90){_0x485cf8['push'](_0x485cf8['shift']());}}}(a233_0x4ff3,0x6f803));import{roleList}from'../../commands/role/list.js';import{roleDetail}from'../../commands/role/detail.js';function a233_0x4ff3(){const _0x5e5f6c=['9mzQJrc','1047459SdJUjc','158yNHyZG','83677doTuIR','1900895CVvWKd','75408RZqHfz','1084548nfXeqD','4yMYRZz','4931ZEHREd','760ZsXUGb','1787618KwUMVw'];a233_0x4ff3=function(){return _0x5e5f6c;};return a233_0x4ff3();}import{roleUpdate}from'../../commands/role/update.js';import{roleDelete}from'../../commands/role/delete.js';import{roleUserResolve}from'../../commands/role/user-resolve.js';function a233_0x3f28(_0x579a6a,_0x176623){_0x579a6a=_0x579a6a-0x73;const _0x4ff3fc=a233_0x4ff3();let _0x3f2875=_0x4ff3fc[_0x579a6a];return _0x3f2875;}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 +1 @@
1
- const a234_0x15b8a3=a234_0x31e7;(function(_0x2e0a00,_0x468ad9){const _0x250bbf=a234_0x31e7,_0x343bf5=_0x2e0a00();while(!![]){try{const _0x133329=parseInt(_0x250bbf(0xdb))/0x1*(parseInt(_0x250bbf(0xf4))/0x2)+parseInt(_0x250bbf(0xd0))/0x3*(-parseInt(_0x250bbf(0xe2))/0x4)+-parseInt(_0x250bbf(0xd4))/0x5+parseInt(_0x250bbf(0xee))/0x6*(-parseInt(_0x250bbf(0xec))/0x7)+parseInt(_0x250bbf(0xd9))/0x8*(parseInt(_0x250bbf(0xef))/0x9)+-parseInt(_0x250bbf(0xe5))/0xa+parseInt(_0x250bbf(0xdf))/0xb;if(_0x133329===_0x468ad9)break;else _0x343bf5['push'](_0x343bf5['shift']());}catch(_0x1e6366){_0x343bf5['push'](_0x343bf5['shift']());}}}(a234_0x3999,0xc15b0));import{listAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a234_0x31e7(_0x3733b9,_0x129f06){_0x3733b9=_0x3733b9-0xce;const _0x399943=a234_0x3999();let _0x31e780=_0x399943[_0x3733b9];return _0x31e780;}function a234_0x3999(){const _0x32d9de=['includes','num','--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.','303BYUPQq','appCode','str','page','7531025hlUefy','--pagesize\x20must\x20be\x20between\x201\x20and\x20100.','\x20role(s)','read','toUpperCase','3416JZGjCK','map','136199NATcXr','type','number','Use\x20one\x20of:\x20','64539761jVAXtp','trim','filter','60172froHbo','dev','role','14544050kCmwMX','validation','Page\x20size\x20(1-100)','join','pagesize','length','List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','1785oaNnbp','ADMIN','33066LseOIc','11331NIfUBL','list','Filter\x20by\x20role\x20type','OWNER','Page\x20index\x20(1-based)','4PXLUeA'];a234_0x3999=function(){return _0x32d9de;};return a234_0x3999();}import{projectRole}from'../../commands/role/shared.js';const ROLE_TYPES=[a234_0x15b8a3(0xed),'DEV',a234_0x15b8a3(0xf2),'CUSTOM'];export const roleList={'service':a234_0x15b8a3(0xe4),'command':a234_0x15b8a3(0xf0),'description':a234_0x15b8a3(0xeb),'risk':a234_0x15b8a3(0xd7),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a234_0x15b8a3(0xdc),'type':'string','required':![],'description':a234_0x15b8a3(0xf1),'enum':ROLE_TYPES},{'name':'page','type':a234_0x15b8a3(0xdd),'description':a234_0x15b8a3(0xf3),'default':0x1},{'name':a234_0x15b8a3(0xe9),'type':'number','description':a234_0x15b8a3(0xe7),'default':0x64}],async 'validate'(_0x5a1004){const _0x49ff82=a234_0x15b8a3,_0x31e81d=_0x5a1004[_0x49ff82(0xd2)](_0x49ff82(0xdc))['trim']();if(_0x31e81d&&!ROLE_TYPES[_0x49ff82(0xf5)](_0x31e81d[_0x49ff82(0xd8)]()))throw CliErrors['validation']('Invalid\x20--type\x20\x22'+_0x31e81d+'\x22.',_0x49ff82(0xde)+ROLE_TYPES[_0x49ff82(0xe8)](',\x20')+'.');const _0x3c1442=_0x5a1004[_0x49ff82(0xce)](_0x49ff82(0xd3),0x1),_0x2a5dbc=_0x5a1004[_0x49ff82(0xce)](_0x49ff82(0xe9),0x64);if(_0x3c1442<0x1)throw CliErrors['validation'](_0x49ff82(0xcf));if(_0x2a5dbc<0x1||_0x2a5dbc>0x64)throw CliErrors[_0x49ff82(0xe6)](_0x49ff82(0xd5));},async 'execute'(_0x1e7020){const _0x585e30=a234_0x15b8a3,_0x110fa1=_0x1e7020['num'](_0x585e30(0xd3),0x1)||0x1,_0x18a15d=_0x1e7020[_0x585e30(0xce)](_0x585e30(0xe9),0x64)||0x64,_0x4c160d=_0x1e7020[_0x585e30(0xd2)](_0x585e30(0xdc))[_0x585e30(0xe0)]()['toUpperCase'](),{items:_0x9e5892,paging:_0x96768d}=await listAppRoles(_0x1e7020[_0x585e30(0xd1)],{'currentPage':_0x110fa1,'pageSize':_0x18a15d}),_0x1022d0=_0x4c160d?_0x9e5892[_0x585e30(0xe1)](_0x2e517d=>_0x2e517d['roleType']===_0x4c160d):_0x9e5892,_0xc84f44=_0x1022d0[_0x585e30(0xda)](projectRole);return{'ok':!![],'data':{'scope':_0x585e30(0xe3),'roles':_0xc84f44,'paging':_0x96768d},'message':'Found\x20'+_0xc84f44[_0x585e30(0xea)]+_0x585e30(0xd6)};}};
1
+ const a234_0x5debc8=a234_0x589e;(function(_0x4d876d,_0x1dbe2b){const _0x154212=a234_0x589e,_0x1ded55=_0x4d876d();while(!![]){try{const _0x2312f2=-parseInt(_0x154212(0xd7))/0x1*(parseInt(_0x154212(0xeb))/0x2)+parseInt(_0x154212(0xcb))/0x3*(parseInt(_0x154212(0xd3))/0x4)+-parseInt(_0x154212(0xe8))/0x5+parseInt(_0x154212(0xd1))/0x6*(-parseInt(_0x154212(0xe7))/0x7)+parseInt(_0x154212(0xcf))/0x8+parseInt(_0x154212(0xdb))/0x9*(-parseInt(_0x154212(0xea))/0xa)+parseInt(_0x154212(0xce))/0xb*(parseInt(_0x154212(0xdc))/0xc);if(_0x2312f2===_0x1dbe2b)break;else _0x1ded55['push'](_0x1ded55['shift']());}catch(_0x4d5c6f){_0x1ded55['push'](_0x1ded55['shift']());}}}(a234_0x42ef,0x79d37));import{listAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a234_0x589e(_0x58bda8,_0x58f61c){_0x58bda8=_0x58bda8-0xc5;const _0x42ef4c=a234_0x42ef();let _0x589ebc=_0x42ef4c[_0x58bda8];return _0x589ebc;}function a234_0x42ef(){const _0x278513=['807506wbJBJf','1149710stNmeJ','num','342760rsHHEe','23842FcAZqa','Use\x20one\x20of:\x20','read','length','roleType','\x20role(s)','page','number','join','dev','appCode','69IuxrnE','filter','Page\x20size\x20(1-100)','2600873uRyiYb','6020808NxMsyS','list','48zYSmvB','Filter\x20by\x20role\x20type','126500HCNjWe','pagesize','--pagesize\x20must\x20be\x20between\x201\x20and\x20100.','map','10PQUMzx','Invalid\x20--type\x20\x22','CUSTOM','role','234poZKmV','60ATOutS','string','toUpperCase','includes','Found\x20','validation','trim','str','OWNER','type','--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.'];a234_0x42ef=function(){return _0x278513;};return a234_0x42ef();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectRole}from'../../commands/role/shared.js';const ROLE_TYPES=['ADMIN','DEV',a234_0x5debc8(0xe4),a234_0x5debc8(0xd9)];export const roleList={'service':a234_0x5debc8(0xda),'command':a234_0x5debc8(0xd0),'description':'List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','risk':a234_0x5debc8(0xed),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a234_0x5debc8(0xe5),'type':a234_0x5debc8(0xdd),'required':![],'description':a234_0x5debc8(0xd2),'enum':ROLE_TYPES},{'name':'page','type':'number','description':'Page\x20index\x20(1-based)','default':0x1},{'name':a234_0x5debc8(0xd4),'type':a234_0x5debc8(0xc7),'description':a234_0x5debc8(0xcd),'default':0x64}],async 'validate'(_0x4c82e8){const _0x506a53=a234_0x5debc8,_0x530465=_0x4c82e8[_0x506a53(0xe3)]('type')[_0x506a53(0xe2)]();if(_0x530465&&!ROLE_TYPES[_0x506a53(0xdf)](_0x530465['toUpperCase']()))throw CliErrors['validation'](_0x506a53(0xd8)+_0x530465+'\x22.',_0x506a53(0xec)+ROLE_TYPES[_0x506a53(0xc8)](',\x20')+'.');const _0x4698e5=_0x4c82e8['num'](_0x506a53(0xc6),0x1),_0x1b44f4=_0x4c82e8['num'](_0x506a53(0xd4),0x64);if(_0x4698e5<0x1)throw CliErrors[_0x506a53(0xe1)](_0x506a53(0xe6));if(_0x1b44f4<0x1||_0x1b44f4>0x64)throw CliErrors[_0x506a53(0xe1)](_0x506a53(0xd5));},async 'execute'(_0x292809){const _0x1262fb=a234_0x5debc8,_0x5052c2=_0x292809[_0x1262fb(0xe9)](_0x1262fb(0xc6),0x1)||0x1,_0x2bad67=_0x292809[_0x1262fb(0xe9)]('pagesize',0x64)||0x64,_0xfb5736=_0x292809[_0x1262fb(0xe3)](_0x1262fb(0xe5))[_0x1262fb(0xe2)]()[_0x1262fb(0xde)](),{items:_0x17d641,paging:_0x33e0f5}=await listAppRoles(_0x292809[_0x1262fb(0xca)],{'currentPage':_0x5052c2,'pageSize':_0x2bad67}),_0x120821=_0xfb5736?_0x17d641[_0x1262fb(0xcc)](_0x18589d=>_0x18589d[_0x1262fb(0xef)]===_0xfb5736):_0x17d641,_0x46b1ae=_0x120821[_0x1262fb(0xd6)](projectRole);return{'ok':!![],'data':{'scope':_0x1262fb(0xc9),'roles':_0x46b1ae,'paging':_0x33e0f5},'message':_0x1262fb(0xe0)+_0x46b1ae[_0x1262fb(0xee)]+_0x1262fb(0xc5)};}};
@@ -1 +1 @@
1
- const a235_0x147a6d=a235_0x3f49;(function(_0x20a7b5,_0x230073){const _0x4ff615=a235_0x3f49,_0x4fe60d=_0x20a7b5();while(!![]){try{const _0x2efe41=-parseInt(_0x4ff615(0xf9))/0x1*(-parseInt(_0x4ff615(0x122))/0x2)+parseInt(_0x4ff615(0x128))/0x3+parseInt(_0x4ff615(0xff))/0x4*(parseInt(_0x4ff615(0x114))/0x5)+parseInt(_0x4ff615(0x126))/0x6+-parseInt(_0x4ff615(0x134))/0x7+-parseInt(_0x4ff615(0xf7))/0x8*(parseInt(_0x4ff615(0x109))/0x9)+-parseInt(_0x4ff615(0x102))/0xa;if(_0x2efe41===_0x230073)break;else _0x4fe60d['push'](_0x4fe60d['shift']());}catch(_0x3ad014){_0x4fe60d['push'](_0x4fe60d['shift']());}}}(a235_0x1e07,0xe029b));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_0x147a6d(0x132),'required':!![],'description':a235_0x147a6d(0x145)};export const ROLE_REF_FLAG={'name':'role','type':'string','required':!![],'description':'Role\x20id\x20or\x20exact\x20role\x20name'};function a235_0x3f49(_0x3e2cf0,_0x41631f){_0x3e2cf0=_0x3e2cf0-0xf6;const _0x1e0746=a235_0x1e07();let _0x3f49be=_0x1e0746[_0x3e2cf0];return _0x3f49be;}export const USER_REF_FLAG={'name':a235_0x147a6d(0x13c),'type':a235_0x147a6d(0x137),'required':!![],'description':a235_0x147a6d(0x139)};export const NAME_FLAG={'name':a235_0x147a6d(0xf6),'type':a235_0x147a6d(0x137),'required':!![],'description':a235_0x147a6d(0xfa)};export const USER_NAME_FLAG={'name':a235_0x147a6d(0xf6),'type':'string','required':!![],'description':a235_0x147a6d(0x10c)};export const REMARK_FLAG={'name':a235_0x147a6d(0x108),'type':a235_0x147a6d(0x137),'required':![],'description':a235_0x147a6d(0x105)};export const EXPECT_USER_COUNT_FLAG={'name':a235_0x147a6d(0x110),'type':a235_0x147a6d(0x132),'required':![],'description':a235_0x147a6d(0x111)};export const BUILTIN_ROLE_TYPES=[a235_0x147a6d(0x146),a235_0x147a6d(0x10e),a235_0x147a6d(0xfe)];export function isBuiltinRole(_0x2edce7){const _0x4a8d39=a235_0x147a6d;return BUILTIN_ROLE_TYPES[_0x4a8d39(0x13b)](_0x2edce7);}export function assertCustomRole(_0x45c284,_0x275c85){const _0x55be6d=a235_0x147a6d;if(_0x45c284['roleType']!==_0x55be6d(0x10f))throw CliErrors[_0x55be6d(0x101)](_0x55be6d(0x138)+_0x275c85+'\x20built-in\x20role\x20'+_0x45c284[_0x55be6d(0x13a)]+'\x20('+_0x45c284[_0x55be6d(0x10a)]+').',_0x55be6d(0x115));}export function projectRole(_0x1293c3){const _0x5b8710=a235_0x147a6d;return{'id':_0x1293c3['id'],'roleName':_0x1293c3['roleName'],'roleType':_0x1293c3[_0x5b8710(0x10a)],'remark':_0x1293c3[_0x5b8710(0x108)],'userCount':_0x1293c3[_0x5b8710(0x11c)],'permitCount':_0x1293c3[_0x5b8710(0x13d)],'builtin':isBuiltinRole(_0x1293c3[_0x5b8710(0x10a)])};}function a235_0x1e07(){const _0x563921=['3098583KUboqz','totalCount','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','find','\x20duplicate\x20memberships\x20for\x20user\x20','User\x20','test','push','\x22:\x20','flagMissing','number','map','4290552hdpTpF','appCode','str','string','Cannot\x20','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','roleName','includes','user','permitCount','join','length','Pass\x20--role\x20<id|name>.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','expectUserCount','\x20is\x20not\x20a\x20member\x20of\x20role\x20','dev','Role\x20id\x20(from\x20`role\x20list`)','ADMIN','/smartapi/permit/user-role/create','flag','Pass\x20--user\x20<id>.','username','name','3665224ircPUb','dryRun','2nSsSMe','Role\x20name','Check\x20the\x20nickname/username.\x20','No\x20tenant\x20member\x20matches\x20\x22','POST','OWNER','928iOFWMx','role','validation','19638080KTyTEg','\x20member(s)\x20but\x20role\x20has\x20','toLowerCase','Optional\x20role\x20remark/description','tenant','Pass\x20--user\x20<id|name>.','remark','36BbUIxp','roleType','Anti-drift\x20check\x20failed:\x20expected\x20','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','\x20is\x20already\x20a\x20member\x20of\x20role\x20','DEV','CUSTOM','expect-user-count','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','\x22\x20not\x20found\x20in\x20app\x20','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','33710FbtdMu','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','user-add','\x22\x20is\x20ambiguous\x20(ids:\x20',';\x20no\x20change.','nickname','Removed\x20','Missing\x20role\x20reference.','userCount','Multiple\x20tenant\x20members\x20match\x20\x22','userId','\x20not\x20found\x20in\x20app\x20','Role\x20name\x20\x22','\x20members\x20of\x20the\x20OWNER\x20role.','1802778cugOGj','Disambiguate\x20with\x20--role\x20<id>.','authRequired','filter','5566464elfABs','trim'];a235_0x1e07=function(){return _0x563921;};return a235_0x1e07();}export async function resolveRoleRef(_0x5cb23e,_0x2c0e29){const _0x1bf107=a235_0x147a6d,_0x45ea59=_0x2c0e29[_0x1bf107(0x127)]();if(!_0x45ea59)throw CliErrors['validation'](_0x1bf107(0x11b),_0x1bf107(0x140));if(/^\d+$/[_0x1bf107(0x12e)](_0x45ea59))return getRoleById(_0x5cb23e,Number(_0x45ea59));const _0x5dc394=await listAllAppRoles(_0x5cb23e),_0x2fa60b=_0x5dc394[_0x1bf107(0x125)](_0x59952c=>_0x59952c['roleName']===_0x45ea59);if(_0x2fa60b[_0x1bf107(0x13f)]===0x0)throw CliErrors[_0x1bf107(0x101)](_0x1bf107(0x120)+_0x45ea59+_0x1bf107(0x112)+_0x5cb23e+'.',_0x1bf107(0x141));if(_0x2fa60b[_0x1bf107(0x13f)]>0x1){const _0x4d402e=_0x2fa60b['map'](_0x50bd40=>_0x50bd40['id'])[_0x1bf107(0x13e)](',\x20');throw CliErrors[_0x1bf107(0x101)]('Role\x20name\x20\x22'+_0x45ea59+_0x1bf107(0x117)+_0x4d402e+').',_0x1bf107(0x123));}return _0x2fa60b[0x0];}export async function getRoleById(_0x5b9129,_0x147c58){const _0x9fc84=a235_0x147a6d,_0x5cac0b=await listAllAppRoles(_0x5b9129),_0x5d50ba=_0x5cac0b[_0x9fc84(0x125)](_0x54c47e=>_0x54c47e['id']===_0x147c58&&(!_0x54c47e['appCode']||_0x54c47e[_0x9fc84(0x135)]===_0x5b9129));if(_0x5d50ba[_0x9fc84(0x13f)]!==0x1)throw CliErrors[_0x9fc84(0x101)]('Role\x20id\x20'+_0x147c58+_0x9fc84(0x11f)+_0x5b9129+'.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.');return _0x5d50ba[0x0];}async function listAllAppRoles(_0x9cefbd){const _0x20f022=a235_0x147a6d,_0x2f5f14=0x64,_0x3e997f=[];for(let _0x1db7d9=0x1;;_0x1db7d9+=0x1){const {items:_0x1bba9d,paging:_0x2cd245}=await listAppRoles(_0x9cefbd,{'currentPage':_0x1db7d9,'pageSize':_0x2f5f14});_0x3e997f[_0x20f022(0x12f)](..._0x1bba9d);if(_0x1bba9d[_0x20f022(0x13f)]<_0x2f5f14||_0x2cd245&&_0x3e997f['length']>=_0x2cd245[_0x20f022(0x129)])return _0x3e997f;}}export async function resolveTenantCode(){const _0x5e852b=a235_0x147a6d,_0x2b0951=await getSessionUserInfo(),_0x17eeb9=_0x2b0951?.[_0x5e852b(0x13c)]?.[_0x5e852b(0x106)]?.['tenant_code'];if(!_0x17eeb9)throw CliErrors[_0x5e852b(0x124)](_0x5e852b(0x12a));return _0x17eeb9;}function matchMember(_0x45927e,_0x11ad49){const _0x2f8ffd=a235_0x147a6d,_0x3dc09e=_0x11ad49[_0x2f8ffd(0x127)]()[_0x2f8ffd(0x104)]();return(_0x45927e[_0x2f8ffd(0x119)]??'')[_0x2f8ffd(0x104)]()===_0x3dc09e||(_0x45927e['username']??'')[_0x2f8ffd(0x104)]()===_0x3dc09e;}export async function resolveUserRef(_0x539bd4,_0x1cb7a5=a235_0x147a6d(0x149)){const _0xdf2318=a235_0x147a6d,_0x37febf=_0x539bd4[_0xdf2318(0x127)]();if(!_0x37febf)throw CliErrors[_0xdf2318(0x101)]('Missing\x20user\x20reference.',_0xdf2318(0x107));const _0x394f16=await resolveTenantCode(),_0x59c8ac=await getTenantMembers(_0x394f16);if(/^\d+$/[_0xdf2318(0x12e)](_0x37febf)){const _0x30acdc=Number(_0x37febf),_0x5b666f=_0x59c8ac[_0xdf2318(0x12b)](_0x32fb45=>_0x32fb45[_0xdf2318(0x11e)]===_0x30acdc);return{'userId':_0x30acdc,'username':_0x5b666f?.[_0xdf2318(0x14a)]??String(_0x30acdc),'nickname':_0x5b666f?.[_0xdf2318(0x119)],'matchedBy':'id'};}const _0x517b60=_0x59c8ac[_0xdf2318(0x125)](_0x5c5c0c=>matchMember(_0x5c5c0c,_0x37febf));if(_0x517b60[_0xdf2318(0x13f)]===0x0)throw CliErrors[_0xdf2318(0x101)](_0xdf2318(0xfc)+_0x37febf+'\x22.',_0xdf2318(0xfb)+_0x1cb7a5);if(_0x517b60[_0xdf2318(0x13f)]>0x1){const _0x29bef5=_0x517b60['map'](_0x270c7c=>(_0x270c7c[_0xdf2318(0x119)]??_0x270c7c[_0xdf2318(0x14a)]??'?')+'('+_0x270c7c[_0xdf2318(0x11e)]+')')[_0xdf2318(0x13e)](',\x20');throw CliErrors[_0xdf2318(0x101)](_0xdf2318(0x11d)+_0x37febf+_0xdf2318(0x130)+_0x29bef5+'.',_0x1cb7a5);}const _0x226e5b=_0x517b60[0x0];return{'userId':_0x226e5b[_0xdf2318(0x11e)],'username':_0x226e5b[_0xdf2318(0x14a)]??String(_0x226e5b[_0xdf2318(0x11e)]),'nickname':_0x226e5b['nickname'],'matchedBy':_0xdf2318(0xf6)};}export const CREATE_USER_ROLE_PATH=a235_0x147a6d(0x147);export const DELETE_USER_ROLE_PATH='/smartapi/permit/user-role/delete';export function computeRoleUserMutation(_0x1d0b3d){const _0x46ef02=a235_0x147a6d,{operation:_0x497f81,appCode:_0x5a27cb,role:_0x3708ca,relations:_0xe9b0e5,user:_0x4e714a}=_0x1d0b3d,_0x4c3b03=[...new Set(_0xe9b0e5[_0x46ef02(0x133)](_0x5b8a72=>_0x5b8a72['userId']))],_0x17339d=[];if(_0x1d0b3d['expectUserCount']!==undefined&&_0x1d0b3d[_0x46ef02(0x142)]!==_0x4c3b03[_0x46ef02(0x13f)])throw CliErrors[_0x46ef02(0x101)](_0x46ef02(0x10b)+_0x1d0b3d['expectUserCount']+_0x46ef02(0x103)+_0x4c3b03[_0x46ef02(0x13f)]+'.',_0x46ef02(0x113));const _0x25d724=_0x4c3b03[_0x46ef02(0x13b)](_0x4e714a[_0x46ef02(0x11e)]),_0x3fae52=_0xe9b0e5[_0x46ef02(0x125)](_0x392634=>_0x392634[_0x46ef02(0x11e)]===_0x4e714a[_0x46ef02(0x11e)])['map'](_0x18a083=>_0x18a083['id']),_0x2f9d91=_0x497f81==='user-add'?!_0x25d724:_0x25d724;let _0x5911dc=_0x4c3b03;_0x497f81==='user-add'?_0x25d724?_0x17339d[_0x46ef02(0x12f)](_0x46ef02(0x12d)+_0x4e714a[_0x46ef02(0x11e)]+_0x46ef02(0x10d)+_0x3708ca[_0x46ef02(0x13a)]+_0x46ef02(0x118)):_0x5911dc=[..._0x4c3b03,_0x4e714a['userId']]:!_0x25d724?_0x17339d['push'](_0x46ef02(0x12d)+_0x4e714a[_0x46ef02(0x11e)]+_0x46ef02(0x143)+_0x3708ca[_0x46ef02(0x13a)]+_0x46ef02(0x118)):(_0x5911dc=_0x4c3b03[_0x46ef02(0x125)](_0x2f5499=>_0x2f5499!==_0x4e714a['userId']),_0x3fae52[_0x46ef02(0x13f)]>0x1&&_0x17339d['push'](_0x46ef02(0x11a)+_0x3fae52['length']+_0x46ef02(0x12c)+_0x4e714a[_0x46ef02(0x11e)]+'.'));const _0x2d51fa={'scope':_0x46ef02(0x144),'operation':_0x497f81,'selector':{'appCode':_0x5a27cb,'roleId':_0x3708ca['id'],'roleName':_0x3708ca[_0x46ef02(0x13a)],'userId':_0x4e714a[_0x46ef02(0x11e)]},'before':{'userIds':_0x4c3b03},'after':{'userIds':_0x5911dc},'dryRun':_0x1d0b3d[_0x46ef02(0xf8)],'backend':{'method':_0x46ef02(0xfd),'path':_0x497f81===_0x46ef02(0x116)?CREATE_USER_ROLE_PATH:DELETE_USER_ROLE_PATH},'warnings':_0x17339d};return{'mutation':_0x2d51fa,'changed':_0x2f9d91,'matchingRelationIds':_0x3fae52};}export async function loadDevRoleRelations(_0x58f143,_0xcb4046){const _0x44f0f3=a235_0x147a6d,_0x211464=0x64,_0x552ce4=[];for(let _0x545550=0x1;;_0x545550+=0x1){const {items:_0x896494,paging:_0x260964}=await listDevUserRoleRelations(_0x58f143,{'roleId':_0xcb4046,'currentPage':_0x545550,'pageSize':_0x211464});_0x552ce4['push'](..._0x896494);if(_0x896494[_0x44f0f3(0x13f)]<_0x211464||_0x260964&&_0x552ce4[_0x44f0f3(0x13f)]>=_0x260964[_0x44f0f3(0x129)])return _0x552ce4;}}export function readRoleRef(_0x2a4c78){const _0x23f7f8=a235_0x147a6d,_0x314794=_0x2a4c78['str'](_0x23f7f8(0x100))[_0x23f7f8(0x127)]();if(!_0x314794)throw CliErrors[_0x23f7f8(0x131)]('role',_0x23f7f8(0x140));return _0x314794;}export async function prepareUserMutation(_0x430539,_0x27c846,_0x16d5c1){const _0xc3feb=a235_0x147a6d,_0x270e0c=readRoleRef(_0x430539),_0x215cda=_0x430539[_0xc3feb(0x136)](_0xc3feb(0x13c))[_0xc3feb(0x127)]();if(!_0x215cda)throw CliErrors[_0xc3feb(0x131)](_0xc3feb(0x13c),_0xc3feb(0x107));const _0x402d15=_0x430539[_0xc3feb(0x148)](_0xc3feb(0x110)),_0x2a20a3=_0x402d15===undefined||_0x402d15===null?undefined:Number(_0x402d15),_0x3a7da7=await resolveRoleRef(_0x430539['appCode'],_0x270e0c);if(_0x3a7da7[_0xc3feb(0x10a)]==='OWNER')throw CliErrors[_0xc3feb(0x101)](_0xc3feb(0x138)+_0x27c846+_0xc3feb(0x121),'Use\x20the\x20platform\x20ownership-transfer\x20workflow\x20to\x20change\x20the\x20application\x20owner.');const _0x47e4c6=await resolveUserRef(_0x215cda),_0x105016=await loadDevRoleRelations(_0x430539[_0xc3feb(0x135)],_0x3a7da7['id']);return{...computeRoleUserMutation({'operation':_0x27c846,'appCode':_0x430539[_0xc3feb(0x135)],'role':_0x3a7da7,'relations':_0x105016,'user':{'userId':_0x47e4c6[_0xc3feb(0x11e)],'username':_0x47e4c6[_0xc3feb(0x14a)],'nickname':_0x47e4c6[_0xc3feb(0x119)]},'dryRun':_0x16d5c1,..._0x2a20a3!==undefined?{'expectUserCount':_0x2a20a3}:{}}),'role':_0x3a7da7,'user':_0x47e4c6};}
1
+ const a235_0x40e920=a235_0x2bfd;(function(_0x15edcc,_0x126296){const _0x11b934=a235_0x2bfd,_0x7b6748=_0x15edcc();while(!![]){try{const _0x35bdf4=-parseInt(_0x11b934(0x1c9))/0x1*(-parseInt(_0x11b934(0x1b2))/0x2)+parseInt(_0x11b934(0x1b6))/0x3*(-parseInt(_0x11b934(0x1b4))/0x4)+parseInt(_0x11b934(0x1bd))/0x5+parseInt(_0x11b934(0x1c1))/0x6*(parseInt(_0x11b934(0x1d5))/0x7)+parseInt(_0x11b934(0x1c8))/0x8+parseInt(_0x11b934(0x1fb))/0x9+-parseInt(_0x11b934(0x1ef))/0xa;if(_0x35bdf4===_0x126296)break;else _0x7b6748['push'](_0x7b6748['shift']());}catch(_0x4e4eec){_0x7b6748['push'](_0x7b6748['shift']());}}}(a235_0x71bf,0xf40d3));import{getTenantMembers,listDevUserRoleRelations,listAppRoles}from'../../core/api-client.js';import{getSessionUserInfo}from'../../auth/get-session-user.js';import{CliErrors}from'../../errors.js';function a235_0x2bfd(_0x39396a,_0x10bd88){_0x39396a=_0x39396a-0x1b0;const _0x71bf3c=a235_0x71bf();let _0x2bfdc6=_0x71bf3c[_0x39396a];return _0x2bfdc6;}export const ROLE_ID_FLAG={'name':'id','type':'number','required':!![],'description':a235_0x40e920(0x1cc)};export const ROLE_REF_FLAG={'name':'role','type':'string','required':!![],'description':'Role\x20id\x20or\x20exact\x20role\x20name'};export const USER_REF_FLAG={'name':a235_0x40e920(0x1e4),'type':a235_0x40e920(0x1ce),'required':!![],'description':a235_0x40e920(0x1df)};export const NAME_FLAG={'name':a235_0x40e920(0x1d2),'type':a235_0x40e920(0x1ce),'required':!![],'description':a235_0x40e920(0x1fc)};export const USER_NAME_FLAG={'name':a235_0x40e920(0x1d2),'type':a235_0x40e920(0x1ce),'required':!![],'description':a235_0x40e920(0x1c7)};export const REMARK_FLAG={'name':'remark','type':a235_0x40e920(0x1ce),'required':![],'description':a235_0x40e920(0x1f6)};export const EXPECT_USER_COUNT_FLAG={'name':a235_0x40e920(0x1f7),'type':a235_0x40e920(0x1b1),'required':![],'description':a235_0x40e920(0x1c3)};export const BUILTIN_ROLE_TYPES=[a235_0x40e920(0x1f0),a235_0x40e920(0x1eb),'OWNER'];export function isBuiltinRole(_0x4a10fb){return BUILTIN_ROLE_TYPES['includes'](_0x4a10fb);}export function assertCustomRole(_0x2b5daa,_0x1e6f22){const _0x1452aa=a235_0x40e920;if(_0x2b5daa[_0x1452aa(0x1e6)]!==_0x1452aa(0x1b9))throw CliErrors['validation']('Cannot\x20'+_0x1e6f22+_0x1452aa(0x1f9)+_0x2b5daa['roleName']+'\x20('+_0x2b5daa['roleType']+').','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.');}export function projectRole(_0x4bade3){const _0x27e670=a235_0x40e920;return{'id':_0x4bade3['id'],'roleName':_0x4bade3[_0x27e670(0x1c6)],'roleType':_0x4bade3['roleType'],'remark':_0x4bade3[_0x27e670(0x1c4)],'userCount':_0x4bade3[_0x27e670(0x1be)],'permitCount':_0x4bade3['permitCount'],'builtin':isBuiltinRole(_0x4bade3[_0x27e670(0x1e6)])};}export async function resolveRoleRef(_0x4a3fbd,_0x2db4fa){const _0x3a3431=a235_0x40e920,_0x1538f5=_0x2db4fa[_0x3a3431(0x1ea)]();if(!_0x1538f5)throw CliErrors[_0x3a3431(0x1c5)](_0x3a3431(0x1fe),'Pass\x20--role\x20<id|name>.');if(/^\d+$/[_0x3a3431(0x1bf)](_0x1538f5))return getRoleById(_0x4a3fbd,Number(_0x1538f5));const _0x34bcf0=await listAllAppRoles(_0x4a3fbd),_0x4862a6=_0x34bcf0['filter'](_0x45feca=>_0x45feca[_0x3a3431(0x1c6)]===_0x1538f5);if(_0x4862a6[_0x3a3431(0x1cf)]===0x0)throw CliErrors['validation'](_0x3a3431(0x1d6)+_0x1538f5+_0x3a3431(0x1d8)+_0x4a3fbd+'.',_0x3a3431(0x1b0));if(_0x4862a6['length']>0x1){const _0x569716=_0x4862a6[_0x3a3431(0x1ee)](_0x4fb189=>_0x4fb189['id'])['join'](',\x20');throw CliErrors[_0x3a3431(0x1c5)](_0x3a3431(0x1d6)+_0x1538f5+_0x3a3431(0x1d4)+_0x569716+').',_0x3a3431(0x1c0));}return _0x4862a6[0x0];}export async function getRoleById(_0x43f92f,_0x82c723){const _0x22e23b=a235_0x40e920,_0x5c6fae=await listAllAppRoles(_0x43f92f),_0x43e398=_0x5c6fae[_0x22e23b(0x1e7)](_0x2735c1=>_0x2735c1['id']===_0x82c723&&(!_0x2735c1[_0x22e23b(0x1d0)]||_0x2735c1[_0x22e23b(0x1d0)]===_0x43f92f));if(_0x43e398[_0x22e23b(0x1cf)]!==0x1)throw CliErrors[_0x22e23b(0x1c5)](_0x22e23b(0x1b3)+_0x82c723+_0x22e23b(0x1e2)+_0x43f92f+'.',_0x22e23b(0x1db));return _0x43e398[0x0];}async function listAllAppRoles(_0x49dcdc){const _0xaefc07=a235_0x40e920,_0x1916b7=0x64,_0x5de646=[];for(let _0x4b73fb=0x1;;_0x4b73fb+=0x1){const {items:_0x5bdd52,paging:_0x38d45d}=await listAppRoles(_0x49dcdc,{'currentPage':_0x4b73fb,'pageSize':_0x1916b7});_0x5de646[_0xaefc07(0x1de)](..._0x5bdd52);if(_0x5bdd52['length']<_0x1916b7||_0x38d45d&&_0x5de646['length']>=_0x38d45d[_0xaefc07(0x1f4)])return _0x5de646;}}export async function resolveTenantCode(){const _0x4c57d0=a235_0x40e920,_0xc9590=await getSessionUserInfo(),_0x42ca8b=_0xc9590?.['user']?.['tenant']?.[_0x4c57d0(0x1f3)];if(!_0x42ca8b)throw CliErrors['authRequired'](_0x4c57d0(0x1e5));return _0x42ca8b;}function matchMember(_0x28e6ac,_0x97ffc7){const _0x1a6591=a235_0x40e920,_0x5875c6=_0x97ffc7[_0x1a6591(0x1ea)]()[_0x1a6591(0x1b7)]();return(_0x28e6ac[_0x1a6591(0x1d1)]??'')[_0x1a6591(0x1b7)]()===_0x5875c6||(_0x28e6ac[_0x1a6591(0x1ca)]??'')[_0x1a6591(0x1b7)]()===_0x5875c6;}export async function resolveUserRef(_0x53048f,_0x547d4e='Pass\x20--user\x20<id>.'){const _0xa26f7=a235_0x40e920,_0x4d88a0=_0x53048f[_0xa26f7(0x1ea)]();if(!_0x4d88a0)throw CliErrors['validation'](_0xa26f7(0x1f1),_0xa26f7(0x1cd));const _0x327547=await resolveTenantCode(),_0x5255be=await getTenantMembers(_0x327547);if(/^\d+$/[_0xa26f7(0x1bf)](_0x4d88a0)){const _0x377df2=Number(_0x4d88a0),_0x3ef366=_0x5255be['find'](_0x2e9729=>_0x2e9729[_0xa26f7(0x1da)]===_0x377df2);return{'userId':_0x377df2,'username':_0x3ef366?.[_0xa26f7(0x1ca)]??String(_0x377df2),'nickname':_0x3ef366?.[_0xa26f7(0x1d1)],'matchedBy':'id'};}const _0x32ebdf=_0x5255be[_0xa26f7(0x1e7)](_0x3f2fbc=>matchMember(_0x3f2fbc,_0x4d88a0));if(_0x32ebdf[_0xa26f7(0x1cf)]===0x0)throw CliErrors['validation'](_0xa26f7(0x1ed)+_0x4d88a0+'\x22.',_0xa26f7(0x1ff)+_0x547d4e);if(_0x32ebdf[_0xa26f7(0x1cf)]>0x1){const _0x10275d=_0x32ebdf[_0xa26f7(0x1ee)](_0x5f265c=>(_0x5f265c[_0xa26f7(0x1d1)]??_0x5f265c['username']??'?')+'('+_0x5f265c[_0xa26f7(0x1da)]+')')['join'](',\x20');throw CliErrors[_0xa26f7(0x1c5)](_0xa26f7(0x200)+_0x4d88a0+_0xa26f7(0x1e1)+_0x10275d+'.',_0x547d4e);}const _0xc8900a=_0x32ebdf[0x0];return{'userId':_0xc8900a['userId'],'username':_0xc8900a['username']??String(_0xc8900a[_0xa26f7(0x1da)]),'nickname':_0xc8900a[_0xa26f7(0x1d1)],'matchedBy':'name'};}export const CREATE_USER_ROLE_PATH=a235_0x40e920(0x1e0);export const DELETE_USER_ROLE_PATH=a235_0x40e920(0x1cb);export function computeRoleUserMutation(_0x3fa3c7){const _0x267530=a235_0x40e920,{operation:_0xcd3515,appCode:_0x3314f0,role:_0x37350e,relations:_0x13e58b,user:_0x477731}=_0x3fa3c7,_0x2947cb=[...new Set(_0x13e58b[_0x267530(0x1ee)](_0x5d8896=>_0x5d8896[_0x267530(0x1da)]))],_0x9ca31b=[];if(_0x3fa3c7[_0x267530(0x1d9)]!==undefined&&_0x3fa3c7['expectUserCount']!==_0x2947cb['length'])throw CliErrors['validation'](_0x267530(0x1e3)+_0x3fa3c7['expectUserCount']+_0x267530(0x1b8)+_0x2947cb[_0x267530(0x1cf)]+'.',_0x267530(0x1d3));const _0x409bf6=_0x2947cb[_0x267530(0x1fa)](_0x477731[_0x267530(0x1da)]),_0x22dad7=_0x13e58b[_0x267530(0x1e7)](_0x3473c9=>_0x3473c9[_0x267530(0x1da)]===_0x477731[_0x267530(0x1da)])[_0x267530(0x1ee)](_0x3d886a=>_0x3d886a['id']),_0x5784e0=_0xcd3515===_0x267530(0x1d7)?!_0x409bf6:_0x409bf6;let _0xb0db93=_0x2947cb;_0xcd3515===_0x267530(0x1d7)?_0x409bf6?_0x9ca31b['push'](_0x267530(0x1f5)+_0x477731['userId']+'\x20is\x20already\x20a\x20member\x20of\x20role\x20'+_0x37350e[_0x267530(0x1c6)]+_0x267530(0x1dc)):_0xb0db93=[..._0x2947cb,_0x477731[_0x267530(0x1da)]]:!_0x409bf6?_0x9ca31b['push'](_0x267530(0x1f5)+_0x477731[_0x267530(0x1da)]+'\x20is\x20not\x20a\x20member\x20of\x20role\x20'+_0x37350e[_0x267530(0x1c6)]+_0x267530(0x1dc)):(_0xb0db93=_0x2947cb['filter'](_0x484921=>_0x484921!==_0x477731[_0x267530(0x1da)]),_0x22dad7['length']>0x1&&_0x9ca31b['push'](_0x267530(0x1bb)+_0x22dad7[_0x267530(0x1cf)]+_0x267530(0x1e9)+_0x477731[_0x267530(0x1da)]+'.'));const _0x41c2f2={'scope':_0x267530(0x1e8),'operation':_0xcd3515,'selector':{'appCode':_0x3314f0,'roleId':_0x37350e['id'],'roleName':_0x37350e[_0x267530(0x1c6)],'userId':_0x477731[_0x267530(0x1da)]},'before':{'userIds':_0x2947cb},'after':{'userIds':_0xb0db93},'dryRun':_0x3fa3c7[_0x267530(0x1c2)],'backend':{'method':'POST','path':_0xcd3515===_0x267530(0x1d7)?CREATE_USER_ROLE_PATH:DELETE_USER_ROLE_PATH},'warnings':_0x9ca31b};return{'mutation':_0x41c2f2,'changed':_0x5784e0,'matchingRelationIds':_0x22dad7};}export async function loadDevRoleRelations(_0x45eb3b,_0x4cac4d){const _0x2b8da4=a235_0x40e920,_0x1fb858=0x64,_0x297fbc=[];for(let _0x1b75db=0x1;;_0x1b75db+=0x1){const {items:_0x4f1c46,paging:_0x228382}=await listDevUserRoleRelations(_0x45eb3b,{'roleId':_0x4cac4d,'currentPage':_0x1b75db,'pageSize':_0x1fb858});_0x297fbc['push'](..._0x4f1c46);if(_0x4f1c46[_0x2b8da4(0x1cf)]<_0x1fb858||_0x228382&&_0x297fbc[_0x2b8da4(0x1cf)]>=_0x228382[_0x2b8da4(0x1f4)])return _0x297fbc;}}export function readRoleRef(_0x14adb2){const _0x1bcea9=a235_0x40e920,_0x387dc0=_0x14adb2[_0x1bcea9(0x1dd)](_0x1bcea9(0x1f8))[_0x1bcea9(0x1ea)]();if(!_0x387dc0)throw CliErrors[_0x1bcea9(0x1fd)](_0x1bcea9(0x1f8),_0x1bcea9(0x1b5));return _0x387dc0;}function a235_0x71bf(){const _0x4d39d9=['Pass\x20--user\x20<id|name>.','string','length','appCode','nickname','name','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','\x22\x20is\x20ambiguous\x20(ids:\x20','385kjzZKe','Role\x20name\x20\x22','user-add','\x22\x20not\x20found\x20in\x20app\x20','expectUserCount','userId','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.',';\x20no\x20change.','str','push','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','/smartapi/permit/user-role/create','\x22:\x20','\x20not\x20found\x20in\x20app\x20','Anti-drift\x20check\x20failed:\x20expected\x20','user','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','roleType','filter','dev','\x20duplicate\x20memberships\x20for\x20user\x20','trim','DEV','flag','No\x20tenant\x20member\x20matches\x20\x22','map','13976340myTRFs','ADMIN','Missing\x20user\x20reference.','Use\x20the\x20platform\x20ownership-transfer\x20workflow\x20to\x20change\x20the\x20application\x20owner.','tenant_code','totalCount','User\x20','Optional\x20role\x20remark/description','expect-user-count','role','\x20built-in\x20role\x20','includes','1339704NIbgjz','Role\x20name','flagMissing','Missing\x20role\x20reference.','Check\x20the\x20nickname/username.\x20','Multiple\x20tenant\x20members\x20match\x20\x22','OWNER','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','number','507418MiaPVe','Role\x20id\x20','344Hozrrz','Pass\x20--role\x20<id|name>.','36222drrdAo','toLowerCase','\x20member(s)\x20but\x20role\x20has\x20','CUSTOM','\x20members\x20of\x20the\x20OWNER\x20role.','Removed\x20','Cannot\x20','8372320dTRZYY','userCount','test','Disambiguate\x20with\x20--role\x20<id>.','33666rKiHmV','dryRun','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','remark','validation','roleName','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','281304ZfDmDx','5kfamDT','username','/smartapi/permit/user-role/delete','Role\x20id\x20(from\x20`role\x20list`)'];a235_0x71bf=function(){return _0x4d39d9;};return a235_0x71bf();}export async function prepareUserMutation(_0xa72084,_0xd58d67,_0x266747){const _0x38e508=a235_0x40e920,_0x2218b9=readRoleRef(_0xa72084),_0x1d8263=_0xa72084[_0x38e508(0x1dd)](_0x38e508(0x1e4))[_0x38e508(0x1ea)]();if(!_0x1d8263)throw CliErrors['flagMissing'](_0x38e508(0x1e4),_0x38e508(0x1cd));const _0x55335d=_0xa72084[_0x38e508(0x1ec)](_0x38e508(0x1f7)),_0x13c6a6=_0x55335d===undefined||_0x55335d===null?undefined:Number(_0x55335d),_0x25a1ca=await resolveRoleRef(_0xa72084[_0x38e508(0x1d0)],_0x2218b9);if(_0x25a1ca[_0x38e508(0x1e6)]===_0x38e508(0x201))throw CliErrors[_0x38e508(0x1c5)](_0x38e508(0x1bc)+_0xd58d67+_0x38e508(0x1ba),_0x38e508(0x1f2));const _0x4810ca=await resolveUserRef(_0x1d8263),_0x39d3c7=await loadDevRoleRelations(_0xa72084[_0x38e508(0x1d0)],_0x25a1ca['id']);return{...computeRoleUserMutation({'operation':_0xd58d67,'appCode':_0xa72084[_0x38e508(0x1d0)],'role':_0x25a1ca,'relations':_0x39d3c7,'user':{'userId':_0x4810ca[_0x38e508(0x1da)],'username':_0x4810ca[_0x38e508(0x1ca)],'nickname':_0x4810ca[_0x38e508(0x1d1)]},'dryRun':_0x266747,..._0x13c6a6!==undefined?{'expectUserCount':_0x13c6a6}:{}}),'role':_0x25a1ca,'user':_0x4810ca};}
@@ -1 +1 @@
1
- const a236_0x529773=a236_0x5559;(function(_0x543cf0,_0x2ab2d3){const _0x5795b1=a236_0x5559,_0xb05bae=_0x543cf0();while(!![]){try{const _0xad785a=parseInt(_0x5795b1(0xd2))/0x1+-parseInt(_0x5795b1(0xc9))/0x2*(parseInt(_0x5795b1(0xd6))/0x3)+-parseInt(_0x5795b1(0xd3))/0x4*(parseInt(_0x5795b1(0xdc))/0x5)+parseInt(_0x5795b1(0xe2))/0x6+-parseInt(_0x5795b1(0xcb))/0x7*(-parseInt(_0x5795b1(0xda))/0x8)+parseInt(_0x5795b1(0xe0))/0x9*(-parseInt(_0x5795b1(0xc8))/0xa)+-parseInt(_0x5795b1(0xd9))/0xb*(-parseInt(_0x5795b1(0xde))/0xc);if(_0xad785a===_0x2ab2d3)break;else _0xb05bae['push'](_0xb05bae['shift']());}catch(_0x102afb){_0xb05bae['push'](_0xb05bae['shift']());}}}(a236_0x203c,0xae7c5));import{updateAppRole}from'../../core/api-client.js';function a236_0x203c(){const _0x27e60e=['New\x20role\x20name','trim','string','\x20(id=','POST','flag','39150KSeHBB','15076ydYIhW','remark','98zsJvqA','Updated\x20role\x20','dev','num','--name\x20cannot\x20be\x20empty.','name','role','1261944RTjOyP','1249372KMuaki','/smartapi/permit/role/update','validation','168MbhdGy','Nothing\x20to\x20update.','roleName','1506956tQkvfA','733384qGhnyx','length','20ERCmKT','write','48uUsHKi','appCode','1755FHnTVC','update','337608JuUXSY'];a236_0x203c=function(){return _0x27e60e;};return a236_0x203c();}import{CliErrors}from'../../errors.js';function a236_0x5559(_0x36fa6b,_0x498d5e){_0x36fa6b=_0x36fa6b-0xc4;const _0x203cd9=a236_0x203c();let _0x555978=_0x203cd9[_0x36fa6b];return _0x555978;}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=a236_0x529773(0xd4);function readPatch(_0x409507){const _0x8073de=a236_0x529773,_0x5d362f=_0x409507[_0x8073de(0xc7)](_0x8073de(0xd0)),_0x18eeeb=_0x409507[_0x8073de(0xc7)]('remark'),_0x2bb1b9={};if(_0x5d362f!==undefined&&_0x5d362f!==null){const _0x197033=String(_0x5d362f)[_0x8073de(0xe4)]();if(!_0x197033)throw CliErrors[_0x8073de(0xd5)](_0x8073de(0xcf));if(_0x197033[_0x8073de(0xdb)]>0x40)throw CliErrors[_0x8073de(0xd5)]('Role\x20name\x20cannot\x20exceed\x2064\x20characters.');_0x2bb1b9[_0x8073de(0xd8)]=_0x197033;}_0x18eeeb!==undefined&&_0x18eeeb!==null&&(_0x2bb1b9[_0x8073de(0xca)]=String(_0x18eeeb));if(_0x2bb1b9[_0x8073de(0xd8)]===undefined&&_0x2bb1b9['remark']===undefined)throw CliErrors[_0x8073de(0xd5)](_0x8073de(0xd7),'Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.');return _0x2bb1b9;}export const roleUpdate={'service':a236_0x529773(0xd1),'command':a236_0x529773(0xe1),'description':'Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(built-in\x20roles\x20rejected)','risk':a236_0x529773(0xdd),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':'name','type':a236_0x529773(0xc4),'required':![],'description':a236_0x529773(0xe3)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x19a7c0){readPatch(_0x19a7c0);},async 'dryRun'(_0x3ff9e8){const _0x707487=a236_0x529773,_0x535ee3=_0x3ff9e8[_0x707487(0xce)]('id'),_0x1f4255=readPatch(_0x3ff9e8),_0x23a1f7=await getRoleById(_0x3ff9e8['appCode'],_0x535ee3);return assertCustomRole(_0x23a1f7,_0x707487(0xe1)),asDryRunResult({'scope':_0x707487(0xcd),'operation':_0x707487(0xe1),'selector':{'appCode':_0x3ff9e8[_0x707487(0xdf)],'roleId':_0x535ee3,'roleName':_0x23a1f7[_0x707487(0xd8)]},'before':projectRole(_0x23a1f7),'after':projectRole({..._0x23a1f7,..._0x1f4255['roleName']!==undefined?{'roleName':_0x1f4255[_0x707487(0xd8)]}:{},..._0x1f4255[_0x707487(0xca)]!==undefined?{'remark':_0x1f4255[_0x707487(0xca)]}:{}}),'dryRun':!![],'backend':{'method':_0x707487(0xc6),'path':UPDATE_PATH},'warnings':[]},{'method':_0x707487(0xc6),'url':UPDATE_PATH});},async 'execute'(_0x34e289){const _0x53b478=a236_0x529773,_0x1e0616=_0x34e289[_0x53b478(0xce)]('id'),_0x19d403=readPatch(_0x34e289),_0x5a7787=await getRoleById(_0x34e289[_0x53b478(0xdf)],_0x1e0616);assertCustomRole(_0x5a7787,'update'),await updateAppRole({'id':_0x1e0616,'appCode':_0x34e289[_0x53b478(0xdf)],..._0x19d403[_0x53b478(0xd8)]!==undefined?{'roleName':_0x19d403[_0x53b478(0xd8)]}:{},..._0x19d403['remark']!==undefined?{'remark':_0x19d403[_0x53b478(0xca)]}:{}});const _0x36ba35=await getRoleById(_0x34e289[_0x53b478(0xdf)],_0x1e0616);return{'ok':!![],'data':{'scope':_0x53b478(0xcd),'operation':_0x53b478(0xe1),'selector':{'appCode':_0x34e289[_0x53b478(0xdf)],'roleId':_0x1e0616,'roleName':_0x36ba35[_0x53b478(0xd8)]},'before':projectRole(_0x5a7787),'after':projectRole(_0x36ba35),'dryRun':![],'backend':{'method':'POST','path':UPDATE_PATH},'warnings':[]},'message':_0x53b478(0xcc)+_0x36ba35[_0x53b478(0xd8)]+_0x53b478(0xc5)+_0x1e0616+')'};}};
1
+ const a236_0x3aa99c=a236_0x3e05;(function(_0x566bdb,_0xca677f){const _0x2049ef=a236_0x3e05,_0x58e845=_0x566bdb();while(!![]){try{const _0xe3cef1=-parseInt(_0x2049ef(0xc4))/0x1*(-parseInt(_0x2049ef(0xca))/0x2)+parseInt(_0x2049ef(0xc8))/0x3+-parseInt(_0x2049ef(0xce))/0x4+parseInt(_0x2049ef(0xd0))/0x5+parseInt(_0x2049ef(0xb5))/0x6+-parseInt(_0x2049ef(0xc6))/0x7*(parseInt(_0x2049ef(0xb6))/0x8)+-parseInt(_0x2049ef(0xbd))/0x9*(-parseInt(_0x2049ef(0xbe))/0xa);if(_0xe3cef1===_0xca677f)break;else _0x58e845['push'](_0x58e845['shift']());}catch(_0x885529){_0x58e845['push'](_0x58e845['shift']());}}}(a236_0x3b3b,0x6b200));function a236_0x3e05(_0x225fc3,_0x4d9621){_0x225fc3=_0x225fc3-0xb1;const _0x3b3b72=a236_0x3b3b();let _0x3e0528=_0x3b3b72[_0x225fc3];return _0x3e0528;}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=a236_0x3aa99c(0xbf);function readPatch(_0x1e5f92){const _0x14a4f8=a236_0x3aa99c,_0x16f24e=_0x1e5f92['flag'](_0x14a4f8(0xc9)),_0x494ac=_0x1e5f92[_0x14a4f8(0xc1)]('remark'),_0x3267ff={};if(_0x16f24e!==undefined&&_0x16f24e!==null){const _0x5c4226=String(_0x16f24e)['trim']();if(!_0x5c4226)throw CliErrors[_0x14a4f8(0xb7)](_0x14a4f8(0xc7));if(_0x5c4226[_0x14a4f8(0xc0)]>0x40)throw CliErrors[_0x14a4f8(0xb7)](_0x14a4f8(0xb1));_0x3267ff[_0x14a4f8(0xb9)]=_0x5c4226;}_0x494ac!==undefined&&_0x494ac!==null&&(_0x3267ff['remark']=String(_0x494ac));if(_0x3267ff[_0x14a4f8(0xb9)]===undefined&&_0x3267ff[_0x14a4f8(0xba)]===undefined)throw CliErrors[_0x14a4f8(0xb7)](_0x14a4f8(0xcc),_0x14a4f8(0xbb));return _0x3267ff;}function a236_0x3b3b(){const _0x112582=['28160QmOuOt','/smartapi/permit/role/update','length','flag','POST','update','6iDuQrE','string','4570741VZVYNl','--name\x20cannot\x20be\x20empty.','379611yGXvVo','name','179596iOYdMo','num','Nothing\x20to\x20update.','role','2371116aqukiD','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(built-in\x20roles\x20rejected)','1085690PoASOM','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','dev','write','\x20(id=','3004506XKxjMN','8HXxFnB','validation','appCode','roleName','remark','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','Updated\x20role\x20','963FNwHer'];a236_0x3b3b=function(){return _0x112582;};return a236_0x3b3b();}export const roleUpdate={'service':a236_0x3aa99c(0xcd),'command':'update','description':a236_0x3aa99c(0xcf),'risk':a236_0x3aa99c(0xb3),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a236_0x3aa99c(0xc9),'type':a236_0x3aa99c(0xc5),'required':![],'description':'New\x20role\x20name'},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x2660d7){readPatch(_0x2660d7);},async 'dryRun'(_0x32ad82){const _0x45fc05=a236_0x3aa99c,_0x14b9b6=_0x32ad82[_0x45fc05(0xcb)]('id'),_0x4c396d=readPatch(_0x32ad82),_0x2ba1f6=await getRoleById(_0x32ad82[_0x45fc05(0xb8)],_0x14b9b6);return assertCustomRole(_0x2ba1f6,_0x45fc05(0xc3)),asDryRunResult({'scope':_0x45fc05(0xb2),'operation':_0x45fc05(0xc3),'selector':{'appCode':_0x32ad82[_0x45fc05(0xb8)],'roleId':_0x14b9b6,'roleName':_0x2ba1f6[_0x45fc05(0xb9)]},'before':projectRole(_0x2ba1f6),'after':projectRole({..._0x2ba1f6,..._0x4c396d[_0x45fc05(0xb9)]!==undefined?{'roleName':_0x4c396d[_0x45fc05(0xb9)]}:{},..._0x4c396d[_0x45fc05(0xba)]!==undefined?{'remark':_0x4c396d[_0x45fc05(0xba)]}:{}}),'dryRun':!![],'backend':{'method':_0x45fc05(0xc2),'path':UPDATE_PATH},'warnings':[]},{'method':_0x45fc05(0xc2),'url':UPDATE_PATH});},async 'execute'(_0xf11a43){const _0x508af3=a236_0x3aa99c,_0x139abd=_0xf11a43[_0x508af3(0xcb)]('id'),_0x4c1541=readPatch(_0xf11a43),_0x4ed0d8=await getRoleById(_0xf11a43[_0x508af3(0xb8)],_0x139abd);assertCustomRole(_0x4ed0d8,_0x508af3(0xc3)),await updateAppRole({'id':_0x139abd,'appCode':_0xf11a43['appCode'],..._0x4c1541['roleName']!==undefined?{'roleName':_0x4c1541['roleName']}:{},..._0x4c1541['remark']!==undefined?{'remark':_0x4c1541[_0x508af3(0xba)]}:{}});const _0x20c831=await getRoleById(_0xf11a43['appCode'],_0x139abd);return{'ok':!![],'data':{'scope':'dev','operation':_0x508af3(0xc3),'selector':{'appCode':_0xf11a43[_0x508af3(0xb8)],'roleId':_0x139abd,'roleName':_0x20c831[_0x508af3(0xb9)]},'before':projectRole(_0x4ed0d8),'after':projectRole(_0x20c831),'dryRun':![],'backend':{'method':'POST','path':UPDATE_PATH},'warnings':[]},'message':_0x508af3(0xbc)+_0x20c831[_0x508af3(0xb9)]+_0x508af3(0xb4)+_0x139abd+')'};}};
@@ -1 +1 @@
1
- const a237_0x29baf4=a237_0x1f8e;(function(_0x227139,_0x259da2){const _0x3a5773=a237_0x1f8e,_0xe29e47=_0x227139();while(!![]){try{const _0x16c196=parseInt(_0x3a5773(0x10b))/0x1+parseInt(_0x3a5773(0x114))/0x2*(parseInt(_0x3a5773(0x106))/0x3)+parseInt(_0x3a5773(0x105))/0x4*(parseInt(_0x3a5773(0x119))/0x5)+-parseInt(_0x3a5773(0x103))/0x6*(parseInt(_0x3a5773(0x100))/0x7)+-parseInt(_0x3a5773(0x115))/0x8*(-parseInt(_0x3a5773(0x108))/0x9)+parseInt(_0x3a5773(0xff))/0xa*(-parseInt(_0x3a5773(0x109))/0xb)+parseInt(_0x3a5773(0x110))/0xc*(-parseInt(_0x3a5773(0x101))/0xd);if(_0x16c196===_0x259da2)break;else _0xe29e47['push'](_0xe29e47['shift']());}catch(_0x46f7f3){_0xe29e47['push'](_0xe29e47['shift']());}}}(a237_0x5aee,0xc8566));import{createDevUserRole}from'../../core/api-client.js';function a237_0x1f8e(_0x27a710,_0x3fd203){_0x27a710=_0x27a710-0xff;const _0x5aee2a=a237_0x5aee();let _0x1f8ec1=_0x5aee2a[_0x27a710];return _0x1f8ec1;}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_0x29baf4(0x102),'command':'user-add','description':a237_0x29baf4(0x10f),'risk':a237_0x29baf4(0x112),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x4fc9d2){const _0xb46a3=a237_0x29baf4,{mutation:_0x22788f}=await prepareUserMutation(_0x4fc9d2,_0xb46a3(0x117),!![]);return asDryRunResult(_0x22788f,{'method':_0xb46a3(0x113),'url':CREATE_USER_ROLE_PATH});},async 'execute'(_0x96768e){const _0x297176=a237_0x29baf4,{mutation:_0x26a234,changed:_0x46f157,role:_0x5a55f3,user:_0x228651}=await prepareUserMutation(_0x96768e,_0x297176(0x117),![]);return _0x46f157&&await createDevUserRole({'appCode':_0x96768e[_0x297176(0x111)],'userId':_0x228651['userId'],'username':_0x228651[_0x297176(0x10d)],'roleType':_0x5a55f3[_0x297176(0x118)],'roleId':_0x26a234[_0x297176(0x116)][_0x297176(0x10c)]}),{'ok':!![],'data':_0x26a234,'message':_0x46f157?_0x297176(0x10a)+_0x26a234[_0x297176(0x116)]['userId']+_0x297176(0x10e)+_0x26a234[_0x297176(0x116)][_0x297176(0x104)]:_0x297176(0x107)+_0x26a234[_0x297176(0x116)]['userId']+'\x20already\x20in\x20role\x20'+_0x26a234[_0x297176(0x116)][_0x297176(0x104)]};}};function a237_0x5aee(){const _0x1e6e5a=['No\x20change:\x20user\x20','18DbtiIG','33AMKWgC','Added\x20user\x20','1132834LwKcGg','roleId','username','\x20to\x20role\x20','Add\x20a\x20user\x20to\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','156kxLCgH','appCode','high-risk-write','POST','218DiPMUy','123672DGGKRB','selector','user-add','roleType','4346165mCZXrv','967060pRDJks','7149611iOxKxs','561561UxyvCj','role','6kTYqMA','roleName','4NZkmsB','18183xusIlY'];a237_0x5aee=function(){return _0x1e6e5a;};return a237_0x5aee();}
1
+ const a237_0x4f8677=a237_0x56e0;(function(_0x1b1ba6,_0x4ebfb2){const _0x59d568=a237_0x56e0,_0x25b192=_0x1b1ba6();while(!![]){try{const _0x3121c3=-parseInt(_0x59d568(0x7d))/0x1+parseInt(_0x59d568(0x86))/0x2+parseInt(_0x59d568(0x80))/0x3*(parseInt(_0x59d568(0x88))/0x4)+-parseInt(_0x59d568(0x85))/0x5+parseInt(_0x59d568(0x77))/0x6+parseInt(_0x59d568(0x89))/0x7+parseInt(_0x59d568(0x74))/0x8*(-parseInt(_0x59d568(0x84))/0x9);if(_0x3121c3===_0x4ebfb2)break;else _0x25b192['push'](_0x25b192['shift']());}catch(_0x432324){_0x25b192['push'](_0x25b192['shift']());}}}(a237_0x5ab1,0xc527f));function a237_0x5ab1(){const _0x291dc3=['1606626qDJmzS','6383155utQJWg','338488ahZGYs','Add\x20a\x20user\x20to\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','876vjVyTr','8790089eficgE','16zqeiiz','roleId','Added\x20user\x20','3648666ubQScD','selector','appCode','\x20already\x20in\x20role\x20','user-add','role','527221twwveM','userId','roleType','12813DaZzfZ','\x20to\x20role\x20','roleName','No\x20change:\x20user\x20'];a237_0x5ab1=function(){return _0x291dc3;};return a237_0x5ab1();}import{createDevUserRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a237_0x56e0(_0x2da159,_0x32ced9){_0x2da159=_0x2da159-0x74;const _0x5ab13f=a237_0x5ab1();let _0x56e0dd=_0x5ab13f[_0x2da159];return _0x56e0dd;}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_0x4f8677(0x7c),'command':a237_0x4f8677(0x7b),'description':a237_0x4f8677(0x87),'risk':'high-risk-write','flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x4f50e4){const {mutation:_0x25dabf}=await prepareUserMutation(_0x4f50e4,'user-add',!![]);return asDryRunResult(_0x25dabf,{'method':'POST','url':CREATE_USER_ROLE_PATH});},async 'execute'(_0x65c12c){const _0x25a44a=a237_0x4f8677,{mutation:_0x4a54bd,changed:_0xe3d688,role:_0x3985c8,user:_0x5a9654}=await prepareUserMutation(_0x65c12c,_0x25a44a(0x7b),![]);return _0xe3d688&&await createDevUserRole({'appCode':_0x65c12c[_0x25a44a(0x79)],'userId':_0x5a9654['userId'],'username':_0x5a9654['username'],'roleType':_0x3985c8[_0x25a44a(0x7f)],'roleId':_0x4a54bd[_0x25a44a(0x78)][_0x25a44a(0x75)]}),{'ok':!![],'data':_0x4a54bd,'message':_0xe3d688?_0x25a44a(0x76)+_0x4a54bd[_0x25a44a(0x78)][_0x25a44a(0x7e)]+_0x25a44a(0x81)+_0x4a54bd['selector'][_0x25a44a(0x82)]:_0x25a44a(0x83)+_0x4a54bd[_0x25a44a(0x78)][_0x25a44a(0x7e)]+_0x25a44a(0x7a)+_0x4a54bd[_0x25a44a(0x78)][_0x25a44a(0x82)]};}};
@@ -1 +1 @@
1
- const a238_0x3dbcfb=a238_0x2d77;(function(_0x100dcc,_0x5d24e8){const _0x579a1c=a238_0x2d77,_0x2031fc=_0x100dcc();while(!![]){try{const _0x4482e0=parseInt(_0x579a1c(0x16a))/0x1*(parseInt(_0x579a1c(0x16d))/0x2)+-parseInt(_0x579a1c(0x16f))/0x3+parseInt(_0x579a1c(0x16e))/0x4+parseInt(_0x579a1c(0x175))/0x5*(-parseInt(_0x579a1c(0x174))/0x6)+-parseInt(_0x579a1c(0x177))/0x7*(parseInt(_0x579a1c(0x16c))/0x8)+-parseInt(_0x579a1c(0x17a))/0x9*(-parseInt(_0x579a1c(0x179))/0xa)+parseInt(_0x579a1c(0x171))/0xb;if(_0x4482e0===_0x5d24e8)break;else _0x2031fc['push'](_0x2031fc['shift']());}catch(_0x1fd24f){_0x2031fc['push'](_0x2031fc['shift']());}}}(a238_0x2410,0x661de));function a238_0x2d77(_0x1e8881,_0x1dcffd){_0x1e8881=_0x1e8881-0x168;const _0x24104d=a238_0x2410();let _0x2d774d=_0x24104d[_0x1e8881];return _0x2d774d;}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_0x3dbcfb(0x168),'command':a238_0x3dbcfb(0x170),'description':'Remove\x20a\x20user\x20from\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','risk':a238_0x3dbcfb(0x169),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x47e2a5){const _0x332dbd=a238_0x3dbcfb,{mutation:_0x2fe507}=await prepareUserMutation(_0x47e2a5,_0x332dbd(0x170),!![]);return asDryRunResult(_0x2fe507,{'method':'POST','url':DELETE_USER_ROLE_PATH});},async 'execute'(_0x309391){const _0x4f7a37=a238_0x3dbcfb,{matchingRelationIds:_0x247f11,mutation:_0x25eebe,changed:_0x3eb0e1}=await prepareUserMutation(_0x309391,_0x4f7a37(0x170),![]);if(_0x3eb0e1)for(const _0x477e29 of _0x247f11){await deleteDevUserRole(_0x477e29);}return{'ok':!![],'data':_0x25eebe,'message':_0x3eb0e1?_0x4f7a37(0x173)+_0x25eebe[_0x4f7a37(0x178)]['userId']+_0x4f7a37(0x176)+_0x25eebe[_0x4f7a37(0x178)]['roleName']:_0x4f7a37(0x16b)+_0x25eebe[_0x4f7a37(0x178)]['userId']+'\x20not\x20in\x20role\x20'+_0x25eebe[_0x4f7a37(0x178)][_0x4f7a37(0x172)]};}};function a238_0x2410(){const _0x105110=['524251fxKOUY','selector','60EQtjDz','822573vHHAad','role','high-risk-write','46SUjeBA','No\x20change:\x20user\x20','80gRbaEz','10832MzwWfe','2094740SLxfCf','1183107VQLtjZ','user-remove','7237230BqMAel','roleName','Removed\x20user\x20','119304jLsxZv','105GElMhx','\x20from\x20role\x20'];a238_0x2410=function(){return _0x105110;};return a238_0x2410();}
1
+ const a238_0x1e23ec=a238_0x4678;(function(_0x1a7eba,_0x48d223){const _0x2a7e56=a238_0x4678,_0x238770=_0x1a7eba();while(!![]){try{const _0x188d74=-parseInt(_0x2a7e56(0xb1))/0x1*(-parseInt(_0x2a7e56(0xbc))/0x2)+-parseInt(_0x2a7e56(0xc0))/0x3*(parseInt(_0x2a7e56(0xb6))/0x4)+-parseInt(_0x2a7e56(0xb3))/0x5+-parseInt(_0x2a7e56(0xbb))/0x6*(parseInt(_0x2a7e56(0xaf))/0x7)+parseInt(_0x2a7e56(0xb4))/0x8+parseInt(_0x2a7e56(0xbf))/0x9+-parseInt(_0x2a7e56(0xbe))/0xa*(-parseInt(_0x2a7e56(0xab))/0xb);if(_0x188d74===_0x48d223)break;else _0x238770['push'](_0x238770['shift']());}catch(_0x2cf4e7){_0x238770['push'](_0x238770['shift']());}}}(a238_0x54e0,0xa3234));import{deleteDevUserRole}from'../../core/api-client.js';function a238_0x4678(_0x5f4fe7,_0x362e7f){_0x5f4fe7=_0x5f4fe7-0xab;const _0x54e046=a238_0x54e0();let _0x467807=_0x54e046[_0x5f4fe7];return _0x467807;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,DELETE_USER_ROLE_PATH,prepareUserMutation,ROLE_REF_FLAG,USER_REF_FLAG}from'../../commands/role/shared.js';function a238_0x54e0(){const _0x24921c=['1594jpllLA','\x20from\x20role\x20','310LOnftf','11409372OwpEZy','2360415VKqRaO','50259ivaktS','userId','POST','high-risk-write','77fNKSOM','user-remove','514ZXpjyF','selector','6653590JwVUno','8481400Llawax','Remove\x20a\x20user\x20from\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','4UgRGUW','No\x20change:\x20user\x20','roleName','role','\x20not\x20in\x20role\x20','50970KbZcNk'];a238_0x54e0=function(){return _0x24921c;};return a238_0x54e0();}export const roleUserRemove={'service':a238_0x1e23ec(0xb9),'command':a238_0x1e23ec(0xb0),'description':a238_0x1e23ec(0xb5),'risk':a238_0x1e23ec(0xae),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x2cf594){const _0x3d15c4=a238_0x1e23ec,{mutation:_0xc904d4}=await prepareUserMutation(_0x2cf594,_0x3d15c4(0xb0),!![]);return asDryRunResult(_0xc904d4,{'method':_0x3d15c4(0xad),'url':DELETE_USER_ROLE_PATH});},async 'execute'(_0x49be4e){const _0x58ee30=a238_0x1e23ec,{matchingRelationIds:_0x2e21f8,mutation:_0x358a82,changed:_0x23abfe}=await prepareUserMutation(_0x49be4e,_0x58ee30(0xb0),![]);if(_0x23abfe)for(const _0x14a558 of _0x2e21f8){await deleteDevUserRole(_0x14a558);}return{'ok':!![],'data':_0x358a82,'message':_0x23abfe?'Removed\x20user\x20'+_0x358a82['selector'][_0x58ee30(0xac)]+_0x58ee30(0xbd)+_0x358a82[_0x58ee30(0xb2)][_0x58ee30(0xb8)]:_0x58ee30(0xb7)+_0x358a82['selector'][_0x58ee30(0xac)]+_0x58ee30(0xba)+_0x358a82['selector']['roleName']};}};
@@ -1 +1 @@
1
- const a239_0x40866c=a239_0x4636;function a239_0x2927(){const _0x5f4813=['234lZUwZJ','nickname','2EmmpcF','1065956STmAje','\x22\x20→\x20userId\x20','matchedBy','Resolved\x20\x22','Pass\x20--name\x20<nickname|username>.','read','110LKLvpU','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','388362oEqsiG','name','userId','flagMissing','trim','891500YxdWtn','5168705ROpihT','username','Select\x20a\x20listed\x20userId,\x20then\x20pass\x20it\x20to\x20`role\x20user-add`\x20or\x20`role\x20user-remove`\x20with\x20--user\x20<id>.','1039599hsRvgs','6986Qfktrf','user-resolve','2089504dnBsez'];a239_0x2927=function(){return _0x5f4813;};return a239_0x2927();}(function(_0x47839c,_0x3945d9){const _0x38f553=a239_0x4636,_0x45acf7=_0x47839c();while(!![]){try{const _0x429104=-parseInt(_0x38f553(0x165))/0x1*(-parseInt(_0x38f553(0x14e))/0x2)+-parseInt(_0x38f553(0x156))/0x3+-parseInt(_0x38f553(0x15b))/0x4+parseInt(_0x38f553(0x15c))/0x5+-parseInt(_0x38f553(0x163))/0x6*(parseInt(_0x38f553(0x160))/0x7)+parseInt(_0x38f553(0x162))/0x8+-parseInt(_0x38f553(0x15f))/0x9*(parseInt(_0x38f553(0x154))/0xa);if(_0x429104===_0x3945d9)break;else _0x45acf7['push'](_0x45acf7['shift']());}catch(_0x44300f){_0x45acf7['push'](_0x45acf7['shift']());}}}(a239_0x2927,0xaaa85));import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a239_0x4636(_0xd397be,_0xe3bf70){_0xd397be=_0xd397be-0x14e;const _0x29278d=a239_0x2927();let _0x4636cd=_0x29278d[_0xd397be];return _0x4636cd;}import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';export const roleUserResolve={'service':'role','command':a239_0x40866c(0x161),'description':a239_0x40866c(0x155),'risk':a239_0x40866c(0x153),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x4b6e06){const _0x1b10c8=a239_0x40866c;if(!_0x4b6e06['str'](_0x1b10c8(0x157))[_0x1b10c8(0x15a)]())throw CliErrors[_0x1b10c8(0x159)]('name',_0x1b10c8(0x152));},async 'execute'(_0x1b244b){const _0x4754d8=a239_0x40866c,_0x2d1121=_0x1b244b['str'](_0x4754d8(0x157))['trim'](),_0x366fec=await resolveUserRef(_0x2d1121,_0x4754d8(0x15e));return{'ok':!![],'data':{'user':{'userId':_0x366fec[_0x4754d8(0x158)],'username':_0x366fec[_0x4754d8(0x15d)],'nickname':_0x366fec[_0x4754d8(0x164)],'matchedBy':_0x366fec[_0x4754d8(0x150)]}},'message':_0x4754d8(0x151)+_0x2d1121+_0x4754d8(0x14f)+_0x366fec[_0x4754d8(0x158)]};}};
1
+ function a239_0x354c(_0x29e82e,_0x50a2ad){_0x29e82e=_0x29e82e-0x102;const _0x92222=a239_0x9222();let _0x354cc1=_0x92222[_0x29e82e];return _0x354cc1;}const a239_0x20ebf6=a239_0x354c;(function(_0x26d720,_0x4f3d5e){const _0x106744=a239_0x354c,_0xe47545=_0x26d720();while(!![]){try{const _0x32599b=-parseInt(_0x106744(0x10d))/0x1+-parseInt(_0x106744(0x102))/0x2*(parseInt(_0x106744(0x111))/0x3)+-parseInt(_0x106744(0x105))/0x4*(parseInt(_0x106744(0x108))/0x5)+-parseInt(_0x106744(0x112))/0x6*(-parseInt(_0x106744(0x106))/0x7)+-parseInt(_0x106744(0x113))/0x8*(-parseInt(_0x106744(0x107))/0x9)+parseInt(_0x106744(0x114))/0xa+-parseInt(_0x106744(0x117))/0xb*(-parseInt(_0x106744(0x10b))/0xc);if(_0x32599b===_0x4f3d5e)break;else _0xe47545['push'](_0xe47545['shift']());}catch(_0x41c8b3){_0xe47545['push'](_0xe47545['shift']());}}}(a239_0x9222,0x81a60));import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';function a239_0x9222(){const _0x5d70e8=['181228iqalvq','182WtAcdP','499869eklCMf','95hauSyp','Pass\x20--name\x20<nickname|username>.','role','920844JkNUrA','str','460466VjZlMD','matchedBy','username','read','1198443mgKzmR','167142iNBbej','104rewlpN','3450830unGdos','flagMissing','userId','66awYyNu','nickname','name','2UzyssZ','trim','user-resolve'];a239_0x9222=function(){return _0x5d70e8;};return a239_0x9222();}export const roleUserResolve={'service':a239_0x20ebf6(0x10a),'command':a239_0x20ebf6(0x104),'description':'Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','risk':a239_0x20ebf6(0x110),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0xc01f99){const _0x3f93f5=a239_0x20ebf6;if(!_0xc01f99['str'](_0x3f93f5(0x119))[_0x3f93f5(0x103)]())throw CliErrors[_0x3f93f5(0x115)]('name',_0x3f93f5(0x109));},async 'execute'(_0x3c3cc7){const _0x58bed0=a239_0x20ebf6,_0x16b338=_0x3c3cc7[_0x58bed0(0x10c)]('name')[_0x58bed0(0x103)](),_0x2fc15e=await resolveUserRef(_0x16b338,'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':_0x2fc15e[_0x58bed0(0x116)],'username':_0x2fc15e[_0x58bed0(0x10f)],'nickname':_0x2fc15e[_0x58bed0(0x118)],'matchedBy':_0x2fc15e[_0x58bed0(0x10e)]}},'message':'Resolved\x20\x22'+_0x16b338+'\x22\x20→\x20userId\x20'+_0x2fc15e[_0x58bed0(0x116)]};}};
@@ -1 +1 @@
1
- function a240_0x3880(_0x4c39ac,_0x5f4619){_0x4c39ac=_0x4c39ac-0x15d;const _0xa80e68=a240_0xa80e();let _0x38808a=_0xa80e68[_0x4c39ac];return _0x38808a;}const a240_0xe5bcb3=a240_0x3880;(function(_0x188944,_0x4b6684){const _0x5ec592=a240_0x3880,_0x54fc5c=_0x188944();while(!![]){try{const _0x2c6ed3=-parseInt(_0x5ec592(0x168))/0x1+-parseInt(_0x5ec592(0x164))/0x2+-parseInt(_0x5ec592(0x16b))/0x3+-parseInt(_0x5ec592(0x161))/0x4*(-parseInt(_0x5ec592(0x170))/0x5)+-parseInt(_0x5ec592(0x15e))/0x6+-parseInt(_0x5ec592(0x16f))/0x7*(parseInt(_0x5ec592(0x160))/0x8)+parseInt(_0x5ec592(0x15d))/0x9*(parseInt(_0x5ec592(0x167))/0xa);if(_0x2c6ed3===_0x4b6684)break;else _0x54fc5c['push'](_0x54fc5c['shift']());}catch(_0x1581f0){_0x54fc5c['push'](_0x54fc5c['shift']());}}}(a240_0xa80e,0x83db2));import{getAppRule}from'../../core/api-client.js';function a240_0xa80e(){const _0x594cec=['content','Loaded\x20','get','21UKtljP','15RzyNBl','appCode','16365519dPnLQG','3281520kVpBJr','Create\x20it\x20with\x20`rabetbase\x20rule\x20set\x20--type\x20','20392OzNPbE','353356kjdYaK','\x20for\x20','rule','326910tkrRNn','app_rule_not_found','cookie','10zGpSbo','464955snDJcY','\x20is\x20not\x20configured\x20for\x20app\x20','read','1081047pciaAP'];a240_0xa80e=function(){return _0x594cec;};return a240_0xa80e();}import{APP_RULE_TYPE_FLAG,appRuleError,appRuleFileName,projectAppRule,readAppRuleType}from'../../commands/rule/shared.js';export const ruleGet={'service':a240_0xe5bcb3(0x163),'command':a240_0xe5bcb3(0x16e),'description':'Get\x20one\x20agent\x20context\x20rule\x20for\x20the\x20resolved\x20app','risk':a240_0xe5bcb3(0x16a),'requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG],async 'validate'(_0x5ab2e2){readAppRuleType(_0x5ab2e2);},async 'execute'(_0x2f481b){const _0x240451=a240_0xe5bcb3,_0x5309ac=readAppRuleType(_0x2f481b),_0x446065=await getAppRule(_0x2f481b[_0x240451(0x166)],{'appCode':_0x2f481b[_0x240451(0x171)],'type':_0x5309ac});if(!_0x446065)throw appRuleError(_0x240451(0x165),appRuleFileName(_0x5309ac)+_0x240451(0x169)+_0x2f481b['appCode']+'.',_0x240451(0x15f)+_0x5309ac+'\x20--file\x20<path>\x20--dry-run`.');return{'ok':!![],'data':{'rule':{...projectAppRule(_0x5309ac,_0x446065),'content':_0x446065[_0x240451(0x16c)]}},'message':_0x240451(0x16d)+appRuleFileName(_0x5309ac)+_0x240451(0x162)+_0x2f481b[_0x240451(0x171)]};}};
1
+ const a240_0x521877=a240_0x459e;(function(_0x59e7ea,_0x5e9b85){const _0x529e0d=a240_0x459e,_0x1c63a3=_0x59e7ea();while(!![]){try{const _0x1c0cac=parseInt(_0x529e0d(0x12a))/0x1*(parseInt(_0x529e0d(0x137))/0x2)+parseInt(_0x529e0d(0x134))/0x3+-parseInt(_0x529e0d(0x12c))/0x4*(parseInt(_0x529e0d(0x12e))/0x5)+-parseInt(_0x529e0d(0x139))/0x6+parseInt(_0x529e0d(0x12b))/0x7*(parseInt(_0x529e0d(0x130))/0x8)+parseInt(_0x529e0d(0x12f))/0x9+-parseInt(_0x529e0d(0x131))/0xa;if(_0x1c0cac===_0x5e9b85)break;else _0x1c63a3['push'](_0x1c63a3['shift']());}catch(_0x493f72){_0x1c63a3['push'](_0x1c63a3['shift']());}}}(a240_0x30cd,0x80391));import{getAppRule}from'../../core/api-client.js';function a240_0x459e(_0x418d86,_0xd28315){_0x418d86=_0x418d86-0x129;const _0x30cdba=a240_0x30cd();let _0x459e94=_0x30cdba[_0x418d86];return _0x459e94;}import{APP_RULE_TYPE_FLAG,appRuleError,appRuleFileName,projectAppRule,readAppRuleType}from'../../commands/rule/shared.js';export const ruleGet={'service':a240_0x521877(0x138),'command':a240_0x521877(0x132),'description':'Get\x20one\x20agent\x20context\x20rule\x20for\x20the\x20resolved\x20app','risk':'read','requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG],async 'validate'(_0x5659ef){readAppRuleType(_0x5659ef);},async 'execute'(_0x3cf43a){const _0x56658b=a240_0x521877,_0x5efd80=readAppRuleType(_0x3cf43a),_0xbfd9d5=await getAppRule(_0x3cf43a[_0x56658b(0x135)],{'appCode':_0x3cf43a['appCode'],'type':_0x5efd80});if(!_0xbfd9d5)throw appRuleError('app_rule_not_found',appRuleFileName(_0x5efd80)+'\x20is\x20not\x20configured\x20for\x20app\x20'+_0x3cf43a['appCode']+'.','Create\x20it\x20with\x20`rabetbase\x20rule\x20set\x20--type\x20'+_0x5efd80+'\x20--file\x20<path>\x20--dry-run`.');return{'ok':!![],'data':{'rule':{...projectAppRule(_0x5efd80,_0xbfd9d5),'content':_0xbfd9d5[_0x56658b(0x133)]}},'message':_0x56658b(0x129)+appRuleFileName(_0x5efd80)+_0x56658b(0x12d)+_0x3cf43a[_0x56658b(0x136)]};}};function a240_0x30cd(){const _0x27d86a=['2889735fCWQyf','cookie','appCode','30Njskok','rule','1510776ijHPOq','Loaded\x20','59211clCqvB','2850414xCpLBU','4376eupvXg','\x20for\x20','3730HnHybn','5997537GKDBNW','16iJiQtF','17390860gqFGpW','get','content'];a240_0x30cd=function(){return _0x27d86a;};return a240_0x30cd();}
@@ -1 +1 @@
1
- const a241_0x3bafa4=a241_0x11ff;(function(_0x4dbc2e,_0x96ac3e){const _0x13f338=a241_0x11ff,_0x119680=_0x4dbc2e();while(!![]){try{const _0x213de6=-parseInt(_0x13f338(0x164))/0x1*(parseInt(_0x13f338(0x166))/0x2)+parseInt(_0x13f338(0x16a))/0x3+-parseInt(_0x13f338(0x16f))/0x4*(-parseInt(_0x13f338(0x16c))/0x5)+-parseInt(_0x13f338(0x16b))/0x6*(parseInt(_0x13f338(0x171))/0x7)+parseInt(_0x13f338(0x16e))/0x8+-parseInt(_0x13f338(0x169))/0x9*(parseInt(_0x13f338(0x16d))/0xa)+parseInt(_0x13f338(0x163))/0xb;if(_0x213de6===_0x96ac3e)break;else _0x119680['push'](_0x119680['shift']());}catch(_0x1754bf){_0x119680['push'](_0x119680['shift']());}}}(a241_0x4683,0x76c56));import{withKbManagementSession}from'../../core/kb-management-client.js';function a241_0x11ff(_0x3f2637,_0x26ce2e){_0x3f2637=_0x3f2637-0x163;const _0x4683c0=a241_0x4683();let _0x11ff3b=_0x4683c0[_0x3f2637];return _0x11ff3b;}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_0x3bafa4(0x165)](_0x5ae2ea=>({..._0x5ae2ea,'execute':_0x2b8898=>withKbManagementSession(_0x2b8898[a241_0x3bafa4(0x167)],()=>_0x5ae2ea[a241_0x3bafa4(0x168)](_0x2b8898)),..._0x5ae2ea[a241_0x3bafa4(0x170)]?{'dryRun':_0x11c915=>withKbManagementSession(_0x11c915[a241_0x3bafa4(0x167)],()=>_0x5ae2ea[a241_0x3bafa4(0x170)](_0x11c915))}:{}}));function a241_0x4683(){const _0x587184=['9npMxIB','231354ivKxlk','444MQyqUS','26905KaParF','1510570GaywKL','5335664IGHkMM','4GmEHzq','dryRun','11410yOGJPu','8807942CLfiZJ','6712TPelyB','map','236sivwKO','signal','execute'];a241_0x4683=function(){return _0x587184;};return a241_0x4683();}
1
+ const a241_0x1389d3=a241_0x1e19;(function(_0x456b71,_0x3b1db5){const _0x119ac5=a241_0x1e19,_0x4ed06d=_0x456b71();while(!![]){try{const _0x560742=parseInt(_0x119ac5(0x1f4))/0x1*(parseInt(_0x119ac5(0x1fe))/0x2)+-parseInt(_0x119ac5(0x1f3))/0x3+-parseInt(_0x119ac5(0x1fa))/0x4+-parseInt(_0x119ac5(0x1fc))/0x5*(parseInt(_0x119ac5(0x1f0))/0x6)+-parseInt(_0x119ac5(0x1f9))/0x7*(parseInt(_0x119ac5(0x1f5))/0x8)+parseInt(_0x119ac5(0x1f8))/0x9*(-parseInt(_0x119ac5(0x1fd))/0xa)+-parseInt(_0x119ac5(0x1f2))/0xb*(-parseInt(_0x119ac5(0x1ef))/0xc);if(_0x560742===_0x3b1db5)break;else _0x4ed06d['push'](_0x4ed06d['shift']());}catch(_0x27d5c3){_0x4ed06d['push'](_0x4ed06d['shift']());}}}(a241_0x37c8,0x5522c));import{withKbManagementSession}from'../../core/kb-management-client.js';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_0x1389d3(0x1f6)](_0x47fb92=>({..._0x47fb92,'execute':_0x2f01a8=>withKbManagementSession(_0x2f01a8[a241_0x1389d3(0x1f7)],()=>_0x47fb92[a241_0x1389d3(0x1fb)](_0x2f01a8)),..._0x47fb92[a241_0x1389d3(0x1f1)]?{'dryRun':_0x581add=>withKbManagementSession(_0x581add[a241_0x1389d3(0x1f7)],()=>_0x47fb92[a241_0x1389d3(0x1f1)](_0x581add))}:{}}));function a241_0x1e19(_0x50eb3a,_0x40cfa7){_0x50eb3a=_0x50eb3a-0x1ef;const _0x37c8f1=a241_0x37c8();let _0x1e19d2=_0x37c8f1[_0x50eb3a];return _0x1e19d2;}function a241_0x37c8(){const _0x535697=['39830puVvco','17770zGcQaX','45194BfRPFZ','264756fELwzh','222CFprjF','dryRun','814uFdjir','1238007mgJKPF','15BbwTQP','565392lRgvng','map','signal','1152QvNDby','7fmbqfq','2469440scXjFb','execute'];a241_0x37c8=function(){return _0x535697;};return a241_0x37c8();}
@@ -1 +1 @@
1
- const a242_0x2ba4ea=a242_0x18e6;function a242_0x24fa(){const _0x2d49cb=['2DEOsoU','125112CzirXP','2334876aOdOrf','2465460ZRrTkB','map','list','1580910LokZhs','rule','all','length','read','appCode','932251jBztaO','1913232LGlocr','182lOKzbK','Loaded\x20app\x20rule\x20configuration\x20for\x20','2224260iCZlmo'];a242_0x24fa=function(){return _0x2d49cb;};return a242_0x24fa();}(function(_0x42108c,_0x435cd7){const _0x46edb8=a242_0x18e6,_0x5eb383=_0x42108c();while(!![]){try{const _0x5ae0ae=-parseInt(_0x46edb8(0x181))/0x1*(-parseInt(_0x46edb8(0x186))/0x2)+-parseInt(_0x46edb8(0x188))/0x3+parseInt(_0x46edb8(0x189))/0x4+parseInt(_0x46edb8(0x18c))/0x5+parseInt(_0x46edb8(0x182))/0x6+parseInt(_0x46edb8(0x183))/0x7*(-parseInt(_0x46edb8(0x187))/0x8)+-parseInt(_0x46edb8(0x185))/0x9;if(_0x5ae0ae===_0x435cd7)break;else _0x5eb383['push'](_0x5eb383['shift']());}catch(_0x21d0fd){_0x5eb383['push'](_0x5eb383['shift']());}}}(a242_0x24fa,0xb7808));import{getAppRule}from'../../core/api-client.js';function a242_0x18e6(_0x2962fe,_0x14a0d9){_0x2962fe=_0x2962fe-0x181;const _0x24fa1d=a242_0x24fa();let _0x18e673=_0x24fa1d[_0x2962fe];return _0x18e673;}import{APP_RULE_TYPES,projectAppRule}from'../../commands/rule/shared.js';export const ruleList={'service':a242_0x2ba4ea(0x18d),'command':a242_0x2ba4ea(0x18b),'description':'List\x20agent\x20context\x20rules\x20for\x20the\x20resolved\x20app','risk':a242_0x2ba4ea(0x190),'requiresAppCode':!![],'structuredErrors':!![],'flags':[],async 'execute'(_0x348cca){const _0x1702d0=a242_0x2ba4ea,_0x478a15=await Promise[_0x1702d0(0x18e)](APP_RULE_TYPES['map'](_0x672516=>getAppRule(_0x348cca['cookie'],{'appCode':_0x348cca[_0x1702d0(0x191)],'type':_0x672516}))),_0x50736f=APP_RULE_TYPES[_0x1702d0(0x18a)]((_0x13a2d7,_0x390e0e)=>projectAppRule(_0x13a2d7,_0x478a15[_0x390e0e]??null));return{'ok':!![],'data':{'total':_0x50736f[_0x1702d0(0x18f)],'rules':_0x50736f},'message':_0x1702d0(0x184)+_0x348cca['appCode']};}};
1
+ function a242_0x7a28(_0x139efa,_0x2c5e66){_0x139efa=_0x139efa-0x1dd;const _0x8d914d=a242_0x8d91();let _0x7a285b=_0x8d914d[_0x139efa];return _0x7a285b;}const a242_0x35432d=a242_0x7a28;(function(_0xc6e7de,_0x5db3ee){const _0xb60b0f=a242_0x7a28,_0x2ec723=_0xc6e7de();while(!![]){try{const _0x46f6fc=parseInt(_0xb60b0f(0x1eb))/0x1+parseInt(_0xb60b0f(0x1ea))/0x2*(parseInt(_0xb60b0f(0x1e7))/0x3)+parseInt(_0xb60b0f(0x1e3))/0x4*(parseInt(_0xb60b0f(0x1ee))/0x5)+-parseInt(_0xb60b0f(0x1dd))/0x6*(-parseInt(_0xb60b0f(0x1e8))/0x7)+-parseInt(_0xb60b0f(0x1e5))/0x8+-parseInt(_0xb60b0f(0x1e2))/0x9+-parseInt(_0xb60b0f(0x1e0))/0xa;if(_0x46f6fc===_0x5db3ee)break;else _0x2ec723['push'](_0x2ec723['shift']());}catch(_0x458b87){_0x2ec723['push'](_0x2ec723['shift']());}}}(a242_0x8d91,0x2e44f));import{getAppRule}from'../../core/api-client.js';import{APP_RULE_TYPES,projectAppRule}from'../../commands/rule/shared.js';export const ruleList={'service':'rule','command':a242_0x35432d(0x1e1),'description':a242_0x35432d(0x1e6),'risk':a242_0x35432d(0x1df),'requiresAppCode':!![],'structuredErrors':!![],'flags':[],async 'execute'(_0x5e3ac2){const _0x302eb5=a242_0x35432d,_0x1145a7=await Promise[_0x302eb5(0x1ef)](APP_RULE_TYPES['map'](_0x1d948e=>getAppRule(_0x5e3ac2[_0x302eb5(0x1e9)],{'appCode':_0x5e3ac2[_0x302eb5(0x1ec)],'type':_0x1d948e}))),_0x1c8ef0=APP_RULE_TYPES[_0x302eb5(0x1de)]((_0x4ae0c6,_0x286b24)=>projectAppRule(_0x4ae0c6,_0x1145a7[_0x286b24]??null));return{'ok':!![],'data':{'total':_0x1c8ef0[_0x302eb5(0x1ed)],'rules':_0x1c8ef0},'message':_0x302eb5(0x1e4)+_0x5e3ac2[_0x302eb5(0x1ec)]};}};function a242_0x8d91(){const _0x20a6ce=['list','1049490zQtXxL','191292TyixFx','Loaded\x20app\x20rule\x20configuration\x20for\x20','254616LiaeZo','List\x20agent\x20context\x20rules\x20for\x20the\x20resolved\x20app','3NTXrrN','3836oGUxmh','cookie','523518bAhbDa','24526CjHlNi','appCode','length','25YMlmax','all','1146EScDtF','map','read','2921120fYyHyw'];a242_0x8d91=function(){return _0x20a6ce;};return a242_0x8d91();}
@@ -1 +1 @@
1
- const a243_0x106366=a243_0x4652;function a243_0x13bb(){const _0x33eaa4=['424450WlewAb','DATABASE','1531392ZDFklG','Set\x20','isSafeInteger','\x20does\x20not\x20prove\x20the\x20requested\x20set\x20state.','appCode','Pass\x20a\x20UTF-8\x20Markdown\x20file.','set','version','update','270HhcEXP','create','rules','expectedVersion','--file\x20is\x20required.','app_rule_version_mismatch','cookie','input','297493ZGKXmN','app_rule_expected_version_invalid','content','planned','\x20for\x20','rule','trim','144YJFNXl','unconfigured','RULES\x20content\x20exceeds\x202000\x20UTF-16\x20units.','164175biTZOG',';\x20current\x20version\x20is\x20','defineProperty','751293eWROHR','The\x20set\x20request\x20was\x20sent,\x20but\x20','before','file','2984448YHbeIa','app_rule_verification_unavailable','UTF-8\x20Markdown\x20file\x20(RULES:\x202000\x20UTF-16\x20units;\x20DATABASE:\x205242880\x20units)','str','number','\x20--format\x20compress','Expected\x20','app_rule_set_outcome_unknown','replacement','--expected-version\x20must\x20be\x20a\x20non-negative\x20safe\x20integer.','contentHash','cause','length','5dZJnpt','beforeRecord','POST','\x20could\x20not\x20be\x20verified.','write','rabetbase\x20rule\x20get\x20--type\x20','expected-version','push','type','verified','1437024AGERYO'];a243_0x13bb=function(){return _0x33eaa4;};return a243_0x13bb();}(function(_0x1f2a83,_0x4eae5b){const _0x3cd4c1=a243_0x4652,_0x260f7b=_0x1f2a83();while(!![]){try{const _0x2bc982=-parseInt(_0x3cd4c1(0xfd))/0x1+-parseInt(_0x3cd4c1(0xc3))/0x2+parseInt(_0x3cd4c1(0xde))/0x3+parseInt(_0x3cd4c1(0xe5))/0x4+parseInt(_0x3cd4c1(0xf2))/0x5*(-parseInt(_0x3cd4c1(0xfc))/0x6)+parseInt(_0x3cd4c1(0xd4))/0x7*(-parseInt(_0x3cd4c1(0xdb))/0x8)+-parseInt(_0x3cd4c1(0xe1))/0x9*(-parseInt(_0x3cd4c1(0xcc))/0xa);if(_0x2bc982===_0x4eae5b)break;else _0x260f7b['push'](_0x260f7b['shift']());}catch(_0x4ca133){_0x260f7b['push'](_0x260f7b['shift']());}}}(a243_0x13bb,0xd1fb4));import{knowledgeDocumentsPath}from'../../core/api-client.js';import{getAppRule,isPlatformTransportFailure,saveAppRule}from'../../core/api-client.js';import{asDryRunResult}from'../../commands/common/dry-run.js';function a243_0x4652(_0x43982c,_0x1f006a){_0x43982c=_0x43982c-0xc3;const _0x13bbbd=a243_0x13bb();let _0x4652cd=_0x13bbbd[_0x43982c];return _0x4652cd;}import{APP_RULE_TYPE_FLAG,appRuleContextScope,appRuleError,appRuleFileName,inspectAppRuleContent,projectAppRule,readAppRuleFile,readAppRuleType}from'../../commands/rule/shared.js';function readSetInput(_0xc1fe2a){const _0x4e7e8a=a243_0x4652,_0x280ce6=readAppRuleType(_0xc1fe2a),_0x2a7cc2=_0xc1fe2a[_0x4e7e8a(0xe8)](_0x4e7e8a(0xe4))[_0x4e7e8a(0xda)]();if(!_0x2a7cc2)throw appRuleError('app_rule_file_required',_0x4e7e8a(0xd0),_0x4e7e8a(0xc8));const _0x516761=_0xc1fe2a['flag'](_0x4e7e8a(0xf8));let _0x49566d;if(_0x516761!==undefined){_0x49566d=Number(_0x516761);if(!Number[_0x4e7e8a(0xc5)](_0x49566d)||_0x49566d<0x0)throw appRuleError(_0x4e7e8a(0xd5),_0x4e7e8a(0xee));}return{'type':_0x280ce6,'file':_0x2a7cc2,'expectedVersion':_0x49566d};}async function prepareSet(_0x3b03d0){const _0x20070c=a243_0x4652,_0x4caa9d=readSetInput(_0x3b03d0),_0x2cb035=await readAppRuleFile(_0x4caa9d['file']);if(_0x4caa9d[_0x20070c(0xfa)]==='rules'&&_0x2cb035['content'][_0x20070c(0xf1)]>0x7d0)throw appRuleError('app_rule_content_too_large',_0x20070c(0xdd));const _0x1ab456=await getAppRule(_0x3b03d0['cookie'],{'appCode':_0x3b03d0['appCode'],'type':_0x4caa9d[_0x20070c(0xfa)]});if(_0x4caa9d[_0x20070c(0xcf)]!==undefined&&(_0x1ab456?.[_0x20070c(0xca)]??0x0)!==_0x4caa9d['expectedVersion'])throw appRuleError(_0x20070c(0xd1),appRuleFileName(_0x4caa9d[_0x20070c(0xfa)])+'\x20version\x20changed\x20before\x20write.',_0x20070c(0xeb)+_0x4caa9d[_0x20070c(0xcf)]+_0x20070c(0xdf)+(_0x1ab456?.[_0x20070c(0xca)]??_0x20070c(0xdc))+'.\x20Run\x20rule\x20get\x20and\x20review\x20before\x20retrying.');return{'input':_0x4caa9d,'replacement':_0x2cb035,'beforeRecord':_0x1ab456,'before':projectAppRule(_0x4caa9d[_0x20070c(0xfa)],_0x1ab456),'planned':{'type':_0x4caa9d[_0x20070c(0xfa)],'fileName':appRuleFileName(_0x4caa9d['type']),'contextScope':appRuleContextScope(_0x4caa9d[_0x20070c(0xfa)]),'enabled':!![],'appCode':_0x3b03d0['appCode'],'scope':_0x20070c(0xce),'contentByteSize':_0x2cb035['byteSize'],'contentHash':_0x2cb035['contentHash']}};}function warningsFor(_0x250eda){return[];}export const ruleSet={'service':a243_0x106366(0xd9),'command':a243_0x106366(0xc9),'description':'Set\x20an\x20agent\x20context\x20rule\x20from\x20a\x20UTF-8\x20Markdown\x20file','risk':a243_0x106366(0xf6),'requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG,{'name':'file','type':'string','required':!![],'description':a243_0x106366(0xe7)},{'name':'expected-version','type':a243_0x106366(0xe9),'required':![],'description':'Require\x20the\x20current\x20version\x20before\x20atomic\x20compare-and-set'}],async 'validate'(_0x4a147d){readSetInput(_0x4a147d);},async 'dryRun'(_0x1357a1){const _0x1480f3=a243_0x106366,_0xa18528=await prepareSet(_0x1357a1);return asDryRunResult({'operation':_0x1480f3(0xc9),'selector':{'appCode':_0x1357a1[_0x1480f3(0xc7)],'scope':_0x1480f3(0xce),'type':_0xa18528[_0x1480f3(0xd3)][_0x1480f3(0xfa)]},'before':_0xa18528[_0x1480f3(0xe3)],'after':_0xa18528[_0x1480f3(0xd7)],'dryRun':!![],'backend':{'method':'POST','path':knowledgeDocumentsPath(_0x1480f3(0xce),_0xa18528['beforeRecord']?_0x1480f3(0xcb):_0x1480f3(0xcd)),'body':{'appCode':_0x1357a1[_0x1480f3(0xc7)],..._0xa18528[_0x1480f3(0xf3)]?{'id':_0xa18528['beforeRecord']['id']}:{},'title':_0xa18528[_0x1480f3(0xd3)]['type']===_0x1480f3(0xce)?'RULES':_0x1480f3(0xfe),'contentHash':_0xa18528[_0x1480f3(0xed)][_0x1480f3(0xef)],'contentByteSize':_0xa18528[_0x1480f3(0xed)]['byteSize'],..._0xa18528[_0x1480f3(0xf3)]?{'expectedVersion':_0xa18528['beforeRecord'][_0x1480f3(0xca)]}:{}}},'warnings':warningsFor(_0xa18528[_0x1480f3(0xd3)][_0x1480f3(0xcf)]),'verification':{'expectedVersion':_0xa18528[_0x1480f3(0xf3)]?.[_0x1480f3(0xca)]??0x0,'atomicCompareAndSet':!![],'lookupCommand':_0x1480f3(0xf7)+_0xa18528['input']['type']+_0x1480f3(0xea)}},{'method':_0x1480f3(0xf4),'url':knowledgeDocumentsPath('rules',_0xa18528[_0x1480f3(0xf3)]?_0x1480f3(0xcb):_0x1480f3(0xcd))});},async 'execute'(_0x344cbd){const _0x2bcbd6=a243_0x106366,_0x51381c=await prepareSet(_0x344cbd),_0x78d873=_0x51381c['beforeRecord']===null?0x1:_0x51381c['beforeRecord'][_0x2bcbd6(0xca)]+(_0x51381c[_0x2bcbd6(0xf3)]['content']===_0x51381c['replacement'][_0x2bcbd6(0xd6)]?0x0:0x1);let _0x1e543f,_0x127573=![];try{_0x1e543f=await saveAppRule(_0x344cbd['cookie'],{'appCode':_0x344cbd[_0x2bcbd6(0xc7)],'type':_0x51381c[_0x2bcbd6(0xd3)][_0x2bcbd6(0xfa)],'content':_0x51381c[_0x2bcbd6(0xed)][_0x2bcbd6(0xd6)],'expectedVersion':_0x51381c[_0x2bcbd6(0xf3)]?.[_0x2bcbd6(0xca)]??0x0,..._0x51381c[_0x2bcbd6(0xf3)]?{'id':_0x51381c[_0x2bcbd6(0xf3)]['id']}:{}});if(_0x1e543f[_0x2bcbd6(0xca)]!==_0x78d873||_0x1e543f['content']!==_0x51381c[_0x2bcbd6(0xed)][_0x2bcbd6(0xd6)]||_0x51381c[_0x2bcbd6(0xf3)]!==null&&_0x1e543f['id']!==_0x51381c[_0x2bcbd6(0xf3)]['id'])throw appRuleError('app_rule_verification_failed','The\x20received\x20rule\x20state\x20contradicts\x20the\x20requested\x20changes.','Use\x20read-only\x20rule\x20reconciliation;\x20do\x20not\x20resubmit\x20automatically.');}catch(_0x4055db){if(!isPlatformTransportFailure(_0x4055db))throw _0x4055db;_0x127573=!![];}let _0x5ab953;try{_0x5ab953=await getAppRule(_0x344cbd[_0x2bcbd6(0xd2)],{'appCode':_0x344cbd[_0x2bcbd6(0xc7)],'type':_0x51381c[_0x2bcbd6(0xd3)]['type']});}catch(_0x4420d4){const _0x314ec0=appRuleError(_0x127573?_0x2bcbd6(0xec):_0x2bcbd6(0xe6),_0x2bcbd6(0xe2)+appRuleFileName(_0x51381c[_0x2bcbd6(0xd3)][_0x2bcbd6(0xfa)])+_0x2bcbd6(0xf5),'Do\x20not\x20resubmit\x20automatically.\x20Inspect\x20the\x20exact\x20rule\x20state\x20before\x20retrying.');Object[_0x2bcbd6(0xe0)](_0x314ec0,_0x2bcbd6(0xf0),{'value':_0x4420d4,'enumerable':![]});throw _0x314ec0;}const _0x2938e7=_0x5ab953&&inspectAppRuleContent(_0x5ab953['content'])[_0x2bcbd6(0xef)]===_0x51381c[_0x2bcbd6(0xed)][_0x2bcbd6(0xef)],_0x52547e=_0x5ab953&&_0x5ab953['version']===_0x78d873&&(!_0x1e543f||_0x5ab953['id']===_0x1e543f['id']&&_0x5ab953[_0x2bcbd6(0xca)]===_0x1e543f[_0x2bcbd6(0xca)]);if(!_0x5ab953||!_0x2938e7||!_0x52547e||_0x51381c[_0x2bcbd6(0xf3)]!==null&&_0x5ab953['id']!==_0x51381c['beforeRecord']['id'])throw appRuleError(_0x127573?_0x2bcbd6(0xec):'app_rule_verification_failed',appRuleFileName(_0x51381c[_0x2bcbd6(0xd3)][_0x2bcbd6(0xfa)])+_0x2bcbd6(0xc6),'Inspect\x20it\x20with\x20`rabetbase\x20rule\x20get\x20--type\x20'+_0x51381c[_0x2bcbd6(0xd3)][_0x2bcbd6(0xfa)]+'\x20--format\x20compress`;\x20do\x20not\x20resubmit\x20automatically.');const _0x367b81=warningsFor(_0x51381c[_0x2bcbd6(0xd3)]['expectedVersion']);_0x127573&&_0x367b81[_0x2bcbd6(0xf9)]('Set\x20response\x20was\x20unavailable;\x20verified\x20the\x20exact\x20content\x20readback\x20without\x20resubmitting.');const _0x4b3f30=projectAppRule(_0x51381c[_0x2bcbd6(0xd3)][_0x2bcbd6(0xfa)],_0x5ab953);return{'ok':!![],'data':{'operation':_0x2bcbd6(0xc9),'selector':{'appCode':_0x344cbd[_0x2bcbd6(0xc7)],'scope':_0x2bcbd6(0xce),'type':_0x51381c[_0x2bcbd6(0xd3)][_0x2bcbd6(0xfa)]},'before':_0x51381c['before'],'after':_0x4b3f30,'dryRun':![],'backend':{'method':_0x2bcbd6(0xf4),'path':knowledgeDocumentsPath(_0x2bcbd6(0xce),_0x51381c['beforeRecord']?_0x2bcbd6(0xcb):_0x2bcbd6(0xcd))},'warnings':_0x367b81,'verification':{'status':_0x2bcbd6(0xfb),'recoveredAfterUnknownResponse':_0x127573,'expectedVersion':_0x51381c['beforeRecord']?.[_0x2bcbd6(0xca)]??0x0,'atomicCompareAndSet':!![],'lookupCommand':_0x2bcbd6(0xf7)+_0x51381c[_0x2bcbd6(0xd3)][_0x2bcbd6(0xfa)]+_0x2bcbd6(0xea)}},'message':_0x2bcbd6(0xc4)+appRuleFileName(_0x51381c[_0x2bcbd6(0xd3)]['type'])+_0x2bcbd6(0xd8)+_0x344cbd['appCode']};}};
1
+ const a243_0x4ac20f=a243_0x548b;(function(_0x1a555d,_0x5c5b08){const _0x5588dc=a243_0x548b,_0x2f1b53=_0x1a555d();while(!![]){try{const _0x5e4927=-parseInt(_0x5588dc(0xe4))/0x1+parseInt(_0x5588dc(0xf7))/0x2*(-parseInt(_0x5588dc(0xf6))/0x3)+-parseInt(_0x5588dc(0xf2))/0x4*(parseInt(_0x5588dc(0xe6))/0x5)+-parseInt(_0x5588dc(0xff))/0x6*(-parseInt(_0x5588dc(0xd1))/0x7)+-parseInt(_0x5588dc(0xc7))/0x8+-parseInt(_0x5588dc(0xfd))/0x9+parseInt(_0x5588dc(0xdf))/0xa;if(_0x5e4927===_0x5c5b08)break;else _0x2f1b53['push'](_0x2f1b53['shift']());}catch(_0x3ab033){_0x2f1b53['push'](_0x2f1b53['shift']());}}}(a243_0xddf7,0x9503a));import{knowledgeDocumentsPath}from'../../core/api-client.js';function a243_0xddf7(){const _0x54dcc6=['UTF-8\x20Markdown\x20file\x20(RULES:\x202000\x20UTF-16\x20units;\x20DATABASE:\x205242880\x20units)','The\x20received\x20rule\x20state\x20contradicts\x20the\x20requested\x20changes.','before','1375290QoKrDW','input','6378vJlRMi','\x20--format\x20compress','type','app_rule_verification_unavailable',';\x20current\x20version\x20is\x20','\x20--format\x20compress`;\x20do\x20not\x20resubmit\x20automatically.','\x20does\x20not\x20prove\x20the\x20requested\x20set\x20state.','Set\x20','app_rule_content_too_large','Pass\x20a\x20UTF-8\x20Markdown\x20file.','DATABASE','--file\x20is\x20required.','isSafeInteger','3751520gRjdNm','Set\x20an\x20agent\x20context\x20rule\x20from\x20a\x20UTF-8\x20Markdown\x20file','\x20version\x20changed\x20before\x20write.','POST','expected-version','beforeRecord','contentHash','Set\x20response\x20was\x20unavailable;\x20verified\x20the\x20exact\x20content\x20readback\x20without\x20resubmitting.','push','RULES\x20content\x20exceeds\x202000\x20UTF-16\x20units.','3332CRaskC','app_rule_expected_version_invalid','set','rules','app_rule_file_required','Inspect\x20it\x20with\x20`rabetbase\x20rule\x20get\x20--type\x20','length','\x20could\x20not\x20be\x20verified.','appCode','RULES','version','replacement','Do\x20not\x20resubmit\x20automatically.\x20Inspect\x20the\x20exact\x20rule\x20state\x20before\x20retrying.','verified','28999380FfDVxi','app_rule_verification_failed','planned','byteSize','update','690926teZAgF','The\x20set\x20request\x20was\x20sent,\x20but\x20','997820xaiVlK','Use\x20read-only\x20rule\x20reconciliation;\x20do\x20not\x20resubmit\x20automatically.','file','rule','expectedVersion','cookie','number','rabetbase\x20rule\x20get\x20--type\x20','Expected\x20','Require\x20the\x20current\x20version\x20before\x20atomic\x20compare-and-set','--expected-version\x20must\x20be\x20a\x20non-negative\x20safe\x20integer.','app_rule_set_outcome_unknown','12eFkZyf','unconfigured','defineProperty','content','1326294nBjqXd','4eyfvkx','\x20for\x20','create'];a243_0xddf7=function(){return _0x54dcc6;};return a243_0xddf7();}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(_0xcced8d){const _0x22d38c=a243_0x548b,_0x518158=readAppRuleType(_0xcced8d),_0x50ffe5=_0xcced8d['str'](_0x22d38c(0xe8))['trim']();if(!_0x50ffe5)throw appRuleError(_0x22d38c(0xd5),_0x22d38c(0xc5),_0x22d38c(0xc3));const _0x554dd7=_0xcced8d['flag']('expected-version');let _0x48691e;if(_0x554dd7!==undefined){_0x48691e=Number(_0x554dd7);if(!Number[_0x22d38c(0xc6)](_0x48691e)||_0x48691e<0x0)throw appRuleError(_0x22d38c(0xd2),_0x22d38c(0xf0));}return{'type':_0x518158,'file':_0x50ffe5,'expectedVersion':_0x48691e};}async function prepareSet(_0x5ac66f){const _0x41f5ae=a243_0x548b,_0x115c72=readSetInput(_0x5ac66f),_0xdb99dc=await readAppRuleFile(_0x115c72[_0x41f5ae(0xe8)]);if(_0x115c72[_0x41f5ae(0x101)]===_0x41f5ae(0xd4)&&_0xdb99dc[_0x41f5ae(0xf5)][_0x41f5ae(0xd7)]>0x7d0)throw appRuleError(_0x41f5ae(0xc2),_0x41f5ae(0xd0));const _0x491f23=await getAppRule(_0x5ac66f[_0x41f5ae(0xeb)],{'appCode':_0x5ac66f[_0x41f5ae(0xd9)],'type':_0x115c72[_0x41f5ae(0x101)]});if(_0x115c72[_0x41f5ae(0xea)]!==undefined&&(_0x491f23?.[_0x41f5ae(0xdb)]??0x0)!==_0x115c72[_0x41f5ae(0xea)])throw appRuleError('app_rule_version_mismatch',appRuleFileName(_0x115c72[_0x41f5ae(0x101)])+_0x41f5ae(0xc9),_0x41f5ae(0xee)+_0x115c72[_0x41f5ae(0xea)]+_0x41f5ae(0x103)+(_0x491f23?.['version']??_0x41f5ae(0xf3))+'.\x20Run\x20rule\x20get\x20and\x20review\x20before\x20retrying.');return{'input':_0x115c72,'replacement':_0xdb99dc,'beforeRecord':_0x491f23,'before':projectAppRule(_0x115c72[_0x41f5ae(0x101)],_0x491f23),'planned':{'type':_0x115c72[_0x41f5ae(0x101)],'fileName':appRuleFileName(_0x115c72[_0x41f5ae(0x101)]),'contextScope':appRuleContextScope(_0x115c72[_0x41f5ae(0x101)]),'enabled':!![],'appCode':_0x5ac66f[_0x41f5ae(0xd9)],'scope':_0x41f5ae(0xd4),'contentByteSize':_0xdb99dc['byteSize'],'contentHash':_0xdb99dc[_0x41f5ae(0xcd)]}};}function a243_0x548b(_0x2e5233,_0x42d8d8){_0x2e5233=_0x2e5233-0xc1;const _0xddf73d=a243_0xddf7();let _0x548bf6=_0xddf73d[_0x2e5233];return _0x548bf6;}function warningsFor(_0x469341){return[];}export const ruleSet={'service':a243_0x4ac20f(0xe9),'command':a243_0x4ac20f(0xd3),'description':a243_0x4ac20f(0xc8),'risk':'write','requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG,{'name':'file','type':'string','required':!![],'description':a243_0x4ac20f(0xfa)},{'name':a243_0x4ac20f(0xcb),'type':a243_0x4ac20f(0xec),'required':![],'description':a243_0x4ac20f(0xef)}],async 'validate'(_0x2a1233){readSetInput(_0x2a1233);},async 'dryRun'(_0x340b3e){const _0x2f011e=a243_0x4ac20f,_0xe11d6b=await prepareSet(_0x340b3e);return asDryRunResult({'operation':_0x2f011e(0xd3),'selector':{'appCode':_0x340b3e[_0x2f011e(0xd9)],'scope':_0x2f011e(0xd4),'type':_0xe11d6b['input'][_0x2f011e(0x101)]},'before':_0xe11d6b[_0x2f011e(0xfc)],'after':_0xe11d6b[_0x2f011e(0xe1)],'dryRun':!![],'backend':{'method':_0x2f011e(0xca),'path':knowledgeDocumentsPath('rules',_0xe11d6b[_0x2f011e(0xcc)]?_0x2f011e(0xe3):_0x2f011e(0xf9)),'body':{'appCode':_0x340b3e[_0x2f011e(0xd9)],..._0xe11d6b[_0x2f011e(0xcc)]?{'id':_0xe11d6b[_0x2f011e(0xcc)]['id']}:{},'title':_0xe11d6b[_0x2f011e(0xfe)][_0x2f011e(0x101)]===_0x2f011e(0xd4)?_0x2f011e(0xda):_0x2f011e(0xc4),'contentHash':_0xe11d6b[_0x2f011e(0xdc)][_0x2f011e(0xcd)],'contentByteSize':_0xe11d6b[_0x2f011e(0xdc)][_0x2f011e(0xe2)],..._0xe11d6b[_0x2f011e(0xcc)]?{'expectedVersion':_0xe11d6b[_0x2f011e(0xcc)][_0x2f011e(0xdb)]}:{}}},'warnings':warningsFor(_0xe11d6b['input'][_0x2f011e(0xea)]),'verification':{'expectedVersion':_0xe11d6b[_0x2f011e(0xcc)]?.[_0x2f011e(0xdb)]??0x0,'atomicCompareAndSet':!![],'lookupCommand':_0x2f011e(0xed)+_0xe11d6b[_0x2f011e(0xfe)]['type']+'\x20--format\x20compress'}},{'method':'POST','url':knowledgeDocumentsPath(_0x2f011e(0xd4),_0xe11d6b[_0x2f011e(0xcc)]?_0x2f011e(0xe3):_0x2f011e(0xf9))});},async 'execute'(_0x3481d0){const _0x4f4901=a243_0x4ac20f,_0x3cad77=await prepareSet(_0x3481d0),_0x25acbd=_0x3cad77['beforeRecord']===null?0x1:_0x3cad77[_0x4f4901(0xcc)][_0x4f4901(0xdb)]+(_0x3cad77[_0x4f4901(0xcc)][_0x4f4901(0xf5)]===_0x3cad77[_0x4f4901(0xdc)][_0x4f4901(0xf5)]?0x0:0x1);let _0x27caa9,_0x4d8524=![];try{_0x27caa9=await saveAppRule(_0x3481d0[_0x4f4901(0xeb)],{'appCode':_0x3481d0[_0x4f4901(0xd9)],'type':_0x3cad77[_0x4f4901(0xfe)]['type'],'content':_0x3cad77[_0x4f4901(0xdc)][_0x4f4901(0xf5)],'expectedVersion':_0x3cad77[_0x4f4901(0xcc)]?.[_0x4f4901(0xdb)]??0x0,..._0x3cad77[_0x4f4901(0xcc)]?{'id':_0x3cad77[_0x4f4901(0xcc)]['id']}:{}});if(_0x27caa9[_0x4f4901(0xdb)]!==_0x25acbd||_0x27caa9[_0x4f4901(0xf5)]!==_0x3cad77['replacement']['content']||_0x3cad77[_0x4f4901(0xcc)]!==null&&_0x27caa9['id']!==_0x3cad77[_0x4f4901(0xcc)]['id'])throw appRuleError(_0x4f4901(0xe0),_0x4f4901(0xfb),_0x4f4901(0xe7));}catch(_0x160df4){if(!isPlatformTransportFailure(_0x160df4))throw _0x160df4;_0x4d8524=!![];}let _0x30aa1b;try{_0x30aa1b=await getAppRule(_0x3481d0[_0x4f4901(0xeb)],{'appCode':_0x3481d0[_0x4f4901(0xd9)],'type':_0x3cad77['input'][_0x4f4901(0x101)]});}catch(_0x5a5d31){const _0x276ec2=appRuleError(_0x4d8524?_0x4f4901(0xf1):_0x4f4901(0x102),_0x4f4901(0xe5)+appRuleFileName(_0x3cad77['input']['type'])+_0x4f4901(0xd8),_0x4f4901(0xdd));Object[_0x4f4901(0xf4)](_0x276ec2,'cause',{'value':_0x5a5d31,'enumerable':![]});throw _0x276ec2;}const _0x23236d=_0x30aa1b&&inspectAppRuleContent(_0x30aa1b[_0x4f4901(0xf5)])[_0x4f4901(0xcd)]===_0x3cad77[_0x4f4901(0xdc)][_0x4f4901(0xcd)],_0x16066a=_0x30aa1b&&_0x30aa1b[_0x4f4901(0xdb)]===_0x25acbd&&(!_0x27caa9||_0x30aa1b['id']===_0x27caa9['id']&&_0x30aa1b[_0x4f4901(0xdb)]===_0x27caa9['version']);if(!_0x30aa1b||!_0x23236d||!_0x16066a||_0x3cad77['beforeRecord']!==null&&_0x30aa1b['id']!==_0x3cad77[_0x4f4901(0xcc)]['id'])throw appRuleError(_0x4d8524?_0x4f4901(0xf1):_0x4f4901(0xe0),appRuleFileName(_0x3cad77[_0x4f4901(0xfe)]['type'])+_0x4f4901(0x105),_0x4f4901(0xd6)+_0x3cad77[_0x4f4901(0xfe)][_0x4f4901(0x101)]+_0x4f4901(0x104));const _0x11656d=warningsFor(_0x3cad77[_0x4f4901(0xfe)][_0x4f4901(0xea)]);_0x4d8524&&_0x11656d[_0x4f4901(0xcf)](_0x4f4901(0xce));const _0xbb08a0=projectAppRule(_0x3cad77[_0x4f4901(0xfe)]['type'],_0x30aa1b);return{'ok':!![],'data':{'operation':'set','selector':{'appCode':_0x3481d0['appCode'],'scope':_0x4f4901(0xd4),'type':_0x3cad77[_0x4f4901(0xfe)][_0x4f4901(0x101)]},'before':_0x3cad77[_0x4f4901(0xfc)],'after':_0xbb08a0,'dryRun':![],'backend':{'method':_0x4f4901(0xca),'path':knowledgeDocumentsPath(_0x4f4901(0xd4),_0x3cad77[_0x4f4901(0xcc)]?'update':_0x4f4901(0xf9))},'warnings':_0x11656d,'verification':{'status':_0x4f4901(0xde),'recoveredAfterUnknownResponse':_0x4d8524,'expectedVersion':_0x3cad77['beforeRecord']?.['version']??0x0,'atomicCompareAndSet':!![],'lookupCommand':_0x4f4901(0xed)+_0x3cad77[_0x4f4901(0xfe)][_0x4f4901(0x101)]+_0x4f4901(0x100)}},'message':_0x4f4901(0xc1)+appRuleFileName(_0x3cad77[_0x4f4901(0xfe)][_0x4f4901(0x101)])+_0x4f4901(0xf8)+_0x3481d0[_0x4f4901(0xd9)]};}};
@@ -1 +1 @@
1
- function a244_0x5b84(_0x1c6a37,_0x2c8301){_0x1c6a37=_0x1c6a37-0x172;const _0x88026=a244_0x8802();let _0x5b84a8=_0x88026[_0x1c6a37];return _0x5b84a8;}const a244_0x1b57f6=a244_0x5b84;(function(_0x33c0ab,_0x2e0197){const _0x139313=a244_0x5b84,_0x2d4f66=_0x33c0ab();while(!![]){try{const _0x19ce0d=parseInt(_0x139313(0x173))/0x1*(parseInt(_0x139313(0x199))/0x2)+parseInt(_0x139313(0x1a4))/0x3+-parseInt(_0x139313(0x19d))/0x4*(-parseInt(_0x139313(0x1a2))/0x5)+-parseInt(_0x139313(0x196))/0x6+-parseInt(_0x139313(0x17e))/0x7+-parseInt(_0x139313(0x185))/0x8*(parseInt(_0x139313(0x17d))/0x9)+-parseInt(_0x139313(0x191))/0xa;if(_0x19ce0d===_0x2e0197)break;else _0x2d4f66['push'](_0x2d4f66['shift']());}catch(_0x4155ff){_0x2d4f66['push'](_0x2d4f66['shift']());}}}(a244_0x8802,0x1ae2a));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_0x1b57f6(0x19c),a244_0x1b57f6(0x176)];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_0x1b57f6(0x198),'database':a244_0x1b57f6(0x18d)},APP_RULE_CONTEXT_SCOPES={'rules':a244_0x1b57f6(0x195),'database':a244_0x1b57f6(0x17b)};export function appRuleError(_0x282cbb,_0x259735,_0x50e41a){return new CliError(_0x282cbb,0x1,_0x259735,_0x50e41a);}export function readAppRuleType(_0x53ced8){const _0x1a21ed=a244_0x1b57f6,_0x5dc8d7=_0x53ced8['str'](_0x1a21ed(0x1a0))[_0x1a21ed(0x193)]()[_0x1a21ed(0x19b)]();if(_0x5dc8d7!==_0x1a21ed(0x19c)&&_0x5dc8d7!==_0x1a21ed(0x176))throw appRuleError(_0x1a21ed(0x172),_0x1a21ed(0x1a7));return _0x5dc8d7;}export function appRuleFileName(_0x578ab6){return APP_RULE_FILES[_0x578ab6];}export function appRuleContextScope(_0x5a0730){return APP_RULE_CONTEXT_SCOPES[_0x5a0730];}function a244_0x8802(){const _0x4436c6=['database','App\x20rule\x20file\x20is\x20blank:\x20','scope','Context\x20rule\x20type:\x20rules\x20for\x20page/API\x20development\x20agents\x20(DB\x20Agent\x20excluded),\x20database\x20for\x20DB\x20Agent\x20database\x20analysis','size','database-analysis','Pass\x20a\x20UTF-8\x20Markdown\x20file.','514341oUeDwW','230027fNyWvN','App\x20rule\x20content\x20exceeds\x205242880\x20UTF-16\x20units.','digest','App\x20rule\x20content\x20exceeds\x20the\x20bounded\x20UTF-8\x20file\x20limit.','app_rule_file_required','length','createTime','8XHUcpF','indexStatus','Cannot\x20access\x20app\x20rule\x20file:\x20','updateTime','isFile','decode','utf-8','utf8','DATABASE.md','app_rule_file_invalid','appCode','byteSize','2363360tpAEhd','from','trim','sha256:','page-api-development','939240LmyqDS','--file\x20is\x20required.','RULES.md','129502LCMcAJ','App\x20rule\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','toLowerCase','rules','851416xRGVGW','string','app_rule_content_too_large','type','content','5fGKyIe','update','557703hZZEmy','App\x20rule\x20file\x20is\x20not\x20valid\x20UTF-8:\x20','app_rule_content_invalid','--type\x20must\x20be\x20either\x20rules\x20or\x20database.','app_rule_type_invalid','3QPzuTu','sha256','version'];a244_0x8802=function(){return _0x4436c6;};return a244_0x8802();}export function inspectAppRuleContent(_0x4e5e2b){const _0x437210=a244_0x1b57f6,_0xb3aa98=Buffer[_0x437210(0x192)](_0x4e5e2b,_0x437210(0x18c));return{'content':_0x4e5e2b,'byteSize':_0xb3aa98['byteLength'],'contentHash':_0x437210(0x194)+createHash(_0x437210(0x174))[_0x437210(0x1a3)](_0xb3aa98)[_0x437210(0x180)]('hex')};}export async function readAppRuleFile(_0x3746e5){const _0x5a8c48=a244_0x1b57f6,_0xf518c=_0x3746e5['trim']();if(!_0xf518c)throw appRuleError(_0x5a8c48(0x182),_0x5a8c48(0x197),_0x5a8c48(0x17c));const _0x5d1b96=resolve(_0xf518c);let _0x194e0e;try{_0x194e0e=await stat(_0x5d1b96);}catch(_0x281db0){throw appRuleError('app_rule_file_unreadable',_0x5a8c48(0x187)+_0xf518c,_0x281db0 instanceof Error?_0x281db0['message']:String(_0x281db0));}if(!_0x194e0e[_0x5a8c48(0x189)]())throw appRuleError(_0x5a8c48(0x18e),_0x5a8c48(0x19a)+_0xf518c);if(_0x194e0e[_0x5a8c48(0x17a)]>MAX_APP_RULE_BYTES)throw appRuleError(_0x5a8c48(0x19f),_0x5a8c48(0x181));let _0x2927a5;try{_0x2927a5=await readFile(_0x5d1b96);}catch(_0x2f5586){throw appRuleError('app_rule_file_unreadable','Cannot\x20read\x20app\x20rule\x20file:\x20'+_0xf518c,_0x2f5586 instanceof Error?_0x2f5586['message']:String(_0x2f5586));}if(_0x2927a5['byteLength']>MAX_APP_RULE_BYTES)throw appRuleError(_0x5a8c48(0x19f),_0x5a8c48(0x181));let _0x3105b7;try{_0x3105b7=new TextDecoder(_0x5a8c48(0x18b),{'fatal':!![],'ignoreBOM':!![]})[_0x5a8c48(0x18a)](_0x2927a5);}catch{throw appRuleError(_0x5a8c48(0x1a6),_0x5a8c48(0x1a5)+_0xf518c);}if(_0x3105b7[_0x5a8c48(0x183)]>MAX_APP_RULE_UNITS)throw appRuleError(_0x5a8c48(0x19f),_0x5a8c48(0x17f));if(!_0x3105b7[_0x5a8c48(0x193)]())throw appRuleError(_0x5a8c48(0x1a6),_0x5a8c48(0x177)+_0xf518c);return inspectAppRuleContent(_0x3105b7);}export function projectAppRule(_0x35f986,_0x1f8df4){const _0x3eaf45=a244_0x1b57f6;if(!_0x1f8df4)return{'type':_0x35f986,'fileName':appRuleFileName(_0x35f986),'contextScope':appRuleContextScope(_0x35f986),'enabled':![]};const _0xf5f65e=inspectAppRuleContent(_0x1f8df4[_0x3eaf45(0x1a1)]);return{'type':_0x35f986,'fileName':appRuleFileName(_0x35f986),'contextScope':appRuleContextScope(_0x35f986),'enabled':!![],'id':_0x1f8df4['id'],'scope':_0x1f8df4[_0x3eaf45(0x178)],'appCode':_0x1f8df4[_0x3eaf45(0x18f)],'version':_0x1f8df4[_0x3eaf45(0x175)],..._0x1f8df4[_0x3eaf45(0x186)]!==undefined?{'indexStatus':_0x1f8df4[_0x3eaf45(0x186)]}:{},'contentByteSize':_0xf5f65e[_0x3eaf45(0x190)],'contentHash':_0xf5f65e['contentHash'],..._0x1f8df4[_0x3eaf45(0x184)]!==undefined&&_0x1f8df4[_0x3eaf45(0x184)]!==null?{'createTime':_0x1f8df4[_0x3eaf45(0x184)]}:{},..._0x1f8df4[_0x3eaf45(0x188)]!==undefined&&_0x1f8df4[_0x3eaf45(0x188)]!==null?{'updateTime':_0x1f8df4[_0x3eaf45(0x188)]}:{}};}export const APP_RULE_TYPE_FLAG={'name':a244_0x1b57f6(0x1a0),'type':a244_0x1b57f6(0x19e),'required':!![],'description':a244_0x1b57f6(0x179),'enum':[...APP_RULE_TYPES]};
1
+ const a244_0x4e76fb=a244_0x2ad0;(function(_0x387cd1,_0xf52bfc){const _0x25dc97=a244_0x2ad0,_0x48959d=_0x387cd1();while(!![]){try{const _0x168a94=parseInt(_0x25dc97(0x13a))/0x1+-parseInt(_0x25dc97(0x12d))/0x2*(parseInt(_0x25dc97(0x121))/0x3)+parseInt(_0x25dc97(0x12b))/0x4+parseInt(_0x25dc97(0x143))/0x5*(-parseInt(_0x25dc97(0x13d))/0x6)+-parseInt(_0x25dc97(0x133))/0x7*(-parseInt(_0x25dc97(0x136))/0x8)+parseInt(_0x25dc97(0x115))/0x9+-parseInt(_0x25dc97(0x139))/0xa;if(_0x168a94===_0xf52bfc)break;else _0x48959d['push'](_0x48959d['shift']());}catch(_0x755ffa){_0x48959d['push'](_0x48959d['shift']());}}}(a244_0x2319,0x55480));import{createHash}from'node:crypto';function a244_0x2ad0(_0x2d05a9,_0x59417c){_0x2d05a9=_0x2d05a9-0x111;const _0x231952=a244_0x2319();let _0x2ad0cd=_0x231952[_0x2d05a9];return _0x2ad0cd;}import{readFile,stat}from'node:fs/promises';import{resolve}from'node:path';function a244_0x2319(){const _0x3ca139=['toLowerCase','app_rule_type_invalid','985712Mrnvgv','app_rule_content_too_large','139942HiDXym','page-api-development','byteLength','isFile','scope','Cannot\x20read\x20app\x20rule\x20file:\x20','4581815GvWqbi','type','message','8VOFeaJ','database-analysis','App\x20rule\x20file\x20is\x20blank:\x20','4269390tTtksJ','61942WPXInt','contentHash','utf8','348uHaShK','from','trim','database','rules','DATABASE.md','19770mSIIQM','version','RULES.md','string','indexStatus','app_rule_file_invalid','app_rule_file_unreadable','4792185WEmkZj','size','appCode','Pass\x20a\x20UTF-8\x20Markdown\x20file.','content','createTime','digest','App\x20rule\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','updateTime','app_rule_file_required','decode','App\x20rule\x20content\x20exceeds\x205242880\x20UTF-16\x20units.','21RDHgWu','app_rule_content_invalid','--file\x20is\x20required.','update','Context\x20rule\x20type:\x20rules\x20for\x20page/API\x20development\x20agents\x20(DB\x20Agent\x20excluded),\x20database\x20for\x20DB\x20Agent\x20database\x20analysis','sha256:','App\x20rule\x20content\x20exceeds\x20the\x20bounded\x20UTF-8\x20file\x20limit.','App\x20rule\x20file\x20is\x20not\x20valid\x20UTF-8:\x20'];a244_0x2319=function(){return _0x3ca139;};return a244_0x2319();}import{TextDecoder}from'node:util';import{CliError}from'../../errors.js';export const APP_RULE_TYPES=[a244_0x4e76fb(0x141),a244_0x4e76fb(0x140)];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_0x4e76fb(0x145),'database':a244_0x4e76fb(0x142)},APP_RULE_CONTEXT_SCOPES={'rules':a244_0x4e76fb(0x12e),'database':a244_0x4e76fb(0x137)};export function appRuleError(_0x1f39d1,_0x8ebf6c,_0x103c30){return new CliError(_0x1f39d1,0x1,_0x8ebf6c,_0x103c30);}export function readAppRuleType(_0x565144){const _0x44710a=a244_0x4e76fb,_0x1f2b97=_0x565144['str'](_0x44710a(0x134))['trim']()[_0x44710a(0x129)]();if(_0x1f2b97!==_0x44710a(0x141)&&_0x1f2b97!==_0x44710a(0x140))throw appRuleError(_0x44710a(0x12a),'--type\x20must\x20be\x20either\x20rules\x20or\x20database.');return _0x1f2b97;}export function appRuleFileName(_0x362585){return APP_RULE_FILES[_0x362585];}export function appRuleContextScope(_0x1a77c3){return APP_RULE_CONTEXT_SCOPES[_0x1a77c3];}export function inspectAppRuleContent(_0x271b03){const _0x9653b9=a244_0x4e76fb,_0x311d42=Buffer[_0x9653b9(0x13e)](_0x271b03,_0x9653b9(0x13c));return{'content':_0x271b03,'byteSize':_0x311d42[_0x9653b9(0x12f)],'contentHash':_0x9653b9(0x126)+createHash('sha256')[_0x9653b9(0x124)](_0x311d42)[_0x9653b9(0x11b)]('hex')};}export async function readAppRuleFile(_0x45c76c){const _0x510ea0=a244_0x4e76fb,_0x2f4b23=_0x45c76c[_0x510ea0(0x13f)]();if(!_0x2f4b23)throw appRuleError(_0x510ea0(0x11e),_0x510ea0(0x123),_0x510ea0(0x118));const _0x28e30a=resolve(_0x2f4b23);let _0x1acb23;try{_0x1acb23=await stat(_0x28e30a);}catch(_0x13c3e0){throw appRuleError(_0x510ea0(0x114),'Cannot\x20access\x20app\x20rule\x20file:\x20'+_0x2f4b23,_0x13c3e0 instanceof Error?_0x13c3e0[_0x510ea0(0x135)]:String(_0x13c3e0));}if(!_0x1acb23[_0x510ea0(0x130)]())throw appRuleError(_0x510ea0(0x113),_0x510ea0(0x11c)+_0x2f4b23);if(_0x1acb23[_0x510ea0(0x116)]>MAX_APP_RULE_BYTES)throw appRuleError('app_rule_content_too_large',_0x510ea0(0x127));let _0x23aaeb;try{_0x23aaeb=await readFile(_0x28e30a);}catch(_0x155188){throw appRuleError(_0x510ea0(0x114),_0x510ea0(0x132)+_0x2f4b23,_0x155188 instanceof Error?_0x155188[_0x510ea0(0x135)]:String(_0x155188));}if(_0x23aaeb[_0x510ea0(0x12f)]>MAX_APP_RULE_BYTES)throw appRuleError(_0x510ea0(0x12c),_0x510ea0(0x127));let _0x1168ea;try{_0x1168ea=new TextDecoder('utf-8',{'fatal':!![],'ignoreBOM':!![]})[_0x510ea0(0x11f)](_0x23aaeb);}catch{throw appRuleError('app_rule_content_invalid',_0x510ea0(0x128)+_0x2f4b23);}if(_0x1168ea['length']>MAX_APP_RULE_UNITS)throw appRuleError(_0x510ea0(0x12c),_0x510ea0(0x120));if(!_0x1168ea[_0x510ea0(0x13f)]())throw appRuleError(_0x510ea0(0x122),_0x510ea0(0x138)+_0x2f4b23);return inspectAppRuleContent(_0x1168ea);}export function projectAppRule(_0x172253,_0x1cc15a){const _0x3f5b2c=a244_0x4e76fb;if(!_0x1cc15a)return{'type':_0x172253,'fileName':appRuleFileName(_0x172253),'contextScope':appRuleContextScope(_0x172253),'enabled':![]};const _0x11df00=inspectAppRuleContent(_0x1cc15a[_0x3f5b2c(0x119)]);return{'type':_0x172253,'fileName':appRuleFileName(_0x172253),'contextScope':appRuleContextScope(_0x172253),'enabled':!![],'id':_0x1cc15a['id'],'scope':_0x1cc15a[_0x3f5b2c(0x131)],'appCode':_0x1cc15a[_0x3f5b2c(0x117)],'version':_0x1cc15a[_0x3f5b2c(0x144)],..._0x1cc15a[_0x3f5b2c(0x112)]!==undefined?{'indexStatus':_0x1cc15a[_0x3f5b2c(0x112)]}:{},'contentByteSize':_0x11df00['byteSize'],'contentHash':_0x11df00[_0x3f5b2c(0x13b)],..._0x1cc15a[_0x3f5b2c(0x11a)]!==undefined&&_0x1cc15a[_0x3f5b2c(0x11a)]!==null?{'createTime':_0x1cc15a[_0x3f5b2c(0x11a)]}:{},..._0x1cc15a[_0x3f5b2c(0x11d)]!==undefined&&_0x1cc15a[_0x3f5b2c(0x11d)]!==null?{'updateTime':_0x1cc15a['updateTime']}:{}};}export const APP_RULE_TYPE_FLAG={'name':a244_0x4e76fb(0x134),'type':a244_0x4e76fb(0x111),'required':!![],'description':a244_0x4e76fb(0x125),'enum':[...APP_RULE_TYPES]};
@@ -1 +1 @@
1
- const a245_0x5089f2=a245_0xc42e;(function(_0x5a7332,_0x3b698a){const _0x445f87=a245_0xc42e,_0x1ec976=_0x5a7332();while(!![]){try{const _0x5cf0cb=parseInt(_0x445f87(0xeb))/0x1+-parseInt(_0x445f87(0x101))/0x2*(parseInt(_0x445f87(0xef))/0x3)+parseInt(_0x445f87(0xe7))/0x4+-parseInt(_0x445f87(0xf3))/0x5+parseInt(_0x445f87(0xee))/0x6+parseInt(_0x445f87(0xf7))/0x7+-parseInt(_0x445f87(0xf5))/0x8;if(_0x5cf0cb===_0x3b698a)break;else _0x1ec976['push'](_0x1ec976['shift']());}catch(_0x4728a7){_0x1ec976['push'](_0x1ec976['shift']());}}}(a245_0x44d0,0x1d454));import{readFileSync,existsSync}from'node:fs';import{CLI_BIN_NAME}from'../../constant/cli.js';import{resolve,delimiter,join}from'node:path';import{spawn}from'node:child_process';import{CliErrors}from'../../errors.js';import{findProjectRootDirectory,resolveConfigPath}from'../../context/config-loader.js';import{writeProjectDomainRoutingManifest}from'../../config/project-domain-routing.js';import{checkSdkVersion,printSdkUpgradeWarning}from'../../utils/check-sdk-version.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../utils/cli-version-check.js';function a245_0xc42e(_0x71deab,_0x1a21fc){_0x71deab=_0x71deab-0xe5;const _0x44d008=a245_0x44d0();let _0xc42e0b=_0x44d008[_0x71deab];return _0xc42e0b;}function a245_0x44d0(){const _0x41e2a3=['cwd','has','749682DXJjov','5886VtzddD','needsUpgrade','\x20exited\x20with\x20code\x20','\x20run\x20preview\x20--watch','578445PYXUuN','yarn','841184posuOa','\x20run\x20<script>\x0a','177135vHFtDy','log','parse','\x0a\x20\x20Usage:\x20','inherit','Available:\x20','\x20run\x20build','slice','Enable\x20watch\x20mode\x20for\x20preview','(none)','134hrHugr','keys','Run\x20a\x20package.json\x20script','vite\x20preview\x20exited\x20with\x20code\x20','preview','\x20run\x20start','error','\x20\x20\x20\x20','\x22\x20not\x20found\x20in\x20package.json.','write','vite','run','push','start','\x20\x20EXAMPLES','Script\x20\x22','belowMinimum','bun.lock','close','build','utf-8','No\x20scripts\x20defined\x20in\x20package.json.','boolean','package.json','yarn.lock','Domain\x20routing\x20synchronized:\x20','bun.lockb','\x0a\x20\x20Available\x20scripts:\x0a','validation','args','pnpm-lock.yaml','path','459352wAbUdo','node_modules','watch','.bin','207093aMmKtL'];a245_0x44d0=function(){return _0x41e2a3;};return a245_0x44d0();}const VERSION_CHECK_SCRIPTS=new Set([a245_0x5089f2(0x10e),'dev']),DOMAIN_ROUTING_SYNC_SCRIPTS=new Set([a245_0x5089f2(0x10e),'dev',a245_0x5089f2(0x114),a245_0x5089f2(0x105)]);export function syncProjectDomainRoutingBeforeScript(_0x6cab4b,_0x2291ed){const _0x4ed5c2=a245_0x5089f2;if(!DOMAIN_ROUTING_SYNC_SCRIPTS[_0x4ed5c2(0xed)](_0x2291ed))return null;const _0x13b941=findProjectRootDirectory(_0x6cab4b);if(!resolveConfigPath(_0x13b941))return null;const _0x1fc121=writeProjectDomainRoutingManifest(_0x13b941);return{'path':_0x1fc121[_0x4ed5c2(0xe6)],'changed':_0x1fc121['changed']};}function readPackageScripts(_0x4aaa72){const _0x5c8bf0=a245_0x5089f2,_0x3c7380=resolve(_0x4aaa72,_0x5c8bf0(0x118));if(!existsSync(_0x3c7380))return null;try{const _0x5751e2=JSON[_0x5c8bf0(0xf9)](readFileSync(_0x3c7380,_0x5c8bf0(0x115)));return _0x5751e2['scripts']??{};}catch{return null;}}function detectPackageManager(_0x584219){const _0x3e817a=a245_0x5089f2;if(existsSync(resolve(_0x584219,_0x3e817a(0x11b)))||existsSync(resolve(_0x584219,_0x3e817a(0x112))))return'bun';if(existsSync(resolve(_0x584219,_0x3e817a(0xe5))))return'pnpm';if(existsSync(resolve(_0x584219,_0x3e817a(0x119))))return _0x3e817a(0xf4);return'npm';}async function versionCheck(_0x49dee8){const _0x572641=a245_0x5089f2,_0x46d0e1=await checkCliVersion();(_0x46d0e1[_0x572641(0xf0)]||_0x46d0e1[_0x572641(0x111)])&&(printCliUpgradeWarning(_0x46d0e1),assertCliVersionSupported(_0x46d0e1));const _0x1e4ebb=await checkSdkVersion(_0x49dee8);if(_0x1e4ebb[_0x572641(0xf0)])printSdkUpgradeWarning(_0x1e4ebb);}function spawnScript(_0x28a9e9,_0x324655,_0x27d74c,_0x1d380f){return new Promise((_0x1b65a5,_0x4b00dc)=>{const _0x2757a9=a245_0xc42e,_0x3b6c46=[_0x2757a9(0x10c),_0x324655,..._0x27d74c],_0x873589=spawn(_0x28a9e9,_0x3b6c46,{'cwd':_0x1d380f,'stdio':_0x2757a9(0xfb),'shell':!![],'env':{...process.env,'PATH':''+join(_0x1d380f,'node_modules',_0x2757a9(0xea))+delimiter+process.env.PATH}});_0x873589['on']('close',_0xfa6165=>{const _0x50b614=_0x2757a9;if(_0xfa6165===0x0||_0xfa6165===null)_0x1b65a5();else _0x4b00dc(new Error(_0x28a9e9+'\x20run\x20'+_0x324655+_0x50b614(0xf1)+_0xfa6165));}),_0x873589['on'](_0x2757a9(0x107),_0x4b00dc);});}function spawnViteBuildWatch(_0x4f3b68){return new Promise((_0x57298d,_0x4fa097)=>{const _0x891216=a245_0xc42e,_0x327767=spawn(_0x891216(0x10b),[_0x891216(0x114),'--watch'],{'cwd':_0x4f3b68,'stdio':_0x891216(0xfb),'shell':!![],'env':{...process.env,'PATH':''+join(_0x4f3b68,'node_modules',_0x891216(0xea))+delimiter+process.env.PATH}});_0x327767['on']('close',_0x579203=>{if(_0x579203===0x0||_0x579203===null)_0x57298d();else _0x4fa097(new Error('vite\x20build\x20--watch\x20exited\x20with\x20code\x20'+_0x579203));}),_0x327767['on'](_0x891216(0x107),_0x4fa097);});}function spawnVitePreview(_0x535ce9){return new Promise((_0x29d88e,_0x1863a2)=>{const _0x4b007b=a245_0xc42e,_0x39387a=spawn(_0x4b007b(0x10b),[_0x4b007b(0x105)],{'cwd':_0x535ce9,'stdio':_0x4b007b(0xfb),'shell':!![],'env':{...process.env,'PATH':''+join(_0x535ce9,_0x4b007b(0xe8),_0x4b007b(0xea))+delimiter+process.env.PATH}});_0x39387a['on'](_0x4b007b(0x113),_0x1b7b37=>{const _0x52c4e4=_0x4b007b;if(_0x1b7b37===0x0||_0x1b7b37===null)_0x29d88e();else _0x1863a2(new Error(_0x52c4e4(0x104)+_0x1b7b37));}),_0x39387a['on'](_0x4b007b(0x107),_0x1863a2);});}const runFlags=[{'name':'watch','type':a245_0x5089f2(0x117),'description':a245_0x5089f2(0xff),'default':![]}];export const runDefinition={'service':'run','command':a245_0x5089f2(0x10c),'description':a245_0x5089f2(0x103),'risk':a245_0x5089f2(0x10a),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'script','description':'Script\x20name\x20defined\x20in\x20package.json','required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x3bf6bf=a245_0x5089f2,_0x435584=[];return _0x435584[_0x3bf6bf(0x10d)](_0x3bf6bf(0x10f)),_0x435584[_0x3bf6bf(0x10d)](_0x3bf6bf(0x108)+CLI_BIN_NAME+_0x3bf6bf(0x106)),_0x435584['push']('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x3bf6bf(0xfd)),_0x435584[_0x3bf6bf(0x10d)]('\x20\x20\x20\x20'+CLI_BIN_NAME+'\x20run\x20preview'),_0x435584[_0x3bf6bf(0x10d)](_0x3bf6bf(0x108)+CLI_BIN_NAME+_0x3bf6bf(0xf2)),_0x435584['join']('\x0a');},async 'execute'(_0x2b7790){const _0x964cf3=a245_0x5089f2,_0x4dc946=process[_0x964cf3(0xec)](),_0x2eb9d3=_0x2b7790[_0x964cf3(0x11e)][0x0],_0xc276b2=_0x2b7790[_0x964cf3(0x11e)][_0x964cf3(0xfe)](0x1),_0xc19c0=readPackageScripts(_0x4dc946);if(!_0xc19c0)throw CliErrors[_0x964cf3(0x11d)]('No\x20package.json\x20found\x20in\x20current\x20directory.');if(!_0x2eb9d3){const _0x1d9f09=Object[_0x964cf3(0x102)](_0xc19c0);if(_0x1d9f09['length']===0x0)console[_0x964cf3(0xf8)](_0x964cf3(0x116));else{console[_0x964cf3(0xf8)](_0x964cf3(0x11c));for(const _0x26675 of _0x1d9f09){console[_0x964cf3(0xf8)](_0x964cf3(0x108)+_0x26675);}console['log'](_0x964cf3(0xfa)+CLI_BIN_NAME+_0x964cf3(0xf6));}return{'ok':!![]};}if(!_0xc19c0[_0x2eb9d3])throw CliErrors[_0x964cf3(0x11d)](_0x964cf3(0x110)+_0x2eb9d3+_0x964cf3(0x109),_0x964cf3(0xfc)+(Object['keys'](_0xc19c0)['join'](',\x20')||_0x964cf3(0x100)));const _0x23d82c=detectPackageManager(_0x4dc946),_0x5bf681=syncProjectDomainRoutingBeforeScript(_0x4dc946,_0x2eb9d3);_0x5bf681?.['changed']&&console[_0x964cf3(0x107)](_0x964cf3(0x11a)+_0x5bf681['path']);VERSION_CHECK_SCRIPTS[_0x964cf3(0xed)](_0x2eb9d3)&&await versionCheck(_0x4dc946);if(_0x2eb9d3==='preview'&&_0x2b7790['bool'](_0x964cf3(0xe9)))return await Promise['all']([spawnViteBuildWatch(_0x4dc946),spawnVitePreview(_0x4dc946)]),{'ok':!![]};return await spawnScript(_0x23d82c,_0x2eb9d3,_0xc276b2,_0x4dc946),{'ok':!![]};}};
1
+ const a245_0x27d346=a245_0x3e28;(function(_0x393c9b,_0x5576e4){const _0x28bbc4=a245_0x3e28,_0x45eac7=_0x393c9b();while(!![]){try{const _0x4d9a54=parseInt(_0x28bbc4(0xb4))/0x1+-parseInt(_0x28bbc4(0xa7))/0x2+parseInt(_0x28bbc4(0x9b))/0x3*(parseInt(_0x28bbc4(0xb0))/0x4)+parseInt(_0x28bbc4(0x8f))/0x5*(-parseInt(_0x28bbc4(0xaf))/0x6)+-parseInt(_0x28bbc4(0xc1))/0x7*(-parseInt(_0x28bbc4(0xae))/0x8)+-parseInt(_0x28bbc4(0x8c))/0x9+parseInt(_0x28bbc4(0xb7))/0xa;if(_0x4d9a54===_0x5576e4)break;else _0x45eac7['push'](_0x45eac7['shift']());}catch(_0x1d88d1){_0x45eac7['push'](_0x45eac7['shift']());}}}(a245_0x22e8,0xefa65));function a245_0x3e28(_0x5465f8,_0x2d1c1d){_0x5465f8=_0x5465f8-0x89;const _0x22e8d7=a245_0x22e8();let _0x3e286f=_0x22e8d7[_0x5465f8];return _0x3e286f;}import{readFileSync,existsSync}from'node:fs';import{CLI_BIN_NAME}from'../../constant/cli.js';import{resolve,delimiter,join}from'node:path';import{spawn}from'node:child_process';import{CliErrors}from'../../errors.js';import{findProjectRootDirectory,resolveConfigPath}from'../../context/config-loader.js';import{writeProjectDomainRoutingManifest}from'../../config/project-domain-routing.js';import{checkSdkVersion,printSdkUpgradeWarning}from'../../utils/check-sdk-version.js';function a245_0x22e8(){const _0x706edc=['run','yarn.lock','inherit','\x20\x20\x20\x20','Script\x20name\x20defined\x20in\x20package.json','\x22\x20not\x20found\x20in\x20package.json.','parse','watch','3145624ZVevHL','preview','validation','boolean','\x20\x20EXAMPLES','No\x20scripts\x20defined\x20in\x20package.json.','write','11935368cZMLCR','950574TJuswR','188tmrIxJ','vite','\x0a\x20\x20Available\x20scripts:\x0a','Domain\x20routing\x20synchronized:\x20','863576UAuYPc','start','log','9208810UseYdX','Run\x20a\x20package.json\x20script','close','length','push','bool','package.json','args','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','yarn','7tfqQJj','bun.lockb','Script\x20\x22','vite\x20preview\x20exited\x20with\x20code\x20','(none)','keys','\x20run\x20','\x20run\x20<script>\x0a','needsUpgrade','scripts','9334647NAzSie','changed','build','25QmDjGI','cwd','script','error','node_modules','bun','Available:\x20','pnpm','has','join','.bin','npm','70683kgPIGz','--watch','\x0a\x20\x20Usage:\x20','bun.lock'];a245_0x22e8=function(){return _0x706edc;};return a245_0x22e8();}import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../utils/cli-version-check.js';const VERSION_CHECK_SCRIPTS=new Set([a245_0x27d346(0xb5),'dev']),DOMAIN_ROUTING_SYNC_SCRIPTS=new Set([a245_0x27d346(0xb5),'dev','build',a245_0x27d346(0xa8)]);export function syncProjectDomainRoutingBeforeScript(_0xdd1772,_0x21e777){const _0x52232a=a245_0x27d346;if(!DOMAIN_ROUTING_SYNC_SCRIPTS[_0x52232a(0x97)](_0x21e777))return null;const _0x5e87ab=findProjectRootDirectory(_0xdd1772);if(!resolveConfigPath(_0x5e87ab))return null;const _0x11b25f=writeProjectDomainRoutingManifest(_0x5e87ab);return{'path':_0x11b25f['path'],'changed':_0x11b25f[_0x52232a(0x8d)]};}function readPackageScripts(_0xbc66fa){const _0x59c362=a245_0x27d346,_0x5a6b27=resolve(_0xbc66fa,_0x59c362(0xbd));if(!existsSync(_0x5a6b27))return null;try{const _0x3c6dfe=JSON[_0x59c362(0xa5)](readFileSync(_0x5a6b27,'utf-8'));return _0x3c6dfe[_0x59c362(0x8b)]??{};}catch{return null;}}function detectPackageManager(_0x5446eb){const _0x431211=a245_0x27d346;if(existsSync(resolve(_0x5446eb,_0x431211(0xc2)))||existsSync(resolve(_0x5446eb,_0x431211(0x9e))))return _0x431211(0x94);if(existsSync(resolve(_0x5446eb,'pnpm-lock.yaml')))return _0x431211(0x96);if(existsSync(resolve(_0x5446eb,_0x431211(0xa0))))return _0x431211(0xc0);return _0x431211(0x9a);}async function versionCheck(_0x159e86){const _0x5a6968=a245_0x27d346,_0xb36029=await checkCliVersion();(_0xb36029['needsUpgrade']||_0xb36029['belowMinimum'])&&(printCliUpgradeWarning(_0xb36029),assertCliVersionSupported(_0xb36029));const _0x5c13a6=await checkSdkVersion(_0x159e86);if(_0x5c13a6[_0x5a6968(0x8a)])printSdkUpgradeWarning(_0x5c13a6);}function spawnScript(_0x5ea2b9,_0x406544,_0x787df2,_0x4d87a8){return new Promise((_0x50134f,_0x25a60e)=>{const _0x3c24b3=a245_0x3e28,_0x58c564=[_0x3c24b3(0x9f),_0x406544,..._0x787df2],_0x2ff1ba=spawn(_0x5ea2b9,_0x58c564,{'cwd':_0x4d87a8,'stdio':_0x3c24b3(0xa1),'shell':!![],'env':{...process.env,'PATH':''+join(_0x4d87a8,_0x3c24b3(0x93),'.bin')+delimiter+process.env.PATH}});_0x2ff1ba['on'](_0x3c24b3(0xb9),_0x25d010=>{const _0x532375=_0x3c24b3;if(_0x25d010===0x0||_0x25d010===null)_0x50134f();else _0x25a60e(new Error(_0x5ea2b9+_0x532375(0xc7)+_0x406544+'\x20exited\x20with\x20code\x20'+_0x25d010));}),_0x2ff1ba['on'](_0x3c24b3(0x92),_0x25a60e);});}function spawnViteBuildWatch(_0x28639c){return new Promise((_0x222eb3,_0x196f1f)=>{const _0x3b3528=a245_0x3e28,_0x3017bf=spawn(_0x3b3528(0xb1),[_0x3b3528(0x8e),_0x3b3528(0x9c)],{'cwd':_0x28639c,'stdio':_0x3b3528(0xa1),'shell':!![],'env':{...process.env,'PATH':''+join(_0x28639c,'node_modules',_0x3b3528(0x99))+delimiter+process.env.PATH}});_0x3017bf['on']('close',_0x4a4ae0=>{const _0x23a676=_0x3b3528;if(_0x4a4ae0===0x0||_0x4a4ae0===null)_0x222eb3();else _0x196f1f(new Error(_0x23a676(0xbf)+_0x4a4ae0));}),_0x3017bf['on'](_0x3b3528(0x92),_0x196f1f);});}function spawnVitePreview(_0x32b6eb){return new Promise((_0x4e216b,_0x2fc40c)=>{const _0x9ae6c6=a245_0x3e28,_0x2f5f21=spawn(_0x9ae6c6(0xb1),[_0x9ae6c6(0xa8)],{'cwd':_0x32b6eb,'stdio':_0x9ae6c6(0xa1),'shell':!![],'env':{...process.env,'PATH':''+join(_0x32b6eb,_0x9ae6c6(0x93),_0x9ae6c6(0x99))+delimiter+process.env.PATH}});_0x2f5f21['on']('close',_0x3e283c=>{const _0x5de747=_0x9ae6c6;if(_0x3e283c===0x0||_0x3e283c===null)_0x4e216b();else _0x2fc40c(new Error(_0x5de747(0xc4)+_0x3e283c));}),_0x2f5f21['on'](_0x9ae6c6(0x92),_0x2fc40c);});}const runFlags=[{'name':a245_0x27d346(0xa6),'type':a245_0x27d346(0xaa),'description':'Enable\x20watch\x20mode\x20for\x20preview','default':![]}];export const runDefinition={'service':a245_0x27d346(0x9f),'command':a245_0x27d346(0x9f),'description':a245_0x27d346(0xb8),'risk':a245_0x27d346(0xad),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a245_0x27d346(0x91),'description':a245_0x27d346(0xa3),'required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x388de2=a245_0x27d346,_0x2f40b8=[];return _0x2f40b8[_0x388de2(0xbb)](_0x388de2(0xab)),_0x2f40b8[_0x388de2(0xbb)](_0x388de2(0xa2)+CLI_BIN_NAME+'\x20run\x20start'),_0x2f40b8['push'](_0x388de2(0xa2)+CLI_BIN_NAME+'\x20run\x20build'),_0x2f40b8[_0x388de2(0xbb)](_0x388de2(0xa2)+CLI_BIN_NAME+'\x20run\x20preview'),_0x2f40b8[_0x388de2(0xbb)](_0x388de2(0xa2)+CLI_BIN_NAME+'\x20run\x20preview\x20--watch'),_0x2f40b8[_0x388de2(0x98)]('\x0a');},async 'execute'(_0x5e6cbe){const _0x366400=a245_0x27d346,_0x2717a4=process[_0x366400(0x90)](),_0x30c2d2=_0x5e6cbe[_0x366400(0xbe)][0x0],_0x100891=_0x5e6cbe[_0x366400(0xbe)]['slice'](0x1),_0x1a686b=readPackageScripts(_0x2717a4);if(!_0x1a686b)throw CliErrors[_0x366400(0xa9)]('No\x20package.json\x20found\x20in\x20current\x20directory.');if(!_0x30c2d2){const _0x27b1a4=Object[_0x366400(0xc6)](_0x1a686b);if(_0x27b1a4[_0x366400(0xba)]===0x0)console['log'](_0x366400(0xac));else{console[_0x366400(0xb6)](_0x366400(0xb2));for(const _0xfc58c9 of _0x27b1a4){console[_0x366400(0xb6)](_0x366400(0xa2)+_0xfc58c9);}console[_0x366400(0xb6)](_0x366400(0x9d)+CLI_BIN_NAME+_0x366400(0x89));}return{'ok':!![]};}if(!_0x1a686b[_0x30c2d2])throw CliErrors['validation'](_0x366400(0xc3)+_0x30c2d2+_0x366400(0xa4),_0x366400(0x95)+(Object[_0x366400(0xc6)](_0x1a686b)['join'](',\x20')||_0x366400(0xc5)));const _0x50e557=detectPackageManager(_0x2717a4),_0x366d8a=syncProjectDomainRoutingBeforeScript(_0x2717a4,_0x30c2d2);_0x366d8a?.[_0x366400(0x8d)]&&console[_0x366400(0x92)](_0x366400(0xb3)+_0x366d8a['path']);VERSION_CHECK_SCRIPTS[_0x366400(0x97)](_0x30c2d2)&&await versionCheck(_0x2717a4);if(_0x30c2d2===_0x366400(0xa8)&&_0x5e6cbe[_0x366400(0xbc)](_0x366400(0xa6)))return await Promise['all']([spawnViteBuildWatch(_0x2717a4),spawnVitePreview(_0x2717a4)]),{'ok':!![]};return await spawnScript(_0x50e557,_0x30c2d2,_0x100891,_0x2717a4),{'ok':!![]};}};
@@ -1 +1 @@
1
- function a246_0x4be8(_0x4d8274,_0x586421){_0x4d8274=_0x4d8274-0x87;const _0x2a4534=a246_0x2a45();let _0x4be8bd=_0x2a4534[_0x4d8274];return _0x4be8bd;}const a246_0x4e41d8=a246_0x4be8;(function(_0x29cf30,_0x16ca14){const _0x2629e6=a246_0x4be8,_0x4f02b8=_0x29cf30();while(!![]){try{const _0xd66559=-parseInt(_0x2629e6(0x8a))/0x1+-parseInt(_0x2629e6(0x92))/0x2*(parseInt(_0x2629e6(0x90))/0x3)+parseInt(_0x2629e6(0x88))/0x4+parseInt(_0x2629e6(0x91))/0x5+-parseInt(_0x2629e6(0x87))/0x6+-parseInt(_0x2629e6(0x8d))/0x7*(parseInt(_0x2629e6(0x8b))/0x8)+parseInt(_0x2629e6(0x8c))/0x9;if(_0xd66559===_0x16ca14)break;else _0x4f02b8['push'](_0x4f02b8['shift']());}catch(_0x4603ee){_0x4f02b8['push'](_0x4f02b8['shift']());}}}(a246_0x2a45,0x811dd));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x1b71b8){const _0x44f44c=await buildSchemaPayload();return{'ok':!![],'data':_0x44f44c};}export const schemaDefinition={'service':a246_0x4e41d8(0x8f),'command':a246_0x4e41d8(0x89),'description':a246_0x4e41d8(0x8e),'risk':a246_0x4e41d8(0x93),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':'json','flags':[],'execute':execute};function a246_0x2a45(){const _0x5a8e81=['3994566blGxcC','3391160DuMUSe','export','442170pqGPDM','23224jQHDva','15747021HmoJKE','2373YEQrqY','Export\x20machine-readable\x20command\x20schema\x20(JSON)','schema','126624hAGwQZ','4127010WRBhRq','38VEAiRo','read'];a246_0x2a45=function(){return _0x5a8e81;};return a246_0x2a45();}
1
+ const a246_0x5cf384=a246_0x26d8;function a246_0x26d8(_0x4a0eca,_0x454b88){_0x4a0eca=_0x4a0eca-0x169;const _0x9e84bf=a246_0x9e84();let _0x26d8dd=_0x9e84bf[_0x4a0eca];return _0x26d8dd;}(function(_0x16aa6a,_0x1adee7){const _0x19a17e=a246_0x26d8,_0x30945c=_0x16aa6a();while(!![]){try{const _0x2eeded=parseInt(_0x19a17e(0x16b))/0x1+parseInt(_0x19a17e(0x16d))/0x2+parseInt(_0x19a17e(0x174))/0x3*(parseInt(_0x19a17e(0x16f))/0x4)+parseInt(_0x19a17e(0x16a))/0x5+-parseInt(_0x19a17e(0x176))/0x6+parseInt(_0x19a17e(0x170))/0x7*(parseInt(_0x19a17e(0x175))/0x8)+-parseInt(_0x19a17e(0x169))/0x9;if(_0x2eeded===_0x1adee7)break;else _0x30945c['push'](_0x30945c['shift']());}catch(_0x177880){_0x30945c['push'](_0x30945c['shift']());}}}(a246_0x9e84,0xa44af));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x5d14c0){const _0x392144=await buildSchemaPayload();return{'ok':!![],'data':_0x392144};}export const schemaDefinition={'service':a246_0x5cf384(0x16e),'command':a246_0x5cf384(0x172),'description':a246_0x5cf384(0x173),'risk':a246_0x5cf384(0x171),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a246_0x5cf384(0x16c),'flags':[],'execute':execute};function a246_0x9e84(){const _0x14f79d=['167784XratHT','5752932hJgpgU','16934517nIdABY','4501840KdGAtg','280638dAIvGh','json','2334310tidhfp','schema','358972yVJKDE','329XdwlWH','read','export','Export\x20machine-readable\x20command\x20schema\x20(JSON)','6MVFkwM'];a246_0x9e84=function(){return _0x14f79d;};return a246_0x9e84();}