@lovrabet/rabetbase-cli 2.5.10-beta.2 → 2.5.10-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -0
- 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.d.ts +2 -2
- 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.js +1 -1
- package/lib/commands/dataset/design-start.js +1 -1
- package/lib/commands/dataset/design-status.js +1 -1
- package/lib/commands/dataset/design-sync-retry.js +1 -1
- package/lib/commands/dataset/design-sync-status.js +1 -1
- package/lib/commands/dataset/design-validate.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-restore.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/dataset/user-deleted-field-list.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/cross-db-analysis-shared.js +1 -1
- package/lib/commands/db/cross-db-analyze-latest.js +1 -1
- package/lib/commands/db/cross-db-analyze-start.js +1 -1
- package/lib/commands/db/cross-db-analyze-status.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/table-diff-shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/deployment/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/page-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/context.d.ts +3 -0
- package/lib/commands/issue/context.js +1 -0
- 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/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.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.js +1 -1
- 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/instant-api-policy/endpoints.js +1 -1
- package/lib/core/kb-management-client.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.js +1 -1
- package/lib/services/dataset-design/commands.js +1 -1
- package/lib/services/dataset-design/contract.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +2 -2
- package/skills/rabetbase/SKILL.md +2 -2
- package/skills/rabetbase/references/rabetbase-issue-report.md +4 -1
- package/skills/rabetbase-dataset-generation/SKILL.md +1 -1
- package/skills/rabetbase-page-generation/SKILL.md +1 -1
- package/skills/rabetbase.manifest.json +3 -3
- package/lib/commands/issue/shared.d.ts +0 -32
- package/lib/commands/issue/shared.js +0 -1
- package/lib/telemetry/send-platform-issue-collect-log.d.ts +0 -26
- package/lib/telemetry/send-platform-issue-collect-log.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a146_0x1bc0c7=a146_0x1f56;(function(_0x2c3c18,_0x1a04bd){const _0x4e1afd=a146_0x1f56,_0xac86d7=_0x2c3c18();while(!![]){try{const _0x40752e=parseInt(_0x4e1afd(0x13f))/0x1+-parseInt(_0x4e1afd(0x14c))/0x2+-parseInt(_0x4e1afd(0x143))/0x3+-parseInt(_0x4e1afd(0x145))/0x4+-parseInt(_0x4e1afd(0x149))/0x5*(-parseInt(_0x4e1afd(0x146))/0x6)+parseInt(_0x4e1afd(0x142))/0x7*(-parseInt(_0x4e1afd(0x139))/0x8)+parseInt(_0x4e1afd(0x14e))/0x9;if(_0x40752e===_0x1a04bd)break;else _0xac86d7['push'](_0xac86d7['shift']());}catch(_0x6df58d){_0xac86d7['push'](_0xac86d7['shift']());}}}(a146_0x189f,0xc5010));import{getCurrentInstantApiPolicy,getInstantApiPolicyRevision,isPlatformTransportFailure,rollbackInstantApiPolicy}from'../../core/api-client.js';function a146_0x189f(){const _0x411ee0=['instant-api-policy','1364986tRfzYJ','3468180EGbKXm','rollback','6196048rmzSAN','61986CJtLCq','Inspect\x20with\x20`','Rollback\x20response\x20was\x20unavailable;\x20current-policy\x20readback\x20proved\x20the\x20new\x20revision\x20without\x20resubmitting.','175IsbGLm','\x20forward\x20to\x20revision\x20','`;\x20do\x20not\x20resubmit\x20automatically.','1048026HRmkPy','The\x20rollback\x20request\x20was\x20sent,\x20but\x20the\x20current\x20policy\x20could\x20not\x20be\x20verified.','25433883fJdaRu','push','expectedRevision','defineProperty','instant_api_policy_rollback_verification_unavailable','instant_api_policy_rollback_outcome_unknown','verified','before','Instant\x20API\x20policy\x20is\x20not\x20configured\x20for\x20','Restore\x20a\x20historical\x20policy\x20as\x20a\x20new\x20active\x20revision','target','changeSummary','POST','configHash','16TEPstC','all','instant_api_policy_not_configured','appCode','revision','cause','1238437INnKTZ','Current\x20policy\x20readback\x20does\x20not\x20prove\x20the\x20requested\x20rollback.'];a146_0x189f=function(){return _0x411ee0;};return a146_0x189f();}import{asDryRunResult}from'../../commands/common/dry-run.js';import{instantApiPolicyError}from'../../core/instant-api-policy/config.js';import{assertExpectedRevision,CHANGE_SUMMARY_FLAG,EXPECTED_REVISION_FLAG,expectedRevisionWarnings,INSTANT_API_POLICY_PATHS,mutationLookupCommand,projectCurrentPolicy,projectRevisionDetail,readChangeSummary,readExpectedRevision,readRevision,REVISION_FLAG,RUNTIME_CACHE_WARNING}from'../../commands/instant-api-policy/shared.js';function a146_0x1f56(_0x1205c5,_0x313562){_0x1205c5=_0x1205c5-0x137;const _0x189f15=a146_0x189f();let _0x1f5679=_0x189f15[_0x1205c5];return _0x1f5679;}async function prepareRollback(_0x54e789){const _0x34b9c6=a146_0x1f56,_0x53e344=readRevision(_0x54e789),_0xc3477a=readChangeSummary(_0x54e789),_0x518b92=readExpectedRevision(_0x54e789),[_0x5f1552,_0x82cdeb]=await Promise[_0x34b9c6(0x13a)]([getCurrentInstantApiPolicy(_0x54e789[_0x34b9c6(0x13c)]),getInstantApiPolicyRevision(_0x54e789['appCode'],_0x53e344)]);if(!_0x5f1552)throw instantApiPolicyError(_0x34b9c6(0x13b),_0x34b9c6(0x156)+_0x54e789[_0x34b9c6(0x13c)]+'.');return assertExpectedRevision(_0x5f1552,_0x518b92),{'revision':_0x53e344,'changeSummary':_0xc3477a,'expectedRevision':_0x518b92,'before':_0x5f1552,'target':_0x82cdeb};}export const instantApiPolicyRollback={'service':a146_0x1bc0c7(0x141),'command':a146_0x1bc0c7(0x144),'description':a146_0x1bc0c7(0x157),'risk':'high-risk-write','requiresAppCode':!![],'structuredErrors':!![],'confirmationDescription':'Restore\x20an\x20application-wide\x20Instant\x20API\x20policy\x20from\x20immutable\x20history\x20as\x20a\x20new\x20revision.','flags':[REVISION_FLAG,CHANGE_SUMMARY_FLAG,EXPECTED_REVISION_FLAG],async 'validate'(_0x36ed78){readRevision(_0x36ed78),readChangeSummary(_0x36ed78),readExpectedRevision(_0x36ed78);},async 'dryRun'(_0x4d4236){const _0x4df1fc=a146_0x1bc0c7,_0x70fbdf=await prepareRollback(_0x4d4236);return asDryRunResult({'operation':_0x4df1fc(0x144),'selector':{'appCode':_0x4d4236[_0x4df1fc(0x13c)],'sourceRevision':_0x70fbdf['revision']},'before':projectCurrentPolicy(_0x70fbdf[_0x4df1fc(0x155)]),'after':{'revision':_0x70fbdf[_0x4df1fc(0x155)][_0x4df1fc(0x13d)]+0x1,'sourceRevision':projectRevisionDetail(_0x70fbdf[_0x4df1fc(0x158)])},'dryRun':!![],'backend':{'method':_0x4df1fc(0x137),'path':INSTANT_API_POLICY_PATHS[_0x4df1fc(0x144)]},'warnings':expectedRevisionWarnings(_0x70fbdf[_0x4df1fc(0x150)]),'verification':{'status':'planned','expectedRevision':_0x70fbdf[_0x4df1fc(0x150)]??null,'atomicCompareAndSet':![],'lookupCommand':mutationLookupCommand()}},{'method':_0x4df1fc(0x137),'url':INSTANT_API_POLICY_PATHS[_0x4df1fc(0x144)]});},async 'execute'(_0x2d0a24){const _0x50e802=a146_0x1bc0c7,_0x367b6f=await prepareRollback(_0x2d0a24);let _0xa1ebe4=![];try{await rollbackInstantApiPolicy({'appCode':_0x2d0a24[_0x50e802(0x13c)],'revision':_0x367b6f[_0x50e802(0x13d)],..._0x367b6f['changeSummary']?{'changeSummary':_0x367b6f[_0x50e802(0x159)]}:{}});}catch(_0x3a205f){if(!isPlatformTransportFailure(_0x3a205f))throw _0x3a205f;_0xa1ebe4=!![];}let _0x49d0b4;try{_0x49d0b4=await getCurrentInstantApiPolicy(_0x2d0a24[_0x50e802(0x13c)]);}catch(_0x226826){const _0x2a9064=instantApiPolicyError(_0xa1ebe4?_0x50e802(0x153):_0x50e802(0x152),_0x50e802(0x14d),_0x50e802(0x147)+mutationLookupCommand()+_0x50e802(0x14b));Object[_0x50e802(0x151)](_0x2a9064,_0x50e802(0x13e),{'value':_0x226826,'enumerable':![]});throw _0x2a9064;}const _0x28b84f=_0x49d0b4&&_0x49d0b4[_0x50e802(0x13d)]>_0x367b6f[_0x50e802(0x155)]['revision'],_0x48b60a=_0x49d0b4?.[_0x50e802(0x138)]===_0x367b6f[_0x50e802(0x158)][_0x50e802(0x138)];if(!_0x49d0b4||!_0x28b84f||!_0x48b60a)throw instantApiPolicyError(_0xa1ebe4?_0x50e802(0x153):'instant_api_policy_rollback_verification_failed',_0x50e802(0x140),_0x50e802(0x147)+mutationLookupCommand()+_0x50e802(0x14b));const _0x2791f7=[...expectedRevisionWarnings(_0x367b6f[_0x50e802(0x150)]),RUNTIME_CACHE_WARNING];return _0xa1ebe4&&_0x2791f7[_0x50e802(0x14f)](_0x50e802(0x148)),{'ok':!![],'data':{'operation':'rollback','selector':{'appCode':_0x2d0a24[_0x50e802(0x13c)],'sourceRevision':_0x367b6f[_0x50e802(0x13d)]},'before':projectCurrentPolicy(_0x367b6f['before']),'after':projectCurrentPolicy(_0x49d0b4),'dryRun':![],'backend':{'method':'POST','path':INSTANT_API_POLICY_PATHS[_0x50e802(0x144)]},'warnings':_0x2791f7,'verification':{'status':_0x50e802(0x154),'recoveredAfterUnknownResponse':_0xa1ebe4,'expectedRevision':_0x367b6f[_0x50e802(0x150)]??null,'atomicCompareAndSet':![],'lookupCommand':mutationLookupCommand()}},'message':'Rolled\x20Instant\x20API\x20policy\x20revision\x20'+_0x367b6f['revision']+_0x50e802(0x14a)+_0x49d0b4[_0x50e802(0x13d)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a147_0x3d67fd=a147_0x20b6;(function(_0x3e7c29,_0x5bcec9){const _0x38629e=a147_0x20b6,_0x2a79f1=_0x3e7c29();while(!![]){try{const _0x35f26d=-parseInt(_0x38629e(0x1eb))/0x1+-parseInt(_0x38629e(0x1fe))/0x2+-parseInt(_0x38629e(0x1f5))/0x3+-parseInt(_0x38629e(0x209))/0x4*(parseInt(_0x38629e(0x1fc))/0x5)+parseInt(_0x38629e(0x202))/0x6*(parseInt(_0x38629e(0x1e9))/0x7)+-parseInt(_0x38629e(0x20d))/0x8+parseInt(_0x38629e(0x218))/0x9*(parseInt(_0x38629e(0x206))/0xa);if(_0x35f26d===_0x5bcec9)break;else _0x2a79f1['push'](_0x2a79f1['shift']());}catch(_0x902c2c){_0x2a79f1['push'](_0x2a79f1['shift']());}}}(a147_0xb8fc,0x61f14));import{instantApiPolicyError,loadInstantApiPolicyLocalConfig,readInstantApiPolicyConfigFile}from'../../core/instant-api-policy/config.js';export{INSTANT_API_POLICY_PATHS}from'../../core/instant-api-policy/endpoints.js';export const RUNTIME_CACHE_WARNING='Runtime\x20instances\x20may\x20take\x20up\x20to\x2030\x20seconds\x20to\x20observe\x20the\x20new\x20active\x20policy.';export const NON_ATOMIC_EXPECTED_REVISION_WARNING=a147_0x3d67fd(0x214);export const FORCE_FLAG={'name':'force','type':a147_0x3d67fd(0x205),'default':![],'description':'Replace\x20an\x20existing\x20fixed\x20policy\x20file;\x20requires\x20--yes'};export const CHANGE_SUMMARY_FLAG={'name':'change-summary','type':a147_0x3d67fd(0x1f0),'required':![],'description':a147_0x3d67fd(0x1f8)};function a147_0xb8fc(){const _0x1a6874=['The\x20current\x20Instant\x20API\x20policy\x20revision\x20changed\x20before\x20mutation.','num','updateUserId','NaN','expected-revision','--expected-revision\x20is\x20a\x20non-atomic\x20read-before-write\x20assertion;\x20the\x20server\x20mutation\x20contract\x20has\x20no\x20revision\x20predicate.','createUserId','operatorId','.\x20Run\x20current\x20and\x20review\x20before\x20retrying.','327213gFFvmk','instant_api_policy_force_confirmation_required','yes','trim','configHash','appCode','7lcVhGe','revision','680302vqhkkU','instant_api_policy_change_summary_invalid','--force\x20requires\x20--yes\x20because\x20it\x20replaces\x20the\x20fixed\x20local\x20policy\x20file.','Expected\x20revision\x20','version','string','changeSummary','Positive\x20published\x20policy\x20revision','--change-summary\x20cannot\x20exceed\x202000\x20characters.','--expected-revision\x20must\x20be\x20a\x20non-negative\x20safe\x20integer.','831582UssCuN','gmtModified','rules','Audit\x20summary\x20for\x20this\x20policy\x20revision\x20(maximum\x202000\x20characters)','Review\x20the\x20existing\x20file,\x20then\x20rerun\x20with\x20--force\x20--yes.',';\x20current\x20revision\x20is\x20','number','10wampbP','instant_api_policy_revision_mismatch','681118GyCckF','gmtCreate','config','rabetbase\x20instant-api-policy\x20current\x20--format\x20compress','3893334rBPurT','instant_api_policy_revision_invalid','policyId','boolean','450IsLOnb','bool','length','659368ASYAWh','Non-atomic\x20assertion\x20for\x20the\x20current\x20revision;\x20use\x200\x20when\x20unconfigured','instant_api_policy_expected_revision_invalid','--revision\x20must\x20be\x20a\x20positive\x20safe\x20integer.','2048344IproLX','enabled'];a147_0xb8fc=function(){return _0x1a6874;};return a147_0xb8fc();}export const REVISION_FLAG={'name':a147_0x3d67fd(0x1ea),'type':'number','required':!![],'description':a147_0x3d67fd(0x1f2)};export const EXPECTED_REVISION_FLAG={'name':a147_0x3d67fd(0x213),'type':a147_0x3d67fd(0x1fb),'required':![],'description':a147_0x3d67fd(0x20a)};export function requireForceConfirmation(_0xd7c710){const _0x230f4a=a147_0x3d67fd;if(!_0xd7c710[_0x230f4a(0x207)]('force')||_0xd7c710[_0x230f4a(0x207)](_0x230f4a(0x1e5)))return;throw instantApiPolicyError(_0x230f4a(0x1e4),_0x230f4a(0x1ed),_0x230f4a(0x1f9));}export function readChangeSummary(_0x3cdbd1){const _0x1dad9c=a147_0x3d67fd,_0x5b2b52=_0x3cdbd1['str']('change-summary')[_0x1dad9c(0x1e6)]();if(!_0x5b2b52)return undefined;if(_0x5b2b52[_0x1dad9c(0x208)]>0x7d0)throw instantApiPolicyError(_0x1dad9c(0x1ec),_0x1dad9c(0x1f3));return _0x5b2b52;}export function readRevision(_0xb83174){const _0x49e583=a147_0x3d67fd,_0x308f34=_0xb83174[_0x49e583(0x210)](_0x49e583(0x1ea),Number[_0x49e583(0x212)]);if(!Number['isSafeInteger'](_0x308f34)||_0x308f34<=0x0)throw instantApiPolicyError(_0x49e583(0x203),_0x49e583(0x20c));return _0x308f34;}export function readExpectedRevision(_0x582bf2){const _0x21cba9=a147_0x3d67fd;if(_0x582bf2['flag'](_0x21cba9(0x213))===undefined)return undefined;const _0x11ac04=_0x582bf2[_0x21cba9(0x210)](_0x21cba9(0x213),Number['NaN']);if(!Number['isSafeInteger'](_0x11ac04)||_0x11ac04<0x0)throw instantApiPolicyError(_0x21cba9(0x20b),_0x21cba9(0x1f4));return _0x11ac04;}export function assertExpectedRevision(_0x27ba66,_0x36b951){const _0x37aaaf=a147_0x3d67fd;if(_0x36b951===undefined)return;const _0x95fd8c=_0x27ba66?.[_0x37aaaf(0x1ea)]??0x0;if(_0x95fd8c!==_0x36b951)throw instantApiPolicyError(_0x37aaaf(0x1fd),_0x37aaaf(0x20f),_0x37aaaf(0x1ee)+_0x36b951+_0x37aaaf(0x1fa)+_0x95fd8c+_0x37aaaf(0x217));}export async function readFixedPolicy(_0xe27581){const _0x4c17c9=loadInstantApiPolicyLocalConfig(_0xe27581['appCode']),_0x3af8d5=await readInstantApiPolicyConfigFile(_0x4c17c9);return{'local':_0x4c17c9,'config':_0x3af8d5};}export function projectCurrentPolicy(_0x52a002){const _0xbf98b2=a147_0x3d67fd;if(!_0x52a002)return null;return{'id':_0x52a002['id'],'appCode':_0x52a002[_0xbf98b2(0x1e8)],'revision':_0x52a002[_0xbf98b2(0x1ea)],'configHash':_0x52a002[_0xbf98b2(0x1e7)],'enabled':_0x52a002[_0xbf98b2(0x20e)],'config':_0x52a002['config'],'createUserId':_0x52a002[_0xbf98b2(0x215)]??null,'updateUserId':_0x52a002[_0xbf98b2(0x211)]??null,'gmtCreate':_0x52a002[_0xbf98b2(0x1ff)]??null,'gmtModified':_0x52a002[_0xbf98b2(0x1f6)]??null};}export function projectRevisionSummary(_0x19f33e){const _0x326809=a147_0x3d67fd;return{'id':_0x19f33e['id'],'policyId':_0x19f33e[_0x326809(0x204)],'appCode':_0x19f33e[_0x326809(0x1e8)],'revision':_0x19f33e['revision'],'configHash':_0x19f33e[_0x326809(0x1e7)],'changeType':_0x19f33e['changeType'],'changeSummary':_0x19f33e[_0x326809(0x1f1)]??null,'operatorId':_0x19f33e[_0x326809(0x216)]??null,'gmtCreate':_0x19f33e[_0x326809(0x1ff)]??null,'version':_0x19f33e[_0x326809(0x200)][_0x326809(0x1ef)],'defaultAction':_0x19f33e['config']['defaults']['instantApi'],'ruleCount':_0x19f33e[_0x326809(0x200)][_0x326809(0x1f7)]?.[_0x326809(0x208)]??0x0};}function a147_0x20b6(_0x1ed7ed,_0x28a839){_0x1ed7ed=_0x1ed7ed-0x1e4;const _0xb8fcf0=a147_0xb8fc();let _0x20b61e=_0xb8fcf0[_0x1ed7ed];return _0x20b61e;}export function projectRevisionDetail(_0x44dda9){const _0x17610e=a147_0x3d67fd;return{...projectRevisionSummary(_0x44dda9),'config':_0x44dda9[_0x17610e(0x200)]};}export function expectedRevisionWarnings(_0xeeeacb){return _0xeeeacb===undefined?[]:[NON_ATOMIC_EXPECTED_REVISION_WARNING];}export function mutationLookupCommand(){const _0x376531=a147_0x3d67fd;return _0x376531(0x201);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a148_0x5482(){const _0x1f16f7=['validate','931XQNBak','1ZScYTQ','instant-api-policy','4504869sXCgNX','POST','838572xgSdwy','4728eRSFHp','255180lkvfJg','508072XhVbah','109638opZmUH','Validate\x20the\x20fixed\x20local\x20policy\x20without\x20publishing','appCode','read','policyRelativePath','Validated\x20Instant\x20API\x20policy\x20for\x20','58855CuApTC'];a148_0x5482=function(){return _0x1f16f7;};return a148_0x5482();}const a148_0x2a4838=a148_0x57b3;function a148_0x57b3(_0x141aab,_0x131bbc){_0x141aab=_0x141aab-0x17a;const _0x548291=a148_0x5482();let _0x57b3da=_0x548291[_0x141aab];return _0x57b3da;}(function(_0x14e0cd,_0xc5eead){const _0x1b2865=a148_0x57b3,_0x4e98fd=_0x14e0cd();while(!![]){try{const _0x5527af=-parseInt(_0x1b2865(0x18a))/0x1*(-parseInt(_0x1b2865(0x181))/0x2)+-parseInt(_0x1b2865(0x17f))/0x3+-parseInt(_0x1b2865(0x180))/0x4+-parseInt(_0x1b2865(0x187))/0x5+-parseInt(_0x1b2865(0x17d))/0x6+parseInt(_0x1b2865(0x189))/0x7*(-parseInt(_0x1b2865(0x17e))/0x8)+parseInt(_0x1b2865(0x17b))/0x9;if(_0x5527af===_0xc5eead)break;else _0x4e98fd['push'](_0x4e98fd['shift']());}catch(_0x58783e){_0x4e98fd['push'](_0x4e98fd['shift']());}}}(a148_0x5482,0x1b9fa));import{validateInstantApiPolicy}from'../../core/api-client.js';import{INSTANT_API_POLICY_PATHS,readFixedPolicy}from'../../commands/instant-api-policy/shared.js';export const instantApiPolicyValidate={'service':a148_0x2a4838(0x17a),'command':'validate','description':a148_0x2a4838(0x182),'risk':a148_0x2a4838(0x184),'requiresAppCode':!![],'structuredErrors':!![],'flags':[],async 'execute'(_0x5ac8df){const _0x3f1825=a148_0x2a4838,{local:_0x32cca1,config:_0xd87835}=await readFixedPolicy(_0x5ac8df),_0x2530df=await validateInstantApiPolicy({'appCode':_0x5ac8df[_0x3f1825(0x183)],'config':_0xd87835});return{'ok':!![],'data':{'operation':_0x3f1825(0x188),'selector':{'appCode':_0x5ac8df['appCode']},'filePath':_0x32cca1['policyFilePath'],'relativePath':_0x32cca1[_0x3f1825(0x185)],'valid':_0x2530df['valid'],'configHash':_0x2530df['configHash'],'normalizedConfig':_0x2530df['normalizedConfig'],'backend':{'method':_0x3f1825(0x17c),'path':INSTANT_API_POLICY_PATHS[_0x3f1825(0x188)]}},'message':_0x3f1825(0x186)+_0x5ac8df['appCode']};}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a149_0x5522(){const _0x451013=['tenant_code','1420qFqBWA','13717xrRtLF','tenant','7GxsBUw','8064498RYJefx','nickname','3321858mVeEWp','9RzVqCA','19870dnxTQB','2140832iVRvLL','mergedCli','155wZLPCm','unknown','appCode','803528Vujudk','user','9370lNtANQ','cookie','18HAxdGd','24AsRSwL'];a149_0x5522=function(){return _0x451013;};return a149_0x5522();}(function(_0x19a471,_0x3bb836){const _0x4efed6=a149_0x1194,_0x3b2719=_0x19a471();while(!![]){try{const _0xc85359=parseInt(_0x4efed6(0x19b))/0x1+-parseInt(_0x4efed6(0x195))/0x2*(parseInt(_0x4efed6(0x194))/0x3)+parseInt(_0x4efed6(0x1a2))/0x4*(parseInt(_0x4efed6(0x198))/0x5)+-parseInt(_0x4efed6(0x193))/0x6*(-parseInt(_0x4efed6(0x190))/0x7)+-parseInt(_0x4efed6(0x196))/0x8*(parseInt(_0x4efed6(0x19f))/0x9)+-parseInt(_0x4efed6(0x19d))/0xa*(-parseInt(_0x4efed6(0x1a3))/0xb)+parseInt(_0x4efed6(0x1a0))/0xc*(-parseInt(_0x4efed6(0x191))/0xd);if(_0xc85359===_0x3bb836)break;else _0x3b2719['push'](_0x3b2719['shift']());}catch(_0x47c0e0){_0x3b2719['push'](_0x3b2719['shift']());}}}(a149_0x5522,0xb271e));import{platform,release,arch}from'node:os';import{getSessionUserInfo}from'../../auth/get-session-user.js';import{getConfigAppCode}from'../../utils/config.js';import{getEnv}from'../../constant/env.js';import{NPM_PACKAGE_NAME}from'../../constant/cli.js';function a149_0x1194(_0x4daeaf,_0x3cde5a){_0x4daeaf=_0x4daeaf-0x190;const _0x5522f8=a149_0x5522();let _0x11946f=_0x5522f8[_0x4daeaf];return _0x11946f;}import{VERSION,GIT_COMMIT}from'../../generated/build-info.js';export async function getIssueReportContext(_0xb8918c,_0x1c72f9){const _0x48970d=a149_0x1194,_0xd9faad=_0x1c72f9?undefined:(await getSessionUserInfo(_0xb8918c[_0x48970d(0x19e)]))?.[_0x48970d(0x19c)];return{'serviceName':NPM_PACKAGE_NAME,'serviceVersion':GIT_COMMIT!==_0x48970d(0x199)?VERSION+'+'+GIT_COMMIT:VERSION,'environment':getEnv(),'appCode':_0xb8918c[_0x48970d(0x19a)]||_0xb8918c[_0x48970d(0x197)]?.['appCode']||getConfigAppCode(),'os':platform()+'\x20'+release()+'\x20'+arch(),'terminal':process.env.TERM,'user':_0xd9faad?{'id':_0xd9faad['id'],'username':_0xd9faad['username'],'nickname':_0xd9faad[_0x48970d(0x192)],'email':_0xd9faad['email'],'tenantCode':_0xd9faad[_0x48970d(0x1a4)]?.[_0x48970d(0x1a1)]}:undefined};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x1ea1cf,_0x8c48fc){const _0x4fd947=a150_0x2cc6,_0x3d575d=_0x1ea1cf();while(!![]){try{const _0x5d8a34=-parseInt(_0x4fd947(0xd9))/0x1*(parseInt(_0x4fd947(0xd6))/0x2)+-parseInt(_0x4fd947(0xda))/0x3*(parseInt(_0x4fd947(0xd3))/0x4)+-parseInt(_0x4fd947(0xd4))/0x5+parseInt(_0x4fd947(0xd5))/0x6*(parseInt(_0x4fd947(0xdd))/0x7)+parseInt(_0x4fd947(0xdc))/0x8*(-parseInt(_0x4fd947(0xd7))/0x9)+-parseInt(_0x4fd947(0xd8))/0xa+parseInt(_0x4fd947(0xdb))/0xb;if(_0x5d8a34===_0x8c48fc)break;else _0x3d575d['push'](_0x3d575d['shift']());}catch(_0x5c08fe){_0x3d575d['push'](_0x3d575d['shift']());}}}(a150_0x5dd8,0xce11e));import{issueReport}from'../../commands/issue/report.js';function a150_0x2cc6(_0x18d965,_0x37168e){_0x18d965=_0x18d965-0xd3;const _0x5dd888=a150_0x5dd8();let _0x2cc6b3=_0x5dd888[_0x18d965];return _0x2cc6b3;}function a150_0x5dd8(){const _0x645796=['203nOrejO','1448lhNVns','2784315rPAAKF','84678jnpHKj','236lxtIdV','171RHKJcD','11175740IdRUVV','6685PEKXmh','13881aEGYhV','52354412jUWZOJ','78512OUSstJ'];a150_0x5dd8=function(){return _0x645796;};return a150_0x5dd8();}export const issueDefinitions=[issueReport];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a151_0x583550=a151_0x1007;(function(_0x13ee4c,_0x5ec78c){const _0x1a50d0=a151_0x1007,_0x430b7b=_0x13ee4c();while(!![]){try{const _0x2757d7=-parseInt(_0x1a50d0(0x1fe))/0x1+-parseInt(_0x1a50d0(0x206))/0x2*(-parseInt(_0x1a50d0(0x1e8))/0x3)+parseInt(_0x1a50d0(0x1f0))/0x4+-parseInt(_0x1a50d0(0x1eb))/0x5+parseInt(_0x1a50d0(0x1e7))/0x6*(parseInt(_0x1a50d0(0x1e4))/0x7)+-parseInt(_0x1a50d0(0x200))/0x8+parseInt(_0x1a50d0(0x203))/0x9*(-parseInt(_0x1a50d0(0x1f8))/0xa);if(_0x2757d7===_0x5ec78c)break;else _0x430b7b['push'](_0x430b7b['shift']());}catch(_0x27edde){_0x430b7b['push'](_0x430b7b['shift']());}}}(a151_0x30e8,0x3f991));import{CliError}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const NUDGE_OPT_OUT_ENV=a151_0x583550(0x1fc);const NUDGE_SUPPRESSED_CODES=new Set([a151_0x583550(0x1ef),a151_0x583550(0x1fb),a151_0x583550(0x1f9),a151_0x583550(0x1e9),a151_0x583550(0x1ea),a151_0x583550(0x1ed),a151_0x583550(0x1ec),a151_0x583550(0x204)]),defaultWriter=_0x2c1baf=>{const _0x5a11fe=a151_0x583550;process[_0x5a11fe(0x205)][_0x5a11fe(0x1fa)](_0x2c1baf);};function a151_0x1007(_0x408c70,_0xbf3459){_0x408c70=_0x408c70-0x1e4;const _0x30e890=a151_0x30e8();let _0x100743=_0x30e890[_0x408c70];return _0x100743;}export function shouldNudgeForError(_0xb3c2a4,_0x44276d){const _0x3f1dd0=a151_0x583550;if(process.env[NUDGE_OPT_OUT_ENV]==='1')return![];if(_0x44276d[_0x3f1dd0(0x1f5)]===_0x3f1dd0(0x1e6)&&_0x44276d['command']===_0x3f1dd0(0x1f2))return![];if(_0xb3c2a4 instanceof CliError)return!NUDGE_SUPPRESSED_CODES['has'](_0xb3c2a4[_0x3f1dd0(0x202)]);return!![];}export function printIssueReportNudgeForError(_0x7fac8c,_0x2ba7d9,_0x207e13=defaultWriter){if(!shouldNudgeForError(_0x7fac8c,_0x2ba7d9))return;const _0x2f1953=buildSuggestedTitle(_0x7fac8c,_0x2ba7d9);_0x207e13(formatNudge(_0x2f1953));}function a151_0x30e8(){const _0x21bfde=['11439HoHckr','network_error','stderr','2aNgPvW','command','114191QKlcYm','\x20bug?\x20Help\x20us\x20fix\x20it:','issue','96DLzmSl','1527177wQxwvi','not_in_project','unknown_command','248185yeLwaY','validation_error','flag_missing','=1\x20to\x20silence\x20this\x20hint.','cancelled','1823756OOgRft','slice','report','replace','join','service','\x20issue\x20report\x20\x5c','\x20\x20\x20\x20--title\x20\x22','4840MdnEYF','config_missing','write','auth_required','RABETBASE_DISABLE_ISSUE_NUDGE','\x20\x20Set\x20','40227hLkgvH','Hit\x20a\x20','2083848oRJOEc','\x20\x20(Cookies\x20/\x20Authorization\x20/\x20access\x20keys\x20are\x20automatically\x20redacted\x20before\x20upload.)','code'];a151_0x30e8=function(){return _0x21bfde;};return a151_0x30e8();}function buildSuggestedTitle(_0x263bc9,_0x3ecbbc){const _0x39b318=a151_0x583550,_0x5587c2=_0x263bc9 instanceof Error?_0x263bc9['message']:String(_0x263bc9),_0x15131b=_0x5587c2[_0x39b318(0x1f3)](/[\r\n]+/g,'\x20')[_0x39b318(0x1f3)](/\s+/g,'\x20')['trim']()[_0x39b318(0x1f1)](0x0,0x78)[_0x39b318(0x1f3)](/"/g,'\x5c\x22'),_0x5e3998=CLI_BIN_NAME+'\x20'+_0x3ecbbc[_0x39b318(0x1f5)]+'\x20'+_0x3ecbbc[_0x39b318(0x207)];return _0x15131b['length']>0x0?_0x5e3998+':\x20'+_0x15131b:_0x5e3998;}function formatNudge(_0x253f30){const _0x4f0871=a151_0x583550;return['',_0x4f0871(0x1ff)+CLI_BIN_NAME+_0x4f0871(0x1e5),'\x20\x20'+CLI_BIN_NAME+_0x4f0871(0x1f6),_0x4f0871(0x1f7)+_0x253f30+'\x22\x20\x5c','\x20\x20\x20\x20--description\x20\x22Steps\x20to\x20reproduce,\x20expected\x20vs\x20actual,\x20and\x20any\x20relevant\x20logs.\x22',_0x4f0871(0x201),_0x4f0871(0x1fd)+NUDGE_OPT_OUT_ENV+_0x4f0871(0x1ee),''][_0x4f0871(0x1f4)]('\x0a');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a152_0x3105d2=a152_0x9746;(function(_0x3b3e7d,_0x59487e){const _0x444d76=a152_0x9746,_0x43144f=_0x3b3e7d();while(!![]){try{const _0x4ef674=parseInt(_0x444d76(0xc5))/0x1*(parseInt(_0x444d76(0xbb))/0x2)+parseInt(_0x444d76(0xdb))/0x3+parseInt(_0x444d76(0xdf))/0x4*(parseInt(_0x444d76(0xc8))/0x5)+parseInt(_0x444d76(0xd8))/0x6*(-parseInt(_0x444d76(0xdc))/0x7)+-parseInt(_0x444d76(0xbc))/0x8+-parseInt(_0x444d76(0xc0))/0x9*(parseInt(_0x444d76(0xc7))/0xa)+parseInt(_0x444d76(0xbe))/0xb;if(_0x4ef674===_0x59487e)break;else _0x43144f['push'](_0x43144f['shift']());}catch(_0xbe93d){_0x43144f['push'](_0x43144f['shift']());}}}(a152_0x3bc8,0x3bcf4));import{existsSync}from'node:fs';import{readFile}from'node:fs/promises';import{resolve}from'node:path';import{CliErrors}from'../../errors.js';import{reportIssue}from'@lovrabet/cli-framework';import{getIssueReportContext}from'./context.js';function a152_0x3bc8(){const _0x2c335f=['trim','sanitize','Cannot\x20read\x20issue\x20description\x20file:\x20','otel://','title','Check\x20your\x20login\x20and\x20network\x20connectivity.','keys','traceName','originalBytes','Failed\x20to\x20submit\x20issue\x20log:\x20','2VrYCeR','3657936YCBhwJ','Path\x20to\x20a\x20markdown\x20file\x20whose\x20contents\x20become\x20issue.description','4532308CbmEjH','str','922662XAjBBd','Inline\x20markdown\x20issue\x20description\x20(alternative\x20to\x20--description-file)','compress','filter','Report\x20a\x20problem\x20log\x20with\x20title\x20and\x20markdown\x20context','251701IRMbHS','logData','10PKCAet','25NcYtUB','description-file','redactions:\x20','spanName','validation','description','report','redactionKinds','Use\x20--description\x20for\x20short\x20markdown\x20text,\x20or\x20--description-file\x20for\x20full\x20issue\x20context.','Provide\x20exactly\x20one\x20of\x20--description\x20or\x20--description-file.','inline','descriptionSource','string','redactionCount','length','Submit\x20a\x20problem\x20log','5820PrRGrM','cwd','apiError','900963EqEblM','1316MDgZam','descriptionFilePath','flagMissing','18440bRHWiV','truncated','POST','message','utf8','\x20bytes','File\x20not\x20found:\x20'];a152_0x3bc8=function(){return _0x2c335f;};return a152_0x3bc8();}const DESCRIPTION_FILE_FLAG=a152_0x3105d2(0xc9);export const issueReport={'service':'issue','command':a152_0x3105d2(0xce),'description':a152_0x3105d2(0xc4),'risk':'write','confirmationDescription':'Submit\x20the\x20issue\x20description\x20and\x20diagnostic\x20context\x20as\x20a\x20problem\x20log.','requiresAuth':!![],'requiresAppCode':![],'defaultOutputFormat':a152_0x3105d2(0xc2),'flags':[{'name':'title','type':a152_0x3105d2(0xd4),'required':!![],'description':'One-line\x20issue\x20summary'},{'name':a152_0x3105d2(0xcd),'type':a152_0x3105d2(0xd4),'description':a152_0x3105d2(0xc1)},{'name':DESCRIPTION_FILE_FLAG,'type':a152_0x3105d2(0xd4),'description':a152_0x3105d2(0xbd)}],async 'validate'(_0xb46acf){const _0x239564=a152_0x3105d2,_0xe76c04=_0xb46acf[_0x239564(0xbf)](_0x239564(0xea))['trim'](),_0x3ac986=_0xb46acf[_0x239564(0xbf)](_0x239564(0xcd))['trim'](),_0x40fdb0=_0xb46acf['str'](DESCRIPTION_FILE_FLAG)['trim']();if(!_0xe76c04)throw CliErrors[_0x239564(0xde)](_0x239564(0xea),'Provide\x20--title\x20with\x20a\x20one-line\x20issue\x20summary.');const _0xd2a916=_0x3ac986[_0x239564(0xd6)]>0x0,_0x3a2d0c=_0x40fdb0[_0x239564(0xd6)]>0x0;if(_0xd2a916===_0x3a2d0c)throw CliErrors[_0x239564(0xcc)](_0x239564(0xd1),_0x239564(0xd0));if(_0x3a2d0c){const _0x5cc9d1=resolve(process[_0x239564(0xd9)](),_0x40fdb0);if(!existsSync(_0x5cc9d1))throw CliErrors[_0x239564(0xcc)](_0x239564(0xe5)+_0x5cc9d1);}},async 'dryRun'(_0x1a065b){const _0x56cb73=a152_0x3105d2,_0xccbfe6=await prepareIssueReport(_0x1a065b,!![]);return{'method':_0x56cb73(0xe1),'url':_0x56cb73(0xe9)+_0xccbfe6[_0x56cb73(0xed)]+'/'+_0xccbfe6['spanName'],'body':{'traceName':_0xccbfe6[_0x56cb73(0xed)],'spanName':_0xccbfe6[_0x56cb73(0xcb)],'logData':_0xccbfe6['logData']},'description':[_0x56cb73(0xd7),'descriptionSource:\x20'+_0xccbfe6[_0x56cb73(0xd3)],_0xccbfe6['descriptionFilePath']?'descriptionFile:\x20'+_0xccbfe6['descriptionFilePath']:null,_0xccbfe6[_0x56cb73(0xe7)][_0x56cb73(0xe0)]?'truncated:\x20original\x20'+_0xccbfe6['sanitize'][_0x56cb73(0xee)]+_0x56cb73(0xe4):null,_0xccbfe6[_0x56cb73(0xe7)][_0x56cb73(0xd5)]>0x0?_0x56cb73(0xca)+_0xccbfe6[_0x56cb73(0xe7)]['redactionCount']+'\x20('+_0xccbfe6[_0x56cb73(0xe7)][_0x56cb73(0xcf)]['join'](',\x20')+')':null][_0x56cb73(0xc3)](Boolean)['join']('\x0a')};},async 'execute'(_0x4ac215){const _0x19bace=a152_0x3105d2,_0x9127ff=await prepareIssueReport(_0x4ac215,![]);return{'ok':!![],'message':_0x9127ff[_0x19bace(0xe7)][_0x19bace(0xd5)]||_0x9127ff[_0x19bace(0xe7)][_0x19bace(0xe0)]?'Issue\x20log\x20submitted\x20(content\x20redacted\x20or\x20truncated)':'Issue\x20log\x20submitted','data':{'traceName':_0x9127ff[_0x19bace(0xed)],'spanName':_0x9127ff[_0x19bace(0xcb)],'logDataKeys':Object[_0x19bace(0xec)](_0x9127ff[_0x19bace(0xc6)]),'issue':{'title':_0x9127ff[_0x19bace(0xea)],'descriptionLength':_0x9127ff[_0x19bace(0xcd)]['length'],'descriptionSource':_0x9127ff[_0x19bace(0xd3)],..._0x9127ff[_0x19bace(0xdd)]?{'descriptionFile':_0x9127ff[_0x19bace(0xdd)]}:{},'sanitize':{'originalBytes':_0x9127ff[_0x19bace(0xe7)][_0x19bace(0xee)],'truncated':_0x9127ff[_0x19bace(0xe7)]['truncated'],'redactions':_0x9127ff['sanitize'][_0x19bace(0xd5)],'redactionKinds':_0x9127ff[_0x19bace(0xe7)]['redactionKinds']}}}};}};function a152_0x9746(_0xf7c0bb,_0x3ba6ef){_0xf7c0bb=_0xf7c0bb-0xbb;const _0x3bc8a7=a152_0x3bc8();let _0x97462f=_0x3bc8a7[_0xf7c0bb];return _0x97462f;}async function prepareIssueReport(_0x510b51,_0x38208e){const _0x2ed88c=a152_0x3105d2;await issueReport['validate'](_0x510b51);const _0x2055dc=_0x510b51[_0x2ed88c(0xbf)](DESCRIPTION_FILE_FLAG)[_0x2ed88c(0xe6)](),_0x2e943c=_0x2055dc?resolve(process[_0x2ed88c(0xd9)](),_0x2055dc):undefined;let _0x10594d=_0x510b51[_0x2ed88c(0xbf)]('description');if(_0x2e943c)try{_0x10594d=await readFile(_0x2e943c,_0x2ed88c(0xe3));}catch{throw CliErrors[_0x2ed88c(0xcc)](_0x2ed88c(0xe8)+_0x2e943c);}if(!_0x10594d[_0x2ed88c(0xe6)]())throw CliErrors['validation']('Issue\x20description\x20cannot\x20be\x20empty.');const _0x5e8b13=await getIssueReportContext(_0x510b51,_0x38208e);try{const _0x2d639e=await reportIssue({'title':_0x510b51[_0x2ed88c(0xbf)]('title'),'description':_0x10594d,'context':_0x5e8b13,'dryRun':_0x38208e,'redactDescription':process.env.RABETBASE_ISSUE_RAW_DESCRIPTION!=='1'});return{..._0x2d639e,'descriptionSource':_0x2e943c?'file':_0x2ed88c(0xd2),'descriptionFilePath':_0x2e943c};}catch(_0x33bd7b){throw CliErrors[_0x2ed88c(0xda)](_0x2ed88c(0xef)+(_0x33bd7b instanceof Error?_0x33bd7b[_0x2ed88c(0xe2)]:String(_0x33bd7b)),_0x2ed88c(0xeb));}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a153_0x3a1a02=a153_0x4deb;function a153_0x4deb(_0x22ca43,_0x4bf334){_0x22ca43=_0x22ca43-0x13a;const _0x531d70=a153_0x531d();let _0x4deb19=_0x531d70[_0x22ca43];return _0x4deb19;}(function(_0x101578,_0x2663cb){const _0x51e311=a153_0x4deb,_0x1b72b0=_0x101578();while(!![]){try{const _0x2ae3f7=parseInt(_0x51e311(0x145))/0x1*(-parseInt(_0x51e311(0x13c))/0x2)+parseInt(_0x51e311(0x158))/0x3+parseInt(_0x51e311(0x147))/0x4*(-parseInt(_0x51e311(0x14b))/0x5)+parseInt(_0x51e311(0x15e))/0x6+-parseInt(_0x51e311(0x163))/0x7+parseInt(_0x51e311(0x167))/0x8*(parseInt(_0x51e311(0x144))/0x9)+parseInt(_0x51e311(0x150))/0xa*(parseInt(_0x51e311(0x153))/0xb);if(_0x2ae3f7===_0x2663cb)break;else _0x1b72b0['push'](_0x1b72b0['shift']());}catch(_0x3a24f2){_0x1b72b0['push'](_0x1b72b0['shift']());}}}(a153_0x531d,0xf13bc));import{knowledgeDocumentsPath}from'../../core/api-client.js';import{createEnterpriseKnowledgeBase,isPlatformTransportFailure}from'../../core/api-client.js';function a153_0x531d(){const _0xf59326=['kb_create_outcome_unknown','kb_already_exists','cookie','2779845cEXrDY','Pass\x20a\x20UTF-8\x20text\x20or\x20Markdown\x20file.','length','version','contentHash','\x20does\x20not\x20match\x20the\x20requested\x20create\x20state.','4052736LbxGvs','Do\x20not\x20resubmit.\x20Inspect\x20the\x20resolved\x20app\x20and\x20determine\x20the\x20outcome\x20manually.','trim','stringify','rabetbase\x20kb\x20detail\x20--id\x20','7365533oCXNyd','--file\x20is\x20required.','Create\x20a\x20company\x20knowledge\x20base\x20from\x20a\x20UTF-8\x20text\x20or\x20Markdown\x20file','kb_title_required','120fDJDmd','Create\x20response\x20was\x20unavailable;\x20recovered\x20one\x20exact\x20company/app/title\x20record\x20without\x20resubmitting.','str','Inspect\x20it\x20with\x20`rabetbase\x20kb\x20detail\x20--id\x20','\x20with\x20title\x20','kb_file_required','1446xxNSbc','The\x20created\x20document\x20version\x20changed\x20after\x20its\x20write\x20response.\x20Inspect\x20it\x20without\x20resubmitting.','string','appCode','content','\x20--format\x20compress','company','Created\x20company\x20knowledge\x20base\x20','40563immtVX','539gwQIKV','\x20--format\x20compress`;\x20do\x20not\x20resubmit\x20automatically.','793136FddWog','Expected\x20one\x20exact\x20company\x20knowledge\x20base\x20after\x20uncertain\x20create;\x20found\x20','POST','create','30jHhQAf','title','byteSize','Run\x20`rabetbase\x20kb\x20detail\x20--id\x20','Knowledge-base\x20title','790ExXqpj','file','verified','271524XxynEv','rabetbase\x20kb\x20list\x20--title\x20'];a153_0x531d=function(){return _0xf59326;};return a153_0x531d();}import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCompanyKnowledgeBase,fetchAllCompanyKnowledgeBases,findExactCompanyKnowledgeBases,inspectKbContent,kbError,projectKb,readKbFile,requireKb,verifyKbMutationReadback}from'../../commands/kb/shared.js';function readCreateInput(_0x1aae2a){const _0x1a3624=a153_0x4deb,_0x56d8cb=_0x1aae2a[_0x1a3624(0x169)](_0x1a3624(0x14c))[_0x1a3624(0x160)]();if(!_0x56d8cb)throw kbError(_0x1a3624(0x166),'--title\x20is\x20required.');const _0x1c0a57=_0x1aae2a[_0x1a3624(0x169)](_0x1a3624(0x151))[_0x1a3624(0x160)]();if(!_0x1c0a57)throw kbError(_0x1a3624(0x13b),_0x1a3624(0x164),_0x1a3624(0x159));return{'title':_0x56d8cb,'file':_0x1c0a57};}async function prepareCreate(_0x3b0725){const _0x1be885=a153_0x4deb,_0x39e0df=readCreateInput(_0x3b0725),_0x5036cc=await readKbFile(_0x39e0df[_0x1be885(0x151)]),_0x4eb2e0=await fetchAllCompanyKnowledgeBases(_0x3b0725,{'title':_0x39e0df['title']}),_0x1dfe70=findExactCompanyKnowledgeBases(_0x4eb2e0,_0x3b0725[_0x1be885(0x13f)],_0x39e0df['title']);if(_0x1dfe70[_0x1be885(0x15a)]>0x0)throw kbError(_0x1be885(0x156),'Company\x20knowledge\x20base\x20already\x20exists\x20for\x20app\x20'+_0x3b0725[_0x1be885(0x13f)]+_0x1be885(0x13a)+_0x39e0df[_0x1be885(0x14c)]+'.',_0x1be885(0x14e)+_0x1dfe70[0x0]['id']+'\x20--format\x20compress`\x20before\x20choosing\x20update.');return{..._0x39e0df,'content':_0x5036cc};}function plannedAfter(_0x205886,_0x3a7a0f){const _0x471b1a=a153_0x4deb;return{'scope':_0x471b1a(0x142),'appCode':_0x205886[_0x471b1a(0x13f)],'title':_0x3a7a0f[_0x471b1a(0x14c)],'contentByteSize':_0x3a7a0f['content'][_0x471b1a(0x14d)],'contentHash':_0x3a7a0f['content']['contentHash']};}function verifyCreatedState(_0x4e6ab5,_0x388164,_0x11d35b){const _0x4bbaf5=a153_0x4deb;assertCompanyKnowledgeBase(_0x11d35b,_0x4e6ab5[_0x4bbaf5(0x13f)],_0x11d35b['id']);const _0x4b55b4=inspectKbContent(_0x11d35b[_0x4bbaf5(0x140)]);if(_0x11d35b['title']!==_0x388164[_0x4bbaf5(0x14c)]||_0x4b55b4[_0x4bbaf5(0x15c)]!==_0x388164['content'][_0x4bbaf5(0x15c)])throw kbError('kb_verification_failed','Company\x20knowledge\x20base\x20'+_0x11d35b['id']+_0x4bbaf5(0x15d),_0x4bbaf5(0x16a)+_0x11d35b['id']+_0x4bbaf5(0x146));return projectKb(_0x11d35b);}export const kbCreate={'service':'kb','command':a153_0x3a1a02(0x14a),'description':a153_0x3a1a02(0x165),'risk':'write','requiresAppCode':!![],'structuredErrors':!![],'flags':[{'name':a153_0x3a1a02(0x14c),'type':'string','required':!![],'description':a153_0x3a1a02(0x14f)},{'name':a153_0x3a1a02(0x151),'type':a153_0x3a1a02(0x13e),'required':!![],'description':'UTF-8\x20text\x20or\x20Markdown\x20content\x20file'}],async 'validate'(_0x33708a){readCreateInput(_0x33708a);},async 'dryRun'(_0x1de755){const _0xcca600=a153_0x3a1a02,_0x84a2b0=await prepareCreate(_0x1de755);return asDryRunResult({'operation':_0xcca600(0x14a),'selector':{'scope':_0xcca600(0x142),'appCode':_0x1de755[_0xcca600(0x13f)],'title':_0x84a2b0[_0xcca600(0x14c)]},'before':null,'after':plannedAfter(_0x1de755,_0x84a2b0),'dryRun':!![],'backend':{'method':_0xcca600(0x149),'path':knowledgeDocumentsPath(_0xcca600(0x142),_0xcca600(0x14a)),'body':{'appCode':_0x1de755[_0xcca600(0x13f)],'title':_0x84a2b0['title'],'contentHash':_0x84a2b0['content'][_0xcca600(0x15c)],'contentByteSize':_0x84a2b0['content']['byteSize']}},'warnings':[],'verification':{'lookupCommand':_0xcca600(0x154)+JSON[_0xcca600(0x161)](_0x84a2b0[_0xcca600(0x14c)])+_0xcca600(0x141)}},{'method':_0xcca600(0x149),'url':knowledgeDocumentsPath(_0xcca600(0x142),_0xcca600(0x14a))});},async 'execute'(_0x31c92d){const _0x543c90=a153_0x3a1a02,_0x5afb3d=await prepareCreate(_0x31c92d);let _0x5199dc,_0x436cd3,_0x17dcb1=![];try{const _0x5a4913=await createEnterpriseKnowledgeBase(_0x31c92d[_0x543c90(0x157)],{'appCode':_0x31c92d['appCode'],'title':_0x5afb3d[_0x543c90(0x14c)],'content':_0x5afb3d[_0x543c90(0x140)][_0x543c90(0x140)]});assertCompanyKnowledgeBase(_0x5a4913,_0x31c92d[_0x543c90(0x13f)],_0x5a4913['id']),_0x5199dc=_0x5a4913['id'],_0x436cd3=_0x5a4913[_0x543c90(0x15b)];}catch(_0x51f97d){if(!isPlatformTransportFailure(_0x51f97d))throw _0x51f97d;_0x17dcb1=!![];}if(_0x5199dc===undefined){const _0x17f382=await verifyKbMutationReadback(_0x543c90(0x14a),!![],()=>fetchAllCompanyKnowledgeBases(_0x31c92d,{'title':_0x5afb3d['title']})),_0x471947=findExactCompanyKnowledgeBases(_0x17f382,_0x31c92d['appCode'],_0x5afb3d[_0x543c90(0x14c)]);if(_0x471947['length']!==0x1)throw kbError(_0x543c90(0x155),_0x543c90(0x148)+_0x471947[_0x543c90(0x15a)]+'.',_0x543c90(0x15f));_0x5199dc=_0x471947[0x0]['id'];}const _0x1e9c6b=await verifyKbMutationReadback(_0x543c90(0x14a),_0x17dcb1,()=>requireKb(_0x31c92d,_0x5199dc));if(_0x436cd3!==undefined&&_0x1e9c6b['version']!==_0x436cd3)throw kbError('kb_verification_failed',_0x543c90(0x13d));const _0x18b8eb=verifyCreatedState(_0x31c92d,_0x5afb3d,_0x1e9c6b),_0x5525d8=_0x17dcb1?[_0x543c90(0x168)]:[];return{'ok':!![],'data':{'operation':_0x543c90(0x14a),'selector':{'id':_0x18b8eb['id'],'scope':_0x543c90(0x142),'appCode':_0x18b8eb[_0x543c90(0x13f)]},'before':null,'after':_0x18b8eb,'dryRun':![],'backend':{'method':_0x543c90(0x149),'path':knowledgeDocumentsPath(_0x543c90(0x142),_0x543c90(0x14a))},'warnings':_0x5525d8,'verification':{'status':_0x543c90(0x152),'recoveredAfterUnknownResponse':_0x17dcb1,'lookupCommand':_0x543c90(0x162)+_0x18b8eb['id']+_0x543c90(0x141)}},'message':_0x543c90(0x143)+_0x18b8eb['id']+'\x20for\x20'+_0x18b8eb[_0x543c90(0x13f)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a154_0x5f48(_0x3c4968,_0xc455e1){_0x3c4968=_0x3c4968-0x180;const _0x16ed50=a154_0x16ed();let _0x5f4879=_0x16ed50[_0x3c4968];return _0x5f4879;}const a154_0x354883=a154_0x5f48;(function(_0x61372e,_0x12a6af){const _0x344bd0=a154_0x5f48,_0x26d794=_0x61372e();while(!![]){try{const _0x2ee716=-parseInt(_0x344bd0(0x194))/0x1+-parseInt(_0x344bd0(0x192))/0x2*(-parseInt(_0x344bd0(0x184))/0x3)+-parseInt(_0x344bd0(0x187))/0x4+-parseInt(_0x344bd0(0x198))/0x5*(-parseInt(_0x344bd0(0x18c))/0x6)+-parseInt(_0x344bd0(0x19d))/0x7+-parseInt(_0x344bd0(0x18e))/0x8+-parseInt(_0x344bd0(0x197))/0x9*(-parseInt(_0x344bd0(0x18a))/0xa);if(_0x2ee716===_0x12a6af)break;else _0x26d794['push'](_0x26d794['shift']());}catch(_0x325541){_0x26d794['push'](_0x26d794['shift']());}}}(a154_0x16ed,0xceb32));import{knowledgeDocumentsPath}from'../../core/api-client.js';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';const RAG_WARNING=a154_0x354883(0x1a1);function readExpectedVersion(_0x5f3b18){const _0x2005ec=a154_0x354883,_0x31f86c=_0x5f3b18[_0x2005ec(0x19e)](_0x2005ec(0x1a5));if(_0x31f86c===undefined)return undefined;const _0x516a6=Number(_0x31f86c);if(!Number[_0x2005ec(0x18d)](_0x516a6)||_0x516a6<0x1)throw kbError(_0x2005ec(0x196),_0x2005ec(0x190));return _0x516a6;}function a154_0x16ed(){const _0x4ba8f7=['unshift','company','64263UqsZtC','\x20is\x20already\x20absent;\x20no\x20delete\x20request\x20was\x20made','already_absent','4036216THJToB','\x20--format\x20compress','Inspect\x20it\x20with\x20`rabetbase\x20kb\x20detail\x20--id\x20','31922930RMjfhA','\x20remains\x20readable\x20after\x20delete.','498WlMrVR','isSafeInteger','9903576SBSkgO','delete','--expected-version\x20must\x20be\x20a\x20positive\x20safe\x20integer.','verified','80IrcsQq','snapshotHash','1086468utjqJB','rabetbase\x20kb\x20detail\x20--id\x20','kb_expected_version_invalid','9BBVmOM','53575lrjHKF','version','Require\x20the\x20current\x20version\x20before\x20atomic\x20compare-and-set','high-risk-write','Soft-deleted\x20company\x20knowledge\x20base\x20','5308569lkdOin','flag','Company\x20knowledge\x20base\x20','appCode','Database\x20soft\x20deletion\x20was\x20verified;\x20asynchronous\x20RAG\x20cleanup\x20was\x20not\x20verified\x20by\x20the\x20CLI.','number','Delete\x20response\x20was\x20unavailable;\x20exact-ID\x20not-found\x20readback\x20verified\x20database\x20soft\x20deletion\x20without\x20resubmitting.','cookie','expected-version','kb_delete_outcome_unknown','string','POST'];a154_0x16ed=function(){return _0x4ba8f7;};return a154_0x16ed();}function noOpData(_0x58849c,_0x4de684,_0x598a0f){const _0x19b88d=a154_0x354883;return{'operation':'no_op','selector':{'id':_0x4de684,'scope':_0x19b88d(0x183),'appCode':_0x58849c[_0x19b88d(0x1a0)]},'before':null,'after':null,'dryRun':_0x598a0f,'deleteCalled':![],'backend':{'method':_0x19b88d(0x181),'path':knowledgeDocumentsPath(_0x19b88d(0x183),'delete')},'warnings':[],'verification':{'status':_0x19b88d(0x186),'databaseSoftDelete':!![],'ragCleanup':{'asynchronous':!![],'verified':![]}}};}export const kbDelete={'service':'kb','command':a154_0x354883(0x18f),'description':'Soft-delete\x20a\x20company\x20knowledge\x20base\x20for\x20the\x20resolved\x20app','risk':a154_0x354883(0x19b),'requiresAppCode':!![],'structuredErrors':!![],'flags':[{'name':'id','type':a154_0x354883(0x180),'required':!![],'description':'Company\x20knowledge-base\x20id'},{'name':a154_0x354883(0x1a5),'type':a154_0x354883(0x1a2),'required':![],'description':a154_0x354883(0x19a)}],async 'validate'(_0x2f116c){readKbId(_0x2f116c),readExpectedVersion(_0x2f116c),requireKbExplicitYes(_0x2f116c);},async 'dryRun'(_0x4d32e1){const _0xd73dd3=a154_0x354883,_0x3f3902=readKbId(_0x4d32e1),_0x229a0c=readExpectedVersion(_0x4d32e1),_0x4027fb=await getKbOrNull(_0x4d32e1,_0x3f3902);if(!_0x4027fb)return asDryRunResult(noOpData(_0x4d32e1,_0x3f3902,!![]),{'method':'POST','url':knowledgeDocumentsPath('company',_0xd73dd3(0x18f))});assertExpectedKbVersion(_0x4027fb,_0x229a0c);const _0x4ce99e=projectKb(_0x4027fb),_0x1ba6a5=[RAG_WARNING];return asDryRunResult({'operation':'delete','selector':{'id':_0x4ce99e['id'],'scope':'company','appCode':_0x4ce99e[_0xd73dd3(0x1a0)]},'before':_0x4ce99e,'after':null,'dryRun':!![],'deleteCalled':![],'backend':{'method':'POST','path':knowledgeDocumentsPath(_0xd73dd3(0x183),_0xd73dd3(0x18f)),'body':{'appCode':_0x4d32e1[_0xd73dd3(0x1a0)],'id':_0x3f3902,'expectedVersion':_0x4027fb['version']}},'warnings':_0x1ba6a5,'verification':{'expectedVersion':_0x4027fb[_0xd73dd3(0x199)],'atomicCompareAndSet':!![],'snapshotHash':_0x4ce99e[_0xd73dd3(0x193)],'databaseSoftDelete':!![],'ragCleanup':{'asynchronous':!![],'verified':![]},'lookupCommand':_0xd73dd3(0x195)+_0x4ce99e['id']+_0xd73dd3(0x188)}},{'method':_0xd73dd3(0x181),'url':knowledgeDocumentsPath(_0xd73dd3(0x183),'delete')});},async 'execute'(_0x26cd09){const _0x43ba00=a154_0x354883;requireKbExplicitYes(_0x26cd09);const _0x56debc=readKbId(_0x26cd09),_0x2483c6=readExpectedVersion(_0x26cd09),_0x407782=await getKbOrNull(_0x26cd09,_0x56debc);if(!_0x407782)return{'ok':!![],'data':noOpData(_0x26cd09,_0x56debc,![]),'message':'Company\x20knowledge\x20base\x20'+_0x56debc+_0x43ba00(0x185)};assertExpectedKbVersion(_0x407782,_0x2483c6);const _0x1c2e44=projectKb(_0x407782);let _0x452ae4=![];try{await deleteEnterpriseKnowledgeBase(_0x26cd09[_0x43ba00(0x1a4)],_0x56debc,_0x26cd09[_0x43ba00(0x1a0)],_0x407782[_0x43ba00(0x199)]);}catch(_0x26f0d2){if(!isPlatformTransportFailure(_0x26f0d2))throw _0x26f0d2;_0x452ae4=!![];}const _0x3b20d4=await verifyKbMutationReadback(_0x43ba00(0x18f),_0x452ae4,()=>getKbOrNull(_0x26cd09,_0x56debc));if(_0x3b20d4)throw kbError(_0x452ae4?_0x43ba00(0x1a6):'kb_verification_failed',_0x43ba00(0x19f)+_0x56debc+_0x43ba00(0x18b),_0x43ba00(0x189)+_0x56debc+'\x20--format\x20compress`;\x20do\x20not\x20resubmit\x20automatically.');const _0x1e270b=[RAG_WARNING];return _0x452ae4&&_0x1e270b[_0x43ba00(0x182)](_0x43ba00(0x1a3)),{'ok':!![],'data':{'operation':_0x43ba00(0x18f),'selector':{'id':_0x1c2e44['id'],'scope':_0x43ba00(0x183),'appCode':_0x1c2e44[_0x43ba00(0x1a0)]},'before':_0x1c2e44,'after':null,'dryRun':![],'deleteCalled':!![],'backend':{'method':'POST','path':knowledgeDocumentsPath(_0x43ba00(0x183),'delete')},'warnings':_0x1e270b,'verification':{'status':_0x43ba00(0x191),'databaseSoftDelete':!![],'ragCleanup':{'asynchronous':!![],'verified':![]},'recoveredAfterUnknownResponse':_0x452ae4,'lookupCommand':_0x43ba00(0x195)+_0x1c2e44['id']+_0x43ba00(0x188)}},'message':_0x43ba00(0x19c)+_0x1c2e44['id']};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a155_0x3a3d55=a155_0x26aa;function a155_0x580d(){const _0x25eff0=['detail','3310740LcQAGV','150ajkUKj','Company\x20knowledge-base\x20id','2056054yOQtvu','string','17964BLgcfa','610419uVJMxA','1273401UlHNHZ','Show\x20one\x20company\x20knowledge\x20base\x20with\x20full\x20content\x20for\x20the\x20resolved\x20app','316337wfWIut','327228EcQQcf','14072aCqGSm'];a155_0x580d=function(){return _0x25eff0;};return a155_0x580d();}(function(_0x52e6d6,_0x35ef84){const _0x26a326=a155_0x26aa,_0x479aa9=_0x52e6d6();while(!![]){try{const _0x19370c=-parseInt(_0x26a326(0xe3))/0x1+-parseInt(_0x26a326(0xe0))/0x2+parseInt(_0x26a326(0xd7))/0x3+parseInt(_0x26a326(0xda))/0x4+-parseInt(_0x26a326(0xdd))/0x5+-parseInt(_0x26a326(0xde))/0x6*(parseInt(_0x26a326(0xd9))/0x7)+-parseInt(_0x26a326(0xdb))/0x8*(-parseInt(_0x26a326(0xe2))/0x9);if(_0x19370c===_0x35ef84)break;else _0x479aa9['push'](_0x479aa9['shift']());}catch(_0x3dac34){_0x479aa9['push'](_0x479aa9['shift']());}}}(a155_0x580d,0x8f475));import{projectKb,readKbId,requireKb}from'../../commands/kb/shared.js';function a155_0x26aa(_0x52af8c,_0x3c0582){_0x52af8c=_0x52af8c-0xd7;const _0x580d86=a155_0x580d();let _0x26aa06=_0x580d86[_0x52af8c];return _0x26aa06;}export const kbDetail={'service':'kb','command':a155_0x3a3d55(0xdc),'description':a155_0x3a3d55(0xd8),'risk':'read','requiresAppCode':!![],'structuredErrors':!![],'flags':[{'name':'id','type':a155_0x3a3d55(0xe1),'required':!![],'description':a155_0x3a3d55(0xdf)}],async 'validate'(_0x30445d){readKbId(_0x30445d);},async 'execute'(_0x1f0f6f){const _0x30ec5d=readKbId(_0x1f0f6f),_0x3d5eb0=await requireKb(_0x1f0f6f,_0x30ec5d);return{'ok':!![],'data':{'knowledgeBase':{...projectKb(_0x3d5eb0),'content':_0x3d5eb0['content']}},'message':'Loaded\x20company\x20knowledge\x20base\x20'+_0x30ec5d};}};
|
package/lib/commands/kb/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a156_0x4744f2=a156_0x4c72;(function(_0x149d71,_0x3cb29b){const _0x2df906=a156_0x4c72,_0x403fc8=_0x149d71();while(!![]){try{const _0xc6d854=-parseInt(_0x2df906(0x131))/0x1+parseInt(_0x2df906(0x134))/0x2+-parseInt(_0x2df906(0x13a))/0x3*(-parseInt(_0x2df906(0x133))/0x4)+-parseInt(_0x2df906(0x135))/0x5*(-parseInt(_0x2df906(0x138))/0x6)+-parseInt(_0x2df906(0x139))/0x7+-parseInt(_0x2df906(0x130))/0x8+-parseInt(_0x2df906(0x136))/0x9*(-parseInt(_0x2df906(0x12f))/0xa);if(_0xc6d854===_0x3cb29b)break;else _0x403fc8['push'](_0x403fc8['shift']());}catch(_0x478931){_0x403fc8['push'](_0x403fc8['shift']());}}}(a156_0x5b07,0xad285));function a156_0x4c72(_0x34e4a7,_0x2110f7){_0x34e4a7=_0x34e4a7-0x12f;const _0x5b070b=a156_0x5b07();let _0x4c7293=_0x5b070b[_0x34e4a7];return _0x4c7293;}import{withKbManagementSession}from'../../core/kb-management-client.js';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';import{kbDelete}from'../../commands/kb/delete.js';function a156_0x5b07(){const _0x32d2da=['8868320ORkjiU','1279438ynnLnc','dryRun','4SJwSwS','2204696zCgBpf','605ZekaKL','1559133Gnewej','signal','5934IptBCJ','8871051KalqSE','2671278Nlsrot','130SGnnVx'];a156_0x5b07=function(){return _0x32d2da;};return a156_0x5b07();}export const kbDefinitions=[kbList,kbDetail,kbSearch,kbCreate,kbUpdate,kbDelete]['map'](_0xd8ac4e=>_0xd8ac4e['command']==='search'?_0xd8ac4e:{..._0xd8ac4e,'execute':_0x2cbeec=>withKbManagementSession(_0x2cbeec['signal'],()=>_0xd8ac4e['execute'](_0x2cbeec)),..._0xd8ac4e[a156_0x4744f2(0x132)]?{'dryRun':_0x2c3c90=>withKbManagementSession(_0x2c3c90[a156_0x4744f2(0x137)],()=>_0xd8ac4e['dryRun'](_0x2c3c90))}:{}});
|
package/lib/commands/kb/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a157_0x2fbdf3=a157_0x4237;(function(_0x5ee10a,_0x2e38b8){const _0x47aa3b=a157_0x4237,_0x715d78=_0x5ee10a();while(!![]){try{const _0x379557=-parseInt(_0x47aa3b(0xd0))/0x1*(-parseInt(_0x47aa3b(0xd6))/0x2)+-parseInt(_0x47aa3b(0xd4))/0x3+-parseInt(_0x47aa3b(0xd3))/0x4+-parseInt(_0x47aa3b(0xc8))/0x5+-parseInt(_0x47aa3b(0xc7))/0x6*(-parseInt(_0x47aa3b(0xcf))/0x7)+parseInt(_0x47aa3b(0xcd))/0x8+-parseInt(_0x47aa3b(0xc5))/0x9;if(_0x379557===_0x2e38b8)break;else _0x715d78['push'](_0x715d78['shift']());}catch(_0x14b546){_0x715d78['push'](_0x715d78['shift']());}}}(a157_0xc91b,0xd3085));function a157_0xc91b(){const _0x437d9f=['942785qXXXkg','list','str','trim','length','13008216XqxLIz','read','119ovizGu','5rhqScw','appCode','Found\x20','6623864ZHeCDT','1942800zgIqXD','title','204478WPoJeK','1475541QEHPks','map','488202wkuLeZ'];a157_0xc91b=function(){return _0x437d9f;};return a157_0xc91b();}import{fetchAllCompanyKnowledgeBases,projectKb}from'../../commands/kb/shared.js';function a157_0x4237(_0x364138,_0x48c5d2){_0x364138=_0x364138-0xc5;const _0xc91b03=a157_0xc91b();let _0x42376d=_0xc91b03[_0x364138];return _0x42376d;}export const kbList={'service':'kb','command':a157_0x2fbdf3(0xc9),'description':'List\x20company\x20knowledge\x20bases\x20for\x20the\x20resolved\x20app','risk':a157_0x2fbdf3(0xce),'requiresAppCode':!![],'structuredErrors':!![],'flags':[{'name':a157_0x2fbdf3(0xd5),'type':'string','required':![],'description':'Filter\x20by\x20knowledge-base\x20title'}],async 'execute'(_0x124aa0){const _0x4567f3=a157_0x2fbdf3,_0x7e7db1=_0x124aa0[_0x4567f3(0xca)](_0x4567f3(0xd5))[_0x4567f3(0xcb)](),_0x33a779=await fetchAllCompanyKnowledgeBases(_0x124aa0,{..._0x7e7db1?{'title':_0x7e7db1}:{}}),_0x5921ba=_0x33a779[_0x4567f3(0xc6)](projectKb);return{'ok':!![],'data':{'total':_0x5921ba['length'],'knowledgeBases':_0x5921ba},'message':_0x4567f3(0xd2)+_0x5921ba[_0x4567f3(0xcc)]+'\x20company\x20knowledge\x20base(s)\x20for\x20'+_0x124aa0[_0x4567f3(0xd1)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a158_0x4c37(_0x7f9450,_0x2a0206){_0x7f9450=_0x7f9450-0x16f;const _0x550ec0=a158_0x550e();let _0x4c3709=_0x550ec0[_0x7f9450];return _0x4c3709;}const a158_0x1c478b=a158_0x4c37;(function(_0x5246fb,_0x387216){const _0x20f41e=a158_0x4c37,_0x56b488=_0x5246fb();while(!![]){try{const _0x47311d=-parseInt(_0x20f41e(0x183))/0x1+-parseInt(_0x20f41e(0x16f))/0x2*(parseInt(_0x20f41e(0x17c))/0x3)+parseInt(_0x20f41e(0x170))/0x4+-parseInt(_0x20f41e(0x177))/0x5*(-parseInt(_0x20f41e(0x179))/0x6)+-parseInt(_0x20f41e(0x18c))/0x7+parseInt(_0x20f41e(0x17f))/0x8*(parseInt(_0x20f41e(0x184))/0x9)+parseInt(_0x20f41e(0x17d))/0xa*(-parseInt(_0x20f41e(0x181))/0xb);if(_0x47311d===_0x387216)break;else _0x56b488['push'](_0x56b488['shift']());}catch(_0x38be31){_0x56b488['push'](_0x56b488['shift']());}}}(a158_0x550e,0xd465d));import{searchDirectKnowledge,normalizeKbServiceOrigin}from'../../core/kb-search-client.js';function a158_0x550e(){const _0x315337=['11dQvJlB','Optional\x20trusted\x20KB\x20Service\x20HTTPS\x20origin\x20for\x20this\x20request\x20only','655441BueteQ','36oracPB','query','trim','Search\x20company\x20and\x20public\x20knowledge\x20for\x20the\x20resolved\x20app','Found\x20','search','validation','kb-service-url','4902030gzIzoQ','KB\x20Service\x20is\x20not\x20configured\x20for\x20knowledge\x20search.','Maximum\x20number\x20of\x20knowledge\x20hits\x20to\x20return','2zOVZCx','3772204tZpnKH','appCode','\x20company/public\x20knowledge\x20hit(s)\x20for\x20','signal','Search\x20query\x20is\x20required.','Company\x20and\x20public\x20knowledge\x20search\x20query','topk','5GaQZJS','--topk\x20must\x20be\x20an\x20integer\x20from\x201\x20through\x2050.','9920958vvSUMc','string','str','1861503nHkuxE','14491870zFSytR','Configure\x20kbServiceDomain\x20in\x20the\x20connection\x20settings,\x20or\x20pass\x20--kb-service-url\x20<https-origin>\x20for\x20this\x20request.','3397712bDsQYJ','cookie'];a158_0x550e=function(){return _0x315337;};return a158_0x550e();}import{CliErrors}from'../../errors.js';import{getKbServiceDomain}from'../../constant/domain.js';function readSearchQuery(_0x3c6f52){const _0x58ca5d=a158_0x4c37,_0x2d3797=_0x3c6f52['str']('query')[_0x58ca5d(0x186)]();if(!_0x2d3797)throw CliErrors[_0x58ca5d(0x18a)](_0x58ca5d(0x174));return _0x2d3797;}function readSearchTopK(_0x13a137){const _0x2fbeed=a158_0x4c37,_0x609020=_0x13a137['flag'](_0x2fbeed(0x176));if(_0x609020===undefined||_0x609020===null||_0x609020==='')return undefined;const _0x4b6e9f=_0x13a137['num']('topk');if(!Number['isSafeInteger'](_0x4b6e9f)||_0x4b6e9f<0x1||_0x4b6e9f>0x32)throw CliErrors[_0x2fbeed(0x18a)](_0x2fbeed(0x178));return _0x4b6e9f;}function readSearchServiceUrl(_0x49d07b){const _0x125a9e=a158_0x4c37;if(_0x49d07b['flag'](_0x125a9e(0x18b))!==undefined)return normalizeKbServiceOrigin(_0x49d07b[_0x125a9e(0x17b)](_0x125a9e(0x18b)));const _0x2bac03=getKbServiceDomain();if(!_0x2bac03)throw CliErrors[_0x125a9e(0x18a)](_0x125a9e(0x18d),_0x125a9e(0x17e));return normalizeKbServiceOrigin(_0x2bac03);}export const kbSearch={'service':'kb','command':a158_0x1c478b(0x189),'description':a158_0x1c478b(0x187),'risk':'read','requiresAppCode':!![],'structuredErrors':!![],'strictFlags':!![],'flags':[{'name':a158_0x1c478b(0x185),'type':a158_0x1c478b(0x17a),'required':!![],'description':a158_0x1c478b(0x175)},{'name':a158_0x1c478b(0x176),'type':'number','required':![],'description':a158_0x1c478b(0x18e)},{'name':a158_0x1c478b(0x18b),'type':a158_0x1c478b(0x17a),'required':![],'description':a158_0x1c478b(0x182)}],async 'validate'(_0x1721e5){readSearchQuery(_0x1721e5),readSearchTopK(_0x1721e5),readSearchServiceUrl(_0x1721e5);},async 'execute'(_0xac748d){const _0x43b906=a158_0x1c478b,_0x566208=readSearchQuery(_0xac748d),_0x1f516e=readSearchTopK(_0xac748d),_0x414d4b=readSearchServiceUrl(_0xac748d),_0x4776f6={'cookie':_0xac748d[_0x43b906(0x180)],'query':_0x566208,'appCode':_0xac748d[_0x43b906(0x171)],..._0x1f516e!==undefined?{'topK':_0x1f516e}:{},'signal':_0xac748d[_0x43b906(0x173)]},_0x340ad4=await searchDirectKnowledge({..._0x4776f6,'serviceUrl':_0x414d4b});return{'ok':!![],'data':_0x340ad4,'message':_0x43b906(0x188)+_0x340ad4['total']+_0x43b906(0x172)+_0xac748d[_0x43b906(0x171)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a159_0x5f27f4=a159_0x106e;(function(_0x1cf236,_0x135b96){const _0x37f709=a159_0x106e,_0x187a99=_0x1cf236();while(!![]){try{const _0x2287db=-parseInt(_0x37f709(0x1b6))/0x1+parseInt(_0x37f709(0x1ab))/0x2+-parseInt(_0x37f709(0x191))/0x3*(parseInt(_0x37f709(0x1af))/0x4)+parseInt(_0x37f709(0x1c2))/0x5*(-parseInt(_0x37f709(0x194))/0x6)+-parseInt(_0x37f709(0x1b1))/0x7+-parseInt(_0x37f709(0x1b4))/0x8+parseInt(_0x37f709(0x19b))/0x9;if(_0x2287db===_0x135b96)break;else _0x187a99['push'](_0x187a99['shift']());}catch(_0x540dc9){_0x187a99['push'](_0x187a99['shift']());}}}(a159_0x5b1d,0x8e7a1));function a159_0x106e(_0x362896,_0x506b4c){_0x362896=_0x362896-0x166;const _0x5b1d27=a159_0x5b1d();let _0x106edf=_0x5b1d27[_0x362896];return _0x106edf;}import{createHash}from'node:crypto';import{readFile,stat}from'node:fs/promises';import{resolve}from'node:path';import{TextDecoder}from'node:util';function a159_0x5b1d(){const _0x4a6e4a=['Knowledge-base\x20content\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','Knowledge-base\x20list\x20returned\x20an\x20inconsistent\x20page\x20size\x20or\x20record\x20count.','paging',',\x20current\x20','\x20during\x20paging.','kb_','version','760710wGblVO','items','contentHash','Knowledge-base\x20content\x20file\x20path\x20is\x20required.','verification_unavailable','kb_file_required','byteLength','str','\x20response\x20is\x20missing\x20','updateTime','min','cookie','Knowledge-base\x20list\x20returned\x20page\x20','hex','createTime','kb_list_contract_invalid','string','sha256:','indexedVersion','Cannot\x20access\x20knowledge-base\x20content\x20file:\x20','306','kb_id_invalid','Knowledge\x20base\x20','Run\x20`rabetbase\x20kb\x20list\x20--format\x20compress`\x20to\x20inspect\x20the\x20resolved\x20app.','kb_state_drift','has','Knowledge-base\x20response\x20contains\x20an\x20invalid\x20id.','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.','\x20while\x20page\x20','\x20of\x20','push','\x20while\x20id\x20','currentPage','--id\x20must\x20be\x20a\x20positive\x20decimal\x20integer\x20string.','Run\x20the\x20command\x20with\x20--dry-run\x20again\x20and\x20review\x20the\x20latest\x20version\x20before\x20retrying.','test','This\x20company\x20knowledge-base\x20mutation\x20requires\x20explicit\x20--yes.','trim','indexStatus','add','stringify','message','kb_confirmation_required','Knowledge-base\x20get-one\x20returned\x20id\x20','237bdgzNu','max','company','6bSZJhz','pageSize','bool','\x20records.','kb_content_invalid','kb_file_invalid','scope','25431399jzPvsi','\x20request\x20was\x20sent,\x20but\x20its\x20final\x20company\x20knowledge-base\x20state\x20could\x20not\x20be\x20verified.','Knowledge-base\x20content\x20file\x20is\x20not\x20valid\x20UTF-8:\x20','from','pageTooLarge','floor','cause','\x20does\x20not\x20belong\x20to\x20company\x20scope\x20for\x20app\x20','allowEmpty','clear','outcome_unknown','appCode','kb_file_unreadable','isSafeInteger','utf8','title','527904pGuuNd','Knowledge-base\x20list\x20returned\x20an\x20invalid\x20or\x20repeated\x20id:\x20','\x20response\x20contains\x20an\x20invalid\x20version.','\x20was\x20requested.','12040ngPfpl','length','2773631vStWST','content','kb_response_invalid','4485048hSNQPn','yes','1159282iCZzdr','kb_not_found','dry-run','isFile','Knowledge-base\x20list\x20total\x20changed\x20from\x20'];a159_0x5b1d=function(){return _0x4a6e4a;};return a159_0x5b1d();}import{getEnterpriseKnowledgeBase,getPlatformErrorCode,getPlatformHttpStatus,listEnterpriseKnowledgeBases}from'../../core/api-client.js';import{KbManagementError}from'../../core/kb-management-client.js';import{CliError}from'../../errors.js';const LIST_PAGE_SIZE=0x32,DATA_NOT_EXIST_ERROR_CODE=a159_0x5f27f4(0x179);export function kbError(_0x3778dd,_0x48981e,_0x304fb8){return new CliError(_0x3778dd,0x1,_0x48981e,_0x304fb8);}export function readKbId(_0x225f84){const _0x289a3c=a159_0x5f27f4,_0xf63825=_0x225f84[_0x289a3c(0x16c)]('id');if(!/^0*[1-9][0-9]*$/[_0x289a3c(0x188)](_0xf63825))throw kbError(_0x289a3c(0x17a),_0x289a3c(0x186));return _0xf63825;}export function requireKbExplicitYes(_0x1d9421){const _0x361114=a159_0x5f27f4;if(_0x1d9421[_0x361114(0x196)](_0x361114(0x1b8))||_0x1d9421['bool'](_0x361114(0x1b5)))return;throw kbError(_0x361114(0x18f),_0x361114(0x189),_0x361114(0x180));}function sha256(_0x5b5662){const _0x8f6477=a159_0x5f27f4;return _0x8f6477(0x176)+createHash('sha256')['update'](_0x5b5662)['digest'](_0x8f6477(0x172));}export function inspectKbContent(_0x589f81){const _0x14f331=a159_0x5f27f4,_0x5cdb25=Buffer[_0x14f331(0x19e)](_0x589f81,_0x14f331(0x1a9));return{'content':_0x589f81,'byteSize':_0x5cdb25[_0x14f331(0x16b)],'contentHash':sha256(_0x5cdb25)};}export async function readKbFile(_0x560aea){const _0x3fc559=a159_0x5f27f4,_0x140b68=_0x560aea[_0x3fc559(0x18a)]();if(!_0x140b68)throw kbError(_0x3fc559(0x16a),_0x3fc559(0x168),'Pass\x20--file\x20<knowledge.md>.');const _0x42ac48=resolve(_0x140b68);let _0x5137d2;try{_0x5137d2=await stat(_0x42ac48);}catch(_0x4c92b2){throw kbError('kb_file_unreadable',_0x3fc559(0x178)+_0x140b68,_0x4c92b2 instanceof Error?_0x4c92b2[_0x3fc559(0x18e)]:String(_0x4c92b2));}if(!_0x5137d2[_0x3fc559(0x1b9)]())throw kbError(_0x3fc559(0x199),_0x3fc559(0x1bb)+_0x140b68);let _0x1309eb;try{_0x1309eb=await readFile(_0x42ac48);}catch(_0xd09753){throw kbError(_0x3fc559(0x1a7),'Cannot\x20read\x20knowledge-base\x20content\x20file:\x20'+_0x140b68,_0xd09753 instanceof Error?_0xd09753[_0x3fc559(0x18e)]:String(_0xd09753));}let _0x4c0051;try{_0x4c0051=new TextDecoder('utf-8',{'fatal':!![],'ignoreBOM':!![]})['decode'](_0x1309eb);}catch{throw kbError(_0x3fc559(0x198),_0x3fc559(0x19d)+_0x140b68);}if(!_0x4c0051[_0x3fc559(0x18a)]())throw kbError(_0x3fc559(0x198),'Knowledge-base\x20content\x20file\x20is\x20blank:\x20'+_0x140b68);return inspectKbContent(_0x4c0051);}export async function verifyKbMutationReadback(_0x59b8c4,_0x2784aa,_0x25d280){const _0x378cbe=a159_0x5f27f4;try{return await _0x25d280();}catch(_0x4efcb3){const _0x556d6d=kbError(_0x378cbe(0x1c0)+_0x59b8c4+'_'+(_0x2784aa?_0x378cbe(0x1a5):_0x378cbe(0x169)),'The\x20'+_0x59b8c4+_0x378cbe(0x19c),'Do\x20not\x20resubmit\x20automatically.\x20Resolve\x20the\x20app\x20again\x20and\x20inspect\x20the\x20target\x20state\x20manually.');Object['defineProperty'](_0x556d6d,_0x378cbe(0x1a1),{'value':_0x4efcb3,'enumerable':![]});throw _0x556d6d;}}function requireRecordText(_0xb8e6fd,_0x352522,_0xf3a740,_0xe74ced={}){const _0x27e82f=a159_0x5f27f4;if(typeof _0xb8e6fd===_0x27e82f(0x175)&&(_0xe74ced[_0x27e82f(0x1a3)]||_0xb8e6fd[_0x27e82f(0x18a)]()))return _0xb8e6fd;throw kbError(_0x27e82f(0x1b3),_0x27e82f(0x17b)+String(_0xf3a740)+_0x27e82f(0x16d)+_0x352522+'.');}export function projectKb(_0x15dc92){const _0x5d4c85=a159_0x5f27f4;if(typeof _0x15dc92['id']!==_0x5d4c85(0x175)||!/^0*[1-9][0-9]*$/[_0x5d4c85(0x188)](_0x15dc92['id']))throw kbError(_0x5d4c85(0x1b3),_0x5d4c85(0x17f));if(!Number[_0x5d4c85(0x1a8)](_0x15dc92[_0x5d4c85(0x1c1)])||_0x15dc92[_0x5d4c85(0x1c1)]<0x1)throw kbError(_0x5d4c85(0x1b3),_0x5d4c85(0x17b)+_0x15dc92['id']+_0x5d4c85(0x1ad));if(_0x15dc92['scope']!=='company')throw kbError('kb_scope_mismatch',_0x5d4c85(0x17b)+_0x15dc92['id']+'\x20is\x20not\x20company-scoped.');const _0x38e986=requireRecordText(_0x15dc92[_0x5d4c85(0x1a6)],_0x5d4c85(0x1a6),_0x15dc92['id']),_0x185477=requireRecordText(_0x15dc92[_0x5d4c85(0x1aa)],_0x5d4c85(0x1aa),_0x15dc92['id']),_0x2ed35f=inspectKbContent(requireRecordText(_0x15dc92[_0x5d4c85(0x1b2)],_0x5d4c85(0x1b2),_0x15dc92['id'],{'allowEmpty':!![]})),_0x1ac04a=typeof _0x15dc92[_0x5d4c85(0x173)]===_0x5d4c85(0x175)||typeof _0x15dc92[_0x5d4c85(0x173)]==='number'?_0x15dc92[_0x5d4c85(0x173)]:undefined,_0x4f4966=typeof _0x15dc92[_0x5d4c85(0x16e)]===_0x5d4c85(0x175)||typeof _0x15dc92[_0x5d4c85(0x16e)]==='number'?_0x15dc92[_0x5d4c85(0x16e)]:undefined,_0x1ef394=sha256(JSON[_0x5d4c85(0x18d)]({'id':_0x15dc92['id'],'scope':_0x15dc92[_0x5d4c85(0x19a)],'appCode':_0x38e986,'title':_0x185477,'version':_0x15dc92[_0x5d4c85(0x1c1)],'contentHash':_0x2ed35f[_0x5d4c85(0x167)],'createTime':_0x1ac04a,'updateTime':_0x4f4966}));return{'id':_0x15dc92['id'],'scope':'company','appCode':_0x38e986,'title':_0x185477,'version':_0x15dc92[_0x5d4c85(0x1c1)],..._0x15dc92['sourceVersion']!==undefined?{'sourceVersion':_0x15dc92['sourceVersion']}:{},..._0x15dc92[_0x5d4c85(0x18b)]!==undefined?{'indexStatus':_0x15dc92['indexStatus'],'indexedVersion':_0x15dc92[_0x5d4c85(0x177)]}:{},'contentByteSize':_0x2ed35f['byteSize'],'contentHash':_0x2ed35f[_0x5d4c85(0x167)],'snapshotHash':_0x1ef394,..._0x1ac04a!==undefined?{'createTime':_0x1ac04a}:{},..._0x4f4966!==undefined?{'updateTime':_0x4f4966}:{}};}export function assertCompanyKnowledgeBase(_0x57a6e9,_0x377b31,_0x5c463e){const _0x1285ca=a159_0x5f27f4;if(_0x5c463e!==undefined&&_0x57a6e9['id']!==_0x5c463e)throw kbError(_0x1285ca(0x1b3),_0x1285ca(0x190)+_0x57a6e9['id']+_0x1285ca(0x184)+_0x5c463e+'\x20was\x20requested.');if(_0x57a6e9[_0x1285ca(0x19a)]!==_0x1285ca(0x193)||_0x57a6e9[_0x1285ca(0x1a6)]!==_0x377b31)throw kbError('kb_scope_mismatch',_0x1285ca(0x17b)+_0x57a6e9['id']+_0x1285ca(0x1a2)+_0x377b31+'.');}export async function fetchAllCompanyKnowledgeBases(_0x4e67d9,_0x3ecf60){const _0x47b91c=a159_0x5f27f4;let _0x3b0e41=LIST_PAGE_SIZE;const _0x507f33=[],_0x7f9a65=new Set();let _0x356769=0x1,_0x1cff37=0x0,_0x3b681e;while(!![]){let _0x1d0b6e;try{_0x1d0b6e=await listEnterpriseKnowledgeBases(_0x4e67d9[_0x47b91c(0x170)],{'currentPage':_0x356769,'pageSize':_0x3b0e41,'appCode':_0x4e67d9['appCode'],..._0x3ecf60});}catch(_0x252d08){if(!(_0x252d08 instanceof KbManagementError)||!_0x252d08[_0x47b91c(0x19f)]||_0x3b0e41===0x1)throw _0x252d08;_0x3b0e41=Math[_0x47b91c(0x192)](0x1,Math[_0x47b91c(0x1a0)](_0x3b0e41/0x2)),_0x356769=0x1,_0x1cff37=0x0,_0x507f33[_0x47b91c(0x1b0)]=0x0,_0x7f9a65[_0x47b91c(0x1a4)]();continue;}const _0x1929ad=_0x1d0b6e['paging']?.['totalCount'];if(!_0x1d0b6e['paging']||_0x1d0b6e[_0x47b91c(0x1bd)][_0x47b91c(0x195)]!==_0x3b0e41||!Number['isSafeInteger'](_0x1929ad)||_0x1929ad<0x0||_0x1d0b6e[_0x47b91c(0x166)][_0x47b91c(0x1b0)]!==Math[_0x47b91c(0x16f)](_0x3b0e41,Math[_0x47b91c(0x192)](0x0,_0x1929ad-(_0x356769-0x1)*_0x3b0e41)))throw kbError(_0x47b91c(0x174),_0x47b91c(0x1bc));if(_0x1d0b6e['paging']['currentPage']!==_0x356769)throw kbError(_0x47b91c(0x174),_0x47b91c(0x171)+_0x1d0b6e['paging'][_0x47b91c(0x185)]+_0x47b91c(0x181)+_0x356769+_0x47b91c(0x1ae));if(_0x1929ad!==undefined){if(_0x3b681e!==undefined&&_0x1929ad!==_0x3b681e)throw kbError(_0x47b91c(0x174),_0x47b91c(0x1ba)+_0x3b681e+'\x20to\x20'+_0x1929ad+_0x47b91c(0x1bf),'Retry\x20the\x20read\x20after\x20concurrent\x20updates\x20have\x20settled.');_0x3b681e=_0x1929ad;}for(const _0x2f702d of _0x1d0b6e[_0x47b91c(0x166)]){if(typeof _0x2f702d['id']!==_0x47b91c(0x175)||!/^0*[1-9][0-9]*$/[_0x47b91c(0x188)](_0x2f702d['id'])||_0x7f9a65[_0x47b91c(0x17e)](_0x2f702d['id']))throw kbError(_0x47b91c(0x174),_0x47b91c(0x1ac)+String(_0x2f702d['id'])+'.');_0x7f9a65[_0x47b91c(0x18c)](_0x2f702d['id']),_0x2f702d[_0x47b91c(0x19a)]===_0x47b91c(0x193)&&_0x2f702d[_0x47b91c(0x1a6)]===_0x4e67d9['appCode']&&_0x507f33[_0x47b91c(0x183)](_0x2f702d);}_0x1cff37+=_0x1d0b6e[_0x47b91c(0x166)][_0x47b91c(0x1b0)];if(_0x1929ad!==undefined&&_0x1cff37>=_0x1929ad)break;if(_0x1d0b6e['items']['length']<_0x3b0e41){if(_0x1929ad!==undefined&&_0x1cff37<_0x1929ad)throw kbError(_0x47b91c(0x174),'Knowledge-base\x20list\x20stopped\x20at\x20'+_0x1cff37+_0x47b91c(0x182)+_0x1929ad+_0x47b91c(0x197));break;}_0x356769+=0x1;}return _0x507f33;}export function findExactCompanyKnowledgeBases(_0x4e804c,_0x2b37cc,_0x1dc838){const _0x779c33=a159_0x5f27f4;return _0x4e804c['filter'](_0x8bf1f0=>_0x8bf1f0['scope']===_0x779c33(0x193)&&_0x8bf1f0[_0x779c33(0x1a6)]===_0x2b37cc&&_0x8bf1f0[_0x779c33(0x1aa)]===_0x1dc838);}export async function getKbOrNull(_0x9fa004,_0x233a61){const _0x15eab1=a159_0x5f27f4;try{const _0x306751=await getEnterpriseKnowledgeBase(_0x9fa004['cookie'],_0x233a61,_0x9fa004[_0x15eab1(0x1a6)]);return assertCompanyKnowledgeBase(_0x306751,_0x9fa004[_0x15eab1(0x1a6)],_0x233a61),_0x306751;}catch(_0x2e9f7e){if(getPlatformErrorCode(_0x2e9f7e)===DATA_NOT_EXIST_ERROR_CODE&&getPlatformHttpStatus(_0x2e9f7e)===0x194)return null;throw _0x2e9f7e;}}export async function requireKb(_0x2ab848,_0x5152ae){const _0xe9a185=a159_0x5f27f4,_0x24c8ba=await getKbOrNull(_0x2ab848,_0x5152ae);if(!_0x24c8ba)throw kbError(_0xe9a185(0x1b7),'Company\x20knowledge\x20base\x20not\x20found:\x20'+_0x5152ae,_0xe9a185(0x17c));return _0x24c8ba;}export function assertExpectedKbVersion(_0x2f009c,_0x12f4df){const _0x5187d8=a159_0x5f27f4;if(_0x12f4df===undefined||_0x2f009c[_0x5187d8(0x1c1)]===_0x12f4df)return;throw kbError(_0x5187d8(0x17d),_0x5187d8(0x17b)+_0x2f009c['id']+'\x20version\x20changed:\x20expected\x20'+_0x12f4df+_0x5187d8(0x1be)+_0x2f009c[_0x5187d8(0x1c1)]+'.',_0x5187d8(0x187));}
|
|
1
|
+
const a159_0x2e4327=a159_0xb60e;(function(_0x534d44,_0x15abcf){const _0x484961=a159_0xb60e,_0x29beef=_0x534d44();while(!![]){try{const _0xb96c64=-parseInt(_0x484961(0x138))/0x1*(-parseInt(_0x484961(0x152))/0x2)+parseInt(_0x484961(0x156))/0x3+-parseInt(_0x484961(0x116))/0x4+parseInt(_0x484961(0x121))/0x5+-parseInt(_0x484961(0x12c))/0x6*(-parseInt(_0x484961(0x119))/0x7)+-parseInt(_0x484961(0x110))/0x8*(parseInt(_0x484961(0x144))/0x9)+parseInt(_0x484961(0x15a))/0xa*(-parseInt(_0x484961(0x10e))/0xb);if(_0xb96c64===_0x15abcf)break;else _0x29beef['push'](_0x29beef['shift']());}catch(_0x46c0bd){_0x29beef['push'](_0x29beef['shift']());}}}(a159_0xb5a0,0x55780));import{createHash}from'node:crypto';import{readFile,stat}from'node:fs/promises';function a159_0xb5a0(){const _0x284907=['items','kb_file_required','sourceVersion','add','133JXmnEj','message','utf8','\x20response\x20is\x20missing\x20','\x20request\x20was\x20sent,\x20but\x20its\x20final\x20company\x20knowledge-base\x20state\x20could\x20not\x20be\x20verified.','\x20does\x20not\x20belong\x20to\x20company\x20scope\x20for\x20app\x20','allowEmpty','update','Run\x20`rabetbase\x20kb\x20list\x20--format\x20compress`\x20to\x20inspect\x20the\x20resolved\x20app.','Knowledge-base\x20content\x20file\x20path\x20is\x20required.','Retry\x20the\x20read\x20after\x20concurrent\x20updates\x20have\x20settled.','isSafeInteger','36vZOczU','updateTime','Cannot\x20read\x20knowledge-base\x20content\x20file:\x20','defineProperty','kb_state_drift','kb_scope_mismatch','yes','Knowledge-base\x20content\x20file\x20is\x20not\x20valid\x20UTF-8:\x20','Knowledge-base\x20list\x20returned\x20an\x20inconsistent\x20page\x20size\x20or\x20record\x20count.','byteSize','createTime','length','Run\x20the\x20command\x20with\x20--dry-run\x20again\x20and\x20review\x20the\x20latest\x20version\x20before\x20retrying.','decode','4666XWqzxc','version','scope','Knowledge-base\x20list\x20returned\x20an\x20invalid\x20or\x20repeated\x20id:\x20','1679634QMfkcn',',\x20current\x20','filter','byteLength','4897930WQslGc','\x20records.','str','string','appCode','kb_response_invalid','kb_file_unreadable','paging','kb_file_invalid','cookie','contentHash','isFile','max','Knowledge-base\x20list\x20total\x20changed\x20from\x20','company','kb_','content','verification_unavailable','\x20during\x20paging.','11oiSrkC','\x20version\x20changed:\x20expected\x20','900136hPGHYA','min','306','utf-8','title','clear','2551680rDYxCg','trim','number','16940bwfgkL','totalCount','from','Knowledge-base\x20get-one\x20returned\x20id\x20','bool','Knowledge-base\x20list\x20stopped\x20at\x20','\x20was\x20requested.','Knowledge-base\x20list\x20returned\x20page\x20','2033570bxKRbl','Cannot\x20access\x20knowledge-base\x20content\x20file:\x20','pageSize','dry-run','kb_list_contract_invalid','Knowledge\x20base\x20','kb_confirmation_required','\x20while\x20page\x20','\x20of\x20','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.','currentPage','1614ycZfne','kb_content_invalid','Knowledge-base\x20content\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','indexedVersion','This\x20company\x20knowledge-base\x20mutation\x20requires\x20explicit\x20--yes.','\x20while\x20id\x20','\x20is\x20not\x20company-scoped.','\x20response\x20contains\x20an\x20invalid\x20version.'];a159_0xb5a0=function(){return _0x284907;};return a159_0xb5a0();}import{resolve}from'node:path';import{TextDecoder}from'node:util';import{getEnterpriseKnowledgeBase,getPlatformErrorCode,getPlatformHttpStatus,listEnterpriseKnowledgeBases}from'../../core/api-client.js';import{KbManagementError}from'../../core/kb-management-client.js';import{CliError}from'../../errors.js';const LIST_PAGE_SIZE=0x32,DATA_NOT_EXIST_ERROR_CODE=a159_0x2e4327(0x112);export function kbError(_0xaec043,_0x414b0c,_0x2760a2){return new CliError(_0xaec043,0x1,_0x414b0c,_0x2760a2);}export function readKbId(_0x267ce0){const _0x54170b=a159_0x2e4327,_0x40cd6a=_0x267ce0[_0x54170b(0x15c)]('id');if(!/^0*[1-9][0-9]*$/['test'](_0x40cd6a))throw kbError('kb_id_invalid','--id\x20must\x20be\x20a\x20positive\x20decimal\x20integer\x20string.');return _0x40cd6a;}export function requireKbExplicitYes(_0x5536aa){const _0x220ce7=a159_0x2e4327;if(_0x5536aa[_0x220ce7(0x11d)](_0x220ce7(0x124))||_0x5536aa[_0x220ce7(0x11d)](_0x220ce7(0x14a)))return;throw kbError(_0x220ce7(0x127),_0x220ce7(0x130),_0x220ce7(0x12a));}function a159_0xb60e(_0x5ab990,_0x131ab1){_0x5ab990=_0x5ab990-0x108;const _0xb5a0cd=a159_0xb5a0();let _0xb60e00=_0xb5a0cd[_0x5ab990];return _0xb60e00;}function sha256(_0x5b6f69){const _0x5e4978=a159_0x2e4327;return'sha256:'+createHash('sha256')[_0x5e4978(0x13f)](_0x5b6f69)['digest']('hex');}export function inspectKbContent(_0x43aea3){const _0x75b5f1=a159_0x2e4327,_0x54e775=Buffer[_0x75b5f1(0x11b)](_0x43aea3,_0x75b5f1(0x13a));return{'content':_0x43aea3,'byteSize':_0x54e775[_0x75b5f1(0x159)],'contentHash':sha256(_0x54e775)};}export async function readKbFile(_0x15cf95){const _0x23e248=a159_0x2e4327,_0x2d6594=_0x15cf95[_0x23e248(0x117)]();if(!_0x2d6594)throw kbError(_0x23e248(0x135),_0x23e248(0x141),'Pass\x20--file\x20<knowledge.md>.');const _0x3f68f2=resolve(_0x2d6594);let _0x58453b;try{_0x58453b=await stat(_0x3f68f2);}catch(_0xc7104a){throw kbError(_0x23e248(0x160),_0x23e248(0x122)+_0x2d6594,_0xc7104a instanceof Error?_0xc7104a[_0x23e248(0x139)]:String(_0xc7104a));}if(!_0x58453b[_0x23e248(0x165)]())throw kbError(_0x23e248(0x162),_0x23e248(0x12e)+_0x2d6594);let _0x27f655;try{_0x27f655=await readFile(_0x3f68f2);}catch(_0xa62a01){throw kbError(_0x23e248(0x160),_0x23e248(0x146)+_0x2d6594,_0xa62a01 instanceof Error?_0xa62a01[_0x23e248(0x139)]:String(_0xa62a01));}let _0x5be178;try{_0x5be178=new TextDecoder(_0x23e248(0x113),{'fatal':!![],'ignoreBOM':!![]})[_0x23e248(0x151)](_0x27f655);}catch{throw kbError(_0x23e248(0x12d),_0x23e248(0x14b)+_0x2d6594);}if(!_0x5be178[_0x23e248(0x117)]())throw kbError(_0x23e248(0x12d),'Knowledge-base\x20content\x20file\x20is\x20blank:\x20'+_0x2d6594);return inspectKbContent(_0x5be178);}export async function verifyKbMutationReadback(_0x938bb6,_0x2cb548,_0x1a26cf){const _0x567256=a159_0x2e4327;try{return await _0x1a26cf();}catch(_0x432c38){const _0x49d3a7=kbError(_0x567256(0x10a)+_0x938bb6+'_'+(_0x2cb548?'outcome_unknown':_0x567256(0x10c)),'The\x20'+_0x938bb6+_0x567256(0x13c),'Do\x20not\x20resubmit\x20automatically.\x20Resolve\x20the\x20app\x20again\x20and\x20inspect\x20the\x20target\x20state\x20manually.');Object[_0x567256(0x147)](_0x49d3a7,'cause',{'value':_0x432c38,'enumerable':![]});throw _0x49d3a7;}}function requireRecordText(_0x41431c,_0x1182f2,_0x62657c,_0x39f236={}){const _0x867e51=a159_0x2e4327;if(typeof _0x41431c===_0x867e51(0x15d)&&(_0x39f236[_0x867e51(0x13e)]||_0x41431c[_0x867e51(0x117)]()))return _0x41431c;throw kbError(_0x867e51(0x15f),_0x867e51(0x126)+String(_0x62657c)+_0x867e51(0x13b)+_0x1182f2+'.');}export function projectKb(_0x44f781){const _0x434f32=a159_0x2e4327;if(typeof _0x44f781['id']!=='string'||!/^0*[1-9][0-9]*$/['test'](_0x44f781['id']))throw kbError(_0x434f32(0x15f),'Knowledge-base\x20response\x20contains\x20an\x20invalid\x20id.');if(!Number[_0x434f32(0x143)](_0x44f781[_0x434f32(0x153)])||_0x44f781['version']<0x1)throw kbError(_0x434f32(0x15f),_0x434f32(0x126)+_0x44f781['id']+_0x434f32(0x133));if(_0x44f781['scope']!=='company')throw kbError('kb_scope_mismatch',_0x434f32(0x126)+_0x44f781['id']+_0x434f32(0x132));const _0x5b1aaf=requireRecordText(_0x44f781[_0x434f32(0x15e)],_0x434f32(0x15e),_0x44f781['id']),_0x5b5f4e=requireRecordText(_0x44f781[_0x434f32(0x114)],_0x434f32(0x114),_0x44f781['id']),_0x3b5eb6=inspectKbContent(requireRecordText(_0x44f781[_0x434f32(0x10b)],_0x434f32(0x10b),_0x44f781['id'],{'allowEmpty':!![]})),_0x195f29=typeof _0x44f781[_0x434f32(0x14e)]===_0x434f32(0x15d)||typeof _0x44f781[_0x434f32(0x14e)]==='number'?_0x44f781[_0x434f32(0x14e)]:undefined,_0x494be9=typeof _0x44f781[_0x434f32(0x145)]==='string'||typeof _0x44f781[_0x434f32(0x145)]===_0x434f32(0x118)?_0x44f781[_0x434f32(0x145)]:undefined,_0x4dda24=sha256(JSON['stringify']({'id':_0x44f781['id'],'scope':_0x44f781[_0x434f32(0x154)],'appCode':_0x5b1aaf,'title':_0x5b5f4e,'version':_0x44f781[_0x434f32(0x153)],'contentHash':_0x3b5eb6[_0x434f32(0x164)],'createTime':_0x195f29,'updateTime':_0x494be9}));return{'id':_0x44f781['id'],'scope':_0x434f32(0x109),'appCode':_0x5b1aaf,'title':_0x5b5f4e,'version':_0x44f781[_0x434f32(0x153)],..._0x44f781[_0x434f32(0x136)]!==undefined?{'sourceVersion':_0x44f781[_0x434f32(0x136)]}:{},..._0x44f781['indexStatus']!==undefined?{'indexStatus':_0x44f781['indexStatus'],'indexedVersion':_0x44f781[_0x434f32(0x12f)]}:{},'contentByteSize':_0x3b5eb6[_0x434f32(0x14d)],'contentHash':_0x3b5eb6[_0x434f32(0x164)],'snapshotHash':_0x4dda24,..._0x195f29!==undefined?{'createTime':_0x195f29}:{},..._0x494be9!==undefined?{'updateTime':_0x494be9}:{}};}export function assertCompanyKnowledgeBase(_0x2c74b7,_0xe1667e,_0x2fd237){const _0x2ae021=a159_0x2e4327;if(_0x2fd237!==undefined&&_0x2c74b7['id']!==_0x2fd237)throw kbError(_0x2ae021(0x15f),_0x2ae021(0x11c)+_0x2c74b7['id']+_0x2ae021(0x131)+_0x2fd237+'\x20was\x20requested.');if(_0x2c74b7[_0x2ae021(0x154)]!==_0x2ae021(0x109)||_0x2c74b7[_0x2ae021(0x15e)]!==_0xe1667e)throw kbError(_0x2ae021(0x149),_0x2ae021(0x126)+_0x2c74b7['id']+_0x2ae021(0x13d)+_0xe1667e+'.');}export async function fetchAllCompanyKnowledgeBases(_0x2afc57,_0xc74f1c){const _0xa19a31=a159_0x2e4327;let _0x4575f2=LIST_PAGE_SIZE;const _0x4110fd=[],_0x1f2b4f=new Set();let _0x4e47c4=0x1,_0xc2fe04=0x0,_0x4bc4a9;while(!![]){let _0x4ef86a;try{_0x4ef86a=await listEnterpriseKnowledgeBases(_0x2afc57[_0xa19a31(0x163)],{'currentPage':_0x4e47c4,'pageSize':_0x4575f2,'appCode':_0x2afc57[_0xa19a31(0x15e)],..._0xc74f1c});}catch(_0x392669){if(!(_0x392669 instanceof KbManagementError)||!_0x392669['pageTooLarge']||_0x4575f2===0x1)throw _0x392669;_0x4575f2=Math[_0xa19a31(0x166)](0x1,Math['floor'](_0x4575f2/0x2)),_0x4e47c4=0x1,_0xc2fe04=0x0,_0x4110fd['length']=0x0,_0x1f2b4f[_0xa19a31(0x115)]();continue;}const _0x25d900=_0x4ef86a[_0xa19a31(0x161)]?.[_0xa19a31(0x11a)];if(!_0x4ef86a[_0xa19a31(0x161)]||_0x4ef86a[_0xa19a31(0x161)][_0xa19a31(0x123)]!==_0x4575f2||!Number[_0xa19a31(0x143)](_0x25d900)||_0x25d900<0x0||_0x4ef86a[_0xa19a31(0x134)]['length']!==Math[_0xa19a31(0x111)](_0x4575f2,Math['max'](0x0,_0x25d900-(_0x4e47c4-0x1)*_0x4575f2)))throw kbError(_0xa19a31(0x125),_0xa19a31(0x14c));if(_0x4ef86a['paging'][_0xa19a31(0x12b)]!==_0x4e47c4)throw kbError(_0xa19a31(0x125),_0xa19a31(0x120)+_0x4ef86a[_0xa19a31(0x161)]['currentPage']+_0xa19a31(0x128)+_0x4e47c4+_0xa19a31(0x11f));if(_0x25d900!==undefined){if(_0x4bc4a9!==undefined&&_0x25d900!==_0x4bc4a9)throw kbError(_0xa19a31(0x125),_0xa19a31(0x108)+_0x4bc4a9+'\x20to\x20'+_0x25d900+_0xa19a31(0x10d),_0xa19a31(0x142));_0x4bc4a9=_0x25d900;}for(const _0x11f5fb of _0x4ef86a[_0xa19a31(0x134)]){if(typeof _0x11f5fb['id']!=='string'||!/^0*[1-9][0-9]*$/['test'](_0x11f5fb['id'])||_0x1f2b4f['has'](_0x11f5fb['id']))throw kbError(_0xa19a31(0x125),_0xa19a31(0x155)+String(_0x11f5fb['id'])+'.');_0x1f2b4f[_0xa19a31(0x137)](_0x11f5fb['id']),_0x11f5fb[_0xa19a31(0x154)]===_0xa19a31(0x109)&&_0x11f5fb[_0xa19a31(0x15e)]===_0x2afc57[_0xa19a31(0x15e)]&&_0x4110fd['push'](_0x11f5fb);}_0xc2fe04+=_0x4ef86a[_0xa19a31(0x134)][_0xa19a31(0x14f)];if(_0x25d900!==undefined&&_0xc2fe04>=_0x25d900)break;if(_0x4ef86a[_0xa19a31(0x134)][_0xa19a31(0x14f)]<_0x4575f2){if(_0x25d900!==undefined&&_0xc2fe04<_0x25d900)throw kbError('kb_list_contract_invalid',_0xa19a31(0x11e)+_0xc2fe04+_0xa19a31(0x129)+_0x25d900+_0xa19a31(0x15b));break;}_0x4e47c4+=0x1;}return _0x4110fd;}export function findExactCompanyKnowledgeBases(_0x30b6ca,_0x210a47,_0x31a273){const _0x3265d3=a159_0x2e4327;return _0x30b6ca[_0x3265d3(0x158)](_0x3b9529=>_0x3b9529[_0x3265d3(0x154)]===_0x3265d3(0x109)&&_0x3b9529[_0x3265d3(0x15e)]===_0x210a47&&_0x3b9529[_0x3265d3(0x114)]===_0x31a273);}export async function getKbOrNull(_0x574f32,_0x49b7a8){const _0x34d6db=a159_0x2e4327;try{const _0xbfe0b4=await getEnterpriseKnowledgeBase(_0x574f32[_0x34d6db(0x163)],_0x49b7a8,_0x574f32[_0x34d6db(0x15e)]);return assertCompanyKnowledgeBase(_0xbfe0b4,_0x574f32[_0x34d6db(0x15e)],_0x49b7a8),_0xbfe0b4;}catch(_0x2b45ed){if(getPlatformErrorCode(_0x2b45ed)===DATA_NOT_EXIST_ERROR_CODE&&getPlatformHttpStatus(_0x2b45ed)===0x194)return null;throw _0x2b45ed;}}export async function requireKb(_0x4f68de,_0x49ec12){const _0xaf6ed4=a159_0x2e4327,_0x43b1b3=await getKbOrNull(_0x4f68de,_0x49ec12);if(!_0x43b1b3)throw kbError('kb_not_found','Company\x20knowledge\x20base\x20not\x20found:\x20'+_0x49ec12,_0xaf6ed4(0x140));return _0x43b1b3;}export function assertExpectedKbVersion(_0x1c7579,_0x54a87a){const _0x49664a=a159_0x2e4327;if(_0x54a87a===undefined||_0x1c7579[_0x49664a(0x153)]===_0x54a87a)return;throw kbError(_0x49664a(0x148),_0x49664a(0x126)+_0x1c7579['id']+_0x49664a(0x10f)+_0x54a87a+_0x49664a(0x157)+_0x1c7579[_0x49664a(0x153)]+'.',_0x49664a(0x150));}
|