@lovrabet/rabetbase-cli 2.3.16-beta.1 → 2.3.16-beta.2
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 -0
- 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/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/init.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/save.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -0
- package/lib/commands/tenant/members-list.js +1 -0
- package/lib/commands/tenant/shared.js +1 -0
- 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 +2 -2
- package/lib/commands/app/add.js +0 -1
- package/lib/commands/app/remove.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5cd968,_0x2a94d0){const _0x1eb94d=a120_0x511b,_0x3c37d1=_0x5cd968();while(!![]){try{const _0x4eb0cc=-parseInt(_0x1eb94d(0x130))/0x1*(-parseInt(_0x1eb94d(0x145))/0x2)+parseInt(_0x1eb94d(0x147))/0x3+parseInt(_0x1eb94d(0x149))/0x4+parseInt(_0x1eb94d(0x14d))/0x5+-parseInt(_0x1eb94d(0x154))/0x6*(parseInt(_0x1eb94d(0x150))/0x7)+parseInt(_0x1eb94d(0x142))/0x8*(parseInt(_0x1eb94d(0x158))/0x9)+-parseInt(_0x1eb94d(0x12c))/0xa*(parseInt(_0x1eb94d(0x13d))/0xb);if(_0x4eb0cc===_0x2a94d0)break;else _0x3c37d1['push'](_0x3c37d1['shift']());}catch(_0x53c233){_0x3c37d1['push'](_0x3c37d1['shift']());}}}(a120_0x13d1,0x1accc));import{createHash}from'node:crypto';import{getMenuTree}from'../../../core/api-client.js';export async function fetchMenuSnapshot(_0x16701e,_0x174ffc,_0x848428={}){const _0x77ec46=a120_0x511b,_0x5b3c0d=await getMenuTree(_0x16701e,_0x174ffc);return buildMenuSnapshot(Array[_0x77ec46(0x144)](_0x5b3c0d)?_0x5b3c0d:[],_0x848428);}export function buildMenuSnapshot(_0x428bfb,_0x292d02={}){const _0x18cf37=a120_0x511b,_0x4a8b81=flattenMenuItems(_0x428bfb,{'verbose':_0x292d02[_0x18cf37(0x155)]===!![],'parentId':null,'depth':0x0}),_0x1dc4b7=new Map(_0x4a8b81['map'](_0x45a319=>[_0x45a319['id'],_0x45a319])),_0x17178b=createHash('sha256')['update'](JSON[_0x18cf37(0x13e)](_0x4a8b81[_0x18cf37(0x148)](toHashInput)))['digest'](_0x18cf37(0x12d));return{'total':_0x4a8b81[_0x18cf37(0x14e)],'hash':_0x18cf37(0x134)+_0x17178b,'menus':_0x4a8b81,'byId':_0x1dc4b7};}export function toProcessedMenuItem(_0x3f68f7){const _0x402dc8=a120_0x511b;return{'id':_0x3f68f7['id'],'path':_0x3f68f7['path'],'label':_0x3f68f7[_0x402dc8(0x141)],'resources':[..._0x3f68f7[_0x402dc8(0x151)]],'extend':_0x3f68f7['extend']??null};}export function toMenuListItem(_0x5ba2b5){const {modelType:_0xcd4c79,datasetId:_0x4bd319,datasetCode:_0x3b92c8,resourcesValid:_0x10c76b,..._0x3612ee}=_0x5ba2b5;return _0x3612ee;}export function getChildren(_0xbe8381,_0x3f3d15){const _0x5e8b79=a120_0x511b;return _0xbe8381[_0x5e8b79(0x146)][_0x5e8b79(0x143)](_0x36a8eb=>_0x36a8eb[_0x5e8b79(0x12a)]===_0x3f3d15);}function flattenMenuItems(_0x5571e4,_0x4e63b1){const _0x4676ef=a120_0x511b,_0x43bcd2=sortMenuItems(_0x5571e4),_0x407f99=[];for(const _0x2b188a of _0x43bcd2){const _0xe0caf4=sortMenuItems(Array[_0x4676ef(0x144)](_0x2b188a[_0x4676ef(0x135)])?_0x2b188a['children']:[]);_0x407f99[_0x4676ef(0x156)](toMenuFact(_0x2b188a,_0xe0caf4,_0x4e63b1)),_0xe0caf4['length']>0x0&&_0x407f99['push'](...flattenMenuItems(_0xe0caf4,{'verbose':_0x4e63b1[_0x4676ef(0x155)],'parentId':_0x2b188a['id'],'depth':_0x4e63b1['depth']+0x1}));}return _0x407f99;}function sortMenuItems(_0x372cb6){const _0x2d0426=a120_0x511b;return _0x372cb6[_0x2d0426(0x148)]((_0x58f94a,_0x27be74)=>({'item':_0x58f94a,'index':_0x27be74}))[_0x2d0426(0x153)]((_0x4581f8,_0x24e0fe)=>{const _0x50bc06=_0x2d0426,_0x45f83e=normalizeSort(_0x4581f8[_0x50bc06(0x137)][_0x50bc06(0x153)]),_0x1be6c6=normalizeSort(_0x24e0fe[_0x50bc06(0x137)]['sort']);if(_0x45f83e!==_0x1be6c6)return _0x45f83e-_0x1be6c6;return _0x4581f8[_0x50bc06(0x131)]-_0x24e0fe[_0x50bc06(0x131)];})[_0x2d0426(0x148)](({item:_0x4c888d})=>_0x4c888d);}function toMenuFact(_0x19ffe4,_0x33f57a,_0x4c594e){const _0x5f5a5b=a120_0x511b,_0x36e030=normalizeResourceValue(_0x19ffe4['extend']?.[_0x5f5a5b(0x151)]),_0x5782e6={'id':_0x19ffe4['id'],'parentId':_0x4c594e[_0x5f5a5b(0x12a)],'depth':_0x4c594e[_0x5f5a5b(0x139)],'label':normalizeString(_0x19ffe4[_0x5f5a5b(0x141)]),'path':normalizeString(_0x19ffe4[_0x5f5a5b(0x13f)]),'url':normalizeString(_0x19ffe4['url']),'type':normalizeString(_0x19ffe4['type']),'visible':typeof _0x19ffe4[_0x5f5a5b(0x13c)]===_0x5f5a5b(0x13a)?_0x19ffe4[_0x5f5a5b(0x13c)]:null,'sort':typeof _0x19ffe4['sort']==='number'&&Number['isFinite'](_0x19ffe4['sort'])?_0x19ffe4[_0x5f5a5b(0x153)]:null,'resources':_0x36e030['values'],'resourcesValid':_0x36e030['valid'],'childrenIds':_0x33f57a[_0x5f5a5b(0x148)](_0x2b7710=>_0x2b7710['id']),'childrenCount':_0x33f57a[_0x5f5a5b(0x14e)],'pageId':normalizeNullableNumber(_0x19ffe4[_0x5f5a5b(0x12b)]),'pageType':normalizeString(_0x19ffe4[_0x5f5a5b(0x138)]),'modelType':normalizeString(_0x19ffe4[_0x5f5a5b(0x136)]),'datasetId':normalizeNullableNumber(_0x19ffe4[_0x5f5a5b(0x140)]),'datasetCode':normalizeString(_0x19ffe4[_0x5f5a5b(0x14a)]),'updateUserId':normalizeNullableString(_0x19ffe4['updateUserId']),'updateUserName':normalizeNullableString(_0x19ffe4[_0x5f5a5b(0x12e)]),'updateTime':normalizeNullableTimestamp(_0x19ffe4[_0x5f5a5b(0x157)])};return _0x4c594e['verbose']&&(_0x5782e6['extend']=_0x19ffe4[_0x5f5a5b(0x152)]??null),_0x5782e6;}function toHashInput(_0x58082e){const _0x2ec949=a120_0x511b;return{'id':_0x58082e['id'],'parentId':_0x58082e[_0x2ec949(0x12a)],'label':_0x58082e[_0x2ec949(0x141)],'path':_0x58082e[_0x2ec949(0x13f)],'url':_0x58082e['url'],'type':_0x58082e['type'],'visible':_0x58082e[_0x2ec949(0x13c)],'sort':_0x58082e[_0x2ec949(0x153)],'resources':_0x58082e[_0x2ec949(0x151)],'resourcesValid':_0x58082e[_0x2ec949(0x133)],'childrenIds':_0x58082e[_0x2ec949(0x14b)],'pageId':_0x58082e[_0x2ec949(0x12b)],'pageType':_0x58082e['pageType'],'modelType':_0x58082e[_0x2ec949(0x136)],'datasetId':_0x58082e['datasetId'],'datasetCode':_0x58082e[_0x2ec949(0x14a)],'updateUserId':_0x58082e[_0x2ec949(0x14c)],'updateUserName':_0x58082e['updateUserName'],'updateTime':_0x58082e[_0x2ec949(0x157)]};}function normalizeSort(_0x539bac){const _0x3aba50=a120_0x511b;return typeof _0x539bac===_0x3aba50(0x12f)&&Number[_0x3aba50(0x132)](_0x539bac)?_0x539bac:Number['POSITIVE_INFINITY'];}function a120_0x511b(_0x4067b0,_0x16714f){_0x4067b0=_0x4067b0-0x12a;const _0x13d1d0=a120_0x13d1();let _0x511bfc=_0x13d1d0[_0x4067b0];return _0x511bfc;}function normalizeString(_0x397b58){const _0x26956e=a120_0x511b;return typeof _0x397b58===_0x26956e(0x14f)?_0x397b58:'';}function normalizeNullableNumber(_0x4b2875){const _0x4d9cc3=a120_0x511b;return typeof _0x4b2875===_0x4d9cc3(0x12f)&&Number[_0x4d9cc3(0x132)](_0x4b2875)?_0x4b2875:null;}function a120_0x13d1(){const _0x173e50=['verbose','push','updateTime','9gSonJa','parentId','pageId','150SSDoYu','hex','updateUserName','number','1UqhNHv','index','isFinite','resourcesValid','sha256:','children','modelType','item','pageType','depth','boolean','values','visible','295614WKscLq','stringify','path','datasetId','label','1226528CeLIrC','filter','isArray','414928UxqyQK','menus','130689nbqEXR','map','674232iZgrrh','datasetCode','childrenIds','updateUserId','192950xpLUHK','length','string','49xwHWDo','resources','extend','sort','84522KEDRwr'];a120_0x13d1=function(){return _0x173e50;};return a120_0x13d1();}function normalizeNullableString(_0x5c3cef){return typeof _0x5c3cef==='string'&&_0x5c3cef['length']>0x0?_0x5c3cef:null;}function normalizeNullableTimestamp(_0x121800){const _0x2c6758=a120_0x511b;if(typeof _0x121800===_0x2c6758(0x14f))return _0x121800[_0x2c6758(0x14e)]>0x0?_0x121800:null;return typeof _0x121800===_0x2c6758(0x12f)&&Number[_0x2c6758(0x132)](_0x121800)?_0x121800:null;}export function normalizeResources(_0x4a4196){const _0x46cb5a=a120_0x511b;return normalizeResourceValue(_0x4a4196)[_0x46cb5a(0x13b)];}function normalizeResourceValue(_0x313dd4){const _0xec24e3=a120_0x511b;if(_0x313dd4==null)return{'values':[],'valid':!![]};if(Array[_0xec24e3(0x144)](_0x313dd4))return{'values':_0x313dd4['map'](String),'valid':!![]};if(typeof _0x313dd4!==_0xec24e3(0x14f))return{'values':[],'valid':![]};try{const _0x33dbf8=JSON['parse'](_0x313dd4);return Array[_0xec24e3(0x144)](_0x33dbf8)?{'values':_0x33dbf8[_0xec24e3(0x148)](String),'valid':!![]}:{'values':[],'valid':![]};}catch{return{'values':[],'valid':![]};}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3179ae,_0x114617){var _0xd148e=a121_0x152f,_0x31b7aa=_0x3179ae();while(!![]){try{var _0x430eea=-parseInt(_0xd148e(0x146))/0x1*(parseInt(_0xd148e(0x147))/0x2)+parseInt(_0xd148e(0x144))/0x3*(parseInt(_0xd148e(0x145))/0x4)+-parseInt(_0xd148e(0x14b))/0x5+-parseInt(_0xd148e(0x149))/0x6*(parseInt(_0xd148e(0x14a))/0x7)+-parseInt(_0xd148e(0x14c))/0x8*(parseInt(_0xd148e(0x141))/0x9)+-parseInt(_0xd148e(0x148))/0xa*(-parseInt(_0xd148e(0x142))/0xb)+-parseInt(_0xd148e(0x14d))/0xc*(-parseInt(_0xd148e(0x143))/0xd);if(_0x430eea===_0x114617)break;else _0x31b7aa['push'](_0x31b7aa['shift']());}catch(_0x5c5961){_0x31b7aa['push'](_0x31b7aa['shift']());}}}(a121_0x5315,0x812ac));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';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_0x152f(_0x378945,_0xb744b2){_0x378945=_0x378945-0x141;var _0x531586=a121_0x5315();var _0x152ffb=_0x531586[_0x378945];return _0x152ffb;}function a121_0x5315(){var _0x505e6d=['819rplZtA','1351105UMaZeE','24uijGWp','16140xwGWCQ','1792458yjVDmq','9977jPmdqg','10517ahjeVa','684SbPOJd','3692eFgtGo','551795XcCVDO','2RLZPys','10460PSYpjS','15318XURnGs'];a121_0x5315=function(){return _0x505e6d;};return a121_0x5315();}export*from'../../../commands/menu/shared/update-core.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x311c56,_0x5a685a){const _0x201efe=a122_0xddbf,_0x493d18=_0x311c56();while(!![]){try{const _0x4782e3=parseInt(_0x201efe(0x1ec))/0x1+-parseInt(_0x201efe(0x1f6))/0x2+-parseInt(_0x201efe(0x1e6))/0x3+parseInt(_0x201efe(0x203))/0x4*(parseInt(_0x201efe(0x1e7))/0x5)+-parseInt(_0x201efe(0x1f0))/0x6+parseInt(_0x201efe(0x1eb))/0x7*(-parseInt(_0x201efe(0x1e8))/0x8)+-parseInt(_0x201efe(0x1f3))/0x9*(-parseInt(_0x201efe(0x1fa))/0xa);if(_0x4782e3===_0x5a685a)break;else _0x493d18['push'](_0x493d18['shift']());}catch(_0x46959a){_0x493d18['push'](_0x493d18['shift']());}}}(a122_0x5306,0x8dfef));import a122_0x771bc2 from'chalk';import{checkbox,input,confirm}from'@inquirer/prompts';import a122_0xee29a0 from'ora';import{isUrlReachable}from'../../../commands/menu/shared/valid-url.js';import{CliErrors}from'../../../errors.js';function onCancel(_0x54e40f){return _0x54e40f['catch'](_0x4dad03=>{const _0x2c9075=a122_0xddbf;if(_0x4dad03?.[_0x2c9075(0x1f2)]===_0x2c9075(0x1dd))throw CliErrors[_0x2c9075(0x1ea)](_0x2c9075(0x1f8));throw _0x4dad03;});}export function startSpinner(_0x568e3f){const _0x533056=a122_0xddbf;return a122_0xee29a0({'text':_0x568e3f,'color':_0x533056(0x1f1)})[_0x533056(0x1f4)]();}export function stopSpinner(_0x44f5c6,_0xe33d30,_0x3f01b9){_0x3f01b9?_0x44f5c6['succeed'](_0xe33d30):_0x44f5c6['fail'](_0xe33d30);}export async function askConfirm(_0x3fb5f3){return onCancel(confirm({'message':_0x3fb5f3,'theme':{'prefix':''}}));}export async function askJsUrl(_0x2c24aa){const _0x2a7557=a122_0xddbf;while(!![]){const _0x2421ee=await onCancel(input({'message':_0x2a7557(0x1de),'default':_0x2c24aa,'theme':{'prefix':''}}));if(_0x2421ee[_0x2a7557(0x1e5)]()==='')throw CliErrors[_0x2a7557(0x1ea)]('Cancelled.');if(!/^https:\/\/.+\.js(\?.*)?$/[_0x2a7557(0x1fe)](_0x2421ee[_0x2a7557(0x1e5)]())){console[_0x2a7557(0x1fd)](a122_0x771bc2[_0x2a7557(0x1e3)](_0x2a7557(0x1e9)));continue;}const _0x1d4db6=startSpinner(_0x2a7557(0x1d8));try{const _0x1ebb85=await isUrlReachable(_0x2421ee['trim']());stopSpinner(_0x1d4db6,_0x2a7557(0x1e0),_0x1ebb85);if(!_0x1ebb85){console['error'](a122_0x771bc2['red']('\x20\x20✗\x20JS\x20URL\x20is\x20unreachable'));continue;}return _0x2421ee[_0x2a7557(0x1e5)]();}catch(_0x2f64e7){stopSpinner(_0x1d4db6,_0x2a7557(0x1d9),![]);throw _0x2f64e7;}}}export async function askCssUrl(_0x3499fc){const _0x42a27a=a122_0xddbf;while(!![]){const _0x19d4ab=await onCancel(input({'message':_0x42a27a(0x1df),'default':_0x3499fc,'theme':{'prefix':''}}));if(_0x19d4ab[_0x42a27a(0x1e5)]()==='')throw CliErrors[_0x42a27a(0x1ea)]('Cancelled.');if(!/^https:\/\/.+\.css(\?.*)?$/[_0x42a27a(0x1fe)](_0x19d4ab['trim']())){console[_0x42a27a(0x1fd)](a122_0x771bc2[_0x42a27a(0x1e3)](_0x42a27a(0x202)));continue;}const _0x563446=startSpinner(_0x42a27a(0x201));try{const _0x19a532=await isUrlReachable(_0x19d4ab['trim']());stopSpinner(_0x563446,_0x42a27a(0x200),_0x19a532);if(!_0x19a532){console[_0x42a27a(0x1fd)](a122_0x771bc2[_0x42a27a(0x1e3)](_0x42a27a(0x1dc)));continue;}return _0x19d4ab[_0x42a27a(0x1e5)]();}catch(_0x325b0c){stopSpinner(_0x563446,_0x42a27a(0x1ef),![]);throw _0x325b0c;}}}export async function selectPages(_0x5ea754,_0x4324cf){const _0x4aafa0=a122_0xddbf,_0x4bc509=_0x5ea754['map'](_0x64c342=>{const _0x26818d=a122_0xddbf,_0x31c5ca=_0x4324cf[_0x26818d(0x1e2)](_0x64c342[_0x26818d(0x1ed)]);return{'name':_0x64c342[_0x26818d(0x1db)]+'\x20\x20'+a122_0x771bc2[_0x26818d(0x1f5)](_0x64c342[_0x26818d(0x1ed)])+'\x20\x20'+(_0x31c5ca?a122_0x771bc2['gray'](_0x26818d(0x1fc)):a122_0x771bc2['green'](_0x26818d(0x1f9))),'value':_0x64c342[_0x26818d(0x1ed)],'checked':!_0x31c5ca,'disabled':_0x31c5ca};});if(_0x4bc509[_0x4aafa0(0x1fb)]===0x0)throw new Error(_0x4aafa0(0x1da));const _0x5ad268=await onCancel(checkbox({'message':'\x20\x20Select\x20menus\x20to\x20sync\x20(space\x20to\x20toggle,\x20a=all,\x20i=invert):','choices':_0x4bc509,'loop':![],'theme':{'prefix':''}}));if(_0x5ad268[_0x4aafa0(0x1fb)]===0x0)throw new Error(_0x4aafa0(0x1e1));return _0x5ea754[_0x4aafa0(0x1f7)](_0x1c65e6=>_0x5ad268[_0x4aafa0(0x1ee)](_0x1c65e6['path']));}export function isInteractive(){const _0x38d5cf=a122_0xddbf;return process[_0x38d5cf(0x1e4)][_0x38d5cf(0x1ff)]===!![];}function a122_0xddbf(_0xe90f3,_0x775698){_0xe90f3=_0xe90f3-0x1d7;const _0x530646=a122_0x5306();let _0xddbf6b=_0x530646[_0xe90f3];return _0xddbf6b;}export function requireInteractive(){const _0x377507=a122_0xddbf;if(!isInteractive())throw new Error('This\x20command\x20requires\x20an\x20interactive\x20terminal.\x20'+_0x377507(0x1d7));}function a122_0x5306(){const _0x183c71=['5661006DKfZWM','cyan','name','10710JaYyWs','start','gray','2251054VkXuCr','filter','Cancelled.','[new]','19490QcLqwI','length','[already\x20on\x20platform]','error','test','isTTY','CSS\x20URL\x20checked','\x20\x20Checking\x20CSS\x20URL\x20reachability...','\x20\x20✗\x20CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','1715344wLoIof','Use\x20--yes\x20to\x20run\x20in\x20non-interactive\x20mode,\x20or\x20pipe\x20data\x20via\x20--params.','\x20\x20Checking\x20JS\x20URL\x20reachability...','JS\x20URL\x20check\x20failed','No\x20local\x20pages\x20found.','label','\x20\x20✗\x20CSS\x20URL\x20is\x20unreachable','ExitPromptError','\x20\x20JS\x20URL:','\x20\x20CSS\x20URL:','JS\x20URL\x20checked','No\x20menus\x20selected.','has','red','stdin','trim','1126314xBjQKh','5ZsroFI','312BmWVIo','\x20\x20✗\x20JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','cancelled','120799prBaLh','950958cmEalb','path','includes','CSS\x20URL\x20check\x20failed'];a122_0x5306=function(){return _0x183c71;};return a122_0x5306();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a123_0x3eb92d=a123_0x2572;function a123_0x51d7(){const _0x48085b=['11333XnxFLd','40KfEawC','\x5c.displayName\x5cs*=\x5cs*[\x22\x27]([^\x22\x27]+)[\x22\x27]','640lunxxX','3315411ZYnGVq','endsWith','cwd','isDirectory','trim','472838PfKlOY','push','replace','split','99410HBHGnW','src/pages','path','810565coBGin','2425530NCAxdL','9OTcdds','forEach','utf-8','index.tsx','616608ZJqcPd','match','filter','.tsx','replaceAll','join'];a123_0x51d7=function(){return _0x48085b;};return a123_0x51d7();}(function(_0x41d601,_0x3320ac){const _0x270f4a=a123_0x2572,_0x315b19=_0x41d601();while(!![]){try{const _0x18badb=-parseInt(_0x270f4a(0x162))/0x1+parseInt(_0x270f4a(0x166))/0x2*(-parseInt(_0x270f4a(0x16b))/0x3)+parseInt(_0x270f4a(0x16f))/0x4+-parseInt(_0x270f4a(0x169))/0x5+-parseInt(_0x270f4a(0x16a))/0x6+-parseInt(_0x270f4a(0x175))/0x7*(parseInt(_0x270f4a(0x178))/0x8)+parseInt(_0x270f4a(0x179))/0x9*(parseInt(_0x270f4a(0x176))/0xa);if(_0x18badb===_0x3320ac)break;else _0x315b19['push'](_0x315b19['shift']());}catch(_0xe25714){_0x315b19['push'](_0x315b19['shift']());}}}(a123_0x51d7,0x4ba43));import{readdirSync,statSync,readFileSync}from'fs';function a123_0x2572(_0x23f8a4,_0x264f87){_0x23f8a4=_0x23f8a4-0x162;const _0x51d782=a123_0x51d7();let _0x25723b=_0x51d782[_0x23f8a4];return _0x25723b;}import{join,relative,resolve,sep}from'path';const pagesDir=resolve(process[a123_0x3eb92d(0x17b)](),a123_0x3eb92d(0x167));export function extractTitleFromComment(_0x560365){const _0x1891d5=a123_0x3eb92d;try{const _0x1c24d3=readFileSync(_0x560365,_0x1891d5(0x16d)),_0x13d5dd=_0x1c24d3[_0x1891d5(0x170)](/^\s*\/\*\*?([\s\S]*?)\*\//);if(_0x13d5dd&&_0x13d5dd[0x1]){const _0x1c88cb=_0x13d5dd[0x1],_0x5b4822=_0x1c88cb['match'](/^\s*\*?\s*title\s*:\s*(.+)/im);if(_0x5b4822&&_0x5b4822[0x1])return _0x5b4822[0x1][_0x1891d5(0x17d)]();}let _0x129c71=null;const _0xe4e561=_0x1c24d3[_0x1891d5(0x170)](/export\s+default\s+([A-Z][a-zA-Z0-9]*)/);_0xe4e561&&_0xe4e561[0x1]&&(_0x129c71=_0xe4e561[0x1]);if(!_0x129c71){const _0x5ccc71=_0x1c24d3[_0x1891d5(0x170)](/export\s+default\s+function\s+([A-Z][a-zA-Z0-9]*)/);_0x5ccc71&&_0x5ccc71[0x1]&&(_0x129c71=_0x5ccc71[0x1]);}if(_0x129c71){const _0x51de67=new RegExp('\x5cb'+_0x129c71+_0x1891d5(0x177)),_0x534ef1=_0x1c24d3[_0x1891d5(0x170)](_0x51de67);if(_0x534ef1&&_0x534ef1[0x1])return _0x534ef1[0x1];return _0x129c71;}return null;}catch(_0x579a2b){return null;}}export function getLocalPages(_0x232eef=pagesDir,_0x587098=pagesDir){const _0x2ed850=a123_0x3eb92d;let _0x2a7153=[];const _0x2579ac=readdirSync(_0x232eef);return _0x2579ac[_0x2ed850(0x16c)](_0x1f3ece=>{const _0x15b185=_0x2ed850,_0xcf7c9c=join(_0x232eef,_0x1f3ece),_0x1dbea7=statSync(_0xcf7c9c);if(_0x1dbea7&&_0x1dbea7[_0x15b185(0x17c)]())_0x2a7153=_0x2a7153['concat'](getLocalPages(_0xcf7c9c,_0x587098));else{if(_0x1f3ece[_0x15b185(0x17a)](_0x15b185(0x172))){let _0x25d19e=relative(_0x587098,_0xcf7c9c);_0x25d19e[_0x15b185(0x17a)](_0x15b185(0x16e))?_0x25d19e=_0x25d19e[_0x15b185(0x164)](/index\.tsx$/,''):_0x25d19e=_0x25d19e[_0x15b185(0x164)](/\.tsx$/,'');_0x25d19e['endsWith'](sep)&&(_0x25d19e=_0x25d19e['slice'](0x0,-0x1));const _0x588d9d=_0x25d19e[_0x15b185(0x165)](sep)[_0x15b185(0x174)]('/'),_0x5bc40e=extractTitleFromComment(_0xcf7c9c),_0xab306f=_0x5bc40e||_0x588d9d;_0x2a7153[_0x15b185(0x163)]({'path':_0x588d9d[_0x15b185(0x173)]('$',':'),'label':_0xab306f});}}}),_0x2a7153[_0x2ed850(0x171)](_0x521112=>_0x521112[_0x2ed850(0x168)]!=='');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3d51ce,_0x451642){const _0x772a6e=a124_0x3221,_0x443796=_0x3d51ce();while(!![]){try{const _0x10ec4c=parseInt(_0x772a6e(0xa8))/0x1*(-parseInt(_0x772a6e(0xa2))/0x2)+parseInt(_0x772a6e(0xb5))/0x3*(parseInt(_0x772a6e(0xaf))/0x4)+-parseInt(_0x772a6e(0xa3))/0x5+-parseInt(_0x772a6e(0xad))/0x6+-parseInt(_0x772a6e(0xa4))/0x7*(parseInt(_0x772a6e(0xb3))/0x8)+-parseInt(_0x772a6e(0xa0))/0x9+-parseInt(_0x772a6e(0xa5))/0xa*(-parseInt(_0x772a6e(0xa6))/0xb);if(_0x10ec4c===_0x451642)break;else _0x443796['push'](_0x443796['shift']());}catch(_0x32713d){_0x443796['push'](_0x443796['shift']());}}}(a124_0x527e,0xbbbe1));import{getLocalPages}from'../../../commands/menu/shared/local-pages.js';import{getOnlineMenuList,createMenus}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';export function validateJsUrl(_0x4edc1d){const _0x446687=a124_0x3221,_0x34efbb=[];return!isValidJsHttpsUrl(_0x4edc1d)&&_0x34efbb[_0x446687(0xab)](_0x446687(0xb0)),{'ok':_0x34efbb[_0x446687(0xb2)]===0x0,'errors':_0x34efbb};}export function validateCssUrl(_0x105226){const _0x1ce27d=a124_0x3221,_0x5873e9=[];return!isValidCssHttpsUrl(_0x105226)&&_0x5873e9['push'](_0x1ce27d(0xae)),{'ok':_0x5873e9[_0x1ce27d(0xb2)]===0x0,'errors':_0x5873e9};}export async function validateJsUrlReachable(_0x3cfd3e){const _0x25a2e5=a124_0x3221,_0x57d7ee=validateJsUrl(_0x3cfd3e);if(!_0x57d7ee['ok'])return _0x57d7ee;const _0x2d710a=await isUrlReachable(_0x3cfd3e);if(!_0x2d710a)_0x57d7ee[_0x25a2e5(0xa9)]['push'](_0x25a2e5(0x9f));return{'ok':_0x57d7ee[_0x25a2e5(0xa9)][_0x25a2e5(0xb2)]===0x0,'errors':_0x57d7ee[_0x25a2e5(0xa9)]};}export async function validateCssUrlReachable(_0x1ec581){const _0x2bb707=a124_0x3221,_0x296b07=validateCssUrl(_0x1ec581);if(!_0x296b07['ok'])return _0x296b07;const _0xa9092c=await isUrlReachable(_0x1ec581);if(!_0xa9092c)_0x296b07[_0x2bb707(0xa9)][_0x2bb707(0xab)](_0x2bb707(0xa7));return{'ok':_0x296b07[_0x2bb707(0xa9)]['length']===0x0,'errors':_0x296b07[_0x2bb707(0xa9)]};}export function buildCompareRows(_0x1469bd,_0x2df93e){const _0x2506fe=a124_0x3221;return _0x1469bd[_0x2506fe(0xac)](_0x40025c=>({'label':_0x40025c[_0x2506fe(0xb4)],'path':_0x40025c['path'],'local':!![],'online':_0x2df93e[_0x2506fe(0xaa)](_0x40025c[_0x2506fe(0x9e)])}));}export async function doCreateMenus(_0x21cf83,_0x3804cb,_0x3c467a,_0x3e5c15){const _0x2a3a1b=a124_0x3221,_0x46569e=await createMenus(_0x21cf83,_0x3804cb,_0x3c467a,_0x3e5c15);return{'created':_0x46569e[_0x2a3a1b(0xb2)],'failed':0x0,'labels':_0x3c467a[_0x2a3a1b(0xac)](_0xdce2bd=>_0xdce2bd[_0x2a3a1b(0xb4)]),'menus':_0x46569e};}export function filterMenusWithResources(_0x1d8b8c){const _0x2c2df8=a124_0x3221;return _0x1d8b8c[_0x2c2df8(0xa1)](_0x1499eb=>_0x1499eb[_0x2c2df8(0xb1)][_0x2c2df8(0xb2)]>0x0);}export async function fetchMenuData(_0x1c5743,_0x5f45b1){const _0x318fc9=a124_0x3221,_0x57b1ae=getLocalPages(),_0x220e67=await getOnlineMenuList(_0x1c5743,_0x5f45b1),_0xce988a=new Set(_0x220e67[_0x318fc9(0xac)](_0x4fa7a5=>_0x4fa7a5[_0x318fc9(0x9e)]));return{'localPages':_0x57b1ae,'onlineMenuList':_0x220e67,'onlinePaths':_0xce988a};}export async function fetchOnlineMenuList(_0x5aeb9a,_0x16d9f6){return getOnlineMenuList(_0x5aeb9a,_0x16d9f6);}function a124_0x3221(_0x4ffe7c,_0x6b3fc3){_0x4ffe7c=_0x4ffe7c-0x9e;const _0x527e2f=a124_0x527e();let _0x3221b1=_0x527e2f[_0x4ffe7c];return _0x3221b1;}function a124_0x527e(){const _0x27681e=['length','16IWngYt','label','14475VIfhHw','path','JS\x20URL\x20is\x20unreachable','7920468EwfDmx','filter','53906KSJFXe','7056975YhvUOv','719019xeAtQS','50BDGJKq','9625561ozwesF','CSS\x20URL\x20is\x20unreachable','29bJfCRv','errors','has','push','map','3298164lrCnFn','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','184JmSllK','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','resources'];a124_0x527e=function(){return _0x27681e;};return a124_0x527e();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a126_0xc1b8eb=a126_0x4ae9;function a126_0x1acc(){const _0x1f89b9=['parent-id','childrenCount','selector','warnings','rawFlags','number','map','message','4IApXtN','expected-children-count','hint','failed','cascade','cookie','stringify','\x20parent\x20changed:\x20expected\x20','Failed\x20to\x20','Re-run\x20the\x20command\x20with\x20--dry-run\x20and\x20update\x20the\x20expect\x20flags\x20before\x20retrying.','expect-path','call','length','menu_confirmation_required','menu_permission_denied','str','succeeded','Parent\x20folder\x20id;\x20use\x20root\x20for\x20a\x20root-level\x20node','isSafeInteger','Sibling\x20sort\x20value\x20(non-negative\x20integer)','num','Menu\x20','appCode','The\x20write\x20may\x20already\x20have\x20taken\x20effect.\x20Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20inspect\x20the\x20returned\x20id\x20before\x20retrying.','code','menu_verification_failed',',\x20or\x20pass\x20an\x20explicit\x20--sort\x20value.','planFile','flagMissing','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.','read\x20online\x20menu\x20facts\x20before\x20','bool','\x20child\x20count\x20changed:\x20expected\x20','verification','toLowerCase','dryRun','3768950OeqpOZ','Choose\x20a\x20menu\x20whose\x20type\x20is\x20folder,\x20or\x20use\x20root.','string','4306947CreWLN','sort','expect-parent-id','type','hasOwnProperty','menu_state_drift','Cannot\x20append\x20a\x20','9NEfyYj','snapshotHash','menu_mutation_failed','menu_not_found','Abort\x20unless\x20the\x20current\x20parent\x20id\x20matches;\x20use\x20root\x20for\x20root\x20level','Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20use\x20an\x20exact\x20id\x20from\x20the\x20current\x20app.','904fMrVuW','after','folder','menu_sort_overflow','recheck\x20online\x20menu\x20facts\x20before\x20','134235ZPZBTC','menu_sort_invalid','6zCpsTx','get','Abort\x20unless\x20the\x20current\x20menu\x20path\x20exactly\x20matches','path','Online\x20menu\x20state\x20changed\x20before\x20','deleteOrder','\x20because\x20the\x20current\x20maximum\x20sibling\x20sort\x20is\x20','This\x20menu\x20mutation\x20requires\x20explicit\x20--yes.','Choose\x20a\x20sort\x20value\x20within\x20the\x20Java\x20Integer\x20range\x20used\x20by\x20the\x20menu\x20service.','dry-run','68565GCvaHn','filter','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20again\x20and\x20review\x20the\x20latest\x20snapshot\x20before\x20retrying.',',\x20current\x20','data','required','14586242YhswBR','pre-write-recheck','\x20must\x20be\x20a\x20positive\x20menu\x20id\x20or\x20root.','root','894682JrmdvQ','parentId','api_error','validation','plannedActions','--id\x20must\x20be\x20a\x20positive\x20integer\x20menu\x20id.','--expected-children-count\x20must\x20be\x20a\x20non-negative\x20integer.','\x20path\x20changed:\x20expected\x20','hash','162530uWJvUg','\x20menu\x20','targets','\x20is\x20type\x20\x22','error','max','backend','Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20to\x20inspect\x20the\x20latest\x20online\x20menu\x20state.','Online\x20menu\x20not\x20found:\x20','test'];a126_0x1acc=function(){return _0x1f89b9;};return a126_0x1acc();}(function(_0x4d1885,_0x49f06b){const _0x1d5100=a126_0x4ae9,_0x31b544=_0x4d1885();while(!![]){try{const _0x37d1c0=-parseInt(_0x1d5100(0x10e))/0x1+-parseInt(_0x1d5100(0xba))/0x2+-parseInt(_0x1d5100(0xfc))/0x3*(-parseInt(_0x1d5100(0xd5))/0x4)+-parseInt(_0x1d5100(0xc3))/0x5*(-parseInt(_0x1d5100(0x110))/0x6)+-parseInt(_0x1d5100(0x11a))/0x7*(parseInt(_0x1d5100(0x109))/0x8)+-parseInt(_0x1d5100(0x103))/0x9*(parseInt(_0x1d5100(0xf9))/0xa)+parseInt(_0x1d5100(0xb6))/0xb;if(_0x37d1c0===_0x49f06b)break;else _0x31b544['push'](_0x31b544['shift']());}catch(_0x5c079f){_0x31b544['push'](_0x31b544['shift']());}}}(a126_0x1acc,0xb1f27));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':a126_0xc1b8eb(0xd2),'required':!![],'description':'Exact\x20online\x20menu\x20id'};export const MENU_SORT_FLAG={'name':a126_0xc1b8eb(0xfd),'type':a126_0xc1b8eb(0xd2),'description':a126_0xc1b8eb(0xe8)};export const MENU_PARENT_ID_FLAG={'name':a126_0xc1b8eb(0xcd),'type':a126_0xc1b8eb(0xfb),'description':a126_0xc1b8eb(0xe6)};export const MENU_EXPECT_PARENT_ID_FLAG={'name':'expect-parent-id','type':'string','description':a126_0xc1b8eb(0x107)};export const MENU_EXPECT_FLAGS=[MENU_EXPECT_PARENT_ID_FLAG,{'name':a126_0xc1b8eb(0xdf),'type':a126_0xc1b8eb(0xfb),'description':a126_0xc1b8eb(0x112)},{'name':a126_0xc1b8eb(0xd6),'type':a126_0xc1b8eb(0xd2),'description':'Abort\x20unless\x20the\x20current\x20direct\x20child\x20count\x20matches'}];export function validateExactId(_0x4174c5){const _0x293e16=a126_0xc1b8eb,_0x59d0da=_0x4174c5[_0x293e16(0xe9)]('id');if(!Number[_0x293e16(0xe7)](_0x59d0da)||_0x59d0da<=0x0)throw CliErrors['validation'](_0x293e16(0xbf));return _0x59d0da;}export function validateSort(_0x4893f0,_0x3f6c8a=a126_0xc1b8eb(0xfd)){const _0x4bafa5=a126_0xc1b8eb;if(!hasFlag(_0x4893f0,_0x3f6c8a))return undefined;const _0x32eeff=_0x4893f0[_0x4bafa5(0xe9)](_0x3f6c8a);if(!Number[_0x4bafa5(0xe7)](_0x32eeff)||_0x32eeff<0x0||_0x32eeff>MAX_MENU_SORT)throw menuError(_0x4bafa5(0x10f),'--'+_0x3f6c8a+'\x20must\x20be\x20an\x20integer\x20between\x200\x20and\x20'+MAX_MENU_SORT+'.',_0x4bafa5(0x118));return _0x32eeff;}export function nextSiblingSort(_0x592f98,_0x20a10f,_0x136492){const _0xc67db=a126_0xc1b8eb,_0x4539e2=getChildren(_0x592f98,_0x20a10f)[_0xc67db(0xd3)](_0xc22aef=>_0xc22aef['sort'])[_0xc67db(0x11b)](_0x2f0d63=>typeof _0x2f0d63==='number');if(_0x4539e2[_0xc67db(0xe1)]===0x0)return 0x0;const _0x4f6797=Math[_0xc67db(0xc8)](..._0x4539e2);if(_0x4f6797>=MAX_MENU_SORT)throw menuError(_0xc67db(0x10c),_0xc67db(0x102)+_0x136492+_0xc67db(0x116)+_0x4f6797+'.','Reorder\x20sibling\x20menus\x20below\x20'+MAX_MENU_SORT+_0xc67db(0xef));return _0x4f6797+0x1;}export function requireExplicitYes(_0x32715b){const _0x3938b3=a126_0xc1b8eb;if(_0x32715b[_0x3938b3(0xf4)](_0x3938b3(0x119)))return;if(!_0x32715b[_0x3938b3(0xf4)]('yes'))throw menuError(_0x3938b3(0xe2),_0x3938b3(0x117),_0x3938b3(0xf2));}export async function fetchMutationSnapshot(_0x2226c5,_0x5279fe,_0x5c5138){const _0x2226a5=a126_0xc1b8eb;try{return await fetchMenuSnapshot(_0x2226c5['appCode'],_0x2226c5[_0x2226a5(0xda)]);}catch(_0x15aadb){throw mapMenuApiError(_0x15aadb,_0x2226a5(0xf3)+_0x5279fe,_0x5c5138);}}export async function recheckMutationSnapshot(_0x32bcc7,_0x79f051,_0x51f878,_0x50fb28){const _0x1dd70d=a126_0xc1b8eb;let _0xe2c10f;try{_0xe2c10f=await fetchMenuSnapshot(_0x32bcc7[_0x1dd70d(0xeb)],_0x32bcc7[_0x1dd70d(0xda)]);}catch(_0x1fce94){const _0x1f5242=mapMenuApiError(_0x1fce94,_0x1dd70d(0x10d)+_0x51f878,_0x50fb28);throw menuFailure(_0x1f5242,_0x79f051,{'stage':'pre-write-recheck','failed':_0x50fb28==null?{}:{'id':_0x50fb28}});}if(_0xe2c10f[_0x1dd70d(0xc2)]!==_0x79f051[_0x1dd70d(0x104)]){const _0x295b84=menuError(_0x1dd70d(0x101),_0x1dd70d(0x114)+_0x51f878+';\x20the\x20planned\x20snapshot\x20is\x20no\x20longer\x20current.',_0x1dd70d(0x11c));throw menuFailure(_0x295b84,_0x79f051,{'stage':_0x1dd70d(0xb7),'failed':{..._0x50fb28==null?{}:{'id':_0x50fb28},'expectedSnapshotHash':_0x79f051[_0x1dd70d(0x104)],'currentSnapshotHash':_0xe2c10f['hash']}});}return _0xe2c10f;}export function parseParentId(_0x46417f,_0x109a83,_0x24170c={}){const _0x49c6c7=a126_0xc1b8eb;if(!hasFlag(_0x46417f,_0x109a83)){if(_0x24170c[_0x49c6c7(0xb5)])throw CliErrors[_0x49c6c7(0xf1)](_0x109a83);return undefined;}const _0x5405d4=_0x46417f['str'](_0x109a83)['trim']();if(_0x5405d4[_0x49c6c7(0xf7)]()===_0x49c6c7(0xb9))return null;if(!/^\d+$/[_0x49c6c7(0xcc)](_0x5405d4))throw CliErrors['validation']('--'+_0x109a83+_0x49c6c7(0xb8));const _0x59f25c=Number(_0x5405d4);if(!Number['isSafeInteger'](_0x59f25c)||_0x59f25c<=0x0)throw CliErrors[_0x49c6c7(0xbd)]('--'+_0x109a83+_0x49c6c7(0xb8));return _0x59f25c;}export function requireMenu(_0x3f7993,_0x4feaeb){const _0x2481b7=a126_0xc1b8eb,_0x5d4cfb=_0x3f7993['byId'][_0x2481b7(0x111)](_0x4feaeb);if(!_0x5d4cfb)throw menuError(_0x2481b7(0x106),_0x2481b7(0xcb)+_0x4feaeb,_0x2481b7(0x108));return _0x5d4cfb;}export function requireFolder(_0xc8443d,_0xf40d9e){const _0x1f9a4a=a126_0xc1b8eb,_0x3311e0=requireMenu(_0xc8443d,_0xf40d9e);if(_0x3311e0[_0x1f9a4a(0xff)]!==_0x1f9a4a(0x10b))throw menuError('menu_parent_not_folder',_0x1f9a4a(0xea)+_0xf40d9e+_0x1f9a4a(0xc6)+(_0x3311e0[_0x1f9a4a(0xff)]||'unknown')+'\x22,\x20not\x20folder.',_0x1f9a4a(0xfa));return _0x3311e0;}export function assertExpectedState(_0x472d23,_0x3c3df2){const _0x1f180b=a126_0xc1b8eb;if(hasFlag(_0x472d23,_0x1f180b(0xfe))){const _0x16db60=parseParentId(_0x472d23,_0x1f180b(0xfe),{'required':!![]});if(_0x3c3df2[_0x1f180b(0xbb)]!==_0x16db60)throw stateDrift(_0x1f180b(0xea)+_0x3c3df2['id']+_0x1f180b(0xdc)+formatParent(_0x16db60)+',\x20current\x20'+formatParent(_0x3c3df2[_0x1f180b(0xbb)])+'.');}if(hasFlag(_0x472d23,_0x1f180b(0xdf))){const _0x32e2fd=_0x472d23[_0x1f180b(0xe4)](_0x1f180b(0xdf));if(_0x3c3df2[_0x1f180b(0x113)]!==_0x32e2fd)throw stateDrift(_0x1f180b(0xea)+_0x3c3df2['id']+_0x1f180b(0xc1)+JSON[_0x1f180b(0xdb)](_0x32e2fd)+_0x1f180b(0xb3)+JSON[_0x1f180b(0xdb)](_0x3c3df2[_0x1f180b(0x113)])+'.');}if(hasFlag(_0x472d23,_0x1f180b(0xd6))){const _0x269d8d=_0x472d23['num'](_0x1f180b(0xd6));if(!Number[_0x1f180b(0xe7)](_0x269d8d)||_0x269d8d<0x0)throw CliErrors['validation'](_0x1f180b(0xc0));if(_0x3c3df2[_0x1f180b(0xce)]!==_0x269d8d)throw stateDrift(_0x1f180b(0xea)+_0x3c3df2['id']+_0x1f180b(0xf5)+_0x269d8d+',\x20current\x20'+_0x3c3df2['childrenCount']+'.');}}export function assertVerified(_0x3ceacb,_0x42425f,_0x404929=a126_0xc1b8eb(0xca)){const _0x292c27=a126_0xc1b8eb;if(!_0x3ceacb)throw menuError(_0x292c27(0xee),_0x42425f,_0x404929);}export function mutationResult(_0x58c5d2){const _0x215d92=a126_0xc1b8eb;return{'operation':_0x58c5d2['operation'],'selector':_0x58c5d2[_0x215d92(0xcf)],'before':_0x58c5d2['before'],'after':_0x58c5d2['after'],'dryRun':_0x58c5d2[_0x215d92(0xf8)],'backend':_0x58c5d2[_0x215d92(0xc9)],..._0x58c5d2[_0x215d92(0xbe)]?{'plannedActions':_0x58c5d2[_0x215d92(0xbe)]}:{},..._0x58c5d2[_0x215d92(0xc5)]?{'targets':_0x58c5d2[_0x215d92(0xc5)]}:{},..._0x58c5d2[_0x215d92(0x115)]?{'deleteOrder':_0x58c5d2[_0x215d92(0x115)]}:{},'snapshotHash':_0x58c5d2[_0x215d92(0x104)],..._0x58c5d2[_0x215d92(0xd9)]?{'cascade':_0x58c5d2[_0x215d92(0xd9)]}:{},..._0x58c5d2['planFile']?{'planFile':_0x58c5d2[_0x215d92(0xf0)]}:{},'succeeded':_0x58c5d2[_0x215d92(0xe5)]??[],'failed':_0x58c5d2[_0x215d92(0xd8)]??[],'warnings':_0x58c5d2[_0x215d92(0xd0)]??[],'verification':_0x58c5d2[_0x215d92(0xf6)],'error':_0x58c5d2[_0x215d92(0xc7)]};}export function menuDryRunResult(_0x453e66,_0x5854c9){return{..._0x453e66,..._0x5854c9};}export function menuFailure(_0x5502fd,_0x19aee4,_0x4869ab){const _0x9fff3=a126_0xc1b8eb,_0x551855=mutationResult({..._0x19aee4,'after':_0x4869ab[_0x9fff3(0x10a)]===undefined?_0x19aee4[_0x9fff3(0x10a)]:_0x4869ab[_0x9fff3(0x10a)],'backend':_0x4869ab['backend']??_0x19aee4[_0x9fff3(0xc9)],'dryRun':![],'succeeded':_0x4869ab[_0x9fff3(0xe5)]??[],'failed':[{..._0x4869ab['failed']??{},'stage':_0x4869ab['stage'],'code':_0x5502fd[_0x9fff3(0xed)],'message':_0x5502fd[_0x9fff3(0xd4)]}],'warnings':[..._0x19aee4[_0x9fff3(0xd0)],..._0x4869ab[_0x9fff3(0xd0)]??[]],'verification':_0x4869ab[_0x9fff3(0xf6)],'error':{'code':_0x5502fd[_0x9fff3(0xed)],'message':_0x5502fd['message'],..._0x5502fd[_0x9fff3(0xd7)]?{'hint':_0x5502fd[_0x9fff3(0xd7)]}:{}}});return Object['defineProperty'](_0x5502fd,_0x9fff3(0xb4),{'value':_0x551855,'enumerable':!![],'configurable':!![]}),_0x5502fd;}export function asVerificationError(_0xd42bf1,_0x4481be){const _0x534d5f=a126_0xc1b8eb;if(_0xd42bf1 instanceof CliError&&_0xd42bf1['code']===_0x534d5f(0xee))return _0xd42bf1;const _0x3e9e27=_0xd42bf1 instanceof Error?_0xd42bf1[_0x534d5f(0xd4)]:String(_0xd42bf1);return menuError('menu_verification_failed',''+_0x4481be+(_0x3e9e27?':\x20'+_0x3e9e27:''),_0x534d5f(0xec));}export function describeMenuErrorCause(_0x45c8a9,_0x4d06c9,_0xfbcab){const _0x753e81=a126_0xc1b8eb,_0x557d98=mapMenuApiError(_0x45c8a9,_0x4d06c9,_0xfbcab);return{'causeCode':_0x557d98[_0x753e81(0xed)],'causeMessage':_0x557d98[_0x753e81(0xd4)]};}export function hasFlag(_0x114803,_0x37f2d8){const _0x4f8003=a126_0xc1b8eb;return Object['prototype'][_0x4f8003(0x100)][_0x4f8003(0xe0)](_0x114803[_0x4f8003(0xd1)],_0x37f2d8)&&_0x114803[_0x4f8003(0xd1)][_0x37f2d8]!==undefined;}export function toApiParentId(_0xa6bc7d){return _0xa6bc7d??0x0;}export function formatParent(_0x51d2e3){const _0x4b2b11=a126_0xc1b8eb;return _0x51d2e3==null?_0x4b2b11(0xb9):String(_0x51d2e3);}function a126_0x4ae9(_0x3be091,_0x358d15){_0x3be091=_0x3be091-0xb3;const _0x1acc47=a126_0x1acc();let _0x4ae998=_0x1acc47[_0x3be091];return _0x4ae998;}export function menuError(_0x5bff77,_0x20f9c8,_0x44126a){return new CliError(_0x5bff77,0x1,_0x20f9c8,_0x44126a);}export function mapMenuApiError(_0x3c5158,_0x12f329,_0x33335a){const _0x29e49a=a126_0xc1b8eb;if(_0x3c5158 instanceof CliError&&_0x3c5158[_0x29e49a(0xed)]!==_0x29e49a(0xbc))return _0x3c5158;const _0x370058=_0x3c5158 instanceof Error?_0x3c5158['message']:String(_0x3c5158);if(/HTTP 403|forbidden|permission|无权限|权限不足|没有权限/i[_0x29e49a(0xcc)](_0x370058))return menuError(_0x29e49a(0xe3),'Permission\x20denied\x20while\x20attempting\x20to\x20'+_0x12f329+(_0x33335a?'\x20menu\x20'+_0x33335a:'')+'.','Confirm\x20that\x20the\x20current\x20account\x20can\x20manage\x20menus\x20for\x20this\x20app.');return menuError(_0x29e49a(0x105),_0x29e49a(0xdd)+_0x12f329+(_0x33335a?_0x29e49a(0xc4)+_0x33335a:'')+':\x20'+_0x370058,'Re-run\x20menu\x20list\x20to\x20inspect\x20the\x20latest\x20online\x20state\x20before\x20retrying.');}export function isMenuResponseLoss(_0x367f0d){const _0x557cfd=a126_0xc1b8eb,_0x4b0688=_0x367f0d instanceof Error?_0x367f0d['message']:String(_0x367f0d);if(_0x367f0d instanceof CliError)return _0x367f0d[_0x557cfd(0xed)]===_0x557cfd(0xbc)&&/^Request (?:failed|timeout):/i[_0x557cfd(0xcc)](_0x4b0688);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'](_0x4b0688);}function stateDrift(_0x4c9e2c){const _0x3f74b4=a126_0xc1b8eb;return menuError('menu_state_drift',_0x4c9e2c,_0x3f74b4(0xde));}
|
|
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 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2371c8,_0x5232e9){const _0x4aa993=a126_0x4295,_0x206468=_0x2371c8();while(!![]){try{const _0x512678=-parseInt(_0x4aa993(0x197))/0x1+-parseInt(_0x4aa993(0x182))/0x2+-parseInt(_0x4aa993(0x180))/0x3+-parseInt(_0x4aa993(0x191))/0x4*(-parseInt(_0x4aa993(0x18b))/0x5)+-parseInt(_0x4aa993(0x185))/0x6*(-parseInt(_0x4aa993(0x18a))/0x7)+parseInt(_0x4aa993(0x183))/0x8+parseInt(_0x4aa993(0x1a5))/0x9;if(_0x512678===_0x5232e9)break;else _0x206468['push'](_0x206468['shift']());}catch(_0x162a7a){_0x206468['push'](_0x206468['shift']());}}}(a126_0x4760,0xc9b08));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_0x7df8b9,updateMenuRecord}from'../../../core/api-client.js';export async function getOnlineMenuList(_0x697cba,_0x180dd1){const _0x45bd7b=a126_0x4295,_0x19227d=getEnv();logger[_0x45bd7b(0x198)](_0x45bd7b(0x19e),isProduction(_0x19227d)?_0x45bd7b(0x181)+_0x697cba+')':_0x45bd7b(0x187)+_0x697cba+')');const _0x532b6f=await fetchMenuSnapshot(_0x697cba,_0x180dd1,{'verbose':!![]});return logger[_0x45bd7b(0x198)]('get-online-menu-list',_0x45bd7b(0x1a0)+_0x532b6f[_0x45bd7b(0x19b)]+_0x45bd7b(0x1a4)),_0x532b6f[_0x45bd7b(0x193)][_0x45bd7b(0x17e)](toProcessedMenuItem);}export async function createMenu(_0x912510,_0x24c77e,_0xf63bb6){const _0x42937d=a126_0x4295;logger[_0x42937d(0x198)](_0x42937d(0x18c),_0x42937d(0x184)+_0xf63bb6[_0x42937d(0x188)]+'\x20('+_0xf63bb6[_0x42937d(0x1a3)]+')');const _0x5213a0={'appCode':_0x912510,'type':'procode','sort':0x0,'extend':{'loadScriptMode':_0x42937d(0x1a2),'resources':_0xf63bb6[_0x42937d(0x195)]?JSON[_0x42937d(0x17f)](_0xf63bb6['resources']):undefined},..._0xf63bb6},_0x1e97c3=await createMenuRecord(_0x5213a0,_0x24c77e,_0x42937d(0x17d)+_0xf63bb6[_0x42937d(0x188)]+'\x22');return logger[_0x42937d(0x198)]('create-menu',_0x42937d(0x190)+_0xf63bb6[_0x42937d(0x188)]),_0x1e97c3;}async function createSingleMenu(_0x529e62,_0x16dba4,_0x440903,_0x39ae18){const _0x27c8e5=a126_0x4295,_0x37ba54={'appCode':_0x529e62,'type':_0x27c8e5(0x186),'sort':0x0,'extend':{'loadScriptMode':_0x27c8e5(0x1a2),'resources':_0x39ae18?JSON[_0x27c8e5(0x17f)](_0x39ae18):undefined},'label':_0x440903[_0x27c8e5(0x188)],'path':_0x440903['path']},_0xd66135=await createMenuRecord(_0x37ba54,_0x16dba4,'Create\x20menu\x20\x22'+_0x440903[_0x27c8e5(0x188)]+'\x22');return logger['info'](_0x27c8e5(0x18c),_0x27c8e5(0x190)+_0x440903[_0x27c8e5(0x188)]),_0xd66135;}function a126_0x4760(){const _0x3e0c4d=['resources','Delete\x20','672221toHsQb','info','\x20menu','update-menu-cdn-url','total','Regroup\x20','Start\x20batch\x20menu\x20creation,\x20total\x20','get-online-menu-list','\x20menu\x20group(s)','Fetched\x20','Update\x20menu\x20','import','path','\x20online\x20menus\x20successfully','12085911hcgRWA','Create\x20menu\x20\x22','map','stringify','1720197RvJnzq','Fetching\x20online\x20menu\x20list...\x20(appCode:\x20','2924938xTRddw','12638192SFSZoh','Creating\x20menu:\x20','903858oKdEwS','procode','Fetching\x20daily\x20menu\x20list...\x20(appCode:\x20','label','loadScriptMode','21krAXKa','61395cgNsJK','create-menu','length','extend','menuGroups','Menu\x20created\x20successfully:\x20','52oopIhQ','all','menus','create-menus'];a126_0x4760=function(){return _0x3e0c4d;};return a126_0x4760();}export async function createMenus(_0x1b8ecc,_0x488dae,_0x4bb0b5,_0x6af51c){const _0x3c1f94=a126_0x4295;logger[_0x3c1f94(0x198)](_0x3c1f94(0x194),_0x3c1f94(0x19d)+_0x4bb0b5[_0x3c1f94(0x18d)]);const _0x1f095e=await Promise[_0x3c1f94(0x192)](_0x4bb0b5['map'](_0x3f0ef6=>createSingleMenu(_0x1b8ecc,_0x488dae,_0x3f0ef6,_0x6af51c)));return logger['info'](_0x3c1f94(0x194),'Batch\x20menu\x20creation\x20completed,\x20total\x20'+_0x4bb0b5['length']),_0x1f095e;}export async function updateMenuCdnUrl(_0x833959,_0x41b3ea,_0xc18ba3){const _0x434aa1=a126_0x4295;logger[_0x434aa1(0x198)](_0x434aa1(0x19a),'Updating\x20menu\x20asset\x20links:\x20'+_0xc18ba3[_0x434aa1(0x188)]+'\x20('+_0xc18ba3[_0x434aa1(0x1a3)]+')');const _0x5eaf96={'id':_0xc18ba3['id'],'appCode':_0x833959,'extend':{..._0xc18ba3[_0x434aa1(0x18e)]??{},..._0xc18ba3[_0x434aa1(0x189)]?{'loadScriptMode':_0xc18ba3[_0x434aa1(0x189)]}:{},'resources':_0xc18ba3[_0x434aa1(0x195)]?JSON[_0x434aa1(0x17f)](_0xc18ba3[_0x434aa1(0x195)]):undefined}},_0x151b33=await updateMenuRecord(_0x5eaf96,_0x41b3ea,'Update\x20menu\x20assets\x20\x22'+_0xc18ba3['label']+'\x22');return logger[_0x434aa1(0x198)]('update-menu-cdn-url','Menu\x20assets\x20synced:\x20'+_0xc18ba3[_0x434aa1(0x188)],undefined),_0x151b33;}function a126_0x4295(_0x3d6778,_0x57190d){_0x3d6778=_0x3d6778-0x17d;const _0x476098=a126_0x4760();let _0x42953e=_0x476098[_0x3d6778];return _0x42953e;}export async function createMenuEntity(_0x14488f,_0x2089fd,_0x1233c1){const _0x1435ef=a126_0x4295;return createMenuRecord({'appCode':_0x14488f,..._0x1233c1},_0x2089fd,'Create\x20menu\x20\x22'+_0x1233c1[_0x1435ef(0x188)]+'\x22');}export async function updateMenuEntity(_0x31454d,_0x1e30dd,_0x2024b4){const _0x5c6a39=a126_0x4295;return updateMenuRecord({'appCode':_0x31454d,..._0x2024b4},_0x1e30dd,_0x5c6a39(0x1a1)+_0x2024b4['id']);}export async function batchDeleteMenuEntities(_0x4caaa0,_0x5de579){const _0x5d1912=a126_0x4295;return batchDeleteMenuRecords(_0x5de579,_0x4caaa0,_0x5d1912(0x196)+_0x5de579[_0x5d1912(0x18d)]+_0x5d1912(0x199)+(_0x5de579[_0x5d1912(0x18d)]===0x1?'':'s'));}export async function startMenuRegroup(_0x1870b2,_0x5a9dcc){const _0x29ee19=a126_0x4295;return a126_0x7df8b9(_0x5a9dcc,_0x1870b2,_0x29ee19(0x19c)+_0x5a9dcc[_0x29ee19(0x18f)][_0x29ee19(0x18d)]+_0x29ee19(0x19f));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a127_0x3bbe9f=a127_0x484b;function a127_0x484b(_0x744545,_0x5b1a99){_0x744545=_0x744545-0x184;const _0x211783=a127_0x2117();let _0x484b08=_0x211783[_0x744545];return _0x484b08;}(function(_0x1e48fc,_0x11518e){const _0x48c5df=a127_0x484b,_0x4a508c=_0x1e48fc();while(!![]){try{const _0x539ad4=parseInt(_0x48c5df(0x1a1))/0x1*(parseInt(_0x48c5df(0x192))/0x2)+-parseInt(_0x48c5df(0x19f))/0x3*(parseInt(_0x48c5df(0x1a8))/0x4)+-parseInt(_0x48c5df(0x1a5))/0x5*(-parseInt(_0x48c5df(0x1a0))/0x6)+parseInt(_0x48c5df(0x1aa))/0x7*(-parseInt(_0x48c5df(0x19c))/0x8)+-parseInt(_0x48c5df(0x19a))/0x9*(parseInt(_0x48c5df(0x197))/0xa)+parseInt(_0x48c5df(0x191))/0xb*(-parseInt(_0x48c5df(0x190))/0xc)+-parseInt(_0x48c5df(0x1a4))/0xd*(-parseInt(_0x48c5df(0x1ad))/0xe);if(_0x539ad4===_0x11518e)break;else _0x4a508c['push'](_0x4a508c['shift']());}catch(_0x1fd5b4){_0x4a508c['push'](_0x4a508c['shift']());}}}(a127_0x2117,0xb5c77));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';function a127_0x2117(){const _0x2dd333=['Invalid\x20--params:\x20expected\x20a\x20JSON\x20object.','label','get','push','hasOwn','info','Invalid\x20--params.','dryRun','path','Invalid\x20--params\x20JSON.','Invalid\x20--params\x20fields:\x20','import','map','--params.pages\x20is\x20no\x20longer\x20supported.\x20Use\x20--paths\x20with\x20exact\x20local\x20page\x20paths.','CSS\x20URL\x20is\x20unreachable:\x20','JS\x20URL\x20is\x20unreachable:\x20','12996OEEOOo','1837rtlRgA','452fJIFkg','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','Invalid\x20--params:\x20','menu-sync','No\x20local\x20pages\x20matched\x20paths:\x20','3265130SuLkKe','parse','join','9nATYEy','isArray','11305744VlNsTK','length','filter','114dqwiHA','576HISslK','4309gUcJcM','Start\x20non-interactive\x20menu\x20sync','jsUrl','42289ZoHbYP','100pmHCzC','--params.','field','32072fAMjVO','cssUrl','7rMKGZv','object','trim','8582aMecap','string'];a127_0x2117=function(){return _0x2dd333;};return a127_0x2117();}import{logger}from'../../../utils/logger.js';const MENU_SYNC_PARAM_KEYS=new Set([a127_0x3bbe9f(0x1a3),'cssUrl']);function validateParams(_0x406210){const _0x952049=a127_0x3bbe9f,_0x444ead=[];return _0x406210[_0x952049(0x1a3)]&&!isValidJsHttpsUrl(_0x406210[_0x952049(0x1a3)])&&_0x444ead[_0x952049(0x1b2)]({'field':_0x952049(0x1a3),'message':'JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL'}),_0x406210[_0x952049(0x1a9)]&&!isValidCssHttpsUrl(_0x406210[_0x952049(0x1a9)])&&_0x444ead['push']({'field':'cssUrl','message':_0x952049(0x193)}),_0x444ead;}export async function runMenuSyncCore(_0x5943eb,_0x40b020,_0x30582f=[],_0x348a36,_0x352788={}){const _0x4ed93d=a127_0x3bbe9f,_0x9990ef=parseMenuSyncParams(_0x348a36),_0x1ad7c7=[...new Set(_0x30582f[_0x4ed93d(0x18c)](_0xc4b3c2=>_0xc4b3c2[_0x4ed93d(0x1ac)]())[_0x4ed93d(0x19e)](Boolean))],_0x5aa3b1=_0x9990ef[_0x4ed93d(0x1a3)],_0xe2edd2=_0x9990ef['cssUrl'],_0xd7293e=[];if(_0x5aa3b1)_0xd7293e[_0x4ed93d(0x1b2)](_0x5aa3b1);if(_0xe2edd2)_0xd7293e['push'](_0xe2edd2);const _0x2d6cd8=validateParams(_0x9990ef);if(_0x2d6cd8['length']>0x0){const _0x5afddf=_0x2d6cd8['map'](_0x2eac42=>_0x4ed93d(0x1a6)+_0x2eac42[_0x4ed93d(0x1a7)]+':\x20'+_0x2eac42['message'])[_0x4ed93d(0x199)](';\x20');throw new Error(_0x4ed93d(0x194)+_0x5afddf);}logger['setLogPath'](process['cwd']()),logger[_0x4ed93d(0x185)]('menu-sync',_0x4ed93d(0x1a2),{'appCode':_0x5943eb,'selectedCount':_0x1ad7c7[_0x4ed93d(0x19d)],'jsUrl':_0x5aa3b1,'cssUrl':_0xe2edd2});if(_0x5aa3b1){const _0xced200=await isUrlReachable(_0x5aa3b1);if(!_0xced200)throw new Error(_0x4ed93d(0x18f)+_0x5aa3b1);}if(_0xe2edd2){const _0x8d60c4=await isUrlReachable(_0xe2edd2);if(!_0x8d60c4)throw new Error(_0x4ed93d(0x18e)+_0xe2edd2);}const _0x515505=getLocalPages();if(_0x515505[_0x4ed93d(0x19d)]===0x0){if(_0x1ad7c7[_0x4ed93d(0x19d)]>0x0)throw new Error(_0x4ed93d(0x196)+_0x1ad7c7[_0x4ed93d(0x199)](',\x20'));return{'created':0x0,'skipped':!![],'dryRun':_0x352788[_0x4ed93d(0x187)]===!![],'targetPages':[],'plannedMenus':[]};}const _0x5a309f=await getOnlineMenuList(_0x5943eb,_0x40b020),_0x536c2e=new Set(_0x5a309f[_0x4ed93d(0x18c)](_0x2d6518=>_0x2d6518['path']));let _0x2d56bb;if(_0x1ad7c7[_0x4ed93d(0x19d)]>0x0){const _0x23a043=new Map(_0x515505['map'](_0x9a9cd8=>[_0x9a9cd8[_0x4ed93d(0x188)],_0x9a9cd8])),_0x3d3679=_0x1ad7c7[_0x4ed93d(0x19e)](_0x5efd5d=>!_0x23a043['has'](_0x5efd5d));if(_0x3d3679[_0x4ed93d(0x19d)]>0x0){const _0x4908f5=_0x515505[_0x4ed93d(0x18c)](_0xe58f3f=>_0xe58f3f[_0x4ed93d(0x188)])[_0x4ed93d(0x199)](',\x20');throw new Error(_0x4ed93d(0x196)+_0x3d3679[_0x4ed93d(0x199)](',\x20')+'\x0a\x20\x20Available\x20local\x20paths:\x20'+_0x4908f5);}const _0x460b8a=_0x1ad7c7[_0x4ed93d(0x19e)](_0x483c70=>_0x536c2e['has'](_0x483c70));if(_0x460b8a[_0x4ed93d(0x19d)]>0x0)throw new Error('Local\x20page\x20paths\x20are\x20already\x20on\x20the\x20platform:\x20'+_0x460b8a[_0x4ed93d(0x199)](',\x20'));_0x2d56bb=_0x1ad7c7['map'](_0x1ad812=>_0x23a043[_0x4ed93d(0x1b1)](_0x1ad812));}else _0x2d56bb=_0x515505[_0x4ed93d(0x19e)](_0x264669=>!_0x536c2e['has'](_0x264669['path']));if(_0x2d56bb[_0x4ed93d(0x19d)]===0x0)return{'created':0x0,'skipped':!![],'dryRun':_0x352788[_0x4ed93d(0x187)]===!![],'targetPages':[],'plannedMenus':[]};const _0x3698be=_0x2d56bb['map'](_0x3020f7=>({'type':'procode','path':_0x3020f7[_0x4ed93d(0x188)],'label':_0x3020f7[_0x4ed93d(0x1b0)],'loadScriptMode':_0x4ed93d(0x18b),'resources':[..._0xd7293e]}));if(_0x352788[_0x4ed93d(0x187)])return{'created':0x0,'skipped':![],'dryRun':!![],'targetPages':_0x2d56bb,'plannedMenus':_0x3698be};const _0x1f7a38=await createMenus(_0x5943eb,_0x40b020,_0x2d56bb,_0xd7293e['length']>0x0?_0xd7293e:undefined);return logger[_0x4ed93d(0x185)](_0x4ed93d(0x195),'Menu\x20sync\x20completed',{'count':_0x2d56bb[_0x4ed93d(0x19d)],'resources':_0xd7293e}),{'created':_0x1f7a38[_0x4ed93d(0x19d)],'skipped':![],'dryRun':![],'targetPages':_0x2d56bb,'plannedMenus':_0x3698be,'menus':_0x1f7a38};}export function parseMenuSyncParams(_0x34c8ef){const _0x3dc390=a127_0x3bbe9f;if(!_0x34c8ef||typeof _0x34c8ef!==_0x3dc390(0x1ae))return{};let _0x3dab36;try{_0x3dab36=JSON[_0x3dc390(0x198)](_0x34c8ef);}catch{throw new Error(_0x3dc390(0x189));}if(typeof _0x3dab36!==_0x3dc390(0x1ab)||_0x3dab36===null||Array[_0x3dc390(0x19b)](_0x3dab36))throw new Error(_0x3dc390(0x1af));const _0x1320bf=_0x3dab36;if(Object[_0x3dc390(0x184)](_0x1320bf,'pages'))throw new Error(_0x3dc390(0x18d));const _0x571776=Object['keys'](_0x1320bf)['filter'](_0x3af764=>!MENU_SYNC_PARAM_KEYS['has'](_0x3af764));if(_0x571776[_0x3dc390(0x19d)]>0x0)throw new Error(_0x3dc390(0x18a)+_0x571776[_0x3dc390(0x199)](',\x20')+'.');for(const _0x14979c of MENU_SYNC_PARAM_KEYS){const _0x2828ec=_0x1320bf[_0x14979c];if(_0x2828ec!==undefined&&(typeof _0x2828ec!==_0x3dc390(0x1ae)||_0x2828ec[_0x3dc390(0x1ac)]()===''))throw new Error(_0x3dc390(0x186)+_0x14979c+':\x20expected\x20a\x20non-empty\x20string.');}return{'jsUrl':typeof _0x1320bf['jsUrl']==='string'?_0x1320bf[_0x3dc390(0x1a3)][_0x3dc390(0x1ac)]():undefined,'cssUrl':typeof _0x1320bf[_0x3dc390(0x1a9)]===_0x3dc390(0x1ae)?_0x1320bf[_0x3dc390(0x1a9)][_0x3dc390(0x1ac)]():undefined};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x24027b,_0x480690){const _0x492b80=a130_0x4aca,_0x1cd927=_0x24027b();while(!![]){try{const _0x5e763e=-parseInt(_0x492b80(0x1ca))/0x1+parseInt(_0x492b80(0x1ad))/0x2*(parseInt(_0x492b80(0x1ae))/0x3)+parseInt(_0x492b80(0x1cd))/0x4*(parseInt(_0x492b80(0x1c9))/0x5)+parseInt(_0x492b80(0x1c0))/0x6+-parseInt(_0x492b80(0x1e6))/0x7+-parseInt(_0x492b80(0x1b2))/0x8+parseInt(_0x492b80(0x1d7))/0x9*(-parseInt(_0x492b80(0x1be))/0xa);if(_0x5e763e===_0x480690)break;else _0x1cd927['push'](_0x1cd927['shift']());}catch(_0x1b33d7){_0x1cd927['push'](_0x1cd927['shift']());}}}(a130_0x3a4f,0x5e47a));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(_0x158ead){const _0x4b07de=a130_0x4aca,_0x36ec23=[];return _0x158ead['jsUrl']&&!isValidJsHttpsUrl(_0x158ead['jsUrl'])&&_0x36ec23['push']({'field':_0x4b07de(0x1c2),'message':_0x4b07de(0x1af)}),_0x158ead[_0x4b07de(0x1de)]&&!isValidCssHttpsUrl(_0x158ead[_0x4b07de(0x1de)])&&_0x36ec23[_0x4b07de(0x1e4)]({'field':_0x4b07de(0x1de),'message':_0x4b07de(0x1ab)}),_0x36ec23;}export async function runMenuUpdateCore(_0x3cad0f,_0x2595d5,_0x5c0e2e,_0x47c470={}){const _0x4cefc2=a130_0x4aca,_0x1f34d9=parseUpdateParamsFlag(_0x5c0e2e),_0x563543=normalizeMode(_0x47c470[_0x4cefc2(0x1d0)]);validateSelection(_0x47c470[_0x4cefc2(0x1c8)]);const _0x47ddb3=[];if(_0x1f34d9[_0x4cefc2(0x1c2)])_0x47ddb3[_0x4cefc2(0x1e4)](_0x1f34d9[_0x4cefc2(0x1c2)]);if(_0x1f34d9['cssUrl'])_0x47ddb3[_0x4cefc2(0x1e4)](_0x1f34d9[_0x4cefc2(0x1de)]);const _0x2d3a55=validateParams(_0x1f34d9);if(_0x2d3a55[_0x4cefc2(0x1bd)]>0x0){const _0x221728=_0x2d3a55[_0x4cefc2(0x1e0)](_0x728536=>_0x4cefc2(0x1ec)+_0x728536[_0x4cefc2(0x1ea)]+':\x20'+_0x728536[_0x4cefc2(0x1e1)])[_0x4cefc2(0x1d2)](';\x20');throw new Error(_0x4cefc2(0x1bf)+_0x221728);}if(_0x47ddb3[_0x4cefc2(0x1bd)]===0x0)throw new Error(_0x4cefc2(0x1c7)+'Pass\x20--params\x20\x27{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}\x27\x20to\x20update\x20assets.');logger[_0x4cefc2(0x1c5)](process['cwd']()),logger[_0x4cefc2(0x1bb)](_0x4cefc2(0x1b8),_0x4cefc2(0x1d1),{'appCode':_0x3cad0f,'jsUrl':_0x1f34d9[_0x4cefc2(0x1c2)],'cssUrl':_0x1f34d9[_0x4cefc2(0x1de)],'mode':_0x563543,'dryRun':_0x47c470[_0x4cefc2(0x1ac)]===!![]});if(_0x1f34d9[_0x4cefc2(0x1c2)]){const _0x5b10c8=await isUrlReachable(_0x1f34d9['jsUrl']);if(!_0x5b10c8)throw new Error(_0x4cefc2(0x1e9)+_0x1f34d9[_0x4cefc2(0x1c2)]);}if(_0x1f34d9[_0x4cefc2(0x1de)]){const _0x2f259b=await isUrlReachable(_0x1f34d9['cssUrl']);if(!_0x2f259b)throw new Error(_0x4cefc2(0x1b6)+_0x1f34d9[_0x4cefc2(0x1de)]);}const _0x4c6020=await getOnlineMenuList(_0x3cad0f,_0x2595d5),_0x3b24a7=_0x4c6020[_0x4cefc2(0x1df)](_0x2b6c61=>_0x2b6c61['resources'][_0x4cefc2(0x1bd)]>0x0),_0x5595c9=selectMenusForUpdate(_0x3b24a7,_0x47c470['selection']);if(_0x5595c9['length']===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![],'dryRun':_0x47c470[_0x4cefc2(0x1ac)]===!![]};const _0x49bf1e=_0x5595c9[_0x4cefc2(0x1e0)](_0x506dfa=>buildMenuUpdateDiff(_0x506dfa,_0x1f34d9,_0x563543,_0x47c470['force']===!![],_0x47c470[_0x4cefc2(0x1e7)]));if(_0x47c470[_0x4cefc2(0x1ac)])return{'updated':0x0,'failed':0x0,'skipped':![],'dryRun':!![],'diffs':_0x49bf1e};const _0x4bd1cd=await Promise[_0x4cefc2(0x1e5)](_0x5595c9[_0x4cefc2(0x1e0)]((_0x2b3dd1,_0x43311a)=>updateMenuCdnUrl(_0x3cad0f,_0x2595d5,{'id':_0x2b3dd1['id'],'label':_0x2b3dd1[_0x4cefc2(0x1bc)],'path':_0x2b3dd1[_0x4cefc2(0x1cb)],'resources':_0x49bf1e[_0x43311a][_0x4cefc2(0x1e2)][_0x4cefc2(0x1e3)],'extend':_0x2b3dd1[_0x4cefc2(0x1d6)]??null,'loadScriptMode':_0x47c470[_0x4cefc2(0x1e7)]}))),_0x5767d0=_0x4bd1cd[_0x4cefc2(0x1df)](_0x3cb9af=>_0x3cb9af[_0x4cefc2(0x1b4)]==='fulfilled')['map'](_0x241356=>_0x241356[_0x4cefc2(0x1d3)]),_0x5bd396=_0x4bd1cd[_0x4cefc2(0x1df)](_0x1ef235=>_0x1ef235['status']===_0x4cefc2(0x1b1))[_0x4cefc2(0x1bd)];return logger['info'](_0x4cefc2(0x1b8),_0x4cefc2(0x1b9),{'count':_0x5595c9[_0x4cefc2(0x1bd)],'resources':_0x47ddb3}),{'updated':_0x5767d0[_0x4cefc2(0x1bd)],'failed':_0x5bd396,'skipped':![],'menus':_0x5767d0};}function validateSelection(_0x2a04c3){const _0x305688=a130_0x4aca;if(!_0x2a04c3)throw new Error(_0x305688(0x1eb));if(_0x2a04c3[_0x305688(0x1a9)]&&(_0x2a04c3[_0x305688(0x1da)]['length']>0x0||_0x2a04c3[_0x305688(0x1b3)][_0x305688(0x1bd)]>0x0))throw new Error(_0x305688(0x1ee));if(!_0x2a04c3[_0x305688(0x1a9)]&&_0x2a04c3[_0x305688(0x1da)][_0x305688(0x1bd)]===0x0&&_0x2a04c3[_0x305688(0x1b3)]['length']===0x0)throw new Error('menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.');}export function selectMenusForUpdate(_0x3c2fa8,_0x1fd8b4){const _0x2bb921=a130_0x4aca;validateSelection(_0x1fd8b4);if(_0x1fd8b4[_0x2bb921(0x1a9)])return _0x3c2fa8;const _0x40c5cc=new Set(_0x3c2fa8['map'](_0x34893a=>_0x34893a['id'])),_0x3ab46b=new Set(_0x3c2fa8[_0x2bb921(0x1e0)](_0x56fe09=>_0x56fe09[_0x2bb921(0x1cb)])),_0x34813c=_0x1fd8b4[_0x2bb921(0x1da)]['filter'](_0x286708=>!_0x40c5cc[_0x2bb921(0x1ba)](_0x286708)),_0x4aafda=_0x1fd8b4['paths']['filter'](_0x385f05=>!_0x3ab46b['has'](_0x385f05));if(_0x34813c['length']>0x0||_0x4aafda[_0x2bb921(0x1bd)]>0x0){const _0x29cf12=[..._0x34813c['map'](_0x86510e=>String(_0x86510e)),..._0x4aafda][_0x2bb921(0x1d2)](',\x20');throw new Error(_0x2bb921(0x1c3)+_0x29cf12);}const _0x4033bf=new Set(_0x1fd8b4[_0x2bb921(0x1da)]),_0x4cb5bb=new Set(_0x1fd8b4[_0x2bb921(0x1b3)]);return _0x3c2fa8[_0x2bb921(0x1df)](_0x45dcdc=>_0x4033bf['has'](_0x45dcdc['id'])||_0x4cb5bb[_0x2bb921(0x1ba)](_0x45dcdc[_0x2bb921(0x1cb)]));}function normalizeMode(_0x18b3a8){const _0x45c927=a130_0x4aca;if(!_0x18b3a8)return'patch';if(_0x18b3a8==='replace'||_0x18b3a8==='patch')return _0x18b3a8;throw new Error(_0x45c927(0x1dd)+_0x18b3a8+_0x45c927(0x1ed));}function a130_0x3a4f(){const _0x481ee2=['menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.','--params.','.\x20Allowed\x20values:\x20replace,\x20patch','--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.','all','.css','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','dryRun','430pNvkRT','10065PFCoNG','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','with\x20a\x20single\x20cssUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','rejected','2159568TOyVfp','paths','status','endsWith','CSS\x20URL\x20is\x20unreachable:\x20','\x22\x20(','menu-asset-update','Menu\x20asset\x20update\x20completed','has','info','label','length','25450SeJECL','Invalid\x20--params:\x20','4437558lMsqoo','trim','jsUrl','menu\x20asset-update\x20selectors\x20did\x20not\x20match\x20resource-bearing\x20menus:\x20','string','setLogPath','isArray','Invalid\x20--params:\x20menu\x20asset-update\x20requires\x20at\x20least\x20one\x20explicit\x20JS/CSS\x20URL.\x20','selection','129625bFVvww','400632ppoczl','path','unshift','108FpKPMW','menu\x20asset-update\x20will\x20remove\x20existing\x20CSS\x20resource\x20for\x20\x22','menu\x20asset-update\x20cannot\x20patch\x20','mode','Start\x20non-interactive\x20menu\x20asset\x20update','join','value','object','some','extend','2655EHMjVB','patch',').\x20','menuIds','toLowerCase','Use\x20--mode\x20patch\x20to\x20preserve\x20it,\x20pass\x20jsUrl,\x20or\x20add\x20--force\x20for\x20an\x20intentional\x20removal.','Invalid\x20--mode:\x20','cssUrl','filter','map','message','after','resources','push','allSettled','2473590BfzGfo','loadScriptMode','parse','JS\x20URL\x20is\x20unreachable:\x20','field'];a130_0x3a4f=function(){return _0x481ee2;};return a130_0x3a4f();}function buildMenuUpdateDiff(_0x5f4363,_0x124ee4,_0x483dab,_0x4ee218,_0x4da864){const _0x1ae940=a130_0x4aca,_0x4d8c89=[..._0x5f4363[_0x1ae940(0x1e3)]];_0x483dab===_0x1ae940(0x1d8)&&assertUnambiguousPatchResources(_0x5f4363,_0x4d8c89,_0x124ee4);const _0x399993=_0x483dab===_0x1ae940(0x1d8)?patchResources(_0x4d8c89,_0x124ee4):replaceResources(_0x124ee4),_0x36871d=[],_0x13ac8b=_0x4d8c89[_0x1ae940(0x1d5)](isJsResource),_0x20145d=_0x399993[_0x1ae940(0x1d5)](isJsResource);if(_0x13ac8b&&!_0x20145d){const _0x5c3745='menu\x20asset-update\x20would\x20remove\x20existing\x20JS\x20resource\x20for\x20\x22'+_0x5f4363[_0x1ae940(0x1bc)]+_0x1ae940(0x1b7)+_0x5f4363[_0x1ae940(0x1cb)]+_0x1ae940(0x1d9)+_0x1ae940(0x1dc);if(!_0x4ee218)throw new Error(_0x5c3745);_0x36871d[_0x1ae940(0x1e4)](_0x5c3745);}const _0x4def0f=_0x4d8c89[_0x1ae940(0x1d5)](isCssResource),_0x29207e=_0x399993[_0x1ae940(0x1d5)](isCssResource);_0x4def0f&&!_0x29207e&&_0x36871d[_0x1ae940(0x1e4)](_0x1ae940(0x1ce)+_0x5f4363['label']+'\x22\x20('+_0x5f4363[_0x1ae940(0x1cb)]+').');const _0x242f68=typeof _0x5f4363[_0x1ae940(0x1d6)]?.[_0x1ae940(0x1e7)]===_0x1ae940(0x1c4)?_0x5f4363['extend'][_0x1ae940(0x1e7)]:null,_0x58daa6=_0x4da864?{'loadScriptMode':_0x242f68}:{},_0xe0420f=_0x4da864?{'loadScriptMode':_0x4da864}:{};return{'id':_0x5f4363['id'],'label':_0x5f4363[_0x1ae940(0x1bc)],'path':_0x5f4363[_0x1ae940(0x1cb)],'mode':_0x483dab,'before':{'resources':_0x4d8c89,..._0x58daa6},'after':{'resources':_0x399993,..._0xe0420f},'warnings':_0x36871d};}function replaceResources(_0x4c8c16){const _0x309d57=a130_0x4aca;return[_0x4c8c16[_0x309d57(0x1c2)],_0x4c8c16[_0x309d57(0x1de)]]['filter'](_0x134d03=>!!_0x134d03);}function assertUnambiguousPatchResources(_0x535cdd,_0xe4fbc6,_0xb9eea8){const _0x3cfe0e=a130_0x4aca,_0x156eed=_0xe4fbc6[_0x3cfe0e(0x1df)](isJsResource)[_0x3cfe0e(0x1bd)];if(_0xb9eea8[_0x3cfe0e(0x1c2)]&&_0x156eed>0x1)throw new Error(_0x3cfe0e(0x1cf)+_0x156eed+'\x20existing\x20JS\x20resources\x20for\x20\x22'+_0x535cdd[_0x3cfe0e(0x1bc)]+_0x3cfe0e(0x1b7)+_0x535cdd[_0x3cfe0e(0x1cb)]+')\x20'+'with\x20a\x20single\x20jsUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.');const _0x56b9dc=_0xe4fbc6['filter'](isCssResource)[_0x3cfe0e(0x1bd)];if(_0xb9eea8[_0x3cfe0e(0x1de)]&&_0x56b9dc>0x1)throw new Error(_0x3cfe0e(0x1cf)+_0x56b9dc+'\x20existing\x20CSS\x20resources\x20for\x20\x22'+_0x535cdd[_0x3cfe0e(0x1bc)]+_0x3cfe0e(0x1b7)+_0x535cdd[_0x3cfe0e(0x1cb)]+')\x20'+_0x3cfe0e(0x1b0));}function patchResources(_0x51180e,_0x42883d){const _0x40c268=a130_0x4aca;let _0x58e120=![],_0x211ee4=![];const _0x1d066d=[];for(const _0x59f0f1 of _0x51180e){if(isJsResource(_0x59f0f1)){if(_0x42883d[_0x40c268(0x1c2)]&&!_0x58e120)_0x1d066d['push'](_0x42883d[_0x40c268(0x1c2)]),_0x58e120=!![];else!_0x42883d[_0x40c268(0x1c2)]&&_0x1d066d[_0x40c268(0x1e4)](_0x59f0f1);continue;}if(isCssResource(_0x59f0f1)){if(_0x42883d[_0x40c268(0x1de)]&&!_0x211ee4)_0x1d066d['push'](_0x42883d['cssUrl']),_0x211ee4=!![];else!_0x42883d[_0x40c268(0x1de)]&&_0x1d066d[_0x40c268(0x1e4)](_0x59f0f1);continue;}_0x1d066d[_0x40c268(0x1e4)](_0x59f0f1);}return _0x42883d['jsUrl']&&!_0x58e120&&_0x1d066d[_0x40c268(0x1cc)](_0x42883d[_0x40c268(0x1c2)]),_0x42883d[_0x40c268(0x1de)]&&!_0x211ee4&&_0x1d066d[_0x40c268(0x1e4)](_0x42883d[_0x40c268(0x1de)]),_0x1d066d;}function a130_0x4aca(_0x1a8c27,_0x35b1d9){_0x1a8c27=_0x1a8c27-0x1a9;const _0x3a4f55=a130_0x3a4f();let _0x4aca41=_0x3a4f55[_0x1a8c27];return _0x4aca41;}function isJsResource(_0x381ef9){const _0x223f2d=a130_0x4aca;return stripQuery(_0x381ef9)[_0x223f2d(0x1db)]()[_0x223f2d(0x1b5)]('.js');}function isCssResource(_0x4918da){const _0x220c5c=a130_0x4aca;return stripQuery(_0x4918da)['toLowerCase']()[_0x220c5c(0x1b5)](_0x220c5c(0x1aa));}function stripQuery(_0x5a138e){return _0x5a138e['split']('?')[0x0]??_0x5a138e;}function parseUpdateParamsFlag(_0x1e31cf){const _0x47c40d=a130_0x4aca;if(!_0x1e31cf||typeof _0x1e31cf!==_0x47c40d(0x1c4))return{};try{const _0x536ed8=JSON[_0x47c40d(0x1e8)](_0x1e31cf);if(typeof _0x536ed8!==_0x47c40d(0x1d4)||_0x536ed8===null||Array[_0x47c40d(0x1c6)](_0x536ed8))return{};return{'jsUrl':typeof _0x536ed8['jsUrl']===_0x47c40d(0x1c4)?_0x536ed8[_0x47c40d(0x1c2)]['trim']():undefined,'cssUrl':typeof _0x536ed8[_0x47c40d(0x1de)]==='string'?_0x536ed8[_0x47c40d(0x1de)][_0x47c40d(0x1c1)]():undefined};}catch{return{};}}
|
|
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 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a130_0x3245(_0x4be62f,_0x3aa0dc){_0x4be62f=_0x4be62f-0x166;const _0x4388fa=a130_0x4388();let _0x3245f1=_0x4388fa[_0x4be62f];return _0x3245f1;}function a130_0x4388(){const _0x37273f=['5128HNuorm','test','12lAPAtQ','58837097QPkKnP','27byOsCm','trim','554MpuMMB','5864450ffzXuw','10338708UaxPAG','5655130WiOYSG','7404GLXTGM','8714096hNkPAU','7YXtckf','1308rJNeGY'];a130_0x4388=function(){return _0x37273f;};return a130_0x4388();}(function(_0xe197cd,_0x2d78c2){const _0x861456=a130_0x3245,_0x48414a=_0xe197cd();while(!![]){try{const _0x28f5cb=-parseInt(_0x861456(0x16d))/0x1*(parseInt(_0x861456(0x167))/0x2)+parseInt(_0x861456(0x166))/0x3*(-parseInt(_0x861456(0x171))/0x4)+-parseInt(_0x861456(0x16e))/0x5+parseInt(_0x861456(0x16f))/0x6+parseInt(_0x861456(0x173))/0x7*(-parseInt(_0x861456(0x172))/0x8)+parseInt(_0x861456(0x16b))/0x9*(-parseInt(_0x861456(0x170))/0xa)+parseInt(_0x861456(0x16a))/0xb*(parseInt(_0x861456(0x169))/0xc);if(_0x28f5cb===_0x2d78c2)break;else _0x48414a['push'](_0x48414a['shift']());}catch(_0x223efc){_0x48414a['push'](_0x48414a['shift']());}}}(a130_0x4388,0xd8402));export function isValidJsHttpsUrl(_0x12b450){const _0x12e13c=a130_0x3245;return/^https:\/\/.+\.js(\?.*)?$/[_0x12e13c(0x168)](_0x12b450[_0x12e13c(0x16c)]());}export function isValidCssHttpsUrl(_0x419926){return/^https:\/\/.+\.css(\?.*)?$/['test'](_0x419926['trim']());}export async function isUrlReachable(_0xfa1e1c){try{const _0x204e92=await fetch(_0xfa1e1c,{'method':'HEAD'});return _0x204e92['ok'];}catch{return![];}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a131_0x29608f=a131_0x142f;(function(_0x4d59c9,_0x51e514){const _0x1b4c0c=a131_0x142f,_0x47b051=_0x4d59c9();while(!![]){try{const _0x44ce94=-parseInt(_0x1b4c0c(0x1c3))/0x1*(-parseInt(_0x1b4c0c(0x1b3))/0x2)+-parseInt(_0x1b4c0c(0x1aa))/0x3+parseInt(_0x1b4c0c(0x1c9))/0x4*(-parseInt(_0x1b4c0c(0x1d8))/0x5)+parseInt(_0x1b4c0c(0x1ce))/0x6+parseInt(_0x1b4c0c(0x19a))/0x7+-parseInt(_0x1b4c0c(0x199))/0x8+-parseInt(_0x1b4c0c(0x1c5))/0x9*(-parseInt(_0x1b4c0c(0x191))/0xa);if(_0x44ce94===_0x51e514)break;else _0x47b051['push'](_0x47b051['shift']());}catch(_0x14de73){_0x47b051['push'](_0x47b051['shift']());}}}(a131_0x2180,0xde2e1));import a131_0x530cb8 from'chalk';import{buildCompareRows,doCreateMenus,fetchMenuData}from'../../commands/menu/shared/logic.js';import{renderCompareTable,renderSyncSummary}from'../../commands/menu/shared/compare-table.js';function a131_0x142f(_0x4f74c0,_0x526d29){_0x4f74c0=_0x4f74c0-0x191;const _0x218070=a131_0x2180();let _0x142fd7=_0x218070[_0x4f74c0];return _0x142fd7;}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';function a131_0x2180(){const _0x3766db=['Exact\x20comma-separated\x20local\x20page\x20paths\x20to\x20sync','Confirm\x20non-interactive\x20sync;\x20without\x20--paths,\x20create\x20all\x20missing\x20local\x20pages','✓\x20Menu\x20sync\x20completed:\x20','Menu\x20sync\x20skipped','paths','2wzqiDg','JSON:\x20{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}','message','\x20\x20Create\x20','Menu\x20sync\x20completed:\x20','length','cyan','appCode','rawFlags','flag','localPages','\x20\x20✓\x20Selected:\x20','Online\x20menu\x20list\x20fetched','\x20failed.','menu\x20sync\x20requires\x20a\x20project\x20context\x20or\x20explicit\x20--appcode.\x20','Failed\x20to\x20fetch\x20online\x20menu\x20list','813361uQFDvl','\x20\x20!\x20No\x20local\x20pages\x20found,\x20please\x20create\x20pages\x20first','63PcBFQM','Preview\x20with\x20--dry-run,\x20then\x20reuse\x20the\x20same\x20--paths\x20and\x20--params\x20with\x20--yes.','cssUrl','skipped','345544oyJKze','sync','menu','params','string','10140816sqwsog','✓\x20All\x20local\x20pages\x20are\x20already\x20on\x20platform','yellow','gray','Would\x20create\x20','onlinePaths','Pre-fill\x20JS/CSS\x20URLs.\x20','\x20created,\x20','Run\x20inside\x20a\x20directory\x20with\x20.rabetbase.json,\x20or\x20pass\x20--appcode\x20<code>.','\x20created.','45KxfMUn','size','2001020vDVGXM','split','str','filter','Fetching\x20online\x20menu\x20list...','\x20menu(s)\x20created','No\x20local\x20microfrontend\x20menus\x20would\x20be\x20created.','validation','10417408LFQjjJ','230440osidJG','boolean','cookie','created','appcode','\x20\x20Cancelled.','Non-interactive\x20menu\x20sync\x20requires\x20--yes.','\x20page(s)','selectedAppName','\x20menu(s)\x20with\x20JS:\x20','jsUrl','Menu\x20creation\x20failed','Creating\x20','\x20local\x20microfrontend\x20menu(s).','Created\x20','\x20menu(s)...','2842296uAbrkV','\x20\x20Continue\x20with\x20creation?','\x20menu(s)','trim'];a131_0x2180=function(){return _0x3766db;};return a131_0x2180();}import{isInProject}from'../../context.js';export const menuSync={'service':a131_0x29608f(0x1cb),'command':a131_0x29608f(0x1ca),'description':'Sync\x20local\x20pages\x20as\x20platform\x20menus','risk':'write','flags':[{'name':'params','type':a131_0x29608f(0x1cd),'description':a131_0x29608f(0x1d4)+a131_0x29608f(0x1b4)},{'name':a131_0x29608f(0x1b2),'type':a131_0x29608f(0x1cd),'description':a131_0x29608f(0x1ae)},{'name':'yes','type':a131_0x29608f(0x19b),'description':a131_0x29608f(0x1af)}],async 'dryRun'(_0x5b2caf){const _0x46350e=a131_0x29608f;ensureRunnableContext(_0x5b2caf[_0x46350e(0x1bb)],_0x5b2caf['selectedAppName']);const _0x1d387d=await runMenuSyncCore(_0x5b2caf[_0x46350e(0x1ba)],_0x5b2caf[_0x46350e(0x19c)],parsePaths(_0x5b2caf[_0x46350e(0x193)]('paths')),_0x5b2caf[_0x46350e(0x193)](_0x46350e(0x1cc)),{'dryRun':!![]});return{'method':'POST','url':'/smartapi/menu/create','body':_0x1d387d,'description':_0x1d387d[_0x46350e(0x1c8)]?_0x46350e(0x197):_0x46350e(0x1d2)+_0x1d387d['targetPages']['length']+_0x46350e(0x1a7)};},async 'execute'(_0x549d15){const _0xb49ce5=a131_0x29608f;ensureRunnableContext(_0x549d15[_0xb49ce5(0x1bb)],_0x549d15[_0xb49ce5(0x1a2)]);const _0x40d052=_0x549d15[_0xb49ce5(0x1bc)]('yes'),_0x3b4729=_0x549d15[_0xb49ce5(0x193)](_0xb49ce5(0x1cc)),_0x3813cb=parsePaths(_0x549d15[_0xb49ce5(0x193)](_0xb49ce5(0x1b2))),_0x4d50bf=parseMenuSyncParams(_0x3b4729);if(_0x40d052){const _0x419a20=await runMenuSyncCore(_0x549d15[_0xb49ce5(0x1ba)],_0x549d15[_0xb49ce5(0x19c)],_0x3813cb,_0x3b4729);if(_0x419a20['skipped']){const _0x30c9ad=getLocalPages();_0x30c9ad[_0xb49ce5(0x1b8)]===0x0?writeCliSideChannelLine('!\x20No\x20local\x20pages\x20found\x20in\x20src/pages'):writeCliSideChannelLine(_0xb49ce5(0x1cf));}else writeCliSideChannelLine(_0xb49ce5(0x1b0)+_0x419a20[_0xb49ce5(0x19d)]+_0xb49ce5(0x196));return{'ok':!![],'data':_0x419a20,'message':_0x419a20[_0xb49ce5(0x1c8)]?_0xb49ce5(0x1b1):'Menu\x20sync\x20completed:\x20'+_0x419a20[_0xb49ce5(0x19d)]+_0xb49ce5(0x1d7)};}if(_0x3813cb[_0xb49ce5(0x1b8)]>0x0)throw CliErrors[_0xb49ce5(0x198)]('menu\x20sync\x20--paths\x20requires\x20--yes\x20for\x20execution.',_0xb49ce5(0x1c6));if(!isInteractive()&&_0x3b4729)throw CliErrors['validation'](_0xb49ce5(0x1a0),_0xb49ce5(0x1c6));requireInteractive();const _0x19cb72=startSpinner(_0xb49ce5(0x195));let _0x2d0675,_0xf24ed8,_0x1a45f1;try{const _0x3483f8=await fetchMenuData(_0x549d15[_0xb49ce5(0x1ba)],_0x549d15[_0xb49ce5(0x19c)]);_0x2d0675=_0x3483f8[_0xb49ce5(0x1bd)],_0xf24ed8=_0x3483f8[_0xb49ce5(0x1d3)],_0x1a45f1=_0x3483f8['onlineMenuList'],stopSpinner(_0x19cb72,_0xb49ce5(0x1bf),!![]);}catch(_0x10e3d3){stopSpinner(_0x19cb72,_0xb49ce5(0x1c2),![]);throw CliErrors['validation'](_0x10e3d3 instanceof Error?_0x10e3d3[_0xb49ce5(0x1b5)]:_0xb49ce5(0x1c2));}if(_0x2d0675['length']===0x0)return writeCliSideChannelLine(a131_0x530cb8[_0xb49ce5(0x1d0)](_0xb49ce5(0x1c4))),{'ok':!![]};const _0x1c7caf=buildCompareRows(_0x2d0675,_0xf24ed8);writeCliSideChannelLine(renderCompareTable(_0x1c7caf)),writeCliSideChannelLine('');const _0x327c97=await selectPages(_0x2d0675,_0xf24ed8);writeCliSideChannelLine(''),writeCliSideChannelLine(a131_0x530cb8[_0xb49ce5(0x1b9)](_0xb49ce5(0x1be)+_0x327c97[_0xb49ce5(0x1b8)]+_0xb49ce5(0x1a1)));const _0x402946=_0x4d50bf[_0xb49ce5(0x1a4)]&&_0x4d50bf[_0xb49ce5(0x1c7)];if(!_0x402946){writeCliSideChannelLine(renderSyncSummary(_0x327c97,_0xf24ed8[_0xb49ce5(0x1d9)]>0x0));const _0x1474ba=await askConfirm(_0xb49ce5(0x1ab));if(!_0x1474ba)return writeCliSideChannelLine(a131_0x530cb8[_0xb49ce5(0x1d1)](_0xb49ce5(0x19f))),{'ok':!![]};}let _0x343813=_0x4d50bf[_0xb49ce5(0x1a4)],_0x4fd0c4=_0x4d50bf[_0xb49ce5(0x1c7)];!_0x343813&&(_0x343813=await askJsUrl());!_0x4fd0c4&&(_0x4fd0c4=await askCssUrl());const _0x4969f3=await askConfirm(_0xb49ce5(0x1b6)+_0x327c97['length']+_0xb49ce5(0x1a3)+_0x343813+'\x20and\x20CSS:\x20'+_0x4fd0c4+'?');if(!_0x4969f3)return writeCliSideChannelLine(a131_0x530cb8['gray']('\x20\x20Cancelled.')),{'ok':!![]};const _0x112685=[_0x343813,_0x4fd0c4],_0xcbfc30=startSpinner(_0xb49ce5(0x1a6)+_0x327c97['length']+_0xb49ce5(0x1a9));try{const _0x12ae3f=await doCreateMenus(_0x549d15[_0xb49ce5(0x1ba)],_0x549d15[_0xb49ce5(0x19c)],_0x327c97,_0x112685);return stopSpinner(_0xcbfc30,_0xb49ce5(0x1a8)+_0x12ae3f[_0xb49ce5(0x19d)]+_0xb49ce5(0x1ac),!![]),{'ok':!![],'data':_0x12ae3f,'message':_0xb49ce5(0x1b7)+_0x12ae3f[_0xb49ce5(0x19d)]+_0xb49ce5(0x1d5)+_0x12ae3f['failed']+_0xb49ce5(0x1c0)};}catch(_0x4abbce){stopSpinner(_0xcbfc30,_0xb49ce5(0x1a5),![]);throw CliErrors[_0xb49ce5(0x198)](_0x4abbce instanceof Error?_0x4abbce['message']:_0xb49ce5(0x1a5));}}};function ensureRunnableContext(_0x3f8c5e,_0x27dc84){const _0xf21f7f=a131_0x29608f,_0x30e7f5=_0x3f8c5e[_0xf21f7f(0x19e)]?String(_0x3f8c5e['appcode'])[_0xf21f7f(0x1ad)]():'';if(!isInProject()&&!_0x27dc84&&!_0x30e7f5)throw CliErrors['validation'](_0xf21f7f(0x1c1)+_0xf21f7f(0x1d6));}function parsePaths(_0x50d73a){const _0x23c126=a131_0x29608f;return[...new Set(_0x50d73a[_0x23c126(0x192)](',')['map'](_0x60cf29=>_0x60cf29[_0x23c126(0x1ad)]())[_0x23c126(0x194)](Boolean))];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a132_0x331a(){const _0x572486=['join','length','2660sQJjMl','FEISHU','235410hkSwkF','read','validation','type','129eztGhd','Found\x20','EMAIL','string','notification','Invalid\x20--type:\x20','44rsQJRf','WEBHOOK','Allowed\x20values:\x20','str','Notification\x20channel\x20type','396NeFPlt','number','316QXLXQr','WECOM','createTime','updateTime','293720FHphJe','List\x20app-level\x20notification\x20configs\x20and\x20their\x20configCode\x20values','Invalid\x20notification\x20config\x20response.','trim','9778weoElA','7EJrbMK','\x20notification\x20config(s)','config-list','Item\x20','map','configName','4531680voEIdH','configCode','apiError','1496202PUlKWL','description','1832zcgyqc','appCode'];a132_0x331a=function(){return _0x572486;};return a132_0x331a();}const a132_0x317ce4=a132_0x4230;(function(_0x19ec0a,_0x238f4a){const _0x1b0dc6=a132_0x4230,_0x4a5c65=_0x19ec0a();while(!![]){try{const _0x35dbbf=-parseInt(_0x1b0dc6(0xe1))/0x1+-parseInt(_0x1b0dc6(0xe5))/0x2*(parseInt(_0x1b0dc6(0xd0))/0x3)+-parseInt(_0x1b0dc6(0xdd))/0x4*(parseInt(_0x1b0dc6(0xf5))/0x5)+parseInt(_0x1b0dc6(0xef))/0x6*(parseInt(_0x1b0dc6(0xe6))/0x7)+parseInt(_0x1b0dc6(0xf1))/0x8*(-parseInt(_0x1b0dc6(0xdb))/0x9)+-parseInt(_0x1b0dc6(0xf7))/0xa*(-parseInt(_0x1b0dc6(0xd6))/0xb)+parseInt(_0x1b0dc6(0xec))/0xc;if(_0x35dbbf===_0x238f4a)break;else _0x4a5c65['push'](_0x4a5c65['shift']());}catch(_0x3da30f){_0x4a5c65['push'](_0x4a5c65['shift']());}}}(a132_0x331a,0x28500));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a132_0x4230(_0x526a39,_0x566b6d){_0x526a39=_0x526a39-0xcf;const _0x331ae3=a132_0x331a();let _0x423023=_0x331ae3[_0x526a39];return _0x423023;}import{listNotificationChannelConfigs}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const NOTIFICATION_CHANNEL_TYPES=[a132_0x317ce4(0xd2),a132_0x317ce4(0xf6),'DINGTALK',a132_0x317ce4(0xde),a132_0x317ce4(0xd7)];export const notificationConfigList={'service':a132_0x317ce4(0xd4),'command':a132_0x317ce4(0xe8),'description':a132_0x317ce4(0xe2),'risk':a132_0x317ce4(0xf8),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a132_0x317ce4(0xcf),'type':a132_0x317ce4(0xd3),'description':a132_0x317ce4(0xda),'enum':NOTIFICATION_CHANNEL_TYPES,'default':a132_0x317ce4(0xd2)}],async 'validate'(_0xa0e32){readChannelType(_0xa0e32);},async 'execute'(_0x5b7a1e){const _0x2e5496=a132_0x317ce4,_0x2cb670=readChannelType(_0x5b7a1e),_0x3369af=await listNotificationChannelConfigs(_0x5b7a1e[_0x2e5496(0xf2)],_0x2cb670),_0x540d7e=_0x3369af[_0x2e5496(0xea)](projectNotificationConfig);return{'ok':!![],'data':{'appCode':_0x5b7a1e['appCode'],'channelType':_0x2cb670,'count':_0x540d7e[_0x2e5496(0xf4)],'configs':_0x540d7e},'message':_0x2e5496(0xd1)+_0x540d7e[_0x2e5496(0xf4)]+'\x20'+_0x2cb670+_0x2e5496(0xe7)};}};function readChannelType(_0x3ddf2b){const _0x4ce01f=a132_0x317ce4,_0xa013d2=_0x3ddf2b[_0x4ce01f(0xd9)](_0x4ce01f(0xcf))['trim']()||'EMAIL';if(!NOTIFICATION_CHANNEL_TYPES['includes'](_0xa013d2))throw CliErrors[_0x4ce01f(0xf9)](_0x4ce01f(0xd5)+_0xa013d2,_0x4ce01f(0xd8)+NOTIFICATION_CHANNEL_TYPES[_0x4ce01f(0xf3)](',\x20')+'.');return _0xa013d2;}function projectNotificationConfig(_0x2683d0,_0x58cc6f){const _0x3ad83a=a132_0x317ce4;return{'id':typeof _0x2683d0['id']===_0x3ad83a(0xdc)?_0x2683d0['id']:null,'configCode':requireConfigString(_0x2683d0,_0x3ad83a(0xed),_0x58cc6f),'configName':requireConfigString(_0x2683d0,_0x3ad83a(0xeb),_0x58cc6f),'channelType':requireConfigString(_0x2683d0,'channelType',_0x58cc6f),'description':normalizeNullableString(_0x2683d0[_0x3ad83a(0xf0)]),'createTime':normalizeNullableString(_0x2683d0[_0x3ad83a(0xdf)]),'updateTime':normalizeNullableString(_0x2683d0[_0x3ad83a(0xe0)])};}function requireConfigString(_0x5759eb,_0x40c014,_0x2762bf){const _0x49b587=a132_0x317ce4,_0x238e8a=_0x5759eb[_0x40c014];if(typeof _0x238e8a!==_0x49b587(0xd3)||_0x238e8a[_0x49b587(0xe4)]()==='')throw CliErrors[_0x49b587(0xee)](_0x49b587(0xe3),_0x49b587(0xe9)+(_0x2762bf+0x1)+'\x20is\x20missing\x20required\x20field\x20\x22'+_0x40c014+'\x22.');return _0x238e8a[_0x49b587(0xe4)]();}function normalizeNullableString(_0x19c17e){const _0x3f17ae=a132_0x317ce4;return typeof _0x19c17e===_0x3f17ae(0xd3)?_0x19c17e:null;}
|