@lovrabet/rabetbase-cli 2.3.15 → 2.3.16-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -3
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -0
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -0
- package/lib/commands/kb/delete.js +1 -0
- package/lib/commands/kb/detail.js +1 -0
- package/lib/commands/kb/index.js +1 -0
- package/lib/commands/kb/list.js +1 -0
- package/lib/commands/kb/shared.js +1 -0
- package/lib/commands/kb/update.js +1 -0
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-apis-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/non-interactive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/init.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/save.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -0
- package/lib/commands/tenant/members-list.js +1 -0
- package/lib/commands/tenant/shared.js +1 -0
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -0
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +2 -2
- package/lib/commands/app/add.js +0 -1
- package/lib/commands/app/remove.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2371c8,_0x5232e9){const _0x4aa993=a126_0x4295,_0x206468=_0x2371c8();while(!![]){try{const _0x512678=-parseInt(_0x4aa993(0x197))/0x1+-parseInt(_0x4aa993(0x182))/0x2+-parseInt(_0x4aa993(0x180))/0x3+-parseInt(_0x4aa993(0x191))/0x4*(-parseInt(_0x4aa993(0x18b))/0x5)+-parseInt(_0x4aa993(0x185))/0x6*(-parseInt(_0x4aa993(0x18a))/0x7)+parseInt(_0x4aa993(0x183))/0x8+parseInt(_0x4aa993(0x1a5))/0x9;if(_0x512678===_0x5232e9)break;else _0x206468['push'](_0x206468['shift']());}catch(_0x162a7a){_0x206468['push'](_0x206468['shift']());}}}(a126_0x4760,0xc9b08));import{getEnv,isProduction}from'../../../constant/env.js';import{logger}from'../../../utils/logger.js';import{fetchMenuSnapshot,toProcessedMenuItem}from'../../../commands/menu/shared/facts.js';import{batchDeleteMenuRecords,createMenuRecord,startMenuRegroup as a126_0x7df8b9,updateMenuRecord}from'../../../core/api-client.js';export async function getOnlineMenuList(_0x697cba,_0x180dd1){const _0x45bd7b=a126_0x4295,_0x19227d=getEnv();logger[_0x45bd7b(0x198)](_0x45bd7b(0x19e),isProduction(_0x19227d)?_0x45bd7b(0x181)+_0x697cba+')':_0x45bd7b(0x187)+_0x697cba+')');const _0x532b6f=await fetchMenuSnapshot(_0x697cba,_0x180dd1,{'verbose':!![]});return logger[_0x45bd7b(0x198)]('get-online-menu-list',_0x45bd7b(0x1a0)+_0x532b6f[_0x45bd7b(0x19b)]+_0x45bd7b(0x1a4)),_0x532b6f[_0x45bd7b(0x193)][_0x45bd7b(0x17e)](toProcessedMenuItem);}export async function createMenu(_0x912510,_0x24c77e,_0xf63bb6){const _0x42937d=a126_0x4295;logger[_0x42937d(0x198)](_0x42937d(0x18c),_0x42937d(0x184)+_0xf63bb6[_0x42937d(0x188)]+'\x20('+_0xf63bb6[_0x42937d(0x1a3)]+')');const _0x5213a0={'appCode':_0x912510,'type':'procode','sort':0x0,'extend':{'loadScriptMode':_0x42937d(0x1a2),'resources':_0xf63bb6[_0x42937d(0x195)]?JSON[_0x42937d(0x17f)](_0xf63bb6['resources']):undefined},..._0xf63bb6},_0x1e97c3=await createMenuRecord(_0x5213a0,_0x24c77e,_0x42937d(0x17d)+_0xf63bb6[_0x42937d(0x188)]+'\x22');return logger[_0x42937d(0x198)]('create-menu',_0x42937d(0x190)+_0xf63bb6[_0x42937d(0x188)]),_0x1e97c3;}async function createSingleMenu(_0x529e62,_0x16dba4,_0x440903,_0x39ae18){const _0x27c8e5=a126_0x4295,_0x37ba54={'appCode':_0x529e62,'type':_0x27c8e5(0x186),'sort':0x0,'extend':{'loadScriptMode':_0x27c8e5(0x1a2),'resources':_0x39ae18?JSON[_0x27c8e5(0x17f)](_0x39ae18):undefined},'label':_0x440903[_0x27c8e5(0x188)],'path':_0x440903['path']},_0xd66135=await createMenuRecord(_0x37ba54,_0x16dba4,'Create\x20menu\x20\x22'+_0x440903[_0x27c8e5(0x188)]+'\x22');return logger['info'](_0x27c8e5(0x18c),_0x27c8e5(0x190)+_0x440903[_0x27c8e5(0x188)]),_0xd66135;}function a126_0x4760(){const _0x3e0c4d=['resources','Delete\x20','672221toHsQb','info','\x20menu','update-menu-cdn-url','total','Regroup\x20','Start\x20batch\x20menu\x20creation,\x20total\x20','get-online-menu-list','\x20menu\x20group(s)','Fetched\x20','Update\x20menu\x20','import','path','\x20online\x20menus\x20successfully','12085911hcgRWA','Create\x20menu\x20\x22','map','stringify','1720197RvJnzq','Fetching\x20online\x20menu\x20list...\x20(appCode:\x20','2924938xTRddw','12638192SFSZoh','Creating\x20menu:\x20','903858oKdEwS','procode','Fetching\x20daily\x20menu\x20list...\x20(appCode:\x20','label','loadScriptMode','21krAXKa','61395cgNsJK','create-menu','length','extend','menuGroups','Menu\x20created\x20successfully:\x20','52oopIhQ','all','menus','create-menus'];a126_0x4760=function(){return _0x3e0c4d;};return a126_0x4760();}export async function createMenus(_0x1b8ecc,_0x488dae,_0x4bb0b5,_0x6af51c){const _0x3c1f94=a126_0x4295;logger[_0x3c1f94(0x198)](_0x3c1f94(0x194),_0x3c1f94(0x19d)+_0x4bb0b5[_0x3c1f94(0x18d)]);const _0x1f095e=await Promise[_0x3c1f94(0x192)](_0x4bb0b5['map'](_0x3f0ef6=>createSingleMenu(_0x1b8ecc,_0x488dae,_0x3f0ef6,_0x6af51c)));return logger['info'](_0x3c1f94(0x194),'Batch\x20menu\x20creation\x20completed,\x20total\x20'+_0x4bb0b5['length']),_0x1f095e;}export async function updateMenuCdnUrl(_0x833959,_0x41b3ea,_0xc18ba3){const _0x434aa1=a126_0x4295;logger[_0x434aa1(0x198)](_0x434aa1(0x19a),'Updating\x20menu\x20asset\x20links:\x20'+_0xc18ba3[_0x434aa1(0x188)]+'\x20('+_0xc18ba3[_0x434aa1(0x1a3)]+')');const _0x5eaf96={'id':_0xc18ba3['id'],'appCode':_0x833959,'extend':{..._0xc18ba3[_0x434aa1(0x18e)]??{},..._0xc18ba3[_0x434aa1(0x189)]?{'loadScriptMode':_0xc18ba3[_0x434aa1(0x189)]}:{},'resources':_0xc18ba3[_0x434aa1(0x195)]?JSON[_0x434aa1(0x17f)](_0xc18ba3[_0x434aa1(0x195)]):undefined}},_0x151b33=await updateMenuRecord(_0x5eaf96,_0x41b3ea,'Update\x20menu\x20assets\x20\x22'+_0xc18ba3['label']+'\x22');return logger[_0x434aa1(0x198)]('update-menu-cdn-url','Menu\x20assets\x20synced:\x20'+_0xc18ba3[_0x434aa1(0x188)],undefined),_0x151b33;}function a126_0x4295(_0x3d6778,_0x57190d){_0x3d6778=_0x3d6778-0x17d;const _0x476098=a126_0x4760();let _0x42953e=_0x476098[_0x3d6778];return _0x42953e;}export async function createMenuEntity(_0x14488f,_0x2089fd,_0x1233c1){const _0x1435ef=a126_0x4295;return createMenuRecord({'appCode':_0x14488f,..._0x1233c1},_0x2089fd,'Create\x20menu\x20\x22'+_0x1233c1[_0x1435ef(0x188)]+'\x22');}export async function updateMenuEntity(_0x31454d,_0x1e30dd,_0x2024b4){const _0x5c6a39=a126_0x4295;return updateMenuRecord({'appCode':_0x31454d,..._0x2024b4},_0x1e30dd,_0x5c6a39(0x1a1)+_0x2024b4['id']);}export async function batchDeleteMenuEntities(_0x4caaa0,_0x5de579){const _0x5d1912=a126_0x4295;return batchDeleteMenuRecords(_0x5de579,_0x4caaa0,_0x5d1912(0x196)+_0x5de579[_0x5d1912(0x18d)]+_0x5d1912(0x199)+(_0x5de579[_0x5d1912(0x18d)]===0x1?'':'s'));}export async function startMenuRegroup(_0x1870b2,_0x5a9dcc){const _0x29ee19=a126_0x4295;return a126_0x7df8b9(_0x5a9dcc,_0x1870b2,_0x29ee19(0x19c)+_0x5a9dcc[_0x29ee19(0x18f)][_0x29ee19(0x18d)]+_0x29ee19(0x19f));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a127_0x3bbe9f=a127_0x484b;function a127_0x484b(_0x744545,_0x5b1a99){_0x744545=_0x744545-0x184;const _0x211783=a127_0x2117();let _0x484b08=_0x211783[_0x744545];return _0x484b08;}(function(_0x1e48fc,_0x11518e){const _0x48c5df=a127_0x484b,_0x4a508c=_0x1e48fc();while(!![]){try{const _0x539ad4=parseInt(_0x48c5df(0x1a1))/0x1*(parseInt(_0x48c5df(0x192))/0x2)+-parseInt(_0x48c5df(0x19f))/0x3*(parseInt(_0x48c5df(0x1a8))/0x4)+-parseInt(_0x48c5df(0x1a5))/0x5*(-parseInt(_0x48c5df(0x1a0))/0x6)+parseInt(_0x48c5df(0x1aa))/0x7*(-parseInt(_0x48c5df(0x19c))/0x8)+-parseInt(_0x48c5df(0x19a))/0x9*(parseInt(_0x48c5df(0x197))/0xa)+parseInt(_0x48c5df(0x191))/0xb*(-parseInt(_0x48c5df(0x190))/0xc)+-parseInt(_0x48c5df(0x1a4))/0xd*(-parseInt(_0x48c5df(0x1ad))/0xe);if(_0x539ad4===_0x11518e)break;else _0x4a508c['push'](_0x4a508c['shift']());}catch(_0x1fd5b4){_0x4a508c['push'](_0x4a508c['shift']());}}}(a127_0x2117,0xb5c77));import{getLocalPages}from'../../../commands/menu/shared/local-pages.js';import{getOnlineMenuList,createMenus}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';function a127_0x2117(){const _0x2dd333=['Invalid\x20--params:\x20expected\x20a\x20JSON\x20object.','label','get','push','hasOwn','info','Invalid\x20--params.','dryRun','path','Invalid\x20--params\x20JSON.','Invalid\x20--params\x20fields:\x20','import','map','--params.pages\x20is\x20no\x20longer\x20supported.\x20Use\x20--paths\x20with\x20exact\x20local\x20page\x20paths.','CSS\x20URL\x20is\x20unreachable:\x20','JS\x20URL\x20is\x20unreachable:\x20','12996OEEOOo','1837rtlRgA','452fJIFkg','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','Invalid\x20--params:\x20','menu-sync','No\x20local\x20pages\x20matched\x20paths:\x20','3265130SuLkKe','parse','join','9nATYEy','isArray','11305744VlNsTK','length','filter','114dqwiHA','576HISslK','4309gUcJcM','Start\x20non-interactive\x20menu\x20sync','jsUrl','42289ZoHbYP','100pmHCzC','--params.','field','32072fAMjVO','cssUrl','7rMKGZv','object','trim','8582aMecap','string'];a127_0x2117=function(){return _0x2dd333;};return a127_0x2117();}import{logger}from'../../../utils/logger.js';const MENU_SYNC_PARAM_KEYS=new Set([a127_0x3bbe9f(0x1a3),'cssUrl']);function validateParams(_0x406210){const _0x952049=a127_0x3bbe9f,_0x444ead=[];return _0x406210[_0x952049(0x1a3)]&&!isValidJsHttpsUrl(_0x406210[_0x952049(0x1a3)])&&_0x444ead[_0x952049(0x1b2)]({'field':_0x952049(0x1a3),'message':'JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL'}),_0x406210[_0x952049(0x1a9)]&&!isValidCssHttpsUrl(_0x406210[_0x952049(0x1a9)])&&_0x444ead['push']({'field':'cssUrl','message':_0x952049(0x193)}),_0x444ead;}export async function runMenuSyncCore(_0x5943eb,_0x40b020,_0x30582f=[],_0x348a36,_0x352788={}){const _0x4ed93d=a127_0x3bbe9f,_0x9990ef=parseMenuSyncParams(_0x348a36),_0x1ad7c7=[...new Set(_0x30582f[_0x4ed93d(0x18c)](_0xc4b3c2=>_0xc4b3c2[_0x4ed93d(0x1ac)]())[_0x4ed93d(0x19e)](Boolean))],_0x5aa3b1=_0x9990ef[_0x4ed93d(0x1a3)],_0xe2edd2=_0x9990ef['cssUrl'],_0xd7293e=[];if(_0x5aa3b1)_0xd7293e[_0x4ed93d(0x1b2)](_0x5aa3b1);if(_0xe2edd2)_0xd7293e['push'](_0xe2edd2);const _0x2d6cd8=validateParams(_0x9990ef);if(_0x2d6cd8['length']>0x0){const _0x5afddf=_0x2d6cd8['map'](_0x2eac42=>_0x4ed93d(0x1a6)+_0x2eac42[_0x4ed93d(0x1a7)]+':\x20'+_0x2eac42['message'])[_0x4ed93d(0x199)](';\x20');throw new Error(_0x4ed93d(0x194)+_0x5afddf);}logger['setLogPath'](process['cwd']()),logger[_0x4ed93d(0x185)]('menu-sync',_0x4ed93d(0x1a2),{'appCode':_0x5943eb,'selectedCount':_0x1ad7c7[_0x4ed93d(0x19d)],'jsUrl':_0x5aa3b1,'cssUrl':_0xe2edd2});if(_0x5aa3b1){const _0xced200=await isUrlReachable(_0x5aa3b1);if(!_0xced200)throw new Error(_0x4ed93d(0x18f)+_0x5aa3b1);}if(_0xe2edd2){const _0x8d60c4=await isUrlReachable(_0xe2edd2);if(!_0x8d60c4)throw new Error(_0x4ed93d(0x18e)+_0xe2edd2);}const _0x515505=getLocalPages();if(_0x515505[_0x4ed93d(0x19d)]===0x0){if(_0x1ad7c7[_0x4ed93d(0x19d)]>0x0)throw new Error(_0x4ed93d(0x196)+_0x1ad7c7[_0x4ed93d(0x199)](',\x20'));return{'created':0x0,'skipped':!![],'dryRun':_0x352788[_0x4ed93d(0x187)]===!![],'targetPages':[],'plannedMenus':[]};}const _0x5a309f=await getOnlineMenuList(_0x5943eb,_0x40b020),_0x536c2e=new Set(_0x5a309f[_0x4ed93d(0x18c)](_0x2d6518=>_0x2d6518['path']));let _0x2d56bb;if(_0x1ad7c7[_0x4ed93d(0x19d)]>0x0){const _0x23a043=new Map(_0x515505['map'](_0x9a9cd8=>[_0x9a9cd8[_0x4ed93d(0x188)],_0x9a9cd8])),_0x3d3679=_0x1ad7c7[_0x4ed93d(0x19e)](_0x5efd5d=>!_0x23a043['has'](_0x5efd5d));if(_0x3d3679[_0x4ed93d(0x19d)]>0x0){const _0x4908f5=_0x515505[_0x4ed93d(0x18c)](_0xe58f3f=>_0xe58f3f[_0x4ed93d(0x188)])[_0x4ed93d(0x199)](',\x20');throw new Error(_0x4ed93d(0x196)+_0x3d3679[_0x4ed93d(0x199)](',\x20')+'\x0a\x20\x20Available\x20local\x20paths:\x20'+_0x4908f5);}const _0x460b8a=_0x1ad7c7[_0x4ed93d(0x19e)](_0x483c70=>_0x536c2e['has'](_0x483c70));if(_0x460b8a[_0x4ed93d(0x19d)]>0x0)throw new Error('Local\x20page\x20paths\x20are\x20already\x20on\x20the\x20platform:\x20'+_0x460b8a[_0x4ed93d(0x199)](',\x20'));_0x2d56bb=_0x1ad7c7['map'](_0x1ad812=>_0x23a043[_0x4ed93d(0x1b1)](_0x1ad812));}else _0x2d56bb=_0x515505[_0x4ed93d(0x19e)](_0x264669=>!_0x536c2e['has'](_0x264669['path']));if(_0x2d56bb[_0x4ed93d(0x19d)]===0x0)return{'created':0x0,'skipped':!![],'dryRun':_0x352788[_0x4ed93d(0x187)]===!![],'targetPages':[],'plannedMenus':[]};const _0x3698be=_0x2d56bb['map'](_0x3020f7=>({'type':'procode','path':_0x3020f7[_0x4ed93d(0x188)],'label':_0x3020f7[_0x4ed93d(0x1b0)],'loadScriptMode':_0x4ed93d(0x18b),'resources':[..._0xd7293e]}));if(_0x352788[_0x4ed93d(0x187)])return{'created':0x0,'skipped':![],'dryRun':!![],'targetPages':_0x2d56bb,'plannedMenus':_0x3698be};const _0x1f7a38=await createMenus(_0x5943eb,_0x40b020,_0x2d56bb,_0xd7293e['length']>0x0?_0xd7293e:undefined);return logger[_0x4ed93d(0x185)](_0x4ed93d(0x195),'Menu\x20sync\x20completed',{'count':_0x2d56bb[_0x4ed93d(0x19d)],'resources':_0xd7293e}),{'created':_0x1f7a38[_0x4ed93d(0x19d)],'skipped':![],'dryRun':![],'targetPages':_0x2d56bb,'plannedMenus':_0x3698be,'menus':_0x1f7a38};}export function parseMenuSyncParams(_0x34c8ef){const _0x3dc390=a127_0x3bbe9f;if(!_0x34c8ef||typeof _0x34c8ef!==_0x3dc390(0x1ae))return{};let _0x3dab36;try{_0x3dab36=JSON[_0x3dc390(0x198)](_0x34c8ef);}catch{throw new Error(_0x3dc390(0x189));}if(typeof _0x3dab36!==_0x3dc390(0x1ab)||_0x3dab36===null||Array[_0x3dc390(0x19b)](_0x3dab36))throw new Error(_0x3dc390(0x1af));const _0x1320bf=_0x3dab36;if(Object[_0x3dc390(0x184)](_0x1320bf,'pages'))throw new Error(_0x3dc390(0x18d));const _0x571776=Object['keys'](_0x1320bf)['filter'](_0x3af764=>!MENU_SYNC_PARAM_KEYS['has'](_0x3af764));if(_0x571776[_0x3dc390(0x19d)]>0x0)throw new Error(_0x3dc390(0x18a)+_0x571776[_0x3dc390(0x199)](',\x20')+'.');for(const _0x14979c of MENU_SYNC_PARAM_KEYS){const _0x2828ec=_0x1320bf[_0x14979c];if(_0x2828ec!==undefined&&(typeof _0x2828ec!==_0x3dc390(0x1ae)||_0x2828ec[_0x3dc390(0x1ac)]()===''))throw new Error(_0x3dc390(0x186)+_0x14979c+':\x20expected\x20a\x20non-empty\x20string.');}return{'jsUrl':typeof _0x1320bf['jsUrl']==='string'?_0x1320bf[_0x3dc390(0x1a3)][_0x3dc390(0x1ac)]():undefined,'cssUrl':typeof _0x1320bf[_0x3dc390(0x1a9)]===_0x3dc390(0x1ae)?_0x1320bf[_0x3dc390(0x1a9)][_0x3dc390(0x1ac)]():undefined};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x4825e0,_0x375ba7){const _0x5944e5=a123_0x4403,_0x10b62e=_0x4825e0();while(!![]){try{const _0x573912=-parseInt(_0x5944e5(0xd7))/0x1+-parseInt(_0x5944e5(0xc6))/0x2*(parseInt(_0x5944e5(0xf1))/0x3)+parseInt(_0x5944e5(0xb7))/0x4*(parseInt(_0x5944e5(0xbb))/0x5)+-parseInt(_0x5944e5(0xf6))/0x6*(-parseInt(_0x5944e5(0xd4))/0x7)+-parseInt(_0x5944e5(0xdb))/0x8+-parseInt(_0x5944e5(0xe5))/0x9*(parseInt(_0x5944e5(0xe4))/0xa)+parseInt(_0x5944e5(0xe9))/0xb;if(_0x573912===_0x375ba7)break;else _0x10b62e['push'](_0x10b62e['shift']());}catch(_0x15a3a9){_0x10b62e['push'](_0x10b62e['shift']());}}}(a123_0x5d9b,0x62959));import{updateMenuCdnUrl,getOnlineMenuList}from'../../../commands/menu/shared/service.js';function a123_0x4403(_0x186f06,_0x50a06c){_0x186f06=_0x186f06-0xb5;const _0x5d9b1d=a123_0x5d9b();let _0x4403de=_0x5d9b1d[_0x186f06];return _0x4403de;}import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';import{logger}from'../../../utils/logger.js';function validateParams(_0x331e2d){const _0x44c90f=a123_0x4403,_0x3096e1=[];return _0x331e2d['jsUrl']&&!isValidJsHttpsUrl(_0x331e2d['jsUrl'])&&_0x3096e1[_0x44c90f(0xf2)]({'field':_0x44c90f(0xcf),'message':_0x44c90f(0xcc)}),_0x331e2d[_0x44c90f(0xd3)]&&!isValidCssHttpsUrl(_0x331e2d[_0x44c90f(0xd3)])&&_0x3096e1[_0x44c90f(0xf2)]({'field':_0x44c90f(0xd3),'message':_0x44c90f(0xbc)}),_0x3096e1;}export async function runMenuUpdateCore(_0x1769d4,_0x29ded8,_0x18ab78,_0x446caf={}){const _0x3af9f3=a123_0x4403,_0x383313=parseUpdateParamsFlag(_0x18ab78),_0x2f8555=normalizeMode(_0x446caf['mode']);validateSelection(_0x446caf['selection']);const _0x13751a=[];if(_0x383313['jsUrl'])_0x13751a[_0x3af9f3(0xf2)](_0x383313[_0x3af9f3(0xcf)]);if(_0x383313[_0x3af9f3(0xd3)])_0x13751a[_0x3af9f3(0xf2)](_0x383313[_0x3af9f3(0xd3)]);const _0x2c4def=validateParams(_0x383313);if(_0x2c4def[_0x3af9f3(0xdf)]>0x0){const _0x4fe4ec=_0x2c4def[_0x3af9f3(0xc9)](_0x44be1f=>_0x3af9f3(0xd9)+_0x44be1f['field']+':\x20'+_0x44be1f[_0x3af9f3(0xf9)])[_0x3af9f3(0xf5)](';\x20');throw new Error('Invalid\x20--params:\x20'+_0x4fe4ec);}if(_0x13751a[_0x3af9f3(0xdf)]===0x0)throw new Error('Invalid\x20--params:\x20menu\x20asset-update\x20requires\x20at\x20least\x20one\x20explicit\x20JS/CSS\x20URL.\x20'+_0x3af9f3(0xb5));logger[_0x3af9f3(0xd0)](process[_0x3af9f3(0xc4)]()),logger[_0x3af9f3(0xdc)](_0x3af9f3(0xbf),_0x3af9f3(0xd8),{'appCode':_0x1769d4,'jsUrl':_0x383313[_0x3af9f3(0xcf)],'cssUrl':_0x383313[_0x3af9f3(0xd3)],'mode':_0x2f8555,'dryRun':_0x446caf[_0x3af9f3(0xde)]===!![]});if(_0x383313['jsUrl']){const _0x2bde35=await isUrlReachable(_0x383313[_0x3af9f3(0xcf)]);if(!_0x2bde35)throw new Error(_0x3af9f3(0xcb)+_0x383313['jsUrl']);}if(_0x383313[_0x3af9f3(0xd3)]){const _0x23b8d8=await isUrlReachable(_0x383313[_0x3af9f3(0xd3)]);if(!_0x23b8d8)throw new Error(_0x3af9f3(0xc2)+_0x383313['cssUrl']);}const _0x4e4b18=await getOnlineMenuList(_0x1769d4,_0x29ded8),_0x2f8fe5=_0x4e4b18['filter'](_0x407339=>_0x407339[_0x3af9f3(0xd6)][_0x3af9f3(0xdf)]>0x0),_0x5a9e6c=selectMenusForUpdate(_0x2f8fe5,_0x446caf[_0x3af9f3(0xe1)]);if(_0x5a9e6c[_0x3af9f3(0xdf)]===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![],'dryRun':_0x446caf[_0x3af9f3(0xde)]===!![]};const _0x1da96b=_0x5a9e6c[_0x3af9f3(0xc9)](_0x2bf24a=>buildMenuUpdateDiff(_0x2bf24a,_0x383313,_0x2f8555,_0x446caf['force']===!![],_0x446caf[_0x3af9f3(0xbd)]));if(_0x446caf[_0x3af9f3(0xde)])return{'updated':0x0,'failed':0x0,'skipped':![],'dryRun':!![],'diffs':_0x1da96b};const _0x2f2754=await Promise['allSettled'](_0x5a9e6c[_0x3af9f3(0xc9)]((_0xf85291,_0x4857d7)=>updateMenuCdnUrl(_0x1769d4,_0x29ded8,{'id':_0xf85291['id'],'label':_0xf85291[_0x3af9f3(0xc3)],'path':_0xf85291[_0x3af9f3(0xe0)],'resources':_0x1da96b[_0x4857d7][_0x3af9f3(0xe3)][_0x3af9f3(0xd6)],'extend':_0xf85291[_0x3af9f3(0xd1)]??null,'loadScriptMode':_0x446caf['loadScriptMode']}))),_0x5e2cab=_0x2f2754[_0x3af9f3(0xc5)](_0x55b3d7=>_0x55b3d7['status']==='fulfilled')[_0x3af9f3(0xc9)](_0x31c2da=>_0x31c2da[_0x3af9f3(0xec)]),_0x4b6203=_0x2f2754[_0x3af9f3(0xc5)](_0x34fdf2=>_0x34fdf2['status']===_0x3af9f3(0xea))[_0x3af9f3(0xdf)];return logger['info'](_0x3af9f3(0xbf),_0x3af9f3(0xb6),{'count':_0x5a9e6c[_0x3af9f3(0xdf)],'resources':_0x13751a}),{'updated':_0x5e2cab[_0x3af9f3(0xdf)],'failed':_0x4b6203,'skipped':![],'menus':_0x5e2cab};}function a123_0x5d9b(){const _0x9de66c=['446056qQdVsz','.\x20Allowed\x20values:\x20replace,\x20patch','--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.','endsWith','10VnwoTF','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','loadScriptMode','menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.','menu-asset-update','.css','all','CSS\x20URL\x20is\x20unreachable:\x20','label','cwd','filter','6478DZeRHV','\x22\x20(','menu\x20asset-update\x20cannot\x20patch\x20','map','\x20existing\x20CSS\x20resources\x20for\x20\x22','JS\x20URL\x20is\x20unreachable:\x20','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','some','toLowerCase','jsUrl','setLogPath','extend','paths','cssUrl','3644648hNKQSj','.js','resources','461773swEzKL','Start\x20non-interactive\x20menu\x20asset\x20update','--params.','\x20existing\x20JS\x20resources\x20for\x20\x22','6230376OvPxMP','info','string','dryRun','length','path','selection','menu\x20asset-update\x20would\x20remove\x20existing\x20JS\x20resource\x20for\x20\x22','after','10zSjtJL','4955481JPMglT','has','object','patch','19063891ZLwZxq','rejected','unshift','value','menu\x20asset-update\x20selectors\x20did\x20not\x20match\x20resource-bearing\x20menus:\x20','split','parse','menu\x20asset-update\x20will\x20remove\x20existing\x20CSS\x20resource\x20for\x20\x22','261gIUOry','push','Invalid\x20--mode:\x20','replace','join','6wDNpkT','trim','menuIds','message','Pass\x20--params\x20\x27{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}\x27\x20to\x20update\x20assets.','Menu\x20asset\x20update\x20completed'];a123_0x5d9b=function(){return _0x9de66c;};return a123_0x5d9b();}function validateSelection(_0x2342e7){const _0x1254a2=a123_0x4403;if(!_0x2342e7)throw new Error('menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.');if(_0x2342e7[_0x1254a2(0xc1)]&&(_0x2342e7[_0x1254a2(0xf8)][_0x1254a2(0xdf)]>0x0||_0x2342e7[_0x1254a2(0xd2)][_0x1254a2(0xdf)]>0x0))throw new Error(_0x1254a2(0xb9));if(!_0x2342e7['all']&&_0x2342e7[_0x1254a2(0xf8)][_0x1254a2(0xdf)]===0x0&&_0x2342e7[_0x1254a2(0xd2)][_0x1254a2(0xdf)]===0x0)throw new Error(_0x1254a2(0xbe));}export function selectMenusForUpdate(_0x4fa404,_0x1cb399){const _0xb3de46=a123_0x4403;validateSelection(_0x1cb399);if(_0x1cb399[_0xb3de46(0xc1)])return _0x4fa404;const _0x50b9b7=new Set(_0x4fa404[_0xb3de46(0xc9)](_0x5f54a1=>_0x5f54a1['id'])),_0x16ed2e=new Set(_0x4fa404[_0xb3de46(0xc9)](_0x6e27ff=>_0x6e27ff['path'])),_0x389c95=_0x1cb399[_0xb3de46(0xf8)]['filter'](_0xc7f6c8=>!_0x50b9b7[_0xb3de46(0xe6)](_0xc7f6c8)),_0x417569=_0x1cb399[_0xb3de46(0xd2)][_0xb3de46(0xc5)](_0x24d073=>!_0x16ed2e[_0xb3de46(0xe6)](_0x24d073));if(_0x389c95[_0xb3de46(0xdf)]>0x0||_0x417569['length']>0x0){const _0x593640=[..._0x389c95['map'](_0x4e46b7=>String(_0x4e46b7)),..._0x417569][_0xb3de46(0xf5)](',\x20');throw new Error(_0xb3de46(0xed)+_0x593640);}const _0xb388da=new Set(_0x1cb399['menuIds']),_0xe1fe62=new Set(_0x1cb399['paths']);return _0x4fa404[_0xb3de46(0xc5)](_0x57fb64=>_0xb388da['has'](_0x57fb64['id'])||_0xe1fe62[_0xb3de46(0xe6)](_0x57fb64[_0xb3de46(0xe0)]));}function normalizeMode(_0x283b8c){const _0x2638e5=a123_0x4403;if(!_0x283b8c)return'patch';if(_0x283b8c===_0x2638e5(0xf4)||_0x283b8c==='patch')return _0x283b8c;throw new Error(_0x2638e5(0xf3)+_0x283b8c+_0x2638e5(0xb8));}function buildMenuUpdateDiff(_0x38b92e,_0xf27b18,_0x5bcec4,_0xf7b32c,_0xbfb63c){const _0x1615bf=a123_0x4403,_0x2b1241=[..._0x38b92e[_0x1615bf(0xd6)]];_0x5bcec4===_0x1615bf(0xe8)&&assertUnambiguousPatchResources(_0x38b92e,_0x2b1241,_0xf27b18);const _0x1bf888=_0x5bcec4==='patch'?patchResources(_0x2b1241,_0xf27b18):replaceResources(_0xf27b18),_0x40b532=[],_0x1857c6=_0x2b1241[_0x1615bf(0xcd)](isJsResource),_0x5c144d=_0x1bf888['some'](isJsResource);if(_0x1857c6&&!_0x5c144d){const _0x4984eb=_0x1615bf(0xe2)+_0x38b92e[_0x1615bf(0xc3)]+'\x22\x20('+_0x38b92e[_0x1615bf(0xe0)]+').\x20'+'Use\x20--mode\x20patch\x20to\x20preserve\x20it,\x20pass\x20jsUrl,\x20or\x20add\x20--force\x20for\x20an\x20intentional\x20removal.';if(!_0xf7b32c)throw new Error(_0x4984eb);_0x40b532[_0x1615bf(0xf2)](_0x4984eb);}const _0x347b37=_0x2b1241[_0x1615bf(0xcd)](isCssResource),_0x5bc3f4=_0x1bf888['some'](isCssResource);_0x347b37&&!_0x5bc3f4&&_0x40b532[_0x1615bf(0xf2)](_0x1615bf(0xf0)+_0x38b92e['label']+_0x1615bf(0xc7)+_0x38b92e[_0x1615bf(0xe0)]+').');const _0x13d1b3=typeof _0x38b92e[_0x1615bf(0xd1)]?.['loadScriptMode']===_0x1615bf(0xdd)?_0x38b92e[_0x1615bf(0xd1)]['loadScriptMode']:null,_0x5c7bbf=_0xbfb63c?{'loadScriptMode':_0x13d1b3}:{},_0x30ad19=_0xbfb63c?{'loadScriptMode':_0xbfb63c}:{};return{'id':_0x38b92e['id'],'label':_0x38b92e[_0x1615bf(0xc3)],'path':_0x38b92e[_0x1615bf(0xe0)],'mode':_0x5bcec4,'before':{'resources':_0x2b1241,..._0x5c7bbf},'after':{'resources':_0x1bf888,..._0x30ad19},'warnings':_0x40b532};}function replaceResources(_0x200d5b){const _0x23d2f5=a123_0x4403;return[_0x200d5b['jsUrl'],_0x200d5b[_0x23d2f5(0xd3)]][_0x23d2f5(0xc5)](_0x5078ae=>!!_0x5078ae);}function assertUnambiguousPatchResources(_0x158a5f,_0x1c1425,_0x4f86f7){const _0x2438de=a123_0x4403,_0x36aed5=_0x1c1425[_0x2438de(0xc5)](isJsResource)[_0x2438de(0xdf)];if(_0x4f86f7['jsUrl']&&_0x36aed5>0x1)throw new Error(_0x2438de(0xc8)+_0x36aed5+_0x2438de(0xda)+_0x158a5f[_0x2438de(0xc3)]+'\x22\x20('+_0x158a5f['path']+')\x20'+'with\x20a\x20single\x20jsUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.');const _0x2cf898=_0x1c1425[_0x2438de(0xc5)](isCssResource)['length'];if(_0x4f86f7[_0x2438de(0xd3)]&&_0x2cf898>0x1)throw new Error('menu\x20asset-update\x20cannot\x20patch\x20'+_0x2cf898+_0x2438de(0xca)+_0x158a5f['label']+'\x22\x20('+_0x158a5f['path']+')\x20'+'with\x20a\x20single\x20cssUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.');}function patchResources(_0x359fc4,_0x491776){const _0x585e5d=a123_0x4403;let _0x7f9dbc=![],_0x26c5b1=![];const _0x57bb23=[];for(const _0x1765b6 of _0x359fc4){if(isJsResource(_0x1765b6)){if(_0x491776[_0x585e5d(0xcf)]&&!_0x7f9dbc)_0x57bb23[_0x585e5d(0xf2)](_0x491776[_0x585e5d(0xcf)]),_0x7f9dbc=!![];else!_0x491776['jsUrl']&&_0x57bb23[_0x585e5d(0xf2)](_0x1765b6);continue;}if(isCssResource(_0x1765b6)){if(_0x491776[_0x585e5d(0xd3)]&&!_0x26c5b1)_0x57bb23[_0x585e5d(0xf2)](_0x491776[_0x585e5d(0xd3)]),_0x26c5b1=!![];else!_0x491776[_0x585e5d(0xd3)]&&_0x57bb23[_0x585e5d(0xf2)](_0x1765b6);continue;}_0x57bb23[_0x585e5d(0xf2)](_0x1765b6);}return _0x491776[_0x585e5d(0xcf)]&&!_0x7f9dbc&&_0x57bb23[_0x585e5d(0xeb)](_0x491776[_0x585e5d(0xcf)]),_0x491776['cssUrl']&&!_0x26c5b1&&_0x57bb23[_0x585e5d(0xf2)](_0x491776[_0x585e5d(0xd3)]),_0x57bb23;}function isJsResource(_0x226d6b){const _0x45620c=a123_0x4403;return stripQuery(_0x226d6b)[_0x45620c(0xce)]()['endsWith'](_0x45620c(0xd5));}function isCssResource(_0x5f540f){const _0x1ba2e0=a123_0x4403;return stripQuery(_0x5f540f)[_0x1ba2e0(0xce)]()[_0x1ba2e0(0xba)](_0x1ba2e0(0xc0));}function stripQuery(_0x460ce2){const _0x50857a=a123_0x4403;return _0x460ce2[_0x50857a(0xee)]('?')[0x0]??_0x460ce2;}function parseUpdateParamsFlag(_0x32990c){const _0x495ae4=a123_0x4403;if(!_0x32990c||typeof _0x32990c!==_0x495ae4(0xdd))return{};try{const _0x58c8b6=JSON[_0x495ae4(0xef)](_0x32990c);if(typeof _0x58c8b6!==_0x495ae4(0xe7)||_0x58c8b6===null||Array['isArray'](_0x58c8b6))return{};return{'jsUrl':typeof _0x58c8b6['jsUrl']==='string'?_0x58c8b6['jsUrl'][_0x495ae4(0xf7)]():undefined,'cssUrl':typeof _0x58c8b6[_0x495ae4(0xd3)]===_0x495ae4(0xdd)?_0x58c8b6[_0x495ae4(0xd3)][_0x495ae4(0xf7)]():undefined};}catch{return{};}}
|
|
1
|
+
(function(_0x7a5403,_0x285af2){const _0x8226c7=a129_0x2cbd,_0x3ca143=_0x7a5403();while(!![]){try{const _0x36a48c=parseInt(_0x8226c7(0xb7))/0x1+parseInt(_0x8226c7(0xcd))/0x2+-parseInt(_0x8226c7(0xc1))/0x3+-parseInt(_0x8226c7(0xb3))/0x4+parseInt(_0x8226c7(0xd7))/0x5+-parseInt(_0x8226c7(0xc6))/0x6+parseInt(_0x8226c7(0xc4))/0x7;if(_0x36a48c===_0x285af2)break;else _0x3ca143['push'](_0x3ca143['shift']());}catch(_0x1a490d){_0x3ca143['push'](_0x3ca143['shift']());}}}(a129_0x1245,0xac562));function a129_0x2cbd(_0x34d5ec,_0x5d217e){_0x34d5ec=_0x34d5ec-0xa0;const _0x1245bb=a129_0x1245();let _0x2cbd46=_0x1245bb[_0x34d5ec];return _0x2cbd46;}import{updateMenuCdnUrl,getOnlineMenuList}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';import{logger}from'../../../utils/logger.js';function validateParams(_0x4f18d4){const _0x2816f0=a129_0x2cbd,_0x60044e=[];return _0x4f18d4[_0x2816f0(0xc2)]&&!isValidJsHttpsUrl(_0x4f18d4[_0x2816f0(0xc2)])&&_0x60044e[_0x2816f0(0xc5)]({'field':_0x2816f0(0xc2),'message':'JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL'}),_0x4f18d4[_0x2816f0(0xc3)]&&!isValidCssHttpsUrl(_0x4f18d4[_0x2816f0(0xc3)])&&_0x60044e['push']({'field':'cssUrl','message':_0x2816f0(0xbe)}),_0x60044e;}export async function runMenuUpdateCore(_0x1329ec,_0x351bef,_0x5a8ba7,_0x3d3f06={}){const _0x29c00f=a129_0x2cbd,_0x168775=parseUpdateParamsFlag(_0x5a8ba7),_0x13de15=normalizeMode(_0x3d3f06[_0x29c00f(0xb5)]);validateSelection(_0x3d3f06[_0x29c00f(0xaf)]);const _0x1257b8=[];if(_0x168775[_0x29c00f(0xc2)])_0x1257b8[_0x29c00f(0xc5)](_0x168775[_0x29c00f(0xc2)]);if(_0x168775[_0x29c00f(0xc3)])_0x1257b8[_0x29c00f(0xc5)](_0x168775['cssUrl']);const _0x54c896=validateParams(_0x168775);if(_0x54c896[_0x29c00f(0xa5)]>0x0){const _0x15b091=_0x54c896[_0x29c00f(0xb0)](_0x3ffe3e=>_0x29c00f(0xdc)+_0x3ffe3e[_0x29c00f(0xcf)]+':\x20'+_0x3ffe3e['message'])['join'](';\x20');throw new Error(_0x29c00f(0xa1)+_0x15b091);}if(_0x1257b8[_0x29c00f(0xa5)]===0x0)throw new Error(_0x29c00f(0xa7)+_0x29c00f(0xc8));logger['setLogPath'](process[_0x29c00f(0xae)]()),logger['info'](_0x29c00f(0xa9),'Start\x20non-interactive\x20menu\x20asset\x20update',{'appCode':_0x1329ec,'jsUrl':_0x168775[_0x29c00f(0xc2)],'cssUrl':_0x168775['cssUrl'],'mode':_0x13de15,'dryRun':_0x3d3f06['dryRun']===!![]});if(_0x168775[_0x29c00f(0xc2)]){const _0x26301c=await isUrlReachable(_0x168775[_0x29c00f(0xc2)]);if(!_0x26301c)throw new Error(_0x29c00f(0xc7)+_0x168775[_0x29c00f(0xc2)]);}if(_0x168775[_0x29c00f(0xc3)]){const _0x5a9cba=await isUrlReachable(_0x168775['cssUrl']);if(!_0x5a9cba)throw new Error('CSS\x20URL\x20is\x20unreachable:\x20'+_0x168775[_0x29c00f(0xc3)]);}const _0x10a07c=await getOnlineMenuList(_0x1329ec,_0x351bef),_0x1d54cf=_0x10a07c[_0x29c00f(0xb4)](_0x178295=>_0x178295[_0x29c00f(0xcb)][_0x29c00f(0xa5)]>0x0),_0x5ac3ac=selectMenusForUpdate(_0x1d54cf,_0x3d3f06[_0x29c00f(0xaf)]);if(_0x5ac3ac[_0x29c00f(0xa5)]===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![],'dryRun':_0x3d3f06[_0x29c00f(0xbc)]===!![]};const _0x460280=_0x5ac3ac[_0x29c00f(0xb0)](_0x4b693a=>buildMenuUpdateDiff(_0x4b693a,_0x168775,_0x13de15,_0x3d3f06[_0x29c00f(0xb6)]===!![],_0x3d3f06[_0x29c00f(0xc9)]));if(_0x3d3f06[_0x29c00f(0xbc)])return{'updated':0x0,'failed':0x0,'skipped':![],'dryRun':!![],'diffs':_0x460280};const _0x3017ba=await Promise[_0x29c00f(0xa6)](_0x5ac3ac[_0x29c00f(0xb0)]((_0x42fcc0,_0x5707c2)=>updateMenuCdnUrl(_0x1329ec,_0x351bef,{'id':_0x42fcc0['id'],'label':_0x42fcc0[_0x29c00f(0xd8)],'path':_0x42fcc0[_0x29c00f(0xb2)],'resources':_0x460280[_0x5707c2][_0x29c00f(0xd5)][_0x29c00f(0xcb)],'extend':_0x42fcc0['extend']??null,'loadScriptMode':_0x3d3f06['loadScriptMode']}))),_0x31ad3f=_0x3017ba[_0x29c00f(0xb4)](_0xc1f7f4=>_0xc1f7f4['status']===_0x29c00f(0xb1))['map'](_0x5e42d0=>_0x5e42d0['value']),_0x30e655=_0x3017ba[_0x29c00f(0xb4)](_0xe65441=>_0xe65441[_0x29c00f(0xbd)]==='rejected')['length'];return logger[_0x29c00f(0xd6)](_0x29c00f(0xa9),'Menu\x20asset\x20update\x20completed',{'count':_0x5ac3ac[_0x29c00f(0xa5)],'resources':_0x1257b8}),{'updated':_0x31ad3f[_0x29c00f(0xa5)],'failed':_0x30e655,'skipped':![],'menus':_0x31ad3f};}function validateSelection(_0xb4f31){const _0x55e703=a129_0x2cbd;if(!_0xb4f31)throw new Error(_0x55e703(0xdd));if(_0xb4f31[_0x55e703(0xce)]&&(_0xb4f31[_0x55e703(0xd2)][_0x55e703(0xa5)]>0x0||_0xb4f31[_0x55e703(0xca)][_0x55e703(0xa5)]>0x0))throw new Error(_0x55e703(0xac));if(!_0xb4f31[_0x55e703(0xce)]&&_0xb4f31[_0x55e703(0xd2)]['length']===0x0&&_0xb4f31['paths']['length']===0x0)throw new Error(_0x55e703(0xdd));}export function selectMenusForUpdate(_0x4036ef,_0x59f092){const _0x4a9992=a129_0x2cbd;validateSelection(_0x59f092);if(_0x59f092[_0x4a9992(0xce)])return _0x4036ef;const _0x3c94ac=new Set(_0x4036ef[_0x4a9992(0xb0)](_0x149124=>_0x149124['id'])),_0x39e213=new Set(_0x4036ef[_0x4a9992(0xb0)](_0x43402e=>_0x43402e[_0x4a9992(0xb2)])),_0x513e42=_0x59f092[_0x4a9992(0xd2)][_0x4a9992(0xb4)](_0x2c1dd3=>!_0x3c94ac[_0x4a9992(0xd0)](_0x2c1dd3)),_0x602b70=_0x59f092['paths']['filter'](_0x946946=>!_0x39e213[_0x4a9992(0xd0)](_0x946946));if(_0x513e42['length']>0x0||_0x602b70[_0x4a9992(0xa5)]>0x0){const _0x312d48=[..._0x513e42[_0x4a9992(0xb0)](_0x2033b1=>String(_0x2033b1)),..._0x602b70][_0x4a9992(0xba)](',\x20');throw new Error(_0x4a9992(0xc0)+_0x312d48);}const _0x41b271=new Set(_0x59f092[_0x4a9992(0xd2)]),_0xed19b6=new Set(_0x59f092[_0x4a9992(0xca)]);return _0x4036ef[_0x4a9992(0xb4)](_0x3b8f58=>_0x41b271[_0x4a9992(0xd0)](_0x3b8f58['id'])||_0xed19b6[_0x4a9992(0xd0)](_0x3b8f58[_0x4a9992(0xb2)]));}function normalizeMode(_0x24adca){const _0x51e75b=a129_0x2cbd;if(!_0x24adca)return _0x51e75b(0xbf);if(_0x24adca==='replace'||_0x24adca===_0x51e75b(0xbf))return _0x24adca;throw new Error('Invalid\x20--mode:\x20'+_0x24adca+_0x51e75b(0xda));}function buildMenuUpdateDiff(_0x373e3d,_0x5b132d,_0x1801ab,_0x5bf3e5,_0x3b0179){const _0x1986c3=a129_0x2cbd,_0x30b0af=[..._0x373e3d['resources']];_0x1801ab===_0x1986c3(0xbf)&&assertUnambiguousPatchResources(_0x373e3d,_0x30b0af,_0x5b132d);const _0x47376b=_0x1801ab==='patch'?patchResources(_0x30b0af,_0x5b132d):replaceResources(_0x5b132d),_0x2e66ce=[],_0x4b302a=_0x30b0af[_0x1986c3(0xa4)](isJsResource),_0x339ce9=_0x47376b['some'](isJsResource);if(_0x4b302a&&!_0x339ce9){const _0x1f763f=_0x1986c3(0xcc)+_0x373e3d[_0x1986c3(0xd8)]+_0x1986c3(0xb8)+_0x373e3d[_0x1986c3(0xb2)]+').\x20'+_0x1986c3(0xa8);if(!_0x5bf3e5)throw new Error(_0x1f763f);_0x2e66ce['push'](_0x1f763f);}const _0x4b9a30=_0x30b0af[_0x1986c3(0xa4)](isCssResource),_0xca2084=_0x47376b['some'](isCssResource);_0x4b9a30&&!_0xca2084&&_0x2e66ce[_0x1986c3(0xc5)]('menu\x20asset-update\x20will\x20remove\x20existing\x20CSS\x20resource\x20for\x20\x22'+_0x373e3d['label']+_0x1986c3(0xb8)+_0x373e3d[_0x1986c3(0xb2)]+').');const _0x2d43a5=typeof _0x373e3d[_0x1986c3(0xdb)]?.[_0x1986c3(0xc9)]===_0x1986c3(0xd1)?_0x373e3d[_0x1986c3(0xdb)][_0x1986c3(0xc9)]:null,_0x419453=_0x3b0179?{'loadScriptMode':_0x2d43a5}:{},_0x8115ba=_0x3b0179?{'loadScriptMode':_0x3b0179}:{};return{'id':_0x373e3d['id'],'label':_0x373e3d[_0x1986c3(0xd8)],'path':_0x373e3d[_0x1986c3(0xb2)],'mode':_0x1801ab,'before':{'resources':_0x30b0af,..._0x419453},'after':{'resources':_0x47376b,..._0x8115ba},'warnings':_0x2e66ce};}function replaceResources(_0x3adbca){const _0x4fb21c=a129_0x2cbd;return[_0x3adbca[_0x4fb21c(0xc2)],_0x3adbca['cssUrl']]['filter'](_0x1f2c05=>!!_0x1f2c05);}function assertUnambiguousPatchResources(_0x3f48c3,_0x5d10a5,_0xdcb262){const _0xe57798=a129_0x2cbd,_0x550f18=_0x5d10a5[_0xe57798(0xb4)](isJsResource)[_0xe57798(0xa5)];if(_0xdcb262[_0xe57798(0xc2)]&&_0x550f18>0x1)throw new Error(_0xe57798(0xaa)+_0x550f18+'\x20existing\x20JS\x20resources\x20for\x20\x22'+_0x3f48c3[_0xe57798(0xd8)]+'\x22\x20('+_0x3f48c3[_0xe57798(0xb2)]+')\x20'+_0xe57798(0xa0));const _0x427585=_0x5d10a5[_0xe57798(0xb4)](isCssResource)[_0xe57798(0xa5)];if(_0xdcb262['cssUrl']&&_0x427585>0x1)throw new Error('menu\x20asset-update\x20cannot\x20patch\x20'+_0x427585+_0xe57798(0xd9)+_0x3f48c3['label']+_0xe57798(0xb8)+_0x3f48c3[_0xe57798(0xb2)]+')\x20'+_0xe57798(0xad));}function patchResources(_0x6badb,_0x4e348a){const _0x349fa5=a129_0x2cbd;let _0x7b0db1=![],_0x2ab0b6=![];const _0x21b795=[];for(const _0x405311 of _0x6badb){if(isJsResource(_0x405311)){if(_0x4e348a[_0x349fa5(0xc2)]&&!_0x7b0db1)_0x21b795[_0x349fa5(0xc5)](_0x4e348a[_0x349fa5(0xc2)]),_0x7b0db1=!![];else!_0x4e348a['jsUrl']&&_0x21b795['push'](_0x405311);continue;}if(isCssResource(_0x405311)){if(_0x4e348a[_0x349fa5(0xc3)]&&!_0x2ab0b6)_0x21b795[_0x349fa5(0xc5)](_0x4e348a[_0x349fa5(0xc3)]),_0x2ab0b6=!![];else!_0x4e348a[_0x349fa5(0xc3)]&&_0x21b795[_0x349fa5(0xc5)](_0x405311);continue;}_0x21b795[_0x349fa5(0xc5)](_0x405311);}return _0x4e348a[_0x349fa5(0xc2)]&&!_0x7b0db1&&_0x21b795[_0x349fa5(0xde)](_0x4e348a[_0x349fa5(0xc2)]),_0x4e348a['cssUrl']&&!_0x2ab0b6&&_0x21b795[_0x349fa5(0xc5)](_0x4e348a['cssUrl']),_0x21b795;}function isJsResource(_0x3ecfcf){const _0x2ee210=a129_0x2cbd;return stripQuery(_0x3ecfcf)[_0x2ee210(0xd4)]()[_0x2ee210(0xbb)]('.js');}function isCssResource(_0x2b5580){const _0x5c056f=a129_0x2cbd;return stripQuery(_0x2b5580)[_0x5c056f(0xd4)]()[_0x5c056f(0xbb)]('.css');}function a129_0x1245(){const _0x3cdb0d=['has','string','menuIds','split','toLowerCase','after','info','953290rOrJDT','label','\x20existing\x20CSS\x20resources\x20for\x20\x22','.\x20Allowed\x20values:\x20replace,\x20patch','extend','--params.','menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.','unshift','with\x20a\x20single\x20jsUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','Invalid\x20--params:\x20','trim','object','some','length','allSettled','Invalid\x20--params:\x20menu\x20asset-update\x20requires\x20at\x20least\x20one\x20explicit\x20JS/CSS\x20URL.\x20','Use\x20--mode\x20patch\x20to\x20preserve\x20it,\x20pass\x20jsUrl,\x20or\x20add\x20--force\x20for\x20an\x20intentional\x20removal.','menu-asset-update','menu\x20asset-update\x20cannot\x20patch\x20','isArray','--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.','with\x20a\x20single\x20cssUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','cwd','selection','map','fulfilled','path','1190336ToPbDE','filter','mode','force','704526cwdTne','\x22\x20(','parse','join','endsWith','dryRun','status','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','patch','menu\x20asset-update\x20selectors\x20did\x20not\x20match\x20resource-bearing\x20menus:\x20','2365152NzGNLp','jsUrl','cssUrl','11236687hdVMoa','push','7405032ONmPuG','JS\x20URL\x20is\x20unreachable:\x20','Pass\x20--params\x20\x27{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}\x27\x20to\x20update\x20assets.','loadScriptMode','paths','resources','menu\x20asset-update\x20would\x20remove\x20existing\x20JS\x20resource\x20for\x20\x22','1051210xYEQxb','all','field'];a129_0x1245=function(){return _0x3cdb0d;};return a129_0x1245();}function stripQuery(_0x496fd7){const _0x5605c8=a129_0x2cbd;return _0x496fd7[_0x5605c8(0xd3)]('?')[0x0]??_0x496fd7;}function parseUpdateParamsFlag(_0xf2a068){const _0x469379=a129_0x2cbd;if(!_0xf2a068||typeof _0xf2a068!==_0x469379(0xd1))return{};try{const _0x186e28=JSON[_0x469379(0xb9)](_0xf2a068);if(typeof _0x186e28!==_0x469379(0xa3)||_0x186e28===null||Array[_0x469379(0xab)](_0x186e28))return{};return{'jsUrl':typeof _0x186e28['jsUrl']===_0x469379(0xd1)?_0x186e28['jsUrl']['trim']():undefined,'cssUrl':typeof _0x186e28[_0x469379(0xc3)]===_0x469379(0xd1)?_0x186e28[_0x469379(0xc3)][_0x469379(0xa2)]():undefined};}catch{return{};}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a130_0x3245(_0x4be62f,_0x3aa0dc){_0x4be62f=_0x4be62f-0x166;const _0x4388fa=a130_0x4388();let _0x3245f1=_0x4388fa[_0x4be62f];return _0x3245f1;}function a130_0x4388(){const _0x37273f=['5128HNuorm','test','12lAPAtQ','58837097QPkKnP','27byOsCm','trim','554MpuMMB','5864450ffzXuw','10338708UaxPAG','5655130WiOYSG','7404GLXTGM','8714096hNkPAU','7YXtckf','1308rJNeGY'];a130_0x4388=function(){return _0x37273f;};return a130_0x4388();}(function(_0xe197cd,_0x2d78c2){const _0x861456=a130_0x3245,_0x48414a=_0xe197cd();while(!![]){try{const _0x28f5cb=-parseInt(_0x861456(0x16d))/0x1*(parseInt(_0x861456(0x167))/0x2)+parseInt(_0x861456(0x166))/0x3*(-parseInt(_0x861456(0x171))/0x4)+-parseInt(_0x861456(0x16e))/0x5+parseInt(_0x861456(0x16f))/0x6+parseInt(_0x861456(0x173))/0x7*(-parseInt(_0x861456(0x172))/0x8)+parseInt(_0x861456(0x16b))/0x9*(-parseInt(_0x861456(0x170))/0xa)+parseInt(_0x861456(0x16a))/0xb*(parseInt(_0x861456(0x169))/0xc);if(_0x28f5cb===_0x2d78c2)break;else _0x48414a['push'](_0x48414a['shift']());}catch(_0x223efc){_0x48414a['push'](_0x48414a['shift']());}}}(a130_0x4388,0xd8402));export function isValidJsHttpsUrl(_0x12b450){const _0x12e13c=a130_0x3245;return/^https:\/\/.+\.js(\?.*)?$/[_0x12e13c(0x168)](_0x12b450[_0x12e13c(0x16c)]());}export function isValidCssHttpsUrl(_0x419926){return/^https:\/\/.+\.css(\?.*)?$/['test'](_0x419926['trim']());}export async function isUrlReachable(_0xfa1e1c){try{const _0x204e92=await fetch(_0xfa1e1c,{'method':'HEAD'});return _0x204e92['ok'];}catch{return![];}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a131_0x29608f=a131_0x142f;(function(_0x4d59c9,_0x51e514){const _0x1b4c0c=a131_0x142f,_0x47b051=_0x4d59c9();while(!![]){try{const _0x44ce94=-parseInt(_0x1b4c0c(0x1c3))/0x1*(-parseInt(_0x1b4c0c(0x1b3))/0x2)+-parseInt(_0x1b4c0c(0x1aa))/0x3+parseInt(_0x1b4c0c(0x1c9))/0x4*(-parseInt(_0x1b4c0c(0x1d8))/0x5)+parseInt(_0x1b4c0c(0x1ce))/0x6+parseInt(_0x1b4c0c(0x19a))/0x7+-parseInt(_0x1b4c0c(0x199))/0x8+-parseInt(_0x1b4c0c(0x1c5))/0x9*(-parseInt(_0x1b4c0c(0x191))/0xa);if(_0x44ce94===_0x51e514)break;else _0x47b051['push'](_0x47b051['shift']());}catch(_0x14de73){_0x47b051['push'](_0x47b051['shift']());}}}(a131_0x2180,0xde2e1));import a131_0x530cb8 from'chalk';import{buildCompareRows,doCreateMenus,fetchMenuData}from'../../commands/menu/shared/logic.js';import{renderCompareTable,renderSyncSummary}from'../../commands/menu/shared/compare-table.js';function a131_0x142f(_0x4f74c0,_0x526d29){_0x4f74c0=_0x4f74c0-0x191;const _0x218070=a131_0x2180();let _0x142fd7=_0x218070[_0x4f74c0];return _0x142fd7;}import{selectPages,askJsUrl,askCssUrl,askConfirm,startSpinner,stopSpinner,isInteractive,requireInteractive}from'../../commands/menu/shared/inquirer.js';import{CliErrors}from'../../errors.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';import{parseMenuSyncParams,runMenuSyncCore}from'../../commands/menu/shared/sync-core.js';import{getLocalPages}from'../../commands/menu/shared/local-pages.js';function a131_0x2180(){const _0x3766db=['Exact\x20comma-separated\x20local\x20page\x20paths\x20to\x20sync','Confirm\x20non-interactive\x20sync;\x20without\x20--paths,\x20create\x20all\x20missing\x20local\x20pages','✓\x20Menu\x20sync\x20completed:\x20','Menu\x20sync\x20skipped','paths','2wzqiDg','JSON:\x20{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}','message','\x20\x20Create\x20','Menu\x20sync\x20completed:\x20','length','cyan','appCode','rawFlags','flag','localPages','\x20\x20✓\x20Selected:\x20','Online\x20menu\x20list\x20fetched','\x20failed.','menu\x20sync\x20requires\x20a\x20project\x20context\x20or\x20explicit\x20--appcode.\x20','Failed\x20to\x20fetch\x20online\x20menu\x20list','813361uQFDvl','\x20\x20!\x20No\x20local\x20pages\x20found,\x20please\x20create\x20pages\x20first','63PcBFQM','Preview\x20with\x20--dry-run,\x20then\x20reuse\x20the\x20same\x20--paths\x20and\x20--params\x20with\x20--yes.','cssUrl','skipped','345544oyJKze','sync','menu','params','string','10140816sqwsog','✓\x20All\x20local\x20pages\x20are\x20already\x20on\x20platform','yellow','gray','Would\x20create\x20','onlinePaths','Pre-fill\x20JS/CSS\x20URLs.\x20','\x20created,\x20','Run\x20inside\x20a\x20directory\x20with\x20.rabetbase.json,\x20or\x20pass\x20--appcode\x20<code>.','\x20created.','45KxfMUn','size','2001020vDVGXM','split','str','filter','Fetching\x20online\x20menu\x20list...','\x20menu(s)\x20created','No\x20local\x20microfrontend\x20menus\x20would\x20be\x20created.','validation','10417408LFQjjJ','230440osidJG','boolean','cookie','created','appcode','\x20\x20Cancelled.','Non-interactive\x20menu\x20sync\x20requires\x20--yes.','\x20page(s)','selectedAppName','\x20menu(s)\x20with\x20JS:\x20','jsUrl','Menu\x20creation\x20failed','Creating\x20','\x20local\x20microfrontend\x20menu(s).','Created\x20','\x20menu(s)...','2842296uAbrkV','\x20\x20Continue\x20with\x20creation?','\x20menu(s)','trim'];a131_0x2180=function(){return _0x3766db;};return a131_0x2180();}import{isInProject}from'../../context.js';export const menuSync={'service':a131_0x29608f(0x1cb),'command':a131_0x29608f(0x1ca),'description':'Sync\x20local\x20pages\x20as\x20platform\x20menus','risk':'write','flags':[{'name':'params','type':a131_0x29608f(0x1cd),'description':a131_0x29608f(0x1d4)+a131_0x29608f(0x1b4)},{'name':a131_0x29608f(0x1b2),'type':a131_0x29608f(0x1cd),'description':a131_0x29608f(0x1ae)},{'name':'yes','type':a131_0x29608f(0x19b),'description':a131_0x29608f(0x1af)}],async 'dryRun'(_0x5b2caf){const _0x46350e=a131_0x29608f;ensureRunnableContext(_0x5b2caf[_0x46350e(0x1bb)],_0x5b2caf['selectedAppName']);const _0x1d387d=await runMenuSyncCore(_0x5b2caf[_0x46350e(0x1ba)],_0x5b2caf[_0x46350e(0x19c)],parsePaths(_0x5b2caf[_0x46350e(0x193)]('paths')),_0x5b2caf[_0x46350e(0x193)](_0x46350e(0x1cc)),{'dryRun':!![]});return{'method':'POST','url':'/smartapi/menu/create','body':_0x1d387d,'description':_0x1d387d[_0x46350e(0x1c8)]?_0x46350e(0x197):_0x46350e(0x1d2)+_0x1d387d['targetPages']['length']+_0x46350e(0x1a7)};},async 'execute'(_0x549d15){const _0xb49ce5=a131_0x29608f;ensureRunnableContext(_0x549d15[_0xb49ce5(0x1bb)],_0x549d15[_0xb49ce5(0x1a2)]);const _0x40d052=_0x549d15[_0xb49ce5(0x1bc)]('yes'),_0x3b4729=_0x549d15[_0xb49ce5(0x193)](_0xb49ce5(0x1cc)),_0x3813cb=parsePaths(_0x549d15[_0xb49ce5(0x193)](_0xb49ce5(0x1b2))),_0x4d50bf=parseMenuSyncParams(_0x3b4729);if(_0x40d052){const _0x419a20=await runMenuSyncCore(_0x549d15[_0xb49ce5(0x1ba)],_0x549d15[_0xb49ce5(0x19c)],_0x3813cb,_0x3b4729);if(_0x419a20['skipped']){const _0x30c9ad=getLocalPages();_0x30c9ad[_0xb49ce5(0x1b8)]===0x0?writeCliSideChannelLine('!\x20No\x20local\x20pages\x20found\x20in\x20src/pages'):writeCliSideChannelLine(_0xb49ce5(0x1cf));}else writeCliSideChannelLine(_0xb49ce5(0x1b0)+_0x419a20[_0xb49ce5(0x19d)]+_0xb49ce5(0x196));return{'ok':!![],'data':_0x419a20,'message':_0x419a20[_0xb49ce5(0x1c8)]?_0xb49ce5(0x1b1):'Menu\x20sync\x20completed:\x20'+_0x419a20[_0xb49ce5(0x19d)]+_0xb49ce5(0x1d7)};}if(_0x3813cb[_0xb49ce5(0x1b8)]>0x0)throw CliErrors[_0xb49ce5(0x198)]('menu\x20sync\x20--paths\x20requires\x20--yes\x20for\x20execution.',_0xb49ce5(0x1c6));if(!isInteractive()&&_0x3b4729)throw CliErrors['validation'](_0xb49ce5(0x1a0),_0xb49ce5(0x1c6));requireInteractive();const _0x19cb72=startSpinner(_0xb49ce5(0x195));let _0x2d0675,_0xf24ed8,_0x1a45f1;try{const _0x3483f8=await fetchMenuData(_0x549d15[_0xb49ce5(0x1ba)],_0x549d15[_0xb49ce5(0x19c)]);_0x2d0675=_0x3483f8[_0xb49ce5(0x1bd)],_0xf24ed8=_0x3483f8[_0xb49ce5(0x1d3)],_0x1a45f1=_0x3483f8['onlineMenuList'],stopSpinner(_0x19cb72,_0xb49ce5(0x1bf),!![]);}catch(_0x10e3d3){stopSpinner(_0x19cb72,_0xb49ce5(0x1c2),![]);throw CliErrors['validation'](_0x10e3d3 instanceof Error?_0x10e3d3[_0xb49ce5(0x1b5)]:_0xb49ce5(0x1c2));}if(_0x2d0675['length']===0x0)return writeCliSideChannelLine(a131_0x530cb8[_0xb49ce5(0x1d0)](_0xb49ce5(0x1c4))),{'ok':!![]};const _0x1c7caf=buildCompareRows(_0x2d0675,_0xf24ed8);writeCliSideChannelLine(renderCompareTable(_0x1c7caf)),writeCliSideChannelLine('');const _0x327c97=await selectPages(_0x2d0675,_0xf24ed8);writeCliSideChannelLine(''),writeCliSideChannelLine(a131_0x530cb8[_0xb49ce5(0x1b9)](_0xb49ce5(0x1be)+_0x327c97[_0xb49ce5(0x1b8)]+_0xb49ce5(0x1a1)));const _0x402946=_0x4d50bf[_0xb49ce5(0x1a4)]&&_0x4d50bf[_0xb49ce5(0x1c7)];if(!_0x402946){writeCliSideChannelLine(renderSyncSummary(_0x327c97,_0xf24ed8[_0xb49ce5(0x1d9)]>0x0));const _0x1474ba=await askConfirm(_0xb49ce5(0x1ab));if(!_0x1474ba)return writeCliSideChannelLine(a131_0x530cb8[_0xb49ce5(0x1d1)](_0xb49ce5(0x19f))),{'ok':!![]};}let _0x343813=_0x4d50bf[_0xb49ce5(0x1a4)],_0x4fd0c4=_0x4d50bf[_0xb49ce5(0x1c7)];!_0x343813&&(_0x343813=await askJsUrl());!_0x4fd0c4&&(_0x4fd0c4=await askCssUrl());const _0x4969f3=await askConfirm(_0xb49ce5(0x1b6)+_0x327c97['length']+_0xb49ce5(0x1a3)+_0x343813+'\x20and\x20CSS:\x20'+_0x4fd0c4+'?');if(!_0x4969f3)return writeCliSideChannelLine(a131_0x530cb8['gray']('\x20\x20Cancelled.')),{'ok':!![]};const _0x112685=[_0x343813,_0x4fd0c4],_0xcbfc30=startSpinner(_0xb49ce5(0x1a6)+_0x327c97['length']+_0xb49ce5(0x1a9));try{const _0x12ae3f=await doCreateMenus(_0x549d15[_0xb49ce5(0x1ba)],_0x549d15[_0xb49ce5(0x19c)],_0x327c97,_0x112685);return stopSpinner(_0xcbfc30,_0xb49ce5(0x1a8)+_0x12ae3f[_0xb49ce5(0x19d)]+_0xb49ce5(0x1ac),!![]),{'ok':!![],'data':_0x12ae3f,'message':_0xb49ce5(0x1b7)+_0x12ae3f[_0xb49ce5(0x19d)]+_0xb49ce5(0x1d5)+_0x12ae3f['failed']+_0xb49ce5(0x1c0)};}catch(_0x4abbce){stopSpinner(_0xcbfc30,_0xb49ce5(0x1a5),![]);throw CliErrors[_0xb49ce5(0x198)](_0x4abbce instanceof Error?_0x4abbce['message']:_0xb49ce5(0x1a5));}}};function ensureRunnableContext(_0x3f8c5e,_0x27dc84){const _0xf21f7f=a131_0x29608f,_0x30e7f5=_0x3f8c5e[_0xf21f7f(0x19e)]?String(_0x3f8c5e['appcode'])[_0xf21f7f(0x1ad)]():'';if(!isInProject()&&!_0x27dc84&&!_0x30e7f5)throw CliErrors['validation'](_0xf21f7f(0x1c1)+_0xf21f7f(0x1d6));}function parsePaths(_0x50d73a){const _0x23c126=a131_0x29608f;return[...new Set(_0x50d73a[_0x23c126(0x192)](',')['map'](_0x60cf29=>_0x60cf29[_0x23c126(0x1ad)]())[_0x23c126(0x194)](Boolean))];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a132_0x331a(){const _0x572486=['join','length','2660sQJjMl','FEISHU','235410hkSwkF','read','validation','type','129eztGhd','Found\x20','EMAIL','string','notification','Invalid\x20--type:\x20','44rsQJRf','WEBHOOK','Allowed\x20values:\x20','str','Notification\x20channel\x20type','396NeFPlt','number','316QXLXQr','WECOM','createTime','updateTime','293720FHphJe','List\x20app-level\x20notification\x20configs\x20and\x20their\x20configCode\x20values','Invalid\x20notification\x20config\x20response.','trim','9778weoElA','7EJrbMK','\x20notification\x20config(s)','config-list','Item\x20','map','configName','4531680voEIdH','configCode','apiError','1496202PUlKWL','description','1832zcgyqc','appCode'];a132_0x331a=function(){return _0x572486;};return a132_0x331a();}const a132_0x317ce4=a132_0x4230;(function(_0x19ec0a,_0x238f4a){const _0x1b0dc6=a132_0x4230,_0x4a5c65=_0x19ec0a();while(!![]){try{const _0x35dbbf=-parseInt(_0x1b0dc6(0xe1))/0x1+-parseInt(_0x1b0dc6(0xe5))/0x2*(parseInt(_0x1b0dc6(0xd0))/0x3)+-parseInt(_0x1b0dc6(0xdd))/0x4*(parseInt(_0x1b0dc6(0xf5))/0x5)+parseInt(_0x1b0dc6(0xef))/0x6*(parseInt(_0x1b0dc6(0xe6))/0x7)+parseInt(_0x1b0dc6(0xf1))/0x8*(-parseInt(_0x1b0dc6(0xdb))/0x9)+-parseInt(_0x1b0dc6(0xf7))/0xa*(-parseInt(_0x1b0dc6(0xd6))/0xb)+parseInt(_0x1b0dc6(0xec))/0xc;if(_0x35dbbf===_0x238f4a)break;else _0x4a5c65['push'](_0x4a5c65['shift']());}catch(_0x3da30f){_0x4a5c65['push'](_0x4a5c65['shift']());}}}(a132_0x331a,0x28500));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a132_0x4230(_0x526a39,_0x566b6d){_0x526a39=_0x526a39-0xcf;const _0x331ae3=a132_0x331a();let _0x423023=_0x331ae3[_0x526a39];return _0x423023;}import{listNotificationChannelConfigs}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const NOTIFICATION_CHANNEL_TYPES=[a132_0x317ce4(0xd2),a132_0x317ce4(0xf6),'DINGTALK',a132_0x317ce4(0xde),a132_0x317ce4(0xd7)];export const notificationConfigList={'service':a132_0x317ce4(0xd4),'command':a132_0x317ce4(0xe8),'description':a132_0x317ce4(0xe2),'risk':a132_0x317ce4(0xf8),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a132_0x317ce4(0xcf),'type':a132_0x317ce4(0xd3),'description':a132_0x317ce4(0xda),'enum':NOTIFICATION_CHANNEL_TYPES,'default':a132_0x317ce4(0xd2)}],async 'validate'(_0xa0e32){readChannelType(_0xa0e32);},async 'execute'(_0x5b7a1e){const _0x2e5496=a132_0x317ce4,_0x2cb670=readChannelType(_0x5b7a1e),_0x3369af=await listNotificationChannelConfigs(_0x5b7a1e[_0x2e5496(0xf2)],_0x2cb670),_0x540d7e=_0x3369af[_0x2e5496(0xea)](projectNotificationConfig);return{'ok':!![],'data':{'appCode':_0x5b7a1e['appCode'],'channelType':_0x2cb670,'count':_0x540d7e[_0x2e5496(0xf4)],'configs':_0x540d7e},'message':_0x2e5496(0xd1)+_0x540d7e[_0x2e5496(0xf4)]+'\x20'+_0x2cb670+_0x2e5496(0xe7)};}};function readChannelType(_0x3ddf2b){const _0x4ce01f=a132_0x317ce4,_0xa013d2=_0x3ddf2b[_0x4ce01f(0xd9)](_0x4ce01f(0xcf))['trim']()||'EMAIL';if(!NOTIFICATION_CHANNEL_TYPES['includes'](_0xa013d2))throw CliErrors[_0x4ce01f(0xf9)](_0x4ce01f(0xd5)+_0xa013d2,_0x4ce01f(0xd8)+NOTIFICATION_CHANNEL_TYPES[_0x4ce01f(0xf3)](',\x20')+'.');return _0xa013d2;}function projectNotificationConfig(_0x2683d0,_0x58cc6f){const _0x3ad83a=a132_0x317ce4;return{'id':typeof _0x2683d0['id']===_0x3ad83a(0xdc)?_0x2683d0['id']:null,'configCode':requireConfigString(_0x2683d0,_0x3ad83a(0xed),_0x58cc6f),'configName':requireConfigString(_0x2683d0,_0x3ad83a(0xeb),_0x58cc6f),'channelType':requireConfigString(_0x2683d0,'channelType',_0x58cc6f),'description':normalizeNullableString(_0x2683d0[_0x3ad83a(0xf0)]),'createTime':normalizeNullableString(_0x2683d0[_0x3ad83a(0xdf)]),'updateTime':normalizeNullableString(_0x2683d0[_0x3ad83a(0xe0)])};}function requireConfigString(_0x5759eb,_0x40c014,_0x2762bf){const _0x49b587=a132_0x317ce4,_0x238e8a=_0x5759eb[_0x40c014];if(typeof _0x238e8a!==_0x49b587(0xd3)||_0x238e8a[_0x49b587(0xe4)]()==='')throw CliErrors[_0x49b587(0xee)](_0x49b587(0xe3),_0x49b587(0xe9)+(_0x2762bf+0x1)+'\x20is\x20missing\x20required\x20field\x20\x22'+_0x40c014+'\x22.');return _0x238e8a[_0x49b587(0xe4)]();}function normalizeNullableString(_0x19c17e){const _0x3f17ae=a132_0x317ce4;return typeof _0x19c17e===_0x3f17ae(0xd3)?_0x19c17e:null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a133_0x59b6(_0x4d0c59,_0x19e344){_0x4d0c59=_0x4d0c59-0x85;const _0x403b59=a133_0x403b();let _0x59b62d=_0x403b59[_0x4d0c59];return _0x59b62d;}function a133_0x403b(){const _0x4d948d=['3xnyYPv','45912HqayIU','1213955HUxBcc','1236764xSIAFU','440028NBhVWW','23730LjDnFf','126rubYGC','2535520yhKWGR','114IDBnqW','85183RpRqdI'];a133_0x403b=function(){return _0x4d948d;};return a133_0x403b();}(function(_0x29b4dc,_0xef3d3f){const _0x445007=a133_0x59b6,_0x177fc4=_0x29b4dc();while(!![]){try{const _0x2ec46d=parseInt(_0x445007(0x85))/0x1+parseInt(_0x445007(0x86))/0x2+parseInt(_0x445007(0x8b))/0x3*(-parseInt(_0x445007(0x8e))/0x4)+-parseInt(_0x445007(0x8d))/0x5+parseInt(_0x445007(0x89))/0x6*(parseInt(_0x445007(0x8a))/0x7)+parseInt(_0x445007(0x8c))/0x8*(-parseInt(_0x445007(0x87))/0x9)+parseInt(_0x445007(0x88))/0xa;if(_0x2ec46d===_0xef3d3f)break;else _0x177fc4['push'](_0x177fc4['shift']());}catch(_0x4efc6d){_0x177fc4['push'](_0x177fc4['shift']());}}}(a133_0x403b,0x4a4c8));import{notificationConfigList}from'../../commands/notification/config-list.js';export const notificationDefinitions=[notificationConfigList];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a134_0x232b1a=a134_0x107d;(function(_0x20a20b,_0x1ebc5f){const _0x4cb262=a134_0x107d,_0x34c32e=_0x20a20b();while(!![]){try{const _0x588c45=-parseInt(_0x4cb262(0x152))/0x1*(-parseInt(_0x4cb262(0x12c))/0x2)+parseInt(_0x4cb262(0x139))/0x3+parseInt(_0x4cb262(0x148))/0x4*(-parseInt(_0x4cb262(0x130))/0x5)+parseInt(_0x4cb262(0x14a))/0x6+parseInt(_0x4cb262(0x141))/0x7*(-parseInt(_0x4cb262(0x153))/0x8)+parseInt(_0x4cb262(0x13e))/0x9+-parseInt(_0x4cb262(0x138))/0xa;if(_0x588c45===_0x1ebc5f)break;else _0x34c32e['push'](_0x34c32e['shift']());}catch(_0x2261ad){_0x34c32e['push'](_0x34c32e['shift']());}}}(a134_0x5425,0x2b669));function a134_0x5425(){const _0x12297c=['887eguXlG','17576tLTlht','recognize','imageUrl','GET','File\x20upload\x20response\x20missing\x20filePath.','invoice','<filePath\x20returned\x20by\x20/smartapi/common/uploadFile>','Preview:\x20recognize\x20','<fileUrl\x20returned\x20by\x20/smartapi/common/queryFileUrl>','form','validation','OCR\x20scene:\x20invoice,\x20general,\x20form,\x20or\x20idCard','Preview:\x20upload\x20local\x20file,\x20query\x20temporary\x20URL,\x20then\x20recognize\x20','image-file','702HeJcbq','\x20OCR\x20from\x20URL','Local\x20image\x20or\x20PDF\x20file;\x20uses\x20upload\x20->\x20query-url\x20->\x20OCR','image-url','5WMgLPY','.\x20Supported\x20scenes:\x20','/smartapi/common/uploadFile','filePath','apiError','count','idCard','IdCard','3143250vFimBm','990345wvAKvQ','Choose\x20exactly\x20one\x20OCR\x20input:\x20--image-file\x20or\x20--image-url.','toLowerCase','\x20OCR','Unsupported\x20OCR\x20scene:\x20','365049hpaKMG','imageFile','/smartapi/ocr/recognize-text','1043Axpvrm','Table','toString','join','使用研发态\x20OCR\x20服务识别\x20URL\x20或本地文件中的文字','read','fileUrl','629716TOOJKw','POST','1769178RzSckC','trim','general','appCode','File\x20URL\x20response\x20missing\x20fileUrl.','str','string','fileName'];a134_0x5425=function(){return _0x12297c;};return a134_0x5425();}import{requireDevelopmentUploadFile}from'../../commands/common/local-file.js';function a134_0x107d(_0x30ecff,_0x542482){_0x30ecff=_0x30ecff-0x129;const _0x5425dd=a134_0x5425();let _0x107dbb=_0x5425dd[_0x30ecff];return _0x107dbb;}import{queryDevelopmentFileUrl,recognizeDevelopmentOcr,uploadDevelopmentFile}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const SUPPORTED_SCENES=[a134_0x232b1a(0x158),'general',a134_0x232b1a(0x15c),a134_0x232b1a(0x136)],SCENE_TO_LEGACY_TYPE={'invoice':'Invoice','general':'General','form':a134_0x232b1a(0x142),'idCard':a134_0x232b1a(0x137)},SCENE_FLAG={'name':'scene','type':a134_0x232b1a(0x150),'required':!![],'enum':[...SUPPORTED_SCENES],'description':a134_0x232b1a(0x129)},IMAGE_FILE_FLAG={'name':'image-file','type':a134_0x232b1a(0x150),'description':a134_0x232b1a(0x12e)},IMAGE_URL_FLAG={'name':a134_0x232b1a(0x12f),'type':a134_0x232b1a(0x150),'description':'Publicly\x20accessible\x20image\x20or\x20file\x20URL'};function normalizeScene(_0x3523db){const _0xaa93eb=a134_0x232b1a,_0xafbd8a=_0x3523db[_0xaa93eb(0x14b)]()[_0xaa93eb(0x13b)]();if(_0xafbd8a==='idcard')return _0xaa93eb(0x136);if(_0xafbd8a===_0xaa93eb(0x158)||_0xafbd8a===_0xaa93eb(0x14c)||_0xafbd8a===_0xaa93eb(0x15c))return _0xafbd8a;throw CliErrors[_0xaa93eb(0x15d)](_0xaa93eb(0x13d)+_0x3523db+_0xaa93eb(0x131)+SUPPORTED_SCENES[_0xaa93eb(0x144)](',\x20'));}function selectedInputs(_0x1e52cf){const _0x294fc0=a134_0x232b1a,_0x1579d4=_0x1e52cf[_0x294fc0(0x14f)](_0x294fc0(0x12b))[_0x294fc0(0x14b)](),_0x327625=_0x1e52cf[_0x294fc0(0x14f)](_0x294fc0(0x12f))['trim']();return{'imageFile':_0x1579d4,'imageUrl':_0x327625,'count':[_0x1579d4,_0x327625]['filter'](Boolean)['length']};}function validateInputSelection(_0x2dac11){const _0x228a87=a134_0x232b1a,_0x46bbc0=selectedInputs(_0x2dac11);if(_0x46bbc0[_0x228a87(0x135)]!==0x1)throw CliErrors[_0x228a87(0x15d)](_0x228a87(0x13a));return _0x46bbc0;}function withScene(_0x3ed01f,_0x55ef1d,_0x448578){const _0x540906=a134_0x232b1a;return{..._0x3ed01f,'scene':_0x55ef1d,..._0x448578?{'sourceFile':{'fileName':_0x448578[_0x540906(0x151)],'filePath':_0x448578['filePath']}}:{}};}const ocrRecognize={'service':'ocr','command':a134_0x232b1a(0x154),'description':a134_0x232b1a(0x145),'risk':a134_0x232b1a(0x146),'flags':[SCENE_FLAG,IMAGE_FILE_FLAG,IMAGE_URL_FLAG],async 'dryRun'(_0x3cfe98){const _0x5525cc=a134_0x232b1a,_0x1cd5af=normalizeScene(_0x3cfe98[_0x5525cc(0x14f)]('scene')),_0x89292c=SCENE_TO_LEGACY_TYPE[_0x1cd5af],_0x3e44c7=validateInputSelection(_0x3cfe98);if(_0x3e44c7[_0x5525cc(0x155)]){const _0x418b4d=new URLSearchParams({'url':_0x3e44c7[_0x5525cc(0x155)],'type':_0x89292c,'appCode':_0x3cfe98[_0x5525cc(0x14d)]});return{'method':_0x5525cc(0x156),'url':'/smartapi/ocr/recognize-text?'+_0x418b4d[_0x5525cc(0x143)](),'description':_0x5525cc(0x15a)+_0x1cd5af+_0x5525cc(0x12d)};}const _0x39e3d2=requireDevelopmentUploadFile(_0x3e44c7['imageFile'],_0x5525cc(0x12b));return{'method':'POST','url':_0x5525cc(0x132),'body':{'steps':[{'method':_0x5525cc(0x149),'url':_0x5525cc(0x132),'body':{'appCode':_0x3cfe98[_0x5525cc(0x14d)],'multipart':{'file':_0x39e3d2}}},{'method':_0x5525cc(0x149),'url':'/smartapi/common/queryFileUrl','body':{'filePath':_0x5525cc(0x159),'downloadFlag':![]}},{'method':_0x5525cc(0x156),'url':_0x5525cc(0x140),'query':{'appCode':_0x3cfe98['appCode'],'url':_0x5525cc(0x15b),'type':_0x89292c}}]},'description':_0x5525cc(0x12a)+_0x1cd5af+_0x5525cc(0x13c)};},async 'execute'(_0x659755){const _0x25cf10=a134_0x232b1a,_0x11063f=normalizeScene(_0x659755['str']('scene')),_0x5ead6b=SCENE_TO_LEGACY_TYPE[_0x11063f],_0x12e1c4=validateInputSelection(_0x659755);if(_0x12e1c4[_0x25cf10(0x155)]){const _0x348e9e=await recognizeDevelopmentOcr(_0x659755[_0x25cf10(0x14d)],{'url':_0x12e1c4[_0x25cf10(0x155)],'type':_0x5ead6b});return{'ok':!![],'data':withScene(_0x348e9e,_0x11063f)};}const _0xd978ed=requireDevelopmentUploadFile(_0x12e1c4[_0x25cf10(0x13f)],_0x25cf10(0x12b)),_0x61458b=await uploadDevelopmentFile(_0x659755['appCode'],_0xd978ed['path']);if(!_0x61458b[_0x25cf10(0x133)])throw CliErrors[_0x25cf10(0x134)](_0x25cf10(0x157));const _0x2b4194=await queryDevelopmentFileUrl(_0x61458b['filePath'],{'download':![]});if(!_0x2b4194[_0x25cf10(0x147)])throw CliErrors[_0x25cf10(0x134)](_0x25cf10(0x14e));const _0x2b9c60=await recognizeDevelopmentOcr(_0x659755['appCode'],{'url':_0x2b4194['fileUrl'],'type':_0x5ead6b});return{'ok':!![],'data':withScene(_0x2b9c60,_0x11063f,_0x61458b)};}};export const ocrDefinitions=[ocrRecognize];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a135_0x466bad=a135_0x1b47;function a135_0x1b47(_0x295f3c,_0x1b65df){_0x295f3c=_0x295f3c-0x166;const _0x3968f4=a135_0x3968();let _0x1b4725=_0x3968f4[_0x295f3c];return _0x1b4725;}(function(_0x41df69,_0x531eb2){const _0x564658=a135_0x1b47,_0x5844e3=_0x41df69();while(!![]){try{const _0x179f35=parseInt(_0x564658(0x175))/0x1*(parseInt(_0x564658(0x188))/0x2)+parseInt(_0x564658(0x182))/0x3*(-parseInt(_0x564658(0x173))/0x4)+-parseInt(_0x564658(0x177))/0x5+-parseInt(_0x564658(0x189))/0x6*(-parseInt(_0x564658(0x17b))/0x7)+-parseInt(_0x564658(0x17d))/0x8*(parseInt(_0x564658(0x171))/0x9)+-parseInt(_0x564658(0x180))/0xa+parseInt(_0x564658(0x178))/0xb;if(_0x179f35===_0x531eb2)break;else _0x5844e3['push'](_0x5844e3['shift']());}catch(_0x102d1d){_0x5844e3['push'](_0x5844e3['shift']());}}}(a135_0x3968,0xa1813));import{APPCODE_FLAG_OPTIONAL,DATASETCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{assessGenerateOperationState,assessStandardPageState,buildPageGenerateOperationStatusQueryCommand,buildStandardPageStatusQueryCommand,createPageGenerateClientOperationId,getUndeletedRelatedPages,loadDatasetDetailForPage,loadStandardPageStatusForGenerate,serializeDryRunDescription,validateDatasetSelector}from'../../commands/page/shared.js';function a135_0x3968(){const _0x47c59c=['12phKfrc','复用已有生成任务','precheck','PARTIAL_SUCCESS','write','compress','code','dataset','apply','related-pages-fallback','name','/generate-standard-pages/start','nextAction','boolean','appCode','string','bool','progressRate','9BQwSZG','manualResolutionRequired','10088WWSmfx','POST','8786urReXh','standardPageStatus','3462070AYQiqG','26136781KKZBJj','Dry-run\x20preview\x20(pass\x20--apply\x20to\x20execute\x20the\x20generation)','number','897358XVNkWs','allowGenerate','5827864QoFhjR','clientOperationId','/smartapi/lovrabet/dataset/','13142570bqezrp','status','42ZEyDFK','message','source','operationId','SUCCESS','alias','182fVBBby'];a135_0x3968=function(){return _0x47c59c;};return a135_0x3968();}import{startGenerateStandardPages}from'../../core/api-client.js';export const pageGenerateStart={'service':'page','command':'generate-start','description':'Start\x20async\x20Smart\x20List\x20Page\x20generation\x20from\x20a\x20dataset','risk':a135_0x466bad(0x18d),'defaultOutputFormat':a135_0x466bad(0x18e),'flags':[APPCODE_FLAG_OPTIONAL,DATASETCODE_FLAG_OPTIONAL,{'name':a135_0x466bad(0x187),'type':a135_0x466bad(0x16e),'description':'Dataset\x20alias\x20from\x20api.ts\x20(resolves\x20to\x20dataset\x20code\x20automatically)'},{'name':a135_0x466bad(0x167),'type':a135_0x466bad(0x16c),'description':'Actually\x20execute\x20the\x20generation.\x20Without\x20this\x20flag,\x20only\x20a\x20dry-run\x20preview\x20is\x20shown.'}],async 'validate'(_0x38bc83){validateDatasetSelector(_0x38bc83);},async 'dryRun'(_0x5d41ec){const _0x581127=a135_0x466bad,_0x2aedd0=await prepare(_0x5d41ec);return{'method':_0x581127(0x174),'url':_0x581127(0x17f)+_0x2aedd0[_0x581127(0x166)][_0x581127(0x18f)]+_0x581127(0x16a),'body':{'appCode':_0x5d41ec[_0x581127(0x16d)],'clientOperationId':_0x2aedd0['clientOperationId']},'description':serializeDryRunDescription({'dataset':{'id':_0x2aedd0['dataset']['id'],'code':_0x2aedd0[_0x581127(0x166)][_0x581127(0x18f)],'name':_0x2aedd0[_0x581127(0x166)][_0x581127(0x169)],'fieldCount':_0x2aedd0[_0x581127(0x166)]['fieldCount']},'precheckSource':_0x2aedd0[_0x581127(0x176)]?.[_0x581127(0x184)]??_0x581127(0x168),'action':'generate-start','clientOperationId':_0x2aedd0[_0x581127(0x17e)],'plannedStatus':_0x2aedd0[_0x581127(0x18b)][_0x581127(0x181)],'reason':_0x2aedd0[_0x581127(0x18b)][_0x581127(0x183)]})};},async 'execute'(_0xdf1684){const _0x4676b5=a135_0x466bad;if(!_0xdf1684[_0x4676b5(0x16f)](_0x4676b5(0x167))){const _0x40fa0b=await pageGenerateStart['dryRun'](_0xdf1684);return{'ok':!![],'message':_0x4676b5(0x179),'data':_0x40fa0b};}const _0x2107cc=await prepare(_0xdf1684);if(!_0x2107cc['precheck'][_0x4676b5(0x17c)])return{'ok':![],'message':_0x2107cc[_0x4676b5(0x18b)][_0x4676b5(0x183)],'data':{'datasetCode':_0x2107cc[_0x4676b5(0x166)]['code'],'clientOperationId':_0x2107cc[_0x4676b5(0x17e)],'precheckSource':_0x2107cc[_0x4676b5(0x176)]?.['source']??_0x4676b5(0x168),'status':_0x2107cc[_0x4676b5(0x18b)][_0x4676b5(0x181)],'manualResolutionRequired':_0x2107cc[_0x4676b5(0x18b)][_0x4676b5(0x172)],'nextAction':_0x2107cc[_0x4676b5(0x18b)]['nextAction'],'query':{'command':buildStandardPageStatusQueryCommand(_0x2107cc[_0x4676b5(0x166)]['code'],_0xdf1684['appCode'])},'standardPageStatus':_0x2107cc[_0x4676b5(0x176)]}};const _0xd1cc70=await startGenerateStandardPages(_0xdf1684['appCode'],_0x2107cc['dataset'][_0x4676b5(0x18f)],{'clientOperationId':_0x2107cc[_0x4676b5(0x17e)]}),_0x4be8cb=_0xd1cc70['status']===_0x4676b5(0x186)||_0xd1cc70['status']===_0x4676b5(0x18c)?await loadStandardPageStatusForGenerate(_0xdf1684,_0x2107cc[_0x4676b5(0x166)]['code']):null,_0x23af86=assessGenerateOperationState(_0x2107cc['dataset'][_0x4676b5(0x18f)],_0xd1cc70['status'],_0x4be8cb);return{'ok':!![],'message':_0xd1cc70['reused']?_0x4676b5(0x18a):'已提交生成任务','data':{'datasetCode':_0x2107cc[_0x4676b5(0x166)][_0x4676b5(0x18f)],'appCode':_0xdf1684[_0x4676b5(0x16d)],'operationId':_0xd1cc70[_0x4676b5(0x185)]??null,'clientOperationId':_0x2107cc[_0x4676b5(0x17e)],'jobStatus':_0xd1cc70[_0x4676b5(0x181)]??null,'progressRate':typeof _0xd1cc70[_0x4676b5(0x170)]===_0x4676b5(0x17a)?_0xd1cc70['progressRate']:null,'currentStep':_0xd1cc70['currentStep']??null,'reused':_0xd1cc70['reused']===!![],'status':_0x23af86[_0x4676b5(0x181)],'manualResolutionRequired':_0x23af86['manualResolutionRequired'],'nextAction':_0x23af86[_0x4676b5(0x16b)],'query':{'command':buildPageGenerateOperationStatusQueryCommand(_0x2107cc[_0x4676b5(0x166)][_0x4676b5(0x18f)],{'appCode':_0xdf1684['appCode'],'operationId':_0xd1cc70[_0x4676b5(0x185)],'clientOperationId':_0x2107cc[_0x4676b5(0x17e)]})},'standardPageStatus':_0x4be8cb}};}};async function prepare(_0x21ded1){const _0xa31de8=a135_0x466bad,_0x3ebcc2=await loadDatasetDetailForPage(_0x21ded1),_0x249690=await loadStandardPageStatusForGenerate(_0x21ded1,_0x3ebcc2[_0xa31de8(0x18f)]),_0x500373=getUndeletedRelatedPages(_0x3ebcc2);return{'dataset':_0x3ebcc2,'standardPageStatus':_0x249690,'clientOperationId':createPageGenerateClientOperationId(),'precheck':assessStandardPageState(_0x3ebcc2[_0xa31de8(0x18f)],_0x249690,{'fallbackUndeletedPages':_0x500373})};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a136_0x5bcabc=a136_0x10e4;function a136_0x5784(){const _0x5909c9=['operation-id','alias','/generate-standard-pages/status?','client-operation-id','generate-status','9FVTSfO','702978gkHHVb','1060368PEMEhv','code','896608miMyTY','clientOperationId','nextAction','compress','progressRate','set','16Tsyoen','Async\x20operation\x20id\x20returned\x20by\x20page\x20generate-start','2311071BBWXnh','8BRlTlA','errorMsg','message','string','page','status','operation_failed','PARTIAL_SUCCESS','str','9261276GpfQxP','name','1129996EIcmGX','9476600KkQmqF','appCode','33uNFJWT','GET','operationId','number','35nJuzNj'];a136_0x5784=function(){return _0x5909c9;};return a136_0x5784();}(function(_0x55f842,_0x596a19){const _0x19fb70=a136_0x10e4,_0x3e722c=_0x55f842();while(!![]){try{const _0x44d2be=-parseInt(_0x19fb70(0x182))/0x1+parseInt(_0x19fb70(0x18b))/0x2*(parseInt(_0x19fb70(0x17f))/0x3)+parseInt(_0x19fb70(0x171))/0x4+-parseInt(_0x19fb70(0x178))/0x5*(-parseInt(_0x19fb70(0x180))/0x6)+parseInt(_0x19fb70(0x18a))/0x7*(parseInt(_0x19fb70(0x188))/0x8)+parseInt(_0x19fb70(0x17e))/0x9*(parseInt(_0x19fb70(0x172))/0xa)+-parseInt(_0x19fb70(0x174))/0xb*(parseInt(_0x19fb70(0x16f))/0xc);if(_0x44d2be===_0x596a19)break;else _0x3e722c['push'](_0x3e722c['shift']());}catch(_0x51a234){_0x3e722c['push'](_0x3e722c['shift']());}}}(a136_0x5784,0xd03ca));function a136_0x10e4(_0x31e074,_0x59ab3d){_0x31e074=_0x31e074-0x167;const _0x5784f0=a136_0x5784();let _0x10e459=_0x5784f0[_0x31e074];return _0x10e459;}import{APPCODE_FLAG_OPTIONAL,DATASETCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{assessGenerateOperationState,buildPageGenerateOperationStatusQueryCommand,loadDatasetDetailForPage,loadStandardPageStatusForGenerate,serializeDryRunDescription,validateDatasetSelector,validateGenerateOperationSelector}from'../../commands/page/shared.js';import{getGenerateStandardPagesStatus}from'../../core/api-client.js';export const pageGenerateStatus={'service':a136_0x5bcabc(0x16a),'command':a136_0x5bcabc(0x17d),'description':'Query\x20Smart\x20List\x20Page\x20generate\x20operation\x20status','risk':'read','defaultOutputFormat':a136_0x5bcabc(0x185),'flags':[APPCODE_FLAG_OPTIONAL,DATASETCODE_FLAG_OPTIONAL,{'name':a136_0x5bcabc(0x17a),'type':a136_0x5bcabc(0x169),'description':'Dataset\x20alias\x20from\x20api.ts\x20(resolves\x20to\x20dataset\x20code\x20automatically)'},{'name':a136_0x5bcabc(0x179),'type':a136_0x5bcabc(0x169),'description':a136_0x5bcabc(0x189)},{'name':'client-operation-id','type':a136_0x5bcabc(0x169),'description':'Client\x20recovery/idempotency\x20id\x20when\x20operationId\x20is\x20unavailable\x20or\x20lost'}],async 'validate'(_0x400c83){validateDatasetSelector(_0x400c83),validateGenerateOperationSelector(_0x400c83);},async 'dryRun'(_0x21b5a3){const _0x37c615=a136_0x5bcabc,_0x2d1e4c=await loadDatasetDetailForPage(_0x21b5a3),_0x3b2a74=_0x21b5a3[_0x37c615(0x16e)](_0x37c615(0x179)),_0x413b57=_0x21b5a3['str'](_0x37c615(0x17c)),_0x2b8378=new URLSearchParams({'appCode':_0x21b5a3[_0x37c615(0x173)]});return _0x3b2a74&&_0x2b8378[_0x37c615(0x187)](_0x37c615(0x176),_0x3b2a74),_0x413b57&&_0x2b8378['set'](_0x37c615(0x183),_0x413b57),{'method':_0x37c615(0x175),'url':'/smartapi/lovrabet/dataset/'+_0x2d1e4c['code']+_0x37c615(0x17b)+_0x2b8378['toString'](),'description':serializeDryRunDescription({'dataset':{'id':_0x2d1e4c['id'],'code':_0x2d1e4c['code'],'name':_0x2d1e4c[_0x37c615(0x170)]},'action':'query-generate-operation-status','operationId':_0x3b2a74||undefined,'clientOperationId':_0x413b57||undefined})};},async 'execute'(_0x3d5f5a){const _0x41565f=a136_0x5bcabc,_0x4fd3bc=await loadDatasetDetailForPage(_0x3d5f5a),_0x25fb71=_0x3d5f5a[_0x41565f(0x16e)](_0x41565f(0x179)),_0xfef47d=_0x3d5f5a[_0x41565f(0x16e)]('client-operation-id'),_0x36b3b8=await getGenerateStandardPagesStatus(_0x3d5f5a['appCode'],_0x4fd3bc[_0x41565f(0x181)],{'operationId':_0x25fb71||undefined,'clientOperationId':_0xfef47d||undefined}),_0xe8c160=_0x36b3b8['status']==='SUCCESS'||_0x36b3b8['status']===_0x41565f(0x16d),_0x4c2f1d=_0xe8c160?await loadStandardPageStatusForGenerate(_0x3d5f5a,_0x4fd3bc[_0x41565f(0x181)]):null,_0x58f2b7=assessGenerateOperationState(_0x4fd3bc[_0x41565f(0x181)],_0x36b3b8[_0x41565f(0x16b)],_0x4c2f1d),_0xad2064=_0x36b3b8['operationId']??_0x25fb71??undefined,_0x555e56=_0x36b3b8[_0x41565f(0x183)]??_0xfef47d??undefined;return{'ok':!![],'message':_0x58f2b7[_0x41565f(0x16b)]===_0x41565f(0x16c)?_0x36b3b8['errorMsg']||_0x58f2b7[_0x41565f(0x168)]:_0x58f2b7[_0x41565f(0x168)],'data':{'datasetCode':_0x4fd3bc[_0x41565f(0x181)],'appCode':_0x3d5f5a[_0x41565f(0x173)],'operationId':_0xad2064,'clientOperationId':_0x555e56,'jobStatus':_0x36b3b8[_0x41565f(0x16b)]??null,'progressRate':typeof _0x36b3b8['progressRate']===_0x41565f(0x177)?_0x36b3b8[_0x41565f(0x186)]:null,'currentStep':_0x36b3b8['currentStep']??null,'errorMsg':_0x36b3b8[_0x41565f(0x167)]??null,'status':_0x58f2b7[_0x41565f(0x16b)],'manualResolutionRequired':_0x58f2b7['manualResolutionRequired'],'nextAction':_0x58f2b7[_0x41565f(0x184)],'query':{'command':buildPageGenerateOperationStatusQueryCommand(_0x4fd3bc[_0x41565f(0x181)],{'appCode':_0x3d5f5a[_0x41565f(0x173)],'operationId':_0xad2064,'clientOperationId':_0x555e56})},'standardPageStatus':_0x4c2f1d,'result':_0x36b3b8['result']??null}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xe57ee2,_0x3dc02a){const _0x3f5b00=a137_0x5a02,_0x2b2a21=_0xe57ee2();while(!![]){try{const _0x120ca0=-parseInt(_0x3f5b00(0xa4))/0x1*(-parseInt(_0x3f5b00(0xac))/0x2)+-parseInt(_0x3f5b00(0xa8))/0x3*(-parseInt(_0x3f5b00(0xa5))/0x4)+-parseInt(_0x3f5b00(0xaa))/0x5+parseInt(_0x3f5b00(0xad))/0x6+-parseInt(_0x3f5b00(0xa6))/0x7+parseInt(_0x3f5b00(0xa7))/0x8*(parseInt(_0x3f5b00(0xab))/0x9)+-parseInt(_0x3f5b00(0xa9))/0xa;if(_0x120ca0===_0x3dc02a)break;else _0x2b2a21['push'](_0x2b2a21['shift']());}catch(_0x4f4638){_0x2b2a21['push'](_0x2b2a21['shift']());}}}(a137_0x59ef,0x94bf5));function a137_0x5a02(_0x55e7ca,_0x24c0fd){_0x55e7ca=_0x55e7ca-0xa4;const _0x59efe2=a137_0x59ef();let _0x5a02c6=_0x59efe2[_0x55e7ca];return _0x5a02c6;}import{pageGenerateStart}from'../../commands/page/generate-start.js';import{pageGenerateStatus}from'../../commands/page/generate-status.js';import{pageStandardPageStatus}from'../../commands/page/standard-page-status.js';import{pageSync}from'../../commands/page/sync.js';import{pagePull}from'../../commands/page/pull.js';function a137_0x59ef(){const _0x44d388=['3620979tYlZvo','2ZClndP','1798776JLOmYb','960719rWVNMq','1556IXQpkW','5019301fbyCqF','24LVjTHy','8295HlSCdx','19492860Sotqva','1337475GpzzbG'];a137_0x59ef=function(){return _0x44d388;};return a137_0x59ef();}import{pagePush}from'../../commands/page/push.js';import{pageRelationAudit}from'../../commands/page/relation-audit.js';import{pageRestore}from'../../commands/page/restore.js';export const pageDefinitions=[pageGenerateStart,pageGenerateStatus,pageStandardPageStatus,pageRelationAudit,pageSync,pagePull,pagePush,pageRestore];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a138_0x2e8fbd=a138_0x3faa;(function(_0x3afe39,_0x229063){const _0x2a09a0=a138_0x3faa,_0x452b25=_0x3afe39();while(!![]){try{const _0xe00add=parseInt(_0x2a09a0(0xf8))/0x1*(parseInt(_0x2a09a0(0x10a))/0x2)+-parseInt(_0x2a09a0(0x121))/0x3*(-parseInt(_0x2a09a0(0x11a))/0x4)+parseInt(_0x2a09a0(0xed))/0x5+parseInt(_0x2a09a0(0xf0))/0x6+parseInt(_0x2a09a0(0xee))/0x7+parseInt(_0x2a09a0(0x114))/0x8+-parseInt(_0x2a09a0(0x115))/0x9;if(_0xe00add===_0x229063)break;else _0x452b25['push'](_0x452b25['shift']());}catch(_0x3ebbf0){_0x452b25['push'](_0x452b25['shift']());}}}(a138_0x8278,0xc6a10));function a138_0x3faa(_0xb95d85,_0x4c6954){_0xb95d85=_0xb95d85-0xe9;const _0x8278d1=a138_0x8278();let _0x3faa75=_0x8278d1[_0xb95d85];return _0x3faa75;}import{writeFile}from'node:fs/promises';import{APPCODE_FLAG_OPTIONAL,DATASETCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{getPageIdFlag,loadDatasetDetailForPage,loadPageDetailForPage,selectVersionTagGroup,serializeDryRunDescription,validatePageTargetSelector}from'../../commands/page/shared.js';import{computePageContentHash,computePageFileHash,serializePageSchemaForFile}from'../../core/page/hash.js';import{ensureParentDirectory,fileExists,loadPageProjectConfig,resolvePageFilePath}from'../../core/page/file-system.js';import{createEmptyPageLock,ensurePageLockScope,readPageLockFile,writePageLockFile}from'../../core/page/lock.js';import{CliErrors}from'../../errors.js';export const pagePull={'service':'page','command':a138_0x2e8fbd(0xe9),'description':a138_0x2e8fbd(0x11d),'risk':a138_0x2e8fbd(0x113),'defaultOutputFormat':a138_0x2e8fbd(0x11e),'flags':[APPCODE_FLAG_OPTIONAL,{'name':'id','type':'number','description':a138_0x2e8fbd(0xfa)},DATASETCODE_FLAG_OPTIONAL,{'name':a138_0x2e8fbd(0x10b),'type':a138_0x2e8fbd(0xef),'description':'Dataset\x20alias\x20from\x20api.ts\x20(resolves\x20to\x20dataset\x20code\x20automatically)'},{'name':a138_0x2e8fbd(0x120),'type':a138_0x2e8fbd(0xef),'description':a138_0x2e8fbd(0x11f)},{'name':a138_0x2e8fbd(0xf9),'type':'boolean','description':a138_0x2e8fbd(0x10e)}],async 'validate'(_0x14df9d){validatePageTargetSelector(_0x14df9d);},async 'dryRun'(_0x2d7a0b){const _0x28f39c=a138_0x2e8fbd,_0x2928fa=await buildPullPlan(_0x2d7a0b);return{'method':'GET','url':_0x2928fa['mode']===_0x28f39c(0xfd)?'/smartapi/lovrabet/detail?pageId='+(_0x2928fa[_0x28f39c(0xf7)][0x0]?.[_0x28f39c(0x109)][_0x28f39c(0xf2)]??''):_0x28f39c(0xeb),'body':{'appCode':_0x2d7a0b['appCode'],'mode':_0x2928fa['mode'],'targetDatasetCode':_0x2928fa['datasetCode']??null,'pages':_0x2928fa[_0x28f39c(0xf7)][_0x28f39c(0x111)](toPreviewItem)},'description':serializeDryRunDescription({'mode':_0x2928fa[_0x28f39c(0x106)],'datasetCode':_0x2928fa[_0x28f39c(0x11b)]??null,'totalCandidates':_0x2928fa[_0x28f39c(0xf7)][_0x28f39c(0x11c)],'totalWouldPull':_0x2928fa[_0x28f39c(0xf7)][_0x28f39c(0x10c)](_0x153153=>_0x153153[_0x28f39c(0x124)]==='would_pull')[_0x28f39c(0x11c)],'totalConflicts':_0x2928fa[_0x28f39c(0xf7)][_0x28f39c(0x10c)](_0x1e8466=>_0x1e8466['status']===_0x28f39c(0x10f))[_0x28f39c(0x11c)]})};},async 'execute'(_0x410e38){const _0x3db3f0=a138_0x2e8fbd,_0x265814=loadPageProjectConfig(_0x410e38[_0x3db3f0(0x119)]),_0x3ba953=await readPageLockFile(_0x265814[_0x3db3f0(0xfe)]),{lockData:_0x3a248e,appLock:_0x3b30b0}=ensurePageLockScope(_0x3ba953??createEmptyPageLock(),_0x410e38[_0x3db3f0(0x119)]),_0x157e1a=await buildPullPlan(_0x410e38),_0x569fc2=_0x410e38[_0x3db3f0(0xec)]('force');if(_0x157e1a[_0x3db3f0(0x106)]===_0x3db3f0(0xfd)&&_0x157e1a[_0x3db3f0(0xf7)][0x0]?.[_0x3db3f0(0x124)]==='conflict'&&!_0x569fc2)throw CliErrors[_0x3db3f0(0xf4)](_0x3db3f0(0x123)+_0x157e1a[_0x3db3f0(0xf7)][0x0][_0x3db3f0(0x104)],_0x3db3f0(0x101));const _0x2330c7=[],_0x3cf3e4=[];for(const _0x2301a9 of _0x157e1a[_0x3db3f0(0xf7)]){if(_0x2301a9[_0x3db3f0(0x124)]===_0x3db3f0(0x10f)&&!_0x569fc2){_0x3cf3e4['push']({'pageId':_0x2301a9[_0x3db3f0(0x109)][_0x3db3f0(0xf2)],'type':_0x2301a9[_0x3db3f0(0x109)][_0x3db3f0(0x118)],'title':_0x2301a9['detail'][_0x3db3f0(0x117)],'localPath':_0x2301a9[_0x3db3f0(0x104)],'reason':_0x2301a9[_0x3db3f0(0x116)]??_0x3db3f0(0x110)});continue;}await ensureParentDirectory(_0x2301a9[_0x3db3f0(0x104)]);const _0x56a646=serializePageSchemaForFile(_0x2301a9[_0x3db3f0(0x109)][_0x3db3f0(0xff)]);await writeFile(_0x2301a9[_0x3db3f0(0x104)],_0x56a646,_0x3db3f0(0xea)),_0x3b30b0[_0x3db3f0(0x112)][String(_0x2301a9[_0x3db3f0(0x109)][_0x3db3f0(0xf2)])]=buildLockEntry(_0x2301a9[_0x3db3f0(0x109)],_0x56a646),_0x2330c7[_0x3db3f0(0x103)]({'pageId':_0x2301a9[_0x3db3f0(0x109)][_0x3db3f0(0xf2)],'type':_0x2301a9[_0x3db3f0(0x109)][_0x3db3f0(0x118)],'title':_0x2301a9[_0x3db3f0(0x109)][_0x3db3f0(0x117)],'localPath':_0x2301a9[_0x3db3f0(0x104)]});}return _0x3b30b0['lastSync']=new Date()[_0x3db3f0(0xf1)](),await writePageLockFile(_0x265814[_0x3db3f0(0xfe)],_0x3a248e),{'ok':!![],'message':_0x3db3f0(0x125)+_0x2330c7[_0x3db3f0(0x11c)]+_0x3db3f0(0x102)+_0x3cf3e4[_0x3db3f0(0x11c)]+'\x20skipped','data':{'appCode':_0x410e38[_0x3db3f0(0x119)],'pulledPages':_0x2330c7,'skippedPages':_0x3cf3e4,'totalPulled':_0x2330c7[_0x3db3f0(0x11c)],'totalSkipped':_0x3cf3e4['length']}};}};async function buildPullPlan(_0x5d82e4){const _0x1a4729=a138_0x2e8fbd,_0x23ec18=loadPageProjectConfig(_0x5d82e4[_0x1a4729(0x119)]),_0x18665b=await readPageLockFile(_0x23ec18[_0x1a4729(0xfe)]),{appLock:_0x1e4304}=ensurePageLockScope(_0x18665b??createEmptyPageLock(),_0x5d82e4[_0x1a4729(0x119)]),_0x4f1a00=getPageIdFlag(_0x5d82e4);if(_0x4f1a00!==undefined){const _0x14de94=await loadPageDetailForPage(_0x5d82e4,_0x4f1a00);return{'mode':_0x1a4729(0xfd),'items':[await inspectPullTarget(_0x23ec18,_0x1e4304[_0x1a4729(0x112)][String(_0x14de94[_0x1a4729(0xf2)])],_0x14de94)]};}const _0x15bd48=await loadDatasetDetailForPage(_0x5d82e4),_0x3ddad5=_0x15bd48[_0x1a4729(0xf6)][_0x1a4729(0x10c)](_0x112387=>!_0x112387[_0x1a4729(0x100)]);if(_0x3ddad5[_0x1a4729(0x11c)]===0x0)throw CliErrors[_0x1a4729(0xf4)](_0x1a4729(0xfc)+_0x15bd48[_0x1a4729(0xff)]+_0x1a4729(0xf5));const _0x23967f=await Promise['all'](_0x3ddad5[_0x1a4729(0x111)](_0x44a92f=>loadPageDetailForPage(_0x5d82e4,_0x44a92f['id']))),_0x341c92=selectVersionTagGroup(_0x23967f,_0x51504b=>_0x51504b[_0x1a4729(0x107)],_0x5d82e4[_0x1a4729(0xfb)](_0x1a4729(0x120)));return{'mode':_0x1a4729(0x108),'datasetCode':_0x15bd48['code'],'items':await Promise[_0x1a4729(0x122)](_0x341c92['items'][_0x1a4729(0x111)](_0x2327af=>inspectPullTarget(_0x23ec18,_0x1e4304[_0x1a4729(0x112)][String(_0x2327af[_0x1a4729(0xf2)])],_0x2327af)))};}async function inspectPullTarget(_0x396600,_0x305537,_0x198e24){const _0x2ed709=a138_0x2e8fbd,_0x3723c1=resolvePageFilePath(_0x396600,_0x198e24[_0x2ed709(0xf2)],_0x198e24['type']),_0x35b316=await fileExists(_0x3723c1);if(!_0x35b316){const _0x201e61=serializePageSchemaForFile(_0x198e24[_0x2ed709(0xff)]);return{'detail':_0x198e24,'localPath':_0x3723c1,'localHash':computePageContentHash(_0x201e61),'status':'would_pull'};}const _0x52b9a4=await computePageFileHash(_0x3723c1);if(!_0x305537||_0x52b9a4!==_0x305537[_0x2ed709(0xf3)])return{'detail':_0x198e24,'localPath':_0x3723c1,'localHash':_0x52b9a4,'status':'conflict','reason':_0x2ed709(0x110)};return{'detail':_0x198e24,'localPath':_0x3723c1,'localHash':_0x52b9a4,'status':'would_pull'};}function buildLockEntry(_0x4bbb4f,_0x503ad5){const _0x5cc623=a138_0x2e8fbd;return{'hash':computePageContentHash(_0x503ad5),'pageId':_0x4bbb4f[_0x5cc623(0xf2)],'pageVersion':_0x4bbb4f[_0x5cc623(0x10d)],'type':_0x4bbb4f[_0x5cc623(0x118)],'title':_0x4bbb4f[_0x5cc623(0x117)],'datasetIds':_0x4bbb4f[_0x5cc623(0x105)],'versionTag':_0x4bbb4f['versionTag']};}function toPreviewItem(_0x3e864b){const _0x16239a=a138_0x2e8fbd;return{'pageId':_0x3e864b[_0x16239a(0x109)]['pageId'],'type':_0x3e864b[_0x16239a(0x109)][_0x16239a(0x118)],'title':_0x3e864b['detail'][_0x16239a(0x117)],'localPath':_0x3e864b[_0x16239a(0x104)],'status':_0x3e864b['status'],..._0x3e864b[_0x16239a(0x116)]?{'reason':_0x3e864b['reason']}:{}};}function a138_0x8278(){const _0x3ca52b=['Use\x20--force\x20to\x20overwrite\x20local\x20changes.','\x20pulled,\x20','push','localPath','datasetIds','mode','versionTag','batch','detail','2ASmPeK','alias','filter','pageVersion','Overwrite\x20local\x20files\x20even\x20when\x20unsynced\x20local\x20changes\x20exist','conflict','local\x20unsynced\x20changes','map','pages','read','7362576HrkwEQ','23325165MYTPMK','reason','name','type','appCode','12EDVAjP','datasetCode','length','Pull\x20page\x20schema\x20to\x20local\x20files','compress','Page\x20group\x20version\x20tag\x20(batch\x20mode\x20only)','version-tag','688035ootIjf','all','Local\x20page\x20file\x20has\x20unsynced\x20changes:\x20','status','拉取完成:\x20','pull','utf8','/smartapi/lovrabet/detail\x20(per\x20selected\x20page)','bool','330275UJHIcq','1908830Sucuti','string','946140VLLUZm','toISOString','pageId','hash','validation','\x22\x20has\x20no\x20undeleted\x20related\x20pages.','relatedPages','items','1300477rVWFCX','force','Page\x20ID','str','Dataset\x20\x22','single','lockFilePath','code','deleted'];a138_0x8278=function(){return _0x3ca52b;};return a138_0x8278();}
|