@lovrabet/rabetbase-cli 2.4.5 → 2.4.6-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- 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.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/dataset/business-groups.js +1 -1
- 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.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/{standard-page-status.d.ts → create.d.ts} +1 -1
- package/lib/commands/page/create.js +1 -0
- package/lib/commands/page/{react → custom}/detail.d.ts +1 -1
- package/lib/commands/page/custom/detail.js +1 -0
- package/lib/commands/page/{react → custom}/list.d.ts +1 -1
- package/lib/commands/page/custom/list.js +1 -0
- package/lib/commands/page/{react → custom}/publish.d.ts +1 -1
- package/lib/commands/page/custom/publish.js +1 -0
- package/lib/commands/page/{react → custom}/shared.d.ts +15 -15
- package/lib/commands/page/custom/shared.js +1 -0
- package/lib/commands/page/{react → custom}/syntax.d.ts +2 -2
- package/lib/commands/page/custom/syntax.js +1 -0
- package/lib/commands/page/custom/template.js +1 -0
- package/lib/commands/page/{react → custom}/update.d.ts +1 -1
- package/lib/commands/page/custom/update.js +1 -0
- package/lib/commands/page/data-list-status.d.ts +2 -0
- package/lib/commands/page/data-list-status.js +1 -0
- 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/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.d.ts +18 -18
- package/lib/commands/page/shared.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.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 +43 -43
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- 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.d.ts +3 -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 +34 -34
- package/skills/rabetbase/guides/backend-function.md +63 -18
- package/skills/rabetbase/guides/bff-creation-workflow.md +2 -0
- package/skills/rabetbase/guides/{react-custom-page-workflow.md → custom-page-workflow.md} +45 -45
- package/skills/rabetbase/guides/page-development-workflow.md +22 -22
- package/skills/rabetbase/knowledge/{react-page → custom-page}/components.md +2 -2
- package/skills/rabetbase/knowledge/{react-page → custom-page}/generation-standards.md +6 -6
- package/skills/rabetbase/knowledge/page-schema/LrSmartTable.md +6 -6
- package/skills/rabetbase/knowledge/page-schema/external-resources-usage.md +1 -1
- package/skills/rabetbase/references/rabetbase-bff-create.md +2 -0
- package/skills/rabetbase/references/{rabetbase-standard-page-status.md → rabetbase-data-list-status.md} +6 -6
- package/skills/rabetbase/references/rabetbase-dataset-generate.md +1 -1
- package/skills/rabetbase/references/rabetbase-dataset-relation-mutations.md +1 -1
- package/skills/rabetbase/references/rabetbase-dataset-relations.md +1 -1
- package/skills/rabetbase/references/rabetbase-dataset-restore.md +1 -1
- package/skills/rabetbase/references/rabetbase-menu-list.md +1 -1
- package/skills/rabetbase/references/rabetbase-page-create.md +31 -0
- package/skills/rabetbase/references/{rabetbase-page-react-detail.md → rabetbase-page-custom-detail.md} +5 -5
- package/skills/rabetbase/references/{rabetbase-page-react-list.md → rabetbase-page-custom-list.md} +4 -4
- package/skills/rabetbase/references/{rabetbase-page-react-publish.md → rabetbase-page-custom-publish.md} +6 -6
- package/skills/rabetbase/references/{rabetbase-page-react-update.md → rabetbase-page-custom-update.md} +6 -6
- package/skills/rabetbase/references/rabetbase-page-generate-start.md +5 -4
- package/skills/rabetbase/references/rabetbase-page-generate-status.md +4 -4
- package/skills/rabetbase/references/rabetbase-page-pull.md +2 -2
- package/skills/rabetbase/references/rabetbase-page-relation-binding.md +1 -1
- package/skills/rabetbase/references/rabetbase-page-restore.md +7 -7
- package/skills/rabetbase/references/rabetbase-page-sync.md +3 -3
- package/skills/rabetbase.manifest.json +12 -12
- package/lib/commands/page/react/create.d.ts +0 -2
- package/lib/commands/page/react/create.js +0 -1
- package/lib/commands/page/react/detail.js +0 -1
- package/lib/commands/page/react/list.js +0 -1
- package/lib/commands/page/react/publish.js +0 -1
- package/lib/commands/page/react/shared.js +0 -1
- package/lib/commands/page/react/syntax.js +0 -1
- package/lib/commands/page/react/template.js +0 -1
- package/lib/commands/page/react/update.js +0 -1
- package/lib/commands/page/standard-page-status.js +0 -1
- package/skills/rabetbase/references/rabetbase-page-react-create.md +0 -29
- /package/lib/commands/page/{react → custom}/template.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a142_0x1f4bb7=a142_0x1b26;(function(_0x2c10b1,_0x473edb){const _0x56e948=a142_0x1b26,_0x47133f=_0x2c10b1();while(!![]){try{const _0x34b5d2=parseInt(_0x56e948(0xb5))/0x1*(-parseInt(_0x56e948(0x7d))/0x2)+-parseInt(_0x56e948(0x7f))/0x3+parseInt(_0x56e948(0xac))/0x4+parseInt(_0x56e948(0xb3))/0x5+-parseInt(_0x56e948(0x79))/0x6*(-parseInt(_0x56e948(0x8f))/0x7)+parseInt(_0x56e948(0x9e))/0x8+parseInt(_0x56e948(0x97))/0x9*(-parseInt(_0x56e948(0x7a))/0xa);if(_0x34b5d2===_0x473edb)break;else _0x47133f['push'](_0x47133f['shift']());}catch(_0x1f5024){_0x47133f['push'](_0x47133f['shift']());}}}(a142_0x2fd0,0x3bd0c));import{APPCODE_FLAG}from'../../commands/common/flags.js';import{buildInitialFiles}from'../../commands/page/custom/template.js';import{createCustomPage,getI18nInfo}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{buildCustomPageDevelopmentUrl,buildCustomPageEditUrl,parseCustomPageContent,validateCustomPageContent}from'./custom/shared.js';const DEFAULT_CUSTOM_PAGE_LANGUAGES=[a142_0x1f4bb7(0xab),a142_0x1f4bb7(0x9f)];export const pageCreate={'service':a142_0x1f4bb7(0x83),'command':a142_0x1f4bb7(0x85),'description':a142_0x1f4bb7(0x78),'risk':a142_0x1f4bb7(0x94),'defaultOutputFormat':'compress','structuredErrors':!![],'rejectedFlags':[{'name':a142_0x1f4bb7(0xad),'message':a142_0x1f4bb7(0xa7),'hint':'This\x20command\x20always\x20creates\x20a\x20CUSTOM\x20JSX\x20page;\x20use\x20--page-pattern\x20BLANK\x20or\x20--page-content.'}],'flags':[{'name':a142_0x1f4bb7(0x87),'type':a142_0x1f4bb7(0xa0),'description':'Optional\x20Custom\x20Page\x20name\x20(1-100\x20characters)'},{'name':'parent-menu-id','type':a142_0x1f4bb7(0x86),'description':a142_0x1f4bb7(0x9b)},{'name':a142_0x1f4bb7(0x8b),'type':a142_0x1f4bb7(0xa0),'description':a142_0x1f4bb7(0x98),'enum':[a142_0x1f4bb7(0x8a)]},{'name':a142_0x1f4bb7(0x7e),'type':'string','description':a142_0x1f4bb7(0xb4)},APPCODE_FLAG],async 'validate'(_0x33e5bc){const _0x497b9b=a142_0x1f4bb7,_0xfb79a5=readPagePattern(_0x33e5bc);await validateCustomPageContent(readInput(_0x33e5bc,DEFAULT_CUSTOM_PAGE_LANGUAGES,_0xfb79a5)[_0x497b9b(0x80)]);},async 'dryRun'(_0xe76fbc){const _0x2b3877=a142_0x1f4bb7,{input:_0xbf9bb4}=await prepare(_0xe76fbc);return{'method':_0x2b3877(0x8d),'url':_0x2b3877(0xb2),'body':{'appCode':_0xbf9bb4[_0x2b3877(0x84)],'pageName':_0xbf9bb4[_0x2b3877(0xa6)],..._0xbf9bb4[_0x2b3877(0x99)]!=null?{'parentMenuId':_0xbf9bb4[_0x2b3877(0x99)]}:{},'createMenu':_0xbf9bb4['createMenu'],'codeContent':_0xbf9bb4[_0x2b3877(0x80)]},'description':_0x2b3877(0x95)+JSON[_0x2b3877(0xa4)](_0xbf9bb4[_0x2b3877(0xa6)])+_0x2b3877(0x8c)};},async 'execute'(_0xfccd46){const _0x39147f=a142_0x1f4bb7,_0x28f292=await prepare(_0xfccd46),_0x44bff2=await createCustomPage(_0x28f292[_0x39147f(0xb0)]);if(!Number[_0x39147f(0xa3)](_0x44bff2[_0x39147f(0x81)])||_0x44bff2[_0x39147f(0x81)]<=0x0)throw CliErrors['apiError'](_0x39147f(0x89));return{'ok':!![],'data':buildMutationData(_0x28f292,_0x44bff2),'message':_0x39147f(0x9d)+_0x44bff2['pageId']+'.'};}};async function prepare(_0xdff2b8){const _0x4bcddd=a142_0x1f4bb7,_0x21a8d5=readPagePattern(_0xdff2b8);if(_0x21a8d5===null)return{'input':readInput(_0xdff2b8,DEFAULT_CUSTOM_PAGE_LANGUAGES,_0x21a8d5),'warnings':[],'pagePattern':_0x21a8d5};let _0x2f6eee=DEFAULT_CUSTOM_PAGE_LANGUAGES,_0x372eec=[];try{const _0x4d77bc=await getI18nInfo(_0xdff2b8[_0x4bcddd(0x84)]);_0x4d77bc[_0x4bcddd(0xa5)]&&_0x4d77bc[_0x4bcddd(0x92)]?.[_0x4bcddd(0x91)]&&(_0x2f6eee=_0x4d77bc[_0x4bcddd(0x92)]);}catch{_0x372eec=[_0x4bcddd(0xa1)];}return{'input':readInput(_0xdff2b8,_0x2f6eee,_0x21a8d5),'warnings':_0x372eec,'pagePattern':_0x21a8d5};}function readPagePattern(_0x57d988){const _0x13f067=a142_0x1f4bb7,_0x4be23f=_0x57d988[_0x13f067(0x82)](_0x13f067(0x8b))['trim'](),_0x4d386c=_0x57d988['str']('page-content')[_0x13f067(0xae)]()[_0x13f067(0x91)]>0x0;if(_0x4be23f&&_0x4d386c)throw CliErrors[_0x13f067(0x7c)](_0x13f067(0x9a));if(_0x4d386c)return null;if(!_0x4be23f)throw CliErrors[_0x13f067(0x7c)](_0x13f067(0xaf));if(_0x4be23f!==_0x13f067(0x8a))throw CliErrors[_0x13f067(0x7c)](_0x13f067(0x9c));return _0x4be23f;}function readInput(_0x463f44,_0x5eea43=DEFAULT_CUSTOM_PAGE_LANGUAGES,_0x40cedd=readPagePattern(_0x463f44)){const _0x36a08d=a142_0x1f4bb7,_0x44d1a4=_0x463f44[_0x36a08d(0x82)](_0x36a08d(0x87))[_0x36a08d(0xae)]()||_0x36a08d(0xb6)+Date[_0x36a08d(0x8e)]();if(_0x44d1a4[_0x36a08d(0x91)]>0x64)throw CliErrors[_0x36a08d(0x7c)]('pageName\x20cannot\x20exceed\x20100\x20characters.');const _0x18ab1a=_0x463f44[_0x36a08d(0x7b)](_0x36a08d(0xa8),NaN),_0x1ea454=!Number['isNaN'](_0x18ab1a);if(_0x1ea454&&(!Number['isInteger'](_0x18ab1a)||_0x18ab1a<=0x0))throw CliErrors[_0x36a08d(0x7c)](_0x36a08d(0x88));return{'appCode':_0x463f44['appCode'],'pageName':_0x44d1a4,..._0x1ea454?{'parentMenuId':_0x18ab1a}:{},'createMenu':!![],'files':_0x40cedd===null?parseCustomPageContent(_0x463f44[_0x36a08d(0x82)](_0x36a08d(0x7e))):buildInitialFiles(_0x44d1a4,_0x5eea43)};}function a142_0x2fd0(){const _0x2eaaaa=['Provide\x20--page-pattern\x20BLANK\x20or\x20--page-content.','input','Custom\x20Page\x20was\x20created,\x20but\x20a\x20link\x20to\x20its\x20latest\x20saved\x20content\x20could\x20not\x20be\x20generated.','/smartapi/webcode/page/create','2374265qGrTBY','Complete\x20page\x20files\x20as\x20JSON\x20(conflicts\x20with\x20--page-pattern)','172091gQUFEJ','自定义页面_','Create\x20a\x20JSX\x20Custom\x20Page\x20from\x20a\x20released\x20pattern\x20or\x20complete\x20files','6tlTAdD','5230BZRNsQ','num','validation','4JOIhZa','page-content','1122855GraqTc','files','pageId','str','page','appCode','create','number','name','--parent-menu-id\x20must\x20be\x20a\x20positive\x20integer.','Custom\x20Page\x20creation\x20did\x20not\x20return\x20a\x20valid\x20pageId.','BLANK','page-pattern','\x20and\x20its\x20menu\x20entry.','POST','now','3361239QpZzOa','page.create','length','langs','CUSTOM','write','Would\x20create\x20Custom\x20Page\x20','warnings','11727xoqzhx','Custom\x20Page\x20pattern\x20(currently\x20BLANK;\x20conflicts\x20with\x20--page-content)','parentMenuId','--page-pattern\x20and\x20--page-content\x20cannot\x20be\x20used\x20together.','Optional\x20parent\x20menu\x20id\x20when\x20creating\x20a\x20menu\x20entry','--page-pattern\x20currently\x20supports\x20only\x20BLANK.','Created\x20Custom\x20Page\x20','2796648FoLVzu','en-US','string','Application\x20language\x20settings\x20could\x20not\x20be\x20read;\x20default\x20Chinese\x20and\x20English\x20language\x20files\x20were\x20generated.','pagePattern','isInteger','stringify','enableI18n','pageName','page\x20create\x20does\x20not\x20accept\x20--page-type.','parent-menu-id','menuId','menuPath','zh-CN','1361316KGzdte','page-type','trim'];a142_0x2fd0=function(){return _0x2eaaaa;};return a142_0x2fd0();}function a142_0x1b26(_0xc36752,_0x56a908){_0xc36752=_0xc36752-0x78;const _0x2fd081=a142_0x2fd0();let _0x1b2620=_0x2fd081[_0xc36752];return _0x1b2620;}function buildMutationData(_0x515c3c,_0x27d303){const _0x38c98a=a142_0x1f4bb7,{input:_0x4d9bb4}=_0x515c3c,_0x41e936=_0x27d303&&buildCustomPageDevelopmentUrl(_0x4d9bb4[_0x38c98a(0x84)],_0x27d303[_0x38c98a(0xaa)]),_0x399cb3=_0x27d303&&buildCustomPageEditUrl(_0x4d9bb4[_0x38c98a(0x84)],_0x27d303['pageId']);return{'operation':_0x38c98a(0x90),'pageType':_0x38c98a(0x93),'pagePattern':_0x515c3c[_0x38c98a(0xa2)],'selector':{'appCode':_0x4d9bb4[_0x38c98a(0x84)],'pageName':_0x4d9bb4[_0x38c98a(0xa6)]},'before':null,'after':{'pageId':_0x27d303?.[_0x38c98a(0x81)]??null,'pageName':_0x27d303?.[_0x38c98a(0xa6)]??_0x4d9bb4[_0x38c98a(0xa6)],'appCode':_0x27d303?.[_0x38c98a(0x84)]??_0x4d9bb4[_0x38c98a(0x84)],'version':_0x27d303?.['version']??null,'menuId':_0x27d303?.[_0x38c98a(0xa9)]??null,'menuPath':_0x27d303?.[_0x38c98a(0xaa)]??null,'files':_0x27d303?.[_0x38c98a(0x80)]??Object['keys'](_0x4d9bb4['files'])},'dryRun':_0x27d303===undefined,'request':_0x4d9bb4,..._0x41e936?{'pageUrl':_0x41e936}:{},..._0x399cb3?{'editPageUrl':_0x399cb3}:{},'warnings':[..._0x515c3c[_0x38c98a(0x96)],..._0x27d303&&!_0x41e936?[_0x38c98a(0xb1)]:[]]};}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { CommandDefinition } from "../../../framework/types.js";
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const pageCustomDetail: CommandDefinition;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a143_0x4e64f8=a143_0x2cfe;(function(_0x2ea529,_0x4698bf){const _0x5e9e94=a143_0x2cfe,_0x557a1a=_0x2ea529();while(!![]){try{const _0x48ac9f=parseInt(_0x5e9e94(0x1c8))/0x1*(-parseInt(_0x5e9e94(0x1b7))/0x2)+parseInt(_0x5e9e94(0x1c1))/0x3+-parseInt(_0x5e9e94(0x1b9))/0x4*(parseInt(_0x5e9e94(0x1ce))/0x5)+-parseInt(_0x5e9e94(0x1b5))/0x6+parseInt(_0x5e9e94(0x1c0))/0x7*(parseInt(_0x5e9e94(0x1bf))/0x8)+parseInt(_0x5e9e94(0x1b6))/0x9+-parseInt(_0x5e9e94(0x1bd))/0xa*(-parseInt(_0x5e9e94(0x1c6))/0xb);if(_0x48ac9f===_0x4698bf)break;else _0x557a1a['push'](_0x557a1a['shift']());}catch(_0x4ccf79){_0x557a1a['push'](_0x557a1a['shift']());}}}(a143_0x1925,0x66645));import{getCustomPageSource}from'../../../core/api-client.js';import{buildCustomPageEditUrl,buildCustomPageRuntimeUrl,readCustomPageId,CUSTOM_PAGE_APPCODE_FLAG_OPTIONAL,resolveCustomPageDevelopmentUrl}from'./shared.js';export const pageCustomDetail={'service':a143_0x4e64f8(0x1bc),'command':a143_0x4e64f8(0x1cc),'description':a143_0x4e64f8(0x1c2),'risk':a143_0x4e64f8(0x1ca),'defaultOutputFormat':a143_0x4e64f8(0x1cf),'structuredErrors':!![],'requiresAppCode':![],'flags':[{'name':'id','type':a143_0x4e64f8(0x1cd),'required':!![],'description':'Custom\x20Page\x20ID'},CUSTOM_PAGE_APPCODE_FLAG_OPTIONAL],async 'validate'(_0x1ec64a){readCustomPageId(_0x1ec64a);},async 'execute'(_0x16c32b){const _0x3dfe11=a143_0x4e64f8,_0x50c48b=readCustomPageId(_0x16c32b),_0x1957d7=await getCustomPageSource(_0x50c48b),{bundle:_0x3cc1e4,createTime:_0x3dcb2e,updateTime:_0xeaee15,..._0xc707f4}=_0x1957d7,_0x2f4b07=_0x1957d7['id']??_0x50c48b,_0x5c7f94=_0x1957d7[_0x3dfe11(0x1b8)]?.['trim']()||_0x16c32b[_0x3dfe11(0x1be)]('appcode')['trim'](),_0x384825=buildCustomPageRuntimeUrl(_0x5c7f94,_0x1957d7[_0x3dfe11(0x1cb)]),_0x1b8fc7=buildCustomPageEditUrl(_0x5c7f94,_0x2f4b07),_0x2c5b67=await resolveCustomPageDevelopmentUrl(_0x5c7f94,_0x2f4b07,_0x16c32b['cookie']);return{'ok':!![],'data':{..._0xc707f4,..._0x384825?{'runtimePageUrl':_0x384825}:{},..._0x2c5b67?{'pageUrl':_0x2c5b67}:{},..._0x1b8fc7?{'editPageUrl':_0x1b8fc7}:{},..._0x3dcb2e==null?{}:{'createTime':formatTime(_0x3dcb2e)},..._0xeaee15==null?{}:{'updateTime':formatTime(_0xeaee15)}},'message':_0x3dfe11(0x1c7)+_0x50c48b+'.'};}};function a143_0x1925(){const _0x50e7d9=['4962744xjqFXJ','3480219mTwNLC','800302xmrHKD','appCode','4jqGKcy','isNaN','getMinutes','page','402870kkxXIG','str','3188872NHSOGX','7fsNokN','1374555oChXdG','Show\x20a\x20Custom\x20Page\x20and\x20all\x20of\x20its\x20files','join','getTime','padStart','242QbPzGd','Retrieved\x20Custom\x20Page\x20','1FAQcOH','getFullYear','read','pageCode','custom-detail','number','2415635CohKsT','compress'];a143_0x1925=function(){return _0x50e7d9;};return a143_0x1925();}function a143_0x2cfe(_0x505184,_0x54441a){_0x505184=_0x505184-0x1b5;const _0x1925cd=a143_0x1925();let _0x2cfe7c=_0x1925cd[_0x505184];return _0x2cfe7c;}function formatTime(_0x235da6){const _0x56ac04=a143_0x4e64f8,_0x3aec81=new Date(_0x235da6);if(Number[_0x56ac04(0x1ba)](_0x3aec81[_0x56ac04(0x1c4)]()))return String(_0x235da6);const _0x190338=[_0x3aec81[_0x56ac04(0x1c9)](),String(_0x3aec81['getMonth']()+0x1)[_0x56ac04(0x1c5)](0x2,'0'),String(_0x3aec81['getDate']())[_0x56ac04(0x1c5)](0x2,'0')]['join']('-'),_0x31eb10=[String(_0x3aec81['getHours']())['padStart'](0x2,'0'),String(_0x3aec81[_0x56ac04(0x1bb)]())[_0x56ac04(0x1c5)](0x2,'0'),String(_0x3aec81['getSeconds']())[_0x56ac04(0x1c5)](0x2,'0')][_0x56ac04(0x1c3)](':');return _0x190338+'\x20'+_0x31eb10;}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { CommandDefinition } from "../../../framework/types.js";
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const pageCustomList: CommandDefinition;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a144_0x2b28e2=a144_0x5138;(function(_0x444570,_0x228af2){const _0x3c3d7f=a144_0x5138,_0x4ce8ab=_0x444570();while(!![]){try{const _0x2f8547=parseInt(_0x3c3d7f(0x7e))/0x1+parseInt(_0x3c3d7f(0x75))/0x2+-parseInt(_0x3c3d7f(0x89))/0x3+-parseInt(_0x3c3d7f(0x84))/0x4+-parseInt(_0x3c3d7f(0x7b))/0x5+parseInt(_0x3c3d7f(0x7f))/0x6*(parseInt(_0x3c3d7f(0x82))/0x7)+-parseInt(_0x3c3d7f(0x8b))/0x8;if(_0x2f8547===_0x228af2)break;else _0x4ce8ab['push'](_0x4ce8ab['shift']());}catch(_0x3b597f){_0x4ce8ab['push'](_0x4ce8ab['shift']());}}}(a144_0x248e,0x88483));import{APPCODE_FLAG}from'../../../commands/common/flags.js';import{fetchMenuSnapshot}from'../../../commands/menu/shared/facts.js';import{buildCustomPageDevelopmentUrl,buildCustomPageEditUrl}from'./shared.js';function a144_0x5138(_0x412b50,_0x3ba6da){_0x412b50=_0x412b50-0x75;const _0x248ef4=a144_0x248e();let _0x5138e0=_0x248ef4[_0x412b50];return _0x5138e0;}export const pageCustomList={'service':a144_0x2b28e2(0x86),'command':a144_0x2b28e2(0x78),'description':'List\x20Custom\x20Pages\x20in\x20the\x20current\x20app','risk':a144_0x2b28e2(0x79),'defaultOutputFormat':a144_0x2b28e2(0x88),'structuredErrors':!![],'flags':[APPCODE_FLAG],async 'execute'(_0x1dc427){const _0x50a16b=a144_0x2b28e2,_0x1f5ae4=(await fetchMenuSnapshot(_0x1dc427[_0x50a16b(0x87)],_0x1dc427[_0x50a16b(0x80)]))['menus'][_0x50a16b(0x7d)](_0x342e7a=>{const _0x451735=_0x50a16b;if(_0x342e7a['type']!==_0x451735(0x8a)||_0x342e7a[_0x451735(0x81)]==null)return[];const _0x198ffb=buildCustomPageDevelopmentUrl(_0x1dc427['appCode'],_0x342e7a[_0x451735(0x7c)]),_0x4cedcc=buildCustomPageEditUrl(_0x1dc427[_0x451735(0x87)],_0x342e7a['pageId']);return[{'pageId':_0x342e7a[_0x451735(0x81)],'label':_0x342e7a[_0x451735(0x77)],..._0x198ffb?{'pageUrl':_0x198ffb}:{},..._0x4cedcc?{'editPageUrl':_0x4cedcc}:{}}];});return{'ok':!![],'data':{'pages':_0x1f5ae4},'message':_0x1f5ae4[_0x50a16b(0x7a)]===0x0?_0x50a16b(0x76):_0x50a16b(0x85)+_0x1f5ae4[_0x50a16b(0x7a)]+_0x50a16b(0x83)};}};function a144_0x248e(){const _0x4814b4=['No\x20Custom\x20Pages\x20found.','label','custom-list','read','length','1419185GftfWJ','path','flatMap','279315NuPZqP','408LpuSab','cookie','pageId','110194uNgfZh','\x20Custom\x20Page(s).','277000CYkAJW','Found\x20','page','appCode','compress','1505214wAKzZU','react','7306384GKRHRs','1953126rhYkoV'];a144_0x248e=function(){return _0x4814b4;};return a144_0x248e();}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { CommandDefinition } from "../../../framework/types.js";
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const pageCustomPublish: CommandDefinition;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a145_0x27c7(_0x558aa1,_0x1889b2){_0x558aa1=_0x558aa1-0xa3;const _0x198fed=a145_0x198f();let _0x27c70a=_0x198fed[_0x558aa1];return _0x27c70a;}const a145_0xe612b=a145_0x27c7;(function(_0x52b165,_0x3d3c6b){const _0x5236ed=a145_0x27c7,_0x5a4b0c=_0x52b165();while(!![]){try{const _0x33a098=parseInt(_0x5236ed(0xaf))/0x1*(parseInt(_0x5236ed(0xad))/0x2)+parseInt(_0x5236ed(0xb2))/0x3*(parseInt(_0x5236ed(0xa8))/0x4)+parseInt(_0x5236ed(0xae))/0x5+parseInt(_0x5236ed(0xb6))/0x6+-parseInt(_0x5236ed(0xb0))/0x7*(parseInt(_0x5236ed(0xc9))/0x8)+-parseInt(_0x5236ed(0xc0))/0x9*(parseInt(_0x5236ed(0xbe))/0xa)+-parseInt(_0x5236ed(0xbb))/0xb*(parseInt(_0x5236ed(0xac))/0xc);if(_0x33a098===_0x3d3c6b)break;else _0x5a4b0c['push'](_0x5a4b0c['shift']());}catch(_0x5e0a39){_0x5a4b0c['push'](_0x5a4b0c['shift']());}}}(a145_0x198f,0x42726));import{getCustomPageSource,publishCustomPage}from'../../../core/api-client.js';function a145_0x198f(){const _0x4a030d=['Published\x20successfully,\x20but\x20a\x20link\x20to\x20the\x20published\x20page\x20could\x20not\x20be\x20generated.','FORMAL','20AFUXWX','Publish\x20the\x20latest\x20saved\x20content\x20of\x20a\x20Custom\x20Page','number','status','1644FsCpiW','2Oudehn','1127370VyNjmw','106627CfsRVu','77VtGBoc','/smartapi/webcode/file/publish','115881JxlLXq','remark','page','Published\x20Custom\x20Page\x20','1956198pfeKJj','Custom\x20Page\x20publish\x20did\x20not\x20return\x20the\x20expected\x20page\x20ID.','Published\x20successfully,\x20but\x20a\x20link\x20to\x20the\x20latest\x20saved\x20content\x20could\x20not\x20be\x20generated.','Custom\x20Page\x20publish\x20did\x20not\x20reach\x20published\x20status:\x20','push','14267cHuChs','write','pageId','55270LOuvoX','str','63TzEKIR','Custom\x20Page\x20ID','custom-publish','appCode','POST','warnings','Optional\x20publish\x20remark','runtimePageUrl','page.custom-publish','263800MbSZLY','unknown','trim','isInteger'];a145_0x198f=function(){return _0x4a030d;};return a145_0x198f();}import{CliErrors}from'../../../errors.js';import{buildCustomPageEditUrl,buildCustomPageRuntimeUrl,readCustomPageId,resolveCustomPageDevelopmentUrl}from'./shared.js';export const pageCustomPublish={'service':a145_0xe612b(0xb4),'command':a145_0xe612b(0xc2),'description':a145_0xe612b(0xa9),'risk':a145_0xe612b(0xbc),'defaultOutputFormat':'compress','structuredErrors':!![],'requiresAppCode':![],'flags':[{'name':'id','type':a145_0xe612b(0xaa),'required':!![],'description':a145_0xe612b(0xc1)},{'name':'remark','type':'string','description':a145_0xe612b(0xc6)}],async 'validate'(_0x1d7806){readCustomPageId(_0x1d7806);},async 'dryRun'(_0x2fdab3){const _0x379923=a145_0xe612b,_0x5222e5=readInput(_0x2fdab3);return{'method':_0x379923(0xc4),'url':_0x379923(0xb1),'body':{'id':_0x5222e5[_0x379923(0xbd)],..._0x5222e5[_0x379923(0xb3)]?{'remark':_0x5222e5[_0x379923(0xb3)]}:{}},'description':'Would\x20publish\x20Custom\x20Page\x20'+_0x5222e5[_0x379923(0xbd)]+'.'};},async 'execute'(_0x4626ce){const _0x511d33=a145_0xe612b,_0x2bbc0a=readInput(_0x4626ce);await getCustomPageSource(_0x2bbc0a['pageId']);const _0x2dba47=await publishCustomPage(_0x2bbc0a);if(!Number[_0x511d33(0xa5)](_0x2dba47)||_0x2dba47!==_0x2bbc0a['pageId'])throw CliErrors['apiError'](_0x511d33(0xb7));const _0x4ce62e=await getCustomPageSource(_0x2bbc0a[_0x511d33(0xbd)]);if(_0x4ce62e[_0x511d33(0xab)]!==_0x511d33(0xa7))throw CliErrors['apiError'](_0x511d33(0xb9)+(_0x4ce62e[_0x511d33(0xab)]??_0x511d33(0xa3))+'.');const _0x248fe8=_0x4ce62e[_0x511d33(0xc3)]?.[_0x511d33(0xa4)](),_0x39eb7e=buildCustomPageEditUrl(_0x248fe8,_0x2bbc0a['pageId']),_0x4155df=await resolveCustomPageDevelopmentUrl(_0x248fe8,_0x2bbc0a[_0x511d33(0xbd)],_0x4626ce['cookie']),_0x17d096=buildMutationData(_0x2bbc0a,!![],_0x4155df,_0x39eb7e);_0x248fe8&&!_0x4155df&&_0x17d096['warnings'][_0x511d33(0xba)](_0x511d33(0xb8));const _0x22d028=buildCustomPageRuntimeUrl(_0x4ce62e['appCode'],_0x4ce62e['pageCode']);return _0x22d028?_0x17d096[_0x511d33(0xc7)]=_0x22d028:_0x17d096[_0x511d33(0xc5)][_0x511d33(0xba)](_0x511d33(0xa6)),{'ok':!![],'data':_0x17d096,'message':_0x511d33(0xb5)+_0x2bbc0a['pageId']+'.'};}};function readInput(_0x53e45a){const _0x6f6715=a145_0xe612b,_0x4ee244=readCustomPageId(_0x53e45a),_0x5660f3=_0x53e45a[_0x6f6715(0xbf)](_0x6f6715(0xb3))['trim']();return{'pageId':_0x4ee244,..._0x5660f3?{'remark':_0x5660f3}:{}};}function buildMutationData(_0x282227,_0x2e85cf=![],_0x4b2fcd,_0x23c059){const _0x23f183=a145_0xe612b;return{'operation':_0x23f183(0xc8),'selector':{'pageId':_0x282227[_0x23f183(0xbd)]},'before':null,'after':{'pageId':_0x282227['pageId'],'status':_0x23f183(0xa7)},'dryRun':!_0x2e85cf,'request':_0x282227,..._0x4b2fcd?{'pageUrl':_0x4b2fcd}:{},..._0x23c059?{'editPageUrl':_0x23c059}:{},'warnings':[]};}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { CommandDefinition } from "../../../framework/types.js";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* 自定义页面命令的上下文类型
|
|
4
4
|
*/
|
|
5
|
-
export type
|
|
5
|
+
export type CustomPageCommandContext = Parameters<NonNullable<CommandDefinition["execute"]>>[0];
|
|
6
6
|
/**
|
|
7
7
|
* 生成页相关命令时可复用的 appCode 可选参数
|
|
8
8
|
*/
|
|
9
|
-
export declare const
|
|
9
|
+
export declare const CUSTOM_PAGE_APPCODE_FLAG_OPTIONAL: {
|
|
10
10
|
description: string;
|
|
11
11
|
name: string;
|
|
12
12
|
type: "string" | "boolean" | "number";
|
|
@@ -27,7 +27,7 @@ export declare const REACT_PAGE_APPCODE_FLAG_OPTIONAL: {
|
|
|
27
27
|
* @param pageCode 页面 code
|
|
28
28
|
* @returns 当前环境下已发布页面地址,任一为空返回 undefined
|
|
29
29
|
*/
|
|
30
|
-
export declare function
|
|
30
|
+
export declare function buildCustomPageRuntimeUrl(appCode: string | undefined, pageCode: string | undefined): string | undefined;
|
|
31
31
|
/**
|
|
32
32
|
* 构建最新保存内容查看地址
|
|
33
33
|
*
|
|
@@ -35,16 +35,16 @@ export declare function buildReactPageRuntimeUrl(appCode: string | undefined, pa
|
|
|
35
35
|
* @param menuPath 页面菜单路径
|
|
36
36
|
* @returns 当前环境最新保存内容查看地址,任一为空返回 undefined
|
|
37
37
|
*/
|
|
38
|
-
export declare function
|
|
38
|
+
export declare function buildCustomPageDevelopmentUrl(appCode: string | undefined, menuPath: string | undefined | null): string | undefined;
|
|
39
39
|
/**
|
|
40
|
-
*
|
|
40
|
+
* 从菜单事实解析自定义页面最新保存内容查看地址
|
|
41
41
|
*
|
|
42
42
|
* @param appCode 应用 code
|
|
43
43
|
* @param pageId 页面 ID
|
|
44
44
|
* @param cookie 当前认证 cookie
|
|
45
|
-
* @returns
|
|
45
|
+
* @returns 找到对应自定义页面菜单时返回最新保存内容查看地址,否则返回 undefined
|
|
46
46
|
*/
|
|
47
|
-
export declare function
|
|
47
|
+
export declare function resolveCustomPageDevelopmentUrl(appCode: string | undefined, pageId: number, cookie: string): Promise<string | undefined>;
|
|
48
48
|
/**
|
|
49
49
|
* 构建页面编辑地址
|
|
50
50
|
*
|
|
@@ -52,7 +52,7 @@ export declare function resolveReactPageDevelopmentUrl(appCode: string | undefin
|
|
|
52
52
|
* @param pageId 页面 ID
|
|
53
53
|
* @returns 当前环境页面编辑地址,任一为空返回 undefined
|
|
54
54
|
*/
|
|
55
|
-
export declare function
|
|
55
|
+
export declare function buildCustomPageEditUrl(appCode: string | undefined, pageId: number | string | undefined): string | undefined;
|
|
56
56
|
/**
|
|
57
57
|
* 解析并校验 page-content 入参
|
|
58
58
|
*
|
|
@@ -60,19 +60,19 @@ export declare function buildReactPageEditUrl(appCode: string | undefined, pageI
|
|
|
60
60
|
* @returns 路径到内容字符串的映射
|
|
61
61
|
* @throws 当缺失、非 JSON 或值不是字符串时抛出校验错误
|
|
62
62
|
*/
|
|
63
|
-
export declare function
|
|
63
|
+
export declare function parseCustomPageContent(value: string): Record<string, string>;
|
|
64
64
|
/**
|
|
65
|
-
*
|
|
65
|
+
* 校验完整自定义页面文件映射中的源码
|
|
66
66
|
*
|
|
67
67
|
* @param pageContent 路径到文件内容的完整映射
|
|
68
|
-
* @throws 未包含
|
|
68
|
+
* @throws 未包含 JSX/TSX 源码或存在基础语法错误时抛出校验错误
|
|
69
69
|
*/
|
|
70
|
-
export declare function
|
|
70
|
+
export declare function validateCustomPageContent(pageContent: Record<string, string>): Promise<void>;
|
|
71
71
|
/**
|
|
72
|
-
*
|
|
72
|
+
* 读取并校验自定义页面 ID
|
|
73
73
|
*
|
|
74
74
|
* @param ctx 命令执行上下文
|
|
75
75
|
* @returns 正整数 pageId
|
|
76
76
|
* @throws 当 ID 非正整数时抛出校验错误
|
|
77
77
|
*/
|
|
78
|
-
export declare function
|
|
78
|
+
export declare function readCustomPageId(ctx: CustomPageCommandContext): number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a146_0x5a50c6=a146_0x4f68;(function(_0x5e301b,_0x4a839a){const _0x2d780f=a146_0x4f68,_0x47ab51=_0x5e301b();while(!![]){try{const _0x38269f=-parseInt(_0x2d780f(0xa6))/0x1*(-parseInt(_0x2d780f(0x9a))/0x2)+parseInt(_0x2d780f(0xac))/0x3*(-parseInt(_0x2d780f(0x9d))/0x4)+-parseInt(_0x2d780f(0xa1))/0x5*(parseInt(_0x2d780f(0x9b))/0x6)+parseInt(_0x2d780f(0xbe))/0x7+-parseInt(_0x2d780f(0xb1))/0x8+-parseInt(_0x2d780f(0xa9))/0x9+parseInt(_0x2d780f(0xba))/0xa*(parseInt(_0x2d780f(0xbc))/0xb);if(_0x38269f===_0x4a839a)break;else _0x47ab51['push'](_0x47ab51['shift']());}catch(_0x20d397){_0x47ab51['push'](_0x47ab51['shift']());}}}(a146_0x1c2c,0xb460d));import{APPCODE_FLAG_OPTIONAL}from'../../../commands/common/flags.js';import{fetchMenuSnapshot}from'../../../commands/menu/shared/facts.js';import{getEnv,isProduction}from'../../../constant/env.js';import{getAppBaseUrl}from'../../../constant/domain.js';import{CliErrors}from'../../../errors.js';import{validateCustomPageSourceFiles}from'./syntax.js';export const CUSTOM_PAGE_APPCODE_FLAG_OPTIONAL={...APPCODE_FLAG_OPTIONAL,'description':a146_0x5a50c6(0xbb)};function trimOptional(_0x75e1be){const _0x305b14=a146_0x5a50c6;return _0x75e1be?.[_0x305b14(0xae)]()||undefined;}export function buildCustomPageRuntimeUrl(_0x21247a,_0xb176cf){const _0x55f286=a146_0x5a50c6,_0x15459b=trimOptional(_0x21247a),_0x58cb1e=trimOptional(_0xb176cf);if(!_0x15459b||!_0x58cb1e)return undefined;const _0x3a1e0f=isProduction(getEnv())?_0x15459b+'.app.lovrabet.com':_0x15459b+_0x55f286(0x99);return _0x55f286(0xb7)+_0x3a1e0f+'/'+encodeURIComponent(_0x58cb1e);}export function buildCustomPageDevelopmentUrl(_0x593192,_0x3f7992){const _0x2c70f8=trimOptional(_0x593192),_0x27a12c=trimOptional(_0x3f7992);if(!_0x2c70f8||!_0x27a12c)return undefined;return getAppBaseUrl(_0x2c70f8)+'/pages/'+encodeURIComponent(_0x27a12c);}export async function resolveCustomPageDevelopmentUrl(_0x335064,_0x247bd4,_0x1f3710){const _0x29e2fc=a146_0x5a50c6,_0x43286e=trimOptional(_0x335064);if(!_0x43286e)return undefined;try{const _0x16888a=(await fetchMenuSnapshot(_0x43286e,_0x1f3710))['menus'][_0x29e2fc(0xa2)](_0x81b9c5=>_0x81b9c5[_0x29e2fc(0xa8)]===_0x29e2fc(0xb4)&&_0x81b9c5[_0x29e2fc(0xbd)]===_0x247bd4);return buildCustomPageDevelopmentUrl(_0x43286e,_0x16888a?.[_0x29e2fc(0xb3)]);}catch{return undefined;}}export function buildCustomPageEditUrl(_0x3a093f,_0x5e69e8){const _0x5584fd=a146_0x5a50c6,_0x15cf43=trimOptional(_0x3a093f);if(!_0x15cf43)return;const _0x1a8ef3=trimOptional(_0x5e69e8==null?undefined:String(_0x5e69e8));if(!_0x1a8ef3)return;const _0x496f18=isProduction(getEnv())?_0x5584fd(0xb5):'/web-app/app',_0x432115=isProduction(getEnv())?_0x5584fd(0x97):_0x5584fd(0xa0);return''+_0x432115+_0x496f18+'/'+encodeURIComponent(_0x15cf43)+_0x5584fd(0x95)+encodeURIComponent(_0x1a8ef3);}export function parseCustomPageContent(_0x5b71db){const _0x483a5a=a146_0x5a50c6;if(!_0x5b71db[_0x483a5a(0xae)]())throw CliErrors['flagMissing'](_0x483a5a(0x98));let _0x2b29ab;try{_0x2b29ab=JSON[_0x483a5a(0xa3)](_0x5b71db);}catch{throw CliErrors['validation'](_0x483a5a(0xb8));}if(typeof _0x2b29ab!==_0x483a5a(0xab)||_0x2b29ab===null||Array[_0x483a5a(0xb6)](_0x2b29ab)||Object[_0x483a5a(0xb2)](_0x2b29ab)[_0x483a5a(0x9f)](_0x57e3eb=>typeof _0x57e3eb!==_0x483a5a(0xa5)))throw CliErrors[_0x483a5a(0xa4)](_0x483a5a(0x96));return _0x2b29ab;}function a146_0x1c2c(){const _0x1ea0e6=['5QCmWaO','find','parse','validation','string','1GpdpYH','--id\x20must\x20be\x20a\x20positive\x20integer.','type','11297493xXedbx','file','object','50703HSrLEs','isInteger','trim','num','join','11567696lkwJSH','values','path','react','/app','isArray','https://','--page-content\x20must\x20be\x20valid\x20JSON.','message','200CUpyBQ','Optional\x20app\x20code\x20resolved\x20from\x20page\x20ID\x20when\x20omitted','2471678qbAUWY','pageId','5713778gxCnDY','/ide/','--page-content\x20must\x20be\x20a\x20JSON\x20object\x20whose\x20values\x20are\x20file\x20content\x20strings.','https://app.lovrabet.com','page-content','.daily.lovrabet.com','1297276mGCOSg','8217096tGoeIq','length','272bxLihv','map','some','https://daily.lovrabet.com'];a146_0x1c2c=function(){return _0x1ea0e6;};return a146_0x1c2c();}export async function validateCustomPageContent(_0x5e53da){const _0x4003fa=a146_0x5a50c6,_0x2448f8=await validateCustomPageSourceFiles(_0x5e53da);if(_0x2448f8[_0x4003fa(0x9c)]>0x0)throw CliErrors[_0x4003fa(0xa4)]('Invalid\x20Custom\x20Page\x20content:\x20'+_0x2448f8[_0x4003fa(0x9e)](_0x421a59=>_0x421a59[_0x4003fa(0xaa)]+':\x20'+_0x421a59[_0x4003fa(0xb9)])[_0x4003fa(0xb0)](';\x20'));}function a146_0x4f68(_0xa51697,_0x13bb2f){_0xa51697=_0xa51697-0x95;const _0x1c2c1b=a146_0x1c2c();let _0x4f68b6=_0x1c2c1b[_0xa51697];return _0x4f68b6;}export function readCustomPageId(_0x1fae64){const _0x13c05d=a146_0x5a50c6,_0x449ac7=_0x1fae64[_0x13c05d(0xaf)]('id');if(!Number[_0x13c05d(0xad)](_0x449ac7)||_0x449ac7<=0x0)throw CliErrors[_0x13c05d(0xa4)](_0x13c05d(0xa7));return _0x449ac7;}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 页面源码校验返回的标准问题结构
|
|
3
3
|
*/
|
|
4
|
-
type
|
|
4
|
+
type CustomPageSourceValidationIssue = {
|
|
5
5
|
file: string;
|
|
6
6
|
message: string;
|
|
7
7
|
};
|
|
@@ -14,5 +14,5 @@ type ReactPageSourceValidationIssue = {
|
|
|
14
14
|
* @param pageContent 页面文件路径到内容的映射
|
|
15
15
|
* @returns 按文件聚合的语法问题列表
|
|
16
16
|
*/
|
|
17
|
-
export declare function
|
|
17
|
+
export declare function validateCustomPageSourceFiles(pageContent: Record<string, string>): Promise<CustomPageSourceValidationIssue[]>;
|
|
18
18
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a147_0x5194ff=a147_0xa4cb;(function(_0x2ab866,_0x4c04d2){const _0x2a8c47=a147_0xa4cb,_0x19bee3=_0x2ab866();while(!![]){try{const _0x1e7b85=-parseInt(_0x2a8c47(0xa1))/0x1+parseInt(_0x2a8c47(0xb1))/0x2*(parseInt(_0x2a8c47(0xab))/0x3)+-parseInt(_0x2a8c47(0xac))/0x4+-parseInt(_0x2a8c47(0xa3))/0x5*(-parseInt(_0x2a8c47(0xa6))/0x6)+-parseInt(_0x2a8c47(0xa5))/0x7+parseInt(_0x2a8c47(0xaf))/0x8+-parseInt(_0x2a8c47(0xa2))/0x9*(-parseInt(_0x2a8c47(0xb3))/0xa);if(_0x1e7b85===_0x4c04d2)break;else _0x19bee3['push'](_0x19bee3['shift']());}catch(_0x3033f4){_0x19bee3['push'](_0x19bee3['shift']());}}}(a147_0x589f,0xad8c2));import{format}from'prettier';const SOURCE_PARSERS={'.js':a147_0x5194ff(0xaa),'.jsx':a147_0x5194ff(0xaa),'.ts':'typescript','.tsx':a147_0x5194ff(0x9e)},CUSTOM_PAGE_EXTENSIONS=[a147_0x5194ff(0xa8),a147_0x5194ff(0xb0)];function a147_0xa4cb(_0x155d8d,_0x2ce31c){_0x155d8d=_0x155d8d-0x9d;const _0x589f29=a147_0x589f();let _0xa4cb03=_0x589f29[_0x155d8d];return _0xa4cb03;}export async function validateCustomPageSourceFiles(_0x3a52ce){const _0x15073d=a147_0x5194ff,_0x5db6b6=Object['entries'](_0x3a52ce)[_0x15073d(0xa0)](([_0x1240cd])=>getParser(_0x1240cd));if(!_0x5db6b6['some'](([_0x4265c0])=>isReactSourceFile(_0x4265c0)))return[{'file':_0x15073d(0xb2),'message':'Missing\x20React\x20source\x20file\x20with\x20extension\x20.jsx\x20or\x20.tsx'}];const _0x577bde=await Promise[_0x15073d(0xae)](_0x5db6b6[_0x15073d(0xa4)](async([_0x210aba,_0x2f5cf3])=>{try{return await format(_0x2f5cf3,{'parser':getParser(_0x210aba)}),undefined;}catch(_0x1d1ccb){return{'file':_0x210aba,'message':_0x1d1ccb instanceof Error?_0x1d1ccb['message']:String(_0x1d1ccb)};}}));return _0x577bde['filter'](_0x67805e=>_0x67805e!==undefined);}function a147_0x589f(){const _0x100c80=['18TqnfPF','find','.jsx','some','babel','3874449unNDsM','5621796HoDjVN','trim','all','5704232jyrnFQ','.tsx','2AnPlCT','page-content','3098740iFwnuK','endsWith','entries','typescript','toLowerCase','filter','1052564ozhETy','63cMRUsj','551275inNZon','map','9348724vQywWR'];a147_0x589f=function(){return _0x100c80;};return a147_0x589f();}function getParser(_0x3f1f67){const _0x36af57=a147_0x5194ff,_0x37eafc=_0x3f1f67[_0x36af57(0xad)]()[_0x36af57(0x9f)]();return Object[_0x36af57(0x9d)](SOURCE_PARSERS)[_0x36af57(0xa7)](([_0x28cd1d])=>_0x37eafc[_0x36af57(0xb4)](_0x28cd1d))?.[0x1];}function isReactSourceFile(_0x174eff){const _0x456fec=a147_0x5194ff,_0x4c1cf2=_0x174eff[_0x456fec(0xad)]()[_0x456fec(0x9f)]();return CUSTOM_PAGE_EXTENSIONS[_0x456fec(0xa9)](_0x541f01=>_0x4c1cf2['endsWith'](_0x541f01));}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a148_0x255f(){const _0x4d8ad6=['pageDescription','290725NehvDU','export\x20const\x20locales\x20=\x20{\x0a','This\x20is\x20a\x20basic\x20page\x20template,\x20you\x20can\x20develop\x20based\x20on\x20it.','4556904CehUJP','これは基本ページテンプレートです。あなたは、これに基づいて開発できます。','en-US','11496kbZqeD','137AHEamU','18womSQO','326xihGMU','1960448GTDdtD','ja-JP','1701smXLaa','590YQPtAF','Ini\x20adalah\x20sebuah\x20halaman\x20dasar.\x20Anda\x20dapat\x20mengembangkan\x20ini.','Bu\x20bir\x20temel\x20sayfa\x20şablonudur.\x20Bu\x20temaplana\x20dayanarak\x20geliştirilebilir.','\x0a};\x0a','806301QRCtXo','4qACPOZ','join','id-ID','stringify','zh-CN','41239HwKXxh','tr-TR',':\x20{\x0a\x20\x20\x20\x20'];a148_0x255f=function(){return _0x4d8ad6;};return a148_0x255f();}(function(_0x11ec93,_0x493210){const _0x16d5f8=a148_0x5cf3,_0x4805ce=_0x11ec93();while(!![]){try{const _0x2bdbf4=-parseInt(_0x16d5f8(0x101))/0x1*(parseInt(_0x16d5f8(0x103))/0x2)+-parseInt(_0x16d5f8(0xf0))/0x3*(parseInt(_0x16d5f8(0xf1))/0x4)+parseInt(_0x16d5f8(0xfa))/0x5*(-parseInt(_0x16d5f8(0x102))/0x6)+parseInt(_0x16d5f8(0x104))/0x7+-parseInt(_0x16d5f8(0x100))/0x8*(parseInt(_0x16d5f8(0x106))/0x9)+-parseInt(_0x16d5f8(0xec))/0xa*(-parseInt(_0x16d5f8(0xf6))/0xb)+parseInt(_0x16d5f8(0xfd))/0xc;if(_0x2bdbf4===_0x493210)break;else _0x4805ce['push'](_0x4805ce['shift']());}catch(_0x549966){_0x4805ce['push'](_0x4805ce['shift']());}}}(a148_0x255f,0x231ff));function buildIndexFile(_0x13d1ef){return'import\x20React\x20from\x20\x27react\x27;\x0aimport\x20{\x20Card,\x20Typography\x20}\x20from\x20\x27antd\x27;\x0aimport\x20{\x20useSdkClient,\x20useI18n,\x20useNavigate,\x20useLocation\x20}\x20from\x20\x22@/context/app-context\x22;\x0aimport\x20{\x20locales\x20}\x20from\x20\x27../locales\x27;\x0aimport\x20\x27./index.css\x27;\x0a\x0aconst\x20App\x20=\x20()\x20=>\x20{\x0a\x20\x20const\x20client\x20=\x20useSdkClient();\x20//\x20client\x20可以用于获取其他数据集的数据\x0a\x20\x20const\x20$i18n\x20=\x20useI18n();\x20//\x20国际化多语言\x20i18n\x20实例\x0a\x20\x20const\x20navigate\x20=\x20useNavigate();\x20//\x20react-router\x20navigate\x20导航实例\x0a\x20\x20const\x20location\x20=\x20useLocation();\x20//\x20浏览器\x20location\x20实例\x0a\x0a\x20\x20$i18n.addLocale(locales);\x20//\x20添加多语言词包\x0a\x0a\x20\x20return\x20(\x0a\x20\x20\x20\x20<div\x20className=\x22page-container\x22>\x0a\x20\x20\x20\x20\x20\x20<Card>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<Typography>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<Typography.Title\x20level={2}>{'+JSON['stringify'](_0x13d1ef)+'}</Typography.Title>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<Typography.Paragraph>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{$i18n.t(\x27pageDescription\x27,\x20\x27这是一个基础页面模板,你可以在此基础上进行开发。\x27)}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</Typography.Paragraph>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</Typography>\x0a\x20\x20\x20\x20\x20\x20</Card>\x0a\x20\x20\x20\x20</div>\x0a\x20\x20);\x0a};\x0a\x0aexport\x20default\x20App;\x0a';}function buildStyleFile(){return'.page-container\x20{\x0a\x20\x20padding:\x2024px;\x0a\x20\x20background:\x20#f0f2f5;\x0a\x20\x20min-height:\x20100vh;\x0a}\x0a';}function buildLocalesFile(_0x2d35f3){const _0x9c7016=a148_0x5cf3,_0x22bf2e=_0x2d35f3['map'](_0x5d4e03=>{const _0x5405bd=a148_0x5cf3;let _0x30bd7e='';switch(_0x5d4e03){case _0x5405bd(0xf5):_0x30bd7e='这是一个基础页面模板,你可以在此基础上进行开发。';break;case _0x5405bd(0xff):_0x30bd7e=_0x5405bd(0xfc);break;case _0x5405bd(0x105):_0x30bd7e=_0x5405bd(0xfe);break;case _0x5405bd(0xf7):_0x30bd7e=_0x5405bd(0xee);break;case _0x5405bd(0xf3):_0x30bd7e=_0x5405bd(0xed);break;default:_0x30bd7e=_0x5405bd(0xfc);}return'\x20\x20'+JSON[_0x5405bd(0xf4)](_0x5d4e03)+_0x5405bd(0xf8)+JSON['stringify'](_0x5405bd(0xf9))+':\x20'+JSON[_0x5405bd(0xf4)](_0x30bd7e)+',\x0a\x20\x20}';})[_0x9c7016(0xf2)](',\x0a');return _0x9c7016(0xfb)+_0x22bf2e+_0x9c7016(0xef);}function a148_0x5cf3(_0x4e6b11,_0x2ef961){_0x4e6b11=_0x4e6b11-0xec;const _0x255fd0=a148_0x255f();let _0x5cf352=_0x255fd0[_0x4e6b11];return _0x5cf352;}export function buildInitialFiles(_0x4a3167,_0x1f8672){return{'src/app/index.jsx':buildIndexFile(_0x4a3167),'src/app/index.css':buildStyleFile(),'src/locales/index.js':buildLocalesFile(_0x1f8672)};}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { CommandDefinition } from "../../../framework/types.js";
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const pageCustomUpdate: CommandDefinition;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a149_0x557bbf=a149_0x23cc;(function(_0x1d0253,_0x230f8b){const _0x24f8bb=a149_0x23cc,_0x37ceb2=_0x1d0253();while(!![]){try{const _0x3fbab4=-parseInt(_0x24f8bb(0x183))/0x1*(parseInt(_0x24f8bb(0x170))/0x2)+-parseInt(_0x24f8bb(0x16f))/0x3+parseInt(_0x24f8bb(0x179))/0x4+-parseInt(_0x24f8bb(0x16b))/0x5*(-parseInt(_0x24f8bb(0x167))/0x6)+-parseInt(_0x24f8bb(0x174))/0x7+parseInt(_0x24f8bb(0x184))/0x8*(parseInt(_0x24f8bb(0x180))/0x9)+-parseInt(_0x24f8bb(0x165))/0xa*(parseInt(_0x24f8bb(0x164))/0xb);if(_0x3fbab4===_0x230f8b)break;else _0x37ceb2['push'](_0x37ceb2['shift']());}catch(_0x4bfc1b){_0x37ceb2['push'](_0x37ceb2['shift']());}}}(a149_0x4d40,0xd78d1));import{getCustomPageSource,updateCustomPageContent}from'../../../core/api-client.js';function a149_0x4d40(){const _0x4b2404=['Cannot\x20determine\x20the\x20appCode\x20for\x20Custom\x20Page\x20','Save\x20all\x20files\x20of\x20a\x20Custom\x20Page','pageContent','number','45nLigWc','POST','Custom\x20Page\x20update\x20did\x20not\x20create\x20a\x20new\x20version.','17cUhwAW','529264JVjKCS','str','887557bLMJqw','80EVMOAu','Custom\x20Page\x20was\x20updated,\x20but\x20a\x20link\x20to\x20its\x20latest\x20saved\x20content\x20could\x20not\x20be\x20generated.','6KffDEf','apiError','Custom\x20Page\x20ID','custom-update','4003715AmHpzD','trim','Updated\x20Custom\x20Page\x20','appCode','114654WjRSju','48tYcUkZ','pageId','/smartapi/webcode/page/update/content','string','2322922pQMwtr','cookie','validation','appcode','page-content','3069328AZhyoP','Complete\x20page\x20files\x20as\x20JSON','write'];a149_0x4d40=function(){return _0x4b2404;};return a149_0x4d40();}import{CliErrors}from'../../../errors.js';function a149_0x23cc(_0x135567,_0x43ea0e){_0x135567=_0x135567-0x163;const _0x4d4096=a149_0x4d40();let _0x23cc5d=_0x4d4096[_0x135567];return _0x23cc5d;}import{buildCustomPageEditUrl,parseCustomPageContent,resolveCustomPageDevelopmentUrl,readCustomPageId,CUSTOM_PAGE_APPCODE_FLAG_OPTIONAL,validateCustomPageContent}from'./shared.js';export const pageCustomUpdate={'service':'page','command':a149_0x557bbf(0x16a),'description':a149_0x557bbf(0x17d),'risk':a149_0x557bbf(0x17b),'defaultOutputFormat':'compress','structuredErrors':!![],'requiresAppCode':![],'flags':[{'name':'id','type':a149_0x557bbf(0x17f),'required':!![],'description':a149_0x557bbf(0x169)},{'name':a149_0x557bbf(0x178),'type':a149_0x557bbf(0x173),'required':!![],'description':a149_0x557bbf(0x17a)},CUSTOM_PAGE_APPCODE_FLAG_OPTIONAL],async 'validate'(_0x5a1541){const _0x5c134c=a149_0x557bbf;readCustomPageId(_0x5a1541),await validateCustomPageContent(parseCustomPageContent(_0x5a1541[_0x5c134c(0x163)]('page-content')));},async 'dryRun'(_0x5e998c){const _0x38a3f6=a149_0x557bbf,_0x5ebb62=await readInput(_0x5e998c);return{'method':_0x38a3f6(0x181),'url':_0x38a3f6(0x172),'body':{'id':_0x5ebb62[_0x38a3f6(0x171)],'codeContent':_0x5ebb62[_0x38a3f6(0x17e)]},'description':'Would\x20save\x20all\x20files\x20of\x20Custom\x20Page\x20'+_0x5ebb62[_0x38a3f6(0x171)]+'.'};},async 'execute'(_0x3bf417){const _0x2550ff=a149_0x557bbf,_0x360fef=await readInput(_0x3bf417),_0x340a6c=await updateCustomPageContent({'pageId':_0x360fef['pageId'],'pageContent':_0x360fef[_0x2550ff(0x17e)]});if(!Number['isInteger'](_0x340a6c['newVersion'])||_0x340a6c['newVersion']<=0x0)throw CliErrors[_0x2550ff(0x168)](_0x2550ff(0x182));const _0x14f5b5=buildCustomPageEditUrl(_0x360fef['appCode'],_0x360fef[_0x2550ff(0x171)]),_0x1d18b6=await resolveCustomPageDevelopmentUrl(_0x360fef['appCode'],_0x360fef[_0x2550ff(0x171)],_0x3bf417[_0x2550ff(0x175)]);return{'ok':!![],'data':buildMutationData(_0x360fef,_0x340a6c,_0x1d18b6,_0x14f5b5,_0x1d18b6?[]:[_0x2550ff(0x166)]),'message':_0x2550ff(0x16d)+_0x360fef[_0x2550ff(0x171)]+'.'};}};async function readInput(_0x16a367){const _0x531de3=a149_0x557bbf,_0x44054d=readCustomPageId(_0x16a367),_0x4ce430=_0x16a367[_0x531de3(0x163)](_0x531de3(0x177))[_0x531de3(0x16c)]()||(await getCustomPageSource(_0x44054d))[_0x531de3(0x16e)]?.[_0x531de3(0x16c)]();if(!_0x4ce430)throw CliErrors[_0x531de3(0x176)](_0x531de3(0x17c)+_0x44054d+'.');return{'appCode':_0x4ce430,'pageId':_0x44054d,'pageContent':parseCustomPageContent(_0x16a367['str'](_0x531de3(0x178)))};}function buildMutationData(_0x476a15,_0x3c2f17,_0x196957,_0x331aa8,_0x188109=[]){const _0x483062=a149_0x557bbf;return{'operation':'page.custom-update','selector':{'appCode':_0x476a15[_0x483062(0x16e)],'pageId':_0x476a15[_0x483062(0x171)]},'before':null,'after':{'pageId':_0x3c2f17?.[_0x483062(0x171)]??_0x476a15[_0x483062(0x171)],'version':_0x3c2f17?.['newVersion']??null,'pageContent':_0x476a15[_0x483062(0x17e)]},'dryRun':_0x3c2f17===undefined,'request':_0x476a15,..._0x196957?{'pageUrl':_0x196957}:{},..._0x331aa8?{'editPageUrl':_0x331aa8}:{},'warnings':_0x188109};}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a150_0x486c(_0x468c3f,_0x4129d3){_0x468c3f=_0x468c3f-0x1d1;const _0x3d69a3=a150_0x3d69();let _0x486cba=_0x3d69a3[_0x468c3f];return _0x486cba;}const a150_0x5b2285=a150_0x486c;(function(_0xda236c,_0x12e504){const _0xe1faf1=a150_0x486c,_0x36b0ed=_0xda236c();while(!![]){try{const _0x5b63e4=parseInt(_0xe1faf1(0x1d1))/0x1+-parseInt(_0xe1faf1(0x1e0))/0x2*(parseInt(_0xe1faf1(0x1de))/0x3)+parseInt(_0xe1faf1(0x1e9))/0x4+parseInt(_0xe1faf1(0x1dc))/0x5*(parseInt(_0xe1faf1(0x1df))/0x6)+-parseInt(_0xe1faf1(0x1ea))/0x7+parseInt(_0xe1faf1(0x1d4))/0x8*(-parseInt(_0xe1faf1(0x1e6))/0x9)+-parseInt(_0xe1faf1(0x1d7))/0xa*(-parseInt(_0xe1faf1(0x1e2))/0xb);if(_0x5b63e4===_0x12e504)break;else _0x36b0ed['push'](_0x36b0ed['shift']());}catch(_0x30f1fb){_0x36b0ed['push'](_0x36b0ed['shift']());}}}(a150_0x3d69,0xa1432));function a150_0x3d69(){const _0x56a232=['relatedPages','40BUrFoE','length','code','70ypQMVJ','alias','read','data-list-status','Query\x20Data\x20List\x20Page\x20facts\x20for\x20a\x20dataset','35frKXaC','compress','1493682AKqmIF','234468wibplW','4OiScII','page','1161809ojnowV','source','name','/standard-page-status?appCode=','2185893MZxJHq','Dataset\x20alias\x20from\x20api.ts\x20(resolves\x20to\x20dataset\x20code\x20automatically)','GET','4787252jwngrB','1931895ZfcndZ','936996gRunbw','appCode'];a150_0x3d69=function(){return _0x56a232;};return a150_0x3d69();}import{APPCODE_FLAG_OPTIONAL,DATASETCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{assessDataListPageState,getUndeletedRelatedPages,loadDatasetDetailForPage,loadDataListPageStatusForGenerate,serializeDryRunDescription,validateDatasetSelector}from'../../commands/page/shared.js';export const pageDataListStatus={'service':a150_0x5b2285(0x1e1),'command':a150_0x5b2285(0x1da),'description':a150_0x5b2285(0x1db),'risk':a150_0x5b2285(0x1d9),'defaultOutputFormat':a150_0x5b2285(0x1dd),'flags':[APPCODE_FLAG_OPTIONAL,DATASETCODE_FLAG_OPTIONAL,{'name':a150_0x5b2285(0x1d8),'type':'string','description':a150_0x5b2285(0x1e7)}],async 'validate'(_0x141ce9){validateDatasetSelector(_0x141ce9);},async 'dryRun'(_0xaa919a){const _0x192b4e=a150_0x5b2285,_0x11a8e1=await loadDatasetDetailForPage(_0xaa919a);return{'method':_0x192b4e(0x1e8),'url':'/smartapi/lovrabet/dataset/'+_0x11a8e1['code']+_0x192b4e(0x1e5)+encodeURIComponent(_0xaa919a[_0x192b4e(0x1d2)]),'description':serializeDryRunDescription({'dataset':{'id':_0x11a8e1['id'],'code':_0x11a8e1[_0x192b4e(0x1d6)],'name':_0x11a8e1[_0x192b4e(0x1e4)]},'action':'query-data-list-status'})};},async 'execute'(_0x318b3d){const _0x2ca06e=a150_0x5b2285,_0x43e18b=await loadDatasetDetailForPage(_0x318b3d),_0x15e420=await loadDataListPageStatusForGenerate(_0x318b3d,_0x43e18b[_0x2ca06e(0x1d6)]),_0x4bfedb=getUndeletedRelatedPages(_0x43e18b),_0x39e8a0=assessDataListPageState(_0x43e18b[_0x2ca06e(0x1d6)],_0x15e420,{'fallbackUndeletedPages':_0x4bfedb});return{'ok':!![],'data':{'datasetCode':_0x43e18b['code'],'precheckSource':_0x15e420?.[_0x2ca06e(0x1e3)]??'related-pages-fallback','status':_0x39e8a0['status'],'manualResolutionRequired':_0x39e8a0['manualResolutionRequired'],'nextAction':_0x39e8a0['nextAction'],'dataListPageStatus':_0x15e420,'relatedPages':{'total':_0x43e18b[_0x2ca06e(0x1d3)][_0x2ca06e(0x1d5)],'undeletedCount':_0x4bfedb[_0x2ca06e(0x1d5)]}}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a151_0x5843cf=a151_0x1bb7;(function(_0x456f4e,_0x2a69c1){const _0x48d228=a151_0x1bb7,_0x516bbf=_0x456f4e();while(!![]){try{const _0x52448c=-parseInt(_0x48d228(0xf6))/0x1+parseInt(_0x48d228(0xd9))/0x2*(parseInt(_0x48d228(0xf0))/0x3)+parseInt(_0x48d228(0xdf))/0x4+-parseInt(_0x48d228(0xe7))/0x5*(-parseInt(_0x48d228(0xf5))/0x6)+-parseInt(_0x48d228(0xdd))/0x7+-parseInt(_0x48d228(0xf3))/0x8+parseInt(_0x48d228(0xd4))/0x9;if(_0x52448c===_0x2a69c1)break;else _0x516bbf['push'](_0x516bbf['shift']());}catch(_0x452543){_0x516bbf['push'](_0x516bbf['shift']());}}}(a151_0x188c,0x66583));import{APPCODE_FLAG_OPTIONAL,DATASETCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{assessGenerateOperationState,assessDataListPageState,buildPageGenerateOperationStatusQueryCommand,buildDataListPageStatusQueryCommand,createPageGenerateClientOperationId,getUndeletedRelatedPages,loadDatasetDetailForPage,loadDataListPageStatusForGenerate,serializeDryRunDescription,validateDatasetSelector}from'../../commands/page/shared.js';function a151_0x1bb7(_0x580745,_0x3385f3){_0x580745=_0x580745-0xc8;const _0x188ca4=a151_0x188c();let _0x1bb7a4=_0x188ca4[_0x580745];return _0x1bb7a4;}function a151_0x188c(){const _0x363bb9=['复用已有生成任务','dataset','page\x20generate-start\x20does\x20not\x20accept\x20--page-type.','Start\x20async\x20Data\x20List\x20Page\x20generation\x20from\x20a\x20dataset','2uqqSbN','Dataset\x20alias\x20from\x20api.ts\x20(resolves\x20to\x20dataset\x20code\x20automatically)','appCode','code','3862516eigSFQ','message','875736CVmVSk','/generate-standard-pages/start','name','compress','boolean','Actually\x20execute\x20the\x20generation.\x20Without\x20this\x20flag,\x20only\x20a\x20dry-run\x20preview\x20is\x20shown.','related-pages-fallback','alias','54210tBOvFL','status','precheck','write','apply','page-type','POST','fieldCount','dryRun','1648683VJUgQo','SUCCESS','Dry-run\x20preview\x20(pass\x20--apply\x20to\x20execute\x20the\x20generation)','2366184KrZlmx','progressRate','342UCZJvE','406089BuUAFI','nextAction','bool','DATA_LIST\x20currently\x20has\x20one\x20fixed\x20pattern:\x20CRUD_PAGE_SET.','CRUD_PAGE_SET','taskId','allowGenerate','This\x20command\x20always\x20generates\x20a\x20DATA_LIST\x20page\x20from\x20a\x20dataset.','operationId','generate-start','clientOperationId','page','page\x20generate-start\x20does\x20not\x20accept\x20--page-pattern.','PARTIAL_SUCCESS','source','reused','DATA_LIST','dataListPageStatus','currentStep','2577276szSSWA'];a151_0x188c=function(){return _0x363bb9;};return a151_0x188c();}import{startGenerateDataListPages}from'../../core/api-client.js';export const pageGenerateStart={'service':a151_0x5843cf(0xcc),'command':a151_0x5843cf(0xca),'description':a151_0x5843cf(0xd8),'risk':a151_0x5843cf(0xea),'defaultOutputFormat':a151_0x5843cf(0xe2),'rejectedFlags':[{'name':a151_0x5843cf(0xec),'message':a151_0x5843cf(0xd7),'hint':a151_0x5843cf(0xc8)},{'name':'page-pattern','message':a151_0x5843cf(0xcd),'hint':a151_0x5843cf(0xf9)}],'flags':[APPCODE_FLAG_OPTIONAL,DATASETCODE_FLAG_OPTIONAL,{'name':a151_0x5843cf(0xe6),'type':'string','description':a151_0x5843cf(0xda)},{'name':a151_0x5843cf(0xeb),'type':a151_0x5843cf(0xe3),'description':a151_0x5843cf(0xe4)}],async 'validate'(_0x5d4133){validateDatasetSelector(_0x5d4133);},async 'dryRun'(_0x3c3011){const _0x5096f8=a151_0x5843cf,_0x2fbfc3=await prepare(_0x3c3011);return{'method':_0x5096f8(0xed),'url':'/smartapi/lovrabet/dataset/'+_0x2fbfc3[_0x5096f8(0xd6)][_0x5096f8(0xdc)]+_0x5096f8(0xe0),'body':{'appCode':_0x3c3011[_0x5096f8(0xdb)],'clientOperationId':_0x2fbfc3[_0x5096f8(0xcb)]},'description':serializeDryRunDescription({'dataset':{'id':_0x2fbfc3['dataset']['id'],'code':_0x2fbfc3[_0x5096f8(0xd6)][_0x5096f8(0xdc)],'name':_0x2fbfc3[_0x5096f8(0xd6)][_0x5096f8(0xe1)],'fieldCount':_0x2fbfc3[_0x5096f8(0xd6)][_0x5096f8(0xee)]},'precheckSource':_0x2fbfc3[_0x5096f8(0xd2)]?.[_0x5096f8(0xcf)]??'related-pages-fallback','action':'generate-start','clientOperationId':_0x2fbfc3[_0x5096f8(0xcb)],'plannedStatus':_0x2fbfc3[_0x5096f8(0xe9)]['status'],'reason':_0x2fbfc3[_0x5096f8(0xe9)]['message']})};},async 'execute'(_0x5c762f){const _0x327dfc=a151_0x5843cf;if(!_0x5c762f[_0x327dfc(0xf8)](_0x327dfc(0xeb))){const _0x1da5ef=await pageGenerateStart[_0x327dfc(0xef)](_0x5c762f);return{'ok':!![],'message':_0x327dfc(0xf2),'data':_0x1da5ef};}const _0x1af70e=await prepare(_0x5c762f);if(!_0x1af70e[_0x327dfc(0xe9)][_0x327dfc(0xfc)])return{'ok':![],'message':_0x1af70e[_0x327dfc(0xe9)][_0x327dfc(0xde)],'data':{'datasetCode':_0x1af70e[_0x327dfc(0xd6)][_0x327dfc(0xdc)],'pageType':_0x327dfc(0xd1),'pagePattern':_0x327dfc(0xfa),'clientOperationId':_0x1af70e[_0x327dfc(0xcb)],'precheckSource':_0x1af70e[_0x327dfc(0xd2)]?.['source']??_0x327dfc(0xe5),'status':_0x1af70e['precheck'][_0x327dfc(0xe8)],'manualResolutionRequired':_0x1af70e['precheck']['manualResolutionRequired'],'nextAction':_0x1af70e[_0x327dfc(0xe9)][_0x327dfc(0xf7)],'query':{'command':buildDataListPageStatusQueryCommand(_0x1af70e[_0x327dfc(0xd6)][_0x327dfc(0xdc)],_0x5c762f[_0x327dfc(0xdb)])},'dataListPageStatus':_0x1af70e['dataListPageStatus']}};const _0x3c420f=await startGenerateDataListPages(_0x5c762f[_0x327dfc(0xdb)],_0x1af70e[_0x327dfc(0xd6)][_0x327dfc(0xdc)],{'clientOperationId':_0x1af70e['clientOperationId']}),_0x2742f4=_0x3c420f[_0x327dfc(0xe8)]===_0x327dfc(0xf1)||_0x3c420f['status']===_0x327dfc(0xce)?await loadDataListPageStatusForGenerate(_0x5c762f,_0x1af70e[_0x327dfc(0xd6)][_0x327dfc(0xdc)]):null,_0x1dd985=assessGenerateOperationState(_0x1af70e[_0x327dfc(0xd6)][_0x327dfc(0xdc)],_0x3c420f[_0x327dfc(0xe8)],_0x2742f4);return{'ok':!![],'message':_0x3c420f[_0x327dfc(0xd0)]?_0x327dfc(0xd5):'已提交生成任务','data':{'datasetCode':_0x1af70e['dataset'][_0x327dfc(0xdc)],'appCode':_0x5c762f[_0x327dfc(0xdb)],'pageType':_0x327dfc(0xd1),'pagePattern':_0x327dfc(0xfa),'taskId':_0x3c420f[_0x327dfc(0xfb)]??null,'operationId':_0x3c420f['operationId']??null,'clientOperationId':_0x1af70e[_0x327dfc(0xcb)],'jobStatus':_0x3c420f[_0x327dfc(0xe8)]??null,'progressRate':typeof _0x3c420f['progressRate']==='number'?_0x3c420f[_0x327dfc(0xf4)]:null,'currentStep':_0x3c420f[_0x327dfc(0xd3)]??null,'reused':_0x3c420f[_0x327dfc(0xd0)]===!![],'status':_0x1dd985[_0x327dfc(0xe8)],'manualResolutionRequired':_0x1dd985['manualResolutionRequired'],'nextAction':_0x1dd985[_0x327dfc(0xf7)],'query':{'command':buildPageGenerateOperationStatusQueryCommand(_0x1af70e[_0x327dfc(0xd6)][_0x327dfc(0xdc)],{'appCode':_0x5c762f[_0x327dfc(0xdb)],'taskId':_0x3c420f[_0x327dfc(0xfb)],'operationId':_0x3c420f[_0x327dfc(0xc9)],'clientOperationId':_0x1af70e[_0x327dfc(0xcb)]})},'dataListPageStatus':_0x2742f4}};}};async function prepare(_0x248ab0){const _0x31b0d5=a151_0x5843cf,_0x5e2bdc=await loadDatasetDetailForPage(_0x248ab0),_0x33d8b6=await loadDataListPageStatusForGenerate(_0x248ab0,_0x5e2bdc['code']),_0x18b553=getUndeletedRelatedPages(_0x5e2bdc);return{'dataset':_0x5e2bdc,'dataListPageStatus':_0x33d8b6,'clientOperationId':createPageGenerateClientOperationId(),'precheck':assessDataListPageState(_0x5e2bdc[_0x31b0d5(0xdc)],_0x33d8b6,{'fallbackUndeletedPages':_0x18b553})};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a152_0x3f627a=a152_0x1656;(function(_0x316945,_0x4d2f7d){const _0x48f2cb=a152_0x1656,_0x3f7342=_0x316945();while(!![]){try{const _0x3519d0=-parseInt(_0x48f2cb(0x14b))/0x1+parseInt(_0x48f2cb(0x15f))/0x2+-parseInt(_0x48f2cb(0x152))/0x3*(parseInt(_0x48f2cb(0x15a))/0x4)+parseInt(_0x48f2cb(0x146))/0x5*(-parseInt(_0x48f2cb(0x153))/0x6)+parseInt(_0x48f2cb(0x15c))/0x7+parseInt(_0x48f2cb(0x165))/0x8*(parseInt(_0x48f2cb(0x151))/0x9)+parseInt(_0x48f2cb(0x16a))/0xa;if(_0x3519d0===_0x4d2f7d)break;else _0x3f7342['push'](_0x3f7342['shift']());}catch(_0x137916){_0x3f7342['push'](_0x3f7342['shift']());}}}(a152_0x5223,0xdfea4));function a152_0x1656(_0x5ab876,_0x5983b5){_0x5ab876=_0x5ab876-0x140;const _0x522331=a152_0x5223();let _0x165652=_0x522331[_0x5ab876];return _0x165652;}function a152_0x5223(){const _0x70e461=['page','/smartapi/lovrabet/dataset/','operation_failed','str','errorMsg','query-generate-operation-status','8160765SpOVKs','GET','SUCCESS','toString','code','489429zAGtOX','Generic\x20task\x20id\x20returned\x20by\x20page\x20generate-start','PARTIAL_SUCCESS','clientOperationId','Dataset\x20alias\x20from\x20api.ts\x20(resolves\x20to\x20dataset\x20code\x20automatically)','task-id','9AZKOyH','3eApwyN','6fDrnin','name','Client\x20recovery/idempotency\x20id\x20when\x20operationId\x20is\x20unavailable\x20or\x20lost','client-operation-id','status','alias','taskId','5896236cmQSfC','string','2256247QKQkfe','compress','manualResolutionRequired','2733960rirewK','result','appCode','operation-id','/generate-standard-pages/status?','read','14427392LlBDEJ','currentStep','Async\x20operation\x20id\x20returned\x20by\x20page\x20generate-start','number','message','10200720ltvHlL','set','operationId','Query\x20Data\x20List\x20Page\x20generate\x20operation\x20status'];a152_0x5223=function(){return _0x70e461;};return a152_0x5223();}import{APPCODE_FLAG_OPTIONAL,DATASETCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{assessGenerateOperationState,buildPageGenerateOperationStatusQueryCommand,loadDatasetDetailForPage,loadDataListPageStatusForGenerate,serializeDryRunDescription,validateDatasetSelector,validateGenerateOperationSelector}from'../../commands/page/shared.js';import{getGenerateDataListPagesStatus}from'../../core/api-client.js';export const pageGenerateStatus={'service':a152_0x3f627a(0x140),'command':'generate-status','description':a152_0x3f627a(0x16d),'risk':a152_0x3f627a(0x164),'defaultOutputFormat':a152_0x3f627a(0x15d),'flags':[APPCODE_FLAG_OPTIONAL,DATASETCODE_FLAG_OPTIONAL,{'name':a152_0x3f627a(0x158),'type':a152_0x3f627a(0x15b),'description':a152_0x3f627a(0x14f)},{'name':a152_0x3f627a(0x150),'type':a152_0x3f627a(0x15b),'description':a152_0x3f627a(0x14c)},{'name':a152_0x3f627a(0x162),'type':a152_0x3f627a(0x15b),'description':a152_0x3f627a(0x167)},{'name':a152_0x3f627a(0x156),'type':'string','description':a152_0x3f627a(0x155)}],async 'validate'(_0x777f0b){validateDatasetSelector(_0x777f0b),validateGenerateOperationSelector(_0x777f0b);},async 'dryRun'(_0x3e06f0){const _0x254216=a152_0x3f627a,_0x245724=await loadDatasetDetailForPage(_0x3e06f0),_0x1f575d=_0x3e06f0[_0x254216(0x143)](_0x254216(0x150)),_0x239e0f=_0x3e06f0[_0x254216(0x143)]('operation-id'),_0x7c856b=_0x3e06f0[_0x254216(0x143)](_0x254216(0x156)),_0x46d82a=new URLSearchParams({'appCode':_0x3e06f0[_0x254216(0x161)]});return _0x1f575d&&_0x46d82a['set'](_0x254216(0x159),_0x1f575d),_0x239e0f&&_0x46d82a[_0x254216(0x16b)](_0x254216(0x16c),_0x239e0f),_0x7c856b&&_0x46d82a['set'](_0x254216(0x14e),_0x7c856b),{'method':_0x254216(0x147),'url':_0x254216(0x141)+_0x245724['code']+_0x254216(0x163)+_0x46d82a[_0x254216(0x149)](),'description':serializeDryRunDescription({'dataset':{'id':_0x245724['id'],'code':_0x245724[_0x254216(0x14a)],'name':_0x245724[_0x254216(0x154)]},'action':_0x254216(0x145),'taskId':_0x1f575d||undefined,'operationId':_0x239e0f||undefined,'clientOperationId':_0x7c856b||undefined})};},async 'execute'(_0x42f243){const _0x2814c3=a152_0x3f627a,_0x26da13=await loadDatasetDetailForPage(_0x42f243),_0x4704ca=_0x42f243[_0x2814c3(0x143)](_0x2814c3(0x150)),_0x1353a9=_0x42f243[_0x2814c3(0x143)](_0x2814c3(0x162)),_0x245c09=_0x42f243[_0x2814c3(0x143)]('client-operation-id'),_0x388d7f=await getGenerateDataListPagesStatus(_0x42f243['appCode'],_0x26da13['code'],{'taskId':_0x4704ca||undefined,'operationId':_0x1353a9||undefined,'clientOperationId':_0x245c09||undefined}),_0x5deb94=_0x388d7f[_0x2814c3(0x157)]===_0x2814c3(0x148)||_0x388d7f['status']===_0x2814c3(0x14d),_0xdf56d6=_0x5deb94?await loadDataListPageStatusForGenerate(_0x42f243,_0x26da13[_0x2814c3(0x14a)]):null,_0x5a08d9=assessGenerateOperationState(_0x26da13[_0x2814c3(0x14a)],_0x388d7f[_0x2814c3(0x157)],_0xdf56d6),_0x3dfd9c=_0x388d7f['taskId']??_0x4704ca??undefined,_0x5b5570=_0x388d7f['operationId']??_0x1353a9??undefined,_0xc23993=_0x388d7f['clientOperationId']??_0x245c09??undefined;return{'ok':!![],'message':_0x5a08d9['status']===_0x2814c3(0x142)?_0x388d7f[_0x2814c3(0x144)]||_0x5a08d9[_0x2814c3(0x169)]:_0x5a08d9['message'],'data':{'datasetCode':_0x26da13[_0x2814c3(0x14a)],'appCode':_0x42f243[_0x2814c3(0x161)],'taskId':_0x3dfd9c,'operationId':_0x5b5570,'clientOperationId':_0xc23993,'jobStatus':_0x388d7f[_0x2814c3(0x157)]??null,'progressRate':typeof _0x388d7f['progressRate']===_0x2814c3(0x168)?_0x388d7f['progressRate']:null,'currentStep':_0x388d7f[_0x2814c3(0x166)]??null,'errorMsg':_0x388d7f[_0x2814c3(0x144)]??null,'status':_0x5a08d9[_0x2814c3(0x157)],'manualResolutionRequired':_0x5a08d9[_0x2814c3(0x15e)],'nextAction':_0x5a08d9['nextAction'],'query':{'command':buildPageGenerateOperationStatusQueryCommand(_0x26da13[_0x2814c3(0x14a)],{'appCode':_0x42f243[_0x2814c3(0x161)],'taskId':_0x3dfd9c,'operationId':_0x5b5570,'clientOperationId':_0xc23993})},'dataListPageStatus':_0xdf56d6,'result':_0x388d7f[_0x2814c3(0x160)]??null}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2b6d1c,_0x5d06b6){const _0x56ac8f=a153_0x46df,_0x436482=_0x2b6d1c();while(!![]){try{const _0x20463a=-parseInt(_0x56ac8f(0xe9))/0x1*(-parseInt(_0x56ac8f(0xe3))/0x2)+parseInt(_0x56ac8f(0xea))/0x3*(parseInt(_0x56ac8f(0xe2))/0x4)+parseInt(_0x56ac8f(0xeb))/0x5*(-parseInt(_0x56ac8f(0xe5))/0x6)+-parseInt(_0x56ac8f(0xe4))/0x7*(-parseInt(_0x56ac8f(0xe1))/0x8)+-parseInt(_0x56ac8f(0xe7))/0x9*(-parseInt(_0x56ac8f(0xe6))/0xa)+-parseInt(_0x56ac8f(0xe0))/0xb+parseInt(_0x56ac8f(0xec))/0xc*(-parseInt(_0x56ac8f(0xe8))/0xd);if(_0x20463a===_0x5d06b6)break;else _0x436482['push'](_0x436482['shift']());}catch(_0x534a9c){_0x436482['push'](_0x436482['shift']());}}}(a153_0x36fd,0xd6fb1));import{pageGenerateStart}from'../../commands/page/generate-start.js';import{pageGenerateStatus}from'../../commands/page/generate-status.js';import{pageDataListStatus}from'../../commands/page/data-list-status.js';import{pageSync}from'../../commands/page/sync.js';import{pagePull}from'../../commands/page/pull.js';import{pagePush}from'../../commands/page/push.js';import{pageRelationAudit}from'../../commands/page/relation-audit.js';import{pageRestore}from'../../commands/page/restore.js';import{pageCreate}from'../../commands/page/create.js';function a153_0x46df(_0x2a6d4b,_0x576e5f){_0x2a6d4b=_0x2a6d4b-0xe0;const _0x36fdee=a153_0x36fd();let _0x46dfe0=_0x36fdee[_0x2a6d4b];return _0x46dfe0;}import{pageCustomDetail}from'../../commands/page/custom/detail.js';import{pageCustomList}from'../../commands/page/custom/list.js';function a153_0x36fd(){const _0x5a0907=['414826CRyLDZ','469whPPoE','84nabsMM','20ZsAqZe','7426179ZHhBus','75322WKfjDP','5XPwmDy','4109115creFZh','268110GLmKZM','5784osogHT','6037658cnjgMY','109352wckqGI','4jDzCOw'];a153_0x36fd=function(){return _0x5a0907;};return a153_0x36fd();}import{pageCustomPublish}from'../../commands/page/custom/publish.js';import{pageCustomUpdate}from'../../commands/page/custom/update.js';export const pageDefinitions=[pageGenerateStart,pageGenerateStatus,pageDataListStatus,pageRelationAudit,pageSync,pagePull,pagePush,pageRestore,pageCreate,pageCustomList,pageCustomDetail,pageCustomPublish,pageCustomUpdate];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a154_0x36a1e5=a154_0x3bf0;(function(_0x233f36,_0x3fa160){const _0x4fd909=a154_0x3bf0,_0x426b8f=_0x233f36();while(!![]){try{const _0x59d8e9=-parseInt(_0x4fd909(0x1ca))/0x1*(parseInt(_0x4fd909(0x1e2))/0x2)+-parseInt(_0x4fd909(0x1f0))/0x3+-parseInt(_0x4fd909(0x1dc))/0x4+-parseInt(_0x4fd909(0x1f6))/0x5*(parseInt(_0x4fd909(0x1cb))/0x6)+-parseInt(_0x4fd909(0x1e5))/0x7+parseInt(_0x4fd909(0x1bd))/0x8+parseInt(_0x4fd909(0x1da))/0x9*(parseInt(_0x4fd909(0x1db))/0xa);if(_0x59d8e9===_0x3fa160)break;else _0x426b8f['push'](_0x426b8f['shift']());}catch(_0x4a2fb9){_0x426b8f['push'](_0x426b8f['shift']());}}}(a154_0x1efa,0x2f804));import{writeFile}from'node:fs/promises';import{APPCODE_FLAG_OPTIONAL,DATASETCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{getPageIdFlag,loadDatasetDetailForPage,loadPageDetailForPage,selectVersionTagGroup,serializeDryRunDescription,validatePageTargetSelector}from'../../commands/page/shared.js';import{computePageContentHash,computePageFileHash,serializePageSchemaForFile}from'../../core/page/hash.js';import{ensureParentDirectory,fileExists,loadPageProjectConfig,resolvePageFilePath}from'../../core/page/file-system.js';import{createEmptyPageLock,ensurePageLockScope,readPageLockFile,writePageLockFile}from'../../core/page/lock.js';function a154_0x3bf0(_0x353c4b,_0x8b6ddc){_0x353c4b=_0x353c4b-0x1b5;const _0x1efabb=a154_0x1efa();let _0x3bf053=_0x1efabb[_0x353c4b];return _0x3bf053;}import{CliErrors}from'../../errors.js';export const pagePull={'service':a154_0x36a1e5(0x1ee),'command':a154_0x36a1e5(0x1d8),'description':a154_0x36a1e5(0x1c5),'risk':a154_0x36a1e5(0x1ef),'defaultOutputFormat':a154_0x36a1e5(0x1ce),'flags':[APPCODE_FLAG_OPTIONAL,{'name':'id','type':a154_0x36a1e5(0x1d2),'description':a154_0x36a1e5(0x1d7)},DATASETCODE_FLAG_OPTIONAL,{'name':a154_0x36a1e5(0x1e0),'type':a154_0x36a1e5(0x1bf),'description':a154_0x36a1e5(0x1cc)},{'name':a154_0x36a1e5(0x1b8),'type':a154_0x36a1e5(0x1bf),'description':a154_0x36a1e5(0x1ec)},{'name':a154_0x36a1e5(0x1d9),'type':'boolean','description':a154_0x36a1e5(0x1dd)}],async 'validate'(_0x1c1a7a){validatePageTargetSelector(_0x1c1a7a);},async 'dryRun'(_0x3f435c){const _0x15dca4=a154_0x36a1e5,_0x4b4227=await buildPullPlan(_0x3f435c);return{'method':_0x15dca4(0x1f3),'url':_0x4b4227[_0x15dca4(0x1ba)]===_0x15dca4(0x1f2)?'/smartapi/lovrabet/detail?pageId='+(_0x4b4227[_0x15dca4(0x1b6)][0x0]?.['detail'][_0x15dca4(0x1eb)]??''):_0x15dca4(0x1c8),'body':{'appCode':_0x3f435c[_0x15dca4(0x1f1)],'mode':_0x4b4227[_0x15dca4(0x1ba)],'targetDatasetCode':_0x4b4227['datasetCode']??null,'pages':_0x4b4227['items']['map'](toPreviewItem)},'description':serializeDryRunDescription({'mode':_0x4b4227[_0x15dca4(0x1ba)],'datasetCode':_0x4b4227[_0x15dca4(0x1c3)]??null,'totalCandidates':_0x4b4227['items'][_0x15dca4(0x1b5)],'totalWouldPull':_0x4b4227[_0x15dca4(0x1b6)][_0x15dca4(0x1e6)](_0x262e16=>_0x262e16[_0x15dca4(0x1b9)]===_0x15dca4(0x1d1))[_0x15dca4(0x1b5)],'totalConflicts':_0x4b4227[_0x15dca4(0x1b6)][_0x15dca4(0x1e6)](_0x854672=>_0x854672[_0x15dca4(0x1b9)]===_0x15dca4(0x1ea))['length']})};},async 'execute'(_0x201d80){const _0x524b33=a154_0x36a1e5,_0x308e82=loadPageProjectConfig(_0x201d80[_0x524b33(0x1f1)]),_0x3fa923=await readPageLockFile(_0x308e82['lockFilePath']),{lockData:_0x2fd456,appLock:_0x11e013}=ensurePageLockScope(_0x3fa923??createEmptyPageLock(),_0x201d80['appCode']),_0x1310ff=await buildPullPlan(_0x201d80),_0x57ea5a=_0x201d80[_0x524b33(0x1c6)]('force');if(_0x1310ff[_0x524b33(0x1ba)]==='single'&&_0x1310ff[_0x524b33(0x1b6)][0x0]?.[_0x524b33(0x1b9)]===_0x524b33(0x1ea)&&!_0x57ea5a)throw CliErrors[_0x524b33(0x1d6)](_0x524b33(0x1b7)+_0x1310ff[_0x524b33(0x1b6)][0x0][_0x524b33(0x1c9)],_0x524b33(0x1c1));const _0x4bb53d=[],_0x1e459a=[];for(const _0x506f7d of _0x1310ff['items']){if(_0x506f7d[_0x524b33(0x1b9)]==='conflict'&&!_0x57ea5a){_0x1e459a[_0x524b33(0x1c7)]({'pageId':_0x506f7d[_0x524b33(0x1e1)][_0x524b33(0x1eb)],'type':_0x506f7d[_0x524b33(0x1e1)][_0x524b33(0x1e7)],'title':_0x506f7d[_0x524b33(0x1e1)]['name'],'localPath':_0x506f7d['localPath'],'reason':_0x506f7d[_0x524b33(0x1cd)]??'local\x20unsynced\x20changes'});continue;}await ensureParentDirectory(_0x506f7d[_0x524b33(0x1c9)]);const _0x44b10f=serializePageSchemaForFile(_0x506f7d[_0x524b33(0x1e1)][_0x524b33(0x1df)]);await writeFile(_0x506f7d[_0x524b33(0x1c9)],_0x44b10f,_0x524b33(0x1d5)),_0x11e013[_0x524b33(0x1d3)][String(_0x506f7d['detail'][_0x524b33(0x1eb)])]=buildLockEntry(_0x506f7d['detail'],_0x44b10f),_0x4bb53d['push']({'pageId':_0x506f7d[_0x524b33(0x1e1)][_0x524b33(0x1eb)],'type':_0x506f7d['detail'][_0x524b33(0x1e7)],'title':_0x506f7d[_0x524b33(0x1e1)]['name'],'localPath':_0x506f7d[_0x524b33(0x1c9)]});}return _0x11e013[_0x524b33(0x1cf)]=new Date()[_0x524b33(0x1ed)](),await writePageLockFile(_0x308e82[_0x524b33(0x1d0)],_0x2fd456),{'ok':!![],'message':_0x524b33(0x1f5)+_0x4bb53d[_0x524b33(0x1b5)]+_0x524b33(0x1c4)+_0x1e459a[_0x524b33(0x1b5)]+_0x524b33(0x1d4),'data':{'appCode':_0x201d80[_0x524b33(0x1f1)],'pulledPages':_0x4bb53d,'skippedPages':_0x1e459a,'totalPulled':_0x4bb53d[_0x524b33(0x1b5)],'totalSkipped':_0x1e459a['length']}};}};function a154_0x1efa(){const _0x82d531=['map','拉取完成:\x20','23465bwBiKh','length','items','Local\x20page\x20file\x20has\x20unsynced\x20changes:\x20','version-tag','status','mode','Dataset\x20\x22','str','1918520NyJQlI','hash','string','versionTag','Use\x20--force\x20to\x20overwrite\x20local\x20changes.','all','datasetCode','\x20pulled,\x20','Pull\x20page\x20schema\x20to\x20local\x20files','bool','push','/smartapi/lovrabet/detail\x20(per\x20selected\x20page)','localPath','303455SRMmkX','66dxakJF','Dataset\x20alias\x20from\x20api.ts\x20(resolves\x20to\x20dataset\x20code\x20automatically)','reason','compress','lastSync','lockFilePath','would_pull','number','pages','\x20skipped','utf8','validation','Page\x20ID','pull','force','9FMiaPZ','7717090sYGUVe','560752mRpNrn','Overwrite\x20local\x20files\x20even\x20when\x20unsynced\x20local\x20changes\x20exist','name','code','alias','detail','2iwdiXt','\x22\x20has\x20no\x20undeleted\x20related\x20pages.','relatedPages','1325996GmPMWR','filter','type','deleted','datasetIds','conflict','pageId','Page\x20group\x20version\x20tag\x20(batch\x20mode\x20only)','toISOString','page','read','396798JZOKwz','appCode','single','GET'];a154_0x1efa=function(){return _0x82d531;};return a154_0x1efa();}async function buildPullPlan(_0x3d2167){const _0x27ccbc=a154_0x36a1e5,_0x516bf0=loadPageProjectConfig(_0x3d2167[_0x27ccbc(0x1f1)]),_0x2fd06f=await readPageLockFile(_0x516bf0['lockFilePath']),{appLock:_0x3bc95f}=ensurePageLockScope(_0x2fd06f??createEmptyPageLock(),_0x3d2167[_0x27ccbc(0x1f1)]),_0x47823d=getPageIdFlag(_0x3d2167);if(_0x47823d!==undefined){const _0xb1eb7f=await loadPageDetailForPage(_0x3d2167,_0x47823d);return{'mode':_0x27ccbc(0x1f2),'items':[await inspectPullTarget(_0x516bf0,_0x3bc95f['pages'][String(_0xb1eb7f['pageId'])],_0xb1eb7f)]};}const _0x2fd2e4=await loadDatasetDetailForPage(_0x3d2167),_0x4599d1=_0x2fd2e4[_0x27ccbc(0x1e4)][_0x27ccbc(0x1e6)](_0x542892=>!_0x542892[_0x27ccbc(0x1e8)]);if(_0x4599d1[_0x27ccbc(0x1b5)]===0x0)throw CliErrors[_0x27ccbc(0x1d6)](_0x27ccbc(0x1bb)+_0x2fd2e4[_0x27ccbc(0x1df)]+_0x27ccbc(0x1e3));const _0x1886a6=await Promise[_0x27ccbc(0x1c2)](_0x4599d1[_0x27ccbc(0x1f4)](_0x405e86=>loadPageDetailForPage(_0x3d2167,_0x405e86['id']))),_0x2bb141=selectVersionTagGroup(_0x1886a6,_0x45fe39=>_0x45fe39[_0x27ccbc(0x1c0)],_0x3d2167[_0x27ccbc(0x1bc)](_0x27ccbc(0x1b8)));return{'mode':'batch','datasetCode':_0x2fd2e4[_0x27ccbc(0x1df)],'items':await Promise['all'](_0x2bb141[_0x27ccbc(0x1b6)][_0x27ccbc(0x1f4)](_0x254676=>inspectPullTarget(_0x516bf0,_0x3bc95f['pages'][String(_0x254676[_0x27ccbc(0x1eb)])],_0x254676)))};}async function inspectPullTarget(_0x372770,_0xf29f41,_0x5bb283){const _0x44d868=a154_0x36a1e5,_0x27e044=resolvePageFilePath(_0x372770,_0x5bb283[_0x44d868(0x1eb)],_0x5bb283[_0x44d868(0x1e7)]),_0x241792=await fileExists(_0x27e044);if(!_0x241792){const _0x47c2c9=serializePageSchemaForFile(_0x5bb283[_0x44d868(0x1df)]);return{'detail':_0x5bb283,'localPath':_0x27e044,'localHash':computePageContentHash(_0x47c2c9),'status':_0x44d868(0x1d1)};}const _0x5aac57=await computePageFileHash(_0x27e044);if(!_0xf29f41||_0x5aac57!==_0xf29f41[_0x44d868(0x1be)])return{'detail':_0x5bb283,'localPath':_0x27e044,'localHash':_0x5aac57,'status':_0x44d868(0x1ea),'reason':'local\x20unsynced\x20changes'};return{'detail':_0x5bb283,'localPath':_0x27e044,'localHash':_0x5aac57,'status':_0x44d868(0x1d1)};}function buildLockEntry(_0x4ae90d,_0x5ab57c){const _0x1259b2=a154_0x36a1e5;return{'hash':computePageContentHash(_0x5ab57c),'pageId':_0x4ae90d['pageId'],'pageVersion':_0x4ae90d['pageVersion'],'type':_0x4ae90d[_0x1259b2(0x1e7)],'title':_0x4ae90d['name'],'datasetIds':_0x4ae90d[_0x1259b2(0x1e9)],'versionTag':_0x4ae90d[_0x1259b2(0x1c0)]};}function toPreviewItem(_0x25fa70){const _0x278049=a154_0x36a1e5;return{'pageId':_0x25fa70[_0x278049(0x1e1)][_0x278049(0x1eb)],'type':_0x25fa70[_0x278049(0x1e1)]['type'],'title':_0x25fa70[_0x278049(0x1e1)][_0x278049(0x1de)],'localPath':_0x25fa70[_0x278049(0x1c9)],'status':_0x25fa70[_0x278049(0x1b9)],..._0x25fa70['reason']?{'reason':_0x25fa70['reason']}:{}};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a146_0x299fdf=a146_0x274b;function a146_0x3db7(){const _0x23cbca=['reason','map','blocked','items','remote\x20pageVersion\x20changed','conflict','Invalid\x20JSON\x20in\x20local\x20page\x20file:\x20','versionTag','`\x20first.','Local\x20file\x20not\x20found:\x20','nextLockEntry','filter','72kfOSuU','length','code','apiError','no\x20changes','alias','Page\x20ID','No\x20lock\x20record\x20found\x20for\x20page\x20','Remote\x20page\x20','UNKNOWN','toISOString','remoteDetail','utf8','102Jgrmad','page-','unchanged','lockFilePath','title','datasetId','page','Push\x20local\x20page\x20schema\x20back\x20to\x20remote','Run\x20`','603644tYzFSq','single','version-tag','normalized','推送成功,服务端已规范化\x20schema','pageVersion','125368rpmDgm','type','无变更需要推送','No\x20local\x20pages\x20found\x20for\x20dataset\x20\x22','has','relatedPages','POST','includes','1344147lcklXE','pages','message','590554UiLrCL','`\x20first','appCode','would_push','parse','\x20no\x20longer\x20belongs\x20to\x20the\x20selected\x20dataset.','\x20no\x20longer\x20belongs\x20to\x20the\x20target\x20dataset','remote\x20schema\x20changed','mode','6iXtrrW','Page\x20group\x20version\x20tag\x20(batch\x20mode\x20only)','datasetCode','推送成功','hash','部分页面推送失败','\x20page\x20pull\x20--datasetcode\x20','local\x20JSON\x20is\x20invalid','lastSync','Page\x20','\x20has\x20changed\x20since\x20last\x20pull.','candidates','52895nFkele','pageId','deleted','793930bzBGED','string','status','datasetIds','localContent','\x20page\x20pull\x20--id\x20','push','name','2348760zYhUPb','validation','compress'];a146_0x3db7=function(){return _0x23cbca;};return a146_0x3db7();}function a146_0x274b(_0x261a39,_0x4e96b7){_0x261a39=_0x261a39-0x1e7;const _0x3db77d=a146_0x3db7();let _0x274b19=_0x3db77d[_0x261a39];return _0x274b19;}(function(_0x467c90,_0x2d4750){const _0x5be644=a146_0x274b,_0x18f391=_0x467c90();while(!![]){try{const _0x13a987=-parseInt(_0x5be644(0x23b))/0x1+-parseInt(_0x5be644(0x1f0))/0x2+parseInt(_0x5be644(0x1f9))/0x3*(-parseInt(_0x5be644(0x235))/0x4)+parseInt(_0x5be644(0x205))/0x5*(-parseInt(_0x5be644(0x22c))/0x6)+parseInt(_0x5be644(0x1ed))/0x7+parseInt(_0x5be644(0x210))/0x8+parseInt(_0x5be644(0x21f))/0x9*(parseInt(_0x5be644(0x208))/0xa);if(_0x13a987===_0x2d4750)break;else _0x18f391['push'](_0x18f391['shift']());}catch(_0x1d2fc0){_0x18f391['push'](_0x18f391['shift']());}}}(a146_0x3db7,0x35552));import{readFile,writeFile}from'node:fs/promises';import{APPCODE_FLAG_OPTIONAL,DATASETCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{getPageIdFlag,loadDatasetDetailForPage,loadPageDetailForPage,selectVersionTagGroup,serializeDryRunDescription,validatePageTargetSelector}from'../../commands/page/shared.js';import{updatePage}from'../../core/api-client.js';import{computePageContentHash,computePageFileHash,computeSerializedSchemaHash,serializePageSchemaForFile}from'../../core/page/hash.js';import{fileExists,loadPageProjectConfig,resolvePageFilePath}from'../../core/page/file-system.js';import{createEmptyPageLock,ensurePageLockScope,readPageLockFile,writePageLockFile}from'../../core/page/lock.js';import{CliErrors}from'../../errors.js';export const pagePush={'service':a146_0x299fdf(0x232),'command':a146_0x299fdf(0x20e),'description':a146_0x299fdf(0x233),'risk':'write','defaultOutputFormat':a146_0x299fdf(0x212),'flags':[APPCODE_FLAG_OPTIONAL,{'name':'id','type':'number','description':a146_0x299fdf(0x225)},DATASETCODE_FLAG_OPTIONAL,{'name':a146_0x299fdf(0x224),'type':a146_0x299fdf(0x209),'description':'Dataset\x20alias\x20from\x20api.ts\x20(resolves\x20to\x20dataset\x20code\x20automatically)'},{'name':a146_0x299fdf(0x237),'type':a146_0x299fdf(0x209),'description':a146_0x299fdf(0x1fa)}],async 'validate'(_0x4118c0){validatePageTargetSelector(_0x4118c0);},async 'dryRun'(_0x56e84e){const _0xd0cc78=a146_0x299fdf,_0x4ce039=await buildPushPreview(_0x56e84e);return{'method':_0xd0cc78(0x1eb),'url':'/smartapi/lovrabet/update-page','body':{'appCode':_0x56e84e['appCode'],'mode':_0x4ce039[_0xd0cc78(0x1f8)],'datasetCode':_0x4ce039[_0xd0cc78(0x1fb)]??null,'pages':_0x4ce039['items']},'description':serializeDryRunDescription({'mode':_0x4ce039['mode'],'datasetCode':_0x4ce039[_0xd0cc78(0x1fb)]??null,'totalWouldPush':_0x4ce039[_0xd0cc78(0x216)][_0xd0cc78(0x21e)](_0x45b5c3=>_0x45b5c3[_0xd0cc78(0x20a)]===_0xd0cc78(0x1f3))[_0xd0cc78(0x220)],'totalUnchanged':_0x4ce039['items'][_0xd0cc78(0x21e)](_0x516075=>_0x516075[_0xd0cc78(0x20a)]===_0xd0cc78(0x22e))[_0xd0cc78(0x220)],'totalConflicts':_0x4ce039[_0xd0cc78(0x216)]['filter'](_0x2e4009=>_0x2e4009['status']===_0xd0cc78(0x218)||_0x2e4009['status']===_0xd0cc78(0x215))[_0xd0cc78(0x220)]})};},async 'execute'(_0x16c139){const _0xa2fcc9=a146_0x299fdf,_0x37ee91=loadPageProjectConfig(_0x16c139[_0xa2fcc9(0x1f2)]),_0x4db59a=await readPageLockFile(_0x37ee91[_0xa2fcc9(0x22f)]),{lockData:_0x4c811d,appLock:_0x3f96c5}=ensurePageLockScope(_0x4db59a??createEmptyPageLock(),_0x16c139[_0xa2fcc9(0x1f2)]),_0x23eb63=getPageIdFlag(_0x16c139);if(_0x23eb63!==undefined){const _0x13f551=await prepareSinglePush(_0x16c139,_0x37ee91,_0x3f96c5[_0xa2fcc9(0x1ee)][String(_0x23eb63)],_0x23eb63),_0x363da9=await pushPreparedPage(_0x16c139,_0x13f551);return _0x3f96c5[_0xa2fcc9(0x1ee)][String(_0x363da9[_0xa2fcc9(0x206)])]=_0x363da9[_0xa2fcc9(0x21d)],_0x3f96c5[_0xa2fcc9(0x201)]=new Date()[_0xa2fcc9(0x229)](),await writePageLockFile(_0x37ee91[_0xa2fcc9(0x22f)],_0x4c811d),{'ok':!![],'message':_0x363da9[_0xa2fcc9(0x238)]?_0xa2fcc9(0x239):_0xa2fcc9(0x1fc),'data':{'appCode':_0x16c139[_0xa2fcc9(0x1f2)],'pushedPages':[{'pageId':_0x363da9[_0xa2fcc9(0x206)],'type':_0x363da9[_0xa2fcc9(0x23c)],'title':_0x363da9[_0xa2fcc9(0x230)],'normalized':_0x363da9[_0xa2fcc9(0x238)]}],'skippedPages':[],'failedPages':[],'totalPushed':0x1,'totalSkipped':0x0,'totalFailed':0x0}};}const _0x5265ae=await buildBatchPushPlan(_0x16c139,_0x3f96c5[_0xa2fcc9(0x1ee)]),_0x2599b6=[],_0xc6911=[],_0x1d42bc=[];for(const _0xa03800 of _0x5265ae['unchanged']){_0xc6911[_0xa2fcc9(0x20e)](_0xa03800);}for(const _0x37244b of _0x5265ae['candidates']){try{const _0x10cc49=await prepareSinglePush(_0x16c139,_0x37ee91,_0x3f96c5[_0xa2fcc9(0x1ee)][String(_0x37244b[_0xa2fcc9(0x206)])],_0x37244b[_0xa2fcc9(0x206)],_0x5265ae[_0xa2fcc9(0x231)]),_0x24b900=await pushPreparedPage(_0x16c139,_0x10cc49);_0x3f96c5[_0xa2fcc9(0x1ee)][String(_0x24b900[_0xa2fcc9(0x206)])]=_0x24b900['nextLockEntry'],_0x2599b6[_0xa2fcc9(0x20e)]({'pageId':_0x24b900[_0xa2fcc9(0x206)],'type':_0x24b900[_0xa2fcc9(0x23c)],'title':_0x24b900['title'],'normalized':_0x24b900[_0xa2fcc9(0x238)]});}catch(_0x52e887){_0x1d42bc[_0xa2fcc9(0x20e)]({'pageId':_0x37244b['pageId'],'type':_0x37244b[_0xa2fcc9(0x23c)],'title':_0x37244b[_0xa2fcc9(0x230)],'reason':_0x52e887 instanceof Error?_0x52e887['message']:String(_0x52e887)});}}return _0x3f96c5[_0xa2fcc9(0x201)]=new Date()['toISOString'](),await writePageLockFile(_0x37ee91[_0xa2fcc9(0x22f)],_0x4c811d),{'ok':_0x1d42bc[_0xa2fcc9(0x220)]===0x0||_0x2599b6['length']>0x0||_0xc6911[_0xa2fcc9(0x220)]>0x0,'message':_0x1d42bc[_0xa2fcc9(0x220)]>0x0&&_0x2599b6[_0xa2fcc9(0x220)]>0x0?_0xa2fcc9(0x1fe):_0x2599b6[_0xa2fcc9(0x220)]>0x0?_0xa2fcc9(0x1fc):_0xc6911[_0xa2fcc9(0x220)]>0x0&&_0x1d42bc['length']===0x0?_0xa2fcc9(0x1e7):_0x1d42bc[0x0]?.[_0xa2fcc9(0x213)]||'推送失败','data':{'appCode':_0x16c139[_0xa2fcc9(0x1f2)],'pushedPages':_0x2599b6,'skippedPages':_0xc6911,'failedPages':_0x1d42bc,'totalPushed':_0x2599b6['length'],'totalSkipped':_0xc6911['length'],'totalFailed':_0x1d42bc['length']}};}};async function buildPushPreview(_0x274f2d){const _0x465dd7=a146_0x299fdf,_0x2ca80f=loadPageProjectConfig(_0x274f2d[_0x465dd7(0x1f2)]),_0x6e188b=await readPageLockFile(_0x2ca80f[_0x465dd7(0x22f)]),{appLock:_0x1456a8}=ensurePageLockScope(_0x6e188b??createEmptyPageLock(),_0x274f2d[_0x465dd7(0x1f2)]),_0x36266c=getPageIdFlag(_0x274f2d);if(_0x36266c!==undefined)return{'mode':_0x465dd7(0x236),'items':[await inspectPushPage(_0x274f2d,_0x2ca80f,_0x1456a8['pages'][String(_0x36266c)],_0x36266c)]};const _0x3aca2d=await buildBatchPushPlan(_0x274f2d,_0x1456a8['pages']);return{'mode':'batch','datasetCode':_0x3aca2d['datasetCode'],'items':[..._0x3aca2d[_0x465dd7(0x22e)][_0x465dd7(0x214)](_0x81ae0c=>({'pageId':_0x81ae0c[_0x465dd7(0x206)],'type':_0x81ae0c['type'],'title':_0x81ae0c[_0x465dd7(0x230)],'localPath':_0x81ae0c['localPath'],'status':_0x465dd7(0x22e),'reason':_0x81ae0c[_0x465dd7(0x213)]})),...await Promise['all'](_0x3aca2d[_0x465dd7(0x204)][_0x465dd7(0x214)](_0x4e86ed=>inspectPushPage(_0x274f2d,_0x2ca80f,_0x1456a8['pages'][String(_0x4e86ed[_0x465dd7(0x206)])],_0x4e86ed[_0x465dd7(0x206)],_0x3aca2d['datasetId'])))]};}async function buildBatchPushPlan(_0x5e565d,_0x255e0c){const _0x5bc1f3=a146_0x299fdf,_0x44bf6c=loadPageProjectConfig(_0x5e565d[_0x5bc1f3(0x1f2)]),_0x4e9755=await loadDatasetDetailForPage(_0x5e565d),_0x472f36=_0x4e9755['id'],_0x562c39=new Set(_0x4e9755[_0x5bc1f3(0x1ea)][_0x5bc1f3(0x21e)](_0x1c511b=>!_0x1c511b[_0x5bc1f3(0x207)])[_0x5bc1f3(0x214)](_0x1d26b7=>_0x1d26b7['id'])),_0xee06d5=Object['values'](_0x255e0c)[_0x5bc1f3(0x21e)](_0x28b424=>_0x28b424[_0x5bc1f3(0x20b)][_0x5bc1f3(0x1ec)](_0x472f36)&&_0x562c39[_0x5bc1f3(0x1e9)](_0x28b424[_0x5bc1f3(0x206)]));if(_0xee06d5[_0x5bc1f3(0x220)]===0x0)throw CliErrors[_0x5bc1f3(0x211)](_0x5bc1f3(0x1e8)+_0x4e9755[_0x5bc1f3(0x221)]+'\x22.','Run\x20`'+CLI_BIN_NAME+_0x5bc1f3(0x1ff)+_0x4e9755[_0x5bc1f3(0x221)]+_0x5bc1f3(0x21b));const _0x12802c=selectVersionTagGroup(_0xee06d5,_0x23264b=>_0x23264b[_0x5bc1f3(0x21a)]??null,_0x5e565d['str'](_0x5bc1f3(0x237))),_0x30fab3=[],_0x3f7c89=[];for(const _0x5109e5 of _0x12802c['items']){const _0x3ed868=resolvePageFilePath(_0x44bf6c,_0x5109e5['pageId'],_0x5109e5[_0x5bc1f3(0x23c)]);if(!await fileExists(_0x3ed868)){_0x30fab3[_0x5bc1f3(0x20e)]({'pageId':_0x5109e5[_0x5bc1f3(0x206)],'type':_0x5109e5[_0x5bc1f3(0x23c)],'title':_0x5109e5[_0x5bc1f3(0x230)]});continue;}const _0x43fb49=await computePageFileHash(_0x3ed868);if(_0x43fb49===_0x5109e5[_0x5bc1f3(0x1fd)]){_0x3f7c89[_0x5bc1f3(0x20e)]({'pageId':_0x5109e5[_0x5bc1f3(0x206)],'type':_0x5109e5['type'],'title':_0x5109e5['title'],'localPath':_0x3ed868,'reason':'no\x20changes'});continue;}_0x30fab3['push']({'pageId':_0x5109e5[_0x5bc1f3(0x206)],'type':_0x5109e5[_0x5bc1f3(0x23c)],'title':_0x5109e5[_0x5bc1f3(0x230)]});}return{'datasetCode':_0x4e9755[_0x5bc1f3(0x221)],'datasetId':_0x472f36,'candidates':_0x30fab3,'unchanged':_0x3f7c89};}async function inspectPushPage(_0x46faf0,_0x415ce1,_0x5f46d8,_0x38652b,_0x2b99d0){const _0x17fa3f=a146_0x299fdf;if(!_0x5f46d8)return{'pageId':_0x38652b,'type':_0x17fa3f(0x228),'title':_0x17fa3f(0x22d)+_0x38652b,'localPath':resolvePageFilePath(_0x415ce1,_0x38652b,'UNKNOWN'),'status':'blocked','reason':_0x17fa3f(0x234)+CLI_BIN_NAME+_0x17fa3f(0x20d)+_0x38652b+_0x17fa3f(0x1f1)};const _0x16751d=resolvePageFilePath(_0x415ce1,_0x38652b,_0x5f46d8['type']);if(!await fileExists(_0x16751d))return{'pageId':_0x38652b,'type':_0x5f46d8[_0x17fa3f(0x23c)],'title':_0x5f46d8[_0x17fa3f(0x230)],'localPath':_0x16751d,'status':_0x17fa3f(0x215),'reason':_0x17fa3f(0x21c)+_0x16751d};const _0x49caf5=await readFile(_0x16751d,_0x17fa3f(0x22b));try{JSON[_0x17fa3f(0x1f4)](_0x49caf5);}catch{return{'pageId':_0x38652b,'type':_0x5f46d8[_0x17fa3f(0x23c)],'title':_0x5f46d8['title'],'localPath':_0x16751d,'status':'blocked','reason':_0x17fa3f(0x200)};}const _0x4d4340=computePageContentHash(_0x49caf5);if(_0x4d4340===_0x5f46d8[_0x17fa3f(0x1fd)])return{'pageId':_0x38652b,'type':_0x5f46d8['type'],'title':_0x5f46d8[_0x17fa3f(0x230)],'localPath':_0x16751d,'status':'unchanged','reason':_0x17fa3f(0x223)};try{const _0x1b59bd=await loadPageDetailForPage(_0x46faf0,_0x38652b);if(_0x2b99d0!=null&&!_0x1b59bd['datasetIds'][_0x17fa3f(0x1ec)](_0x2b99d0))return{'pageId':_0x38652b,'type':_0x5f46d8['type'],'title':_0x5f46d8[_0x17fa3f(0x230)],'localPath':_0x16751d,'status':_0x17fa3f(0x218),'reason':_0x17fa3f(0x202)+_0x38652b+_0x17fa3f(0x1f6)};const _0x535694=_0x5f46d8['pageVersion']!=null&&_0x1b59bd[_0x17fa3f(0x23a)]!=null;if(_0x535694&&_0x5f46d8['pageVersion']!==_0x1b59bd[_0x17fa3f(0x23a)])return{'pageId':_0x38652b,'type':_0x5f46d8['type'],'title':_0x5f46d8[_0x17fa3f(0x230)],'localPath':_0x16751d,'status':_0x17fa3f(0x218),'reason':_0x17fa3f(0x217)};if(!_0x535694&&computeSerializedSchemaHash(_0x1b59bd[_0x17fa3f(0x221)])!==_0x5f46d8[_0x17fa3f(0x1fd)])return{'pageId':_0x38652b,'type':_0x5f46d8[_0x17fa3f(0x23c)],'title':_0x5f46d8[_0x17fa3f(0x230)],'localPath':_0x16751d,'status':_0x17fa3f(0x218),'reason':_0x17fa3f(0x1f7)};}catch(_0x162a6f){return{'pageId':_0x38652b,'type':_0x5f46d8[_0x17fa3f(0x23c)],'title':_0x5f46d8[_0x17fa3f(0x230)],'localPath':_0x16751d,'status':'blocked','reason':_0x162a6f instanceof Error?_0x162a6f[_0x17fa3f(0x1ef)]:String(_0x162a6f)};}return{'pageId':_0x38652b,'type':_0x5f46d8['type'],'title':_0x5f46d8[_0x17fa3f(0x230)],'localPath':_0x16751d,'status':'would_push'};}async function prepareSinglePush(_0x395dfd,_0xc81786,_0x192b94,_0x25ae2d,_0x587e71){const _0x4c2c51=a146_0x299fdf;if(!_0x192b94)throw CliErrors[_0x4c2c51(0x211)](_0x4c2c51(0x226)+_0x25ae2d+'.','Run\x20`'+CLI_BIN_NAME+_0x4c2c51(0x20d)+_0x25ae2d+'`\x20first.');const _0x34b8aa=resolvePageFilePath(_0xc81786,_0x25ae2d,_0x192b94[_0x4c2c51(0x23c)]);if(!await fileExists(_0x34b8aa))throw CliErrors[_0x4c2c51(0x211)](_0x4c2c51(0x21c)+_0x34b8aa,_0x4c2c51(0x234)+CLI_BIN_NAME+_0x4c2c51(0x20d)+_0x25ae2d+_0x4c2c51(0x21b));const _0x32ead7=await readFile(_0x34b8aa,_0x4c2c51(0x22b));try{JSON['parse'](_0x32ead7);}catch{throw CliErrors['validation'](_0x4c2c51(0x219)+_0x34b8aa);}const _0x19fdf2=await loadPageDetailForPage(_0x395dfd,_0x25ae2d);if(_0x587e71!=null&&!_0x19fdf2[_0x4c2c51(0x20b)]['includes'](_0x587e71))throw CliErrors['validation']('Page\x20'+_0x25ae2d+_0x4c2c51(0x1f5));const _0x25d38c=_0x192b94[_0x4c2c51(0x23a)]!=null&&_0x19fdf2[_0x4c2c51(0x23a)]!=null;if(_0x25d38c){if(_0x192b94[_0x4c2c51(0x23a)]!==_0x19fdf2[_0x4c2c51(0x23a)])throw CliErrors[_0x4c2c51(0x211)](_0x4c2c51(0x227)+_0x25ae2d+_0x4c2c51(0x203),_0x4c2c51(0x234)+CLI_BIN_NAME+_0x4c2c51(0x20d)+_0x25ae2d+'`\x20first.');}else{const _0x4b20bd=computeSerializedSchemaHash(_0x19fdf2['code']);if(_0x4b20bd!==_0x192b94[_0x4c2c51(0x1fd)])throw CliErrors['validation']('Remote\x20page\x20'+_0x25ae2d+_0x4c2c51(0x203),_0x4c2c51(0x234)+CLI_BIN_NAME+_0x4c2c51(0x20d)+_0x25ae2d+_0x4c2c51(0x21b));}return{'lockEntry':_0x192b94,'localPath':_0x34b8aa,'localContent':_0x32ead7,'localHash':computePageContentHash(_0x32ead7),'remoteDetail':_0x19fdf2};}async function pushPreparedPage(_0x332e8a,_0x5128c2){const _0x15e083=a146_0x299fdf,_0x320758=await updatePage(_0x332e8a[_0x15e083(0x1f2)],_0x5128c2[_0x15e083(0x22a)][_0x15e083(0x206)],_0x5128c2[_0x15e083(0x20c)],_0x5128c2['remoteDetail'][_0x15e083(0x20b)]);if(!_0x320758)throw CliErrors[_0x15e083(0x222)]('Page\x20update\x20failed:\x20'+_0x5128c2['remoteDetail'][_0x15e083(0x206)]);const _0x284c64=await loadPageDetailForPage(_0x332e8a,_0x5128c2['remoteDetail']['pageId']),_0x42d0f1=serializePageSchemaForFile(_0x284c64['code']);return await writeFile(_0x5128c2['localPath'],_0x42d0f1,_0x15e083(0x22b)),{'pageId':_0x284c64[_0x15e083(0x206)],'type':_0x284c64['type'],'title':_0x284c64[_0x15e083(0x20f)],'normalized':_0x42d0f1!==serializePageSchemaForFile(_0x5128c2[_0x15e083(0x20c)]),'nextLockEntry':{'hash':computePageContentHash(_0x42d0f1),'pageId':_0x284c64['pageId'],'pageVersion':_0x284c64['pageVersion'],'type':_0x284c64[_0x15e083(0x23c)],'title':_0x284c64[_0x15e083(0x20f)],'datasetIds':_0x284c64[_0x15e083(0x20b)],'versionTag':_0x284c64[_0x15e083(0x21a)]}};}
|
|
1
|
+
const a155_0x16a62e=a155_0x3d6b;(function(_0x1cd5b7,_0x23472e){const _0x312b0=a155_0x3d6b,_0x2ff891=_0x1cd5b7();while(!![]){try{const _0x174191=parseInt(_0x312b0(0x1f9))/0x1*(parseInt(_0x312b0(0x208))/0x2)+parseInt(_0x312b0(0x1f3))/0x3+-parseInt(_0x312b0(0x1c3))/0x4+parseInt(_0x312b0(0x214))/0x5+-parseInt(_0x312b0(0x1cf))/0x6+parseInt(_0x312b0(0x216))/0x7*(-parseInt(_0x312b0(0x1fa))/0x8)+parseInt(_0x312b0(0x1c6))/0x9;if(_0x174191===_0x23472e)break;else _0x2ff891['push'](_0x2ff891['shift']());}catch(_0x49f558){_0x2ff891['push'](_0x2ff891['shift']());}}}(a155_0x4d1c,0xbe417));import{readFile,writeFile}from'node:fs/promises';import{APPCODE_FLAG_OPTIONAL,DATASETCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a155_0x3d6b(_0x2ac28f,_0x5b32d8){_0x2ac28f=_0x2ac28f-0x1c3;const _0x4d1c3e=a155_0x4d1c();let _0x3d6b26=_0x4d1c3e[_0x2ac28f];return _0x3d6b26;}import{CLI_BIN_NAME}from'../../constant/cli.js';import{getPageIdFlag,loadDatasetDetailForPage,loadPageDetailForPage,selectVersionTagGroup,serializeDryRunDescription,validatePageTargetSelector}from'../../commands/page/shared.js';import{updatePage}from'../../core/api-client.js';import{computePageContentHash,computePageFileHash,computeSerializedSchemaHash,serializePageSchemaForFile}from'../../core/page/hash.js';import{fileExists,loadPageProjectConfig,resolvePageFilePath}from'../../core/page/file-system.js';import{createEmptyPageLock,ensurePageLockScope,readPageLockFile,writePageLockFile}from'../../core/page/lock.js';import{CliErrors}from'../../errors.js';export const pagePush={'service':a155_0x16a62e(0x20c),'command':a155_0x16a62e(0x1ca),'description':'Push\x20local\x20page\x20schema\x20back\x20to\x20remote','risk':'write','defaultOutputFormat':a155_0x16a62e(0x1f1),'flags':[APPCODE_FLAG_OPTIONAL,{'name':'id','type':'number','description':'Page\x20ID'},DATASETCODE_FLAG_OPTIONAL,{'name':a155_0x16a62e(0x1d7),'type':a155_0x16a62e(0x1d6),'description':a155_0x16a62e(0x20f)},{'name':a155_0x16a62e(0x206),'type':a155_0x16a62e(0x1d6),'description':'Page\x20group\x20version\x20tag\x20(batch\x20mode\x20only)'}],async 'validate'(_0x1ba50a){validatePageTargetSelector(_0x1ba50a);},async 'dryRun'(_0x392e94){const _0x67be94=a155_0x16a62e,_0x178f8a=await buildPushPreview(_0x392e94);return{'method':'POST','url':_0x67be94(0x1f8),'body':{'appCode':_0x392e94[_0x67be94(0x1f6)],'mode':_0x178f8a[_0x67be94(0x202)],'datasetCode':_0x178f8a[_0x67be94(0x1d2)]??null,'pages':_0x178f8a[_0x67be94(0x1ec)]},'description':serializeDryRunDescription({'mode':_0x178f8a['mode'],'datasetCode':_0x178f8a[_0x67be94(0x1d2)]??null,'totalWouldPush':_0x178f8a[_0x67be94(0x1ec)][_0x67be94(0x207)](_0x146d40=>_0x146d40[_0x67be94(0x1c8)]===_0x67be94(0x20e))['length'],'totalUnchanged':_0x178f8a['items'][_0x67be94(0x207)](_0xc37712=>_0xc37712[_0x67be94(0x1c8)]===_0x67be94(0x1f7))[_0x67be94(0x212)],'totalConflicts':_0x178f8a[_0x67be94(0x1ec)][_0x67be94(0x207)](_0xa8ca02=>_0xa8ca02[_0x67be94(0x1c8)]===_0x67be94(0x1de)||_0xa8ca02['status']===_0x67be94(0x1e1))[_0x67be94(0x212)]})};},async 'execute'(_0xa474e9){const _0x129d21=a155_0x16a62e,_0x18a990=loadPageProjectConfig(_0xa474e9[_0x129d21(0x1f6)]),_0x5a7b02=await readPageLockFile(_0x18a990[_0x129d21(0x1cb)]),{lockData:_0x456438,appLock:_0x6731c6}=ensurePageLockScope(_0x5a7b02??createEmptyPageLock(),_0xa474e9[_0x129d21(0x1f6)]),_0x1022d2=getPageIdFlag(_0xa474e9);if(_0x1022d2!==undefined){const _0x2cc425=await prepareSinglePush(_0xa474e9,_0x18a990,_0x6731c6[_0x129d21(0x210)][String(_0x1022d2)],_0x1022d2),_0x2e8d3c=await pushPreparedPage(_0xa474e9,_0x2cc425);return _0x6731c6[_0x129d21(0x210)][String(_0x2e8d3c['pageId'])]=_0x2e8d3c[_0x129d21(0x1d8)],_0x6731c6[_0x129d21(0x1e5)]=new Date()[_0x129d21(0x1e6)](),await writePageLockFile(_0x18a990[_0x129d21(0x1cb)],_0x456438),{'ok':!![],'message':_0x2e8d3c[_0x129d21(0x1dc)]?_0x129d21(0x1e9):_0x129d21(0x1d3),'data':{'appCode':_0xa474e9['appCode'],'pushedPages':[{'pageId':_0x2e8d3c[_0x129d21(0x1cd)],'type':_0x2e8d3c[_0x129d21(0x1d1)],'title':_0x2e8d3c[_0x129d21(0x1d9)],'normalized':_0x2e8d3c[_0x129d21(0x1dc)]}],'skippedPages':[],'failedPages':[],'totalPushed':0x1,'totalSkipped':0x0,'totalFailed':0x0}};}const _0x2b7c65=await buildBatchPushPlan(_0xa474e9,_0x6731c6[_0x129d21(0x210)]),_0x2ebfac=[],_0x12db0b=[],_0x21ad1c=[];for(const _0x710032 of _0x2b7c65[_0x129d21(0x1f7)]){_0x12db0b[_0x129d21(0x1ca)](_0x710032);}for(const _0x25e026 of _0x2b7c65[_0x129d21(0x1ed)]){try{const _0xfe1a84=await prepareSinglePush(_0xa474e9,_0x18a990,_0x6731c6[_0x129d21(0x210)][String(_0x25e026[_0x129d21(0x1cd)])],_0x25e026[_0x129d21(0x1cd)],_0x2b7c65[_0x129d21(0x1da)]),_0x498c61=await pushPreparedPage(_0xa474e9,_0xfe1a84);_0x6731c6[_0x129d21(0x210)][String(_0x498c61[_0x129d21(0x1cd)])]=_0x498c61['nextLockEntry'],_0x2ebfac[_0x129d21(0x1ca)]({'pageId':_0x498c61['pageId'],'type':_0x498c61['type'],'title':_0x498c61[_0x129d21(0x1d9)],'normalized':_0x498c61[_0x129d21(0x1dc)]});}catch(_0x39f7ef){_0x21ad1c[_0x129d21(0x1ca)]({'pageId':_0x25e026['pageId'],'type':_0x25e026['type'],'title':_0x25e026[_0x129d21(0x1d9)],'reason':_0x39f7ef instanceof Error?_0x39f7ef[_0x129d21(0x1d0)]:String(_0x39f7ef)});}}return _0x6731c6[_0x129d21(0x1e5)]=new Date()['toISOString'](),await writePageLockFile(_0x18a990['lockFilePath'],_0x456438),{'ok':_0x21ad1c[_0x129d21(0x212)]===0x0||_0x2ebfac['length']>0x0||_0x12db0b['length']>0x0,'message':_0x21ad1c[_0x129d21(0x212)]>0x0&&_0x2ebfac[_0x129d21(0x212)]>0x0?_0x129d21(0x1f5):_0x2ebfac[_0x129d21(0x212)]>0x0?_0x129d21(0x1d3):_0x12db0b[_0x129d21(0x212)]>0x0&&_0x21ad1c[_0x129d21(0x212)]===0x0?_0x129d21(0x1f4):_0x21ad1c[0x0]?.[_0x129d21(0x1e2)]||_0x129d21(0x1c9),'data':{'appCode':_0xa474e9['appCode'],'pushedPages':_0x2ebfac,'skippedPages':_0x12db0b,'failedPages':_0x21ad1c,'totalPushed':_0x2ebfac[_0x129d21(0x212)],'totalSkipped':_0x12db0b[_0x129d21(0x212)],'totalFailed':_0x21ad1c[_0x129d21(0x212)]}};}};async function buildPushPreview(_0x43d48e){const _0x6d7fe5=a155_0x16a62e,_0x4d0f5a=loadPageProjectConfig(_0x43d48e[_0x6d7fe5(0x1f6)]),_0x16c626=await readPageLockFile(_0x4d0f5a['lockFilePath']),{appLock:_0x23a1b3}=ensurePageLockScope(_0x16c626??createEmptyPageLock(),_0x43d48e['appCode']),_0x28360d=getPageIdFlag(_0x43d48e);if(_0x28360d!==undefined)return{'mode':_0x6d7fe5(0x1ef),'items':[await inspectPushPage(_0x43d48e,_0x4d0f5a,_0x23a1b3[_0x6d7fe5(0x210)][String(_0x28360d)],_0x28360d)]};const _0x1e40a5=await buildBatchPushPlan(_0x43d48e,_0x23a1b3[_0x6d7fe5(0x210)]);return{'mode':'batch','datasetCode':_0x1e40a5['datasetCode'],'items':[..._0x1e40a5[_0x6d7fe5(0x1f7)][_0x6d7fe5(0x1fb)](_0x478831=>({'pageId':_0x478831['pageId'],'type':_0x478831['type'],'title':_0x478831['title'],'localPath':_0x478831[_0x6d7fe5(0x1e4)],'status':'unchanged','reason':_0x478831[_0x6d7fe5(0x1e2)]})),...await Promise['all'](_0x1e40a5['candidates'][_0x6d7fe5(0x1fb)](_0x3714d6=>inspectPushPage(_0x43d48e,_0x4d0f5a,_0x23a1b3[_0x6d7fe5(0x210)][String(_0x3714d6[_0x6d7fe5(0x1cd)])],_0x3714d6['pageId'],_0x1e40a5[_0x6d7fe5(0x1da)])))]};}async function buildBatchPushPlan(_0x1dbd8b,_0x241db8){const _0x487d77=a155_0x16a62e,_0x424a57=loadPageProjectConfig(_0x1dbd8b[_0x487d77(0x1f6)]),_0x2cb521=await loadDatasetDetailForPage(_0x1dbd8b),_0x343080=_0x2cb521['id'],_0x154eb7=new Set(_0x2cb521[_0x487d77(0x1f0)]['filter'](_0x242043=>!_0x242043['deleted'])[_0x487d77(0x1fb)](_0x65e3f4=>_0x65e3f4['id'])),_0x312481=Object[_0x487d77(0x1e8)](_0x241db8)['filter'](_0x4a6290=>_0x4a6290['datasetIds'][_0x487d77(0x1e3)](_0x343080)&&_0x154eb7[_0x487d77(0x205)](_0x4a6290[_0x487d77(0x1cd)]));if(_0x312481[_0x487d77(0x212)]===0x0)throw CliErrors[_0x487d77(0x1db)]('No\x20local\x20pages\x20found\x20for\x20dataset\x20\x22'+_0x2cb521[_0x487d77(0x1ee)]+'\x22.','Run\x20`'+CLI_BIN_NAME+_0x487d77(0x1ea)+_0x2cb521[_0x487d77(0x1ee)]+_0x487d77(0x1df));const _0x300ec8=selectVersionTagGroup(_0x312481,_0x3ae852=>_0x3ae852['versionTag']??null,_0x1dbd8b[_0x487d77(0x213)](_0x487d77(0x206))),_0x35cb87=[],_0x27ad9f=[];for(const _0x57371d of _0x300ec8['items']){const _0x306126=resolvePageFilePath(_0x424a57,_0x57371d[_0x487d77(0x1cd)],_0x57371d[_0x487d77(0x1d1)]);if(!await fileExists(_0x306126)){_0x35cb87[_0x487d77(0x1ca)]({'pageId':_0x57371d[_0x487d77(0x1cd)],'type':_0x57371d['type'],'title':_0x57371d[_0x487d77(0x1d9)]});continue;}const _0x199828=await computePageFileHash(_0x306126);if(_0x199828===_0x57371d[_0x487d77(0x209)]){_0x27ad9f[_0x487d77(0x1ca)]({'pageId':_0x57371d[_0x487d77(0x1cd)],'type':_0x57371d['type'],'title':_0x57371d[_0x487d77(0x1d9)],'localPath':_0x306126,'reason':_0x487d77(0x203)});continue;}_0x35cb87[_0x487d77(0x1ca)]({'pageId':_0x57371d[_0x487d77(0x1cd)],'type':_0x57371d[_0x487d77(0x1d1)],'title':_0x57371d[_0x487d77(0x1d9)]});}return{'datasetCode':_0x2cb521['code'],'datasetId':_0x343080,'candidates':_0x35cb87,'unchanged':_0x27ad9f};}function a155_0x4d1c(){const _0x448e60=['length','str','4250395EaRouQ','localContent','658pjoHjQ','1415232SQqRpU','Local\x20file\x20not\x20found:\x20','name','10128159LglYHO','parse','status','推送失败','push','lockFilePath','\x20has\x20changed\x20since\x20last\x20pull.','pageId','remote\x20pageVersion\x20changed','8354622jCsRvV','message','type','datasetCode','推送成功','`\x20first','UNKNOWN','string','alias','nextLockEntry','title','datasetId','validation','normalized','page-','conflict','`\x20first.','utf8','blocked','reason','includes','localPath','lastSync','toISOString','No\x20lock\x20record\x20found\x20for\x20page\x20','values','推送成功,服务端已规范化\x20schema','\x20page\x20pull\x20--datasetcode\x20','Remote\x20page\x20','items','candidates','code','single','relatedPages','compress','pageVersion','2284110gmkJbh','无变更需要推送','部分页面推送失败','appCode','unchanged','/smartapi/lovrabet/update-page','2321mHJtat','72104cVdRGJ','map','remote\x20schema\x20changed','remoteDetail','Page\x20update\x20failed:\x20','Page\x20','Invalid\x20JSON\x20in\x20local\x20page\x20file:\x20','datasetIds','mode','no\x20changes','versionTag','has','version-tag','filter','548BqNovK','hash','\x20no\x20longer\x20belongs\x20to\x20the\x20selected\x20dataset.','\x20page\x20pull\x20--id\x20','page','Run\x20`','would_push','Dataset\x20alias\x20from\x20api.ts\x20(resolves\x20to\x20dataset\x20code\x20automatically)','pages','apiError'];a155_0x4d1c=function(){return _0x448e60;};return a155_0x4d1c();}async function inspectPushPage(_0x418f43,_0x446aab,_0x57b8e4,_0x33d8e6,_0x5a0a98){const _0x1670f6=a155_0x16a62e;if(!_0x57b8e4)return{'pageId':_0x33d8e6,'type':_0x1670f6(0x1d5),'title':_0x1670f6(0x1dd)+_0x33d8e6,'localPath':resolvePageFilePath(_0x446aab,_0x33d8e6,_0x1670f6(0x1d5)),'status':_0x1670f6(0x1e1),'reason':'Run\x20`'+CLI_BIN_NAME+'\x20page\x20pull\x20--id\x20'+_0x33d8e6+_0x1670f6(0x1d4)};const _0x60fe9=resolvePageFilePath(_0x446aab,_0x33d8e6,_0x57b8e4['type']);if(!await fileExists(_0x60fe9))return{'pageId':_0x33d8e6,'type':_0x57b8e4[_0x1670f6(0x1d1)],'title':_0x57b8e4[_0x1670f6(0x1d9)],'localPath':_0x60fe9,'status':_0x1670f6(0x1e1),'reason':_0x1670f6(0x1c4)+_0x60fe9};const _0x24ef45=await readFile(_0x60fe9,'utf8');try{JSON[_0x1670f6(0x1c7)](_0x24ef45);}catch{return{'pageId':_0x33d8e6,'type':_0x57b8e4['type'],'title':_0x57b8e4['title'],'localPath':_0x60fe9,'status':_0x1670f6(0x1e1),'reason':'local\x20JSON\x20is\x20invalid'};}const _0x4d5ae5=computePageContentHash(_0x24ef45);if(_0x4d5ae5===_0x57b8e4['hash'])return{'pageId':_0x33d8e6,'type':_0x57b8e4[_0x1670f6(0x1d1)],'title':_0x57b8e4[_0x1670f6(0x1d9)],'localPath':_0x60fe9,'status':_0x1670f6(0x1f7),'reason':_0x1670f6(0x203)};try{const _0x650d86=await loadPageDetailForPage(_0x418f43,_0x33d8e6);if(_0x5a0a98!=null&&!_0x650d86[_0x1670f6(0x201)][_0x1670f6(0x1e3)](_0x5a0a98))return{'pageId':_0x33d8e6,'type':_0x57b8e4[_0x1670f6(0x1d1)],'title':_0x57b8e4[_0x1670f6(0x1d9)],'localPath':_0x60fe9,'status':_0x1670f6(0x1de),'reason':_0x1670f6(0x1ff)+_0x33d8e6+'\x20no\x20longer\x20belongs\x20to\x20the\x20target\x20dataset'};const _0x154e00=_0x57b8e4[_0x1670f6(0x1f2)]!=null&&_0x650d86[_0x1670f6(0x1f2)]!=null;if(_0x154e00&&_0x57b8e4[_0x1670f6(0x1f2)]!==_0x650d86[_0x1670f6(0x1f2)])return{'pageId':_0x33d8e6,'type':_0x57b8e4['type'],'title':_0x57b8e4[_0x1670f6(0x1d9)],'localPath':_0x60fe9,'status':_0x1670f6(0x1de),'reason':_0x1670f6(0x1ce)};if(!_0x154e00&&computeSerializedSchemaHash(_0x650d86[_0x1670f6(0x1ee)])!==_0x57b8e4['hash'])return{'pageId':_0x33d8e6,'type':_0x57b8e4[_0x1670f6(0x1d1)],'title':_0x57b8e4[_0x1670f6(0x1d9)],'localPath':_0x60fe9,'status':_0x1670f6(0x1de),'reason':_0x1670f6(0x1fc)};}catch(_0x2cea16){return{'pageId':_0x33d8e6,'type':_0x57b8e4[_0x1670f6(0x1d1)],'title':_0x57b8e4[_0x1670f6(0x1d9)],'localPath':_0x60fe9,'status':_0x1670f6(0x1e1),'reason':_0x2cea16 instanceof Error?_0x2cea16[_0x1670f6(0x1d0)]:String(_0x2cea16)};}return{'pageId':_0x33d8e6,'type':_0x57b8e4[_0x1670f6(0x1d1)],'title':_0x57b8e4[_0x1670f6(0x1d9)],'localPath':_0x60fe9,'status':'would_push'};}async function prepareSinglePush(_0x4a896a,_0xd93dc5,_0x1aaa93,_0x56428b,_0x512938){const _0x1b50f2=a155_0x16a62e;if(!_0x1aaa93)throw CliErrors[_0x1b50f2(0x1db)](_0x1b50f2(0x1e7)+_0x56428b+'.',_0x1b50f2(0x20d)+CLI_BIN_NAME+_0x1b50f2(0x20b)+_0x56428b+_0x1b50f2(0x1df));const _0x5e165d=resolvePageFilePath(_0xd93dc5,_0x56428b,_0x1aaa93[_0x1b50f2(0x1d1)]);if(!await fileExists(_0x5e165d))throw CliErrors[_0x1b50f2(0x1db)](_0x1b50f2(0x1c4)+_0x5e165d,_0x1b50f2(0x20d)+CLI_BIN_NAME+_0x1b50f2(0x20b)+_0x56428b+_0x1b50f2(0x1df));const _0x271acc=await readFile(_0x5e165d,_0x1b50f2(0x1e0));try{JSON['parse'](_0x271acc);}catch{throw CliErrors['validation'](_0x1b50f2(0x200)+_0x5e165d);}const _0x4f918b=await loadPageDetailForPage(_0x4a896a,_0x56428b);if(_0x512938!=null&&!_0x4f918b[_0x1b50f2(0x201)][_0x1b50f2(0x1e3)](_0x512938))throw CliErrors['validation']('Page\x20'+_0x56428b+_0x1b50f2(0x20a));const _0x4a08a2=_0x1aaa93[_0x1b50f2(0x1f2)]!=null&&_0x4f918b[_0x1b50f2(0x1f2)]!=null;if(_0x4a08a2){if(_0x1aaa93[_0x1b50f2(0x1f2)]!==_0x4f918b['pageVersion'])throw CliErrors[_0x1b50f2(0x1db)]('Remote\x20page\x20'+_0x56428b+_0x1b50f2(0x1cc),_0x1b50f2(0x20d)+CLI_BIN_NAME+_0x1b50f2(0x20b)+_0x56428b+'`\x20first.');}else{const _0x4c234f=computeSerializedSchemaHash(_0x4f918b[_0x1b50f2(0x1ee)]);if(_0x4c234f!==_0x1aaa93['hash'])throw CliErrors[_0x1b50f2(0x1db)](_0x1b50f2(0x1eb)+_0x56428b+'\x20has\x20changed\x20since\x20last\x20pull.','Run\x20`'+CLI_BIN_NAME+'\x20page\x20pull\x20--id\x20'+_0x56428b+_0x1b50f2(0x1df));}return{'lockEntry':_0x1aaa93,'localPath':_0x5e165d,'localContent':_0x271acc,'localHash':computePageContentHash(_0x271acc),'remoteDetail':_0x4f918b};}async function pushPreparedPage(_0x5b1feb,_0x191bb5){const _0x157487=a155_0x16a62e,_0x1b0749=await updatePage(_0x5b1feb[_0x157487(0x1f6)],_0x191bb5['remoteDetail'][_0x157487(0x1cd)],_0x191bb5[_0x157487(0x215)],_0x191bb5[_0x157487(0x1fd)][_0x157487(0x201)]);if(!_0x1b0749)throw CliErrors[_0x157487(0x211)](_0x157487(0x1fe)+_0x191bb5[_0x157487(0x1fd)]['pageId']);const _0x32ca77=await loadPageDetailForPage(_0x5b1feb,_0x191bb5[_0x157487(0x1fd)][_0x157487(0x1cd)]),_0x4e99b6=serializePageSchemaForFile(_0x32ca77[_0x157487(0x1ee)]);return await writeFile(_0x191bb5[_0x157487(0x1e4)],_0x4e99b6,_0x157487(0x1e0)),{'pageId':_0x32ca77[_0x157487(0x1cd)],'type':_0x32ca77[_0x157487(0x1d1)],'title':_0x32ca77['name'],'normalized':_0x4e99b6!==serializePageSchemaForFile(_0x191bb5[_0x157487(0x215)]),'nextLockEntry':{'hash':computePageContentHash(_0x4e99b6),'pageId':_0x32ca77[_0x157487(0x1cd)],'pageVersion':_0x32ca77['pageVersion'],'type':_0x32ca77[_0x157487(0x1d1)],'title':_0x32ca77[_0x157487(0x1c5)],'datasetIds':_0x32ca77[_0x157487(0x201)],'versionTag':_0x32ca77[_0x157487(0x204)]}};}
|