@lovrabet/rabetbase-cli 2.2.5-beta.1 → 2.2.5-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/add.js +1 -1
- package/lib/commands/app/discover.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/remove.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app/use.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-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-selector.js +1 -1
- package/lib/commands/common/flags.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/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-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 -0
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/shared/compare-table.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/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/menu/update.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/non-interactive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/init.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/save.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/workspace/index.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-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/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/templates/README.md +15 -25
- package/templates/generate-api/api.ts.tpl +2 -2
- package/templates/generate-api/client.ts.tpl +2 -2
- package/templates/projects/sub-app-react-demo/CHANGELOG.md +15 -1
- package/templates/projects/sub-app-react-demo/README.md +159 -231
- package/templates/projects/sub-app-react-demo/docs/quick-start.md +145 -426
- package/templates/projects/sub-app-react-demo/src/api/api.ts +8 -65
- package/templates/projects/sub-app-react-demo/src/api/client.ts +10 -42
- package/templates/projects/sub-app-react-demo/src/components/demo-page-container/DemoPageContainer.module.css +28 -0
- package/templates/projects/sub-app-react-demo/src/components/demo-page-container/DemoPageContainer.tsx +55 -0
- package/templates/projects/sub-app-react-demo/src/layouts/MainLayout.tsx +6 -9
- package/templates/projects/sub-app-react-demo/src/main.tsx +10 -6
- package/templates/projects/sub-app-react-demo/src/pages/dashboard/index.tsx +3 -5
- package/templates/projects/sub-app-react-demo/src/pages/data-screen/index.tsx +153 -148
- package/templates/projects/sub-app-react-demo/src/pages/index.module.css +500 -0
- package/templates/projects/sub-app-react-demo/src/pages/index.tsx +517 -343
- package/templates/projects/sub-app-react-demo/src/pages/sdk-demo/index.tsx +325 -242
- package/templates/projects/sub-app-react-demo/src/pages/workbench/index.module.css +8 -6
- package/templates/projects/sub-app-react-demo/src/pages/workbench/index.tsx +174 -87
- package/templates/projects/sub-app-react-demo/src/style.css +19 -3
- package/templates/projects/sub-app-react-demo/src/vite-env.d.ts +1 -1
- package/templates/projects/sub-app-react-demo/docs/API_RULE_CHANGE.md +0 -212
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a93_0xee1c3a=a93_0xc671;(function(_0x44e11b,_0xcd84e8){const _0xfe94c8=a93_0xc671,_0x30ed28=_0x44e11b();while(!![]){try{const _0x2bef40=-parseInt(_0xfe94c8(0x14d))/0x1+-parseInt(_0xfe94c8(0x169))/0x2+-parseInt(_0xfe94c8(0x153))/0x3*(parseInt(_0xfe94c8(0x165))/0x4)+-parseInt(_0xfe94c8(0x167))/0x5*(parseInt(_0xfe94c8(0x166))/0x6)+-parseInt(_0xfe94c8(0x16c))/0x7+-parseInt(_0xfe94c8(0x14c))/0x8*(parseInt(_0xfe94c8(0x160))/0x9)+-parseInt(_0xfe94c8(0x16f))/0xa*(-parseInt(_0xfe94c8(0x14e))/0xb);if(_0x2bef40===_0xcd84e8)break;else _0x30ed28['push'](_0x30ed28['shift']());}catch(_0x28afa0){_0x30ed28['push'](_0x30ed28['shift']());}}}(a93_0x2d27,0xb20b1));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{getApiDomain}from'../../constant/domain.js';import{platformFetch}from'../../core/api-client.js';export const menuList={'service':a93_0xee1c3a(0x16a),'command':a93_0xee1c3a(0x151),'description':a93_0xee1c3a(0x15e),'risk':a93_0xee1c3a(0x158),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a93_0xee1c3a(0x16b),'type':a93_0xee1c3a(0x155),'description':a93_0xee1c3a(0x164)}],async 'execute'(_0x158761){const _0x1ee253=a93_0xee1c3a,_0x569da2=_0x158761[_0x1ee253(0x172)](_0x1ee253(0x16b)),_0x475233=await platformFetch(getApiDomain()+'/smartapi/menu/find?appCode='+_0x158761[_0x1ee253(0x161)],{'cookie':_0x158761['cookie'],'label':_0x1ee253(0x14b)}),_0x3908ba=flattenMenuItems(Array[_0x1ee253(0x152)](_0x475233)?_0x475233:[],{'verbose':_0x569da2,'parentId':null,'depth':0x0});return{'ok':!![],'data':{'total':_0x3908ba[_0x1ee253(0x168)],'menus':_0x3908ba},'message':_0x3908ba[_0x1ee253(0x168)]===0x0?_0x1ee253(0x150):_0x1ee253(0x15d)+_0x3908ba[_0x1ee253(0x168)]+_0x1ee253(0x163)};}};function flattenMenuItems(_0x338af5,_0x17c056){const _0x4e89b6=a93_0xee1c3a,_0x4a0364=sortMenuItems(_0x338af5),_0x22e53f=[];for(const _0x35431a of _0x4a0364){_0x22e53f['push'](toMenuListItem(_0x35431a,_0x17c056)),Array[_0x4e89b6(0x152)](_0x35431a[_0x4e89b6(0x15a)])&&_0x35431a['children'][_0x4e89b6(0x168)]>0x0&&_0x22e53f[_0x4e89b6(0x16d)](...flattenMenuItems(_0x35431a[_0x4e89b6(0x15a)],{'verbose':_0x17c056[_0x4e89b6(0x16b)],'parentId':_0x35431a['id'],'depth':_0x17c056['depth']+0x1}));}return _0x22e53f;}function sortMenuItems(_0x48ae14){const _0x501359=a93_0xee1c3a;return _0x48ae14[_0x501359(0x156)]((_0x4037ee,_0xd71502)=>({'item':_0x4037ee,'index':_0xd71502}))[_0x501359(0x154)]((_0x5133fe,_0x181370)=>{const _0x48dd44=_0x501359,_0x1c6b0d=normalizeSort(_0x5133fe[_0x48dd44(0x15c)][_0x48dd44(0x154)]),_0x1ebd4b=normalizeSort(_0x181370[_0x48dd44(0x15c)]['sort']);if(_0x1c6b0d!==_0x1ebd4b)return _0x1c6b0d-_0x1ebd4b;return _0x5133fe[_0x48dd44(0x15b)]-_0x181370[_0x48dd44(0x15b)];})['map'](({item:_0x154d84})=>_0x154d84);}function toMenuListItem(_0x19e2e8,_0x19c2ad){const _0x500601=a93_0xee1c3a,_0x3b9901={'id':_0x19e2e8['id'],'parentId':_0x19c2ad['parentId'],'depth':_0x19c2ad[_0x500601(0x162)],'label':normalizeString(_0x19e2e8['label']),'path':normalizeString(_0x19e2e8[_0x500601(0x171)]),'type':normalizeString(_0x19e2e8['type']),'visible':typeof _0x19e2e8['visible']===_0x500601(0x155)?_0x19e2e8[_0x500601(0x170)]:null,'sort':typeof _0x19e2e8[_0x500601(0x154)]===_0x500601(0x157)&&Number[_0x500601(0x159)](_0x19e2e8[_0x500601(0x154)])?_0x19e2e8[_0x500601(0x154)]:null,'resources':normalizeResources(_0x19e2e8[_0x500601(0x15f)]?.['resources'])};return _0x19c2ad[_0x500601(0x16b)]&&(_0x3b9901[_0x500601(0x15f)]=_0x19e2e8[_0x500601(0x15f)]??null),_0x3b9901;}function normalizeSort(_0x4d6e4f){const _0x17e865=a93_0xee1c3a;return typeof _0x4d6e4f===_0x17e865(0x157)&&Number['isFinite'](_0x4d6e4f)?_0x4d6e4f:Number[_0x17e865(0x16e)];}function a93_0x2d27(){const _0x15229e=['200bQnXOo','visible','path','bool','Fetch\x20menu\x20list','16RpcDZP','918875hNnLZE','3526699oTgEyI','string','No\x20menus\x20found.','list','isArray','933UdjQsi','sort','boolean','map','number','read','isFinite','children','index','item','Found\x20','List\x20online\x20menu\x20facts\x20for\x20the\x20current\x20app','extend','5982102gFQstZ','appCode','depth','\x20menu(s)','Return\x20extend\x20field\x20for\x20troubleshooting\x20resource\x20parsing','13656InfFNd','219252TrsfBE','55BSapdE','length','1396944fiDojN','menu','verbose','8907472nWUbrW','push','POSITIVE_INFINITY'];a93_0x2d27=function(){return _0x15229e;};return a93_0x2d27();}function a93_0xc671(_0x188783,_0x318eda){_0x188783=_0x188783-0x14b;const _0x2d2792=a93_0x2d27();let _0xc6713f=_0x2d2792[_0x188783];return _0xc6713f;}function normalizeString(_0x3dcf3b){const _0x84526=a93_0xee1c3a;return typeof _0x3dcf3b===_0x84526(0x14f)?_0x3dcf3b:'';}function normalizeResources(_0x4c5513){const _0x3652ca=a93_0xee1c3a;if(Array[_0x3652ca(0x152)](_0x4c5513))return _0x4c5513[_0x3652ca(0x156)](String);if(typeof _0x4c5513!==_0x3652ca(0x14f))return[];try{const _0x995abe=JSON['parse'](_0x4c5513);return Array[_0x3652ca(0x152)](_0x995abe)?_0x995abe[_0x3652ca(0x156)](String):[];}catch{return[];}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a94_0x5a9e(){const _0x380d38=['\x20\x20No\x20menus\x20with\x20existing\x20resources\x20found.','label','showOnline','length','387PqCWVM','5865307PIgEDH','(unchanged)','local','16KbcfSs','test','477636FrLanA','2997565oegMlu','\x20\x20No\x20pages\x20to\x20sync.','109688elMGGE','repeat','990570XWKWen','Local','path','1034922bJQKxg','\x20\x20\x20\x20•\x20','max','36530JpDbPS','online','Platform','\x20\x20\x20\x20CSS:\x20','join','\x20\x20\x20\x20JS:\x20\x20','push','\x20menu(s)\x20will\x20be\x20updated\x20with\x20new\x20assets:'];a94_0x5a9e=function(){return _0x380d38;};return a94_0x5a9e();}(function(_0x4442e4,_0x4d9a92){const _0x35a6dd=a94_0x2f96,_0x386147=_0x4442e4();while(!![]){try{const _0x57e187=parseInt(_0x35a6dd(0x10e))/0x1*(-parseInt(_0x35a6dd(0x11e))/0x2)+-parseInt(_0x35a6dd(0x125))/0x3+parseInt(_0x35a6dd(0x120))/0x4+parseInt(_0x35a6dd(0x121))/0x5+parseInt(_0x35a6dd(0x10b))/0x6+parseInt(_0x35a6dd(0x11b))/0x7+-parseInt(_0x35a6dd(0x123))/0x8*(parseInt(_0x35a6dd(0x11a))/0x9);if(_0x57e187===_0x4d9a92)break;else _0x386147['push'](_0x386147['shift']());}catch(_0x14a184){_0x386147['push'](_0x386147['shift']());}}}(a94_0x5a9e,0x7e4bb));function strWidth(_0x53a34b){const _0x30df40=a94_0x2f96;let _0x236fcb=0x0;for(const _0x517488 of _0x53a34b){_0x236fcb+=/[\u4e00-\u9fa5]/[_0x30df40(0x11f)](_0x517488)?0x2:0x1;}return _0x236fcb;}function a94_0x2f96(_0x1c4a12,_0x1d2acc){_0x1c4a12=_0x1c4a12-0x109;const _0x5a9e1d=a94_0x5a9e();let _0x2f961f=_0x5a9e1d[_0x1c4a12];return _0x2f961f;}function padRight(_0x473d85,_0x32726f){const _0x5b0d1b=a94_0x2f96,_0x3cd00b=strWidth(_0x473d85);return _0x473d85+'\x20'[_0x5b0d1b(0x124)](Math[_0x5b0d1b(0x10d)](0x0,_0x32726f-_0x3cd00b));}export function renderCompareTable(_0x4ef420,_0x36daab={}){const _0x1029fd=a94_0x2f96;if(_0x4ef420[_0x1029fd(0x119)]===0x0)return'';const _0x574e3b=_0x36daab[_0x1029fd(0x118)]??!![],_0x521933=Math[_0x1029fd(0x10d)](0x1e,..._0x4ef420['map'](_0x35b4eb=>strWidth(_0x35b4eb[_0x1029fd(0x117)]))),_0x16cba0=0x4,_0x384f53=[],_0x3eb51b='\x20\x20'+padRight('Menu\x20Name',_0x521933),_0x871abb=padRight(_0x1029fd(0x109),_0x16cba0),_0x1ab210=_0x574e3b?'\x20\x20'+padRight(_0x1029fd(0x110),_0x16cba0):'';_0x384f53[_0x1029fd(0x114)](_0x3eb51b+'\x20\x20'+_0x871abb+(_0x574e3b?_0x1ab210:'')),_0x384f53[_0x1029fd(0x114)]('\x20\x20'+'─'[_0x1029fd(0x124)](_0x521933)+'\x20\x20'+'─'[_0x1029fd(0x124)](_0x16cba0)+(_0x574e3b?'\x20\x20'+'─'[_0x1029fd(0x124)](_0x16cba0):''));for(const _0x121322 of _0x4ef420){const _0x56cef2=padRight(_0x121322[_0x1029fd(0x117)],_0x521933),_0x3dab73=_0x121322[_0x1029fd(0x11d)]?'✓':'✗',_0x364b63=padRight(_0x3dab73,_0x16cba0);let _0x3aaf28='\x20\x20'+_0x56cef2+'\x20\x20'+_0x364b63;if(_0x574e3b){const _0x4a955b=_0x121322[_0x1029fd(0x10f)]?'✓':'✗';_0x3aaf28+='\x20\x20'+padRight(_0x4a955b,_0x16cba0);}_0x384f53[_0x1029fd(0x114)](_0x3aaf28);}return _0x384f53[_0x1029fd(0x112)]('\x0a');}export function renderSyncSummary(_0x317a6d,_0x4bd7db){const _0x4446aa=a94_0x2f96;if(_0x317a6d['length']===0x0)return _0x4bd7db?'\x20\x20All\x20local\x20pages\x20are\x20already\x20on\x20platform.':_0x4446aa(0x122);const _0x10a88c=['\x20\x20'+_0x317a6d[_0x4446aa(0x119)]+'\x20page(s)\x20will\x20be\x20created\x20on\x20platform:'];for(const _0x73c1b5 of _0x317a6d){_0x10a88c[_0x4446aa(0x114)](_0x4446aa(0x10c)+_0x73c1b5['label']+'\x20('+_0x73c1b5[_0x4446aa(0x10a)]+')');}return _0x10a88c[_0x4446aa(0x112)]('\x0a');}export function renderUpdateSummary(_0x169f92,_0x369b25){const _0x768c3d=a94_0x2f96;if(_0x169f92['length']===0x0)return _0x768c3d(0x116);const _0x4079e1=['\x20\x20'+_0x169f92[_0x768c3d(0x119)]+_0x768c3d(0x115),_0x768c3d(0x113)+(_0x369b25[0x0]??'(unchanged)'),_0x768c3d(0x111)+(_0x369b25[0x1]??_0x768c3d(0x11c)),'','\x20\x20Affected\x20menus:\x20'+_0x169f92['join'](',\x20')];return _0x4079e1[_0x768c3d(0x112)]('\x0a');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a95_0xde8e(){var _0x4601e6=['345186OrlYQf','372bvHHOu','1315oIwOHR','321104rYEtlJ','16rREJlC','20CXUabi','365393mLHymI','964797PXhLPF','7880620Vqhlgh','392614aKjpLP','4ghIUDD'];a95_0xde8e=function(){return _0x4601e6;};return a95_0xde8e();}(function(_0x204b42,_0x1341dc){var _0x3f587a=a95_0x1325,_0x2cfadc=_0x204b42();while(!![]){try{var _0x41b3f3=parseInt(_0x3f587a(0x90))/0x1+parseInt(_0x3f587a(0x8b))/0x2+-parseInt(_0x3f587a(0x89))/0x3*(-parseInt(_0x3f587a(0x8c))/0x4)+-parseInt(_0x3f587a(0x8f))/0x5*(-parseInt(_0x3f587a(0x8e))/0x6)+parseInt(_0x3f587a(0x88))/0x7*(parseInt(_0x3f587a(0x86))/0x8)+-parseInt(_0x3f587a(0x8d))/0x9*(parseInt(_0x3f587a(0x87))/0xa)+-parseInt(_0x3f587a(0x8a))/0xb;if(_0x41b3f3===_0x1341dc)break;else _0x2cfadc['push'](_0x2cfadc['shift']());}catch(_0x37e9fc){_0x2cfadc['push'](_0x2cfadc['shift']());}}}(a95_0xde8e,0x28aba));export*from'../../../commands/menu/shared/types.js';export*from'../../../commands/menu/shared/logic.js';export*from'../../../commands/menu/shared/compare-table.js';export*from'../../../commands/menu/shared/inquirer.js';function a95_0x1325(_0x3f4663,_0x42b277){_0x3f4663=_0x3f4663-0x86;var _0xde8ead=a95_0xde8e();var _0x1325cf=_0xde8ead[_0x3f4663];return _0x1325cf;}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
|
-
|
|
1
|
+
(function(_0xaf893c,_0x29867e){const _0x540475=a96_0x1d21,_0x501c9a=_0xaf893c();while(!![]){try{const _0x3d1c79=-parseInt(_0x540475(0x1b5))/0x1*(-parseInt(_0x540475(0x1ab))/0x2)+parseInt(_0x540475(0x196))/0x3+parseInt(_0x540475(0x1bf))/0x4+-parseInt(_0x540475(0x1bc))/0x5*(parseInt(_0x540475(0x1b2))/0x6)+parseInt(_0x540475(0x19e))/0x7+-parseInt(_0x540475(0x19a))/0x8*(parseInt(_0x540475(0x1be))/0x9)+-parseInt(_0x540475(0x192))/0xa*(parseInt(_0x540475(0x190))/0xb);if(_0x3d1c79===_0x29867e)break;else _0x501c9a['push'](_0x501c9a['shift']());}catch(_0x332d36){_0x501c9a['push'](_0x501c9a['shift']());}}}(a96_0x1a09,0x21f07));import a96_0x282e5e from'chalk';import{checkbox,input,confirm}from'@inquirer/prompts';import a96_0x2d60e9 from'ora';import{isUrlReachable}from'../../../commands/menu/shared/valid-url.js';function a96_0x1a09(){const _0xf04f6d=['\x20\x20✗\x20CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','test','\x20\x20Select\x20menus\x20to\x20sync\x20(space\x20to\x20toggle,\x20a=all,\x20i=invert):','4632fweVkX','cancelled','label','isTTY','1819566sVknvW','error','stdin','CSS\x20URL\x20check\x20failed','No\x20local\x20pages\x20found.','\x20\x20JS\x20URL:','green','Cancelled.','gray','JS\x20URL\x20checked','map','includes','trim','36022FHnrcl','name','length','filter','ExitPromptError','[already\x20on\x20platform]','This\x20command\x20requires\x20an\x20interactive\x20terminal.\x20','231834sfGpbP','catch','red','9lFaFVj','\x20\x20CSS\x20URL:','succeed','path','has','\x20\x20Checking\x20CSS\x20URL\x20reachability...','\x20\x20✗\x20CSS\x20URL\x20is\x20unreachable','5uNitHq','[new]','3204ndJowl','928324NSkDxC','cyan','Use\x20--yes\x20to\x20run\x20in\x20non-interactive\x20mode,\x20or\x20pipe\x20data\x20via\x20--params.','CSS\x20URL\x20checked','JS\x20URL\x20check\x20failed','11wolzcz','fail','3531970eIBKEn','\x20\x20Checking\x20JS\x20URL\x20reachability...','\x20\x20✗\x20JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','\x20\x20✗\x20JS\x20URL\x20is\x20unreachable','248571IKJAst'];a96_0x1a09=function(){return _0xf04f6d;};return a96_0x1a09();}function a96_0x1d21(_0x5054c1,_0x36ddd9){_0x5054c1=_0x5054c1-0x190;const _0x1a0964=a96_0x1a09();let _0x1d2157=_0x1a0964[_0x5054c1];return _0x1d2157;}import{CliErrors}from'../../../errors.js';function onCancel(_0x4e0cd9){const _0x1f1b7b=a96_0x1d21;return _0x4e0cd9[_0x1f1b7b(0x1b3)](_0x3905b3=>{const _0x5e9841=_0x1f1b7b;if(_0x3905b3?.[_0x5e9841(0x1ac)]===_0x5e9841(0x1af))throw CliErrors[_0x5e9841(0x19b)](_0x5e9841(0x1a5));throw _0x3905b3;});}export function startSpinner(_0x4c913c){const _0x174a72=a96_0x1d21;return a96_0x2d60e9({'text':_0x4c913c,'color':_0x174a72(0x1c0)})['start']();}export function stopSpinner(_0x1f9484,_0x516b35,_0x5e3a57){const _0x426763=a96_0x1d21;_0x5e3a57?_0x1f9484[_0x426763(0x1b7)](_0x516b35):_0x1f9484[_0x426763(0x191)](_0x516b35);}export async function askConfirm(_0x8b0422){return onCancel(confirm({'message':_0x8b0422,'theme':{'prefix':''}}));}export async function askJsUrl(_0x392aab){const _0x2d2fb7=a96_0x1d21;while(!![]){const _0x43ce8e=await onCancel(input({'message':_0x2d2fb7(0x1a3),'default':_0x392aab,'theme':{'prefix':''}}));if(_0x43ce8e[_0x2d2fb7(0x1aa)]()==='')throw CliErrors[_0x2d2fb7(0x19b)](_0x2d2fb7(0x1a5));if(!/^https:\/\/.+\.js(\?.*)?$/['test'](_0x43ce8e[_0x2d2fb7(0x1aa)]())){console[_0x2d2fb7(0x19f)](a96_0x282e5e[_0x2d2fb7(0x1b4)](_0x2d2fb7(0x194)));continue;}const _0x2b4a14=startSpinner(_0x2d2fb7(0x193));try{const _0x7b1f2b=await isUrlReachable(_0x43ce8e[_0x2d2fb7(0x1aa)]());stopSpinner(_0x2b4a14,_0x2d2fb7(0x1a7),_0x7b1f2b);if(!_0x7b1f2b){console['error'](a96_0x282e5e[_0x2d2fb7(0x1b4)](_0x2d2fb7(0x195)));continue;}return _0x43ce8e[_0x2d2fb7(0x1aa)]();}catch(_0xe082c9){stopSpinner(_0x2b4a14,_0x2d2fb7(0x1c3),![]);throw _0xe082c9;}}}export async function askCssUrl(_0x534f52){const _0x4ee894=a96_0x1d21;while(!![]){const _0x27ee34=await onCancel(input({'message':_0x4ee894(0x1b6),'default':_0x534f52,'theme':{'prefix':''}}));if(_0x27ee34[_0x4ee894(0x1aa)]()==='')throw CliErrors['cancelled']('Cancelled.');if(!/^https:\/\/.+\.css(\?.*)?$/[_0x4ee894(0x198)](_0x27ee34[_0x4ee894(0x1aa)]())){console[_0x4ee894(0x19f)](a96_0x282e5e[_0x4ee894(0x1b4)](_0x4ee894(0x197)));continue;}const _0x1e4a0f=startSpinner(_0x4ee894(0x1ba));try{const _0xc65d42=await isUrlReachable(_0x27ee34[_0x4ee894(0x1aa)]());stopSpinner(_0x1e4a0f,_0x4ee894(0x1c2),_0xc65d42);if(!_0xc65d42){console[_0x4ee894(0x19f)](a96_0x282e5e[_0x4ee894(0x1b4)](_0x4ee894(0x1bb)));continue;}return _0x27ee34[_0x4ee894(0x1aa)]();}catch(_0x3d2502){stopSpinner(_0x1e4a0f,_0x4ee894(0x1a1),![]);throw _0x3d2502;}}}export async function selectPages(_0x1579db,_0x1fa991,_0x452a07){const _0x4e9051=a96_0x1d21,_0x563e99=_0x1579db[_0x4e9051(0x1a8)](_0x3dcdc0=>({'name':_0x3dcdc0[_0x4e9051(0x19c)]+'\x20\x20'+(_0x1fa991[_0x4e9051(0x1b9)](_0x3dcdc0['path'])?a96_0x282e5e[_0x4e9051(0x1a6)](_0x4e9051(0x1b0)):a96_0x282e5e[_0x4e9051(0x1a4)](_0x4e9051(0x1bd))),'value':_0x3dcdc0['label'],'checked':_0x452a07?_0x452a07[_0x4e9051(0x1a9)](_0x3dcdc0['label']):!_0x1fa991[_0x4e9051(0x1b9)](_0x3dcdc0[_0x4e9051(0x1b8)])}));if(_0x563e99[_0x4e9051(0x1ad)]===0x0)throw new Error(_0x4e9051(0x1a2));const _0x58923c=await onCancel(checkbox({'message':_0x4e9051(0x199),'choices':_0x563e99,'loop':![],'theme':{'prefix':''}}));if(_0x58923c[_0x4e9051(0x1ad)]===0x0)throw new Error('No\x20menus\x20selected.');return _0x1579db[_0x4e9051(0x1ae)](_0x3a41a6=>_0x58923c['includes'](_0x3a41a6[_0x4e9051(0x19c)]));}export function isInteractive(){const _0xd7b077=a96_0x1d21;return process[_0xd7b077(0x1a0)][_0xd7b077(0x19d)]===!![];}export function requireInteractive(){const _0x9a809f=a96_0x1d21;if(!isInteractive())throw new Error(_0x9a809f(0x1b1)+_0x9a809f(0x1c1));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a97_0x5168b5=a97_0x1c34;(function(_0x325b11,_0x309d3d){const _0x16234d=a97_0x1c34,_0x531230=_0x325b11();while(!![]){try{const _0x2d007a=parseInt(_0x16234d(0x89))/0x1*(-parseInt(_0x16234d(0x88))/0x2)+parseInt(_0x16234d(0x94))/0x3+parseInt(_0x16234d(0x82))/0x4*(parseInt(_0x16234d(0x9b))/0x5)+parseInt(_0x16234d(0x9a))/0x6*(parseInt(_0x16234d(0x8d))/0x7)+parseInt(_0x16234d(0x85))/0x8+parseInt(_0x16234d(0x8b))/0x9*(-parseInt(_0x16234d(0x8f))/0xa)+-parseInt(_0x16234d(0x92))/0xb;if(_0x2d007a===_0x309d3d)break;else _0x531230['push'](_0x531230['shift']());}catch(_0x1d952b){_0x531230['push'](_0x531230['shift']());}}}(a97_0x1878,0x557cc));function a97_0x1878(){const _0x5c5c8e=['1795295OCkPhl','slice','4NajmaF','filter','isDirectory','1974224ESXTUw','\x5c.displayName\x5cs*=\x5cs*[\x22\x27]([^\x22\x27]+)[\x22\x27]','src/pages','2342ubPSQR','499EieOtM','join','909hJFfqO','index.tsx','7553fnhOXU','endsWith','15340QwRwVh','match','replace','2932721IaCTOF','concat','1651734JcOnPO','forEach','utf-8','path','.tsx','replaceAll','1110eWEwCH'];a97_0x1878=function(){return _0x5c5c8e;};return a97_0x1878();}function a97_0x1c34(_0x3e3661,_0x5cb8f6){_0x3e3661=_0x3e3661-0x82;const _0x18788f=a97_0x1878();let _0x1c3412=_0x18788f[_0x3e3661];return _0x1c3412;}import{readdirSync,statSync,readFileSync}from'fs';import{join,relative,resolve,sep}from'path';const pagesDir=resolve(process['cwd'](),a97_0x5168b5(0x87));export function extractTitleFromComment(_0x2c6639){const _0x338ae7=a97_0x5168b5;try{const _0x570511=readFileSync(_0x2c6639,_0x338ae7(0x96)),_0x394699=_0x570511[_0x338ae7(0x90)](/^\s*\/\*\*?([\s\S]*?)\*\//);if(_0x394699&&_0x394699[0x1]){const _0x113c19=_0x394699[0x1],_0x30b1c1=_0x113c19['match'](/^\s*\*?\s*title\s*:\s*(.+)/im);if(_0x30b1c1&&_0x30b1c1[0x1])return _0x30b1c1[0x1]['trim']();}let _0x2c4e81=null;const _0x363d5b=_0x570511[_0x338ae7(0x90)](/export\s+default\s+([A-Z][a-zA-Z0-9]*)/);_0x363d5b&&_0x363d5b[0x1]&&(_0x2c4e81=_0x363d5b[0x1]);if(!_0x2c4e81){const _0x5b491b=_0x570511['match'](/export\s+default\s+function\s+([A-Z][a-zA-Z0-9]*)/);_0x5b491b&&_0x5b491b[0x1]&&(_0x2c4e81=_0x5b491b[0x1]);}if(_0x2c4e81){const _0x18004a=new RegExp('\x5cb'+_0x2c4e81+_0x338ae7(0x86)),_0x4883aa=_0x570511[_0x338ae7(0x90)](_0x18004a);if(_0x4883aa&&_0x4883aa[0x1])return _0x4883aa[0x1];return _0x2c4e81;}return null;}catch(_0x1eb532){return null;}}export function getLocalPages(_0x1d3505=pagesDir,_0x2976c6=pagesDir){const _0x27c3f9=a97_0x5168b5;let _0x391eea=[];const _0x5c7938=readdirSync(_0x1d3505);return _0x5c7938[_0x27c3f9(0x95)](_0x2f399a=>{const _0x13d1f6=_0x27c3f9,_0x4eb78f=join(_0x1d3505,_0x2f399a),_0x247350=statSync(_0x4eb78f);if(_0x247350&&_0x247350[_0x13d1f6(0x84)]())_0x391eea=_0x391eea[_0x13d1f6(0x93)](getLocalPages(_0x4eb78f,_0x2976c6));else{if(_0x2f399a[_0x13d1f6(0x8e)](_0x13d1f6(0x98))){let _0x46aa99=relative(_0x2976c6,_0x4eb78f);_0x46aa99[_0x13d1f6(0x8e)](_0x13d1f6(0x8c))?_0x46aa99=_0x46aa99[_0x13d1f6(0x91)](/index\.tsx$/,''):_0x46aa99=_0x46aa99[_0x13d1f6(0x91)](/\.tsx$/,'');_0x46aa99[_0x13d1f6(0x8e)](sep)&&(_0x46aa99=_0x46aa99[_0x13d1f6(0x9c)](0x0,-0x1));const _0x3bbe68=_0x46aa99['split'](sep)[_0x13d1f6(0x8a)]('/'),_0xc70d75=extractTitleFromComment(_0x4eb78f),_0x5df456=_0xc70d75||_0x3bbe68;_0x391eea['push']({'path':_0x3bbe68[_0x13d1f6(0x99)]('$',':'),'label':_0x5df456});}}}),_0x391eea[_0x27c3f9(0x83)](_0x1a98c7=>_0x1a98c7[_0x27c3f9(0x97)]!=='');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3c234b,_0x4344b6){const _0x3a03a1=a98_0x1fbb,_0x2416fa=_0x3c234b();while(!![]){try{const _0x41754b=-parseInt(_0x3a03a1(0x163))/0x1+parseInt(_0x3a03a1(0x161))/0x2+parseInt(_0x3a03a1(0x167))/0x3*(parseInt(_0x3a03a1(0x176))/0x4)+parseInt(_0x3a03a1(0x166))/0x5*(parseInt(_0x3a03a1(0x178))/0x6)+-parseInt(_0x3a03a1(0x16e))/0x7*(-parseInt(_0x3a03a1(0x160))/0x8)+parseInt(_0x3a03a1(0x177))/0x9+-parseInt(_0x3a03a1(0x171))/0xa;if(_0x41754b===_0x4344b6)break;else _0x2416fa['push'](_0x2416fa['shift']());}catch(_0xaf6290){_0x2416fa['push'](_0x2416fa['shift']());}}}(a98_0x593d,0x86569));import{getLocalPages}from'../../../commands/menu/shared/local-pages.js';import{getOnlineMenuList,createMenus,updateMenuCdnUrl}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';export function validateJsUrl(_0x27b1b7){const _0x370e28=a98_0x1fbb,_0x466663=[];return!isValidJsHttpsUrl(_0x27b1b7)&&_0x466663['push'](_0x370e28(0x16c)),{'ok':_0x466663['length']===0x0,'errors':_0x466663};}export function validateCssUrl(_0x328041){const _0x27efbf=a98_0x1fbb,_0x5ecea0=[];return!isValidCssHttpsUrl(_0x328041)&&_0x5ecea0[_0x27efbf(0x15e)](_0x27efbf(0x174)),{'ok':_0x5ecea0[_0x27efbf(0x172)]===0x0,'errors':_0x5ecea0};}function a98_0x593d(){const _0x15691f=['11053ZntIyt','find','resources','11478530JKTUlL','length','filter','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','trim','13156WGMJQN','2815731MdEAbA','12DgzmFX','push','path','120yiEKTI','1353666YeRmzM','has','607917FXPIDW','errors','fulfilled','666185qLNBmH','936WOQrSP','map','label','CSS\x20URL\x20is\x20unreachable','join','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','extend'];a98_0x593d=function(){return _0x15691f;};return a98_0x593d();}export async function validateJsUrlReachable(_0x47f851){const _0x5896da=a98_0x1fbb,_0xa648a5=validateJsUrl(_0x47f851);if(!_0xa648a5['ok'])return _0xa648a5;const _0x15d790=await isUrlReachable(_0x47f851);if(!_0x15d790)_0xa648a5['errors'][_0x5896da(0x15e)]('JS\x20URL\x20is\x20unreachable');return{'ok':_0xa648a5[_0x5896da(0x164)]['length']===0x0,'errors':_0xa648a5[_0x5896da(0x164)]};}export async function validateCssUrlReachable(_0x4ecd25){const _0x66c0ac=a98_0x1fbb,_0x30e640=validateCssUrl(_0x4ecd25);if(!_0x30e640['ok'])return _0x30e640;const _0x748be3=await isUrlReachable(_0x4ecd25);if(!_0x748be3)_0x30e640[_0x66c0ac(0x164)][_0x66c0ac(0x15e)](_0x66c0ac(0x16a));return{'ok':_0x30e640[_0x66c0ac(0x164)][_0x66c0ac(0x172)]===0x0,'errors':_0x30e640[_0x66c0ac(0x164)]};}export function buildCompareRows(_0x1990e0,_0x5c8970){const _0x591e51=a98_0x1fbb;return _0x1990e0['map'](_0x58ec4c=>({'label':_0x58ec4c[_0x591e51(0x169)],'path':_0x58ec4c[_0x591e51(0x15f)],'local':!![],'online':_0x5c8970[_0x591e51(0x162)](_0x58ec4c['path'])}));}export function filterNewPages(_0x110dc6,_0xbad2df,_0x390e4e){const _0x2b9939=a98_0x1fbb;if(_0x390e4e&&_0x390e4e[_0x2b9939(0x172)]>0x0){const _0xa710e2=new Set(_0x390e4e[_0x2b9939(0x168)](_0x2a5b8c=>_0x2a5b8c['trim']())),_0x2ca3fe=_0x110dc6[_0x2b9939(0x173)](_0x1156a1=>_0xa710e2[_0x2b9939(0x162)](_0x1156a1[_0x2b9939(0x169)]));if(_0x2ca3fe['length']===0x0)throw new Error('No\x20local\x20pages\x20matched\x20labels:\x20'+[..._0xa710e2][_0x2b9939(0x16b)](',\x20'));return _0x2ca3fe;}return _0x110dc6[_0x2b9939(0x173)](_0x3326f9=>!_0xbad2df[_0x2b9939(0x162)](_0x3326f9[_0x2b9939(0x15f)]));}export function filterPagesByLabels(_0x547d51,_0x1fad60){const _0x17a82b=a98_0x1fbb,_0x4cc912=[],_0x24d0ff=[];for(const _0x4500a2 of _0x1fad60){const _0x84e9d8=_0x4500a2[_0x17a82b(0x175)](),_0x559001=_0x547d51[_0x17a82b(0x16f)](_0x272d71=>_0x272d71['label']===_0x84e9d8);if(_0x559001)_0x4cc912[_0x17a82b(0x15e)](_0x559001);else _0x24d0ff['push'](_0x4500a2);}return{'matched':_0x4cc912,'unmatched':_0x24d0ff};}export async function doCreateMenus(_0x139d69,_0x360beb,_0x2ce1be,_0x5661dc){const _0x3a8bf8=a98_0x1fbb,_0x5bc2a3=await createMenus(_0x139d69,_0x360beb,_0x2ce1be,_0x5661dc);return{'created':_0x5bc2a3[_0x3a8bf8(0x172)],'failed':0x0,'labels':_0x2ce1be['map'](_0x1c607e=>_0x1c607e[_0x3a8bf8(0x169)]),'menus':_0x5bc2a3};}export function filterMenusWithResources(_0x192f32){const _0x579347=a98_0x1fbb;return _0x192f32['filter'](_0x51c2a8=>_0x51c2a8[_0x579347(0x170)][_0x579347(0x172)]>0x0);}function a98_0x1fbb(_0xebd3b3,_0x3d0e2b){_0xebd3b3=_0xebd3b3-0x15e;const _0x593dff=a98_0x593d();let _0x1fbba3=_0x593dff[_0xebd3b3];return _0x1fbba3;}export async function doUpdateCdnUrls(_0x26c075,_0x13b77c,_0x503024,_0x5e4383){const _0x54dbba=a98_0x1fbb,_0x2cd398=_0x503024[_0x54dbba(0x173)](_0x32d903=>_0x32d903['resources'][_0x54dbba(0x172)]>0x0),_0x3f77a9=await Promise['allSettled'](_0x2cd398['map'](_0x2d648d=>updateMenuCdnUrl(_0x26c075,_0x13b77c,{'id':_0x2d648d['id'],'label':_0x2d648d[_0x54dbba(0x169)],'path':_0x2d648d[_0x54dbba(0x15f)],'resources':_0x5e4383,'extend':_0x2d648d[_0x54dbba(0x16d)]??null}))),_0x21fbdb=_0x3f77a9[_0x54dbba(0x173)](_0x44f54d=>_0x44f54d['status']===_0x54dbba(0x165))[_0x54dbba(0x168)](_0x366902=>_0x366902['value']),_0x14f8f4=_0x3f77a9[_0x54dbba(0x173)](_0x3fbf09=>_0x3fbf09['status']==='rejected')[_0x54dbba(0x172)];return{'updated':_0x21fbdb[_0x54dbba(0x172)],'failed':_0x14f8f4,'menus':_0x21fbdb};}export async function fetchMenuData(_0x3ce0c5,_0x14444a){const _0x50e03c=getLocalPages(),_0x4f8fdb=await getOnlineMenuList(_0x3ce0c5,_0x14444a),_0x11bb1c=new Set(_0x4f8fdb['map'](_0x26c1d3=>_0x26c1d3['path']));return{'localPages':_0x50e03c,'onlineMenuList':_0x4f8fdb,'onlinePaths':_0x11bb1c};}export async function fetchOnlineMenuList(_0xa25623,_0x37cf3d){return getOnlineMenuList(_0xa25623,_0x37cf3d);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2a6e69,_0x34287d){const _0x412cab=a99_0x57ae,_0x815dbe=_0x2a6e69();while(!![]){try{const _0x3b1a78=parseInt(_0x412cab(0x167))/0x1+parseInt(_0x412cab(0x15b))/0x2*(-parseInt(_0x412cab(0x14d))/0x3)+parseInt(_0x412cab(0x143))/0x4+parseInt(_0x412cab(0x156))/0x5+-parseInt(_0x412cab(0x152))/0x6*(-parseInt(_0x412cab(0x158))/0x7)+parseInt(_0x412cab(0x153))/0x8+-parseInt(_0x412cab(0x13d))/0x9*(parseInt(_0x412cab(0x159))/0xa);if(_0x3b1a78===_0x34287d)break;else _0x815dbe['push'](_0x815dbe['shift']());}catch(_0x1674ae){_0x815dbe['push'](_0x815dbe['shift']());}}}(a99_0xfea1,0x96880));import{getApiDomain}from'../../../constant/domain.js';import{getEnv,isProduction}from'../../../constant/env.js';import{logger}from'../../../utils/logger.js';function a99_0x57ae(_0x8bb7aa,_0x27f681){_0x8bb7aa=_0x8bb7aa-0x13a;const _0xfea194=a99_0xfea1();let _0x57ae54=_0xfea194[_0x8bb7aa];return _0x57ae54;}import{platformFetch}from'../../../core/api-client.js';export async function getOnlineMenuList(_0xb19f61,_0x4c30f1){const _0x221e18=a99_0x57ae,_0x4a0781=getEnv();logger[_0x221e18(0x15c)](_0x221e18(0x147),isProduction(_0x4a0781)?_0x221e18(0x150)+_0xb19f61+')':_0x221e18(0x14b)+_0xb19f61+')');const _0x4c21ea=await platformFetch(getApiDomain()+_0x221e18(0x151)+_0xb19f61,{'cookie':_0x4c30f1,'label':_0x221e18(0x164)});if(!_0x4c21ea)return logger[_0x221e18(0x15c)]('get-online-menu-list',_0x221e18(0x161)),[];return logger[_0x221e18(0x15c)]('get-online-menu-list',_0x221e18(0x14f)+_0x4c21ea[_0x221e18(0x140)]+_0x221e18(0x142)),_0x4c21ea[_0x221e18(0x160)](flattenMenuItem)[_0x221e18(0x15d)]();}function flattenMenuItem(_0x37f498){const _0x28fec1=a99_0x57ae;let _0x4acc27=[];try{const _0x45d970=_0x37f498[_0x28fec1(0x13b)]?.[_0x28fec1(0x144)];if(typeof _0x45d970===_0x28fec1(0x15f)){const _0x4b8b4c=JSON[_0x28fec1(0x141)](_0x45d970);if(Array[_0x28fec1(0x165)](_0x4b8b4c))_0x4acc27=_0x4b8b4c[_0x28fec1(0x160)](String);}else Array[_0x28fec1(0x165)](_0x45d970)&&(_0x4acc27=_0x45d970[_0x28fec1(0x160)](String));}catch{}const _0x4b6b58=[{'id':_0x37f498['id'],'path':_0x37f498['path'],'label':_0x37f498[_0x28fec1(0x146)],'resources':_0x4acc27,'extend':_0x37f498['extend']??null}];if(_0x37f498[_0x28fec1(0x15e)]&&_0x37f498[_0x28fec1(0x15e)][_0x28fec1(0x140)]>0x0)for(const _0x1dc814 of _0x37f498[_0x28fec1(0x15e)]){_0x4b6b58[_0x28fec1(0x13c)](...flattenMenuItem(_0x1dc814));}return _0x4b6b58;}export async function createMenu(_0x7b2d0d,_0x330356,_0x3ec40b){const _0x35778f=a99_0x57ae;logger['info'](_0x35778f(0x13a),_0x35778f(0x163)+_0x3ec40b[_0x35778f(0x146)]+'\x20('+_0x3ec40b['path']+')');const _0x1d7d00={'appCode':_0x7b2d0d,'type':_0x35778f(0x13f),'sort':0x0,'extend':{'loadScriptMode':_0x35778f(0x145),'resources':_0x3ec40b[_0x35778f(0x144)]?JSON[_0x35778f(0x15a)](_0x3ec40b[_0x35778f(0x144)]):undefined},..._0x3ec40b},_0x8e79ae=await platformFetch(getApiDomain()+_0x35778f(0x154),{'method':'POST','body':_0x1d7d00,'cookie':_0x330356,'label':_0x35778f(0x13e)+_0x3ec40b['label']+'\x22'});return logger[_0x35778f(0x15c)](_0x35778f(0x13a),_0x35778f(0x14e)+_0x3ec40b[_0x35778f(0x146)]),_0x8e79ae;}async function createSingleMenu(_0xc3f2a5,_0x84636c,_0x4f38e2,_0x240446){const _0x4a86b6=a99_0x57ae,_0x33be8d={'appCode':_0xc3f2a5,'type':'procode','sort':0x0,'extend':{'loadScriptMode':_0x4a86b6(0x145),'resources':_0x240446?JSON['stringify'](_0x240446):undefined},'label':_0x4f38e2[_0x4a86b6(0x146)],'path':_0x4f38e2[_0x4a86b6(0x149)]},_0x4033a7=await platformFetch(getApiDomain()+_0x4a86b6(0x154),{'method':_0x4a86b6(0x14c),'body':_0x33be8d,'cookie':_0x84636c,'label':'Create\x20menu\x20\x22'+_0x4f38e2[_0x4a86b6(0x146)]+'\x22'});return logger[_0x4a86b6(0x15c)](_0x4a86b6(0x13a),_0x4a86b6(0x14e)+_0x4f38e2[_0x4a86b6(0x146)]),_0x4033a7;}export async function createMenus(_0x4e0b5c,_0x3cfd3a,_0x3c04a1,_0x7f3211){const _0x76212f=a99_0x57ae;logger[_0x76212f(0x15c)](_0x76212f(0x155),_0x76212f(0x148)+_0x3c04a1[_0x76212f(0x140)]);const _0x35f41f=await Promise['all'](_0x3c04a1[_0x76212f(0x160)](_0x340f76=>createSingleMenu(_0x4e0b5c,_0x3cfd3a,_0x340f76,_0x7f3211)));return logger[_0x76212f(0x15c)](_0x76212f(0x155),_0x76212f(0x14a)+_0x3c04a1[_0x76212f(0x140)]),_0x35f41f;}export async function updateMenuCdnUrl(_0x5c2d42,_0x309aef,_0x409f63){const _0x39fdc9=a99_0x57ae;logger[_0x39fdc9(0x15c)](_0x39fdc9(0x166),'Updating\x20menu\x20asset\x20links:\x20'+_0x409f63[_0x39fdc9(0x146)]+'\x20('+_0x409f63[_0x39fdc9(0x149)]+')');const _0x57d0fe={'id':_0x409f63['id'],'appCode':_0x5c2d42,'extend':{..._0x409f63['extend']??{},'loadScriptMode':_0x39fdc9(0x145),'resources':_0x409f63['resources']?JSON[_0x39fdc9(0x15a)](_0x409f63[_0x39fdc9(0x144)]):undefined}},_0x177901=await platformFetch(getApiDomain()+_0x39fdc9(0x162),{'method':_0x39fdc9(0x14c),'body':_0x57d0fe,'cookie':_0x309aef,'label':_0x39fdc9(0x157)+_0x409f63[_0x39fdc9(0x146)]+'\x22'});return logger[_0x39fdc9(0x15c)](_0x39fdc9(0x166),'Menu\x20assets\x20synced:\x20'+_0x409f63[_0x39fdc9(0x146)],undefined),_0x177901;}function a99_0xfea1(){const _0x3fcfa9=['Update\x20menu\x20assets\x20\x22','7WzJsdQ','620320MyjIIv','stringify','70582utsJlI','info','flat','children','string','map','Server\x20returned\x20empty\x20menu\x20list','/smartapi/menu/update','Creating\x20menu:\x20','Fetch\x20menu\x20list','isArray','update-menu-cdn-url','711385Qoyhro','create-menu','extend','push','54YlUmXY','Create\x20menu\x20\x22','procode','length','parse','\x20online\x20menus\x20successfully','743432VEFIbe','resources','import','label','get-online-menu-list','Start\x20batch\x20menu\x20creation,\x20total\x20','path','Batch\x20menu\x20creation\x20completed,\x20total\x20','Fetching\x20daily\x20menu\x20list...\x20(appCode:\x20','POST','45hJgekX','Menu\x20created\x20successfully:\x20','Fetched\x20','Fetching\x20online\x20menu\x20list...\x20(appCode:\x20','/smartapi/menu/find?appCode=','26676OhgWyP','1279168GqzfeZ','/smartapi/menu/create','create-menus','2282740JXFJVF'];a99_0xfea1=function(){return _0x3fcfa9;};return a99_0xfea1();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a100_0x336b(){const _0x362b9a=['1032968oHJGVj','concat','field','info','--params.','stdin','JS\x20URL\x20is\x20unreachable:\x20','1218948wVgPAb','49705vGCXKF','jsUrl','37977SQJeBZ','24GLNPSh','toString','5vmONtk','utf8','join','split','readableEnded','52GWlHvu','27577sXaKJj','trim','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','120015VPjuSf','has','Menu\x20sync\x20completed','cssUrl','push','length','object','end','200mYUoLu','isTTY','setLogPath','filter','map','1248ZxfPOo','pages','No\x20local\x20pages\x20matched\x20labels:\x20','Invalid\x20--params:\x20','cwd','isArray','string','122706dvSClv','path','startsWith'];a100_0x336b=function(){return _0x362b9a;};return a100_0x336b();}(function(_0x3c1a11,_0x10f943){const _0x300058=a100_0x5e76,_0x559b5b=_0x3c1a11();while(!![]){try{const _0x21b5cc=-parseInt(_0x300058(0xb9))/0x1+parseInt(_0x300058(0xc3))/0x2*(parseInt(_0x300058(0xbb))/0x3)+-parseInt(_0x300058(0xb1))/0x4*(parseInt(_0x300058(0xbe))/0x5)+parseInt(_0x300058(0xb8))/0x6+-parseInt(_0x300058(0x9a))/0x7*(parseInt(_0x300058(0xbc))/0x8)+parseInt(_0x300058(0xae))/0x9*(parseInt(_0x300058(0xa2))/0xa)+parseInt(_0x300058(0xc4))/0xb*(-parseInt(_0x300058(0xa7))/0xc);if(_0x21b5cc===_0x10f943)break;else _0x559b5b['push'](_0x559b5b['shift']());}catch(_0x477421){_0x559b5b['push'](_0x559b5b['shift']());}}}(a100_0x336b,0x2d21e));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 a100_0x5e76(_0x3a99c4,_0x1c7e7c){_0x3a99c4=_0x3a99c4-0x9a;const _0x336ba1=a100_0x336b();let _0x5e7635=_0x336ba1[_0x3a99c4];return _0x5e7635;}import{logger}from'../../../utils/logger.js';function validateParams(_0x410709){const _0x296d98=a100_0x5e76,_0x51b152=[];return _0x410709[_0x296d98(0xba)]&&!isValidJsHttpsUrl(_0x410709[_0x296d98(0xba)])&&_0x51b152[_0x296d98(0x9e)]({'field':_0x296d98(0xba),'message':_0x296d98(0xc6)}),_0x410709[_0x296d98(0x9d)]&&!isValidCssHttpsUrl(_0x410709[_0x296d98(0x9d)])&&_0x51b152['push']({'field':'cssUrl','message':'CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL'}),_0x51b152;}export async function runMenuSyncCore(_0x1b3ccb,_0x9f98bb,_0x157ddd=[],_0x3edaec){const _0x3c6504=a100_0x5e76,_0x4fd5e0=parseParamsFlag(_0x3edaec),_0x75c497=_0x157ddd[_0x3c6504(0x9f)]>0x0?_0x157ddd:_0x4fd5e0['selectedLabels'],_0x4a51a6=_0x4fd5e0[_0x3c6504(0xba)],_0x7cd0bd=_0x4fd5e0['cssUrl'],_0x41d3cd=[];if(_0x4a51a6)_0x41d3cd['push'](_0x4a51a6);if(_0x7cd0bd)_0x41d3cd[_0x3c6504(0x9e)](_0x7cd0bd);const _0x31f8da=validateParams(_0x4fd5e0);if(_0x31f8da[_0x3c6504(0x9f)]>0x0){const _0x13a549=_0x31f8da[_0x3c6504(0xa6)](_0x29b0db=>_0x3c6504(0xb5)+_0x29b0db[_0x3c6504(0xb3)]+':\x20'+_0x29b0db['message'])['join'](';\x20');throw new Error(_0x3c6504(0xaa)+_0x13a549);}logger[_0x3c6504(0xa4)](process[_0x3c6504(0xab)]()),logger[_0x3c6504(0xb4)]('menu-sync','Start\x20non-interactive\x20menu\x20sync',{'appCode':_0x1b3ccb,'selectedCount':_0x75c497?.['length'],'jsUrl':_0x4a51a6,'cssUrl':_0x7cd0bd});if(_0x4a51a6){const _0xed5c02=await isUrlReachable(_0x4a51a6);if(!_0xed5c02)throw new Error(_0x3c6504(0xb7)+_0x4a51a6);}if(_0x7cd0bd){const _0x354f8c=await isUrlReachable(_0x7cd0bd);if(!_0x354f8c)throw new Error('CSS\x20URL\x20is\x20unreachable:\x20'+_0x7cd0bd);}const _0x3ee91a=getLocalPages();if(_0x3ee91a[_0x3c6504(0x9f)]===0x0)return{'created':0x0,'skipped':!![],'targetPages':[]};const _0x834e24=await getOnlineMenuList(_0x1b3ccb,_0x9f98bb),_0x2cfddf=new Set(_0x834e24['map'](_0x3bedd4=>_0x3bedd4['path']));let _0x37a99b;if(_0x75c497&&_0x75c497[_0x3c6504(0x9f)]>0x0){const _0xad2a06=new Set(_0x75c497['map'](_0x266b44=>_0x266b44['trim']()));_0x37a99b=_0x3ee91a[_0x3c6504(0xa5)](_0x5782f1=>_0xad2a06[_0x3c6504(0x9b)](_0x5782f1['label']));if(_0x37a99b[_0x3c6504(0x9f)]===0x0){const _0x10b6a0=_0x3ee91a[_0x3c6504(0xa6)](_0x61dd15=>_0x61dd15['label'])[_0x3c6504(0xc0)](',\x20');throw new Error(_0x3c6504(0xa9)+[..._0xad2a06][_0x3c6504(0xc0)](',\x20')+'\x0a\x20\x20Available\x20local\x20pages:\x20'+_0x10b6a0);}}else _0x37a99b=_0x3ee91a[_0x3c6504(0xa5)](_0x5501e6=>!_0x2cfddf[_0x3c6504(0x9b)](_0x5501e6[_0x3c6504(0xaf)]));if(_0x37a99b[_0x3c6504(0x9f)]===0x0)return{'created':0x0,'skipped':!![],'targetPages':[]};const _0x8ddcb1=await createMenus(_0x1b3ccb,_0x9f98bb,_0x37a99b,_0x41d3cd[_0x3c6504(0x9f)]>0x0?_0x41d3cd:undefined);return logger[_0x3c6504(0xb4)]('menu-sync',_0x3c6504(0x9c),{'count':_0x37a99b[_0x3c6504(0x9f)],'resources':_0x41d3cd}),{'created':_0x8ddcb1['length'],'skipped':![],'targetPages':_0x37a99b,'menus':_0x8ddcb1};}export async function readPageLabelsFromStdin(){const _0x960766=a100_0x5e76;if(!process[_0x960766(0xb6)][_0x960766(0xa3)]&&!process['stdin'][_0x960766(0xc2)])return new Promise(_0x3af80d=>{const _0x54a430=_0x960766,_0x148480=[];process[_0x54a430(0xb6)]['on']('data',_0x1cd509=>_0x148480[_0x54a430(0x9e)](_0x1cd509)),process[_0x54a430(0xb6)]['on'](_0x54a430(0xa1),()=>{const _0x8182c9=_0x54a430,_0x15e6cc=Buffer[_0x8182c9(0xb2)](_0x148480)[_0x8182c9(0xbd)](_0x8182c9(0xbf)),_0x4fd99e=_0x15e6cc[_0x8182c9(0xc1)]('\x0a')[_0x8182c9(0xa6)](_0x325d59=>_0x325d59[_0x8182c9(0xc5)]())['filter'](_0x3d47dd=>_0x3d47dd[_0x8182c9(0x9f)]>0x0&&!_0x3d47dd[_0x8182c9(0xb0)]('#'));_0x3af80d(_0x4fd99e);}),setTimeout(()=>_0x3af80d([]),0x1f4);});return[];}function parseParamsFlag(_0xb2f350){const _0x185ae2=a100_0x5e76;if(!_0xb2f350||typeof _0xb2f350!==_0x185ae2(0xad))return{};try{const _0x339513=JSON['parse'](_0xb2f350);if(typeof _0x339513!==_0x185ae2(0xa0)||_0x339513===null||Array[_0x185ae2(0xac)](_0x339513))return{};return{'selectedLabels':Array[_0x185ae2(0xac)](_0x339513['pages'])?_0x339513[_0x185ae2(0xa8)]['map'](String):undefined,'jsUrl':typeof _0x339513[_0x185ae2(0xba)]===_0x185ae2(0xad)?_0x339513['jsUrl']['trim']():undefined,'cssUrl':typeof _0x339513[_0x185ae2(0x9d)]===_0x185ae2(0xad)?_0x339513[_0x185ae2(0x9d)][_0x185ae2(0xc5)]():undefined};}catch{return{};}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a102_0x2a16(_0x17d9d7,_0x135362){_0x17d9d7=_0x17d9d7-0x16d;const _0x2144e8=a102_0x2144();let _0x2a1674=_0x2144e8[_0x17d9d7];return _0x2a1674;}function a102_0x2144(){const _0x34db58=['\x22\x20(','rejected','menu-update','length','extend','95Jhhlle','fulfilled','6NTdpWB','force','Invalid\x20--mode:\x20','cssUrl','value','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','filter','CSS\x20URL\x20is\x20unreachable:\x20','dryRun','replace','47cdeaXA','867909oLlbkY','resources','226856XwkDxz','field','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','string','66447vkAigx','5606930JkfUSM','isArray','split','trim','after','Invalid\x20--params:\x20','status','cwd','patch','some','Invalid\x20--params:\x20menu\x20update\x20requires\x20at\x20least\x20one\x20explicit\x20JS/CSS\x20URL.\x20','50206vDWzAo','jsUrl','Menu\x20update\x20completed','menu\x20update\x20will\x20remove\x20existing\x20CSS\x20resource\x20for\x20\x22','Start\x20non-interactive\x20menu\x20update','.css','map','allSettled','toLowerCase','--params.','3072JyBcyF','864RTVBFN','4005316sOfdMM','message','JS\x20URL\x20is\x20unreachable:\x20','endsWith','push','path','mode','495sTOgQx','info','unshift','label','object','Use\x20--mode\x20patch\x20to\x20preserve\x20it,\x20pass\x20jsUrl,\x20or\x20add\x20--force\x20for\x20an\x20intentional\x20removal.'];a102_0x2144=function(){return _0x34db58;};return a102_0x2144();}(function(_0x236b69,_0x176f93){const _0x42276e=a102_0x2a16,_0x3cdf90=_0x236b69();while(!![]){try{const _0x1bf603=-parseInt(_0x42276e(0x189))/0x1*(-parseInt(_0x42276e(0x19c))/0x2)+parseInt(_0x42276e(0x18a))/0x3+parseInt(_0x42276e(0x18c))/0x4*(parseInt(_0x42276e(0x17d))/0x5)+parseInt(_0x42276e(0x17f))/0x6*(-parseInt(_0x42276e(0x1a8))/0x7)+parseInt(_0x42276e(0x1a7))/0x8*(-parseInt(_0x42276e(0x190))/0x9)+-parseInt(_0x42276e(0x191))/0xa+-parseInt(_0x42276e(0x172))/0xb*(parseInt(_0x42276e(0x1a6))/0xc);if(_0x1bf603===_0x176f93)break;else _0x3cdf90['push'](_0x3cdf90['shift']());}catch(_0x9e040f){_0x3cdf90['push'](_0x3cdf90['shift']());}}}(a102_0x2144,0x93b11));import{updateMenuCdnUrl,getOnlineMenuList}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';import{logger}from'../../../utils/logger.js';function validateParams(_0x7e693f){const _0x50a023=a102_0x2a16,_0x570844=[];return _0x7e693f[_0x50a023(0x19d)]&&!isValidJsHttpsUrl(_0x7e693f[_0x50a023(0x19d)])&&_0x570844[_0x50a023(0x16f)]({'field':_0x50a023(0x19d),'message':_0x50a023(0x184)}),_0x7e693f[_0x50a023(0x182)]&&!isValidCssHttpsUrl(_0x7e693f[_0x50a023(0x182)])&&_0x570844[_0x50a023(0x16f)]({'field':_0x50a023(0x182),'message':_0x50a023(0x18e)}),_0x570844;}export async function runMenuUpdateCore(_0x740a0c,_0x395fb2,_0xb70c8e,_0x11442f={}){const _0xaa2671=a102_0x2a16,_0x47e3cf=parseUpdateParamsFlag(_0xb70c8e),_0x22ff8a=normalizeMode(_0x11442f[_0xaa2671(0x171)]),_0x43d5ad=[];if(_0x47e3cf[_0xaa2671(0x19d)])_0x43d5ad[_0xaa2671(0x16f)](_0x47e3cf[_0xaa2671(0x19d)]);if(_0x47e3cf[_0xaa2671(0x182)])_0x43d5ad['push'](_0x47e3cf[_0xaa2671(0x182)]);const _0x1a6ae7=validateParams(_0x47e3cf);if(_0x1a6ae7['length']>0x0){const _0x5e6c96=_0x1a6ae7['map'](_0x4ac8f1=>_0xaa2671(0x1a5)+_0x4ac8f1[_0xaa2671(0x18d)]+':\x20'+_0x4ac8f1[_0xaa2671(0x1a9)])['join'](';\x20');throw new Error(_0xaa2671(0x196)+_0x5e6c96);}if(_0x43d5ad[_0xaa2671(0x17b)]===0x0)throw new Error(_0xaa2671(0x19b)+'Pass\x20--params\x20\x27{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}\x27\x20to\x20update\x20assets.');logger['setLogPath'](process[_0xaa2671(0x198)]()),logger[_0xaa2671(0x173)](_0xaa2671(0x17a),_0xaa2671(0x1a0),{'appCode':_0x740a0c,'jsUrl':_0x47e3cf[_0xaa2671(0x19d)],'cssUrl':_0x47e3cf[_0xaa2671(0x182)],'mode':_0x22ff8a,'dryRun':_0x11442f[_0xaa2671(0x187)]===!![]});if(_0x47e3cf[_0xaa2671(0x19d)]){const _0x1f9232=await isUrlReachable(_0x47e3cf['jsUrl']);if(!_0x1f9232)throw new Error(_0xaa2671(0x16d)+_0x47e3cf[_0xaa2671(0x19d)]);}if(_0x47e3cf[_0xaa2671(0x182)]){const _0x43c5f7=await isUrlReachable(_0x47e3cf[_0xaa2671(0x182)]);if(!_0x43c5f7)throw new Error(_0xaa2671(0x186)+_0x47e3cf[_0xaa2671(0x182)]);}const _0x454983=await getOnlineMenuList(_0x740a0c,_0x395fb2),_0x444231=_0x454983[_0xaa2671(0x185)](_0x597234=>_0x597234[_0xaa2671(0x18b)][_0xaa2671(0x17b)]>0x0);if(_0x444231[_0xaa2671(0x17b)]===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![],'dryRun':_0x11442f[_0xaa2671(0x187)]===!![]};const _0x3d10fb=_0x444231[_0xaa2671(0x1a2)](_0x37548a=>buildMenuUpdateDiff(_0x37548a,_0x47e3cf,_0x22ff8a,_0x11442f[_0xaa2671(0x180)]===!![]));if(_0x11442f[_0xaa2671(0x187)])return{'updated':0x0,'failed':0x0,'skipped':![],'dryRun':!![],'diffs':_0x3d10fb};const _0xb45f7a=await Promise[_0xaa2671(0x1a3)](_0x444231[_0xaa2671(0x1a2)]((_0x5bda5c,_0x5694fd)=>updateMenuCdnUrl(_0x740a0c,_0x395fb2,{'id':_0x5bda5c['id'],'label':_0x5bda5c[_0xaa2671(0x175)],'path':_0x5bda5c[_0xaa2671(0x170)],'resources':_0x3d10fb[_0x5694fd][_0xaa2671(0x195)][_0xaa2671(0x18b)],'extend':_0x5bda5c[_0xaa2671(0x17c)]??null}))),_0x325f1d=_0xb45f7a['filter'](_0x5d7a95=>_0x5d7a95[_0xaa2671(0x197)]===_0xaa2671(0x17e))['map'](_0x43d11c=>_0x43d11c[_0xaa2671(0x183)]),_0x4d05ab=_0xb45f7a[_0xaa2671(0x185)](_0x201311=>_0x201311[_0xaa2671(0x197)]===_0xaa2671(0x179))[_0xaa2671(0x17b)];return logger[_0xaa2671(0x173)](_0xaa2671(0x17a),_0xaa2671(0x19e),{'count':_0x444231[_0xaa2671(0x17b)],'resources':_0x43d5ad}),{'updated':_0x325f1d['length'],'failed':_0x4d05ab,'skipped':![],'menus':_0x325f1d};}function normalizeMode(_0x5291d4){const _0x260896=a102_0x2a16;if(!_0x5291d4)return _0x260896(0x188);if(_0x5291d4===_0x260896(0x188)||_0x5291d4===_0x260896(0x199))return _0x5291d4;throw new Error(_0x260896(0x181)+_0x5291d4+'.\x20Allowed\x20values:\x20replace,\x20patch');}function buildMenuUpdateDiff(_0x564808,_0x6e80d5,_0x4ee5a7,_0x40fb58){const _0x4d4d27=a102_0x2a16,_0x596bd4=[..._0x564808['resources']],_0x1ce801=_0x4ee5a7==='patch'?patchResources(_0x596bd4,_0x6e80d5):replaceResources(_0x6e80d5),_0x188304=[],_0x43f428=_0x596bd4['some'](isJsResource),_0x36fa1f=_0x1ce801[_0x4d4d27(0x19a)](isJsResource);if(_0x43f428&&!_0x36fa1f){const _0x42e531='menu\x20update\x20would\x20remove\x20existing\x20JS\x20resource\x20for\x20\x22'+_0x564808[_0x4d4d27(0x175)]+_0x4d4d27(0x178)+_0x564808[_0x4d4d27(0x170)]+').\x20'+_0x4d4d27(0x177);if(!_0x40fb58)throw new Error(_0x42e531);_0x188304['push'](_0x42e531);}const _0x4d6c17=_0x596bd4['some'](isCssResource),_0x47b175=_0x1ce801[_0x4d4d27(0x19a)](isCssResource);return _0x4d6c17&&!_0x47b175&&_0x188304['push'](_0x4d4d27(0x19f)+_0x564808['label']+_0x4d4d27(0x178)+_0x564808[_0x4d4d27(0x170)]+').'),{'id':_0x564808['id'],'label':_0x564808[_0x4d4d27(0x175)],'path':_0x564808[_0x4d4d27(0x170)],'mode':_0x4ee5a7,'before':{'resources':_0x596bd4},'after':{'resources':_0x1ce801},'warnings':_0x188304};}function replaceResources(_0x2cdb3a){const _0x49371f=a102_0x2a16;return[_0x2cdb3a['jsUrl'],_0x2cdb3a[_0x49371f(0x182)]]['filter'](_0x300f5b=>!!_0x300f5b);}function patchResources(_0x50f5d0,_0x3efb2b){const _0x3c5e27=a102_0x2a16;let _0x1ad45c=![],_0x4336c7=![];const _0xa8de24=[];for(const _0x4a3ad6 of _0x50f5d0){if(isJsResource(_0x4a3ad6)){if(_0x3efb2b[_0x3c5e27(0x19d)]&&!_0x1ad45c)_0xa8de24['push'](_0x3efb2b[_0x3c5e27(0x19d)]),_0x1ad45c=!![];else!_0x3efb2b['jsUrl']&&_0xa8de24[_0x3c5e27(0x16f)](_0x4a3ad6);continue;}if(isCssResource(_0x4a3ad6)){if(_0x3efb2b['cssUrl']&&!_0x4336c7)_0xa8de24[_0x3c5e27(0x16f)](_0x3efb2b[_0x3c5e27(0x182)]),_0x4336c7=!![];else!_0x3efb2b[_0x3c5e27(0x182)]&&_0xa8de24[_0x3c5e27(0x16f)](_0x4a3ad6);continue;}_0xa8de24['push'](_0x4a3ad6);}return _0x3efb2b[_0x3c5e27(0x19d)]&&!_0x1ad45c&&_0xa8de24[_0x3c5e27(0x174)](_0x3efb2b[_0x3c5e27(0x19d)]),_0x3efb2b[_0x3c5e27(0x182)]&&!_0x4336c7&&_0xa8de24[_0x3c5e27(0x16f)](_0x3efb2b['cssUrl']),_0xa8de24;}function isJsResource(_0x53d84e){const _0x2c1ae8=a102_0x2a16;return stripQuery(_0x53d84e)['toLowerCase']()[_0x2c1ae8(0x16e)]('.js');}function isCssResource(_0x2e519e){const _0x4f99a6=a102_0x2a16;return stripQuery(_0x2e519e)[_0x4f99a6(0x1a4)]()['endsWith'](_0x4f99a6(0x1a1));}function stripQuery(_0x380ad5){const _0x8349e8=a102_0x2a16;return _0x380ad5[_0x8349e8(0x193)]('?')[0x0]??_0x380ad5;}function parseUpdateParamsFlag(_0x15d3c4){const _0xc90cff=a102_0x2a16;if(!_0x15d3c4||typeof _0x15d3c4!==_0xc90cff(0x18f))return{};try{const _0x10bf64=JSON['parse'](_0x15d3c4);if(typeof _0x10bf64!==_0xc90cff(0x176)||_0x10bf64===null||Array[_0xc90cff(0x192)](_0x10bf64))return{};return{'jsUrl':typeof _0x10bf64[_0xc90cff(0x19d)]==='string'?_0x10bf64[_0xc90cff(0x19d)][_0xc90cff(0x194)]():undefined,'cssUrl':typeof _0x10bf64['cssUrl']===_0xc90cff(0x18f)?_0x10bf64[_0xc90cff(0x182)][_0xc90cff(0x194)]():undefined};}catch{return{};}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a103_0x14d9(){const _0x107a6c=['trim','35mcMTpZ','test','3042045SBDPBY','9166sOuJcK','HEAD','11aqjTfd','278YruNXr','9021520wqamfj','1022727PhmZDi','3589535WPLIpA','1522182dPgTNX','4oxyFUH','41632210gETHOX'];a103_0x14d9=function(){return _0x107a6c;};return a103_0x14d9();}(function(_0x2c5a7d,_0x5bd8cc){const _0x1853e6=a103_0x5039,_0x1b2382=_0x2c5a7d();while(!![]){try{const _0x5b138a=parseInt(_0x1853e6(0xe9))/0x1*(parseInt(_0x1853e6(0xde))/0x2)+parseInt(_0x1853e6(0xe0))/0x3*(parseInt(_0x1853e6(0xe3))/0x4)+parseInt(_0x1853e6(0xe1))/0x5+parseInt(_0x1853e6(0xe2))/0x6*(parseInt(_0x1853e6(0xe6))/0x7)+parseInt(_0x1853e6(0xdf))/0x8+parseInt(_0x1853e6(0xe8))/0x9+-parseInt(_0x1853e6(0xe4))/0xa*(parseInt(_0x1853e6(0xeb))/0xb);if(_0x5b138a===_0x5bd8cc)break;else _0x1b2382['push'](_0x1b2382['shift']());}catch(_0x270b9c){_0x1b2382['push'](_0x1b2382['shift']());}}}(a103_0x14d9,0xdcaa9));export function isValidJsHttpsUrl(_0x546408){const _0x4c34c4=a103_0x5039;return/^https:\/\/.+\.js(\?.*)?$/[_0x4c34c4(0xe7)](_0x546408[_0x4c34c4(0xe5)]());}function a103_0x5039(_0x50466b,_0x266ff3){_0x50466b=_0x50466b-0xde;const _0x14d9ca=a103_0x14d9();let _0x50395f=_0x14d9ca[_0x50466b];return _0x50395f;}export function isValidCssHttpsUrl(_0x41b3b2){const _0x3697ce=a103_0x5039;return/^https:\/\/.+\.css(\?.*)?$/[_0x3697ce(0xe7)](_0x41b3b2[_0x3697ce(0xe5)]());}export async function isUrlReachable(_0x290472){const _0x3425da=a103_0x5039;try{const _0x504265=await fetch(_0x290472,{'method':_0x3425da(0xea)});return _0x504265['ok'];}catch{return![];}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a104_0xa2527a=a104_0x53ff;(function(_0x73c7d0,_0x4276c6){const _0x55a49d=a104_0x53ff,_0x12aa30=_0x73c7d0();while(!![]){try{const _0x9373e8=-parseInt(_0x55a49d(0x194))/0x1+-parseInt(_0x55a49d(0x1ae))/0x2+parseInt(_0x55a49d(0x196))/0x3*(-parseInt(_0x55a49d(0x16f))/0x4)+parseInt(_0x55a49d(0x19a))/0x5+parseInt(_0x55a49d(0x197))/0x6*(parseInt(_0x55a49d(0x1a0))/0x7)+parseInt(_0x55a49d(0x19b))/0x8*(parseInt(_0x55a49d(0x1a4))/0x9)+-parseInt(_0x55a49d(0x192))/0xa*(-parseInt(_0x55a49d(0x1b0))/0xb);if(_0x9373e8===_0x4276c6)break;else _0x12aa30['push'](_0x12aa30['shift']());}catch(_0x2c89d1){_0x12aa30['push'](_0x12aa30['shift']());}}}(a104_0x2601,0x33065));import a104_0x2da3fe from'chalk';function a104_0x53ff(_0x3daf57,_0x84065c){_0x3daf57=_0x3daf57-0x16f;const _0x260187=a104_0x2601();let _0x53ff9c=_0x260187[_0x3daf57];return _0x53ff9c;}import{buildCompareRows,doCreateMenus,fetchMenuData}from'../../commands/menu/shared/logic.js';import{renderCompareTable,renderSyncSummary}from'../../commands/menu/shared/compare-table.js';import{selectPages,askJsUrl,askCssUrl,askConfirm,startSpinner,stopSpinner,isInteractive,requireInteractive}from'../../commands/menu/shared/inquirer.js';import{CliErrors}from'../../errors.js';function a104_0x2601(){const _0x415e6e=['\x20menu(s)...','str','Fetching\x20online\x20menu\x20list...','4TpCYor','params','\x20page(s)','\x20and\x20CSS:\x20','✓\x20Menu\x20sync\x20completed:\x20','onlinePaths','pages','flag','skipped','\x20\x20✓\x20Selected:\x20','\x20\x20Create\x20','Pre-fill\x20JS/CSS\x20URLs\x20and/or\x20select\x20specific\x20pages.\x20','sync','size','Online\x20menu\x20list\x20fetched','\x20created,\x20','validation','Menu\x20sync\x20skipped','\x20\x20Cancelled.','!\x20No\x20local\x20pages\x20found\x20in\x20src/pages','map','appCode','string','isArray','\x20\x20!\x20No\x20local\x20pages\x20found,\x20please\x20create\x20pages\x20first','Non-interactive:\x20auto-create\x20all\x20local\x20pages\x20not\x20yet\x20on\x20platform','cookie','yes','message','\x20failed.','onlineMenuList','Failed\x20to\x20fetch\x20online\x20menu\x20list','JSON:\x20{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22,\x22pages\x22:[\x22Page1\x22]}','menu\x20sync\x20requires\x20a\x20project\x20context\x20or\x20explicit\x20--appcode.\x20','trim','20nHQLuS','Sync\x20local\x20pages\x20as\x20platform\x20menus','101391pPHwyF','cssUrl','382971agOboh','216882WlYjGh','gray','menu','1270640APwkkW','431104qQonEl','✓\x20All\x20local\x20pages\x20are\x20already\x20on\x20platform','\x20menu(s)\x20with\x20JS:\x20','boolean','Menu\x20creation\x20failed','77igCrMv','created','object','Menu\x20sync\x20completed:\x20','18DXiNKS','jsUrl','\x20menu(s)\x20created','Creating\x20','\x20menu(s)','Run\x20inside\x20a\x20directory\x20with\x20.rabetbase.json,\x20or\x20pass\x20--appcode\x20<code>.','rawFlags','cyan','yellow','parse','670044gCvcrz','\x20created.','74503UrEHen','length','appcode','selectedAppName'];a104_0x2601=function(){return _0x415e6e;};return a104_0x2601();}import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';import{runMenuSyncCore,readPageLabelsFromStdin}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':a104_0xa2527a(0x199),'command':a104_0xa2527a(0x17b),'description':a104_0xa2527a(0x193),'risk':'write','flags':[{'name':a104_0xa2527a(0x170),'type':a104_0xa2527a(0x185),'description':a104_0xa2527a(0x17a)+a104_0xa2527a(0x18f)},{'name':a104_0xa2527a(0x18a),'type':a104_0xa2527a(0x19e),'description':a104_0xa2527a(0x188)}],async 'execute'(_0x176a30){const _0x3506db=a104_0xa2527a,_0x57f1ea=_0x176a30['rawFlags']['appcode']?String(_0x176a30[_0x3506db(0x1aa)][_0x3506db(0x1b2)])[_0x3506db(0x191)]():'';if(!isInProject()&&!_0x176a30[_0x3506db(0x1b3)]&&!_0x57f1ea)throw CliErrors[_0x3506db(0x17f)](_0x3506db(0x190)+_0x3506db(0x1a9));const _0x3a8845=_0x176a30[_0x3506db(0x176)]('yes'),_0x26aeef=_0x176a30[_0x3506db(0x1b5)](_0x3506db(0x170)),_0x121274=parseParams(_0x26aeef),_0x1a788d=!!(_0x121274[_0x3506db(0x1a5)]||_0x121274[_0x3506db(0x195)]||_0x121274[_0x3506db(0x175)]&&_0x121274['pages'][_0x3506db(0x1b1)]>0x0);if(_0x3a8845||_0x1a788d){let _0x416ddb=[];!isInteractive()&&!_0x121274[_0x3506db(0x175)]?.[_0x3506db(0x1b1)]&&(_0x416ddb=await readPageLabelsFromStdin());const _0xd8a091=await runMenuSyncCore(_0x176a30[_0x3506db(0x184)],_0x176a30[_0x3506db(0x189)],_0x416ddb[_0x3506db(0x1b1)]>0x0?_0x416ddb:_0x121274['pages']??[],_0x26aeef);if(_0xd8a091[_0x3506db(0x177)]){const _0x36934=getLocalPages();_0x36934['length']===0x0?writeCliSideChannelLine(_0x3506db(0x182)):writeCliSideChannelLine(_0x3506db(0x19c));}else writeCliSideChannelLine(_0x3506db(0x173)+_0xd8a091[_0x3506db(0x1a1)]+_0x3506db(0x1a6));return{'ok':!![],'data':_0xd8a091,'message':_0xd8a091['skipped']?_0x3506db(0x180):_0x3506db(0x1a3)+_0xd8a091['created']+_0x3506db(0x1af)};}requireInteractive();const _0x183b3c=startSpinner(_0x3506db(0x1b6));let _0x48584c,_0x19c9ed,_0x1d8a95;try{const _0x510033=await fetchMenuData(_0x176a30['appCode'],_0x176a30['cookie']);_0x48584c=_0x510033['localPages'],_0x19c9ed=_0x510033[_0x3506db(0x174)],_0x1d8a95=_0x510033[_0x3506db(0x18d)],stopSpinner(_0x183b3c,_0x3506db(0x17d),!![]);}catch(_0x4f0457){stopSpinner(_0x183b3c,'Failed\x20to\x20fetch\x20online\x20menu\x20list',![]);throw CliErrors[_0x3506db(0x17f)](_0x4f0457 instanceof Error?_0x4f0457['message']:_0x3506db(0x18e));}if(_0x48584c[_0x3506db(0x1b1)]===0x0)return writeCliSideChannelLine(a104_0x2da3fe[_0x3506db(0x1ac)](_0x3506db(0x187))),{'ok':!![]};const _0x5858e2=buildCompareRows(_0x48584c,_0x19c9ed);writeCliSideChannelLine(renderCompareTable(_0x5858e2)),writeCliSideChannelLine('');const _0x51d1f9=_0x121274[_0x3506db(0x175)],_0x3af0e9=await selectPages(_0x48584c,_0x19c9ed,_0x51d1f9);writeCliSideChannelLine(''),writeCliSideChannelLine(a104_0x2da3fe[_0x3506db(0x1ab)](_0x3506db(0x178)+_0x3af0e9[_0x3506db(0x1b1)]+_0x3506db(0x171)));const _0x4bbf57=_0x121274[_0x3506db(0x1a5)]&&_0x121274[_0x3506db(0x195)];if(!_0x4bbf57){writeCliSideChannelLine(renderSyncSummary(_0x3af0e9,_0x19c9ed[_0x3506db(0x17c)]>0x0));const _0x2ec7c6=await askConfirm('\x20\x20Continue\x20with\x20creation?');if(!_0x2ec7c6)return writeCliSideChannelLine(a104_0x2da3fe[_0x3506db(0x198)](_0x3506db(0x181))),{'ok':!![]};}let _0x550581=_0x121274[_0x3506db(0x1a5)],_0x522b18=_0x121274['cssUrl'];!_0x550581&&(_0x550581=await askJsUrl());!_0x522b18&&(_0x522b18=await askCssUrl());const _0x433ab4=await askConfirm(_0x3506db(0x179)+_0x3af0e9['length']+_0x3506db(0x19d)+_0x550581+_0x3506db(0x172)+_0x522b18+'?');if(!_0x433ab4)return writeCliSideChannelLine(a104_0x2da3fe[_0x3506db(0x198)](_0x3506db(0x181))),{'ok':!![]};const _0x919907=[_0x550581,_0x522b18],_0x5d111a=startSpinner(_0x3506db(0x1a7)+_0x3af0e9[_0x3506db(0x1b1)]+_0x3506db(0x1b4));try{const _0x232bb7=await doCreateMenus(_0x176a30['appCode'],_0x176a30['cookie'],_0x3af0e9,_0x919907);return stopSpinner(_0x5d111a,'Created\x20'+_0x232bb7[_0x3506db(0x1a1)]+_0x3506db(0x1a8),!![]),{'ok':!![],'data':_0x232bb7,'message':_0x3506db(0x1a3)+_0x232bb7[_0x3506db(0x1a1)]+_0x3506db(0x17e)+_0x232bb7['failed']+_0x3506db(0x18c)};}catch(_0x5a3cd0){stopSpinner(_0x5d111a,_0x3506db(0x19f),![]);throw CliErrors[_0x3506db(0x17f)](_0x5a3cd0 instanceof Error?_0x5a3cd0[_0x3506db(0x18b)]:_0x3506db(0x19f));}}};function parseParams(_0x1a8b22){const _0x454910=a104_0xa2527a;if(!_0x1a8b22)return{};try{const _0x343764=JSON[_0x454910(0x1ad)](_0x1a8b22);if(typeof _0x343764!==_0x454910(0x1a2)||_0x343764===null||Array[_0x454910(0x186)](_0x343764))return{};return{'jsUrl':typeof _0x343764[_0x454910(0x1a5)]==='string'?_0x343764['jsUrl'][_0x454910(0x191)]():undefined,'cssUrl':typeof _0x343764[_0x454910(0x195)]===_0x454910(0x185)?_0x343764[_0x454910(0x195)][_0x454910(0x191)]():undefined,'pages':Array[_0x454910(0x186)](_0x343764[_0x454910(0x175)])?_0x343764[_0x454910(0x175)][_0x454910(0x183)](String):undefined};}catch{return{};}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a105_0x2ac2cb=a105_0x3d0e;(function(_0x33e968,_0x282038){const _0x213d8c=a105_0x3d0e,_0x567a60=_0x33e968();while(!![]){try{const _0x1e4964=-parseInt(_0x213d8c(0x7a))/0x1*(parseInt(_0x213d8c(0x88))/0x2)+parseInt(_0x213d8c(0x8d))/0x3+-parseInt(_0x213d8c(0x8f))/0x4*(-parseInt(_0x213d8c(0x9b))/0x5)+parseInt(_0x213d8c(0x85))/0x6+parseInt(_0x213d8c(0xa7))/0x7+-parseInt(_0x213d8c(0xa1))/0x8+parseInt(_0x213d8c(0xbc))/0x9*(-parseInt(_0x213d8c(0x90))/0xa);if(_0x1e4964===_0x282038)break;else _0x567a60['push'](_0x567a60['shift']());}catch(_0x1daf41){_0x567a60['push'](_0x567a60['shift']());}}}(a105_0x5069,0x570fa));import a105_0x767348 from'chalk';import{filterMenusWithResources,doUpdateCdnUrls,fetchOnlineMenuList}from'../../commands/menu/shared/logic.js';import{renderUpdateSummary}from'../../commands/menu/shared/compare-table.js';import{askJsUrl,askCssUrl,askConfirm,startSpinner,stopSpinner,isInteractive,requireInteractive}from'../../commands/menu/shared/inquirer.js';import{CliErrors}from'../../errors.js';function a105_0x5069(){const _0x7002f9=['jsUrl','565811drIkJh','menu\x20update\x20requires\x20a\x20project\x20context\x20or\x20explicit\x20--appcode.\x20','yellow','\x20menu(s)\x20updated','appcode','Resource\x20update\x20mode:\x20replace\x20rewrites\x20resources\x20from\x20supplied\x20URLs;\x20patch\x20replaces\x20only\x20supplied\x20resource\x20types','Fetching\x20online\x20menu\x20list...','object','mode','diffs','isArray','3027222iMhUen','bool','update','2PKZCwT','\x20updated.','\x20and\x20CSS:\x20','gray','Menu\x20update\x20failed','1584381YIdTMG','!\x20No\x20menus\x20with\x20existing\x20resources\x20found','8bTxWFM','4950210rkaCww','message','\x20menu(s)\x20failed','cookie','validation','updated','Menu\x20update\x20skipped','str','trim','selectedAppName','POST','1015475ORRWUq','\x20menu(s)\x20with\x20existing\x20resources','params','Update\x20CDN\x20asset\x20URLs\x20for\x20all\x20online\x20menus\x20with\x20existing\x20resources','string','/smartapi/menu/update','197464DRiSbq','parse','Would\x20update\x20','patch','\x20menu(s)\x20with\x20JS:\x20','Failed\x20to\x20fetch\x20online\x20menu\x20list','3487988yMHiio','skipped','\x20menu(s)...','cyan','\x20\x20Found\x20','cssUrl','label','flag','Updated\x20','length','appCode','Run\x20inside\x20a\x20directory\x20with\x20.rabetbase.json,\x20or\x20pass\x20--appcode\x20<code>.','map','rawFlags','force','\x20menu\x20resource\x20set(s).','\x20menu(s)','Menu\x20update\x20completed:\x20','Online\x20menu\x20list\x20fetched','failed','yes','18muJcok','Updating\x20','\x20updated,\x20','replace','menu','\x20failed.'];a105_0x5069=function(){return _0x7002f9;};return a105_0x5069();}import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';function a105_0x3d0e(_0x2eef16,_0x959b9a){_0x2eef16=_0x2eef16-0x76;const _0x5069d0=a105_0x5069();let _0x3d0e58=_0x5069d0[_0x2eef16];return _0x3d0e58;}import{runMenuUpdateCore}from'../../commands/menu/shared/update-core.js';import{isInProject}from'../../context.js';export const menuUpdate={'service':a105_0x2ac2cb(0x77),'command':a105_0x2ac2cb(0x87),'description':a105_0x2ac2cb(0x9e),'risk':'high-risk-write','flags':[{'name':a105_0x2ac2cb(0x9d),'type':a105_0x2ac2cb(0x9f),'description':'Pre-fill\x20JS/CSS\x20URLs\x20to\x20update.\x20'+'JSON:\x20{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}'},{'name':a105_0x2ac2cb(0xbb),'type':'boolean','description':'Non-interactive:\x20update\x20all\x20menus\x20without\x20confirmation;\x20requires\x20--params'},{'name':'mode','type':'string','description':a105_0x2ac2cb(0x7f),'enum':[a105_0x2ac2cb(0x76),a105_0x2ac2cb(0xa4)],'default':a105_0x2ac2cb(0x76)},{'name':a105_0x2ac2cb(0xb5),'type':'boolean','description':'Allow\x20replace\x20mode\x20to\x20remove\x20existing\x20JS\x20resources'}],async 'dryRun'(_0x499597){const _0x34dbd7=a105_0x2ac2cb;ensureRunnableContext(_0x499597[_0x34dbd7(0xb4)],_0x499597[_0x34dbd7(0x99)]);const _0x2681b6=await runMenuUpdateCore(_0x499597[_0x34dbd7(0xb1)],_0x499597[_0x34dbd7(0x93)],_0x499597[_0x34dbd7(0x97)]('params'),{'mode':parseMode(_0x499597[_0x34dbd7(0x97)]('mode')),'dryRun':!![],'force':_0x499597[_0x34dbd7(0x86)]('force')});return{'method':_0x34dbd7(0x9a),'url':_0x34dbd7(0xa0),'body':_0x2681b6,'description':_0x2681b6[_0x34dbd7(0xa8)]?'No\x20menus\x20with\x20existing\x20resources\x20would\x20be\x20updated.':_0x34dbd7(0xa3)+(_0x2681b6[_0x34dbd7(0x83)]?.[_0x34dbd7(0xb0)]??0x0)+_0x34dbd7(0xb6)};},async 'execute'(_0x34dc3c){const _0x1be653=a105_0x2ac2cb;ensureRunnableContext(_0x34dc3c[_0x1be653(0xb4)],_0x34dc3c['selectedAppName']);const _0x3c9cec=_0x34dc3c[_0x1be653(0xae)]('yes'),_0x292946=_0x34dc3c['str'](_0x1be653(0x9d)),_0x5f38be=parseMode(_0x34dc3c[_0x1be653(0x97)](_0x1be653(0x82))),_0x5e1538=_0x34dc3c[_0x1be653(0x86)](_0x1be653(0xb5)),_0x2f1860=parseParams(_0x292946),_0x175fee=!!(_0x2f1860[_0x1be653(0x79)]||_0x2f1860[_0x1be653(0xac)]);if(_0x3c9cec||_0x175fee&&!isInteractive()){const _0x57fc29=await runMenuUpdateCore(_0x34dc3c[_0x1be653(0xb1)],_0x34dc3c[_0x1be653(0x93)],_0x292946,{'mode':_0x5f38be,'force':_0x5e1538});return _0x57fc29[_0x1be653(0xa8)]?writeCliSideChannelLine(_0x1be653(0x8e)):(writeCliSideChannelLine('✓\x20Menu\x20update\x20completed:\x20'+_0x57fc29[_0x1be653(0x95)]+_0x1be653(0x7d)),_0x57fc29[_0x1be653(0xba)]>0x0&&writeCliSideChannelLine('!\x20'+_0x57fc29[_0x1be653(0xba)]+_0x1be653(0x92))),{'ok':_0x57fc29['failed']===0x0,'data':_0x57fc29,'message':_0x57fc29[_0x1be653(0xa8)]?_0x1be653(0x96):_0x1be653(0xb8)+_0x57fc29[_0x1be653(0x95)]+'\x20updated,\x20'+_0x57fc29[_0x1be653(0xba)]+_0x1be653(0x78)};}requireInteractive();const _0x3e9505=startSpinner(_0x1be653(0x80));let _0x314e0d;try{_0x314e0d=await fetchOnlineMenuList(_0x34dc3c[_0x1be653(0xb1)],_0x34dc3c[_0x1be653(0x93)]),stopSpinner(_0x3e9505,_0x1be653(0xb9),!![]);}catch(_0x5e2200){stopSpinner(_0x3e9505,_0x1be653(0xa6),![]);throw CliErrors[_0x1be653(0x94)](_0x5e2200 instanceof Error?_0x5e2200[_0x1be653(0x91)]:'Failed\x20to\x20fetch\x20online\x20menu\x20list');}const _0x1f8de2=filterMenusWithResources(_0x314e0d);if(_0x1f8de2[_0x1be653(0xb0)]===0x0)return writeCliSideChannelLine(a105_0x767348[_0x1be653(0x7c)]('\x20\x20!\x20No\x20menus\x20with\x20existing\x20resources\x20found')),{'ok':!![]};writeCliSideChannelLine(''),writeCliSideChannelLine(a105_0x767348[_0x1be653(0xaa)](_0x1be653(0xab)+_0x1f8de2[_0x1be653(0xb0)]+_0x1be653(0x9c))),writeCliSideChannelLine(renderUpdateSummary(_0x1f8de2[_0x1be653(0xb3)](_0x110e56=>_0x110e56[_0x1be653(0xad)]),[_0x2f1860[_0x1be653(0x79)],_0x2f1860[_0x1be653(0xac)]])),writeCliSideChannelLine('');let _0x172996=_0x2f1860[_0x1be653(0x79)],_0x5cf003=_0x2f1860[_0x1be653(0xac)];!_0x172996&&(_0x172996=await askJsUrl());!_0x5cf003&&(_0x5cf003=await askCssUrl());const _0x49a479=await askConfirm('\x20\x20Update\x20'+_0x1f8de2[_0x1be653(0xb0)]+_0x1be653(0xa5)+_0x172996+_0x1be653(0x8a)+_0x5cf003+'?');if(!_0x49a479)return writeCliSideChannelLine(a105_0x767348[_0x1be653(0x8b)]('\x20\x20Cancelled.')),{'ok':!![]};const _0x44bb58=[_0x172996,_0x5cf003],_0x38496c=startSpinner(_0x1be653(0xbd)+_0x1f8de2[_0x1be653(0xb0)]+_0x1be653(0xa9));try{const _0x4e2ce9=await doUpdateCdnUrls(_0x34dc3c['appCode'],_0x34dc3c[_0x1be653(0x93)],_0x1f8de2,_0x44bb58);return stopSpinner(_0x38496c,_0x1be653(0xaf)+_0x4e2ce9['updated']+_0x1be653(0xb7),_0x4e2ce9[_0x1be653(0xba)]===0x0),{'ok':_0x4e2ce9[_0x1be653(0xba)]===0x0,'data':_0x4e2ce9,'message':_0x4e2ce9[_0x1be653(0xba)]>0x0?_0x1be653(0xb8)+_0x4e2ce9[_0x1be653(0x95)]+_0x1be653(0xbe)+_0x4e2ce9[_0x1be653(0xba)]+'\x20failed.':'Menu\x20update\x20completed:\x20'+_0x4e2ce9[_0x1be653(0x95)]+_0x1be653(0x89)};}catch(_0x13245d){stopSpinner(_0x38496c,_0x1be653(0x8c),![]);throw CliErrors[_0x1be653(0x94)](_0x13245d instanceof Error?_0x13245d['message']:_0x1be653(0x8c));}}};function ensureRunnableContext(_0x119642,_0x59a57b){const _0x35a4a0=a105_0x2ac2cb,_0xb5351b=_0x119642[_0x35a4a0(0x7e)]?String(_0x119642[_0x35a4a0(0x7e)])[_0x35a4a0(0x98)]():'';if(!isInProject()&&!_0x59a57b&&!_0xb5351b)throw CliErrors[_0x35a4a0(0x94)](_0x35a4a0(0x7b)+_0x35a4a0(0xb2));}function parseMode(_0x3f0512){const _0x278ec3=a105_0x2ac2cb;if(!_0x3f0512)return'replace';if(_0x3f0512==='replace'||_0x3f0512===_0x278ec3(0xa4))return _0x3f0512;throw CliErrors['validation']('Invalid\x20--mode.\x20Allowed\x20values:\x20replace,\x20patch');}function parseParams(_0x3ae218){const _0x14b1b4=a105_0x2ac2cb;if(!_0x3ae218)return{};try{const _0x5a9aca=JSON[_0x14b1b4(0xa2)](_0x3ae218);if(typeof _0x5a9aca!==_0x14b1b4(0x81)||_0x5a9aca===null||Array[_0x14b1b4(0x84)](_0x5a9aca))return{};return{'jsUrl':typeof _0x5a9aca['jsUrl']===_0x14b1b4(0x9f)?_0x5a9aca[_0x14b1b4(0x79)][_0x14b1b4(0x98)]():undefined,'cssUrl':typeof _0x5a9aca[_0x14b1b4(0xac)]===_0x14b1b4(0x9f)?_0x5a9aca['cssUrl'][_0x14b1b4(0x98)]():undefined};}catch{return{};}}
|