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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (330) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/fetch-model-list.js +1 -1
  3. package/lib/api/generate-api-file.js +1 -1
  4. package/lib/auth/auth-server-ui.js +1 -1
  5. package/lib/auth/auth-server.js +1 -1
  6. package/lib/auth/constant.js +1 -1
  7. package/lib/auth/get-cookie.js +1 -1
  8. package/lib/auth/get-session-user.js +1 -1
  9. package/lib/auth/is-session-valid.js +1 -1
  10. package/lib/auth/login-success-html.js +1 -1
  11. package/lib/auth/logout.js +1 -1
  12. package/lib/cli-flags.js +1 -1
  13. package/lib/cli.js +1 -1
  14. package/lib/commands/api/generate.js +1 -1
  15. package/lib/commands/api/index.js +1 -1
  16. package/lib/commands/api/list.js +1 -1
  17. package/lib/commands/api/pull.js +1 -1
  18. package/lib/commands/api/shared.js +1 -1
  19. package/lib/commands/app/index.js +1 -1
  20. package/lib/commands/app/list.js +1 -1
  21. package/lib/commands/app/members-list.js +1 -1
  22. package/lib/commands/app/remote-directory.js +1 -1
  23. package/lib/commands/app/shared.js +1 -1
  24. package/lib/commands/app-config/delete.js +1 -1
  25. package/lib/commands/app-config/get.js +1 -1
  26. package/lib/commands/app-config/index.js +1 -1
  27. package/lib/commands/app-config/list.js +1 -1
  28. package/lib/commands/app-config/set.js +1 -1
  29. package/lib/commands/app-config/shared.js +1 -1
  30. package/lib/commands/auth/index.js +1 -1
  31. package/lib/commands/bff/create.js +1 -1
  32. package/lib/commands/bff/delete.js +1 -1
  33. package/lib/commands/bff/detail.js +1 -1
  34. package/lib/commands/bff/index.js +1 -1
  35. package/lib/commands/bff/list.js +1 -1
  36. package/lib/commands/bff/pull.js +1 -1
  37. package/lib/commands/bff/push.js +1 -1
  38. package/lib/commands/bff/status.js +1 -1
  39. package/lib/commands/cli-skill/index.js +1 -1
  40. package/lib/commands/cli-update.js +1 -1
  41. package/lib/commands/codegen/index.js +1 -1
  42. package/lib/commands/codegen/sdk.js +1 -1
  43. package/lib/commands/codegen/sql.js +1 -1
  44. package/lib/commands/common/app-registry.js +1 -1
  45. package/lib/commands/common/app-selector.js +1 -1
  46. package/lib/commands/common/async-task.js +1 -1
  47. package/lib/commands/common/dry-run.js +1 -1
  48. package/lib/commands/common/flags.d.ts +1 -0
  49. package/lib/commands/common/flags.js +1 -1
  50. package/lib/commands/common/local-file.js +1 -1
  51. package/lib/commands/common/validate.js +1 -1
  52. package/lib/commands/config/get.js +1 -1
  53. package/lib/commands/config/index.js +1 -1
  54. package/lib/commands/config/list.js +1 -1
  55. package/lib/commands/config/set.js +1 -1
  56. package/lib/commands/config/shared.js +1 -1
  57. package/lib/commands/data/filter.js +1 -1
  58. package/lib/commands/data/getOne.js +1 -1
  59. package/lib/commands/data/index.js +1 -1
  60. package/lib/commands/data/shared.js +1 -1
  61. package/lib/commands/dataset/business-group-update.js +1 -1
  62. package/lib/commands/{permit/index.d.ts → dataset/business-groups.d.ts} +1 -1
  63. package/lib/commands/dataset/business-groups.js +1 -0
  64. package/lib/commands/dataset/capability.js +1 -1
  65. package/lib/commands/dataset/delete.js +1 -1
  66. package/lib/commands/dataset/detail.js +1 -1
  67. package/lib/commands/dataset/extend-update.js +1 -1
  68. package/lib/commands/dataset/field-update.js +1 -1
  69. package/lib/commands/dataset/generate.js +1 -1
  70. package/lib/commands/dataset/index.js +1 -1
  71. package/lib/commands/dataset/list.js +1 -1
  72. package/lib/commands/dataset/operations.js +1 -1
  73. package/lib/commands/dataset/relation-audit.js +1 -1
  74. package/lib/commands/dataset/relation-create.js +1 -1
  75. package/lib/commands/dataset/relation-delete.js +1 -1
  76. package/lib/commands/dataset/relation-shared.js +1 -1
  77. package/lib/commands/dataset/relation-update.js +1 -1
  78. package/lib/commands/dataset/relations.js +1 -1
  79. package/lib/commands/dataset/rename.js +1 -1
  80. package/lib/commands/dataset/restore.js +1 -1
  81. package/lib/commands/db/analysis-batching.js +1 -1
  82. package/lib/commands/db/analyze-batch-plan.js +1 -1
  83. package/lib/commands/db/analyze-cancel.js +1 -1
  84. package/lib/commands/db/analyze-start.js +1 -1
  85. package/lib/commands/db/analyze-status.js +1 -1
  86. package/lib/commands/db/create.js +1 -1
  87. package/lib/commands/db/delete.js +1 -1
  88. package/lib/commands/db/detail.js +1 -1
  89. package/lib/commands/db/diff-refresh-start.js +1 -1
  90. package/lib/commands/db/diff-refresh-status.js +1 -1
  91. package/lib/commands/db/diff.js +1 -1
  92. package/lib/commands/db/index.js +1 -1
  93. package/lib/commands/db/list.js +1 -1
  94. package/lib/commands/db/shared.d.ts +15 -1
  95. package/lib/commands/db/shared.js +1 -1
  96. package/lib/commands/db/tables.js +1 -1
  97. package/lib/commands/db/test.js +1 -1
  98. package/lib/commands/db/update.js +1 -1
  99. package/lib/commands/doctor.js +1 -1
  100. package/lib/commands/file/index.js +1 -1
  101. package/lib/commands/init/index.js +1 -1
  102. package/lib/commands/issue/index.js +1 -1
  103. package/lib/commands/issue/nudge.js +1 -1
  104. package/lib/commands/issue/report.js +1 -1
  105. package/lib/commands/issue/shared.js +1 -1
  106. package/lib/commands/kb/create.js +1 -1
  107. package/lib/commands/kb/delete.js +1 -1
  108. package/lib/commands/kb/detail.js +1 -1
  109. package/lib/commands/kb/index.js +1 -1
  110. package/lib/commands/kb/list.js +1 -1
  111. package/lib/commands/kb/shared.js +1 -1
  112. package/lib/commands/kb/update.js +1 -1
  113. package/lib/commands/logs/index.js +1 -1
  114. package/lib/commands/menu/asset-update.js +1 -1
  115. package/lib/commands/menu/delete.js +1 -1
  116. package/lib/commands/menu/external-link-create.js +1 -1
  117. package/lib/commands/menu/external-link-update.js +1 -1
  118. package/lib/commands/menu/group-create.js +1 -1
  119. package/lib/commands/menu/group-update.js +1 -1
  120. package/lib/commands/menu/index.js +1 -1
  121. package/lib/commands/menu/list.js +1 -1
  122. package/lib/commands/menu/move.js +1 -1
  123. package/lib/commands/menu/regroup-start.js +1 -1
  124. package/lib/commands/menu/rename.js +1 -1
  125. package/lib/commands/menu/shared/compare-table.js +1 -1
  126. package/lib/commands/menu/shared/delete-plan.js +1 -1
  127. package/lib/commands/menu/shared/facts.js +1 -1
  128. package/lib/commands/menu/shared/index.js +1 -1
  129. package/lib/commands/menu/shared/inquirer.js +1 -1
  130. package/lib/commands/menu/shared/local-pages.js +1 -1
  131. package/lib/commands/menu/shared/logic.js +1 -1
  132. package/lib/commands/menu/shared/mutations.js +1 -1
  133. package/lib/commands/menu/shared/service.js +1 -1
  134. package/lib/commands/menu/shared/sync-core.js +1 -1
  135. package/lib/commands/menu/shared/update-core.js +1 -1
  136. package/lib/commands/menu/shared/valid-url.js +1 -1
  137. package/lib/commands/menu/sync.js +1 -1
  138. package/lib/commands/notification/config-create.js +1 -1
  139. package/lib/commands/notification/config-delete.js +1 -1
  140. package/lib/commands/notification/config-list.js +1 -1
  141. package/lib/commands/notification/config-update.js +1 -1
  142. package/lib/commands/notification/index.js +1 -1
  143. package/lib/commands/notification/shared.js +1 -1
  144. package/lib/commands/ocr/index.js +1 -1
  145. package/lib/commands/page/generate-start.js +1 -1
  146. package/lib/commands/page/generate-status.js +1 -1
  147. package/lib/commands/page/index.js +1 -1
  148. package/lib/commands/page/pull.js +1 -1
  149. package/lib/commands/page/push.js +1 -1
  150. package/lib/commands/page/react/create.js +1 -1
  151. package/lib/commands/page/react/detail.js +1 -1
  152. package/lib/commands/page/react/list.js +1 -1
  153. package/lib/commands/page/react/publish.js +1 -1
  154. package/lib/commands/page/react/shared.js +1 -1
  155. package/lib/commands/page/react/syntax.js +1 -1
  156. package/lib/commands/page/react/template.js +1 -1
  157. package/lib/commands/page/react/update.js +1 -1
  158. package/lib/commands/page/relation-audit.js +1 -1
  159. package/lib/commands/page/restore.js +1 -1
  160. package/lib/commands/page/shared.js +1 -1
  161. package/lib/commands/page/standard-page-status.js +1 -1
  162. package/lib/commands/page/sync.js +1 -1
  163. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  164. package/lib/commands/project/create/format-elapsed.js +1 -1
  165. package/lib/commands/project/create/main.js +1 -1
  166. package/lib/commands/project/create/materialize-project-template.js +1 -1
  167. package/lib/commands/project/create/project-name.js +1 -1
  168. package/lib/commands/project/create/project-template-archive.js +1 -1
  169. package/lib/commands/project/create/project-template-path.js +1 -1
  170. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  171. package/lib/commands/project/create/use-format-code.js +1 -1
  172. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  173. package/lib/commands/project/index.js +1 -1
  174. package/lib/commands/project/upgrade.js +1 -1
  175. package/lib/commands/registry.js +1 -1
  176. package/lib/commands/role/delete.js +1 -1
  177. package/lib/commands/role/detail.js +1 -1
  178. package/lib/commands/role/index.js +1 -1
  179. package/lib/commands/role/list.js +1 -1
  180. package/lib/commands/role/shared.d.ts +15 -17
  181. package/lib/commands/role/shared.js +1 -1
  182. package/lib/commands/role/update.js +1 -1
  183. package/lib/commands/role/user-add.js +1 -1
  184. package/lib/commands/role/user-remove.js +1 -1
  185. package/lib/commands/role/user-resolve.js +1 -1
  186. package/lib/commands/run/index.js +1 -1
  187. package/lib/commands/schema.js +1 -1
  188. package/lib/commands/sql/create.js +1 -1
  189. package/lib/commands/sql/delete.js +1 -1
  190. package/lib/commands/sql/detail.js +1 -1
  191. package/lib/commands/sql/exec.js +1 -1
  192. package/lib/commands/sql/index.js +1 -1
  193. package/lib/commands/sql/list.js +1 -1
  194. package/lib/commands/sql/pull.js +1 -1
  195. package/lib/commands/sql/push.js +1 -1
  196. package/lib/commands/sql/shared.js +1 -1
  197. package/lib/commands/sql/status.js +1 -1
  198. package/lib/commands/sql/validate.js +1 -1
  199. package/lib/commands/task/index.js +1 -1
  200. package/lib/commands/task/status.js +1 -1
  201. package/lib/commands/tenant/index.js +1 -1
  202. package/lib/commands/tenant/members-list.js +1 -1
  203. package/lib/commands/tenant/shared.js +1 -1
  204. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  205. package/lib/commands/user-account/index.js +1 -1
  206. package/lib/commands/workspace/add.js +1 -1
  207. package/lib/commands/workspace/index.js +1 -1
  208. package/lib/commands/workspace/remove.js +1 -1
  209. package/lib/config/schema.js +1 -1
  210. package/lib/constant/cdn.js +1 -1
  211. package/lib/constant/cli.js +1 -1
  212. package/lib/constant/defaults.js +1 -1
  213. package/lib/constant/domain.js +1 -1
  214. package/lib/constant/env.js +1 -1
  215. package/lib/constant/output.js +1 -1
  216. package/lib/constant/paths.js +1 -1
  217. package/lib/constant/risk.js +1 -1
  218. package/lib/context/app-resolver.js +1 -1
  219. package/lib/context/auth-resolver.js +1 -1
  220. package/lib/context/config-loader.js +1 -1
  221. package/lib/context.js +1 -1
  222. package/lib/core/alias-resolver.js +1 -1
  223. package/lib/core/api-client.d.ts +70 -79
  224. package/lib/core/api-client.js +1 -1
  225. package/lib/core/bff/config.js +1 -1
  226. package/lib/core/bff/file-system.d.ts +1 -0
  227. package/lib/core/bff/file-system.js +1 -1
  228. package/lib/core/bff/hash.js +1 -1
  229. package/lib/core/bff/lock.js +1 -1
  230. package/lib/core/bff/utils.js +1 -1
  231. package/lib/core/db-resolver.js +1 -1
  232. package/lib/core/page/file-system.js +1 -1
  233. package/lib/core/page/hash.js +1 -1
  234. package/lib/core/page/lock.js +1 -1
  235. package/lib/core/sql-index-auditor.js +1 -1
  236. package/lib/core/sql-sync/config.js +1 -1
  237. package/lib/core/sql-sync/file-system.js +1 -1
  238. package/lib/core/sql-sync/hash.js +1 -1
  239. package/lib/core/sql-sync/lock.js +1 -1
  240. package/lib/core/sql-sync/utils.js +1 -1
  241. package/lib/core/sql-validator.js +1 -1
  242. package/lib/errors.js +1 -1
  243. package/lib/framework/build-all-flags.js +1 -1
  244. package/lib/framework/error-output.js +1 -1
  245. package/lib/framework/explicit-yes.js +1 -1
  246. package/lib/framework/flags.js +1 -1
  247. package/lib/framework/help.js +1 -1
  248. package/lib/framework/index.js +1 -1
  249. package/lib/framework/output.js +1 -1
  250. package/lib/framework/response.js +1 -1
  251. package/lib/framework/runner-alias.js +1 -1
  252. package/lib/framework/runner.js +1 -1
  253. package/lib/framework/schema-export.js +1 -1
  254. package/lib/framework/types.js +1 -1
  255. package/lib/generated/build-info.d.ts +4 -4
  256. package/lib/generated/build-info.js +1 -1
  257. package/lib/help.js +1 -1
  258. package/lib/postinstall.js +1 -1
  259. package/lib/runtime/confirmation.js +1 -1
  260. package/lib/runtime/event.js +1 -1
  261. package/lib/runtime/index.js +1 -1
  262. package/lib/runtime/queue.js +1 -1
  263. package/lib/runtime/resolve.js +1 -1
  264. package/lib/skills/builtin-skill.js +1 -1
  265. package/lib/skills/main.js +1 -1
  266. package/lib/skills/npx-skills-add.js +1 -1
  267. package/lib/skills/skill-presence.js +1 -1
  268. package/lib/telemetry/cli-command-trace.js +1 -1
  269. package/lib/telemetry/cli-help-trace.js +1 -1
  270. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  271. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  272. package/lib/telemetry/send-cli-trace-log.js +1 -1
  273. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  274. package/lib/utils/ai_config.js +1 -1
  275. package/lib/utils/apply-jq-filter.js +1 -1
  276. package/lib/utils/cdn-config.js +1 -1
  277. package/lib/utils/check-sdk-version.js +1 -1
  278. package/lib/utils/cli-version-check.js +1 -1
  279. package/lib/utils/cli-version-policy.js +1 -1
  280. package/lib/utils/config.js +1 -1
  281. package/lib/utils/entity-with-id.js +1 -1
  282. package/lib/utils/file-utils.js +1 -1
  283. package/lib/utils/guides-cdn.js +1 -1
  284. package/lib/utils/http-client.js +1 -1
  285. package/lib/utils/is-non-interactive.js +1 -1
  286. package/lib/utils/logger.js +1 -1
  287. package/lib/utils/params.js +1 -1
  288. package/lib/utils/platform.js +1 -1
  289. package/lib/utils/rules-cdn.js +1 -1
  290. package/lib/utils/sleep.js +1 -1
  291. package/lib/utils/template-replacer.js +1 -1
  292. package/lib/utils/update-notice.js +1 -1
  293. package/lib/utils/version.js +1 -1
  294. package/lib/utils/with-active-cookie.js +1 -1
  295. package/lib/utils/write-cli-side-channel.js +1 -1
  296. package/package.json +1 -1
  297. package/skills/rabetbase/SKILL.md +18 -24
  298. package/skills/rabetbase/guides/database-connection-workflow.md +6 -2
  299. package/skills/rabetbase/references/rabetbase-dataset-business-groups.md +28 -0
  300. package/skills/rabetbase/references/rabetbase-dataset-delete.md +7 -5
  301. package/skills/rabetbase/references/rabetbase-dataset-list.md +6 -6
  302. package/skills/rabetbase/references/rabetbase-dataset-restore.md +5 -5
  303. package/skills/rabetbase/references/rabetbase-db-create.md +3 -0
  304. package/skills/rabetbase/references/rabetbase-db-delete.md +10 -2
  305. package/skills/rabetbase/references/rabetbase-db-detail.md +2 -0
  306. package/skills/rabetbase/references/rabetbase-db-list.md +3 -2
  307. package/skills/rabetbase/references/rabetbase-db-update.md +4 -2
  308. package/skills/rabetbase/references/rabetbase-role-list.md +9 -17
  309. package/skills/rabetbase/references/rabetbase-role-user-add.md +44 -16
  310. package/skills/rabetbase/references/rabetbase-role-user-resolve.md +2 -2
  311. package/skills/rabetbase.manifest.json +4 -7
  312. package/lib/commands/permit/index.js +0 -1
  313. package/lib/commands/permit/page-get.d.ts +0 -2
  314. package/lib/commands/permit/page-get.js +0 -1
  315. package/lib/commands/permit/page-set.d.ts +0 -2
  316. package/lib/commands/permit/page-set.js +0 -1
  317. package/lib/commands/permit/role-apis-set.d.ts +0 -2
  318. package/lib/commands/permit/role-apis-set.js +0 -1
  319. package/lib/commands/permit/role-menus-set.d.ts +0 -2
  320. package/lib/commands/permit/role-menus-set.js +0 -1
  321. package/lib/commands/permit/role-menus.d.ts +0 -2
  322. package/lib/commands/permit/role-menus.js +0 -1
  323. package/lib/commands/permit/shared.d.ts +0 -74
  324. package/lib/commands/permit/shared.js +0 -1
  325. package/lib/commands/role/create.d.ts +0 -2
  326. package/lib/commands/role/create.js +0 -1
  327. package/skills/rabetbase/guides/role-permit-workflow.md +0 -127
  328. package/skills/rabetbase/references/rabetbase-permit-page-set.md +0 -69
  329. package/skills/rabetbase/references/rabetbase-permit-role-apis-set.md +0 -53
  330. package/skills/rabetbase/references/rabetbase-permit-role-menus-set.md +0 -57
@@ -2,10 +2,10 @@
2
2
  * role service 共享逻辑(SSOT)
3
3
  *
4
4
  * 集中:内置角色守卫、角色引用解析(id 单查 / name 全分页)、
5
- * 查人(tenant 成员目录)、user-list 全量 merge、投影与写命令输出信封。
5
+ * 查人(tenant 成员目录)、研发态关系分页读取、原子成员变更、投影与写命令输出信封。
6
6
  * 命令文件只引用这里,不重复合并/守卫规则(见 AGENTS.md 声明式方法论 SSOT)。
7
7
  */
8
- import { type AppRole, type RoleUsers } from "../../core/api-client.js";
8
+ import { type AppRole, type DevUserRoleRelation } from "../../core/api-client.js";
9
9
  import type { FlagDef, RuntimeContext } from "../../framework/types.js";
10
10
  export declare const ROLE_ID_FLAG: FlagDef;
11
11
  export declare const ROLE_REF_FLAG: FlagDef;
@@ -19,8 +19,6 @@ export declare const BUILTIN_ROLE_TYPES: AppRole["roleType"][];
19
19
  export declare function isBuiltinRole(roleType: string): boolean;
20
20
  /** update / delete:仅允许 CUSTOM 角色 */
21
21
  export declare function assertCustomRole(role: AppRole, action: string): void;
22
- /** role-menus-set / role-apis-set:拒绝改 DEV / ADMIN 的权限矩阵 */
23
- export declare function assertPermConfigurable(role: AppRole): void;
24
22
  export interface RoleProjection {
25
23
  id: number;
26
24
  roleName: string;
@@ -53,6 +51,7 @@ export interface UserResolution {
53
51
  */
54
52
  export declare function resolveUserRef(ref: string): Promise<UserResolution>;
55
53
  export interface RoleUserMutationData {
54
+ scope: "dev";
56
55
  operation: "user-add" | "user-remove";
57
56
  selector: {
58
57
  appCode: string;
@@ -73,17 +72,13 @@ export interface RoleUserMutationData {
73
72
  };
74
73
  warnings: string[];
75
74
  }
76
- export declare const UPDATE_USER_LIST_PATH = "/smartapi/permit/user-role/update-user-list";
77
- /**
78
- * 计算 user-add / user-remove 的全量回写结果与 before/after。
79
- * 只改目标 role 的 userList,其余 role 原样带回。
80
- * 返回 { roleList, mutation, changed };changed=false 表示无需写(幂等)。
81
- */
75
+ export declare const CREATE_USER_ROLE_PATH = "/smartapi/permit/user-role/create";
76
+ export declare const DELETE_USER_ROLE_PATH = "/smartapi/permit/user-role/delete";
82
77
  export declare function computeRoleUserMutation(params: {
83
78
  operation: "user-add" | "user-remove";
84
79
  appCode: string;
85
- roleUsers: RoleUsers[];
86
- targetRoleId: number;
80
+ role: AppRole;
81
+ relations: DevUserRoleRelation[];
87
82
  user: {
88
83
  userId: number;
89
84
  username: string;
@@ -92,16 +87,19 @@ export declare function computeRoleUserMutation(params: {
92
87
  dryRun: boolean;
93
88
  expectUserCount?: number;
94
89
  }): {
95
- roleList: RoleUsers[];
96
90
  mutation: RoleUserMutationData;
97
91
  changed: boolean;
92
+ matchingRelationIds: number[];
98
93
  };
99
- /** 读取目标 role 的全量成员列表(供 add/remove 前置) */
100
- export declare function loadRoleUsers(appCode: string): Promise<RoleUsers[]>;
94
+ /** 分页读取目标研发态角色的关系记录,避免整表覆盖。 */
95
+ export declare function loadDevRoleRelations(appCode: string, roleId: number): Promise<DevUserRoleRelation[]>;
101
96
  /** 供命令 ctx 读取角色引用 flag 的小工具 */
102
97
  export declare function readRoleRef(ctx: RuntimeContext): string;
103
98
  /**
104
99
  * user-add / user-remove 的完整前置编排(供两个命令的 dryRun / execute 共用):
105
- * 解析角色引用 → 解析用户 → 读全量成员 → 计算全量回写与 before/after。
100
+ * 解析角色引用 → 解析用户 → 读取目标角色关系 → 计算原子写入与 before/after。
106
101
  */
107
- export declare function prepareUserMutation(ctx: RuntimeContext, operation: "user-add" | "user-remove", dryRun: boolean): Promise<ReturnType<typeof computeRoleUserMutation>>;
102
+ export declare function prepareUserMutation(ctx: RuntimeContext, operation: "user-add" | "user-remove", dryRun: boolean): Promise<ReturnType<typeof computeRoleUserMutation> & {
103
+ role: AppRole;
104
+ user: UserResolution;
105
+ }>;
@@ -1 +1 @@
1
- const a184_0x3f8d3a=a184_0x2794;(function(_0x1d3080,_0x1b5fd1){const _0x5aa456=a184_0x2794,_0x14149f=_0x1d3080();while(!![]){try{const _0x18ab67=-parseInt(_0x5aa456(0x18d))/0x1*(parseInt(_0x5aa456(0x199))/0x2)+parseInt(_0x5aa456(0x18c))/0x3*(-parseInt(_0x5aa456(0x186))/0x4)+-parseInt(_0x5aa456(0x17e))/0x5+-parseInt(_0x5aa456(0x19f))/0x6+-parseInt(_0x5aa456(0x157))/0x7*(parseInt(_0x5aa456(0x1a4))/0x8)+parseInt(_0x5aa456(0x182))/0x9+parseInt(_0x5aa456(0x16d))/0xa;if(_0x18ab67===_0x1b5fd1)break;else _0x14149f['push'](_0x14149f['shift']());}catch(_0x177122){_0x14149f['push'](_0x14149f['shift']());}}}(a184_0x39a3,0x2cfa4));import{getAppRole,getTenantMembers,listAppRoles,listRoleUsers}from'../../core/api-client.js';function a184_0x39a3(){const _0x32eecc=['validation','\x20not\x20found\x20in\x20the\x20user-role\x20list.','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','Pass\x20--user\x20<id|name>.','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','8603tfvSSw','Missing\x20role\x20reference.','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','test','Role\x20name\x20\x22','permitCount','\x20not\x20found\x20in\x20app\x20','Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.','map',';\x20no\x20change.','Disambiguate\x20with\x20--role\x20<id>.','join','POST','Cannot\x20','string','Role\x20id\x20(from\x20`role\x20list`)','push','DEV\x20/\x20ADMIN\x20keep\x20full\x20access\x20by\x20design;\x20configure\x20a\x20CUSTOM\x20role\x20instead.','\x20is\x20already\x20a\x20member\x20of\x20role\x20','Missing\x20user\x20reference.','remark','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','10288170iLOrPW','role','splice','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','expectUserCount','str','Role\x20name','name','Optional\x20role\x20remark/description','flagMissing','dryRun','Multiple\x20tenant\x20members\x20match\x20\x22','roleType','Anti-drift\x20check\x20failed:\x20expected\x20','userList','ADMIN','username','1360525pWVfqc','user','User\x20','appCode','1345059LGUASr','expect-user-count','Disambiguate\x20with\x20--user\x20<id>.','length','12476uEnPzK','find','Role\x20id\x20or\x20role\x20name\x20(CUSTOM\x20roles\x20may\x20be\x20referenced\x20by\x20name)','CUSTOM','totalCount','DEV','57bYIQcB','4142LzvWrm','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','tenant','Pass\x20--role\x20<id|name>.','USER','/smartapi/permit/user-role/update-user-list','filter','trim','No\x20tenant\x20member\x20matches\x20\x22','\x22:\x20','Cannot\x20change\x20the\x20permission\x20matrix\x20of\x20built-in\x20role\x20','number','6iVKaAv','\x22\x20not\x20found\x20in\x20app\x20','Role\x20id\x20','nickname','userId','toLowerCase','1903134jFoMdA','includes','authRequired','roleName','\x20is\x20not\x20a\x20member\x20of\x20role\x20','2168qdYEtg'];a184_0x39a3=function(){return _0x32eecc;};return a184_0x39a3();}import{getSessionUserInfo}from'../../auth/get-session-user.js';import{CliErrors}from'../../errors.js';export const ROLE_ID_FLAG={'name':'id','type':a184_0x3f8d3a(0x198),'required':!![],'description':a184_0x3f8d3a(0x166)};export const ROLE_REF_FLAG={'name':a184_0x3f8d3a(0x16e),'type':a184_0x3f8d3a(0x165),'required':!![],'description':a184_0x3f8d3a(0x188)};export const USER_REF_FLAG={'name':a184_0x3f8d3a(0x17f),'type':a184_0x3f8d3a(0x165),'required':!![],'description':a184_0x3f8d3a(0x170)};function a184_0x2794(_0x410ae8,_0x336959){_0x410ae8=_0x410ae8-0x152;const _0x39a3fa=a184_0x39a3();let _0x27946b=_0x39a3fa[_0x410ae8];return _0x27946b;}export const NAME_FLAG={'name':'name','type':a184_0x3f8d3a(0x165),'required':!![],'description':a184_0x3f8d3a(0x173)};export const USER_NAME_FLAG={'name':a184_0x3f8d3a(0x174),'type':a184_0x3f8d3a(0x165),'required':!![],'description':a184_0x3f8d3a(0x159)};export const REMARK_FLAG={'name':a184_0x3f8d3a(0x16b),'type':a184_0x3f8d3a(0x165),'required':![],'description':a184_0x3f8d3a(0x175)};export const EXPECT_USER_COUNT_FLAG={'name':a184_0x3f8d3a(0x183),'type':'number','required':![],'description':a184_0x3f8d3a(0x154)};export const BUILTIN_ROLE_TYPES=[a184_0x3f8d3a(0x17c),a184_0x3f8d3a(0x18b),a184_0x3f8d3a(0x191)];export function isBuiltinRole(_0x90e268){const _0x4c1615=a184_0x3f8d3a;return BUILTIN_ROLE_TYPES[_0x4c1615(0x1a0)](_0x90e268);}export function assertCustomRole(_0x3984ea,_0x2e32af){const _0x3e4d9b=a184_0x3f8d3a;if(_0x3984ea[_0x3e4d9b(0x179)]!==_0x3e4d9b(0x189))throw CliErrors[_0x3e4d9b(0x152)](_0x3e4d9b(0x164)+_0x2e32af+'\x20built-in\x20role\x20'+_0x3984ea[_0x3e4d9b(0x1a2)]+'\x20('+_0x3984ea[_0x3e4d9b(0x179)]+').','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.');}export function assertPermConfigurable(_0x12079f){const _0xc0a586=a184_0x3f8d3a;if(_0x12079f[_0xc0a586(0x179)]==='DEV'||_0x12079f[_0xc0a586(0x179)]===_0xc0a586(0x17c))throw CliErrors['validation'](_0xc0a586(0x197)+_0x12079f[_0xc0a586(0x1a2)]+'\x20('+_0x12079f[_0xc0a586(0x179)]+').',_0xc0a586(0x168));}export function projectRole(_0x27fcfc){const _0x15175f=a184_0x3f8d3a;return{'id':_0x27fcfc['id'],'roleName':_0x27fcfc['roleName'],'roleType':_0x27fcfc[_0x15175f(0x179)],'remark':_0x27fcfc[_0x15175f(0x16b)],'userCount':_0x27fcfc['userCount'],'permitCount':_0x27fcfc[_0x15175f(0x15c)],'builtin':isBuiltinRole(_0x27fcfc[_0x15175f(0x179)])};}export async function resolveRoleRef(_0x361374,_0x59835a){const _0x3f9a7b=a184_0x3f8d3a,_0x5b2597=_0x59835a['trim']();if(!_0x5b2597)throw CliErrors[_0x3f9a7b(0x152)](_0x3f9a7b(0x158),_0x3f9a7b(0x190));if(/^\d+$/[_0x3f9a7b(0x15a)](_0x5b2597))return getRoleById(_0x361374,Number(_0x5b2597));const _0x23c21d=await listAllAppRoles(_0x361374),_0x2e4f1=_0x23c21d['filter'](_0x59d8c8=>_0x59d8c8[_0x3f9a7b(0x1a2)]===_0x5b2597);if(_0x2e4f1['length']===0x0)throw CliErrors[_0x3f9a7b(0x152)](_0x3f9a7b(0x15b)+_0x5b2597+_0x3f9a7b(0x19a)+_0x361374+'.',_0x3f9a7b(0x18e));if(_0x2e4f1[_0x3f9a7b(0x185)]>0x1){const _0x3b43c1=_0x2e4f1[_0x3f9a7b(0x15f)](_0x1bb4ba=>_0x1bb4ba['id'])['join'](',\x20');throw CliErrors['validation'](_0x3f9a7b(0x15b)+_0x5b2597+'\x22\x20is\x20ambiguous\x20(ids:\x20'+_0x3b43c1+').',_0x3f9a7b(0x161));}return _0x2e4f1[0x0];}export async function getRoleById(_0x36e972,_0x47f800){const _0x2346a5=a184_0x3f8d3a,_0x24adcf=await getAppRole(_0x47f800);if(!_0x24adcf)throw CliErrors[_0x2346a5(0x152)](_0x2346a5(0x19b)+_0x47f800+_0x2346a5(0x15d)+_0x36e972+'.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.');return _0x24adcf;}async function listAllAppRoles(_0x5ed08b){const _0x2133f8=a184_0x3f8d3a,_0x2f0d60=0x64,_0x45434c=[];for(let _0x24463=0x1;;_0x24463+=0x1){const {items:_0x166865,paging:_0x4c524b}=await listAppRoles(_0x5ed08b,{'currentPage':_0x24463,'pageSize':_0x2f0d60});_0x45434c[_0x2133f8(0x167)](..._0x166865);if(_0x166865[_0x2133f8(0x185)]<_0x2f0d60||_0x4c524b&&_0x45434c[_0x2133f8(0x185)]>=_0x4c524b[_0x2133f8(0x18a)])return _0x45434c;}}export async function resolveTenantCode(){const _0xb261a=a184_0x3f8d3a,_0x1af543=await getSessionUserInfo(),_0x3c4c58=_0x1af543?.[_0xb261a(0x17f)]?.[_0xb261a(0x18f)]?.['tenant_code'];if(!_0x3c4c58)throw CliErrors[_0xb261a(0x1a1)](_0xb261a(0x156));return _0x3c4c58;}function matchMember(_0x46817d,_0x2c1f14){const _0x2cba07=a184_0x3f8d3a,_0x29cdd6=_0x2c1f14['trim']()[_0x2cba07(0x19e)]();return(_0x46817d['nickname']??'')[_0x2cba07(0x19e)]()===_0x29cdd6||(_0x46817d['username']??'')[_0x2cba07(0x19e)]()===_0x29cdd6;}export async function resolveUserRef(_0x34e115){const _0x1e980f=a184_0x3f8d3a,_0x3e2a6e=_0x34e115['trim']();if(!_0x3e2a6e)throw CliErrors['validation'](_0x1e980f(0x16a),_0x1e980f(0x155));const _0x1cfb89=await resolveTenantCode(),_0x489567=await getTenantMembers(_0x1cfb89);if(/^\d+$/[_0x1e980f(0x15a)](_0x3e2a6e)){const _0x3efac3=Number(_0x3e2a6e),_0x411df9=_0x489567[_0x1e980f(0x187)](_0x35173e=>_0x35173e['userId']===_0x3efac3);return{'userId':_0x3efac3,'username':_0x411df9?.[_0x1e980f(0x17d)]??String(_0x3efac3),'nickname':_0x411df9?.[_0x1e980f(0x19c)],'matchedBy':'id'};}const _0xca4c3e=_0x489567[_0x1e980f(0x193)](_0x195630=>matchMember(_0x195630,_0x3e2a6e));if(_0xca4c3e[_0x1e980f(0x185)]===0x0)throw CliErrors[_0x1e980f(0x152)](_0x1e980f(0x195)+_0x3e2a6e+'\x22.',_0x1e980f(0x15e));if(_0xca4c3e['length']>0x1){const _0x111df1=_0xca4c3e[_0x1e980f(0x15f)](_0x3d4adc=>(_0x3d4adc['nickname']??_0x3d4adc[_0x1e980f(0x17d)]??'?')+'('+_0x3d4adc[_0x1e980f(0x19d)]+')')[_0x1e980f(0x162)](',\x20');throw CliErrors[_0x1e980f(0x152)](_0x1e980f(0x178)+_0x3e2a6e+_0x1e980f(0x196)+_0x111df1+'.',_0x1e980f(0x184));}const _0x3fa3a9=_0xca4c3e[0x0];return{'userId':_0x3fa3a9[_0x1e980f(0x19d)],'username':_0x3fa3a9[_0x1e980f(0x17d)]??String(_0x3fa3a9[_0x1e980f(0x19d)]),'nickname':_0x3fa3a9[_0x1e980f(0x19c)],'matchedBy':_0x1e980f(0x174)};}export const UPDATE_USER_LIST_PATH=a184_0x3f8d3a(0x192);function userIdsOf(_0x4d44ef){const _0x7b6f5c=a184_0x3f8d3a;return(_0x4d44ef?.[_0x7b6f5c(0x17b)]??[])[_0x7b6f5c(0x15f)](_0x3ff3e4=>_0x3ff3e4['userId']);}export function computeRoleUserMutation(_0x3db006){const _0x1ab7db=a184_0x3f8d3a,{operation:_0x566328,appCode:_0x3f7f09,roleUsers:_0x517921,targetRoleId:_0x407ab9,user:_0x46a064}=_0x3db006,_0x2055c1=_0x517921['find'](_0x3f93ef=>_0x3f93ef['id']===_0x407ab9);if(!_0x2055c1)throw CliErrors[_0x1ab7db(0x152)](_0x1ab7db(0x19b)+_0x407ab9+_0x1ab7db(0x153),_0x1ab7db(0x16c));const _0x1a2465=userIdsOf(_0x2055c1),_0x18192b=[];if(_0x3db006[_0x1ab7db(0x171)]!==undefined&&_0x3db006[_0x1ab7db(0x171)]!==_0x1a2465[_0x1ab7db(0x185)])throw CliErrors[_0x1ab7db(0x152)](_0x1ab7db(0x17a)+_0x3db006[_0x1ab7db(0x171)]+'\x20member(s)\x20but\x20role\x20has\x20'+_0x1a2465['length']+'.','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.');const _0x4c9afd=_0x1a2465[_0x1ab7db(0x1a0)](_0x46a064[_0x1ab7db(0x19d)]);let _0x7ff2b4=![];const _0x22f19b=[..._0x2055c1[_0x1ab7db(0x17b)]];if(_0x566328==='user-add')_0x4c9afd?_0x18192b[_0x1ab7db(0x167)](_0x1ab7db(0x180)+_0x46a064[_0x1ab7db(0x19d)]+_0x1ab7db(0x169)+_0x2055c1['roleName']+';\x20no\x20change.'):(_0x22f19b[_0x1ab7db(0x167)]({'userId':_0x46a064[_0x1ab7db(0x19d)],'username':_0x46a064['username'],..._0x46a064[_0x1ab7db(0x19c)]?{'nickname':_0x46a064[_0x1ab7db(0x19c)]}:{}}),_0x7ff2b4=!![]);else{if(!_0x4c9afd)_0x18192b[_0x1ab7db(0x167)](_0x1ab7db(0x180)+_0x46a064[_0x1ab7db(0x19d)]+_0x1ab7db(0x1a3)+_0x2055c1[_0x1ab7db(0x1a2)]+_0x1ab7db(0x160));else{const _0x4cbaa3=_0x22f19b['findIndex'](_0x5557d2=>_0x5557d2[_0x1ab7db(0x19d)]===_0x46a064[_0x1ab7db(0x19d)]);if(_0x4cbaa3>=0x0)_0x22f19b[_0x1ab7db(0x16f)](_0x4cbaa3,0x1);_0x7ff2b4=!![];}}const _0x178b52=_0x517921['map'](_0x503a95=>_0x503a95['id']===_0x407ab9?{..._0x503a95,'userList':_0x22f19b}:_0x503a95),_0x5e9ec5=_0x22f19b['map'](_0x59e91b=>_0x59e91b[_0x1ab7db(0x19d)]),_0x3d11d7={'operation':_0x566328,'selector':{'appCode':_0x3f7f09,'roleId':_0x407ab9,'roleName':_0x2055c1[_0x1ab7db(0x1a2)],'userId':_0x46a064['userId']},'before':{'userIds':_0x1a2465},'after':{'userIds':_0x5e9ec5},'dryRun':_0x3db006[_0x1ab7db(0x177)],'backend':{'method':_0x1ab7db(0x163),'path':UPDATE_USER_LIST_PATH},'warnings':_0x18192b};return{'roleList':_0x178b52,'mutation':_0x3d11d7,'changed':_0x7ff2b4};}export async function loadRoleUsers(_0x77522f){return listRoleUsers(_0x77522f);}export function readRoleRef(_0x3bf3bb){const _0x45d5c6=a184_0x3f8d3a,_0x235f55=_0x3bf3bb[_0x45d5c6(0x172)]('role')[_0x45d5c6(0x194)]();if(!_0x235f55)throw CliErrors[_0x45d5c6(0x176)](_0x45d5c6(0x16e),_0x45d5c6(0x190));return _0x235f55;}export async function prepareUserMutation(_0x15298e,_0x1897eb,_0x53f680){const _0x2c1173=a184_0x3f8d3a,_0x18d2d2=readRoleRef(_0x15298e),_0x1faa83=_0x15298e[_0x2c1173(0x172)](_0x2c1173(0x17f))['trim']();if(!_0x1faa83)throw CliErrors['flagMissing'](_0x2c1173(0x17f),_0x2c1173(0x155));const _0x37b18=_0x15298e['flag'](_0x2c1173(0x183)),_0xd4a469=_0x37b18===undefined||_0x37b18===null?undefined:Number(_0x37b18),_0x4e3369=await resolveRoleRef(_0x15298e[_0x2c1173(0x181)],_0x18d2d2),_0x15a5b8=await resolveUserRef(_0x1faa83),_0x4c5b37=await loadRoleUsers(_0x15298e['appCode']);return computeRoleUserMutation({'operation':_0x1897eb,'appCode':_0x15298e[_0x2c1173(0x181)],'roleUsers':_0x4c5b37,'targetRoleId':_0x4e3369['id'],'user':{'userId':_0x15a5b8[_0x2c1173(0x19d)],'username':_0x15a5b8[_0x2c1173(0x17d)],'nickname':_0x15a5b8[_0x2c1173(0x19c)]},'dryRun':_0x53f680,..._0xd4a469!==undefined?{'expectUserCount':_0xd4a469}:{}});}
1
+ const a177_0x45db15=a177_0x5363;(function(_0x88f4db,_0x4e5fc8){const _0x176591=a177_0x5363,_0x535f2c=_0x88f4db();while(!![]){try{const _0x4c2785=parseInt(_0x176591(0x1b5))/0x1+parseInt(_0x176591(0x1de))/0x2*(parseInt(_0x176591(0x1e7))/0x3)+-parseInt(_0x176591(0x1e3))/0x4+-parseInt(_0x176591(0x1fd))/0x5*(parseInt(_0x176591(0x1f7))/0x6)+parseInt(_0x176591(0x1b6))/0x7*(parseInt(_0x176591(0x204))/0x8)+parseInt(_0x176591(0x1fc))/0x9*(-parseInt(_0x176591(0x1d0))/0xa)+parseInt(_0x176591(0x1c9))/0xb;if(_0x4c2785===_0x4e5fc8)break;else _0x535f2c['push'](_0x535f2c['shift']());}catch(_0x5e7d40){_0x535f2c['push'](_0x535f2c['shift']());}}}(a177_0x4f55,0x24694));import{getTenantMembers,listDevUserRoleRelations,listAppRoles}from'../../core/api-client.js';function a177_0x4f55(){const _0x1cfa78=['userCount','username','/smartapi/permit/user-role/create','Cannot\x20','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','remark','\x20member(s)\x20but\x20role\x20has\x20','16788ZYsiHs','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','userId','Optional\x20role\x20remark/description','\x22:\x20','234HpRrFx','80XxLUeN','Pass\x20--role\x20<id|name>.','Missing\x20user\x20reference.','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','appCode','Anti-drift\x20check\x20failed:\x20expected\x20','\x20is\x20already\x20a\x20member\x20of\x20role\x20','5864oPdqiJ','user-add','\x20built-in\x20role\x20','CUSTOM','\x20is\x20not\x20a\x20member\x20of\x20role\x20','\x20not\x20found\x20in\x20app\x20','77651sltumw','441tRMeYt','\x22\x20not\x20found\x20in\x20app\x20','validation','Disambiguate\x20with\x20--user\x20<id>.','Pass\x20--user\x20<id|name>.','tenant','Role\x20name\x20\x22','flag','toLowerCase','roleName','dryRun','Role\x20id\x20or\x20exact\x20role\x20name','tenant_code','filter','expectUserCount','Role\x20id\x20','\x20members\x20of\x20the\x20OWNER\x20role.','join','ADMIN','2117104rCIAJE','name','No\x20tenant\x20member\x20matches\x20\x22','find','Removed\x20','length','DEV','68860TYBPbl','nickname','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','dev','authRequired','user','Multiple\x20tenant\x20members\x20match\x20\x22','Missing\x20role\x20reference.','string','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','role','POST','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','map','308114yIxKss','number','roleType','includes','push','389628EvnrTR','/smartapi/permit/user-role/delete','flagMissing','trim','3ayhVMo','permitCount',';\x20no\x20change.','expect-user-count','User\x20','OWNER','Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.','str'];a177_0x4f55=function(){return _0x1cfa78;};return a177_0x4f55();}import{getSessionUserInfo}from'../../auth/get-session-user.js';import{CliErrors}from'../../errors.js';export const ROLE_ID_FLAG={'name':'id','type':'number','required':!![],'description':'Role\x20id\x20(from\x20`role\x20list`)'};export const ROLE_REF_FLAG={'name':a177_0x45db15(0x1da),'type':a177_0x45db15(0x1d8),'required':!![],'description':a177_0x45db15(0x1c1)};export const USER_REF_FLAG={'name':a177_0x45db15(0x1d5),'type':'string','required':!![],'description':a177_0x45db15(0x200)};export const NAME_FLAG={'name':'name','type':a177_0x45db15(0x1d8),'required':!![],'description':'Role\x20name'};export const USER_NAME_FLAG={'name':a177_0x45db15(0x1ca),'type':'string','required':!![],'description':a177_0x45db15(0x1f4)};export const REMARK_FLAG={'name':a177_0x45db15(0x1f5),'type':a177_0x45db15(0x1d8),'required':![],'description':a177_0x45db15(0x1fa)};export const EXPECT_USER_COUNT_FLAG={'name':a177_0x45db15(0x1ea),'type':a177_0x45db15(0x1df),'required':![],'description':'Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs'};export const BUILTIN_ROLE_TYPES=[a177_0x45db15(0x1c8),a177_0x45db15(0x1cf),a177_0x45db15(0x1ec)];export function isBuiltinRole(_0x13af4b){const _0x401b40=a177_0x45db15;return BUILTIN_ROLE_TYPES[_0x401b40(0x1e1)](_0x13af4b);}export function assertCustomRole(_0xb13cb,_0x2fe07a){const _0x240820=a177_0x45db15;if(_0xb13cb['roleType']!==_0x240820(0x1b2))throw CliErrors['validation'](_0x240820(0x1f2)+_0x2fe07a+_0x240820(0x1b1)+_0xb13cb[_0x240820(0x1bf)]+'\x20('+_0xb13cb[_0x240820(0x1e0)]+').',_0x240820(0x1d9));}export function projectRole(_0x4e8861){const _0x5e91c7=a177_0x45db15;return{'id':_0x4e8861['id'],'roleName':_0x4e8861[_0x5e91c7(0x1bf)],'roleType':_0x4e8861['roleType'],'remark':_0x4e8861[_0x5e91c7(0x1f5)],'userCount':_0x4e8861[_0x5e91c7(0x1ef)],'permitCount':_0x4e8861[_0x5e91c7(0x1e8)],'builtin':isBuiltinRole(_0x4e8861[_0x5e91c7(0x1e0)])};}export async function resolveRoleRef(_0x115a95,_0x3fda63){const _0x2d4bf7=a177_0x45db15,_0x34f12d=_0x3fda63[_0x2d4bf7(0x1e6)]();if(!_0x34f12d)throw CliErrors[_0x2d4bf7(0x1b8)](_0x2d4bf7(0x1d7),'Pass\x20--role\x20<id|name>.');if(/^\d+$/['test'](_0x34f12d))return getRoleById(_0x115a95,Number(_0x34f12d));const _0x365600=await listAllAppRoles(_0x115a95),_0x29d07f=_0x365600[_0x2d4bf7(0x1c3)](_0x2f6c90=>_0x2f6c90['roleName']===_0x34f12d);if(_0x29d07f[_0x2d4bf7(0x1ce)]===0x0)throw CliErrors[_0x2d4bf7(0x1b8)](_0x2d4bf7(0x1bc)+_0x34f12d+_0x2d4bf7(0x1b7)+_0x115a95+'.',_0x2d4bf7(0x1d2));if(_0x29d07f['length']>0x1){const _0x315250=_0x29d07f[_0x2d4bf7(0x1dd)](_0x9dbcce=>_0x9dbcce['id'])[_0x2d4bf7(0x1c7)](',\x20');throw CliErrors[_0x2d4bf7(0x1b8)](_0x2d4bf7(0x1bc)+_0x34f12d+'\x22\x20is\x20ambiguous\x20(ids:\x20'+_0x315250+').','Disambiguate\x20with\x20--role\x20<id>.');}return _0x29d07f[0x0];}export async function getRoleById(_0x38b985,_0x3268e3){const _0x4deb70=a177_0x45db15,_0xd7c2dc=await listAllAppRoles(_0x38b985),_0x1fb43e=_0xd7c2dc[_0x4deb70(0x1c3)](_0x43eabf=>_0x43eabf['id']===_0x3268e3&&(!_0x43eabf[_0x4deb70(0x201)]||_0x43eabf['appCode']===_0x38b985));if(_0x1fb43e[_0x4deb70(0x1ce)]!==0x1)throw CliErrors[_0x4deb70(0x1b8)](_0x4deb70(0x1c5)+_0x3268e3+_0x4deb70(0x1b4)+_0x38b985+'.',_0x4deb70(0x1dc));return _0x1fb43e[0x0];}async function listAllAppRoles(_0x6d3beb){const _0x55f37c=a177_0x45db15,_0x3605ee=0x64,_0x1871d0=[];for(let _0x447d2d=0x1;;_0x447d2d+=0x1){const {items:_0x4b291d,paging:_0x5e3cf2}=await listAppRoles(_0x6d3beb,{'currentPage':_0x447d2d,'pageSize':_0x3605ee});_0x1871d0[_0x55f37c(0x1e2)](..._0x4b291d);if(_0x4b291d[_0x55f37c(0x1ce)]<_0x3605ee||_0x5e3cf2&&_0x1871d0[_0x55f37c(0x1ce)]>=_0x5e3cf2['totalCount'])return _0x1871d0;}}export async function resolveTenantCode(){const _0x4eb4de=a177_0x45db15,_0x58ae83=await getSessionUserInfo(),_0x407cc2=_0x58ae83?.[_0x4eb4de(0x1d5)]?.[_0x4eb4de(0x1bb)]?.[_0x4eb4de(0x1c2)];if(!_0x407cc2)throw CliErrors[_0x4eb4de(0x1d4)](_0x4eb4de(0x1f8));return _0x407cc2;}function matchMember(_0x1ca1a6,_0x42aa24){const _0x12d024=a177_0x45db15,_0x3d818f=_0x42aa24['trim']()['toLowerCase']();return(_0x1ca1a6[_0x12d024(0x1d1)]??'')['toLowerCase']()===_0x3d818f||(_0x1ca1a6[_0x12d024(0x1f0)]??'')[_0x12d024(0x1be)]()===_0x3d818f;}export async function resolveUserRef(_0x2392dc){const _0x3a2a11=a177_0x45db15,_0x3a65bc=_0x2392dc[_0x3a2a11(0x1e6)]();if(!_0x3a65bc)throw CliErrors[_0x3a2a11(0x1b8)](_0x3a2a11(0x1ff),'Pass\x20--user\x20<id|name>.');const _0x200070=await resolveTenantCode(),_0x16cb0e=await getTenantMembers(_0x200070);if(/^\d+$/['test'](_0x3a65bc)){const _0x160c16=Number(_0x3a65bc),_0x20bb70=_0x16cb0e[_0x3a2a11(0x1cc)](_0x3e44f6=>_0x3e44f6[_0x3a2a11(0x1f9)]===_0x160c16);return{'userId':_0x160c16,'username':_0x20bb70?.[_0x3a2a11(0x1f0)]??String(_0x160c16),'nickname':_0x20bb70?.[_0x3a2a11(0x1d1)],'matchedBy':'id'};}const _0x5c468c=_0x16cb0e[_0x3a2a11(0x1c3)](_0x29c5a2=>matchMember(_0x29c5a2,_0x3a65bc));if(_0x5c468c['length']===0x0)throw CliErrors['validation'](_0x3a2a11(0x1cb)+_0x3a65bc+'\x22.',_0x3a2a11(0x1ed));if(_0x5c468c[_0x3a2a11(0x1ce)]>0x1){const _0x334bb3=_0x5c468c[_0x3a2a11(0x1dd)](_0x15ee33=>(_0x15ee33[_0x3a2a11(0x1d1)]??_0x15ee33[_0x3a2a11(0x1f0)]??'?')+'('+_0x15ee33[_0x3a2a11(0x1f9)]+')')[_0x3a2a11(0x1c7)](',\x20');throw CliErrors['validation'](_0x3a2a11(0x1d6)+_0x3a65bc+_0x3a2a11(0x1fb)+_0x334bb3+'.',_0x3a2a11(0x1b9));}const _0x2129a9=_0x5c468c[0x0];return{'userId':_0x2129a9[_0x3a2a11(0x1f9)],'username':_0x2129a9[_0x3a2a11(0x1f0)]??String(_0x2129a9[_0x3a2a11(0x1f9)]),'nickname':_0x2129a9[_0x3a2a11(0x1d1)],'matchedBy':_0x3a2a11(0x1ca)};}export const CREATE_USER_ROLE_PATH=a177_0x45db15(0x1f1);export const DELETE_USER_ROLE_PATH=a177_0x45db15(0x1e4);export function computeRoleUserMutation(_0x14c66f){const _0x32b7c9=a177_0x45db15,{operation:_0x31b657,appCode:_0xccb91b,role:_0x8ee005,relations:_0x270f9b,user:_0x453feb}=_0x14c66f,_0x18154d=[...new Set(_0x270f9b['map'](_0x5f59e1=>_0x5f59e1[_0x32b7c9(0x1f9)]))],_0xa1a5da=[];if(_0x14c66f[_0x32b7c9(0x1c4)]!==undefined&&_0x14c66f[_0x32b7c9(0x1c4)]!==_0x18154d[_0x32b7c9(0x1ce)])throw CliErrors['validation'](_0x32b7c9(0x202)+_0x14c66f[_0x32b7c9(0x1c4)]+_0x32b7c9(0x1f6)+_0x18154d[_0x32b7c9(0x1ce)]+'.',_0x32b7c9(0x1f3));const _0x497003=_0x18154d[_0x32b7c9(0x1e1)](_0x453feb['userId']),_0x476a51=_0x270f9b[_0x32b7c9(0x1c3)](_0x290751=>_0x290751[_0x32b7c9(0x1f9)]===_0x453feb[_0x32b7c9(0x1f9)])[_0x32b7c9(0x1dd)](_0x466ed5=>_0x466ed5['id']),_0x5604fd=_0x31b657==='user-add'?!_0x497003:_0x497003;let _0x1b4bc3=_0x18154d;_0x31b657===_0x32b7c9(0x1b0)?_0x497003?_0xa1a5da[_0x32b7c9(0x1e2)]('User\x20'+_0x453feb['userId']+_0x32b7c9(0x203)+_0x8ee005[_0x32b7c9(0x1bf)]+_0x32b7c9(0x1e9)):_0x1b4bc3=[..._0x18154d,_0x453feb[_0x32b7c9(0x1f9)]]:!_0x497003?_0xa1a5da[_0x32b7c9(0x1e2)](_0x32b7c9(0x1eb)+_0x453feb[_0x32b7c9(0x1f9)]+_0x32b7c9(0x1b3)+_0x8ee005[_0x32b7c9(0x1bf)]+';\x20no\x20change.'):(_0x1b4bc3=_0x18154d[_0x32b7c9(0x1c3)](_0x2f6091=>_0x2f6091!==_0x453feb['userId']),_0x476a51['length']>0x1&&_0xa1a5da['push'](_0x32b7c9(0x1cd)+_0x476a51[_0x32b7c9(0x1ce)]+'\x20duplicate\x20memberships\x20for\x20user\x20'+_0x453feb[_0x32b7c9(0x1f9)]+'.'));const _0x37a415={'scope':_0x32b7c9(0x1d3),'operation':_0x31b657,'selector':{'appCode':_0xccb91b,'roleId':_0x8ee005['id'],'roleName':_0x8ee005[_0x32b7c9(0x1bf)],'userId':_0x453feb[_0x32b7c9(0x1f9)]},'before':{'userIds':_0x18154d},'after':{'userIds':_0x1b4bc3},'dryRun':_0x14c66f[_0x32b7c9(0x1c0)],'backend':{'method':_0x32b7c9(0x1db),'path':_0x31b657==='user-add'?CREATE_USER_ROLE_PATH:DELETE_USER_ROLE_PATH},'warnings':_0xa1a5da};return{'mutation':_0x37a415,'changed':_0x5604fd,'matchingRelationIds':_0x476a51};}export async function loadDevRoleRelations(_0x6154fd,_0x4e2bba){const _0x3c18a7=a177_0x45db15,_0x179f0f=0x64,_0x2058e8=[];for(let _0x141215=0x1;;_0x141215+=0x1){const {items:_0x541fcf,paging:_0x27be44}=await listDevUserRoleRelations(_0x6154fd,{'roleId':_0x4e2bba,'currentPage':_0x141215,'pageSize':_0x179f0f});_0x2058e8['push'](..._0x541fcf);if(_0x541fcf['length']<_0x179f0f||_0x27be44&&_0x2058e8[_0x3c18a7(0x1ce)]>=_0x27be44['totalCount'])return _0x2058e8;}}export function readRoleRef(_0x583a43){const _0x325c78=a177_0x45db15,_0x492428=_0x583a43[_0x325c78(0x1ee)](_0x325c78(0x1da))[_0x325c78(0x1e6)]();if(!_0x492428)throw CliErrors[_0x325c78(0x1e5)](_0x325c78(0x1da),_0x325c78(0x1fe));return _0x492428;}function a177_0x5363(_0x432a2e,_0x596bc6){_0x432a2e=_0x432a2e-0x1b0;const _0x4f55bd=a177_0x4f55();let _0x5363bf=_0x4f55bd[_0x432a2e];return _0x5363bf;}export async function prepareUserMutation(_0x5e772c,_0x1d813e,_0x56273f){const _0x11eac8=a177_0x45db15,_0x148a7c=readRoleRef(_0x5e772c),_0x191192=_0x5e772c[_0x11eac8(0x1ee)](_0x11eac8(0x1d5))[_0x11eac8(0x1e6)]();if(!_0x191192)throw CliErrors[_0x11eac8(0x1e5)](_0x11eac8(0x1d5),_0x11eac8(0x1ba));const _0x16fa69=_0x5e772c[_0x11eac8(0x1bd)](_0x11eac8(0x1ea)),_0x288a82=_0x16fa69===undefined||_0x16fa69===null?undefined:Number(_0x16fa69),_0x5c64a7=await resolveRoleRef(_0x5e772c[_0x11eac8(0x201)],_0x148a7c);if(_0x5c64a7[_0x11eac8(0x1e0)]===_0x11eac8(0x1ec))throw CliErrors[_0x11eac8(0x1b8)]('Cannot\x20'+_0x1d813e+_0x11eac8(0x1c6),'Use\x20the\x20platform\x20ownership-transfer\x20workflow\x20to\x20change\x20the\x20application\x20owner.');const _0x43ca11=await resolveUserRef(_0x191192),_0x3041a7=await loadDevRoleRelations(_0x5e772c[_0x11eac8(0x201)],_0x5c64a7['id']);return{...computeRoleUserMutation({'operation':_0x1d813e,'appCode':_0x5e772c['appCode'],'role':_0x5c64a7,'relations':_0x3041a7,'user':{'userId':_0x43ca11[_0x11eac8(0x1f9)],'username':_0x43ca11[_0x11eac8(0x1f0)],'nickname':_0x43ca11[_0x11eac8(0x1d1)]},'dryRun':_0x56273f,..._0x288a82!==undefined?{'expectUserCount':_0x288a82}:{}}),'role':_0x5c64a7,'user':_0x43ca11};}
@@ -1 +1 @@
1
- const a185_0x50058b=a185_0x13f7;(function(_0x24d52f,_0x31b8ab){const _0x50a62a=a185_0x13f7,_0x552d5c=_0x24d52f();while(!![]){try{const _0x1105c9=-parseInt(_0x50a62a(0x144))/0x1*(parseInt(_0x50a62a(0x14f))/0x2)+parseInt(_0x50a62a(0x14d))/0x3+-parseInt(_0x50a62a(0x153))/0x4*(-parseInt(_0x50a62a(0x148))/0x5)+parseInt(_0x50a62a(0x138))/0x6+parseInt(_0x50a62a(0x142))/0x7+-parseInt(_0x50a62a(0x150))/0x8*(parseInt(_0x50a62a(0x146))/0x9)+parseInt(_0x50a62a(0x147))/0xa;if(_0x1105c9===_0x31b8ab)break;else _0x552d5c['push'](_0x552d5c['shift']());}catch(_0x40920c){_0x552d5c['push'](_0x552d5c['shift']());}}}(a185_0x37e5,0x36226));function a185_0x37e5(){const _0x1c73b8=['999460OcPgBO','POST','10228mtPJuz','num','306dJJtOM','1276860KCHjYR','64490QdqcEZ','trim','Updated\x20role\x20','string','roleName','144390uMWddM','appCode','38qPndxl','62584YHZCbd','update','/smartapi/permit/role/update','4qIghgh','remark','2103324ucCSiO','validation','Nothing\x20to\x20update.','length','write','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','--name\x20cannot\x20be\x20empty.','\x20(id=','flag'];a185_0x37e5=function(){return _0x1c73b8;};return a185_0x37e5();}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=a185_0x50058b(0x152);function readPatch(_0x386c94){const _0x425b65=a185_0x50058b,_0x10820e=_0x386c94[_0x425b65(0x141)]('name'),_0x10ae75=_0x386c94['flag'](_0x425b65(0x137)),_0x2e43e4={};if(_0x10820e!==undefined&&_0x10820e!==null){const _0x4d7874=String(_0x10820e)[_0x425b65(0x149)]();if(!_0x4d7874)throw CliErrors['validation'](_0x425b65(0x13f));if(_0x4d7874[_0x425b65(0x13b)]>0x40)throw CliErrors[_0x425b65(0x139)](_0x425b65(0x13e));_0x2e43e4['roleName']=_0x4d7874;}_0x10ae75!==undefined&&_0x10ae75!==null&&(_0x2e43e4[_0x425b65(0x137)]=String(_0x10ae75));if(_0x2e43e4['roleName']===undefined&&_0x2e43e4['remark']===undefined)throw CliErrors[_0x425b65(0x139)](_0x425b65(0x13a),_0x425b65(0x13d));return _0x2e43e4;}function a185_0x13f7(_0x12ee40,_0x16380c){_0x12ee40=_0x12ee40-0x137;const _0x37e55e=a185_0x37e5();let _0x13f7aa=_0x37e55e[_0x12ee40];return _0x13f7aa;}export const roleUpdate={'service':'role','command':a185_0x50058b(0x151),'description':'Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(DEV/ADMIN\x20rejected)','risk':a185_0x50058b(0x13c),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':'name','type':a185_0x50058b(0x14b),'required':![],'description':'New\x20role\x20name'},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x58ab2f){readPatch(_0x58ab2f);},async 'dryRun'(_0x579760){const _0x453eb8=a185_0x50058b,_0x597ce3=_0x579760[_0x453eb8(0x145)]('id'),_0x5082e0=readPatch(_0x579760),_0x5c0d03=await getRoleById(_0x579760['appCode'],_0x597ce3);return assertCustomRole(_0x5c0d03,_0x453eb8(0x151)),asDryRunResult({'operation':_0x453eb8(0x151),'selector':{'appCode':_0x579760[_0x453eb8(0x14e)],'roleId':_0x597ce3,'roleName':_0x5c0d03[_0x453eb8(0x14c)]},'before':projectRole(_0x5c0d03),'after':projectRole({..._0x5c0d03,..._0x5082e0['roleName']!==undefined?{'roleName':_0x5082e0['roleName']}:{},..._0x5082e0[_0x453eb8(0x137)]!==undefined?{'remark':_0x5082e0['remark']}:{}}),'dryRun':!![],'backend':{'method':'POST','path':UPDATE_PATH},'warnings':[]},{'method':_0x453eb8(0x143),'url':UPDATE_PATH});},async 'execute'(_0x355b43){const _0x244e9f=a185_0x50058b,_0x1b1bd0=_0x355b43[_0x244e9f(0x145)]('id'),_0x40c9d4=readPatch(_0x355b43),_0x58b4a5=await getRoleById(_0x355b43[_0x244e9f(0x14e)],_0x1b1bd0);assertCustomRole(_0x58b4a5,_0x244e9f(0x151)),await updateAppRole({'id':_0x1b1bd0,'appCode':_0x355b43[_0x244e9f(0x14e)],..._0x40c9d4[_0x244e9f(0x14c)]!==undefined?{'roleName':_0x40c9d4['roleName']}:{},..._0x40c9d4[_0x244e9f(0x137)]!==undefined?{'remark':_0x40c9d4[_0x244e9f(0x137)]}:{}});const _0x1c7c4b=await getRoleById(_0x355b43['appCode'],_0x1b1bd0);return{'ok':!![],'data':{'operation':_0x244e9f(0x151),'selector':{'appCode':_0x355b43[_0x244e9f(0x14e)],'roleId':_0x1b1bd0,'roleName':_0x1c7c4b[_0x244e9f(0x14c)]},'before':projectRole(_0x58b4a5),'after':projectRole(_0x1c7c4b),'dryRun':![],'backend':{'method':_0x244e9f(0x143),'path':UPDATE_PATH},'warnings':[]},'message':_0x244e9f(0x14a)+_0x1c7c4b[_0x244e9f(0x14c)]+_0x244e9f(0x140)+_0x1b1bd0+')'};}};
1
+ const a178_0x5be01f=a178_0x1b8b;function a178_0x4126(){const _0x1dd202=['5094540mHcNnP','1219304QZlIvj','4509099aROuDt','3485030VPmLpz','appCode','roleName','4757408pzckgQ','update','validation','role','remark','Nothing\x20to\x20update.','write','flag','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(built-in\x20roles\x20rejected)','num','dev','New\x20role\x20name','name','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','POST','755796pZWIHa','length','2553ZMvKLv','3004UJsKJI'];a178_0x4126=function(){return _0x1dd202;};return a178_0x4126();}(function(_0x40dc1a,_0x399d18){const _0x23f843=a178_0x1b8b,_0x1d33c3=_0x40dc1a();while(!![]){try{const _0x1fa969=parseInt(_0x23f843(0x1dd))/0x1+parseInt(_0x23f843(0x1e2))/0x2+parseInt(_0x23f843(0x1df))/0x3*(-parseInt(_0x23f843(0x1e0))/0x4)+parseInt(_0x23f843(0x1ca))/0x5+-parseInt(_0x23f843(0x1e1))/0x6+-parseInt(_0x23f843(0x1c9))/0x7+parseInt(_0x23f843(0x1cd))/0x8;if(_0x1fa969===_0x399d18)break;else _0x1d33c3['push'](_0x1d33c3['shift']());}catch(_0x29aba4){_0x1d33c3['push'](_0x1d33c3['shift']());}}}(a178_0x4126,0x801ee));import{updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,REMARK_FLAG,ROLE_ID_FLAG}from'../../commands/role/shared.js';const UPDATE_PATH='/smartapi/permit/role/update';function readPatch(_0x2af24c){const _0x523ad5=a178_0x1b8b,_0x28632a=_0x2af24c[_0x523ad5(0x1d4)](_0x523ad5(0x1da)),_0x53558d=_0x2af24c['flag'](_0x523ad5(0x1d1)),_0x475224={};if(_0x28632a!==undefined&&_0x28632a!==null){const _0x5d7206=String(_0x28632a)['trim']();if(!_0x5d7206)throw CliErrors['validation']('--name\x20cannot\x20be\x20empty.');if(_0x5d7206[_0x523ad5(0x1de)]>0x40)throw CliErrors[_0x523ad5(0x1cf)](_0x523ad5(0x1db));_0x475224[_0x523ad5(0x1cc)]=_0x5d7206;}_0x53558d!==undefined&&_0x53558d!==null&&(_0x475224[_0x523ad5(0x1d1)]=String(_0x53558d));if(_0x475224[_0x523ad5(0x1cc)]===undefined&&_0x475224[_0x523ad5(0x1d1)]===undefined)throw CliErrors[_0x523ad5(0x1cf)](_0x523ad5(0x1d2),_0x523ad5(0x1d5));return _0x475224;}function a178_0x1b8b(_0x1a6817,_0x52fce5){_0x1a6817=_0x1a6817-0x1c9;const _0x41267f=a178_0x4126();let _0x1b8b31=_0x41267f[_0x1a6817];return _0x1b8b31;}export const roleUpdate={'service':a178_0x5be01f(0x1d0),'command':'update','description':a178_0x5be01f(0x1d6),'risk':a178_0x5be01f(0x1d3),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':'name','type':'string','required':![],'description':a178_0x5be01f(0x1d9)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x3f270a){readPatch(_0x3f270a);},async 'dryRun'(_0x379cb1){const _0xd9cf58=a178_0x5be01f,_0x57e4e6=_0x379cb1[_0xd9cf58(0x1d7)]('id'),_0x1411f8=readPatch(_0x379cb1),_0x19537f=await getRoleById(_0x379cb1[_0xd9cf58(0x1cb)],_0x57e4e6);return assertCustomRole(_0x19537f,_0xd9cf58(0x1ce)),asDryRunResult({'scope':_0xd9cf58(0x1d8),'operation':_0xd9cf58(0x1ce),'selector':{'appCode':_0x379cb1[_0xd9cf58(0x1cb)],'roleId':_0x57e4e6,'roleName':_0x19537f[_0xd9cf58(0x1cc)]},'before':projectRole(_0x19537f),'after':projectRole({..._0x19537f,..._0x1411f8['roleName']!==undefined?{'roleName':_0x1411f8[_0xd9cf58(0x1cc)]}:{},..._0x1411f8[_0xd9cf58(0x1d1)]!==undefined?{'remark':_0x1411f8[_0xd9cf58(0x1d1)]}:{}}),'dryRun':!![],'backend':{'method':_0xd9cf58(0x1dc),'path':UPDATE_PATH},'warnings':[]},{'method':_0xd9cf58(0x1dc),'url':UPDATE_PATH});},async 'execute'(_0x212bae){const _0x18b0ce=a178_0x5be01f,_0x5d522e=_0x212bae['num']('id'),_0x4d8528=readPatch(_0x212bae),_0x51ee16=await getRoleById(_0x212bae[_0x18b0ce(0x1cb)],_0x5d522e);assertCustomRole(_0x51ee16,_0x18b0ce(0x1ce)),await updateAppRole({'id':_0x5d522e,'appCode':_0x212bae[_0x18b0ce(0x1cb)],..._0x4d8528[_0x18b0ce(0x1cc)]!==undefined?{'roleName':_0x4d8528[_0x18b0ce(0x1cc)]}:{},..._0x4d8528[_0x18b0ce(0x1d1)]!==undefined?{'remark':_0x4d8528[_0x18b0ce(0x1d1)]}:{}});const _0x160695=await getRoleById(_0x212bae[_0x18b0ce(0x1cb)],_0x5d522e);return{'ok':!![],'data':{'scope':'dev','operation':'update','selector':{'appCode':_0x212bae['appCode'],'roleId':_0x5d522e,'roleName':_0x160695['roleName']},'before':projectRole(_0x51ee16),'after':projectRole(_0x160695),'dryRun':![],'backend':{'method':'POST','path':UPDATE_PATH},'warnings':[]},'message':'Updated\x20role\x20'+_0x160695[_0x18b0ce(0x1cc)]+'\x20(id='+_0x5d522e+')'};}};
@@ -1 +1 @@
1
- const a186_0x1edc10=a186_0x235b;(function(_0x45475a,_0x6a1ce7){const _0x3a9695=a186_0x235b,_0x2c1373=_0x45475a();while(!![]){try{const _0x1b2072=parseInt(_0x3a9695(0xc2))/0x1+-parseInt(_0x3a9695(0xc8))/0x2+parseInt(_0x3a9695(0xba))/0x3*(-parseInt(_0x3a9695(0xc3))/0x4)+-parseInt(_0x3a9695(0xc9))/0x5+-parseInt(_0x3a9695(0xb9))/0x6*(-parseInt(_0x3a9695(0xbb))/0x7)+parseInt(_0x3a9695(0xc5))/0x8+-parseInt(_0x3a9695(0xb5))/0x9*(-parseInt(_0x3a9695(0xc0))/0xa);if(_0x1b2072===_0x6a1ce7)break;else _0x2c1373['push'](_0x2c1373['shift']());}catch(_0x4aabde){_0x2c1373['push'](_0x2c1373['shift']());}}}(a186_0xc7c6,0xc4e17));import{updateRoleUsers}from'../../core/api-client.js';function a186_0xc7c6(){const _0x208861=['22370TRVuKa','high-risk-write','264994fyBHqy','4bSBmbI','userId','2072120lxKFhg','\x20to\x20role\x20','appCode','2404952szaYfa','8051485zRPTPp','Added\x20user\x20','11943UTHlZJ','user-add','role','selector','5784TjiEWw','510672RxXypA','2156aQYwRl','No\x20change:\x20user\x20','Add\x20a\x20user\x20to\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','POST','roleName'];a186_0xc7c6=function(){return _0x208861;};return a186_0xc7c6();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,prepareUserMutation,ROLE_REF_FLAG,UPDATE_USER_LIST_PATH,USER_REF_FLAG}from'../../commands/role/shared.js';function a186_0x235b(_0x2817f2,_0x33675e){_0x2817f2=_0x2817f2-0xb5;const _0xc7c60b=a186_0xc7c6();let _0x235ba8=_0xc7c60b[_0x2817f2];return _0x235ba8;}export const roleUserAdd={'service':a186_0x1edc10(0xb7),'command':'user-add','description':a186_0x1edc10(0xbd),'risk':a186_0x1edc10(0xc1),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0xe24983){const _0x10361c=a186_0x1edc10,{mutation:_0x4261a8}=await prepareUserMutation(_0xe24983,_0x10361c(0xb6),!![]);return asDryRunResult(_0x4261a8,{'method':_0x10361c(0xbe),'url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x6b05c6){const _0x41d19d=a186_0x1edc10,{roleList:_0x5b7428,mutation:_0x147f0a,changed:_0x5c3de7}=await prepareUserMutation(_0x6b05c6,_0x41d19d(0xb6),![]);return _0x5c3de7&&await updateRoleUsers(_0x6b05c6[_0x41d19d(0xc7)],_0x5b7428),{'ok':!![],'data':_0x147f0a,'message':_0x5c3de7?_0x41d19d(0xca)+_0x147f0a[_0x41d19d(0xb8)][_0x41d19d(0xc4)]+_0x41d19d(0xc6)+_0x147f0a[_0x41d19d(0xb8)][_0x41d19d(0xbf)]:_0x41d19d(0xbc)+_0x147f0a[_0x41d19d(0xb8)]['userId']+'\x20already\x20in\x20role\x20'+_0x147f0a[_0x41d19d(0xb8)]['roleName']};}};
1
+ const a179_0x2c3b6c=a179_0x2b2a;(function(_0x16ecf5,_0x4eeb58){const _0x558791=a179_0x2b2a,_0x56e1c6=_0x16ecf5();while(!![]){try{const _0x44d70e=parseInt(_0x558791(0xb9))/0x1*(parseInt(_0x558791(0xb2))/0x2)+-parseInt(_0x558791(0xb8))/0x3+-parseInt(_0x558791(0xab))/0x4*(parseInt(_0x558791(0xb0))/0x5)+parseInt(_0x558791(0xac))/0x6+parseInt(_0x558791(0xb1))/0x7*(-parseInt(_0x558791(0xba))/0x8)+-parseInt(_0x558791(0xa9))/0x9+parseInt(_0x558791(0xaf))/0xa;if(_0x44d70e===_0x4eeb58)break;else _0x56e1c6['push'](_0x56e1c6['shift']());}catch(_0x341833){_0x56e1c6['push'](_0x56e1c6['shift']());}}}(a179_0x2a37,0x778c3));import{createDevUserRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';function a179_0x2a37(){const _0x3b2f92=['1804760qEQKWr','user-add','role','\x20already\x20in\x20role\x20','roleId','4007106WbssUs','high-risk-write','292nEgXNC','3986766nvFaNR','Added\x20user\x20','roleName','20281740cNxbIv','64345qYjpcr','7PvQTqT','32482FGregg','selector','roleType','Add\x20a\x20user\x20to\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','userId','No\x20change:\x20user\x20','2411505UUXZrI','13pKsYvQ'];a179_0x2a37=function(){return _0x3b2f92;};return a179_0x2a37();}import{EXPECT_USER_COUNT_FLAG,CREATE_USER_ROLE_PATH,prepareUserMutation,ROLE_REF_FLAG,USER_REF_FLAG}from'../../commands/role/shared.js';function a179_0x2b2a(_0x2e2fa7,_0x5a77aa){_0x2e2fa7=_0x2e2fa7-0xa9;const _0x2a3709=a179_0x2a37();let _0x2b2a02=_0x2a3709[_0x2e2fa7];return _0x2b2a02;}export const roleUserAdd={'service':a179_0x2c3b6c(0xbc),'command':'user-add','description':a179_0x2c3b6c(0xb5),'risk':a179_0x2c3b6c(0xaa),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x32c4c2){const _0x7425a9=a179_0x2c3b6c,{mutation:_0x3177c3}=await prepareUserMutation(_0x32c4c2,_0x7425a9(0xbb),!![]);return asDryRunResult(_0x3177c3,{'method':'POST','url':CREATE_USER_ROLE_PATH});},async 'execute'(_0x261fb6){const _0x2036bc=a179_0x2c3b6c,{mutation:_0x4610f1,changed:_0x2af334,role:_0x2642c2,user:_0x11c06b}=await prepareUserMutation(_0x261fb6,_0x2036bc(0xbb),![]);return _0x2af334&&await createDevUserRole({'appCode':_0x261fb6['appCode'],'userId':_0x11c06b[_0x2036bc(0xb6)],'username':_0x11c06b['username'],'roleType':_0x2642c2[_0x2036bc(0xb4)],'roleId':_0x4610f1[_0x2036bc(0xb3)][_0x2036bc(0xbe)]}),{'ok':!![],'data':_0x4610f1,'message':_0x2af334?_0x2036bc(0xad)+_0x4610f1[_0x2036bc(0xb3)][_0x2036bc(0xb6)]+'\x20to\x20role\x20'+_0x4610f1[_0x2036bc(0xb3)][_0x2036bc(0xae)]:_0x2036bc(0xb7)+_0x4610f1['selector']['userId']+_0x2036bc(0xbd)+_0x4610f1[_0x2036bc(0xb3)][_0x2036bc(0xae)]};}};
@@ -1 +1 @@
1
- const a187_0x499735=a187_0x16cd;(function(_0x390665,_0x53aa8a){const _0x225930=a187_0x16cd,_0x3c366c=_0x390665();while(!![]){try{const _0x32885d=parseInt(_0x225930(0x89))/0x1*(-parseInt(_0x225930(0x7a))/0x2)+-parseInt(_0x225930(0x79))/0x3+parseInt(_0x225930(0x8a))/0x4+-parseInt(_0x225930(0x88))/0x5*(parseInt(_0x225930(0x84))/0x6)+parseInt(_0x225930(0x86))/0x7+-parseInt(_0x225930(0x82))/0x8+parseInt(_0x225930(0x78))/0x9*(parseInt(_0x225930(0x7d))/0xa);if(_0x32885d===_0x53aa8a)break;else _0x3c366c['push'](_0x3c366c['shift']());}catch(_0x186d89){_0x3c366c['push'](_0x3c366c['shift']());}}}(a187_0x4966,0x953b3));import{updateRoleUsers}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a187_0x16cd(_0x2a45f2,_0x114df4){_0x2a45f2=_0x2a45f2-0x78;const _0x4966b2=a187_0x4966();let _0x16cd45=_0x4966b2[_0x2a45f2];return _0x16cd45;}import{asDryRunResult}from'../../commands/common/dry-run.js';function a187_0x4966(){const _0x269dcb=['70smrGqM','Removed\x20user\x20','appCode','No\x20change:\x20user\x20','userId','5030544BrexgW','user-remove','6259326tQbwGN','POST','210378uWOIDP','roleName','5YJzPrc','1tHpquB','97436tJIIGx','selector','4183020tWuqYX','1112250ACuTlD','1307666UWpGbo','\x20from\x20role\x20','high-risk-write'];a187_0x4966=function(){return _0x269dcb;};return a187_0x4966();}import{EXPECT_USER_COUNT_FLAG,prepareUserMutation,ROLE_REF_FLAG,UPDATE_USER_LIST_PATH,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserRemove={'service':'role','command':'user-remove','description':'Remove\x20a\x20user\x20from\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','risk':a187_0x499735(0x7c),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x192042){const _0x5215f8=a187_0x499735,{mutation:_0x45d2a7}=await prepareUserMutation(_0x192042,_0x5215f8(0x83),!![]);return asDryRunResult(_0x45d2a7,{'method':_0x5215f8(0x85),'url':UPDATE_USER_LIST_PATH});},async 'execute'(_0xfa2eff){const _0x40fa74=a187_0x499735,{roleList:_0x4b1f91,mutation:_0x14f12d,changed:_0x3f189}=await prepareUserMutation(_0xfa2eff,_0x40fa74(0x83),![]);return _0x3f189&&await updateRoleUsers(_0xfa2eff[_0x40fa74(0x7f)],_0x4b1f91),{'ok':!![],'data':_0x14f12d,'message':_0x3f189?_0x40fa74(0x7e)+_0x14f12d[_0x40fa74(0x8b)][_0x40fa74(0x81)]+_0x40fa74(0x7b)+_0x14f12d['selector'][_0x40fa74(0x87)]:_0x40fa74(0x80)+_0x14f12d[_0x40fa74(0x8b)][_0x40fa74(0x81)]+'\x20not\x20in\x20role\x20'+_0x14f12d[_0x40fa74(0x8b)][_0x40fa74(0x87)]};}};
1
+ const a180_0x45edbc=a180_0x2b23;(function(_0x1f4ce7,_0x5b6abd){const _0x2e7697=a180_0x2b23,_0x21d4d1=_0x1f4ce7();while(!![]){try{const _0x4d549e=parseInt(_0x2e7697(0x1e1))/0x1+-parseInt(_0x2e7697(0x1ea))/0x2*(-parseInt(_0x2e7697(0x1e7))/0x3)+-parseInt(_0x2e7697(0x1e5))/0x4+-parseInt(_0x2e7697(0x1ee))/0x5+parseInt(_0x2e7697(0x1e6))/0x6+-parseInt(_0x2e7697(0x1f0))/0x7+parseInt(_0x2e7697(0x1e4))/0x8;if(_0x4d549e===_0x5b6abd)break;else _0x21d4d1['push'](_0x21d4d1['shift']());}catch(_0x1ec6dc){_0x21d4d1['push'](_0x21d4d1['shift']());}}}(a180_0x4d29,0xad71c));import{deleteDevUserRole}from'../../core/api-client.js';function a180_0x4d29(){const _0x2dbc56=['6396575nhOBuP','Remove\x20a\x20user\x20from\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','5867043GyCiro','POST','1145656gaeJnl','\x20not\x20in\x20role\x20','Removed\x20user\x20','10942656bvITVG','5457024zVmnsv','4623672pNXTTh','23484xMtalM','\x20from\x20role\x20','user-remove','232MBmQlX','selector','userId','role'];a180_0x4d29=function(){return _0x2dbc56;};return a180_0x4d29();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a180_0x2b23(_0x31854d,_0x6c21bd){_0x31854d=_0x31854d-0x1e0;const _0x4d29d8=a180_0x4d29();let _0x2b23e4=_0x4d29d8[_0x31854d];return _0x2b23e4;}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':a180_0x45edbc(0x1ed),'command':a180_0x45edbc(0x1e9),'description':a180_0x45edbc(0x1ef),'risk':'high-risk-write','flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x52481f){const _0x438c5f=a180_0x45edbc,{mutation:_0xfd2259}=await prepareUserMutation(_0x52481f,_0x438c5f(0x1e9),!![]);return asDryRunResult(_0xfd2259,{'method':_0x438c5f(0x1e0),'url':DELETE_USER_ROLE_PATH});},async 'execute'(_0x48b0de){const _0x2e845c=a180_0x45edbc,{matchingRelationIds:_0x120790,mutation:_0x162aae,changed:_0x49ea58}=await prepareUserMutation(_0x48b0de,_0x2e845c(0x1e9),![]);if(_0x49ea58)for(const _0x4c53e0 of _0x120790){await deleteDevUserRole(_0x4c53e0);}return{'ok':!![],'data':_0x162aae,'message':_0x49ea58?_0x2e845c(0x1e3)+_0x162aae[_0x2e845c(0x1eb)][_0x2e845c(0x1ec)]+_0x2e845c(0x1e8)+_0x162aae[_0x2e845c(0x1eb)]['roleName']:'No\x20change:\x20user\x20'+_0x162aae[_0x2e845c(0x1eb)][_0x2e845c(0x1ec)]+_0x2e845c(0x1e2)+_0x162aae[_0x2e845c(0x1eb)]['roleName']};}};
@@ -1 +1 @@
1
- function a188_0x5471(_0x9e2d36,_0x10932e){_0x9e2d36=_0x9e2d36-0x14d;const _0x54694f=a188_0x5469();let _0x547131=_0x54694f[_0x9e2d36];return _0x547131;}const a188_0x28acb9=a188_0x5471;(function(_0x4b608c,_0x4649a){const _0x70db65=a188_0x5471,_0x3b95ed=_0x4b608c();while(!![]){try{const _0x2b7260=-parseInt(_0x70db65(0x162))/0x1*(parseInt(_0x70db65(0x154))/0x2)+-parseInt(_0x70db65(0x167))/0x3*(-parseInt(_0x70db65(0x150))/0x4)+parseInt(_0x70db65(0x14e))/0x5*(-parseInt(_0x70db65(0x15b))/0x6)+-parseInt(_0x70db65(0x151))/0x7+parseInt(_0x70db65(0x160))/0x8*(parseInt(_0x70db65(0x161))/0x9)+parseInt(_0x70db65(0x152))/0xa*(parseInt(_0x70db65(0x157))/0xb)+parseInt(_0x70db65(0x158))/0xc;if(_0x2b7260===_0x4649a)break;else _0x3b95ed['push'](_0x3b95ed['shift']());}catch(_0x777b36){_0x3b95ed['push'](_0x3b95ed['shift']());}}}(a188_0x5469,0x81ef9));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 a188_0x5469(){const _0x5d79a4=['username','1142590uuNPJf','userId','441052yZbCnp','5198739xVrRed','60gumJxL','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','105414IiJbZX','nickname','read','978560ZdYRlq','11588604axdQIO','str','name','6iWMSWa','matchedBy','\x22\x20→\x20userId\x20','flagMissing','role','32qHDAsG','1269711uusiox','19LxKHWG','Pass\x20--name\x20<nickname|username>.','trim','Resolved\x20\x22','user-resolve','12ufUROi'];a188_0x5469=function(){return _0x5d79a4;};return a188_0x5469();}export const roleUserResolve={'service':a188_0x28acb9(0x15f),'command':a188_0x28acb9(0x166),'description':a188_0x28acb9(0x153),'risk':a188_0x28acb9(0x156),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0xa42e14){const _0x48d6e3=a188_0x28acb9;if(!_0xa42e14[_0x48d6e3(0x159)](_0x48d6e3(0x15a))[_0x48d6e3(0x164)]())throw CliErrors[_0x48d6e3(0x15e)](_0x48d6e3(0x15a),_0x48d6e3(0x163));},async 'execute'(_0x48ab93){const _0x172e92=a188_0x28acb9,_0x2c4e9a=_0x48ab93[_0x172e92(0x159)]('name')['trim'](),_0x36c760=await resolveUserRef(_0x2c4e9a);return{'ok':!![],'data':{'user':{'userId':_0x36c760[_0x172e92(0x14f)],'username':_0x36c760[_0x172e92(0x14d)],'nickname':_0x36c760[_0x172e92(0x155)],'matchedBy':_0x36c760[_0x172e92(0x15c)]}},'message':_0x172e92(0x165)+_0x2c4e9a+_0x172e92(0x15d)+_0x36c760[_0x172e92(0x14f)]};}};
1
+ function a181_0x4c5f(){const _0x3d3b07=['292566xyIlhP','role','str','48MbqqHT','trim','matchedBy','username','18pibUFV','171706rglpOY','2097360xrdgWK','2241019tIiDvP','Pass\x20--name\x20<nickname|username>.','91CDwJxR','name','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','909656dKfGtd','userId','1585270SCNrfD','nickname','18iXNsgm','4pdYfsy'];a181_0x4c5f=function(){return _0x3d3b07;};return a181_0x4c5f();}const a181_0x56bb5e=a181_0xe28b;function a181_0xe28b(_0x1dc307,_0x5e427a){_0x1dc307=_0x1dc307-0x1e4;const _0x4c5ff5=a181_0x4c5f();let _0xe28bef=_0x4c5ff5[_0x1dc307];return _0xe28bef;}(function(_0x325a59,_0x578a35){const _0x21d010=a181_0xe28b,_0x4de196=_0x325a59();while(!![]){try{const _0x326437=parseInt(_0x21d010(0x1f5))/0x1+-parseInt(_0x21d010(0x1e8))/0x2*(parseInt(_0x21d010(0x1f3))/0x3)+-parseInt(_0x21d010(0x1f4))/0x4*(-parseInt(_0x21d010(0x1f1))/0x5)+-parseInt(_0x21d010(0x1f8))/0x6*(-parseInt(_0x21d010(0x1ec))/0x7)+parseInt(_0x21d010(0x1ef))/0x8*(-parseInt(_0x21d010(0x1e7))/0x9)+parseInt(_0x21d010(0x1e9))/0xa+parseInt(_0x21d010(0x1ea))/0xb;if(_0x326437===_0x578a35)break;else _0x4de196['push'](_0x4de196['shift']());}catch(_0x1ce727){_0x4de196['push'](_0x4de196['shift']());}}}(a181_0x4c5f,0x44851));import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';export const roleUserResolve={'service':a181_0x56bb5e(0x1f6),'command':'user-resolve','description':a181_0x56bb5e(0x1ee),'risk':'read','flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x4f199f){const _0x46e7e5=a181_0x56bb5e;if(!_0x4f199f[_0x46e7e5(0x1f7)](_0x46e7e5(0x1ed))[_0x46e7e5(0x1e4)]())throw CliErrors['flagMissing'](_0x46e7e5(0x1ed),_0x46e7e5(0x1eb));},async 'execute'(_0x26076a){const _0x18df9c=a181_0x56bb5e,_0xd9919f=_0x26076a['str']('name')['trim'](),_0x54784c=await resolveUserRef(_0xd9919f);return{'ok':!![],'data':{'user':{'userId':_0x54784c[_0x18df9c(0x1f0)],'username':_0x54784c[_0x18df9c(0x1e6)],'nickname':_0x54784c[_0x18df9c(0x1f2)],'matchedBy':_0x54784c[_0x18df9c(0x1e5)]}},'message':'Resolved\x20\x22'+_0xd9919f+'\x22\x20→\x20userId\x20'+_0x54784c[_0x18df9c(0x1f0)]};}};
@@ -1 +1 @@
1
- const a189_0x5e10bb=a189_0x5ad4;(function(_0x38a412,_0x1aa8d2){const _0x257d9c=a189_0x5ad4,_0x506700=_0x38a412();while(!![]){try{const _0x4686e3=-parseInt(_0x257d9c(0x18b))/0x1+-parseInt(_0x257d9c(0x16f))/0x2*(parseInt(_0x257d9c(0x17d))/0x3)+-parseInt(_0x257d9c(0x189))/0x4+-parseInt(_0x257d9c(0x17a))/0x5+-parseInt(_0x257d9c(0x173))/0x6+parseInt(_0x257d9c(0x16a))/0x7*(parseInt(_0x257d9c(0x16b))/0x8)+parseInt(_0x257d9c(0x18e))/0x9;if(_0x4686e3===_0x1aa8d2)break;else _0x506700['push'](_0x506700['shift']());}catch(_0x1eae7c){_0x506700['push'](_0x506700['shift']());}}}(a189_0x410c,0x97733));import{readFileSync,existsSync}from'node:fs';function a189_0x5ad4(_0x1ce497,_0x30f006){_0x1ce497=_0x1ce497-0x169;const _0x410c95=a189_0x410c();let _0x5ad496=_0x410c95[_0x1ce497];return _0x5ad496;}import{CLI_BIN_NAME}from'../../constant/cli.js';import{resolve,delimiter,join}from'node:path';import{spawn}from'node:child_process';function a189_0x410c(){const _0x4968c0=['build','No\x20package.json\x20found\x20in\x20current\x20directory.','belowMinimum','cwd','slice','\x20run\x20','Enable\x20watch\x20mode\x20for\x20preview','No\x20scripts\x20defined\x20in\x20package.json.','node_modules','log','\x20run\x20build','keys','yarn.lock','start','--watch','run','.bin','length','\x20exited\x20with\x20code\x20','\x20\x20\x20\x20','1295NmSBAU','5064eweLDS','close','bun','\x0a\x20\x20Usage:\x20','884srQTwy','bun.lock','validation','needsUpgrade','3117432zGZfFy','script','has','parse','Script\x20\x22','inherit','(none)','3804090cLENwV','\x22\x20not\x20found\x20in\x20package.json.','boolean','5538lJTuVa','join','scripts','vite\x20preview\x20exited\x20with\x20code\x20','watch','push','Script\x20name\x20defined\x20in\x20package.json','npm','Run\x20a\x20package.json\x20script','\x20run\x20<script>\x0a','args','\x0a\x20\x20Available\x20scripts:\x0a','924200cXEBtO','preview','83489RCkreX','yarn','vite','26226855BPuRLZ','error'];a189_0x410c=function(){return _0x4968c0;};return a189_0x410c();}import{CliErrors}from'../../errors.js';import{checkSdkVersion,printSdkUpgradeWarning}from'../../utils/check-sdk-version.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../utils/cli-version-check.js';const VERSION_CHECK_SCRIPTS=new Set([a189_0x5e10bb(0x19d),'dev']);function readPackageScripts(_0x23d101){const _0x2ae8fb=a189_0x5e10bb,_0x52255c=resolve(_0x23d101,'package.json');if(!existsSync(_0x52255c))return null;try{const _0x3ae475=JSON[_0x2ae8fb(0x176)](readFileSync(_0x52255c,'utf-8'));return _0x3ae475[_0x2ae8fb(0x17f)]??{};}catch{return null;}}function detectPackageManager(_0x1078b7){const _0x317719=a189_0x5e10bb;if(existsSync(resolve(_0x1078b7,'bun.lockb'))||existsSync(resolve(_0x1078b7,_0x317719(0x170))))return _0x317719(0x16d);if(existsSync(resolve(_0x1078b7,'pnpm-lock.yaml')))return'pnpm';if(existsSync(resolve(_0x1078b7,_0x317719(0x19c))))return _0x317719(0x18c);return _0x317719(0x184);}async function versionCheck(_0x21bd7f){const _0x3ac79a=a189_0x5e10bb,_0x37753c=await checkCliVersion();(_0x37753c[_0x3ac79a(0x172)]||_0x37753c[_0x3ac79a(0x192)])&&(printCliUpgradeWarning(_0x37753c),assertCliVersionSupported(_0x37753c));const _0x57f79c=await checkSdkVersion(_0x21bd7f);if(_0x57f79c['needsUpgrade'])printSdkUpgradeWarning(_0x57f79c);}function spawnScript(_0x453ac2,_0x826d0a,_0x3024da,_0x275b9d){return new Promise((_0x5ab73a,_0x1f81d9)=>{const _0x11d197=a189_0x5ad4,_0x5e74b8=[_0x11d197(0x19f),_0x826d0a,..._0x3024da],_0x1106b6=spawn(_0x453ac2,_0x5e74b8,{'cwd':_0x275b9d,'stdio':_0x11d197(0x178),'shell':!![],'env':{...process.env,'PATH':''+join(_0x275b9d,_0x11d197(0x198),_0x11d197(0x1a0))+delimiter+process.env.PATH}});_0x1106b6['on'](_0x11d197(0x16c),_0x556f2a=>{const _0x468e67=_0x11d197;if(_0x556f2a===0x0||_0x556f2a===null)_0x5ab73a();else _0x1f81d9(new Error(_0x453ac2+_0x468e67(0x195)+_0x826d0a+_0x468e67(0x1a2)+_0x556f2a));}),_0x1106b6['on'](_0x11d197(0x18f),_0x1f81d9);});}function spawnViteBuildWatch(_0x3936e2){return new Promise((_0x42d02f,_0x3aa133)=>{const _0x1f6aa5=a189_0x5ad4,_0x16e36f=spawn(_0x1f6aa5(0x18d),[_0x1f6aa5(0x190),_0x1f6aa5(0x19e)],{'cwd':_0x3936e2,'stdio':_0x1f6aa5(0x178),'shell':!![],'env':{...process.env,'PATH':''+join(_0x3936e2,_0x1f6aa5(0x198),_0x1f6aa5(0x1a0))+delimiter+process.env.PATH}});_0x16e36f['on'](_0x1f6aa5(0x16c),_0x30f8e4=>{if(_0x30f8e4===0x0||_0x30f8e4===null)_0x42d02f();else _0x3aa133(new Error('vite\x20build\x20--watch\x20exited\x20with\x20code\x20'+_0x30f8e4));}),_0x16e36f['on'](_0x1f6aa5(0x18f),_0x3aa133);});}function spawnVitePreview(_0x433dec){return new Promise((_0x46aa3c,_0x56d628)=>{const _0x5c4bd3=a189_0x5ad4,_0x4034f0=spawn('vite',[_0x5c4bd3(0x18a)],{'cwd':_0x433dec,'stdio':_0x5c4bd3(0x178),'shell':!![],'env':{...process.env,'PATH':''+join(_0x433dec,_0x5c4bd3(0x198),_0x5c4bd3(0x1a0))+delimiter+process.env.PATH}});_0x4034f0['on'](_0x5c4bd3(0x16c),_0x26a1d9=>{const _0x42adaf=_0x5c4bd3;if(_0x26a1d9===0x0||_0x26a1d9===null)_0x46aa3c();else _0x56d628(new Error(_0x42adaf(0x180)+_0x26a1d9));}),_0x4034f0['on']('error',_0x56d628);});}const runFlags=[{'name':'watch','type':a189_0x5e10bb(0x17c),'description':a189_0x5e10bb(0x196),'default':![]}];export const runDefinition={'service':'run','command':a189_0x5e10bb(0x19f),'description':a189_0x5e10bb(0x185),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a189_0x5e10bb(0x174),'description':a189_0x5e10bb(0x183),'required':![]}],'flags':runFlags,'helpExtra':()=>{const _0xfbffeb=a189_0x5e10bb,_0x359d36=[];return _0x359d36['push']('\x20\x20EXAMPLES'),_0x359d36[_0xfbffeb(0x182)](_0xfbffeb(0x169)+CLI_BIN_NAME+'\x20run\x20start'),_0x359d36[_0xfbffeb(0x182)](_0xfbffeb(0x169)+CLI_BIN_NAME+_0xfbffeb(0x19a)),_0x359d36[_0xfbffeb(0x182)](_0xfbffeb(0x169)+CLI_BIN_NAME+'\x20run\x20preview'),_0x359d36[_0xfbffeb(0x182)]('\x20\x20\x20\x20'+CLI_BIN_NAME+'\x20run\x20preview\x20--watch'),_0x359d36[_0xfbffeb(0x17e)]('\x0a');},async 'execute'(_0x4d0b1c){const _0x173a56=a189_0x5e10bb,_0x246da4=process[_0x173a56(0x193)](),_0x379747=_0x4d0b1c[_0x173a56(0x187)][0x0],_0x14079f=_0x4d0b1c[_0x173a56(0x187)][_0x173a56(0x194)](0x1),_0xe41caa=readPackageScripts(_0x246da4);if(!_0xe41caa)throw CliErrors[_0x173a56(0x171)](_0x173a56(0x191));if(!_0x379747){const _0x48e191=Object[_0x173a56(0x19b)](_0xe41caa);if(_0x48e191[_0x173a56(0x1a1)]===0x0)console['log'](_0x173a56(0x197));else{console[_0x173a56(0x199)](_0x173a56(0x188));for(const _0x3c84a9 of _0x48e191){console['log'](_0x173a56(0x169)+_0x3c84a9);}console[_0x173a56(0x199)](_0x173a56(0x16e)+CLI_BIN_NAME+_0x173a56(0x186));}return{'ok':!![]};}if(!_0xe41caa[_0x379747])throw CliErrors[_0x173a56(0x171)](_0x173a56(0x177)+_0x379747+_0x173a56(0x17b),'Available:\x20'+(Object['keys'](_0xe41caa)[_0x173a56(0x17e)](',\x20')||_0x173a56(0x179)));const _0x4674c2=detectPackageManager(_0x246da4);VERSION_CHECK_SCRIPTS[_0x173a56(0x175)](_0x379747)&&await versionCheck(_0x246da4);if(_0x379747==='preview'&&_0x4d0b1c['bool'](_0x173a56(0x181)))return await Promise['all']([spawnViteBuildWatch(_0x246da4),spawnVitePreview(_0x246da4)]),{'ok':!![]};return await spawnScript(_0x4674c2,_0x379747,_0x14079f,_0x246da4),{'ok':!![]};}};
1
+ const a182_0x32456e=a182_0x17fb;function a182_0x17fb(_0x545fe1,_0x31ae0b){_0x545fe1=_0x545fe1-0xc6;const _0x3b1225=a182_0x3b12();let _0x17fb48=_0x3b1225[_0x545fe1];return _0x17fb48;}(function(_0x128598,_0x2df43a){const _0x1286f3=a182_0x17fb,_0x544e37=_0x128598();while(!![]){try{const _0x9445cf=parseInt(_0x1286f3(0xd0))/0x1+-parseInt(_0x1286f3(0xdb))/0x2+parseInt(_0x1286f3(0xed))/0x3+parseInt(_0x1286f3(0xfc))/0x4*(-parseInt(_0x1286f3(0xfb))/0x5)+-parseInt(_0x1286f3(0xc7))/0x6*(parseInt(_0x1286f3(0x100))/0x7)+-parseInt(_0x1286f3(0xef))/0x8+parseInt(_0x1286f3(0xd1))/0x9*(parseInt(_0x1286f3(0xec))/0xa);if(_0x9445cf===_0x2df43a)break;else _0x544e37['push'](_0x544e37['shift']());}catch(_0x29cea1){_0x544e37['push'](_0x544e37['shift']());}}}(a182_0x3b12,0x34a31));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{checkSdkVersion,printSdkUpgradeWarning}from'../../utils/check-sdk-version.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../utils/cli-version-check.js';const VERSION_CHECK_SCRIPTS=new Set(['start',a182_0x32456e(0xcd)]);function readPackageScripts(_0x1851a9){const _0x498a84=a182_0x32456e,_0x26ffe9=resolve(_0x1851a9,_0x498a84(0xf9));if(!existsSync(_0x26ffe9))return null;try{const _0x413dce=JSON[_0x498a84(0xf3)](readFileSync(_0x26ffe9,_0x498a84(0xda)));return _0x413dce[_0x498a84(0xf1)]??{};}catch{return null;}}function detectPackageManager(_0x1c85df){const _0x544b04=a182_0x32456e;if(existsSync(resolve(_0x1c85df,_0x544b04(0xe3)))||existsSync(resolve(_0x1c85df,_0x544b04(0xc9))))return _0x544b04(0xca);if(existsSync(resolve(_0x1c85df,_0x544b04(0xee))))return _0x544b04(0x101);if(existsSync(resolve(_0x1c85df,_0x544b04(0xe6))))return _0x544b04(0xe8);return _0x544b04(0xea);}async function versionCheck(_0x43ddc9){const _0x47b1bb=a182_0x32456e,_0x5314ab=await checkCliVersion();(_0x5314ab['needsUpgrade']||_0x5314ab[_0x47b1bb(0xe4)])&&(printCliUpgradeWarning(_0x5314ab),assertCliVersionSupported(_0x5314ab));const _0x59cdbf=await checkSdkVersion(_0x43ddc9);if(_0x59cdbf[_0x47b1bb(0xdc)])printSdkUpgradeWarning(_0x59cdbf);}function spawnScript(_0xe5532,_0x9d79f9,_0x5103c4,_0x5da7a2){return new Promise((_0x2a1d6a,_0x27af7f)=>{const _0x3abd20=a182_0x17fb,_0x1c5af7=[_0x3abd20(0xeb),_0x9d79f9,..._0x5103c4],_0x4ec41e=spawn(_0xe5532,_0x1c5af7,{'cwd':_0x5da7a2,'stdio':_0x3abd20(0xf6),'shell':!![],'env':{...process.env,'PATH':''+join(_0x5da7a2,'node_modules',_0x3abd20(0xf7))+delimiter+process.env.PATH}});_0x4ec41e['on'](_0x3abd20(0xce),_0xae1313=>{const _0x12b640=_0x3abd20;if(_0xae1313===0x0||_0xae1313===null)_0x2a1d6a();else _0x27af7f(new Error(_0xe5532+_0x12b640(0xc8)+_0x9d79f9+_0x12b640(0xcc)+_0xae1313));}),_0x4ec41e['on'](_0x3abd20(0xfa),_0x27af7f);});}function spawnViteBuildWatch(_0x4cd794){return new Promise((_0x2411fc,_0x2776c4)=>{const _0x8b6b18=a182_0x17fb,_0x4c7363=spawn(_0x8b6b18(0xd9),[_0x8b6b18(0xfe),'--watch'],{'cwd':_0x4cd794,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x4cd794,_0x8b6b18(0x102),_0x8b6b18(0xf7))+delimiter+process.env.PATH}});_0x4c7363['on']('close',_0x1c83d4=>{const _0x53646f=_0x8b6b18;if(_0x1c83d4===0x0||_0x1c83d4===null)_0x2411fc();else _0x2776c4(new Error(_0x53646f(0xfd)+_0x1c83d4));}),_0x4c7363['on'](_0x8b6b18(0xfa),_0x2776c4);});}function spawnVitePreview(_0x20b44a){return new Promise((_0x3284cc,_0x52e74e)=>{const _0x45b530=a182_0x17fb,_0x54cce2=spawn('vite',[_0x45b530(0xd4)],{'cwd':_0x20b44a,'stdio':_0x45b530(0xf6),'shell':!![],'env':{...process.env,'PATH':''+join(_0x20b44a,_0x45b530(0x102),_0x45b530(0xf7))+delimiter+process.env.PATH}});_0x54cce2['on']('close',_0x4e1258=>{const _0x155d37=_0x45b530;if(_0x4e1258===0x0||_0x4e1258===null)_0x3284cc();else _0x52e74e(new Error(_0x155d37(0xd2)+_0x4e1258));}),_0x54cce2['on'](_0x45b530(0xfa),_0x52e74e);});}function a182_0x3b12(){const _0xed009=['build','\x20\x20EXAMPLES','79583WhHdUW','pnpm','node_modules','bool','log','36nHGUrh','\x20run\x20','bun.lock','bun','\x22\x20not\x20found\x20in\x20package.json.','\x20exited\x20with\x20code\x20','dev','close','Enable\x20watch\x20mode\x20for\x20preview','244884qqgsiu','341316AbqUTW','vite\x20preview\x20exited\x20with\x20code\x20','has','preview','No\x20package.json\x20found\x20in\x20current\x20directory.','Run\x20a\x20package.json\x20script','Script\x20name\x20defined\x20in\x20package.json','Script\x20\x22','vite','utf-8','525852owzCHs','needsUpgrade','validation','(none)','\x20run\x20start','Available:\x20','slice','length','bun.lockb','belowMinimum','keys','yarn.lock','\x20\x20\x20\x20','yarn','join','npm','run','110pFdiuk','872427uwtrNu','pnpm-lock.yaml','862008TFtEON','boolean','scripts','push','parse','args','\x20run\x20build','inherit','.bin','\x0a\x20\x20Usage:\x20','package.json','error','1491825LPqJlM','4KuwywR','vite\x20build\x20--watch\x20exited\x20with\x20code\x20'];a182_0x3b12=function(){return _0xed009;};return a182_0x3b12();}const runFlags=[{'name':'watch','type':a182_0x32456e(0xf0),'description':a182_0x32456e(0xcf),'default':![]}];export const runDefinition={'service':a182_0x32456e(0xeb),'command':'run','description':a182_0x32456e(0xd6),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'script','description':a182_0x32456e(0xd7),'required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x39eeba=a182_0x32456e,_0x44b7d8=[];return _0x44b7d8[_0x39eeba(0xf2)](_0x39eeba(0xff)),_0x44b7d8[_0x39eeba(0xf2)](_0x39eeba(0xe7)+CLI_BIN_NAME+_0x39eeba(0xdf)),_0x44b7d8['push']('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x39eeba(0xf5)),_0x44b7d8['push']('\x20\x20\x20\x20'+CLI_BIN_NAME+'\x20run\x20preview'),_0x44b7d8[_0x39eeba(0xf2)](_0x39eeba(0xe7)+CLI_BIN_NAME+'\x20run\x20preview\x20--watch'),_0x44b7d8[_0x39eeba(0xe9)]('\x0a');},async 'execute'(_0x284fac){const _0x493917=a182_0x32456e,_0x501b55=process['cwd'](),_0x2f19fd=_0x284fac[_0x493917(0xf4)][0x0],_0x2442b9=_0x284fac['args'][_0x493917(0xe1)](0x1),_0x588b82=readPackageScripts(_0x501b55);if(!_0x588b82)throw CliErrors[_0x493917(0xdd)](_0x493917(0xd5));if(!_0x2f19fd){const _0x45445e=Object[_0x493917(0xe5)](_0x588b82);if(_0x45445e[_0x493917(0xe2)]===0x0)console['log']('No\x20scripts\x20defined\x20in\x20package.json.');else{console['log']('\x0a\x20\x20Available\x20scripts:\x0a');for(const _0x2a5774 of _0x45445e){console['log'](_0x493917(0xe7)+_0x2a5774);}console[_0x493917(0xc6)](_0x493917(0xf8)+CLI_BIN_NAME+'\x20run\x20<script>\x0a');}return{'ok':!![]};}if(!_0x588b82[_0x2f19fd])throw CliErrors['validation'](_0x493917(0xd8)+_0x2f19fd+_0x493917(0xcb),_0x493917(0xe0)+(Object[_0x493917(0xe5)](_0x588b82)['join'](',\x20')||_0x493917(0xde)));const _0x58b315=detectPackageManager(_0x501b55);VERSION_CHECK_SCRIPTS[_0x493917(0xd3)](_0x2f19fd)&&await versionCheck(_0x501b55);if(_0x2f19fd===_0x493917(0xd4)&&_0x284fac[_0x493917(0x103)]('watch'))return await Promise['all']([spawnViteBuildWatch(_0x501b55),spawnVitePreview(_0x501b55)]),{'ok':!![]};return await spawnScript(_0x58b315,_0x2f19fd,_0x2442b9,_0x501b55),{'ok':!![]};}};
@@ -1 +1 @@
1
- function a190_0x5228(){const _0x494c72=['json','5PgZaeV','630242jnVXei','schema','2940954JErjmy','99ZEWevw','2788748EGcZLE','3247782thkLvy','28384vuClxD','792tSoJdN','2phVbAl','export','3585281wmtKPH','1914690HyImGf'];a190_0x5228=function(){return _0x494c72;};return a190_0x5228();}const a190_0x291db9=a190_0x31c3;(function(_0x30f981,_0x108519){const _0x2e780f=a190_0x31c3,_0x5e19ae=_0x30f981();while(!![]){try{const _0x19dde9=-parseInt(_0x2e780f(0xc9))/0x1*(parseInt(_0x2e780f(0xc1))/0x2)+-parseInt(_0x2e780f(0xc3))/0x3+parseInt(_0x2e780f(0xc5))/0x4*(parseInt(_0x2e780f(0xc0))/0x5)+parseInt(_0x2e780f(0xc6))/0x6+-parseInt(_0x2e780f(0xcb))/0x7+parseInt(_0x2e780f(0xc7))/0x8*(-parseInt(_0x2e780f(0xc8))/0x9)+-parseInt(_0x2e780f(0xbe))/0xa*(-parseInt(_0x2e780f(0xc4))/0xb);if(_0x19dde9===_0x108519)break;else _0x5e19ae['push'](_0x5e19ae['shift']());}catch(_0x2d9b92){_0x5e19ae['push'](_0x5e19ae['shift']());}}}(a190_0x5228,0x80992));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x47c93a){const _0x44c2e5=await buildSchemaPayload();return{'ok':!![],'data':_0x44c2e5};}function a190_0x31c3(_0x52d74b,_0x3e2139){_0x52d74b=_0x52d74b-0xbe;const _0x522837=a190_0x5228();let _0x31c3e3=_0x522837[_0x52d74b];return _0x31c3e3;}export const schemaDefinition={'service':a190_0x291db9(0xc2),'command':a190_0x291db9(0xca),'description':'Export\x20machine-readable\x20command\x20schema\x20(JSON)','risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a190_0x291db9(0xbf),'flags':[],'execute':execute};
1
+ const a183_0x54398a=a183_0x5de8;function a183_0x5de8(_0x3633b0,_0x31cd9b){_0x3633b0=_0x3633b0-0x179;const _0x29f51a=a183_0x29f5();let _0x5de852=_0x29f51a[_0x3633b0];return _0x5de852;}(function(_0xd379fb,_0x4c15fa){const _0x1fe2d6=a183_0x5de8,_0x527f97=_0xd379fb();while(!![]){try{const _0x5451b5=parseInt(_0x1fe2d6(0x17e))/0x1+-parseInt(_0x1fe2d6(0x179))/0x2*(parseInt(_0x1fe2d6(0x185))/0x3)+-parseInt(_0x1fe2d6(0x186))/0x4*(parseInt(_0x1fe2d6(0x182))/0x5)+-parseInt(_0x1fe2d6(0x17a))/0x6+-parseInt(_0x1fe2d6(0x188))/0x7*(parseInt(_0x1fe2d6(0x183))/0x8)+parseInt(_0x1fe2d6(0x17d))/0x9*(-parseInt(_0x1fe2d6(0x180))/0xa)+-parseInt(_0x1fe2d6(0x184))/0xb*(-parseInt(_0x1fe2d6(0x181))/0xc);if(_0x5451b5===_0x4c15fa)break;else _0x527f97['push'](_0x527f97['shift']());}catch(_0x54aa30){_0x527f97['push'](_0x527f97['shift']());}}}(a183_0x29f5,0x3455a));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x1ac8ba){const _0x7be8e0=await buildSchemaPayload();return{'ok':!![],'data':_0x7be8e0};}export const schemaDefinition={'service':a183_0x54398a(0x187),'command':a183_0x54398a(0x17c),'description':a183_0x54398a(0x17b),'risk':a183_0x54398a(0x17f),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':'json','flags':[],'execute':execute};function a183_0x29f5(){const _0x2493f1=['schema','7EKrLlD','2zVWQEe','563190zGsSbc','Export\x20machine-readable\x20command\x20schema\x20(JSON)','export','2907HEXgDK','308544TaNlsj','read','10340jQCWpD','108eMCvUb','20zBmOCa','574816Yfjpdr','958133zyYvft','728634aemKzq','135532HvzAKn'];a183_0x29f5=function(){return _0x2493f1;};return a183_0x29f5();}
@@ -1 +1 @@
1
- const a191_0x12aca0=a191_0x1695;(function(_0x46ea70,_0x4e4022){const _0x2053d2=a191_0x1695,_0x180c00=_0x46ea70();while(!![]){try{const _0x230b8a=parseInt(_0x2053d2(0x1a6))/0x1*(parseInt(_0x2053d2(0x1a8))/0x2)+-parseInt(_0x2053d2(0x1b8))/0x3+-parseInt(_0x2053d2(0x175))/0x4*(parseInt(_0x2053d2(0x17a))/0x5)+-parseInt(_0x2053d2(0x191))/0x6*(parseInt(_0x2053d2(0x176))/0x7)+-parseInt(_0x2053d2(0x18d))/0x8+parseInt(_0x2053d2(0x1a5))/0x9*(parseInt(_0x2053d2(0x1a9))/0xa)+parseInt(_0x2053d2(0x179))/0xb;if(_0x230b8a===_0x4e4022)break;else _0x180c00['push'](_0x180c00['shift']());}catch(_0x13f340){_0x180c00['push'](_0x180c00['shift']());}}}(a191_0x21c9,0xd0d8f));import{writeFile}from'node:fs/promises';import{input,select}from'@inquirer/prompts';import{createSqlQuery}from'../../core/api-client.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';function a191_0x21c9(){const _0x37d402=['length','str','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','lockFilePath','validation','请输入\x20SQL\x20名称:','name','7392208RtSHdM','join','dbName','请选择本地\x20SQL\x20模式:','18voQvCa','</select>','db-id','File\x20already\x20exists:\x20','catch','sqlRoot','dbId','sqlRootDir','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','sqlName','dbId\x20必须为正整数','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','isInteger','mode','/smartapi/custom/saveUserCustomSql','description','\x20\x20SELECT\x201\x20AS\x20id','__manual__','create','4050CmfzJN','2549SQYzgU','appCode','8HqdOed','3690RRolpI','utf8','SQL\x20名称不能为空','请输入目标数据库\x20dbId:','请选择目标数据库:','sqlCode','trim','MyBatis\x20XML(mybatisXml)','string','parse','Created\x20SQL\x20query\x20','Local\x20SQL\x20file\x20mode','普通\x20SQL(sql)','toISOString','Invalid\x20database\x20selection\x20payload:\x20','4566051eLpyaN','1324CaSujr','387611xqtdbC','map','nonInteractive','53321246bUctur','23505uLuVsK','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','POST','sql','flagMissing','dbId\x20不能为空','flag','mybatisXml','isFinite','<server-generated-sqlCode>','SQL\x20query\x20display\x20name','number'];a191_0x21c9=function(){return _0x37d402;};return a191_0x21c9();}function a191_0x1695(_0x35b219,_0x2d7c06){_0x35b219=_0x35b219-0x175;const _0x21c9de=a191_0x21c9();let _0x169511=_0x21c9de[_0x35b219];return _0x169511;}import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{buildSqlRelativePath}from'../../core/sql-sync/utils.js';import{CliErrors}from'../../errors.js';import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function generateSqlTemplate(_0x2e2f09){const _0x1ed679=a191_0x1695;if(_0x2e2f09===_0x1ed679(0x181))return[_0x1ed679(0x19a),_0x1ed679(0x1a2),_0x1ed679(0x192),'']['join']('\x0a');return['SELECT\x201\x20AS\x20id;',''][_0x1ed679(0x18e)]('\x0a');}export const sqlCreate={'service':a191_0x12aca0(0x17d),'command':a191_0x12aca0(0x1a4),'description':a191_0x12aca0(0x19d),'risk':'write','flags':[{'name':'name','type':a191_0x12aca0(0x1b1),'description':a191_0x12aca0(0x184)},{'name':'db-id','type':a191_0x12aca0(0x185),'description':'Target\x20database\x20ID'},{'name':'mode','type':'string','enum':[a191_0x12aca0(0x17d),a191_0x12aca0(0x181)],'description':a191_0x12aca0(0x1b4)}],async 'validate'(_0x5a8ea4){const _0x2fe0d8=a191_0x12aca0;if(!_0x5a8ea4[_0x2fe0d8(0x178)])return;if(!_0x5a8ea4['str']('name')[_0x2fe0d8(0x1af)]())throw CliErrors[_0x2fe0d8(0x17e)](_0x2fe0d8(0x18c),_0x2fe0d8(0x188));const _0x4fc9c7=resolveProvidedDbId(_0x5a8ea4);if(typeof _0x4fc9c7!==_0x2fe0d8(0x185)||!Number[_0x2fe0d8(0x182)](_0x4fc9c7)||_0x4fc9c7<=0x0)throw CliErrors[_0x2fe0d8(0x17e)](_0x2fe0d8(0x193),'--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.');if(!_0x5a8ea4[_0x2fe0d8(0x187)](_0x2fe0d8(0x19f))['trim']())throw CliErrors['flagMissing'](_0x2fe0d8(0x19f),'--mode\x20is\x20required\x20in\x20non-interactive\x20mode.');},async 'dryRun'(_0x41eb76){const _0x588c70=a191_0x12aca0,_0x5224f2=loadSqlProjectConfig(_0x41eb76[_0x588c70(0x1a7)]),{sqlName:_0x3286a,dbId:_0x5da765,dbName:_0x596dce,mode:_0x33f0ce}=await resolveSqlNewInputs(_0x41eb76),_0x1f46dd=buildSqlRelativePath(_0x588c70(0x183),_0x3286a,_0x596dce,_0x33f0ce,_0x5da765),_0x315680=_0x5224f2['sqlRootDir']+'/'+_0x1f46dd;return{'method':_0x588c70(0x17c),'url':_0x588c70(0x1a0),'body':{'appCode':_0x41eb76[_0x588c70(0x1a7)],'sqlName':_0x3286a,'dbId':_0x5da765,'mode':_0x33f0ce,'localPath':_0x315680},'description':_0x588c70(0x17b)+_0x5224f2[_0x588c70(0x198)]};},async 'execute'(_0x23297e){const _0x4cc5b2=a191_0x12aca0,_0x130d9e=loadSqlProjectConfig(_0x23297e[_0x4cc5b2(0x1a7)]),{sqlName:_0x1740be,dbId:_0x5a1ab0,dbName:_0x568514,mode:_0x104711}=await resolveSqlNewInputs(_0x23297e),_0x12b094=generateSqlTemplate(_0x104711),_0x3bc93f=await createSqlQuery({'appCode':_0x23297e['appCode'],'sqlName':_0x1740be,'dbId':_0x5a1ab0,'sqlContent':_0x12b094}),_0x2a74ca=ensureRemoteSqlContent(_0x3bc93f),_0x48d189=_0x568514||await getDbName(_0x23297e[_0x4cc5b2(0x1a7)],_0x5a1ab0)['catch'](()=>undefined),_0x348080=buildSqlRelativePath(_0x3bc93f['sqlCode'],_0x3bc93f[_0x4cc5b2(0x19b)],_0x48d189,_0x104711,_0x5a1ab0),_0x1e4441=_0x130d9e[_0x4cc5b2(0x198)]+'/'+_0x348080,_0x26f556=buildLocalSqlFileContent({'sqlCode':_0x3bc93f[_0x4cc5b2(0x1ae)],'sqlName':_0x3bc93f[_0x4cc5b2(0x19b)],'dbId':_0x3bc93f[_0x4cc5b2(0x197)]},_0x2a74ca,{'dbName':_0x48d189,'mode':_0x104711,'syncedAt':new Date()[_0x4cc5b2(0x1b6)](),'description':_0x3bc93f[_0x4cc5b2(0x1a1)]});if(await fileExists(_0x1e4441))throw CliErrors['validation'](_0x4cc5b2(0x194)+_0x1e4441);await ensureParentDirectory(_0x1e4441),await writeFile(_0x1e4441,_0x26f556,_0x4cc5b2(0x1aa));const _0x157b5e=await readSqlLockFile(_0x130d9e[_0x4cc5b2(0x189)]),{lockData:_0x5051bf,appLock:_0x4e8216}=ensureSqlLockScope(_0x157b5e??createEmptySqlLock(),_0x130d9e[_0x4cc5b2(0x1a7)],_0x130d9e[_0x4cc5b2(0x196)],'new');return _0x4e8216['sqls'][_0x3bc93f[_0x4cc5b2(0x1ae)]]={...buildSqlLockEntry(_0x3bc93f,_0x2a74ca,computeSqlContentHash(_0x26f556),{'dbName':_0x48d189}),'path':_0x348080,'mode':_0x104711},_0x4e8216['lastSync']=new Date()[_0x4cc5b2(0x1b6)](),await writeSqlLockFile(_0x130d9e[_0x4cc5b2(0x189)],_0x5051bf),{'ok':!![],'data':{'id':_0x3bc93f['id'],'sqlCode':_0x3bc93f['sqlCode'],'sqlName':_0x3bc93f[_0x4cc5b2(0x19b)],'dbId':_0x3bc93f[_0x4cc5b2(0x197)],'path':_0x1e4441,'mode':_0x104711},'message':_0x4cc5b2(0x1b3)+_0x3bc93f[_0x4cc5b2(0x1ae)]};}};async function resolveSqlNewInputs(_0x32a74d){const _0x3f5f65=await resolveSqlNameInput(_0x32a74d),{dbId:_0x16a194,dbName:_0x1df74a}=await resolveDbSelection(_0x32a74d),_0x123334=await resolveSqlModeInput(_0x32a74d);return{'sqlName':_0x3f5f65,'dbId':_0x16a194,'dbName':_0x1df74a,'mode':_0x123334};}async function resolveSqlNameInput(_0x25c935){const _0x447dd4=a191_0x12aca0,_0x32e51a=_0x25c935[_0x447dd4(0x187)]('name')[_0x447dd4(0x1af)]();if(_0x32e51a)return _0x32e51a;if(_0x25c935[_0x447dd4(0x178)])throw CliErrors[_0x447dd4(0x17e)](_0x447dd4(0x18c),'--name\x20is\x20required\x20in\x20non-interactive\x20mode.');return(await input({'message':_0x447dd4(0x18b),'validate':_0x38b99d=>_0x38b99d[_0x447dd4(0x1af)]()?!![]:_0x447dd4(0x1ab)}))[_0x447dd4(0x1af)]();}async function resolveDbSelection(_0x33eed5){const _0x17cadb=a191_0x12aca0,_0x2b7a69=resolveProvidedDbId(_0x33eed5);if(typeof _0x2b7a69==='number'&&Number[_0x17cadb(0x182)](_0x2b7a69)&&_0x2b7a69>0x0)return{'dbId':_0x2b7a69,'dbName':await getDbName(_0x33eed5[_0x17cadb(0x1a7)],_0x2b7a69)['catch'](()=>undefined)};if(_0x33eed5[_0x17cadb(0x178)])throw CliErrors['flagMissing']('db-id','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.');const _0x44b2d0=await listDatabases(_0x33eed5[_0x17cadb(0x1a7)])[_0x17cadb(0x195)](()=>[]);if(_0x44b2d0[_0x17cadb(0x186)]===0x1)return{'dbId':_0x44b2d0[0x0][_0x17cadb(0x197)],'dbName':_0x44b2d0[0x0][_0x17cadb(0x18f)]};if(_0x44b2d0[_0x17cadb(0x186)]>0x1){const _0x3fda32=await select({'message':_0x17cadb(0x1ad),'choices':[..._0x44b2d0[_0x17cadb(0x177)](_0x5238e3=>({'name':_0x5238e3[_0x17cadb(0x18f)]+'\x20('+_0x5238e3[_0x17cadb(0x197)]+')','value':serializeDbSelection(_0x5238e3)})),{'name':'✎\x20手动输入\x20dbId','value':_0x17cadb(0x1a3)}]});if(_0x3fda32!==_0x17cadb(0x1a3))return deserializeDbSelection(_0x3fda32);}const _0x4e008e=await input({'message':_0x17cadb(0x1ac),'validate':_0x2319a8=>{const _0x16de84=_0x17cadb,_0x4649dd=_0x2319a8['trim']();if(!_0x4649dd)return _0x16de84(0x17f);const _0x47c8de=Number(_0x4649dd);if(!Number[_0x16de84(0x19e)](_0x47c8de)||_0x47c8de<=0x0)return _0x16de84(0x19c);return!![];}});return{'dbId':Number(_0x4e008e['trim']())};}async function resolveSqlModeInput(_0x21ac8b){const _0x33aa70=a191_0x12aca0,_0xec6789=_0x21ac8b[_0x33aa70(0x187)](_0x33aa70(0x19f))[_0x33aa70(0x1af)]();if(_0xec6789===_0x33aa70(0x17d)||_0xec6789==='mybatisXml')return _0xec6789;if(_0x21ac8b[_0x33aa70(0x178)])throw CliErrors[_0x33aa70(0x17e)](_0x33aa70(0x19f),_0x33aa70(0x199));return await select({'message':_0x33aa70(0x190),'choices':[{'name':_0x33aa70(0x1b5),'value':_0x33aa70(0x17d),'description':'适合直接执行的普通\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20语句'},{'name':_0x33aa70(0x1b0),'value':_0x33aa70(0x181),'description':'适合带动态标签的\x20MyBatis\x20XML\x20SQL'}]});}function serializeDbSelection(_0x9dcdd2){const _0x36c90c=a191_0x12aca0;return JSON['stringify']({'dbId':_0x9dcdd2[_0x36c90c(0x197)],'dbName':_0x9dcdd2[_0x36c90c(0x18f)]});}function deserializeDbSelection(_0x169085){const _0x4f651d=a191_0x12aca0;try{const _0x696fb0=JSON[_0x4f651d(0x1b2)](_0x169085);if(typeof _0x696fb0[_0x4f651d(0x197)]===_0x4f651d(0x185)&&Number[_0x4f651d(0x182)](_0x696fb0[_0x4f651d(0x197)]))return{'dbId':_0x696fb0['dbId'],'dbName':_0x696fb0[_0x4f651d(0x18f)]};}catch{}throw CliErrors[_0x4f651d(0x18a)](_0x4f651d(0x1b7)+_0x169085);}function resolveProvidedDbId(_0x30d0d3){const _0x21bae2=a191_0x12aca0,_0xdabe5b=_0x30d0d3[_0x21bae2(0x180)](_0x21bae2(0x193));if(typeof _0xdabe5b===_0x21bae2(0x185)&&Number[_0x21bae2(0x182)](_0xdabe5b))return _0xdabe5b;return undefined;}
1
+ const a184_0x44e3c3=a184_0x523b;(function(_0x721429,_0xe1c677){const _0xc9335a=a184_0x523b,_0x4be76a=_0x721429();while(!![]){try{const _0x1e32a1=-parseInt(_0xc9335a(0x18d))/0x1+parseInt(_0xc9335a(0x1a7))/0x2*(-parseInt(_0xc9335a(0x19e))/0x3)+parseInt(_0xc9335a(0x18b))/0x4*(parseInt(_0xc9335a(0x182))/0x5)+-parseInt(_0xc9335a(0x17d))/0x6*(parseInt(_0xc9335a(0x1af))/0x7)+parseInt(_0xc9335a(0x171))/0x8*(-parseInt(_0xc9335a(0x1b8))/0x9)+-parseInt(_0xc9335a(0x1ab))/0xa*(parseInt(_0xc9335a(0x1a1))/0xb)+parseInt(_0xc9335a(0x1b4))/0xc;if(_0x1e32a1===_0xe1c677)break;else _0x4be76a['push'](_0x4be76a['shift']());}catch(_0x4a9cc1){_0x4be76a['push'](_0x4be76a['shift']());}}}(a184_0x23c5,0x756a8));import{writeFile}from'node:fs/promises';import{input,select}from'@inquirer/prompts';import{createSqlQuery}from'../../core/api-client.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{buildSqlRelativePath}from'../../core/sql-sync/utils.js';import{CliErrors}from'../../errors.js';import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function a184_0x23c5(){const _0xb82db7=['new','description','Created\x20SQL\x20query\x20','appCode','join','str','dbId','utf8','nonInteractive','2517MYmgwT','Invalid\x20database\x20selection\x20payload:\x20','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','615989mleLJU','mybatisXml','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','/smartapi/custom/saveUserCustomSql','create','isFinite','8DoHhWp','dbName','\x20\x20SELECT\x201\x20AS\x20id','toISOString','110hzZvZS','catch','<server-generated-sqlCode>','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','14FDADoZ','dbId\x20不能为空','lastSync','parse','sql','18836472xSEDca','write','请输入\x20SQL\x20名称:','flag','9kObaRt','719712lJqLpF','number','__manual__','SELECT\x201\x20AS\x20id;','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','请选择目标数据库:','dbId\x20必须为正整数','请输入目标数据库\x20dbId:','POST','mode','db-id','name','116658skScbI','flagMissing','sqlRootDir','string','MyBatis\x20XML(mybatisXml)','195enrZeY','</select>','Target\x20database\x20ID','sqls','sqlCode','适合带动态标签的\x20MyBatis\x20XML\x20SQL','普通\x20SQL(sql)','validation','lockFilePath','30676VqlTfw','SQL\x20query\x20display\x20name','639666CFqOqB','sqlName','isInteger','trim','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','sqlRoot','请选择本地\x20SQL\x20模式:'];a184_0x23c5=function(){return _0xb82db7;};return a184_0x23c5();}function generateSqlTemplate(_0x1d02c2){const _0x5bd27e=a184_0x523b;if(_0x1d02c2===_0x5bd27e(0x1a2))return[_0x5bd27e(0x191),_0x5bd27e(0x1a9),_0x5bd27e(0x183),''][_0x5bd27e(0x199)]('\x0a');return[_0x5bd27e(0x174),''][_0x5bd27e(0x199)]('\x0a');}export const sqlCreate={'service':a184_0x44e3c3(0x1b3),'command':a184_0x44e3c3(0x1a5),'description':a184_0x44e3c3(0x1a3),'risk':a184_0x44e3c3(0x1b5),'flags':[{'name':'name','type':a184_0x44e3c3(0x180),'description':a184_0x44e3c3(0x18c)},{'name':a184_0x44e3c3(0x17b),'type':'number','description':a184_0x44e3c3(0x184)},{'name':a184_0x44e3c3(0x17a),'type':'string','enum':['sql',a184_0x44e3c3(0x1a2)],'description':'Local\x20SQL\x20file\x20mode'}],async 'validate'(_0x3b89bc){const _0x3a99a4=a184_0x44e3c3;if(!_0x3b89bc[_0x3a99a4(0x19d)])return;if(!_0x3b89bc['str'](_0x3a99a4(0x17c))[_0x3a99a4(0x190)]())throw CliErrors[_0x3a99a4(0x17e)](_0x3a99a4(0x17c),'--name\x20is\x20required\x20in\x20non-interactive\x20mode.');const _0x2e54b7=resolveProvidedDbId(_0x3b89bc);if(typeof _0x2e54b7!==_0x3a99a4(0x172)||!Number['isFinite'](_0x2e54b7)||_0x2e54b7<=0x0)throw CliErrors['flagMissing'](_0x3a99a4(0x17b),'--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.');if(!_0x3b89bc[_0x3a99a4(0x19a)](_0x3a99a4(0x17a))['trim']())throw CliErrors[_0x3a99a4(0x17e)](_0x3a99a4(0x17a),_0x3a99a4(0x1ae));},async 'dryRun'(_0x102e8a){const _0x51895d=a184_0x44e3c3,_0x198f4f=loadSqlProjectConfig(_0x102e8a[_0x51895d(0x198)]),{sqlName:_0x611ba0,dbId:_0x54bb4b,dbName:_0xdb4ac6,mode:_0x39fc07}=await resolveSqlNewInputs(_0x102e8a),_0x56abce=buildSqlRelativePath(_0x51895d(0x1ad),_0x611ba0,_0xdb4ac6,_0x39fc07,_0x54bb4b),_0x5117e8=_0x198f4f['sqlRootDir']+'/'+_0x56abce;return{'method':_0x51895d(0x179),'url':_0x51895d(0x1a4),'body':{'appCode':_0x102e8a['appCode'],'sqlName':_0x611ba0,'dbId':_0x54bb4b,'mode':_0x39fc07,'localPath':_0x5117e8},'description':_0x51895d(0x1a0)+_0x198f4f[_0x51895d(0x17f)]};},async 'execute'(_0x1d42be){const _0x4df7c0=a184_0x44e3c3,_0x2ada7e=loadSqlProjectConfig(_0x1d42be[_0x4df7c0(0x198)]),{sqlName:_0xc9da,dbId:_0x57d5c7,dbName:_0x4ba92c,mode:_0x2f79d3}=await resolveSqlNewInputs(_0x1d42be),_0x405d14=generateSqlTemplate(_0x2f79d3),_0x3cb817=await createSqlQuery({'appCode':_0x1d42be[_0x4df7c0(0x198)],'sqlName':_0xc9da,'dbId':_0x57d5c7,'sqlContent':_0x405d14}),_0x3331a0=ensureRemoteSqlContent(_0x3cb817),_0x32093f=_0x4ba92c||await getDbName(_0x1d42be[_0x4df7c0(0x198)],_0x57d5c7)[_0x4df7c0(0x1ac)](()=>undefined),_0x38eadb=buildSqlRelativePath(_0x3cb817['sqlCode'],_0x3cb817[_0x4df7c0(0x18e)],_0x32093f,_0x2f79d3,_0x57d5c7),_0x56bf12=_0x2ada7e['sqlRootDir']+'/'+_0x38eadb,_0x15994f=buildLocalSqlFileContent({'sqlCode':_0x3cb817[_0x4df7c0(0x186)],'sqlName':_0x3cb817[_0x4df7c0(0x18e)],'dbId':_0x3cb817[_0x4df7c0(0x19b)]},_0x3331a0,{'dbName':_0x32093f,'mode':_0x2f79d3,'syncedAt':new Date()['toISOString'](),'description':_0x3cb817[_0x4df7c0(0x196)]});if(await fileExists(_0x56bf12))throw CliErrors[_0x4df7c0(0x189)]('File\x20already\x20exists:\x20'+_0x56bf12);await ensureParentDirectory(_0x56bf12),await writeFile(_0x56bf12,_0x15994f,_0x4df7c0(0x19c));const _0x5419ec=await readSqlLockFile(_0x2ada7e[_0x4df7c0(0x18a)]),{lockData:_0x293f1b,appLock:_0x462c8e}=ensureSqlLockScope(_0x5419ec??createEmptySqlLock(),_0x2ada7e[_0x4df7c0(0x198)],_0x2ada7e[_0x4df7c0(0x193)],_0x4df7c0(0x195));return _0x462c8e[_0x4df7c0(0x185)][_0x3cb817[_0x4df7c0(0x186)]]={...buildSqlLockEntry(_0x3cb817,_0x3331a0,computeSqlContentHash(_0x15994f),{'dbName':_0x32093f}),'path':_0x38eadb,'mode':_0x2f79d3},_0x462c8e[_0x4df7c0(0x1b1)]=new Date()[_0x4df7c0(0x1aa)](),await writeSqlLockFile(_0x2ada7e[_0x4df7c0(0x18a)],_0x293f1b),{'ok':!![],'data':{'id':_0x3cb817['id'],'sqlCode':_0x3cb817[_0x4df7c0(0x186)],'sqlName':_0x3cb817[_0x4df7c0(0x18e)],'dbId':_0x3cb817[_0x4df7c0(0x19b)],'path':_0x56bf12,'mode':_0x2f79d3},'message':_0x4df7c0(0x197)+_0x3cb817[_0x4df7c0(0x186)]};}};function a184_0x523b(_0x39fb1e,_0x15573f){_0x39fb1e=_0x39fb1e-0x171;const _0x23c5a0=a184_0x23c5();let _0x523bcd=_0x23c5a0[_0x39fb1e];return _0x523bcd;}async function resolveSqlNewInputs(_0xe196ba){const _0x466f56=await resolveSqlNameInput(_0xe196ba),{dbId:_0x26c91b,dbName:_0x31e34d}=await resolveDbSelection(_0xe196ba),_0x4d519e=await resolveSqlModeInput(_0xe196ba);return{'sqlName':_0x466f56,'dbId':_0x26c91b,'dbName':_0x31e34d,'mode':_0x4d519e};}async function resolveSqlNameInput(_0x3e7dc8){const _0x1ecccb=a184_0x44e3c3,_0x5b8e08=_0x3e7dc8[_0x1ecccb(0x19a)](_0x1ecccb(0x17c))[_0x1ecccb(0x190)]();if(_0x5b8e08)return _0x5b8e08;if(_0x3e7dc8[_0x1ecccb(0x19d)])throw CliErrors[_0x1ecccb(0x17e)](_0x1ecccb(0x17c),_0x1ecccb(0x192));return(await input({'message':_0x1ecccb(0x1b6),'validate':_0x4bd12c=>_0x4bd12c[_0x1ecccb(0x190)]()?!![]:'SQL\x20名称不能为空'}))[_0x1ecccb(0x190)]();}async function resolveDbSelection(_0x5cfb8f){const _0x1d6bab=a184_0x44e3c3,_0x58b280=resolveProvidedDbId(_0x5cfb8f);if(typeof _0x58b280===_0x1d6bab(0x172)&&Number[_0x1d6bab(0x1a6)](_0x58b280)&&_0x58b280>0x0)return{'dbId':_0x58b280,'dbName':await getDbName(_0x5cfb8f[_0x1d6bab(0x198)],_0x58b280)[_0x1d6bab(0x1ac)](()=>undefined)};if(_0x5cfb8f[_0x1d6bab(0x19d)])throw CliErrors['flagMissing'](_0x1d6bab(0x17b),_0x1d6bab(0x175));const _0x53d063=await listDatabases(_0x5cfb8f[_0x1d6bab(0x198)])[_0x1d6bab(0x1ac)](()=>[]);if(_0x53d063['length']===0x1)return{'dbId':_0x53d063[0x0][_0x1d6bab(0x19b)],'dbName':_0x53d063[0x0]['dbName']};if(_0x53d063['length']>0x1){const _0x203329=await select({'message':_0x1d6bab(0x176),'choices':[..._0x53d063['map'](_0x4986b1=>({'name':_0x4986b1[_0x1d6bab(0x1a8)]+'\x20('+_0x4986b1[_0x1d6bab(0x19b)]+')','value':serializeDbSelection(_0x4986b1)})),{'name':'✎\x20手动输入\x20dbId','value':_0x1d6bab(0x173)}]});if(_0x203329!==_0x1d6bab(0x173))return deserializeDbSelection(_0x203329);}const _0x3290a0=await input({'message':_0x1d6bab(0x178),'validate':_0xadbc00=>{const _0x173a17=_0x1d6bab,_0xf798ec=_0xadbc00[_0x173a17(0x190)]();if(!_0xf798ec)return _0x173a17(0x1b0);const _0x426465=Number(_0xf798ec);if(!Number[_0x173a17(0x18f)](_0x426465)||_0x426465<=0x0)return _0x173a17(0x177);return!![];}});return{'dbId':Number(_0x3290a0['trim']())};}async function resolveSqlModeInput(_0x5c202e){const _0x3ce1d6=a184_0x44e3c3,_0x99e225=_0x5c202e[_0x3ce1d6(0x19a)]('mode')[_0x3ce1d6(0x190)]();if(_0x99e225===_0x3ce1d6(0x1b3)||_0x99e225===_0x3ce1d6(0x1a2))return _0x99e225;if(_0x5c202e[_0x3ce1d6(0x19d)])throw CliErrors[_0x3ce1d6(0x17e)](_0x3ce1d6(0x17a),_0x3ce1d6(0x1ae));return await select({'message':_0x3ce1d6(0x194),'choices':[{'name':_0x3ce1d6(0x188),'value':_0x3ce1d6(0x1b3),'description':'适合直接执行的普通\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20语句'},{'name':_0x3ce1d6(0x181),'value':_0x3ce1d6(0x1a2),'description':_0x3ce1d6(0x187)}]});}function serializeDbSelection(_0x559d60){const _0x2603d6=a184_0x44e3c3;return JSON['stringify']({'dbId':_0x559d60[_0x2603d6(0x19b)],'dbName':_0x559d60['dbName']});}function deserializeDbSelection(_0x9932d3){const _0x3526f3=a184_0x44e3c3;try{const _0x2fc331=JSON[_0x3526f3(0x1b2)](_0x9932d3);if(typeof _0x2fc331['dbId']===_0x3526f3(0x172)&&Number[_0x3526f3(0x1a6)](_0x2fc331[_0x3526f3(0x19b)]))return{'dbId':_0x2fc331['dbId'],'dbName':_0x2fc331[_0x3526f3(0x1a8)]};}catch{}throw CliErrors[_0x3526f3(0x189)](_0x3526f3(0x19f)+_0x9932d3);}function resolveProvidedDbId(_0x3b3be3){const _0x337d9a=a184_0x44e3c3,_0x5ebb42=_0x3b3be3[_0x337d9a(0x1b7)](_0x337d9a(0x17b));if(typeof _0x5ebb42==='number'&&Number[_0x337d9a(0x1a6)](_0x5ebb42))return _0x5ebb42;return undefined;}
@@ -1 +1 @@
1
- const a192_0x1f8781=a192_0x416e;(function(_0x444e6f,_0x17184d){const _0x2a2db8=a192_0x416e,_0x4d6b83=_0x444e6f();while(!![]){try{const _0x489cec=-parseInt(_0x2a2db8(0x78))/0x1*(-parseInt(_0x2a2db8(0x6b))/0x2)+parseInt(_0x2a2db8(0x82))/0x3+-parseInt(_0x2a2db8(0x75))/0x4*(-parseInt(_0x2a2db8(0x6f))/0x5)+-parseInt(_0x2a2db8(0x74))/0x6*(parseInt(_0x2a2db8(0x81))/0x7)+parseInt(_0x2a2db8(0x7f))/0x8+parseInt(_0x2a2db8(0x87))/0x9+-parseInt(_0x2a2db8(0x6e))/0xa*(parseInt(_0x2a2db8(0x84))/0xb);if(_0x489cec===_0x17184d)break;else _0x4d6b83['push'](_0x4d6b83['shift']());}catch(_0x21a9ee){_0x4d6b83['push'](_0x4d6b83['shift']());}}}(a192_0xb2b3,0x2ae0c));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{fileExists}from'../../core/bff/file-system.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a192_0x416e(_0xf2cbe6,_0x246daf){_0xf2cbe6=_0xf2cbe6-0x69;const _0xb2b31f=a192_0xb2b3();let _0x416e3a=_0xb2b31f[_0xf2cbe6];return _0x416e3a;}export const sqlDelete={'service':a192_0x1f8781(0x6c),'command':a192_0x1f8781(0x88),'description':a192_0x1f8781(0x7e),'risk':a192_0x1f8781(0x6d),'flags':[SQLCODE_FLAG],async 'validate'(_0x2394f0){const _0x39d13e=a192_0x1f8781,_0x3c533c=loadSqlProjectConfig(_0x2394f0['appCode']),_0x1e206f=await readSqlLockFile(_0x3c533c[_0x39d13e(0x76)]);if(!_0x1e206f)throw CliErrors['validation'](_0x39d13e(0x72));},async 'dryRun'(_0xdb20a8){const _0x547dc8=a192_0x1f8781,_0x56bbb9=loadSqlProjectConfig(_0xdb20a8[_0x547dc8(0x6a)]),_0x46a7fe=await readSqlLockFile(_0x56bbb9[_0x547dc8(0x76)]);if(!_0x46a7fe)throw CliErrors['validation']('SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.');const {appLock:_0x5f3f62}=ensureSqlLockScope(_0x46a7fe,_0xdb20a8[_0x547dc8(0x6a)],_0x56bbb9[_0x547dc8(0x79)],_0x547dc8(0x88)),_0x54891a=_0xdb20a8[_0x547dc8(0x69)](_0x547dc8(0x80)),_0x1b622a=_0x5f3f62[_0x547dc8(0x86)][_0x54891a];if(!_0x1b622a)throw CliErrors[_0x547dc8(0x7d)](_0x547dc8(0x83)+_0x54891a+'\x22.');return{'method':_0x547dc8(0x89),'url':'/smartapi/custom/deleteUserCustomSql','body':{'sqlCode':_0x54891a,'id':_0x1b622a[_0x547dc8(0x70)],'localPath':resolveLocalSqlFilePath(_0x56bbb9,_0x54891a,_0x1b622a)},'description':_0x547dc8(0x8a)+_0x54891a+_0x547dc8(0x7c)+_0x56bbb9[_0x547dc8(0x7a)]};},async 'execute'(_0x346bdf){const _0x3e9f01=a192_0x1f8781,_0x359700=loadSqlProjectConfig(_0x346bdf[_0x3e9f01(0x6a)]),_0x5d8914=await readSqlLockFile(_0x359700['lockFilePath']);if(!_0x5d8914)throw CliErrors[_0x3e9f01(0x7d)](_0x3e9f01(0x77));const {lockData:_0x2b4884,appLock:_0x406ab5}=ensureSqlLockScope(_0x5d8914,_0x346bdf['appCode'],_0x359700[_0x3e9f01(0x79)],_0x3e9f01(0x88)),_0x2aeb54=_0x346bdf[_0x3e9f01(0x69)](_0x3e9f01(0x80)),_0x587a65=_0x406ab5[_0x3e9f01(0x86)][_0x2aeb54];if(!_0x587a65)throw CliErrors[_0x3e9f01(0x7d)](_0x3e9f01(0x83)+_0x2aeb54+'\x22.');await deleteSqlQuery({'id':_0x587a65[_0x3e9f01(0x70)],'sqlCode':_0x2aeb54}),_0x406ab5['sqls']=Object[_0x3e9f01(0x73)](Object[_0x3e9f01(0x85)](_0x406ab5[_0x3e9f01(0x86)])['filter'](([_0x456972])=>_0x456972!==_0x2aeb54)),_0x406ab5[_0x3e9f01(0x71)]=new Date()[_0x3e9f01(0x7b)](),await writeSqlLockFile(_0x359700[_0x3e9f01(0x76)],_0x2b4884);const _0x1c7888=resolveLocalSqlFilePath(_0x359700,_0x2aeb54,_0x587a65);let _0x5f073f;await fileExists(_0x1c7888)&&(_0x5f073f=await moveToTrash(_0x359700['projectRoot'],_0x359700['trashDir'],_0x1c7888),await cleanupEmptyDirectories(dirname(_0x1c7888),_0x359700['sqlRootDir']));const _0x20c8e0={'deleted':_0x2aeb54,'remoteId':_0x587a65[_0x3e9f01(0x70)]};if(_0x5f073f)_0x20c8e0['trashedTo']=_0x5f073f;return{'ok':!![],'data':_0x20c8e0,'message':'Deleted\x20'+_0x2aeb54+(_0x5f073f?'\x20(local\x20file\x20moved\x20to\x20trash)':'')};}};async function moveToTrash(_0xafed6d,_0x3a1894,_0x3b2e43){const _0x4a90d1=a192_0x1f8781,_0x1931bb=new Date()[_0x4a90d1(0x7b)]()['replace'](/[:.]/g,'-'),_0x11edc2=relative(_0xafed6d,_0x3b2e43),_0x6bb2c9=join(_0x3a1894,_0x1931bb,_0x11edc2);return await mkdir(dirname(_0x6bb2c9),{'recursive':!![]}),await rename(_0x3b2e43,_0x6bb2c9),_0x6bb2c9;}function a192_0xb2b3(){const _0xcea13f=['Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','434344UZJNPL','sqlcode','110663TASVvx','518487NDetOC','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','110uoDoZg','entries','sqls','2904057QwjVcl','delete','POST','Would\x20delete\x20SQL\x20','str','appCode','6zxRpiy','sql','high-risk-write','327190bOqYKR','203575GKnWmY','remoteId','lastSync','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','fromEntries','42OjgqjA','4TQpmHB','lockFilePath','SQL\x20lock\x20file\x20not\x20found.','7657qmrEfr','sqlRoot','trashDir','toISOString','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20','validation'];a192_0xb2b3=function(){return _0xcea13f;};return a192_0xb2b3();}async function cleanupEmptyDirectories(_0x25502f,_0x5e3381){let _0x241100=resolve(_0x25502f);const _0x3007ce=resolve(_0x5e3381);while(_0x241100['startsWith'](''+_0x3007ce+sep)||_0x241100===_0x3007ce){if(_0x241100===_0x3007ce)return;try{const _0x186032=await readdir(_0x241100);if(_0x186032['length']>0x0)return;await rmdir(_0x241100);}catch{return;}_0x241100=dirname(_0x241100);}}
1
+ const a185_0x249951=a185_0x47ac;(function(_0x17abe1,_0x56affd){const _0x11af3c=a185_0x47ac,_0x3ed0cd=_0x17abe1();while(!![]){try{const _0x21206d=-parseInt(_0x11af3c(0xfc))/0x1+parseInt(_0x11af3c(0xe4))/0x2*(-parseInt(_0x11af3c(0xee))/0x3)+parseInt(_0x11af3c(0xf5))/0x4*(-parseInt(_0x11af3c(0xe0))/0x5)+-parseInt(_0x11af3c(0xde))/0x6+parseInt(_0x11af3c(0xe5))/0x7*(-parseInt(_0x11af3c(0xd9))/0x8)+-parseInt(_0x11af3c(0xe1))/0x9+-parseInt(_0x11af3c(0xfd))/0xa*(-parseInt(_0x11af3c(0xd6))/0xb);if(_0x21206d===_0x56affd)break;else _0x3ed0cd['push'](_0x3ed0cd['shift']());}catch(_0x42560d){_0x3ed0cd['push'](_0x3ed0cd['shift']());}}}(a185_0x4d27,0xb9db1));function a185_0x47ac(_0x52cf7e,_0x54443a){_0x52cf7e=_0x52cf7e-0xd6;const _0x4d271a=a185_0x4d27();let _0x47ac65=_0x4d271a[_0x52cf7e];return _0x47ac65;}import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{fileExists}from'../../core/bff/file-system.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{CliErrors}from'../../errors.js';function a185_0x4d27(){const _0x26cef2=['POST','str','SQL\x20lock\x20file\x20not\x20found.','1277263Zylvkg','30jPAdco','19000762bsyysM','/smartapi/custom/deleteUserCustomSql','sqlcode','3348344pBAQxg','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','sqlRoot','Deleted\x20','filter','916074ZzciIt','validation','21245IpDsKv','6532902pcCgaV','length','toISOString','6666BAvXZc','7qawtsp','entries','delete','lastSync','lockFilePath','trashedTo','trashDir','replace','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','549ifuGzv','Would\x20delete\x20SQL\x20','fromEntries','\x20(local\x20file\x20moved\x20to\x20trash)','appCode','Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','sqlRootDir','1164qrkigv','sqls','remoteId','high-risk-write'];a185_0x4d27=function(){return _0x26cef2;};return a185_0x4d27();}import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDelete={'service':'sql','command':a185_0x249951(0xe7),'description':a185_0x249951(0xf3),'risk':a185_0x249951(0xf8),'flags':[SQLCODE_FLAG],async 'validate'(_0x4de64f){const _0xd46af2=a185_0x249951,_0x3b47b2=loadSqlProjectConfig(_0x4de64f[_0xd46af2(0xf2)]),_0x5c6568=await readSqlLockFile(_0x3b47b2[_0xd46af2(0xe9)]);if(!_0x5c6568)throw CliErrors[_0xd46af2(0xdf)](_0xd46af2(0xda));},async 'dryRun'(_0x4ac409){const _0x3c1f14=a185_0x249951,_0x5cc858=loadSqlProjectConfig(_0x4ac409[_0x3c1f14(0xf2)]),_0x36f27a=await readSqlLockFile(_0x5cc858[_0x3c1f14(0xe9)]);if(!_0x36f27a)throw CliErrors[_0x3c1f14(0xdf)]('SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.');const {appLock:_0x4bce43}=ensureSqlLockScope(_0x36f27a,_0x4ac409[_0x3c1f14(0xf2)],_0x5cc858[_0x3c1f14(0xdb)],'delete'),_0x25097d=_0x4ac409[_0x3c1f14(0xfa)](_0x3c1f14(0xd8)),_0x49ce43=_0x4bce43[_0x3c1f14(0xf6)][_0x25097d];if(!_0x49ce43)throw CliErrors[_0x3c1f14(0xdf)](_0x3c1f14(0xed)+_0x25097d+'\x22.');return{'method':_0x3c1f14(0xf9),'url':_0x3c1f14(0xd7),'body':{'sqlCode':_0x25097d,'id':_0x49ce43[_0x3c1f14(0xf7)],'localPath':resolveLocalSqlFilePath(_0x5cc858,_0x25097d,_0x49ce43)},'description':_0x3c1f14(0xef)+_0x25097d+'\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20'+_0x5cc858[_0x3c1f14(0xeb)]};},async 'execute'(_0x1eaa8f){const _0x232ab3=a185_0x249951,_0x3f6d9c=loadSqlProjectConfig(_0x1eaa8f[_0x232ab3(0xf2)]),_0x431f74=await readSqlLockFile(_0x3f6d9c[_0x232ab3(0xe9)]);if(!_0x431f74)throw CliErrors[_0x232ab3(0xdf)](_0x232ab3(0xfb));const {lockData:_0x3bd73f,appLock:_0x380a86}=ensureSqlLockScope(_0x431f74,_0x1eaa8f['appCode'],_0x3f6d9c[_0x232ab3(0xdb)],_0x232ab3(0xe7)),_0x400eb9=_0x1eaa8f[_0x232ab3(0xfa)](_0x232ab3(0xd8)),_0x3aade9=_0x380a86[_0x232ab3(0xf6)][_0x400eb9];if(!_0x3aade9)throw CliErrors[_0x232ab3(0xdf)]('No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22'+_0x400eb9+'\x22.');await deleteSqlQuery({'id':_0x3aade9[_0x232ab3(0xf7)],'sqlCode':_0x400eb9}),_0x380a86[_0x232ab3(0xf6)]=Object[_0x232ab3(0xf0)](Object[_0x232ab3(0xe6)](_0x380a86[_0x232ab3(0xf6)])[_0x232ab3(0xdd)](([_0x43f954])=>_0x43f954!==_0x400eb9)),_0x380a86[_0x232ab3(0xe8)]=new Date()[_0x232ab3(0xe3)](),await writeSqlLockFile(_0x3f6d9c[_0x232ab3(0xe9)],_0x3bd73f);const _0x53cc77=resolveLocalSqlFilePath(_0x3f6d9c,_0x400eb9,_0x3aade9);let _0x39ad75;await fileExists(_0x53cc77)&&(_0x39ad75=await moveToTrash(_0x3f6d9c['projectRoot'],_0x3f6d9c[_0x232ab3(0xeb)],_0x53cc77),await cleanupEmptyDirectories(dirname(_0x53cc77),_0x3f6d9c[_0x232ab3(0xf4)]));const _0x76e5ee={'deleted':_0x400eb9,'remoteId':_0x3aade9[_0x232ab3(0xf7)]};if(_0x39ad75)_0x76e5ee[_0x232ab3(0xea)]=_0x39ad75;return{'ok':!![],'data':_0x76e5ee,'message':_0x232ab3(0xdc)+_0x400eb9+(_0x39ad75?_0x232ab3(0xf1):'')};}};async function moveToTrash(_0x1e26b6,_0x2f29c0,_0xcc3cde){const _0x2b4912=a185_0x249951,_0x23883f=new Date()[_0x2b4912(0xe3)]()[_0x2b4912(0xec)](/[:.]/g,'-'),_0x3e8e10=relative(_0x1e26b6,_0xcc3cde),_0x322520=join(_0x2f29c0,_0x23883f,_0x3e8e10);return await mkdir(dirname(_0x322520),{'recursive':!![]}),await rename(_0xcc3cde,_0x322520),_0x322520;}async function cleanupEmptyDirectories(_0x57d33c,_0x23bf34){const _0x15ceaf=a185_0x249951;let _0x498389=resolve(_0x57d33c);const _0x3ec2c8=resolve(_0x23bf34);while(_0x498389['startsWith'](''+_0x3ec2c8+sep)||_0x498389===_0x3ec2c8){if(_0x498389===_0x3ec2c8)return;try{const _0x3748be=await readdir(_0x498389);if(_0x3748be[_0x15ceaf(0xe2)]>0x0)return;await rmdir(_0x498389);}catch{return;}_0x498389=dirname(_0x498389);}}
@@ -1 +1 @@
1
- const a193_0x1bbcdc=a193_0x46c6;function a193_0x392d(){const _0x5702cd=['2137446YMyjIG','boolean','detail','str','dbId','sqlCode','6963385LtvCyQ','sqlContent','5010580bEMPOl','54sksQpN','sqlcode','16OZlDEv','7119500RVHVxh','3xxtQeg','411365SVmgdb','4tEIWgA','960890eHtDqZ','12HetmKm','appCode','verbose','sql','265062xkgELQ','bool'];a193_0x392d=function(){return _0x5702cd;};return a193_0x392d();}function a193_0x46c6(_0x356957,_0x445902){_0x356957=_0x356957-0x139;const _0x392dab=a193_0x392d();let _0x46c61c=_0x392dab[_0x356957];return _0x46c61c;}(function(_0x153466,_0x41baf8){const _0x1310dd=a193_0x46c6,_0x2c0892=_0x153466();while(!![]){try{const _0x4b9aae=parseInt(_0x1310dd(0x14f))/0x1*(-parseInt(_0x1310dd(0x149))/0x2)+parseInt(_0x1310dd(0x147))/0x3*(-parseInt(_0x1310dd(0x142))/0x4)+-parseInt(_0x1310dd(0x148))/0x5*(-parseInt(_0x1310dd(0x143))/0x6)+-parseInt(_0x1310dd(0x14a))/0x7+-parseInt(_0x1310dd(0x145))/0x8*(-parseInt(_0x1310dd(0x13a))/0x9)+parseInt(_0x1310dd(0x146))/0xa+parseInt(_0x1310dd(0x140))/0xb*(parseInt(_0x1310dd(0x14b))/0xc);if(_0x4b9aae===_0x41baf8)break;else _0x2c0892['push'](_0x2c0892['shift']());}catch(_0x2b96b2){_0x2c0892['push'](_0x2c0892['shift']());}}}(a193_0x392d,0x9c587));import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':a193_0x1bbcdc(0x14e),'command':a193_0x1bbcdc(0x13c),'description':'Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','risk':'read','flags':[SQLCODE_FLAG,{'name':a193_0x1bbcdc(0x14d),'type':a193_0x1bbcdc(0x13b),'description':'Return\x20full\x20raw\x20SQL\x20query\x20object'}],async 'execute'(_0x42ea64){const _0x2e35f8=a193_0x1bbcdc,_0x544883=await getSqlQueryInfo(_0x42ea64[_0x2e35f8(0x14c)],_0x42ea64[_0x2e35f8(0x13d)](_0x2e35f8(0x144))),_0x19f62f=_0x42ea64[_0x2e35f8(0x139)]('verbose');if(_0x19f62f)return{'ok':!![],'data':_0x544883};const _0x575cf5=_0x544883[_0x2e35f8(0x13e)]?await getDbName(_0x42ea64[_0x2e35f8(0x14c)],_0x544883['dbId']):undefined;return{'ok':!![],'data':{'sqlCode':_0x544883[_0x2e35f8(0x13f)],'sqlName':_0x544883['sqlName'],'db':_0x575cf5?_0x575cf5+'\x20('+_0x544883[_0x2e35f8(0x13e)]+')':_0x544883[_0x2e35f8(0x13e)]??'','description':_0x544883['description']??'','sqlContent':_0x544883[_0x2e35f8(0x141)]??''}};}};
1
+ const a186_0x3bd777=a186_0x3273;function a186_0x3bc8(){const _0x5a3185=['2172tykxBk','verbose','read','64KOCSap','sqlContent','4691753HVqPJN','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','1564ZbsvkN','400URccbE','description','5982921HMdMzB','10emOYqS','str','24rCoIiX','4466891TXpxdk','bool','10895KbymYG','371768TOXZIq','6OvBxsB','31472hDxEVM','sqlName','sqlCode','appCode','dbId'];a186_0x3bc8=function(){return _0x5a3185;};return a186_0x3bc8();}(function(_0x3c4866,_0x41cb90){const _0xa63e20=a186_0x3273,_0x4f70da=_0x3c4866();while(!![]){try{const _0x43e513=-parseInt(_0xa63e20(0x16a))/0x1*(-parseInt(_0xa63e20(0x16b))/0x2)+-parseInt(_0xa63e20(0x15d))/0x3*(-parseInt(_0xa63e20(0x15c))/0x4)+parseInt(_0xa63e20(0x15b))/0x5*(parseInt(_0xa63e20(0x163))/0x6)+-parseInt(_0xa63e20(0x15e))/0x7*(-parseInt(_0xa63e20(0x166))/0x8)+-parseInt(_0xa63e20(0x155))/0x9+parseInt(_0xa63e20(0x156))/0xa*(parseInt(_0xa63e20(0x168))/0xb)+-parseInt(_0xa63e20(0x158))/0xc*(parseInt(_0xa63e20(0x159))/0xd);if(_0x43e513===_0x41cb90)break;else _0x4f70da['push'](_0x4f70da['shift']());}catch(_0x1912ce){_0x4f70da['push'](_0x4f70da['shift']());}}}(a186_0x3bc8,0x612a6));import{getSqlQueryInfo}from'../../core/api-client.js';function a186_0x3273(_0x1e1da3,_0x5ab327){_0x1e1da3=_0x1e1da3-0x155;const _0x3bc80b=a186_0x3bc8();let _0x32739d=_0x3bc80b[_0x1e1da3];return _0x32739d;}import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':'sql','command':'detail','description':a186_0x3bd777(0x169),'risk':a186_0x3bd777(0x165),'flags':[SQLCODE_FLAG,{'name':a186_0x3bd777(0x164),'type':'boolean','description':'Return\x20full\x20raw\x20SQL\x20query\x20object'}],async 'execute'(_0xbfc82a){const _0x49db70=a186_0x3bd777,_0x5c2333=await getSqlQueryInfo(_0xbfc82a[_0x49db70(0x161)],_0xbfc82a[_0x49db70(0x157)]('sqlcode')),_0x2830a6=_0xbfc82a[_0x49db70(0x15a)](_0x49db70(0x164));if(_0x2830a6)return{'ok':!![],'data':_0x5c2333};const _0x838300=_0x5c2333[_0x49db70(0x162)]?await getDbName(_0xbfc82a[_0x49db70(0x161)],_0x5c2333[_0x49db70(0x162)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x5c2333[_0x49db70(0x160)],'sqlName':_0x5c2333[_0x49db70(0x15f)],'db':_0x838300?_0x838300+'\x20('+_0x5c2333[_0x49db70(0x162)]+')':_0x5c2333[_0x49db70(0x162)]??'','description':_0x5c2333[_0x49db70(0x16c)]??'','sqlContent':_0x5c2333[_0x49db70(0x167)]??''}};}};
@@ -1 +1 @@
1
- const a194_0xb736=a194_0x3297;(function(_0x26968d,_0x59b7ec){const _0x5bf3a5=a194_0x3297,_0x2de89c=_0x26968d();while(!![]){try{const _0x1340d7=parseInt(_0x5bf3a5(0x132))/0x1*(parseInt(_0x5bf3a5(0x13e))/0x2)+-parseInt(_0x5bf3a5(0x13d))/0x3*(parseInt(_0x5bf3a5(0x137))/0x4)+parseInt(_0x5bf3a5(0x13c))/0x5+parseInt(_0x5bf3a5(0x131))/0x6+parseInt(_0x5bf3a5(0x13b))/0x7*(parseInt(_0x5bf3a5(0x138))/0x8)+-parseInt(_0x5bf3a5(0x12b))/0x9+-parseInt(_0x5bf3a5(0x134))/0xa;if(_0x1340d7===_0x59b7ec)break;else _0x2de89c['push'](_0x2de89c['shift']());}catch(_0x57e593){_0x2de89c['push'](_0x2de89c['shift']());}}}(a194_0x19d5,0x85690));import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a194_0x19d5(){const _0x15603a=['string','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','length','32184hesMNy','72NTmHmH','\x20row(s)\x20in\x20','90150bnrFCS','sql','str','22004Zezazp','1142256jVKmkH','now','execError','7hWYNRR','2792980qOYqAZ','195kmDcSy','15122paqCAM','params','read','exec','sqlcode','Returned\x20','execResult','3042954ukedjj','execSuccess'];a194_0x19d5=function(){return _0x15603a;};return a194_0x19d5();}function a194_0x3297(_0x2c4123,_0x500717){_0x2c4123=_0x2c4123-0x127;const _0x19d5be=a194_0x19d5();let _0x329754=_0x19d5be[_0x2c4123];return _0x329754;}import{parseJsonParams}from'../../utils/params.js';export const sqlExec={'service':a194_0xb736(0x135),'command':a194_0xb736(0x127),'description':a194_0xb736(0x12f),'risk':a194_0xb736(0x140),'flags':[SQLCODE_FLAG,{'name':a194_0xb736(0x13f),'type':a194_0xb736(0x12d),'description':a194_0xb736(0x12e)}],async 'execute'(_0xd930de){const _0x4cdd30=a194_0xb736,_0x181bf1=parseJsonParams(_0xd930de['str'](_0x4cdd30(0x13f))),_0x4daf30=Date[_0x4cdd30(0x139)](),_0x2ff07a=await executeSql(_0xd930de['appCode'],_0xd930de[_0x4cdd30(0x136)](_0x4cdd30(0x128)),_0x181bf1),_0x421fef=Date['now']()-_0x4daf30,_0x4d6b2a=_0x2ff07a?.[_0x4cdd30(0x12a)]??_0x2ff07a,_0x5453a6=_0x2ff07a?.[_0x4cdd30(0x12c)]??!![];if(!_0x5453a6)return{'ok':![],'data':{'error':_0x2ff07a?.[_0x4cdd30(0x13a)]||'SQL\x20execution\x20failed','elapsed':_0x421fef},'message':'SQL\x20execution\x20failed'};const _0x3987a6=Array['isArray'](_0x4d6b2a)?_0x4d6b2a:[];return{'ok':!![],'data':{'rows':_0x3987a6,'rowCount':_0x3987a6[_0x4cdd30(0x130)],'elapsed':_0x421fef},'message':_0x4cdd30(0x129)+_0x3987a6[_0x4cdd30(0x130)]+_0x4cdd30(0x133)+_0x421fef+'ms'};}};
1
+ const a187_0x33a641=a187_0x6cc1;(function(_0x32c8a3,_0x2d0c72){const _0x2a5bf5=a187_0x6cc1,_0x2fd51d=_0x32c8a3();while(!![]){try{const _0x2053f1=-parseInt(_0x2a5bf5(0x1ba))/0x1*(parseInt(_0x2a5bf5(0x1be))/0x2)+-parseInt(_0x2a5bf5(0x1c1))/0x3+parseInt(_0x2a5bf5(0x1bc))/0x4+parseInt(_0x2a5bf5(0x1bd))/0x5+-parseInt(_0x2a5bf5(0x1c8))/0x6*(-parseInt(_0x2a5bf5(0x1c7))/0x7)+-parseInt(_0x2a5bf5(0x1c4))/0x8*(-parseInt(_0x2a5bf5(0x1c6))/0x9)+-parseInt(_0x2a5bf5(0x1b8))/0xa;if(_0x2053f1===_0x2d0c72)break;else _0x2fd51d['push'](_0x2fd51d['shift']());}catch(_0x23bfd9){_0x2fd51d['push'](_0x2fd51d['shift']());}}}(a187_0x4f08,0xf2236));import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';function a187_0x4f08(){const _0x308228=['7QLjGDF','10353126saEvwv','Returned\x20','params','read','now','execResult','length','29026110yXPcvE','SQL\x20execution\x20failed','6973AslVFc','\x20row(s)\x20in\x20','6465300wFflhZ','5113505DvbCyn','254xgwzxv','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','execError','1545681TJbALt','execSuccess','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','80deGjoN','str','837594iEdjym'];a187_0x4f08=function(){return _0x308228;};return a187_0x4f08();}function a187_0x6cc1(_0x603c55,_0x3146b2){_0x603c55=_0x603c55-0x1b8;const _0x4f082e=a187_0x4f08();let _0x6cc18e=_0x4f082e[_0x603c55];return _0x6cc18e;}export const sqlExec={'service':'sql','command':'exec','description':a187_0x33a641(0x1bf),'risk':a187_0x33a641(0x1cb),'flags':[SQLCODE_FLAG,{'name':'params','type':'string','description':a187_0x33a641(0x1c3)}],async 'execute'(_0x208233){const _0x27ded1=a187_0x33a641,_0x4c620a=parseJsonParams(_0x208233[_0x27ded1(0x1c5)](_0x27ded1(0x1ca))),_0x32c463=Date[_0x27ded1(0x1cc)](),_0x52e6d4=await executeSql(_0x208233['appCode'],_0x208233['str']('sqlcode'),_0x4c620a),_0x1e0b10=Date[_0x27ded1(0x1cc)]()-_0x32c463,_0x45c703=_0x52e6d4?.[_0x27ded1(0x1cd)]??_0x52e6d4,_0x5791e0=_0x52e6d4?.[_0x27ded1(0x1c2)]??!![];if(!_0x5791e0)return{'ok':![],'data':{'error':_0x52e6d4?.[_0x27ded1(0x1c0)]||_0x27ded1(0x1b9),'elapsed':_0x1e0b10},'message':_0x27ded1(0x1b9)};const _0x480fd4=Array['isArray'](_0x45c703)?_0x45c703:[];return{'ok':!![],'data':{'rows':_0x480fd4,'rowCount':_0x480fd4['length'],'elapsed':_0x1e0b10},'message':_0x27ded1(0x1c9)+_0x480fd4[_0x27ded1(0x1ce)]+_0x27ded1(0x1bb)+_0x1e0b10+'ms'};}};
@@ -1 +1 @@
1
- (function(_0x5e750c,_0x5c191a){const _0x430ced=a195_0x339c,_0x205776=_0x5e750c();while(!![]){try{const _0x164453=-parseInt(_0x430ced(0x17d))/0x1+-parseInt(_0x430ced(0x178))/0x2*(-parseInt(_0x430ced(0x172))/0x3)+-parseInt(_0x430ced(0x179))/0x4*(-parseInt(_0x430ced(0x174))/0x5)+-parseInt(_0x430ced(0x176))/0x6+-parseInt(_0x430ced(0x17a))/0x7*(parseInt(_0x430ced(0x17c))/0x8)+-parseInt(_0x430ced(0x17b))/0x9*(-parseInt(_0x430ced(0x175))/0xa)+-parseInt(_0x430ced(0x177))/0xb*(-parseInt(_0x430ced(0x173))/0xc);if(_0x164453===_0x5c191a)break;else _0x205776['push'](_0x205776['shift']());}catch(_0x51429c){_0x205776['push'](_0x205776['shift']());}}}(a195_0x17ad,0xc8e12));import{sqlList}from'../../commands/sql/list.js';import{sqlDetail}from'../../commands/sql/detail.js';import{sqlValidate}from'../../commands/sql/validate.js';import{sqlExec}from'../../commands/sql/exec.js';import{sqlPull}from'../../commands/sql/pull.js';import{sqlCreate}from'../../commands/sql/create.js';import{sqlStatus}from'../../commands/sql/status.js';function a195_0x339c(_0x4d86f8,_0x3b0e0c){_0x4d86f8=_0x4d86f8-0x172;const _0x17ade4=a195_0x17ad();let _0x339c2a=_0x17ade4[_0x4d86f8];return _0x339c2a;}import{sqlPush}from'../../commands/sql/push.js';import{sqlDelete}from'../../commands/sql/delete.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlExec,sqlPull,sqlDelete];function a195_0x17ad(){const _0x6ef8d3=['211349hltBFs','3MVBwGv','341244pcfItx','4420uZvgSU','2676130ZXjqEJ','6789060OqOdrz','418xQaoYO','3062498yXbYmf','92scFGTG','10758846DAMcez','36hxhQXn','8xbmUwZ'];a195_0x17ad=function(){return _0x6ef8d3;};return a195_0x17ad();}
1
+ (function(_0x3de3c9,_0x3d177e){const _0xcff20=a188_0x4cce,_0x5b86b8=_0x3de3c9();while(!![]){try{const _0x323d18=-parseInt(_0xcff20(0x162))/0x1+parseInt(_0xcff20(0x160))/0x2+parseInt(_0xcff20(0x16b))/0x3*(parseInt(_0xcff20(0x16a))/0x4)+-parseInt(_0xcff20(0x169))/0x5*(parseInt(_0xcff20(0x167))/0x6)+parseInt(_0xcff20(0x165))/0x7*(-parseInt(_0xcff20(0x161))/0x8)+parseInt(_0xcff20(0x164))/0x9*(parseInt(_0xcff20(0x166))/0xa)+parseInt(_0xcff20(0x163))/0xb*(parseInt(_0xcff20(0x168))/0xc);if(_0x323d18===_0x3d177e)break;else _0x5b86b8['push'](_0x5b86b8['shift']());}catch(_0x562992){_0x5b86b8['push'](_0x5b86b8['shift']());}}}(a188_0x62bb,0x5deda));import{sqlList}from'../../commands/sql/list.js';import{sqlDetail}from'../../commands/sql/detail.js';import{sqlValidate}from'../../commands/sql/validate.js';function a188_0x4cce(_0x51baa7,_0x2f37a9){_0x51baa7=_0x51baa7-0x160;const _0x62bb47=a188_0x62bb();let _0x4cce7d=_0x62bb47[_0x51baa7];return _0x4cce7d;}import{sqlExec}from'../../commands/sql/exec.js';import{sqlPull}from'../../commands/sql/pull.js';import{sqlCreate}from'../../commands/sql/create.js';import{sqlStatus}from'../../commands/sql/status.js';import{sqlPush}from'../../commands/sql/push.js';function a188_0x62bb(){const _0x598fa0=['12kFMkML','2370HLiCAb','4DolSNL','946485XdMFOd','115064mJzfiW','4668104ZvHxsj','42519xKpjIv','5531251zNyFIt','4041khiTUS','7tOKbgx','4060LszlXM','600jqRpxs'];a188_0x62bb=function(){return _0x598fa0;};return a188_0x62bb();}import{sqlDelete}from'../../commands/sql/delete.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlExec,sqlPull,sqlDelete];
@@ -1 +1 @@
1
- const a196_0x29fdf7=a196_0x48dc;(function(_0x5a3027,_0xbdb5df){const _0x27ffe2=a196_0x48dc,_0x458e13=_0x5a3027();while(!![]){try{const _0x1ee157=-parseInt(_0x27ffe2(0x19c))/0x1+parseInt(_0x27ffe2(0x187))/0x2*(parseInt(_0x27ffe2(0x195))/0x3)+parseInt(_0x27ffe2(0x1a2))/0x4*(-parseInt(_0x27ffe2(0x190))/0x5)+-parseInt(_0x27ffe2(0x193))/0x6*(-parseInt(_0x27ffe2(0x1a6))/0x7)+-parseInt(_0x27ffe2(0x18e))/0x8*(-parseInt(_0x27ffe2(0x1a3))/0x9)+parseInt(_0x27ffe2(0x1ad))/0xa+parseInt(_0x27ffe2(0x198))/0xb;if(_0x1ee157===_0xbdb5df)break;else _0x458e13['push'](_0x458e13['shift']());}catch(_0x32fd89){_0x458e13['push'](_0x458e13['shift']());}}}(a196_0xdb16,0x8b988));import{listSqlQueries}from'../../core/api-client.js';function a196_0x48dc(_0x21fdba,_0x31c038){_0x21fdba=_0x21fdba-0x187;const _0xdb16f6=a196_0xdb16();let _0x48dcd8=_0xdb16f6[_0x21fdba];return _0x48dcd8;}function a196_0xdb16(){const _0xb2b41f=['Page\x20size','2457965UoUfED','sqlcode','length','538374zyNZRe','sqlCode','1108173TMbRGV','all','bool','1686938MbBpvu','string','List\x20custom\x20SQL\x20queries','appCode','357935ZJapDb','list','pagesize','read','number','boolean','4pwxuSt','117alyRqM','name','verbose','7bawVFx','sqlName','No\x20custom\x20SQL\x20queries\x20found.','dbId','Found\x20','totalCount','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','6884930zLXBJJ','2FbrJKE','Filter\x20by\x20SQL\x20name','page','num','str','description','tableData','74056Jscdll'];a196_0xdb16=function(){return _0xb2b41f;};return a196_0xdb16();}import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlList={'service':'sql','command':a196_0x29fdf7(0x19d),'description':a196_0x29fdf7(0x19a),'risk':a196_0x29fdf7(0x19f),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a196_0x29fdf7(0x1a4),'type':a196_0x29fdf7(0x199),'description':a196_0x29fdf7(0x188)},{'name':a196_0x29fdf7(0x189),'type':a196_0x29fdf7(0x1a0),'description':'Page\x20number','default':0x1},{'name':a196_0x29fdf7(0x19e),'type':a196_0x29fdf7(0x1a0),'description':a196_0x29fdf7(0x18f)},{'name':a196_0x29fdf7(0x1a5),'type':a196_0x29fdf7(0x1a1),'description':a196_0x29fdf7(0x1ac)}],async 'execute'(_0x5bbc82){const _0x51d76b=a196_0x29fdf7,_0x42edc3=await listSqlQueries(_0x5bbc82[_0x51d76b(0x19b)],{'sqlCode':_0x5bbc82[_0x51d76b(0x18b)](_0x51d76b(0x191))||undefined,'sqlName':_0x5bbc82['str']('name')||undefined,'currentPage':_0x5bbc82[_0x51d76b(0x18a)](_0x51d76b(0x189)),'pageSize':_0x5bbc82['num']('pagesize',0x32)}),_0x1fc36d=_0x5bbc82[_0x51d76b(0x197)](_0x51d76b(0x1a5)),_0x2fcd6d=_0x42edc3[_0x51d76b(0x18d)]??[],_0x222582=_0x42edc3['paging']?.[_0x51d76b(0x1ab)]??_0x2fcd6d[_0x51d76b(0x192)];let _0x26abcf;return _0x1fc36d?_0x26abcf=_0x2fcd6d:_0x26abcf=await Promise[_0x51d76b(0x196)](_0x2fcd6d['map'](async _0x54384d=>{const _0x29b075=_0x51d76b;let _0x3121d1;try{_0x3121d1=_0x54384d[_0x29b075(0x1a9)]?await getDbName(_0x5bbc82[_0x29b075(0x19b)],_0x54384d['dbId']):undefined;}catch{}return{'sqlCode':_0x54384d[_0x29b075(0x194)],'sqlName':_0x54384d[_0x29b075(0x1a7)],'description':_0x54384d[_0x29b075(0x18c)]??'','db':_0x3121d1?_0x3121d1+'\x20('+_0x54384d[_0x29b075(0x1a9)]+')':_0x54384d[_0x29b075(0x1a9)]??''};})),{'ok':!![],'data':_0x26abcf,'message':_0x2fcd6d[_0x51d76b(0x192)]===0x0?_0x51d76b(0x1a8):_0x51d76b(0x1aa)+_0x2fcd6d['length']+'\x20SQL\x20queries\x20(total:\x20'+_0x222582+').'};}};
1
+ const a189_0x187552=a189_0x5d3a;(function(_0x32afbf,_0x4b6d05){const _0x28b40c=a189_0x5d3a,_0x529ae7=_0x32afbf();while(!![]){try{const _0x758acf=parseInt(_0x28b40c(0x87))/0x1*(parseInt(_0x28b40c(0x6e))/0x2)+parseInt(_0x28b40c(0x79))/0x3+parseInt(_0x28b40c(0x6f))/0x4*(-parseInt(_0x28b40c(0x80))/0x5)+parseInt(_0x28b40c(0x68))/0x6+parseInt(_0x28b40c(0x69))/0x7+-parseInt(_0x28b40c(0x7b))/0x8*(parseInt(_0x28b40c(0x7a))/0x9)+-parseInt(_0x28b40c(0x81))/0xa*(-parseInt(_0x28b40c(0x6c))/0xb);if(_0x758acf===_0x4b6d05)break;else _0x529ae7['push'](_0x529ae7['shift']());}catch(_0x191167){_0x529ae7['push'](_0x529ae7['shift']());}}}(a189_0x5deb,0xa21e5));function a189_0x5d3a(_0x58c9fd,_0x5aafc7){_0x58c9fd=_0x58c9fd-0x66;const _0x5deb3f=a189_0x5deb();let _0x5d3a71=_0x5deb3f[_0x58c9fd];return _0x5d3a71;}import{listSqlQueries}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';function a189_0x5deb(){const _0x4c99aa=['6039537PICOdG','appCode','Found\x20','11WvlpUe','string','105274VWyWzc','2371744cBSSFi','sql','sqlcode','str','dbId','paging','sqlCode','bool','list','List\x20custom\x20SQL\x20queries','1831641PFwvnu','9ttqljU','7180568mksgkF','description','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','number','page','5mnXVmy','5095690fcvOrQ','num','Filter\x20by\x20SQL\x20name','\x20SQL\x20queries\x20(total:\x20','name','verbose','1QyLfHD','No\x20custom\x20SQL\x20queries\x20found.','Page\x20number','length','pagesize','714000APQqlB'];a189_0x5deb=function(){return _0x4c99aa;};return a189_0x5deb();}import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlList={'service':a189_0x187552(0x70),'command':a189_0x187552(0x77),'description':a189_0x187552(0x78),'risk':'read','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a189_0x187552(0x85),'type':a189_0x187552(0x6d),'description':a189_0x187552(0x83)},{'name':a189_0x187552(0x7f),'type':'number','description':a189_0x187552(0x89),'default':0x1},{'name':a189_0x187552(0x67),'type':a189_0x187552(0x7e),'description':'Page\x20size'},{'name':a189_0x187552(0x86),'type':'boolean','description':a189_0x187552(0x7d)}],async 'execute'(_0x429858){const _0x1bd849=a189_0x187552,_0x10adf1=await listSqlQueries(_0x429858[_0x1bd849(0x6a)],{'sqlCode':_0x429858[_0x1bd849(0x72)](_0x1bd849(0x71))||undefined,'sqlName':_0x429858[_0x1bd849(0x72)](_0x1bd849(0x85))||undefined,'currentPage':_0x429858[_0x1bd849(0x82)]('page'),'pageSize':_0x429858['num'](_0x1bd849(0x67),0x32)}),_0x4f3cf0=_0x429858[_0x1bd849(0x76)]('verbose'),_0x45a4a5=_0x10adf1['tableData']??[],_0x34b30c=_0x10adf1[_0x1bd849(0x74)]?.['totalCount']??_0x45a4a5['length'];let _0x33d6e3;return _0x4f3cf0?_0x33d6e3=_0x45a4a5:_0x33d6e3=await Promise['all'](_0x45a4a5['map'](async _0x42eb26=>{const _0x153d1c=_0x1bd849;let _0x290e82;try{_0x290e82=_0x42eb26[_0x153d1c(0x73)]?await getDbName(_0x429858[_0x153d1c(0x6a)],_0x42eb26[_0x153d1c(0x73)]):undefined;}catch{}return{'sqlCode':_0x42eb26[_0x153d1c(0x75)],'sqlName':_0x42eb26['sqlName'],'description':_0x42eb26[_0x153d1c(0x7c)]??'','db':_0x290e82?_0x290e82+'\x20('+_0x42eb26[_0x153d1c(0x73)]+')':_0x42eb26['dbId']??''};})),{'ok':!![],'data':_0x33d6e3,'message':_0x45a4a5['length']===0x0?_0x1bd849(0x88):_0x1bd849(0x6b)+_0x45a4a5[_0x1bd849(0x66)]+_0x1bd849(0x84)+_0x34b30c+').'};}};