@lovrabet/rabetbase-cli 2.5.10-beta.1 → 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.d.ts +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.d.ts +0 -28
- 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.d.ts +8 -0
- package/lib/core/instant-api-policy/endpoints.js +1 -0
- package/lib/core/kb-management-client.d.ts +3 -9
- package/lib/core/kb-management-client.js +1 -1
- package/lib/core/kb-search-client.d.ts +1 -4
- 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 +3 -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
|
-
|
|
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
|
-
const
|
|
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
|
-
(function(
|
|
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
|
-
const
|
|
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_0x4b2859=a159_0x56c5;(function(_0x41a990,_0x36aaa7){const _0x4bfc52=a159_0x56c5,_0x1aa846=_0x41a990();while(!![]){try{const _0x5788f5=parseInt(_0x4bfc52(0x83))/0x1+parseInt(_0x4bfc52(0x6f))/0x2*(-parseInt(_0x4bfc52(0xc4))/0x3)+-parseInt(_0x4bfc52(0x72))/0x4+parseInt(_0x4bfc52(0x76))/0x5+parseInt(_0x4bfc52(0xa9))/0x6+-parseInt(_0x4bfc52(0xb7))/0x7+-parseInt(_0x4bfc52(0xc2))/0x8*(-parseInt(_0x4bfc52(0x73))/0x9);if(_0x5788f5===_0x36aaa7)break;else _0x1aa846['push'](_0x1aa846['shift']());}catch(_0x2080f0){_0x1aa846['push'](_0x1aa846['shift']());}}}(a159_0x4bd1,0xb26ea));import{createHash}from'node:crypto';import{readFile,stat}from'node:fs/promises';import{resolve}from'node:path';import{TextDecoder}from'node:util';import{getEnterpriseKnowledgeBase,getPlatformErrorCode,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_0x4b2859(0xcf);export function kbError(_0x39b704,_0x361341,_0x15204f){return new CliError(_0x39b704,0x1,_0x361341,_0x15204f);}export function readKbId(_0x4454e9){const _0x2d1a1a=a159_0x4b2859,_0x4c9c49=_0x4454e9[_0x2d1a1a(0xc5)]('id');if(!/^0*[1-9][0-9]*$/['test'](_0x4c9c49))throw kbError(_0x2d1a1a(0xa7),_0x2d1a1a(0xaf));return _0x4c9c49;}function a159_0x56c5(_0xeb5570,_0xda22aa){_0xeb5570=_0xeb5570-0x6f;const _0x4bd14a=a159_0x4bd1();let _0x56c597=_0x4bd14a[_0xeb5570];return _0x56c597;}export function requireKbExplicitYes(_0x33115b){const _0x434072=a159_0x4b2859;if(_0x33115b['bool']('dry-run')||_0x33115b[_0x434072(0x9a)]('yes'))return;throw kbError(_0x434072(0x74),_0x434072(0x7b),'Run\x20the\x20same\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.');}function sha256(_0x4f8a73){const _0x59c363=a159_0x4b2859;return'sha256:'+createHash(_0x59c363(0x80))[_0x59c363(0xbb)](_0x4f8a73)[_0x59c363(0x96)](_0x59c363(0x92));}export function inspectKbContent(_0x335195){const _0x50098c=a159_0x4b2859,_0x1c1b6d=Buffer[_0x50098c(0x97)](_0x335195,_0x50098c(0xaa));return{'content':_0x335195,'byteSize':_0x1c1b6d[_0x50098c(0xb9)],'contentHash':sha256(_0x1c1b6d)};}export async function readKbFile(_0x4a04ec){const _0x4d91e0=a159_0x4b2859,_0xbb6ae=_0x4a04ec[_0x4d91e0(0xb4)]();if(!_0xbb6ae)throw kbError(_0x4d91e0(0xac),_0x4d91e0(0x9b),_0x4d91e0(0x8a));const _0x27a5c4=resolve(_0xbb6ae);let _0x506d75;try{_0x506d75=await stat(_0x27a5c4);}catch(_0x3695f3){throw kbError(_0x4d91e0(0x81),_0x4d91e0(0xb3)+_0xbb6ae,_0x3695f3 instanceof Error?_0x3695f3[_0x4d91e0(0xd0)]:String(_0x3695f3));}if(!_0x506d75[_0x4d91e0(0xb5)]())throw kbError('kb_file_invalid',_0x4d91e0(0x94)+_0xbb6ae);let _0x329a08;try{_0x329a08=await readFile(_0x27a5c4);}catch(_0x2bdab8){throw kbError(_0x4d91e0(0x81),_0x4d91e0(0xbd)+_0xbb6ae,_0x2bdab8 instanceof Error?_0x2bdab8['message']:String(_0x2bdab8));}let _0x3a3652;try{_0x3a3652=new TextDecoder(_0x4d91e0(0xbc),{'fatal':!![],'ignoreBOM':!![]})[_0x4d91e0(0x87)](_0x329a08);}catch{throw kbError(_0x4d91e0(0x71),_0x4d91e0(0x79)+_0xbb6ae);}if(!_0x3a3652[_0x4d91e0(0xb4)]())throw kbError('kb_content_invalid','Knowledge-base\x20content\x20file\x20is\x20blank:\x20'+_0xbb6ae);return inspectKbContent(_0x3a3652);}export async function verifyKbMutationReadback(_0x201c88,_0x537ab2,_0x445d11){const _0x3c67d4=a159_0x4b2859;try{return await _0x445d11();}catch(_0x919e8c){const _0xb87cff=kbError('kb_'+_0x201c88+'_'+(_0x537ab2?_0x3c67d4(0xa1):_0x3c67d4(0x70)),_0x3c67d4(0xc1)+_0x201c88+_0x3c67d4(0x75),_0x3c67d4(0x8c));Object[_0x3c67d4(0x8f)](_0xb87cff,_0x3c67d4(0x7f),{'value':_0x919e8c,'enumerable':![]});throw _0xb87cff;}}function requireRecordText(_0x38380c,_0x7fedd5,_0x9bbfd0,_0x3f4c00={}){const _0x3ec09b=a159_0x4b2859;if(typeof _0x38380c===_0x3ec09b(0x93)&&(_0x3f4c00[_0x3ec09b(0xa4)]||_0x38380c[_0x3ec09b(0xb4)]()))return _0x38380c;throw kbError('kb_response_invalid',_0x3ec09b(0xce)+String(_0x9bbfd0)+_0x3ec09b(0x84)+_0x7fedd5+'.');}export function projectKb(_0xd3b66c){const _0x2cfd6b=a159_0x4b2859;if(typeof _0xd3b66c['id']!==_0x2cfd6b(0x93)||!/^0*[1-9][0-9]*$/[_0x2cfd6b(0xc0)](_0xd3b66c['id']))throw kbError('kb_response_invalid','Knowledge-base\x20response\x20contains\x20an\x20invalid\x20id.');if(!Number[_0x2cfd6b(0x9e)](_0xd3b66c['version'])||_0xd3b66c[_0x2cfd6b(0x98)]<0x1)throw kbError(_0x2cfd6b(0xa2),'Knowledge\x20base\x20'+_0xd3b66c['id']+'\x20response\x20contains\x20an\x20invalid\x20version.');if(_0xd3b66c['scope']!==_0x2cfd6b(0xb6))throw kbError(_0x2cfd6b(0xb8),_0x2cfd6b(0xce)+_0xd3b66c['id']+'\x20is\x20not\x20company-scoped.');const _0x2e14c5=requireRecordText(_0xd3b66c['appCode'],'appCode',_0xd3b66c['id']),_0x542d59=requireRecordText(_0xd3b66c[_0x2cfd6b(0xa3)],_0x2cfd6b(0xa3),_0xd3b66c['id']),_0x29c4d1=inspectKbContent(requireRecordText(_0xd3b66c['content'],_0x2cfd6b(0xb0),_0xd3b66c['id'],{'allowEmpty':!![]})),_0x379da7=typeof _0xd3b66c[_0x2cfd6b(0xa8)]===_0x2cfd6b(0x93)||typeof _0xd3b66c['createTime']===_0x2cfd6b(0xb1)?_0xd3b66c[_0x2cfd6b(0xa8)]:undefined,_0x3e36db=typeof _0xd3b66c[_0x2cfd6b(0xab)]==='string'||typeof _0xd3b66c[_0x2cfd6b(0xab)]===_0x2cfd6b(0xb1)?_0xd3b66c[_0x2cfd6b(0xab)]:undefined,_0x417329=sha256(JSON['stringify']({'id':_0xd3b66c['id'],'scope':_0xd3b66c['scope'],'appCode':_0x2e14c5,'title':_0x542d59,'version':_0xd3b66c[_0x2cfd6b(0x98)],'contentHash':_0x29c4d1[_0x2cfd6b(0xc8)],'createTime':_0x379da7,'updateTime':_0x3e36db}));return{'id':_0xd3b66c['id'],'scope':_0x2cfd6b(0xb6),'appCode':_0x2e14c5,'title':_0x542d59,'version':_0xd3b66c['version'],..._0xd3b66c['sourceVersion']!==undefined?{'sourceVersion':_0xd3b66c[_0x2cfd6b(0x77)]}:{},..._0xd3b66c[_0x2cfd6b(0x9f)]!==undefined?{'indexStatus':_0xd3b66c[_0x2cfd6b(0x9f)],'indexedVersion':_0xd3b66c[_0x2cfd6b(0xb2)]}:{},'contentByteSize':_0x29c4d1['byteSize'],'contentHash':_0x29c4d1[_0x2cfd6b(0xc8)],'snapshotHash':_0x417329,..._0x379da7!==undefined?{'createTime':_0x379da7}:{},..._0x3e36db!==undefined?{'updateTime':_0x3e36db}:{}};}export function assertCompanyKnowledgeBase(_0x34367c,_0x16bb56,_0x19c4e8){const _0x42d5dc=a159_0x4b2859;if(_0x19c4e8!==undefined&&_0x34367c['id']!==_0x19c4e8)throw kbError('kb_response_invalid',_0x42d5dc(0x86)+_0x34367c['id']+'\x20while\x20id\x20'+_0x19c4e8+_0x42d5dc(0xcb));if(_0x34367c[_0x42d5dc(0xc3)]!=='company'||_0x34367c['appCode']!==_0x16bb56)throw kbError(_0x42d5dc(0xb8),_0x42d5dc(0xce)+_0x34367c['id']+'\x20does\x20not\x20belong\x20to\x20company\x20scope\x20for\x20app\x20'+_0x16bb56+'.');}function a159_0x4bd1(){const _0x22617c=['This\x20company\x20knowledge-base\x20mutation\x20requires\x20explicit\x20--yes.','Knowledge-base\x20list\x20returned\x20an\x20inconsistent\x20page\x20size\x20or\x20record\x20count.','Run\x20the\x20command\x20with\x20--dry-run\x20again\x20and\x20review\x20the\x20latest\x20version\x20before\x20retrying.','\x20to\x20','cause','sha256','kb_file_unreadable','max','739100PaKzjJ','\x20response\x20is\x20missing\x20','min','Knowledge-base\x20get-one\x20returned\x20id\x20','decode','\x20during\x20paging.','\x20while\x20page\x20','Pass\x20--file\x20<knowledge.md>.','Knowledge-base\x20list\x20total\x20changed\x20from\x20','Do\x20not\x20resubmit\x20automatically.\x20Resolve\x20the\x20app\x20again\x20and\x20inspect\x20the\x20target\x20state\x20manually.','Knowledge-base\x20list\x20returned\x20an\x20invalid\x20or\x20repeated\x20id:\x20','appCode','defineProperty','paging','pageTooLarge','hex','string','Knowledge-base\x20content\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','clear','digest','from','version','currentPage','bool','Knowledge-base\x20content\x20file\x20path\x20is\x20required.','\x20of\x20','kb_not_found','isSafeInteger','indexStatus','filter','outcome_unknown','kb_response_invalid','title','allowEmpty','has','cookie','kb_id_invalid','createTime','883290FUCehv','utf8','updateTime','kb_file_required','kb_state_drift','Knowledge-base\x20list\x20returned\x20page\x20','--id\x20must\x20be\x20a\x20positive\x20decimal\x20integer\x20string.','content','number','indexedVersion','Cannot\x20access\x20knowledge-base\x20content\x20file:\x20','trim','isFile','company','1359323duvgOc','kb_scope_mismatch','byteLength','\x20records.','update','utf-8','Cannot\x20read\x20knowledge-base\x20content\x20file:\x20','kb_list_contract_invalid',',\x20current\x20','test','The\x20','41648DUHqAc','scope','4656FEwWDj','str','Retry\x20the\x20read\x20after\x20concurrent\x20updates\x20have\x20settled.','\x20version\x20changed:\x20expected\x20','contentHash','items','Knowledge-base\x20list\x20stopped\x20at\x20','\x20was\x20requested.','Company\x20knowledge\x20base\x20not\x20found:\x20','floor','Knowledge\x20base\x20','306','message','1586hpLRvS','verification_unavailable','kb_content_invalid','3981664FSvmcd','3267rRFrJD','kb_confirmation_required','\x20request\x20was\x20sent,\x20but\x20its\x20final\x20company\x20knowledge-base\x20state\x20could\x20not\x20be\x20verified.','1875530EokZDj','sourceVersion','length','Knowledge-base\x20content\x20file\x20is\x20not\x20valid\x20UTF-8:\x20','add'];a159_0x4bd1=function(){return _0x22617c;};return a159_0x4bd1();}export async function fetchAllCompanyKnowledgeBases(_0x185785,_0x43bf5e){const _0x59a31e=a159_0x4b2859;let _0x13ba12=LIST_PAGE_SIZE;const _0x3a0aa1=[],_0x5d8999=new Set();let _0x2eaa11=0x1,_0x22904e=0x0,_0x5cc5c0;while(!![]){let _0x16fe3c;try{_0x16fe3c=await listEnterpriseKnowledgeBases(_0x185785[_0x59a31e(0xa6)],{'currentPage':_0x2eaa11,'pageSize':_0x13ba12,'appCode':_0x185785[_0x59a31e(0x8e)],..._0x43bf5e});}catch(_0x368b64){if(!(_0x368b64 instanceof KbManagementError)||!_0x368b64[_0x59a31e(0x91)]||_0x13ba12===0x1)throw _0x368b64;_0x13ba12=Math[_0x59a31e(0x82)](0x1,Math[_0x59a31e(0xcd)](_0x13ba12/0x2)),_0x2eaa11=0x1,_0x22904e=0x0,_0x3a0aa1[_0x59a31e(0x78)]=0x0,_0x5d8999[_0x59a31e(0x95)]();continue;}const _0x4dc484=_0x16fe3c[_0x59a31e(0x90)]?.['totalCount'];if(!_0x16fe3c[_0x59a31e(0x90)]||_0x16fe3c[_0x59a31e(0x90)]['pageSize']!==_0x13ba12||!Number[_0x59a31e(0x9e)](_0x4dc484)||_0x4dc484<0x0||_0x16fe3c['items'][_0x59a31e(0x78)]!==Math[_0x59a31e(0x85)](_0x13ba12,Math['max'](0x0,_0x4dc484-(_0x2eaa11-0x1)*_0x13ba12)))throw kbError(_0x59a31e(0xbe),_0x59a31e(0x7c));if(_0x16fe3c[_0x59a31e(0x90)]['currentPage']!==_0x2eaa11)throw kbError(_0x59a31e(0xbe),_0x59a31e(0xae)+_0x16fe3c[_0x59a31e(0x90)][_0x59a31e(0x99)]+_0x59a31e(0x89)+_0x2eaa11+'\x20was\x20requested.');if(_0x4dc484!==undefined){if(_0x5cc5c0!==undefined&&_0x4dc484!==_0x5cc5c0)throw kbError(_0x59a31e(0xbe),_0x59a31e(0x8b)+_0x5cc5c0+_0x59a31e(0x7e)+_0x4dc484+_0x59a31e(0x88),_0x59a31e(0xc6));_0x5cc5c0=_0x4dc484;}for(const _0x4aaa74 of _0x16fe3c['items']){if(typeof _0x4aaa74['id']!==_0x59a31e(0x93)||!/^0*[1-9][0-9]*$/[_0x59a31e(0xc0)](_0x4aaa74['id'])||_0x5d8999[_0x59a31e(0xa5)](_0x4aaa74['id']))throw kbError('kb_list_contract_invalid',_0x59a31e(0x8d)+String(_0x4aaa74['id'])+'.');_0x5d8999[_0x59a31e(0x7a)](_0x4aaa74['id']),_0x4aaa74[_0x59a31e(0xc3)]===_0x59a31e(0xb6)&&_0x4aaa74[_0x59a31e(0x8e)]===_0x185785[_0x59a31e(0x8e)]&&_0x3a0aa1['push'](_0x4aaa74);}_0x22904e+=_0x16fe3c['items'][_0x59a31e(0x78)];if(_0x4dc484!==undefined&&_0x22904e>=_0x4dc484)break;if(_0x16fe3c[_0x59a31e(0xc9)][_0x59a31e(0x78)]<_0x13ba12){if(_0x4dc484!==undefined&&_0x22904e<_0x4dc484)throw kbError('kb_list_contract_invalid',_0x59a31e(0xca)+_0x22904e+_0x59a31e(0x9c)+_0x4dc484+_0x59a31e(0xba));break;}_0x2eaa11+=0x1;}return _0x3a0aa1;}export function findExactCompanyKnowledgeBases(_0x2c26b6,_0x59639d,_0x80ac15){const _0x8c39f4=a159_0x4b2859;return _0x2c26b6[_0x8c39f4(0xa0)](_0x4fa66e=>_0x4fa66e['scope']===_0x8c39f4(0xb6)&&_0x4fa66e['appCode']===_0x59639d&&_0x4fa66e['title']===_0x80ac15);}export async function getKbOrNull(_0x5a189d,_0x49f6f0){const _0xda4c83=a159_0x4b2859;try{const _0x35ae9f=await getEnterpriseKnowledgeBase(_0x5a189d[_0xda4c83(0xa6)],_0x49f6f0,_0x5a189d[_0xda4c83(0x8e)]);return assertCompanyKnowledgeBase(_0x35ae9f,_0x5a189d['appCode'],_0x49f6f0),_0x35ae9f;}catch(_0x746a36){if(getPlatformErrorCode(_0x746a36)===DATA_NOT_EXIST_ERROR_CODE&&getPlatformHttpStatus(_0x746a36)===0x194)return null;throw _0x746a36;}}export async function requireKb(_0x8e3f45,_0x1ff7e3){const _0x4b09eb=a159_0x4b2859,_0x5e7a74=await getKbOrNull(_0x8e3f45,_0x1ff7e3);if(!_0x5e7a74)throw kbError(_0x4b09eb(0x9d),_0x4b09eb(0xcc)+_0x1ff7e3,'Run\x20`rabetbase\x20kb\x20list\x20--format\x20compress`\x20to\x20inspect\x20the\x20resolved\x20app.');return _0x5e7a74;}export function assertExpectedKbVersion(_0x2ba241,_0xaa55c3){const _0x2133c6=a159_0x4b2859;if(_0xaa55c3===undefined||_0x2ba241[_0x2133c6(0x98)]===_0xaa55c3)return;throw kbError(_0x2133c6(0xad),'Knowledge\x20base\x20'+_0x2ba241['id']+_0x2133c6(0xc7)+_0xaa55c3+_0x2133c6(0xbf)+_0x2ba241[_0x2133c6(0x98)]+'.',_0x2133c6(0x7d));}
|
|
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));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a160_0x1de89a=a160_0x1f31;(function(_0x2723b4,_0x539af9){const _0x15a65a=a160_0x1f31,_0x111f73=_0x2723b4();while(!![]){try{const _0x222bc4=-parseInt(_0x15a65a(0x218))/0x1+-parseInt(_0x15a65a(0x1fa))/0x2+-parseInt(_0x15a65a(0x1f3))/0x3*(-parseInt(_0x15a65a(0x1ef))/0x4)+-parseInt(_0x15a65a(0x211))/0x5*(parseInt(_0x15a65a(0x204))/0x6)+parseInt(_0x15a65a(0x21b))/0x7+parseInt(_0x15a65a(0x20a))/0x8*(parseInt(_0x15a65a(0x202))/0x9)+-parseInt(_0x15a65a(0x1eb))/0xa;if(_0x222bc4===_0x539af9)break;else _0x111f73['push'](_0x111f73['shift']());}catch(_0x5acca6){_0x111f73['push'](_0x111f73['shift']());}}}(a160_0x292f,0x7d403));import{knowledgeDocumentsPath}from'../../core/api-client.js';import{isPlatformTransportFailure,updateEnterpriseKnowledgeBase}from'../../core/api-client.js';import{asDryRunResult}from'../../commands/common/dry-run.js';function a160_0x292f(){const _0x4a1d4d=['The\x20received\x20update\x20state\x20contradicts\x20the\x20requested\x20changes.','10DAYjNB','Update\x20a\x20company\x20knowledge\x20base\x20with\x20preflight\x20drift\x20protection','number','Updated\x20company\x20knowledge\x20base\x20','POST','isSafeInteger','company','995601yxaslm','--file\x20cannot\x20be\x20empty.','trim','5301156KbzVqH','kb_update_empty','expected-version','update','contentHash','\x20--format\x20compress`;\x20do\x20not\x20resubmit\x20automatically.','--expected-version\x20must\x20be\x20a\x20positive\x20safe\x20integer.','version','Nothing\x20to\x20update.','replacement','654490fmMAmh','kb_update_outcome_unknown','\x20--format\x20compress','before','148kFJQop','snapshotHash','string','Pass\x20at\x20least\x20one\x20of\x20--title\x20or\x20--file.','74607DamwTK','\x20does\x20not\x20prove\x20the\x20requested\x20update\x20state.','Inspect\x20it\x20with\x20`rabetbase\x20kb\x20detail\x20--id\x20','title','--title\x20cannot\x20be\x20empty.','file','rabetbase\x20kb\x20detail\x20--id\x20','418522RTSkgp','Update\x20response\x20was\x20unavailable;\x20verified\x20applicable\x20postconditions\x20by\x20exact\x20ID\x20without\x20resubmitting.','kb_title_invalid','kb_verification_failed','verified','kb_file_required','Use\x20read-only\x20detail\x20reconciliation;\x20do\x20not\x20resubmit\x20automatically.','push','9pAiVMl','Require\x20the\x20current\x20version\x20before\x20atomic\x20compare-and-set','141012Ushjeo','New\x20knowledge-base\x20title','beforeRecord','Company\x20knowledge-base\x20id','kb_expected_version_invalid','patch','1223048fgSily','content','appCode','expectedVersion','flag','Replacement\x20UTF-8\x20text\x20or\x20Markdown\x20content\x20file'];a160_0x292f=function(){return _0x4a1d4d;};return a160_0x292f();}import{assertCompanyKnowledgeBase,assertExpectedKbVersion,kbError,projectKb,readKbFile,readKbId,requireKb,verifyKbMutationReadback}from'../../commands/kb/shared.js';function readUpdatePatch(_0x51471b){const _0x18a7d3=a160_0x1f31,_0x40f09f=readKbId(_0x51471b),_0x21624a=_0x51471b[_0x18a7d3(0x20e)](_0x18a7d3(0x1f6)),_0xf62f0d=_0x51471b[_0x18a7d3(0x20e)](_0x18a7d3(0x1f8)),_0x11d2aa=_0x51471b['flag'](_0x18a7d3(0x21d)),_0xcbe0e5=_0x21624a===undefined?undefined:String(_0x21624a)[_0x18a7d3(0x21a)]();if(_0x21624a!==undefined&&!_0xcbe0e5)throw kbError(_0x18a7d3(0x1fc),_0x18a7d3(0x1f7));const _0x29f369=_0xf62f0d===undefined?undefined:String(_0xf62f0d)[_0x18a7d3(0x21a)]();if(_0xf62f0d!==undefined&&!_0x29f369)throw kbError(_0x18a7d3(0x1ff),_0x18a7d3(0x219));if(_0xcbe0e5===undefined&&_0x29f369===undefined)throw kbError(_0x18a7d3(0x21c),_0x18a7d3(0x1e9),_0x18a7d3(0x1f2));let _0x51cfbb;if(_0x11d2aa!==undefined){_0x51cfbb=Number(_0x11d2aa);if(!Number[_0x18a7d3(0x216)](_0x51cfbb)||_0x51cfbb<0x1)throw kbError(_0x18a7d3(0x208),_0x18a7d3(0x221));}return{'id':_0x40f09f,'title':_0xcbe0e5,'file':_0x29f369,'expectedVersion':_0x51cfbb};}async function prepareUpdate(_0xe79599){const _0x11bdb3=a160_0x1f31,_0x1917f7=readUpdatePatch(_0xe79599),_0x287395=await requireKb(_0xe79599,_0x1917f7['id']);assertExpectedKbVersion(_0x287395,_0x1917f7[_0x11bdb3(0x20d)]);const _0xc57b87=_0x1917f7[_0x11bdb3(0x1f8)]?await readKbFile(_0x1917f7[_0x11bdb3(0x1f8)]):undefined,_0x1a535b=projectKb(_0x287395),_0x54bea3=projectKb({..._0x287395,..._0x1917f7[_0x11bdb3(0x1f6)]!==undefined?{'title':_0x1917f7['title']}:{},..._0xc57b87?{'content':_0xc57b87[_0x11bdb3(0x20b)]}:{}});return{'patch':_0x1917f7,'beforeRecord':_0x287395,'before':_0x1a535b,'planned':_0x54bea3,'replacement':_0xc57b87};}function a160_0x1f31(_0x24e4b6,_0x69b0c0){_0x24e4b6=_0x24e4b6-0x1e8;const _0x292f8a=a160_0x292f();let _0x1f3106=_0x292f8a[_0x24e4b6];return _0x1f3106;}export const kbUpdate={'service':'kb','command':'update','description':a160_0x1de89a(0x212),'risk':'write','requiresAppCode':!![],'structuredErrors':!![],'flags':[{'name':'id','type':a160_0x1de89a(0x1f1),'required':!![],'description':a160_0x1de89a(0x207)},{'name':a160_0x1de89a(0x1f6),'type':a160_0x1de89a(0x1f1),'required':![],'description':a160_0x1de89a(0x205)},{'name':a160_0x1de89a(0x1f8),'type':a160_0x1de89a(0x1f1),'required':![],'description':a160_0x1de89a(0x20f)},{'name':'expected-version','type':a160_0x1de89a(0x213),'required':![],'description':a160_0x1de89a(0x203)}],async 'validate'(_0xb702a5){readUpdatePatch(_0xb702a5);},async 'dryRun'(_0x3d314f){const _0x11437d=a160_0x1de89a,_0x68b973=await prepareUpdate(_0x3d314f),_0x5275ae=[];return asDryRunResult({'operation':'update','selector':{'id':_0x68b973['before']['id'],'scope':'company','appCode':_0x68b973[_0x11437d(0x1ee)]['appCode']},'before':_0x68b973[_0x11437d(0x1ee)],'after':_0x68b973['planned'],'dryRun':!![],'backend':{'method':_0x11437d(0x215),'path':knowledgeDocumentsPath(_0x11437d(0x217),_0x11437d(0x21e)),'body':{'appCode':_0x3d314f[_0x11437d(0x20c)],'id':_0x68b973[_0x11437d(0x209)]['id'],'expectedVersion':_0x68b973['beforeRecord']['version'],..._0x68b973['patch'][_0x11437d(0x1f6)]!==undefined?{'title':_0x68b973[_0x11437d(0x209)]['title']}:{},..._0x68b973[_0x11437d(0x1ea)]?{'contentHash':_0x68b973[_0x11437d(0x1ea)][_0x11437d(0x21f)],'contentByteSize':_0x68b973[_0x11437d(0x1ea)]['byteSize']}:{}}},'warnings':_0x5275ae,'verification':{'expectedVersion':_0x68b973[_0x11437d(0x206)][_0x11437d(0x1e8)],'atomicCompareAndSet':!![],'plannedSnapshotHash':_0x68b973['before'][_0x11437d(0x1f0)],'lookupCommand':_0x11437d(0x1f9)+_0x68b973['before']['id']+_0x11437d(0x1ed)}},{'method':_0x11437d(0x215),'url':knowledgeDocumentsPath(_0x11437d(0x217),'update')});},async 'execute'(_0x478879){const _0x1479e5=a160_0x1de89a,_0x291447=await prepareUpdate(_0x478879),_0x172b5d={'id':_0x291447['patch']['id'],'appCode':_0x478879[_0x1479e5(0x20c)],'expectedVersion':_0x291447[_0x1479e5(0x206)][_0x1479e5(0x1e8)],..._0x291447[_0x1479e5(0x209)]['title']!==undefined?{'title':_0x291447[_0x1479e5(0x209)][_0x1479e5(0x1f6)]}:{},..._0x291447[_0x1479e5(0x1ea)]?{'content':_0x291447['replacement']['content']}:{}},_0x12f9a0=_0x291447[_0x1479e5(0x209)]['title']??_0x291447['beforeRecord'][_0x1479e5(0x1f6)],_0x4aa178=_0x291447[_0x1479e5(0x1ea)]?.['content']??_0x291447[_0x1479e5(0x206)][_0x1479e5(0x20b)],_0x38c864=_0x12f9a0!==_0x291447[_0x1479e5(0x206)][_0x1479e5(0x1f6)]||_0x4aa178!==_0x291447[_0x1479e5(0x206)]['content'],_0x254a59=_0x291447[_0x1479e5(0x206)][_0x1479e5(0x1e8)]+(_0x38c864?0x1:0x0);let _0xb11832,_0x182f1f=![];try{_0xb11832=await updateEnterpriseKnowledgeBase(_0x478879['cookie'],_0x172b5d),assertCompanyKnowledgeBase(_0xb11832,_0x478879['appCode'],_0x291447[_0x1479e5(0x209)]['id']);if(_0xb11832['title']!==_0x12f9a0||_0xb11832[_0x1479e5(0x20b)]!==_0x4aa178||_0xb11832['version']!==_0x254a59)throw kbError(_0x1479e5(0x1fd),_0x1479e5(0x210),_0x1479e5(0x200));}catch(_0x36eda2){if(!isPlatformTransportFailure(_0x36eda2))throw _0x36eda2;_0x182f1f=!![];}const _0x6edd32=await verifyKbMutationReadback(_0x1479e5(0x21e),_0x182f1f,()=>requireKb(_0x478879,_0x291447['patch']['id'])),_0x24e906=projectKb(_0x6edd32),_0x119aef=_0x6edd32[_0x1479e5(0x1f6)]===_0x12f9a0,_0x18e20c=_0x6edd32[_0x1479e5(0x20b)]===_0x4aa178,_0x5a601f=_0x6edd32[_0x1479e5(0x1e8)]===_0x254a59&&(!_0xb11832||_0x6edd32['id']===_0xb11832['id']&&_0x6edd32['version']===_0xb11832[_0x1479e5(0x1e8)]),_0x390076=!_0x182f1f||_0x291447['replacement']!==undefined||_0x291447[_0x1479e5(0x209)][_0x1479e5(0x1f6)]===undefined||_0x291447['beforeRecord']['title']!==_0x291447[_0x1479e5(0x209)]['title'];if(!_0x119aef||!_0x18e20c||!_0x5a601f||!_0x390076)throw kbError(_0x182f1f?_0x1479e5(0x1ec):_0x1479e5(0x1fd),'Company\x20knowledge\x20base\x20'+_0x291447[_0x1479e5(0x209)]['id']+_0x1479e5(0x1f4),_0x1479e5(0x1f5)+_0x291447[_0x1479e5(0x209)]['id']+_0x1479e5(0x220));const _0x4e1636=[];return _0x182f1f&&_0x4e1636[_0x1479e5(0x201)](_0x1479e5(0x1fb)),{'ok':!![],'data':{'operation':_0x1479e5(0x21e),'selector':{'id':_0x24e906['id'],'scope':'company','appCode':_0x24e906[_0x1479e5(0x20c)]},'before':_0x291447[_0x1479e5(0x1ee)],'after':_0x24e906,'dryRun':![],'backend':{'method':_0x1479e5(0x215),'path':knowledgeDocumentsPath(_0x1479e5(0x217),_0x1479e5(0x21e))},'warnings':_0x4e1636,'verification':{'status':_0x1479e5(0x1fe),'recoveredAfterUnknownResponse':_0x182f1f,'expectedVersion':_0x291447[_0x1479e5(0x206)][_0x1479e5(0x1e8)],'atomicCompareAndSet':!![],'lookupCommand':'rabetbase\x20kb\x20detail\x20--id\x20'+_0x24e906['id']+_0x1479e5(0x1ed)}},'message':_0x1479e5(0x214)+_0x24e906['id']};}};
|