@lovrabet/rabetbase-cli 2.4.5-beta.1 → 2.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/react/create.js +1 -1
- package/lib/commands/page/react/detail.js +1 -1
- package/lib/commands/page/react/list.js +1 -1
- package/lib/commands/page/react/publish.js +1 -1
- package/lib/commands/page/react/shared.js +1 -1
- package/lib/commands/page/react/syntax.js +1 -1
- package/lib/commands/page/react/template.js +1 -1
- package/lib/commands/page/react/update.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/rabetbase/SKILL.md +1 -1
- package/skills/rabetbase.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a130_0x21e9e4=a130_0x39b6;function a130_0x504d(){const _0x2c1307=['47665ntArfk','686539yUXzFO','5325388rDflrU','map','string','path','24IQxzVd','4911591BpwksF','225DngHHa','\x0a\x20\x20Available\x20local\x20paths:\x20','1056PIlYiO','Invalid\x20--params\x20fields:\x20','join','Menu\x20sync\x20completed','54AXxQLz','field','procode','JS\x20URL\x20is\x20unreachable:\x20','setLogPath','info','34786jEdBVl','label','import','cwd','136FhpcDB','10397024oliIAS','isArray','get','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','cssUrl','trim','dryRun','jsUrl','hasOwn','menu-sync','length','push','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','pages','keys',':\x20expected\x20a\x20non-empty\x20string.','160010YhyowD','has','Invalid\x20--params:\x20expected\x20a\x20JSON\x20object.','--params.pages\x20is\x20no\x20longer\x20supported.\x20Use\x20--paths\x20with\x20exact\x20local\x20page\x20paths.','filter','Invalid\x20--params\x20JSON.','message'];a130_0x504d=function(){return _0x2c1307;};return a130_0x504d();}(function(_0x3e9b3a,_0x5d9838){const _0x2b3a59=a130_0x39b6,_0x68d60d=_0x3e9b3a();while(!![]){try{const _0x5dd721=-parseInt(_0x2b3a59(0xf0))/0x1*(parseInt(_0x2b3a59(0xc6))/0x2)+parseInt(_0x2b3a59(0xe9))/0x3+-parseInt(_0x2b3a59(0xe4))/0x4+parseInt(_0x2b3a59(0xe2))/0x5*(parseInt(_0x2b3a59(0xec))/0x6)+parseInt(_0x2b3a59(0xe3))/0x7*(-parseInt(_0x2b3a59(0xca))/0x8)+parseInt(_0x2b3a59(0xea))/0x9*(-parseInt(_0x2b3a59(0xdb))/0xa)+parseInt(_0x2b3a59(0xcb))/0xb*(parseInt(_0x2b3a59(0xe8))/0xc);if(_0x5dd721===_0x5d9838)break;else _0x68d60d['push'](_0x68d60d['shift']());}catch(_0x4eb0dd){_0x68d60d['push'](_0x68d60d['shift']());}}}(a130_0x504d,0xd3c8e));function a130_0x39b6(_0x345bfc,_0x7297f3){_0x345bfc=_0x345bfc-0xc2;const _0x504d0b=a130_0x504d();let _0x39b65c=_0x504d0b[_0x345bfc];return _0x39b65c;}import{getLocalPages}from'../../../commands/menu/shared/local-pages.js';import{getOnlineMenuList,createMenus}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';import{logger}from'../../../utils/logger.js';const MENU_SYNC_PARAM_KEYS=new Set([a130_0x21e9e4(0xd2),a130_0x21e9e4(0xcf)]);function validateParams(_0x246266){const _0x3cefb1=a130_0x21e9e4,_0x1b25cc=[];return _0x246266['jsUrl']&&!isValidJsHttpsUrl(_0x246266['jsUrl'])&&_0x1b25cc[_0x3cefb1(0xd6)]({'field':_0x3cefb1(0xd2),'message':_0x3cefb1(0xce)}),_0x246266['cssUrl']&&!isValidCssHttpsUrl(_0x246266['cssUrl'])&&_0x1b25cc[_0x3cefb1(0xd6)]({'field':_0x3cefb1(0xcf),'message':_0x3cefb1(0xd7)}),_0x1b25cc;}export async function runMenuSyncCore(_0x54cb39,_0x16ae5b,_0x229341=[],_0x30249d,_0x23b831={}){const _0x4d6b56=a130_0x21e9e4,_0x369900=parseMenuSyncParams(_0x30249d),_0x503658=[...new Set(_0x229341['map'](_0x281155=>_0x281155['trim']())['filter'](Boolean))],_0x47edfb=_0x369900[_0x4d6b56(0xd2)],_0x7dfd43=_0x369900['cssUrl'],_0x2f68a7=[];if(_0x47edfb)_0x2f68a7[_0x4d6b56(0xd6)](_0x47edfb);if(_0x7dfd43)_0x2f68a7[_0x4d6b56(0xd6)](_0x7dfd43);const _0x5d2808=validateParams(_0x369900);if(_0x5d2808[_0x4d6b56(0xd5)]>0x0){const _0x687ff2=_0x5d2808[_0x4d6b56(0xe5)](_0x32dd4a=>'--params.'+_0x32dd4a[_0x4d6b56(0xf1)]+':\x20'+_0x32dd4a[_0x4d6b56(0xe1)])['join'](';\x20');throw new Error('Invalid\x20--params:\x20'+_0x687ff2);}logger[_0x4d6b56(0xc4)](process[_0x4d6b56(0xc9)]()),logger[_0x4d6b56(0xc5)](_0x4d6b56(0xd4),'Start\x20non-interactive\x20menu\x20sync',{'appCode':_0x54cb39,'selectedCount':_0x503658[_0x4d6b56(0xd5)],'jsUrl':_0x47edfb,'cssUrl':_0x7dfd43});if(_0x47edfb){const _0x20ac6c=await isUrlReachable(_0x47edfb);if(!_0x20ac6c)throw new Error(_0x4d6b56(0xc3)+_0x47edfb);}if(_0x7dfd43){const _0x32baa5=await isUrlReachable(_0x7dfd43);if(!_0x32baa5)throw new Error('CSS\x20URL\x20is\x20unreachable:\x20'+_0x7dfd43);}const _0x3477d2=getLocalPages();if(_0x3477d2[_0x4d6b56(0xd5)]===0x0){if(_0x503658[_0x4d6b56(0xd5)]>0x0)throw new Error('No\x20local\x20pages\x20matched\x20paths:\x20'+_0x503658[_0x4d6b56(0xee)](',\x20'));return{'created':0x0,'skipped':!![],'dryRun':_0x23b831[_0x4d6b56(0xd1)]===!![],'targetPages':[],'plannedMenus':[]};}const _0x958096=await getOnlineMenuList(_0x54cb39,_0x16ae5b),_0xf7591=new Set(_0x958096[_0x4d6b56(0xe5)](_0x5b8d72=>_0x5b8d72[_0x4d6b56(0xe7)]));let _0x4b8591;if(_0x503658[_0x4d6b56(0xd5)]>0x0){const _0x4ebd9d=new Map(_0x3477d2[_0x4d6b56(0xe5)](_0x4fcf79=>[_0x4fcf79[_0x4d6b56(0xe7)],_0x4fcf79])),_0x380bf6=_0x503658[_0x4d6b56(0xdf)](_0x1b194f=>!_0x4ebd9d[_0x4d6b56(0xdc)](_0x1b194f));if(_0x380bf6[_0x4d6b56(0xd5)]>0x0){const _0xb010b6=_0x3477d2[_0x4d6b56(0xe5)](_0x109197=>_0x109197[_0x4d6b56(0xe7)])['join'](',\x20');throw new Error('No\x20local\x20pages\x20matched\x20paths:\x20'+_0x380bf6[_0x4d6b56(0xee)](',\x20')+_0x4d6b56(0xeb)+_0xb010b6);}const _0x4aca5f=_0x503658[_0x4d6b56(0xdf)](_0x5493c9=>_0xf7591[_0x4d6b56(0xdc)](_0x5493c9));if(_0x4aca5f[_0x4d6b56(0xd5)]>0x0)throw new Error('Local\x20page\x20paths\x20are\x20already\x20on\x20the\x20platform:\x20'+_0x4aca5f[_0x4d6b56(0xee)](',\x20'));_0x4b8591=_0x503658[_0x4d6b56(0xe5)](_0x4696b9=>_0x4ebd9d[_0x4d6b56(0xcd)](_0x4696b9));}else _0x4b8591=_0x3477d2['filter'](_0x782d7e=>!_0xf7591[_0x4d6b56(0xdc)](_0x782d7e['path']));if(_0x4b8591[_0x4d6b56(0xd5)]===0x0)return{'created':0x0,'skipped':!![],'dryRun':_0x23b831[_0x4d6b56(0xd1)]===!![],'targetPages':[],'plannedMenus':[]};const _0x4f0606=_0x4b8591[_0x4d6b56(0xe5)](_0xd8c165=>({'type':_0x4d6b56(0xc2),'path':_0xd8c165[_0x4d6b56(0xe7)],'label':_0xd8c165[_0x4d6b56(0xc7)],'loadScriptMode':_0x4d6b56(0xc8),'resources':[..._0x2f68a7]}));if(_0x23b831[_0x4d6b56(0xd1)])return{'created':0x0,'skipped':![],'dryRun':!![],'targetPages':_0x4b8591,'plannedMenus':_0x4f0606};const _0x548da5=await createMenus(_0x54cb39,_0x16ae5b,_0x4b8591,_0x2f68a7['length']>0x0?_0x2f68a7:undefined);return logger[_0x4d6b56(0xc5)](_0x4d6b56(0xd4),_0x4d6b56(0xef),{'count':_0x4b8591[_0x4d6b56(0xd5)],'resources':_0x2f68a7}),{'created':_0x548da5['length'],'skipped':![],'dryRun':![],'targetPages':_0x4b8591,'plannedMenus':_0x4f0606,'menus':_0x548da5};}export function parseMenuSyncParams(_0x36f5db){const _0x5d5686=a130_0x21e9e4;if(!_0x36f5db||typeof _0x36f5db!==_0x5d5686(0xe6))return{};let _0x307a42;try{_0x307a42=JSON['parse'](_0x36f5db);}catch{throw new Error(_0x5d5686(0xe0));}if(typeof _0x307a42!=='object'||_0x307a42===null||Array[_0x5d5686(0xcc)](_0x307a42))throw new Error(_0x5d5686(0xdd));const _0x3651aa=_0x307a42;if(Object[_0x5d5686(0xd3)](_0x3651aa,_0x5d5686(0xd8)))throw new Error(_0x5d5686(0xde));const _0x3eba9e=Object[_0x5d5686(0xd9)](_0x3651aa)['filter'](_0x208089=>!MENU_SYNC_PARAM_KEYS['has'](_0x208089));if(_0x3eba9e['length']>0x0)throw new Error(_0x5d5686(0xed)+_0x3eba9e[_0x5d5686(0xee)](',\x20')+'.');for(const _0x52aecc of MENU_SYNC_PARAM_KEYS){const _0x324e06=_0x3651aa[_0x52aecc];if(_0x324e06!==undefined&&(typeof _0x324e06!=='string'||_0x324e06[_0x5d5686(0xd0)]()===''))throw new Error('Invalid\x20--params.'+_0x52aecc+_0x5d5686(0xda));}return{'jsUrl':typeof _0x3651aa[_0x5d5686(0xd2)]==='string'?_0x3651aa['jsUrl'][_0x5d5686(0xd0)]():undefined,'cssUrl':typeof _0x3651aa['cssUrl']===_0x5d5686(0xe6)?_0x3651aa[_0x5d5686(0xcf)]['trim']():undefined};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x2c52de,_0x47d9de){const _0x532072=a132_0x2ee8,_0xc2d603=_0x2c52de();while(!![]){try{const _0xa228a3=parseInt(_0x532072(0x15d))/0x1*(parseInt(_0x532072(0x15e))/0x2)+-parseInt(_0x532072(0x169))/0x3+parseInt(_0x532072(0x173))/0x4*(parseInt(_0x532072(0x161))/0x5)+-parseInt(_0x532072(0x179))/0x6+-parseInt(_0x532072(0x16d))/0x7+parseInt(_0x532072(0x15c))/0x8+parseInt(_0x532072(0x192))/0x9;if(_0xa228a3===_0x47d9de)break;else _0xc2d603['push'](_0xc2d603['shift']());}catch(_0xb8341b){_0xc2d603['push'](_0xc2d603['shift']());}}}(a132_0x35b3,0xa9ed9));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(_0x374206){const _0xa2adbe=a132_0x2ee8,_0x98da83=[];return _0x374206[_0xa2adbe(0x168)]&&!isValidJsHttpsUrl(_0x374206[_0xa2adbe(0x168)])&&_0x98da83[_0xa2adbe(0x178)]({'field':_0xa2adbe(0x168),'message':'JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL'}),_0x374206['cssUrl']&&!isValidCssHttpsUrl(_0x374206[_0xa2adbe(0x16b)])&&_0x98da83[_0xa2adbe(0x178)]({'field':_0xa2adbe(0x16b),'message':_0xa2adbe(0x17c)}),_0x98da83;}export async function runMenuUpdateCore(_0xdffb5d,_0x2b4541,_0x421f62,_0x5c88ae={}){const _0x5a0eab=a132_0x2ee8,_0x18fcf2=parseUpdateParamsFlag(_0x421f62),_0x3c2fd6=normalizeMode(_0x5c88ae[_0x5a0eab(0x186)]);validateSelection(_0x5c88ae['selection']);const _0x583b85=[];if(_0x18fcf2[_0x5a0eab(0x168)])_0x583b85[_0x5a0eab(0x178)](_0x18fcf2['jsUrl']);if(_0x18fcf2['cssUrl'])_0x583b85[_0x5a0eab(0x178)](_0x18fcf2['cssUrl']);const _0x4d9c48=validateParams(_0x18fcf2);if(_0x4d9c48['length']>0x0){const _0x5cc68e=_0x4d9c48['map'](_0x3ff318=>'--params.'+_0x3ff318[_0x5a0eab(0x18c)]+':\x20'+_0x3ff318['message'])[_0x5a0eab(0x189)](';\x20');throw new Error('Invalid\x20--params:\x20'+_0x5cc68e);}if(_0x583b85[_0x5a0eab(0x183)]===0x0)throw new Error(_0x5a0eab(0x18a)+'Pass\x20--params\x20\x27{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}\x27\x20to\x20update\x20assets.');logger[_0x5a0eab(0x17b)](process[_0x5a0eab(0x15f)]()),logger[_0x5a0eab(0x15b)](_0x5a0eab(0x187),_0x5a0eab(0x172),{'appCode':_0xdffb5d,'jsUrl':_0x18fcf2[_0x5a0eab(0x168)],'cssUrl':_0x18fcf2[_0x5a0eab(0x16b)],'mode':_0x3c2fd6,'dryRun':_0x5c88ae[_0x5a0eab(0x184)]===!![]});if(_0x18fcf2[_0x5a0eab(0x168)]){const _0x1780db=await isUrlReachable(_0x18fcf2[_0x5a0eab(0x168)]);if(!_0x1780db)throw new Error(_0x5a0eab(0x191)+_0x18fcf2[_0x5a0eab(0x168)]);}if(_0x18fcf2[_0x5a0eab(0x16b)]){const _0x15f850=await isUrlReachable(_0x18fcf2[_0x5a0eab(0x16b)]);if(!_0x15f850)throw new Error(_0x5a0eab(0x195)+_0x18fcf2[_0x5a0eab(0x16b)]);}const _0x3e2577=await getOnlineMenuList(_0xdffb5d,_0x2b4541),_0x5e8ad7=_0x3e2577[_0x5a0eab(0x16a)](_0xfa1559=>_0xfa1559[_0x5a0eab(0x197)][_0x5a0eab(0x183)]>0x0),_0x2173ca=selectMenusForUpdate(_0x5e8ad7,_0x5c88ae[_0x5a0eab(0x18d)]);if(_0x2173ca[_0x5a0eab(0x183)]===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![],'dryRun':_0x5c88ae[_0x5a0eab(0x184)]===!![]};const _0x2f2601=_0x2173ca[_0x5a0eab(0x159)](_0x23ab3c=>buildMenuUpdateDiff(_0x23ab3c,_0x18fcf2,_0x3c2fd6,_0x5c88ae[_0x5a0eab(0x155)]===!![],_0x5c88ae[_0x5a0eab(0x17e)]));if(_0x5c88ae[_0x5a0eab(0x184)])return{'updated':0x0,'failed':0x0,'skipped':![],'dryRun':!![],'diffs':_0x2f2601};const _0xc5fb68=await Promise[_0x5a0eab(0x16e)](_0x2173ca['map']((_0x315d0c,_0x3d384c)=>updateMenuCdnUrl(_0xdffb5d,_0x2b4541,{'id':_0x315d0c['id'],'label':_0x315d0c[_0x5a0eab(0x174)],'path':_0x315d0c[_0x5a0eab(0x15a)],'resources':_0x2f2601[_0x3d384c]['after'][_0x5a0eab(0x197)],'extend':_0x315d0c[_0x5a0eab(0x193)]??null,'loadScriptMode':_0x5c88ae[_0x5a0eab(0x17e)]}))),_0x437ea2=_0xc5fb68[_0x5a0eab(0x16a)](_0x544f9b=>_0x544f9b[_0x5a0eab(0x17d)]===_0x5a0eab(0x156))[_0x5a0eab(0x159)](_0x2001ae=>_0x2001ae[_0x5a0eab(0x166)]),_0x2fbb7e=_0xc5fb68[_0x5a0eab(0x16a)](_0x412f5f=>_0x412f5f[_0x5a0eab(0x17d)]===_0x5a0eab(0x17a))[_0x5a0eab(0x183)];return logger[_0x5a0eab(0x15b)]('menu-asset-update',_0x5a0eab(0x162),{'count':_0x2173ca[_0x5a0eab(0x183)],'resources':_0x583b85}),{'updated':_0x437ea2[_0x5a0eab(0x183)],'failed':_0x2fbb7e,'skipped':![],'menus':_0x437ea2};}function validateSelection(_0x461378){const _0x4bcd55=a132_0x2ee8;if(!_0x461378)throw new Error(_0x4bcd55(0x167));if(_0x461378[_0x4bcd55(0x181)]&&(_0x461378[_0x4bcd55(0x180)][_0x4bcd55(0x183)]>0x0||_0x461378[_0x4bcd55(0x196)][_0x4bcd55(0x183)]>0x0))throw new Error('--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.');if(!_0x461378[_0x4bcd55(0x181)]&&_0x461378[_0x4bcd55(0x180)][_0x4bcd55(0x183)]===0x0&&_0x461378[_0x4bcd55(0x196)][_0x4bcd55(0x183)]===0x0)throw new Error(_0x4bcd55(0x167));}export function selectMenusForUpdate(_0xe8dda,_0x17e7c5){const _0x375116=a132_0x2ee8;validateSelection(_0x17e7c5);if(_0x17e7c5[_0x375116(0x181)])return _0xe8dda;const _0x52a1c1=new Set(_0xe8dda[_0x375116(0x159)](_0x414c21=>_0x414c21['id'])),_0x415333=new Set(_0xe8dda['map'](_0x4831a9=>_0x4831a9['path'])),_0x4f89ec=_0x17e7c5[_0x375116(0x180)][_0x375116(0x16a)](_0x313a69=>!_0x52a1c1[_0x375116(0x198)](_0x313a69)),_0x237e8b=_0x17e7c5[_0x375116(0x196)]['filter'](_0x2bf372=>!_0x415333[_0x375116(0x198)](_0x2bf372));if(_0x4f89ec['length']>0x0||_0x237e8b[_0x375116(0x183)]>0x0){const _0x9fc072=[..._0x4f89ec[_0x375116(0x159)](_0x38a6fb=>String(_0x38a6fb)),..._0x237e8b][_0x375116(0x189)](',\x20');throw new Error('menu\x20asset-update\x20selectors\x20did\x20not\x20match\x20resource-bearing\x20menus:\x20'+_0x9fc072);}const _0x413631=new Set(_0x17e7c5[_0x375116(0x180)]),_0x122981=new Set(_0x17e7c5[_0x375116(0x196)]);return _0xe8dda[_0x375116(0x16a)](_0x19aece=>_0x413631[_0x375116(0x198)](_0x19aece['id'])||_0x122981[_0x375116(0x198)](_0x19aece[_0x375116(0x15a)]));}function normalizeMode(_0x2bfb43){const _0x573796=a132_0x2ee8;if(!_0x2bfb43)return _0x573796(0x17f);if(_0x2bfb43===_0x573796(0x182)||_0x2bfb43===_0x573796(0x17f))return _0x2bfb43;throw new Error(_0x573796(0x176)+_0x2bfb43+_0x573796(0x160));}function buildMenuUpdateDiff(_0x40dd10,_0x383ae1,_0x5e614c,_0xdbde01,_0x156110){const _0x268945=a132_0x2ee8,_0xa7bd75=[..._0x40dd10[_0x268945(0x197)]];_0x5e614c===_0x268945(0x17f)&&assertUnambiguousPatchResources(_0x40dd10,_0xa7bd75,_0x383ae1);const _0x50d4ea=_0x5e614c===_0x268945(0x17f)?patchResources(_0xa7bd75,_0x383ae1):replaceResources(_0x383ae1),_0xbe038a=[],_0x5f30b8=_0xa7bd75[_0x268945(0x16f)](isJsResource),_0x13861f=_0x50d4ea['some'](isJsResource);if(_0x5f30b8&&!_0x13861f){const _0x26fcec=_0x268945(0x170)+_0x40dd10[_0x268945(0x174)]+_0x268945(0x185)+_0x40dd10[_0x268945(0x15a)]+_0x268945(0x18e)+_0x268945(0x190);if(!_0xdbde01)throw new Error(_0x26fcec);_0xbe038a[_0x268945(0x178)](_0x26fcec);}const _0x35af03=_0xa7bd75[_0x268945(0x16f)](isCssResource),_0xa95216=_0x50d4ea[_0x268945(0x16f)](isCssResource);_0x35af03&&!_0xa95216&&_0xbe038a[_0x268945(0x178)](_0x268945(0x175)+_0x40dd10[_0x268945(0x174)]+_0x268945(0x185)+_0x40dd10[_0x268945(0x15a)]+').');const _0x23bf56=typeof _0x40dd10[_0x268945(0x193)]?.['loadScriptMode']===_0x268945(0x157)?_0x40dd10['extend']['loadScriptMode']:null,_0x5ed60e=_0x156110?{'loadScriptMode':_0x23bf56}:{},_0x2342f3=_0x156110?{'loadScriptMode':_0x156110}:{};return{'id':_0x40dd10['id'],'label':_0x40dd10[_0x268945(0x174)],'path':_0x40dd10[_0x268945(0x15a)],'mode':_0x5e614c,'before':{'resources':_0xa7bd75,..._0x5ed60e},'after':{'resources':_0x50d4ea,..._0x2342f3},'warnings':_0xbe038a};}function a132_0x2ee8(_0x19489c,_0x2ae83c){_0x19489c=_0x19489c-0x155;const _0x35b3a3=a132_0x35b3();let _0x2ee8e=_0x35b3a3[_0x19489c];return _0x2ee8e;}function replaceResources(_0x5ad1cc){const _0x302dbd=a132_0x2ee8;return[_0x5ad1cc[_0x302dbd(0x168)],_0x5ad1cc[_0x302dbd(0x16b)]][_0x302dbd(0x16a)](_0xd383c1=>!!_0xd383c1);}function assertUnambiguousPatchResources(_0x556432,_0x11556a,_0x4e1689){const _0x29ea25=a132_0x2ee8,_0x5dfc47=_0x11556a[_0x29ea25(0x16a)](isJsResource)[_0x29ea25(0x183)];if(_0x4e1689['jsUrl']&&_0x5dfc47>0x1)throw new Error('menu\x20asset-update\x20cannot\x20patch\x20'+_0x5dfc47+_0x29ea25(0x18f)+_0x556432[_0x29ea25(0x174)]+_0x29ea25(0x185)+_0x556432[_0x29ea25(0x15a)]+')\x20'+_0x29ea25(0x194));const _0x4ce65f=_0x11556a['filter'](isCssResource)['length'];if(_0x4e1689[_0x29ea25(0x16b)]&&_0x4ce65f>0x1)throw new Error(_0x29ea25(0x163)+_0x4ce65f+_0x29ea25(0x165)+_0x556432[_0x29ea25(0x174)]+_0x29ea25(0x185)+_0x556432[_0x29ea25(0x15a)]+')\x20'+_0x29ea25(0x18b));}function a132_0x35b3(){const _0x4673d9=['map','path','info','7881104myPMCv','75315IVDXKT','30krJmRy','cwd','.\x20Allowed\x20values:\x20replace,\x20patch','23645mgncwm','Menu\x20asset\x20update\x20completed','menu\x20asset-update\x20cannot\x20patch\x20','split','\x20existing\x20CSS\x20resources\x20for\x20\x22','value','menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.','jsUrl','369975IzGEOI','filter','cssUrl','.css','7984242AmFchu','allSettled','some','menu\x20asset-update\x20would\x20remove\x20existing\x20JS\x20resource\x20for\x20\x22','endsWith','Start\x20non-interactive\x20menu\x20asset\x20update','128KUUqFJ','label','menu\x20asset-update\x20will\x20remove\x20existing\x20CSS\x20resource\x20for\x20\x22','Invalid\x20--mode:\x20','trim','push','6276792dkdUrz','rejected','setLogPath','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','status','loadScriptMode','patch','menuIds','all','replace','length','dryRun','\x22\x20(','mode','menu-asset-update','parse','join','Invalid\x20--params:\x20menu\x20asset-update\x20requires\x20at\x20least\x20one\x20explicit\x20JS/CSS\x20URL.\x20','with\x20a\x20single\x20cssUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','field','selection',').\x20','\x20existing\x20JS\x20resources\x20for\x20\x22','Use\x20--mode\x20patch\x20to\x20preserve\x20it,\x20pass\x20jsUrl,\x20or\x20add\x20--force\x20for\x20an\x20intentional\x20removal.','JS\x20URL\x20is\x20unreachable:\x20','6659073SyHtoC','extend','with\x20a\x20single\x20jsUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','CSS\x20URL\x20is\x20unreachable:\x20','paths','resources','has','force','fulfilled','string','object'];a132_0x35b3=function(){return _0x4673d9;};return a132_0x35b3();}function patchResources(_0xee963f,_0x8e0eea){const _0x5a2b41=a132_0x2ee8;let _0x26fdb7=![],_0x51b526=![];const _0x410cc1=[];for(const _0x1e3b6b of _0xee963f){if(isJsResource(_0x1e3b6b)){if(_0x8e0eea[_0x5a2b41(0x168)]&&!_0x26fdb7)_0x410cc1[_0x5a2b41(0x178)](_0x8e0eea['jsUrl']),_0x26fdb7=!![];else!_0x8e0eea[_0x5a2b41(0x168)]&&_0x410cc1[_0x5a2b41(0x178)](_0x1e3b6b);continue;}if(isCssResource(_0x1e3b6b)){if(_0x8e0eea[_0x5a2b41(0x16b)]&&!_0x51b526)_0x410cc1[_0x5a2b41(0x178)](_0x8e0eea[_0x5a2b41(0x16b)]),_0x51b526=!![];else!_0x8e0eea['cssUrl']&&_0x410cc1[_0x5a2b41(0x178)](_0x1e3b6b);continue;}_0x410cc1['push'](_0x1e3b6b);}return _0x8e0eea[_0x5a2b41(0x168)]&&!_0x26fdb7&&_0x410cc1['unshift'](_0x8e0eea[_0x5a2b41(0x168)]),_0x8e0eea['cssUrl']&&!_0x51b526&&_0x410cc1[_0x5a2b41(0x178)](_0x8e0eea[_0x5a2b41(0x16b)]),_0x410cc1;}function isJsResource(_0x5ab653){const _0x36d433=a132_0x2ee8;return stripQuery(_0x5ab653)['toLowerCase']()[_0x36d433(0x171)]('.js');}function isCssResource(_0xc337dc){const _0xae1850=a132_0x2ee8;return stripQuery(_0xc337dc)['toLowerCase']()['endsWith'](_0xae1850(0x16c));}function stripQuery(_0xb92708){const _0x2741f9=a132_0x2ee8;return _0xb92708[_0x2741f9(0x164)]('?')[0x0]??_0xb92708;}function parseUpdateParamsFlag(_0x1442f4){const _0x193789=a132_0x2ee8;if(!_0x1442f4||typeof _0x1442f4!==_0x193789(0x157))return{};try{const _0x3f400a=JSON[_0x193789(0x188)](_0x1442f4);if(typeof _0x3f400a!==_0x193789(0x158)||_0x3f400a===null||Array['isArray'](_0x3f400a))return{};return{'jsUrl':typeof _0x3f400a['jsUrl']===_0x193789(0x157)?_0x3f400a[_0x193789(0x168)][_0x193789(0x177)]():undefined,'cssUrl':typeof _0x3f400a[_0x193789(0x16b)]==='string'?_0x3f400a[_0x193789(0x16b)]['trim']():undefined};}catch{return{};}}
|
|
1
|
+
(function(_0x34c837,_0x34ebd2){const _0x781f4e=a132_0x10f2,_0x657372=_0x34c837();while(!![]){try{const _0x4f6b0b=parseInt(_0x781f4e(0xf7))/0x1+parseInt(_0x781f4e(0xfd))/0x2+parseInt(_0x781f4e(0x10b))/0x3*(-parseInt(_0x781f4e(0xfa))/0x4)+parseInt(_0x781f4e(0x115))/0x5+-parseInt(_0x781f4e(0x101))/0x6*(parseInt(_0x781f4e(0xf6))/0x7)+parseInt(_0x781f4e(0x10f))/0x8+parseInt(_0x781f4e(0x108))/0x9*(parseInt(_0x781f4e(0x100))/0xa);if(_0x4f6b0b===_0x34ebd2)break;else _0x657372['push'](_0x657372['shift']());}catch(_0x36cbfb){_0x657372['push'](_0x657372['shift']());}}}(a132_0x3f85,0xb69f8));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(_0x52396b){const _0x1bfb30=a132_0x10f2,_0x530eed=[];return _0x52396b[_0x1bfb30(0xf4)]&&!isValidJsHttpsUrl(_0x52396b['jsUrl'])&&_0x530eed['push']({'field':'jsUrl','message':_0x1bfb30(0x117)}),_0x52396b['cssUrl']&&!isValidCssHttpsUrl(_0x52396b[_0x1bfb30(0x106)])&&_0x530eed[_0x1bfb30(0xdc)]({'field':'cssUrl','message':_0x1bfb30(0x102)}),_0x530eed;}export async function runMenuUpdateCore(_0x749224,_0x49754d,_0x3769fe,_0x318974={}){const _0x1bedaf=a132_0x10f2,_0xe35370=parseUpdateParamsFlag(_0x3769fe),_0x464d41=normalizeMode(_0x318974[_0x1bedaf(0x110)]);validateSelection(_0x318974['selection']);const _0x35a11b=[];if(_0xe35370['jsUrl'])_0x35a11b[_0x1bedaf(0xdc)](_0xe35370[_0x1bedaf(0xf4)]);if(_0xe35370[_0x1bedaf(0x106)])_0x35a11b[_0x1bedaf(0xdc)](_0xe35370[_0x1bedaf(0x106)]);const _0x8e9386=validateParams(_0xe35370);if(_0x8e9386['length']>0x0){const _0x9fa535=_0x8e9386[_0x1bedaf(0x104)](_0x30d7e7=>_0x1bedaf(0x119)+_0x30d7e7[_0x1bedaf(0xee)]+':\x20'+_0x30d7e7[_0x1bedaf(0xe6)])[_0x1bedaf(0x105)](';\x20');throw new Error(_0x1bedaf(0xd6)+_0x9fa535);}if(_0x35a11b[_0x1bedaf(0xda)]===0x0)throw new Error(_0x1bedaf(0xf9)+'Pass\x20--params\x20\x27{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}\x27\x20to\x20update\x20assets.');logger[_0x1bedaf(0xe9)](process[_0x1bedaf(0xe2)]()),logger['info'](_0x1bedaf(0x111),_0x1bedaf(0x103),{'appCode':_0x749224,'jsUrl':_0xe35370[_0x1bedaf(0xf4)],'cssUrl':_0xe35370[_0x1bedaf(0x106)],'mode':_0x464d41,'dryRun':_0x318974[_0x1bedaf(0xff)]===!![]});if(_0xe35370[_0x1bedaf(0xf4)]){const _0x58daac=await isUrlReachable(_0xe35370['jsUrl']);if(!_0x58daac)throw new Error(_0x1bedaf(0xe8)+_0xe35370['jsUrl']);}if(_0xe35370[_0x1bedaf(0x106)]){const _0x2bbbaf=await isUrlReachable(_0xe35370[_0x1bedaf(0x106)]);if(!_0x2bbbaf)throw new Error(_0x1bedaf(0x113)+_0xe35370[_0x1bedaf(0x106)]);}const _0x31ff64=await getOnlineMenuList(_0x749224,_0x49754d),_0x3d68b4=_0x31ff64['filter'](_0x21c023=>_0x21c023[_0x1bedaf(0xd3)]['length']>0x0),_0x304e5d=selectMenusForUpdate(_0x3d68b4,_0x318974[_0x1bedaf(0xf2)]);if(_0x304e5d['length']===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![],'dryRun':_0x318974[_0x1bedaf(0xff)]===!![]};const _0x60f8d8=_0x304e5d[_0x1bedaf(0x104)](_0x2d5fd2=>buildMenuUpdateDiff(_0x2d5fd2,_0xe35370,_0x464d41,_0x318974[_0x1bedaf(0xd4)]===!![],_0x318974[_0x1bedaf(0x114)]));if(_0x318974[_0x1bedaf(0xff)])return{'updated':0x0,'failed':0x0,'skipped':![],'dryRun':!![],'diffs':_0x60f8d8};const _0x4c807=await Promise[_0x1bedaf(0x109)](_0x304e5d['map']((_0x37fc89,_0x5ebeb6)=>updateMenuCdnUrl(_0x749224,_0x49754d,{'id':_0x37fc89['id'],'label':_0x37fc89[_0x1bedaf(0xe7)],'path':_0x37fc89[_0x1bedaf(0xfe)],'resources':_0x60f8d8[_0x5ebeb6][_0x1bedaf(0xed)][_0x1bedaf(0xd3)],'extend':_0x37fc89['extend']??null,'loadScriptMode':_0x318974['loadScriptMode']}))),_0xac8b6c=_0x4c807[_0x1bedaf(0xf8)](_0x471aa5=>_0x471aa5[_0x1bedaf(0xea)]==='fulfilled')['map'](_0x7d36c3=>_0x7d36c3[_0x1bedaf(0xe0)]),_0x5eacab=_0x4c807[_0x1bedaf(0xf8)](_0x5e0aa1=>_0x5e0aa1[_0x1bedaf(0xea)]==='rejected')[_0x1bedaf(0xda)];return logger[_0x1bedaf(0xf0)](_0x1bedaf(0x111),_0x1bedaf(0x112),{'count':_0x304e5d[_0x1bedaf(0xda)],'resources':_0x35a11b}),{'updated':_0xac8b6c[_0x1bedaf(0xda)],'failed':_0x5eacab,'skipped':![],'menus':_0xac8b6c};}function a132_0x10f2(_0xf747c,_0x23fc06){_0xf747c=_0xf747c-0xd3;const _0x3f85f8=a132_0x3f85();let _0x10f2e7=_0x3f85f8[_0xf747c];return _0x10f2e7;}function validateSelection(_0x2a55c4){const _0x38f5eb=a132_0x10f2;if(!_0x2a55c4)throw new Error(_0x38f5eb(0xe3));if(_0x2a55c4[_0x38f5eb(0x10a)]&&(_0x2a55c4['menuIds'][_0x38f5eb(0xda)]>0x0||_0x2a55c4[_0x38f5eb(0xd9)][_0x38f5eb(0xda)]>0x0))throw new Error(_0x38f5eb(0xf1));if(!_0x2a55c4[_0x38f5eb(0x10a)]&&_0x2a55c4['menuIds'][_0x38f5eb(0xda)]===0x0&&_0x2a55c4[_0x38f5eb(0xd9)][_0x38f5eb(0xda)]===0x0)throw new Error(_0x38f5eb(0xe3));}export function selectMenusForUpdate(_0x2baac4,_0x16ce4a){const _0x185557=a132_0x10f2;validateSelection(_0x16ce4a);if(_0x16ce4a[_0x185557(0x10a)])return _0x2baac4;const _0x5276d5=new Set(_0x2baac4[_0x185557(0x104)](_0x5eb3d8=>_0x5eb3d8['id'])),_0x47bc06=new Set(_0x2baac4[_0x185557(0x104)](_0x1f2566=>_0x1f2566['path'])),_0x59954a=_0x16ce4a[_0x185557(0xfc)][_0x185557(0xf8)](_0xa89b68=>!_0x5276d5['has'](_0xa89b68)),_0x212b1a=_0x16ce4a[_0x185557(0xd9)][_0x185557(0xf8)](_0x2b5898=>!_0x47bc06[_0x185557(0xf3)](_0x2b5898));if(_0x59954a[_0x185557(0xda)]>0x0||_0x212b1a[_0x185557(0xda)]>0x0){const _0x84585c=[..._0x59954a[_0x185557(0x104)](_0x3b2568=>String(_0x3b2568)),..._0x212b1a][_0x185557(0x105)](',\x20');throw new Error(_0x185557(0xd7)+_0x84585c);}const _0x209f12=new Set(_0x16ce4a[_0x185557(0xfc)]),_0x19014a=new Set(_0x16ce4a[_0x185557(0xd9)]);return _0x2baac4['filter'](_0x26abfd=>_0x209f12[_0x185557(0xf3)](_0x26abfd['id'])||_0x19014a['has'](_0x26abfd['path']));}function normalizeMode(_0x3a8ca2){const _0x4324d0=a132_0x10f2;if(!_0x3a8ca2)return _0x4324d0(0xe4);if(_0x3a8ca2===_0x4324d0(0xef)||_0x3a8ca2==='patch')return _0x3a8ca2;throw new Error(_0x4324d0(0xfb)+_0x3a8ca2+_0x4324d0(0xe5));}function buildMenuUpdateDiff(_0x992410,_0x1329d9,_0x4c570d,_0x4505e3,_0x488175){const _0x3805fa=a132_0x10f2,_0x23a56a=[..._0x992410[_0x3805fa(0xd3)]];_0x4c570d==='patch'&&assertUnambiguousPatchResources(_0x992410,_0x23a56a,_0x1329d9);const _0x59f9ba=_0x4c570d==='patch'?patchResources(_0x23a56a,_0x1329d9):replaceResources(_0x1329d9),_0x27fdad=[],_0x5072e7=_0x23a56a[_0x3805fa(0xd5)](isJsResource),_0x5a6f1e=_0x59f9ba[_0x3805fa(0xd5)](isJsResource);if(_0x5072e7&&!_0x5a6f1e){const _0x418df5='menu\x20asset-update\x20would\x20remove\x20existing\x20JS\x20resource\x20for\x20\x22'+_0x992410[_0x3805fa(0xe7)]+_0x3805fa(0xec)+_0x992410[_0x3805fa(0xfe)]+_0x3805fa(0xf5)+_0x3805fa(0x10c);if(!_0x4505e3)throw new Error(_0x418df5);_0x27fdad[_0x3805fa(0xdc)](_0x418df5);}const _0x2418b6=_0x23a56a[_0x3805fa(0xd5)](isCssResource),_0x3dcec5=_0x59f9ba[_0x3805fa(0xd5)](isCssResource);_0x2418b6&&!_0x3dcec5&&_0x27fdad[_0x3805fa(0xdc)](_0x3805fa(0x10e)+_0x992410[_0x3805fa(0xe7)]+_0x3805fa(0xec)+_0x992410['path']+').');const _0x3876bf=typeof _0x992410['extend']?.['loadScriptMode']===_0x3805fa(0x116)?_0x992410['extend'][_0x3805fa(0x114)]:null,_0x3d628d=_0x488175?{'loadScriptMode':_0x3876bf}:{},_0x4ab335=_0x488175?{'loadScriptMode':_0x488175}:{};return{'id':_0x992410['id'],'label':_0x992410[_0x3805fa(0xe7)],'path':_0x992410[_0x3805fa(0xfe)],'mode':_0x4c570d,'before':{'resources':_0x23a56a,..._0x3d628d},'after':{'resources':_0x59f9ba,..._0x4ab335},'warnings':_0x27fdad};}function replaceResources(_0x3582f2){const _0x143941=a132_0x10f2;return[_0x3582f2['jsUrl'],_0x3582f2[_0x143941(0x106)]][_0x143941(0xf8)](_0x620021=>!!_0x620021);}function a132_0x3f85(){const _0x286946=['jsUrl',').\x20','9330811CuUIFf','389532smxbYE','filter','Invalid\x20--params:\x20menu\x20asset-update\x20requires\x20at\x20least\x20one\x20explicit\x20JS/CSS\x20URL.\x20','5759524sYXTii','Invalid\x20--mode:\x20','menuIds','387744rNXIdt','path','dryRun','10iKQfKX','6xmDByR','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','Start\x20non-interactive\x20menu\x20asset\x20update','map','join','cssUrl','menu\x20asset-update\x20cannot\x20patch\x20','10926108Uoeblp','allSettled','all','3DBygcx','Use\x20--mode\x20patch\x20to\x20preserve\x20it,\x20pass\x20jsUrl,\x20or\x20add\x20--force\x20for\x20an\x20intentional\x20removal.','.js','menu\x20asset-update\x20will\x20remove\x20existing\x20CSS\x20resource\x20for\x20\x22','8351424CanOSn','mode','menu-asset-update','Menu\x20asset\x20update\x20completed','CSS\x20URL\x20is\x20unreachable:\x20','loadScriptMode','3397670oQcTax','string','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','toLowerCase','--params.','resources','force','some','Invalid\x20--params:\x20','menu\x20asset-update\x20selectors\x20did\x20not\x20match\x20resource-bearing\x20menus:\x20','with\x20a\x20single\x20cssUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','paths','length','trim','push','endsWith','.css','with\x20a\x20single\x20jsUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','value','\x20existing\x20CSS\x20resources\x20for\x20\x22','cwd','menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.','patch','.\x20Allowed\x20values:\x20replace,\x20patch','message','label','JS\x20URL\x20is\x20unreachable:\x20','setLogPath','status','unshift','\x22\x20(','after','field','replace','info','--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.','selection','has'];a132_0x3f85=function(){return _0x286946;};return a132_0x3f85();}function assertUnambiguousPatchResources(_0x55378e,_0x188900,_0x23c145){const _0x48de3a=a132_0x10f2,_0x13e616=_0x188900[_0x48de3a(0xf8)](isJsResource)[_0x48de3a(0xda)];if(_0x23c145[_0x48de3a(0xf4)]&&_0x13e616>0x1)throw new Error('menu\x20asset-update\x20cannot\x20patch\x20'+_0x13e616+'\x20existing\x20JS\x20resources\x20for\x20\x22'+_0x55378e[_0x48de3a(0xe7)]+_0x48de3a(0xec)+_0x55378e[_0x48de3a(0xfe)]+')\x20'+_0x48de3a(0xdf));const _0x4671eb=_0x188900[_0x48de3a(0xf8)](isCssResource)['length'];if(_0x23c145[_0x48de3a(0x106)]&&_0x4671eb>0x1)throw new Error(_0x48de3a(0x107)+_0x4671eb+_0x48de3a(0xe1)+_0x55378e[_0x48de3a(0xe7)]+'\x22\x20('+_0x55378e[_0x48de3a(0xfe)]+')\x20'+_0x48de3a(0xd8));}function patchResources(_0x8e6f73,_0x191d23){const _0x582fb5=a132_0x10f2;let _0x1bec91=![],_0x1c4bc6=![];const _0xbed5af=[];for(const _0x261fd0 of _0x8e6f73){if(isJsResource(_0x261fd0)){if(_0x191d23[_0x582fb5(0xf4)]&&!_0x1bec91)_0xbed5af[_0x582fb5(0xdc)](_0x191d23[_0x582fb5(0xf4)]),_0x1bec91=!![];else!_0x191d23[_0x582fb5(0xf4)]&&_0xbed5af[_0x582fb5(0xdc)](_0x261fd0);continue;}if(isCssResource(_0x261fd0)){if(_0x191d23[_0x582fb5(0x106)]&&!_0x1c4bc6)_0xbed5af[_0x582fb5(0xdc)](_0x191d23[_0x582fb5(0x106)]),_0x1c4bc6=!![];else!_0x191d23[_0x582fb5(0x106)]&&_0xbed5af['push'](_0x261fd0);continue;}_0xbed5af['push'](_0x261fd0);}return _0x191d23[_0x582fb5(0xf4)]&&!_0x1bec91&&_0xbed5af[_0x582fb5(0xeb)](_0x191d23['jsUrl']),_0x191d23[_0x582fb5(0x106)]&&!_0x1c4bc6&&_0xbed5af[_0x582fb5(0xdc)](_0x191d23[_0x582fb5(0x106)]),_0xbed5af;}function isJsResource(_0x481ad6){const _0x197804=a132_0x10f2;return stripQuery(_0x481ad6)[_0x197804(0x118)]()[_0x197804(0xdd)](_0x197804(0x10d));}function isCssResource(_0x42112d){const _0x1e8eeb=a132_0x10f2;return stripQuery(_0x42112d)[_0x1e8eeb(0x118)]()[_0x1e8eeb(0xdd)](_0x1e8eeb(0xde));}function stripQuery(_0x51c507){return _0x51c507['split']('?')[0x0]??_0x51c507;}function parseUpdateParamsFlag(_0x343889){const _0x546286=a132_0x10f2;if(!_0x343889||typeof _0x343889!==_0x546286(0x116))return{};try{const _0x2c39c4=JSON['parse'](_0x343889);if(typeof _0x2c39c4!=='object'||_0x2c39c4===null||Array['isArray'](_0x2c39c4))return{};return{'jsUrl':typeof _0x2c39c4[_0x546286(0xf4)]===_0x546286(0x116)?_0x2c39c4[_0x546286(0xf4)][_0x546286(0xdb)]():undefined,'cssUrl':typeof _0x2c39c4[_0x546286(0x106)]===_0x546286(0x116)?_0x2c39c4[_0x546286(0x106)][_0x546286(0xdb)]():undefined};}catch{return{};}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x460b98,_0x1ee9dc){const _0x1d916e=a133_0x41db,_0x1a60fe=_0x460b98();while(!![]){try{const _0x5a36c0=parseInt(_0x1d916e(0x1d2))/0x1*(parseInt(_0x1d916e(0x1d5))/0x2)+-parseInt(_0x1d916e(0x1d3))/0x3+parseInt(_0x1d916e(0x1d4))/0x4*(parseInt(_0x1d916e(0x1d0))/0x5)+parseInt(_0x1d916e(0x1d6))/0x6+-parseInt(_0x1d916e(0x1cc))/0x7*(-parseInt(_0x1d916e(0x1d7))/0x8)+-parseInt(_0x1d916e(0x1cb))/0x9*(parseInt(_0x1d916e(0x1d1))/0xa)+parseInt(_0x1d916e(0x1ca))/0xb;if(_0x5a36c0===_0x1ee9dc)break;else _0x1a60fe['push'](_0x1a60fe['shift']());}catch(_0x48256a){_0x1a60fe['push'](_0x1a60fe['shift']());}}}(a133_0x3e41,0x62bd5));export function isValidJsHttpsUrl(_0x55f39a){const _0x3a1203=a133_0x41db;return/^https:\/\/.+\.js(\?.*)?$/[_0x3a1203(0x1cf)](_0x55f39a['trim']());}export function isValidCssHttpsUrl(_0x3fa387){const _0xcc7eb3=a133_0x41db;return/^https:\/\/.+\.css(\?.*)?$/[_0xcc7eb3(0x1cf)](_0x3fa387[_0xcc7eb3(0x1ce)]());}function a133_0x41db(_0x4c7876,_0x49869d){_0x4c7876=_0x4c7876-0x1ca;const _0x3e416f=a133_0x3e41();let _0x41db56=_0x3e416f[_0x4c7876];return _0x41db56;}function a133_0x3e41(){const _0x12f96b=['7668410molKxb','50981bdEEVq','2244012QYEvyV','1137572LGtHmX','26mqbCsw','3184752YLWZpp','8umHXaf','942216nAprUI','9JXaIKQ','2489816ncmhXL','HEAD','trim','test','5yiOCwr'];a133_0x3e41=function(){return _0x12f96b;};return a133_0x3e41();}export async function isUrlReachable(_0x58e565){const _0x406887=a133_0x41db;try{const _0x8d47a9=await fetch(_0x58e565,{'method':_0x406887(0x1cd)});return _0x8d47a9['ok'];}catch{return![];}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a134_0x2c97(){const _0x532e86=['6zdvLGq','/smartapi/menu/create','1671796LDrikW','selectedAppName','Non-interactive\x20menu\x20sync\x20requires\x20--yes.','POST','appcode','Would\x20create\x20','onlineMenuList','Pre-fill\x20JS/CSS\x20URLs.\x20','string','\x20\x20!\x20No\x20local\x20pages\x20found,\x20please\x20create\x20pages\x20first','Exact\x20comma-separated\x20local\x20page\x20paths\x20to\x20sync','Menu\x20creation\x20failed','str','cyan','map','\x20\x20Continue\x20with\x20creation?','4583655KOFwuy','Menu\x20sync\x20completed:\x20','3850885lJorXP','targetPages','skipped','paths','901202ClggdN','875971kefAVA','cookie','Failed\x20to\x20fetch\x20online\x20menu\x20list','menu\x20sync\x20--paths\x20requires\x20--yes\x20for\x20execution.','\x20menu(s)','\x20local\x20microfrontend\x20menu(s).','Created\x20','Menu\x20sync\x20skipped','menu','gray','\x20and\x20CSS:\x20','failed','created','appCode','localPages','jsUrl','\x20menu(s)...','menu\x20sync\x20requires\x20a\x20project\x20context\x20or\x20explicit\x20--appcode.\x20','1844252PYItGa','length','write','\x20menu(s)\x20with\x20JS:\x20','size','\x20created.','✓\x20All\x20local\x20pages\x20are\x20already\x20on\x20platform','yellow','Online\x20menu\x20list\x20fetched','6uUeYIK','cssUrl','sync','\x20\x20Cancelled.','JSON:\x20{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}','No\x20local\x20microfrontend\x20menus\x20would\x20be\x20created.','Run\x20inside\x20a\x20directory\x20with\x20.rabetbase.json,\x20or\x20pass\x20--appcode\x20<code>.','filter','flag','message','✓\x20Menu\x20sync\x20completed:\x20','validation','trim','5739624ujFSmX'];a134_0x2c97=function(){return _0x532e86;};return a134_0x2c97();}const a134_0x18b31c=a134_0x8df3;(function(_0x5f0d6b,_0x10124f){const _0x4ada99=a134_0x8df3,_0xaac293=_0x5f0d6b();while(!![]){try{const _0x16aaeb=parseInt(_0x4ada99(0xc8))/0x1+parseInt(_0x4ada99(0xc7))/0x2*(parseInt(_0x4ada99(0xaf))/0x3)+-parseInt(_0x4ada99(0xda))/0x4+-parseInt(_0x4ada99(0xc3))/0x5+parseInt(_0x4ada99(0xa1))/0x6*(parseInt(_0x4ada99(0xb1))/0x7)+-parseInt(_0x4ada99(0xae))/0x8+parseInt(_0x4ada99(0xc1))/0x9;if(_0x16aaeb===_0x10124f)break;else _0xaac293['push'](_0xaac293['shift']());}catch(_0x580cdd){_0xaac293['push'](_0xaac293['shift']());}}}(a134_0x2c97,0x8cc5b));import a134_0x367112 from'chalk';import{buildCompareRows,doCreateMenus,fetchMenuData}from'../../commands/menu/shared/logic.js';import{renderCompareTable,renderSyncSummary}from'../../commands/menu/shared/compare-table.js';import{selectPages,askJsUrl,askCssUrl,askConfirm,startSpinner,stopSpinner,isInteractive,requireInteractive}from'../../commands/menu/shared/inquirer.js';import{CliErrors}from'../../errors.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';import{parseMenuSyncParams,runMenuSyncCore}from'../../commands/menu/shared/sync-core.js';function a134_0x8df3(_0x4a868e,_0x343d6c){_0x4a868e=_0x4a868e-0x9c;const _0x2c9702=a134_0x2c97();let _0x8df324=_0x2c9702[_0x4a868e];return _0x8df324;}import{getLocalPages}from'../../commands/menu/shared/local-pages.js';import{isInProject}from'../../context.js';export const menuSync={'service':a134_0x18b31c(0xd0),'command':a134_0x18b31c(0xa3),'description':'Sync\x20local\x20pages\x20as\x20platform\x20menus','risk':a134_0x18b31c(0xdc),'flags':[{'name':'params','type':a134_0x18b31c(0xb9),'description':a134_0x18b31c(0xb8)+a134_0x18b31c(0xa5)},{'name':'paths','type':'string','description':a134_0x18b31c(0xbb)},{'name':'yes','type':'boolean','description':'Confirm\x20non-interactive\x20sync;\x20without\x20--paths,\x20create\x20all\x20missing\x20local\x20pages'}],async 'dryRun'(_0x2ac711){const _0x430e40=a134_0x18b31c;ensureRunnableContext(_0x2ac711['rawFlags'],_0x2ac711[_0x430e40(0xb2)]);const _0x2023ed=await runMenuSyncCore(_0x2ac711['appCode'],_0x2ac711['cookie'],parsePaths(_0x2ac711[_0x430e40(0xbd)](_0x430e40(0xc6))),_0x2ac711['str']('params'),{'dryRun':!![]});return{'method':_0x430e40(0xb4),'url':_0x430e40(0xb0),'body':_0x2023ed,'description':_0x2023ed[_0x430e40(0xc5)]?_0x430e40(0xa6):_0x430e40(0xb6)+_0x2023ed[_0x430e40(0xc4)][_0x430e40(0xdb)]+_0x430e40(0xcd)};},async 'execute'(_0x1e9a21){const _0x33f59a=a134_0x18b31c;ensureRunnableContext(_0x1e9a21['rawFlags'],_0x1e9a21[_0x33f59a(0xb2)]);const _0x56d79b=_0x1e9a21[_0x33f59a(0xa9)]('yes'),_0x1c9bf1=_0x1e9a21[_0x33f59a(0xbd)]('params'),_0x58872f=parsePaths(_0x1e9a21[_0x33f59a(0xbd)](_0x33f59a(0xc6))),_0xa1e788=parseMenuSyncParams(_0x1c9bf1);if(_0x56d79b){const _0x4c03dc=await runMenuSyncCore(_0x1e9a21[_0x33f59a(0xd5)],_0x1e9a21[_0x33f59a(0xc9)],_0x58872f,_0x1c9bf1);if(_0x4c03dc[_0x33f59a(0xc5)]){const _0x376d0e=getLocalPages();_0x376d0e[_0x33f59a(0xdb)]===0x0?writeCliSideChannelLine('!\x20No\x20local\x20pages\x20found\x20in\x20src/pages'):writeCliSideChannelLine(_0x33f59a(0x9e));}else writeCliSideChannelLine(_0x33f59a(0xab)+_0x4c03dc['created']+'\x20menu(s)\x20created');return{'ok':!![],'data':_0x4c03dc,'message':_0x4c03dc['skipped']?_0x33f59a(0xcf):'Menu\x20sync\x20completed:\x20'+_0x4c03dc[_0x33f59a(0xd4)]+_0x33f59a(0x9d)};}if(_0x58872f['length']>0x0)throw CliErrors[_0x33f59a(0xac)](_0x33f59a(0xcb),'Preview\x20with\x20--dry-run,\x20then\x20reuse\x20the\x20same\x20--paths\x20and\x20--params\x20with\x20--yes.');if(!isInteractive()&&_0x1c9bf1)throw CliErrors[_0x33f59a(0xac)](_0x33f59a(0xb3),'Preview\x20with\x20--dry-run,\x20then\x20reuse\x20the\x20same\x20--paths\x20and\x20--params\x20with\x20--yes.');requireInteractive();const _0x2362c6=startSpinner('Fetching\x20online\x20menu\x20list...');let _0x4ef3cf,_0x10ad23,_0x11ca66;try{const _0xc61ef9=await fetchMenuData(_0x1e9a21[_0x33f59a(0xd5)],_0x1e9a21[_0x33f59a(0xc9)]);_0x4ef3cf=_0xc61ef9[_0x33f59a(0xd6)],_0x10ad23=_0xc61ef9['onlinePaths'],_0x11ca66=_0xc61ef9[_0x33f59a(0xb7)],stopSpinner(_0x2362c6,_0x33f59a(0xa0),!![]);}catch(_0x4059e7){stopSpinner(_0x2362c6,_0x33f59a(0xca),![]);throw CliErrors[_0x33f59a(0xac)](_0x4059e7 instanceof Error?_0x4059e7[_0x33f59a(0xaa)]:_0x33f59a(0xca));}if(_0x4ef3cf[_0x33f59a(0xdb)]===0x0)return writeCliSideChannelLine(a134_0x367112[_0x33f59a(0x9f)](_0x33f59a(0xba))),{'ok':!![]};const _0x150216=buildCompareRows(_0x4ef3cf,_0x10ad23);writeCliSideChannelLine(renderCompareTable(_0x150216)),writeCliSideChannelLine('');const _0x41b1c0=await selectPages(_0x4ef3cf,_0x10ad23);writeCliSideChannelLine(''),writeCliSideChannelLine(a134_0x367112[_0x33f59a(0xbe)]('\x20\x20✓\x20Selected:\x20'+_0x41b1c0[_0x33f59a(0xdb)]+'\x20page(s)'));const _0x2281c6=_0xa1e788[_0x33f59a(0xd7)]&&_0xa1e788[_0x33f59a(0xa2)];if(!_0x2281c6){writeCliSideChannelLine(renderSyncSummary(_0x41b1c0,_0x10ad23[_0x33f59a(0x9c)]>0x0));const _0x183dca=await askConfirm(_0x33f59a(0xc0));if(!_0x183dca)return writeCliSideChannelLine(a134_0x367112[_0x33f59a(0xd1)](_0x33f59a(0xa4))),{'ok':!![]};}let _0x4fec8d=_0xa1e788[_0x33f59a(0xd7)],_0x33cced=_0xa1e788[_0x33f59a(0xa2)];!_0x4fec8d&&(_0x4fec8d=await askJsUrl());!_0x33cced&&(_0x33cced=await askCssUrl());const _0xac26a7=await askConfirm('\x20\x20Create\x20'+_0x41b1c0[_0x33f59a(0xdb)]+_0x33f59a(0xdd)+_0x4fec8d+_0x33f59a(0xd2)+_0x33cced+'?');if(!_0xac26a7)return writeCliSideChannelLine(a134_0x367112[_0x33f59a(0xd1)](_0x33f59a(0xa4))),{'ok':!![]};const _0x4dbc5c=[_0x4fec8d,_0x33cced],_0x2299cb=startSpinner('Creating\x20'+_0x41b1c0[_0x33f59a(0xdb)]+_0x33f59a(0xd8));try{const _0x5cec1b=await doCreateMenus(_0x1e9a21['appCode'],_0x1e9a21['cookie'],_0x41b1c0,_0x4dbc5c);return stopSpinner(_0x2299cb,_0x33f59a(0xce)+_0x5cec1b[_0x33f59a(0xd4)]+_0x33f59a(0xcc),!![]),{'ok':!![],'data':_0x5cec1b,'message':_0x33f59a(0xc2)+_0x5cec1b['created']+'\x20created,\x20'+_0x5cec1b[_0x33f59a(0xd3)]+'\x20failed.'};}catch(_0x4c9f3c){stopSpinner(_0x2299cb,_0x33f59a(0xbc),![]);throw CliErrors['validation'](_0x4c9f3c instanceof Error?_0x4c9f3c[_0x33f59a(0xaa)]:'Menu\x20creation\x20failed');}}};function ensureRunnableContext(_0x1d411f,_0x49e2ce){const _0x4c9da3=a134_0x18b31c,_0x2f99d7=_0x1d411f[_0x4c9da3(0xb5)]?String(_0x1d411f['appcode'])[_0x4c9da3(0xad)]():'';if(!isInProject()&&!_0x49e2ce&&!_0x2f99d7)throw CliErrors[_0x4c9da3(0xac)](_0x4c9da3(0xd9)+_0x4c9da3(0xa7));}function parsePaths(_0x532e37){const _0x25ccee=a134_0x18b31c;return[...new Set(_0x532e37['split'](',')[_0x25ccee(0xbf)](_0x12fd40=>_0x12fd40[_0x25ccee(0xad)]())[_0x25ccee(0xa8)](Boolean))];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a135_0x367df9=a135_0x4ecb;(function(_0x1de94e,_0x5cbf87){const _0x1af737=a135_0x4ecb,_0x562b9a=_0x1de94e();while(!![]){try{const _0x21cda6=parseInt(_0x1af737(0x19f))/0x1*(parseInt(_0x1af737(0x18a))/0x2)+parseInt(_0x1af737(0x189))/0x3+-parseInt(_0x1af737(0x197))/0x4*(parseInt(_0x1af737(0x191))/0x5)+-parseInt(_0x1af737(0x1a2))/0x6*(-parseInt(_0x1af737(0x1a0))/0x7)+-parseInt(_0x1af737(0x184))/0x8+parseInt(_0x1af737(0x1a3))/0x9*(-parseInt(_0x1af737(0x188))/0xa)+parseInt(_0x1af737(0x198))/0xb;if(_0x21cda6===_0x5cbf87)break;else _0x562b9a['push'](_0x562b9a['shift']());}catch(_0x36fc4f){_0x562b9a['push'](_0x562b9a['shift']());}}}(a135_0x1bfd,0x4deb8));import{asDryRunResult}from'../../commands/common/dry-run.js';import{createNotificationChannelConfig,getNotificationChannelConfig,isPlatformTransportFailure}from'../../core/api-client.js';function a135_0x4ecb(_0xfedfb9,_0x33bf2c){_0xfedfb9=_0xfedfb9-0x183;const _0x1bfd99=a135_0x1bfd();let _0x4ecb2c=_0x1bfd99[_0xfedfb9];return _0x4ecb2c;}import{assertSingleNotificationSource,createMutationInput,DEFAULT_NOTIFICATION_CONNECT_TIMEOUT,DEFAULT_NOTIFICATION_READ_TIMEOUT,normalizeExactNotificationConfig,notificationError,notificationLookupCommand,NOTIFICATION_APP_FLAG,NOTIFICATION_INPUT_FLAGS,projectNotificationConfig,readNotificationDocument,safeApiFailure}from'../../commands/notification/shared.js';const CREATE_PATH=a135_0x367df9(0x195);function a135_0x1bfd(){const _0x5a9f92=['notification','configCode','configName','Create\x20an\x20app-level\x20notification\x20config\x20from\x20a\x20secure\x20JSON\x20source','document','4155oPrUxJ','readTimeout','connectTimeout','channelConfig','/notification/channel-config/create','Inspect\x20with\x20','504lktvya','7691112CJWscK','POST','Created\x20notification\x20config\x20',';\x20do\x20not\x20resubmit.','verification','write','Notification\x20config\x20create\x20outcome\x20is\x20unknown\x20because\x20no\x20server\x20ID\x20was\x20received.','7wbhfbW','161Qyoavk','config-create','42174XugXlx','38007kBjcgG','channelType','description','create','mutation','input','notification_config_create_outcome_unknown','3788328CcJVRD','appCode','endpointUrl','Notification\x20config\x20create\x20returned\x20no\x20usable\x20server\x20ID.','1150eVWeld','468384xPneAd','104590fdvbaG','verified'];a135_0x1bfd=function(){return _0x5a9f92;};return a135_0x1bfd();}async function prepareCreate(_0x2ab7bd){const _0x4f3458=a135_0x367df9,_0x409d97=await readNotificationDocument(_0x2ab7bd,_0x4f3458(0x1a6)),_0x1467aa=createMutationInput(_0x2ab7bd['appCode'],_0x409d97);return{'document':_0x409d97,'input':_0x1467aa,'planned':projectNotificationConfig({'appCode':_0x2ab7bd['appCode'],'configName':_0x409d97[_0x4f3458(0x18e)],'channelType':_0x409d97['channelType'],'endpointUrl':_0x409d97[_0x4f3458(0x186)],'channelConfig':_0x409d97[_0x4f3458(0x194)],'description':_0x409d97[_0x4f3458(0x1a5)],'connectTimeout':_0x409d97[_0x4f3458(0x193)]??DEFAULT_NOTIFICATION_CONNECT_TIMEOUT,'readTimeout':_0x409d97[_0x4f3458(0x192)]??DEFAULT_NOTIFICATION_READ_TIMEOUT})};}export const notificationConfigCreate={'service':a135_0x367df9(0x18c),'command':a135_0x367df9(0x1a1),'description':a135_0x367df9(0x18f),'risk':a135_0x367df9(0x19d),'requiresAppCode':!![],'structuredErrors':!![],'flags':[...NOTIFICATION_INPUT_FLAGS,NOTIFICATION_APP_FLAG],async 'validate'(_0x2141fa){assertSingleNotificationSource(_0x2141fa);},async 'dryRun'(_0x34c57d){const _0x25f3fb=a135_0x367df9,_0x3938c4=await prepareCreate(_0x34c57d),_0x9d411a=notificationLookupCommand(_0x34c57d[_0x25f3fb(0x185)],_0x3938c4['document'][_0x25f3fb(0x1a4)]);return asDryRunResult({'operation':_0x25f3fb(0x1a6),'selector':{'appCode':_0x34c57d['appCode'],'configName':_0x3938c4[_0x25f3fb(0x190)][_0x25f3fb(0x18e)],'channelType':_0x3938c4[_0x25f3fb(0x190)][_0x25f3fb(0x1a4)]},'before':null,'after':_0x3938c4['planned'],'dryRun':!![],'backend':{'method':_0x25f3fb(0x199),'path':CREATE_PATH},'warnings':[],'verification':{'status':'planned','lookupCommand':_0x9d411a}},{'method':'POST','url':CREATE_PATH});},async 'execute'(_0x3a0bff){const _0x3c0598=a135_0x367df9,_0x50f582=await prepareCreate(_0x3a0bff),_0x6ffff=notificationLookupCommand(_0x3a0bff[_0x3c0598(0x185)],_0x50f582[_0x3c0598(0x190)][_0x3c0598(0x1a4)]);let _0x5d6f8a;try{_0x5d6f8a=await createNotificationChannelConfig(_0x50f582[_0x3c0598(0x1a8)]);}catch(_0x13ccf0){if(isPlatformTransportFailure(_0x13ccf0))throw notificationError('notification_config_create_outcome_unknown',_0x3c0598(0x19e),_0x3c0598(0x196)+_0x6ffff+_0x3c0598(0x19b));throw safeApiFailure(_0x3c0598(0x1a6),_0x3c0598(0x1a7),_0x3c0598(0x196)+_0x6ffff+';\x20no\x20automatic\x20retry\x20was\x20attempted.');}if(!Number['isSafeInteger'](_0x5d6f8a)||_0x5d6f8a<=0x0)throw notificationError(_0x3c0598(0x183),_0x3c0598(0x187),_0x3c0598(0x196)+_0x6ffff+_0x3c0598(0x19b));let _0x401bf1;try{const _0x1f8116=await getNotificationChannelConfig(_0x5d6f8a,_0x3a0bff[_0x3c0598(0x185)]);_0x401bf1=normalizeExactNotificationConfig(_0x1f8116,_0x5d6f8a,_0x3a0bff[_0x3c0598(0x185)]);}catch{throw safeApiFailure('create',_0x3c0598(0x19c),_0x3c0598(0x196)+_0x6ffff+';\x20do\x20not\x20resubmit\x20automatically.');}return{'ok':!![],'data':{'operation':_0x3c0598(0x1a6),'selector':{'appCode':_0x401bf1[_0x3c0598(0x185)],'id':_0x401bf1['id'],'configCode':_0x401bf1[_0x3c0598(0x18d)],'configName':_0x401bf1[_0x3c0598(0x18e)],'channelType':_0x401bf1[_0x3c0598(0x1a4)]},'before':null,'after':projectNotificationConfig(_0x401bf1),'dryRun':![],'backend':{'method':'POST','path':CREATE_PATH},'warnings':[],'verification':{'status':_0x3c0598(0x18b),'lookupCommand':_0x6ffff}},'message':_0x3c0598(0x19a)+_0x401bf1['id']};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a136_0x5c3a35=a136_0x4eed;(function(_0x25acf8,_0x4a8f96){const _0x2bf000=a136_0x4eed,_0x1c1c36=_0x25acf8();while(!![]){try{const _0x4c72e7=parseInt(_0x2bf000(0x1f9))/0x1+parseInt(_0x2bf000(0x1f1))/0x2+-parseInt(_0x2bf000(0x1e5))/0x3+parseInt(_0x2bf000(0x1e7))/0x4*(-parseInt(_0x2bf000(0x1ed))/0x5)+parseInt(_0x2bf000(0x1fa))/0x6*(-parseInt(_0x2bf000(0x1fc))/0x7)+parseInt(_0x2bf000(0x200))/0x8+parseInt(_0x2bf000(0x1f3))/0x9;if(_0x4c72e7===_0x4a8f96)break;else _0x1c1c36['push'](_0x1c1c36['shift']());}catch(_0x3e00f0){_0x1c1c36['push'](_0x1c1c36['shift']());}}}(a136_0x4e50,0xbda7b));import{asDryRunResult}from'../../commands/common/dry-run.js';import{deleteNotificationChannelConfig,isPlatformTransportFailure,listNotificationChannelConfigs}from'../../core/api-client.js';import{notificationError,notificationLookupCommand,notificationSelector,NOTIFICATION_APP_FLAG,NOTIFICATION_ID_FLAG,projectNotificationConfig,readNotificationId,requireNotificationExplicitYes,requireExactNotificationConfig,safeApiFailure,validateNotificationDeleteReadback}from'../../commands/notification/shared.js';function a136_0x4e50(){const _0x14992b=['POST','3165561olqgUo','/notification/channel-config/delete','channelType',';\x20do\x20not\x20resubmit\x20automatically.','notification_config_delete_verification_failed','delete','610593xiPnIa','34980vwdjAd','notification','651KbXQra','Inspect\x20with\x20','notification_config_delete_verification_unavailable','Delete\x20response\x20was\x20unavailable;\x20list\x20readback\x20proved\x20ID\x20absence\x20without\x20resubmitting.','5054008dReNYk','Deleting\x20this\x20app-level\x20config\x20may\x20make\x20dataset-level\x20channels\x20that\x20reference\x20it\x20unavailable;\x20dataset\x20references\x20were\x20not\x20verified\x20by\x20the\x20CLI.','\x20delete\x20could\x20not\x20be\x20verified.','config-delete','3056367VlFTAg','Deleted\x20notification\x20config\x20','4uZUlhX','notification_config_delete_outcome_unknown','\x20remains\x20present\x20after\x20delete.','some','appCode','before','1188955JxTlZJ','planned','Notification\x20config\x20','Delete\x20an\x20app-level\x20notification\x20config\x20after\x20exact\x20preflight','1963048EThxnM'];a136_0x4e50=function(){return _0x14992b;};return a136_0x4e50();}const DELETE_PATH=a136_0x5c3a35(0x1f4),REFERENCE_WARNING=a136_0x5c3a35(0x201);async function prepareDelete(_0x240f4b){const _0x36ecca=a136_0x5c3a35,_0x5c36b9=readNotificationId(_0x240f4b),_0x14d30b=await requireExactNotificationConfig(_0x240f4b[_0x36ecca(0x1eb)],_0x5c36b9,_0x36ecca(0x1f8));return{'id':_0x5c36b9,'before':_0x14d30b};}function a136_0x4eed(_0x581f6a,_0x4f01c3){_0x581f6a=_0x581f6a-0x1e4;const _0x4e5050=a136_0x4e50();let _0x4eedb4=_0x4e5050[_0x581f6a];return _0x4eedb4;}export const notificationConfigDelete={'service':a136_0x5c3a35(0x1fb),'command':a136_0x5c3a35(0x1e4),'description':a136_0x5c3a35(0x1f0),'risk':'high-risk-write','requiresAppCode':!![],'structuredErrors':!![],'flags':[NOTIFICATION_ID_FLAG,NOTIFICATION_APP_FLAG],async 'validate'(_0x1563b7){readNotificationId(_0x1563b7),requireNotificationExplicitYes(_0x1563b7);},async 'dryRun'(_0x4b99fc){const _0x5341e6=a136_0x5c3a35,_0x232dd5=await prepareDelete(_0x4b99fc),_0x2dd51d=notificationLookupCommand(_0x4b99fc[_0x5341e6(0x1eb)],_0x232dd5['before'][_0x5341e6(0x1f5)]);return asDryRunResult({'operation':_0x5341e6(0x1f8),'selector':notificationSelector(_0x232dd5[_0x5341e6(0x1ec)]),'before':projectNotificationConfig(_0x232dd5['before']),'after':null,'dryRun':!![],'backend':{'method':_0x5341e6(0x1f2),'path':DELETE_PATH},'warnings':[REFERENCE_WARNING],'verification':{'status':_0x5341e6(0x1ee),'lookupCommand':_0x2dd51d}},{'method':_0x5341e6(0x1f2),'url':DELETE_PATH});},async 'execute'(_0x192512){const _0x21f6ab=a136_0x5c3a35;requireNotificationExplicitYes(_0x192512);const _0x417b3a=await prepareDelete(_0x192512),_0x3558e7=notificationLookupCommand(_0x192512[_0x21f6ab(0x1eb)],_0x417b3a[_0x21f6ab(0x1ec)][_0x21f6ab(0x1f5)]);let _0x568fc1=![];try{await deleteNotificationChannelConfig(_0x417b3a['id'],_0x192512[_0x21f6ab(0x1eb)]);}catch(_0x1a3a55){if(!isPlatformTransportFailure(_0x1a3a55))throw safeApiFailure(_0x21f6ab(0x1f8),'mutation','Inspect\x20with\x20'+_0x3558e7+';\x20no\x20automatic\x20retry\x20was\x20attempted.');_0x568fc1=!![];}let _0x793346;try{_0x793346=await listNotificationChannelConfigs(_0x192512[_0x21f6ab(0x1eb)],_0x417b3a[_0x21f6ab(0x1ec)]['channelType']),validateNotificationDeleteReadback(_0x793346,_0x192512['appCode'],_0x417b3a[_0x21f6ab(0x1ec)][_0x21f6ab(0x1f5)]);}catch{throw notificationError(_0x568fc1?_0x21f6ab(0x1e8):_0x21f6ab(0x1fe),'Notification\x20config\x20'+_0x417b3a['id']+_0x21f6ab(0x202),_0x21f6ab(0x1fd)+_0x3558e7+';\x20do\x20not\x20resubmit\x20automatically.');}if(_0x793346[_0x21f6ab(0x1ea)](_0x159397=>_0x159397['id']===_0x417b3a['id']))throw notificationError(_0x568fc1?'notification_config_delete_outcome_unknown':_0x21f6ab(0x1f7),_0x21f6ab(0x1ef)+_0x417b3a['id']+_0x21f6ab(0x1e9),_0x21f6ab(0x1fd)+_0x3558e7+_0x21f6ab(0x1f6));const _0x1db81b=[REFERENCE_WARNING];return _0x568fc1&&_0x1db81b['unshift'](_0x21f6ab(0x1ff)),{'ok':!![],'data':{'operation':'delete','selector':notificationSelector(_0x417b3a[_0x21f6ab(0x1ec)]),'before':projectNotificationConfig(_0x417b3a[_0x21f6ab(0x1ec)]),'after':null,'dryRun':![],'backend':{'method':_0x21f6ab(0x1f2),'path':DELETE_PATH},'warnings':_0x1db81b,'verification':{'status':'verified','absenceConfirmed':!![],'recoveredAfterUnknownResponse':_0x568fc1,'lookupCommand':_0x3558e7}},'message':_0x21f6ab(0x1e6)+_0x417b3a['id']};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a137_0x1283d0=a137_0x531d;function a137_0x531d(_0x356091,_0x15b1f0){_0x356091=_0x356091-0xc7;const _0x15a40b=a137_0x15a4();let _0x531d41=_0x15a40b[_0x356091];return _0x531d41;}(function(_0x2227a0,_0x1a62b2){const _0x23488d=a137_0x531d,_0x1798bf=_0x2227a0();while(!![]){try{const _0x51a277=parseInt(_0x23488d(0xda))/0x1+parseInt(_0x23488d(0xcd))/0x2+parseInt(_0x23488d(0xce))/0x3*(-parseInt(_0x23488d(0xcf))/0x4)+parseInt(_0x23488d(0xd2))/0x5+parseInt(_0x23488d(0xcb))/0x6*(parseInt(_0x23488d(0xd3))/0x7)+parseInt(_0x23488d(0xc7))/0x8+-parseInt(_0x23488d(0xd8))/0x9;if(_0x51a277===_0x1a62b2)break;else _0x1798bf['push'](_0x1798bf['shift']());}catch(_0x464396){_0x1798bf['push'](_0x1798bf['shift']());}}}(a137_0x15a4,0xc621a));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{listNotificationChannelConfigs}from'../../core/api-client.js';import{NOTIFICATION_CHANNEL_TYPES,projectNotificationListConfig,readNotificationChannelType}from'../../commands/notification/shared.js';export const notificationConfigList={'service':'notification','command':a137_0x1283d0(0xcc),'description':'List\x20app-level\x20notification\x20configs\x20and\x20their\x20configCode\x20values','risk':a137_0x1283d0(0xd1),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a137_0x1283d0(0xd9),'type':a137_0x1283d0(0xd0),'description':a137_0x1283d0(0xd4),'enum':NOTIFICATION_CHANNEL_TYPES,'default':a137_0x1283d0(0xc9)}],async 'validate'(_0x2a1fd9){readNotificationChannelType(_0x2a1fd9);},async 'execute'(_0x478a5a){const _0x871153=a137_0x1283d0,_0x294eca=readNotificationChannelType(_0x478a5a),_0x754712=await listNotificationChannelConfigs(_0x478a5a['appCode'],_0x294eca),_0x330762=_0x754712[_0x871153(0xd6)](projectNotificationListConfig);return{'ok':!![],'data':{'appCode':_0x478a5a[_0x871153(0xc8)],'channelType':_0x294eca,'count':_0x330762[_0x871153(0xd7)],'configs':_0x330762},'message':_0x871153(0xca)+_0x330762[_0x871153(0xd7)]+'\x20'+_0x294eca+_0x871153(0xd5)};}};function a137_0x15a4(){const _0xb68c4a=['1619288QRIEix','2122032cMiqow','appCode','EMAIL','Found\x20','6EEGQgd','config-list','2163150NTFySg','84UndKKM','182108RkioYF','string','read','1945855nnMdyp','8612709UwvoIb','Notification\x20channel\x20type','\x20notification\x20config(s)','map','length','22494357XyUPdP','type'];a137_0x15a4=function(){return _0xb68c4a;};return a137_0x15a4();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a138_0x3d97f3=a138_0x10f8;function a138_0x256f(){const _0x5584a5=['\x20readback\x20does\x20not\x20prove\x20the\x20requested\x20update.','notification_config_update_verification_failed','4heCKgQ','4275832MOSCGX','POST','before','planned','4001473TUkDla','patch','\x20via\x20','Update\x20response\x20was\x20unavailable;\x20exact-ID\x20readback\x20proved\x20changed\x20safe\x20fields\x20without\x20resubmitting.','Inspect\x20ID\x20',';\x20no\x20automatic\x20retry\x20was\x20attempted.','update','verified','payload','channelType','appCode','notification_config_update_outcome_unknown','Inspect\x20with\x20--id\x20','63390EUhWab','47pRAlNa','5618280cmrLad','8956685CNsXiR','Notification\x20config\x20','10VaDlGI','allMatch',';\x20do\x20not\x20resubmit\x20automatically.','/notification/channel-config/update','\x20with\x20','45186251pMViUP','config-update','notification','mutation','verifiedFields','\x20update\x20could\x20not\x20be\x20verified\x20by\x20exact\x20ID.','419868QFaofA','provesChange','18HkaMdo'];a138_0x256f=function(){return _0x5584a5;};return a138_0x256f();}function a138_0x10f8(_0x598a17,_0x20824a){_0x598a17=_0x598a17-0x194;const _0x256fc6=a138_0x256f();let _0x10f873=_0x256fc6[_0x598a17];return _0x10f873;}(function(_0x1fa927,_0x219668){const _0x4e9c75=a138_0x10f8,_0x5ed631=_0x1fa927();while(!![]){try{const _0x21be4f=parseInt(_0x4e9c75(0x1a6))/0x1*(-parseInt(_0x4e9c75(0x1a5))/0x2)+-parseInt(_0x4e9c75(0x1a7))/0x3+-parseInt(_0x4e9c75(0x1ba))/0x4*(-parseInt(_0x4e9c75(0x1a8))/0x5)+parseInt(_0x4e9c75(0x1b5))/0x6+-parseInt(_0x4e9c75(0x198))/0x7+parseInt(_0x4e9c75(0x194))/0x8*(-parseInt(_0x4e9c75(0x1b7))/0x9)+-parseInt(_0x4e9c75(0x1aa))/0xa*(-parseInt(_0x4e9c75(0x1af))/0xb);if(_0x21be4f===_0x219668)break;else _0x5ed631['push'](_0x5ed631['shift']());}catch(_0x4f6b59){_0x5ed631['push'](_0x5ed631['shift']());}}}(a138_0x256f,0xebdf6));import{asDryRunResult}from'../../commands/common/dry-run.js';import{getNotificationChannelConfig,isPlatformTransportFailure,updateNotificationChannelConfig}from'../../core/api-client.js';import{assertSingleNotificationSource,mergeUpdateInput,normalizeExactNotificationConfig,notificationError,notificationLookupCommand,notificationSelector,NOTIFICATION_APP_FLAG,NOTIFICATION_ID_FLAG,NOTIFICATION_INPUT_FLAGS,plannedUpdateProjection,projectNotificationConfig,readNotificationDocument,readNotificationId,requestedSafeFieldsMatch,requireNotificationExplicitYes,requireExactNotificationConfig,safeApiFailure}from'../../commands/notification/shared.js';const UPDATE_PATH=a138_0x3d97f3(0x1ad);async function prepareUpdate(_0x3da077){const _0xcd6c3f=a138_0x3d97f3,_0x370190=readNotificationId(_0x3da077),_0xd13e9=await readNotificationDocument(_0x3da077,_0xcd6c3f(0x19e)),_0x5c95e7=await requireExactNotificationConfig(_0x3da077[_0xcd6c3f(0x1a2)],_0x370190,'update');return{'id':_0x370190,'patch':_0xd13e9,'before':_0x5c95e7,'payload':mergeUpdateInput(_0x5c95e7,_0xd13e9),'planned':plannedUpdateProjection(_0x5c95e7,_0xd13e9)};}export const notificationConfigUpdate={'service':a138_0x3d97f3(0x1b1),'command':a138_0x3d97f3(0x1b0),'description':'Update\x20an\x20app-level\x20notification\x20config\x20from\x20a\x20secure\x20JSON\x20patch','risk':'high-risk-write','requiresAppCode':!![],'structuredErrors':!![],'flags':[NOTIFICATION_ID_FLAG,...NOTIFICATION_INPUT_FLAGS,NOTIFICATION_APP_FLAG],async 'validate'(_0x120237){readNotificationId(_0x120237),assertSingleNotificationSource(_0x120237),requireNotificationExplicitYes(_0x120237);},async 'dryRun'(_0x21ec6a){const _0x55bba9=a138_0x3d97f3,_0x18f505=await prepareUpdate(_0x21ec6a),_0x599fa6=notificationLookupCommand(_0x21ec6a[_0x55bba9(0x1a2)],_0x18f505[_0x55bba9(0x196)][_0x55bba9(0x1a1)]);return asDryRunResult({'operation':_0x55bba9(0x19e),'selector':notificationSelector(_0x18f505['before']),'before':projectNotificationConfig(_0x18f505[_0x55bba9(0x196)]),'after':_0x18f505[_0x55bba9(0x197)],'dryRun':!![],'backend':{'method':'POST','path':UPDATE_PATH},'warnings':[],'verification':{'status':_0x55bba9(0x197),'lookupCommand':_0x599fa6}},{'method':_0x55bba9(0x195),'url':UPDATE_PATH});},async 'execute'(_0x4174ff){const _0x256f8f=a138_0x3d97f3;requireNotificationExplicitYes(_0x4174ff);const _0x14673f=await prepareUpdate(_0x4174ff),_0x51ebbf=notificationLookupCommand(_0x4174ff[_0x256f8f(0x1a2)],_0x14673f[_0x256f8f(0x196)][_0x256f8f(0x1a1)]);let _0x164a16=![];try{await updateNotificationChannelConfig(_0x14673f[_0x256f8f(0x1a0)]);}catch(_0xe998d){if(!isPlatformTransportFailure(_0xe998d))throw safeApiFailure(_0x256f8f(0x19e),_0x256f8f(0x1b2),_0x256f8f(0x19c)+_0x14673f['id']+_0x256f8f(0x1ae)+_0x51ebbf+_0x256f8f(0x19d));_0x164a16=!![];}let _0x4d6127;try{const _0x1c5e7c=await getNotificationChannelConfig(_0x14673f['id'],_0x4174ff[_0x256f8f(0x1a2)]);_0x4d6127=normalizeExactNotificationConfig(_0x1c5e7c,_0x14673f['id'],_0x4174ff[_0x256f8f(0x1a2)]);}catch{throw notificationError(_0x164a16?_0x256f8f(0x1a3):'notification_config_update_verification_unavailable',_0x256f8f(0x1a9)+_0x14673f['id']+_0x256f8f(0x1b4),'Inspect\x20with\x20--id\x20'+_0x14673f['id']+_0x256f8f(0x19a)+_0x51ebbf+';\x20do\x20not\x20resubmit\x20automatically.');}const _0x792db3=requestedSafeFieldsMatch(_0x14673f[_0x256f8f(0x196)],_0x4d6127,_0x14673f[_0x256f8f(0x199)]);if(!_0x792db3[_0x256f8f(0x1ab)]||_0x164a16&&!_0x792db3[_0x256f8f(0x1b6)])throw notificationError(_0x164a16?'notification_config_update_outcome_unknown':_0x256f8f(0x1b9),_0x256f8f(0x1a9)+_0x14673f['id']+_0x256f8f(0x1b8),_0x256f8f(0x1a4)+_0x14673f['id']+_0x256f8f(0x19a)+_0x51ebbf+_0x256f8f(0x1ac));const _0x1e3d1a=_0x164a16?[_0x256f8f(0x19b)]:[];return{'ok':!![],'data':{'operation':_0x256f8f(0x19e),'selector':notificationSelector(_0x4d6127),'before':projectNotificationConfig(_0x14673f['before']),'after':projectNotificationConfig(_0x4d6127),'dryRun':![],'backend':{'method':_0x256f8f(0x195),'path':UPDATE_PATH},'warnings':_0x1e3d1a,'verification':{'status':_0x256f8f(0x19f),'recoveredAfterUnknownResponse':_0x164a16,'verifiedFields':_0x792db3[_0x256f8f(0x1b3)],'lookupCommand':_0x51ebbf}},'message':'Updated\x20notification\x20config\x20'+_0x4d6127['id']};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1208e5,_0x4ac0e1){const _0x274394=a139_0x19bb,_0x3543eb=_0x1208e5();while(!![]){try{const _0x269141=parseInt(_0x274394(0x182))/0x1*(-parseInt(_0x274394(0x185))/0x2)+parseInt(_0x274394(0x183))/0x3*(-parseInt(_0x274394(0x17d))/0x4)+parseInt(_0x274394(0x180))/0x5+parseInt(_0x274394(0x17e))/0x6+parseInt(_0x274394(0x181))/0x7+parseInt(_0x274394(0x17f))/0x8*(-parseInt(_0x274394(0x186))/0x9)+parseInt(_0x274394(0x184))/0xa;if(_0x269141===_0x4ac0e1)break;else _0x3543eb['push'](_0x3543eb['shift']());}catch(_0x1e3382){_0x3543eb['push'](_0x3543eb['shift']());}}}(a139_0xf566,0xe374b));function a139_0xf566(){const _0x25cb9a=['72952UdBWBb','1867255GYmiQx','5863550JRblAF','1vrNgPJ','1779KiXcvd','15505400nwoDyr','2897324eqpAPc','1179gvrhtD','932VwSVzo','5708628QOGjWm'];a139_0xf566=function(){return _0x25cb9a;};return a139_0xf566();}function a139_0x19bb(_0x4c6952,_0x4f9547){_0x4c6952=_0x4c6952-0x17d;const _0xf56618=a139_0xf566();let _0x19bb8d=_0xf56618[_0x4c6952];return _0x19bb8d;}import{notificationConfigList}from'../../commands/notification/config-list.js';import{notificationConfigCreate}from'../../commands/notification/config-create.js';import{notificationConfigUpdate}from'../../commands/notification/config-update.js';import{notificationConfigDelete}from'../../commands/notification/config-delete.js';export const notificationDefinitions=[notificationConfigList,notificationConfigCreate,notificationConfigUpdate,notificationConfigDelete];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a140_0x7d39b8=a140_0x7061;(function(_0x1b0a4b,_0x19cd83){const _0xfd52e8=a140_0x7061,_0x5723f0=_0x1b0a4b();while(!![]){try{const _0x368211=-parseInt(_0xfd52e8(0x132))/0x1*(parseInt(_0xfd52e8(0x12b))/0x2)+parseInt(_0xfd52e8(0x162))/0x3*(-parseInt(_0xfd52e8(0x16a))/0x4)+parseInt(_0xfd52e8(0x10e))/0x5+parseInt(_0xfd52e8(0x15f))/0x6*(-parseInt(_0xfd52e8(0x100))/0x7)+parseInt(_0xfd52e8(0x109))/0x8+parseInt(_0xfd52e8(0x126))/0x9*(-parseInt(_0xfd52e8(0x123))/0xa)+parseInt(_0xfd52e8(0x10d))/0xb;if(_0x368211===_0x19cd83)break;else _0x5723f0['push'](_0x5723f0['shift']());}catch(_0x24e6bb){_0x5723f0['push'](_0x5723f0['shift']());}}}(a140_0x11f3,0x9cf75));import{readFile}from'node:fs/promises';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{getNotificationChannelConfig}from'../../core/api-client.js';import{CliError,CliErrors}from'../../errors.js';export const NOTIFICATION_CHANNEL_TYPES=['EMAIL',a140_0x7d39b8(0x11c),a140_0x7d39b8(0xf8),a140_0x7d39b8(0x147),a140_0x7d39b8(0x14d)];export const DEFAULT_NOTIFICATION_CONNECT_TIMEOUT=0x1388;export const DEFAULT_NOTIFICATION_READ_TIMEOUT=0x2710;const ALLOWED_INPUT_FIELDS=new Set([a140_0x7d39b8(0x14a),a140_0x7d39b8(0xf0),a140_0x7d39b8(0x101),'channelConfig','description',a140_0x7d39b8(0x160),a140_0x7d39b8(0x104)]),FORBIDDEN_IDENTITY_FIELDS=new Set(['id',a140_0x7d39b8(0x11f),'configCode',a140_0x7d39b8(0x154)]),EMAIL_RECIPIENT_FIELDS=new Set([a140_0x7d39b8(0x15a),'recipients','ccList',a140_0x7d39b8(0x116),a140_0x7d39b8(0xfb),'subjectPrefix','fromName','to','cc']);export const NOTIFICATION_INPUT_FLAGS=[{'name':a140_0x7d39b8(0x153),'type':a140_0x7d39b8(0x111),'required':![],'description':a140_0x7d39b8(0x13c)},{'name':'stdin','type':a140_0x7d39b8(0xfa),'required':![],'default':![],'description':a140_0x7d39b8(0x145)},{'name':a140_0x7d39b8(0x11a),'type':'string','required':![],'description':'Read\x20the\x20notification\x20JSON\x20document\x20from\x20a\x20named\x20environment\x20variable'}];export const NOTIFICATION_ID_FLAG={'name':'id','type':a140_0x7d39b8(0x14f),'required':!![],'description':'Application-level\x20notification\x20config\x20ID'};export const NOTIFICATION_APP_FLAG=APPCODE_FLAG_OPTIONAL;function a140_0x7061(_0x4d4e20,_0x322ed2){_0x4d4e20=_0x4d4e20-0xec;const _0x11f381=a140_0x11f3();let _0x70613e=_0x11f381[_0x4d4e20];return _0x70613e;}export function notificationError(_0x4f49d3,_0x5a0659,_0x5c9cdd){return new CliError(_0x4f49d3,0x1,_0x5a0659,_0x5c9cdd);}export function readNotificationId(_0x356cd4){const _0x45e584=a140_0x7d39b8,_0xf2a486=_0x356cd4[_0x45e584(0x150)]('id');if(!Number[_0x45e584(0x12d)](_0xf2a486)||_0xf2a486<=0x0)throw notificationError(_0x45e584(0x13f),'--id\x20must\x20be\x20a\x20positive\x20safe\x20integer.');return _0xf2a486;}export function requireNotificationExplicitYes(_0x2c349f){const _0x4e6f2=a140_0x7d39b8;if(_0x2c349f[_0x4e6f2(0x158)](_0x4e6f2(0x144))||_0x2c349f['bool'](_0x4e6f2(0x10c)))return;throw notificationError(_0x4e6f2(0x12c),'This\x20notification\x20config\x20mutation\x20requires\x20explicit\x20--yes.',_0x4e6f2(0x129));}export function readNotificationChannelType(_0xf005a3,_0x2544bc=a140_0x7d39b8(0x14b),_0x2aed4b='EMAIL'){const _0xe324c7=a140_0x7d39b8,_0x10e53e=_0xf005a3['str'](_0x2544bc)[_0xe324c7(0x15e)]()||_0x2aed4b;if(!NOTIFICATION_CHANNEL_TYPES[_0xe324c7(0x12a)](_0x10e53e))throw CliErrors[_0xe324c7(0x137)](_0xe324c7(0xf1)+_0x2544bc+':\x20'+_0x10e53e,_0xe324c7(0x113)+NOTIFICATION_CHANNEL_TYPES[_0xe324c7(0x13e)](',\x20')+'.');return _0x10e53e;}export function assertSingleNotificationSource(_0x16783a){const _0x5e5d9a=a140_0x7d39b8,_0x10f03d=[],_0x8f7d26=_0x16783a[_0x5e5d9a(0x110)](_0x5e5d9a(0x153))[_0x5e5d9a(0x15e)]();if(_0x8f7d26)_0x10f03d[_0x5e5d9a(0x155)]({'kind':_0x5e5d9a(0x153),'path':_0x8f7d26});if(_0x16783a['bool'](_0x5e5d9a(0x13d)))_0x10f03d['push']({'kind':'stdin'});const _0x134158=_0x16783a['str'](_0x5e5d9a(0x11a))['trim']();if(_0x134158)_0x10f03d[_0x5e5d9a(0x155)]({'kind':_0x5e5d9a(0x10b),'name':_0x134158});if(_0x10f03d[_0x5e5d9a(0x114)]===0x0)throw CliErrors[_0x5e5d9a(0x137)](_0x5e5d9a(0x103),_0x5e5d9a(0x10a));if(_0x10f03d[_0x5e5d9a(0x114)]>0x1)throw CliErrors[_0x5e5d9a(0x137)](_0x5e5d9a(0x151),_0x5e5d9a(0x10a));return _0x10f03d[0x0];}export async function readNotificationDocument(_0xd740c9,_0x39e708){const _0x5ed6e7=a140_0x7d39b8,_0xb54917=assertSingleNotificationSource(_0xd740c9),_0x3fd270=_0xb54917[_0x5ed6e7(0x115)]===_0x5ed6e7(0x153)?_0x5ed6e7(0x107)+_0xb54917['path']:_0xb54917[_0x5ed6e7(0x115)]==='env'?_0x5ed6e7(0x127)+_0xb54917[_0x5ed6e7(0x117)]:'stdin';let _0x2e1564;try{if(_0xb54917[_0x5ed6e7(0x115)]==='file')_0x2e1564=await readFile(_0xb54917[_0x5ed6e7(0x168)],'utf8');else{if(_0xb54917[_0x5ed6e7(0x115)]===_0x5ed6e7(0x10b)){if(!(_0xb54917[_0x5ed6e7(0x117)]in process.env))throw notificationError(_0x5ed6e7(0x102),_0x5ed6e7(0x12e)+_0xb54917[_0x5ed6e7(0x117)]);_0x2e1564=process.env[_0xb54917.name]??'';}else _0x2e1564=await readStdin();}}catch(_0xea4a0e){if(_0xea4a0e instanceof CliError)throw _0xea4a0e;throw notificationError('notification_config_source_unavailable',_0x5ed6e7(0x15b)+_0x3fd270+'.');}let _0x4a9c78;try{_0x4a9c78=JSON[_0x5ed6e7(0x140)](_0x2e1564);}catch{throw notificationError(_0x5ed6e7(0x157),_0x5ed6e7(0x108)+_0x3fd270+_0x5ed6e7(0xfe),_0x5ed6e7(0x125));}if(!isJsonObject(_0x4a9c78))throw notificationError('notification_config_json_invalid',_0x5ed6e7(0x108)+_0x3fd270+_0x5ed6e7(0x11e));return validateNotificationDocument(_0x4a9c78,_0x39e708);}export function projectNotificationListConfig(_0x58fc08,_0x4fb93f){const _0x45c8cc=a140_0x7d39b8;return{'id':typeof _0x58fc08['id']===_0x45c8cc(0x14f)?_0x58fc08['id']:null,'configCode':requireResponseString(_0x58fc08[_0x45c8cc(0x161)],_0x45c8cc(0x161),_0x4fb93f),'configName':requireResponseString(_0x58fc08[_0x45c8cc(0x14a)],_0x45c8cc(0x14a),_0x4fb93f),'channelType':requireResponseString(_0x58fc08['channelType'],'channelType',_0x4fb93f),'description':normalizeNullableString(_0x58fc08[_0x45c8cc(0x16e)]),'createTime':normalizeNullableString(_0x58fc08['createTime']),'updateTime':normalizeNullableString(_0x58fc08[_0x45c8cc(0x15d)])};}export function normalizeExactNotificationConfig(_0x4e5dc5,_0x453715,_0x310762){const _0x17c626=a140_0x7d39b8;if(!Number[_0x17c626(0x12d)](_0x4e5dc5['id'])||_0x4e5dc5['id']!==_0x453715)throw notificationError('notification_config_response_invalid',_0x17c626(0xff)+_0x453715+'.');if(_0x4e5dc5[_0x17c626(0x11f)]!==_0x310762)throw notificationError(_0x17c626(0xf5),_0x17c626(0x136)+_0x453715+_0x17c626(0x164));const _0x22c8ad=requireExactString(_0x4e5dc5['configName'],'configName',_0x453715),_0x2a3ac3=requireExactString(_0x4e5dc5[_0x17c626(0x161)],'configCode',_0x453715),_0x41d584=requireExactString(_0x4e5dc5[_0x17c626(0xf0)],_0x17c626(0xf0),_0x453715);if(!NOTIFICATION_CHANNEL_TYPES['includes'](_0x41d584))throw notificationError('notification_config_response_invalid',_0x17c626(0x136)+_0x453715+_0x17c626(0x121));const _0x1ab1dd=responseNullableString(_0x4e5dc5[_0x17c626(0x101)],_0x17c626(0x101),_0x453715),_0x14a811=responseNullableString(_0x4e5dc5[_0x17c626(0x134)],_0x17c626(0x134),_0x453715),_0x1401f4=responseNullableString(_0x4e5dc5[_0x17c626(0x16e)],_0x17c626(0x16e),_0x453715),_0x22623a=responseNullableTimeout(_0x4e5dc5[_0x17c626(0x160)],_0x17c626(0x160),_0x453715),_0x2df6aa=responseNullableTimeout(_0x4e5dc5[_0x17c626(0x104)],_0x17c626(0x104),_0x453715);return{'id':_0x453715,'appCode':_0x310762,'configCode':_0x2a3ac3,'configName':_0x22c8ad,'channelType':_0x41d584,'endpointUrl':redactSensitive(_0x1ab1dd),'channelConfig':redactSensitive(_0x14a811),'description':_0x1401f4,'connectTimeout':_0x22623a,'readTimeout':_0x2df6aa,'endpointUrlRaw':_0x1ab1dd,'channelConfigRaw':_0x14a811};}export async function requireExactNotificationConfig(_0xb6abb0,_0x30254c,_0x456886){const _0x3b7bc1=a140_0x7d39b8;let _0x1a8bfe;try{_0x1a8bfe=await getNotificationChannelConfig(_0x30254c,_0xb6abb0);}catch{throw safeApiFailure(_0x456886,_0x3b7bc1(0x169),_0x3b7bc1(0x14c)+_0xb6abb0+_0x3b7bc1(0x105));}return normalizeExactNotificationConfig(_0x1a8bfe,_0x30254c,_0xb6abb0);}export function projectNotificationConfig(_0x56b06d){const _0xdd7c78=a140_0x7d39b8;return{'id':_0x56b06d['id']??null,'appCode':_0x56b06d[_0xdd7c78(0x11f)],'configCode':_0x56b06d[_0xdd7c78(0x161)]??null,'configName':_0x56b06d[_0xdd7c78(0x14a)],'channelType':_0x56b06d['channelType'],'endpointUrl':redactSensitive(_0x56b06d[_0xdd7c78(0x101)]),'channelConfig':redactSensitive(_0x56b06d[_0xdd7c78(0x134)]),'description':_0x56b06d[_0xdd7c78(0x16e)]??null,'connectTimeout':_0x56b06d[_0xdd7c78(0x160)]??null,'readTimeout':_0x56b06d['readTimeout']??null};}export function notificationSelector(_0x55d391){const _0xd1cb6c=a140_0x7d39b8;return{'appCode':_0x55d391[_0xd1cb6c(0x11f)],'id':_0x55d391['id'],'configCode':_0x55d391['configCode'],'configName':_0x55d391[_0xd1cb6c(0x14a)],'channelType':_0x55d391['channelType']};}export function createMutationInput(_0xe20136,_0x766f26){const _0x4d6064=a140_0x7d39b8;return{'appCode':_0xe20136,'configName':_0x766f26[_0x4d6064(0x14a)],'channelType':_0x766f26[_0x4d6064(0xf0)],...hasOwn(_0x766f26,_0x4d6064(0x101))?{'endpointUrl':_0x766f26[_0x4d6064(0x101)]}:{},...hasOwn(_0x766f26,_0x4d6064(0x134))?{'channelConfig':serializeChannelConfig(_0x766f26[_0x4d6064(0x134)])}:{},...hasOwn(_0x766f26,'description')?{'description':_0x766f26['description']}:{},...hasOwn(_0x766f26,'connectTimeout')?{'connectTimeout':_0x766f26[_0x4d6064(0x160)]}:{},...hasOwn(_0x766f26,_0x4d6064(0x104))?{'readTimeout':_0x766f26[_0x4d6064(0x104)]}:{}};}export function mergeUpdateInput(_0x42b6ec,_0x445ca7){const _0x3ffd3c=a140_0x7d39b8;return{'id':_0x42b6ec['id'],'appCode':_0x42b6ec[_0x3ffd3c(0x11f)],'configName':_0x445ca7['configName']??_0x42b6ec[_0x3ffd3c(0x14a)],'channelType':_0x445ca7[_0x3ffd3c(0xf0)]??_0x42b6ec[_0x3ffd3c(0xf0)],'endpointUrl':hasOwn(_0x445ca7,_0x3ffd3c(0x101))?_0x445ca7['endpointUrl']:_0x42b6ec['endpointUrlRaw'],'channelConfig':hasOwn(_0x445ca7,_0x3ffd3c(0x134))?serializeChannelConfig(_0x445ca7['channelConfig']):_0x42b6ec[_0x3ffd3c(0x130)],'description':hasOwn(_0x445ca7,_0x3ffd3c(0x16e))?_0x445ca7[_0x3ffd3c(0x16e)]:_0x42b6ec[_0x3ffd3c(0x16e)],'connectTimeout':hasOwn(_0x445ca7,'connectTimeout')?_0x445ca7[_0x3ffd3c(0x160)]:_0x42b6ec[_0x3ffd3c(0x160)],'readTimeout':hasOwn(_0x445ca7,_0x3ffd3c(0x104))?_0x445ca7[_0x3ffd3c(0x104)]:_0x42b6ec[_0x3ffd3c(0x104)]};}export function plannedUpdateProjection(_0x247b8a,_0x127d21){const _0x26fdf3=a140_0x7d39b8;return projectNotificationConfig({'id':_0x247b8a['id'],'appCode':_0x247b8a[_0x26fdf3(0x11f)],'configCode':_0x247b8a[_0x26fdf3(0x161)],'configName':_0x127d21[_0x26fdf3(0x14a)]??_0x247b8a[_0x26fdf3(0x14a)],'channelType':_0x127d21[_0x26fdf3(0xf0)]??_0x247b8a['channelType'],'endpointUrl':hasOwn(_0x127d21,_0x26fdf3(0x101))?_0x127d21['endpointUrl']:_0x247b8a[_0x26fdf3(0x133)],'channelConfig':hasOwn(_0x127d21,_0x26fdf3(0x134))?_0x127d21[_0x26fdf3(0x134)]:_0x247b8a[_0x26fdf3(0x130)],'description':hasOwn(_0x127d21,_0x26fdf3(0x16e))?_0x127d21[_0x26fdf3(0x16e)]:_0x247b8a[_0x26fdf3(0x16e)],'connectTimeout':hasOwn(_0x127d21,'connectTimeout')?_0x127d21[_0x26fdf3(0x160)]??DEFAULT_NOTIFICATION_CONNECT_TIMEOUT:_0x247b8a[_0x26fdf3(0x160)],'readTimeout':hasOwn(_0x127d21,_0x26fdf3(0x104))?_0x127d21[_0x26fdf3(0x104)]??DEFAULT_NOTIFICATION_READ_TIMEOUT:_0x247b8a[_0x26fdf3(0x104)]});}export function requestedSafeFieldsMatch(_0x49f978,_0x4921be,_0x2763fd){const _0x2b3b12=a140_0x7d39b8,_0x534e7f=[],_0x12e831=[],_0x2adf14=[];for(const _0x214518 of[_0x2b3b12(0x14a),_0x2b3b12(0xf0),'description']){if(!hasOwn(_0x2763fd,_0x214518))continue;_0x2adf14[_0x2b3b12(0x155)](_0x214518),_0x534e7f[_0x2b3b12(0x155)](_0x4921be[_0x214518]===_0x2763fd[_0x214518]),_0x12e831[_0x2b3b12(0x155)](_0x49f978[_0x214518]!==_0x2763fd[_0x214518]&&_0x4921be[_0x214518]===_0x2763fd[_0x214518]);}for(const _0x3d2a23 of['connectTimeout',_0x2b3b12(0x104)]){if(!hasOwn(_0x2763fd,_0x3d2a23))continue;const _0xb00a1=_0x2763fd[_0x3d2a23]??(_0x3d2a23===_0x2b3b12(0x160)?DEFAULT_NOTIFICATION_CONNECT_TIMEOUT:DEFAULT_NOTIFICATION_READ_TIMEOUT);_0x2adf14[_0x2b3b12(0x155)](_0x3d2a23),_0x534e7f['push'](_0x4921be[_0x3d2a23]===_0xb00a1),_0x12e831['push'](_0x49f978[_0x3d2a23]!==_0xb00a1&&_0x4921be[_0x3d2a23]===_0xb00a1);}return hasOwn(_0x2763fd,'endpointUrl')&&_0x2763fd[_0x2b3b12(0x101)]===null&&(_0x2adf14[_0x2b3b12(0x155)](_0x2b3b12(0xf2)),_0x534e7f[_0x2b3b12(0x155)](_0x4921be[_0x2b3b12(0x133)]===null||_0x4921be[_0x2b3b12(0x133)]===''),_0x12e831[_0x2b3b12(0x155)](_0x49f978[_0x2b3b12(0x133)]!==null&&_0x49f978[_0x2b3b12(0x133)]!==''&&(_0x4921be[_0x2b3b12(0x133)]===null||_0x4921be['endpointUrlRaw']===''))),{'allMatch':_0x534e7f[_0x2b3b12(0x167)](Boolean),'provesChange':_0x12e831['some'](Boolean),'verifiedFields':_0x2adf14};}export function validateNotificationDeleteReadback(_0xa73ffa,_0x1efd34,_0x4c177d){const _0x235ad6=a140_0x7d39b8;for(const [_0x517cca,_0x599c24]of _0xa73ffa[_0x235ad6(0xee)]()){if(!Number[_0x235ad6(0x12d)](_0x599c24['id'])||_0x599c24['id']<=0x0)throw notificationError(_0x235ad6(0xf5),_0x235ad6(0x120)+(_0x517cca+0x1)+_0x235ad6(0x159));if(_0x599c24[_0x235ad6(0x11f)]!==_0x1efd34)throw notificationError(_0x235ad6(0xf5),_0x235ad6(0x120)+(_0x517cca+0x1)+_0x235ad6(0xf7));if(_0x599c24['channelType']!==_0x4c177d)throw notificationError(_0x235ad6(0xf5),_0x235ad6(0x120)+(_0x517cca+0x1)+_0x235ad6(0x166));}}export function safeApiFailure(_0x594851,_0x35bcea,_0xef551a){const _0x44e5d0=a140_0x7d39b8;return notificationError(_0x44e5d0(0x149)+_0x594851+'_'+(_0x35bcea==='mutation'?_0x44e5d0(0xf6):_0x35bcea+'_unavailable'),_0x44e5d0(0x136)+_0x594851+'\x20'+_0x35bcea+_0x44e5d0(0x16d),_0xef551a);}export function notificationLookupCommand(_0x198e9c,_0x143704){const _0x2eee14=a140_0x7d39b8;return'rabetbase\x20notification\x20config-list\x20--appcode\x20'+_0x198e9c+_0x2eee14(0x12f)+_0x143704+'\x20--format\x20compress';}function validateNotificationDocument(_0x14fb7c,_0x144a90){const _0x2832de=a140_0x7d39b8;for(const _0x1fe066 of Object[_0x2832de(0x14e)](_0x14fb7c)){if(FORBIDDEN_IDENTITY_FIELDS['has'](_0x1fe066))throw notificationError(_0x2832de(0x118),_0x2832de(0xfd)+_0x1fe066+'\x22\x20is\x20controlled\x20by\x20the\x20CLI\x20or\x20server\x20and\x20is\x20forbidden.');if(!ALLOWED_INPUT_FIELDS[_0x2832de(0x11b)](_0x1fe066))throw notificationError(_0x2832de(0x10f),_0x2832de(0x128)+_0x1fe066+'\x22.');}if(_0x144a90===_0x2832de(0x139)&&Object['keys'](_0x14fb7c)[_0x2832de(0x114)]===0x0)throw notificationError(_0x2832de(0x141),_0x2832de(0x13a));const _0x4d5849={};if(hasOwn(_0x14fb7c,_0x2832de(0x14a)))_0x4d5849[_0x2832de(0x14a)]=validateRequiredString(_0x14fb7c[_0x2832de(0x14a)],_0x2832de(0x14a),0x80);else{if(_0x144a90===_0x2832de(0x16c))throw notificationError(_0x2832de(0x131),_0x2832de(0x165)+_0x2832de(0x146));}if(hasOwn(_0x14fb7c,_0x2832de(0xf0))){if(typeof _0x14fb7c[_0x2832de(0xf0)]!==_0x2832de(0x111))throw invalidFieldType('channelType','a\x20supported\x20string');const _0xcb2b55=_0x14fb7c[_0x2832de(0xf0)]['trim']();if(!NOTIFICATION_CHANNEL_TYPES[_0x2832de(0x12a)](_0xcb2b55))throw notificationError(_0x2832de(0xed),_0x2832de(0x152),_0x2832de(0x113)+NOTIFICATION_CHANNEL_TYPES[_0x2832de(0x13e)](',\x20')+'.');_0x4d5849[_0x2832de(0xf0)]=_0xcb2b55;}else{if(_0x144a90===_0x2832de(0x16c))throw notificationError(_0x2832de(0x131),_0x2832de(0x165)+_0x2832de(0xf9));}for(const [_0x565a4f,_0x4a3570]of[['endpointUrl',0x200],[_0x2832de(0x16e),0x100]]){if(!hasOwn(_0x14fb7c,_0x565a4f))continue;const _0x2d05e7=_0x14fb7c[_0x565a4f];if(_0x2d05e7!==null&&typeof _0x2d05e7!==_0x2832de(0x111))throw invalidFieldType(_0x565a4f,'a\x20string\x20or\x20null');if(typeof _0x2d05e7===_0x2832de(0x111)&&_0x2d05e7[_0x2832de(0x114)]>_0x4a3570)throw notificationError(_0x2832de(0xed),_0x2832de(0xfd)+_0x565a4f+_0x2832de(0xf3)+_0x4a3570+'\x20characters.');_0x4d5849[_0x565a4f]=_0x2d05e7;}if(hasOwn(_0x14fb7c,_0x2832de(0x134))){const _0x6eb6f8=_0x14fb7c[_0x2832de(0x134)];if(_0x6eb6f8===null&&_0x144a90===_0x2832de(0x16c))throw invalidFieldType(_0x2832de(0x134),_0x2832de(0x124));if(_0x6eb6f8!==null&&!isJsonObject(_0x6eb6f8))throw invalidFieldType(_0x2832de(0x134),_0x144a90===_0x2832de(0x139)?'a\x20JSON\x20object\x20or\x20null':_0x2832de(0x124));_0x6eb6f8!==null&&validateChannelConfigFields(_0x4d5849['channelType'],_0x6eb6f8),_0x4d5849['channelConfig']=_0x6eb6f8;}for(const _0x3e545d of[_0x2832de(0x160),'readTimeout']){if(!hasOwn(_0x14fb7c,_0x3e545d))continue;const _0x3e0b6c=_0x14fb7c[_0x3e545d];if(_0x3e0b6c!==null&&(!Number[_0x2832de(0x12d)](_0x3e0b6c)||_0x3e0b6c<0x0))throw notificationError('notification_config_field_invalid',_0x2832de(0xfd)+_0x3e545d+_0x2832de(0x135));_0x4d5849[_0x3e545d]=_0x3e0b6c;}return _0x4d5849;}function validateRequiredString(_0x9d8ab,_0x5aac37,_0x654f69){const _0x672d24=a140_0x7d39b8;if(typeof _0x9d8ab!=='string')throw invalidFieldType(_0x5aac37,'a\x20non-empty\x20string');const _0x47c735=_0x9d8ab[_0x672d24(0x15e)]();if(!_0x47c735)throw notificationError('notification_config_field_invalid',_0x672d24(0xfd)+_0x5aac37+'\x22\x20must\x20be\x20a\x20non-empty\x20string.');if(_0x47c735['length']>_0x654f69)throw notificationError(_0x672d24(0xed),_0x672d24(0xfd)+_0x5aac37+_0x672d24(0xf3)+_0x654f69+_0x672d24(0xef));return _0x47c735;}function validateChannelConfigFields(_0x513732,_0x35e0ca){const _0x5afc11=a140_0x7d39b8;if(hasOwn(_0x35e0ca,_0x5afc11(0x148)))throw forbiddenChannelConfigField(_0x5afc11(0x148));if(_0x513732===_0x5afc11(0xec))for(const _0x2fc57e of EMAIL_RECIPIENT_FIELDS){if(hasOwn(_0x35e0ca,_0x2fc57e))throw forbiddenChannelConfigField(_0x2fc57e);}}function forbiddenChannelConfigField(_0xa03df2){const _0x154bd6=a140_0x7d39b8;return notificationError(_0x154bd6(0x112),'Notification\x20JSON\x20channelConfig\x20field\x20\x22'+_0xa03df2+_0x154bd6(0xf4));}function invalidFieldType(_0x1bd764,_0x45f8f4){const _0x1e31ea=a140_0x7d39b8;return notificationError('notification_config_field_invalid',_0x1e31ea(0xfd)+_0x1bd764+_0x1e31ea(0x11d)+_0x45f8f4+'.');}function serializeChannelConfig(_0x4191c0){const _0xa55be=a140_0x7d39b8;return _0x4191c0===null||_0x4191c0===undefined?null:JSON[_0xa55be(0x142)](_0x4191c0);}function redactSensitive(_0x2c1743){const _0x37fb79=a140_0x7d39b8;return _0x2c1743===null||_0x2c1743===undefined||_0x2c1743===''?null:_0x37fb79(0x156);}function requireResponseString(_0x119150,_0x311f5a,_0x55488d){const _0x8b47bc=a140_0x7d39b8;if(typeof _0x119150!==_0x8b47bc(0x111)||_0x119150['trim']()==='')throw CliErrors['apiError'](_0x8b47bc(0x138),_0x8b47bc(0x143)+(_0x55488d+0x1)+_0x8b47bc(0x106)+_0x311f5a+'\x22.');return _0x119150[_0x8b47bc(0x15e)]();}function requireExactString(_0x143de0,_0x1d60c9,_0x38aa48){const _0x44fd38=a140_0x7d39b8;if(typeof _0x143de0!==_0x44fd38(0x111)||_0x143de0[_0x44fd38(0x15e)]()==='')throw notificationError(_0x44fd38(0xf5),_0x44fd38(0x136)+_0x38aa48+_0x44fd38(0x106)+_0x1d60c9+'\x22.');return _0x143de0[_0x44fd38(0x15e)]();}function a140_0x11f3(){const _0x23b90b=['parse','notification_config_update_empty','stringify','Item\x20','dry-run','Read\x20the\x20notification\x20JSON\x20document\x20from\x20stdin','\x22configName\x22.','WECOM','messageTemplate','notification_config_','configName','type','Inspect\x20with\x20rabetbase\x20notification\x20config-list\x20--appcode\x20','WEBHOOK','keys','number','num','Notification\x20JSON\x20source\x20is\x20ambiguous.','Notification\x20JSON\x20field\x20\x22channelType\x22\x20is\x20unsupported.','file','channelCode','push','<redacted>','notification_config_json_invalid','bool','\x20has\x20an\x20invalid\x20id.','emailTargets','Unable\x20to\x20read\x20notification\x20JSON\x20from\x20','hasOwnProperty','updateTime','trim','12exAkFE','connectTimeout','configCode','2391Jokcbw','setEncoding','\x20does\x20not\x20belong\x20to\x20the\x20resolved\x20app.','Create\x20JSON\x20requires\x20field\x20','\x20has\x20an\x20invalid\x20channelType.','every','path','preflight','2284lSafFs','\x20has\x20invalid\x20field\x20\x22','create','\x20failed.','description','EMAIL','notification_config_field_invalid','entries','\x20characters.','channelType','Invalid\x20--','endpointUrl:null','\x22\x20cannot\x20exceed\x20','\x22\x20is\x20forbidden.','notification_config_response_invalid','failed','\x20has\x20an\x20invalid\x20appCode.','DINGTALK','\x22channelType\x22.','boolean','replyTo','call','Notification\x20JSON\x20field\x20\x22','\x20is\x20invalid.','Notification\x20config\x20detail\x20did\x20not\x20contain\x20the\x20requested\x20ID\x20','1252538YZBlMQ','endpointUrl','notification_config_source_unavailable','Missing\x20notification\x20JSON\x20source.','readTimeout','\x20--type\x20<CHANNEL_TYPE>\x20--format\x20compress;\x20no\x20mutation\x20was\x20submitted.','\x20is\x20missing\x20required\x20field\x20\x22','file\x20','Notification\x20JSON\x20from\x20','7850320WWvZmo','Use\x20exactly\x20one\x20of\x20--file\x20<path>,\x20--stdin,\x20or\x20--from-env\x20<NAME>.','env','yes','7053244RHHZHb','5666050gaSXTX','notification_config_field_unknown','str','string','notification_config_channel_field_forbidden','Allowed\x20values:\x20','length','kind','bccList','name','notification_config_field_forbidden','utf8','from-env','has','FEISHU','\x22\x20must\x20be\x20','\x20must\x20be\x20an\x20object.','appCode','Notification\x20config\x20list\x20item\x20','\x20has\x20an\x20unsupported\x20channelType.','prototype','10vGwXiR','a\x20JSON\x20object','Provide\x20one\x20valid\x20JSON\x20object;\x20source\x20contents\x20are\x20not\x20included\x20in\x20errors.','7607988ggpWVU','environment\x20variable\x20','Unknown\x20notification\x20JSON\x20field\x20\x22','Run\x20the\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.','includes','4oEmNaG','notification_config_confirmation_required','isSafeInteger','Notification\x20JSON\x20environment\x20variable\x20is\x20not\x20set:\x20','\x20--type\x20','channelConfigRaw','notification_config_field_required','227242lRiNRi','endpointUrlRaw','channelConfig','\x22\x20must\x20be\x20a\x20non-negative\x20safe\x20integer\x20or\x20null.','Notification\x20config\x20','validation','Invalid\x20notification\x20config\x20response.','update','Update\x20JSON\x20must\x20contain\x20at\x20least\x20one\x20allowed\x20field.','isArray','Read\x20the\x20notification\x20JSON\x20document\x20from\x20a\x20UTF-8\x20file','stdin','join','notification_config_id_invalid'];a140_0x11f3=function(){return _0x23b90b;};return a140_0x11f3();}function responseNullableString(_0x40706f,_0x56d40d,_0x4536f0){const _0x2ed895=a140_0x7d39b8;if(_0x40706f===undefined||_0x40706f===null)return null;if(typeof _0x40706f!==_0x2ed895(0x111))throw notificationError('notification_config_response_invalid',_0x2ed895(0x136)+_0x4536f0+_0x2ed895(0x16b)+_0x56d40d+'\x22.');return _0x40706f;}function responseNullableTimeout(_0x4cac65,_0x24bcc6,_0x437f09){const _0x217ba3=a140_0x7d39b8;if(_0x4cac65===undefined||_0x4cac65===null)return null;if(!Number[_0x217ba3(0x12d)](_0x4cac65)||_0x4cac65<0x0)throw notificationError(_0x217ba3(0xf5),'Notification\x20config\x20'+_0x437f09+_0x217ba3(0x16b)+_0x24bcc6+'\x22.');return _0x4cac65;}function normalizeNullableString(_0x119d50){const _0x27cfae=a140_0x7d39b8;return typeof _0x119d50===_0x27cfae(0x111)?_0x119d50:null;}function isJsonObject(_0x3eaac5){const _0x110809=a140_0x7d39b8;return _0x3eaac5!==null&&typeof _0x3eaac5==='object'&&!Array[_0x110809(0x13b)](_0x3eaac5);}function hasOwn(_0x1ee35f,_0x42d2ed){const _0x5aed1c=a140_0x7d39b8;return Object[_0x5aed1c(0x122)][_0x5aed1c(0x15c)][_0x5aed1c(0xfc)](_0x1ee35f,_0x42d2ed);}async function readStdin(){const _0x5112fe=a140_0x7d39b8;let _0x2c2adb='';process[_0x5112fe(0x13d)][_0x5112fe(0x163)](_0x5112fe(0x119));for await(const _0x503838 of process[_0x5112fe(0x13d)])_0x2c2adb+=_0x503838;return _0x2c2adb;}
|
|
1
|
+
const a140_0x97c5c4=a140_0x1d43;(function(_0x3f678e,_0x312b56){const _0x116e50=a140_0x1d43,_0x2e2d7e=_0x3f678e();while(!![]){try{const _0xb94645=parseInt(_0x116e50(0x17b))/0x1*(parseInt(_0x116e50(0x1b8))/0x2)+parseInt(_0x116e50(0x1aa))/0x3+-parseInt(_0x116e50(0x1b0))/0x4*(parseInt(_0x116e50(0x18c))/0x5)+parseInt(_0x116e50(0x17d))/0x6+parseInt(_0x116e50(0x1e4))/0x7*(-parseInt(_0x116e50(0x1af))/0x8)+parseInt(_0x116e50(0x1f2))/0x9+-parseInt(_0x116e50(0x1a8))/0xa;if(_0xb94645===_0x312b56)break;else _0x2e2d7e['push'](_0x2e2d7e['shift']());}catch(_0x5d94ad){_0x2e2d7e['push'](_0x2e2d7e['shift']());}}}(a140_0x1da8,0x7bba2));import{readFile}from'node:fs/promises';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{getNotificationChannelConfig}from'../../core/api-client.js';import{CliError,CliErrors}from'../../errors.js';function a140_0x1da8(){const _0x1c6eca=['Item\x20','num','isSafeInteger','1193330vEQTjb','\x22\x20cannot\x20exceed\x20','55068iWDJoQ','Read\x20the\x20notification\x20JSON\x20document\x20from\x20stdin','Notification\x20JSON\x20from\x20','kind','emailTargets','8kGGYtc','9600AsHtoB','notification_config_confirmation_required','stdin','FEISHU','Create\x20JSON\x20requires\x20field\x20','a\x20supported\x20string','createTime','This\x20notification\x20config\x20mutation\x20requires\x20explicit\x20--yes.','2KUnQOe','join','\x20is\x20invalid.','\x20has\x20an\x20invalid\x20appCode.','<redacted>','notification_config_field_forbidden','from-env','\x20has\x20an\x20unsupported\x20channelType.','apiError','\x20has\x20an\x20invalid\x20channelType.','path','\x20characters.','Run\x20the\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.','update','appCode','messageTemplate','a\x20JSON\x20object\x20or\x20null','Notification\x20config\x20list\x20item\x20','notification_config_field_invalid','\x22\x20must\x20be\x20a\x20non-empty\x20string.','rabetbase\x20notification\x20config-list\x20--appcode\x20','Notification\x20JSON\x20source\x20is\x20ambiguous.','notification_config_response_invalid','number','Notification\x20JSON\x20field\x20\x22','endpointUrlRaw','Application-level\x20notification\x20config\x20ID','utf8','env','channelConfig','connectTimeout','configCode','length','stringify','\x22\x20is\x20forbidden.','includes','fromName','subjectPrefix','entries','WECOM','\x22configName\x22.','Allowed\x20values:\x20','notification_config_json_invalid','\x22\x20must\x20be\x20','4627343QAIuEP','_unavailable','Read\x20the\x20notification\x20JSON\x20document\x20from\x20a\x20UTF-8\x20file','\x22\x20is\x20controlled\x20by\x20the\x20CLI\x20or\x20server\x20and\x20is\x20forbidden.','name','Inspect\x20with\x20rabetbase\x20notification\x20config-list\x20--appcode\x20','channelConfigRaw','channelType','\x20--format\x20compress','Invalid\x20notification\x20config\x20response.','Update\x20JSON\x20must\x20contain\x20at\x20least\x20one\x20allowed\x20field.','every','a\x20string\x20or\x20null','mutation','4926375aBnIGd','\x20--type\x20','ccList','\x20--type\x20<CHANNEL_TYPE>\x20--format\x20compress;\x20no\x20mutation\x20was\x20submitted.','\x20is\x20missing\x20required\x20field\x20\x22','setEncoding','bccList','string','validation','notification_config_id_invalid','object','--id\x20must\x20be\x20a\x20positive\x20safe\x20integer.','has','135829oxCbIb','DINGTALK','5745648PwniAu','keys','trim','type','hasOwnProperty','Invalid\x20--','notification_config_channel_field_forbidden','Unable\x20to\x20read\x20notification\x20JSON\x20from\x20','endpointUrl','updateTime','notification_config_','push','a\x20non-empty\x20string','configName','\x20has\x20an\x20invalid\x20id.','775WbDgxk','EMAIL','Notification\x20JSON\x20field\x20\x22channelType\x22\x20is\x20unsupported.','Notification\x20config\x20detail\x20did\x20not\x20contain\x20the\x20requested\x20ID\x20','bool','\x20has\x20invalid\x20field\x20\x22','failed','replyTo','create','readTimeout','notification_config_field_required','a\x20JSON\x20object','recipients','notification_config_source_unavailable','notification_config_field_unknown','environment\x20variable\x20','preflight','Use\x20exactly\x20one\x20of\x20--file\x20<path>,\x20--stdin,\x20or\x20--from-env\x20<NAME>.','file','Unknown\x20notification\x20JSON\x20field\x20\x22','description','some','\x20does\x20not\x20belong\x20to\x20the\x20resolved\x20app.','str','Notification\x20config\x20'];a140_0x1da8=function(){return _0x1c6eca;};return a140_0x1da8();}export const NOTIFICATION_CHANNEL_TYPES=[a140_0x97c5c4(0x18d),a140_0x97c5c4(0x1b3),a140_0x97c5c4(0x17c),a140_0x97c5c4(0x1df),'WEBHOOK'];export const DEFAULT_NOTIFICATION_CONNECT_TIMEOUT=0x1388;export const DEFAULT_NOTIFICATION_READ_TIMEOUT=0x2710;const ALLOWED_INPUT_FIELDS=new Set([a140_0x97c5c4(0x18a),a140_0x97c5c4(0x1eb),a140_0x97c5c4(0x185),'channelConfig',a140_0x97c5c4(0x1a0),a140_0x97c5c4(0x1d6),a140_0x97c5c4(0x195)]),FORBIDDEN_IDENTITY_FIELDS=new Set(['id',a140_0x97c5c4(0x1c6),a140_0x97c5c4(0x1d7),'channelCode']),EMAIL_RECIPIENT_FIELDS=new Set([a140_0x97c5c4(0x1ae),a140_0x97c5c4(0x198),a140_0x97c5c4(0x170),a140_0x97c5c4(0x174),a140_0x97c5c4(0x193),a140_0x97c5c4(0x1dd),a140_0x97c5c4(0x1dc),'to','cc']);export const NOTIFICATION_INPUT_FLAGS=[{'name':a140_0x97c5c4(0x19e),'type':a140_0x97c5c4(0x175),'required':![],'description':a140_0x97c5c4(0x1e6)},{'name':'stdin','type':'boolean','required':![],'default':![],'description':a140_0x97c5c4(0x1ab)},{'name':'from-env','type':a140_0x97c5c4(0x175),'required':![],'description':'Read\x20the\x20notification\x20JSON\x20document\x20from\x20a\x20named\x20environment\x20variable'}];export const NOTIFICATION_ID_FLAG={'name':'id','type':a140_0x97c5c4(0x1cf),'required':!![],'description':a140_0x97c5c4(0x1d2)};export const NOTIFICATION_APP_FLAG=APPCODE_FLAG_OPTIONAL;export function notificationError(_0x45b488,_0x345f8a,_0x41454a){return new CliError(_0x45b488,0x1,_0x345f8a,_0x41454a);}export function readNotificationId(_0x46addf){const _0x3220cf=a140_0x97c5c4,_0x3d801a=_0x46addf[_0x3220cf(0x1a6)]('id');if(!Number[_0x3220cf(0x1a7)](_0x3d801a)||_0x3d801a<=0x0)throw notificationError(_0x3220cf(0x177),_0x3220cf(0x179));return _0x3d801a;}export function requireNotificationExplicitYes(_0x26fc24){const _0x7864e7=a140_0x97c5c4;if(_0x26fc24[_0x7864e7(0x190)]('dry-run')||_0x26fc24['bool']('yes'))return;throw notificationError(_0x7864e7(0x1b1),_0x7864e7(0x1b7),_0x7864e7(0x1c4));}export function readNotificationChannelType(_0x5109d1,_0xebfd5f=a140_0x97c5c4(0x180),_0x3a5127=a140_0x97c5c4(0x18d)){const _0xee53ea=a140_0x97c5c4,_0x56b9a9=_0x5109d1[_0xee53ea(0x1a3)](_0xebfd5f)[_0xee53ea(0x17f)]()||_0x3a5127;if(!NOTIFICATION_CHANNEL_TYPES[_0xee53ea(0x1db)](_0x56b9a9))throw CliErrors[_0xee53ea(0x176)](_0xee53ea(0x182)+_0xebfd5f+':\x20'+_0x56b9a9,_0xee53ea(0x1e1)+NOTIFICATION_CHANNEL_TYPES[_0xee53ea(0x1b9)](',\x20')+'.');return _0x56b9a9;}export function assertSingleNotificationSource(_0xdfc05b){const _0x5d274b=a140_0x97c5c4,_0x4bf1e7=[],_0x3c6dd0=_0xdfc05b['str'](_0x5d274b(0x19e))[_0x5d274b(0x17f)]();if(_0x3c6dd0)_0x4bf1e7[_0x5d274b(0x188)]({'kind':_0x5d274b(0x19e),'path':_0x3c6dd0});if(_0xdfc05b[_0x5d274b(0x190)](_0x5d274b(0x1b2)))_0x4bf1e7[_0x5d274b(0x188)]({'kind':_0x5d274b(0x1b2)});const _0x4bc70e=_0xdfc05b[_0x5d274b(0x1a3)](_0x5d274b(0x1be))[_0x5d274b(0x17f)]();if(_0x4bc70e)_0x4bf1e7[_0x5d274b(0x188)]({'kind':'env','name':_0x4bc70e});if(_0x4bf1e7[_0x5d274b(0x1d8)]===0x0)throw CliErrors['validation']('Missing\x20notification\x20JSON\x20source.',_0x5d274b(0x19d));if(_0x4bf1e7['length']>0x1)throw CliErrors[_0x5d274b(0x176)](_0x5d274b(0x1cd),_0x5d274b(0x19d));return _0x4bf1e7[0x0];}export async function readNotificationDocument(_0x148c1e,_0x3f304a){const _0x3b138c=a140_0x97c5c4,_0x2733b3=assertSingleNotificationSource(_0x148c1e),_0x386aa1=_0x2733b3['kind']==='file'?'file\x20'+_0x2733b3['path']:_0x2733b3[_0x3b138c(0x1ad)]===_0x3b138c(0x1d4)?_0x3b138c(0x19b)+_0x2733b3['name']:_0x3b138c(0x1b2);let _0x5a9c58;try{if(_0x2733b3['kind']==='file')_0x5a9c58=await readFile(_0x2733b3[_0x3b138c(0x1c2)],_0x3b138c(0x1d3));else{if(_0x2733b3['kind']===_0x3b138c(0x1d4)){if(!(_0x2733b3[_0x3b138c(0x1e8)]in process.env))throw notificationError(_0x3b138c(0x199),'Notification\x20JSON\x20environment\x20variable\x20is\x20not\x20set:\x20'+_0x2733b3['name']);_0x5a9c58=process.env[_0x2733b3.name]??'';}else _0x5a9c58=await readStdin();}}catch(_0x373a10){if(_0x373a10 instanceof CliError)throw _0x373a10;throw notificationError('notification_config_source_unavailable',_0x3b138c(0x184)+_0x386aa1+'.');}let _0x8b6c8e;try{_0x8b6c8e=JSON['parse'](_0x5a9c58);}catch{throw notificationError(_0x3b138c(0x1e2),_0x3b138c(0x1ac)+_0x386aa1+_0x3b138c(0x1ba),'Provide\x20one\x20valid\x20JSON\x20object;\x20source\x20contents\x20are\x20not\x20included\x20in\x20errors.');}if(!isJsonObject(_0x8b6c8e))throw notificationError('notification_config_json_invalid','Notification\x20JSON\x20from\x20'+_0x386aa1+'\x20must\x20be\x20an\x20object.');return validateNotificationDocument(_0x8b6c8e,_0x3f304a);}export function projectNotificationListConfig(_0x24a95d,_0x50adcc){const _0x1d6360=a140_0x97c5c4;return{'id':typeof _0x24a95d['id']===_0x1d6360(0x1cf)?_0x24a95d['id']:null,'configCode':requireResponseString(_0x24a95d[_0x1d6360(0x1d7)],_0x1d6360(0x1d7),_0x50adcc),'configName':requireResponseString(_0x24a95d[_0x1d6360(0x18a)],_0x1d6360(0x18a),_0x50adcc),'channelType':requireResponseString(_0x24a95d[_0x1d6360(0x1eb)],'channelType',_0x50adcc),'description':normalizeNullableString(_0x24a95d['description']),'createTime':normalizeNullableString(_0x24a95d[_0x1d6360(0x1b6)]),'updateTime':normalizeNullableString(_0x24a95d[_0x1d6360(0x186)])};}export function normalizeExactNotificationConfig(_0x5f2d1c,_0x4cab6d,_0x1aa73d){const _0x423550=a140_0x97c5c4;if(!Number[_0x423550(0x1a7)](_0x5f2d1c['id'])||_0x5f2d1c['id']!==_0x4cab6d)throw notificationError(_0x423550(0x1ce),_0x423550(0x18f)+_0x4cab6d+'.');if(_0x5f2d1c[_0x423550(0x1c6)]!==_0x1aa73d)throw notificationError('notification_config_response_invalid',_0x423550(0x1a4)+_0x4cab6d+_0x423550(0x1a2));const _0x3d0b86=requireExactString(_0x5f2d1c[_0x423550(0x18a)],'configName',_0x4cab6d),_0x48dced=requireExactString(_0x5f2d1c[_0x423550(0x1d7)],_0x423550(0x1d7),_0x4cab6d),_0x202dd6=requireExactString(_0x5f2d1c[_0x423550(0x1eb)],_0x423550(0x1eb),_0x4cab6d);if(!NOTIFICATION_CHANNEL_TYPES[_0x423550(0x1db)](_0x202dd6))throw notificationError(_0x423550(0x1ce),_0x423550(0x1a4)+_0x4cab6d+_0x423550(0x1bf));const _0x165f05=responseNullableString(_0x5f2d1c['endpointUrl'],_0x423550(0x185),_0x4cab6d),_0x4e72b3=responseNullableString(_0x5f2d1c[_0x423550(0x1d5)],_0x423550(0x1d5),_0x4cab6d),_0x3977e0=responseNullableString(_0x5f2d1c['description'],_0x423550(0x1a0),_0x4cab6d),_0x6bbbd6=responseNullableTimeout(_0x5f2d1c['connectTimeout'],_0x423550(0x1d6),_0x4cab6d),_0x17ed0d=responseNullableTimeout(_0x5f2d1c[_0x423550(0x195)],'readTimeout',_0x4cab6d);return{'id':_0x4cab6d,'appCode':_0x1aa73d,'configCode':_0x48dced,'configName':_0x3d0b86,'channelType':_0x202dd6,'endpointUrl':redactSensitive(_0x165f05),'channelConfig':redactSensitive(_0x4e72b3),'description':_0x3977e0,'connectTimeout':_0x6bbbd6,'readTimeout':_0x17ed0d,'endpointUrlRaw':_0x165f05,'channelConfigRaw':_0x4e72b3};}export async function requireExactNotificationConfig(_0x618cfc,_0x532b10,_0x582e99){const _0x558717=a140_0x97c5c4;let _0x1cbb2b;try{_0x1cbb2b=await getNotificationChannelConfig(_0x532b10,_0x618cfc);}catch{throw safeApiFailure(_0x582e99,_0x558717(0x19c),_0x558717(0x1e9)+_0x618cfc+_0x558717(0x171));}return normalizeExactNotificationConfig(_0x1cbb2b,_0x532b10,_0x618cfc);}export function projectNotificationConfig(_0x2a4f13){const _0x309753=a140_0x97c5c4;return{'id':_0x2a4f13['id']??null,'appCode':_0x2a4f13['appCode'],'configCode':_0x2a4f13['configCode']??null,'configName':_0x2a4f13['configName'],'channelType':_0x2a4f13[_0x309753(0x1eb)],'endpointUrl':redactSensitive(_0x2a4f13['endpointUrl']),'channelConfig':redactSensitive(_0x2a4f13[_0x309753(0x1d5)]),'description':_0x2a4f13[_0x309753(0x1a0)]??null,'connectTimeout':_0x2a4f13[_0x309753(0x1d6)]??null,'readTimeout':_0x2a4f13[_0x309753(0x195)]??null};}export function notificationSelector(_0x535ead){const _0x4f7eae=a140_0x97c5c4;return{'appCode':_0x535ead[_0x4f7eae(0x1c6)],'id':_0x535ead['id'],'configCode':_0x535ead[_0x4f7eae(0x1d7)],'configName':_0x535ead['configName'],'channelType':_0x535ead[_0x4f7eae(0x1eb)]};}export function createMutationInput(_0x11e6b3,_0xf8852d){const _0x47e085=a140_0x97c5c4;return{'appCode':_0x11e6b3,'configName':_0xf8852d[_0x47e085(0x18a)],'channelType':_0xf8852d[_0x47e085(0x1eb)],...hasOwn(_0xf8852d,_0x47e085(0x185))?{'endpointUrl':_0xf8852d[_0x47e085(0x185)]}:{},...hasOwn(_0xf8852d,_0x47e085(0x1d5))?{'channelConfig':serializeChannelConfig(_0xf8852d[_0x47e085(0x1d5)])}:{},...hasOwn(_0xf8852d,'description')?{'description':_0xf8852d[_0x47e085(0x1a0)]}:{},...hasOwn(_0xf8852d,_0x47e085(0x1d6))?{'connectTimeout':_0xf8852d['connectTimeout']}:{},...hasOwn(_0xf8852d,_0x47e085(0x195))?{'readTimeout':_0xf8852d[_0x47e085(0x195)]}:{}};}export function mergeUpdateInput(_0x67c6fc,_0x3d7bcf){const _0x4118aa=a140_0x97c5c4;return{'id':_0x67c6fc['id'],'appCode':_0x67c6fc[_0x4118aa(0x1c6)],'configName':_0x3d7bcf[_0x4118aa(0x18a)]??_0x67c6fc[_0x4118aa(0x18a)],'channelType':_0x3d7bcf[_0x4118aa(0x1eb)]??_0x67c6fc[_0x4118aa(0x1eb)],'endpointUrl':hasOwn(_0x3d7bcf,_0x4118aa(0x185))?_0x3d7bcf[_0x4118aa(0x185)]:_0x67c6fc[_0x4118aa(0x1d1)],'channelConfig':hasOwn(_0x3d7bcf,'channelConfig')?serializeChannelConfig(_0x3d7bcf[_0x4118aa(0x1d5)]):_0x67c6fc[_0x4118aa(0x1ea)],'description':hasOwn(_0x3d7bcf,_0x4118aa(0x1a0))?_0x3d7bcf['description']:_0x67c6fc[_0x4118aa(0x1a0)],'connectTimeout':hasOwn(_0x3d7bcf,'connectTimeout')?_0x3d7bcf[_0x4118aa(0x1d6)]:_0x67c6fc['connectTimeout'],'readTimeout':hasOwn(_0x3d7bcf,_0x4118aa(0x195))?_0x3d7bcf[_0x4118aa(0x195)]:_0x67c6fc[_0x4118aa(0x195)]};}export function plannedUpdateProjection(_0x32a46d,_0x221b78){const _0x4b3d20=a140_0x97c5c4;return projectNotificationConfig({'id':_0x32a46d['id'],'appCode':_0x32a46d[_0x4b3d20(0x1c6)],'configCode':_0x32a46d[_0x4b3d20(0x1d7)],'configName':_0x221b78[_0x4b3d20(0x18a)]??_0x32a46d[_0x4b3d20(0x18a)],'channelType':_0x221b78[_0x4b3d20(0x1eb)]??_0x32a46d[_0x4b3d20(0x1eb)],'endpointUrl':hasOwn(_0x221b78,_0x4b3d20(0x185))?_0x221b78['endpointUrl']:_0x32a46d[_0x4b3d20(0x1d1)],'channelConfig':hasOwn(_0x221b78,_0x4b3d20(0x1d5))?_0x221b78[_0x4b3d20(0x1d5)]:_0x32a46d[_0x4b3d20(0x1ea)],'description':hasOwn(_0x221b78,_0x4b3d20(0x1a0))?_0x221b78['description']:_0x32a46d[_0x4b3d20(0x1a0)],'connectTimeout':hasOwn(_0x221b78,'connectTimeout')?_0x221b78[_0x4b3d20(0x1d6)]??DEFAULT_NOTIFICATION_CONNECT_TIMEOUT:_0x32a46d[_0x4b3d20(0x1d6)],'readTimeout':hasOwn(_0x221b78,_0x4b3d20(0x195))?_0x221b78[_0x4b3d20(0x195)]??DEFAULT_NOTIFICATION_READ_TIMEOUT:_0x32a46d[_0x4b3d20(0x195)]});}export function requestedSafeFieldsMatch(_0x3da3e7,_0x3cdc04,_0x230207){const _0x3b33ff=a140_0x97c5c4,_0x391313=[],_0x197f70=[],_0xb577cf=[];for(const _0x1809a5 of['configName',_0x3b33ff(0x1eb),_0x3b33ff(0x1a0)]){if(!hasOwn(_0x230207,_0x1809a5))continue;_0xb577cf[_0x3b33ff(0x188)](_0x1809a5),_0x391313[_0x3b33ff(0x188)](_0x3cdc04[_0x1809a5]===_0x230207[_0x1809a5]),_0x197f70['push'](_0x3da3e7[_0x1809a5]!==_0x230207[_0x1809a5]&&_0x3cdc04[_0x1809a5]===_0x230207[_0x1809a5]);}for(const _0x1236f2 of[_0x3b33ff(0x1d6),_0x3b33ff(0x195)]){if(!hasOwn(_0x230207,_0x1236f2))continue;const _0x1d0fc1=_0x230207[_0x1236f2]??(_0x1236f2==='connectTimeout'?DEFAULT_NOTIFICATION_CONNECT_TIMEOUT:DEFAULT_NOTIFICATION_READ_TIMEOUT);_0xb577cf[_0x3b33ff(0x188)](_0x1236f2),_0x391313['push'](_0x3cdc04[_0x1236f2]===_0x1d0fc1),_0x197f70[_0x3b33ff(0x188)](_0x3da3e7[_0x1236f2]!==_0x1d0fc1&&_0x3cdc04[_0x1236f2]===_0x1d0fc1);}return hasOwn(_0x230207,_0x3b33ff(0x185))&&_0x230207[_0x3b33ff(0x185)]===null&&(_0xb577cf['push']('endpointUrl:null'),_0x391313[_0x3b33ff(0x188)](_0x3cdc04[_0x3b33ff(0x1d1)]===null||_0x3cdc04[_0x3b33ff(0x1d1)]===''),_0x197f70[_0x3b33ff(0x188)](_0x3da3e7['endpointUrlRaw']!==null&&_0x3da3e7[_0x3b33ff(0x1d1)]!==''&&(_0x3cdc04[_0x3b33ff(0x1d1)]===null||_0x3cdc04[_0x3b33ff(0x1d1)]===''))),{'allMatch':_0x391313[_0x3b33ff(0x1ef)](Boolean),'provesChange':_0x197f70[_0x3b33ff(0x1a1)](Boolean),'verifiedFields':_0xb577cf};}export function validateNotificationDeleteReadback(_0x4129ee,_0x25e7bd,_0x42f27f){const _0x1e35de=a140_0x97c5c4;for(const [_0xfabced,_0xc8c543]of _0x4129ee[_0x1e35de(0x1de)]()){if(!Number[_0x1e35de(0x1a7)](_0xc8c543['id'])||_0xc8c543['id']<=0x0)throw notificationError(_0x1e35de(0x1ce),_0x1e35de(0x1c9)+(_0xfabced+0x1)+_0x1e35de(0x18b));if(_0xc8c543[_0x1e35de(0x1c6)]!==_0x25e7bd)throw notificationError(_0x1e35de(0x1ce),_0x1e35de(0x1c9)+(_0xfabced+0x1)+_0x1e35de(0x1bb));if(_0xc8c543['channelType']!==_0x42f27f)throw notificationError('notification_config_response_invalid',_0x1e35de(0x1c9)+(_0xfabced+0x1)+_0x1e35de(0x1c1));}}export function safeApiFailure(_0x28cc11,_0x51b3d7,_0x17dc7f){const _0x447f52=a140_0x97c5c4;return notificationError(_0x447f52(0x187)+_0x28cc11+'_'+(_0x51b3d7===_0x447f52(0x1f1)?_0x447f52(0x192):_0x51b3d7+_0x447f52(0x1e5)),_0x447f52(0x1a4)+_0x28cc11+'\x20'+_0x51b3d7+'\x20failed.',_0x17dc7f);}export function notificationLookupCommand(_0x3e5f62,_0x16088d){const _0x145141=a140_0x97c5c4;return _0x145141(0x1cc)+_0x3e5f62+_0x145141(0x16f)+_0x16088d+_0x145141(0x1ec);}function validateNotificationDocument(_0x1d62d1,_0x43f214){const _0x406ccd=a140_0x97c5c4;for(const _0x1daf25 of Object[_0x406ccd(0x17e)](_0x1d62d1)){if(FORBIDDEN_IDENTITY_FIELDS[_0x406ccd(0x17a)](_0x1daf25))throw notificationError(_0x406ccd(0x1bd),'Notification\x20JSON\x20field\x20\x22'+_0x1daf25+_0x406ccd(0x1e7));if(!ALLOWED_INPUT_FIELDS['has'](_0x1daf25))throw notificationError(_0x406ccd(0x19a),_0x406ccd(0x19f)+_0x1daf25+'\x22.');}if(_0x43f214===_0x406ccd(0x1c5)&&Object[_0x406ccd(0x17e)](_0x1d62d1)[_0x406ccd(0x1d8)]===0x0)throw notificationError('notification_config_update_empty',_0x406ccd(0x1ee));const _0x2e8e75={};if(hasOwn(_0x1d62d1,_0x406ccd(0x18a)))_0x2e8e75[_0x406ccd(0x18a)]=validateRequiredString(_0x1d62d1['configName'],_0x406ccd(0x18a),0x80);else{if(_0x43f214===_0x406ccd(0x194))throw notificationError(_0x406ccd(0x196),_0x406ccd(0x1b4)+_0x406ccd(0x1e0));}if(hasOwn(_0x1d62d1,_0x406ccd(0x1eb))){if(typeof _0x1d62d1['channelType']!==_0x406ccd(0x175))throw invalidFieldType('channelType',_0x406ccd(0x1b5));const _0x5c4dba=_0x1d62d1[_0x406ccd(0x1eb)]['trim']();if(!NOTIFICATION_CHANNEL_TYPES[_0x406ccd(0x1db)](_0x5c4dba))throw notificationError(_0x406ccd(0x1ca),_0x406ccd(0x18e),_0x406ccd(0x1e1)+NOTIFICATION_CHANNEL_TYPES['join'](',\x20')+'.');_0x2e8e75['channelType']=_0x5c4dba;}else{if(_0x43f214===_0x406ccd(0x194))throw notificationError(_0x406ccd(0x196),'Create\x20JSON\x20requires\x20field\x20'+'\x22channelType\x22.');}for(const [_0x2a0299,_0x1d4239]of[[_0x406ccd(0x185),0x200],[_0x406ccd(0x1a0),0x100]]){if(!hasOwn(_0x1d62d1,_0x2a0299))continue;const _0x2f56f1=_0x1d62d1[_0x2a0299];if(_0x2f56f1!==null&&typeof _0x2f56f1!==_0x406ccd(0x175))throw invalidFieldType(_0x2a0299,_0x406ccd(0x1f0));if(typeof _0x2f56f1===_0x406ccd(0x175)&&_0x2f56f1[_0x406ccd(0x1d8)]>_0x1d4239)throw notificationError(_0x406ccd(0x1ca),_0x406ccd(0x1d0)+_0x2a0299+_0x406ccd(0x1a9)+_0x1d4239+_0x406ccd(0x1c3));_0x2e8e75[_0x2a0299]=_0x2f56f1;}if(hasOwn(_0x1d62d1,_0x406ccd(0x1d5))){const _0x1e93c5=_0x1d62d1[_0x406ccd(0x1d5)];if(_0x1e93c5===null&&_0x43f214===_0x406ccd(0x194))throw invalidFieldType('channelConfig',_0x406ccd(0x197));if(_0x1e93c5!==null&&!isJsonObject(_0x1e93c5))throw invalidFieldType(_0x406ccd(0x1d5),_0x43f214===_0x406ccd(0x1c5)?_0x406ccd(0x1c8):_0x406ccd(0x197));_0x1e93c5!==null&&validateChannelConfigFields(_0x2e8e75['channelType'],_0x1e93c5),_0x2e8e75['channelConfig']=_0x1e93c5;}for(const _0x3be00b of['connectTimeout',_0x406ccd(0x195)]){if(!hasOwn(_0x1d62d1,_0x3be00b))continue;const _0x54e020=_0x1d62d1[_0x3be00b];if(_0x54e020!==null&&(!Number[_0x406ccd(0x1a7)](_0x54e020)||_0x54e020<0x0))throw notificationError('notification_config_field_invalid',_0x406ccd(0x1d0)+_0x3be00b+'\x22\x20must\x20be\x20a\x20non-negative\x20safe\x20integer\x20or\x20null.');_0x2e8e75[_0x3be00b]=_0x54e020;}return _0x2e8e75;}function validateRequiredString(_0x303e61,_0x3de79f,_0x278e37){const _0x2bef9a=a140_0x97c5c4;if(typeof _0x303e61!==_0x2bef9a(0x175))throw invalidFieldType(_0x3de79f,_0x2bef9a(0x189));const _0x49c2a3=_0x303e61[_0x2bef9a(0x17f)]();if(!_0x49c2a3)throw notificationError(_0x2bef9a(0x1ca),_0x2bef9a(0x1d0)+_0x3de79f+_0x2bef9a(0x1cb));if(_0x49c2a3[_0x2bef9a(0x1d8)]>_0x278e37)throw notificationError(_0x2bef9a(0x1ca),'Notification\x20JSON\x20field\x20\x22'+_0x3de79f+'\x22\x20cannot\x20exceed\x20'+_0x278e37+'\x20characters.');return _0x49c2a3;}function validateChannelConfigFields(_0x2e7521,_0x2e277f){const _0x3de844=a140_0x97c5c4;if(hasOwn(_0x2e277f,'messageTemplate'))throw forbiddenChannelConfigField(_0x3de844(0x1c7));if(_0x2e7521===_0x3de844(0x18d))for(const _0x2b3f4c of EMAIL_RECIPIENT_FIELDS){if(hasOwn(_0x2e277f,_0x2b3f4c))throw forbiddenChannelConfigField(_0x2b3f4c);}}function forbiddenChannelConfigField(_0x48a26f){const _0x4a20dc=a140_0x97c5c4;return notificationError(_0x4a20dc(0x183),'Notification\x20JSON\x20channelConfig\x20field\x20\x22'+_0x48a26f+_0x4a20dc(0x1da));}function invalidFieldType(_0x2ee9b9,_0x2468cb){const _0x4f92cd=a140_0x97c5c4;return notificationError(_0x4f92cd(0x1ca),_0x4f92cd(0x1d0)+_0x2ee9b9+_0x4f92cd(0x1e3)+_0x2468cb+'.');}function serializeChannelConfig(_0x1b08c8){const _0x2672c3=a140_0x97c5c4;return _0x1b08c8===null||_0x1b08c8===undefined?null:JSON[_0x2672c3(0x1d9)](_0x1b08c8);}function redactSensitive(_0x3b746e){const _0x304b31=a140_0x97c5c4;return _0x3b746e===null||_0x3b746e===undefined||_0x3b746e===''?null:_0x304b31(0x1bc);}function requireResponseString(_0x474391,_0x468a9d,_0x50e21f){const _0x11e498=a140_0x97c5c4;if(typeof _0x474391!==_0x11e498(0x175)||_0x474391[_0x11e498(0x17f)]()==='')throw CliErrors[_0x11e498(0x1c0)](_0x11e498(0x1ed),_0x11e498(0x1a5)+(_0x50e21f+0x1)+_0x11e498(0x172)+_0x468a9d+'\x22.');return _0x474391[_0x11e498(0x17f)]();}function requireExactString(_0x30c3b5,_0x481c6c,_0x2cdac2){const _0x43cac8=a140_0x97c5c4;if(typeof _0x30c3b5!=='string'||_0x30c3b5[_0x43cac8(0x17f)]()==='')throw notificationError(_0x43cac8(0x1ce),_0x43cac8(0x1a4)+_0x2cdac2+_0x43cac8(0x172)+_0x481c6c+'\x22.');return _0x30c3b5[_0x43cac8(0x17f)]();}function responseNullableString(_0x238471,_0x49130e,_0x1736eb){const _0x35b4fa=a140_0x97c5c4;if(_0x238471===undefined||_0x238471===null)return null;if(typeof _0x238471!==_0x35b4fa(0x175))throw notificationError('notification_config_response_invalid',_0x35b4fa(0x1a4)+_0x1736eb+_0x35b4fa(0x191)+_0x49130e+'\x22.');return _0x238471;}function a140_0x1d43(_0x425794,_0x5b4f19){_0x425794=_0x425794-0x16f;const _0x1da8d1=a140_0x1da8();let _0x1d439f=_0x1da8d1[_0x425794];return _0x1d439f;}function responseNullableTimeout(_0x3f65c0,_0x52a718,_0x5d3b04){const _0x2a1855=a140_0x97c5c4;if(_0x3f65c0===undefined||_0x3f65c0===null)return null;if(!Number[_0x2a1855(0x1a7)](_0x3f65c0)||_0x3f65c0<0x0)throw notificationError(_0x2a1855(0x1ce),_0x2a1855(0x1a4)+_0x5d3b04+'\x20has\x20invalid\x20field\x20\x22'+_0x52a718+'\x22.');return _0x3f65c0;}function normalizeNullableString(_0xe7f2cb){return typeof _0xe7f2cb==='string'?_0xe7f2cb:null;}function isJsonObject(_0x2f3f9b){const _0x1f90af=a140_0x97c5c4;return _0x2f3f9b!==null&&typeof _0x2f3f9b===_0x1f90af(0x178)&&!Array['isArray'](_0x2f3f9b);}function hasOwn(_0xfdcf91,_0x4e7ec8){const _0x206f6e=a140_0x97c5c4;return Object['prototype'][_0x206f6e(0x181)]['call'](_0xfdcf91,_0x4e7ec8);}async function readStdin(){const _0x160d3f=a140_0x97c5c4;let _0x2a590c='';process[_0x160d3f(0x1b2)][_0x160d3f(0x173)](_0x160d3f(0x1d3));for await(const _0x44a84a of process[_0x160d3f(0x1b2)])_0x2a590c+=_0x44a84a;return _0x2a590c;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a141_0x340794=a141_0x124c;(function(_0x5c83b9,_0x36d25e){const _0x4d2096=a141_0x124c,_0x3205ca=_0x5c83b9();while(!![]){try{const _0x14ee86=-parseInt(_0x4d2096(0x111))/0x1+-parseInt(_0x4d2096(0x125))/0x2*(-parseInt(_0x4d2096(0x12d))/0x3)+-parseInt(_0x4d2096(0x12a))/0x4*(parseInt(_0x4d2096(0x13c))/0x5)+-parseInt(_0x4d2096(0x136))/0x6+-parseInt(_0x4d2096(0x12e))/0x7+parseInt(_0x4d2096(0x12f))/0x8*(-parseInt(_0x4d2096(0x13e))/0x9)+parseInt(_0x4d2096(0x122))/0xa*(parseInt(_0x4d2096(0x139))/0xb);if(_0x14ee86===_0x36d25e)break;else _0x3205ca['push'](_0x3205ca['shift']());}catch(_0x15f5f7){_0x3205ca['push'](_0x3205ca['shift']());}}}(a141_0x1e3d,0xf0bce));import{requireDevelopmentUploadFile}from'../../commands/common/local-file.js';import{queryDevelopmentFileUrl,recognizeDevelopmentOcr,uploadDevelopmentFile}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a141_0x124c(_0x1759db,_0x2d1d6b){_0x1759db=_0x1759db-0x108;const _0x1e3d98=a141_0x1e3d();let _0x124ca3=_0x1e3d98[_0x1759db];return _0x124ca3;}const SUPPORTED_SCENES=[a141_0x340794(0x12b),a141_0x340794(0x117),a141_0x340794(0x126),a141_0x340794(0x120)],SCENE_TO_LEGACY_TYPE={'invoice':a141_0x340794(0x109),'general':a141_0x340794(0x12c),'form':'Table','idCard':a141_0x340794(0x10f)},SCENE_FLAG={'name':'scene','type':a141_0x340794(0x133),'required':!![],'enum':[...SUPPORTED_SCENES],'description':a141_0x340794(0x13a)},IMAGE_FILE_FLAG={'name':a141_0x340794(0x13d),'type':a141_0x340794(0x133),'description':'Local\x20image\x20or\x20PDF\x20file;\x20uses\x20upload\x20->\x20query-url\x20->\x20OCR'},IMAGE_URL_FLAG={'name':'image-url','type':'string','description':a141_0x340794(0x121)};function normalizeScene(_0x4f0865){const _0x196607=a141_0x340794,_0x3d18de=_0x4f0865[_0x196607(0x115)]()['toLowerCase']();if(_0x3d18de==='idcard')return _0x196607(0x120);if(_0x3d18de===_0x196607(0x12b)||_0x3d18de==='general'||_0x3d18de===_0x196607(0x126))return _0x3d18de;throw CliErrors['validation'](_0x196607(0x114)+_0x4f0865+_0x196607(0x13b)+SUPPORTED_SCENES['join'](',\x20'));}function selectedInputs(_0x4bc36e){const _0x2424d3=a141_0x340794,_0xafc4df=_0x4bc36e[_0x2424d3(0x10e)]('image-file')[_0x2424d3(0x115)](),_0x283572=_0x4bc36e[_0x2424d3(0x10e)]('image-url')[_0x2424d3(0x115)]();return{'imageFile':_0xafc4df,'imageUrl':_0x283572,'count':[_0xafc4df,_0x283572][_0x2424d3(0x10d)](Boolean)[_0x2424d3(0x127)]};}function validateInputSelection(_0x5e5599){const _0x370669=a141_0x340794,_0x29bb2c=selectedInputs(_0x5e5599);if(_0x29bb2c[_0x370669(0x124)]!==0x1)throw CliErrors[_0x370669(0x112)]('Choose\x20exactly\x20one\x20OCR\x20input:\x20--image-file\x20or\x20--image-url.');return _0x29bb2c;}function a141_0x1e3d(){const _0x14d9df=['fileName','21166wYikaK','validation','Preview:\x20upload\x20local\x20file,\x20query\x20temporary\x20URL,\x20then\x20recognize\x20','Unsupported\x20OCR\x20scene:\x20','trim','\x20OCR\x20from\x20URL','general','<filePath\x20returned\x20by\x20/smartapi/common/uploadFile>','/smartapi/ocr/recognize-text','\x20OCR','ocr','File\x20URL\x20response\x20missing\x20fileUrl.','appCode','/smartapi/ocr/recognize-text?','GET','idCard','Publicly\x20accessible\x20image\x20or\x20file\x20URL','10FCwOnR','imageUrl','count','54rsVfzD','form','length','apiError','<fileUrl\x20returned\x20by\x20/smartapi/common/queryFileUrl>','4XDuneg','invoice','General','200265YPfSZY','13213389MWkhTb','23960xrZNsp','path','recognize','fileUrl','string','read','/smartapi/common/uploadFile','852000VURMoq','imageFile','/smartapi/common/queryFileUrl','24391763zlgfkm','OCR\x20scene:\x20invoice,\x20general,\x20form,\x20or\x20idCard','.\x20Supported\x20scenes:\x20','871565VKOxso','image-file','2430ilcrWU','toString','POST','Invoice','使用研发态\x20OCR\x20服务识别\x20URL\x20或本地文件中的文字','scene','filePath','filter','str','IdCard'];a141_0x1e3d=function(){return _0x14d9df;};return a141_0x1e3d();}function withScene(_0x26b078,_0x57a6db,_0x581dde){const _0x5c2042=a141_0x340794;return{..._0x26b078,'scene':_0x57a6db,..._0x581dde?{'sourceFile':{'fileName':_0x581dde[_0x5c2042(0x110)],'filePath':_0x581dde[_0x5c2042(0x10c)]}}:{}};}const ocrRecognize={'service':a141_0x340794(0x11b),'command':a141_0x340794(0x131),'description':a141_0x340794(0x10a),'risk':a141_0x340794(0x134),'flags':[SCENE_FLAG,IMAGE_FILE_FLAG,IMAGE_URL_FLAG],async 'dryRun'(_0x39c2e7){const _0xdb5d2c=a141_0x340794,_0x29163a=normalizeScene(_0x39c2e7[_0xdb5d2c(0x10e)](_0xdb5d2c(0x10b))),_0x572f1e=SCENE_TO_LEGACY_TYPE[_0x29163a],_0x49bbdd=validateInputSelection(_0x39c2e7);if(_0x49bbdd[_0xdb5d2c(0x123)]){const _0x65aa48=new URLSearchParams({'url':_0x49bbdd['imageUrl'],'type':_0x572f1e,'appCode':_0x39c2e7['appCode']});return{'method':_0xdb5d2c(0x11f),'url':_0xdb5d2c(0x11e)+_0x65aa48[_0xdb5d2c(0x13f)](),'description':'Preview:\x20recognize\x20'+_0x29163a+_0xdb5d2c(0x116)};}const _0x3146ee=requireDevelopmentUploadFile(_0x49bbdd[_0xdb5d2c(0x137)],_0xdb5d2c(0x13d));return{'method':_0xdb5d2c(0x108),'url':_0xdb5d2c(0x135),'body':{'steps':[{'method':'POST','url':_0xdb5d2c(0x135),'body':{'appCode':_0x39c2e7['appCode'],'multipart':{'file':_0x3146ee}}},{'method':_0xdb5d2c(0x108),'url':_0xdb5d2c(0x138),'body':{'filePath':_0xdb5d2c(0x118),'downloadFlag':![]}},{'method':'GET','url':_0xdb5d2c(0x119),'query':{'appCode':_0x39c2e7[_0xdb5d2c(0x11d)],'url':_0xdb5d2c(0x129),'type':_0x572f1e}}]},'description':_0xdb5d2c(0x113)+_0x29163a+_0xdb5d2c(0x11a)};},async 'execute'(_0xc23b2e){const _0x19c823=a141_0x340794,_0x1f9c04=normalizeScene(_0xc23b2e['str']('scene')),_0x3f7a24=SCENE_TO_LEGACY_TYPE[_0x1f9c04],_0x39a047=validateInputSelection(_0xc23b2e);if(_0x39a047[_0x19c823(0x123)]){const _0x515577=await recognizeDevelopmentOcr(_0xc23b2e['appCode'],{'url':_0x39a047[_0x19c823(0x123)],'type':_0x3f7a24});return{'ok':!![],'data':withScene(_0x515577,_0x1f9c04)};}const _0x551ad0=requireDevelopmentUploadFile(_0x39a047[_0x19c823(0x137)],_0x19c823(0x13d)),_0x34d1d2=await uploadDevelopmentFile(_0xc23b2e['appCode'],_0x551ad0[_0x19c823(0x130)]);if(!_0x34d1d2['filePath'])throw CliErrors[_0x19c823(0x128)]('File\x20upload\x20response\x20missing\x20filePath.');const _0x35c383=await queryDevelopmentFileUrl(_0x34d1d2[_0x19c823(0x10c)],{'download':![]});if(!_0x35c383['fileUrl'])throw CliErrors['apiError'](_0x19c823(0x11c));const _0x55a2c6=await recognizeDevelopmentOcr(_0xc23b2e[_0x19c823(0x11d)],{'url':_0x35c383[_0x19c823(0x132)],'type':_0x3f7a24});return{'ok':!![],'data':withScene(_0x55a2c6,_0x1f9c04,_0x34d1d2)};}};export const ocrDefinitions=[ocrRecognize];
|