@lovrabet/rabetbase-cli 2.5.5 → 2.5.6
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 +15 -1
- package/lib/api/api-doc.js +1 -1
- package/lib/api/api-group.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/api/legacy-api-file.js +1 -1
- package/lib/api/model-registry-file.js +1 -1
- package/lib/api/model-registry-scaffold.js +1 -1
- package/lib/api/model-source.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/detail.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/logs.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/batch-design.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/cross-relation-create.js +1 -1
- package/lib/commands/dataset/cross-relation-delete.js +1 -1
- package/lib/commands/dataset/cross-relation-list.js +1 -1
- package/lib/commands/dataset/cross-relation-shared.js +1 -1
- package/lib/commands/dataset/cross-relation-update.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/design-context.d.ts +1 -0
- package/lib/commands/dataset/design-context.js +1 -0
- package/lib/commands/dataset/design-start.d.ts +1 -0
- package/lib/commands/dataset/design-start.js +1 -0
- package/lib/commands/dataset/design-status.d.ts +1 -0
- package/lib/commands/dataset/design-status.js +1 -0
- package/lib/commands/dataset/design-sync-retry.d.ts +1 -0
- package/lib/commands/dataset/design-sync-retry.js +1 -0
- package/lib/commands/dataset/design-sync-status.d.ts +1 -0
- package/lib/commands/dataset/design-sync-status.js +1 -0
- package/lib/commands/dataset/design-validate.d.ts +1 -0
- package/lib/commands/dataset/design-validate.js +1 -0
- 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/cross-db-analysis-shared.d.ts +40 -0
- package/lib/commands/db/cross-db-analysis-shared.js +1 -0
- package/lib/commands/db/cross-db-analyze-latest.d.ts +2 -0
- package/lib/commands/db/cross-db-analyze-latest.js +1 -0
- package/lib/commands/db/cross-db-analyze-start.d.ts +2 -0
- package/lib/commands/db/cross-db-analyze-start.js +1 -0
- package/lib/commands/db/cross-db-analyze-status.d.ts +2 -0
- package/lib/commands/db/cross-db-analyze-status.js +1 -0
- 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/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/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/flow/create.js +1 -1
- package/lib/commands/flow/detail.js +1 -1
- package/lib/commands/flow/index.js +1 -1
- package/lib/commands/flow/list.js +1 -1
- package/lib/commands/flow/publish.js +1 -1
- package/lib/commands/flow/runtime-resources-shared.js +1 -1
- package/lib/commands/flow/runtime-role-list.js +1 -1
- package/lib/commands/flow/runtime-role-user-list.js +1 -1
- package/lib/commands/flow/runtime-user-search.js +1 -1
- package/lib/commands/flow/shared.js +1 -1
- package/lib/commands/flow/update.js +1 -1
- package/lib/commands/flow/validate.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/path.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/subapp-assets.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/subapp-assets-status.js +1 -1
- package/lib/commands/menu/subapp-assets-update.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.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/api-architecture-upgrade.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.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/feishu-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.js +1 -1
- package/lib/config/project-domain-routing.js +1 -1
- package/lib/config/region-config.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 +18 -0
- 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/hook-directory.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/cross-db-analysis.d.ts +17 -0
- package/lib/core/cross-db-analysis.js +1 -0
- package/lib/core/cross-db-relation.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/flow-config.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.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/page/lr-smart-jsx.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.js +1 -1
- 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/services/dataset-design/checkpoint.d.ts +17 -0
- package/lib/services/dataset-design/checkpoint.js +1 -0
- package/lib/services/dataset-design/commands.d.ts +6 -0
- package/lib/services/dataset-design/commands.js +1 -0
- package/lib/services/dataset-design/contract.d.ts +7 -0
- package/lib/services/dataset-design/contract.js +1 -0
- 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 +3 -2
- package/skills/rabetbase/SKILL.md +9 -7
- package/skills/rabetbase/guides/database-connection-workflow.md +12 -3
- package/skills/rabetbase/guides/independent-deployment.md +10 -2
- package/skills/rabetbase/references/rabetbase-dataset-cross-relations.md +2 -0
- package/skills/rabetbase/references/rabetbase-dataset-design.md +25 -0
- package/skills/rabetbase/references/rabetbase-dataset-generate.md +2 -255
- package/skills/rabetbase/references/rabetbase-db-analyze.md +2 -0
- package/skills/rabetbase/references/rabetbase-db-cross-analyze.md +78 -0
- package/skills/rabetbase-dataset-generation/SKILL.md +45 -0
- package/skills/rabetbase-dataset-generation/references/workflow.md +60 -0
- package/skills/rabetbase-page-generation/SKILL.md +1 -1
- package/skills/rabetbase.manifest.json +5 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a149_0x4dc7da=a149_0x5e78;(function(_0xfceddf,_0x53992c){const _0x57e396=a149_0x5e78,_0x1eb3c3=_0xfceddf();while(!![]){try{const _0x37eb7d=-parseInt(_0x57e396(0xa5))/0x1+parseInt(_0x57e396(0xa3))/0x2+-parseInt(_0x57e396(0xa2))/0x3+parseInt(_0x57e396(0x9a))/0x4*(-parseInt(_0x57e396(0xa9))/0x5)+parseInt(_0x57e396(0x9f))/0x6*(-parseInt(_0x57e396(0xac))/0x7)+-parseInt(_0x57e396(0xad))/0x8*(parseInt(_0x57e396(0x9d))/0x9)+parseInt(_0x57e396(0xb2))/0xa;if(_0x37eb7d===_0x53992c)break;else _0x1eb3c3['push'](_0x1eb3c3['shift']());}catch(_0x117566){_0x1eb3c3['push'](_0x1eb3c3['shift']());}}}(a149_0x32e0,0xaa850));import{CliError}from'../../errors.js';function a149_0x5e78(_0x1a6bb5,_0x32afd9){_0x1a6bb5=_0x1a6bb5-0x96;const _0x32e0cf=a149_0x32e0();let _0x5e7819=_0x32e0cf[_0x1a6bb5];return _0x5e7819;}import{CLI_BIN_NAME}from'../../constant/cli.js';export const NUDGE_OPT_OUT_ENV='RABETBASE_DISABLE_ISSUE_NUDGE';const NUDGE_SUPPRESSED_CODES=new Set([a149_0x4dc7da(0xa1),'auth_required',a149_0x4dc7da(0xb1),a149_0x4dc7da(0x97),a149_0x4dc7da(0xa7),a149_0x4dc7da(0xa4),'validation_error','network_error']),defaultWriter=_0xd638e1=>{const _0x85dd27=a149_0x4dc7da;process[_0x85dd27(0xb0)][_0x85dd27(0x99)](_0xd638e1);};export function shouldNudgeForError(_0x2d4a87,_0x80391b){const _0x4d9d42=a149_0x4dc7da;if(process.env[NUDGE_OPT_OUT_ENV]==='1')return![];if(_0x80391b[_0x4d9d42(0xb6)]===_0x4d9d42(0xa6)&&_0x80391b[_0x4d9d42(0xb5)]===_0x4d9d42(0xb3))return![];if(_0x2d4a87 instanceof CliError)return!NUDGE_SUPPRESSED_CODES['has'](_0x2d4a87[_0x4d9d42(0x9c)]);return!![];}function a149_0x32e0(){const _0x346eab=['flag_missing','576655ZrzWcs','issue','unknown_command','\x20\x20\x20\x20--description\x20\x22Steps\x20to\x20reproduce,\x20expected\x20vs\x20actual,\x20and\x20any\x20relevant\x20logs.\x22','785tGwsUX','\x22\x20\x5c','join','7EISmDj','5571640PFuZpY','\x20issue\x20report\x20\x5c','\x20bug?\x20Help\x20us\x20fix\x20it:','stderr','config_missing','31703240PIenHq','report','\x20\x20\x20\x20--title\x20\x22','command','service','Hit\x20a\x20','not_in_project','replace','write','24588NfkNXl','slice','code','9upAuKc','trim','996702RtooCn','message','cancelled','845004vcSOTr','428196DLfBrm'];a149_0x32e0=function(){return _0x346eab;};return a149_0x32e0();}export function printIssueReportNudgeForError(_0x38f8e6,_0x1d16df,_0x67d9d9=defaultWriter){if(!shouldNudgeForError(_0x38f8e6,_0x1d16df))return;const _0x6706da=buildSuggestedTitle(_0x38f8e6,_0x1d16df);_0x67d9d9(formatNudge(_0x6706da));}function buildSuggestedTitle(_0x2339d9,_0x218861){const _0x4e4109=a149_0x4dc7da,_0x575897=_0x2339d9 instanceof Error?_0x2339d9[_0x4e4109(0xa0)]:String(_0x2339d9),_0x265e95=_0x575897[_0x4e4109(0x98)](/[\r\n]+/g,'\x20')['replace'](/\s+/g,'\x20')[_0x4e4109(0x9e)]()[_0x4e4109(0x9b)](0x0,0x78)[_0x4e4109(0x98)](/"/g,'\x5c\x22'),_0xb46c1c=CLI_BIN_NAME+'\x20'+_0x218861[_0x4e4109(0xb6)]+'\x20'+_0x218861[_0x4e4109(0xb5)];return _0x265e95['length']>0x0?_0xb46c1c+':\x20'+_0x265e95:_0xb46c1c;}function formatNudge(_0x339b1c){const _0x28fccf=a149_0x4dc7da;return['',_0x28fccf(0x96)+CLI_BIN_NAME+_0x28fccf(0xaf),'\x20\x20'+CLI_BIN_NAME+_0x28fccf(0xae),_0x28fccf(0xb4)+_0x339b1c+_0x28fccf(0xaa),_0x28fccf(0xa8),'\x20\x20(Cookies\x20/\x20Authorization\x20/\x20access\x20keys\x20are\x20automatically\x20redacted\x20before\x20upload.)','\x20\x20Set\x20'+NUDGE_OPT_OUT_ENV+'=1\x20to\x20silence\x20this\x20hint.',''][_0x28fccf(0xab)]('\x0a');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a150_0x4ce121=a150_0x3ecc;function a150_0x3ecc(_0x137827,_0x1bc117){_0x137827=_0x137827-0x196;const _0x3ab337=a150_0x3ab3();let _0x3ecc0b=_0x3ab337[_0x137827];return _0x3ecc0b;}function a150_0x3ab3(){const _0x17f026=['\x20bytes','trim','issue.title','redactionKinds','redactions:\x20','descriptionSource:\x20','2946eZyFXN','Send\x20platform\x20issue\x20collect\x20log\x20via\x20the\x20CLI\x20telemetry\x20adapter','otel://','6cAstLL','flagMissing','Path\x20to\x20a\x20markdown\x20file\x20whose\x20contents\x20become\x20issue.description','7204880Yapbzl','file','2460uPqFps','utf8','Failed\x20to\x20report\x20platform\x20issue:\x20','truncated\x20from\x20','Check\x20telemetry\x20configuration\x20and\x20network\x20reachability,\x20then\x20retry.','Issue\x20description\x20file\x20is\x20empty:\x20','\x20secret(s):\x20','originalBytes','redacted\x20','Provide\x20--title\x20with\x20a\x20one-line\x20issue\x20summary.','Platform\x20issue\x20reported','validation','2059534QKroqD','issue.description_original_bytes','issue.description_redaction_kinds','issue','title','str','description','3147055PPTGOW','compress','Provide\x20non-empty\x20markdown\x20content\x20via\x20--description\x20or\x20--description-file.','descriptionSource','974337EzTVqg','issue.description','One-line\x20issue\x20summary','apiError','sanitize','Platform\x20issue\x20reported\x20(','19683OxiwPy','cwd','redactionCount','File\x20not\x20found:\x20','descriptionFilePath','Report\x20a\x20platform\x20issue\x20with\x20title\x20and\x20markdown\x20context','description-file','write','POST','Issue\x20description\x20cannot\x20be\x20empty.','string','push','filter','Use\x20--description\x20for\x20short\x20markdown\x20text,\x20or\x20--description-file\x20for\x20full\x20issue\x20context.','Inline\x20markdown\x20issue\x20description\x20(alternative\x20to\x20--description-file)','length','message','report','join','1670jtosNj','9022139lkfNEw','truncated','issue.description_truncated'];a150_0x3ab3=function(){return _0x17f026;};return a150_0x3ab3();}(function(_0x13448e,_0x36b87d){const _0x5539fc=a150_0x3ecc,_0x5ef932=_0x13448e();while(!![]){try{const _0x56494c=parseInt(_0x5539fc(0x1a7))/0x1+-parseInt(_0x5539fc(0x19c))/0x2+parseInt(_0x5539fc(0x1ca))/0x3*(parseInt(_0x5539fc(0x1d2))/0x4)+parseInt(_0x5539fc(0x1a3))/0x5*(-parseInt(_0x5539fc(0x1cd))/0x6)+parseInt(_0x5539fc(0x1c1))/0x7+-parseInt(_0x5539fc(0x1d0))/0x8+parseInt(_0x5539fc(0x1ad))/0x9*(parseInt(_0x5539fc(0x1c0))/0xa);if(_0x56494c===_0x36b87d)break;else _0x5ef932['push'](_0x5ef932['shift']());}catch(_0x1c156){_0x5ef932['push'](_0x5ef932['shift']());}}}(a150_0x3ab3,0xa4349));import{existsSync}from'node:fs';import{readFile}from'node:fs/promises';import{resolve}from'node:path';import{CliErrors}from'../../errors.js';import{sanitizeIssueDescription}from'../../commands/issue/shared.js';import{PLATFORM_ISSUE_SPAN_NAME,PLATFORM_ISSUE_TRACE_NAME,sendPlatformIssueCollectLog}from'../../telemetry/send-platform-issue-collect-log.js';const DESCRIPTION_FILE_FLAG=a150_0x4ce121(0x1b3);export const issueReport={'service':a150_0x4ce121(0x19f),'command':a150_0x4ce121(0x1be),'description':a150_0x4ce121(0x1b2),'risk':a150_0x4ce121(0x1b4),'requiresAuth':!![],'requiresAppCode':![],'defaultOutputFormat':a150_0x4ce121(0x1a4),'flags':[{'name':'title','type':'string','required':!![],'description':a150_0x4ce121(0x1a9)},{'name':a150_0x4ce121(0x1a2),'type':a150_0x4ce121(0x1b7),'description':a150_0x4ce121(0x1bb)},{'name':DESCRIPTION_FILE_FLAG,'type':'string','description':a150_0x4ce121(0x1cf)}],async 'validate'(_0x1f57e0){const _0x1e6559=a150_0x4ce121,_0x178265=_0x1f57e0[_0x1e6559(0x1a1)](_0x1e6559(0x1a0))[_0x1e6559(0x1c5)](),_0x2db77e=_0x1f57e0[_0x1e6559(0x1a1)](_0x1e6559(0x1a2))[_0x1e6559(0x1c5)](),_0x18d3db=_0x1f57e0[_0x1e6559(0x1a1)](DESCRIPTION_FILE_FLAG)[_0x1e6559(0x1c5)]();if(!_0x178265)throw CliErrors[_0x1e6559(0x1ce)](_0x1e6559(0x1a0),_0x1e6559(0x199));const _0x156650=_0x2db77e['length']>0x0,_0x285ec8=_0x18d3db[_0x1e6559(0x1bc)]>0x0;if(_0x156650===_0x285ec8)throw CliErrors['validation']('Provide\x20exactly\x20one\x20of\x20--description\x20or\x20--description-file.',_0x1e6559(0x1ba));if(_0x285ec8){const _0x244852=resolve(process[_0x1e6559(0x1ae)](),_0x18d3db);if(!existsSync(_0x244852))throw CliErrors['validation'](_0x1e6559(0x1b0)+_0x244852);}},async 'dryRun'(_0x482ac6){const _0x35f2f1=a150_0x4ce121,_0x3430f9=await prepareIssueReport(_0x482ac6);return{'method':_0x35f2f1(0x1b5),'url':_0x35f2f1(0x1cc)+PLATFORM_ISSUE_TRACE_NAME+'/'+PLATFORM_ISSUE_SPAN_NAME,'body':{'traceName':PLATFORM_ISSUE_TRACE_NAME,'spanName':PLATFORM_ISSUE_SPAN_NAME,'logData':{'issue.title':_0x3430f9[_0x35f2f1(0x1a0)],'issue.description':_0x3430f9[_0x35f2f1(0x1a2)],'issue.description_original_bytes':_0x3430f9[_0x35f2f1(0x1ab)][_0x35f2f1(0x197)],'issue.description_truncated':_0x3430f9['sanitize']['truncated'],'issue.description_redactions':_0x3430f9[_0x35f2f1(0x1ab)]['redactionCount'],'issue.description_redaction_kinds':_0x3430f9[_0x35f2f1(0x1ab)][_0x35f2f1(0x1c7)]['join'](',')}},'description':[_0x35f2f1(0x1cb),_0x35f2f1(0x1c9)+_0x3430f9['descriptionSource'],_0x3430f9[_0x35f2f1(0x1b1)]?'descriptionFile:\x20'+_0x3430f9[_0x35f2f1(0x1b1)]:null,_0x3430f9[_0x35f2f1(0x1ab)][_0x35f2f1(0x1c2)]?'truncated:\x20original\x20'+_0x3430f9[_0x35f2f1(0x1ab)][_0x35f2f1(0x197)]+_0x35f2f1(0x1c4):null,_0x3430f9[_0x35f2f1(0x1ab)][_0x35f2f1(0x1af)]>0x0?_0x35f2f1(0x1c8)+_0x3430f9[_0x35f2f1(0x1ab)][_0x35f2f1(0x1af)]+'\x20('+_0x3430f9[_0x35f2f1(0x1ab)][_0x35f2f1(0x1c7)]['join'](',\x20')+')':null][_0x35f2f1(0x1b9)](Boolean)[_0x35f2f1(0x1bf)]('\x0a')};},async 'execute'(_0x7abb65){const _0x46bb64=a150_0x4ce121,_0x5569f4=await prepareIssueReport(_0x7abb65);try{await sendPlatformIssueCollectLog({'title':_0x5569f4[_0x46bb64(0x1a0)],'description':_0x5569f4[_0x46bb64(0x1a2)],'sanitize':{'originalBytes':_0x5569f4[_0x46bb64(0x1ab)][_0x46bb64(0x197)],'truncated':_0x5569f4['sanitize'][_0x46bb64(0x1c2)],'redactionCount':_0x5569f4['sanitize']['redactionCount'],'redactionKinds':_0x5569f4[_0x46bb64(0x1ab)][_0x46bb64(0x1c7)]}});}catch(_0x32e39a){throw CliErrors[_0x46bb64(0x1aa)](_0x46bb64(0x1d4)+(_0x32e39a instanceof Error?_0x32e39a[_0x46bb64(0x1bd)]:String(_0x32e39a)),_0x46bb64(0x1d6));}return{'ok':!![],'message':buildResultMessage(_0x5569f4[_0x46bb64(0x1ab)]),'data':{'traceName':PLATFORM_ISSUE_TRACE_NAME,'spanName':PLATFORM_ISSUE_SPAN_NAME,'logDataKeys':[_0x46bb64(0x1c6),_0x46bb64(0x1a8),_0x46bb64(0x19d),_0x46bb64(0x1c3),'issue.description_redactions',_0x46bb64(0x19e)],'issue':{'title':_0x5569f4[_0x46bb64(0x1a0)],'descriptionLength':_0x5569f4['description'][_0x46bb64(0x1bc)],'descriptionSource':_0x5569f4[_0x46bb64(0x1a6)],..._0x5569f4[_0x46bb64(0x1b1)]?{'descriptionFile':_0x5569f4[_0x46bb64(0x1b1)]}:{},'sanitize':{'originalBytes':_0x5569f4[_0x46bb64(0x1ab)][_0x46bb64(0x197)],'truncated':_0x5569f4[_0x46bb64(0x1ab)][_0x46bb64(0x1c2)],'redactions':_0x5569f4[_0x46bb64(0x1ab)]['redactionCount'],'redactionKinds':_0x5569f4['sanitize'][_0x46bb64(0x1c7)]}}}};}};function buildResultMessage(_0x421072){const _0x1be7a1=a150_0x4ce121,_0x2cd400=[];return _0x421072['truncated']&&_0x2cd400['push'](_0x1be7a1(0x1d5)+_0x421072[_0x1be7a1(0x197)]+_0x1be7a1(0x1c4)),_0x421072[_0x1be7a1(0x1af)]>0x0&&_0x2cd400[_0x1be7a1(0x1b8)](_0x1be7a1(0x198)+_0x421072[_0x1be7a1(0x1af)]+_0x1be7a1(0x196)+_0x421072['redactionKinds'][_0x1be7a1(0x1bf)](',\x20')),_0x2cd400[_0x1be7a1(0x1bc)]===0x0?_0x1be7a1(0x19a):_0x1be7a1(0x1ac)+_0x2cd400['join'](';\x20')+')';}async function prepareIssueReport(_0x29b47f){const _0x16b73e=a150_0x4ce121,_0x1c3283=_0x29b47f['str'](_0x16b73e(0x1a0))[_0x16b73e(0x1c5)](),_0x3a34e2=_0x29b47f[_0x16b73e(0x1a1)](_0x16b73e(0x1a2)),_0x13e9c4=_0x29b47f['str'](DESCRIPTION_FILE_FLAG)[_0x16b73e(0x1c5)]();if(!_0x13e9c4){const _0x47b675=_0x3a34e2;if(!_0x47b675[_0x16b73e(0x1c5)]())throw CliErrors[_0x16b73e(0x19b)](_0x16b73e(0x1b6),_0x16b73e(0x1a5));const _0x10079a=sanitizeIssueDescription(_0x47b675);return{'title':_0x1c3283,'description':_0x10079a[_0x16b73e(0x1a2)],'descriptionSource':'inline','sanitize':_0x10079a};}const _0x4db6f0=resolve(process[_0x16b73e(0x1ae)](),_0x13e9c4),_0xbd3c42=await readFile(_0x4db6f0,_0x16b73e(0x1d3));if(!_0xbd3c42[_0x16b73e(0x1c5)]())throw CliErrors['validation'](_0x16b73e(0x1d7)+_0x4db6f0,'Write\x20markdown\x20context\x20into\x20the\x20file\x20before\x20retrying.');const _0x1d0af3=sanitizeIssueDescription(_0xbd3c42);return{'title':_0x1c3283,'description':_0x1d0af3[_0x16b73e(0x1a2)],'descriptionSource':_0x16b73e(0x1d1),'descriptionFilePath':_0x4db6f0,'sanitize':_0x1d0af3};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a151_0x863522=a151_0x1248;(function(_0x53a367,_0x5ba1ad){const _0x64a82f=a151_0x1248,_0x1738e1=_0x53a367();while(!![]){try{const _0x54efcc=-parseInt(_0x64a82f(0x18e))/0x1*(parseInt(_0x64a82f(0x186))/0x2)+parseInt(_0x64a82f(0x17e))/0x3*(-parseInt(_0x64a82f(0x178))/0x4)+-parseInt(_0x64a82f(0x17b))/0x5*(parseInt(_0x64a82f(0x18a))/0x6)+parseInt(_0x64a82f(0x194))/0x7+parseInt(_0x64a82f(0x192))/0x8*(parseInt(_0x64a82f(0x184))/0x9)+parseInt(_0x64a82f(0x17a))/0xa+parseInt(_0x64a82f(0x177))/0xb;if(_0x54efcc===_0x5ba1ad)break;else _0x1738e1['push'](_0x1738e1['shift']());}catch(_0x49a1c5){_0x1738e1['push'](_0x1738e1['shift']());}}}(a151_0x5810,0xcb6a8));function a151_0x5810(){const _0x44692b=['16GvSFDl','cookie','1806644yKbsnB','REDACTED:password','kind','REDACTED:private-key','14801204mdXWkO','4431044xFXEcA','byteLength','14715470qtizdP','1984825ZcFIWb','push','private-key','3kVqygU','REDACTED:authorization','access-key','toString','subarray','max','1757709IRMCct','password','17762YxKOQC','authorization','slice','__RB_OSS_ID_','6fxbAez','REDACTED:access-key','restore','includes','127avDRgL','REDACTED:bearer-jwt','replace','utf8'];a151_0x5810=function(){return _0x44692b;};return a151_0x5810();}export const ISSUE_DESCRIPTION_MAX_BYTES=0x100*0x400;const TRUNCATION_NOTICE='\x0a\x0a[...TRUNCATED\x20by\x20rabetbase-cli...]',REDACTION_RULES=[{'kind':a151_0x863522(0x193),'pattern':/(cookie\s*[:=]\s*)[^\s;,'"`]+/gi,'label':'REDACTED:cookie'},{'kind':a151_0x863522(0x187),'pattern':/(authorization\s*:\s*)(bearer|basic|token)\s+[^\s'"`]+/gi,'label':a151_0x863522(0x17f)},{'kind':a151_0x863522(0x17d),'pattern':/-----BEGIN [A-Z0-9 ]*PRIVATE KEY-----[\s\S]*?-----END [A-Z0-9 ]*PRIVATE KEY-----/g,'label':a151_0x863522(0x176)},{'kind':a151_0x863522(0x180),'pattern':/((?:aliyun_)?(?:access|secret)[_-]?key(?:[_-]?id)?\s*[:=]\s*)['"]?[A-Za-z0-9/+_\-]{8,}['"]?/gi,'label':a151_0x863522(0x18b)},{'kind':a151_0x863522(0x185),'pattern':/(pass(?:word|wd)\s*[:=]\s*)['"]?[^\s'"`]+['"]?/gi,'label':a151_0x863522(0x195)},{'kind':'bearer-jwt','pattern':/\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\b/g,'label':a151_0x863522(0x18f)}];export function sanitizeIssueDescription(_0x31a623){const _0x3a66ed=a151_0x863522,_0x2eeea3=Buffer['byteLength'](_0x31a623,_0x3a66ed(0x191)),_0x59b8fc=process.env.RABETBASE_ISSUE_RAW_DESCRIPTION==='1';let _0x3c56f0=_0x31a623,_0x1e778b=0x0;const _0x1ee5bd=[];if(!_0x59b8fc){const _0x1f6919=protectOssAccessKeyIds(_0x3c56f0);_0x3c56f0=_0x1f6919['description'];for(const _0x2f7400 of REDACTION_RULES){let _0x57f95a=0x0;_0x3c56f0=_0x3c56f0[_0x3a66ed(0x190)](_0x2f7400['pattern'],(_0x53afbf,_0x2f6a5c)=>{_0x57f95a+=0x1;const _0x23fb1e=typeof _0x2f6a5c==='string'?_0x2f6a5c:'';return _0x23fb1e+'['+_0x2f7400['label']+']';}),_0x57f95a>0x0&&(_0x1e778b+=_0x57f95a,!_0x1ee5bd[_0x3a66ed(0x18d)](_0x2f7400[_0x3a66ed(0x175)])&&_0x1ee5bd[_0x3a66ed(0x17c)](_0x2f7400['kind']));}_0x3c56f0=_0x1f6919[_0x3a66ed(0x18c)](_0x3c56f0);}let _0x51183d=![];if(Buffer[_0x3a66ed(0x179)](_0x3c56f0,'utf8')>ISSUE_DESCRIPTION_MAX_BYTES){_0x51183d=!![];const _0x95c56c=Buffer[_0x3a66ed(0x179)](TRUNCATION_NOTICE,_0x3a66ed(0x191)),_0x2110b=Math[_0x3a66ed(0x183)](0x0,ISSUE_DESCRIPTION_MAX_BYTES-_0x95c56c);_0x3c56f0=sliceUtf8Bytes(_0x3c56f0,_0x2110b)+TRUNCATION_NOTICE;}return{'description':_0x3c56f0,'originalBytes':_0x2eeea3,'truncated':_0x51183d,'redactionCount':_0x1e778b,'redactionKinds':_0x1ee5bd};}function protectOssAccessKeyIds(_0x2b4395){const _0x19fe2e=a151_0x863522,_0x3a6b22=[],_0x1c1f2b=_0x2b4395[_0x19fe2e(0x190)](/([?&])OSSAccessKeyId=([A-Za-z0-9/+_\-]{8,})/gi,(_0x2e2475,_0x548b0b)=>{const _0x3b6671=_0x19fe2e,_0x1db355=_0x3a6b22[_0x3b6671(0x17c)](_0x2e2475[_0x3b6671(0x188)](_0x548b0b['length']))-0x1;return _0x548b0b+_0x3b6671(0x189)+_0x1db355+'__';});return{'description':_0x1c1f2b,'restore':_0x48ca19=>_0x48ca19[_0x19fe2e(0x190)](/([?&])__RB_OSS_ID_(\d+)__/g,(_0x5c914f,_0x1fe248,_0xaba703)=>{const _0x370ba4=_0x3a6b22[Number(_0xaba703)];return _0x370ba4===undefined?_0x5c914f:''+_0x1fe248+_0x370ba4;})};}function a151_0x1248(_0x364496,_0x11820f){_0x364496=_0x364496-0x175;const _0x5810d0=a151_0x5810();let _0x124847=_0x5810d0[_0x364496];return _0x124847;}function sliceUtf8Bytes(_0x59c210,_0x33551d){const _0x486564=a151_0x863522;if(_0x33551d<=0x0)return'';const _0x45cf96=Buffer['from'](_0x59c210,_0x486564(0x191));if(_0x45cf96['byteLength']<=_0x33551d)return _0x59c210;let _0x19a7bd=_0x33551d;while(_0x19a7bd>0x0){const _0x8b397e=_0x45cf96[_0x19a7bd];if(_0x8b397e===undefined||(_0x8b397e&0xc0)!==0x80)break;_0x19a7bd-=0x1;}return _0x45cf96[_0x486564(0x182)](0x0,_0x19a7bd)[_0x486564(0x181)](_0x486564(0x191));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a152_0x516741=a152_0x236e;(function(_0x36f8cc,_0x5ec2fc){const _0xbda8d6=a152_0x236e,_0x420821=_0x36f8cc();while(!![]){try{const _0x34420d=-parseInt(_0xbda8d6(0x20a))/0x1+parseInt(_0xbda8d6(0x208))/0x2*(parseInt(_0xbda8d6(0x214))/0x3)+-parseInt(_0xbda8d6(0x21b))/0x4*(-parseInt(_0xbda8d6(0x1ff))/0x5)+parseInt(_0xbda8d6(0x1f4))/0x6+-parseInt(_0xbda8d6(0x1f9))/0x7+parseInt(_0xbda8d6(0x204))/0x8+parseInt(_0xbda8d6(0x1f5))/0x9;if(_0x34420d===_0x5ec2fc)break;else _0x420821['push'](_0x420821['shift']());}catch(_0x5df023){_0x420821['push'](_0x420821['shift']());}}}(a152_0x5188,0x4fdc9));import{createEnterpriseKnowledgeBase,isPlatformTransportFailure}from'../../core/api-client.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCompanyKnowledgeBase,fetchAllCompanyKnowledgeBases,findExactCompanyKnowledgeBases,inspectKbContent,kbError,projectKb,readKbFile,requireKb,verifyKbMutationReadback}from'../../commands/kb/shared.js';const CREATE_PATH=a152_0x516741(0x216);function readCreateInput(_0x34a62d){const _0x35183f=a152_0x516741,_0x25c6f7=_0x34a62d[_0x35183f(0x218)](_0x35183f(0x21a))['trim']();if(!_0x25c6f7)throw kbError(_0x35183f(0x201),'--title\x20is\x20required.');const _0x4d3ff7=_0x34a62d[_0x35183f(0x218)](_0x35183f(0x207))[_0x35183f(0x21c)]();if(!_0x4d3ff7)throw kbError(_0x35183f(0x1fd),_0x35183f(0x1fe),_0x35183f(0x203));return{'title':_0x25c6f7,'file':_0x4d3ff7};}function a152_0x236e(_0x5f0a5b,_0x439bcb){_0x5f0a5b=_0x5f0a5b-0x1f0;const _0x51882b=a152_0x5188();let _0x236e39=_0x51882b[_0x5f0a5b];return _0x236e39;}async function prepareCreate(_0x26936d){const _0x26f40f=a152_0x516741,_0x48a536=readCreateInput(_0x26936d),_0x275bdf=await readKbFile(_0x48a536[_0x26f40f(0x207)]),_0x3ff305=await fetchAllCompanyKnowledgeBases(_0x26936d,{'title':_0x48a536[_0x26f40f(0x21a)]}),_0x37a56d=findExactCompanyKnowledgeBases(_0x3ff305,_0x26936d[_0x26f40f(0x210)],_0x48a536['title']);if(_0x37a56d[_0x26f40f(0x209)]>0x0)throw kbError(_0x26f40f(0x202),_0x26f40f(0x1f2)+_0x26936d[_0x26f40f(0x210)]+_0x26f40f(0x219)+_0x48a536[_0x26f40f(0x21a)]+'.',_0x26f40f(0x1f7)+_0x37a56d[0x0]['id']+_0x26f40f(0x20b));return{..._0x48a536,'content':_0x275bdf};}function plannedAfter(_0x518517,_0xd2f52){const _0x4f4612=a152_0x516741;return{'scope':'company','appCode':_0x518517[_0x4f4612(0x210)],'title':_0xd2f52[_0x4f4612(0x21a)],'contentByteSize':_0xd2f52['content']['byteSize'],'contentHash':_0xd2f52[_0x4f4612(0x1f3)][_0x4f4612(0x20e)]};}function verifyCreatedState(_0x16d7fb,_0x285473,_0x5f319b){const _0x1004a5=a152_0x516741;assertCompanyKnowledgeBase(_0x5f319b,_0x16d7fb[_0x1004a5(0x210)],_0x5f319b['id']);const _0x3b8d6d=inspectKbContent(_0x5f319b['content']);if(_0x5f319b['title']!==_0x285473[_0x1004a5(0x21a)]||_0x3b8d6d['contentHash']!==_0x285473[_0x1004a5(0x1f3)][_0x1004a5(0x20e)])throw kbError(_0x1004a5(0x1fb),'Company\x20knowledge\x20base\x20'+_0x5f319b['id']+'\x20does\x20not\x20match\x20the\x20requested\x20create\x20state.',_0x1004a5(0x212)+_0x5f319b['id']+_0x1004a5(0x217));return projectKb(_0x5f319b);}function a152_0x5188(){const _0xb62eca=['1220856hCxyYP','209457PMIpTt','verified','Run\x20`rabetbase\x20kb\x20detail\x20--id\x20','\x20--format\x20compress','3987942YUlHnl','UTF-8\x20text\x20or\x20Markdown\x20content\x20file','kb_verification_failed','stringify','kb_file_required','--file\x20is\x20required.','10SehVpJ','\x20for\x20','kb_title_required','kb_already_exists','Pass\x20a\x20UTF-8\x20text\x20or\x20Markdown\x20file.','4095104BeVerA','company','string','file','148MWfMBG','length','497744IPhAxf','\x20--format\x20compress`\x20before\x20choosing\x20update.','rabetbase\x20kb\x20detail\x20--id\x20','write','contentHash','Do\x20not\x20resubmit.\x20Inspect\x20the\x20resolved\x20app\x20and\x20determine\x20the\x20outcome\x20manually.','appCode','POST','Inspect\x20it\x20with\x20`rabetbase\x20kb\x20detail\x20--id\x20','Create\x20response\x20was\x20unavailable;\x20recovered\x20one\x20exact\x20company/app/title\x20record\x20without\x20resubmitting.','12396iTfpTK','Knowledge-base\x20title','/admin/knowledge-base/create','\x20--format\x20compress`;\x20do\x20not\x20resubmit\x20automatically.','str','\x20with\x20title\x20','title','700316JohcpY','trim','create','Expected\x20one\x20exact\x20company\x20knowledge\x20base\x20after\x20uncertain\x20create;\x20found\x20','Company\x20knowledge\x20base\x20already\x20exists\x20for\x20app\x20','content'];a152_0x5188=function(){return _0xb62eca;};return a152_0x5188();}export const kbCreate={'service':'kb','command':a152_0x516741(0x1f0),'description':'Create\x20a\x20company\x20knowledge\x20base\x20from\x20a\x20UTF-8\x20text\x20or\x20Markdown\x20file','risk':a152_0x516741(0x20d),'requiresAppCode':!![],'structuredErrors':!![],'flags':[{'name':a152_0x516741(0x21a),'type':a152_0x516741(0x206),'required':!![],'description':a152_0x516741(0x215)},{'name':a152_0x516741(0x207),'type':a152_0x516741(0x206),'required':!![],'description':a152_0x516741(0x1fa)}],async 'validate'(_0x4ac265){readCreateInput(_0x4ac265);},async 'dryRun'(_0x1094fa){const _0x4ab7db=a152_0x516741,_0x1aeee7=await prepareCreate(_0x1094fa);return asDryRunResult({'operation':'create','selector':{'scope':_0x4ab7db(0x205),'appCode':_0x1094fa[_0x4ab7db(0x210)],'title':_0x1aeee7[_0x4ab7db(0x21a)]},'before':null,'after':plannedAfter(_0x1094fa,_0x1aeee7),'dryRun':!![],'backend':{'method':_0x4ab7db(0x211),'path':CREATE_PATH},'warnings':[],'verification':{'lookupCommand':'rabetbase\x20kb\x20list\x20--title\x20'+JSON[_0x4ab7db(0x1fc)](_0x1aeee7[_0x4ab7db(0x21a)])+_0x4ab7db(0x1f8)}},{'method':'POST','url':CREATE_PATH});},async 'execute'(_0x342dfa){const _0x5203c6=a152_0x516741,_0x2fd731=await prepareCreate(_0x342dfa);let _0x1cbe0f,_0x4d91b8=![];try{const _0x181607=await createEnterpriseKnowledgeBase(_0x342dfa['cookie'],{'appCode':_0x342dfa['appCode'],'title':_0x2fd731[_0x5203c6(0x21a)],'content':_0x2fd731[_0x5203c6(0x1f3)][_0x5203c6(0x1f3)]});assertCompanyKnowledgeBase(_0x181607,_0x342dfa['appCode'],_0x181607['id']),_0x1cbe0f=_0x181607['id'];}catch(_0xf11dd8){if(!isPlatformTransportFailure(_0xf11dd8))throw _0xf11dd8;_0x4d91b8=!![];}if(_0x1cbe0f===undefined){const _0x2b3239=await verifyKbMutationReadback('create',!![],()=>fetchAllCompanyKnowledgeBases(_0x342dfa,{'title':_0x2fd731[_0x5203c6(0x21a)]})),_0x499b36=findExactCompanyKnowledgeBases(_0x2b3239,_0x342dfa[_0x5203c6(0x210)],_0x2fd731[_0x5203c6(0x21a)]);if(_0x499b36[_0x5203c6(0x209)]!==0x1)throw kbError('kb_create_outcome_unknown',_0x5203c6(0x1f1)+_0x499b36['length']+'.',_0x5203c6(0x20f));_0x1cbe0f=_0x499b36[0x0]['id'];}const _0x45be53=await verifyKbMutationReadback(_0x5203c6(0x1f0),_0x4d91b8,()=>requireKb(_0x342dfa,_0x1cbe0f)),_0x3f82b3=verifyCreatedState(_0x342dfa,_0x2fd731,_0x45be53),_0x276b93=_0x4d91b8?[_0x5203c6(0x213)]:[];return{'ok':!![],'data':{'operation':_0x5203c6(0x1f0),'selector':{'id':_0x3f82b3['id'],'scope':'company','appCode':_0x3f82b3['appCode']},'before':null,'after':_0x3f82b3,'dryRun':![],'backend':{'method':_0x5203c6(0x211),'path':CREATE_PATH},'warnings':_0x276b93,'verification':{'status':_0x5203c6(0x1f6),'recoveredAfterUnknownResponse':_0x4d91b8,'lookupCommand':_0x5203c6(0x20c)+_0x3f82b3['id']+'\x20--format\x20compress'}},'message':'Created\x20company\x20knowledge\x20base\x20'+_0x3f82b3['id']+_0x5203c6(0x200)+_0x3f82b3[_0x5203c6(0x210)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a153_0x40b17d=a153_0x560d;(function(_0x14fabf,_0x300e0d){const _0x1420f4=a153_0x560d,_0x31cad8=_0x14fabf();while(!![]){try{const _0x37f509=parseInt(_0x1420f4(0x169))/0x1+parseInt(_0x1420f4(0x15a))/0x2+-parseInt(_0x1420f4(0x16b))/0x3*(-parseInt(_0x1420f4(0x171))/0x4)+-parseInt(_0x1420f4(0x163))/0x5*(parseInt(_0x1420f4(0x15e))/0x6)+-parseInt(_0x1420f4(0x17d))/0x7*(-parseInt(_0x1420f4(0x17a))/0x8)+-parseInt(_0x1420f4(0x17b))/0x9*(-parseInt(_0x1420f4(0x15c))/0xa)+-parseInt(_0x1420f4(0x159))/0xb*(parseInt(_0x1420f4(0x16e))/0xc);if(_0x37f509===_0x300e0d)break;else _0x31cad8['push'](_0x31cad8['shift']());}catch(_0x59576d){_0x31cad8['push'](_0x31cad8['shift']());}}}(a153_0xe3e3,0x3005d));import{deleteEnterpriseKnowledgeBase,isPlatformTransportFailure}from'../../core/api-client.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertExpectedKbVersion,getKbOrNull,kbError,projectKb,readKbId,requireKbExplicitYes,verifyKbMutationReadback}from'../../commands/kb/shared.js';function a153_0xe3e3(){const _0xe8e824=['isSafeInteger','already_absent','kb_delete_outcome_unknown','company','delete','kb_expected_version_invalid','\x20remains\x20readable\x20after\x20delete.','8rAzLuF','25569CZERbP','appCode','1288399pRKwrY','kb_verification_failed','Soft-deleted\x20company\x20knowledge\x20base\x20','11dxCAVR','281102kBRbIJ','high-risk-write','150toztTu','rabetbase\x20kb\x20detail\x20--id\x20','1870314bCVRUw','Delete\x20response\x20was\x20unavailable;\x20exact-ID\x20not-found\x20readback\x20verified\x20database\x20soft\x20deletion\x20without\x20resubmitting.','POST','Non-atomic\x20preflight\x20assertion\x20for\x20the\x20current\x20version','unshift','5eKmaOQ','flag','Soft-delete\x20a\x20company\x20knowledge\x20base\x20for\x20the\x20resolved\x20app','expected-version','snapshotHash','cookie','242789rCMdxq','number','275523kxeEGo','--expected-version\x20is\x20a\x20non-atomic\x20read-before-write\x20assertion;\x20the\x20server\x20delete\x20contract\x20has\x20no\x20version\x20predicate.','\x20is\x20already\x20absent;\x20no\x20delete\x20request\x20was\x20made','2321196sYJkMj','verified','\x20--format\x20compress','4pGVpNc','\x20--format\x20compress`;\x20do\x20not\x20resubmit\x20automatically.'];a153_0xe3e3=function(){return _0xe8e824;};return a153_0xe3e3();}const DELETE_PATH='/admin/knowledge-base/delete',RAG_WARNING='Database\x20soft\x20deletion\x20was\x20verified;\x20asynchronous\x20RAG\x20cleanup\x20was\x20not\x20verified\x20by\x20the\x20CLI.',NON_ATOMIC_WARNING=a153_0x40b17d(0x16c);function readExpectedVersion(_0x2df19b){const _0x9594f5=a153_0x40b17d,_0x5cf91a=_0x2df19b[_0x9594f5(0x164)]('expected-version');if(_0x5cf91a===undefined)return undefined;const _0x59f046=Number(_0x5cf91a);if(!Number[_0x9594f5(0x173)](_0x59f046)||_0x59f046<0x0)throw kbError(_0x9594f5(0x178),'--expected-version\x20must\x20be\x20a\x20non-negative\x20safe\x20integer.');return _0x59f046;}function noOpData(_0x55bb12,_0xe6177b,_0x3cf176){const _0x3816a4=a153_0x40b17d;return{'operation':'no_op','selector':{'id':_0xe6177b,'scope':_0x3816a4(0x176),'appCode':_0x55bb12[_0x3816a4(0x17c)]},'before':null,'after':null,'dryRun':_0x3cf176,'deleteCalled':![],'backend':{'method':'POST','path':DELETE_PATH},'warnings':[],'verification':{'status':_0x3816a4(0x174),'databaseSoftDelete':!![],'ragCleanup':{'asynchronous':!![],'verified':![]}}};}function a153_0x560d(_0x4e9c37,_0x5a09b9){_0x4e9c37=_0x4e9c37-0x159;const _0xe3e35b=a153_0xe3e3();let _0x560dc4=_0xe3e35b[_0x4e9c37];return _0x560dc4;}export const kbDelete={'service':'kb','command':a153_0x40b17d(0x177),'description':a153_0x40b17d(0x165),'risk':a153_0x40b17d(0x15b),'requiresAppCode':!![],'structuredErrors':!![],'flags':[{'name':'id','type':a153_0x40b17d(0x16a),'required':!![],'description':'Company\x20knowledge-base\x20id'},{'name':a153_0x40b17d(0x166),'type':a153_0x40b17d(0x16a),'required':![],'description':a153_0x40b17d(0x161)}],async 'validate'(_0x1c9e23){readKbId(_0x1c9e23),readExpectedVersion(_0x1c9e23),requireKbExplicitYes(_0x1c9e23);},async 'dryRun'(_0x1197c4){const _0x52f026=a153_0x40b17d,_0x2912f0=readKbId(_0x1197c4),_0x44e755=readExpectedVersion(_0x1197c4),_0x462ee5=await getKbOrNull(_0x1197c4,_0x2912f0);if(!_0x462ee5)return asDryRunResult(noOpData(_0x1197c4,_0x2912f0,!![]),{'method':_0x52f026(0x160),'url':DELETE_PATH});assertExpectedKbVersion(_0x462ee5,_0x44e755);const _0x21fd55=projectKb(_0x462ee5),_0x2f07dd=[RAG_WARNING];if(_0x44e755!==undefined)_0x2f07dd[_0x52f026(0x162)](NON_ATOMIC_WARNING);return asDryRunResult({'operation':'delete','selector':{'id':_0x21fd55['id'],'scope':_0x52f026(0x176),'appCode':_0x21fd55['appCode']},'before':_0x21fd55,'after':null,'dryRun':!![],'deleteCalled':![],'backend':{'method':_0x52f026(0x160),'path':DELETE_PATH},'warnings':_0x2f07dd,'verification':{'expectedVersion':_0x44e755??null,'atomicCompareAndSet':![],'snapshotHash':_0x21fd55[_0x52f026(0x167)],'databaseSoftDelete':!![],'ragCleanup':{'asynchronous':!![],'verified':![]},'lookupCommand':_0x52f026(0x15d)+_0x21fd55['id']+_0x52f026(0x170)}},{'method':_0x52f026(0x160),'url':DELETE_PATH});},async 'execute'(_0x1626e9){const _0x4b4f89=a153_0x40b17d;requireKbExplicitYes(_0x1626e9);const _0x1c140a=readKbId(_0x1626e9),_0x413fe2=readExpectedVersion(_0x1626e9),_0x1b2f32=await getKbOrNull(_0x1626e9,_0x1c140a);if(!_0x1b2f32)return{'ok':!![],'data':noOpData(_0x1626e9,_0x1c140a,![]),'message':'Company\x20knowledge\x20base\x20'+_0x1c140a+_0x4b4f89(0x16d)};assertExpectedKbVersion(_0x1b2f32,_0x413fe2);const _0x1b548f=projectKb(_0x1b2f32);let _0x1fa5cf=![];try{await deleteEnterpriseKnowledgeBase(_0x1626e9[_0x4b4f89(0x168)],_0x1c140a);}catch(_0x2f2fda){if(!isPlatformTransportFailure(_0x2f2fda))throw _0x2f2fda;_0x1fa5cf=!![];}const _0x366788=await verifyKbMutationReadback(_0x4b4f89(0x177),_0x1fa5cf,()=>getKbOrNull(_0x1626e9,_0x1c140a));if(_0x366788)throw kbError(_0x1fa5cf?_0x4b4f89(0x175):_0x4b4f89(0x17e),'Company\x20knowledge\x20base\x20'+_0x1c140a+_0x4b4f89(0x179),'Inspect\x20it\x20with\x20`rabetbase\x20kb\x20detail\x20--id\x20'+_0x1c140a+_0x4b4f89(0x172));const _0xceb929=[RAG_WARNING];if(_0x413fe2!==undefined)_0xceb929['unshift'](NON_ATOMIC_WARNING);return _0x1fa5cf&&_0xceb929[_0x4b4f89(0x162)](_0x4b4f89(0x15f)),{'ok':!![],'data':{'operation':_0x4b4f89(0x177),'selector':{'id':_0x1b548f['id'],'scope':'company','appCode':_0x1b548f[_0x4b4f89(0x17c)]},'before':_0x1b548f,'after':null,'dryRun':![],'deleteCalled':!![],'backend':{'method':_0x4b4f89(0x160),'path':DELETE_PATH},'warnings':_0xceb929,'verification':{'status':_0x4b4f89(0x16f),'databaseSoftDelete':!![],'ragCleanup':{'asynchronous':!![],'verified':![]},'recoveredAfterUnknownResponse':_0x1fa5cf,'lookupCommand':_0x4b4f89(0x15d)+_0x1b548f['id']+'\x20--format\x20compress'}},'message':_0x4b4f89(0x17f)+_0x1b548f['id']};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a154_0x99a4bd=a154_0x30a9;function a154_0x30a9(_0x417cd8,_0x108657){_0x417cd8=_0x417cd8-0xa9;const _0x192ab5=a154_0x192a();let _0x30a946=_0x192ab5[_0x417cd8];return _0x30a946;}function a154_0x192a(){const _0x3c6ae5=['8QOFawD','31573817akanqU','number','966eqVCsE','432PtNqwV','Loaded\x20company\x20knowledge\x20base\x20','1663LWbyTv','75byfhGx','3997329YxZVhk','5305362VXrJvT','11847474xHhZyr','Company\x20knowledge-base\x20id','252784QZKRrK','95110uOSKeN','Show\x20one\x20company\x20knowledge\x20base\x20for\x20the\x20resolved\x20app','detail'];a154_0x192a=function(){return _0x3c6ae5;};return a154_0x192a();}(function(_0x4dd09d,_0x439ea5){const _0x342c71=a154_0x30a9,_0x2a33cf=_0x4dd09d();while(!![]){try{const _0x3242ef=parseInt(_0x342c71(0xb0))/0x1*(parseInt(_0x342c71(0xad))/0x2)+-parseInt(_0x342c71(0xb3))/0x3+-parseInt(_0x342c71(0xb6))/0x4*(-parseInt(_0x342c71(0xb1))/0x5)+-parseInt(_0x342c71(0xb4))/0x6+-parseInt(_0x342c71(0xb2))/0x7*(-parseInt(_0x342c71(0xaa))/0x8)+-parseInt(_0x342c71(0xae))/0x9*(parseInt(_0x342c71(0xb7))/0xa)+parseInt(_0x342c71(0xab))/0xb;if(_0x3242ef===_0x439ea5)break;else _0x2a33cf['push'](_0x2a33cf['shift']());}catch(_0xbfcbe8){_0x2a33cf['push'](_0x2a33cf['shift']());}}}(a154_0x192a,0xf26ea));import{projectKb,readKbId,requireKb}from'../../commands/kb/shared.js';export const kbDetail={'service':'kb','command':a154_0x99a4bd(0xa9),'description':a154_0x99a4bd(0xb8),'risk':'read','requiresAppCode':!![],'structuredErrors':!![],'flags':[{'name':'id','type':a154_0x99a4bd(0xac),'required':!![],'description':a154_0x99a4bd(0xb5)}],async 'validate'(_0x29b9e9){readKbId(_0x29b9e9);},async 'execute'(_0x1452c7){const _0x2176ac=a154_0x99a4bd,_0x267f32=readKbId(_0x1452c7),_0x4a78d9=await requireKb(_0x1452c7,_0x267f32);return{'ok':!![],'data':{'knowledgeBase':projectKb(_0x4a78d9)},'message':_0x2176ac(0xaf)+_0x267f32};}};
|
package/lib/commands/kb/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a155_0xec51(){const _0x4c3ae6=['2iDWtBa','332166zBhXlB','3819326EMOrwu','42867MPHcTb','138Tjvyby','24oCtWYL','58195iMYTwe','28zonPrO','353109BcOOCW','8ncmJsJ','1190COJVLg','11449282yvuJyr','3211417ZqbspE'];a155_0xec51=function(){return _0x4c3ae6;};return a155_0xec51();}(function(_0x3c4be4,_0x2211cc){const _0x4fca10=a155_0xa9f4,_0x587573=_0x3c4be4();while(!![]){try{const _0xcd14f1=-parseInt(_0x4fca10(0x1be))/0x1*(parseInt(_0x4fca10(0x1bf))/0x2)+-parseInt(_0x4fca10(0x1b9))/0x3*(parseInt(_0x4fca10(0x1b8))/0x4)+-parseInt(_0x4fca10(0x1b7))/0x5*(-parseInt(_0x4fca10(0x1c2))/0x6)+-parseInt(_0x4fca10(0x1c0))/0x7*(-parseInt(_0x4fca10(0x1ba))/0x8)+parseInt(_0x4fca10(0x1c1))/0x9*(-parseInt(_0x4fca10(0x1bb))/0xa)+-parseInt(_0x4fca10(0x1bd))/0xb*(-parseInt(_0x4fca10(0x1b6))/0xc)+parseInt(_0x4fca10(0x1bc))/0xd;if(_0xcd14f1===_0x2211cc)break;else _0x587573['push'](_0x587573['shift']());}catch(_0x110c9a){_0x587573['push'](_0x587573['shift']());}}}(a155_0xec51,0x8781f));import{kbList}from'../../commands/kb/list.js';import{kbDetail}from'../../commands/kb/detail.js';import{kbSearch}from'../../commands/kb/search.js';import{kbCreate}from'../../commands/kb/create.js';import{kbUpdate}from'../../commands/kb/update.js';function a155_0xa9f4(_0x5bc926,_0x383219){_0x5bc926=_0x5bc926-0x1b6;const _0xec516f=a155_0xec51();let _0xa9f4ac=_0xec516f[_0x5bc926];return _0xa9f4ac;}import{kbDelete}from'../../commands/kb/delete.js';export const kbDefinitions=[kbList,kbDetail,kbSearch,kbCreate,kbUpdate,kbDelete];
|
package/lib/commands/kb/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a156_0x465daf=a156_0x3d56;(function(_0x279573,_0x38d57b){const _0x1a0c68=a156_0x3d56,_0x1e2acb=_0x279573();while(!![]){try{const _0x2deff3=-parseInt(_0x1a0c68(0xc3))/0x1+-parseInt(_0x1a0c68(0xd1))/0x2+parseInt(_0x1a0c68(0xcf))/0x3+parseInt(_0x1a0c68(0xd5))/0x4*(-parseInt(_0x1a0c68(0xcd))/0x5)+parseInt(_0x1a0c68(0xd2))/0x6+-parseInt(_0x1a0c68(0xce))/0x7*(-parseInt(_0x1a0c68(0xd0))/0x8)+-parseInt(_0x1a0c68(0xd6))/0x9*(parseInt(_0x1a0c68(0xc6))/0xa);if(_0x2deff3===_0x38d57b)break;else _0x1e2acb['push'](_0x1e2acb['shift']());}catch(_0x35309e){_0x1e2acb['push'](_0x1e2acb['shift']());}}}(a156_0x6155,0x31575));import{fetchAllCompanyKnowledgeBases,projectKb}from'../../commands/kb/shared.js';function a156_0x6155(){const _0x8ef8d8=['List\x20company\x20knowledge\x20bases\x20for\x20the\x20resolved\x20app','map','426795CYuAyJ','7NsEjfG','113064rUfcuq','2342488Honeix','68568HYcLfl','689526frQgur','string','Filter\x20by\x20knowledge-base\x20title','4QELlJJ','101295sRnnVq','67401ONZTTq','title','length','50IbWhtG','appCode','read','trim','list'];a156_0x6155=function(){return _0x8ef8d8;};return a156_0x6155();}function a156_0x3d56(_0x2fd67f,_0x468b73){_0x2fd67f=_0x2fd67f-0xc3;const _0x61556c=a156_0x6155();let _0x3d5601=_0x61556c[_0x2fd67f];return _0x3d5601;}export const kbList={'service':'kb','command':a156_0x465daf(0xca),'description':a156_0x465daf(0xcb),'risk':a156_0x465daf(0xc8),'requiresAppCode':!![],'structuredErrors':!![],'flags':[{'name':a156_0x465daf(0xc4),'type':a156_0x465daf(0xd3),'required':![],'description':a156_0x465daf(0xd4)}],async 'execute'(_0x192397){const _0x584333=a156_0x465daf,_0x287a5e=_0x192397['str'](_0x584333(0xc4))[_0x584333(0xc9)](),_0x363897=await fetchAllCompanyKnowledgeBases(_0x192397,{..._0x287a5e?{'title':_0x287a5e}:{}}),_0x3fc53e=_0x363897[_0x584333(0xcc)](projectKb);return{'ok':!![],'data':{'total':_0x3fc53e[_0x584333(0xc5)],'knowledgeBases':_0x3fc53e},'message':'Found\x20'+_0x3fc53e[_0x584333(0xc5)]+'\x20company\x20knowledge\x20base(s)\x20for\x20'+_0x192397[_0x584333(0xc7)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a157_0x373760=a157_0x408b;(function(_0x76ac7d,_0x2edda5){const _0x4f92cb=a157_0x408b,_0x539284=_0x76ac7d();while(!![]){try{const _0x5d7f3c=parseInt(_0x4f92cb(0x102))/0x1+parseInt(_0x4f92cb(0x10d))/0x2*(parseInt(_0x4f92cb(0x116))/0x3)+parseInt(_0x4f92cb(0x108))/0x4*(-parseInt(_0x4f92cb(0x110))/0x5)+parseInt(_0x4f92cb(0x111))/0x6*(parseInt(_0x4f92cb(0x11d))/0x7)+-parseInt(_0x4f92cb(0x109))/0x8*(parseInt(_0x4f92cb(0x119))/0x9)+-parseInt(_0x4f92cb(0x115))/0xa*(parseInt(_0x4f92cb(0x121))/0xb)+parseInt(_0x4f92cb(0x10c))/0xc*(parseInt(_0x4f92cb(0x105))/0xd);if(_0x5d7f3c===_0x2edda5)break;else _0x539284['push'](_0x539284['shift']());}catch(_0x4a5a49){_0x539284['push'](_0x539284['shift']());}}}(a157_0x5a26,0xcfb38));import{searchDirectKnowledge,normalizeKbServiceOrigin}from'../../core/kb-search-client.js';function a157_0x5a26(){const _0x55b8ec=['7972vSYaWT','query','isSafeInteger','365EWOoua','4908yEwxVI','string','Found\x20','read','1630YfsVjw','639iRFoTY','cookie','Company\x20and\x20public\x20knowledge\x20search\x20query','18OzyHNR','Maximum\x20number\x20of\x20knowledge\x20hits\x20to\x20return','signal','\x20company/public\x20knowledge\x20hit(s)\x20for\x20','8876eWCLvA','Search\x20company\x20and\x20public\x20knowledge\x20for\x20the\x20resolved\x20app','kb-service-url','total','103477rbXPIN','Configure\x20kbServiceDomain\x20in\x20the\x20connection\x20settings,\x20or\x20pass\x20--kb-service-url\x20<https-origin>\x20for\x20this\x20request.','KB\x20Service\x20is\x20not\x20configured\x20for\x20knowledge\x20search.','validation','--topk\x20must\x20be\x20an\x20integer\x20from\x201\x20through\x2050.','1416716QDQKFK','number','topk','1229696buGxpe','flag','str','76236Wsxzlc','4164152ckEfbd','Search\x20query\x20is\x20required.','appCode','192PlWFNx'];a157_0x5a26=function(){return _0x55b8ec;};return a157_0x5a26();}import{CliErrors}from'../../errors.js';import{getKbServiceDomain}from'../../constant/domain.js';function readSearchQuery(_0x19b1c0){const _0x535c4e=a157_0x408b,_0x3987c3=_0x19b1c0[_0x535c4e(0x107)](_0x535c4e(0x10e))['trim']();if(!_0x3987c3)throw CliErrors[_0x535c4e(0x124)](_0x535c4e(0x10a));return _0x3987c3;}function readSearchTopK(_0x367554){const _0x43471c=a157_0x408b,_0x24a2d2=_0x367554['flag'](_0x43471c(0x104));if(_0x24a2d2===undefined||_0x24a2d2===null||_0x24a2d2==='')return undefined;const _0x5543d0=_0x367554['num'](_0x43471c(0x104));if(!Number[_0x43471c(0x10f)](_0x5543d0)||_0x5543d0<0x1||_0x5543d0>0x32)throw CliErrors[_0x43471c(0x124)](_0x43471c(0x101));return _0x5543d0;}function a157_0x408b(_0x59fdd9,_0x2c5b88){_0x59fdd9=_0x59fdd9-0x101;const _0x5a269d=a157_0x5a26();let _0x408b88=_0x5a269d[_0x59fdd9];return _0x408b88;}function readSearchServiceUrl(_0x45ac24){const _0x216c96=a157_0x408b;if(_0x45ac24[_0x216c96(0x106)](_0x216c96(0x11f))!==undefined)return normalizeKbServiceOrigin(_0x45ac24[_0x216c96(0x107)](_0x216c96(0x11f)));const _0x113540=getKbServiceDomain();if(!_0x113540)throw CliErrors[_0x216c96(0x124)](_0x216c96(0x123),_0x216c96(0x122));return normalizeKbServiceOrigin(_0x113540);}export const kbSearch={'service':'kb','command':'search','description':a157_0x373760(0x11e),'risk':a157_0x373760(0x114),'requiresAppCode':!![],'structuredErrors':!![],'strictFlags':!![],'flags':[{'name':a157_0x373760(0x10e),'type':'string','required':!![],'description':a157_0x373760(0x118)},{'name':a157_0x373760(0x104),'type':a157_0x373760(0x103),'required':![],'description':a157_0x373760(0x11a)},{'name':a157_0x373760(0x11f),'type':a157_0x373760(0x112),'required':![],'description':'Optional\x20trusted\x20KB\x20Service\x20HTTPS\x20origin\x20for\x20this\x20request\x20only'}],async 'validate'(_0x4214ef){readSearchQuery(_0x4214ef),readSearchTopK(_0x4214ef),readSearchServiceUrl(_0x4214ef);},async 'execute'(_0x4d3e45){const _0x57c58f=a157_0x373760,_0x36ef90=readSearchQuery(_0x4d3e45),_0x2adad6=readSearchTopK(_0x4d3e45),_0x59ab17=readSearchServiceUrl(_0x4d3e45),_0x25a1aa={'cookie':_0x4d3e45[_0x57c58f(0x117)],'query':_0x36ef90,'appCode':_0x4d3e45[_0x57c58f(0x10b)],..._0x2adad6!==undefined?{'topK':_0x2adad6}:{},'signal':_0x4d3e45[_0x57c58f(0x11b)]},_0x41fa17=await searchDirectKnowledge({..._0x25a1aa,'serviceUrl':_0x59ab17});return{'ok':!![],'data':_0x41fa17,'message':_0x57c58f(0x113)+_0x41fa17[_0x57c58f(0x120)]+_0x57c58f(0x11c)+_0x4d3e45[_0x57c58f(0x10b)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a148_0x1e2f(){const _0x2889e6=['byteLength','items','\x20was\x20requested.','7194IAlYrt','\x20does\x20not\x20belong\x20to\x20company\x20scope\x20for\x20app\x20','sha256','Knowledge-base\x20list\x20returned\x20page\x20','company','1082620yrvZzQ','\x20to\x20','Retry\x20the\x20read\x20after\x20concurrent\x20updates\x20have\x20settled.','sha256:','Knowledge-base\x20list\x20total\x20changed\x20from\x20','contentHash','number','cookie','kb_confirmation_required','Knowledge-base\x20content\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','This\x20company\x20knowledge-base\x20mutation\x20requires\x20explicit\x20--yes.','update','add','has','38423WDjlXc','length','scope','utf-8','--id\x20must\x20be\x20a\x20positive\x20safe\x20integer.','Cannot\x20read\x20knowledge-base\x20content\x20file:\x20','kb_list_contract_invalid','isSafeInteger','117jqGzkg','kb_id_invalid','push','\x20while\x20id\x20','decode','stringify','kb_not_found','updateTime','498zdQfpa','bool','dry-run','outcome_unknown','yes','hex','num','verification_unavailable','230285TbYHpF','allowEmpty','kb_response_invalid','trim','Knowledge-base\x20list\x20stopped\x20at\x20','string','\x20is\x20not\x20company-scoped.','165656rasOCf','98ZidFNm','kb_scope_mismatch','kb_file_required','306','\x20version\x20changed:\x20expected\x20','from','\x20during\x20paging.','paging','Knowledge-base\x20content\x20file\x20is\x20blank:\x20','version','message','Knowledge-base\x20response\x20contains\x20an\x20invalid\x20id.','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.','Knowledge-base\x20content\x20file\x20path\x20is\x20required.','491128YfhRQO','utf8','Run\x20the\x20command\x20with\x20--dry-run\x20again\x20and\x20review\x20the\x20latest\x20version\x20before\x20retrying.','title','createTime',',\x20current\x20','\x20while\x20page\x20','12TuOrKt','defineProperty','Knowledge-base\x20content\x20file\x20is\x20not\x20valid\x20UTF-8:\x20','Knowledge\x20base\x20','currentPage','\x20records.','509637FJPNZV','kb_file_unreadable','content','\x20response\x20contains\x20an\x20invalid\x20version.','appCode','isFile'];a148_0x1e2f=function(){return _0x2889e6;};return a148_0x1e2f();}const a148_0x195d30=a148_0x107d;(function(_0x11de58,_0x19f237){const _0x2ae4cf=a148_0x107d,_0x9f4731=_0x11de58();while(!![]){try{const _0x1d14a3=parseInt(_0x2ae4cf(0x1e6))/0x1*(parseInt(_0x2ae4cf(0x1b3))/0x2)+-parseInt(_0x2ae4cf(0x1aa))/0x3+parseInt(_0x2ae4cf(0x1a4))/0x4*(parseInt(_0x2ae4cf(0x1de))/0x5)+-parseInt(_0x2ae4cf(0x1d6))/0x6*(parseInt(_0x2ae4cf(0x1c6))/0x7)+parseInt(_0x2ae4cf(0x1e5))/0x8*(parseInt(_0x2ae4cf(0x1ce))/0x9)+parseInt(_0x2ae4cf(0x1b8))/0xa+parseInt(_0x2ae4cf(0x19d))/0xb;if(_0x1d14a3===_0x19f237)break;else _0x9f4731['push'](_0x9f4731['shift']());}catch(_0x3e9098){_0x9f4731['push'](_0x9f4731['shift']());}}}(a148_0x1e2f,0x46250));import{createHash}from'node:crypto';import{readFile,stat}from'node:fs/promises';import{resolve}from'node:path';import{TextDecoder}from'node:util';function a148_0x107d(_0x2f1270,_0x3bfc73){_0x2f1270=_0x2f1270-0x195;const _0x1e2f2f=a148_0x1e2f();let _0x107d2e=_0x1e2f2f[_0x2f1270];return _0x107d2e;}import{getEnterpriseKnowledgeBase,getPlatformErrorCode,listEnterpriseKnowledgeBases}from'../../core/api-client.js';import{CliError}from'../../errors.js';const LIST_PAGE_SIZE=0x32,DATA_NOT_EXIST_ERROR_CODE=a148_0x195d30(0x1e9);export function kbError(_0x137ae1,_0x154cb1,_0x148230){return new CliError(_0x137ae1,0x1,_0x154cb1,_0x148230);}export function readKbId(_0x1fe910){const _0xe4f91f=a148_0x195d30,_0x4d93b7=_0x1fe910[_0xe4f91f(0x1dc)]('id');if(!Number['isSafeInteger'](_0x4d93b7)||_0x4d93b7<=0x0)throw kbError(_0xe4f91f(0x1cf),_0xe4f91f(0x1ca));return _0x4d93b7;}export function requireKbExplicitYes(_0x377e27){const _0x59df21=a148_0x195d30;if(_0x377e27[_0x59df21(0x1d7)](_0x59df21(0x1d8))||_0x377e27[_0x59df21(0x1d7)](_0x59df21(0x1da)))return;throw kbError(_0x59df21(0x1c0),_0x59df21(0x1c2),_0x59df21(0x19b));}function sha256(_0x1aa3bc){const _0xc05421=a148_0x195d30;return _0xc05421(0x1bb)+createHash(_0xc05421(0x1b5))[_0xc05421(0x1c3)](_0x1aa3bc)['digest'](_0xc05421(0x1db));}export function inspectKbContent(_0x311862){const _0x35049b=a148_0x195d30,_0x507c53=Buffer[_0x35049b(0x1eb)](_0x311862,_0x35049b(0x19e));return{'content':_0x311862,'byteSize':_0x507c53[_0x35049b(0x1b0)],'contentHash':sha256(_0x507c53)};}export async function readKbFile(_0x3a0b56){const _0x229b99=a148_0x195d30,_0x26255d=_0x3a0b56[_0x229b99(0x1e1)]();if(!_0x26255d)throw kbError(_0x229b99(0x1e8),_0x229b99(0x19c),'Pass\x20--file\x20<knowledge.md>.');const _0x4a9f7a=resolve(_0x26255d);let _0x2a3659;try{_0x2a3659=await stat(_0x4a9f7a);}catch(_0x139b5f){throw kbError(_0x229b99(0x1ab),'Cannot\x20access\x20knowledge-base\x20content\x20file:\x20'+_0x26255d,_0x139b5f instanceof Error?_0x139b5f[_0x229b99(0x199)]:String(_0x139b5f));}if(!_0x2a3659[_0x229b99(0x1af)]())throw kbError('kb_file_invalid',_0x229b99(0x1c1)+_0x26255d);let _0x481037;try{_0x481037=await readFile(_0x4a9f7a);}catch(_0x8e762b){throw kbError(_0x229b99(0x1ab),_0x229b99(0x1cb)+_0x26255d,_0x8e762b instanceof Error?_0x8e762b['message']:String(_0x8e762b));}let _0x42de24;try{_0x42de24=new TextDecoder(_0x229b99(0x1c9),{'fatal':!![],'ignoreBOM':!![]})[_0x229b99(0x1d2)](_0x481037);}catch{throw kbError('kb_content_invalid',_0x229b99(0x1a6)+_0x26255d);}if(!_0x42de24[_0x229b99(0x1e1)]())throw kbError('kb_content_invalid',_0x229b99(0x197)+_0x26255d);return inspectKbContent(_0x42de24);}export async function verifyKbMutationReadback(_0x5b0be4,_0x3774d6,_0x5896d6){const _0x43f7fd=a148_0x195d30;try{return await _0x5896d6();}catch(_0x182c28){const _0x51078b=kbError('kb_'+_0x5b0be4+'_'+(_0x3774d6?_0x43f7fd(0x1d9):_0x43f7fd(0x1dd)),'The\x20'+_0x5b0be4+'\x20request\x20was\x20sent,\x20but\x20its\x20final\x20company\x20knowledge-base\x20state\x20could\x20not\x20be\x20verified.','Do\x20not\x20resubmit\x20automatically.\x20Resolve\x20the\x20app\x20again\x20and\x20inspect\x20the\x20target\x20state\x20manually.');Object[_0x43f7fd(0x1a5)](_0x51078b,'cause',{'value':_0x182c28,'enumerable':![]});throw _0x51078b;}}function requireRecordText(_0x918594,_0x26a0cc,_0x46ce7e,_0x69bc36={}){const _0x303631=a148_0x195d30;if(typeof _0x918594===_0x303631(0x1e3)&&(_0x69bc36[_0x303631(0x1df)]||_0x918594[_0x303631(0x1e1)]()))return _0x918594;throw kbError(_0x303631(0x1e0),'Knowledge\x20base\x20'+String(_0x46ce7e)+'\x20response\x20is\x20missing\x20'+_0x26a0cc+'.');}export function projectKb(_0x29e00a){const _0x5e1f27=a148_0x195d30;if(!Number[_0x5e1f27(0x1cd)](_0x29e00a['id'])||_0x29e00a['id']<=0x0)throw kbError(_0x5e1f27(0x1e0),_0x5e1f27(0x19a));if(!Number['isSafeInteger'](_0x29e00a[_0x5e1f27(0x198)])||_0x29e00a[_0x5e1f27(0x198)]<0x0)throw kbError(_0x5e1f27(0x1e0),_0x5e1f27(0x1a7)+_0x29e00a['id']+_0x5e1f27(0x1ad));if(_0x29e00a['scope']!==_0x5e1f27(0x1b7))throw kbError(_0x5e1f27(0x1e7),_0x5e1f27(0x1a7)+_0x29e00a['id']+_0x5e1f27(0x1e4));const _0xc2630d=requireRecordText(_0x29e00a[_0x5e1f27(0x1ae)],'appCode',_0x29e00a['id']),_0x2737e5=requireRecordText(_0x29e00a[_0x5e1f27(0x1a0)],'title',_0x29e00a['id']),_0x395879=inspectKbContent(requireRecordText(_0x29e00a['content'],_0x5e1f27(0x1ac),_0x29e00a['id'],{'allowEmpty':!![]})),_0x115ac7=typeof _0x29e00a['createTime']===_0x5e1f27(0x1e3)||typeof _0x29e00a[_0x5e1f27(0x1a1)]===_0x5e1f27(0x1be)?_0x29e00a['createTime']:undefined,_0x1f33c0=typeof _0x29e00a['updateTime']===_0x5e1f27(0x1e3)||typeof _0x29e00a[_0x5e1f27(0x1d5)]===_0x5e1f27(0x1be)?_0x29e00a['updateTime']:undefined,_0x627378=sha256(JSON[_0x5e1f27(0x1d3)]({'id':_0x29e00a['id'],'scope':_0x29e00a[_0x5e1f27(0x1c8)],'appCode':_0xc2630d,'title':_0x2737e5,'version':_0x29e00a[_0x5e1f27(0x198)],'contentHash':_0x395879[_0x5e1f27(0x1bd)],'createTime':_0x115ac7,'updateTime':_0x1f33c0}));return{'id':_0x29e00a['id'],'scope':'company','appCode':_0xc2630d,'title':_0x2737e5,'version':_0x29e00a['version'],'contentByteSize':_0x395879['byteSize'],'contentHash':_0x395879[_0x5e1f27(0x1bd)],'snapshotHash':_0x627378,..._0x115ac7!==undefined?{'createTime':_0x115ac7}:{},..._0x1f33c0!==undefined?{'updateTime':_0x1f33c0}:{}};}export function assertCompanyKnowledgeBase(_0x5e4612,_0xd84a62,_0x2e390f){const _0x3cdae6=a148_0x195d30;if(_0x2e390f!==undefined&&_0x5e4612['id']!==_0x2e390f)throw kbError(_0x3cdae6(0x1e0),'Knowledge-base\x20get-one\x20returned\x20id\x20'+_0x5e4612['id']+_0x3cdae6(0x1d1)+_0x2e390f+_0x3cdae6(0x1b2));if(_0x5e4612[_0x3cdae6(0x1c8)]!=='company'||_0x5e4612[_0x3cdae6(0x1ae)]!==_0xd84a62)throw kbError(_0x3cdae6(0x1e7),_0x3cdae6(0x1a7)+_0x5e4612['id']+_0x3cdae6(0x1b4)+_0xd84a62+'.');}export async function fetchAllCompanyKnowledgeBases(_0x3b2438,_0x396366){const _0x394c28=a148_0x195d30,_0x1120bd=[],_0x12ac11=new Set();let _0x6b1ac0=0x1,_0x202792=0x0,_0x456636;while(!![]){const _0xbfb81=await listEnterpriseKnowledgeBases(_0x3b2438['cookie'],{'currentPage':_0x6b1ac0,'pageSize':LIST_PAGE_SIZE,'appCode':_0x3b2438[_0x394c28(0x1ae)],..._0x396366}),_0x567536=_0xbfb81[_0x394c28(0x196)]?.['totalCount'];if(_0xbfb81[_0x394c28(0x196)]?.['currentPage']!==undefined&&_0xbfb81['paging'][_0x394c28(0x1a8)]!==_0x6b1ac0)throw kbError(_0x394c28(0x1cc),_0x394c28(0x1b6)+_0xbfb81[_0x394c28(0x196)][_0x394c28(0x1a8)]+_0x394c28(0x1a3)+_0x6b1ac0+_0x394c28(0x1b2));if(_0x567536!==undefined){if(_0x456636!==undefined&&_0x567536!==_0x456636)throw kbError(_0x394c28(0x1cc),_0x394c28(0x1bc)+_0x456636+_0x394c28(0x1b9)+_0x567536+_0x394c28(0x195),_0x394c28(0x1ba));_0x456636=_0x567536;}for(const _0x1912e5 of _0xbfb81['items']){if(!Number[_0x394c28(0x1cd)](_0x1912e5['id'])||_0x12ac11[_0x394c28(0x1c5)](_0x1912e5['id']))throw kbError(_0x394c28(0x1cc),'Knowledge-base\x20list\x20returned\x20an\x20invalid\x20or\x20repeated\x20id:\x20'+String(_0x1912e5['id'])+'.');_0x12ac11[_0x394c28(0x1c4)](_0x1912e5['id']),_0x1912e5[_0x394c28(0x1c8)]==='company'&&_0x1912e5[_0x394c28(0x1ae)]===_0x3b2438[_0x394c28(0x1ae)]&&_0x1120bd[_0x394c28(0x1d0)](_0x1912e5);}_0x202792+=_0xbfb81[_0x394c28(0x1b1)]['length'];if(_0x567536!==undefined&&_0x202792>=_0x567536)break;if(_0xbfb81[_0x394c28(0x1b1)][_0x394c28(0x1c7)]<LIST_PAGE_SIZE){if(_0x567536!==undefined&&_0x202792<_0x567536)throw kbError(_0x394c28(0x1cc),_0x394c28(0x1e2)+_0x202792+'\x20of\x20'+_0x567536+_0x394c28(0x1a9));break;}_0x6b1ac0+=0x1;}return _0x1120bd;}export function findExactCompanyKnowledgeBases(_0x44247b,_0x20fcf,_0x370802){const _0x39f2d8=a148_0x195d30;return _0x44247b['filter'](_0x78eb80=>_0x78eb80[_0x39f2d8(0x1c8)]===_0x39f2d8(0x1b7)&&_0x78eb80[_0x39f2d8(0x1ae)]===_0x20fcf&&_0x78eb80[_0x39f2d8(0x1a0)]===_0x370802);}export async function getKbOrNull(_0x326f29,_0x2e2174){const _0x58721d=a148_0x195d30;try{const _0x130aea=await getEnterpriseKnowledgeBase(_0x326f29[_0x58721d(0x1bf)],_0x2e2174);return assertCompanyKnowledgeBase(_0x130aea,_0x326f29[_0x58721d(0x1ae)],_0x2e2174),_0x130aea;}catch(_0x3e1546){if(getPlatformErrorCode(_0x3e1546)===DATA_NOT_EXIST_ERROR_CODE)return null;throw _0x3e1546;}}export async function requireKb(_0x2b79bd,_0x36377a){const _0x48afbb=a148_0x195d30,_0x29cf25=await getKbOrNull(_0x2b79bd,_0x36377a);if(!_0x29cf25)throw kbError(_0x48afbb(0x1d4),'Company\x20knowledge\x20base\x20not\x20found:\x20'+_0x36377a,'Run\x20`rabetbase\x20kb\x20list\x20--format\x20compress`\x20to\x20inspect\x20the\x20resolved\x20app.');return _0x29cf25;}export function assertExpectedKbVersion(_0x2ce73c,_0x31b95){const _0x3959c7=a148_0x195d30;if(_0x31b95===undefined||_0x2ce73c['version']===_0x31b95)return;throw kbError('kb_state_drift',_0x3959c7(0x1a7)+_0x2ce73c['id']+_0x3959c7(0x1ea)+_0x31b95+_0x3959c7(0x1a2)+_0x2ce73c[_0x3959c7(0x198)]+'.',_0x3959c7(0x19f));}
|
|
1
|
+
const a158_0x21e163=a158_0xc2a3;(function(_0x54b9f7,_0x28d41d){const _0x386ac7=a158_0xc2a3,_0x15f3d1=_0x54b9f7();while(!![]){try{const _0xfd0b36=-parseInt(_0x386ac7(0x1a3))/0x1*(-parseInt(_0x386ac7(0x1c6))/0x2)+parseInt(_0x386ac7(0x1b4))/0x3*(parseInt(_0x386ac7(0x186))/0x4)+-parseInt(_0x386ac7(0x199))/0x5+-parseInt(_0x386ac7(0x1d3))/0x6*(parseInt(_0x386ac7(0x1a0))/0x7)+-parseInt(_0x386ac7(0x1d5))/0x8*(parseInt(_0x386ac7(0x1b0))/0x9)+parseInt(_0x386ac7(0x180))/0xa+-parseInt(_0x386ac7(0x191))/0xb;if(_0xfd0b36===_0x28d41d)break;else _0x15f3d1['push'](_0x15f3d1['shift']());}catch(_0xe0c3dd){_0x15f3d1['push'](_0x15f3d1['shift']());}}}(a158_0x41fb,0xd3a0e));import{createHash}from'node:crypto';import{readFile,stat}from'node:fs/promises';import{resolve}from'node:path';import{TextDecoder}from'node:util';import{getEnterpriseKnowledgeBase,getPlatformErrorCode,listEnterpriseKnowledgeBases}from'../../core/api-client.js';import{CliError}from'../../errors.js';const LIST_PAGE_SIZE=0x32,DATA_NOT_EXIST_ERROR_CODE=a158_0x21e163(0x19d);export function kbError(_0xc0c955,_0x5df018,_0x43723d){return new CliError(_0xc0c955,0x1,_0x5df018,_0x43723d);}export function readKbId(_0x45dda3){const _0x5196c6=a158_0x21e163,_0xe1e44e=_0x45dda3[_0x5196c6(0x1d6)]('id');if(!Number['isSafeInteger'](_0xe1e44e)||_0xe1e44e<=0x0)throw kbError(_0x5196c6(0x19c),'--id\x20must\x20be\x20a\x20positive\x20safe\x20integer.');return _0xe1e44e;}function a158_0xc2a3(_0x544383,_0x27e9e0){_0x544383=_0x544383-0x180;const _0x41fb60=a158_0x41fb();let _0xc2a3fb=_0x41fb60[_0x544383];return _0xc2a3fb;}export function requireKbExplicitYes(_0x5f55c5){const _0x5457e3=a158_0x21e163;if(_0x5f55c5['bool'](_0x5457e3(0x1ad))||_0x5f55c5[_0x5457e3(0x195)](_0x5457e3(0x1a1)))return;throw kbError(_0x5457e3(0x193),'This\x20company\x20knowledge-base\x20mutation\x20requires\x20explicit\x20--yes.','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.');}function sha256(_0x1e4348){const _0x35beb6=a158_0x21e163;return _0x35beb6(0x18a)+createHash(_0x35beb6(0x18b))[_0x35beb6(0x1d7)](_0x1e4348)[_0x35beb6(0x184)](_0x35beb6(0x1a4));}export function inspectKbContent(_0x241454){const _0x33f737=a158_0x21e163,_0x472547=Buffer[_0x33f737(0x1b7)](_0x241454,_0x33f737(0x1c3));return{'content':_0x241454,'byteSize':_0x472547[_0x33f737(0x1ca)],'contentHash':sha256(_0x472547)};}export async function readKbFile(_0x39c3e7){const _0x969633=a158_0x21e163,_0x3424c2=_0x39c3e7['trim']();if(!_0x3424c2)throw kbError(_0x969633(0x18c),_0x969633(0x1ab),_0x969633(0x1b9));const _0x33cb84=resolve(_0x3424c2);let _0x5649fa;try{_0x5649fa=await stat(_0x33cb84);}catch(_0x38f321){throw kbError(_0x969633(0x1d4),_0x969633(0x190)+_0x3424c2,_0x38f321 instanceof Error?_0x38f321[_0x969633(0x1c7)]:String(_0x38f321));}if(!_0x5649fa[_0x969633(0x1b5)]())throw kbError(_0x969633(0x1c9),'Knowledge-base\x20content\x20path\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x3424c2);let _0x2449dd;try{_0x2449dd=await readFile(_0x33cb84);}catch(_0x32d05b){throw kbError(_0x969633(0x1d4),_0x969633(0x19a)+_0x3424c2,_0x32d05b instanceof Error?_0x32d05b[_0x969633(0x1c7)]:String(_0x32d05b));}let _0x3fda5d;try{_0x3fda5d=new TextDecoder('utf-8',{'fatal':!![],'ignoreBOM':!![]})[_0x969633(0x1b2)](_0x2449dd);}catch{throw kbError(_0x969633(0x1c1),_0x969633(0x192)+_0x3424c2);}if(!_0x3fda5d[_0x969633(0x1ce)]())throw kbError(_0x969633(0x1c1),_0x969633(0x1d2)+_0x3424c2);return inspectKbContent(_0x3fda5d);}export async function verifyKbMutationReadback(_0x553577,_0x29a8b4,_0x1cc68e){const _0x4eef7e=a158_0x21e163;try{return await _0x1cc68e();}catch(_0x219f64){const _0x55011a=kbError(_0x4eef7e(0x1a5)+_0x553577+'_'+(_0x29a8b4?'outcome_unknown':_0x4eef7e(0x1d0)),_0x4eef7e(0x1ba)+_0x553577+_0x4eef7e(0x194),'Do\x20not\x20resubmit\x20automatically.\x20Resolve\x20the\x20app\x20again\x20and\x20inspect\x20the\x20target\x20state\x20manually.');Object[_0x4eef7e(0x197)](_0x55011a,_0x4eef7e(0x18f),{'value':_0x219f64,'enumerable':![]});throw _0x55011a;}}function requireRecordText(_0x32dedd,_0x891aa,_0x78af58,_0x5832ff={}){const _0x23e989=a158_0x21e163;if(typeof _0x32dedd===_0x23e989(0x1bd)&&(_0x5832ff[_0x23e989(0x1c5)]||_0x32dedd[_0x23e989(0x1ce)]()))return _0x32dedd;throw kbError('kb_response_invalid','Knowledge\x20base\x20'+String(_0x78af58)+'\x20response\x20is\x20missing\x20'+_0x891aa+'.');}export function projectKb(_0x433c58){const _0x3403c8=a158_0x21e163;if(!Number[_0x3403c8(0x1b3)](_0x433c58['id'])||_0x433c58['id']<=0x0)throw kbError(_0x3403c8(0x1c0),_0x3403c8(0x198));if(!Number[_0x3403c8(0x1b3)](_0x433c58[_0x3403c8(0x18d)])||_0x433c58[_0x3403c8(0x18d)]<0x0)throw kbError(_0x3403c8(0x1c0),_0x3403c8(0x1cb)+_0x433c58['id']+_0x3403c8(0x18e));if(_0x433c58[_0x3403c8(0x185)]!==_0x3403c8(0x1d1))throw kbError(_0x3403c8(0x1c2),_0x3403c8(0x1cb)+_0x433c58['id']+'\x20is\x20not\x20company-scoped.');const _0x8a25c2=requireRecordText(_0x433c58['appCode'],'appCode',_0x433c58['id']),_0x6760bb=requireRecordText(_0x433c58[_0x3403c8(0x181)],_0x3403c8(0x181),_0x433c58['id']),_0xe1bfc8=inspectKbContent(requireRecordText(_0x433c58[_0x3403c8(0x1c4)],_0x3403c8(0x1c4),_0x433c58['id'],{'allowEmpty':!![]})),_0x11098d=typeof _0x433c58[_0x3403c8(0x188)]===_0x3403c8(0x1bd)||typeof _0x433c58[_0x3403c8(0x188)]===_0x3403c8(0x1af)?_0x433c58['createTime']:undefined,_0x1bd411=typeof _0x433c58[_0x3403c8(0x1a6)]===_0x3403c8(0x1bd)||typeof _0x433c58[_0x3403c8(0x1a6)]===_0x3403c8(0x1af)?_0x433c58[_0x3403c8(0x1a6)]:undefined,_0x5d4b2a=sha256(JSON['stringify']({'id':_0x433c58['id'],'scope':_0x433c58[_0x3403c8(0x185)],'appCode':_0x8a25c2,'title':_0x6760bb,'version':_0x433c58[_0x3403c8(0x18d)],'contentHash':_0xe1bfc8[_0x3403c8(0x183)],'createTime':_0x11098d,'updateTime':_0x1bd411}));return{'id':_0x433c58['id'],'scope':_0x3403c8(0x1d1),'appCode':_0x8a25c2,'title':_0x6760bb,'version':_0x433c58[_0x3403c8(0x18d)],'contentByteSize':_0xe1bfc8[_0x3403c8(0x1a8)],'contentHash':_0xe1bfc8[_0x3403c8(0x183)],'snapshotHash':_0x5d4b2a,..._0x11098d!==undefined?{'createTime':_0x11098d}:{},..._0x1bd411!==undefined?{'updateTime':_0x1bd411}:{}};}function a158_0x41fb(){const _0x42b2fc=['message','push','kb_file_invalid','byteLength','Knowledge\x20base\x20','Knowledge-base\x20list\x20total\x20changed\x20from\x20','cookie','trim','currentPage','verification_unavailable','company','Knowledge-base\x20content\x20file\x20is\x20blank:\x20','601950FTFJTO','kb_file_unreadable','11447944EHiDhf','num','update','length','16042170JjIfAs','title','paging','contentHash','digest','scope','2265608nNtdoN','\x20to\x20','createTime','appCode','sha256:','sha256','kb_file_required','version','\x20response\x20contains\x20an\x20invalid\x20version.','cause','Cannot\x20access\x20knowledge-base\x20content\x20file:\x20','7194825fdYvDA','Knowledge-base\x20content\x20file\x20is\x20not\x20valid\x20UTF-8:\x20','kb_confirmation_required','\x20request\x20was\x20sent,\x20but\x20its\x20final\x20company\x20knowledge-base\x20state\x20could\x20not\x20be\x20verified.','bool','filter','defineProperty','Knowledge-base\x20response\x20contains\x20an\x20invalid\x20id.','2705055zsBkkE','Cannot\x20read\x20knowledge-base\x20content\x20file:\x20','Run\x20`rabetbase\x20kb\x20list\x20--format\x20compress`\x20to\x20inspect\x20the\x20resolved\x20app.','kb_id_invalid','306','\x20was\x20requested.',',\x20current\x20','7wrKwrh','yes','Retry\x20the\x20read\x20after\x20concurrent\x20updates\x20have\x20settled.','4751DHMJaQ','hex','kb_','updateTime','\x20while\x20page\x20','byteSize','add','Company\x20knowledge\x20base\x20not\x20found:\x20','Knowledge-base\x20content\x20file\x20path\x20is\x20required.','\x20during\x20paging.','dry-run','Knowledge-base\x20list\x20stopped\x20at\x20','number','9wluaaM','Knowledge-base\x20list\x20returned\x20an\x20invalid\x20or\x20repeated\x20id:\x20','decode','isSafeInteger','9kNPXLE','isFile','totalCount','from','\x20does\x20not\x20belong\x20to\x20company\x20scope\x20for\x20app\x20','Pass\x20--file\x20<knowledge.md>.','The\x20','\x20version\x20changed:\x20expected\x20','\x20records.','string','kb_not_found','kb_list_contract_invalid','kb_response_invalid','kb_content_invalid','kb_scope_mismatch','utf8','content','allowEmpty','122QGBOBz'];a158_0x41fb=function(){return _0x42b2fc;};return a158_0x41fb();}export function assertCompanyKnowledgeBase(_0x11f4ff,_0x1396f0,_0x250d5c){const _0x660d94=a158_0x21e163;if(_0x250d5c!==undefined&&_0x11f4ff['id']!==_0x250d5c)throw kbError(_0x660d94(0x1c0),'Knowledge-base\x20get-one\x20returned\x20id\x20'+_0x11f4ff['id']+'\x20while\x20id\x20'+_0x250d5c+_0x660d94(0x19e));if(_0x11f4ff[_0x660d94(0x185)]!==_0x660d94(0x1d1)||_0x11f4ff[_0x660d94(0x189)]!==_0x1396f0)throw kbError('kb_scope_mismatch','Knowledge\x20base\x20'+_0x11f4ff['id']+_0x660d94(0x1b8)+_0x1396f0+'.');}export async function fetchAllCompanyKnowledgeBases(_0x4dfc60,_0x1bc839){const _0x5da6e0=a158_0x21e163,_0x125535=[],_0x3768b6=new Set();let _0x1ff1c1=0x1,_0x4bb460=0x0,_0x737326;while(!![]){const _0x54a63d=await listEnterpriseKnowledgeBases(_0x4dfc60[_0x5da6e0(0x1cd)],{'currentPage':_0x1ff1c1,'pageSize':LIST_PAGE_SIZE,'appCode':_0x4dfc60[_0x5da6e0(0x189)],..._0x1bc839}),_0x101490=_0x54a63d['paging']?.[_0x5da6e0(0x1b6)];if(_0x54a63d[_0x5da6e0(0x182)]?.[_0x5da6e0(0x1cf)]!==undefined&&_0x54a63d[_0x5da6e0(0x182)][_0x5da6e0(0x1cf)]!==_0x1ff1c1)throw kbError('kb_list_contract_invalid','Knowledge-base\x20list\x20returned\x20page\x20'+_0x54a63d[_0x5da6e0(0x182)][_0x5da6e0(0x1cf)]+_0x5da6e0(0x1a7)+_0x1ff1c1+'\x20was\x20requested.');if(_0x101490!==undefined){if(_0x737326!==undefined&&_0x101490!==_0x737326)throw kbError(_0x5da6e0(0x1bf),_0x5da6e0(0x1cc)+_0x737326+_0x5da6e0(0x187)+_0x101490+_0x5da6e0(0x1ac),_0x5da6e0(0x1a2));_0x737326=_0x101490;}for(const _0xa579a8 of _0x54a63d['items']){if(!Number['isSafeInteger'](_0xa579a8['id'])||_0x3768b6['has'](_0xa579a8['id']))throw kbError(_0x5da6e0(0x1bf),_0x5da6e0(0x1b1)+String(_0xa579a8['id'])+'.');_0x3768b6[_0x5da6e0(0x1a9)](_0xa579a8['id']),_0xa579a8[_0x5da6e0(0x185)]===_0x5da6e0(0x1d1)&&_0xa579a8[_0x5da6e0(0x189)]===_0x4dfc60['appCode']&&_0x125535[_0x5da6e0(0x1c8)](_0xa579a8);}_0x4bb460+=_0x54a63d['items'][_0x5da6e0(0x1d8)];if(_0x101490!==undefined&&_0x4bb460>=_0x101490)break;if(_0x54a63d['items'][_0x5da6e0(0x1d8)]<LIST_PAGE_SIZE){if(_0x101490!==undefined&&_0x4bb460<_0x101490)throw kbError(_0x5da6e0(0x1bf),_0x5da6e0(0x1ae)+_0x4bb460+'\x20of\x20'+_0x101490+_0x5da6e0(0x1bc));break;}_0x1ff1c1+=0x1;}return _0x125535;}export function findExactCompanyKnowledgeBases(_0x5b2569,_0x11cfc9,_0x3d5335){const _0x5471d4=a158_0x21e163;return _0x5b2569[_0x5471d4(0x196)](_0xc9ae2f=>_0xc9ae2f['scope']==='company'&&_0xc9ae2f['appCode']===_0x11cfc9&&_0xc9ae2f[_0x5471d4(0x181)]===_0x3d5335);}export async function getKbOrNull(_0x3b3ab7,_0x312f94){const _0x3a3317=a158_0x21e163;try{const _0x2fe121=await getEnterpriseKnowledgeBase(_0x3b3ab7[_0x3a3317(0x1cd)],_0x312f94);return assertCompanyKnowledgeBase(_0x2fe121,_0x3b3ab7['appCode'],_0x312f94),_0x2fe121;}catch(_0x4ef135){if(getPlatformErrorCode(_0x4ef135)===DATA_NOT_EXIST_ERROR_CODE)return null;throw _0x4ef135;}}export async function requireKb(_0x65d1fb,_0x4ede75){const _0x3e7f30=a158_0x21e163,_0x246ee3=await getKbOrNull(_0x65d1fb,_0x4ede75);if(!_0x246ee3)throw kbError(_0x3e7f30(0x1be),_0x3e7f30(0x1aa)+_0x4ede75,_0x3e7f30(0x19b));return _0x246ee3;}export function assertExpectedKbVersion(_0x3f6888,_0x237b79){const _0x10c7e8=a158_0x21e163;if(_0x237b79===undefined||_0x3f6888[_0x10c7e8(0x18d)]===_0x237b79)return;throw kbError('kb_state_drift',_0x10c7e8(0x1cb)+_0x3f6888['id']+_0x10c7e8(0x1bb)+_0x237b79+_0x10c7e8(0x19f)+_0x3f6888[_0x10c7e8(0x18d)]+'.','Run\x20the\x20command\x20with\x20--dry-run\x20again\x20and\x20review\x20the\x20latest\x20version\x20before\x20retrying.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a159_0x108990=a159_0x2f96;(function(_0xe24d4,_0x55f0e1){const _0x42deef=a159_0x2f96,_0x489448=_0xe24d4();while(!![]){try{const _0x1a5fde=parseInt(_0x42deef(0x127))/0x1*(parseInt(_0x42deef(0x107))/0x2)+parseInt(_0x42deef(0x11f))/0x3*(parseInt(_0x42deef(0x115))/0x4)+-parseInt(_0x42deef(0x121))/0x5+parseInt(_0x42deef(0x111))/0x6+parseInt(_0x42deef(0x120))/0x7+-parseInt(_0x42deef(0x13a))/0x8+-parseInt(_0x42deef(0x117))/0x9;if(_0x1a5fde===_0x55f0e1)break;else _0x489448['push'](_0x489448['shift']());}catch(_0x440464){_0x489448['push'](_0x489448['shift']());}}}(a159_0x5e6e,0x21dd3));function a159_0x2f96(_0x3c2e6c,_0x47d569){_0x3c2e6c=_0x3c2e6c-0x106;const _0x5e6ee0=a159_0x5e6e();let _0x2f9641=_0x5e6ee0[_0x3c2e6c];return _0x2f9641;}import{isPlatformTransportFailure,updateEnterpriseKnowledgeBase}from'../../core/api-client.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCompanyKnowledgeBase,assertExpectedKbVersion,inspectKbContent,kbError,projectKb,readKbFile,readKbId,requireKb,verifyKbMutationReadback}from'../../commands/kb/shared.js';const UPDATE_PATH=a159_0x108990(0x126),NON_ATOMIC_WARNING='--expected-version\x20is\x20a\x20non-atomic\x20read-before-write\x20assertion;\x20the\x20server\x20update\x20contract\x20has\x20no\x20version\x20predicate.';function readUpdatePatch(_0x4355ae){const _0x1c0c46=a159_0x108990,_0xc975d5=readKbId(_0x4355ae),_0x2fcd4a=_0x4355ae[_0x1c0c46(0x11c)]('title'),_0x4043d0=_0x4355ae[_0x1c0c46(0x11c)](_0x1c0c46(0x132)),_0x391e09=_0x4355ae['flag']('expected-version'),_0x4d0369=_0x2fcd4a===undefined?undefined:String(_0x2fcd4a)[_0x1c0c46(0x12f)]();if(_0x2fcd4a!==undefined&&!_0x4d0369)throw kbError(_0x1c0c46(0x135),_0x1c0c46(0x106));const _0xf4cd18=_0x4043d0===undefined?undefined:String(_0x4043d0)[_0x1c0c46(0x12f)]();if(_0x4043d0!==undefined&&!_0xf4cd18)throw kbError(_0x1c0c46(0x134),_0x1c0c46(0x109));if(_0x4d0369===undefined&&_0xf4cd18===undefined)throw kbError(_0x1c0c46(0x11d),'Nothing\x20to\x20update.',_0x1c0c46(0x12d));let _0x229253;if(_0x391e09!==undefined){_0x229253=Number(_0x391e09);if(!Number[_0x1c0c46(0x10d)](_0x229253)||_0x229253<0x0)throw kbError('kb_expected_version_invalid',_0x1c0c46(0x12b));}return{'id':_0xc975d5,'title':_0x4d0369,'file':_0xf4cd18,'expectedVersion':_0x229253};}function a159_0x5e6e(){const _0x40dec3=['1413896bbqSNP','snapshotHash','\x20does\x20not\x20prove\x20the\x20requested\x20update\x20state.','--title\x20cannot\x20be\x20empty.','15856nJOSFX','POST','--file\x20cannot\x20be\x20empty.','rabetbase\x20kb\x20detail\x20--id\x20','company','Replacement\x20UTF-8\x20text\x20or\x20Markdown\x20content\x20file','isSafeInteger','\x20--format\x20compress`;\x20do\x20not\x20resubmit\x20automatically.','push','\x20--format\x20compress','790548PUbRWY','version','before','Update\x20a\x20company\x20knowledge\x20base\x20with\x20preflight\x20drift\x20protection','20428jKDlhz','content','2460069LWxbYR','string','Updated\x20company\x20knowledge\x20base\x20','appCode','verified','flag','kb_update_empty','update','123zCKZyQ','1778756VuoukJ','428740YgZvzP','Non-atomic\x20preflight\x20assertion\x20for\x20the\x20current\x20version','cookie','beforeRecord','kb_verification_failed','/admin/knowledge-base/update','10WwRWxH','Company\x20knowledge-base\x20id','expectedVersion','Company\x20knowledge\x20base\x20','--expected-version\x20must\x20be\x20a\x20non-negative\x20safe\x20integer.','kb_update_outcome_unknown','Pass\x20at\x20least\x20one\x20of\x20--title\x20or\x20--file.','replacement','trim','number','Update\x20response\x20was\x20unavailable;\x20verified\x20applicable\x20postconditions\x20by\x20exact\x20ID\x20without\x20resubmitting.','file','title','kb_file_required','kb_title_invalid','expected-version','Inspect\x20it\x20with\x20`rabetbase\x20kb\x20detail\x20--id\x20','patch','contentHash'];a159_0x5e6e=function(){return _0x40dec3;};return a159_0x5e6e();}async function prepareUpdate(_0x5e3c54){const _0xca786=a159_0x108990,_0x2a78f9=readUpdatePatch(_0x5e3c54),_0x25c43c=await requireKb(_0x5e3c54,_0x2a78f9['id']);assertExpectedKbVersion(_0x25c43c,_0x2a78f9[_0xca786(0x129)]);const _0x1c0ec6=_0x2a78f9[_0xca786(0x132)]?await readKbFile(_0x2a78f9[_0xca786(0x132)]):undefined,_0x249535=projectKb(_0x25c43c),_0x50d63d=projectKb({..._0x25c43c,..._0x2a78f9[_0xca786(0x133)]!==undefined?{'title':_0x2a78f9['title']}:{},..._0x1c0ec6?{'content':_0x1c0ec6[_0xca786(0x116)]}:{}});return{'patch':_0x2a78f9,'beforeRecord':_0x25c43c,'before':_0x249535,'planned':_0x50d63d,'replacement':_0x1c0ec6};}export const kbUpdate={'service':'kb','command':a159_0x108990(0x11e),'description':a159_0x108990(0x114),'risk':'write','requiresAppCode':!![],'structuredErrors':!![],'flags':[{'name':'id','type':a159_0x108990(0x130),'required':!![],'description':a159_0x108990(0x128)},{'name':a159_0x108990(0x133),'type':a159_0x108990(0x118),'required':![],'description':'New\x20knowledge-base\x20title'},{'name':a159_0x108990(0x132),'type':'string','required':![],'description':a159_0x108990(0x10c)},{'name':a159_0x108990(0x136),'type':a159_0x108990(0x130),'required':![],'description':a159_0x108990(0x122)}],async 'validate'(_0x32ef82){readUpdatePatch(_0x32ef82);},async 'dryRun'(_0x4367a2){const _0x45fa3e=a159_0x108990,_0x490809=await prepareUpdate(_0x4367a2),_0x29b5ca=_0x490809[_0x45fa3e(0x138)][_0x45fa3e(0x129)]!==undefined?[NON_ATOMIC_WARNING]:[];return asDryRunResult({'operation':_0x45fa3e(0x11e),'selector':{'id':_0x490809[_0x45fa3e(0x113)]['id'],'scope':_0x45fa3e(0x10b),'appCode':_0x490809[_0x45fa3e(0x113)]['appCode']},'before':_0x490809[_0x45fa3e(0x113)],'after':_0x490809['planned'],'dryRun':!![],'backend':{'method':_0x45fa3e(0x108),'path':UPDATE_PATH},'warnings':_0x29b5ca,'verification':{'expectedVersion':_0x490809[_0x45fa3e(0x138)]['expectedVersion']??null,'atomicCompareAndSet':![],'plannedSnapshotHash':_0x490809['before'][_0x45fa3e(0x13b)],'lookupCommand':'rabetbase\x20kb\x20detail\x20--id\x20'+_0x490809[_0x45fa3e(0x113)]['id']+'\x20--format\x20compress'}},{'method':_0x45fa3e(0x108),'url':UPDATE_PATH});},async 'execute'(_0x421181){const _0x4bcd67=a159_0x108990,_0x2df800=await prepareUpdate(_0x421181),_0x2a05cf={'id':_0x2df800[_0x4bcd67(0x138)]['id'],..._0x2df800['patch'][_0x4bcd67(0x133)]!==undefined?{'title':_0x2df800[_0x4bcd67(0x138)][_0x4bcd67(0x133)]}:{},..._0x2df800['replacement']?{'content':_0x2df800['replacement'][_0x4bcd67(0x116)]}:{}};let _0x5c7d32=![];try{const _0x3634c2=await updateEnterpriseKnowledgeBase(_0x421181[_0x4bcd67(0x123)],_0x2a05cf);assertCompanyKnowledgeBase(_0x3634c2,_0x421181['appCode'],_0x2df800[_0x4bcd67(0x138)]['id']);}catch(_0x19b44a){if(!isPlatformTransportFailure(_0x19b44a))throw _0x19b44a;_0x5c7d32=!![];}const _0x3dccd4=await verifyKbMutationReadback('update',_0x5c7d32,()=>requireKb(_0x421181,_0x2df800[_0x4bcd67(0x138)]['id'])),_0x11325b=projectKb(_0x3dccd4),_0x1cbe96=_0x2df800[_0x4bcd67(0x138)][_0x4bcd67(0x133)]===undefined||_0x3dccd4[_0x4bcd67(0x133)]===_0x2df800[_0x4bcd67(0x138)][_0x4bcd67(0x133)],_0x5118fe=!_0x2df800[_0x4bcd67(0x12e)]||inspectKbContent(_0x3dccd4[_0x4bcd67(0x116)])[_0x4bcd67(0x139)]===_0x2df800['replacement'][_0x4bcd67(0x139)],_0x3506d9=!_0x2df800[_0x4bcd67(0x12e)]||_0x3dccd4[_0x4bcd67(0x112)]>_0x2df800[_0x4bcd67(0x124)]['version'],_0x36e80b=!_0x5c7d32||_0x2df800[_0x4bcd67(0x12e)]!==undefined||_0x2df800[_0x4bcd67(0x138)][_0x4bcd67(0x133)]===undefined||_0x2df800[_0x4bcd67(0x124)]['title']!==_0x2df800[_0x4bcd67(0x138)][_0x4bcd67(0x133)];if(!_0x1cbe96||!_0x5118fe||!_0x3506d9||!_0x36e80b)throw kbError(_0x5c7d32?_0x4bcd67(0x12c):_0x4bcd67(0x125),_0x4bcd67(0x12a)+_0x2df800['patch']['id']+_0x4bcd67(0x13c),_0x4bcd67(0x137)+_0x2df800[_0x4bcd67(0x138)]['id']+_0x4bcd67(0x10e));const _0x2e98fc=[];return _0x2df800[_0x4bcd67(0x138)][_0x4bcd67(0x129)]!==undefined&&_0x2e98fc[_0x4bcd67(0x10f)](NON_ATOMIC_WARNING),_0x5c7d32&&_0x2e98fc[_0x4bcd67(0x10f)](_0x4bcd67(0x131)),{'ok':!![],'data':{'operation':_0x4bcd67(0x11e),'selector':{'id':_0x11325b['id'],'scope':_0x4bcd67(0x10b),'appCode':_0x11325b[_0x4bcd67(0x11a)]},'before':_0x2df800[_0x4bcd67(0x113)],'after':_0x11325b,'dryRun':![],'backend':{'method':'POST','path':UPDATE_PATH},'warnings':_0x2e98fc,'verification':{'status':_0x4bcd67(0x11b),'recoveredAfterUnknownResponse':_0x5c7d32,'expectedVersion':_0x2df800['patch'][_0x4bcd67(0x129)]??null,'atomicCompareAndSet':![],'lookupCommand':_0x4bcd67(0x10a)+_0x11325b['id']+_0x4bcd67(0x110)}},'message':_0x4bcd67(0x119)+_0x11325b['id']};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a160_0xbd4127=a160_0x52c9;(function(_0x449734,_0x5ded06){const _0x406b3f=a160_0x52c9,_0x4b00b6=_0x449734();while(!![]){try{const _0x2f9a4e=-parseInt(_0x406b3f(0x83))/0x1*(parseInt(_0x406b3f(0x8b))/0x2)+-parseInt(_0x406b3f(0x9c))/0x3+-parseInt(_0x406b3f(0x99))/0x4*(parseInt(_0x406b3f(0xa2))/0x5)+parseInt(_0x406b3f(0x94))/0x6*(-parseInt(_0x406b3f(0x81))/0x7)+parseInt(_0x406b3f(0x8a))/0x8*(-parseInt(_0x406b3f(0x9e))/0x9)+-parseInt(_0x406b3f(0x8f))/0xa*(parseInt(_0x406b3f(0x96))/0xb)+-parseInt(_0x406b3f(0xa1))/0xc*(-parseInt(_0x406b3f(0x86))/0xd);if(_0x2f9a4e===_0x5ded06)break;else _0x4b00b6['push'](_0x4b00b6['shift']());}catch(_0x3425fd){_0x4b00b6['push'](_0x4b00b6['shift']());}}}(a160_0x96fd,0x908bf));import{logger}from'../../utils/logger.js';function printLogs(_0x532013){const _0x549468=a160_0x52c9;if(_0x532013[_0x549468(0x8d)]===0x0){console['log'](_0x549468(0x8c));return;}console[_0x549468(0x97)](_0x549468(0x90)),_0x532013['forEach']((_0x401a43,_0x530007)=>{const _0xa46218=_0x549468,_0x2d7657=new Date(_0x401a43[_0xa46218(0x88)])[_0xa46218(0x9b)](_0xa46218(0x9a)),_0x4f1c7f=_0x401a43[_0xa46218(0x80)]===_0xa46218(0x85)?'√':_0x401a43[_0xa46218(0x80)]===_0xa46218(0x9f)?'×':_0x401a43[_0xa46218(0x80)]===_0xa46218(0x8e)?'!':'i';console[_0xa46218(0x97)](_0x530007+0x1+'.\x20'+_0x4f1c7f+'\x20['+_0x401a43['command']+']\x20'+_0x401a43[_0xa46218(0x7e)]),console['log'](_0xa46218(0x91)+_0x2d7657),_0x401a43[_0xa46218(0x89)]&&console[_0xa46218(0x97)]('\x20\x20\x20Duration:\x20'+_0x401a43['duration']+'ms'),_0x401a43['details']&&Object[_0xa46218(0x95)](_0x401a43[_0xa46218(0x98)])['length']>0x0&&console[_0xa46218(0x97)](_0xa46218(0x82)+JSON[_0xa46218(0x87)](_0x401a43[_0xa46218(0x98)],null,0x2)),console[_0xa46218(0x97)]('');});}export const logsDefinitions=[{'service':a160_0xbd4127(0x84),'command':a160_0xbd4127(0x9d),'description':'View\x20command\x20history\x20logs','risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x3f65a9){const _0x50060a=a160_0xbd4127;return printLogs(logger[_0x50060a(0x92)]()),{'ok':!![]};}},{'service':a160_0xbd4127(0x84),'command':'clear','description':a160_0xbd4127(0x7f),'risk':a160_0xbd4127(0xa0),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x3ef523){const _0x3cdc5f=a160_0xbd4127;return logger['clearLogs'](),console[_0x3cdc5f(0x97)](_0x3cdc5f(0x93)),{'ok':!![]};}}];function a160_0x52c9(_0x58f416,_0xe4f1c3){_0x58f416=_0x58f416-0x7e;const _0x96fd01=a160_0x96fd();let _0x52c982=_0x96fd01[_0x58f416];return _0x52c982;}function a160_0x96fd(){const _0x1c8829=['details','25876PFaQQe','en-US','toLocaleString','647769FKsTfZ','show','324UeWrjl','error','write','42110844iCQOJi','800zWnQFG','message','Clear\x20command\x20history\x20logs','level','45941dDDRrp','\x20\x20\x20Details:\x20','3507zTWOQL','logs','success','13OxtcAD','stringify','timestamp','duration','137032AlMpgb','2NCKuye','*\x20No\x20logs\x20found','length','warn','3464990VTwvNv','*\x20Lovrabet\x20CLI\x20logs:\x0a','\x20\x20\x20Time:\x20','readLogs','*\x20Logs\x20cleared','6UWuMlD','keys','33offqBh','log'];a160_0x96fd=function(){return _0x1c8829;};return a160_0x96fd();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a151_0x4f39c4=a151_0x5efd;(function(_0x186912,_0x54a41f){const _0x5db5a6=a151_0x5efd,_0x1855ca=_0x186912();while(!![]){try{const _0xcea1bf=-parseInt(_0x5db5a6(0x1b6))/0x1+-parseInt(_0x5db5a6(0x1dd))/0x2*(parseInt(_0x5db5a6(0x1bd))/0x3)+-parseInt(_0x5db5a6(0x1b1))/0x4+-parseInt(_0x5db5a6(0x18b))/0x5*(-parseInt(_0x5db5a6(0x1a9))/0x6)+-parseInt(_0x5db5a6(0x1a2))/0x7*(-parseInt(_0x5db5a6(0x1a4))/0x8)+parseInt(_0x5db5a6(0x18e))/0x9+parseInt(_0x5db5a6(0x19b))/0xa*(parseInt(_0x5db5a6(0x199))/0xb);if(_0xcea1bf===_0x54a41f)break;else _0x1855ca['push'](_0x1855ca['shift']());}catch(_0x1bcd27){_0x1855ca['push'](_0x1855ca['shift']());}}}(a151_0x1fd4,0xb8b79));import a151_0x1a04f8 from'chalk';import{filterMenusWithResources,fetchOnlineMenuList}from'../../commands/menu/shared/logic.js';import{renderUpdateSummary}from'../../commands/menu/shared/compare-table.js';import{askJsUrl,askCssUrl,askConfirm,startSpinner,stopSpinner,requireInteractive}from'../../commands/menu/shared/inquirer.js';import{CliErrors}from'../../errors.js';function a151_0x1fd4(){const _0x29631f=['paths','--menu-ids\x20must\x20contain\x20positive\x20safe\x20integers.','Update\x20CDN\x20asset\x20URLs\x20for\x20selected\x20online\x20menus\x20with\x20existing\x20resources','map','cookie','validation','Pre-fill\x20JS/CSS\x20URLs\x20to\x20update.\x20','failed','asset-update','\x20updated,\x20','Would\x20update\x20','yellow','load-mode','appCode','all','\x20\x20!\x20No\x20menus\x20with\x20existing\x20resources\x20found','--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.','Invalid\x20--mode.\x20Allowed\x20values:\x20replace,\x20patch','fetch','Exact\x20comma-separated\x20menu\x20paths\x20to\x20update','✓\x20Menu\x20asset\x20update\x20completed:\x20','rawFlags','\x20menu(s)...','Allow\x20replace\x20mode\x20to\x20remove\x20existing\x20JS\x20resources','filter','JSON:\x20{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}','Resource\x20update\x20mode:\x20replace\x20rewrites\x20resources\x20from\x20supplied\x20URLs;\x20','replace','boolean','parse','split','18CQdigu','params','message','Run\x20inside\x20a\x20directory\x20with\x20.rabetbase.json,\x20or\x20pass\x20--appcode\x20<code>.','string','isArray','Failed\x20to\x20fetch\x20online\x20menu\x20list','5tijYma','label','\x20\x20Cancelled.','448038tTqKBX','import','\x20failed.','force','gray','length','\x20\x20Found\x20','\x20menu(s)\x20failed','\x20updated.','trim','bool','77pqezdp','mode','712370LkASwX','menu-ids','Menu\x20asset\x20update\x20skipped','isSafeInteger','Fetching\x20online\x20menu\x20list...','menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.','\x20menu\x20resource\x20set(s).','3073ADOeSn','Invalid\x20--load-mode.\x20Allowed\x20values:\x20import,\x20script,\x20fetch','19768ImXdxq','patch\x20replaces\x20a\x20supplied\x20type\x20only\x20when\x20the\x20existing\x20target\x20is\x20unambiguous','\x20menu(s)\x20updated','skipped','appcode','751254eRfcdk','Explicitly\x20change\x20the\x20microfrontend\x20resource\x20loading\x20mode','cssUrl','str','patch','\x20menu(s)','jsUrl','\x20menu(s)\x20with\x20JS:\x20','83244DkjmjM','updated','menu','Menu\x20asset\x20update\x20completed:\x20','selectedAppName','670660eNmsKr','cyan','!\x20No\x20menus\x20with\x20existing\x20resources\x20found','Menu\x20asset\x20update\x20failed','Updated\x20','Explicitly\x20update\x20every\x20menu\x20that\x20has\x20resources','script','103449kJSEkR'];a151_0x1fd4=function(){return _0x29631f;};return a151_0x1fd4();}import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';import{runMenuUpdateCore}from'../../commands/menu/shared/update-core.js';import{selectMenusForUpdate}from'../../commands/menu/shared/update-core.js';import{isInProject}from'../../context.js';function a151_0x5efd(_0x5c7db1,_0x576a6e){_0x5c7db1=_0x5c7db1-0x187;const _0x1fd4d=a151_0x1fd4();let _0x5efd9a=_0x1fd4d[_0x5c7db1];return _0x5efd9a;}export const menuAssetUpdate={'service':a151_0x4f39c4(0x1b3),'command':a151_0x4f39c4(0x1c6),'description':a151_0x4f39c4(0x1c0),'risk':'write','flags':[{'name':a151_0x4f39c4(0x1de),'type':a151_0x4f39c4(0x188),'description':a151_0x4f39c4(0x1c4)+a151_0x4f39c4(0x1d7)},{'name':'mode','type':a151_0x4f39c4(0x188),'description':a151_0x4f39c4(0x1d8)+a151_0x4f39c4(0x1a5),'enum':['replace','patch'],'default':a151_0x4f39c4(0x1ad)},{'name':a151_0x4f39c4(0x191),'type':a151_0x4f39c4(0x1da),'description':a151_0x4f39c4(0x1d5)},{'name':a151_0x4f39c4(0x19c),'type':a151_0x4f39c4(0x188),'description':'Exact\x20comma-separated\x20menu\x20IDs\x20to\x20update'},{'name':a151_0x4f39c4(0x1be),'type':a151_0x4f39c4(0x188),'description':a151_0x4f39c4(0x1d1)},{'name':'all','type':a151_0x4f39c4(0x1da),'description':a151_0x4f39c4(0x1bb)},{'name':a151_0x4f39c4(0x1ca),'type':a151_0x4f39c4(0x188),'enum':[a151_0x4f39c4(0x18f),a151_0x4f39c4(0x1bc),a151_0x4f39c4(0x1d0)],'description':a151_0x4f39c4(0x1aa)}],async 'dryRun'(_0x4f315b){const _0x3e803e=a151_0x4f39c4;ensureRunnableContext(_0x4f315b[_0x3e803e(0x1d3)],_0x4f315b[_0x3e803e(0x1b5)]);const _0x458993=await runMenuUpdateCore(_0x4f315b[_0x3e803e(0x1cb)],_0x4f315b[_0x3e803e(0x1c2)],_0x4f315b[_0x3e803e(0x1ac)]('params'),{'mode':parseMode(_0x4f315b[_0x3e803e(0x1ac)](_0x3e803e(0x19a))),'dryRun':!![],'force':_0x4f315b[_0x3e803e(0x198)](_0x3e803e(0x191)),'selection':parseSelection(_0x4f315b),'loadScriptMode':parseLoadScriptMode(_0x4f315b[_0x3e803e(0x1ac)]('load-mode'))});return{'method':'POST','url':'/smartapi/menu/update','body':_0x458993,'description':_0x458993['skipped']?'No\x20menus\x20with\x20existing\x20resources\x20would\x20be\x20updated.':_0x3e803e(0x1c8)+(_0x458993['diffs']?.['length']??0x0)+_0x3e803e(0x1a1)};},async 'execute'(_0x5e7936){const _0x1c9827=a151_0x4f39c4;ensureRunnableContext(_0x5e7936[_0x1c9827(0x1d3)],_0x5e7936[_0x1c9827(0x1b5)]);const _0x4d305e=_0x5e7936[_0x1c9827(0x1ac)]('params'),_0x5243ea=parseMode(_0x5e7936['str'](_0x1c9827(0x19a))),_0x45efa9=_0x5e7936[_0x1c9827(0x198)](_0x1c9827(0x191)),_0x3148de=parseLoadScriptMode(_0x5e7936['str']('load-mode')),_0x38c04c=parseParams(_0x4d305e),_0x22b234=!!(_0x38c04c['jsUrl']||_0x38c04c[_0x1c9827(0x1ab)]);if(_0x22b234){const _0x551926=await runMenuUpdateCore(_0x5e7936[_0x1c9827(0x1cb)],_0x5e7936['cookie'],_0x4d305e,{'mode':_0x5243ea,'force':_0x45efa9,'selection':parseSelection(_0x5e7936),'loadScriptMode':_0x3148de});return _0x551926[_0x1c9827(0x1a7)]?writeCliSideChannelLine(_0x1c9827(0x1b8)):(writeCliSideChannelLine(_0x1c9827(0x1d2)+_0x551926[_0x1c9827(0x1b2)]+_0x1c9827(0x1a6)),_0x551926[_0x1c9827(0x1c5)]>0x0&&writeCliSideChannelLine('!\x20'+_0x551926[_0x1c9827(0x1c5)]+_0x1c9827(0x195))),{'ok':_0x551926[_0x1c9827(0x1c5)]===0x0,'data':_0x551926,'message':_0x551926[_0x1c9827(0x1a7)]?_0x1c9827(0x19d):_0x1c9827(0x1b4)+_0x551926[_0x1c9827(0x1b2)]+_0x1c9827(0x1c7)+_0x551926['failed']+_0x1c9827(0x190)};}requireInteractive();const _0x1bba9b=startSpinner(_0x1c9827(0x19f));let _0x5d046b;try{_0x5d046b=await fetchOnlineMenuList(_0x5e7936[_0x1c9827(0x1cb)],_0x5e7936[_0x1c9827(0x1c2)]),stopSpinner(_0x1bba9b,'Online\x20menu\x20list\x20fetched',!![]);}catch(_0x436f87){stopSpinner(_0x1bba9b,_0x1c9827(0x18a),![]);throw CliErrors[_0x1c9827(0x1c3)](_0x436f87 instanceof Error?_0x436f87[_0x1c9827(0x1df)]:'Failed\x20to\x20fetch\x20online\x20menu\x20list');}const _0xd4974e=filterMenusWithResources(_0x5d046b),_0x45a0a5=parseSelection(_0x5e7936,![]),_0x449f9f=_0x45a0a5?selectMenusForUpdate(_0xd4974e,_0x45a0a5):_0xd4974e;if(_0x449f9f[_0x1c9827(0x193)]===0x0)return writeCliSideChannelLine(a151_0x1a04f8[_0x1c9827(0x1c9)](_0x1c9827(0x1cd))),{'ok':!![]};writeCliSideChannelLine(''),writeCliSideChannelLine(a151_0x1a04f8[_0x1c9827(0x1b7)](_0x1c9827(0x194)+_0x449f9f[_0x1c9827(0x193)]+'\x20menu(s)\x20with\x20existing\x20resources')),writeCliSideChannelLine(renderUpdateSummary(_0x449f9f[_0x1c9827(0x1c1)](_0x2f5be7=>_0x2f5be7[_0x1c9827(0x18c)]),[_0x38c04c[_0x1c9827(0x1af)],_0x38c04c[_0x1c9827(0x1ab)]])),writeCliSideChannelLine('');let _0x256d39=_0x38c04c['jsUrl'],_0x4ec34b=_0x38c04c[_0x1c9827(0x1ab)];!_0x256d39&&(_0x256d39=await askJsUrl());!_0x4ec34b&&(_0x4ec34b=await askCssUrl());const _0x140797=await askConfirm('\x20\x20Update\x20'+_0x449f9f[_0x1c9827(0x193)]+_0x1c9827(0x1b0)+_0x256d39+'\x20and\x20CSS:\x20'+_0x4ec34b+'?');if(!_0x140797)return writeCliSideChannelLine(a151_0x1a04f8[_0x1c9827(0x192)](_0x1c9827(0x18d))),{'ok':!![]};const _0x5466ca=startSpinner('Updating\x20'+_0x449f9f[_0x1c9827(0x193)]+_0x1c9827(0x1d4));try{const _0x3887bb=await runMenuUpdateCore(_0x5e7936[_0x1c9827(0x1cb)],_0x5e7936[_0x1c9827(0x1c2)],JSON['stringify']({'jsUrl':_0x256d39,'cssUrl':_0x4ec34b}),{'mode':_0x5243ea,'force':_0x45efa9,'selection':{'all':![],'menuIds':_0x449f9f['map'](_0xf2a644=>_0xf2a644['id']),'paths':[]},'loadScriptMode':_0x3148de});return stopSpinner(_0x5466ca,_0x1c9827(0x1ba)+_0x3887bb[_0x1c9827(0x1b2)]+_0x1c9827(0x1ae),_0x3887bb['failed']===0x0),{'ok':_0x3887bb[_0x1c9827(0x1c5)]===0x0,'data':_0x3887bb,'message':_0x3887bb[_0x1c9827(0x1c5)]>0x0?_0x1c9827(0x1b4)+_0x3887bb[_0x1c9827(0x1b2)]+_0x1c9827(0x1c7)+_0x3887bb[_0x1c9827(0x1c5)]+_0x1c9827(0x190):'Menu\x20asset\x20update\x20completed:\x20'+_0x3887bb[_0x1c9827(0x1b2)]+_0x1c9827(0x196)};}catch(_0x187b95){stopSpinner(_0x5466ca,_0x1c9827(0x1b9),![]);throw CliErrors[_0x1c9827(0x1c3)](_0x187b95 instanceof Error?_0x187b95['message']:_0x1c9827(0x1b9));}}};function ensureRunnableContext(_0x1ff711,_0x4a88ea){const _0x2dd6bd=a151_0x4f39c4,_0x1bdb66=_0x1ff711[_0x2dd6bd(0x1a8)]?String(_0x1ff711[_0x2dd6bd(0x1a8)])[_0x2dd6bd(0x197)]():'';if(!isInProject()&&!_0x4a88ea&&!_0x1bdb66)throw CliErrors[_0x2dd6bd(0x1c3)]('menu\x20asset-update\x20requires\x20a\x20project\x20context\x20or\x20explicit\x20--appcode.\x20'+_0x2dd6bd(0x187));}function parseMode(_0x505e25){const _0x50ebd3=a151_0x4f39c4;if(!_0x505e25)return _0x50ebd3(0x1ad);if(_0x505e25===_0x50ebd3(0x1d9)||_0x505e25===_0x50ebd3(0x1ad))return _0x505e25;throw CliErrors[_0x50ebd3(0x1c3)](_0x50ebd3(0x1cf));}function parseSelection(_0x581bde,_0x3e7f0c=!![]){const _0x3180f4=a151_0x4f39c4,_0x58a94b=_0x581bde[_0x3180f4(0x198)](_0x3180f4(0x1cc)),_0x4d7cbf=parseMenuIds(_0x581bde[_0x3180f4(0x1ac)]('menu-ids')),_0x1acfc0=parseCsv(_0x581bde[_0x3180f4(0x1ac)]('paths')),_0x248af8=_0x4d7cbf['length']>0x0||_0x1acfc0[_0x3180f4(0x193)]>0x0;if(_0x58a94b&&_0x248af8)throw CliErrors['validation'](_0x3180f4(0x1ce));if(!_0x58a94b&&!_0x248af8){if(!_0x3e7f0c)return undefined;throw CliErrors[_0x3180f4(0x1c3)](_0x3180f4(0x1a0));}return{'all':_0x58a94b,'menuIds':_0x4d7cbf,'paths':_0x1acfc0};}function parseMenuIds(_0x942139){const _0x5a462b=a151_0x4f39c4,_0x19cbdb=parseCsv(_0x942139),_0x58db3d=_0x19cbdb[_0x5a462b(0x1c1)](Number);if(_0x58db3d['some'](_0x59cb74=>!Number[_0x5a462b(0x19e)](_0x59cb74)||_0x59cb74<=0x0))throw CliErrors[_0x5a462b(0x1c3)](_0x5a462b(0x1bf));return[...new Set(_0x58db3d)];}function parseCsv(_0x1c848a){const _0xfe7f71=a151_0x4f39c4;return[...new Set(_0x1c848a[_0xfe7f71(0x1dc)](',')[_0xfe7f71(0x1c1)](_0x508f53=>_0x508f53[_0xfe7f71(0x197)]())[_0xfe7f71(0x1d6)](Boolean))];}function parseLoadScriptMode(_0x3e47b8){const _0xe6c2a4=a151_0x4f39c4;if(!_0x3e47b8)return undefined;if(_0x3e47b8===_0xe6c2a4(0x18f)||_0x3e47b8===_0xe6c2a4(0x1bc)||_0x3e47b8===_0xe6c2a4(0x1d0))return _0x3e47b8;throw CliErrors[_0xe6c2a4(0x1c3)](_0xe6c2a4(0x1a3));}function parseParams(_0x495aad){const _0x37f686=a151_0x4f39c4;if(!_0x495aad)return{};try{const _0x5cf3ed=JSON[_0x37f686(0x1db)](_0x495aad);if(typeof _0x5cf3ed!=='object'||_0x5cf3ed===null||Array[_0x37f686(0x189)](_0x5cf3ed))return{};return{'jsUrl':typeof _0x5cf3ed[_0x37f686(0x1af)]==='string'?_0x5cf3ed['jsUrl'][_0x37f686(0x197)]():undefined,'cssUrl':typeof _0x5cf3ed[_0x37f686(0x1ab)]==='string'?_0x5cf3ed[_0x37f686(0x1ab)][_0x37f686(0x197)]():undefined};}catch{return{};}}
|
|
1
|
+
const a161_0x51f7d5=a161_0x4d7b;(function(_0x5c3d84,_0x555975){const _0x3efa7f=a161_0x4d7b,_0xcc9573=_0x5c3d84();while(!![]){try{const _0x154550=parseInt(_0x3efa7f(0x1e6))/0x1+parseInt(_0x3efa7f(0x1b1))/0x2*(parseInt(_0x3efa7f(0x19f))/0x3)+parseInt(_0x3efa7f(0x1ad))/0x4+-parseInt(_0x3efa7f(0x1b0))/0x5*(-parseInt(_0x3efa7f(0x1e2))/0x6)+-parseInt(_0x3efa7f(0x1e9))/0x7+parseInt(_0x3efa7f(0x1dd))/0x8*(parseInt(_0x3efa7f(0x1a9))/0x9)+-parseInt(_0x3efa7f(0x1bd))/0xa;if(_0x154550===_0x555975)break;else _0xcc9573['push'](_0xcc9573['shift']());}catch(_0x379fc1){_0xcc9573['push'](_0xcc9573['shift']());}}}(a161_0x3a1c,0x80dd5));function a161_0x3a1c(){const _0xab1c88=['gray','\x20menu(s)\x20with\x20JS:\x20','No\x20menus\x20with\x20existing\x20resources\x20would\x20be\x20updated.','Exact\x20comma-separated\x20menu\x20paths\x20to\x20update','Fetching\x20online\x20menu\x20list...','Run\x20inside\x20a\x20directory\x20with\x20.rabetbase.json,\x20or\x20pass\x20--appcode\x20<code>.','script','some','5622tMowcc','JSON:\x20{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}','\x20menu(s)','skipped','Allow\x20replace\x20mode\x20to\x20remove\x20existing\x20JS\x20resources','import','\x20menu(s)\x20with\x20existing\x20resources','Explicitly\x20change\x20the\x20microfrontend\x20resource\x20loading\x20mode','Pre-fill\x20JS/CSS\x20URLs\x20to\x20update.\x20','--menu-ids\x20must\x20contain\x20positive\x20safe\x20integers.','44568LtYHkh','validation','force','params','2133292edXRoa','\x20menu(s)...','all','5226155ZNbUgw','36gabOWV','stringify','trim','failed','\x20menu(s)\x20updated','menu','filter','\x20and\x20CSS:\x20','menu\x20asset-update\x20requires\x20a\x20project\x20context\x20or\x20explicit\x20--appcode.\x20','load-mode','diffs','length','21498890OcmEMa','selectedAppName','parse','\x20failed.','label','bool','/smartapi/menu/update','Menu\x20asset\x20update\x20failed','Failed\x20to\x20fetch\x20online\x20menu\x20list','POST','\x20menu\x20resource\x20set(s).','\x20updated,\x20','appcode','Exact\x20comma-separated\x20menu\x20IDs\x20to\x20update','fetch','rawFlags','string','isArray','Updating\x20','\x20menu(s)\x20failed','cookie','patch','\x20updated.','Menu\x20asset\x20update\x20skipped','map','menu-ids','mode','updated','✓\x20Menu\x20asset\x20update\x20completed:\x20','cssUrl','asset-update','--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.','1592ctXuvz','\x20\x20Cancelled.','Would\x20update\x20','yellow','replace','6BFEKEM','Explicitly\x20update\x20every\x20menu\x20that\x20has\x20resources','str','isSafeInteger','921193xtUfcx','jsUrl','paths','5888463ANXAag','write','menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.','Menu\x20asset\x20update\x20completed:\x20','\x20\x20Found\x20','split','message','!\x20No\x20menus\x20with\x20existing\x20resources\x20found','\x20\x20!\x20No\x20menus\x20with\x20existing\x20resources\x20found','Update\x20CDN\x20asset\x20URLs\x20for\x20selected\x20online\x20menus\x20with\x20existing\x20resources','Resource\x20update\x20mode:\x20replace\x20rewrites\x20resources\x20from\x20supplied\x20URLs;\x20','cyan','appCode','Updated\x20'];a161_0x3a1c=function(){return _0xab1c88;};return a161_0x3a1c();}import a161_0x2f4c from'chalk';import{filterMenusWithResources,fetchOnlineMenuList}from'../../commands/menu/shared/logic.js';import{renderUpdateSummary}from'../../commands/menu/shared/compare-table.js';import{askJsUrl,askCssUrl,askConfirm,startSpinner,stopSpinner,requireInteractive}from'../../commands/menu/shared/inquirer.js';import{CliErrors}from'../../errors.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';import{runMenuUpdateCore}from'../../commands/menu/shared/update-core.js';import{selectMenusForUpdate}from'../../commands/menu/shared/update-core.js';import{isInProject}from'../../context.js';export const menuAssetUpdate={'service':a161_0x51f7d5(0x1b6),'command':a161_0x51f7d5(0x1db),'description':a161_0x51f7d5(0x192),'risk':a161_0x51f7d5(0x1ea),'flags':[{'name':a161_0x51f7d5(0x1ac),'type':a161_0x51f7d5(0x1cd),'description':a161_0x51f7d5(0x1a7)+a161_0x51f7d5(0x1a0)},{'name':a161_0x51f7d5(0x1d7),'type':a161_0x51f7d5(0x1cd),'description':a161_0x51f7d5(0x193)+'patch\x20replaces\x20a\x20supplied\x20type\x20only\x20when\x20the\x20existing\x20target\x20is\x20unambiguous','enum':['replace',a161_0x51f7d5(0x1d2)],'default':a161_0x51f7d5(0x1d2)},{'name':'force','type':'boolean','description':a161_0x51f7d5(0x1a3)},{'name':a161_0x51f7d5(0x1d6),'type':a161_0x51f7d5(0x1cd),'description':a161_0x51f7d5(0x1ca)},{'name':'paths','type':'string','description':a161_0x51f7d5(0x19a)},{'name':a161_0x51f7d5(0x1af),'type':'boolean','description':a161_0x51f7d5(0x1e3)},{'name':a161_0x51f7d5(0x1ba),'type':a161_0x51f7d5(0x1cd),'enum':[a161_0x51f7d5(0x1a4),a161_0x51f7d5(0x19d),a161_0x51f7d5(0x1cb)],'description':a161_0x51f7d5(0x1a6)}],async 'dryRun'(_0x453654){const _0x1b341e=a161_0x51f7d5;ensureRunnableContext(_0x453654['rawFlags'],_0x453654[_0x1b341e(0x1be)]);const _0x361008=await runMenuUpdateCore(_0x453654['appCode'],_0x453654[_0x1b341e(0x1d1)],_0x453654[_0x1b341e(0x1e4)](_0x1b341e(0x1ac)),{'mode':parseMode(_0x453654[_0x1b341e(0x1e4)](_0x1b341e(0x1d7))),'dryRun':!![],'force':_0x453654[_0x1b341e(0x1c2)](_0x1b341e(0x1ab)),'selection':parseSelection(_0x453654),'loadScriptMode':parseLoadScriptMode(_0x453654['str']('load-mode'))});return{'method':_0x1b341e(0x1c6),'url':_0x1b341e(0x1c3),'body':_0x361008,'description':_0x361008[_0x1b341e(0x1a2)]?_0x1b341e(0x199):_0x1b341e(0x1df)+(_0x361008[_0x1b341e(0x1bb)]?.[_0x1b341e(0x1bc)]??0x0)+_0x1b341e(0x1c7)};},async 'execute'(_0x138779){const _0x407a1f=a161_0x51f7d5;ensureRunnableContext(_0x138779[_0x407a1f(0x1cc)],_0x138779[_0x407a1f(0x1be)]);const _0xf4b470=_0x138779[_0x407a1f(0x1e4)](_0x407a1f(0x1ac)),_0x9c3a07=parseMode(_0x138779[_0x407a1f(0x1e4)](_0x407a1f(0x1d7))),_0x112df9=_0x138779[_0x407a1f(0x1c2)]('force'),_0x487bd2=parseLoadScriptMode(_0x138779[_0x407a1f(0x1e4)](_0x407a1f(0x1ba))),_0x36c035=parseParams(_0xf4b470),_0x214572=!!(_0x36c035['jsUrl']||_0x36c035[_0x407a1f(0x1da)]);if(_0x214572){const _0xfa0910=await runMenuUpdateCore(_0x138779['appCode'],_0x138779[_0x407a1f(0x1d1)],_0xf4b470,{'mode':_0x9c3a07,'force':_0x112df9,'selection':parseSelection(_0x138779),'loadScriptMode':_0x487bd2});return _0xfa0910[_0x407a1f(0x1a2)]?writeCliSideChannelLine(_0x407a1f(0x190)):(writeCliSideChannelLine(_0x407a1f(0x1d9)+_0xfa0910[_0x407a1f(0x1d8)]+_0x407a1f(0x1b5)),_0xfa0910[_0x407a1f(0x1b4)]>0x0&&writeCliSideChannelLine('!\x20'+_0xfa0910[_0x407a1f(0x1b4)]+_0x407a1f(0x1d0))),{'ok':_0xfa0910[_0x407a1f(0x1b4)]===0x0,'data':_0xfa0910,'message':_0xfa0910[_0x407a1f(0x1a2)]?_0x407a1f(0x1d4):_0x407a1f(0x18c)+_0xfa0910[_0x407a1f(0x1d8)]+_0x407a1f(0x1c8)+_0xfa0910[_0x407a1f(0x1b4)]+_0x407a1f(0x1c0)};}requireInteractive();const _0x13ba42=startSpinner(_0x407a1f(0x19b));let _0x30d8b6;try{_0x30d8b6=await fetchOnlineMenuList(_0x138779[_0x407a1f(0x195)],_0x138779[_0x407a1f(0x1d1)]),stopSpinner(_0x13ba42,'Online\x20menu\x20list\x20fetched',!![]);}catch(_0x48229a){stopSpinner(_0x13ba42,_0x407a1f(0x1c5),![]);throw CliErrors[_0x407a1f(0x1aa)](_0x48229a instanceof Error?_0x48229a[_0x407a1f(0x18f)]:_0x407a1f(0x1c5));}const _0x716b0b=filterMenusWithResources(_0x30d8b6),_0x597e33=parseSelection(_0x138779,![]),_0x4b8ead=_0x597e33?selectMenusForUpdate(_0x716b0b,_0x597e33):_0x716b0b;if(_0x4b8ead[_0x407a1f(0x1bc)]===0x0)return writeCliSideChannelLine(a161_0x2f4c[_0x407a1f(0x1e0)](_0x407a1f(0x191))),{'ok':!![]};writeCliSideChannelLine(''),writeCliSideChannelLine(a161_0x2f4c[_0x407a1f(0x194)](_0x407a1f(0x18d)+_0x4b8ead[_0x407a1f(0x1bc)]+_0x407a1f(0x1a5))),writeCliSideChannelLine(renderUpdateSummary(_0x4b8ead[_0x407a1f(0x1d5)](_0x548ed4=>_0x548ed4[_0x407a1f(0x1c1)]),[_0x36c035['jsUrl'],_0x36c035['cssUrl']])),writeCliSideChannelLine('');let _0x5771e8=_0x36c035[_0x407a1f(0x1e7)],_0x3aeec6=_0x36c035[_0x407a1f(0x1da)];!_0x5771e8&&(_0x5771e8=await askJsUrl());!_0x3aeec6&&(_0x3aeec6=await askCssUrl());const _0x1a4ed3=await askConfirm('\x20\x20Update\x20'+_0x4b8ead[_0x407a1f(0x1bc)]+_0x407a1f(0x198)+_0x5771e8+_0x407a1f(0x1b8)+_0x3aeec6+'?');if(!_0x1a4ed3)return writeCliSideChannelLine(a161_0x2f4c[_0x407a1f(0x197)](_0x407a1f(0x1de))),{'ok':!![]};const _0x2009f8=startSpinner(_0x407a1f(0x1cf)+_0x4b8ead['length']+_0x407a1f(0x1ae));try{const _0x2b140e=await runMenuUpdateCore(_0x138779[_0x407a1f(0x195)],_0x138779[_0x407a1f(0x1d1)],JSON[_0x407a1f(0x1b2)]({'jsUrl':_0x5771e8,'cssUrl':_0x3aeec6}),{'mode':_0x9c3a07,'force':_0x112df9,'selection':{'all':![],'menuIds':_0x4b8ead[_0x407a1f(0x1d5)](_0x29830c=>_0x29830c['id']),'paths':[]},'loadScriptMode':_0x487bd2});return stopSpinner(_0x2009f8,_0x407a1f(0x196)+_0x2b140e[_0x407a1f(0x1d8)]+_0x407a1f(0x1a1),_0x2b140e['failed']===0x0),{'ok':_0x2b140e[_0x407a1f(0x1b4)]===0x0,'data':_0x2b140e,'message':_0x2b140e['failed']>0x0?_0x407a1f(0x18c)+_0x2b140e['updated']+_0x407a1f(0x1c8)+_0x2b140e[_0x407a1f(0x1b4)]+_0x407a1f(0x1c0):_0x407a1f(0x18c)+_0x2b140e[_0x407a1f(0x1d8)]+_0x407a1f(0x1d3)};}catch(_0x3e7917){stopSpinner(_0x2009f8,_0x407a1f(0x1c4),![]);throw CliErrors['validation'](_0x3e7917 instanceof Error?_0x3e7917[_0x407a1f(0x18f)]:'Menu\x20asset\x20update\x20failed');}}};function ensureRunnableContext(_0x321e3a,_0x10d472){const _0x4c0c07=a161_0x51f7d5,_0x13c017=_0x321e3a[_0x4c0c07(0x1c9)]?String(_0x321e3a['appcode'])[_0x4c0c07(0x1b3)]():'';if(!isInProject()&&!_0x10d472&&!_0x13c017)throw CliErrors[_0x4c0c07(0x1aa)](_0x4c0c07(0x1b9)+_0x4c0c07(0x19c));}function parseMode(_0x5f2009){const _0x3fe1c4=a161_0x51f7d5;if(!_0x5f2009)return'patch';if(_0x5f2009===_0x3fe1c4(0x1e1)||_0x5f2009==='patch')return _0x5f2009;throw CliErrors[_0x3fe1c4(0x1aa)]('Invalid\x20--mode.\x20Allowed\x20values:\x20replace,\x20patch');}function parseSelection(_0x453631,_0x1074d6=!![]){const _0x7a7d0a=a161_0x51f7d5,_0x32e612=_0x453631[_0x7a7d0a(0x1c2)](_0x7a7d0a(0x1af)),_0x231dd7=parseMenuIds(_0x453631[_0x7a7d0a(0x1e4)](_0x7a7d0a(0x1d6))),_0x36a17d=parseCsv(_0x453631[_0x7a7d0a(0x1e4)](_0x7a7d0a(0x1e8))),_0x5a3c49=_0x231dd7['length']>0x0||_0x36a17d[_0x7a7d0a(0x1bc)]>0x0;if(_0x32e612&&_0x5a3c49)throw CliErrors['validation'](_0x7a7d0a(0x1dc));if(!_0x32e612&&!_0x5a3c49){if(!_0x1074d6)return undefined;throw CliErrors['validation'](_0x7a7d0a(0x18b));}return{'all':_0x32e612,'menuIds':_0x231dd7,'paths':_0x36a17d};}function parseMenuIds(_0x5e696b){const _0x396f8a=a161_0x51f7d5,_0x4f0e3e=parseCsv(_0x5e696b),_0x561448=_0x4f0e3e['map'](Number);if(_0x561448[_0x396f8a(0x19e)](_0x4a09c9=>!Number[_0x396f8a(0x1e5)](_0x4a09c9)||_0x4a09c9<=0x0))throw CliErrors['validation'](_0x396f8a(0x1a8));return[...new Set(_0x561448)];}function a161_0x4d7b(_0x24a3ea,_0x23865b){_0x24a3ea=_0x24a3ea-0x18b;const _0x3a1c3c=a161_0x3a1c();let _0x4d7b0e=_0x3a1c3c[_0x24a3ea];return _0x4d7b0e;}function parseCsv(_0x31317b){const _0x2fb7c0=a161_0x51f7d5;return[...new Set(_0x31317b[_0x2fb7c0(0x18e)](',')[_0x2fb7c0(0x1d5)](_0x3a4253=>_0x3a4253[_0x2fb7c0(0x1b3)]())[_0x2fb7c0(0x1b7)](Boolean))];}function parseLoadScriptMode(_0x1ecb1e){const _0x4af90b=a161_0x51f7d5;if(!_0x1ecb1e)return undefined;if(_0x1ecb1e==='import'||_0x1ecb1e===_0x4af90b(0x19d)||_0x1ecb1e===_0x4af90b(0x1cb))return _0x1ecb1e;throw CliErrors[_0x4af90b(0x1aa)]('Invalid\x20--load-mode.\x20Allowed\x20values:\x20import,\x20script,\x20fetch');}function parseParams(_0x346c3c){const _0x19a3f2=a161_0x51f7d5;if(!_0x346c3c)return{};try{const _0x556ab7=JSON[_0x19a3f2(0x1bf)](_0x346c3c);if(typeof _0x556ab7!=='object'||_0x556ab7===null||Array[_0x19a3f2(0x1ce)](_0x556ab7))return{};return{'jsUrl':typeof _0x556ab7[_0x19a3f2(0x1e7)]===_0x19a3f2(0x1cd)?_0x556ab7[_0x19a3f2(0x1e7)][_0x19a3f2(0x1b3)]():undefined,'cssUrl':typeof _0x556ab7[_0x19a3f2(0x1da)]===_0x19a3f2(0x1cd)?_0x556ab7[_0x19a3f2(0x1da)][_0x19a3f2(0x1b3)]():undefined};}catch{return{};}}
|