@lovrabet/rabetbase-cli 2.3.16-beta.2 → 2.3.16-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/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/react/create.js +1 -0
- package/lib/commands/page/react/detail.js +1 -0
- package/lib/commands/page/react/list.js +1 -0
- package/lib/commands/page/react/publish.js +1 -0
- package/lib/commands/page/react/shared.js +1 -0
- package/lib/commands/page/react/syntax.js +1 -0
- package/lib/commands/page/react/template.js +1 -0
- package/lib/commands/page/react/update.js +1 -0
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-apis-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.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/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/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/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/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/templates/projects/sub-app-react-demo/CHANGELOG.md +1 -1
- package/templates/projects/sub-app-react-demo/README.md +1 -1
- package/templates/projects/sub-app-react-demo/docs/quick-start.md +1 -1
- package/templates/projects/sub-app-react-demo/src/pages/index.tsx +1 -1
- package/lib/commands/project/init.js +0 -1
- package/lib/commands/sql/save.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5ba902,_0x3c1737){const _0x149331=a120_0x32de,_0x3de7ef=_0x5ba902();while(!![]){try{const _0x2bf588=-parseInt(_0x149331(0xb5))/0x1+-parseInt(_0x149331(0xb8))/0x2*(-parseInt(_0x149331(0xc5))/0x3)+-parseInt(_0x149331(0xb2))/0x4+-parseInt(_0x149331(0xbf))/0x5+-parseInt(_0x149331(0xbc))/0x6*(-parseInt(_0x149331(0xc9))/0x7)+parseInt(_0x149331(0xa4))/0x8+parseInt(_0x149331(0xc7))/0x9;if(_0x2bf588===_0x3c1737)break;else _0x3de7ef['push'](_0x3de7ef['shift']());}catch(_0x519ab9){_0x3de7ef['push'](_0x3de7ef['shift']());}}}(a120_0x4ea8,0xeb772));function a120_0x32de(_0x59aff1,_0x151481){_0x59aff1=_0x59aff1-0x9f;const _0x4ea8f8=a120_0x4ea8();let _0x32de30=_0x4ea8f8[_0x59aff1];return _0x32de30;}import{createHash}from'node:crypto';import{getMenuTree}from'../../../core/api-client.js';export async function fetchMenuSnapshot(_0xce90f2,_0x301dec,_0x582008={}){const _0x35b864=a120_0x32de,_0x4c4ac3=await getMenuTree(_0xce90f2,_0x301dec);return buildMenuSnapshot(Array[_0x35b864(0xaa)](_0x4c4ac3)?_0x4c4ac3:[],_0x582008);}export function buildMenuSnapshot(_0x3275af,_0x292c90={}){const _0xd21832=a120_0x32de,_0x1d0345=flattenMenuItems(_0x3275af,{'verbose':_0x292c90[_0xd21832(0xca)]===!![],'parentId':null,'depth':0x0}),_0x43c4ce=new Map(_0x1d0345['map'](_0x4124c7=>[_0x4124c7['id'],_0x4124c7])),_0x166223=createHash(_0xd21832(0xce))['update'](JSON[_0xd21832(0xbb)](_0x1d0345['map'](toHashInput)))['digest'](_0xd21832(0xa5));return{'total':_0x1d0345[_0xd21832(0xa9)],'hash':_0xd21832(0xa7)+_0x166223,'menus':_0x1d0345,'byId':_0x43c4ce};}export function toProcessedMenuItem(_0x4a633a){const _0x19d870=a120_0x32de;return{'id':_0x4a633a['id'],'path':_0x4a633a[_0x19d870(0xcb)],'label':_0x4a633a['label'],'resources':[..._0x4a633a[_0x19d870(0xa0)]],'extend':_0x4a633a['extend']??null};}export function toMenuListItem(_0x4ee4c5){const {modelType:_0xd9f713,datasetId:_0x40021f,datasetCode:_0x430001,resourcesValid:_0x54bbf5,..._0x1398c7}=_0x4ee4c5;return _0x1398c7;}function a120_0x4ea8(){const _0x5a74d0=['isArray','POSITIVE_INFINITY','sort','extend','string','valid','updateTime','label','4362636WmuvqP','values','visible','38066viwbDP','pageType','datasetId','2tXqTDu','updateUserName','filter','stringify','1636374HqqbJW','type','depth','7430505lOwcyh','map','modelType','children','datasetCode','parentId','883131cQAhQP','item','5129199zxAvIn','updateUserId','42olUkBH','verbose','path','parse','isFinite','sha256','number','boolean','resources','childrenIds','url','push','8629040pttjRn','hex','pageId','sha256:','index','length'];a120_0x4ea8=function(){return _0x5a74d0;};return a120_0x4ea8();}export function getChildren(_0xd10b09,_0x249b8b){const _0x56d9ea=a120_0x32de;return _0xd10b09['menus'][_0x56d9ea(0xba)](_0x59b0de=>_0x59b0de['parentId']===_0x249b8b);}function flattenMenuItems(_0x2909b5,_0x32e17d){const _0x5c45d5=a120_0x32de,_0x126ab5=sortMenuItems(_0x2909b5),_0x21203a=[];for(const _0x470251 of _0x126ab5){const _0x1e9f91=sortMenuItems(Array[_0x5c45d5(0xaa)](_0x470251[_0x5c45d5(0xc2)])?_0x470251[_0x5c45d5(0xc2)]:[]);_0x21203a[_0x5c45d5(0xa3)](toMenuFact(_0x470251,_0x1e9f91,_0x32e17d)),_0x1e9f91['length']>0x0&&_0x21203a['push'](...flattenMenuItems(_0x1e9f91,{'verbose':_0x32e17d[_0x5c45d5(0xca)],'parentId':_0x470251['id'],'depth':_0x32e17d[_0x5c45d5(0xbe)]+0x1}));}return _0x21203a;}function sortMenuItems(_0xa81a9d){const _0x1e3ce8=a120_0x32de;return _0xa81a9d[_0x1e3ce8(0xc0)]((_0x4a2899,_0x2bbea7)=>({'item':_0x4a2899,'index':_0x2bbea7}))['sort']((_0x2c381a,_0x31e587)=>{const _0x5f4511=_0x1e3ce8,_0x22fe4e=normalizeSort(_0x2c381a[_0x5f4511(0xc6)][_0x5f4511(0xac)]),_0xfb430d=normalizeSort(_0x31e587['item'][_0x5f4511(0xac)]);if(_0x22fe4e!==_0xfb430d)return _0x22fe4e-_0xfb430d;return _0x2c381a[_0x5f4511(0xa8)]-_0x31e587[_0x5f4511(0xa8)];})[_0x1e3ce8(0xc0)](({item:_0xc25df0})=>_0xc25df0);}function toMenuFact(_0x3bdaa2,_0x2e0108,_0x1e7249){const _0x7d5df=a120_0x32de,_0x47d548=normalizeResourceValue(_0x3bdaa2['extend']?.[_0x7d5df(0xa0)]),_0x458fc8={'id':_0x3bdaa2['id'],'parentId':_0x1e7249[_0x7d5df(0xc4)],'depth':_0x1e7249[_0x7d5df(0xbe)],'label':normalizeString(_0x3bdaa2[_0x7d5df(0xb1)]),'path':normalizeString(_0x3bdaa2[_0x7d5df(0xcb)]),'url':normalizeString(_0x3bdaa2['url']),'type':normalizeString(_0x3bdaa2[_0x7d5df(0xbd)]),'visible':typeof _0x3bdaa2[_0x7d5df(0xb4)]===_0x7d5df(0x9f)?_0x3bdaa2[_0x7d5df(0xb4)]:null,'sort':typeof _0x3bdaa2[_0x7d5df(0xac)]===_0x7d5df(0xcf)&&Number[_0x7d5df(0xcd)](_0x3bdaa2[_0x7d5df(0xac)])?_0x3bdaa2[_0x7d5df(0xac)]:null,'resources':_0x47d548['values'],'resourcesValid':_0x47d548[_0x7d5df(0xaf)],'childrenIds':_0x2e0108[_0x7d5df(0xc0)](_0x1b4a13=>_0x1b4a13['id']),'childrenCount':_0x2e0108[_0x7d5df(0xa9)],'pageId':normalizeNullableNumber(_0x3bdaa2[_0x7d5df(0xa6)]),'pageType':normalizeString(_0x3bdaa2[_0x7d5df(0xb6)]),'modelType':normalizeString(_0x3bdaa2[_0x7d5df(0xc1)]),'datasetId':normalizeNullableNumber(_0x3bdaa2[_0x7d5df(0xb7)]),'datasetCode':normalizeString(_0x3bdaa2[_0x7d5df(0xc3)]),'updateUserId':normalizeNullableString(_0x3bdaa2['updateUserId']),'updateUserName':normalizeNullableString(_0x3bdaa2[_0x7d5df(0xb9)]),'updateTime':normalizeNullableTimestamp(_0x3bdaa2['updateTime'])};return _0x1e7249[_0x7d5df(0xca)]&&(_0x458fc8[_0x7d5df(0xad)]=_0x3bdaa2[_0x7d5df(0xad)]??null),_0x458fc8;}function toHashInput(_0xb4b27){const _0x1304f3=a120_0x32de;return{'id':_0xb4b27['id'],'parentId':_0xb4b27[_0x1304f3(0xc4)],'label':_0xb4b27[_0x1304f3(0xb1)],'path':_0xb4b27[_0x1304f3(0xcb)],'url':_0xb4b27[_0x1304f3(0xa2)],'type':_0xb4b27[_0x1304f3(0xbd)],'visible':_0xb4b27[_0x1304f3(0xb4)],'sort':_0xb4b27['sort'],'resources':_0xb4b27[_0x1304f3(0xa0)],'resourcesValid':_0xb4b27['resourcesValid'],'childrenIds':_0xb4b27[_0x1304f3(0xa1)],'pageId':_0xb4b27['pageId'],'pageType':_0xb4b27[_0x1304f3(0xb6)],'modelType':_0xb4b27[_0x1304f3(0xc1)],'datasetId':_0xb4b27[_0x1304f3(0xb7)],'datasetCode':_0xb4b27[_0x1304f3(0xc3)],'updateUserId':_0xb4b27[_0x1304f3(0xc8)],'updateUserName':_0xb4b27['updateUserName'],'updateTime':_0xb4b27[_0x1304f3(0xb0)]};}function normalizeSort(_0x27e2ab){const _0x47c971=a120_0x32de;return typeof _0x27e2ab===_0x47c971(0xcf)&&Number[_0x47c971(0xcd)](_0x27e2ab)?_0x27e2ab:Number[_0x47c971(0xab)];}function normalizeString(_0x537793){const _0x113c31=a120_0x32de;return typeof _0x537793===_0x113c31(0xae)?_0x537793:'';}function normalizeNullableNumber(_0x4afc6c){const _0x4b2d11=a120_0x32de;return typeof _0x4afc6c===_0x4b2d11(0xcf)&&Number[_0x4b2d11(0xcd)](_0x4afc6c)?_0x4afc6c:null;}function normalizeNullableString(_0x13001b){const _0xdefa36=a120_0x32de;return typeof _0x13001b===_0xdefa36(0xae)&&_0x13001b[_0xdefa36(0xa9)]>0x0?_0x13001b:null;}function normalizeNullableTimestamp(_0x34c01f){const _0x18bb14=a120_0x32de;if(typeof _0x34c01f===_0x18bb14(0xae))return _0x34c01f[_0x18bb14(0xa9)]>0x0?_0x34c01f:null;return typeof _0x34c01f===_0x18bb14(0xcf)&&Number[_0x18bb14(0xcd)](_0x34c01f)?_0x34c01f:null;}export function normalizeResources(_0x57513b){const _0x281d8f=a120_0x32de;return normalizeResourceValue(_0x57513b)[_0x281d8f(0xb3)];}function normalizeResourceValue(_0x1a43cc){const _0x1c11c8=a120_0x32de;if(_0x1a43cc==null)return{'values':[],'valid':!![]};if(Array[_0x1c11c8(0xaa)](_0x1a43cc))return{'values':_0x1a43cc[_0x1c11c8(0xc0)](String),'valid':!![]};if(typeof _0x1a43cc!==_0x1c11c8(0xae))return{'values':[],'valid':![]};try{const _0x1df8e0=JSON[_0x1c11c8(0xcc)](_0x1a43cc);return Array[_0x1c11c8(0xaa)](_0x1df8e0)?{'values':_0x1df8e0['map'](String),'valid':!![]}:{'values':[],'valid':![]};}catch{return{'values':[],'valid':![]};}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3416a6,_0x2ce436){var _0x1e55a6=a121_0x4108,_0x14e6ad=_0x3416a6();while(!![]){try{var _0x4356b0=-parseInt(_0x1e55a6(0x1d6))/0x1*(parseInt(_0x1e55a6(0x1da))/0x2)+parseInt(_0x1e55a6(0x1d2))/0x3*(-parseInt(_0x1e55a6(0x1d5))/0x4)+-parseInt(_0x1e55a6(0x1d8))/0x5*(-parseInt(_0x1e55a6(0x1d9))/0x6)+parseInt(_0x1e55a6(0x1d7))/0x7+-parseInt(_0x1e55a6(0x1d4))/0x8+-parseInt(_0x1e55a6(0x1d0))/0x9+parseInt(_0x1e55a6(0x1d3))/0xa*(parseInt(_0x1e55a6(0x1d1))/0xb);if(_0x4356b0===_0x2ce436)break;else _0x14e6ad['push'](_0x14e6ad['shift']());}catch(_0x2ddc1e){_0x14e6ad['push'](_0x14e6ad['shift']());}}}(a121_0x1096,0x378ad));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 a121_0x4108(_0x38f550,_0x650fe2){_0x38f550=_0x38f550-0x1d0;var _0x1096d0=a121_0x1096();var _0x41086d=_0x1096d0[_0x38f550];return _0x41086d;}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';function a121_0x1096(){var _0x1a2977=['10HyCuSn','802120IcXyqN','119244KtVjtl','68410TLKxnL','267953tkaZwQ','5LOdHRu','1400598VAGjcY','2hroWDN','3102201CssGrh','6472367RLxrWK','12eCaHIA'];a121_0x1096=function(){return _0x1a2977;};return a121_0x1096();}export*from'../../../commands/menu/shared/update-core.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x565e8c,_0x3e1d6d){const _0x5b35f1=a122_0x545c,_0x40849f=_0x565e8c();while(!![]){try{const _0x1ccb89=-parseInt(_0x5b35f1(0x17e))/0x1+-parseInt(_0x5b35f1(0x165))/0x2*(parseInt(_0x5b35f1(0x15b))/0x3)+parseInt(_0x5b35f1(0x16d))/0x4+-parseInt(_0x5b35f1(0x158))/0x5*(parseInt(_0x5b35f1(0x157))/0x6)+-parseInt(_0x5b35f1(0x179))/0x7+-parseInt(_0x5b35f1(0x17f))/0x8*(parseInt(_0x5b35f1(0x159))/0x9)+parseInt(_0x5b35f1(0x163))/0xa;if(_0x1ccb89===_0x3e1d6d)break;else _0x40849f['push'](_0x40849f['shift']());}catch(_0x3bbbd4){_0x40849f['push'](_0x40849f['shift']());}}}(a122_0x32b9,0x9f4ab));import a122_0x3920e5 from'chalk';import{checkbox,input,confirm}from'@inquirer/prompts';import a122_0x36426f from'ora';import{isUrlReachable}from'../../../commands/menu/shared/valid-url.js';import{CliErrors}from'../../../errors.js';function onCancel(_0x40e338){const _0x5c9a3b=a122_0x545c;return _0x40e338[_0x5c9a3b(0x166)](_0xb2b965=>{const _0x294173=_0x5c9a3b;if(_0xb2b965?.['name']===_0x294173(0x173))throw CliErrors[_0x294173(0x176)](_0x294173(0x17b));throw _0xb2b965;});}export function startSpinner(_0x3ec752){const _0x9602e3=a122_0x545c;return a122_0x36426f({'text':_0x3ec752,'color':_0x9602e3(0x171)})[_0x9602e3(0x162)]();}export function stopSpinner(_0x8b5be8,_0x4924dc,_0x1fe718){const _0x5e696b=a122_0x545c;_0x1fe718?_0x8b5be8[_0x5e696b(0x168)](_0x4924dc):_0x8b5be8['fail'](_0x4924dc);}export async function askConfirm(_0x8c39f7){return onCancel(confirm({'message':_0x8c39f7,'theme':{'prefix':''}}));}export async function askJsUrl(_0x137c0f){const _0x593475=a122_0x545c;while(!![]){const _0x237bb4=await onCancel(input({'message':'\x20\x20JS\x20URL:','default':_0x137c0f,'theme':{'prefix':''}}));if(_0x237bb4[_0x593475(0x167)]()==='')throw CliErrors['cancelled']('Cancelled.');if(!/^https:\/\/.+\.js(\?.*)?$/[_0x593475(0x15a)](_0x237bb4[_0x593475(0x167)]())){console[_0x593475(0x16b)](a122_0x3920e5['red'](_0x593475(0x177)));continue;}const _0x455833=startSpinner('\x20\x20Checking\x20JS\x20URL\x20reachability...');try{const _0x292e7b=await isUrlReachable(_0x237bb4[_0x593475(0x167)]());stopSpinner(_0x455833,_0x593475(0x161),_0x292e7b);if(!_0x292e7b){console[_0x593475(0x16b)](a122_0x3920e5['red']('\x20\x20✗\x20JS\x20URL\x20is\x20unreachable'));continue;}return _0x237bb4[_0x593475(0x167)]();}catch(_0x22bfd7){stopSpinner(_0x455833,_0x593475(0x16c),![]);throw _0x22bfd7;}}}function a122_0x32b9(){const _0x16b680=['28807000kAKPUl','\x20\x20✗\x20CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','2WANNRH','catch','trim','succeed','red','map','error','JS\x20URL\x20check\x20failed','3674212ONkgPj','stdin','\x20\x20Select\x20menus\x20to\x20sync\x20(space\x20to\x20toggle,\x20a=all,\x20i=invert):','isTTY','cyan','filter','ExitPromptError','green','CSS\x20URL\x20checked','cancelled','\x20\x20✗\x20JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','length','8264382rtDjhY','No\x20menus\x20selected.','Cancelled.','has','path','139254dVMKQl','552SRWKBl','gray','2748NjOLVU','10550WzADkd','71451dwXzKD','test','938229iNueop','\x20\x20Checking\x20CSS\x20URL\x20reachability...','[new]','label','CSS\x20URL\x20check\x20failed','\x20\x20✗\x20CSS\x20URL\x20is\x20unreachable','JS\x20URL\x20checked','start'];a122_0x32b9=function(){return _0x16b680;};return a122_0x32b9();}export async function askCssUrl(_0xcb68a1){const _0x456dbc=a122_0x545c;while(!![]){const _0x584681=await onCancel(input({'message':'\x20\x20CSS\x20URL:','default':_0xcb68a1,'theme':{'prefix':''}}));if(_0x584681[_0x456dbc(0x167)]()==='')throw CliErrors[_0x456dbc(0x176)]('Cancelled.');if(!/^https:\/\/.+\.css(\?.*)?$/['test'](_0x584681[_0x456dbc(0x167)]())){console[_0x456dbc(0x16b)](a122_0x3920e5['red'](_0x456dbc(0x164)));continue;}const _0x45ea6c=startSpinner(_0x456dbc(0x15c));try{const _0x51237d=await isUrlReachable(_0x584681[_0x456dbc(0x167)]());stopSpinner(_0x45ea6c,_0x456dbc(0x175),_0x51237d);if(!_0x51237d){console[_0x456dbc(0x16b)](a122_0x3920e5[_0x456dbc(0x169)](_0x456dbc(0x160)));continue;}return _0x584681[_0x456dbc(0x167)]();}catch(_0x454b3b){stopSpinner(_0x45ea6c,_0x456dbc(0x15f),![]);throw _0x454b3b;}}}function a122_0x545c(_0x588a2a,_0x5f5b87){_0x588a2a=_0x588a2a-0x157;const _0x32b9fc=a122_0x32b9();let _0x545c44=_0x32b9fc[_0x588a2a];return _0x545c44;}export async function selectPages(_0x3bb05d,_0x5598a0){const _0x530a6f=a122_0x545c,_0x595add=_0x3bb05d[_0x530a6f(0x16a)](_0x194b52=>{const _0x5aa7d0=_0x530a6f,_0x4aeb21=_0x5598a0[_0x5aa7d0(0x17c)](_0x194b52[_0x5aa7d0(0x17d)]);return{'name':_0x194b52[_0x5aa7d0(0x15e)]+'\x20\x20'+a122_0x3920e5['gray'](_0x194b52[_0x5aa7d0(0x17d)])+'\x20\x20'+(_0x4aeb21?a122_0x3920e5[_0x5aa7d0(0x180)]('[already\x20on\x20platform]'):a122_0x3920e5[_0x5aa7d0(0x174)](_0x5aa7d0(0x15d))),'value':_0x194b52[_0x5aa7d0(0x17d)],'checked':!_0x4aeb21,'disabled':_0x4aeb21};});if(_0x595add[_0x530a6f(0x178)]===0x0)throw new Error('No\x20local\x20pages\x20found.');const _0x80c4b5=await onCancel(checkbox({'message':_0x530a6f(0x16f),'choices':_0x595add,'loop':![],'theme':{'prefix':''}}));if(_0x80c4b5[_0x530a6f(0x178)]===0x0)throw new Error(_0x530a6f(0x17a));return _0x3bb05d[_0x530a6f(0x172)](_0x206620=>_0x80c4b5['includes'](_0x206620[_0x530a6f(0x17d)]));}export function isInteractive(){const _0x361334=a122_0x545c;return process[_0x361334(0x16e)][_0x361334(0x170)]===!![];}export function requireInteractive(){if(!isInteractive())throw new Error('This\x20command\x20requires\x20an\x20interactive\x20terminal.\x20'+'Use\x20--yes\x20to\x20run\x20in\x20non-interactive\x20mode,\x20or\x20pipe\x20data\x20via\x20--params.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a123_0x281dd3=a123_0x502c;(function(_0x4195fd,_0x10c465){const _0x256df8=a123_0x502c,_0x1f5bdf=_0x4195fd();while(!![]){try{const _0x472397=parseInt(_0x256df8(0x1bb))/0x1*(-parseInt(_0x256df8(0x1cb))/0x2)+-parseInt(_0x256df8(0x1c3))/0x3+parseInt(_0x256df8(0x1c8))/0x4*(-parseInt(_0x256df8(0x1ba))/0x5)+-parseInt(_0x256df8(0x1b9))/0x6*(-parseInt(_0x256df8(0x1bc))/0x7)+parseInt(_0x256df8(0x1b8))/0x8*(-parseInt(_0x256df8(0x1cf))/0x9)+parseInt(_0x256df8(0x1c6))/0xa+parseInt(_0x256df8(0x1bf))/0xb;if(_0x472397===_0x10c465)break;else _0x1f5bdf['push'](_0x1f5bdf['shift']());}catch(_0x56f31a){_0x1f5bdf['push'](_0x1f5bdf['shift']());}}}(a123_0x2e14,0x91d38));function a123_0x502c(_0x422935,_0x155712){_0x422935=_0x422935-0x1b5;const _0x2e14d6=a123_0x2e14();let _0x502ce3=_0x2e14d6[_0x422935];return _0x502ce3;}import{readdirSync,statSync,readFileSync}from'fs';import{join,relative,resolve,sep}from'path';function a123_0x2e14(){const _0x584272=['trim','6540810gCCbKn','split','4OCqZKJ','index.tsx','replace','6446OTsBug','filter','match','join','99kOjzAc','\x5c.displayName\x5cs*=\x5cs*[\x22\x27]([^\x22\x27]+)[\x22\x27]','src/pages','replaceAll','446776YAAtCT','2274YZqJZF','1509395ieafKa','10arTBUB','7217hYWqSr','endsWith','cwd','12220395UJPtgj','forEach','slice','.tsx','1830135xugjNu','concat'];a123_0x2e14=function(){return _0x584272;};return a123_0x2e14();}const pagesDir=resolve(process[a123_0x281dd3(0x1be)](),a123_0x281dd3(0x1b6));export function extractTitleFromComment(_0x5b6557){const _0x237848=a123_0x281dd3;try{const _0x2c1e2a=readFileSync(_0x5b6557,'utf-8'),_0x1cb739=_0x2c1e2a[_0x237848(0x1cd)](/^\s*\/\*\*?([\s\S]*?)\*\//);if(_0x1cb739&&_0x1cb739[0x1]){const _0x5351d0=_0x1cb739[0x1],_0x5ef697=_0x5351d0[_0x237848(0x1cd)](/^\s*\*?\s*title\s*:\s*(.+)/im);if(_0x5ef697&&_0x5ef697[0x1])return _0x5ef697[0x1][_0x237848(0x1c5)]();}let _0x39820c=null;const _0x3556e8=_0x2c1e2a['match'](/export\s+default\s+([A-Z][a-zA-Z0-9]*)/);_0x3556e8&&_0x3556e8[0x1]&&(_0x39820c=_0x3556e8[0x1]);if(!_0x39820c){const _0x7a66e2=_0x2c1e2a['match'](/export\s+default\s+function\s+([A-Z][a-zA-Z0-9]*)/);_0x7a66e2&&_0x7a66e2[0x1]&&(_0x39820c=_0x7a66e2[0x1]);}if(_0x39820c){const _0x571e29=new RegExp('\x5cb'+_0x39820c+_0x237848(0x1b5)),_0x558ad9=_0x2c1e2a['match'](_0x571e29);if(_0x558ad9&&_0x558ad9[0x1])return _0x558ad9[0x1];return _0x39820c;}return null;}catch(_0x57a0b2){return null;}}export function getLocalPages(_0x5ccf7e=pagesDir,_0x47eb96=pagesDir){const _0x14ca2d=a123_0x281dd3;let _0x2a0a66=[];const _0x56d33e=readdirSync(_0x5ccf7e);return _0x56d33e[_0x14ca2d(0x1c0)](_0x36eb01=>{const _0x426995=_0x14ca2d,_0x31db3c=join(_0x5ccf7e,_0x36eb01),_0x5e55a0=statSync(_0x31db3c);if(_0x5e55a0&&_0x5e55a0['isDirectory']())_0x2a0a66=_0x2a0a66[_0x426995(0x1c4)](getLocalPages(_0x31db3c,_0x47eb96));else{if(_0x36eb01[_0x426995(0x1bd)](_0x426995(0x1c2))){let _0xeb64b3=relative(_0x47eb96,_0x31db3c);_0xeb64b3[_0x426995(0x1bd)](_0x426995(0x1c9))?_0xeb64b3=_0xeb64b3[_0x426995(0x1ca)](/index\.tsx$/,''):_0xeb64b3=_0xeb64b3['replace'](/\.tsx$/,'');_0xeb64b3['endsWith'](sep)&&(_0xeb64b3=_0xeb64b3[_0x426995(0x1c1)](0x0,-0x1));const _0x492e93=_0xeb64b3[_0x426995(0x1c7)](sep)[_0x426995(0x1ce)]('/'),_0x496f91=extractTitleFromComment(_0x31db3c),_0x2c1829=_0x496f91||_0x492e93;_0x2a0a66['push']({'path':_0x492e93[_0x426995(0x1b7)]('$',':'),'label':_0x2c1829});}}}),_0x2a0a66[_0x14ca2d(0x1cc)](_0x596dec=>_0x596dec['path']!=='');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x39e8c4,_0x4c9d38){const _0x15ec17=a124_0x6ce6,_0x41b1d9=_0x39e8c4();while(!![]){try{const _0x2758c8=-parseInt(_0x15ec17(0x9c))/0x1*(-parseInt(_0x15ec17(0x93))/0x2)+-parseInt(_0x15ec17(0x98))/0x3*(-parseInt(_0x15ec17(0x8d))/0x4)+parseInt(_0x15ec17(0xa0))/0x5+parseInt(_0x15ec17(0x9d))/0x6*(-parseInt(_0x15ec17(0x95))/0x7)+parseInt(_0x15ec17(0x97))/0x8*(-parseInt(_0x15ec17(0x96))/0x9)+-parseInt(_0x15ec17(0x9f))/0xa*(parseInt(_0x15ec17(0x8c))/0xb)+parseInt(_0x15ec17(0xa1))/0xc;if(_0x2758c8===_0x4c9d38)break;else _0x41b1d9['push'](_0x41b1d9['shift']());}catch(_0x225460){_0x41b1d9['push'](_0x41b1d9['shift']());}}}(a124_0x1ec3,0xc99f2));import{getLocalPages}from'../../../commands/menu/shared/local-pages.js';import{getOnlineMenuList,createMenus}from'../../../commands/menu/shared/service.js';function a124_0x6ce6(_0x3498e5,_0xcaf58e){_0x3498e5=_0x3498e5-0x8c;const _0x1ec3c2=a124_0x1ec3();let _0x6ce684=_0x1ec3c2[_0x3498e5];return _0x6ce684;}import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';export function validateJsUrl(_0x32756d){const _0x1eeb00=a124_0x6ce6,_0x2236ef=[];return!isValidJsHttpsUrl(_0x32756d)&&_0x2236ef[_0x1eeb00(0x94)](_0x1eeb00(0x9e)),{'ok':_0x2236ef[_0x1eeb00(0x9a)]===0x0,'errors':_0x2236ef};}export function validateCssUrl(_0x10bdb3){const _0x3f6163=a124_0x6ce6,_0x37c0db=[];return!isValidCssHttpsUrl(_0x10bdb3)&&_0x37c0db[_0x3f6163(0x94)](_0x3f6163(0x92)),{'ok':_0x37c0db[_0x3f6163(0x9a)]===0x0,'errors':_0x37c0db};}export async function validateJsUrlReachable(_0x384f9b){const _0x32d302=a124_0x6ce6,_0x38121d=validateJsUrl(_0x384f9b);if(!_0x38121d['ok'])return _0x38121d;const _0x3ed858=await isUrlReachable(_0x384f9b);if(!_0x3ed858)_0x38121d[_0x32d302(0x90)]['push'](_0x32d302(0x9b));return{'ok':_0x38121d[_0x32d302(0x90)][_0x32d302(0x9a)]===0x0,'errors':_0x38121d[_0x32d302(0x90)]};}export async function validateCssUrlReachable(_0xdfab1a){const _0x366cea=a124_0x6ce6,_0x124c6=validateCssUrl(_0xdfab1a);if(!_0x124c6['ok'])return _0x124c6;const _0x1ebc51=await isUrlReachable(_0xdfab1a);if(!_0x1ebc51)_0x124c6[_0x366cea(0x90)][_0x366cea(0x94)]('CSS\x20URL\x20is\x20unreachable');return{'ok':_0x124c6[_0x366cea(0x90)]['length']===0x0,'errors':_0x124c6[_0x366cea(0x90)]};}export function buildCompareRows(_0x58772e,_0x30f938){const _0x54e245=a124_0x6ce6;return _0x58772e['map'](_0xe0f013=>({'label':_0xe0f013[_0x54e245(0x8f)],'path':_0xe0f013[_0x54e245(0x91)],'local':!![],'online':_0x30f938['has'](_0xe0f013[_0x54e245(0x91)])}));}export async function doCreateMenus(_0x2a4e73,_0x52eab8,_0x3cebdf,_0x283f48){const _0x3cdfac=a124_0x6ce6,_0x30ac9e=await createMenus(_0x2a4e73,_0x52eab8,_0x3cebdf,_0x283f48);return{'created':_0x30ac9e[_0x3cdfac(0x9a)],'failed':0x0,'labels':_0x3cebdf[_0x3cdfac(0x8e)](_0x663d1f=>_0x663d1f[_0x3cdfac(0x8f)]),'menus':_0x30ac9e};}export function filterMenusWithResources(_0x486d54){const _0x4183cc=a124_0x6ce6;return _0x486d54['filter'](_0x555d83=>_0x555d83[_0x4183cc(0x99)][_0x4183cc(0x9a)]>0x0);}function a124_0x1ec3(){const _0x53022d=['155993hvrjJP','42GlycBv','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','10ZYIzAY','4680535YLSnDQ','14515044mQqQfV','14699839oaznPD','4WmuTKY','map','label','errors','path','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','6wQnwBS','push','1250907DethAj','274707ELKWhf','56tXFtcX','3039258yLyyCj','resources','length','JS\x20URL\x20is\x20unreachable'];a124_0x1ec3=function(){return _0x53022d;};return a124_0x1ec3();}export async function fetchMenuData(_0x479af8,_0x56c68a){const _0x4b7516=a124_0x6ce6,_0x992de7=getLocalPages(),_0x2c2a80=await getOnlineMenuList(_0x479af8,_0x56c68a),_0x34585f=new Set(_0x2c2a80[_0x4b7516(0x8e)](_0x7f6c08=>_0x7f6c08['path']));return{'localPages':_0x992de7,'onlineMenuList':_0x2c2a80,'onlinePaths':_0x34585f};}export async function fetchOnlineMenuList(_0x5557f2,_0xbcd727){return getOnlineMenuList(_0x5557f2,_0xbcd727);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a125_0x120514=a125_0xd3ff;(function(_0x4c2137,_0xd6584d){const _0x101553=a125_0xd3ff,_0x63b5da=_0x4c2137();while(!![]){try{const _0x319a4e=-parseInt(_0x101553(0x163))/0x1*(-parseInt(_0x101553(0x154))/0x2)+-parseInt(_0x101553(0x115))/0x3+-parseInt(_0x101553(0x135))/0x4*(-parseInt(_0x101553(0x120))/0x5)+parseInt(_0x101553(0x14d))/0x6*(parseInt(_0x101553(0x157))/0x7)+-parseInt(_0x101553(0x10d))/0x8*(parseInt(_0x101553(0x141))/0x9)+-parseInt(_0x101553(0x11e))/0xa*(parseInt(_0x101553(0x11f))/0xb)+-parseInt(_0x101553(0x177))/0xc*(-parseInt(_0x101553(0x156))/0xd);if(_0x319a4e===_0xd6584d)break;else _0x63b5da['push'](_0x63b5da['shift']());}catch(_0xf7879a){_0x63b5da['push'](_0x63b5da['shift']());}}}(a125_0x2032,0x940d3));import{CliError,CliErrors}from'../../../errors.js';function a125_0xd3ff(_0x159a99,_0x18ac00){_0x159a99=_0x159a99-0x10d;const _0x203288=a125_0x2032();let _0xd3ff7f=_0x203288[_0x159a99];return _0xd3ff7f;}import{fetchMenuSnapshot,getChildren}from'../../../commands/menu/shared/facts.js';export const MAX_MENU_SORT=0x7fffffff;export const MENU_ID_FLAG={'name':'id','type':a125_0x120514(0x147),'required':!![],'description':a125_0x120514(0x119)};export const MENU_SORT_FLAG={'name':a125_0x120514(0x171),'type':a125_0x120514(0x147),'description':a125_0x120514(0x142)};export const MENU_PARENT_ID_FLAG={'name':a125_0x120514(0x167),'type':a125_0x120514(0x126),'description':a125_0x120514(0x16c)};function a125_0x2032(){const _0x280244=['call','Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20use\x20an\x20exact\x20id\x20from\x20the\x20current\x20app.','succeeded','menu_permission_denied','map','expect-parent-id','Reorder\x20sibling\x20menus\x20below\x20','1285188aJYsAM','api_error','defineProperty','expect-path','Exact\x20online\x20menu\x20id','\x20must\x20be\x20a\x20positive\x20menu\x20id\x20or\x20root.','message','menu_confirmation_required','menu_parent_not_folder','390JEkkPH','205161MFKRaW','5qnEhSa','warnings','error','code','selector','get','string','failed','pre-write-recheck','Choose\x20a\x20menu\x20whose\x20type\x20is\x20folder,\x20or\x20use\x20root.','bool','--expected-children-count\x20must\x20be\x20a\x20non-negative\x20integer.','rawFlags','\x20is\x20type\x20\x22','hash','snapshotHash','\x20menu\x20','after','type','Online\x20menu\x20state\x20changed\x20before\x20','unknown','2131964lLpWgi','menu_not_found','folder','stringify','num','trim','str','Abort\x20unless\x20the\x20current\x20direct\x20child\x20count\x20matches','read\x20online\x20menu\x20facts\x20before\x20','test','validation','Re-run\x20the\x20command\x20with\x20--dry-run\x20and\x20update\x20the\x20expect\x20flags\x20before\x20retrying.','1273059TPTNjw','Sibling\x20sort\x20value\x20(non-negative\x20integer)','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.','stage','byId','targets','number','recheck\x20online\x20menu\x20facts\x20before\x20','prototype','yes','path','cascade','6QrkTJe','Cannot\x20append\x20a\x20','plannedActions','--id\x20must\x20be\x20a\x20positive\x20integer\x20menu\x20id.','\x22,\x20not\x20folder.','deleteOrder','Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20to\x20inspect\x20the\x20latest\x20online\x20menu\x20state.','708LiRVcF','dryRun','123019dJoACK','7329602vFHlNp','Abort\x20unless\x20the\x20current\x20parent\x20id\x20matches;\x20use\x20root\x20for\x20root\x20level','menu_state_drift','max','expected-children-count','The\x20write\x20may\x20already\x20have\x20taken\x20effect.\x20Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20inspect\x20the\x20returned\x20id\x20before\x20retrying.','operation','menu_verification_failed','hint',';\x20the\x20planned\x20snapshot\x20is\x20no\x20longer\x20current.','before','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20again\x20and\x20review\x20the\x20latest\x20snapshot\x20before\x20retrying.','1OLYmNr','data','Menu\x20','childrenCount','parent-id','\x20path\x20changed:\x20expected\x20','\x20child\x20count\x20changed:\x20expected\x20','verification','\x20parent\x20changed:\x20expected\x20','Parent\x20folder\x20id;\x20use\x20root\x20for\x20a\x20root-level\x20node','length',',\x20current\x20','\x20because\x20the\x20current\x20maximum\x20sibling\x20sort\x20is\x20','appCode','sort','required','root','Abort\x20unless\x20the\x20current\x20menu\x20path\x20exactly\x20matches','flagMissing','hasOwnProperty','948CAtyud','planFile','Permission\x20denied\x20while\x20attempting\x20to\x20','backend','isSafeInteger','Online\x20menu\x20not\x20found:\x20','Confirm\x20that\x20the\x20current\x20account\x20can\x20manage\x20menus\x20for\x20this\x20app.','32QccBnE'];a125_0x2032=function(){return _0x280244;};return a125_0x2032();}export const MENU_EXPECT_PARENT_ID_FLAG={'name':'expect-parent-id','type':a125_0x120514(0x126),'description':a125_0x120514(0x158)};export const MENU_EXPECT_FLAGS=[MENU_EXPECT_PARENT_ID_FLAG,{'name':a125_0x120514(0x118),'type':a125_0x120514(0x126),'description':a125_0x120514(0x174)},{'name':a125_0x120514(0x15b),'type':a125_0x120514(0x147),'description':a125_0x120514(0x13c)}];export function validateExactId(_0x222f78){const _0x163223=a125_0x120514,_0x1b3a09=_0x222f78[_0x163223(0x139)]('id');if(!Number[_0x163223(0x17b)](_0x1b3a09)||_0x1b3a09<=0x0)throw CliErrors[_0x163223(0x13f)](_0x163223(0x150));return _0x1b3a09;}export function validateSort(_0x2f15a3,_0xa14306=a125_0x120514(0x171)){const _0x137263=a125_0x120514;if(!hasFlag(_0x2f15a3,_0xa14306))return undefined;const _0x5b5363=_0x2f15a3[_0x137263(0x139)](_0xa14306);if(!Number[_0x137263(0x17b)](_0x5b5363)||_0x5b5363<0x0||_0x5b5363>MAX_MENU_SORT)throw menuError('menu_sort_invalid','--'+_0xa14306+'\x20must\x20be\x20an\x20integer\x20between\x200\x20and\x20'+MAX_MENU_SORT+'.','Choose\x20a\x20sort\x20value\x20within\x20the\x20Java\x20Integer\x20range\x20used\x20by\x20the\x20menu\x20service.');return _0x5b5363;}export function nextSiblingSort(_0x1924ad,_0x52c167,_0x2272c8){const _0x7ae685=a125_0x120514,_0x469ba0=getChildren(_0x1924ad,_0x52c167)[_0x7ae685(0x112)](_0x517b14=>_0x517b14[_0x7ae685(0x171)])['filter'](_0x5f2107=>typeof _0x5f2107===_0x7ae685(0x147));if(_0x469ba0[_0x7ae685(0x16d)]===0x0)return 0x0;const _0x2d4d76=Math[_0x7ae685(0x15a)](..._0x469ba0);if(_0x2d4d76>=MAX_MENU_SORT)throw menuError('menu_sort_overflow',_0x7ae685(0x14e)+_0x2272c8+_0x7ae685(0x16f)+_0x2d4d76+'.',_0x7ae685(0x114)+MAX_MENU_SORT+',\x20or\x20pass\x20an\x20explicit\x20--sort\x20value.');return _0x2d4d76+0x1;}export function requireExplicitYes(_0xfab9a0){const _0x3f09cb=a125_0x120514;if(_0xfab9a0[_0x3f09cb(0x12a)]('dry-run'))return;if(!_0xfab9a0[_0x3f09cb(0x12a)](_0x3f09cb(0x14a)))throw menuError(_0x3f09cb(0x11c),'This\x20menu\x20mutation\x20requires\x20explicit\x20--yes.',_0x3f09cb(0x143));}export async function fetchMutationSnapshot(_0x3162f2,_0x4eb4e3,_0x4a217e){const _0x530bf5=a125_0x120514;try{return await fetchMenuSnapshot(_0x3162f2[_0x530bf5(0x170)],_0x3162f2['cookie']);}catch(_0x45dfe7){throw mapMenuApiError(_0x45dfe7,_0x530bf5(0x13d)+_0x4eb4e3,_0x4a217e);}}export async function recheckMutationSnapshot(_0xcb1506,_0x95e5fb,_0x11b5d6,_0x653166){const _0xf69499=a125_0x120514;let _0x32f080;try{_0x32f080=await fetchMenuSnapshot(_0xcb1506[_0xf69499(0x170)],_0xcb1506['cookie']);}catch(_0x3786fa){const _0x42aea2=mapMenuApiError(_0x3786fa,_0xf69499(0x148)+_0x11b5d6,_0x653166);throw menuFailure(_0x42aea2,_0x95e5fb,{'stage':_0xf69499(0x128),'failed':_0x653166==null?{}:{'id':_0x653166}});}if(_0x32f080[_0xf69499(0x12e)]!==_0x95e5fb[_0xf69499(0x12f)]){const _0x3a73d9=menuError(_0xf69499(0x159),_0xf69499(0x133)+_0x11b5d6+_0xf69499(0x160),_0xf69499(0x162));throw menuFailure(_0x3a73d9,_0x95e5fb,{'stage':_0xf69499(0x128),'failed':{..._0x653166==null?{}:{'id':_0x653166},'expectedSnapshotHash':_0x95e5fb['snapshotHash'],'currentSnapshotHash':_0x32f080[_0xf69499(0x12e)]}});}return _0x32f080;}export function parseParentId(_0x8d292a,_0xf50856,_0x37fd3d={}){const _0x2c79af=a125_0x120514;if(!hasFlag(_0x8d292a,_0xf50856)){if(_0x37fd3d[_0x2c79af(0x172)])throw CliErrors[_0x2c79af(0x175)](_0xf50856);return undefined;}const _0xc86be1=_0x8d292a[_0x2c79af(0x13b)](_0xf50856)[_0x2c79af(0x13a)]();if(_0xc86be1['toLowerCase']()==='root')return null;if(!/^\d+$/[_0x2c79af(0x13e)](_0xc86be1))throw CliErrors['validation']('--'+_0xf50856+_0x2c79af(0x11a));const _0x13158b=Number(_0xc86be1);if(!Number[_0x2c79af(0x17b)](_0x13158b)||_0x13158b<=0x0)throw CliErrors['validation']('--'+_0xf50856+_0x2c79af(0x11a));return _0x13158b;}export function requireMenu(_0x4a60a3,_0x418ee8){const _0x2d6df1=a125_0x120514,_0x32ebdc=_0x4a60a3[_0x2d6df1(0x145)][_0x2d6df1(0x125)](_0x418ee8);if(!_0x32ebdc)throw menuError(_0x2d6df1(0x136),_0x2d6df1(0x17c)+_0x418ee8,_0x2d6df1(0x10f));return _0x32ebdc;}export function requireFolder(_0x2b8939,_0x4d6236){const _0x238541=a125_0x120514,_0x477662=requireMenu(_0x2b8939,_0x4d6236);if(_0x477662['type']!==_0x238541(0x137))throw menuError(_0x238541(0x11d),_0x238541(0x165)+_0x4d6236+_0x238541(0x12d)+(_0x477662[_0x238541(0x132)]||_0x238541(0x134))+_0x238541(0x151),_0x238541(0x129));return _0x477662;}export function assertExpectedState(_0x6b18,_0x518b19){const _0x168bc9=a125_0x120514;if(hasFlag(_0x6b18,_0x168bc9(0x113))){const _0x59065a=parseParentId(_0x6b18,'expect-parent-id',{'required':!![]});if(_0x518b19['parentId']!==_0x59065a)throw stateDrift(_0x168bc9(0x165)+_0x518b19['id']+_0x168bc9(0x16b)+formatParent(_0x59065a)+',\x20current\x20'+formatParent(_0x518b19['parentId'])+'.');}if(hasFlag(_0x6b18,_0x168bc9(0x118))){const _0x109d62=_0x6b18['str']('expect-path');if(_0x518b19['path']!==_0x109d62)throw stateDrift(_0x168bc9(0x165)+_0x518b19['id']+_0x168bc9(0x168)+JSON['stringify'](_0x109d62)+_0x168bc9(0x16e)+JSON[_0x168bc9(0x138)](_0x518b19[_0x168bc9(0x14b)])+'.');}if(hasFlag(_0x6b18,_0x168bc9(0x15b))){const _0x20095f=_0x6b18[_0x168bc9(0x139)]('expected-children-count');if(!Number[_0x168bc9(0x17b)](_0x20095f)||_0x20095f<0x0)throw CliErrors[_0x168bc9(0x13f)](_0x168bc9(0x12b));if(_0x518b19[_0x168bc9(0x166)]!==_0x20095f)throw stateDrift(_0x168bc9(0x165)+_0x518b19['id']+_0x168bc9(0x169)+_0x20095f+_0x168bc9(0x16e)+_0x518b19['childrenCount']+'.');}}export function assertVerified(_0x19a99c,_0x190d4e,_0x172698=a125_0x120514(0x153)){const _0x19a9d7=a125_0x120514;if(!_0x19a99c)throw menuError(_0x19a9d7(0x15e),_0x190d4e,_0x172698);}export function mutationResult(_0x43a183){const _0x4412b4=a125_0x120514;return{'operation':_0x43a183[_0x4412b4(0x15d)],'selector':_0x43a183[_0x4412b4(0x124)],'before':_0x43a183[_0x4412b4(0x161)],'after':_0x43a183['after'],'dryRun':_0x43a183[_0x4412b4(0x155)],'backend':_0x43a183['backend'],..._0x43a183[_0x4412b4(0x14f)]?{'plannedActions':_0x43a183[_0x4412b4(0x14f)]}:{},..._0x43a183[_0x4412b4(0x146)]?{'targets':_0x43a183[_0x4412b4(0x146)]}:{},..._0x43a183[_0x4412b4(0x152)]?{'deleteOrder':_0x43a183[_0x4412b4(0x152)]}:{},'snapshotHash':_0x43a183['snapshotHash'],..._0x43a183['cascade']?{'cascade':_0x43a183[_0x4412b4(0x14c)]}:{},..._0x43a183[_0x4412b4(0x178)]?{'planFile':_0x43a183[_0x4412b4(0x178)]}:{},'succeeded':_0x43a183['succeeded']??[],'failed':_0x43a183[_0x4412b4(0x127)]??[],'warnings':_0x43a183['warnings']??[],'verification':_0x43a183[_0x4412b4(0x16a)],'error':_0x43a183[_0x4412b4(0x122)]};}export function menuDryRunResult(_0x288cef,_0x3198f1){return{..._0x288cef,..._0x3198f1};}export function menuFailure(_0x361cc3,_0x2ffca0,_0x55fa91){const _0x3b4afd=a125_0x120514,_0x92ec4=mutationResult({..._0x2ffca0,'after':_0x55fa91[_0x3b4afd(0x131)]===undefined?_0x2ffca0['after']:_0x55fa91[_0x3b4afd(0x131)],'backend':_0x55fa91['backend']??_0x2ffca0[_0x3b4afd(0x17a)],'dryRun':![],'succeeded':_0x55fa91[_0x3b4afd(0x110)]??[],'failed':[{..._0x55fa91[_0x3b4afd(0x127)]??{},'stage':_0x55fa91[_0x3b4afd(0x144)],'code':_0x361cc3['code'],'message':_0x361cc3[_0x3b4afd(0x11b)]}],'warnings':[..._0x2ffca0[_0x3b4afd(0x121)],..._0x55fa91[_0x3b4afd(0x121)]??[]],'verification':_0x55fa91[_0x3b4afd(0x16a)],'error':{'code':_0x361cc3[_0x3b4afd(0x123)],'message':_0x361cc3['message'],..._0x361cc3[_0x3b4afd(0x15f)]?{'hint':_0x361cc3[_0x3b4afd(0x15f)]}:{}}});return Object[_0x3b4afd(0x117)](_0x361cc3,_0x3b4afd(0x164),{'value':_0x92ec4,'enumerable':!![],'configurable':!![]}),_0x361cc3;}export function asVerificationError(_0x2806fa,_0x5bc3b9){const _0x51aafe=a125_0x120514;if(_0x2806fa instanceof CliError&&_0x2806fa['code']===_0x51aafe(0x15e))return _0x2806fa;const _0x46c9fe=_0x2806fa instanceof Error?_0x2806fa[_0x51aafe(0x11b)]:String(_0x2806fa);return menuError(_0x51aafe(0x15e),''+_0x5bc3b9+(_0x46c9fe?':\x20'+_0x46c9fe:''),_0x51aafe(0x15c));}export function describeMenuErrorCause(_0x3e0840,_0x22a4aa,_0x4d05a7){const _0x4825af=a125_0x120514,_0x2ce94a=mapMenuApiError(_0x3e0840,_0x22a4aa,_0x4d05a7);return{'causeCode':_0x2ce94a[_0x4825af(0x123)],'causeMessage':_0x2ce94a[_0x4825af(0x11b)]};}export function hasFlag(_0x333416,_0x5e9850){const _0x2d6e80=a125_0x120514;return Object[_0x2d6e80(0x149)][_0x2d6e80(0x176)][_0x2d6e80(0x10e)](_0x333416[_0x2d6e80(0x12c)],_0x5e9850)&&_0x333416[_0x2d6e80(0x12c)][_0x5e9850]!==undefined;}export function toApiParentId(_0x3048fa){return _0x3048fa??0x0;}export function formatParent(_0x46dad0){const _0x2c4d2e=a125_0x120514;return _0x46dad0==null?_0x2c4d2e(0x173):String(_0x46dad0);}export function menuError(_0x11dbb2,_0x54fd9c,_0x738434){return new CliError(_0x11dbb2,0x1,_0x54fd9c,_0x738434);}export function mapMenuApiError(_0x5cb6e1,_0x5f597c,_0x4395c0){const _0xad2bfb=a125_0x120514;if(_0x5cb6e1 instanceof CliError&&_0x5cb6e1['code']!==_0xad2bfb(0x116))return _0x5cb6e1;const _0x10f35a=_0x5cb6e1 instanceof Error?_0x5cb6e1[_0xad2bfb(0x11b)]:String(_0x5cb6e1);if(/HTTP 403|forbidden|permission|无权限|权限不足|没有权限/i[_0xad2bfb(0x13e)](_0x10f35a))return menuError(_0xad2bfb(0x111),_0xad2bfb(0x179)+_0x5f597c+(_0x4395c0?_0xad2bfb(0x130)+_0x4395c0:'')+'.',_0xad2bfb(0x17d));return menuError('menu_mutation_failed','Failed\x20to\x20'+_0x5f597c+(_0x4395c0?_0xad2bfb(0x130)+_0x4395c0:'')+':\x20'+_0x10f35a,'Re-run\x20menu\x20list\x20to\x20inspect\x20the\x20latest\x20online\x20state\x20before\x20retrying.');}export function isMenuResponseLoss(_0x410fef){const _0x3c4c22=a125_0x120514,_0x4c150=_0x410fef instanceof Error?_0x410fef['message']:String(_0x410fef);if(_0x410fef instanceof CliError)return _0x410fef[_0x3c4c22(0x123)]===_0x3c4c22(0x116)&&/^Request (?:failed|timeout):/i[_0x3c4c22(0x13e)](_0x4c150);return/timeout|timed out|ECONNRESET|socket hang up|network|fetch failed|connection closed|aborted|terminated|unexpected end of JSON|premature close|body stream/i[_0x3c4c22(0x13e)](_0x4c150);}function stateDrift(_0x4e0488){const _0x1740bc=a125_0x120514;return menuError(_0x1740bc(0x159),_0x4e0488,_0x1740bc(0x140));}
|
|
1
|
+
const a125_0x85e8f3=a125_0x407a;(function(_0x1c9716,_0x3cfda2){const _0x2c6f7d=a125_0x407a,_0xf78daf=_0x1c9716();while(!![]){try{const _0x353d3c=-parseInt(_0x2c6f7d(0x1d9))/0x1+parseInt(_0x2c6f7d(0x1a4))/0x2+parseInt(_0x2c6f7d(0x1de))/0x3+parseInt(_0x2c6f7d(0x1ae))/0x4+-parseInt(_0x2c6f7d(0x1e2))/0x5*(-parseInt(_0x2c6f7d(0x19a))/0x6)+parseInt(_0x2c6f7d(0x1ec))/0x7+-parseInt(_0x2c6f7d(0x1c4))/0x8;if(_0x353d3c===_0x3cfda2)break;else _0xf78daf['push'](_0xf78daf['shift']());}catch(_0x4cd855){_0xf78daf['push'](_0xf78daf['shift']());}}}(a125_0x16e6,0x8521c));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':'number','required':!![],'description':'Exact\x20online\x20menu\x20id'};export const MENU_SORT_FLAG={'name':a125_0x85e8f3(0x1df),'type':'number','description':a125_0x85e8f3(0x1d5)};export const MENU_PARENT_ID_FLAG={'name':a125_0x85e8f3(0x1ed),'type':'string','description':a125_0x85e8f3(0x19b)};export const MENU_EXPECT_PARENT_ID_FLAG={'name':a125_0x85e8f3(0x1be),'type':'string','description':'Abort\x20unless\x20the\x20current\x20parent\x20id\x20matches;\x20use\x20root\x20for\x20root\x20level'};export const MENU_EXPECT_FLAGS=[MENU_EXPECT_PARENT_ID_FLAG,{'name':a125_0x85e8f3(0x1c8),'type':a125_0x85e8f3(0x1d4),'description':a125_0x85e8f3(0x195)},{'name':a125_0x85e8f3(0x199),'type':a125_0x85e8f3(0x192),'description':a125_0x85e8f3(0x1b3)}];export function validateExactId(_0x1982fe){const _0x1d9d26=a125_0x85e8f3,_0x16893e=_0x1982fe['num']('id');if(!Number[_0x1d9d26(0x1d0)](_0x16893e)||_0x16893e<=0x0)throw CliErrors['validation'](_0x1d9d26(0x1b0));return _0x16893e;}export function validateSort(_0x570dd3,_0x59e902=a125_0x85e8f3(0x1df)){const _0x29b0cb=a125_0x85e8f3;if(!hasFlag(_0x570dd3,_0x59e902))return undefined;const _0x243e48=_0x570dd3[_0x29b0cb(0x1c1)](_0x59e902);if(!Number['isSafeInteger'](_0x243e48)||_0x243e48<0x0||_0x243e48>MAX_MENU_SORT)throw menuError(_0x29b0cb(0x1b4),'--'+_0x59e902+_0x29b0cb(0x1a9)+MAX_MENU_SORT+'.','Choose\x20a\x20sort\x20value\x20within\x20the\x20Java\x20Integer\x20range\x20used\x20by\x20the\x20menu\x20service.');return _0x243e48;}export function nextSiblingSort(_0x5e403d,_0x29766a,_0x54ad8c){const _0x59de85=a125_0x85e8f3,_0x1b0645=getChildren(_0x5e403d,_0x29766a)[_0x59de85(0x1b1)](_0x421d21=>_0x421d21['sort'])[_0x59de85(0x198)](_0x5ccac0=>typeof _0x5ccac0==='number');if(_0x1b0645[_0x59de85(0x1c3)]===0x0)return 0x0;const _0x178721=Math['max'](..._0x1b0645);if(_0x178721>=MAX_MENU_SORT)throw menuError('menu_sort_overflow',_0x59de85(0x1e8)+_0x54ad8c+_0x59de85(0x1af)+_0x178721+'.',_0x59de85(0x1db)+MAX_MENU_SORT+_0x59de85(0x1d8));return _0x178721+0x1;}export function requireExplicitYes(_0x2f71bf){const _0x984dec=a125_0x85e8f3;if(_0x2f71bf[_0x984dec(0x19e)](_0x984dec(0x1b9)))return;if(!_0x2f71bf[_0x984dec(0x19e)](_0x984dec(0x1bb)))throw menuError('menu_confirmation_required',_0x984dec(0x1a6),_0x984dec(0x1a2));}export async function fetchMutationSnapshot(_0x3d300e,_0x39c2c2,_0x394b4f){const _0x5230a6=a125_0x85e8f3;try{return await fetchMenuSnapshot(_0x3d300e[_0x5230a6(0x1b8)],_0x3d300e[_0x5230a6(0x1a5)]);}catch(_0x3b2268){throw mapMenuApiError(_0x3b2268,_0x5230a6(0x196)+_0x39c2c2,_0x394b4f);}}export async function recheckMutationSnapshot(_0x4f7549,_0xbda3be,_0x2e0db8,_0x2b88a6){const _0x2d52af=a125_0x85e8f3;let _0x380c89;try{_0x380c89=await fetchMenuSnapshot(_0x4f7549[_0x2d52af(0x1b8)],_0x4f7549[_0x2d52af(0x1a5)]);}catch(_0x5856fe){const _0x4d02c1=mapMenuApiError(_0x5856fe,_0x2d52af(0x1a8)+_0x2e0db8,_0x2b88a6);throw menuFailure(_0x4d02c1,_0xbda3be,{'stage':'pre-write-recheck','failed':_0x2b88a6==null?{}:{'id':_0x2b88a6}});}if(_0x380c89[_0x2d52af(0x1cf)]!==_0xbda3be[_0x2d52af(0x1ad)]){const _0x553cb8=menuError(_0x2d52af(0x1e5),_0x2d52af(0x1dd)+_0x2e0db8+';\x20the\x20planned\x20snapshot\x20is\x20no\x20longer\x20current.','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20again\x20and\x20review\x20the\x20latest\x20snapshot\x20before\x20retrying.');throw menuFailure(_0x553cb8,_0xbda3be,{'stage':_0x2d52af(0x1e7),'failed':{..._0x2b88a6==null?{}:{'id':_0x2b88a6},'expectedSnapshotHash':_0xbda3be[_0x2d52af(0x1ad)],'currentSnapshotHash':_0x380c89[_0x2d52af(0x1cf)]}});}return _0x380c89;}export function parseParentId(_0x8065e0,_0x19a204,_0x229768={}){const _0x98fe8b=a125_0x85e8f3;if(!hasFlag(_0x8065e0,_0x19a204)){if(_0x229768[_0x98fe8b(0x18d)])throw CliErrors[_0x98fe8b(0x1bd)](_0x19a204);return undefined;}const _0x4ff1e7=_0x8065e0[_0x98fe8b(0x1cb)](_0x19a204)[_0x98fe8b(0x19f)]();if(_0x4ff1e7[_0x98fe8b(0x1d1)]()==='root')return null;if(!/^\d+$/['test'](_0x4ff1e7))throw CliErrors[_0x98fe8b(0x1c5)]('--'+_0x19a204+'\x20must\x20be\x20a\x20positive\x20menu\x20id\x20or\x20root.');const _0xc4d88e=Number(_0x4ff1e7);if(!Number[_0x98fe8b(0x1d0)](_0xc4d88e)||_0xc4d88e<=0x0)throw CliErrors['validation']('--'+_0x19a204+_0x98fe8b(0x1bc));return _0xc4d88e;}export function requireMenu(_0x1dc9c9,_0x32e6d3){const _0x917ad1=a125_0x85e8f3,_0x2d0e49=_0x1dc9c9['byId']['get'](_0x32e6d3);if(!_0x2d0e49)throw menuError('menu_not_found','Online\x20menu\x20not\x20found:\x20'+_0x32e6d3,_0x917ad1(0x190));return _0x2d0e49;}export function requireFolder(_0x59fdf7,_0x501bbc){const _0x5a830e=a125_0x85e8f3,_0x7a6d58=requireMenu(_0x59fdf7,_0x501bbc);if(_0x7a6d58[_0x5a830e(0x1eb)]!==_0x5a830e(0x1ce))throw menuError(_0x5a830e(0x1cd),_0x5a830e(0x18c)+_0x501bbc+'\x20is\x20type\x20\x22'+(_0x7a6d58['type']||_0x5a830e(0x1ac))+_0x5a830e(0x1ab),_0x5a830e(0x1c9));return _0x7a6d58;}export function assertExpectedState(_0x3b279e,_0x322220){const _0x47293e=a125_0x85e8f3;if(hasFlag(_0x3b279e,_0x47293e(0x1be))){const _0x314d4b=parseParentId(_0x3b279e,_0x47293e(0x1be),{'required':!![]});if(_0x322220[_0x47293e(0x1ba)]!==_0x314d4b)throw stateDrift('Menu\x20'+_0x322220['id']+_0x47293e(0x1ca)+formatParent(_0x314d4b)+_0x47293e(0x1b2)+formatParent(_0x322220[_0x47293e(0x1ba)])+'.');}if(hasFlag(_0x3b279e,_0x47293e(0x1c8))){const _0x1f0df5=_0x3b279e[_0x47293e(0x1cb)](_0x47293e(0x1c8));if(_0x322220[_0x47293e(0x1da)]!==_0x1f0df5)throw stateDrift(_0x47293e(0x18c)+_0x322220['id']+_0x47293e(0x18e)+JSON[_0x47293e(0x1e6)](_0x1f0df5)+_0x47293e(0x1b2)+JSON['stringify'](_0x322220[_0x47293e(0x1da)])+'.');}if(hasFlag(_0x3b279e,_0x47293e(0x199))){const _0x219eac=_0x3b279e[_0x47293e(0x1c1)](_0x47293e(0x199));if(!Number[_0x47293e(0x1d0)](_0x219eac)||_0x219eac<0x0)throw CliErrors[_0x47293e(0x1c5)](_0x47293e(0x1b5));if(_0x322220[_0x47293e(0x1a0)]!==_0x219eac)throw stateDrift('Menu\x20'+_0x322220['id']+_0x47293e(0x19d)+_0x219eac+_0x47293e(0x1b2)+_0x322220[_0x47293e(0x1a0)]+'.');}}export function assertVerified(_0x36834e,_0xf212c2,_0x5e418c='Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20to\x20inspect\x20the\x20latest\x20online\x20menu\x20state.'){const _0x2df18f=a125_0x85e8f3;if(!_0x36834e)throw menuError(_0x2df18f(0x1c6),_0xf212c2,_0x5e418c);}export function mutationResult(_0x2dd2e7){const _0x3de1cf=a125_0x85e8f3;return{'operation':_0x2dd2e7[_0x3de1cf(0x1d7)],'selector':_0x2dd2e7[_0x3de1cf(0x1b7)],'before':_0x2dd2e7['before'],'after':_0x2dd2e7['after'],'dryRun':_0x2dd2e7[_0x3de1cf(0x1c2)],'backend':_0x2dd2e7['backend'],..._0x2dd2e7[_0x3de1cf(0x1b6)]?{'plannedActions':_0x2dd2e7[_0x3de1cf(0x1b6)]}:{},..._0x2dd2e7['targets']?{'targets':_0x2dd2e7[_0x3de1cf(0x1c0)]}:{},..._0x2dd2e7[_0x3de1cf(0x1c7)]?{'deleteOrder':_0x2dd2e7[_0x3de1cf(0x1c7)]}:{},'snapshotHash':_0x2dd2e7[_0x3de1cf(0x1ad)],..._0x2dd2e7[_0x3de1cf(0x1dc)]?{'cascade':_0x2dd2e7[_0x3de1cf(0x1dc)]}:{},..._0x2dd2e7['planFile']?{'planFile':_0x2dd2e7['planFile']}:{},'succeeded':_0x2dd2e7['succeeded']??[],'failed':_0x2dd2e7[_0x3de1cf(0x1cc)]??[],'warnings':_0x2dd2e7[_0x3de1cf(0x18f)]??[],'verification':_0x2dd2e7[_0x3de1cf(0x19c)],'error':_0x2dd2e7[_0x3de1cf(0x18b)]};}export function menuDryRunResult(_0x24d555,_0x4a78dc){return{..._0x24d555,..._0x4a78dc};}export function menuFailure(_0xf6e028,_0x51703c,_0x72e067){const _0x2f685d=a125_0x85e8f3,_0x37c226=mutationResult({..._0x51703c,'after':_0x72e067[_0x2f685d(0x1a1)]===undefined?_0x51703c['after']:_0x72e067[_0x2f685d(0x1a1)],'backend':_0x72e067['backend']??_0x51703c[_0x2f685d(0x1ea)],'dryRun':![],'succeeded':_0x72e067[_0x2f685d(0x191)]??[],'failed':[{..._0x72e067[_0x2f685d(0x1cc)]??{},'stage':_0x72e067[_0x2f685d(0x194)],'code':_0xf6e028[_0x2f685d(0x1e0)],'message':_0xf6e028['message']}],'warnings':[..._0x51703c[_0x2f685d(0x18f)],..._0x72e067['warnings']??[]],'verification':_0x72e067[_0x2f685d(0x19c)],'error':{'code':_0xf6e028[_0x2f685d(0x1e0)],'message':_0xf6e028[_0x2f685d(0x18a)],..._0xf6e028['hint']?{'hint':_0xf6e028[_0x2f685d(0x1aa)]}:{}}});return Object[_0x2f685d(0x193)](_0xf6e028,_0x2f685d(0x1d2),{'value':_0x37c226,'enumerable':!![],'configurable':!![]}),_0xf6e028;}export function asVerificationError(_0x171d04,_0x3aa956){const _0x4e663a=a125_0x85e8f3;if(_0x171d04 instanceof CliError&&_0x171d04[_0x4e663a(0x1e0)]===_0x4e663a(0x1c6))return _0x171d04;const _0x311c30=_0x171d04 instanceof Error?_0x171d04[_0x4e663a(0x18a)]:String(_0x171d04);return menuError('menu_verification_failed',''+_0x3aa956+(_0x311c30?':\x20'+_0x311c30:''),'The\x20write\x20may\x20already\x20have\x20taken\x20effect.\x20Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20inspect\x20the\x20returned\x20id\x20before\x20retrying.');}export function describeMenuErrorCause(_0x3cad11,_0x275256,_0x3d5975){const _0x5db0a6=a125_0x85e8f3,_0x5b4629=mapMenuApiError(_0x3cad11,_0x275256,_0x3d5975);return{'causeCode':_0x5b4629[_0x5db0a6(0x1e0)],'causeMessage':_0x5b4629[_0x5db0a6(0x18a)]};}function a125_0x407a(_0x26ca97,_0x560b9e){_0x26ca97=_0x26ca97-0x18a;const _0x16e6fb=a125_0x16e6();let _0x407a1b=_0x16e6fb[_0x26ca97];return _0x407a1b;}export function hasFlag(_0x463480,_0x1bf4b9){const _0x40a3fa=a125_0x85e8f3;return Object[_0x40a3fa(0x1a3)][_0x40a3fa(0x1d6)][_0x40a3fa(0x1e1)](_0x463480[_0x40a3fa(0x1a7)],_0x1bf4b9)&&_0x463480[_0x40a3fa(0x1a7)][_0x1bf4b9]!==undefined;}export function toApiParentId(_0x318072){return _0x318072??0x0;}export function formatParent(_0xe1aa4){return _0xe1aa4==null?'root':String(_0xe1aa4);}export function menuError(_0x3a2f86,_0x19c738,_0x19d47d){return new CliError(_0x3a2f86,0x1,_0x19c738,_0x19d47d);}export function mapMenuApiError(_0x816a76,_0x596c27,_0x416b0f){const _0x1a878e=a125_0x85e8f3;if(_0x816a76 instanceof CliError&&_0x816a76[_0x1a878e(0x1e0)]!=='api_error')return _0x816a76;const _0x195677=_0x816a76 instanceof Error?_0x816a76[_0x1a878e(0x18a)]:String(_0x816a76);if(/HTTP 403|forbidden|permission|无权限|权限不足|没有权限/i[_0x1a878e(0x1e9)](_0x195677))return menuError(_0x1a878e(0x1d3),'Permission\x20denied\x20while\x20attempting\x20to\x20'+_0x596c27+(_0x416b0f?_0x1a878e(0x1e3)+_0x416b0f:'')+'.',_0x1a878e(0x1e4));return menuError('menu_mutation_failed',_0x1a878e(0x197)+_0x596c27+(_0x416b0f?_0x1a878e(0x1e3)+_0x416b0f:'')+':\x20'+_0x195677,'Re-run\x20menu\x20list\x20to\x20inspect\x20the\x20latest\x20online\x20state\x20before\x20retrying.');}export function isMenuResponseLoss(_0x49acbb){const _0x13ffd6=a125_0x85e8f3,_0x40f972=_0x49acbb instanceof Error?_0x49acbb[_0x13ffd6(0x18a)]:String(_0x49acbb);if(_0x49acbb instanceof CliError)return _0x49acbb[_0x13ffd6(0x1e0)]===_0x13ffd6(0x1bf)&&/^Request (?:failed|timeout):/i['test'](_0x40f972);return/timeout|timed out|ECONNRESET|socket hang up|network|fetch failed|connection closed|aborted|terminated|unexpected end of JSON|premature close|body stream/i['test'](_0x40f972);}function stateDrift(_0x2099c6){const _0x232d83=a125_0x85e8f3;return menuError(_0x232d83(0x1e5),_0x2099c6,'Re-run\x20the\x20command\x20with\x20--dry-run\x20and\x20update\x20the\x20expect\x20flags\x20before\x20retrying.');}function a125_0x16e6(){const _0x18c214=['\x20path\x20changed:\x20expected\x20','warnings','Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20use\x20an\x20exact\x20id\x20from\x20the\x20current\x20app.','succeeded','number','defineProperty','stage','Abort\x20unless\x20the\x20current\x20menu\x20path\x20exactly\x20matches','read\x20online\x20menu\x20facts\x20before\x20','Failed\x20to\x20','filter','expected-children-count','4197306cmPpzM','Parent\x20folder\x20id;\x20use\x20root\x20for\x20a\x20root-level\x20node','verification','\x20child\x20count\x20changed:\x20expected\x20','bool','trim','childrenCount','after','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.','prototype','1548380wiKGWA','cookie','This\x20menu\x20mutation\x20requires\x20explicit\x20--yes.','rawFlags','recheck\x20online\x20menu\x20facts\x20before\x20','\x20must\x20be\x20an\x20integer\x20between\x200\x20and\x20','hint','\x22,\x20not\x20folder.','unknown','snapshotHash','672900hiUtHk','\x20because\x20the\x20current\x20maximum\x20sibling\x20sort\x20is\x20','--id\x20must\x20be\x20a\x20positive\x20integer\x20menu\x20id.','map',',\x20current\x20','Abort\x20unless\x20the\x20current\x20direct\x20child\x20count\x20matches','menu_sort_invalid','--expected-children-count\x20must\x20be\x20a\x20non-negative\x20integer.','plannedActions','selector','appCode','dry-run','parentId','yes','\x20must\x20be\x20a\x20positive\x20menu\x20id\x20or\x20root.','flagMissing','expect-parent-id','api_error','targets','num','dryRun','length','5201968SCpiDQ','validation','menu_verification_failed','deleteOrder','expect-path','Choose\x20a\x20menu\x20whose\x20type\x20is\x20folder,\x20or\x20use\x20root.','\x20parent\x20changed:\x20expected\x20','str','failed','menu_parent_not_folder','folder','hash','isSafeInteger','toLowerCase','data','menu_permission_denied','string','Sibling\x20sort\x20value\x20(non-negative\x20integer)','hasOwnProperty','operation',',\x20or\x20pass\x20an\x20explicit\x20--sort\x20value.','983351CZxueB','path','Reorder\x20sibling\x20menus\x20below\x20','cascade','Online\x20menu\x20state\x20changed\x20before\x20','236358EGCypT','sort','code','call','5mLsbYS','\x20menu\x20','Confirm\x20that\x20the\x20current\x20account\x20can\x20manage\x20menus\x20for\x20this\x20app.','menu_state_drift','stringify','pre-write-recheck','Cannot\x20append\x20a\x20','test','backend','type','3207071ijkxfR','parent-id','message','error','Menu\x20','required'];a125_0x16e6=function(){return _0x18c214;};return a125_0x16e6();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xc4d7e4,_0x2adf2c){const _0x48004b=a126_0x2c82,_0x11ad96=_0xc4d7e4();while(!![]){try{const _0x18c0f0=-parseInt(_0x48004b(0x109))/0x1*(-parseInt(_0x48004b(0x107))/0x2)+parseInt(_0x48004b(0x110))/0x3+parseInt(_0x48004b(0x11a))/0x4*(-parseInt(_0x48004b(0x126))/0x5)+parseInt(_0x48004b(0x10a))/0x6+-parseInt(_0x48004b(0x10b))/0x7*(-parseInt(_0x48004b(0x129))/0x8)+parseInt(_0x48004b(0x12f))/0x9*(-parseInt(_0x48004b(0x12a))/0xa)+-parseInt(_0x48004b(0x124))/0xb*(parseInt(_0x48004b(0x120))/0xc);if(_0x18c0f0===_0x2adf2c)break;else _0x11ad96['push'](_0x11ad96['shift']());}catch(_0x1a8863){_0x11ad96['push'](_0x11ad96['shift']());}}}(a126_0x2c91,0xbe757));function a126_0x2c82(_0x711ac1,_0x40056e){_0x711ac1=_0x711ac1-0x107;const _0x2c9107=a126_0x2c91();let _0x2c8264=_0x2c9107[_0x711ac1];return _0x2c8264;}function a126_0x2c91(){const _0x60ce1e=['info','3605lghmVt','7946934xNPvhE','14uitIMH','path','Fetched\x20','Start\x20batch\x20menu\x20creation,\x20total\x20','stringify','1525821LCvFNY','map','update-menu-cdn-url','Fetching\x20daily\x20menu\x20list...\x20(appCode:\x20','Batch\x20menu\x20creation\x20completed,\x20total\x20','loadScriptMode','Create\x20menu\x20\x22','total','Update\x20menu\x20','create-menu','568iTzrRw','import','get-online-menu-list','length','Update\x20menu\x20assets\x20\x22','Updating\x20menu\x20asset\x20links:\x20','55332YZTtpV','resources','\x20menu\x20group(s)','Creating\x20menu:\x20','2332CRHUCr','menuGroups','30055aFTlOo','Menu\x20created\x20successfully:\x20','\x20menu','4304504HwsWbr','4752570vVndLh','menus','create-menus','label','procode','18QkwYim','362SsTZQY'];a126_0x2c91=function(){return _0x60ce1e;};return a126_0x2c91();}import{getEnv,isProduction}from'../../../constant/env.js';import{logger}from'../../../utils/logger.js';import{fetchMenuSnapshot,toProcessedMenuItem}from'../../../commands/menu/shared/facts.js';import{batchDeleteMenuRecords,createMenuRecord,startMenuRegroup as a126_0x1ec342,updateMenuRecord}from'../../../core/api-client.js';export async function getOnlineMenuList(_0x113e2b,_0x762a34){const _0xbb1886=a126_0x2c82,_0x3e405e=getEnv();logger[_0xbb1886(0x108)](_0xbb1886(0x11c),isProduction(_0x3e405e)?'Fetching\x20online\x20menu\x20list...\x20(appCode:\x20'+_0x113e2b+')':_0xbb1886(0x113)+_0x113e2b+')');const _0x3606d4=await fetchMenuSnapshot(_0x113e2b,_0x762a34,{'verbose':!![]});return logger['info'](_0xbb1886(0x11c),_0xbb1886(0x10d)+_0x3606d4[_0xbb1886(0x117)]+'\x20online\x20menus\x20successfully'),_0x3606d4[_0xbb1886(0x12b)][_0xbb1886(0x111)](toProcessedMenuItem);}export async function createMenu(_0x5e649c,_0x19877d,_0x74f16e){const _0x1f15b4=a126_0x2c82;logger['info'](_0x1f15b4(0x119),_0x1f15b4(0x123)+_0x74f16e[_0x1f15b4(0x12d)]+'\x20('+_0x74f16e[_0x1f15b4(0x10c)]+')');const _0xbb34c0={'appCode':_0x5e649c,'type':'procode','sort':0x0,'extend':{'loadScriptMode':_0x1f15b4(0x11b),'resources':_0x74f16e['resources']?JSON[_0x1f15b4(0x10f)](_0x74f16e['resources']):undefined},..._0x74f16e},_0x3a3b48=await createMenuRecord(_0xbb34c0,_0x19877d,_0x1f15b4(0x116)+_0x74f16e[_0x1f15b4(0x12d)]+'\x22');return logger['info']('create-menu','Menu\x20created\x20successfully:\x20'+_0x74f16e[_0x1f15b4(0x12d)]),_0x3a3b48;}async function createSingleMenu(_0x3ad161,_0x45cde2,_0x398d35,_0x144ab1){const _0x2d736d=a126_0x2c82,_0x47dfd3={'appCode':_0x3ad161,'type':_0x2d736d(0x12e),'sort':0x0,'extend':{'loadScriptMode':_0x2d736d(0x11b),'resources':_0x144ab1?JSON[_0x2d736d(0x10f)](_0x144ab1):undefined},'label':_0x398d35[_0x2d736d(0x12d)],'path':_0x398d35[_0x2d736d(0x10c)]},_0x2118c7=await createMenuRecord(_0x47dfd3,_0x45cde2,_0x2d736d(0x116)+_0x398d35['label']+'\x22');return logger['info'](_0x2d736d(0x119),_0x2d736d(0x127)+_0x398d35[_0x2d736d(0x12d)]),_0x2118c7;}export async function createMenus(_0x30da79,_0x506ba3,_0x43e71a,_0x23d225){const _0x49c390=a126_0x2c82;logger['info'](_0x49c390(0x12c),_0x49c390(0x10e)+_0x43e71a['length']);const _0xb766e1=await Promise['all'](_0x43e71a[_0x49c390(0x111)](_0x54cd35=>createSingleMenu(_0x30da79,_0x506ba3,_0x54cd35,_0x23d225)));return logger[_0x49c390(0x108)]('create-menus',_0x49c390(0x114)+_0x43e71a[_0x49c390(0x11d)]),_0xb766e1;}export async function updateMenuCdnUrl(_0x1360f8,_0x419980,_0x5b61b8){const _0x10282f=a126_0x2c82;logger[_0x10282f(0x108)](_0x10282f(0x112),_0x10282f(0x11f)+_0x5b61b8['label']+'\x20('+_0x5b61b8[_0x10282f(0x10c)]+')');const _0x2f4b3f={'id':_0x5b61b8['id'],'appCode':_0x1360f8,'extend':{..._0x5b61b8['extend']??{},..._0x5b61b8[_0x10282f(0x115)]?{'loadScriptMode':_0x5b61b8[_0x10282f(0x115)]}:{},'resources':_0x5b61b8[_0x10282f(0x121)]?JSON[_0x10282f(0x10f)](_0x5b61b8['resources']):undefined}},_0x5c6542=await updateMenuRecord(_0x2f4b3f,_0x419980,_0x10282f(0x11e)+_0x5b61b8['label']+'\x22');return logger['info'](_0x10282f(0x112),'Menu\x20assets\x20synced:\x20'+_0x5b61b8[_0x10282f(0x12d)],undefined),_0x5c6542;}export async function createMenuEntity(_0x576e6c,_0x218d74,_0x2f7e58){const _0x4663d3=a126_0x2c82;return createMenuRecord({'appCode':_0x576e6c,..._0x2f7e58},_0x218d74,_0x4663d3(0x116)+_0x2f7e58[_0x4663d3(0x12d)]+'\x22');}export async function updateMenuEntity(_0x3531fb,_0x230c70,_0x48f8e6){const _0x2e344e=a126_0x2c82;return updateMenuRecord({'appCode':_0x3531fb,..._0x48f8e6},_0x230c70,_0x2e344e(0x118)+_0x48f8e6['id']);}export async function batchDeleteMenuEntities(_0x55fbad,_0x381b9f){const _0x53f572=a126_0x2c82;return batchDeleteMenuRecords(_0x381b9f,_0x55fbad,'Delete\x20'+_0x381b9f[_0x53f572(0x11d)]+_0x53f572(0x128)+(_0x381b9f[_0x53f572(0x11d)]===0x1?'':'s'));}export async function startMenuRegroup(_0x5b27b0,_0x19cf95){const _0x5ad736=a126_0x2c82;return a126_0x1ec342(_0x19cf95,_0x5b27b0,'Regroup\x20'+_0x19cf95[_0x5ad736(0x125)][_0x5ad736(0x11d)]+_0x5ad736(0x122));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a127_0x2def76=a127_0x2509;function a127_0x2509(_0x43f2fd,_0x12a918){_0x43f2fd=_0x43f2fd-0x1eb;const _0x5bfac5=a127_0x5bfa();let _0x250986=_0x5bfac5[_0x43f2fd];return _0x250986;}(function(_0x16ebff,_0x37f3d1){const _0x2d533b=a127_0x2509,_0xdb6369=_0x16ebff();while(!![]){try{const _0x1cecca=-parseInt(_0x2d533b(0x1eb))/0x1+-parseInt(_0x2d533b(0x217))/0x2*(parseInt(_0x2d533b(0x213))/0x3)+-parseInt(_0x2d533b(0x212))/0x4*(parseInt(_0x2d533b(0x211))/0x5)+parseInt(_0x2d533b(0x208))/0x6*(-parseInt(_0x2d533b(0x1f2))/0x7)+-parseInt(_0x2d533b(0x214))/0x8*(-parseInt(_0x2d533b(0x202))/0x9)+parseInt(_0x2d533b(0x1f1))/0xa*(-parseInt(_0x2d533b(0x21b))/0xb)+parseInt(_0x2d533b(0x21c))/0xc*(parseInt(_0x2d533b(0x1ff))/0xd);if(_0x1cecca===_0x37f3d1)break;else _0xdb6369['push'](_0xdb6369['shift']());}catch(_0xf4dd76){_0xdb6369['push'](_0xdb6369['shift']());}}}(a127_0x5bfa,0x76688));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(['jsUrl',a127_0x2def76(0x1fb)]);function validateParams(_0x463a78){const _0x2e7580=a127_0x2def76,_0x41be13=[];return _0x463a78[_0x2e7580(0x203)]&&!isValidJsHttpsUrl(_0x463a78['jsUrl'])&&_0x41be13[_0x2e7580(0x1f8)]({'field':'jsUrl','message':_0x2e7580(0x207)}),_0x463a78[_0x2e7580(0x1fb)]&&!isValidCssHttpsUrl(_0x463a78[_0x2e7580(0x1fb)])&&_0x41be13[_0x2e7580(0x1f8)]({'field':_0x2e7580(0x1fb),'message':_0x2e7580(0x201)}),_0x41be13;}function a127_0x5bfa(){const _0x398399=['JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','1223958xMfJuq','No\x20local\x20pages\x20matched\x20paths:\x20','info','join','import','CSS\x20URL\x20is\x20unreachable:\x20','JS\x20URL\x20is\x20unreachable:\x20','Invalid\x20--params\x20fields:\x20','isArray','26020KGLeXp','252QnTxuk','1227uZOUzp','2240dmuYkM','path','has','3746isFMPO','menu-sync','Menu\x20sync\x20completed','Invalid\x20--params:\x20expected\x20a\x20JSON\x20object.','484qCfGAQ','36Mhobvy','get','364691fKaawl','keys','pages','map','hasOwn','dryRun','47290FcoqDb','7Xphcnh','setLogPath',':\x20expected\x20a\x20non-empty\x20string.','Local\x20page\x20paths\x20are\x20already\x20on\x20the\x20platform:\x20','trim','Start\x20non-interactive\x20menu\x20sync','push','Invalid\x20--params.','filter','cssUrl','--params.pages\x20is\x20no\x20longer\x20supported.\x20Use\x20--paths\x20with\x20exact\x20local\x20page\x20paths.','length','label','10073219GjMtsM','\x0a\x20\x20Available\x20local\x20paths:\x20','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','999MUbFFz','jsUrl','Invalid\x20--params\x20JSON.','message','string'];a127_0x5bfa=function(){return _0x398399;};return a127_0x5bfa();}export async function runMenuSyncCore(_0x5835a2,_0xf78cf0,_0x5f40e3=[],_0x3a63dc,_0x4626fe={}){const _0x35090d=a127_0x2def76,_0x7e3da9=parseMenuSyncParams(_0x3a63dc),_0x7850d4=[...new Set(_0x5f40e3[_0x35090d(0x1ee)](_0x55a7a8=>_0x55a7a8[_0x35090d(0x1f6)]())[_0x35090d(0x1fa)](Boolean))],_0x43c3f6=_0x7e3da9['jsUrl'],_0x3b615f=_0x7e3da9[_0x35090d(0x1fb)],_0x33e8fe=[];if(_0x43c3f6)_0x33e8fe['push'](_0x43c3f6);if(_0x3b615f)_0x33e8fe[_0x35090d(0x1f8)](_0x3b615f);const _0x2afaa7=validateParams(_0x7e3da9);if(_0x2afaa7[_0x35090d(0x1fd)]>0x0){const _0x508d36=_0x2afaa7[_0x35090d(0x1ee)](_0x4d0252=>'--params.'+_0x4d0252['field']+':\x20'+_0x4d0252[_0x35090d(0x205)])[_0x35090d(0x20b)](';\x20');throw new Error('Invalid\x20--params:\x20'+_0x508d36);}logger[_0x35090d(0x1f3)](process['cwd']()),logger['info'](_0x35090d(0x218),_0x35090d(0x1f7),{'appCode':_0x5835a2,'selectedCount':_0x7850d4[_0x35090d(0x1fd)],'jsUrl':_0x43c3f6,'cssUrl':_0x3b615f});if(_0x43c3f6){const _0x3f13fb=await isUrlReachable(_0x43c3f6);if(!_0x3f13fb)throw new Error(_0x35090d(0x20e)+_0x43c3f6);}if(_0x3b615f){const _0x5cda10=await isUrlReachable(_0x3b615f);if(!_0x5cda10)throw new Error(_0x35090d(0x20d)+_0x3b615f);}const _0x26df8a=getLocalPages();if(_0x26df8a['length']===0x0){if(_0x7850d4[_0x35090d(0x1fd)]>0x0)throw new Error(_0x35090d(0x209)+_0x7850d4[_0x35090d(0x20b)](',\x20'));return{'created':0x0,'skipped':!![],'dryRun':_0x4626fe[_0x35090d(0x1f0)]===!![],'targetPages':[],'plannedMenus':[]};}const _0x134845=await getOnlineMenuList(_0x5835a2,_0xf78cf0),_0x5466d5=new Set(_0x134845[_0x35090d(0x1ee)](_0x26df8b=>_0x26df8b['path']));let _0xe386f2;if(_0x7850d4['length']>0x0){const _0x22b39a=new Map(_0x26df8a['map'](_0x23f7b0=>[_0x23f7b0[_0x35090d(0x215)],_0x23f7b0])),_0x44c697=_0x7850d4['filter'](_0x5e63f1=>!_0x22b39a[_0x35090d(0x216)](_0x5e63f1));if(_0x44c697[_0x35090d(0x1fd)]>0x0){const _0x2bf514=_0x26df8a[_0x35090d(0x1ee)](_0x5bc4bc=>_0x5bc4bc[_0x35090d(0x215)])['join'](',\x20');throw new Error('No\x20local\x20pages\x20matched\x20paths:\x20'+_0x44c697['join'](',\x20')+_0x35090d(0x200)+_0x2bf514);}const _0x1dc9b6=_0x7850d4[_0x35090d(0x1fa)](_0xfbb241=>_0x5466d5[_0x35090d(0x216)](_0xfbb241));if(_0x1dc9b6[_0x35090d(0x1fd)]>0x0)throw new Error(_0x35090d(0x1f5)+_0x1dc9b6['join'](',\x20'));_0xe386f2=_0x7850d4[_0x35090d(0x1ee)](_0x38c1b4=>_0x22b39a[_0x35090d(0x21d)](_0x38c1b4));}else _0xe386f2=_0x26df8a[_0x35090d(0x1fa)](_0x5613c0=>!_0x5466d5['has'](_0x5613c0[_0x35090d(0x215)]));if(_0xe386f2[_0x35090d(0x1fd)]===0x0)return{'created':0x0,'skipped':!![],'dryRun':_0x4626fe[_0x35090d(0x1f0)]===!![],'targetPages':[],'plannedMenus':[]};const _0x411652=_0xe386f2['map'](_0x1cc254=>({'type':'procode','path':_0x1cc254['path'],'label':_0x1cc254[_0x35090d(0x1fe)],'loadScriptMode':_0x35090d(0x20c),'resources':[..._0x33e8fe]}));if(_0x4626fe[_0x35090d(0x1f0)])return{'created':0x0,'skipped':![],'dryRun':!![],'targetPages':_0xe386f2,'plannedMenus':_0x411652};const _0x858bc5=await createMenus(_0x5835a2,_0xf78cf0,_0xe386f2,_0x33e8fe[_0x35090d(0x1fd)]>0x0?_0x33e8fe:undefined);return logger[_0x35090d(0x20a)]('menu-sync',_0x35090d(0x219),{'count':_0xe386f2[_0x35090d(0x1fd)],'resources':_0x33e8fe}),{'created':_0x858bc5[_0x35090d(0x1fd)],'skipped':![],'dryRun':![],'targetPages':_0xe386f2,'plannedMenus':_0x411652,'menus':_0x858bc5};}export function parseMenuSyncParams(_0x27e032){const _0xd597fa=a127_0x2def76;if(!_0x27e032||typeof _0x27e032!==_0xd597fa(0x206))return{};let _0x2b7b27;try{_0x2b7b27=JSON['parse'](_0x27e032);}catch{throw new Error(_0xd597fa(0x204));}if(typeof _0x2b7b27!=='object'||_0x2b7b27===null||Array[_0xd597fa(0x210)](_0x2b7b27))throw new Error(_0xd597fa(0x21a));const _0x4f0a65=_0x2b7b27;if(Object[_0xd597fa(0x1ef)](_0x4f0a65,_0xd597fa(0x1ed)))throw new Error(_0xd597fa(0x1fc));const _0x24515a=Object[_0xd597fa(0x1ec)](_0x4f0a65)[_0xd597fa(0x1fa)](_0x51afca=>!MENU_SYNC_PARAM_KEYS[_0xd597fa(0x216)](_0x51afca));if(_0x24515a[_0xd597fa(0x1fd)]>0x0)throw new Error(_0xd597fa(0x20f)+_0x24515a[_0xd597fa(0x20b)](',\x20')+'.');for(const _0x16ea08 of MENU_SYNC_PARAM_KEYS){const _0x23c163=_0x4f0a65[_0x16ea08];if(_0x23c163!==undefined&&(typeof _0x23c163!==_0xd597fa(0x206)||_0x23c163[_0xd597fa(0x1f6)]()===''))throw new Error(_0xd597fa(0x1f9)+_0x16ea08+_0xd597fa(0x1f4));}return{'jsUrl':typeof _0x4f0a65[_0xd597fa(0x203)]===_0xd597fa(0x206)?_0x4f0a65[_0xd597fa(0x203)][_0xd597fa(0x1f6)]():undefined,'cssUrl':typeof _0x4f0a65[_0xd597fa(0x1fb)]==='string'?_0x4f0a65[_0xd597fa(0x1fb)][_0xd597fa(0x1f6)]():undefined};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x7a5403,_0x285af2){const _0x8226c7=a129_0x2cbd,_0x3ca143=_0x7a5403();while(!![]){try{const _0x36a48c=parseInt(_0x8226c7(0xb7))/0x1+parseInt(_0x8226c7(0xcd))/0x2+-parseInt(_0x8226c7(0xc1))/0x3+-parseInt(_0x8226c7(0xb3))/0x4+parseInt(_0x8226c7(0xd7))/0x5+-parseInt(_0x8226c7(0xc6))/0x6+parseInt(_0x8226c7(0xc4))/0x7;if(_0x36a48c===_0x285af2)break;else _0x3ca143['push'](_0x3ca143['shift']());}catch(_0x1a490d){_0x3ca143['push'](_0x3ca143['shift']());}}}(a129_0x1245,0xac562));function a129_0x2cbd(_0x34d5ec,_0x5d217e){_0x34d5ec=_0x34d5ec-0xa0;const _0x1245bb=a129_0x1245();let _0x2cbd46=_0x1245bb[_0x34d5ec];return _0x2cbd46;}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(_0x4f18d4){const _0x2816f0=a129_0x2cbd,_0x60044e=[];return _0x4f18d4[_0x2816f0(0xc2)]&&!isValidJsHttpsUrl(_0x4f18d4[_0x2816f0(0xc2)])&&_0x60044e[_0x2816f0(0xc5)]({'field':_0x2816f0(0xc2),'message':'JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL'}),_0x4f18d4[_0x2816f0(0xc3)]&&!isValidCssHttpsUrl(_0x4f18d4[_0x2816f0(0xc3)])&&_0x60044e['push']({'field':'cssUrl','message':_0x2816f0(0xbe)}),_0x60044e;}export async function runMenuUpdateCore(_0x1329ec,_0x351bef,_0x5a8ba7,_0x3d3f06={}){const _0x29c00f=a129_0x2cbd,_0x168775=parseUpdateParamsFlag(_0x5a8ba7),_0x13de15=normalizeMode(_0x3d3f06[_0x29c00f(0xb5)]);validateSelection(_0x3d3f06[_0x29c00f(0xaf)]);const _0x1257b8=[];if(_0x168775[_0x29c00f(0xc2)])_0x1257b8[_0x29c00f(0xc5)](_0x168775[_0x29c00f(0xc2)]);if(_0x168775[_0x29c00f(0xc3)])_0x1257b8[_0x29c00f(0xc5)](_0x168775['cssUrl']);const _0x54c896=validateParams(_0x168775);if(_0x54c896[_0x29c00f(0xa5)]>0x0){const _0x15b091=_0x54c896[_0x29c00f(0xb0)](_0x3ffe3e=>_0x29c00f(0xdc)+_0x3ffe3e[_0x29c00f(0xcf)]+':\x20'+_0x3ffe3e['message'])['join'](';\x20');throw new Error(_0x29c00f(0xa1)+_0x15b091);}if(_0x1257b8[_0x29c00f(0xa5)]===0x0)throw new Error(_0x29c00f(0xa7)+_0x29c00f(0xc8));logger['setLogPath'](process[_0x29c00f(0xae)]()),logger['info'](_0x29c00f(0xa9),'Start\x20non-interactive\x20menu\x20asset\x20update',{'appCode':_0x1329ec,'jsUrl':_0x168775[_0x29c00f(0xc2)],'cssUrl':_0x168775['cssUrl'],'mode':_0x13de15,'dryRun':_0x3d3f06['dryRun']===!![]});if(_0x168775[_0x29c00f(0xc2)]){const _0x26301c=await isUrlReachable(_0x168775[_0x29c00f(0xc2)]);if(!_0x26301c)throw new Error(_0x29c00f(0xc7)+_0x168775[_0x29c00f(0xc2)]);}if(_0x168775[_0x29c00f(0xc3)]){const _0x5a9cba=await isUrlReachable(_0x168775['cssUrl']);if(!_0x5a9cba)throw new Error('CSS\x20URL\x20is\x20unreachable:\x20'+_0x168775[_0x29c00f(0xc3)]);}const _0x10a07c=await getOnlineMenuList(_0x1329ec,_0x351bef),_0x1d54cf=_0x10a07c[_0x29c00f(0xb4)](_0x178295=>_0x178295[_0x29c00f(0xcb)][_0x29c00f(0xa5)]>0x0),_0x5ac3ac=selectMenusForUpdate(_0x1d54cf,_0x3d3f06[_0x29c00f(0xaf)]);if(_0x5ac3ac[_0x29c00f(0xa5)]===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![],'dryRun':_0x3d3f06[_0x29c00f(0xbc)]===!![]};const _0x460280=_0x5ac3ac[_0x29c00f(0xb0)](_0x4b693a=>buildMenuUpdateDiff(_0x4b693a,_0x168775,_0x13de15,_0x3d3f06[_0x29c00f(0xb6)]===!![],_0x3d3f06[_0x29c00f(0xc9)]));if(_0x3d3f06[_0x29c00f(0xbc)])return{'updated':0x0,'failed':0x0,'skipped':![],'dryRun':!![],'diffs':_0x460280};const _0x3017ba=await Promise[_0x29c00f(0xa6)](_0x5ac3ac[_0x29c00f(0xb0)]((_0x42fcc0,_0x5707c2)=>updateMenuCdnUrl(_0x1329ec,_0x351bef,{'id':_0x42fcc0['id'],'label':_0x42fcc0[_0x29c00f(0xd8)],'path':_0x42fcc0[_0x29c00f(0xb2)],'resources':_0x460280[_0x5707c2][_0x29c00f(0xd5)][_0x29c00f(0xcb)],'extend':_0x42fcc0['extend']??null,'loadScriptMode':_0x3d3f06['loadScriptMode']}))),_0x31ad3f=_0x3017ba[_0x29c00f(0xb4)](_0xc1f7f4=>_0xc1f7f4['status']===_0x29c00f(0xb1))['map'](_0x5e42d0=>_0x5e42d0['value']),_0x30e655=_0x3017ba[_0x29c00f(0xb4)](_0xe65441=>_0xe65441[_0x29c00f(0xbd)]==='rejected')['length'];return logger[_0x29c00f(0xd6)](_0x29c00f(0xa9),'Menu\x20asset\x20update\x20completed',{'count':_0x5ac3ac[_0x29c00f(0xa5)],'resources':_0x1257b8}),{'updated':_0x31ad3f[_0x29c00f(0xa5)],'failed':_0x30e655,'skipped':![],'menus':_0x31ad3f};}function validateSelection(_0xb4f31){const _0x55e703=a129_0x2cbd;if(!_0xb4f31)throw new Error(_0x55e703(0xdd));if(_0xb4f31[_0x55e703(0xce)]&&(_0xb4f31[_0x55e703(0xd2)][_0x55e703(0xa5)]>0x0||_0xb4f31[_0x55e703(0xca)][_0x55e703(0xa5)]>0x0))throw new Error(_0x55e703(0xac));if(!_0xb4f31[_0x55e703(0xce)]&&_0xb4f31[_0x55e703(0xd2)]['length']===0x0&&_0xb4f31['paths']['length']===0x0)throw new Error(_0x55e703(0xdd));}export function selectMenusForUpdate(_0x4036ef,_0x59f092){const _0x4a9992=a129_0x2cbd;validateSelection(_0x59f092);if(_0x59f092[_0x4a9992(0xce)])return _0x4036ef;const _0x3c94ac=new Set(_0x4036ef[_0x4a9992(0xb0)](_0x149124=>_0x149124['id'])),_0x39e213=new Set(_0x4036ef[_0x4a9992(0xb0)](_0x43402e=>_0x43402e[_0x4a9992(0xb2)])),_0x513e42=_0x59f092[_0x4a9992(0xd2)][_0x4a9992(0xb4)](_0x2c1dd3=>!_0x3c94ac[_0x4a9992(0xd0)](_0x2c1dd3)),_0x602b70=_0x59f092['paths']['filter'](_0x946946=>!_0x39e213[_0x4a9992(0xd0)](_0x946946));if(_0x513e42['length']>0x0||_0x602b70[_0x4a9992(0xa5)]>0x0){const _0x312d48=[..._0x513e42[_0x4a9992(0xb0)](_0x2033b1=>String(_0x2033b1)),..._0x602b70][_0x4a9992(0xba)](',\x20');throw new Error(_0x4a9992(0xc0)+_0x312d48);}const _0x41b271=new Set(_0x59f092[_0x4a9992(0xd2)]),_0xed19b6=new Set(_0x59f092[_0x4a9992(0xca)]);return _0x4036ef[_0x4a9992(0xb4)](_0x3b8f58=>_0x41b271[_0x4a9992(0xd0)](_0x3b8f58['id'])||_0xed19b6[_0x4a9992(0xd0)](_0x3b8f58[_0x4a9992(0xb2)]));}function normalizeMode(_0x24adca){const _0x51e75b=a129_0x2cbd;if(!_0x24adca)return _0x51e75b(0xbf);if(_0x24adca==='replace'||_0x24adca===_0x51e75b(0xbf))return _0x24adca;throw new Error('Invalid\x20--mode:\x20'+_0x24adca+_0x51e75b(0xda));}function buildMenuUpdateDiff(_0x373e3d,_0x5b132d,_0x1801ab,_0x5bf3e5,_0x3b0179){const _0x1986c3=a129_0x2cbd,_0x30b0af=[..._0x373e3d['resources']];_0x1801ab===_0x1986c3(0xbf)&&assertUnambiguousPatchResources(_0x373e3d,_0x30b0af,_0x5b132d);const _0x47376b=_0x1801ab==='patch'?patchResources(_0x30b0af,_0x5b132d):replaceResources(_0x5b132d),_0x2e66ce=[],_0x4b302a=_0x30b0af[_0x1986c3(0xa4)](isJsResource),_0x339ce9=_0x47376b['some'](isJsResource);if(_0x4b302a&&!_0x339ce9){const _0x1f763f=_0x1986c3(0xcc)+_0x373e3d[_0x1986c3(0xd8)]+_0x1986c3(0xb8)+_0x373e3d[_0x1986c3(0xb2)]+').\x20'+_0x1986c3(0xa8);if(!_0x5bf3e5)throw new Error(_0x1f763f);_0x2e66ce['push'](_0x1f763f);}const _0x4b9a30=_0x30b0af[_0x1986c3(0xa4)](isCssResource),_0xca2084=_0x47376b['some'](isCssResource);_0x4b9a30&&!_0xca2084&&_0x2e66ce[_0x1986c3(0xc5)]('menu\x20asset-update\x20will\x20remove\x20existing\x20CSS\x20resource\x20for\x20\x22'+_0x373e3d['label']+_0x1986c3(0xb8)+_0x373e3d[_0x1986c3(0xb2)]+').');const _0x2d43a5=typeof _0x373e3d[_0x1986c3(0xdb)]?.[_0x1986c3(0xc9)]===_0x1986c3(0xd1)?_0x373e3d[_0x1986c3(0xdb)][_0x1986c3(0xc9)]:null,_0x419453=_0x3b0179?{'loadScriptMode':_0x2d43a5}:{},_0x8115ba=_0x3b0179?{'loadScriptMode':_0x3b0179}:{};return{'id':_0x373e3d['id'],'label':_0x373e3d[_0x1986c3(0xd8)],'path':_0x373e3d[_0x1986c3(0xb2)],'mode':_0x1801ab,'before':{'resources':_0x30b0af,..._0x419453},'after':{'resources':_0x47376b,..._0x8115ba},'warnings':_0x2e66ce};}function replaceResources(_0x3adbca){const _0x4fb21c=a129_0x2cbd;return[_0x3adbca[_0x4fb21c(0xc2)],_0x3adbca['cssUrl']]['filter'](_0x1f2c05=>!!_0x1f2c05);}function assertUnambiguousPatchResources(_0x3f48c3,_0x5d10a5,_0xdcb262){const _0xe57798=a129_0x2cbd,_0x550f18=_0x5d10a5[_0xe57798(0xb4)](isJsResource)[_0xe57798(0xa5)];if(_0xdcb262[_0xe57798(0xc2)]&&_0x550f18>0x1)throw new Error(_0xe57798(0xaa)+_0x550f18+'\x20existing\x20JS\x20resources\x20for\x20\x22'+_0x3f48c3[_0xe57798(0xd8)]+'\x22\x20('+_0x3f48c3[_0xe57798(0xb2)]+')\x20'+_0xe57798(0xa0));const _0x427585=_0x5d10a5[_0xe57798(0xb4)](isCssResource)[_0xe57798(0xa5)];if(_0xdcb262['cssUrl']&&_0x427585>0x1)throw new Error('menu\x20asset-update\x20cannot\x20patch\x20'+_0x427585+_0xe57798(0xd9)+_0x3f48c3['label']+_0xe57798(0xb8)+_0x3f48c3[_0xe57798(0xb2)]+')\x20'+_0xe57798(0xad));}function patchResources(_0x6badb,_0x4e348a){const _0x349fa5=a129_0x2cbd;let _0x7b0db1=![],_0x2ab0b6=![];const _0x21b795=[];for(const _0x405311 of _0x6badb){if(isJsResource(_0x405311)){if(_0x4e348a[_0x349fa5(0xc2)]&&!_0x7b0db1)_0x21b795[_0x349fa5(0xc5)](_0x4e348a[_0x349fa5(0xc2)]),_0x7b0db1=!![];else!_0x4e348a['jsUrl']&&_0x21b795['push'](_0x405311);continue;}if(isCssResource(_0x405311)){if(_0x4e348a[_0x349fa5(0xc3)]&&!_0x2ab0b6)_0x21b795[_0x349fa5(0xc5)](_0x4e348a[_0x349fa5(0xc3)]),_0x2ab0b6=!![];else!_0x4e348a[_0x349fa5(0xc3)]&&_0x21b795[_0x349fa5(0xc5)](_0x405311);continue;}_0x21b795[_0x349fa5(0xc5)](_0x405311);}return _0x4e348a[_0x349fa5(0xc2)]&&!_0x7b0db1&&_0x21b795[_0x349fa5(0xde)](_0x4e348a[_0x349fa5(0xc2)]),_0x4e348a['cssUrl']&&!_0x2ab0b6&&_0x21b795[_0x349fa5(0xc5)](_0x4e348a['cssUrl']),_0x21b795;}function isJsResource(_0x3ecfcf){const _0x2ee210=a129_0x2cbd;return stripQuery(_0x3ecfcf)[_0x2ee210(0xd4)]()[_0x2ee210(0xbb)]('.js');}function isCssResource(_0x2b5580){const _0x5c056f=a129_0x2cbd;return stripQuery(_0x2b5580)[_0x5c056f(0xd4)]()[_0x5c056f(0xbb)]('.css');}function a129_0x1245(){const _0x3cdb0d=['has','string','menuIds','split','toLowerCase','after','info','953290rOrJDT','label','\x20existing\x20CSS\x20resources\x20for\x20\x22','.\x20Allowed\x20values:\x20replace,\x20patch','extend','--params.','menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.','unshift','with\x20a\x20single\x20jsUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','Invalid\x20--params:\x20','trim','object','some','length','allSettled','Invalid\x20--params:\x20menu\x20asset-update\x20requires\x20at\x20least\x20one\x20explicit\x20JS/CSS\x20URL.\x20','Use\x20--mode\x20patch\x20to\x20preserve\x20it,\x20pass\x20jsUrl,\x20or\x20add\x20--force\x20for\x20an\x20intentional\x20removal.','menu-asset-update','menu\x20asset-update\x20cannot\x20patch\x20','isArray','--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.','with\x20a\x20single\x20cssUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','cwd','selection','map','fulfilled','path','1190336ToPbDE','filter','mode','force','704526cwdTne','\x22\x20(','parse','join','endsWith','dryRun','status','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','patch','menu\x20asset-update\x20selectors\x20did\x20not\x20match\x20resource-bearing\x20menus:\x20','2365152NzGNLp','jsUrl','cssUrl','11236687hdVMoa','push','7405032ONmPuG','JS\x20URL\x20is\x20unreachable:\x20','Pass\x20--params\x20\x27{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}\x27\x20to\x20update\x20assets.','loadScriptMode','paths','resources','menu\x20asset-update\x20would\x20remove\x20existing\x20JS\x20resource\x20for\x20\x22','1051210xYEQxb','all','field'];a129_0x1245=function(){return _0x3cdb0d;};return a129_0x1245();}function stripQuery(_0x496fd7){const _0x5605c8=a129_0x2cbd;return _0x496fd7[_0x5605c8(0xd3)]('?')[0x0]??_0x496fd7;}function parseUpdateParamsFlag(_0xf2a068){const _0x469379=a129_0x2cbd;if(!_0xf2a068||typeof _0xf2a068!==_0x469379(0xd1))return{};try{const _0x186e28=JSON[_0x469379(0xb9)](_0xf2a068);if(typeof _0x186e28!==_0x469379(0xa3)||_0x186e28===null||Array[_0x469379(0xab)](_0x186e28))return{};return{'jsUrl':typeof _0x186e28['jsUrl']===_0x469379(0xd1)?_0x186e28['jsUrl']['trim']():undefined,'cssUrl':typeof _0x186e28[_0x469379(0xc3)]===_0x469379(0xd1)?_0x186e28[_0x469379(0xc3)][_0x469379(0xa2)]():undefined};}catch{return{};}}
|
|
1
|
+
(function(_0x278db7,_0xf771c9){const _0xd93c45=a129_0x55f4,_0x4385c1=_0x278db7();while(!![]){try{const _0x23ce58=-parseInt(_0xd93c45(0x106))/0x1*(parseInt(_0xd93c45(0x105))/0x2)+parseInt(_0xd93c45(0xf3))/0x3+parseInt(_0xd93c45(0x11b))/0x4*(parseInt(_0xd93c45(0xe7))/0x5)+-parseInt(_0xd93c45(0xfa))/0x6+parseInt(_0xd93c45(0xf1))/0x7+-parseInt(_0xd93c45(0x102))/0x8*(parseInt(_0xd93c45(0xed))/0x9)+parseInt(_0xd93c45(0xfe))/0xa*(parseInt(_0xd93c45(0x115))/0xb);if(_0x23ce58===_0xf771c9)break;else _0x4385c1['push'](_0x4385c1['shift']());}catch(_0x79f51a){_0x4385c1['push'](_0x4385c1['shift']());}}}(a129_0x379c,0x5c552));function a129_0x379c(){const _0xeec41b=['length','1621611MRImmn','menu\x20asset-update\x20selectors\x20did\x20not\x20match\x20resource-bearing\x20menus:\x20','resources','.\x20Allowed\x20values:\x20replace,\x20patch','4118821ihbDFI','menu\x20asset-update\x20would\x20remove\x20existing\x20JS\x20resource\x20for\x20\x22','1055382wzlvsS','force','allSettled','Start\x20non-interactive\x20menu\x20asset\x20update','dryRun','filter','--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.','2203518yaJCuy','Invalid\x20--params:\x20','rejected','with\x20a\x20single\x20cssUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','582040mlXwzC','mode','endsWith','toLowerCase','8yytTzx','field','string','774ttyRpW','1721lLpmlq','path','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','loadScriptMode','\x22\x20(','menu-asset-update','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','menu\x20asset-update\x20cannot\x20patch\x20','paths','CSS\x20URL\x20is\x20unreachable:\x20','replace','extend','label','push','selection','22wJklfy','cwd','value','patch','parse','jsUrl','1070096sdLZAu','menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.','info','setLogPath','has','menuIds','object','split','\x20existing\x20CSS\x20resources\x20for\x20\x22','Use\x20--mode\x20patch\x20to\x20preserve\x20it,\x20pass\x20jsUrl,\x20or\x20add\x20--force\x20for\x20an\x20intentional\x20removal.','cssUrl','status','map','unshift','some','all','isArray','menu\x20asset-update\x20will\x20remove\x20existing\x20CSS\x20resource\x20for\x20\x22','trim','10OrEbDa','fulfilled','Invalid\x20--params:\x20menu\x20asset-update\x20requires\x20at\x20least\x20one\x20explicit\x20JS/CSS\x20URL.\x20','join',').\x20'];a129_0x379c=function(){return _0xeec41b;};return a129_0x379c();}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(_0x30550d){const _0x20dd71=a129_0x55f4,_0xf3a13=[];return _0x30550d[_0x20dd71(0x11a)]&&!isValidJsHttpsUrl(_0x30550d['jsUrl'])&&_0xf3a13[_0x20dd71(0x113)]({'field':_0x20dd71(0x11a),'message':_0x20dd71(0x108)}),_0x30550d['cssUrl']&&!isValidCssHttpsUrl(_0x30550d[_0x20dd71(0x125)])&&_0xf3a13[_0x20dd71(0x113)]({'field':_0x20dd71(0x125),'message':_0x20dd71(0x10c)}),_0xf3a13;}export async function runMenuUpdateCore(_0x2f598a,_0x4d775b,_0x3e6377,_0x50e496={}){const _0x4c86be=a129_0x55f4,_0x11868d=parseUpdateParamsFlag(_0x3e6377),_0x5f0913=normalizeMode(_0x50e496[_0x4c86be(0xff)]);validateSelection(_0x50e496['selection']);const _0x59aeb8=[];if(_0x11868d[_0x4c86be(0x11a)])_0x59aeb8['push'](_0x11868d['jsUrl']);if(_0x11868d[_0x4c86be(0x125)])_0x59aeb8[_0x4c86be(0x113)](_0x11868d[_0x4c86be(0x125)]);const _0x38e921=validateParams(_0x11868d);if(_0x38e921[_0x4c86be(0xec)]>0x0){const _0x478d18=_0x38e921[_0x4c86be(0x127)](_0xd59c9e=>'--params.'+_0xd59c9e[_0x4c86be(0x103)]+':\x20'+_0xd59c9e['message'])[_0x4c86be(0xea)](';\x20');throw new Error(_0x4c86be(0xfb)+_0x478d18);}if(_0x59aeb8[_0x4c86be(0xec)]===0x0)throw new Error(_0x4c86be(0xe9)+'Pass\x20--params\x20\x27{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}\x27\x20to\x20update\x20assets.');logger[_0x4c86be(0x11e)](process[_0x4c86be(0x116)]()),logger[_0x4c86be(0x11d)](_0x4c86be(0x10b),_0x4c86be(0xf6),{'appCode':_0x2f598a,'jsUrl':_0x11868d[_0x4c86be(0x11a)],'cssUrl':_0x11868d[_0x4c86be(0x125)],'mode':_0x5f0913,'dryRun':_0x50e496['dryRun']===!![]});if(_0x11868d['jsUrl']){const _0xf78706=await isUrlReachable(_0x11868d['jsUrl']);if(!_0xf78706)throw new Error('JS\x20URL\x20is\x20unreachable:\x20'+_0x11868d[_0x4c86be(0x11a)]);}if(_0x11868d[_0x4c86be(0x125)]){const _0x4389ed=await isUrlReachable(_0x11868d[_0x4c86be(0x125)]);if(!_0x4389ed)throw new Error(_0x4c86be(0x10f)+_0x11868d[_0x4c86be(0x125)]);}const _0x323529=await getOnlineMenuList(_0x2f598a,_0x4d775b),_0x4985b8=_0x323529[_0x4c86be(0xf8)](_0x2837e1=>_0x2837e1['resources']['length']>0x0),_0x3fdbbd=selectMenusForUpdate(_0x4985b8,_0x50e496[_0x4c86be(0x114)]);if(_0x3fdbbd['length']===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![],'dryRun':_0x50e496[_0x4c86be(0xf7)]===!![]};const _0x2ce8bf=_0x3fdbbd[_0x4c86be(0x127)](_0x10d510=>buildMenuUpdateDiff(_0x10d510,_0x11868d,_0x5f0913,_0x50e496[_0x4c86be(0xf4)]===!![],_0x50e496[_0x4c86be(0x109)]));if(_0x50e496[_0x4c86be(0xf7)])return{'updated':0x0,'failed':0x0,'skipped':![],'dryRun':!![],'diffs':_0x2ce8bf};const _0x621b3a=await Promise[_0x4c86be(0xf5)](_0x3fdbbd[_0x4c86be(0x127)]((_0x5b4583,_0x2b59fe)=>updateMenuCdnUrl(_0x2f598a,_0x4d775b,{'id':_0x5b4583['id'],'label':_0x5b4583[_0x4c86be(0x112)],'path':_0x5b4583['path'],'resources':_0x2ce8bf[_0x2b59fe]['after'][_0x4c86be(0xef)],'extend':_0x5b4583['extend']??null,'loadScriptMode':_0x50e496['loadScriptMode']}))),_0x381c0e=_0x621b3a['filter'](_0x391e14=>_0x391e14[_0x4c86be(0x126)]===_0x4c86be(0xe8))[_0x4c86be(0x127)](_0xa64af9=>_0xa64af9[_0x4c86be(0x117)]),_0x3cab6f=_0x621b3a[_0x4c86be(0xf8)](_0x4c52a9=>_0x4c52a9['status']===_0x4c86be(0xfc))[_0x4c86be(0xec)];return logger['info'](_0x4c86be(0x10b),'Menu\x20asset\x20update\x20completed',{'count':_0x3fdbbd['length'],'resources':_0x59aeb8}),{'updated':_0x381c0e[_0x4c86be(0xec)],'failed':_0x3cab6f,'skipped':![],'menus':_0x381c0e};}function validateSelection(_0x190e76){const _0x15d971=a129_0x55f4;if(!_0x190e76)throw new Error(_0x15d971(0x11c));if(_0x190e76[_0x15d971(0xe3)]&&(_0x190e76[_0x15d971(0x120)][_0x15d971(0xec)]>0x0||_0x190e76[_0x15d971(0x10e)]['length']>0x0))throw new Error(_0x15d971(0xf9));if(!_0x190e76['all']&&_0x190e76[_0x15d971(0x120)]['length']===0x0&&_0x190e76[_0x15d971(0x10e)][_0x15d971(0xec)]===0x0)throw new Error(_0x15d971(0x11c));}export function selectMenusForUpdate(_0x26c6ee,_0x334569){const _0x32e72e=a129_0x55f4;validateSelection(_0x334569);if(_0x334569[_0x32e72e(0xe3)])return _0x26c6ee;const _0x1e8e66=new Set(_0x26c6ee[_0x32e72e(0x127)](_0x497ec0=>_0x497ec0['id'])),_0x11d9c7=new Set(_0x26c6ee[_0x32e72e(0x127)](_0xd2564b=>_0xd2564b[_0x32e72e(0x107)])),_0x3de1b5=_0x334569['menuIds']['filter'](_0xd6ab6e=>!_0x1e8e66[_0x32e72e(0x11f)](_0xd6ab6e)),_0x1abc07=_0x334569[_0x32e72e(0x10e)][_0x32e72e(0xf8)](_0x47d2ee=>!_0x11d9c7[_0x32e72e(0x11f)](_0x47d2ee));if(_0x3de1b5[_0x32e72e(0xec)]>0x0||_0x1abc07[_0x32e72e(0xec)]>0x0){const _0x162c34=[..._0x3de1b5[_0x32e72e(0x127)](_0x32d481=>String(_0x32d481)),..._0x1abc07][_0x32e72e(0xea)](',\x20');throw new Error(_0x32e72e(0xee)+_0x162c34);}const _0x384235=new Set(_0x334569[_0x32e72e(0x120)]),_0x131ce4=new Set(_0x334569[_0x32e72e(0x10e)]);return _0x26c6ee[_0x32e72e(0xf8)](_0x191029=>_0x384235[_0x32e72e(0x11f)](_0x191029['id'])||_0x131ce4['has'](_0x191029[_0x32e72e(0x107)]));}function normalizeMode(_0xb447a0){const _0x581ea5=a129_0x55f4;if(!_0xb447a0)return _0x581ea5(0x118);if(_0xb447a0===_0x581ea5(0x110)||_0xb447a0===_0x581ea5(0x118))return _0xb447a0;throw new Error('Invalid\x20--mode:\x20'+_0xb447a0+_0x581ea5(0xf0));}function a129_0x55f4(_0x1dec26,_0x1a89df){_0x1dec26=_0x1dec26-0xe3;const _0x379cf7=a129_0x379c();let _0x55f48d=_0x379cf7[_0x1dec26];return _0x55f48d;}function buildMenuUpdateDiff(_0x1316d6,_0x29cc2b,_0x26c022,_0x3aeac7,_0x288c6b){const _0x1f67c0=a129_0x55f4,_0x22604f=[..._0x1316d6['resources']];_0x26c022===_0x1f67c0(0x118)&&assertUnambiguousPatchResources(_0x1316d6,_0x22604f,_0x29cc2b);const _0xe8ebaa=_0x26c022===_0x1f67c0(0x118)?patchResources(_0x22604f,_0x29cc2b):replaceResources(_0x29cc2b),_0x122612=[],_0x2a5658=_0x22604f['some'](isJsResource),_0x5b8557=_0xe8ebaa[_0x1f67c0(0x129)](isJsResource);if(_0x2a5658&&!_0x5b8557){const _0x40b230=_0x1f67c0(0xf2)+_0x1316d6[_0x1f67c0(0x112)]+_0x1f67c0(0x10a)+_0x1316d6['path']+_0x1f67c0(0xeb)+_0x1f67c0(0x124);if(!_0x3aeac7)throw new Error(_0x40b230);_0x122612[_0x1f67c0(0x113)](_0x40b230);}const _0x10bccc=_0x22604f[_0x1f67c0(0x129)](isCssResource),_0x3efece=_0xe8ebaa['some'](isCssResource);_0x10bccc&&!_0x3efece&&_0x122612[_0x1f67c0(0x113)](_0x1f67c0(0xe5)+_0x1316d6['label']+'\x22\x20('+_0x1316d6[_0x1f67c0(0x107)]+').');const _0x33a62b=typeof _0x1316d6[_0x1f67c0(0x111)]?.[_0x1f67c0(0x109)]===_0x1f67c0(0x104)?_0x1316d6[_0x1f67c0(0x111)][_0x1f67c0(0x109)]:null,_0x3e6ad0=_0x288c6b?{'loadScriptMode':_0x33a62b}:{},_0x377882=_0x288c6b?{'loadScriptMode':_0x288c6b}:{};return{'id':_0x1316d6['id'],'label':_0x1316d6['label'],'path':_0x1316d6[_0x1f67c0(0x107)],'mode':_0x26c022,'before':{'resources':_0x22604f,..._0x3e6ad0},'after':{'resources':_0xe8ebaa,..._0x377882},'warnings':_0x122612};}function replaceResources(_0x4949ea){const _0x46a2d9=a129_0x55f4;return[_0x4949ea[_0x46a2d9(0x11a)],_0x4949ea[_0x46a2d9(0x125)]][_0x46a2d9(0xf8)](_0x1bb754=>!!_0x1bb754);}function assertUnambiguousPatchResources(_0x3d657f,_0x2ed3ae,_0x14a566){const _0x24b6bb=a129_0x55f4,_0x48987b=_0x2ed3ae[_0x24b6bb(0xf8)](isJsResource)[_0x24b6bb(0xec)];if(_0x14a566['jsUrl']&&_0x48987b>0x1)throw new Error(_0x24b6bb(0x10d)+_0x48987b+'\x20existing\x20JS\x20resources\x20for\x20\x22'+_0x3d657f[_0x24b6bb(0x112)]+_0x24b6bb(0x10a)+_0x3d657f[_0x24b6bb(0x107)]+')\x20'+'with\x20a\x20single\x20jsUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.');const _0x421ed8=_0x2ed3ae[_0x24b6bb(0xf8)](isCssResource)['length'];if(_0x14a566[_0x24b6bb(0x125)]&&_0x421ed8>0x1)throw new Error('menu\x20asset-update\x20cannot\x20patch\x20'+_0x421ed8+_0x24b6bb(0x123)+_0x3d657f['label']+_0x24b6bb(0x10a)+_0x3d657f[_0x24b6bb(0x107)]+')\x20'+_0x24b6bb(0xfd));}function patchResources(_0x878321,_0x574dd1){const _0x594e4d=a129_0x55f4;let _0x5dbe39=![],_0x2a6a2e=![];const _0x4ccc80=[];for(const _0x257b47 of _0x878321){if(isJsResource(_0x257b47)){if(_0x574dd1[_0x594e4d(0x11a)]&&!_0x5dbe39)_0x4ccc80['push'](_0x574dd1[_0x594e4d(0x11a)]),_0x5dbe39=!![];else!_0x574dd1[_0x594e4d(0x11a)]&&_0x4ccc80['push'](_0x257b47);continue;}if(isCssResource(_0x257b47)){if(_0x574dd1[_0x594e4d(0x125)]&&!_0x2a6a2e)_0x4ccc80[_0x594e4d(0x113)](_0x574dd1[_0x594e4d(0x125)]),_0x2a6a2e=!![];else!_0x574dd1[_0x594e4d(0x125)]&&_0x4ccc80[_0x594e4d(0x113)](_0x257b47);continue;}_0x4ccc80[_0x594e4d(0x113)](_0x257b47);}return _0x574dd1[_0x594e4d(0x11a)]&&!_0x5dbe39&&_0x4ccc80[_0x594e4d(0x128)](_0x574dd1['jsUrl']),_0x574dd1['cssUrl']&&!_0x2a6a2e&&_0x4ccc80[_0x594e4d(0x113)](_0x574dd1[_0x594e4d(0x125)]),_0x4ccc80;}function isJsResource(_0x17a34c){const _0x411ee1=a129_0x55f4;return stripQuery(_0x17a34c)[_0x411ee1(0x101)]()[_0x411ee1(0x100)]('.js');}function isCssResource(_0x217a41){const _0x1e1ea3=a129_0x55f4;return stripQuery(_0x217a41)['toLowerCase']()[_0x1e1ea3(0x100)]('.css');}function stripQuery(_0x639ca9){const _0x138450=a129_0x55f4;return _0x639ca9[_0x138450(0x122)]('?')[0x0]??_0x639ca9;}function parseUpdateParamsFlag(_0x37c215){const _0x36e66a=a129_0x55f4;if(!_0x37c215||typeof _0x37c215!==_0x36e66a(0x104))return{};try{const _0x7b9d2f=JSON[_0x36e66a(0x119)](_0x37c215);if(typeof _0x7b9d2f!==_0x36e66a(0x121)||_0x7b9d2f===null||Array[_0x36e66a(0xe4)](_0x7b9d2f))return{};return{'jsUrl':typeof _0x7b9d2f['jsUrl']===_0x36e66a(0x104)?_0x7b9d2f['jsUrl'][_0x36e66a(0xe6)]():undefined,'cssUrl':typeof _0x7b9d2f[_0x36e66a(0x125)]===_0x36e66a(0x104)?_0x7b9d2f['cssUrl'][_0x36e66a(0xe6)]():undefined};}catch{return{};}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a130_0x53e4(_0x356195,_0xab0baf){_0x356195=_0x356195-0x1af;const _0x4a6d66=a130_0x4a6d();let _0x53e4d1=_0x4a6d66[_0x356195];return _0x53e4d1;}(function(_0x59ec7d,_0x3451a0){const _0x2b14a3=a130_0x53e4,_0x4e10a2=_0x59ec7d();while(!![]){try{const _0x2d579a=parseInt(_0x2b14a3(0x1b2))/0x1*(parseInt(_0x2b14a3(0x1b0))/0x2)+parseInt(_0x2b14a3(0x1b4))/0x3+-parseInt(_0x2b14a3(0x1b3))/0x4+-parseInt(_0x2b14a3(0x1b7))/0x5+parseInt(_0x2b14a3(0x1b5))/0x6*(parseInt(_0x2b14a3(0x1af))/0x7)+-parseInt(_0x2b14a3(0x1b6))/0x8+-parseInt(_0x2b14a3(0x1ba))/0x9;if(_0x2d579a===_0x3451a0)break;else _0x4e10a2['push'](_0x4e10a2['shift']());}catch(_0x5ed878){_0x4e10a2['push'](_0x4e10a2['shift']());}}}(a130_0x4a6d,0x82f66));export function isValidJsHttpsUrl(_0xe3cf03){const _0x4c9dce=a130_0x53e4;return/^https:\/\/.+\.js(\?.*)?$/[_0x4c9dce(0x1b8)](_0xe3cf03[_0x4c9dce(0x1b9)]());}function a130_0x4a6d(){const _0x180921=['138fwmARt','2567360ojIqBA','1427370euHwXI','test','trim','3152088dwcXhz','318381jHAQgx','716670vsHvni','HEAD','2QePFJY','3125864ZJmhJn','1535205AXWmyK'];a130_0x4a6d=function(){return _0x180921;};return a130_0x4a6d();}export function isValidCssHttpsUrl(_0x34a9dd){const _0x21e0d8=a130_0x53e4;return/^https:\/\/.+\.css(\?.*)?$/[_0x21e0d8(0x1b8)](_0x34a9dd['trim']());}export async function isUrlReachable(_0x599468){const _0x5ce046=a130_0x53e4;try{const _0x25d606=await fetch(_0x599468,{'method':_0x5ce046(0x1b1)});return _0x25d606['ok'];}catch{return![];}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a131_0x1a3a06=a131_0x25ec;function a131_0x25ec(_0x5c5533,_0x5a3425){_0x5c5533=_0x5c5533-0x1ee;const _0x4e4f9c=a131_0x4e4f();let _0x25eca9=_0x4e4f9c[_0x5c5533];return _0x25eca9;}(function(_0x366a97,_0x2374fb){const _0x48221a=a131_0x25ec,_0x878e8c=_0x366a97();while(!![]){try{const _0x226018=parseInt(_0x48221a(0x1ff))/0x1*(-parseInt(_0x48221a(0x22b))/0x2)+parseInt(_0x48221a(0x21f))/0x3*(-parseInt(_0x48221a(0x231))/0x4)+parseInt(_0x48221a(0x213))/0x5*(-parseInt(_0x48221a(0x1f7))/0x6)+parseInt(_0x48221a(0x230))/0x7*(parseInt(_0x48221a(0x205))/0x8)+parseInt(_0x48221a(0x227))/0x9+parseInt(_0x48221a(0x22c))/0xa*(-parseInt(_0x48221a(0x1f9))/0xb)+-parseInt(_0x48221a(0x207))/0xc*(-parseInt(_0x48221a(0x212))/0xd);if(_0x226018===_0x2374fb)break;else _0x878e8c['push'](_0x878e8c['shift']());}catch(_0x3d1a88){_0x878e8c['push'](_0x878e8c['shift']());}}}(a131_0x4e4f,0x83c90));import a131_0x474074 from'chalk';import{buildCompareRows,doCreateMenus,fetchMenuData}from'../../commands/menu/shared/logic.js';import{renderCompareTable,renderSyncSummary}from'../../commands/menu/shared/compare-table.js';import{selectPages,askJsUrl,askCssUrl,askConfirm,startSpinner,stopSpinner,isInteractive,requireInteractive}from'../../commands/menu/shared/inquirer.js';import{CliErrors}from'../../errors.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';import{parseMenuSyncParams,runMenuSyncCore}from'../../commands/menu/shared/sync-core.js';import{getLocalPages}from'../../commands/menu/shared/local-pages.js';import{isInProject}from'../../context.js';function a131_0x4e4f(){const _0x692cb=['appCode','\x20menu(s)...','Menu\x20sync\x20completed:\x20','\x20failed.','1770AyGDFJ','Sync\x20local\x20pages\x20as\x20platform\x20menus','!\x20No\x20local\x20pages\x20found\x20in\x20src/pages','string','trim','onlinePaths','cookie','message','4923873BnFOUT','✓\x20Menu\x20sync\x20completed:\x20','\x20\x20Create\x20','\x20\x20Cancelled.','859666ncbNaS','112660lZenJC','Would\x20create\x20','Menu\x20creation\x20failed','yellow','6790BJNDwx','2616owDMfE','split','Failed\x20to\x20fetch\x20online\x20menu\x20list','filter','paths','\x20menu(s)\x20created','Pre-fill\x20JS/CSS\x20URLs.\x20','boolean','failed','str','created','✓\x20All\x20local\x20pages\x20are\x20already\x20on\x20platform','cyan','\x20page(s)','targetPages','localPages','240798ffnXvR','No\x20local\x20microfrontend\x20menus\x20would\x20be\x20created.','66pLcXMj','size','POST','Menu\x20sync\x20skipped','\x20and\x20CSS:\x20','sync','1ObPtEB','Fetching\x20online\x20menu\x20list...','cssUrl','skipped','menu\x20sync\x20requires\x20a\x20project\x20context\x20or\x20explicit\x20--appcode.\x20','JSON:\x20{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}','1768lGNazM','length','1572FFQgnl','write','\x20created.','\x20\x20✓\x20Selected:\x20','selectedAppName','validation','Preview\x20with\x20--dry-run,\x20then\x20reuse\x20the\x20same\x20--paths\x20and\x20--params\x20with\x20--yes.','Run\x20inside\x20a\x20directory\x20with\x20.rabetbase.json,\x20or\x20pass\x20--appcode\x20<code>.','\x20menu(s)','gray','rawFlags','93535CvXtnB','35nNlCYo','\x20created,\x20','appcode','menu\x20sync\x20--paths\x20requires\x20--yes\x20for\x20execution.','jsUrl','yes','Online\x20menu\x20list\x20fetched','Non-interactive\x20menu\x20sync\x20requires\x20--yes.'];a131_0x4e4f=function(){return _0x692cb;};return a131_0x4e4f();}export const menuSync={'service':'menu','command':a131_0x1a3a06(0x1fe),'description':a131_0x1a3a06(0x220),'risk':a131_0x1a3a06(0x208),'flags':[{'name':'params','type':a131_0x1a3a06(0x222),'description':a131_0x1a3a06(0x237)+a131_0x1a3a06(0x204)},{'name':a131_0x1a3a06(0x235),'type':a131_0x1a3a06(0x222),'description':'Exact\x20comma-separated\x20local\x20page\x20paths\x20to\x20sync'},{'name':a131_0x1a3a06(0x218),'type':a131_0x1a3a06(0x1ee),'description':'Confirm\x20non-interactive\x20sync;\x20without\x20--paths,\x20create\x20all\x20missing\x20local\x20pages'}],async 'dryRun'(_0x23ac20){const _0x26f986=a131_0x1a3a06;ensureRunnableContext(_0x23ac20['rawFlags'],_0x23ac20[_0x26f986(0x20b)]);const _0x216ec4=await runMenuSyncCore(_0x23ac20['appCode'],_0x23ac20['cookie'],parsePaths(_0x23ac20[_0x26f986(0x1f0)]('paths')),_0x23ac20[_0x26f986(0x1f0)]('params'),{'dryRun':!![]});return{'method':_0x26f986(0x1fb),'url':'/smartapi/menu/create','body':_0x216ec4,'description':_0x216ec4['skipped']?_0x26f986(0x1f8):_0x26f986(0x22d)+_0x216ec4[_0x26f986(0x1f5)][_0x26f986(0x206)]+'\x20local\x20microfrontend\x20menu(s).'};},async 'execute'(_0x361062){const _0x587db6=a131_0x1a3a06;ensureRunnableContext(_0x361062[_0x587db6(0x211)],_0x361062['selectedAppName']);const _0x4b305b=_0x361062['flag']('yes'),_0x2b8dc2=_0x361062[_0x587db6(0x1f0)]('params'),_0x37f021=parsePaths(_0x361062[_0x587db6(0x1f0)](_0x587db6(0x235))),_0x77642d=parseMenuSyncParams(_0x2b8dc2);if(_0x4b305b){const _0x11a31a=await runMenuSyncCore(_0x361062[_0x587db6(0x21b)],_0x361062[_0x587db6(0x225)],_0x37f021,_0x2b8dc2);if(_0x11a31a[_0x587db6(0x202)]){const _0x22bc2a=getLocalPages();_0x22bc2a[_0x587db6(0x206)]===0x0?writeCliSideChannelLine(_0x587db6(0x221)):writeCliSideChannelLine(_0x587db6(0x1f2));}else writeCliSideChannelLine(_0x587db6(0x228)+_0x11a31a[_0x587db6(0x1f1)]+_0x587db6(0x236));return{'ok':!![],'data':_0x11a31a,'message':_0x11a31a[_0x587db6(0x202)]?_0x587db6(0x1fc):'Menu\x20sync\x20completed:\x20'+_0x11a31a[_0x587db6(0x1f1)]+_0x587db6(0x209)};}if(_0x37f021[_0x587db6(0x206)]>0x0)throw CliErrors[_0x587db6(0x20c)](_0x587db6(0x216),_0x587db6(0x20d));if(!isInteractive()&&_0x2b8dc2)throw CliErrors[_0x587db6(0x20c)](_0x587db6(0x21a),_0x587db6(0x20d));requireInteractive();const _0x4ae102=startSpinner(_0x587db6(0x200));let _0x26720a,_0x4e5d37,_0xd274de;try{const _0x1f0c45=await fetchMenuData(_0x361062[_0x587db6(0x21b)],_0x361062[_0x587db6(0x225)]);_0x26720a=_0x1f0c45[_0x587db6(0x1f6)],_0x4e5d37=_0x1f0c45[_0x587db6(0x224)],_0xd274de=_0x1f0c45['onlineMenuList'],stopSpinner(_0x4ae102,_0x587db6(0x219),!![]);}catch(_0x8094a6){stopSpinner(_0x4ae102,'Failed\x20to\x20fetch\x20online\x20menu\x20list',![]);throw CliErrors[_0x587db6(0x20c)](_0x8094a6 instanceof Error?_0x8094a6[_0x587db6(0x226)]:_0x587db6(0x233));}if(_0x26720a['length']===0x0)return writeCliSideChannelLine(a131_0x474074[_0x587db6(0x22f)]('\x20\x20!\x20No\x20local\x20pages\x20found,\x20please\x20create\x20pages\x20first')),{'ok':!![]};const _0x1e3b4f=buildCompareRows(_0x26720a,_0x4e5d37);writeCliSideChannelLine(renderCompareTable(_0x1e3b4f)),writeCliSideChannelLine('');const _0x575495=await selectPages(_0x26720a,_0x4e5d37);writeCliSideChannelLine(''),writeCliSideChannelLine(a131_0x474074[_0x587db6(0x1f3)](_0x587db6(0x20a)+_0x575495[_0x587db6(0x206)]+_0x587db6(0x1f4)));const _0x59af8f=_0x77642d['jsUrl']&&_0x77642d[_0x587db6(0x201)];if(!_0x59af8f){writeCliSideChannelLine(renderSyncSummary(_0x575495,_0x4e5d37[_0x587db6(0x1fa)]>0x0));const _0xb1c236=await askConfirm('\x20\x20Continue\x20with\x20creation?');if(!_0xb1c236)return writeCliSideChannelLine(a131_0x474074['gray'](_0x587db6(0x22a))),{'ok':!![]};}let _0x340a7a=_0x77642d[_0x587db6(0x217)],_0x2816a1=_0x77642d[_0x587db6(0x201)];!_0x340a7a&&(_0x340a7a=await askJsUrl());!_0x2816a1&&(_0x2816a1=await askCssUrl());const _0x53e450=await askConfirm(_0x587db6(0x229)+_0x575495[_0x587db6(0x206)]+'\x20menu(s)\x20with\x20JS:\x20'+_0x340a7a+_0x587db6(0x1fd)+_0x2816a1+'?');if(!_0x53e450)return writeCliSideChannelLine(a131_0x474074[_0x587db6(0x210)](_0x587db6(0x22a))),{'ok':!![]};const _0x3c70f1=[_0x340a7a,_0x2816a1],_0x355714=startSpinner('Creating\x20'+_0x575495[_0x587db6(0x206)]+_0x587db6(0x21c));try{const _0x55be68=await doCreateMenus(_0x361062[_0x587db6(0x21b)],_0x361062[_0x587db6(0x225)],_0x575495,_0x3c70f1);return stopSpinner(_0x355714,'Created\x20'+_0x55be68[_0x587db6(0x1f1)]+_0x587db6(0x20f),!![]),{'ok':!![],'data':_0x55be68,'message':_0x587db6(0x21d)+_0x55be68[_0x587db6(0x1f1)]+_0x587db6(0x214)+_0x55be68[_0x587db6(0x1ef)]+_0x587db6(0x21e)};}catch(_0x41c7ca){stopSpinner(_0x355714,'Menu\x20creation\x20failed',![]);throw CliErrors[_0x587db6(0x20c)](_0x41c7ca instanceof Error?_0x41c7ca[_0x587db6(0x226)]:_0x587db6(0x22e));}}};function ensureRunnableContext(_0x5e4501,_0x4e8a71){const _0x371a2c=a131_0x1a3a06,_0x131ae6=_0x5e4501[_0x371a2c(0x215)]?String(_0x5e4501[_0x371a2c(0x215)])['trim']():'';if(!isInProject()&&!_0x4e8a71&&!_0x131ae6)throw CliErrors[_0x371a2c(0x20c)](_0x371a2c(0x203)+_0x371a2c(0x20e));}function parsePaths(_0x1e0173){const _0x22a4b2=a131_0x1a3a06;return[...new Set(_0x1e0173[_0x22a4b2(0x232)](',')['map'](_0x2d7243=>_0x2d7243[_0x22a4b2(0x223)]())[_0x22a4b2(0x234)](Boolean))];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a132_0x2c41bd=a132_0xef08;(function(_0x4b3a28,_0xf27258){const _0x13ba31=a132_0xef08,_0x109550=_0x4b3a28();while(!![]){try{const _0x34f56f=-parseInt(_0x13ba31(0x77))/0x1*(parseInt(_0x13ba31(0x92))/0x2)+parseInt(_0x13ba31(0x74))/0x3*(-parseInt(_0x13ba31(0x96))/0x4)+parseInt(_0x13ba31(0x8d))/0x5*(-parseInt(_0x13ba31(0x82))/0x6)+parseInt(_0x13ba31(0x7f))/0x7+-parseInt(_0x13ba31(0x8c))/0x8+parseInt(_0x13ba31(0x87))/0x9+parseInt(_0x13ba31(0x76))/0xa;if(_0x34f56f===_0xf27258)break;else _0x109550['push'](_0x109550['shift']());}catch(_0x2e576a){_0x109550['push'](_0x109550['shift']());}}}(a132_0x264c,0x761ef));function a132_0xef08(_0x36d9a6,_0x4ca248){_0x36d9a6=_0x36d9a6-0x74;const _0x264c23=a132_0x264c();let _0xef08b3=_0x264c23[_0x36d9a6];return _0xef08b3;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{listNotificationChannelConfigs}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const NOTIFICATION_CHANNEL_TYPES=[a132_0x2c41bd(0x99),a132_0x2c41bd(0x79),'DINGTALK',a132_0x2c41bd(0x9a),a132_0x2c41bd(0x8f)];export const notificationConfigList={'service':a132_0x2c41bd(0x85),'command':a132_0x2c41bd(0x83),'description':a132_0x2c41bd(0x88),'risk':'read','flags':[APPCODE_FLAG_OPTIONAL,{'name':a132_0x2c41bd(0x86),'type':a132_0x2c41bd(0x81),'description':a132_0x2c41bd(0x7c),'enum':NOTIFICATION_CHANNEL_TYPES,'default':a132_0x2c41bd(0x99)}],async 'validate'(_0x58b515){readChannelType(_0x58b515);},async 'execute'(_0x59cf90){const _0x67eafb=a132_0x2c41bd,_0x41238d=readChannelType(_0x59cf90),_0x58563a=await listNotificationChannelConfigs(_0x59cf90['appCode'],_0x41238d),_0x155ba1=_0x58563a['map'](projectNotificationConfig);return{'ok':!![],'data':{'appCode':_0x59cf90[_0x67eafb(0x80)],'channelType':_0x41238d,'count':_0x155ba1[_0x67eafb(0x9b)],'configs':_0x155ba1},'message':_0x67eafb(0x7a)+_0x155ba1[_0x67eafb(0x9b)]+'\x20'+_0x41238d+_0x67eafb(0x8a)};}};function readChannelType(_0x1665f7){const _0x199328=a132_0x2c41bd,_0x5cc3d3=_0x1665f7[_0x199328(0x7b)](_0x199328(0x86))[_0x199328(0x95)]()||'EMAIL';if(!NOTIFICATION_CHANNEL_TYPES[_0x199328(0x7e)](_0x5cc3d3))throw CliErrors[_0x199328(0x97)](_0x199328(0x89)+_0x5cc3d3,'Allowed\x20values:\x20'+NOTIFICATION_CHANNEL_TYPES[_0x199328(0x78)](',\x20')+'.');return _0x5cc3d3;}function a132_0x264c(){const _0x5ed5a4=['number','5943110mfbADA','983PNJhOE','join','FEISHU','Found\x20','str','Notification\x20channel\x20type','apiError','includes','4860730dNzjFi','appCode','string','4356eXBcmC','config-list','updateTime','notification','type','5870403PJFYNg','List\x20app-level\x20notification\x20configs\x20and\x20their\x20configCode\x20values','Invalid\x20--type:\x20','\x20notification\x20config(s)','configCode','2549320Cogwge','1690TPFBiV','configName','WEBHOOK','Item\x20','\x20is\x20missing\x20required\x20field\x20\x22','32XsQPRK','Invalid\x20notification\x20config\x20response.','description','trim','3368aFNKkC','validation','channelType','EMAIL','WECOM','length','3126JdxdQo'];a132_0x264c=function(){return _0x5ed5a4;};return a132_0x264c();}function projectNotificationConfig(_0x4252a6,_0x160b05){const _0x260d22=a132_0x2c41bd;return{'id':typeof _0x4252a6['id']===_0x260d22(0x75)?_0x4252a6['id']:null,'configCode':requireConfigString(_0x4252a6,_0x260d22(0x8b),_0x160b05),'configName':requireConfigString(_0x4252a6,_0x260d22(0x8e),_0x160b05),'channelType':requireConfigString(_0x4252a6,_0x260d22(0x98),_0x160b05),'description':normalizeNullableString(_0x4252a6[_0x260d22(0x94)]),'createTime':normalizeNullableString(_0x4252a6['createTime']),'updateTime':normalizeNullableString(_0x4252a6[_0x260d22(0x84)])};}function requireConfigString(_0x448cb5,_0xe21396,_0x264114){const _0x14fe45=a132_0x2c41bd,_0x4079d0=_0x448cb5[_0xe21396];if(typeof _0x4079d0!==_0x14fe45(0x81)||_0x4079d0[_0x14fe45(0x95)]()==='')throw CliErrors[_0x14fe45(0x7d)](_0x14fe45(0x93),_0x14fe45(0x90)+(_0x264114+0x1)+_0x14fe45(0x91)+_0xe21396+'\x22.');return _0x4079d0[_0x14fe45(0x95)]();}function normalizeNullableString(_0x35a30d){return typeof _0x35a30d==='string'?_0x35a30d:null;}
|