@lovrabet/rabetbase-cli 2.4.4-beta.1 → 2.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/react/create.js +1 -1
- package/lib/commands/page/react/detail.js +1 -1
- package/lib/commands/page/react/list.js +1 -1
- package/lib/commands/page/react/publish.js +1 -1
- package/lib/commands/page/react/shared.js +1 -1
- package/lib/commands/page/react/syntax.js +1 -1
- package/lib/commands/page/react/template.js +1 -1
- package/lib/commands/page/react/update.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-apis-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.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.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/rabetbase/SKILL.md +1 -1
- package/skills/rabetbase.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3cecbe,_0x3cfec3){const _0x43807c=a122_0x1f74,_0x2f7580=_0x3cecbe();while(!![]){try{const _0x4be366=-parseInt(_0x43807c(0x1c1))/0x1*(parseInt(_0x43807c(0x19b))/0x2)+-parseInt(_0x43807c(0x19f))/0x3+-parseInt(_0x43807c(0x19d))/0x4+parseInt(_0x43807c(0x1c3))/0x5+-parseInt(_0x43807c(0x195))/0x6*(parseInt(_0x43807c(0x1b0))/0x7)+parseInt(_0x43807c(0x19c))/0x8+parseInt(_0x43807c(0x1a6))/0x9*(parseInt(_0x43807c(0x1c0))/0xa);if(_0x4be366===_0x3cfec3)break;else _0x2f7580['push'](_0x2f7580['shift']());}catch(_0x8c6bc){_0x2f7580['push'](_0x2f7580['shift']());}}}(a122_0x4edd,0xb298b));import{createHash}from'node:crypto';import{getMenuTree}from'../../../core/api-client.js';export async function fetchMenuSnapshot(_0xf79544,_0xfcd2ca,_0x252228={}){const _0x444bcd=a122_0x1f74,_0x1f6850=await getMenuTree(_0xf79544,_0xfcd2ca);return buildMenuSnapshot(Array[_0x444bcd(0x199)](_0x1f6850)?_0x1f6850:[],_0x252228);}export function buildMenuSnapshot(_0x963f7c,_0x57302c={}){const _0x11cd31=a122_0x1f74,_0x29aed8=flattenMenuItems(_0x963f7c,{'verbose':_0x57302c[_0x11cd31(0x1aa)]===!![],'parentId':null,'depth':0x0}),_0x3e2834=new Map(_0x29aed8[_0x11cd31(0x1bb)](_0x17a96e=>[_0x17a96e['id'],_0x17a96e])),_0x17099a=createHash(_0x11cd31(0x1b4))[_0x11cd31(0x1b7)](JSON[_0x11cd31(0x1bf)](_0x29aed8[_0x11cd31(0x1bb)](toHashInput)))['digest'](_0x11cd31(0x196));return{'total':_0x29aed8[_0x11cd31(0x19a)],'hash':_0x11cd31(0x1b3)+_0x17099a,'menus':_0x29aed8,'byId':_0x3e2834};}export function toProcessedMenuItem(_0x38c8e2){const _0x575e3a=a122_0x1f74;return{'id':_0x38c8e2['id'],'path':_0x38c8e2[_0x575e3a(0x1c2)],'label':_0x38c8e2[_0x575e3a(0x1ac)],'resources':[..._0x38c8e2['resources']],'extend':_0x38c8e2[_0x575e3a(0x1b2)]??null};}export function toMenuListItem(_0x47eadb){const {modelType:_0x5896e3,datasetId:_0x1c55c5,datasetCode:_0x4a1da1,resourcesValid:_0x4e91e4,..._0x3a4a23}=_0x47eadb;return _0x3a4a23;}export function getChildren(_0x2ed320,_0x71a3e7){const _0xe31c94=a122_0x1f74;return _0x2ed320['menus'][_0xe31c94(0x1be)](_0x4770bf=>_0x4770bf[_0xe31c94(0x1b6)]===_0x71a3e7);}function a122_0x4edd(){const _0x4344f3=['7563000qEuYvX','3515056vUrsvN','datasetCode','3254451SkJVYt','parse','pageType','updateUserName','childrenIds','updateTime','string','45ORdnzJ','datasetId','depth','number','verbose','type','label','values','resources','sort','9814126ZiXbxF','push','extend','sha256:','sha256','isFinite','parentId','update','valid','children','pageId','map','item','visible','filter','stringify','6502570pOQitb','196561sJHvOa','path','2450765mhvKeo','updateUserId','index','modelType','POSITIVE_INFINITY','6UutyfP','hex','resourcesValid','url','isArray','length','6GARhOS'];a122_0x4edd=function(){return _0x4344f3;};return a122_0x4edd();}function flattenMenuItems(_0x52dc30,_0x233bd4){const _0x17533d=a122_0x1f74,_0xb7c416=sortMenuItems(_0x52dc30),_0x464695=[];for(const _0x58d95e of _0xb7c416){const _0x1516f8=sortMenuItems(Array[_0x17533d(0x199)](_0x58d95e[_0x17533d(0x1b9)])?_0x58d95e[_0x17533d(0x1b9)]:[]);_0x464695['push'](toMenuFact(_0x58d95e,_0x1516f8,_0x233bd4)),_0x1516f8[_0x17533d(0x19a)]>0x0&&_0x464695[_0x17533d(0x1b1)](...flattenMenuItems(_0x1516f8,{'verbose':_0x233bd4[_0x17533d(0x1aa)],'parentId':_0x58d95e['id'],'depth':_0x233bd4[_0x17533d(0x1a8)]+0x1}));}return _0x464695;}function sortMenuItems(_0x478bce){const _0x390039=a122_0x1f74;return _0x478bce[_0x390039(0x1bb)]((_0x5ca1ea,_0x1558f9)=>({'item':_0x5ca1ea,'index':_0x1558f9}))[_0x390039(0x1af)]((_0x12b17f,_0x5f3e0d)=>{const _0x19495b=_0x390039,_0x484e2b=normalizeSort(_0x12b17f[_0x19495b(0x1bc)][_0x19495b(0x1af)]),_0x10431b=normalizeSort(_0x5f3e0d[_0x19495b(0x1bc)][_0x19495b(0x1af)]);if(_0x484e2b!==_0x10431b)return _0x484e2b-_0x10431b;return _0x12b17f[_0x19495b(0x192)]-_0x5f3e0d['index'];})['map'](({item:_0x536f11})=>_0x536f11);}function toMenuFact(_0x5eb4e1,_0x1117c5,_0x2b03f0){const _0x429db4=a122_0x1f74,_0x100ae4=normalizeResourceValue(_0x5eb4e1[_0x429db4(0x1b2)]?.[_0x429db4(0x1ae)]),_0x48339e={'id':_0x5eb4e1['id'],'parentId':_0x2b03f0[_0x429db4(0x1b6)],'depth':_0x2b03f0['depth'],'label':normalizeString(_0x5eb4e1['label']),'path':normalizeString(_0x5eb4e1[_0x429db4(0x1c2)]),'url':normalizeString(_0x5eb4e1[_0x429db4(0x198)]),'type':normalizeString(_0x5eb4e1['type']),'visible':typeof _0x5eb4e1[_0x429db4(0x1bd)]==='boolean'?_0x5eb4e1[_0x429db4(0x1bd)]:null,'sort':typeof _0x5eb4e1['sort']===_0x429db4(0x1a9)&&Number['isFinite'](_0x5eb4e1[_0x429db4(0x1af)])?_0x5eb4e1['sort']:null,'resources':_0x100ae4['values'],'resourcesValid':_0x100ae4[_0x429db4(0x1b8)],'childrenIds':_0x1117c5[_0x429db4(0x1bb)](_0x2a3ab2=>_0x2a3ab2['id']),'childrenCount':_0x1117c5['length'],'pageId':normalizeNullableNumber(_0x5eb4e1[_0x429db4(0x1ba)]),'pageType':normalizeString(_0x5eb4e1[_0x429db4(0x1a1)]),'modelType':normalizeString(_0x5eb4e1[_0x429db4(0x193)]),'datasetId':normalizeNullableNumber(_0x5eb4e1[_0x429db4(0x1a7)]),'datasetCode':normalizeString(_0x5eb4e1[_0x429db4(0x19e)]),'updateUserId':normalizeNullableString(_0x5eb4e1[_0x429db4(0x1c4)]),'updateUserName':normalizeNullableString(_0x5eb4e1[_0x429db4(0x1a2)]),'updateTime':normalizeNullableTimestamp(_0x5eb4e1[_0x429db4(0x1a4)])};return _0x2b03f0['verbose']&&(_0x48339e[_0x429db4(0x1b2)]=_0x5eb4e1[_0x429db4(0x1b2)]??null),_0x48339e;}function toHashInput(_0x52c28c){const _0x43562a=a122_0x1f74;return{'id':_0x52c28c['id'],'parentId':_0x52c28c['parentId'],'label':_0x52c28c['label'],'path':_0x52c28c[_0x43562a(0x1c2)],'url':_0x52c28c[_0x43562a(0x198)],'type':_0x52c28c[_0x43562a(0x1ab)],'visible':_0x52c28c['visible'],'sort':_0x52c28c[_0x43562a(0x1af)],'resources':_0x52c28c[_0x43562a(0x1ae)],'resourcesValid':_0x52c28c[_0x43562a(0x197)],'childrenIds':_0x52c28c[_0x43562a(0x1a3)],'pageId':_0x52c28c[_0x43562a(0x1ba)],'pageType':_0x52c28c[_0x43562a(0x1a1)],'modelType':_0x52c28c[_0x43562a(0x193)],'datasetId':_0x52c28c[_0x43562a(0x1a7)],'datasetCode':_0x52c28c[_0x43562a(0x19e)],'updateUserId':_0x52c28c[_0x43562a(0x1c4)],'updateUserName':_0x52c28c[_0x43562a(0x1a2)],'updateTime':_0x52c28c[_0x43562a(0x1a4)]};}function normalizeSort(_0x3f99bb){const _0x399049=a122_0x1f74;return typeof _0x3f99bb===_0x399049(0x1a9)&&Number[_0x399049(0x1b5)](_0x3f99bb)?_0x3f99bb:Number[_0x399049(0x194)];}function normalizeString(_0x5acf0d){const _0x2c5145=a122_0x1f74;return typeof _0x5acf0d===_0x2c5145(0x1a5)?_0x5acf0d:'';}function normalizeNullableNumber(_0x1c8a32){const _0x171152=a122_0x1f74;return typeof _0x1c8a32==='number'&&Number[_0x171152(0x1b5)](_0x1c8a32)?_0x1c8a32:null;}function normalizeNullableString(_0xa5ee9d){const _0x2fe352=a122_0x1f74;return typeof _0xa5ee9d===_0x2fe352(0x1a5)&&_0xa5ee9d['length']>0x0?_0xa5ee9d:null;}function a122_0x1f74(_0x214e70,_0x8888e1){_0x214e70=_0x214e70-0x192;const _0x4edd92=a122_0x4edd();let _0x1f740c=_0x4edd92[_0x214e70];return _0x1f740c;}function normalizeNullableTimestamp(_0x5ca5d2){const _0x3547d3=a122_0x1f74;if(typeof _0x5ca5d2===_0x3547d3(0x1a5))return _0x5ca5d2['length']>0x0?_0x5ca5d2:null;return typeof _0x5ca5d2===_0x3547d3(0x1a9)&&Number[_0x3547d3(0x1b5)](_0x5ca5d2)?_0x5ca5d2:null;}export function normalizeResources(_0x147ac8){const _0x22233f=a122_0x1f74;return normalizeResourceValue(_0x147ac8)[_0x22233f(0x1ad)];}function normalizeResourceValue(_0x22fae0){const _0x19dc42=a122_0x1f74;if(_0x22fae0==null)return{'values':[],'valid':!![]};if(Array[_0x19dc42(0x199)](_0x22fae0))return{'values':_0x22fae0[_0x19dc42(0x1bb)](String),'valid':!![]};if(typeof _0x22fae0!=='string')return{'values':[],'valid':![]};try{const _0xedc09a=JSON[_0x19dc42(0x1a0)](_0x22fae0);return Array[_0x19dc42(0x199)](_0xedc09a)?{'values':_0xedc09a[_0x19dc42(0x1bb)](String),'valid':!![]}:{'values':[],'valid':![]};}catch{return{'values':[],'valid':![]};}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xe14061,_0x14831f){var _0x57e50f=a123_0x24b2,_0x343f4e=_0xe14061();while(!![]){try{var _0x4e86b6=parseInt(_0x57e50f(0x7d))/0x1*(parseInt(_0x57e50f(0x7e))/0x2)+-parseInt(_0x57e50f(0x77))/0x3*(-parseInt(_0x57e50f(0x75))/0x4)+-parseInt(_0x57e50f(0x80))/0x5*(-parseInt(_0x57e50f(0x7f))/0x6)+parseInt(_0x57e50f(0x7c))/0x7+-parseInt(_0x57e50f(0x78))/0x8*(parseInt(_0x57e50f(0x76))/0x9)+-parseInt(_0x57e50f(0x7a))/0xa+parseInt(_0x57e50f(0x79))/0xb*(-parseInt(_0x57e50f(0x7b))/0xc);if(_0x4e86b6===_0x14831f)break;else _0x343f4e['push'](_0x343f4e['shift']());}catch(_0x3cc6c6){_0x343f4e['push'](_0x343f4e['shift']());}}}(a123_0x1786,0x75d3c));export*from'../../../commands/menu/shared/types.js';export*from'../../../commands/menu/shared/logic.js';function a123_0x24b2(_0x4633ec,_0x3490d3){_0x4633ec=_0x4633ec-0x75;var _0x178608=a123_0x1786();var _0x24b263=_0x178608[_0x4633ec];return _0x24b263;}export*from'../../../commands/menu/shared/compare-table.js';export*from'../../../commands/menu/shared/inquirer.js';function a123_0x1786(){var _0x56980e=['196lPAMaa','15534IkSRQO','34509wfCcCT','2072xWlNea','22RDJqGL','2482670xfaPTL','4337028fLnwMY','2720438dXvGlE','29qYTTUw','56138bsiqHN','42CmzojY','96055nIgnQI'];a123_0x1786=function(){return _0x56980e;};return a123_0x1786();}export*from'../../../commands/menu/shared/valid-url.js';export*from'../../../commands/menu/shared/local-pages.js';export*from'../../../commands/menu/shared/service.js';export*from'../../../commands/menu/shared/sync-core.js';export*from'../../../commands/menu/shared/update-core.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4ace9c,_0x543f69){const _0x2e0be8=a124_0xf493,_0x1ace1c=_0x4ace9c();while(!![]){try{const _0x3c3bb0=parseInt(_0x2e0be8(0x1cd))/0x1+parseInt(_0x2e0be8(0x1d0))/0x2+-parseInt(_0x2e0be8(0x1b3))/0x3+parseInt(_0x2e0be8(0x1c7))/0x4*(-parseInt(_0x2e0be8(0x1b2))/0x5)+-parseInt(_0x2e0be8(0x1c5))/0x6+-parseInt(_0x2e0be8(0x1b8))/0x7*(parseInt(_0x2e0be8(0x1d1))/0x8)+parseInt(_0x2e0be8(0x1c6))/0x9;if(_0x3c3bb0===_0x543f69)break;else _0x1ace1c['push'](_0x1ace1c['shift']());}catch(_0x5c9a55){_0x1ace1c['push'](_0x1ace1c['shift']());}}}(a124_0x1d89,0xb44a1));function a124_0xf493(_0x15beb1,_0x593c05){_0x15beb1=_0x15beb1-0x1aa;const _0x1d89c9=a124_0x1d89();let _0xf493=_0x1d89c9[_0x15beb1];return _0xf493;}import a124_0x2098c7 from'chalk';import{checkbox,input,confirm}from'@inquirer/prompts';import a124_0xdb90ad from'ora';import{isUrlReachable}from'../../../commands/menu/shared/valid-url.js';import{CliErrors}from'../../../errors.js';function onCancel(_0x443365){const _0x47e7a2=a124_0xf493;return _0x443365[_0x47e7a2(0x1ad)](_0x1a9360=>{const _0x2afacb=_0x47e7a2;if(_0x1a9360?.[_0x2afacb(0x1cf)]===_0x2afacb(0x1b6))throw CliErrors[_0x2afacb(0x1b4)]('Cancelled.');throw _0x1a9360;});}export function startSpinner(_0x3b7cc9){const _0x46d68a=a124_0xf493;return a124_0xdb90ad({'text':_0x3b7cc9,'color':_0x46d68a(0x1ab)})[_0x46d68a(0x1c1)]();}export function stopSpinner(_0x5c8d51,_0x573a5b,_0x48fee6){_0x48fee6?_0x5c8d51['succeed'](_0x573a5b):_0x5c8d51['fail'](_0x573a5b);}export async function askConfirm(_0x52e26e){return onCancel(confirm({'message':_0x52e26e,'theme':{'prefix':''}}));}export async function askJsUrl(_0x5c8980){const _0x4a4c96=a124_0xf493;while(!![]){const _0x234e2d=await onCancel(input({'message':_0x4a4c96(0x1d3),'default':_0x5c8980,'theme':{'prefix':''}}));if(_0x234e2d['trim']()==='')throw CliErrors[_0x4a4c96(0x1b4)](_0x4a4c96(0x1d4));if(!/^https:\/\/.+\.js(\?.*)?$/[_0x4a4c96(0x1c8)](_0x234e2d['trim']())){console[_0x4a4c96(0x1c3)](a124_0x2098c7[_0x4a4c96(0x1ba)](_0x4a4c96(0x1d2)));continue;}const _0x268d8f=startSpinner(_0x4a4c96(0x1ae));try{const _0x3b5b8b=await isUrlReachable(_0x234e2d[_0x4a4c96(0x1c2)]());stopSpinner(_0x268d8f,_0x4a4c96(0x1c0),_0x3b5b8b);if(!_0x3b5b8b){console[_0x4a4c96(0x1c3)](a124_0x2098c7[_0x4a4c96(0x1ba)](_0x4a4c96(0x1ce)));continue;}return _0x234e2d['trim']();}catch(_0x2b9dc6){stopSpinner(_0x268d8f,_0x4a4c96(0x1bb),![]);throw _0x2b9dc6;}}}export async function askCssUrl(_0xf5f74d){const _0x17b1a4=a124_0xf493;while(!![]){const _0x4cec7b=await onCancel(input({'message':_0x17b1a4(0x1d5),'default':_0xf5f74d,'theme':{'prefix':''}}));if(_0x4cec7b[_0x17b1a4(0x1c2)]()==='')throw CliErrors['cancelled'](_0x17b1a4(0x1d4));if(!/^https:\/\/.+\.css(\?.*)?$/[_0x17b1a4(0x1c8)](_0x4cec7b[_0x17b1a4(0x1c2)]())){console[_0x17b1a4(0x1c3)](a124_0x2098c7[_0x17b1a4(0x1ba)](_0x17b1a4(0x1bc)));continue;}const _0x1be288=startSpinner('\x20\x20Checking\x20CSS\x20URL\x20reachability...');try{const _0x5ce0c3=await isUrlReachable(_0x4cec7b[_0x17b1a4(0x1c2)]());stopSpinner(_0x1be288,_0x17b1a4(0x1b1),_0x5ce0c3);if(!_0x5ce0c3){console[_0x17b1a4(0x1c3)](a124_0x2098c7[_0x17b1a4(0x1ba)](_0x17b1a4(0x1bd)));continue;}return _0x4cec7b[_0x17b1a4(0x1c2)]();}catch(_0x45c02a){stopSpinner(_0x1be288,_0x17b1a4(0x1be),![]);throw _0x45c02a;}}}export async function selectPages(_0x273a0c,_0x392610){const _0x4fd426=a124_0xf493,_0x2a4ecc=_0x273a0c[_0x4fd426(0x1b0)](_0x466ea6=>{const _0x445679=_0x4fd426,_0x16dd00=_0x392610[_0x445679(0x1c4)](_0x466ea6[_0x445679(0x1b9)]);return{'name':_0x466ea6[_0x445679(0x1b7)]+'\x20\x20'+a124_0x2098c7[_0x445679(0x1b5)](_0x466ea6[_0x445679(0x1b9)])+'\x20\x20'+(_0x16dd00?a124_0x2098c7[_0x445679(0x1b5)](_0x445679(0x1af)):a124_0x2098c7['green'](_0x445679(0x1c9))),'value':_0x466ea6[_0x445679(0x1b9)],'checked':!_0x16dd00,'disabled':_0x16dd00};});if(_0x2a4ecc[_0x4fd426(0x1ca)]===0x0)throw new Error(_0x4fd426(0x1bf));const _0x4ecff0=await onCancel(checkbox({'message':'\x20\x20Select\x20menus\x20to\x20sync\x20(space\x20to\x20toggle,\x20a=all,\x20i=invert):','choices':_0x2a4ecc,'loop':![],'theme':{'prefix':''}}));if(_0x4ecff0[_0x4fd426(0x1ca)]===0x0)throw new Error(_0x4fd426(0x1aa));return _0x273a0c[_0x4fd426(0x1ac)](_0x55a31a=>_0x4ecff0[_0x4fd426(0x1cb)](_0x55a31a[_0x4fd426(0x1b9)]));}export function isInteractive(){return process['stdin']['isTTY']===!![];}function a124_0x1d89(){const _0x241374=['\x20\x20Checking\x20JS\x20URL\x20reachability...','[already\x20on\x20platform]','map','CSS\x20URL\x20checked','135vHOGDw','3158511bCWevl','cancelled','gray','ExitPromptError','label','10010qFBWlj','path','red','JS\x20URL\x20check\x20failed','\x20\x20✗\x20CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','\x20\x20✗\x20CSS\x20URL\x20is\x20unreachable','CSS\x20URL\x20check\x20failed','No\x20local\x20pages\x20found.','JS\x20URL\x20checked','start','trim','error','has','2615250peXxsz','10358685aKiJAa','3132Kdpldf','test','[new]','length','includes','Use\x20--yes\x20to\x20run\x20in\x20non-interactive\x20mode,\x20or\x20pipe\x20data\x20via\x20--params.','1111685QrvrXv','\x20\x20✗\x20JS\x20URL\x20is\x20unreachable','name','912276kbvHMY','2632dBchZQ','\x20\x20✗\x20JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','\x20\x20JS\x20URL:','Cancelled.','\x20\x20CSS\x20URL:','No\x20menus\x20selected.','cyan','filter','catch'];a124_0x1d89=function(){return _0x241374;};return a124_0x1d89();}export function requireInteractive(){const _0x422ca1=a124_0xf493;if(!isInteractive())throw new Error('This\x20command\x20requires\x20an\x20interactive\x20terminal.\x20'+_0x422ca1(0x1cc));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a125_0x4b274b=a125_0x47ca;(function(_0xd57b48,_0xb91f02){const _0x126bf3=a125_0x47ca,_0x265d46=_0xd57b48();while(!![]){try{const _0x7632a1=parseInt(_0x126bf3(0xbf))/0x1+parseInt(_0x126bf3(0xc3))/0x2*(-parseInt(_0x126bf3(0xca))/0x3)+parseInt(_0x126bf3(0xc8))/0x4+parseInt(_0x126bf3(0xcf))/0x5*(parseInt(_0x126bf3(0xcb))/0x6)+-parseInt(_0x126bf3(0xbe))/0x7+-parseInt(_0x126bf3(0xd3))/0x8*(-parseInt(_0x126bf3(0xb9))/0x9)+parseInt(_0x126bf3(0xc5))/0xa*(-parseInt(_0x126bf3(0xcd))/0xb);if(_0x7632a1===_0xb91f02)break;else _0x265d46['push'](_0x265d46['shift']());}catch(_0x13ccb9){_0x265d46['push'](_0x265d46['shift']());}}}(a125_0x2bea,0x7ed96));function a125_0x47ca(_0x5745d2,_0x13f3b7){_0x5745d2=_0x5745d2-0xb9;const _0x2bea20=a125_0x2bea();let _0x47ca5b=_0x2bea20[_0x5745d2];return _0x47ca5b;}import{readdirSync,statSync,readFileSync}from'fs';import{join,relative,resolve,sep}from'path';const pagesDir=resolve(process[a125_0x4b274b(0xc2)](),'src/pages');export function extractTitleFromComment(_0x4cfa4c){const _0x2bbb4a=a125_0x4b274b;try{const _0x4d6431=readFileSync(_0x4cfa4c,_0x2bbb4a(0xbb)),_0x383dac=_0x4d6431['match'](/^\s*\/\*\*?([\s\S]*?)\*\//);if(_0x383dac&&_0x383dac[0x1]){const _0x94490b=_0x383dac[0x1],_0x12c4ad=_0x94490b[_0x2bbb4a(0xc7)](/^\s*\*?\s*title\s*:\s*(.+)/im);if(_0x12c4ad&&_0x12c4ad[0x1])return _0x12c4ad[0x1][_0x2bbb4a(0xcc)]();}let _0x563e4f=null;const _0x5dfce7=_0x4d6431[_0x2bbb4a(0xc7)](/export\s+default\s+([A-Z][a-zA-Z0-9]*)/);_0x5dfce7&&_0x5dfce7[0x1]&&(_0x563e4f=_0x5dfce7[0x1]);if(!_0x563e4f){const _0x140681=_0x4d6431[_0x2bbb4a(0xc7)](/export\s+default\s+function\s+([A-Z][a-zA-Z0-9]*)/);_0x140681&&_0x140681[0x1]&&(_0x563e4f=_0x140681[0x1]);}if(_0x563e4f){const _0x3a124d=new RegExp('\x5cb'+_0x563e4f+'\x5c.displayName\x5cs*=\x5cs*[\x22\x27]([^\x22\x27]+)[\x22\x27]'),_0x4f3136=_0x4d6431[_0x2bbb4a(0xc7)](_0x3a124d);if(_0x4f3136&&_0x4f3136[0x1])return _0x4f3136[0x1];return _0x563e4f;}return null;}catch(_0x5251fb){return null;}}function a125_0x2bea(){const _0x4a11c3=['isDirectory','.tsx','cwd','82FWZdil','path','1136330oZsNQh','join','match','2214400JhriwN','filter','5979tEQJVS','3258QJYEDa','trim','44SRozxO','replace','475QaVrbd','push','endsWith','split','4744nuBxCb','657YLqDGx','forEach','utf-8','concat','slice','1723302WVyura','653531wPyYPW'];a125_0x2bea=function(){return _0x4a11c3;};return a125_0x2bea();}export function getLocalPages(_0x3047d8=pagesDir,_0x1e3f28=pagesDir){const _0x260202=a125_0x4b274b;let _0x4877b3=[];const _0x362d5f=readdirSync(_0x3047d8);return _0x362d5f[_0x260202(0xba)](_0x157c19=>{const _0x5c100c=_0x260202,_0x5bffe0=join(_0x3047d8,_0x157c19),_0x5dcb44=statSync(_0x5bffe0);if(_0x5dcb44&&_0x5dcb44[_0x5c100c(0xc0)]())_0x4877b3=_0x4877b3[_0x5c100c(0xbc)](getLocalPages(_0x5bffe0,_0x1e3f28));else{if(_0x157c19[_0x5c100c(0xd1)](_0x5c100c(0xc1))){let _0xf69f02=relative(_0x1e3f28,_0x5bffe0);_0xf69f02[_0x5c100c(0xd1)]('index.tsx')?_0xf69f02=_0xf69f02[_0x5c100c(0xce)](/index\.tsx$/,''):_0xf69f02=_0xf69f02['replace'](/\.tsx$/,'');_0xf69f02[_0x5c100c(0xd1)](sep)&&(_0xf69f02=_0xf69f02[_0x5c100c(0xbd)](0x0,-0x1));const _0x58e20f=_0xf69f02[_0x5c100c(0xd2)](sep)[_0x5c100c(0xc6)]('/'),_0x2d36e1=extractTitleFromComment(_0x5bffe0),_0x5e0119=_0x2d36e1||_0x58e20f;_0x4877b3[_0x5c100c(0xd0)]({'path':_0x58e20f['replaceAll']('$',':'),'label':_0x5e0119});}}}),_0x4877b3[_0x260202(0xc9)](_0x275ae0=>_0x275ae0[_0x260202(0xc4)]!=='');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x190d1a,_0x3a8dc7){const _0x44373c=a126_0x2cbe,_0x3b0af4=_0x190d1a();while(!![]){try{const _0x1a291d=parseInt(_0x44373c(0x1be))/0x1*(parseInt(_0x44373c(0x1b8))/0x2)+-parseInt(_0x44373c(0x1c7))/0x3*(parseInt(_0x44373c(0x1c1))/0x4)+-parseInt(_0x44373c(0x1c0))/0x5*(parseInt(_0x44373c(0x1bd))/0x6)+-parseInt(_0x44373c(0x1bc))/0x7*(-parseInt(_0x44373c(0x1ca))/0x8)+-parseInt(_0x44373c(0x1c4))/0x9+parseInt(_0x44373c(0x1c3))/0xa+-parseInt(_0x44373c(0x1c2))/0xb*(-parseInt(_0x44373c(0x1c9))/0xc);if(_0x1a291d===_0x3a8dc7)break;else _0x3b0af4['push'](_0x3b0af4['shift']());}catch(_0x4523b6){_0x3b0af4['push'](_0x3b0af4['shift']());}}}(a126_0x34bf,0xb4674));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(_0x16d170){const _0x415330=a126_0x2cbe,_0x552934=[];return!isValidJsHttpsUrl(_0x16d170)&&_0x552934['push']('JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL'),{'ok':_0x552934[_0x415330(0x1c8)]===0x0,'errors':_0x552934};}export function validateCssUrl(_0x54934d){const _0x175db1=a126_0x2cbe,_0x1ff4fd=[];return!isValidCssHttpsUrl(_0x54934d)&&_0x1ff4fd[_0x175db1(0x1bf)](_0x175db1(0x1c6)),{'ok':_0x1ff4fd[_0x175db1(0x1c8)]===0x0,'errors':_0x1ff4fd};}export async function validateJsUrlReachable(_0x2a228e){const _0x21f145=a126_0x2cbe,_0x3b21e5=validateJsUrl(_0x2a228e);if(!_0x3b21e5['ok'])return _0x3b21e5;const _0x2afd1f=await isUrlReachable(_0x2a228e);if(!_0x2afd1f)_0x3b21e5[_0x21f145(0x1ba)][_0x21f145(0x1bf)](_0x21f145(0x1b7));return{'ok':_0x3b21e5[_0x21f145(0x1ba)]['length']===0x0,'errors':_0x3b21e5[_0x21f145(0x1ba)]};}function a126_0x34bf(){const _0x490254=['6JkqItb','has','errors','path','1526vAexDv','6376872fEupxi','416015wemHWK','push','5pBkyqI','13868VHbnqn','22nrbIYM','11032190yTTnNN','6968682SFFIjZ','map','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','318XlHumm','length','549204qaWJRX','18376xftlug','label','JS\x20URL\x20is\x20unreachable'];a126_0x34bf=function(){return _0x490254;};return a126_0x34bf();}export async function validateCssUrlReachable(_0x18bccd){const _0x1b0ac8=a126_0x2cbe,_0xe06581=validateCssUrl(_0x18bccd);if(!_0xe06581['ok'])return _0xe06581;const _0x6dbed8=await isUrlReachable(_0x18bccd);if(!_0x6dbed8)_0xe06581[_0x1b0ac8(0x1ba)][_0x1b0ac8(0x1bf)]('CSS\x20URL\x20is\x20unreachable');return{'ok':_0xe06581[_0x1b0ac8(0x1ba)][_0x1b0ac8(0x1c8)]===0x0,'errors':_0xe06581[_0x1b0ac8(0x1ba)]};}export function buildCompareRows(_0xb00901,_0x68f85d){const _0x5890bc=a126_0x2cbe;return _0xb00901[_0x5890bc(0x1c5)](_0x19b95e=>({'label':_0x19b95e[_0x5890bc(0x1b6)],'path':_0x19b95e[_0x5890bc(0x1bb)],'local':!![],'online':_0x68f85d[_0x5890bc(0x1b9)](_0x19b95e['path'])}));}export async function doCreateMenus(_0x1b2f8b,_0x1d391b,_0x561a6c,_0x41f872){const _0x59a998=a126_0x2cbe,_0x2d8b92=await createMenus(_0x1b2f8b,_0x1d391b,_0x561a6c,_0x41f872);return{'created':_0x2d8b92[_0x59a998(0x1c8)],'failed':0x0,'labels':_0x561a6c[_0x59a998(0x1c5)](_0x270a7f=>_0x270a7f[_0x59a998(0x1b6)]),'menus':_0x2d8b92};}function a126_0x2cbe(_0x5f1033,_0x16a818){_0x5f1033=_0x5f1033-0x1b6;const _0x34bfaf=a126_0x34bf();let _0x2cbec5=_0x34bfaf[_0x5f1033];return _0x2cbec5;}export function filterMenusWithResources(_0x2d2192){const _0x4f21d5=a126_0x2cbe;return _0x2d2192['filter'](_0x5726b8=>_0x5726b8['resources'][_0x4f21d5(0x1c8)]>0x0);}export async function fetchMenuData(_0x48e8ba,_0x29c2b1){const _0x4c7982=a126_0x2cbe,_0x2504fe=getLocalPages(),_0x502dd5=await getOnlineMenuList(_0x48e8ba,_0x29c2b1),_0x3f21b7=new Set(_0x502dd5[_0x4c7982(0x1c5)](_0x1cf2e3=>_0x1cf2e3['path']));return{'localPages':_0x2504fe,'onlineMenuList':_0x502dd5,'onlinePaths':_0x3f21b7};}export async function fetchOnlineMenuList(_0x201f89,_0x31bc6d){return getOnlineMenuList(_0x201f89,_0x31bc6d);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a127_0x2b5dc7=a127_0x2019;(function(_0x26c920,_0x64c708){const _0x1a032e=a127_0x2019,_0x134155=_0x26c920();while(!![]){try{const _0x5c5138=-parseInt(_0x1a032e(0x1ff))/0x1*(parseInt(_0x1a032e(0x250))/0x2)+-parseInt(_0x1a032e(0x1f8))/0x3+parseInt(_0x1a032e(0x22d))/0x4*(-parseInt(_0x1a032e(0x257))/0x5)+-parseInt(_0x1a032e(0x244))/0x6+-parseInt(_0x1a032e(0x21a))/0x7*(-parseInt(_0x1a032e(0x217))/0x8)+-parseInt(_0x1a032e(0x230))/0x9+parseInt(_0x1a032e(0x21f))/0xa*(parseInt(_0x1a032e(0x24d))/0xb);if(_0x5c5138===_0x64c708)break;else _0x134155['push'](_0x134155['shift']());}catch(_0x41c913){_0x134155['push'](_0x134155['shift']());}}}(a127_0x3e59,0x366dd));import{CliError,CliErrors}from'../../../errors.js';function a127_0x3e59(){const _0x4a18e9=['Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20to\x20inspect\x20the\x20latest\x20online\x20menu\x20state.','Permission\x20denied\x20while\x20attempting\x20to\x20','map','call','stringify','prototype','code',',\x20or\x20pass\x20an\x20explicit\x20--sort\x20value.','\x20path\x20changed:\x20expected\x20','743496OIuLLH','api_error','after','\x20is\x20type\x20\x22','yes','flagMissing','max','snapshotHash','get','13678423GGCgcn','planFile','Failed\x20to\x20','11826RQMsbF','str','test','menu_sort_overflow','defineProperty','\x20parent\x20changed:\x20expected\x20','hash','25mBBtIw','read\x20online\x20menu\x20facts\x20before\x20','targets','menu_mutation_failed','expected-children-count','menu_confirmation_required','Online\x20menu\x20state\x20changed\x20before\x20','data','menu_sort_invalid','appCode','Menu\x20','toLowerCase','Parent\x20folder\x20id;\x20use\x20root\x20for\x20a\x20root-level\x20node','rawFlags','number','plannedActions','\x20menu\x20','verification','817488eOvbLs','required','Choose\x20a\x20menu\x20whose\x20type\x20is\x20folder,\x20or\x20use\x20root.','menu_parent_not_folder','folder','message','pre-write-recheck','20zLfEmC','num','Reorder\x20sibling\x20menus\x20below\x20','Re-run\x20the\x20command\x20with\x20--dry-run\x20and\x20update\x20the\x20expect\x20flags\x20before\x20retrying.','menu_not_found','before','Exact\x20online\x20menu\x20id','Abort\x20unless\x20the\x20current\x20direct\x20child\x20count\x20matches','bool','childrenCount','parent-id','length','warnings','expect-parent-id','sort','byId','root','failed','error','backend','succeeded','This\x20menu\x20mutation\x20requires\x20explicit\x20--yes.','validation','expect-path','8OprabD','\x20child\x20count\x20changed:\x20expected\x20','Abort\x20unless\x20the\x20current\x20parent\x20id\x20matches;\x20use\x20root\x20for\x20root\x20level','1810081BiXszZ','\x22,\x20not\x20folder.','deleteOrder','Cannot\x20append\x20a\x20','type','10NnPmuf','\x20must\x20be\x20a\x20positive\x20menu\x20id\x20or\x20root.',',\x20current\x20','menu_permission_denied','menu_state_drift','selector','trim','Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20use\x20an\x20exact\x20id\x20from\x20the\x20current\x20app.','path','parentId','Abort\x20unless\x20the\x20current\x20menu\x20path\x20exactly\x20matches','hint','cascade',';\x20the\x20planned\x20snapshot\x20is\x20no\x20longer\x20current.','261204pEgebM','dry-run','string','3941622hONlOj','Choose\x20a\x20sort\x20value\x20within\x20the\x20Java\x20Integer\x20range\x20used\x20by\x20the\x20menu\x20service.','isSafeInteger','unknown','filter','menu_verification_failed','recheck\x20online\x20menu\x20facts\x20before\x20','cookie','The\x20write\x20may\x20already\x20have\x20taken\x20effect.\x20Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20inspect\x20the\x20returned\x20id\x20before\x20retrying.','hasOwnProperty','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.'];a127_0x3e59=function(){return _0x4a18e9;};return a127_0x3e59();}import{fetchMenuSnapshot,getChildren}from'../../../commands/menu/shared/facts.js';export const MAX_MENU_SORT=0x7fffffff;function a127_0x2019(_0x33b244,_0x5276f0){_0x33b244=_0x33b244-0x1f0;const _0x3e599f=a127_0x3e59();let _0x2019e6=_0x3e599f[_0x33b244];return _0x2019e6;}export const MENU_ID_FLAG={'name':'id','type':a127_0x2b5dc7(0x1f4),'required':!![],'description':a127_0x2b5dc7(0x205)};export const MENU_SORT_FLAG={'name':a127_0x2b5dc7(0x20d),'type':a127_0x2b5dc7(0x1f4),'description':'Sibling\x20sort\x20value\x20(non-negative\x20integer)'};export const MENU_PARENT_ID_FLAG={'name':a127_0x2b5dc7(0x209),'type':a127_0x2b5dc7(0x22f),'description':a127_0x2b5dc7(0x1f2)};export const MENU_EXPECT_PARENT_ID_FLAG={'name':'expect-parent-id','type':'string','description':a127_0x2b5dc7(0x219)};export const MENU_EXPECT_FLAGS=[MENU_EXPECT_PARENT_ID_FLAG,{'name':a127_0x2b5dc7(0x216),'type':a127_0x2b5dc7(0x22f),'description':a127_0x2b5dc7(0x229)},{'name':a127_0x2b5dc7(0x25b),'type':a127_0x2b5dc7(0x1f4),'description':a127_0x2b5dc7(0x206)}];export function validateExactId(_0xac832b){const _0x35fd70=a127_0x2b5dc7,_0x19cb95=_0xac832b[_0x35fd70(0x200)]('id');if(!Number['isSafeInteger'](_0x19cb95)||_0x19cb95<=0x0)throw CliErrors['validation']('--id\x20must\x20be\x20a\x20positive\x20integer\x20menu\x20id.');return _0x19cb95;}export function validateSort(_0x5d9108,_0x2d83b4='sort'){const _0x23ba5b=a127_0x2b5dc7;if(!hasFlag(_0x5d9108,_0x2d83b4))return undefined;const _0x25f8e9=_0x5d9108['num'](_0x2d83b4);if(!Number[_0x23ba5b(0x232)](_0x25f8e9)||_0x25f8e9<0x0||_0x25f8e9>MAX_MENU_SORT)throw menuError(_0x23ba5b(0x25f),'--'+_0x2d83b4+'\x20must\x20be\x20an\x20integer\x20between\x200\x20and\x20'+MAX_MENU_SORT+'.',_0x23ba5b(0x231));return _0x25f8e9;}export function nextSiblingSort(_0x4efbc8,_0x12ad85,_0x237297){const _0x104fd8=a127_0x2b5dc7,_0x1f1496=getChildren(_0x4efbc8,_0x12ad85)[_0x104fd8(0x23d)](_0x2061dc=>_0x2061dc['sort'])[_0x104fd8(0x234)](_0x54f9ff=>typeof _0x54f9ff===_0x104fd8(0x1f4));if(_0x1f1496[_0x104fd8(0x20a)]===0x0)return 0x0;const _0xb7886f=Math[_0x104fd8(0x24a)](..._0x1f1496);if(_0xb7886f>=MAX_MENU_SORT)throw menuError(_0x104fd8(0x253),_0x104fd8(0x21d)+_0x237297+'\x20because\x20the\x20current\x20maximum\x20sibling\x20sort\x20is\x20'+_0xb7886f+'.',_0x104fd8(0x201)+MAX_MENU_SORT+_0x104fd8(0x242));return _0xb7886f+0x1;}export function requireExplicitYes(_0x4f97ab){const _0x1ad199=a127_0x2b5dc7;if(_0x4f97ab['bool'](_0x1ad199(0x22e)))return;if(!_0x4f97ab[_0x1ad199(0x207)](_0x1ad199(0x248)))throw menuError(_0x1ad199(0x25c),_0x1ad199(0x214),_0x1ad199(0x23a));}export async function fetchMutationSnapshot(_0x569470,_0x240568,_0x3e974c){const _0xbda81=a127_0x2b5dc7;try{return await fetchMenuSnapshot(_0x569470[_0xbda81(0x260)],_0x569470[_0xbda81(0x237)]);}catch(_0x184291){throw mapMenuApiError(_0x184291,_0xbda81(0x258)+_0x240568,_0x3e974c);}}export async function recheckMutationSnapshot(_0x182d9c,_0x1cd671,_0x5ee075,_0x2c8990){const _0x184ec3=a127_0x2b5dc7;let _0x1edbba;try{_0x1edbba=await fetchMenuSnapshot(_0x182d9c[_0x184ec3(0x260)],_0x182d9c[_0x184ec3(0x237)]);}catch(_0x6193ea){const _0x4a3d66=mapMenuApiError(_0x6193ea,_0x184ec3(0x236)+_0x5ee075,_0x2c8990);throw menuFailure(_0x4a3d66,_0x1cd671,{'stage':_0x184ec3(0x1fe),'failed':_0x2c8990==null?{}:{'id':_0x2c8990}});}if(_0x1edbba[_0x184ec3(0x256)]!==_0x1cd671['snapshotHash']){const _0xa0cbfa=menuError(_0x184ec3(0x223),_0x184ec3(0x25d)+_0x5ee075+_0x184ec3(0x22c),'Run\x20the\x20same\x20command\x20with\x20--dry-run\x20again\x20and\x20review\x20the\x20latest\x20snapshot\x20before\x20retrying.');throw menuFailure(_0xa0cbfa,_0x1cd671,{'stage':_0x184ec3(0x1fe),'failed':{..._0x2c8990==null?{}:{'id':_0x2c8990},'expectedSnapshotHash':_0x1cd671[_0x184ec3(0x24b)],'currentSnapshotHash':_0x1edbba[_0x184ec3(0x256)]}});}return _0x1edbba;}export function parseParentId(_0x3142ef,_0xe785c4,_0x359514={}){const _0x12d9ba=a127_0x2b5dc7;if(!hasFlag(_0x3142ef,_0xe785c4)){if(_0x359514[_0x12d9ba(0x1f9)])throw CliErrors[_0x12d9ba(0x249)](_0xe785c4);return undefined;}const _0x412acb=_0x3142ef[_0x12d9ba(0x251)](_0xe785c4)[_0x12d9ba(0x225)]();if(_0x412acb[_0x12d9ba(0x1f1)]()===_0x12d9ba(0x20f))return null;if(!/^\d+$/[_0x12d9ba(0x252)](_0x412acb))throw CliErrors[_0x12d9ba(0x215)]('--'+_0xe785c4+_0x12d9ba(0x220));const _0x412351=Number(_0x412acb);if(!Number['isSafeInteger'](_0x412351)||_0x412351<=0x0)throw CliErrors[_0x12d9ba(0x215)]('--'+_0xe785c4+_0x12d9ba(0x220));return _0x412351;}export function requireMenu(_0x181f6e,_0x19a352){const _0xd2829a=a127_0x2b5dc7,_0x5d08f1=_0x181f6e[_0xd2829a(0x20e)][_0xd2829a(0x24c)](_0x19a352);if(!_0x5d08f1)throw menuError(_0xd2829a(0x203),'Online\x20menu\x20not\x20found:\x20'+_0x19a352,_0xd2829a(0x226));return _0x5d08f1;}export function requireFolder(_0x28b0e4,_0x984aab){const _0x1ef1bc=a127_0x2b5dc7,_0x5abd5a=requireMenu(_0x28b0e4,_0x984aab);if(_0x5abd5a[_0x1ef1bc(0x21e)]!==_0x1ef1bc(0x1fc))throw menuError(_0x1ef1bc(0x1fb),_0x1ef1bc(0x1f0)+_0x984aab+_0x1ef1bc(0x247)+(_0x5abd5a[_0x1ef1bc(0x21e)]||_0x1ef1bc(0x233))+_0x1ef1bc(0x21b),_0x1ef1bc(0x1fa));return _0x5abd5a;}export function assertExpectedState(_0xda2024,_0xc38bf1){const _0x5d1f74=a127_0x2b5dc7;if(hasFlag(_0xda2024,_0x5d1f74(0x20c))){const _0x2d8c3e=parseParentId(_0xda2024,_0x5d1f74(0x20c),{'required':!![]});if(_0xc38bf1['parentId']!==_0x2d8c3e)throw stateDrift(_0x5d1f74(0x1f0)+_0xc38bf1['id']+_0x5d1f74(0x255)+formatParent(_0x2d8c3e)+_0x5d1f74(0x221)+formatParent(_0xc38bf1[_0x5d1f74(0x228)])+'.');}if(hasFlag(_0xda2024,_0x5d1f74(0x216))){const _0x1132d8=_0xda2024[_0x5d1f74(0x251)](_0x5d1f74(0x216));if(_0xc38bf1[_0x5d1f74(0x227)]!==_0x1132d8)throw stateDrift(_0x5d1f74(0x1f0)+_0xc38bf1['id']+_0x5d1f74(0x243)+JSON['stringify'](_0x1132d8)+_0x5d1f74(0x221)+JSON[_0x5d1f74(0x23f)](_0xc38bf1[_0x5d1f74(0x227)])+'.');}if(hasFlag(_0xda2024,_0x5d1f74(0x25b))){const _0x3cf5ad=_0xda2024[_0x5d1f74(0x200)]('expected-children-count');if(!Number[_0x5d1f74(0x232)](_0x3cf5ad)||_0x3cf5ad<0x0)throw CliErrors[_0x5d1f74(0x215)]('--expected-children-count\x20must\x20be\x20a\x20non-negative\x20integer.');if(_0xc38bf1['childrenCount']!==_0x3cf5ad)throw stateDrift(_0x5d1f74(0x1f0)+_0xc38bf1['id']+_0x5d1f74(0x218)+_0x3cf5ad+_0x5d1f74(0x221)+_0xc38bf1[_0x5d1f74(0x208)]+'.');}}export function assertVerified(_0x2e12a9,_0x2a7e3f,_0x1b4814=a127_0x2b5dc7(0x23b)){if(!_0x2e12a9)throw menuError('menu_verification_failed',_0x2a7e3f,_0x1b4814);}export function mutationResult(_0x3e553d){const _0x27f0b1=a127_0x2b5dc7;return{'operation':_0x3e553d['operation'],'selector':_0x3e553d[_0x27f0b1(0x224)],'before':_0x3e553d[_0x27f0b1(0x204)],'after':_0x3e553d[_0x27f0b1(0x246)],'dryRun':_0x3e553d['dryRun'],'backend':_0x3e553d[_0x27f0b1(0x212)],..._0x3e553d['plannedActions']?{'plannedActions':_0x3e553d[_0x27f0b1(0x1f5)]}:{},..._0x3e553d['targets']?{'targets':_0x3e553d[_0x27f0b1(0x259)]}:{},..._0x3e553d[_0x27f0b1(0x21c)]?{'deleteOrder':_0x3e553d[_0x27f0b1(0x21c)]}:{},'snapshotHash':_0x3e553d['snapshotHash'],..._0x3e553d[_0x27f0b1(0x22b)]?{'cascade':_0x3e553d[_0x27f0b1(0x22b)]}:{},..._0x3e553d[_0x27f0b1(0x24e)]?{'planFile':_0x3e553d[_0x27f0b1(0x24e)]}:{},'succeeded':_0x3e553d[_0x27f0b1(0x213)]??[],'failed':_0x3e553d[_0x27f0b1(0x210)]??[],'warnings':_0x3e553d[_0x27f0b1(0x20b)]??[],'verification':_0x3e553d[_0x27f0b1(0x1f7)],'error':_0x3e553d[_0x27f0b1(0x211)]};}export function menuDryRunResult(_0x1971d6,_0x584542){return{..._0x1971d6,..._0x584542};}export function menuFailure(_0x1b9401,_0x2cfe54,_0x501e53){const _0x55ecc5=a127_0x2b5dc7,_0x203608=mutationResult({..._0x2cfe54,'after':_0x501e53[_0x55ecc5(0x246)]===undefined?_0x2cfe54['after']:_0x501e53[_0x55ecc5(0x246)],'backend':_0x501e53[_0x55ecc5(0x212)]??_0x2cfe54['backend'],'dryRun':![],'succeeded':_0x501e53[_0x55ecc5(0x213)]??[],'failed':[{..._0x501e53[_0x55ecc5(0x210)]??{},'stage':_0x501e53['stage'],'code':_0x1b9401[_0x55ecc5(0x241)],'message':_0x1b9401[_0x55ecc5(0x1fd)]}],'warnings':[..._0x2cfe54['warnings'],..._0x501e53[_0x55ecc5(0x20b)]??[]],'verification':_0x501e53[_0x55ecc5(0x1f7)],'error':{'code':_0x1b9401[_0x55ecc5(0x241)],'message':_0x1b9401[_0x55ecc5(0x1fd)],..._0x1b9401[_0x55ecc5(0x22a)]?{'hint':_0x1b9401[_0x55ecc5(0x22a)]}:{}}});return Object[_0x55ecc5(0x254)](_0x1b9401,_0x55ecc5(0x25e),{'value':_0x203608,'enumerable':!![],'configurable':!![]}),_0x1b9401;}export function asVerificationError(_0x26a781,_0x36a69b){const _0x450de5=a127_0x2b5dc7;if(_0x26a781 instanceof CliError&&_0x26a781['code']==='menu_verification_failed')return _0x26a781;const _0x4de11f=_0x26a781 instanceof Error?_0x26a781[_0x450de5(0x1fd)]:String(_0x26a781);return menuError(_0x450de5(0x235),''+_0x36a69b+(_0x4de11f?':\x20'+_0x4de11f:''),_0x450de5(0x238));}export function describeMenuErrorCause(_0x1d5a09,_0x15aeca,_0x531a12){const _0x180af7=a127_0x2b5dc7,_0x21d1c5=mapMenuApiError(_0x1d5a09,_0x15aeca,_0x531a12);return{'causeCode':_0x21d1c5[_0x180af7(0x241)],'causeMessage':_0x21d1c5[_0x180af7(0x1fd)]};}export function hasFlag(_0x5f102f,_0x37a2d1){const _0x54bfd6=a127_0x2b5dc7;return Object[_0x54bfd6(0x240)][_0x54bfd6(0x239)][_0x54bfd6(0x23e)](_0x5f102f['rawFlags'],_0x37a2d1)&&_0x5f102f[_0x54bfd6(0x1f3)][_0x37a2d1]!==undefined;}export function toApiParentId(_0xda6fa6){return _0xda6fa6??0x0;}export function formatParent(_0x3018e3){const _0x48f718=a127_0x2b5dc7;return _0x3018e3==null?_0x48f718(0x20f):String(_0x3018e3);}export function menuError(_0x283f19,_0x380126,_0x575f40){return new CliError(_0x283f19,0x1,_0x380126,_0x575f40);}export function mapMenuApiError(_0x4196a1,_0x3c9f7b,_0x52ff3c){const _0x4368b1=a127_0x2b5dc7;if(_0x4196a1 instanceof CliError&&_0x4196a1['code']!==_0x4368b1(0x245))return _0x4196a1;const _0x2bff85=_0x4196a1 instanceof Error?_0x4196a1[_0x4368b1(0x1fd)]:String(_0x4196a1);if(/HTTP 403|forbidden|permission|无权限|权限不足|没有权限/i['test'](_0x2bff85))return menuError(_0x4368b1(0x222),_0x4368b1(0x23c)+_0x3c9f7b+(_0x52ff3c?_0x4368b1(0x1f6)+_0x52ff3c:'')+'.','Confirm\x20that\x20the\x20current\x20account\x20can\x20manage\x20menus\x20for\x20this\x20app.');return menuError(_0x4368b1(0x25a),_0x4368b1(0x24f)+_0x3c9f7b+(_0x52ff3c?'\x20menu\x20'+_0x52ff3c:'')+':\x20'+_0x2bff85,'Re-run\x20menu\x20list\x20to\x20inspect\x20the\x20latest\x20online\x20state\x20before\x20retrying.');}export function isMenuResponseLoss(_0x1d8439){const _0x4bb986=a127_0x2b5dc7,_0x1542b2=_0x1d8439 instanceof Error?_0x1d8439[_0x4bb986(0x1fd)]:String(_0x1d8439);if(_0x1d8439 instanceof CliError)return _0x1d8439[_0x4bb986(0x241)]===_0x4bb986(0x245)&&/^Request (?:failed|timeout):/i[_0x4bb986(0x252)](_0x1542b2);return/timeout|timed out|ECONNRESET|socket hang up|network|fetch failed|connection closed|aborted|terminated|unexpected end of JSON|premature close|body stream/i[_0x4bb986(0x252)](_0x1542b2);}function stateDrift(_0x3bc4e2){const _0x5ce2b5=a127_0x2b5dc7;return menuError(_0x5ce2b5(0x223),_0x3bc4e2,_0x5ce2b5(0x202));}
|
|
1
|
+
const a127_0xebbd7a=a127_0x2671;(function(_0x12e6ca,_0x275651){const _0x2c6136=a127_0x2671,_0x1303dc=_0x12e6ca();while(!![]){try{const _0x8ae6d6=-parseInt(_0x2c6136(0x1cc))/0x1+-parseInt(_0x2c6136(0x1d1))/0x2*(-parseInt(_0x2c6136(0x209))/0x3)+parseInt(_0x2c6136(0x1c4))/0x4+parseInt(_0x2c6136(0x20c))/0x5+parseInt(_0x2c6136(0x1e6))/0x6+-parseInt(_0x2c6136(0x1ff))/0x7*(parseInt(_0x2c6136(0x1e1))/0x8)+-parseInt(_0x2c6136(0x1b7))/0x9;if(_0x8ae6d6===_0x275651)break;else _0x1303dc['push'](_0x1303dc['shift']());}catch(_0x2059e2){_0x1303dc['push'](_0x1303dc['shift']());}}}(a127_0x28d9,0x952fc));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':a127_0xebbd7a(0x1fb),'required':!![],'description':'Exact\x20online\x20menu\x20id'};export const MENU_SORT_FLAG={'name':a127_0xebbd7a(0x1bb),'type':a127_0xebbd7a(0x1fb),'description':a127_0xebbd7a(0x1fe)};function a127_0x2671(_0x53a02d,_0xb787b2){_0x53a02d=_0x53a02d-0x1a8;const _0x28d9d5=a127_0x28d9();let _0x2671a9=_0x28d9d5[_0x53a02d];return _0x2671a9;}export const MENU_PARENT_ID_FLAG={'name':a127_0xebbd7a(0x207),'type':'string','description':a127_0xebbd7a(0x1d4)};export const MENU_EXPECT_PARENT_ID_FLAG={'name':'expect-parent-id','type':'string','description':a127_0xebbd7a(0x1f8)};export const MENU_EXPECT_FLAGS=[MENU_EXPECT_PARENT_ID_FLAG,{'name':a127_0xebbd7a(0x1b6),'type':a127_0xebbd7a(0x1b3),'description':'Abort\x20unless\x20the\x20current\x20menu\x20path\x20exactly\x20matches'},{'name':'expected-children-count','type':a127_0xebbd7a(0x1fb),'description':a127_0xebbd7a(0x1dd)}];export function validateExactId(_0x8d27ba){const _0x5afe08=a127_0xebbd7a,_0x13d8a0=_0x8d27ba[_0x5afe08(0x1f6)]('id');if(!Number['isSafeInteger'](_0x13d8a0)||_0x13d8a0<=0x0)throw CliErrors[_0x5afe08(0x201)](_0x5afe08(0x1f2));return _0x13d8a0;}export function validateSort(_0x27b0f0,_0x8b4915=a127_0xebbd7a(0x1bb)){const _0x3b5397=a127_0xebbd7a;if(!hasFlag(_0x27b0f0,_0x8b4915))return undefined;const _0x2d36c6=_0x27b0f0['num'](_0x8b4915);if(!Number['isSafeInteger'](_0x2d36c6)||_0x2d36c6<0x0||_0x2d36c6>MAX_MENU_SORT)throw menuError(_0x3b5397(0x1ea),'--'+_0x8b4915+_0x3b5397(0x1c7)+MAX_MENU_SORT+'.',_0x3b5397(0x1ba));return _0x2d36c6;}export function nextSiblingSort(_0x4de7f6,_0x4f6c75,_0x512e6b){const _0x48c074=a127_0xebbd7a,_0x46a978=getChildren(_0x4de7f6,_0x4f6c75)[_0x48c074(0x1d2)](_0x58fe12=>_0x58fe12[_0x48c074(0x1bb)])[_0x48c074(0x1ab)](_0xfb0ac8=>typeof _0xfb0ac8===_0x48c074(0x1fb));if(_0x46a978[_0x48c074(0x1f9)]===0x0)return 0x0;const _0x36e6b1=Math[_0x48c074(0x20e)](..._0x46a978);if(_0x36e6b1>=MAX_MENU_SORT)throw menuError(_0x48c074(0x1bc),_0x48c074(0x1e7)+_0x512e6b+_0x48c074(0x20d)+_0x36e6b1+'.','Reorder\x20sibling\x20menus\x20below\x20'+MAX_MENU_SORT+_0x48c074(0x1da));return _0x36e6b1+0x1;}export function requireExplicitYes(_0x1a0aaf){const _0x17e130=a127_0xebbd7a;if(_0x1a0aaf['bool']('dry-run'))return;if(!_0x1a0aaf['bool']('yes'))throw menuError(_0x17e130(0x1ae),_0x17e130(0x20a),'Run\x20the\x20same\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.');}export async function fetchMutationSnapshot(_0x4b3bbb,_0x122fda,_0x366552){const _0x36be7d=a127_0xebbd7a;try{return await fetchMenuSnapshot(_0x4b3bbb[_0x36be7d(0x1d0)],_0x4b3bbb[_0x36be7d(0x1bd)]);}catch(_0x10aea8){throw mapMenuApiError(_0x10aea8,'read\x20online\x20menu\x20facts\x20before\x20'+_0x122fda,_0x366552);}}export async function recheckMutationSnapshot(_0x4def58,_0x4f39b8,_0x5b0b25,_0x3b4e31){const _0x294512=a127_0xebbd7a;let _0x2db6f0;try{_0x2db6f0=await fetchMenuSnapshot(_0x4def58[_0x294512(0x1d0)],_0x4def58[_0x294512(0x1bd)]);}catch(_0x13721a){const _0x12ecc7=mapMenuApiError(_0x13721a,_0x294512(0x1fc)+_0x5b0b25,_0x3b4e31);throw menuFailure(_0x12ecc7,_0x4f39b8,{'stage':_0x294512(0x1c0),'failed':_0x3b4e31==null?{}:{'id':_0x3b4e31}});}if(_0x2db6f0[_0x294512(0x1e9)]!==_0x4f39b8[_0x294512(0x1c6)]){const _0xe17a35=menuError(_0x294512(0x1a9),_0x294512(0x1ee)+_0x5b0b25+_0x294512(0x1ed),'Run\x20the\x20same\x20command\x20with\x20--dry-run\x20again\x20and\x20review\x20the\x20latest\x20snapshot\x20before\x20retrying.');throw menuFailure(_0xe17a35,_0x4f39b8,{'stage':_0x294512(0x1c0),'failed':{..._0x3b4e31==null?{}:{'id':_0x3b4e31},'expectedSnapshotHash':_0x4f39b8[_0x294512(0x1c6)],'currentSnapshotHash':_0x2db6f0['hash']}});}return _0x2db6f0;}export function parseParentId(_0x4c2b09,_0x514d33,_0x2788e0={}){const _0x21ba43=a127_0xebbd7a;if(!hasFlag(_0x4c2b09,_0x514d33)){if(_0x2788e0[_0x21ba43(0x1cf)])throw CliErrors['flagMissing'](_0x514d33);return undefined;}const _0x4880ed=_0x4c2b09[_0x21ba43(0x1b5)](_0x514d33)['trim']();if(_0x4880ed[_0x21ba43(0x1d7)]()===_0x21ba43(0x1f0))return null;if(!/^\d+$/['test'](_0x4880ed))throw CliErrors['validation']('--'+_0x514d33+'\x20must\x20be\x20a\x20positive\x20menu\x20id\x20or\x20root.');const _0x571206=Number(_0x4880ed);if(!Number['isSafeInteger'](_0x571206)||_0x571206<=0x0)throw CliErrors[_0x21ba43(0x201)]('--'+_0x514d33+_0x21ba43(0x1e2));return _0x571206;}export function requireMenu(_0x264dbe,_0x5a469b){const _0x1d0a32=a127_0xebbd7a,_0xb68bc5=_0x264dbe[_0x1d0a32(0x1ac)][_0x1d0a32(0x1e4)](_0x5a469b);if(!_0xb68bc5)throw menuError('menu_not_found',_0x1d0a32(0x204)+_0x5a469b,_0x1d0a32(0x208));return _0xb68bc5;}export function requireFolder(_0x49733e,_0x68cd5a){const _0x16f35d=a127_0xebbd7a,_0xd26d56=requireMenu(_0x49733e,_0x68cd5a);if(_0xd26d56[_0x16f35d(0x20f)]!==_0x16f35d(0x1d5))throw menuError(_0x16f35d(0x1c5),'Menu\x20'+_0x68cd5a+_0x16f35d(0x203)+(_0xd26d56[_0x16f35d(0x20f)]||_0x16f35d(0x1df))+_0x16f35d(0x1b4),_0x16f35d(0x1de));return _0xd26d56;}function a127_0x28d9(){const _0xe86efb=['hash','menu_sort_invalid','succeeded','Re-run\x20menu\x20list\x20to\x20inspect\x20the\x20latest\x20online\x20state\x20before\x20retrying.',';\x20the\x20planned\x20snapshot\x20is\x20no\x20longer\x20current.','Online\x20menu\x20state\x20changed\x20before\x20','\x20child\x20count\x20changed:\x20expected\x20','root','operation','--id\x20must\x20be\x20a\x20positive\x20integer\x20menu\x20id.','hint','error','Permission\x20denied\x20while\x20attempting\x20to\x20','num','stringify','Abort\x20unless\x20the\x20current\x20parent\x20id\x20matches;\x20use\x20root\x20for\x20root\x20level','length','backend','number','recheck\x20online\x20menu\x20facts\x20before\x20','Menu\x20','Sibling\x20sort\x20value\x20(non-negative\x20integer)','7qfaxZR','Confirm\x20that\x20the\x20current\x20account\x20can\x20manage\x20menus\x20for\x20this\x20app.','validation','stage','\x20is\x20type\x20\x22','Online\x20menu\x20not\x20found:\x20','menu_mutation_failed','childrenCount','parent-id','Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20use\x20an\x20exact\x20id\x20from\x20the\x20current\x20app.','87783gXZeGl','This\x20menu\x20mutation\x20requires\x20explicit\x20--yes.','expect-parent-id','606105jkSdWP','\x20because\x20the\x20current\x20maximum\x20sibling\x20sort\x20is\x20','max','type','cascade','plannedActions','menu_state_drift','selector','filter','byId','hasOwnProperty','menu_confirmation_required',',\x20current\x20','parentId','Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20to\x20inspect\x20the\x20latest\x20online\x20menu\x20state.','menu_permission_denied','string','\x22,\x20not\x20folder.','str','expect-path','8694450kYpNiU','verification','deleteOrder','Choose\x20a\x20sort\x20value\x20within\x20the\x20Java\x20Integer\x20range\x20used\x20by\x20the\x20menu\x20service.','sort','menu_sort_overflow','cookie','Failed\x20to\x20','before','pre-write-recheck','rawFlags','expected-children-count','warnings','4521220yPUqsD','menu_parent_not_folder','snapshotHash','\x20must\x20be\x20an\x20integer\x20between\x200\x20and\x20','dryRun','Re-run\x20the\x20command\x20with\x20--dry-run\x20and\x20update\x20the\x20expect\x20flags\x20before\x20retrying.','isSafeInteger','\x20menu\x20','373495wzhpmw','failed','after','required','appCode','56KnbWHE','map','path','Parent\x20folder\x20id;\x20use\x20root\x20for\x20a\x20root-level\x20node','folder','planFile','toLowerCase','code','test',',\x20or\x20pass\x20an\x20explicit\x20--sort\x20value.','prototype','api_error','Abort\x20unless\x20the\x20current\x20direct\x20child\x20count\x20matches','Choose\x20a\x20menu\x20whose\x20type\x20is\x20folder,\x20or\x20use\x20root.','unknown','data','8577848KAdyVb','\x20must\x20be\x20a\x20positive\x20menu\x20id\x20or\x20root.','targets','get','menu_verification_failed','5712060fnyhij','Cannot\x20append\x20a\x20','message'];a127_0x28d9=function(){return _0xe86efb;};return a127_0x28d9();}export function assertExpectedState(_0x37950a,_0x49989c){const _0x5ec1fe=a127_0xebbd7a;if(hasFlag(_0x37950a,_0x5ec1fe(0x20b))){const _0x135763=parseParentId(_0x37950a,_0x5ec1fe(0x20b),{'required':!![]});if(_0x49989c[_0x5ec1fe(0x1b0)]!==_0x135763)throw stateDrift(_0x5ec1fe(0x1fd)+_0x49989c['id']+'\x20parent\x20changed:\x20expected\x20'+formatParent(_0x135763)+_0x5ec1fe(0x1af)+formatParent(_0x49989c[_0x5ec1fe(0x1b0)])+'.');}if(hasFlag(_0x37950a,'expect-path')){const _0x58b3e5=_0x37950a[_0x5ec1fe(0x1b5)](_0x5ec1fe(0x1b6));if(_0x49989c['path']!==_0x58b3e5)throw stateDrift(_0x5ec1fe(0x1fd)+_0x49989c['id']+'\x20path\x20changed:\x20expected\x20'+JSON[_0x5ec1fe(0x1f7)](_0x58b3e5)+_0x5ec1fe(0x1af)+JSON['stringify'](_0x49989c[_0x5ec1fe(0x1d3)])+'.');}if(hasFlag(_0x37950a,_0x5ec1fe(0x1c2))){const _0xf82b91=_0x37950a[_0x5ec1fe(0x1f6)](_0x5ec1fe(0x1c2));if(!Number[_0x5ec1fe(0x1ca)](_0xf82b91)||_0xf82b91<0x0)throw CliErrors['validation']('--expected-children-count\x20must\x20be\x20a\x20non-negative\x20integer.');if(_0x49989c[_0x5ec1fe(0x206)]!==_0xf82b91)throw stateDrift('Menu\x20'+_0x49989c['id']+_0x5ec1fe(0x1ef)+_0xf82b91+_0x5ec1fe(0x1af)+_0x49989c[_0x5ec1fe(0x206)]+'.');}}export function assertVerified(_0x4cbb7d,_0x3c2bd5,_0x888372=a127_0xebbd7a(0x1b1)){const _0x5d0733=a127_0xebbd7a;if(!_0x4cbb7d)throw menuError(_0x5d0733(0x1e5),_0x3c2bd5,_0x888372);}export function mutationResult(_0x1c1e70){const _0x26cb77=a127_0xebbd7a;return{'operation':_0x1c1e70[_0x26cb77(0x1f1)],'selector':_0x1c1e70[_0x26cb77(0x1aa)],'before':_0x1c1e70[_0x26cb77(0x1bf)],'after':_0x1c1e70[_0x26cb77(0x1ce)],'dryRun':_0x1c1e70[_0x26cb77(0x1c8)],'backend':_0x1c1e70[_0x26cb77(0x1fa)],..._0x1c1e70[_0x26cb77(0x1a8)]?{'plannedActions':_0x1c1e70[_0x26cb77(0x1a8)]}:{},..._0x1c1e70[_0x26cb77(0x1e3)]?{'targets':_0x1c1e70[_0x26cb77(0x1e3)]}:{},..._0x1c1e70[_0x26cb77(0x1b9)]?{'deleteOrder':_0x1c1e70[_0x26cb77(0x1b9)]}:{},'snapshotHash':_0x1c1e70[_0x26cb77(0x1c6)],..._0x1c1e70[_0x26cb77(0x210)]?{'cascade':_0x1c1e70[_0x26cb77(0x210)]}:{},..._0x1c1e70['planFile']?{'planFile':_0x1c1e70[_0x26cb77(0x1d6)]}:{},'succeeded':_0x1c1e70[_0x26cb77(0x1eb)]??[],'failed':_0x1c1e70[_0x26cb77(0x1cd)]??[],'warnings':_0x1c1e70['warnings']??[],'verification':_0x1c1e70['verification'],'error':_0x1c1e70[_0x26cb77(0x1f4)]};}export function menuDryRunResult(_0x1c3772,_0x2b045a){return{..._0x1c3772,..._0x2b045a};}export function menuFailure(_0x1d2346,_0x26c968,_0x1c10ff){const _0x2e16c8=a127_0xebbd7a,_0x407b9c=mutationResult({..._0x26c968,'after':_0x1c10ff[_0x2e16c8(0x1ce)]===undefined?_0x26c968[_0x2e16c8(0x1ce)]:_0x1c10ff[_0x2e16c8(0x1ce)],'backend':_0x1c10ff[_0x2e16c8(0x1fa)]??_0x26c968['backend'],'dryRun':![],'succeeded':_0x1c10ff[_0x2e16c8(0x1eb)]??[],'failed':[{..._0x1c10ff[_0x2e16c8(0x1cd)]??{},'stage':_0x1c10ff[_0x2e16c8(0x202)],'code':_0x1d2346['code'],'message':_0x1d2346[_0x2e16c8(0x1e8)]}],'warnings':[..._0x26c968[_0x2e16c8(0x1c3)],..._0x1c10ff[_0x2e16c8(0x1c3)]??[]],'verification':_0x1c10ff[_0x2e16c8(0x1b8)],'error':{'code':_0x1d2346[_0x2e16c8(0x1d8)],'message':_0x1d2346[_0x2e16c8(0x1e8)],..._0x1d2346[_0x2e16c8(0x1f3)]?{'hint':_0x1d2346[_0x2e16c8(0x1f3)]}:{}}});return Object['defineProperty'](_0x1d2346,_0x2e16c8(0x1e0),{'value':_0x407b9c,'enumerable':!![],'configurable':!![]}),_0x1d2346;}export function asVerificationError(_0x100ebf,_0x467bd5){const _0xb0e0bb=a127_0xebbd7a;if(_0x100ebf instanceof CliError&&_0x100ebf[_0xb0e0bb(0x1d8)]===_0xb0e0bb(0x1e5))return _0x100ebf;const _0x5476ea=_0x100ebf instanceof Error?_0x100ebf['message']:String(_0x100ebf);return menuError('menu_verification_failed',''+_0x467bd5+(_0x5476ea?':\x20'+_0x5476ea:''),'The\x20write\x20may\x20already\x20have\x20taken\x20effect.\x20Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20inspect\x20the\x20returned\x20id\x20before\x20retrying.');}export function describeMenuErrorCause(_0x141c1f,_0x3df321,_0x3ec381){const _0x4d72f5=a127_0xebbd7a,_0x24fd3f=mapMenuApiError(_0x141c1f,_0x3df321,_0x3ec381);return{'causeCode':_0x24fd3f['code'],'causeMessage':_0x24fd3f[_0x4d72f5(0x1e8)]};}export function hasFlag(_0x3da294,_0x447168){const _0x1535f0=a127_0xebbd7a;return Object[_0x1535f0(0x1db)][_0x1535f0(0x1ad)]['call'](_0x3da294['rawFlags'],_0x447168)&&_0x3da294[_0x1535f0(0x1c1)][_0x447168]!==undefined;}export function toApiParentId(_0x613084){return _0x613084??0x0;}export function formatParent(_0x20ec2d){return _0x20ec2d==null?'root':String(_0x20ec2d);}export function menuError(_0x1371ed,_0x238e07,_0x3a615e){return new CliError(_0x1371ed,0x1,_0x238e07,_0x3a615e);}export function mapMenuApiError(_0xd0e73d,_0x50a353,_0x42f74d){const _0x571ab7=a127_0xebbd7a;if(_0xd0e73d instanceof CliError&&_0xd0e73d[_0x571ab7(0x1d8)]!==_0x571ab7(0x1dc))return _0xd0e73d;const _0x50ea87=_0xd0e73d instanceof Error?_0xd0e73d[_0x571ab7(0x1e8)]:String(_0xd0e73d);if(/HTTP 403|forbidden|permission|无权限|权限不足|没有权限/i[_0x571ab7(0x1d9)](_0x50ea87))return menuError(_0x571ab7(0x1b2),_0x571ab7(0x1f5)+_0x50a353+(_0x42f74d?_0x571ab7(0x1cb)+_0x42f74d:'')+'.',_0x571ab7(0x200));return menuError(_0x571ab7(0x205),_0x571ab7(0x1be)+_0x50a353+(_0x42f74d?_0x571ab7(0x1cb)+_0x42f74d:'')+':\x20'+_0x50ea87,_0x571ab7(0x1ec));}export function isMenuResponseLoss(_0x38de72){const _0x2a1898=a127_0xebbd7a,_0x1d9d55=_0x38de72 instanceof Error?_0x38de72[_0x2a1898(0x1e8)]:String(_0x38de72);if(_0x38de72 instanceof CliError)return _0x38de72[_0x2a1898(0x1d8)]===_0x2a1898(0x1dc)&&/^Request (?:failed|timeout):/i['test'](_0x1d9d55);return/timeout|timed out|ECONNRESET|socket hang up|network|fetch failed|connection closed|aborted|terminated|unexpected end of JSON|premature close|body stream/i[_0x2a1898(0x1d9)](_0x1d9d55);}function stateDrift(_0x43b022){const _0x2c9f91=a127_0xebbd7a;return menuError(_0x2c9f91(0x1a9),_0x43b022,_0x2c9f91(0x1c9));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2a3569,_0x52c111){const _0x431b48=a128_0x2f56,_0x3189dc=_0x2a3569();while(!![]){try{const _0x4a9295=parseInt(_0x431b48(0x138))/0x1+parseInt(_0x431b48(0x12d))/0x2*(-parseInt(_0x431b48(0x135))/0x3)+-parseInt(_0x431b48(0x122))/0x4*(-parseInt(_0x431b48(0x130))/0x5)+-parseInt(_0x431b48(0x133))/0x6+-parseInt(_0x431b48(0x112))/0x7*(parseInt(_0x431b48(0x120))/0x8)+-parseInt(_0x431b48(0x116))/0x9*(-parseInt(_0x431b48(0x121))/0xa)+parseInt(_0x431b48(0x131))/0xb;if(_0x4a9295===_0x52c111)break;else _0x3189dc['push'](_0x3189dc['shift']());}catch(_0x31f83b){_0x3189dc['push'](_0x3189dc['shift']());}}}(a128_0x4d2d,0x54525));import{getEnv,isProduction}from'../../../constant/env.js';import{logger}from'../../../utils/logger.js';import{fetchMenuSnapshot,toProcessedMenuItem}from'../../../commands/menu/shared/facts.js';function a128_0x4d2d(){const _0x4dffcd=['3199880fMfUYH','2098996AqeUGZ','update-menu-cdn-url','create-menu','import','Fetching\x20online\x20menu\x20list...\x20(appCode:\x20','Batch\x20menu\x20creation\x20completed,\x20total\x20','Delete\x20','\x20online\x20menus\x20successfully','path','Creating\x20menu:\x20','Menu\x20assets\x20synced:\x20','558364QqKmtG','info','menus','5iovnbQ','76516OWwkoG','label','2804928dYkBxw','extend','3zSyqQH','resources','Regroup\x20','484608umPAHH','menuGroups','Updating\x20menu\x20asset\x20links:\x20','total','\x20menu\x20group(s)','14rXpgHN','Update\x20menu\x20assets\x20\x22','all','map','18XJaFfk','get-online-menu-list','loadScriptMode','length','Fetching\x20daily\x20menu\x20list...\x20(appCode:\x20','create-menus','\x20menu','Start\x20batch\x20menu\x20creation,\x20total\x20','Create\x20menu\x20\x22','stringify','2256952PTfiew'];a128_0x4d2d=function(){return _0x4dffcd;};return a128_0x4d2d();}import{batchDeleteMenuRecords,createMenuRecord,startMenuRegroup as a128_0x3bd91c,updateMenuRecord}from'../../../core/api-client.js';export async function getOnlineMenuList(_0x585bc5,_0x2d0dc2){const _0x9415ff=a128_0x2f56,_0x9af45b=getEnv();logger[_0x9415ff(0x12e)](_0x9415ff(0x117),isProduction(_0x9af45b)?_0x9415ff(0x126)+_0x585bc5+')':_0x9415ff(0x11a)+_0x585bc5+')');const _0x1d03e9=await fetchMenuSnapshot(_0x585bc5,_0x2d0dc2,{'verbose':!![]});return logger[_0x9415ff(0x12e)]('get-online-menu-list','Fetched\x20'+_0x1d03e9[_0x9415ff(0x13b)]+_0x9415ff(0x129)),_0x1d03e9[_0x9415ff(0x12f)][_0x9415ff(0x115)](toProcessedMenuItem);}export async function createMenu(_0x5bfffb,_0x5e97ac,_0x1dbb27){const _0x2fd9d7=a128_0x2f56;logger[_0x2fd9d7(0x12e)](_0x2fd9d7(0x124),_0x2fd9d7(0x12b)+_0x1dbb27[_0x2fd9d7(0x132)]+'\x20('+_0x1dbb27[_0x2fd9d7(0x12a)]+')');const _0x4bd611={'appCode':_0x5bfffb,'type':'procode','sort':0x0,'extend':{'loadScriptMode':_0x2fd9d7(0x125),'resources':_0x1dbb27[_0x2fd9d7(0x136)]?JSON[_0x2fd9d7(0x11f)](_0x1dbb27[_0x2fd9d7(0x136)]):undefined},..._0x1dbb27},_0x463519=await createMenuRecord(_0x4bd611,_0x5e97ac,_0x2fd9d7(0x11e)+_0x1dbb27[_0x2fd9d7(0x132)]+'\x22');return logger['info'](_0x2fd9d7(0x124),'Menu\x20created\x20successfully:\x20'+_0x1dbb27[_0x2fd9d7(0x132)]),_0x463519;}function a128_0x2f56(_0x1ec5dd,_0x1ff1d0){_0x1ec5dd=_0x1ec5dd-0x112;const _0x4d2db8=a128_0x4d2d();let _0x2f56bb=_0x4d2db8[_0x1ec5dd];return _0x2f56bb;}async function createSingleMenu(_0x30d425,_0x5ab009,_0x356186,_0x1fdc36){const _0x36a932=a128_0x2f56,_0x3c324f={'appCode':_0x30d425,'type':'procode','sort':0x0,'extend':{'loadScriptMode':_0x36a932(0x125),'resources':_0x1fdc36?JSON['stringify'](_0x1fdc36):undefined},'label':_0x356186['label'],'path':_0x356186[_0x36a932(0x12a)]},_0x2ba99f=await createMenuRecord(_0x3c324f,_0x5ab009,_0x36a932(0x11e)+_0x356186[_0x36a932(0x132)]+'\x22');return logger[_0x36a932(0x12e)]('create-menu','Menu\x20created\x20successfully:\x20'+_0x356186[_0x36a932(0x132)]),_0x2ba99f;}export async function createMenus(_0x300684,_0x2e206f,_0x36a2c6,_0x415549){const _0x4e24c4=a128_0x2f56;logger[_0x4e24c4(0x12e)](_0x4e24c4(0x11b),_0x4e24c4(0x11d)+_0x36a2c6['length']);const _0x29b657=await Promise[_0x4e24c4(0x114)](_0x36a2c6[_0x4e24c4(0x115)](_0x2337b1=>createSingleMenu(_0x300684,_0x2e206f,_0x2337b1,_0x415549)));return logger['info'](_0x4e24c4(0x11b),_0x4e24c4(0x127)+_0x36a2c6[_0x4e24c4(0x119)]),_0x29b657;}export async function updateMenuCdnUrl(_0x22a435,_0xd06b55,_0x12a7e1){const _0x431836=a128_0x2f56;logger[_0x431836(0x12e)](_0x431836(0x123),_0x431836(0x13a)+_0x12a7e1[_0x431836(0x132)]+'\x20('+_0x12a7e1[_0x431836(0x12a)]+')');const _0x323a37={'id':_0x12a7e1['id'],'appCode':_0x22a435,'extend':{..._0x12a7e1[_0x431836(0x134)]??{},..._0x12a7e1[_0x431836(0x118)]?{'loadScriptMode':_0x12a7e1['loadScriptMode']}:{},'resources':_0x12a7e1[_0x431836(0x136)]?JSON[_0x431836(0x11f)](_0x12a7e1[_0x431836(0x136)]):undefined}},_0x5e69fc=await updateMenuRecord(_0x323a37,_0xd06b55,_0x431836(0x113)+_0x12a7e1[_0x431836(0x132)]+'\x22');return logger[_0x431836(0x12e)](_0x431836(0x123),_0x431836(0x12c)+_0x12a7e1[_0x431836(0x132)],undefined),_0x5e69fc;}export async function createMenuEntity(_0x4e090a,_0xa8238,_0x46c7b5){const _0x1564d5=a128_0x2f56;return createMenuRecord({'appCode':_0x4e090a,..._0x46c7b5},_0xa8238,_0x1564d5(0x11e)+_0x46c7b5[_0x1564d5(0x132)]+'\x22');}export async function updateMenuEntity(_0x1a3961,_0x3e1a4c,_0x16f39a){return updateMenuRecord({'appCode':_0x1a3961,..._0x16f39a},_0x3e1a4c,'Update\x20menu\x20'+_0x16f39a['id']);}export async function batchDeleteMenuEntities(_0x1a920f,_0x472a65){const _0x580e8e=a128_0x2f56;return batchDeleteMenuRecords(_0x472a65,_0x1a920f,_0x580e8e(0x128)+_0x472a65[_0x580e8e(0x119)]+_0x580e8e(0x11c)+(_0x472a65['length']===0x1?'':'s'));}export async function startMenuRegroup(_0x25048f,_0x35e6c8){const _0x1fcb3d=a128_0x2f56;return a128_0x3bd91c(_0x35e6c8,_0x25048f,_0x1fcb3d(0x137)+_0x35e6c8[_0x1fcb3d(0x139)][_0x1fcb3d(0x119)]+_0x1fcb3d(0x13c));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a129_0x4d5044=a129_0x32dc;(function(_0x406255,_0x1f2ed8){const _0x549699=a129_0x32dc,_0x4a4149=_0x406255();while(!![]){try{const _0x384b8d=-parseInt(_0x549699(0xc2))/0x1*(-parseInt(_0x549699(0xdd))/0x2)+-parseInt(_0x549699(0xcd))/0x3+parseInt(_0x549699(0xc9))/0x4*(parseInt(_0x549699(0xdf))/0x5)+parseInt(_0x549699(0xbd))/0x6+-parseInt(_0x549699(0xd6))/0x7+-parseInt(_0x549699(0xcb))/0x8+parseInt(_0x549699(0xdc))/0x9;if(_0x384b8d===_0x1f2ed8)break;else _0x4a4149['push'](_0x4a4149['shift']());}catch(_0x41f908){_0x4a4149['push'](_0x4a4149['shift']());}}}(a129_0x3685,0x6c4ee));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 a129_0x32dc(_0x43556e,_0xb90e7a){_0x43556e=_0x43556e-0xb2;const _0x368560=a129_0x3685();let _0x32dc90=_0x368560[_0x43556e];return _0x32dc90;}import{logger}from'../../../utils/logger.js';function a129_0x3685(){const _0x2e7382=['push','1239340gosqwN','hasOwn','Invalid\x20--params.','has','JS\x20URL\x20is\x20unreachable:\x20','jsUrl','map','Invalid\x20--params:\x20','import','Invalid\x20--params\x20fields:\x20','pages','cssUrl','Invalid\x20--params:\x20expected\x20a\x20JSON\x20object.','object','1834866igtnuH','dryRun','path','message','\x0a\x20\x20Available\x20local\x20paths:\x20','1zePxww','trim','Menu\x20sync\x20completed','No\x20local\x20pages\x20matched\x20paths:\x20','procode','--params.','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','4JsMKqw','filter','4427640MMhTnW','keys','2415345yGyWnE','isArray','CSS\x20URL\x20is\x20unreachable:\x20','length','Local\x20page\x20paths\x20are\x20already\x20on\x20the\x20platform:\x20','join','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','--params.pages\x20is\x20no\x20longer\x20supported.\x20Use\x20--paths\x20with\x20exact\x20local\x20page\x20paths.','menu-sync','281043WZRjAj','string','field',':\x20expected\x20a\x20non-empty\x20string.','setLogPath','get','9544257UFSBzA','456394sASUKA'];a129_0x3685=function(){return _0x2e7382;};return a129_0x3685();}const MENU_SYNC_PARAM_KEYS=new Set([a129_0x4d5044(0xb4),'cssUrl']);function validateParams(_0x31e304){const _0x51e867=a129_0x4d5044,_0x69d328=[];return _0x31e304[_0x51e867(0xb4)]&&!isValidJsHttpsUrl(_0x31e304[_0x51e867(0xb4)])&&_0x69d328['push']({'field':_0x51e867(0xb4),'message':_0x51e867(0xc8)}),_0x31e304[_0x51e867(0xba)]&&!isValidCssHttpsUrl(_0x31e304['cssUrl'])&&_0x69d328[_0x51e867(0xde)]({'field':_0x51e867(0xba),'message':_0x51e867(0xd3)}),_0x69d328;}export async function runMenuSyncCore(_0x120aa1,_0x1d6627,_0x98f32c=[],_0x5e43ac,_0x55db83={}){const _0x253fbd=a129_0x4d5044,_0x24ed2a=parseMenuSyncParams(_0x5e43ac),_0x4bd814=[...new Set(_0x98f32c[_0x253fbd(0xb5)](_0xfeeaa2=>_0xfeeaa2[_0x253fbd(0xc3)]())[_0x253fbd(0xca)](Boolean))],_0x33f669=_0x24ed2a['jsUrl'],_0x5123b7=_0x24ed2a[_0x253fbd(0xba)],_0x54367e=[];if(_0x33f669)_0x54367e[_0x253fbd(0xde)](_0x33f669);if(_0x5123b7)_0x54367e[_0x253fbd(0xde)](_0x5123b7);const _0x44e8d9=validateParams(_0x24ed2a);if(_0x44e8d9[_0x253fbd(0xd0)]>0x0){const _0x488ced=_0x44e8d9[_0x253fbd(0xb5)](_0x8007f1=>_0x253fbd(0xc7)+_0x8007f1[_0x253fbd(0xd8)]+':\x20'+_0x8007f1[_0x253fbd(0xc0)])[_0x253fbd(0xd2)](';\x20');throw new Error(_0x253fbd(0xb6)+_0x488ced);}logger[_0x253fbd(0xda)](process['cwd']()),logger['info'](_0x253fbd(0xd5),'Start\x20non-interactive\x20menu\x20sync',{'appCode':_0x120aa1,'selectedCount':_0x4bd814[_0x253fbd(0xd0)],'jsUrl':_0x33f669,'cssUrl':_0x5123b7});if(_0x33f669){const _0x34179d=await isUrlReachable(_0x33f669);if(!_0x34179d)throw new Error(_0x253fbd(0xb3)+_0x33f669);}if(_0x5123b7){const _0x384cd6=await isUrlReachable(_0x5123b7);if(!_0x384cd6)throw new Error(_0x253fbd(0xcf)+_0x5123b7);}const _0x505e6c=getLocalPages();if(_0x505e6c['length']===0x0){if(_0x4bd814[_0x253fbd(0xd0)]>0x0)throw new Error(_0x253fbd(0xc5)+_0x4bd814[_0x253fbd(0xd2)](',\x20'));return{'created':0x0,'skipped':!![],'dryRun':_0x55db83[_0x253fbd(0xbe)]===!![],'targetPages':[],'plannedMenus':[]};}const _0x45184e=await getOnlineMenuList(_0x120aa1,_0x1d6627),_0x303273=new Set(_0x45184e[_0x253fbd(0xb5)](_0x3df0c6=>_0x3df0c6[_0x253fbd(0xbf)]));let _0x46f5c4;if(_0x4bd814['length']>0x0){const _0x52e40f=new Map(_0x505e6c[_0x253fbd(0xb5)](_0x3880b2=>[_0x3880b2['path'],_0x3880b2])),_0x51b34d=_0x4bd814[_0x253fbd(0xca)](_0x359d46=>!_0x52e40f['has'](_0x359d46));if(_0x51b34d[_0x253fbd(0xd0)]>0x0){const _0x29a505=_0x505e6c['map'](_0x48c359=>_0x48c359[_0x253fbd(0xbf)])['join'](',\x20');throw new Error(_0x253fbd(0xc5)+_0x51b34d['join'](',\x20')+_0x253fbd(0xc1)+_0x29a505);}const _0x365785=_0x4bd814['filter'](_0x28e094=>_0x303273[_0x253fbd(0xb2)](_0x28e094));if(_0x365785[_0x253fbd(0xd0)]>0x0)throw new Error(_0x253fbd(0xd1)+_0x365785[_0x253fbd(0xd2)](',\x20'));_0x46f5c4=_0x4bd814[_0x253fbd(0xb5)](_0xa069cd=>_0x52e40f[_0x253fbd(0xdb)](_0xa069cd));}else _0x46f5c4=_0x505e6c[_0x253fbd(0xca)](_0x3394a4=>!_0x303273[_0x253fbd(0xb2)](_0x3394a4['path']));if(_0x46f5c4['length']===0x0)return{'created':0x0,'skipped':!![],'dryRun':_0x55db83[_0x253fbd(0xbe)]===!![],'targetPages':[],'plannedMenus':[]};const _0x2af984=_0x46f5c4['map'](_0x4b4877=>({'type':_0x253fbd(0xc6),'path':_0x4b4877['path'],'label':_0x4b4877['label'],'loadScriptMode':_0x253fbd(0xb7),'resources':[..._0x54367e]}));if(_0x55db83[_0x253fbd(0xbe)])return{'created':0x0,'skipped':![],'dryRun':!![],'targetPages':_0x46f5c4,'plannedMenus':_0x2af984};const _0xe1802b=await createMenus(_0x120aa1,_0x1d6627,_0x46f5c4,_0x54367e['length']>0x0?_0x54367e:undefined);return logger['info'](_0x253fbd(0xd5),_0x253fbd(0xc4),{'count':_0x46f5c4['length'],'resources':_0x54367e}),{'created':_0xe1802b['length'],'skipped':![],'dryRun':![],'targetPages':_0x46f5c4,'plannedMenus':_0x2af984,'menus':_0xe1802b};}export function parseMenuSyncParams(_0x10fdb8){const _0x32b69e=a129_0x4d5044;if(!_0x10fdb8||typeof _0x10fdb8!=='string')return{};let _0x5659ba;try{_0x5659ba=JSON['parse'](_0x10fdb8);}catch{throw new Error('Invalid\x20--params\x20JSON.');}if(typeof _0x5659ba!==_0x32b69e(0xbc)||_0x5659ba===null||Array[_0x32b69e(0xce)](_0x5659ba))throw new Error(_0x32b69e(0xbb));const _0x53a7d1=_0x5659ba;if(Object[_0x32b69e(0xe0)](_0x53a7d1,_0x32b69e(0xb9)))throw new Error(_0x32b69e(0xd4));const _0x37d1d8=Object[_0x32b69e(0xcc)](_0x53a7d1)[_0x32b69e(0xca)](_0x18cb9f=>!MENU_SYNC_PARAM_KEYS[_0x32b69e(0xb2)](_0x18cb9f));if(_0x37d1d8[_0x32b69e(0xd0)]>0x0)throw new Error(_0x32b69e(0xb8)+_0x37d1d8['join'](',\x20')+'.');for(const _0x12106d of MENU_SYNC_PARAM_KEYS){const _0x49ecae=_0x53a7d1[_0x12106d];if(_0x49ecae!==undefined&&(typeof _0x49ecae!==_0x32b69e(0xd7)||_0x49ecae[_0x32b69e(0xc3)]()===''))throw new Error(_0x32b69e(0xe1)+_0x12106d+_0x32b69e(0xd9));}return{'jsUrl':typeof _0x53a7d1[_0x32b69e(0xb4)]===_0x32b69e(0xd7)?_0x53a7d1[_0x32b69e(0xb4)][_0x32b69e(0xc3)]():undefined,'cssUrl':typeof _0x53a7d1['cssUrl']===_0x32b69e(0xd7)?_0x53a7d1[_0x32b69e(0xba)][_0x32b69e(0xc3)]():undefined};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x1bf7d1,_0x11a2ef){const _0x2a21ab=a131_0xb5de,_0x26f3df=_0x1bf7d1();while(!![]){try{const _0x3a98d2=-parseInt(_0x2a21ab(0x18d))/0x1+-parseInt(_0x2a21ab(0x17a))/0x2*(-parseInt(_0x2a21ab(0x177))/0x3)+parseInt(_0x2a21ab(0x164))/0x4+-parseInt(_0x2a21ab(0x180))/0x5*(parseInt(_0x2a21ab(0x189))/0x6)+parseInt(_0x2a21ab(0x193))/0x7+parseInt(_0x2a21ab(0x165))/0x8*(parseInt(_0x2a21ab(0x17c))/0x9)+-parseInt(_0x2a21ab(0x187))/0xa;if(_0x3a98d2===_0x11a2ef)break;else _0x26f3df['push'](_0x26f3df['shift']());}catch(_0x3bbd1b){_0x26f3df['push'](_0x26f3df['shift']());}}}(a131_0x24e4,0x89052));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 a131_0x24e4(){const _0xb9152f=['has','allSettled','menuIds','patch','after','extend','with\x20a\x20single\x20cssUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','.\x20Allowed\x20values:\x20replace,\x20patch','\x20existing\x20JS\x20resources\x20for\x20\x22','Start\x20non-interactive\x20menu\x20asset\x20update','status','paths','resources','\x22\x20(','JS\x20URL\x20is\x20unreachable:\x20','--params.','1233OWQCvY','mode','selection','302QrkuCD','message','45ENFQjO','label','dryRun','Use\x20--mode\x20patch\x20to\x20preserve\x20it,\x20pass\x20jsUrl,\x20or\x20add\x20--force\x20for\x20an\x20intentional\x20removal.','20YJwHEt','loadScriptMode','filter','trim','.css','Invalid\x20--params:\x20menu\x20asset-update\x20requires\x20at\x20least\x20one\x20explicit\x20JS/CSS\x20URL.\x20','force','2378580VJvAFz','with\x20a\x20single\x20jsUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','1339836ESKwxw','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','join','menu\x20asset-update\x20cannot\x20patch\x20','601624KmbZhl','Menu\x20asset\x20update\x20completed','map','toLowerCase','all','replace','5571090JzQgPi','cwd','jsUrl','some','Invalid\x20--mode:\x20','string','cssUrl','info','Invalid\x20--params:\x20','parse','menu\x20asset-update\x20selectors\x20did\x20not\x20match\x20resource-bearing\x20menus:\x20','field','Pass\x20--params\x20\x27{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}\x27\x20to\x20update\x20assets.','menu\x20asset-update\x20will\x20remove\x20existing\x20CSS\x20resource\x20for\x20\x22','menu\x20asset-update\x20would\x20remove\x20existing\x20JS\x20resource\x20for\x20\x22','rejected','path','length','push','CSS\x20URL\x20is\x20unreachable:\x20','menu-asset-update','setLogPath','split','3120976SYBntC','1049224jCZQrs','fulfilled'];a131_0x24e4=function(){return _0xb9152f;};return a131_0x24e4();}function validateParams(_0x3f7e05){const _0x9a1271=a131_0xb5de,_0x4eb2b7=[];return _0x3f7e05[_0x9a1271(0x195)]&&!isValidJsHttpsUrl(_0x3f7e05[_0x9a1271(0x195)])&&_0x4eb2b7[_0x9a1271(0x15f)]({'field':_0x9a1271(0x195),'message':'JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL'}),_0x3f7e05[_0x9a1271(0x199)]&&!isValidCssHttpsUrl(_0x3f7e05[_0x9a1271(0x199)])&&_0x4eb2b7[_0x9a1271(0x15f)]({'field':_0x9a1271(0x199),'message':_0x9a1271(0x18a)}),_0x4eb2b7;}export async function runMenuUpdateCore(_0xe2b849,_0x5d4624,_0x2f0bfe,_0x3f9052={}){const _0x51fc6c=a131_0xb5de,_0xa1e67=parseUpdateParamsFlag(_0x2f0bfe),_0xedab56=normalizeMode(_0x3f9052[_0x51fc6c(0x178)]);validateSelection(_0x3f9052['selection']);const _0x32f4a2=[];if(_0xa1e67['jsUrl'])_0x32f4a2[_0x51fc6c(0x15f)](_0xa1e67[_0x51fc6c(0x195)]);if(_0xa1e67['cssUrl'])_0x32f4a2['push'](_0xa1e67[_0x51fc6c(0x199)]);const _0x4ec184=validateParams(_0xa1e67);if(_0x4ec184[_0x51fc6c(0x15e)]>0x0){const _0x4dfc41=_0x4ec184[_0x51fc6c(0x18f)](_0x15718f=>_0x51fc6c(0x176)+_0x15718f[_0x51fc6c(0x158)]+':\x20'+_0x15718f[_0x51fc6c(0x17b)])[_0x51fc6c(0x18b)](';\x20');throw new Error(_0x51fc6c(0x155)+_0x4dfc41);}if(_0x32f4a2[_0x51fc6c(0x15e)]===0x0)throw new Error(_0x51fc6c(0x185)+_0x51fc6c(0x159));logger[_0x51fc6c(0x162)](process[_0x51fc6c(0x194)]()),logger[_0x51fc6c(0x154)](_0x51fc6c(0x161),_0x51fc6c(0x170),{'appCode':_0xe2b849,'jsUrl':_0xa1e67[_0x51fc6c(0x195)],'cssUrl':_0xa1e67[_0x51fc6c(0x199)],'mode':_0xedab56,'dryRun':_0x3f9052['dryRun']===!![]});if(_0xa1e67['jsUrl']){const _0x5702b3=await isUrlReachable(_0xa1e67['jsUrl']);if(!_0x5702b3)throw new Error(_0x51fc6c(0x175)+_0xa1e67[_0x51fc6c(0x195)]);}if(_0xa1e67['cssUrl']){const _0x135fa6=await isUrlReachable(_0xa1e67[_0x51fc6c(0x199)]);if(!_0x135fa6)throw new Error(_0x51fc6c(0x160)+_0xa1e67[_0x51fc6c(0x199)]);}const _0x58c49c=await getOnlineMenuList(_0xe2b849,_0x5d4624),_0x1b6927=_0x58c49c[_0x51fc6c(0x182)](_0x1a4ece=>_0x1a4ece[_0x51fc6c(0x173)][_0x51fc6c(0x15e)]>0x0),_0x4f696a=selectMenusForUpdate(_0x1b6927,_0x3f9052[_0x51fc6c(0x179)]);if(_0x4f696a[_0x51fc6c(0x15e)]===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![],'dryRun':_0x3f9052['dryRun']===!![]};const _0x123106=_0x4f696a['map'](_0x30d647=>buildMenuUpdateDiff(_0x30d647,_0xa1e67,_0xedab56,_0x3f9052[_0x51fc6c(0x186)]===!![],_0x3f9052[_0x51fc6c(0x181)]));if(_0x3f9052[_0x51fc6c(0x17e)])return{'updated':0x0,'failed':0x0,'skipped':![],'dryRun':!![],'diffs':_0x123106};const _0x1e60cb=await Promise[_0x51fc6c(0x168)](_0x4f696a['map']((_0x327eb2,_0x11e50e)=>updateMenuCdnUrl(_0xe2b849,_0x5d4624,{'id':_0x327eb2['id'],'label':_0x327eb2[_0x51fc6c(0x17d)],'path':_0x327eb2['path'],'resources':_0x123106[_0x11e50e][_0x51fc6c(0x16b)][_0x51fc6c(0x173)],'extend':_0x327eb2[_0x51fc6c(0x16c)]??null,'loadScriptMode':_0x3f9052['loadScriptMode']}))),_0x45e7e9=_0x1e60cb[_0x51fc6c(0x182)](_0x4f62f2=>_0x4f62f2[_0x51fc6c(0x171)]===_0x51fc6c(0x166))[_0x51fc6c(0x18f)](_0x5c4b3e=>_0x5c4b3e['value']),_0x4cda90=_0x1e60cb[_0x51fc6c(0x182)](_0x48331f=>_0x48331f[_0x51fc6c(0x171)]===_0x51fc6c(0x15c))['length'];return logger['info']('menu-asset-update',_0x51fc6c(0x18e),{'count':_0x4f696a[_0x51fc6c(0x15e)],'resources':_0x32f4a2}),{'updated':_0x45e7e9[_0x51fc6c(0x15e)],'failed':_0x4cda90,'skipped':![],'menus':_0x45e7e9};}function validateSelection(_0x4aa0a4){const _0x430939=a131_0xb5de;if(!_0x4aa0a4)throw new Error('menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.');if(_0x4aa0a4[_0x430939(0x191)]&&(_0x4aa0a4['menuIds'][_0x430939(0x15e)]>0x0||_0x4aa0a4[_0x430939(0x172)][_0x430939(0x15e)]>0x0))throw new Error('--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.');if(!_0x4aa0a4[_0x430939(0x191)]&&_0x4aa0a4[_0x430939(0x169)][_0x430939(0x15e)]===0x0&&_0x4aa0a4[_0x430939(0x172)][_0x430939(0x15e)]===0x0)throw new Error('menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.');}function a131_0xb5de(_0x14ea03,_0x384514){_0x14ea03=_0x14ea03-0x154;const _0x24e494=a131_0x24e4();let _0xb5de4b=_0x24e494[_0x14ea03];return _0xb5de4b;}export function selectMenusForUpdate(_0x3d7ded,_0x5ce6d5){const _0x44e526=a131_0xb5de;validateSelection(_0x5ce6d5);if(_0x5ce6d5[_0x44e526(0x191)])return _0x3d7ded;const _0x153100=new Set(_0x3d7ded[_0x44e526(0x18f)](_0x47ce6c=>_0x47ce6c['id'])),_0x23aacf=new Set(_0x3d7ded[_0x44e526(0x18f)](_0x2186ce=>_0x2186ce[_0x44e526(0x15d)])),_0x2b996b=_0x5ce6d5[_0x44e526(0x169)][_0x44e526(0x182)](_0x4ba82c=>!_0x153100[_0x44e526(0x167)](_0x4ba82c)),_0x2b818c=_0x5ce6d5[_0x44e526(0x172)][_0x44e526(0x182)](_0x46bb30=>!_0x23aacf['has'](_0x46bb30));if(_0x2b996b[_0x44e526(0x15e)]>0x0||_0x2b818c[_0x44e526(0x15e)]>0x0){const _0x5046ce=[..._0x2b996b['map'](_0x2ee8d9=>String(_0x2ee8d9)),..._0x2b818c][_0x44e526(0x18b)](',\x20');throw new Error(_0x44e526(0x157)+_0x5046ce);}const _0x3a94b3=new Set(_0x5ce6d5[_0x44e526(0x169)]),_0x2026df=new Set(_0x5ce6d5[_0x44e526(0x172)]);return _0x3d7ded[_0x44e526(0x182)](_0x48dccb=>_0x3a94b3[_0x44e526(0x167)](_0x48dccb['id'])||_0x2026df[_0x44e526(0x167)](_0x48dccb[_0x44e526(0x15d)]));}function normalizeMode(_0x4e2cb7){const _0x2f6a76=a131_0xb5de;if(!_0x4e2cb7)return _0x2f6a76(0x16a);if(_0x4e2cb7===_0x2f6a76(0x192)||_0x4e2cb7===_0x2f6a76(0x16a))return _0x4e2cb7;throw new Error(_0x2f6a76(0x197)+_0x4e2cb7+_0x2f6a76(0x16e));}function buildMenuUpdateDiff(_0x4a0565,_0x2067a2,_0x16a573,_0x3ea1f3,_0x2bd029){const _0x146361=a131_0xb5de,_0x116f91=[..._0x4a0565[_0x146361(0x173)]];_0x16a573===_0x146361(0x16a)&&assertUnambiguousPatchResources(_0x4a0565,_0x116f91,_0x2067a2);const _0x2c903a=_0x16a573===_0x146361(0x16a)?patchResources(_0x116f91,_0x2067a2):replaceResources(_0x2067a2),_0x380531=[],_0x4264a0=_0x116f91[_0x146361(0x196)](isJsResource),_0x2bab9d=_0x2c903a[_0x146361(0x196)](isJsResource);if(_0x4264a0&&!_0x2bab9d){const _0x354d0a=_0x146361(0x15b)+_0x4a0565[_0x146361(0x17d)]+'\x22\x20('+_0x4a0565[_0x146361(0x15d)]+').\x20'+_0x146361(0x17f);if(!_0x3ea1f3)throw new Error(_0x354d0a);_0x380531[_0x146361(0x15f)](_0x354d0a);}const _0x89063b=_0x116f91[_0x146361(0x196)](isCssResource),_0x39f4be=_0x2c903a[_0x146361(0x196)](isCssResource);_0x89063b&&!_0x39f4be&&_0x380531['push'](_0x146361(0x15a)+_0x4a0565['label']+_0x146361(0x174)+_0x4a0565[_0x146361(0x15d)]+').');const _0x427806=typeof _0x4a0565[_0x146361(0x16c)]?.['loadScriptMode']===_0x146361(0x198)?_0x4a0565[_0x146361(0x16c)][_0x146361(0x181)]:null,_0x2e5ab0=_0x2bd029?{'loadScriptMode':_0x427806}:{},_0xa0006e=_0x2bd029?{'loadScriptMode':_0x2bd029}:{};return{'id':_0x4a0565['id'],'label':_0x4a0565[_0x146361(0x17d)],'path':_0x4a0565[_0x146361(0x15d)],'mode':_0x16a573,'before':{'resources':_0x116f91,..._0x2e5ab0},'after':{'resources':_0x2c903a,..._0xa0006e},'warnings':_0x380531};}function replaceResources(_0x3e1627){const _0x445782=a131_0xb5de;return[_0x3e1627[_0x445782(0x195)],_0x3e1627[_0x445782(0x199)]][_0x445782(0x182)](_0x3c8f11=>!!_0x3c8f11);}function assertUnambiguousPatchResources(_0x5f1c3a,_0x4637c7,_0x3699ed){const _0x286472=a131_0xb5de,_0x1fe4c6=_0x4637c7['filter'](isJsResource)['length'];if(_0x3699ed[_0x286472(0x195)]&&_0x1fe4c6>0x1)throw new Error(_0x286472(0x18c)+_0x1fe4c6+_0x286472(0x16f)+_0x5f1c3a[_0x286472(0x17d)]+_0x286472(0x174)+_0x5f1c3a['path']+')\x20'+_0x286472(0x188));const _0x337917=_0x4637c7['filter'](isCssResource)['length'];if(_0x3699ed['cssUrl']&&_0x337917>0x1)throw new Error(_0x286472(0x18c)+_0x337917+'\x20existing\x20CSS\x20resources\x20for\x20\x22'+_0x5f1c3a[_0x286472(0x17d)]+'\x22\x20('+_0x5f1c3a['path']+')\x20'+_0x286472(0x16d));}function patchResources(_0x41dfc1,_0x453337){const _0xd45b67=a131_0xb5de;let _0xbaae5c=![],_0x5e5331=![];const _0x49a2cb=[];for(const _0x4d7906 of _0x41dfc1){if(isJsResource(_0x4d7906)){if(_0x453337['jsUrl']&&!_0xbaae5c)_0x49a2cb['push'](_0x453337['jsUrl']),_0xbaae5c=!![];else!_0x453337[_0xd45b67(0x195)]&&_0x49a2cb[_0xd45b67(0x15f)](_0x4d7906);continue;}if(isCssResource(_0x4d7906)){if(_0x453337[_0xd45b67(0x199)]&&!_0x5e5331)_0x49a2cb[_0xd45b67(0x15f)](_0x453337[_0xd45b67(0x199)]),_0x5e5331=!![];else!_0x453337[_0xd45b67(0x199)]&&_0x49a2cb['push'](_0x4d7906);continue;}_0x49a2cb[_0xd45b67(0x15f)](_0x4d7906);}return _0x453337[_0xd45b67(0x195)]&&!_0xbaae5c&&_0x49a2cb['unshift'](_0x453337['jsUrl']),_0x453337[_0xd45b67(0x199)]&&!_0x5e5331&&_0x49a2cb['push'](_0x453337[_0xd45b67(0x199)]),_0x49a2cb;}function isJsResource(_0x14fe44){const _0x2b2254=a131_0xb5de;return stripQuery(_0x14fe44)[_0x2b2254(0x190)]()['endsWith']('.js');}function isCssResource(_0x2fc344){const _0x27301f=a131_0xb5de;return stripQuery(_0x2fc344)['toLowerCase']()['endsWith'](_0x27301f(0x184));}function stripQuery(_0x38eb13){const _0x32eaec=a131_0xb5de;return _0x38eb13[_0x32eaec(0x163)]('?')[0x0]??_0x38eb13;}function parseUpdateParamsFlag(_0x49aea4){const _0x5d05ed=a131_0xb5de;if(!_0x49aea4||typeof _0x49aea4!=='string')return{};try{const _0x3581b1=JSON[_0x5d05ed(0x156)](_0x49aea4);if(typeof _0x3581b1!=='object'||_0x3581b1===null||Array['isArray'](_0x3581b1))return{};return{'jsUrl':typeof _0x3581b1[_0x5d05ed(0x195)]==='string'?_0x3581b1[_0x5d05ed(0x195)][_0x5d05ed(0x183)]():undefined,'cssUrl':typeof _0x3581b1[_0x5d05ed(0x199)]==='string'?_0x3581b1[_0x5d05ed(0x199)][_0x5d05ed(0x183)]():undefined};}catch{return{};}}
|
|
1
|
+
(function(_0x13c9da,_0x4588ad){const _0x1696ad=a131_0x557f,_0x26eb80=_0x13c9da();while(!![]){try{const _0xced495=-parseInt(_0x1696ad(0x101))/0x1*(-parseInt(_0x1696ad(0x11f))/0x2)+parseInt(_0x1696ad(0x11c))/0x3*(parseInt(_0x1696ad(0x104))/0x4)+parseInt(_0x1696ad(0x12e))/0x5*(-parseInt(_0x1696ad(0x132))/0x6)+parseInt(_0x1696ad(0x12d))/0x7*(parseInt(_0x1696ad(0x120))/0x8)+parseInt(_0x1696ad(0x12b))/0x9*(-parseInt(_0x1696ad(0xfe))/0xa)+parseInt(_0x1696ad(0x109))/0xb+parseInt(_0x1696ad(0x107))/0xc*(parseInt(_0x1696ad(0x117))/0xd);if(_0xced495===_0x4588ad)break;else _0x26eb80['push'](_0x26eb80['shift']());}catch(_0x26671b){_0x26eb80['push'](_0x26eb80['shift']());}}}(a131_0x692f,0xee6b0));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 a131_0x557f(_0x342641,_0x170b4f){_0x342641=_0x342641-0xf0;const _0x692f2=a131_0x692f();let _0x557fe0=_0x692f2[_0x342641];return _0x557fe0;}function validateParams(_0x4e6cd8){const _0x1b7dec=a131_0x557f,_0x122948=[];return _0x4e6cd8[_0x1b7dec(0x121)]&&!isValidJsHttpsUrl(_0x4e6cd8[_0x1b7dec(0x121)])&&_0x122948[_0x1b7dec(0x123)]({'field':_0x1b7dec(0x121),'message':_0x1b7dec(0xf1)}),_0x4e6cd8[_0x1b7dec(0x108)]&&!isValidCssHttpsUrl(_0x4e6cd8[_0x1b7dec(0x108)])&&_0x122948[_0x1b7dec(0x123)]({'field':_0x1b7dec(0x108),'message':_0x1b7dec(0x119)}),_0x122948;}export async function runMenuUpdateCore(_0x337df3,_0x31b9fa,_0x892d9c,_0x472c0e={}){const _0x1345ec=a131_0x557f,_0x414a57=parseUpdateParamsFlag(_0x892d9c),_0x2aae4f=normalizeMode(_0x472c0e['mode']);validateSelection(_0x472c0e[_0x1345ec(0xff)]);const _0x43fcc0=[];if(_0x414a57[_0x1345ec(0x121)])_0x43fcc0[_0x1345ec(0x123)](_0x414a57[_0x1345ec(0x121)]);if(_0x414a57[_0x1345ec(0x108)])_0x43fcc0[_0x1345ec(0x123)](_0x414a57[_0x1345ec(0x108)]);const _0x543b8f=validateParams(_0x414a57);if(_0x543b8f[_0x1345ec(0xf7)]>0x0){const _0x1531a1=_0x543b8f[_0x1345ec(0x11b)](_0x1c2325=>_0x1345ec(0x127)+_0x1c2325['field']+':\x20'+_0x1c2325[_0x1345ec(0x111)])[_0x1345ec(0x12c)](';\x20');throw new Error(_0x1345ec(0xf6)+_0x1531a1);}if(_0x43fcc0[_0x1345ec(0xf7)]===0x0)throw new Error('Invalid\x20--params:\x20menu\x20asset-update\x20requires\x20at\x20least\x20one\x20explicit\x20JS/CSS\x20URL.\x20'+_0x1345ec(0xf4));logger[_0x1345ec(0xf3)](process[_0x1345ec(0x10e)]()),logger[_0x1345ec(0x10a)](_0x1345ec(0x131),_0x1345ec(0xfc),{'appCode':_0x337df3,'jsUrl':_0x414a57['jsUrl'],'cssUrl':_0x414a57[_0x1345ec(0x108)],'mode':_0x2aae4f,'dryRun':_0x472c0e['dryRun']===!![]});if(_0x414a57[_0x1345ec(0x121)]){const _0x457729=await isUrlReachable(_0x414a57[_0x1345ec(0x121)]);if(!_0x457729)throw new Error(_0x1345ec(0x12a)+_0x414a57[_0x1345ec(0x121)]);}if(_0x414a57[_0x1345ec(0x108)]){const _0xb696c3=await isUrlReachable(_0x414a57[_0x1345ec(0x108)]);if(!_0xb696c3)throw new Error(_0x1345ec(0x100)+_0x414a57[_0x1345ec(0x108)]);}const _0x55d5c7=await getOnlineMenuList(_0x337df3,_0x31b9fa),_0x4196c5=_0x55d5c7[_0x1345ec(0x113)](_0x1b7a95=>_0x1b7a95[_0x1345ec(0xf8)][_0x1345ec(0xf7)]>0x0),_0x58415d=selectMenusForUpdate(_0x4196c5,_0x472c0e[_0x1345ec(0xff)]);if(_0x58415d[_0x1345ec(0xf7)]===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![],'dryRun':_0x472c0e[_0x1345ec(0x10f)]===!![]};const _0x39a513=_0x58415d[_0x1345ec(0x11b)](_0x89946=>buildMenuUpdateDiff(_0x89946,_0x414a57,_0x2aae4f,_0x472c0e['force']===!![],_0x472c0e[_0x1345ec(0x122)]));if(_0x472c0e[_0x1345ec(0x10f)])return{'updated':0x0,'failed':0x0,'skipped':![],'dryRun':!![],'diffs':_0x39a513};const _0x5a02dc=await Promise['allSettled'](_0x58415d[_0x1345ec(0x11b)]((_0x134dbd,_0x3588fe)=>updateMenuCdnUrl(_0x337df3,_0x31b9fa,{'id':_0x134dbd['id'],'label':_0x134dbd[_0x1345ec(0x11d)],'path':_0x134dbd[_0x1345ec(0x103)],'resources':_0x39a513[_0x3588fe][_0x1345ec(0x137)][_0x1345ec(0xf8)],'extend':_0x134dbd['extend']??null,'loadScriptMode':_0x472c0e['loadScriptMode']}))),_0x51ac85=_0x5a02dc[_0x1345ec(0x113)](_0x10bb00=>_0x10bb00['status']===_0x1345ec(0x116))[_0x1345ec(0x11b)](_0x589118=>_0x589118[_0x1345ec(0x126)]),_0x562613=_0x5a02dc[_0x1345ec(0x113)](_0x584238=>_0x584238[_0x1345ec(0x135)]==='rejected')['length'];return logger[_0x1345ec(0x10a)](_0x1345ec(0x131),_0x1345ec(0xf2),{'count':_0x58415d['length'],'resources':_0x43fcc0}),{'updated':_0x51ac85[_0x1345ec(0xf7)],'failed':_0x562613,'skipped':![],'menus':_0x51ac85};}function validateSelection(_0x28814e){const _0x32b2b7=a131_0x557f;if(!_0x28814e)throw new Error(_0x32b2b7(0x11a));if(_0x28814e[_0x32b2b7(0x110)]&&(_0x28814e[_0x32b2b7(0x124)][_0x32b2b7(0xf7)]>0x0||_0x28814e['paths'][_0x32b2b7(0xf7)]>0x0))throw new Error(_0x32b2b7(0x136));if(!_0x28814e[_0x32b2b7(0x110)]&&_0x28814e[_0x32b2b7(0x124)]['length']===0x0&&_0x28814e[_0x32b2b7(0x11e)]['length']===0x0)throw new Error(_0x32b2b7(0x11a));}export function selectMenusForUpdate(_0x576535,_0x5c0392){const _0x17ef53=a131_0x557f;validateSelection(_0x5c0392);if(_0x5c0392[_0x17ef53(0x110)])return _0x576535;const _0x1126f3=new Set(_0x576535[_0x17ef53(0x11b)](_0x5ed7e0=>_0x5ed7e0['id'])),_0x5d5957=new Set(_0x576535['map'](_0x6e8c8b=>_0x6e8c8b[_0x17ef53(0x103)])),_0x280fb1=_0x5c0392[_0x17ef53(0x124)][_0x17ef53(0x113)](_0x566ef1=>!_0x1126f3[_0x17ef53(0x129)](_0x566ef1)),_0xe0be1e=_0x5c0392[_0x17ef53(0x11e)][_0x17ef53(0x113)](_0x1457e0=>!_0x5d5957[_0x17ef53(0x129)](_0x1457e0));if(_0x280fb1[_0x17ef53(0xf7)]>0x0||_0xe0be1e[_0x17ef53(0xf7)]>0x0){const _0xa57f42=[..._0x280fb1[_0x17ef53(0x11b)](_0x5cc3c1=>String(_0x5cc3c1)),..._0xe0be1e][_0x17ef53(0x12c)](',\x20');throw new Error(_0x17ef53(0xf0)+_0xa57f42);}const _0x18e2bf=new Set(_0x5c0392[_0x17ef53(0x124)]),_0x38c55f=new Set(_0x5c0392[_0x17ef53(0x11e)]);return _0x576535[_0x17ef53(0x113)](_0x177f6f=>_0x18e2bf[_0x17ef53(0x129)](_0x177f6f['id'])||_0x38c55f[_0x17ef53(0x129)](_0x177f6f[_0x17ef53(0x103)]));}function normalizeMode(_0x104074){const _0x4e2e7f=a131_0x557f;if(!_0x104074)return _0x4e2e7f(0x133);if(_0x104074===_0x4e2e7f(0x10d)||_0x104074===_0x4e2e7f(0x133))return _0x104074;throw new Error(_0x4e2e7f(0x115)+_0x104074+_0x4e2e7f(0xfa));}function buildMenuUpdateDiff(_0x2f1c4d,_0x341eaa,_0x373827,_0x4a49d3,_0x1bc1f9){const _0x1eada2=a131_0x557f,_0x49f312=[..._0x2f1c4d[_0x1eada2(0xf8)]];_0x373827==='patch'&&assertUnambiguousPatchResources(_0x2f1c4d,_0x49f312,_0x341eaa);const _0x2479aa=_0x373827===_0x1eada2(0x133)?patchResources(_0x49f312,_0x341eaa):replaceResources(_0x341eaa),_0x464c95=[],_0x36627f=_0x49f312[_0x1eada2(0x118)](isJsResource),_0x96f8d9=_0x2479aa[_0x1eada2(0x118)](isJsResource);if(_0x36627f&&!_0x96f8d9){const _0x28b0c3='menu\x20asset-update\x20would\x20remove\x20existing\x20JS\x20resource\x20for\x20\x22'+_0x2f1c4d[_0x1eada2(0x11d)]+'\x22\x20('+_0x2f1c4d[_0x1eada2(0x103)]+_0x1eada2(0x10c)+_0x1eada2(0x10b);if(!_0x4a49d3)throw new Error(_0x28b0c3);_0x464c95[_0x1eada2(0x123)](_0x28b0c3);}const _0x4cb39f=_0x49f312[_0x1eada2(0x118)](isCssResource),_0x331a9d=_0x2479aa[_0x1eada2(0x118)](isCssResource);_0x4cb39f&&!_0x331a9d&&_0x464c95[_0x1eada2(0x123)](_0x1eada2(0x130)+_0x2f1c4d[_0x1eada2(0x11d)]+'\x22\x20('+_0x2f1c4d[_0x1eada2(0x103)]+').');const _0x1f1ebe=typeof _0x2f1c4d[_0x1eada2(0x114)]?.['loadScriptMode']===_0x1eada2(0x105)?_0x2f1c4d[_0x1eada2(0x114)][_0x1eada2(0x122)]:null,_0xd4b69f=_0x1bc1f9?{'loadScriptMode':_0x1f1ebe}:{},_0x148baa=_0x1bc1f9?{'loadScriptMode':_0x1bc1f9}:{};return{'id':_0x2f1c4d['id'],'label':_0x2f1c4d['label'],'path':_0x2f1c4d['path'],'mode':_0x373827,'before':{'resources':_0x49f312,..._0xd4b69f},'after':{'resources':_0x2479aa,..._0x148baa},'warnings':_0x464c95};}function replaceResources(_0x5dcba0){const _0x95160a=a131_0x557f;return[_0x5dcba0[_0x95160a(0x121)],_0x5dcba0[_0x95160a(0x108)]][_0x95160a(0x113)](_0x1a9e2d=>!!_0x1a9e2d);}function assertUnambiguousPatchResources(_0x427b2e,_0x4112af,_0x5e2db9){const _0x292a27=a131_0x557f,_0x87dbb5=_0x4112af[_0x292a27(0x113)](isJsResource)[_0x292a27(0xf7)];if(_0x5e2db9[_0x292a27(0x121)]&&_0x87dbb5>0x1)throw new Error('menu\x20asset-update\x20cannot\x20patch\x20'+_0x87dbb5+_0x292a27(0x128)+_0x427b2e['label']+_0x292a27(0xf9)+_0x427b2e[_0x292a27(0x103)]+')\x20'+_0x292a27(0xf5));const _0x546a5f=_0x4112af['filter'](isCssResource)[_0x292a27(0xf7)];if(_0x5e2db9['cssUrl']&&_0x546a5f>0x1)throw new Error('menu\x20asset-update\x20cannot\x20patch\x20'+_0x546a5f+'\x20existing\x20CSS\x20resources\x20for\x20\x22'+_0x427b2e[_0x292a27(0x11d)]+_0x292a27(0xf9)+_0x427b2e[_0x292a27(0x103)]+')\x20'+_0x292a27(0x134));}function a131_0x692f(){const _0x5953de=['JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','Menu\x20asset\x20update\x20completed','setLogPath','Pass\x20--params\x20\x27{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}\x27\x20to\x20update\x20assets.','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','length','resources','\x22\x20(','.\x20Allowed\x20values:\x20replace,\x20patch','isArray','Start\x20non-interactive\x20menu\x20asset\x20update','object','751470CKQTQx','selection','CSS\x20URL\x20is\x20unreachable:\x20','77RpJMKF','trim','path','4xsWvLC','string','.js','4164nHfBcS','cssUrl','6803214AwbBdu','info','Use\x20--mode\x20patch\x20to\x20preserve\x20it,\x20pass\x20jsUrl,\x20or\x20add\x20--force\x20for\x20an\x20intentional\x20removal.',').\x20','replace','cwd','dryRun','all','message','toLowerCase','filter','extend','Invalid\x20--mode:\x20','fulfilled','24037jlJuhg','some','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.','map','780969YzbXQD','label','paths','10238kazhny','8NksKyy','jsUrl','loadScriptMode','push','menuIds','split','value','--params.','\x20existing\x20JS\x20resources\x20for\x20\x22','has','JS\x20URL\x20is\x20unreachable:\x20','99cuYnmM','join','1372301WzFFrP','145tZSWEe','endsWith','menu\x20asset-update\x20will\x20remove\x20existing\x20CSS\x20resource\x20for\x20\x22','menu-asset-update','63606QeGWif','patch','with\x20a\x20single\x20cssUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','status','--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.','after','menu\x20asset-update\x20selectors\x20did\x20not\x20match\x20resource-bearing\x20menus:\x20'];a131_0x692f=function(){return _0x5953de;};return a131_0x692f();}function patchResources(_0x36d2b5,_0x3f22b1){const _0x202744=a131_0x557f;let _0x2a322b=![],_0x3ac4fd=![];const _0x37f079=[];for(const _0x5441ef of _0x36d2b5){if(isJsResource(_0x5441ef)){if(_0x3f22b1['jsUrl']&&!_0x2a322b)_0x37f079[_0x202744(0x123)](_0x3f22b1[_0x202744(0x121)]),_0x2a322b=!![];else!_0x3f22b1['jsUrl']&&_0x37f079[_0x202744(0x123)](_0x5441ef);continue;}if(isCssResource(_0x5441ef)){if(_0x3f22b1['cssUrl']&&!_0x3ac4fd)_0x37f079[_0x202744(0x123)](_0x3f22b1[_0x202744(0x108)]),_0x3ac4fd=!![];else!_0x3f22b1[_0x202744(0x108)]&&_0x37f079[_0x202744(0x123)](_0x5441ef);continue;}_0x37f079[_0x202744(0x123)](_0x5441ef);}return _0x3f22b1['jsUrl']&&!_0x2a322b&&_0x37f079['unshift'](_0x3f22b1[_0x202744(0x121)]),_0x3f22b1[_0x202744(0x108)]&&!_0x3ac4fd&&_0x37f079['push'](_0x3f22b1[_0x202744(0x108)]),_0x37f079;}function isJsResource(_0x4d52fe){const _0x5e9986=a131_0x557f;return stripQuery(_0x4d52fe)[_0x5e9986(0x112)]()[_0x5e9986(0x12f)](_0x5e9986(0x106));}function isCssResource(_0x1c89bc){const _0x4bc97e=a131_0x557f;return stripQuery(_0x1c89bc)[_0x4bc97e(0x112)]()[_0x4bc97e(0x12f)]('.css');}function stripQuery(_0xd6ae5d){const _0x5883eb=a131_0x557f;return _0xd6ae5d[_0x5883eb(0x125)]('?')[0x0]??_0xd6ae5d;}function parseUpdateParamsFlag(_0x2019f9){const _0x1ba047=a131_0x557f;if(!_0x2019f9||typeof _0x2019f9!==_0x1ba047(0x105))return{};try{const _0x4739a8=JSON['parse'](_0x2019f9);if(typeof _0x4739a8!==_0x1ba047(0xfd)||_0x4739a8===null||Array[_0x1ba047(0xfb)](_0x4739a8))return{};return{'jsUrl':typeof _0x4739a8[_0x1ba047(0x121)]===_0x1ba047(0x105)?_0x4739a8[_0x1ba047(0x121)][_0x1ba047(0x102)]():undefined,'cssUrl':typeof _0x4739a8['cssUrl']===_0x1ba047(0x105)?_0x4739a8[_0x1ba047(0x108)][_0x1ba047(0x102)]():undefined};}catch{return{};}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5e6a4f,_0x3d881e){const _0x336413=a132_0x4b36,_0x33f6eb=_0x5e6a4f();while(!![]){try{const _0x7d818=-parseInt(_0x336413(0xea))/0x1+parseInt(_0x336413(0xeb))/0x2*(parseInt(_0x336413(0xe6))/0x3)+-parseInt(_0x336413(0xed))/0x4+parseInt(_0x336413(0xe7))/0x5*(parseInt(_0x336413(0xe4))/0x6)+-parseInt(_0x336413(0xe3))/0x7+-parseInt(_0x336413(0xe8))/0x8+-parseInt(_0x336413(0xe9))/0x9*(-parseInt(_0x336413(0xe5))/0xa);if(_0x7d818===_0x3d881e)break;else _0x33f6eb['push'](_0x33f6eb['shift']());}catch(_0x53fbf0){_0x33f6eb['push'](_0x33f6eb['shift']());}}}(a132_0x5b2b,0x5a584));function a132_0x4b36(_0x53e4da,_0x5877e2){_0x53e4da=_0x53e4da-0xe2;const _0x5b2b4e=a132_0x5b2b();let _0x4b36fd=_0x5b2b4e[_0x53e4da];return _0x4b36fd;}export function isValidJsHttpsUrl(_0x5f2ffb){const _0x31614=a132_0x4b36;return/^https:\/\/.+\.js(\?.*)?$/[_0x31614(0xec)](_0x5f2ffb[_0x31614(0xe2)]());}function a132_0x5b2b(){const _0x1b62ca=['trim','1552047iazfbQ','414WDwNvs','2003720eNevNO','87OEgzxw','36295IbNoTp','3321392Qejdeb','27PWzUxq','463636Plqfow','31408KdrwRj','test','347280EQzgEd','HEAD'];a132_0x5b2b=function(){return _0x1b62ca;};return a132_0x5b2b();}export function isValidCssHttpsUrl(_0x5ead6b){const _0x5676d3=a132_0x4b36;return/^https:\/\/.+\.css(\?.*)?$/[_0x5676d3(0xec)](_0x5ead6b[_0x5676d3(0xe2)]());}export async function isUrlReachable(_0x3fb696){const _0x1f20f2=a132_0x4b36;try{const _0x2b7d3f=await fetch(_0x3fb696,{'method':_0x1f20f2(0xee)});return _0x2b7d3f['ok'];}catch{return![];}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a133_0x86be8d=a133_0x2325;function a133_0x18a6(){const _0x4c9974=['3123rXnUTl','\x20\x20!\x20No\x20local\x20pages\x20found,\x20please\x20create\x20pages\x20first','message','Run\x20inside\x20a\x20directory\x20with\x20.rabetbase.json,\x20or\x20pass\x20--appcode\x20<code>.','2401536WUBTCY','str','Pre-fill\x20JS/CSS\x20URLs.\x20','Creating\x20','write','string','menu','appcode','/smartapi/menu/create','9550734xmvFvA','localPages','menu\x20sync\x20requires\x20a\x20project\x20context\x20or\x20explicit\x20--appcode.\x20','flag','\x20created.','\x20page(s)','Failed\x20to\x20fetch\x20online\x20menu\x20list','yellow','cssUrl','5yMraTn','JSON:\x20{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}','Sync\x20local\x20pages\x20as\x20platform\x20menus','\x20local\x20microfrontend\x20menu(s).','onlinePaths','2078949AjFfub','boolean','trim','\x20failed.','Confirm\x20non-interactive\x20sync;\x20without\x20--paths,\x20create\x20all\x20missing\x20local\x20pages','paths','cyan','params','Preview\x20with\x20--dry-run,\x20then\x20reuse\x20the\x20same\x20--paths\x20and\x20--params\x20with\x20--yes.','skipped','430MCNMZA','Menu\x20creation\x20failed','Would\x20create\x20','\x20created,\x20','validation','targetPages','\x20\x20Create\x20','split','21918582KXhFLY','✓\x20All\x20local\x20pages\x20are\x20already\x20on\x20platform','onlineMenuList','5923516WOcbqm','created','sync','Fetching\x20online\x20menu\x20list...','yes','\x20\x20Cancelled.','\x20menu(s)','cookie','rawFlags','\x20and\x20CSS:\x20','9854845jFnKlq','Exact\x20comma-separated\x20local\x20page\x20paths\x20to\x20sync','appCode','No\x20local\x20microfrontend\x20menus\x20would\x20be\x20created.','gray','selectedAppName','\x20\x20✓\x20Selected:\x20','failed','Menu\x20sync\x20completed:\x20','Created\x20','length','Non-interactive\x20menu\x20sync\x20requires\x20--yes.'];a133_0x18a6=function(){return _0x4c9974;};return a133_0x18a6();}(function(_0x284cdf,_0x3a4aa4){const _0x265306=a133_0x2325,_0x5065f7=_0x284cdf();while(!![]){try{const _0x9be2a6=parseInt(_0x265306(0x143))/0x1*(parseInt(_0x265306(0x168))/0x2)+parseInt(_0x265306(0x15e))/0x3+parseInt(_0x265306(0x12d))/0x4+parseInt(_0x265306(0x159))/0x5*(parseInt(_0x265306(0x150))/0x6)+-parseInt(_0x265306(0x137))/0x7+parseInt(_0x265306(0x147))/0x8+-parseInt(_0x265306(0x170))/0x9;if(_0x9be2a6===_0x3a4aa4)break;else _0x5065f7['push'](_0x5065f7['shift']());}catch(_0x4b1851){_0x5065f7['push'](_0x5065f7['shift']());}}}(a133_0x18a6,0xda467));import a133_0x1eaddb from'chalk';import{buildCompareRows,doCreateMenus,fetchMenuData}from'../../commands/menu/shared/logic.js';import{renderCompareTable,renderSyncSummary}from'../../commands/menu/shared/compare-table.js';import{selectPages,askJsUrl,askCssUrl,askConfirm,startSpinner,stopSpinner,isInteractive,requireInteractive}from'../../commands/menu/shared/inquirer.js';function a133_0x2325(_0x12fa6a,_0x4d3f7f){_0x12fa6a=_0x12fa6a-0x12d;const _0x18a687=a133_0x18a6();let _0x2325e7=_0x18a687[_0x12fa6a];return _0x2325e7;}import{CliErrors}from'../../errors.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';import{parseMenuSyncParams,runMenuSyncCore}from'../../commands/menu/shared/sync-core.js';import{getLocalPages}from'../../commands/menu/shared/local-pages.js';import{isInProject}from'../../context.js';export const menuSync={'service':a133_0x86be8d(0x14d),'command':a133_0x86be8d(0x12f),'description':a133_0x86be8d(0x15b),'risk':a133_0x86be8d(0x14b),'flags':[{'name':a133_0x86be8d(0x165),'type':a133_0x86be8d(0x14c),'description':a133_0x86be8d(0x149)+a133_0x86be8d(0x15a)},{'name':a133_0x86be8d(0x163),'type':a133_0x86be8d(0x14c),'description':a133_0x86be8d(0x138)},{'name':a133_0x86be8d(0x131),'type':a133_0x86be8d(0x15f),'description':a133_0x86be8d(0x162)}],async 'dryRun'(_0x283a00){const _0x477c46=a133_0x86be8d;ensureRunnableContext(_0x283a00[_0x477c46(0x135)],_0x283a00[_0x477c46(0x13c)]);const _0x42a0ee=await runMenuSyncCore(_0x283a00['appCode'],_0x283a00[_0x477c46(0x134)],parsePaths(_0x283a00['str'](_0x477c46(0x163))),_0x283a00[_0x477c46(0x148)](_0x477c46(0x165)),{'dryRun':!![]});return{'method':'POST','url':_0x477c46(0x14f),'body':_0x42a0ee,'description':_0x42a0ee[_0x477c46(0x167)]?_0x477c46(0x13a):_0x477c46(0x16a)+_0x42a0ee[_0x477c46(0x16d)][_0x477c46(0x141)]+_0x477c46(0x15c)};},async 'execute'(_0x4f7978){const _0x35b93b=a133_0x86be8d;ensureRunnableContext(_0x4f7978['rawFlags'],_0x4f7978['selectedAppName']);const _0x3a9764=_0x4f7978[_0x35b93b(0x153)](_0x35b93b(0x131)),_0x4007bf=_0x4f7978[_0x35b93b(0x148)](_0x35b93b(0x165)),_0x53251b=parsePaths(_0x4f7978[_0x35b93b(0x148)](_0x35b93b(0x163))),_0x509a72=parseMenuSyncParams(_0x4007bf);if(_0x3a9764){const _0x3ccb24=await runMenuSyncCore(_0x4f7978['appCode'],_0x4f7978['cookie'],_0x53251b,_0x4007bf);if(_0x3ccb24['skipped']){const _0x440244=getLocalPages();_0x440244[_0x35b93b(0x141)]===0x0?writeCliSideChannelLine('!\x20No\x20local\x20pages\x20found\x20in\x20src/pages'):writeCliSideChannelLine(_0x35b93b(0x171));}else writeCliSideChannelLine('✓\x20Menu\x20sync\x20completed:\x20'+_0x3ccb24['created']+'\x20menu(s)\x20created');return{'ok':!![],'data':_0x3ccb24,'message':_0x3ccb24[_0x35b93b(0x167)]?'Menu\x20sync\x20skipped':'Menu\x20sync\x20completed:\x20'+_0x3ccb24[_0x35b93b(0x12e)]+_0x35b93b(0x154)};}if(_0x53251b[_0x35b93b(0x141)]>0x0)throw CliErrors['validation']('menu\x20sync\x20--paths\x20requires\x20--yes\x20for\x20execution.',_0x35b93b(0x166));if(!isInteractive()&&_0x4007bf)throw CliErrors[_0x35b93b(0x16c)](_0x35b93b(0x142),_0x35b93b(0x166));requireInteractive();const _0x536e88=startSpinner(_0x35b93b(0x130));let _0x3502c1,_0x2ac2b4,_0x39cf3b;try{const _0x3f4644=await fetchMenuData(_0x4f7978[_0x35b93b(0x139)],_0x4f7978['cookie']);_0x3502c1=_0x3f4644[_0x35b93b(0x151)],_0x2ac2b4=_0x3f4644[_0x35b93b(0x15d)],_0x39cf3b=_0x3f4644[_0x35b93b(0x172)],stopSpinner(_0x536e88,'Online\x20menu\x20list\x20fetched',!![]);}catch(_0x39a92e){stopSpinner(_0x536e88,_0x35b93b(0x156),![]);throw CliErrors[_0x35b93b(0x16c)](_0x39a92e instanceof Error?_0x39a92e[_0x35b93b(0x145)]:_0x35b93b(0x156));}if(_0x3502c1[_0x35b93b(0x141)]===0x0)return writeCliSideChannelLine(a133_0x1eaddb[_0x35b93b(0x157)](_0x35b93b(0x144))),{'ok':!![]};const _0x5d4050=buildCompareRows(_0x3502c1,_0x2ac2b4);writeCliSideChannelLine(renderCompareTable(_0x5d4050)),writeCliSideChannelLine('');const _0x2bff05=await selectPages(_0x3502c1,_0x2ac2b4);writeCliSideChannelLine(''),writeCliSideChannelLine(a133_0x1eaddb[_0x35b93b(0x164)](_0x35b93b(0x13d)+_0x2bff05[_0x35b93b(0x141)]+_0x35b93b(0x155)));const _0x1f6b0e=_0x509a72['jsUrl']&&_0x509a72['cssUrl'];if(!_0x1f6b0e){writeCliSideChannelLine(renderSyncSummary(_0x2bff05,_0x2ac2b4['size']>0x0));const _0x53539e=await askConfirm('\x20\x20Continue\x20with\x20creation?');if(!_0x53539e)return writeCliSideChannelLine(a133_0x1eaddb[_0x35b93b(0x13b)](_0x35b93b(0x132))),{'ok':!![]};}let _0xa7c318=_0x509a72['jsUrl'],_0x2952a2=_0x509a72[_0x35b93b(0x158)];!_0xa7c318&&(_0xa7c318=await askJsUrl());!_0x2952a2&&(_0x2952a2=await askCssUrl());const _0x23ac9e=await askConfirm(_0x35b93b(0x16e)+_0x2bff05[_0x35b93b(0x141)]+'\x20menu(s)\x20with\x20JS:\x20'+_0xa7c318+_0x35b93b(0x136)+_0x2952a2+'?');if(!_0x23ac9e)return writeCliSideChannelLine(a133_0x1eaddb[_0x35b93b(0x13b)](_0x35b93b(0x132))),{'ok':!![]};const _0x1cd606=[_0xa7c318,_0x2952a2],_0x326c2b=startSpinner(_0x35b93b(0x14a)+_0x2bff05[_0x35b93b(0x141)]+'\x20menu(s)...');try{const _0x25074d=await doCreateMenus(_0x4f7978[_0x35b93b(0x139)],_0x4f7978['cookie'],_0x2bff05,_0x1cd606);return stopSpinner(_0x326c2b,_0x35b93b(0x140)+_0x25074d['created']+_0x35b93b(0x133),!![]),{'ok':!![],'data':_0x25074d,'message':_0x35b93b(0x13f)+_0x25074d[_0x35b93b(0x12e)]+_0x35b93b(0x16b)+_0x25074d[_0x35b93b(0x13e)]+_0x35b93b(0x161)};}catch(_0x34111b){stopSpinner(_0x326c2b,'Menu\x20creation\x20failed',![]);throw CliErrors[_0x35b93b(0x16c)](_0x34111b instanceof Error?_0x34111b['message']:_0x35b93b(0x169));}}};function ensureRunnableContext(_0x1b4550,_0x2394df){const _0x1e0342=a133_0x86be8d,_0x33739e=_0x1b4550[_0x1e0342(0x14e)]?String(_0x1b4550[_0x1e0342(0x14e)])[_0x1e0342(0x160)]():'';if(!isInProject()&&!_0x2394df&&!_0x33739e)throw CliErrors['validation'](_0x1e0342(0x152)+_0x1e0342(0x146));}function parsePaths(_0x51fe8d){const _0x3296ff=a133_0x86be8d;return[...new Set(_0x51fe8d[_0x3296ff(0x16f)](',')['map'](_0x363e2=>_0x363e2['trim']())['filter'](Boolean))];}
|