@lovrabet/rabetbase-cli 2.4.4 → 2.4.5
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_0x1f8ad5=a219_0x2e18;(function(_0xf519ec,_0xa84748){const _0x90a198=a219_0x2e18,_0x67e0ca=_0xf519ec();while(!![]){try{const _0x1515b6=-parseInt(_0x90a198(0x2b7))/0x1+-parseInt(_0x90a198(0x293))/0x2+-parseInt(_0x90a198(0x1be))/0x3+parseInt(_0x90a198(0x1f4))/0x4+-parseInt(_0x90a198(0x22d))/0x5*(-parseInt(_0x90a198(0x1fa))/0x6)+parseInt(_0x90a198(0x1df))/0x7*(-parseInt(_0x90a198(0x292))/0x8)+parseInt(_0x90a198(0x2a4))/0x9;if(_0x1515b6===_0xa84748)break;else _0x67e0ca['push'](_0x67e0ca['shift']());}catch(_0x2c3c93){_0x67e0ca['push'](_0x67e0ca['shift']());}}}(a219_0x2d03,0x60ce4));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(_0x273950){_activeCookie=_0x273950||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(a219_0x1f8ad5(0x277)),PLATFORM_ERROR_CODE=Symbol(a219_0x1f8ad5(0x1ef));export function isPlatformTransportFailure(_0x4b1f3d){const _0x4c16b8=a219_0x1f8ad5;return Boolean(_0x4b1f3d&&typeof _0x4b1f3d===_0x4c16b8(0x210)&&_0x4b1f3d[PLATFORM_TRANSPORT_FAILURE]===!![]);}export function getPlatformErrorCode(_0x29896b){const _0x49fbf8=a219_0x1f8ad5;if(!_0x29896b||typeof _0x29896b!==_0x49fbf8(0x210))return undefined;const _0x26293b=_0x29896b[PLATFORM_ERROR_CODE];return typeof _0x26293b===_0x49fbf8(0x2a9)&&_0x26293b?_0x26293b:undefined;}function createPlatformApiError(_0x247383,_0x39343e){const _0x368144=a219_0x1f8ad5,_0x52eb24=typeof _0x39343e===_0x368144(0x2a9)?_0x39343e[_0x368144(0x280)]():typeof _0x39343e===_0x368144(0x289)?String(_0x39343e):'',_0xc41024=CliErrors['apiError'](_0x247383,_0x52eb24?_0x368144(0x1e5)+_0x52eb24:undefined);return _0x52eb24&&(Object[_0x368144(0x2b5)](_0xc41024,PLATFORM_ERROR_CODE,{'value':_0x52eb24}),Object[_0x368144(0x2b5)](_0xc41024,_0x368144(0x244),{'value':{'remoteErrorCode':_0x52eb24},'enumerable':![]})),_0xc41024;}function createFetchFailureError(_0x496fb3,_0x1aab74){const _0x5ebd2a=a219_0x1f8ad5,_0xae20e0=_0x1aab74 instanceof Error?_0x1aab74[_0x5ebd2a(0x259)]:String(_0x1aab74),_0x30fa94=CliErrors[_0x5ebd2a(0x2af)](_0x5ebd2a(0x20f)+_0x496fb3+(_0xae20e0?'\x20('+_0xae20e0+')':''),_0x5ebd2a(0x1ea));return Object[_0x5ebd2a(0x2b5)](_0x30fa94,PLATFORM_TRANSPORT_FAILURE,{'value':!![]}),_0x30fa94;}function createRequestTimeoutError(_0x13ecde,_0x33be8b){const _0x3d9b46=a219_0x1f8ad5,_0x187ef0=CliErrors[_0x3d9b46(0x2af)](_0x3d9b46(0x297)+_0x13ecde);return _0x33be8b&&Object['defineProperty'](_0x187ef0,PLATFORM_TRANSPORT_FAILURE,{'value':!![]}),_0x187ef0;}function createIndeterminateResponseError(_0x52e2bd){const _0x36be44=a219_0x1f8ad5,_0x2c341c=CliErrors[_0x36be44(0x2af)](_0x52e2bd+'\x20returned\x20an\x20invalid\x20JSON\x20response\x20envelope\x20after\x20HTTP\x20success.',_0x36be44(0x282));return Object[_0x36be44(0x2b5)](_0x2c341c,PLATFORM_TRANSPORT_FAILURE,{'value':!![]}),_0x2c341c;}async function apiRequest(_0x12c777,_0x448a1a={}){const _0x58df6c=a219_0x1f8ad5,{method:method=_0x58df6c(0x215),body:_0x46cd48,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![],allowNonJsonSuccess:allowNonJsonSuccess=![],indeterminateMutation:indeterminateMutation=![]}=_0x448a1a,_0xf3b671=useRuntime?getRuntimeDomain():getApiDomain(),_0x1e266f=_activeCookie||getCookie(),_0x19168b=''+_0xf3b671+_0x12c777,_0x637956=new AbortController(),_0x579c24=setTimeout(()=>_0x637956[_0x58df6c(0x28a)](),timeout);try{const _0xd149e=await fetch(_0x19168b,{'method':method,'headers':{'Content-Type':_0x58df6c(0x25f),'Cookie':_0x1e266f,'X-Invoke-Source':_0x58df6c(0x2a8),...headers},'body':_0x46cd48?JSON[_0x58df6c(0x2a6)](_0x46cd48):undefined,'signal':_0x637956[_0x58df6c(0x1ba)]});let _0x5cd49e;try{_0x5cd49e=await _0xd149e[_0x58df6c(0x230)]();}catch(_0x43467d){if(_0xd149e['ok']&&_0x43467d instanceof Error&&_0x43467d['name']==='AbortError')throw createRequestTimeoutError(_0x19168b,indeterminateMutation);if(_0xd149e['ok']&&indeterminateMutation)throw createIndeterminateResponseError(_0x12c777);if(_0xd149e['ok']&&allowNonJsonSuccess)return{'success':!![],'data':undefined};throw CliErrors['apiError'](_0x58df6c(0x1e9)+_0xd149e[_0x58df6c(0x1fd)]+')',_0xd149e[_0x58df6c(0x1fd)]>=0x190?'Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.':undefined);}const _0x4e0245=_0x5cd49e!==null&&typeof _0x5cd49e===_0x58df6c(0x210)&&!Array[_0x58df6c(0x208)](_0x5cd49e);if(!_0xd149e['ok']){const _0x1bb688=_0x4e0245?_0x5cd49e:undefined;throw CliErrors[_0x58df6c(0x2af)](_0x1bb688?.[_0x58df6c(0x1a0)]||_0x1bb688?.[_0x58df6c(0x259)]||_0x58df6c(0x1eb)+_0xd149e[_0x58df6c(0x1fd)],_0x1bb688?.[_0x58df6c(0x1cf)]?_0x58df6c(0x1e5)+_0x1bb688[_0x58df6c(0x1cf)]:undefined);}if(indeterminateMutation){if(!_0x4e0245)throw createIndeterminateResponseError(_0x12c777);if(_0x5cd49e[_0x58df6c(0x1e8)]===![])throw CliErrors['apiError'](_0x5cd49e[_0x58df6c(0x1a0)]||_0x5cd49e['message']||_0x58df6c(0x1eb)+_0xd149e['status'],_0x5cd49e[_0x58df6c(0x1cf)]?_0x58df6c(0x1e5)+_0x5cd49e[_0x58df6c(0x1cf)]:undefined);if(_0x5cd49e['success']!==!![])throw createIndeterminateResponseError(_0x12c777);return _0x5cd49e;}if(_0x5cd49e===null||_0x5cd49e===undefined)throw CliErrors[_0x58df6c(0x2af)]('API\x20returned\x20an\x20invalid\x20JSON\x20response\x20envelope\x20(HTTP\x20'+_0xd149e['status']+')');if(_0x5cd49e['success']===![])throw CliErrors[_0x58df6c(0x2af)](_0x5cd49e['errorMsg']||_0x5cd49e['message']||_0x58df6c(0x1eb)+_0xd149e[_0x58df6c(0x1fd)],_0x5cd49e[_0x58df6c(0x1cf)]?'API\x20error\x20code:\x20'+_0x5cd49e['errorCode']:undefined);return _0x5cd49e;}catch(_0xef172c){if(_0xef172c instanceof CliError)throw _0xef172c;if(_0xef172c instanceof Error&&_0xef172c[_0x58df6c(0x1a2)]===_0x58df6c(0x228))throw createRequestTimeoutError(_0x19168b,indeterminateMutation);throw createFetchFailureError(_0x19168b,_0xef172c);}finally{clearTimeout(_0x579c24);}}async function apiFormRequest(_0xec70cc,_0x455dfd,_0x56956a={}){const _0x29ebed=a219_0x1f8ad5,{timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS}=_0x56956a,_0x59a31f=_activeCookie||getCookie(),_0x5d669a=''+getApiDomain()+_0xec70cc,_0x4df1ce=new AbortController(),_0x32689b=setTimeout(()=>_0x4df1ce[_0x29ebed(0x28a)](),timeout);try{const _0x32eaad=await fetch(_0x5d669a,{'method':_0x29ebed(0x21f),'headers':{'Cookie':_0x59a31f,'X-Invoke-Source':_0x29ebed(0x2a8)},'body':_0x455dfd,'signal':_0x4df1ce['signal']});let _0x1f691a;try{_0x1f691a=await _0x32eaad['json']();}catch(_0x16242e){if(_0x16242e instanceof Error&&_0x16242e[_0x29ebed(0x1a2)]==='AbortError')throw CliErrors[_0x29ebed(0x2af)](_0x29ebed(0x297)+_0x5d669a);throw CliErrors[_0x29ebed(0x2af)](_0x29ebed(0x1e9)+_0x32eaad[_0x29ebed(0x1fd)]+')',_0x32eaad[_0x29ebed(0x1fd)]>=0x190?_0x29ebed(0x226):undefined);}if(!_0x32eaad['ok']||_0x1f691a[_0x29ebed(0x1e8)]===![])throw CliErrors[_0x29ebed(0x2af)](_0x1f691a[_0x29ebed(0x1a0)]||_0x1f691a[_0x29ebed(0x259)]||'API\x20error:\x20'+_0x32eaad[_0x29ebed(0x1fd)],_0x1f691a['errorCode']?_0x29ebed(0x1e5)+_0x1f691a[_0x29ebed(0x1cf)]:undefined);return _0x1f691a;}catch(_0x43549f){if(_0x43549f instanceof CliError)throw _0x43549f;if(_0x43549f instanceof Error&&_0x43549f[_0x29ebed(0x1a2)]===_0x29ebed(0x228))throw CliErrors['apiError'](_0x29ebed(0x297)+_0x5d669a);throw createFetchFailureError(_0x5d669a,_0x43549f);}finally{clearTimeout(_0x32689b);}}export async function uploadDevelopmentFile(_0x37ae21,_0x540924){const _0x5624fb=a219_0x1f8ad5,_0x3f993a=await readFile(_0x540924),_0x6d6892=new FormData();_0x6d6892[_0x5624fb(0x246)](_0x5624fb(0x1dd),_0x37ae21),_0x6d6892['append'](_0x5624fb(0x2b4),new Blob([new Uint8Array(_0x3f993a)]),basename(_0x540924));const _0x374cd0=await apiFormRequest(_0x5624fb(0x278),_0x6d6892);return _0x374cd0[_0x5624fb(0x244)];}export async function queryDevelopmentFileUrl(_0xe2dc9d,_0x254cba={}){const _0x231c61=a219_0x1f8ad5,_0x16b7f2=await apiRequest(_0x231c61(0x221),{'method':'POST','body':{'filePath':_0xe2dc9d,'downloadFlag':_0x254cba[_0x231c61(0x1b3)]??![],..._0x254cba[_0x231c61(0x233)]?{'longTerm':!![]}:{}}});return _0x16b7f2[_0x231c61(0x244)];}export async function recognizeDevelopmentOcr(_0x5d4050,_0x9e231a){const _0x2a96ce=a219_0x1f8ad5,_0x5b1205=new URLSearchParams({'url':_0x9e231a[_0x2a96ce(0x271)],'type':_0x9e231a[_0x2a96ce(0x1cc)],'appCode':_0x5d4050}),_0x47b995=await apiRequest(_0x2a96ce(0x24d)+_0x5b1205[_0x2a96ce(0x1e6)](),{'method':_0x2a96ce(0x215)});return _0x47b995[_0x2a96ce(0x244)];}export const DING_TALK_SANDBOX_BIND_PATH=a219_0x1f8ad5(0x1e3);export async function bindDingTalkSandboxAccount(_0x2d013d){const _0x2585b7=a219_0x1f8ad5,_0x12670d=await apiRequest(DING_TALK_SANDBOX_BIND_PATH,{'method':_0x2585b7(0x21f),'body':{'dingTalkUserId':_0x2d013d}});return _0x12670d['data'];}function isAuthFailure(_0x6aae85){const _0x5d40f6=a219_0x1f8ad5,_0x5c0c98=_0x6aae85['errorMsg']||_0x6aae85[_0x5d40f6(0x259)]||_0x6aae85['data']?.['message']||_0x6aae85[_0x5d40f6(0x203)]||_0x6aae85[_0x5d40f6(0x262)]||'';return _0x6aae85['errorCode']===_0x5d40f6(0x243)||_0x6aae85['code']===0x191||_0x6aae85[_0x5d40f6(0x268)]===_0x5d40f6(0x239)||_0x5c0c98[_0x5d40f6(0x272)](_0x5d40f6(0x239))||_0x5c0c98[_0x5d40f6(0x272)](_0x5d40f6(0x1e7))||_0x5c0c98[_0x5d40f6(0x272)]('登录')||_0x5c0c98[_0x5d40f6(0x272)]('认证');}export async function platformFetch(_0x47ac27,_0x18d8dc){const _0x1b3e15=a219_0x1f8ad5;let _0x2c157e;try{_0x2c157e=await fetch(_0x47ac27,{'method':_0x18d8dc['method']??_0x1b3e15(0x215),'headers':{'Content-Type':_0x1b3e15(0x25f),'Cookie':_0x18d8dc[_0x1b3e15(0x27c)],'X-Invoke-Source':_0x1b3e15(0x2a8)},..._0x18d8dc[_0x1b3e15(0x296)]&&{'body':JSON[_0x1b3e15(0x2a6)](_0x18d8dc[_0x1b3e15(0x296)])}});}catch(_0x5b763a){throw createFetchFailureError(_0x47ac27,_0x5b763a);}let _0x32aefc;try{_0x32aefc=await _0x2c157e['json']();}catch(_0x4c06cd){if(!_0x2c157e['ok']){if(_0x2c157e[_0x1b3e15(0x1fd)]===0x191)throw CliErrors['authRequired']();throw CliErrors['apiError'](_0x18d8dc[_0x1b3e15(0x1ab)]+_0x1b3e15(0x255)+_0x2c157e['status']);}throw createFetchFailureError(_0x47ac27,_0x4c06cd);}if(_0x32aefc===null||typeof _0x32aefc!==_0x1b3e15(0x210)||Array[_0x1b3e15(0x208)](_0x32aefc)){if(_0x2c157e[_0x1b3e15(0x1fd)]===0x191)throw CliErrors['authRequired']();if(_0x2c157e['ok'])throw createIndeterminateResponseError(_0x18d8dc[_0x1b3e15(0x1ab)]);throw CliErrors[_0x1b3e15(0x2af)](_0x18d8dc[_0x1b3e15(0x1ab)]+_0x1b3e15(0x218)+(!_0x2c157e['ok']?_0x1b3e15(0x284)+_0x2c157e['status']:'')+_0x1b3e15(0x1f5));}const _0x511d37=typeof _0x32aefc[_0x1b3e15(0x1cf)]===_0x1b3e15(0x2a9)||typeof _0x32aefc[_0x1b3e15(0x1cf)]==='number',_0x3a20eb=_0x511d37?String(_0x32aefc[_0x1b3e15(0x1cf)])[_0x1b3e15(0x280)]():'',_0xe97602=_0x32aefc[_0x1b3e15(0x1e8)]===![]||_0x511d37&&_0x3a20eb!=='0000';if(!_0x2c157e['ok']||_0xe97602){if(_0x2c157e['status']===0x191||isAuthFailure(_0x32aefc))throw CliErrors['authRequired']();throw createPlatformApiError(_0x32aefc['errorMsg']||_0x32aefc['message']||_0x18d8dc[_0x1b3e15(0x1ab)]+'\x20failed'+(!_0x2c157e['ok']?_0x1b3e15(0x284)+_0x2c157e[_0x1b3e15(0x1fd)]:''),_0x32aefc[_0x1b3e15(0x1cf)]??_0x32aefc[_0x1b3e15(0x268)]);}if(_0x32aefc['success']!==!![]||_0x511d37&&_0x3a20eb!==_0x1b3e15(0x1db))throw createIndeterminateResponseError(_0x18d8dc['label']);return _0x32aefc[_0x1b3e15(0x244)];}export async function platformRequest(_0x5a4b7d,_0x23953e){const _0x113792=a219_0x1f8ad5;if(/^https?:\/\//i[_0x113792(0x270)](_0x5a4b7d))throw CliErrors[_0x113792(0x241)]('platformRequest\x20expects\x20an\x20API\x20path,\x20got\x20absolute\x20URL:\x20'+_0x5a4b7d,_0x113792(0x232));const _0x4fe4f4=_0x5a4b7d[_0x113792(0x1d0)]('/')?_0x5a4b7d:'/'+_0x5a4b7d;return platformFetch(''+getApiDomain()+_0x4fe4f4,_0x23953e);}const MAX_KNOWLEDGE_BASE_PAGE_SIZE=0x64;function parseKnowledgeBaseInteger(_0x28c43e,_0x15886e){const _0x3b2945=a219_0x1f8ad5,_0x4a92b2=typeof _0x28c43e===_0x3b2945(0x289)?_0x28c43e:typeof _0x28c43e===_0x3b2945(0x2a9)&&/^(0|[1-9]\d*)$/[_0x3b2945(0x270)](_0x28c43e)?Number(_0x28c43e):Number[_0x3b2945(0x1d2)],_0x42fbf4=Number[_0x3b2945(0x229)](_0x4a92b2)&&(_0x15886e==='id'?_0x4a92b2>0x0:_0x4a92b2>=0x0);if(!_0x42fbf4)throw CliErrors[_0x3b2945(0x2af)](_0x3b2945(0x2a2)+_0x15886e+'.');return _0x4a92b2;}function a219_0x2d03(){const _0x391353=['\x20of\x20','/smartapi/app-config/create','/smartapi/recycleBin/resource/list?','pageSize','Knowledge-base\x20update\x20requires\x20title\x20or\x20content.','datasetTableCount','validation','relation','UNAUTHORIZED','data','files','append','/api/management/library/scripts/save','i18nInfo','length','value','roleType','Fetch\x20doc\x20(','/smartapi/ocr/recognize-text?','/smartapi/dblink/create','/smartapi/menu/create','/smartapi/question/er-config/cli/erCreate','scriptType','has','Page\x20not\x20found:\x20','/smartapi/dblink/getAllTableList','\x20failed,\x20HTTP\x20','fetch-model-list','ENABLE','roleName','message','\x20\x20\x20\x20sqlCode:\x20\x27','/admin/knowledge-base/get-list','/smartapi/tasks/','tableName','getOne','application/json','dbId','scriptName','error','menu','materialName','api_error','set','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','code','content','List\x20enterprise\x20knowledge\x20bases','/smartapi/menu/regroup','/smartapi/app-config/getByKey','dataset_','functionName','source','test','url','includes','\x20\x20currentPage:\x201,','Dataset\x20not\x20found:\x20','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','/smartapi/webcode/page/update/content','platform-transport-failure','/smartapi/common/uploadFile','//\x20','const\x20data\x20=\x20await\x20client.sql.execute({','tableData','cookie','/smartapi/lovrabet/dataset/','/smartapi/custom/queryUserCustomSqlList','operationName','trim','/smartapi/permit/role/get-list','The\x20server\x20outcome\x20is\x20indeterminate.\x20Verify\x20current\x20state\x20before\x20retrying\x20any\x20mutation.','company',',\x20HTTP\x20','/smartapi/dblink/getDiffTableByPage','summary','create','datasetName','number','abort','API\x20error\x20code:\x20306','SQL\x20query\x20not\x20found:\x20id=','draftVersion','/smartapi/question/er-config','list','title','/smartapi/dataset/text-generate/start','396376QCLRGW','1167792PlVMtG','modelId','/smartapi/question/er-config/business-group/edit','body','Request\x20timeout:\x20','/smartapi/db-analysis/start','operations','/smartapi/app/getList','deleted','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','add','/api/node-toolbox/sql/save','clientOperationId','/filter','createTime','Knowledge-base\x20response\x20contains\x20an\x20invalid\x20','Use\x20the\x20platform\x20console\x20to\x20see\x20all.','3879864NeLRWo','dbtableConfig','stringify','pageIndex','cli:rabetbase','string','/api/management/library/scripts/list?appCode=','totalCount','/smartapi/custom/getUserCustomSql?id=','key','remark','apiError','configArray','description','map','sdk','file','defineProperty','table','35826ViTcpn','/notification/channel-config/','/smartapi/dblink/getTableDiffV2ByPage','/smartapi/dblink/delete','requirementDescription','/api/custom/executeSql','errorMsg','hint','name','/notification/channel-config/create','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','//\x20SQL:\x20','\x20\x20pageSize:\x2020,','/smartapi/permit/user-role/delete','taskId','/smartapi/dataset/get-dataset-list','/smartapi/custom/getUserCustomSql','label','sqlCode','parentMenuId','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','Update\x20enterprise\x20knowledge\x20base','/smartapi/db-analysis/status/','/notification/channel-config/list','/notification/channel-config/update','download','/smartapi/permit/user-role/create','toLowerCase','roleId','displayName','Knowledge-base\x20response\x20is\x20missing\x20a\x20valid\x20','path','signal','});','/smartapi/lovrabet/update-page','resourceName','248616Scqxvk','/smartapi/dataset/update-driven-data','pageName','currentPage','const\x20result\x20=\x20await\x20client.models.','List\x20enterprise\x20knowledge\x20bases\x20returned\x20an\x20invalid\x20response\x20contract.','entries','requestFields','\x20\x20});','sqlName','/smartapi/app-config/update','replace','/smartapi/dblink/testConnect','Knowledge-base\x20API\x20returned\x20an\x20invalid\x20record\x20contract.','type','SQL\x20query\x20not\x20found:\x20','push','errorCode','startsWith','find','NaN','isInteger','physicalTableCount','DATA_NOT_EXIST','warn','updateTime','/smartapi/permit/role/delete','BFF\x20save\x20returned\x20no\x20valid\x20id','/api/management/library/scripts/info?id=','0000','/smartapi/lovrabet/detail?pageId=','appCode','filter','35rBmUaf','/smartapi/app/getOne','method','version','/smartapi/user-accounts/cli/dingding-sandbox/bind','/admin/knowledge-base/delete','API\x20error\x20code:\x20','toString','Unauthorized','success','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','Check\x20network\x20connectivity\x20and\x20try\x20again.','API\x20error:\x20','Expected\x20the\x20server\x20data\x20field\x20to\x20be\x20an\x20array.','/notification/channel-config/delete','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','platform-error-code','target','/api/','/userTenant/queryBelongsTenants','Fetch\x20datasets','1119368fvBRPV',':\x20invalid\x20JSON\x20response\x20envelope','/smartapi/dblink/connect','Fetch\x20menu\x20list','?sqlCode=','.getOne(id);','18LJClwl','tags','isFinite','status','personal','/smartapi/menu/delete','join','array','/admin/knowledge-base/get-one','errorMessage','/smartapi/question/er-config/cli/detail?','/api/management/library/scripts/statistics?appCode=','operationId','/smartapi/dataset/delete?cascade=','isArray','userId','modelCode','/smartapi/dblink/update','/smartapi/dataset/get-driven-data?','React\x20custom\x20page\x20not\x20found:\x20','markdown','Request\x20failed:\x20','object','/smartapi/menu/update','nickname','scope','/smartapi/question/er-config/cli/delete-single','GET','\x20\x20sqlCode:\x20\x27','/smartapi/app-config/delete','\x20failed','/smartapi/dataset/text-generate/preview','/admin/knowledge-base/create','Knowledge-base\x20response\x20contains\x20an\x20invalid\x20scope.','/admin/knowledge-base/update','/standard-page-status?appCode=','Warning:\x20showing\x20first\x20','POST','(/*\x20params\x20*/);','/smartapi/common/queryFileUrl','/generate-standard-pages/start','\x20\x20where:\x20{},','/smartapi/page/getDeletedPageList?','/smartapi/webcode/page/restore','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','/api/management/library/scripts/delete','AbortError','isSafeInteger','/smartapi/dataset/get-dataset-operation','/generate-standard-pages/status?','\x22\x20not\x20found\x20in\x20dataset\x20','1059845dSHviF','pageId','BFF\x20script\x20not\x20found:\x20id=','json','/api/management/script/cache/clear','Use\x20platformFetch\x20only\x20for\x20legacy\x20absolute-URL\x20calls.','longTerm','/smartapi/dataset/text-generate/status?','includeImports','.remove(id);','/smartapi/menu/batchDelete','tableList','401','/smartapi/dblink/table-diff/analyze/start'];a219_0x2d03=function(){return _0x391353;};return a219_0x2d03();}function parseKnowledgeBaseText(_0x5a818a,_0x439a5e){const _0x5dac5c=a219_0x1f8ad5;if(typeof _0x5a818a==='string'&&(_0x439a5e===_0x5dac5c(0x269)||_0x5a818a['trim']()))return _0x5a818a;throw CliErrors[_0x5dac5c(0x2af)](_0x5dac5c(0x1b8)+_0x439a5e+'.');}function parseKnowledgeBaseRecord(_0x533e25){const _0x46026c=a219_0x1f8ad5;if(!_0x533e25||typeof _0x533e25!==_0x46026c(0x210)||Array['isArray'](_0x533e25))throw CliErrors['apiError'](_0x46026c(0x1cb));const _0x3f2957=_0x533e25;if(_0x3f2957[_0x46026c(0x213)]!==_0x46026c(0x283)&&_0x3f2957['scope']!==_0x46026c(0x1fe))throw CliErrors['apiError'](_0x46026c(0x21b));const _0x597061={'id':parseKnowledgeBaseInteger(_0x3f2957['id'],'id'),'scope':_0x3f2957[_0x46026c(0x213)],'appCode':parseKnowledgeBaseText(_0x3f2957[_0x46026c(0x1dd)],'appCode'),'title':parseKnowledgeBaseText(_0x3f2957[_0x46026c(0x290)],_0x46026c(0x290)),'version':parseKnowledgeBaseInteger(_0x3f2957['version'],_0x46026c(0x1e2)),'content':parseKnowledgeBaseText(_0x3f2957['content'],_0x46026c(0x269))};return(_0x3f2957[_0x46026c(0x2a1)]===null||typeof _0x3f2957['createTime']===_0x46026c(0x2a9)||typeof _0x3f2957['createTime']===_0x46026c(0x289))&&(_0x597061[_0x46026c(0x2a1)]=_0x3f2957[_0x46026c(0x2a1)]),(_0x3f2957[_0x46026c(0x1d7)]===null||typeof _0x3f2957[_0x46026c(0x1d7)]===_0x46026c(0x2a9)||typeof _0x3f2957[_0x46026c(0x1d7)]===_0x46026c(0x289))&&(_0x597061['updateTime']=_0x3f2957[_0x46026c(0x1d7)]),_0x597061;}export async function listEnterpriseKnowledgeBases(_0x2f8831,_0x5ed6bd={}){const _0x4c834a=a219_0x1f8ad5,_0x281799=_0x5ed6bd[_0x4c834a(0x23e)]??0x32;if(!Number[_0x4c834a(0x229)](_0x281799)||_0x281799<0x1||_0x281799>MAX_KNOWLEDGE_BASE_PAGE_SIZE)throw CliErrors['validation']('Knowledge-base\x20pageSize\x20must\x20be\x20an\x20integer\x20between\x201\x20and\x20'+MAX_KNOWLEDGE_BASE_PAGE_SIZE+'.');const _0x14a7bc=await platformRequest(_0x4c834a(0x25b),{'method':'POST','cookie':_0x2f8831,'label':_0x4c834a(0x26a),'body':{'currentPage':_0x5ed6bd[_0x4c834a(0x1c1)]??0x1,'pageSize':_0x281799,'scope':_0x4c834a(0x283),..._0x5ed6bd['appCode']?{'appCode':_0x5ed6bd[_0x4c834a(0x1dd)]}:{},..._0x5ed6bd[_0x4c834a(0x290)]?{'title':_0x5ed6bd[_0x4c834a(0x290)]}:{}}});if(!_0x14a7bc||typeof _0x14a7bc!==_0x4c834a(0x210)||Array[_0x4c834a(0x208)](_0x14a7bc)||!Array[_0x4c834a(0x208)](_0x14a7bc[_0x4c834a(0x27b)]))throw CliErrors['apiError'](_0x4c834a(0x1c3));const _0x36efe2=extractPaging(_0x14a7bc);if(!_0x36efe2||!Number[_0x4c834a(0x1d3)](_0x36efe2[_0x4c834a(0x1c1)])||!Number['isInteger'](_0x36efe2[_0x4c834a(0x23e)])||!Number['isInteger'](_0x36efe2['totalCount'])||_0x36efe2['currentPage']<0x1||_0x36efe2[_0x4c834a(0x23e)]<0x1||_0x36efe2[_0x4c834a(0x23e)]>MAX_KNOWLEDGE_BASE_PAGE_SIZE||_0x36efe2[_0x4c834a(0x2ab)]<0x0)throw CliErrors[_0x4c834a(0x2af)]('List\x20enterprise\x20knowledge\x20bases\x20returned\x20invalid\x20paging\x20metadata.');return{'items':extractList(_0x14a7bc)[_0x4c834a(0x2b2)](parseKnowledgeBaseRecord),'paging':_0x36efe2};}export async function getEnterpriseKnowledgeBase(_0x3f26e0,_0x5e2e3e){const _0x49b582=a219_0x1f8ad5,_0x26bcb1=await platformRequest(_0x49b582(0x202)+buildQuery({'id':_0x5e2e3e}),{'cookie':_0x3f26e0,'label':'Get\x20enterprise\x20knowledge\x20base'});return parseKnowledgeBaseRecord(_0x26bcb1);}export async function createEnterpriseKnowledgeBase(_0x3c2438,_0x1f28ba){const _0x5b4e28=a219_0x1f8ad5,_0x4104c1=await platformRequest(_0x5b4e28(0x21a),{'method':'POST','cookie':_0x3c2438,'label':'Create\x20enterprise\x20knowledge\x20base','body':{'scope':_0x5b4e28(0x283),..._0x1f28ba}});return parseKnowledgeBaseRecord(_0x4104c1);}export async function updateEnterpriseKnowledgeBase(_0x561b39,_0x59bf37){const _0x34c21f=a219_0x1f8ad5;if(_0x59bf37['title']===undefined&&_0x59bf37[_0x34c21f(0x269)]===undefined)throw CliErrors[_0x34c21f(0x241)](_0x34c21f(0x23f));const _0x58c15e=await platformRequest(_0x34c21f(0x21c),{'method':_0x34c21f(0x21f),'cookie':_0x561b39,'label':_0x34c21f(0x1af),'body':{'id':_0x59bf37['id'],..._0x59bf37['title']!==undefined?{'title':_0x59bf37[_0x34c21f(0x290)]}:{},..._0x59bf37[_0x34c21f(0x269)]!==undefined?{'content':_0x59bf37['content']}:{}}});return parseKnowledgeBaseRecord(_0x58c15e);}export async function deleteEnterpriseKnowledgeBase(_0x72da44,_0x19346c){const _0x4c8dca=a219_0x1f8ad5;await platformRequest(_0x4c8dca(0x1e4),{'method':_0x4c8dca(0x21f),'cookie':_0x72da44,'label':'Delete\x20enterprise\x20knowledge\x20base','body':{'id':_0x19346c}});}function cleanNewlines(_0x25c157){const _0x482d1a=a219_0x1f8ad5;return _0x25c157[_0x482d1a(0x1c9)](/[\r\n]+/g,'\x20')[_0x482d1a(0x280)]();}function cleanDatasetName(_0x2476e7){const _0x21330d=a219_0x1f8ad5;if(!_0x2476e7[_0x21330d(0x1a2)])return _0x2476e7;return{..._0x2476e7,'name':cleanNewlines(_0x2476e7[_0x21330d(0x1a2)])};}export async function fetchModelList(_0x1b06e3,_0x1bb0b3){const _0x28f8c8=a219_0x1f8ad5,_0x22f214=getEnv(),_0x5271ad=new URLSearchParams({'appcode':_0x1b06e3,'otype':_0x28f8c8(0x201)}),_0x41a414='/api/node-toolbox/dataset/model-list?'+_0x5271ad['toString']();logger['info'](_0x28f8c8(0x256),'正在从服务器拉取模型列表...\x20(环境:\x20'+_0x22f214+')',{'apiPath':_0x41a414});const _0x441600=await platformRequest(_0x41a414,{'cookie':_0x1bb0b3,'label':_0x28f8c8(0x1f3)}),_0x3e60bb=(_0x441600[_0x28f8c8(0x2b0)]??[])[_0x28f8c8(0x2b2)](cleanDatasetName);return{'configArray':_0x3e60bb,'count':_0x3e60bb[_0x28f8c8(0x249)]};}export async function fetchDatasetDoc(_0x4fdcc1){const _0x51211a=a219_0x1f8ad5,{appCode:_0x18ca69,cookie:_0x3b7ec5,datasetCode:_0x50fd1c,datasetId:_0x1c108e,extraParams:_0x3fb0ae}=_0x4fdcc1,_0x397b73=await platformRequest('/api/node-toolbox/api-doc-generator',{'method':'POST','body':{'appCode':_0x18ca69,'datasetCode':_0x50fd1c,'datasetId':_0x1c108e,..._0x3fb0ae||{}},'cookie':_0x3b7ec5,'label':_0x51211a(0x24c)+_0x50fd1c+')'});if(!_0x397b73||typeof _0x397b73[_0x51211a(0x20e)]!=='string')throw new Error('Invalid\x20response\x20format\x20('+_0x50fd1c+'):\x20missing\x20data.markdown\x20field');return _0x397b73[_0x51211a(0x20e)];}export async function getMenuTree(_0x435896,_0x4d031e){const _0x30974d=a219_0x1f8ad5,_0x53e884=new URLSearchParams({'appCode':_0x435896});return platformRequest('/smartapi/menu/find?'+_0x53e884[_0x30974d(0x1e6)](),{'cookie':_0x4d031e,'label':_0x30974d(0x1f7)});}export async function createMenuRecord(_0x163f4f,_0x39c854,_0x576bd0){const _0x2ced84=a219_0x1f8ad5;return platformRequest(_0x2ced84(0x24f),{'method':'POST','body':_0x163f4f,'cookie':_0x39c854,'label':_0x576bd0});}export async function updateMenuRecord(_0x47fe5a,_0x53cc13,_0x574360){const _0x1a6020=a219_0x1f8ad5;return platformRequest(_0x1a6020(0x211),{'method':_0x1a6020(0x21f),'body':_0x47fe5a,'cookie':_0x53cc13,'label':_0x574360});}export async function deleteMenuRecord(_0x54dee6,_0x50bb59,_0x5047b0){const _0xfc7697=a219_0x1f8ad5;return platformRequest(_0xfc7697(0x1ff),{'method':'POST','body':{'id':_0x54dee6},'cookie':_0x50bb59,'label':_0x5047b0});}export async function batchDeleteMenuRecords(_0x452bd2,_0x5c7f01,_0x307137){const _0x1519b6=a219_0x1f8ad5;return platformRequest(_0x1519b6(0x237),{'method':_0x1519b6(0x21f),'body':{'idList':_0x452bd2},'cookie':_0x5c7f01,'label':_0x307137});}export async function startMenuRegroup(_0x962514,_0x478634,_0x1396d9){const _0x60175e=a219_0x1f8ad5;return platformRequest(_0x60175e(0x26b),{'method':'POST','body':_0x962514,'cookie':_0x478634,'label':_0x1396d9});}export async function getAsyncTaskStatus(_0x578deb,_0x9c09f1,_0x158d96){const _0x2b3d=a219_0x1f8ad5,_0x4cd3ea=new URLSearchParams({'appCode':_0x9c09f1});return platformRequest(_0x2b3d(0x25c)+encodeURIComponent(_0x578deb)+'?'+_0x4cd3ea[_0x2b3d(0x1e6)](),{'cookie':_0x158d96,'label':'Fetch\x20async\x20task\x20'+_0x578deb});}export async function listBffScripts(_0x38ebe9,_0x590893,_0x2361d2){const _0x2d7322=a219_0x1f8ad5;let _0x2b770d=_0x2d7322(0x2aa)+_0x38ebe9;if(_0x590893)_0x2b770d+='&type='+_0x590893;const _0x4abcd4=await apiRequest(_0x2b770d);let _0x2e679b=extractList(_0x4abcd4[_0x2d7322(0x244)]);if(_0x2361d2?.[_0x2d7322(0x261)]){const _0x237d0f=_0x2361d2[_0x2d7322(0x261)][_0x2d7322(0x1b5)]();_0x2e679b=_0x2e679b['filter'](_0x15b39c=>_0x15b39c[_0x2d7322(0x26e)]?.[_0x2d7322(0x1b5)]()['includes'](_0x237d0f)||_0x15b39c[_0x2d7322(0x2b1)]?.[_0x2d7322(0x1b5)]()['includes'](_0x237d0f));}return _0x2e679b;}export async function getBffScriptInfo(_0x139184){const _0x37fdb9=a219_0x1f8ad5,_0x5d6a51=await apiRequest(_0x37fdb9(0x1da)+_0x139184);if(!_0x5d6a51['data'])throw CliErrors['validation'](_0x37fdb9(0x22f)+_0x139184);return _0x5d6a51[_0x37fdb9(0x244)];}export async function saveBffScript(_0x20c760){const _0x56dc14=a219_0x1f8ad5,_0x4a713d=await apiRequest(_0x56dc14(0x247),{'method':_0x56dc14(0x21f),'body':_0x20c760}),{id:_0x3a4798,entity:_0x27bfa0}=normalizeEntityWithIdResponse(_0x4a713d[_0x56dc14(0x244)]);if(_0x3a4798!==undefined){const _0x20213d=typeof _0x27bfa0[_0x56dc14(0x26e)]===_0x56dc14(0x2a9)||typeof _0x27bfa0[_0x56dc14(0x251)]===_0x56dc14(0x2a9)?_0x27bfa0:undefined;return{'id':_0x3a4798,'script':_0x20213d};}throw CliErrors[_0x56dc14(0x2af)](_0x56dc14(0x1d9));}export async function deleteBffScript(_0x588483){const _0xaaabd4=a219_0x1f8ad5;await apiRequest(_0xaaabd4(0x227),{'method':_0xaaabd4(0x21f),'body':{'id':_0x588483}});}export async function getBffScriptStatistics(_0x254da1){const _0xd1d120=a219_0x1f8ad5,_0x215694=await apiRequest(_0xd1d120(0x205)+_0x254da1);return extractList(_0x215694[_0xd1d120(0x244)]);}export async function clearBffScriptCache(){const _0x58e7db=a219_0x1f8ad5,_0x565120=await apiRequest(_0x58e7db(0x231),{'method':_0x58e7db(0x21f),'useRuntime':!![]});return typeof _0x565120['data']===_0x58e7db(0x2a9)?_0x565120['data']:'';}export async function listBffDatasetOperations(_0xf10ac8,_0x1759b5){const _0x5172a8=a219_0x1f8ad5,_0x1618d6=await apiRequest(_0x5172a8(0x22a),{'method':_0x5172a8(0x21f),'body':{'appCode':_0xf10ac8,'datasetId':_0x1759b5}});return _0x1618d6['data'];}export async function listSqlQueries(_0x2c6c4f,_0x266310){const _0x5e7fa5=a219_0x1f8ad5,_0x1956a9=await apiRequest(_0x5e7fa5(0x27e),{'method':'POST','body':{'appCode':_0x2c6c4f,'currentPage':_0x266310?.['currentPage']??0x1,'pageSize':_0x266310?.['pageSize']??0x32,'sqlCode':_0x266310?.[_0x5e7fa5(0x1ac)],'sqlName':_0x266310?.[_0x5e7fa5(0x1c7)]}});return _0x1956a9[_0x5e7fa5(0x244)];}export async function getSqlQueryInfo(_0x3d1b7b,_0x598928){const _0x12018a=a219_0x1f8ad5,_0x5431f6=await listSqlQueries(_0x3d1b7b,{'sqlCode':_0x598928}),_0x8ed87a=_0x5431f6[_0x12018a(0x27b)]?.[0x0];if(!_0x8ed87a)throw CliErrors[_0x12018a(0x241)](_0x12018a(0x1cd)+_0x598928);return _0x8ed87a;}export async function getSqlQueryDetail(_0x16a229){const _0x187403=a219_0x1f8ad5,_0x46c92b=await apiRequest(_0x187403(0x1aa)+(_0x187403(0x1f8)+encodeURIComponent(_0x16a229)));if(!_0x46c92b[_0x187403(0x244)])throw CliErrors[_0x187403(0x241)](_0x187403(0x1cd)+_0x16a229);return _0x46c92b[_0x187403(0x244)];}export async function getSqlQueryDetailById(_0x53fd13){const _0x15cb34=a219_0x1f8ad5,_0x322723=await apiRequest(_0x15cb34(0x2ac)+_0x53fd13);if(!_0x322723[_0x15cb34(0x244)])throw CliErrors['validation'](_0x15cb34(0x28c)+_0x53fd13);return _0x322723[_0x15cb34(0x244)];}export async function createSqlQuery(_0x2f0a67){const _0x19c3ef=a219_0x1f8ad5,_0x498f86=await apiRequest('/smartapi/custom/saveUserCustomSql',{'method':_0x19c3ef(0x21f),'body':_0x2f0a67}),{id:_0x11acf0,entity:_0x407d54}=normalizeEntityWithIdResponse(_0x498f86[_0x19c3ef(0x244)]);if(!('sqlCode'in _0x407d54)&&_0x11acf0)return getSqlQueryDetailById(_0x11acf0);return normalizeSqlQueryEntity(_0x407d54);}export async function updateSqlQuery(_0x578022){const _0x3329cb=a219_0x1f8ad5,_0x28a279=await apiRequest('/smartapi/custom/updateUserCustomSql',{'method':'POST','body':_0x578022}),{id:_0x475afe,entity:_0x3e2192}=normalizeEntityWithIdResponse(_0x28a279['data']);if(!(_0x3329cb(0x1ac)in _0x3e2192)){if(_0x578022[_0x3329cb(0x1ac)])return getSqlQueryDetail(_0x578022[_0x3329cb(0x1ac)]);if(_0x475afe)return getSqlQueryDetailById(_0x475afe);}return normalizeSqlQueryEntity(_0x3e2192);}export async function deleteSqlQuery(_0x422cf5){const _0x54415f=a219_0x1f8ad5;await apiRequest('/smartapi/custom/deleteUserCustomSql',{'method':_0x54415f(0x21f),'body':_0x422cf5});}export async function saveSqlQuery(_0x524709){const _0x200062=a219_0x1f8ad5,_0x56bf3d=await apiRequest(_0x200062(0x29e),{'method':_0x200062(0x21f),'body':_0x524709});return _0x56bf3d[_0x200062(0x244)];}function normalizeSqlQueryEntity(_0x53f942){const _0x8de29a=a219_0x1f8ad5;return{..._0x53f942,'id':Number(_0x53f942['id']),'dbId':_0x53f942[_0x8de29a(0x260)]==null?undefined:Number(_0x53f942[_0x8de29a(0x260)]),'version':_0x53f942[_0x8de29a(0x1e2)]==null?undefined:Number(_0x53f942[_0x8de29a(0x1e2)])};}export async function executeSql(_0x23e4bd,_0x1ffb38,_0x2fa055){const _0x2a34bb=a219_0x1f8ad5,_0x84c608=await apiRequest(_0x2a34bb(0x19f),{'method':_0x2a34bb(0x21f),'body':{'appCode':_0x23e4bd,'sqlCode':_0x1ffb38,..._0x2fa055&&{'params':_0x2fa055}},'useRuntime':!![]});return _0x84c608[_0x2a34bb(0x244)];}export async function executeDatasetDataOperation(_0x5f2b46,_0x15c658,_0x2c94f7,_0x3790e4={}){const _0x55bf9d=a219_0x1f8ad5;try{const _0x2b5124=await apiRequest(_0x55bf9d(0x1f1)+_0x5f2b46+'/'+_0x15c658+'/'+_0x2c94f7,{'method':'POST','body':_0x3790e4,'useRuntime':!![]});return _0x2b5124[_0x55bf9d(0x244)];}catch(_0x1ec9cd){if(_0x2c94f7==='getOne'&&_0x1ec9cd instanceof CliError&&_0x1ec9cd[_0x55bf9d(0x268)]===_0x55bf9d(0x265)&&_0x3790e4['id']!==undefined&&_0x3790e4['id']!==null&&_0x3790e4['id']!==''){const _0x44656d=await apiRequest('/api/'+_0x5f2b46+'/'+_0x15c658+_0x55bf9d(0x2a0),{'method':_0x55bf9d(0x21f),'body':{'where':{'id':{'$eq':_0x3790e4['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0x5c284a=Array[_0x55bf9d(0x208)](_0x44656d[_0x55bf9d(0x244)]?.['tableData'])?_0x44656d[_0x55bf9d(0x244)]['tableData']:[];return _0x5c284a[0x0]??null;}throw _0x1ec9cd;}}export async function listDatasets(_0x4c14fd,_0x4326c6){const _0x3afa43=a219_0x1f8ad5,_0x128d69={'appCode':_0x4c14fd,'deleted':_0x4326c6?.[_0x3afa43(0x29b)]??![]};if(_0x4326c6?.[_0x3afa43(0x268)])_0x128d69[_0x3afa43(0x268)]=_0x4326c6[_0x3afa43(0x268)];if(_0x4326c6?.['name'])_0x128d69[_0x3afa43(0x1a2)]=_0x4326c6[_0x3afa43(0x1a2)];if(_0x4326c6?.[_0x3afa43(0x26f)])_0x128d69[_0x3afa43(0x26f)]=_0x4326c6['source'];const _0x23b35c=await apiRequest(_0x3afa43(0x1a9),{'method':'POST','body':_0x128d69});return extractList(_0x23b35c[_0x3afa43(0x244)]);}export async function deleteDataset(_0x59d0c0,_0x2418db){const _0x358991=a219_0x1f8ad5;await apiRequest(_0x358991(0x207)+(_0x2418db?'true':'false'),{'method':_0x358991(0x21f),'body':{'id':_0x59d0c0}});}export async function restoreDataset(_0x1cdf8c,_0x4a6329){const _0x4ebc8a=a219_0x1f8ad5;await apiRequest('/smartapi/dataset/restore-dataset',{'method':_0x4ebc8a(0x21f),'body':{'appCode':_0x1cdf8c,'datasetId':_0x4a6329}});}export async function listRecycleBinResources(_0x598f69,_0x24476d,_0x3a8735){const _0xa31187=a219_0x1f8ad5,_0x3c6248=new URLSearchParams({'appCode':_0x598f69,'resourceType':_0x24476d,'currentPage':String(_0x3a8735[_0xa31187(0x1c1)]),'pageSize':String(_0x3a8735[_0xa31187(0x23e)])});if(_0x3a8735['resourceName'])_0x3c6248['set'](_0xa31187(0x1bd),_0x3a8735['resourceName']);const _0x3da8fe=await apiRequest(_0xa31187(0x23d)+_0x3c6248[_0xa31187(0x1e6)]());return{'items':extractList(_0x3da8fe[_0xa31187(0x244)]),'paging':extractPaging(_0x3da8fe[_0xa31187(0x244)])};}export async function restoreRecycleBinResource(_0x325d86){const _0x579a1a=a219_0x1f8ad5;await apiRequest('/smartapi/recycleBin/resource/restore',{'method':_0x579a1a(0x21f),'body':{'id':_0x325d86}});}export async function previewTextGeneratedDataset(_0x4d72b3,_0x514fd1){const _0x54f031=a219_0x1f8ad5,_0xdf62e8=await apiRequest(_0x54f031(0x219),{'method':_0x54f031(0x21f),'body':{'appCode':_0x4d72b3,'datasetName':_0x514fd1[_0x54f031(0x288)],'requirementDescription':_0x514fd1[_0x54f031(0x19e)]},'timeout':TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS});return _0xdf62e8[_0x54f031(0x244)];}export async function startTextGeneratedDataset(_0x571d83,_0x552016,_0x1f4d6c){const _0x1175b6=a219_0x1f8ad5,_0x56d745=await apiRequest(_0x1175b6(0x291),{'method':_0x1175b6(0x21f),'body':{'appCode':_0x571d83,..._0x1f4d6c?.[_0x1175b6(0x29f)]?{'clientOperationId':_0x1f4d6c[_0x1175b6(0x29f)]}:{},'design':_0x552016},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x56d745[_0x1175b6(0x244)];}export async function getTextGeneratedDatasetStatus(_0x1b6661,_0x5aff1e){const _0x56fb00=a219_0x1f8ad5,_0x24760b=new URLSearchParams({'appCode':_0x1b6661});if(_0x5aff1e[_0x56fb00(0x1a8)])_0x24760b[_0x56fb00(0x266)]('operationId',_0x5aff1e[_0x56fb00(0x1a8)]);else{if(_0x5aff1e['operationId'])_0x24760b[_0x56fb00(0x266)](_0x56fb00(0x206),_0x5aff1e['operationId']);else _0x5aff1e['clientOperationId']&&_0x24760b[_0x56fb00(0x266)]('clientOperationId',_0x5aff1e[_0x56fb00(0x29f)]);}const _0x149aaf=await apiRequest(_0x56fb00(0x234)+_0x24760b[_0x56fb00(0x1e6)]());return _0x149aaf[_0x56fb00(0x244)];}export async function searchDatasets(_0x27399c,_0x1fb446){const _0x2b5d44=a219_0x1f8ad5,_0x2b1154=await listDatasets(_0x27399c,{'name':_0x1fb446}),_0x3475c3=_0x1fb446[_0x2b5d44(0x1b5)](),_0xb72c8e=new Set(_0x2b1154[_0x2b5d44(0x2b2)](_0x4916a0=>_0x4916a0['id'])),_0x503a76=_0x2b1154[_0x2b5d44(0x1de)](_0xa4e2af=>_0xa4e2af[_0x2b5d44(0x2a5)]?.[_0x2b5d44(0x25d)]?.[_0x2b5d44(0x1b5)]()[_0x2b5d44(0x272)](_0x3475c3)||_0xa4e2af[_0x2b5d44(0x2b1)]?.[_0x2b5d44(0x1b5)]()[_0x2b5d44(0x272)](_0x3475c3)),_0x2cb1b6=await listDatasets(_0x27399c,{'code':_0x1fb446});for(const _0x240dac of _0x2cb1b6){!_0xb72c8e[_0x2b5d44(0x252)](_0x240dac['id'])&&(_0x2b1154['push'](_0x240dac),_0xb72c8e[_0x2b5d44(0x29d)](_0x240dac['id']));}return _0x2b1154;}export function normalizeDatasetOperations(_0x230f80){const _0xf50de8=a219_0x1f8ad5;if(Array[_0xf50de8(0x208)](_0x230f80))return _0x230f80[_0xf50de8(0x1de)](_0x242650=>_0x242650!=null&&typeof _0x242650==='object');if(_0x230f80&&typeof _0x230f80===_0xf50de8(0x210))return Object[_0xf50de8(0x1c4)](_0x230f80)['filter'](([,_0x3772ca])=>_0x3772ca!=null&&typeof _0x3772ca===_0xf50de8(0x210))[_0xf50de8(0x2b2)](([_0x37b72a,_0x9bd933])=>({..._0x9bd933,'name':_0x9bd933[_0xf50de8(0x1a2)]??_0x9bd933['operationName']??_0x37b72a}));return[];}export async function getDatasetDetail(_0x4a0c03){const _0x49128a=a219_0x1f8ad5,_0x5c74a0=/^\d+$/['test'](_0x4a0c03)?'id':_0x49128a(0x268),_0x14fbbe=await apiRequest(_0x49128a(0x20c)+_0x5c74a0+'='+_0x4a0c03);return _0x14fbbe[_0x49128a(0x244)];}export async function updateDrivenData(_0x216ed4){const _0x48d5f0=a219_0x1f8ad5,_0x5b7f5a=await apiRequest(_0x48d5f0(0x1bf),{'method':'POST','body':_0x216ed4});return _0x5b7f5a[_0x48d5f0(0x244)];}export async function getDatasetOperations(_0x9c3d3){const _0x5c36d8=a219_0x1f8ad5,_0x1bdb8a=await getDatasetDetail(_0x9c3d3),_0x591dc8=normalizeDatasetOperations(_0x1bdb8a[_0x5c36d8(0x299)])[_0x5c36d8(0x2b2)](_0x55a615=>({'name':_0x55a615[_0x5c36d8(0x1a2)]||_0x55a615['operationName'],'displayName':_0x55a615[_0x5c36d8(0x1b7)]||_0x55a615[_0x5c36d8(0x1a2)],'type':_0x55a615[_0x5c36d8(0x1cc)],'method':_0x55a615[_0x5c36d8(0x1e1)],'path':_0x55a615[_0x5c36d8(0x1b9)],'enabled':_0x55a615['enabled']??!![],'requestFields':_0x55a615[_0x5c36d8(0x1c5)],'responseFields':_0x55a615['responseFields']}));return{'dataset':{'id':_0x1bdb8a['id']??_0x1bdb8a[_0x5c36d8(0x294)],'name':_0x1bdb8a[_0x5c36d8(0x1a2)],'code':_0x1bdb8a[_0x5c36d8(0x268)]||_0x1bdb8a['modelCode'],'tableName':_0x1bdb8a[_0x5c36d8(0x25d)]||_0x1bdb8a[_0x5c36d8(0x2a5)]?.[_0x5c36d8(0x25d)]},'operations':_0x591dc8};}export async function getOperationDetail(_0xe14a0a,_0x30f58a,_0x3d1b89){const _0x2c5c6d=a219_0x1f8ad5;let _0x92e13c=_0x30f58a;if(!/^\d+$/['test'](_0x30f58a)){const _0x4e3eaf=await listDatasets(_0xe14a0a,{'code':_0x30f58a}),_0x1cbee7=_0x4e3eaf['find'](_0x4e97cc=>_0x4e97cc[_0x2c5c6d(0x268)]===_0x30f58a||String(_0x4e97cc['id'])===_0x30f58a);if(!_0x1cbee7)throw CliErrors[_0x2c5c6d(0x241)](_0x2c5c6d(0x274)+_0x30f58a);_0x92e13c=String(_0x1cbee7['id']);}const _0x645ed5=await getDatasetDetail(_0x92e13c),_0x3d8ff1=normalizeDatasetOperations(_0x645ed5[_0x2c5c6d(0x299)])[_0x2c5c6d(0x1d1)](_0x1dd92a=>(_0x1dd92a[_0x2c5c6d(0x1a2)]||_0x1dd92a[_0x2c5c6d(0x27f)])===_0x3d1b89);if(!_0x3d8ff1)throw CliErrors['validation']('Operation\x20\x22'+_0x3d1b89+_0x2c5c6d(0x22c)+_0x30f58a);return{'dataset':{'id':_0x645ed5['id']??_0x645ed5[_0x2c5c6d(0x294)],'name':_0x645ed5['name'],'code':_0x645ed5[_0x2c5c6d(0x268)]||_0x645ed5[_0x2c5c6d(0x20a)],'tableName':_0x645ed5[_0x2c5c6d(0x25d)]||_0x645ed5[_0x2c5c6d(0x2a5)]?.[_0x2c5c6d(0x25d)]},'operation':_0x3d8ff1};}export async function getAppInfo(_0xf1348c){const _0x158233=a219_0x1f8ad5,_0x98a14=await apiRequest(_0x158233(0x1e0)+buildQuery({'appCode':_0xf1348c}));return _0x98a14[_0x158233(0x244)];}export async function getI18nInfo(_0x4a7c24){const _0x2455ab=a219_0x1f8ad5,_0x224093=await getAppInfo(_0x4a7c24);return{'enableI18n':_0x224093['enableI18n'],..._0x224093[_0x2455ab(0x248)]};}export async function createReactPage(_0x3e5751){const _0x3c83f7=a219_0x1f8ad5,_0x59fd39=await apiRequest('/smartapi/webcode/page/create',{'method':'POST','body':{'appCode':_0x3e5751[_0x3c83f7(0x1dd)],'pageName':_0x3e5751['pageName'],..._0x3e5751[_0x3c83f7(0x1ad)]!=null?{'parentMenuId':_0x3e5751[_0x3c83f7(0x1ad)]}:{},'createMenu':_0x3e5751['createMenu'],'codeContent':_0x3e5751[_0x3c83f7(0x245)]}});return{'pageId':_0x59fd39[_0x3c83f7(0x244)][_0x3c83f7(0x22e)],'pageName':_0x59fd39['data'][_0x3c83f7(0x264)]??_0x3e5751[_0x3c83f7(0x1c0)],'appCode':_0x3e5751[_0x3c83f7(0x1dd)],'version':_0x59fd39[_0x3c83f7(0x244)][_0x3c83f7(0x28d)]??0x0,'menuId':_0x59fd39['data'][_0x3c83f7(0x263)]?.['id']??null,'menuPath':_0x59fd39[_0x3c83f7(0x244)][_0x3c83f7(0x263)]?.[_0x3c83f7(0x1b9)]??null,'files':_0x59fd39[_0x3c83f7(0x244)][_0x3c83f7(0x245)]};}export async function updateReactPageContent(_0x4b336b){const _0x3b6792=a219_0x1f8ad5,_0x19c510=await apiRequest(_0x3b6792(0x276),{'method':_0x3b6792(0x21f),'body':{'id':_0x4b336b[_0x3b6792(0x22e)],'codeContent':_0x4b336b['pageContent']}});return{'pageId':_0x4b336b['pageId'],'newVersion':_0x19c510[_0x3b6792(0x244)]};}export async function publishReactPage(_0xd0d204){const _0x5ba461=a219_0x1f8ad5,_0x3d09f0=await apiRequest('/smartapi/webcode/file/publish',{'method':_0x5ba461(0x21f),'body':{'id':_0xd0d204[_0x5ba461(0x22e)],..._0xd0d204[_0x5ba461(0x2ae)]?{'remark':_0xd0d204[_0x5ba461(0x2ae)]}:{}}});return _0x3d09f0[_0x5ba461(0x244)];}export async function getReactPageSource(_0x47a28d){const _0x4d4086=a219_0x1f8ad5,_0x45be21=await apiRequest('/smartapi/webcode/page/detail'+buildQuery({'id':_0x47a28d}));if(!_0x45be21['data'])throw CliErrors[_0x4d4086(0x241)](_0x4d4086(0x20d)+_0x47a28d);return _0x45be21[_0x4d4086(0x244)];}export async function startGenerateStandardPages(_0x40bf41,_0x183eaa,_0x2152f0){const _0x3e11f7=a219_0x1f8ad5,_0x11edee=await apiRequest(_0x3e11f7(0x27d)+_0x183eaa+_0x3e11f7(0x222),{'method':_0x3e11f7(0x21f),'body':{'appCode':_0x40bf41,..._0x2152f0?.[_0x3e11f7(0x29f)]?{'clientOperationId':_0x2152f0['clientOperationId']}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x11edee[_0x3e11f7(0x244)];}export async function getGenerateStandardPagesStatus(_0x3db822,_0x21c66d,_0x59dbc0){const _0x19af41=a219_0x1f8ad5,_0x229334=new URLSearchParams({'appCode':_0x3db822});_0x59dbc0[_0x19af41(0x1a8)]&&_0x229334[_0x19af41(0x266)]('taskId',_0x59dbc0[_0x19af41(0x1a8)]);_0x59dbc0[_0x19af41(0x206)]&&_0x229334[_0x19af41(0x266)](_0x19af41(0x206),_0x59dbc0['operationId']);_0x59dbc0[_0x19af41(0x29f)]&&_0x229334[_0x19af41(0x266)](_0x19af41(0x29f),_0x59dbc0[_0x19af41(0x29f)]);const _0x2cfa2a=await apiRequest(_0x19af41(0x27d)+_0x21c66d+_0x19af41(0x22b)+_0x229334['toString']());return _0x2cfa2a[_0x19af41(0x244)];}export async function getStandardPageStatus(_0x48922c,_0x332f4f){const _0x125ed1=a219_0x1f8ad5,_0x125121=await apiRequest('/smartapi/lovrabet/dataset/'+_0x332f4f+_0x125ed1(0x21d)+encodeURIComponent(_0x48922c));return _0x125121[_0x125ed1(0x244)];}export async function tryGetStandardPageStatus(_0xbf1b5a,_0x2b40e4){const _0x5d82a7=a219_0x1f8ad5;try{return await getStandardPageStatus(_0xbf1b5a,_0x2b40e4);}catch(_0x39596b){if(_0x39596b instanceof CliError&&_0x39596b[_0x5d82a7(0x268)]===_0x5d82a7(0x265)&&/404|not found|non-json response/i[_0x5d82a7(0x270)](_0x39596b[_0x5d82a7(0x259)]))return null;throw _0x39596b;}}export async function syncStandardPages(_0x5ba96c,_0x450b63){const _0x48d5f1=a219_0x1f8ad5,_0x7d3041=await apiRequest('/smartapi/lovrabet/dataset/'+_0x450b63+'/sync-to-pages',{'method':_0x48d5f1(0x21f),'body':{'appCode':_0x5ba96c}});return _0x7d3041['data'];}export async function getPageDetail(_0x46bc8d){const _0x4d6725=a219_0x1f8ad5,_0x102ad8=await apiRequest(_0x4d6725(0x1dc)+_0x46bc8d);if(!_0x102ad8[_0x4d6725(0x244)])throw CliErrors['validation'](_0x4d6725(0x253)+_0x46bc8d);return _0x102ad8[_0x4d6725(0x244)];}export async function listDeletedPages(_0x3dda83,_0xd6b7ad,_0x5b9c1a){const _0x202e24=a219_0x1f8ad5,_0x1ffb8b=new URLSearchParams({'appCode':_0x3dda83,'type':_0xd6b7ad,'currentPage':String(_0x5b9c1a[_0x202e24(0x1c1)]),'pageSize':String(_0x5b9c1a[_0x202e24(0x23e)])}),_0x145675=await apiRequest(_0x202e24(0x224)+_0x1ffb8b['toString']());return _0x145675[_0x202e24(0x244)];}export async function restoreStandardPage(_0x280e18){const _0x27f732=a219_0x1f8ad5;await apiRequest('/smartapi/page/restore',{'method':_0x27f732(0x21f),'body':{'id':_0x280e18}});}export async function restoreJsxPage(_0x131e75,_0x2daa40){const _0x19a934=a219_0x1f8ad5,_0x174514=await apiRequest(_0x19a934(0x225),{'method':'POST','body':{'appCode':_0x131e75,'id':_0x2daa40}});return _0x174514[_0x19a934(0x244)];}export async function updatePage(_0x589d94,_0x3bcf4b,_0x216def,_0x2bb4e7){const _0x41bc61=a219_0x1f8ad5,_0x1c902a=await apiRequest(_0x41bc61(0x1bc),{'method':_0x41bc61(0x21f),'body':{'appCode':_0x589d94,'pageId':_0x3bcf4b,'code':_0x216def,'datasetIds':_0x2bb4e7}});return _0x1c902a[_0x41bc61(0x244)];}export function generateSdkCode(_0x4afaaa,_0x5af434,_0x3998de){const _0x4adcde=a219_0x1f8ad5,_0x56f682=_0x3998de?.[_0x4adcde(0x235)]??!![],_0x1dcdad=_0x4adcde(0x26d)+_0x4afaaa[_0x4adcde(0x268)]?.[_0x4adcde(0x1c9)](/-/g,'_'),_0x5db09c=_0x5af434['name']||_0x5af434['operationName']||_0x4adcde(0x1de),_0x456011=[];_0x56f682&&_0x456011[_0x4adcde(0x1ce)](_0x4adcde(0x275),'',_0x4adcde(0x1a4),'');_0x456011['push'](_0x4adcde(0x279)+_0x4afaaa['name']+'\x20('+(_0x4afaaa[_0x4adcde(0x25d)]||_0x4adcde(0x2b6))+')');if(_0x5db09c===_0x4adcde(0x1de))_0x456011[_0x4adcde(0x1ce)](_0x4adcde(0x1c2)+_0x1dcdad+'.filter({',_0x4adcde(0x223),_0x4adcde(0x1a6),_0x4adcde(0x273),'});');else{if(_0x5db09c===_0x4adcde(0x25e))_0x456011[_0x4adcde(0x1ce)](_0x4adcde(0x1c2)+_0x1dcdad+_0x4adcde(0x1f9));else{if(_0x5db09c===_0x4adcde(0x287))_0x456011[_0x4adcde(0x1ce)](_0x4adcde(0x1c2)+_0x1dcdad+'.create({\x20/*\x20fields\x20*/\x20});');else{if(_0x5db09c==='update')_0x456011['push'](_0x4adcde(0x1c2)+_0x1dcdad+'.update(id,\x20{\x20/*\x20fields\x20*/\x20});');else _0x5db09c==='delete'||_0x5db09c==='remove'?_0x456011['push'](_0x4adcde(0x1c2)+_0x1dcdad+_0x4adcde(0x236)):_0x456011[_0x4adcde(0x1ce)](_0x4adcde(0x1c2)+_0x1dcdad+'.'+_0x5db09c+_0x4adcde(0x220));}}}return _0x456011[_0x4adcde(0x200)]('\x0a');}export function generateSqlCodeTemplate(_0x5b0b09,_0x921d70){const _0x4ae121=a219_0x1f8ad5,_0x6555e7=_0x921d70?.[_0x4ae121(0x1f0)]??_0x4ae121(0x2b3),_0x42fa24=_0x921d70?.[_0x4ae121(0x235)]??!![],_0x4ace6a=[];return _0x4ace6a[_0x4ae121(0x1ce)](_0x4ae121(0x1a5)+_0x5b0b09['sqlName']+'\x20('+_0x5b0b09[_0x4ae121(0x1ac)]+')'),_0x6555e7===_0x4ae121(0x2b3)?(_0x42fa24&&_0x4ace6a[_0x4ae121(0x1ce)](_0x4ae121(0x275),'','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});',''),_0x4ace6a[_0x4ae121(0x1ce)](_0x4ae121(0x27a),_0x4ae121(0x216)+_0x5b0b09['sqlCode']+'\x27,',_0x4ae121(0x1ee),_0x4ae121(0x1bb),'if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','const\x20results\x20=\x20data.execResult\x20||\x20[];')):_0x4ace6a[_0x4ae121(0x1ce)](_0x4ae121(0x1ae),_0x4ae121(0x267),_0x4ae121(0x29c),_0x4ae121(0x25a)+_0x5b0b09[_0x4ae121(0x1ac)]+'\x27,','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},',_0x4ae121(0x1c6),'\x20\x20return\x20rows;','}'),_0x4ace6a[_0x4ae121(0x200)]('\x0a');}export async function getErConfig(_0x9c13ea,_0x343b39){const _0x4ffdc5=a219_0x1f8ad5,_0xdf8ee6=await apiRequest(_0x4ffdc5(0x28e),{'method':'POST','body':{'appCode':_0x9c13ea,'dblinkId':_0x343b39},'timeout':ER_CONFIG_REQUEST_TIMEOUT_MS});return _0xdf8ee6['data'];}export async function getErRelationDetail(_0x2fcc3e,_0x346c14){const _0xe1015b=a219_0x1f8ad5,_0x4d2af6=new URLSearchParams({'appCode':_0x2fcc3e,'relationId':String(_0x346c14)});try{const _0x51b271=await apiRequest(_0xe1015b(0x204)+_0x4d2af6[_0xe1015b(0x1e6)]());return _0x51b271[_0xe1015b(0x244)]?.[_0xe1015b(0x242)]??null;}catch(_0x1320cd){if(_0x1320cd instanceof CliError&&_0x1320cd[_0xe1015b(0x268)]===_0xe1015b(0x265)&&(_0x1320cd[_0xe1015b(0x1a1)]?.[_0xe1015b(0x272)](_0xe1015b(0x1d5))||_0x1320cd['hint']===_0xe1015b(0x28b)&&_0x1320cd['message']==='ER\x20relation\x20does\x20not\x20exist'))return null;throw _0x1320cd;}}export async function createErRelation(_0x1ecac3){const _0x901da7=a219_0x1f8ad5,_0x2a0e8e=await apiRequest(_0x901da7(0x250),{'method':_0x901da7(0x21f),'body':_0x1ecac3,'allowNonJsonSuccess':!![]});return _0x2a0e8e['data'];}export async function updateErRelation(_0x3cae03){const _0x1795bf=a219_0x1f8ad5,_0x116173=await apiRequest('/smartapi/question/er-config/cli/update-single',{'method':_0x1795bf(0x21f),'body':_0x3cae03,'allowNonJsonSuccess':!![]});return _0x116173[_0x1795bf(0x244)];}export async function deleteErRelation(_0x3befa5){const _0x4f33f2=a219_0x1f8ad5,_0x10bbcc=await apiRequest(_0x4f33f2(0x214),{'method':_0x4f33f2(0x21f),'body':_0x3befa5,'allowNonJsonSuccess':!![]});return _0x10bbcc['data'];}export async function updateErBusinessGroup(_0x2c5001){const _0x588064=a219_0x1f8ad5,_0x5982a4=await apiRequest(_0x588064(0x295),{'method':'POST','body':_0x2c5001,'allowNonJsonSuccess':!![]});return _0x5982a4[_0x588064(0x244)];}export async function getErBusinessGroupSummary(_0x3fea85,_0x31586b){const _0x26f720=a219_0x1f8ad5,_0x30ef93=await apiRequest('/smartapi/question/er-config/business-groups',{'method':'POST','body':{'appCode':_0x3fea85,'dblinkId':_0x31586b}});return _0x30ef93[_0x26f720(0x244)];}function buildQuery(_0x2bfa92){const _0x4fbc41=a219_0x1f8ad5,_0x372363=new URLSearchParams();for(const [_0x58e6d3,_0x105069]of Object[_0x4fbc41(0x1c4)](_0x2bfa92)){if(_0x105069===undefined||_0x105069==='')continue;_0x372363[_0x4fbc41(0x266)](_0x58e6d3,String(_0x105069));}const _0x2639d2=_0x372363[_0x4fbc41(0x1e6)]();return _0x2639d2?'?'+_0x2639d2:'';}export async function listNotificationChannelConfigs(_0x3c7bb4,_0x37d064){const _0x4cebc7=a219_0x1f8ad5,_0x459086=await apiRequest(_0x4cebc7(0x1b1)+buildQuery({'appCode':_0x3c7bb4,'channelType':_0x37d064}));if(!Array[_0x4cebc7(0x208)](_0x459086[_0x4cebc7(0x244)]))throw CliErrors[_0x4cebc7(0x2af)]('Invalid\x20notification\x20config\x20list\x20response.',_0x4cebc7(0x1ec));return _0x459086[_0x4cebc7(0x244)];}export async function getNotificationChannelConfig(_0x175e12,_0x2361a8){const _0x36b50b=a219_0x1f8ad5,_0x880acb=await apiRequest(_0x36b50b(0x19b)+_0x175e12+buildQuery({'appCode':_0x2361a8}));return _0x880acb[_0x36b50b(0x244)];}export async function createNotificationChannelConfig(_0x398b10){const _0x48bef1=a219_0x1f8ad5,_0x17d625=await apiRequest(_0x48bef1(0x1a3),{'method':_0x48bef1(0x21f),'body':_0x398b10,'indeterminateMutation':!![]});return _0x17d625[_0x48bef1(0x244)];}export async function updateNotificationChannelConfig(_0x24b6f7){const _0x1e1cdc=a219_0x1f8ad5;await apiRequest(_0x1e1cdc(0x1b2),{'method':'POST','body':_0x24b6f7,'indeterminateMutation':!![]});}export async function deleteNotificationChannelConfig(_0x422583,_0x1b3b15){const _0x2394e8=a219_0x1f8ad5;await apiRequest(_0x2394e8(0x1ed),{'method':_0x2394e8(0x21f),'body':{'id':_0x422583,'appCode':_0x1b3b15},'indeterminateMutation':!![]});}export async function listAppConfigs(_0x2585fe,_0x5c857d){const _0x5724f5=a219_0x1f8ad5,_0x23ad71=await apiRequest('/smartapi/app-config/list',{'method':_0x5724f5(0x21f),'body':{'appCode':_0x2585fe,..._0x5c857d?.[_0x5724f5(0x2ad)]?{'key':_0x5c857d['key']}:{},..._0x5c857d?.[_0x5724f5(0x1fb)]?{'tags':_0x5c857d[_0x5724f5(0x1fb)]}:{}}});return extractAppConfigList(_0x23ad71[_0x5724f5(0x244)]);}export async function getAppConfigByKey(_0x47c9b6,_0x2a2163){const _0x343ce4=a219_0x1f8ad5,_0x14e1ec=await apiRequest(_0x343ce4(0x26c)+buildQuery({'appCode':_0x47c9b6,'key':_0x2a2163}));return _0x14e1ec[_0x343ce4(0x244)]??null;}export async function createAppConfig(_0x24469d){const _0x43767c=a219_0x1f8ad5,_0x23af1c=await apiRequest(_0x43767c(0x23c),{'method':_0x43767c(0x21f),'body':{'appCode':_0x24469d['appCode'],'key':_0x24469d['key'],'value':_0x24469d[_0x43767c(0x24a)],..._0x24469d['tags']?{'tags':_0x24469d[_0x43767c(0x1fb)]}:{}}});return _0x23af1c[_0x43767c(0x244)];}export async function updateAppConfig(_0x469a70){const _0x172664=a219_0x1f8ad5;await apiRequest(_0x172664(0x1c8),{'method':_0x172664(0x21f),'body':{'id':_0x469a70['id'],'appCode':_0x469a70[_0x172664(0x1dd)],'key':_0x469a70[_0x172664(0x2ad)],'value':_0x469a70[_0x172664(0x24a)],..._0x469a70[_0x172664(0x1fb)]?{'tags':_0x469a70['tags']}:{}}});}export async function deleteAppConfig(_0x52e99c){const _0x1bff6f=a219_0x1f8ad5;await apiRequest(_0x1bff6f(0x217),{'method':_0x1bff6f(0x21f),'body':_0x52e99c});}function extractAppConfigList(_0x54d385){const _0x2ce40e=a219_0x1f8ad5;if(Array[_0x2ce40e(0x208)](_0x54d385))return _0x54d385;if(_0x54d385&&typeof _0x54d385==='object'&&Array[_0x2ce40e(0x208)](_0x54d385[_0x2ce40e(0x28f)]))return _0x54d385[_0x2ce40e(0x28f)];return extractList(_0x54d385);}export async function listDbLinks(_0x280941,_0x57ac04){const _0x3a6af8=a219_0x1f8ad5,_0x3bc1ea=await apiRequest('/smartapi/dblink/getList',{'method':_0x3a6af8(0x21f),'body':{'appCode':_0x280941,'currentPage':_0x57ac04?.[_0x3a6af8(0x1c1)]??0x1,'pageSize':_0x57ac04?.[_0x3a6af8(0x23e)]??0x64}});return{'items':extractList(_0x3bc1ea['data']),'paging':extractPaging(_0x3bc1ea[_0x3a6af8(0x244)])};}export async function getDbLinkInfo(_0x82115f){const _0x42a665=await apiRequest('/smartapi/dblink/getOne'+buildQuery({'id':_0x82115f}));return _0x42a665['data'];}export async function createDbLink(_0x3e42ea){const _0x585804=a219_0x1f8ad5,_0x1fbeee=await apiRequest(_0x585804(0x24e),{'method':_0x585804(0x21f),'body':_0x3e42ea});return _0x1fbeee[_0x585804(0x244)];}export async function updateDbLink(_0x30f3b4){const _0x3aaf30=a219_0x1f8ad5,_0x10a1a2=await apiRequest(_0x3aaf30(0x20b),{'method':_0x3aaf30(0x21f),'body':_0x30f3b4});return _0x10a1a2['data'];}export async function deleteDbLink(_0x1ae982){const _0x40ded6=a219_0x1f8ad5;await apiRequest(_0x40ded6(0x19d),{'method':_0x40ded6(0x21f),'body':{'id':_0x1ae982}});}export async function testDbLinkConnect(_0x170ec2){const _0x1a78cf=a219_0x1f8ad5,_0x19081c=await apiRequest(_0x1a78cf(0x1ca)+buildQuery({'id':_0x170ec2}));return _0x19081c['data'];}export async function testDbLinkConfigConnect(_0x12b4a4){const _0x310ce1=a219_0x1f8ad5,_0x21925f=await apiRequest(_0x310ce1(0x1f6),{'method':_0x310ce1(0x21f),'body':_0x12b4a4});return _0x21925f[_0x310ce1(0x244)];}export async function startDbAnalysis(_0x23450b,_0xa2bf21){const _0x10d499=a219_0x1f8ad5,_0x3b101d=await apiRequest(_0x10d499(0x298),{'method':_0x10d499(0x21f),'body':{'dbLinkId':_0x23450b,..._0xa2bf21&&_0xa2bf21[_0x10d499(0x249)]>0x0?{'tableNames':_0xa2bf21}:{}}});return _0x3b101d[_0x10d499(0x244)];}export async function cancelDbAnalysis(_0x1242ef){await apiRequest('/smartapi/db-analysis/jobs/cancel'+buildQuery({'planId':_0x1242ef}),{'method':'POST'});}export async function getDbAnalysisStatus(_0x4d47cc){const _0x136e9f=a219_0x1f8ad5,_0xa53f31=await apiRequest(_0x136e9f(0x1b0)+encodeURIComponent(_0x4d47cc));return _0xa53f31['data'];}export async function getDbAllTableList(_0x5788f7,_0xa4b754){const _0x530fa0=a219_0x1f8ad5,_0x1d6fc9=await apiRequest(_0x530fa0(0x254)+buildQuery({'appCode':_0x5788f7,'dbLinkId':_0xa4b754})),_0x4ebb9b=_0x1d6fc9[_0x530fa0(0x244)];if(Array[_0x530fa0(0x208)](_0x4ebb9b))return _0x4ebb9b;return extractList(_0x4ebb9b);}export async function getDbTableDiff(_0xfe82df,_0x5082c8,_0x34d83b){const _0x319a4f=a219_0x1f8ad5,_0x272eb2=await apiRequest(_0x319a4f(0x285)+buildQuery({'appCode':_0xfe82df,'dbLinkId':_0x5082c8,'pageIndex':_0x34d83b?.[_0x319a4f(0x2a7)]??0x1,'pageSize':_0x34d83b?.[_0x319a4f(0x23e)]??0x14,'tableName':_0x34d83b?.['tableName']})),_0x42c67c=_0x272eb2[_0x319a4f(0x244)];return{'totalCount':_0x42c67c?.['totalCount']??0x0,...typeof _0x42c67c?.[_0x319a4f(0x1d4)]==='number'?{'physicalTableCount':_0x42c67c['physicalTableCount']}:{},...typeof _0x42c67c?.['datasetTableCount']===_0x319a4f(0x289)?{'datasetTableCount':_0x42c67c[_0x319a4f(0x240)]}:{},..._0x42c67c?.['summary']?{'summary':_0x42c67c['summary']}:{},'tableList':Array[_0x319a4f(0x208)](_0x42c67c?.[_0x319a4f(0x238)])?_0x42c67c[_0x319a4f(0x238)]:[]};}export async function getDbLiveTableDiff(_0x424ceb,_0xbeeeb2,_0x222320){const _0x13d19e=a219_0x1f8ad5,_0x2e982d=await apiRequest(_0x13d19e(0x19c)+buildQuery({'appCode':_0x424ceb,'dbLinkId':_0xbeeeb2,'pageIndex':_0x222320?.[_0x13d19e(0x2a7)]??0x1,'pageSize':_0x222320?.[_0x13d19e(0x23e)]??0x14,'tableName':_0x222320?.[_0x13d19e(0x25d)]})),_0x53a501=_0x2e982d[_0x13d19e(0x244)];return{'totalCount':_0x53a501?.[_0x13d19e(0x2ab)]??0x0,...typeof _0x53a501?.[_0x13d19e(0x1d4)]===_0x13d19e(0x289)?{'physicalTableCount':_0x53a501['physicalTableCount']}:{},...typeof _0x53a501?.[_0x13d19e(0x240)]==='number'?{'datasetTableCount':_0x53a501[_0x13d19e(0x240)]}:{},..._0x53a501?.[_0x13d19e(0x286)]?{'summary':_0x53a501[_0x13d19e(0x286)]}:{},'tableList':Array[_0x13d19e(0x208)](_0x53a501?.[_0x13d19e(0x238)])?_0x53a501['tableList']:[]};}export async function startDbTableDiffRefresh(_0x900a51,_0x1a4ffc){const _0x3a14dc=a219_0x1f8ad5,_0x27e70c=await apiRequest(_0x3a14dc(0x23a)+buildQuery({'appCode':_0x900a51,'dbLinkId':_0x1a4ffc}),{'method':_0x3a14dc(0x21f)});return _0x27e70c[_0x3a14dc(0x244)];}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x4aa0ba=a219_0x1f8ad5,_0x285b9f=await apiRequest(_0x4aa0ba(0x29a),{'method':'POST','body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0xad3304=extractList(_0x285b9f[_0x4aa0ba(0x244)]),_0x8fcf1f=extractPaging(_0x285b9f[_0x4aa0ba(0x244)]);return _0x8fcf1f&&_0x8fcf1f[_0x4aa0ba(0x2ab)]>REMOTE_APP_PAGE_SIZE&&console[_0x4aa0ba(0x1d6)](_0x4aa0ba(0x21e)+REMOTE_APP_PAGE_SIZE+_0x4aa0ba(0x23b)+_0x8fcf1f[_0x4aa0ba(0x2ab)]+'\x20apps.\x20'+_0x4aa0ba(0x2a3)),_0xad3304;}const APP_ROLE_PAGE_SIZE_MAX=0x64;export async function listAppRoles(_0x392536,_0x43a05b){const _0x2cb6e1=a219_0x1f8ad5,_0x2c3335=Math['min'](Math['max'](_0x43a05b?.[_0x2cb6e1(0x23e)]??APP_ROLE_PAGE_SIZE_MAX,0x1),APP_ROLE_PAGE_SIZE_MAX),_0xe3634d=await apiRequest(_0x2cb6e1(0x281),{'method':_0x2cb6e1(0x21f),'body':{'appCode':_0x392536,'currentPage':_0x43a05b?.[_0x2cb6e1(0x1c1)]??0x1,'pageSize':_0x2c3335}});return{'items':extractList(_0xe3634d['data']),'paging':extractPaging(_0xe3634d[_0x2cb6e1(0x244)])};}export async function updateAppRole(_0xf8d78c){const _0x3ec4be=a219_0x1f8ad5,_0x3cad63=await apiRequest('/smartapi/permit/role/update',{'method':'POST','body':{'id':_0xf8d78c['id'],'appCode':_0xf8d78c[_0x3ec4be(0x1dd)],..._0xf8d78c['roleName']!==undefined?{'roleName':_0xf8d78c[_0x3ec4be(0x258)]}:{},..._0xf8d78c[_0x3ec4be(0x2ae)]!==undefined?{'remark':_0xf8d78c[_0x3ec4be(0x2ae)]}:{}}});return _0x3cad63[_0x3ec4be(0x244)];}function a219_0x2e18(_0x35b387,_0x13fc92){_0x35b387=_0x35b387-0x19b;const _0x2d03d5=a219_0x2d03();let _0x2e188f=_0x2d03d5[_0x35b387];return _0x2e188f;}export async function deleteAppRole(_0x40258b){const _0xa12b41=a219_0x1f8ad5;await apiRequest(_0xa12b41(0x1d8),{'method':_0xa12b41(0x21f),'body':{'id':_0x40258b}});}export async function listRoleUsers(_0x3f674f){const _0x1f7d62=a219_0x1f8ad5,_0x3bbfa9=await apiRequest('/smartapi/permit/user-role/get-user-list',{'method':_0x1f7d62(0x21f),'body':{'appCode':_0x3f674f}});return extractList(_0x3bbfa9['data'])[_0x1f7d62(0x2b2)](({id:_0x40ac7c,userList:_0x48bd9e,applyUserList:_0xe10189,..._0x2a1737})=>({..._0x2a1737,'id':Number(_0x40ac7c),'userList':_0x48bd9e['map'](_0x377457=>({..._0x377457,'userId':Number(_0x377457[_0x1f7d62(0x209)])})),..._0xe10189?{'applyUserList':_0xe10189[_0x1f7d62(0x2b2)](_0x43abb9=>({..._0x43abb9,'userId':Number(_0x43abb9[_0x1f7d62(0x209)])}))}:{}}));}export async function listDevUserRoleRelations(_0x3d7cd5,_0x3f0729){const _0x5f2e89=a219_0x1f8ad5,_0x3089fc=Math['min'](Math['max'](_0x3f0729?.[_0x5f2e89(0x23e)]??0x64,0x1),0x64),_0x378d26=await apiRequest('/smartapi/permit/user-role/get-list',{'method':_0x5f2e89(0x21f),'body':{'appCode':_0x3d7cd5,..._0x3f0729?.[_0x5f2e89(0x209)]!==undefined?{'userId':_0x3f0729[_0x5f2e89(0x209)]}:{},..._0x3f0729?.['roleId']!==undefined?{'roleId':_0x3f0729[_0x5f2e89(0x1b6)]}:{},..._0x3f0729?.[_0x5f2e89(0x24b)]!==undefined?{'roleType':_0x3f0729[_0x5f2e89(0x24b)]}:{},'currentPage':_0x3f0729?.[_0x5f2e89(0x1c1)]??0x1,'pageSize':_0x3089fc}}),_0x3bc60b=extractList(_0x378d26[_0x5f2e89(0x244)])[_0x5f2e89(0x2b2)](_0x329f38=>({..._0x329f38,'id':Number(_0x329f38['id']),'userId':Number(_0x329f38[_0x5f2e89(0x209)]),'roleId':Number(_0x329f38[_0x5f2e89(0x1b6)])}));return{'items':_0x3bc60b,'paging':extractPaging(_0x378d26[_0x5f2e89(0x244)])};}export async function createDevUserRole(_0x4e7d01){const _0x2fa266=a219_0x1f8ad5,_0x1bd0c5=await apiRequest(_0x2fa266(0x1b4),{'method':'POST','body':_0x4e7d01});return{..._0x1bd0c5['data'],'id':Number(_0x1bd0c5[_0x2fa266(0x244)]['id']),'userId':Number(_0x1bd0c5[_0x2fa266(0x244)][_0x2fa266(0x209)]),'roleId':Number(_0x1bd0c5[_0x2fa266(0x244)][_0x2fa266(0x1b6)])};}export async function deleteDevUserRole(_0x5fd089){const _0x27a4c1=a219_0x1f8ad5,_0x1bc05e=await apiRequest(_0x27a4c1(0x1a7),{'method':_0x27a4c1(0x21f),'body':{'id':_0x5fd089}});return _0x1bc05e[_0x27a4c1(0x244)];}export async function listCurrentUserTenantMemberships(){const _0x536d16=a219_0x1f8ad5,_0x22fde4=await apiRequest(_0x536d16(0x1f2));return extractList(_0x22fde4[_0x536d16(0x244)]);}export async function listTenantDirectoryMembers(_0x4e5550){const _0x2c36ad=a219_0x1f8ad5,_0x4c4bd5=await apiRequest('/userTenant/getByTenantCode'+buildQuery({'code':_0x4e5550})),_0x24a731=_0x4c4bd5['data']?.['userTenantRelationList'];return Array[_0x2c36ad(0x208)](_0x24a731)?_0x24a731:[];}export async function getTenantMembers(_0x393f76){const _0x49a3ae=a219_0x1f8ad5,_0x27c7ef=await listTenantDirectoryMembers(_0x393f76);return _0x27c7ef[_0x49a3ae(0x1de)](_0x155be0=>_0x155be0[_0x49a3ae(0x1fd)]===_0x49a3ae(0x257)||_0x155be0['status']===undefined)[_0x49a3ae(0x2b2)](_0x22e79c=>({'userId':Number(_0x22e79c[_0x49a3ae(0x209)]??_0x22e79c['id']),'username':_0x22e79c['username'],'nickname':_0x22e79c[_0x49a3ae(0x212)],'status':_0x22e79c[_0x49a3ae(0x1fd)],'email':_0x22e79c['email'],'mobile':_0x22e79c['mobile'],'avatar':_0x22e79c['avatar']}))['filter'](_0x4dffa9=>Number[_0x49a3ae(0x1fc)](_0x4dffa9[_0x49a3ae(0x209)])&&_0x4dffa9['userId']>0x0);}
|
package/lib/core/bff/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a220_0xaf2c66=a220_0xe251;(function(_0x1b0524,_0x49c881){const _0x1f2e09=a220_0xe251,_0x5569a4=_0x1b0524();while(!![]){try{const _0x3d0478=-parseInt(_0x1f2e09(0x1fa))/0x1*(parseInt(_0x1f2e09(0x1f9))/0x2)+-parseInt(_0x1f2e09(0x1f8))/0x3*(-parseInt(_0x1f2e09(0x1f4))/0x4)+-parseInt(_0x1f2e09(0x1f3))/0x5*(-parseInt(_0x1f2e09(0x1f6))/0x6)+parseInt(_0x1f2e09(0x1ff))/0x7+-parseInt(_0x1f2e09(0x1fd))/0x8*(parseInt(_0x1f2e09(0x1f5))/0x9)+parseInt(_0x1f2e09(0x1f7))/0xa*(parseInt(_0x1f2e09(0x1f0))/0xb)+parseInt(_0x1f2e09(0x1fb))/0xc*(-parseInt(_0x1f2e09(0x1fc))/0xd);if(_0x3d0478===_0x49c881)break;else _0x5569a4['push'](_0x5569a4['shift']());}catch(_0x50d62a){_0x5569a4['push'](_0x5569a4['shift']());}}}(a220_0x4570,0x27800));function a220_0xe251(_0x5d7e1a,_0x114c4c){_0x5d7e1a=_0x5d7e1a-0x1f0;const _0x45700d=a220_0x4570();let _0xe2512d=_0x45700d[_0x5d7e1a];return _0xe2512d;}import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';function a220_0x4570(){const _0x1e3689=['9714bpqgVa','36280pdiXqI','3ypUHiA','2SdiVCb','158633BgIPKA','12bSLiQN','1621191zDiDre','1153928IaSxnW','/bff','444794bJUgNX','341oCVETU','bff.lock.json','bff','820fQOhlj','591388fxtfWP','9jYJxTY'];a220_0x4570=function(){return _0x1e3689;};return a220_0x4570();}const DOT_DIR='.rabetbase',LOCK_FILE_NAME=a220_0xaf2c66(0x1f1),TRASH_DIR_NAME='bff-trash';export function loadBffProjectConfig(_0x54e4d7,_0x4ae14e){const _0x110c2c=a220_0xaf2c66,_0xe5205e=resolve(_0x4ae14e??findProjectRootDirectory()),_0x11d84c=DOT_DIR+_0x110c2c(0x1fe),_0x3f6731=_0x11d84c+'/'+_0x54e4d7;return{'projectRoot':_0xe5205e,'appCode':_0x54e4d7,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x11d84c,'scriptsRoot':_0x3f6731,'scriptsRootDir':resolve(_0xe5205e,DOT_DIR,_0x110c2c(0x1f2),_0x54e4d7),'lockFilePath':resolve(_0xe5205e,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0xe5205e,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.
|