@lovrabet/rabetbase-cli 2.5.10-beta.3 → 2.5.10-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/api-group.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/generate-sdk-config-file.js +1 -1
- package/lib/api/legacy-api-file.js +1 -1
- package/lib/api/model-registry-file.js +1 -1
- package/lib/api/model-registry-scaffold.js +1 -1
- package/lib/api/model-source.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/detail.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/logs.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/delete.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/dataset/batch-design.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/cross-relation-create.js +1 -1
- package/lib/commands/dataset/cross-relation-delete.js +1 -1
- package/lib/commands/dataset/cross-relation-list.js +1 -1
- package/lib/commands/dataset/cross-relation-shared.js +1 -1
- package/lib/commands/dataset/cross-relation-update.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/design-context.js +1 -1
- package/lib/commands/dataset/design-start.js +1 -1
- package/lib/commands/dataset/design-status.js +1 -1
- package/lib/commands/dataset/design-sync-retry.js +1 -1
- package/lib/commands/dataset/design-sync-status.js +1 -1
- package/lib/commands/dataset/design-validate.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-restore.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/dataset/user-deleted-field-list.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/cross-db-analysis-shared.js +1 -1
- package/lib/commands/db/cross-db-analyze-latest.js +1 -1
- package/lib/commands/db/cross-db-analyze-start.js +1 -1
- package/lib/commands/db/cross-db-analyze-status.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/table-diff-shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/deployment/index.js +1 -1
- package/lib/commands/deployment/sync-all.js +1 -1
- package/lib/commands/deployment/sync-jobs.js +1 -1
- package/lib/commands/deployment/sync-status.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/flow/create.js +1 -1
- package/lib/commands/flow/detail.js +1 -1
- package/lib/commands/flow/index.js +1 -1
- package/lib/commands/flow/list.js +1 -1
- package/lib/commands/flow/page-list.js +1 -1
- package/lib/commands/flow/publish.js +1 -1
- package/lib/commands/flow/runtime-resources-shared.js +1 -1
- package/lib/commands/flow/runtime-role-list.js +1 -1
- package/lib/commands/flow/runtime-role-user-list.js +1 -1
- package/lib/commands/flow/runtime-user-search.js +1 -1
- package/lib/commands/flow/shared.js +1 -1
- package/lib/commands/flow/update.js +1 -1
- package/lib/commands/flow/validate.js +1 -1
- package/lib/commands/instant-api-policy/current.js +1 -1
- package/lib/commands/instant-api-policy/index.js +1 -1
- package/lib/commands/instant-api-policy/init.js +1 -1
- package/lib/commands/instant-api-policy/publish.js +1 -1
- package/lib/commands/instant-api-policy/pull.js +1 -1
- package/lib/commands/instant-api-policy/revision.js +1 -1
- package/lib/commands/instant-api-policy/revisions.js +1 -1
- package/lib/commands/instant-api-policy/rollback.js +1 -1
- package/lib/commands/instant-api-policy/shared.js +1 -1
- package/lib/commands/instant-api-policy/validate.js +1 -1
- package/lib/commands/issue/context.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/search.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/path.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/subapp-assets.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/subapp-assets-status.js +1 -1
- package/lib/commands/menu/subapp-assets-update.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.js +1 -1
- package/lib/commands/page/custom/update.js +1 -1
- package/lib/commands/page/data-list-status.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/api-architecture-upgrade.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/domain-routing-sync.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/rule/get.js +1 -1
- package/lib/commands/rule/index.js +1 -1
- package/lib/commands/rule/list.js +1 -1
- package/lib/commands/rule/set.js +1 -1
- package/lib/commands/rule/shared.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/feishu-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/project-domain-routing.js +1 -1
- package/lib/config/region-config.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/routing-profile.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/hook-directory.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/cross-db-analysis.js +1 -1
- package/lib/core/cross-db-relation.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/flow-config.js +1 -1
- package/lib/core/instant-api-policy/config.js +1 -1
- package/lib/core/instant-api-policy/endpoints.js +1 -1
- package/lib/core/kb-management-client.js +1 -1
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/page/lr-smart-jsx.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/supported-flags.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/services/dataset-design/checkpoint.js +1 -1
- package/lib/services/dataset-design/commands.js +1 -1
- package/lib/services/dataset-design/contract.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/rabetbase/SKILL.md +1 -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
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a147_0x5a1f5c=a147_0x108c;(function(_0x16525b,_0xe54e79){const _0x39f11d=a147_0x108c,_0x3af7e3=_0x16525b();while(!![]){try{const _0x42280f=parseInt(_0x39f11d(0x17c))/0x1*(-parseInt(_0x39f11d(0x19f))/0x2)+parseInt(_0x39f11d(0x1a9))/0x3+-parseInt(_0x39f11d(0x197))/0x4*(parseInt(_0x39f11d(0x17d))/0x5)+parseInt(_0x39f11d(0x196))/0x6*(parseInt(_0x39f11d(0x18d))/0x7)+parseInt(_0x39f11d(0x192))/0x8*(-parseInt(_0x39f11d(0x18f))/0x9)+-parseInt(_0x39f11d(0x189))/0xa+parseInt(_0x39f11d(0x185))/0xb;if(_0x42280f===_0xe54e79)break;else _0x3af7e3['push'](_0x3af7e3['shift']());}catch(_0x58d927){_0x3af7e3['push'](_0x3af7e3['shift']());}}}(a147_0x33fb,0x42172));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=a147_0x5a1f5c(0x1a8);export const NON_ATOMIC_EXPECTED_REVISION_WARNING=a147_0x5a1f5c(0x17b);export const FORCE_FLAG={'name':a147_0x5a1f5c(0x190),'type':a147_0x5a1f5c(0x1aa),'default':![],'description':a147_0x5a1f5c(0x1ab)};export const CHANGE_SUMMARY_FLAG={'name':'change-summary','type':a147_0x5a1f5c(0x181),'required':![],'description':a147_0x5a1f5c(0x184)};export const REVISION_FLAG={'name':a147_0x5a1f5c(0x183),'type':a147_0x5a1f5c(0x1a3),'required':!![],'description':a147_0x5a1f5c(0x19c)};export const EXPECTED_REVISION_FLAG={'name':a147_0x5a1f5c(0x1a7),'type':a147_0x5a1f5c(0x1a3),'required':![],'description':a147_0x5a1f5c(0x199)};export function requireForceConfirmation(_0x43e99f){const _0x1e6236=a147_0x5a1f5c;if(!_0x43e99f[_0x1e6236(0x1a4)]('force')||_0x43e99f[_0x1e6236(0x1a4)](_0x1e6236(0x187)))return;throw instantApiPolicyError(_0x1e6236(0x193),'--force\x20requires\x20--yes\x20because\x20it\x20replaces\x20the\x20fixed\x20local\x20policy\x20file.',_0x1e6236(0x198));}export function readChangeSummary(_0x2bedbe){const _0x4153fa=a147_0x5a1f5c,_0x5766f0=_0x2bedbe['str']('change-summary')[_0x4153fa(0x19e)]();if(!_0x5766f0)return undefined;if(_0x5766f0['length']>0x7d0)throw instantApiPolicyError(_0x4153fa(0x18c),_0x4153fa(0x19d));return _0x5766f0;}export function readRevision(_0x52a718){const _0x4de962=a147_0x5a1f5c,_0x337e63=_0x52a718['num'](_0x4de962(0x183),Number[_0x4de962(0x195)]);if(!Number[_0x4de962(0x179)](_0x337e63)||_0x337e63<=0x0)throw instantApiPolicyError(_0x4de962(0x17a),_0x4de962(0x18b));return _0x337e63;}export function readExpectedRevision(_0x54c75e){const _0x1803ff=a147_0x5a1f5c;if(_0x54c75e[_0x1803ff(0x1af)]('expected-revision')===undefined)return undefined;const _0x23c8e4=_0x54c75e[_0x1803ff(0x182)](_0x1803ff(0x1a7),Number[_0x1803ff(0x195)]);if(!Number[_0x1803ff(0x179)](_0x23c8e4)||_0x23c8e4<0x0)throw instantApiPolicyError(_0x1803ff(0x18e),_0x1803ff(0x1a2));return _0x23c8e4;}export function assertExpectedRevision(_0x2ba916,_0x5bd0df){const _0x2f3b3e=a147_0x5a1f5c;if(_0x5bd0df===undefined)return;const _0x15d22c=_0x2ba916?.[_0x2f3b3e(0x183)]??0x0;if(_0x15d22c!==_0x5bd0df)throw instantApiPolicyError(_0x2f3b3e(0x1ad),_0x2f3b3e(0x17f),'Expected\x20revision\x20'+_0x5bd0df+_0x2f3b3e(0x1a1)+_0x15d22c+'.\x20Run\x20current\x20and\x20review\x20before\x20retrying.');}export async function readFixedPolicy(_0x1fd3af){const _0x2d80e8=loadInstantApiPolicyLocalConfig(_0x1fd3af['appCode']),_0x19b417=await readInstantApiPolicyConfigFile(_0x2d80e8);return{'local':_0x2d80e8,'config':_0x19b417};}function a147_0x33fb(){const _0x5a3596=['instant_api_policy_force_confirmation_required','enabled','NaN','6AaNNlN','380XeOOQE','Review\x20the\x20existing\x20file,\x20then\x20rerun\x20with\x20--force\x20--yes.','Non-atomic\x20assertion\x20for\x20the\x20current\x20revision;\x20use\x200\x20when\x20unconfigured','gmtModified','operatorId','Positive\x20published\x20policy\x20revision','--change-summary\x20cannot\x20exceed\x202000\x20characters.','trim','711498HuhSmb','configHash',';\x20current\x20revision\x20is\x20','--expected-revision\x20must\x20be\x20a\x20non-negative\x20safe\x20integer.','number','bool','createUserId','appCode','expected-revision','Runtime\x20instances\x20may\x20take\x20up\x20to\x2030\x20seconds\x20to\x20observe\x20the\x20new\x20active\x20policy.','1109979BsVRiw','boolean','Replace\x20an\x20existing\x20fixed\x20policy\x20file;\x20requires\x20--yes','length','instant_api_policy_revision_mismatch','updateUserId','flag','isSafeInteger','instant_api_policy_revision_invalid','--expected-revision\x20is\x20a\x20non-atomic\x20read-before-write\x20assertion;\x20the\x20server\x20mutation\x20contract\x20has\x20no\x20revision\x20predicate.','1fNxquv','2770WqRUIx','changeType','The\x20current\x20Instant\x20API\x20policy\x20revision\x20changed\x20before\x20mutation.','version','string','num','revision','Audit\x20summary\x20for\x20this\x20policy\x20revision\x20(maximum\x202000\x20characters)','5442877bKoJpx','gmtCreate','yes','config','3433290TAOSdP','defaults','--revision\x20must\x20be\x20a\x20positive\x20safe\x20integer.','instant_api_policy_change_summary_invalid','2946825YPieEl','instant_api_policy_expected_revision_invalid','112869bpqYbZ','force','policyId','168mCsxoZ'];a147_0x33fb=function(){return _0x5a3596;};return a147_0x33fb();}export function projectCurrentPolicy(_0x5807d0){const _0x5605a1=a147_0x5a1f5c;if(!_0x5807d0)return null;return{'id':_0x5807d0['id'],'appCode':_0x5807d0[_0x5605a1(0x1a6)],'revision':_0x5807d0[_0x5605a1(0x183)],'configHash':_0x5807d0[_0x5605a1(0x1a0)],'enabled':_0x5807d0[_0x5605a1(0x194)],'config':_0x5807d0[_0x5605a1(0x188)],'createUserId':_0x5807d0[_0x5605a1(0x1a5)]??null,'updateUserId':_0x5807d0[_0x5605a1(0x1ae)]??null,'gmtCreate':_0x5807d0[_0x5605a1(0x186)]??null,'gmtModified':_0x5807d0[_0x5605a1(0x19a)]??null};}function a147_0x108c(_0x4f15e2,_0x32a4fa){_0x4f15e2=_0x4f15e2-0x179;const _0x33fb77=a147_0x33fb();let _0x108c0f=_0x33fb77[_0x4f15e2];return _0x108c0f;}export function projectRevisionSummary(_0x28eed1){const _0x2f86a4=a147_0x5a1f5c;return{'id':_0x28eed1['id'],'policyId':_0x28eed1[_0x2f86a4(0x191)],'appCode':_0x28eed1['appCode'],'revision':_0x28eed1[_0x2f86a4(0x183)],'configHash':_0x28eed1[_0x2f86a4(0x1a0)],'changeType':_0x28eed1[_0x2f86a4(0x17e)],'changeSummary':_0x28eed1['changeSummary']??null,'operatorId':_0x28eed1[_0x2f86a4(0x19b)]??null,'gmtCreate':_0x28eed1['gmtCreate']??null,'version':_0x28eed1[_0x2f86a4(0x188)][_0x2f86a4(0x180)],'defaultAction':_0x28eed1[_0x2f86a4(0x188)][_0x2f86a4(0x18a)]['instantApi'],'ruleCount':_0x28eed1[_0x2f86a4(0x188)]['rules']?.[_0x2f86a4(0x1ac)]??0x0};}export function projectRevisionDetail(_0x30cb0a){const _0x2251b4=a147_0x5a1f5c;return{...projectRevisionSummary(_0x30cb0a),'config':_0x30cb0a[_0x2251b4(0x188)]};}export function expectedRevisionWarnings(_0x5a5419){return _0x5a5419===undefined?[]:[NON_ATOMIC_EXPECTED_REVISION_WARNING];}export function mutationLookupCommand(){return'rabetbase\x20instant-api-policy\x20current\x20--format\x20compress';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a148_0x10deba=a148_0x5522;(function(_0x5906e3,_0x480fc2){const _0x3df36b=a148_0x5522,_0x7d5efe=_0x5906e3();while(!![]){try{const _0x4f675=-parseInt(_0x3df36b(0x15a))/0x1+parseInt(_0x3df36b(0x156))/0x2*(parseInt(_0x3df36b(0x15b))/0x3)+parseInt(_0x3df36b(0x163))/0x4*(parseInt(_0x3df36b(0x15f))/0x5)+parseInt(_0x3df36b(0x159))/0x6*(parseInt(_0x3df36b(0x160))/0x7)+-parseInt(_0x3df36b(0x14f))/0x8+-parseInt(_0x3df36b(0x15d))/0x9*(-parseInt(_0x3df36b(0x151))/0xa)+-parseInt(_0x3df36b(0x161))/0xb*(parseInt(_0x3df36b(0x154))/0xc);if(_0x4f675===_0x480fc2)break;else _0x7d5efe['push'](_0x7d5efe['shift']());}catch(_0x1a99fa){_0x7d5efe['push'](_0x7d5efe['shift']());}}}(a148_0x2421,0xac7d5));import{validateInstantApiPolicy}from'../../core/api-client.js';import{INSTANT_API_POLICY_PATHS,readFixedPolicy}from'../../commands/instant-api-policy/shared.js';function a148_0x2421(){const _0x19d08c=['3414453DKjHtO','valid','15381PlVRUk','policyFilePath','3227855TuXDmW','7XHIutE','11DDudmp','configHash','4RKSWUa','validate','4903808bawpdt','Validate\x20the\x20fixed\x20local\x20policy\x20without\x20publishing','5410RKMLdo','POST','appCode','13851072iOtUsz','read','2uqkMmG','policyRelativePath','normalizedConfig','5715894LmZWdT','1187191JvHTdW'];a148_0x2421=function(){return _0x19d08c;};return a148_0x2421();}function a148_0x5522(_0x7d0a7f,_0x536991){_0x7d0a7f=_0x7d0a7f-0x14e;const _0x242183=a148_0x2421();let _0x55226f=_0x242183[_0x7d0a7f];return _0x55226f;}export const instantApiPolicyValidate={'service':'instant-api-policy','command':a148_0x10deba(0x14e),'description':a148_0x10deba(0x150),'risk':a148_0x10deba(0x155),'requiresAppCode':!![],'structuredErrors':!![],'flags':[],async 'execute'(_0x4950d8){const _0x3ba1b5=a148_0x10deba,{local:_0x5169c7,config:_0x16b52e}=await readFixedPolicy(_0x4950d8),_0x479c72=await validateInstantApiPolicy({'appCode':_0x4950d8[_0x3ba1b5(0x153)],'config':_0x16b52e});return{'ok':!![],'data':{'operation':_0x3ba1b5(0x14e),'selector':{'appCode':_0x4950d8[_0x3ba1b5(0x153)]},'filePath':_0x5169c7[_0x3ba1b5(0x15e)],'relativePath':_0x5169c7[_0x3ba1b5(0x157)],'valid':_0x479c72[_0x3ba1b5(0x15c)],'configHash':_0x479c72[_0x3ba1b5(0x162)],'normalizedConfig':_0x479c72[_0x3ba1b5(0x158)],'backend':{'method':_0x3ba1b5(0x152),'path':INSTANT_API_POLICY_PATHS['validate']}},'message':'Validated\x20Instant\x20API\x20policy\x20for\x20'+_0x4950d8[_0x3ba1b5(0x153)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a149_0x4383(_0x41b1b2,_0x3e50a0){_0x41b1b2=_0x41b1b2-0x16a;const _0xb9377f=a149_0xb937();let _0x438355=_0xb9377f[_0x41b1b2];return _0x438355;}(function(_0xd91148,_0x1b37e6){const _0x586e48=a149_0x4383,_0x4e89a2=_0xd91148();while(!![]){try{const _0x3e42d4=parseInt(_0x586e48(0x16a))/0x1+parseInt(_0x586e48(0x17a))/0x2+-parseInt(_0x586e48(0x174))/0x3*(parseInt(_0x586e48(0x173))/0x4)+-parseInt(_0x586e48(0x16c))/0x5+-parseInt(_0x586e48(0x17d))/0x6*(-parseInt(_0x586e48(0x170))/0x7)+parseInt(_0x586e48(0x177))/0x8*(-parseInt(_0x586e48(0x16b))/0x9)+parseInt(_0x586e48(0x16f))/0xa*(parseInt(_0x586e48(0x172))/0xb);if(_0x3e42d4===_0x1b37e6)break;else _0x4e89a2['push'](_0x4e89a2['shift']());}catch(_0x11d086){_0x4e89a2['push'](_0x4e89a2['shift']());}}}(a149_0xb937,0x861ec));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_0xb937(){const _0x4572bf=['859838RtvDch','user','2321bNvAjR','388PKASoZ','8286OxyNZu','username','mergedCli','32TmCWpJ','unknown','nickname','435162tJxAJE','tenant_code','tenant','6PEAaWe','544185yJkyGH','2402802MgjaBZ','1602445FMAjlM','email','cookie','62610SFlosC'];a149_0xb937=function(){return _0x4572bf;};return a149_0xb937();}import{VERSION,GIT_COMMIT}from'../../generated/build-info.js';export async function getIssueReportContext(_0x18e47,_0x253160){const _0x5c95e0=a149_0x4383,_0x2734c2=_0x253160?undefined:(await getSessionUserInfo(_0x18e47[_0x5c95e0(0x16e)]))?.[_0x5c95e0(0x171)];return{'serviceName':NPM_PACKAGE_NAME,'serviceVersion':GIT_COMMIT!==_0x5c95e0(0x178)?VERSION+'+'+GIT_COMMIT:VERSION,'environment':getEnv(),'appCode':_0x18e47['appCode']||_0x18e47[_0x5c95e0(0x176)]?.['appCode']||getConfigAppCode(),'os':platform()+'\x20'+release()+'\x20'+arch(),'terminal':process.env.TERM,'user':_0x2734c2?{'id':_0x2734c2['id'],'username':_0x2734c2[_0x5c95e0(0x175)],'nickname':_0x2734c2[_0x5c95e0(0x179)],'email':_0x2734c2[_0x5c95e0(0x16d)],'tenantCode':_0x2734c2[_0x5c95e0(0x17c)]?.[_0x5c95e0(0x17b)]}:undefined};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5c543e,_0x583020){const _0x25b84e=a150_0x31c7,_0x42a98f=_0x5c543e();while(!![]){try{const _0x5d37ec=parseInt(_0x25b84e(0x11b))/0x1*(parseInt(_0x25b84e(0x11d))/0x2)+parseInt(_0x25b84e(0x11c))/0x3+parseInt(_0x25b84e(0x11f))/0x4+-parseInt(_0x25b84e(0x122))/0x5+-parseInt(_0x25b84e(0x123))/0x6*(parseInt(_0x25b84e(0x120))/0x7)+parseInt(_0x25b84e(0x11e))/0x8+-parseInt(_0x25b84e(0x121))/0x9*(parseInt(_0x25b84e(0x11a))/0xa);if(_0x5d37ec===_0x583020)break;else _0x42a98f['push'](_0x42a98f['shift']());}catch(_0x32fa55){_0x42a98f['push'](_0x42a98f['shift']());}}}(a150_0x4e2c,0x98a71));function a150_0x4e2c(){const _0x53c3c7=['1999415JNpOxs','4238538QJxXLd','19730niVVuk','1OfgOwg','383694WMwhnl','2223678HnApzg','9585024EnBwjX','1799536ZfbLvE','7wezlfk','5274NUUnbR'];a150_0x4e2c=function(){return _0x53c3c7;};return a150_0x4e2c();}import{issueReport}from'../../commands/issue/report.js';function a150_0x31c7(_0x23a569,_0xa4ccae){_0x23a569=_0x23a569-0x11a;const _0x4e2cdd=a150_0x4e2c();let _0x31c7b5=_0x4e2cdd[_0x23a569];return _0x31c7b5;}export const issueDefinitions=[issueReport];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a151_0xfacc81=a151_0x4804;(function(_0x171d41,_0xae4bcf){const _0x3caa11=a151_0x4804,_0x3a4ae7=_0x171d41();while(!![]){try{const _0x860f40=parseInt(_0x3caa11(0x1f4))/0x1*(parseInt(_0x3caa11(0x1f6))/0x2)+parseInt(_0x3caa11(0x1f3))/0x3*(parseInt(_0x3caa11(0x1ef))/0x4)+parseInt(_0x3caa11(0x211))/0x5*(-parseInt(_0x3caa11(0x20a))/0x6)+-parseInt(_0x3caa11(0x1fd))/0x7*(parseInt(_0x3caa11(0x1fe))/0x8)+-parseInt(_0x3caa11(0x1fa))/0x9+-parseInt(_0x3caa11(0x206))/0xa*(-parseInt(_0x3caa11(0x1f2))/0xb)+parseInt(_0x3caa11(0x212))/0xc*(parseInt(_0x3caa11(0x203))/0xd);if(_0x860f40===_0xae4bcf)break;else _0x3a4ae7['push'](_0x3a4ae7['shift']());}catch(_0x5d888f){_0x3a4ae7['push'](_0x3a4ae7['shift']());}}}(a151_0x2a94,0xadd5f));import{CliError}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const NUDGE_OPT_OUT_ENV=a151_0xfacc81(0x20b);const NUDGE_SUPPRESSED_CODES=new Set([a151_0xfacc81(0x1fc),'auth_required',a151_0xfacc81(0x209),a151_0xfacc81(0x1f1),'unknown_command',a151_0xfacc81(0x20f),a151_0xfacc81(0x1f9),a151_0xfacc81(0x1f5)]),defaultWriter=_0x45a659=>{const _0x3e5d01=a151_0xfacc81;process['stderr'][_0x3e5d01(0x1f0)](_0x45a659);};export function shouldNudgeForError(_0x479f6d,_0x1bf32d){const _0x3bd08b=a151_0xfacc81;if(process.env[NUDGE_OPT_OUT_ENV]==='1')return![];if(_0x1bf32d['service']===_0x3bd08b(0x210)&&_0x1bf32d['command']==='report')return![];if(_0x479f6d instanceof CliError)return!NUDGE_SUPPRESSED_CODES[_0x3bd08b(0x20e)](_0x479f6d['code']);return!![];}function a151_0x4804(_0x3cd1f9,_0x4f01af){_0x3cd1f9=_0x3cd1f9-0x1ef;const _0x2a9488=a151_0x2a94();let _0x48049f=_0x2a9488[_0x3cd1f9];return _0x48049f;}export function printIssueReportNudgeForError(_0xa16a3e,_0xf68954,_0x43eeee=defaultWriter){if(!shouldNudgeForError(_0xa16a3e,_0xf68954))return;const _0x2dba1e=buildSuggestedTitle(_0xa16a3e,_0xf68954);_0x43eeee(formatNudge(_0x2dba1e));}function buildSuggestedTitle(_0x28077b,_0xd6e1af){const _0x208812=a151_0xfacc81,_0x1c2e9b=_0x28077b instanceof Error?_0x28077b[_0x208812(0x1f8)]:String(_0x28077b),_0x1d667f=_0x1c2e9b[_0x208812(0x207)](/[\r\n]+/g,'\x20')[_0x208812(0x207)](/\s+/g,'\x20')[_0x208812(0x204)]()[_0x208812(0x20c)](0x0,0x78)[_0x208812(0x207)](/"/g,'\x5c\x22'),_0x47c413=CLI_BIN_NAME+'\x20'+_0xd6e1af['service']+'\x20'+_0xd6e1af[_0x208812(0x208)];return _0x1d667f[_0x208812(0x1f7)]>0x0?_0x47c413+':\x20'+_0x1d667f:_0x47c413;}function a151_0x2a94(){const _0x26c095=['132CCfiwz','write','not_in_project','357423NJrwcw','84207AMUPCX','204201PlBUkG','network_error','6yuhghU','length','message','validation_error','6761286dJvUPO','=1\x20to\x20silence\x20this\x20hint.','cancelled','3367oijUdN','2232JoxnwB','\x20bug?\x20Help\x20us\x20fix\x20it:','Hit\x20a\x20','join','\x20issue\x20report\x20\x5c','641303OtcZGQ','trim','\x20\x20Set\x20','290KnTVwO','replace','command','config_missing','116034XsNTzH','RABETBASE_DISABLE_ISSUE_NUDGE','slice','\x20\x20\x20\x20--title\x20\x22','has','flag_missing','issue','305jxTgyS','72mQPPAG'];a151_0x2a94=function(){return _0x26c095;};return a151_0x2a94();}function formatNudge(_0x38116a){const _0x386706=a151_0xfacc81;return['',_0x386706(0x200)+CLI_BIN_NAME+_0x386706(0x1ff),'\x20\x20'+CLI_BIN_NAME+_0x386706(0x202),_0x386706(0x20d)+_0x38116a+'\x22\x20\x5c','\x20\x20\x20\x20--description\x20\x22Steps\x20to\x20reproduce,\x20expected\x20vs\x20actual,\x20and\x20any\x20relevant\x20logs.\x22','\x20\x20(Cookies\x20/\x20Authorization\x20/\x20access\x20keys\x20are\x20automatically\x20redacted\x20before\x20upload.)',_0x386706(0x205)+NUDGE_OPT_OUT_ENV+_0x386706(0x1fb),''][_0x386706(0x201)]('\x0a');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a152_0x12fc(){const _0xf5a9c3=['Path\x20to\x20a\x20markdown\x20file\x20whose\x20contents\x20become\x20issue.description','Provide\x20exactly\x20one\x20of\x20--description\x20or\x20--description-file.','title','Inline\x20markdown\x20issue\x20description\x20(alternative\x20to\x20--description-file)','Issue\x20description\x20cannot\x20be\x20empty.','spanName','One-line\x20issue\x20summary','Use\x20--description\x20for\x20short\x20markdown\x20text,\x20or\x20--description-file\x20for\x20full\x20issue\x20context.','trim','2VUKukY','compress','string','11DgcZCB','truncated:\x20original\x20','Submit\x20a\x20problem\x20log','cwd','descriptionSource','inline','Report\x20a\x20problem\x20log\x20with\x20title\x20and\x20markdown\x20context','utf8','Issue\x20log\x20submitted\x20(content\x20redacted\x20or\x20truncated)','validate','descriptionSource:\x20','File\x20not\x20found:\x20','\x20bytes','file','descriptionFilePath','report','write','136wCTpzG','redactionCount','POST','4022670BnwUbl','Cannot\x20read\x20issue\x20description\x20file:\x20','redactionKinds','message','3uNaCpg','str','description','321399SgqFYV','length','join','descriptionFile:\x20','validation','redactions:\x20','filter','19588530fWfxpN','keys','logData','273148vyLlPj','sanitize','3788134zfpdQo','141203ZFdkur','1595200ginwBp','traceName','truncated'];a152_0x12fc=function(){return _0xf5a9c3;};return a152_0x12fc();}const a152_0xc41c9c=a152_0x1a18;(function(_0x6eb94d,_0x464e10){const _0x279621=a152_0x1a18,_0x1df6fa=_0x6eb94d();while(!![]){try{const _0x32130d=-parseInt(_0x279621(0x13c))/0x1*(parseInt(_0x279621(0x149))/0x2)+parseInt(_0x279621(0x164))/0x3*(parseInt(_0x279621(0x139))/0x4)+parseInt(_0x279621(0x13d))/0x5+-parseInt(_0x279621(0x160))/0x6+-parseInt(_0x279621(0x13b))/0x7+parseInt(_0x279621(0x15d))/0x8*(-parseInt(_0x279621(0x167))/0x9)+-parseInt(_0x279621(0x136))/0xa*(-parseInt(_0x279621(0x14c))/0xb);if(_0x32130d===_0x464e10)break;else _0x1df6fa['push'](_0x1df6fa['shift']());}catch(_0x13ec01){_0x1df6fa['push'](_0x1df6fa['shift']());}}}(a152_0x12fc,0x5e4eb));import{existsSync}from'node:fs';function a152_0x1a18(_0x1ec7b9,_0x2aa832){_0x1ec7b9=_0x1ec7b9-0x135;const _0x12fc21=a152_0x12fc();let _0x1a1873=_0x12fc21[_0x1ec7b9];return _0x1a1873;}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';const DESCRIPTION_FILE_FLAG='description-file';export const issueReport={'service':'issue','command':a152_0xc41c9c(0x15b),'description':a152_0xc41c9c(0x152),'risk':a152_0xc41c9c(0x15c),'confirmationDescription':'Submit\x20the\x20issue\x20description\x20and\x20diagnostic\x20context\x20as\x20a\x20problem\x20log.','requiresAuth':!![],'requiresAppCode':![],'defaultOutputFormat':a152_0xc41c9c(0x14a),'flags':[{'name':a152_0xc41c9c(0x142),'type':a152_0xc41c9c(0x14b),'required':!![],'description':a152_0xc41c9c(0x146)},{'name':a152_0xc41c9c(0x166),'type':a152_0xc41c9c(0x14b),'description':a152_0xc41c9c(0x143)},{'name':DESCRIPTION_FILE_FLAG,'type':a152_0xc41c9c(0x14b),'description':a152_0xc41c9c(0x140)}],async 'validate'(_0x580d44){const _0x170797=a152_0xc41c9c,_0x391110=_0x580d44[_0x170797(0x165)](_0x170797(0x142))[_0x170797(0x148)](),_0x179205=_0x580d44[_0x170797(0x165)](_0x170797(0x166))[_0x170797(0x148)](),_0x26d5e3=_0x580d44['str'](DESCRIPTION_FILE_FLAG)[_0x170797(0x148)]();if(!_0x391110)throw CliErrors['flagMissing'](_0x170797(0x142),'Provide\x20--title\x20with\x20a\x20one-line\x20issue\x20summary.');const _0x1f29b1=_0x179205[_0x170797(0x168)]>0x0,_0x47130f=_0x26d5e3[_0x170797(0x168)]>0x0;if(_0x1f29b1===_0x47130f)throw CliErrors[_0x170797(0x16b)](_0x170797(0x141),_0x170797(0x147));if(_0x47130f){const _0x14dca7=resolve(process[_0x170797(0x14f)](),_0x26d5e3);if(!existsSync(_0x14dca7))throw CliErrors[_0x170797(0x16b)](_0x170797(0x157)+_0x14dca7);}},async 'dryRun'(_0x21159c){const _0x44f13a=a152_0xc41c9c,_0x390373=await prepareIssueReport(_0x21159c,!![]);return{'method':_0x44f13a(0x15f),'url':'otel://'+_0x390373['traceName']+'/'+_0x390373['spanName'],'body':{'traceName':_0x390373[_0x44f13a(0x13e)],'spanName':_0x390373['spanName'],'logData':_0x390373['logData']},'description':[_0x44f13a(0x14e),_0x44f13a(0x156)+_0x390373[_0x44f13a(0x150)],_0x390373['descriptionFilePath']?_0x44f13a(0x16a)+_0x390373[_0x44f13a(0x15a)]:null,_0x390373[_0x44f13a(0x13a)][_0x44f13a(0x13f)]?_0x44f13a(0x14d)+_0x390373[_0x44f13a(0x13a)]['originalBytes']+_0x44f13a(0x158):null,_0x390373[_0x44f13a(0x13a)]['redactionCount']>0x0?_0x44f13a(0x16c)+_0x390373[_0x44f13a(0x13a)][_0x44f13a(0x15e)]+'\x20('+_0x390373[_0x44f13a(0x13a)][_0x44f13a(0x162)][_0x44f13a(0x169)](',\x20')+')':null][_0x44f13a(0x135)](Boolean)[_0x44f13a(0x169)]('\x0a')};},async 'execute'(_0x19517c){const _0x199137=a152_0xc41c9c,_0x1cca5e=await prepareIssueReport(_0x19517c,![]);return{'ok':!![],'message':_0x1cca5e[_0x199137(0x13a)][_0x199137(0x15e)]||_0x1cca5e['sanitize'][_0x199137(0x13f)]?_0x199137(0x154):'Issue\x20log\x20submitted','data':{'traceName':_0x1cca5e[_0x199137(0x13e)],'spanName':_0x1cca5e[_0x199137(0x145)],'logDataKeys':Object[_0x199137(0x137)](_0x1cca5e[_0x199137(0x138)]),'issue':{'title':_0x1cca5e[_0x199137(0x142)],'descriptionLength':_0x1cca5e['description']['length'],'descriptionSource':_0x1cca5e[_0x199137(0x150)],..._0x1cca5e[_0x199137(0x15a)]?{'descriptionFile':_0x1cca5e[_0x199137(0x15a)]}:{},'sanitize':{'originalBytes':_0x1cca5e['sanitize']['originalBytes'],'truncated':_0x1cca5e[_0x199137(0x13a)][_0x199137(0x13f)],'redactions':_0x1cca5e['sanitize'][_0x199137(0x15e)],'redactionKinds':_0x1cca5e[_0x199137(0x13a)][_0x199137(0x162)]}}}};}};async function prepareIssueReport(_0x2bb47a,_0x2b408f){const _0xa32c1f=a152_0xc41c9c;await issueReport[_0xa32c1f(0x155)](_0x2bb47a);const _0x19a6db=_0x2bb47a[_0xa32c1f(0x165)](DESCRIPTION_FILE_FLAG)['trim'](),_0x548a6d=_0x19a6db?resolve(process[_0xa32c1f(0x14f)](),_0x19a6db):undefined;let _0xaadc4=_0x2bb47a[_0xa32c1f(0x165)]('description');if(_0x548a6d)try{_0xaadc4=await readFile(_0x548a6d,_0xa32c1f(0x153));}catch{throw CliErrors[_0xa32c1f(0x16b)](_0xa32c1f(0x161)+_0x548a6d);}if(!_0xaadc4[_0xa32c1f(0x148)]())throw CliErrors[_0xa32c1f(0x16b)](_0xa32c1f(0x144));const _0x4a748a=await getIssueReportContext(_0x2bb47a,_0x2b408f);try{const _0x51c7b4=await reportIssue({'title':_0x2bb47a['str'](_0xa32c1f(0x142)),'description':_0xaadc4,'context':_0x4a748a,'dryRun':_0x2b408f,'redactDescription':process.env.RABETBASE_ISSUE_RAW_DESCRIPTION!=='1'});return{..._0x51c7b4,'descriptionSource':_0x548a6d?_0xa32c1f(0x159):_0xa32c1f(0x151),'descriptionFilePath':_0x548a6d};}catch(_0x4f1922){throw CliErrors['apiError']('Failed\x20to\x20submit\x20issue\x20log:\x20'+(_0x4f1922 instanceof Error?_0x4f1922[_0xa32c1f(0x163)]:String(_0x4f1922)),'Check\x20your\x20login\x20and\x20network\x20connectivity.');}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a153_0x2382c1=a153_0x203a;(function(_0x53968e,_0x2fe66c){const _0x182f7a=a153_0x203a,_0x5dfc2f=_0x53968e();while(!![]){try{const _0x43aee0=-parseInt(_0x182f7a(0xf4))/0x1+parseInt(_0x182f7a(0xd9))/0x2+-parseInt(_0x182f7a(0xd0))/0x3+parseInt(_0x182f7a(0xe3))/0x4*(parseInt(_0x182f7a(0xdf))/0x5)+parseInt(_0x182f7a(0xe4))/0x6+parseInt(_0x182f7a(0xdb))/0x7*(parseInt(_0x182f7a(0xd4))/0x8)+-parseInt(_0x182f7a(0xf0))/0x9*(-parseInt(_0x182f7a(0xd7))/0xa);if(_0x43aee0===_0x2fe66c)break;else _0x5dfc2f['push'](_0x5dfc2f['shift']());}catch(_0x50a181){_0x5dfc2f['push'](_0x5dfc2f['shift']());}}}(a153_0x54be,0x75e1d));import{knowledgeDocumentsPath}from'../../core/api-client.js';import{createEnterpriseKnowledgeBase,isPlatformTransportFailure}from'../../core/api-client.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCompanyKnowledgeBase,fetchAllCompanyKnowledgeBases,findExactCompanyKnowledgeBases,inspectKbContent,kbError,projectKb,readKbFile,requireKb,verifyKbMutationReadback}from'../../commands/kb/shared.js';function a153_0x203a(_0x733426,_0x4222dc){_0x733426=_0x733426-0xd0;const _0x54be22=a153_0x54be();let _0x203a13=_0x54be22[_0x733426];return _0x203a13;}function readCreateInput(_0x482141){const _0x5d5785=a153_0x203a,_0x4f0913=_0x482141[_0x5d5785(0xdc)](_0x5d5785(0xed))[_0x5d5785(0xd8)]();if(!_0x4f0913)throw kbError(_0x5d5785(0xe2),'--title\x20is\x20required.');const _0x2f6e51=_0x482141['str'](_0x5d5785(0xde))[_0x5d5785(0xd8)]();if(!_0x2f6e51)throw kbError(_0x5d5785(0xfa),_0x5d5785(0xf2),_0x5d5785(0xfc));return{'title':_0x4f0913,'file':_0x2f6e51};}async function prepareCreate(_0x5e0c40){const _0x1c4a9a=a153_0x203a,_0x23898f=readCreateInput(_0x5e0c40),_0x31a2d5=await readKbFile(_0x23898f[_0x1c4a9a(0xde)]),_0x51dd11=await fetchAllCompanyKnowledgeBases(_0x5e0c40,{'title':_0x23898f[_0x1c4a9a(0xed)]}),_0x5a4e76=findExactCompanyKnowledgeBases(_0x51dd11,_0x5e0c40[_0x1c4a9a(0xf3)],_0x23898f[_0x1c4a9a(0xed)]);if(_0x5a4e76[_0x1c4a9a(0xfb)]>0x0)throw kbError(_0x1c4a9a(0xef),'Company\x20knowledge\x20base\x20already\x20exists\x20for\x20app\x20'+_0x5e0c40[_0x1c4a9a(0xf3)]+_0x1c4a9a(0xf7)+_0x23898f[_0x1c4a9a(0xed)]+'.',_0x1c4a9a(0xe5)+_0x5a4e76[0x0]['id']+_0x1c4a9a(0xf9));return{..._0x23898f,'content':_0x31a2d5};}function a153_0x54be(){const _0x95e587=['\x20does\x20not\x20match\x20the\x20requested\x20create\x20state.','rabetbase\x20kb\x20detail\x20--id\x20','title','kb_verification_failed','kb_already_exists','9cwwfVo','POST','--file\x20is\x20required.','appCode','748070IjkqTd','contentHash','Company\x20knowledge\x20base\x20','\x20with\x20title\x20','byteSize','\x20--format\x20compress`\x20before\x20choosing\x20update.','kb_file_required','length','Pass\x20a\x20UTF-8\x20text\x20or\x20Markdown\x20file.','content','Inspect\x20it\x20with\x20`rabetbase\x20kb\x20detail\x20--id\x20','2404701fkjmic','Create\x20a\x20company\x20knowledge\x20base\x20from\x20a\x20UTF-8\x20text\x20or\x20Markdown\x20file','company','The\x20created\x20document\x20version\x20changed\x20after\x20its\x20write\x20response.\x20Inspect\x20it\x20without\x20resubmitting.','3032888AfqGCa','Expected\x20one\x20exact\x20company\x20knowledge\x20base\x20after\x20uncertain\x20create;\x20found\x20','verified','6917810WpvCJl','trim','1059908TzKXLG','\x20--format\x20compress`;\x20do\x20not\x20resubmit\x20automatically.','7skgVve','str','\x20--format\x20compress','file','204920AAcXdQ','create','Create\x20response\x20was\x20unavailable;\x20recovered\x20one\x20exact\x20company/app/title\x20record\x20without\x20resubmitting.','kb_title_required','24CBqaal','1114392SnZXQN','Run\x20`rabetbase\x20kb\x20detail\x20--id\x20','kb_create_outcome_unknown','stringify','string','rabetbase\x20kb\x20list\x20--title\x20','UTF-8\x20text\x20or\x20Markdown\x20content\x20file'];a153_0x54be=function(){return _0x95e587;};return a153_0x54be();}function plannedAfter(_0x5cd2b1,_0xc0489f){const _0xcea56f=a153_0x203a;return{'scope':'company','appCode':_0x5cd2b1['appCode'],'title':_0xc0489f[_0xcea56f(0xed)],'contentByteSize':_0xc0489f[_0xcea56f(0xfd)][_0xcea56f(0xf8)],'contentHash':_0xc0489f[_0xcea56f(0xfd)][_0xcea56f(0xf5)]};}function verifyCreatedState(_0x1c7467,_0x42f12e,_0x3a3ede){const _0x379d5b=a153_0x203a;assertCompanyKnowledgeBase(_0x3a3ede,_0x1c7467[_0x379d5b(0xf3)],_0x3a3ede['id']);const _0x39dedb=inspectKbContent(_0x3a3ede[_0x379d5b(0xfd)]);if(_0x3a3ede[_0x379d5b(0xed)]!==_0x42f12e[_0x379d5b(0xed)]||_0x39dedb[_0x379d5b(0xf5)]!==_0x42f12e['content'][_0x379d5b(0xf5)])throw kbError('kb_verification_failed',_0x379d5b(0xf6)+_0x3a3ede['id']+_0x379d5b(0xeb),_0x379d5b(0xfe)+_0x3a3ede['id']+_0x379d5b(0xda));return projectKb(_0x3a3ede);}export const kbCreate={'service':'kb','command':a153_0x2382c1(0xe0),'description':a153_0x2382c1(0xd1),'risk':'write','requiresAppCode':!![],'structuredErrors':!![],'flags':[{'name':a153_0x2382c1(0xed),'type':'string','required':!![],'description':'Knowledge-base\x20title'},{'name':a153_0x2382c1(0xde),'type':a153_0x2382c1(0xe8),'required':!![],'description':a153_0x2382c1(0xea)}],async 'validate'(_0x453d1f){readCreateInput(_0x453d1f);},async 'dryRun'(_0x5bc5f2){const _0x4313c4=a153_0x2382c1,_0x2aab1d=await prepareCreate(_0x5bc5f2);return asDryRunResult({'operation':'create','selector':{'scope':_0x4313c4(0xd2),'appCode':_0x5bc5f2['appCode'],'title':_0x2aab1d[_0x4313c4(0xed)]},'before':null,'after':plannedAfter(_0x5bc5f2,_0x2aab1d),'dryRun':!![],'backend':{'method':_0x4313c4(0xf1),'path':knowledgeDocumentsPath(_0x4313c4(0xd2),_0x4313c4(0xe0)),'body':{'appCode':_0x5bc5f2[_0x4313c4(0xf3)],'title':_0x2aab1d[_0x4313c4(0xed)],'contentHash':_0x2aab1d[_0x4313c4(0xfd)][_0x4313c4(0xf5)],'contentByteSize':_0x2aab1d['content'][_0x4313c4(0xf8)]}},'warnings':[],'verification':{'lookupCommand':_0x4313c4(0xe9)+JSON[_0x4313c4(0xe7)](_0x2aab1d[_0x4313c4(0xed)])+_0x4313c4(0xdd)}},{'method':'POST','url':knowledgeDocumentsPath(_0x4313c4(0xd2),'create')});},async 'execute'(_0x5f5277){const _0x277fa6=a153_0x2382c1,_0x1bc825=await prepareCreate(_0x5f5277);let _0x5e1eef,_0x1e9038,_0x5bbc28=![];try{const _0x55d924=await createEnterpriseKnowledgeBase(_0x5f5277['cookie'],{'appCode':_0x5f5277[_0x277fa6(0xf3)],'title':_0x1bc825[_0x277fa6(0xed)],'content':_0x1bc825[_0x277fa6(0xfd)][_0x277fa6(0xfd)]});assertCompanyKnowledgeBase(_0x55d924,_0x5f5277[_0x277fa6(0xf3)],_0x55d924['id']),_0x5e1eef=_0x55d924['id'],_0x1e9038=_0x55d924['version'];}catch(_0x487490){if(!isPlatformTransportFailure(_0x487490))throw _0x487490;_0x5bbc28=!![];}if(_0x5e1eef===undefined){const _0x59ee1c=await verifyKbMutationReadback(_0x277fa6(0xe0),!![],()=>fetchAllCompanyKnowledgeBases(_0x5f5277,{'title':_0x1bc825[_0x277fa6(0xed)]})),_0x1c6f58=findExactCompanyKnowledgeBases(_0x59ee1c,_0x5f5277[_0x277fa6(0xf3)],_0x1bc825[_0x277fa6(0xed)]);if(_0x1c6f58[_0x277fa6(0xfb)]!==0x1)throw kbError(_0x277fa6(0xe6),_0x277fa6(0xd5)+_0x1c6f58[_0x277fa6(0xfb)]+'.','Do\x20not\x20resubmit.\x20Inspect\x20the\x20resolved\x20app\x20and\x20determine\x20the\x20outcome\x20manually.');_0x5e1eef=_0x1c6f58[0x0]['id'];}const _0x3e7d5d=await verifyKbMutationReadback('create',_0x5bbc28,()=>requireKb(_0x5f5277,_0x5e1eef));if(_0x1e9038!==undefined&&_0x3e7d5d['version']!==_0x1e9038)throw kbError(_0x277fa6(0xee),_0x277fa6(0xd3));const _0xb38aa5=verifyCreatedState(_0x5f5277,_0x1bc825,_0x3e7d5d),_0xcef619=_0x5bbc28?[_0x277fa6(0xe1)]:[];return{'ok':!![],'data':{'operation':_0x277fa6(0xe0),'selector':{'id':_0xb38aa5['id'],'scope':'company','appCode':_0xb38aa5[_0x277fa6(0xf3)]},'before':null,'after':_0xb38aa5,'dryRun':![],'backend':{'method':_0x277fa6(0xf1),'path':knowledgeDocumentsPath(_0x277fa6(0xd2),'create')},'warnings':_0xcef619,'verification':{'status':_0x277fa6(0xd6),'recoveredAfterUnknownResponse':_0x5bbc28,'lookupCommand':_0x277fa6(0xec)+_0xb38aa5['id']+_0x277fa6(0xdd)}},'message':'Created\x20company\x20knowledge\x20base\x20'+_0xb38aa5['id']+'\x20for\x20'+_0xb38aa5[_0x277fa6(0xf3)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a154_0x52749a=a154_0x32d6;(function(_0x174a29,_0x3fe8fd){const _0x27f814=a154_0x32d6,_0x436fbe=_0x174a29();while(!![]){try{const _0x2e041e=-parseInt(_0x27f814(0x13a))/0x1+-parseInt(_0x27f814(0x134))/0x2+parseInt(_0x27f814(0x144))/0x3+-parseInt(_0x27f814(0x13e))/0x4+-parseInt(_0x27f814(0x152))/0x5+-parseInt(_0x27f814(0x143))/0x6+parseInt(_0x27f814(0x13c))/0x7;if(_0x2e041e===_0x3fe8fd)break;else _0x436fbe['push'](_0x436fbe['shift']());}catch(_0x57ceea){_0x436fbe['push'](_0x436fbe['shift']());}}}(a154_0x4274,0xe0a29));import{knowledgeDocumentsPath}from'../../core/api-client.js';import{deleteEnterpriseKnowledgeBase,isPlatformTransportFailure}from'../../core/api-client.js';function a154_0x4274(){const _0x592296=['appCode','\x20--format\x20compress','2110386OWCska','Company\x20knowledge\x20base\x20','kb_verification_failed','--expected-version\x20must\x20be\x20a\x20positive\x20safe\x20integer.','flag','\x20remains\x20readable\x20after\x20delete.','1819195NqUGhz','Require\x20the\x20current\x20version\x20before\x20atomic\x20compare-and-set','29461726oAXWEr','Inspect\x20it\x20with\x20`rabetbase\x20kb\x20detail\x20--id\x20','1010972diYeTw','no_op','Database\x20soft\x20deletion\x20was\x20verified;\x20asynchronous\x20RAG\x20cleanup\x20was\x20not\x20verified\x20by\x20the\x20CLI.','version','Delete\x20response\x20was\x20unavailable;\x20exact-ID\x20not-found\x20readback\x20verified\x20database\x20soft\x20deletion\x20without\x20resubmitting.','1184520sRQNNk','508230OjjdYT','string','Soft-delete\x20a\x20company\x20knowledge\x20base\x20for\x20the\x20resolved\x20app','snapshotHash','company','isSafeInteger','rabetbase\x20kb\x20detail\x20--id\x20','already_absent','high-risk-write','cookie','kb_expected_version_invalid','expected-version','POST','unshift','667860WMNPAy','delete','kb_delete_outcome_unknown'];a154_0x4274=function(){return _0x592296;};return a154_0x4274();}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_0x52749a(0x140);function readExpectedVersion(_0x1f6bd5){const _0x3ed0bb=a154_0x52749a,_0x25f56c=_0x1f6bd5[_0x3ed0bb(0x138)](_0x3ed0bb(0x14f));if(_0x25f56c===undefined)return undefined;const _0x1e6f91=Number(_0x25f56c);if(!Number[_0x3ed0bb(0x149)](_0x1e6f91)||_0x1e6f91<0x1)throw kbError(_0x3ed0bb(0x14e),_0x3ed0bb(0x137));return _0x1e6f91;}function a154_0x32d6(_0x177333,_0x2c35d3){_0x177333=_0x177333-0x132;const _0x4274a=a154_0x4274();let _0x32d6c9=_0x4274a[_0x177333];return _0x32d6c9;}function noOpData(_0x247546,_0x53e659,_0x545b0c){const _0x18e629=a154_0x52749a;return{'operation':_0x18e629(0x13f),'selector':{'id':_0x53e659,'scope':_0x18e629(0x148),'appCode':_0x247546[_0x18e629(0x132)]},'before':null,'after':null,'dryRun':_0x545b0c,'deleteCalled':![],'backend':{'method':_0x18e629(0x150),'path':knowledgeDocumentsPath(_0x18e629(0x148),_0x18e629(0x153))},'warnings':[],'verification':{'status':_0x18e629(0x14b),'databaseSoftDelete':!![],'ragCleanup':{'asynchronous':!![],'verified':![]}}};}export const kbDelete={'service':'kb','command':'delete','description':a154_0x52749a(0x146),'risk':a154_0x52749a(0x14c),'requiresAppCode':!![],'structuredErrors':!![],'flags':[{'name':'id','type':a154_0x52749a(0x145),'required':!![],'description':'Company\x20knowledge-base\x20id'},{'name':a154_0x52749a(0x14f),'type':'number','required':![],'description':a154_0x52749a(0x13b)}],async 'validate'(_0x4a2ff1){readKbId(_0x4a2ff1),readExpectedVersion(_0x4a2ff1),requireKbExplicitYes(_0x4a2ff1);},async 'dryRun'(_0x164283){const _0x4d980e=a154_0x52749a,_0x34c5b5=readKbId(_0x164283),_0x315b39=readExpectedVersion(_0x164283),_0x429af2=await getKbOrNull(_0x164283,_0x34c5b5);if(!_0x429af2)return asDryRunResult(noOpData(_0x164283,_0x34c5b5,!![]),{'method':_0x4d980e(0x150),'url':knowledgeDocumentsPath(_0x4d980e(0x148),_0x4d980e(0x153))});assertExpectedKbVersion(_0x429af2,_0x315b39);const _0x1dca82=projectKb(_0x429af2),_0x4d38f4=[RAG_WARNING];return asDryRunResult({'operation':_0x4d980e(0x153),'selector':{'id':_0x1dca82['id'],'scope':_0x4d980e(0x148),'appCode':_0x1dca82['appCode']},'before':_0x1dca82,'after':null,'dryRun':!![],'deleteCalled':![],'backend':{'method':_0x4d980e(0x150),'path':knowledgeDocumentsPath(_0x4d980e(0x148),_0x4d980e(0x153)),'body':{'appCode':_0x164283['appCode'],'id':_0x34c5b5,'expectedVersion':_0x429af2[_0x4d980e(0x141)]}},'warnings':_0x4d38f4,'verification':{'expectedVersion':_0x429af2[_0x4d980e(0x141)],'atomicCompareAndSet':!![],'snapshotHash':_0x1dca82[_0x4d980e(0x147)],'databaseSoftDelete':!![],'ragCleanup':{'asynchronous':!![],'verified':![]},'lookupCommand':_0x4d980e(0x14a)+_0x1dca82['id']+'\x20--format\x20compress'}},{'method':_0x4d980e(0x150),'url':knowledgeDocumentsPath(_0x4d980e(0x148),_0x4d980e(0x153))});},async 'execute'(_0x527020){const _0x1ef8b6=a154_0x52749a;requireKbExplicitYes(_0x527020);const _0x2643fe=readKbId(_0x527020),_0x2a7044=readExpectedVersion(_0x527020),_0x3879ac=await getKbOrNull(_0x527020,_0x2643fe);if(!_0x3879ac)return{'ok':!![],'data':noOpData(_0x527020,_0x2643fe,![]),'message':_0x1ef8b6(0x135)+_0x2643fe+'\x20is\x20already\x20absent;\x20no\x20delete\x20request\x20was\x20made'};assertExpectedKbVersion(_0x3879ac,_0x2a7044);const _0x10ddb3=projectKb(_0x3879ac);let _0x1b1445=![];try{await deleteEnterpriseKnowledgeBase(_0x527020[_0x1ef8b6(0x14d)],_0x2643fe,_0x527020[_0x1ef8b6(0x132)],_0x3879ac[_0x1ef8b6(0x141)]);}catch(_0x3115d6){if(!isPlatformTransportFailure(_0x3115d6))throw _0x3115d6;_0x1b1445=!![];}const _0x4def96=await verifyKbMutationReadback('delete',_0x1b1445,()=>getKbOrNull(_0x527020,_0x2643fe));if(_0x4def96)throw kbError(_0x1b1445?_0x1ef8b6(0x154):_0x1ef8b6(0x136),'Company\x20knowledge\x20base\x20'+_0x2643fe+_0x1ef8b6(0x139),_0x1ef8b6(0x13d)+_0x2643fe+'\x20--format\x20compress`;\x20do\x20not\x20resubmit\x20automatically.');const _0x1a9dc2=[RAG_WARNING];return _0x1b1445&&_0x1a9dc2[_0x1ef8b6(0x151)](_0x1ef8b6(0x142)),{'ok':!![],'data':{'operation':'delete','selector':{'id':_0x10ddb3['id'],'scope':_0x1ef8b6(0x148),'appCode':_0x10ddb3['appCode']},'before':_0x10ddb3,'after':null,'dryRun':![],'deleteCalled':!![],'backend':{'method':'POST','path':knowledgeDocumentsPath('company',_0x1ef8b6(0x153))},'warnings':_0x1a9dc2,'verification':{'status':'verified','databaseSoftDelete':!![],'ragCleanup':{'asynchronous':!![],'verified':![]},'recoveredAfterUnknownResponse':_0x1b1445,'lookupCommand':'rabetbase\x20kb\x20detail\x20--id\x20'+_0x10ddb3['id']+_0x1ef8b6(0x133)}},'message':'Soft-deleted\x20company\x20knowledge\x20base\x20'+_0x10ddb3['id']};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a155_0x392177=a155_0x1192;function a155_0x1192(_0xdd1a6c,_0x672e49){_0xdd1a6c=_0xdd1a6c-0x6c;const _0x224a03=a155_0x224a();let _0x1192ef=_0x224a03[_0xdd1a6c];return _0x1192ef;}function a155_0x224a(){const _0x344885=['Show\x20one\x20company\x20knowledge\x20base\x20with\x20full\x20content\x20for\x20the\x20resolved\x20app','string','1022055PLvtgl','91lVdLKA','303BjxkVG','18660OvxYCu','content','read','2246yPQuwV','60360lmltCV','5873112rREHmy','Company\x20knowledge-base\x20id','detail','1023192OzKTJA','126000rvFIni'];a155_0x224a=function(){return _0x344885;};return a155_0x224a();}(function(_0x49be65,_0x525102){const _0x1cafa7=a155_0x1192,_0xa6531b=_0x49be65();while(!![]){try{const _0x53383d=parseInt(_0x1cafa7(0x73))/0x1+parseInt(_0x1cafa7(0x72))/0x2*(parseInt(_0x1cafa7(0x6e))/0x3)+parseInt(_0x1cafa7(0x6f))/0x4+parseInt(_0x1cafa7(0x6c))/0x5+parseInt(_0x1cafa7(0x77))/0x6+parseInt(_0x1cafa7(0x6d))/0x7*(parseInt(_0x1cafa7(0x78))/0x8)+-parseInt(_0x1cafa7(0x74))/0x9;if(_0x53383d===_0x525102)break;else _0xa6531b['push'](_0xa6531b['shift']());}catch(_0x19fe2b){_0xa6531b['push'](_0xa6531b['shift']());}}}(a155_0x224a,0x19c65));import{projectKb,readKbId,requireKb}from'../../commands/kb/shared.js';export const kbDetail={'service':'kb','command':a155_0x392177(0x76),'description':a155_0x392177(0x79),'risk':a155_0x392177(0x71),'requiresAppCode':!![],'structuredErrors':!![],'flags':[{'name':'id','type':a155_0x392177(0x7a),'required':!![],'description':a155_0x392177(0x75)}],async 'validate'(_0x1d240f){readKbId(_0x1d240f);},async 'execute'(_0x1796e4){const _0x445dcd=a155_0x392177,_0x5c85ea=readKbId(_0x1796e4),_0x1d6ae1=await requireKb(_0x1796e4,_0x5c85ea);return{'ok':!![],'data':{'knowledgeBase':{...projectKb(_0x1d6ae1),'content':_0x1d6ae1[_0x445dcd(0x70)]}},'message':'Loaded\x20company\x20knowledge\x20base\x20'+_0x5c85ea};}};
|
package/lib/commands/kb/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a156_0x325e0c=a156_0x7d9c;(function(_0x19f5d4,_0x373685){const _0x37de00=a156_0x7d9c,_0xcc5e1=_0x19f5d4();while(!![]){try{const _0x348a1f=parseInt(_0x37de00(0xb2))/0x1+parseInt(_0x37de00(0xab))/0x2+-parseInt(_0x37de00(0xa8))/0x3+parseInt(_0x37de00(0xb4))/0x4+-parseInt(_0x37de00(0xb0))/0x5*(parseInt(_0x37de00(0xb1))/0x6)+-parseInt(_0x37de00(0xa9))/0x7*(parseInt(_0x37de00(0xb3))/0x8)+-parseInt(_0x37de00(0xad))/0x9;if(_0x348a1f===_0x373685)break;else _0xcc5e1['push'](_0xcc5e1['shift']());}catch(_0x2c5808){_0xcc5e1['push'](_0xcc5e1['shift']());}}}(a156_0x2e5a,0x835ee));function a156_0x7d9c(_0x3e487e,_0x37791b){_0x3e487e=_0x3e487e-0xa7;const _0x2e5a8b=a156_0x2e5a();let _0x7d9c23=_0x2e5a8b[_0x3e487e];return _0x7d9c23;}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';export const kbDefinitions=[kbList,kbDetail,kbSearch,kbCreate,kbUpdate,kbDelete]['map'](_0x3eafcb=>_0x3eafcb[a156_0x325e0c(0xae)]===a156_0x325e0c(0xa7)?_0x3eafcb:{..._0x3eafcb,'execute':_0x3bc3a3=>withKbManagementSession(_0x3bc3a3['signal'],()=>_0x3eafcb[a156_0x325e0c(0xaf)](_0x3bc3a3)),..._0x3eafcb[a156_0x325e0c(0xac)]?{'dryRun':_0x335de1=>withKbManagementSession(_0x335de1[a156_0x325e0c(0xaa)],()=>_0x3eafcb[a156_0x325e0c(0xac)](_0x335de1))}:{}});function a156_0x2e5a(){const _0x32f815=['execute','12415jdbdxz','1008iefBHz','836056PGmRmG','505608ywFJPc','4057972oVORhA','search','1296762PLvcGW','35VOPNGD','signal','2030964UMpOkR','dryRun','10462806xMlUGm','command'];a156_0x2e5a=function(){return _0x32f815;};return a156_0x2e5a();}
|
package/lib/commands/kb/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a157_0x440e94=a157_0x3769;function a157_0x3769(_0x3e4a5a,_0x51ad05){_0x3e4a5a=_0x3e4a5a-0xb2;const _0x1302e0=a157_0x1302();let _0x3769c9=_0x1302e0[_0x3e4a5a];return _0x3769c9;}(function(_0x5526f9,_0x5b1051){const _0x2d4aa0=a157_0x3769,_0x3e2409=_0x5526f9();while(!![]){try{const _0x2af89a=-parseInt(_0x2d4aa0(0xc0))/0x1*(parseInt(_0x2d4aa0(0xc1))/0x2)+parseInt(_0x2d4aa0(0xb5))/0x3+parseInt(_0x2d4aa0(0xbd))/0x4+parseInt(_0x2d4aa0(0xb6))/0x5+parseInt(_0x2d4aa0(0xb3))/0x6+parseInt(_0x2d4aa0(0xb8))/0x7+parseInt(_0x2d4aa0(0xb4))/0x8*(-parseInt(_0x2d4aa0(0xbe))/0x9);if(_0x2af89a===_0x5b1051)break;else _0x3e2409['push'](_0x3e2409['shift']());}catch(_0xa234fb){_0x3e2409['push'](_0x3e2409['shift']());}}}(a157_0x1302,0xe7700));import{fetchAllCompanyKnowledgeBases,projectKb}from'../../commands/kb/shared.js';function a157_0x1302(){const _0x1e3bbe=['4jAmdPT','appCode','7649556hYAwco','8eBVIYJ','2936127qDpYFe','7920640CsRHpq','map','11933138zqjCgY','str','List\x20company\x20knowledge\x20bases\x20for\x20the\x20resolved\x20app','Filter\x20by\x20knowledge-base\x20title','read','364112BxYEnd','34060239mBoBah','length','450543JeXFsq'];a157_0x1302=function(){return _0x1e3bbe;};return a157_0x1302();}export const kbList={'service':'kb','command':'list','description':a157_0x440e94(0xba),'risk':a157_0x440e94(0xbc),'requiresAppCode':!![],'structuredErrors':!![],'flags':[{'name':'title','type':'string','required':![],'description':a157_0x440e94(0xbb)}],async 'execute'(_0x2f35fd){const _0x4a6e35=a157_0x440e94,_0x5b3e1a=_0x2f35fd[_0x4a6e35(0xb9)]('title')['trim'](),_0x1105f7=await fetchAllCompanyKnowledgeBases(_0x2f35fd,{..._0x5b3e1a?{'title':_0x5b3e1a}:{}}),_0x11fd9f=_0x1105f7[_0x4a6e35(0xb7)](projectKb);return{'ok':!![],'data':{'total':_0x11fd9f[_0x4a6e35(0xbf)],'knowledgeBases':_0x11fd9f},'message':'Found\x20'+_0x11fd9f[_0x4a6e35(0xbf)]+'\x20company\x20knowledge\x20base(s)\x20for\x20'+_0x2f35fd[_0x4a6e35(0xb2)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a158_0x298281=a158_0xb3c9;(function(_0x2badf1,_0x59de4c){const _0x10894a=a158_0xb3c9,_0x3d7673=_0x2badf1();while(!![]){try{const _0x1647df=parseInt(_0x10894a(0x1fb))/0x1+parseInt(_0x10894a(0x20c))/0x2+parseInt(_0x10894a(0x1f4))/0x3+-parseInt(_0x10894a(0x1f8))/0x4+-parseInt(_0x10894a(0x208))/0x5*(parseInt(_0x10894a(0x1fc))/0x6)+-parseInt(_0x10894a(0x206))/0x7+-parseInt(_0x10894a(0x1fe))/0x8;if(_0x1647df===_0x59de4c)break;else _0x3d7673['push'](_0x3d7673['shift']());}catch(_0x7766d6){_0x3d7673['push'](_0x3d7673['shift']());}}}(a158_0x5864,0x40a46));import{searchDirectKnowledge,normalizeKbServiceOrigin}from'../../core/kb-search-client.js';import{CliErrors}from'../../errors.js';import{getKbServiceDomain}from'../../constant/domain.js';function readSearchQuery(_0x261042){const _0xaf3f25=a158_0xb3c9,_0x580060=_0x261042[_0xaf3f25(0x1f2)](_0xaf3f25(0x1f9))[_0xaf3f25(0x1fd)]();if(!_0x580060)throw CliErrors[_0xaf3f25(0x1f6)](_0xaf3f25(0x1ff));return _0x580060;}function a158_0x5864(){const _0x6de7a1=['str','appCode','678621ssZbJS','Company\x20and\x20public\x20knowledge\x20search\x20query','validation','signal','705644UoJoPW','query','cookie','506902KDRSAP','126gpzJRK','trim','2891136vPffCs','Search\x20query\x20is\x20required.','topk','Optional\x20trusted\x20KB\x20Service\x20HTTPS\x20origin\x20for\x20this\x20request\x20only','total','string','flag','search','276003fXXZWc','read','75085jlHySQ','Search\x20company\x20and\x20public\x20knowledge\x20for\x20the\x20resolved\x20app','kb-service-url','num','848508eRzgPH','\x20company/public\x20knowledge\x20hit(s)\x20for\x20','KB\x20Service\x20is\x20not\x20configured\x20for\x20knowledge\x20search.','Configure\x20kbServiceDomain\x20in\x20the\x20connection\x20settings,\x20or\x20pass\x20--kb-service-url\x20<https-origin>\x20for\x20this\x20request.','isSafeInteger'];a158_0x5864=function(){return _0x6de7a1;};return a158_0x5864();}function readSearchTopK(_0x4f07ab){const _0x31e1e4=a158_0xb3c9,_0x311e36=_0x4f07ab[_0x31e1e4(0x204)](_0x31e1e4(0x200));if(_0x311e36===undefined||_0x311e36===null||_0x311e36==='')return undefined;const _0xf43e0f=_0x4f07ab[_0x31e1e4(0x20b)](_0x31e1e4(0x200));if(!Number[_0x31e1e4(0x1f1)](_0xf43e0f)||_0xf43e0f<0x1||_0xf43e0f>0x32)throw CliErrors[_0x31e1e4(0x1f6)]('--topk\x20must\x20be\x20an\x20integer\x20from\x201\x20through\x2050.');return _0xf43e0f;}function a158_0xb3c9(_0x5172aa,_0x49ba14){_0x5172aa=_0x5172aa-0x1f0;const _0x5864a5=a158_0x5864();let _0xb3c9b6=_0x5864a5[_0x5172aa];return _0xb3c9b6;}function readSearchServiceUrl(_0x452242){const _0x4b5531=a158_0xb3c9;if(_0x452242[_0x4b5531(0x204)](_0x4b5531(0x20a))!==undefined)return normalizeKbServiceOrigin(_0x452242[_0x4b5531(0x1f2)](_0x4b5531(0x20a)));const _0x44a901=getKbServiceDomain();if(!_0x44a901)throw CliErrors[_0x4b5531(0x1f6)](_0x4b5531(0x20e),_0x4b5531(0x1f0));return normalizeKbServiceOrigin(_0x44a901);}export const kbSearch={'service':'kb','command':a158_0x298281(0x205),'description':a158_0x298281(0x209),'risk':a158_0x298281(0x207),'requiresAppCode':!![],'structuredErrors':!![],'strictFlags':!![],'flags':[{'name':a158_0x298281(0x1f9),'type':a158_0x298281(0x203),'required':!![],'description':a158_0x298281(0x1f5)},{'name':a158_0x298281(0x200),'type':'number','required':![],'description':'Maximum\x20number\x20of\x20knowledge\x20hits\x20to\x20return'},{'name':'kb-service-url','type':a158_0x298281(0x203),'required':![],'description':a158_0x298281(0x201)}],async 'validate'(_0x5552f6){readSearchQuery(_0x5552f6),readSearchTopK(_0x5552f6),readSearchServiceUrl(_0x5552f6);},async 'execute'(_0xc0f6f9){const _0x2344bf=a158_0x298281,_0x10f2a7=readSearchQuery(_0xc0f6f9),_0x24ecf2=readSearchTopK(_0xc0f6f9),_0x50c069=readSearchServiceUrl(_0xc0f6f9),_0x3f6bd5={'cookie':_0xc0f6f9[_0x2344bf(0x1fa)],'query':_0x10f2a7,'appCode':_0xc0f6f9[_0x2344bf(0x1f3)],..._0x24ecf2!==undefined?{'topK':_0x24ecf2}:{},'signal':_0xc0f6f9[_0x2344bf(0x1f7)]},_0x5b55a1=await searchDirectKnowledge({..._0x3f6bd5,'serviceUrl':_0x50c069});return{'ok':!![],'data':_0x5b55a1,'message':'Found\x20'+_0x5b55a1[_0x2344bf(0x202)]+_0x2344bf(0x20d)+_0xc0f6f9[_0x2344bf(0x1f3)]};}};
|
|
@@ -1 +1 @@
|
|
|
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
|
+
const a159_0x23de21=a159_0x1075;(function(_0x27c577,_0x3d95b1){const _0x7ae07e=a159_0x1075,_0x938ccf=_0x27c577();while(!![]){try{const _0x216d45=parseInt(_0x7ae07e(0x82))/0x1*(-parseInt(_0x7ae07e(0x7a))/0x2)+parseInt(_0x7ae07e(0xa7))/0x3+parseInt(_0x7ae07e(0x71))/0x4*(parseInt(_0x7ae07e(0x6d))/0x5)+-parseInt(_0x7ae07e(0xa1))/0x6*(-parseInt(_0x7ae07e(0xc4))/0x7)+-parseInt(_0x7ae07e(0xb7))/0x8*(parseInt(_0x7ae07e(0x93))/0x9)+parseInt(_0x7ae07e(0xc0))/0xa*(-parseInt(_0x7ae07e(0xbe))/0xb)+parseInt(_0x7ae07e(0xc9))/0xc;if(_0x216d45===_0x3d95b1)break;else _0x938ccf['push'](_0x938ccf['shift']());}catch(_0x3ab117){_0x938ccf['push'](_0x938ccf['shift']());}}}(a159_0x56ed,0x8bf40));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';function a159_0x1075(_0x69791a,_0x37bc56){_0x69791a=_0x69791a-0x6c;const _0x56ed24=a159_0x56ed();let _0x1075ad=_0x56ed24[_0x69791a];return _0x1075ad;}import{CliError}from'../../errors.js';const LIST_PAGE_SIZE=0x32,DATA_NOT_EXIST_ERROR_CODE=a159_0x23de21(0xd1);export function kbError(_0x1f0c77,_0x1e537a,_0x4c53c0){return new CliError(_0x1f0c77,0x1,_0x1e537a,_0x4c53c0);}export function readKbId(_0x42fe0f){const _0x40b7e0=a159_0x23de21,_0x5460fd=_0x42fe0f[_0x40b7e0(0xd0)]('id');if(!/^0*[1-9][0-9]*$/['test'](_0x5460fd))throw kbError('kb_id_invalid',_0x40b7e0(0xc3));return _0x5460fd;}export function requireKbExplicitYes(_0x35bb89){const _0x1b7dfa=a159_0x23de21;if(_0x35bb89[_0x1b7dfa(0x70)](_0x1b7dfa(0x7e))||_0x35bb89[_0x1b7dfa(0x70)](_0x1b7dfa(0xc5)))return;throw kbError(_0x1b7dfa(0xa8),_0x1b7dfa(0x8c),_0x1b7dfa(0x9b));}function sha256(_0x1c4cc8){const _0x1d3975=a159_0x23de21;return _0x1d3975(0x77)+createHash(_0x1d3975(0x95))[_0x1d3975(0x87)](_0x1c4cc8)['digest'](_0x1d3975(0xbb));}export function inspectKbContent(_0x28bca9){const _0x253a6c=a159_0x23de21,_0x2edd80=Buffer[_0x253a6c(0x84)](_0x28bca9,'utf8');return{'content':_0x28bca9,'byteSize':_0x2edd80[_0x253a6c(0xcd)],'contentHash':sha256(_0x2edd80)};}export async function readKbFile(_0xc02520){const _0x464c78=a159_0x23de21,_0x473050=_0xc02520[_0x464c78(0xbf)]();if(!_0x473050)throw kbError(_0x464c78(0xcc),'Knowledge-base\x20content\x20file\x20path\x20is\x20required.',_0x464c78(0xaf));const _0x58b7bc=resolve(_0x473050);let _0x25ad11;try{_0x25ad11=await stat(_0x58b7bc);}catch(_0x2c37f0){throw kbError('kb_file_unreadable',_0x464c78(0xac)+_0x473050,_0x2c37f0 instanceof Error?_0x2c37f0[_0x464c78(0x9f)]:String(_0x2c37f0));}if(!_0x25ad11[_0x464c78(0xb4)]())throw kbError('kb_file_invalid','Knowledge-base\x20content\x20path\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x473050);let _0x1e83f0;try{_0x1e83f0=await readFile(_0x58b7bc);}catch(_0x4cf6d3){throw kbError('kb_file_unreadable',_0x464c78(0xb2)+_0x473050,_0x4cf6d3 instanceof Error?_0x4cf6d3['message']:String(_0x4cf6d3));}let _0x398f5c;try{_0x398f5c=new TextDecoder(_0x464c78(0x7f),{'fatal':!![],'ignoreBOM':!![]})[_0x464c78(0xbc)](_0x1e83f0);}catch{throw kbError(_0x464c78(0x8f),_0x464c78(0xaa)+_0x473050);}if(!_0x398f5c['trim']())throw kbError(_0x464c78(0x8f),_0x464c78(0xcb)+_0x473050);return inspectKbContent(_0x398f5c);}export async function verifyKbMutationReadback(_0x2dfd27,_0x31539a,_0x20243d){const _0x54faf6=a159_0x23de21;try{return await _0x20243d();}catch(_0x11e16e){const _0x57b838=kbError(_0x54faf6(0xa4)+_0x2dfd27+'_'+(_0x31539a?_0x54faf6(0xa6):_0x54faf6(0xce)),_0x54faf6(0x74)+_0x2dfd27+_0x54faf6(0x76),'Do\x20not\x20resubmit\x20automatically.\x20Resolve\x20the\x20app\x20again\x20and\x20inspect\x20the\x20target\x20state\x20manually.');Object[_0x54faf6(0x89)](_0x57b838,_0x54faf6(0xcf),{'value':_0x11e16e,'enumerable':![]});throw _0x57b838;}}function a159_0x56ed(){const _0x52a6d1=['This\x20company\x20knowledge-base\x20mutation\x20requires\x20explicit\x20--yes.','currentPage','Run\x20the\x20command\x20with\x20--dry-run\x20again\x20and\x20review\x20the\x20latest\x20version\x20before\x20retrying.','kb_content_invalid','contentHash','kb_response_invalid','items','117goNrqG','paging','sha256','Retry\x20the\x20read\x20after\x20concurrent\x20updates\x20have\x20settled.','title','allowEmpty','filter','Knowledge\x20base\x20','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.','Knowledge-base\x20response\x20contains\x20an\x20invalid\x20id.','content','floor','message','\x20was\x20requested.','729720tGkaPL','indexedVersion','stringify','kb_','clear','outcome_unknown','1375548QZVcqH','kb_confirmation_required','Knowledge-base\x20list\x20returned\x20an\x20invalid\x20or\x20repeated\x20id:\x20','Knowledge-base\x20content\x20file\x20is\x20not\x20valid\x20UTF-8:\x20','number','Cannot\x20access\x20knowledge-base\x20content\x20file:\x20','updateTime','Knowledge-base\x20list\x20returned\x20an\x20inconsistent\x20page\x20size\x20or\x20record\x20count.','Pass\x20--file\x20<knowledge.md>.','totalCount','kb_not_found','Cannot\x20read\x20knowledge-base\x20content\x20file:\x20','\x20while\x20id\x20','isFile','cookie','push','452800NHGYyd','company','test','indexStatus','hex','decode','scope','1076713OIQRDW','trim','80GMCdsh','kb_scope_mismatch','\x20version\x20changed:\x20expected\x20','--id\x20must\x20be\x20a\x20positive\x20decimal\x20integer\x20string.','14ZmwrPo','yes','\x20response\x20contains\x20an\x20invalid\x20version.','has','byteSize','16307256MRomBD','\x20while\x20page\x20','Knowledge-base\x20content\x20file\x20is\x20blank:\x20','kb_file_required','byteLength','verification_unavailable','cause','str','306',',\x20current\x20','125MEzTvo','add','Run\x20`rabetbase\x20kb\x20list\x20--format\x20compress`\x20to\x20inspect\x20the\x20resolved\x20app.','bool','67100bGGPtR','\x20during\x20paging.','length','The\x20','Knowledge-base\x20get-one\x20returned\x20id\x20','\x20request\x20was\x20sent,\x20but\x20its\x20final\x20company\x20knowledge-base\x20state\x20could\x20not\x20be\x20verified.','sha256:','\x20to\x20','sourceVersion','775914lXhhTI','pageTooLarge','\x20is\x20not\x20company-scoped.','max','dry-run','utf-8','appCode','kb_list_contract_invalid','1hLcMEs','Company\x20knowledge\x20base\x20not\x20found:\x20','from','version','isSafeInteger','update','string','defineProperty','Knowledge-base\x20list\x20returned\x20page\x20','\x20does\x20not\x20belong\x20to\x20company\x20scope\x20for\x20app\x20'];a159_0x56ed=function(){return _0x52a6d1;};return a159_0x56ed();}function requireRecordText(_0x19c65e,_0x35da82,_0x4da96c,_0x82737e={}){const _0x1d07e3=a159_0x23de21;if(typeof _0x19c65e===_0x1d07e3(0x88)&&(_0x82737e[_0x1d07e3(0x98)]||_0x19c65e[_0x1d07e3(0xbf)]()))return _0x19c65e;throw kbError(_0x1d07e3(0x91),_0x1d07e3(0x9a)+String(_0x4da96c)+'\x20response\x20is\x20missing\x20'+_0x35da82+'.');}export function projectKb(_0x483f9c){const _0x50d779=a159_0x23de21;if(typeof _0x483f9c['id']!=='string'||!/^0*[1-9][0-9]*$/[_0x50d779(0xb9)](_0x483f9c['id']))throw kbError(_0x50d779(0x91),_0x50d779(0x9c));if(!Number[_0x50d779(0x86)](_0x483f9c[_0x50d779(0x85)])||_0x483f9c[_0x50d779(0x85)]<0x1)throw kbError(_0x50d779(0x91),_0x50d779(0x9a)+_0x483f9c['id']+_0x50d779(0xc6));if(_0x483f9c[_0x50d779(0xbd)]!==_0x50d779(0xb8))throw kbError('kb_scope_mismatch',_0x50d779(0x9a)+_0x483f9c['id']+_0x50d779(0x7c));const _0x1d480e=requireRecordText(_0x483f9c[_0x50d779(0x80)],'appCode',_0x483f9c['id']),_0x5df6b6=requireRecordText(_0x483f9c[_0x50d779(0x97)],_0x50d779(0x97),_0x483f9c['id']),_0x405da5=inspectKbContent(requireRecordText(_0x483f9c[_0x50d779(0x9d)],_0x50d779(0x9d),_0x483f9c['id'],{'allowEmpty':!![]})),_0x4a8c05=typeof _0x483f9c['createTime']===_0x50d779(0x88)||typeof _0x483f9c['createTime']===_0x50d779(0xab)?_0x483f9c['createTime']:undefined,_0x1c266b=typeof _0x483f9c['updateTime']===_0x50d779(0x88)||typeof _0x483f9c[_0x50d779(0xad)]===_0x50d779(0xab)?_0x483f9c[_0x50d779(0xad)]:undefined,_0x42ceb6=sha256(JSON[_0x50d779(0xa3)]({'id':_0x483f9c['id'],'scope':_0x483f9c[_0x50d779(0xbd)],'appCode':_0x1d480e,'title':_0x5df6b6,'version':_0x483f9c[_0x50d779(0x85)],'contentHash':_0x405da5['contentHash'],'createTime':_0x4a8c05,'updateTime':_0x1c266b}));return{'id':_0x483f9c['id'],'scope':_0x50d779(0xb8),'appCode':_0x1d480e,'title':_0x5df6b6,'version':_0x483f9c[_0x50d779(0x85)],..._0x483f9c[_0x50d779(0x79)]!==undefined?{'sourceVersion':_0x483f9c[_0x50d779(0x79)]}:{},..._0x483f9c['indexStatus']!==undefined?{'indexStatus':_0x483f9c[_0x50d779(0xba)],'indexedVersion':_0x483f9c[_0x50d779(0xa2)]}:{},'contentByteSize':_0x405da5[_0x50d779(0xc8)],'contentHash':_0x405da5[_0x50d779(0x90)],'snapshotHash':_0x42ceb6,..._0x4a8c05!==undefined?{'createTime':_0x4a8c05}:{},..._0x1c266b!==undefined?{'updateTime':_0x1c266b}:{}};}export function assertCompanyKnowledgeBase(_0x34f53c,_0x504ec8,_0x4b3bdc){const _0x14651a=a159_0x23de21;if(_0x4b3bdc!==undefined&&_0x34f53c['id']!==_0x4b3bdc)throw kbError(_0x14651a(0x91),_0x14651a(0x75)+_0x34f53c['id']+_0x14651a(0xb3)+_0x4b3bdc+_0x14651a(0xa0));if(_0x34f53c['scope']!==_0x14651a(0xb8)||_0x34f53c[_0x14651a(0x80)]!==_0x504ec8)throw kbError(_0x14651a(0xc1),'Knowledge\x20base\x20'+_0x34f53c['id']+_0x14651a(0x8b)+_0x504ec8+'.');}export async function fetchAllCompanyKnowledgeBases(_0xb81e89,_0x46d1d4){const _0x5543ee=a159_0x23de21;let _0x39de1a=LIST_PAGE_SIZE;const _0x407936=[],_0x382b7d=new Set();let _0x4315c3=0x1,_0x7ab302=0x0,_0x140774;while(!![]){let _0x364bae;try{_0x364bae=await listEnterpriseKnowledgeBases(_0xb81e89[_0x5543ee(0xb5)],{'currentPage':_0x4315c3,'pageSize':_0x39de1a,'appCode':_0xb81e89[_0x5543ee(0x80)],..._0x46d1d4});}catch(_0x49d0b6){if(!(_0x49d0b6 instanceof KbManagementError)||!_0x49d0b6[_0x5543ee(0x7b)]||_0x39de1a===0x1)throw _0x49d0b6;_0x39de1a=Math[_0x5543ee(0x7d)](0x1,Math[_0x5543ee(0x9e)](_0x39de1a/0x2)),_0x4315c3=0x1,_0x7ab302=0x0,_0x407936[_0x5543ee(0x73)]=0x0,_0x382b7d[_0x5543ee(0xa5)]();continue;}const _0xb2798d=_0x364bae[_0x5543ee(0x94)]?.[_0x5543ee(0xb0)];if(!_0x364bae[_0x5543ee(0x94)]||_0x364bae[_0x5543ee(0x94)]['pageSize']!==_0x39de1a||!Number[_0x5543ee(0x86)](_0xb2798d)||_0xb2798d<0x0||_0x364bae['items'][_0x5543ee(0x73)]!==Math['min'](_0x39de1a,Math['max'](0x0,_0xb2798d-(_0x4315c3-0x1)*_0x39de1a)))throw kbError('kb_list_contract_invalid',_0x5543ee(0xae));if(_0x364bae[_0x5543ee(0x94)][_0x5543ee(0x8d)]!==_0x4315c3)throw kbError(_0x5543ee(0x81),_0x5543ee(0x8a)+_0x364bae[_0x5543ee(0x94)][_0x5543ee(0x8d)]+_0x5543ee(0xca)+_0x4315c3+_0x5543ee(0xa0));if(_0xb2798d!==undefined){if(_0x140774!==undefined&&_0xb2798d!==_0x140774)throw kbError(_0x5543ee(0x81),'Knowledge-base\x20list\x20total\x20changed\x20from\x20'+_0x140774+_0x5543ee(0x78)+_0xb2798d+_0x5543ee(0x72),_0x5543ee(0x96));_0x140774=_0xb2798d;}for(const _0x9700bf of _0x364bae['items']){if(typeof _0x9700bf['id']!==_0x5543ee(0x88)||!/^0*[1-9][0-9]*$/[_0x5543ee(0xb9)](_0x9700bf['id'])||_0x382b7d[_0x5543ee(0xc7)](_0x9700bf['id']))throw kbError(_0x5543ee(0x81),_0x5543ee(0xa9)+String(_0x9700bf['id'])+'.');_0x382b7d[_0x5543ee(0x6e)](_0x9700bf['id']),_0x9700bf[_0x5543ee(0xbd)]===_0x5543ee(0xb8)&&_0x9700bf[_0x5543ee(0x80)]===_0xb81e89['appCode']&&_0x407936[_0x5543ee(0xb6)](_0x9700bf);}_0x7ab302+=_0x364bae['items'][_0x5543ee(0x73)];if(_0xb2798d!==undefined&&_0x7ab302>=_0xb2798d)break;if(_0x364bae[_0x5543ee(0x92)][_0x5543ee(0x73)]<_0x39de1a){if(_0xb2798d!==undefined&&_0x7ab302<_0xb2798d)throw kbError(_0x5543ee(0x81),'Knowledge-base\x20list\x20stopped\x20at\x20'+_0x7ab302+'\x20of\x20'+_0xb2798d+'\x20records.');break;}_0x4315c3+=0x1;}return _0x407936;}export function findExactCompanyKnowledgeBases(_0xb9ea86,_0x16fa28,_0x34e95b){const _0x5093a1=a159_0x23de21;return _0xb9ea86[_0x5093a1(0x99)](_0xc69659=>_0xc69659[_0x5093a1(0xbd)]===_0x5093a1(0xb8)&&_0xc69659[_0x5093a1(0x80)]===_0x16fa28&&_0xc69659['title']===_0x34e95b);}export async function getKbOrNull(_0x3edc70,_0x1c0f84){const _0x5c34d=a159_0x23de21;try{const _0xc0f958=await getEnterpriseKnowledgeBase(_0x3edc70['cookie'],_0x1c0f84,_0x3edc70['appCode']);return assertCompanyKnowledgeBase(_0xc0f958,_0x3edc70[_0x5c34d(0x80)],_0x1c0f84),_0xc0f958;}catch(_0xfa31ea){if(getPlatformErrorCode(_0xfa31ea)===DATA_NOT_EXIST_ERROR_CODE&&getPlatformHttpStatus(_0xfa31ea)===0x194)return null;throw _0xfa31ea;}}export async function requireKb(_0x235c31,_0x401b6e){const _0x2465ab=a159_0x23de21,_0x3fd888=await getKbOrNull(_0x235c31,_0x401b6e);if(!_0x3fd888)throw kbError(_0x2465ab(0xb1),_0x2465ab(0x83)+_0x401b6e,_0x2465ab(0x6f));return _0x3fd888;}export function assertExpectedKbVersion(_0x454a3e,_0x2b12cd){const _0x30c8c3=a159_0x23de21;if(_0x2b12cd===undefined||_0x454a3e[_0x30c8c3(0x85)]===_0x2b12cd)return;throw kbError('kb_state_drift',_0x30c8c3(0x9a)+_0x454a3e['id']+_0x30c8c3(0xc2)+_0x2b12cd+_0x30c8c3(0x6c)+_0x454a3e[_0x30c8c3(0x85)]+'.',_0x30c8c3(0x8e));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a160_0x8eff5c=a160_0x450b;function a160_0x450b(_0x5cecca,_0x398adc){_0x5cecca=_0x5cecca-0x1b8;const _0x422ae9=a160_0x422a();let _0x450b78=_0x422ae9[_0x5cecca];return _0x450b78;}(function(_0x210bd3,_0x25121b){const _0x32323a=a160_0x450b,_0x5abf06=_0x210bd3();while(!![]){try{const _0x422d09=-parseInt(_0x32323a(0x1b9))/0x1*(-parseInt(_0x32323a(0x1c8))/0x2)+-parseInt(_0x32323a(0x1ca))/0x3+-parseInt(_0x32323a(0x1c2))/0x4+parseInt(_0x32323a(0x1d5))/0x5*(-parseInt(_0x32323a(0x1c0))/0x6)+-parseInt(_0x32323a(0x1cf))/0x7+-parseInt(_0x32323a(0x1c1))/0x8*(-parseInt(_0x32323a(0x1da))/0x9)+parseInt(_0x32323a(0x1d6))/0xa*(parseInt(_0x32323a(0x1b8))/0xb);if(_0x422d09===_0x25121b)break;else _0x5abf06['push'](_0x5abf06['shift']());}catch(_0x187cd5){_0x5abf06['push'](_0x5abf06['shift']());}}}(a160_0x422a,0xb3ee3));import{knowledgeDocumentsPath}from'../../core/api-client.js';import{isPlatformTransportFailure,updateEnterpriseKnowledgeBase}from'../../core/api-client.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCompanyKnowledgeBase,assertExpectedKbVersion,kbError,projectKb,readKbFile,readKbId,requireKb,verifyKbMutationReadback}from'../../commands/kb/shared.js';function readUpdatePatch(_0x4f2cb0){const _0x3e5e92=a160_0x450b,_0x10b51c=readKbId(_0x4f2cb0),_0x79a48f=_0x4f2cb0[_0x3e5e92(0x1e3)](_0x3e5e92(0x1ea)),_0x166bf4=_0x4f2cb0[_0x3e5e92(0x1e3)](_0x3e5e92(0x1df)),_0x5e99a5=_0x4f2cb0[_0x3e5e92(0x1e3)](_0x3e5e92(0x1d2)),_0x58f6d8=_0x79a48f===undefined?undefined:String(_0x79a48f)['trim']();if(_0x79a48f!==undefined&&!_0x58f6d8)throw kbError('kb_title_invalid','--title\x20cannot\x20be\x20empty.');const _0x5c66bb=_0x166bf4===undefined?undefined:String(_0x166bf4)[_0x3e5e92(0x1d9)]();if(_0x166bf4!==undefined&&!_0x5c66bb)throw kbError(_0x3e5e92(0x1d4),_0x3e5e92(0x1bf));if(_0x58f6d8===undefined&&_0x5c66bb===undefined)throw kbError(_0x3e5e92(0x1e6),'Nothing\x20to\x20update.',_0x3e5e92(0x1ba));let _0x474ea1;if(_0x5e99a5!==undefined){_0x474ea1=Number(_0x5e99a5);if(!Number[_0x3e5e92(0x1e7)](_0x474ea1)||_0x474ea1<0x1)throw kbError(_0x3e5e92(0x1bd),_0x3e5e92(0x1be));}return{'id':_0x10b51c,'title':_0x58f6d8,'file':_0x5c66bb,'expectedVersion':_0x474ea1};}async function prepareUpdate(_0x35320c){const _0x423812=a160_0x450b,_0x2732d5=readUpdatePatch(_0x35320c),_0x2f2435=await requireKb(_0x35320c,_0x2732d5['id']);assertExpectedKbVersion(_0x2f2435,_0x2732d5[_0x423812(0x1e2)]);const _0x10f88d=_0x2732d5['file']?await readKbFile(_0x2732d5[_0x423812(0x1df)]):undefined,_0x28c00c=projectKb(_0x2f2435),_0x43f306=projectKb({..._0x2f2435,..._0x2732d5[_0x423812(0x1ea)]!==undefined?{'title':_0x2732d5[_0x423812(0x1ea)]}:{},..._0x10f88d?{'content':_0x10f88d[_0x423812(0x1e8)]}:{}});return{'patch':_0x2732d5,'beforeRecord':_0x2f2435,'before':_0x28c00c,'planned':_0x43f306,'replacement':_0x10f88d};}function a160_0x422a(){const _0x7d50f6=['Updated\x20company\x20knowledge\x20base\x20','byteSize','Use\x20read-only\x20detail\x20reconciliation;\x20do\x20not\x20resubmit\x20automatically.','company','2mRDBkr','Require\x20the\x20current\x20version\x20before\x20atomic\x20compare-and-set','3470949YbLoSd','update','Company\x20knowledge\x20base\x20','kb_verification_failed','verified','5510211lhlVuA','appCode','Replacement\x20UTF-8\x20text\x20or\x20Markdown\x20content\x20file','expected-version','Update\x20response\x20was\x20unavailable;\x20verified\x20applicable\x20postconditions\x20by\x20exact\x20ID\x20without\x20resubmitting.','kb_file_required','309090sRfdni','10VMRqLr','POST','\x20--format\x20compress`;\x20do\x20not\x20resubmit\x20automatically.','trim','531oAlwBA','kb_update_outcome_unknown','\x20--format\x20compress','write','before','file','planned','patch','expectedVersion','flag','string','The\x20received\x20update\x20state\x20contradicts\x20the\x20requested\x20changes.','kb_update_empty','isSafeInteger','content','push','title','cookie','Update\x20a\x20company\x20knowledge\x20base\x20with\x20preflight\x20drift\x20protection','replacement','beforeRecord','34885741ZQRQHX','721986etdgRn','Pass\x20at\x20least\x20one\x20of\x20--title\x20or\x20--file.','Company\x20knowledge-base\x20id','number','kb_expected_version_invalid','--expected-version\x20must\x20be\x20a\x20positive\x20safe\x20integer.','--file\x20cannot\x20be\x20empty.','114VZtINM','48440NHahvy','1579876eneErt','version'];a160_0x422a=function(){return _0x7d50f6;};return a160_0x422a();}export const kbUpdate={'service':'kb','command':a160_0x8eff5c(0x1cb),'description':a160_0x8eff5c(0x1ec),'risk':a160_0x8eff5c(0x1dd),'requiresAppCode':!![],'structuredErrors':!![],'flags':[{'name':'id','type':'string','required':!![],'description':a160_0x8eff5c(0x1bb)},{'name':a160_0x8eff5c(0x1ea),'type':'string','required':![],'description':'New\x20knowledge-base\x20title'},{'name':'file','type':a160_0x8eff5c(0x1e4),'required':![],'description':a160_0x8eff5c(0x1d1)},{'name':a160_0x8eff5c(0x1d2),'type':a160_0x8eff5c(0x1bc),'required':![],'description':a160_0x8eff5c(0x1c9)}],async 'validate'(_0x4bba46){readUpdatePatch(_0x4bba46);},async 'dryRun'(_0x13a267){const _0x4ff4c2=a160_0x8eff5c,_0x3b4536=await prepareUpdate(_0x13a267),_0x1f1f04=[];return asDryRunResult({'operation':_0x4ff4c2(0x1cb),'selector':{'id':_0x3b4536[_0x4ff4c2(0x1de)]['id'],'scope':_0x4ff4c2(0x1c7),'appCode':_0x3b4536[_0x4ff4c2(0x1de)]['appCode']},'before':_0x3b4536['before'],'after':_0x3b4536[_0x4ff4c2(0x1e0)],'dryRun':!![],'backend':{'method':_0x4ff4c2(0x1d7),'path':knowledgeDocumentsPath(_0x4ff4c2(0x1c7),_0x4ff4c2(0x1cb)),'body':{'appCode':_0x13a267['appCode'],'id':_0x3b4536[_0x4ff4c2(0x1e1)]['id'],'expectedVersion':_0x3b4536[_0x4ff4c2(0x1ee)][_0x4ff4c2(0x1c3)],..._0x3b4536[_0x4ff4c2(0x1e1)][_0x4ff4c2(0x1ea)]!==undefined?{'title':_0x3b4536[_0x4ff4c2(0x1e1)]['title']}:{},..._0x3b4536['replacement']?{'contentHash':_0x3b4536[_0x4ff4c2(0x1ed)]['contentHash'],'contentByteSize':_0x3b4536[_0x4ff4c2(0x1ed)][_0x4ff4c2(0x1c5)]}:{}}},'warnings':_0x1f1f04,'verification':{'expectedVersion':_0x3b4536['beforeRecord'][_0x4ff4c2(0x1c3)],'atomicCompareAndSet':!![],'plannedSnapshotHash':_0x3b4536[_0x4ff4c2(0x1de)]['snapshotHash'],'lookupCommand':'rabetbase\x20kb\x20detail\x20--id\x20'+_0x3b4536[_0x4ff4c2(0x1de)]['id']+_0x4ff4c2(0x1dc)}},{'method':_0x4ff4c2(0x1d7),'url':knowledgeDocumentsPath('company',_0x4ff4c2(0x1cb))});},async 'execute'(_0x3d0b98){const _0x6beee8=a160_0x8eff5c,_0x21ce4f=await prepareUpdate(_0x3d0b98),_0x547ed9={'id':_0x21ce4f[_0x6beee8(0x1e1)]['id'],'appCode':_0x3d0b98[_0x6beee8(0x1d0)],'expectedVersion':_0x21ce4f[_0x6beee8(0x1ee)][_0x6beee8(0x1c3)],..._0x21ce4f[_0x6beee8(0x1e1)][_0x6beee8(0x1ea)]!==undefined?{'title':_0x21ce4f[_0x6beee8(0x1e1)][_0x6beee8(0x1ea)]}:{},..._0x21ce4f[_0x6beee8(0x1ed)]?{'content':_0x21ce4f[_0x6beee8(0x1ed)][_0x6beee8(0x1e8)]}:{}},_0x5de3d5=_0x21ce4f[_0x6beee8(0x1e1)][_0x6beee8(0x1ea)]??_0x21ce4f[_0x6beee8(0x1ee)]['title'],_0x398e98=_0x21ce4f[_0x6beee8(0x1ed)]?.[_0x6beee8(0x1e8)]??_0x21ce4f[_0x6beee8(0x1ee)][_0x6beee8(0x1e8)],_0x285c3c=_0x5de3d5!==_0x21ce4f[_0x6beee8(0x1ee)][_0x6beee8(0x1ea)]||_0x398e98!==_0x21ce4f[_0x6beee8(0x1ee)][_0x6beee8(0x1e8)],_0x514d8b=_0x21ce4f[_0x6beee8(0x1ee)][_0x6beee8(0x1c3)]+(_0x285c3c?0x1:0x0);let _0x3c81a4,_0xa3749f=![];try{_0x3c81a4=await updateEnterpriseKnowledgeBase(_0x3d0b98[_0x6beee8(0x1eb)],_0x547ed9),assertCompanyKnowledgeBase(_0x3c81a4,_0x3d0b98[_0x6beee8(0x1d0)],_0x21ce4f[_0x6beee8(0x1e1)]['id']);if(_0x3c81a4[_0x6beee8(0x1ea)]!==_0x5de3d5||_0x3c81a4[_0x6beee8(0x1e8)]!==_0x398e98||_0x3c81a4[_0x6beee8(0x1c3)]!==_0x514d8b)throw kbError(_0x6beee8(0x1cd),_0x6beee8(0x1e5),_0x6beee8(0x1c6));}catch(_0x1cd8fd){if(!isPlatformTransportFailure(_0x1cd8fd))throw _0x1cd8fd;_0xa3749f=!![];}const _0x489d38=await verifyKbMutationReadback(_0x6beee8(0x1cb),_0xa3749f,()=>requireKb(_0x3d0b98,_0x21ce4f[_0x6beee8(0x1e1)]['id'])),_0x7bc446=projectKb(_0x489d38),_0x13afec=_0x489d38['title']===_0x5de3d5,_0x4a59c7=_0x489d38[_0x6beee8(0x1e8)]===_0x398e98,_0x40abe8=_0x489d38[_0x6beee8(0x1c3)]===_0x514d8b&&(!_0x3c81a4||_0x489d38['id']===_0x3c81a4['id']&&_0x489d38['version']===_0x3c81a4[_0x6beee8(0x1c3)]),_0x539a71=!_0xa3749f||_0x21ce4f['replacement']!==undefined||_0x21ce4f[_0x6beee8(0x1e1)][_0x6beee8(0x1ea)]===undefined||_0x21ce4f['beforeRecord'][_0x6beee8(0x1ea)]!==_0x21ce4f['patch'][_0x6beee8(0x1ea)];if(!_0x13afec||!_0x4a59c7||!_0x40abe8||!_0x539a71)throw kbError(_0xa3749f?_0x6beee8(0x1db):'kb_verification_failed',_0x6beee8(0x1cc)+_0x21ce4f[_0x6beee8(0x1e1)]['id']+'\x20does\x20not\x20prove\x20the\x20requested\x20update\x20state.','Inspect\x20it\x20with\x20`rabetbase\x20kb\x20detail\x20--id\x20'+_0x21ce4f[_0x6beee8(0x1e1)]['id']+_0x6beee8(0x1d8));const _0x296fab=[];return _0xa3749f&&_0x296fab[_0x6beee8(0x1e9)](_0x6beee8(0x1d3)),{'ok':!![],'data':{'operation':_0x6beee8(0x1cb),'selector':{'id':_0x7bc446['id'],'scope':_0x6beee8(0x1c7),'appCode':_0x7bc446[_0x6beee8(0x1d0)]},'before':_0x21ce4f[_0x6beee8(0x1de)],'after':_0x7bc446,'dryRun':![],'backend':{'method':_0x6beee8(0x1d7),'path':knowledgeDocumentsPath('company',_0x6beee8(0x1cb))},'warnings':_0x296fab,'verification':{'status':_0x6beee8(0x1ce),'recoveredAfterUnknownResponse':_0xa3749f,'expectedVersion':_0x21ce4f[_0x6beee8(0x1ee)][_0x6beee8(0x1c3)],'atomicCompareAndSet':!![],'lookupCommand':'rabetbase\x20kb\x20detail\x20--id\x20'+_0x7bc446['id']+_0x6beee8(0x1dc)}},'message':_0x6beee8(0x1c4)+_0x7bc446['id']};}};
|