@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.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.d.ts +1 -0
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/{permit/index.d.ts → dataset/business-groups.d.ts} +1 -1
- package/lib/commands/dataset/business-groups.js +1 -0
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.d.ts +15 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/react/create.js +1 -1
- package/lib/commands/page/react/detail.js +1 -1
- package/lib/commands/page/react/list.js +1 -1
- package/lib/commands/page/react/publish.js +1 -1
- package/lib/commands/page/react/shared.js +1 -1
- package/lib/commands/page/react/syntax.js +1 -1
- package/lib/commands/page/react/template.js +1 -1
- package/lib/commands/page/react/update.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.d.ts +15 -17
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.d.ts +70 -79
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.d.ts +1 -0
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/rabetbase/SKILL.md +18 -24
- package/skills/rabetbase/guides/database-connection-workflow.md +6 -2
- package/skills/rabetbase/references/rabetbase-dataset-business-groups.md +28 -0
- package/skills/rabetbase/references/rabetbase-dataset-delete.md +7 -5
- package/skills/rabetbase/references/rabetbase-dataset-list.md +6 -6
- package/skills/rabetbase/references/rabetbase-dataset-restore.md +5 -5
- package/skills/rabetbase/references/rabetbase-db-create.md +3 -0
- package/skills/rabetbase/references/rabetbase-db-delete.md +10 -2
- package/skills/rabetbase/references/rabetbase-db-detail.md +2 -0
- package/skills/rabetbase/references/rabetbase-db-list.md +3 -2
- package/skills/rabetbase/references/rabetbase-db-update.md +4 -2
- package/skills/rabetbase/references/rabetbase-role-list.md +9 -17
- package/skills/rabetbase/references/rabetbase-role-user-add.md +44 -16
- package/skills/rabetbase/references/rabetbase-role-user-resolve.md +2 -2
- package/skills/rabetbase.manifest.json +4 -7
- package/lib/commands/permit/index.js +0 -1
- package/lib/commands/permit/page-get.d.ts +0 -2
- package/lib/commands/permit/page-get.js +0 -1
- package/lib/commands/permit/page-set.d.ts +0 -2
- package/lib/commands/permit/page-set.js +0 -1
- package/lib/commands/permit/role-apis-set.d.ts +0 -2
- package/lib/commands/permit/role-apis-set.js +0 -1
- package/lib/commands/permit/role-menus-set.d.ts +0 -2
- package/lib/commands/permit/role-menus-set.js +0 -1
- package/lib/commands/permit/role-menus.d.ts +0 -2
- package/lib/commands/permit/role-menus.js +0 -1
- package/lib/commands/permit/shared.d.ts +0 -74
- package/lib/commands/permit/shared.js +0 -1
- package/lib/commands/role/create.d.ts +0 -2
- package/lib/commands/role/create.js +0 -1
- package/skills/rabetbase/guides/role-permit-workflow.md +0 -127
- package/skills/rabetbase/references/rabetbase-permit-page-set.md +0 -69
- package/skills/rabetbase/references/rabetbase-permit-role-apis-set.md +0 -53
- 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
|
|
5
|
+
* 查人(tenant 成员目录)、研发态关系分页读取、原子成员变更、投影与写命令输出信封。
|
|
6
6
|
* 命令文件只引用这里,不重复合并/守卫规则(见 AGENTS.md 声明式方法论 SSOT)。
|
|
7
7
|
*/
|
|
8
|
-
import { type AppRole, type
|
|
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
|
|
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
|
-
|
|
86
|
-
|
|
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
|
-
/**
|
|
100
|
-
export declare function
|
|
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
|
-
* 解析角色引用 → 解析用户 →
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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':!![]};}};
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
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
|
|
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
|
|
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)]??''}};}};
|
package/lib/commands/sql/exec.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
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(
|
|
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];
|
package/lib/commands/sql/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
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+').'};}};
|