@lovrabet/rabetbase-cli 2.5.2-beta.2 → 2.5.2-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- 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/api/generate-sdk-config-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.d.ts +1 -0
- 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/delete.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.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/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-restore.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/dataset/user-deleted-field-list.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/table-diff-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/deployment/auto-sync.js +1 -1
- package/lib/commands/deployment/index.js +1 -1
- package/lib/commands/deployment/sync-all.js +1 -1
- package/lib/commands/deployment/sync-jobs.js +1 -1
- package/lib/commands/deployment/sync-status.js +1 -1
- package/lib/commands/deployment/sync.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/instant-api-policy/current.js +1 -1
- package/lib/commands/instant-api-policy/index.js +1 -1
- package/lib/commands/instant-api-policy/init.js +1 -1
- package/lib/commands/instant-api-policy/publish.js +1 -1
- package/lib/commands/instant-api-policy/pull.js +1 -1
- package/lib/commands/instant-api-policy/revision.js +1 -1
- package/lib/commands/instant-api-policy/revisions.js +1 -1
- package/lib/commands/instant-api-policy/rollback.js +1 -1
- package/lib/commands/instant-api-policy/shared.js +1 -1
- package/lib/commands/instant-api-policy/validate.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/search.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/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.d.ts +0 -8
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.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/domain-routing-sync.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/rule/get.js +1 -1
- package/lib/commands/rule/index.js +1 -1
- package/lib/commands/rule/list.js +1 -1
- package/lib/commands/rule/set.js +1 -1
- package/lib/commands/rule/shared.js +1 -1
- package/lib/commands/run/index.d.ts +4 -0
- 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/domain-config.d.ts +3 -7
- package/lib/config/domain-config.js +1 -1
- package/lib/config/project-domain-routing.d.ts +5 -1
- package/lib/config/project-domain-routing.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/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/routing-profile.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.d.ts +1 -26
- 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/instant-api-policy/config.js +1 -1
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/page/file-system.d.ts +43 -0
- 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/supported-flags.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/generated/official-routing.d.ts +1 -1
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.d.ts +1 -3
- package/lib/generated/routing-contract.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/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +2 -1
- package/skills/rabetbase/SKILL.md +6 -6
- package/skills/rabetbase/guides/custom-page-workflow.md +35 -17
- package/skills/rabetbase/guides/page-development-workflow.md +1 -1
- package/skills/rabetbase/knowledge/components.md +292 -0
- package/skills/rabetbase/knowledge/custom-page/generation-standards.md +74 -4
- package/skills/rabetbase/knowledge/custom-page/page-templates.md +68 -0
- package/skills/rabetbase/references/rabetbase-app-members-list.md +2 -0
- package/skills/rabetbase/references/rabetbase-page-create.md +21 -9
- package/skills/rabetbase/references/rabetbase-page-custom-detail.md +1 -1
- package/skills/rabetbase/references/rabetbase-page-custom-update.md +13 -9
- package/skills/rabetbase/references/rabetbase-project-create.md +5 -2
- package/skills/rabetbase/references/rabetbase-project-domain-routing-sync.md +2 -2
- package/skills/rabetbase/references/rabetbase-run.md +1 -0
- package/skills/rabetbase.manifest.json +5 -4
- package/templates/README.md +10 -4
- package/templates/custom-pages/blank.json +5 -0
- package/templates/custom-pages/dashboard.json +5 -0
- package/templates/custom-pages/onepage.json +5 -0
- package/templates/generate-api/api.ts.tpl +1 -1
- package/lib/commands/page/custom/template.d.ts +0 -8
- package/lib/commands/page/custom/template.js +0 -1
- package/skills/rabetbase/knowledge/custom-page/components.md +0 -225
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a157_0x1baa2d=a157_0x2839;(function(_0x209ac0,_0x301f24){const _0x2aeaf6=a157_0x2839,_0x237df4=_0x209ac0();while(!![]){try{const _0x44b67e=-parseInt(_0x2aeaf6(0x1cd))/0x1+-parseInt(_0x2aeaf6(0x1c2))/0x2+-parseInt(_0x2aeaf6(0x1c1))/0x3+-parseInt(_0x2aeaf6(0x1bc))/0x4+-parseInt(_0x2aeaf6(0x1dd))/0x5+parseInt(_0x2aeaf6(0x1c5))/0x6+-parseInt(_0x2aeaf6(0x1ce))/0x7*(-parseInt(_0x2aeaf6(0x1cb))/0x8);if(_0x44b67e===_0x301f24)break;else _0x237df4['push'](_0x237df4['shift']());}catch(_0x3f7046){_0x237df4['push'](_0x237df4['shift']());}}}(a157_0x258b,0xe6de6));import{asDryRunResult}from'../../commands/common/dry-run.js';import{getNotificationChannelConfig,isPlatformTransportFailure,updateNotificationChannelConfig}from'../../core/api-client.js';function a157_0x2839(_0x3623f0,_0x2e8fcc){_0x3623f0=_0x3623f0-0x1bc;const _0x258b08=a157_0x258b();let _0x283984=_0x258b08[_0x3623f0];return _0x283984;}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=a157_0x1baa2d(0x1c0);async function prepareUpdate(_0x174845){const _0x5411a5=a157_0x1baa2d,_0x474150=readNotificationId(_0x174845),_0x568485=await readNotificationDocument(_0x174845,_0x5411a5(0x1ca)),_0x2246d6=await requireExactNotificationConfig(_0x174845[_0x5411a5(0x1db)],_0x474150,_0x5411a5(0x1ca));return{'id':_0x474150,'patch':_0x568485,'before':_0x2246d6,'payload':mergeUpdateInput(_0x2246d6,_0x568485),'planned':plannedUpdateProjection(_0x2246d6,_0x568485)};}export const notificationConfigUpdate={'service':'notification','command':a157_0x1baa2d(0x1c3),'description':a157_0x1baa2d(0x1bd),'risk':'high-risk-write','requiresAppCode':!![],'structuredErrors':!![],'flags':[NOTIFICATION_ID_FLAG,...NOTIFICATION_INPUT_FLAGS,NOTIFICATION_APP_FLAG],async 'validate'(_0x4497f7){readNotificationId(_0x4497f7),assertSingleNotificationSource(_0x4497f7),requireNotificationExplicitYes(_0x4497f7);},async 'dryRun'(_0x1dde15){const _0x58b584=a157_0x1baa2d,_0x33566c=await prepareUpdate(_0x1dde15),_0x446a2f=notificationLookupCommand(_0x1dde15[_0x58b584(0x1db)],_0x33566c[_0x58b584(0x1c8)][_0x58b584(0x1c9)]);return asDryRunResult({'operation':'update','selector':notificationSelector(_0x33566c[_0x58b584(0x1c8)]),'before':projectNotificationConfig(_0x33566c[_0x58b584(0x1c8)]),'after':_0x33566c[_0x58b584(0x1cc)],'dryRun':!![],'backend':{'method':_0x58b584(0x1d3),'path':UPDATE_PATH},'warnings':[],'verification':{'status':_0x58b584(0x1cc),'lookupCommand':_0x446a2f}},{'method':_0x58b584(0x1d3),'url':UPDATE_PATH});},async 'execute'(_0x27c859){const _0x3e9b10=a157_0x1baa2d;requireNotificationExplicitYes(_0x27c859);const _0x3a0247=await prepareUpdate(_0x27c859),_0x40b0a5=notificationLookupCommand(_0x27c859[_0x3e9b10(0x1db)],_0x3a0247[_0x3e9b10(0x1c8)]['channelType']);let _0x1e31d0=![];try{await updateNotificationChannelConfig(_0x3a0247[_0x3e9b10(0x1d4)]);}catch(_0xe4e4b1){if(!isPlatformTransportFailure(_0xe4e4b1))throw safeApiFailure(_0x3e9b10(0x1ca),_0x3e9b10(0x1c7),_0x3e9b10(0x1bf)+_0x3a0247['id']+_0x3e9b10(0x1d8)+_0x40b0a5+';\x20no\x20automatic\x20retry\x20was\x20attempted.');_0x1e31d0=!![];}let _0x103345;try{const _0x26bc23=await getNotificationChannelConfig(_0x3a0247['id'],_0x27c859['appCode']);_0x103345=normalizeExactNotificationConfig(_0x26bc23,_0x3a0247['id'],_0x27c859[_0x3e9b10(0x1db)]);}catch{throw notificationError(_0x1e31d0?_0x3e9b10(0x1cf):'notification_config_update_verification_unavailable',_0x3e9b10(0x1c6)+_0x3a0247['id']+_0x3e9b10(0x1d0),_0x3e9b10(0x1d6)+_0x3a0247['id']+_0x3e9b10(0x1d9)+_0x40b0a5+';\x20do\x20not\x20resubmit\x20automatically.');}const _0x584c3d=requestedSafeFieldsMatch(_0x3a0247[_0x3e9b10(0x1c8)],_0x103345,_0x3a0247[_0x3e9b10(0x1d7)]);if(!_0x584c3d[_0x3e9b10(0x1c4)]||_0x1e31d0&&!_0x584c3d[_0x3e9b10(0x1dc)])throw notificationError(_0x1e31d0?_0x3e9b10(0x1cf):'notification_config_update_verification_failed','Notification\x20config\x20'+_0x3a0247['id']+_0x3e9b10(0x1de),_0x3e9b10(0x1d6)+_0x3a0247['id']+_0x3e9b10(0x1d9)+_0x40b0a5+_0x3e9b10(0x1da));const _0x4ace9a=_0x1e31d0?[_0x3e9b10(0x1d1)]:[];return{'ok':!![],'data':{'operation':_0x3e9b10(0x1ca),'selector':notificationSelector(_0x103345),'before':projectNotificationConfig(_0x3a0247[_0x3e9b10(0x1c8)]),'after':projectNotificationConfig(_0x103345),'dryRun':![],'backend':{'method':_0x3e9b10(0x1d3),'path':UPDATE_PATH},'warnings':_0x4ace9a,'verification':{'status':_0x3e9b10(0x1d5),'recoveredAfterUnknownResponse':_0x1e31d0,'verifiedFields':_0x584c3d[_0x3e9b10(0x1d2)],'lookupCommand':_0x40b0a5}},'message':_0x3e9b10(0x1be)+_0x103345['id']};}};function a157_0x258b(){const _0x3e9c0e=['\x20readback\x20does\x20not\x20prove\x20the\x20requested\x20update.','5259240lUzuQt','Update\x20an\x20app-level\x20notification\x20config\x20from\x20a\x20secure\x20JSON\x20patch','Updated\x20notification\x20config\x20','Inspect\x20ID\x20','/notification/channel-config/update','4765524jmXZyH','1022490vRyESR','config-update','allMatch','7550856sDVBxi','Notification\x20config\x20','mutation','before','channelType','update','104WFapOO','planned','851958BzByOW','2736965eMQSVu','notification_config_update_outcome_unknown','\x20update\x20could\x20not\x20be\x20verified\x20by\x20exact\x20ID.','Update\x20response\x20was\x20unavailable;\x20exact-ID\x20readback\x20proved\x20changed\x20safe\x20fields\x20without\x20resubmitting.','verifiedFields','POST','payload','verified','Inspect\x20with\x20--id\x20','patch','\x20with\x20','\x20via\x20',';\x20do\x20not\x20resubmit\x20automatically.','appCode','provesChange','5646260sZMTWh'];a157_0x258b=function(){return _0x3e9c0e;};return a157_0x258b();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x389335,_0x3ac507){const _0x3e7488=a158_0x2321,_0x313761=_0x389335();while(!![]){try{const _0x495022=parseInt(_0x3e7488(0xb4))/0x1+parseInt(_0x3e7488(0xb2))/0x2+-parseInt(_0x3e7488(0xb8))/0x3+parseInt(_0x3e7488(0xb3))/0x4+parseInt(_0x3e7488(0xb5))/0x5+parseInt(_0x3e7488(0xb9))/0x6*(parseInt(_0x3e7488(0xb7))/0x7)+-parseInt(_0x3e7488(0xba))/0x8*(parseInt(_0x3e7488(0xb6))/0x9);if(_0x495022===_0x3ac507)break;else _0x313761['push'](_0x313761['shift']());}catch(_0x5253c2){_0x313761['push'](_0x313761['shift']());}}}(a158_0x3619,0xf15b0));import{notificationConfigList}from'../../commands/notification/config-list.js';function a158_0x2321(_0x3cb2f3,_0x40b67f){_0x3cb2f3=_0x3cb2f3-0xb2;const _0x361977=a158_0x3619();let _0x23212e=_0x361977[_0x3cb2f3];return _0x23212e;}import{notificationConfigCreate}from'../../commands/notification/config-create.js';import{notificationConfigUpdate}from'../../commands/notification/config-update.js';import{notificationConfigDelete}from'../../commands/notification/config-delete.js';export const notificationDefinitions=[notificationConfigList,notificationConfigCreate,notificationConfigUpdate,notificationConfigDelete];function a158_0x3619(){const _0x5df3d6=['273092VWXXry','11329tEutWO','919525TmGDhS','12447ngGApe','28PZShAf','2208594PBBtaf','1387662XEQbJS','6632BZbtDe','3365364Rkprea'];a158_0x3619=function(){return _0x5df3d6;};return a158_0x3619();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a159_0x440ca9=a159_0x2a8b;(function(_0x36a0c4,_0x3edfe7){const _0x29ba09=a159_0x2a8b,_0x1ca80f=_0x36a0c4();while(!![]){try{const _0x4d2450=-parseInt(_0x29ba09(0x157))/0x1+parseInt(_0x29ba09(0x126))/0x2*(parseInt(_0x29ba09(0x12c))/0x3)+parseInt(_0x29ba09(0x16d))/0x4*(parseInt(_0x29ba09(0x121))/0x5)+-parseInt(_0x29ba09(0x10b))/0x6+parseInt(_0x29ba09(0x143))/0x7+parseInt(_0x29ba09(0x15f))/0x8+-parseInt(_0x29ba09(0x112))/0x9;if(_0x4d2450===_0x3edfe7)break;else _0x1ca80f['push'](_0x1ca80f['shift']());}catch(_0x3e1348){_0x1ca80f['push'](_0x1ca80f['shift']());}}}(a159_0xf798,0xa8221));import{readFile}from'node:fs/promises';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a159_0xf798(){const _0x5dbbc6=['WEBHOOK','path','from-env','DINGTALK','1176SmlaQn','preflight','name','endpointUrl:null','\x22\x20must\x20be\x20a\x20non-empty\x20string.','emailTargets','isArray','object','keys','env','Invalid\x20notification\x20config\x20response.','channelType','createTime','num','Create\x20JSON\x20requires\x20field\x20','isSafeInteger','\x20--type\x20','Application-level\x20notification\x20config\x20ID','file','apiError','hasOwnProperty','join','call','1748832vxMIDs','Use\x20exactly\x20one\x20of\x20--file\x20<path>,\x20--stdin,\x20or\x20--from-env\x20<NAME>.','\x22\x20is\x20forbidden.','Notification\x20config\x20detail\x20did\x20not\x20contain\x20the\x20requested\x20ID\x20','Provide\x20one\x20valid\x20JSON\x20object;\x20source\x20contents\x20are\x20not\x20included\x20in\x20errors.','notification_config_update_empty','string','13065381dxrNqR','Notification\x20JSON\x20field\x20\x22','kind','Read\x20the\x20notification\x20JSON\x20document\x20from\x20stdin','entries','Read\x20the\x20notification\x20JSON\x20document\x20from\x20a\x20named\x20environment\x20variable','a\x20string\x20or\x20null','fromName','FEISHU','\x20has\x20an\x20invalid\x20id.','Missing\x20notification\x20JSON\x20source.','subjectPrefix','notification_config_channel_field_forbidden','Notification\x20config\x20list\x20item\x20','Allowed\x20values:\x20','6375DGsvIL','has','notification_config_source_unavailable','_unavailable','trim','2205874qPZzAl','Run\x20the\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.','create','notification_config_field_required','\x20must\x20be\x20an\x20object.','includes','3IqkVKA','Notification\x20JSON\x20environment\x20variable\x20is\x20not\x20set:\x20','failed','\x20has\x20an\x20invalid\x20channelType.','\x20failed.','stdin','\x20has\x20an\x20unsupported\x20channelType.','recipients','push','endpointUrl','readTimeout','channelConfigRaw','notification_config_id_invalid','parse','Notification\x20JSON\x20field\x20\x22channelType\x22\x20is\x20unsupported.','Inspect\x20with\x20rabetbase\x20notification\x20config-list\x20--appcode\x20','\x20--type\x20<CHANNEL_TYPE>\x20--format\x20compress;\x20no\x20mutation\x20was\x20submitted.','endpointUrlRaw','channelConfig','notification_config_field_invalid','appCode','environment\x20variable\x20','\x20is\x20invalid.','9266229loBdac','bool','update','\x20has\x20an\x20invalid\x20appCode.','a\x20JSON\x20object\x20or\x20null','length','description','utf8','\x20is\x20missing\x20required\x20field\x20\x22','Notification\x20JSON\x20from\x20','<redacted>','str','a\x20JSON\x20object','Notification\x20JSON\x20channelConfig\x20field\x20\x22','\x22\x20cannot\x20exceed\x20','bccList','notification_config_response_invalid','WECOM','Invalid\x20--','updateTime','667357NpeGcf','notification_config_json_invalid','Notification\x20config\x20','\x20has\x20invalid\x20field\x20\x22','\x20does\x20not\x20belong\x20to\x20the\x20resolved\x20app.','Update\x20JSON\x20must\x20contain\x20at\x20least\x20one\x20allowed\x20field.','some','file\x20','2381416wJLwpe','connectTimeout','EMAIL','configCode','validation','setEncoding','configName','ccList','Item\x20','Unable\x20to\x20read\x20notification\x20JSON\x20from\x20'];a159_0xf798=function(){return _0x5dbbc6;};return a159_0xf798();}import{getNotificationChannelConfig}from'../../core/api-client.js';import{CliError,CliErrors}from'../../errors.js';export const NOTIFICATION_CHANNEL_TYPES=[a159_0x440ca9(0x161),a159_0x440ca9(0x11a),a159_0x440ca9(0x16c),a159_0x440ca9(0x154),a159_0x440ca9(0x169)];export const DEFAULT_NOTIFICATION_CONNECT_TIMEOUT=0x1388;export const DEFAULT_NOTIFICATION_READ_TIMEOUT=0x2710;const ALLOWED_INPUT_FIELDS=new Set([a159_0x440ca9(0x165),'channelType','endpointUrl',a159_0x440ca9(0x13e),a159_0x440ca9(0x149),a159_0x440ca9(0x160),a159_0x440ca9(0x136)]),FORBIDDEN_IDENTITY_FIELDS=new Set(['id',a159_0x440ca9(0x140),a159_0x440ca9(0x162),'channelCode']),EMAIL_RECIPIENT_FIELDS=new Set([a159_0x440ca9(0xf9),a159_0x440ca9(0x133),a159_0x440ca9(0x166),a159_0x440ca9(0x152),'replyTo',a159_0x440ca9(0x11d),a159_0x440ca9(0x119),'to','cc']);export const NOTIFICATION_INPUT_FLAGS=[{'name':'file','type':a159_0x440ca9(0x111),'required':![],'description':'Read\x20the\x20notification\x20JSON\x20document\x20from\x20a\x20UTF-8\x20file'},{'name':'stdin','type':'boolean','required':![],'default':![],'description':a159_0x440ca9(0x115)},{'name':a159_0x440ca9(0x16b),'type':a159_0x440ca9(0x111),'required':![],'description':a159_0x440ca9(0x117)}];export const NOTIFICATION_ID_FLAG={'name':'id','type':'number','required':!![],'description':a159_0x440ca9(0x105)};export const NOTIFICATION_APP_FLAG=APPCODE_FLAG_OPTIONAL;export function notificationError(_0x3c0e89,_0x5d1d47,_0x321471){return new CliError(_0x3c0e89,0x1,_0x5d1d47,_0x321471);}export function readNotificationId(_0x59a0da){const _0x432725=a159_0x440ca9,_0x4b90be=_0x59a0da[_0x432725(0x101)]('id');if(!Number[_0x432725(0x103)](_0x4b90be)||_0x4b90be<=0x0)throw notificationError(_0x432725(0x138),'--id\x20must\x20be\x20a\x20positive\x20safe\x20integer.');return _0x4b90be;}export function requireNotificationExplicitYes(_0x5e5d47){const _0x4fd77f=a159_0x440ca9;if(_0x5e5d47['bool']('dry-run')||_0x5e5d47['bool']('yes'))return;throw notificationError('notification_config_confirmation_required','This\x20notification\x20config\x20mutation\x20requires\x20explicit\x20--yes.',_0x4fd77f(0x127));}export function readNotificationChannelType(_0x25b279,_0x60e701='type',_0x431d0a=a159_0x440ca9(0x161)){const _0x3e13c8=a159_0x440ca9,_0x2f01f7=_0x25b279[_0x3e13c8(0x14e)](_0x60e701)[_0x3e13c8(0x125)]()||_0x431d0a;if(!NOTIFICATION_CHANNEL_TYPES['includes'](_0x2f01f7))throw CliErrors['validation'](_0x3e13c8(0x155)+_0x60e701+':\x20'+_0x2f01f7,_0x3e13c8(0x120)+NOTIFICATION_CHANNEL_TYPES['join'](',\x20')+'.');return _0x2f01f7;}export function assertSingleNotificationSource(_0x45d1aa){const _0x5cbc35=a159_0x440ca9,_0xf2d01d=[],_0x1dba74=_0x45d1aa[_0x5cbc35(0x14e)](_0x5cbc35(0x106))[_0x5cbc35(0x125)]();if(_0x1dba74)_0xf2d01d['push']({'kind':_0x5cbc35(0x106),'path':_0x1dba74});if(_0x45d1aa[_0x5cbc35(0x144)]('stdin'))_0xf2d01d[_0x5cbc35(0x134)]({'kind':_0x5cbc35(0x131)});const _0xcd6c75=_0x45d1aa[_0x5cbc35(0x14e)](_0x5cbc35(0x16b))[_0x5cbc35(0x125)]();if(_0xcd6c75)_0xf2d01d['push']({'kind':'env','name':_0xcd6c75});if(_0xf2d01d['length']===0x0)throw CliErrors[_0x5cbc35(0x163)](_0x5cbc35(0x11c),_0x5cbc35(0x10c));if(_0xf2d01d[_0x5cbc35(0x148)]>0x1)throw CliErrors['validation']('Notification\x20JSON\x20source\x20is\x20ambiguous.',_0x5cbc35(0x10c));return _0xf2d01d[0x0];}export async function readNotificationDocument(_0x58fcda,_0x500a1f){const _0x578dc1=a159_0x440ca9,_0x17367e=assertSingleNotificationSource(_0x58fcda),_0x132a8f=_0x17367e[_0x578dc1(0x114)]===_0x578dc1(0x106)?_0x578dc1(0x15e)+_0x17367e[_0x578dc1(0x16a)]:_0x17367e[_0x578dc1(0x114)]==='env'?_0x578dc1(0x141)+_0x17367e[_0x578dc1(0xf6)]:_0x578dc1(0x131);let _0x1dcc25;try{if(_0x17367e[_0x578dc1(0x114)]==='file')_0x1dcc25=await readFile(_0x17367e[_0x578dc1(0x16a)],_0x578dc1(0x14a));else{if(_0x17367e['kind']===_0x578dc1(0xfd)){if(!(_0x17367e[_0x578dc1(0xf6)]in process.env))throw notificationError(_0x578dc1(0x123),_0x578dc1(0x12d)+_0x17367e[_0x578dc1(0xf6)]);_0x1dcc25=process.env[_0x17367e.name]??'';}else _0x1dcc25=await readStdin();}}catch(_0x5530f8){if(_0x5530f8 instanceof CliError)throw _0x5530f8;throw notificationError(_0x578dc1(0x123),_0x578dc1(0x168)+_0x132a8f+'.');}let _0x15f6b8;try{_0x15f6b8=JSON[_0x578dc1(0x139)](_0x1dcc25);}catch{throw notificationError('notification_config_json_invalid',_0x578dc1(0x14c)+_0x132a8f+_0x578dc1(0x142),_0x578dc1(0x10f));}if(!isJsonObject(_0x15f6b8))throw notificationError(_0x578dc1(0x158),'Notification\x20JSON\x20from\x20'+_0x132a8f+_0x578dc1(0x12a));return validateNotificationDocument(_0x15f6b8,_0x500a1f);}function a159_0x2a8b(_0x44e791,_0x33f1c9){_0x44e791=_0x44e791-0xf6;const _0xf798db=a159_0xf798();let _0x2a8b05=_0xf798db[_0x44e791];return _0x2a8b05;}export function projectNotificationListConfig(_0x25afca,_0x1726df){const _0x45953c=a159_0x440ca9;return{'id':typeof _0x25afca['id']==='number'?_0x25afca['id']:null,'configCode':requireResponseString(_0x25afca['configCode'],_0x45953c(0x162),_0x1726df),'configName':requireResponseString(_0x25afca[_0x45953c(0x165)],_0x45953c(0x165),_0x1726df),'channelType':requireResponseString(_0x25afca[_0x45953c(0xff)],_0x45953c(0xff),_0x1726df),'description':normalizeNullableString(_0x25afca[_0x45953c(0x149)]),'createTime':normalizeNullableString(_0x25afca[_0x45953c(0x100)]),'updateTime':normalizeNullableString(_0x25afca[_0x45953c(0x156)])};}export function normalizeExactNotificationConfig(_0x58a5b8,_0x88a028,_0x21253b){const _0x2aa3c4=a159_0x440ca9;if(!Number['isSafeInteger'](_0x58a5b8['id'])||_0x58a5b8['id']!==_0x88a028)throw notificationError(_0x2aa3c4(0x153),_0x2aa3c4(0x10e)+_0x88a028+'.');if(_0x58a5b8[_0x2aa3c4(0x140)]!==_0x21253b)throw notificationError(_0x2aa3c4(0x153),_0x2aa3c4(0x159)+_0x88a028+_0x2aa3c4(0x15b));const _0x4360b1=requireExactString(_0x58a5b8['configName'],_0x2aa3c4(0x165),_0x88a028),_0x5dcc6b=requireExactString(_0x58a5b8[_0x2aa3c4(0x162)],_0x2aa3c4(0x162),_0x88a028),_0x5f0de3=requireExactString(_0x58a5b8[_0x2aa3c4(0xff)],_0x2aa3c4(0xff),_0x88a028);if(!NOTIFICATION_CHANNEL_TYPES[_0x2aa3c4(0x12b)](_0x5f0de3))throw notificationError('notification_config_response_invalid',_0x2aa3c4(0x159)+_0x88a028+_0x2aa3c4(0x132));const _0xaa4924=responseNullableString(_0x58a5b8[_0x2aa3c4(0x135)],_0x2aa3c4(0x135),_0x88a028),_0x519d90=responseNullableString(_0x58a5b8['channelConfig'],_0x2aa3c4(0x13e),_0x88a028),_0x475197=responseNullableString(_0x58a5b8[_0x2aa3c4(0x149)],_0x2aa3c4(0x149),_0x88a028),_0x38ba50=responseNullableTimeout(_0x58a5b8[_0x2aa3c4(0x160)],_0x2aa3c4(0x160),_0x88a028),_0x53ae2f=responseNullableTimeout(_0x58a5b8[_0x2aa3c4(0x136)],_0x2aa3c4(0x136),_0x88a028);return{'id':_0x88a028,'appCode':_0x21253b,'configCode':_0x5dcc6b,'configName':_0x4360b1,'channelType':_0x5f0de3,'endpointUrl':redactSensitive(_0xaa4924),'channelConfig':redactSensitive(_0x519d90),'description':_0x475197,'connectTimeout':_0x38ba50,'readTimeout':_0x53ae2f,'endpointUrlRaw':_0xaa4924,'channelConfigRaw':_0x519d90};}export async function requireExactNotificationConfig(_0x3e6a01,_0x551230,_0x198240){const _0x4f1ef8=a159_0x440ca9;let _0x386233;try{_0x386233=await getNotificationChannelConfig(_0x551230,_0x3e6a01);}catch{throw safeApiFailure(_0x198240,_0x4f1ef8(0x16e),_0x4f1ef8(0x13b)+_0x3e6a01+_0x4f1ef8(0x13c));}return normalizeExactNotificationConfig(_0x386233,_0x551230,_0x3e6a01);}export function projectNotificationConfig(_0x585491){const _0x2c1acd=a159_0x440ca9;return{'id':_0x585491['id']??null,'appCode':_0x585491['appCode'],'configCode':_0x585491[_0x2c1acd(0x162)]??null,'configName':_0x585491[_0x2c1acd(0x165)],'channelType':_0x585491[_0x2c1acd(0xff)],'endpointUrl':redactSensitive(_0x585491[_0x2c1acd(0x135)]),'channelConfig':redactSensitive(_0x585491['channelConfig']),'description':_0x585491['description']??null,'connectTimeout':_0x585491[_0x2c1acd(0x160)]??null,'readTimeout':_0x585491['readTimeout']??null};}export function notificationSelector(_0x59db99){const _0x29cfc3=a159_0x440ca9;return{'appCode':_0x59db99[_0x29cfc3(0x140)],'id':_0x59db99['id'],'configCode':_0x59db99[_0x29cfc3(0x162)],'configName':_0x59db99['configName'],'channelType':_0x59db99['channelType']};}export function createMutationInput(_0x4508ea,_0x22abc2){const _0x1f9cd7=a159_0x440ca9;return{'appCode':_0x4508ea,'configName':_0x22abc2['configName'],'channelType':_0x22abc2[_0x1f9cd7(0xff)],...hasOwn(_0x22abc2,_0x1f9cd7(0x135))?{'endpointUrl':_0x22abc2[_0x1f9cd7(0x135)]}:{},...hasOwn(_0x22abc2,_0x1f9cd7(0x13e))?{'channelConfig':serializeChannelConfig(_0x22abc2[_0x1f9cd7(0x13e)])}:{},...hasOwn(_0x22abc2,'description')?{'description':_0x22abc2[_0x1f9cd7(0x149)]}:{},...hasOwn(_0x22abc2,_0x1f9cd7(0x160))?{'connectTimeout':_0x22abc2['connectTimeout']}:{},...hasOwn(_0x22abc2,'readTimeout')?{'readTimeout':_0x22abc2[_0x1f9cd7(0x136)]}:{}};}export function mergeUpdateInput(_0x2a3872,_0x29894e){const _0x40f537=a159_0x440ca9;return{'id':_0x2a3872['id'],'appCode':_0x2a3872[_0x40f537(0x140)],'configName':_0x29894e[_0x40f537(0x165)]??_0x2a3872[_0x40f537(0x165)],'channelType':_0x29894e[_0x40f537(0xff)]??_0x2a3872[_0x40f537(0xff)],'endpointUrl':hasOwn(_0x29894e,'endpointUrl')?_0x29894e[_0x40f537(0x135)]:_0x2a3872[_0x40f537(0x13d)],'channelConfig':hasOwn(_0x29894e,_0x40f537(0x13e))?serializeChannelConfig(_0x29894e[_0x40f537(0x13e)]):_0x2a3872[_0x40f537(0x137)],'description':hasOwn(_0x29894e,_0x40f537(0x149))?_0x29894e[_0x40f537(0x149)]:_0x2a3872['description'],'connectTimeout':hasOwn(_0x29894e,_0x40f537(0x160))?_0x29894e[_0x40f537(0x160)]:_0x2a3872['connectTimeout'],'readTimeout':hasOwn(_0x29894e,_0x40f537(0x136))?_0x29894e[_0x40f537(0x136)]:_0x2a3872[_0x40f537(0x136)]};}export function plannedUpdateProjection(_0x3bd767,_0x42ab10){const _0xb1de13=a159_0x440ca9;return projectNotificationConfig({'id':_0x3bd767['id'],'appCode':_0x3bd767[_0xb1de13(0x140)],'configCode':_0x3bd767['configCode'],'configName':_0x42ab10[_0xb1de13(0x165)]??_0x3bd767[_0xb1de13(0x165)],'channelType':_0x42ab10['channelType']??_0x3bd767[_0xb1de13(0xff)],'endpointUrl':hasOwn(_0x42ab10,_0xb1de13(0x135))?_0x42ab10['endpointUrl']:_0x3bd767['endpointUrlRaw'],'channelConfig':hasOwn(_0x42ab10,_0xb1de13(0x13e))?_0x42ab10[_0xb1de13(0x13e)]:_0x3bd767[_0xb1de13(0x137)],'description':hasOwn(_0x42ab10,_0xb1de13(0x149))?_0x42ab10[_0xb1de13(0x149)]:_0x3bd767[_0xb1de13(0x149)],'connectTimeout':hasOwn(_0x42ab10,'connectTimeout')?_0x42ab10[_0xb1de13(0x160)]??DEFAULT_NOTIFICATION_CONNECT_TIMEOUT:_0x3bd767[_0xb1de13(0x160)],'readTimeout':hasOwn(_0x42ab10,'readTimeout')?_0x42ab10[_0xb1de13(0x136)]??DEFAULT_NOTIFICATION_READ_TIMEOUT:_0x3bd767[_0xb1de13(0x136)]});}export function requestedSafeFieldsMatch(_0x346195,_0x1fc6c7,_0x1e5e15){const _0x29c241=a159_0x440ca9,_0x56e2e7=[],_0x5a2204=[],_0x49de25=[];for(const _0x20e479 of['configName',_0x29c241(0xff),_0x29c241(0x149)]){if(!hasOwn(_0x1e5e15,_0x20e479))continue;_0x49de25['push'](_0x20e479),_0x56e2e7[_0x29c241(0x134)](_0x1fc6c7[_0x20e479]===_0x1e5e15[_0x20e479]),_0x5a2204[_0x29c241(0x134)](_0x346195[_0x20e479]!==_0x1e5e15[_0x20e479]&&_0x1fc6c7[_0x20e479]===_0x1e5e15[_0x20e479]);}for(const _0x4d58e2 of[_0x29c241(0x160),_0x29c241(0x136)]){if(!hasOwn(_0x1e5e15,_0x4d58e2))continue;const _0x561956=_0x1e5e15[_0x4d58e2]??(_0x4d58e2==='connectTimeout'?DEFAULT_NOTIFICATION_CONNECT_TIMEOUT:DEFAULT_NOTIFICATION_READ_TIMEOUT);_0x49de25[_0x29c241(0x134)](_0x4d58e2),_0x56e2e7[_0x29c241(0x134)](_0x1fc6c7[_0x4d58e2]===_0x561956),_0x5a2204[_0x29c241(0x134)](_0x346195[_0x4d58e2]!==_0x561956&&_0x1fc6c7[_0x4d58e2]===_0x561956);}return hasOwn(_0x1e5e15,_0x29c241(0x135))&&_0x1e5e15[_0x29c241(0x135)]===null&&(_0x49de25[_0x29c241(0x134)](_0x29c241(0xf7)),_0x56e2e7[_0x29c241(0x134)](_0x1fc6c7['endpointUrlRaw']===null||_0x1fc6c7['endpointUrlRaw']===''),_0x5a2204[_0x29c241(0x134)](_0x346195['endpointUrlRaw']!==null&&_0x346195[_0x29c241(0x13d)]!==''&&(_0x1fc6c7['endpointUrlRaw']===null||_0x1fc6c7['endpointUrlRaw']===''))),{'allMatch':_0x56e2e7['every'](Boolean),'provesChange':_0x5a2204[_0x29c241(0x15d)](Boolean),'verifiedFields':_0x49de25};}export function validateNotificationDeleteReadback(_0x24cb91,_0x35a484,_0x4bf084){const _0x36ce41=a159_0x440ca9;for(const [_0x5cf806,_0xf32b48]of _0x24cb91[_0x36ce41(0x116)]()){if(!Number[_0x36ce41(0x103)](_0xf32b48['id'])||_0xf32b48['id']<=0x0)throw notificationError(_0x36ce41(0x153),'Notification\x20config\x20list\x20item\x20'+(_0x5cf806+0x1)+_0x36ce41(0x11b));if(_0xf32b48[_0x36ce41(0x140)]!==_0x35a484)throw notificationError(_0x36ce41(0x153),_0x36ce41(0x11f)+(_0x5cf806+0x1)+_0x36ce41(0x146));if(_0xf32b48[_0x36ce41(0xff)]!==_0x4bf084)throw notificationError(_0x36ce41(0x153),_0x36ce41(0x11f)+(_0x5cf806+0x1)+_0x36ce41(0x12f));}}export function safeApiFailure(_0x5b0a9e,_0x51dc6f,_0x382320){const _0x1450f1=a159_0x440ca9;return notificationError('notification_config_'+_0x5b0a9e+'_'+(_0x51dc6f==='mutation'?_0x1450f1(0x12e):_0x51dc6f+_0x1450f1(0x124)),_0x1450f1(0x159)+_0x5b0a9e+'\x20'+_0x51dc6f+_0x1450f1(0x130),_0x382320);}export function notificationLookupCommand(_0x1fada3,_0x57edaf){const _0x2e5110=a159_0x440ca9;return'rabetbase\x20notification\x20config-list\x20--appcode\x20'+_0x1fada3+_0x2e5110(0x104)+_0x57edaf+'\x20--format\x20compress';}function validateNotificationDocument(_0x28bc6c,_0x21d1a8){const _0x1189ab=a159_0x440ca9;for(const _0x47c002 of Object[_0x1189ab(0xfc)](_0x28bc6c)){if(FORBIDDEN_IDENTITY_FIELDS[_0x1189ab(0x122)](_0x47c002))throw notificationError('notification_config_field_forbidden',_0x1189ab(0x113)+_0x47c002+'\x22\x20is\x20controlled\x20by\x20the\x20CLI\x20or\x20server\x20and\x20is\x20forbidden.');if(!ALLOWED_INPUT_FIELDS[_0x1189ab(0x122)](_0x47c002))throw notificationError('notification_config_field_unknown','Unknown\x20notification\x20JSON\x20field\x20\x22'+_0x47c002+'\x22.');}if(_0x21d1a8===_0x1189ab(0x145)&&Object[_0x1189ab(0xfc)](_0x28bc6c)[_0x1189ab(0x148)]===0x0)throw notificationError(_0x1189ab(0x110),_0x1189ab(0x15c));const _0x42d713={};if(hasOwn(_0x28bc6c,_0x1189ab(0x165)))_0x42d713[_0x1189ab(0x165)]=validateRequiredString(_0x28bc6c[_0x1189ab(0x165)],_0x1189ab(0x165),0x80);else{if(_0x21d1a8===_0x1189ab(0x128))throw notificationError(_0x1189ab(0x129),_0x1189ab(0x102)+'\x22configName\x22.');}if(hasOwn(_0x28bc6c,_0x1189ab(0xff))){if(typeof _0x28bc6c[_0x1189ab(0xff)]!==_0x1189ab(0x111))throw invalidFieldType(_0x1189ab(0xff),'a\x20supported\x20string');const _0x1d6381=_0x28bc6c[_0x1189ab(0xff)][_0x1189ab(0x125)]();if(!NOTIFICATION_CHANNEL_TYPES[_0x1189ab(0x12b)](_0x1d6381))throw notificationError(_0x1189ab(0x13f),_0x1189ab(0x13a),'Allowed\x20values:\x20'+NOTIFICATION_CHANNEL_TYPES[_0x1189ab(0x109)](',\x20')+'.');_0x42d713[_0x1189ab(0xff)]=_0x1d6381;}else{if(_0x21d1a8===_0x1189ab(0x128))throw notificationError(_0x1189ab(0x129),_0x1189ab(0x102)+'\x22channelType\x22.');}for(const [_0x54819f,_0x5cb194]of[['endpointUrl',0x200],[_0x1189ab(0x149),0x100]]){if(!hasOwn(_0x28bc6c,_0x54819f))continue;const _0x432938=_0x28bc6c[_0x54819f];if(_0x432938!==null&&typeof _0x432938!==_0x1189ab(0x111))throw invalidFieldType(_0x54819f,_0x1189ab(0x118));if(typeof _0x432938===_0x1189ab(0x111)&&_0x432938[_0x1189ab(0x148)]>_0x5cb194)throw notificationError(_0x1189ab(0x13f),_0x1189ab(0x113)+_0x54819f+_0x1189ab(0x151)+_0x5cb194+'\x20characters.');_0x42d713[_0x54819f]=_0x432938;}if(hasOwn(_0x28bc6c,_0x1189ab(0x13e))){const _0x1d269f=_0x28bc6c[_0x1189ab(0x13e)];if(_0x1d269f===null&&_0x21d1a8===_0x1189ab(0x128))throw invalidFieldType(_0x1189ab(0x13e),_0x1189ab(0x14f));if(_0x1d269f!==null&&!isJsonObject(_0x1d269f))throw invalidFieldType(_0x1189ab(0x13e),_0x21d1a8==='update'?_0x1189ab(0x147):'a\x20JSON\x20object');_0x1d269f!==null&&validateChannelConfigFields(_0x42d713[_0x1189ab(0xff)],_0x1d269f),_0x42d713[_0x1189ab(0x13e)]=_0x1d269f;}for(const _0x528d60 of[_0x1189ab(0x160),'readTimeout']){if(!hasOwn(_0x28bc6c,_0x528d60))continue;const _0x472b55=_0x28bc6c[_0x528d60];if(_0x472b55!==null&&(!Number[_0x1189ab(0x103)](_0x472b55)||_0x472b55<0x0))throw notificationError(_0x1189ab(0x13f),_0x1189ab(0x113)+_0x528d60+'\x22\x20must\x20be\x20a\x20non-negative\x20safe\x20integer\x20or\x20null.');_0x42d713[_0x528d60]=_0x472b55;}return _0x42d713;}function validateRequiredString(_0x73a8c4,_0x55e372,_0x3a96c7){const _0x448184=a159_0x440ca9;if(typeof _0x73a8c4!==_0x448184(0x111))throw invalidFieldType(_0x55e372,'a\x20non-empty\x20string');const _0x1a547d=_0x73a8c4[_0x448184(0x125)]();if(!_0x1a547d)throw notificationError(_0x448184(0x13f),_0x448184(0x113)+_0x55e372+_0x448184(0xf8));if(_0x1a547d[_0x448184(0x148)]>_0x3a96c7)throw notificationError('notification_config_field_invalid','Notification\x20JSON\x20field\x20\x22'+_0x55e372+_0x448184(0x151)+_0x3a96c7+'\x20characters.');return _0x1a547d;}function validateChannelConfigFields(_0x463dab,_0x4ac695){const _0x35f086=a159_0x440ca9;if(hasOwn(_0x4ac695,'messageTemplate'))throw forbiddenChannelConfigField('messageTemplate');if(_0x463dab===_0x35f086(0x161))for(const _0x2909ed of EMAIL_RECIPIENT_FIELDS){if(hasOwn(_0x4ac695,_0x2909ed))throw forbiddenChannelConfigField(_0x2909ed);}}function forbiddenChannelConfigField(_0x3b514a){const _0xc63cbc=a159_0x440ca9;return notificationError(_0xc63cbc(0x11e),_0xc63cbc(0x150)+_0x3b514a+_0xc63cbc(0x10d));}function invalidFieldType(_0x39a8b8,_0x15f89b){const _0x3154cd=a159_0x440ca9;return notificationError('notification_config_field_invalid',_0x3154cd(0x113)+_0x39a8b8+'\x22\x20must\x20be\x20'+_0x15f89b+'.');}function serializeChannelConfig(_0x4602f4){return _0x4602f4===null||_0x4602f4===undefined?null:JSON['stringify'](_0x4602f4);}function redactSensitive(_0x21c374){const _0x11da04=a159_0x440ca9;return _0x21c374===null||_0x21c374===undefined||_0x21c374===''?null:_0x11da04(0x14d);}function requireResponseString(_0x46d7e6,_0x5f5069,_0x4e5dc6){const _0x7b481e=a159_0x440ca9;if(typeof _0x46d7e6!==_0x7b481e(0x111)||_0x46d7e6[_0x7b481e(0x125)]()==='')throw CliErrors[_0x7b481e(0x107)](_0x7b481e(0xfe),_0x7b481e(0x167)+(_0x4e5dc6+0x1)+_0x7b481e(0x14b)+_0x5f5069+'\x22.');return _0x46d7e6[_0x7b481e(0x125)]();}function requireExactString(_0x2dc07f,_0x470d2b,_0x3ee860){const _0x427bcd=a159_0x440ca9;if(typeof _0x2dc07f!=='string'||_0x2dc07f[_0x427bcd(0x125)]()==='')throw notificationError(_0x427bcd(0x153),_0x427bcd(0x159)+_0x3ee860+_0x427bcd(0x14b)+_0x470d2b+'\x22.');return _0x2dc07f[_0x427bcd(0x125)]();}function responseNullableString(_0x16110f,_0x20a67d,_0x2028ce){const _0x3a22b3=a159_0x440ca9;if(_0x16110f===undefined||_0x16110f===null)return null;if(typeof _0x16110f!==_0x3a22b3(0x111))throw notificationError(_0x3a22b3(0x153),_0x3a22b3(0x159)+_0x2028ce+_0x3a22b3(0x15a)+_0x20a67d+'\x22.');return _0x16110f;}function responseNullableTimeout(_0x51de4b,_0x3390cd,_0x16a848){const _0x3e8121=a159_0x440ca9;if(_0x51de4b===undefined||_0x51de4b===null)return null;if(!Number['isSafeInteger'](_0x51de4b)||_0x51de4b<0x0)throw notificationError(_0x3e8121(0x153),_0x3e8121(0x159)+_0x16a848+_0x3e8121(0x15a)+_0x3390cd+'\x22.');return _0x51de4b;}function normalizeNullableString(_0x202c87){const _0x1651ed=a159_0x440ca9;return typeof _0x202c87===_0x1651ed(0x111)?_0x202c87:null;}function isJsonObject(_0x65a048){const _0x1855d5=a159_0x440ca9;return _0x65a048!==null&&typeof _0x65a048===_0x1855d5(0xfb)&&!Array[_0x1855d5(0xfa)](_0x65a048);}function hasOwn(_0x206d46,_0x110c85){const _0x1dee9c=a159_0x440ca9;return Object['prototype'][_0x1dee9c(0x108)][_0x1dee9c(0x10a)](_0x206d46,_0x110c85);}async function readStdin(){const _0x16a726=a159_0x440ca9;let _0x1556c8='';process[_0x16a726(0x131)][_0x16a726(0x164)](_0x16a726(0x14a));for await(const _0xc8fb20 of process[_0x16a726(0x131)])_0x1556c8+=_0xc8fb20;return _0x1556c8;}
|
|
1
|
+
function a159_0x5528(){const _0x18d6cc=['\x22\x20must\x20be\x20a\x20non-empty\x20string.','has','create','failed','connectTimeout','notification_config_json_invalid','updateTime','Unknown\x20notification\x20JSON\x20field\x20\x22','update','5258752DFkIfW','108CsXGzs','validation','notification_config_id_invalid','number','\x22\x20is\x20forbidden.','file\x20','\x20failed.','\x22configName\x22.','parse','a\x20JSON\x20object','\x20--type\x20','bool','file','\x22channelType\x22.','notification_config_update_empty','env','Allowed\x20values:\x20','notification_config_field_unknown','yes','notification_config_','setEncoding','length','\x22\x20must\x20be\x20a\x20non-negative\x20safe\x20integer\x20or\x20null.','prototype','join','recipients','num','Update\x20JSON\x20must\x20contain\x20at\x20least\x20one\x20allowed\x20field.','readTimeout','15019552kWPoHj','environment\x20variable\x20','Application-level\x20notification\x20config\x20ID','trim','\x20has\x20an\x20invalid\x20channelType.','endpointUrl','type','\x20has\x20invalid\x20field\x20\x22','Notification\x20JSON\x20field\x20\x22channelType\x22\x20is\x20unsupported.','\x20does\x20not\x20belong\x20to\x20the\x20resolved\x20app.','isArray','description','DINGTALK','createTime','a\x20non-empty\x20string','Notification\x20config\x20','notification_config_confirmation_required','WECOM','Notification\x20JSON\x20field\x20\x22','object','rabetbase\x20notification\x20config-list\x20--appcode\x20','Use\x20exactly\x20one\x20of\x20--file\x20<path>,\x20--stdin,\x20or\x20--from-env\x20<NAME>.','Read\x20the\x20notification\x20JSON\x20document\x20from\x20a\x20UTF-8\x20file','path','messageTemplate','\x20is\x20invalid.','Read\x20the\x20notification\x20JSON\x20document\x20from\x20stdin','EMAIL','endpointUrl:null','\x20characters.','FEISHU','stdin','notification_config_field_required','Notification\x20config\x20list\x20item\x20','channelCode','bccList','a\x20string\x20or\x20null','kind','217440xHUCqT','Notification\x20JSON\x20from\x20','notification_config_source_unavailable','configName','channelType','<redacted>','configCode','\x20--type\x20<CHANNEL_TYPE>\x20--format\x20compress;\x20no\x20mutation\x20was\x20submitted.','push','appCode','1033484ZemqVY','notification_config_response_invalid','keys','\x20has\x20an\x20invalid\x20appCode.','utf8','\x20has\x20an\x20unsupported\x20channelType.','Notification\x20JSON\x20channelConfig\x20field\x20\x22','ccList','Create\x20JSON\x20requires\x20field\x20','notification_config_field_invalid','fromName','This\x20notification\x20config\x20mutation\x20requires\x20explicit\x20--yes.','endpointUrlRaw','str','8828988riBDeB','\x22\x20must\x20be\x20','WEBHOOK','2289194lUwrTa','a\x20supported\x20string','boolean','string','notification_config_field_forbidden','channelConfig','includes','entries','name','from-env','\x20must\x20be\x20an\x20object.','emailTargets','subjectPrefix','every','Notification\x20config\x20detail\x20did\x20not\x20contain\x20the\x20requested\x20ID\x20','53112tqWGmL','isSafeInteger','Inspect\x20with\x20rabetbase\x20notification\x20config-list\x20--appcode\x20'];a159_0x5528=function(){return _0x18d6cc;};return a159_0x5528();}const a159_0x93c37b=a159_0x15ed;(function(_0xaf14bd,_0x9e84bb){const _0x17bcde=a159_0x15ed,_0x59822a=_0xaf14bd();while(!![]){try{const _0x4b35fc=parseInt(_0x17bcde(0xce))/0x1+parseInt(_0x17bcde(0xdf))/0x2+-parseInt(_0x17bcde(0xee))/0x3+-parseInt(_0x17bcde(0xfa))/0x4+parseInt(_0x17bcde(0xc4))/0x5*(-parseInt(_0x17bcde(0xfb))/0x6)+-parseInt(_0x17bcde(0xdc))/0x7+parseInt(_0x17bcde(0x118))/0x8;if(_0x4b35fc===_0x9e84bb)break;else _0x59822a['push'](_0x59822a['shift']());}catch(_0x2bd4aa){_0x59822a['push'](_0x59822a['shift']());}}}(a159_0x5528,0xa5c99));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=[a159_0x93c37b(0x133),a159_0x93c37b(0x136),a159_0x93c37b(0x124),a159_0x93c37b(0x129),a159_0x93c37b(0xde)];export const DEFAULT_NOTIFICATION_CONNECT_TIMEOUT=0x1388;export const DEFAULT_NOTIFICATION_READ_TIMEOUT=0x2710;const ALLOWED_INPUT_FIELDS=new Set([a159_0x93c37b(0xc7),a159_0x93c37b(0xc8),'endpointUrl',a159_0x93c37b(0xe4),a159_0x93c37b(0x123),a159_0x93c37b(0xf5),a159_0x93c37b(0x117)]),FORBIDDEN_IDENTITY_FIELDS=new Set(['id',a159_0x93c37b(0xcd),a159_0x93c37b(0xca),a159_0x93c37b(0xc0)]),EMAIL_RECIPIENT_FIELDS=new Set([a159_0x93c37b(0xea),a159_0x93c37b(0x114),a159_0x93c37b(0xd5),a159_0x93c37b(0xc1),'replyTo',a159_0x93c37b(0xeb),a159_0x93c37b(0xd8),'to','cc']);export const NOTIFICATION_INPUT_FLAGS=[{'name':a159_0x93c37b(0x107),'type':a159_0x93c37b(0xe2),'required':![],'description':a159_0x93c37b(0x12e)},{'name':a159_0x93c37b(0x137),'type':a159_0x93c37b(0xe1),'required':![],'default':![],'description':a159_0x93c37b(0x132)},{'name':a159_0x93c37b(0xe8),'type':a159_0x93c37b(0xe2),'required':![],'description':'Read\x20the\x20notification\x20JSON\x20document\x20from\x20a\x20named\x20environment\x20variable'}];export const NOTIFICATION_ID_FLAG={'name':'id','type':a159_0x93c37b(0xfe),'required':!![],'description':a159_0x93c37b(0x11a)};export const NOTIFICATION_APP_FLAG=APPCODE_FLAG_OPTIONAL;export function notificationError(_0x2f4746,_0x4ed586,_0x4b1620){return new CliError(_0x2f4746,0x1,_0x4ed586,_0x4b1620);}export function readNotificationId(_0x59ea3c){const _0x364e5a=a159_0x93c37b,_0x4daafb=_0x59ea3c[_0x364e5a(0x115)]('id');if(!Number[_0x364e5a(0xef)](_0x4daafb)||_0x4daafb<=0x0)throw notificationError(_0x364e5a(0xfd),'--id\x20must\x20be\x20a\x20positive\x20safe\x20integer.');return _0x4daafb;}export function requireNotificationExplicitYes(_0x4ff7b5){const _0x15aaac=a159_0x93c37b;if(_0x4ff7b5['bool']('dry-run')||_0x4ff7b5['bool'](_0x15aaac(0x10d)))return;throw notificationError(_0x15aaac(0x128),_0x15aaac(0xd9),'Run\x20the\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.');}export function readNotificationChannelType(_0x3f41fe,_0x59f9da=a159_0x93c37b(0x11e),_0x2fa69c=a159_0x93c37b(0x133)){const _0x308825=a159_0x93c37b,_0x4040e1=_0x3f41fe[_0x308825(0xdb)](_0x59f9da)[_0x308825(0x11b)]()||_0x2fa69c;if(!NOTIFICATION_CHANNEL_TYPES[_0x308825(0xe5)](_0x4040e1))throw CliErrors[_0x308825(0xfc)]('Invalid\x20--'+_0x59f9da+':\x20'+_0x4040e1,_0x308825(0x10b)+NOTIFICATION_CHANNEL_TYPES[_0x308825(0x113)](',\x20')+'.');return _0x4040e1;}export function assertSingleNotificationSource(_0x3b5413){const _0x18370c=a159_0x93c37b,_0x306a88=[],_0x592c4b=_0x3b5413[_0x18370c(0xdb)](_0x18370c(0x107))[_0x18370c(0x11b)]();if(_0x592c4b)_0x306a88[_0x18370c(0xcc)]({'kind':_0x18370c(0x107),'path':_0x592c4b});if(_0x3b5413[_0x18370c(0x106)](_0x18370c(0x137)))_0x306a88[_0x18370c(0xcc)]({'kind':'stdin'});const _0x404a60=_0x3b5413[_0x18370c(0xdb)](_0x18370c(0xe8))[_0x18370c(0x11b)]();if(_0x404a60)_0x306a88['push']({'kind':_0x18370c(0x10a),'name':_0x404a60});if(_0x306a88[_0x18370c(0x110)]===0x0)throw CliErrors[_0x18370c(0xfc)]('Missing\x20notification\x20JSON\x20source.',_0x18370c(0x12d));if(_0x306a88[_0x18370c(0x110)]>0x1)throw CliErrors[_0x18370c(0xfc)]('Notification\x20JSON\x20source\x20is\x20ambiguous.','Use\x20exactly\x20one\x20of\x20--file\x20<path>,\x20--stdin,\x20or\x20--from-env\x20<NAME>.');return _0x306a88[0x0];}export async function readNotificationDocument(_0x160f7a,_0x52c58a){const _0x8db358=a159_0x93c37b,_0x2d36ec=assertSingleNotificationSource(_0x160f7a),_0x1ceb9c=_0x2d36ec[_0x8db358(0xc3)]===_0x8db358(0x107)?_0x8db358(0x100)+_0x2d36ec[_0x8db358(0x12f)]:_0x2d36ec[_0x8db358(0xc3)]===_0x8db358(0x10a)?_0x8db358(0x119)+_0x2d36ec[_0x8db358(0xe7)]:_0x8db358(0x137);let _0x43d1e0;try{if(_0x2d36ec[_0x8db358(0xc3)]===_0x8db358(0x107))_0x43d1e0=await readFile(_0x2d36ec['path'],_0x8db358(0xd2));else{if(_0x2d36ec[_0x8db358(0xc3)]===_0x8db358(0x10a)){if(!(_0x2d36ec[_0x8db358(0xe7)]in process.env))throw notificationError(_0x8db358(0xc6),'Notification\x20JSON\x20environment\x20variable\x20is\x20not\x20set:\x20'+_0x2d36ec['name']);_0x43d1e0=process.env[_0x2d36ec.name]??'';}else _0x43d1e0=await readStdin();}}catch(_0x53537e){if(_0x53537e instanceof CliError)throw _0x53537e;throw notificationError(_0x8db358(0xc6),'Unable\x20to\x20read\x20notification\x20JSON\x20from\x20'+_0x1ceb9c+'.');}let _0x35e4bd;try{_0x35e4bd=JSON[_0x8db358(0x103)](_0x43d1e0);}catch{throw notificationError(_0x8db358(0xf6),_0x8db358(0xc5)+_0x1ceb9c+_0x8db358(0x131),'Provide\x20one\x20valid\x20JSON\x20object;\x20source\x20contents\x20are\x20not\x20included\x20in\x20errors.');}if(!isJsonObject(_0x35e4bd))throw notificationError(_0x8db358(0xf6),_0x8db358(0xc5)+_0x1ceb9c+_0x8db358(0xe9));return validateNotificationDocument(_0x35e4bd,_0x52c58a);}export function projectNotificationListConfig(_0x2bf1da,_0x41259f){const _0x7a60b1=a159_0x93c37b;return{'id':typeof _0x2bf1da['id']==='number'?_0x2bf1da['id']:null,'configCode':requireResponseString(_0x2bf1da[_0x7a60b1(0xca)],_0x7a60b1(0xca),_0x41259f),'configName':requireResponseString(_0x2bf1da['configName'],'configName',_0x41259f),'channelType':requireResponseString(_0x2bf1da[_0x7a60b1(0xc8)],_0x7a60b1(0xc8),_0x41259f),'description':normalizeNullableString(_0x2bf1da[_0x7a60b1(0x123)]),'createTime':normalizeNullableString(_0x2bf1da[_0x7a60b1(0x125)]),'updateTime':normalizeNullableString(_0x2bf1da[_0x7a60b1(0xf7)])};}export function normalizeExactNotificationConfig(_0x416aa9,_0x68f369,_0x4388e0){const _0x3eed9a=a159_0x93c37b;if(!Number['isSafeInteger'](_0x416aa9['id'])||_0x416aa9['id']!==_0x68f369)throw notificationError('notification_config_response_invalid',_0x3eed9a(0xed)+_0x68f369+'.');if(_0x416aa9['appCode']!==_0x4388e0)throw notificationError(_0x3eed9a(0xcf),_0x3eed9a(0x127)+_0x68f369+_0x3eed9a(0x121));const _0x42f778=requireExactString(_0x416aa9[_0x3eed9a(0xc7)],_0x3eed9a(0xc7),_0x68f369),_0x2a86c1=requireExactString(_0x416aa9[_0x3eed9a(0xca)],_0x3eed9a(0xca),_0x68f369),_0x2611bb=requireExactString(_0x416aa9[_0x3eed9a(0xc8)],_0x3eed9a(0xc8),_0x68f369);if(!NOTIFICATION_CHANNEL_TYPES[_0x3eed9a(0xe5)](_0x2611bb))throw notificationError(_0x3eed9a(0xcf),'Notification\x20config\x20'+_0x68f369+_0x3eed9a(0xd3));const _0x1917d0=responseNullableString(_0x416aa9[_0x3eed9a(0x11d)],_0x3eed9a(0x11d),_0x68f369),_0x4add27=responseNullableString(_0x416aa9['channelConfig'],_0x3eed9a(0xe4),_0x68f369),_0x3aeec9=responseNullableString(_0x416aa9[_0x3eed9a(0x123)],_0x3eed9a(0x123),_0x68f369),_0x1d8c29=responseNullableTimeout(_0x416aa9[_0x3eed9a(0xf5)],_0x3eed9a(0xf5),_0x68f369),_0x2cdf42=responseNullableTimeout(_0x416aa9[_0x3eed9a(0x117)],'readTimeout',_0x68f369);return{'id':_0x68f369,'appCode':_0x4388e0,'configCode':_0x2a86c1,'configName':_0x42f778,'channelType':_0x2611bb,'endpointUrl':redactSensitive(_0x1917d0),'channelConfig':redactSensitive(_0x4add27),'description':_0x3aeec9,'connectTimeout':_0x1d8c29,'readTimeout':_0x2cdf42,'endpointUrlRaw':_0x1917d0,'channelConfigRaw':_0x4add27};}export async function requireExactNotificationConfig(_0x46cb1b,_0x43d8a4,_0x4e141b){const _0x4a2233=a159_0x93c37b;let _0x1b007a;try{_0x1b007a=await getNotificationChannelConfig(_0x43d8a4,_0x46cb1b);}catch{throw safeApiFailure(_0x4e141b,'preflight',_0x4a2233(0xf0)+_0x46cb1b+_0x4a2233(0xcb));}return normalizeExactNotificationConfig(_0x1b007a,_0x43d8a4,_0x46cb1b);}export function projectNotificationConfig(_0x3aaf05){const _0x3f32a3=a159_0x93c37b;return{'id':_0x3aaf05['id']??null,'appCode':_0x3aaf05[_0x3f32a3(0xcd)],'configCode':_0x3aaf05[_0x3f32a3(0xca)]??null,'configName':_0x3aaf05[_0x3f32a3(0xc7)],'channelType':_0x3aaf05[_0x3f32a3(0xc8)],'endpointUrl':redactSensitive(_0x3aaf05[_0x3f32a3(0x11d)]),'channelConfig':redactSensitive(_0x3aaf05[_0x3f32a3(0xe4)]),'description':_0x3aaf05[_0x3f32a3(0x123)]??null,'connectTimeout':_0x3aaf05[_0x3f32a3(0xf5)]??null,'readTimeout':_0x3aaf05[_0x3f32a3(0x117)]??null};}export function notificationSelector(_0x382d4d){const _0x5dd9e0=a159_0x93c37b;return{'appCode':_0x382d4d[_0x5dd9e0(0xcd)],'id':_0x382d4d['id'],'configCode':_0x382d4d[_0x5dd9e0(0xca)],'configName':_0x382d4d[_0x5dd9e0(0xc7)],'channelType':_0x382d4d[_0x5dd9e0(0xc8)]};}export function createMutationInput(_0x5802f6,_0x3f1ed4){const _0x217236=a159_0x93c37b;return{'appCode':_0x5802f6,'configName':_0x3f1ed4['configName'],'channelType':_0x3f1ed4[_0x217236(0xc8)],...hasOwn(_0x3f1ed4,_0x217236(0x11d))?{'endpointUrl':_0x3f1ed4[_0x217236(0x11d)]}:{},...hasOwn(_0x3f1ed4,'channelConfig')?{'channelConfig':serializeChannelConfig(_0x3f1ed4[_0x217236(0xe4)])}:{},...hasOwn(_0x3f1ed4,_0x217236(0x123))?{'description':_0x3f1ed4[_0x217236(0x123)]}:{},...hasOwn(_0x3f1ed4,_0x217236(0xf5))?{'connectTimeout':_0x3f1ed4[_0x217236(0xf5)]}:{},...hasOwn(_0x3f1ed4,_0x217236(0x117))?{'readTimeout':_0x3f1ed4[_0x217236(0x117)]}:{}};}export function mergeUpdateInput(_0x1b3db6,_0x370687){const _0x20679d=a159_0x93c37b;return{'id':_0x1b3db6['id'],'appCode':_0x1b3db6[_0x20679d(0xcd)],'configName':_0x370687[_0x20679d(0xc7)]??_0x1b3db6[_0x20679d(0xc7)],'channelType':_0x370687[_0x20679d(0xc8)]??_0x1b3db6['channelType'],'endpointUrl':hasOwn(_0x370687,_0x20679d(0x11d))?_0x370687[_0x20679d(0x11d)]:_0x1b3db6[_0x20679d(0xda)],'channelConfig':hasOwn(_0x370687,_0x20679d(0xe4))?serializeChannelConfig(_0x370687[_0x20679d(0xe4)]):_0x1b3db6['channelConfigRaw'],'description':hasOwn(_0x370687,_0x20679d(0x123))?_0x370687[_0x20679d(0x123)]:_0x1b3db6['description'],'connectTimeout':hasOwn(_0x370687,'connectTimeout')?_0x370687[_0x20679d(0xf5)]:_0x1b3db6['connectTimeout'],'readTimeout':hasOwn(_0x370687,_0x20679d(0x117))?_0x370687[_0x20679d(0x117)]:_0x1b3db6[_0x20679d(0x117)]};}export function plannedUpdateProjection(_0x3f5045,_0x1eae2b){const _0x2a4ae9=a159_0x93c37b;return projectNotificationConfig({'id':_0x3f5045['id'],'appCode':_0x3f5045['appCode'],'configCode':_0x3f5045[_0x2a4ae9(0xca)],'configName':_0x1eae2b[_0x2a4ae9(0xc7)]??_0x3f5045[_0x2a4ae9(0xc7)],'channelType':_0x1eae2b[_0x2a4ae9(0xc8)]??_0x3f5045[_0x2a4ae9(0xc8)],'endpointUrl':hasOwn(_0x1eae2b,'endpointUrl')?_0x1eae2b['endpointUrl']:_0x3f5045[_0x2a4ae9(0xda)],'channelConfig':hasOwn(_0x1eae2b,_0x2a4ae9(0xe4))?_0x1eae2b[_0x2a4ae9(0xe4)]:_0x3f5045['channelConfigRaw'],'description':hasOwn(_0x1eae2b,_0x2a4ae9(0x123))?_0x1eae2b[_0x2a4ae9(0x123)]:_0x3f5045[_0x2a4ae9(0x123)],'connectTimeout':hasOwn(_0x1eae2b,_0x2a4ae9(0xf5))?_0x1eae2b[_0x2a4ae9(0xf5)]??DEFAULT_NOTIFICATION_CONNECT_TIMEOUT:_0x3f5045[_0x2a4ae9(0xf5)],'readTimeout':hasOwn(_0x1eae2b,_0x2a4ae9(0x117))?_0x1eae2b[_0x2a4ae9(0x117)]??DEFAULT_NOTIFICATION_READ_TIMEOUT:_0x3f5045[_0x2a4ae9(0x117)]});}function a159_0x15ed(_0x54944a,_0x3a76a2){_0x54944a=_0x54944a-0xc0;const _0x5528a2=a159_0x5528();let _0x15ed50=_0x5528a2[_0x54944a];return _0x15ed50;}export function requestedSafeFieldsMatch(_0x590c15,_0x4133b1,_0x24c190){const _0x5e7443=a159_0x93c37b,_0x42514e=[],_0x1ad7df=[],_0x230d5a=[];for(const _0x5c1dfc of[_0x5e7443(0xc7),_0x5e7443(0xc8),_0x5e7443(0x123)]){if(!hasOwn(_0x24c190,_0x5c1dfc))continue;_0x230d5a['push'](_0x5c1dfc),_0x42514e[_0x5e7443(0xcc)](_0x4133b1[_0x5c1dfc]===_0x24c190[_0x5c1dfc]),_0x1ad7df['push'](_0x590c15[_0x5c1dfc]!==_0x24c190[_0x5c1dfc]&&_0x4133b1[_0x5c1dfc]===_0x24c190[_0x5c1dfc]);}for(const _0x4875cd of[_0x5e7443(0xf5),_0x5e7443(0x117)]){if(!hasOwn(_0x24c190,_0x4875cd))continue;const _0x748804=_0x24c190[_0x4875cd]??(_0x4875cd===_0x5e7443(0xf5)?DEFAULT_NOTIFICATION_CONNECT_TIMEOUT:DEFAULT_NOTIFICATION_READ_TIMEOUT);_0x230d5a['push'](_0x4875cd),_0x42514e['push'](_0x4133b1[_0x4875cd]===_0x748804),_0x1ad7df['push'](_0x590c15[_0x4875cd]!==_0x748804&&_0x4133b1[_0x4875cd]===_0x748804);}return hasOwn(_0x24c190,_0x5e7443(0x11d))&&_0x24c190[_0x5e7443(0x11d)]===null&&(_0x230d5a[_0x5e7443(0xcc)](_0x5e7443(0x134)),_0x42514e[_0x5e7443(0xcc)](_0x4133b1[_0x5e7443(0xda)]===null||_0x4133b1[_0x5e7443(0xda)]===''),_0x1ad7df[_0x5e7443(0xcc)](_0x590c15[_0x5e7443(0xda)]!==null&&_0x590c15[_0x5e7443(0xda)]!==''&&(_0x4133b1[_0x5e7443(0xda)]===null||_0x4133b1[_0x5e7443(0xda)]===''))),{'allMatch':_0x42514e[_0x5e7443(0xec)](Boolean),'provesChange':_0x1ad7df['some'](Boolean),'verifiedFields':_0x230d5a};}export function validateNotificationDeleteReadback(_0x19f2c4,_0x4d1ca9,_0x47ca9e){const _0x4a856c=a159_0x93c37b;for(const [_0x27e6e7,_0x3565e2]of _0x19f2c4[_0x4a856c(0xe6)]()){if(!Number[_0x4a856c(0xef)](_0x3565e2['id'])||_0x3565e2['id']<=0x0)throw notificationError(_0x4a856c(0xcf),_0x4a856c(0x139)+(_0x27e6e7+0x1)+'\x20has\x20an\x20invalid\x20id.');if(_0x3565e2[_0x4a856c(0xcd)]!==_0x4d1ca9)throw notificationError(_0x4a856c(0xcf),'Notification\x20config\x20list\x20item\x20'+(_0x27e6e7+0x1)+_0x4a856c(0xd1));if(_0x3565e2[_0x4a856c(0xc8)]!==_0x47ca9e)throw notificationError(_0x4a856c(0xcf),'Notification\x20config\x20list\x20item\x20'+(_0x27e6e7+0x1)+_0x4a856c(0x11c));}}export function safeApiFailure(_0x55c589,_0x5cfed5,_0x342a93){const _0x3c9354=a159_0x93c37b;return notificationError(_0x3c9354(0x10e)+_0x55c589+'_'+(_0x5cfed5==='mutation'?_0x3c9354(0xf4):_0x5cfed5+'_unavailable'),'Notification\x20config\x20'+_0x55c589+'\x20'+_0x5cfed5+_0x3c9354(0x101),_0x342a93);}export function notificationLookupCommand(_0x321303,_0x524719){const _0x2867e9=a159_0x93c37b;return _0x2867e9(0x12c)+_0x321303+_0x2867e9(0x105)+_0x524719+'\x20--format\x20compress';}function validateNotificationDocument(_0x3f61fb,_0x1ed0d8){const _0x1e7ed7=a159_0x93c37b;for(const _0x5bb6b6 of Object['keys'](_0x3f61fb)){if(FORBIDDEN_IDENTITY_FIELDS[_0x1e7ed7(0xf2)](_0x5bb6b6))throw notificationError(_0x1e7ed7(0xe3),_0x1e7ed7(0x12a)+_0x5bb6b6+'\x22\x20is\x20controlled\x20by\x20the\x20CLI\x20or\x20server\x20and\x20is\x20forbidden.');if(!ALLOWED_INPUT_FIELDS[_0x1e7ed7(0xf2)](_0x5bb6b6))throw notificationError(_0x1e7ed7(0x10c),_0x1e7ed7(0xf8)+_0x5bb6b6+'\x22.');}if(_0x1ed0d8===_0x1e7ed7(0xf9)&&Object[_0x1e7ed7(0xd0)](_0x3f61fb)[_0x1e7ed7(0x110)]===0x0)throw notificationError(_0x1e7ed7(0x109),_0x1e7ed7(0x116));const _0x3b024c={};if(hasOwn(_0x3f61fb,_0x1e7ed7(0xc7)))_0x3b024c[_0x1e7ed7(0xc7)]=validateRequiredString(_0x3f61fb[_0x1e7ed7(0xc7)],'configName',0x80);else{if(_0x1ed0d8===_0x1e7ed7(0xf3))throw notificationError(_0x1e7ed7(0x138),_0x1e7ed7(0xd6)+_0x1e7ed7(0x102));}if(hasOwn(_0x3f61fb,_0x1e7ed7(0xc8))){if(typeof _0x3f61fb[_0x1e7ed7(0xc8)]!==_0x1e7ed7(0xe2))throw invalidFieldType('channelType',_0x1e7ed7(0xe0));const _0x3db2ec=_0x3f61fb[_0x1e7ed7(0xc8)][_0x1e7ed7(0x11b)]();if(!NOTIFICATION_CHANNEL_TYPES[_0x1e7ed7(0xe5)](_0x3db2ec))throw notificationError(_0x1e7ed7(0xd7),_0x1e7ed7(0x120),_0x1e7ed7(0x10b)+NOTIFICATION_CHANNEL_TYPES[_0x1e7ed7(0x113)](',\x20')+'.');_0x3b024c[_0x1e7ed7(0xc8)]=_0x3db2ec;}else{if(_0x1ed0d8===_0x1e7ed7(0xf3))throw notificationError(_0x1e7ed7(0x138),_0x1e7ed7(0xd6)+_0x1e7ed7(0x108));}for(const [_0x360676,_0x15161a]of[[_0x1e7ed7(0x11d),0x200],[_0x1e7ed7(0x123),0x100]]){if(!hasOwn(_0x3f61fb,_0x360676))continue;const _0x2352ea=_0x3f61fb[_0x360676];if(_0x2352ea!==null&&typeof _0x2352ea!==_0x1e7ed7(0xe2))throw invalidFieldType(_0x360676,_0x1e7ed7(0xc2));if(typeof _0x2352ea==='string'&&_0x2352ea[_0x1e7ed7(0x110)]>_0x15161a)throw notificationError(_0x1e7ed7(0xd7),_0x1e7ed7(0x12a)+_0x360676+'\x22\x20cannot\x20exceed\x20'+_0x15161a+_0x1e7ed7(0x135));_0x3b024c[_0x360676]=_0x2352ea;}if(hasOwn(_0x3f61fb,_0x1e7ed7(0xe4))){const _0x2535d1=_0x3f61fb[_0x1e7ed7(0xe4)];if(_0x2535d1===null&&_0x1ed0d8===_0x1e7ed7(0xf3))throw invalidFieldType(_0x1e7ed7(0xe4),_0x1e7ed7(0x104));if(_0x2535d1!==null&&!isJsonObject(_0x2535d1))throw invalidFieldType(_0x1e7ed7(0xe4),_0x1ed0d8==='update'?'a\x20JSON\x20object\x20or\x20null':'a\x20JSON\x20object');_0x2535d1!==null&&validateChannelConfigFields(_0x3b024c[_0x1e7ed7(0xc8)],_0x2535d1),_0x3b024c[_0x1e7ed7(0xe4)]=_0x2535d1;}for(const _0x419536 of['connectTimeout','readTimeout']){if(!hasOwn(_0x3f61fb,_0x419536))continue;const _0x49432f=_0x3f61fb[_0x419536];if(_0x49432f!==null&&(!Number[_0x1e7ed7(0xef)](_0x49432f)||_0x49432f<0x0))throw notificationError(_0x1e7ed7(0xd7),_0x1e7ed7(0x12a)+_0x419536+_0x1e7ed7(0x111));_0x3b024c[_0x419536]=_0x49432f;}return _0x3b024c;}function validateRequiredString(_0x18fb76,_0x52b38d,_0xbd9188){const _0x9237d9=a159_0x93c37b;if(typeof _0x18fb76!==_0x9237d9(0xe2))throw invalidFieldType(_0x52b38d,_0x9237d9(0x126));const _0x577043=_0x18fb76[_0x9237d9(0x11b)]();if(!_0x577043)throw notificationError(_0x9237d9(0xd7),'Notification\x20JSON\x20field\x20\x22'+_0x52b38d+_0x9237d9(0xf1));if(_0x577043[_0x9237d9(0x110)]>_0xbd9188)throw notificationError(_0x9237d9(0xd7),_0x9237d9(0x12a)+_0x52b38d+'\x22\x20cannot\x20exceed\x20'+_0xbd9188+_0x9237d9(0x135));return _0x577043;}function validateChannelConfigFields(_0xa58b23,_0x1a0144){const _0x5f2005=a159_0x93c37b;if(hasOwn(_0x1a0144,'messageTemplate'))throw forbiddenChannelConfigField(_0x5f2005(0x130));if(_0xa58b23===_0x5f2005(0x133))for(const _0x1e9340 of EMAIL_RECIPIENT_FIELDS){if(hasOwn(_0x1a0144,_0x1e9340))throw forbiddenChannelConfigField(_0x1e9340);}}function forbiddenChannelConfigField(_0x24b0d7){const _0x317746=a159_0x93c37b;return notificationError('notification_config_channel_field_forbidden',_0x317746(0xd4)+_0x24b0d7+_0x317746(0xff));}function invalidFieldType(_0x339a64,_0x4104d3){const _0x151530=a159_0x93c37b;return notificationError('notification_config_field_invalid',_0x151530(0x12a)+_0x339a64+_0x151530(0xdd)+_0x4104d3+'.');}function serializeChannelConfig(_0x537fe8){return _0x537fe8===null||_0x537fe8===undefined?null:JSON['stringify'](_0x537fe8);}function redactSensitive(_0x5758f8){const _0x552ce7=a159_0x93c37b;return _0x5758f8===null||_0x5758f8===undefined||_0x5758f8===''?null:_0x552ce7(0xc9);}function requireResponseString(_0x305ac4,_0x23ecdc,_0x276c82){const _0x38e306=a159_0x93c37b;if(typeof _0x305ac4!==_0x38e306(0xe2)||_0x305ac4[_0x38e306(0x11b)]()==='')throw CliErrors['apiError']('Invalid\x20notification\x20config\x20response.','Item\x20'+(_0x276c82+0x1)+'\x20is\x20missing\x20required\x20field\x20\x22'+_0x23ecdc+'\x22.');return _0x305ac4[_0x38e306(0x11b)]();}function requireExactString(_0x4f7a65,_0x2fa02b,_0x1649df){const _0x5b501f=a159_0x93c37b;if(typeof _0x4f7a65!==_0x5b501f(0xe2)||_0x4f7a65['trim']()==='')throw notificationError('notification_config_response_invalid','Notification\x20config\x20'+_0x1649df+'\x20is\x20missing\x20required\x20field\x20\x22'+_0x2fa02b+'\x22.');return _0x4f7a65[_0x5b501f(0x11b)]();}function responseNullableString(_0x210904,_0x51e5fc,_0x15c78c){const _0x444c9f=a159_0x93c37b;if(_0x210904===undefined||_0x210904===null)return null;if(typeof _0x210904!==_0x444c9f(0xe2))throw notificationError(_0x444c9f(0xcf),_0x444c9f(0x127)+_0x15c78c+'\x20has\x20invalid\x20field\x20\x22'+_0x51e5fc+'\x22.');return _0x210904;}function responseNullableTimeout(_0x2eb9d9,_0x256c2b,_0x3f74f5){const _0x37d8aa=a159_0x93c37b;if(_0x2eb9d9===undefined||_0x2eb9d9===null)return null;if(!Number[_0x37d8aa(0xef)](_0x2eb9d9)||_0x2eb9d9<0x0)throw notificationError(_0x37d8aa(0xcf),_0x37d8aa(0x127)+_0x3f74f5+_0x37d8aa(0x11f)+_0x256c2b+'\x22.');return _0x2eb9d9;}function normalizeNullableString(_0x5bdd60){const _0x431d73=a159_0x93c37b;return typeof _0x5bdd60===_0x431d73(0xe2)?_0x5bdd60:null;}function isJsonObject(_0x310a66){const _0x1b9159=a159_0x93c37b;return _0x310a66!==null&&typeof _0x310a66===_0x1b9159(0x12b)&&!Array[_0x1b9159(0x122)](_0x310a66);}function hasOwn(_0x58c380,_0x13da25){const _0x1b96f3=a159_0x93c37b;return Object[_0x1b96f3(0x112)]['hasOwnProperty']['call'](_0x58c380,_0x13da25);}async function readStdin(){const _0x116a0f=a159_0x93c37b;let _0x332bcc='';process[_0x116a0f(0x137)][_0x116a0f(0x10f)](_0x116a0f(0xd2));for await(const _0x4f464e of process['stdin'])_0x332bcc+=_0x4f464e;return _0x332bcc;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a160_0x38b484=a160_0x3a10;(function(_0x23453c,_0xcf65fd){const _0x110b34=a160_0x3a10,_0x35adf1=_0x23453c();while(!![]){try{const _0x1d72d9=-parseInt(_0x110b34(0x1db))/0x1+parseInt(_0x110b34(0x1e1))/0x2+parseInt(_0x110b34(0x200))/0x3+-parseInt(_0x110b34(0x1e7))/0x4*(-parseInt(_0x110b34(0x1dd))/0x5)+-parseInt(_0x110b34(0x1da))/0x6+-parseInt(_0x110b34(0x1f6))/0x7*(parseInt(_0x110b34(0x1f2))/0x8)+parseInt(_0x110b34(0x1d0))/0x9;if(_0x1d72d9===_0xcf65fd)break;else _0x35adf1['push'](_0x35adf1['shift']());}catch(_0x166811){_0x35adf1['push'](_0x35adf1['shift']());}}}(a160_0x2109,0xe3244));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=[a160_0x38b484(0x1e6),'general',a160_0x38b484(0x201),a160_0x38b484(0x1e4)],SCENE_TO_LEGACY_TYPE={'invoice':'Invoice','general':a160_0x38b484(0x1e3),'form':a160_0x38b484(0x1fd),'idCard':a160_0x38b484(0x1f4)},SCENE_FLAG={'name':a160_0x38b484(0x1f0),'type':'string','required':!![],'enum':[...SUPPORTED_SCENES],'description':a160_0x38b484(0x1f1)},IMAGE_FILE_FLAG={'name':a160_0x38b484(0x1ff),'type':a160_0x38b484(0x1de),'description':a160_0x38b484(0x1d2)},IMAGE_URL_FLAG={'name':a160_0x38b484(0x1dc),'type':a160_0x38b484(0x1de),'description':'Publicly\x20accessible\x20image\x20or\x20file\x20URL'};function normalizeScene(_0x167dff){const _0x5caadb=a160_0x38b484,_0x1cefe=_0x167dff[_0x5caadb(0x1cf)]()[_0x5caadb(0x1d6)]();if(_0x1cefe==='idcard')return _0x5caadb(0x1e4);if(_0x1cefe==='invoice'||_0x1cefe==='general'||_0x1cefe===_0x5caadb(0x201))return _0x1cefe;throw CliErrors[_0x5caadb(0x1d1)]('Unsupported\x20OCR\x20scene:\x20'+_0x167dff+'.\x20Supported\x20scenes:\x20'+SUPPORTED_SCENES[_0x5caadb(0x1f8)](',\x20'));}function a160_0x2109(){const _0x3bba9c=['OCR\x20scene:\x20invoice,\x20general,\x20form,\x20or\x20idCard','8680yLiJhc','read','IdCard','\x20OCR','8806mQfJdv','imageFile','join','\x20OCR\x20from\x20URL','apiError','fileUrl','path','Table','/smartapi/common/queryFileUrl','image-file','1980672XMBWMD','form','trim','22922604uPduAc','validation','Local\x20image\x20or\x20PDF\x20file;\x20uses\x20upload\x20->\x20query-url\x20->\x20OCR','File\x20upload\x20response\x20missing\x20filePath.','filePath','length','toLowerCase','Choose\x20exactly\x20one\x20OCR\x20input:\x20--image-file\x20or\x20--image-url.','File\x20URL\x20response\x20missing\x20fileUrl.','/smartapi/ocr/recognize-text?','6448152zrqbYf','1288041eorAvg','image-url','40020akqyKP','string','imageUrl','ocr','1460990mLBYAq','count','General','idCard','/smartapi/ocr/recognize-text','invoice','360EEULBw','recognize','/smartapi/common/uploadFile','<filePath\x20returned\x20by\x20/smartapi/common/uploadFile>','str','GET','appCode','POST','fileName','scene'];a160_0x2109=function(){return _0x3bba9c;};return a160_0x2109();}function selectedInputs(_0x6d6b88){const _0x349a0d=a160_0x38b484,_0x59f995=_0x6d6b88[_0x349a0d(0x1eb)](_0x349a0d(0x1ff))[_0x349a0d(0x1cf)](),_0x4e72d3=_0x6d6b88[_0x349a0d(0x1eb)](_0x349a0d(0x1dc))[_0x349a0d(0x1cf)]();return{'imageFile':_0x59f995,'imageUrl':_0x4e72d3,'count':[_0x59f995,_0x4e72d3]['filter'](Boolean)[_0x349a0d(0x1d5)]};}function validateInputSelection(_0x1fb6f0){const _0x8e75b1=a160_0x38b484,_0x440ae0=selectedInputs(_0x1fb6f0);if(_0x440ae0[_0x8e75b1(0x1e2)]!==0x1)throw CliErrors[_0x8e75b1(0x1d1)](_0x8e75b1(0x1d7));return _0x440ae0;}function withScene(_0x406114,_0x197e70,_0x24850a){const _0x510d58=a160_0x38b484;return{..._0x406114,'scene':_0x197e70,..._0x24850a?{'sourceFile':{'fileName':_0x24850a[_0x510d58(0x1ef)],'filePath':_0x24850a[_0x510d58(0x1d4)]}}:{}};}function a160_0x3a10(_0x44f590,_0x22cebc){_0x44f590=_0x44f590-0x1cf;const _0x21098e=a160_0x2109();let _0x3a10e7=_0x21098e[_0x44f590];return _0x3a10e7;}const ocrRecognize={'service':a160_0x38b484(0x1e0),'command':a160_0x38b484(0x1e8),'description':'Extract\x20text\x20and\x20structured\x20fields\x20from\x20voucher-style\x20business\x20documents;\x20not\x20for\x20general\x20image\x20understanding','risk':a160_0x38b484(0x1f3),'flags':[SCENE_FLAG,IMAGE_FILE_FLAG,IMAGE_URL_FLAG],async 'dryRun'(_0x2eb3f6){const _0x2d975c=a160_0x38b484,_0x588e40=normalizeScene(_0x2eb3f6[_0x2d975c(0x1eb)](_0x2d975c(0x1f0))),_0x25e726=SCENE_TO_LEGACY_TYPE[_0x588e40],_0x2ebeb2=validateInputSelection(_0x2eb3f6);if(_0x2ebeb2[_0x2d975c(0x1df)]){const _0x44d1a4=new URLSearchParams({'url':_0x2ebeb2[_0x2d975c(0x1df)],'type':_0x25e726,'appCode':_0x2eb3f6[_0x2d975c(0x1ed)]});return{'method':_0x2d975c(0x1ec),'url':_0x2d975c(0x1d9)+_0x44d1a4['toString'](),'description':'Preview:\x20recognize\x20'+_0x588e40+_0x2d975c(0x1f9)};}const _0x1b6442=requireDevelopmentUploadFile(_0x2ebeb2[_0x2d975c(0x1f7)],_0x2d975c(0x1ff));return{'method':'POST','url':_0x2d975c(0x1e9),'body':{'steps':[{'method':_0x2d975c(0x1ee),'url':_0x2d975c(0x1e9),'body':{'appCode':_0x2eb3f6[_0x2d975c(0x1ed)],'multipart':{'file':_0x1b6442}}},{'method':_0x2d975c(0x1ee),'url':_0x2d975c(0x1fe),'body':{'filePath':_0x2d975c(0x1ea),'downloadFlag':![]}},{'method':'GET','url':_0x2d975c(0x1e5),'query':{'appCode':_0x2eb3f6['appCode'],'url':'<fileUrl\x20returned\x20by\x20/smartapi/common/queryFileUrl>','type':_0x25e726}}]},'description':'Preview:\x20upload\x20local\x20file,\x20query\x20temporary\x20URL,\x20then\x20recognize\x20'+_0x588e40+_0x2d975c(0x1f5)};},async 'execute'(_0x41a020){const _0x7e6926=a160_0x38b484,_0x54e036=normalizeScene(_0x41a020[_0x7e6926(0x1eb)](_0x7e6926(0x1f0))),_0x55f4ac=SCENE_TO_LEGACY_TYPE[_0x54e036],_0x41a3a=validateInputSelection(_0x41a020);if(_0x41a3a[_0x7e6926(0x1df)]){const _0xf9506d=await recognizeDevelopmentOcr(_0x41a020['appCode'],{'url':_0x41a3a['imageUrl'],'type':_0x55f4ac});return{'ok':!![],'data':withScene(_0xf9506d,_0x54e036)};}const _0x59ae50=requireDevelopmentUploadFile(_0x41a3a[_0x7e6926(0x1f7)],'image-file'),_0x3c4041=await uploadDevelopmentFile(_0x41a020[_0x7e6926(0x1ed)],_0x59ae50[_0x7e6926(0x1fc)]);if(!_0x3c4041[_0x7e6926(0x1d4)])throw CliErrors[_0x7e6926(0x1fa)](_0x7e6926(0x1d3));const _0x17e436=await queryDevelopmentFileUrl(_0x3c4041['filePath'],{'download':![]});if(!_0x17e436[_0x7e6926(0x1fb)])throw CliErrors[_0x7e6926(0x1fa)](_0x7e6926(0x1d8));const _0x13022b=await recognizeDevelopmentOcr(_0x41a020[_0x7e6926(0x1ed)],{'url':_0x17e436[_0x7e6926(0x1fb)],'type':_0x55f4ac});return{'ok':!![],'data':withScene(_0x13022b,_0x54e036,_0x3c4041)};}};export const ocrDefinitions=[ocrRecognize];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a161_0x38a406=a161_0x46f8;(function(_0x8b131f,_0x5d23a9){const _0x3846f1=a161_0x46f8,_0x4feb05=_0x8b131f();while(!![]){try{const _0x1120c8=parseInt(_0x3846f1(0x115))/0x1*(parseInt(_0x3846f1(0x10a))/0x2)+-parseInt(_0x3846f1(0xfa))/0x3+parseInt(_0x3846f1(0xe3))/0x4*(parseInt(_0x3846f1(0x106))/0x5)+-parseInt(_0x3846f1(0x120))/0x6+-parseInt(_0x3846f1(0xf5))/0x7+-parseInt(_0x3846f1(0x10e))/0x8+-parseInt(_0x3846f1(0x125))/0x9*(-parseInt(_0x3846f1(0x107))/0xa);if(_0x1120c8===_0x5d23a9)break;else _0x4feb05['push'](_0x4feb05['shift']());}catch(_0x4833a6){_0x4feb05['push'](_0x4feb05['shift']());}}}(a161_0x283a,0x9ca59));import{readFile}from'node:fs/promises';import{dirname,join,resolve}from'node:path';import{fileURLToPath}from'node:url';import{APPCODE_FLAG}from'../../commands/common/flags.js';import{readCustomPageDirectory}from'../../core/page/file-system.js';import{createCustomPage}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{buildCustomPageDevelopmentUrl,buildCustomPageEditUrl,validateCustomPageContent}from'./custom/shared.js';const CUSTOM_PAGE_PATTERNS=['BLANK','ONEPAGE','DASHBOARD'],CUSTOM_PAGE_TEMPLATE_DIR=resolve(dirname(fileURLToPath(import.meta.url)),a161_0x38a406(0x121));export const pageCreate={'service':a161_0x38a406(0xfd),'command':a161_0x38a406(0xf4),'description':a161_0x38a406(0xf1),'risk':'write','defaultOutputFormat':a161_0x38a406(0xe8),'structuredErrors':!![],'rejectedFlags':[{'name':a161_0x38a406(0x101),'message':a161_0x38a406(0xfc),'hint':a161_0x38a406(0xeb)},{'name':'page-content','message':a161_0x38a406(0x11f),'hint':a161_0x38a406(0x124)}],'flags':[{'name':a161_0x38a406(0xe7),'type':a161_0x38a406(0x103),'description':a161_0x38a406(0xf6)},{'name':'parent-menu-id','type':a161_0x38a406(0xe4),'description':a161_0x38a406(0x122)},{'name':a161_0x38a406(0x105),'type':'string','description':'Built-in\x20Custom\x20Page\x20pattern\x20(cannot\x20be\x20used\x20with\x20--page-dir)','enum':CUSTOM_PAGE_PATTERNS},{'name':'page-dir','type':a161_0x38a406(0x103),'description':a161_0x38a406(0x11d)},APPCODE_FLAG],async 'validate'(_0x1babd0){await readValidatedPageSource(_0x1babd0);},async 'dryRun'(_0x2b87f7){const _0x1407a5=a161_0x38a406,_0x49a31d=readInput(_0x2b87f7,await readValidatedPageSource(_0x2b87f7));return{'method':_0x1407a5(0x110),'url':_0x1407a5(0xef),'body':{'appCode':_0x49a31d['appCode'],'pageName':_0x49a31d[_0x1407a5(0x10b)],..._0x49a31d[_0x1407a5(0x112)]!=null?{'parentMenuId':_0x49a31d['parentMenuId']}:{},'createMenu':_0x49a31d[_0x1407a5(0x111)],'codeContent':_0x49a31d['files']},'description':_0x1407a5(0x11a)+JSON[_0x1407a5(0xe6)](_0x49a31d[_0x1407a5(0x10b)])+_0x1407a5(0x10d)};},async 'execute'(_0x2b4224){const _0x49a714=a161_0x38a406,_0x367da6=readInput(_0x2b4224,await readValidatedPageSource(_0x2b4224)),_0x10b03e=await createCustomPage(_0x367da6);if(!Number['isInteger'](_0x10b03e[_0x49a714(0x109)])||_0x10b03e[_0x49a714(0x109)]<=0x0)throw CliErrors[_0x49a714(0x10f)](_0x49a714(0x123));const _0x5ed512=buildCustomPageDevelopmentUrl(_0x367da6[_0x49a714(0x119)],_0x10b03e[_0x49a714(0xfb)]),_0x46d65d=buildCustomPageEditUrl(_0x367da6[_0x49a714(0x119)],_0x10b03e[_0x49a714(0x109)]);return{'ok':!![],'data':{'operation':'page.create','pageType':_0x49a714(0xe5),'pagePattern':readPagePattern(_0x2b4224),'selector':{'appCode':_0x367da6[_0x49a714(0x119)],'pageName':_0x367da6[_0x49a714(0x10b)]},'before':null,'after':{'pageId':_0x10b03e[_0x49a714(0x109)],'pageName':_0x10b03e[_0x49a714(0x10b)],'appCode':_0x10b03e['appCode'],'version':_0x10b03e[_0x49a714(0xec)],'menuId':_0x10b03e[_0x49a714(0x113)],'menuPath':_0x10b03e[_0x49a714(0xfb)],'files':_0x10b03e['files']??Object[_0x49a714(0xe0)](_0x367da6[_0x49a714(0xea)])},'dryRun':![],'request':_0x367da6,..._0x5ed512?{'pageUrl':_0x5ed512}:{},..._0x46d65d?{'editPageUrl':_0x46d65d}:{},'warnings':_0x5ed512?[]:[_0x49a714(0xf9)]},'message':_0x49a714(0xf3)+_0x10b03e['pageId']+'.'};}};function readPagePattern(_0x25792b){const _0x498c6c=a161_0x38a406,_0x2e526b=_0x25792b['str']('page-pattern')[_0x498c6c(0x117)](),_0x380583=_0x25792b[_0x498c6c(0x100)](_0x498c6c(0xf2))['trim']();if(_0x2e526b&&_0x380583)throw CliErrors['validation'](_0x498c6c(0xe9));if(_0x380583)return null;if(!_0x2e526b)throw CliErrors[_0x498c6c(0xf7)](_0x498c6c(0xed));if(!CUSTOM_PAGE_PATTERNS[_0x498c6c(0x126)](_0x2e526b))throw CliErrors[_0x498c6c(0xf7)](_0x498c6c(0xf8));return _0x2e526b;}async function readPageSource(_0x26ea3c){const _0x2e6ef1=a161_0x38a406,_0x5ba310=_0x26ea3c[_0x2e6ef1(0x100)](_0x2e6ef1(0xf2))[_0x2e6ef1(0x117)](),_0x4b9236=readPagePattern(_0x26ea3c);if(_0x4b9236===null){const _0x1a09ea=await readCustomPageDirectory(_0x5ba310);if(Object[_0x2e6ef1(0xe0)](_0x1a09ea)['length']===0x0)throw CliErrors[_0x2e6ef1(0xf7)]('--page-dir\x20must\x20contain\x20at\x20least\x20one\x20page\x20file.');return _0x1a09ea;}let _0x13138f;try{_0x13138f=await readFile(join(CUSTOM_PAGE_TEMPLATE_DIR,_0x4b9236[_0x2e6ef1(0x116)]()+_0x2e6ef1(0xee)),_0x2e6ef1(0x118));}catch{throw CliErrors[_0x2e6ef1(0xf7)](_0x2e6ef1(0xe2)+_0x4b9236+'.');}let _0x3303e;try{_0x3303e=JSON[_0x2e6ef1(0xfe)](_0x13138f);}catch{throw CliErrors[_0x2e6ef1(0xf7)](_0x2e6ef1(0x102)+_0x4b9236+'.');}if(!_0x3303e||typeof _0x3303e!==_0x2e6ef1(0xf0)||Array[_0x2e6ef1(0x10c)](_0x3303e)||Object[_0x2e6ef1(0x11b)](_0x3303e)['some'](_0x5edd7b=>typeof _0x5edd7b!==_0x2e6ef1(0x103)))throw CliErrors[_0x2e6ef1(0xf7)]('Invalid\x20Custom\x20Page\x20pattern:\x20'+_0x4b9236+'.');return _0x3303e;}function a161_0x46f8(_0x35924d,_0x3a02c4){_0x35924d=_0x35924d-0xe0;const _0x283a8b=a161_0x283a();let _0x46f81d=_0x283a8b[_0x35924d];return _0x46f81d;}async function readValidatedPageSource(_0x5b0f8c){const _0x483846=await readPageSource(_0x5b0f8c);return await validateCustomPageContent(_0x483846),_0x483846;}function a161_0x283a(){const _0x43c5a1=['/smartapi/webcode/page/create','object','Create\x20a\x20JSX\x20Custom\x20Page\x20from\x20a\x20released\x20pattern\x20or\x20local\x20directory','page-dir','Created\x20Custom\x20Page\x20','create','6537510hItHko','Optional\x20Custom\x20Page\x20name\x20(1-100\x20characters)','validation','--page-pattern\x20must\x20be\x20BLANK,\x20ONEPAGE,\x20or\x20DASHBOARD.','Custom\x20Page\x20was\x20created,\x20but\x20a\x20link\x20to\x20its\x20latest\x20saved\x20content\x20could\x20not\x20be\x20generated.','1457376ObEESI','menuPath','page\x20create\x20does\x20not\x20accept\x20--page-type.','page','parse','parent-menu-id','str','page-type','Invalid\x20Custom\x20Page\x20pattern:\x20','string','now','page-pattern','5660SZTQra','43130zvYljM','isInteger','pageId','147514iREzXx','pageName','isArray','\x20and\x20its\x20menu\x20entry.','6377088UqDEZH','apiError','POST','createMenu','parentMenuId','menuId','num','12OggZUX','toLowerCase','trim','utf8','appCode','Would\x20create\x20Custom\x20Page\x20','values','length','Directory\x20containing\x20all\x20page\x20files\x20(cannot\x20be\x20used\x20with\x20--page-pattern)','Custom_page_','page\x20create\x20no\x20longer\x20accepts\x20--page-content.','1344420LEvdif','../../../templates/custom-pages','Optional\x20parent\x20menu\x20id\x20when\x20creating\x20a\x20menu\x20entry','Custom\x20Page\x20creation\x20did\x20not\x20return\x20a\x20valid\x20pageId.','Write\x20the\x20complete\x20page\x20files\x20to\x20a\x20local\x20directory\x20and\x20use\x20--page-dir\x20<dir>.','2169NmitnW','includes','keys','--parent-menu-id\x20must\x20be\x20a\x20positive\x20integer.','Custom\x20Page\x20pattern\x20not\x20found:\x20','4092NDbJvI','number','CUSTOM','stringify','name','compress','--page-pattern\x20and\x20--page-dir\x20cannot\x20be\x20used\x20together.','files','This\x20command\x20always\x20creates\x20a\x20CUSTOM\x20JSX\x20page;\x20use\x20--page-pattern\x20BLANK,\x20ONEPAGE,\x20DASHBOARD,\x20or\x20--page-dir.','version','Provide\x20--page-pattern\x20BLANK,\x20ONEPAGE,\x20DASHBOARD,\x20or\x20--page-dir\x20<dir>.','.json'];a161_0x283a=function(){return _0x43c5a1;};return a161_0x283a();}function readInput(_0xece1c9,_0x4ef5ee){const _0x8698d0=a161_0x38a406,_0x2161fd=_0xece1c9['str'](_0x8698d0(0xe7))['trim']()||_0x8698d0(0x11e)+Date[_0x8698d0(0x104)]();if(_0x2161fd[_0x8698d0(0x11c)]>0x64)throw CliErrors[_0x8698d0(0xf7)]('pageName\x20cannot\x20exceed\x20100\x20characters.');const _0x59a99a=_0xece1c9[_0x8698d0(0x114)](_0x8698d0(0xff),NaN),_0x598216=!Number['isNaN'](_0x59a99a);if(_0x598216&&(!Number[_0x8698d0(0x108)](_0x59a99a)||_0x59a99a<=0x0))throw CliErrors['validation'](_0x8698d0(0xe1));return{'appCode':_0xece1c9[_0x8698d0(0x119)],'pageName':_0x2161fd,..._0x598216?{'parentMenuId':_0x59a99a}:{},'createMenu':!![],'files':_0x4ef5ee};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a162_0x1435(){const _0x11dfdd=['8404880XWZqWs','str','pageCode','padStart','126134iSesVx','Show\x20a\x20Custom\x20Page\x20and\x20all\x20of\x20its\x20files','getFullYear','6tRJzkO','55ZELDIG','6352812KFcLST','getHours','number','Retrieved\x20Custom\x20Page\x20','join','135336WsrLxF','appCode','trim','getTime','page','3067857hubZYF','10859170DLmDea','cookie','custom-detail','8AsqFKd','24VKIOSH','Custom\x20Page\x20ID','getMinutes','compress','getSeconds','7FwYUod','isNaN','130320kxBxgL','getDate'];a162_0x1435=function(){return _0x11dfdd;};return a162_0x1435();}const a162_0x1180b6=a162_0x4ea8;(function(_0x39fe5e,_0x39fb63){const _0x466df3=a162_0x4ea8,_0x1299bb=_0x39fe5e();while(!![]){try{const _0x237e03=-parseInt(_0x466df3(0x1a7))/0x1*(-parseInt(_0x466df3(0x1aa))/0x2)+parseInt(_0x466df3(0x190))/0x3*(parseInt(_0x466df3(0x199))/0x4)+parseInt(_0x466df3(0x1a1))/0x5*(parseInt(_0x466df3(0x19a))/0x6)+-parseInt(_0x466df3(0x19f))/0x7*(parseInt(_0x466df3(0x1a3))/0x8)+-parseInt(_0x466df3(0x195))/0x9+-parseInt(_0x466df3(0x196))/0xa+parseInt(_0x466df3(0x1ab))/0xb*(parseInt(_0x466df3(0x1ac))/0xc);if(_0x237e03===_0x39fb63)break;else _0x1299bb['push'](_0x1299bb['shift']());}catch(_0x1bba6b){_0x1299bb['push'](_0x1299bb['shift']());}}}(a162_0x1435,0xb5457));function a162_0x4ea8(_0x26b775,_0x173aa5){_0x26b775=_0x26b775-0x190;const _0x14358a=a162_0x1435();let _0x4ea850=_0x14358a[_0x26b775];return _0x4ea850;}import{getCustomPageSource}from'../../../core/api-client.js';import{buildCustomPageEditUrl,buildCustomPageRuntimeUrl,readCustomPageId,CUSTOM_PAGE_APPCODE_FLAG_OPTIONAL,resolveCustomPageDevelopmentUrl}from'./shared.js';export const pageCustomDetail={'service':a162_0x1180b6(0x194),'command':a162_0x1180b6(0x198),'description':a162_0x1180b6(0x1a8),'risk':'read','defaultOutputFormat':a162_0x1180b6(0x19d),'structuredErrors':!![],'requiresAppCode':![],'flags':[{'name':'id','type':a162_0x1180b6(0x1ae),'required':!![],'description':a162_0x1180b6(0x19b)},CUSTOM_PAGE_APPCODE_FLAG_OPTIONAL],async 'validate'(_0x54e085){readCustomPageId(_0x54e085);},async 'execute'(_0x1d87bf){const _0x3713aa=a162_0x1180b6,_0x28285f=readCustomPageId(_0x1d87bf),_0x25bb00=await getCustomPageSource(_0x28285f),{bundle:_0x35855d,createTime:_0x3959e1,updateTime:_0x42c897,..._0x20efe6}=_0x25bb00,_0x16144b=_0x25bb00['id']??_0x28285f,_0x2edc32=_0x25bb00[_0x3713aa(0x191)]?.[_0x3713aa(0x192)]()||_0x1d87bf[_0x3713aa(0x1a4)]('appcode')[_0x3713aa(0x192)](),_0x7a98d2=buildCustomPageRuntimeUrl(_0x2edc32,_0x25bb00[_0x3713aa(0x1a5)]),_0x533d20=buildCustomPageEditUrl(_0x2edc32,_0x16144b),_0x4d7424=await resolveCustomPageDevelopmentUrl(_0x2edc32,_0x16144b,_0x1d87bf[_0x3713aa(0x197)]);return{'ok':!![],'data':{..._0x20efe6,..._0x7a98d2?{'runtimePageUrl':_0x7a98d2}:{},..._0x4d7424?{'pageUrl':_0x4d7424}:{},..._0x533d20?{'editPageUrl':_0x533d20}:{},..._0x3959e1==null?{}:{'createTime':formatTime(_0x3959e1)},..._0x42c897==null?{}:{'updateTime':formatTime(_0x42c897)}},'message':_0x3713aa(0x1af)+_0x28285f+'.'};}};function formatTime(_0x296c7a){const _0x37753b=a162_0x1180b6,_0x1168cc=new Date(_0x296c7a);if(Number[_0x37753b(0x1a0)](_0x1168cc[_0x37753b(0x193)]()))return String(_0x296c7a);const _0x267832=[_0x1168cc[_0x37753b(0x1a9)](),String(_0x1168cc['getMonth']()+0x1)['padStart'](0x2,'0'),String(_0x1168cc[_0x37753b(0x1a2)]())[_0x37753b(0x1a6)](0x2,'0')][_0x37753b(0x1b0)]('-'),_0x451bc1=[String(_0x1168cc[_0x37753b(0x1ad)]())['padStart'](0x2,'0'),String(_0x1168cc[_0x37753b(0x19c)]())[_0x37753b(0x1a6)](0x2,'0'),String(_0x1168cc[_0x37753b(0x19e)]())[_0x37753b(0x1a6)](0x2,'0')]['join'](':');return _0x267832+'\x20'+_0x451bc1;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a163_0x59ec(_0xf95fc,_0x12b401){_0xf95fc=_0xf95fc-0x10a;const _0x422112=a163_0x4221();let _0x59ec5b=_0x422112[_0xf95fc];return _0x59ec5b;}const a163_0x1be3c6=a163_0x59ec;function a163_0x4221(){const _0x5a6762=['flatMap','label','pageId','40sMxklx','compress','List\x20Custom\x20Pages\x20in\x20the\x20current\x20app','239432DlUZdk','react','2941710cojCKH','length','19107708wPsfFR','\x20Custom\x20Page(s).','369975OjgqWX','6SxPXms','7stzymD','appCode','2161050Xkyjif','2411433HEFrXa','path','11hnSOXm','85YEoOoi','type','3945872gnSjcN','Found\x20'];a163_0x4221=function(){return _0x5a6762;};return a163_0x4221();}(function(_0x554cba,_0x51b7a6){const _0x1ce833=a163_0x59ec,_0x278eba=_0x554cba();while(!![]){try{const _0x51a8ee=-parseInt(_0x1ce833(0x11b))/0x1*(parseInt(_0x1ce833(0x11c))/0x2)+-parseInt(_0x1ce833(0x117))/0x3+-parseInt(_0x1ce833(0x115))/0x4*(-parseInt(_0x1ce833(0x10b))/0x5)+parseInt(_0x1ce833(0x11f))/0x6*(-parseInt(_0x1ce833(0x11d))/0x7)+-parseInt(_0x1ce833(0x10d))/0x8+parseInt(_0x1ce833(0x120))/0x9*(parseInt(_0x1ce833(0x112))/0xa)+-parseInt(_0x1ce833(0x10a))/0xb*(-parseInt(_0x1ce833(0x119))/0xc);if(_0x51a8ee===_0x51b7a6)break;else _0x278eba['push'](_0x278eba['shift']());}catch(_0x6d165f){_0x278eba['push'](_0x278eba['shift']());}}}(a163_0x4221,0xb41cb));import{APPCODE_FLAG_OPTIONAL}from'../../../commands/common/flags.js';import{fetchMenuSnapshot}from'../../../commands/menu/shared/facts.js';import{buildCustomPageDevelopmentUrl,buildCustomPageEditUrl}from'./shared.js';export const pageCustomList={'service':'page','command':'custom-list','description':a163_0x1be3c6(0x114),'risk':'read','defaultOutputFormat':a163_0x1be3c6(0x113),'structuredErrors':!![],'flags':[APPCODE_FLAG_OPTIONAL],async 'execute'(_0x1e76cf){const _0x3a0ac9=a163_0x1be3c6,_0x5322b4=(await fetchMenuSnapshot(_0x1e76cf[_0x3a0ac9(0x11e)],_0x1e76cf['cookie']))['menus'][_0x3a0ac9(0x10f)](_0x12eef7=>{const _0x79bebe=_0x3a0ac9;if(_0x12eef7[_0x79bebe(0x10c)]!==_0x79bebe(0x116)||_0x12eef7[_0x79bebe(0x111)]==null)return[];const _0x1d8460=buildCustomPageDevelopmentUrl(_0x1e76cf[_0x79bebe(0x11e)],_0x12eef7[_0x79bebe(0x121)]),_0x2e00d6=buildCustomPageEditUrl(_0x1e76cf[_0x79bebe(0x11e)],_0x12eef7[_0x79bebe(0x111)]);return[{'pageId':_0x12eef7[_0x79bebe(0x111)],'label':_0x12eef7[_0x79bebe(0x110)],..._0x1d8460?{'pageUrl':_0x1d8460}:{},..._0x2e00d6?{'editPageUrl':_0x2e00d6}:{}}];});return{'ok':!![],'data':{'pages':_0x5322b4},'message':_0x5322b4['length']===0x0?'No\x20Custom\x20Pages\x20found.':_0x3a0ac9(0x10e)+_0x5322b4[_0x3a0ac9(0x118)]+_0x3a0ac9(0x11a)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a164_0x159947=a164_0x557e;(function(_0x22f2a6,_0x1dbe47){const _0x369c43=a164_0x557e,_0x3fbf8b=_0x22f2a6();while(!![]){try{const _0x4e1796=parseInt(_0x369c43(0x1b0))/0x1+parseInt(_0x369c43(0x1af))/0x2*(-parseInt(_0x369c43(0x19e))/0x3)+parseInt(_0x369c43(0x1b6))/0x4*(-parseInt(_0x369c43(0x19c))/0x5)+parseInt(_0x369c43(0x1b7))/0x6+-parseInt(_0x369c43(0x1b4))/0x7+-parseInt(_0x369c43(0x1aa))/0x8*(parseInt(_0x369c43(0x19b))/0x9)+parseInt(_0x369c43(0x1ab))/0xa;if(_0x4e1796===_0x1dbe47)break;else _0x3fbf8b['push'](_0x3fbf8b['shift']());}catch(_0x47e44e){_0x3fbf8b['push'](_0x3fbf8b['shift']());}}}(a164_0x29fe,0x7198c));import{getCustomPageSource,publishCustomPage}from'../../../core/api-client.js';function a164_0x29fe(){const _0x3219c8=['372556STENmA','343812wqZPpH','Custom\x20Page\x20ID','apiError','string','Custom\x20Page\x20publish\x20did\x20not\x20reach\x20published\x20status:\x20','pageCode','runtimePageUrl','Custom\x20Page\x20publish\x20did\x20not\x20return\x20the\x20expected\x20page\x20ID.','522GKiBZi','45cNtDqG','custom-publish','15ltanqe','compress','unknown','POST','Published\x20successfully,\x20but\x20a\x20link\x20to\x20the\x20latest\x20saved\x20content\x20could\x20not\x20be\x20generated.','push','FORMAL','trim','Publish\x20the\x20latest\x20saved\x20content\x20of\x20a\x20Custom\x20Page','pageId','page','Would\x20publish\x20Custom\x20Page\x20','29136mwEVLk','25069790mosFRM','warnings','status','isInteger','359714kpCYVw','170334IeIYaR','number','/smartapi/webcode/file/publish','remark','2243857CrUnDl','appCode'];a164_0x29fe=function(){return _0x3219c8;};return a164_0x29fe();}import{CliErrors}from'../../../errors.js';import{buildCustomPageEditUrl,buildCustomPageRuntimeUrl,readCustomPageId,resolveCustomPageDevelopmentUrl}from'./shared.js';export const pageCustomPublish={'service':a164_0x159947(0x1a8),'command':a164_0x159947(0x19d),'description':a164_0x159947(0x1a6),'risk':'write','defaultOutputFormat':a164_0x159947(0x19f),'structuredErrors':!![],'requiresAppCode':![],'flags':[{'name':'id','type':a164_0x159947(0x1b1),'required':!![],'description':a164_0x159947(0x1b8)},{'name':a164_0x159947(0x1b3),'type':a164_0x159947(0x1ba),'description':'Optional\x20publish\x20remark'}],async 'validate'(_0xa465cd){readCustomPageId(_0xa465cd);},async 'dryRun'(_0x346995){const _0x4d04b0=a164_0x159947,_0x301249=readInput(_0x346995);return{'method':_0x4d04b0(0x1a1),'url':_0x4d04b0(0x1b2),'body':{'id':_0x301249[_0x4d04b0(0x1a7)],..._0x301249['remark']?{'remark':_0x301249[_0x4d04b0(0x1b3)]}:{}},'description':_0x4d04b0(0x1a9)+_0x301249[_0x4d04b0(0x1a7)]+'.'};},async 'execute'(_0x438bec){const _0x62bdaa=a164_0x159947,_0xb6d3e=readInput(_0x438bec);await getCustomPageSource(_0xb6d3e['pageId']);const _0x4a9d52=await publishCustomPage(_0xb6d3e);if(!Number[_0x62bdaa(0x1ae)](_0x4a9d52)||_0x4a9d52!==_0xb6d3e[_0x62bdaa(0x1a7)])throw CliErrors[_0x62bdaa(0x1b9)](_0x62bdaa(0x19a));const _0x571cfc=await getCustomPageSource(_0xb6d3e[_0x62bdaa(0x1a7)]);if(_0x571cfc['status']!==_0x62bdaa(0x1a4))throw CliErrors[_0x62bdaa(0x1b9)](_0x62bdaa(0x1bb)+(_0x571cfc[_0x62bdaa(0x1ad)]??_0x62bdaa(0x1a0))+'.');const _0x59493d=_0x571cfc[_0x62bdaa(0x1b5)]?.['trim'](),_0x5792ae=buildCustomPageEditUrl(_0x59493d,_0xb6d3e[_0x62bdaa(0x1a7)]),_0x21952e=await resolveCustomPageDevelopmentUrl(_0x59493d,_0xb6d3e[_0x62bdaa(0x1a7)],_0x438bec['cookie']),_0x4a70d2=buildMutationData(_0xb6d3e,!![],_0x21952e,_0x5792ae);_0x59493d&&!_0x21952e&&_0x4a70d2[_0x62bdaa(0x1ac)][_0x62bdaa(0x1a3)](_0x62bdaa(0x1a2));const _0x15d5ad=buildCustomPageRuntimeUrl(_0x571cfc['appCode'],_0x571cfc[_0x62bdaa(0x1bc)]);return _0x15d5ad?_0x4a70d2[_0x62bdaa(0x1bd)]=_0x15d5ad:_0x4a70d2['warnings'][_0x62bdaa(0x1a3)]('Published\x20successfully,\x20but\x20a\x20link\x20to\x20the\x20published\x20page\x20could\x20not\x20be\x20generated.'),{'ok':!![],'data':_0x4a70d2,'message':'Published\x20Custom\x20Page\x20'+_0xb6d3e[_0x62bdaa(0x1a7)]+'.'};}};function readInput(_0x19ace3){const _0x1fcf89=a164_0x159947,_0x37d75e=readCustomPageId(_0x19ace3),_0x1502cc=_0x19ace3['str'](_0x1fcf89(0x1b3))[_0x1fcf89(0x1a5)]();return{'pageId':_0x37d75e,..._0x1502cc?{'remark':_0x1502cc}:{}};}function a164_0x557e(_0x56ea4f,_0x1a9fa5){_0x56ea4f=_0x56ea4f-0x19a;const _0x29febd=a164_0x29fe();let _0x557e11=_0x29febd[_0x56ea4f];return _0x557e11;}function buildMutationData(_0x5261f5,_0x2d4fbd=![],_0x1cfcbe,_0x3b2ac1){const _0x131329=a164_0x159947;return{'operation':'page.custom-publish','selector':{'pageId':_0x5261f5[_0x131329(0x1a7)]},'before':null,'after':{'pageId':_0x5261f5[_0x131329(0x1a7)],'status':_0x131329(0x1a4)},'dryRun':!_0x2d4fbd,'request':_0x5261f5,..._0x1cfcbe?{'pageUrl':_0x1cfcbe}:{},..._0x3b2ac1?{'editPageUrl':_0x3b2ac1}:{},'warnings':[]};}
|
|
@@ -53,14 +53,6 @@ export declare function resolveCustomPageDevelopmentUrl(appCode: string | undefi
|
|
|
53
53
|
* @returns 当前环境页面编辑地址,任一为空返回 undefined
|
|
54
54
|
*/
|
|
55
55
|
export declare function buildCustomPageEditUrl(appCode: string | undefined, pageId: number | string | undefined): string | undefined;
|
|
56
|
-
/**
|
|
57
|
-
* 解析并校验 page-content 入参
|
|
58
|
-
*
|
|
59
|
-
* @param value 命令参数 `--page-content` 的原始字符串
|
|
60
|
-
* @returns 路径到内容字符串的映射
|
|
61
|
-
* @throws 当缺失、非 JSON 或值不是字符串时抛出校验错误
|
|
62
|
-
*/
|
|
63
|
-
export declare function parseCustomPageContent(value: string): Record<string, string>;
|
|
64
56
|
/**
|
|
65
57
|
* 校验完整自定义页面文件映射中的源码
|
|
66
58
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x15eefa,_0x29c0e5){const _0x35fbd6=a165_0xfaf3,_0x4515f2=_0x15eefa();while(!![]){try{const _0x26e58f=-parseInt(_0x35fbd6(0x1c8))/0x1*(parseInt(_0x35fbd6(0x1c3))/0x2)+parseInt(_0x35fbd6(0x1c9))/0x3+parseInt(_0x35fbd6(0x1d2))/0x4*(parseInt(_0x35fbd6(0x1c0))/0x5)+-parseInt(_0x35fbd6(0x1be))/0x6*(-parseInt(_0x35fbd6(0x1ce))/0x7)+parseInt(_0x35fbd6(0x1c2))/0x8+parseInt(_0x35fbd6(0x1c7))/0x9+-parseInt(_0x35fbd6(0x1cc))/0xa;if(_0x26e58f===_0x29c0e5)break;else _0x4515f2['push'](_0x4515f2['shift']());}catch(_0x3cf45e){_0x4515f2['push'](_0x4515f2['shift']());}}}(a165_0x1794,0xf2ca4));import{APPCODE_FLAG_OPTIONAL}from'../../../commands/common/flags.js';import{fetchMenuSnapshot}from'../../../commands/menu/shared/facts.js';import{getAppBaseUrl,getPublishedAppDomain}from'../../../constant/domain.js';function a165_0x1794(){const _0x57f64d=['5HBlMRf','file','1055096qoTgiA','45106owUzcQ','find','map','message','651645AeWKma','19rpBtJZ','5627010fJreKk','--id\x20must\x20be\x20a\x20positive\x20integer.','num','29852870eWXSoy','Invalid\x20Custom\x20Page\x20content:\x20','14AHxiYI','menus','isInteger','/ide/','1932016hMqjMr','trim','5535888hlZbSr','validation'];a165_0x1794=function(){return _0x57f64d;};return a165_0x1794();}import{CliErrors}from'../../../errors.js';import{validateCustomPageSourceFiles}from'./syntax.js';export const CUSTOM_PAGE_APPCODE_FLAG_OPTIONAL={...APPCODE_FLAG_OPTIONAL,'description':'Optional\x20app\x20code\x20resolved\x20from\x20page\x20ID\x20when\x20omitted'};function trimOptional(_0x5a40e4){const _0x56b710=a165_0xfaf3;return _0x5a40e4?.[_0x56b710(0x1bd)]()||undefined;}export function buildCustomPageRuntimeUrl(_0x2cc157,_0x2053f4){const _0x2aec02=trimOptional(_0x2cc157),_0xa0dcea=trimOptional(_0x2053f4);if(!_0x2aec02||!_0xa0dcea)return undefined;return getPublishedAppDomain(_0x2aec02)+'/'+encodeURIComponent(_0xa0dcea);}export function buildCustomPageDevelopmentUrl(_0x2564e9,_0xf5db10){const _0x790659=trimOptional(_0x2564e9),_0x303a4d=trimOptional(_0xf5db10);if(!_0x790659||!_0x303a4d)return undefined;return getAppBaseUrl(_0x790659)+'/pages/'+encodeURIComponent(_0x303a4d);}function a165_0xfaf3(_0x3df1b0,_0x27fc1d){_0x3df1b0=_0x3df1b0-0x1bd;const _0x1794f3=a165_0x1794();let _0xfaf32c=_0x1794f3[_0x3df1b0];return _0xfaf32c;}export async function resolveCustomPageDevelopmentUrl(_0x21c59f,_0x2cb6e9,_0x44c262){const _0xb538f2=a165_0xfaf3,_0x229834=trimOptional(_0x21c59f);if(!_0x229834)return undefined;try{const _0x497866=(await fetchMenuSnapshot(_0x229834,_0x44c262))[_0xb538f2(0x1cf)][_0xb538f2(0x1c4)](_0x1c2b30=>_0x1c2b30['type']==='react'&&_0x1c2b30['pageId']===_0x2cb6e9);return buildCustomPageDevelopmentUrl(_0x229834,_0x497866?.['path']);}catch{return undefined;}}export function buildCustomPageEditUrl(_0x16a0e1,_0x4a96cc){const _0x17788f=a165_0xfaf3,_0x16127e=trimOptional(_0x16a0e1);if(!_0x16127e)return;const _0x38e80f=trimOptional(String(_0x4a96cc??''));if(!_0x38e80f)return;return getAppBaseUrl(_0x16127e)+_0x17788f(0x1d1)+encodeURIComponent(_0x38e80f);}export async function validateCustomPageContent(_0x4ac6cb){const _0x3bcd87=a165_0xfaf3,_0x574fb0=await validateCustomPageSourceFiles(_0x4ac6cb);if(_0x574fb0['length']>0x0)throw CliErrors[_0x3bcd87(0x1bf)](_0x3bcd87(0x1cd)+_0x574fb0[_0x3bcd87(0x1c5)](_0x538cc9=>_0x538cc9[_0x3bcd87(0x1c1)]+':\x20'+_0x538cc9[_0x3bcd87(0x1c6)])['join'](';\x20'));}export function readCustomPageId(_0x43b0ab){const _0x5d13b4=a165_0xfaf3,_0xa66fb1=_0x43b0ab[_0x5d13b4(0x1cb)]('id');if(!Number[_0x5d13b4(0x1d0)](_0xa66fb1)||_0xa66fb1<=0x0)throw CliErrors['validation'](_0x5d13b4(0x1ca));return _0xa66fb1;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a166_0x17e01e=a166_0x203f;(function(_0x2730ac,_0x2c48c4){const _0x53f943=a166_0x203f,_0x171774=_0x2730ac();while(!![]){try{const _0x502c8e=-parseInt(_0x53f943(0x1b0))/0x1+parseInt(_0x53f943(0x1b1))/0x2+-parseInt(_0x53f943(0x1b6))/0x3+-parseInt(_0x53f943(0x1b8))/0x4*(-parseInt(_0x53f943(0x1b2))/0x5)+-parseInt(_0x53f943(0x1aa))/0x6+parseInt(_0x53f943(0x1ad))/0x7*(-parseInt(_0x53f943(0x1b5))/0x8)+parseInt(_0x53f943(0x1a7))/0x9;if(_0x502c8e===_0x2c48c4)break;else _0x171774['push'](_0x171774['shift']());}catch(_0x27c1b8){_0x171774['push'](_0x171774['shift']());}}}(a166_0x9aec,0x3e686));function a166_0x203f(_0x488431,_0x43a4e4){_0x488431=_0x488431-0x1a5;const _0x9aec49=a166_0x9aec();let _0x203fcc=_0x9aec49[_0x488431];return _0x203fcc;}import{format}from'prettier';const SOURCE_PARSERS={'.js':a166_0x17e01e(0x1b4),'.jsx':a166_0x17e01e(0x1b4),'.ts':'typescript','.tsx':a166_0x17e01e(0x1a9)},CUSTOM_PAGE_EXTENSIONS=['.jsx','.tsx'];function a166_0x9aec(){const _0x113123=['14616lPrqRT','endsWith','some','450961SPsvex','633032TzEYqS','490HonSQa','toLowerCase','babel','1776jXPLlW','1358361QjkcyK','filter','20580oFUVOj','entries','all','Missing\x20React\x20source\x20file\x20with\x20extension\x20.jsx\x20or\x20.tsx','8816382NiAACo','map','typescript','1064508PTVskY','trim','message'];a166_0x9aec=function(){return _0x113123;};return a166_0x9aec();}export async function validateCustomPageSourceFiles(_0x5ef0d9){const _0x69c7e6=a166_0x17e01e,_0x51717f=Object[_0x69c7e6(0x1b9)](_0x5ef0d9)[_0x69c7e6(0x1b7)](([_0x5a2524])=>getParser(_0x5a2524));if(!_0x51717f[_0x69c7e6(0x1af)](([_0x4683fa])=>isReactSourceFile(_0x4683fa)))return[{'file':'page\x20files','message':_0x69c7e6(0x1a6)}];const _0xa61fc6=await Promise[_0x69c7e6(0x1a5)](_0x51717f[_0x69c7e6(0x1a8)](async([_0x5948da,_0x125593])=>{const _0x1609e1=_0x69c7e6;try{return await format(_0x125593,{'parser':getParser(_0x5948da)}),undefined;}catch(_0x41f882){return{'file':_0x5948da,'message':_0x41f882 instanceof Error?_0x41f882[_0x1609e1(0x1ac)]:String(_0x41f882)};}}));return _0xa61fc6[_0x69c7e6(0x1b7)](_0x14a575=>_0x14a575!==undefined);}function getParser(_0x3d4314){const _0x337759=a166_0x17e01e,_0x27faea=_0x3d4314[_0x337759(0x1ab)]()[_0x337759(0x1b3)]();return Object['entries'](SOURCE_PARSERS)['find'](([_0x38ab42])=>_0x27faea['endsWith'](_0x38ab42))?.[0x1];}function isReactSourceFile(_0x305414){const _0x39192a=a166_0x17e01e,_0x3716eb=_0x305414[_0x39192a(0x1ab)]()[_0x39192a(0x1b3)]();return CUSTOM_PAGE_EXTENSIONS[_0x39192a(0x1af)](_0x3d5cb4=>_0x3716eb[_0x39192a(0x1ae)](_0x3d5cb4));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a167_0x5409bf=a167_0x1624;(function(_0x5cd39b,_0x50b8d7){const _0x510629=a167_0x1624,_0x26490a=_0x5cd39b();while(!![]){try{const _0x5c8d36=parseInt(_0x510629(0xa9))/0x1*(-parseInt(_0x510629(0x98))/0x2)+-parseInt(_0x510629(0x97))/0x3+-parseInt(_0x510629(0x9d))/0x4+parseInt(_0x510629(0xb1))/0x5+parseInt(_0x510629(0xa6))/0x6+-parseInt(_0x510629(0xa5))/0x7+parseInt(_0x510629(0x96))/0x8;if(_0x5c8d36===_0x50b8d7)break;else _0x26490a['push'](_0x26490a['shift']());}catch(_0x3a995e){_0x26490a['push'](_0x26490a['shift']());}}}(a167_0x4a4b,0x21ebe));import{getCustomPageSource,updateCustomPageContent}from'../../../core/api-client.js';function a167_0x1624(_0x2f9b87,_0x4be44d){_0x2f9b87=_0x2f9b87-0x93;const _0x4a4b60=a167_0x4a4b();let _0x1624af=_0x4a4b60[_0x2f9b87];return _0x1624af;}import{readCustomPageDirectory}from'../../../core/page/file-system.js';import{CliErrors}from'../../../errors.js';import{buildCustomPageEditUrl,resolveCustomPageDevelopmentUrl,readCustomPageId,CUSTOM_PAGE_APPCODE_FLAG_OPTIONAL,validateCustomPageContent}from'./shared.js';export const pageCustomUpdate={'service':'page','command':a167_0x5409bf(0xaf),'description':'Save\x20all\x20files\x20of\x20a\x20Custom\x20Page','risk':'write','defaultOutputFormat':a167_0x5409bf(0xa0),'structuredErrors':!![],'requiresAppCode':![],'rejectedFlags':[{'name':a167_0x5409bf(0xae),'message':a167_0x5409bf(0xaa),'hint':a167_0x5409bf(0xb2)}],'flags':[{'name':'id','type':a167_0x5409bf(0xa7),'required':!![],'description':'Custom\x20Page\x20ID'},{'name':a167_0x5409bf(0xa1),'type':a167_0x5409bf(0x94),'required':!![],'description':'Directory\x20containing\x20all\x20complete\x20page\x20files'},CUSTOM_PAGE_APPCODE_FLAG_OPTIONAL],async 'validate'(_0x5ae6ad){readCustomPageId(_0x5ae6ad),await readValidatedPageContent(_0x5ae6ad);},async 'dryRun'(_0x1899a0){const _0x3fa8c5=a167_0x5409bf,_0x955102=await readInput(_0x1899a0);return{'method':_0x3fa8c5(0xa2),'url':'/smartapi/webcode/page/update/content','body':{'id':_0x955102[_0x3fa8c5(0x9a)],'codeContent':_0x955102[_0x3fa8c5(0xac)]},'description':_0x3fa8c5(0xab)+_0x955102[_0x3fa8c5(0x9a)]+'.'};},async 'execute'(_0x1ab71a){const _0x1f15dc=a167_0x5409bf,_0x2e2b42=await readInput(_0x1ab71a),_0x3e62d5=await updateCustomPageContent({'pageId':_0x2e2b42[_0x1f15dc(0x9a)],'pageContent':_0x2e2b42[_0x1f15dc(0xac)]});if(!Number[_0x1f15dc(0xad)](_0x3e62d5[_0x1f15dc(0xb0)])||_0x3e62d5['newVersion']<=0x0)throw CliErrors[_0x1f15dc(0x9e)](_0x1f15dc(0xa4));const _0x353710=buildCustomPageEditUrl(_0x2e2b42[_0x1f15dc(0x9b)],_0x2e2b42[_0x1f15dc(0x9a)]),_0x580b78=await resolveCustomPageDevelopmentUrl(_0x2e2b42[_0x1f15dc(0x9b)],_0x2e2b42[_0x1f15dc(0x9a)],_0x1ab71a[_0x1f15dc(0x9f)]);return{'ok':!![],'data':{'operation':'page.custom-update','selector':{'appCode':_0x2e2b42[_0x1f15dc(0x9b)],'pageId':_0x2e2b42[_0x1f15dc(0x9a)]},'before':null,'after':{'pageId':_0x3e62d5[_0x1f15dc(0x9a)],'version':_0x3e62d5[_0x1f15dc(0xb0)],'pageContent':_0x2e2b42[_0x1f15dc(0xac)]},'dryRun':![],'request':_0x2e2b42,..._0x580b78?{'pageUrl':_0x580b78}:{},..._0x353710?{'editPageUrl':_0x353710}:{},'warnings':_0x580b78?[]:['Custom\x20Page\x20was\x20updated,\x20but\x20a\x20link\x20to\x20its\x20latest\x20saved\x20content\x20could\x20not\x20be\x20generated.']},'message':_0x1f15dc(0x95)+_0x2e2b42[_0x1f15dc(0x9a)]+'.'};}};async function readInput(_0x4ec06a){const _0x124d5a=a167_0x5409bf,_0x15238c=readCustomPageId(_0x4ec06a),_0x3d21b0=_0x4ec06a[_0x124d5a(0x99)](_0x124d5a(0xa8))[_0x124d5a(0x93)]()||(await getCustomPageSource(_0x15238c))[_0x124d5a(0x9b)]?.[_0x124d5a(0x93)]();if(!_0x3d21b0)throw CliErrors[_0x124d5a(0xa3)](_0x124d5a(0x9c)+_0x15238c+'.');return{'appCode':_0x3d21b0,'pageId':_0x15238c,'pageContent':await readValidatedPageContent(_0x4ec06a)};}async function readValidatedPageContent(_0x11723d){const _0x488b70=a167_0x5409bf,_0x338f69=await readCustomPageDirectory(_0x11723d[_0x488b70(0x99)]('page-dir'));return await validateCustomPageContent(_0x338f69),_0x338f69;}function a167_0x4a4b(){const _0x5f0ae3=['Custom\x20Page\x20update\x20did\x20not\x20create\x20a\x20new\x20version.','1220940NFjyaA','754104RhAeXi','number','appcode','80341jeMMVx','page\x20custom-update\x20no\x20longer\x20accepts\x20--page-content.','Would\x20save\x20all\x20files\x20of\x20Custom\x20Page\x20','pageContent','isInteger','page-content','custom-update','newVersion','827470ArJSgc','Write\x20the\x20complete\x20page\x20files\x20to\x20a\x20local\x20directory\x20and\x20use\x20--page-dir\x20<dir>.','trim','string','Updated\x20Custom\x20Page\x20','3299584ZWDCcl','94641duFQYA','4ZIfaMx','str','pageId','appCode','Cannot\x20determine\x20the\x20appCode\x20for\x20Custom\x20Page\x20','792140SXfDRQ','apiError','cookie','compress','page-dir','POST','validation'];a167_0x4a4b=function(){return _0x5f0ae3;};return a167_0x4a4b();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a168_0x5b7f(_0x1e03dc,_0x554fc9){_0x1e03dc=_0x1e03dc-0x1f3;const _0x1e0372=a168_0x1e03();let _0x5b7f6e=_0x1e0372[_0x1e03dc];return _0x5b7f6e;}const a168_0x3b946c=a168_0x5b7f;function a168_0x1e03(){const _0x594c54=['45755hSzhqL','appCode','string','manualResolutionRequired','alias','201692YpwvMP','status','5841tUdOsz','compress','data-list-status','210483MZyqlZ','relatedPages','203000gZVphr','12jfPzFV','read','10133820UAiEpj','/smartapi/lovrabet/dataset/','page','code','396312CiFlcM','2312zPNSpm','source','length','132RYntNK','query-data-list-status','nextAction'];a168_0x1e03=function(){return _0x594c54;};return a168_0x1e03();}(function(_0x4892b8,_0x7ccd4f){const _0x54e5f4=a168_0x5b7f,_0x356455=_0x4892b8();while(!![]){try{const _0x20e7d2=-parseInt(_0x54e5f4(0x1f8))/0x1+-parseInt(_0x54e5f4(0x1ff))/0x2+-parseInt(_0x54e5f4(0x1fd))/0x3*(parseInt(_0x54e5f4(0x200))/0x4)+-parseInt(_0x54e5f4(0x1f3))/0x5*(parseInt(_0x54e5f4(0x20a))/0x6)+parseInt(_0x54e5f4(0x206))/0x7+-parseInt(_0x54e5f4(0x207))/0x8*(parseInt(_0x54e5f4(0x1fa))/0x9)+parseInt(_0x54e5f4(0x202))/0xa;if(_0x20e7d2===_0x7ccd4f)break;else _0x356455['push'](_0x356455['shift']());}catch(_0x5bb00b){_0x356455['push'](_0x356455['shift']());}}}(a168_0x1e03,0x28e10));import{APPCODE_FLAG_OPTIONAL,DATASETCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{assessDataListPageState,getUndeletedRelatedPages,loadDatasetDetailForPage,loadDataListPageStatusForGenerate,serializeDryRunDescription,validateDatasetSelector}from'../../commands/page/shared.js';export const pageDataListStatus={'service':a168_0x3b946c(0x204),'command':a168_0x3b946c(0x1fc),'description':'Query\x20Data\x20List\x20Page\x20facts\x20for\x20a\x20dataset','risk':a168_0x3b946c(0x201),'defaultOutputFormat':a168_0x3b946c(0x1fb),'flags':[APPCODE_FLAG_OPTIONAL,DATASETCODE_FLAG_OPTIONAL,{'name':a168_0x3b946c(0x1f7),'type':a168_0x3b946c(0x1f5),'description':'Dataset\x20alias\x20from\x20api.ts\x20(resolves\x20to\x20dataset\x20code\x20automatically)'}],async 'validate'(_0x55ff6f){validateDatasetSelector(_0x55ff6f);},async 'dryRun'(_0x41606a){const _0x2a34dc=a168_0x3b946c,_0x3ab43c=await loadDatasetDetailForPage(_0x41606a);return{'method':'GET','url':_0x2a34dc(0x203)+_0x3ab43c['code']+'/standard-page-status?appCode='+encodeURIComponent(_0x41606a[_0x2a34dc(0x1f4)]),'description':serializeDryRunDescription({'dataset':{'id':_0x3ab43c['id'],'code':_0x3ab43c[_0x2a34dc(0x205)],'name':_0x3ab43c['name']},'action':_0x2a34dc(0x20b)})};},async 'execute'(_0x1b941e){const _0x2aa820=a168_0x3b946c,_0x3d205b=await loadDatasetDetailForPage(_0x1b941e),_0x11be33=await loadDataListPageStatusForGenerate(_0x1b941e,_0x3d205b[_0x2aa820(0x205)]),_0xbcdb3b=getUndeletedRelatedPages(_0x3d205b),_0x59833d=assessDataListPageState(_0x3d205b[_0x2aa820(0x205)],_0x11be33,{'fallbackUndeletedPages':_0xbcdb3b});return{'ok':!![],'data':{'datasetCode':_0x3d205b[_0x2aa820(0x205)],'precheckSource':_0x11be33?.[_0x2aa820(0x208)]??'related-pages-fallback','status':_0x59833d[_0x2aa820(0x1f9)],'manualResolutionRequired':_0x59833d[_0x2aa820(0x1f6)],'nextAction':_0x59833d[_0x2aa820(0x20c)],'dataListPageStatus':_0x11be33,'relatedPages':{'total':_0x3d205b[_0x2aa820(0x1fe)][_0x2aa820(0x209)],'undeletedCount':_0xbcdb3b[_0x2aa820(0x209)]}}};}};
|