@lovrabet/rabetbase-cli 2.5.3-beta.2 → 2.5.3-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/api-group.d.ts +22 -0
- package/lib/api/api-group.js +1 -0
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.d.ts +18 -2
- 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.d.ts +11 -0
- package/lib/api/legacy-api-file.js +1 -0
- package/lib/api/model-registry-file.d.ts +36 -0
- package/lib/api/model-registry-file.js +1 -0
- package/lib/api/model-registry-scaffold.d.ts +7 -0
- package/lib/api/model-registry-scaffold.js +1 -0
- package/lib/api/model-source.d.ts +6 -0
- package/lib/api/model-source.js +1 -0
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.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.d.ts +7 -0
- 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.d.ts +2 -0
- package/lib/commands/dataset/cross-relation-create.js +1 -0
- package/lib/commands/dataset/cross-relation-delete.d.ts +2 -0
- package/lib/commands/dataset/cross-relation-delete.js +1 -0
- package/lib/commands/dataset/cross-relation-list.d.ts +2 -0
- package/lib/commands/dataset/cross-relation-list.js +1 -0
- package/lib/commands/dataset/cross-relation-shared.d.ts +190 -0
- package/lib/commands/dataset/cross-relation-shared.js +1 -0
- package/lib/commands/dataset/cross-relation-update.d.ts +2 -0
- package/lib/commands/dataset/cross-relation-update.js +1 -0
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-restore.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/dataset/user-deleted-field-list.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/table-diff-shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/deployment/index.js +1 -1
- package/lib/commands/deployment/sync-all.js +1 -1
- package/lib/commands/deployment/sync-jobs.js +1 -1
- package/lib/commands/deployment/sync-status.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/flow/create.js +1 -1
- package/lib/commands/flow/detail.js +1 -1
- package/lib/commands/flow/index.js +1 -1
- package/lib/commands/flow/list.js +1 -1
- package/lib/commands/flow/publish.js +1 -1
- package/lib/commands/flow/runtime-resources-shared.js +1 -1
- package/lib/commands/flow/runtime-role-list.js +1 -1
- package/lib/commands/flow/runtime-role-user-list.js +1 -1
- package/lib/commands/flow/runtime-user-search.js +1 -1
- package/lib/commands/flow/shared.js +1 -1
- package/lib/commands/flow/update.js +1 -1
- package/lib/commands/flow/validate.js +1 -1
- package/lib/commands/instant-api-policy/current.js +1 -1
- package/lib/commands/instant-api-policy/index.js +1 -1
- package/lib/commands/instant-api-policy/init.js +1 -1
- package/lib/commands/instant-api-policy/publish.js +1 -1
- package/lib/commands/instant-api-policy/pull.js +1 -1
- package/lib/commands/instant-api-policy/revision.js +1 -1
- package/lib/commands/instant-api-policy/revisions.js +1 -1
- package/lib/commands/instant-api-policy/rollback.js +1 -1
- package/lib/commands/instant-api-policy/shared.js +1 -1
- package/lib/commands/instant-api-policy/validate.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/search.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.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.d.ts +28 -0
- package/lib/commands/project/api-architecture-upgrade.js +1 -0
- 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.d.ts +30 -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/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.d.ts +2 -0
- 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.d.ts +2 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.d.ts +13 -17
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.d.ts +6 -0
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/hook-directory.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/cross-db-relation.d.ts +41 -0
- package/lib/core/cross-db-relation.js +1 -0
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/flow-config.js +1 -1
- package/lib/core/instant-api-policy/config.js +1 -1
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/page/lr-smart-jsx.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.d.ts +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/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.d.ts +0 -10
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/types/index.d.ts +11 -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.d.ts +12 -0
- 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 +4 -1
- package/skills/rabetbase/SKILL.md +10 -6
- package/skills/rabetbase/guides/sdk-client-generation.md +112 -61
- package/skills/rabetbase/guides/typescript-sdk.md +9 -0
- package/skills/rabetbase/references/rabetbase-api-pull.md +30 -19
- package/skills/rabetbase/references/rabetbase-app-list.md +1 -1
- package/skills/rabetbase/references/rabetbase-config.md +2 -1
- package/skills/rabetbase/references/rabetbase-dataset-cross-relations.md +60 -0
- package/skills/rabetbase/references/rabetbase-project-create.md +3 -3
- package/skills/rabetbase/references/rabetbase-project-upgrade.md +24 -13
- package/skills/rabetbase.manifest.json +4 -3
- package/templates/README.md +16 -4
- package/templates/generate-api/model-runtime.ts.tpl +101 -0
- package/templates/generate-api/profile-api.ts.tpl +21 -0
- package/templates/generate-api/profile-client.ts.tpl +14 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a135_0x20cc2b=a135_0x2fb4;(function(_0x5ecdd5,_0x53f37f){const _0x2262cc=a135_0x2fb4,_0x560887=_0x5ecdd5();while(!![]){try{const _0xf7a4ef=-parseInt(_0x2262cc(0x178))/0x1*(parseInt(_0x2262cc(0x160))/0x2)+parseInt(_0x2262cc(0x16b))/0x3*(parseInt(_0x2262cc(0x15e))/0x4)+-parseInt(_0x2262cc(0x162))/0x5*(-parseInt(_0x2262cc(0x15b))/0x6)+parseInt(_0x2262cc(0x169))/0x7*(-parseInt(_0x2262cc(0x177))/0x8)+parseInt(_0x2262cc(0x155))/0x9+-parseInt(_0x2262cc(0x175))/0xa*(-parseInt(_0x2262cc(0x152))/0xb)+parseInt(_0x2262cc(0x166))/0xc*(parseInt(_0x2262cc(0x17a))/0xd);if(_0xf7a4ef===_0x53f37f)break;else _0x560887['push'](_0x560887['shift']());}catch(_0x48c294){_0x560887['push'](_0x560887['shift']());}}}(a135_0x4e21,0x257d3));import{instantApiPolicyError,loadInstantApiPolicyLocalConfig,readInstantApiPolicyConfigFile}from'../../core/instant-api-policy/config.js';export const INSTANT_API_POLICY_BASE_PATH=a135_0x20cc2b(0x150);export const RUNTIME_CACHE_WARNING=a135_0x20cc2b(0x15d);function a135_0x2fb4(_0x1aa3b8,_0x5c0385){_0x1aa3b8=_0x1aa3b8-0x14e;const _0x4e21df=a135_0x4e21();let _0x2fb432=_0x4e21df[_0x1aa3b8];return _0x2fb432;}export const NON_ATOMIC_EXPECTED_REVISION_WARNING=a135_0x20cc2b(0x158);export const FORCE_FLAG={'name':a135_0x20cc2b(0x16c),'type':a135_0x20cc2b(0x172),'default':![],'description':a135_0x20cc2b(0x151)};export const CHANGE_SUMMARY_FLAG={'name':'change-summary','type':a135_0x20cc2b(0x159),'required':![],'description':'Audit\x20summary\x20for\x20this\x20policy\x20revision\x20(maximum\x202000\x20characters)'};export const REVISION_FLAG={'name':'revision','type':'number','required':!![],'description':a135_0x20cc2b(0x16e)};export const EXPECTED_REVISION_FLAG={'name':a135_0x20cc2b(0x174),'type':'number','required':![],'description':'Non-atomic\x20assertion\x20for\x20the\x20current\x20revision;\x20use\x200\x20when\x20unconfigured'};export function requireForceConfirmation(_0x38c958){const _0x431164=a135_0x20cc2b;if(!_0x38c958[_0x431164(0x153)]('force')||_0x38c958[_0x431164(0x153)]('yes'))return;throw instantApiPolicyError(_0x431164(0x17b),_0x431164(0x15f),'Review\x20the\x20existing\x20file,\x20then\x20rerun\x20with\x20--force\x20--yes.');}export function readChangeSummary(_0x3d1d4f){const _0x5ea48a=a135_0x20cc2b,_0x14cc14=_0x3d1d4f['str']('change-summary')[_0x5ea48a(0x179)]();if(!_0x14cc14)return undefined;if(_0x14cc14['length']>0x7d0)throw instantApiPolicyError('instant_api_policy_change_summary_invalid','--change-summary\x20cannot\x20exceed\x202000\x20characters.');return _0x14cc14;}function a135_0x4e21(){const _0x521e5e=['string','num','6kHkRpK','appCode','Runtime\x20instances\x20may\x20take\x20up\x20to\x2030\x20seconds\x20to\x20observe\x20the\x20new\x20active\x20policy.','8axZkEP','--force\x20requires\x20--yes\x20because\x20it\x20replaces\x20the\x20fixed\x20local\x20policy\x20file.','393966qQzTDs','policyId','796650PuZfNY','NaN','flag','.\x20Run\x20current\x20and\x20review\x20before\x20retrying.','120bJeLoF','configHash','operatorId','1410458pSEutg','instant_api_policy_revision_invalid','88971RbHNVE','force','updateUserId','Positive\x20published\x20policy\x20revision','--expected-revision\x20must\x20be\x20a\x20non-negative\x20safe\x20integer.','changeSummary','createUserId','boolean','gmtCreate','expected-revision','282830nkBPMB','enabled','8DjLSNa','1QFrzkO','trim','36205OActWf','instant_api_policy_force_confirmation_required','isSafeInteger','version','--revision\x20must\x20be\x20a\x20positive\x20safe\x20integer.','config','/smartapi/instant-api-policy','Replace\x20an\x20existing\x20fixed\x20policy\x20file;\x20requires\x20--yes','22QHZzMt','bool','length','2240748eNSYeK','instant_api_policy_revision_mismatch','revision','--expected-revision\x20is\x20a\x20non-atomic\x20read-before-write\x20assertion;\x20the\x20server\x20mutation\x20contract\x20has\x20no\x20revision\x20predicate.'];a135_0x4e21=function(){return _0x521e5e;};return a135_0x4e21();}export function readRevision(_0x2d7920){const _0x32e444=a135_0x20cc2b,_0x303a2f=_0x2d7920[_0x32e444(0x15a)]('revision',Number['NaN']);if(!Number[_0x32e444(0x17c)](_0x303a2f)||_0x303a2f<=0x0)throw instantApiPolicyError(_0x32e444(0x16a),_0x32e444(0x14e));return _0x303a2f;}export function readExpectedRevision(_0x5aec24){const _0x3a565a=a135_0x20cc2b;if(_0x5aec24[_0x3a565a(0x164)](_0x3a565a(0x174))===undefined)return undefined;const _0x2b2585=_0x5aec24[_0x3a565a(0x15a)](_0x3a565a(0x174),Number[_0x3a565a(0x163)]);if(!Number[_0x3a565a(0x17c)](_0x2b2585)||_0x2b2585<0x0)throw instantApiPolicyError('instant_api_policy_expected_revision_invalid',_0x3a565a(0x16f));return _0x2b2585;}export function assertExpectedRevision(_0x52dc77,_0x34de38){const _0x334d98=a135_0x20cc2b;if(_0x34de38===undefined)return;const _0x20b372=_0x52dc77?.[_0x334d98(0x157)]??0x0;if(_0x20b372!==_0x34de38)throw instantApiPolicyError(_0x334d98(0x156),'The\x20current\x20Instant\x20API\x20policy\x20revision\x20changed\x20before\x20mutation.','Expected\x20revision\x20'+_0x34de38+';\x20current\x20revision\x20is\x20'+_0x20b372+_0x334d98(0x165));}export async function readFixedPolicy(_0xb49107){const _0x4bc6fd=a135_0x20cc2b,_0x4aa7c0=loadInstantApiPolicyLocalConfig(_0xb49107[_0x4bc6fd(0x15c)]),_0x38fceb=await readInstantApiPolicyConfigFile(_0x4aa7c0);return{'local':_0x4aa7c0,'config':_0x38fceb};}export function projectCurrentPolicy(_0x5d7900){const _0x10d46c=a135_0x20cc2b;if(!_0x5d7900)return null;return{'id':_0x5d7900['id'],'appCode':_0x5d7900[_0x10d46c(0x15c)],'revision':_0x5d7900[_0x10d46c(0x157)],'configHash':_0x5d7900[_0x10d46c(0x167)],'enabled':_0x5d7900[_0x10d46c(0x176)],'config':_0x5d7900[_0x10d46c(0x14f)],'createUserId':_0x5d7900[_0x10d46c(0x171)]??null,'updateUserId':_0x5d7900[_0x10d46c(0x16d)]??null,'gmtCreate':_0x5d7900['gmtCreate']??null,'gmtModified':_0x5d7900['gmtModified']??null};}export function projectRevisionSummary(_0x508486){const _0x36799e=a135_0x20cc2b;return{'id':_0x508486['id'],'policyId':_0x508486[_0x36799e(0x161)],'appCode':_0x508486['appCode'],'revision':_0x508486[_0x36799e(0x157)],'configHash':_0x508486[_0x36799e(0x167)],'changeType':_0x508486['changeType'],'changeSummary':_0x508486[_0x36799e(0x170)]??null,'operatorId':_0x508486[_0x36799e(0x168)]??null,'gmtCreate':_0x508486[_0x36799e(0x173)]??null,'version':_0x508486['config'][_0x36799e(0x17d)],'defaultAction':_0x508486[_0x36799e(0x14f)]['defaults']['instantApi'],'ruleCount':_0x508486[_0x36799e(0x14f)]['rules']?.[_0x36799e(0x154)]??0x0};}export function projectRevisionDetail(_0x96291){const _0x4d485e=a135_0x20cc2b;return{...projectRevisionSummary(_0x96291),'config':_0x96291[_0x4d485e(0x14f)]};}export function expectedRevisionWarnings(_0xf8491){return _0xf8491===undefined?[]:[NON_ATOMIC_EXPECTED_REVISION_WARNING];}export function mutationLookupCommand(){return'rabetbase\x20instant-api-policy\x20current\x20--format\x20compress';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a136_0x48d659=a136_0x31c2;(function(_0x297695,_0x348192){const _0x40a261=a136_0x31c2,_0x1e98f9=_0x297695();while(!![]){try{const _0x439da3=parseInt(_0x40a261(0x193))/0x1+-parseInt(_0x40a261(0x188))/0x2+parseInt(_0x40a261(0x187))/0x3+-parseInt(_0x40a261(0x18c))/0x4+-parseInt(_0x40a261(0x190))/0x5+parseInt(_0x40a261(0x185))/0x6+parseInt(_0x40a261(0x18a))/0x7;if(_0x439da3===_0x348192)break;else _0x1e98f9['push'](_0x1e98f9['shift']());}catch(_0x5680c6){_0x1e98f9['push'](_0x1e98f9['shift']());}}}(a136_0x59f9,0x6a070));function a136_0x31c2(_0x4bce0d,_0x103027){_0x4bce0d=_0x4bce0d-0x183;const _0x59f955=a136_0x59f9();let _0x31c299=_0x59f955[_0x4bce0d];return _0x31c299;}import{validateInstantApiPolicy}from'../../core/api-client.js';function a136_0x59f9(){const _0x2b7143=['Validated\x20Instant\x20API\x20policy\x20for\x20','Validate\x20the\x20fixed\x20local\x20policy\x20without\x20publishing','1191790PVrKrK','valid','POST','9098JTlRNA','/validate','policyFilePath','136446BaElBB','validate','1472421JzRVAj','821658EJIwUo','normalizedConfig','7075495QSYnAg','read','1799824dZpqnS','appCode'];a136_0x59f9=function(){return _0x2b7143;};return a136_0x59f9();}import{INSTANT_API_POLICY_BASE_PATH,readFixedPolicy}from'../../commands/instant-api-policy/shared.js';export const instantApiPolicyValidate={'service':'instant-api-policy','command':a136_0x48d659(0x186),'description':a136_0x48d659(0x18f),'risk':a136_0x48d659(0x18b),'requiresAppCode':!![],'structuredErrors':!![],'flags':[],async 'execute'(_0x4b009d){const _0x109300=a136_0x48d659,{local:_0x13f7c3,config:_0x4457c3}=await readFixedPolicy(_0x4b009d),_0xb13b4=await validateInstantApiPolicy({'appCode':_0x4b009d['appCode'],'config':_0x4457c3});return{'ok':!![],'data':{'operation':_0x109300(0x186),'selector':{'appCode':_0x4b009d[_0x109300(0x18d)]},'filePath':_0x13f7c3[_0x109300(0x184)],'relativePath':_0x13f7c3['policyRelativePath'],'valid':_0xb13b4[_0x109300(0x191)],'configHash':_0xb13b4['configHash'],'normalizedConfig':_0xb13b4[_0x109300(0x189)],'backend':{'method':_0x109300(0x192),'path':INSTANT_API_POLICY_BASE_PATH+_0x109300(0x183)}},'message':_0x109300(0x18e)+_0x4b009d[_0x109300(0x18d)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a137_0x5721(_0xf6392,_0x5b162b){_0xf6392=_0xf6392-0xba;const _0x3f4f18=a137_0x3f4f();let _0x5721f3=_0x3f4f18[_0xf6392];return _0x5721f3;}function a137_0x3f4f(){const _0x225c09=['113328bHyCUb','222260NiuVOh','233064ITYNNn','120lxuPzf','6726bNedFo','10082330UzuwnY','24TTOpux','4185685jdiEdi','1749072uTWjlP','16LtyBSN'];a137_0x3f4f=function(){return _0x225c09;};return a137_0x3f4f();}(function(_0x7b422,_0x52e623){const _0x5b417d=a137_0x5721,_0x3f4ba2=_0x7b422();while(!![]){try{const _0x56c3ea=parseInt(_0x5b417d(0xbf))/0x1*(parseInt(_0x5b417d(0xbe))/0x2)+parseInt(_0x5b417d(0xbd))/0x3+parseInt(_0x5b417d(0xc3))/0x4+parseInt(_0x5b417d(0xbc))/0x5*(-parseInt(_0x5b417d(0xc1))/0x6)+parseInt(_0x5b417d(0xc2))/0x7+parseInt(_0x5b417d(0xba))/0x8*(parseInt(_0x5b417d(0xbb))/0x9)+-parseInt(_0x5b417d(0xc0))/0xa;if(_0x56c3ea===_0x52e623)break;else _0x3f4ba2['push'](_0x3f4ba2['shift']());}catch(_0x2cbc4f){_0x3f4ba2['push'](_0x3f4ba2['shift']());}}}(a137_0x3f4f,0x56d1e));import{issueReport}from'../../commands/issue/report.js';export const issueDefinitions=[issueReport];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a138_0x574266=a138_0x27a3;(function(_0x42d574,_0x29a433){const _0x129ba9=a138_0x27a3,_0x31f2ac=_0x42d574();while(!![]){try{const _0x110323=parseInt(_0x129ba9(0x1df))/0x1*(-parseInt(_0x129ba9(0x1f7))/0x2)+-parseInt(_0x129ba9(0x1fb))/0x3*(-parseInt(_0x129ba9(0x1f9))/0x4)+-parseInt(_0x129ba9(0x1e1))/0x5*(parseInt(_0x129ba9(0x1de))/0x6)+parseInt(_0x129ba9(0x1ec))/0x7+parseInt(_0x129ba9(0x1f1))/0x8+-parseInt(_0x129ba9(0x1f4))/0x9*(parseInt(_0x129ba9(0x1e0))/0xa)+-parseInt(_0x129ba9(0x1dc))/0xb;if(_0x110323===_0x29a433)break;else _0x31f2ac['push'](_0x31f2ac['shift']());}catch(_0x38f922){_0x31f2ac['push'](_0x31f2ac['shift']());}}}(a138_0x225f,0x7db9f));import{CliError}from'../../errors.js';function a138_0x27a3(_0x3cad56,_0x490238){_0x3cad56=_0x3cad56-0x1d9;const _0x225fbb=a138_0x225f();let _0x27a3cb=_0x225fbb[_0x3cad56];return _0x27a3cb;}import{CLI_BIN_NAME}from'../../constant/cli.js';export const NUDGE_OPT_OUT_ENV='RABETBASE_DISABLE_ISSUE_NUDGE';const NUDGE_SUPPRESSED_CODES=new Set(['cancelled',a138_0x574266(0x1e9),a138_0x574266(0x1e7),'not_in_project',a138_0x574266(0x1e3),'flag_missing',a138_0x574266(0x1e6),'network_error']),defaultWriter=_0x970764=>{const _0x16c22d=a138_0x574266;process[_0x16c22d(0x1e5)][_0x16c22d(0x1ee)](_0x970764);};export function shouldNudgeForError(_0x15d454,_0x4184ce){const _0x154619=a138_0x574266;if(process.env[NUDGE_OPT_OUT_ENV]==='1')return![];if(_0x4184ce[_0x154619(0x1e2)]===_0x154619(0x1eb)&&_0x4184ce[_0x154619(0x1dd)]==='report')return![];if(_0x15d454 instanceof CliError)return!NUDGE_SUPPRESSED_CODES[_0x154619(0x1f2)](_0x15d454[_0x154619(0x1e4)]);return!![];}function a138_0x225f(){const _0x595d0f=['989650rnAGVG','2229455apvBHL','service','unknown_command','code','stderr','validation_error','config_missing','slice','auth_required','length','issue','3659971tCDtIr','join','write','\x20bug?\x20Help\x20us\x20fix\x20it:','=1\x20to\x20silence\x20this\x20hint.','7938368uQXpEz','has','\x20\x20\x20\x20--title\x20\x22','9EdgWuX','Hit\x20a\x20','\x20\x20(Cookies\x20/\x20Authorization\x20/\x20access\x20keys\x20are\x20automatically\x20redacted\x20before\x20upload.)','257714jFrVnJ','replace','10576fenBTx','\x20issue\x20report\x20\x5c','744PefBbx','trim','\x20\x20\x20\x20--description\x20\x22Steps\x20to\x20reproduce,\x20expected\x20vs\x20actual,\x20and\x20any\x20relevant\x20logs.\x22','\x22\x20\x5c','3064248agEKwt','command','12HNISHo','3JyCgoq'];a138_0x225f=function(){return _0x595d0f;};return a138_0x225f();}export function printIssueReportNudgeForError(_0x384d19,_0x3a2a31,_0x55e498=defaultWriter){if(!shouldNudgeForError(_0x384d19,_0x3a2a31))return;const _0x5c1918=buildSuggestedTitle(_0x384d19,_0x3a2a31);_0x55e498(formatNudge(_0x5c1918));}function buildSuggestedTitle(_0x3266e0,_0xe33c17){const _0x284cf9=a138_0x574266,_0x8a9243=_0x3266e0 instanceof Error?_0x3266e0['message']:String(_0x3266e0),_0x4572b4=_0x8a9243[_0x284cf9(0x1f8)](/[\r\n]+/g,'\x20')[_0x284cf9(0x1f8)](/\s+/g,'\x20')[_0x284cf9(0x1d9)]()[_0x284cf9(0x1e8)](0x0,0x78)[_0x284cf9(0x1f8)](/"/g,'\x5c\x22'),_0x488925=CLI_BIN_NAME+'\x20'+_0xe33c17[_0x284cf9(0x1e2)]+'\x20'+_0xe33c17[_0x284cf9(0x1dd)];return _0x4572b4[_0x284cf9(0x1ea)]>0x0?_0x488925+':\x20'+_0x4572b4:_0x488925;}function formatNudge(_0x472dff){const _0x380d0a=a138_0x574266;return['',_0x380d0a(0x1f5)+CLI_BIN_NAME+_0x380d0a(0x1ef),'\x20\x20'+CLI_BIN_NAME+_0x380d0a(0x1fa),_0x380d0a(0x1f3)+_0x472dff+_0x380d0a(0x1db),_0x380d0a(0x1da),_0x380d0a(0x1f6),'\x20\x20Set\x20'+NUDGE_OPT_OUT_ENV+_0x380d0a(0x1f0),''][_0x380d0a(0x1ed)]('\x0a');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a139_0x2f28aa=a139_0x8d69;function a139_0x8d69(_0x44db8d,_0x3374e6){_0x44db8d=_0x44db8d-0x176;const _0x1ce565=a139_0x1ce5();let _0x8d6950=_0x1ce565[_0x44db8d];return _0x8d6950;}(function(_0x5ac229,_0x2d7537){const _0x501615=a139_0x8d69,_0x96f62d=_0x5ac229();while(!![]){try{const _0x23ef81=-parseInt(_0x501615(0x183))/0x1*(parseInt(_0x501615(0x17c))/0x2)+-parseInt(_0x501615(0x1a2))/0x3+parseInt(_0x501615(0x1ae))/0x4*(parseInt(_0x501615(0x1b5))/0x5)+parseInt(_0x501615(0x19f))/0x6*(-parseInt(_0x501615(0x17b))/0x7)+-parseInt(_0x501615(0x1ac))/0x8+-parseInt(_0x501615(0x1b2))/0x9*(parseInt(_0x501615(0x1a4))/0xa)+parseInt(_0x501615(0x187))/0xb;if(_0x23ef81===_0x2d7537)break;else _0x96f62d['push'](_0x96f62d['shift']());}catch(_0x5cae94){_0x96f62d['push'](_0x96f62d['shift']());}}}(a139_0x1ce5,0xa11b8));import{existsSync}from'node:fs';import{readFile}from'node:fs/promises';import{resolve}from'node:path';import{CliErrors}from'../../errors.js';import{sanitizeIssueDescription}from'../../commands/issue/shared.js';import{PLATFORM_ISSUE_SPAN_NAME,PLATFORM_ISSUE_TRACE_NAME,sendPlatformIssueCollectLog}from'../../telemetry/send-platform-issue-collect-log.js';const DESCRIPTION_FILE_FLAG=a139_0x2f28aa(0x184);function a139_0x1ce5(){const _0x495009=['One-line\x20issue\x20summary','issue.description','1uQlaQQ','description-file','otel://','message','36079065mtHrbr','Provide\x20non-empty\x20markdown\x20content\x20via\x20--description\x20or\x20--description-file.','redacted\x20','Check\x20telemetry\x20configuration\x20and\x20network\x20reachability,\x20then\x20retry.','truncated\x20from\x20','File\x20not\x20found:\x20','Issue\x20description\x20file\x20is\x20empty:\x20','Report\x20a\x20platform\x20issue\x20with\x20title\x20and\x20markdown\x20context','Failed\x20to\x20report\x20platform\x20issue:\x20','Write\x20markdown\x20context\x20into\x20the\x20file\x20before\x20retrying.','trim','filter','descriptionFile:\x20','str','file','Provide\x20--title\x20with\x20a\x20one-line\x20issue\x20summary.','\x20secret(s):\x20','validation','descriptionFilePath','Inline\x20markdown\x20issue\x20description\x20(alternative\x20to\x20--description-file)','truncated','length','description','descriptionSource','74142gDmlIc','issue.description_truncated','truncated:\x20original\x20','1136772BEvAaI','issue.description_redaction_kinds','20RdMXJx','title','descriptionSource:\x20','Path\x20to\x20a\x20markdown\x20file\x20whose\x20contents\x20become\x20issue.description','issue.title','utf8','\x20bytes','string','9788648snbIvB','Platform\x20issue\x20reported\x20(','1720764vpzvmz','originalBytes','redactionKinds','compress','1902582KMNsWt','join','write','5PwUdPp','sanitize','redactionCount','push','Use\x20--description\x20for\x20short\x20markdown\x20text,\x20or\x20--description-file\x20for\x20full\x20issue\x20context.','Platform\x20issue\x20reported','469DIKHzG','393980bDWoey','cwd','flagMissing','inline','Provide\x20exactly\x20one\x20of\x20--description\x20or\x20--description-file.'];a139_0x1ce5=function(){return _0x495009;};return a139_0x1ce5();}export const issueReport={'service':'issue','command':'report','description':a139_0x2f28aa(0x18e),'risk':a139_0x2f28aa(0x1b4),'requiresAuth':!![],'requiresAppCode':![],'defaultOutputFormat':a139_0x2f28aa(0x1b1),'flags':[{'name':a139_0x2f28aa(0x1a5),'type':a139_0x2f28aa(0x1ab),'required':!![],'description':a139_0x2f28aa(0x181)},{'name':'description','type':'string','description':a139_0x2f28aa(0x19a)},{'name':DESCRIPTION_FILE_FLAG,'type':a139_0x2f28aa(0x1ab),'description':a139_0x2f28aa(0x1a7)}],async 'validate'(_0x5bffd3){const _0xff7d40=a139_0x2f28aa,_0x41d219=_0x5bffd3[_0xff7d40(0x194)](_0xff7d40(0x1a5))[_0xff7d40(0x191)](),_0x77c713=_0x5bffd3[_0xff7d40(0x194)](_0xff7d40(0x19d))['trim'](),_0x3b9e75=_0x5bffd3[_0xff7d40(0x194)](DESCRIPTION_FILE_FLAG)[_0xff7d40(0x191)]();if(!_0x41d219)throw CliErrors[_0xff7d40(0x17e)](_0xff7d40(0x1a5),_0xff7d40(0x196));const _0x2ad572=_0x77c713[_0xff7d40(0x19c)]>0x0,_0x1f1201=_0x3b9e75[_0xff7d40(0x19c)]>0x0;if(_0x2ad572===_0x1f1201)throw CliErrors[_0xff7d40(0x198)](_0xff7d40(0x180),_0xff7d40(0x179));if(_0x1f1201){const _0x92c87=resolve(process[_0xff7d40(0x17d)](),_0x3b9e75);if(!existsSync(_0x92c87))throw CliErrors[_0xff7d40(0x198)](_0xff7d40(0x18c)+_0x92c87);}},async 'dryRun'(_0x199f76){const _0x3e0699=a139_0x2f28aa,_0x197d95=await prepareIssueReport(_0x199f76);return{'method':'POST','url':_0x3e0699(0x185)+PLATFORM_ISSUE_TRACE_NAME+'/'+PLATFORM_ISSUE_SPAN_NAME,'body':{'traceName':PLATFORM_ISSUE_TRACE_NAME,'spanName':PLATFORM_ISSUE_SPAN_NAME,'logData':{'issue.title':_0x197d95['title'],'issue.description':_0x197d95['description'],'issue.description_original_bytes':_0x197d95[_0x3e0699(0x176)][_0x3e0699(0x1af)],'issue.description_truncated':_0x197d95[_0x3e0699(0x176)][_0x3e0699(0x19b)],'issue.description_redactions':_0x197d95[_0x3e0699(0x176)][_0x3e0699(0x177)],'issue.description_redaction_kinds':_0x197d95[_0x3e0699(0x176)][_0x3e0699(0x1b0)][_0x3e0699(0x1b3)](',')}},'description':['Send\x20platform\x20issue\x20collect\x20log\x20via\x20the\x20CLI\x20telemetry\x20adapter',_0x3e0699(0x1a6)+_0x197d95[_0x3e0699(0x19e)],_0x197d95['descriptionFilePath']?_0x3e0699(0x193)+_0x197d95[_0x3e0699(0x199)]:null,_0x197d95[_0x3e0699(0x176)][_0x3e0699(0x19b)]?_0x3e0699(0x1a1)+_0x197d95[_0x3e0699(0x176)][_0x3e0699(0x1af)]+_0x3e0699(0x1aa):null,_0x197d95[_0x3e0699(0x176)][_0x3e0699(0x177)]>0x0?'redactions:\x20'+_0x197d95['sanitize'][_0x3e0699(0x177)]+'\x20('+_0x197d95[_0x3e0699(0x176)][_0x3e0699(0x1b0)][_0x3e0699(0x1b3)](',\x20')+')':null][_0x3e0699(0x192)](Boolean)['join']('\x0a')};},async 'execute'(_0x2dd67b){const _0x4cb93f=a139_0x2f28aa,_0x54016f=await prepareIssueReport(_0x2dd67b);try{await sendPlatformIssueCollectLog({'title':_0x54016f[_0x4cb93f(0x1a5)],'description':_0x54016f[_0x4cb93f(0x19d)],'sanitize':{'originalBytes':_0x54016f[_0x4cb93f(0x176)][_0x4cb93f(0x1af)],'truncated':_0x54016f[_0x4cb93f(0x176)][_0x4cb93f(0x19b)],'redactionCount':_0x54016f[_0x4cb93f(0x176)]['redactionCount'],'redactionKinds':_0x54016f[_0x4cb93f(0x176)][_0x4cb93f(0x1b0)]}});}catch(_0x1665e2){throw CliErrors['apiError'](_0x4cb93f(0x18f)+(_0x1665e2 instanceof Error?_0x1665e2[_0x4cb93f(0x186)]:String(_0x1665e2)),_0x4cb93f(0x18a));}return{'ok':!![],'message':buildResultMessage(_0x54016f['sanitize']),'data':{'traceName':PLATFORM_ISSUE_TRACE_NAME,'spanName':PLATFORM_ISSUE_SPAN_NAME,'logDataKeys':[_0x4cb93f(0x1a8),_0x4cb93f(0x182),'issue.description_original_bytes',_0x4cb93f(0x1a0),'issue.description_redactions',_0x4cb93f(0x1a3)],'issue':{'title':_0x54016f[_0x4cb93f(0x1a5)],'descriptionLength':_0x54016f['description'][_0x4cb93f(0x19c)],'descriptionSource':_0x54016f[_0x4cb93f(0x19e)],..._0x54016f[_0x4cb93f(0x199)]?{'descriptionFile':_0x54016f['descriptionFilePath']}:{},'sanitize':{'originalBytes':_0x54016f['sanitize'][_0x4cb93f(0x1af)],'truncated':_0x54016f['sanitize'][_0x4cb93f(0x19b)],'redactions':_0x54016f[_0x4cb93f(0x176)][_0x4cb93f(0x177)],'redactionKinds':_0x54016f[_0x4cb93f(0x176)][_0x4cb93f(0x1b0)]}}}};}};function buildResultMessage(_0x4c9c73){const _0x44abe8=a139_0x2f28aa,_0xd12658=[];return _0x4c9c73[_0x44abe8(0x19b)]&&_0xd12658[_0x44abe8(0x178)](_0x44abe8(0x18b)+_0x4c9c73[_0x44abe8(0x1af)]+_0x44abe8(0x1aa)),_0x4c9c73[_0x44abe8(0x177)]>0x0&&_0xd12658[_0x44abe8(0x178)](_0x44abe8(0x189)+_0x4c9c73[_0x44abe8(0x177)]+_0x44abe8(0x197)+_0x4c9c73['redactionKinds'][_0x44abe8(0x1b3)](',\x20')),_0xd12658[_0x44abe8(0x19c)]===0x0?_0x44abe8(0x17a):_0x44abe8(0x1ad)+_0xd12658[_0x44abe8(0x1b3)](';\x20')+')';}async function prepareIssueReport(_0x1263c4){const _0x4d3b02=a139_0x2f28aa,_0x12ac69=_0x1263c4[_0x4d3b02(0x194)](_0x4d3b02(0x1a5))['trim'](),_0x4625fe=_0x1263c4[_0x4d3b02(0x194)](_0x4d3b02(0x19d)),_0x5ea9b8=_0x1263c4[_0x4d3b02(0x194)](DESCRIPTION_FILE_FLAG)['trim']();if(!_0x5ea9b8){const _0x3dcc8e=_0x4625fe;if(!_0x3dcc8e[_0x4d3b02(0x191)]())throw CliErrors[_0x4d3b02(0x198)]('Issue\x20description\x20cannot\x20be\x20empty.',_0x4d3b02(0x188));const _0x10ac20=sanitizeIssueDescription(_0x3dcc8e);return{'title':_0x12ac69,'description':_0x10ac20[_0x4d3b02(0x19d)],'descriptionSource':_0x4d3b02(0x17f),'sanitize':_0x10ac20};}const _0xab335b=resolve(process[_0x4d3b02(0x17d)](),_0x5ea9b8),_0x7baf7c=await readFile(_0xab335b,_0x4d3b02(0x1a9));if(!_0x7baf7c['trim']())throw CliErrors['validation'](_0x4d3b02(0x18d)+_0xab335b,_0x4d3b02(0x190));const _0xe06734=sanitizeIssueDescription(_0x7baf7c);return{'title':_0x12ac69,'description':_0xe06734[_0x4d3b02(0x19d)],'descriptionSource':_0x4d3b02(0x195),'descriptionFilePath':_0xab335b,'sanitize':_0xe06734};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a140_0x47dbe3=a140_0x360e;(function(_0x1a8544,_0x3dfff9){const _0x40c482=a140_0x360e,_0x22604a=_0x1a8544();while(!![]){try{const _0x34592f=-parseInt(_0x40c482(0x126))/0x1*(-parseInt(_0x40c482(0x105))/0x2)+parseInt(_0x40c482(0x107))/0x3*(parseInt(_0x40c482(0x11b))/0x4)+-parseInt(_0x40c482(0x110))/0x5*(-parseInt(_0x40c482(0x10c))/0x6)+parseInt(_0x40c482(0x11c))/0x7*(parseInt(_0x40c482(0x109))/0x8)+parseInt(_0x40c482(0x11d))/0x9+-parseInt(_0x40c482(0x114))/0xa+parseInt(_0x40c482(0x10e))/0xb*(-parseInt(_0x40c482(0x121))/0xc);if(_0x34592f===_0x3dfff9)break;else _0x22604a['push'](_0x22604a['shift']());}catch(_0x18cd92){_0x22604a['push'](_0x22604a['shift']());}}}(a140_0x31e7,0x565b9));export const ISSUE_DESCRIPTION_MAX_BYTES=0x100*0x400;function a140_0x360e(_0x555271,_0x8e1d11){_0x555271=_0x555271-0x105;const _0x31e7c0=a140_0x31e7();let _0x360e14=_0x31e7c0[_0x555271];return _0x360e14;}const TRUNCATION_NOTICE='\x0a\x0a[...TRUNCATED\x20by\x20rabetbase-cli...]',REDACTION_RULES=[{'kind':a140_0x47dbe3(0x116),'pattern':/(cookie\s*[:=]\s*)[^\s;,'"`]+/gi,'label':a140_0x47dbe3(0x119)},{'kind':'authorization','pattern':/(authorization\s*:\s*)(bearer|basic|token)\s+[^\s'"`]+/gi,'label':a140_0x47dbe3(0x128)},{'kind':'private-key','pattern':/-----BEGIN [A-Z0-9 ]*PRIVATE KEY-----[\s\S]*?-----END [A-Z0-9 ]*PRIVATE KEY-----/g,'label':a140_0x47dbe3(0x12a)},{'kind':a140_0x47dbe3(0x11a),'pattern':/((?:aliyun_)?(?:access|secret)[_-]?key(?:[_-]?id)?\s*[:=]\s*)['"]?[A-Za-z0-9/+_\-]{8,}['"]?/gi,'label':'REDACTED:access-key'},{'kind':a140_0x47dbe3(0x112),'pattern':/(pass(?:word|wd)\s*[:=]\s*)['"]?[^\s'"`]+['"]?/gi,'label':a140_0x47dbe3(0x129)},{'kind':a140_0x47dbe3(0x125),'pattern':/\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\b/g,'label':a140_0x47dbe3(0x108)}];export function sanitizeIssueDescription(_0x1de69b){const _0x4f66ac=a140_0x47dbe3,_0x5be49f=Buffer[_0x4f66ac(0x10f)](_0x1de69b,_0x4f66ac(0x127)),_0x222b13=process.env.RABETBASE_ISSUE_RAW_DESCRIPTION==='1';let _0x3a9d42=_0x1de69b,_0x488ff4=0x0;const _0x360243=[];if(!_0x222b13){const _0x3085c8=protectOssAccessKeyIds(_0x3a9d42);_0x3a9d42=_0x3085c8[_0x4f66ac(0x120)];for(const _0x456f77 of REDACTION_RULES){let _0x411289=0x0;_0x3a9d42=_0x3a9d42[_0x4f66ac(0x10b)](_0x456f77[_0x4f66ac(0x111)],(_0x8f7afd,_0x51cc75)=>{const _0x187fec=_0x4f66ac;_0x411289+=0x1;const _0x319cf3=typeof _0x51cc75===_0x187fec(0x118)?_0x51cc75:'';return _0x319cf3+'['+_0x456f77[_0x187fec(0x123)]+']';}),_0x411289>0x0&&(_0x488ff4+=_0x411289,!_0x360243[_0x4f66ac(0x122)](_0x456f77[_0x4f66ac(0x11f)])&&_0x360243[_0x4f66ac(0x115)](_0x456f77[_0x4f66ac(0x11f)]));}_0x3a9d42=_0x3085c8[_0x4f66ac(0x10d)](_0x3a9d42);}let _0xe15b11=![];if(Buffer[_0x4f66ac(0x10f)](_0x3a9d42,_0x4f66ac(0x127))>ISSUE_DESCRIPTION_MAX_BYTES){_0xe15b11=!![];const _0xa54e62=Buffer[_0x4f66ac(0x10f)](TRUNCATION_NOTICE,_0x4f66ac(0x127)),_0x5b5ddb=Math[_0x4f66ac(0x10a)](0x0,ISSUE_DESCRIPTION_MAX_BYTES-_0xa54e62);_0x3a9d42=sliceUtf8Bytes(_0x3a9d42,_0x5b5ddb)+TRUNCATION_NOTICE;}return{'description':_0x3a9d42,'originalBytes':_0x5be49f,'truncated':_0xe15b11,'redactionCount':_0x488ff4,'redactionKinds':_0x360243};}function a140_0x31e7(){const _0x501e17=['label','subarray','bearer-jwt','10461zpNmQa','utf8','REDACTED:authorization','REDACTED:password','REDACTED:private-key','84ApySco','from','801bBLYGj','REDACTED:bearer-jwt','1662664POCyPe','max','replace','1369770ewViMB','restore','14994881wkpvOp','byteLength','15lSmVSL','pattern','password','__RB_OSS_ID_','6576680ilGyOw','push','cookie','length','string','REDACTED:cookie','access-key','7012epSZmM','7XyfwGw','5169861dVQTPJ','toString','kind','description','12myGqvY','includes'];a140_0x31e7=function(){return _0x501e17;};return a140_0x31e7();}function protectOssAccessKeyIds(_0x4de83f){const _0x427372=a140_0x47dbe3,_0x12b82a=[],_0x10b5f5=_0x4de83f[_0x427372(0x10b)](/([?&])OSSAccessKeyId=([A-Za-z0-9/+_\-]{8,})/gi,(_0x5dbe80,_0x2aa368)=>{const _0x3fdb20=_0x427372,_0x20bc77=_0x12b82a[_0x3fdb20(0x115)](_0x5dbe80['slice'](_0x2aa368[_0x3fdb20(0x117)]))-0x1;return _0x2aa368+_0x3fdb20(0x113)+_0x20bc77+'__';});return{'description':_0x10b5f5,'restore':_0x3800f3=>_0x3800f3['replace'](/([?&])__RB_OSS_ID_(\d+)__/g,(_0x59a49e,_0x551490,_0x151aa2)=>{const _0x5f2afc=_0x12b82a[Number(_0x151aa2)];return _0x5f2afc===undefined?_0x59a49e:''+_0x551490+_0x5f2afc;})};}function sliceUtf8Bytes(_0x304085,_0x1e771c){const _0x5d6db7=a140_0x47dbe3;if(_0x1e771c<=0x0)return'';const _0x1046e8=Buffer[_0x5d6db7(0x106)](_0x304085,_0x5d6db7(0x127));if(_0x1046e8[_0x5d6db7(0x10f)]<=_0x1e771c)return _0x304085;let _0x4b898d=_0x1e771c;while(_0x4b898d>0x0){const _0x922f26=_0x1046e8[_0x4b898d];if(_0x922f26===undefined||(_0x922f26&0xc0)!==0x80)break;_0x4b898d-=0x1;}return _0x1046e8[_0x5d6db7(0x124)](0x0,_0x4b898d)[_0x5d6db7(0x11e)](_0x5d6db7(0x127));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a141_0x277360=a141_0x1896;(function(_0x145c76,_0x14ed50){const _0x2eeb5b=a141_0x1896,_0x585077=_0x145c76();while(!![]){try{const _0x29585b=parseInt(_0x2eeb5b(0x1a8))/0x1*(parseInt(_0x2eeb5b(0x1ac))/0x2)+parseInt(_0x2eeb5b(0x1b4))/0x3*(-parseInt(_0x2eeb5b(0x1cd))/0x4)+-parseInt(_0x2eeb5b(0x1d7))/0x5*(-parseInt(_0x2eeb5b(0x1c7))/0x6)+-parseInt(_0x2eeb5b(0x1d3))/0x7*(parseInt(_0x2eeb5b(0x1bc))/0x8)+parseInt(_0x2eeb5b(0x1c4))/0x9*(parseInt(_0x2eeb5b(0x1b1))/0xa)+-parseInt(_0x2eeb5b(0x1d2))/0xb+parseInt(_0x2eeb5b(0x1c8))/0xc;if(_0x29585b===_0x14ed50)break;else _0x585077['push'](_0x585077['shift']());}catch(_0x344f08){_0x585077['push'](_0x585077['shift']());}}}(a141_0x267b,0x6bed5));import{createEnterpriseKnowledgeBase,isPlatformTransportFailure}from'../../core/api-client.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCompanyKnowledgeBase,fetchAllCompanyKnowledgeBases,findExactCompanyKnowledgeBases,inspectKbContent,kbError,projectKb,readKbFile,requireKb,verifyKbMutationReadback}from'../../commands/kb/shared.js';const CREATE_PATH=a141_0x277360(0x1c5);function readCreateInput(_0x13c760){const _0x523fa5=a141_0x277360,_0x135cd7=_0x13c760[_0x523fa5(0x1b6)]('title')[_0x523fa5(0x1b0)]();if(!_0x135cd7)throw kbError('kb_title_required',_0x523fa5(0x1b3));const _0x4fbe53=_0x13c760['str'](_0x523fa5(0x1bf))[_0x523fa5(0x1b0)]();if(!_0x4fbe53)throw kbError(_0x523fa5(0x1b8),_0x523fa5(0x1ce),_0x523fa5(0x1d1));return{'title':_0x135cd7,'file':_0x4fbe53};}async function prepareCreate(_0x1016a7){const _0x2218d1=a141_0x277360,_0x3f578d=readCreateInput(_0x1016a7),_0x426365=await readKbFile(_0x3f578d[_0x2218d1(0x1bf)]),_0x1b9f7f=await fetchAllCompanyKnowledgeBases(_0x1016a7,{'title':_0x3f578d[_0x2218d1(0x1cb)]}),_0x20ba55=findExactCompanyKnowledgeBases(_0x1b9f7f,_0x1016a7['appCode'],_0x3f578d[_0x2218d1(0x1cb)]);if(_0x20ba55[_0x2218d1(0x1cc)]>0x0)throw kbError(_0x2218d1(0x1be),_0x2218d1(0x1c0)+_0x1016a7[_0x2218d1(0x1b5)]+'\x20with\x20title\x20'+_0x3f578d[_0x2218d1(0x1cb)]+'.',_0x2218d1(0x1ab)+_0x20ba55[0x0]['id']+_0x2218d1(0x1c2));return{..._0x3f578d,'content':_0x426365};}function a141_0x1896(_0x18bc5a,_0x429dcc){_0x18bc5a=_0x18bc5a-0x1a8;const _0x267bd6=a141_0x267b();let _0x1896ea=_0x267bd6[_0x18bc5a];return _0x1896ea;}function plannedAfter(_0x80a574,_0x23b2f4){const _0x198bf0=a141_0x277360;return{'scope':_0x198bf0(0x1d8),'appCode':_0x80a574[_0x198bf0(0x1b5)],'title':_0x23b2f4[_0x198bf0(0x1cb)],'contentByteSize':_0x23b2f4[_0x198bf0(0x1c3)]['byteSize'],'contentHash':_0x23b2f4['content'][_0x198bf0(0x1b9)]};}function a141_0x267b(){const _0x3ad54f=['9628176MDRURP','\x20--format\x20compress','Knowledge-base\x20title','title','length','3407984mKlFrA','--file\x20is\x20required.','\x20does\x20not\x20match\x20the\x20requested\x20create\x20state.','\x20for\x20','Pass\x20a\x20UTF-8\x20text\x20or\x20Markdown\x20file.','1612138JMchYu','227969OnYKjG','cookie','verified','rabetbase\x20kb\x20list\x20--title\x20','60530cBfdCJ','company','669jnqGhT','write','kb_create_outcome_unknown','Run\x20`rabetbase\x20kb\x20detail\x20--id\x20','1964xuBCxt','kb_verification_failed','string','create','trim','20WWPsFm','Do\x20not\x20resubmit.\x20Inspect\x20the\x20resolved\x20app\x20and\x20determine\x20the\x20outcome\x20manually.','--title\x20is\x20required.','3zLUMba','appCode','str','Expected\x20one\x20exact\x20company\x20knowledge\x20base\x20after\x20uncertain\x20create;\x20found\x20','kb_file_required','contentHash','POST','Create\x20a\x20company\x20knowledge\x20base\x20from\x20a\x20UTF-8\x20text\x20or\x20Markdown\x20file','200yIWDRY','\x20--format\x20compress`;\x20do\x20not\x20resubmit\x20automatically.','kb_already_exists','file','Company\x20knowledge\x20base\x20already\x20exists\x20for\x20app\x20','Create\x20response\x20was\x20unavailable;\x20recovered\x20one\x20exact\x20company/app/title\x20record\x20without\x20resubmitting.','\x20--format\x20compress`\x20before\x20choosing\x20update.','content','1509588LFTeNf','/admin/knowledge-base/create','Inspect\x20it\x20with\x20`rabetbase\x20kb\x20detail\x20--id\x20','228VzzbZn'];a141_0x267b=function(){return _0x3ad54f;};return a141_0x267b();}function verifyCreatedState(_0x976a33,_0xd592c8,_0x59153e){const _0x364de7=a141_0x277360;assertCompanyKnowledgeBase(_0x59153e,_0x976a33[_0x364de7(0x1b5)],_0x59153e['id']);const _0x14227c=inspectKbContent(_0x59153e[_0x364de7(0x1c3)]);if(_0x59153e['title']!==_0xd592c8[_0x364de7(0x1cb)]||_0x14227c['contentHash']!==_0xd592c8[_0x364de7(0x1c3)]['contentHash'])throw kbError(_0x364de7(0x1ad),'Company\x20knowledge\x20base\x20'+_0x59153e['id']+_0x364de7(0x1cf),_0x364de7(0x1c6)+_0x59153e['id']+_0x364de7(0x1bd));return projectKb(_0x59153e);}export const kbCreate={'service':'kb','command':a141_0x277360(0x1af),'description':a141_0x277360(0x1bb),'risk':a141_0x277360(0x1a9),'requiresAppCode':!![],'structuredErrors':!![],'flags':[{'name':a141_0x277360(0x1cb),'type':a141_0x277360(0x1ae),'required':!![],'description':a141_0x277360(0x1ca)},{'name':'file','type':a141_0x277360(0x1ae),'required':!![],'description':'UTF-8\x20text\x20or\x20Markdown\x20content\x20file'}],async 'validate'(_0x57fc63){readCreateInput(_0x57fc63);},async 'dryRun'(_0x2a1670){const _0x3a5a7f=a141_0x277360,_0x42f37f=await prepareCreate(_0x2a1670);return asDryRunResult({'operation':_0x3a5a7f(0x1af),'selector':{'scope':'company','appCode':_0x2a1670[_0x3a5a7f(0x1b5)],'title':_0x42f37f[_0x3a5a7f(0x1cb)]},'before':null,'after':plannedAfter(_0x2a1670,_0x42f37f),'dryRun':!![],'backend':{'method':_0x3a5a7f(0x1ba),'path':CREATE_PATH},'warnings':[],'verification':{'lookupCommand':_0x3a5a7f(0x1d6)+JSON['stringify'](_0x42f37f['title'])+_0x3a5a7f(0x1c9)}},{'method':_0x3a5a7f(0x1ba),'url':CREATE_PATH});},async 'execute'(_0x146ad9){const _0x2f03d6=a141_0x277360,_0x20cf3d=await prepareCreate(_0x146ad9);let _0x547db3,_0x5f48a2=![];try{const _0x5755a0=await createEnterpriseKnowledgeBase(_0x146ad9[_0x2f03d6(0x1d4)],{'appCode':_0x146ad9[_0x2f03d6(0x1b5)],'title':_0x20cf3d['title'],'content':_0x20cf3d[_0x2f03d6(0x1c3)][_0x2f03d6(0x1c3)]});assertCompanyKnowledgeBase(_0x5755a0,_0x146ad9[_0x2f03d6(0x1b5)],_0x5755a0['id']),_0x547db3=_0x5755a0['id'];}catch(_0x5a92ba){if(!isPlatformTransportFailure(_0x5a92ba))throw _0x5a92ba;_0x5f48a2=!![];}if(_0x547db3===undefined){const _0x2d68d4=await verifyKbMutationReadback(_0x2f03d6(0x1af),!![],()=>fetchAllCompanyKnowledgeBases(_0x146ad9,{'title':_0x20cf3d[_0x2f03d6(0x1cb)]})),_0x5f36c6=findExactCompanyKnowledgeBases(_0x2d68d4,_0x146ad9[_0x2f03d6(0x1b5)],_0x20cf3d['title']);if(_0x5f36c6['length']!==0x1)throw kbError(_0x2f03d6(0x1aa),_0x2f03d6(0x1b7)+_0x5f36c6[_0x2f03d6(0x1cc)]+'.',_0x2f03d6(0x1b2));_0x547db3=_0x5f36c6[0x0]['id'];}const _0x12ac61=await verifyKbMutationReadback(_0x2f03d6(0x1af),_0x5f48a2,()=>requireKb(_0x146ad9,_0x547db3)),_0x2e7b07=verifyCreatedState(_0x146ad9,_0x20cf3d,_0x12ac61),_0x1db250=_0x5f48a2?[_0x2f03d6(0x1c1)]:[];return{'ok':!![],'data':{'operation':_0x2f03d6(0x1af),'selector':{'id':_0x2e7b07['id'],'scope':_0x2f03d6(0x1d8),'appCode':_0x2e7b07[_0x2f03d6(0x1b5)]},'before':null,'after':_0x2e7b07,'dryRun':![],'backend':{'method':_0x2f03d6(0x1ba),'path':CREATE_PATH},'warnings':_0x1db250,'verification':{'status':_0x2f03d6(0x1d5),'recoveredAfterUnknownResponse':_0x5f48a2,'lookupCommand':'rabetbase\x20kb\x20detail\x20--id\x20'+_0x2e7b07['id']+_0x2f03d6(0x1c9)}},'message':'Created\x20company\x20knowledge\x20base\x20'+_0x2e7b07['id']+_0x2f03d6(0x1d0)+_0x2e7b07[_0x2f03d6(0x1b5)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a142_0xc4e397=a142_0x4ad8;(function(_0x2a2d28,_0x69751c){const _0x2334fa=a142_0x4ad8,_0x5cecbd=_0x2a2d28();while(!![]){try{const _0x34e19f=-parseInt(_0x2334fa(0xf0))/0x1+parseInt(_0x2334fa(0xfa))/0x2+parseInt(_0x2334fa(0xd4))/0x3*(-parseInt(_0x2334fa(0xf8))/0x4)+-parseInt(_0x2334fa(0xea))/0x5*(-parseInt(_0x2334fa(0xde))/0x6)+-parseInt(_0x2334fa(0xf2))/0x7+parseInt(_0x2334fa(0xdf))/0x8+-parseInt(_0x2334fa(0xdb))/0x9;if(_0x34e19f===_0x69751c)break;else _0x5cecbd['push'](_0x5cecbd['shift']());}catch(_0x5455aa){_0x5cecbd['push'](_0x5cecbd['shift']());}}}(a142_0x3ab4,0x3dd9f));import{deleteEnterpriseKnowledgeBase,isPlatformTransportFailure}from'../../core/api-client.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertExpectedKbVersion,getKbOrNull,kbError,projectKb,readKbId,requireKbExplicitYes,verifyKbMutationReadback}from'../../commands/kb/shared.js';const DELETE_PATH=a142_0xc4e397(0xf4),RAG_WARNING=a142_0xc4e397(0xf1),NON_ATOMIC_WARNING=a142_0xc4e397(0xe9);function readExpectedVersion(_0x59d5de){const _0x203606=a142_0xc4e397,_0x52e540=_0x59d5de[_0x203606(0xda)](_0x203606(0xf9));if(_0x52e540===undefined)return undefined;const _0x44d0e9=Number(_0x52e540);if(!Number[_0x203606(0xf3)](_0x44d0e9)||_0x44d0e9<0x0)throw kbError('kb_expected_version_invalid','--expected-version\x20must\x20be\x20a\x20non-negative\x20safe\x20integer.');return _0x44d0e9;}function a142_0x4ad8(_0x1f9098,_0x496e20){_0x1f9098=_0x1f9098-0xd4;const _0x3ab41e=a142_0x3ab4();let _0x4ad845=_0x3ab41e[_0x1f9098];return _0x4ad845;}function noOpData(_0xc6cdd9,_0x2c9f44,_0x236715){const _0x5cc651=a142_0xc4e397;return{'operation':_0x5cc651(0xe1),'selector':{'id':_0x2c9f44,'scope':_0x5cc651(0xd6),'appCode':_0xc6cdd9['appCode']},'before':null,'after':null,'dryRun':_0x236715,'deleteCalled':![],'backend':{'method':'POST','path':DELETE_PATH},'warnings':[],'verification':{'status':_0x5cc651(0xe5),'databaseSoftDelete':!![],'ragCleanup':{'asynchronous':!![],'verified':![]}}};}function a142_0x3ab4(){const _0xfe9420=['2078676XBXCKJ','Non-atomic\x20preflight\x20assertion\x20for\x20the\x20current\x20version','\x20is\x20already\x20absent;\x20no\x20delete\x20request\x20was\x20made','2788278FmjnxB','2022920MRWcKb','kb_verification_failed','no_op','Company\x20knowledge\x20base\x20','verified','\x20remains\x20readable\x20after\x20delete.','already_absent','Company\x20knowledge-base\x20id','Inspect\x20it\x20with\x20`rabetbase\x20kb\x20detail\x20--id\x20','kb_delete_outcome_unknown','--expected-version\x20is\x20a\x20non-atomic\x20read-before-write\x20assertion;\x20the\x20server\x20delete\x20contract\x20has\x20no\x20version\x20predicate.','5NHNYJw','Soft-deleted\x20company\x20knowledge\x20base\x20','delete','\x20--format\x20compress`;\x20do\x20not\x20resubmit\x20automatically.','Soft-delete\x20a\x20company\x20knowledge\x20base\x20for\x20the\x20resolved\x20app','unshift','171533FliNor','Database\x20soft\x20deletion\x20was\x20verified;\x20asynchronous\x20RAG\x20cleanup\x20was\x20not\x20verified\x20by\x20the\x20CLI.','1646134EZRxaD','isSafeInteger','/admin/knowledge-base/delete','rabetbase\x20kb\x20detail\x20--id\x20','POST','Delete\x20response\x20was\x20unavailable;\x20exact-ID\x20not-found\x20readback\x20verified\x20database\x20soft\x20deletion\x20without\x20resubmitting.','4JRlzgu','expected-version','976862oJnjYe','945021QDUNHv','appCode','company','\x20--format\x20compress','high-risk-write','snapshotHash','flag'];a142_0x3ab4=function(){return _0xfe9420;};return a142_0x3ab4();}export const kbDelete={'service':'kb','command':a142_0xc4e397(0xec),'description':a142_0xc4e397(0xee),'risk':a142_0xc4e397(0xd8),'requiresAppCode':!![],'structuredErrors':!![],'flags':[{'name':'id','type':'number','required':!![],'description':a142_0xc4e397(0xe6)},{'name':a142_0xc4e397(0xf9),'type':'number','required':![],'description':a142_0xc4e397(0xdc)}],async 'validate'(_0x4e7d4e){readKbId(_0x4e7d4e),readExpectedVersion(_0x4e7d4e),requireKbExplicitYes(_0x4e7d4e);},async 'dryRun'(_0x53cbaa){const _0x3abefe=a142_0xc4e397,_0x2bea1f=readKbId(_0x53cbaa),_0x2ebb14=readExpectedVersion(_0x53cbaa),_0x3039d7=await getKbOrNull(_0x53cbaa,_0x2bea1f);if(!_0x3039d7)return asDryRunResult(noOpData(_0x53cbaa,_0x2bea1f,!![]),{'method':_0x3abefe(0xf6),'url':DELETE_PATH});assertExpectedKbVersion(_0x3039d7,_0x2ebb14);const _0x3a99b8=projectKb(_0x3039d7),_0x461c5a=[RAG_WARNING];if(_0x2ebb14!==undefined)_0x461c5a[_0x3abefe(0xef)](NON_ATOMIC_WARNING);return asDryRunResult({'operation':'delete','selector':{'id':_0x3a99b8['id'],'scope':'company','appCode':_0x3a99b8[_0x3abefe(0xd5)]},'before':_0x3a99b8,'after':null,'dryRun':!![],'deleteCalled':![],'backend':{'method':_0x3abefe(0xf6),'path':DELETE_PATH},'warnings':_0x461c5a,'verification':{'expectedVersion':_0x2ebb14??null,'atomicCompareAndSet':![],'snapshotHash':_0x3a99b8[_0x3abefe(0xd9)],'databaseSoftDelete':!![],'ragCleanup':{'asynchronous':!![],'verified':![]},'lookupCommand':'rabetbase\x20kb\x20detail\x20--id\x20'+_0x3a99b8['id']+_0x3abefe(0xd7)}},{'method':'POST','url':DELETE_PATH});},async 'execute'(_0x381d8f){const _0xc98078=a142_0xc4e397;requireKbExplicitYes(_0x381d8f);const _0x10430f=readKbId(_0x381d8f),_0x99f3ae=readExpectedVersion(_0x381d8f),_0x1294ed=await getKbOrNull(_0x381d8f,_0x10430f);if(!_0x1294ed)return{'ok':!![],'data':noOpData(_0x381d8f,_0x10430f,![]),'message':_0xc98078(0xe2)+_0x10430f+_0xc98078(0xdd)};assertExpectedKbVersion(_0x1294ed,_0x99f3ae);const _0x5175c5=projectKb(_0x1294ed);let _0x23b642=![];try{await deleteEnterpriseKnowledgeBase(_0x381d8f['cookie'],_0x10430f);}catch(_0xba3dd0){if(!isPlatformTransportFailure(_0xba3dd0))throw _0xba3dd0;_0x23b642=!![];}const _0x2e7b5d=await verifyKbMutationReadback(_0xc98078(0xec),_0x23b642,()=>getKbOrNull(_0x381d8f,_0x10430f));if(_0x2e7b5d)throw kbError(_0x23b642?_0xc98078(0xe8):_0xc98078(0xe0),_0xc98078(0xe2)+_0x10430f+_0xc98078(0xe4),_0xc98078(0xe7)+_0x10430f+_0xc98078(0xed));const _0x248564=[RAG_WARNING];if(_0x99f3ae!==undefined)_0x248564[_0xc98078(0xef)](NON_ATOMIC_WARNING);return _0x23b642&&_0x248564[_0xc98078(0xef)](_0xc98078(0xf7)),{'ok':!![],'data':{'operation':'delete','selector':{'id':_0x5175c5['id'],'scope':_0xc98078(0xd6),'appCode':_0x5175c5['appCode']},'before':_0x5175c5,'after':null,'dryRun':![],'deleteCalled':!![],'backend':{'method':_0xc98078(0xf6),'path':DELETE_PATH},'warnings':_0x248564,'verification':{'status':_0xc98078(0xe3),'databaseSoftDelete':!![],'ragCleanup':{'asynchronous':!![],'verified':![]},'recoveredAfterUnknownResponse':_0x23b642,'lookupCommand':_0xc98078(0xf5)+_0x5175c5['id']+_0xc98078(0xd7)}},'message':_0xc98078(0xeb)+_0x5175c5['id']};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a143_0x2fae92=a143_0x3058;(function(_0x5318fe,_0x5996eb){const _0x2af36a=a143_0x3058,_0x4c5561=_0x5318fe();while(!![]){try{const _0x3f0ea8=-parseInt(_0x2af36a(0x1b7))/0x1+-parseInt(_0x2af36a(0x1ad))/0x2*(-parseInt(_0x2af36a(0x1b5))/0x3)+parseInt(_0x2af36a(0x1b3))/0x4+parseInt(_0x2af36a(0x1b2))/0x5*(-parseInt(_0x2af36a(0x1af))/0x6)+parseInt(_0x2af36a(0x1ae))/0x7*(parseInt(_0x2af36a(0x1bb))/0x8)+parseInt(_0x2af36a(0x1b4))/0x9+-parseInt(_0x2af36a(0x1b1))/0xa;if(_0x3f0ea8===_0x5996eb)break;else _0x4c5561['push'](_0x4c5561['shift']());}catch(_0x38237f){_0x4c5561['push'](_0x4c5561['shift']());}}}(a143_0x314a,0x33955));function a143_0x3058(_0x134014,_0x15dace){_0x134014=_0x134014-0x1ad;const _0x314ad0=a143_0x314a();let _0x30584b=_0x314ad0[_0x134014];return _0x30584b;}import{projectKb,readKbId,requireKb}from'../../commands/kb/shared.js';function a143_0x314a(){const _0x41be5e=['2296fGoGDy','84XCciyS','read','384530xEjduZ','100365GwmVpd','488392LcWRON','1382319jHXHFo','1803YPuMoR','Company\x20knowledge-base\x20id','157105fYfeCS','Loaded\x20company\x20knowledge\x20base\x20','number','detail','9584PrBTJv','64BJudhQ'];a143_0x314a=function(){return _0x41be5e;};return a143_0x314a();}export const kbDetail={'service':'kb','command':a143_0x2fae92(0x1ba),'description':'Show\x20one\x20company\x20knowledge\x20base\x20for\x20the\x20resolved\x20app','risk':a143_0x2fae92(0x1b0),'requiresAppCode':!![],'structuredErrors':!![],'flags':[{'name':'id','type':a143_0x2fae92(0x1b9),'required':!![],'description':a143_0x2fae92(0x1b6)}],async 'validate'(_0x47c08c){readKbId(_0x47c08c);},async 'execute'(_0x340acc){const _0x2ff6cd=a143_0x2fae92,_0x432165=readKbId(_0x340acc),_0x454418=await requireKb(_0x340acc,_0x432165);return{'ok':!![],'data':{'knowledgeBase':projectKb(_0x454418)},'message':_0x2ff6cd(0x1b8)+_0x432165};}};
|
package/lib/commands/kb/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x5ed6f1,_0x297b95){const _0x32841a=a144_0x3d00,_0x1fb3dc=_0x5ed6f1();while(!![]){try{const _0x47c6ea=-parseInt(_0x32841a(0x113))/0x1+parseInt(_0x32841a(0x118))/0x2+parseInt(_0x32841a(0x114))/0x3+-parseInt(_0x32841a(0x112))/0x4+-parseInt(_0x32841a(0x116))/0x5+-parseInt(_0x32841a(0x119))/0x6*(parseInt(_0x32841a(0x115))/0x7)+parseInt(_0x32841a(0x117))/0x8;if(_0x47c6ea===_0x297b95)break;else _0x1fb3dc['push'](_0x1fb3dc['shift']());}catch(_0x5bb1e0){_0x1fb3dc['push'](_0x1fb3dc['shift']());}}}(a144_0x40ee,0x8341d));import{kbList}from'../../commands/kb/list.js';import{kbDetail}from'../../commands/kb/detail.js';import{kbSearch}from'../../commands/kb/search.js';function a144_0x40ee(){const _0x3ffa7f=['906430wIMApB','1542114lpvvxY','77uHOKBf','3231105mPrFZv','19115872vNTFzd','793728cqwdGS','378774nrzVhf','2062748sqUApb'];a144_0x40ee=function(){return _0x3ffa7f;};return a144_0x40ee();}import{kbCreate}from'../../commands/kb/create.js';import{kbUpdate}from'../../commands/kb/update.js';function a144_0x3d00(_0x2f8582,_0x35ec1f){_0x2f8582=_0x2f8582-0x112;const _0x40ee0=a144_0x40ee();let _0x3d00ff=_0x40ee0[_0x2f8582];return _0x3d00ff;}import{kbDelete}from'../../commands/kb/delete.js';export const kbDefinitions=[kbList,kbDetail,kbSearch,kbCreate,kbUpdate,kbDelete];
|
package/lib/commands/kb/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a145_0x2987(_0x276e6b,_0x4be13a){_0x276e6b=_0x276e6b-0x1b6;const _0x2ad070=a145_0x2ad0();let _0x2987d5=_0x2ad070[_0x276e6b];return _0x2987d5;}const a145_0x3cf4f8=a145_0x2987;function a145_0x2ad0(){const _0x543350=['read','List\x20company\x20knowledge\x20bases\x20for\x20the\x20resolved\x20app','str','list','map','3679810lZHyJf','9IyRKPb','189603pbMCFX','485254cgqJxn','trim','685540GczRLm','1097516mgzdgl','title','2mcVKdn','length','1383144qyOPXU','310340QtnNIV','12qUbFqV'];a145_0x2ad0=function(){return _0x543350;};return a145_0x2ad0();}(function(_0x1bc95f,_0x41a1b7){const _0x4447f1=a145_0x2987,_0x1dfb61=_0x1bc95f();while(!![]){try{const _0x1c5ec4=-parseInt(_0x4447f1(0x1be))/0x1+-parseInt(_0x4447f1(0x1bb))/0x2*(parseInt(_0x4447f1(0x1c7))/0x3)+-parseInt(_0x4447f1(0x1b9))/0x4+parseInt(_0x4447f1(0x1b8))/0x5+parseInt(_0x4447f1(0x1bf))/0x6*(parseInt(_0x4447f1(0x1b6))/0x7)+parseInt(_0x4447f1(0x1bd))/0x8+-parseInt(_0x4447f1(0x1c6))/0x9*(-parseInt(_0x4447f1(0x1c5))/0xa);if(_0x1c5ec4===_0x41a1b7)break;else _0x1dfb61['push'](_0x1dfb61['shift']());}catch(_0x346220){_0x1dfb61['push'](_0x1dfb61['shift']());}}}(a145_0x2ad0,0x29302));import{fetchAllCompanyKnowledgeBases,projectKb}from'../../commands/kb/shared.js';export const kbList={'service':'kb','command':a145_0x3cf4f8(0x1c3),'description':a145_0x3cf4f8(0x1c1),'risk':a145_0x3cf4f8(0x1c0),'requiresAppCode':!![],'structuredErrors':!![],'flags':[{'name':a145_0x3cf4f8(0x1ba),'type':'string','required':![],'description':'Filter\x20by\x20knowledge-base\x20title'}],async 'execute'(_0x3668e1){const _0x40727d=a145_0x3cf4f8,_0x5ecb9b=_0x3668e1[_0x40727d(0x1c2)]('title')[_0x40727d(0x1b7)](),_0x430118=await fetchAllCompanyKnowledgeBases(_0x3668e1,{..._0x5ecb9b?{'title':_0x5ecb9b}:{}}),_0x50925b=_0x430118[_0x40727d(0x1c4)](projectKb);return{'ok':!![],'data':{'total':_0x50925b[_0x40727d(0x1bc)],'knowledgeBases':_0x50925b},'message':'Found\x20'+_0x50925b[_0x40727d(0x1bc)]+'\x20company\x20knowledge\x20base(s)\x20for\x20'+_0x3668e1['appCode']};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a146_0x4862(_0x2b3fbc,_0x5cee68){_0x2b3fbc=_0x2b3fbc-0x1c7;const _0x40c29a=a146_0x40c2();let _0x4862ae=_0x40c29a[_0x2b3fbc];return _0x4862ae;}const a146_0x19784c=a146_0x4862;(function(_0x283b88,_0x33a9d7){const _0x5c1ee5=a146_0x4862,_0x3d31b7=_0x283b88();while(!![]){try{const _0x5eec8d=parseInt(_0x5c1ee5(0x1d4))/0x1*(parseInt(_0x5c1ee5(0x1ce))/0x2)+-parseInt(_0x5c1ee5(0x1d3))/0x3*(-parseInt(_0x5c1ee5(0x1d7))/0x4)+parseInt(_0x5c1ee5(0x1d2))/0x5*(-parseInt(_0x5c1ee5(0x1c9))/0x6)+-parseInt(_0x5c1ee5(0x1dd))/0x7*(parseInt(_0x5c1ee5(0x1cc))/0x8)+-parseInt(_0x5c1ee5(0x1d8))/0x9+parseInt(_0x5c1ee5(0x1cb))/0xa+parseInt(_0x5c1ee5(0x1e1))/0xb*(parseInt(_0x5c1ee5(0x1d9))/0xc);if(_0x5eec8d===_0x33a9d7)break;else _0x3d31b7['push'](_0x3d31b7['shift']());}catch(_0x1e304f){_0x3d31b7['push'](_0x3d31b7['shift']());}}}(a146_0x40c2,0x98eff));import{searchDevelopmentKnowledge}from'../../core/kb-search-client.js';import{CliErrors}from'../../errors.js';function readSearchQuery(_0xef1e6b){const _0x237744=a146_0x4862,_0x4ba847=_0xef1e6b[_0x237744(0x1e0)](_0x237744(0x1ca))['trim']();if(!_0x4ba847)throw CliErrors[_0x237744(0x1e2)](_0x237744(0x1d0));return _0x4ba847;}function a146_0x40c2(){const _0x276827=['signal','6DolLMV','query','9213500miZkFy','8zKcspW','Search\x20company\x20and\x20public\x20knowledge\x20for\x20the\x20resolved\x20app','686dwOVCz','search','Search\x20query\x20is\x20required.','Maximum\x20number\x20of\x20knowledge\x20hits\x20to\x20return','5085780Oziyyo','40323THCurP','1564TJkAIM','appCode','string','52yUFzZp','2282112xhLTLN','36NWIELI','isSafeInteger','cookie','number','5086627KGTyxE','flag','topk','str','3634697Zlfemo','validation','Found\x20'];a146_0x40c2=function(){return _0x276827;};return a146_0x40c2();}function readSearchTopK(_0x285395){const _0x4b7b70=a146_0x4862,_0x5afe25=_0x285395[_0x4b7b70(0x1de)]('topk');if(_0x5afe25===undefined||_0x5afe25===null||_0x5afe25==='')return undefined;const _0x7b6e51=_0x285395['num'](_0x4b7b70(0x1df));if(!Number[_0x4b7b70(0x1da)](_0x7b6e51)||_0x7b6e51<0x1||_0x7b6e51>0x32)throw CliErrors[_0x4b7b70(0x1e2)]('--topk\x20must\x20be\x20an\x20integer\x20from\x201\x20through\x2050.');return _0x7b6e51;}export const kbSearch={'service':'kb','command':a146_0x19784c(0x1cf),'description':a146_0x19784c(0x1cd),'risk':'read','requiresAppCode':!![],'structuredErrors':!![],'flags':[{'name':a146_0x19784c(0x1ca),'type':a146_0x19784c(0x1d6),'required':!![],'description':'Company\x20and\x20public\x20knowledge\x20search\x20query'},{'name':'topk','type':a146_0x19784c(0x1dc),'required':![],'description':a146_0x19784c(0x1d1)}],async 'validate'(_0x490068){readSearchQuery(_0x490068),readSearchTopK(_0x490068);},async 'execute'(_0x2c7c2e){const _0x3fed6d=a146_0x19784c,_0x47f9e5=readSearchQuery(_0x2c7c2e),_0xa8a0db=readSearchTopK(_0x2c7c2e),_0x3a1105=await searchDevelopmentKnowledge({'cookie':_0x2c7c2e[_0x3fed6d(0x1db)],'query':_0x47f9e5,'appCode':_0x2c7c2e[_0x3fed6d(0x1d5)],..._0xa8a0db!==undefined?{'topK':_0xa8a0db}:{},'signal':_0x2c7c2e[_0x3fed6d(0x1c8)]});return{'ok':!![],'data':_0x3a1105,'message':_0x3fed6d(0x1c7)+_0x3a1105['total']+'\x20company/public\x20knowledge\x20hit(s)\x20for\x20'+_0x2c7c2e['appCode']};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a137_0x13e0(){const _0x21423f=['kb_file_required','7826445xKrZRJ','version','Run\x20the\x20command\x20with\x20--dry-run\x20again\x20and\x20review\x20the\x20latest\x20version\x20before\x20retrying.','Knowledge-base\x20list\x20stopped\x20at\x20','number','2064776PbMnlj','Cannot\x20read\x20knowledge-base\x20content\x20file:\x20','kb_state_drift','\x20does\x20not\x20belong\x20to\x20company\x20scope\x20for\x20app\x20','kb_','265196cBhkeu','\x20while\x20page\x20','\x20is\x20not\x20company-scoped.','allowEmpty','Do\x20not\x20resubmit\x20automatically.\x20Resolve\x20the\x20app\x20again\x20and\x20inspect\x20the\x20target\x20state\x20manually.','Knowledge-base\x20content\x20file\x20is\x20blank:\x20','length','totalCount','\x20response\x20contains\x20an\x20invalid\x20version.','\x20was\x20requested.','yes','bool','currentPage',',\x20current\x20','utf-8','company','kb_not_found','num','sha256','trim','kb_id_invalid','items','306','paging','appCode','Knowledge-base\x20get-one\x20returned\x20id\x20','scope','Company\x20knowledge\x20base\x20not\x20found:\x20','kb_content_invalid','isSafeInteger','message','isFile','Knowledge-base\x20response\x20contains\x20an\x20invalid\x20id.','\x20records.','hex','\x20to\x20','title','verification_unavailable','Pass\x20--file\x20<knowledge.md>.','content','749045heoRtz','Run\x20`rabetbase\x20kb\x20list\x20--format\x20compress`\x20to\x20inspect\x20the\x20resolved\x20app.','\x20of\x20','updateTime','277726mFJwgC','add','kb_list_contract_invalid','Retry\x20the\x20read\x20after\x20concurrent\x20updates\x20have\x20settled.','Knowledge\x20base\x20','createTime','--id\x20must\x20be\x20a\x20positive\x20safe\x20integer.','string','6sOAcbx','\x20response\x20is\x20missing\x20','\x20while\x20id\x20','268256kJlzkV','byteLength','outcome_unknown','utf8','638116wrSuhj','\x20request\x20was\x20sent,\x20but\x20its\x20final\x20company\x20knowledge-base\x20state\x20could\x20not\x20be\x20verified.','defineProperty','dry-run','cause','kb_file_unreadable','contentHash','3Vtpeaj','Knowledge-base\x20list\x20total\x20changed\x20from\x20','Cannot\x20access\x20knowledge-base\x20content\x20file:\x20','stringify','Knowledge-base\x20content\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','sha256:','kb_confirmation_required','The\x20','update','digest'];a137_0x13e0=function(){return _0x21423f;};return a137_0x13e0();}const a137_0x371ad1=a137_0x16db;(function(_0x586a61,_0x158b38){const _0x54ccfa=a137_0x16db,_0x2d31ca=_0x586a61();while(!![]){try{const _0x149565=parseInt(_0x54ccfa(0x221))/0x1+parseInt(_0x54ccfa(0x1f5))/0x2+-parseInt(_0x54ccfa(0x1e0))/0x3*(-parseInt(_0x54ccfa(0x230))/0x4)+parseInt(_0x54ccfa(0x21d))/0x5+parseInt(_0x54ccfa(0x229))/0x6*(parseInt(_0x54ccfa(0x1f0))/0x7)+parseInt(_0x54ccfa(0x22c))/0x8+-parseInt(_0x54ccfa(0x1eb))/0x9;if(_0x149565===_0x158b38)break;else _0x2d31ca['push'](_0x2d31ca['shift']());}catch(_0x5aaf2f){_0x2d31ca['push'](_0x2d31ca['shift']());}}}(a137_0x13e0,0x2b97d));import{createHash}from'node:crypto';import{readFile,stat}from'node:fs/promises';import{resolve}from'node:path';import{TextDecoder}from'node:util';import{getEnterpriseKnowledgeBase,getPlatformErrorCode,listEnterpriseKnowledgeBases}from'../../core/api-client.js';import{CliError}from'../../errors.js';const LIST_PAGE_SIZE=0x32,DATA_NOT_EXIST_ERROR_CODE=a137_0x371ad1(0x20b);export function kbError(_0x29d801,_0xfaf0a3,_0x1bb992){return new CliError(_0x29d801,0x1,_0xfaf0a3,_0x1bb992);}export function readKbId(_0x40b5b0){const _0x5202ca=a137_0x371ad1,_0x57122e=_0x40b5b0[_0x5202ca(0x206)]('id');if(!Number[_0x5202ca(0x212)](_0x57122e)||_0x57122e<=0x0)throw kbError(_0x5202ca(0x209),_0x5202ca(0x227));return _0x57122e;}function a137_0x16db(_0x22f635,_0x350c64){_0x22f635=_0x22f635-0x1de;const _0x13e064=a137_0x13e0();let _0x16db25=_0x13e064[_0x22f635];return _0x16db25;}export function requireKbExplicitYes(_0x515786){const _0xe31dea=a137_0x371ad1;if(_0x515786['bool'](_0xe31dea(0x233))||_0x515786[_0xe31dea(0x200)](_0xe31dea(0x1ff)))return;throw kbError(_0xe31dea(0x1e6),'This\x20company\x20knowledge-base\x20mutation\x20requires\x20explicit\x20--yes.','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.');}function sha256(_0x39e0da){const _0x306051=a137_0x371ad1;return _0x306051(0x1e5)+createHash(_0x306051(0x207))[_0x306051(0x1e8)](_0x39e0da)[_0x306051(0x1e9)](_0x306051(0x217));}export function inspectKbContent(_0x364ade){const _0x21b580=a137_0x371ad1,_0x52f757=Buffer['from'](_0x364ade,_0x21b580(0x22f));return{'content':_0x364ade,'byteSize':_0x52f757[_0x21b580(0x22d)],'contentHash':sha256(_0x52f757)};}export async function readKbFile(_0x20bace){const _0x3e8ff6=a137_0x371ad1,_0x56338e=_0x20bace[_0x3e8ff6(0x208)]();if(!_0x56338e)throw kbError(_0x3e8ff6(0x1ea),'Knowledge-base\x20content\x20file\x20path\x20is\x20required.',_0x3e8ff6(0x21b));const _0x5281c0=resolve(_0x56338e);let _0x2041d8;try{_0x2041d8=await stat(_0x5281c0);}catch(_0x191867){throw kbError('kb_file_unreadable',_0x3e8ff6(0x1e2)+_0x56338e,_0x191867 instanceof Error?_0x191867[_0x3e8ff6(0x213)]:String(_0x191867));}if(!_0x2041d8[_0x3e8ff6(0x214)]())throw kbError('kb_file_invalid',_0x3e8ff6(0x1e4)+_0x56338e);let _0x1f0001;try{_0x1f0001=await readFile(_0x5281c0);}catch(_0x3da704){throw kbError(_0x3e8ff6(0x1de),_0x3e8ff6(0x1f1)+_0x56338e,_0x3da704 instanceof Error?_0x3da704[_0x3e8ff6(0x213)]:String(_0x3da704));}let _0x1867e3;try{_0x1867e3=new TextDecoder(_0x3e8ff6(0x203),{'fatal':!![],'ignoreBOM':!![]})['decode'](_0x1f0001);}catch{throw kbError(_0x3e8ff6(0x211),'Knowledge-base\x20content\x20file\x20is\x20not\x20valid\x20UTF-8:\x20'+_0x56338e);}if(!_0x1867e3[_0x3e8ff6(0x208)]())throw kbError(_0x3e8ff6(0x211),_0x3e8ff6(0x1fa)+_0x56338e);return inspectKbContent(_0x1867e3);}export async function verifyKbMutationReadback(_0x43b257,_0x788e9c,_0x4cde3f){const _0x4b0639=a137_0x371ad1;try{return await _0x4cde3f();}catch(_0x26a41c){const _0x477734=kbError(_0x4b0639(0x1f4)+_0x43b257+'_'+(_0x788e9c?_0x4b0639(0x22e):_0x4b0639(0x21a)),_0x4b0639(0x1e7)+_0x43b257+_0x4b0639(0x231),_0x4b0639(0x1f9));Object[_0x4b0639(0x232)](_0x477734,_0x4b0639(0x234),{'value':_0x26a41c,'enumerable':![]});throw _0x477734;}}function requireRecordText(_0x15cb4f,_0xb5809,_0x496827,_0x2aa0de={}){const _0x56b6e1=a137_0x371ad1;if(typeof _0x15cb4f===_0x56b6e1(0x228)&&(_0x2aa0de[_0x56b6e1(0x1f8)]||_0x15cb4f[_0x56b6e1(0x208)]()))return _0x15cb4f;throw kbError('kb_response_invalid',_0x56b6e1(0x225)+String(_0x496827)+_0x56b6e1(0x22a)+_0xb5809+'.');}export function projectKb(_0x25a82c){const _0x4ebc74=a137_0x371ad1;if(!Number['isSafeInteger'](_0x25a82c['id'])||_0x25a82c['id']<=0x0)throw kbError('kb_response_invalid',_0x4ebc74(0x215));if(!Number['isSafeInteger'](_0x25a82c[_0x4ebc74(0x1ec)])||_0x25a82c[_0x4ebc74(0x1ec)]<0x0)throw kbError('kb_response_invalid',_0x4ebc74(0x225)+_0x25a82c['id']+_0x4ebc74(0x1fd));if(_0x25a82c[_0x4ebc74(0x20f)]!=='company')throw kbError('kb_scope_mismatch',_0x4ebc74(0x225)+_0x25a82c['id']+_0x4ebc74(0x1f7));const _0x1a64cb=requireRecordText(_0x25a82c[_0x4ebc74(0x20d)],_0x4ebc74(0x20d),_0x25a82c['id']),_0xa44e4f=requireRecordText(_0x25a82c[_0x4ebc74(0x219)],_0x4ebc74(0x219),_0x25a82c['id']),_0x13a7c0=inspectKbContent(requireRecordText(_0x25a82c[_0x4ebc74(0x21c)],_0x4ebc74(0x21c),_0x25a82c['id'],{'allowEmpty':!![]})),_0x4513ca=typeof _0x25a82c['createTime']===_0x4ebc74(0x228)||typeof _0x25a82c[_0x4ebc74(0x226)]===_0x4ebc74(0x1ef)?_0x25a82c[_0x4ebc74(0x226)]:undefined,_0xf614c0=typeof _0x25a82c[_0x4ebc74(0x220)]==='string'||typeof _0x25a82c[_0x4ebc74(0x220)]===_0x4ebc74(0x1ef)?_0x25a82c[_0x4ebc74(0x220)]:undefined,_0x3a3b26=sha256(JSON[_0x4ebc74(0x1e3)]({'id':_0x25a82c['id'],'scope':_0x25a82c[_0x4ebc74(0x20f)],'appCode':_0x1a64cb,'title':_0xa44e4f,'version':_0x25a82c[_0x4ebc74(0x1ec)],'contentHash':_0x13a7c0['contentHash'],'createTime':_0x4513ca,'updateTime':_0xf614c0}));return{'id':_0x25a82c['id'],'scope':_0x4ebc74(0x204),'appCode':_0x1a64cb,'title':_0xa44e4f,'version':_0x25a82c[_0x4ebc74(0x1ec)],'contentByteSize':_0x13a7c0['byteSize'],'contentHash':_0x13a7c0[_0x4ebc74(0x1df)],'snapshotHash':_0x3a3b26,..._0x4513ca!==undefined?{'createTime':_0x4513ca}:{},..._0xf614c0!==undefined?{'updateTime':_0xf614c0}:{}};}export function assertCompanyKnowledgeBase(_0x544411,_0x192c0d,_0xe546fb){const _0x2e3e6b=a137_0x371ad1;if(_0xe546fb!==undefined&&_0x544411['id']!==_0xe546fb)throw kbError('kb_response_invalid',_0x2e3e6b(0x20e)+_0x544411['id']+_0x2e3e6b(0x22b)+_0xe546fb+_0x2e3e6b(0x1fe));if(_0x544411[_0x2e3e6b(0x20f)]!==_0x2e3e6b(0x204)||_0x544411[_0x2e3e6b(0x20d)]!==_0x192c0d)throw kbError('kb_scope_mismatch',_0x2e3e6b(0x225)+_0x544411['id']+_0x2e3e6b(0x1f3)+_0x192c0d+'.');}export async function fetchAllCompanyKnowledgeBases(_0x29a35c,_0x36249a){const _0x226dec=a137_0x371ad1,_0x319177=[],_0x4cf156=new Set();let _0x16c990=0x1,_0x1bd248=0x0,_0x4e4b86;while(!![]){const _0xd21472=await listEnterpriseKnowledgeBases(_0x29a35c['cookie'],{'currentPage':_0x16c990,'pageSize':LIST_PAGE_SIZE,'appCode':_0x29a35c[_0x226dec(0x20d)],..._0x36249a}),_0x283649=_0xd21472['paging']?.[_0x226dec(0x1fc)];if(_0xd21472[_0x226dec(0x20c)]?.[_0x226dec(0x201)]!==undefined&&_0xd21472[_0x226dec(0x20c)][_0x226dec(0x201)]!==_0x16c990)throw kbError('kb_list_contract_invalid','Knowledge-base\x20list\x20returned\x20page\x20'+_0xd21472[_0x226dec(0x20c)][_0x226dec(0x201)]+_0x226dec(0x1f6)+_0x16c990+_0x226dec(0x1fe));if(_0x283649!==undefined){if(_0x4e4b86!==undefined&&_0x283649!==_0x4e4b86)throw kbError(_0x226dec(0x223),_0x226dec(0x1e1)+_0x4e4b86+_0x226dec(0x218)+_0x283649+'\x20during\x20paging.',_0x226dec(0x224));_0x4e4b86=_0x283649;}for(const _0x2e7ef1 of _0xd21472['items']){if(!Number[_0x226dec(0x212)](_0x2e7ef1['id'])||_0x4cf156['has'](_0x2e7ef1['id']))throw kbError(_0x226dec(0x223),'Knowledge-base\x20list\x20returned\x20an\x20invalid\x20or\x20repeated\x20id:\x20'+String(_0x2e7ef1['id'])+'.');_0x4cf156[_0x226dec(0x222)](_0x2e7ef1['id']),_0x2e7ef1[_0x226dec(0x20f)]===_0x226dec(0x204)&&_0x2e7ef1['appCode']===_0x29a35c[_0x226dec(0x20d)]&&_0x319177['push'](_0x2e7ef1);}_0x1bd248+=_0xd21472[_0x226dec(0x20a)][_0x226dec(0x1fb)];if(_0x283649!==undefined&&_0x1bd248>=_0x283649)break;if(_0xd21472['items']['length']<LIST_PAGE_SIZE){if(_0x283649!==undefined&&_0x1bd248<_0x283649)throw kbError(_0x226dec(0x223),_0x226dec(0x1ee)+_0x1bd248+_0x226dec(0x21f)+_0x283649+_0x226dec(0x216));break;}_0x16c990+=0x1;}return _0x319177;}export function findExactCompanyKnowledgeBases(_0x50c5d1,_0x423343,_0x2497d4){const _0x4855fe=a137_0x371ad1;return _0x50c5d1['filter'](_0x4f095d=>_0x4f095d[_0x4855fe(0x20f)]===_0x4855fe(0x204)&&_0x4f095d[_0x4855fe(0x20d)]===_0x423343&&_0x4f095d['title']===_0x2497d4);}export async function getKbOrNull(_0x34e15d,_0x16dffb){try{const _0x3bb5e1=await getEnterpriseKnowledgeBase(_0x34e15d['cookie'],_0x16dffb);return assertCompanyKnowledgeBase(_0x3bb5e1,_0x34e15d['appCode'],_0x16dffb),_0x3bb5e1;}catch(_0x3c8134){if(getPlatformErrorCode(_0x3c8134)===DATA_NOT_EXIST_ERROR_CODE)return null;throw _0x3c8134;}}export async function requireKb(_0x2e93c9,_0x5c0c09){const _0x27a4ea=a137_0x371ad1,_0x4c13c7=await getKbOrNull(_0x2e93c9,_0x5c0c09);if(!_0x4c13c7)throw kbError(_0x27a4ea(0x205),_0x27a4ea(0x210)+_0x5c0c09,_0x27a4ea(0x21e));return _0x4c13c7;}export function assertExpectedKbVersion(_0x3997ca,_0x184367){const _0x1d5e83=a137_0x371ad1;if(_0x184367===undefined||_0x3997ca[_0x1d5e83(0x1ec)]===_0x184367)return;throw kbError(_0x1d5e83(0x1f2),'Knowledge\x20base\x20'+_0x3997ca['id']+'\x20version\x20changed:\x20expected\x20'+_0x184367+_0x1d5e83(0x202)+_0x3997ca[_0x1d5e83(0x1ec)]+'.',_0x1d5e83(0x1ed));}
|
|
1
|
+
const a147_0x2f013e=a147_0x483a;(function(_0x4084c0,_0x1dd94d){const _0x241869=a147_0x483a,_0x4eba8=_0x4084c0();while(!![]){try{const _0x554e4e=-parseInt(_0x241869(0x104))/0x1+parseInt(_0x241869(0x11e))/0x2+-parseInt(_0x241869(0x14c))/0x3*(-parseInt(_0x241869(0x14f))/0x4)+parseInt(_0x241869(0x135))/0x5*(parseInt(_0x241869(0x147))/0x6)+-parseInt(_0x241869(0x133))/0x7*(parseInt(_0x241869(0x13b))/0x8)+-parseInt(_0x241869(0x138))/0x9*(parseInt(_0x241869(0x114))/0xa)+-parseInt(_0x241869(0x11a))/0xb*(-parseInt(_0x241869(0x149))/0xc);if(_0x554e4e===_0x1dd94d)break;else _0x4eba8['push'](_0x4eba8['shift']());}catch(_0x370f6b){_0x4eba8['push'](_0x4eba8['shift']());}}}(a147_0x566a,0xa8a2d));import{createHash}from'node:crypto';import{readFile,stat}from'node:fs/promises';function a147_0x483a(_0x127f6d,_0xb833ff){_0x127f6d=_0x127f6d-0x104;const _0x566a05=a147_0x566a();let _0x483ae2=_0x566a05[_0x127f6d];return _0x483ae2;}import{resolve}from'node:path';import{TextDecoder}from'node:util';import{getEnterpriseKnowledgeBase,getPlatformErrorCode,listEnterpriseKnowledgeBases}from'../../core/api-client.js';import{CliError}from'../../errors.js';const LIST_PAGE_SIZE=0x32,DATA_NOT_EXIST_ERROR_CODE=a147_0x2f013e(0x10d);export function kbError(_0x4cbe0b,_0x237c86,_0x425e52){return new CliError(_0x4cbe0b,0x1,_0x237c86,_0x425e52);}export function readKbId(_0x261760){const _0x30426a=a147_0x2f013e,_0x109415=_0x261760[_0x30426a(0x121)]('id');if(!Number[_0x30426a(0x115)](_0x109415)||_0x109415<=0x0)throw kbError(_0x30426a(0x145),'--id\x20must\x20be\x20a\x20positive\x20safe\x20integer.');return _0x109415;}export function requireKbExplicitYes(_0x19d53a){const _0x14ea89=a147_0x2f013e;if(_0x19d53a[_0x14ea89(0x118)](_0x14ea89(0x13f))||_0x19d53a[_0x14ea89(0x118)](_0x14ea89(0x11f)))return;throw kbError('kb_confirmation_required',_0x14ea89(0x11c),'Run\x20the\x20same\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.');}function sha256(_0x42a5c1){const _0x13a381=a147_0x2f013e;return _0x13a381(0x119)+createHash('sha256')[_0x13a381(0x117)](_0x42a5c1)[_0x13a381(0x107)]('hex');}export function inspectKbContent(_0x27baaa){const _0x1fb26a=a147_0x2f013e,_0x2e112e=Buffer['from'](_0x27baaa,'utf8');return{'content':_0x27baaa,'byteSize':_0x2e112e[_0x1fb26a(0x13a)],'contentHash':sha256(_0x2e112e)};}export async function readKbFile(_0x25745a){const _0x46b47c=a147_0x2f013e,_0x3a795b=_0x25745a['trim']();if(!_0x3a795b)throw kbError(_0x46b47c(0x14e),'Knowledge-base\x20content\x20file\x20path\x20is\x20required.',_0x46b47c(0x141));const _0x371c6b=resolve(_0x3a795b);let _0x31ecd2;try{_0x31ecd2=await stat(_0x371c6b);}catch(_0x45d059){throw kbError(_0x46b47c(0x154),_0x46b47c(0x12c)+_0x3a795b,_0x45d059 instanceof Error?_0x45d059[_0x46b47c(0x129)]:String(_0x45d059));}if(!_0x31ecd2[_0x46b47c(0x156)]())throw kbError('kb_file_invalid','Knowledge-base\x20content\x20path\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x3a795b);let _0x438ed8;try{_0x438ed8=await readFile(_0x371c6b);}catch(_0x25dca6){throw kbError('kb_file_unreadable',_0x46b47c(0x155)+_0x3a795b,_0x25dca6 instanceof Error?_0x25dca6[_0x46b47c(0x129)]:String(_0x25dca6));}let _0x3c7a51;try{_0x3c7a51=new TextDecoder(_0x46b47c(0x13c),{'fatal':!![],'ignoreBOM':!![]})[_0x46b47c(0x140)](_0x438ed8);}catch{throw kbError(_0x46b47c(0x127),'Knowledge-base\x20content\x20file\x20is\x20not\x20valid\x20UTF-8:\x20'+_0x3a795b);}if(!_0x3c7a51[_0x46b47c(0x111)]())throw kbError(_0x46b47c(0x127),_0x46b47c(0x122)+_0x3a795b);return inspectKbContent(_0x3c7a51);}function a147_0x566a(){const _0x58625e=['add','number','dry-run','decode','Pass\x20--file\x20<knowledge.md>.','contentHash',',\x20current\x20','\x20response\x20contains\x20an\x20invalid\x20version.','kb_id_invalid','\x20records.','18YTyRqo','kb_response_invalid','672iGVbTW','company','totalCount','135852mbTIPN','Run\x20the\x20command\x20with\x20--dry-run\x20again\x20and\x20review\x20the\x20latest\x20version\x20before\x20retrying.','kb_file_required','4LxWzwA','title','\x20response\x20is\x20missing\x20','createTime','\x20is\x20not\x20company-scoped.','kb_file_unreadable','Cannot\x20read\x20knowledge-base\x20content\x20file:\x20','isFile','188874CysSNi','byteSize','kb_list_contract_invalid','digest','items','currentPage','Company\x20knowledge\x20base\x20not\x20found:\x20','paging','filter','306','defineProperty','length','kb_','trim','\x20was\x20requested.','kb_scope_mismatch','830LMVOOS','isSafeInteger','appCode','update','bool','sha256:','114180WixqeG','\x20of\x20','This\x20company\x20knowledge-base\x20mutation\x20requires\x20explicit\x20--yes.','Knowledge\x20base\x20','2437220RxNIzM','yes','\x20while\x20id\x20','num','Knowledge-base\x20content\x20file\x20is\x20blank:\x20','has','allowEmpty','Knowledge-base\x20list\x20returned\x20an\x20invalid\x20or\x20repeated\x20id:\x20','\x20request\x20was\x20sent,\x20but\x20its\x20final\x20company\x20knowledge-base\x20state\x20could\x20not\x20be\x20verified.','kb_content_invalid','string','message','content','verification_unavailable','Cannot\x20access\x20knowledge-base\x20content\x20file:\x20','\x20does\x20not\x20belong\x20to\x20company\x20scope\x20for\x20app\x20','version','Knowledge-base\x20list\x20stopped\x20at\x20','updateTime','cause','stringify','272237hxBKgG','Knowledge-base\x20get-one\x20returned\x20id\x20','2288995XdneuA','push','\x20version\x20changed:\x20expected\x20','139761pPaeaG','scope','byteLength','216WLCBGF','utf-8'];a147_0x566a=function(){return _0x58625e;};return a147_0x566a();}export async function verifyKbMutationReadback(_0x4bdfb0,_0x74f1bb,_0x2bf7d8){const _0x594086=a147_0x2f013e;try{return await _0x2bf7d8();}catch(_0x314437){const _0x131932=kbError(_0x594086(0x110)+_0x4bdfb0+'_'+(_0x74f1bb?'outcome_unknown':_0x594086(0x12b)),'The\x20'+_0x4bdfb0+_0x594086(0x126),'Do\x20not\x20resubmit\x20automatically.\x20Resolve\x20the\x20app\x20again\x20and\x20inspect\x20the\x20target\x20state\x20manually.');Object[_0x594086(0x10e)](_0x131932,_0x594086(0x131),{'value':_0x314437,'enumerable':![]});throw _0x131932;}}function requireRecordText(_0x3f116,_0x17d2a3,_0x1c0a73,_0x1a0d12={}){const _0x264e17=a147_0x2f013e;if(typeof _0x3f116===_0x264e17(0x128)&&(_0x1a0d12[_0x264e17(0x124)]||_0x3f116['trim']()))return _0x3f116;throw kbError('kb_response_invalid',_0x264e17(0x11d)+String(_0x1c0a73)+_0x264e17(0x151)+_0x17d2a3+'.');}export function projectKb(_0x570d86){const _0x4fdbcd=a147_0x2f013e;if(!Number[_0x4fdbcd(0x115)](_0x570d86['id'])||_0x570d86['id']<=0x0)throw kbError(_0x4fdbcd(0x148),'Knowledge-base\x20response\x20contains\x20an\x20invalid\x20id.');if(!Number[_0x4fdbcd(0x115)](_0x570d86['version'])||_0x570d86[_0x4fdbcd(0x12e)]<0x0)throw kbError(_0x4fdbcd(0x148),_0x4fdbcd(0x11d)+_0x570d86['id']+_0x4fdbcd(0x144));if(_0x570d86[_0x4fdbcd(0x139)]!=='company')throw kbError(_0x4fdbcd(0x113),_0x4fdbcd(0x11d)+_0x570d86['id']+_0x4fdbcd(0x153));const _0x417ef7=requireRecordText(_0x570d86[_0x4fdbcd(0x116)],_0x4fdbcd(0x116),_0x570d86['id']),_0x5a3beb=requireRecordText(_0x570d86[_0x4fdbcd(0x150)],'title',_0x570d86['id']),_0x37ba94=inspectKbContent(requireRecordText(_0x570d86[_0x4fdbcd(0x12a)],'content',_0x570d86['id'],{'allowEmpty':!![]})),_0x3a3464=typeof _0x570d86[_0x4fdbcd(0x152)]===_0x4fdbcd(0x128)||typeof _0x570d86['createTime']===_0x4fdbcd(0x13e)?_0x570d86[_0x4fdbcd(0x152)]:undefined,_0x5601dd=typeof _0x570d86['updateTime']==='string'||typeof _0x570d86[_0x4fdbcd(0x130)]===_0x4fdbcd(0x13e)?_0x570d86[_0x4fdbcd(0x130)]:undefined,_0x2c220a=sha256(JSON[_0x4fdbcd(0x132)]({'id':_0x570d86['id'],'scope':_0x570d86[_0x4fdbcd(0x139)],'appCode':_0x417ef7,'title':_0x5a3beb,'version':_0x570d86[_0x4fdbcd(0x12e)],'contentHash':_0x37ba94[_0x4fdbcd(0x142)],'createTime':_0x3a3464,'updateTime':_0x5601dd}));return{'id':_0x570d86['id'],'scope':_0x4fdbcd(0x14a),'appCode':_0x417ef7,'title':_0x5a3beb,'version':_0x570d86[_0x4fdbcd(0x12e)],'contentByteSize':_0x37ba94[_0x4fdbcd(0x105)],'contentHash':_0x37ba94[_0x4fdbcd(0x142)],'snapshotHash':_0x2c220a,..._0x3a3464!==undefined?{'createTime':_0x3a3464}:{},..._0x5601dd!==undefined?{'updateTime':_0x5601dd}:{}};}export function assertCompanyKnowledgeBase(_0x1b0533,_0x37a120,_0x90132f){const _0x126906=a147_0x2f013e;if(_0x90132f!==undefined&&_0x1b0533['id']!==_0x90132f)throw kbError(_0x126906(0x148),_0x126906(0x134)+_0x1b0533['id']+_0x126906(0x120)+_0x90132f+_0x126906(0x112));if(_0x1b0533[_0x126906(0x139)]!==_0x126906(0x14a)||_0x1b0533[_0x126906(0x116)]!==_0x37a120)throw kbError('kb_scope_mismatch',_0x126906(0x11d)+_0x1b0533['id']+_0x126906(0x12d)+_0x37a120+'.');}export async function fetchAllCompanyKnowledgeBases(_0x1527fa,_0x1ab6b7){const _0x17808e=a147_0x2f013e,_0x240558=[],_0x133d94=new Set();let _0x5870c1=0x1,_0x2c7699=0x0,_0x5c141c;while(!![]){const _0x476d43=await listEnterpriseKnowledgeBases(_0x1527fa['cookie'],{'currentPage':_0x5870c1,'pageSize':LIST_PAGE_SIZE,'appCode':_0x1527fa[_0x17808e(0x116)],..._0x1ab6b7}),_0x473bfe=_0x476d43['paging']?.[_0x17808e(0x14b)];if(_0x476d43[_0x17808e(0x10b)]?.['currentPage']!==undefined&&_0x476d43[_0x17808e(0x10b)][_0x17808e(0x109)]!==_0x5870c1)throw kbError('kb_list_contract_invalid','Knowledge-base\x20list\x20returned\x20page\x20'+_0x476d43[_0x17808e(0x10b)][_0x17808e(0x109)]+'\x20while\x20page\x20'+_0x5870c1+_0x17808e(0x112));if(_0x473bfe!==undefined){if(_0x5c141c!==undefined&&_0x473bfe!==_0x5c141c)throw kbError('kb_list_contract_invalid','Knowledge-base\x20list\x20total\x20changed\x20from\x20'+_0x5c141c+'\x20to\x20'+_0x473bfe+'\x20during\x20paging.','Retry\x20the\x20read\x20after\x20concurrent\x20updates\x20have\x20settled.');_0x5c141c=_0x473bfe;}for(const _0x13a502 of _0x476d43['items']){if(!Number[_0x17808e(0x115)](_0x13a502['id'])||_0x133d94[_0x17808e(0x123)](_0x13a502['id']))throw kbError(_0x17808e(0x106),_0x17808e(0x125)+String(_0x13a502['id'])+'.');_0x133d94[_0x17808e(0x13d)](_0x13a502['id']),_0x13a502['scope']===_0x17808e(0x14a)&&_0x13a502[_0x17808e(0x116)]===_0x1527fa['appCode']&&_0x240558[_0x17808e(0x136)](_0x13a502);}_0x2c7699+=_0x476d43['items']['length'];if(_0x473bfe!==undefined&&_0x2c7699>=_0x473bfe)break;if(_0x476d43[_0x17808e(0x108)][_0x17808e(0x10f)]<LIST_PAGE_SIZE){if(_0x473bfe!==undefined&&_0x2c7699<_0x473bfe)throw kbError('kb_list_contract_invalid',_0x17808e(0x12f)+_0x2c7699+_0x17808e(0x11b)+_0x473bfe+_0x17808e(0x146));break;}_0x5870c1+=0x1;}return _0x240558;}export function findExactCompanyKnowledgeBases(_0x136700,_0x235f4c,_0x1f4b23){const _0x9656c9=a147_0x2f013e;return _0x136700[_0x9656c9(0x10c)](_0x2f01f5=>_0x2f01f5['scope']===_0x9656c9(0x14a)&&_0x2f01f5[_0x9656c9(0x116)]===_0x235f4c&&_0x2f01f5['title']===_0x1f4b23);}export async function getKbOrNull(_0x3654f9,_0x1dd8b9){const _0x24dc46=a147_0x2f013e;try{const _0x1baff7=await getEnterpriseKnowledgeBase(_0x3654f9['cookie'],_0x1dd8b9);return assertCompanyKnowledgeBase(_0x1baff7,_0x3654f9[_0x24dc46(0x116)],_0x1dd8b9),_0x1baff7;}catch(_0x35ecca){if(getPlatformErrorCode(_0x35ecca)===DATA_NOT_EXIST_ERROR_CODE)return null;throw _0x35ecca;}}export async function requireKb(_0x375d37,_0x32aef7){const _0x4b8f32=a147_0x2f013e,_0x144822=await getKbOrNull(_0x375d37,_0x32aef7);if(!_0x144822)throw kbError('kb_not_found',_0x4b8f32(0x10a)+_0x32aef7,'Run\x20`rabetbase\x20kb\x20list\x20--format\x20compress`\x20to\x20inspect\x20the\x20resolved\x20app.');return _0x144822;}export function assertExpectedKbVersion(_0xbd3e3a,_0x10ec01){const _0x1fbad3=a147_0x2f013e;if(_0x10ec01===undefined||_0xbd3e3a['version']===_0x10ec01)return;throw kbError('kb_state_drift',_0x1fbad3(0x11d)+_0xbd3e3a['id']+_0x1fbad3(0x137)+_0x10ec01+_0x1fbad3(0x143)+_0xbd3e3a['version']+'.',_0x1fbad3(0x14d));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a148_0x1f6689=a148_0x590b;(function(_0x253889,_0x1e5a59){const _0x354d02=a148_0x590b,_0x5561a7=_0x253889();while(!![]){try{const _0x57d74f=parseInt(_0x354d02(0x193))/0x1+parseInt(_0x354d02(0x184))/0x2*(-parseInt(_0x354d02(0x1b0))/0x3)+-parseInt(_0x354d02(0x192))/0x4+-parseInt(_0x354d02(0x19d))/0x5+-parseInt(_0x354d02(0x18c))/0x6*(parseInt(_0x354d02(0x1a1))/0x7)+parseInt(_0x354d02(0x182))/0x8+parseInt(_0x354d02(0x1ad))/0x9*(parseInt(_0x354d02(0x1a4))/0xa);if(_0x57d74f===_0x1e5a59)break;else _0x5561a7['push'](_0x5561a7['shift']());}catch(_0x74bdaa){_0x5561a7['push'](_0x5561a7['shift']());}}}(a148_0x52f4,0x4c6f2));import{isPlatformTransportFailure,updateEnterpriseKnowledgeBase}from'../../core/api-client.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCompanyKnowledgeBase,assertExpectedKbVersion,inspectKbContent,kbError,projectKb,readKbFile,readKbId,requireKb,verifyKbMutationReadback}from'../../commands/kb/shared.js';const UPDATE_PATH='/admin/knowledge-base/update',NON_ATOMIC_WARNING='--expected-version\x20is\x20a\x20non-atomic\x20read-before-write\x20assertion;\x20the\x20server\x20update\x20contract\x20has\x20no\x20version\x20predicate.';function readUpdatePatch(_0x42ce8f){const _0x30202e=a148_0x590b,_0x2d25a3=readKbId(_0x42ce8f),_0x5857ae=_0x42ce8f[_0x30202e(0x18d)](_0x30202e(0x1a5)),_0x5daec2=_0x42ce8f['flag'](_0x30202e(0x18e)),_0x101a78=_0x42ce8f[_0x30202e(0x18d)]('expected-version'),_0x5bf0ea=_0x5857ae===undefined?undefined:String(_0x5857ae)['trim']();if(_0x5857ae!==undefined&&!_0x5bf0ea)throw kbError(_0x30202e(0x1a6),_0x30202e(0x19a));const _0x1a889d=_0x5daec2===undefined?undefined:String(_0x5daec2)[_0x30202e(0x183)]();if(_0x5daec2!==undefined&&!_0x1a889d)throw kbError(_0x30202e(0x1a2),_0x30202e(0x188));if(_0x5bf0ea===undefined&&_0x1a889d===undefined)throw kbError(_0x30202e(0x1af),_0x30202e(0x1a9),_0x30202e(0x1ab));let _0x4fc4d2;if(_0x101a78!==undefined){_0x4fc4d2=Number(_0x101a78);if(!Number['isSafeInteger'](_0x4fc4d2)||_0x4fc4d2<0x0)throw kbError(_0x30202e(0x197),'--expected-version\x20must\x20be\x20a\x20non-negative\x20safe\x20integer.');}return{'id':_0x2d25a3,'title':_0x5bf0ea,'file':_0x1a889d,'expectedVersion':_0x4fc4d2};}function a148_0x590b(_0x192276,_0x3ea898){_0x192276=_0x192276-0x17f;const _0x52f480=a148_0x52f4();let _0x590bb3=_0x52f480[_0x192276];return _0x590bb3;}function a148_0x52f4(){const _0x5a3eb=['1469140jJtoUF','367490ZgxiTO','push','Inspect\x20it\x20with\x20`rabetbase\x20kb\x20detail\x20--id\x20','cookie','kb_expected_version_invalid','\x20--format\x20compress`;\x20do\x20not\x20resubmit\x20automatically.','Replacement\x20UTF-8\x20text\x20or\x20Markdown\x20content\x20file','--title\x20cannot\x20be\x20empty.','Update\x20a\x20company\x20knowledge\x20base\x20with\x20preflight\x20drift\x20protection','version','377225zFnmuL','patch','company','write','287wmOXWd','kb_file_required','snapshotHash','13220110zFVPNf','title','kb_title_invalid','content','\x20--format\x20compress','Nothing\x20to\x20update.','New\x20knowledge-base\x20title','Pass\x20at\x20least\x20one\x20of\x20--title\x20or\x20--file.','POST','9VpUcau','\x20does\x20not\x20prove\x20the\x20requested\x20update\x20state.','kb_update_empty','12783HVJohu','update','string','expectedVersion','before','appCode','1114400wvczku','trim','228CTZRmU','contentHash','kb_verification_failed','Company\x20knowledge-base\x20id','--file\x20cannot\x20be\x20empty.','expected-version','rabetbase\x20kb\x20detail\x20--id\x20','Update\x20response\x20was\x20unavailable;\x20verified\x20applicable\x20postconditions\x20by\x20exact\x20ID\x20without\x20resubmitting.','85938Wnlxus','flag','file','replacement','Updated\x20company\x20knowledge\x20base\x20','beforeRecord'];a148_0x52f4=function(){return _0x5a3eb;};return a148_0x52f4();}async function prepareUpdate(_0x181aec){const _0x4dcf0f=a148_0x590b,_0x55ed04=readUpdatePatch(_0x181aec),_0x51384e=await requireKb(_0x181aec,_0x55ed04['id']);assertExpectedKbVersion(_0x51384e,_0x55ed04[_0x4dcf0f(0x17f)]);const _0x1dc31c=_0x55ed04['file']?await readKbFile(_0x55ed04[_0x4dcf0f(0x18e)]):undefined,_0x20ca27=projectKb(_0x51384e),_0x22adfc=projectKb({..._0x51384e,..._0x55ed04[_0x4dcf0f(0x1a5)]!==undefined?{'title':_0x55ed04[_0x4dcf0f(0x1a5)]}:{},..._0x1dc31c?{'content':_0x1dc31c[_0x4dcf0f(0x1a7)]}:{}});return{'patch':_0x55ed04,'beforeRecord':_0x51384e,'before':_0x20ca27,'planned':_0x22adfc,'replacement':_0x1dc31c};}export const kbUpdate={'service':'kb','command':'update','description':a148_0x1f6689(0x19b),'risk':a148_0x1f6689(0x1a0),'requiresAppCode':!![],'structuredErrors':!![],'flags':[{'name':'id','type':'number','required':!![],'description':a148_0x1f6689(0x187)},{'name':a148_0x1f6689(0x1a5),'type':a148_0x1f6689(0x1b2),'required':![],'description':a148_0x1f6689(0x1aa)},{'name':'file','type':a148_0x1f6689(0x1b2),'required':![],'description':a148_0x1f6689(0x199)},{'name':a148_0x1f6689(0x189),'type':'number','required':![],'description':'Non-atomic\x20preflight\x20assertion\x20for\x20the\x20current\x20version'}],async 'validate'(_0x595630){readUpdatePatch(_0x595630);},async 'dryRun'(_0x5dc6df){const _0xec4dbf=a148_0x1f6689,_0x19a249=await prepareUpdate(_0x5dc6df),_0x2ed9a3=_0x19a249['patch'][_0xec4dbf(0x17f)]!==undefined?[NON_ATOMIC_WARNING]:[];return asDryRunResult({'operation':'update','selector':{'id':_0x19a249[_0xec4dbf(0x180)]['id'],'scope':_0xec4dbf(0x19f),'appCode':_0x19a249[_0xec4dbf(0x180)]['appCode']},'before':_0x19a249[_0xec4dbf(0x180)],'after':_0x19a249['planned'],'dryRun':!![],'backend':{'method':_0xec4dbf(0x1ac),'path':UPDATE_PATH},'warnings':_0x2ed9a3,'verification':{'expectedVersion':_0x19a249[_0xec4dbf(0x19e)][_0xec4dbf(0x17f)]??null,'atomicCompareAndSet':![],'plannedSnapshotHash':_0x19a249[_0xec4dbf(0x180)][_0xec4dbf(0x1a3)],'lookupCommand':_0xec4dbf(0x18a)+_0x19a249[_0xec4dbf(0x180)]['id']+_0xec4dbf(0x1a8)}},{'method':_0xec4dbf(0x1ac),'url':UPDATE_PATH});},async 'execute'(_0x4c66fa){const _0x20d743=a148_0x1f6689,_0x514c17=await prepareUpdate(_0x4c66fa),_0x2da26e={'id':_0x514c17[_0x20d743(0x19e)]['id'],..._0x514c17[_0x20d743(0x19e)][_0x20d743(0x1a5)]!==undefined?{'title':_0x514c17[_0x20d743(0x19e)][_0x20d743(0x1a5)]}:{},..._0x514c17[_0x20d743(0x18f)]?{'content':_0x514c17[_0x20d743(0x18f)][_0x20d743(0x1a7)]}:{}};let _0x24d7bf=![];try{const _0x5bda6a=await updateEnterpriseKnowledgeBase(_0x4c66fa[_0x20d743(0x196)],_0x2da26e);assertCompanyKnowledgeBase(_0x5bda6a,_0x4c66fa[_0x20d743(0x181)],_0x514c17[_0x20d743(0x19e)]['id']);}catch(_0x299010){if(!isPlatformTransportFailure(_0x299010))throw _0x299010;_0x24d7bf=!![];}const _0x57dffc=await verifyKbMutationReadback(_0x20d743(0x1b1),_0x24d7bf,()=>requireKb(_0x4c66fa,_0x514c17[_0x20d743(0x19e)]['id'])),_0x265946=projectKb(_0x57dffc),_0xa9e6c2=_0x514c17[_0x20d743(0x19e)][_0x20d743(0x1a5)]===undefined||_0x57dffc[_0x20d743(0x1a5)]===_0x514c17[_0x20d743(0x19e)]['title'],_0x4aa5f=!_0x514c17[_0x20d743(0x18f)]||inspectKbContent(_0x57dffc[_0x20d743(0x1a7)])[_0x20d743(0x185)]===_0x514c17[_0x20d743(0x18f)][_0x20d743(0x185)],_0x656f4e=!_0x514c17[_0x20d743(0x18f)]||_0x57dffc[_0x20d743(0x19c)]>_0x514c17[_0x20d743(0x191)]['version'],_0x35798e=!_0x24d7bf||_0x514c17[_0x20d743(0x18f)]!==undefined||_0x514c17['patch'][_0x20d743(0x1a5)]===undefined||_0x514c17[_0x20d743(0x191)]['title']!==_0x514c17['patch'][_0x20d743(0x1a5)];if(!_0xa9e6c2||!_0x4aa5f||!_0x656f4e||!_0x35798e)throw kbError(_0x24d7bf?'kb_update_outcome_unknown':_0x20d743(0x186),'Company\x20knowledge\x20base\x20'+_0x514c17[_0x20d743(0x19e)]['id']+_0x20d743(0x1ae),_0x20d743(0x195)+_0x514c17['patch']['id']+_0x20d743(0x198));const _0x17629f=[];return _0x514c17[_0x20d743(0x19e)][_0x20d743(0x17f)]!==undefined&&_0x17629f[_0x20d743(0x194)](NON_ATOMIC_WARNING),_0x24d7bf&&_0x17629f[_0x20d743(0x194)](_0x20d743(0x18b)),{'ok':!![],'data':{'operation':'update','selector':{'id':_0x265946['id'],'scope':_0x20d743(0x19f),'appCode':_0x265946[_0x20d743(0x181)]},'before':_0x514c17[_0x20d743(0x180)],'after':_0x265946,'dryRun':![],'backend':{'method':_0x20d743(0x1ac),'path':UPDATE_PATH},'warnings':_0x17629f,'verification':{'status':'verified','recoveredAfterUnknownResponse':_0x24d7bf,'expectedVersion':_0x514c17[_0x20d743(0x19e)][_0x20d743(0x17f)]??null,'atomicCompareAndSet':![],'lookupCommand':_0x20d743(0x18a)+_0x265946['id']+_0x20d743(0x1a8)}},'message':_0x20d743(0x190)+_0x265946['id']};}};
|