@lovrabet/rabetbase-cli 2.4.3 → 2.4.4-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.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/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.d.ts +2 -0
- package/lib/commands/db/diff-refresh-start.js +1 -0
- package/lib/commands/db/diff-refresh-status.d.ts +2 -0
- package/lib/commands/db/diff-refresh-status.js +1 -0
- 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.d.ts +2 -0
- package/lib/commands/notification/config-create.js +1 -0
- package/lib/commands/notification/config-delete.d.ts +2 -0
- package/lib/commands/notification/config-delete.js +1 -0
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.d.ts +2 -0
- package/lib/commands/notification/config-update.js +1 -0
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.d.ts +97 -0
- package/lib/commands/notification/shared.js +1 -0
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/react/create.js +1 -1
- package/lib/commands/page/react/detail.js +1 -1
- package/lib/commands/page/react/list.js +1 -1
- package/lib/commands/page/react/publish.js +1 -1
- package/lib/commands/page/react/shared.js +1 -1
- package/lib/commands/page/react/syntax.js +1 -1
- package/lib/commands/page/react/template.js +1 -1
- package/lib/commands/page/react/update.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-apis-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.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.d.ts +1 -0
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.d.ts +11 -0
- package/lib/commands/project/create/materialize-project-template.js +1 -0
- package/lib/commands/project/create/project-name.d.ts +2 -0
- package/lib/commands/project/create/project-name.js +1 -0
- package/lib/commands/project/create/project-template-archive.d.ts +6 -0
- package/lib/commands/project/create/project-template-archive.js +1 -0
- package/lib/commands/project/create/project-template-path.d.ts +1 -3
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.d.ts +2 -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/create.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.d.ts +2 -0
- 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.d.ts +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.d.ts +29 -2
- 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.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.d.ts +13 -0
- 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 +9 -4
- package/skills/rabetbase/SKILL.md +33 -22
- package/skills/rabetbase/guides/backend-function.md +5 -3
- package/skills/rabetbase/guides/bff-creation-workflow.md +2 -2
- package/skills/rabetbase/guides/conflict-detection.md +2 -2
- package/skills/rabetbase/guides/database-connection-workflow.md +39 -5
- package/skills/rabetbase/guides/react-custom-page-workflow.md +16 -4
- package/skills/rabetbase/guides/sql-creation-workflow.md +4 -2
- package/skills/rabetbase/guides/sql-mybatis.md +2 -2
- package/skills/rabetbase/knowledge/page-schema/YtPage.md +3 -37
- package/skills/rabetbase/knowledge/react-page/generation-standards.md +14 -3
- package/skills/rabetbase/references/rabetbase-app-config.md +2 -2
- package/skills/rabetbase/references/rabetbase-bff-push.md +4 -5
- package/skills/rabetbase/references/rabetbase-bff-save.md +3 -3
- package/skills/rabetbase/references/rabetbase-config.md +2 -2
- package/skills/rabetbase/references/rabetbase-db-analyze.md +2 -2
- package/skills/rabetbase/references/rabetbase-db-detail.md +3 -0
- package/skills/rabetbase/references/rabetbase-db-diff-refresh.md +53 -0
- package/skills/rabetbase/references/rabetbase-db-diff.md +40 -21
- package/skills/rabetbase/references/rabetbase-db-list.md +1 -1
- package/skills/rabetbase/references/rabetbase-kb.md +5 -3
- package/skills/rabetbase/references/rabetbase-menu-asset-update.md +9 -10
- package/skills/rabetbase/references/rabetbase-menu-external-link-update.md +1 -3
- package/skills/rabetbase/references/rabetbase-menu-regroup-start.md +2 -3
- package/skills/rabetbase/references/rabetbase-notification-config-list.md +2 -2
- package/skills/rabetbase/references/rabetbase-notification-config-mutations.md +56 -0
- package/skills/rabetbase/references/rabetbase-page-react-detail.md +1 -1
- package/skills/rabetbase/references/rabetbase-page-react-list.md +1 -1
- package/skills/rabetbase/references/rabetbase-page-react-publish.md +2 -2
- package/skills/rabetbase/references/rabetbase-project-create.md +3 -0
- package/skills/rabetbase/references/rabetbase-run.md +1 -1
- package/skills/rabetbase/references/rabetbase-sql-create.md +1 -1
- package/skills/rabetbase/references/rabetbase-sql-push.md +3 -4
- package/skills/rabetbase/references/rabetbase-user-account.md +0 -1
- package/skills/rabetbase.manifest.json +5 -5
- package/templates/README.md +14 -2
- package/lib/commands/project/create/non-interactive.d.ts +0 -9
- package/lib/commands/project/create/non-interactive.js +0 -1
- package/lib/utils/copy-directory.d.ts +0 -1
- package/lib/utils/copy-directory.js +0 -1
- package/skills/rabetbase/knowledge/page-schema/LrSmartEcharts.md +0 -291
- package/skills/rabetbase/knowledge/page-schema/LrSmartStatistic.md +0 -223
- package/templates/projects/sub-app-react-demo/.prettierrc +0 -1
- package/templates/projects/sub-app-react-demo/CHANGELOG.md +0 -67
- package/templates/projects/sub-app-react-demo/README.md +0 -246
- package/templates/projects/sub-app-react-demo/docs/quick-start.md +0 -245
- package/templates/projects/sub-app-react-demo/index.html +0 -27
- package/templates/projects/sub-app-react-demo/package.json +0 -34
- package/templates/projects/sub-app-react-demo/public/logo.svg +0 -1
- package/templates/projects/sub-app-react-demo/public/vite.svg +0 -1
- package/templates/projects/sub-app-react-demo/src/api/api.ts +0 -26
- package/templates/projects/sub-app-react-demo/src/api/client.ts +0 -32
- package/templates/projects/sub-app-react-demo/src/components/demo-page-container/DemoPageContainer.module.css +0 -28
- package/templates/projects/sub-app-react-demo/src/components/demo-page-container/DemoPageContainer.tsx +0 -55
- package/templates/projects/sub-app-react-demo/src/layouts/MainLayout.tsx +0 -308
- package/templates/projects/sub-app-react-demo/src/main.tsx +0 -52
- package/templates/projects/sub-app-react-demo/src/pages/dashboard/index.tsx +0 -570
- package/templates/projects/sub-app-react-demo/src/pages/data-screen/index.tsx +0 -531
- package/templates/projects/sub-app-react-demo/src/pages/index.module.css +0 -500
- package/templates/projects/sub-app-react-demo/src/pages/index.tsx +0 -641
- package/templates/projects/sub-app-react-demo/src/pages/sdk-demo/index.tsx +0 -536
- package/templates/projects/sub-app-react-demo/src/pages/workbench/index.module.css +0 -295
- package/templates/projects/sub-app-react-demo/src/pages/workbench/index.tsx +0 -242
- package/templates/projects/sub-app-react-demo/src/router/index.tsx +0 -30
- package/templates/projects/sub-app-react-demo/src/style.css +0 -108
- package/templates/projects/sub-app-react-demo/src/utils/api.ts +0 -12
- package/templates/projects/sub-app-react-demo/src/vite-env.d.ts +0 -2
- package/templates/projects/sub-app-react-demo/tsconfig.json +0 -26
- package/templates/projects/sub-app-react-demo/vite.config.ts +0 -111
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a135_0x50a90a=a135_0x253b;(function(_0x3d931d,_0x51e1d5){const _0x14bba5=a135_0x253b,_0x1bddfa=_0x3d931d();while(!![]){try{const _0x325ac8=-parseInt(_0x14bba5(0x133))/0x1+parseInt(_0x14bba5(0x120))/0x2+-parseInt(_0x14bba5(0x132))/0x3+parseInt(_0x14bba5(0x134))/0x4+-parseInt(_0x14bba5(0x118))/0x5*(-parseInt(_0x14bba5(0x123))/0x6)+-parseInt(_0x14bba5(0x11f))/0x7+parseInt(_0x14bba5(0x12f))/0x8;if(_0x325ac8===_0x51e1d5)break;else _0x1bddfa['push'](_0x1bddfa['shift']());}catch(_0x4f60bb){_0x1bddfa['push'](_0x1bddfa['shift']());}}}(a135_0x7a52,0x65b50));function a135_0x7a52(){const _0x3f9ca2=['Delete\x20response\x20was\x20unavailable;\x20list\x20readback\x20proved\x20ID\x20absence\x20without\x20resubmitting.','high-risk-write','Notification\x20config\x20','5405687NtpbES','1441602vHJYDA','delete','verified','7884qUdSHt',';\x20do\x20not\x20resubmit\x20automatically.','Inspect\x20with\x20','unshift','mutation','some','\x20remains\x20present\x20after\x20delete.','notification','notification_config_delete_outcome_unknown','channelType','\x20delete\x20could\x20not\x20be\x20verified.','POST','10228160TyWZco',';\x20no\x20automatic\x20retry\x20was\x20attempted.','Deleting\x20this\x20app-level\x20config\x20may\x20make\x20dataset-level\x20channels\x20that\x20reference\x20it\x20unavailable;\x20dataset\x20references\x20were\x20not\x20verified\x20by\x20the\x20CLI.','2215824FjFzlc','152561tBcpZu','291188DyfsdY','30lACRAC','appCode','Delete\x20an\x20app-level\x20notification\x20config\x20after\x20exact\x20preflight','before'];a135_0x7a52=function(){return _0x3f9ca2;};return a135_0x7a52();}import{asDryRunResult}from'../../commands/common/dry-run.js';import{deleteNotificationChannelConfig,isPlatformTransportFailure,listNotificationChannelConfigs}from'../../core/api-client.js';function a135_0x253b(_0x292632,_0x1d1c14){_0x292632=_0x292632-0x118;const _0x7a52da=a135_0x7a52();let _0x253bc8=_0x7a52da[_0x292632];return _0x253bc8;}import{notificationError,notificationLookupCommand,notificationSelector,NOTIFICATION_APP_FLAG,NOTIFICATION_ID_FLAG,projectNotificationConfig,readNotificationId,requireNotificationExplicitYes,requireExactNotificationConfig,safeApiFailure,validateNotificationDeleteReadback}from'../../commands/notification/shared.js';const DELETE_PATH='/notification/channel-config/delete',REFERENCE_WARNING=a135_0x50a90a(0x131);async function prepareDelete(_0x8a9ebb){const _0x527a77=a135_0x50a90a,_0x2b5ed8=readNotificationId(_0x8a9ebb),_0x59b5b8=await requireExactNotificationConfig(_0x8a9ebb[_0x527a77(0x119)],_0x2b5ed8,_0x527a77(0x121));return{'id':_0x2b5ed8,'before':_0x59b5b8};}export const notificationConfigDelete={'service':a135_0x50a90a(0x12a),'command':'config-delete','description':a135_0x50a90a(0x11a),'risk':a135_0x50a90a(0x11d),'requiresAppCode':!![],'structuredErrors':!![],'flags':[NOTIFICATION_ID_FLAG,NOTIFICATION_APP_FLAG],async 'validate'(_0x572308){readNotificationId(_0x572308),requireNotificationExplicitYes(_0x572308);},async 'dryRun'(_0x215022){const _0x4c0048=a135_0x50a90a,_0x12f888=await prepareDelete(_0x215022),_0x3f9242=notificationLookupCommand(_0x215022[_0x4c0048(0x119)],_0x12f888[_0x4c0048(0x11b)][_0x4c0048(0x12c)]);return asDryRunResult({'operation':_0x4c0048(0x121),'selector':notificationSelector(_0x12f888[_0x4c0048(0x11b)]),'before':projectNotificationConfig(_0x12f888[_0x4c0048(0x11b)]),'after':null,'dryRun':!![],'backend':{'method':_0x4c0048(0x12e),'path':DELETE_PATH},'warnings':[REFERENCE_WARNING],'verification':{'status':'planned','lookupCommand':_0x3f9242}},{'method':_0x4c0048(0x12e),'url':DELETE_PATH});},async 'execute'(_0x3f612c){const _0x533e76=a135_0x50a90a;requireNotificationExplicitYes(_0x3f612c);const _0x3e035c=await prepareDelete(_0x3f612c),_0x4755f5=notificationLookupCommand(_0x3f612c['appCode'],_0x3e035c[_0x533e76(0x11b)]['channelType']);let _0x37d7c6=![];try{await deleteNotificationChannelConfig(_0x3e035c['id'],_0x3f612c[_0x533e76(0x119)]);}catch(_0x3a9d48){if(!isPlatformTransportFailure(_0x3a9d48))throw safeApiFailure(_0x533e76(0x121),_0x533e76(0x127),_0x533e76(0x125)+_0x4755f5+_0x533e76(0x130));_0x37d7c6=!![];}let _0x12b6f7;try{_0x12b6f7=await listNotificationChannelConfigs(_0x3f612c[_0x533e76(0x119)],_0x3e035c[_0x533e76(0x11b)][_0x533e76(0x12c)]),validateNotificationDeleteReadback(_0x12b6f7,_0x3f612c[_0x533e76(0x119)],_0x3e035c[_0x533e76(0x11b)][_0x533e76(0x12c)]);}catch{throw notificationError(_0x37d7c6?'notification_config_delete_outcome_unknown':'notification_config_delete_verification_unavailable',_0x533e76(0x11e)+_0x3e035c['id']+_0x533e76(0x12d),_0x533e76(0x125)+_0x4755f5+';\x20do\x20not\x20resubmit\x20automatically.');}if(_0x12b6f7[_0x533e76(0x128)](_0x1554a8=>_0x1554a8['id']===_0x3e035c['id']))throw notificationError(_0x37d7c6?_0x533e76(0x12b):'notification_config_delete_verification_failed','Notification\x20config\x20'+_0x3e035c['id']+_0x533e76(0x129),_0x533e76(0x125)+_0x4755f5+_0x533e76(0x124));const _0x56da08=[REFERENCE_WARNING];return _0x37d7c6&&_0x56da08[_0x533e76(0x126)](_0x533e76(0x11c)),{'ok':!![],'data':{'operation':'delete','selector':notificationSelector(_0x3e035c[_0x533e76(0x11b)]),'before':projectNotificationConfig(_0x3e035c[_0x533e76(0x11b)]),'after':null,'dryRun':![],'backend':{'method':_0x533e76(0x12e),'path':DELETE_PATH},'warnings':_0x56da08,'verification':{'status':_0x533e76(0x122),'absenceConfirmed':!![],'recoveredAfterUnknownResponse':_0x37d7c6,'lookupCommand':_0x4755f5}},'message':'Deleted\x20notification\x20config\x20'+_0x3e035c['id']};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a136_0x111fe1=a136_0xde54;(function(_0x2f7951,_0x39e155){const _0x5bbe2a=a136_0xde54,_0x12e1f2=_0x2f7951();while(!![]){try{const _0x5bbf03=parseInt(_0x5bbe2a(0xdb))/0x1+-parseInt(_0x5bbe2a(0xde))/0x2*(parseInt(_0x5bbe2a(0xd5))/0x3)+parseInt(_0x5bbe2a(0xdd))/0x4+-parseInt(_0x5bbe2a(0xd3))/0x5*(-parseInt(_0x5bbe2a(0xe4))/0x6)+-parseInt(_0x5bbe2a(0xdc))/0x7*(parseInt(_0x5bbe2a(0xd4))/0x8)+parseInt(_0x5bbe2a(0xd7))/0x9+-parseInt(_0x5bbe2a(0xe3))/0xa;if(_0x5bbf03===_0x39e155)break;else _0x12e1f2['push'](_0x12e1f2['shift']());}catch(_0x125626){_0x12e1f2['push'](_0x12e1f2['shift']());}}}(a136_0x3555,0x9eee8));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a136_0xde54(_0x560c87,_0x3894cc){_0x560c87=_0x560c87-0xd2;const _0x355503=a136_0x3555();let _0xde54e0=_0x355503[_0x560c87];return _0xde54e0;}import{listNotificationChannelConfigs}from'../../core/api-client.js';import{NOTIFICATION_CHANNEL_TYPES,projectNotificationListConfig,readNotificationChannelType}from'../../commands/notification/shared.js';export const notificationConfigList={'service':'notification','command':a136_0x111fe1(0xd6),'description':a136_0x111fe1(0xdf),'risk':a136_0x111fe1(0xe2),'flags':[APPCODE_FLAG_OPTIONAL,{'name':'type','type':a136_0x111fe1(0xd8),'description':a136_0x111fe1(0xe1),'enum':NOTIFICATION_CHANNEL_TYPES,'default':'EMAIL'}],async 'validate'(_0x158b1c){readNotificationChannelType(_0x158b1c);},async 'execute'(_0x217a59){const _0x4d091b=a136_0x111fe1,_0x546301=readNotificationChannelType(_0x217a59),_0x293335=await listNotificationChannelConfigs(_0x217a59[_0x4d091b(0xe0)],_0x546301),_0x4629c4=_0x293335[_0x4d091b(0xd9)](projectNotificationListConfig);return{'ok':!![],'data':{'appCode':_0x217a59[_0x4d091b(0xe0)],'channelType':_0x546301,'count':_0x4629c4[_0x4d091b(0xda)],'configs':_0x4629c4},'message':_0x4d091b(0xd2)+_0x4629c4[_0x4d091b(0xda)]+'\x20'+_0x546301+'\x20notification\x20config(s)'};}};function a136_0x3555(){const _0x29d43f=['List\x20app-level\x20notification\x20configs\x20and\x20their\x20configCode\x20values','appCode','Notification\x20channel\x20type','read','13061770yGsyIE','12GpLzsw','Found\x20','1470375LxCMMR','1317944pLcckD','12oELQdu','config-list','7461666DyZExa','string','map','length','1052267aFVCjk','28SQcQUy','2554056rLlcPX','245936DpSYpY'];a136_0x3555=function(){return _0x29d43f;};return a136_0x3555();}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a137_0x2e9b(){const _0x1d2df8=['1754765cEnFwS','notification_config_update_verification_unavailable','Update\x20an\x20app-level\x20notification\x20config\x20from\x20a\x20secure\x20JSON\x20patch','12YlAIzK','Notification\x20config\x20','before','11mrXfQN','Update\x20response\x20was\x20unavailable;\x20exact-ID\x20readback\x20proved\x20changed\x20safe\x20fields\x20without\x20resubmitting.','\x20update\x20could\x20not\x20be\x20verified\x20by\x20exact\x20ID.','high-risk-write','1994193DPitEM','appCode','patch','channelType','verifiedFields','allMatch','verified','planned','8sQfRSm','mutation','config-update','16006850DrIkwB','157087qUoGWZ','notification','POST','notification_config_update_outcome_unknown','payload','notification_config_update_verification_failed','2ukobnS','\x20via\x20','2217921uzekWn','264416tvtFbR','Inspect\x20ID\x20','3360200aPVXte','update',';\x20do\x20not\x20resubmit\x20automatically.','Updated\x20notification\x20config\x20','Inspect\x20with\x20--id\x20','provesChange','/notification/channel-config/update'];a137_0x2e9b=function(){return _0x1d2df8;};return a137_0x2e9b();}const a137_0x4bce88=a137_0x5ad5;(function(_0x14fbe7,_0x2a5c24){const _0x3fb2ca=a137_0x5ad5,_0x57053f=_0x14fbe7();while(!![]){try{const _0x4def18=parseInt(_0x3fb2ca(0xdf))/0x1+-parseInt(_0x3fb2ca(0xdc))/0x2*(parseInt(_0x3fb2ca(0xde))/0x3)+-parseInt(_0x3fb2ca(0xe1))/0x4+parseInt(_0x3fb2ca(0xe8))/0x5+-parseInt(_0x3fb2ca(0xeb))/0x6*(-parseInt(_0x3fb2ca(0xd6))/0x7)+-parseInt(_0x3fb2ca(0xd2))/0x8*(parseInt(_0x3fb2ca(0xca))/0x9)+parseInt(_0x3fb2ca(0xd5))/0xa*(parseInt(_0x3fb2ca(0xee))/0xb);if(_0x4def18===_0x2a5c24)break;else _0x57053f['push'](_0x57053f['shift']());}catch(_0x1290ab){_0x57053f['push'](_0x57053f['shift']());}}}(a137_0x2e9b,0x704e2));import{asDryRunResult}from'../../commands/common/dry-run.js';import{getNotificationChannelConfig,isPlatformTransportFailure,updateNotificationChannelConfig}from'../../core/api-client.js';import{assertSingleNotificationSource,mergeUpdateInput,normalizeExactNotificationConfig,notificationError,notificationLookupCommand,notificationSelector,NOTIFICATION_APP_FLAG,NOTIFICATION_ID_FLAG,NOTIFICATION_INPUT_FLAGS,plannedUpdateProjection,projectNotificationConfig,readNotificationDocument,readNotificationId,requestedSafeFieldsMatch,requireNotificationExplicitYes,requireExactNotificationConfig,safeApiFailure}from'../../commands/notification/shared.js';const UPDATE_PATH=a137_0x4bce88(0xe7);async function prepareUpdate(_0x3499ae){const _0x536f2e=a137_0x4bce88,_0x4548b0=readNotificationId(_0x3499ae),_0x5b7163=await readNotificationDocument(_0x3499ae,'update'),_0x95e647=await requireExactNotificationConfig(_0x3499ae[_0x536f2e(0xcb)],_0x4548b0,_0x536f2e(0xe2));return{'id':_0x4548b0,'patch':_0x5b7163,'before':_0x95e647,'payload':mergeUpdateInput(_0x95e647,_0x5b7163),'planned':plannedUpdateProjection(_0x95e647,_0x5b7163)};}function a137_0x5ad5(_0x5da6db,_0x4d555f){_0x5da6db=_0x5da6db-0xc8;const _0x2e9bdf=a137_0x2e9b();let _0x5ad542=_0x2e9bdf[_0x5da6db];return _0x5ad542;}export const notificationConfigUpdate={'service':a137_0x4bce88(0xd7),'command':a137_0x4bce88(0xd4),'description':a137_0x4bce88(0xea),'risk':a137_0x4bce88(0xc9),'requiresAppCode':!![],'structuredErrors':!![],'flags':[NOTIFICATION_ID_FLAG,...NOTIFICATION_INPUT_FLAGS,NOTIFICATION_APP_FLAG],async 'validate'(_0x26ad36){readNotificationId(_0x26ad36),assertSingleNotificationSource(_0x26ad36),requireNotificationExplicitYes(_0x26ad36);},async 'dryRun'(_0x4e85ac){const _0x5b34d2=a137_0x4bce88,_0x3704e6=await prepareUpdate(_0x4e85ac),_0x3838e8=notificationLookupCommand(_0x4e85ac[_0x5b34d2(0xcb)],_0x3704e6[_0x5b34d2(0xed)][_0x5b34d2(0xcd)]);return asDryRunResult({'operation':_0x5b34d2(0xe2),'selector':notificationSelector(_0x3704e6[_0x5b34d2(0xed)]),'before':projectNotificationConfig(_0x3704e6['before']),'after':_0x3704e6[_0x5b34d2(0xd1)],'dryRun':!![],'backend':{'method':_0x5b34d2(0xd8),'path':UPDATE_PATH},'warnings':[],'verification':{'status':_0x5b34d2(0xd1),'lookupCommand':_0x3838e8}},{'method':_0x5b34d2(0xd8),'url':UPDATE_PATH});},async 'execute'(_0x3276fe){const _0x104ac1=a137_0x4bce88;requireNotificationExplicitYes(_0x3276fe);const _0x138e74=await prepareUpdate(_0x3276fe),_0x389f90=notificationLookupCommand(_0x3276fe['appCode'],_0x138e74['before'][_0x104ac1(0xcd)]);let _0x5e06cb=![];try{await updateNotificationChannelConfig(_0x138e74[_0x104ac1(0xda)]);}catch(_0x2c6a42){if(!isPlatformTransportFailure(_0x2c6a42))throw safeApiFailure(_0x104ac1(0xe2),_0x104ac1(0xd3),_0x104ac1(0xe0)+_0x138e74['id']+'\x20with\x20'+_0x389f90+';\x20no\x20automatic\x20retry\x20was\x20attempted.');_0x5e06cb=!![];}let _0x5305b5;try{const _0x462f53=await getNotificationChannelConfig(_0x138e74['id'],_0x3276fe[_0x104ac1(0xcb)]);_0x5305b5=normalizeExactNotificationConfig(_0x462f53,_0x138e74['id'],_0x3276fe['appCode']);}catch{throw notificationError(_0x5e06cb?'notification_config_update_outcome_unknown':_0x104ac1(0xe9),_0x104ac1(0xec)+_0x138e74['id']+_0x104ac1(0xc8),_0x104ac1(0xe5)+_0x138e74['id']+'\x20via\x20'+_0x389f90+_0x104ac1(0xe3));}const _0xb345=requestedSafeFieldsMatch(_0x138e74[_0x104ac1(0xed)],_0x5305b5,_0x138e74[_0x104ac1(0xcc)]);if(!_0xb345[_0x104ac1(0xcf)]||_0x5e06cb&&!_0xb345[_0x104ac1(0xe6)])throw notificationError(_0x5e06cb?_0x104ac1(0xd9):_0x104ac1(0xdb),_0x104ac1(0xec)+_0x138e74['id']+'\x20readback\x20does\x20not\x20prove\x20the\x20requested\x20update.',_0x104ac1(0xe5)+_0x138e74['id']+_0x104ac1(0xdd)+_0x389f90+_0x104ac1(0xe3));const _0x44f5b2=_0x5e06cb?[_0x104ac1(0xef)]:[];return{'ok':!![],'data':{'operation':'update','selector':notificationSelector(_0x5305b5),'before':projectNotificationConfig(_0x138e74[_0x104ac1(0xed)]),'after':projectNotificationConfig(_0x5305b5),'dryRun':![],'backend':{'method':_0x104ac1(0xd8),'path':UPDATE_PATH},'warnings':_0x44f5b2,'verification':{'status':_0x104ac1(0xd0),'recoveredAfterUnknownResponse':_0x5e06cb,'verifiedFields':_0xb345[_0x104ac1(0xce)],'lookupCommand':_0x389f90}},'message':_0x104ac1(0xe4)+_0x5305b5['id']};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a138_0x5a65(_0xff28e9,_0x55dcfd){_0xff28e9=_0xff28e9-0xe7;const _0x1c109c=a138_0x1c10();let _0x5a652d=_0x1c109c[_0xff28e9];return _0x5a652d;}(function(_0x41a59f,_0x856eae){const _0x5a3092=a138_0x5a65,_0x39f455=_0x41a59f();while(!![]){try{const _0x33d3de=-parseInt(_0x5a3092(0xf0))/0x1*(parseInt(_0x5a3092(0xe7))/0x2)+parseInt(_0x5a3092(0xec))/0x3*(parseInt(_0x5a3092(0xe8))/0x4)+parseInt(_0x5a3092(0xef))/0x5+parseInt(_0x5a3092(0xee))/0x6+-parseInt(_0x5a3092(0xea))/0x7+parseInt(_0x5a3092(0xed))/0x8*(-parseInt(_0x5a3092(0xe9))/0x9)+parseInt(_0x5a3092(0xeb))/0xa;if(_0x33d3de===_0x856eae)break;else _0x39f455['push'](_0x39f455['shift']());}catch(_0x155bca){_0x39f455['push'](_0x39f455['shift']());}}}(a138_0x1c10,0x49b69));import{notificationConfigList}from'../../commands/notification/config-list.js';import{notificationConfigCreate}from'../../commands/notification/config-create.js';function a138_0x1c10(){const _0x6c0347=['16dUFKGn','1668168dIdVTP','850665NmxRZY','529786jQxevu','2wwgDEF','894508PtFpMo','2698857VvsrMn','84035IsuooC','7716780GipGXI','3jRTaPU'];a138_0x1c10=function(){return _0x6c0347;};return a138_0x1c10();}import{notificationConfigUpdate}from'../../commands/notification/config-update.js';import{notificationConfigDelete}from'../../commands/notification/config-delete.js';export const notificationDefinitions=[notificationConfigList,notificationConfigCreate,notificationConfigUpdate,notificationConfigDelete];
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import type { NotificationChannelConfigItem, NotificationChannelConfigMutationInput, NotificationChannelType } from "../../core/api-client.js";
|
|
2
|
+
import { CliError } from "../../errors.js";
|
|
3
|
+
import type { CommandDefinition, FlagDef, RuntimeContext } from "../../framework/types.js";
|
|
4
|
+
export declare const NOTIFICATION_CHANNEL_TYPES: NotificationChannelType[];
|
|
5
|
+
export declare const DEFAULT_NOTIFICATION_CONNECT_TIMEOUT = 5000;
|
|
6
|
+
export declare const DEFAULT_NOTIFICATION_READ_TIMEOUT = 10000;
|
|
7
|
+
type NotificationContext = Parameters<NonNullable<CommandDefinition["execute"]>>[0];
|
|
8
|
+
type JsonObject = Record<string, unknown>;
|
|
9
|
+
type SensitiveSource = {
|
|
10
|
+
kind: "file";
|
|
11
|
+
path: string;
|
|
12
|
+
} | {
|
|
13
|
+
kind: "stdin";
|
|
14
|
+
} | {
|
|
15
|
+
kind: "env";
|
|
16
|
+
name: string;
|
|
17
|
+
};
|
|
18
|
+
export interface NotificationConfigDocument {
|
|
19
|
+
configName?: string;
|
|
20
|
+
channelType?: NotificationChannelType;
|
|
21
|
+
endpointUrl?: string | null;
|
|
22
|
+
channelConfig?: JsonObject | null;
|
|
23
|
+
description?: string | null;
|
|
24
|
+
connectTimeout?: number | null;
|
|
25
|
+
readTimeout?: number | null;
|
|
26
|
+
}
|
|
27
|
+
export interface NotificationConfigProjection {
|
|
28
|
+
id: number | null;
|
|
29
|
+
appCode: string;
|
|
30
|
+
configCode: string | null;
|
|
31
|
+
configName: string;
|
|
32
|
+
channelType: NotificationChannelType;
|
|
33
|
+
endpointUrl: "<redacted>" | null;
|
|
34
|
+
channelConfig: "<redacted>" | null;
|
|
35
|
+
description: string | null;
|
|
36
|
+
connectTimeout: number | null;
|
|
37
|
+
readTimeout: number | null;
|
|
38
|
+
}
|
|
39
|
+
export interface ExactNotificationConfig extends NotificationConfigProjection {
|
|
40
|
+
id: number;
|
|
41
|
+
configCode: string;
|
|
42
|
+
endpointUrlRaw: string | null;
|
|
43
|
+
channelConfigRaw: string | null;
|
|
44
|
+
}
|
|
45
|
+
export declare const NOTIFICATION_INPUT_FLAGS: FlagDef[];
|
|
46
|
+
export declare const NOTIFICATION_ID_FLAG: FlagDef;
|
|
47
|
+
export declare const NOTIFICATION_APP_FLAG: FlagDef;
|
|
48
|
+
export declare function notificationError(code: string, message: string, hint?: string): CliError;
|
|
49
|
+
export declare function readNotificationId(ctx: NotificationContext): number;
|
|
50
|
+
export declare function requireNotificationExplicitYes(ctx: NotificationContext): void;
|
|
51
|
+
export declare function readNotificationChannelType(ctx: RuntimeContext | NotificationContext, flagName?: string, fallback?: string): NotificationChannelType;
|
|
52
|
+
export declare function assertSingleNotificationSource(ctx: NotificationContext): SensitiveSource;
|
|
53
|
+
export declare function readNotificationDocument(ctx: NotificationContext, mode: "create" | "update"): Promise<NotificationConfigDocument>;
|
|
54
|
+
export declare function projectNotificationListConfig(item: NotificationChannelConfigItem, index: number): {
|
|
55
|
+
id: number | null;
|
|
56
|
+
configCode: string;
|
|
57
|
+
configName: string;
|
|
58
|
+
channelType: string;
|
|
59
|
+
description: string | null;
|
|
60
|
+
createTime: string | null;
|
|
61
|
+
updateTime: string | null;
|
|
62
|
+
};
|
|
63
|
+
export declare function normalizeExactNotificationConfig(item: NotificationChannelConfigItem, expectedId: number, expectedAppCode: string): ExactNotificationConfig;
|
|
64
|
+
export declare function requireExactNotificationConfig(appCode: string, id: number, operation: "update" | "delete"): Promise<ExactNotificationConfig>;
|
|
65
|
+
export declare function projectNotificationConfig(value: {
|
|
66
|
+
id?: number | null;
|
|
67
|
+
appCode: string;
|
|
68
|
+
configCode?: string | null;
|
|
69
|
+
configName: string;
|
|
70
|
+
channelType: NotificationChannelType;
|
|
71
|
+
endpointUrl?: string | JsonObject | null;
|
|
72
|
+
channelConfig?: string | JsonObject | null;
|
|
73
|
+
description?: string | null;
|
|
74
|
+
connectTimeout?: number | null;
|
|
75
|
+
readTimeout?: number | null;
|
|
76
|
+
}): NotificationConfigProjection;
|
|
77
|
+
export declare function notificationSelector(record: ExactNotificationConfig): {
|
|
78
|
+
appCode: string;
|
|
79
|
+
id: number;
|
|
80
|
+
configCode: string;
|
|
81
|
+
configName: string;
|
|
82
|
+
channelType: NotificationChannelType;
|
|
83
|
+
};
|
|
84
|
+
export declare function createMutationInput(appCode: string, document: NotificationConfigDocument): NotificationChannelConfigMutationInput;
|
|
85
|
+
export declare function mergeUpdateInput(before: ExactNotificationConfig, patch: NotificationConfigDocument): NotificationChannelConfigMutationInput & {
|
|
86
|
+
id: number;
|
|
87
|
+
};
|
|
88
|
+
export declare function plannedUpdateProjection(before: ExactNotificationConfig, patch: NotificationConfigDocument): NotificationConfigProjection;
|
|
89
|
+
export declare function requestedSafeFieldsMatch(before: ExactNotificationConfig, after: ExactNotificationConfig, patch: NotificationConfigDocument): {
|
|
90
|
+
allMatch: boolean;
|
|
91
|
+
provesChange: boolean;
|
|
92
|
+
verifiedFields: string[];
|
|
93
|
+
};
|
|
94
|
+
export declare function validateNotificationDeleteReadback(items: NotificationChannelConfigItem[], appCode: string, channelType: NotificationChannelType): void;
|
|
95
|
+
export declare function safeApiFailure(operation: "create" | "update" | "delete", stage: "mutation" | "verification" | "preflight", hint: string): CliError;
|
|
96
|
+
export declare function notificationLookupCommand(appCode: string, channelType: NotificationChannelType): string;
|
|
97
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a139_0x216800=a139_0x2ea6;(function(_0x11fc61,_0x27d6ae){const _0x3f6787=a139_0x2ea6,_0x44c1f8=_0x11fc61();while(!![]){try{const _0x211e30=-parseInt(_0x3f6787(0x162))/0x1*(parseInt(_0x3f6787(0x1af))/0x2)+-parseInt(_0x3f6787(0x174))/0x3+parseInt(_0x3f6787(0x166))/0x4+parseInt(_0x3f6787(0x13c))/0x5*(-parseInt(_0x3f6787(0x16f))/0x6)+parseInt(_0x3f6787(0x14d))/0x7+parseInt(_0x3f6787(0x189))/0x8+-parseInt(_0x3f6787(0x172))/0x9*(-parseInt(_0x3f6787(0x1a0))/0xa);if(_0x211e30===_0x27d6ae)break;else _0x44c1f8['push'](_0x44c1f8['shift']());}catch(_0x2dc578){_0x44c1f8['push'](_0x44c1f8['shift']());}}}(a139_0x3eb1,0x561a0));import{readFile}from'node:fs/promises';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{getNotificationChannelConfig}from'../../core/api-client.js';import{CliError,CliErrors}from'../../errors.js';export const NOTIFICATION_CHANNEL_TYPES=[a139_0x216800(0x173),a139_0x216800(0x17b),a139_0x216800(0x199),a139_0x216800(0x13f),a139_0x216800(0x18e)];export const DEFAULT_NOTIFICATION_CONNECT_TIMEOUT=0x1388;export const DEFAULT_NOTIFICATION_READ_TIMEOUT=0x2710;const ALLOWED_INPUT_FIELDS=new Set([a139_0x216800(0x17e),a139_0x216800(0x14e),'endpointUrl','channelConfig',a139_0x216800(0x1b1),'connectTimeout','readTimeout']),FORBIDDEN_IDENTITY_FIELDS=new Set(['id',a139_0x216800(0x1bf),a139_0x216800(0x170),a139_0x216800(0x154)]),EMAIL_RECIPIENT_FIELDS=new Set(['emailTargets','recipients',a139_0x216800(0x1b4),a139_0x216800(0x1c2),a139_0x216800(0x1b7),a139_0x216800(0x1a3),a139_0x216800(0x150),'to','cc']);function a139_0x3eb1(){const _0x5307d5=['has','\x22channelType\x22.','\x20characters.','notification_config_response_invalid','appCode','Notification\x20JSON\x20channelConfig\x20field\x20\x22','boolean','bccList','153410IKzdez','mutation','a\x20non-empty\x20string','WECOM','Read\x20the\x20notification\x20JSON\x20document\x20from\x20a\x20named\x20environment\x20variable','name','\x20--format\x20compress','failed','Invalid\x20notification\x20config\x20response.','a\x20JSON\x20object','stringify','connectTimeout','\x22configName\x22.','Allowed\x20values:\x20','Notification\x20JSON\x20field\x20\x22','rabetbase\x20notification\x20config-list\x20--appcode\x20','channelConfigRaw','3040660ejhewa','channelType','\x22\x20must\x20be\x20a\x20non-empty\x20string.','fromName','isSafeInteger','Notification\x20config\x20list\x20item\x20','--id\x20must\x20be\x20a\x20positive\x20safe\x20integer.','channelCode','Read\x20the\x20notification\x20JSON\x20document\x20from\x20a\x20UTF-8\x20file','\x22\x20must\x20be\x20a\x20non-negative\x20safe\x20integer\x20or\x20null.','\x20does\x20not\x20belong\x20to\x20the\x20resolved\x20app.','Provide\x20one\x20valid\x20JSON\x20object;\x20source\x20contents\x20are\x20not\x20included\x20in\x20errors.','\x20has\x20an\x20unsupported\x20channelType.','includes','trim','\x22\x20is\x20forbidden.','path','createTime','object','\x22\x20is\x20controlled\x20by\x20the\x20CLI\x20or\x20server\x20and\x20is\x20forbidden.','call','6718ZFSVQM','str','messageTemplate','length','2305324Nglfgu','endpointUrlRaw','\x20is\x20missing\x20required\x20field\x20\x22','\x20has\x20an\x20invalid\x20channelType.','kind','notification_config_','notification_config_source_unavailable','Notification\x20JSON\x20environment\x20variable\x20is\x20not\x20set:\x20','isArray','114rToihj','configCode','readTimeout','660303gNpPZu','EMAIL','193431TSFOvM','some','Use\x20exactly\x20one\x20of\x20--file\x20<path>,\x20--stdin,\x20or\x20--from-env\x20<NAME>.','parse','notification_config_update_empty','Missing\x20notification\x20JSON\x20source.','every','FEISHU','setEncoding','type','configName','<redacted>','notification_config_field_required','validation','join','from-env','Inspect\x20with\x20rabetbase\x20notification\x20config-list\x20--appcode\x20','Invalid\x20--','\x20must\x20be\x20an\x20object.','\x20--type\x20','Notification\x20config\x20','2284152tjcVSP','preflight','notification_config_json_invalid','Item\x20','Notification\x20JSON\x20source\x20is\x20ambiguous.','WEBHOOK','\x20has\x20an\x20invalid\x20appCode.','dry-run','Unknown\x20notification\x20JSON\x20field\x20\x22','a\x20string\x20or\x20null','updateTime','file','notification_config_field_invalid','keys','channelConfig','Application-level\x20notification\x20config\x20ID','DINGTALK','\x22\x20cannot\x20exceed\x20','Create\x20JSON\x20requires\x20field\x20','environment\x20variable\x20','Notification\x20JSON\x20field\x20\x22channelType\x22\x20is\x20unsupported.','endpointUrl','Notification\x20config\x20detail\x20did\x20not\x20contain\x20the\x20requested\x20ID\x20','10LjDvuL','Notification\x20JSON\x20from\x20','push','subjectPrefix','yes','number','string','Run\x20the\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.','utf8','stdin','notification_config_confirmation_required','_unavailable','hasOwnProperty','create','entries','110SYanpj','\x20has\x20an\x20invalid\x20id.','description','env','prototype','ccList','\x20failed.','bool','replyTo','notification_config_field_forbidden','\x20--type\x20<CHANNEL_TYPE>\x20--format\x20compress;\x20no\x20mutation\x20was\x20submitted.','update'];a139_0x3eb1=function(){return _0x5307d5;};return a139_0x3eb1();}export const NOTIFICATION_INPUT_FLAGS=[{'name':a139_0x216800(0x194),'type':a139_0x216800(0x1a6),'required':![],'description':a139_0x216800(0x155)},{'name':a139_0x216800(0x1a9),'type':a139_0x216800(0x1c1),'required':![],'default':![],'description':'Read\x20the\x20notification\x20JSON\x20document\x20from\x20stdin'},{'name':a139_0x216800(0x183),'type':a139_0x216800(0x1a6),'required':![],'description':a139_0x216800(0x140)}];export const NOTIFICATION_ID_FLAG={'name':'id','type':a139_0x216800(0x1a5),'required':!![],'description':a139_0x216800(0x198)};export const NOTIFICATION_APP_FLAG=APPCODE_FLAG_OPTIONAL;export function notificationError(_0xdab7fd,_0x1f14bc,_0x4470a1){return new CliError(_0xdab7fd,0x1,_0x1f14bc,_0x4470a1);}export function readNotificationId(_0x563404){const _0x1570c3=a139_0x216800,_0xda8574=_0x563404['num']('id');if(!Number[_0x1570c3(0x151)](_0xda8574)||_0xda8574<=0x0)throw notificationError('notification_config_id_invalid',_0x1570c3(0x153));return _0xda8574;}export function requireNotificationExplicitYes(_0x5cad85){const _0x34733c=a139_0x216800;if(_0x5cad85[_0x34733c(0x1b6)](_0x34733c(0x190))||_0x5cad85[_0x34733c(0x1b6)](_0x34733c(0x1a4)))return;throw notificationError(_0x34733c(0x1aa),'This\x20notification\x20config\x20mutation\x20requires\x20explicit\x20--yes.',_0x34733c(0x1a7));}export function readNotificationChannelType(_0x558fc1,_0x5b5f03=a139_0x216800(0x17d),_0x509224=a139_0x216800(0x173)){const _0x3a014e=a139_0x216800,_0x582846=_0x558fc1[_0x3a014e(0x163)](_0x5b5f03)[_0x3a014e(0x15b)]()||_0x509224;if(!NOTIFICATION_CHANNEL_TYPES[_0x3a014e(0x15a)](_0x582846))throw CliErrors[_0x3a014e(0x181)](_0x3a014e(0x185)+_0x5b5f03+':\x20'+_0x582846,_0x3a014e(0x149)+NOTIFICATION_CHANNEL_TYPES['join'](',\x20')+'.');return _0x582846;}export function assertSingleNotificationSource(_0x492855){const _0x41dcd1=a139_0x216800,_0x9bcf44=[],_0x29dafa=_0x492855[_0x41dcd1(0x163)](_0x41dcd1(0x194))[_0x41dcd1(0x15b)]();if(_0x29dafa)_0x9bcf44[_0x41dcd1(0x1a2)]({'kind':_0x41dcd1(0x194),'path':_0x29dafa});if(_0x492855[_0x41dcd1(0x1b6)](_0x41dcd1(0x1a9)))_0x9bcf44['push']({'kind':_0x41dcd1(0x1a9)});const _0x5de3d4=_0x492855[_0x41dcd1(0x163)](_0x41dcd1(0x183))[_0x41dcd1(0x15b)]();if(_0x5de3d4)_0x9bcf44['push']({'kind':_0x41dcd1(0x1b2),'name':_0x5de3d4});if(_0x9bcf44['length']===0x0)throw CliErrors[_0x41dcd1(0x181)](_0x41dcd1(0x179),_0x41dcd1(0x176));if(_0x9bcf44[_0x41dcd1(0x165)]>0x1)throw CliErrors[_0x41dcd1(0x181)](_0x41dcd1(0x18d),_0x41dcd1(0x176));return _0x9bcf44[0x0];}function a139_0x2ea6(_0x4a4be2,_0x3a1aca){_0x4a4be2=_0x4a4be2-0x13c;const _0x3eb174=a139_0x3eb1();let _0x2ea6f3=_0x3eb174[_0x4a4be2];return _0x2ea6f3;}export async function readNotificationDocument(_0x9ea806,_0x1baa2a){const _0x24f2f1=a139_0x216800,_0x1e7341=assertSingleNotificationSource(_0x9ea806),_0x38616e=_0x1e7341[_0x24f2f1(0x16a)]===_0x24f2f1(0x194)?'file\x20'+_0x1e7341[_0x24f2f1(0x15d)]:_0x1e7341[_0x24f2f1(0x16a)]===_0x24f2f1(0x1b2)?_0x24f2f1(0x19c)+_0x1e7341[_0x24f2f1(0x141)]:_0x24f2f1(0x1a9);let _0xd2d331;try{if(_0x1e7341[_0x24f2f1(0x16a)]===_0x24f2f1(0x194))_0xd2d331=await readFile(_0x1e7341['path'],_0x24f2f1(0x1a8));else{if(_0x1e7341[_0x24f2f1(0x16a)]===_0x24f2f1(0x1b2)){if(!(_0x1e7341[_0x24f2f1(0x141)]in process.env))throw notificationError(_0x24f2f1(0x16c),_0x24f2f1(0x16d)+_0x1e7341[_0x24f2f1(0x141)]);_0xd2d331=process.env[_0x1e7341.name]??'';}else _0xd2d331=await readStdin();}}catch(_0x8969f2){if(_0x8969f2 instanceof CliError)throw _0x8969f2;throw notificationError(_0x24f2f1(0x16c),'Unable\x20to\x20read\x20notification\x20JSON\x20from\x20'+_0x38616e+'.');}let _0x58b0e8;try{_0x58b0e8=JSON[_0x24f2f1(0x177)](_0xd2d331);}catch{throw notificationError(_0x24f2f1(0x18b),_0x24f2f1(0x1a1)+_0x38616e+'\x20is\x20invalid.',_0x24f2f1(0x158));}if(!isJsonObject(_0x58b0e8))throw notificationError(_0x24f2f1(0x18b),_0x24f2f1(0x1a1)+_0x38616e+_0x24f2f1(0x186));return validateNotificationDocument(_0x58b0e8,_0x1baa2a);}export function projectNotificationListConfig(_0x416df2,_0xf33dc0){const _0x3bb913=a139_0x216800;return{'id':typeof _0x416df2['id']===_0x3bb913(0x1a5)?_0x416df2['id']:null,'configCode':requireResponseString(_0x416df2[_0x3bb913(0x170)],_0x3bb913(0x170),_0xf33dc0),'configName':requireResponseString(_0x416df2[_0x3bb913(0x17e)],'configName',_0xf33dc0),'channelType':requireResponseString(_0x416df2[_0x3bb913(0x14e)],_0x3bb913(0x14e),_0xf33dc0),'description':normalizeNullableString(_0x416df2[_0x3bb913(0x1b1)]),'createTime':normalizeNullableString(_0x416df2[_0x3bb913(0x15e)]),'updateTime':normalizeNullableString(_0x416df2[_0x3bb913(0x193)])};}export function normalizeExactNotificationConfig(_0xa8618a,_0x19a12d,_0x28f3cd){const _0x532e99=a139_0x216800;if(!Number[_0x532e99(0x151)](_0xa8618a['id'])||_0xa8618a['id']!==_0x19a12d)throw notificationError(_0x532e99(0x1be),_0x532e99(0x19f)+_0x19a12d+'.');if(_0xa8618a['appCode']!==_0x28f3cd)throw notificationError(_0x532e99(0x1be),'Notification\x20config\x20'+_0x19a12d+_0x532e99(0x157));const _0x44bc74=requireExactString(_0xa8618a[_0x532e99(0x17e)],'configName',_0x19a12d),_0x4c7af7=requireExactString(_0xa8618a[_0x532e99(0x170)],_0x532e99(0x170),_0x19a12d),_0x24e4f2=requireExactString(_0xa8618a[_0x532e99(0x14e)],_0x532e99(0x14e),_0x19a12d);if(!NOTIFICATION_CHANNEL_TYPES[_0x532e99(0x15a)](_0x24e4f2))throw notificationError('notification_config_response_invalid',_0x532e99(0x188)+_0x19a12d+_0x532e99(0x159));const _0x1503e=responseNullableString(_0xa8618a[_0x532e99(0x19e)],_0x532e99(0x19e),_0x19a12d),_0x169edf=responseNullableString(_0xa8618a[_0x532e99(0x197)],_0x532e99(0x197),_0x19a12d),_0x333f2c=responseNullableString(_0xa8618a[_0x532e99(0x1b1)],'description',_0x19a12d),_0x340ce4=responseNullableTimeout(_0xa8618a[_0x532e99(0x147)],_0x532e99(0x147),_0x19a12d),_0x426eb2=responseNullableTimeout(_0xa8618a['readTimeout'],_0x532e99(0x171),_0x19a12d);return{'id':_0x19a12d,'appCode':_0x28f3cd,'configCode':_0x4c7af7,'configName':_0x44bc74,'channelType':_0x24e4f2,'endpointUrl':redactSensitive(_0x1503e),'channelConfig':redactSensitive(_0x169edf),'description':_0x333f2c,'connectTimeout':_0x340ce4,'readTimeout':_0x426eb2,'endpointUrlRaw':_0x1503e,'channelConfigRaw':_0x169edf};}export async function requireExactNotificationConfig(_0x462956,_0x11bfcf,_0x60274d){const _0x4cca01=a139_0x216800;let _0x491992;try{_0x491992=await getNotificationChannelConfig(_0x11bfcf,_0x462956);}catch{throw safeApiFailure(_0x60274d,_0x4cca01(0x18a),_0x4cca01(0x184)+_0x462956+_0x4cca01(0x1b9));}return normalizeExactNotificationConfig(_0x491992,_0x11bfcf,_0x462956);}export function projectNotificationConfig(_0x392634){const _0x50b683=a139_0x216800;return{'id':_0x392634['id']??null,'appCode':_0x392634[_0x50b683(0x1bf)],'configCode':_0x392634[_0x50b683(0x170)]??null,'configName':_0x392634[_0x50b683(0x17e)],'channelType':_0x392634[_0x50b683(0x14e)],'endpointUrl':redactSensitive(_0x392634[_0x50b683(0x19e)]),'channelConfig':redactSensitive(_0x392634[_0x50b683(0x197)]),'description':_0x392634[_0x50b683(0x1b1)]??null,'connectTimeout':_0x392634[_0x50b683(0x147)]??null,'readTimeout':_0x392634[_0x50b683(0x171)]??null};}export function notificationSelector(_0xbf2308){const _0x37acbb=a139_0x216800;return{'appCode':_0xbf2308[_0x37acbb(0x1bf)],'id':_0xbf2308['id'],'configCode':_0xbf2308[_0x37acbb(0x170)],'configName':_0xbf2308[_0x37acbb(0x17e)],'channelType':_0xbf2308[_0x37acbb(0x14e)]};}export function createMutationInput(_0x2a3f67,_0xb0714d){const _0x29f2c5=a139_0x216800;return{'appCode':_0x2a3f67,'configName':_0xb0714d[_0x29f2c5(0x17e)],'channelType':_0xb0714d[_0x29f2c5(0x14e)],...hasOwn(_0xb0714d,_0x29f2c5(0x19e))?{'endpointUrl':_0xb0714d[_0x29f2c5(0x19e)]}:{},...hasOwn(_0xb0714d,_0x29f2c5(0x197))?{'channelConfig':serializeChannelConfig(_0xb0714d[_0x29f2c5(0x197)])}:{},...hasOwn(_0xb0714d,_0x29f2c5(0x1b1))?{'description':_0xb0714d['description']}:{},...hasOwn(_0xb0714d,_0x29f2c5(0x147))?{'connectTimeout':_0xb0714d['connectTimeout']}:{},...hasOwn(_0xb0714d,_0x29f2c5(0x171))?{'readTimeout':_0xb0714d[_0x29f2c5(0x171)]}:{}};}export function mergeUpdateInput(_0x15b64a,_0x2a2313){const _0x2bbbeb=a139_0x216800;return{'id':_0x15b64a['id'],'appCode':_0x15b64a[_0x2bbbeb(0x1bf)],'configName':_0x2a2313[_0x2bbbeb(0x17e)]??_0x15b64a['configName'],'channelType':_0x2a2313['channelType']??_0x15b64a[_0x2bbbeb(0x14e)],'endpointUrl':hasOwn(_0x2a2313,_0x2bbbeb(0x19e))?_0x2a2313['endpointUrl']:_0x15b64a[_0x2bbbeb(0x167)],'channelConfig':hasOwn(_0x2a2313,_0x2bbbeb(0x197))?serializeChannelConfig(_0x2a2313[_0x2bbbeb(0x197)]):_0x15b64a[_0x2bbbeb(0x14c)],'description':hasOwn(_0x2a2313,_0x2bbbeb(0x1b1))?_0x2a2313[_0x2bbbeb(0x1b1)]:_0x15b64a['description'],'connectTimeout':hasOwn(_0x2a2313,_0x2bbbeb(0x147))?_0x2a2313[_0x2bbbeb(0x147)]:_0x15b64a[_0x2bbbeb(0x147)],'readTimeout':hasOwn(_0x2a2313,_0x2bbbeb(0x171))?_0x2a2313[_0x2bbbeb(0x171)]:_0x15b64a['readTimeout']};}export function plannedUpdateProjection(_0x29b695,_0x2c3468){const _0x5319c6=a139_0x216800;return projectNotificationConfig({'id':_0x29b695['id'],'appCode':_0x29b695[_0x5319c6(0x1bf)],'configCode':_0x29b695[_0x5319c6(0x170)],'configName':_0x2c3468[_0x5319c6(0x17e)]??_0x29b695[_0x5319c6(0x17e)],'channelType':_0x2c3468[_0x5319c6(0x14e)]??_0x29b695[_0x5319c6(0x14e)],'endpointUrl':hasOwn(_0x2c3468,_0x5319c6(0x19e))?_0x2c3468[_0x5319c6(0x19e)]:_0x29b695[_0x5319c6(0x167)],'channelConfig':hasOwn(_0x2c3468,_0x5319c6(0x197))?_0x2c3468['channelConfig']:_0x29b695[_0x5319c6(0x14c)],'description':hasOwn(_0x2c3468,'description')?_0x2c3468[_0x5319c6(0x1b1)]:_0x29b695[_0x5319c6(0x1b1)],'connectTimeout':hasOwn(_0x2c3468,_0x5319c6(0x147))?_0x2c3468[_0x5319c6(0x147)]??DEFAULT_NOTIFICATION_CONNECT_TIMEOUT:_0x29b695[_0x5319c6(0x147)],'readTimeout':hasOwn(_0x2c3468,_0x5319c6(0x171))?_0x2c3468[_0x5319c6(0x171)]??DEFAULT_NOTIFICATION_READ_TIMEOUT:_0x29b695[_0x5319c6(0x171)]});}export function requestedSafeFieldsMatch(_0x58305f,_0xb61f50,_0x501edf){const _0x1e54c8=a139_0x216800,_0x3cae13=[],_0x1239b4=[],_0x2a8b92=[];for(const _0xe9f238 of['configName','channelType',_0x1e54c8(0x1b1)]){if(!hasOwn(_0x501edf,_0xe9f238))continue;_0x2a8b92[_0x1e54c8(0x1a2)](_0xe9f238),_0x3cae13[_0x1e54c8(0x1a2)](_0xb61f50[_0xe9f238]===_0x501edf[_0xe9f238]),_0x1239b4[_0x1e54c8(0x1a2)](_0x58305f[_0xe9f238]!==_0x501edf[_0xe9f238]&&_0xb61f50[_0xe9f238]===_0x501edf[_0xe9f238]);}for(const _0x28d652 of[_0x1e54c8(0x147),_0x1e54c8(0x171)]){if(!hasOwn(_0x501edf,_0x28d652))continue;const _0x5eddd9=_0x501edf[_0x28d652]??(_0x28d652===_0x1e54c8(0x147)?DEFAULT_NOTIFICATION_CONNECT_TIMEOUT:DEFAULT_NOTIFICATION_READ_TIMEOUT);_0x2a8b92['push'](_0x28d652),_0x3cae13[_0x1e54c8(0x1a2)](_0xb61f50[_0x28d652]===_0x5eddd9),_0x1239b4['push'](_0x58305f[_0x28d652]!==_0x5eddd9&&_0xb61f50[_0x28d652]===_0x5eddd9);}return hasOwn(_0x501edf,_0x1e54c8(0x19e))&&_0x501edf[_0x1e54c8(0x19e)]===null&&(_0x2a8b92[_0x1e54c8(0x1a2)]('endpointUrl:null'),_0x3cae13[_0x1e54c8(0x1a2)](_0xb61f50[_0x1e54c8(0x167)]===null||_0xb61f50[_0x1e54c8(0x167)]===''),_0x1239b4['push'](_0x58305f[_0x1e54c8(0x167)]!==null&&_0x58305f[_0x1e54c8(0x167)]!==''&&(_0xb61f50['endpointUrlRaw']===null||_0xb61f50[_0x1e54c8(0x167)]===''))),{'allMatch':_0x3cae13[_0x1e54c8(0x17a)](Boolean),'provesChange':_0x1239b4[_0x1e54c8(0x175)](Boolean),'verifiedFields':_0x2a8b92};}export function validateNotificationDeleteReadback(_0x186b53,_0x4da9a2,_0x87cb33){const _0x21576c=a139_0x216800;for(const [_0x5765ed,_0x5dd5ae]of _0x186b53[_0x21576c(0x1ae)]()){if(!Number[_0x21576c(0x151)](_0x5dd5ae['id'])||_0x5dd5ae['id']<=0x0)throw notificationError('notification_config_response_invalid',_0x21576c(0x152)+(_0x5765ed+0x1)+_0x21576c(0x1b0));if(_0x5dd5ae[_0x21576c(0x1bf)]!==_0x4da9a2)throw notificationError('notification_config_response_invalid',_0x21576c(0x152)+(_0x5765ed+0x1)+_0x21576c(0x18f));if(_0x5dd5ae[_0x21576c(0x14e)]!==_0x87cb33)throw notificationError(_0x21576c(0x1be),_0x21576c(0x152)+(_0x5765ed+0x1)+_0x21576c(0x169));}}export function safeApiFailure(_0x3b7679,_0x64c6f6,_0x2f59bf){const _0x5102c1=a139_0x216800;return notificationError(_0x5102c1(0x16b)+_0x3b7679+'_'+(_0x64c6f6===_0x5102c1(0x13d)?_0x5102c1(0x143):_0x64c6f6+_0x5102c1(0x1ab)),_0x5102c1(0x188)+_0x3b7679+'\x20'+_0x64c6f6+_0x5102c1(0x1b5),_0x2f59bf);}export function notificationLookupCommand(_0x86501e,_0x5e5e5f){const _0x39eed6=a139_0x216800;return _0x39eed6(0x14b)+_0x86501e+_0x39eed6(0x187)+_0x5e5e5f+_0x39eed6(0x142);}function validateNotificationDocument(_0x5a70aa,_0x1ec5db){const _0x461247=a139_0x216800;for(const _0x10d94f of Object[_0x461247(0x196)](_0x5a70aa)){if(FORBIDDEN_IDENTITY_FIELDS[_0x461247(0x1bb)](_0x10d94f))throw notificationError(_0x461247(0x1b8),_0x461247(0x14a)+_0x10d94f+_0x461247(0x160));if(!ALLOWED_INPUT_FIELDS[_0x461247(0x1bb)](_0x10d94f))throw notificationError('notification_config_field_unknown',_0x461247(0x191)+_0x10d94f+'\x22.');}if(_0x1ec5db===_0x461247(0x1ba)&&Object[_0x461247(0x196)](_0x5a70aa)[_0x461247(0x165)]===0x0)throw notificationError(_0x461247(0x178),'Update\x20JSON\x20must\x20contain\x20at\x20least\x20one\x20allowed\x20field.');const _0x2e007d={};if(hasOwn(_0x5a70aa,_0x461247(0x17e)))_0x2e007d[_0x461247(0x17e)]=validateRequiredString(_0x5a70aa['configName'],_0x461247(0x17e),0x80);else{if(_0x1ec5db===_0x461247(0x1ad))throw notificationError(_0x461247(0x180),_0x461247(0x19b)+_0x461247(0x148));}if(hasOwn(_0x5a70aa,_0x461247(0x14e))){if(typeof _0x5a70aa[_0x461247(0x14e)]!=='string')throw invalidFieldType('channelType','a\x20supported\x20string');const _0x20a118=_0x5a70aa[_0x461247(0x14e)][_0x461247(0x15b)]();if(!NOTIFICATION_CHANNEL_TYPES[_0x461247(0x15a)](_0x20a118))throw notificationError(_0x461247(0x195),_0x461247(0x19d),_0x461247(0x149)+NOTIFICATION_CHANNEL_TYPES[_0x461247(0x182)](',\x20')+'.');_0x2e007d[_0x461247(0x14e)]=_0x20a118;}else{if(_0x1ec5db===_0x461247(0x1ad))throw notificationError('notification_config_field_required',_0x461247(0x19b)+_0x461247(0x1bc));}for(const [_0x38d2ae,_0x569dda]of[[_0x461247(0x19e),0x200],[_0x461247(0x1b1),0x100]]){if(!hasOwn(_0x5a70aa,_0x38d2ae))continue;const _0x15c826=_0x5a70aa[_0x38d2ae];if(_0x15c826!==null&&typeof _0x15c826!==_0x461247(0x1a6))throw invalidFieldType(_0x38d2ae,_0x461247(0x192));if(typeof _0x15c826==='string'&&_0x15c826[_0x461247(0x165)]>_0x569dda)throw notificationError(_0x461247(0x195),_0x461247(0x14a)+_0x38d2ae+'\x22\x20cannot\x20exceed\x20'+_0x569dda+_0x461247(0x1bd));_0x2e007d[_0x38d2ae]=_0x15c826;}if(hasOwn(_0x5a70aa,'channelConfig')){const _0x59a634=_0x5a70aa['channelConfig'];if(_0x59a634===null&&_0x1ec5db===_0x461247(0x1ad))throw invalidFieldType(_0x461247(0x197),_0x461247(0x145));if(_0x59a634!==null&&!isJsonObject(_0x59a634))throw invalidFieldType(_0x461247(0x197),_0x1ec5db===_0x461247(0x1ba)?'a\x20JSON\x20object\x20or\x20null':'a\x20JSON\x20object');_0x59a634!==null&&validateChannelConfigFields(_0x2e007d['channelType'],_0x59a634),_0x2e007d[_0x461247(0x197)]=_0x59a634;}for(const _0x576de6 of['connectTimeout','readTimeout']){if(!hasOwn(_0x5a70aa,_0x576de6))continue;const _0x22d2f8=_0x5a70aa[_0x576de6];if(_0x22d2f8!==null&&(!Number['isSafeInteger'](_0x22d2f8)||_0x22d2f8<0x0))throw notificationError(_0x461247(0x195),_0x461247(0x14a)+_0x576de6+_0x461247(0x156));_0x2e007d[_0x576de6]=_0x22d2f8;}return _0x2e007d;}function validateRequiredString(_0x1cf624,_0x2e69dc,_0xe74c9e){const _0x3637e0=a139_0x216800;if(typeof _0x1cf624!=='string')throw invalidFieldType(_0x2e69dc,_0x3637e0(0x13e));const _0x20af0b=_0x1cf624['trim']();if(!_0x20af0b)throw notificationError(_0x3637e0(0x195),'Notification\x20JSON\x20field\x20\x22'+_0x2e69dc+_0x3637e0(0x14f));if(_0x20af0b[_0x3637e0(0x165)]>_0xe74c9e)throw notificationError(_0x3637e0(0x195),'Notification\x20JSON\x20field\x20\x22'+_0x2e69dc+_0x3637e0(0x19a)+_0xe74c9e+_0x3637e0(0x1bd));return _0x20af0b;}function validateChannelConfigFields(_0x6c174a,_0x58d737){const _0xf8d929=a139_0x216800;if(hasOwn(_0x58d737,_0xf8d929(0x164)))throw forbiddenChannelConfigField(_0xf8d929(0x164));if(_0x6c174a===_0xf8d929(0x173))for(const _0x2d49cf of EMAIL_RECIPIENT_FIELDS){if(hasOwn(_0x58d737,_0x2d49cf))throw forbiddenChannelConfigField(_0x2d49cf);}}function forbiddenChannelConfigField(_0x349680){const _0x28d82a=a139_0x216800;return notificationError('notification_config_channel_field_forbidden',_0x28d82a(0x1c0)+_0x349680+_0x28d82a(0x15c));}function invalidFieldType(_0x386dfd,_0x50f32d){const _0x2ef91c=a139_0x216800;return notificationError(_0x2ef91c(0x195),_0x2ef91c(0x14a)+_0x386dfd+'\x22\x20must\x20be\x20'+_0x50f32d+'.');}function serializeChannelConfig(_0x54ca1e){const _0x2b31a9=a139_0x216800;return _0x54ca1e===null||_0x54ca1e===undefined?null:JSON[_0x2b31a9(0x146)](_0x54ca1e);}function redactSensitive(_0x1e065b){const _0x3a7329=a139_0x216800;return _0x1e065b===null||_0x1e065b===undefined||_0x1e065b===''?null:_0x3a7329(0x17f);}function requireResponseString(_0x17a47f,_0x146e49,_0x26aae3){const _0x23caa0=a139_0x216800;if(typeof _0x17a47f!==_0x23caa0(0x1a6)||_0x17a47f[_0x23caa0(0x15b)]()==='')throw CliErrors['apiError'](_0x23caa0(0x144),_0x23caa0(0x18c)+(_0x26aae3+0x1)+_0x23caa0(0x168)+_0x146e49+'\x22.');return _0x17a47f[_0x23caa0(0x15b)]();}function requireExactString(_0x2df6f2,_0x3e9e0c,_0x2ed8cf){const _0x5aaa75=a139_0x216800;if(typeof _0x2df6f2!==_0x5aaa75(0x1a6)||_0x2df6f2['trim']()==='')throw notificationError(_0x5aaa75(0x1be),_0x5aaa75(0x188)+_0x2ed8cf+_0x5aaa75(0x168)+_0x3e9e0c+'\x22.');return _0x2df6f2[_0x5aaa75(0x15b)]();}function responseNullableString(_0x14bdc1,_0x553d15,_0x405388){const _0x1b7e05=a139_0x216800;if(_0x14bdc1===undefined||_0x14bdc1===null)return null;if(typeof _0x14bdc1!==_0x1b7e05(0x1a6))throw notificationError(_0x1b7e05(0x1be),'Notification\x20config\x20'+_0x405388+'\x20has\x20invalid\x20field\x20\x22'+_0x553d15+'\x22.');return _0x14bdc1;}function responseNullableTimeout(_0x1b6267,_0x6a0640,_0x420d1f){const _0x3e9878=a139_0x216800;if(_0x1b6267===undefined||_0x1b6267===null)return null;if(!Number[_0x3e9878(0x151)](_0x1b6267)||_0x1b6267<0x0)throw notificationError(_0x3e9878(0x1be),_0x3e9878(0x188)+_0x420d1f+'\x20has\x20invalid\x20field\x20\x22'+_0x6a0640+'\x22.');return _0x1b6267;}function normalizeNullableString(_0x36bc06){const _0x55f608=a139_0x216800;return typeof _0x36bc06===_0x55f608(0x1a6)?_0x36bc06:null;}function isJsonObject(_0x35548b){const _0x39209f=a139_0x216800;return _0x35548b!==null&&typeof _0x35548b===_0x39209f(0x15f)&&!Array[_0x39209f(0x16e)](_0x35548b);}function hasOwn(_0x494faf,_0x19fbc0){const _0x305474=a139_0x216800;return Object[_0x305474(0x1b3)][_0x305474(0x1ac)][_0x305474(0x161)](_0x494faf,_0x19fbc0);}async function readStdin(){const _0x3b4432=a139_0x216800;let _0xa8e907='';process[_0x3b4432(0x1a9)][_0x3b4432(0x17c)](_0x3b4432(0x1a8));for await(const _0x159803 of process[_0x3b4432(0x1a9)])_0xa8e907+=_0x159803;return _0xa8e907;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a140_0x421c85=a140_0x5865;(function(_0x9e26ac,_0x4c472d){const _0x2918e4=a140_0x5865,_0x35467a=_0x9e26ac();while(!![]){try{const _0x4441dd=parseInt(_0x2918e4(0x105))/0x1+-parseInt(_0x2918e4(0x115))/0x2+-parseInt(_0x2918e4(0x114))/0x3*(parseInt(_0x2918e4(0xeb))/0x4)+-parseInt(_0x2918e4(0x117))/0x5+-parseInt(_0x2918e4(0xe7))/0x6+-parseInt(_0x2918e4(0x11d))/0x7*(-parseInt(_0x2918e4(0x10b))/0x8)+parseInt(_0x2918e4(0xf0))/0x9*(parseInt(_0x2918e4(0x10f))/0xa);if(_0x4441dd===_0x4c472d)break;else _0x35467a['push'](_0x35467a['shift']());}catch(_0x29332d){_0x35467a['push'](_0x35467a['shift']());}}}(a140_0x425b,0xd9e7e));function a140_0x425b(){const _0x207c38=['.\x20Supported\x20scenes:\x20','scene','fileName','trim','filePath','14LGhgkv','使用研发态\x20OCR\x20服务识别\x20URL\x20或本地文件中的文字','idCard','str','\x20OCR','Preview:\x20upload\x20local\x20file,\x20query\x20temporary\x20URL,\x20then\x20recognize\x20','3377016wOFPmo','ocr','appCode','toString','5543504YzOAYp','recognize','Local\x20image\x20or\x20PDF\x20file;\x20uses\x20upload\x20->\x20query-url\x20->\x20OCR','read','<filePath\x20returned\x20by\x20/smartapi/common/uploadFile>','9mXgqcp','length','path','filter','invoice','apiError','Publicly\x20accessible\x20image\x20or\x20file\x20URL','File\x20URL\x20response\x20missing\x20fileUrl.','\x20OCR\x20from\x20URL','imageFile','Table','join','fileUrl','Choose\x20exactly\x20one\x20OCR\x20input:\x20--image-file\x20or\x20--image-url.','validation','/smartapi/common/uploadFile','Preview:\x20recognize\x20','form','<fileUrl\x20returned\x20by\x20/smartapi/common/queryFileUrl>','POST','/smartapi/ocr/recognize-text','144917CxyvuB','Invoice','imageUrl','idcard','OCR\x20scene:\x20invoice,\x20general,\x20form,\x20or\x20idCard','IdCard','3232480tsCtkZ','image-file','General','GET','39930910npLFcZ','toLowerCase','/smartapi/common/queryFileUrl','File\x20upload\x20response\x20missing\x20filePath.','count','3VpFITF','1809068HBOgPh','string','6001700lZqfcE'];a140_0x425b=function(){return _0x207c38;};return a140_0x425b();}import{requireDevelopmentUploadFile}from'../../commands/common/local-file.js';import{queryDevelopmentFileUrl,recognizeDevelopmentOcr,uploadDevelopmentFile}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const SUPPORTED_SCENES=[a140_0x421c85(0xf4),'general',a140_0x421c85(0x101),a140_0x421c85(0x11f)],SCENE_TO_LEGACY_TYPE={'invoice':a140_0x421c85(0x106),'general':a140_0x421c85(0x10d),'form':a140_0x421c85(0xfa),'idCard':a140_0x421c85(0x10a)},SCENE_FLAG={'name':a140_0x421c85(0x119),'type':'string','required':!![],'enum':[...SUPPORTED_SCENES],'description':a140_0x421c85(0x109)},IMAGE_FILE_FLAG={'name':a140_0x421c85(0x10c),'type':a140_0x421c85(0x116),'description':a140_0x421c85(0xed)},IMAGE_URL_FLAG={'name':'image-url','type':'string','description':a140_0x421c85(0xf6)};function normalizeScene(_0x522058){const _0x413e83=a140_0x421c85,_0x3c88e4=_0x522058['trim']()[_0x413e83(0x110)]();if(_0x3c88e4===_0x413e83(0x108))return _0x413e83(0x11f);if(_0x3c88e4===_0x413e83(0xf4)||_0x3c88e4==='general'||_0x3c88e4==='form')return _0x3c88e4;throw CliErrors[_0x413e83(0xfe)]('Unsupported\x20OCR\x20scene:\x20'+_0x522058+_0x413e83(0x118)+SUPPORTED_SCENES[_0x413e83(0xfb)](',\x20'));}function a140_0x5865(_0x1d7b6e,_0x4c983f){_0x1d7b6e=_0x1d7b6e-0xe7;const _0x425b2f=a140_0x425b();let _0x586592=_0x425b2f[_0x1d7b6e];return _0x586592;}function selectedInputs(_0x32b88b){const _0x4eeb3d=a140_0x421c85,_0x48aa1b=_0x32b88b[_0x4eeb3d(0x120)](_0x4eeb3d(0x10c))[_0x4eeb3d(0x11b)](),_0x2dcf6f=_0x32b88b[_0x4eeb3d(0x120)]('image-url')[_0x4eeb3d(0x11b)]();return{'imageFile':_0x48aa1b,'imageUrl':_0x2dcf6f,'count':[_0x48aa1b,_0x2dcf6f][_0x4eeb3d(0xf3)](Boolean)[_0x4eeb3d(0xf1)]};}function validateInputSelection(_0x4f4c6f){const _0x17365e=a140_0x421c85,_0x5b33af=selectedInputs(_0x4f4c6f);if(_0x5b33af[_0x17365e(0x113)]!==0x1)throw CliErrors[_0x17365e(0xfe)](_0x17365e(0xfd));return _0x5b33af;}function withScene(_0x51f120,_0x5cfd31,_0x434ea8){const _0x14986a=a140_0x421c85;return{..._0x51f120,'scene':_0x5cfd31,..._0x434ea8?{'sourceFile':{'fileName':_0x434ea8[_0x14986a(0x11a)],'filePath':_0x434ea8['filePath']}}:{}};}const ocrRecognize={'service':a140_0x421c85(0xe8),'command':a140_0x421c85(0xec),'description':a140_0x421c85(0x11e),'risk':a140_0x421c85(0xee),'flags':[SCENE_FLAG,IMAGE_FILE_FLAG,IMAGE_URL_FLAG],async 'dryRun'(_0x3fd5ae){const _0x668afe=a140_0x421c85,_0x18321e=normalizeScene(_0x3fd5ae[_0x668afe(0x120)](_0x668afe(0x119))),_0x206a8f=SCENE_TO_LEGACY_TYPE[_0x18321e],_0x44ceab=validateInputSelection(_0x3fd5ae);if(_0x44ceab['imageUrl']){const _0x21c969=new URLSearchParams({'url':_0x44ceab[_0x668afe(0x107)],'type':_0x206a8f,'appCode':_0x3fd5ae[_0x668afe(0xe9)]});return{'method':_0x668afe(0x10e),'url':'/smartapi/ocr/recognize-text?'+_0x21c969[_0x668afe(0xea)](),'description':_0x668afe(0x100)+_0x18321e+_0x668afe(0xf8)};}const _0x3c4db5=requireDevelopmentUploadFile(_0x44ceab[_0x668afe(0xf9)],_0x668afe(0x10c));return{'method':'POST','url':_0x668afe(0xff),'body':{'steps':[{'method':_0x668afe(0x103),'url':'/smartapi/common/uploadFile','body':{'appCode':_0x3fd5ae[_0x668afe(0xe9)],'multipart':{'file':_0x3c4db5}}},{'method':_0x668afe(0x103),'url':_0x668afe(0x111),'body':{'filePath':_0x668afe(0xef),'downloadFlag':![]}},{'method':_0x668afe(0x10e),'url':_0x668afe(0x104),'query':{'appCode':_0x3fd5ae[_0x668afe(0xe9)],'url':_0x668afe(0x102),'type':_0x206a8f}}]},'description':_0x668afe(0x122)+_0x18321e+_0x668afe(0x121)};},async 'execute'(_0x20c09f){const _0x41f49b=a140_0x421c85,_0x127499=normalizeScene(_0x20c09f[_0x41f49b(0x120)](_0x41f49b(0x119))),_0x29f253=SCENE_TO_LEGACY_TYPE[_0x127499],_0xb863a8=validateInputSelection(_0x20c09f);if(_0xb863a8[_0x41f49b(0x107)]){const _0x17cb3b=await recognizeDevelopmentOcr(_0x20c09f['appCode'],{'url':_0xb863a8[_0x41f49b(0x107)],'type':_0x29f253});return{'ok':!![],'data':withScene(_0x17cb3b,_0x127499)};}const _0x40bbd5=requireDevelopmentUploadFile(_0xb863a8['imageFile'],_0x41f49b(0x10c)),_0x3ffbf3=await uploadDevelopmentFile(_0x20c09f[_0x41f49b(0xe9)],_0x40bbd5[_0x41f49b(0xf2)]);if(!_0x3ffbf3[_0x41f49b(0x11c)])throw CliErrors[_0x41f49b(0xf5)](_0x41f49b(0x112));const _0x479c4b=await queryDevelopmentFileUrl(_0x3ffbf3[_0x41f49b(0x11c)],{'download':![]});if(!_0x479c4b[_0x41f49b(0xfc)])throw CliErrors['apiError'](_0x41f49b(0xf7));const _0x233299=await recognizeDevelopmentOcr(_0x20c09f['appCode'],{'url':_0x479c4b['fileUrl'],'type':_0x29f253});return{'ok':!![],'data':withScene(_0x233299,_0x127499,_0x3ffbf3)};}};export const ocrDefinitions=[ocrRecognize];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a141_0x37dedf=a141_0x17e3;(function(_0x2b7eae,_0x4332b3){const _0xe9b3e8=a141_0x17e3,_0x222459=_0x2b7eae();while(!![]){try{const _0x4200be=parseInt(_0xe9b3e8(0xcf))/0x1*(-parseInt(_0xe9b3e8(0xcc))/0x2)+-parseInt(_0xe9b3e8(0xa8))/0x3*(-parseInt(_0xe9b3e8(0xb0))/0x4)+-parseInt(_0xe9b3e8(0xbf))/0x5+-parseInt(_0xe9b3e8(0xc5))/0x6+parseInt(_0xe9b3e8(0xb8))/0x7+parseInt(_0xe9b3e8(0xca))/0x8+parseInt(_0xe9b3e8(0xae))/0x9;if(_0x4200be===_0x4332b3)break;else _0x222459['push'](_0x222459['shift']());}catch(_0x1c26bc){_0x222459['push'](_0x222459['shift']());}}}(a141_0x57de,0x88de9));function a141_0x57de(){const _0x4d39dd=['dataset','boolean','5746182jKOsEa','generate-start','source','page','progressRate','6190392xBPcIa','code','1054YWFPhs','number','allowGenerate','616OGeqCV','apply','clientOperationId','dryRun','SUCCESS','6SfaFls','fieldCount','/smartapi/lovrabet/dataset/','nextAction','related-pages-fallback','Actually\x20execute\x20the\x20generation.\x20Without\x20this\x20flag,\x20only\x20a\x20dry-run\x20preview\x20is\x20shown.','4087926GeCfIk','status','690020hQvXoT','standardPageStatus','alias','string','precheck','Dry-run\x20preview\x20(pass\x20--apply\x20to\x20execute\x20the\x20generation)','PARTIAL_SUCCESS','operationId','3592169JKaQMC','bool','POST','/generate-standard-pages/start','Start\x20async\x20Smart\x20List\x20Page\x20generation\x20from\x20a\x20dataset','复用已有生成任务','manualResolutionRequired','1216220VPDnsc','已提交生成任务','appCode','reused'];a141_0x57de=function(){return _0x4d39dd;};return a141_0x57de();}import{APPCODE_FLAG_OPTIONAL,DATASETCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{assessGenerateOperationState,assessStandardPageState,buildPageGenerateOperationStatusQueryCommand,buildStandardPageStatusQueryCommand,createPageGenerateClientOperationId,getUndeletedRelatedPages,loadDatasetDetailForPage,loadStandardPageStatusForGenerate,serializeDryRunDescription,validateDatasetSelector}from'../../commands/page/shared.js';import{startGenerateStandardPages}from'../../core/api-client.js';function a141_0x17e3(_0x266f11,_0x4d68f6){_0x266f11=_0x266f11-0xa6;const _0x57decb=a141_0x57de();let _0x17e369=_0x57decb[_0x266f11];return _0x17e369;}export const pageGenerateStart={'service':a141_0x37dedf(0xc8),'command':'generate-start','description':a141_0x37dedf(0xbc),'risk':'write','defaultOutputFormat':'compress','flags':[APPCODE_FLAG_OPTIONAL,DATASETCODE_FLAG_OPTIONAL,{'name':a141_0x37dedf(0xb2),'type':a141_0x37dedf(0xb3),'description':'Dataset\x20alias\x20from\x20api.ts\x20(resolves\x20to\x20dataset\x20code\x20automatically)'},{'name':a141_0x37dedf(0xd0),'type':a141_0x37dedf(0xc4),'description':a141_0x37dedf(0xad)}],async 'validate'(_0x19668e){validateDatasetSelector(_0x19668e);},async 'dryRun'(_0x3678b1){const _0x433d67=a141_0x37dedf,_0x2f1661=await prepare(_0x3678b1);return{'method':_0x433d67(0xba),'url':_0x433d67(0xaa)+_0x2f1661[_0x433d67(0xc3)][_0x433d67(0xcb)]+_0x433d67(0xbb),'body':{'appCode':_0x3678b1[_0x433d67(0xc1)],'clientOperationId':_0x2f1661[_0x433d67(0xd1)]},'description':serializeDryRunDescription({'dataset':{'id':_0x2f1661[_0x433d67(0xc3)]['id'],'code':_0x2f1661[_0x433d67(0xc3)][_0x433d67(0xcb)],'name':_0x2f1661[_0x433d67(0xc3)]['name'],'fieldCount':_0x2f1661[_0x433d67(0xc3)][_0x433d67(0xa9)]},'precheckSource':_0x2f1661[_0x433d67(0xb1)]?.[_0x433d67(0xc7)]??_0x433d67(0xac),'action':_0x433d67(0xc6),'clientOperationId':_0x2f1661[_0x433d67(0xd1)],'plannedStatus':_0x2f1661[_0x433d67(0xb4)]['status'],'reason':_0x2f1661[_0x433d67(0xb4)]['message']})};},async 'execute'(_0x2b84e9){const _0x258764=a141_0x37dedf;if(!_0x2b84e9[_0x258764(0xb9)]('apply')){const _0x21ccdb=await pageGenerateStart[_0x258764(0xa6)](_0x2b84e9);return{'ok':!![],'message':_0x258764(0xb5),'data':_0x21ccdb};}const _0x26c1fc=await prepare(_0x2b84e9);if(!_0x26c1fc[_0x258764(0xb4)][_0x258764(0xce)])return{'ok':![],'message':_0x26c1fc[_0x258764(0xb4)]['message'],'data':{'datasetCode':_0x26c1fc[_0x258764(0xc3)]['code'],'clientOperationId':_0x26c1fc[_0x258764(0xd1)],'precheckSource':_0x26c1fc[_0x258764(0xb1)]?.[_0x258764(0xc7)]??_0x258764(0xac),'status':_0x26c1fc['precheck']['status'],'manualResolutionRequired':_0x26c1fc['precheck']['manualResolutionRequired'],'nextAction':_0x26c1fc[_0x258764(0xb4)][_0x258764(0xab)],'query':{'command':buildStandardPageStatusQueryCommand(_0x26c1fc[_0x258764(0xc3)][_0x258764(0xcb)],_0x2b84e9[_0x258764(0xc1)])},'standardPageStatus':_0x26c1fc[_0x258764(0xb1)]}};const _0x4bfdf4=await startGenerateStandardPages(_0x2b84e9[_0x258764(0xc1)],_0x26c1fc['dataset'][_0x258764(0xcb)],{'clientOperationId':_0x26c1fc[_0x258764(0xd1)]}),_0x3b15ff=_0x4bfdf4[_0x258764(0xaf)]===_0x258764(0xa7)||_0x4bfdf4['status']===_0x258764(0xb6)?await loadStandardPageStatusForGenerate(_0x2b84e9,_0x26c1fc[_0x258764(0xc3)][_0x258764(0xcb)]):null,_0x175cfd=assessGenerateOperationState(_0x26c1fc['dataset'][_0x258764(0xcb)],_0x4bfdf4[_0x258764(0xaf)],_0x3b15ff);return{'ok':!![],'message':_0x4bfdf4[_0x258764(0xc2)]?_0x258764(0xbd):_0x258764(0xc0),'data':{'datasetCode':_0x26c1fc['dataset'][_0x258764(0xcb)],'appCode':_0x2b84e9[_0x258764(0xc1)],'taskId':_0x4bfdf4['taskId']??null,'operationId':_0x4bfdf4['operationId']??null,'clientOperationId':_0x26c1fc[_0x258764(0xd1)],'jobStatus':_0x4bfdf4['status']??null,'progressRate':typeof _0x4bfdf4[_0x258764(0xc9)]===_0x258764(0xcd)?_0x4bfdf4['progressRate']:null,'currentStep':_0x4bfdf4['currentStep']??null,'reused':_0x4bfdf4['reused']===!![],'status':_0x175cfd[_0x258764(0xaf)],'manualResolutionRequired':_0x175cfd[_0x258764(0xbe)],'nextAction':_0x175cfd[_0x258764(0xab)],'query':{'command':buildPageGenerateOperationStatusQueryCommand(_0x26c1fc[_0x258764(0xc3)][_0x258764(0xcb)],{'appCode':_0x2b84e9['appCode'],'taskId':_0x4bfdf4['taskId'],'operationId':_0x4bfdf4[_0x258764(0xb7)],'clientOperationId':_0x26c1fc['clientOperationId']})},'standardPageStatus':_0x3b15ff}};}};async function prepare(_0x1a0b4e){const _0x2bfb85=a141_0x37dedf,_0x59588b=await loadDatasetDetailForPage(_0x1a0b4e),_0x2a5cf9=await loadStandardPageStatusForGenerate(_0x1a0b4e,_0x59588b[_0x2bfb85(0xcb)]),_0x156454=getUndeletedRelatedPages(_0x59588b);return{'dataset':_0x59588b,'standardPageStatus':_0x2a5cf9,'clientOperationId':createPageGenerateClientOperationId(),'precheck':assessStandardPageState(_0x59588b[_0x2bfb85(0xcb)],_0x2a5cf9,{'fallbackUndeletedPages':_0x156454})};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a142_0x5cd1(_0x25f7e1,_0x21b006){_0x25f7e1=_0x25f7e1-0xed;const _0x4e198e=a142_0x4e19();let _0x5cd11f=_0x4e198e[_0x25f7e1];return _0x5cd11f;}const a142_0x1f7c1e=a142_0x5cd1;(function(_0xacdff0,_0x4afc0b){const _0x529f70=a142_0x5cd1,_0x52c671=_0xacdff0();while(!![]){try{const _0x1797f7=parseInt(_0x529f70(0x114))/0x1+parseInt(_0x529f70(0x105))/0x2*(-parseInt(_0x529f70(0x111))/0x3)+parseInt(_0x529f70(0xfd))/0x4*(parseInt(_0x529f70(0xfa))/0x5)+-parseInt(_0x529f70(0xf1))/0x6+parseInt(_0x529f70(0x107))/0x7+-parseInt(_0x529f70(0x118))/0x8*(-parseInt(_0x529f70(0xef))/0x9)+parseInt(_0x529f70(0xfe))/0xa;if(_0x1797f7===_0x4afc0b)break;else _0x52c671['push'](_0x52c671['shift']());}catch(_0x33747c){_0x52c671['push'](_0x52c671['shift']());}}}(a142_0x4e19,0x785a3));import{APPCODE_FLAG_OPTIONAL,DATASETCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a142_0x4e19(){const _0x2a519f=['number','14539kOjuWe','/generate-standard-pages/status?','Query\x20Smart\x20List\x20Page\x20generate\x20operation\x20status','nextAction','PARTIAL_SUCCESS','set','Client\x20recovery/idempotency\x20id\x20when\x20operationId\x20is\x20unavailable\x20or\x20lost','code','appCode','currentStep','6wcqzzO','taskId','GET','158620njqMue','str','Dataset\x20alias\x20from\x20api.ts\x20(resolves\x20to\x20dataset\x20code\x20automatically)','errorMsg','224LmyQLg','/smartapi/lovrabet/dataset/','clientOperationId','170334NvuSOM','toString','3140898aNFKKg','string','name','operation-id','operationId','generate-status','SUCCESS','client-operation-id','Generic\x20task\x20id\x20returned\x20by\x20page\x20generate-start','165305cdXNXY','read','manualResolutionRequired','44RUtUAo','5144900oAajkQ','result','progressRate','status','task-id','message','query-generate-operation-status','552340NPJjFg'];a142_0x4e19=function(){return _0x2a519f;};return a142_0x4e19();}import{assessGenerateOperationState,buildPageGenerateOperationStatusQueryCommand,loadDatasetDetailForPage,loadStandardPageStatusForGenerate,serializeDryRunDescription,validateDatasetSelector,validateGenerateOperationSelector}from'../../commands/page/shared.js';import{getGenerateStandardPagesStatus}from'../../core/api-client.js';export const pageGenerateStatus={'service':'page','command':a142_0x1f7c1e(0xf6),'description':a142_0x1f7c1e(0x109),'risk':a142_0x1f7c1e(0xfb),'defaultOutputFormat':'compress','flags':[APPCODE_FLAG_OPTIONAL,DATASETCODE_FLAG_OPTIONAL,{'name':'alias','type':a142_0x1f7c1e(0xf2),'description':a142_0x1f7c1e(0x116)},{'name':'task-id','type':a142_0x1f7c1e(0xf2),'description':a142_0x1f7c1e(0xf9)},{'name':'operation-id','type':a142_0x1f7c1e(0xf2),'description':'Async\x20operation\x20id\x20returned\x20by\x20page\x20generate-start'},{'name':a142_0x1f7c1e(0xf8),'type':a142_0x1f7c1e(0xf2),'description':a142_0x1f7c1e(0x10d)}],async 'validate'(_0x1bb3c4){validateDatasetSelector(_0x1bb3c4),validateGenerateOperationSelector(_0x1bb3c4);},async 'dryRun'(_0xdcd74c){const _0x1ac13b=a142_0x1f7c1e,_0x5c353d=await loadDatasetDetailForPage(_0xdcd74c),_0x5d95c8=_0xdcd74c[_0x1ac13b(0x115)](_0x1ac13b(0x102)),_0x2c32cf=_0xdcd74c[_0x1ac13b(0x115)](_0x1ac13b(0xf4)),_0x57473d=_0xdcd74c[_0x1ac13b(0x115)](_0x1ac13b(0xf8)),_0x116cdf=new URLSearchParams({'appCode':_0xdcd74c[_0x1ac13b(0x10f)]});return _0x5d95c8&&_0x116cdf[_0x1ac13b(0x10c)](_0x1ac13b(0x112),_0x5d95c8),_0x2c32cf&&_0x116cdf[_0x1ac13b(0x10c)](_0x1ac13b(0xf5),_0x2c32cf),_0x57473d&&_0x116cdf['set'](_0x1ac13b(0xee),_0x57473d),{'method':_0x1ac13b(0x113),'url':_0x1ac13b(0xed)+_0x5c353d['code']+_0x1ac13b(0x108)+_0x116cdf[_0x1ac13b(0xf0)](),'description':serializeDryRunDescription({'dataset':{'id':_0x5c353d['id'],'code':_0x5c353d[_0x1ac13b(0x10e)],'name':_0x5c353d[_0x1ac13b(0xf3)]},'action':_0x1ac13b(0x104),'taskId':_0x5d95c8||undefined,'operationId':_0x2c32cf||undefined,'clientOperationId':_0x57473d||undefined})};},async 'execute'(_0x5840e1){const _0xbd6e77=a142_0x1f7c1e,_0x598ba9=await loadDatasetDetailForPage(_0x5840e1),_0x2bc95d=_0x5840e1[_0xbd6e77(0x115)]('task-id'),_0x4e6c2e=_0x5840e1[_0xbd6e77(0x115)]('operation-id'),_0xca6923=_0x5840e1['str'](_0xbd6e77(0xf8)),_0x3fce35=await getGenerateStandardPagesStatus(_0x5840e1['appCode'],_0x598ba9[_0xbd6e77(0x10e)],{'taskId':_0x2bc95d||undefined,'operationId':_0x4e6c2e||undefined,'clientOperationId':_0xca6923||undefined}),_0x48b52d=_0x3fce35[_0xbd6e77(0x101)]===_0xbd6e77(0xf7)||_0x3fce35[_0xbd6e77(0x101)]===_0xbd6e77(0x10b),_0x126432=_0x48b52d?await loadStandardPageStatusForGenerate(_0x5840e1,_0x598ba9[_0xbd6e77(0x10e)]):null,_0x16a9b8=assessGenerateOperationState(_0x598ba9['code'],_0x3fce35['status'],_0x126432),_0x4ca7ad=_0x3fce35[_0xbd6e77(0x112)]??_0x2bc95d??undefined,_0x4aef3d=_0x3fce35[_0xbd6e77(0xf5)]??_0x4e6c2e??undefined,_0x1af712=_0x3fce35[_0xbd6e77(0xee)]??_0xca6923??undefined;return{'ok':!![],'message':_0x16a9b8['status']==='operation_failed'?_0x3fce35[_0xbd6e77(0x117)]||_0x16a9b8[_0xbd6e77(0x103)]:_0x16a9b8[_0xbd6e77(0x103)],'data':{'datasetCode':_0x598ba9['code'],'appCode':_0x5840e1[_0xbd6e77(0x10f)],'taskId':_0x4ca7ad,'operationId':_0x4aef3d,'clientOperationId':_0x1af712,'jobStatus':_0x3fce35['status']??null,'progressRate':typeof _0x3fce35[_0xbd6e77(0x100)]===_0xbd6e77(0x106)?_0x3fce35[_0xbd6e77(0x100)]:null,'currentStep':_0x3fce35[_0xbd6e77(0x110)]??null,'errorMsg':_0x3fce35[_0xbd6e77(0x117)]??null,'status':_0x16a9b8['status'],'manualResolutionRequired':_0x16a9b8[_0xbd6e77(0xfc)],'nextAction':_0x16a9b8[_0xbd6e77(0x10a)],'query':{'command':buildPageGenerateOperationStatusQueryCommand(_0x598ba9['code'],{'appCode':_0x5840e1['appCode'],'taskId':_0x4ca7ad,'operationId':_0x4aef3d,'clientOperationId':_0x1af712})},'standardPageStatus':_0x126432,'result':_0x3fce35[_0xbd6e77(0xff)]??null}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x557a88,_0x57cc65){const _0x42c496=a143_0x166a,_0x18db9f=_0x557a88();while(!![]){try{const _0x26d214=-parseInt(_0x42c496(0x14f))/0x1+parseInt(_0x42c496(0x150))/0x2+-parseInt(_0x42c496(0x14e))/0x3+-parseInt(_0x42c496(0x152))/0x4+-parseInt(_0x42c496(0x14b))/0x5+-parseInt(_0x42c496(0x151))/0x6*(parseInt(_0x42c496(0x14a))/0x7)+-parseInt(_0x42c496(0x14c))/0x8*(-parseInt(_0x42c496(0x14d))/0x9);if(_0x26d214===_0x57cc65)break;else _0x18db9f['push'](_0x18db9f['shift']());}catch(_0x3402b9){_0x18db9f['push'](_0x18db9f['shift']());}}}(a143_0x4256,0x960ed));import{pageGenerateStart}from'../../commands/page/generate-start.js';import{pageGenerateStatus}from'../../commands/page/generate-status.js';import{pageStandardPageStatus}from'../../commands/page/standard-page-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{pageReactCreate}from'../../commands/page/react/create.js';function a143_0x4256(){const _0x4a0b52=['6ZaNjVd','855120nlDUss','6287813ULnvum','503925XpZxcm','472cKMbut','473193HAWfSl','2444628VPTJrR','727441HwbEyF','535470vydHnv'];a143_0x4256=function(){return _0x4a0b52;};return a143_0x4256();}import{pageReactDetail}from'../../commands/page/react/detail.js';function a143_0x166a(_0x2d652f,_0x47e0d1){_0x2d652f=_0x2d652f-0x14a;const _0x4256a8=a143_0x4256();let _0x166a33=_0x4256a8[_0x2d652f];return _0x166a33;}import{pageReactList}from'../../commands/page/react/list.js';import{pageReactPublish}from'../../commands/page/react/publish.js';import{pageReactUpdate}from'../../commands/page/react/update.js';export const pageDefinitions=[pageGenerateStart,pageGenerateStatus,pageStandardPageStatus,pageRelationAudit,pageSync,pagePull,pagePush,pageRestore,pageReactCreate,pageReactList,pageReactDetail,pageReactPublish,pageReactUpdate];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a144_0xb979c=a144_0x1ebb;(function(_0x276d83,_0x29188e){const _0x203761=a144_0x1ebb,_0x21b77b=_0x276d83();while(!![]){try{const _0xc5ca13=parseInt(_0x203761(0x18f))/0x1+parseInt(_0x203761(0x191))/0x2*(-parseInt(_0x203761(0x16c))/0x3)+parseInt(_0x203761(0x18b))/0x4+-parseInt(_0x203761(0x1a4))/0x5*(parseInt(_0x203761(0x17c))/0x6)+-parseInt(_0x203761(0x171))/0x7*(parseInt(_0x203761(0x16a))/0x8)+parseInt(_0x203761(0x180))/0x9*(parseInt(_0x203761(0x198))/0xa)+-parseInt(_0x203761(0x169))/0xb*(-parseInt(_0x203761(0x1a6))/0xc);if(_0xc5ca13===_0x29188e)break;else _0x21b77b['push'](_0x21b77b['shift']());}catch(_0xc57943){_0x21b77b['push'](_0x21b77b['shift']());}}}(a144_0x1f1e,0xd24b7));function a144_0x1ebb(_0x3bbd90,_0x4a3e92){_0x3bbd90=_0x3bbd90-0x169;const _0x1f1e72=a144_0x1f1e();let _0x1ebb92=_0x1f1e72[_0x3bbd90];return _0x1ebb92;}function a144_0x1f1e(){const _0x45ef99=['Page\x20ID','detail','Overwrite\x20local\x20files\x20even\x20when\x20unsynced\x20local\x20changes\x20exist','Dataset\x20alias\x20from\x20api.ts\x20(resolves\x20to\x20dataset\x20code\x20automatically)','type','2712132mJtYqV','length','filter','batch','65450oyqFzz','relatedPages','80CcaqSp','GET','would_pull','拉取完成:\x20','force','alias','str','476350FnVzbU','version-tag','map','boolean','\x20pulled,\x20','pages','push','single','lastSync','utf8','Dataset\x20\x22','versionTag','4272725wEnogo','compress','1464FHqYGz','210529IIsROa','16sbEJJG','pageId','67899GuHNcn','code','read','Pull\x20page\x20schema\x20to\x20local\x20files','deleted','2433844GoBdBz','lockFilePath','appCode','Local\x20page\x20file\x20has\x20unsynced\x20changes:\x20','validation','number','local\x20unsynced\x20changes','mode','all','name','reason','6FZFgtk','conflict','/smartapi/lovrabet/detail\x20(per\x20selected\x20page)','items','45QpXGLx','string','\x22\x20has\x20no\x20undeleted\x20related\x20pages.','status','/smartapi/lovrabet/detail?pageId=','localPath'];a144_0x1f1e=function(){return _0x45ef99;};return a144_0x1f1e();}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';import{CliErrors}from'../../errors.js';export const pagePull={'service':'page','command':'pull','description':a144_0xb979c(0x16f),'risk':a144_0xb979c(0x16e),'defaultOutputFormat':a144_0xb979c(0x1a5),'flags':[APPCODE_FLAG_OPTIONAL,{'name':'id','type':a144_0xb979c(0x176),'description':a144_0xb979c(0x186)},DATASETCODE_FLAG_OPTIONAL,{'name':a144_0xb979c(0x196),'type':'string','description':a144_0xb979c(0x189)},{'name':a144_0xb979c(0x199),'type':a144_0xb979c(0x181),'description':'Page\x20group\x20version\x20tag\x20(batch\x20mode\x20only)'},{'name':a144_0xb979c(0x195),'type':a144_0xb979c(0x19b),'description':a144_0xb979c(0x188)}],async 'validate'(_0x293a40){validatePageTargetSelector(_0x293a40);},async 'dryRun'(_0x1c2e2b){const _0x4e1b16=a144_0xb979c,_0x493f61=await buildPullPlan(_0x1c2e2b);return{'method':_0x4e1b16(0x192),'url':_0x493f61[_0x4e1b16(0x178)]===_0x4e1b16(0x19f)?_0x4e1b16(0x184)+(_0x493f61['items'][0x0]?.['detail'][_0x4e1b16(0x16b)]??''):_0x4e1b16(0x17e),'body':{'appCode':_0x1c2e2b[_0x4e1b16(0x173)],'mode':_0x493f61[_0x4e1b16(0x178)],'targetDatasetCode':_0x493f61['datasetCode']??null,'pages':_0x493f61[_0x4e1b16(0x17f)]['map'](toPreviewItem)},'description':serializeDryRunDescription({'mode':_0x493f61[_0x4e1b16(0x178)],'datasetCode':_0x493f61['datasetCode']??null,'totalCandidates':_0x493f61['items'][_0x4e1b16(0x18c)],'totalWouldPull':_0x493f61[_0x4e1b16(0x17f)][_0x4e1b16(0x18d)](_0x59dc7b=>_0x59dc7b[_0x4e1b16(0x183)]===_0x4e1b16(0x193))[_0x4e1b16(0x18c)],'totalConflicts':_0x493f61['items'][_0x4e1b16(0x18d)](_0x2cf5cc=>_0x2cf5cc[_0x4e1b16(0x183)]===_0x4e1b16(0x17d))[_0x4e1b16(0x18c)]})};},async 'execute'(_0x2cabf6){const _0x241daa=a144_0xb979c,_0x5f7f27=loadPageProjectConfig(_0x2cabf6[_0x241daa(0x173)]),_0x1deeff=await readPageLockFile(_0x5f7f27['lockFilePath']),{lockData:_0x563a9a,appLock:_0x2ca270}=ensurePageLockScope(_0x1deeff??createEmptyPageLock(),_0x2cabf6['appCode']),_0x46571d=await buildPullPlan(_0x2cabf6),_0x52ec09=_0x2cabf6['bool']('force');if(_0x46571d[_0x241daa(0x178)]===_0x241daa(0x19f)&&_0x46571d['items'][0x0]?.['status']===_0x241daa(0x17d)&&!_0x52ec09)throw CliErrors[_0x241daa(0x175)](_0x241daa(0x174)+_0x46571d['items'][0x0][_0x241daa(0x185)],'Use\x20--force\x20to\x20overwrite\x20local\x20changes.');const _0x41a0f0=[],_0x1ddd61=[];for(const _0xc6db03 of _0x46571d[_0x241daa(0x17f)]){if(_0xc6db03[_0x241daa(0x183)]==='conflict'&&!_0x52ec09){_0x1ddd61[_0x241daa(0x19e)]({'pageId':_0xc6db03[_0x241daa(0x187)]['pageId'],'type':_0xc6db03[_0x241daa(0x187)][_0x241daa(0x18a)],'title':_0xc6db03[_0x241daa(0x187)]['name'],'localPath':_0xc6db03[_0x241daa(0x185)],'reason':_0xc6db03[_0x241daa(0x17b)]??_0x241daa(0x177)});continue;}await ensureParentDirectory(_0xc6db03['localPath']);const _0x537d8c=serializePageSchemaForFile(_0xc6db03['detail'][_0x241daa(0x16d)]);await writeFile(_0xc6db03[_0x241daa(0x185)],_0x537d8c,_0x241daa(0x1a1)),_0x2ca270[_0x241daa(0x19d)][String(_0xc6db03[_0x241daa(0x187)][_0x241daa(0x16b)])]=buildLockEntry(_0xc6db03['detail'],_0x537d8c),_0x41a0f0[_0x241daa(0x19e)]({'pageId':_0xc6db03[_0x241daa(0x187)]['pageId'],'type':_0xc6db03[_0x241daa(0x187)][_0x241daa(0x18a)],'title':_0xc6db03[_0x241daa(0x187)][_0x241daa(0x17a)],'localPath':_0xc6db03[_0x241daa(0x185)]});}return _0x2ca270[_0x241daa(0x1a0)]=new Date()['toISOString'](),await writePageLockFile(_0x5f7f27['lockFilePath'],_0x563a9a),{'ok':!![],'message':_0x241daa(0x194)+_0x41a0f0[_0x241daa(0x18c)]+_0x241daa(0x19c)+_0x1ddd61[_0x241daa(0x18c)]+'\x20skipped','data':{'appCode':_0x2cabf6['appCode'],'pulledPages':_0x41a0f0,'skippedPages':_0x1ddd61,'totalPulled':_0x41a0f0[_0x241daa(0x18c)],'totalSkipped':_0x1ddd61[_0x241daa(0x18c)]}};}};async function buildPullPlan(_0x42cc92){const _0x17730e=a144_0xb979c,_0x43c585=loadPageProjectConfig(_0x42cc92['appCode']),_0x3bfdfd=await readPageLockFile(_0x43c585[_0x17730e(0x172)]),{appLock:_0x48b993}=ensurePageLockScope(_0x3bfdfd??createEmptyPageLock(),_0x42cc92['appCode']),_0x1a029c=getPageIdFlag(_0x42cc92);if(_0x1a029c!==undefined){const _0x5527e5=await loadPageDetailForPage(_0x42cc92,_0x1a029c);return{'mode':_0x17730e(0x19f),'items':[await inspectPullTarget(_0x43c585,_0x48b993['pages'][String(_0x5527e5['pageId'])],_0x5527e5)]};}const _0x3a521f=await loadDatasetDetailForPage(_0x42cc92),_0x1976d7=_0x3a521f[_0x17730e(0x190)][_0x17730e(0x18d)](_0x4b59d4=>!_0x4b59d4[_0x17730e(0x170)]);if(_0x1976d7[_0x17730e(0x18c)]===0x0)throw CliErrors[_0x17730e(0x175)](_0x17730e(0x1a2)+_0x3a521f[_0x17730e(0x16d)]+_0x17730e(0x182));const _0xbb1f68=await Promise[_0x17730e(0x179)](_0x1976d7['map'](_0x5a06bd=>loadPageDetailForPage(_0x42cc92,_0x5a06bd['id']))),_0x1b5d18=selectVersionTagGroup(_0xbb1f68,_0x44fe64=>_0x44fe64[_0x17730e(0x1a3)],_0x42cc92[_0x17730e(0x197)](_0x17730e(0x199)));return{'mode':_0x17730e(0x18e),'datasetCode':_0x3a521f[_0x17730e(0x16d)],'items':await Promise[_0x17730e(0x179)](_0x1b5d18[_0x17730e(0x17f)][_0x17730e(0x19a)](_0x2e6f53=>inspectPullTarget(_0x43c585,_0x48b993[_0x17730e(0x19d)][String(_0x2e6f53[_0x17730e(0x16b)])],_0x2e6f53)))};}async function inspectPullTarget(_0x137a93,_0x47f6d8,_0x4d0043){const _0x25833d=a144_0xb979c,_0x4197bf=resolvePageFilePath(_0x137a93,_0x4d0043[_0x25833d(0x16b)],_0x4d0043[_0x25833d(0x18a)]),_0x1f4a90=await fileExists(_0x4197bf);if(!_0x1f4a90){const _0x4b56b6=serializePageSchemaForFile(_0x4d0043[_0x25833d(0x16d)]);return{'detail':_0x4d0043,'localPath':_0x4197bf,'localHash':computePageContentHash(_0x4b56b6),'status':'would_pull'};}const _0x2d84b8=await computePageFileHash(_0x4197bf);if(!_0x47f6d8||_0x2d84b8!==_0x47f6d8['hash'])return{'detail':_0x4d0043,'localPath':_0x4197bf,'localHash':_0x2d84b8,'status':_0x25833d(0x17d),'reason':_0x25833d(0x177)};return{'detail':_0x4d0043,'localPath':_0x4197bf,'localHash':_0x2d84b8,'status':_0x25833d(0x193)};}function buildLockEntry(_0x32d3ae,_0x5c6702){const _0x4ee527=a144_0xb979c;return{'hash':computePageContentHash(_0x5c6702),'pageId':_0x32d3ae[_0x4ee527(0x16b)],'pageVersion':_0x32d3ae['pageVersion'],'type':_0x32d3ae[_0x4ee527(0x18a)],'title':_0x32d3ae[_0x4ee527(0x17a)],'datasetIds':_0x32d3ae['datasetIds'],'versionTag':_0x32d3ae[_0x4ee527(0x1a3)]};}function toPreviewItem(_0x137bd0){const _0x2d6836=a144_0xb979c;return{'pageId':_0x137bd0['detail']['pageId'],'type':_0x137bd0[_0x2d6836(0x187)][_0x2d6836(0x18a)],'title':_0x137bd0[_0x2d6836(0x187)][_0x2d6836(0x17a)],'localPath':_0x137bd0[_0x2d6836(0x185)],'status':_0x137bd0[_0x2d6836(0x183)],..._0x137bd0[_0x2d6836(0x17b)]?{'reason':_0x137bd0['reason']}:{}};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a139_0x3a60bd=a139_0x39d6;(function(_0x2c707b,_0x3df93b){const _0x144b9f=a139_0x39d6,_0x59b767=_0x2c707b();while(!![]){try{const _0xd9bff9=parseInt(_0x144b9f(0x1de))/0x1*(parseInt(_0x144b9f(0x1ac))/0x2)+parseInt(_0x144b9f(0x1c3))/0x3*(parseInt(_0x144b9f(0x1b0))/0x4)+parseInt(_0x144b9f(0x1e6))/0x5+-parseInt(_0x144b9f(0x1c1))/0x6+parseInt(_0x144b9f(0x1da))/0x7*(parseInt(_0x144b9f(0x1a6))/0x8)+-parseInt(_0x144b9f(0x1e7))/0x9+parseInt(_0x144b9f(0x1d2))/0xa*(-parseInt(_0x144b9f(0x1b1))/0xb);if(_0xd9bff9===_0x3df93b)break;else _0x59b767['push'](_0x59b767['shift']());}catch(_0x1b5910){_0x59b767['push'](_0x59b767['shift']());}}}(a139_0x4909,0x83872));import{readFile,writeFile}from'node:fs/promises';import{APPCODE_FLAG_OPTIONAL,DATASETCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a139_0x39d6(_0x2cf4f3,_0x35e802){_0x2cf4f3=_0x2cf4f3-0x1a2;const _0x4909fb=a139_0x4909();let _0x39d6d9=_0x4909fb[_0x2cf4f3];return _0x39d6d9;}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':a139_0x3a60bd(0x1bd),'command':a139_0x3a60bd(0x1e0),'description':a139_0x3a60bd(0x1bc),'risk':a139_0x3a60bd(0x1ba),'defaultOutputFormat':'compress','flags':[APPCODE_FLAG_OPTIONAL,{'name':'id','type':'number','description':a139_0x3a60bd(0x1f3)},DATASETCODE_FLAG_OPTIONAL,{'name':a139_0x3a60bd(0x1dc),'type':'string','description':a139_0x3a60bd(0x1eb)},{'name':a139_0x3a60bd(0x1e5),'type':a139_0x3a60bd(0x1bf),'description':a139_0x3a60bd(0x1e4)}],async 'validate'(_0x4a1261){validatePageTargetSelector(_0x4a1261);},async 'dryRun'(_0xf434fa){const _0x263578=a139_0x3a60bd,_0x1ad111=await buildPushPreview(_0xf434fa);return{'method':'POST','url':'/smartapi/lovrabet/update-page','body':{'appCode':_0xf434fa[_0x263578(0x1ab)],'mode':_0x1ad111[_0x263578(0x1b4)],'datasetCode':_0x1ad111[_0x263578(0x1b7)]??null,'pages':_0x1ad111[_0x263578(0x1d1)]},'description':serializeDryRunDescription({'mode':_0x1ad111[_0x263578(0x1b4)],'datasetCode':_0x1ad111[_0x263578(0x1b7)]??null,'totalWouldPush':_0x1ad111[_0x263578(0x1d1)][_0x263578(0x1ca)](_0x1fa633=>_0x1fa633['status']===_0x263578(0x1d4))[_0x263578(0x1a7)],'totalUnchanged':_0x1ad111[_0x263578(0x1d1)][_0x263578(0x1ca)](_0x3e11cf=>_0x3e11cf[_0x263578(0x1a2)]===_0x263578(0x1e2))['length'],'totalConflicts':_0x1ad111[_0x263578(0x1d1)][_0x263578(0x1ca)](_0x52d6ab=>_0x52d6ab[_0x263578(0x1a2)]===_0x263578(0x1f2)||_0x52d6ab[_0x263578(0x1a2)]===_0x263578(0x1c8))['length']})};},async 'execute'(_0x4472a7){const _0x364206=a139_0x3a60bd,_0x338c8e=loadPageProjectConfig(_0x4472a7[_0x364206(0x1ab)]),_0x136425=await readPageLockFile(_0x338c8e[_0x364206(0x1cc)]),{lockData:_0x103a89,appLock:_0x412d72}=ensurePageLockScope(_0x136425??createEmptyPageLock(),_0x4472a7[_0x364206(0x1ab)]),_0x4e013f=getPageIdFlag(_0x4472a7);if(_0x4e013f!==undefined){const _0x212607=await prepareSinglePush(_0x4472a7,_0x338c8e,_0x412d72[_0x364206(0x1be)][String(_0x4e013f)],_0x4e013f),_0x162fe0=await pushPreparedPage(_0x4472a7,_0x212607);return _0x412d72['pages'][String(_0x162fe0['pageId'])]=_0x162fe0[_0x364206(0x1ea)],_0x412d72[_0x364206(0x1dd)]=new Date()['toISOString'](),await writePageLockFile(_0x338c8e[_0x364206(0x1cc)],_0x103a89),{'ok':!![],'message':_0x162fe0[_0x364206(0x1c9)]?_0x364206(0x1a4):_0x364206(0x1f5),'data':{'appCode':_0x4472a7[_0x364206(0x1ab)],'pushedPages':[{'pageId':_0x162fe0['pageId'],'type':_0x162fe0[_0x364206(0x1e9)],'title':_0x162fe0[_0x364206(0x1a5)],'normalized':_0x162fe0[_0x364206(0x1c9)]}],'skippedPages':[],'failedPages':[],'totalPushed':0x1,'totalSkipped':0x0,'totalFailed':0x0}};}const _0x3e7662=await buildBatchPushPlan(_0x4472a7,_0x412d72['pages']),_0x3f4120=[],_0x473935=[],_0xe172f6=[];for(const _0x3e01c7 of _0x3e7662['unchanged']){_0x473935[_0x364206(0x1e0)](_0x3e01c7);}for(const _0x128166 of _0x3e7662[_0x364206(0x1b2)]){try{const _0x1e6919=await prepareSinglePush(_0x4472a7,_0x338c8e,_0x412d72['pages'][String(_0x128166[_0x364206(0x1e3)])],_0x128166['pageId'],_0x3e7662[_0x364206(0x1df)]),_0x24f6e1=await pushPreparedPage(_0x4472a7,_0x1e6919);_0x412d72['pages'][String(_0x24f6e1['pageId'])]=_0x24f6e1[_0x364206(0x1ea)],_0x3f4120[_0x364206(0x1e0)]({'pageId':_0x24f6e1[_0x364206(0x1e3)],'type':_0x24f6e1[_0x364206(0x1e9)],'title':_0x24f6e1[_0x364206(0x1a5)],'normalized':_0x24f6e1[_0x364206(0x1c9)]});}catch(_0x116d51){_0xe172f6[_0x364206(0x1e0)]({'pageId':_0x128166[_0x364206(0x1e3)],'type':_0x128166['type'],'title':_0x128166[_0x364206(0x1a5)],'reason':_0x116d51 instanceof Error?_0x116d51['message']:String(_0x116d51)});}}return _0x412d72[_0x364206(0x1dd)]=new Date()[_0x364206(0x1b6)](),await writePageLockFile(_0x338c8e[_0x364206(0x1cc)],_0x103a89),{'ok':_0xe172f6[_0x364206(0x1a7)]===0x0||_0x3f4120[_0x364206(0x1a7)]>0x0||_0x473935[_0x364206(0x1a7)]>0x0,'message':_0xe172f6[_0x364206(0x1a7)]>0x0&&_0x3f4120[_0x364206(0x1a7)]>0x0?'部分页面推送失败':_0x3f4120[_0x364206(0x1a7)]>0x0?_0x364206(0x1f5):_0x473935[_0x364206(0x1a7)]>0x0&&_0xe172f6[_0x364206(0x1a7)]===0x0?_0x364206(0x1ee):_0xe172f6[0x0]?.['reason']||_0x364206(0x1aa),'data':{'appCode':_0x4472a7[_0x364206(0x1ab)],'pushedPages':_0x3f4120,'skippedPages':_0x473935,'failedPages':_0xe172f6,'totalPushed':_0x3f4120[_0x364206(0x1a7)],'totalSkipped':_0x473935[_0x364206(0x1a7)],'totalFailed':_0xe172f6[_0x364206(0x1a7)]}};}};async function buildPushPreview(_0x2fcbd9){const _0x424831=a139_0x3a60bd,_0x56e1eb=loadPageProjectConfig(_0x2fcbd9[_0x424831(0x1ab)]),_0x143de9=await readPageLockFile(_0x56e1eb[_0x424831(0x1cc)]),{appLock:_0x59c860}=ensurePageLockScope(_0x143de9??createEmptyPageLock(),_0x2fcbd9[_0x424831(0x1ab)]),_0x495bd2=getPageIdFlag(_0x2fcbd9);if(_0x495bd2!==undefined)return{'mode':_0x424831(0x1ed),'items':[await inspectPushPage(_0x2fcbd9,_0x56e1eb,_0x59c860[_0x424831(0x1be)][String(_0x495bd2)],_0x495bd2)]};const _0x116314=await buildBatchPushPlan(_0x2fcbd9,_0x59c860[_0x424831(0x1be)]);return{'mode':_0x424831(0x1ef),'datasetCode':_0x116314['datasetCode'],'items':[..._0x116314['unchanged'][_0x424831(0x1c4)](_0x139fc9=>({'pageId':_0x139fc9[_0x424831(0x1e3)],'type':_0x139fc9[_0x424831(0x1e9)],'title':_0x139fc9[_0x424831(0x1a5)],'localPath':_0x139fc9[_0x424831(0x1b5)],'status':_0x424831(0x1e2),'reason':_0x139fc9[_0x424831(0x1d0)]})),...await Promise['all'](_0x116314[_0x424831(0x1b2)][_0x424831(0x1c4)](_0x297cca=>inspectPushPage(_0x2fcbd9,_0x56e1eb,_0x59c860[_0x424831(0x1be)][String(_0x297cca[_0x424831(0x1e3)])],_0x297cca[_0x424831(0x1e3)],_0x116314[_0x424831(0x1df)])))]};}async function buildBatchPushPlan(_0x4f0f06,_0x4e317a){const _0x28d497=a139_0x3a60bd,_0x53e4f9=loadPageProjectConfig(_0x4f0f06['appCode']),_0x35556b=await loadDatasetDetailForPage(_0x4f0f06),_0x6cd735=_0x35556b['id'],_0x59a295=new Set(_0x35556b[_0x28d497(0x1af)][_0x28d497(0x1ca)](_0x2d00d4=>!_0x2d00d4[_0x28d497(0x1ae)])[_0x28d497(0x1c4)](_0xe2e864=>_0xe2e864['id'])),_0x12fa30=Object['values'](_0x4e317a)['filter'](_0x1b85cf=>_0x1b85cf['datasetIds']['includes'](_0x6cd735)&&_0x59a295[_0x28d497(0x1c0)](_0x1b85cf[_0x28d497(0x1e3)]));if(_0x12fa30[_0x28d497(0x1a7)]===0x0)throw CliErrors[_0x28d497(0x1d3)](_0x28d497(0x1f1)+_0x35556b[_0x28d497(0x1ce)]+'\x22.',_0x28d497(0x1d8)+CLI_BIN_NAME+_0x28d497(0x1f4)+_0x35556b['code']+_0x28d497(0x1b9));const _0x1352e1=selectVersionTagGroup(_0x12fa30,_0x5b77ef=>_0x5b77ef[_0x28d497(0x1e1)]??null,_0x4f0f06[_0x28d497(0x1ec)](_0x28d497(0x1e5))),_0xd6595d=[],_0x5641c1=[];for(const _0x25c015 of _0x1352e1[_0x28d497(0x1d1)]){const _0x32d377=resolvePageFilePath(_0x53e4f9,_0x25c015[_0x28d497(0x1e3)],_0x25c015[_0x28d497(0x1e9)]);if(!await fileExists(_0x32d377)){_0xd6595d[_0x28d497(0x1e0)]({'pageId':_0x25c015[_0x28d497(0x1e3)],'type':_0x25c015['type'],'title':_0x25c015['title']});continue;}const _0x4d85ae=await computePageFileHash(_0x32d377);if(_0x4d85ae===_0x25c015['hash']){_0x5641c1[_0x28d497(0x1e0)]({'pageId':_0x25c015[_0x28d497(0x1e3)],'type':_0x25c015['type'],'title':_0x25c015['title'],'localPath':_0x32d377,'reason':_0x28d497(0x1d9)});continue;}_0xd6595d[_0x28d497(0x1e0)]({'pageId':_0x25c015['pageId'],'type':_0x25c015[_0x28d497(0x1e9)],'title':_0x25c015[_0x28d497(0x1a5)]});}return{'datasetCode':_0x35556b['code'],'datasetId':_0x6cd735,'candidates':_0xd6595d,'unchanged':_0x5641c1};}function a139_0x4909(){const _0x505354=['pageVersion','reason','items','20GniaBL','validation','would_push','UNKNOWN','parse','utf8','Run\x20`','no\x20changes','5757157WHIuQC','\x20no\x20longer\x20belongs\x20to\x20the\x20target\x20dataset','alias','lastSync','1qUHyYq','datasetId','push','versionTag','unchanged','pageId','Page\x20group\x20version\x20tag\x20(batch\x20mode\x20only)','version-tag','4645400pFEOjy','1209726cBUCVR','hash','type','nextLockEntry','Dataset\x20alias\x20from\x20api.ts\x20(resolves\x20to\x20dataset\x20code\x20automatically)','str','single','无变更需要推送','batch','name','No\x20local\x20pages\x20found\x20for\x20dataset\x20\x22','conflict','Page\x20ID','\x20page\x20pull\x20--datasetcode\x20','推送成功','status','Page\x20update\x20failed:\x20','推送成功,服务端已规范化\x20schema','title','8CImVEB','length','datasetIds','remote\x20pageVersion\x20changed','推送失败','appCode','1287604mkylVE','message','deleted','relatedPages','29324PmLVya','10340946JBKLEZ','candidates','page-','mode','localPath','toISOString','datasetCode','`\x20first','`\x20first.','write','Local\x20file\x20not\x20found:\x20','Push\x20local\x20page\x20schema\x20back\x20to\x20remote','page','pages','string','has','1999116zOSGVe','localContent','201FWtXgH','map','\x20page\x20pull\x20--id\x20','Page\x20','\x20has\x20changed\x20since\x20last\x20pull.','blocked','normalized','filter','apiError','lockFilePath','remoteDetail','code'];a139_0x4909=function(){return _0x505354;};return a139_0x4909();}async function inspectPushPage(_0x19abed,_0x29894f,_0x48bf0a,_0x138431,_0x5c197d){const _0x178484=a139_0x3a60bd;if(!_0x48bf0a)return{'pageId':_0x138431,'type':_0x178484(0x1d5),'title':_0x178484(0x1b3)+_0x138431,'localPath':resolvePageFilePath(_0x29894f,_0x138431,_0x178484(0x1d5)),'status':'blocked','reason':_0x178484(0x1d8)+CLI_BIN_NAME+_0x178484(0x1c5)+_0x138431+_0x178484(0x1b8)};const _0x3638f3=resolvePageFilePath(_0x29894f,_0x138431,_0x48bf0a['type']);if(!await fileExists(_0x3638f3))return{'pageId':_0x138431,'type':_0x48bf0a[_0x178484(0x1e9)],'title':_0x48bf0a[_0x178484(0x1a5)],'localPath':_0x3638f3,'status':_0x178484(0x1c8),'reason':_0x178484(0x1bb)+_0x3638f3};const _0x2ebc50=await readFile(_0x3638f3,_0x178484(0x1d7));try{JSON[_0x178484(0x1d6)](_0x2ebc50);}catch{return{'pageId':_0x138431,'type':_0x48bf0a[_0x178484(0x1e9)],'title':_0x48bf0a[_0x178484(0x1a5)],'localPath':_0x3638f3,'status':_0x178484(0x1c8),'reason':'local\x20JSON\x20is\x20invalid'};}const _0x4b9033=computePageContentHash(_0x2ebc50);if(_0x4b9033===_0x48bf0a[_0x178484(0x1e8)])return{'pageId':_0x138431,'type':_0x48bf0a[_0x178484(0x1e9)],'title':_0x48bf0a[_0x178484(0x1a5)],'localPath':_0x3638f3,'status':'unchanged','reason':_0x178484(0x1d9)};try{const _0x437d52=await loadPageDetailForPage(_0x19abed,_0x138431);if(_0x5c197d!=null&&!_0x437d52[_0x178484(0x1a8)]['includes'](_0x5c197d))return{'pageId':_0x138431,'type':_0x48bf0a[_0x178484(0x1e9)],'title':_0x48bf0a[_0x178484(0x1a5)],'localPath':_0x3638f3,'status':'conflict','reason':_0x178484(0x1c6)+_0x138431+_0x178484(0x1db)};const _0x26f43a=_0x48bf0a[_0x178484(0x1cf)]!=null&&_0x437d52[_0x178484(0x1cf)]!=null;if(_0x26f43a&&_0x48bf0a[_0x178484(0x1cf)]!==_0x437d52[_0x178484(0x1cf)])return{'pageId':_0x138431,'type':_0x48bf0a['type'],'title':_0x48bf0a[_0x178484(0x1a5)],'localPath':_0x3638f3,'status':_0x178484(0x1f2),'reason':_0x178484(0x1a9)};if(!_0x26f43a&&computeSerializedSchemaHash(_0x437d52[_0x178484(0x1ce)])!==_0x48bf0a[_0x178484(0x1e8)])return{'pageId':_0x138431,'type':_0x48bf0a[_0x178484(0x1e9)],'title':_0x48bf0a[_0x178484(0x1a5)],'localPath':_0x3638f3,'status':_0x178484(0x1f2),'reason':'remote\x20schema\x20changed'};}catch(_0x138d03){return{'pageId':_0x138431,'type':_0x48bf0a[_0x178484(0x1e9)],'title':_0x48bf0a['title'],'localPath':_0x3638f3,'status':_0x178484(0x1c8),'reason':_0x138d03 instanceof Error?_0x138d03[_0x178484(0x1ad)]:String(_0x138d03)};}return{'pageId':_0x138431,'type':_0x48bf0a[_0x178484(0x1e9)],'title':_0x48bf0a[_0x178484(0x1a5)],'localPath':_0x3638f3,'status':_0x178484(0x1d4)};}async function prepareSinglePush(_0x45c8af,_0x53ba99,_0x17403f,_0x5dbc9d,_0x32e5f0){const _0x274ff4=a139_0x3a60bd;if(!_0x17403f)throw CliErrors[_0x274ff4(0x1d3)]('No\x20lock\x20record\x20found\x20for\x20page\x20'+_0x5dbc9d+'.','Run\x20`'+CLI_BIN_NAME+'\x20page\x20pull\x20--id\x20'+_0x5dbc9d+'`\x20first.');const _0x2b05ec=resolvePageFilePath(_0x53ba99,_0x5dbc9d,_0x17403f[_0x274ff4(0x1e9)]);if(!await fileExists(_0x2b05ec))throw CliErrors['validation']('Local\x20file\x20not\x20found:\x20'+_0x2b05ec,'Run\x20`'+CLI_BIN_NAME+_0x274ff4(0x1c5)+_0x5dbc9d+_0x274ff4(0x1b9));const _0x4f68d5=await readFile(_0x2b05ec,_0x274ff4(0x1d7));try{JSON['parse'](_0x4f68d5);}catch{throw CliErrors['validation']('Invalid\x20JSON\x20in\x20local\x20page\x20file:\x20'+_0x2b05ec);}const _0x4e71d5=await loadPageDetailForPage(_0x45c8af,_0x5dbc9d);if(_0x32e5f0!=null&&!_0x4e71d5[_0x274ff4(0x1a8)]['includes'](_0x32e5f0))throw CliErrors['validation'](_0x274ff4(0x1c6)+_0x5dbc9d+'\x20no\x20longer\x20belongs\x20to\x20the\x20selected\x20dataset.');const _0x1c0410=_0x17403f['pageVersion']!=null&&_0x4e71d5[_0x274ff4(0x1cf)]!=null;if(_0x1c0410){if(_0x17403f[_0x274ff4(0x1cf)]!==_0x4e71d5[_0x274ff4(0x1cf)])throw CliErrors[_0x274ff4(0x1d3)]('Remote\x20page\x20'+_0x5dbc9d+'\x20has\x20changed\x20since\x20last\x20pull.','Run\x20`'+CLI_BIN_NAME+'\x20page\x20pull\x20--id\x20'+_0x5dbc9d+_0x274ff4(0x1b9));}else{const _0x144806=computeSerializedSchemaHash(_0x4e71d5[_0x274ff4(0x1ce)]);if(_0x144806!==_0x17403f['hash'])throw CliErrors[_0x274ff4(0x1d3)]('Remote\x20page\x20'+_0x5dbc9d+_0x274ff4(0x1c7),_0x274ff4(0x1d8)+CLI_BIN_NAME+'\x20page\x20pull\x20--id\x20'+_0x5dbc9d+_0x274ff4(0x1b9));}return{'lockEntry':_0x17403f,'localPath':_0x2b05ec,'localContent':_0x4f68d5,'localHash':computePageContentHash(_0x4f68d5),'remoteDetail':_0x4e71d5};}async function pushPreparedPage(_0x191d89,_0x50b9f5){const _0xb32a08=a139_0x3a60bd,_0x592dab=await updatePage(_0x191d89['appCode'],_0x50b9f5[_0xb32a08(0x1cd)][_0xb32a08(0x1e3)],_0x50b9f5[_0xb32a08(0x1c2)],_0x50b9f5[_0xb32a08(0x1cd)][_0xb32a08(0x1a8)]);if(!_0x592dab)throw CliErrors[_0xb32a08(0x1cb)](_0xb32a08(0x1a3)+_0x50b9f5['remoteDetail']['pageId']);const _0x473062=await loadPageDetailForPage(_0x191d89,_0x50b9f5[_0xb32a08(0x1cd)]['pageId']),_0x5ec326=serializePageSchemaForFile(_0x473062[_0xb32a08(0x1ce)]);return await writeFile(_0x50b9f5[_0xb32a08(0x1b5)],_0x5ec326,'utf8'),{'pageId':_0x473062[_0xb32a08(0x1e3)],'type':_0x473062['type'],'title':_0x473062['name'],'normalized':_0x5ec326!==serializePageSchemaForFile(_0x50b9f5[_0xb32a08(0x1c2)]),'nextLockEntry':{'hash':computePageContentHash(_0x5ec326),'pageId':_0x473062['pageId'],'pageVersion':_0x473062[_0xb32a08(0x1cf)],'type':_0x473062[_0xb32a08(0x1e9)],'title':_0x473062[_0xb32a08(0x1f0)],'datasetIds':_0x473062[_0xb32a08(0x1a8)],'versionTag':_0x473062[_0xb32a08(0x1e1)]}};}
|
|
1
|
+
const a145_0x54b097=a145_0x5adf;(function(_0x5e4e75,_0x45ad3a){const _0x101a3e=a145_0x5adf,_0x4f17e9=_0x5e4e75();while(!![]){try{const _0xc9550c=parseInt(_0x101a3e(0x163))/0x1*(parseInt(_0x101a3e(0x14e))/0x2)+parseInt(_0x101a3e(0x14a))/0x3*(-parseInt(_0x101a3e(0x17e))/0x4)+-parseInt(_0x101a3e(0x139))/0x5+-parseInt(_0x101a3e(0x154))/0x6*(-parseInt(_0x101a3e(0x17b))/0x7)+parseInt(_0x101a3e(0x162))/0x8*(parseInt(_0x101a3e(0x15e))/0x9)+-parseInt(_0x101a3e(0x16c))/0xa*(-parseInt(_0x101a3e(0x138))/0xb)+-parseInt(_0x101a3e(0x144))/0xc*(parseInt(_0x101a3e(0x14d))/0xd);if(_0xc9550c===_0x45ad3a)break;else _0x4f17e9['push'](_0x4f17e9['shift']());}catch(_0x2cd014){_0x4f17e9['push'](_0x4f17e9['shift']());}}}(a145_0x2e87,0x89223));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':a145_0x54b097(0x16f),'command':a145_0x54b097(0x13a),'description':a145_0x54b097(0x174),'risk':a145_0x54b097(0x14c),'defaultOutputFormat':a145_0x54b097(0x182),'flags':[APPCODE_FLAG_OPTIONAL,{'name':'id','type':a145_0x54b097(0x177),'description':'Page\x20ID'},DATASETCODE_FLAG_OPTIONAL,{'name':'alias','type':'string','description':a145_0x54b097(0x15d)},{'name':a145_0x54b097(0x140),'type':a145_0x54b097(0x158),'description':a145_0x54b097(0x181)}],async 'validate'(_0x31ed60){validatePageTargetSelector(_0x31ed60);},async 'dryRun'(_0x5adfac){const _0x1236dd=a145_0x54b097,_0x592106=await buildPushPreview(_0x5adfac);return{'method':_0x1236dd(0x178),'url':_0x1236dd(0x184),'body':{'appCode':_0x5adfac[_0x1236dd(0x164)],'mode':_0x592106['mode'],'datasetCode':_0x592106['datasetCode']??null,'pages':_0x592106['items']},'description':serializeDryRunDescription({'mode':_0x592106['mode'],'datasetCode':_0x592106['datasetCode']??null,'totalWouldPush':_0x592106[_0x1236dd(0x15b)]['filter'](_0x2ceb09=>_0x2ceb09[_0x1236dd(0x183)]===_0x1236dd(0x147))[_0x1236dd(0x18b)],'totalUnchanged':_0x592106['items'][_0x1236dd(0x17f)](_0x34e52a=>_0x34e52a[_0x1236dd(0x183)]===_0x1236dd(0x176))[_0x1236dd(0x18b)],'totalConflicts':_0x592106[_0x1236dd(0x15b)][_0x1236dd(0x17f)](_0x458de1=>_0x458de1[_0x1236dd(0x183)]===_0x1236dd(0x156)||_0x458de1[_0x1236dd(0x183)]==='blocked')[_0x1236dd(0x18b)]})};},async 'execute'(_0x1f8e62){const _0x39b98c=a145_0x54b097,_0x41d594=loadPageProjectConfig(_0x1f8e62[_0x39b98c(0x164)]),_0x5e4fa9=await readPageLockFile(_0x41d594[_0x39b98c(0x153)]),{lockData:_0x5664da,appLock:_0x43edfa}=ensurePageLockScope(_0x5e4fa9??createEmptyPageLock(),_0x1f8e62[_0x39b98c(0x164)]),_0x467d8b=getPageIdFlag(_0x1f8e62);if(_0x467d8b!==undefined){const _0x11ab9c=await prepareSinglePush(_0x1f8e62,_0x41d594,_0x43edfa['pages'][String(_0x467d8b)],_0x467d8b),_0x2e0320=await pushPreparedPage(_0x1f8e62,_0x11ab9c);return _0x43edfa[_0x39b98c(0x189)][String(_0x2e0320[_0x39b98c(0x14b)])]=_0x2e0320['nextLockEntry'],_0x43edfa[_0x39b98c(0x171)]=new Date()[_0x39b98c(0x170)](),await writePageLockFile(_0x41d594[_0x39b98c(0x153)],_0x5664da),{'ok':!![],'message':_0x2e0320[_0x39b98c(0x17c)]?_0x39b98c(0x15c):_0x39b98c(0x17d),'data':{'appCode':_0x1f8e62['appCode'],'pushedPages':[{'pageId':_0x2e0320[_0x39b98c(0x14b)],'type':_0x2e0320[_0x39b98c(0x18d)],'title':_0x2e0320[_0x39b98c(0x13c)],'normalized':_0x2e0320[_0x39b98c(0x17c)]}],'skippedPages':[],'failedPages':[],'totalPushed':0x1,'totalSkipped':0x0,'totalFailed':0x0}};}const _0x77c735=await buildBatchPushPlan(_0x1f8e62,_0x43edfa['pages']),_0x3146ff=[],_0x155fc5=[],_0xdfa9ef=[];for(const _0x19d020 of _0x77c735[_0x39b98c(0x176)]){_0x155fc5[_0x39b98c(0x13a)](_0x19d020);}for(const _0x366cce of _0x77c735['candidates']){try{const _0x2862af=await prepareSinglePush(_0x1f8e62,_0x41d594,_0x43edfa['pages'][String(_0x366cce[_0x39b98c(0x14b)])],_0x366cce['pageId'],_0x77c735[_0x39b98c(0x149)]),_0x4eab9e=await pushPreparedPage(_0x1f8e62,_0x2862af);_0x43edfa[_0x39b98c(0x189)][String(_0x4eab9e[_0x39b98c(0x14b)])]=_0x4eab9e[_0x39b98c(0x141)],_0x3146ff['push']({'pageId':_0x4eab9e[_0x39b98c(0x14b)],'type':_0x4eab9e['type'],'title':_0x4eab9e[_0x39b98c(0x13c)],'normalized':_0x4eab9e[_0x39b98c(0x17c)]});}catch(_0x426f08){_0xdfa9ef[_0x39b98c(0x13a)]({'pageId':_0x366cce[_0x39b98c(0x14b)],'type':_0x366cce[_0x39b98c(0x18d)],'title':_0x366cce[_0x39b98c(0x13c)],'reason':_0x426f08 instanceof Error?_0x426f08[_0x39b98c(0x14f)]:String(_0x426f08)});}}return _0x43edfa[_0x39b98c(0x171)]=new Date()[_0x39b98c(0x170)](),await writePageLockFile(_0x41d594['lockFilePath'],_0x5664da),{'ok':_0xdfa9ef[_0x39b98c(0x18b)]===0x0||_0x3146ff[_0x39b98c(0x18b)]>0x0||_0x155fc5[_0x39b98c(0x18b)]>0x0,'message':_0xdfa9ef[_0x39b98c(0x18b)]>0x0&&_0x3146ff[_0x39b98c(0x18b)]>0x0?_0x39b98c(0x18a):_0x3146ff[_0x39b98c(0x18b)]>0x0?_0x39b98c(0x17d):_0x155fc5[_0x39b98c(0x18b)]>0x0&&_0xdfa9ef[_0x39b98c(0x18b)]===0x0?_0x39b98c(0x152):_0xdfa9ef[0x0]?.[_0x39b98c(0x16e)]||_0x39b98c(0x15f),'data':{'appCode':_0x1f8e62[_0x39b98c(0x164)],'pushedPages':_0x3146ff,'skippedPages':_0x155fc5,'failedPages':_0xdfa9ef,'totalPushed':_0x3146ff[_0x39b98c(0x18b)],'totalSkipped':_0x155fc5[_0x39b98c(0x18b)],'totalFailed':_0xdfa9ef['length']}};}};async function buildPushPreview(_0x49081e){const _0x6ed9cd=a145_0x54b097,_0x1850cb=loadPageProjectConfig(_0x49081e[_0x6ed9cd(0x164)]),_0x2b6de5=await readPageLockFile(_0x1850cb['lockFilePath']),{appLock:_0x9385eb}=ensurePageLockScope(_0x2b6de5??createEmptyPageLock(),_0x49081e['appCode']),_0x2bdc4b=getPageIdFlag(_0x49081e);if(_0x2bdc4b!==undefined)return{'mode':_0x6ed9cd(0x142),'items':[await inspectPushPage(_0x49081e,_0x1850cb,_0x9385eb[_0x6ed9cd(0x189)][String(_0x2bdc4b)],_0x2bdc4b)]};const _0x2332cc=await buildBatchPushPlan(_0x49081e,_0x9385eb[_0x6ed9cd(0x189)]);return{'mode':_0x6ed9cd(0x16b),'datasetCode':_0x2332cc[_0x6ed9cd(0x151)],'items':[..._0x2332cc[_0x6ed9cd(0x176)][_0x6ed9cd(0x16d)](_0x33188a=>({'pageId':_0x33188a[_0x6ed9cd(0x14b)],'type':_0x33188a[_0x6ed9cd(0x18d)],'title':_0x33188a[_0x6ed9cd(0x13c)],'localPath':_0x33188a[_0x6ed9cd(0x148)],'status':_0x6ed9cd(0x176),'reason':_0x33188a['reason']})),...await Promise[_0x6ed9cd(0x180)](_0x2332cc[_0x6ed9cd(0x16a)][_0x6ed9cd(0x16d)](_0x4cb238=>inspectPushPage(_0x49081e,_0x1850cb,_0x9385eb[_0x6ed9cd(0x189)][String(_0x4cb238[_0x6ed9cd(0x14b)])],_0x4cb238[_0x6ed9cd(0x14b)],_0x2332cc[_0x6ed9cd(0x149)])))]};}function a145_0x2e87(){const _0x5367cc=['5132105HQeExY','5030690YneGhy','push','Remote\x20page\x20','title','UNKNOWN','has','datasetIds','version-tag','nextLockEntry','single','no\x20changes','1230384BaUxPl','validation','apiError','would_push','localPath','datasetId','3YpVwaS','pageId','write','143XOmuTu','7762FZrfCo','message','versionTag','datasetCode','无变更需要推送','lockFilePath','1674RwvNBH','\x20has\x20changed\x20since\x20last\x20pull.','conflict','\x20no\x20longer\x20belongs\x20to\x20the\x20selected\x20dataset.','string','localContent','pageVersion','items','推送成功,服务端已规范化\x20schema','Dataset\x20alias\x20from\x20api.ts\x20(resolves\x20to\x20dataset\x20code\x20automatically)','145251brSZYZ','推送失败','Local\x20file\x20not\x20found:\x20','`\x20first','232iWUxoN','284snfByF','appCode','No\x20local\x20pages\x20found\x20for\x20dataset\x20\x22','hash','includes','page-','name','candidates','batch','20VdsGGA','map','reason','page','toISOString','lastSync','remote\x20pageVersion\x20changed','blocked','Push\x20local\x20page\x20schema\x20back\x20to\x20remote','deleted','unchanged','number','POST','Page\x20','\x20page\x20pull\x20--datasetcode\x20','21875AsQiue','normalized','推送成功','2718124RszKnA','filter','all','Page\x20group\x20version\x20tag\x20(batch\x20mode\x20only)','compress','status','/smartapi/lovrabet/update-page','Run\x20`','remoteDetail','parse','code','pages','部分页面推送失败','length','`\x20first.','type','utf8','\x20page\x20pull\x20--id\x20'];a145_0x2e87=function(){return _0x5367cc;};return a145_0x2e87();}async function buildBatchPushPlan(_0x3d0810,_0x4649d7){const _0x1f1142=a145_0x54b097,_0x1aa279=loadPageProjectConfig(_0x3d0810[_0x1f1142(0x164)]),_0x20d808=await loadDatasetDetailForPage(_0x3d0810),_0xac6757=_0x20d808['id'],_0x521200=new Set(_0x20d808['relatedPages'][_0x1f1142(0x17f)](_0x59fdd3=>!_0x59fdd3[_0x1f1142(0x175)])[_0x1f1142(0x16d)](_0x5ce04c=>_0x5ce04c['id'])),_0x19f3da=Object['values'](_0x4649d7)[_0x1f1142(0x17f)](_0x4b4f83=>_0x4b4f83['datasetIds'][_0x1f1142(0x167)](_0xac6757)&&_0x521200[_0x1f1142(0x13e)](_0x4b4f83[_0x1f1142(0x14b)]));if(_0x19f3da[_0x1f1142(0x18b)]===0x0)throw CliErrors[_0x1f1142(0x145)](_0x1f1142(0x165)+_0x20d808['code']+'\x22.',_0x1f1142(0x185)+CLI_BIN_NAME+_0x1f1142(0x17a)+_0x20d808[_0x1f1142(0x188)]+_0x1f1142(0x18c));const _0x3df9b5=selectVersionTagGroup(_0x19f3da,_0x19671d=>_0x19671d[_0x1f1142(0x150)]??null,_0x3d0810['str'](_0x1f1142(0x140))),_0x38b0d6=[],_0x5b7fb5=[];for(const _0x44ecb4 of _0x3df9b5['items']){const _0x19a207=resolvePageFilePath(_0x1aa279,_0x44ecb4[_0x1f1142(0x14b)],_0x44ecb4[_0x1f1142(0x18d)]);if(!await fileExists(_0x19a207)){_0x38b0d6['push']({'pageId':_0x44ecb4[_0x1f1142(0x14b)],'type':_0x44ecb4[_0x1f1142(0x18d)],'title':_0x44ecb4[_0x1f1142(0x13c)]});continue;}const _0x14fb15=await computePageFileHash(_0x19a207);if(_0x14fb15===_0x44ecb4[_0x1f1142(0x166)]){_0x5b7fb5[_0x1f1142(0x13a)]({'pageId':_0x44ecb4[_0x1f1142(0x14b)],'type':_0x44ecb4[_0x1f1142(0x18d)],'title':_0x44ecb4[_0x1f1142(0x13c)],'localPath':_0x19a207,'reason':_0x1f1142(0x143)});continue;}_0x38b0d6[_0x1f1142(0x13a)]({'pageId':_0x44ecb4[_0x1f1142(0x14b)],'type':_0x44ecb4['type'],'title':_0x44ecb4[_0x1f1142(0x13c)]});}return{'datasetCode':_0x20d808['code'],'datasetId':_0xac6757,'candidates':_0x38b0d6,'unchanged':_0x5b7fb5};}function a145_0x5adf(_0x1716f,_0x666eca){_0x1716f=_0x1716f-0x136;const _0x2e8760=a145_0x2e87();let _0x5adf49=_0x2e8760[_0x1716f];return _0x5adf49;}async function inspectPushPage(_0x42c23f,_0x4728d9,_0x51d8fe,_0x48de93,_0x283390){const _0x23c5ea=a145_0x54b097;if(!_0x51d8fe)return{'pageId':_0x48de93,'type':_0x23c5ea(0x13d),'title':_0x23c5ea(0x168)+_0x48de93,'localPath':resolvePageFilePath(_0x4728d9,_0x48de93,_0x23c5ea(0x13d)),'status':_0x23c5ea(0x173),'reason':_0x23c5ea(0x185)+CLI_BIN_NAME+_0x23c5ea(0x137)+_0x48de93+_0x23c5ea(0x161)};const _0x1b966c=resolvePageFilePath(_0x4728d9,_0x48de93,_0x51d8fe['type']);if(!await fileExists(_0x1b966c))return{'pageId':_0x48de93,'type':_0x51d8fe['type'],'title':_0x51d8fe[_0x23c5ea(0x13c)],'localPath':_0x1b966c,'status':_0x23c5ea(0x173),'reason':_0x23c5ea(0x160)+_0x1b966c};const _0x7474d7=await readFile(_0x1b966c,_0x23c5ea(0x136));try{JSON[_0x23c5ea(0x187)](_0x7474d7);}catch{return{'pageId':_0x48de93,'type':_0x51d8fe[_0x23c5ea(0x18d)],'title':_0x51d8fe[_0x23c5ea(0x13c)],'localPath':_0x1b966c,'status':'blocked','reason':'local\x20JSON\x20is\x20invalid'};}const _0x3286fa=computePageContentHash(_0x7474d7);if(_0x3286fa===_0x51d8fe[_0x23c5ea(0x166)])return{'pageId':_0x48de93,'type':_0x51d8fe['type'],'title':_0x51d8fe[_0x23c5ea(0x13c)],'localPath':_0x1b966c,'status':_0x23c5ea(0x176),'reason':_0x23c5ea(0x143)};try{const _0x2a8c02=await loadPageDetailForPage(_0x42c23f,_0x48de93);if(_0x283390!=null&&!_0x2a8c02[_0x23c5ea(0x13f)][_0x23c5ea(0x167)](_0x283390))return{'pageId':_0x48de93,'type':_0x51d8fe[_0x23c5ea(0x18d)],'title':_0x51d8fe['title'],'localPath':_0x1b966c,'status':_0x23c5ea(0x156),'reason':_0x23c5ea(0x179)+_0x48de93+'\x20no\x20longer\x20belongs\x20to\x20the\x20target\x20dataset'};const _0xfe00ab=_0x51d8fe['pageVersion']!=null&&_0x2a8c02[_0x23c5ea(0x15a)]!=null;if(_0xfe00ab&&_0x51d8fe[_0x23c5ea(0x15a)]!==_0x2a8c02['pageVersion'])return{'pageId':_0x48de93,'type':_0x51d8fe[_0x23c5ea(0x18d)],'title':_0x51d8fe['title'],'localPath':_0x1b966c,'status':_0x23c5ea(0x156),'reason':_0x23c5ea(0x172)};if(!_0xfe00ab&&computeSerializedSchemaHash(_0x2a8c02['code'])!==_0x51d8fe[_0x23c5ea(0x166)])return{'pageId':_0x48de93,'type':_0x51d8fe[_0x23c5ea(0x18d)],'title':_0x51d8fe[_0x23c5ea(0x13c)],'localPath':_0x1b966c,'status':_0x23c5ea(0x156),'reason':'remote\x20schema\x20changed'};}catch(_0x278c6b){return{'pageId':_0x48de93,'type':_0x51d8fe[_0x23c5ea(0x18d)],'title':_0x51d8fe['title'],'localPath':_0x1b966c,'status':_0x23c5ea(0x173),'reason':_0x278c6b instanceof Error?_0x278c6b[_0x23c5ea(0x14f)]:String(_0x278c6b)};}return{'pageId':_0x48de93,'type':_0x51d8fe['type'],'title':_0x51d8fe[_0x23c5ea(0x13c)],'localPath':_0x1b966c,'status':'would_push'};}async function prepareSinglePush(_0x334de9,_0x1fd3af,_0x476a3c,_0x227139,_0x181eb2){const _0x7a5be7=a145_0x54b097;if(!_0x476a3c)throw CliErrors['validation']('No\x20lock\x20record\x20found\x20for\x20page\x20'+_0x227139+'.',_0x7a5be7(0x185)+CLI_BIN_NAME+_0x7a5be7(0x137)+_0x227139+_0x7a5be7(0x18c));const _0x468226=resolvePageFilePath(_0x1fd3af,_0x227139,_0x476a3c['type']);if(!await fileExists(_0x468226))throw CliErrors['validation'](_0x7a5be7(0x160)+_0x468226,_0x7a5be7(0x185)+CLI_BIN_NAME+'\x20page\x20pull\x20--id\x20'+_0x227139+_0x7a5be7(0x18c));const _0x4210d1=await readFile(_0x468226,_0x7a5be7(0x136));try{JSON[_0x7a5be7(0x187)](_0x4210d1);}catch{throw CliErrors['validation']('Invalid\x20JSON\x20in\x20local\x20page\x20file:\x20'+_0x468226);}const _0x14c3fe=await loadPageDetailForPage(_0x334de9,_0x227139);if(_0x181eb2!=null&&!_0x14c3fe[_0x7a5be7(0x13f)][_0x7a5be7(0x167)](_0x181eb2))throw CliErrors[_0x7a5be7(0x145)](_0x7a5be7(0x179)+_0x227139+_0x7a5be7(0x157));const _0x340c39=_0x476a3c[_0x7a5be7(0x15a)]!=null&&_0x14c3fe[_0x7a5be7(0x15a)]!=null;if(_0x340c39){if(_0x476a3c[_0x7a5be7(0x15a)]!==_0x14c3fe['pageVersion'])throw CliErrors['validation'](_0x7a5be7(0x13b)+_0x227139+_0x7a5be7(0x155),_0x7a5be7(0x185)+CLI_BIN_NAME+_0x7a5be7(0x137)+_0x227139+_0x7a5be7(0x18c));}else{const _0x1a1cb2=computeSerializedSchemaHash(_0x14c3fe[_0x7a5be7(0x188)]);if(_0x1a1cb2!==_0x476a3c[_0x7a5be7(0x166)])throw CliErrors[_0x7a5be7(0x145)](_0x7a5be7(0x13b)+_0x227139+_0x7a5be7(0x155),_0x7a5be7(0x185)+CLI_BIN_NAME+_0x7a5be7(0x137)+_0x227139+'`\x20first.');}return{'lockEntry':_0x476a3c,'localPath':_0x468226,'localContent':_0x4210d1,'localHash':computePageContentHash(_0x4210d1),'remoteDetail':_0x14c3fe};}async function pushPreparedPage(_0x18830b,_0x351dc5){const _0x42c858=a145_0x54b097,_0xb4f95a=await updatePage(_0x18830b[_0x42c858(0x164)],_0x351dc5[_0x42c858(0x186)][_0x42c858(0x14b)],_0x351dc5['localContent'],_0x351dc5[_0x42c858(0x186)][_0x42c858(0x13f)]);if(!_0xb4f95a)throw CliErrors[_0x42c858(0x146)]('Page\x20update\x20failed:\x20'+_0x351dc5[_0x42c858(0x186)][_0x42c858(0x14b)]);const _0x3a8d1c=await loadPageDetailForPage(_0x18830b,_0x351dc5[_0x42c858(0x186)][_0x42c858(0x14b)]),_0x2ffaf1=serializePageSchemaForFile(_0x3a8d1c[_0x42c858(0x188)]);return await writeFile(_0x351dc5['localPath'],_0x2ffaf1,_0x42c858(0x136)),{'pageId':_0x3a8d1c['pageId'],'type':_0x3a8d1c[_0x42c858(0x18d)],'title':_0x3a8d1c[_0x42c858(0x169)],'normalized':_0x2ffaf1!==serializePageSchemaForFile(_0x351dc5[_0x42c858(0x159)]),'nextLockEntry':{'hash':computePageContentHash(_0x2ffaf1),'pageId':_0x3a8d1c[_0x42c858(0x14b)],'pageVersion':_0x3a8d1c[_0x42c858(0x15a)],'type':_0x3a8d1c[_0x42c858(0x18d)],'title':_0x3a8d1c[_0x42c858(0x169)],'datasetIds':_0x3a8d1c[_0x42c858(0x13f)],'versionTag':_0x3a8d1c[_0x42c858(0x150)]}};}
|