@lovrabet/rabetbase-cli 2.4.4 → 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
package/lib/core/api-client.d.ts
CHANGED
|
@@ -243,6 +243,7 @@ export interface BffScript {
|
|
|
243
243
|
operationType?: string | null;
|
|
244
244
|
createdTime?: string;
|
|
245
245
|
updatedTime?: string;
|
|
246
|
+
updateUserName?: string;
|
|
246
247
|
}
|
|
247
248
|
export interface BffSaveResult {
|
|
248
249
|
id?: number;
|
|
@@ -398,9 +399,31 @@ export declare function listDatasets(appCode: string, options?: {
|
|
|
398
399
|
code?: string;
|
|
399
400
|
name?: string;
|
|
400
401
|
deleted?: boolean;
|
|
402
|
+
source?: "DB_TABLE" | "METADATA";
|
|
401
403
|
}): Promise<DatasetItem[]>;
|
|
402
|
-
export declare function deleteDataset(
|
|
404
|
+
export declare function deleteDataset(datasetId: number, cascade: boolean): Promise<void>;
|
|
403
405
|
export declare function restoreDataset(appCode: string, datasetId: number): Promise<void>;
|
|
406
|
+
export type RecycleBinResourceType = "DATASET";
|
|
407
|
+
export interface RecycleBinResourceLog {
|
|
408
|
+
id: number;
|
|
409
|
+
appCode: string;
|
|
410
|
+
resourceType: RecycleBinResourceType | string;
|
|
411
|
+
resourceId: number;
|
|
412
|
+
resourceName?: string[];
|
|
413
|
+
createTime?: number | string | null;
|
|
414
|
+
createUserId?: number | null;
|
|
415
|
+
createUserName?: string | null;
|
|
416
|
+
[key: string]: unknown;
|
|
417
|
+
}
|
|
418
|
+
export declare function listRecycleBinResources(appCode: string, resourceType: RecycleBinResourceType, options: {
|
|
419
|
+
currentPage: number;
|
|
420
|
+
pageSize: number;
|
|
421
|
+
resourceName?: string;
|
|
422
|
+
}): Promise<{
|
|
423
|
+
items: RecycleBinResourceLog[];
|
|
424
|
+
paging?: Paging;
|
|
425
|
+
}>;
|
|
426
|
+
export declare function restoreRecycleBinResource(deleteLogId: number): Promise<void>;
|
|
404
427
|
export interface TextGeneratedDatasetPreviewInput {
|
|
405
428
|
datasetName: string;
|
|
406
429
|
requirementDescription: string;
|
|
@@ -828,11 +851,21 @@ export interface ErBusinessGroupUpdatePayload {
|
|
|
828
851
|
datasetCode: string;
|
|
829
852
|
businessGroup?: string;
|
|
830
853
|
}
|
|
854
|
+
export interface ErBusinessGroupSummary {
|
|
855
|
+
appCode: string;
|
|
856
|
+
dblinkId: number;
|
|
857
|
+
totalDatasetCount: number;
|
|
858
|
+
groups: Array<{
|
|
859
|
+
businessGroup: string;
|
|
860
|
+
datasetCount: number;
|
|
861
|
+
}>;
|
|
862
|
+
}
|
|
831
863
|
export declare function getErRelationDetail(appCode: string, relationId: number): Promise<ErRelationDetail | null>;
|
|
832
864
|
export declare function createErRelation(payload: ErRelationMutationPayload): Promise<boolean>;
|
|
833
865
|
export declare function updateErRelation(payload: ErRelationMutationPayload): Promise<boolean>;
|
|
834
866
|
export declare function deleteErRelation(payload: ErRelationDeletePayload): Promise<boolean>;
|
|
835
867
|
export declare function updateErBusinessGroup(payload: ErBusinessGroupUpdatePayload): Promise<boolean>;
|
|
868
|
+
export declare function getErBusinessGroupSummary(appCode: string, dblinkId: number): Promise<ErBusinessGroupSummary>;
|
|
836
869
|
export interface DbLinkInfo {
|
|
837
870
|
id: number;
|
|
838
871
|
appCode: string;
|
|
@@ -849,6 +882,7 @@ export interface DbLinkInfo {
|
|
|
849
882
|
latestAnalysisTraceId?: string;
|
|
850
883
|
latestAnalysisSuccessTime?: string;
|
|
851
884
|
tableCount?: number;
|
|
885
|
+
hasAvailableDo?: boolean;
|
|
852
886
|
[key: string]: unknown;
|
|
853
887
|
}
|
|
854
888
|
export interface DbTableInfo {
|
|
@@ -970,6 +1004,8 @@ export declare function updateDbLink(data: DbLinkInfo): Promise<DbLinkInfo>;
|
|
|
970
1004
|
export declare function deleteDbLink(id: number): Promise<void>;
|
|
971
1005
|
/** @returns 后端返回的连通性结果(多为 boolean) */
|
|
972
1006
|
export declare function testDbLinkConnect(id: number): Promise<unknown>;
|
|
1007
|
+
/** Test a database connection configuration before it is saved. */
|
|
1008
|
+
export declare function testDbLinkConfigConnect(data: DbLinkInfo): Promise<boolean>;
|
|
973
1009
|
export interface DbAnalysisStartResult {
|
|
974
1010
|
planId: string;
|
|
975
1011
|
estimatedMinutes: number;
|
|
@@ -998,12 +1034,11 @@ export interface RemoteApp {
|
|
|
998
1034
|
[key: string]: any;
|
|
999
1035
|
}
|
|
1000
1036
|
export declare function listRemoteApps(): Promise<RemoteApp[]>;
|
|
1001
|
-
/**
|
|
1002
|
-
export type AppRoleType = "ADMIN" | "DEV" | "
|
|
1003
|
-
/** 资源权限动作枚举(工作台 checkbox 值) */
|
|
1004
|
-
export type PermitAction = "0" | "access" | "default";
|
|
1037
|
+
/** 研发态角色/用户组类型 */
|
|
1038
|
+
export type AppRoleType = "ADMIN" | "DEV" | "OWNER" | "CUSTOM";
|
|
1005
1039
|
export interface AppRole {
|
|
1006
1040
|
id: number;
|
|
1041
|
+
appCode?: string;
|
|
1007
1042
|
roleName: string;
|
|
1008
1043
|
remark?: string;
|
|
1009
1044
|
roleType: AppRoleType;
|
|
@@ -1021,42 +1056,18 @@ export interface RoleUserRef {
|
|
|
1021
1056
|
export interface RoleUsers {
|
|
1022
1057
|
id: number;
|
|
1023
1058
|
roleName: string;
|
|
1024
|
-
roleType: "ADMIN" | "DEV" | "
|
|
1059
|
+
roleType: "ADMIN" | "DEV" | "OWNER" | "CUSTOM";
|
|
1025
1060
|
userList: RoleUserRef[];
|
|
1026
1061
|
applyUserList?: RoleUserRef[];
|
|
1027
1062
|
}
|
|
1028
|
-
export interface
|
|
1029
|
-
|
|
1030
|
-
resourceCode: string;
|
|
1031
|
-
resourceName: string;
|
|
1032
|
-
allowed?: boolean;
|
|
1033
|
-
allowedActions: PermitAction[];
|
|
1034
|
-
menuType: "folder" | "lowcode";
|
|
1035
|
-
pageId: number | null;
|
|
1036
|
-
pageNodeList: MenuResource[] | null;
|
|
1037
|
-
}
|
|
1038
|
-
export interface ApiResource {
|
|
1039
|
-
resourceType: "API";
|
|
1040
|
-
resourceName: string;
|
|
1041
|
-
datasetCode: string;
|
|
1042
|
-
apiType: "DATASET" | "OTHER";
|
|
1043
|
-
apiList?: Record<string, PermitAction[]>;
|
|
1044
|
-
}
|
|
1045
|
-
export interface PagePermitResourceSlot {
|
|
1046
|
-
resourceCode: string;
|
|
1047
|
-
resourceType: "MENU" | "DATA_CREATE" | "DATA_UPDATE" | "DATA_DELETE" | "DATA_DETAIL" | "DATA_EXPORT" | "DATA_ROW";
|
|
1048
|
-
rolePermit: AppRole[];
|
|
1049
|
-
}
|
|
1050
|
-
export interface PagePermit {
|
|
1051
|
-
menuId: number;
|
|
1063
|
+
export interface DevUserRoleRelation {
|
|
1064
|
+
id: number;
|
|
1052
1065
|
appCode: string;
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
dataExport?: PagePermitResourceSlot;
|
|
1059
|
-
dataPermit?: PagePermitResourceSlot;
|
|
1066
|
+
userId: number;
|
|
1067
|
+
username?: string;
|
|
1068
|
+
status?: string;
|
|
1069
|
+
roleType: AppRoleType;
|
|
1070
|
+
roleId: number;
|
|
1060
1071
|
}
|
|
1061
1072
|
/** 租户成员(查人:nickname/username → userId) */
|
|
1062
1073
|
export interface TenantMember {
|
|
@@ -1097,60 +1108,40 @@ export declare function listAppRoles(appCode: string, options?: {
|
|
|
1097
1108
|
items: AppRole[];
|
|
1098
1109
|
paging?: Paging;
|
|
1099
1110
|
}>;
|
|
1100
|
-
/** GET /smartapi/permit/role/get-one?id=:按主键读取单个用户组 */
|
|
1101
|
-
export declare function getAppRole(id: number): Promise<AppRole | null>;
|
|
1102
|
-
/**
|
|
1103
|
-
* POST /smartapi/permit/role/create:创建自定义用户组(服务端固定 roleType=CUSTOM)。
|
|
1104
|
-
* 服务端返回创建后的完整角色对象。
|
|
1105
|
-
*/
|
|
1106
|
-
export declare function createAppRole(input: {
|
|
1107
|
-
appCode: string;
|
|
1108
|
-
roleName: string;
|
|
1109
|
-
remark?: string;
|
|
1110
|
-
}): Promise<AppRole>;
|
|
1111
1111
|
/**
|
|
1112
|
-
* POST /smartapi/permit/role/update
|
|
1113
|
-
* - 改名/备注:传 roleName / remark(不传 roleType / permits)。
|
|
1114
|
-
* - 保存菜单权限:roleType="PAGE" + permits(resourceCode → actions)。
|
|
1115
|
-
* - 保存 API 权限:roleType="API" + permits(resourceCode → actions)。
|
|
1112
|
+
* POST /smartapi/permit/role/update:更新研发态自定义用户组的名称或备注。
|
|
1116
1113
|
*/
|
|
1117
1114
|
export declare function updateAppRole(input: {
|
|
1118
1115
|
id: number;
|
|
1119
1116
|
appCode: string;
|
|
1120
|
-
roleType?: "PAGE" | "API";
|
|
1121
1117
|
roleName?: string;
|
|
1122
1118
|
remark?: string;
|
|
1123
|
-
permits?: Record<string, PermitAction[]>;
|
|
1124
1119
|
}): Promise<unknown>;
|
|
1125
1120
|
/** POST /smartapi/permit/role/delete:删除用户组 */
|
|
1126
1121
|
export declare function deleteAppRole(id: number): Promise<void>;
|
|
1127
|
-
/**
|
|
1128
|
-
* POST /smartapi/permit/role/get-permit-list:应用下所有用户组 + 特殊组
|
|
1129
|
-
* ({id:-1, roleType:"ALL"}, {id:0, roleType:"SELF"})。用于解析 SELF/ALL 字面量。
|
|
1130
|
-
*/
|
|
1131
|
-
export declare function listPermitRoles(appCode: string, options?: {
|
|
1132
|
-
needSelf?: boolean;
|
|
1133
|
-
needPublic?: boolean;
|
|
1134
|
-
}): Promise<AppRole[]>;
|
|
1135
|
-
/** POST /smartapi/permit/resource/get-menu-list:角色当前菜单资源矩阵 */
|
|
1136
|
-
export declare function getRoleMenuResources(appCode: string, roleId: number): Promise<MenuResource[]>;
|
|
1137
|
-
/**
|
|
1138
|
-
* POST /smartapi/permit/resource/get-api-list:角色当前 API 资源矩阵。
|
|
1139
|
-
* 服务端标 @Deprecated,但为 datasetCode→resourceCode 映射与全量状态的唯一来源;
|
|
1140
|
-
* 仅供 permit service 内部读取,不做公开命令(见 spec §3.2)。
|
|
1141
|
-
*/
|
|
1142
|
-
export declare function getRoleApiResources(appCode: string, roleId: number): Promise<ApiResource[]>;
|
|
1143
1122
|
/** POST /smartapi/permit/user-role/get-user-list:应用下所有用户组的成员(全量) */
|
|
1144
1123
|
export declare function listRoleUsers(appCode: string): Promise<RoleUsers[]>;
|
|
1145
|
-
/**
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1124
|
+
/** POST /smartapi/permit/user-role/get-list:分页读取研发态成员关系。 */
|
|
1125
|
+
export declare function listDevUserRoleRelations(appCode: string, options?: {
|
|
1126
|
+
userId?: number;
|
|
1127
|
+
roleId?: number;
|
|
1128
|
+
roleType?: AppRoleType;
|
|
1129
|
+
currentPage?: number;
|
|
1130
|
+
pageSize?: number;
|
|
1131
|
+
}): Promise<{
|
|
1132
|
+
items: DevUserRoleRelation[];
|
|
1133
|
+
paging?: Paging;
|
|
1134
|
+
}>;
|
|
1135
|
+
/** POST /smartapi/permit/user-role/create:新增一条研发态成员关系。 */
|
|
1136
|
+
export declare function createDevUserRole(input: {
|
|
1137
|
+
appCode: string;
|
|
1138
|
+
userId: number;
|
|
1139
|
+
username?: string;
|
|
1140
|
+
roleType: AppRoleType;
|
|
1141
|
+
roleId: number;
|
|
1142
|
+
}): Promise<DevUserRoleRelation>;
|
|
1143
|
+
/** POST /smartapi/permit/user-role/delete:按关系主键删除研发态成员关系。 */
|
|
1144
|
+
export declare function deleteDevUserRole(id: number): Promise<boolean>;
|
|
1154
1145
|
/** GET /userTenant/queryBelongsTenants:当前登录账号所属的启用租户关系 */
|
|
1155
1146
|
export declare function listCurrentUserTenantMemberships(): Promise<TenantMembership[]>;
|
|
1156
1147
|
/** GET /userTenant/getByTenantCode?code=:保留全部成员状态的租户目录 */
|
package/lib/core/api-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a226_0x333717=a226_0x2af6;(function(_0x2aa791,_0x10a0ef){const _0x28c11e=a226_0x2af6,_0x5bae3b=_0x2aa791();while(!![]){try{const _0xc53dba=parseInt(_0x28c11e(0x2a3))/0x1+-parseInt(_0x28c11e(0x266))/0x2+parseInt(_0x28c11e(0x1f7))/0x3*(parseInt(_0x28c11e(0x27b))/0x4)+-parseInt(_0x28c11e(0x1f5))/0x5*(parseInt(_0x28c11e(0x1cd))/0x6)+parseInt(_0x28c11e(0x2a6))/0x7+parseInt(_0x28c11e(0x211))/0x8*(-parseInt(_0x28c11e(0x20e))/0x9)+parseInt(_0x28c11e(0x1c8))/0xa;if(_0xc53dba===_0x10a0ef)break;else _0x5bae3b['push'](_0x5bae3b['shift']());}catch(_0x2f7b0c){_0x5bae3b['push'](_0x5bae3b['shift']());}}}(a226_0x534d,0x97aef));import{readFile}from'node:fs/promises';import{basename}from'node:path';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain,getRuntimeDomain}from'../constant/domain.js';import{getEnv}from'../constant/env.js';import{CliError,CliErrors}from'../errors.js';import{extractList,extractPaging}from'../framework/response.js';import{normalizeEntityWithIdResponse}from'../utils/entity-with-id.js';import{logger}from'../utils/logger.js';let _activeCookie;export function setActiveCookie(_0x4bcd85){_activeCookie=_0x4bcd85||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}const DEFAULT_REQUEST_TIMEOUT_MS=0x7530,ER_CONFIG_REQUEST_TIMEOUT_MS=0x1d4c0,TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS=0x57e40,PLATFORM_TRANSPORT_FAILURE=Symbol(a226_0x333717(0x298)),PLATFORM_ERROR_CODE=Symbol('platform-error-code');export function isPlatformTransportFailure(_0xc4c383){return Boolean(_0xc4c383&&typeof _0xc4c383==='object'&&_0xc4c383[PLATFORM_TRANSPORT_FAILURE]===!![]);}export function getPlatformErrorCode(_0x4d7f84){const _0x4935f6=a226_0x333717;if(!_0x4d7f84||typeof _0x4d7f84!==_0x4935f6(0x20c))return undefined;const _0x2a8183=_0x4d7f84[PLATFORM_ERROR_CODE];return typeof _0x2a8183==='string'&&_0x2a8183?_0x2a8183:undefined;}function createPlatformApiError(_0x48c3ef,_0x25252a){const _0x463668=a226_0x333717,_0x1fd1e9=typeof _0x25252a===_0x463668(0x272)?_0x25252a[_0x463668(0x1d3)]():typeof _0x25252a===_0x463668(0x230)?String(_0x25252a):'',_0x392619=CliErrors[_0x463668(0x1aa)](_0x48c3ef,_0x1fd1e9?_0x463668(0x29d)+_0x1fd1e9:undefined);return _0x1fd1e9&&(Object[_0x463668(0x26b)](_0x392619,PLATFORM_ERROR_CODE,{'value':_0x1fd1e9}),Object[_0x463668(0x26b)](_0x392619,_0x463668(0x289),{'value':{'remoteErrorCode':_0x1fd1e9},'enumerable':![]})),_0x392619;}function createFetchFailureError(_0x21d3fb,_0x9e6f9e){const _0x4b83fe=a226_0x333717,_0x3a23bc=_0x9e6f9e instanceof Error?_0x9e6f9e[_0x4b83fe(0x1e4)]:String(_0x9e6f9e),_0x548a53=CliErrors[_0x4b83fe(0x1aa)](_0x4b83fe(0x1ab)+_0x21d3fb+(_0x3a23bc?'\x20('+_0x3a23bc+')':''),_0x4b83fe(0x246));return Object['defineProperty'](_0x548a53,PLATFORM_TRANSPORT_FAILURE,{'value':!![]}),_0x548a53;}function createRequestTimeoutError(_0x1a29b9,_0x11a5dd){const _0x1c98f8=a226_0x333717,_0x2d4dcd=CliErrors[_0x1c98f8(0x1aa)](_0x1c98f8(0x1b0)+_0x1a29b9);return _0x11a5dd&&Object[_0x1c98f8(0x26b)](_0x2d4dcd,PLATFORM_TRANSPORT_FAILURE,{'value':!![]}),_0x2d4dcd;}function createIndeterminateResponseError(_0x2fc693){const _0x3e32e4=a226_0x333717,_0x553fdd=CliErrors['apiError'](_0x2fc693+_0x3e32e4(0x1fb),'The\x20server\x20outcome\x20is\x20indeterminate.\x20Verify\x20current\x20state\x20before\x20retrying\x20any\x20mutation.');return Object[_0x3e32e4(0x26b)](_0x553fdd,PLATFORM_TRANSPORT_FAILURE,{'value':!![]}),_0x553fdd;}async function apiRequest(_0x2c9785,_0xcae68d={}){const _0x28eaf1=a226_0x333717,{method:method='GET',body:_0xdb2e88,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![],allowNonJsonSuccess:allowNonJsonSuccess=![],indeterminateMutation:indeterminateMutation=![]}=_0xcae68d,_0x4dc5da=useRuntime?getRuntimeDomain():getApiDomain(),_0x2a1df5=_activeCookie||getCookie(),_0x16529b=''+_0x4dc5da+_0x2c9785,_0x315bcf=new AbortController(),_0x12d080=setTimeout(()=>_0x315bcf[_0x28eaf1(0x232)](),timeout);try{const _0x373916=await fetch(_0x16529b,{'method':method,'headers':{'Content-Type':_0x28eaf1(0x263),'Cookie':_0x2a1df5,'X-Invoke-Source':'cli:rabetbase',...headers},'body':_0xdb2e88?JSON[_0x28eaf1(0x2a5)](_0xdb2e88):undefined,'signal':_0x315bcf[_0x28eaf1(0x1c5)]});let _0x533c92;try{_0x533c92=await _0x373916[_0x28eaf1(0x1ed)]();}catch(_0x1e2c67){if(_0x373916['ok']&&_0x1e2c67 instanceof Error&&_0x1e2c67[_0x28eaf1(0x1e7)]===_0x28eaf1(0x247))throw createRequestTimeoutError(_0x16529b,indeterminateMutation);if(_0x373916['ok']&&indeterminateMutation)throw createIndeterminateResponseError(_0x2c9785);if(_0x373916['ok']&&allowNonJsonSuccess)return{'success':!![],'data':undefined};throw CliErrors[_0x28eaf1(0x1aa)](_0x28eaf1(0x24a)+_0x373916[_0x28eaf1(0x262)]+')',_0x373916[_0x28eaf1(0x262)]>=0x190?'Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.':undefined);}const _0x49a25b=_0x533c92!==null&&typeof _0x533c92==='object'&&!Array[_0x28eaf1(0x2bc)](_0x533c92);if(!_0x373916['ok']){const _0x4afa69=_0x49a25b?_0x533c92:undefined;throw CliErrors[_0x28eaf1(0x1aa)](_0x4afa69?.[_0x28eaf1(0x21b)]||_0x4afa69?.[_0x28eaf1(0x1e4)]||'API\x20error:\x20'+_0x373916[_0x28eaf1(0x262)],_0x4afa69?.[_0x28eaf1(0x21c)]?'API\x20error\x20code:\x20'+_0x4afa69[_0x28eaf1(0x21c)]:undefined);}if(indeterminateMutation){if(!_0x49a25b)throw createIndeterminateResponseError(_0x2c9785);if(_0x533c92[_0x28eaf1(0x1cb)]===![])throw CliErrors[_0x28eaf1(0x1aa)](_0x533c92[_0x28eaf1(0x21b)]||_0x533c92[_0x28eaf1(0x1e4)]||'API\x20error:\x20'+_0x373916[_0x28eaf1(0x262)],_0x533c92['errorCode']?_0x28eaf1(0x29d)+_0x533c92['errorCode']:undefined);if(_0x533c92[_0x28eaf1(0x1cb)]!==!![])throw createIndeterminateResponseError(_0x2c9785);return _0x533c92;}if(_0x533c92===null||_0x533c92===undefined)throw CliErrors['apiError'](_0x28eaf1(0x1ce)+_0x373916[_0x28eaf1(0x262)]+')');if(_0x533c92[_0x28eaf1(0x1cb)]===![])throw CliErrors[_0x28eaf1(0x1aa)](_0x533c92[_0x28eaf1(0x21b)]||_0x533c92['message']||'API\x20error:\x20'+_0x373916['status'],_0x533c92[_0x28eaf1(0x21c)]?_0x28eaf1(0x29d)+_0x533c92['errorCode']:undefined);return _0x533c92;}catch(_0x1a8f17){if(_0x1a8f17 instanceof CliError)throw _0x1a8f17;if(_0x1a8f17 instanceof Error&&_0x1a8f17[_0x28eaf1(0x1e7)]==='AbortError')throw createRequestTimeoutError(_0x16529b,indeterminateMutation);throw createFetchFailureError(_0x16529b,_0x1a8f17);}finally{clearTimeout(_0x12d080);}}async function apiFormRequest(_0x42c812,_0x34c2f0,_0x352653={}){const _0x225d42=a226_0x333717,{timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS}=_0x352653,_0x4cfb87=_activeCookie||getCookie(),_0x10709b=''+getApiDomain()+_0x42c812,_0xff27b7=new AbortController(),_0xa9d509=setTimeout(()=>_0xff27b7['abort'](),timeout);try{const _0x1f2021=await fetch(_0x10709b,{'method':_0x225d42(0x1d2),'headers':{'Cookie':_0x4cfb87,'X-Invoke-Source':_0x225d42(0x240)},'body':_0x34c2f0,'signal':_0xff27b7[_0x225d42(0x1c5)]});let _0x53715a;try{_0x53715a=await _0x1f2021['json']();}catch(_0xc20b07){if(_0xc20b07 instanceof Error&&_0xc20b07[_0x225d42(0x1e7)]===_0x225d42(0x247))throw CliErrors['apiError']('Request\x20timeout:\x20'+_0x10709b);throw CliErrors['apiError']('API\x20returned\x20non-JSON\x20response\x20(HTTP\x20'+_0x1f2021['status']+')',_0x1f2021['status']>=0x190?_0x225d42(0x283):undefined);}if(!_0x1f2021['ok']||_0x53715a['success']===![])throw CliErrors[_0x225d42(0x1aa)](_0x53715a[_0x225d42(0x21b)]||_0x53715a['message']||_0x225d42(0x216)+_0x1f2021[_0x225d42(0x262)],_0x53715a[_0x225d42(0x21c)]?_0x225d42(0x29d)+_0x53715a['errorCode']:undefined);return _0x53715a;}catch(_0x106d05){if(_0x106d05 instanceof CliError)throw _0x106d05;if(_0x106d05 instanceof Error&&_0x106d05[_0x225d42(0x1e7)]===_0x225d42(0x247))throw CliErrors['apiError'](_0x225d42(0x1b0)+_0x10709b);throw createFetchFailureError(_0x10709b,_0x106d05);}finally{clearTimeout(_0xa9d509);}}export async function uploadDevelopmentFile(_0x49b870,_0x361dec){const _0x1c7742=a226_0x333717,_0x439a1e=await readFile(_0x361dec),_0x4ff286=new FormData();_0x4ff286['append'](_0x1c7742(0x2bb),_0x49b870),_0x4ff286[_0x1c7742(0x1a0)](_0x1c7742(0x1ac),new Blob([new Uint8Array(_0x439a1e)]),basename(_0x361dec));const _0x2fc795=await apiFormRequest(_0x1c7742(0x22f),_0x4ff286);return _0x2fc795['data'];}export async function queryDevelopmentFileUrl(_0x870a7b,_0x38a59b={}){const _0xfa16ca=a226_0x333717,_0x2316a6=await apiRequest(_0xfa16ca(0x2bd),{'method':_0xfa16ca(0x1d2),'body':{'filePath':_0x870a7b,'downloadFlag':_0x38a59b['download']??![],..._0x38a59b[_0xfa16ca(0x1e1)]?{'longTerm':!![]}:{}}});return _0x2316a6[_0xfa16ca(0x289)];}export async function recognizeDevelopmentOcr(_0xe24b45,_0x54365b){const _0x39d197=a226_0x333717,_0x507fd5=new URLSearchParams({'url':_0x54365b[_0x39d197(0x1c0)],'type':_0x54365b[_0x39d197(0x1ad)],'appCode':_0xe24b45}),_0x56fb4e=await apiRequest(_0x39d197(0x1af)+_0x507fd5[_0x39d197(0x23d)](),{'method':_0x39d197(0x280)});return _0x56fb4e['data'];}export const DING_TALK_SANDBOX_BIND_PATH=a226_0x333717(0x28a);export async function bindDingTalkSandboxAccount(_0x460613){const _0x442a90=a226_0x333717,_0x28fb99=await apiRequest(DING_TALK_SANDBOX_BIND_PATH,{'method':_0x442a90(0x1d2),'body':{'dingTalkUserId':_0x460613}});return _0x28fb99[_0x442a90(0x289)];}function isAuthFailure(_0x200775){const _0x4a03a6=a226_0x333717,_0x159660=_0x200775[_0x4a03a6(0x21b)]||_0x200775['message']||_0x200775[_0x4a03a6(0x289)]?.[_0x4a03a6(0x1e4)]||_0x200775['errorMessage']||_0x200775['error']||'';return _0x200775[_0x4a03a6(0x21c)]===_0x4a03a6(0x1a2)||_0x200775['code']===0x191||_0x200775[_0x4a03a6(0x1c3)]==='401'||_0x159660['includes'](_0x4a03a6(0x26f))||_0x159660[_0x4a03a6(0x2af)]('Unauthorized')||_0x159660[_0x4a03a6(0x2af)]('登录')||_0x159660['includes']('认证');}export async function platformFetch(_0x11eec0,_0x3d1efe){const _0x1af926=a226_0x333717;let _0x13752e;try{_0x13752e=await fetch(_0x11eec0,{'method':_0x3d1efe[_0x1af926(0x1ff)]??_0x1af926(0x280),'headers':{'Content-Type':'application/json','Cookie':_0x3d1efe['cookie'],'X-Invoke-Source':_0x1af926(0x240)},..._0x3d1efe[_0x1af926(0x234)]&&{'body':JSON[_0x1af926(0x2a5)](_0x3d1efe[_0x1af926(0x234)])}});}catch(_0x2a0a89){throw createFetchFailureError(_0x11eec0,_0x2a0a89);}let _0x53e6da;try{_0x53e6da=await _0x13752e[_0x1af926(0x1ed)]();}catch(_0x2ad719){if(!_0x13752e['ok']){if(_0x13752e[_0x1af926(0x262)]===0x191)throw CliErrors[_0x1af926(0x25f)]();throw CliErrors[_0x1af926(0x1aa)](_0x3d1efe[_0x1af926(0x2ba)]+_0x1af926(0x23a)+_0x13752e[_0x1af926(0x262)]);}throw createFetchFailureError(_0x11eec0,_0x2ad719);}if(_0x53e6da===null||typeof _0x53e6da!==_0x1af926(0x20c)||Array[_0x1af926(0x2bc)](_0x53e6da)){if(_0x13752e[_0x1af926(0x262)]===0x191)throw CliErrors['authRequired']();if(_0x13752e['ok'])throw createIndeterminateResponseError(_0x3d1efe[_0x1af926(0x2ba)]);throw CliErrors[_0x1af926(0x1aa)](_0x3d1efe[_0x1af926(0x2ba)]+_0x1af926(0x1f9)+(!_0x13752e['ok']?_0x1af926(0x238)+_0x13752e[_0x1af926(0x262)]:'')+_0x1af926(0x287));}const _0x367390=typeof _0x53e6da[_0x1af926(0x21c)]==='string'||typeof _0x53e6da[_0x1af926(0x21c)]===_0x1af926(0x230),_0x5aa7c2=_0x367390?String(_0x53e6da[_0x1af926(0x21c)])[_0x1af926(0x1d3)]():'',_0x197f3b=_0x53e6da[_0x1af926(0x1cb)]===![]||_0x367390&&_0x5aa7c2!==_0x1af926(0x265);if(!_0x13752e['ok']||_0x197f3b){if(_0x13752e[_0x1af926(0x262)]===0x191||isAuthFailure(_0x53e6da))throw CliErrors[_0x1af926(0x25f)]();throw createPlatformApiError(_0x53e6da[_0x1af926(0x21b)]||_0x53e6da[_0x1af926(0x1e4)]||_0x3d1efe['label']+_0x1af926(0x1f9)+(!_0x13752e['ok']?_0x1af926(0x238)+_0x13752e[_0x1af926(0x262)]:''),_0x53e6da['errorCode']??_0x53e6da['code']);}if(_0x53e6da[_0x1af926(0x1cb)]!==!![]||_0x367390&&_0x5aa7c2!=='0000')throw createIndeterminateResponseError(_0x3d1efe['label']);return _0x53e6da['data'];}export async function platformRequest(_0x2c8f97,_0x52bade){const _0x5e5c2e=a226_0x333717;if(/^https?:\/\//i[_0x5e5c2e(0x244)](_0x2c8f97))throw CliErrors[_0x5e5c2e(0x22d)]('platformRequest\x20expects\x20an\x20API\x20path,\x20got\x20absolute\x20URL:\x20'+_0x2c8f97,'Use\x20platformFetch\x20only\x20for\x20legacy\x20absolute-URL\x20calls.');const _0x24ecca=_0x2c8f97[_0x5e5c2e(0x2a1)]('/')?_0x2c8f97:'/'+_0x2c8f97;return platformFetch(''+getApiDomain()+_0x24ecca,_0x52bade);}const MAX_KNOWLEDGE_BASE_PAGE_SIZE=0x64;function parseKnowledgeBaseInteger(_0x720169,_0x53f376){const _0x428de4=a226_0x333717,_0x43f585=typeof _0x720169===_0x428de4(0x230)?_0x720169:typeof _0x720169==='string'&&/^(0|[1-9]\d*)$/[_0x428de4(0x244)](_0x720169)?Number(_0x720169):Number[_0x428de4(0x2be)],_0x23f2e5=Number[_0x428de4(0x295)](_0x43f585)&&(_0x53f376==='id'?_0x43f585>0x0:_0x43f585>=0x0);if(!_0x23f2e5)throw CliErrors[_0x428de4(0x1aa)](_0x428de4(0x2ab)+_0x53f376+'.');return _0x43f585;}function parseKnowledgeBaseText(_0x18c376,_0x454f7c){const _0x41936e=a226_0x333717;if(typeof _0x18c376===_0x41936e(0x272)&&(_0x454f7c==='content'||_0x18c376['trim']()))return _0x18c376;throw CliErrors[_0x41936e(0x1aa)](_0x41936e(0x229)+_0x454f7c+'.');}function parseKnowledgeBaseRecord(_0x179af6){const _0x1fd59c=a226_0x333717;if(!_0x179af6||typeof _0x179af6!==_0x1fd59c(0x20c)||Array[_0x1fd59c(0x2bc)](_0x179af6))throw CliErrors[_0x1fd59c(0x1aa)]('Knowledge-base\x20API\x20returned\x20an\x20invalid\x20record\x20contract.');const _0x5dbba0=_0x179af6;if(_0x5dbba0['scope']!==_0x1fd59c(0x210)&&_0x5dbba0[_0x1fd59c(0x20b)]!=='personal')throw CliErrors[_0x1fd59c(0x1aa)](_0x1fd59c(0x1bc));const _0x199707={'id':parseKnowledgeBaseInteger(_0x5dbba0['id'],'id'),'scope':_0x5dbba0[_0x1fd59c(0x20b)],'appCode':parseKnowledgeBaseText(_0x5dbba0[_0x1fd59c(0x2bb)],_0x1fd59c(0x2bb)),'title':parseKnowledgeBaseText(_0x5dbba0['title'],'title'),'version':parseKnowledgeBaseInteger(_0x5dbba0['version'],_0x1fd59c(0x1f6)),'content':parseKnowledgeBaseText(_0x5dbba0[_0x1fd59c(0x201)],_0x1fd59c(0x201))};return(_0x5dbba0['createTime']===null||typeof _0x5dbba0[_0x1fd59c(0x29b)]===_0x1fd59c(0x272)||typeof _0x5dbba0['createTime']===_0x1fd59c(0x230))&&(_0x199707[_0x1fd59c(0x29b)]=_0x5dbba0[_0x1fd59c(0x29b)]),(_0x5dbba0[_0x1fd59c(0x269)]===null||typeof _0x5dbba0[_0x1fd59c(0x269)]===_0x1fd59c(0x272)||typeof _0x5dbba0[_0x1fd59c(0x269)]===_0x1fd59c(0x230))&&(_0x199707[_0x1fd59c(0x269)]=_0x5dbba0[_0x1fd59c(0x269)]),_0x199707;}export async function listEnterpriseKnowledgeBases(_0x1e2825,_0x26ebd5={}){const _0x571afc=a226_0x333717,_0x278828=_0x26ebd5['pageSize']??0x32;if(!Number[_0x571afc(0x295)](_0x278828)||_0x278828<0x1||_0x278828>MAX_KNOWLEDGE_BASE_PAGE_SIZE)throw CliErrors[_0x571afc(0x22d)]('Knowledge-base\x20pageSize\x20must\x20be\x20an\x20integer\x20between\x201\x20and\x20'+MAX_KNOWLEDGE_BASE_PAGE_SIZE+'.');const _0x43ae60=await platformRequest(_0x571afc(0x25e),{'method':_0x571afc(0x1d2),'cookie':_0x1e2825,'label':'List\x20enterprise\x20knowledge\x20bases','body':{'currentPage':_0x26ebd5['currentPage']??0x1,'pageSize':_0x278828,'scope':_0x571afc(0x210),..._0x26ebd5[_0x571afc(0x2bb)]?{'appCode':_0x26ebd5[_0x571afc(0x2bb)]}:{},..._0x26ebd5[_0x571afc(0x294)]?{'title':_0x26ebd5['title']}:{}}});if(!_0x43ae60||typeof _0x43ae60!==_0x571afc(0x20c)||Array[_0x571afc(0x2bc)](_0x43ae60)||!Array[_0x571afc(0x2bc)](_0x43ae60['tableData']))throw CliErrors[_0x571afc(0x1aa)](_0x571afc(0x1e5));const _0x2c553c=extractPaging(_0x43ae60);if(!_0x2c553c||!Number[_0x571afc(0x227)](_0x2c553c[_0x571afc(0x267)])||!Number[_0x571afc(0x227)](_0x2c553c[_0x571afc(0x214)])||!Number[_0x571afc(0x227)](_0x2c553c[_0x571afc(0x296)])||_0x2c553c['currentPage']<0x1||_0x2c553c['pageSize']<0x1||_0x2c553c[_0x571afc(0x214)]>MAX_KNOWLEDGE_BASE_PAGE_SIZE||_0x2c553c[_0x571afc(0x296)]<0x0)throw CliErrors['apiError'](_0x571afc(0x237));return{'items':extractList(_0x43ae60)[_0x571afc(0x29e)](parseKnowledgeBaseRecord),'paging':_0x2c553c};}export async function getEnterpriseKnowledgeBase(_0x4b557d,_0x3cc99e){const _0x294ea7=a226_0x333717,_0x165594=await platformRequest('/admin/knowledge-base/get-one'+buildQuery({'id':_0x3cc99e}),{'cookie':_0x4b557d,'label':_0x294ea7(0x21d)});return parseKnowledgeBaseRecord(_0x165594);}export async function createEnterpriseKnowledgeBase(_0x1ee456,_0x4c9c82){const _0x40ab34=a226_0x333717,_0x2e363c=await platformRequest(_0x40ab34(0x203),{'method':_0x40ab34(0x1d2),'cookie':_0x1ee456,'label':_0x40ab34(0x2b7),'body':{'scope':_0x40ab34(0x210),..._0x4c9c82}});return parseKnowledgeBaseRecord(_0x2e363c);}export async function updateEnterpriseKnowledgeBase(_0x281147,_0x436312){const _0x9e3cd6=a226_0x333717;if(_0x436312[_0x9e3cd6(0x294)]===undefined&&_0x436312['content']===undefined)throw CliErrors['validation']('Knowledge-base\x20update\x20requires\x20title\x20or\x20content.');const _0x187c09=await platformRequest(_0x9e3cd6(0x277),{'method':_0x9e3cd6(0x1d2),'cookie':_0x281147,'label':_0x9e3cd6(0x256),'body':{'id':_0x436312['id'],..._0x436312[_0x9e3cd6(0x294)]!==undefined?{'title':_0x436312[_0x9e3cd6(0x294)]}:{},..._0x436312[_0x9e3cd6(0x201)]!==undefined?{'content':_0x436312[_0x9e3cd6(0x201)]}:{}}});return parseKnowledgeBaseRecord(_0x187c09);}export async function deleteEnterpriseKnowledgeBase(_0x2e1daa,_0x3f8a45){const _0x23a981=a226_0x333717;await platformRequest(_0x23a981(0x258),{'method':_0x23a981(0x1d2),'cookie':_0x2e1daa,'label':_0x23a981(0x1e2),'body':{'id':_0x3f8a45}});}function cleanNewlines(_0x464b59){const _0x2c7d8e=a226_0x333717;return _0x464b59[_0x2c7d8e(0x202)](/[\r\n]+/g,'\x20')[_0x2c7d8e(0x1d3)]();}function cleanDatasetName(_0x299a46){const _0x2de487=a226_0x333717;if(!_0x299a46[_0x2de487(0x1e7)])return _0x299a46;return{..._0x299a46,'name':cleanNewlines(_0x299a46[_0x2de487(0x1e7)])};}export async function fetchModelList(_0x2aa3c3,_0xdaac01){const _0x109508=a226_0x333717,_0x586bda=getEnv(),_0xc2af19=new URLSearchParams({'appcode':_0x2aa3c3,'otype':'array'}),_0x1ebe4e=_0x109508(0x271)+_0xc2af19[_0x109508(0x23d)]();logger[_0x109508(0x250)](_0x109508(0x241),'正在从服务器拉取模型列表...\x20(环境:\x20'+_0x586bda+')',{'apiPath':_0x1ebe4e});const _0x1be9b2=await platformRequest(_0x1ebe4e,{'cookie':_0xdaac01,'label':'Fetch\x20datasets'}),_0x4b6cad=(_0x1be9b2[_0x109508(0x22b)]??[])[_0x109508(0x29e)](cleanDatasetName);return{'configArray':_0x4b6cad,'count':_0x4b6cad['length']};}export async function fetchDatasetDoc(_0x1de9f9){const _0x11fc6a=a226_0x333717,{appCode:_0x2ba95c,cookie:_0x7e4096,datasetCode:_0x55aaf8,datasetId:_0xd66ee9,extraParams:_0x1f9cce}=_0x1de9f9,_0x5f370c=await platformRequest(_0x11fc6a(0x29a),{'method':_0x11fc6a(0x1d2),'body':{'appCode':_0x2ba95c,'datasetCode':_0x55aaf8,'datasetId':_0xd66ee9,..._0x1f9cce||{}},'cookie':_0x7e4096,'label':_0x11fc6a(0x254)+_0x55aaf8+')'});if(!_0x5f370c||typeof _0x5f370c[_0x11fc6a(0x1da)]!==_0x11fc6a(0x272))throw new Error('Invalid\x20response\x20format\x20('+_0x55aaf8+_0x11fc6a(0x1b8));return _0x5f370c[_0x11fc6a(0x1da)];}export async function getMenuTree(_0x27a391,_0x2fe0d){const _0x37ebe2=a226_0x333717,_0x305550=new URLSearchParams({'appCode':_0x27a391});return platformRequest(_0x37ebe2(0x245)+_0x305550['toString'](),{'cookie':_0x2fe0d,'label':_0x37ebe2(0x200)});}function a226_0x2af6(_0x6e359,_0x43c831){_0x6e359=_0x6e359-0x19e;const _0x534d32=a226_0x534d();let _0x2af6e9=_0x534d32[_0x6e359];return _0x2af6e9;}export async function createMenuRecord(_0x13eefb,_0x1b08e3,_0x1e4bf0){const _0x1f8aac=a226_0x333717;return platformRequest(_0x1f8aac(0x1d8),{'method':_0x1f8aac(0x1d2),'body':_0x13eefb,'cookie':_0x1b08e3,'label':_0x1e4bf0});}export async function updateMenuRecord(_0x1a6fb4,_0x46c912,_0x25c7ef){const _0x50106a=a226_0x333717;return platformRequest(_0x50106a(0x20d),{'method':_0x50106a(0x1d2),'body':_0x1a6fb4,'cookie':_0x46c912,'label':_0x25c7ef});}export async function deleteMenuRecord(_0x3b7d68,_0xf4bc66,_0x3698db){const _0x25ec08=a226_0x333717;return platformRequest(_0x25ec08(0x251),{'method':'POST','body':{'id':_0x3b7d68},'cookie':_0xf4bc66,'label':_0x3698db});}export async function batchDeleteMenuRecords(_0x1d46e8,_0x2b14b7,_0x5becaa){const _0x3c7c11=a226_0x333717;return platformRequest('/smartapi/menu/batchDelete',{'method':_0x3c7c11(0x1d2),'body':{'idList':_0x1d46e8},'cookie':_0x2b14b7,'label':_0x5becaa});}export async function startMenuRegroup(_0x236b65,_0x43fda1,_0x62dca){const _0x2acd6a=a226_0x333717;return platformRequest(_0x2acd6a(0x1dc),{'method':_0x2acd6a(0x1d2),'body':_0x236b65,'cookie':_0x43fda1,'label':_0x62dca});}export async function getAsyncTaskStatus(_0xf45be1,_0x289322,_0x36fa99){const _0xf030e0=a226_0x333717,_0x434492=new URLSearchParams({'appCode':_0x289322});return platformRequest(_0xf030e0(0x253)+encodeURIComponent(_0xf45be1)+'?'+_0x434492[_0xf030e0(0x23d)](),{'cookie':_0x36fa99,'label':_0xf030e0(0x221)+_0xf45be1});}export async function listBffScripts(_0x2e5ce7,_0x32f5ef,_0x37045e){const _0x2d5258=a226_0x333717;let _0xa91497=_0x2d5258(0x276)+_0x2e5ce7;if(_0x32f5ef)_0xa91497+='&type='+_0x32f5ef;const _0xefca22=await apiRequest(_0xa91497);let _0x213c7b=extractList(_0xefca22[_0x2d5258(0x289)]);if(_0x37045e?.['scriptName']){const _0x10381a=_0x37045e[_0x2d5258(0x2b0)][_0x2d5258(0x274)]();_0x213c7b=_0x213c7b[_0x2d5258(0x25b)](_0x31b148=>_0x31b148[_0x2d5258(0x1b3)]?.[_0x2d5258(0x274)]()['includes'](_0x10381a)||_0x31b148[_0x2d5258(0x268)]?.[_0x2d5258(0x274)]()['includes'](_0x10381a));}return _0x213c7b;}export async function getBffScriptInfo(_0x591d9f){const _0x14a7ca=a226_0x333717,_0x30c040=await apiRequest(_0x14a7ca(0x1f3)+_0x591d9f);if(!_0x30c040[_0x14a7ca(0x289)])throw CliErrors[_0x14a7ca(0x22d)](_0x14a7ca(0x1e9)+_0x591d9f);return _0x30c040[_0x14a7ca(0x289)];}export async function saveBffScript(_0x2c3438){const _0x5030a7=a226_0x333717,_0x4cc1a9=await apiRequest('/api/management/library/scripts/save',{'method':'POST','body':_0x2c3438}),{id:_0x3a2759,entity:_0x3e336f}=normalizeEntityWithIdResponse(_0x4cc1a9[_0x5030a7(0x289)]);if(_0x3a2759!==undefined){const _0x93e65=typeof _0x3e336f[_0x5030a7(0x1b3)]===_0x5030a7(0x272)||typeof _0x3e336f[_0x5030a7(0x223)]===_0x5030a7(0x272)?_0x3e336f:undefined;return{'id':_0x3a2759,'script':_0x93e65};}throw CliErrors[_0x5030a7(0x1aa)](_0x5030a7(0x20a));}export async function deleteBffScript(_0x3e4100){const _0x179559=a226_0x333717;await apiRequest(_0x179559(0x21e),{'method':'POST','body':{'id':_0x3e4100}});}export async function getBffScriptStatistics(_0x3f3199){const _0x3ae281=a226_0x333717,_0x157dca=await apiRequest('/api/management/library/scripts/statistics?appCode='+_0x3f3199);return extractList(_0x157dca[_0x3ae281(0x289)]);}export async function clearBffScriptCache(){const _0x3a223c=a226_0x333717,_0x592fb4=await apiRequest(_0x3a223c(0x1d5),{'method':'POST','useRuntime':!![]});return typeof _0x592fb4[_0x3a223c(0x289)]===_0x3a223c(0x272)?_0x592fb4[_0x3a223c(0x289)]:'';}export async function listBffDatasetOperations(_0x29153c,_0x16302d){const _0x3698d5=a226_0x333717,_0x101f29=await apiRequest(_0x3698d5(0x27e),{'method':'POST','body':{'appCode':_0x29153c,'datasetId':_0x16302d}});return _0x101f29[_0x3698d5(0x289)];}export async function listSqlQueries(_0x150e4f,_0x2bd89d){const _0x25aacd=a226_0x333717,_0x11e042=await apiRequest(_0x25aacd(0x22e),{'method':'POST','body':{'appCode':_0x150e4f,'currentPage':_0x2bd89d?.[_0x25aacd(0x267)]??0x1,'pageSize':_0x2bd89d?.[_0x25aacd(0x214)]??0x32,'sqlCode':_0x2bd89d?.['sqlCode'],'sqlName':_0x2bd89d?.['sqlName']}});return _0x11e042['data'];}export async function getSqlQueryInfo(_0x3138ea,_0x18125b){const _0x139915=a226_0x333717,_0x3bfdb6=await listSqlQueries(_0x3138ea,{'sqlCode':_0x18125b}),_0x21b615=_0x3bfdb6[_0x139915(0x2a0)]?.[0x0];if(!_0x21b615)throw CliErrors[_0x139915(0x22d)](_0x139915(0x1eb)+_0x18125b);return _0x21b615;}export async function getSqlQueryDetail(_0x15fe11){const _0x274e2b=a226_0x333717,_0x26daae=await apiRequest('/smartapi/custom/getUserCustomSql'+(_0x274e2b(0x19e)+encodeURIComponent(_0x15fe11)));if(!_0x26daae['data'])throw CliErrors[_0x274e2b(0x22d)]('SQL\x20query\x20not\x20found:\x20'+_0x15fe11);return _0x26daae[_0x274e2b(0x289)];}export async function getSqlQueryDetailById(_0x89aeb6){const _0x4c1c7c=a226_0x333717,_0x1be66c=await apiRequest(_0x4c1c7c(0x218)+_0x89aeb6);if(!_0x1be66c['data'])throw CliErrors[_0x4c1c7c(0x22d)](_0x4c1c7c(0x1b1)+_0x89aeb6);return _0x1be66c[_0x4c1c7c(0x289)];}export async function createSqlQuery(_0x56bc02){const _0x11917c=a226_0x333717,_0x30cc7d=await apiRequest('/smartapi/custom/saveUserCustomSql',{'method':_0x11917c(0x1d2),'body':_0x56bc02}),{id:_0x3cce18,entity:_0x1befa8}=normalizeEntityWithIdResponse(_0x30cc7d[_0x11917c(0x289)]);if(!(_0x11917c(0x222)in _0x1befa8)&&_0x3cce18)return getSqlQueryDetailById(_0x3cce18);return normalizeSqlQueryEntity(_0x1befa8);}export async function updateSqlQuery(_0x5053ed){const _0xb55038=a226_0x333717,_0x5ab5eb=await apiRequest(_0xb55038(0x2a8),{'method':_0xb55038(0x1d2),'body':_0x5053ed}),{id:_0x16c306,entity:_0x16adad}=normalizeEntityWithIdResponse(_0x5ab5eb[_0xb55038(0x289)]);if(!(_0xb55038(0x222)in _0x16adad)){if(_0x5053ed['sqlCode'])return getSqlQueryDetail(_0x5053ed[_0xb55038(0x222)]);if(_0x16c306)return getSqlQueryDetailById(_0x16c306);}return normalizeSqlQueryEntity(_0x16adad);}export async function deleteSqlQuery(_0x15eecc){const _0x5cf518=a226_0x333717;await apiRequest(_0x5cf518(0x1a7),{'method':_0x5cf518(0x1d2),'body':_0x15eecc});}export async function saveSqlQuery(_0x149f16){const _0x50355c=a226_0x333717,_0x275255=await apiRequest(_0x50355c(0x19f),{'method':'POST','body':_0x149f16});return _0x275255[_0x50355c(0x289)];}function normalizeSqlQueryEntity(_0x41643b){const _0x5887dd=a226_0x333717;return{..._0x41643b,'id':Number(_0x41643b['id']),'dbId':_0x41643b[_0x5887dd(0x2b6)]==null?undefined:Number(_0x41643b[_0x5887dd(0x2b6)]),'version':_0x41643b[_0x5887dd(0x1f6)]==null?undefined:Number(_0x41643b[_0x5887dd(0x1f6)])};}export async function executeSql(_0x299e4d,_0x41baae,_0x3877c7){const _0x3c80fe=a226_0x333717,_0x493af1=await apiRequest(_0x3c80fe(0x1cc),{'method':_0x3c80fe(0x1d2),'body':{'appCode':_0x299e4d,'sqlCode':_0x41baae,..._0x3877c7&&{'params':_0x3877c7}},'useRuntime':!![]});return _0x493af1[_0x3c80fe(0x289)];}export async function executeDatasetDataOperation(_0x152405,_0x1805ea,_0xc5ef77,_0x56e2dc={}){const _0x42656c=a226_0x333717;try{const _0xc69b26=await apiRequest(_0x42656c(0x206)+_0x152405+'/'+_0x1805ea+'/'+_0xc5ef77,{'method':_0x42656c(0x1d2),'body':_0x56e2dc,'useRuntime':!![]});return _0xc69b26[_0x42656c(0x289)];}catch(_0xfd9308){if(_0xc5ef77===_0x42656c(0x243)&&_0xfd9308 instanceof CliError&&_0xfd9308[_0x42656c(0x1c3)]==='api_error'&&_0x56e2dc['id']!==undefined&&_0x56e2dc['id']!==null&&_0x56e2dc['id']!==''){const _0x1b7b60=await apiRequest(_0x42656c(0x206)+_0x152405+'/'+_0x1805ea+_0x42656c(0x21f),{'method':'POST','body':{'where':{'id':{'$eq':_0x56e2dc['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0x19de74=Array['isArray'](_0x1b7b60[_0x42656c(0x289)]?.[_0x42656c(0x2a0)])?_0x1b7b60['data'][_0x42656c(0x2a0)]:[];return _0x19de74[0x0]??null;}throw _0xfd9308;}}export async function listDatasets(_0x5e9bd5,_0x43968e){const _0x56aa8f=a226_0x333717,_0x3dab98={'appCode':_0x5e9bd5,'deleted':_0x43968e?.[_0x56aa8f(0x224)]??![]};if(_0x43968e?.[_0x56aa8f(0x1c3)])_0x3dab98[_0x56aa8f(0x1c3)]=_0x43968e[_0x56aa8f(0x1c3)];if(_0x43968e?.[_0x56aa8f(0x1e7)])_0x3dab98[_0x56aa8f(0x1e7)]=_0x43968e[_0x56aa8f(0x1e7)];const _0x164704=await apiRequest(_0x56aa8f(0x260),{'method':'POST','body':_0x3dab98});return extractList(_0x164704['data']);}export async function deleteDataset(_0x170544,_0x2f57a7){const _0x2cac83=a226_0x333717;await apiRequest(_0x2cac83(0x1f1),{'method':_0x2cac83(0x1d2),'body':{'appCode':_0x170544,'datasetId':_0x2f57a7}});}export async function restoreDataset(_0x28b154,_0x5aed5c){const _0x3f9478=a226_0x333717;await apiRequest('/smartapi/dataset/restore-dataset',{'method':_0x3f9478(0x1d2),'body':{'appCode':_0x28b154,'datasetId':_0x5aed5c}});}export async function previewTextGeneratedDataset(_0x1450a5,_0x434178){const _0x712d84=a226_0x333717,_0x3ad319=await apiRequest('/smartapi/dataset/text-generate/preview',{'method':_0x712d84(0x1d2),'body':{'appCode':_0x1450a5,'datasetName':_0x434178[_0x712d84(0x1b9)],'requirementDescription':_0x434178[_0x712d84(0x26a)]},'timeout':TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS});return _0x3ad319[_0x712d84(0x289)];}export async function startTextGeneratedDataset(_0x2ccf8d,_0x171b31,_0x5ed2b9){const _0x1ba7d5=a226_0x333717,_0x60c381=await apiRequest(_0x1ba7d5(0x2c0),{'method':_0x1ba7d5(0x1d2),'body':{'appCode':_0x2ccf8d,..._0x5ed2b9?.[_0x1ba7d5(0x24d)]?{'clientOperationId':_0x5ed2b9[_0x1ba7d5(0x24d)]}:{},'design':_0x171b31},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x60c381[_0x1ba7d5(0x289)];}export async function getTextGeneratedDatasetStatus(_0x387340,_0x581f73){const _0x53741d=a226_0x333717,_0x230852=new URLSearchParams({'appCode':_0x387340});if(_0x581f73[_0x53741d(0x22a)])_0x230852[_0x53741d(0x1b6)](_0x53741d(0x1c6),_0x581f73[_0x53741d(0x22a)]);else{if(_0x581f73['operationId'])_0x230852[_0x53741d(0x1b6)](_0x53741d(0x1c6),_0x581f73[_0x53741d(0x1c6)]);else _0x581f73[_0x53741d(0x24d)]&&_0x230852[_0x53741d(0x1b6)]('clientOperationId',_0x581f73[_0x53741d(0x24d)]);}const _0x28c286=await apiRequest(_0x53741d(0x242)+_0x230852[_0x53741d(0x23d)]());return _0x28c286[_0x53741d(0x289)];}export async function searchDatasets(_0xc6d896,_0x776b6f){const _0x470a81=a226_0x333717,_0x7e3f60=await listDatasets(_0xc6d896,{'name':_0x776b6f}),_0x1c460=_0x776b6f[_0x470a81(0x274)](),_0x3cd960=new Set(_0x7e3f60['map'](_0x579bd4=>_0x579bd4['id'])),_0x5580d1=_0x7e3f60[_0x470a81(0x25b)](_0x4e4862=>_0x4e4862[_0x470a81(0x1d1)]?.[_0x470a81(0x1ca)]?.[_0x470a81(0x274)]()[_0x470a81(0x2af)](_0x1c460)||_0x4e4862[_0x470a81(0x268)]?.[_0x470a81(0x274)]()[_0x470a81(0x2af)](_0x1c460)),_0x9832ca=await listDatasets(_0xc6d896,{'code':_0x776b6f});for(const _0x3abf1f of _0x9832ca){!_0x3cd960[_0x470a81(0x279)](_0x3abf1f['id'])&&(_0x7e3f60['push'](_0x3abf1f),_0x3cd960[_0x470a81(0x288)](_0x3abf1f['id']));}return _0x7e3f60;}export function normalizeDatasetOperations(_0x530793){const _0x5c226c=a226_0x333717;if(Array[_0x5c226c(0x2bc)](_0x530793))return _0x530793['filter'](_0x40471e=>_0x40471e!=null&&typeof _0x40471e===_0x5c226c(0x20c));if(_0x530793&&typeof _0x530793===_0x5c226c(0x20c))return Object['entries'](_0x530793)[_0x5c226c(0x25b)](([,_0x5ecd60])=>_0x5ecd60!=null&&typeof _0x5ecd60==='object')[_0x5c226c(0x29e)](([_0xfe6859,_0x1434d3])=>({..._0x1434d3,'name':_0x1434d3[_0x5c226c(0x1e7)]??_0x1434d3[_0x5c226c(0x205)]??_0xfe6859}));return[];}export async function getDatasetDetail(_0x11c2b0){const _0x565e82=a226_0x333717,_0x41e8ba=/^\d+$/[_0x565e82(0x244)](_0x11c2b0)?'id':_0x565e82(0x1c3),_0x3bc07f=await apiRequest('/smartapi/dataset/get-driven-data?'+_0x41e8ba+'='+_0x11c2b0);return _0x3bc07f[_0x565e82(0x289)];}export async function updateDrivenData(_0x5cd879){const _0x4bc5f3=a226_0x333717,_0xe4e972=await apiRequest(_0x4bc5f3(0x1ef),{'method':_0x4bc5f3(0x1d2),'body':_0x5cd879});return _0xe4e972[_0x4bc5f3(0x289)];}export async function getDatasetOperations(_0x478b97){const _0x34b491=a226_0x333717,_0x10b884=await getDatasetDetail(_0x478b97),_0x5d092e=normalizeDatasetOperations(_0x10b884[_0x34b491(0x2b1)])[_0x34b491(0x29e)](_0xf2df95=>({'name':_0xf2df95['name']||_0xf2df95[_0x34b491(0x205)],'displayName':_0xf2df95[_0x34b491(0x273)]||_0xf2df95[_0x34b491(0x1e7)],'type':_0xf2df95[_0x34b491(0x1ad)],'method':_0xf2df95[_0x34b491(0x1ff)],'path':_0xf2df95[_0x34b491(0x212)],'enabled':_0xf2df95[_0x34b491(0x228)]??!![],'requestFields':_0xf2df95[_0x34b491(0x27f)],'responseFields':_0xf2df95[_0x34b491(0x1d7)]}));return{'dataset':{'id':_0x10b884['id']??_0x10b884[_0x34b491(0x1a9)],'name':_0x10b884[_0x34b491(0x1e7)],'code':_0x10b884[_0x34b491(0x1c3)]||_0x10b884[_0x34b491(0x299)],'tableName':_0x10b884[_0x34b491(0x1ca)]||_0x10b884[_0x34b491(0x1d1)]?.[_0x34b491(0x1ca)]},'operations':_0x5d092e};}export async function getOperationDetail(_0x1013f9,_0xf6d3f1,_0x17104c){const _0x4f2327=a226_0x333717;let _0x370907=_0xf6d3f1;if(!/^\d+$/[_0x4f2327(0x244)](_0xf6d3f1)){const _0x4569b5=await listDatasets(_0x1013f9,{'code':_0xf6d3f1}),_0x12a842=_0x4569b5['find'](_0x1078e6=>_0x1078e6[_0x4f2327(0x1c3)]===_0xf6d3f1||String(_0x1078e6['id'])===_0xf6d3f1);if(!_0x12a842)throw CliErrors[_0x4f2327(0x22d)](_0x4f2327(0x1e3)+_0xf6d3f1);_0x370907=String(_0x12a842['id']);}const _0x940920=await getDatasetDetail(_0x370907),_0x44ac21=normalizeDatasetOperations(_0x940920['operations'])[_0x4f2327(0x259)](_0x59d1e1=>(_0x59d1e1['name']||_0x59d1e1[_0x4f2327(0x205)])===_0x17104c);if(!_0x44ac21)throw CliErrors[_0x4f2327(0x22d)](_0x4f2327(0x28e)+_0x17104c+'\x22\x20not\x20found\x20in\x20dataset\x20'+_0xf6d3f1);return{'dataset':{'id':_0x940920['id']??_0x940920['modelId'],'name':_0x940920[_0x4f2327(0x1e7)],'code':_0x940920[_0x4f2327(0x1c3)]||_0x940920[_0x4f2327(0x299)],'tableName':_0x940920[_0x4f2327(0x1ca)]||_0x940920['dbtableConfig']?.['tableName']},'operation':_0x44ac21};}export async function getAppInfo(_0x431d40){const _0x3d8acc=a226_0x333717,_0x28ded7=await apiRequest('/smartapi/app/getOne'+buildQuery({'appCode':_0x431d40}));return _0x28ded7[_0x3d8acc(0x289)];}export async function getI18nInfo(_0x16064e){const _0x152cf5=a226_0x333717,_0x649e6b=await getAppInfo(_0x16064e);return{'enableI18n':_0x649e6b[_0x152cf5(0x1a4)],..._0x649e6b['i18nInfo']};}export async function createReactPage(_0x15e61c){const _0x228c8a=a226_0x333717,_0xcb1b6d=await apiRequest(_0x228c8a(0x208),{'method':_0x228c8a(0x1d2),'body':{'appCode':_0x15e61c[_0x228c8a(0x2bb)],'pageName':_0x15e61c[_0x228c8a(0x275)],..._0x15e61c['parentMenuId']!=null?{'parentMenuId':_0x15e61c[_0x228c8a(0x1d4)]}:{},'createMenu':_0x15e61c[_0x228c8a(0x291)],'codeContent':_0x15e61c['files']}});return{'pageId':_0xcb1b6d[_0x228c8a(0x289)][_0x228c8a(0x286)],'pageName':_0xcb1b6d[_0x228c8a(0x289)][_0x228c8a(0x235)]??_0x15e61c[_0x228c8a(0x275)],'appCode':_0x15e61c[_0x228c8a(0x2bb)],'version':_0xcb1b6d['data'][_0x228c8a(0x23e)]??0x0,'menuId':_0xcb1b6d[_0x228c8a(0x289)][_0x228c8a(0x233)]?.['id']??null,'menuPath':_0xcb1b6d['data'][_0x228c8a(0x233)]?.['path']??null,'files':_0xcb1b6d[_0x228c8a(0x289)]['files']};}export async function updateReactPageContent(_0x296bf9){const _0x99e241=a226_0x333717,_0x52d406=await apiRequest(_0x99e241(0x1ba),{'method':_0x99e241(0x1d2),'body':{'id':_0x296bf9[_0x99e241(0x286)],'codeContent':_0x296bf9[_0x99e241(0x1b7)]}});return{'pageId':_0x296bf9[_0x99e241(0x286)],'newVersion':_0x52d406[_0x99e241(0x289)]};}export async function publishReactPage(_0x180a8c){const _0x26c9b9=a226_0x333717,_0x166c0e=await apiRequest(_0x26c9b9(0x28c),{'method':_0x26c9b9(0x1d2),'body':{'id':_0x180a8c[_0x26c9b9(0x286)],..._0x180a8c[_0x26c9b9(0x1ee)]?{'remark':_0x180a8c['remark']}:{}}});return _0x166c0e[_0x26c9b9(0x289)];}export async function getReactPageSource(_0x80aaf2){const _0x4389fe=a226_0x333717,_0x426ccd=await apiRequest('/smartapi/webcode/page/detail'+buildQuery({'id':_0x80aaf2}));if(!_0x426ccd['data'])throw CliErrors[_0x4389fe(0x22d)](_0x4389fe(0x2aa)+_0x80aaf2);return _0x426ccd[_0x4389fe(0x289)];}export async function startGenerateStandardPages(_0x2d8124,_0x4c6865,_0x1e7a74){const _0x43641d=a226_0x333717,_0x5c3b1b=await apiRequest(_0x43641d(0x1fc)+_0x4c6865+_0x43641d(0x1e6),{'method':_0x43641d(0x1d2),'body':{'appCode':_0x2d8124,..._0x1e7a74?.['clientOperationId']?{'clientOperationId':_0x1e7a74[_0x43641d(0x24d)]}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x5c3b1b['data'];}export async function getGenerateStandardPagesStatus(_0x316f3e,_0xb727c4,_0x3ed375){const _0x98d3df=a226_0x333717,_0x11f313=new URLSearchParams({'appCode':_0x316f3e});_0x3ed375['taskId']&&_0x11f313[_0x98d3df(0x1b6)](_0x98d3df(0x22a),_0x3ed375[_0x98d3df(0x22a)]);_0x3ed375['operationId']&&_0x11f313[_0x98d3df(0x1b6)](_0x98d3df(0x1c6),_0x3ed375[_0x98d3df(0x1c6)]);_0x3ed375[_0x98d3df(0x24d)]&&_0x11f313[_0x98d3df(0x1b6)](_0x98d3df(0x24d),_0x3ed375[_0x98d3df(0x24d)]);const _0x2c98a3=await apiRequest('/smartapi/lovrabet/dataset/'+_0xb727c4+_0x98d3df(0x2b5)+_0x11f313['toString']());return _0x2c98a3[_0x98d3df(0x289)];}export async function getStandardPageStatus(_0x3c76ae,_0x5bf128){const _0x21d262=a226_0x333717,_0xafbd05=await apiRequest('/smartapi/lovrabet/dataset/'+_0x5bf128+_0x21d262(0x23b)+encodeURIComponent(_0x3c76ae));return _0xafbd05[_0x21d262(0x289)];}export async function tryGetStandardPageStatus(_0x528e96,_0x1cbcfc){const _0x1c8369=a226_0x333717;try{return await getStandardPageStatus(_0x528e96,_0x1cbcfc);}catch(_0x25bcd5){if(_0x25bcd5 instanceof CliError&&_0x25bcd5[_0x1c8369(0x1c3)]===_0x1c8369(0x219)&&/404|not found|non-json response/i[_0x1c8369(0x244)](_0x25bcd5[_0x1c8369(0x1e4)]))return null;throw _0x25bcd5;}}export async function syncStandardPages(_0x36b500,_0x2b96e9){const _0x2c6976=a226_0x333717,_0x228dcc=await apiRequest(_0x2c6976(0x1fc)+_0x2b96e9+_0x2c6976(0x29c),{'method':_0x2c6976(0x1d2),'body':{'appCode':_0x36b500}});return _0x228dcc[_0x2c6976(0x289)];}export async function getPageDetail(_0x550da0){const _0x4ec2d1=a226_0x333717,_0x33dc37=await apiRequest(_0x4ec2d1(0x1dd)+_0x550da0);if(!_0x33dc37[_0x4ec2d1(0x289)])throw CliErrors['validation'](_0x4ec2d1(0x25c)+_0x550da0);return _0x33dc37['data'];}export async function listDeletedPages(_0x4fc54b,_0x4c4040,_0x47b5c6){const _0x265073=a226_0x333717,_0x3da502=new URLSearchParams({'appCode':_0x4fc54b,'type':_0x4c4040,'currentPage':String(_0x47b5c6[_0x265073(0x267)]),'pageSize':String(_0x47b5c6[_0x265073(0x214)])}),_0x16aa1a=await apiRequest(_0x265073(0x1a8)+_0x3da502['toString']());return _0x16aa1a[_0x265073(0x289)];}export async function restoreStandardPage(_0x10c81e){const _0x2f3dce=a226_0x333717;await apiRequest(_0x2f3dce(0x1cf),{'method':'POST','body':{'id':_0x10c81e}});}export async function restoreJsxPage(_0x258f04,_0x16d6c9){const _0x588422=a226_0x333717,_0x4809e8=await apiRequest(_0x588422(0x292),{'method':_0x588422(0x1d2),'body':{'appCode':_0x258f04,'id':_0x16d6c9}});return _0x4809e8[_0x588422(0x289)];}export async function updatePage(_0x43a3e8,_0xe99ab6,_0xababb5,_0x151688){const _0x5a8492=a226_0x333717,_0x4419a5=await apiRequest(_0x5a8492(0x236),{'method':_0x5a8492(0x1d2),'body':{'appCode':_0x43a3e8,'pageId':_0xe99ab6,'code':_0xababb5,'datasetIds':_0x151688}});return _0x4419a5[_0x5a8492(0x289)];}export function generateSdkCode(_0x2bd4fd,_0x2d22d4,_0x2b20d0){const _0x2c826a=a226_0x333717,_0x3b1afe=_0x2b20d0?.[_0x2c826a(0x297)]??!![],_0x1e82b4='dataset_'+_0x2bd4fd[_0x2c826a(0x1c3)]?.['replace'](/-/g,'_'),_0x3eeacc=_0x2d22d4['name']||_0x2d22d4['operationName']||'filter',_0x4e9bc7=[];_0x3b1afe&&_0x4e9bc7[_0x2c826a(0x2b2)](_0x2c826a(0x1c2),'',_0x2c826a(0x28d),'');_0x4e9bc7[_0x2c826a(0x2b2)](_0x2c826a(0x27a)+_0x2bd4fd[_0x2c826a(0x1e7)]+'\x20('+(_0x2bd4fd['tableName']||_0x2c826a(0x1a3))+')');if(_0x3eeacc===_0x2c826a(0x25b))_0x4e9bc7[_0x2c826a(0x2b2)](_0x2c826a(0x27d)+_0x1e82b4+_0x2c826a(0x1b2),_0x2c826a(0x2b4),_0x2c826a(0x217),_0x2c826a(0x209),_0x2c826a(0x1fd));else{if(_0x3eeacc===_0x2c826a(0x243))_0x4e9bc7[_0x2c826a(0x2b2)](_0x2c826a(0x27d)+_0x1e82b4+'.getOne(id);');else{if(_0x3eeacc===_0x2c826a(0x1ae))_0x4e9bc7[_0x2c826a(0x2b2)](_0x2c826a(0x27d)+_0x1e82b4+_0x2c826a(0x2ae));else{if(_0x3eeacc===_0x2c826a(0x2c2))_0x4e9bc7[_0x2c826a(0x2b2)](_0x2c826a(0x27d)+_0x1e82b4+'.update(id,\x20{\x20/*\x20fields\x20*/\x20});');else _0x3eeacc===_0x2c826a(0x220)||_0x3eeacc===_0x2c826a(0x1e0)?_0x4e9bc7[_0x2c826a(0x2b2)](_0x2c826a(0x27d)+_0x1e82b4+_0x2c826a(0x1e8)):_0x4e9bc7['push'](_0x2c826a(0x27d)+_0x1e82b4+'.'+_0x3eeacc+_0x2c826a(0x24c));}}}return _0x4e9bc7[_0x2c826a(0x231)]('\x0a');}export function generateSqlCodeTemplate(_0x58d74f,_0x5d8056){const _0x39066d=a226_0x333717,_0x7a8ebb=_0x5d8056?.[_0x39066d(0x1c7)]??_0x39066d(0x2ac),_0x2d7d18=_0x5d8056?.['includeImports']??!![],_0x566b30=[];return _0x566b30[_0x39066d(0x2b2)](_0x39066d(0x25d)+_0x58d74f[_0x39066d(0x204)]+'\x20('+_0x58d74f[_0x39066d(0x222)]+')'),_0x7a8ebb===_0x39066d(0x2ac)?(_0x2d7d18&&_0x566b30[_0x39066d(0x2b2)](_0x39066d(0x1c2),'','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});',''),_0x566b30[_0x39066d(0x2b2)](_0x39066d(0x282),_0x39066d(0x2ad)+_0x58d74f[_0x39066d(0x222)]+'\x27,','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},',_0x39066d(0x1fd),_0x39066d(0x1a1),_0x39066d(0x1d9))):_0x566b30[_0x39066d(0x2b2)](_0x39066d(0x1de),'export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','\x20\x20\x20\x20sqlCode:\x20\x27'+_0x58d74f[_0x39066d(0x222)]+'\x27,',_0x39066d(0x1d0),'\x20\x20});',_0x39066d(0x1ec),'}'),_0x566b30[_0x39066d(0x231)]('\x0a');}export async function getErConfig(_0x2cc6d0,_0x3e1128){const _0x2c316b=a226_0x333717,_0x43a333=await apiRequest(_0x2c316b(0x26d),{'method':'POST','body':{'appCode':_0x2cc6d0,'dblinkId':_0x3e1128},'timeout':ER_CONFIG_REQUEST_TIMEOUT_MS});return _0x43a333[_0x2c316b(0x289)];}export async function getErRelationDetail(_0x3110fa,_0x19958f){const _0x4345a7=a226_0x333717,_0x51edb=new URLSearchParams({'appCode':_0x3110fa,'relationId':String(_0x19958f)});try{const _0xfe882f=await apiRequest('/smartapi/question/er-config/cli/detail?'+_0x51edb[_0x4345a7(0x23d)]());return _0xfe882f['data']?.['relation']??null;}catch(_0x11fcbe){if(_0x11fcbe instanceof CliError&&_0x11fcbe[_0x4345a7(0x1c3)]==='api_error'&&(_0x11fcbe[_0x4345a7(0x264)]?.[_0x4345a7(0x2af)](_0x4345a7(0x2b8))||_0x11fcbe[_0x4345a7(0x264)]===_0x4345a7(0x1db)&&_0x11fcbe[_0x4345a7(0x1e4)]===_0x4345a7(0x24e)))return null;throw _0x11fcbe;}}export async function createErRelation(_0x3e847b){const _0x121eb6=a226_0x333717,_0xebb355=await apiRequest(_0x121eb6(0x293),{'method':'POST','body':_0x3e847b,'allowNonJsonSuccess':!![]});return _0xebb355[_0x121eb6(0x289)];}export async function updateErRelation(_0x5c48f4){const _0x11b132=a226_0x333717,_0x51bc62=await apiRequest(_0x11b132(0x270),{'method':_0x11b132(0x1d2),'body':_0x5c48f4,'allowNonJsonSuccess':!![]});return _0x51bc62[_0x11b132(0x289)];}export async function deleteErRelation(_0x4b1363){const _0x69b122=a226_0x333717,_0x3fe2a4=await apiRequest(_0x69b122(0x1a5),{'method':_0x69b122(0x1d2),'body':_0x4b1363,'allowNonJsonSuccess':!![]});return _0x3fe2a4[_0x69b122(0x289)];}export async function updateErBusinessGroup(_0x5dd99c){const _0x1b93b5=a226_0x333717,_0x17beff=await apiRequest(_0x1b93b5(0x1f0),{'method':_0x1b93b5(0x1d2),'body':_0x5dd99c,'allowNonJsonSuccess':!![]});return _0x17beff[_0x1b93b5(0x289)];}function buildQuery(_0x3aa9d6){const _0x5565d4=a226_0x333717,_0x39a96c=new URLSearchParams();for(const [_0x46393e,_0x223700]of Object[_0x5565d4(0x249)](_0x3aa9d6)){if(_0x223700===undefined||_0x223700==='')continue;_0x39a96c[_0x5565d4(0x1b6)](_0x46393e,String(_0x223700));}const _0x392166=_0x39a96c[_0x5565d4(0x23d)]();return _0x392166?'?'+_0x392166:'';}export async function listNotificationChannelConfigs(_0x3e7fc0,_0x24c72c){const _0x5b5d88=a226_0x333717,_0x3c9db7=await apiRequest(_0x5b5d88(0x1f8)+buildQuery({'appCode':_0x3e7fc0,'channelType':_0x24c72c}));if(!Array['isArray'](_0x3c9db7[_0x5b5d88(0x289)]))throw CliErrors[_0x5b5d88(0x1aa)](_0x5b5d88(0x226),'Expected\x20the\x20server\x20data\x20field\x20to\x20be\x20an\x20array.');return _0x3c9db7[_0x5b5d88(0x289)];}export async function getNotificationChannelConfig(_0x4c5bbb,_0x31790a){const _0x5bd221=a226_0x333717,_0x305b4a=await apiRequest(_0x5bd221(0x278)+_0x4c5bbb+buildQuery({'appCode':_0x31790a}));return _0x305b4a['data'];}export async function createNotificationChannelConfig(_0x2ecb38){const _0x16da7a=a226_0x333717,_0x4abbd4=await apiRequest('/notification/channel-config/create',{'method':'POST','body':_0x2ecb38,'indeterminateMutation':!![]});return _0x4abbd4[_0x16da7a(0x289)];}export async function updateNotificationChannelConfig(_0x1bdbd8){const _0x120628=a226_0x333717;await apiRequest(_0x120628(0x2c1),{'method':_0x120628(0x1d2),'body':_0x1bdbd8,'indeterminateMutation':!![]});}export async function deleteNotificationChannelConfig(_0x5daf16,_0x5cd9b1){const _0x496799=a226_0x333717;await apiRequest(_0x496799(0x213),{'method':_0x496799(0x1d2),'body':{'id':_0x5daf16,'appCode':_0x5cd9b1},'indeterminateMutation':!![]});}export async function listAppConfigs(_0x3c9b87,_0x47f3b5){const _0x490bf9=a226_0x333717,_0x293cbb=await apiRequest(_0x490bf9(0x23f),{'method':_0x490bf9(0x1d2),'body':{'appCode':_0x3c9b87,..._0x47f3b5?.[_0x490bf9(0x284)]?{'key':_0x47f3b5[_0x490bf9(0x284)]}:{},..._0x47f3b5?.['tags']?{'tags':_0x47f3b5['tags']}:{}}});return extractAppConfigList(_0x293cbb['data']);}export async function getAppConfigByKey(_0x3935af,_0x7d7a0e){const _0x4b255b=a226_0x333717,_0x21e65a=await apiRequest(_0x4b255b(0x1f4)+buildQuery({'appCode':_0x3935af,'key':_0x7d7a0e}));return _0x21e65a[_0x4b255b(0x289)]??null;}export async function createAppConfig(_0x42762d){const _0x4087ec=a226_0x333717,_0x41c4d5=await apiRequest(_0x4087ec(0x261),{'method':_0x4087ec(0x1d2),'body':{'appCode':_0x42762d[_0x4087ec(0x2bb)],'key':_0x42762d[_0x4087ec(0x284)],'value':_0x42762d[_0x4087ec(0x255)],..._0x42762d['tags']?{'tags':_0x42762d[_0x4087ec(0x252)]}:{}}});return _0x41c4d5[_0x4087ec(0x289)];}export async function updateAppConfig(_0x34df94){const _0x2b7d40=a226_0x333717;await apiRequest(_0x2b7d40(0x225),{'method':_0x2b7d40(0x1d2),'body':{'id':_0x34df94['id'],'appCode':_0x34df94['appCode'],'key':_0x34df94[_0x2b7d40(0x284)],'value':_0x34df94['value'],..._0x34df94[_0x2b7d40(0x252)]?{'tags':_0x34df94[_0x2b7d40(0x252)]}:{}}});}export async function deleteAppConfig(_0x59197f){const _0x501721=a226_0x333717;await apiRequest(_0x501721(0x1bb),{'method':_0x501721(0x1d2),'body':_0x59197f});}function extractAppConfigList(_0x33da31){const _0x3859cf=a226_0x333717;if(Array[_0x3859cf(0x2bc)](_0x33da31))return _0x33da31;if(_0x33da31&&typeof _0x33da31==='object'&&Array[_0x3859cf(0x2bc)](_0x33da31[_0x3859cf(0x27c)]))return _0x33da31[_0x3859cf(0x27c)];return extractList(_0x33da31);}export async function listDbLinks(_0x5839cf,_0x67cc19){const _0xe659fe=a226_0x333717,_0x261236=await apiRequest(_0xe659fe(0x1fa),{'method':_0xe659fe(0x1d2),'body':{'appCode':_0x5839cf,'currentPage':_0x67cc19?.[_0xe659fe(0x267)]??0x1,'pageSize':_0x67cc19?.[_0xe659fe(0x214)]??0x64}});return{'items':extractList(_0x261236['data']),'paging':extractPaging(_0x261236[_0xe659fe(0x289)])};}export async function getDbLinkInfo(_0x44aaea){const _0x5a4e8a=a226_0x333717,_0xdfae3d=await apiRequest(_0x5a4e8a(0x21a)+buildQuery({'id':_0x44aaea}));return _0xdfae3d['data'];}export async function createDbLink(_0x212ca6){const _0x1028d0=a226_0x333717,_0x17a322=await apiRequest('/smartapi/dblink/create',{'method':_0x1028d0(0x1d2),'body':_0x212ca6});return _0x17a322[_0x1028d0(0x289)];}export async function updateDbLink(_0x231eb0){const _0x4efa08=a226_0x333717,_0x854706=await apiRequest(_0x4efa08(0x2a2),{'method':_0x4efa08(0x1d2),'body':_0x231eb0});return _0x854706[_0x4efa08(0x289)];}export async function deleteDbLink(_0x53d22c){const _0x2e68bc=a226_0x333717;await apiRequest(_0x2e68bc(0x285),{'method':_0x2e68bc(0x1d2),'body':{'id':_0x53d22c}});}export async function testDbLinkConnect(_0x284ec6){const _0x3f2485=a226_0x333717,_0x2d167e=await apiRequest('/smartapi/dblink/testConnect'+buildQuery({'id':_0x284ec6}));return _0x2d167e[_0x3f2485(0x289)];}export async function startDbAnalysis(_0xa355bb,_0x53ba75){const _0x26f864=a226_0x333717,_0x1397b9=await apiRequest('/smartapi/db-analysis/start',{'method':'POST','body':{'dbLinkId':_0xa355bb,..._0x53ba75&&_0x53ba75['length']>0x0?{'tableNames':_0x53ba75}:{}}});return _0x1397b9[_0x26f864(0x289)];}export async function cancelDbAnalysis(_0x1962de){const _0x4e58c6=a226_0x333717;await apiRequest(_0x4e58c6(0x215)+buildQuery({'planId':_0x1962de}),{'method':_0x4e58c6(0x1d2)});}export async function getDbAnalysisStatus(_0x3842ea){const _0x146736=a226_0x333717,_0x9a2c5=await apiRequest(_0x146736(0x1df)+encodeURIComponent(_0x3842ea));return _0x9a2c5[_0x146736(0x289)];}export async function getDbAllTableList(_0x2009b9,_0x2103d7){const _0x4e6f20=a226_0x333717,_0x457e29=await apiRequest(_0x4e6f20(0x1bf)+buildQuery({'appCode':_0x2009b9,'dbLinkId':_0x2103d7})),_0x28a06b=_0x457e29['data'];if(Array[_0x4e6f20(0x2bc)](_0x28a06b))return _0x28a06b;return extractList(_0x28a06b);}function a226_0x534d(){const _0x2dc5f1=['draftVersion','/smartapi/app-config/list','cli:rabetbase','fetch-model-list','/smartapi/dataset/text-generate/status?','getOne','test','/smartapi/menu/find?','Check\x20network\x20connectivity\x20and\x20try\x20again.','AbortError','/smartapi/permit/resource/get-api-list','entries','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','/smartapi/permit/user-role/update-user-list','(/*\x20params\x20*/);','clientOperationId','ER\x20relation\x20does\x20not\x20exist','username','info','/smartapi/menu/delete','tags','/smartapi/tasks/','Fetch\x20doc\x20(','value','Update\x20enterprise\x20knowledge\x20base','CUSTOM','/admin/knowledge-base/delete','find','/smartapi/permit/role/delete','filter','Page\x20not\x20found:\x20','//\x20SQL:\x20','/admin/knowledge-base/get-list','authRequired','/smartapi/dataset/get-dataset-list','/smartapi/app-config/create','status','application/json','hint','0000','1534190CqIsPI','currentPage','description','updateTime','requirementDescription','defineProperty','\x20of\x20','/smartapi/question/er-config','datasetTableCount','401','/smartapi/question/er-config/cli/update-single','/api/node-toolbox/dataset/model-list?','string','displayName','toLowerCase','pageName','/api/management/library/scripts/list?appCode=','/admin/knowledge-base/update','/notification/channel-config/','has','//\x20','2876BGyscR','list','const\x20result\x20=\x20await\x20client.models.','/smartapi/dataset/get-dataset-operation','requestFields','GET','tableList','const\x20data\x20=\x20await\x20client.sql.execute({','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','key','/smartapi/dblink/delete','pageId',':\x20invalid\x20JSON\x20response\x20envelope','add','data','/smartapi/user-accounts/cli/dingding-sandbox/bind','/smartapi/permit/resource/get-menu-list','/smartapi/webcode/file/publish','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','Operation\x20\x22','/userTenant/getByTenantCode','\x20apps.\x20','createMenu','/smartapi/webcode/page/restore','/smartapi/question/er-config/cli/erCreate','title','isSafeInteger','totalCount','includeImports','platform-transport-failure','modelCode','/api/node-toolbox/api-doc-generator','createTime','/sync-to-pages','API\x20error\x20code:\x20','map','avatar','tableData','startsWith','/smartapi/dblink/update','963821KqihLJ','isFinite','stringify','448308ROjyNg','/userTenant/queryBelongsTenants','/smartapi/custom/updateUserCustomSql','/smartapi/permit/page/get-one','React\x20custom\x20page\x20not\x20found:\x20','Knowledge-base\x20response\x20contains\x20an\x20invalid\x20','sdk','\x20\x20sqlCode:\x20\x27','.create({\x20/*\x20fields\x20*/\x20});','includes','scriptName','operations','push','/smartapi/permit/role/get-permit-list','\x20\x20where:\x20{},','/generate-standard-pages/status?','dbId','Create\x20enterprise\x20knowledge\x20base','DATA_NOT_EXIST','summary','label','appCode','isArray','/smartapi/common/queryFileUrl','NaN','/smartapi/permit/role/get-list','/smartapi/dataset/text-generate/start','/notification/channel-config/update','update','?sqlCode=','/api/node-toolbox/sql/save','append','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','UNAUTHORIZED','table','enableI18n','/smartapi/question/er-config/cli/delete-single','mobile','/smartapi/custom/deleteUserCustomSql','/smartapi/page/getDeletedPageList?','modelId','apiError','Request\x20failed:\x20','file','type','create','/smartapi/ocr/recognize-text?','Request\x20timeout:\x20','SQL\x20query\x20not\x20found:\x20id=','.filter({','functionName','/smartapi/permit/role/update','/smartapi/permit/role/get-one','set','pageContent','):\x20missing\x20data.markdown\x20field','datasetName','/smartapi/webcode/page/update/content','/smartapi/app-config/delete','Knowledge-base\x20response\x20contains\x20an\x20invalid\x20scope.','/smartapi/dblink/getTableDiffV2ByPage','needPublic','/smartapi/dblink/getAllTableList','url','userTenantRelationList','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','code','/smartapi/app/getList','signal','operationId','target','13248880FWWcDu','/smartapi/permit/user-role/get-user-list','tableName','success','/api/custom/executeSql','192450agPuWY','API\x20returned\x20an\x20invalid\x20JSON\x20response\x20envelope\x20(HTTP\x20','/smartapi/page/restore','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','dbtableConfig','POST','trim','parentMenuId','/api/management/script/cache/clear','permits','responseFields','/smartapi/menu/create','const\x20results\x20=\x20data.execResult\x20||\x20[];','markdown','API\x20error\x20code:\x20306','/smartapi/menu/regroup','/smartapi/lovrabet/detail?pageId=','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','/smartapi/db-analysis/status/','remove','longTerm','Delete\x20enterprise\x20knowledge\x20base','Dataset\x20not\x20found:\x20','message','List\x20enterprise\x20knowledge\x20bases\x20returned\x20an\x20invalid\x20response\x20contract.','/generate-standard-pages/start','name','.remove(id);','BFF\x20script\x20not\x20found:\x20id=','warn','SQL\x20query\x20not\x20found:\x20','\x20\x20return\x20rows;','json','remark','/smartapi/dataset/update-driven-data','/smartapi/question/er-config/business-group/edit','/smartapi/dataset/delete-dataset','userId','/api/management/library/scripts/info?id=','/smartapi/app-config/getByKey','85XxlERC','version','3198Sbooht','/notification/channel-config/list','\x20failed','/smartapi/dblink/getList','\x20returned\x20an\x20invalid\x20JSON\x20response\x20envelope\x20after\x20HTTP\x20success.','/smartapi/lovrabet/dataset/','});','/smartapi/dblink/getDiffTableByPage','method','Fetch\x20menu\x20list','content','replace','/admin/knowledge-base/create','sqlName','operationName','/api/','pageIndex','/smartapi/webcode/page/create','\x20\x20currentPage:\x201,','BFF\x20save\x20returned\x20no\x20valid\x20id','scope','object','/smartapi/menu/update','11034zHYvSj','physicalTableCount','company','7736AFCBiv','path','/notification/channel-config/delete','pageSize','/smartapi/db-analysis/jobs/cancel','API\x20error:\x20','\x20\x20pageSize:\x2020,','/smartapi/custom/getUserCustomSql?id=','api_error','/smartapi/dblink/getOne','errorMsg','errorCode','Get\x20enterprise\x20knowledge\x20base','/api/management/library/scripts/delete','/filter','delete','Fetch\x20async\x20task\x20','sqlCode','scriptType','deleted','/smartapi/app-config/update','Invalid\x20notification\x20config\x20list\x20response.','isInteger','enabled','Knowledge-base\x20response\x20is\x20missing\x20a\x20valid\x20','taskId','configArray','max','validation','/smartapi/custom/queryUserCustomSqlList','/smartapi/common/uploadFile','number','join','abort','menu','body','materialName','/smartapi/lovrabet/update-page','List\x20enterprise\x20knowledge\x20bases\x20returned\x20invalid\x20paging\x20metadata.',',\x20HTTP\x20','roleName','\x20failed,\x20HTTP\x20','/standard-page-status?appCode=','needSelf','toString'];a226_0x534d=function(){return _0x2dc5f1;};return a226_0x534d();}export async function getDbTableDiff(_0x435026,_0x573c13,_0xaa71d2){const _0x322463=a226_0x333717,_0x53d501=await apiRequest(_0x322463(0x1fe)+buildQuery({'appCode':_0x435026,'dbLinkId':_0x573c13,'pageIndex':_0xaa71d2?.[_0x322463(0x207)]??0x1,'pageSize':_0xaa71d2?.[_0x322463(0x214)]??0x14,'tableName':_0xaa71d2?.[_0x322463(0x1ca)]})),_0x5c5308=_0x53d501[_0x322463(0x289)];return{'totalCount':_0x5c5308?.['totalCount']??0x0,...typeof _0x5c5308?.[_0x322463(0x20f)]==='number'?{'physicalTableCount':_0x5c5308['physicalTableCount']}:{},...typeof _0x5c5308?.[_0x322463(0x26e)]===_0x322463(0x230)?{'datasetTableCount':_0x5c5308[_0x322463(0x26e)]}:{},..._0x5c5308?.[_0x322463(0x2b9)]?{'summary':_0x5c5308[_0x322463(0x2b9)]}:{},'tableList':Array[_0x322463(0x2bc)](_0x5c5308?.[_0x322463(0x281)])?_0x5c5308['tableList']:[]};}export async function getDbLiveTableDiff(_0x4f85ce,_0x3dadd7,_0xd61d60){const _0x4b70e4=a226_0x333717,_0x14c1f1=await apiRequest(_0x4b70e4(0x1bd)+buildQuery({'appCode':_0x4f85ce,'dbLinkId':_0x3dadd7,'pageIndex':_0xd61d60?.[_0x4b70e4(0x207)]??0x1,'pageSize':_0xd61d60?.[_0x4b70e4(0x214)]??0x14,'tableName':_0xd61d60?.[_0x4b70e4(0x1ca)]})),_0x5c94aa=_0x14c1f1['data'];return{'totalCount':_0x5c94aa?.['totalCount']??0x0,...typeof _0x5c94aa?.[_0x4b70e4(0x20f)]==='number'?{'physicalTableCount':_0x5c94aa[_0x4b70e4(0x20f)]}:{},...typeof _0x5c94aa?.[_0x4b70e4(0x26e)]===_0x4b70e4(0x230)?{'datasetTableCount':_0x5c94aa[_0x4b70e4(0x26e)]}:{},..._0x5c94aa?.['summary']?{'summary':_0x5c94aa[_0x4b70e4(0x2b9)]}:{},'tableList':Array[_0x4b70e4(0x2bc)](_0x5c94aa?.[_0x4b70e4(0x281)])?_0x5c94aa['tableList']:[]};}export async function startDbTableDiffRefresh(_0x38bc8f,_0x29a3bc){const _0x4e946b=a226_0x333717,_0x271bdb=await apiRequest('/smartapi/dblink/table-diff/analyze/start'+buildQuery({'appCode':_0x38bc8f,'dbLinkId':_0x29a3bc}),{'method':_0x4e946b(0x1d2)});return _0x271bdb[_0x4e946b(0x289)];}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x5a144d=a226_0x333717,_0x174b0b=await apiRequest(_0x5a144d(0x1c4),{'method':'POST','body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x3f627c=extractList(_0x174b0b[_0x5a144d(0x289)]),_0x54f11e=extractPaging(_0x174b0b[_0x5a144d(0x289)]);return _0x54f11e&&_0x54f11e['totalCount']>REMOTE_APP_PAGE_SIZE&&console[_0x5a144d(0x1ea)]('Warning:\x20showing\x20first\x20'+REMOTE_APP_PAGE_SIZE+_0x5a144d(0x26c)+_0x54f11e[_0x5a144d(0x296)]+_0x5a144d(0x290)+'Use\x20the\x20platform\x20console\x20to\x20see\x20all.'),_0x3f627c;}const APP_ROLE_PAGE_SIZE_MAX=0x64;export async function listAppRoles(_0x583296,_0x420388){const _0x44ac0c=a226_0x333717,_0x4ad89f=Math['min'](Math[_0x44ac0c(0x22c)](_0x420388?.['pageSize']??APP_ROLE_PAGE_SIZE_MAX,0x1),APP_ROLE_PAGE_SIZE_MAX),_0xc8d3=await apiRequest(_0x44ac0c(0x2bf),{'method':_0x44ac0c(0x1d2),'body':{'appCode':_0x583296,'currentPage':_0x420388?.[_0x44ac0c(0x267)]??0x1,'pageSize':_0x4ad89f}});return{'items':extractList(_0xc8d3[_0x44ac0c(0x289)]),'paging':extractPaging(_0xc8d3['data'])};}export async function getAppRole(_0x337b39){const _0x201b01=a226_0x333717,_0x41191a=await apiRequest(_0x201b01(0x1b5)+buildQuery({'id':_0x337b39}));return _0x41191a[_0x201b01(0x289)];}export async function createAppRole(_0x396233){const _0x253a4a=a226_0x333717,_0x2ea1b0=await apiRequest('/smartapi/permit/role/create',{'method':_0x253a4a(0x1d2),'body':{'appCode':_0x396233[_0x253a4a(0x2bb)],'roleName':_0x396233['roleName'],'roleType':_0x253a4a(0x257),..._0x396233[_0x253a4a(0x1ee)]?{'remark':_0x396233[_0x253a4a(0x1ee)]}:{}}});return _0x2ea1b0['data'];}export async function updateAppRole(_0x2adcca){const _0x259e0e=a226_0x333717,_0x280781=await apiRequest(_0x259e0e(0x1b4),{'method':'POST','body':{'id':_0x2adcca['id'],'appCode':_0x2adcca['appCode'],..._0x2adcca['roleType']?{'roleType':_0x2adcca['roleType']}:{},..._0x2adcca[_0x259e0e(0x239)]!==undefined?{'roleName':_0x2adcca[_0x259e0e(0x239)]}:{},..._0x2adcca[_0x259e0e(0x1ee)]!==undefined?{'remark':_0x2adcca[_0x259e0e(0x1ee)]}:{},..._0x2adcca[_0x259e0e(0x1d6)]?{'permits':_0x2adcca[_0x259e0e(0x1d6)]}:{}}});return _0x280781[_0x259e0e(0x289)];}export async function deleteAppRole(_0x3c5e47){const _0x43bc74=a226_0x333717;await apiRequest(_0x43bc74(0x25a),{'method':_0x43bc74(0x1d2),'body':{'id':_0x3c5e47}});}export async function listPermitRoles(_0x46d9d8,_0x28c3f1){const _0x3defe0=a226_0x333717,_0x310423=await apiRequest(_0x3defe0(0x2b3),{'method':_0x3defe0(0x1d2),'body':{'appCode':_0x46d9d8,..._0x28c3f1?.[_0x3defe0(0x23c)]!==undefined?{'needSelf':_0x28c3f1['needSelf']}:{},..._0x28c3f1?.['needPublic']!==undefined?{'needPublic':_0x28c3f1[_0x3defe0(0x1be)]}:{}}});return extractList(_0x310423[_0x3defe0(0x289)]);}export async function getRoleMenuResources(_0x445b22,_0x136a58){const _0x55c82d=a226_0x333717,_0x3006dd=await apiRequest(_0x55c82d(0x28b),{'method':_0x55c82d(0x1d2),'body':{'appCode':_0x445b22,'roleId':_0x136a58}});return extractList(_0x3006dd[_0x55c82d(0x289)]);}export async function getRoleApiResources(_0x4f3a85,_0x33098c){const _0xff3d3e=a226_0x333717,_0x112264=await apiRequest(_0xff3d3e(0x248),{'method':_0xff3d3e(0x1d2),'body':{'appCode':_0x4f3a85,'roleId':_0x33098c}});return extractList(_0x112264[_0xff3d3e(0x289)]);}export async function listRoleUsers(_0xf60401){const _0x1b9659=a226_0x333717,_0x1e6aa6=await apiRequest(_0x1b9659(0x1c9),{'method':'POST','body':{'appCode':_0xf60401}});return extractList(_0x1e6aa6['data'])[_0x1b9659(0x29e)](({id:_0x57da16,userList:_0x38c9be,applyUserList:_0x142781,..._0x588686})=>({..._0x588686,'id':Number(_0x57da16),'userList':_0x38c9be['map'](_0x158a35=>({..._0x158a35,'userId':Number(_0x158a35[_0x1b9659(0x1f2)])})),..._0x142781?{'applyUserList':_0x142781[_0x1b9659(0x29e)](_0x409276=>({..._0x409276,'userId':Number(_0x409276[_0x1b9659(0x1f2)])}))}:{}}));}export async function updateRoleUsers(_0x768003,_0x5a2d8a){const _0x1303bf=a226_0x333717;await apiRequest(_0x1303bf(0x24b),{'method':'POST','body':{'appCode':_0x768003,'roleList':_0x5a2d8a}});}export async function getPagePermit(_0x2de43a){const _0x1a9cae=a226_0x333717,_0x4b4759=await apiRequest(_0x1a9cae(0x2a9)+buildQuery({'menuId':_0x2de43a}));return _0x4b4759[_0x1a9cae(0x289)];}export async function savePagePermit(_0x54e467){const _0x107823=a226_0x333717,_0xddd6d2=await apiRequest('/smartapi/permit/page/save',{'method':'POST','body':_0x54e467});return _0xddd6d2[_0x107823(0x289)];}export async function listCurrentUserTenantMemberships(){const _0x43a351=a226_0x333717,_0x18b2f3=await apiRequest(_0x43a351(0x2a7));return extractList(_0x18b2f3[_0x43a351(0x289)]);}export async function listTenantDirectoryMembers(_0x143832){const _0x3827de=a226_0x333717,_0x2d649f=await apiRequest(_0x3827de(0x28f)+buildQuery({'code':_0x143832})),_0x5cb8a0=_0x2d649f['data']?.[_0x3827de(0x1c1)];return Array[_0x3827de(0x2bc)](_0x5cb8a0)?_0x5cb8a0:[];}export async function getTenantMembers(_0x3d9601){const _0x19c988=a226_0x333717,_0x24361e=await listTenantDirectoryMembers(_0x3d9601);return _0x24361e[_0x19c988(0x25b)](_0x521575=>_0x521575[_0x19c988(0x262)]==='ENABLE'||_0x521575['status']===undefined)[_0x19c988(0x29e)](_0x8aba4d=>({'userId':Number(_0x8aba4d['userId']??_0x8aba4d['id']),'username':_0x8aba4d[_0x19c988(0x24f)],'nickname':_0x8aba4d['nickname'],'status':_0x8aba4d['status'],'email':_0x8aba4d['email'],'mobile':_0x8aba4d[_0x19c988(0x1a6)],'avatar':_0x8aba4d[_0x19c988(0x29f)]}))[_0x19c988(0x25b)](_0x17280b=>Number[_0x19c988(0x2a4)](_0x17280b[_0x19c988(0x1f2)])&&_0x17280b[_0x19c988(0x1f2)]>0x0);}
|
|
1
|
+
const a219_0x5c1b3d=a219_0x2fe4;(function(_0x5413f2,_0x135502){const _0x21f699=a219_0x2fe4,_0x3389a4=_0x5413f2();while(!![]){try{const _0x33efba=-parseInt(_0x21f699(0x227))/0x1*(-parseInt(_0x21f699(0x271))/0x2)+parseInt(_0x21f699(0x1f6))/0x3+parseInt(_0x21f699(0x253))/0x4+parseInt(_0x21f699(0x2ab))/0x5+parseInt(_0x21f699(0x2d4))/0x6+parseInt(_0x21f699(0x26e))/0x7*(parseInt(_0x21f699(0x254))/0x8)+parseInt(_0x21f699(0x2d5))/0x9*(-parseInt(_0x21f699(0x275))/0xa);if(_0x33efba===_0x135502)break;else _0x3389a4['push'](_0x3389a4['shift']());}catch(_0x4ed7c9){_0x3389a4['push'](_0x3389a4['shift']());}}}(a219_0x118d,0x9d52f));import{readFile}from'node:fs/promises';import{basename}from'node:path';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain,getRuntimeDomain}from'../constant/domain.js';import{getEnv}from'../constant/env.js';import{CliError,CliErrors}from'../errors.js';import{extractList,extractPaging}from'../framework/response.js';import{normalizeEntityWithIdResponse}from'../utils/entity-with-id.js';import{logger}from'../utils/logger.js';let _activeCookie;export function setActiveCookie(_0x3b5df0){_activeCookie=_0x3b5df0||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}const DEFAULT_REQUEST_TIMEOUT_MS=0x7530,ER_CONFIG_REQUEST_TIMEOUT_MS=0x1d4c0,TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS=0x57e40,PLATFORM_TRANSPORT_FAILURE=Symbol('platform-transport-failure'),PLATFORM_ERROR_CODE=Symbol(a219_0x5c1b3d(0x2bb));export function isPlatformTransportFailure(_0x3d3fb8){const _0x158426=a219_0x5c1b3d;return Boolean(_0x3d3fb8&&typeof _0x3d3fb8===_0x158426(0x1e5)&&_0x3d3fb8[PLATFORM_TRANSPORT_FAILURE]===!![]);}export function getPlatformErrorCode(_0x40cf54){const _0x49506c=a219_0x5c1b3d;if(!_0x40cf54||typeof _0x40cf54!==_0x49506c(0x1e5))return undefined;const _0x16c5d9=_0x40cf54[PLATFORM_ERROR_CODE];return typeof _0x16c5d9===_0x49506c(0x1fe)&&_0x16c5d9?_0x16c5d9:undefined;}function createPlatformApiError(_0x3413b8,_0x412efa){const _0x4373f5=a219_0x5c1b3d,_0x3d14c8=typeof _0x412efa===_0x4373f5(0x1fe)?_0x412efa[_0x4373f5(0x258)]():typeof _0x412efa===_0x4373f5(0x21a)?String(_0x412efa):'',_0x5114b3=CliErrors['apiError'](_0x3413b8,_0x3d14c8?_0x4373f5(0x207)+_0x3d14c8:undefined);return _0x3d14c8&&(Object[_0x4373f5(0x214)](_0x5114b3,PLATFORM_ERROR_CODE,{'value':_0x3d14c8}),Object[_0x4373f5(0x214)](_0x5114b3,_0x4373f5(0x297),{'value':{'remoteErrorCode':_0x3d14c8},'enumerable':![]})),_0x5114b3;}function createFetchFailureError(_0x216850,_0x24fc90){const _0x9eae08=a219_0x5c1b3d,_0xc9fde9=_0x24fc90 instanceof Error?_0x24fc90['message']:String(_0x24fc90),_0x415599=CliErrors[_0x9eae08(0x22e)](_0x9eae08(0x2e8)+_0x216850+(_0xc9fde9?'\x20('+_0xc9fde9+')':''),_0x9eae08(0x27d));return Object[_0x9eae08(0x214)](_0x415599,PLATFORM_TRANSPORT_FAILURE,{'value':!![]}),_0x415599;}function createRequestTimeoutError(_0x45b6c6,_0x346e00){const _0x38d00c=a219_0x5c1b3d,_0x2dc5a2=CliErrors[_0x38d00c(0x22e)](_0x38d00c(0x1de)+_0x45b6c6);return _0x346e00&&Object[_0x38d00c(0x214)](_0x2dc5a2,PLATFORM_TRANSPORT_FAILURE,{'value':!![]}),_0x2dc5a2;}function createIndeterminateResponseError(_0x349706){const _0x185cd6=a219_0x5c1b3d,_0x535e1e=CliErrors[_0x185cd6(0x22e)](_0x349706+_0x185cd6(0x2d9),'The\x20server\x20outcome\x20is\x20indeterminate.\x20Verify\x20current\x20state\x20before\x20retrying\x20any\x20mutation.');return Object['defineProperty'](_0x535e1e,PLATFORM_TRANSPORT_FAILURE,{'value':!![]}),_0x535e1e;}async function apiRequest(_0x432741,_0x5c19f2={}){const _0x415a26=a219_0x5c1b3d,{method:method=_0x415a26(0x2c6),body:_0x243ad8,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![],allowNonJsonSuccess:allowNonJsonSuccess=![],indeterminateMutation:indeterminateMutation=![]}=_0x5c19f2,_0x39ba77=useRuntime?getRuntimeDomain():getApiDomain(),_0x505f31=_activeCookie||getCookie(),_0x2a313b=''+_0x39ba77+_0x432741,_0x1b4d93=new AbortController(),_0x494060=setTimeout(()=>_0x1b4d93['abort'](),timeout);try{const _0x537214=await fetch(_0x2a313b,{'method':method,'headers':{'Content-Type':_0x415a26(0x2aa),'Cookie':_0x505f31,'X-Invoke-Source':_0x415a26(0x2a0),...headers},'body':_0x243ad8?JSON[_0x415a26(0x2b9)](_0x243ad8):undefined,'signal':_0x1b4d93['signal']});let _0x1be786;try{_0x1be786=await _0x537214[_0x415a26(0x28d)]();}catch(_0x420e64){if(_0x537214['ok']&&_0x420e64 instanceof Error&&_0x420e64[_0x415a26(0x24d)]===_0x415a26(0x2c3))throw createRequestTimeoutError(_0x2a313b,indeterminateMutation);if(_0x537214['ok']&&indeterminateMutation)throw createIndeterminateResponseError(_0x432741);if(_0x537214['ok']&&allowNonJsonSuccess)return{'success':!![],'data':undefined};throw CliErrors[_0x415a26(0x22e)]('API\x20returned\x20non-JSON\x20response\x20(HTTP\x20'+_0x537214[_0x415a26(0x286)]+')',_0x537214['status']>=0x190?_0x415a26(0x2a5):undefined);}const _0x6f9164=_0x1be786!==null&&typeof _0x1be786==='object'&&!Array[_0x415a26(0x2eb)](_0x1be786);if(!_0x537214['ok']){const _0x53b944=_0x6f9164?_0x1be786:undefined;throw CliErrors['apiError'](_0x53b944?.['errorMsg']||_0x53b944?.[_0x415a26(0x25f)]||_0x415a26(0x27f)+_0x537214[_0x415a26(0x286)],_0x53b944?.['errorCode']?_0x415a26(0x207)+_0x53b944[_0x415a26(0x2ee)]:undefined);}if(indeterminateMutation){if(!_0x6f9164)throw createIndeterminateResponseError(_0x432741);if(_0x1be786[_0x415a26(0x216)]===![])throw CliErrors['apiError'](_0x1be786[_0x415a26(0x29f)]||_0x1be786[_0x415a26(0x25f)]||_0x415a26(0x27f)+_0x537214['status'],_0x1be786['errorCode']?_0x415a26(0x207)+_0x1be786[_0x415a26(0x2ee)]:undefined);if(_0x1be786[_0x415a26(0x216)]!==!![])throw createIndeterminateResponseError(_0x432741);return _0x1be786;}if(_0x1be786===null||_0x1be786===undefined)throw CliErrors[_0x415a26(0x22e)](_0x415a26(0x23b)+_0x537214[_0x415a26(0x286)]+')');if(_0x1be786['success']===![])throw CliErrors['apiError'](_0x1be786[_0x415a26(0x29f)]||_0x1be786['message']||_0x415a26(0x27f)+_0x537214[_0x415a26(0x286)],_0x1be786[_0x415a26(0x2ee)]?'API\x20error\x20code:\x20'+_0x1be786['errorCode']:undefined);return _0x1be786;}catch(_0x5fab9f){if(_0x5fab9f instanceof CliError)throw _0x5fab9f;if(_0x5fab9f instanceof Error&&_0x5fab9f[_0x415a26(0x24d)]==='AbortError')throw createRequestTimeoutError(_0x2a313b,indeterminateMutation);throw createFetchFailureError(_0x2a313b,_0x5fab9f);}finally{clearTimeout(_0x494060);}}async function apiFormRequest(_0x74d01,_0x420783,_0x4be330={}){const _0x11df1e=a219_0x5c1b3d,{timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS}=_0x4be330,_0x2725e6=_activeCookie||getCookie(),_0x140819=''+getApiDomain()+_0x74d01,_0x2e2e34=new AbortController(),_0xdd0ac5=setTimeout(()=>_0x2e2e34[_0x11df1e(0x282)](),timeout);try{const _0x3d801d=await fetch(_0x140819,{'method':'POST','headers':{'Cookie':_0x2725e6,'X-Invoke-Source':_0x11df1e(0x2a0)},'body':_0x420783,'signal':_0x2e2e34[_0x11df1e(0x2c2)]});let _0x1e990e;try{_0x1e990e=await _0x3d801d[_0x11df1e(0x28d)]();}catch(_0x45e2e5){if(_0x45e2e5 instanceof Error&&_0x45e2e5[_0x11df1e(0x24d)]===_0x11df1e(0x2c3))throw CliErrors['apiError'](_0x11df1e(0x1de)+_0x140819);throw CliErrors[_0x11df1e(0x22e)](_0x11df1e(0x29d)+_0x3d801d[_0x11df1e(0x286)]+')',_0x3d801d[_0x11df1e(0x286)]>=0x190?'Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.':undefined);}if(!_0x3d801d['ok']||_0x1e990e[_0x11df1e(0x216)]===![])throw CliErrors[_0x11df1e(0x22e)](_0x1e990e[_0x11df1e(0x29f)]||_0x1e990e[_0x11df1e(0x25f)]||'API\x20error:\x20'+_0x3d801d[_0x11df1e(0x286)],_0x1e990e[_0x11df1e(0x2ee)]?_0x11df1e(0x207)+_0x1e990e[_0x11df1e(0x2ee)]:undefined);return _0x1e990e;}catch(_0x4e38c9){if(_0x4e38c9 instanceof CliError)throw _0x4e38c9;if(_0x4e38c9 instanceof Error&&_0x4e38c9[_0x11df1e(0x24d)]===_0x11df1e(0x2c3))throw CliErrors['apiError'](_0x11df1e(0x1de)+_0x140819);throw createFetchFailureError(_0x140819,_0x4e38c9);}finally{clearTimeout(_0xdd0ac5);}}export async function uploadDevelopmentFile(_0x563485,_0xa832f4){const _0x144c3c=a219_0x5c1b3d,_0x52b945=await readFile(_0xa832f4),_0x14d25f=new FormData();_0x14d25f[_0x144c3c(0x1fb)](_0x144c3c(0x23a),_0x563485),_0x14d25f[_0x144c3c(0x1fb)]('file',new Blob([new Uint8Array(_0x52b945)]),basename(_0xa832f4));const _0x5397c1=await apiFormRequest(_0x144c3c(0x203),_0x14d25f);return _0x5397c1[_0x144c3c(0x297)];}export async function queryDevelopmentFileUrl(_0x3c1eaa,_0xf5d07e={}){const _0x583a4=a219_0x5c1b3d,_0x40ef8c=await apiRequest(_0x583a4(0x2cd),{'method':_0x583a4(0x290),'body':{'filePath':_0x3c1eaa,'downloadFlag':_0xf5d07e[_0x583a4(0x281)]??![],..._0xf5d07e['longTerm']?{'longTerm':!![]}:{}}});return _0x40ef8c[_0x583a4(0x297)];}export async function recognizeDevelopmentOcr(_0x1ff7b4,_0x24577c){const _0x36bfcd=a219_0x5c1b3d,_0x549f36=new URLSearchParams({'url':_0x24577c['url'],'type':_0x24577c['type'],'appCode':_0x1ff7b4}),_0x10435b=await apiRequest('/smartapi/ocr/recognize-text?'+_0x549f36[_0x36bfcd(0x1e6)](),{'method':'GET'});return _0x10435b[_0x36bfcd(0x297)];}function a219_0x2fe4(_0x79067,_0x5065c6){_0x79067=_0x79067-0x1cd;const _0x118d78=a219_0x118d();let _0x2fe415=_0x118d78[_0x79067];return _0x2fe415;}export const DING_TALK_SANDBOX_BIND_PATH=a219_0x5c1b3d(0x21e);export async function bindDingTalkSandboxAccount(_0x2ce58e){const _0x52b046=a219_0x5c1b3d,_0x7977ef=await apiRequest(DING_TALK_SANDBOX_BIND_PATH,{'method':_0x52b046(0x290),'body':{'dingTalkUserId':_0x2ce58e}});return _0x7977ef['data'];}function isAuthFailure(_0x199ae3){const _0x49e094=a219_0x5c1b3d,_0x48df97=_0x199ae3[_0x49e094(0x29f)]||_0x199ae3[_0x49e094(0x25f)]||_0x199ae3[_0x49e094(0x297)]?.[_0x49e094(0x25f)]||_0x199ae3[_0x49e094(0x2c9)]||_0x199ae3['error']||'';return _0x199ae3[_0x49e094(0x2ee)]===_0x49e094(0x2a1)||_0x199ae3[_0x49e094(0x260)]===0x191||_0x199ae3['code']===_0x49e094(0x24f)||_0x48df97[_0x49e094(0x2c0)]('401')||_0x48df97[_0x49e094(0x2c0)](_0x49e094(0x2f6))||_0x48df97['includes']('登录')||_0x48df97[_0x49e094(0x2c0)]('认证');}export async function platformFetch(_0x5a67da,_0x2d9af9){const _0x4b2a05=a219_0x5c1b3d;let _0x2fd5f4;try{_0x2fd5f4=await fetch(_0x5a67da,{'method':_0x2d9af9[_0x4b2a05(0x242)]??_0x4b2a05(0x2c6),'headers':{'Content-Type':_0x4b2a05(0x2aa),'Cookie':_0x2d9af9[_0x4b2a05(0x248)],'X-Invoke-Source':_0x4b2a05(0x2a0)},..._0x2d9af9['body']&&{'body':JSON[_0x4b2a05(0x2b9)](_0x2d9af9[_0x4b2a05(0x1d8)])}});}catch(_0x1ac4bb){throw createFetchFailureError(_0x5a67da,_0x1ac4bb);}let _0x201102;try{_0x201102=await _0x2fd5f4['json']();}catch(_0x31d212){if(!_0x2fd5f4['ok']){if(_0x2fd5f4[_0x4b2a05(0x286)]===0x191)throw CliErrors[_0x4b2a05(0x2bc)]();throw CliErrors[_0x4b2a05(0x22e)](_0x2d9af9[_0x4b2a05(0x2db)]+_0x4b2a05(0x23d)+_0x2fd5f4['status']);}throw createFetchFailureError(_0x5a67da,_0x31d212);}if(_0x201102===null||typeof _0x201102!==_0x4b2a05(0x1e5)||Array[_0x4b2a05(0x2eb)](_0x201102)){if(_0x2fd5f4[_0x4b2a05(0x286)]===0x191)throw CliErrors[_0x4b2a05(0x2bc)]();if(_0x2fd5f4['ok'])throw createIndeterminateResponseError(_0x2d9af9['label']);throw CliErrors[_0x4b2a05(0x22e)](_0x2d9af9[_0x4b2a05(0x2db)]+_0x4b2a05(0x2f1)+(!_0x2fd5f4['ok']?_0x4b2a05(0x20d)+_0x2fd5f4[_0x4b2a05(0x286)]:'')+_0x4b2a05(0x23e));}const _0x15b8c6=typeof _0x201102[_0x4b2a05(0x2ee)]===_0x4b2a05(0x1fe)||typeof _0x201102['errorCode']===_0x4b2a05(0x21a),_0x52cc9e=_0x15b8c6?String(_0x201102[_0x4b2a05(0x2ee)])[_0x4b2a05(0x258)]():'',_0x1525e2=_0x201102[_0x4b2a05(0x216)]===![]||_0x15b8c6&&_0x52cc9e!==_0x4b2a05(0x2f4);if(!_0x2fd5f4['ok']||_0x1525e2){if(_0x2fd5f4['status']===0x191||isAuthFailure(_0x201102))throw CliErrors[_0x4b2a05(0x2bc)]();throw createPlatformApiError(_0x201102[_0x4b2a05(0x29f)]||_0x201102['message']||_0x2d9af9[_0x4b2a05(0x2db)]+_0x4b2a05(0x2f1)+(!_0x2fd5f4['ok']?',\x20HTTP\x20'+_0x2fd5f4[_0x4b2a05(0x286)]:''),_0x201102[_0x4b2a05(0x2ee)]??_0x201102[_0x4b2a05(0x260)]);}if(_0x201102[_0x4b2a05(0x216)]!==!![]||_0x15b8c6&&_0x52cc9e!==_0x4b2a05(0x2f4))throw createIndeterminateResponseError(_0x2d9af9['label']);return _0x201102[_0x4b2a05(0x297)];}export async function platformRequest(_0x2a55de,_0x4eb1b4){const _0x24f2ba=a219_0x5c1b3d;if(/^https?:\/\//i[_0x24f2ba(0x2dd)](_0x2a55de))throw CliErrors[_0x24f2ba(0x1ee)]('platformRequest\x20expects\x20an\x20API\x20path,\x20got\x20absolute\x20URL:\x20'+_0x2a55de,_0x24f2ba(0x266));const _0x1cb5bd=_0x2a55de[_0x24f2ba(0x25d)]('/')?_0x2a55de:'/'+_0x2a55de;return platformFetch(''+getApiDomain()+_0x1cb5bd,_0x4eb1b4);}const MAX_KNOWLEDGE_BASE_PAGE_SIZE=0x64;function parseKnowledgeBaseInteger(_0x1c6b01,_0x2b2cfd){const _0x2b5bfb=a219_0x5c1b3d,_0x3327d3=typeof _0x1c6b01===_0x2b5bfb(0x21a)?_0x1c6b01:typeof _0x1c6b01===_0x2b5bfb(0x1fe)&&/^(0|[1-9]\d*)$/[_0x2b5bfb(0x2dd)](_0x1c6b01)?Number(_0x1c6b01):Number[_0x2b5bfb(0x2b2)],_0x1deed0=Number[_0x2b5bfb(0x2f3)](_0x3327d3)&&(_0x2b2cfd==='id'?_0x3327d3>0x0:_0x3327d3>=0x0);if(!_0x1deed0)throw CliErrors[_0x2b5bfb(0x22e)](_0x2b5bfb(0x2be)+_0x2b2cfd+'.');return _0x3327d3;}function parseKnowledgeBaseText(_0x2548be,_0x516e96){const _0x597db9=a219_0x5c1b3d;if(typeof _0x2548be==='string'&&(_0x516e96===_0x597db9(0x264)||_0x2548be[_0x597db9(0x258)]()))return _0x2548be;throw CliErrors[_0x597db9(0x22e)]('Knowledge-base\x20response\x20is\x20missing\x20a\x20valid\x20'+_0x516e96+'.');}function parseKnowledgeBaseRecord(_0x43dbd3){const _0xd54996=a219_0x5c1b3d;if(!_0x43dbd3||typeof _0x43dbd3!==_0xd54996(0x1e5)||Array[_0xd54996(0x2eb)](_0x43dbd3))throw CliErrors['apiError'](_0xd54996(0x244));const _0xa06862=_0x43dbd3;if(_0xa06862[_0xd54996(0x267)]!=='company'&&_0xa06862['scope']!=='personal')throw CliErrors[_0xd54996(0x22e)](_0xd54996(0x261));const _0x35c1ee={'id':parseKnowledgeBaseInteger(_0xa06862['id'],'id'),'scope':_0xa06862[_0xd54996(0x267)],'appCode':parseKnowledgeBaseText(_0xa06862[_0xd54996(0x23a)],'appCode'),'title':parseKnowledgeBaseText(_0xa06862[_0xd54996(0x2ad)],_0xd54996(0x2ad)),'version':parseKnowledgeBaseInteger(_0xa06862[_0xd54996(0x259)],'version'),'content':parseKnowledgeBaseText(_0xa06862[_0xd54996(0x264)],'content')};return(_0xa06862['createTime']===null||typeof _0xa06862[_0xd54996(0x201)]===_0xd54996(0x1fe)||typeof _0xa06862[_0xd54996(0x201)]===_0xd54996(0x21a))&&(_0x35c1ee['createTime']=_0xa06862[_0xd54996(0x201)]),(_0xa06862[_0xd54996(0x252)]===null||typeof _0xa06862[_0xd54996(0x252)]==='string'||typeof _0xa06862[_0xd54996(0x252)]==='number')&&(_0x35c1ee['updateTime']=_0xa06862['updateTime']),_0x35c1ee;}export async function listEnterpriseKnowledgeBases(_0x49d2c9,_0x2cff3f={}){const _0x33bf87=a219_0x5c1b3d,_0x4bd4bb=_0x2cff3f[_0x33bf87(0x29a)]??0x32;if(!Number['isSafeInteger'](_0x4bd4bb)||_0x4bd4bb<0x1||_0x4bd4bb>MAX_KNOWLEDGE_BASE_PAGE_SIZE)throw CliErrors[_0x33bf87(0x1ee)](_0x33bf87(0x1f9)+MAX_KNOWLEDGE_BASE_PAGE_SIZE+'.');const _0xb285=await platformRequest(_0x33bf87(0x299),{'method':_0x33bf87(0x290),'cookie':_0x49d2c9,'label':_0x33bf87(0x2bd),'body':{'currentPage':_0x2cff3f[_0x33bf87(0x20e)]??0x1,'pageSize':_0x4bd4bb,'scope':_0x33bf87(0x26f),..._0x2cff3f[_0x33bf87(0x23a)]?{'appCode':_0x2cff3f[_0x33bf87(0x23a)]}:{},..._0x2cff3f[_0x33bf87(0x2ad)]?{'title':_0x2cff3f[_0x33bf87(0x2ad)]}:{}}});if(!_0xb285||typeof _0xb285!==_0x33bf87(0x1e5)||Array['isArray'](_0xb285)||!Array['isArray'](_0xb285[_0x33bf87(0x211)]))throw CliErrors['apiError'](_0x33bf87(0x1d0));const _0x22d760=extractPaging(_0xb285);if(!_0x22d760||!Number[_0x33bf87(0x27a)](_0x22d760[_0x33bf87(0x20e)])||!Number[_0x33bf87(0x27a)](_0x22d760[_0x33bf87(0x29a)])||!Number[_0x33bf87(0x27a)](_0x22d760[_0x33bf87(0x225)])||_0x22d760[_0x33bf87(0x20e)]<0x1||_0x22d760['pageSize']<0x1||_0x22d760[_0x33bf87(0x29a)]>MAX_KNOWLEDGE_BASE_PAGE_SIZE||_0x22d760[_0x33bf87(0x225)]<0x0)throw CliErrors[_0x33bf87(0x22e)](_0x33bf87(0x26b));return{'items':extractList(_0xb285)['map'](parseKnowledgeBaseRecord),'paging':_0x22d760};}export async function getEnterpriseKnowledgeBase(_0x5a332d,_0x44a62d){const _0x4e4174=a219_0x5c1b3d,_0x24d2ed=await platformRequest('/admin/knowledge-base/get-one'+buildQuery({'id':_0x44a62d}),{'cookie':_0x5a332d,'label':_0x4e4174(0x26c)});return parseKnowledgeBaseRecord(_0x24d2ed);}export async function createEnterpriseKnowledgeBase(_0x2a88c4,_0x57ab7e){const _0x45779e=a219_0x5c1b3d,_0x337edd=await platformRequest(_0x45779e(0x1d4),{'method':_0x45779e(0x290),'cookie':_0x2a88c4,'label':_0x45779e(0x217),'body':{'scope':'company',..._0x57ab7e}});return parseKnowledgeBaseRecord(_0x337edd);}export async function updateEnterpriseKnowledgeBase(_0x50db67,_0x21ad3d){const _0x5b67bf=a219_0x5c1b3d;if(_0x21ad3d[_0x5b67bf(0x2ad)]===undefined&&_0x21ad3d[_0x5b67bf(0x264)]===undefined)throw CliErrors[_0x5b67bf(0x1ee)](_0x5b67bf(0x2a2));const _0x567702=await platformRequest(_0x5b67bf(0x2a4),{'method':_0x5b67bf(0x290),'cookie':_0x50db67,'label':_0x5b67bf(0x2d0),'body':{'id':_0x21ad3d['id'],..._0x21ad3d[_0x5b67bf(0x2ad)]!==undefined?{'title':_0x21ad3d[_0x5b67bf(0x2ad)]}:{},..._0x21ad3d['content']!==undefined?{'content':_0x21ad3d[_0x5b67bf(0x264)]}:{}}});return parseKnowledgeBaseRecord(_0x567702);}export async function deleteEnterpriseKnowledgeBase(_0x2fa16a,_0x28c73a){const _0x125ea6=a219_0x5c1b3d;await platformRequest('/admin/knowledge-base/delete',{'method':'POST','cookie':_0x2fa16a,'label':_0x125ea6(0x28c),'body':{'id':_0x28c73a}});}function cleanNewlines(_0x1895f9){const _0x53c2f1=a219_0x5c1b3d;return _0x1895f9[_0x53c2f1(0x21d)](/[\r\n]+/g,'\x20')[_0x53c2f1(0x258)]();}function cleanDatasetName(_0x2f19b0){const _0x11d231=a219_0x5c1b3d;if(!_0x2f19b0[_0x11d231(0x24d)])return _0x2f19b0;return{..._0x2f19b0,'name':cleanNewlines(_0x2f19b0[_0x11d231(0x24d)])};}export async function fetchModelList(_0x1a1a8a,_0x2a6544){const _0x55aa66=a219_0x5c1b3d,_0x4f86b1=getEnv(),_0x1d5c2f=new URLSearchParams({'appcode':_0x1a1a8a,'otype':_0x55aa66(0x20c)}),_0x21b911=_0x55aa66(0x210)+_0x1d5c2f['toString']();logger[_0x55aa66(0x1d1)](_0x55aa66(0x218),_0x55aa66(0x279)+_0x4f86b1+')',{'apiPath':_0x21b911});const _0x4d03c8=await platformRequest(_0x21b911,{'cookie':_0x2a6544,'label':_0x55aa66(0x219)}),_0x1aff1e=(_0x4d03c8['configArray']??[])['map'](cleanDatasetName);return{'configArray':_0x1aff1e,'count':_0x1aff1e[_0x55aa66(0x26a)]};}export async function fetchDatasetDoc(_0xd52293){const _0xbb8baa=a219_0x5c1b3d,{appCode:_0x59c353,cookie:_0x4c2c12,datasetCode:_0x4c401b,datasetId:_0x5e22c1,extraParams:_0x537c86}=_0xd52293,_0x5cb414=await platformRequest(_0xbb8baa(0x251),{'method':_0xbb8baa(0x290),'body':{'appCode':_0x59c353,'datasetCode':_0x4c401b,'datasetId':_0x5e22c1,..._0x537c86||{}},'cookie':_0x4c2c12,'label':'Fetch\x20doc\x20('+_0x4c401b+')'});if(!_0x5cb414||typeof _0x5cb414['markdown']!==_0xbb8baa(0x1fe))throw new Error(_0xbb8baa(0x2ef)+_0x4c401b+_0xbb8baa(0x2e6));return _0x5cb414[_0xbb8baa(0x25b)];}export async function getMenuTree(_0x41c2b1,_0x40d2f6){const _0x3a266f=a219_0x5c1b3d,_0x481f50=new URLSearchParams({'appCode':_0x41c2b1});return platformRequest(_0x3a266f(0x1d2)+_0x481f50[_0x3a266f(0x1e6)](),{'cookie':_0x40d2f6,'label':_0x3a266f(0x21f)});}export async function createMenuRecord(_0x5e0e2b,_0x5e0a0b,_0x5271dc){const _0x539ff9=a219_0x5c1b3d;return platformRequest(_0x539ff9(0x284),{'method':_0x539ff9(0x290),'body':_0x5e0e2b,'cookie':_0x5e0a0b,'label':_0x5271dc});}export async function updateMenuRecord(_0x27f280,_0x2ae7ae,_0x3348da){const _0x3f5f7c=a219_0x5c1b3d;return platformRequest(_0x3f5f7c(0x1e3),{'method':'POST','body':_0x27f280,'cookie':_0x2ae7ae,'label':_0x3348da});}export async function deleteMenuRecord(_0x30a052,_0x2346e1,_0x26292b){const _0x34eace=a219_0x5c1b3d;return platformRequest('/smartapi/menu/delete',{'method':_0x34eace(0x290),'body':{'id':_0x30a052},'cookie':_0x2346e1,'label':_0x26292b});}export async function batchDeleteMenuRecords(_0x1319a1,_0x91bf07,_0x5bd9c4){const _0x576a42=a219_0x5c1b3d;return platformRequest('/smartapi/menu/batchDelete',{'method':_0x576a42(0x290),'body':{'idList':_0x1319a1},'cookie':_0x91bf07,'label':_0x5bd9c4});}export async function startMenuRegroup(_0x5980cd,_0x24e409,_0x598177){const _0xcc7da3=a219_0x5c1b3d;return platformRequest('/smartapi/menu/regroup',{'method':_0xcc7da3(0x290),'body':_0x5980cd,'cookie':_0x24e409,'label':_0x598177});}export async function getAsyncTaskStatus(_0x5ebe7d,_0x1b0a9c,_0x38eb47){const _0x51e9fc=a219_0x5c1b3d,_0x24aca3=new URLSearchParams({'appCode':_0x1b0a9c});return platformRequest(_0x51e9fc(0x224)+encodeURIComponent(_0x5ebe7d)+'?'+_0x24aca3[_0x51e9fc(0x1e6)](),{'cookie':_0x38eb47,'label':_0x51e9fc(0x2a8)+_0x5ebe7d});}export async function listBffScripts(_0xb596f9,_0x275494,_0x1ad6e0){const _0x5a462d=a219_0x5c1b3d;let _0x433235=_0x5a462d(0x291)+_0xb596f9;if(_0x275494)_0x433235+=_0x5a462d(0x25a)+_0x275494;const _0x383521=await apiRequest(_0x433235);let _0x30dcc2=extractList(_0x383521[_0x5a462d(0x297)]);if(_0x1ad6e0?.['scriptName']){const _0x18c011=_0x1ad6e0['scriptName'][_0x5a462d(0x250)]();_0x30dcc2=_0x30dcc2[_0x5a462d(0x1f0)](_0x3cd676=>_0x3cd676[_0x5a462d(0x2ca)]?.['toLowerCase']()[_0x5a462d(0x2c0)](_0x18c011)||_0x3cd676['description']?.[_0x5a462d(0x250)]()['includes'](_0x18c011));}return _0x30dcc2;}export async function getBffScriptInfo(_0xa75fb7){const _0x444296=a219_0x5c1b3d,_0x21e397=await apiRequest(_0x444296(0x26d)+_0xa75fb7);if(!_0x21e397[_0x444296(0x297)])throw CliErrors[_0x444296(0x1ee)]('BFF\x20script\x20not\x20found:\x20id='+_0xa75fb7);return _0x21e397[_0x444296(0x297)];}export async function saveBffScript(_0x2d2ffc){const _0x242544=a219_0x5c1b3d,_0x3294f4=await apiRequest(_0x242544(0x2f5),{'method':_0x242544(0x290),'body':_0x2d2ffc}),{id:_0x49c233,entity:_0x53e8e1}=normalizeEntityWithIdResponse(_0x3294f4['data']);if(_0x49c233!==undefined){const _0x31ba67=typeof _0x53e8e1[_0x242544(0x2ca)]===_0x242544(0x1fe)||typeof _0x53e8e1[_0x242544(0x295)]===_0x242544(0x1fe)?_0x53e8e1:undefined;return{'id':_0x49c233,'script':_0x31ba67};}throw CliErrors['apiError'](_0x242544(0x2a9));}export async function deleteBffScript(_0x47a319){const _0x8823ac=a219_0x5c1b3d;await apiRequest(_0x8823ac(0x241),{'method':_0x8823ac(0x290),'body':{'id':_0x47a319}});}export async function getBffScriptStatistics(_0x71ffd1){const _0xd64916=a219_0x5c1b3d,_0x6209b7=await apiRequest('/api/management/library/scripts/statistics?appCode='+_0x71ffd1);return extractList(_0x6209b7[_0xd64916(0x297)]);}export async function clearBffScriptCache(){const _0x31e361=a219_0x5c1b3d,_0x14af6f=await apiRequest(_0x31e361(0x205),{'method':'POST','useRuntime':!![]});return typeof _0x14af6f['data']===_0x31e361(0x1fe)?_0x14af6f[_0x31e361(0x297)]:'';}export async function listBffDatasetOperations(_0x469cdf,_0x51635d){const _0x357e05=a219_0x5c1b3d,_0x4e3da5=await apiRequest(_0x357e05(0x247),{'method':_0x357e05(0x290),'body':{'appCode':_0x469cdf,'datasetId':_0x51635d}});return _0x4e3da5[_0x357e05(0x297)];}export async function listSqlQueries(_0x4a6811,_0x3b3140){const _0x552f6e=a219_0x5c1b3d,_0x3a356c=await apiRequest(_0x552f6e(0x2af),{'method':'POST','body':{'appCode':_0x4a6811,'currentPage':_0x3b3140?.[_0x552f6e(0x20e)]??0x1,'pageSize':_0x3b3140?.['pageSize']??0x32,'sqlCode':_0x3b3140?.[_0x552f6e(0x1ff)],'sqlName':_0x3b3140?.[_0x552f6e(0x256)]}});return _0x3a356c['data'];}export async function getSqlQueryInfo(_0x4c5295,_0x203d6d){const _0x5a7f8f=a219_0x5c1b3d,_0x575bb9=await listSqlQueries(_0x4c5295,{'sqlCode':_0x203d6d}),_0x2b8716=_0x575bb9['tableData']?.[0x0];if(!_0x2b8716)throw CliErrors[_0x5a7f8f(0x1ee)]('SQL\x20query\x20not\x20found:\x20'+_0x203d6d);return _0x2b8716;}export async function getSqlQueryDetail(_0x5e48cf){const _0x58a90c=a219_0x5c1b3d,_0x848685=await apiRequest(_0x58a90c(0x274)+(_0x58a90c(0x292)+encodeURIComponent(_0x5e48cf)));if(!_0x848685[_0x58a90c(0x297)])throw CliErrors[_0x58a90c(0x1ee)](_0x58a90c(0x1cd)+_0x5e48cf);return _0x848685['data'];}export async function getSqlQueryDetailById(_0x29fe92){const _0x2dafd0=a219_0x5c1b3d,_0x49d3b5=await apiRequest(_0x2dafd0(0x285)+_0x29fe92);if(!_0x49d3b5[_0x2dafd0(0x297)])throw CliErrors[_0x2dafd0(0x1ee)](_0x2dafd0(0x1db)+_0x29fe92);return _0x49d3b5[_0x2dafd0(0x297)];}export async function createSqlQuery(_0x46d41f){const _0x597a3a=a219_0x5c1b3d,_0x2e20ff=await apiRequest('/smartapi/custom/saveUserCustomSql',{'method':_0x597a3a(0x290),'body':_0x46d41f}),{id:_0x4884d3,entity:_0x39249c}=normalizeEntityWithIdResponse(_0x2e20ff['data']);if(!(_0x597a3a(0x1ff)in _0x39249c)&&_0x4884d3)return getSqlQueryDetailById(_0x4884d3);return normalizeSqlQueryEntity(_0x39249c);}export async function updateSqlQuery(_0x5be1be){const _0x4bfb44=a219_0x5c1b3d,_0x48046f=await apiRequest(_0x4bfb44(0x2de),{'method':_0x4bfb44(0x290),'body':_0x5be1be}),{id:_0x4218a5,entity:_0x39d563}=normalizeEntityWithIdResponse(_0x48046f[_0x4bfb44(0x297)]);if(!(_0x4bfb44(0x1ff)in _0x39d563)){if(_0x5be1be['sqlCode'])return getSqlQueryDetail(_0x5be1be[_0x4bfb44(0x1ff)]);if(_0x4218a5)return getSqlQueryDetailById(_0x4218a5);}return normalizeSqlQueryEntity(_0x39d563);}export async function deleteSqlQuery(_0x1a5c18){const _0x119867=a219_0x5c1b3d;await apiRequest(_0x119867(0x1e7),{'method':_0x119867(0x290),'body':_0x1a5c18});}export async function saveSqlQuery(_0x433615){const _0x4cacb3=a219_0x5c1b3d,_0x4619f7=await apiRequest(_0x4cacb3(0x2cf),{'method':_0x4cacb3(0x290),'body':_0x433615});return _0x4619f7[_0x4cacb3(0x297)];}function normalizeSqlQueryEntity(_0x4b351e){const _0x2e5816=a219_0x5c1b3d;return{..._0x4b351e,'id':Number(_0x4b351e['id']),'dbId':_0x4b351e[_0x2e5816(0x1dc)]==null?undefined:Number(_0x4b351e[_0x2e5816(0x1dc)]),'version':_0x4b351e[_0x2e5816(0x259)]==null?undefined:Number(_0x4b351e[_0x2e5816(0x259)])};}export async function executeSql(_0x13b75f,_0x5a671b,_0x40ba79){const _0x2a62a1=a219_0x5c1b3d,_0x4c460c=await apiRequest('/api/custom/executeSql',{'method':_0x2a62a1(0x290),'body':{'appCode':_0x13b75f,'sqlCode':_0x5a671b,..._0x40ba79&&{'params':_0x40ba79}},'useRuntime':!![]});return _0x4c460c['data'];}export async function executeDatasetDataOperation(_0x227691,_0x376cd0,_0x144a4e,_0x4976b9={}){const _0x4463a9=a219_0x5c1b3d;try{const _0x3bdd16=await apiRequest(_0x4463a9(0x2ec)+_0x227691+'/'+_0x376cd0+'/'+_0x144a4e,{'method':'POST','body':_0x4976b9,'useRuntime':!![]});return _0x3bdd16[_0x4463a9(0x297)];}catch(_0x51dea5){if(_0x144a4e===_0x4463a9(0x1f2)&&_0x51dea5 instanceof CliError&&_0x51dea5['code']==='api_error'&&_0x4976b9['id']!==undefined&&_0x4976b9['id']!==null&&_0x4976b9['id']!==''){const _0x340275=await apiRequest('/api/'+_0x227691+'/'+_0x376cd0+_0x4463a9(0x2a7),{'method':'POST','body':{'where':{'id':{'$eq':_0x4976b9['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0x220996=Array[_0x4463a9(0x2eb)](_0x340275[_0x4463a9(0x297)]?.['tableData'])?_0x340275[_0x4463a9(0x297)][_0x4463a9(0x211)]:[];return _0x220996[0x0]??null;}throw _0x51dea5;}}export async function listDatasets(_0x5ba530,_0x4a087f){const _0x454916=a219_0x5c1b3d,_0x29ba08={'appCode':_0x5ba530,'deleted':_0x4a087f?.[_0x454916(0x232)]??![]};if(_0x4a087f?.[_0x454916(0x260)])_0x29ba08['code']=_0x4a087f[_0x454916(0x260)];if(_0x4a087f?.[_0x454916(0x24d)])_0x29ba08['name']=_0x4a087f[_0x454916(0x24d)];if(_0x4a087f?.[_0x454916(0x21c)])_0x29ba08[_0x454916(0x21c)]=_0x4a087f[_0x454916(0x21c)];const _0x2ccb97=await apiRequest(_0x454916(0x22b),{'method':_0x454916(0x290),'body':_0x29ba08});return extractList(_0x2ccb97[_0x454916(0x297)]);}export async function deleteDataset(_0x50bb4e,_0x5c4ebe){const _0x25f06b=a219_0x5c1b3d;await apiRequest(_0x25f06b(0x206)+(_0x5c4ebe?_0x25f06b(0x2d8):_0x25f06b(0x2fa)),{'method':_0x25f06b(0x290),'body':{'id':_0x50bb4e}});}export async function restoreDataset(_0x43d617,_0x2bcc1a){const _0x620ff7=a219_0x5c1b3d;await apiRequest(_0x620ff7(0x2b8),{'method':_0x620ff7(0x290),'body':{'appCode':_0x43d617,'datasetId':_0x2bcc1a}});}export async function listRecycleBinResources(_0x41e60e,_0x2c8fad,_0x18dde9){const _0x3cb83f=a219_0x5c1b3d,_0x5f256a=new URLSearchParams({'appCode':_0x41e60e,'resourceType':_0x2c8fad,'currentPage':String(_0x18dde9['currentPage']),'pageSize':String(_0x18dde9[_0x3cb83f(0x29a)])});if(_0x18dde9[_0x3cb83f(0x2b6)])_0x5f256a[_0x3cb83f(0x2c5)]('resourceName',_0x18dde9[_0x3cb83f(0x2b6)]);const _0x654d0d=await apiRequest(_0x3cb83f(0x2a3)+_0x5f256a[_0x3cb83f(0x1e6)]());return{'items':extractList(_0x654d0d[_0x3cb83f(0x297)]),'paging':extractPaging(_0x654d0d[_0x3cb83f(0x297)])};}export async function restoreRecycleBinResource(_0x2bb096){const _0x475671=a219_0x5c1b3d;await apiRequest(_0x475671(0x220),{'method':_0x475671(0x290),'body':{'id':_0x2bb096}});}export async function previewTextGeneratedDataset(_0x49b627,_0xee40ee){const _0x51474b=a219_0x5c1b3d,_0x53e81a=await apiRequest('/smartapi/dataset/text-generate/preview',{'method':'POST','body':{'appCode':_0x49b627,'datasetName':_0xee40ee[_0x51474b(0x28a)],'requirementDescription':_0xee40ee[_0x51474b(0x2da)]},'timeout':TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS});return _0x53e81a[_0x51474b(0x297)];}export async function startTextGeneratedDataset(_0x514bdc,_0x1281a8,_0x544ff2){const _0x5a8e48=a219_0x5c1b3d,_0x1d7196=await apiRequest(_0x5a8e48(0x213),{'method':_0x5a8e48(0x290),'body':{'appCode':_0x514bdc,..._0x544ff2?.[_0x5a8e48(0x237)]?{'clientOperationId':_0x544ff2['clientOperationId']}:{},'design':_0x1281a8},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x1d7196[_0x5a8e48(0x297)];}export async function getTextGeneratedDatasetStatus(_0x1ff6ce,_0x67dbf5){const _0x4fd4c5=a219_0x5c1b3d,_0x591ff8=new URLSearchParams({'appCode':_0x1ff6ce});if(_0x67dbf5[_0x4fd4c5(0x2df)])_0x591ff8[_0x4fd4c5(0x2c5)]('operationId',_0x67dbf5[_0x4fd4c5(0x2df)]);else{if(_0x67dbf5['operationId'])_0x591ff8[_0x4fd4c5(0x2c5)](_0x4fd4c5(0x20a),_0x67dbf5[_0x4fd4c5(0x20a)]);else _0x67dbf5[_0x4fd4c5(0x237)]&&_0x591ff8[_0x4fd4c5(0x2c5)]('clientOperationId',_0x67dbf5['clientOperationId']);}const _0x392d01=await apiRequest(_0x4fd4c5(0x27e)+_0x591ff8[_0x4fd4c5(0x1e6)]());return _0x392d01['data'];}export async function searchDatasets(_0x3aef49,_0x60b99d){const _0x5086ba=a219_0x5c1b3d,_0x1b91f4=await listDatasets(_0x3aef49,{'name':_0x60b99d}),_0x565b05=_0x60b99d['toLowerCase'](),_0x2d956b=new Set(_0x1b91f4[_0x5086ba(0x298)](_0x5e53c5=>_0x5e53c5['id'])),_0x114812=_0x1b91f4[_0x5086ba(0x1f0)](_0x310891=>_0x310891['dbtableConfig']?.[_0x5086ba(0x296)]?.[_0x5086ba(0x250)]()[_0x5086ba(0x2c0)](_0x565b05)||_0x310891[_0x5086ba(0x1e8)]?.[_0x5086ba(0x250)]()[_0x5086ba(0x2c0)](_0x565b05)),_0x586f89=await listDatasets(_0x3aef49,{'code':_0x60b99d});for(const _0x1f1660 of _0x586f89){!_0x2d956b[_0x5086ba(0x234)](_0x1f1660['id'])&&(_0x1b91f4[_0x5086ba(0x1ed)](_0x1f1660),_0x2d956b[_0x5086ba(0x1d6)](_0x1f1660['id']));}return _0x1b91f4;}export function normalizeDatasetOperations(_0x839599){const _0x12cde3=a219_0x5c1b3d;if(Array[_0x12cde3(0x2eb)](_0x839599))return _0x839599[_0x12cde3(0x1f0)](_0x40f846=>_0x40f846!=null&&typeof _0x40f846==='object');if(_0x839599&&typeof _0x839599===_0x12cde3(0x1e5))return Object[_0x12cde3(0x2d2)](_0x839599)[_0x12cde3(0x1f0)](([,_0x1cb0c9])=>_0x1cb0c9!=null&&typeof _0x1cb0c9===_0x12cde3(0x1e5))[_0x12cde3(0x298)](([_0xff24a8,_0x266968])=>({..._0x266968,'name':_0x266968[_0x12cde3(0x24d)]??_0x266968[_0x12cde3(0x22d)]??_0xff24a8}));return[];}export async function getDatasetDetail(_0x5b3efb){const _0x4c2686=a219_0x5c1b3d,_0x350916=/^\d+$/[_0x4c2686(0x2dd)](_0x5b3efb)?'id':'code',_0x1bf34e=await apiRequest(_0x4c2686(0x2b0)+_0x350916+'='+_0x5b3efb);return _0x1bf34e[_0x4c2686(0x297)];}export async function updateDrivenData(_0x1414df){const _0x2940f7=a219_0x5c1b3d,_0x8fa601=await apiRequest(_0x2940f7(0x27b),{'method':_0x2940f7(0x290),'body':_0x1414df});return _0x8fa601[_0x2940f7(0x297)];}export async function getDatasetOperations(_0x5f3adb){const _0x4a3b5e=a219_0x5c1b3d,_0x321751=await getDatasetDetail(_0x5f3adb),_0x598f06=normalizeDatasetOperations(_0x321751['operations'])['map'](_0x248b32=>({'name':_0x248b32[_0x4a3b5e(0x24d)]||_0x248b32[_0x4a3b5e(0x22d)],'displayName':_0x248b32[_0x4a3b5e(0x223)]||_0x248b32[_0x4a3b5e(0x24d)],'type':_0x248b32[_0x4a3b5e(0x222)],'method':_0x248b32[_0x4a3b5e(0x242)],'path':_0x248b32[_0x4a3b5e(0x236)],'enabled':_0x248b32['enabled']??!![],'requestFields':_0x248b32[_0x4a3b5e(0x288)],'responseFields':_0x248b32[_0x4a3b5e(0x1d7)]}));return{'dataset':{'id':_0x321751['id']??_0x321751[_0x4a3b5e(0x263)],'name':_0x321751[_0x4a3b5e(0x24d)],'code':_0x321751[_0x4a3b5e(0x260)]||_0x321751[_0x4a3b5e(0x2c7)],'tableName':_0x321751[_0x4a3b5e(0x296)]||_0x321751[_0x4a3b5e(0x24b)]?.[_0x4a3b5e(0x296)]},'operations':_0x598f06};}export async function getOperationDetail(_0x2742ae,_0x45c17f,_0x494378){const _0x2ebbc4=a219_0x5c1b3d;let _0x73fc6e=_0x45c17f;if(!/^\d+$/[_0x2ebbc4(0x2dd)](_0x45c17f)){const _0x3bb86a=await listDatasets(_0x2742ae,{'code':_0x45c17f}),_0x2c6031=_0x3bb86a['find'](_0x95e8d5=>_0x95e8d5['code']===_0x45c17f||String(_0x95e8d5['id'])===_0x45c17f);if(!_0x2c6031)throw CliErrors[_0x2ebbc4(0x1ee)]('Dataset\x20not\x20found:\x20'+_0x45c17f);_0x73fc6e=String(_0x2c6031['id']);}const _0x22119e=await getDatasetDetail(_0x73fc6e),_0x3ab1dc=normalizeDatasetOperations(_0x22119e[_0x2ebbc4(0x1d5)])[_0x2ebbc4(0x262)](_0xb2add=>(_0xb2add[_0x2ebbc4(0x24d)]||_0xb2add['operationName'])===_0x494378);if(!_0x3ab1dc)throw CliErrors[_0x2ebbc4(0x1ee)](_0x2ebbc4(0x1e9)+_0x494378+'\x22\x20not\x20found\x20in\x20dataset\x20'+_0x45c17f);return{'dataset':{'id':_0x22119e['id']??_0x22119e[_0x2ebbc4(0x263)],'name':_0x22119e[_0x2ebbc4(0x24d)],'code':_0x22119e['code']||_0x22119e[_0x2ebbc4(0x2c7)],'tableName':_0x22119e[_0x2ebbc4(0x296)]||_0x22119e['dbtableConfig']?.[_0x2ebbc4(0x296)]},'operation':_0x3ab1dc};}export async function getAppInfo(_0x58ed8f){const _0x14011b=a219_0x5c1b3d,_0x1c2d42=await apiRequest(_0x14011b(0x2ce)+buildQuery({'appCode':_0x58ed8f}));return _0x1c2d42[_0x14011b(0x297)];}export async function getI18nInfo(_0x240751){const _0xbe9194=a219_0x5c1b3d,_0x323b7e=await getAppInfo(_0x240751);return{'enableI18n':_0x323b7e[_0xbe9194(0x204)],..._0x323b7e['i18nInfo']};}export async function createReactPage(_0x1b45e6){const _0xbed5a=a219_0x5c1b3d,_0x438664=await apiRequest('/smartapi/webcode/page/create',{'method':_0xbed5a(0x290),'body':{'appCode':_0x1b45e6[_0xbed5a(0x23a)],'pageName':_0x1b45e6['pageName'],..._0x1b45e6[_0xbed5a(0x2c8)]!=null?{'parentMenuId':_0x1b45e6[_0xbed5a(0x2c8)]}:{},'createMenu':_0x1b45e6[_0xbed5a(0x1f7)],'codeContent':_0x1b45e6[_0xbed5a(0x2ba)]}});return{'pageId':_0x438664['data'][_0xbed5a(0x25e)],'pageName':_0x438664['data'][_0xbed5a(0x24e)]??_0x1b45e6['pageName'],'appCode':_0x1b45e6[_0xbed5a(0x23a)],'version':_0x438664[_0xbed5a(0x297)][_0xbed5a(0x208)]??0x0,'menuId':_0x438664[_0xbed5a(0x297)][_0xbed5a(0x2e7)]?.['id']??null,'menuPath':_0x438664[_0xbed5a(0x297)][_0xbed5a(0x2e7)]?.['path']??null,'files':_0x438664[_0xbed5a(0x297)]['files']};}export async function updateReactPageContent(_0x354855){const _0x319688=a219_0x5c1b3d,_0x298ab2=await apiRequest(_0x319688(0x243),{'method':_0x319688(0x290),'body':{'id':_0x354855[_0x319688(0x25e)],'codeContent':_0x354855['pageContent']}});return{'pageId':_0x354855[_0x319688(0x25e)],'newVersion':_0x298ab2[_0x319688(0x297)]};}export async function publishReactPage(_0x35db7e){const _0x412f4d=a219_0x5c1b3d,_0x17c896=await apiRequest(_0x412f4d(0x1f4),{'method':_0x412f4d(0x290),'body':{'id':_0x35db7e[_0x412f4d(0x25e)],..._0x35db7e[_0x412f4d(0x1fc)]?{'remark':_0x35db7e[_0x412f4d(0x1fc)]}:{}}});return _0x17c896[_0x412f4d(0x297)];}export async function getReactPageSource(_0x5cdace){const _0x3886fc=a219_0x5c1b3d,_0xfab219=await apiRequest(_0x3886fc(0x212)+buildQuery({'id':_0x5cdace}));if(!_0xfab219[_0x3886fc(0x297)])throw CliErrors['validation'](_0x3886fc(0x1e4)+_0x5cdace);return _0xfab219['data'];}export async function startGenerateStandardPages(_0x5b1ee5,_0x488093,_0x38d9a2){const _0x6cb767=a219_0x5c1b3d,_0x594c30=await apiRequest('/smartapi/lovrabet/dataset/'+_0x488093+_0x6cb767(0x280),{'method':'POST','body':{'appCode':_0x5b1ee5,..._0x38d9a2?.[_0x6cb767(0x237)]?{'clientOperationId':_0x38d9a2['clientOperationId']}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x594c30[_0x6cb767(0x297)];}function a219_0x118d(){const _0x23322a=['Unauthorized','.remove(id);','DATA_NOT_EXIST','const\x20result\x20=\x20await\x20client.models.','false','SQL\x20query\x20not\x20found:\x20','/standard-page-status?appCode=','const\x20data\x20=\x20await\x20client.sql.execute({','List\x20enterprise\x20knowledge\x20bases\x20returned\x20an\x20invalid\x20response\x20contract.','info','/smartapi/menu/find?','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','/admin/knowledge-base/create','operations','add','responseFields','body','/smartapi/question/er-config/cli/delete-single','/smartapi/lovrabet/dataset/','SQL\x20query\x20not\x20found:\x20id=','dbId','join','Request\x20timeout:\x20','\x20apps.\x20','target','Warning:\x20showing\x20first\x20','/smartapi/question/er-config/business-groups','/smartapi/menu/update','React\x20custom\x20page\x20not\x20found:\x20','object','toString','/smartapi/custom/deleteUserCustomSql','description','Operation\x20\x22','relation','/smartapi/permit/role/delete','/smartapi/db-analysis/jobs/cancel','push','validation','physicalTableCount','filter','/userTenant/queryBelongsTenants','getOne','max','/smartapi/webcode/file/publish','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','2198568wzikEU','createMenu','/notification/channel-config/delete','Knowledge-base\x20pageSize\x20must\x20be\x20an\x20integer\x20between\x201\x20and\x20','/sync-to-pages','append','remark','roleType','string','sqlCode','dataset_','createTime','/smartapi/page/restore','/smartapi/common/uploadFile','enableI18n','/api/management/script/cache/clear','/smartapi/dataset/delete?cascade=','API\x20error\x20code:\x20','draftVersion','/smartapi/dblink/testConnect','operationId','\x20\x20});','array',',\x20HTTP\x20','currentPage','/smartapi/dblink/getAllTableList','/api/node-toolbox/dataset/model-list?','tableData','/smartapi/webcode/page/detail','/smartapi/dataset/text-generate/start','defineProperty','warn','success','Create\x20enterprise\x20knowledge\x20base','fetch-model-list','Fetch\x20datasets','number','pageIndex','source','replace','/smartapi/user-accounts/cli/dingding-sandbox/bind','Fetch\x20menu\x20list','/smartapi/recycleBin/resource/restore','\x20\x20sqlCode:\x20\x27','type','displayName','/smartapi/tasks/','totalCount','/smartapi/permit/user-role/create','10vmbaGk','(/*\x20params\x20*/);','remove','/smartapi/app-config/getByKey','/smartapi/dataset/get-dataset-list','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','operationName','apiError','Expected\x20the\x20server\x20data\x20field\x20to\x20be\x20an\x20array.','list','/smartapi/question/er-config/business-group/edit','deleted','\x20\x20return\x20rows;','has','.getOne(id);','path','clientOperationId','/smartapi/question/er-config/cli/detail?','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','appCode','API\x20returned\x20an\x20invalid\x20JSON\x20response\x20envelope\x20(HTTP\x20','.create({\x20/*\x20fields\x20*/\x20});','\x20failed,\x20HTTP\x20',':\x20invalid\x20JSON\x20response\x20envelope','hint','/smartapi/dblink/getTableDiffV2ByPage','/api/management/library/scripts/delete','method','/smartapi/webcode/page/update/content','Knowledge-base\x20API\x20returned\x20an\x20invalid\x20record\x20contract.','userTenantRelationList','/smartapi/dblink/getDiffTableByPage','/smartapi/dataset/get-dataset-operation','cookie','key','tableList','dbtableConfig','summary','name','materialName','401','toLowerCase','/api/node-toolbox/api-doc-generator','updateTime','5058876MoPcdp','112yxcotn','/smartapi/dblink/table-diff/analyze/start','sqlName','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','trim','version','&type=','markdown','Invalid\x20notification\x20config\x20list\x20response.','startsWith','pageId','message','code','Knowledge-base\x20response\x20contains\x20an\x20invalid\x20scope.','find','modelId','content','ENABLE','Use\x20platformFetch\x20only\x20for\x20legacy\x20absolute-URL\x20calls.','scope','min','API\x20error\x20code:\x20306','length','List\x20enterprise\x20knowledge\x20bases\x20returned\x20invalid\x20paging\x20metadata.','Get\x20enterprise\x20knowledge\x20base','/api/management/library/scripts/info?id=','325031NGatgw','company','/smartapi/app/getList','48998angvrY','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','/smartapi/db-analysis/start','/smartapi/custom/getUserCustomSql','10GtrykX','/smartapi/permit/user-role/get-user-list','/notification/channel-config/create','/smartapi/app-config/list','正在从服务器拉取模型列表...\x20(环境:\x20','isInteger','/smartapi/dataset/update-driven-data','userId','Check\x20network\x20connectivity\x20and\x20try\x20again.','/smartapi/dataset/text-generate/status?','API\x20error:\x20','/generate-standard-pages/start','download','abort','value','/smartapi/menu/create','/smartapi/custom/getUserCustomSql?id=','status','\x20\x20currentPage:\x201,','requestFields','/smartapi/db-analysis/status/','datasetName','roleName','Delete\x20enterprise\x20knowledge\x20base','json','//\x20SQL:\x20','email','POST','/api/management/library/scripts/list?appCode=','?sqlCode=','/smartapi/webcode/page/restore','api_error','scriptType','tableName','data','map','/admin/knowledge-base/get-list','pageSize','datasetTableCount','//\x20','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','/smartapi/question/er-config/cli/erCreate','errorMsg','cli:rabetbase','UNAUTHORIZED','Knowledge-base\x20update\x20requires\x20title\x20or\x20content.','/smartapi/recycleBin/resource/list?','/admin/knowledge-base/update','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','});','/filter','Fetch\x20async\x20task\x20','BFF\x20save\x20returned\x20no\x20valid\x20id','application/json','5255080dyOKdw','/smartapi/lovrabet/detail?pageId=','title','/smartapi/dblink/create','/smartapi/custom/queryUserCustomSqlList','/smartapi/dataset/get-driven-data?','tags','NaN','update','delete','/smartapi/dblink/delete','resourceName','\x20\x20pageSize:\x2020,','/smartapi/dataset/restore-dataset','stringify','files','platform-error-code','authRequired','List\x20enterprise\x20knowledge\x20bases','Knowledge-base\x20response\x20contains\x20an\x20invalid\x20','/generate-standard-pages/status?','includes','/smartapi/app-config/update','signal','AbortError','table','set','GET','modelCode','parentMenuId','errorMessage','functionName','sdk','isFinite','/smartapi/common/queryFileUrl','/smartapi/app/getOne','/api/node-toolbox/sql/save','Update\x20enterprise\x20knowledge\x20base','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','entries','/smartapi/dblink/getList','6615642dHIgeh','39616659qcvbZb','/notification/channel-config/list','/smartapi/permit/role/get-list','true','\x20returned\x20an\x20invalid\x20JSON\x20response\x20envelope\x20after\x20HTTP\x20success.','requirementDescription','label','.filter({','test','/smartapi/custom/updateUserCustomSql','taskId','create','/smartapi/question/er-config/cli/update-single','\x20of\x20','Use\x20the\x20platform\x20console\x20to\x20see\x20all.','/smartapi/lovrabet/update-page','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','):\x20missing\x20data.markdown\x20field','menu','Request\x20failed:\x20','roleId','Page\x20not\x20found:\x20','isArray','/api/','\x20\x20where:\x20{},','errorCode','Invalid\x20response\x20format\x20(','/notification/channel-config/','\x20failed','includeImports','isSafeInteger','0000','/api/management/library/scripts/save'];a219_0x118d=function(){return _0x23322a;};return a219_0x118d();}export async function getGenerateStandardPagesStatus(_0x3ffdd9,_0x4cb07f,_0x25116a){const _0x546c16=a219_0x5c1b3d,_0x5f1bd5=new URLSearchParams({'appCode':_0x3ffdd9});_0x25116a['taskId']&&_0x5f1bd5[_0x546c16(0x2c5)](_0x546c16(0x2df),_0x25116a['taskId']);_0x25116a[_0x546c16(0x20a)]&&_0x5f1bd5[_0x546c16(0x2c5)](_0x546c16(0x20a),_0x25116a['operationId']);_0x25116a[_0x546c16(0x237)]&&_0x5f1bd5['set'](_0x546c16(0x237),_0x25116a[_0x546c16(0x237)]);const _0x35a2fc=await apiRequest('/smartapi/lovrabet/dataset/'+_0x4cb07f+_0x546c16(0x2bf)+_0x5f1bd5[_0x546c16(0x1e6)]());return _0x35a2fc[_0x546c16(0x297)];}export async function getStandardPageStatus(_0x9a5cc4,_0x135b82){const _0x3974ad=a219_0x5c1b3d,_0x2411c0=await apiRequest(_0x3974ad(0x1da)+_0x135b82+_0x3974ad(0x1ce)+encodeURIComponent(_0x9a5cc4));return _0x2411c0[_0x3974ad(0x297)];}export async function tryGetStandardPageStatus(_0x575925,_0xa33ac2){const _0x39f1af=a219_0x5c1b3d;try{return await getStandardPageStatus(_0x575925,_0xa33ac2);}catch(_0x2edaae){if(_0x2edaae instanceof CliError&&_0x2edaae['code']===_0x39f1af(0x294)&&/404|not found|non-json response/i[_0x39f1af(0x2dd)](_0x2edaae[_0x39f1af(0x25f)]))return null;throw _0x2edaae;}}export async function syncStandardPages(_0x469e6c,_0x296dbe){const _0x20d090=a219_0x5c1b3d,_0x44cad5=await apiRequest(_0x20d090(0x1da)+_0x296dbe+_0x20d090(0x1fa),{'method':_0x20d090(0x290),'body':{'appCode':_0x469e6c}});return _0x44cad5[_0x20d090(0x297)];}export async function getPageDetail(_0x57339e){const _0x5ebb8e=a219_0x5c1b3d,_0x500d0b=await apiRequest(_0x5ebb8e(0x2ac)+_0x57339e);if(!_0x500d0b[_0x5ebb8e(0x297)])throw CliErrors[_0x5ebb8e(0x1ee)](_0x5ebb8e(0x2ea)+_0x57339e);return _0x500d0b['data'];}export async function listDeletedPages(_0x3065dc,_0xa2d4fd,_0x2e0d1a){const _0x22b630=a219_0x5c1b3d,_0x186120=new URLSearchParams({'appCode':_0x3065dc,'type':_0xa2d4fd,'currentPage':String(_0x2e0d1a[_0x22b630(0x20e)]),'pageSize':String(_0x2e0d1a[_0x22b630(0x29a)])}),_0x4d99e8=await apiRequest('/smartapi/page/getDeletedPageList?'+_0x186120[_0x22b630(0x1e6)]());return _0x4d99e8['data'];}export async function restoreStandardPage(_0x32b0ab){const _0xeb62c9=a219_0x5c1b3d;await apiRequest(_0xeb62c9(0x202),{'method':_0xeb62c9(0x290),'body':{'id':_0x32b0ab}});}export async function restoreJsxPage(_0x3c0721,_0x4ed62b){const _0x5e6d61=a219_0x5c1b3d,_0x190b77=await apiRequest(_0x5e6d61(0x293),{'method':_0x5e6d61(0x290),'body':{'appCode':_0x3c0721,'id':_0x4ed62b}});return _0x190b77['data'];}export async function updatePage(_0x320596,_0xac8e29,_0x586a16,_0x2a992b){const _0x5d4a31=a219_0x5c1b3d,_0x4a06d7=await apiRequest(_0x5d4a31(0x2e4),{'method':_0x5d4a31(0x290),'body':{'appCode':_0x320596,'pageId':_0xac8e29,'code':_0x586a16,'datasetIds':_0x2a992b}});return _0x4a06d7[_0x5d4a31(0x297)];}export function generateSdkCode(_0x29de88,_0x5bd9e6,_0x274d62){const _0x96067d=a219_0x5c1b3d,_0x17e3c7=_0x274d62?.['includeImports']??!![],_0xe957e4=_0x96067d(0x200)+_0x29de88[_0x96067d(0x260)]?.[_0x96067d(0x21d)](/-/g,'_'),_0x2655bc=_0x5bd9e6[_0x96067d(0x24d)]||_0x5bd9e6['operationName']||_0x96067d(0x1f0),_0x121368=[];_0x17e3c7&&_0x121368[_0x96067d(0x1ed)](_0x96067d(0x1f5),'',_0x96067d(0x1d3),'');_0x121368['push'](_0x96067d(0x29c)+_0x29de88['name']+'\x20('+(_0x29de88[_0x96067d(0x296)]||_0x96067d(0x2c4))+')');if(_0x2655bc===_0x96067d(0x1f0))_0x121368[_0x96067d(0x1ed)](_0x96067d(0x2f9)+_0xe957e4+_0x96067d(0x2dc),_0x96067d(0x2ed),_0x96067d(0x2b7),_0x96067d(0x287),_0x96067d(0x2a6));else{if(_0x2655bc==='getOne')_0x121368[_0x96067d(0x1ed)](_0x96067d(0x2f9)+_0xe957e4+_0x96067d(0x235));else{if(_0x2655bc===_0x96067d(0x2e0))_0x121368[_0x96067d(0x1ed)](_0x96067d(0x2f9)+_0xe957e4+_0x96067d(0x23c));else{if(_0x2655bc===_0x96067d(0x2b3))_0x121368[_0x96067d(0x1ed)](_0x96067d(0x2f9)+_0xe957e4+_0x96067d(0x272));else _0x2655bc===_0x96067d(0x2b4)||_0x2655bc===_0x96067d(0x229)?_0x121368[_0x96067d(0x1ed)](_0x96067d(0x2f9)+_0xe957e4+_0x96067d(0x2f7)):_0x121368['push'](_0x96067d(0x2f9)+_0xe957e4+'.'+_0x2655bc+_0x96067d(0x228));}}}return _0x121368[_0x96067d(0x1dd)]('\x0a');}export function generateSqlCodeTemplate(_0x3e7af3,_0xa9e528){const _0xf48dce=a219_0x5c1b3d,_0xbaece9=_0xa9e528?.[_0xf48dce(0x1e0)]??_0xf48dce(0x2cb),_0x4e565b=_0xa9e528?.[_0xf48dce(0x2f2)]??!![],_0x536465=[];return _0x536465['push'](_0xf48dce(0x28e)+_0x3e7af3['sqlName']+'\x20('+_0x3e7af3['sqlCode']+')'),_0xbaece9==='sdk'?(_0x4e565b&&_0x536465['push'](_0xf48dce(0x1f5),'','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});',''),_0x536465[_0xf48dce(0x1ed)](_0xf48dce(0x1cf),_0xf48dce(0x221)+_0x3e7af3[_0xf48dce(0x1ff)]+'\x27,',_0xf48dce(0x257),_0xf48dce(0x2a6),_0xf48dce(0x22c),'const\x20results\x20=\x20data.execResult\x20||\x20[];')):_0x536465[_0xf48dce(0x1ed)](_0xf48dce(0x239),'export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{',_0xf48dce(0x2d1),'\x20\x20\x20\x20sqlCode:\x20\x27'+_0x3e7af3[_0xf48dce(0x1ff)]+'\x27,',_0xf48dce(0x2e5),_0xf48dce(0x20b),_0xf48dce(0x233),'}'),_0x536465[_0xf48dce(0x1dd)]('\x0a');}export async function getErConfig(_0x38aea2,_0x5ad992){const _0x1f90e7=a219_0x5c1b3d,_0x2908e0=await apiRequest('/smartapi/question/er-config',{'method':'POST','body':{'appCode':_0x38aea2,'dblinkId':_0x5ad992},'timeout':ER_CONFIG_REQUEST_TIMEOUT_MS});return _0x2908e0[_0x1f90e7(0x297)];}export async function getErRelationDetail(_0x450cf4,_0x52aaaa){const _0xd85c82=a219_0x5c1b3d,_0x4c4f37=new URLSearchParams({'appCode':_0x450cf4,'relationId':String(_0x52aaaa)});try{const _0xec2ccd=await apiRequest(_0xd85c82(0x238)+_0x4c4f37[_0xd85c82(0x1e6)]());return _0xec2ccd[_0xd85c82(0x297)]?.[_0xd85c82(0x1ea)]??null;}catch(_0x5774f0){if(_0x5774f0 instanceof CliError&&_0x5774f0[_0xd85c82(0x260)]===_0xd85c82(0x294)&&(_0x5774f0[_0xd85c82(0x23f)]?.[_0xd85c82(0x2c0)](_0xd85c82(0x2f8))||_0x5774f0[_0xd85c82(0x23f)]===_0xd85c82(0x269)&&_0x5774f0[_0xd85c82(0x25f)]==='ER\x20relation\x20does\x20not\x20exist'))return null;throw _0x5774f0;}}export async function createErRelation(_0x565e86){const _0x27c33f=a219_0x5c1b3d,_0x460a21=await apiRequest(_0x27c33f(0x29e),{'method':'POST','body':_0x565e86,'allowNonJsonSuccess':!![]});return _0x460a21[_0x27c33f(0x297)];}export async function updateErRelation(_0x213587){const _0x7021fc=a219_0x5c1b3d,_0x4886b6=await apiRequest(_0x7021fc(0x2e1),{'method':_0x7021fc(0x290),'body':_0x213587,'allowNonJsonSuccess':!![]});return _0x4886b6['data'];}export async function deleteErRelation(_0x369fde){const _0x13a9ac=a219_0x5c1b3d,_0x57f1f6=await apiRequest(_0x13a9ac(0x1d9),{'method':_0x13a9ac(0x290),'body':_0x369fde,'allowNonJsonSuccess':!![]});return _0x57f1f6[_0x13a9ac(0x297)];}export async function updateErBusinessGroup(_0x2ada3c){const _0x39cfab=a219_0x5c1b3d,_0x1ed352=await apiRequest(_0x39cfab(0x231),{'method':_0x39cfab(0x290),'body':_0x2ada3c,'allowNonJsonSuccess':!![]});return _0x1ed352[_0x39cfab(0x297)];}export async function getErBusinessGroupSummary(_0x58c4a6,_0x5d830c){const _0x250179=a219_0x5c1b3d,_0x2d13ca=await apiRequest(_0x250179(0x1e2),{'method':_0x250179(0x290),'body':{'appCode':_0x58c4a6,'dblinkId':_0x5d830c}});return _0x2d13ca[_0x250179(0x297)];}function buildQuery(_0x267b33){const _0x86b789=a219_0x5c1b3d,_0xb34baa=new URLSearchParams();for(const [_0x3fb37b,_0x35a7d1]of Object[_0x86b789(0x2d2)](_0x267b33)){if(_0x35a7d1===undefined||_0x35a7d1==='')continue;_0xb34baa[_0x86b789(0x2c5)](_0x3fb37b,String(_0x35a7d1));}const _0x48fe32=_0xb34baa[_0x86b789(0x1e6)]();return _0x48fe32?'?'+_0x48fe32:'';}export async function listNotificationChannelConfigs(_0x15f19c,_0x5c409c){const _0x1371f9=a219_0x5c1b3d,_0xc0fa3c=await apiRequest(_0x1371f9(0x2d6)+buildQuery({'appCode':_0x15f19c,'channelType':_0x5c409c}));if(!Array['isArray'](_0xc0fa3c[_0x1371f9(0x297)]))throw CliErrors[_0x1371f9(0x22e)](_0x1371f9(0x25c),_0x1371f9(0x22f));return _0xc0fa3c[_0x1371f9(0x297)];}export async function getNotificationChannelConfig(_0x355836,_0x1e45c4){const _0x34197c=a219_0x5c1b3d,_0x2ab569=await apiRequest(_0x34197c(0x2f0)+_0x355836+buildQuery({'appCode':_0x1e45c4}));return _0x2ab569['data'];}export async function createNotificationChannelConfig(_0x3a268d){const _0x4db0ba=a219_0x5c1b3d,_0x524074=await apiRequest(_0x4db0ba(0x277),{'method':'POST','body':_0x3a268d,'indeterminateMutation':!![]});return _0x524074[_0x4db0ba(0x297)];}export async function updateNotificationChannelConfig(_0x259afb){const _0x54838b=a219_0x5c1b3d;await apiRequest('/notification/channel-config/update',{'method':_0x54838b(0x290),'body':_0x259afb,'indeterminateMutation':!![]});}export async function deleteNotificationChannelConfig(_0x1ddad2,_0x4dafef){const _0x1b826e=a219_0x5c1b3d;await apiRequest(_0x1b826e(0x1f8),{'method':_0x1b826e(0x290),'body':{'id':_0x1ddad2,'appCode':_0x4dafef},'indeterminateMutation':!![]});}export async function listAppConfigs(_0x596747,_0x3ccfc9){const _0x55908c=a219_0x5c1b3d,_0x4e1e74=await apiRequest(_0x55908c(0x278),{'method':'POST','body':{'appCode':_0x596747,..._0x3ccfc9?.['key']?{'key':_0x3ccfc9[_0x55908c(0x249)]}:{},..._0x3ccfc9?.[_0x55908c(0x2b1)]?{'tags':_0x3ccfc9['tags']}:{}}});return extractAppConfigList(_0x4e1e74[_0x55908c(0x297)]);}export async function getAppConfigByKey(_0x554d55,_0x445f28){const _0x1738ba=a219_0x5c1b3d,_0x1a1cc2=await apiRequest(_0x1738ba(0x22a)+buildQuery({'appCode':_0x554d55,'key':_0x445f28}));return _0x1a1cc2['data']??null;}export async function createAppConfig(_0xd7f249){const _0x217c93=a219_0x5c1b3d,_0x4faeff=await apiRequest('/smartapi/app-config/create',{'method':_0x217c93(0x290),'body':{'appCode':_0xd7f249[_0x217c93(0x23a)],'key':_0xd7f249[_0x217c93(0x249)],'value':_0xd7f249[_0x217c93(0x283)],..._0xd7f249[_0x217c93(0x2b1)]?{'tags':_0xd7f249[_0x217c93(0x2b1)]}:{}}});return _0x4faeff[_0x217c93(0x297)];}export async function updateAppConfig(_0xb70d62){const _0x3712f4=a219_0x5c1b3d;await apiRequest(_0x3712f4(0x2c1),{'method':_0x3712f4(0x290),'body':{'id':_0xb70d62['id'],'appCode':_0xb70d62[_0x3712f4(0x23a)],'key':_0xb70d62[_0x3712f4(0x249)],'value':_0xb70d62[_0x3712f4(0x283)],..._0xb70d62[_0x3712f4(0x2b1)]?{'tags':_0xb70d62[_0x3712f4(0x2b1)]}:{}}});}export async function deleteAppConfig(_0x95aac2){const _0x176e38=a219_0x5c1b3d;await apiRequest('/smartapi/app-config/delete',{'method':_0x176e38(0x290),'body':_0x95aac2});}function extractAppConfigList(_0x442ad9){const _0x1775ae=a219_0x5c1b3d;if(Array[_0x1775ae(0x2eb)](_0x442ad9))return _0x442ad9;if(_0x442ad9&&typeof _0x442ad9==='object'&&Array['isArray'](_0x442ad9[_0x1775ae(0x230)]))return _0x442ad9[_0x1775ae(0x230)];return extractList(_0x442ad9);}export async function listDbLinks(_0x9a339,_0x509ba0){const _0x3a968a=a219_0x5c1b3d,_0x27d4a3=await apiRequest(_0x3a968a(0x2d3),{'method':_0x3a968a(0x290),'body':{'appCode':_0x9a339,'currentPage':_0x509ba0?.['currentPage']??0x1,'pageSize':_0x509ba0?.[_0x3a968a(0x29a)]??0x64}});return{'items':extractList(_0x27d4a3[_0x3a968a(0x297)]),'paging':extractPaging(_0x27d4a3[_0x3a968a(0x297)])};}export async function getDbLinkInfo(_0x39ce60){const _0x5a1889=a219_0x5c1b3d,_0x29c7bd=await apiRequest('/smartapi/dblink/getOne'+buildQuery({'id':_0x39ce60}));return _0x29c7bd[_0x5a1889(0x297)];}export async function createDbLink(_0x1442ed){const _0x4deab3=a219_0x5c1b3d,_0x2696b3=await apiRequest(_0x4deab3(0x2ae),{'method':_0x4deab3(0x290),'body':_0x1442ed});return _0x2696b3[_0x4deab3(0x297)];}export async function updateDbLink(_0x150cf2){const _0xd24545=a219_0x5c1b3d,_0x57d482=await apiRequest('/smartapi/dblink/update',{'method':'POST','body':_0x150cf2});return _0x57d482[_0xd24545(0x297)];}export async function deleteDbLink(_0x2f901a){const _0x5323a7=a219_0x5c1b3d;await apiRequest(_0x5323a7(0x2b5),{'method':_0x5323a7(0x290),'body':{'id':_0x2f901a}});}export async function testDbLinkConnect(_0x568b0e){const _0x29b425=a219_0x5c1b3d,_0x4a223a=await apiRequest(_0x29b425(0x209)+buildQuery({'id':_0x568b0e}));return _0x4a223a['data'];}export async function testDbLinkConfigConnect(_0x2e553a){const _0x4d481e=await apiRequest('/smartapi/dblink/connect',{'method':'POST','body':_0x2e553a});return _0x4d481e['data'];}export async function startDbAnalysis(_0x899cbd,_0x5e90d6){const _0x5e361b=a219_0x5c1b3d,_0x523a63=await apiRequest(_0x5e361b(0x273),{'method':'POST','body':{'dbLinkId':_0x899cbd,..._0x5e90d6&&_0x5e90d6[_0x5e361b(0x26a)]>0x0?{'tableNames':_0x5e90d6}:{}}});return _0x523a63['data'];}export async function cancelDbAnalysis(_0x376068){const _0x3b7307=a219_0x5c1b3d;await apiRequest(_0x3b7307(0x1ec)+buildQuery({'planId':_0x376068}),{'method':_0x3b7307(0x290)});}export async function getDbAnalysisStatus(_0xd409b8){const _0x498879=a219_0x5c1b3d,_0x22d366=await apiRequest(_0x498879(0x289)+encodeURIComponent(_0xd409b8));return _0x22d366[_0x498879(0x297)];}export async function getDbAllTableList(_0x534f12,_0x1d908d){const _0x3324ca=a219_0x5c1b3d,_0x4e7ea6=await apiRequest(_0x3324ca(0x20f)+buildQuery({'appCode':_0x534f12,'dbLinkId':_0x1d908d})),_0x402168=_0x4e7ea6[_0x3324ca(0x297)];if(Array[_0x3324ca(0x2eb)](_0x402168))return _0x402168;return extractList(_0x402168);}export async function getDbTableDiff(_0x5e4cd6,_0x5cae46,_0x3b3e2c){const _0x3d9249=a219_0x5c1b3d,_0x486170=await apiRequest(_0x3d9249(0x246)+buildQuery({'appCode':_0x5e4cd6,'dbLinkId':_0x5cae46,'pageIndex':_0x3b3e2c?.[_0x3d9249(0x21b)]??0x1,'pageSize':_0x3b3e2c?.[_0x3d9249(0x29a)]??0x14,'tableName':_0x3b3e2c?.[_0x3d9249(0x296)]})),_0x9aafbe=_0x486170[_0x3d9249(0x297)];return{'totalCount':_0x9aafbe?.[_0x3d9249(0x225)]??0x0,...typeof _0x9aafbe?.[_0x3d9249(0x1ef)]===_0x3d9249(0x21a)?{'physicalTableCount':_0x9aafbe['physicalTableCount']}:{},...typeof _0x9aafbe?.[_0x3d9249(0x29b)]===_0x3d9249(0x21a)?{'datasetTableCount':_0x9aafbe[_0x3d9249(0x29b)]}:{},..._0x9aafbe?.['summary']?{'summary':_0x9aafbe['summary']}:{},'tableList':Array[_0x3d9249(0x2eb)](_0x9aafbe?.[_0x3d9249(0x24a)])?_0x9aafbe[_0x3d9249(0x24a)]:[]};}export async function getDbLiveTableDiff(_0x136269,_0x11bc17,_0xf41ca1){const _0xabf36b=a219_0x5c1b3d,_0x1f1961=await apiRequest(_0xabf36b(0x240)+buildQuery({'appCode':_0x136269,'dbLinkId':_0x11bc17,'pageIndex':_0xf41ca1?.[_0xabf36b(0x21b)]??0x1,'pageSize':_0xf41ca1?.[_0xabf36b(0x29a)]??0x14,'tableName':_0xf41ca1?.[_0xabf36b(0x296)]})),_0x3d7756=_0x1f1961[_0xabf36b(0x297)];return{'totalCount':_0x3d7756?.[_0xabf36b(0x225)]??0x0,...typeof _0x3d7756?.[_0xabf36b(0x1ef)]===_0xabf36b(0x21a)?{'physicalTableCount':_0x3d7756[_0xabf36b(0x1ef)]}:{},...typeof _0x3d7756?.[_0xabf36b(0x29b)]===_0xabf36b(0x21a)?{'datasetTableCount':_0x3d7756[_0xabf36b(0x29b)]}:{},..._0x3d7756?.[_0xabf36b(0x24c)]?{'summary':_0x3d7756[_0xabf36b(0x24c)]}:{},'tableList':Array[_0xabf36b(0x2eb)](_0x3d7756?.['tableList'])?_0x3d7756[_0xabf36b(0x24a)]:[]};}export async function startDbTableDiffRefresh(_0x33df91,_0x23e51b){const _0xb3e488=a219_0x5c1b3d,_0x3f3fac=await apiRequest(_0xb3e488(0x255)+buildQuery({'appCode':_0x33df91,'dbLinkId':_0x23e51b}),{'method':_0xb3e488(0x290)});return _0x3f3fac[_0xb3e488(0x297)];}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x1b2e3a=a219_0x5c1b3d,_0x4442c0=await apiRequest(_0x1b2e3a(0x270),{'method':_0x1b2e3a(0x290),'body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0xd49876=extractList(_0x4442c0[_0x1b2e3a(0x297)]),_0x1752f7=extractPaging(_0x4442c0['data']);return _0x1752f7&&_0x1752f7[_0x1b2e3a(0x225)]>REMOTE_APP_PAGE_SIZE&&console[_0x1b2e3a(0x215)](_0x1b2e3a(0x1e1)+REMOTE_APP_PAGE_SIZE+_0x1b2e3a(0x2e2)+_0x1752f7[_0x1b2e3a(0x225)]+_0x1b2e3a(0x1df)+_0x1b2e3a(0x2e3)),_0xd49876;}const APP_ROLE_PAGE_SIZE_MAX=0x64;export async function listAppRoles(_0x247e83,_0x206858){const _0xadc548=a219_0x5c1b3d,_0x564ea8=Math[_0xadc548(0x268)](Math['max'](_0x206858?.[_0xadc548(0x29a)]??APP_ROLE_PAGE_SIZE_MAX,0x1),APP_ROLE_PAGE_SIZE_MAX),_0x4dc348=await apiRequest(_0xadc548(0x2d7),{'method':'POST','body':{'appCode':_0x247e83,'currentPage':_0x206858?.[_0xadc548(0x20e)]??0x1,'pageSize':_0x564ea8}});return{'items':extractList(_0x4dc348[_0xadc548(0x297)]),'paging':extractPaging(_0x4dc348[_0xadc548(0x297)])};}export async function updateAppRole(_0x4644b1){const _0x45f759=a219_0x5c1b3d,_0x15efd9=await apiRequest('/smartapi/permit/role/update',{'method':'POST','body':{'id':_0x4644b1['id'],'appCode':_0x4644b1[_0x45f759(0x23a)],..._0x4644b1[_0x45f759(0x28b)]!==undefined?{'roleName':_0x4644b1[_0x45f759(0x28b)]}:{},..._0x4644b1['remark']!==undefined?{'remark':_0x4644b1[_0x45f759(0x1fc)]}:{}}});return _0x15efd9[_0x45f759(0x297)];}export async function deleteAppRole(_0x2c2d5c){const _0x3705f4=a219_0x5c1b3d;await apiRequest(_0x3705f4(0x1eb),{'method':_0x3705f4(0x290),'body':{'id':_0x2c2d5c}});}export async function listRoleUsers(_0x3b908f){const _0x2dcf4f=a219_0x5c1b3d,_0xf9a2fb=await apiRequest(_0x2dcf4f(0x276),{'method':'POST','body':{'appCode':_0x3b908f}});return extractList(_0xf9a2fb[_0x2dcf4f(0x297)])[_0x2dcf4f(0x298)](({id:_0x4c71e8,userList:_0x38b63a,applyUserList:_0x2cab99,..._0x5279e2})=>({..._0x5279e2,'id':Number(_0x4c71e8),'userList':_0x38b63a[_0x2dcf4f(0x298)](_0x41fc27=>({..._0x41fc27,'userId':Number(_0x41fc27['userId'])})),..._0x2cab99?{'applyUserList':_0x2cab99['map'](_0x1c5d68=>({..._0x1c5d68,'userId':Number(_0x1c5d68[_0x2dcf4f(0x27c)])}))}:{}}));}export async function listDevUserRoleRelations(_0x546e08,_0x2fc5ba){const _0x5995ef=a219_0x5c1b3d,_0x3a0b5e=Math[_0x5995ef(0x268)](Math[_0x5995ef(0x1f3)](_0x2fc5ba?.['pageSize']??0x64,0x1),0x64),_0xb8209c=await apiRequest('/smartapi/permit/user-role/get-list',{'method':'POST','body':{'appCode':_0x546e08,..._0x2fc5ba?.[_0x5995ef(0x27c)]!==undefined?{'userId':_0x2fc5ba['userId']}:{},..._0x2fc5ba?.[_0x5995ef(0x2e9)]!==undefined?{'roleId':_0x2fc5ba['roleId']}:{},..._0x2fc5ba?.[_0x5995ef(0x1fd)]!==undefined?{'roleType':_0x2fc5ba['roleType']}:{},'currentPage':_0x2fc5ba?.[_0x5995ef(0x20e)]??0x1,'pageSize':_0x3a0b5e}}),_0x14a689=extractList(_0xb8209c[_0x5995ef(0x297)])[_0x5995ef(0x298)](_0x91bc46=>({..._0x91bc46,'id':Number(_0x91bc46['id']),'userId':Number(_0x91bc46[_0x5995ef(0x27c)]),'roleId':Number(_0x91bc46[_0x5995ef(0x2e9)])}));return{'items':_0x14a689,'paging':extractPaging(_0xb8209c[_0x5995ef(0x297)])};}export async function createDevUserRole(_0x1584c9){const _0x42c22b=a219_0x5c1b3d,_0x47a6dd=await apiRequest(_0x42c22b(0x226),{'method':_0x42c22b(0x290),'body':_0x1584c9});return{..._0x47a6dd['data'],'id':Number(_0x47a6dd[_0x42c22b(0x297)]['id']),'userId':Number(_0x47a6dd[_0x42c22b(0x297)][_0x42c22b(0x27c)]),'roleId':Number(_0x47a6dd[_0x42c22b(0x297)][_0x42c22b(0x2e9)])};}export async function deleteDevUserRole(_0x4c8001){const _0x3e8d31=a219_0x5c1b3d,_0x330fa8=await apiRequest('/smartapi/permit/user-role/delete',{'method':'POST','body':{'id':_0x4c8001}});return _0x330fa8[_0x3e8d31(0x297)];}export async function listCurrentUserTenantMemberships(){const _0xaee91=a219_0x5c1b3d,_0x3c0b81=await apiRequest(_0xaee91(0x1f1));return extractList(_0x3c0b81['data']);}export async function listTenantDirectoryMembers(_0x29b587){const _0x58d3e4=a219_0x5c1b3d,_0x1ffe36=await apiRequest('/userTenant/getByTenantCode'+buildQuery({'code':_0x29b587})),_0x10d636=_0x1ffe36[_0x58d3e4(0x297)]?.[_0x58d3e4(0x245)];return Array[_0x58d3e4(0x2eb)](_0x10d636)?_0x10d636:[];}export async function getTenantMembers(_0xed7115){const _0x149458=a219_0x5c1b3d,_0x1eb653=await listTenantDirectoryMembers(_0xed7115);return _0x1eb653[_0x149458(0x1f0)](_0x5eb812=>_0x5eb812['status']===_0x149458(0x265)||_0x5eb812[_0x149458(0x286)]===undefined)[_0x149458(0x298)](_0x357314=>({'userId':Number(_0x357314[_0x149458(0x27c)]??_0x357314['id']),'username':_0x357314['username'],'nickname':_0x357314['nickname'],'status':_0x357314[_0x149458(0x286)],'email':_0x357314[_0x149458(0x28f)],'mobile':_0x357314['mobile'],'avatar':_0x357314['avatar']}))[_0x149458(0x1f0)](_0x4b2534=>Number[_0x149458(0x2cc)](_0x4b2534[_0x149458(0x27c)])&&_0x4b2534[_0x149458(0x27c)]>0x0);}
|
package/lib/core/bff/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a220_0x9b58fc=a220_0x5592;(function(_0xaa3a3d,_0x2cf2ec){const _0x5d660a=a220_0x5592,_0x5d34c1=_0xaa3a3d();while(!![]){try{const _0x1d9293=-parseInt(_0x5d660a(0x16f))/0x1*(-parseInt(_0x5d660a(0x172))/0x2)+parseInt(_0x5d660a(0x17c))/0x3+parseInt(_0x5d660a(0x16d))/0x4*(-parseInt(_0x5d660a(0x171))/0x5)+parseInt(_0x5d660a(0x173))/0x6*(parseInt(_0x5d660a(0x178))/0x7)+parseInt(_0x5d660a(0x17b))/0x8*(-parseInt(_0x5d660a(0x177))/0x9)+parseInt(_0x5d660a(0x176))/0xa*(-parseInt(_0x5d660a(0x170))/0xb)+-parseInt(_0x5d660a(0x175))/0xc*(-parseInt(_0x5d660a(0x174))/0xd);if(_0x1d9293===_0x2cf2ec)break;else _0x5d34c1['push'](_0x5d34c1['shift']());}catch(_0x427cb7){_0x5d34c1['push'](_0x5d34c1['shift']());}}}(a220_0x5958,0x527cc));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a220_0x9b58fc(0x17a),LOCK_FILE_NAME=a220_0x9b58fc(0x16e),TRASH_DIR_NAME='bff-trash';function a220_0x5958(){const _0x1fb5fc=['1840mQmlJu','1359PhJclG','14LRqQdn','bff','.rabetbase','20928GtnUKe','240351Rwhksy','/bff','579512hzldIQ','bff.lock.json','4XfyUqa','38302kaTgZi','5FiBaGP','63548hvlEJN','1748718zeEqmX','185653bQJhkD','612aLwCCp'];a220_0x5958=function(){return _0x1fb5fc;};return a220_0x5958();}function a220_0x5592(_0x1844b5,_0x3e1a8f){_0x1844b5=_0x1844b5-0x16d;const _0x595887=a220_0x5958();let _0x5592e2=_0x595887[_0x1844b5];return _0x5592e2;}export function loadBffProjectConfig(_0x1a38fd,_0x19ded8){const _0xe69ccb=a220_0x9b58fc,_0x2a8f77=resolve(_0x19ded8??findProjectRootDirectory()),_0x4cbc37=DOT_DIR+_0xe69ccb(0x17d),_0x516b1b=_0x4cbc37+'/'+_0x1a38fd;return{'projectRoot':_0x2a8f77,'appCode':_0x1a38fd,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x4cbc37,'scriptsRoot':_0x516b1b,'scriptsRootDir':resolve(_0x2a8f77,DOT_DIR,_0xe69ccb(0x179),_0x1a38fd),'lockFilePath':resolve(_0x2a8f77,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x2a8f77,DOT_DIR,TRASH_DIR_NAME)};}
|
|
@@ -10,6 +10,7 @@ import type { BffLockEntry, BffProjectConfig, BffScriptType, HookLocation, Local
|
|
|
10
10
|
export declare const SUPPORTED_BFF_TYPES: BffScriptType[];
|
|
11
11
|
export declare function normalizeBffType(rawType?: string): BffScriptType | undefined;
|
|
12
12
|
export declare function scanLocalBffFunctions(config: BffProjectConfig, filterType?: BffScriptType): Promise<LocalBffFunction[]>;
|
|
13
|
+
export declare function isSafeLockKeySegment(segment: string): boolean;
|
|
13
14
|
export declare function resolveLocalFilePathFromLockKey(config: BffProjectConfig, lockKey: string): string;
|
|
14
15
|
/**
|
|
15
16
|
* Build a map from remote script ID to its HOOK location using statistics data.
|