@lovrabet/rabetbase-cli 2.4.6-beta.1 → 2.4.6-beta.3
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.d.ts +8 -7
- 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/types.d.ts +17 -2
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/visibility-update.d.ts +2 -0
- package/lib/commands/menu/visibility-update.js +1 -0
- 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/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.js +1 -1
- package/lib/commands/page/custom/template.js +1 -1
- package/lib/commands/page/custom/update.js +1 -1
- package/lib/commands/page/data-list-status.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/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 +4 -3
- package/skills/rabetbase/references/rabetbase-menu-list.md +3 -1
- package/skills/rabetbase/references/rabetbase-menu-visibility-update.md +59 -0
- package/skills/rabetbase/references/rabetbase-ocr.md +17 -2
- package/skills/rabetbase.manifest.json +4 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x4dcc22,_0x27f06c){const _0x2ec505=a132_0x1758,_0x5690d3=_0x4dcc22();while(!![]){try{const _0x28471e=-parseInt(_0x2ec505(0x12b))/0x1+-parseInt(_0x2ec505(0x11d))/0x2*(-parseInt(_0x2ec505(0x14d))/0x3)+-parseInt(_0x2ec505(0x15c))/0x4+parseInt(_0x2ec505(0x149))/0x5*(parseInt(_0x2ec505(0x119))/0x6)+-parseInt(_0x2ec505(0x120))/0x7*(-parseInt(_0x2ec505(0x155))/0x8)+-parseInt(_0x2ec505(0x129))/0x9*(parseInt(_0x2ec505(0x126))/0xa)+parseInt(_0x2ec505(0x15f))/0xb*(parseInt(_0x2ec505(0x135))/0xc);if(_0x28471e===_0x27f06c)break;else _0x5690d3['push'](_0x5690d3['shift']());}catch(_0x46938a){_0x5690d3['push'](_0x5690d3['shift']());}}}(a132_0x1401,0xc83fb));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(_0x521a8b){const _0x5f28a4=a132_0x1758,_0x5307bc=[];return _0x521a8b[_0x5f28a4(0x11b)]&&!isValidJsHttpsUrl(_0x521a8b[_0x5f28a4(0x11b)])&&_0x5307bc[_0x5f28a4(0x152)]({'field':_0x5f28a4(0x11b),'message':_0x5f28a4(0x140)}),_0x521a8b[_0x5f28a4(0x15e)]&&!isValidCssHttpsUrl(_0x521a8b[_0x5f28a4(0x15e)])&&_0x5307bc[_0x5f28a4(0x152)]({'field':_0x5f28a4(0x15e),'message':'CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL'}),_0x5307bc;}export async function runMenuUpdateCore(_0x5d899f,_0x1fd85d,_0xa63f0d,_0x11870f={}){const _0x329412=a132_0x1758,_0x4a8401=parseUpdateParamsFlag(_0xa63f0d),_0x2c6204=normalizeMode(_0x11870f[_0x329412(0x138)]);validateSelection(_0x11870f['selection']);const _0x4e1c57=[];if(_0x4a8401[_0x329412(0x11b)])_0x4e1c57[_0x329412(0x152)](_0x4a8401[_0x329412(0x11b)]);if(_0x4a8401['cssUrl'])_0x4e1c57[_0x329412(0x152)](_0x4a8401[_0x329412(0x15e)]);const _0x122b92=validateParams(_0x4a8401);if(_0x122b92[_0x329412(0x12f)]>0x0){const _0x154153=_0x122b92['map'](_0x5e8486=>_0x329412(0x15a)+_0x5e8486[_0x329412(0x123)]+':\x20'+_0x5e8486['message'])['join'](';\x20');throw new Error(_0x329412(0x11c)+_0x154153);}if(_0x4e1c57[_0x329412(0x12f)]===0x0)throw new Error('Invalid\x20--params:\x20menu\x20asset-update\x20requires\x20at\x20least\x20one\x20explicit\x20JS/CSS\x20URL.\x20'+_0x329412(0x153));logger['setLogPath'](process[_0x329412(0x131)]()),logger['info'](_0x329412(0x122),_0x329412(0x146),{'appCode':_0x5d899f,'jsUrl':_0x4a8401[_0x329412(0x11b)],'cssUrl':_0x4a8401[_0x329412(0x15e)],'mode':_0x2c6204,'dryRun':_0x11870f[_0x329412(0x158)]===!![]});if(_0x4a8401[_0x329412(0x11b)]){const _0x372e36=await isUrlReachable(_0x4a8401[_0x329412(0x11b)]);if(!_0x372e36)throw new Error(_0x329412(0x13d)+_0x4a8401[_0x329412(0x11b)]);}if(_0x4a8401[_0x329412(0x15e)]){const _0x3affd9=await isUrlReachable(_0x4a8401[_0x329412(0x15e)]);if(!_0x3affd9)throw new Error('CSS\x20URL\x20is\x20unreachable:\x20'+_0x4a8401[_0x329412(0x15e)]);}const _0x115342=await getOnlineMenuList(_0x5d899f,_0x1fd85d),_0x3d82ce=_0x115342[_0x329412(0x14f)](_0x750272=>_0x750272[_0x329412(0x12a)][_0x329412(0x12f)]>0x0),_0x17ac01=selectMenusForUpdate(_0x3d82ce,_0x11870f[_0x329412(0x128)]);if(_0x17ac01[_0x329412(0x12f)]===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![],'dryRun':_0x11870f['dryRun']===!![]};const _0x3729fc=_0x17ac01[_0x329412(0x134)](_0x2184fb=>buildMenuUpdateDiff(_0x2184fb,_0x4a8401,_0x2c6204,_0x11870f[_0x329412(0x154)]===!![],_0x11870f['loadScriptMode']));if(_0x11870f[_0x329412(0x158)])return{'updated':0x0,'failed':0x0,'skipped':![],'dryRun':!![],'diffs':_0x3729fc};const _0x4ce7ea=await Promise[_0x329412(0x156)](_0x17ac01[_0x329412(0x134)]((_0x1e3feb,_0x4a0edc)=>updateMenuCdnUrl(_0x5d899f,_0x1fd85d,{'id':_0x1e3feb['id'],'label':_0x1e3feb['label'],'path':_0x1e3feb['path'],'resources':_0x3729fc[_0x4a0edc][_0x329412(0x127)]['resources'],'extend':_0x1e3feb[_0x329412(0x124)]??null,'loadScriptMode':_0x11870f[_0x329412(0x12c)]}))),_0xf71fb5=_0x4ce7ea[_0x329412(0x14f)](_0x3e19e8=>_0x3e19e8[_0x329412(0x14c)]===_0x329412(0x11a))[_0x329412(0x134)](_0x1a6cfd=>_0x1a6cfd[_0x329412(0x121)]),_0x52af23=_0x4ce7ea['filter'](_0x436320=>_0x436320['status']===_0x329412(0x144))['length'];return logger[_0x329412(0x13c)]('menu-asset-update','Menu\x20asset\x20update\x20completed',{'count':_0x17ac01[_0x329412(0x12f)],'resources':_0x4e1c57}),{'updated':_0xf71fb5[_0x329412(0x12f)],'failed':_0x52af23,'skipped':![],'menus':_0xf71fb5};}function validateSelection(_0x594f7d){const _0x3a1632=a132_0x1758;if(!_0x594f7d)throw new Error(_0x3a1632(0x143));if(_0x594f7d[_0x3a1632(0x130)]&&(_0x594f7d[_0x3a1632(0x147)]['length']>0x0||_0x594f7d[_0x3a1632(0x13f)][_0x3a1632(0x12f)]>0x0))throw new Error(_0x3a1632(0x151));if(!_0x594f7d[_0x3a1632(0x130)]&&_0x594f7d[_0x3a1632(0x147)][_0x3a1632(0x12f)]===0x0&&_0x594f7d[_0x3a1632(0x13f)][_0x3a1632(0x12f)]===0x0)throw new Error(_0x3a1632(0x143));}export function selectMenusForUpdate(_0x5bfb8d,_0x3374b8){const _0x5cc413=a132_0x1758;validateSelection(_0x3374b8);if(_0x3374b8['all'])return _0x5bfb8d;const _0x4f6898=new Set(_0x5bfb8d[_0x5cc413(0x134)](_0x228934=>_0x228934['id'])),_0xc1fdca=new Set(_0x5bfb8d[_0x5cc413(0x134)](_0x3bd423=>_0x3bd423[_0x5cc413(0x14a)])),_0xa09c20=_0x3374b8[_0x5cc413(0x147)][_0x5cc413(0x14f)](_0x386630=>!_0x4f6898[_0x5cc413(0x159)](_0x386630)),_0x11b453=_0x3374b8['paths'][_0x5cc413(0x14f)](_0x32d9f2=>!_0xc1fdca[_0x5cc413(0x159)](_0x32d9f2));if(_0xa09c20[_0x5cc413(0x12f)]>0x0||_0x11b453[_0x5cc413(0x12f)]>0x0){const _0x3e273e=[..._0xa09c20[_0x5cc413(0x134)](_0x5932c4=>String(_0x5932c4)),..._0x11b453][_0x5cc413(0x14b)](',\x20');throw new Error(_0x5cc413(0x15b)+_0x3e273e);}const _0x275322=new Set(_0x3374b8[_0x5cc413(0x147)]),_0xdd5992=new Set(_0x3374b8['paths']);return _0x5bfb8d[_0x5cc413(0x14f)](_0x2fa55e=>_0x275322[_0x5cc413(0x159)](_0x2fa55e['id'])||_0xdd5992[_0x5cc413(0x159)](_0x2fa55e['path']));}function normalizeMode(_0x9451e6){const _0x57db46=a132_0x1758;if(!_0x9451e6)return _0x57db46(0x12d);if(_0x9451e6===_0x57db46(0x11f)||_0x9451e6===_0x57db46(0x12d))return _0x9451e6;throw new Error(_0x57db46(0x142)+_0x9451e6+'.\x20Allowed\x20values:\x20replace,\x20patch');}function buildMenuUpdateDiff(_0x1bede6,_0x5ed03d,_0x3c0866,_0xd15a7,_0x1e7740){const _0x25ab25=a132_0x1758,_0x245d84=[..._0x1bede6[_0x25ab25(0x12a)]];_0x3c0866===_0x25ab25(0x12d)&&assertUnambiguousPatchResources(_0x1bede6,_0x245d84,_0x5ed03d);const _0xd1bf17=_0x3c0866===_0x25ab25(0x12d)?patchResources(_0x245d84,_0x5ed03d):replaceResources(_0x5ed03d),_0x49710f=[],_0x1635a6=_0x245d84[_0x25ab25(0x162)](isJsResource),_0x568619=_0xd1bf17['some'](isJsResource);if(_0x1635a6&&!_0x568619){const _0x192a04=_0x25ab25(0x125)+_0x1bede6[_0x25ab25(0x13a)]+'\x22\x20('+_0x1bede6[_0x25ab25(0x14a)]+_0x25ab25(0x160)+'Use\x20--mode\x20patch\x20to\x20preserve\x20it,\x20pass\x20jsUrl,\x20or\x20add\x20--force\x20for\x20an\x20intentional\x20removal.';if(!_0xd15a7)throw new Error(_0x192a04);_0x49710f['push'](_0x192a04);}const _0x17106b=_0x245d84[_0x25ab25(0x162)](isCssResource),_0x3cbf79=_0xd1bf17[_0x25ab25(0x162)](isCssResource);_0x17106b&&!_0x3cbf79&&_0x49710f[_0x25ab25(0x152)](_0x25ab25(0x139)+_0x1bede6[_0x25ab25(0x13a)]+_0x25ab25(0x13e)+_0x1bede6[_0x25ab25(0x14a)]+').');const _0x5b34a0=typeof _0x1bede6['extend']?.[_0x25ab25(0x12c)]==='string'?_0x1bede6[_0x25ab25(0x124)]['loadScriptMode']:null,_0x10bc26=_0x1e7740?{'loadScriptMode':_0x5b34a0}:{},_0x717dd4=_0x1e7740?{'loadScriptMode':_0x1e7740}:{};return{'id':_0x1bede6['id'],'label':_0x1bede6[_0x25ab25(0x13a)],'path':_0x1bede6[_0x25ab25(0x14a)],'mode':_0x3c0866,'before':{'resources':_0x245d84,..._0x10bc26},'after':{'resources':_0xd1bf17,..._0x717dd4},'warnings':_0x49710f};}function replaceResources(_0x11f4a7){const _0x18004f=a132_0x1758;return[_0x11f4a7[_0x18004f(0x11b)],_0x11f4a7[_0x18004f(0x15e)]][_0x18004f(0x14f)](_0x415b1d=>!!_0x415b1d);}function assertUnambiguousPatchResources(_0x2897f8,_0x1977c3,_0x732630){const _0x5b4c89=a132_0x1758,_0x4d3f33=_0x1977c3[_0x5b4c89(0x14f)](isJsResource)['length'];if(_0x732630['jsUrl']&&_0x4d3f33>0x1)throw new Error(_0x5b4c89(0x133)+_0x4d3f33+_0x5b4c89(0x15d)+_0x2897f8[_0x5b4c89(0x13a)]+_0x5b4c89(0x13e)+_0x2897f8['path']+')\x20'+_0x5b4c89(0x14e));const _0x2306b8=_0x1977c3['filter'](isCssResource)[_0x5b4c89(0x12f)];if(_0x732630[_0x5b4c89(0x15e)]&&_0x2306b8>0x1)throw new Error(_0x5b4c89(0x133)+_0x2306b8+_0x5b4c89(0x136)+_0x2897f8['label']+_0x5b4c89(0x13e)+_0x2897f8['path']+')\x20'+_0x5b4c89(0x148));}function a132_0x1401(){const _0x1eb8a6=['patch','.js','length','all','cwd','toLowerCase','menu\x20asset-update\x20cannot\x20patch\x20','map','15331560yUMHzF','\x20existing\x20CSS\x20resources\x20for\x20\x22','unshift','mode','menu\x20asset-update\x20will\x20remove\x20existing\x20CSS\x20resource\x20for\x20\x22','label','endsWith','info','JS\x20URL\x20is\x20unreachable:\x20','\x22\x20(','paths','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','isArray','Invalid\x20--mode:\x20','menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.','rejected','split','Start\x20non-interactive\x20menu\x20asset\x20update','menuIds','with\x20a\x20single\x20cssUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','6740zKUDot','path','join','status','389931Uptvhw','with\x20a\x20single\x20jsUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','filter','object','--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.','push','Pass\x20--params\x20\x27{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}\x27\x20to\x20update\x20assets.','force','5528IovKGG','allSettled','parse','dryRun','has','--params.','menu\x20asset-update\x20selectors\x20did\x20not\x20match\x20resource-bearing\x20menus:\x20','5509468nEFQPM','\x20existing\x20JS\x20resources\x20for\x20\x22','cssUrl','22gAZstI',').\x20','trim','some','2826UOKxjm','fulfilled','jsUrl','Invalid\x20--params:\x20','14HWJXub','string','replace','602KlwPqQ','value','menu-asset-update','field','extend','menu\x20asset-update\x20would\x20remove\x20existing\x20JS\x20resource\x20for\x20\x22','420460wqlrfo','after','selection','171oxedhZ','resources','1162973VWdzry','loadScriptMode'];a132_0x1401=function(){return _0x1eb8a6;};return a132_0x1401();}function patchResources(_0x2ae5a6,_0x2668dc){const _0x300269=a132_0x1758;let _0x4558a3=![],_0x252227=![];const _0x162c14=[];for(const _0x5c38e0 of _0x2ae5a6){if(isJsResource(_0x5c38e0)){if(_0x2668dc['jsUrl']&&!_0x4558a3)_0x162c14[_0x300269(0x152)](_0x2668dc[_0x300269(0x11b)]),_0x4558a3=!![];else!_0x2668dc[_0x300269(0x11b)]&&_0x162c14['push'](_0x5c38e0);continue;}if(isCssResource(_0x5c38e0)){if(_0x2668dc['cssUrl']&&!_0x252227)_0x162c14['push'](_0x2668dc[_0x300269(0x15e)]),_0x252227=!![];else!_0x2668dc[_0x300269(0x15e)]&&_0x162c14[_0x300269(0x152)](_0x5c38e0);continue;}_0x162c14[_0x300269(0x152)](_0x5c38e0);}return _0x2668dc[_0x300269(0x11b)]&&!_0x4558a3&&_0x162c14[_0x300269(0x137)](_0x2668dc[_0x300269(0x11b)]),_0x2668dc[_0x300269(0x15e)]&&!_0x252227&&_0x162c14[_0x300269(0x152)](_0x2668dc[_0x300269(0x15e)]),_0x162c14;}function isJsResource(_0x26ed81){const _0x14cca4=a132_0x1758;return stripQuery(_0x26ed81)[_0x14cca4(0x132)]()['endsWith'](_0x14cca4(0x12e));}function isCssResource(_0x35d79f){const _0x5ea471=a132_0x1758;return stripQuery(_0x35d79f)[_0x5ea471(0x132)]()[_0x5ea471(0x13b)]('.css');}function a132_0x1758(_0x2e6aa8,_0x240bb8){_0x2e6aa8=_0x2e6aa8-0x119;const _0x1401b5=a132_0x1401();let _0x17583b=_0x1401b5[_0x2e6aa8];return _0x17583b;}function stripQuery(_0x2d7854){const _0x2d1d42=a132_0x1758;return _0x2d7854[_0x2d1d42(0x145)]('?')[0x0]??_0x2d7854;}function parseUpdateParamsFlag(_0x251c73){const _0x2117c1=a132_0x1758;if(!_0x251c73||typeof _0x251c73!==_0x2117c1(0x11e))return{};try{const _0x2423f7=JSON[_0x2117c1(0x157)](_0x251c73);if(typeof _0x2423f7!==_0x2117c1(0x150)||_0x2423f7===null||Array[_0x2117c1(0x141)](_0x2423f7))return{};return{'jsUrl':typeof _0x2423f7[_0x2117c1(0x11b)]===_0x2117c1(0x11e)?_0x2423f7[_0x2117c1(0x11b)]['trim']():undefined,'cssUrl':typeof _0x2423f7['cssUrl']==='string'?_0x2423f7[_0x2117c1(0x15e)][_0x2117c1(0x161)]():undefined};}catch{return{};}}
|
|
1
|
+
(function(_0x302642,_0x3f13ef){const _0x110609=a132_0x41e1,_0x2df9ed=_0x302642();while(!![]){try{const _0x571d10=-parseInt(_0x110609(0x159))/0x1+parseInt(_0x110609(0x153))/0x2*(parseInt(_0x110609(0x168))/0x3)+parseInt(_0x110609(0x14f))/0x4*(-parseInt(_0x110609(0x12a))/0x5)+-parseInt(_0x110609(0x169))/0x6*(parseInt(_0x110609(0x151))/0x7)+parseInt(_0x110609(0x12b))/0x8+-parseInt(_0x110609(0x13d))/0x9*(-parseInt(_0x110609(0x130))/0xa)+-parseInt(_0x110609(0x12f))/0xb;if(_0x571d10===_0x3f13ef)break;else _0x2df9ed['push'](_0x2df9ed['shift']());}catch(_0x51d456){_0x2df9ed['push'](_0x2df9ed['shift']());}}}(a132_0x319b,0x99f4e));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(_0x715869){const _0xb602fa=a132_0x41e1,_0x418e18=[];return _0x715869[_0xb602fa(0x125)]&&!isValidJsHttpsUrl(_0x715869[_0xb602fa(0x125)])&&_0x418e18[_0xb602fa(0x13f)]({'field':_0xb602fa(0x125),'message':_0xb602fa(0x15a)}),_0x715869[_0xb602fa(0x154)]&&!isValidCssHttpsUrl(_0x715869[_0xb602fa(0x154)])&&_0x418e18[_0xb602fa(0x13f)]({'field':'cssUrl','message':'CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL'}),_0x418e18;}function a132_0x319b(){const _0x4ca1d8=['445867rKyVvi','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.','menuIds','selection','join','.js','\x22\x20(','rejected','field','split','parse','all','replace','Invalid\x20--params:\x20','111gEyUIP','12MPIfSQ','value','menu\x20asset-update\x20will\x20remove\x20existing\x20CSS\x20resource\x20for\x20\x22','jsUrl','menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.','with\x20a\x20single\x20jsUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','filter','some','82745keHHDs','2714056LYoGhk','object','length','dryRun','5666287UkPuub','1050vKoPIS','label','trim','path','info','menu\x20asset-update\x20would\x20remove\x20existing\x20JS\x20resource\x20for\x20\x22','.\x20Allowed\x20values:\x20replace,\x20patch','toLowerCase','JS\x20URL\x20is\x20unreachable:\x20',').\x20','paths','unshift','fulfilled','87111lTyUIR','patch','push','map','--params.','menu\x20asset-update\x20selectors\x20did\x20not\x20match\x20resource-bearing\x20menus:\x20','.css','after','with\x20a\x20single\x20cssUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','force','extend','resources','\x20existing\x20CSS\x20resources\x20for\x20\x22','string','has','Invalid\x20--mode:\x20','menu-asset-update','loadScriptMode','28GqAglx','status','1721146utxFrW','mode','45602wonLrb','cssUrl','endsWith','\x20existing\x20JS\x20resources\x20for\x20\x22','message','CSS\x20URL\x20is\x20unreachable:\x20'];a132_0x319b=function(){return _0x4ca1d8;};return a132_0x319b();}export async function runMenuUpdateCore(_0x112b48,_0x58e91d,_0x5a37df,_0x415582={}){const _0x11be5a=a132_0x41e1,_0x237cb5=parseUpdateParamsFlag(_0x5a37df),_0x5b488a=normalizeMode(_0x415582[_0x11be5a(0x152)]);validateSelection(_0x415582['selection']);const _0x387931=[];if(_0x237cb5[_0x11be5a(0x125)])_0x387931[_0x11be5a(0x13f)](_0x237cb5[_0x11be5a(0x125)]);if(_0x237cb5[_0x11be5a(0x154)])_0x387931['push'](_0x237cb5['cssUrl']);const _0xbdecfc=validateParams(_0x237cb5);if(_0xbdecfc[_0x11be5a(0x12d)]>0x0){const _0x2f174a=_0xbdecfc[_0x11be5a(0x140)](_0x12351a=>_0x11be5a(0x141)+_0x12351a[_0x11be5a(0x162)]+':\x20'+_0x12351a[_0x11be5a(0x157)])[_0x11be5a(0x15e)](';\x20');throw new Error(_0x11be5a(0x167)+_0x2f174a);}if(_0x387931[_0x11be5a(0x12d)]===0x0)throw new Error('Invalid\x20--params:\x20menu\x20asset-update\x20requires\x20at\x20least\x20one\x20explicit\x20JS/CSS\x20URL.\x20'+'Pass\x20--params\x20\x27{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}\x27\x20to\x20update\x20assets.');logger['setLogPath'](process['cwd']()),logger['info'](_0x11be5a(0x14d),'Start\x20non-interactive\x20menu\x20asset\x20update',{'appCode':_0x112b48,'jsUrl':_0x237cb5[_0x11be5a(0x125)],'cssUrl':_0x237cb5['cssUrl'],'mode':_0x5b488a,'dryRun':_0x415582[_0x11be5a(0x12e)]===!![]});if(_0x237cb5[_0x11be5a(0x125)]){const _0x528153=await isUrlReachable(_0x237cb5[_0x11be5a(0x125)]);if(!_0x528153)throw new Error(_0x11be5a(0x138)+_0x237cb5[_0x11be5a(0x125)]);}if(_0x237cb5[_0x11be5a(0x154)]){const _0x1aae70=await isUrlReachable(_0x237cb5[_0x11be5a(0x154)]);if(!_0x1aae70)throw new Error(_0x11be5a(0x158)+_0x237cb5[_0x11be5a(0x154)]);}const _0x39195e=await getOnlineMenuList(_0x112b48,_0x58e91d),_0x447dd6=_0x39195e['filter'](_0xaedc09=>_0xaedc09[_0x11be5a(0x148)][_0x11be5a(0x12d)]>0x0),_0x4aa5f5=selectMenusForUpdate(_0x447dd6,_0x415582[_0x11be5a(0x15d)]);if(_0x4aa5f5[_0x11be5a(0x12d)]===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![],'dryRun':_0x415582['dryRun']===!![]};const _0xca8efd=_0x4aa5f5[_0x11be5a(0x140)](_0x2f5bc6=>buildMenuUpdateDiff(_0x2f5bc6,_0x237cb5,_0x5b488a,_0x415582[_0x11be5a(0x146)]===!![],_0x415582[_0x11be5a(0x14e)]));if(_0x415582[_0x11be5a(0x12e)])return{'updated':0x0,'failed':0x0,'skipped':![],'dryRun':!![],'diffs':_0xca8efd};const _0x459242=await Promise['allSettled'](_0x4aa5f5[_0x11be5a(0x140)]((_0x411a51,_0x1cc0f3)=>updateMenuCdnUrl(_0x112b48,_0x58e91d,{'id':_0x411a51['id'],'label':_0x411a51[_0x11be5a(0x131)],'path':_0x411a51[_0x11be5a(0x133)],'resources':_0xca8efd[_0x1cc0f3][_0x11be5a(0x144)]['resources'],'extend':_0x411a51[_0x11be5a(0x147)]??null,'loadScriptMode':_0x415582['loadScriptMode']}))),_0x48f7a1=_0x459242[_0x11be5a(0x128)](_0xd6edf3=>_0xd6edf3[_0x11be5a(0x150)]===_0x11be5a(0x13c))[_0x11be5a(0x140)](_0x86568d=>_0x86568d[_0x11be5a(0x16a)]),_0x3f2f21=_0x459242[_0x11be5a(0x128)](_0xaba312=>_0xaba312[_0x11be5a(0x150)]===_0x11be5a(0x161))[_0x11be5a(0x12d)];return logger[_0x11be5a(0x134)]('menu-asset-update','Menu\x20asset\x20update\x20completed',{'count':_0x4aa5f5[_0x11be5a(0x12d)],'resources':_0x387931}),{'updated':_0x48f7a1[_0x11be5a(0x12d)],'failed':_0x3f2f21,'skipped':![],'menus':_0x48f7a1};}function validateSelection(_0x31710d){const _0x2e4656=a132_0x41e1;if(!_0x31710d)throw new Error(_0x2e4656(0x126));if(_0x31710d[_0x2e4656(0x165)]&&(_0x31710d[_0x2e4656(0x15c)]['length']>0x0||_0x31710d[_0x2e4656(0x13a)][_0x2e4656(0x12d)]>0x0))throw new Error(_0x2e4656(0x15b));if(!_0x31710d[_0x2e4656(0x165)]&&_0x31710d[_0x2e4656(0x15c)][_0x2e4656(0x12d)]===0x0&&_0x31710d['paths']['length']===0x0)throw new Error(_0x2e4656(0x126));}export function selectMenusForUpdate(_0x182f8d,_0xf07744){const _0x2b97ba=a132_0x41e1;validateSelection(_0xf07744);if(_0xf07744[_0x2b97ba(0x165)])return _0x182f8d;const _0x3218b5=new Set(_0x182f8d[_0x2b97ba(0x140)](_0x38c892=>_0x38c892['id'])),_0x15ae84=new Set(_0x182f8d[_0x2b97ba(0x140)](_0x42945f=>_0x42945f['path'])),_0x58b22e=_0xf07744[_0x2b97ba(0x15c)][_0x2b97ba(0x128)](_0x47e38d=>!_0x3218b5[_0x2b97ba(0x14b)](_0x47e38d)),_0x1ebfaa=_0xf07744[_0x2b97ba(0x13a)][_0x2b97ba(0x128)](_0x12abc3=>!_0x15ae84[_0x2b97ba(0x14b)](_0x12abc3));if(_0x58b22e['length']>0x0||_0x1ebfaa[_0x2b97ba(0x12d)]>0x0){const _0x116dbe=[..._0x58b22e[_0x2b97ba(0x140)](_0x2ba9eb=>String(_0x2ba9eb)),..._0x1ebfaa][_0x2b97ba(0x15e)](',\x20');throw new Error(_0x2b97ba(0x142)+_0x116dbe);}const _0x367e4e=new Set(_0xf07744[_0x2b97ba(0x15c)]),_0x1dcb13=new Set(_0xf07744['paths']);return _0x182f8d['filter'](_0x37533d=>_0x367e4e[_0x2b97ba(0x14b)](_0x37533d['id'])||_0x1dcb13[_0x2b97ba(0x14b)](_0x37533d[_0x2b97ba(0x133)]));}function normalizeMode(_0x57ca92){const _0x2dd838=a132_0x41e1;if(!_0x57ca92)return _0x2dd838(0x13e);if(_0x57ca92===_0x2dd838(0x166)||_0x57ca92===_0x2dd838(0x13e))return _0x57ca92;throw new Error(_0x2dd838(0x14c)+_0x57ca92+_0x2dd838(0x136));}function buildMenuUpdateDiff(_0x4c71c5,_0x4063dd,_0x1f0c60,_0x578acf,_0xd2c1b8){const _0x5e89a8=a132_0x41e1,_0x2a639b=[..._0x4c71c5[_0x5e89a8(0x148)]];_0x1f0c60===_0x5e89a8(0x13e)&&assertUnambiguousPatchResources(_0x4c71c5,_0x2a639b,_0x4063dd);const _0x438e22=_0x1f0c60===_0x5e89a8(0x13e)?patchResources(_0x2a639b,_0x4063dd):replaceResources(_0x4063dd),_0x4bbf14=[],_0x146090=_0x2a639b['some'](isJsResource),_0x4d877b=_0x438e22[_0x5e89a8(0x129)](isJsResource);if(_0x146090&&!_0x4d877b){const _0xc02b1f=_0x5e89a8(0x135)+_0x4c71c5['label']+_0x5e89a8(0x160)+_0x4c71c5[_0x5e89a8(0x133)]+_0x5e89a8(0x139)+'Use\x20--mode\x20patch\x20to\x20preserve\x20it,\x20pass\x20jsUrl,\x20or\x20add\x20--force\x20for\x20an\x20intentional\x20removal.';if(!_0x578acf)throw new Error(_0xc02b1f);_0x4bbf14['push'](_0xc02b1f);}const _0x2f88e8=_0x2a639b[_0x5e89a8(0x129)](isCssResource),_0x26ae3d=_0x438e22[_0x5e89a8(0x129)](isCssResource);_0x2f88e8&&!_0x26ae3d&&_0x4bbf14['push'](_0x5e89a8(0x16b)+_0x4c71c5[_0x5e89a8(0x131)]+_0x5e89a8(0x160)+_0x4c71c5[_0x5e89a8(0x133)]+').');const _0x3cec74=typeof _0x4c71c5[_0x5e89a8(0x147)]?.['loadScriptMode']==='string'?_0x4c71c5[_0x5e89a8(0x147)][_0x5e89a8(0x14e)]:null,_0x4292d0=_0xd2c1b8?{'loadScriptMode':_0x3cec74}:{},_0x23cc81=_0xd2c1b8?{'loadScriptMode':_0xd2c1b8}:{};return{'id':_0x4c71c5['id'],'label':_0x4c71c5['label'],'path':_0x4c71c5[_0x5e89a8(0x133)],'mode':_0x1f0c60,'before':{'resources':_0x2a639b,..._0x4292d0},'after':{'resources':_0x438e22,..._0x23cc81},'warnings':_0x4bbf14};}function a132_0x41e1(_0x2865c4,_0x2397d1){_0x2865c4=_0x2865c4-0x125;const _0x319bf4=a132_0x319b();let _0x41e1d9=_0x319bf4[_0x2865c4];return _0x41e1d9;}function replaceResources(_0x3cb561){const _0x186ebd=a132_0x41e1;return[_0x3cb561['jsUrl'],_0x3cb561[_0x186ebd(0x154)]]['filter'](_0x61758c=>!!_0x61758c);}function assertUnambiguousPatchResources(_0x4d7855,_0x34102b,_0x32c441){const _0x55cd9e=a132_0x41e1,_0x1f03dc=_0x34102b[_0x55cd9e(0x128)](isJsResource)[_0x55cd9e(0x12d)];if(_0x32c441[_0x55cd9e(0x125)]&&_0x1f03dc>0x1)throw new Error('menu\x20asset-update\x20cannot\x20patch\x20'+_0x1f03dc+_0x55cd9e(0x156)+_0x4d7855[_0x55cd9e(0x131)]+_0x55cd9e(0x160)+_0x4d7855[_0x55cd9e(0x133)]+')\x20'+_0x55cd9e(0x127));const _0x3f7e80=_0x34102b[_0x55cd9e(0x128)](isCssResource)[_0x55cd9e(0x12d)];if(_0x32c441[_0x55cd9e(0x154)]&&_0x3f7e80>0x1)throw new Error('menu\x20asset-update\x20cannot\x20patch\x20'+_0x3f7e80+_0x55cd9e(0x149)+_0x4d7855[_0x55cd9e(0x131)]+_0x55cd9e(0x160)+_0x4d7855[_0x55cd9e(0x133)]+')\x20'+_0x55cd9e(0x145));}function patchResources(_0x2c8b54,_0x213ceb){const _0x124f54=a132_0x41e1;let _0x5eb68a=![],_0x248802=![];const _0x2c5b8d=[];for(const _0xe3ce6a of _0x2c8b54){if(isJsResource(_0xe3ce6a)){if(_0x213ceb[_0x124f54(0x125)]&&!_0x5eb68a)_0x2c5b8d[_0x124f54(0x13f)](_0x213ceb[_0x124f54(0x125)]),_0x5eb68a=!![];else!_0x213ceb['jsUrl']&&_0x2c5b8d[_0x124f54(0x13f)](_0xe3ce6a);continue;}if(isCssResource(_0xe3ce6a)){if(_0x213ceb[_0x124f54(0x154)]&&!_0x248802)_0x2c5b8d[_0x124f54(0x13f)](_0x213ceb[_0x124f54(0x154)]),_0x248802=!![];else!_0x213ceb[_0x124f54(0x154)]&&_0x2c5b8d[_0x124f54(0x13f)](_0xe3ce6a);continue;}_0x2c5b8d[_0x124f54(0x13f)](_0xe3ce6a);}return _0x213ceb['jsUrl']&&!_0x5eb68a&&_0x2c5b8d[_0x124f54(0x13b)](_0x213ceb['jsUrl']),_0x213ceb[_0x124f54(0x154)]&&!_0x248802&&_0x2c5b8d[_0x124f54(0x13f)](_0x213ceb['cssUrl']),_0x2c5b8d;}function isJsResource(_0x1451fe){const _0x3f7b1b=a132_0x41e1;return stripQuery(_0x1451fe)[_0x3f7b1b(0x137)]()['endsWith'](_0x3f7b1b(0x15f));}function isCssResource(_0x476749){const _0x5cbb25=a132_0x41e1;return stripQuery(_0x476749)[_0x5cbb25(0x137)]()[_0x5cbb25(0x155)](_0x5cbb25(0x143));}function stripQuery(_0x1054b9){const _0x10bbcd=a132_0x41e1;return _0x1054b9[_0x10bbcd(0x163)]('?')[0x0]??_0x1054b9;}function parseUpdateParamsFlag(_0x5057c3){const _0x1770fc=a132_0x41e1;if(!_0x5057c3||typeof _0x5057c3!=='string')return{};try{const _0x4ba715=JSON[_0x1770fc(0x164)](_0x5057c3);if(typeof _0x4ba715!==_0x1770fc(0x12c)||_0x4ba715===null||Array['isArray'](_0x4ba715))return{};return{'jsUrl':typeof _0x4ba715['jsUrl']==='string'?_0x4ba715[_0x1770fc(0x125)]['trim']():undefined,'cssUrl':typeof _0x4ba715[_0x1770fc(0x154)]===_0x1770fc(0x14a)?_0x4ba715['cssUrl'][_0x1770fc(0x132)]():undefined};}catch{return{};}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x7a744a,_0x344bc8){const _0xf50d1f=a133_0x3141,_0x19aa01=_0x7a744a();while(!![]){try{const _0x4573a2=parseInt(_0xf50d1f(0xe1))/0x1*(parseInt(_0xf50d1f(0xd9))/0x2)+parseInt(_0xf50d1f(0xdb))/0x3+parseInt(_0xf50d1f(0xdd))/0x4*(parseInt(_0xf50d1f(0xe2))/0x5)+parseInt(_0xf50d1f(0xd7))/0x6+-parseInt(_0xf50d1f(0xd8))/0x7+-parseInt(_0xf50d1f(0xdf))/0x8+parseInt(_0xf50d1f(0xda))/0x9;if(_0x4573a2===_0x344bc8)break;else _0x19aa01['push'](_0x19aa01['shift']());}catch(_0x3df1f3){_0x19aa01['push'](_0x19aa01['shift']());}}}(a133_0x50e0,0xd64d1));export function isValidJsHttpsUrl(_0x3f4b6c){const _0x2dfd26=a133_0x3141;return/^https:\/\/.+\.js(\?.*)?$/[_0x2dfd26(0xe0)](_0x3f4b6c[_0x2dfd26(0xde)]());}export function isValidCssHttpsUrl(_0x491396){const _0x5b2c7c=a133_0x3141;return/^https:\/\/.+\.css(\?.*)?$/[_0x5b2c7c(0xe0)](_0x491396['trim']());}function a133_0x3141(_0x583ab4,_0x3aa4a9){_0x583ab4=_0x583ab4-0xd7;const _0x50e0c5=a133_0x50e0();let _0x314186=_0x50e0c5[_0x583ab4];return _0x314186;}function a133_0x50e0(){const _0x5a0a66=['13839488GZMxIx','test','7493ySXBSs','1050ZapQHK','4781346TKUDrJ','6283865bWecuG','72cceUwA','897489vfnIdr','4192854QKVikr','HEAD','17932JeIHDc','trim'];a133_0x50e0=function(){return _0x5a0a66;};return a133_0x50e0();}export async function isUrlReachable(_0x55aac6){const _0x42ba1b=a133_0x3141;try{const _0x258dcc=await fetch(_0x55aac6,{'method':_0x42ba1b(0xdc)});return _0x258dcc['ok'];}catch{return![];}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a134_0x201f50=a134_0x48a9;(function(_0x4adf0a,_0x278e4e){const _0xb5b8fb=a134_0x48a9,_0x2df970=_0x4adf0a();while(!![]){try{const _0x4b83bf=-parseInt(_0xb5b8fb(0x1d3))/0x1*(parseInt(_0xb5b8fb(0x1d8))/0x2)+-parseInt(_0xb5b8fb(0x1e3))/0x3*(-parseInt(_0xb5b8fb(0x1af))/0x4)+-parseInt(_0xb5b8fb(0x1c4))/0x5*(parseInt(_0xb5b8fb(0x1c7))/0x6)+-parseInt(_0xb5b8fb(0x1b5))/0x7*(parseInt(_0xb5b8fb(0x1f3))/0x8)+parseInt(_0xb5b8fb(0x1d5))/0x9+-parseInt(_0xb5b8fb(0x1e4))/0xa*(parseInt(_0xb5b8fb(0x1ec))/0xb)+parseInt(_0xb5b8fb(0x1c1))/0xc;if(_0x4b83bf===_0x278e4e)break;else _0x2df970['push'](_0x2df970['shift']());}catch(_0x1fe6bd){_0x2df970['push'](_0x2df970['shift']());}}}(a134_0x2ebe,0x62783));function a134_0x2ebe(){const _0x55e2a8=['\x20\x20!\x20No\x20local\x20pages\x20found,\x20please\x20create\x20pages\x20first','\x20created.','appcode','cyan','21645024ZWUbfs','map','\x20menu(s)','3426450PoAvVn','POST','sync','6bdZzpt','Menu\x20sync\x20completed:\x20','size','skipped','Menu\x20sync\x20skipped','created','\x20local\x20microfrontend\x20menu(s).','flag','boolean','Confirm\x20non-interactive\x20sync;\x20without\x20--paths,\x20create\x20all\x20missing\x20local\x20pages','paths','✓\x20Menu\x20sync\x20completed:\x20','311CWDMYP','Non-interactive\x20menu\x20sync\x20requires\x20--yes.','1267983NaGEHI','\x20menu(s)\x20created','Sync\x20local\x20pages\x20as\x20platform\x20menus','592BMCwjr','write','filter','trim','Menu\x20creation\x20failed','Failed\x20to\x20fetch\x20online\x20menu\x20list','Created\x20','length','Run\x20inside\x20a\x20directory\x20with\x20.rabetbase.json,\x20or\x20pass\x20--appcode\x20<code>.','yellow','cssUrl','324741YzbfRY','196090AMihJN','Would\x20create\x20','message','gray','\x20\x20Continue\x20with\x20creation?','\x20and\x20CSS:\x20','validation','menu','99LOctjX','\x20\x20Cancelled.','Fetching\x20online\x20menu\x20list...','\x20created,\x20','cookie','string','params','6431800vOEdBc','Preview\x20with\x20--dry-run,\x20then\x20reuse\x20the\x20same\x20--paths\x20and\x20--params\x20with\x20--yes.','8efRVfP','onlineMenuList','localPages','selectedAppName','Creating\x20','appCode','7jagLQU','Pre-fill\x20JS/CSS\x20URLs.\x20','\x20\x20Create\x20','/smartapi/menu/create','!\x20No\x20local\x20pages\x20found\x20in\x20src/pages','jsUrl','str','menu\x20sync\x20--paths\x20requires\x20--yes\x20for\x20execution.'];a134_0x2ebe=function(){return _0x55e2a8;};return a134_0x2ebe();}import a134_0x3fcd8d from'chalk';function a134_0x48a9(_0x4dff09,_0x5943ed){_0x4dff09=_0x4dff09-0x1af;const _0x2ebe11=a134_0x2ebe();let _0x48a9b7=_0x2ebe11[_0x4dff09];return _0x48a9b7;}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';import{getLocalPages}from'../../commands/menu/shared/local-pages.js';import{isInProject}from'../../context.js';export const menuSync={'service':a134_0x201f50(0x1eb),'command':a134_0x201f50(0x1c6),'description':a134_0x201f50(0x1d7),'risk':a134_0x201f50(0x1d9),'flags':[{'name':a134_0x201f50(0x1f2),'type':'string','description':a134_0x201f50(0x1b6)+'JSON:\x20{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}'},{'name':'paths','type':a134_0x201f50(0x1f1),'description':'Exact\x20comma-separated\x20local\x20page\x20paths\x20to\x20sync'},{'name':'yes','type':a134_0x201f50(0x1cf),'description':a134_0x201f50(0x1d0)}],async 'dryRun'(_0x20a8da){const _0x460881=a134_0x201f50;ensureRunnableContext(_0x20a8da['rawFlags'],_0x20a8da[_0x460881(0x1b2)]);const _0x283760=await runMenuSyncCore(_0x20a8da['appCode'],_0x20a8da[_0x460881(0x1f0)],parsePaths(_0x20a8da[_0x460881(0x1bb)](_0x460881(0x1d1))),_0x20a8da[_0x460881(0x1bb)]('params'),{'dryRun':!![]});return{'method':_0x460881(0x1c5),'url':_0x460881(0x1b8),'body':_0x283760,'description':_0x283760[_0x460881(0x1ca)]?'No\x20local\x20microfrontend\x20menus\x20would\x20be\x20created.':_0x460881(0x1e5)+_0x283760['targetPages'][_0x460881(0x1df)]+_0x460881(0x1cd)};},async 'execute'(_0x4f566d){const _0x24862f=a134_0x201f50;ensureRunnableContext(_0x4f566d['rawFlags'],_0x4f566d[_0x24862f(0x1b2)]);const _0x501b23=_0x4f566d[_0x24862f(0x1ce)]('yes'),_0x17bc0e=_0x4f566d['str'](_0x24862f(0x1f2)),_0x51881f=parsePaths(_0x4f566d[_0x24862f(0x1bb)](_0x24862f(0x1d1))),_0x530f48=parseMenuSyncParams(_0x17bc0e);if(_0x501b23){const _0x1329e7=await runMenuSyncCore(_0x4f566d['appCode'],_0x4f566d['cookie'],_0x51881f,_0x17bc0e);if(_0x1329e7['skipped']){const _0x36d61d=getLocalPages();_0x36d61d[_0x24862f(0x1df)]===0x0?writeCliSideChannelLine(_0x24862f(0x1b9)):writeCliSideChannelLine('✓\x20All\x20local\x20pages\x20are\x20already\x20on\x20platform');}else writeCliSideChannelLine(_0x24862f(0x1d2)+_0x1329e7[_0x24862f(0x1cc)]+_0x24862f(0x1d6));return{'ok':!![],'data':_0x1329e7,'message':_0x1329e7[_0x24862f(0x1ca)]?_0x24862f(0x1cb):_0x24862f(0x1c8)+_0x1329e7['created']+_0x24862f(0x1be)};}if(_0x51881f[_0x24862f(0x1df)]>0x0)throw CliErrors[_0x24862f(0x1ea)](_0x24862f(0x1bc),_0x24862f(0x1f4));if(!isInteractive()&&_0x17bc0e)throw CliErrors['validation'](_0x24862f(0x1d4),_0x24862f(0x1f4));requireInteractive();const _0x1f2094=startSpinner(_0x24862f(0x1ee));let _0x4cce82,_0x544c1f,_0x42f8c7;try{const _0x426e40=await fetchMenuData(_0x4f566d[_0x24862f(0x1b4)],_0x4f566d[_0x24862f(0x1f0)]);_0x4cce82=_0x426e40[_0x24862f(0x1b1)],_0x544c1f=_0x426e40['onlinePaths'],_0x42f8c7=_0x426e40[_0x24862f(0x1b0)],stopSpinner(_0x1f2094,'Online\x20menu\x20list\x20fetched',!![]);}catch(_0x5debc5){stopSpinner(_0x1f2094,_0x24862f(0x1dd),![]);throw CliErrors['validation'](_0x5debc5 instanceof Error?_0x5debc5[_0x24862f(0x1e6)]:'Failed\x20to\x20fetch\x20online\x20menu\x20list');}if(_0x4cce82[_0x24862f(0x1df)]===0x0)return writeCliSideChannelLine(a134_0x3fcd8d[_0x24862f(0x1e1)](_0x24862f(0x1bd))),{'ok':!![]};const _0x52f74e=buildCompareRows(_0x4cce82,_0x544c1f);writeCliSideChannelLine(renderCompareTable(_0x52f74e)),writeCliSideChannelLine('');const _0x11abf2=await selectPages(_0x4cce82,_0x544c1f);writeCliSideChannelLine(''),writeCliSideChannelLine(a134_0x3fcd8d[_0x24862f(0x1c0)]('\x20\x20✓\x20Selected:\x20'+_0x11abf2[_0x24862f(0x1df)]+'\x20page(s)'));const _0x48da1c=_0x530f48[_0x24862f(0x1ba)]&&_0x530f48[_0x24862f(0x1e2)];if(!_0x48da1c){writeCliSideChannelLine(renderSyncSummary(_0x11abf2,_0x544c1f[_0x24862f(0x1c9)]>0x0));const _0x576cdf=await askConfirm(_0x24862f(0x1e8));if(!_0x576cdf)return writeCliSideChannelLine(a134_0x3fcd8d[_0x24862f(0x1e7)](_0x24862f(0x1ed))),{'ok':!![]};}let _0x5a2d99=_0x530f48[_0x24862f(0x1ba)],_0x2b1ea3=_0x530f48[_0x24862f(0x1e2)];!_0x5a2d99&&(_0x5a2d99=await askJsUrl());!_0x2b1ea3&&(_0x2b1ea3=await askCssUrl());const _0x34f510=await askConfirm(_0x24862f(0x1b7)+_0x11abf2[_0x24862f(0x1df)]+'\x20menu(s)\x20with\x20JS:\x20'+_0x5a2d99+_0x24862f(0x1e9)+_0x2b1ea3+'?');if(!_0x34f510)return writeCliSideChannelLine(a134_0x3fcd8d[_0x24862f(0x1e7)](_0x24862f(0x1ed))),{'ok':!![]};const _0x40346f=[_0x5a2d99,_0x2b1ea3],_0x46dfaf=startSpinner(_0x24862f(0x1b3)+_0x11abf2[_0x24862f(0x1df)]+'\x20menu(s)...');try{const _0x1533b7=await doCreateMenus(_0x4f566d['appCode'],_0x4f566d['cookie'],_0x11abf2,_0x40346f);return stopSpinner(_0x46dfaf,_0x24862f(0x1de)+_0x1533b7[_0x24862f(0x1cc)]+_0x24862f(0x1c3),!![]),{'ok':!![],'data':_0x1533b7,'message':_0x24862f(0x1c8)+_0x1533b7[_0x24862f(0x1cc)]+_0x24862f(0x1ef)+_0x1533b7['failed']+'\x20failed.'};}catch(_0x252af5){stopSpinner(_0x46dfaf,_0x24862f(0x1dc),![]);throw CliErrors['validation'](_0x252af5 instanceof Error?_0x252af5[_0x24862f(0x1e6)]:'Menu\x20creation\x20failed');}}};function ensureRunnableContext(_0x414564,_0x33d4c9){const _0x425900=a134_0x201f50,_0x2d389c=_0x414564[_0x425900(0x1bf)]?String(_0x414564['appcode'])[_0x425900(0x1db)]():'';if(!isInProject()&&!_0x33d4c9&&!_0x2d389c)throw CliErrors[_0x425900(0x1ea)]('menu\x20sync\x20requires\x20a\x20project\x20context\x20or\x20explicit\x20--appcode.\x20'+_0x425900(0x1e0));}function parsePaths(_0x251762){const _0x262359=a134_0x201f50;return[...new Set(_0x251762['split'](',')[_0x262359(0x1c2)](_0x96f428=>_0x96f428['trim']())[_0x262359(0x1da)](Boolean))];}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a135_0x461eec=a135_0x247f;function a135_0x3776(){const _0x4fdd60=['Exact\x20comma-separated\x20menu\x20paths\x20to\x20update','294GzDLxM','\x20unchanged\x20menu(s).','368487JeyoPe','\x20failed.','appCode','update\x20visibility\x20for','menu\x20visibility-update\x20requires\x20--menu-ids\x20or\x20--paths.','Every\x20selected\x20menu\x20already\x20has\x20the\x20requested\x20visibility;\x20no\x20write\x20is\x20needed.','1595046odrQuE','Run\x20`rabetbase\x20menu\x20list\x20--format\x20compress`\x20and\x20use\x20exact\x20current\x20ids.','true','276568YygvsY','Menu\x20','recovered','menu_state_drift','menu\x20list','Run\x20`rabetbase\x20menu\x20list\x20--format\x20compress`\x20and\x20use\x20an\x20exact\x20current\x20path.','update-menu-visibility','validation','message','paths','beforeById','expected-count','Run\x20the\x20command\x20with\x20--dry-run\x20again\x20and\x20update\x20--expected-count.','filter','childrenIds','One\x20or\x20more\x20updates\x20may\x20have\x20changed\x20fields\x20outside\x20visibility;\x20inspect\x20current\x20menu\x20facts\x20before\x20retrying.','childrenCount','updated','\x20skipped,\x20','Use\x20--menu-ids\x20with\x20one\x20or\x20more\x20of:\x20','\x20updated,\x20','resourcesValid','Menu\x20path\x20selector\x20matched\x20multiple\x20menus:\x20','verify\x20menu\x20visibility\x20update','Inspect\x20current\x20menu\x20facts\x20before\x20retrying\x20any\x20target.','627012IONzvS','menu','type','requestedVisible','stringify','192Mcjcvr','num','sort','rabetbase\x20menu\x20list\x20--format\x20compress','menu-ids','visible','path','menu_selector_not_found','menus','warnings','expect-visible','datasetCode','Selected\x20','split','POST','set','resources','pageType','\x20was\x20not\x20found\x20during\x20visibility\x20verification.','cookie','datasetId','\x20changed\x20unexpectedly.','expectedCount','plan','menu_expected_count_mismatch','length','update\x20menu\x20visibility','Response\x20was\x20lost\x20for\x20menu\x20','update-recovery','Abort\x20unless\x20the\x20exact\x20number\x20of\x20selected\x20menus\x20matches','targets','\x20must\x20be\x20true\x20or\x20false.','Response\x20was\x20lost\x20and\x20menu\x20','Failed\x20update\x20requests\x20were\x20not\x20retried;\x20inspect\x20current\x20menu\x20facts\x20before\x20retrying.','\x20and\x20final\x20state\x20could\x20not\x20be\x20read.','5oPOuad','plannedActions','visibility-update','menu_selector_ambiguous','\x20visibility\x20could\x20not\x20be\x20verified\x20safely','has','\x20menu(s);\x20skipped\x20','modelType','flagMissing','--expected-count\x20must\x20be\x20a\x20non-negative\x20integer.','depth','code','isArray','byId','/smartapi/menu/update','before','boolean','get','menu_verification_failed','str','Menu\x20visibility\x20update\x20could\x20not\x20be\x20verified\x20for\x20id(s):\x20','parentId','number','body','Visibility\x20update\x20requests\x20completed\x20but\x20readback\x20could\x20not\x20confirm\x20the\x20requested\x20state','hash','32058qJGhKW','menuIds','26826RPOUtM','--menu-ids\x20must\x20contain\x20positive\x20safe\x20integers.','verification','3650610JyJbiR','Menu\x20id\x20selector(s)\x20not\x20found:\x20','push','expectVisible','Menu\x20path\x20selector\x20not\x20found:\x20','failed','string','map','pageId','join','label','some','isSafeInteger','values','high-risk-write','false','Exact\x20comma-separated\x20menu\x20IDs\x20to\x20update','\x20visible\x20did\x20not\x20match\x20the\x20requested\x20state.'];a135_0x3776=function(){return _0x4fdd60;};return a135_0x3776();}(function(_0x3eb2eb,_0xb3ca19){const _0x4e311a=a135_0x247f,_0x1776b4=_0x3eb2eb();while(!![]){try{const _0x5995c5=parseInt(_0x4e311a(0x72))/0x1+-parseInt(_0x4e311a(0x92))/0x2+-parseInt(_0x4e311a(0xae))/0x3+parseInt(_0x4e311a(0x95))/0x4*(-parseInt(_0x4e311a(0xd6))/0x5)+-parseInt(_0x4e311a(0x74))/0x6*(-parseInt(_0x4e311a(0x8a))/0x7)+-parseInt(_0x4e311a(0xb3))/0x8*(-parseInt(_0x4e311a(0x8c))/0x9)+parseInt(_0x4e311a(0x77))/0xa;if(_0x5995c5===_0xb3ca19)break;else _0x1776b4['push'](_0x1776b4['shift']());}catch(_0x3fbe74){_0x1776b4['push'](_0x1776b4['shift']());}}}(a135_0x3776,0x78158));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{fetchMenuSnapshot}from'../../commands/menu/shared/facts.js';function a135_0x247f(_0x44654b,_0x3d8775){_0x44654b=_0x44654b-0x6e;const _0x377618=a135_0x3776();let _0x247fb9=_0x377618[_0x44654b];return _0x247fb9;}import{asVerificationError,assertVerified,describeMenuErrorCause,fetchMutationSnapshot,hasFlag,isMenuResponseLoss,mapMenuApiError,menuDryRunResult,menuError,menuFailure,mutationResult,recheckMutationSnapshot,requireExplicitYes}from'../../commands/menu/shared/mutations.js';import{updateMenuEntity}from'../../commands/menu/shared/service.js';import{CliErrors}from'../../errors.js';const BACKEND=[{'method':a135_0x461eec(0xc1),'path':a135_0x461eec(0xe4)}];export const menuVisibilityUpdate={'service':a135_0x461eec(0xaf),'command':a135_0x461eec(0xd8),'description':'Set\x20exact\x20menus\x20visible\x20or\x20hidden\x20without\x20changing\x20their\x20routes\x20or\x20resources','risk':a135_0x461eec(0x85),'structuredErrors':!![],'flags':[{'name':a135_0x461eec(0xb7),'type':'string','description':a135_0x461eec(0x87)},{'name':a135_0x461eec(0x9e),'type':a135_0x461eec(0x7d),'description':a135_0x461eec(0x89)},{'name':'visible','type':a135_0x461eec(0xe6),'required':!![],'description':'Requested\x20menu\x20visibility'},{'name':a135_0x461eec(0xbd),'type':a135_0x461eec(0xe6),'description':'Abort\x20unless\x20every\x20selected\x20menu\x20has\x20this\x20visibility'},{'name':'expected-count','type':a135_0x461eec(0x6e),'description':a135_0x461eec(0xd0)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x21bec5){parseInput(_0x21bec5),requireExplicitYes(_0x21bec5);},async 'dryRun'(_0x19fac3){const _0x207901=a135_0x461eec,_0x792ee8=await buildPlan(_0x19fac3,!![]),_0x4a9b6d=_0x792ee8[_0x207901(0xca)][_0x207901(0xd7)]?.['length']??0x0,_0x124aff=_0x792ee8[_0x207901(0xca)]['targets'][_0x207901(0xcc)]-_0x4a9b6d;return menuDryRunResult(_0x792ee8[_0x207901(0xca)],{'method':_0x207901(0xc1),'url':_0x207901(0xe4),'body':{'updates':_0x792ee8[_0x207901(0xca)][_0x207901(0xd7)]?.['map'](_0x437ab8=>_0x437ab8[_0x207901(0x6f)])??[]},'description':'Would\x20update\x20visibility\x20for\x20'+_0x4a9b6d+'\x20menu(s);\x20skip\x20'+_0x124aff+_0x207901(0x8b)});},async 'execute'(_0xb6f688){const _0x349c16=a135_0x461eec;requireExplicitYes(_0xb6f688);const _0x1b982e=await buildPlan(_0xb6f688,![]);await recheckMutationSnapshot(_0xb6f688,_0x1b982e[_0x349c16(0xca)],_0x349c16(0xcd));const _0x5c4237=[],_0x37182f=[],_0xd663e=[];for(const _0x56efcd of _0x1b982e[_0x349c16(0xca)][_0x349c16(0xd1)]){if(_0x56efcd[_0x349c16(0xe5)][_0x349c16(0xb8)]===_0x1b982e['plan'][_0x349c16(0xb1)]){_0x5c4237['push']({'id':_0x56efcd['id'],'updated':![],'skipped':!![]});continue;}try{await updateMenuEntity(_0xb6f688[_0x349c16(0x8e)],_0xb6f688['cookie'],{'id':_0x56efcd['id'],'visible':_0x1b982e[_0x349c16(0xca)][_0x349c16(0xb1)]}),_0x5c4237['push']({'id':_0x56efcd['id'],'updated':!![],'skipped':![]});}catch(_0xbfa55e){const _0x319936=mapMenuApiError(_0xbfa55e,_0x349c16(0x8f),_0x56efcd['id']);if(isMenuResponseLoss(_0xbfa55e)&&_0x319936[_0x349c16(0xe1)]!=='menu_permission_denied'){_0xd663e[_0x349c16(0x79)](_0x56efcd['id']);continue;}_0x37182f[_0x349c16(0x79)]({'id':_0x56efcd['id'],'stage':'update','code':_0x319936[_0x349c16(0xe1)],'message':_0x319936[_0x349c16(0x9d)]});}}let _0x432e6c;try{_0x432e6c=await fetchMenuSnapshot(_0xb6f688[_0x349c16(0x8e)],_0xb6f688[_0x349c16(0xc6)]);}catch(_0x46fbe6){const _0x45a3cb=describeMenuErrorCause(_0x46fbe6,_0x349c16(0xac)),_0x18135f=_0xd663e[_0x349c16(0x7e)](_0x4f9ac6=>({'id':_0x4f9ac6,'stage':'update-recovery','code':_0x349c16(0xe8),'message':_0x349c16(0xce)+_0x4f9ac6+_0x349c16(0xd5),'requestedStateConfirmed':![],'recovered':![]})),_0x489dee={'stage':_0x349c16(0x76),'code':_0x349c16(0xe8),'message':'Final\x20menu\x20visibility\x20readback\x20failed.','targetIds':_0x1b982e['plan'][_0x349c16(0xd1)][_0x349c16(0x7e)](_0x404d7c=>_0x404d7c['id']),'requestedStateConfirmed':![],..._0x45a3cb};throw menuFailure(asVerificationError(_0x46fbe6,_0x349c16(0x70)),_0x1b982e[_0x349c16(0xca)],{'stage':_0x349c16(0x76),'succeeded':_0x5c4237,'failedRecords':[..._0x37182f,..._0x18135f,_0x489dee],'warnings':['The\x20update\x20may\x20have\x20taken\x20effect;\x20inspect\x20the\x20latest\x20menu\x20facts\x20before\x20retrying.'],'verification':{'status':_0x349c16(0x7c),'recoveredCount':0x0,'lookupCommand':_0x349c16(0xb6)}});}const _0x31cf78=[];for(const _0x1d28e9 of _0x5c4237){const _0x33ce34=Number(_0x1d28e9['id']),_0x47eb80=_0x1b982e[_0x349c16(0x9f)][_0x349c16(0xe7)](_0x33ce34),_0x4efbae=_0x432e6c[_0x349c16(0xe3)][_0x349c16(0xe7)](_0x33ce34);try{verifyVisibilityUpdate(_0x47eb80,_0x4efbae,_0x1b982e[_0x349c16(0xca)]['requestedVisible']);}catch(_0x132ba0){const _0x290037=asVerificationError(_0x132ba0,_0x349c16(0x96)+_0x33ce34+'\x20visibility\x20update\x20could\x20not\x20be\x20verified');_0x31cf78[_0x349c16(0x79)]({'id':_0x33ce34,'stage':_0x349c16(0x76),'code':_0x290037[_0x349c16(0xe1)],'message':_0x290037[_0x349c16(0x9d)],'requestedStateConfirmed':![]});}}for(const _0x59f2af of _0xd663e){const _0x22b6cb=_0x1b982e[_0x349c16(0x9f)]['get'](_0x59f2af),_0x4072f0=_0x432e6c[_0x349c16(0xe3)]['get'](_0x59f2af);try{verifyVisibilityUpdate(_0x22b6cb,_0x4072f0,_0x1b982e['plan']['requestedVisible']),_0x5c4237[_0x349c16(0x79)]({'id':_0x59f2af,'updated':!![],'skipped':![],'recovered':!![]});}catch(_0x17a6cf){const _0x45408f=asVerificationError(_0x17a6cf,_0x349c16(0xd3)+_0x59f2af+_0x349c16(0xda));_0x31cf78[_0x349c16(0x79)]({'id':_0x59f2af,'stage':_0x349c16(0xcf),'code':_0x45408f[_0x349c16(0xe1)],'message':_0x45408f[_0x349c16(0x9d)],'requestedStateConfirmed':![],'recovered':![]});}}if(_0x31cf78[_0x349c16(0xcc)]>0x0){const _0x44573b=_0x31cf78[_0x349c16(0x7e)](_0x55a78c=>Number(_0x55a78c['id'])),_0x297a80=_0x5c4237[_0x349c16(0xa2)](_0x1ab595=>_0x1ab595[_0x349c16(0x97)]===!![])[_0x349c16(0xcc)],_0x5e4772=menuError(_0x349c16(0xe8),_0x349c16(0xea)+_0x44573b['join'](',\x20')+'.',_0x349c16(0xad));throw menuFailure(_0x5e4772,_0x1b982e[_0x349c16(0xca)],{'stage':_0x349c16(0x76),'succeeded':_0x5c4237,'failedRecords':[..._0x37182f,..._0x31cf78],'warnings':[_0x349c16(0xa4)],'verification':{'status':'failed',..._0x44573b['length']===0x1?{'targetId':_0x44573b[0x0]}:{'targetIds':_0x44573b},'recoveredCount':_0x297a80,'lookupCommand':_0x349c16(0xb6)}});}const _0x599066=_0x5c4237[_0x349c16(0xa2)](_0x116ce9=>_0x116ce9[_0x349c16(0xa6)]===!![])[_0x349c16(0xcc)],_0x396f4e=_0x5c4237[_0x349c16(0xcc)]-_0x599066,_0x81e03a={..._0x1b982e[_0x349c16(0xca)],'succeeded':_0x5c4237,'failed':_0x37182f,'warnings':_0x37182f[_0x349c16(0xcc)]>0x0?[..._0x1b982e['plan'][_0x349c16(0xbc)],_0x349c16(0xd4)]:_0x1b982e[_0x349c16(0xca)][_0x349c16(0xbc)],'verification':{'checkedBy':_0x349c16(0x99),'snapshotHash':_0x432e6c[_0x349c16(0x71)],'matchesRequestedState':_0x37182f[_0x349c16(0xcc)]===0x0,'recoveredCount':_0xd663e['length']}};return{'ok':_0x37182f[_0x349c16(0xcc)]===0x0,'data':_0x81e03a,'message':_0x37182f[_0x349c16(0xcc)]===0x0?'Updated\x20visibility\x20for\x20'+_0x599066+_0x349c16(0xdc)+_0x396f4e+_0x349c16(0x8b):'Menu\x20visibility\x20update\x20completed:\x20'+_0x599066+_0x349c16(0xa9)+_0x396f4e+_0x349c16(0xa7)+_0x37182f[_0x349c16(0xcc)]+_0x349c16(0x8d)};}};function parseInput(_0x51f9d1){const _0x1c273d=a135_0x461eec,_0x278771=parseMenuIds(_0x51f9d1[_0x1c273d(0xe9)]('menu-ids')),_0x4adcc6=parseCsv(_0x51f9d1[_0x1c273d(0xe9)]('paths'));if(_0x278771[_0x1c273d(0xcc)]===0x0&&_0x4adcc6[_0x1c273d(0xcc)]===0x0)throw CliErrors[_0x1c273d(0x9c)](_0x1c273d(0x90));const _0x3a4d5b=parseBooleanFlag(_0x51f9d1,'visible',!![]),_0x51c66e=parseBooleanFlag(_0x51f9d1,_0x1c273d(0xbd),![]);let _0x57ccea;if(hasFlag(_0x51f9d1,_0x1c273d(0xa0))){_0x57ccea=_0x51f9d1[_0x1c273d(0xb4)]('expected-count');if(!Number[_0x1c273d(0x83)](_0x57ccea)||_0x57ccea<0x0)throw CliErrors[_0x1c273d(0x9c)](_0x1c273d(0xdf));}return{'menuIds':_0x278771,'paths':_0x4adcc6,'visible':_0x3a4d5b,'expectVisible':_0x51c66e,'expectedCount':_0x57ccea};}async function buildPlan(_0x1971c5,_0x22ea98){const _0x36a876=a135_0x461eec,_0x28dec3=parseInput(_0x1971c5),_0x1adae3=await fetchMutationSnapshot(_0x1971c5,_0x36a876(0xcd)),_0x4c0a19=selectTargets(_0x1adae3[_0x36a876(0xbb)],_0x28dec3['menuIds'],_0x28dec3['paths']);if(_0x28dec3[_0x36a876(0xc9)]!==undefined&&_0x4c0a19[_0x36a876(0xcc)]!==_0x28dec3[_0x36a876(0xc9)])throw menuError(_0x36a876(0xcb),_0x36a876(0xbf)+_0x4c0a19[_0x36a876(0xcc)]+'\x20menu(s),\x20expected\x20'+_0x28dec3[_0x36a876(0xc9)]+'.',_0x36a876(0xa1));if(_0x28dec3[_0x36a876(0x7a)]!==undefined){const _0x84ddd6=_0x4c0a19[_0x36a876(0xa2)](_0x52b0c5=>_0x52b0c5[_0x36a876(0xb8)]!==_0x28dec3[_0x36a876(0x7a)]);if(_0x84ddd6[_0x36a876(0xcc)]>0x0)throw menuError(_0x36a876(0x98),'Selected\x20menu\x20visibility\x20changed\x20for\x20id(s):\x20'+_0x84ddd6[_0x36a876(0x7e)](_0x1e9cb7=>_0x1e9cb7['id'])['join'](',\x20')+'.','Run\x20the\x20command\x20with\x20--dry-run\x20again\x20and\x20update\x20--expect-visible.');}const _0x1c41a6=_0x4c0a19[_0x36a876(0x7e)](_0xf873dc=>({'id':_0xf873dc['id'],'label':_0xf873dc[_0x36a876(0x81)],'path':_0xf873dc[_0x36a876(0xb9)],'before':{'visible':_0xf873dc[_0x36a876(0xb8)]},'after':{'visible':_0x28dec3['visible']}})),_0x7fd66c=_0x1c41a6[_0x36a876(0xa2)](_0x2e9b64=>_0x2e9b64['before'][_0x36a876(0xb8)]!==_0x28dec3['visible'])['map'](_0x190de1=>({'stage':_0x36a876(0x9b),'method':_0x36a876(0xc1),'path':_0x36a876(0xe4),'body':{'appCode':_0x1971c5[_0x36a876(0x8e)],'id':_0x190de1['id'],'visible':_0x28dec3[_0x36a876(0xb8)]}})),_0x958d25=mutationResult({'operation':_0x36a876(0xd8),'selector':{'menuIds':_0x28dec3[_0x36a876(0x73)],'paths':_0x28dec3['paths']},'before':{'menus':_0x4c0a19[_0x36a876(0x7e)](_0x489811=>({'id':_0x489811['id'],'path':_0x489811[_0x36a876(0xb9)],'visible':_0x489811['visible']}))},'after':{'menus':_0x4c0a19['map'](_0x5ac948=>({'id':_0x5ac948['id'],'path':_0x5ac948['path'],'visible':_0x28dec3[_0x36a876(0xb8)]}))},'dryRun':_0x22ea98,'backend':[...BACKEND],'plannedActions':_0x7fd66c,'snapshotHash':_0x1adae3['hash'],'warnings':_0x7fd66c[_0x36a876(0xcc)]===0x0?[_0x36a876(0x91)]:[]});return{'plan':{..._0x958d25,'requestedVisible':_0x28dec3[_0x36a876(0xb8)],'targets':_0x1c41a6},'beforeById':new Map(_0x4c0a19[_0x36a876(0x7e)](_0x357135=>[_0x357135['id'],_0x357135]))};}function selectTargets(_0x6d4a34,_0x2f10f3,_0x559155){const _0xe7e6fd=a135_0x461eec,_0x440371=new Map(_0x6d4a34[_0xe7e6fd(0x7e)](_0x398ffe=>[_0x398ffe['id'],_0x398ffe])),_0x515670=new Map(),_0x409366=_0x2f10f3[_0xe7e6fd(0xa2)](_0x5d0bfd=>!_0x440371[_0xe7e6fd(0xdb)](_0x5d0bfd));if(_0x409366[_0xe7e6fd(0xcc)]>0x0)throw menuError(_0xe7e6fd(0xba),_0xe7e6fd(0x78)+_0x409366['join'](',\x20')+'.',_0xe7e6fd(0x93));for(const _0x5259c7 of _0x2f10f3){_0x515670[_0xe7e6fd(0xc2)](_0x5259c7,_0x440371['get'](_0x5259c7));}for(const _0x3d756a of _0x559155){const _0x4b67a1=_0x6d4a34['filter'](_0x271d8b=>_0x271d8b[_0xe7e6fd(0xb9)]===_0x3d756a);if(_0x4b67a1[_0xe7e6fd(0xcc)]===0x0)throw menuError(_0xe7e6fd(0xba),_0xe7e6fd(0x7b)+JSON['stringify'](_0x3d756a)+'.',_0xe7e6fd(0x9a));if(_0x4b67a1['length']>0x1)throw menuError(_0xe7e6fd(0xd9),_0xe7e6fd(0xab)+JSON[_0xe7e6fd(0xb2)](_0x3d756a)+'.',_0xe7e6fd(0xa8)+_0x4b67a1[_0xe7e6fd(0x7e)](_0x3f5e8d=>_0x3f5e8d['id'])[_0xe7e6fd(0x80)](',\x20')+'.');const _0x23fa41=_0x4b67a1[0x0];_0x515670[_0xe7e6fd(0xc2)](_0x23fa41['id'],_0x23fa41);}return[..._0x515670[_0xe7e6fd(0x84)]()];}function parseMenuIds(_0x28253a){const _0x3ebe0c=a135_0x461eec,_0x1891f0=parseCsv(_0x28253a),_0x361faa=_0x1891f0[_0x3ebe0c(0x7e)](Number);if(_0x361faa[_0x3ebe0c(0x82)](_0x18a43b=>!Number[_0x3ebe0c(0x83)](_0x18a43b)||_0x18a43b<=0x0))throw CliErrors['validation'](_0x3ebe0c(0x75));return[...new Set(_0x361faa)];}function parseCsv(_0x2dd719){const _0x255045=a135_0x461eec;return[...new Set(_0x2dd719[_0x255045(0xc0)](',')[_0x255045(0x7e)](_0x4ad687=>_0x4ad687['trim']())['filter'](Boolean))];}function parseBooleanFlag(_0x2f58eb,_0x313263,_0x3a6ddc){const _0x59e4ca=a135_0x461eec;if(!hasFlag(_0x2f58eb,_0x313263)){if(_0x3a6ddc)throw CliErrors[_0x59e4ca(0xde)](_0x313263);return undefined;}const _0x123890=_0x2f58eb['rawFlags'][_0x313263];if(_0x123890===!![]||_0x123890===![])return _0x123890;if(_0x123890===_0x59e4ca(0x94))return!![];if(_0x123890===_0x59e4ca(0x86))return![];throw CliErrors[_0x59e4ca(0x9c)]('--'+_0x313263+_0x59e4ca(0xd2));}function verifyVisibilityUpdate(_0x2f9ce4,_0x1e735f,_0x261bcc){const _0x2eb79b=a135_0x461eec;assertVerified(!!_0x1e735f,'Menu\x20'+_0x2f9ce4['id']+_0x2eb79b(0xc5)),assertVerified(_0x1e735f[_0x2eb79b(0xb8)]===_0x261bcc,_0x2eb79b(0x96)+_0x2f9ce4['id']+_0x2eb79b(0x88));const _0x2c8871=[['id',_0x1e735f['id'],_0x2f9ce4['id']],[_0x2eb79b(0xeb),_0x1e735f['parentId'],_0x2f9ce4[_0x2eb79b(0xeb)]],[_0x2eb79b(0xe0),_0x1e735f[_0x2eb79b(0xe0)],_0x2f9ce4[_0x2eb79b(0xe0)]],[_0x2eb79b(0x81),_0x1e735f[_0x2eb79b(0x81)],_0x2f9ce4[_0x2eb79b(0x81)]],[_0x2eb79b(0xb9),_0x1e735f['path'],_0x2f9ce4[_0x2eb79b(0xb9)]],['url',_0x1e735f['url'],_0x2f9ce4['url']],[_0x2eb79b(0xb0),_0x1e735f[_0x2eb79b(0xb0)],_0x2f9ce4['type']],[_0x2eb79b(0xb5),_0x1e735f['sort'],_0x2f9ce4[_0x2eb79b(0xb5)]],[_0x2eb79b(0xc3),_0x1e735f['resources'],_0x2f9ce4['resources']],['resourcesValid',_0x1e735f[_0x2eb79b(0xaa)],_0x2f9ce4[_0x2eb79b(0xaa)]],[_0x2eb79b(0xa3),_0x1e735f[_0x2eb79b(0xa3)],_0x2f9ce4[_0x2eb79b(0xa3)]],['childrenCount',_0x1e735f[_0x2eb79b(0xa5)],_0x2f9ce4[_0x2eb79b(0xa5)]],['pageId',_0x1e735f[_0x2eb79b(0x7f)],_0x2f9ce4[_0x2eb79b(0x7f)]],['pageType',_0x1e735f[_0x2eb79b(0xc4)],_0x2f9ce4['pageType']],[_0x2eb79b(0xdd),_0x1e735f[_0x2eb79b(0xdd)],_0x2f9ce4[_0x2eb79b(0xdd)]],[_0x2eb79b(0xc7),_0x1e735f[_0x2eb79b(0xc7)],_0x2f9ce4['datasetId']],[_0x2eb79b(0xbe),_0x1e735f['datasetCode'],_0x2f9ce4[_0x2eb79b(0xbe)]]];for(const [_0x38616a,_0x233bd3,_0x2cdb58]of _0x2c8871){assertVerified(sameValue(_0x233bd3,_0x2cdb58),'Menu\x20'+_0x2f9ce4['id']+'\x20'+_0x38616a+_0x2eb79b(0xc8));}}function sameValue(_0x47fe14,_0x1ac27b){const _0x14363b=a135_0x461eec;if(Array[_0x14363b(0xe2)](_0x47fe14)||Array[_0x14363b(0xe2)](_0x1ac27b))return JSON[_0x14363b(0xb2)](_0x47fe14)===JSON[_0x14363b(0xb2)](_0x1ac27b);return _0x47fe14===_0x1ac27b;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a136_0x2d04c6=a136_0x301d;function a136_0x301d(_0x2af32e,_0x207557){_0x2af32e=_0x2af32e-0xd4;const _0x291ec6=a136_0x291e();let _0x301d35=_0x291ec6[_0x2af32e];return _0x301d35;}(function(_0x14788a,_0x25f278){const _0xf48a2=a136_0x301d,_0x100377=_0x14788a();while(!![]){try{const _0x26b43e=-parseInt(_0xf48a2(0xed))/0x1+-parseInt(_0xf48a2(0xd6))/0x2*(parseInt(_0xf48a2(0xea))/0x3)+parseInt(_0xf48a2(0xd7))/0x4*(-parseInt(_0xf48a2(0xeb))/0x5)+-parseInt(_0xf48a2(0xdf))/0x6*(parseInt(_0xf48a2(0xdb))/0x7)+-parseInt(_0xf48a2(0xe7))/0x8+-parseInt(_0xf48a2(0xda))/0x9*(-parseInt(_0xf48a2(0xe1))/0xa)+parseInt(_0xf48a2(0xe4))/0xb*(parseInt(_0xf48a2(0xe0))/0xc);if(_0x26b43e===_0x25f278)break;else _0x100377['push'](_0x100377['shift']());}catch(_0x31629a){_0x100377['push'](_0x100377['shift']());}}}(a136_0x291e,0x4151f));import{asDryRunResult}from'../../commands/common/dry-run.js';import{createNotificationChannelConfig,getNotificationChannelConfig,isPlatformTransportFailure}from'../../core/api-client.js';function a136_0x291e(){const _0x1bb211=['12mqnxqb','3110MttycM',';\x20do\x20not\x20resubmit.','Notification\x20config\x20create\x20outcome\x20is\x20unknown\x20because\x20no\x20server\x20ID\x20was\x20received.','10047917WKgHag','endpointUrl','verified','133688KFfPQp','Notification\x20config\x20create\x20returned\x20no\x20usable\x20server\x20ID.','Inspect\x20with\x20','11031fhsFVs','300305uEonCY',';\x20no\x20automatic\x20retry\x20was\x20attempted.','217040nTxrRr','appCode','config-create','mutation','Created\x20notification\x20config\x20','document','configName','notification_config_create_outcome_unknown','channelType','notification','36JwyWvq','4AVSLKr',';\x20do\x20not\x20resubmit\x20automatically.','create','549OOwVXr','2134083UdtOdd','POST','input','planned','6KpvRfS'];a136_0x291e=function(){return _0x1bb211;};return a136_0x291e();}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='/notification/channel-config/create';async function prepareCreate(_0x1d7f1f){const _0x1afcb1=a136_0x301d,_0x1164f3=await readNotificationDocument(_0x1d7f1f,_0x1afcb1(0xd9)),_0x267bc9=createMutationInput(_0x1d7f1f[_0x1afcb1(0xee)],_0x1164f3);return{'document':_0x1164f3,'input':_0x267bc9,'planned':projectNotificationConfig({'appCode':_0x1d7f1f[_0x1afcb1(0xee)],'configName':_0x1164f3[_0x1afcb1(0xf3)],'channelType':_0x1164f3[_0x1afcb1(0xd4)],'endpointUrl':_0x1164f3[_0x1afcb1(0xe5)],'channelConfig':_0x1164f3['channelConfig'],'description':_0x1164f3['description'],'connectTimeout':_0x1164f3['connectTimeout']??DEFAULT_NOTIFICATION_CONNECT_TIMEOUT,'readTimeout':_0x1164f3['readTimeout']??DEFAULT_NOTIFICATION_READ_TIMEOUT})};}export const notificationConfigCreate={'service':a136_0x2d04c6(0xd5),'command':a136_0x2d04c6(0xef),'description':'Create\x20an\x20app-level\x20notification\x20config\x20from\x20a\x20secure\x20JSON\x20source','risk':'write','requiresAppCode':!![],'structuredErrors':!![],'flags':[...NOTIFICATION_INPUT_FLAGS,NOTIFICATION_APP_FLAG],async 'validate'(_0x2edefc){assertSingleNotificationSource(_0x2edefc);},async 'dryRun'(_0x19fc98){const _0x2dfe03=a136_0x2d04c6,_0x2545d2=await prepareCreate(_0x19fc98),_0x30c141=notificationLookupCommand(_0x19fc98['appCode'],_0x2545d2[_0x2dfe03(0xf2)][_0x2dfe03(0xd4)]);return asDryRunResult({'operation':_0x2dfe03(0xd9),'selector':{'appCode':_0x19fc98[_0x2dfe03(0xee)],'configName':_0x2545d2[_0x2dfe03(0xf2)][_0x2dfe03(0xf3)],'channelType':_0x2545d2[_0x2dfe03(0xf2)][_0x2dfe03(0xd4)]},'before':null,'after':_0x2545d2[_0x2dfe03(0xde)],'dryRun':!![],'backend':{'method':_0x2dfe03(0xdc),'path':CREATE_PATH},'warnings':[],'verification':{'status':_0x2dfe03(0xde),'lookupCommand':_0x30c141}},{'method':_0x2dfe03(0xdc),'url':CREATE_PATH});},async 'execute'(_0x2156ad){const _0x2d77fa=a136_0x2d04c6,_0x260019=await prepareCreate(_0x2156ad),_0x3a5bd0=notificationLookupCommand(_0x2156ad[_0x2d77fa(0xee)],_0x260019[_0x2d77fa(0xf2)][_0x2d77fa(0xd4)]);let _0x1e7730;try{_0x1e7730=await createNotificationChannelConfig(_0x260019[_0x2d77fa(0xdd)]);}catch(_0x2b0a55){if(isPlatformTransportFailure(_0x2b0a55))throw notificationError(_0x2d77fa(0xf4),_0x2d77fa(0xe3),_0x2d77fa(0xe9)+_0x3a5bd0+_0x2d77fa(0xe2));throw safeApiFailure('create',_0x2d77fa(0xf0),'Inspect\x20with\x20'+_0x3a5bd0+_0x2d77fa(0xec));}if(!Number['isSafeInteger'](_0x1e7730)||_0x1e7730<=0x0)throw notificationError(_0x2d77fa(0xf4),_0x2d77fa(0xe8),_0x2d77fa(0xe9)+_0x3a5bd0+';\x20do\x20not\x20resubmit.');let _0x1c507b;try{const _0x2e4876=await getNotificationChannelConfig(_0x1e7730,_0x2156ad['appCode']);_0x1c507b=normalizeExactNotificationConfig(_0x2e4876,_0x1e7730,_0x2156ad[_0x2d77fa(0xee)]);}catch{throw safeApiFailure(_0x2d77fa(0xd9),'verification',_0x2d77fa(0xe9)+_0x3a5bd0+_0x2d77fa(0xd8));}return{'ok':!![],'data':{'operation':_0x2d77fa(0xd9),'selector':{'appCode':_0x1c507b[_0x2d77fa(0xee)],'id':_0x1c507b['id'],'configCode':_0x1c507b['configCode'],'configName':_0x1c507b[_0x2d77fa(0xf3)],'channelType':_0x1c507b['channelType']},'before':null,'after':projectNotificationConfig(_0x1c507b),'dryRun':![],'backend':{'method':'POST','path':CREATE_PATH},'warnings':[],'verification':{'status':_0x2d77fa(0xe6),'lookupCommand':_0x3a5bd0}},'message':_0x2d77fa(0xf1)+_0x1c507b['id']};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a137_0x5c08dd=a137_0xdd87;(function(_0x5f5108,_0x55d722){const _0xb492d7=a137_0xdd87,_0x4ef900=_0x5f5108();while(!![]){try{const _0x2a5e30=-parseInt(_0xb492d7(0x83))/0x1*(-parseInt(_0xb492d7(0x84))/0x2)+-parseInt(_0xb492d7(0x80))/0x3*(parseInt(_0xb492d7(0x8a))/0x4)+parseInt(_0xb492d7(0x9a))/0x5*(-parseInt(_0xb492d7(0x8d))/0x6)+-parseInt(_0xb492d7(0x7f))/0x7+-parseInt(_0xb492d7(0x87))/0x8*(parseInt(_0xb492d7(0x93))/0x9)+parseInt(_0xb492d7(0x99))/0xa+parseInt(_0xb492d7(0x97))/0xb;if(_0x2a5e30===_0x55d722)break;else _0x4ef900['push'](_0x4ef900['shift']());}catch(_0x442479){_0x4ef900['push'](_0x4ef900['shift']());}}}(a137_0x4578,0xad61c));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 a137_0xdd87(_0x5b0eef,_0x5c9f11){_0x5b0eef=_0x5b0eef-0x7c;const _0x4578bc=a137_0x4578();let _0xdd8743=_0x4578bc[_0x5b0eef];return _0xdd8743;}const DELETE_PATH=a137_0x5c08dd(0x8f),REFERENCE_WARNING='Deleting\x20this\x20app-level\x20config\x20may\x20make\x20dataset-level\x20channels\x20that\x20reference\x20it\x20unavailable;\x20dataset\x20references\x20were\x20not\x20verified\x20by\x20the\x20CLI.';function a137_0x4578(){const _0x5c15fd=['\x20remains\x20present\x20after\x20delete.','appCode','27yPpDMW','notification_config_delete_verification_failed',';\x20do\x20not\x20resubmit\x20automatically.','channelType','23014211RbBwrd','delete','1498510QXgynr','5pakahq','verified','Notification\x20config\x20','Delete\x20an\x20app-level\x20notification\x20config\x20after\x20exact\x20preflight','unshift','POST','3893848fKjZYP','190083dBMgQh','Inspect\x20with\x20','some','1109npuGgg','1358rItwNo','high-risk-write','Deleted\x20notification\x20config\x20','860648tyJOVS','mutation',';\x20no\x20automatic\x20retry\x20was\x20attempted.','68egmugk','before','notification_config_delete_outcome_unknown','1972482BnMwLR','notification_config_delete_verification_unavailable','/notification/channel-config/delete','notification'];a137_0x4578=function(){return _0x5c15fd;};return a137_0x4578();}async function prepareDelete(_0x2ce6bc){const _0x2c6e05=a137_0x5c08dd,_0x129dc4=readNotificationId(_0x2ce6bc),_0xa772c7=await requireExactNotificationConfig(_0x2ce6bc[_0x2c6e05(0x92)],_0x129dc4,_0x2c6e05(0x98));return{'id':_0x129dc4,'before':_0xa772c7};}export const notificationConfigDelete={'service':a137_0x5c08dd(0x90),'command':'config-delete','description':a137_0x5c08dd(0x7c),'risk':a137_0x5c08dd(0x85),'requiresAppCode':!![],'structuredErrors':!![],'flags':[NOTIFICATION_ID_FLAG,NOTIFICATION_APP_FLAG],async 'validate'(_0xed0021){readNotificationId(_0xed0021),requireNotificationExplicitYes(_0xed0021);},async 'dryRun'(_0x2d6a8d){const _0x2b904f=a137_0x5c08dd,_0x3c8564=await prepareDelete(_0x2d6a8d),_0x232c4e=notificationLookupCommand(_0x2d6a8d[_0x2b904f(0x92)],_0x3c8564[_0x2b904f(0x8b)]['channelType']);return asDryRunResult({'operation':'delete','selector':notificationSelector(_0x3c8564['before']),'before':projectNotificationConfig(_0x3c8564[_0x2b904f(0x8b)]),'after':null,'dryRun':!![],'backend':{'method':'POST','path':DELETE_PATH},'warnings':[REFERENCE_WARNING],'verification':{'status':'planned','lookupCommand':_0x232c4e}},{'method':_0x2b904f(0x7e),'url':DELETE_PATH});},async 'execute'(_0x4e2737){const _0x2e1cc4=a137_0x5c08dd;requireNotificationExplicitYes(_0x4e2737);const _0x4a1e5b=await prepareDelete(_0x4e2737),_0x104265=notificationLookupCommand(_0x4e2737[_0x2e1cc4(0x92)],_0x4a1e5b[_0x2e1cc4(0x8b)][_0x2e1cc4(0x96)]);let _0x3857ab=![];try{await deleteNotificationChannelConfig(_0x4a1e5b['id'],_0x4e2737['appCode']);}catch(_0x35d89a){if(!isPlatformTransportFailure(_0x35d89a))throw safeApiFailure(_0x2e1cc4(0x98),_0x2e1cc4(0x88),_0x2e1cc4(0x81)+_0x104265+_0x2e1cc4(0x89));_0x3857ab=!![];}let _0x44a7be;try{_0x44a7be=await listNotificationChannelConfigs(_0x4e2737[_0x2e1cc4(0x92)],_0x4a1e5b[_0x2e1cc4(0x8b)]['channelType']),validateNotificationDeleteReadback(_0x44a7be,_0x4e2737[_0x2e1cc4(0x92)],_0x4a1e5b[_0x2e1cc4(0x8b)][_0x2e1cc4(0x96)]);}catch{throw notificationError(_0x3857ab?_0x2e1cc4(0x8c):_0x2e1cc4(0x8e),_0x2e1cc4(0x9c)+_0x4a1e5b['id']+'\x20delete\x20could\x20not\x20be\x20verified.',_0x2e1cc4(0x81)+_0x104265+';\x20do\x20not\x20resubmit\x20automatically.');}if(_0x44a7be[_0x2e1cc4(0x82)](_0x1f34bc=>_0x1f34bc['id']===_0x4a1e5b['id']))throw notificationError(_0x3857ab?_0x2e1cc4(0x8c):_0x2e1cc4(0x94),'Notification\x20config\x20'+_0x4a1e5b['id']+_0x2e1cc4(0x91),'Inspect\x20with\x20'+_0x104265+_0x2e1cc4(0x95));const _0x40f54a=[REFERENCE_WARNING];return _0x3857ab&&_0x40f54a[_0x2e1cc4(0x7d)]('Delete\x20response\x20was\x20unavailable;\x20list\x20readback\x20proved\x20ID\x20absence\x20without\x20resubmitting.'),{'ok':!![],'data':{'operation':'delete','selector':notificationSelector(_0x4a1e5b[_0x2e1cc4(0x8b)]),'before':projectNotificationConfig(_0x4a1e5b[_0x2e1cc4(0x8b)]),'after':null,'dryRun':![],'backend':{'method':_0x2e1cc4(0x7e),'path':DELETE_PATH},'warnings':_0x40f54a,'verification':{'status':_0x2e1cc4(0x9b),'absenceConfirmed':!![],'recoveredAfterUnknownResponse':_0x3857ab,'lookupCommand':_0x104265}},'message':_0x2e1cc4(0x86)+_0x4a1e5b['id']};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a138_0x54cefe=a138_0x2f52;(function(_0x2c184b,_0x506e88){const _0x46d39=a138_0x2f52,_0x149374=_0x2c184b();while(!![]){try{const _0x175d23=-parseInt(_0x46d39(0x1a2))/0x1*(parseInt(_0x46d39(0x1a3))/0x2)+parseInt(_0x46d39(0x199))/0x3+parseInt(_0x46d39(0x198))/0x4+-parseInt(_0x46d39(0x1a6))/0x5*(-parseInt(_0x46d39(0x1a5))/0x6)+-parseInt(_0x46d39(0x19a))/0x7+parseInt(_0x46d39(0x1aa))/0x8*(parseInt(_0x46d39(0x1a4))/0x9)+-parseInt(_0x46d39(0x1a8))/0xa;if(_0x175d23===_0x506e88)break;else _0x149374['push'](_0x149374['shift']());}catch(_0x3356da){_0x149374['push'](_0x149374['shift']());}}}(a138_0x2a11,0x2de11));function a138_0x2a11(){const _0x2b47b2=['370488rDngEr','1005018TgNVGb','Notification\x20channel\x20type','notification','map','string','length','EMAIL','appCode','1TfnWPJ','692006PnPalX','1461933yuTsUg','98442yFMphR','65MvYyiy','type','2409020pDIiXr','Found\x20','16EycmQs','1026956WnvXYw'];a138_0x2a11=function(){return _0x2b47b2;};return a138_0x2a11();}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';function a138_0x2f52(_0x597073,_0x1eda1c){_0x597073=_0x597073-0x198;const _0x2a1181=a138_0x2a11();let _0x2f52c7=_0x2a1181[_0x597073];return _0x2f52c7;}export const notificationConfigList={'service':a138_0x54cefe(0x19c),'command':'config-list','description':'List\x20app-level\x20notification\x20configs\x20and\x20their\x20configCode\x20values','risk':'read','flags':[APPCODE_FLAG_OPTIONAL,{'name':a138_0x54cefe(0x1a7),'type':a138_0x54cefe(0x19e),'description':a138_0x54cefe(0x19b),'enum':NOTIFICATION_CHANNEL_TYPES,'default':a138_0x54cefe(0x1a0)}],async 'validate'(_0x2ed386){readNotificationChannelType(_0x2ed386);},async 'execute'(_0x396417){const _0x4444d7=a138_0x54cefe,_0x8e1295=readNotificationChannelType(_0x396417),_0x4a7429=await listNotificationChannelConfigs(_0x396417[_0x4444d7(0x1a1)],_0x8e1295),_0xfb7edd=_0x4a7429[_0x4444d7(0x19d)](projectNotificationListConfig);return{'ok':!![],'data':{'appCode':_0x396417[_0x4444d7(0x1a1)],'channelType':_0x8e1295,'count':_0xfb7edd[_0x4444d7(0x19f)],'configs':_0xfb7edd},'message':_0x4444d7(0x1a9)+_0xfb7edd[_0x4444d7(0x19f)]+'\x20'+_0x8e1295+'\x20notification\x20config(s)'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a139_0x2fc38f=a139_0xc508;(function(_0x3ad950,_0x2c0aa9){const _0x2ffbff=a139_0xc508,_0x48e786=_0x3ad950();while(!![]){try{const _0x2a6e12=parseInt(_0x2ffbff(0x148))/0x1*(parseInt(_0x2ffbff(0x136))/0x2)+-parseInt(_0x2ffbff(0x12b))/0x3+parseInt(_0x2ffbff(0x127))/0x4*(-parseInt(_0x2ffbff(0x143))/0x5)+-parseInt(_0x2ffbff(0x132))/0x6*(parseInt(_0x2ffbff(0x138))/0x7)+-parseInt(_0x2ffbff(0x135))/0x8*(-parseInt(_0x2ffbff(0x144))/0x9)+parseInt(_0x2ffbff(0x149))/0xa+parseInt(_0x2ffbff(0x13d))/0xb;if(_0x2a6e12===_0x2c0aa9)break;else _0x48e786['push'](_0x48e786['shift']());}catch(_0x35e640){_0x48e786['push'](_0x48e786['shift']());}}}(a139_0x189b,0xc407a));function a139_0xc508(_0x3aa374,_0x4493a3){_0x3aa374=_0x3aa374-0x127;const _0x189b3b=a139_0x189b();let _0xc5081f=_0x189b3b[_0x3aa374];return _0xc5081f;}function a139_0x189b(){const _0xe9a955=['14400930qLSPgv','188zPvYBE','\x20with\x20','config-update','Update\x20an\x20app-level\x20notification\x20config\x20from\x20a\x20secure\x20JSON\x20patch','2172801KNTUPC','verified','Inspect\x20ID\x20','patch','channelType','\x20via\x20','update','62154jBQocx','mutation','POST','20248cwlbxF','226xvATzF','\x20update\x20could\x20not\x20be\x20verified\x20by\x20exact\x20ID.','973pIfzQN','provesChange','\x20readback\x20does\x20not\x20prove\x20the\x20requested\x20update.',';\x20do\x20not\x20resubmit\x20automatically.','Inspect\x20with\x20--id\x20','25284985ZHnheK','before','/notification/channel-config/update','allMatch','Notification\x20config\x20','payload','125530GCyAzR','990yYMwqD','notification_config_update_outcome_unknown',';\x20no\x20automatic\x20retry\x20was\x20attempted.','appCode','1150CeHRaz'];a139_0x189b=function(){return _0xe9a955;};return a139_0x189b();}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=a139_0x2fc38f(0x13f);async function prepareUpdate(_0x9ba265){const _0x2bcac5=a139_0x2fc38f,_0x24f800=readNotificationId(_0x9ba265),_0x5b6950=await readNotificationDocument(_0x9ba265,_0x2bcac5(0x131)),_0x35a4be=await requireExactNotificationConfig(_0x9ba265['appCode'],_0x24f800,_0x2bcac5(0x131));return{'id':_0x24f800,'patch':_0x5b6950,'before':_0x35a4be,'payload':mergeUpdateInput(_0x35a4be,_0x5b6950),'planned':plannedUpdateProjection(_0x35a4be,_0x5b6950)};}export const notificationConfigUpdate={'service':'notification','command':a139_0x2fc38f(0x129),'description':a139_0x2fc38f(0x12a),'risk':'high-risk-write','requiresAppCode':!![],'structuredErrors':!![],'flags':[NOTIFICATION_ID_FLAG,...NOTIFICATION_INPUT_FLAGS,NOTIFICATION_APP_FLAG],async 'validate'(_0x4017d5){readNotificationId(_0x4017d5),assertSingleNotificationSource(_0x4017d5),requireNotificationExplicitYes(_0x4017d5);},async 'dryRun'(_0x1d1bc0){const _0x2c0440=a139_0x2fc38f,_0x56d509=await prepareUpdate(_0x1d1bc0),_0x44e5f=notificationLookupCommand(_0x1d1bc0[_0x2c0440(0x147)],_0x56d509[_0x2c0440(0x13e)][_0x2c0440(0x12f)]);return asDryRunResult({'operation':_0x2c0440(0x131),'selector':notificationSelector(_0x56d509[_0x2c0440(0x13e)]),'before':projectNotificationConfig(_0x56d509[_0x2c0440(0x13e)]),'after':_0x56d509['planned'],'dryRun':!![],'backend':{'method':_0x2c0440(0x134),'path':UPDATE_PATH},'warnings':[],'verification':{'status':'planned','lookupCommand':_0x44e5f}},{'method':_0x2c0440(0x134),'url':UPDATE_PATH});},async 'execute'(_0x1849bd){const _0x365d7a=a139_0x2fc38f;requireNotificationExplicitYes(_0x1849bd);const _0x25d2d8=await prepareUpdate(_0x1849bd),_0x57f357=notificationLookupCommand(_0x1849bd[_0x365d7a(0x147)],_0x25d2d8['before'][_0x365d7a(0x12f)]);let _0x52947b=![];try{await updateNotificationChannelConfig(_0x25d2d8[_0x365d7a(0x142)]);}catch(_0x2e73b1){if(!isPlatformTransportFailure(_0x2e73b1))throw safeApiFailure('update',_0x365d7a(0x133),_0x365d7a(0x12d)+_0x25d2d8['id']+_0x365d7a(0x128)+_0x57f357+_0x365d7a(0x146));_0x52947b=!![];}let _0x4e2561;try{const _0x1d96c3=await getNotificationChannelConfig(_0x25d2d8['id'],_0x1849bd[_0x365d7a(0x147)]);_0x4e2561=normalizeExactNotificationConfig(_0x1d96c3,_0x25d2d8['id'],_0x1849bd['appCode']);}catch{throw notificationError(_0x52947b?_0x365d7a(0x145):'notification_config_update_verification_unavailable',_0x365d7a(0x141)+_0x25d2d8['id']+_0x365d7a(0x137),'Inspect\x20with\x20--id\x20'+_0x25d2d8['id']+_0x365d7a(0x130)+_0x57f357+_0x365d7a(0x13b));}const _0x538c73=requestedSafeFieldsMatch(_0x25d2d8[_0x365d7a(0x13e)],_0x4e2561,_0x25d2d8[_0x365d7a(0x12e)]);if(!_0x538c73[_0x365d7a(0x140)]||_0x52947b&&!_0x538c73[_0x365d7a(0x139)])throw notificationError(_0x52947b?'notification_config_update_outcome_unknown':'notification_config_update_verification_failed',_0x365d7a(0x141)+_0x25d2d8['id']+_0x365d7a(0x13a),_0x365d7a(0x13c)+_0x25d2d8['id']+_0x365d7a(0x130)+_0x57f357+_0x365d7a(0x13b));const _0x9962a7=_0x52947b?['Update\x20response\x20was\x20unavailable;\x20exact-ID\x20readback\x20proved\x20changed\x20safe\x20fields\x20without\x20resubmitting.']:[];return{'ok':!![],'data':{'operation':'update','selector':notificationSelector(_0x4e2561),'before':projectNotificationConfig(_0x25d2d8['before']),'after':projectNotificationConfig(_0x4e2561),'dryRun':![],'backend':{'method':_0x365d7a(0x134),'path':UPDATE_PATH},'warnings':_0x9962a7,'verification':{'status':_0x365d7a(0x12c),'recoveredAfterUnknownResponse':_0x52947b,'verifiedFields':_0x538c73['verifiedFields'],'lookupCommand':_0x57f357}},'message':'Updated\x20notification\x20config\x20'+_0x4e2561['id']};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xb832ee,_0x4cd220){const _0x42179c=a140_0x33b3,_0x5db454=_0xb832ee();while(!![]){try{const _0x2c71d0=parseInt(_0x42179c(0x1da))/0x1*(parseInt(_0x42179c(0x1d9))/0x2)+parseInt(_0x42179c(0x1dc))/0x3+-parseInt(_0x42179c(0x1de))/0x4*(parseInt(_0x42179c(0x1df))/0x5)+-parseInt(_0x42179c(0x1db))/0x6*(parseInt(_0x42179c(0x1d6))/0x7)+parseInt(_0x42179c(0x1d8))/0x8*(parseInt(_0x42179c(0x1d7))/0x9)+-parseInt(_0x42179c(0x1d5))/0xa*(-parseInt(_0x42179c(0x1d4))/0xb)+-parseInt(_0x42179c(0x1dd))/0xc;if(_0x2c71d0===_0x4cd220)break;else _0x5db454['push'](_0x5db454['shift']());}catch(_0x520aad){_0x5db454['push'](_0x5db454['shift']());}}}(a140_0x589b,0x794c3));function a140_0x33b3(_0xb61b80,_0x21181d){_0xb61b80=_0xb61b80-0x1d4;const _0x589b7e=a140_0x589b();let _0x33b384=_0x589b7e[_0xb61b80];return _0x33b384;}import{notificationConfigList}from'../../commands/notification/config-list.js';import{notificationConfigCreate}from'../../commands/notification/config-create.js';import{notificationConfigUpdate}from'../../commands/notification/config-update.js';function a140_0x589b(){const _0x44ce68=['1233501WkETRG','5753880HFsptR','33844CHiqKE','555PdmMSJ','1989922hHcayX','30MTpQva','5145252XeUmeM','3926511TtGxrT','16elQkpD','2kJUoep','824101jWnyat','6mvhmbE'];a140_0x589b=function(){return _0x44ce68;};return a140_0x589b();}import{notificationConfigDelete}from'../../commands/notification/config-delete.js';export const notificationDefinitions=[notificationConfigList,notificationConfigCreate,notificationConfigUpdate,notificationConfigDelete];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a140_0x3c8ca0=a140_0x19a2;(function(_0x541fed,_0x200543){const _0x57b74e=a140_0x19a2,_0x394e58=_0x541fed();while(!![]){try{const _0x25c89c=parseInt(_0x57b74e(0x1bb))/0x1+-parseInt(_0x57b74e(0x1fe))/0x2+parseInt(_0x57b74e(0x1e1))/0x3+parseInt(_0x57b74e(0x1d6))/0x4+parseInt(_0x57b74e(0x21e))/0x5*(-parseInt(_0x57b74e(0x21c))/0x6)+-parseInt(_0x57b74e(0x1c6))/0x7*(-parseInt(_0x57b74e(0x1f4))/0x8)+-parseInt(_0x57b74e(0x1ca))/0x9;if(_0x25c89c===_0x200543)break;else _0x394e58['push'](_0x394e58['shift']());}catch(_0x1edd55){_0x394e58['push'](_0x394e58['shift']());}}}(a140_0x2f32,0xdade0));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','FEISHU',a140_0x3c8ca0(0x1be),'WECOM',a140_0x3c8ca0(0x1b3)];export const DEFAULT_NOTIFICATION_CONNECT_TIMEOUT=0x1388;export const DEFAULT_NOTIFICATION_READ_TIMEOUT=0x2710;const ALLOWED_INPUT_FIELDS=new Set(['configName',a140_0x3c8ca0(0x222),a140_0x3c8ca0(0x1ac),'channelConfig',a140_0x3c8ca0(0x1cd),a140_0x3c8ca0(0x21d),'readTimeout']),FORBIDDEN_IDENTITY_FIELDS=new Set(['id',a140_0x3c8ca0(0x214),a140_0x3c8ca0(0x1ef),a140_0x3c8ca0(0x1cf)]),EMAIL_RECIPIENT_FIELDS=new Set([a140_0x3c8ca0(0x1d1),'recipients','ccList','bccList',a140_0x3c8ca0(0x1f2),a140_0x3c8ca0(0x207),'fromName','to','cc']);export const NOTIFICATION_INPUT_FLAGS=[{'name':a140_0x3c8ca0(0x1de),'type':a140_0x3c8ca0(0x1cb),'required':![],'description':a140_0x3c8ca0(0x1f8)},{'name':a140_0x3c8ca0(0x21b),'type':'boolean','required':![],'default':![],'description':a140_0x3c8ca0(0x1e9)},{'name':a140_0x3c8ca0(0x1b8),'type':a140_0x3c8ca0(0x1cb),'required':![],'description':a140_0x3c8ca0(0x1ae)}];export const NOTIFICATION_ID_FLAG={'name':'id','type':a140_0x3c8ca0(0x1d5),'required':!![],'description':a140_0x3c8ca0(0x1f5)};export const NOTIFICATION_APP_FLAG=APPCODE_FLAG_OPTIONAL;export function notificationError(_0x317879,_0x3f6ab1,_0x1a19b9){return new CliError(_0x317879,0x1,_0x3f6ab1,_0x1a19b9);}export function readNotificationId(_0x2cb583){const _0x58a029=a140_0x3c8ca0,_0x491c41=_0x2cb583[_0x58a029(0x20f)]('id');if(!Number['isSafeInteger'](_0x491c41)||_0x491c41<=0x0)throw notificationError(_0x58a029(0x1f6),_0x58a029(0x204));return _0x491c41;}export function requireNotificationExplicitYes(_0x41b6fc){const _0x169be6=a140_0x3c8ca0;if(_0x41b6fc['bool'](_0x169be6(0x211))||_0x41b6fc['bool'](_0x169be6(0x20a)))return;throw notificationError(_0x169be6(0x1f7),_0x169be6(0x1c3),_0x169be6(0x1eb));}export function readNotificationChannelType(_0x2a2485,_0x35dd0f='type',_0x10678a=a140_0x3c8ca0(0x1ea)){const _0x9b4c0a=a140_0x3c8ca0,_0x2eec5b=_0x2a2485[_0x9b4c0a(0x1e7)](_0x35dd0f)[_0x9b4c0a(0x1c8)]()||_0x10678a;if(!NOTIFICATION_CHANNEL_TYPES[_0x9b4c0a(0x200)](_0x2eec5b))throw CliErrors['validation'](_0x9b4c0a(0x1fd)+_0x35dd0f+':\x20'+_0x2eec5b,_0x9b4c0a(0x1bf)+NOTIFICATION_CHANNEL_TYPES['join'](',\x20')+'.');return _0x2eec5b;}export function assertSingleNotificationSource(_0x1c0661){const _0x2c5be2=a140_0x3c8ca0,_0x35218e=[],_0x4a0ed9=_0x1c0661[_0x2c5be2(0x1e7)](_0x2c5be2(0x1de))[_0x2c5be2(0x1c8)]();if(_0x4a0ed9)_0x35218e[_0x2c5be2(0x1bd)]({'kind':_0x2c5be2(0x1de),'path':_0x4a0ed9});if(_0x1c0661[_0x2c5be2(0x215)](_0x2c5be2(0x21b)))_0x35218e[_0x2c5be2(0x1bd)]({'kind':_0x2c5be2(0x21b)});const _0x27778c=_0x1c0661['str'](_0x2c5be2(0x1b8))[_0x2c5be2(0x1c8)]();if(_0x27778c)_0x35218e['push']({'kind':_0x2c5be2(0x1b5),'name':_0x27778c});if(_0x35218e['length']===0x0)throw CliErrors[_0x2c5be2(0x1c5)](_0x2c5be2(0x1b7),'Use\x20exactly\x20one\x20of\x20--file\x20<path>,\x20--stdin,\x20or\x20--from-env\x20<NAME>.');if(_0x35218e[_0x2c5be2(0x202)]>0x1)throw CliErrors[_0x2c5be2(0x1c5)]('Notification\x20JSON\x20source\x20is\x20ambiguous.','Use\x20exactly\x20one\x20of\x20--file\x20<path>,\x20--stdin,\x20or\x20--from-env\x20<NAME>.');return _0x35218e[0x0];}export async function readNotificationDocument(_0x1275ad,_0x456b56){const _0x19d70d=a140_0x3c8ca0,_0x177952=assertSingleNotificationSource(_0x1275ad),_0x23b8bb=_0x177952[_0x19d70d(0x1d9)]===_0x19d70d(0x1de)?_0x19d70d(0x1e4)+_0x177952[_0x19d70d(0x1ab)]:_0x177952[_0x19d70d(0x1d9)]===_0x19d70d(0x1b5)?_0x19d70d(0x1f3)+_0x177952[_0x19d70d(0x1ba)]:_0x19d70d(0x21b);let _0x53d85d;try{if(_0x177952[_0x19d70d(0x1d9)]===_0x19d70d(0x1de))_0x53d85d=await readFile(_0x177952[_0x19d70d(0x1ab)],'utf8');else{if(_0x177952[_0x19d70d(0x1d9)]===_0x19d70d(0x1b5)){if(!(_0x177952[_0x19d70d(0x1ba)]in process.env))throw notificationError(_0x19d70d(0x220),_0x19d70d(0x1d0)+_0x177952[_0x19d70d(0x1ba)]);_0x53d85d=process.env[_0x177952.name]??'';}else _0x53d85d=await readStdin();}}catch(_0x27320d){if(_0x27320d instanceof CliError)throw _0x27320d;throw notificationError('notification_config_source_unavailable',_0x19d70d(0x1b6)+_0x23b8bb+'.');}let _0x2db8d8;try{_0x2db8d8=JSON['parse'](_0x53d85d);}catch{throw notificationError(_0x19d70d(0x223),_0x19d70d(0x1af)+_0x23b8bb+_0x19d70d(0x203),_0x19d70d(0x1b1));}if(!isJsonObject(_0x2db8d8))throw notificationError(_0x19d70d(0x223),_0x19d70d(0x1af)+_0x23b8bb+_0x19d70d(0x1a7));return validateNotificationDocument(_0x2db8d8,_0x456b56);}export function projectNotificationListConfig(_0x58033a,_0xa05cea){const _0x495b9b=a140_0x3c8ca0;return{'id':typeof _0x58033a['id']===_0x495b9b(0x1d5)?_0x58033a['id']:null,'configCode':requireResponseString(_0x58033a['configCode'],_0x495b9b(0x1ef),_0xa05cea),'configName':requireResponseString(_0x58033a[_0x495b9b(0x1c0)],_0x495b9b(0x1c0),_0xa05cea),'channelType':requireResponseString(_0x58033a[_0x495b9b(0x222)],'channelType',_0xa05cea),'description':normalizeNullableString(_0x58033a[_0x495b9b(0x1cd)]),'createTime':normalizeNullableString(_0x58033a['createTime']),'updateTime':normalizeNullableString(_0x58033a[_0x495b9b(0x1bc)])};}export function normalizeExactNotificationConfig(_0x3edae5,_0x40fa3d,_0x2beee4){const _0x1e6a2c=a140_0x3c8ca0;if(!Number[_0x1e6a2c(0x1d8)](_0x3edae5['id'])||_0x3edae5['id']!==_0x40fa3d)throw notificationError('notification_config_response_invalid','Notification\x20config\x20detail\x20did\x20not\x20contain\x20the\x20requested\x20ID\x20'+_0x40fa3d+'.');if(_0x3edae5[_0x1e6a2c(0x214)]!==_0x2beee4)throw notificationError(_0x1e6a2c(0x20d),_0x1e6a2c(0x1e5)+_0x40fa3d+'\x20does\x20not\x20belong\x20to\x20the\x20resolved\x20app.');const _0x579e41=requireExactString(_0x3edae5['configName'],_0x1e6a2c(0x1c0),_0x40fa3d),_0x5f4f5f=requireExactString(_0x3edae5[_0x1e6a2c(0x1ef)],_0x1e6a2c(0x1ef),_0x40fa3d),_0x17798c=requireExactString(_0x3edae5[_0x1e6a2c(0x222)],_0x1e6a2c(0x222),_0x40fa3d);if(!NOTIFICATION_CHANNEL_TYPES[_0x1e6a2c(0x200)](_0x17798c))throw notificationError(_0x1e6a2c(0x20d),_0x1e6a2c(0x1e5)+_0x40fa3d+_0x1e6a2c(0x1cc));const _0x33d6b8=responseNullableString(_0x3edae5['endpointUrl'],_0x1e6a2c(0x1ac),_0x40fa3d),_0x53b299=responseNullableString(_0x3edae5[_0x1e6a2c(0x1c2)],_0x1e6a2c(0x1c2),_0x40fa3d),_0x512f68=responseNullableString(_0x3edae5['description'],'description',_0x40fa3d),_0x28b51c=responseNullableTimeout(_0x3edae5[_0x1e6a2c(0x21d)],_0x1e6a2c(0x21d),_0x40fa3d),_0x1ffd20=responseNullableTimeout(_0x3edae5[_0x1e6a2c(0x216)],_0x1e6a2c(0x216),_0x40fa3d);return{'id':_0x40fa3d,'appCode':_0x2beee4,'configCode':_0x5f4f5f,'configName':_0x579e41,'channelType':_0x17798c,'endpointUrl':redactSensitive(_0x33d6b8),'channelConfig':redactSensitive(_0x53b299),'description':_0x512f68,'connectTimeout':_0x28b51c,'readTimeout':_0x1ffd20,'endpointUrlRaw':_0x33d6b8,'channelConfigRaw':_0x53b299};}export async function requireExactNotificationConfig(_0x19f666,_0x3d7456,_0x2b7348){const _0x40be2c=a140_0x3c8ca0;let _0x306b3a;try{_0x306b3a=await getNotificationChannelConfig(_0x3d7456,_0x19f666);}catch{throw safeApiFailure(_0x2b7348,_0x40be2c(0x1a9),_0x40be2c(0x1e8)+_0x19f666+_0x40be2c(0x1df));}return normalizeExactNotificationConfig(_0x306b3a,_0x3d7456,_0x19f666);}export function projectNotificationConfig(_0x401eb3){const _0xd7503a=a140_0x3c8ca0;return{'id':_0x401eb3['id']??null,'appCode':_0x401eb3[_0xd7503a(0x214)],'configCode':_0x401eb3[_0xd7503a(0x1ef)]??null,'configName':_0x401eb3[_0xd7503a(0x1c0)],'channelType':_0x401eb3['channelType'],'endpointUrl':redactSensitive(_0x401eb3[_0xd7503a(0x1ac)]),'channelConfig':redactSensitive(_0x401eb3[_0xd7503a(0x1c2)]),'description':_0x401eb3['description']??null,'connectTimeout':_0x401eb3['connectTimeout']??null,'readTimeout':_0x401eb3[_0xd7503a(0x216)]??null};}export function notificationSelector(_0x5eaf08){const _0x159f45=a140_0x3c8ca0;return{'appCode':_0x5eaf08[_0x159f45(0x214)],'id':_0x5eaf08['id'],'configCode':_0x5eaf08['configCode'],'configName':_0x5eaf08['configName'],'channelType':_0x5eaf08['channelType']};}export function createMutationInput(_0x25abef,_0x3ecb00){const _0x5b2fe5=a140_0x3c8ca0;return{'appCode':_0x25abef,'configName':_0x3ecb00[_0x5b2fe5(0x1c0)],'channelType':_0x3ecb00[_0x5b2fe5(0x222)],...hasOwn(_0x3ecb00,_0x5b2fe5(0x1ac))?{'endpointUrl':_0x3ecb00[_0x5b2fe5(0x1ac)]}:{},...hasOwn(_0x3ecb00,'channelConfig')?{'channelConfig':serializeChannelConfig(_0x3ecb00[_0x5b2fe5(0x1c2)])}:{},...hasOwn(_0x3ecb00,_0x5b2fe5(0x1cd))?{'description':_0x3ecb00[_0x5b2fe5(0x1cd)]}:{},...hasOwn(_0x3ecb00,_0x5b2fe5(0x21d))?{'connectTimeout':_0x3ecb00['connectTimeout']}:{},...hasOwn(_0x3ecb00,_0x5b2fe5(0x216))?{'readTimeout':_0x3ecb00['readTimeout']}:{}};}export function mergeUpdateInput(_0xc54431,_0x3aeeed){const _0x5688b1=a140_0x3c8ca0;return{'id':_0xc54431['id'],'appCode':_0xc54431[_0x5688b1(0x214)],'configName':_0x3aeeed[_0x5688b1(0x1c0)]??_0xc54431[_0x5688b1(0x1c0)],'channelType':_0x3aeeed[_0x5688b1(0x222)]??_0xc54431[_0x5688b1(0x222)],'endpointUrl':hasOwn(_0x3aeeed,_0x5688b1(0x1ac))?_0x3aeeed['endpointUrl']:_0xc54431[_0x5688b1(0x21f)],'channelConfig':hasOwn(_0x3aeeed,_0x5688b1(0x1c2))?serializeChannelConfig(_0x3aeeed['channelConfig']):_0xc54431[_0x5688b1(0x1b4)],'description':hasOwn(_0x3aeeed,'description')?_0x3aeeed[_0x5688b1(0x1cd)]:_0xc54431[_0x5688b1(0x1cd)],'connectTimeout':hasOwn(_0x3aeeed,_0x5688b1(0x21d))?_0x3aeeed[_0x5688b1(0x21d)]:_0xc54431[_0x5688b1(0x21d)],'readTimeout':hasOwn(_0x3aeeed,'readTimeout')?_0x3aeeed[_0x5688b1(0x216)]:_0xc54431['readTimeout']};}export function plannedUpdateProjection(_0x4d2e7a,_0x46ec32){const _0x4a837e=a140_0x3c8ca0;return projectNotificationConfig({'id':_0x4d2e7a['id'],'appCode':_0x4d2e7a['appCode'],'configCode':_0x4d2e7a[_0x4a837e(0x1ef)],'configName':_0x46ec32[_0x4a837e(0x1c0)]??_0x4d2e7a[_0x4a837e(0x1c0)],'channelType':_0x46ec32[_0x4a837e(0x222)]??_0x4d2e7a[_0x4a837e(0x222)],'endpointUrl':hasOwn(_0x46ec32,'endpointUrl')?_0x46ec32[_0x4a837e(0x1ac)]:_0x4d2e7a['endpointUrlRaw'],'channelConfig':hasOwn(_0x46ec32,'channelConfig')?_0x46ec32[_0x4a837e(0x1c2)]:_0x4d2e7a[_0x4a837e(0x1b4)],'description':hasOwn(_0x46ec32,'description')?_0x46ec32['description']:_0x4d2e7a['description'],'connectTimeout':hasOwn(_0x46ec32,_0x4a837e(0x21d))?_0x46ec32['connectTimeout']??DEFAULT_NOTIFICATION_CONNECT_TIMEOUT:_0x4d2e7a[_0x4a837e(0x21d)],'readTimeout':hasOwn(_0x46ec32,'readTimeout')?_0x46ec32[_0x4a837e(0x216)]??DEFAULT_NOTIFICATION_READ_TIMEOUT:_0x4d2e7a[_0x4a837e(0x216)]});}function a140_0x19a2(_0x5c4180,_0x33f39a){_0x5c4180=_0x5c4180-0x1a7;const _0x2f325b=a140_0x2f32();let _0x19a214=_0x2f325b[_0x5c4180];return _0x19a214;}export function requestedSafeFieldsMatch(_0x2a5518,_0xb488fd,_0x44e81f){const _0x44c94d=a140_0x3c8ca0,_0x53aa64=[],_0x5e82ae=[],_0x3f01da=[];for(const _0x41c3fc of[_0x44c94d(0x1c0),_0x44c94d(0x222),'description']){if(!hasOwn(_0x44e81f,_0x41c3fc))continue;_0x3f01da[_0x44c94d(0x1bd)](_0x41c3fc),_0x53aa64[_0x44c94d(0x1bd)](_0xb488fd[_0x41c3fc]===_0x44e81f[_0x41c3fc]),_0x5e82ae[_0x44c94d(0x1bd)](_0x2a5518[_0x41c3fc]!==_0x44e81f[_0x41c3fc]&&_0xb488fd[_0x41c3fc]===_0x44e81f[_0x41c3fc]);}for(const _0x830647 of[_0x44c94d(0x21d),_0x44c94d(0x216)]){if(!hasOwn(_0x44e81f,_0x830647))continue;const _0x1ea4e7=_0x44e81f[_0x830647]??(_0x830647===_0x44c94d(0x21d)?DEFAULT_NOTIFICATION_CONNECT_TIMEOUT:DEFAULT_NOTIFICATION_READ_TIMEOUT);_0x3f01da[_0x44c94d(0x1bd)](_0x830647),_0x53aa64[_0x44c94d(0x1bd)](_0xb488fd[_0x830647]===_0x1ea4e7),_0x5e82ae[_0x44c94d(0x1bd)](_0x2a5518[_0x830647]!==_0x1ea4e7&&_0xb488fd[_0x830647]===_0x1ea4e7);}return hasOwn(_0x44e81f,'endpointUrl')&&_0x44e81f[_0x44c94d(0x1ac)]===null&&(_0x3f01da[_0x44c94d(0x1bd)](_0x44c94d(0x1f0)),_0x53aa64[_0x44c94d(0x1bd)](_0xb488fd[_0x44c94d(0x21f)]===null||_0xb488fd[_0x44c94d(0x21f)]===''),_0x5e82ae[_0x44c94d(0x1bd)](_0x2a5518[_0x44c94d(0x21f)]!==null&&_0x2a5518[_0x44c94d(0x21f)]!==''&&(_0xb488fd['endpointUrlRaw']===null||_0xb488fd[_0x44c94d(0x21f)]===''))),{'allMatch':_0x53aa64['every'](Boolean),'provesChange':_0x5e82ae[_0x44c94d(0x20b)](Boolean),'verifiedFields':_0x3f01da};}export function validateNotificationDeleteReadback(_0x81448b,_0x46e504,_0x2b0de2){const _0x2c2970=a140_0x3c8ca0;for(const [_0x29be5e,_0x4a4f5b]of _0x81448b[_0x2c2970(0x219)]()){if(!Number['isSafeInteger'](_0x4a4f5b['id'])||_0x4a4f5b['id']<=0x0)throw notificationError(_0x2c2970(0x20d),_0x2c2970(0x21a)+(_0x29be5e+0x1)+_0x2c2970(0x1d7));if(_0x4a4f5b[_0x2c2970(0x214)]!==_0x46e504)throw notificationError('notification_config_response_invalid',_0x2c2970(0x21a)+(_0x29be5e+0x1)+_0x2c2970(0x1b0));if(_0x4a4f5b[_0x2c2970(0x222)]!==_0x2b0de2)throw notificationError('notification_config_response_invalid','Notification\x20config\x20list\x20item\x20'+(_0x29be5e+0x1)+_0x2c2970(0x1db));}}export function safeApiFailure(_0x441c6e,_0x4707a0,_0x144fb7){const _0x93d661=a140_0x3c8ca0;return notificationError(_0x93d661(0x1fb)+_0x441c6e+'_'+(_0x4707a0===_0x93d661(0x1f9)?_0x93d661(0x1e3):_0x4707a0+_0x93d661(0x1f1)),_0x93d661(0x1e5)+_0x441c6e+'\x20'+_0x4707a0+'\x20failed.',_0x144fb7);}export function notificationLookupCommand(_0xda5bdb,_0x1f9210){const _0x4e9160=a140_0x3c8ca0;return _0x4e9160(0x208)+_0xda5bdb+_0x4e9160(0x1da)+_0x1f9210+_0x4e9160(0x1d2);}function validateNotificationDocument(_0x5e4c6d,_0x404756){const _0x1d7a66=a140_0x3c8ca0;for(const _0x2ff412 of Object['keys'](_0x5e4c6d)){if(FORBIDDEN_IDENTITY_FIELDS[_0x1d7a66(0x213)](_0x2ff412))throw notificationError(_0x1d7a66(0x205),'Notification\x20JSON\x20field\x20\x22'+_0x2ff412+_0x1d7a66(0x217));if(!ALLOWED_INPUT_FIELDS[_0x1d7a66(0x213)](_0x2ff412))throw notificationError(_0x1d7a66(0x1dd),_0x1d7a66(0x1aa)+_0x2ff412+'\x22.');}if(_0x404756===_0x1d7a66(0x1ad)&&Object['keys'](_0x5e4c6d)[_0x1d7a66(0x202)]===0x0)throw notificationError(_0x1d7a66(0x20e),'Update\x20JSON\x20must\x20contain\x20at\x20least\x20one\x20allowed\x20field.');const _0x179742={};if(hasOwn(_0x5e4c6d,_0x1d7a66(0x1c0)))_0x179742[_0x1d7a66(0x1c0)]=validateRequiredString(_0x5e4c6d['configName'],_0x1d7a66(0x1c0),0x80);else{if(_0x404756==='create')throw notificationError(_0x1d7a66(0x1d4),_0x1d7a66(0x212)+_0x1d7a66(0x1c4));}if(hasOwn(_0x5e4c6d,_0x1d7a66(0x222))){if(typeof _0x5e4c6d[_0x1d7a66(0x222)]!=='string')throw invalidFieldType(_0x1d7a66(0x222),_0x1d7a66(0x1e2));const _0x2d5586=_0x5e4c6d[_0x1d7a66(0x222)]['trim']();if(!NOTIFICATION_CHANNEL_TYPES[_0x1d7a66(0x200)](_0x2d5586))throw notificationError(_0x1d7a66(0x1e6),_0x1d7a66(0x1ee),_0x1d7a66(0x1bf)+NOTIFICATION_CHANNEL_TYPES[_0x1d7a66(0x1c9)](',\x20')+'.');_0x179742['channelType']=_0x2d5586;}else{if(_0x404756===_0x1d7a66(0x210))throw notificationError(_0x1d7a66(0x1d4),_0x1d7a66(0x212)+'\x22channelType\x22.');}for(const [_0x3b243a,_0x535b06]of[[_0x1d7a66(0x1ac),0x200],[_0x1d7a66(0x1cd),0x100]]){if(!hasOwn(_0x5e4c6d,_0x3b243a))continue;const _0x6567b=_0x5e4c6d[_0x3b243a];if(_0x6567b!==null&&typeof _0x6567b!==_0x1d7a66(0x1cb))throw invalidFieldType(_0x3b243a,_0x1d7a66(0x1c7));if(typeof _0x6567b===_0x1d7a66(0x1cb)&&_0x6567b[_0x1d7a66(0x202)]>_0x535b06)throw notificationError(_0x1d7a66(0x1e6),'Notification\x20JSON\x20field\x20\x22'+_0x3b243a+_0x1d7a66(0x1fa)+_0x535b06+_0x1d7a66(0x1dc));_0x179742[_0x3b243a]=_0x6567b;}if(hasOwn(_0x5e4c6d,_0x1d7a66(0x1c2))){const _0x5d6259=_0x5e4c6d[_0x1d7a66(0x1c2)];if(_0x5d6259===null&&_0x404756===_0x1d7a66(0x210))throw invalidFieldType('channelConfig',_0x1d7a66(0x1e0));if(_0x5d6259!==null&&!isJsonObject(_0x5d6259))throw invalidFieldType('channelConfig',_0x404756===_0x1d7a66(0x1ad)?_0x1d7a66(0x1ff):_0x1d7a66(0x1e0));_0x5d6259!==null&&validateChannelConfigFields(_0x179742[_0x1d7a66(0x222)],_0x5d6259),_0x179742[_0x1d7a66(0x1c2)]=_0x5d6259;}for(const _0x5627c8 of[_0x1d7a66(0x21d),_0x1d7a66(0x216)]){if(!hasOwn(_0x5e4c6d,_0x5627c8))continue;const _0x3e9acc=_0x5e4c6d[_0x5627c8];if(_0x3e9acc!==null&&(!Number[_0x1d7a66(0x1d8)](_0x3e9acc)||_0x3e9acc<0x0))throw notificationError(_0x1d7a66(0x1e6),_0x1d7a66(0x20c)+_0x5627c8+_0x1d7a66(0x1ec));_0x179742[_0x5627c8]=_0x3e9acc;}return _0x179742;}function validateRequiredString(_0x423926,_0x5d642b,_0x368d08){const _0xb86a76=a140_0x3c8ca0;if(typeof _0x423926!==_0xb86a76(0x1cb))throw invalidFieldType(_0x5d642b,_0xb86a76(0x221));const _0x5f1bd3=_0x423926[_0xb86a76(0x1c8)]();if(!_0x5f1bd3)throw notificationError(_0xb86a76(0x1e6),_0xb86a76(0x20c)+_0x5d642b+_0xb86a76(0x1a8));if(_0x5f1bd3[_0xb86a76(0x202)]>_0x368d08)throw notificationError(_0xb86a76(0x1e6),_0xb86a76(0x20c)+_0x5d642b+_0xb86a76(0x1fa)+_0x368d08+'\x20characters.');return _0x5f1bd3;}function validateChannelConfigFields(_0x29c73a,_0x168a82){const _0x5bbca2=a140_0x3c8ca0;if(hasOwn(_0x168a82,_0x5bbca2(0x224)))throw forbiddenChannelConfigField(_0x5bbca2(0x224));if(_0x29c73a===_0x5bbca2(0x1ea))for(const _0x654cab of EMAIL_RECIPIENT_FIELDS){if(hasOwn(_0x168a82,_0x654cab))throw forbiddenChannelConfigField(_0x654cab);}}function forbiddenChannelConfigField(_0x9dd557){const _0x526556=a140_0x3c8ca0;return notificationError('notification_config_channel_field_forbidden',_0x526556(0x1ed)+_0x9dd557+'\x22\x20is\x20forbidden.');}function invalidFieldType(_0x1979c6,_0x5f5b34){const _0x6fb4e4=a140_0x3c8ca0;return notificationError(_0x6fb4e4(0x1e6),_0x6fb4e4(0x20c)+_0x1979c6+'\x22\x20must\x20be\x20'+_0x5f5b34+'.');}function a140_0x2f32(){const _0x3ceae4=['notification_config_response_invalid','notification_config_update_empty','num','create','dry-run','Create\x20JSON\x20requires\x20field\x20','has','appCode','bool','readTimeout','\x22\x20is\x20controlled\x20by\x20the\x20CLI\x20or\x20server\x20and\x20is\x20forbidden.','apiError','entries','Notification\x20config\x20list\x20item\x20','stdin','5802MaCuOw','connectTimeout','4315frzKVo','endpointUrlRaw','notification_config_source_unavailable','a\x20non-empty\x20string','channelType','notification_config_json_invalid','messageTemplate','prototype','\x20must\x20be\x20an\x20object.','\x22\x20must\x20be\x20a\x20non-empty\x20string.','preflight','Unknown\x20notification\x20JSON\x20field\x20\x22','path','endpointUrl','update','Read\x20the\x20notification\x20JSON\x20document\x20from\x20a\x20named\x20environment\x20variable','Notification\x20JSON\x20from\x20','\x20has\x20an\x20invalid\x20appCode.','Provide\x20one\x20valid\x20JSON\x20object;\x20source\x20contents\x20are\x20not\x20included\x20in\x20errors.','call','WEBHOOK','channelConfigRaw','env','Unable\x20to\x20read\x20notification\x20JSON\x20from\x20','Missing\x20notification\x20JSON\x20source.','from-env','\x20has\x20invalid\x20field\x20\x22','name','1603802Xscipb','updateTime','push','DINGTALK','Allowed\x20values:\x20','configName','stringify','channelConfig','This\x20notification\x20config\x20mutation\x20requires\x20explicit\x20--yes.','\x22configName\x22.','validation','14bHXQgW','a\x20string\x20or\x20null','trim','join','7634079dtlRGd','string','\x20has\x20an\x20unsupported\x20channelType.','description','Item\x20','channelCode','Notification\x20JSON\x20environment\x20variable\x20is\x20not\x20set:\x20','emailTargets','\x20--format\x20compress','isArray','notification_config_field_required','number','4835096LgewJU','\x20has\x20an\x20invalid\x20id.','isSafeInteger','kind','\x20--type\x20','\x20has\x20an\x20invalid\x20channelType.','\x20characters.','notification_config_field_unknown','file','\x20--type\x20<CHANNEL_TYPE>\x20--format\x20compress;\x20no\x20mutation\x20was\x20submitted.','a\x20JSON\x20object','203334SQpKPf','a\x20supported\x20string','failed','file\x20','Notification\x20config\x20','notification_config_field_invalid','str','Inspect\x20with\x20rabetbase\x20notification\x20config-list\x20--appcode\x20','Read\x20the\x20notification\x20JSON\x20document\x20from\x20stdin','EMAIL','Run\x20the\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.','\x22\x20must\x20be\x20a\x20non-negative\x20safe\x20integer\x20or\x20null.','Notification\x20JSON\x20channelConfig\x20field\x20\x22','Notification\x20JSON\x20field\x20\x22channelType\x22\x20is\x20unsupported.','configCode','endpointUrl:null','_unavailable','replyTo','environment\x20variable\x20','2586688FjxmpE','Application-level\x20notification\x20config\x20ID','notification_config_id_invalid','notification_config_confirmation_required','Read\x20the\x20notification\x20JSON\x20document\x20from\x20a\x20UTF-8\x20file','mutation','\x22\x20cannot\x20exceed\x20','notification_config_','Invalid\x20notification\x20config\x20response.','Invalid\x20--','1895588XInIym','a\x20JSON\x20object\x20or\x20null','includes','\x20is\x20missing\x20required\x20field\x20\x22','length','\x20is\x20invalid.','--id\x20must\x20be\x20a\x20positive\x20safe\x20integer.','notification_config_field_forbidden','setEncoding','subjectPrefix','rabetbase\x20notification\x20config-list\x20--appcode\x20','hasOwnProperty','yes','some','Notification\x20JSON\x20field\x20\x22'];a140_0x2f32=function(){return _0x3ceae4;};return a140_0x2f32();}function serializeChannelConfig(_0xd756c4){const _0xb9a460=a140_0x3c8ca0;return _0xd756c4===null||_0xd756c4===undefined?null:JSON[_0xb9a460(0x1c1)](_0xd756c4);}function redactSensitive(_0x13fee5){return _0x13fee5===null||_0x13fee5===undefined||_0x13fee5===''?null:'<redacted>';}function requireResponseString(_0x4315f4,_0x44f43f,_0x292fdc){const _0x4fcaf9=a140_0x3c8ca0;if(typeof _0x4315f4!==_0x4fcaf9(0x1cb)||_0x4315f4[_0x4fcaf9(0x1c8)]()==='')throw CliErrors[_0x4fcaf9(0x218)](_0x4fcaf9(0x1fc),_0x4fcaf9(0x1ce)+(_0x292fdc+0x1)+'\x20is\x20missing\x20required\x20field\x20\x22'+_0x44f43f+'\x22.');return _0x4315f4[_0x4fcaf9(0x1c8)]();}function requireExactString(_0x479e8e,_0x4e17d8,_0x21a0b4){const _0x5e18ca=a140_0x3c8ca0;if(typeof _0x479e8e!==_0x5e18ca(0x1cb)||_0x479e8e[_0x5e18ca(0x1c8)]()==='')throw notificationError('notification_config_response_invalid',_0x5e18ca(0x1e5)+_0x21a0b4+_0x5e18ca(0x201)+_0x4e17d8+'\x22.');return _0x479e8e['trim']();}function responseNullableString(_0x5d744d,_0x12953c,_0x37b3fc){const _0x1b83c5=a140_0x3c8ca0;if(_0x5d744d===undefined||_0x5d744d===null)return null;if(typeof _0x5d744d!==_0x1b83c5(0x1cb))throw notificationError(_0x1b83c5(0x20d),_0x1b83c5(0x1e5)+_0x37b3fc+_0x1b83c5(0x1b9)+_0x12953c+'\x22.');return _0x5d744d;}function responseNullableTimeout(_0x54acad,_0x2feada,_0x1677c6){const _0x1a9382=a140_0x3c8ca0;if(_0x54acad===undefined||_0x54acad===null)return null;if(!Number[_0x1a9382(0x1d8)](_0x54acad)||_0x54acad<0x0)throw notificationError('notification_config_response_invalid',_0x1a9382(0x1e5)+_0x1677c6+'\x20has\x20invalid\x20field\x20\x22'+_0x2feada+'\x22.');return _0x54acad;}function normalizeNullableString(_0x456170){const _0x59d54d=a140_0x3c8ca0;return typeof _0x456170===_0x59d54d(0x1cb)?_0x456170:null;}function isJsonObject(_0x1b3127){const _0x557630=a140_0x3c8ca0;return _0x1b3127!==null&&typeof _0x1b3127==='object'&&!Array[_0x557630(0x1d3)](_0x1b3127);}function hasOwn(_0x59e067,_0x541253){const _0x2a65ac=a140_0x3c8ca0;return Object[_0x2a65ac(0x225)][_0x2a65ac(0x209)][_0x2a65ac(0x1b2)](_0x59e067,_0x541253);}async function readStdin(){const _0x3e03a7=a140_0x3c8ca0;let _0x54a308='';process[_0x3e03a7(0x21b)][_0x3e03a7(0x206)]('utf8');for await(const _0x2a721b of process['stdin'])_0x54a308+=_0x2a721b;return _0x54a308;}
|
|
1
|
+
const a141_0x3f52d5=a141_0x4fa3;(function(_0x486db6,_0x56f907){const _0x3f733e=a141_0x4fa3,_0x5a0106=_0x486db6();while(!![]){try{const _0x210e77=-parseInt(_0x3f733e(0x229))/0x1+parseInt(_0x3f733e(0x24e))/0x2+parseInt(_0x3f733e(0x216))/0x3*(parseInt(_0x3f733e(0x22b))/0x4)+parseInt(_0x3f733e(0x25b))/0x5+-parseInt(_0x3f733e(0x254))/0x6+parseInt(_0x3f733e(0x24f))/0x7*(-parseInt(_0x3f733e(0x25e))/0x8)+parseInt(_0x3f733e(0x1f6))/0x9;if(_0x210e77===_0x56f907)break;else _0x5a0106['push'](_0x5a0106['shift']());}catch(_0x5ea669){_0x5a0106['push'](_0x5a0106['shift']());}}}(a141_0x145e,0x1d036));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',a141_0x3f52d5(0x257),a141_0x3f52d5(0x20c),'WECOM',a141_0x3f52d5(0x202)];export const DEFAULT_NOTIFICATION_CONNECT_TIMEOUT=0x1388;export const DEFAULT_NOTIFICATION_READ_TIMEOUT=0x2710;const ALLOWED_INPUT_FIELDS=new Set([a141_0x3f52d5(0x1ee),a141_0x3f52d5(0x20d),a141_0x3f52d5(0x239),a141_0x3f52d5(0x25d),'description',a141_0x3f52d5(0x248),a141_0x3f52d5(0x219)]),FORBIDDEN_IDENTITY_FIELDS=new Set(['id','appCode',a141_0x3f52d5(0x251),a141_0x3f52d5(0x25c)]),EMAIL_RECIPIENT_FIELDS=new Set(['emailTargets','recipients',a141_0x3f52d5(0x203),a141_0x3f52d5(0x201),a141_0x3f52d5(0x237),a141_0x3f52d5(0x22c),a141_0x3f52d5(0x255),'to','cc']);export const NOTIFICATION_INPUT_FLAGS=[{'name':a141_0x3f52d5(0x259),'type':a141_0x3f52d5(0x245),'required':![],'description':a141_0x3f52d5(0x21a)},{'name':'stdin','type':a141_0x3f52d5(0x218),'required':![],'default':![],'description':a141_0x3f52d5(0x1e4)},{'name':a141_0x3f52d5(0x22a),'type':a141_0x3f52d5(0x245),'required':![],'description':'Read\x20the\x20notification\x20JSON\x20document\x20from\x20a\x20named\x20environment\x20variable'}];export const NOTIFICATION_ID_FLAG={'name':'id','type':a141_0x3f52d5(0x209),'required':!![],'description':a141_0x3f52d5(0x223)};export const NOTIFICATION_APP_FLAG=APPCODE_FLAG_OPTIONAL;function a141_0x145e(){const _0x42b3a6=['dry-run','Run\x20the\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.','672897MhuMvA','\x20has\x20an\x20invalid\x20channelType.','boolean','readTimeout','Read\x20the\x20notification\x20JSON\x20document\x20from\x20a\x20UTF-8\x20file','every','Notification\x20config\x20','yes','Unable\x20to\x20read\x20notification\x20JSON\x20from\x20','\x20has\x20invalid\x20field\x20\x22','\x20failed.','mutation','includes','Application-level\x20notification\x20config\x20ID','Update\x20JSON\x20must\x20contain\x20at\x20least\x20one\x20allowed\x20field.','Notification\x20config\x20detail\x20did\x20not\x20contain\x20the\x20requested\x20ID\x20','prototype','notification_config_channel_field_forbidden','hasOwnProperty','178982iWGvbk','from-env','4tQlYsE','subjectPrefix','bool','keys','\x22\x20cannot\x20exceed\x20','\x20must\x20be\x20an\x20object.','Notification\x20JSON\x20from\x20','a\x20JSON\x20object\x20or\x20null','utf8','isArray','\x22channelType\x22.','Inspect\x20with\x20rabetbase\x20notification\x20config-list\x20--appcode\x20','replyTo','Notification\x20JSON\x20environment\x20variable\x20is\x20not\x20set:\x20','endpointUrl','\x22\x20is\x20forbidden.','notification_config_confirmation_required','file\x20','appCode','Item\x20','endpointUrlRaw','isSafeInteger','--id\x20must\x20be\x20a\x20positive\x20safe\x20integer.','endpointUrl:null','validation','preflight','string','Provide\x20one\x20valid\x20JSON\x20object;\x20source\x20contents\x20are\x20not\x20included\x20in\x20errors.','notification_config_json_invalid','connectTimeout','messageTemplate','notification_config_id_invalid','notification_config_update_empty','This\x20notification\x20config\x20mutation\x20requires\x20explicit\x20--yes.','_unavailable','356498hliAXT','14ktjguZ','channelConfigRaw','configCode','some','Notification\x20JSON\x20source\x20is\x20ambiguous.','1187988TuGMbA','fromName','a\x20JSON\x20object','FEISHU','num','file','\x20is\x20missing\x20required\x20field\x20\x22','822990kXmECI','channelCode','channelConfig','798032sfGhXr','Unknown\x20notification\x20JSON\x20field\x20\x22','\x20characters.','create','a\x20non-empty\x20string','Notification\x20config\x20list\x20item\x20','notification_config_field_forbidden','Read\x20the\x20notification\x20JSON\x20document\x20from\x20stdin','notification_config_field_invalid','\x22configName\x22.','str','entries','EMAIL','push','env','failed','description','configName','notification_config_response_invalid','a\x20supported\x20string','Notification\x20JSON\x20field\x20\x22','stdin','notification_config_','kind','path','1153620qEOpuL','Create\x20JSON\x20requires\x20field\x20','\x22\x20must\x20be\x20','a\x20string\x20or\x20null','\x20--type\x20','setEncoding','name','trim','Use\x20exactly\x20one\x20of\x20--file\x20<path>,\x20--stdin,\x20or\x20--from-env\x20<NAME>.','Notification\x20JSON\x20field\x20\x22channelType\x22\x20is\x20unsupported.','updateTime','bccList','WEBHOOK','ccList','update','environment\x20variable\x20','\x20has\x20an\x20unsupported\x20channelType.','\x20--type\x20<CHANNEL_TYPE>\x20--format\x20compress;\x20no\x20mutation\x20was\x20submitted.','\x20does\x20not\x20belong\x20to\x20the\x20resolved\x20app.','number','Allowed\x20values:\x20','notification_config_source_unavailable','DINGTALK','channelType','parse','\x22\x20must\x20be\x20a\x20non-empty\x20string.','createTime','length','has','join'];a141_0x145e=function(){return _0x42b3a6;};return a141_0x145e();}function a141_0x4fa3(_0x4a3794,_0x4c2a28){_0x4a3794=_0x4a3794-0x1e0;const _0x145eca=a141_0x145e();let _0x4fa35c=_0x145eca[_0x4a3794];return _0x4fa35c;}export function notificationError(_0x593951,_0x2bb944,_0x4871ac){return new CliError(_0x593951,0x1,_0x2bb944,_0x4871ac);}export function readNotificationId(_0x3d4f79){const _0x56b908=a141_0x3f52d5,_0x4a3149=_0x3d4f79[_0x56b908(0x258)]('id');if(!Number[_0x56b908(0x240)](_0x4a3149)||_0x4a3149<=0x0)throw notificationError(_0x56b908(0x24a),_0x56b908(0x241));return _0x4a3149;}export function requireNotificationExplicitYes(_0x2bdc7c){const _0x1a4866=a141_0x3f52d5;if(_0x2bdc7c[_0x1a4866(0x22d)](_0x1a4866(0x214))||_0x2bdc7c[_0x1a4866(0x22d)](_0x1a4866(0x21d)))return;throw notificationError(_0x1a4866(0x23b),_0x1a4866(0x24c),_0x1a4866(0x215));}export function readNotificationChannelType(_0x5a7a72,_0x4f2718='type',_0xd7467a=a141_0x3f52d5(0x1e9)){const _0x12e9d7=a141_0x3f52d5,_0x556172=_0x5a7a72['str'](_0x4f2718)[_0x12e9d7(0x1fd)]()||_0xd7467a;if(!NOTIFICATION_CHANNEL_TYPES[_0x12e9d7(0x222)](_0x556172))throw CliErrors[_0x12e9d7(0x243)]('Invalid\x20--'+_0x4f2718+':\x20'+_0x556172,_0x12e9d7(0x20a)+NOTIFICATION_CHANNEL_TYPES[_0x12e9d7(0x213)](',\x20')+'.');return _0x556172;}export function assertSingleNotificationSource(_0x3f372d){const _0x7536f=a141_0x3f52d5,_0x22251f=[],_0x43307b=_0x3f372d[_0x7536f(0x1e7)]('file')[_0x7536f(0x1fd)]();if(_0x43307b)_0x22251f[_0x7536f(0x1ea)]({'kind':'file','path':_0x43307b});if(_0x3f372d[_0x7536f(0x22d)](_0x7536f(0x1f2)))_0x22251f[_0x7536f(0x1ea)]({'kind':_0x7536f(0x1f2)});const _0xd3392f=_0x3f372d[_0x7536f(0x1e7)]('from-env')[_0x7536f(0x1fd)]();if(_0xd3392f)_0x22251f[_0x7536f(0x1ea)]({'kind':'env','name':_0xd3392f});if(_0x22251f['length']===0x0)throw CliErrors[_0x7536f(0x243)]('Missing\x20notification\x20JSON\x20source.',_0x7536f(0x1fe));if(_0x22251f[_0x7536f(0x211)]>0x1)throw CliErrors[_0x7536f(0x243)](_0x7536f(0x253),'Use\x20exactly\x20one\x20of\x20--file\x20<path>,\x20--stdin,\x20or\x20--from-env\x20<NAME>.');return _0x22251f[0x0];}export async function readNotificationDocument(_0x398a49,_0x513968){const _0x581e3e=a141_0x3f52d5,_0x3de9e1=assertSingleNotificationSource(_0x398a49),_0x5c69a4=_0x3de9e1['kind']===_0x581e3e(0x259)?_0x581e3e(0x23c)+_0x3de9e1[_0x581e3e(0x1f5)]:_0x3de9e1[_0x581e3e(0x1f4)]==='env'?_0x581e3e(0x205)+_0x3de9e1['name']:_0x581e3e(0x1f2);let _0x3abd94;try{if(_0x3de9e1[_0x581e3e(0x1f4)]===_0x581e3e(0x259))_0x3abd94=await readFile(_0x3de9e1[_0x581e3e(0x1f5)],_0x581e3e(0x233));else{if(_0x3de9e1[_0x581e3e(0x1f4)]===_0x581e3e(0x1eb)){if(!(_0x3de9e1[_0x581e3e(0x1fc)]in process.env))throw notificationError('notification_config_source_unavailable',_0x581e3e(0x238)+_0x3de9e1[_0x581e3e(0x1fc)]);_0x3abd94=process.env[_0x3de9e1.name]??'';}else _0x3abd94=await readStdin();}}catch(_0x56a276){if(_0x56a276 instanceof CliError)throw _0x56a276;throw notificationError(_0x581e3e(0x20b),_0x581e3e(0x21e)+_0x5c69a4+'.');}let _0xff9282;try{_0xff9282=JSON[_0x581e3e(0x20e)](_0x3abd94);}catch{throw notificationError(_0x581e3e(0x247),_0x581e3e(0x231)+_0x5c69a4+'\x20is\x20invalid.',_0x581e3e(0x246));}if(!isJsonObject(_0xff9282))throw notificationError(_0x581e3e(0x247),_0x581e3e(0x231)+_0x5c69a4+_0x581e3e(0x230));return validateNotificationDocument(_0xff9282,_0x513968);}export function projectNotificationListConfig(_0x598670,_0xf0903a){const _0x4f930c=a141_0x3f52d5;return{'id':typeof _0x598670['id']===_0x4f930c(0x209)?_0x598670['id']:null,'configCode':requireResponseString(_0x598670[_0x4f930c(0x251)],_0x4f930c(0x251),_0xf0903a),'configName':requireResponseString(_0x598670[_0x4f930c(0x1ee)],'configName',_0xf0903a),'channelType':requireResponseString(_0x598670[_0x4f930c(0x20d)],'channelType',_0xf0903a),'description':normalizeNullableString(_0x598670['description']),'createTime':normalizeNullableString(_0x598670[_0x4f930c(0x210)]),'updateTime':normalizeNullableString(_0x598670[_0x4f930c(0x200)])};}export function normalizeExactNotificationConfig(_0x25c707,_0x488434,_0x3acaaa){const _0x22e577=a141_0x3f52d5;if(!Number[_0x22e577(0x240)](_0x25c707['id'])||_0x25c707['id']!==_0x488434)throw notificationError(_0x22e577(0x1ef),_0x22e577(0x225)+_0x488434+'.');if(_0x25c707['appCode']!==_0x3acaaa)throw notificationError(_0x22e577(0x1ef),_0x22e577(0x21c)+_0x488434+_0x22e577(0x208));const _0x34558c=requireExactString(_0x25c707['configName'],_0x22e577(0x1ee),_0x488434),_0x5e89ae=requireExactString(_0x25c707[_0x22e577(0x251)],_0x22e577(0x251),_0x488434),_0xf20f1e=requireExactString(_0x25c707[_0x22e577(0x20d)],_0x22e577(0x20d),_0x488434);if(!NOTIFICATION_CHANNEL_TYPES[_0x22e577(0x222)](_0xf20f1e))throw notificationError(_0x22e577(0x1ef),_0x22e577(0x21c)+_0x488434+_0x22e577(0x206));const _0x49c75b=responseNullableString(_0x25c707['endpointUrl'],_0x22e577(0x239),_0x488434),_0x4928f1=responseNullableString(_0x25c707[_0x22e577(0x25d)],_0x22e577(0x25d),_0x488434),_0x296e18=responseNullableString(_0x25c707[_0x22e577(0x1ed)],'description',_0x488434),_0x25de23=responseNullableTimeout(_0x25c707['connectTimeout'],_0x22e577(0x248),_0x488434),_0x431d50=responseNullableTimeout(_0x25c707[_0x22e577(0x219)],'readTimeout',_0x488434);return{'id':_0x488434,'appCode':_0x3acaaa,'configCode':_0x5e89ae,'configName':_0x34558c,'channelType':_0xf20f1e,'endpointUrl':redactSensitive(_0x49c75b),'channelConfig':redactSensitive(_0x4928f1),'description':_0x296e18,'connectTimeout':_0x25de23,'readTimeout':_0x431d50,'endpointUrlRaw':_0x49c75b,'channelConfigRaw':_0x4928f1};}export async function requireExactNotificationConfig(_0x234e16,_0xf590ce,_0x39e2b8){const _0x51be16=a141_0x3f52d5;let _0x18cb24;try{_0x18cb24=await getNotificationChannelConfig(_0xf590ce,_0x234e16);}catch{throw safeApiFailure(_0x39e2b8,_0x51be16(0x244),_0x51be16(0x236)+_0x234e16+_0x51be16(0x207));}return normalizeExactNotificationConfig(_0x18cb24,_0xf590ce,_0x234e16);}export function projectNotificationConfig(_0xff3e2){const _0x353de4=a141_0x3f52d5;return{'id':_0xff3e2['id']??null,'appCode':_0xff3e2[_0x353de4(0x23d)],'configCode':_0xff3e2[_0x353de4(0x251)]??null,'configName':_0xff3e2[_0x353de4(0x1ee)],'channelType':_0xff3e2[_0x353de4(0x20d)],'endpointUrl':redactSensitive(_0xff3e2['endpointUrl']),'channelConfig':redactSensitive(_0xff3e2[_0x353de4(0x25d)]),'description':_0xff3e2['description']??null,'connectTimeout':_0xff3e2['connectTimeout']??null,'readTimeout':_0xff3e2[_0x353de4(0x219)]??null};}export function notificationSelector(_0x4b7c41){const _0x3cff3f=a141_0x3f52d5;return{'appCode':_0x4b7c41[_0x3cff3f(0x23d)],'id':_0x4b7c41['id'],'configCode':_0x4b7c41['configCode'],'configName':_0x4b7c41[_0x3cff3f(0x1ee)],'channelType':_0x4b7c41[_0x3cff3f(0x20d)]};}export function createMutationInput(_0x222b93,_0x29c69f){const _0xe35129=a141_0x3f52d5;return{'appCode':_0x222b93,'configName':_0x29c69f[_0xe35129(0x1ee)],'channelType':_0x29c69f[_0xe35129(0x20d)],...hasOwn(_0x29c69f,_0xe35129(0x239))?{'endpointUrl':_0x29c69f['endpointUrl']}:{},...hasOwn(_0x29c69f,'channelConfig')?{'channelConfig':serializeChannelConfig(_0x29c69f[_0xe35129(0x25d)])}:{},...hasOwn(_0x29c69f,_0xe35129(0x1ed))?{'description':_0x29c69f[_0xe35129(0x1ed)]}:{},...hasOwn(_0x29c69f,_0xe35129(0x248))?{'connectTimeout':_0x29c69f[_0xe35129(0x248)]}:{},...hasOwn(_0x29c69f,_0xe35129(0x219))?{'readTimeout':_0x29c69f[_0xe35129(0x219)]}:{}};}export function mergeUpdateInput(_0x48fab2,_0x44a4be){const _0x1826bd=a141_0x3f52d5;return{'id':_0x48fab2['id'],'appCode':_0x48fab2[_0x1826bd(0x23d)],'configName':_0x44a4be[_0x1826bd(0x1ee)]??_0x48fab2['configName'],'channelType':_0x44a4be['channelType']??_0x48fab2[_0x1826bd(0x20d)],'endpointUrl':hasOwn(_0x44a4be,'endpointUrl')?_0x44a4be[_0x1826bd(0x239)]:_0x48fab2[_0x1826bd(0x23f)],'channelConfig':hasOwn(_0x44a4be,_0x1826bd(0x25d))?serializeChannelConfig(_0x44a4be[_0x1826bd(0x25d)]):_0x48fab2[_0x1826bd(0x250)],'description':hasOwn(_0x44a4be,_0x1826bd(0x1ed))?_0x44a4be[_0x1826bd(0x1ed)]:_0x48fab2['description'],'connectTimeout':hasOwn(_0x44a4be,'connectTimeout')?_0x44a4be[_0x1826bd(0x248)]:_0x48fab2[_0x1826bd(0x248)],'readTimeout':hasOwn(_0x44a4be,_0x1826bd(0x219))?_0x44a4be['readTimeout']:_0x48fab2['readTimeout']};}export function plannedUpdateProjection(_0x16793a,_0x2ed580){const _0x5f1e96=a141_0x3f52d5;return projectNotificationConfig({'id':_0x16793a['id'],'appCode':_0x16793a['appCode'],'configCode':_0x16793a[_0x5f1e96(0x251)],'configName':_0x2ed580[_0x5f1e96(0x1ee)]??_0x16793a[_0x5f1e96(0x1ee)],'channelType':_0x2ed580['channelType']??_0x16793a[_0x5f1e96(0x20d)],'endpointUrl':hasOwn(_0x2ed580,_0x5f1e96(0x239))?_0x2ed580[_0x5f1e96(0x239)]:_0x16793a[_0x5f1e96(0x23f)],'channelConfig':hasOwn(_0x2ed580,_0x5f1e96(0x25d))?_0x2ed580[_0x5f1e96(0x25d)]:_0x16793a[_0x5f1e96(0x250)],'description':hasOwn(_0x2ed580,_0x5f1e96(0x1ed))?_0x2ed580[_0x5f1e96(0x1ed)]:_0x16793a[_0x5f1e96(0x1ed)],'connectTimeout':hasOwn(_0x2ed580,_0x5f1e96(0x248))?_0x2ed580[_0x5f1e96(0x248)]??DEFAULT_NOTIFICATION_CONNECT_TIMEOUT:_0x16793a[_0x5f1e96(0x248)],'readTimeout':hasOwn(_0x2ed580,_0x5f1e96(0x219))?_0x2ed580['readTimeout']??DEFAULT_NOTIFICATION_READ_TIMEOUT:_0x16793a[_0x5f1e96(0x219)]});}export function requestedSafeFieldsMatch(_0x227c5d,_0x4e7296,_0x2973db){const _0x52f0ce=a141_0x3f52d5,_0x3d8593=[],_0x44787c=[],_0x322b88=[];for(const _0x4ad0ec of[_0x52f0ce(0x1ee),'channelType',_0x52f0ce(0x1ed)]){if(!hasOwn(_0x2973db,_0x4ad0ec))continue;_0x322b88['push'](_0x4ad0ec),_0x3d8593[_0x52f0ce(0x1ea)](_0x4e7296[_0x4ad0ec]===_0x2973db[_0x4ad0ec]),_0x44787c[_0x52f0ce(0x1ea)](_0x227c5d[_0x4ad0ec]!==_0x2973db[_0x4ad0ec]&&_0x4e7296[_0x4ad0ec]===_0x2973db[_0x4ad0ec]);}for(const _0x415807 of[_0x52f0ce(0x248),'readTimeout']){if(!hasOwn(_0x2973db,_0x415807))continue;const _0x28e346=_0x2973db[_0x415807]??(_0x415807==='connectTimeout'?DEFAULT_NOTIFICATION_CONNECT_TIMEOUT:DEFAULT_NOTIFICATION_READ_TIMEOUT);_0x322b88[_0x52f0ce(0x1ea)](_0x415807),_0x3d8593[_0x52f0ce(0x1ea)](_0x4e7296[_0x415807]===_0x28e346),_0x44787c[_0x52f0ce(0x1ea)](_0x227c5d[_0x415807]!==_0x28e346&&_0x4e7296[_0x415807]===_0x28e346);}return hasOwn(_0x2973db,_0x52f0ce(0x239))&&_0x2973db[_0x52f0ce(0x239)]===null&&(_0x322b88[_0x52f0ce(0x1ea)](_0x52f0ce(0x242)),_0x3d8593['push'](_0x4e7296[_0x52f0ce(0x23f)]===null||_0x4e7296[_0x52f0ce(0x23f)]===''),_0x44787c['push'](_0x227c5d[_0x52f0ce(0x23f)]!==null&&_0x227c5d[_0x52f0ce(0x23f)]!==''&&(_0x4e7296[_0x52f0ce(0x23f)]===null||_0x4e7296['endpointUrlRaw']===''))),{'allMatch':_0x3d8593[_0x52f0ce(0x21b)](Boolean),'provesChange':_0x44787c[_0x52f0ce(0x252)](Boolean),'verifiedFields':_0x322b88};}export function validateNotificationDeleteReadback(_0x36071d,_0x59ce20,_0x313533){const _0x257a0f=a141_0x3f52d5;for(const [_0x434969,_0x3b8465]of _0x36071d[_0x257a0f(0x1e8)]()){if(!Number['isSafeInteger'](_0x3b8465['id'])||_0x3b8465['id']<=0x0)throw notificationError(_0x257a0f(0x1ef),_0x257a0f(0x1e2)+(_0x434969+0x1)+'\x20has\x20an\x20invalid\x20id.');if(_0x3b8465['appCode']!==_0x59ce20)throw notificationError(_0x257a0f(0x1ef),_0x257a0f(0x1e2)+(_0x434969+0x1)+'\x20has\x20an\x20invalid\x20appCode.');if(_0x3b8465[_0x257a0f(0x20d)]!==_0x313533)throw notificationError('notification_config_response_invalid',_0x257a0f(0x1e2)+(_0x434969+0x1)+_0x257a0f(0x217));}}export function safeApiFailure(_0x1994f3,_0x3d0414,_0x2fdd62){const _0x1a59bb=a141_0x3f52d5;return notificationError(_0x1a59bb(0x1f3)+_0x1994f3+'_'+(_0x3d0414===_0x1a59bb(0x221)?_0x1a59bb(0x1ec):_0x3d0414+_0x1a59bb(0x24d)),_0x1a59bb(0x21c)+_0x1994f3+'\x20'+_0x3d0414+_0x1a59bb(0x220),_0x2fdd62);}export function notificationLookupCommand(_0x189fa6,_0x40458a){const _0x316318=a141_0x3f52d5;return'rabetbase\x20notification\x20config-list\x20--appcode\x20'+_0x189fa6+_0x316318(0x1fa)+_0x40458a+'\x20--format\x20compress';}function validateNotificationDocument(_0x6fcc0f,_0x10d663){const _0x93e8ad=a141_0x3f52d5;for(const _0x323054 of Object[_0x93e8ad(0x22e)](_0x6fcc0f)){if(FORBIDDEN_IDENTITY_FIELDS[_0x93e8ad(0x212)](_0x323054))throw notificationError(_0x93e8ad(0x1e3),_0x93e8ad(0x1f1)+_0x323054+'\x22\x20is\x20controlled\x20by\x20the\x20CLI\x20or\x20server\x20and\x20is\x20forbidden.');if(!ALLOWED_INPUT_FIELDS[_0x93e8ad(0x212)](_0x323054))throw notificationError('notification_config_field_unknown',_0x93e8ad(0x25f)+_0x323054+'\x22.');}if(_0x10d663===_0x93e8ad(0x204)&&Object[_0x93e8ad(0x22e)](_0x6fcc0f)[_0x93e8ad(0x211)]===0x0)throw notificationError(_0x93e8ad(0x24b),_0x93e8ad(0x224));const _0x3d2bb6={};if(hasOwn(_0x6fcc0f,_0x93e8ad(0x1ee)))_0x3d2bb6[_0x93e8ad(0x1ee)]=validateRequiredString(_0x6fcc0f[_0x93e8ad(0x1ee)],_0x93e8ad(0x1ee),0x80);else{if(_0x10d663===_0x93e8ad(0x1e0))throw notificationError('notification_config_field_required',_0x93e8ad(0x1f7)+_0x93e8ad(0x1e6));}if(hasOwn(_0x6fcc0f,'channelType')){if(typeof _0x6fcc0f[_0x93e8ad(0x20d)]!=='string')throw invalidFieldType(_0x93e8ad(0x20d),_0x93e8ad(0x1f0));const _0x2b4ce5=_0x6fcc0f[_0x93e8ad(0x20d)][_0x93e8ad(0x1fd)]();if(!NOTIFICATION_CHANNEL_TYPES['includes'](_0x2b4ce5))throw notificationError(_0x93e8ad(0x1e5),_0x93e8ad(0x1ff),'Allowed\x20values:\x20'+NOTIFICATION_CHANNEL_TYPES['join'](',\x20')+'.');_0x3d2bb6[_0x93e8ad(0x20d)]=_0x2b4ce5;}else{if(_0x10d663===_0x93e8ad(0x1e0))throw notificationError('notification_config_field_required',_0x93e8ad(0x1f7)+_0x93e8ad(0x235));}for(const [_0x1d0b6b,_0x396087]of[[_0x93e8ad(0x239),0x200],[_0x93e8ad(0x1ed),0x100]]){if(!hasOwn(_0x6fcc0f,_0x1d0b6b))continue;const _0x1d0f4d=_0x6fcc0f[_0x1d0b6b];if(_0x1d0f4d!==null&&typeof _0x1d0f4d!==_0x93e8ad(0x245))throw invalidFieldType(_0x1d0b6b,_0x93e8ad(0x1f9));if(typeof _0x1d0f4d===_0x93e8ad(0x245)&&_0x1d0f4d[_0x93e8ad(0x211)]>_0x396087)throw notificationError(_0x93e8ad(0x1e5),_0x93e8ad(0x1f1)+_0x1d0b6b+_0x93e8ad(0x22f)+_0x396087+'\x20characters.');_0x3d2bb6[_0x1d0b6b]=_0x1d0f4d;}if(hasOwn(_0x6fcc0f,'channelConfig')){const _0x4ded85=_0x6fcc0f[_0x93e8ad(0x25d)];if(_0x4ded85===null&&_0x10d663==='create')throw invalidFieldType('channelConfig','a\x20JSON\x20object');if(_0x4ded85!==null&&!isJsonObject(_0x4ded85))throw invalidFieldType(_0x93e8ad(0x25d),_0x10d663==='update'?_0x93e8ad(0x232):_0x93e8ad(0x256));_0x4ded85!==null&&validateChannelConfigFields(_0x3d2bb6[_0x93e8ad(0x20d)],_0x4ded85),_0x3d2bb6[_0x93e8ad(0x25d)]=_0x4ded85;}for(const _0x4edadc of[_0x93e8ad(0x248),_0x93e8ad(0x219)]){if(!hasOwn(_0x6fcc0f,_0x4edadc))continue;const _0x35f6ee=_0x6fcc0f[_0x4edadc];if(_0x35f6ee!==null&&(!Number[_0x93e8ad(0x240)](_0x35f6ee)||_0x35f6ee<0x0))throw notificationError(_0x93e8ad(0x1e5),_0x93e8ad(0x1f1)+_0x4edadc+'\x22\x20must\x20be\x20a\x20non-negative\x20safe\x20integer\x20or\x20null.');_0x3d2bb6[_0x4edadc]=_0x35f6ee;}return _0x3d2bb6;}function validateRequiredString(_0x173855,_0x55799b,_0x42c798){const _0x190c89=a141_0x3f52d5;if(typeof _0x173855!==_0x190c89(0x245))throw invalidFieldType(_0x55799b,_0x190c89(0x1e1));const _0xa96bd2=_0x173855[_0x190c89(0x1fd)]();if(!_0xa96bd2)throw notificationError(_0x190c89(0x1e5),_0x190c89(0x1f1)+_0x55799b+_0x190c89(0x20f));if(_0xa96bd2[_0x190c89(0x211)]>_0x42c798)throw notificationError(_0x190c89(0x1e5),'Notification\x20JSON\x20field\x20\x22'+_0x55799b+_0x190c89(0x22f)+_0x42c798+_0x190c89(0x260));return _0xa96bd2;}function validateChannelConfigFields(_0x489f04,_0x4ab034){const _0x900f97=a141_0x3f52d5;if(hasOwn(_0x4ab034,_0x900f97(0x249)))throw forbiddenChannelConfigField(_0x900f97(0x249));if(_0x489f04===_0x900f97(0x1e9))for(const _0x2f1879 of EMAIL_RECIPIENT_FIELDS){if(hasOwn(_0x4ab034,_0x2f1879))throw forbiddenChannelConfigField(_0x2f1879);}}function forbiddenChannelConfigField(_0x1a34ab){const _0x10a731=a141_0x3f52d5;return notificationError(_0x10a731(0x227),'Notification\x20JSON\x20channelConfig\x20field\x20\x22'+_0x1a34ab+_0x10a731(0x23a));}function invalidFieldType(_0x4e6144,_0x1de7d6){const _0x249295=a141_0x3f52d5;return notificationError('notification_config_field_invalid',_0x249295(0x1f1)+_0x4e6144+_0x249295(0x1f8)+_0x1de7d6+'.');}function serializeChannelConfig(_0x12cb63){return _0x12cb63===null||_0x12cb63===undefined?null:JSON['stringify'](_0x12cb63);}function redactSensitive(_0x1408ff){return _0x1408ff===null||_0x1408ff===undefined||_0x1408ff===''?null:'<redacted>';}function requireResponseString(_0x182da4,_0x11a49f,_0x1a7381){const _0x4a62af=a141_0x3f52d5;if(typeof _0x182da4!==_0x4a62af(0x245)||_0x182da4[_0x4a62af(0x1fd)]()==='')throw CliErrors['apiError']('Invalid\x20notification\x20config\x20response.',_0x4a62af(0x23e)+(_0x1a7381+0x1)+_0x4a62af(0x25a)+_0x11a49f+'\x22.');return _0x182da4[_0x4a62af(0x1fd)]();}function requireExactString(_0x334535,_0x165b79,_0x5e2fca){const _0x4dff6a=a141_0x3f52d5;if(typeof _0x334535!==_0x4dff6a(0x245)||_0x334535['trim']()==='')throw notificationError(_0x4dff6a(0x1ef),'Notification\x20config\x20'+_0x5e2fca+_0x4dff6a(0x25a)+_0x165b79+'\x22.');return _0x334535[_0x4dff6a(0x1fd)]();}function responseNullableString(_0x498bf5,_0x1f2218,_0x382ec2){const _0x59ec6b=a141_0x3f52d5;if(_0x498bf5===undefined||_0x498bf5===null)return null;if(typeof _0x498bf5!==_0x59ec6b(0x245))throw notificationError(_0x59ec6b(0x1ef),_0x59ec6b(0x21c)+_0x382ec2+_0x59ec6b(0x21f)+_0x1f2218+'\x22.');return _0x498bf5;}function responseNullableTimeout(_0x1ae429,_0x16f0fa,_0x444b46){const _0xfb7ce4=a141_0x3f52d5;if(_0x1ae429===undefined||_0x1ae429===null)return null;if(!Number[_0xfb7ce4(0x240)](_0x1ae429)||_0x1ae429<0x0)throw notificationError(_0xfb7ce4(0x1ef),_0xfb7ce4(0x21c)+_0x444b46+_0xfb7ce4(0x21f)+_0x16f0fa+'\x22.');return _0x1ae429;}function normalizeNullableString(_0x43a44b){return typeof _0x43a44b==='string'?_0x43a44b:null;}function isJsonObject(_0x6beec5){const _0x2d2da8=a141_0x3f52d5;return _0x6beec5!==null&&typeof _0x6beec5==='object'&&!Array[_0x2d2da8(0x234)](_0x6beec5);}function hasOwn(_0x1a00b1,_0x2d8078){const _0x415c57=a141_0x3f52d5;return Object[_0x415c57(0x226)][_0x415c57(0x228)]['call'](_0x1a00b1,_0x2d8078);}async function readStdin(){const _0x2b52f6=a141_0x3f52d5;let _0x562dc4='';process[_0x2b52f6(0x1f2)][_0x2b52f6(0x1fb)]('utf8');for await(const _0x373d45 of process['stdin'])_0x562dc4+=_0x373d45;return _0x562dc4;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a142_0x1fb84c=a142_0x5b25;(function(_0x5ead76,_0x5dc2a9){const _0x1355d1=a142_0x5b25,_0x22401d=_0x5ead76();while(!![]){try{const _0x46da92=parseInt(_0x1355d1(0x1f9))/0x1+parseInt(_0x1355d1(0x205))/0x2+-parseInt(_0x1355d1(0x1ec))/0x3*(parseInt(_0x1355d1(0x1e7))/0x4)+parseInt(_0x1355d1(0x1e4))/0x5+-parseInt(_0x1355d1(0x1ea))/0x6+-parseInt(_0x1355d1(0x1f7))/0x7+-parseInt(_0x1355d1(0x1fa))/0x8;if(_0x46da92===_0x5dc2a9)break;else _0x22401d['push'](_0x22401d['shift']());}catch(_0x58736e){_0x22401d['push'](_0x22401d['shift']());}}}(a142_0x4375,0xb9496));import{requireDevelopmentUploadFile}from'../../commands/common/local-file.js';import{queryDevelopmentFileUrl,recognizeDevelopmentOcr,uploadDevelopmentFile}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const SUPPORTED_SCENES=['invoice','general','form',a142_0x1fb84c(0x1f5)],SCENE_TO_LEGACY_TYPE={'invoice':a142_0x1fb84c(0x1e9),'general':'General','form':a142_0x1fb84c(0x1e6),'idCard':'IdCard'},SCENE_FLAG={'name':a142_0x1fb84c(0x1e8),'type':a142_0x1fb84c(0x204),'required':!![],'enum':[...SUPPORTED_SCENES],'description':a142_0x1fb84c(0x1fd)},IMAGE_FILE_FLAG={'name':a142_0x1fb84c(0x1db),'type':a142_0x1fb84c(0x204),'description':a142_0x1fb84c(0x1ed)},IMAGE_URL_FLAG={'name':a142_0x1fb84c(0x1ff),'type':a142_0x1fb84c(0x204),'description':a142_0x1fb84c(0x1f3)};function normalizeScene(_0x1e5c23){const _0x2cceb4=a142_0x1fb84c,_0x1cee33=_0x1e5c23['trim']()['toLowerCase']();if(_0x1cee33===_0x2cceb4(0x1e0))return _0x2cceb4(0x1f5);if(_0x1cee33===_0x2cceb4(0x1eb)||_0x1cee33==='general'||_0x1cee33===_0x2cceb4(0x1e3))return _0x1cee33;throw CliErrors['validation'](_0x2cceb4(0x1f0)+_0x1e5c23+_0x2cceb4(0x1f2)+SUPPORTED_SCENES[_0x2cceb4(0x1d7)](',\x20'));}function selectedInputs(_0x154f5e){const _0x3497e6=a142_0x1fb84c,_0x24147f=_0x154f5e[_0x3497e6(0x1dc)](_0x3497e6(0x1db))[_0x3497e6(0x1fb)](),_0x1e8be9=_0x154f5e[_0x3497e6(0x1dc)](_0x3497e6(0x1ff))[_0x3497e6(0x1fb)]();return{'imageFile':_0x24147f,'imageUrl':_0x1e8be9,'count':[_0x24147f,_0x1e8be9]['filter'](Boolean)['length']};}function a142_0x4375(){const _0x5eccef=['\x20OCR\x20from\x20URL','imageFile','Unsupported\x20OCR\x20scene:\x20','appCode','.\x20Supported\x20scenes:\x20','Publicly\x20accessible\x20image\x20or\x20file\x20URL','Preview:\x20recognize\x20','idCard','path','6377476DCadNU','File\x20URL\x20response\x20missing\x20fileUrl.','468850UWswgF','13312jIHRzR','trim','Choose\x20exactly\x20one\x20OCR\x20input:\x20--image-file\x20or\x20--image-url.','OCR\x20scene:\x20invoice,\x20general,\x20form,\x20or\x20idCard','POST','image-url','\x20OCR','imageUrl','GET','fileUrl','string','2898372ZerkhC','join','filePath','recognize','/smartapi/common/uploadFile','image-file','str','Preview:\x20upload\x20local\x20file,\x20query\x20temporary\x20URL,\x20then\x20recognize\x20','read','<filePath\x20returned\x20by\x20/smartapi/common/uploadFile>','idcard','toString','File\x20upload\x20response\x20missing\x20filePath.','form','7111205bONgTn','apiError','Table','4qMQQcd','scene','Invoice','2037228wJXrqM','invoice','3987219EZzpvY','Local\x20image\x20or\x20PDF\x20file;\x20uses\x20upload\x20->\x20query-url\x20->\x20OCR'];a142_0x4375=function(){return _0x5eccef;};return a142_0x4375();}function validateInputSelection(_0x33341f){const _0x37eeca=a142_0x1fb84c,_0x391994=selectedInputs(_0x33341f);if(_0x391994['count']!==0x1)throw CliErrors['validation'](_0x37eeca(0x1fc));return _0x391994;}function withScene(_0x5e7faf,_0x2709a0,_0x4b0fc9){return{..._0x5e7faf,'scene':_0x2709a0,..._0x4b0fc9?{'sourceFile':{'fileName':_0x4b0fc9['fileName'],'filePath':_0x4b0fc9['filePath']}}:{}};}const ocrRecognize={'service':'ocr','command':a142_0x1fb84c(0x1d9),'description':'提取票证类业务材料中的文字与结构化字段;不用于通用图片理解','risk':a142_0x1fb84c(0x1de),'flags':[SCENE_FLAG,IMAGE_FILE_FLAG,IMAGE_URL_FLAG],async 'dryRun'(_0x5d1488){const _0x49be07=a142_0x1fb84c,_0x571915=normalizeScene(_0x5d1488[_0x49be07(0x1dc)](_0x49be07(0x1e8))),_0x1e49b8=SCENE_TO_LEGACY_TYPE[_0x571915],_0x66983b=validateInputSelection(_0x5d1488);if(_0x66983b[_0x49be07(0x201)]){const _0xe811d9=new URLSearchParams({'url':_0x66983b[_0x49be07(0x201)],'type':_0x1e49b8,'appCode':_0x5d1488['appCode']});return{'method':_0x49be07(0x202),'url':'/smartapi/ocr/recognize-text?'+_0xe811d9[_0x49be07(0x1e1)](),'description':_0x49be07(0x1f4)+_0x571915+_0x49be07(0x1ee)};}const _0x26aeee=requireDevelopmentUploadFile(_0x66983b[_0x49be07(0x1ef)],_0x49be07(0x1db));return{'method':_0x49be07(0x1fe),'url':'/smartapi/common/uploadFile','body':{'steps':[{'method':_0x49be07(0x1fe),'url':_0x49be07(0x1da),'body':{'appCode':_0x5d1488['appCode'],'multipart':{'file':_0x26aeee}}},{'method':_0x49be07(0x1fe),'url':'/smartapi/common/queryFileUrl','body':{'filePath':_0x49be07(0x1df),'downloadFlag':![]}},{'method':_0x49be07(0x202),'url':'/smartapi/ocr/recognize-text','query':{'appCode':_0x5d1488[_0x49be07(0x1f1)],'url':'<fileUrl\x20returned\x20by\x20/smartapi/common/queryFileUrl>','type':_0x1e49b8}}]},'description':_0x49be07(0x1dd)+_0x571915+_0x49be07(0x200)};},async 'execute'(_0x5d60ef){const _0x2ca85c=a142_0x1fb84c,_0x16af21=normalizeScene(_0x5d60ef['str']('scene')),_0x4f8943=SCENE_TO_LEGACY_TYPE[_0x16af21],_0x3e5f4d=validateInputSelection(_0x5d60ef);if(_0x3e5f4d[_0x2ca85c(0x201)]){const _0x332666=await recognizeDevelopmentOcr(_0x5d60ef['appCode'],{'url':_0x3e5f4d['imageUrl'],'type':_0x4f8943});return{'ok':!![],'data':withScene(_0x332666,_0x16af21)};}const _0x5a5ed8=requireDevelopmentUploadFile(_0x3e5f4d[_0x2ca85c(0x1ef)],'image-file'),_0x3c346a=await uploadDevelopmentFile(_0x5d60ef['appCode'],_0x5a5ed8[_0x2ca85c(0x1f6)]);if(!_0x3c346a[_0x2ca85c(0x1d8)])throw CliErrors['apiError'](_0x2ca85c(0x1e2));const _0x4f32c9=await queryDevelopmentFileUrl(_0x3c346a[_0x2ca85c(0x1d8)],{'download':![]});if(!_0x4f32c9[_0x2ca85c(0x203)])throw CliErrors[_0x2ca85c(0x1e5)](_0x2ca85c(0x1f8));const _0x3e32c1=await recognizeDevelopmentOcr(_0x5d60ef[_0x2ca85c(0x1f1)],{'url':_0x4f32c9['fileUrl'],'type':_0x4f8943});return{'ok':!![],'data':withScene(_0x3e32c1,_0x16af21,_0x3c346a)};}};function a142_0x5b25(_0x4e8532,_0x1f3866){_0x4e8532=_0x4e8532-0x1d7;const _0x437592=a142_0x4375();let _0x5b2567=_0x437592[_0x4e8532];return _0x5b2567;}export const ocrDefinitions=[ocrRecognize];
|