@lovrabet/rabetbase-cli 2.3.13-beta.1 → 2.3.13-beta.3
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 +1 -1
- 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/add.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/remove.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.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/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -0
- 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 -0
- 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/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-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-apis-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/non-interactive.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/init.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/save.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/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.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.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/copy-directory.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/lib/commands/menu/update.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a110_0x5a3fad=a110_0x375d;(function(_0x27e902,_0x53b303){const _0x103739=a110_0x375d,_0xd08fe3=_0x27e902();while(!![]){try{const _0xac17c1=parseInt(_0x103739(0x1dd))/0x1+-parseInt(_0x103739(0x237))/0x2+-parseInt(_0x103739(0x220))/0x3+parseInt(_0x103739(0x210))/0x4+-parseInt(_0x103739(0x22f))/0x5*(parseInt(_0x103739(0x1fc))/0x6)+-parseInt(_0x103739(0x21d))/0x7*(-parseInt(_0x103739(0x1f0))/0x8)+parseInt(_0x103739(0x235))/0x9;if(_0xac17c1===_0x53b303)break;else _0xd08fe3['push'](_0xd08fe3['shift']());}catch(_0x162e8c){_0xd08fe3['push'](_0xd08fe3['shift']());}}}(a110_0x5619,0xf2b19));import{createHash}from'node:crypto';import{mkdir,readFile,stat,writeFile}from'node:fs/promises';import{dirname,resolve}from'node:path';import{menuError,mutationResult}from'../../../commands/menu/shared/mutations.js';function a110_0x375d(_0x3b8748,_0x484b20){_0x3b8748=_0x3b8748-0x1cc;const _0x5619d7=a110_0x5619();let _0x375d5c=_0x5619d7[_0x3b8748];return _0x375d5c;}const PLAN_VERSION=0x2,PLAN_COMMAND=a110_0x5a3fad(0x22a),PLAN_TTL_MS=0x1e*0x3c*0x3e8,MAX_PLAN_BYTES=0x400*0x400;export function createMenuDeletePlanFile(_0x2dde40,_0x252c54,_0x4d9599=new Date()){const _0x2140c4=a110_0x5a3fad;if(!_0x252c54[_0x2140c4(0x1db)]||!isMenuFact(_0x252c54['before']))throw menuError(_0x2140c4(0x1f9),'Cannot\x20create\x20a\x20menu\x20delete\x20plan\x20without\x20an\x20exact\x20target\x20snapshot.');const _0x30898d=_0x252c54[_0x2140c4(0x236)]?.['length']?_0x252c54[_0x2140c4(0x236)]:[_0x252c54['before']],_0x4b0d87=_0x252c54['deleteOrder']?.[_0x2140c4(0x1f4)]?_0x252c54[_0x2140c4(0x20e)]:_0x30898d['map'](_0x272371=>_0x272371['id']);return{'version':PLAN_VERSION,'command':PLAN_COMMAND,'appCode':_0x2dde40,'createdAt':_0x4d9599['toISOString'](),'expiresAt':new Date(_0x4d9599[_0x2140c4(0x1d9)]()+PLAN_TTL_MS)[_0x2140c4(0x1e2)](),'snapshotHash':_0x252c54[_0x2140c4(0x1e7)],'recursive':_0x252c54['selector'][_0x2140c4(0x214)]===!![],'target':_0x252c54[_0x2140c4(0x1db)],'targetFingerprint':fingerprint(_0x252c54[_0x2140c4(0x1db)]),'targets':_0x30898d,'targetFingerprints':_0x30898d[_0x2140c4(0x22d)](fingerprint),'deleteOrder':_0x4b0d87,'cascade':_0x252c54['cascade']??{'pages':_0x252c54['before'][_0x2140c4(0x1f7)]==null?[]:[_0x252c54[_0x2140c4(0x1db)][_0x2140c4(0x1f7)]],'pageSchemaAffected':_0x252c54['before']['pageId']!=null},'warnings':[..._0x252c54[_0x2140c4(0x22b)]]};}export async function writeMenuDeletePlan(_0x46bf7f,_0x5b835a){const _0x24d173=a110_0x5a3fad,_0x41942d=resolvePlanPath(_0x46bf7f,'plan-out');await mkdir(dirname(_0x41942d),{'recursive':!![]});try{await writeFile(_0x41942d,JSON[_0x24d173(0x1cd)](_0x5b835a,null,0x2)+'\x0a',{'encoding':'utf8','flag':'wx'});}catch(_0x2d1665){if(_0x2d1665[_0x24d173(0x1d1)]===_0x24d173(0x208))throw menuError(_0x24d173(0x216),_0x24d173(0x204)+_0x41942d,_0x24d173(0x21a));throw menuError(_0x24d173(0x1e4),_0x24d173(0x1e9)+_0x41942d+':\x20'+errorMessage(_0x2d1665));}return _0x41942d;}export async function readMenuDeletePlan(_0x481fc6){const _0x50b538=a110_0x5a3fad,_0x5300fe=resolvePlanPath(_0x481fc6,_0x50b538(0x1f2));let _0x384d1e;try{_0x384d1e=(await stat(_0x5300fe))[_0x50b538(0x1e8)];}catch(_0x219d88){throw menuError(_0x50b538(0x1f9),'Cannot\x20read\x20menu\x20delete\x20plan\x20'+_0x5300fe+':\x20'+errorMessage(_0x219d88));}if(_0x384d1e>MAX_PLAN_BYTES)throw menuError(_0x50b538(0x1f9),_0x50b538(0x1cc)+_0x384d1e+_0x50b538(0x1ec));let _0x4911d3;try{_0x4911d3=JSON[_0x50b538(0x201)](await readFile(_0x5300fe,_0x50b538(0x207)));}catch(_0x253a4d){throw menuError(_0x50b538(0x1f9),'Menu\x20delete\x20plan\x20is\x20not\x20valid\x20JSON:\x20'+errorMessage(_0x253a4d));}if(!isMenuDeletePlanFile(_0x4911d3))throw menuError(_0x50b538(0x1f9),_0x50b538(0x1de)+PLAN_VERSION+_0x50b538(0x217)+PLAN_COMMAND+_0x50b538(0x226));if(!sameFingerprint(_0x4911d3['targetFingerprint'],fingerprint(_0x4911d3['target'])))throw menuError(_0x50b538(0x1f9),_0x50b538(0x1d8),_0x50b538(0x225));if(!_0x4911d3[_0x50b538(0x236)]['every']((_0x485afd,_0x57bcdc)=>sameFingerprint(_0x4911d3['targetFingerprints'][_0x57bcdc],fingerprint(_0x485afd)))||!sameFingerprint(_0x4911d3[_0x50b538(0x221)],fingerprint(_0x4911d3[_0x50b538(0x236)][_0x4911d3['targets']['length']-0x1])))throw menuError(_0x50b538(0x1f9),'Menu\x20delete\x20plan\x20target\x20list\x20does\x20not\x20match\x20its\x20immutable\x20fingerprints.',_0x50b538(0x225));return{'path':_0x5300fe,'plan':_0x4911d3};}export function mutationPlanFromDeleteFile(_0x106a37,_0x2e7478){const _0xc1a9d7=a110_0x5a3fad;return mutationResult({'operation':_0xc1a9d7(0x222),'selector':{'id':_0x106a37[_0xc1a9d7(0x234)]['id'],'recursive':_0x106a37[_0xc1a9d7(0x214)]},'before':_0x106a37[_0xc1a9d7(0x234)],'after':null,'dryRun':![],'backend':[{'method':_0xc1a9d7(0x1d3),'path':_0xc1a9d7(0x1e5)}],'plannedActions':[{'stage':_0xc1a9d7(0x1df),'method':'POST','path':_0xc1a9d7(0x1e5),'body':{'idList':_0x106a37[_0xc1a9d7(0x20e)]}}],'targets':_0x106a37[_0xc1a9d7(0x236)],'deleteOrder':_0x106a37[_0xc1a9d7(0x20e)],'snapshotHash':_0x106a37[_0xc1a9d7(0x1e7)],'cascade':_0x106a37[_0xc1a9d7(0x228)],'planFile':{'path':_0x2e7478,'createdAt':_0x106a37[_0xc1a9d7(0x22c)],'expiresAt':_0x106a37[_0xc1a9d7(0x1f5)]},'warnings':_0x106a37[_0xc1a9d7(0x22b)]});}export function assertMenuDeletePlanCurrent(_0x58644b,_0x2f410d,_0x559326,_0x3dac2b=new Date()){const _0x545de4=a110_0x5a3fad;assertMenuDeletePlanExecutable(_0x58644b,_0x2f410d,_0x3dac2b);if(_0x559326[_0x545de4(0x1ce)]!==_0x58644b[_0x545de4(0x1e7)])throw menuError(_0x545de4(0x1fa),_0x545de4(0x20c),_0x545de4(0x1fd));return _0x58644b[_0x545de4(0x236)][_0x545de4(0x22d)]((_0x254deb,_0x28b4b9)=>{const _0x2fc9dc=_0x545de4,_0x5ec1b2=_0x559326[_0x2fc9dc(0x1d7)]['get'](_0x254deb['id']);if(!_0x5ec1b2)throw menuError(_0x2fc9dc(0x1fa),_0x2fc9dc(0x224)+_0x254deb['id']+_0x2fc9dc(0x21b));if(!sameFingerprint(_0x58644b[_0x2fc9dc(0x20a)][_0x28b4b9],fingerprint(_0x5ec1b2)))throw menuError(_0x2fc9dc(0x1fa),_0x2fc9dc(0x224)+_0x254deb['id']+_0x2fc9dc(0x219),_0x2fc9dc(0x1ef));return _0x5ec1b2;});}export function assertMenuDeletePlanExecutable(_0x9ce162,_0x3771c4,_0x2c3606=new Date()){const _0x5aada6=a110_0x5a3fad;if(_0x9ce162[_0x5aada6(0x1f8)]!==_0x3771c4)throw menuError(_0x5aada6(0x20d),'Menu\x20delete\x20plan\x20targets\x20app\x20'+JSON[_0x5aada6(0x1cd)](_0x9ce162[_0x5aada6(0x1f8)])+_0x5aada6(0x1cf)+JSON[_0x5aada6(0x1cd)](_0x3771c4)+'.');const _0x3cd58e=Date[_0x5aada6(0x201)](_0x9ce162[_0x5aada6(0x22c)]),_0x2a66ae=Date[_0x5aada6(0x201)](_0x9ce162[_0x5aada6(0x1f5)]);if(!Number[_0x5aada6(0x1fb)](_0x3cd58e)||!Number[_0x5aada6(0x1fb)](_0x2a66ae)||_0x2a66ae-_0x3cd58e!==PLAN_TTL_MS)throw menuError(_0x5aada6(0x1f9),_0x5aada6(0x203));if(_0x3cd58e>_0x2c3606[_0x5aada6(0x1d9)]())throw menuError(_0x5aada6(0x1f9),_0x5aada6(0x1e3)+_0x9ce162[_0x5aada6(0x22c)]+_0x5aada6(0x200),_0x5aada6(0x1f3));if(_0x2c3606[_0x5aada6(0x1d9)]()>_0x2a66ae)throw menuError(_0x5aada6(0x1dc),_0x5aada6(0x21c)+_0x9ce162[_0x5aada6(0x1f5)]+'.',_0x5aada6(0x206));}function fingerprint(_0x38a7ae){const _0x50f679=a110_0x5a3fad;return{'id':_0x38a7ae['id'],'parentId':_0x38a7ae['parentId'],'depth':_0x38a7ae[_0x50f679(0x20b)],'label':_0x38a7ae[_0x50f679(0x21f)],'path':_0x38a7ae['path'],'type':_0x38a7ae['type'],'visible':_0x38a7ae['visible'],'sort':_0x38a7ae['sort'],'pageId':_0x38a7ae[_0x50f679(0x1f7)],'pageType':_0x38a7ae[_0x50f679(0x1d4)],'modelType':_0x38a7ae[_0x50f679(0x1f1)],'datasetId':_0x38a7ae[_0x50f679(0x1da)],'datasetCode':_0x38a7ae[_0x50f679(0x202)],'childrenIds':[..._0x38a7ae[_0x50f679(0x1ee)]],'childrenCount':_0x38a7ae['childrenCount'],'resourcesValid':_0x38a7ae['resourcesValid'],'resourcesHash':hashValue(_0x38a7ae['resources']),'extendHash':hashValue(_0x38a7ae[_0x50f679(0x213)]??null),'updateTime':_0x38a7ae[_0x50f679(0x1ff)]};}function hashValue(_0x3d1ddc){const _0x50d0f1=a110_0x5a3fad;return createHash('sha256')[_0x50d0f1(0x233)](JSON[_0x50d0f1(0x1cd)](_0x3d1ddc))[_0x50d0f1(0x230)](_0x50d0f1(0x1e6));}function sameFingerprint(_0x25cb95,_0x39f20f){const _0x1e3a86=a110_0x5a3fad;return JSON[_0x1e3a86(0x1cd)](_0x25cb95)===JSON[_0x1e3a86(0x1cd)](_0x39f20f);}function resolvePlanPath(_0x25f351,_0x19b9d6){const _0x1a973f=a110_0x5a3fad,_0x37d4b4=_0x25f351[_0x1a973f(0x212)]();if(!_0x37d4b4)throw menuError(_0x1a973f(0x1f9),'--'+_0x19b9d6+_0x1a973f(0x1d0));return resolve(_0x37d4b4);}function isMenuDeletePlanFile(_0x5542f0){const _0x44ca22=a110_0x5a3fad;if(!isRecord(_0x5542f0))return![];return _0x5542f0[_0x44ca22(0x22e)]===PLAN_VERSION&&_0x5542f0['command']===PLAN_COMMAND&&typeof _0x5542f0['appCode']===_0x44ca22(0x223)&&_0x5542f0[_0x44ca22(0x1f8)][_0x44ca22(0x1f4)]>0x0&&typeof _0x5542f0[_0x44ca22(0x22c)]==='string'&&typeof _0x5542f0['expiresAt']===_0x44ca22(0x223)&&typeof _0x5542f0[_0x44ca22(0x1e7)]===_0x44ca22(0x223)&&/^sha256:[a-f0-9]{64}$/['test'](_0x5542f0[_0x44ca22(0x1e7)])&&typeof _0x5542f0['recursive']===_0x44ca22(0x21e)&&isMenuFact(_0x5542f0[_0x44ca22(0x234)])&&isTargetFingerprint(_0x5542f0['targetFingerprint'])&&Array['isArray'](_0x5542f0[_0x44ca22(0x236)])&&_0x5542f0[_0x44ca22(0x236)][_0x44ca22(0x1f4)]>0x0&&_0x5542f0[_0x44ca22(0x236)]['every'](isMenuFact)&&Array[_0x44ca22(0x205)](_0x5542f0[_0x44ca22(0x20a)])&&_0x5542f0[_0x44ca22(0x20a)][_0x44ca22(0x1f4)]===_0x5542f0[_0x44ca22(0x236)]['length']&&_0x5542f0['targetFingerprints']['every'](isTargetFingerprint)&&Array['isArray'](_0x5542f0[_0x44ca22(0x20e)])&&_0x5542f0['deleteOrder'][_0x44ca22(0x1f4)]===_0x5542f0[_0x44ca22(0x236)][_0x44ca22(0x1f4)]&&_0x5542f0[_0x44ca22(0x20e)][_0x44ca22(0x20f)](isPositiveInteger)&&new Set(_0x5542f0['deleteOrder'])[_0x44ca22(0x1e8)]===_0x5542f0[_0x44ca22(0x20e)][_0x44ca22(0x1f4)]&&_0x5542f0[_0x44ca22(0x236)][_0x44ca22(0x20f)]((_0x4cd779,_0x5afd22)=>_0x4cd779['id']===_0x5542f0[_0x44ca22(0x20e)][_0x5afd22])&&_0x5542f0[_0x44ca22(0x236)][_0x5542f0[_0x44ca22(0x236)]['length']-0x1]?.['id']===_0x5542f0[_0x44ca22(0x234)]['id']&&isRecord(_0x5542f0['cascade'])&&Array[_0x44ca22(0x205)](_0x5542f0[_0x44ca22(0x228)]['pages'])&&_0x5542f0['cascade'][_0x44ca22(0x1f6)][_0x44ca22(0x20f)](isPositiveInteger)&&typeof _0x5542f0[_0x44ca22(0x228)]['pageSchemaAffected']===_0x44ca22(0x21e)&&Array[_0x44ca22(0x205)](_0x5542f0[_0x44ca22(0x22b)])&&_0x5542f0['warnings']['every'](_0x23a2b8=>typeof _0x23a2b8==='string');}function isMenuFact(_0x2f1ce3){const _0x4b7cb1=a110_0x5a3fad;if(!isRecord(_0x2f1ce3))return![];return isPositiveInteger(_0x2f1ce3['id'])&&(_0x2f1ce3[_0x4b7cb1(0x1e1)]===null||isPositiveInteger(_0x2f1ce3[_0x4b7cb1(0x1e1)]))&&Number[_0x4b7cb1(0x209)](_0x2f1ce3['depth'])&&_0x2f1ce3[_0x4b7cb1(0x20b)]>=0x0&&typeof _0x2f1ce3[_0x4b7cb1(0x21f)]===_0x4b7cb1(0x223)&&typeof _0x2f1ce3['path']===_0x4b7cb1(0x223)&&typeof _0x2f1ce3['type']===_0x4b7cb1(0x223)&&(_0x2f1ce3[_0x4b7cb1(0x1d6)]===null||typeof _0x2f1ce3[_0x4b7cb1(0x1d6)]===_0x4b7cb1(0x21e))&&(_0x2f1ce3[_0x4b7cb1(0x1eb)]===null||Number[_0x4b7cb1(0x209)](_0x2f1ce3[_0x4b7cb1(0x1eb)]))&&Array[_0x4b7cb1(0x205)](_0x2f1ce3[_0x4b7cb1(0x227)])&&_0x2f1ce3[_0x4b7cb1(0x227)][_0x4b7cb1(0x20f)](_0x1c884c=>typeof _0x1c884c===_0x4b7cb1(0x223))&&typeof _0x2f1ce3['resourcesValid']===_0x4b7cb1(0x21e)&&Array[_0x4b7cb1(0x205)](_0x2f1ce3['childrenIds'])&&_0x2f1ce3['childrenIds'][_0x4b7cb1(0x20f)](isPositiveInteger)&&Number['isInteger'](_0x2f1ce3[_0x4b7cb1(0x215)])&&_0x2f1ce3[_0x4b7cb1(0x215)]>=0x0&&(_0x2f1ce3['pageId']===null||isPositiveInteger(_0x2f1ce3[_0x4b7cb1(0x1f7)]))&&typeof _0x2f1ce3['pageType']===_0x4b7cb1(0x223)&&typeof _0x2f1ce3[_0x4b7cb1(0x1f1)]===_0x4b7cb1(0x223)&&(_0x2f1ce3[_0x4b7cb1(0x1da)]===null||isPositiveInteger(_0x2f1ce3[_0x4b7cb1(0x1da)]))&&typeof _0x2f1ce3[_0x4b7cb1(0x202)]==='string'&&(_0x2f1ce3[_0x4b7cb1(0x232)]===null||typeof _0x2f1ce3['updateUserId']===_0x4b7cb1(0x223))&&(_0x2f1ce3[_0x4b7cb1(0x229)]===null||typeof _0x2f1ce3[_0x4b7cb1(0x229)]===_0x4b7cb1(0x223))&&(_0x2f1ce3[_0x4b7cb1(0x1ff)]===null||typeof _0x2f1ce3['updateTime']===_0x4b7cb1(0x223)||typeof _0x2f1ce3[_0x4b7cb1(0x1ff)]===_0x4b7cb1(0x218))&&(_0x2f1ce3[_0x4b7cb1(0x213)]===undefined||_0x2f1ce3[_0x4b7cb1(0x213)]===null||isRecord(_0x2f1ce3[_0x4b7cb1(0x213)]));}function isTargetFingerprint(_0x390f9d){const _0x150059=a110_0x5a3fad;if(!isRecord(_0x390f9d))return![];return isPositiveInteger(_0x390f9d['id'])&&(_0x390f9d[_0x150059(0x1e1)]===null||isPositiveInteger(_0x390f9d[_0x150059(0x1e1)]))&&Number[_0x150059(0x209)](_0x390f9d['depth'])&&_0x390f9d[_0x150059(0x20b)]>=0x0&&typeof _0x390f9d[_0x150059(0x21f)]===_0x150059(0x223)&&typeof _0x390f9d[_0x150059(0x1ea)]==='string'&&typeof _0x390f9d[_0x150059(0x1d2)]===_0x150059(0x223)&&(_0x390f9d[_0x150059(0x1d6)]===null||typeof _0x390f9d[_0x150059(0x1d6)]===_0x150059(0x21e))&&(_0x390f9d['sort']===null||Number[_0x150059(0x209)](_0x390f9d[_0x150059(0x1eb)]))&&(_0x390f9d[_0x150059(0x1f7)]===null||isPositiveInteger(_0x390f9d['pageId']))&&typeof _0x390f9d['pageType']===_0x150059(0x223)&&typeof _0x390f9d['modelType']===_0x150059(0x223)&&(_0x390f9d[_0x150059(0x1da)]===null||isPositiveInteger(_0x390f9d[_0x150059(0x1da)]))&&typeof _0x390f9d[_0x150059(0x202)]==='string'&&Array[_0x150059(0x205)](_0x390f9d[_0x150059(0x1ee)])&&_0x390f9d[_0x150059(0x1ee)]['every'](isPositiveInteger)&&Number[_0x150059(0x209)](_0x390f9d['childrenCount'])&&_0x390f9d[_0x150059(0x215)]>=0x0&&typeof _0x390f9d[_0x150059(0x211)]==='boolean'&&typeof _0x390f9d['resourcesHash']==='string'&&/^[a-f0-9]{64}$/[_0x150059(0x1d5)](_0x390f9d['resourcesHash'])&&typeof _0x390f9d[_0x150059(0x1e0)]===_0x150059(0x223)&&/^[a-f0-9]{64}$/[_0x150059(0x1d5)](_0x390f9d[_0x150059(0x1e0)])&&(_0x390f9d['updateTime']===null||typeof _0x390f9d[_0x150059(0x1ff)]===_0x150059(0x223)||typeof _0x390f9d[_0x150059(0x1ff)]==='number');}function a110_0x5619(){const _0x2edd79=['Generate\x20and\x20review\x20a\x20new\x20plan\x20before\x20deleting.','utf8','EEXIST','isInteger','targetFingerprints','depth','Online\x20menu\x20state\x20changed\x20after\x20the\x20delete\x20plan\x20was\x20reviewed.','menu_plan_app_mismatch','deleteOrder','every','4158448WLKeOp','resourcesValid','trim','extend','recursive','childrenCount','menu_plan_file_exists','\x20of\x20the\x20','number','\x20no\x20longer\x20matches\x20the\x20reviewed\x20target\x20facts.','Choose\x20a\x20new\x20--plan-out\x20path\x20so\x20the\x20reviewed\x20plan\x20remains\x20immutable.','\x20is\x20no\x20longer\x20present\x20in\x20the\x20online\x20menu\x20tree.','Menu\x20delete\x20plan\x20expired\x20at\x20','2017582cHbVHI','boolean','label','4604637GrVkOJ','targetFingerprint','delete','string','Planned\x20menu\x20','Generate\x20a\x20new\x20plan\x20with\x20--dry-run\x20--plan-out;\x20do\x20not\x20edit\x20target\x20fields\x20manually.','\x20contract.','resources','cascade','updateUserName','menu\x20delete','warnings','createdAt','map','version','25nTwmGZ','digest','message','updateUserId','update','target','22614723mLsirV','targets','2684572ShPyIN','Menu\x20delete\x20plan\x20is\x20too\x20large:\x20','stringify','hash',',\x20current\x20app\x20is\x20','\x20requires\x20a\x20non-empty\x20file\x20path.','code','type','POST','pageType','test','visible','byId','Menu\x20delete\x20plan\x20target\x20facts\x20do\x20not\x20match\x20its\x20immutable\x20fingerprint.','getTime','datasetId','before','menu_plan_expired','202123slwrgQ','Menu\x20delete\x20plan\x20does\x20not\x20match\x20version\x20','batch-delete-menu','extendHash','parentId','toISOString','Menu\x20delete\x20plan\x20creation\x20time\x20','menu_plan_write_failed','/smartapi/menu/batchDelete','hex','snapshotHash','size','Failed\x20to\x20write\x20menu\x20delete\x20plan\x20','path','sort','\x20bytes.','object','childrenIds','Generate\x20a\x20new\x20plan\x20and\x20review\x20parent,\x20path,\x20page,\x20children,\x20resources,\x20and\x20update\x20time.','8uyahWJ','modelType','plan','Generate\x20a\x20new\x20plan\x20on\x20a\x20machine\x20with\x20a\x20correct\x20system\x20clock.','length','expiresAt','pages','pageId','appCode','menu_plan_invalid','menu_state_drift','isFinite','205764cuFXVm','Generate\x20a\x20new\x20plan\x20with\x20--dry-run\x20--plan-out\x20and\x20review\x20the\x20latest\x20cascade.','isSafeInteger','updateTime','\x20is\x20in\x20the\x20future.','parse','datasetCode','Menu\x20delete\x20plan\x20has\x20invalid\x20timestamps.','Refusing\x20to\x20overwrite\x20existing\x20menu\x20delete\x20plan:\x20','isArray'];a110_0x5619=function(){return _0x2edd79;};return a110_0x5619();}function isRecord(_0x19304e){const _0x47075d=a110_0x5a3fad;return typeof _0x19304e===_0x47075d(0x1ed)&&_0x19304e!==null&&!Array[_0x47075d(0x205)](_0x19304e);}function isPositiveInteger(_0x780515){const _0x2e70f7=a110_0x5a3fad;return Number[_0x2e70f7(0x1fe)](_0x780515)&&Number(_0x780515)>0x0;}function errorMessage(_0x1ccfb7){const _0x3b6f3e=a110_0x5a3fad;return _0x1ccfb7 instanceof Error?_0x1ccfb7[_0x3b6f3e(0x231)]:String(_0x1ccfb7);}
|
|
1
|
+
const a112_0x455e8b=a112_0x24f8;(function(_0x52db94,_0x14798d){const _0x78cb3b=a112_0x24f8,_0x16a07a=_0x52db94();while(!![]){try{const _0x37b6b8=parseInt(_0x78cb3b(0x1cf))/0x1+-parseInt(_0x78cb3b(0x21c))/0x2+parseInt(_0x78cb3b(0x1d4))/0x3*(-parseInt(_0x78cb3b(0x1d6))/0x4)+-parseInt(_0x78cb3b(0x215))/0x5+-parseInt(_0x78cb3b(0x210))/0x6+parseInt(_0x78cb3b(0x20e))/0x7+-parseInt(_0x78cb3b(0x233))/0x8*(-parseInt(_0x78cb3b(0x235))/0x9);if(_0x37b6b8===_0x14798d)break;else _0x16a07a['push'](_0x16a07a['shift']());}catch(_0x2f76ef){_0x16a07a['push'](_0x16a07a['shift']());}}}(a112_0x21c7,0x219de));import{createHash}from'node:crypto';import{mkdir,readFile,stat,writeFile}from'node:fs/promises';import{dirname,resolve}from'node:path';import{menuError,mutationResult}from'../../../commands/menu/shared/mutations.js';const PLAN_VERSION=0x2,PLAN_COMMAND=a112_0x455e8b(0x22a),PLAN_TTL_MS=0x1e*0x3c*0x3e8,MAX_PLAN_BYTES=0x400*0x400;export function createMenuDeletePlanFile(_0x1ce345,_0x189c23,_0x246578=new Date()){const _0x13689e=a112_0x455e8b;if(!_0x189c23[_0x13689e(0x1f1)]||!isMenuFact(_0x189c23[_0x13689e(0x1f1)]))throw menuError('menu_plan_invalid',_0x13689e(0x227));const _0x16b7d6=_0x189c23[_0x13689e(0x1dc)]?.[_0x13689e(0x1d1)]?_0x189c23['targets']:[_0x189c23[_0x13689e(0x1f1)]],_0x4643e9=_0x189c23[_0x13689e(0x234)]?.[_0x13689e(0x1d1)]?_0x189c23[_0x13689e(0x234)]:_0x16b7d6[_0x13689e(0x218)](_0x4ac0be=>_0x4ac0be['id']);return{'version':PLAN_VERSION,'command':PLAN_COMMAND,'appCode':_0x1ce345,'createdAt':_0x246578[_0x13689e(0x1f2)](),'expiresAt':new Date(_0x246578['getTime']()+PLAN_TTL_MS)[_0x13689e(0x1f2)](),'snapshotHash':_0x189c23['snapshotHash'],'recursive':_0x189c23[_0x13689e(0x1d9)][_0x13689e(0x217)]===!![],'target':_0x189c23[_0x13689e(0x1f1)],'targetFingerprint':fingerprint(_0x189c23['before']),'targets':_0x16b7d6,'targetFingerprints':_0x16b7d6['map'](fingerprint),'deleteOrder':_0x4643e9,'cascade':_0x189c23[_0x13689e(0x1dd)]??{'pages':_0x189c23[_0x13689e(0x1f1)]['pageId']==null?[]:[_0x189c23[_0x13689e(0x1f1)][_0x13689e(0x22b)]],'pageSchemaAffected':_0x189c23[_0x13689e(0x1f1)]['pageId']!=null},'warnings':[..._0x189c23[_0x13689e(0x211)]]};}function a112_0x21c7(){const _0x4dd079=['Menu\x20delete\x20plan\x20targets\x20app\x20','menu_state_drift','381vflcad','snapshotHash','2904KomCEc','isInteger','pages','selector','batch-delete-menu','Planned\x20menu\x20','targets','cascade','message','\x20of\x20the\x20','menu_plan_write_failed','menu_plan_invalid','utf8','Menu\x20delete\x20plan\x20is\x20not\x20valid\x20JSON:\x20','isSafeInteger','datasetId','extendHash','/smartapi/menu/batchDelete','object','trim','isArray','\x20is\x20no\x20longer\x20present\x20in\x20the\x20online\x20menu\x20tree.','updateTime','Choose\x20a\x20new\x20--plan-out\x20path\x20so\x20the\x20reviewed\x20plan\x20remains\x20immutable.','version','childrenIds','Online\x20menu\x20state\x20changed\x20after\x20the\x20delete\x20plan\x20was\x20reviewed.','before','toISOString','\x20is\x20in\x20the\x20future.','Menu\x20delete\x20plan\x20target\x20facts\x20do\x20not\x20match\x20its\x20immutable\x20fingerprint.','parse','Menu\x20delete\x20plan\x20expired\x20at\x20','resources','Generate\x20a\x20new\x20plan\x20with\x20--dry-run\x20--plan-out;\x20do\x20not\x20edit\x20target\x20fields\x20manually.','pageSchemaAffected','POST','plan','plan-out','sha256','label','appCode','get','type','expiresAt','delete','targetFingerprint','Refusing\x20to\x20overwrite\x20existing\x20menu\x20delete\x20plan:\x20','visible','Menu\x20delete\x20plan\x20target\x20list\x20does\x20not\x20match\x20its\x20immutable\x20fingerprints.','getTime','every','createdAt','parentId',',\x20current\x20app\x20is\x20','sort','1091293oSvBfj','Menu\x20delete\x20plan\x20does\x20not\x20match\x20version\x20','714108gEPjCl','warnings','code','menu_plan_app_mismatch','updateUserName','1048315KrLyhx','Menu\x20delete\x20plan\x20is\x20too\x20large:\x20','recursive','map','depth','command','update','216208pcWlzn','childrenCount','Generate\x20a\x20new\x20plan\x20and\x20review\x20parent,\x20path,\x20page,\x20children,\x20resources,\x20and\x20update\x20time.','target','extend','targetFingerprints','size','test','boolean','isFinite','updateUserId','Cannot\x20create\x20a\x20menu\x20delete\x20plan\x20without\x20an\x20exact\x20target\x20snapshot.','resourcesValid','pageType','menu\x20delete','pageId','hex','stringify','path','resourcesHash','string','menu_plan_file_exists','Menu\x20delete\x20plan\x20has\x20invalid\x20timestamps.','208ivPpEU','deleteOrder','133695hvulzd','datasetCode','modelType','number','124552rGKqEB','menu_plan_expired','length'];a112_0x21c7=function(){return _0x4dd079;};return a112_0x21c7();}export async function writeMenuDeletePlan(_0x4e8948,_0x38375e){const _0x14dfa6=a112_0x455e8b,_0x6f5cea=resolvePlanPath(_0x4e8948,_0x14dfa6(0x1fc));await mkdir(dirname(_0x6f5cea),{'recursive':!![]});try{await writeFile(_0x6f5cea,JSON[_0x14dfa6(0x22d)](_0x38375e,null,0x2)+'\x0a',{'encoding':'utf8','flag':'wx'});}catch(_0x461262){if(_0x461262[_0x14dfa6(0x212)]==='EEXIST')throw menuError(_0x14dfa6(0x231),_0x14dfa6(0x205)+_0x6f5cea,_0x14dfa6(0x1ed));throw menuError(_0x14dfa6(0x1e0),'Failed\x20to\x20write\x20menu\x20delete\x20plan\x20'+_0x6f5cea+':\x20'+errorMessage(_0x461262));}return _0x6f5cea;}export async function readMenuDeletePlan(_0x4e45da){const _0x37150f=a112_0x455e8b,_0xd71800=resolvePlanPath(_0x4e45da,_0x37150f(0x1fb));let _0x27c580;try{_0x27c580=(await stat(_0xd71800))[_0x37150f(0x222)];}catch(_0x285569){throw menuError('menu_plan_invalid','Cannot\x20read\x20menu\x20delete\x20plan\x20'+_0xd71800+':\x20'+errorMessage(_0x285569));}if(_0x27c580>MAX_PLAN_BYTES)throw menuError(_0x37150f(0x1e1),_0x37150f(0x216)+_0x27c580+'\x20bytes.');let _0x34fe74;try{_0x34fe74=JSON[_0x37150f(0x1f5)](await readFile(_0xd71800,_0x37150f(0x1e2)));}catch(_0x9da013){throw menuError(_0x37150f(0x1e1),_0x37150f(0x1e3)+errorMessage(_0x9da013));}if(!isMenuDeletePlanFile(_0x34fe74))throw menuError('menu_plan_invalid',_0x37150f(0x20f)+PLAN_VERSION+_0x37150f(0x1df)+PLAN_COMMAND+'\x20contract.');if(!sameFingerprint(_0x34fe74[_0x37150f(0x204)],fingerprint(_0x34fe74[_0x37150f(0x21f)])))throw menuError(_0x37150f(0x1e1),_0x37150f(0x1f4),_0x37150f(0x1f8));if(!_0x34fe74[_0x37150f(0x1dc)][_0x37150f(0x209)]((_0x1bd623,_0x211da2)=>sameFingerprint(_0x34fe74[_0x37150f(0x221)][_0x211da2],fingerprint(_0x1bd623)))||!sameFingerprint(_0x34fe74[_0x37150f(0x204)],fingerprint(_0x34fe74[_0x37150f(0x1dc)][_0x34fe74['targets'][_0x37150f(0x1d1)]-0x1])))throw menuError('menu_plan_invalid',_0x37150f(0x207),_0x37150f(0x1f8));return{'path':_0xd71800,'plan':_0x34fe74};}export function mutationPlanFromDeleteFile(_0x704da6,_0x119ffb){const _0x279ee6=a112_0x455e8b;return mutationResult({'operation':_0x279ee6(0x203),'selector':{'id':_0x704da6[_0x279ee6(0x21f)]['id'],'recursive':_0x704da6[_0x279ee6(0x217)]},'before':_0x704da6[_0x279ee6(0x21f)],'after':null,'dryRun':![],'backend':[{'method':'POST','path':'/smartapi/menu/batchDelete'}],'plannedActions':[{'stage':_0x279ee6(0x1da),'method':_0x279ee6(0x1fa),'path':_0x279ee6(0x1e7),'body':{'idList':_0x704da6[_0x279ee6(0x234)]}}],'targets':_0x704da6[_0x279ee6(0x1dc)],'deleteOrder':_0x704da6[_0x279ee6(0x234)],'snapshotHash':_0x704da6[_0x279ee6(0x1d5)],'cascade':_0x704da6[_0x279ee6(0x1dd)],'planFile':{'path':_0x119ffb,'createdAt':_0x704da6[_0x279ee6(0x20a)],'expiresAt':_0x704da6[_0x279ee6(0x202)]},'warnings':_0x704da6[_0x279ee6(0x211)]});}export function assertMenuDeletePlanCurrent(_0x2f60e2,_0x8fe7b7,_0x595a86,_0x5a4eee=new Date()){const _0x3113ea=a112_0x455e8b;assertMenuDeletePlanExecutable(_0x2f60e2,_0x8fe7b7,_0x5a4eee);if(_0x595a86['hash']!==_0x2f60e2[_0x3113ea(0x1d5)])throw menuError(_0x3113ea(0x1d3),_0x3113ea(0x1f0),'Generate\x20a\x20new\x20plan\x20with\x20--dry-run\x20--plan-out\x20and\x20review\x20the\x20latest\x20cascade.');return _0x2f60e2[_0x3113ea(0x1dc)]['map']((_0x3e0360,_0x52793f)=>{const _0x4a9b92=_0x3113ea,_0x53f5eb=_0x595a86['byId'][_0x4a9b92(0x200)](_0x3e0360['id']);if(!_0x53f5eb)throw menuError(_0x4a9b92(0x1d3),_0x4a9b92(0x1db)+_0x3e0360['id']+_0x4a9b92(0x1eb));if(!sameFingerprint(_0x2f60e2['targetFingerprints'][_0x52793f],fingerprint(_0x53f5eb)))throw menuError(_0x4a9b92(0x1d3),_0x4a9b92(0x1db)+_0x3e0360['id']+'\x20no\x20longer\x20matches\x20the\x20reviewed\x20target\x20facts.',_0x4a9b92(0x21e));return _0x53f5eb;});}export function assertMenuDeletePlanExecutable(_0x2d356d,_0x2557e2,_0x2a7a91=new Date()){const _0x20f7cb=a112_0x455e8b;if(_0x2d356d[_0x20f7cb(0x1ff)]!==_0x2557e2)throw menuError(_0x20f7cb(0x213),_0x20f7cb(0x1d2)+JSON[_0x20f7cb(0x22d)](_0x2d356d[_0x20f7cb(0x1ff)])+_0x20f7cb(0x20c)+JSON['stringify'](_0x2557e2)+'.');const _0x182161=Date['parse'](_0x2d356d[_0x20f7cb(0x20a)]),_0x56cfd2=Date[_0x20f7cb(0x1f5)](_0x2d356d[_0x20f7cb(0x202)]);if(!Number[_0x20f7cb(0x225)](_0x182161)||!Number[_0x20f7cb(0x225)](_0x56cfd2)||_0x56cfd2-_0x182161!==PLAN_TTL_MS)throw menuError('menu_plan_invalid',_0x20f7cb(0x232));if(_0x182161>_0x2a7a91[_0x20f7cb(0x208)]())throw menuError(_0x20f7cb(0x1e1),'Menu\x20delete\x20plan\x20creation\x20time\x20'+_0x2d356d[_0x20f7cb(0x20a)]+_0x20f7cb(0x1f3),'Generate\x20a\x20new\x20plan\x20on\x20a\x20machine\x20with\x20a\x20correct\x20system\x20clock.');if(_0x2a7a91[_0x20f7cb(0x208)]()>_0x56cfd2)throw menuError(_0x20f7cb(0x1d0),_0x20f7cb(0x1f6)+_0x2d356d[_0x20f7cb(0x202)]+'.','Generate\x20and\x20review\x20a\x20new\x20plan\x20before\x20deleting.');}function fingerprint(_0x19aa08){const _0xed0d8e=a112_0x455e8b;return{'id':_0x19aa08['id'],'parentId':_0x19aa08[_0xed0d8e(0x20b)],'depth':_0x19aa08[_0xed0d8e(0x219)],'label':_0x19aa08[_0xed0d8e(0x1fe)],'path':_0x19aa08[_0xed0d8e(0x22e)],'type':_0x19aa08[_0xed0d8e(0x201)],'visible':_0x19aa08[_0xed0d8e(0x206)],'sort':_0x19aa08[_0xed0d8e(0x20d)],'pageId':_0x19aa08['pageId'],'pageType':_0x19aa08[_0xed0d8e(0x229)],'modelType':_0x19aa08['modelType'],'datasetId':_0x19aa08[_0xed0d8e(0x1e5)],'datasetCode':_0x19aa08[_0xed0d8e(0x236)],'childrenIds':[..._0x19aa08[_0xed0d8e(0x1ef)]],'childrenCount':_0x19aa08[_0xed0d8e(0x21d)],'resourcesValid':_0x19aa08[_0xed0d8e(0x228)],'resourcesHash':hashValue(_0x19aa08[_0xed0d8e(0x1f7)]),'extendHash':hashValue(_0x19aa08[_0xed0d8e(0x220)]??null),'updateTime':_0x19aa08[_0xed0d8e(0x1ec)]};}function hashValue(_0x1d2c33){const _0x5ad83d=a112_0x455e8b;return createHash(_0x5ad83d(0x1fd))[_0x5ad83d(0x21b)](JSON[_0x5ad83d(0x22d)](_0x1d2c33))['digest'](_0x5ad83d(0x22c));}function sameFingerprint(_0x53395c,_0x30d07b){const _0x252e3c=a112_0x455e8b;return JSON[_0x252e3c(0x22d)](_0x53395c)===JSON[_0x252e3c(0x22d)](_0x30d07b);}function resolvePlanPath(_0x1b5453,_0x3a1baa){const _0x32ef4a=a112_0x455e8b,_0x296b19=_0x1b5453[_0x32ef4a(0x1e9)]();if(!_0x296b19)throw menuError(_0x32ef4a(0x1e1),'--'+_0x3a1baa+'\x20requires\x20a\x20non-empty\x20file\x20path.');return resolve(_0x296b19);}function isMenuDeletePlanFile(_0x4b6093){const _0x536009=a112_0x455e8b;if(!isRecord(_0x4b6093))return![];return _0x4b6093[_0x536009(0x1ee)]===PLAN_VERSION&&_0x4b6093[_0x536009(0x21a)]===PLAN_COMMAND&&typeof _0x4b6093['appCode']==='string'&&_0x4b6093['appCode'][_0x536009(0x1d1)]>0x0&&typeof _0x4b6093[_0x536009(0x20a)]==='string'&&typeof _0x4b6093[_0x536009(0x202)]==='string'&&typeof _0x4b6093[_0x536009(0x1d5)]===_0x536009(0x230)&&/^sha256:[a-f0-9]{64}$/['test'](_0x4b6093[_0x536009(0x1d5)])&&typeof _0x4b6093[_0x536009(0x217)]===_0x536009(0x224)&&isMenuFact(_0x4b6093[_0x536009(0x21f)])&&isTargetFingerprint(_0x4b6093[_0x536009(0x204)])&&Array[_0x536009(0x1ea)](_0x4b6093[_0x536009(0x1dc)])&&_0x4b6093[_0x536009(0x1dc)][_0x536009(0x1d1)]>0x0&&_0x4b6093[_0x536009(0x1dc)][_0x536009(0x209)](isMenuFact)&&Array[_0x536009(0x1ea)](_0x4b6093[_0x536009(0x221)])&&_0x4b6093[_0x536009(0x221)][_0x536009(0x1d1)]===_0x4b6093[_0x536009(0x1dc)][_0x536009(0x1d1)]&&_0x4b6093[_0x536009(0x221)][_0x536009(0x209)](isTargetFingerprint)&&Array[_0x536009(0x1ea)](_0x4b6093[_0x536009(0x234)])&&_0x4b6093[_0x536009(0x234)][_0x536009(0x1d1)]===_0x4b6093[_0x536009(0x1dc)]['length']&&_0x4b6093[_0x536009(0x234)]['every'](isPositiveInteger)&&new Set(_0x4b6093[_0x536009(0x234)])[_0x536009(0x222)]===_0x4b6093[_0x536009(0x234)][_0x536009(0x1d1)]&&_0x4b6093['targets'][_0x536009(0x209)]((_0x55c33e,_0x2cc5c3)=>_0x55c33e['id']===_0x4b6093[_0x536009(0x234)][_0x2cc5c3])&&_0x4b6093[_0x536009(0x1dc)][_0x4b6093['targets'][_0x536009(0x1d1)]-0x1]?.['id']===_0x4b6093[_0x536009(0x21f)]['id']&&isRecord(_0x4b6093[_0x536009(0x1dd)])&&Array[_0x536009(0x1ea)](_0x4b6093[_0x536009(0x1dd)][_0x536009(0x1d8)])&&_0x4b6093[_0x536009(0x1dd)][_0x536009(0x1d8)][_0x536009(0x209)](isPositiveInteger)&&typeof _0x4b6093[_0x536009(0x1dd)][_0x536009(0x1f9)]==='boolean'&&Array[_0x536009(0x1ea)](_0x4b6093['warnings'])&&_0x4b6093[_0x536009(0x211)]['every'](_0x283477=>typeof _0x283477===_0x536009(0x230));}function isMenuFact(_0x235400){const _0x18a6a7=a112_0x455e8b;if(!isRecord(_0x235400))return![];return isPositiveInteger(_0x235400['id'])&&(_0x235400[_0x18a6a7(0x20b)]===null||isPositiveInteger(_0x235400[_0x18a6a7(0x20b)]))&&Number[_0x18a6a7(0x1d7)](_0x235400[_0x18a6a7(0x219)])&&_0x235400['depth']>=0x0&&typeof _0x235400['label']===_0x18a6a7(0x230)&&typeof _0x235400[_0x18a6a7(0x22e)]===_0x18a6a7(0x230)&&typeof _0x235400[_0x18a6a7(0x201)]==='string'&&(_0x235400[_0x18a6a7(0x206)]===null||typeof _0x235400[_0x18a6a7(0x206)]===_0x18a6a7(0x224))&&(_0x235400[_0x18a6a7(0x20d)]===null||Number[_0x18a6a7(0x1d7)](_0x235400[_0x18a6a7(0x20d)]))&&Array[_0x18a6a7(0x1ea)](_0x235400[_0x18a6a7(0x1f7)])&&_0x235400[_0x18a6a7(0x1f7)]['every'](_0x36f1a4=>typeof _0x36f1a4===_0x18a6a7(0x230))&&typeof _0x235400[_0x18a6a7(0x228)]==='boolean'&&Array[_0x18a6a7(0x1ea)](_0x235400[_0x18a6a7(0x1ef)])&&_0x235400['childrenIds'][_0x18a6a7(0x209)](isPositiveInteger)&&Number['isInteger'](_0x235400['childrenCount'])&&_0x235400[_0x18a6a7(0x21d)]>=0x0&&(_0x235400['pageId']===null||isPositiveInteger(_0x235400[_0x18a6a7(0x22b)]))&&typeof _0x235400['pageType']===_0x18a6a7(0x230)&&typeof _0x235400[_0x18a6a7(0x237)]==='string'&&(_0x235400[_0x18a6a7(0x1e5)]===null||isPositiveInteger(_0x235400[_0x18a6a7(0x1e5)]))&&typeof _0x235400[_0x18a6a7(0x236)]===_0x18a6a7(0x230)&&(_0x235400[_0x18a6a7(0x226)]===null||typeof _0x235400[_0x18a6a7(0x226)]===_0x18a6a7(0x230))&&(_0x235400[_0x18a6a7(0x214)]===null||typeof _0x235400[_0x18a6a7(0x214)]===_0x18a6a7(0x230))&&(_0x235400[_0x18a6a7(0x1ec)]===null||typeof _0x235400[_0x18a6a7(0x1ec)]==='string'||typeof _0x235400['updateTime']==='number')&&(_0x235400[_0x18a6a7(0x220)]===undefined||_0x235400[_0x18a6a7(0x220)]===null||isRecord(_0x235400[_0x18a6a7(0x220)]));}function a112_0x24f8(_0x25efbb,_0x38777c){_0x25efbb=_0x25efbb-0x1ce;const _0x21c78b=a112_0x21c7();let _0x24f852=_0x21c78b[_0x25efbb];return _0x24f852;}function isTargetFingerprint(_0x332cc5){const _0x4b57af=a112_0x455e8b;if(!isRecord(_0x332cc5))return![];return isPositiveInteger(_0x332cc5['id'])&&(_0x332cc5['parentId']===null||isPositiveInteger(_0x332cc5[_0x4b57af(0x20b)]))&&Number[_0x4b57af(0x1d7)](_0x332cc5[_0x4b57af(0x219)])&&_0x332cc5[_0x4b57af(0x219)]>=0x0&&typeof _0x332cc5[_0x4b57af(0x1fe)]===_0x4b57af(0x230)&&typeof _0x332cc5[_0x4b57af(0x22e)]===_0x4b57af(0x230)&&typeof _0x332cc5[_0x4b57af(0x201)]===_0x4b57af(0x230)&&(_0x332cc5[_0x4b57af(0x206)]===null||typeof _0x332cc5[_0x4b57af(0x206)]===_0x4b57af(0x224))&&(_0x332cc5[_0x4b57af(0x20d)]===null||Number[_0x4b57af(0x1d7)](_0x332cc5['sort']))&&(_0x332cc5[_0x4b57af(0x22b)]===null||isPositiveInteger(_0x332cc5[_0x4b57af(0x22b)]))&&typeof _0x332cc5['pageType']==='string'&&typeof _0x332cc5['modelType']==='string'&&(_0x332cc5['datasetId']===null||isPositiveInteger(_0x332cc5[_0x4b57af(0x1e5)]))&&typeof _0x332cc5[_0x4b57af(0x236)]===_0x4b57af(0x230)&&Array[_0x4b57af(0x1ea)](_0x332cc5['childrenIds'])&&_0x332cc5[_0x4b57af(0x1ef)]['every'](isPositiveInteger)&&Number['isInteger'](_0x332cc5[_0x4b57af(0x21d)])&&_0x332cc5[_0x4b57af(0x21d)]>=0x0&&typeof _0x332cc5['resourcesValid']===_0x4b57af(0x224)&&typeof _0x332cc5['resourcesHash']===_0x4b57af(0x230)&&/^[a-f0-9]{64}$/[_0x4b57af(0x223)](_0x332cc5[_0x4b57af(0x22f)])&&typeof _0x332cc5['extendHash']===_0x4b57af(0x230)&&/^[a-f0-9]{64}$/[_0x4b57af(0x223)](_0x332cc5[_0x4b57af(0x1e6)])&&(_0x332cc5[_0x4b57af(0x1ec)]===null||typeof _0x332cc5[_0x4b57af(0x1ec)]===_0x4b57af(0x230)||typeof _0x332cc5[_0x4b57af(0x1ec)]===_0x4b57af(0x1ce));}function isRecord(_0x2c57fd){const _0x3279de=a112_0x455e8b;return typeof _0x2c57fd===_0x3279de(0x1e8)&&_0x2c57fd!==null&&!Array[_0x3279de(0x1ea)](_0x2c57fd);}function isPositiveInteger(_0x504ef9){const _0x124ba0=a112_0x455e8b;return Number[_0x124ba0(0x1e4)](_0x504ef9)&&Number(_0x504ef9)>0x0;}function errorMessage(_0x455fc9){const _0x96382d=a112_0x455e8b;return _0x455fc9 instanceof Error?_0x455fc9[_0x96382d(0x1de)]:String(_0x455fc9);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x393148,_0x1e6317){const _0x5c2fab=a113_0x4634,_0x1c5a70=_0x393148();while(!![]){try{const _0x360fd2=parseInt(_0x5c2fab(0x20c))/0x1*(-parseInt(_0x5c2fab(0x1f4))/0x2)+-parseInt(_0x5c2fab(0x1f7))/0x3+parseInt(_0x5c2fab(0x1f0))/0x4+-parseInt(_0x5c2fab(0x216))/0x5*(parseInt(_0x5c2fab(0x211))/0x6)+-parseInt(_0x5c2fab(0x212))/0x7+parseInt(_0x5c2fab(0x1f1))/0x8*(parseInt(_0x5c2fab(0x201))/0x9)+parseInt(_0x5c2fab(0x203))/0xa;if(_0x360fd2===_0x1e6317)break;else _0x1c5a70['push'](_0x1c5a70['shift']());}catch(_0x110ad6){_0x1c5a70['push'](_0x1c5a70['shift']());}}}(a113_0x1f8b,0xbf1da));import{createHash}from'node:crypto';import{getMenuTree}from'../../../core/api-client.js';function a113_0x4634(_0x32ff9a,_0x4dad72){_0x32ff9a=_0x32ff9a-0x1ed;const _0x1f8bc2=a113_0x1f8b();let _0x46345e=_0x1f8bc2[_0x32ff9a];return _0x46345e;}export async function fetchMenuSnapshot(_0x32ad6b,_0x53a87a,_0x4edba7={}){const _0x2be25f=a113_0x4634,_0x370f43=await getMenuTree(_0x32ad6b,_0x53a87a);return buildMenuSnapshot(Array[_0x2be25f(0x202)](_0x370f43)?_0x370f43:[],_0x4edba7);}export function buildMenuSnapshot(_0x9d95db,_0x5662f3={}){const _0x38a075=a113_0x4634,_0x2d54f1=flattenMenuItems(_0x9d95db,{'verbose':_0x5662f3['verbose']===!![],'parentId':null,'depth':0x0}),_0x1ff2fe=new Map(_0x2d54f1['map'](_0x157ee7=>[_0x157ee7['id'],_0x157ee7])),_0x4653d0=createHash(_0x38a075(0x218))[_0x38a075(0x1ee)](JSON[_0x38a075(0x1f3)](_0x2d54f1['map'](toHashInput)))[_0x38a075(0x208)](_0x38a075(0x1f6));return{'total':_0x2d54f1['length'],'hash':'sha256:'+_0x4653d0,'menus':_0x2d54f1,'byId':_0x1ff2fe};}export function toProcessedMenuItem(_0x49cb5c){const _0x2c90d0=a113_0x4634;return{'id':_0x49cb5c['id'],'path':_0x49cb5c[_0x2c90d0(0x1fc)],'label':_0x49cb5c['label'],'resources':[..._0x49cb5c[_0x2c90d0(0x200)]],'extend':_0x49cb5c[_0x2c90d0(0x214)]??null};}export function toMenuListItem(_0xfde1b6){const {modelType:_0x2f0f50,datasetId:_0x26b43e,datasetCode:_0x2d2f42,resourcesValid:_0x12e9f7,..._0x17b5ee}=_0xfde1b6;return _0x17b5ee;}function a113_0x1f8b(){const _0x59454d=['datasetCode','string','digest','updateUserId','filter','length','11PtRBna','updateUserName','number','label','type','5982tsLfbA','331212LjvxUm','visible','extend','isFinite','3295peGCeO','parentId','sha256','push','POSITIVE_INFINITY','pageType','parse','sort','verbose','update','item','30112erBbev','756192klrvRs','map','stringify','231664GqxviU','values','hex','1584549bQoJwA','index','boolean','datasetId','children','path','modelType','url','pageId','resources','9BCGspi','isArray','31874320vehApF','menus','valid'];a113_0x1f8b=function(){return _0x59454d;};return a113_0x1f8b();}export function getChildren(_0x235a15,_0x28b559){const _0x539bd8=a113_0x4634;return _0x235a15[_0x539bd8(0x204)][_0x539bd8(0x20a)](_0x34a4=>_0x34a4[_0x539bd8(0x217)]===_0x28b559);}function flattenMenuItems(_0x156806,_0x3d0072){const _0x351a9a=a113_0x4634,_0xd170ae=sortMenuItems(_0x156806),_0x3f7da4=[];for(const _0x6366b9 of _0xd170ae){const _0x1518d5=sortMenuItems(Array[_0x351a9a(0x202)](_0x6366b9[_0x351a9a(0x1fb)])?_0x6366b9[_0x351a9a(0x1fb)]:[]);_0x3f7da4[_0x351a9a(0x219)](toMenuFact(_0x6366b9,_0x1518d5,_0x3d0072)),_0x1518d5[_0x351a9a(0x20b)]>0x0&&_0x3f7da4['push'](...flattenMenuItems(_0x1518d5,{'verbose':_0x3d0072[_0x351a9a(0x1ed)],'parentId':_0x6366b9['id'],'depth':_0x3d0072['depth']+0x1}));}return _0x3f7da4;}function sortMenuItems(_0xcae15f){const _0x1a0429=a113_0x4634;return _0xcae15f['map']((_0xc22cd7,_0x22e1b9)=>({'item':_0xc22cd7,'index':_0x22e1b9}))['sort']((_0x4cc98d,_0x5a2a45)=>{const _0x102b4a=a113_0x4634,_0x49c739=normalizeSort(_0x4cc98d[_0x102b4a(0x1ef)][_0x102b4a(0x21d)]),_0x3d6c6d=normalizeSort(_0x5a2a45[_0x102b4a(0x1ef)]['sort']);if(_0x49c739!==_0x3d6c6d)return _0x49c739-_0x3d6c6d;return _0x4cc98d[_0x102b4a(0x1f8)]-_0x5a2a45[_0x102b4a(0x1f8)];})[_0x1a0429(0x1f2)](({item:_0x8b9aa9})=>_0x8b9aa9);}function toMenuFact(_0x3cb8d0,_0x577669,_0x349f1e){const _0x575f0b=a113_0x4634,_0xd1b737=normalizeResourceValue(_0x3cb8d0[_0x575f0b(0x214)]?.[_0x575f0b(0x200)]),_0x8450fd={'id':_0x3cb8d0['id'],'parentId':_0x349f1e['parentId'],'depth':_0x349f1e['depth'],'label':normalizeString(_0x3cb8d0[_0x575f0b(0x20f)]),'path':normalizeString(_0x3cb8d0['path']),'url':normalizeString(_0x3cb8d0['url']),'type':normalizeString(_0x3cb8d0[_0x575f0b(0x210)]),'visible':typeof _0x3cb8d0[_0x575f0b(0x213)]===_0x575f0b(0x1f9)?_0x3cb8d0[_0x575f0b(0x213)]:null,'sort':typeof _0x3cb8d0[_0x575f0b(0x21d)]==='number'&&Number[_0x575f0b(0x215)](_0x3cb8d0['sort'])?_0x3cb8d0[_0x575f0b(0x21d)]:null,'resources':_0xd1b737[_0x575f0b(0x1f5)],'resourcesValid':_0xd1b737[_0x575f0b(0x205)],'childrenIds':_0x577669[_0x575f0b(0x1f2)](_0x410374=>_0x410374['id']),'childrenCount':_0x577669[_0x575f0b(0x20b)],'pageId':normalizeNullableNumber(_0x3cb8d0['pageId']),'pageType':normalizeString(_0x3cb8d0[_0x575f0b(0x21b)]),'modelType':normalizeString(_0x3cb8d0[_0x575f0b(0x1fd)]),'datasetId':normalizeNullableNumber(_0x3cb8d0[_0x575f0b(0x1fa)]),'datasetCode':normalizeString(_0x3cb8d0[_0x575f0b(0x206)]),'updateUserId':normalizeNullableString(_0x3cb8d0['updateUserId']),'updateUserName':normalizeNullableString(_0x3cb8d0[_0x575f0b(0x20d)]),'updateTime':normalizeNullableTimestamp(_0x3cb8d0['updateTime'])};return _0x349f1e[_0x575f0b(0x1ed)]&&(_0x8450fd[_0x575f0b(0x214)]=_0x3cb8d0[_0x575f0b(0x214)]??null),_0x8450fd;}function toHashInput(_0x2b4a0a){const _0x310a77=a113_0x4634;return{'id':_0x2b4a0a['id'],'parentId':_0x2b4a0a[_0x310a77(0x217)],'label':_0x2b4a0a[_0x310a77(0x20f)],'path':_0x2b4a0a[_0x310a77(0x1fc)],'url':_0x2b4a0a[_0x310a77(0x1fe)],'type':_0x2b4a0a[_0x310a77(0x210)],'visible':_0x2b4a0a[_0x310a77(0x213)],'sort':_0x2b4a0a[_0x310a77(0x21d)],'resources':_0x2b4a0a[_0x310a77(0x200)],'resourcesValid':_0x2b4a0a['resourcesValid'],'childrenIds':_0x2b4a0a['childrenIds'],'pageId':_0x2b4a0a[_0x310a77(0x1ff)],'pageType':_0x2b4a0a[_0x310a77(0x21b)],'modelType':_0x2b4a0a[_0x310a77(0x1fd)],'datasetId':_0x2b4a0a['datasetId'],'datasetCode':_0x2b4a0a[_0x310a77(0x206)],'updateUserId':_0x2b4a0a[_0x310a77(0x209)],'updateUserName':_0x2b4a0a['updateUserName'],'updateTime':_0x2b4a0a['updateTime']};}function normalizeSort(_0x1aaf2c){const _0x5e51c9=a113_0x4634;return typeof _0x1aaf2c==='number'&&Number[_0x5e51c9(0x215)](_0x1aaf2c)?_0x1aaf2c:Number[_0x5e51c9(0x21a)];}function normalizeString(_0x42352d){const _0x26b71c=a113_0x4634;return typeof _0x42352d===_0x26b71c(0x207)?_0x42352d:'';}function normalizeNullableNumber(_0x59baba){const _0x617dd=a113_0x4634;return typeof _0x59baba===_0x617dd(0x20e)&&Number[_0x617dd(0x215)](_0x59baba)?_0x59baba:null;}function normalizeNullableString(_0x2bb1dc){return typeof _0x2bb1dc==='string'&&_0x2bb1dc['length']>0x0?_0x2bb1dc:null;}function normalizeNullableTimestamp(_0x52d13c){const _0x402d4d=a113_0x4634;if(typeof _0x52d13c===_0x402d4d(0x207))return _0x52d13c[_0x402d4d(0x20b)]>0x0?_0x52d13c:null;return typeof _0x52d13c===_0x402d4d(0x20e)&&Number['isFinite'](_0x52d13c)?_0x52d13c:null;}export function normalizeResources(_0x2b7d04){const _0x5b218c=a113_0x4634;return normalizeResourceValue(_0x2b7d04)[_0x5b218c(0x1f5)];}function normalizeResourceValue(_0x5d85e4){const _0x1e1d65=a113_0x4634;if(_0x5d85e4==null)return{'values':[],'valid':!![]};if(Array['isArray'](_0x5d85e4))return{'values':_0x5d85e4['map'](String),'valid':!![]};if(typeof _0x5d85e4!=='string')return{'values':[],'valid':![]};try{const _0x23104c=JSON[_0x1e1d65(0x21c)](_0x5d85e4);return Array['isArray'](_0x23104c)?{'values':_0x23104c['map'](String),'valid':!![]}:{'values':[],'valid':![]};}catch{return{'values':[],'valid':![]};}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a114_0x3344(_0x1963b7,_0x284e76){_0x1963b7=_0x1963b7-0x13a;var _0x16cefe=a114_0x16ce();var _0x334408=_0x16cefe[_0x1963b7];return _0x334408;}(function(_0xa7ad11,_0x1d0c7e){var _0x58cbb2=a114_0x3344,_0x3f3a9d=_0xa7ad11();while(!![]){try{var _0x54a234=-parseInt(_0x58cbb2(0x13a))/0x1+parseInt(_0x58cbb2(0x13b))/0x2+parseInt(_0x58cbb2(0x13e))/0x3+-parseInt(_0x58cbb2(0x13c))/0x4+parseInt(_0x58cbb2(0x13f))/0x5+-parseInt(_0x58cbb2(0x13d))/0x6+parseInt(_0x58cbb2(0x140))/0x7;if(_0x54a234===_0x1d0c7e)break;else _0x3f3a9d['push'](_0x3f3a9d['shift']());}catch(_0x1b8bce){_0x3f3a9d['push'](_0x3f3a9d['shift']());}}}(a114_0x16ce,0x5fb01));export*from'../../../commands/menu/shared/types.js';export*from'../../../commands/menu/shared/logic.js';export*from'../../../commands/menu/shared/compare-table.js';export*from'../../../commands/menu/shared/inquirer.js';function a114_0x16ce(){var _0x5ad626=['1092936TzbFDL','3800514dXeoZT','41466LFIYck','3132310OIDALb','4662700EOvtYN','321237xAKHWv','626886ybRhKY'];a114_0x16ce=function(){return _0x5ad626;};return a114_0x16ce();}export*from'../../../commands/menu/shared/valid-url.js';export*from'../../../commands/menu/shared/local-pages.js';export*from'../../../commands/menu/shared/service.js';export*from'../../../commands/menu/shared/sync-core.js';export*from'../../../commands/menu/shared/update-core.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2bb5d5,_0x2a7375){const _0x5664c6=a115_0x9f82,_0x8e86f5=_0x2bb5d5();while(!![]){try{const _0x381b79=-parseInt(_0x5664c6(0x17f))/0x1*(parseInt(_0x5664c6(0x15a))/0x2)+-parseInt(_0x5664c6(0x16c))/0x3*(parseInt(_0x5664c6(0x166))/0x4)+-parseInt(_0x5664c6(0x15d))/0x5+-parseInt(_0x5664c6(0x181))/0x6*(-parseInt(_0x5664c6(0x16e))/0x7)+parseInt(_0x5664c6(0x17a))/0x8*(-parseInt(_0x5664c6(0x164))/0x9)+-parseInt(_0x5664c6(0x15c))/0xa+-parseInt(_0x5664c6(0x160))/0xb*(-parseInt(_0x5664c6(0x183))/0xc);if(_0x381b79===_0x2a7375)break;else _0x8e86f5['push'](_0x8e86f5['shift']());}catch(_0x3e63f8){_0x8e86f5['push'](_0x8e86f5['shift']());}}}(a115_0x1d22,0x60e68));import a115_0xac4672 from'chalk';import{checkbox,input,confirm}from'@inquirer/prompts';import a115_0x1973ed from'ora';import{isUrlReachable}from'../../../commands/menu/shared/valid-url.js';import{CliErrors}from'../../../errors.js';function onCancel(_0x5c5473){const _0x3134d0=a115_0x9f82;return _0x5c5473[_0x3134d0(0x15e)](_0x5deb72=>{const _0x30439d=_0x3134d0;if(_0x5deb72?.[_0x30439d(0x182)]===_0x30439d(0x172))throw CliErrors[_0x30439d(0x171)](_0x30439d(0x173));throw _0x5deb72;});}export function startSpinner(_0x5770b9){const _0xd6d6db=a115_0x9f82;return a115_0x1973ed({'text':_0x5770b9,'color':_0xd6d6db(0x167)})[_0xd6d6db(0x17c)]();}function a115_0x9f82(_0x531347,_0x3b9f00){_0x531347=_0x531347-0x15a;const _0x1d22b6=a115_0x1d22();let _0x9f82a7=_0x1d22b6[_0x531347];return _0x9f82a7;}export function stopSpinner(_0x59a55a,_0x1c0df6,_0x5674d6){const _0x1c58cf=a115_0x9f82;_0x5674d6?_0x59a55a[_0x1c58cf(0x169)](_0x1c0df6):_0x59a55a['fail'](_0x1c0df6);}export async function askConfirm(_0x14a4a7){return onCancel(confirm({'message':_0x14a4a7,'theme':{'prefix':''}}));}function a115_0x1d22(){const _0x200e43=['label','24lEKvHO','gray','start','has','filter','4RynRga','\x20\x20✗\x20CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','2082OliSIS','name','12DlgweW','path','\x20\x20✗\x20JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','error','No\x20local\x20pages\x20found.','length','180656nGwAOL','isTTY','7136760LeTCNp','3252975SPilqC','catch','\x20\x20Checking\x20JS\x20URL\x20reachability...','18956817ztPKET','No\x20menus\x20selected.','test','JS\x20URL\x20check\x20failed','612558VgaqwO','CSS\x20URL\x20check\x20failed','203716tmFoMj','cyan','This\x20command\x20requires\x20an\x20interactive\x20terminal.\x20','succeed','\x20\x20Select\x20menus\x20to\x20sync\x20(space\x20to\x20toggle,\x20a=all,\x20i=invert):','[already\x20on\x20platform]','9RyRSvx','\x20\x20✗\x20JS\x20URL\x20is\x20unreachable','15253lfUEUC','red','[new]','cancelled','ExitPromptError','Cancelled.','Use\x20--yes\x20to\x20run\x20in\x20non-interactive\x20mode,\x20or\x20pipe\x20data\x20via\x20--params.','trim','\x20\x20JS\x20URL:','stdin','CSS\x20URL\x20checked'];a115_0x1d22=function(){return _0x200e43;};return a115_0x1d22();}export async function askJsUrl(_0x20ca85){const _0x27fda3=a115_0x9f82;while(!![]){const _0x58199b=await onCancel(input({'message':_0x27fda3(0x176),'default':_0x20ca85,'theme':{'prefix':''}}));if(_0x58199b[_0x27fda3(0x175)]()==='')throw CliErrors['cancelled'](_0x27fda3(0x173));if(!/^https:\/\/.+\.js(\?.*)?$/[_0x27fda3(0x162)](_0x58199b[_0x27fda3(0x175)]())){console[_0x27fda3(0x186)](a115_0xac4672[_0x27fda3(0x16f)](_0x27fda3(0x185)));continue;}const _0x447ecb=startSpinner(_0x27fda3(0x15f));try{const _0x1fec20=await isUrlReachable(_0x58199b['trim']());stopSpinner(_0x447ecb,'JS\x20URL\x20checked',_0x1fec20);if(!_0x1fec20){console[_0x27fda3(0x186)](a115_0xac4672[_0x27fda3(0x16f)](_0x27fda3(0x16d)));continue;}return _0x58199b['trim']();}catch(_0x57c9f5){stopSpinner(_0x447ecb,_0x27fda3(0x163),![]);throw _0x57c9f5;}}}export async function askCssUrl(_0x515cb6){const _0x1fe259=a115_0x9f82;while(!![]){const _0x312e4a=await onCancel(input({'message':'\x20\x20CSS\x20URL:','default':_0x515cb6,'theme':{'prefix':''}}));if(_0x312e4a[_0x1fe259(0x175)]()==='')throw CliErrors[_0x1fe259(0x171)]('Cancelled.');if(!/^https:\/\/.+\.css(\?.*)?$/[_0x1fe259(0x162)](_0x312e4a[_0x1fe259(0x175)]())){console['error'](a115_0xac4672['red'](_0x1fe259(0x180)));continue;}const _0x76fbd2=startSpinner('\x20\x20Checking\x20CSS\x20URL\x20reachability...');try{const _0x542a55=await isUrlReachable(_0x312e4a[_0x1fe259(0x175)]());stopSpinner(_0x76fbd2,_0x1fe259(0x178),_0x542a55);if(!_0x542a55){console[_0x1fe259(0x186)](a115_0xac4672[_0x1fe259(0x16f)]('\x20\x20✗\x20CSS\x20URL\x20is\x20unreachable'));continue;}return _0x312e4a['trim']();}catch(_0x2ab837){stopSpinner(_0x76fbd2,_0x1fe259(0x165),![]);throw _0x2ab837;}}}export async function selectPages(_0x53fbf9,_0x21d278){const _0x2513fc=a115_0x9f82,_0x2d90ea=_0x53fbf9['map'](_0x2138c5=>{const _0x233245=a115_0x9f82,_0x1e14d5=_0x21d278[_0x233245(0x17d)](_0x2138c5[_0x233245(0x184)]);return{'name':_0x2138c5[_0x233245(0x179)]+'\x20\x20'+a115_0xac4672[_0x233245(0x17b)](_0x2138c5[_0x233245(0x184)])+'\x20\x20'+(_0x1e14d5?a115_0xac4672[_0x233245(0x17b)](_0x233245(0x16b)):a115_0xac4672['green'](_0x233245(0x170))),'value':_0x2138c5[_0x233245(0x184)],'checked':!_0x1e14d5,'disabled':_0x1e14d5};});if(_0x2d90ea['length']===0x0)throw new Error(_0x2513fc(0x187));const _0x571b18=await onCancel(checkbox({'message':_0x2513fc(0x16a),'choices':_0x2d90ea,'loop':![],'theme':{'prefix':''}}));if(_0x571b18[_0x2513fc(0x188)]===0x0)throw new Error(_0x2513fc(0x161));return _0x53fbf9[_0x2513fc(0x17e)](_0x3cee4e=>_0x571b18['includes'](_0x3cee4e['path']));}export function isInteractive(){const _0xc1d104=a115_0x9f82;return process[_0xc1d104(0x177)][_0xc1d104(0x15b)]===!![];}export function requireInteractive(){const _0x21436d=a115_0x9f82;if(!isInteractive())throw new Error(_0x21436d(0x168)+_0x21436d(0x174));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a116_0x26bfac=a116_0x4e9f;function a116_0x49dc(){const _0x56b449=['src/pages','isDirectory','273138PyZkwZ','forEach','1301229EVcbGA','391119mYVNiA','372704UZWGjd','split','replace','44745uEyqhv','cwd','endsWith','102003VxToDq','28LwKAVI','join','63862NBOdDp','filter','.tsx','28ldxOxW','\x5c.displayName\x5cs*=\x5cs*[\x22\x27]([^\x22\x27]+)[\x22\x27]','match','trim','index.tsx'];a116_0x49dc=function(){return _0x56b449;};return a116_0x49dc();}(function(_0x5d81d6,_0xa3197d){const _0x294f1b=a116_0x4e9f,_0x3335a6=_0x5d81d6();while(!![]){try{const _0x5de5a6=parseInt(_0x294f1b(0xa8))/0x1+parseInt(_0x294f1b(0xab))/0x2+parseInt(_0x294f1b(0xb8))/0x3+-parseInt(_0x294f1b(0xae))/0x4*(parseInt(_0x294f1b(0xa5))/0x5)+parseInt(_0x294f1b(0xb5))/0x6*(-parseInt(_0x294f1b(0xa9))/0x7)+-parseInt(_0x294f1b(0xb9))/0x8+parseInt(_0x294f1b(0xb7))/0x9;if(_0x5de5a6===_0xa3197d)break;else _0x3335a6['push'](_0x3335a6['shift']());}catch(_0x5cc615){_0x3335a6['push'](_0x3335a6['shift']());}}}(a116_0x49dc,0x1cb3d));import{readdirSync,statSync,readFileSync}from'fs';import{join,relative,resolve,sep}from'path';function a116_0x4e9f(_0x4145e7,_0x3b3774){_0x4145e7=_0x4145e7-0xa3;const _0x49dc1a=a116_0x49dc();let _0x4e9f90=_0x49dc1a[_0x4145e7];return _0x4e9f90;}const pagesDir=resolve(process[a116_0x26bfac(0xa6)](),a116_0x26bfac(0xb3));export function extractTitleFromComment(_0x588fb4){const _0x4e1825=a116_0x26bfac;try{const _0x440df6=readFileSync(_0x588fb4,'utf-8'),_0x93de03=_0x440df6[_0x4e1825(0xb0)](/^\s*\/\*\*?([\s\S]*?)\*\//);if(_0x93de03&&_0x93de03[0x1]){const _0x1268df=_0x93de03[0x1],_0x37d8cd=_0x1268df[_0x4e1825(0xb0)](/^\s*\*?\s*title\s*:\s*(.+)/im);if(_0x37d8cd&&_0x37d8cd[0x1])return _0x37d8cd[0x1][_0x4e1825(0xb1)]();}let _0x49248b=null;const _0x50ee32=_0x440df6[_0x4e1825(0xb0)](/export\s+default\s+([A-Z][a-zA-Z0-9]*)/);_0x50ee32&&_0x50ee32[0x1]&&(_0x49248b=_0x50ee32[0x1]);if(!_0x49248b){const _0x95657=_0x440df6['match'](/export\s+default\s+function\s+([A-Z][a-zA-Z0-9]*)/);_0x95657&&_0x95657[0x1]&&(_0x49248b=_0x95657[0x1]);}if(_0x49248b){const _0x1a3329=new RegExp('\x5cb'+_0x49248b+_0x4e1825(0xaf)),_0x478669=_0x440df6[_0x4e1825(0xb0)](_0x1a3329);if(_0x478669&&_0x478669[0x1])return _0x478669[0x1];return _0x49248b;}return null;}catch(_0x308775){return null;}}export function getLocalPages(_0x91eb8d=pagesDir,_0x36d52b=pagesDir){const _0x5eb3b7=a116_0x26bfac;let _0x81ff69=[];const _0x39ca40=readdirSync(_0x91eb8d);return _0x39ca40[_0x5eb3b7(0xb6)](_0x409050=>{const _0x43c321=_0x5eb3b7,_0x1fec9=join(_0x91eb8d,_0x409050),_0x25ab47=statSync(_0x1fec9);if(_0x25ab47&&_0x25ab47[_0x43c321(0xb4)]())_0x81ff69=_0x81ff69['concat'](getLocalPages(_0x1fec9,_0x36d52b));else{if(_0x409050[_0x43c321(0xa7)](_0x43c321(0xad))){let _0x3b6c16=relative(_0x36d52b,_0x1fec9);_0x3b6c16[_0x43c321(0xa7)](_0x43c321(0xb2))?_0x3b6c16=_0x3b6c16[_0x43c321(0xa4)](/index\.tsx$/,''):_0x3b6c16=_0x3b6c16[_0x43c321(0xa4)](/\.tsx$/,'');_0x3b6c16['endsWith'](sep)&&(_0x3b6c16=_0x3b6c16['slice'](0x0,-0x1));const _0x4e5788=_0x3b6c16[_0x43c321(0xa3)](sep)[_0x43c321(0xaa)]('/'),_0x5e9b00=extractTitleFromComment(_0x1fec9),_0x5195f8=_0x5e9b00||_0x4e5788;_0x81ff69['push']({'path':_0x4e5788['replaceAll']('$',':'),'label':_0x5195f8});}}}),_0x81ff69[_0x5eb3b7(0xac)](_0x4f955d=>_0x4f955d['path']!=='');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x555517,_0x56f029){const _0x1cc264=a117_0x1d36,_0x25e8fe=_0x555517();while(!![]){try{const _0x3c1887=-parseInt(_0x1cc264(0xb7))/0x1*(-parseInt(_0x1cc264(0xc2))/0x2)+parseInt(_0x1cc264(0xbd))/0x3+-parseInt(_0x1cc264(0xbc))/0x4+-parseInt(_0x1cc264(0xb2))/0x5+-parseInt(_0x1cc264(0xb4))/0x6*(parseInt(_0x1cc264(0xb5))/0x7)+parseInt(_0x1cc264(0xb3))/0x8+-parseInt(_0x1cc264(0xb1))/0x9*(-parseInt(_0x1cc264(0xb6))/0xa);if(_0x3c1887===_0x56f029)break;else _0x25e8fe['push'](_0x25e8fe['shift']());}catch(_0x5cded8){_0x25e8fe['push'](_0x25e8fe['shift']());}}}(a117_0x2f68,0x4e99c));import{getLocalPages}from'../../../commands/menu/shared/local-pages.js';import{getOnlineMenuList,createMenus}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';export function validateJsUrl(_0x30961a){const _0x1d8003=a117_0x1d36,_0x26dd3b=[];return!isValidJsHttpsUrl(_0x30961a)&&_0x26dd3b[_0x1d8003(0xb8)]('JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL'),{'ok':_0x26dd3b[_0x1d8003(0xba)]===0x0,'errors':_0x26dd3b};}export function validateCssUrl(_0x233545){const _0xdffedf=a117_0x1d36,_0x45f51a=[];return!isValidCssHttpsUrl(_0x233545)&&_0x45f51a[_0xdffedf(0xb8)](_0xdffedf(0xc0)),{'ok':_0x45f51a['length']===0x0,'errors':_0x45f51a};}export async function validateJsUrlReachable(_0x2c95f6){const _0x5e062f=a117_0x1d36,_0x5ec588=validateJsUrl(_0x2c95f6);if(!_0x5ec588['ok'])return _0x5ec588;const _0x180616=await isUrlReachable(_0x2c95f6);if(!_0x180616)_0x5ec588['errors']['push'](_0x5e062f(0xc3));return{'ok':_0x5ec588[_0x5e062f(0xbb)][_0x5e062f(0xba)]===0x0,'errors':_0x5ec588[_0x5e062f(0xbb)]};}export async function validateCssUrlReachable(_0x390168){const _0x3d5571=a117_0x1d36,_0x5a60ee=validateCssUrl(_0x390168);if(!_0x5a60ee['ok'])return _0x5a60ee;const _0x3c609c=await isUrlReachable(_0x390168);if(!_0x3c609c)_0x5a60ee[_0x3d5571(0xbb)][_0x3d5571(0xb8)]('CSS\x20URL\x20is\x20unreachable');return{'ok':_0x5a60ee['errors'][_0x3d5571(0xba)]===0x0,'errors':_0x5a60ee[_0x3d5571(0xbb)]};}function a117_0x1d36(_0x3bc7b0,_0x3225a0){_0x3bc7b0=_0x3bc7b0-0xb1;const _0x2f686c=a117_0x2f68();let _0x1d3685=_0x2f686c[_0x3bc7b0];return _0x1d3685;}export function buildCompareRows(_0x2e1d43,_0x50074c){const _0x201301=a117_0x1d36;return _0x2e1d43['map'](_0x472b1e=>({'label':_0x472b1e[_0x201301(0xbf)],'path':_0x472b1e[_0x201301(0xc1)],'local':!![],'online':_0x50074c[_0x201301(0xb9)](_0x472b1e[_0x201301(0xc1)])}));}export async function doCreateMenus(_0x521a3d,_0x4c19ba,_0x489c2f,_0x173697){const _0x22d186=a117_0x1d36,_0x1ca34d=await createMenus(_0x521a3d,_0x4c19ba,_0x489c2f,_0x173697);return{'created':_0x1ca34d[_0x22d186(0xba)],'failed':0x0,'labels':_0x489c2f[_0x22d186(0xbe)](_0x474071=>_0x474071[_0x22d186(0xbf)]),'menus':_0x1ca34d};}export function filterMenusWithResources(_0x464058){const _0x53abbd=a117_0x1d36;return _0x464058['filter'](_0x504132=>_0x504132['resources'][_0x53abbd(0xba)]>0x0);}export async function fetchMenuData(_0x584a7b,_0x1a7c76){const _0x2918e7=a117_0x1d36,_0x3a88e8=getLocalPages(),_0x367838=await getOnlineMenuList(_0x584a7b,_0x1a7c76),_0x435a79=new Set(_0x367838[_0x2918e7(0xbe)](_0x1fc2d0=>_0x1fc2d0[_0x2918e7(0xc1)]));return{'localPages':_0x3a88e8,'onlineMenuList':_0x367838,'onlinePaths':_0x435a79};}export async function fetchOnlineMenuList(_0x3b9fb1,_0x4083d2){return getOnlineMenuList(_0x3b9fb1,_0x4083d2);}function a117_0x2f68(){const _0x12fc26=['4093HQlWWn','push','has','length','errors','2181380GYqEPs','1658352sYiAPf','map','label','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','path','170PctPYb','JS\x20URL\x20is\x20unreachable','110952OovgNR','1657690RhEUvG','4125248FfsWXy','12qrjiAC','1883147ejOjNG','260ulFcar'];a117_0x2f68=function(){return _0x12fc26;};return a117_0x2f68();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a116_0x3a3f7b=a116_0x4435;(function(_0x4f2707,_0x3db567){const _0x613391=a116_0x4435,_0x4ef2bd=_0x4f2707();while(!![]){try{const _0xf05f5b=-parseInt(_0x613391(0x11f))/0x1+-parseInt(_0x613391(0x152))/0x2*(-parseInt(_0x613391(0x159))/0x3)+parseInt(_0x613391(0x133))/0x4*(parseInt(_0x613391(0x128))/0x5)+-parseInt(_0x613391(0x164))/0x6+-parseInt(_0x613391(0x146))/0x7*(-parseInt(_0x613391(0x102))/0x8)+parseInt(_0x613391(0x104))/0x9+-parseInt(_0x613391(0x140))/0xa;if(_0xf05f5b===_0x3db567)break;else _0x4ef2bd['push'](_0x4ef2bd['shift']());}catch(_0x57237b){_0x4ef2bd['push'](_0x4ef2bd['shift']());}}}(a116_0x299e,0xcaba4));import{CliError,CliErrors}from'../../../errors.js';import{fetchMenuSnapshot,getChildren}from'../../../commands/menu/shared/facts.js';export const MAX_MENU_SORT=0x7fffffff;export const MENU_ID_FLAG={'name':'id','type':a116_0x3a3f7b(0x108),'required':!![],'description':a116_0x3a3f7b(0x14c)};export const MENU_SORT_FLAG={'name':a116_0x3a3f7b(0x109),'type':a116_0x3a3f7b(0x108),'description':a116_0x3a3f7b(0x118)};export const MENU_PARENT_ID_FLAG={'name':a116_0x3a3f7b(0x13f),'type':a116_0x3a3f7b(0x11c),'description':'Parent\x20folder\x20id;\x20use\x20root\x20for\x20a\x20root-level\x20node'};export const MENU_EXPECT_PARENT_ID_FLAG={'name':a116_0x3a3f7b(0x11e),'type':a116_0x3a3f7b(0x11c),'description':a116_0x3a3f7b(0x113)};export const MENU_EXPECT_FLAGS=[MENU_EXPECT_PARENT_ID_FLAG,{'name':a116_0x3a3f7b(0x12a),'type':a116_0x3a3f7b(0x11c),'description':a116_0x3a3f7b(0x106)},{'name':a116_0x3a3f7b(0x158),'type':a116_0x3a3f7b(0x108),'description':a116_0x3a3f7b(0x120)}];export function validateExactId(_0x51d390){const _0xef268f=a116_0x3a3f7b,_0x421726=_0x51d390[_0xef268f(0x14b)]('id');if(!Number[_0xef268f(0x123)](_0x421726)||_0x421726<=0x0)throw CliErrors[_0xef268f(0x107)](_0xef268f(0x15e));return _0x421726;}export function validateSort(_0x114d35,_0x64c750=a116_0x3a3f7b(0x109)){const _0x544c25=a116_0x3a3f7b;if(!hasFlag(_0x114d35,_0x64c750))return undefined;const _0x42e5ae=_0x114d35['num'](_0x64c750);if(!Number[_0x544c25(0x123)](_0x42e5ae)||_0x42e5ae<0x0||_0x42e5ae>MAX_MENU_SORT)throw menuError(_0x544c25(0x10a),'--'+_0x64c750+'\x20must\x20be\x20an\x20integer\x20between\x200\x20and\x20'+MAX_MENU_SORT+'.',_0x544c25(0x148));return _0x42e5ae;}export function nextSiblingSort(_0x59fb41,_0xa80605,_0x31b8b5){const _0xaed73c=a116_0x3a3f7b,_0x5b20dc=getChildren(_0x59fb41,_0xa80605)[_0xaed73c(0x10b)](_0x26e460=>_0x26e460[_0xaed73c(0x109)])[_0xaed73c(0x10c)](_0xf7864=>typeof _0xf7864===_0xaed73c(0x108));if(_0x5b20dc[_0xaed73c(0x142)]===0x0)return 0x0;const _0x4f132f=Math['max'](..._0x5b20dc);if(_0x4f132f>=MAX_MENU_SORT)throw menuError(_0xaed73c(0x10d),'Cannot\x20append\x20a\x20'+_0x31b8b5+'\x20because\x20the\x20current\x20maximum\x20sibling\x20sort\x20is\x20'+_0x4f132f+'.',_0xaed73c(0x15f)+MAX_MENU_SORT+',\x20or\x20pass\x20an\x20explicit\x20--sort\x20value.');return _0x4f132f+0x1;}export function requireExplicitYes(_0x40ae4a){const _0x39707a=a116_0x3a3f7b;if(_0x40ae4a[_0x39707a(0x161)](_0x39707a(0x14a)))return;if(!_0x40ae4a[_0x39707a(0x161)](_0x39707a(0x132)))throw menuError(_0x39707a(0x105),'This\x20menu\x20mutation\x20requires\x20explicit\x20--yes.',_0x39707a(0x101));}export async function fetchMutationSnapshot(_0x50f640,_0x7bc79a,_0x55fddc){const _0x2a85a6=a116_0x3a3f7b;try{return await fetchMenuSnapshot(_0x50f640[_0x2a85a6(0x14f)],_0x50f640[_0x2a85a6(0x137)]);}catch(_0x410221){throw mapMenuApiError(_0x410221,_0x2a85a6(0x163)+_0x7bc79a,_0x55fddc);}}export async function recheckMutationSnapshot(_0x2d497e,_0x38ccf1,_0xba4748,_0x46a9e0){const _0x2097e9=a116_0x3a3f7b;let _0x4b8e20;try{_0x4b8e20=await fetchMenuSnapshot(_0x2d497e[_0x2097e9(0x14f)],_0x2d497e[_0x2097e9(0x137)]);}catch(_0x5d682e){const _0x15861a=mapMenuApiError(_0x5d682e,_0x2097e9(0x145)+_0xba4748,_0x46a9e0);throw menuFailure(_0x15861a,_0x38ccf1,{'stage':_0x2097e9(0x151),'failed':_0x46a9e0==null?{}:{'id':_0x46a9e0}});}if(_0x4b8e20[_0x2097e9(0x121)]!==_0x38ccf1[_0x2097e9(0x117)]){const _0xf02bd2=menuError('menu_state_drift',_0x2097e9(0x11d)+_0xba4748+_0x2097e9(0x12f),'Run\x20the\x20same\x20command\x20with\x20--dry-run\x20again\x20and\x20review\x20the\x20latest\x20snapshot\x20before\x20retrying.');throw menuFailure(_0xf02bd2,_0x38ccf1,{'stage':_0x2097e9(0x151),'failed':{..._0x46a9e0==null?{}:{'id':_0x46a9e0},'expectedSnapshotHash':_0x38ccf1[_0x2097e9(0x117)],'currentSnapshotHash':_0x4b8e20[_0x2097e9(0x121)]}});}return _0x4b8e20;}function a116_0x4435(_0x5546d7,_0x3160e1){_0x5546d7=_0x5546d7-0xfe;const _0x299e9e=a116_0x299e();let _0x44356a=_0x299e9e[_0x5546d7];return _0x44356a;}function a116_0x299e(){const _0x55ab9f=['hint','\x20must\x20be\x20a\x20positive\x20menu\x20id\x20or\x20root.','Abort\x20unless\x20the\x20current\x20parent\x20id\x20matches;\x20use\x20root\x20for\x20root\x20level','path','Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20to\x20inspect\x20the\x20latest\x20online\x20menu\x20state.','failed','snapshotHash','Sibling\x20sort\x20value\x20(non-negative\x20integer)','code','root','parentId','string','Online\x20menu\x20state\x20changed\x20before\x20','expect-parent-id','141410XtdhJA','Abort\x20unless\x20the\x20current\x20direct\x20child\x20count\x20matches','hash','selector','isSafeInteger','verification','Re-run\x20menu\x20list\x20to\x20inspect\x20the\x20latest\x20online\x20state\x20before\x20retrying.','rawFlags','get','10YhnXPk','succeeded','expect-path','deleteOrder','\x20is\x20type\x20\x22','warnings',',\x20current\x20',';\x20the\x20planned\x20snapshot\x20is\x20no\x20longer\x20current.','type','\x20parent\x20changed:\x20expected\x20','yes','2788504rXksKf','after','before','byId','cookie','--expected-children-count\x20must\x20be\x20a\x20non-negative\x20integer.','backend','menu_mutation_failed','planFile','toLowerCase','menu_not_found','stage','parent-id','37992930BLsQUJ','\x22,\x20not\x20folder.','length','test','message','recheck\x20online\x20menu\x20facts\x20before\x20','280gwdVZV','\x20menu\x20','Choose\x20a\x20sort\x20value\x20within\x20the\x20Java\x20Integer\x20range\x20used\x20by\x20the\x20menu\x20service.','menu_verification_failed','dry-run','num','Exact\x20online\x20menu\x20id','folder','operation','appCode','targets','pre-write-recheck','8536JQCEMB','Menu\x20','menu_permission_denied','str','\x20child\x20count\x20changed:\x20expected\x20','required','expected-children-count','1113vqiJgx','error','stringify','childrenCount','Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20use\x20an\x20exact\x20id\x20from\x20the\x20current\x20app.','--id\x20must\x20be\x20a\x20positive\x20integer\x20menu\x20id.','Reorder\x20sibling\x20menus\x20below\x20','dryRun','bool','hasOwnProperty','read\x20online\x20menu\x20facts\x20before\x20','2770806uJOJFn','Re-run\x20the\x20command\x20with\x20--dry-run\x20and\x20update\x20the\x20expect\x20flags\x20before\x20retrying.','call','defineProperty','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.','254656sAOpsI','cascade','8837244RoyMjI','menu_confirmation_required','Abort\x20unless\x20the\x20current\x20menu\x20path\x20exactly\x20matches','validation','number','sort','menu_sort_invalid','map','filter','menu_sort_overflow','The\x20write\x20may\x20already\x20have\x20taken\x20effect.\x20Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20inspect\x20the\x20returned\x20id\x20before\x20retrying.','api_error','menu_parent_not_folder'];a116_0x299e=function(){return _0x55ab9f;};return a116_0x299e();}export function parseParentId(_0x3dce37,_0x3ff5fa,_0x33b587={}){const _0x2810dc=a116_0x3a3f7b;if(!hasFlag(_0x3dce37,_0x3ff5fa)){if(_0x33b587[_0x2810dc(0x157)])throw CliErrors['flagMissing'](_0x3ff5fa);return undefined;}const _0x41e887=_0x3dce37[_0x2810dc(0x155)](_0x3ff5fa)['trim']();if(_0x41e887[_0x2810dc(0x13c)]()===_0x2810dc(0x11a))return null;if(!/^\d+$/['test'](_0x41e887))throw CliErrors['validation']('--'+_0x3ff5fa+_0x2810dc(0x112));const _0x360f5e=Number(_0x41e887);if(!Number['isSafeInteger'](_0x360f5e)||_0x360f5e<=0x0)throw CliErrors['validation']('--'+_0x3ff5fa+'\x20must\x20be\x20a\x20positive\x20menu\x20id\x20or\x20root.');return _0x360f5e;}export function requireMenu(_0x5190dc,_0x1ef4ca){const _0x40ea30=a116_0x3a3f7b,_0x16046a=_0x5190dc[_0x40ea30(0x136)][_0x40ea30(0x127)](_0x1ef4ca);if(!_0x16046a)throw menuError(_0x40ea30(0x13d),'Online\x20menu\x20not\x20found:\x20'+_0x1ef4ca,_0x40ea30(0x15d));return _0x16046a;}export function requireFolder(_0x1f6e43,_0x3122e8){const _0x226c9a=a116_0x3a3f7b,_0x228a6b=requireMenu(_0x1f6e43,_0x3122e8);if(_0x228a6b[_0x226c9a(0x130)]!==_0x226c9a(0x14d))throw menuError(_0x226c9a(0x110),_0x226c9a(0x153)+_0x3122e8+_0x226c9a(0x12c)+(_0x228a6b[_0x226c9a(0x130)]||'unknown')+_0x226c9a(0x141),'Choose\x20a\x20menu\x20whose\x20type\x20is\x20folder,\x20or\x20use\x20root.');return _0x228a6b;}export function assertExpectedState(_0x151ee0,_0x1e07fa){const _0x340a88=a116_0x3a3f7b;if(hasFlag(_0x151ee0,'expect-parent-id')){const _0x37337e=parseParentId(_0x151ee0,_0x340a88(0x11e),{'required':!![]});if(_0x1e07fa['parentId']!==_0x37337e)throw stateDrift('Menu\x20'+_0x1e07fa['id']+_0x340a88(0x131)+formatParent(_0x37337e)+_0x340a88(0x12e)+formatParent(_0x1e07fa[_0x340a88(0x11b)])+'.');}if(hasFlag(_0x151ee0,_0x340a88(0x12a))){const _0x10b1a6=_0x151ee0[_0x340a88(0x155)](_0x340a88(0x12a));if(_0x1e07fa[_0x340a88(0x114)]!==_0x10b1a6)throw stateDrift(_0x340a88(0x153)+_0x1e07fa['id']+'\x20path\x20changed:\x20expected\x20'+JSON[_0x340a88(0x15b)](_0x10b1a6)+_0x340a88(0x12e)+JSON[_0x340a88(0x15b)](_0x1e07fa[_0x340a88(0x114)])+'.');}if(hasFlag(_0x151ee0,_0x340a88(0x158))){const _0x292cdd=_0x151ee0[_0x340a88(0x14b)]('expected-children-count');if(!Number[_0x340a88(0x123)](_0x292cdd)||_0x292cdd<0x0)throw CliErrors['validation'](_0x340a88(0x138));if(_0x1e07fa[_0x340a88(0x15c)]!==_0x292cdd)throw stateDrift(_0x340a88(0x153)+_0x1e07fa['id']+_0x340a88(0x156)+_0x292cdd+_0x340a88(0x12e)+_0x1e07fa['childrenCount']+'.');}}export function assertVerified(_0x32ddd8,_0x16e7cd,_0x3eb082=a116_0x3a3f7b(0x115)){const _0x1e38b9=a116_0x3a3f7b;if(!_0x32ddd8)throw menuError(_0x1e38b9(0x149),_0x16e7cd,_0x3eb082);}export function mutationResult(_0x5956f6){const _0x395d47=a116_0x3a3f7b;return{'operation':_0x5956f6[_0x395d47(0x14e)],'selector':_0x5956f6[_0x395d47(0x122)],'before':_0x5956f6[_0x395d47(0x135)],'after':_0x5956f6['after'],'dryRun':_0x5956f6[_0x395d47(0x160)],'backend':_0x5956f6[_0x395d47(0x139)],..._0x5956f6['plannedActions']?{'plannedActions':_0x5956f6['plannedActions']}:{},..._0x5956f6['targets']?{'targets':_0x5956f6[_0x395d47(0x150)]}:{},..._0x5956f6[_0x395d47(0x12b)]?{'deleteOrder':_0x5956f6[_0x395d47(0x12b)]}:{},'snapshotHash':_0x5956f6[_0x395d47(0x117)],..._0x5956f6[_0x395d47(0x103)]?{'cascade':_0x5956f6['cascade']}:{},..._0x5956f6[_0x395d47(0x13b)]?{'planFile':_0x5956f6[_0x395d47(0x13b)]}:{},'succeeded':_0x5956f6[_0x395d47(0x129)]??[],'failed':_0x5956f6[_0x395d47(0x116)]??[],'warnings':_0x5956f6['warnings']??[],'verification':_0x5956f6[_0x395d47(0x124)],'error':_0x5956f6[_0x395d47(0x15a)]};}export function menuDryRunResult(_0x256871,_0x391f0e){return{..._0x256871,..._0x391f0e};}export function menuFailure(_0x3e7a67,_0x90d146,_0x272271){const _0x2cb00b=a116_0x3a3f7b,_0x204814=mutationResult({..._0x90d146,'after':_0x272271[_0x2cb00b(0x134)]===undefined?_0x90d146['after']:_0x272271[_0x2cb00b(0x134)],'backend':_0x272271['backend']??_0x90d146['backend'],'dryRun':![],'succeeded':_0x272271[_0x2cb00b(0x129)]??[],'failed':[{..._0x272271[_0x2cb00b(0x116)]??{},'stage':_0x272271[_0x2cb00b(0x13e)],'code':_0x3e7a67['code'],'message':_0x3e7a67[_0x2cb00b(0x144)]}],'warnings':[..._0x90d146[_0x2cb00b(0x12d)],..._0x272271[_0x2cb00b(0x12d)]??[]],'verification':_0x272271[_0x2cb00b(0x124)],'error':{'code':_0x3e7a67[_0x2cb00b(0x119)],'message':_0x3e7a67[_0x2cb00b(0x144)],..._0x3e7a67[_0x2cb00b(0x111)]?{'hint':_0x3e7a67[_0x2cb00b(0x111)]}:{}}});return Object[_0x2cb00b(0x100)](_0x3e7a67,'data',{'value':_0x204814,'enumerable':!![],'configurable':!![]}),_0x3e7a67;}export function asVerificationError(_0x191006,_0x30cba1){const _0x371f7b=a116_0x3a3f7b;if(_0x191006 instanceof CliError&&_0x191006[_0x371f7b(0x119)]==='menu_verification_failed')return _0x191006;const _0x7cb42c=_0x191006 instanceof Error?_0x191006[_0x371f7b(0x144)]:String(_0x191006);return menuError(_0x371f7b(0x149),''+_0x30cba1+(_0x7cb42c?':\x20'+_0x7cb42c:''),_0x371f7b(0x10e));}export function describeMenuErrorCause(_0x2047a2,_0x503db2,_0x14716d){const _0x232998=a116_0x3a3f7b,_0xfa9f62=mapMenuApiError(_0x2047a2,_0x503db2,_0x14716d);return{'causeCode':_0xfa9f62[_0x232998(0x119)],'causeMessage':_0xfa9f62['message']};}export function hasFlag(_0x3011ed,_0x131711){const _0x708a05=a116_0x3a3f7b;return Object['prototype'][_0x708a05(0x162)][_0x708a05(0xff)](_0x3011ed[_0x708a05(0x126)],_0x131711)&&_0x3011ed[_0x708a05(0x126)][_0x131711]!==undefined;}export function toApiParentId(_0x4ab18e){return _0x4ab18e??0x0;}export function formatParent(_0x3c601a){const _0x4f9f30=a116_0x3a3f7b;return _0x3c601a==null?_0x4f9f30(0x11a):String(_0x3c601a);}export function menuError(_0xdc19ed,_0x478812,_0xf5688b){return new CliError(_0xdc19ed,0x1,_0x478812,_0xf5688b);}export function mapMenuApiError(_0x12faac,_0x482d89,_0x32aa3b){const _0x32a16c=a116_0x3a3f7b;if(_0x12faac instanceof CliError&&_0x12faac['code']!==_0x32a16c(0x10f))return _0x12faac;const _0x47cc24=_0x12faac instanceof Error?_0x12faac['message']:String(_0x12faac);if(/HTTP 403|forbidden|permission|无权限|权限不足|没有权限/i[_0x32a16c(0x143)](_0x47cc24))return menuError(_0x32a16c(0x154),'Permission\x20denied\x20while\x20attempting\x20to\x20'+_0x482d89+(_0x32aa3b?'\x20menu\x20'+_0x32aa3b:'')+'.','Confirm\x20that\x20the\x20current\x20account\x20can\x20manage\x20menus\x20for\x20this\x20app.');return menuError(_0x32a16c(0x13a),'Failed\x20to\x20'+_0x482d89+(_0x32aa3b?_0x32a16c(0x147)+_0x32aa3b:'')+':\x20'+_0x47cc24,_0x32a16c(0x125));}function stateDrift(_0x41f2f6){const _0x24d45b=a116_0x3a3f7b;return menuError('menu_state_drift',_0x41f2f6,_0x24d45b(0xfe));}
|
|
1
|
+
const a118_0x3400bc=a118_0x531a;(function(_0x9be1db,_0x5862cf){const _0x1a4566=a118_0x531a,_0x28a8fe=_0x9be1db();while(!![]){try{const _0x244f7a=-parseInt(_0x1a4566(0x122))/0x1+-parseInt(_0x1a4566(0xf6))/0x2+parseInt(_0x1a4566(0xf7))/0x3*(parseInt(_0x1a4566(0x123))/0x4)+parseInt(_0x1a4566(0x115))/0x5+-parseInt(_0x1a4566(0x100))/0x6*(parseInt(_0x1a4566(0xfd))/0x7)+-parseInt(_0x1a4566(0x11e))/0x8+parseInt(_0x1a4566(0x109))/0x9;if(_0x244f7a===_0x5862cf)break;else _0x28a8fe['push'](_0x28a8fe['shift']());}catch(_0x510fd8){_0x28a8fe['push'](_0x28a8fe['shift']());}}}(a118_0x47d7,0xc549b));import{CliError,CliErrors}from'../../../errors.js';import{fetchMenuSnapshot,getChildren}from'../../../commands/menu/shared/facts.js';export const MAX_MENU_SORT=0x7fffffff;export const MENU_ID_FLAG={'name':'id','type':a118_0x3400bc(0xc3),'required':!![],'description':'Exact\x20online\x20menu\x20id'};export const MENU_SORT_FLAG={'name':a118_0x3400bc(0xe2),'type':a118_0x3400bc(0xc3),'description':'Sibling\x20sort\x20value\x20(non-negative\x20integer)'};export const MENU_PARENT_ID_FLAG={'name':a118_0x3400bc(0xd3),'type':a118_0x3400bc(0xd2),'description':a118_0x3400bc(0xd5)};export const MENU_EXPECT_PARENT_ID_FLAG={'name':'expect-parent-id','type':a118_0x3400bc(0xd2),'description':a118_0x3400bc(0x119)};export const MENU_EXPECT_FLAGS=[MENU_EXPECT_PARENT_ID_FLAG,{'name':a118_0x3400bc(0x10a),'type':a118_0x3400bc(0xd2),'description':a118_0x3400bc(0xd7)},{'name':a118_0x3400bc(0xcc),'type':a118_0x3400bc(0xc3),'description':a118_0x3400bc(0x10e)}];export function validateExactId(_0x5ed026){const _0x29d9b7=a118_0x3400bc,_0x308226=_0x5ed026['num']('id');if(!Number[_0x29d9b7(0xdf)](_0x308226)||_0x308226<=0x0)throw CliErrors[_0x29d9b7(0xea)](_0x29d9b7(0xd8));return _0x308226;}export function validateSort(_0x4e2f13,_0x23a703=a118_0x3400bc(0xe2)){const _0x479bd3=a118_0x3400bc;if(!hasFlag(_0x4e2f13,_0x23a703))return undefined;const _0x26b899=_0x4e2f13[_0x479bd3(0xbd)](_0x23a703);if(!Number[_0x479bd3(0xdf)](_0x26b899)||_0x26b899<0x0||_0x26b899>MAX_MENU_SORT)throw menuError(_0x479bd3(0xf0),'--'+_0x23a703+'\x20must\x20be\x20an\x20integer\x20between\x200\x20and\x20'+MAX_MENU_SORT+'.',_0x479bd3(0x11b));return _0x26b899;}export function nextSiblingSort(_0x401e79,_0x5562b9,_0x5679d3){const _0x1bb5ac=a118_0x3400bc,_0x2c88ed=getChildren(_0x401e79,_0x5562b9)[_0x1bb5ac(0x11d)](_0xf7dcb0=>_0xf7dcb0['sort'])[_0x1bb5ac(0xf1)](_0x4dcc7a=>typeof _0x4dcc7a===_0x1bb5ac(0xc3));if(_0x2c88ed['length']===0x0)return 0x0;const _0x29d609=Math['max'](..._0x2c88ed);if(_0x29d609>=MAX_MENU_SORT)throw menuError(_0x1bb5ac(0xdb),_0x1bb5ac(0xec)+_0x5679d3+_0x1bb5ac(0x10c)+_0x29d609+'.',_0x1bb5ac(0x117)+MAX_MENU_SORT+_0x1bb5ac(0xcb));return _0x29d609+0x1;}export function requireExplicitYes(_0x5da3a9){const _0x1cdcb2=a118_0x3400bc;if(_0x5da3a9['bool'](_0x1cdcb2(0x10f)))return;if(!_0x5da3a9[_0x1cdcb2(0xbb)](_0x1cdcb2(0x118)))throw menuError(_0x1cdcb2(0x116),_0x1cdcb2(0xfe),_0x1cdcb2(0x110));}export async function fetchMutationSnapshot(_0x351603,_0x58cfb5,_0x1836aa){const _0x1ef0c1=a118_0x3400bc;try{return await fetchMenuSnapshot(_0x351603[_0x1ef0c1(0xce)],_0x351603[_0x1ef0c1(0x111)]);}catch(_0x3f3bad){throw mapMenuApiError(_0x3f3bad,_0x1ef0c1(0xfc)+_0x58cfb5,_0x1836aa);}}export async function recheckMutationSnapshot(_0x45257f,_0x57db3f,_0x567a92,_0x3c0e69){const _0x3569f6=a118_0x3400bc;let _0x28ed73;try{_0x28ed73=await fetchMenuSnapshot(_0x45257f[_0x3569f6(0xce)],_0x45257f[_0x3569f6(0x111)]);}catch(_0x1eb6bc){const _0x41f090=mapMenuApiError(_0x1eb6bc,_0x3569f6(0xc7)+_0x567a92,_0x3c0e69);throw menuFailure(_0x41f090,_0x57db3f,{'stage':_0x3569f6(0xd4),'failed':_0x3c0e69==null?{}:{'id':_0x3c0e69}});}if(_0x28ed73['hash']!==_0x57db3f[_0x3569f6(0xe0)]){const _0x401519=menuError(_0x3569f6(0x108),'Online\x20menu\x20state\x20changed\x20before\x20'+_0x567a92+_0x3569f6(0xe9),_0x3569f6(0xf2));throw menuFailure(_0x401519,_0x57db3f,{'stage':_0x3569f6(0xd4),'failed':{..._0x3c0e69==null?{}:{'id':_0x3c0e69},'expectedSnapshotHash':_0x57db3f[_0x3569f6(0xe0)],'currentSnapshotHash':_0x28ed73[_0x3569f6(0xff)]}});}return _0x28ed73;}export function parseParentId(_0x12670a,_0x59bfe7,_0x1ee4dc={}){const _0x3a6fd0=a118_0x3400bc;if(!hasFlag(_0x12670a,_0x59bfe7)){if(_0x1ee4dc['required'])throw CliErrors['flagMissing'](_0x59bfe7);return undefined;}const _0x538d9c=_0x12670a[_0x3a6fd0(0x112)](_0x59bfe7)[_0x3a6fd0(0xe7)]();if(_0x538d9c[_0x3a6fd0(0xf4)]()===_0x3a6fd0(0xe5))return null;if(!/^\d+$/[_0x3a6fd0(0xc5)](_0x538d9c))throw CliErrors[_0x3a6fd0(0xea)]('--'+_0x59bfe7+_0x3a6fd0(0x11c));const _0x2be2e9=Number(_0x538d9c);if(!Number[_0x3a6fd0(0xdf)](_0x2be2e9)||_0x2be2e9<=0x0)throw CliErrors[_0x3a6fd0(0xea)]('--'+_0x59bfe7+_0x3a6fd0(0x11c));return _0x2be2e9;}export function requireMenu(_0x2c63b8,_0x4b52a4){const _0x1aa4fd=a118_0x3400bc,_0x1da06c=_0x2c63b8['byId'][_0x1aa4fd(0xeb)](_0x4b52a4);if(!_0x1da06c)throw menuError(_0x1aa4fd(0x101),_0x1aa4fd(0xdc)+_0x4b52a4,_0x1aa4fd(0xd0));return _0x1da06c;}export function requireFolder(_0x27d6d4,_0x176545){const _0xacb21c=a118_0x3400bc,_0x4aa6e9=requireMenu(_0x27d6d4,_0x176545);if(_0x4aa6e9[_0xacb21c(0xe8)]!=='folder')throw menuError(_0xacb21c(0xcf),_0xacb21c(0xc1)+_0x176545+_0xacb21c(0xc2)+(_0x4aa6e9['type']||_0xacb21c(0x120))+_0xacb21c(0xe3),_0xacb21c(0xee));return _0x4aa6e9;}export function assertExpectedState(_0x577b96,_0x260080){const _0x4cd33=a118_0x3400bc;if(hasFlag(_0x577b96,_0x4cd33(0x113))){const _0x4058c1=parseParentId(_0x577b96,_0x4cd33(0x113),{'required':!![]});if(_0x260080[_0x4cd33(0xf8)]!==_0x4058c1)throw stateDrift(_0x4cd33(0xc1)+_0x260080['id']+'\x20parent\x20changed:\x20expected\x20'+formatParent(_0x4058c1)+_0x4cd33(0x124)+formatParent(_0x260080[_0x4cd33(0xf8)])+'.');}if(hasFlag(_0x577b96,'expect-path')){const _0x3c94e0=_0x577b96[_0x4cd33(0x112)](_0x4cd33(0x10a));if(_0x260080[_0x4cd33(0xe1)]!==_0x3c94e0)throw stateDrift('Menu\x20'+_0x260080['id']+_0x4cd33(0x10d)+JSON[_0x4cd33(0xbe)](_0x3c94e0)+_0x4cd33(0x124)+JSON[_0x4cd33(0xbe)](_0x260080['path'])+'.');}if(hasFlag(_0x577b96,'expected-children-count')){const _0x41bf6d=_0x577b96['num']('expected-children-count');if(!Number['isSafeInteger'](_0x41bf6d)||_0x41bf6d<0x0)throw CliErrors[_0x4cd33(0xea)](_0x4cd33(0xc8));if(_0x260080[_0x4cd33(0xca)]!==_0x41bf6d)throw stateDrift(_0x4cd33(0xc1)+_0x260080['id']+_0x4cd33(0xda)+_0x41bf6d+',\x20current\x20'+_0x260080[_0x4cd33(0xca)]+'.');}}export function assertVerified(_0x381d3c,_0x361203,_0x4d6292=a118_0x3400bc(0xf5)){if(!_0x381d3c)throw menuError('menu_verification_failed',_0x361203,_0x4d6292);}export function mutationResult(_0x14c1c3){const _0x14d644=a118_0x3400bc;return{'operation':_0x14c1c3['operation'],'selector':_0x14c1c3[_0x14d644(0xfa)],'before':_0x14c1c3[_0x14d644(0x10b)],'after':_0x14c1c3[_0x14d644(0xc4)],'dryRun':_0x14c1c3['dryRun'],'backend':_0x14c1c3[_0x14d644(0xdd)],..._0x14c1c3[_0x14d644(0x11a)]?{'plannedActions':_0x14c1c3['plannedActions']}:{},..._0x14c1c3[_0x14d644(0xc6)]?{'targets':_0x14c1c3['targets']}:{},..._0x14c1c3[_0x14d644(0xc0)]?{'deleteOrder':_0x14c1c3[_0x14d644(0xc0)]}:{},'snapshotHash':_0x14c1c3[_0x14d644(0xe0)],..._0x14c1c3[_0x14d644(0xf3)]?{'cascade':_0x14c1c3['cascade']}:{},..._0x14c1c3[_0x14d644(0x106)]?{'planFile':_0x14c1c3[_0x14d644(0x106)]}:{},'succeeded':_0x14c1c3['succeeded']??[],'failed':_0x14c1c3['failed']??[],'warnings':_0x14c1c3['warnings']??[],'verification':_0x14c1c3[_0x14d644(0xf9)],'error':_0x14c1c3[_0x14d644(0x107)]};}export function menuDryRunResult(_0x4deee9,_0x121bd6){return{..._0x4deee9,..._0x121bd6};}export function menuFailure(_0x4872f7,_0x5a96d3,_0x27164b){const _0x3ef2dd=a118_0x3400bc,_0x575da0=mutationResult({..._0x5a96d3,'after':_0x27164b['after']===undefined?_0x5a96d3[_0x3ef2dd(0xc4)]:_0x27164b[_0x3ef2dd(0xc4)],'backend':_0x27164b[_0x3ef2dd(0xdd)]??_0x5a96d3[_0x3ef2dd(0xdd)],'dryRun':![],'succeeded':_0x27164b[_0x3ef2dd(0x103)]??[],'failed':[{..._0x27164b[_0x3ef2dd(0x121)]??{},'stage':_0x27164b['stage'],'code':_0x4872f7['code'],'message':_0x4872f7[_0x3ef2dd(0xcd)]}],'warnings':[..._0x5a96d3[_0x3ef2dd(0x102)],..._0x27164b[_0x3ef2dd(0x102)]??[]],'verification':_0x27164b[_0x3ef2dd(0xf9)],'error':{'code':_0x4872f7[_0x3ef2dd(0x11f)],'message':_0x4872f7[_0x3ef2dd(0xcd)],..._0x4872f7[_0x3ef2dd(0xed)]?{'hint':_0x4872f7['hint']}:{}}});return Object[_0x3ef2dd(0xc9)](_0x4872f7,_0x3ef2dd(0xde),{'value':_0x575da0,'enumerable':!![],'configurable':!![]}),_0x4872f7;}function a118_0x47d7(){const _0x1a2785=['number','after','test','targets','recheck\x20online\x20menu\x20facts\x20before\x20','--expected-children-count\x20must\x20be\x20a\x20non-negative\x20integer.','defineProperty','childrenCount',',\x20or\x20pass\x20an\x20explicit\x20--sort\x20value.','expected-children-count','message','appCode','menu_parent_not_folder','Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20use\x20an\x20exact\x20id\x20from\x20the\x20current\x20app.','Re-run\x20the\x20command\x20with\x20--dry-run\x20and\x20update\x20the\x20expect\x20flags\x20before\x20retrying.','string','parent-id','pre-write-recheck','Parent\x20folder\x20id;\x20use\x20root\x20for\x20a\x20root-level\x20node','menu_mutation_failed','Abort\x20unless\x20the\x20current\x20menu\x20path\x20exactly\x20matches','--id\x20must\x20be\x20a\x20positive\x20integer\x20menu\x20id.','menu_verification_failed','\x20child\x20count\x20changed:\x20expected\x20','menu_sort_overflow','Online\x20menu\x20not\x20found:\x20','backend','data','isSafeInteger','snapshotHash','path','sort','\x22,\x20not\x20folder.','menu_permission_denied','root','The\x20write\x20may\x20already\x20have\x20taken\x20effect.\x20Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20inspect\x20the\x20returned\x20id\x20before\x20retrying.','trim','type',';\x20the\x20planned\x20snapshot\x20is\x20no\x20longer\x20current.','validation','get','Cannot\x20append\x20a\x20','hint','Choose\x20a\x20menu\x20whose\x20type\x20is\x20folder,\x20or\x20use\x20root.','Confirm\x20that\x20the\x20current\x20account\x20can\x20manage\x20menus\x20for\x20this\x20app.','menu_sort_invalid','filter','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20again\x20and\x20review\x20the\x20latest\x20snapshot\x20before\x20retrying.','cascade','toLowerCase','Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20to\x20inspect\x20the\x20latest\x20online\x20menu\x20state.','440946wyzOxE','159KERubq','parentId','verification','selector','prototype','read\x20online\x20menu\x20facts\x20before\x20','7DICIGn','This\x20menu\x20mutation\x20requires\x20explicit\x20--yes.','hash','6470292dOyThp','menu_not_found','warnings','succeeded','hasOwnProperty','api_error','planFile','error','menu_state_drift','26368191kwrgew','expect-path','before','\x20because\x20the\x20current\x20maximum\x20sibling\x20sort\x20is\x20','\x20path\x20changed:\x20expected\x20','Abort\x20unless\x20the\x20current\x20direct\x20child\x20count\x20matches','dry-run','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.','cookie','str','expect-parent-id','Permission\x20denied\x20while\x20attempting\x20to\x20','40990AEnvBr','menu_confirmation_required','Reorder\x20sibling\x20menus\x20below\x20','yes','Abort\x20unless\x20the\x20current\x20parent\x20id\x20matches;\x20use\x20root\x20for\x20root\x20level','plannedActions','Choose\x20a\x20sort\x20value\x20within\x20the\x20Java\x20Integer\x20range\x20used\x20by\x20the\x20menu\x20service.','\x20must\x20be\x20a\x20positive\x20menu\x20id\x20or\x20root.','map','10149144HiuSPm','code','unknown','failed','371082wcUQEf','61032VHljOs',',\x20current\x20','\x20menu\x20','bool','Failed\x20to\x20','num','stringify','rawFlags','deleteOrder','Menu\x20','\x20is\x20type\x20\x22'];a118_0x47d7=function(){return _0x1a2785;};return a118_0x47d7();}export function asVerificationError(_0x28332d,_0x3b9b02){const _0x9fae77=a118_0x3400bc;if(_0x28332d instanceof CliError&&_0x28332d[_0x9fae77(0x11f)]===_0x9fae77(0xd9))return _0x28332d;const _0xbfe775=_0x28332d instanceof Error?_0x28332d[_0x9fae77(0xcd)]:String(_0x28332d);return menuError(_0x9fae77(0xd9),''+_0x3b9b02+(_0xbfe775?':\x20'+_0xbfe775:''),_0x9fae77(0xe6));}function a118_0x531a(_0x250d23,_0x2099a7){_0x250d23=_0x250d23-0xba;const _0x47d784=a118_0x47d7();let _0x531a5d=_0x47d784[_0x250d23];return _0x531a5d;}export function describeMenuErrorCause(_0x4fe67f,_0x335319,_0x24fa88){const _0x30052e=a118_0x3400bc,_0x3a23dc=mapMenuApiError(_0x4fe67f,_0x335319,_0x24fa88);return{'causeCode':_0x3a23dc[_0x30052e(0x11f)],'causeMessage':_0x3a23dc[_0x30052e(0xcd)]};}export function hasFlag(_0x5f20ed,_0x4571ae){const _0x114066=a118_0x3400bc;return Object[_0x114066(0xfb)][_0x114066(0x104)]['call'](_0x5f20ed[_0x114066(0xbf)],_0x4571ae)&&_0x5f20ed[_0x114066(0xbf)][_0x4571ae]!==undefined;}export function toApiParentId(_0x357e8d){return _0x357e8d??0x0;}export function formatParent(_0x29d7ac){const _0x4ce045=a118_0x3400bc;return _0x29d7ac==null?_0x4ce045(0xe5):String(_0x29d7ac);}export function menuError(_0x3fd5ca,_0x5a83bb,_0x266759){return new CliError(_0x3fd5ca,0x1,_0x5a83bb,_0x266759);}export function mapMenuApiError(_0x4548b1,_0xff078e,_0x27a46b){const _0x5d2394=a118_0x3400bc;if(_0x4548b1 instanceof CliError&&_0x4548b1[_0x5d2394(0x11f)]!==_0x5d2394(0x105))return _0x4548b1;const _0x9ff433=_0x4548b1 instanceof Error?_0x4548b1[_0x5d2394(0xcd)]:String(_0x4548b1);if(/HTTP 403|forbidden|permission|无权限|权限不足|没有权限/i['test'](_0x9ff433))return menuError(_0x5d2394(0xe4),_0x5d2394(0x114)+_0xff078e+(_0x27a46b?'\x20menu\x20'+_0x27a46b:'')+'.',_0x5d2394(0xef));return menuError(_0x5d2394(0xd6),_0x5d2394(0xbc)+_0xff078e+(_0x27a46b?_0x5d2394(0xba)+_0x27a46b:'')+':\x20'+_0x9ff433,'Re-run\x20menu\x20list\x20to\x20inspect\x20the\x20latest\x20online\x20state\x20before\x20retrying.');}export function isMenuResponseLoss(_0x1096bd){const _0x48b289=a118_0x3400bc,_0x59650e=_0x1096bd instanceof Error?_0x1096bd[_0x48b289(0xcd)]:String(_0x1096bd);if(_0x1096bd instanceof CliError)return _0x1096bd['code']===_0x48b289(0x105)&&/^Request (?:failed|timeout):/i[_0x48b289(0xc5)](_0x59650e);return/timeout|timed out|ECONNRESET|socket hang up|network|fetch failed|connection closed|aborted|terminated|unexpected end of JSON|premature close|body stream/i[_0x48b289(0xc5)](_0x59650e);}function stateDrift(_0x2b8aaa){const _0x5894ff=a118_0x3400bc;return menuError(_0x5894ff(0x108),_0x2b8aaa,_0x5894ff(0xd1));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3e1c04,_0x5e6900){const _0x313247=a119_0x4d2b,_0x8797ee=_0x3e1c04();while(!![]){try{const _0x7257ab=parseInt(_0x313247(0x175))/0x1*(parseInt(_0x313247(0x186))/0x2)+-parseInt(_0x313247(0x18d))/0x3+parseInt(_0x313247(0x174))/0x4+parseInt(_0x313247(0x18c))/0x5*(parseInt(_0x313247(0x164))/0x6)+-parseInt(_0x313247(0x166))/0x7*(parseInt(_0x313247(0x181))/0x8)+parseInt(_0x313247(0x173))/0x9*(parseInt(_0x313247(0x169))/0xa)+-parseInt(_0x313247(0x17b))/0xb;if(_0x7257ab===_0x5e6900)break;else _0x8797ee['push'](_0x8797ee['shift']());}catch(_0x28c765){_0x8797ee['push'](_0x8797ee['shift']());}}}(a119_0x536a,0xf0f46));import{getEnv,isProduction}from'../../../constant/env.js';function a119_0x536a(){const _0x434d22=['9ffJwmV','5933888TZgAcC','3XJDMAC','Creating\x20menu:\x20','import','create-menu','update-menu-cdn-url','stringify','30694191jBFegm','\x20menu\x20group(s)','\x20online\x20menus\x20successfully','extend','Delete\x20','Create\x20menu\x20\x22','2272WKMTTi','menus','\x20menu','Updating\x20menu\x20asset\x20links:\x20','total','833116FKejfj','Menu\x20created\x20successfully:\x20','Regroup\x20','Fetching\x20online\x20menu\x20list...\x20(appCode:\x20','Start\x20batch\x20menu\x20creation,\x20total\x20','get-online-menu-list','5fXoDEr','906060cUJVmS','Fetching\x20daily\x20menu\x20list...\x20(appCode:\x20','1646616nuAAvt','Menu\x20assets\x20synced:\x20','10689GAYcUl','Update\x20menu\x20assets\x20\x22','create-menus','15054370iZflfA','procode','Fetched\x20','label','length','info','Batch\x20menu\x20creation\x20completed,\x20total\x20','resources','map','loadScriptMode'];a119_0x536a=function(){return _0x434d22;};return a119_0x536a();}import{logger}from'../../../utils/logger.js';import{fetchMenuSnapshot,toProcessedMenuItem}from'../../../commands/menu/shared/facts.js';import{batchDeleteMenuRecords,createMenuRecord,startMenuRegroup as a119_0x35e172,updateMenuRecord}from'../../../core/api-client.js';export async function getOnlineMenuList(_0x1516dd,_0x13b2a4){const _0x31c3df=a119_0x4d2b,_0x107653=getEnv();logger[_0x31c3df(0x16e)](_0x31c3df(0x18b),isProduction(_0x107653)?_0x31c3df(0x189)+_0x1516dd+')':_0x31c3df(0x18e)+_0x1516dd+')');const _0x5dcbde=await fetchMenuSnapshot(_0x1516dd,_0x13b2a4,{'verbose':!![]});return logger['info'](_0x31c3df(0x18b),_0x31c3df(0x16b)+_0x5dcbde[_0x31c3df(0x185)]+_0x31c3df(0x17d)),_0x5dcbde[_0x31c3df(0x182)][_0x31c3df(0x171)](toProcessedMenuItem);}export async function createMenu(_0xd387a5,_0x2679f2,_0x505237){const _0x1759a7=a119_0x4d2b;logger[_0x1759a7(0x16e)](_0x1759a7(0x178),_0x1759a7(0x176)+_0x505237['label']+'\x20('+_0x505237['path']+')');const _0x2572b9={'appCode':_0xd387a5,'type':_0x1759a7(0x16a),'sort':0x0,'extend':{'loadScriptMode':_0x1759a7(0x177),'resources':_0x505237['resources']?JSON[_0x1759a7(0x17a)](_0x505237[_0x1759a7(0x170)]):undefined},..._0x505237},_0x3dabb4=await createMenuRecord(_0x2572b9,_0x2679f2,_0x1759a7(0x180)+_0x505237[_0x1759a7(0x16c)]+'\x22');return logger[_0x1759a7(0x16e)](_0x1759a7(0x178),_0x1759a7(0x187)+_0x505237[_0x1759a7(0x16c)]),_0x3dabb4;}function a119_0x4d2b(_0x16961a,_0x328909){_0x16961a=_0x16961a-0x164;const _0x536a2e=a119_0x536a();let _0x4d2b2b=_0x536a2e[_0x16961a];return _0x4d2b2b;}async function createSingleMenu(_0x865a66,_0x521f82,_0x69aa7a,_0x1cc668){const _0x15a0c3=a119_0x4d2b,_0x3583d7={'appCode':_0x865a66,'type':_0x15a0c3(0x16a),'sort':0x0,'extend':{'loadScriptMode':'import','resources':_0x1cc668?JSON[_0x15a0c3(0x17a)](_0x1cc668):undefined},'label':_0x69aa7a['label'],'path':_0x69aa7a['path']},_0x21a7d1=await createMenuRecord(_0x3583d7,_0x521f82,_0x15a0c3(0x180)+_0x69aa7a[_0x15a0c3(0x16c)]+'\x22');return logger[_0x15a0c3(0x16e)](_0x15a0c3(0x178),_0x15a0c3(0x187)+_0x69aa7a[_0x15a0c3(0x16c)]),_0x21a7d1;}export async function createMenus(_0xce3ca4,_0x2c0529,_0x139654,_0x40ddd7){const _0x4bed2a=a119_0x4d2b;logger['info'](_0x4bed2a(0x168),_0x4bed2a(0x18a)+_0x139654['length']);const _0x410922=await Promise['all'](_0x139654[_0x4bed2a(0x171)](_0xa59297=>createSingleMenu(_0xce3ca4,_0x2c0529,_0xa59297,_0x40ddd7)));return logger['info']('create-menus',_0x4bed2a(0x16f)+_0x139654['length']),_0x410922;}export async function updateMenuCdnUrl(_0xe678e6,_0x5cda27,_0x404cb0){const _0x286fb7=a119_0x4d2b;logger[_0x286fb7(0x16e)](_0x286fb7(0x179),_0x286fb7(0x184)+_0x404cb0[_0x286fb7(0x16c)]+'\x20('+_0x404cb0['path']+')');const _0x1cda1f={'id':_0x404cb0['id'],'appCode':_0xe678e6,'extend':{..._0x404cb0[_0x286fb7(0x17e)]??{},..._0x404cb0[_0x286fb7(0x172)]?{'loadScriptMode':_0x404cb0[_0x286fb7(0x172)]}:{},'resources':_0x404cb0[_0x286fb7(0x170)]?JSON[_0x286fb7(0x17a)](_0x404cb0[_0x286fb7(0x170)]):undefined}},_0x523484=await updateMenuRecord(_0x1cda1f,_0x5cda27,_0x286fb7(0x167)+_0x404cb0[_0x286fb7(0x16c)]+'\x22');return logger[_0x286fb7(0x16e)]('update-menu-cdn-url',_0x286fb7(0x165)+_0x404cb0[_0x286fb7(0x16c)],undefined),_0x523484;}export async function createMenuEntity(_0x55abd1,_0x131c68,_0x24f94c){const _0x24dae9=a119_0x4d2b;return createMenuRecord({'appCode':_0x55abd1,..._0x24f94c},_0x131c68,_0x24dae9(0x180)+_0x24f94c[_0x24dae9(0x16c)]+'\x22');}export async function updateMenuEntity(_0x5ed2d8,_0x56fada,_0x1266aa){return updateMenuRecord({'appCode':_0x5ed2d8,..._0x1266aa},_0x56fada,'Update\x20menu\x20'+_0x1266aa['id']);}export async function batchDeleteMenuEntities(_0x34c14f,_0x21b212){const _0x2ae886=a119_0x4d2b;return batchDeleteMenuRecords(_0x21b212,_0x34c14f,_0x2ae886(0x17f)+_0x21b212[_0x2ae886(0x16d)]+_0x2ae886(0x183)+(_0x21b212[_0x2ae886(0x16d)]===0x1?'':'s'));}export async function startMenuRegroup(_0x11fdaf,_0x19c8c9){const _0x4f3b2e=a119_0x4d2b;return a119_0x35e172(_0x19c8c9,_0x11fdaf,_0x4f3b2e(0x188)+_0x19c8c9['menuGroups']['length']+_0x4f3b2e(0x17c));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a120_0x4359fb=a120_0x261a;function a120_0x2cff(){const _0x70fb01=['Invalid\x20--params:\x20expected\x20a\x20JSON\x20object.','isArray','JS\x20URL\x20is\x20unreachable:\x20','566755WnbWxd','map','pages','length','Local\x20page\x20paths\x20are\x20already\x20on\x20the\x20platform:\x20','84630KQVMjD','420HdIEtu','field','Invalid\x20--params\x20JSON.','cssUrl','72548kFbJYF','info','path','join','96111mVJAgV','jsUrl','filter','16JUgqPF','setLogPath','trim','hasOwn','push','Invalid\x20--params:\x20','import','3766830uPRBPH','242950vcLikB','procode','dryRun','Start\x20non-interactive\x20menu\x20sync','Invalid\x20--params\x20fields:\x20','keys','has','733600tLnhJh','label','menu-sync','87LJhDtL','--params.pages\x20is\x20no\x20longer\x20supported.\x20Use\x20--paths\x20with\x20exact\x20local\x20page\x20paths.','get','message','string','parse','CSS\x20URL\x20is\x20unreachable:\x20','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','object'];a120_0x2cff=function(){return _0x70fb01;};return a120_0x2cff();}function a120_0x261a(_0x390200,_0x2e9214){_0x390200=_0x390200-0x19e;const _0x2cffc4=a120_0x2cff();let _0x261a35=_0x2cffc4[_0x390200];return _0x261a35;}(function(_0xc55597,_0x1d1a89){const _0x3997a2=a120_0x261a,_0x2bfdf7=_0xc55597();while(!![]){try{const _0x3829a4=parseInt(_0x3997a2(0x1a8))/0x1+-parseInt(_0x3997a2(0x1bc))/0x2+parseInt(_0x3997a2(0x1c6))/0x3*(parseInt(_0x3997a2(0x1ad))/0x4)+-parseInt(_0x3997a2(0x1c3))/0x5+-parseInt(_0x3997a2(0x1bb))/0x6+parseInt(_0x3997a2(0x1a3))/0x7*(parseInt(_0x3997a2(0x1b4))/0x8)+parseInt(_0x3997a2(0x1b1))/0x9*(parseInt(_0x3997a2(0x1a9))/0xa);if(_0x3829a4===_0x1d1a89)break;else _0x2bfdf7['push'](_0x2bfdf7['shift']());}catch(_0x16705e){_0x2bfdf7['push'](_0x2bfdf7['shift']());}}}(a120_0x2cff,0x4f5bb));import{getLocalPages}from'../../../commands/menu/shared/local-pages.js';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([a120_0x4359fb(0x1b2),a120_0x4359fb(0x1ac)]);function validateParams(_0x583070){const _0x73bd22=a120_0x4359fb,_0x20895=[];return _0x583070['jsUrl']&&!isValidJsHttpsUrl(_0x583070[_0x73bd22(0x1b2)])&&_0x20895[_0x73bd22(0x1b8)]({'field':_0x73bd22(0x1b2),'message':_0x73bd22(0x19e)}),_0x583070[_0x73bd22(0x1ac)]&&!isValidCssHttpsUrl(_0x583070[_0x73bd22(0x1ac)])&&_0x20895['push']({'field':_0x73bd22(0x1ac),'message':'CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL'}),_0x20895;}export async function runMenuSyncCore(_0x441240,_0x380adf,_0xcf8ec3=[],_0x5cac84,_0x33be57={}){const _0x22530f=a120_0x4359fb,_0x4795dc=parseMenuSyncParams(_0x5cac84),_0x11d610=[...new Set(_0xcf8ec3[_0x22530f(0x1a4)](_0xc00a33=>_0xc00a33[_0x22530f(0x1b6)]())[_0x22530f(0x1b3)](Boolean))],_0x5e8ad9=_0x4795dc['jsUrl'],_0x38e53a=_0x4795dc[_0x22530f(0x1ac)],_0x159e83=[];if(_0x5e8ad9)_0x159e83[_0x22530f(0x1b8)](_0x5e8ad9);if(_0x38e53a)_0x159e83[_0x22530f(0x1b8)](_0x38e53a);const _0x141f2b=validateParams(_0x4795dc);if(_0x141f2b[_0x22530f(0x1a6)]>0x0){const _0x39ad86=_0x141f2b[_0x22530f(0x1a4)](_0x1d6a92=>'--params.'+_0x1d6a92[_0x22530f(0x1aa)]+':\x20'+_0x1d6a92[_0x22530f(0x1c9)])[_0x22530f(0x1b0)](';\x20');throw new Error(_0x22530f(0x1b9)+_0x39ad86);}logger[_0x22530f(0x1b5)](process['cwd']()),logger[_0x22530f(0x1ae)](_0x22530f(0x1c5),_0x22530f(0x1bf),{'appCode':_0x441240,'selectedCount':_0x11d610[_0x22530f(0x1a6)],'jsUrl':_0x5e8ad9,'cssUrl':_0x38e53a});if(_0x5e8ad9){const _0x28c8f9=await isUrlReachable(_0x5e8ad9);if(!_0x28c8f9)throw new Error(_0x22530f(0x1a2)+_0x5e8ad9);}if(_0x38e53a){const _0x19e28b=await isUrlReachable(_0x38e53a);if(!_0x19e28b)throw new Error(_0x22530f(0x1cc)+_0x38e53a);}const _0x17d74d=getLocalPages();if(_0x17d74d['length']===0x0){if(_0x11d610['length']>0x0)throw new Error('No\x20local\x20pages\x20matched\x20paths:\x20'+_0x11d610['join'](',\x20'));return{'created':0x0,'skipped':!![],'dryRun':_0x33be57[_0x22530f(0x1be)]===!![],'targetPages':[],'plannedMenus':[]};}const _0x1db18a=await getOnlineMenuList(_0x441240,_0x380adf),_0x21c81c=new Set(_0x1db18a[_0x22530f(0x1a4)](_0x3d0435=>_0x3d0435[_0x22530f(0x1af)]));let _0x5d7f5d;if(_0x11d610[_0x22530f(0x1a6)]>0x0){const _0x20e6ea=new Map(_0x17d74d[_0x22530f(0x1a4)](_0x5843cd=>[_0x5843cd[_0x22530f(0x1af)],_0x5843cd])),_0xe112d8=_0x11d610[_0x22530f(0x1b3)](_0x3d5cb4=>!_0x20e6ea[_0x22530f(0x1c2)](_0x3d5cb4));if(_0xe112d8[_0x22530f(0x1a6)]>0x0){const _0x39495a=_0x17d74d[_0x22530f(0x1a4)](_0x3b2862=>_0x3b2862[_0x22530f(0x1af)])[_0x22530f(0x1b0)](',\x20');throw new Error('No\x20local\x20pages\x20matched\x20paths:\x20'+_0xe112d8[_0x22530f(0x1b0)](',\x20')+'\x0a\x20\x20Available\x20local\x20paths:\x20'+_0x39495a);}const _0x48af39=_0x11d610['filter'](_0x1e3aab=>_0x21c81c[_0x22530f(0x1c2)](_0x1e3aab));if(_0x48af39[_0x22530f(0x1a6)]>0x0)throw new Error(_0x22530f(0x1a7)+_0x48af39[_0x22530f(0x1b0)](',\x20'));_0x5d7f5d=_0x11d610[_0x22530f(0x1a4)](_0x4cec1f=>_0x20e6ea[_0x22530f(0x1c8)](_0x4cec1f));}else _0x5d7f5d=_0x17d74d[_0x22530f(0x1b3)](_0x34233b=>!_0x21c81c['has'](_0x34233b[_0x22530f(0x1af)]));if(_0x5d7f5d[_0x22530f(0x1a6)]===0x0)return{'created':0x0,'skipped':!![],'dryRun':_0x33be57['dryRun']===!![],'targetPages':[],'plannedMenus':[]};const _0x5e2668=_0x5d7f5d[_0x22530f(0x1a4)](_0x5c775e=>({'type':_0x22530f(0x1bd),'path':_0x5c775e[_0x22530f(0x1af)],'label':_0x5c775e[_0x22530f(0x1c4)],'loadScriptMode':_0x22530f(0x1ba),'resources':[..._0x159e83]}));if(_0x33be57[_0x22530f(0x1be)])return{'created':0x0,'skipped':![],'dryRun':!![],'targetPages':_0x5d7f5d,'plannedMenus':_0x5e2668};const _0x1d8ee2=await createMenus(_0x441240,_0x380adf,_0x5d7f5d,_0x159e83[_0x22530f(0x1a6)]>0x0?_0x159e83:undefined);return logger[_0x22530f(0x1ae)](_0x22530f(0x1c5),'Menu\x20sync\x20completed',{'count':_0x5d7f5d[_0x22530f(0x1a6)],'resources':_0x159e83}),{'created':_0x1d8ee2[_0x22530f(0x1a6)],'skipped':![],'dryRun':![],'targetPages':_0x5d7f5d,'plannedMenus':_0x5e2668,'menus':_0x1d8ee2};}export function parseMenuSyncParams(_0x3e5b49){const _0x57ac8e=a120_0x4359fb;if(!_0x3e5b49||typeof _0x3e5b49!==_0x57ac8e(0x1ca))return{};let _0x12f8a2;try{_0x12f8a2=JSON[_0x57ac8e(0x1cb)](_0x3e5b49);}catch{throw new Error(_0x57ac8e(0x1ab));}if(typeof _0x12f8a2!==_0x57ac8e(0x19f)||_0x12f8a2===null||Array[_0x57ac8e(0x1a1)](_0x12f8a2))throw new Error(_0x57ac8e(0x1a0));const _0x5a7aae=_0x12f8a2;if(Object[_0x57ac8e(0x1b7)](_0x5a7aae,_0x57ac8e(0x1a5)))throw new Error(_0x57ac8e(0x1c7));const _0x3a234b=Object[_0x57ac8e(0x1c1)](_0x5a7aae)[_0x57ac8e(0x1b3)](_0x3a2641=>!MENU_SYNC_PARAM_KEYS[_0x57ac8e(0x1c2)](_0x3a2641));if(_0x3a234b['length']>0x0)throw new Error(_0x57ac8e(0x1c0)+_0x3a234b['join'](',\x20')+'.');for(const _0x4b8676 of MENU_SYNC_PARAM_KEYS){const _0x5989fe=_0x5a7aae[_0x4b8676];if(_0x5989fe!==undefined&&(typeof _0x5989fe!==_0x57ac8e(0x1ca)||_0x5989fe[_0x57ac8e(0x1b6)]()===''))throw new Error('Invalid\x20--params.'+_0x4b8676+':\x20expected\x20a\x20non-empty\x20string.');}return{'jsUrl':typeof _0x5a7aae[_0x57ac8e(0x1b2)]==='string'?_0x5a7aae['jsUrl'][_0x57ac8e(0x1b6)]():undefined,'cssUrl':typeof _0x5a7aae['cssUrl']===_0x57ac8e(0x1ca)?_0x5a7aae['cssUrl'][_0x57ac8e(0x1b6)]():undefined};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x4e36b5,_0x29a94f){const _0x2a8db7=a120_0x1e04,_0x4dfbe0=_0x4e36b5();while(!![]){try{const _0x2562db=parseInt(_0x2a8db7(0x125))/0x1+parseInt(_0x2a8db7(0x12c))/0x2+-parseInt(_0x2a8db7(0x124))/0x3*(-parseInt(_0x2a8db7(0x11e))/0x4)+-parseInt(_0x2a8db7(0x116))/0x5+-parseInt(_0x2a8db7(0x13d))/0x6*(-parseInt(_0x2a8db7(0x10c))/0x7)+parseInt(_0x2a8db7(0x108))/0x8+-parseInt(_0x2a8db7(0x132))/0x9*(parseInt(_0x2a8db7(0x101))/0xa);if(_0x2562db===_0x29a94f)break;else _0x4dfbe0['push'](_0x4dfbe0['shift']());}catch(_0x56a259){_0x4dfbe0['push'](_0x4dfbe0['shift']());}}}(a120_0x7e03,0xe9658));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(_0x23639d){const _0x2d432e=a120_0x1e04,_0x1e2ce9=[];return _0x23639d[_0x2d432e(0x118)]&&!isValidJsHttpsUrl(_0x23639d[_0x2d432e(0x118)])&&_0x1e2ce9[_0x2d432e(0x137)]({'field':_0x2d432e(0x118),'message':_0x2d432e(0x134)}),_0x23639d['cssUrl']&&!isValidCssHttpsUrl(_0x23639d['cssUrl'])&&_0x1e2ce9[_0x2d432e(0x137)]({'field':_0x2d432e(0x126),'message':_0x2d432e(0x140)}),_0x1e2ce9;}export async function runMenuUpdateCore(_0x3d52dc,_0x48afdf,_0x50e0ee,_0x4559c2={}){const _0x5b1de9=a120_0x1e04,_0x2661a3=parseUpdateParamsFlag(_0x50e0ee),_0x677e61=normalizeMode(_0x4559c2[_0x5b1de9(0x13f)]);validateSelection(_0x4559c2['selection']);const _0x244558=[];if(_0x2661a3['jsUrl'])_0x244558[_0x5b1de9(0x137)](_0x2661a3['jsUrl']);if(_0x2661a3[_0x5b1de9(0x126)])_0x244558[_0x5b1de9(0x137)](_0x2661a3[_0x5b1de9(0x126)]);const _0x36d926=validateParams(_0x2661a3);if(_0x36d926['length']>0x0){const _0x46f79a=_0x36d926[_0x5b1de9(0xfd)](_0x496e2c=>_0x5b1de9(0x13c)+_0x496e2c[_0x5b1de9(0x138)]+':\x20'+_0x496e2c[_0x5b1de9(0xfc)])[_0x5b1de9(0x103)](';\x20');throw new Error(_0x5b1de9(0xfe)+_0x46f79a);}if(_0x244558[_0x5b1de9(0x12b)]===0x0)throw new Error(_0x5b1de9(0x13e)+_0x5b1de9(0x121));logger[_0x5b1de9(0x12a)](process['cwd']()),logger[_0x5b1de9(0x110)]('menu-update',_0x5b1de9(0x10e),{'appCode':_0x3d52dc,'jsUrl':_0x2661a3[_0x5b1de9(0x118)],'cssUrl':_0x2661a3[_0x5b1de9(0x126)],'mode':_0x677e61,'dryRun':_0x4559c2[_0x5b1de9(0x102)]===!![]});if(_0x2661a3[_0x5b1de9(0x118)]){const _0x4950ef=await isUrlReachable(_0x2661a3[_0x5b1de9(0x118)]);if(!_0x4950ef)throw new Error('JS\x20URL\x20is\x20unreachable:\x20'+_0x2661a3[_0x5b1de9(0x118)]);}if(_0x2661a3[_0x5b1de9(0x126)]){const _0xafa976=await isUrlReachable(_0x2661a3[_0x5b1de9(0x126)]);if(!_0xafa976)throw new Error('CSS\x20URL\x20is\x20unreachable:\x20'+_0x2661a3[_0x5b1de9(0x126)]);}const _0x1370a0=await getOnlineMenuList(_0x3d52dc,_0x48afdf),_0x93f228=_0x1370a0[_0x5b1de9(0x123)](_0x106e0f=>_0x106e0f[_0x5b1de9(0x104)][_0x5b1de9(0x12b)]>0x0),_0x2b8ce5=selectMenusForUpdate(_0x93f228,_0x4559c2['selection']);if(_0x2b8ce5[_0x5b1de9(0x12b)]===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![],'dryRun':_0x4559c2[_0x5b1de9(0x102)]===!![]};const _0x4f4e14=_0x2b8ce5['map'](_0x28bbb5=>buildMenuUpdateDiff(_0x28bbb5,_0x2661a3,_0x677e61,_0x4559c2['force']===!![],_0x4559c2[_0x5b1de9(0xfb)]));if(_0x4559c2[_0x5b1de9(0x102)])return{'updated':0x0,'failed':0x0,'skipped':![],'dryRun':!![],'diffs':_0x4f4e14};const _0x6864a9=await Promise[_0x5b1de9(0x10d)](_0x2b8ce5[_0x5b1de9(0xfd)]((_0x2a81ed,_0x2d739d)=>updateMenuCdnUrl(_0x3d52dc,_0x48afdf,{'id':_0x2a81ed['id'],'label':_0x2a81ed[_0x5b1de9(0x115)],'path':_0x2a81ed[_0x5b1de9(0x10b)],'resources':_0x4f4e14[_0x2d739d][_0x5b1de9(0x129)][_0x5b1de9(0x104)],'extend':_0x2a81ed[_0x5b1de9(0x11a)]??null,'loadScriptMode':_0x4559c2[_0x5b1de9(0xfb)]}))),_0x5daa43=_0x6864a9[_0x5b1de9(0x123)](_0x41e375=>_0x41e375[_0x5b1de9(0x127)]===_0x5b1de9(0x117))[_0x5b1de9(0xfd)](_0x19ba5d=>_0x19ba5d[_0x5b1de9(0x136)]),_0x73270=_0x6864a9['filter'](_0x7448e8=>_0x7448e8[_0x5b1de9(0x127)]==='rejected')[_0x5b1de9(0x12b)];return logger[_0x5b1de9(0x110)](_0x5b1de9(0x105),_0x5b1de9(0x128),{'count':_0x2b8ce5[_0x5b1de9(0x12b)],'resources':_0x244558}),{'updated':_0x5daa43[_0x5b1de9(0x12b)],'failed':_0x73270,'skipped':![],'menus':_0x5daa43};}function a120_0x7e03(){const _0x393929=['parse','menu\x20update\x20cannot\x20patch\x20','menuIds','label','8075480eRtpxK','fulfilled','jsUrl','some','extend','.css',').\x20','has','752212OItaOe','unshift','\x22\x20(','Pass\x20--params\x20\x27{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}\x27\x20to\x20update\x20assets.','string','filter','15VfFLCm','1662173GrzuSy','cssUrl','status','Menu\x20update\x20completed','after','setLogPath','length','3489672SYqBAn','toLowerCase','trim','.\x20Allowed\x20values:\x20replace,\x20patch','menu\x20update\x20would\x20remove\x20existing\x20JS\x20resource\x20for\x20\x22','endsWith','60183MzYGeZ','--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','.js','value','push','field','replace','patch','Invalid\x20--mode:\x20','--params.','7484646MPkAJy','Invalid\x20--params:\x20menu\x20update\x20requires\x20at\x20least\x20one\x20explicit\x20JS/CSS\x20URL.\x20','mode','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','loadScriptMode','message','map','Invalid\x20--params:\x20','paths','all','4610YyMvtz','dryRun','join','resources','menu-update','menu\x20update\x20will\x20remove\x20existing\x20CSS\x20resource\x20for\x20\x22','menu\x20update\x20selectors\x20did\x20not\x20match\x20resource-bearing\x20menus:\x20','472640lwfOIe','with\x20a\x20single\x20jsUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','\x20existing\x20JS\x20resources\x20for\x20\x22','path','7mZGkmz','allSettled','Start\x20non-interactive\x20menu\x20update','isArray','info','\x20existing\x20CSS\x20resources\x20for\x20\x22'];a120_0x7e03=function(){return _0x393929;};return a120_0x7e03();}function validateSelection(_0x2407c5){const _0x11c949=a120_0x1e04;if(!_0x2407c5)throw new Error('menu\x20update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.');if(_0x2407c5[_0x11c949(0x100)]&&(_0x2407c5[_0x11c949(0x114)][_0x11c949(0x12b)]>0x0||_0x2407c5[_0x11c949(0xff)][_0x11c949(0x12b)]>0x0))throw new Error(_0x11c949(0x133));if(!_0x2407c5[_0x11c949(0x100)]&&_0x2407c5[_0x11c949(0x114)]['length']===0x0&&_0x2407c5[_0x11c949(0xff)][_0x11c949(0x12b)]===0x0)throw new Error('menu\x20update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.');}export function selectMenusForUpdate(_0x622991,_0x596b62){const _0x57f671=a120_0x1e04;validateSelection(_0x596b62);if(_0x596b62[_0x57f671(0x100)])return _0x622991;const _0xd84c32=new Set(_0x622991[_0x57f671(0xfd)](_0x2ebbea=>_0x2ebbea['id'])),_0x330887=new Set(_0x622991[_0x57f671(0xfd)](_0x182f55=>_0x182f55[_0x57f671(0x10b)])),_0x426d7c=_0x596b62[_0x57f671(0x114)]['filter'](_0x35fa3d=>!_0xd84c32['has'](_0x35fa3d)),_0x3dec97=_0x596b62['paths'][_0x57f671(0x123)](_0x138cd3=>!_0x330887[_0x57f671(0x11d)](_0x138cd3));if(_0x426d7c[_0x57f671(0x12b)]>0x0||_0x3dec97[_0x57f671(0x12b)]>0x0){const _0x229a6a=[..._0x426d7c[_0x57f671(0xfd)](_0x247876=>String(_0x247876)),..._0x3dec97][_0x57f671(0x103)](',\x20');throw new Error(_0x57f671(0x107)+_0x229a6a);}const _0x23b2e5=new Set(_0x596b62['menuIds']),_0x29886d=new Set(_0x596b62[_0x57f671(0xff)]);return _0x622991['filter'](_0x488232=>_0x23b2e5[_0x57f671(0x11d)](_0x488232['id'])||_0x29886d[_0x57f671(0x11d)](_0x488232[_0x57f671(0x10b)]));}function normalizeMode(_0x3dd823){const _0x5b4f5e=a120_0x1e04;if(!_0x3dd823)return _0x5b4f5e(0x13a);if(_0x3dd823===_0x5b4f5e(0x139)||_0x3dd823===_0x5b4f5e(0x13a))return _0x3dd823;throw new Error(_0x5b4f5e(0x13b)+_0x3dd823+_0x5b4f5e(0x12f));}function buildMenuUpdateDiff(_0x397d43,_0x3d1110,_0xdaae1a,_0x3832fa,_0x154b08){const _0x4ecc77=a120_0x1e04,_0x12232a=[..._0x397d43['resources']];_0xdaae1a===_0x4ecc77(0x13a)&&assertUnambiguousPatchResources(_0x397d43,_0x12232a,_0x3d1110);const _0x2aa170=_0xdaae1a===_0x4ecc77(0x13a)?patchResources(_0x12232a,_0x3d1110):replaceResources(_0x3d1110),_0x51068c=[],_0xd0f845=_0x12232a[_0x4ecc77(0x119)](isJsResource),_0x205424=_0x2aa170[_0x4ecc77(0x119)](isJsResource);if(_0xd0f845&&!_0x205424){const _0x172a9=_0x4ecc77(0x130)+_0x397d43[_0x4ecc77(0x115)]+_0x4ecc77(0x120)+_0x397d43[_0x4ecc77(0x10b)]+_0x4ecc77(0x11c)+'Use\x20--mode\x20patch\x20to\x20preserve\x20it,\x20pass\x20jsUrl,\x20or\x20add\x20--force\x20for\x20an\x20intentional\x20removal.';if(!_0x3832fa)throw new Error(_0x172a9);_0x51068c[_0x4ecc77(0x137)](_0x172a9);}const _0x2b2699=_0x12232a[_0x4ecc77(0x119)](isCssResource),_0x38de7b=_0x2aa170[_0x4ecc77(0x119)](isCssResource);_0x2b2699&&!_0x38de7b&&_0x51068c[_0x4ecc77(0x137)](_0x4ecc77(0x106)+_0x397d43[_0x4ecc77(0x115)]+_0x4ecc77(0x120)+_0x397d43['path']+').');const _0x1950c7=typeof _0x397d43[_0x4ecc77(0x11a)]?.[_0x4ecc77(0xfb)]===_0x4ecc77(0x122)?_0x397d43[_0x4ecc77(0x11a)][_0x4ecc77(0xfb)]:null,_0x53fb01=_0x154b08?{'loadScriptMode':_0x1950c7}:{},_0x18107d=_0x154b08?{'loadScriptMode':_0x154b08}:{};return{'id':_0x397d43['id'],'label':_0x397d43[_0x4ecc77(0x115)],'path':_0x397d43[_0x4ecc77(0x10b)],'mode':_0xdaae1a,'before':{'resources':_0x12232a,..._0x53fb01},'after':{'resources':_0x2aa170,..._0x18107d},'warnings':_0x51068c};}function replaceResources(_0x1f85d1){const _0x57b856=a120_0x1e04;return[_0x1f85d1['jsUrl'],_0x1f85d1[_0x57b856(0x126)]]['filter'](_0x2887ee=>!!_0x2887ee);}function assertUnambiguousPatchResources(_0x2ebb32,_0x39c5d1,_0xafda1){const _0x22eaa4=a120_0x1e04,_0x47de24=_0x39c5d1[_0x22eaa4(0x123)](isJsResource)[_0x22eaa4(0x12b)];if(_0xafda1[_0x22eaa4(0x118)]&&_0x47de24>0x1)throw new Error(_0x22eaa4(0x113)+_0x47de24+_0x22eaa4(0x10a)+_0x2ebb32[_0x22eaa4(0x115)]+_0x22eaa4(0x120)+_0x2ebb32[_0x22eaa4(0x10b)]+')\x20'+_0x22eaa4(0x109));const _0x21fbea=_0x39c5d1['filter'](isCssResource)[_0x22eaa4(0x12b)];if(_0xafda1[_0x22eaa4(0x126)]&&_0x21fbea>0x1)throw new Error(_0x22eaa4(0x113)+_0x21fbea+_0x22eaa4(0x111)+_0x2ebb32[_0x22eaa4(0x115)]+_0x22eaa4(0x120)+_0x2ebb32[_0x22eaa4(0x10b)]+')\x20'+'with\x20a\x20single\x20cssUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.');}function a120_0x1e04(_0x54470d,_0xcea2dc){_0x54470d=_0x54470d-0xfb;const _0x7e03b4=a120_0x7e03();let _0x1e0473=_0x7e03b4[_0x54470d];return _0x1e0473;}function patchResources(_0x19aa77,_0x52706b){const _0x8049d8=a120_0x1e04;let _0xd63514=![],_0x8dbfba=![];const _0x40b1b5=[];for(const _0x174757 of _0x19aa77){if(isJsResource(_0x174757)){if(_0x52706b[_0x8049d8(0x118)]&&!_0xd63514)_0x40b1b5[_0x8049d8(0x137)](_0x52706b['jsUrl']),_0xd63514=!![];else!_0x52706b[_0x8049d8(0x118)]&&_0x40b1b5['push'](_0x174757);continue;}if(isCssResource(_0x174757)){if(_0x52706b[_0x8049d8(0x126)]&&!_0x8dbfba)_0x40b1b5[_0x8049d8(0x137)](_0x52706b['cssUrl']),_0x8dbfba=!![];else!_0x52706b[_0x8049d8(0x126)]&&_0x40b1b5[_0x8049d8(0x137)](_0x174757);continue;}_0x40b1b5[_0x8049d8(0x137)](_0x174757);}return _0x52706b['jsUrl']&&!_0xd63514&&_0x40b1b5[_0x8049d8(0x11f)](_0x52706b['jsUrl']),_0x52706b[_0x8049d8(0x126)]&&!_0x8dbfba&&_0x40b1b5[_0x8049d8(0x137)](_0x52706b[_0x8049d8(0x126)]),_0x40b1b5;}function isJsResource(_0x14b948){const _0x2900f5=a120_0x1e04;return stripQuery(_0x14b948)[_0x2900f5(0x12d)]()[_0x2900f5(0x131)](_0x2900f5(0x135));}function isCssResource(_0x509fcd){const _0x1de8b6=a120_0x1e04;return stripQuery(_0x509fcd)['toLowerCase']()['endsWith'](_0x1de8b6(0x11b));}function stripQuery(_0x461d4d){return _0x461d4d['split']('?')[0x0]??_0x461d4d;}function parseUpdateParamsFlag(_0x14f2ff){const _0x3de7a5=a120_0x1e04;if(!_0x14f2ff||typeof _0x14f2ff!==_0x3de7a5(0x122))return{};try{const _0x405fbe=JSON[_0x3de7a5(0x112)](_0x14f2ff);if(typeof _0x405fbe!=='object'||_0x405fbe===null||Array[_0x3de7a5(0x10f)](_0x405fbe))return{};return{'jsUrl':typeof _0x405fbe[_0x3de7a5(0x118)]===_0x3de7a5(0x122)?_0x405fbe[_0x3de7a5(0x118)]['trim']():undefined,'cssUrl':typeof _0x405fbe[_0x3de7a5(0x126)]==='string'?_0x405fbe[_0x3de7a5(0x126)][_0x3de7a5(0x12e)]():undefined};}catch{return{};}}
|
|
1
|
+
(function(_0xcac44e,_0x4dd439){const _0x12288e=a122_0x4426,_0x35a666=_0xcac44e();while(!![]){try{const _0x772dd1=parseInt(_0x12288e(0x1fd))/0x1+parseInt(_0x12288e(0x20f))/0x2*(-parseInt(_0x12288e(0x210))/0x3)+parseInt(_0x12288e(0x224))/0x4+-parseInt(_0x12288e(0x226))/0x5+parseInt(_0x12288e(0x218))/0x6+-parseInt(_0x12288e(0x1f5))/0x7+parseInt(_0x12288e(0x228))/0x8;if(_0x772dd1===_0x4dd439)break;else _0x35a666['push'](_0x35a666['shift']());}catch(_0x18a152){_0x35a666['push'](_0x35a666['shift']());}}}(a122_0x2d22,0x79e7b));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(_0x21a37f){const _0x26bd66=a122_0x4426,_0x2561b3=[];return _0x21a37f[_0x26bd66(0x21a)]&&!isValidJsHttpsUrl(_0x21a37f[_0x26bd66(0x21a)])&&_0x2561b3[_0x26bd66(0x223)]({'field':'jsUrl','message':'JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL'}),_0x21a37f['cssUrl']&&!isValidCssHttpsUrl(_0x21a37f[_0x26bd66(0x21e)])&&_0x2561b3[_0x26bd66(0x223)]({'field':'cssUrl','message':_0x26bd66(0x207)}),_0x2561b3;}export async function runMenuUpdateCore(_0x1f2517,_0x5b57a4,_0x4d7f7b,_0x272b98={}){const _0x234cf1=a122_0x4426,_0x1d576b=parseUpdateParamsFlag(_0x4d7f7b),_0x101b88=normalizeMode(_0x272b98[_0x234cf1(0x209)]);validateSelection(_0x272b98[_0x234cf1(0x21c)]);const _0x42ff3e=[];if(_0x1d576b[_0x234cf1(0x21a)])_0x42ff3e[_0x234cf1(0x223)](_0x1d576b[_0x234cf1(0x21a)]);if(_0x1d576b[_0x234cf1(0x21e)])_0x42ff3e['push'](_0x1d576b[_0x234cf1(0x21e)]);const _0x50317d=validateParams(_0x1d576b);if(_0x50317d[_0x234cf1(0x22e)]>0x0){const _0x1b3d96=_0x50317d[_0x234cf1(0x1f8)](_0x546ca2=>_0x234cf1(0x221)+_0x546ca2['field']+':\x20'+_0x546ca2[_0x234cf1(0x1ff)])[_0x234cf1(0x225)](';\x20');throw new Error(_0x234cf1(0x213)+_0x1b3d96);}if(_0x42ff3e[_0x234cf1(0x22e)]===0x0)throw new Error('Invalid\x20--params:\x20menu\x20asset-update\x20requires\x20at\x20least\x20one\x20explicit\x20JS/CSS\x20URL.\x20'+_0x234cf1(0x1f9));logger[_0x234cf1(0x208)](process[_0x234cf1(0x20c)]()),logger[_0x234cf1(0x20d)]('menu-asset-update',_0x234cf1(0x20e),{'appCode':_0x1f2517,'jsUrl':_0x1d576b[_0x234cf1(0x21a)],'cssUrl':_0x1d576b['cssUrl'],'mode':_0x101b88,'dryRun':_0x272b98[_0x234cf1(0x20b)]===!![]});if(_0x1d576b[_0x234cf1(0x21a)]){const _0x37ef12=await isUrlReachable(_0x1d576b[_0x234cf1(0x21a)]);if(!_0x37ef12)throw new Error('JS\x20URL\x20is\x20unreachable:\x20'+_0x1d576b[_0x234cf1(0x21a)]);}if(_0x1d576b[_0x234cf1(0x21e)]){const _0x44e280=await isUrlReachable(_0x1d576b[_0x234cf1(0x21e)]);if(!_0x44e280)throw new Error(_0x234cf1(0x217)+_0x1d576b[_0x234cf1(0x21e)]);}const _0x50e780=await getOnlineMenuList(_0x1f2517,_0x5b57a4),_0x51a471=_0x50e780[_0x234cf1(0x200)](_0x24ab71=>_0x24ab71[_0x234cf1(0x1ed)][_0x234cf1(0x22e)]>0x0),_0x1a7151=selectMenusForUpdate(_0x51a471,_0x272b98['selection']);if(_0x1a7151[_0x234cf1(0x22e)]===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![],'dryRun':_0x272b98[_0x234cf1(0x20b)]===!![]};const _0x31560c=_0x1a7151[_0x234cf1(0x1f8)](_0x1a38dc=>buildMenuUpdateDiff(_0x1a38dc,_0x1d576b,_0x101b88,_0x272b98[_0x234cf1(0x1fc)]===!![],_0x272b98[_0x234cf1(0x1fe)]));if(_0x272b98[_0x234cf1(0x20b)])return{'updated':0x0,'failed':0x0,'skipped':![],'dryRun':!![],'diffs':_0x31560c};const _0x11e609=await Promise['allSettled'](_0x1a7151[_0x234cf1(0x1f8)]((_0x57130f,_0x59e7af)=>updateMenuCdnUrl(_0x1f2517,_0x5b57a4,{'id':_0x57130f['id'],'label':_0x57130f['label'],'path':_0x57130f[_0x234cf1(0x1fb)],'resources':_0x31560c[_0x59e7af]['after']['resources'],'extend':_0x57130f['extend']??null,'loadScriptMode':_0x272b98[_0x234cf1(0x1fe)]}))),_0x142a08=_0x11e609[_0x234cf1(0x200)](_0x152d03=>_0x152d03['status']===_0x234cf1(0x201))['map'](_0x117471=>_0x117471[_0x234cf1(0x227)]),_0x59e507=_0x11e609[_0x234cf1(0x200)](_0x524deb=>_0x524deb[_0x234cf1(0x204)]===_0x234cf1(0x1f0))[_0x234cf1(0x22e)];return logger['info'](_0x234cf1(0x22a),_0x234cf1(0x21f),{'count':_0x1a7151[_0x234cf1(0x22e)],'resources':_0x42ff3e}),{'updated':_0x142a08[_0x234cf1(0x22e)],'failed':_0x59e507,'skipped':![],'menus':_0x142a08};}function validateSelection(_0x4e4b30){const _0x2919de=a122_0x4426;if(!_0x4e4b30)throw new Error(_0x2919de(0x1ec));if(_0x4e4b30['all']&&(_0x4e4b30[_0x2919de(0x1ea)][_0x2919de(0x22e)]>0x0||_0x4e4b30[_0x2919de(0x1f7)]['length']>0x0))throw new Error(_0x2919de(0x215));if(!_0x4e4b30[_0x2919de(0x20a)]&&_0x4e4b30['menuIds'][_0x2919de(0x22e)]===0x0&&_0x4e4b30[_0x2919de(0x1f7)][_0x2919de(0x22e)]===0x0)throw new Error(_0x2919de(0x1ec));}function a122_0x4426(_0x2d8009,_0x1b0d4a){_0x2d8009=_0x2d8009-0x1ea;const _0x2d229e=a122_0x2d22();let _0x4426f0=_0x2d229e[_0x2d8009];return _0x4426f0;}export function selectMenusForUpdate(_0x4c1bb2,_0x350732){const _0x54274d=a122_0x4426;validateSelection(_0x350732);if(_0x350732['all'])return _0x4c1bb2;const _0x36f1f8=new Set(_0x4c1bb2[_0x54274d(0x1f8)](_0xe685bc=>_0xe685bc['id'])),_0x1eef55=new Set(_0x4c1bb2[_0x54274d(0x1f8)](_0x1145ce=>_0x1145ce[_0x54274d(0x1fb)])),_0x34944d=_0x350732[_0x54274d(0x1ea)][_0x54274d(0x200)](_0x39a4bb=>!_0x36f1f8['has'](_0x39a4bb)),_0x3bd771=_0x350732[_0x54274d(0x1f7)][_0x54274d(0x200)](_0x107d40=>!_0x1eef55[_0x54274d(0x203)](_0x107d40));if(_0x34944d['length']>0x0||_0x3bd771[_0x54274d(0x22e)]>0x0){const _0x27ac72=[..._0x34944d['map'](_0x482816=>String(_0x482816)),..._0x3bd771][_0x54274d(0x225)](',\x20');throw new Error(_0x54274d(0x212)+_0x27ac72);}const _0x3ea651=new Set(_0x350732['menuIds']),_0x376306=new Set(_0x350732[_0x54274d(0x1f7)]);return _0x4c1bb2[_0x54274d(0x200)](_0x310b83=>_0x3ea651[_0x54274d(0x203)](_0x310b83['id'])||_0x376306[_0x54274d(0x203)](_0x310b83[_0x54274d(0x1fb)]));}function normalizeMode(_0x1d8a37){const _0x2981f1=a122_0x4426;if(!_0x1d8a37)return _0x2981f1(0x21d);if(_0x1d8a37==='replace'||_0x1d8a37===_0x2981f1(0x21d))return _0x1d8a37;throw new Error(_0x2981f1(0x219)+_0x1d8a37+_0x2981f1(0x220));}function buildMenuUpdateDiff(_0x13f806,_0x4d7336,_0x5cba0b,_0x23ccf8,_0x3bd57d){const _0x684219=a122_0x4426,_0x4c1c42=[..._0x13f806[_0x684219(0x1ed)]];_0x5cba0b===_0x684219(0x21d)&&assertUnambiguousPatchResources(_0x13f806,_0x4c1c42,_0x4d7336);const _0x3618d4=_0x5cba0b===_0x684219(0x21d)?patchResources(_0x4c1c42,_0x4d7336):replaceResources(_0x4d7336),_0x2c8a1f=[],_0x49dcc0=_0x4c1c42[_0x684219(0x22c)](isJsResource),_0x281050=_0x3618d4[_0x684219(0x22c)](isJsResource);if(_0x49dcc0&&!_0x281050){const _0x14abdc=_0x684219(0x1ee)+_0x13f806[_0x684219(0x229)]+'\x22\x20('+_0x13f806[_0x684219(0x1fb)]+_0x684219(0x202)+_0x684219(0x214);if(!_0x23ccf8)throw new Error(_0x14abdc);_0x2c8a1f['push'](_0x14abdc);}const _0x30480a=_0x4c1c42[_0x684219(0x22c)](isCssResource),_0x438486=_0x3618d4[_0x684219(0x22c)](isCssResource);_0x30480a&&!_0x438486&&_0x2c8a1f[_0x684219(0x223)](_0x684219(0x205)+_0x13f806[_0x684219(0x229)]+'\x22\x20('+_0x13f806[_0x684219(0x1fb)]+').');const _0x20d414=typeof _0x13f806[_0x684219(0x22d)]?.[_0x684219(0x1fe)]===_0x684219(0x1f6)?_0x13f806[_0x684219(0x22d)][_0x684219(0x1fe)]:null,_0x4dda7f=_0x3bd57d?{'loadScriptMode':_0x20d414}:{},_0x33f394=_0x3bd57d?{'loadScriptMode':_0x3bd57d}:{};return{'id':_0x13f806['id'],'label':_0x13f806['label'],'path':_0x13f806[_0x684219(0x1fb)],'mode':_0x5cba0b,'before':{'resources':_0x4c1c42,..._0x4dda7f},'after':{'resources':_0x3618d4,..._0x33f394},'warnings':_0x2c8a1f};}function replaceResources(_0x3841a0){const _0x37fe3d=a122_0x4426;return[_0x3841a0['jsUrl'],_0x3841a0[_0x37fe3d(0x21e)]][_0x37fe3d(0x200)](_0x59a7fc=>!!_0x59a7fc);}function assertUnambiguousPatchResources(_0x36b5ef,_0x45fde6,_0x975ff9){const _0x4a5a3f=a122_0x4426,_0xfcc3e8=_0x45fde6[_0x4a5a3f(0x200)](isJsResource)['length'];if(_0x975ff9[_0x4a5a3f(0x21a)]&&_0xfcc3e8>0x1)throw new Error(_0x4a5a3f(0x1f1)+_0xfcc3e8+_0x4a5a3f(0x1eb)+_0x36b5ef[_0x4a5a3f(0x229)]+_0x4a5a3f(0x1fa)+_0x36b5ef[_0x4a5a3f(0x1fb)]+')\x20'+_0x4a5a3f(0x222));const _0x105694=_0x45fde6[_0x4a5a3f(0x200)](isCssResource)[_0x4a5a3f(0x22e)];if(_0x975ff9[_0x4a5a3f(0x21e)]&&_0x105694>0x1)throw new Error('menu\x20asset-update\x20cannot\x20patch\x20'+_0x105694+'\x20existing\x20CSS\x20resources\x20for\x20\x22'+_0x36b5ef[_0x4a5a3f(0x229)]+_0x4a5a3f(0x1fa)+_0x36b5ef[_0x4a5a3f(0x1fb)]+')\x20'+_0x4a5a3f(0x22b));}function patchResources(_0x14d3af,_0x54b2a2){const _0x5da312=a122_0x4426;let _0x271b53=![],_0xb980bb=![];const _0x54f9ba=[];for(const _0x4df8f6 of _0x14d3af){if(isJsResource(_0x4df8f6)){if(_0x54b2a2[_0x5da312(0x21a)]&&!_0x271b53)_0x54f9ba['push'](_0x54b2a2['jsUrl']),_0x271b53=!![];else!_0x54b2a2[_0x5da312(0x21a)]&&_0x54f9ba[_0x5da312(0x223)](_0x4df8f6);continue;}if(isCssResource(_0x4df8f6)){if(_0x54b2a2[_0x5da312(0x21e)]&&!_0xb980bb)_0x54f9ba[_0x5da312(0x223)](_0x54b2a2[_0x5da312(0x21e)]),_0xb980bb=!![];else!_0x54b2a2[_0x5da312(0x21e)]&&_0x54f9ba[_0x5da312(0x223)](_0x4df8f6);continue;}_0x54f9ba[_0x5da312(0x223)](_0x4df8f6);}return _0x54b2a2['jsUrl']&&!_0x271b53&&_0x54f9ba['unshift'](_0x54b2a2[_0x5da312(0x21a)]),_0x54b2a2['cssUrl']&&!_0xb980bb&&_0x54f9ba[_0x5da312(0x223)](_0x54b2a2['cssUrl']),_0x54f9ba;}function isJsResource(_0x41cc7f){const _0xe16d9a=a122_0x4426;return stripQuery(_0x41cc7f)['toLowerCase']()['endsWith'](_0xe16d9a(0x21b));}function isCssResource(_0x20b191){const _0x3839b9=a122_0x4426;return stripQuery(_0x20b191)[_0x3839b9(0x1ef)]()[_0x3839b9(0x1f3)](_0x3839b9(0x1f4));}function stripQuery(_0x36ed5d){const _0x469119=a122_0x4426;return _0x36ed5d[_0x469119(0x211)]('?')[0x0]??_0x36ed5d;}function a122_0x2d22(){const _0x5cc1ad=['push','660952AbJytj','join','2123580VmScSP','value','7929056hAUmzP','label','menu-asset-update','with\x20a\x20single\x20cssUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','some','extend','length','menuIds','\x20existing\x20JS\x20resources\x20for\x20\x22','menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.','resources','menu\x20asset-update\x20would\x20remove\x20existing\x20JS\x20resource\x20for\x20\x22','toLowerCase','rejected','menu\x20asset-update\x20cannot\x20patch\x20','object','endsWith','.css','3024924bnRBZv','string','paths','map','Pass\x20--params\x20\x27{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}\x27\x20to\x20update\x20assets.','\x22\x20(','path','force','33908aARwNC','loadScriptMode','message','filter','fulfilled',').\x20','has','status','menu\x20asset-update\x20will\x20remove\x20existing\x20CSS\x20resource\x20for\x20\x22','trim','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','setLogPath','mode','all','dryRun','cwd','info','Start\x20non-interactive\x20menu\x20asset\x20update','7340ULZMNf','81MeskbX','split','menu\x20asset-update\x20selectors\x20did\x20not\x20match\x20resource-bearing\x20menus:\x20','Invalid\x20--params:\x20','Use\x20--mode\x20patch\x20to\x20preserve\x20it,\x20pass\x20jsUrl,\x20or\x20add\x20--force\x20for\x20an\x20intentional\x20removal.','--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.','isArray','CSS\x20URL\x20is\x20unreachable:\x20','1589898BqtTGt','Invalid\x20--mode:\x20','jsUrl','.js','selection','patch','cssUrl','Menu\x20asset\x20update\x20completed','.\x20Allowed\x20values:\x20replace,\x20patch','--params.','with\x20a\x20single\x20jsUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.'];a122_0x2d22=function(){return _0x5cc1ad;};return a122_0x2d22();}function parseUpdateParamsFlag(_0x2e3b02){const _0x353b84=a122_0x4426;if(!_0x2e3b02||typeof _0x2e3b02!==_0x353b84(0x1f6))return{};try{const _0x38bc40=JSON['parse'](_0x2e3b02);if(typeof _0x38bc40!==_0x353b84(0x1f2)||_0x38bc40===null||Array[_0x353b84(0x216)](_0x38bc40))return{};return{'jsUrl':typeof _0x38bc40['jsUrl']===_0x353b84(0x1f6)?_0x38bc40[_0x353b84(0x21a)][_0x353b84(0x206)]():undefined,'cssUrl':typeof _0x38bc40['cssUrl']===_0x353b84(0x1f6)?_0x38bc40[_0x353b84(0x21e)][_0x353b84(0x206)]():undefined};}catch{return{};}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3cad5d,_0x2cfb67){const _0x85ffac=a123_0x1a2e,_0x5ac702=_0x3cad5d();while(!![]){try{const _0x2eef00=parseInt(_0x85ffac(0xe9))/0x1*(-parseInt(_0x85ffac(0xec))/0x2)+-parseInt(_0x85ffac(0xf0))/0x3*(parseInt(_0x85ffac(0xf3))/0x4)+-parseInt(_0x85ffac(0xf2))/0x5+-parseInt(_0x85ffac(0xf1))/0x6+-parseInt(_0x85ffac(0xf4))/0x7+parseInt(_0x85ffac(0xed))/0x8+parseInt(_0x85ffac(0xee))/0x9;if(_0x2eef00===_0x2cfb67)break;else _0x5ac702['push'](_0x5ac702['shift']());}catch(_0x14654e){_0x5ac702['push'](_0x5ac702['shift']());}}}(a123_0x19cc,0xb0f4b));export function isValidJsHttpsUrl(_0x185964){const _0x22d6e5=a123_0x1a2e;return/^https:\/\/.+\.js(\?.*)?$/[_0x22d6e5(0xeb)](_0x185964[_0x22d6e5(0xea)]());}export function isValidCssHttpsUrl(_0x556cd0){const _0x33adff=a123_0x1a2e;return/^https:\/\/.+\.css(\?.*)?$/[_0x33adff(0xeb)](_0x556cd0['trim']());}function a123_0x19cc(){const _0x57b2e0=['769VrCpoU','trim','test','1034waTcrL','628992UmQRAp','26392221IyVQTM','HEAD','3789pasmhY','962154qnEBbL','928605zxOfjr','2972jNMMyb','4229540stjrMu'];a123_0x19cc=function(){return _0x57b2e0;};return a123_0x19cc();}function a123_0x1a2e(_0x183535,_0x15f034){_0x183535=_0x183535-0xe9;const _0x19cc8b=a123_0x19cc();let _0x1a2efa=_0x19cc8b[_0x183535];return _0x1a2efa;}export async function isUrlReachable(_0x4a6872){const _0x20751d=a123_0x1a2e;try{const _0x498313=await fetch(_0x4a6872,{'method':_0x20751d(0xef)});return _0x498313['ok'];}catch{return![];}}
|