@lovrabet/rabetbase-cli 2.4.5 → 2.4.6-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/{standard-page-status.d.ts → create.d.ts} +1 -1
- package/lib/commands/page/create.js +1 -0
- package/lib/commands/page/{react → custom}/detail.d.ts +1 -1
- package/lib/commands/page/custom/detail.js +1 -0
- package/lib/commands/page/{react → custom}/list.d.ts +1 -1
- package/lib/commands/page/custom/list.js +1 -0
- package/lib/commands/page/{react → custom}/publish.d.ts +1 -1
- package/lib/commands/page/custom/publish.js +1 -0
- package/lib/commands/page/{react → custom}/shared.d.ts +15 -15
- package/lib/commands/page/custom/shared.js +1 -0
- package/lib/commands/page/{react → custom}/syntax.d.ts +2 -2
- package/lib/commands/page/custom/syntax.js +1 -0
- package/lib/commands/page/custom/template.js +1 -0
- package/lib/commands/page/{react → custom}/update.d.ts +1 -1
- package/lib/commands/page/custom/update.js +1 -0
- package/lib/commands/page/data-list-status.d.ts +2 -0
- package/lib/commands/page/data-list-status.js +1 -0
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.d.ts +18 -18
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.d.ts +43 -43
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.d.ts +3 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/rabetbase/SKILL.md +34 -34
- package/skills/rabetbase/guides/backend-function.md +63 -18
- package/skills/rabetbase/guides/bff-creation-workflow.md +2 -0
- package/skills/rabetbase/guides/{react-custom-page-workflow.md → custom-page-workflow.md} +45 -45
- package/skills/rabetbase/guides/page-development-workflow.md +22 -22
- package/skills/rabetbase/knowledge/{react-page → custom-page}/components.md +2 -2
- package/skills/rabetbase/knowledge/{react-page → custom-page}/generation-standards.md +6 -6
- package/skills/rabetbase/knowledge/page-schema/LrSmartTable.md +6 -6
- package/skills/rabetbase/knowledge/page-schema/external-resources-usage.md +1 -1
- package/skills/rabetbase/references/rabetbase-bff-create.md +2 -0
- package/skills/rabetbase/references/{rabetbase-standard-page-status.md → rabetbase-data-list-status.md} +6 -6
- package/skills/rabetbase/references/rabetbase-dataset-generate.md +1 -1
- package/skills/rabetbase/references/rabetbase-dataset-relation-mutations.md +1 -1
- package/skills/rabetbase/references/rabetbase-dataset-relations.md +1 -1
- package/skills/rabetbase/references/rabetbase-dataset-restore.md +1 -1
- package/skills/rabetbase/references/rabetbase-menu-list.md +1 -1
- package/skills/rabetbase/references/rabetbase-page-create.md +31 -0
- package/skills/rabetbase/references/{rabetbase-page-react-detail.md → rabetbase-page-custom-detail.md} +5 -5
- package/skills/rabetbase/references/{rabetbase-page-react-list.md → rabetbase-page-custom-list.md} +4 -4
- package/skills/rabetbase/references/{rabetbase-page-react-publish.md → rabetbase-page-custom-publish.md} +6 -6
- package/skills/rabetbase/references/{rabetbase-page-react-update.md → rabetbase-page-custom-update.md} +6 -6
- package/skills/rabetbase/references/rabetbase-page-generate-start.md +5 -4
- package/skills/rabetbase/references/rabetbase-page-generate-status.md +4 -4
- package/skills/rabetbase/references/rabetbase-page-pull.md +2 -2
- package/skills/rabetbase/references/rabetbase-page-relation-binding.md +1 -1
- package/skills/rabetbase/references/rabetbase-page-restore.md +7 -7
- package/skills/rabetbase/references/rabetbase-page-sync.md +3 -3
- package/skills/rabetbase.manifest.json +12 -12
- package/lib/commands/page/react/create.d.ts +0 -2
- package/lib/commands/page/react/create.js +0 -1
- package/lib/commands/page/react/detail.js +0 -1
- package/lib/commands/page/react/list.js +0 -1
- package/lib/commands/page/react/publish.js +0 -1
- package/lib/commands/page/react/shared.js +0 -1
- package/lib/commands/page/react/syntax.js +0 -1
- package/lib/commands/page/react/template.js +0 -1
- package/lib/commands/page/react/update.js +0 -1
- package/lib/commands/page/standard-page-status.js +0 -1
- package/skills/rabetbase/references/rabetbase-page-react-create.md +0 -29
- /package/lib/commands/page/{react → custom}/template.d.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a130_0x552345=a130_0x522b;function a130_0x72d3(){const _0x29f5e8=['JS\x20URL\x20is\x20unreachable:\x20','83716iZVdbW','Invalid\x20--params\x20JSON.','label','jsUrl','map','procode','74yospAe','7439184UGRCnp','pages','string','--params.','message','keys',':\x20expected\x20a\x20non-empty\x20string.','18509fgeBiK','CSS\x20URL\x20is\x20unreachable:\x20','No\x20local\x20pages\x20matched\x20paths:\x20','import','12ZbREEI','129tWUfTB','Invalid\x20--params:\x20','join','filter','20971038kibjvp','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','trim','path','cssUrl','462630FTpqfZ','7aAslCQ','length','50vwOCIn','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','info','Invalid\x20--params.','1508540TOMlMa','dryRun','has','isArray','--params.pages\x20is\x20no\x20longer\x20supported.\x20Use\x20--paths\x20with\x20exact\x20local\x20page\x20paths.','Menu\x20sync\x20completed','object','menu-sync','Invalid\x20--params:\x20expected\x20a\x20JSON\x20object.','push','cwd','setLogPath','Local\x20page\x20paths\x20are\x20already\x20on\x20the\x20platform:\x20','7167280tlSEOk'];a130_0x72d3=function(){return _0x29f5e8;};return a130_0x72d3();}(function(_0x4fbe51,_0x25649b){const _0x262113=a130_0x522b,_0x42951f=_0x4fbe51();while(!![]){try{const _0x15dc1c=parseInt(_0x262113(0x97))/0x1*(parseInt(_0x262113(0x8f))/0x2)+-parseInt(_0x262113(0x9c))/0x3*(parseInt(_0x262113(0xbb))/0x4)+parseInt(_0x262113(0xa8))/0x5*(parseInt(_0x262113(0xa5))/0x6)+parseInt(_0x262113(0xa6))/0x7*(parseInt(_0x262113(0xb9))/0x8)+parseInt(_0x262113(0x90))/0x9+parseInt(_0x262113(0xac))/0xa+-parseInt(_0x262113(0xa0))/0xb*(parseInt(_0x262113(0x9b))/0xc);if(_0x15dc1c===_0x25649b)break;else _0x42951f['push'](_0x42951f['shift']());}catch(_0x56d8db){_0x42951f['push'](_0x42951f['shift']());}}}(a130_0x72d3,0x7fa42));import{getLocalPages}from'../../../commands/menu/shared/local-pages.js';function a130_0x522b(_0x1679e3,_0x4637a2){_0x1679e3=_0x1679e3-0x8b;const _0x72d325=a130_0x72d3();let _0x522bd5=_0x72d325[_0x1679e3];return _0x522bd5;}import{getOnlineMenuList,createMenus}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';import{logger}from'../../../utils/logger.js';const MENU_SYNC_PARAM_KEYS=new Set(['jsUrl',a130_0x552345(0xa4)]);function validateParams(_0x25aa3c){const _0x5055c7=a130_0x552345,_0x2d331c=[];return _0x25aa3c[_0x5055c7(0x8c)]&&!isValidJsHttpsUrl(_0x25aa3c[_0x5055c7(0x8c)])&&_0x2d331c[_0x5055c7(0xb5)]({'field':_0x5055c7(0x8c),'message':_0x5055c7(0xa1)}),_0x25aa3c[_0x5055c7(0xa4)]&&!isValidCssHttpsUrl(_0x25aa3c[_0x5055c7(0xa4)])&&_0x2d331c['push']({'field':_0x5055c7(0xa4),'message':_0x5055c7(0xa9)}),_0x2d331c;}export async function runMenuSyncCore(_0x31c41d,_0x1742da,_0x1ff872=[],_0x9c422,_0x51f795={}){const _0x575055=a130_0x552345,_0x59a268=parseMenuSyncParams(_0x9c422),_0x2fcf39=[...new Set(_0x1ff872['map'](_0x1672f5=>_0x1672f5['trim']())[_0x575055(0x9f)](Boolean))],_0x32631e=_0x59a268[_0x575055(0x8c)],_0x2653ce=_0x59a268[_0x575055(0xa4)],_0x3638ac=[];if(_0x32631e)_0x3638ac[_0x575055(0xb5)](_0x32631e);if(_0x2653ce)_0x3638ac[_0x575055(0xb5)](_0x2653ce);const _0x35ee1e=validateParams(_0x59a268);if(_0x35ee1e[_0x575055(0xa7)]>0x0){const _0x20f4f7=_0x35ee1e['map'](_0x137192=>_0x575055(0x93)+_0x137192['field']+':\x20'+_0x137192[_0x575055(0x94)])[_0x575055(0x9e)](';\x20');throw new Error(_0x575055(0x9d)+_0x20f4f7);}logger[_0x575055(0xb7)](process[_0x575055(0xb6)]()),logger[_0x575055(0xaa)](_0x575055(0xb3),'Start\x20non-interactive\x20menu\x20sync',{'appCode':_0x31c41d,'selectedCount':_0x2fcf39[_0x575055(0xa7)],'jsUrl':_0x32631e,'cssUrl':_0x2653ce});if(_0x32631e){const _0xb167fc=await isUrlReachable(_0x32631e);if(!_0xb167fc)throw new Error(_0x575055(0xba)+_0x32631e);}if(_0x2653ce){const _0x3245db=await isUrlReachable(_0x2653ce);if(!_0x3245db)throw new Error(_0x575055(0x98)+_0x2653ce);}const _0x732687=getLocalPages();if(_0x732687[_0x575055(0xa7)]===0x0){if(_0x2fcf39[_0x575055(0xa7)]>0x0)throw new Error(_0x575055(0x99)+_0x2fcf39['join'](',\x20'));return{'created':0x0,'skipped':!![],'dryRun':_0x51f795[_0x575055(0xad)]===!![],'targetPages':[],'plannedMenus':[]};}const _0x332034=await getOnlineMenuList(_0x31c41d,_0x1742da),_0x2af1aa=new Set(_0x332034[_0x575055(0x8d)](_0x2ad094=>_0x2ad094[_0x575055(0xa3)]));let _0x20aac2;if(_0x2fcf39['length']>0x0){const _0x24c349=new Map(_0x732687['map'](_0x37fe29=>[_0x37fe29[_0x575055(0xa3)],_0x37fe29])),_0x36896b=_0x2fcf39[_0x575055(0x9f)](_0x5f1505=>!_0x24c349[_0x575055(0xae)](_0x5f1505));if(_0x36896b['length']>0x0){const _0x5d5156=_0x732687[_0x575055(0x8d)](_0x12e29b=>_0x12e29b['path'])['join'](',\x20');throw new Error(_0x575055(0x99)+_0x36896b['join'](',\x20')+'\x0a\x20\x20Available\x20local\x20paths:\x20'+_0x5d5156);}const _0x5c0c14=_0x2fcf39[_0x575055(0x9f)](_0x418578=>_0x2af1aa['has'](_0x418578));if(_0x5c0c14[_0x575055(0xa7)]>0x0)throw new Error(_0x575055(0xb8)+_0x5c0c14['join'](',\x20'));_0x20aac2=_0x2fcf39[_0x575055(0x8d)](_0x584172=>_0x24c349['get'](_0x584172));}else _0x20aac2=_0x732687[_0x575055(0x9f)](_0x418cb6=>!_0x2af1aa[_0x575055(0xae)](_0x418cb6['path']));if(_0x20aac2[_0x575055(0xa7)]===0x0)return{'created':0x0,'skipped':!![],'dryRun':_0x51f795[_0x575055(0xad)]===!![],'targetPages':[],'plannedMenus':[]};const _0x2434c1=_0x20aac2[_0x575055(0x8d)](_0x222d97=>({'type':_0x575055(0x8e),'path':_0x222d97[_0x575055(0xa3)],'label':_0x222d97[_0x575055(0x8b)],'loadScriptMode':_0x575055(0x9a),'resources':[..._0x3638ac]}));if(_0x51f795[_0x575055(0xad)])return{'created':0x0,'skipped':![],'dryRun':!![],'targetPages':_0x20aac2,'plannedMenus':_0x2434c1};const _0x2913a3=await createMenus(_0x31c41d,_0x1742da,_0x20aac2,_0x3638ac['length']>0x0?_0x3638ac:undefined);return logger[_0x575055(0xaa)](_0x575055(0xb3),_0x575055(0xb1),{'count':_0x20aac2[_0x575055(0xa7)],'resources':_0x3638ac}),{'created':_0x2913a3[_0x575055(0xa7)],'skipped':![],'dryRun':![],'targetPages':_0x20aac2,'plannedMenus':_0x2434c1,'menus':_0x2913a3};}export function parseMenuSyncParams(_0x108d5a){const _0x279281=a130_0x552345;if(!_0x108d5a||typeof _0x108d5a!==_0x279281(0x92))return{};let _0x4b3c90;try{_0x4b3c90=JSON['parse'](_0x108d5a);}catch{throw new Error(_0x279281(0xbc));}if(typeof _0x4b3c90!==_0x279281(0xb2)||_0x4b3c90===null||Array[_0x279281(0xaf)](_0x4b3c90))throw new Error(_0x279281(0xb4));const _0xb2fcbb=_0x4b3c90;if(Object['hasOwn'](_0xb2fcbb,_0x279281(0x91)))throw new Error(_0x279281(0xb0));const _0x10664f=Object[_0x279281(0x95)](_0xb2fcbb)[_0x279281(0x9f)](_0x66eb1c=>!MENU_SYNC_PARAM_KEYS['has'](_0x66eb1c));if(_0x10664f[_0x279281(0xa7)]>0x0)throw new Error('Invalid\x20--params\x20fields:\x20'+_0x10664f[_0x279281(0x9e)](',\x20')+'.');for(const _0x155b91 of MENU_SYNC_PARAM_KEYS){const _0x54c675=_0xb2fcbb[_0x155b91];if(_0x54c675!==undefined&&(typeof _0x54c675!==_0x279281(0x92)||_0x54c675[_0x279281(0xa2)]()===''))throw new Error(_0x279281(0xab)+_0x155b91+_0x279281(0x96));}return{'jsUrl':typeof _0xb2fcbb[_0x279281(0x8c)]===_0x279281(0x92)?_0xb2fcbb[_0x279281(0x8c)][_0x279281(0xa2)]():undefined,'cssUrl':typeof _0xb2fcbb[_0x279281(0xa4)]===_0x279281(0x92)?_0xb2fcbb[_0x279281(0xa4)][_0x279281(0xa2)]():undefined};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x34c837,_0x34ebd2){const _0x781f4e=a132_0x10f2,_0x657372=_0x34c837();while(!![]){try{const _0x4f6b0b=parseInt(_0x781f4e(0xf7))/0x1+parseInt(_0x781f4e(0xfd))/0x2+parseInt(_0x781f4e(0x10b))/0x3*(-parseInt(_0x781f4e(0xfa))/0x4)+parseInt(_0x781f4e(0x115))/0x5+-parseInt(_0x781f4e(0x101))/0x6*(parseInt(_0x781f4e(0xf6))/0x7)+parseInt(_0x781f4e(0x10f))/0x8+parseInt(_0x781f4e(0x108))/0x9*(parseInt(_0x781f4e(0x100))/0xa);if(_0x4f6b0b===_0x34ebd2)break;else _0x657372['push'](_0x657372['shift']());}catch(_0x36cbfb){_0x657372['push'](_0x657372['shift']());}}}(a132_0x3f85,0xb69f8));import{updateMenuCdnUrl,getOnlineMenuList}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';import{logger}from'../../../utils/logger.js';function validateParams(_0x52396b){const _0x1bfb30=a132_0x10f2,_0x530eed=[];return _0x52396b[_0x1bfb30(0xf4)]&&!isValidJsHttpsUrl(_0x52396b['jsUrl'])&&_0x530eed['push']({'field':'jsUrl','message':_0x1bfb30(0x117)}),_0x52396b['cssUrl']&&!isValidCssHttpsUrl(_0x52396b[_0x1bfb30(0x106)])&&_0x530eed[_0x1bfb30(0xdc)]({'field':'cssUrl','message':_0x1bfb30(0x102)}),_0x530eed;}export async function runMenuUpdateCore(_0x749224,_0x49754d,_0x3769fe,_0x318974={}){const _0x1bedaf=a132_0x10f2,_0xe35370=parseUpdateParamsFlag(_0x3769fe),_0x464d41=normalizeMode(_0x318974[_0x1bedaf(0x110)]);validateSelection(_0x318974['selection']);const _0x35a11b=[];if(_0xe35370['jsUrl'])_0x35a11b[_0x1bedaf(0xdc)](_0xe35370[_0x1bedaf(0xf4)]);if(_0xe35370[_0x1bedaf(0x106)])_0x35a11b[_0x1bedaf(0xdc)](_0xe35370[_0x1bedaf(0x106)]);const _0x8e9386=validateParams(_0xe35370);if(_0x8e9386['length']>0x0){const _0x9fa535=_0x8e9386[_0x1bedaf(0x104)](_0x30d7e7=>_0x1bedaf(0x119)+_0x30d7e7[_0x1bedaf(0xee)]+':\x20'+_0x30d7e7[_0x1bedaf(0xe6)])[_0x1bedaf(0x105)](';\x20');throw new Error(_0x1bedaf(0xd6)+_0x9fa535);}if(_0x35a11b[_0x1bedaf(0xda)]===0x0)throw new Error(_0x1bedaf(0xf9)+'Pass\x20--params\x20\x27{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}\x27\x20to\x20update\x20assets.');logger[_0x1bedaf(0xe9)](process[_0x1bedaf(0xe2)]()),logger['info'](_0x1bedaf(0x111),_0x1bedaf(0x103),{'appCode':_0x749224,'jsUrl':_0xe35370[_0x1bedaf(0xf4)],'cssUrl':_0xe35370[_0x1bedaf(0x106)],'mode':_0x464d41,'dryRun':_0x318974[_0x1bedaf(0xff)]===!![]});if(_0xe35370[_0x1bedaf(0xf4)]){const _0x58daac=await isUrlReachable(_0xe35370['jsUrl']);if(!_0x58daac)throw new Error(_0x1bedaf(0xe8)+_0xe35370['jsUrl']);}if(_0xe35370[_0x1bedaf(0x106)]){const _0x2bbbaf=await isUrlReachable(_0xe35370[_0x1bedaf(0x106)]);if(!_0x2bbbaf)throw new Error(_0x1bedaf(0x113)+_0xe35370[_0x1bedaf(0x106)]);}const _0x31ff64=await getOnlineMenuList(_0x749224,_0x49754d),_0x3d68b4=_0x31ff64['filter'](_0x21c023=>_0x21c023[_0x1bedaf(0xd3)]['length']>0x0),_0x304e5d=selectMenusForUpdate(_0x3d68b4,_0x318974[_0x1bedaf(0xf2)]);if(_0x304e5d['length']===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![],'dryRun':_0x318974[_0x1bedaf(0xff)]===!![]};const _0x60f8d8=_0x304e5d[_0x1bedaf(0x104)](_0x2d5fd2=>buildMenuUpdateDiff(_0x2d5fd2,_0xe35370,_0x464d41,_0x318974[_0x1bedaf(0xd4)]===!![],_0x318974[_0x1bedaf(0x114)]));if(_0x318974[_0x1bedaf(0xff)])return{'updated':0x0,'failed':0x0,'skipped':![],'dryRun':!![],'diffs':_0x60f8d8};const _0x4c807=await Promise[_0x1bedaf(0x109)](_0x304e5d['map']((_0x37fc89,_0x5ebeb6)=>updateMenuCdnUrl(_0x749224,_0x49754d,{'id':_0x37fc89['id'],'label':_0x37fc89[_0x1bedaf(0xe7)],'path':_0x37fc89[_0x1bedaf(0xfe)],'resources':_0x60f8d8[_0x5ebeb6][_0x1bedaf(0xed)][_0x1bedaf(0xd3)],'extend':_0x37fc89['extend']??null,'loadScriptMode':_0x318974['loadScriptMode']}))),_0xac8b6c=_0x4c807[_0x1bedaf(0xf8)](_0x471aa5=>_0x471aa5[_0x1bedaf(0xea)]==='fulfilled')['map'](_0x7d36c3=>_0x7d36c3[_0x1bedaf(0xe0)]),_0x5eacab=_0x4c807[_0x1bedaf(0xf8)](_0x5e0aa1=>_0x5e0aa1[_0x1bedaf(0xea)]==='rejected')[_0x1bedaf(0xda)];return logger[_0x1bedaf(0xf0)](_0x1bedaf(0x111),_0x1bedaf(0x112),{'count':_0x304e5d[_0x1bedaf(0xda)],'resources':_0x35a11b}),{'updated':_0xac8b6c[_0x1bedaf(0xda)],'failed':_0x5eacab,'skipped':![],'menus':_0xac8b6c};}function a132_0x10f2(_0xf747c,_0x23fc06){_0xf747c=_0xf747c-0xd3;const _0x3f85f8=a132_0x3f85();let _0x10f2e7=_0x3f85f8[_0xf747c];return _0x10f2e7;}function validateSelection(_0x2a55c4){const _0x38f5eb=a132_0x10f2;if(!_0x2a55c4)throw new Error(_0x38f5eb(0xe3));if(_0x2a55c4[_0x38f5eb(0x10a)]&&(_0x2a55c4['menuIds'][_0x38f5eb(0xda)]>0x0||_0x2a55c4[_0x38f5eb(0xd9)][_0x38f5eb(0xda)]>0x0))throw new Error(_0x38f5eb(0xf1));if(!_0x2a55c4[_0x38f5eb(0x10a)]&&_0x2a55c4['menuIds'][_0x38f5eb(0xda)]===0x0&&_0x2a55c4[_0x38f5eb(0xd9)][_0x38f5eb(0xda)]===0x0)throw new Error(_0x38f5eb(0xe3));}export function selectMenusForUpdate(_0x2baac4,_0x16ce4a){const _0x185557=a132_0x10f2;validateSelection(_0x16ce4a);if(_0x16ce4a[_0x185557(0x10a)])return _0x2baac4;const _0x5276d5=new Set(_0x2baac4[_0x185557(0x104)](_0x5eb3d8=>_0x5eb3d8['id'])),_0x47bc06=new Set(_0x2baac4[_0x185557(0x104)](_0x1f2566=>_0x1f2566['path'])),_0x59954a=_0x16ce4a[_0x185557(0xfc)][_0x185557(0xf8)](_0xa89b68=>!_0x5276d5['has'](_0xa89b68)),_0x212b1a=_0x16ce4a[_0x185557(0xd9)][_0x185557(0xf8)](_0x2b5898=>!_0x47bc06[_0x185557(0xf3)](_0x2b5898));if(_0x59954a[_0x185557(0xda)]>0x0||_0x212b1a[_0x185557(0xda)]>0x0){const _0x84585c=[..._0x59954a[_0x185557(0x104)](_0x3b2568=>String(_0x3b2568)),..._0x212b1a][_0x185557(0x105)](',\x20');throw new Error(_0x185557(0xd7)+_0x84585c);}const _0x209f12=new Set(_0x16ce4a[_0x185557(0xfc)]),_0x19014a=new Set(_0x16ce4a[_0x185557(0xd9)]);return _0x2baac4['filter'](_0x26abfd=>_0x209f12[_0x185557(0xf3)](_0x26abfd['id'])||_0x19014a['has'](_0x26abfd['path']));}function normalizeMode(_0x3a8ca2){const _0x4324d0=a132_0x10f2;if(!_0x3a8ca2)return _0x4324d0(0xe4);if(_0x3a8ca2===_0x4324d0(0xef)||_0x3a8ca2==='patch')return _0x3a8ca2;throw new Error(_0x4324d0(0xfb)+_0x3a8ca2+_0x4324d0(0xe5));}function buildMenuUpdateDiff(_0x992410,_0x1329d9,_0x4c570d,_0x4505e3,_0x488175){const _0x3805fa=a132_0x10f2,_0x23a56a=[..._0x992410[_0x3805fa(0xd3)]];_0x4c570d==='patch'&&assertUnambiguousPatchResources(_0x992410,_0x23a56a,_0x1329d9);const _0x59f9ba=_0x4c570d==='patch'?patchResources(_0x23a56a,_0x1329d9):replaceResources(_0x1329d9),_0x27fdad=[],_0x5072e7=_0x23a56a[_0x3805fa(0xd5)](isJsResource),_0x5a6f1e=_0x59f9ba[_0x3805fa(0xd5)](isJsResource);if(_0x5072e7&&!_0x5a6f1e){const _0x418df5='menu\x20asset-update\x20would\x20remove\x20existing\x20JS\x20resource\x20for\x20\x22'+_0x992410[_0x3805fa(0xe7)]+_0x3805fa(0xec)+_0x992410[_0x3805fa(0xfe)]+_0x3805fa(0xf5)+_0x3805fa(0x10c);if(!_0x4505e3)throw new Error(_0x418df5);_0x27fdad[_0x3805fa(0xdc)](_0x418df5);}const _0x2418b6=_0x23a56a[_0x3805fa(0xd5)](isCssResource),_0x3dcec5=_0x59f9ba[_0x3805fa(0xd5)](isCssResource);_0x2418b6&&!_0x3dcec5&&_0x27fdad[_0x3805fa(0xdc)](_0x3805fa(0x10e)+_0x992410[_0x3805fa(0xe7)]+_0x3805fa(0xec)+_0x992410['path']+').');const _0x3876bf=typeof _0x992410['extend']?.['loadScriptMode']===_0x3805fa(0x116)?_0x992410['extend'][_0x3805fa(0x114)]:null,_0x3d628d=_0x488175?{'loadScriptMode':_0x3876bf}:{},_0x4ab335=_0x488175?{'loadScriptMode':_0x488175}:{};return{'id':_0x992410['id'],'label':_0x992410[_0x3805fa(0xe7)],'path':_0x992410[_0x3805fa(0xfe)],'mode':_0x4c570d,'before':{'resources':_0x23a56a,..._0x3d628d},'after':{'resources':_0x59f9ba,..._0x4ab335},'warnings':_0x27fdad};}function replaceResources(_0x3582f2){const _0x143941=a132_0x10f2;return[_0x3582f2['jsUrl'],_0x3582f2[_0x143941(0x106)]][_0x143941(0xf8)](_0x620021=>!!_0x620021);}function a132_0x3f85(){const _0x286946=['jsUrl',').\x20','9330811CuUIFf','389532smxbYE','filter','Invalid\x20--params:\x20menu\x20asset-update\x20requires\x20at\x20least\x20one\x20explicit\x20JS/CSS\x20URL.\x20','5759524sYXTii','Invalid\x20--mode:\x20','menuIds','387744rNXIdt','path','dryRun','10iKQfKX','6xmDByR','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','Start\x20non-interactive\x20menu\x20asset\x20update','map','join','cssUrl','menu\x20asset-update\x20cannot\x20patch\x20','10926108Uoeblp','allSettled','all','3DBygcx','Use\x20--mode\x20patch\x20to\x20preserve\x20it,\x20pass\x20jsUrl,\x20or\x20add\x20--force\x20for\x20an\x20intentional\x20removal.','.js','menu\x20asset-update\x20will\x20remove\x20existing\x20CSS\x20resource\x20for\x20\x22','8351424CanOSn','mode','menu-asset-update','Menu\x20asset\x20update\x20completed','CSS\x20URL\x20is\x20unreachable:\x20','loadScriptMode','3397670oQcTax','string','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','toLowerCase','--params.','resources','force','some','Invalid\x20--params:\x20','menu\x20asset-update\x20selectors\x20did\x20not\x20match\x20resource-bearing\x20menus:\x20','with\x20a\x20single\x20cssUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','paths','length','trim','push','endsWith','.css','with\x20a\x20single\x20jsUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','value','\x20existing\x20CSS\x20resources\x20for\x20\x22','cwd','menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.','patch','.\x20Allowed\x20values:\x20replace,\x20patch','message','label','JS\x20URL\x20is\x20unreachable:\x20','setLogPath','status','unshift','\x22\x20(','after','field','replace','info','--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.','selection','has'];a132_0x3f85=function(){return _0x286946;};return a132_0x3f85();}function assertUnambiguousPatchResources(_0x55378e,_0x188900,_0x23c145){const _0x48de3a=a132_0x10f2,_0x13e616=_0x188900[_0x48de3a(0xf8)](isJsResource)[_0x48de3a(0xda)];if(_0x23c145[_0x48de3a(0xf4)]&&_0x13e616>0x1)throw new Error('menu\x20asset-update\x20cannot\x20patch\x20'+_0x13e616+'\x20existing\x20JS\x20resources\x20for\x20\x22'+_0x55378e[_0x48de3a(0xe7)]+_0x48de3a(0xec)+_0x55378e[_0x48de3a(0xfe)]+')\x20'+_0x48de3a(0xdf));const _0x4671eb=_0x188900[_0x48de3a(0xf8)](isCssResource)['length'];if(_0x23c145[_0x48de3a(0x106)]&&_0x4671eb>0x1)throw new Error(_0x48de3a(0x107)+_0x4671eb+_0x48de3a(0xe1)+_0x55378e[_0x48de3a(0xe7)]+'\x22\x20('+_0x55378e[_0x48de3a(0xfe)]+')\x20'+_0x48de3a(0xd8));}function patchResources(_0x8e6f73,_0x191d23){const _0x582fb5=a132_0x10f2;let _0x1bec91=![],_0x1c4bc6=![];const _0xbed5af=[];for(const _0x261fd0 of _0x8e6f73){if(isJsResource(_0x261fd0)){if(_0x191d23[_0x582fb5(0xf4)]&&!_0x1bec91)_0xbed5af[_0x582fb5(0xdc)](_0x191d23[_0x582fb5(0xf4)]),_0x1bec91=!![];else!_0x191d23[_0x582fb5(0xf4)]&&_0xbed5af[_0x582fb5(0xdc)](_0x261fd0);continue;}if(isCssResource(_0x261fd0)){if(_0x191d23[_0x582fb5(0x106)]&&!_0x1c4bc6)_0xbed5af[_0x582fb5(0xdc)](_0x191d23[_0x582fb5(0x106)]),_0x1c4bc6=!![];else!_0x191d23[_0x582fb5(0x106)]&&_0xbed5af['push'](_0x261fd0);continue;}_0xbed5af['push'](_0x261fd0);}return _0x191d23[_0x582fb5(0xf4)]&&!_0x1bec91&&_0xbed5af[_0x582fb5(0xeb)](_0x191d23['jsUrl']),_0x191d23[_0x582fb5(0x106)]&&!_0x1c4bc6&&_0xbed5af[_0x582fb5(0xdc)](_0x191d23[_0x582fb5(0x106)]),_0xbed5af;}function isJsResource(_0x481ad6){const _0x197804=a132_0x10f2;return stripQuery(_0x481ad6)[_0x197804(0x118)]()[_0x197804(0xdd)](_0x197804(0x10d));}function isCssResource(_0x42112d){const _0x1e8eeb=a132_0x10f2;return stripQuery(_0x42112d)[_0x1e8eeb(0x118)]()[_0x1e8eeb(0xdd)](_0x1e8eeb(0xde));}function stripQuery(_0x51c507){return _0x51c507['split']('?')[0x0]??_0x51c507;}function parseUpdateParamsFlag(_0x343889){const _0x546286=a132_0x10f2;if(!_0x343889||typeof _0x343889!==_0x546286(0x116))return{};try{const _0x2c39c4=JSON['parse'](_0x343889);if(typeof _0x2c39c4!=='object'||_0x2c39c4===null||Array['isArray'](_0x2c39c4))return{};return{'jsUrl':typeof _0x2c39c4[_0x546286(0xf4)]===_0x546286(0x116)?_0x2c39c4[_0x546286(0xf4)][_0x546286(0xdb)]():undefined,'cssUrl':typeof _0x2c39c4[_0x546286(0x106)]===_0x546286(0x116)?_0x2c39c4[_0x546286(0x106)][_0x546286(0xdb)]():undefined};}catch{return{};}}
|
|
1
|
+
(function(_0x4dcc22,_0x27f06c){const _0x2ec505=a132_0x1758,_0x5690d3=_0x4dcc22();while(!![]){try{const _0x28471e=-parseInt(_0x2ec505(0x12b))/0x1+-parseInt(_0x2ec505(0x11d))/0x2*(-parseInt(_0x2ec505(0x14d))/0x3)+-parseInt(_0x2ec505(0x15c))/0x4+parseInt(_0x2ec505(0x149))/0x5*(parseInt(_0x2ec505(0x119))/0x6)+-parseInt(_0x2ec505(0x120))/0x7*(-parseInt(_0x2ec505(0x155))/0x8)+-parseInt(_0x2ec505(0x129))/0x9*(parseInt(_0x2ec505(0x126))/0xa)+parseInt(_0x2ec505(0x15f))/0xb*(parseInt(_0x2ec505(0x135))/0xc);if(_0x28471e===_0x27f06c)break;else _0x5690d3['push'](_0x5690d3['shift']());}catch(_0x46938a){_0x5690d3['push'](_0x5690d3['shift']());}}}(a132_0x1401,0xc83fb));import{updateMenuCdnUrl,getOnlineMenuList}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';import{logger}from'../../../utils/logger.js';function validateParams(_0x521a8b){const _0x5f28a4=a132_0x1758,_0x5307bc=[];return _0x521a8b[_0x5f28a4(0x11b)]&&!isValidJsHttpsUrl(_0x521a8b[_0x5f28a4(0x11b)])&&_0x5307bc[_0x5f28a4(0x152)]({'field':_0x5f28a4(0x11b),'message':_0x5f28a4(0x140)}),_0x521a8b[_0x5f28a4(0x15e)]&&!isValidCssHttpsUrl(_0x521a8b[_0x5f28a4(0x15e)])&&_0x5307bc[_0x5f28a4(0x152)]({'field':_0x5f28a4(0x15e),'message':'CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL'}),_0x5307bc;}export async function runMenuUpdateCore(_0x5d899f,_0x1fd85d,_0xa63f0d,_0x11870f={}){const _0x329412=a132_0x1758,_0x4a8401=parseUpdateParamsFlag(_0xa63f0d),_0x2c6204=normalizeMode(_0x11870f[_0x329412(0x138)]);validateSelection(_0x11870f['selection']);const _0x4e1c57=[];if(_0x4a8401[_0x329412(0x11b)])_0x4e1c57[_0x329412(0x152)](_0x4a8401[_0x329412(0x11b)]);if(_0x4a8401['cssUrl'])_0x4e1c57[_0x329412(0x152)](_0x4a8401[_0x329412(0x15e)]);const _0x122b92=validateParams(_0x4a8401);if(_0x122b92[_0x329412(0x12f)]>0x0){const _0x154153=_0x122b92['map'](_0x5e8486=>_0x329412(0x15a)+_0x5e8486[_0x329412(0x123)]+':\x20'+_0x5e8486['message'])['join'](';\x20');throw new Error(_0x329412(0x11c)+_0x154153);}if(_0x4e1c57[_0x329412(0x12f)]===0x0)throw new Error('Invalid\x20--params:\x20menu\x20asset-update\x20requires\x20at\x20least\x20one\x20explicit\x20JS/CSS\x20URL.\x20'+_0x329412(0x153));logger['setLogPath'](process[_0x329412(0x131)]()),logger['info'](_0x329412(0x122),_0x329412(0x146),{'appCode':_0x5d899f,'jsUrl':_0x4a8401[_0x329412(0x11b)],'cssUrl':_0x4a8401[_0x329412(0x15e)],'mode':_0x2c6204,'dryRun':_0x11870f[_0x329412(0x158)]===!![]});if(_0x4a8401[_0x329412(0x11b)]){const _0x372e36=await isUrlReachable(_0x4a8401[_0x329412(0x11b)]);if(!_0x372e36)throw new Error(_0x329412(0x13d)+_0x4a8401[_0x329412(0x11b)]);}if(_0x4a8401[_0x329412(0x15e)]){const _0x3affd9=await isUrlReachable(_0x4a8401[_0x329412(0x15e)]);if(!_0x3affd9)throw new Error('CSS\x20URL\x20is\x20unreachable:\x20'+_0x4a8401[_0x329412(0x15e)]);}const _0x115342=await getOnlineMenuList(_0x5d899f,_0x1fd85d),_0x3d82ce=_0x115342[_0x329412(0x14f)](_0x750272=>_0x750272[_0x329412(0x12a)][_0x329412(0x12f)]>0x0),_0x17ac01=selectMenusForUpdate(_0x3d82ce,_0x11870f[_0x329412(0x128)]);if(_0x17ac01[_0x329412(0x12f)]===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![],'dryRun':_0x11870f['dryRun']===!![]};const _0x3729fc=_0x17ac01[_0x329412(0x134)](_0x2184fb=>buildMenuUpdateDiff(_0x2184fb,_0x4a8401,_0x2c6204,_0x11870f[_0x329412(0x154)]===!![],_0x11870f['loadScriptMode']));if(_0x11870f[_0x329412(0x158)])return{'updated':0x0,'failed':0x0,'skipped':![],'dryRun':!![],'diffs':_0x3729fc};const _0x4ce7ea=await Promise[_0x329412(0x156)](_0x17ac01[_0x329412(0x134)]((_0x1e3feb,_0x4a0edc)=>updateMenuCdnUrl(_0x5d899f,_0x1fd85d,{'id':_0x1e3feb['id'],'label':_0x1e3feb['label'],'path':_0x1e3feb['path'],'resources':_0x3729fc[_0x4a0edc][_0x329412(0x127)]['resources'],'extend':_0x1e3feb[_0x329412(0x124)]??null,'loadScriptMode':_0x11870f[_0x329412(0x12c)]}))),_0xf71fb5=_0x4ce7ea[_0x329412(0x14f)](_0x3e19e8=>_0x3e19e8[_0x329412(0x14c)]===_0x329412(0x11a))[_0x329412(0x134)](_0x1a6cfd=>_0x1a6cfd[_0x329412(0x121)]),_0x52af23=_0x4ce7ea['filter'](_0x436320=>_0x436320['status']===_0x329412(0x144))['length'];return logger[_0x329412(0x13c)]('menu-asset-update','Menu\x20asset\x20update\x20completed',{'count':_0x17ac01[_0x329412(0x12f)],'resources':_0x4e1c57}),{'updated':_0xf71fb5[_0x329412(0x12f)],'failed':_0x52af23,'skipped':![],'menus':_0xf71fb5};}function validateSelection(_0x594f7d){const _0x3a1632=a132_0x1758;if(!_0x594f7d)throw new Error(_0x3a1632(0x143));if(_0x594f7d[_0x3a1632(0x130)]&&(_0x594f7d[_0x3a1632(0x147)]['length']>0x0||_0x594f7d[_0x3a1632(0x13f)][_0x3a1632(0x12f)]>0x0))throw new Error(_0x3a1632(0x151));if(!_0x594f7d[_0x3a1632(0x130)]&&_0x594f7d[_0x3a1632(0x147)][_0x3a1632(0x12f)]===0x0&&_0x594f7d[_0x3a1632(0x13f)][_0x3a1632(0x12f)]===0x0)throw new Error(_0x3a1632(0x143));}export function selectMenusForUpdate(_0x5bfb8d,_0x3374b8){const _0x5cc413=a132_0x1758;validateSelection(_0x3374b8);if(_0x3374b8['all'])return _0x5bfb8d;const _0x4f6898=new Set(_0x5bfb8d[_0x5cc413(0x134)](_0x228934=>_0x228934['id'])),_0xc1fdca=new Set(_0x5bfb8d[_0x5cc413(0x134)](_0x3bd423=>_0x3bd423[_0x5cc413(0x14a)])),_0xa09c20=_0x3374b8[_0x5cc413(0x147)][_0x5cc413(0x14f)](_0x386630=>!_0x4f6898[_0x5cc413(0x159)](_0x386630)),_0x11b453=_0x3374b8['paths'][_0x5cc413(0x14f)](_0x32d9f2=>!_0xc1fdca[_0x5cc413(0x159)](_0x32d9f2));if(_0xa09c20[_0x5cc413(0x12f)]>0x0||_0x11b453[_0x5cc413(0x12f)]>0x0){const _0x3e273e=[..._0xa09c20[_0x5cc413(0x134)](_0x5932c4=>String(_0x5932c4)),..._0x11b453][_0x5cc413(0x14b)](',\x20');throw new Error(_0x5cc413(0x15b)+_0x3e273e);}const _0x275322=new Set(_0x3374b8[_0x5cc413(0x147)]),_0xdd5992=new Set(_0x3374b8['paths']);return _0x5bfb8d[_0x5cc413(0x14f)](_0x2fa55e=>_0x275322[_0x5cc413(0x159)](_0x2fa55e['id'])||_0xdd5992[_0x5cc413(0x159)](_0x2fa55e['path']));}function normalizeMode(_0x9451e6){const _0x57db46=a132_0x1758;if(!_0x9451e6)return _0x57db46(0x12d);if(_0x9451e6===_0x57db46(0x11f)||_0x9451e6===_0x57db46(0x12d))return _0x9451e6;throw new Error(_0x57db46(0x142)+_0x9451e6+'.\x20Allowed\x20values:\x20replace,\x20patch');}function buildMenuUpdateDiff(_0x1bede6,_0x5ed03d,_0x3c0866,_0xd15a7,_0x1e7740){const _0x25ab25=a132_0x1758,_0x245d84=[..._0x1bede6[_0x25ab25(0x12a)]];_0x3c0866===_0x25ab25(0x12d)&&assertUnambiguousPatchResources(_0x1bede6,_0x245d84,_0x5ed03d);const _0xd1bf17=_0x3c0866===_0x25ab25(0x12d)?patchResources(_0x245d84,_0x5ed03d):replaceResources(_0x5ed03d),_0x49710f=[],_0x1635a6=_0x245d84[_0x25ab25(0x162)](isJsResource),_0x568619=_0xd1bf17['some'](isJsResource);if(_0x1635a6&&!_0x568619){const _0x192a04=_0x25ab25(0x125)+_0x1bede6[_0x25ab25(0x13a)]+'\x22\x20('+_0x1bede6[_0x25ab25(0x14a)]+_0x25ab25(0x160)+'Use\x20--mode\x20patch\x20to\x20preserve\x20it,\x20pass\x20jsUrl,\x20or\x20add\x20--force\x20for\x20an\x20intentional\x20removal.';if(!_0xd15a7)throw new Error(_0x192a04);_0x49710f['push'](_0x192a04);}const _0x17106b=_0x245d84[_0x25ab25(0x162)](isCssResource),_0x3cbf79=_0xd1bf17[_0x25ab25(0x162)](isCssResource);_0x17106b&&!_0x3cbf79&&_0x49710f[_0x25ab25(0x152)](_0x25ab25(0x139)+_0x1bede6[_0x25ab25(0x13a)]+_0x25ab25(0x13e)+_0x1bede6[_0x25ab25(0x14a)]+').');const _0x5b34a0=typeof _0x1bede6['extend']?.[_0x25ab25(0x12c)]==='string'?_0x1bede6[_0x25ab25(0x124)]['loadScriptMode']:null,_0x10bc26=_0x1e7740?{'loadScriptMode':_0x5b34a0}:{},_0x717dd4=_0x1e7740?{'loadScriptMode':_0x1e7740}:{};return{'id':_0x1bede6['id'],'label':_0x1bede6[_0x25ab25(0x13a)],'path':_0x1bede6[_0x25ab25(0x14a)],'mode':_0x3c0866,'before':{'resources':_0x245d84,..._0x10bc26},'after':{'resources':_0xd1bf17,..._0x717dd4},'warnings':_0x49710f};}function replaceResources(_0x11f4a7){const _0x18004f=a132_0x1758;return[_0x11f4a7[_0x18004f(0x11b)],_0x11f4a7[_0x18004f(0x15e)]][_0x18004f(0x14f)](_0x415b1d=>!!_0x415b1d);}function assertUnambiguousPatchResources(_0x2897f8,_0x1977c3,_0x732630){const _0x5b4c89=a132_0x1758,_0x4d3f33=_0x1977c3[_0x5b4c89(0x14f)](isJsResource)['length'];if(_0x732630['jsUrl']&&_0x4d3f33>0x1)throw new Error(_0x5b4c89(0x133)+_0x4d3f33+_0x5b4c89(0x15d)+_0x2897f8[_0x5b4c89(0x13a)]+_0x5b4c89(0x13e)+_0x2897f8['path']+')\x20'+_0x5b4c89(0x14e));const _0x2306b8=_0x1977c3['filter'](isCssResource)[_0x5b4c89(0x12f)];if(_0x732630[_0x5b4c89(0x15e)]&&_0x2306b8>0x1)throw new Error(_0x5b4c89(0x133)+_0x2306b8+_0x5b4c89(0x136)+_0x2897f8['label']+_0x5b4c89(0x13e)+_0x2897f8['path']+')\x20'+_0x5b4c89(0x148));}function a132_0x1401(){const _0x1eb8a6=['patch','.js','length','all','cwd','toLowerCase','menu\x20asset-update\x20cannot\x20patch\x20','map','15331560yUMHzF','\x20existing\x20CSS\x20resources\x20for\x20\x22','unshift','mode','menu\x20asset-update\x20will\x20remove\x20existing\x20CSS\x20resource\x20for\x20\x22','label','endsWith','info','JS\x20URL\x20is\x20unreachable:\x20','\x22\x20(','paths','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','isArray','Invalid\x20--mode:\x20','menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.','rejected','split','Start\x20non-interactive\x20menu\x20asset\x20update','menuIds','with\x20a\x20single\x20cssUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','6740zKUDot','path','join','status','389931Uptvhw','with\x20a\x20single\x20jsUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','filter','object','--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.','push','Pass\x20--params\x20\x27{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}\x27\x20to\x20update\x20assets.','force','5528IovKGG','allSettled','parse','dryRun','has','--params.','menu\x20asset-update\x20selectors\x20did\x20not\x20match\x20resource-bearing\x20menus:\x20','5509468nEFQPM','\x20existing\x20JS\x20resources\x20for\x20\x22','cssUrl','22gAZstI',').\x20','trim','some','2826UOKxjm','fulfilled','jsUrl','Invalid\x20--params:\x20','14HWJXub','string','replace','602KlwPqQ','value','menu-asset-update','field','extend','menu\x20asset-update\x20would\x20remove\x20existing\x20JS\x20resource\x20for\x20\x22','420460wqlrfo','after','selection','171oxedhZ','resources','1162973VWdzry','loadScriptMode'];a132_0x1401=function(){return _0x1eb8a6;};return a132_0x1401();}function patchResources(_0x2ae5a6,_0x2668dc){const _0x300269=a132_0x1758;let _0x4558a3=![],_0x252227=![];const _0x162c14=[];for(const _0x5c38e0 of _0x2ae5a6){if(isJsResource(_0x5c38e0)){if(_0x2668dc['jsUrl']&&!_0x4558a3)_0x162c14[_0x300269(0x152)](_0x2668dc[_0x300269(0x11b)]),_0x4558a3=!![];else!_0x2668dc[_0x300269(0x11b)]&&_0x162c14['push'](_0x5c38e0);continue;}if(isCssResource(_0x5c38e0)){if(_0x2668dc['cssUrl']&&!_0x252227)_0x162c14['push'](_0x2668dc[_0x300269(0x15e)]),_0x252227=!![];else!_0x2668dc[_0x300269(0x15e)]&&_0x162c14[_0x300269(0x152)](_0x5c38e0);continue;}_0x162c14[_0x300269(0x152)](_0x5c38e0);}return _0x2668dc[_0x300269(0x11b)]&&!_0x4558a3&&_0x162c14[_0x300269(0x137)](_0x2668dc[_0x300269(0x11b)]),_0x2668dc[_0x300269(0x15e)]&&!_0x252227&&_0x162c14[_0x300269(0x152)](_0x2668dc[_0x300269(0x15e)]),_0x162c14;}function isJsResource(_0x26ed81){const _0x14cca4=a132_0x1758;return stripQuery(_0x26ed81)[_0x14cca4(0x132)]()['endsWith'](_0x14cca4(0x12e));}function isCssResource(_0x35d79f){const _0x5ea471=a132_0x1758;return stripQuery(_0x35d79f)[_0x5ea471(0x132)]()[_0x5ea471(0x13b)]('.css');}function a132_0x1758(_0x2e6aa8,_0x240bb8){_0x2e6aa8=_0x2e6aa8-0x119;const _0x1401b5=a132_0x1401();let _0x17583b=_0x1401b5[_0x2e6aa8];return _0x17583b;}function stripQuery(_0x2d7854){const _0x2d1d42=a132_0x1758;return _0x2d7854[_0x2d1d42(0x145)]('?')[0x0]??_0x2d7854;}function parseUpdateParamsFlag(_0x251c73){const _0x2117c1=a132_0x1758;if(!_0x251c73||typeof _0x251c73!==_0x2117c1(0x11e))return{};try{const _0x2423f7=JSON[_0x2117c1(0x157)](_0x251c73);if(typeof _0x2423f7!==_0x2117c1(0x150)||_0x2423f7===null||Array[_0x2117c1(0x141)](_0x2423f7))return{};return{'jsUrl':typeof _0x2423f7[_0x2117c1(0x11b)]===_0x2117c1(0x11e)?_0x2423f7[_0x2117c1(0x11b)]['trim']():undefined,'cssUrl':typeof _0x2423f7['cssUrl']==='string'?_0x2423f7[_0x2117c1(0x15e)][_0x2117c1(0x161)]():undefined};}catch{return{};}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x441e48,_0xc245ac){const _0x593ec3=a133_0x3acb,_0x4ee719=_0x441e48();while(!![]){try{const _0x57f24c=-parseInt(_0x593ec3(0x159))/0x1*(parseInt(_0x593ec3(0x15d))/0x2)+parseInt(_0x593ec3(0x15a))/0x3*(parseInt(_0x593ec3(0x156))/0x4)+-parseInt(_0x593ec3(0x152))/0x5*(parseInt(_0x593ec3(0x153))/0x6)+-parseInt(_0x593ec3(0x158))/0x7+parseInt(_0x593ec3(0x150))/0x8+parseInt(_0x593ec3(0x151))/0x9*(parseInt(_0x593ec3(0x154))/0xa)+parseInt(_0x593ec3(0x15b))/0xb;if(_0x57f24c===_0xc245ac)break;else _0x4ee719['push'](_0x4ee719['shift']());}catch(_0x5304ad){_0x4ee719['push'](_0x4ee719['shift']());}}}(a133_0x2a28,0x46903));function a133_0x2a28(){const _0x3f9206=['3923332cVPfJA','5lTzpZx','267cGTKDI','4120237wXnvnB','trim','199310FbqXdI','4139608HTTkJD','54wLmAPq','72415OlZcSz','6FiDGzA','592240tlHnEi','test','5164GvsRHk','HEAD'];a133_0x2a28=function(){return _0x3f9206;};return a133_0x2a28();}function a133_0x3acb(_0x2cd56b,_0x3cd96d){_0x2cd56b=_0x2cd56b-0x150;const _0x2a288b=a133_0x2a28();let _0x3acb53=_0x2a288b[_0x2cd56b];return _0x3acb53;}export function isValidJsHttpsUrl(_0x6cd0c5){const _0x57d2df=a133_0x3acb;return/^https:\/\/.+\.js(\?.*)?$/[_0x57d2df(0x155)](_0x6cd0c5[_0x57d2df(0x15c)]());}export function isValidCssHttpsUrl(_0x285a56){const _0x3eb486=a133_0x3acb;return/^https:\/\/.+\.css(\?.*)?$/[_0x3eb486(0x155)](_0x285a56[_0x3eb486(0x15c)]());}export async function isUrlReachable(_0x308529){const _0x5a409a=a133_0x3acb;try{const _0x60dd9=await fetch(_0x308529,{'method':_0x5a409a(0x157)});return _0x60dd9['ok'];}catch{return![];}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a134_0x3f7900=a134_0x1baa;(function(_0x17492b,_0x2c0e2c){const _0x2bdd1a=a134_0x1baa,_0x299dab=_0x17492b();while(!![]){try{const _0x8e7fe6=parseInt(_0x2bdd1a(0x1b9))/0x1*(parseInt(_0x2bdd1a(0x1a4))/0x2)+-parseInt(_0x2bdd1a(0x19e))/0x3+parseInt(_0x2bdd1a(0x181))/0x4+parseInt(_0x2bdd1a(0x18a))/0x5+-parseInt(_0x2bdd1a(0x1aa))/0x6*(parseInt(_0x2bdd1a(0x194))/0x7)+-parseInt(_0x2bdd1a(0x1be))/0x8*(-parseInt(_0x2bdd1a(0x187))/0x9)+parseInt(_0x2bdd1a(0x1ba))/0xa*(parseInt(_0x2bdd1a(0x1a7))/0xb);if(_0x8e7fe6===_0x2c0e2c)break;else _0x299dab['push'](_0x299dab['shift']());}catch(_0x688e68){_0x299dab['push'](_0x299dab['shift']());}}}(a134_0x4a54,0x1c99f));import a134_0x1221f1 from'chalk';import{buildCompareRows,doCreateMenus,fetchMenuData}from'../../commands/menu/shared/logic.js';import{renderCompareTable,renderSyncSummary}from'../../commands/menu/shared/compare-table.js';import{selectPages,askJsUrl,askCssUrl,askConfirm,startSpinner,stopSpinner,isInteractive,requireInteractive}from'../../commands/menu/shared/inquirer.js';import{CliErrors}from'../../errors.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';import{parseMenuSyncParams,runMenuSyncCore}from'../../commands/menu/shared/sync-core.js';function a134_0x1baa(_0x5bc80d,_0x1e96d2){_0x5bc80d=_0x5bc80d-0x180;const _0x4a54b0=a134_0x4a54();let _0x1baacf=_0x4a54b0[_0x5bc80d];return _0x1baacf;}import{getLocalPages}from'../../commands/menu/shared/local-pages.js';import{isInProject}from'../../context.js';export const menuSync={'service':'menu','command':a134_0x3f7900(0x19c),'description':a134_0x3f7900(0x1ca),'risk':a134_0x3f7900(0x199),'flags':[{'name':a134_0x3f7900(0x1ac),'type':a134_0x3f7900(0x1c2),'description':a134_0x3f7900(0x18c)+a134_0x3f7900(0x190)},{'name':a134_0x3f7900(0x18e),'type':a134_0x3f7900(0x1c2),'description':a134_0x3f7900(0x182)},{'name':a134_0x3f7900(0x1a9),'type':'boolean','description':a134_0x3f7900(0x19b)}],async 'dryRun'(_0x571c05){const _0x405a44=a134_0x3f7900;ensureRunnableContext(_0x571c05[_0x405a44(0x18b)],_0x571c05['selectedAppName']);const _0x5d076a=await runMenuSyncCore(_0x571c05['appCode'],_0x571c05[_0x405a44(0x184)],parsePaths(_0x571c05[_0x405a44(0x189)](_0x405a44(0x18e))),_0x571c05[_0x405a44(0x189)](_0x405a44(0x1ac)),{'dryRun':!![]});return{'method':'POST','url':_0x405a44(0x1a0),'body':_0x5d076a,'description':_0x5d076a[_0x405a44(0x1ad)]?_0x405a44(0x180):_0x405a44(0x19a)+_0x5d076a['targetPages'][_0x405a44(0x192)]+_0x405a44(0x1b0)};},async 'execute'(_0x121a69){const _0x14f693=a134_0x3f7900;ensureRunnableContext(_0x121a69[_0x14f693(0x18b)],_0x121a69[_0x14f693(0x1b8)]);const _0x24d3c4=_0x121a69[_0x14f693(0x1c8)](_0x14f693(0x1a9)),_0x54acc2=_0x121a69['str'](_0x14f693(0x1ac)),_0x3009dd=parsePaths(_0x121a69[_0x14f693(0x189)]('paths')),_0x547024=parseMenuSyncParams(_0x54acc2);if(_0x24d3c4){const _0x153946=await runMenuSyncCore(_0x121a69[_0x14f693(0x1b1)],_0x121a69[_0x14f693(0x184)],_0x3009dd,_0x54acc2);if(_0x153946[_0x14f693(0x1ad)]){const _0x3cfb26=getLocalPages();_0x3cfb26['length']===0x0?writeCliSideChannelLine('!\x20No\x20local\x20pages\x20found\x20in\x20src/pages'):writeCliSideChannelLine(_0x14f693(0x1a6));}else writeCliSideChannelLine(_0x14f693(0x1bd)+_0x153946[_0x14f693(0x1b5)]+_0x14f693(0x18f));return{'ok':!![],'data':_0x153946,'message':_0x153946[_0x14f693(0x1ad)]?_0x14f693(0x1c4):_0x14f693(0x1b6)+_0x153946['created']+_0x14f693(0x191)};}if(_0x3009dd[_0x14f693(0x192)]>0x0)throw CliErrors[_0x14f693(0x186)](_0x14f693(0x1c7),_0x14f693(0x185));if(!isInteractive()&&_0x54acc2)throw CliErrors[_0x14f693(0x186)](_0x14f693(0x1a8),'Preview\x20with\x20--dry-run,\x20then\x20reuse\x20the\x20same\x20--paths\x20and\x20--params\x20with\x20--yes.');requireInteractive();const _0x8b7153=startSpinner(_0x14f693(0x1cb));let _0x519b89,_0x1386d3,_0x541b34;try{const _0x4944da=await fetchMenuData(_0x121a69[_0x14f693(0x1b1)],_0x121a69[_0x14f693(0x184)]);_0x519b89=_0x4944da[_0x14f693(0x1ab)],_0x1386d3=_0x4944da[_0x14f693(0x1c6)],_0x541b34=_0x4944da[_0x14f693(0x1a5)],stopSpinner(_0x8b7153,_0x14f693(0x1b4),!![]);}catch(_0xc403d6){stopSpinner(_0x8b7153,'Failed\x20to\x20fetch\x20online\x20menu\x20list',![]);throw CliErrors[_0x14f693(0x186)](_0xc403d6 instanceof Error?_0xc403d6[_0x14f693(0x198)]:_0x14f693(0x197));}if(_0x519b89[_0x14f693(0x192)]===0x0)return writeCliSideChannelLine(a134_0x1221f1[_0x14f693(0x183)]('\x20\x20!\x20No\x20local\x20pages\x20found,\x20please\x20create\x20pages\x20first')),{'ok':!![]};const _0x510fb9=buildCompareRows(_0x519b89,_0x1386d3);writeCliSideChannelLine(renderCompareTable(_0x510fb9)),writeCliSideChannelLine('');const _0x55810c=await selectPages(_0x519b89,_0x1386d3);writeCliSideChannelLine(''),writeCliSideChannelLine(a134_0x1221f1[_0x14f693(0x1c0)](_0x14f693(0x193)+_0x55810c[_0x14f693(0x192)]+_0x14f693(0x18d)));const _0x593b7a=_0x547024[_0x14f693(0x19f)]&&_0x547024[_0x14f693(0x196)];if(!_0x593b7a){writeCliSideChannelLine(renderSyncSummary(_0x55810c,_0x1386d3['size']>0x0));const _0x5f41d5=await askConfirm(_0x14f693(0x1b2));if(!_0x5f41d5)return writeCliSideChannelLine(a134_0x1221f1[_0x14f693(0x1b7)](_0x14f693(0x1af))),{'ok':!![]};}let _0x5c8c62=_0x547024[_0x14f693(0x19f)],_0x18e4de=_0x547024[_0x14f693(0x196)];!_0x5c8c62&&(_0x5c8c62=await askJsUrl());!_0x18e4de&&(_0x18e4de=await askCssUrl());const _0x16c528=await askConfirm(_0x14f693(0x1c3)+_0x55810c[_0x14f693(0x192)]+_0x14f693(0x1a2)+_0x5c8c62+_0x14f693(0x19d)+_0x18e4de+'?');if(!_0x16c528)return writeCliSideChannelLine(a134_0x1221f1[_0x14f693(0x1b7)]('\x20\x20Cancelled.')),{'ok':!![]};const _0x2b4bb=[_0x5c8c62,_0x18e4de],_0x4fb770=startSpinner(_0x14f693(0x1b3)+_0x55810c['length']+'\x20menu(s)...');try{const _0x47a84c=await doCreateMenus(_0x121a69[_0x14f693(0x1b1)],_0x121a69[_0x14f693(0x184)],_0x55810c,_0x2b4bb);return stopSpinner(_0x4fb770,_0x14f693(0x1a3)+_0x47a84c[_0x14f693(0x1b5)]+'\x20menu(s)',!![]),{'ok':!![],'data':_0x47a84c,'message':'Menu\x20sync\x20completed:\x20'+_0x47a84c[_0x14f693(0x1b5)]+_0x14f693(0x1c5)+_0x47a84c[_0x14f693(0x1bc)]+'\x20failed.'};}catch(_0x2b300c){stopSpinner(_0x4fb770,_0x14f693(0x1a1),![]);throw CliErrors[_0x14f693(0x186)](_0x2b300c instanceof Error?_0x2b300c['message']:_0x14f693(0x1a1));}}};function a134_0x4a54(){const _0xed2e80=['write','Would\x20create\x20','Confirm\x20non-interactive\x20sync;\x20without\x20--paths,\x20create\x20all\x20missing\x20local\x20pages','sync','\x20and\x20CSS:\x20','368664IZcYIw','jsUrl','/smartapi/menu/create','Menu\x20creation\x20failed','\x20menu(s)\x20with\x20JS:\x20','Created\x20','28QNwhBd','onlineMenuList','✓\x20All\x20local\x20pages\x20are\x20already\x20on\x20platform','11uJaobZ','Non-interactive\x20menu\x20sync\x20requires\x20--yes.','yes','30528JakXWv','localPages','params','skipped','appcode','\x20\x20Cancelled.','\x20local\x20microfrontend\x20menu(s).','appCode','\x20\x20Continue\x20with\x20creation?','Creating\x20','Online\x20menu\x20list\x20fetched','created','Menu\x20sync\x20completed:\x20','gray','selectedAppName','4595wGcqrj','516160waznFi','filter','failed','✓\x20Menu\x20sync\x20completed:\x20','8ztkwZp','menu\x20sync\x20requires\x20a\x20project\x20context\x20or\x20explicit\x20--appcode.\x20','cyan','Run\x20inside\x20a\x20directory\x20with\x20.rabetbase.json,\x20or\x20pass\x20--appcode\x20<code>.','string','\x20\x20Create\x20','Menu\x20sync\x20skipped','\x20created,\x20','onlinePaths','menu\x20sync\x20--paths\x20requires\x20--yes\x20for\x20execution.','flag','split','Sync\x20local\x20pages\x20as\x20platform\x20menus','Fetching\x20online\x20menu\x20list...','No\x20local\x20microfrontend\x20menus\x20would\x20be\x20created.','406344xkQnCN','Exact\x20comma-separated\x20local\x20page\x20paths\x20to\x20sync','yellow','cookie','Preview\x20with\x20--dry-run,\x20then\x20reuse\x20the\x20same\x20--paths\x20and\x20--params\x20with\x20--yes.','validation','639297quMMbT','map','str','240730UqfZvc','rawFlags','Pre-fill\x20JS/CSS\x20URLs.\x20','\x20page(s)','paths','\x20menu(s)\x20created','JSON:\x20{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}','\x20created.','length','\x20\x20✓\x20Selected:\x20','133wCXsBH','trim','cssUrl','Failed\x20to\x20fetch\x20online\x20menu\x20list','message'];a134_0x4a54=function(){return _0xed2e80;};return a134_0x4a54();}function ensureRunnableContext(_0x275213,_0x1ddc2a){const _0x1755a2=a134_0x3f7900,_0x21ea22=_0x275213[_0x1755a2(0x1ae)]?String(_0x275213[_0x1755a2(0x1ae)])[_0x1755a2(0x195)]():'';if(!isInProject()&&!_0x1ddc2a&&!_0x21ea22)throw CliErrors[_0x1755a2(0x186)](_0x1755a2(0x1bf)+_0x1755a2(0x1c1));}function parsePaths(_0x108f8e){const _0xc2a39c=a134_0x3f7900;return[...new Set(_0x108f8e[_0xc2a39c(0x1c9)](',')[_0xc2a39c(0x188)](_0x44aaf9=>_0x44aaf9[_0xc2a39c(0x195)]())[_0xc2a39c(0x1bb)](Boolean))];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a135_0x1669e4=a135_0x1648;(function(_0x2ff2e8,_0x5f3345){const _0x5438a0=a135_0x1648,_0x3d4bc3=_0x2ff2e8();while(!![]){try{const _0x3a9fba=parseInt(_0x5438a0(0x12d))/0x1*(parseInt(_0x5438a0(0x124))/0x2)+-parseInt(_0x5438a0(0x12b))/0x3*(-parseInt(_0x5438a0(0x12e))/0x4)+-parseInt(_0x5438a0(0x11e))/0x5+-parseInt(_0x5438a0(0x113))/0x6*(-parseInt(_0x5438a0(0x117))/0x7)+-parseInt(_0x5438a0(0x114))/0x8+-parseInt(_0x5438a0(0x10f))/0x9*(parseInt(_0x5438a0(0x10d))/0xa)+parseInt(_0x5438a0(0x110))/0xb;if(_0x3a9fba===_0x5f3345)break;else _0x3d4bc3['push'](_0x3d4bc3['shift']());}catch(_0x14b3c4){_0x3d4bc3['push'](_0x3d4bc3['shift']());}}}(a135_0x17f0,0x94049));import{asDryRunResult}from'../../commands/common/dry-run.js';import{createNotificationChannelConfig,getNotificationChannelConfig,isPlatformTransportFailure}from'../../core/api-client.js';import{assertSingleNotificationSource,createMutationInput,DEFAULT_NOTIFICATION_CONNECT_TIMEOUT,DEFAULT_NOTIFICATION_READ_TIMEOUT,normalizeExactNotificationConfig,notificationError,notificationLookupCommand,NOTIFICATION_APP_FLAG,NOTIFICATION_INPUT_FLAGS,projectNotificationConfig,readNotificationDocument,safeApiFailure}from'../../commands/notification/shared.js';const CREATE_PATH=a135_0x1669e4(0x122);function a135_0x1648(_0x4a47da,_0x54ef00){_0x4a47da=_0x4a47da-0x10d;const _0x17f084=a135_0x17f0();let _0x1648eb=_0x17f084[_0x4a47da];return _0x1648eb;}async function prepareCreate(_0x4c9ab0){const _0x1f7929=a135_0x1669e4,_0x4809b1=await readNotificationDocument(_0x4c9ab0,_0x1f7929(0x121)),_0x4aa7f4=createMutationInput(_0x4c9ab0['appCode'],_0x4809b1);return{'document':_0x4809b1,'input':_0x4aa7f4,'planned':projectNotificationConfig({'appCode':_0x4c9ab0[_0x1f7929(0x126)],'configName':_0x4809b1['configName'],'channelType':_0x4809b1[_0x1f7929(0x119)],'endpointUrl':_0x4809b1['endpointUrl'],'channelConfig':_0x4809b1['channelConfig'],'description':_0x4809b1[_0x1f7929(0x120)],'connectTimeout':_0x4809b1[_0x1f7929(0x11d)]??DEFAULT_NOTIFICATION_CONNECT_TIMEOUT,'readTimeout':_0x4809b1[_0x1f7929(0x11a)]??DEFAULT_NOTIFICATION_READ_TIMEOUT})};}export const notificationConfigCreate={'service':a135_0x1669e4(0x130),'command':a135_0x1669e4(0x12f),'description':a135_0x1669e4(0x112),'risk':'write','requiresAppCode':!![],'structuredErrors':!![],'flags':[...NOTIFICATION_INPUT_FLAGS,NOTIFICATION_APP_FLAG],async 'validate'(_0x4efcad){assertSingleNotificationSource(_0x4efcad);},async 'dryRun'(_0x19e695){const _0x54361f=a135_0x1669e4,_0x52ab48=await prepareCreate(_0x19e695),_0x3b7064=notificationLookupCommand(_0x19e695['appCode'],_0x52ab48[_0x54361f(0x111)][_0x54361f(0x119)]);return asDryRunResult({'operation':'create','selector':{'appCode':_0x19e695['appCode'],'configName':_0x52ab48[_0x54361f(0x111)][_0x54361f(0x123)],'channelType':_0x52ab48[_0x54361f(0x111)][_0x54361f(0x119)]},'before':null,'after':_0x52ab48[_0x54361f(0x125)],'dryRun':!![],'backend':{'method':_0x54361f(0x10e),'path':CREATE_PATH},'warnings':[],'verification':{'status':_0x54361f(0x125),'lookupCommand':_0x3b7064}},{'method':_0x54361f(0x10e),'url':CREATE_PATH});},async 'execute'(_0x57ebf1){const _0x1fcdfa=a135_0x1669e4,_0x18e8f6=await prepareCreate(_0x57ebf1),_0x5c9a69=notificationLookupCommand(_0x57ebf1['appCode'],_0x18e8f6[_0x1fcdfa(0x111)]['channelType']);let _0x1c5035;try{_0x1c5035=await createNotificationChannelConfig(_0x18e8f6[_0x1fcdfa(0x128)]);}catch(_0x3d93b4){if(isPlatformTransportFailure(_0x3d93b4))throw notificationError('notification_config_create_outcome_unknown',_0x1fcdfa(0x11c),_0x1fcdfa(0x12c)+_0x5c9a69+_0x1fcdfa(0x127));throw safeApiFailure(_0x1fcdfa(0x121),_0x1fcdfa(0x131),_0x1fcdfa(0x12c)+_0x5c9a69+_0x1fcdfa(0x11f));}if(!Number[_0x1fcdfa(0x129)](_0x1c5035)||_0x1c5035<=0x0)throw notificationError(_0x1fcdfa(0x12a),_0x1fcdfa(0x11b),_0x1fcdfa(0x12c)+_0x5c9a69+';\x20do\x20not\x20resubmit.');let _0x1f2f49;try{const _0x2f42ad=await getNotificationChannelConfig(_0x1c5035,_0x57ebf1['appCode']);_0x1f2f49=normalizeExactNotificationConfig(_0x2f42ad,_0x1c5035,_0x57ebf1[_0x1fcdfa(0x126)]);}catch{throw safeApiFailure('create',_0x1fcdfa(0x118),_0x1fcdfa(0x12c)+_0x5c9a69+';\x20do\x20not\x20resubmit\x20automatically.');}return{'ok':!![],'data':{'operation':'create','selector':{'appCode':_0x1f2f49[_0x1fcdfa(0x126)],'id':_0x1f2f49['id'],'configCode':_0x1f2f49[_0x1fcdfa(0x115)],'configName':_0x1f2f49['configName'],'channelType':_0x1f2f49['channelType']},'before':null,'after':projectNotificationConfig(_0x1f2f49),'dryRun':![],'backend':{'method':'POST','path':CREATE_PATH},'warnings':[],'verification':{'status':_0x1fcdfa(0x116),'lookupCommand':_0x5c9a69}},'message':'Created\x20notification\x20config\x20'+_0x1f2f49['id']};}};function a135_0x17f0(){const _0x486bc2=['Create\x20an\x20app-level\x20notification\x20config\x20from\x20a\x20secure\x20JSON\x20source','564wHYKPp','7843712FIiQQy','configCode','verified','41517gOyGju','verification','channelType','readTimeout','Notification\x20config\x20create\x20returned\x20no\x20usable\x20server\x20ID.','Notification\x20config\x20create\x20outcome\x20is\x20unknown\x20because\x20no\x20server\x20ID\x20was\x20received.','connectTimeout','2902180ZfVhmX',';\x20no\x20automatic\x20retry\x20was\x20attempted.','description','create','/notification/channel-config/create','configName','6ZprbQO','planned','appCode',';\x20do\x20not\x20resubmit.','input','isSafeInteger','notification_config_create_outcome_unknown','229413okQjDF','Inspect\x20with\x20','1922RSKRsm','60Yqqjge','config-create','notification','mutation','5330XyPKnf','POST','8793HHGJMz','10753347niUrOG','document'];a135_0x17f0=function(){return _0x486bc2;};return a135_0x17f0();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a136_0x2f72dc=a136_0x309a;(function(_0x243e94,_0x1b4bbc){const _0x3a08e5=a136_0x309a,_0x46b6db=_0x243e94();while(!![]){try{const _0x40bbe1=-parseInt(_0x3a08e5(0x11c))/0x1*(parseInt(_0x3a08e5(0x130))/0x2)+-parseInt(_0x3a08e5(0x121))/0x3+-parseInt(_0x3a08e5(0x133))/0x4*(parseInt(_0x3a08e5(0x122))/0x5)+-parseInt(_0x3a08e5(0x127))/0x6*(parseInt(_0x3a08e5(0x115))/0x7)+parseInt(_0x3a08e5(0x11b))/0x8+parseInt(_0x3a08e5(0x11f))/0x9+parseInt(_0x3a08e5(0x12c))/0xa;if(_0x40bbe1===_0x1b4bbc)break;else _0x46b6db['push'](_0x46b6db['shift']());}catch(_0xa90825){_0x46b6db['push'](_0x46b6db['shift']());}}}(a136_0x61d0,0x849fa));import{asDryRunResult}from'../../commands/common/dry-run.js';import{deleteNotificationChannelConfig,isPlatformTransportFailure,listNotificationChannelConfigs}from'../../core/api-client.js';import{notificationError,notificationLookupCommand,notificationSelector,NOTIFICATION_APP_FLAG,NOTIFICATION_ID_FLAG,projectNotificationConfig,readNotificationId,requireNotificationExplicitYes,requireExactNotificationConfig,safeApiFailure,validateNotificationDeleteReadback}from'../../commands/notification/shared.js';const DELETE_PATH=a136_0x2f72dc(0x117),REFERENCE_WARNING=a136_0x2f72dc(0x119);function a136_0x309a(_0x5d9cc3,_0x3211ab){_0x5d9cc3=_0x5d9cc3-0x114;const _0x61d037=a136_0x61d0();let _0x309a7b=_0x61d037[_0x5d9cc3];return _0x309a7b;}async function prepareDelete(_0x3f6407){const _0x7b8f8b=a136_0x2f72dc,_0xa4418=readNotificationId(_0x3f6407),_0x373373=await requireExactNotificationConfig(_0x3f6407['appCode'],_0xa4418,_0x7b8f8b(0x118));return{'id':_0xa4418,'before':_0x373373};}export const notificationConfigDelete={'service':a136_0x2f72dc(0x114),'command':a136_0x2f72dc(0x123),'description':a136_0x2f72dc(0x125),'risk':a136_0x2f72dc(0x12d),'requiresAppCode':!![],'structuredErrors':!![],'flags':[NOTIFICATION_ID_FLAG,NOTIFICATION_APP_FLAG],async 'validate'(_0xcb4be8){readNotificationId(_0xcb4be8),requireNotificationExplicitYes(_0xcb4be8);},async 'dryRun'(_0x2c7b8f){const _0x584519=a136_0x2f72dc,_0x3f02e1=await prepareDelete(_0x2c7b8f),_0x56682d=notificationLookupCommand(_0x2c7b8f[_0x584519(0x132)],_0x3f02e1[_0x584519(0x134)][_0x584519(0x128)]);return asDryRunResult({'operation':_0x584519(0x118),'selector':notificationSelector(_0x3f02e1[_0x584519(0x134)]),'before':projectNotificationConfig(_0x3f02e1[_0x584519(0x134)]),'after':null,'dryRun':!![],'backend':{'method':'POST','path':DELETE_PATH},'warnings':[REFERENCE_WARNING],'verification':{'status':_0x584519(0x116),'lookupCommand':_0x56682d}},{'method':_0x584519(0x135),'url':DELETE_PATH});},async 'execute'(_0x47d3dd){const _0x467358=a136_0x2f72dc;requireNotificationExplicitYes(_0x47d3dd);const _0x3cba0d=await prepareDelete(_0x47d3dd),_0x298b73=notificationLookupCommand(_0x47d3dd[_0x467358(0x132)],_0x3cba0d['before'][_0x467358(0x128)]);let _0x8fbcd7=![];try{await deleteNotificationChannelConfig(_0x3cba0d['id'],_0x47d3dd[_0x467358(0x132)]);}catch(_0x5b297e){if(!isPlatformTransportFailure(_0x5b297e))throw safeApiFailure('delete',_0x467358(0x120),_0x467358(0x11e)+_0x298b73+';\x20no\x20automatic\x20retry\x20was\x20attempted.');_0x8fbcd7=!![];}let _0x3c1fac;try{_0x3c1fac=await listNotificationChannelConfigs(_0x47d3dd[_0x467358(0x132)],_0x3cba0d[_0x467358(0x134)]['channelType']),validateNotificationDeleteReadback(_0x3c1fac,_0x47d3dd[_0x467358(0x132)],_0x3cba0d[_0x467358(0x134)]['channelType']);}catch{throw notificationError(_0x8fbcd7?'notification_config_delete_outcome_unknown':_0x467358(0x12a),_0x467358(0x129)+_0x3cba0d['id']+'\x20delete\x20could\x20not\x20be\x20verified.',_0x467358(0x11e)+_0x298b73+';\x20do\x20not\x20resubmit\x20automatically.');}if(_0x3c1fac['some'](_0x3c0f0a=>_0x3c0f0a['id']===_0x3cba0d['id']))throw notificationError(_0x8fbcd7?_0x467358(0x131):_0x467358(0x12b),_0x467358(0x129)+_0x3cba0d['id']+_0x467358(0x124),_0x467358(0x11e)+_0x298b73+_0x467358(0x11d));const _0x5a5e27=[REFERENCE_WARNING];return _0x8fbcd7&&_0x5a5e27[_0x467358(0x11a)](_0x467358(0x12e)),{'ok':!![],'data':{'operation':_0x467358(0x118),'selector':notificationSelector(_0x3cba0d[_0x467358(0x134)]),'before':projectNotificationConfig(_0x3cba0d[_0x467358(0x134)]),'after':null,'dryRun':![],'backend':{'method':'POST','path':DELETE_PATH},'warnings':_0x5a5e27,'verification':{'status':_0x467358(0x126),'absenceConfirmed':!![],'recoveredAfterUnknownResponse':_0x8fbcd7,'lookupCommand':_0x298b73}},'message':_0x467358(0x12f)+_0x3cba0d['id']};}};function a136_0x61d0(){const _0x4432f4=['unshift','6773872WRslQn','136AMlqpp',';\x20do\x20not\x20resubmit\x20automatically.','Inspect\x20with\x20','3602304ndEXmV','mutation','157899QisHlZ','680YkRlXU','config-delete','\x20remains\x20present\x20after\x20delete.','Delete\x20an\x20app-level\x20notification\x20config\x20after\x20exact\x20preflight','verified','312348gnxcRx','channelType','Notification\x20config\x20','notification_config_delete_verification_unavailable','notification_config_delete_verification_failed','5261010GyoIXg','high-risk-write','Delete\x20response\x20was\x20unavailable;\x20list\x20readback\x20proved\x20ID\x20absence\x20without\x20resubmitting.','Deleted\x20notification\x20config\x20','8408fBmCaO','notification_config_delete_outcome_unknown','appCode','11684urYBrs','before','POST','notification','28VBsArW','planned','/notification/channel-config/delete','delete','Deleting\x20this\x20app-level\x20config\x20may\x20make\x20dataset-level\x20channels\x20that\x20reference\x20it\x20unavailable;\x20dataset\x20references\x20were\x20not\x20verified\x20by\x20the\x20CLI.'];a136_0x61d0=function(){return _0x4432f4;};return a136_0x61d0();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a137_0x1dcde7=a137_0x3c66;(function(_0xe64fac,_0x521e57){const _0x1c9f9f=a137_0x3c66,_0x5d37cf=_0xe64fac();while(!![]){try{const _0x3f4a66=-parseInt(_0x1c9f9f(0x132))/0x1*(-parseInt(_0x1c9f9f(0x136))/0x2)+parseInt(_0x1c9f9f(0x140))/0x3+-parseInt(_0x1c9f9f(0x137))/0x4*(-parseInt(_0x1c9f9f(0x143))/0x5)+-parseInt(_0x1c9f9f(0x13c))/0x6+parseInt(_0x1c9f9f(0x133))/0x7+-parseInt(_0x1c9f9f(0x139))/0x8*(parseInt(_0x1c9f9f(0x144))/0x9)+parseInt(_0x1c9f9f(0x131))/0xa*(parseInt(_0x1c9f9f(0x141))/0xb);if(_0x3f4a66===_0x521e57)break;else _0x5d37cf['push'](_0x5d37cf['shift']());}catch(_0x2480d8){_0x5d37cf['push'](_0x5d37cf['shift']());}}}(a137_0x1db5,0x57e72));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a137_0x1db5(){const _0x1e6238=['467130JRcXuP','notification','appCode','read','16404UoZZrE','11ZVwcyb','Notification\x20channel\x20type','39665RrmsJT','4763214YPXlXl','type','string','481710KNFmvB','58217AEtgrQ','913192SohbGZ','Found\x20','map','16ckluOx','160JUJBrl','List\x20app-level\x20notification\x20configs\x20and\x20their\x20configCode\x20values','8gEZuJX','\x20notification\x20config(s)','length'];a137_0x1db5=function(){return _0x1e6238;};return a137_0x1db5();}import{listNotificationChannelConfigs}from'../../core/api-client.js';function a137_0x3c66(_0x5befbe,_0x1e25ea){_0x5befbe=_0x5befbe-0x131;const _0x1db5e7=a137_0x1db5();let _0x3c6623=_0x1db5e7[_0x5befbe];return _0x3c6623;}import{NOTIFICATION_CHANNEL_TYPES,projectNotificationListConfig,readNotificationChannelType}from'../../commands/notification/shared.js';export const notificationConfigList={'service':a137_0x1dcde7(0x13d),'command':'config-list','description':a137_0x1dcde7(0x138),'risk':a137_0x1dcde7(0x13f),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a137_0x1dcde7(0x145),'type':a137_0x1dcde7(0x146),'description':a137_0x1dcde7(0x142),'enum':NOTIFICATION_CHANNEL_TYPES,'default':'EMAIL'}],async 'validate'(_0x34262a){readNotificationChannelType(_0x34262a);},async 'execute'(_0x174177){const _0x2210f0=a137_0x1dcde7,_0x2e5491=readNotificationChannelType(_0x174177),_0xa5bc24=await listNotificationChannelConfigs(_0x174177['appCode'],_0x2e5491),_0x2ead0b=_0xa5bc24[_0x2210f0(0x135)](projectNotificationListConfig);return{'ok':!![],'data':{'appCode':_0x174177[_0x2210f0(0x13e)],'channelType':_0x2e5491,'count':_0x2ead0b[_0x2210f0(0x13b)],'configs':_0x2ead0b},'message':_0x2210f0(0x134)+_0x2ead0b[_0x2210f0(0x13b)]+'\x20'+_0x2e5491+_0x2210f0(0x13a)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a138_0x4dbb7d=a138_0xd755;(function(_0x194078,_0x5f473b){const _0x26017c=a138_0xd755,_0xca3249=_0x194078();while(!![]){try{const _0x563554=parseInt(_0x26017c(0x196))/0x1+parseInt(_0x26017c(0x19d))/0x2*(-parseInt(_0x26017c(0x18c))/0x3)+parseInt(_0x26017c(0x189))/0x4*(-parseInt(_0x26017c(0x18e))/0x5)+-parseInt(_0x26017c(0x198))/0x6*(parseInt(_0x26017c(0x194))/0x7)+-parseInt(_0x26017c(0x181))/0x8+-parseInt(_0x26017c(0x19e))/0x9*(-parseInt(_0x26017c(0x1a0))/0xa)+parseInt(_0x26017c(0x17c))/0xb*(parseInt(_0x26017c(0x187))/0xc);if(_0x563554===_0x5f473b)break;else _0xca3249['push'](_0xca3249['shift']());}catch(_0x5043f4){_0xca3249['push'](_0xca3249['shift']());}}}(a138_0x5e10,0xe0a24));function a138_0xd755(_0x74da52,_0x1f9ba3){_0x74da52=_0x74da52-0x17c;const _0x5e103a=a138_0x5e10();let _0xd75536=_0x5e103a[_0x74da52];return _0xd75536;}import{asDryRunResult}from'../../commands/common/dry-run.js';function a138_0x5e10(){const _0x2ea575=['planned','before','Inspect\x20with\x20--id\x20','Update\x20response\x20was\x20unavailable;\x20exact-ID\x20readback\x20proved\x20changed\x20safe\x20fields\x20without\x20resubmitting.','provesChange','8411221NKUdYw','/notification/channel-config/update','377306CiQeYZ','POST','6aKFAeH','verifiedFields','update','notification_config_update_verification_unavailable','\x20update\x20could\x20not\x20be\x20verified\x20by\x20exact\x20ID.','6058DwYhws','81lNlAiq','\x20with\x20','409320ODHMhn','11MCQNGk','channelType','verified','Updated\x20notification\x20config\x20','Notification\x20config\x20','6174280wTDBGr','config-update','payload','mutation','notification_config_update_outcome_unknown',';\x20no\x20automatic\x20retry\x20was\x20attempted.','47013276CIRLnG','notification_config_update_verification_failed','16PDbYGj','appCode','\x20via\x20','1281vGlBBi','patch','595745HfLIzF'];a138_0x5e10=function(){return _0x2ea575;};return a138_0x5e10();}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=a138_0x4dbb7d(0x195);async function prepareUpdate(_0x2797be){const _0x1b419d=a138_0x4dbb7d,_0x37d51b=readNotificationId(_0x2797be),_0x5044c7=await readNotificationDocument(_0x2797be,_0x1b419d(0x19a)),_0x852556=await requireExactNotificationConfig(_0x2797be[_0x1b419d(0x18a)],_0x37d51b,_0x1b419d(0x19a));return{'id':_0x37d51b,'patch':_0x5044c7,'before':_0x852556,'payload':mergeUpdateInput(_0x852556,_0x5044c7),'planned':plannedUpdateProjection(_0x852556,_0x5044c7)};}export const notificationConfigUpdate={'service':'notification','command':a138_0x4dbb7d(0x182),'description':'Update\x20an\x20app-level\x20notification\x20config\x20from\x20a\x20secure\x20JSON\x20patch','risk':'high-risk-write','requiresAppCode':!![],'structuredErrors':!![],'flags':[NOTIFICATION_ID_FLAG,...NOTIFICATION_INPUT_FLAGS,NOTIFICATION_APP_FLAG],async 'validate'(_0x2040b6){readNotificationId(_0x2040b6),assertSingleNotificationSource(_0x2040b6),requireNotificationExplicitYes(_0x2040b6);},async 'dryRun'(_0x5c75a5){const _0x492253=a138_0x4dbb7d,_0x3ed199=await prepareUpdate(_0x5c75a5),_0x19bfc6=notificationLookupCommand(_0x5c75a5[_0x492253(0x18a)],_0x3ed199[_0x492253(0x190)][_0x492253(0x17d)]);return asDryRunResult({'operation':_0x492253(0x19a),'selector':notificationSelector(_0x3ed199[_0x492253(0x190)]),'before':projectNotificationConfig(_0x3ed199[_0x492253(0x190)]),'after':_0x3ed199[_0x492253(0x18f)],'dryRun':!![],'backend':{'method':_0x492253(0x197),'path':UPDATE_PATH},'warnings':[],'verification':{'status':_0x492253(0x18f),'lookupCommand':_0x19bfc6}},{'method':_0x492253(0x197),'url':UPDATE_PATH});},async 'execute'(_0x1de868){const _0x19324e=a138_0x4dbb7d;requireNotificationExplicitYes(_0x1de868);const _0x4dcb95=await prepareUpdate(_0x1de868),_0x11ec26=notificationLookupCommand(_0x1de868[_0x19324e(0x18a)],_0x4dcb95[_0x19324e(0x190)][_0x19324e(0x17d)]);let _0x472084=![];try{await updateNotificationChannelConfig(_0x4dcb95[_0x19324e(0x183)]);}catch(_0x304faa){if(!isPlatformTransportFailure(_0x304faa))throw safeApiFailure(_0x19324e(0x19a),_0x19324e(0x184),'Inspect\x20ID\x20'+_0x4dcb95['id']+_0x19324e(0x19f)+_0x11ec26+_0x19324e(0x186));_0x472084=!![];}let _0x12e9ff;try{const _0x2d3b58=await getNotificationChannelConfig(_0x4dcb95['id'],_0x1de868[_0x19324e(0x18a)]);_0x12e9ff=normalizeExactNotificationConfig(_0x2d3b58,_0x4dcb95['id'],_0x1de868[_0x19324e(0x18a)]);}catch{throw notificationError(_0x472084?_0x19324e(0x185):_0x19324e(0x19b),_0x19324e(0x180)+_0x4dcb95['id']+_0x19324e(0x19c),_0x19324e(0x191)+_0x4dcb95['id']+_0x19324e(0x18b)+_0x11ec26+';\x20do\x20not\x20resubmit\x20automatically.');}const _0x3fee48=requestedSafeFieldsMatch(_0x4dcb95[_0x19324e(0x190)],_0x12e9ff,_0x4dcb95[_0x19324e(0x18d)]);if(!_0x3fee48['allMatch']||_0x472084&&!_0x3fee48[_0x19324e(0x193)])throw notificationError(_0x472084?_0x19324e(0x185):_0x19324e(0x188),'Notification\x20config\x20'+_0x4dcb95['id']+'\x20readback\x20does\x20not\x20prove\x20the\x20requested\x20update.',_0x19324e(0x191)+_0x4dcb95['id']+_0x19324e(0x18b)+_0x11ec26+';\x20do\x20not\x20resubmit\x20automatically.');const _0x2b4815=_0x472084?[_0x19324e(0x192)]:[];return{'ok':!![],'data':{'operation':_0x19324e(0x19a),'selector':notificationSelector(_0x12e9ff),'before':projectNotificationConfig(_0x4dcb95[_0x19324e(0x190)]),'after':projectNotificationConfig(_0x12e9ff),'dryRun':![],'backend':{'method':'POST','path':UPDATE_PATH},'warnings':_0x2b4815,'verification':{'status':_0x19324e(0x17e),'recoveredAfterUnknownResponse':_0x472084,'verifiedFields':_0x3fee48[_0x19324e(0x199)],'lookupCommand':_0x11ec26}},'message':_0x19324e(0x17f)+_0x12e9ff['id']};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x110db5,_0x403bd5){const _0x18cb88=a139_0x4ea1,_0x197d1e=_0x110db5();while(!![]){try{const _0x416371=parseInt(_0x18cb88(0x119))/0x1*(parseInt(_0x18cb88(0x11c))/0x2)+-parseInt(_0x18cb88(0x11e))/0x3*(-parseInt(_0x18cb88(0x115))/0x4)+-parseInt(_0x18cb88(0x120))/0x5*(parseInt(_0x18cb88(0x11b))/0x6)+parseInt(_0x18cb88(0x118))/0x7*(-parseInt(_0x18cb88(0x11f))/0x8)+-parseInt(_0x18cb88(0x117))/0x9*(-parseInt(_0x18cb88(0x11a))/0xa)+parseInt(_0x18cb88(0x11d))/0xb*(-parseInt(_0x18cb88(0x116))/0xc)+parseInt(_0x18cb88(0x114))/0xd;if(_0x416371===_0x403bd5)break;else _0x197d1e['push'](_0x197d1e['shift']());}catch(_0x50b790){_0x197d1e['push'](_0x197d1e['shift']());}}}(a139_0x5eb0,0xb593d));import{notificationConfigList}from'../../commands/notification/config-list.js';import{notificationConfigCreate}from'../../commands/notification/config-create.js';function a139_0x5eb0(){const _0x53de38=['43554qfAfiz','2gNTOaB','160193fMQjOu','3BNwjPe','2792eMwtcZ','485bxpRqY','22683804fhoWRm','962008nPEvbp','1212JPLkfS','9zoRDPV','12635urQRPh','220619mGZIlq','13426430nlEjft'];a139_0x5eb0=function(){return _0x53de38;};return a139_0x5eb0();}function a139_0x4ea1(_0x17545a,_0x42bd50){_0x17545a=_0x17545a-0x114;const _0x5eb03c=a139_0x5eb0();let _0x4ea1c0=_0x5eb03c[_0x17545a];return _0x4ea1c0;}import{notificationConfigUpdate}from'../../commands/notification/config-update.js';import{notificationConfigDelete}from'../../commands/notification/config-delete.js';export const notificationDefinitions=[notificationConfigList,notificationConfigCreate,notificationConfigUpdate,notificationConfigDelete];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a140_0x97c5c4=a140_0x1d43;(function(_0x3f678e,_0x312b56){const _0x116e50=a140_0x1d43,_0x2e2d7e=_0x3f678e();while(!![]){try{const _0xb94645=parseInt(_0x116e50(0x17b))/0x1*(parseInt(_0x116e50(0x1b8))/0x2)+parseInt(_0x116e50(0x1aa))/0x3+-parseInt(_0x116e50(0x1b0))/0x4*(parseInt(_0x116e50(0x18c))/0x5)+parseInt(_0x116e50(0x17d))/0x6+parseInt(_0x116e50(0x1e4))/0x7*(-parseInt(_0x116e50(0x1af))/0x8)+parseInt(_0x116e50(0x1f2))/0x9+-parseInt(_0x116e50(0x1a8))/0xa;if(_0xb94645===_0x312b56)break;else _0x2e2d7e['push'](_0x2e2d7e['shift']());}catch(_0x5d94ad){_0x2e2d7e['push'](_0x2e2d7e['shift']());}}}(a140_0x1da8,0x7bba2));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';function a140_0x1da8(){const _0x1c6eca=['Item\x20','num','isSafeInteger','1193330vEQTjb','\x22\x20cannot\x20exceed\x20','55068iWDJoQ','Read\x20the\x20notification\x20JSON\x20document\x20from\x20stdin','Notification\x20JSON\x20from\x20','kind','emailTargets','8kGGYtc','9600AsHtoB','notification_config_confirmation_required','stdin','FEISHU','Create\x20JSON\x20requires\x20field\x20','a\x20supported\x20string','createTime','This\x20notification\x20config\x20mutation\x20requires\x20explicit\x20--yes.','2KUnQOe','join','\x20is\x20invalid.','\x20has\x20an\x20invalid\x20appCode.','<redacted>','notification_config_field_forbidden','from-env','\x20has\x20an\x20unsupported\x20channelType.','apiError','\x20has\x20an\x20invalid\x20channelType.','path','\x20characters.','Run\x20the\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.','update','appCode','messageTemplate','a\x20JSON\x20object\x20or\x20null','Notification\x20config\x20list\x20item\x20','notification_config_field_invalid','\x22\x20must\x20be\x20a\x20non-empty\x20string.','rabetbase\x20notification\x20config-list\x20--appcode\x20','Notification\x20JSON\x20source\x20is\x20ambiguous.','notification_config_response_invalid','number','Notification\x20JSON\x20field\x20\x22','endpointUrlRaw','Application-level\x20notification\x20config\x20ID','utf8','env','channelConfig','connectTimeout','configCode','length','stringify','\x22\x20is\x20forbidden.','includes','fromName','subjectPrefix','entries','WECOM','\x22configName\x22.','Allowed\x20values:\x20','notification_config_json_invalid','\x22\x20must\x20be\x20','4627343QAIuEP','_unavailable','Read\x20the\x20notification\x20JSON\x20document\x20from\x20a\x20UTF-8\x20file','\x22\x20is\x20controlled\x20by\x20the\x20CLI\x20or\x20server\x20and\x20is\x20forbidden.','name','Inspect\x20with\x20rabetbase\x20notification\x20config-list\x20--appcode\x20','channelConfigRaw','channelType','\x20--format\x20compress','Invalid\x20notification\x20config\x20response.','Update\x20JSON\x20must\x20contain\x20at\x20least\x20one\x20allowed\x20field.','every','a\x20string\x20or\x20null','mutation','4926375aBnIGd','\x20--type\x20','ccList','\x20--type\x20<CHANNEL_TYPE>\x20--format\x20compress;\x20no\x20mutation\x20was\x20submitted.','\x20is\x20missing\x20required\x20field\x20\x22','setEncoding','bccList','string','validation','notification_config_id_invalid','object','--id\x20must\x20be\x20a\x20positive\x20safe\x20integer.','has','135829oxCbIb','DINGTALK','5745648PwniAu','keys','trim','type','hasOwnProperty','Invalid\x20--','notification_config_channel_field_forbidden','Unable\x20to\x20read\x20notification\x20JSON\x20from\x20','endpointUrl','updateTime','notification_config_','push','a\x20non-empty\x20string','configName','\x20has\x20an\x20invalid\x20id.','775WbDgxk','EMAIL','Notification\x20JSON\x20field\x20\x22channelType\x22\x20is\x20unsupported.','Notification\x20config\x20detail\x20did\x20not\x20contain\x20the\x20requested\x20ID\x20','bool','\x20has\x20invalid\x20field\x20\x22','failed','replyTo','create','readTimeout','notification_config_field_required','a\x20JSON\x20object','recipients','notification_config_source_unavailable','notification_config_field_unknown','environment\x20variable\x20','preflight','Use\x20exactly\x20one\x20of\x20--file\x20<path>,\x20--stdin,\x20or\x20--from-env\x20<NAME>.','file','Unknown\x20notification\x20JSON\x20field\x20\x22','description','some','\x20does\x20not\x20belong\x20to\x20the\x20resolved\x20app.','str','Notification\x20config\x20'];a140_0x1da8=function(){return _0x1c6eca;};return a140_0x1da8();}export const NOTIFICATION_CHANNEL_TYPES=[a140_0x97c5c4(0x18d),a140_0x97c5c4(0x1b3),a140_0x97c5c4(0x17c),a140_0x97c5c4(0x1df),'WEBHOOK'];export const DEFAULT_NOTIFICATION_CONNECT_TIMEOUT=0x1388;export const DEFAULT_NOTIFICATION_READ_TIMEOUT=0x2710;const ALLOWED_INPUT_FIELDS=new Set([a140_0x97c5c4(0x18a),a140_0x97c5c4(0x1eb),a140_0x97c5c4(0x185),'channelConfig',a140_0x97c5c4(0x1a0),a140_0x97c5c4(0x1d6),a140_0x97c5c4(0x195)]),FORBIDDEN_IDENTITY_FIELDS=new Set(['id',a140_0x97c5c4(0x1c6),a140_0x97c5c4(0x1d7),'channelCode']),EMAIL_RECIPIENT_FIELDS=new Set([a140_0x97c5c4(0x1ae),a140_0x97c5c4(0x198),a140_0x97c5c4(0x170),a140_0x97c5c4(0x174),a140_0x97c5c4(0x193),a140_0x97c5c4(0x1dd),a140_0x97c5c4(0x1dc),'to','cc']);export const NOTIFICATION_INPUT_FLAGS=[{'name':a140_0x97c5c4(0x19e),'type':a140_0x97c5c4(0x175),'required':![],'description':a140_0x97c5c4(0x1e6)},{'name':'stdin','type':'boolean','required':![],'default':![],'description':a140_0x97c5c4(0x1ab)},{'name':'from-env','type':a140_0x97c5c4(0x175),'required':![],'description':'Read\x20the\x20notification\x20JSON\x20document\x20from\x20a\x20named\x20environment\x20variable'}];export const NOTIFICATION_ID_FLAG={'name':'id','type':a140_0x97c5c4(0x1cf),'required':!![],'description':a140_0x97c5c4(0x1d2)};export const NOTIFICATION_APP_FLAG=APPCODE_FLAG_OPTIONAL;export function notificationError(_0x45b488,_0x345f8a,_0x41454a){return new CliError(_0x45b488,0x1,_0x345f8a,_0x41454a);}export function readNotificationId(_0x46addf){const _0x3220cf=a140_0x97c5c4,_0x3d801a=_0x46addf[_0x3220cf(0x1a6)]('id');if(!Number[_0x3220cf(0x1a7)](_0x3d801a)||_0x3d801a<=0x0)throw notificationError(_0x3220cf(0x177),_0x3220cf(0x179));return _0x3d801a;}export function requireNotificationExplicitYes(_0x26fc24){const _0x7864e7=a140_0x97c5c4;if(_0x26fc24[_0x7864e7(0x190)]('dry-run')||_0x26fc24['bool']('yes'))return;throw notificationError(_0x7864e7(0x1b1),_0x7864e7(0x1b7),_0x7864e7(0x1c4));}export function readNotificationChannelType(_0x5109d1,_0xebfd5f=a140_0x97c5c4(0x180),_0x3a5127=a140_0x97c5c4(0x18d)){const _0xee53ea=a140_0x97c5c4,_0x56b9a9=_0x5109d1[_0xee53ea(0x1a3)](_0xebfd5f)[_0xee53ea(0x17f)]()||_0x3a5127;if(!NOTIFICATION_CHANNEL_TYPES[_0xee53ea(0x1db)](_0x56b9a9))throw CliErrors[_0xee53ea(0x176)](_0xee53ea(0x182)+_0xebfd5f+':\x20'+_0x56b9a9,_0xee53ea(0x1e1)+NOTIFICATION_CHANNEL_TYPES[_0xee53ea(0x1b9)](',\x20')+'.');return _0x56b9a9;}export function assertSingleNotificationSource(_0xdfc05b){const _0x5d274b=a140_0x97c5c4,_0x4bf1e7=[],_0x3c6dd0=_0xdfc05b['str'](_0x5d274b(0x19e))[_0x5d274b(0x17f)]();if(_0x3c6dd0)_0x4bf1e7[_0x5d274b(0x188)]({'kind':_0x5d274b(0x19e),'path':_0x3c6dd0});if(_0xdfc05b[_0x5d274b(0x190)](_0x5d274b(0x1b2)))_0x4bf1e7[_0x5d274b(0x188)]({'kind':_0x5d274b(0x1b2)});const _0x4bc70e=_0xdfc05b[_0x5d274b(0x1a3)](_0x5d274b(0x1be))[_0x5d274b(0x17f)]();if(_0x4bc70e)_0x4bf1e7[_0x5d274b(0x188)]({'kind':'env','name':_0x4bc70e});if(_0x4bf1e7[_0x5d274b(0x1d8)]===0x0)throw CliErrors['validation']('Missing\x20notification\x20JSON\x20source.',_0x5d274b(0x19d));if(_0x4bf1e7['length']>0x1)throw CliErrors[_0x5d274b(0x176)](_0x5d274b(0x1cd),_0x5d274b(0x19d));return _0x4bf1e7[0x0];}export async function readNotificationDocument(_0x148c1e,_0x3f304a){const _0x3b138c=a140_0x97c5c4,_0x2733b3=assertSingleNotificationSource(_0x148c1e),_0x386aa1=_0x2733b3['kind']==='file'?'file\x20'+_0x2733b3['path']:_0x2733b3[_0x3b138c(0x1ad)]===_0x3b138c(0x1d4)?_0x3b138c(0x19b)+_0x2733b3['name']:_0x3b138c(0x1b2);let _0x5a9c58;try{if(_0x2733b3['kind']==='file')_0x5a9c58=await readFile(_0x2733b3[_0x3b138c(0x1c2)],_0x3b138c(0x1d3));else{if(_0x2733b3['kind']===_0x3b138c(0x1d4)){if(!(_0x2733b3[_0x3b138c(0x1e8)]in process.env))throw notificationError(_0x3b138c(0x199),'Notification\x20JSON\x20environment\x20variable\x20is\x20not\x20set:\x20'+_0x2733b3['name']);_0x5a9c58=process.env[_0x2733b3.name]??'';}else _0x5a9c58=await readStdin();}}catch(_0x373a10){if(_0x373a10 instanceof CliError)throw _0x373a10;throw notificationError('notification_config_source_unavailable',_0x3b138c(0x184)+_0x386aa1+'.');}let _0x8b6c8e;try{_0x8b6c8e=JSON['parse'](_0x5a9c58);}catch{throw notificationError(_0x3b138c(0x1e2),_0x3b138c(0x1ac)+_0x386aa1+_0x3b138c(0x1ba),'Provide\x20one\x20valid\x20JSON\x20object;\x20source\x20contents\x20are\x20not\x20included\x20in\x20errors.');}if(!isJsonObject(_0x8b6c8e))throw notificationError('notification_config_json_invalid','Notification\x20JSON\x20from\x20'+_0x386aa1+'\x20must\x20be\x20an\x20object.');return validateNotificationDocument(_0x8b6c8e,_0x3f304a);}export function projectNotificationListConfig(_0x24a95d,_0x50adcc){const _0x1d6360=a140_0x97c5c4;return{'id':typeof _0x24a95d['id']===_0x1d6360(0x1cf)?_0x24a95d['id']:null,'configCode':requireResponseString(_0x24a95d[_0x1d6360(0x1d7)],_0x1d6360(0x1d7),_0x50adcc),'configName':requireResponseString(_0x24a95d[_0x1d6360(0x18a)],_0x1d6360(0x18a),_0x50adcc),'channelType':requireResponseString(_0x24a95d[_0x1d6360(0x1eb)],'channelType',_0x50adcc),'description':normalizeNullableString(_0x24a95d['description']),'createTime':normalizeNullableString(_0x24a95d[_0x1d6360(0x1b6)]),'updateTime':normalizeNullableString(_0x24a95d[_0x1d6360(0x186)])};}export function normalizeExactNotificationConfig(_0x5f2d1c,_0x4cab6d,_0x1aa73d){const _0x423550=a140_0x97c5c4;if(!Number[_0x423550(0x1a7)](_0x5f2d1c['id'])||_0x5f2d1c['id']!==_0x4cab6d)throw notificationError(_0x423550(0x1ce),_0x423550(0x18f)+_0x4cab6d+'.');if(_0x5f2d1c[_0x423550(0x1c6)]!==_0x1aa73d)throw notificationError('notification_config_response_invalid',_0x423550(0x1a4)+_0x4cab6d+_0x423550(0x1a2));const _0x3d0b86=requireExactString(_0x5f2d1c[_0x423550(0x18a)],'configName',_0x4cab6d),_0x48dced=requireExactString(_0x5f2d1c[_0x423550(0x1d7)],_0x423550(0x1d7),_0x4cab6d),_0x202dd6=requireExactString(_0x5f2d1c[_0x423550(0x1eb)],_0x423550(0x1eb),_0x4cab6d);if(!NOTIFICATION_CHANNEL_TYPES[_0x423550(0x1db)](_0x202dd6))throw notificationError(_0x423550(0x1ce),_0x423550(0x1a4)+_0x4cab6d+_0x423550(0x1bf));const _0x165f05=responseNullableString(_0x5f2d1c['endpointUrl'],_0x423550(0x185),_0x4cab6d),_0x4e72b3=responseNullableString(_0x5f2d1c[_0x423550(0x1d5)],_0x423550(0x1d5),_0x4cab6d),_0x3977e0=responseNullableString(_0x5f2d1c['description'],_0x423550(0x1a0),_0x4cab6d),_0x6bbbd6=responseNullableTimeout(_0x5f2d1c['connectTimeout'],_0x423550(0x1d6),_0x4cab6d),_0x17ed0d=responseNullableTimeout(_0x5f2d1c[_0x423550(0x195)],'readTimeout',_0x4cab6d);return{'id':_0x4cab6d,'appCode':_0x1aa73d,'configCode':_0x48dced,'configName':_0x3d0b86,'channelType':_0x202dd6,'endpointUrl':redactSensitive(_0x165f05),'channelConfig':redactSensitive(_0x4e72b3),'description':_0x3977e0,'connectTimeout':_0x6bbbd6,'readTimeout':_0x17ed0d,'endpointUrlRaw':_0x165f05,'channelConfigRaw':_0x4e72b3};}export async function requireExactNotificationConfig(_0x618cfc,_0x532b10,_0x582e99){const _0x558717=a140_0x97c5c4;let _0x1cbb2b;try{_0x1cbb2b=await getNotificationChannelConfig(_0x532b10,_0x618cfc);}catch{throw safeApiFailure(_0x582e99,_0x558717(0x19c),_0x558717(0x1e9)+_0x618cfc+_0x558717(0x171));}return normalizeExactNotificationConfig(_0x1cbb2b,_0x532b10,_0x618cfc);}export function projectNotificationConfig(_0x2a4f13){const _0x309753=a140_0x97c5c4;return{'id':_0x2a4f13['id']??null,'appCode':_0x2a4f13['appCode'],'configCode':_0x2a4f13['configCode']??null,'configName':_0x2a4f13['configName'],'channelType':_0x2a4f13[_0x309753(0x1eb)],'endpointUrl':redactSensitive(_0x2a4f13['endpointUrl']),'channelConfig':redactSensitive(_0x2a4f13[_0x309753(0x1d5)]),'description':_0x2a4f13[_0x309753(0x1a0)]??null,'connectTimeout':_0x2a4f13[_0x309753(0x1d6)]??null,'readTimeout':_0x2a4f13[_0x309753(0x195)]??null};}export function notificationSelector(_0x535ead){const _0x4f7eae=a140_0x97c5c4;return{'appCode':_0x535ead[_0x4f7eae(0x1c6)],'id':_0x535ead['id'],'configCode':_0x535ead[_0x4f7eae(0x1d7)],'configName':_0x535ead['configName'],'channelType':_0x535ead[_0x4f7eae(0x1eb)]};}export function createMutationInput(_0x11e6b3,_0xf8852d){const _0x47e085=a140_0x97c5c4;return{'appCode':_0x11e6b3,'configName':_0xf8852d[_0x47e085(0x18a)],'channelType':_0xf8852d[_0x47e085(0x1eb)],...hasOwn(_0xf8852d,_0x47e085(0x185))?{'endpointUrl':_0xf8852d[_0x47e085(0x185)]}:{},...hasOwn(_0xf8852d,_0x47e085(0x1d5))?{'channelConfig':serializeChannelConfig(_0xf8852d[_0x47e085(0x1d5)])}:{},...hasOwn(_0xf8852d,'description')?{'description':_0xf8852d[_0x47e085(0x1a0)]}:{},...hasOwn(_0xf8852d,_0x47e085(0x1d6))?{'connectTimeout':_0xf8852d['connectTimeout']}:{},...hasOwn(_0xf8852d,_0x47e085(0x195))?{'readTimeout':_0xf8852d[_0x47e085(0x195)]}:{}};}export function mergeUpdateInput(_0x67c6fc,_0x3d7bcf){const _0x4118aa=a140_0x97c5c4;return{'id':_0x67c6fc['id'],'appCode':_0x67c6fc[_0x4118aa(0x1c6)],'configName':_0x3d7bcf[_0x4118aa(0x18a)]??_0x67c6fc[_0x4118aa(0x18a)],'channelType':_0x3d7bcf[_0x4118aa(0x1eb)]??_0x67c6fc[_0x4118aa(0x1eb)],'endpointUrl':hasOwn(_0x3d7bcf,_0x4118aa(0x185))?_0x3d7bcf[_0x4118aa(0x185)]:_0x67c6fc[_0x4118aa(0x1d1)],'channelConfig':hasOwn(_0x3d7bcf,'channelConfig')?serializeChannelConfig(_0x3d7bcf[_0x4118aa(0x1d5)]):_0x67c6fc[_0x4118aa(0x1ea)],'description':hasOwn(_0x3d7bcf,_0x4118aa(0x1a0))?_0x3d7bcf['description']:_0x67c6fc[_0x4118aa(0x1a0)],'connectTimeout':hasOwn(_0x3d7bcf,'connectTimeout')?_0x3d7bcf[_0x4118aa(0x1d6)]:_0x67c6fc['connectTimeout'],'readTimeout':hasOwn(_0x3d7bcf,_0x4118aa(0x195))?_0x3d7bcf[_0x4118aa(0x195)]:_0x67c6fc[_0x4118aa(0x195)]};}export function plannedUpdateProjection(_0x32a46d,_0x221b78){const _0x4b3d20=a140_0x97c5c4;return projectNotificationConfig({'id':_0x32a46d['id'],'appCode':_0x32a46d[_0x4b3d20(0x1c6)],'configCode':_0x32a46d[_0x4b3d20(0x1d7)],'configName':_0x221b78[_0x4b3d20(0x18a)]??_0x32a46d[_0x4b3d20(0x18a)],'channelType':_0x221b78[_0x4b3d20(0x1eb)]??_0x32a46d[_0x4b3d20(0x1eb)],'endpointUrl':hasOwn(_0x221b78,_0x4b3d20(0x185))?_0x221b78['endpointUrl']:_0x32a46d[_0x4b3d20(0x1d1)],'channelConfig':hasOwn(_0x221b78,_0x4b3d20(0x1d5))?_0x221b78[_0x4b3d20(0x1d5)]:_0x32a46d[_0x4b3d20(0x1ea)],'description':hasOwn(_0x221b78,_0x4b3d20(0x1a0))?_0x221b78['description']:_0x32a46d[_0x4b3d20(0x1a0)],'connectTimeout':hasOwn(_0x221b78,'connectTimeout')?_0x221b78[_0x4b3d20(0x1d6)]??DEFAULT_NOTIFICATION_CONNECT_TIMEOUT:_0x32a46d[_0x4b3d20(0x1d6)],'readTimeout':hasOwn(_0x221b78,_0x4b3d20(0x195))?_0x221b78[_0x4b3d20(0x195)]??DEFAULT_NOTIFICATION_READ_TIMEOUT:_0x32a46d[_0x4b3d20(0x195)]});}export function requestedSafeFieldsMatch(_0x3da3e7,_0x3cdc04,_0x230207){const _0x3b33ff=a140_0x97c5c4,_0x391313=[],_0x197f70=[],_0xb577cf=[];for(const _0x1809a5 of['configName',_0x3b33ff(0x1eb),_0x3b33ff(0x1a0)]){if(!hasOwn(_0x230207,_0x1809a5))continue;_0xb577cf[_0x3b33ff(0x188)](_0x1809a5),_0x391313[_0x3b33ff(0x188)](_0x3cdc04[_0x1809a5]===_0x230207[_0x1809a5]),_0x197f70['push'](_0x3da3e7[_0x1809a5]!==_0x230207[_0x1809a5]&&_0x3cdc04[_0x1809a5]===_0x230207[_0x1809a5]);}for(const _0x1236f2 of[_0x3b33ff(0x1d6),_0x3b33ff(0x195)]){if(!hasOwn(_0x230207,_0x1236f2))continue;const _0x1d0fc1=_0x230207[_0x1236f2]??(_0x1236f2==='connectTimeout'?DEFAULT_NOTIFICATION_CONNECT_TIMEOUT:DEFAULT_NOTIFICATION_READ_TIMEOUT);_0xb577cf[_0x3b33ff(0x188)](_0x1236f2),_0x391313['push'](_0x3cdc04[_0x1236f2]===_0x1d0fc1),_0x197f70[_0x3b33ff(0x188)](_0x3da3e7[_0x1236f2]!==_0x1d0fc1&&_0x3cdc04[_0x1236f2]===_0x1d0fc1);}return hasOwn(_0x230207,_0x3b33ff(0x185))&&_0x230207[_0x3b33ff(0x185)]===null&&(_0xb577cf['push']('endpointUrl:null'),_0x391313[_0x3b33ff(0x188)](_0x3cdc04[_0x3b33ff(0x1d1)]===null||_0x3cdc04[_0x3b33ff(0x1d1)]===''),_0x197f70[_0x3b33ff(0x188)](_0x3da3e7['endpointUrlRaw']!==null&&_0x3da3e7[_0x3b33ff(0x1d1)]!==''&&(_0x3cdc04[_0x3b33ff(0x1d1)]===null||_0x3cdc04[_0x3b33ff(0x1d1)]===''))),{'allMatch':_0x391313[_0x3b33ff(0x1ef)](Boolean),'provesChange':_0x197f70[_0x3b33ff(0x1a1)](Boolean),'verifiedFields':_0xb577cf};}export function validateNotificationDeleteReadback(_0x4129ee,_0x25e7bd,_0x42f27f){const _0x1e35de=a140_0x97c5c4;for(const [_0xfabced,_0xc8c543]of _0x4129ee[_0x1e35de(0x1de)]()){if(!Number[_0x1e35de(0x1a7)](_0xc8c543['id'])||_0xc8c543['id']<=0x0)throw notificationError(_0x1e35de(0x1ce),_0x1e35de(0x1c9)+(_0xfabced+0x1)+_0x1e35de(0x18b));if(_0xc8c543[_0x1e35de(0x1c6)]!==_0x25e7bd)throw notificationError(_0x1e35de(0x1ce),_0x1e35de(0x1c9)+(_0xfabced+0x1)+_0x1e35de(0x1bb));if(_0xc8c543['channelType']!==_0x42f27f)throw notificationError('notification_config_response_invalid',_0x1e35de(0x1c9)+(_0xfabced+0x1)+_0x1e35de(0x1c1));}}export function safeApiFailure(_0x28cc11,_0x51b3d7,_0x17dc7f){const _0x447f52=a140_0x97c5c4;return notificationError(_0x447f52(0x187)+_0x28cc11+'_'+(_0x51b3d7===_0x447f52(0x1f1)?_0x447f52(0x192):_0x51b3d7+_0x447f52(0x1e5)),_0x447f52(0x1a4)+_0x28cc11+'\x20'+_0x51b3d7+'\x20failed.',_0x17dc7f);}export function notificationLookupCommand(_0x3e5f62,_0x16088d){const _0x145141=a140_0x97c5c4;return _0x145141(0x1cc)+_0x3e5f62+_0x145141(0x16f)+_0x16088d+_0x145141(0x1ec);}function validateNotificationDocument(_0x1d62d1,_0x43f214){const _0x406ccd=a140_0x97c5c4;for(const _0x1daf25 of Object[_0x406ccd(0x17e)](_0x1d62d1)){if(FORBIDDEN_IDENTITY_FIELDS[_0x406ccd(0x17a)](_0x1daf25))throw notificationError(_0x406ccd(0x1bd),'Notification\x20JSON\x20field\x20\x22'+_0x1daf25+_0x406ccd(0x1e7));if(!ALLOWED_INPUT_FIELDS['has'](_0x1daf25))throw notificationError(_0x406ccd(0x19a),_0x406ccd(0x19f)+_0x1daf25+'\x22.');}if(_0x43f214===_0x406ccd(0x1c5)&&Object[_0x406ccd(0x17e)](_0x1d62d1)[_0x406ccd(0x1d8)]===0x0)throw notificationError('notification_config_update_empty',_0x406ccd(0x1ee));const _0x2e8e75={};if(hasOwn(_0x1d62d1,_0x406ccd(0x18a)))_0x2e8e75[_0x406ccd(0x18a)]=validateRequiredString(_0x1d62d1['configName'],_0x406ccd(0x18a),0x80);else{if(_0x43f214===_0x406ccd(0x194))throw notificationError(_0x406ccd(0x196),_0x406ccd(0x1b4)+_0x406ccd(0x1e0));}if(hasOwn(_0x1d62d1,_0x406ccd(0x1eb))){if(typeof _0x1d62d1['channelType']!==_0x406ccd(0x175))throw invalidFieldType('channelType',_0x406ccd(0x1b5));const _0x5c4dba=_0x1d62d1[_0x406ccd(0x1eb)]['trim']();if(!NOTIFICATION_CHANNEL_TYPES[_0x406ccd(0x1db)](_0x5c4dba))throw notificationError(_0x406ccd(0x1ca),_0x406ccd(0x18e),_0x406ccd(0x1e1)+NOTIFICATION_CHANNEL_TYPES['join'](',\x20')+'.');_0x2e8e75['channelType']=_0x5c4dba;}else{if(_0x43f214===_0x406ccd(0x194))throw notificationError(_0x406ccd(0x196),'Create\x20JSON\x20requires\x20field\x20'+'\x22channelType\x22.');}for(const [_0x2a0299,_0x1d4239]of[[_0x406ccd(0x185),0x200],[_0x406ccd(0x1a0),0x100]]){if(!hasOwn(_0x1d62d1,_0x2a0299))continue;const _0x2f56f1=_0x1d62d1[_0x2a0299];if(_0x2f56f1!==null&&typeof _0x2f56f1!==_0x406ccd(0x175))throw invalidFieldType(_0x2a0299,_0x406ccd(0x1f0));if(typeof _0x2f56f1===_0x406ccd(0x175)&&_0x2f56f1[_0x406ccd(0x1d8)]>_0x1d4239)throw notificationError(_0x406ccd(0x1ca),_0x406ccd(0x1d0)+_0x2a0299+_0x406ccd(0x1a9)+_0x1d4239+_0x406ccd(0x1c3));_0x2e8e75[_0x2a0299]=_0x2f56f1;}if(hasOwn(_0x1d62d1,_0x406ccd(0x1d5))){const _0x1e93c5=_0x1d62d1[_0x406ccd(0x1d5)];if(_0x1e93c5===null&&_0x43f214===_0x406ccd(0x194))throw invalidFieldType('channelConfig',_0x406ccd(0x197));if(_0x1e93c5!==null&&!isJsonObject(_0x1e93c5))throw invalidFieldType(_0x406ccd(0x1d5),_0x43f214===_0x406ccd(0x1c5)?_0x406ccd(0x1c8):_0x406ccd(0x197));_0x1e93c5!==null&&validateChannelConfigFields(_0x2e8e75['channelType'],_0x1e93c5),_0x2e8e75['channelConfig']=_0x1e93c5;}for(const _0x3be00b of['connectTimeout',_0x406ccd(0x195)]){if(!hasOwn(_0x1d62d1,_0x3be00b))continue;const _0x54e020=_0x1d62d1[_0x3be00b];if(_0x54e020!==null&&(!Number[_0x406ccd(0x1a7)](_0x54e020)||_0x54e020<0x0))throw notificationError('notification_config_field_invalid',_0x406ccd(0x1d0)+_0x3be00b+'\x22\x20must\x20be\x20a\x20non-negative\x20safe\x20integer\x20or\x20null.');_0x2e8e75[_0x3be00b]=_0x54e020;}return _0x2e8e75;}function validateRequiredString(_0x303e61,_0x3de79f,_0x278e37){const _0x2bef9a=a140_0x97c5c4;if(typeof _0x303e61!==_0x2bef9a(0x175))throw invalidFieldType(_0x3de79f,_0x2bef9a(0x189));const _0x49c2a3=_0x303e61[_0x2bef9a(0x17f)]();if(!_0x49c2a3)throw notificationError(_0x2bef9a(0x1ca),_0x2bef9a(0x1d0)+_0x3de79f+_0x2bef9a(0x1cb));if(_0x49c2a3[_0x2bef9a(0x1d8)]>_0x278e37)throw notificationError(_0x2bef9a(0x1ca),'Notification\x20JSON\x20field\x20\x22'+_0x3de79f+'\x22\x20cannot\x20exceed\x20'+_0x278e37+'\x20characters.');return _0x49c2a3;}function validateChannelConfigFields(_0x2e7521,_0x2e277f){const _0x3de844=a140_0x97c5c4;if(hasOwn(_0x2e277f,'messageTemplate'))throw forbiddenChannelConfigField(_0x3de844(0x1c7));if(_0x2e7521===_0x3de844(0x18d))for(const _0x2b3f4c of EMAIL_RECIPIENT_FIELDS){if(hasOwn(_0x2e277f,_0x2b3f4c))throw forbiddenChannelConfigField(_0x2b3f4c);}}function forbiddenChannelConfigField(_0x48a26f){const _0x4a20dc=a140_0x97c5c4;return notificationError(_0x4a20dc(0x183),'Notification\x20JSON\x20channelConfig\x20field\x20\x22'+_0x48a26f+_0x4a20dc(0x1da));}function invalidFieldType(_0x2ee9b9,_0x2468cb){const _0x4f92cd=a140_0x97c5c4;return notificationError(_0x4f92cd(0x1ca),_0x4f92cd(0x1d0)+_0x2ee9b9+_0x4f92cd(0x1e3)+_0x2468cb+'.');}function serializeChannelConfig(_0x1b08c8){const _0x2672c3=a140_0x97c5c4;return _0x1b08c8===null||_0x1b08c8===undefined?null:JSON[_0x2672c3(0x1d9)](_0x1b08c8);}function redactSensitive(_0x3b746e){const _0x304b31=a140_0x97c5c4;return _0x3b746e===null||_0x3b746e===undefined||_0x3b746e===''?null:_0x304b31(0x1bc);}function requireResponseString(_0x474391,_0x468a9d,_0x50e21f){const _0x11e498=a140_0x97c5c4;if(typeof _0x474391!==_0x11e498(0x175)||_0x474391[_0x11e498(0x17f)]()==='')throw CliErrors[_0x11e498(0x1c0)](_0x11e498(0x1ed),_0x11e498(0x1a5)+(_0x50e21f+0x1)+_0x11e498(0x172)+_0x468a9d+'\x22.');return _0x474391[_0x11e498(0x17f)]();}function requireExactString(_0x30c3b5,_0x481c6c,_0x2cdac2){const _0x43cac8=a140_0x97c5c4;if(typeof _0x30c3b5!=='string'||_0x30c3b5[_0x43cac8(0x17f)]()==='')throw notificationError(_0x43cac8(0x1ce),_0x43cac8(0x1a4)+_0x2cdac2+_0x43cac8(0x172)+_0x481c6c+'\x22.');return _0x30c3b5[_0x43cac8(0x17f)]();}function responseNullableString(_0x238471,_0x49130e,_0x1736eb){const _0x35b4fa=a140_0x97c5c4;if(_0x238471===undefined||_0x238471===null)return null;if(typeof _0x238471!==_0x35b4fa(0x175))throw notificationError('notification_config_response_invalid',_0x35b4fa(0x1a4)+_0x1736eb+_0x35b4fa(0x191)+_0x49130e+'\x22.');return _0x238471;}function a140_0x1d43(_0x425794,_0x5b4f19){_0x425794=_0x425794-0x16f;const _0x1da8d1=a140_0x1da8();let _0x1d439f=_0x1da8d1[_0x425794];return _0x1d439f;}function responseNullableTimeout(_0x3f65c0,_0x52a718,_0x5d3b04){const _0x2a1855=a140_0x97c5c4;if(_0x3f65c0===undefined||_0x3f65c0===null)return null;if(!Number[_0x2a1855(0x1a7)](_0x3f65c0)||_0x3f65c0<0x0)throw notificationError(_0x2a1855(0x1ce),_0x2a1855(0x1a4)+_0x5d3b04+'\x20has\x20invalid\x20field\x20\x22'+_0x52a718+'\x22.');return _0x3f65c0;}function normalizeNullableString(_0xe7f2cb){return typeof _0xe7f2cb==='string'?_0xe7f2cb:null;}function isJsonObject(_0x2f3f9b){const _0x1f90af=a140_0x97c5c4;return _0x2f3f9b!==null&&typeof _0x2f3f9b===_0x1f90af(0x178)&&!Array['isArray'](_0x2f3f9b);}function hasOwn(_0xfdcf91,_0x4e7ec8){const _0x206f6e=a140_0x97c5c4;return Object['prototype'][_0x206f6e(0x181)]['call'](_0xfdcf91,_0x4e7ec8);}async function readStdin(){const _0x160d3f=a140_0x97c5c4;let _0x2a590c='';process[_0x160d3f(0x1b2)][_0x160d3f(0x173)](_0x160d3f(0x1d3));for await(const _0x44a84a of process[_0x160d3f(0x1b2)])_0x2a590c+=_0x44a84a;return _0x2a590c;}
|
|
1
|
+
const a140_0x3c8ca0=a140_0x19a2;(function(_0x541fed,_0x200543){const _0x57b74e=a140_0x19a2,_0x394e58=_0x541fed();while(!![]){try{const _0x25c89c=parseInt(_0x57b74e(0x1bb))/0x1+-parseInt(_0x57b74e(0x1fe))/0x2+parseInt(_0x57b74e(0x1e1))/0x3+parseInt(_0x57b74e(0x1d6))/0x4+parseInt(_0x57b74e(0x21e))/0x5*(-parseInt(_0x57b74e(0x21c))/0x6)+-parseInt(_0x57b74e(0x1c6))/0x7*(-parseInt(_0x57b74e(0x1f4))/0x8)+-parseInt(_0x57b74e(0x1ca))/0x9;if(_0x25c89c===_0x200543)break;else _0x394e58['push'](_0x394e58['shift']());}catch(_0x1edd55){_0x394e58['push'](_0x394e58['shift']());}}}(a140_0x2f32,0xdade0));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=['EMAIL','FEISHU',a140_0x3c8ca0(0x1be),'WECOM',a140_0x3c8ca0(0x1b3)];export const DEFAULT_NOTIFICATION_CONNECT_TIMEOUT=0x1388;export const DEFAULT_NOTIFICATION_READ_TIMEOUT=0x2710;const ALLOWED_INPUT_FIELDS=new Set(['configName',a140_0x3c8ca0(0x222),a140_0x3c8ca0(0x1ac),'channelConfig',a140_0x3c8ca0(0x1cd),a140_0x3c8ca0(0x21d),'readTimeout']),FORBIDDEN_IDENTITY_FIELDS=new Set(['id',a140_0x3c8ca0(0x214),a140_0x3c8ca0(0x1ef),a140_0x3c8ca0(0x1cf)]),EMAIL_RECIPIENT_FIELDS=new Set([a140_0x3c8ca0(0x1d1),'recipients','ccList','bccList',a140_0x3c8ca0(0x1f2),a140_0x3c8ca0(0x207),'fromName','to','cc']);export const NOTIFICATION_INPUT_FLAGS=[{'name':a140_0x3c8ca0(0x1de),'type':a140_0x3c8ca0(0x1cb),'required':![],'description':a140_0x3c8ca0(0x1f8)},{'name':a140_0x3c8ca0(0x21b),'type':'boolean','required':![],'default':![],'description':a140_0x3c8ca0(0x1e9)},{'name':a140_0x3c8ca0(0x1b8),'type':a140_0x3c8ca0(0x1cb),'required':![],'description':a140_0x3c8ca0(0x1ae)}];export const NOTIFICATION_ID_FLAG={'name':'id','type':a140_0x3c8ca0(0x1d5),'required':!![],'description':a140_0x3c8ca0(0x1f5)};export const NOTIFICATION_APP_FLAG=APPCODE_FLAG_OPTIONAL;export function notificationError(_0x317879,_0x3f6ab1,_0x1a19b9){return new CliError(_0x317879,0x1,_0x3f6ab1,_0x1a19b9);}export function readNotificationId(_0x2cb583){const _0x58a029=a140_0x3c8ca0,_0x491c41=_0x2cb583[_0x58a029(0x20f)]('id');if(!Number['isSafeInteger'](_0x491c41)||_0x491c41<=0x0)throw notificationError(_0x58a029(0x1f6),_0x58a029(0x204));return _0x491c41;}export function requireNotificationExplicitYes(_0x41b6fc){const _0x169be6=a140_0x3c8ca0;if(_0x41b6fc['bool'](_0x169be6(0x211))||_0x41b6fc['bool'](_0x169be6(0x20a)))return;throw notificationError(_0x169be6(0x1f7),_0x169be6(0x1c3),_0x169be6(0x1eb));}export function readNotificationChannelType(_0x2a2485,_0x35dd0f='type',_0x10678a=a140_0x3c8ca0(0x1ea)){const _0x9b4c0a=a140_0x3c8ca0,_0x2eec5b=_0x2a2485[_0x9b4c0a(0x1e7)](_0x35dd0f)[_0x9b4c0a(0x1c8)]()||_0x10678a;if(!NOTIFICATION_CHANNEL_TYPES[_0x9b4c0a(0x200)](_0x2eec5b))throw CliErrors['validation'](_0x9b4c0a(0x1fd)+_0x35dd0f+':\x20'+_0x2eec5b,_0x9b4c0a(0x1bf)+NOTIFICATION_CHANNEL_TYPES['join'](',\x20')+'.');return _0x2eec5b;}export function assertSingleNotificationSource(_0x1c0661){const _0x2c5be2=a140_0x3c8ca0,_0x35218e=[],_0x4a0ed9=_0x1c0661[_0x2c5be2(0x1e7)](_0x2c5be2(0x1de))[_0x2c5be2(0x1c8)]();if(_0x4a0ed9)_0x35218e[_0x2c5be2(0x1bd)]({'kind':_0x2c5be2(0x1de),'path':_0x4a0ed9});if(_0x1c0661[_0x2c5be2(0x215)](_0x2c5be2(0x21b)))_0x35218e[_0x2c5be2(0x1bd)]({'kind':_0x2c5be2(0x21b)});const _0x27778c=_0x1c0661['str'](_0x2c5be2(0x1b8))[_0x2c5be2(0x1c8)]();if(_0x27778c)_0x35218e['push']({'kind':_0x2c5be2(0x1b5),'name':_0x27778c});if(_0x35218e['length']===0x0)throw CliErrors[_0x2c5be2(0x1c5)](_0x2c5be2(0x1b7),'Use\x20exactly\x20one\x20of\x20--file\x20<path>,\x20--stdin,\x20or\x20--from-env\x20<NAME>.');if(_0x35218e[_0x2c5be2(0x202)]>0x1)throw CliErrors[_0x2c5be2(0x1c5)]('Notification\x20JSON\x20source\x20is\x20ambiguous.','Use\x20exactly\x20one\x20of\x20--file\x20<path>,\x20--stdin,\x20or\x20--from-env\x20<NAME>.');return _0x35218e[0x0];}export async function readNotificationDocument(_0x1275ad,_0x456b56){const _0x19d70d=a140_0x3c8ca0,_0x177952=assertSingleNotificationSource(_0x1275ad),_0x23b8bb=_0x177952[_0x19d70d(0x1d9)]===_0x19d70d(0x1de)?_0x19d70d(0x1e4)+_0x177952[_0x19d70d(0x1ab)]:_0x177952[_0x19d70d(0x1d9)]===_0x19d70d(0x1b5)?_0x19d70d(0x1f3)+_0x177952[_0x19d70d(0x1ba)]:_0x19d70d(0x21b);let _0x53d85d;try{if(_0x177952[_0x19d70d(0x1d9)]===_0x19d70d(0x1de))_0x53d85d=await readFile(_0x177952[_0x19d70d(0x1ab)],'utf8');else{if(_0x177952[_0x19d70d(0x1d9)]===_0x19d70d(0x1b5)){if(!(_0x177952[_0x19d70d(0x1ba)]in process.env))throw notificationError(_0x19d70d(0x220),_0x19d70d(0x1d0)+_0x177952[_0x19d70d(0x1ba)]);_0x53d85d=process.env[_0x177952.name]??'';}else _0x53d85d=await readStdin();}}catch(_0x27320d){if(_0x27320d instanceof CliError)throw _0x27320d;throw notificationError('notification_config_source_unavailable',_0x19d70d(0x1b6)+_0x23b8bb+'.');}let _0x2db8d8;try{_0x2db8d8=JSON['parse'](_0x53d85d);}catch{throw notificationError(_0x19d70d(0x223),_0x19d70d(0x1af)+_0x23b8bb+_0x19d70d(0x203),_0x19d70d(0x1b1));}if(!isJsonObject(_0x2db8d8))throw notificationError(_0x19d70d(0x223),_0x19d70d(0x1af)+_0x23b8bb+_0x19d70d(0x1a7));return validateNotificationDocument(_0x2db8d8,_0x456b56);}export function projectNotificationListConfig(_0x58033a,_0xa05cea){const _0x495b9b=a140_0x3c8ca0;return{'id':typeof _0x58033a['id']===_0x495b9b(0x1d5)?_0x58033a['id']:null,'configCode':requireResponseString(_0x58033a['configCode'],_0x495b9b(0x1ef),_0xa05cea),'configName':requireResponseString(_0x58033a[_0x495b9b(0x1c0)],_0x495b9b(0x1c0),_0xa05cea),'channelType':requireResponseString(_0x58033a[_0x495b9b(0x222)],'channelType',_0xa05cea),'description':normalizeNullableString(_0x58033a[_0x495b9b(0x1cd)]),'createTime':normalizeNullableString(_0x58033a['createTime']),'updateTime':normalizeNullableString(_0x58033a[_0x495b9b(0x1bc)])};}export function normalizeExactNotificationConfig(_0x3edae5,_0x40fa3d,_0x2beee4){const _0x1e6a2c=a140_0x3c8ca0;if(!Number[_0x1e6a2c(0x1d8)](_0x3edae5['id'])||_0x3edae5['id']!==_0x40fa3d)throw notificationError('notification_config_response_invalid','Notification\x20config\x20detail\x20did\x20not\x20contain\x20the\x20requested\x20ID\x20'+_0x40fa3d+'.');if(_0x3edae5[_0x1e6a2c(0x214)]!==_0x2beee4)throw notificationError(_0x1e6a2c(0x20d),_0x1e6a2c(0x1e5)+_0x40fa3d+'\x20does\x20not\x20belong\x20to\x20the\x20resolved\x20app.');const _0x579e41=requireExactString(_0x3edae5['configName'],_0x1e6a2c(0x1c0),_0x40fa3d),_0x5f4f5f=requireExactString(_0x3edae5[_0x1e6a2c(0x1ef)],_0x1e6a2c(0x1ef),_0x40fa3d),_0x17798c=requireExactString(_0x3edae5[_0x1e6a2c(0x222)],_0x1e6a2c(0x222),_0x40fa3d);if(!NOTIFICATION_CHANNEL_TYPES[_0x1e6a2c(0x200)](_0x17798c))throw notificationError(_0x1e6a2c(0x20d),_0x1e6a2c(0x1e5)+_0x40fa3d+_0x1e6a2c(0x1cc));const _0x33d6b8=responseNullableString(_0x3edae5['endpointUrl'],_0x1e6a2c(0x1ac),_0x40fa3d),_0x53b299=responseNullableString(_0x3edae5[_0x1e6a2c(0x1c2)],_0x1e6a2c(0x1c2),_0x40fa3d),_0x512f68=responseNullableString(_0x3edae5['description'],'description',_0x40fa3d),_0x28b51c=responseNullableTimeout(_0x3edae5[_0x1e6a2c(0x21d)],_0x1e6a2c(0x21d),_0x40fa3d),_0x1ffd20=responseNullableTimeout(_0x3edae5[_0x1e6a2c(0x216)],_0x1e6a2c(0x216),_0x40fa3d);return{'id':_0x40fa3d,'appCode':_0x2beee4,'configCode':_0x5f4f5f,'configName':_0x579e41,'channelType':_0x17798c,'endpointUrl':redactSensitive(_0x33d6b8),'channelConfig':redactSensitive(_0x53b299),'description':_0x512f68,'connectTimeout':_0x28b51c,'readTimeout':_0x1ffd20,'endpointUrlRaw':_0x33d6b8,'channelConfigRaw':_0x53b299};}export async function requireExactNotificationConfig(_0x19f666,_0x3d7456,_0x2b7348){const _0x40be2c=a140_0x3c8ca0;let _0x306b3a;try{_0x306b3a=await getNotificationChannelConfig(_0x3d7456,_0x19f666);}catch{throw safeApiFailure(_0x2b7348,_0x40be2c(0x1a9),_0x40be2c(0x1e8)+_0x19f666+_0x40be2c(0x1df));}return normalizeExactNotificationConfig(_0x306b3a,_0x3d7456,_0x19f666);}export function projectNotificationConfig(_0x401eb3){const _0xd7503a=a140_0x3c8ca0;return{'id':_0x401eb3['id']??null,'appCode':_0x401eb3[_0xd7503a(0x214)],'configCode':_0x401eb3[_0xd7503a(0x1ef)]??null,'configName':_0x401eb3[_0xd7503a(0x1c0)],'channelType':_0x401eb3['channelType'],'endpointUrl':redactSensitive(_0x401eb3[_0xd7503a(0x1ac)]),'channelConfig':redactSensitive(_0x401eb3[_0xd7503a(0x1c2)]),'description':_0x401eb3['description']??null,'connectTimeout':_0x401eb3['connectTimeout']??null,'readTimeout':_0x401eb3[_0xd7503a(0x216)]??null};}export function notificationSelector(_0x5eaf08){const _0x159f45=a140_0x3c8ca0;return{'appCode':_0x5eaf08[_0x159f45(0x214)],'id':_0x5eaf08['id'],'configCode':_0x5eaf08['configCode'],'configName':_0x5eaf08['configName'],'channelType':_0x5eaf08['channelType']};}export function createMutationInput(_0x25abef,_0x3ecb00){const _0x5b2fe5=a140_0x3c8ca0;return{'appCode':_0x25abef,'configName':_0x3ecb00[_0x5b2fe5(0x1c0)],'channelType':_0x3ecb00[_0x5b2fe5(0x222)],...hasOwn(_0x3ecb00,_0x5b2fe5(0x1ac))?{'endpointUrl':_0x3ecb00[_0x5b2fe5(0x1ac)]}:{},...hasOwn(_0x3ecb00,'channelConfig')?{'channelConfig':serializeChannelConfig(_0x3ecb00[_0x5b2fe5(0x1c2)])}:{},...hasOwn(_0x3ecb00,_0x5b2fe5(0x1cd))?{'description':_0x3ecb00[_0x5b2fe5(0x1cd)]}:{},...hasOwn(_0x3ecb00,_0x5b2fe5(0x21d))?{'connectTimeout':_0x3ecb00['connectTimeout']}:{},...hasOwn(_0x3ecb00,_0x5b2fe5(0x216))?{'readTimeout':_0x3ecb00['readTimeout']}:{}};}export function mergeUpdateInput(_0xc54431,_0x3aeeed){const _0x5688b1=a140_0x3c8ca0;return{'id':_0xc54431['id'],'appCode':_0xc54431[_0x5688b1(0x214)],'configName':_0x3aeeed[_0x5688b1(0x1c0)]??_0xc54431[_0x5688b1(0x1c0)],'channelType':_0x3aeeed[_0x5688b1(0x222)]??_0xc54431[_0x5688b1(0x222)],'endpointUrl':hasOwn(_0x3aeeed,_0x5688b1(0x1ac))?_0x3aeeed['endpointUrl']:_0xc54431[_0x5688b1(0x21f)],'channelConfig':hasOwn(_0x3aeeed,_0x5688b1(0x1c2))?serializeChannelConfig(_0x3aeeed['channelConfig']):_0xc54431[_0x5688b1(0x1b4)],'description':hasOwn(_0x3aeeed,'description')?_0x3aeeed[_0x5688b1(0x1cd)]:_0xc54431[_0x5688b1(0x1cd)],'connectTimeout':hasOwn(_0x3aeeed,_0x5688b1(0x21d))?_0x3aeeed[_0x5688b1(0x21d)]:_0xc54431[_0x5688b1(0x21d)],'readTimeout':hasOwn(_0x3aeeed,'readTimeout')?_0x3aeeed[_0x5688b1(0x216)]:_0xc54431['readTimeout']};}export function plannedUpdateProjection(_0x4d2e7a,_0x46ec32){const _0x4a837e=a140_0x3c8ca0;return projectNotificationConfig({'id':_0x4d2e7a['id'],'appCode':_0x4d2e7a['appCode'],'configCode':_0x4d2e7a[_0x4a837e(0x1ef)],'configName':_0x46ec32[_0x4a837e(0x1c0)]??_0x4d2e7a[_0x4a837e(0x1c0)],'channelType':_0x46ec32[_0x4a837e(0x222)]??_0x4d2e7a[_0x4a837e(0x222)],'endpointUrl':hasOwn(_0x46ec32,'endpointUrl')?_0x46ec32[_0x4a837e(0x1ac)]:_0x4d2e7a['endpointUrlRaw'],'channelConfig':hasOwn(_0x46ec32,'channelConfig')?_0x46ec32[_0x4a837e(0x1c2)]:_0x4d2e7a[_0x4a837e(0x1b4)],'description':hasOwn(_0x46ec32,'description')?_0x46ec32['description']:_0x4d2e7a['description'],'connectTimeout':hasOwn(_0x46ec32,_0x4a837e(0x21d))?_0x46ec32['connectTimeout']??DEFAULT_NOTIFICATION_CONNECT_TIMEOUT:_0x4d2e7a[_0x4a837e(0x21d)],'readTimeout':hasOwn(_0x46ec32,'readTimeout')?_0x46ec32[_0x4a837e(0x216)]??DEFAULT_NOTIFICATION_READ_TIMEOUT:_0x4d2e7a[_0x4a837e(0x216)]});}function a140_0x19a2(_0x5c4180,_0x33f39a){_0x5c4180=_0x5c4180-0x1a7;const _0x2f325b=a140_0x2f32();let _0x19a214=_0x2f325b[_0x5c4180];return _0x19a214;}export function requestedSafeFieldsMatch(_0x2a5518,_0xb488fd,_0x44e81f){const _0x44c94d=a140_0x3c8ca0,_0x53aa64=[],_0x5e82ae=[],_0x3f01da=[];for(const _0x41c3fc of[_0x44c94d(0x1c0),_0x44c94d(0x222),'description']){if(!hasOwn(_0x44e81f,_0x41c3fc))continue;_0x3f01da[_0x44c94d(0x1bd)](_0x41c3fc),_0x53aa64[_0x44c94d(0x1bd)](_0xb488fd[_0x41c3fc]===_0x44e81f[_0x41c3fc]),_0x5e82ae[_0x44c94d(0x1bd)](_0x2a5518[_0x41c3fc]!==_0x44e81f[_0x41c3fc]&&_0xb488fd[_0x41c3fc]===_0x44e81f[_0x41c3fc]);}for(const _0x830647 of[_0x44c94d(0x21d),_0x44c94d(0x216)]){if(!hasOwn(_0x44e81f,_0x830647))continue;const _0x1ea4e7=_0x44e81f[_0x830647]??(_0x830647===_0x44c94d(0x21d)?DEFAULT_NOTIFICATION_CONNECT_TIMEOUT:DEFAULT_NOTIFICATION_READ_TIMEOUT);_0x3f01da[_0x44c94d(0x1bd)](_0x830647),_0x53aa64[_0x44c94d(0x1bd)](_0xb488fd[_0x830647]===_0x1ea4e7),_0x5e82ae[_0x44c94d(0x1bd)](_0x2a5518[_0x830647]!==_0x1ea4e7&&_0xb488fd[_0x830647]===_0x1ea4e7);}return hasOwn(_0x44e81f,'endpointUrl')&&_0x44e81f[_0x44c94d(0x1ac)]===null&&(_0x3f01da[_0x44c94d(0x1bd)](_0x44c94d(0x1f0)),_0x53aa64[_0x44c94d(0x1bd)](_0xb488fd[_0x44c94d(0x21f)]===null||_0xb488fd[_0x44c94d(0x21f)]===''),_0x5e82ae[_0x44c94d(0x1bd)](_0x2a5518[_0x44c94d(0x21f)]!==null&&_0x2a5518[_0x44c94d(0x21f)]!==''&&(_0xb488fd['endpointUrlRaw']===null||_0xb488fd[_0x44c94d(0x21f)]===''))),{'allMatch':_0x53aa64['every'](Boolean),'provesChange':_0x5e82ae[_0x44c94d(0x20b)](Boolean),'verifiedFields':_0x3f01da};}export function validateNotificationDeleteReadback(_0x81448b,_0x46e504,_0x2b0de2){const _0x2c2970=a140_0x3c8ca0;for(const [_0x29be5e,_0x4a4f5b]of _0x81448b[_0x2c2970(0x219)]()){if(!Number['isSafeInteger'](_0x4a4f5b['id'])||_0x4a4f5b['id']<=0x0)throw notificationError(_0x2c2970(0x20d),_0x2c2970(0x21a)+(_0x29be5e+0x1)+_0x2c2970(0x1d7));if(_0x4a4f5b[_0x2c2970(0x214)]!==_0x46e504)throw notificationError('notification_config_response_invalid',_0x2c2970(0x21a)+(_0x29be5e+0x1)+_0x2c2970(0x1b0));if(_0x4a4f5b[_0x2c2970(0x222)]!==_0x2b0de2)throw notificationError('notification_config_response_invalid','Notification\x20config\x20list\x20item\x20'+(_0x29be5e+0x1)+_0x2c2970(0x1db));}}export function safeApiFailure(_0x441c6e,_0x4707a0,_0x144fb7){const _0x93d661=a140_0x3c8ca0;return notificationError(_0x93d661(0x1fb)+_0x441c6e+'_'+(_0x4707a0===_0x93d661(0x1f9)?_0x93d661(0x1e3):_0x4707a0+_0x93d661(0x1f1)),_0x93d661(0x1e5)+_0x441c6e+'\x20'+_0x4707a0+'\x20failed.',_0x144fb7);}export function notificationLookupCommand(_0xda5bdb,_0x1f9210){const _0x4e9160=a140_0x3c8ca0;return _0x4e9160(0x208)+_0xda5bdb+_0x4e9160(0x1da)+_0x1f9210+_0x4e9160(0x1d2);}function validateNotificationDocument(_0x5e4c6d,_0x404756){const _0x1d7a66=a140_0x3c8ca0;for(const _0x2ff412 of Object['keys'](_0x5e4c6d)){if(FORBIDDEN_IDENTITY_FIELDS[_0x1d7a66(0x213)](_0x2ff412))throw notificationError(_0x1d7a66(0x205),'Notification\x20JSON\x20field\x20\x22'+_0x2ff412+_0x1d7a66(0x217));if(!ALLOWED_INPUT_FIELDS[_0x1d7a66(0x213)](_0x2ff412))throw notificationError(_0x1d7a66(0x1dd),_0x1d7a66(0x1aa)+_0x2ff412+'\x22.');}if(_0x404756===_0x1d7a66(0x1ad)&&Object['keys'](_0x5e4c6d)[_0x1d7a66(0x202)]===0x0)throw notificationError(_0x1d7a66(0x20e),'Update\x20JSON\x20must\x20contain\x20at\x20least\x20one\x20allowed\x20field.');const _0x179742={};if(hasOwn(_0x5e4c6d,_0x1d7a66(0x1c0)))_0x179742[_0x1d7a66(0x1c0)]=validateRequiredString(_0x5e4c6d['configName'],_0x1d7a66(0x1c0),0x80);else{if(_0x404756==='create')throw notificationError(_0x1d7a66(0x1d4),_0x1d7a66(0x212)+_0x1d7a66(0x1c4));}if(hasOwn(_0x5e4c6d,_0x1d7a66(0x222))){if(typeof _0x5e4c6d[_0x1d7a66(0x222)]!=='string')throw invalidFieldType(_0x1d7a66(0x222),_0x1d7a66(0x1e2));const _0x2d5586=_0x5e4c6d[_0x1d7a66(0x222)]['trim']();if(!NOTIFICATION_CHANNEL_TYPES[_0x1d7a66(0x200)](_0x2d5586))throw notificationError(_0x1d7a66(0x1e6),_0x1d7a66(0x1ee),_0x1d7a66(0x1bf)+NOTIFICATION_CHANNEL_TYPES[_0x1d7a66(0x1c9)](',\x20')+'.');_0x179742['channelType']=_0x2d5586;}else{if(_0x404756===_0x1d7a66(0x210))throw notificationError(_0x1d7a66(0x1d4),_0x1d7a66(0x212)+'\x22channelType\x22.');}for(const [_0x3b243a,_0x535b06]of[[_0x1d7a66(0x1ac),0x200],[_0x1d7a66(0x1cd),0x100]]){if(!hasOwn(_0x5e4c6d,_0x3b243a))continue;const _0x6567b=_0x5e4c6d[_0x3b243a];if(_0x6567b!==null&&typeof _0x6567b!==_0x1d7a66(0x1cb))throw invalidFieldType(_0x3b243a,_0x1d7a66(0x1c7));if(typeof _0x6567b===_0x1d7a66(0x1cb)&&_0x6567b[_0x1d7a66(0x202)]>_0x535b06)throw notificationError(_0x1d7a66(0x1e6),'Notification\x20JSON\x20field\x20\x22'+_0x3b243a+_0x1d7a66(0x1fa)+_0x535b06+_0x1d7a66(0x1dc));_0x179742[_0x3b243a]=_0x6567b;}if(hasOwn(_0x5e4c6d,_0x1d7a66(0x1c2))){const _0x5d6259=_0x5e4c6d[_0x1d7a66(0x1c2)];if(_0x5d6259===null&&_0x404756===_0x1d7a66(0x210))throw invalidFieldType('channelConfig',_0x1d7a66(0x1e0));if(_0x5d6259!==null&&!isJsonObject(_0x5d6259))throw invalidFieldType('channelConfig',_0x404756===_0x1d7a66(0x1ad)?_0x1d7a66(0x1ff):_0x1d7a66(0x1e0));_0x5d6259!==null&&validateChannelConfigFields(_0x179742[_0x1d7a66(0x222)],_0x5d6259),_0x179742[_0x1d7a66(0x1c2)]=_0x5d6259;}for(const _0x5627c8 of[_0x1d7a66(0x21d),_0x1d7a66(0x216)]){if(!hasOwn(_0x5e4c6d,_0x5627c8))continue;const _0x3e9acc=_0x5e4c6d[_0x5627c8];if(_0x3e9acc!==null&&(!Number[_0x1d7a66(0x1d8)](_0x3e9acc)||_0x3e9acc<0x0))throw notificationError(_0x1d7a66(0x1e6),_0x1d7a66(0x20c)+_0x5627c8+_0x1d7a66(0x1ec));_0x179742[_0x5627c8]=_0x3e9acc;}return _0x179742;}function validateRequiredString(_0x423926,_0x5d642b,_0x368d08){const _0xb86a76=a140_0x3c8ca0;if(typeof _0x423926!==_0xb86a76(0x1cb))throw invalidFieldType(_0x5d642b,_0xb86a76(0x221));const _0x5f1bd3=_0x423926[_0xb86a76(0x1c8)]();if(!_0x5f1bd3)throw notificationError(_0xb86a76(0x1e6),_0xb86a76(0x20c)+_0x5d642b+_0xb86a76(0x1a8));if(_0x5f1bd3[_0xb86a76(0x202)]>_0x368d08)throw notificationError(_0xb86a76(0x1e6),_0xb86a76(0x20c)+_0x5d642b+_0xb86a76(0x1fa)+_0x368d08+'\x20characters.');return _0x5f1bd3;}function validateChannelConfigFields(_0x29c73a,_0x168a82){const _0x5bbca2=a140_0x3c8ca0;if(hasOwn(_0x168a82,_0x5bbca2(0x224)))throw forbiddenChannelConfigField(_0x5bbca2(0x224));if(_0x29c73a===_0x5bbca2(0x1ea))for(const _0x654cab of EMAIL_RECIPIENT_FIELDS){if(hasOwn(_0x168a82,_0x654cab))throw forbiddenChannelConfigField(_0x654cab);}}function forbiddenChannelConfigField(_0x9dd557){const _0x526556=a140_0x3c8ca0;return notificationError('notification_config_channel_field_forbidden',_0x526556(0x1ed)+_0x9dd557+'\x22\x20is\x20forbidden.');}function invalidFieldType(_0x1979c6,_0x5f5b34){const _0x6fb4e4=a140_0x3c8ca0;return notificationError(_0x6fb4e4(0x1e6),_0x6fb4e4(0x20c)+_0x1979c6+'\x22\x20must\x20be\x20'+_0x5f5b34+'.');}function a140_0x2f32(){const _0x3ceae4=['notification_config_response_invalid','notification_config_update_empty','num','create','dry-run','Create\x20JSON\x20requires\x20field\x20','has','appCode','bool','readTimeout','\x22\x20is\x20controlled\x20by\x20the\x20CLI\x20or\x20server\x20and\x20is\x20forbidden.','apiError','entries','Notification\x20config\x20list\x20item\x20','stdin','5802MaCuOw','connectTimeout','4315frzKVo','endpointUrlRaw','notification_config_source_unavailable','a\x20non-empty\x20string','channelType','notification_config_json_invalid','messageTemplate','prototype','\x20must\x20be\x20an\x20object.','\x22\x20must\x20be\x20a\x20non-empty\x20string.','preflight','Unknown\x20notification\x20JSON\x20field\x20\x22','path','endpointUrl','update','Read\x20the\x20notification\x20JSON\x20document\x20from\x20a\x20named\x20environment\x20variable','Notification\x20JSON\x20from\x20','\x20has\x20an\x20invalid\x20appCode.','Provide\x20one\x20valid\x20JSON\x20object;\x20source\x20contents\x20are\x20not\x20included\x20in\x20errors.','call','WEBHOOK','channelConfigRaw','env','Unable\x20to\x20read\x20notification\x20JSON\x20from\x20','Missing\x20notification\x20JSON\x20source.','from-env','\x20has\x20invalid\x20field\x20\x22','name','1603802Xscipb','updateTime','push','DINGTALK','Allowed\x20values:\x20','configName','stringify','channelConfig','This\x20notification\x20config\x20mutation\x20requires\x20explicit\x20--yes.','\x22configName\x22.','validation','14bHXQgW','a\x20string\x20or\x20null','trim','join','7634079dtlRGd','string','\x20has\x20an\x20unsupported\x20channelType.','description','Item\x20','channelCode','Notification\x20JSON\x20environment\x20variable\x20is\x20not\x20set:\x20','emailTargets','\x20--format\x20compress','isArray','notification_config_field_required','number','4835096LgewJU','\x20has\x20an\x20invalid\x20id.','isSafeInteger','kind','\x20--type\x20','\x20has\x20an\x20invalid\x20channelType.','\x20characters.','notification_config_field_unknown','file','\x20--type\x20<CHANNEL_TYPE>\x20--format\x20compress;\x20no\x20mutation\x20was\x20submitted.','a\x20JSON\x20object','203334SQpKPf','a\x20supported\x20string','failed','file\x20','Notification\x20config\x20','notification_config_field_invalid','str','Inspect\x20with\x20rabetbase\x20notification\x20config-list\x20--appcode\x20','Read\x20the\x20notification\x20JSON\x20document\x20from\x20stdin','EMAIL','Run\x20the\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.','\x22\x20must\x20be\x20a\x20non-negative\x20safe\x20integer\x20or\x20null.','Notification\x20JSON\x20channelConfig\x20field\x20\x22','Notification\x20JSON\x20field\x20\x22channelType\x22\x20is\x20unsupported.','configCode','endpointUrl:null','_unavailable','replyTo','environment\x20variable\x20','2586688FjxmpE','Application-level\x20notification\x20config\x20ID','notification_config_id_invalid','notification_config_confirmation_required','Read\x20the\x20notification\x20JSON\x20document\x20from\x20a\x20UTF-8\x20file','mutation','\x22\x20cannot\x20exceed\x20','notification_config_','Invalid\x20notification\x20config\x20response.','Invalid\x20--','1895588XInIym','a\x20JSON\x20object\x20or\x20null','includes','\x20is\x20missing\x20required\x20field\x20\x22','length','\x20is\x20invalid.','--id\x20must\x20be\x20a\x20positive\x20safe\x20integer.','notification_config_field_forbidden','setEncoding','subjectPrefix','rabetbase\x20notification\x20config-list\x20--appcode\x20','hasOwnProperty','yes','some','Notification\x20JSON\x20field\x20\x22'];a140_0x2f32=function(){return _0x3ceae4;};return a140_0x2f32();}function serializeChannelConfig(_0xd756c4){const _0xb9a460=a140_0x3c8ca0;return _0xd756c4===null||_0xd756c4===undefined?null:JSON[_0xb9a460(0x1c1)](_0xd756c4);}function redactSensitive(_0x13fee5){return _0x13fee5===null||_0x13fee5===undefined||_0x13fee5===''?null:'<redacted>';}function requireResponseString(_0x4315f4,_0x44f43f,_0x292fdc){const _0x4fcaf9=a140_0x3c8ca0;if(typeof _0x4315f4!==_0x4fcaf9(0x1cb)||_0x4315f4[_0x4fcaf9(0x1c8)]()==='')throw CliErrors[_0x4fcaf9(0x218)](_0x4fcaf9(0x1fc),_0x4fcaf9(0x1ce)+(_0x292fdc+0x1)+'\x20is\x20missing\x20required\x20field\x20\x22'+_0x44f43f+'\x22.');return _0x4315f4[_0x4fcaf9(0x1c8)]();}function requireExactString(_0x479e8e,_0x4e17d8,_0x21a0b4){const _0x5e18ca=a140_0x3c8ca0;if(typeof _0x479e8e!==_0x5e18ca(0x1cb)||_0x479e8e[_0x5e18ca(0x1c8)]()==='')throw notificationError('notification_config_response_invalid',_0x5e18ca(0x1e5)+_0x21a0b4+_0x5e18ca(0x201)+_0x4e17d8+'\x22.');return _0x479e8e['trim']();}function responseNullableString(_0x5d744d,_0x12953c,_0x37b3fc){const _0x1b83c5=a140_0x3c8ca0;if(_0x5d744d===undefined||_0x5d744d===null)return null;if(typeof _0x5d744d!==_0x1b83c5(0x1cb))throw notificationError(_0x1b83c5(0x20d),_0x1b83c5(0x1e5)+_0x37b3fc+_0x1b83c5(0x1b9)+_0x12953c+'\x22.');return _0x5d744d;}function responseNullableTimeout(_0x54acad,_0x2feada,_0x1677c6){const _0x1a9382=a140_0x3c8ca0;if(_0x54acad===undefined||_0x54acad===null)return null;if(!Number[_0x1a9382(0x1d8)](_0x54acad)||_0x54acad<0x0)throw notificationError('notification_config_response_invalid',_0x1a9382(0x1e5)+_0x1677c6+'\x20has\x20invalid\x20field\x20\x22'+_0x2feada+'\x22.');return _0x54acad;}function normalizeNullableString(_0x456170){const _0x59d54d=a140_0x3c8ca0;return typeof _0x456170===_0x59d54d(0x1cb)?_0x456170:null;}function isJsonObject(_0x1b3127){const _0x557630=a140_0x3c8ca0;return _0x1b3127!==null&&typeof _0x1b3127==='object'&&!Array[_0x557630(0x1d3)](_0x1b3127);}function hasOwn(_0x59e067,_0x541253){const _0x2a65ac=a140_0x3c8ca0;return Object[_0x2a65ac(0x225)][_0x2a65ac(0x209)][_0x2a65ac(0x1b2)](_0x59e067,_0x541253);}async function readStdin(){const _0x3e03a7=a140_0x3c8ca0;let _0x54a308='';process[_0x3e03a7(0x21b)][_0x3e03a7(0x206)]('utf8');for await(const _0x2a721b of process['stdin'])_0x54a308+=_0x2a721b;return _0x54a308;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a141_0x38a5b6=a141_0xee05;(function(_0x111e06,_0x1b02e9){const _0x4837fd=a141_0xee05,_0x476ffe=_0x111e06();while(!![]){try{const _0x4e3fd8=parseInt(_0x4837fd(0x1a5))/0x1+parseInt(_0x4837fd(0x185))/0x2*(-parseInt(_0x4837fd(0x1b1))/0x3)+parseInt(_0x4837fd(0x192))/0x4+parseInt(_0x4837fd(0x1b0))/0x5*(parseInt(_0x4837fd(0x18f))/0x6)+parseInt(_0x4837fd(0x1a2))/0x7+-parseInt(_0x4837fd(0x18a))/0x8+-parseInt(_0x4837fd(0x18c))/0x9;if(_0x4e3fd8===_0x1b02e9)break;else _0x476ffe['push'](_0x476ffe['shift']());}catch(_0x1a04a0){_0x476ffe['push'](_0x476ffe['shift']());}}}(a141_0x807a,0x8e510));import{requireDevelopmentUploadFile}from'../../commands/common/local-file.js';function a141_0xee05(_0xdd97ce,_0x3e8c75){_0xdd97ce=_0xdd97ce-0x17d;const _0x807a88=a141_0x807a();let _0xee054=_0x807a88[_0xdd97ce];return _0xee054;}import{queryDevelopmentFileUrl,recognizeDevelopmentOcr,uploadDevelopmentFile}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const SUPPORTED_SCENES=['invoice',a141_0x38a5b6(0x183),'form','idCard'],SCENE_TO_LEGACY_TYPE={'invoice':a141_0x38a5b6(0x1aa),'general':a141_0x38a5b6(0x184),'form':'Table','idCard':a141_0x38a5b6(0x1ac)},SCENE_FLAG={'name':a141_0x38a5b6(0x1a7),'type':a141_0x38a5b6(0x1a8),'required':!![],'enum':[...SUPPORTED_SCENES],'description':a141_0x38a5b6(0x17e)},IMAGE_FILE_FLAG={'name':a141_0x38a5b6(0x19f),'type':'string','description':a141_0x38a5b6(0x198)},IMAGE_URL_FLAG={'name':a141_0x38a5b6(0x17f),'type':a141_0x38a5b6(0x1a8),'description':a141_0x38a5b6(0x1a0)};function normalizeScene(_0x17b56a){const _0x2ba0f3=a141_0x38a5b6,_0x47c1f5=_0x17b56a[_0x2ba0f3(0x196)]()[_0x2ba0f3(0x190)]();if(_0x47c1f5===_0x2ba0f3(0x187))return _0x2ba0f3(0x19a);if(_0x47c1f5===_0x2ba0f3(0x19e)||_0x47c1f5===_0x2ba0f3(0x183)||_0x47c1f5==='form')return _0x47c1f5;throw CliErrors[_0x2ba0f3(0x188)](_0x2ba0f3(0x1a4)+_0x17b56a+_0x2ba0f3(0x191)+SUPPORTED_SCENES['join'](',\x20'));}function selectedInputs(_0x269230){const _0x124edf=a141_0x38a5b6,_0xba3ad5=_0x269230[_0x124edf(0x1b2)](_0x124edf(0x19f))[_0x124edf(0x196)](),_0x560e70=_0x269230['str']('image-url')['trim']();return{'imageFile':_0xba3ad5,'imageUrl':_0x560e70,'count':[_0xba3ad5,_0x560e70][_0x124edf(0x181)](Boolean)['length']};}function validateInputSelection(_0x16b32e){const _0x40c70c=a141_0x38a5b6,_0x14ae74=selectedInputs(_0x16b32e);if(_0x14ae74['count']!==0x1)throw CliErrors[_0x40c70c(0x188)](_0x40c70c(0x193));return _0x14ae74;}function withScene(_0x57d006,_0x8b7346,_0x8fe4d1){const _0x562225=a141_0x38a5b6;return{..._0x57d006,'scene':_0x8b7346,..._0x8fe4d1?{'sourceFile':{'fileName':_0x8fe4d1[_0x562225(0x1a1)],'filePath':_0x8fe4d1[_0x562225(0x1ab)]}}:{}};}function a141_0x807a(){const _0x5ad930=['File\x20URL\x20response\x20missing\x20fileUrl.','GET','invoice','image-file','Publicly\x20accessible\x20image\x20or\x20file\x20URL','fileName','4793936LJYJwW','appCode','Unsupported\x20OCR\x20scene:\x20','398417HGYYFQ','recognize','scene','string','apiError','Invoice','filePath','IdCard','path','imageUrl','Preview:\x20recognize\x20','9005FwLZNB','1501611iHAeVt','str','/smartapi/common/uploadFile','OCR\x20scene:\x20invoice,\x20general,\x20form,\x20or\x20idCard','image-url','\x20OCR\x20from\x20URL','filter','/smartapi/common/queryFileUrl','general','General','2pTHwbE','/smartapi/ocr/recognize-text?','idcard','validation','fileUrl','3061024yltXeU','<fileUrl\x20returned\x20by\x20/smartapi/common/queryFileUrl>','4521069pPGezy','ocr','Preview:\x20upload\x20local\x20file,\x20query\x20temporary\x20URL,\x20then\x20recognize\x20','942mpnuRV','toLowerCase','.\x20Supported\x20scenes:\x20','2409648dgNWwP','Choose\x20exactly\x20one\x20OCR\x20input:\x20--image-file\x20or\x20--image-url.','POST','imageFile','trim','read','Local\x20image\x20or\x20PDF\x20file;\x20uses\x20upload\x20->\x20query-url\x20->\x20OCR','File\x20upload\x20response\x20missing\x20filePath.','idCard','<filePath\x20returned\x20by\x20/smartapi/common/uploadFile>'];a141_0x807a=function(){return _0x5ad930;};return a141_0x807a();}const ocrRecognize={'service':a141_0x38a5b6(0x18d),'command':a141_0x38a5b6(0x1a6),'description':'使用研发态\x20OCR\x20服务识别\x20URL\x20或本地文件中的文字','risk':a141_0x38a5b6(0x197),'flags':[SCENE_FLAG,IMAGE_FILE_FLAG,IMAGE_URL_FLAG],async 'dryRun'(_0x3adad4){const _0x36b166=a141_0x38a5b6,_0x2e280c=normalizeScene(_0x3adad4[_0x36b166(0x1b2)](_0x36b166(0x1a7))),_0x25b30f=SCENE_TO_LEGACY_TYPE[_0x2e280c],_0x2279b9=validateInputSelection(_0x3adad4);if(_0x2279b9[_0x36b166(0x1ae)]){const _0x3c5655=new URLSearchParams({'url':_0x2279b9[_0x36b166(0x1ae)],'type':_0x25b30f,'appCode':_0x3adad4[_0x36b166(0x1a3)]});return{'method':_0x36b166(0x19d),'url':_0x36b166(0x186)+_0x3c5655['toString'](),'description':_0x36b166(0x1af)+_0x2e280c+_0x36b166(0x180)};}const _0xb7ea83=requireDevelopmentUploadFile(_0x2279b9[_0x36b166(0x195)],_0x36b166(0x19f));return{'method':'POST','url':_0x36b166(0x17d),'body':{'steps':[{'method':_0x36b166(0x194),'url':_0x36b166(0x17d),'body':{'appCode':_0x3adad4[_0x36b166(0x1a3)],'multipart':{'file':_0xb7ea83}}},{'method':_0x36b166(0x194),'url':_0x36b166(0x182),'body':{'filePath':_0x36b166(0x19b),'downloadFlag':![]}},{'method':_0x36b166(0x19d),'url':'/smartapi/ocr/recognize-text','query':{'appCode':_0x3adad4[_0x36b166(0x1a3)],'url':_0x36b166(0x18b),'type':_0x25b30f}}]},'description':_0x36b166(0x18e)+_0x2e280c+'\x20OCR'};},async 'execute'(_0x43607d){const _0x3db6fb=a141_0x38a5b6,_0x20617b=normalizeScene(_0x43607d['str'](_0x3db6fb(0x1a7))),_0x84b241=SCENE_TO_LEGACY_TYPE[_0x20617b],_0x269c7e=validateInputSelection(_0x43607d);if(_0x269c7e[_0x3db6fb(0x1ae)]){const _0xf3b707=await recognizeDevelopmentOcr(_0x43607d['appCode'],{'url':_0x269c7e[_0x3db6fb(0x1ae)],'type':_0x84b241});return{'ok':!![],'data':withScene(_0xf3b707,_0x20617b)};}const _0x39171b=requireDevelopmentUploadFile(_0x269c7e[_0x3db6fb(0x195)],_0x3db6fb(0x19f)),_0x1ccc63=await uploadDevelopmentFile(_0x43607d[_0x3db6fb(0x1a3)],_0x39171b[_0x3db6fb(0x1ad)]);if(!_0x1ccc63[_0x3db6fb(0x1ab)])throw CliErrors['apiError'](_0x3db6fb(0x199));const _0x588276=await queryDevelopmentFileUrl(_0x1ccc63['filePath'],{'download':![]});if(!_0x588276[_0x3db6fb(0x189)])throw CliErrors[_0x3db6fb(0x1a9)](_0x3db6fb(0x19c));const _0x1f8e64=await recognizeDevelopmentOcr(_0x43607d[_0x3db6fb(0x1a3)],{'url':_0x588276['fileUrl'],'type':_0x84b241});return{'ok':!![],'data':withScene(_0x1f8e64,_0x20617b,_0x1ccc63)};}};export const ocrDefinitions=[ocrRecognize];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { CommandDefinition } from "../../framework/types.js";
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const pageCreate: CommandDefinition;
|