@lovrabet/rabetbase-cli 2.5.13 → 2.6.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -17
- package/lib/api/api-doc.js +3 -1
- package/lib/api/api-group.js +3 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +8 -1
- package/lib/api/generate-sdk-config-file.js +1 -1
- package/lib/api/legacy-api-file.js +2 -1
- package/lib/api/model-registry-file.js +11 -1
- package/lib/api/model-registry-scaffold.js +2 -1
- package/lib/api/model-source.js +3 -1
- package/lib/auth/auth-server-ui.js +2 -1
- package/lib/auth/auth-server.js +5 -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 +3 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +5 -1
- package/lib/commands/api/generate.js +4 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +2 -1
- package/lib/commands/api/pull.js +10 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/detail.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +5 -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 +4 -1
- package/lib/commands/app-config/delete.js +2 -1
- package/lib/commands/app-config/get.js +2 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +2 -1
- package/lib/commands/app-config/set.js +3 -1
- package/lib/commands/app-config/shared.d.ts +9 -2
- package/lib/commands/app-config/shared.js +6 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +11 -1
- package/lib/commands/bff/delete.js +6 -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 +4 -1
- package/lib/commands/bff/pull.js +22 -1
- package/lib/commands/bff/push.js +16 -1
- package/lib/commands/bff/status.js +3 -1
- package/lib/commands/cli-skill/index.js +2 -1
- package/lib/commands/cli-update.js +7 -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 +4 -1
- package/lib/commands/common/app-selector.js +4 -1
- package/lib/commands/common/async-task.js +2 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +3 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/delete.js +2 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.js +5 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +4 -1
- package/lib/commands/config/shared.js +2 -1
- package/lib/commands/dataset/batch-design.js +9 -1
- package/lib/commands/dataset/business-group-update.js +10 -1
- package/lib/commands/dataset/business-groups.js +1 -1
- package/lib/commands/dataset/capability.js +3 -1
- package/lib/commands/dataset/cross-relation-create.js +2 -1
- package/lib/commands/dataset/cross-relation-delete.js +1 -1
- package/lib/commands/dataset/cross-relation-list.js +2 -1
- package/lib/commands/dataset/cross-relation-shared.js +10 -1
- package/lib/commands/dataset/cross-relation-update.js +2 -1
- package/lib/commands/dataset/delete.js +6 -1
- package/lib/commands/dataset/design-context.js +1 -1
- package/lib/commands/dataset/design-start.js +1 -1
- package/lib/commands/dataset/design-status.js +1 -1
- package/lib/commands/dataset/design-sync-retry.js +1 -1
- package/lib/commands/dataset/design-sync-status.js +1 -1
- package/lib/commands/dataset/design-validate.js +1 -1
- package/lib/commands/dataset/detail.js +5 -1
- package/lib/commands/dataset/extend-update.js +7 -1
- package/lib/commands/dataset/field-restore.js +7 -1
- package/lib/commands/dataset/field-update.js +7 -1
- package/lib/commands/dataset/generate.js +19 -1
- package/lib/commands/dataset/index.js +3 -1
- package/lib/commands/dataset/list.js +2 -1
- package/lib/commands/dataset/operations.js +2 -1
- package/lib/commands/dataset/relation-audit.js +7 -1
- package/lib/commands/dataset/relation-create.js +3 -1
- package/lib/commands/dataset/relation-delete.js +3 -1
- package/lib/commands/dataset/relation-shared.js +21 -1
- package/lib/commands/dataset/relation-update.js +4 -1
- package/lib/commands/dataset/relations.js +7 -1
- package/lib/commands/dataset/rename.js +4 -1
- package/lib/commands/dataset/restore.js +7 -1
- package/lib/commands/dataset/user-deleted-field-list.js +3 -1
- package/lib/commands/db/analysis-batching.js +3 -1
- package/lib/commands/db/analyze-batch-plan.js +2 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +3 -1
- package/lib/commands/db/analyze-status.js +6 -1
- package/lib/commands/db/create.js +4 -1
- package/lib/commands/db/cross-db-analysis-shared.js +3 -1
- package/lib/commands/db/cross-db-analyze-latest.js +1 -1
- package/lib/commands/db/cross-db-analyze-start.js +2 -1
- package/lib/commands/db/cross-db-analyze-status.js +1 -1
- package/lib/commands/db/delete.js +3 -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 +2 -1
- package/lib/commands/db/diff.js +3 -1
- package/lib/commands/db/index.js +2 -1
- package/lib/commands/db/list.js +2 -1
- package/lib/commands/db/shared.js +3 -1
- package/lib/commands/db/table-diff-shared.js +2 -1
- package/lib/commands/db/tables.js +2 -1
- package/lib/commands/db/test.js +2 -1
- package/lib/commands/db/update.js +4 -1
- package/lib/commands/deployment/index.js +1 -1
- package/lib/commands/deployment/sync-all.js +3 -1
- package/lib/commands/deployment/sync-jobs.js +2 -1
- package/lib/commands/deployment/sync-status.js +2 -1
- package/lib/commands/doctor.js +12 -1
- package/lib/commands/file/index.js +3 -1
- package/lib/commands/flow/create.js +2 -1
- package/lib/commands/flow/detail.js +3 -1
- package/lib/commands/flow/index.js +1 -1
- package/lib/commands/flow/list.js +2 -1
- package/lib/commands/flow/page-list.js +2 -1
- package/lib/commands/flow/publish.js +2 -1
- package/lib/commands/flow/runtime-resources-shared.js +3 -1
- package/lib/commands/flow/runtime-role-list.js +2 -1
- package/lib/commands/flow/runtime-role-user-list.js +2 -1
- package/lib/commands/flow/runtime-user-search.js +2 -1
- package/lib/commands/flow/shared.js +6 -1
- package/lib/commands/flow/update.js +4 -1
- package/lib/commands/flow/validate.js +2 -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 +2 -1
- package/lib/commands/instant-api-policy/publish.js +5 -1
- package/lib/commands/instant-api-policy/pull.js +2 -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 +5 -1
- package/lib/commands/instant-api-policy/shared.js +5 -1
- package/lib/commands/instant-api-policy/validate.js +1 -1
- package/lib/commands/issue/context.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +2 -1
- package/lib/commands/issue/report.js +5 -1
- package/lib/commands/kb/create.js +5 -1
- package/lib/commands/kb/delete.js +5 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/import-api.d.ts +3 -0
- package/lib/commands/kb/import-api.js +1 -0
- package/lib/commands/kb/import-resume.d.ts +2 -0
- package/lib/commands/kb/import-resume.js +2 -0
- package/lib/commands/kb/import-shared.d.ts +69 -0
- package/lib/commands/kb/import-shared.js +9 -0
- package/lib/commands/kb/import-status.d.ts +2 -0
- package/lib/commands/kb/import-status.js +1 -0
- package/lib/commands/kb/import.d.ts +2 -0
- package/lib/commands/kb/import.js +3 -0
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/search.js +3 -1
- package/lib/commands/kb/shared.js +9 -1
- package/lib/commands/kb/update.js +7 -1
- package/lib/commands/logs/index.js +2 -1
- package/lib/commands/menu/asset-update.js +8 -1
- package/lib/commands/menu/delete.js +15 -1
- package/lib/commands/menu/external-link-create.js +16 -1
- package/lib/commands/menu/external-link-update.js +10 -1
- package/lib/commands/menu/group-create.js +8 -1
- package/lib/commands/menu/group-update.js +6 -1
- package/lib/commands/menu/index.js +2 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +6 -1
- package/lib/commands/menu/regroup-start.js +11 -1
- package/lib/commands/menu/rename.js +9 -1
- package/lib/commands/menu/shared/compare-table.js +2 -1
- package/lib/commands/menu/shared/delete-plan.js +13 -1
- package/lib/commands/menu/shared/facts.js +5 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +4 -1
- package/lib/commands/menu/shared/local-pages.js +5 -1
- package/lib/commands/menu/shared/logic.js +3 -1
- package/lib/commands/menu/shared/mutations.js +9 -1
- package/lib/commands/menu/shared/path.js +1 -1
- package/lib/commands/menu/shared/service.js +4 -1
- package/lib/commands/menu/shared/subapp-assets.js +4 -1
- package/lib/commands/menu/shared/sync-core.js +7 -1
- package/lib/commands/menu/shared/types.js +1 -1
- package/lib/commands/menu/shared/update-core.js +8 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/subapp-assets-status.js +1 -1
- package/lib/commands/menu/subapp-assets-update.js +7 -1
- package/lib/commands/menu/sync.js +7 -1
- package/lib/commands/menu/visibility-update.js +13 -1
- package/lib/commands/metric/contract.d.ts +8 -0
- package/lib/commands/metric/contract.js +5 -0
- package/lib/commands/metric/definition.d.ts +43 -0
- package/lib/commands/metric/definition.js +4 -0
- package/lib/commands/metric/delete.d.ts +2 -0
- package/lib/commands/metric/delete.js +3 -0
- package/lib/commands/metric/detail.d.ts +2 -0
- package/lib/commands/metric/detail.js +1 -0
- package/lib/commands/metric/example.d.ts +2 -0
- package/lib/commands/metric/example.js +1 -0
- package/lib/commands/metric/index.d.ts +2 -0
- package/lib/commands/metric/index.js +1 -0
- package/lib/commands/metric/list.d.ts +2 -0
- package/lib/commands/metric/list.js +2 -0
- package/lib/commands/metric/publication-diff.d.ts +8 -0
- package/lib/commands/metric/publication-diff.js +1 -0
- package/lib/commands/metric/publish.d.ts +2 -0
- package/lib/commands/metric/publish.js +4 -0
- package/lib/commands/metric/schema.d.ts +2 -0
- package/lib/commands/metric/schema.js +1 -0
- package/lib/commands/metric/shared.d.ts +14 -0
- package/lib/commands/metric/shared.js +2 -0
- package/lib/commands/metric/validate.d.ts +2 -0
- package/lib/commands/metric/validate.js +1 -0
- package/lib/commands/notification/config-create.js +4 -1
- package/lib/commands/notification/config-delete.js +4 -1
- package/lib/commands/notification/config-list.js +2 -1
- package/lib/commands/notification/config-update.js +4 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +18 -1
- package/lib/commands/ocr/index.js +4 -1
- package/lib/commands/page/create.js +6 -1
- package/lib/commands/page/custom/detail.js +2 -1
- package/lib/commands/page/custom/list.js +2 -1
- package/lib/commands/page/custom/publish.js +3 -1
- package/lib/commands/page/custom/shared.js +3 -1
- package/lib/commands/page/custom/syntax.js +2 -1
- package/lib/commands/page/custom/update.js +3 -1
- package/lib/commands/page/data-list-status.js +2 -1
- package/lib/commands/page/generate-start.js +5 -1
- package/lib/commands/page/generate-status.js +4 -1
- package/lib/commands/page/index.js +2 -1
- package/lib/commands/page/pull.js +6 -1
- package/lib/commands/page/push.js +11 -1
- package/lib/commands/page/relation-audit.js +15 -1
- package/lib/commands/page/restore.js +5 -1
- package/lib/commands/page/shared.js +16 -1
- package/lib/commands/page/sync.js +2 -1
- package/lib/commands/project/api-architecture-upgrade.js +11 -1
- package/lib/commands/project/create/enhanced-guided-create.js +2 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +13 -1
- package/lib/commands/project/create/materialize-project-template.js +12 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.js +5 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +2 -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 +4 -1
- package/lib/commands/project/upgrade.js +7 -1
- package/lib/commands/registry.js +10 -1
- package/lib/commands/role/delete.js +2 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +2 -1
- package/lib/commands/role/shared.js +8 -1
- package/lib/commands/role/update.js +3 -1
- package/lib/commands/role/user-add.js +2 -1
- package/lib/commands/role/user-remove.js +2 -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 +7 -1
- package/lib/commands/rule/shared.js +4 -1
- package/lib/commands/run/index.js +5 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +7 -1
- package/lib/commands/sql/delete.js +4 -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 +2 -1
- package/lib/commands/sql/pull.js +10 -1
- package/lib/commands/sql/push.js +9 -1
- package/lib/commands/sql/shared.js +5 -1
- package/lib/commands/sql/status.js +3 -1
- package/lib/commands/sql/validate.js +5 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +2 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +2 -1
- package/lib/commands/tenant/shared.js +2 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +2 -1
- package/lib/commands/user-account/feishu-bind.js +2 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +7 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/domain-config.js +8 -1
- package/lib/config/project-domain-routing.js +3 -1
- package/lib/config/region-config.js +2 -1
- package/lib/config/schema.js +7 -1
- package/lib/constant/cdn.js +2 -1
- package/lib/constant/cli.js +8 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +4 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/routing-profile.js +1 -1
- package/lib/context/app-resolver.js +7 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +7 -1
- package/lib/context.js +9 -1
- package/lib/core/alias-resolver.js +5 -1
- package/lib/core/api-client.d.ts +14 -7
- package/lib/core/api-client.js +69 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +6 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/hook-directory.js +9 -1
- package/lib/core/bff/lock.js +2 -1
- package/lib/core/bff/types.js +1 -1
- package/lib/core/bff/utils.js +3 -1
- package/lib/core/cross-db-analysis.js +1 -1
- package/lib/core/cross-db-relation.js +1 -1
- package/lib/core/db-resolver.js +2 -1
- package/lib/core/flow-config.js +49 -1
- package/lib/core/instant-api-policy/config.js +7 -1
- package/lib/core/instant-api-policy/endpoints.js +1 -1
- package/lib/core/kb-management-client.d.ts +11 -0
- package/lib/core/kb-management-client.js +4 -1
- package/lib/core/kb-search-client.js +3 -1
- package/lib/core/page/file-system.js +2 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +2 -1
- package/lib/core/page/lr-smart-jsx.js +4 -1
- package/lib/core/page/types.js +1 -1
- package/lib/core/sql-index-auditor.js +14 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +3 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +2 -1
- package/lib/core/sql-sync/types.js +1 -1
- package/lib/core/sql-sync/utils.js +2 -1
- package/lib/core/sql-validator.js +15 -1
- package/lib/errors.js +3 -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 +2 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +2 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +2 -1
- package/lib/framework/runner.js +9 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/supported-flags.js +2 -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 +3 -1
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/runtime/confirmation.js +2 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +4 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +2 -1
- package/lib/runtime/types.js +1 -1
- package/lib/services/dataset-design/checkpoint.js +2 -1
- package/lib/services/dataset-design/commands.js +14 -1
- package/lib/services/dataset-design/contract.js +8 -1
- package/lib/skills/builtin-skill.js +8 -1
- package/lib/skills/install-updated-skill.d.ts +8 -0
- package/lib/skills/install-updated-skill.js +3 -0
- package/lib/skills/local-skills-installer.d.ts +2 -0
- package/lib/skills/local-skills-installer.js +1 -0
- package/lib/skills/main.js +2 -1
- package/lib/skills/npx-skills-add.d.ts +6 -6
- package/lib/skills/npx-skills-add.js +5 -1
- package/lib/skills/skill-presence.d.ts +1 -30
- package/lib/skills/skill-presence.js +2 -1
- package/lib/telemetry/cli-command-trace.js +2 -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/types/index.js +1 -1
- package/lib/utils/ai_config.js +3 -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 +5 -1
- package/lib/utils/cli-version-check.js +4 -1
- package/lib/utils/cli-version-policy.js +3 -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 +3 -1
- package/lib/utils/http-client.js +2 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +3 -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 +5 -1
- package/lib/utils/update-notice.js +3 -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 +10 -7
- package/skills/rabetbase/SKILL.md +11 -7
- package/skills/rabetbase/guides/backend-function.md +3 -1
- package/skills/rabetbase/guides/data-api-guidelines.md +1 -1
- package/skills/rabetbase/guides/frontend-development.md +1 -0
- package/skills/rabetbase/guides/metric-development.md +185 -0
- package/skills/rabetbase/references/rabetbase-app-config.md +4 -3
- package/skills/rabetbase/references/rabetbase-cli-skill-install.md +5 -5
- package/skills/rabetbase/references/rabetbase-dataset-design.md +1 -1
- package/skills/rabetbase/references/rabetbase-kb.md +16 -0
- package/skills/rabetbase/references/rabetbase-metric.md +119 -0
- package/skills/rabetbase/references/rabetbase-update.md +7 -5
- package/skills/rabetbase-dataset-generation/SKILL.md +1 -1
- package/skills/rabetbase-dataset-generation/references/workflow.md +1 -1
- package/skills/rabetbase-metrics-generation/SKILL.md +22 -0
- package/skills/rabetbase-metrics-generation/references/verification.md +19 -0
- package/skills/rabetbase-metrics-generation/references/workflow.md +41 -0
- package/skills/rabetbase-metrics-generation/templates/statistics-delivery.md +11 -0
- package/skills/rabetbase-page-generation/SKILL.md +1 -1
- package/skills/rabetbase-page-generation/references/generation.md +1 -1
- package/skills/rabetbase.manifest.json +5 -3
- package/templates/metrics/definition.json +78 -0
- package/templates/metrics/metric-definition.schema.json +136 -0
- package/lib/postinstall.d.ts +0 -3
- package/lib/postinstall.js +0 -1
- package/scripts/postinstall.mjs +0 -24
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{taskStatus}from"../../commands/task/status.js";export const taskDefinitions=[taskStatus];
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import{APPCODE_FLAG_OPTIONAL}from"../../commands/common/flags.js";import{asyncTaskMessage,buildAsyncTaskStatusCommand,normalizeAsyncTask}from"../../commands/common/async-task.js";import{getAsyncTaskStatus}from"../../core/api-client.js";import{CliErrors}from"../../errors.js";export const taskStatus={service:"task",command:"status",description:"Query an asynchronous task; repeat for PENDING or PROCESSING until SUCCESS or FAILED",risk:"read",defaultOutputFormat:"compress",structuredErrors:true,flags:[{name:"task-id",type:"string",required:true,description:"Task id returned by an asynchronous platform command"},APPCODE_FLAG_OPTIONAL],async validate(ctx){if(!ctx.str("task-id").trim()){throw CliErrors.flagMissing("task-id")}},async execute(ctx){const requestedTaskId=ctx.str("task-id").trim();const task=normalizeAsyncTask(await getAsyncTaskStatus(requestedTaskId,ctx.appCode,ctx.cookie));if(task.taskId!==requestedTaskId){
|
|
2
|
+
throw CliErrors.apiError(`Task status response id mismatch: requested ${requestedTaskId}, received ${task.taskId}.`)}const queryCommand=buildAsyncTaskStatusCommand(task.taskId,ctx.appCode);return{ok:true,message:asyncTaskMessage(task),data:{appCode:ctx.appCode,...task,query:task.isTerminal?null:{command:queryCommand}}}}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{tenantMembersListDefinition}from"../../commands/tenant/members-list.js";export const tenantDefinitions=[tenantMembersListDefinition];
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import{listCurrentUserTenantMemberships,listTenantDirectoryMembers}from"../../core/api-client.js";import{CliErrors}from"../../errors.js";import{assertTenantAccessible,projectTenantMembers}from"../../commands/tenant/shared.js";export const tenantMembersListDefinition={service:"tenant",command:"members-list",description:"List members of a tenant available to the current account",risk:"read",requiresAuth:true,requiresAppCode:false,structuredErrors:true,flags:[{name:"tenant-code",type:"string",required:true,description:"Exact tenant code"}],async validate(ctx){if(!ctx.str("tenant-code").trim()){throw CliErrors.flagMissing("tenant-code","Pass --tenant-code <code>.")}},async execute(ctx){const tenantCode=ctx.str("tenant-code").trim();const memberships=await listCurrentUserTenantMemberships();assertTenantAccessible(tenantCode,memberships);const items=projectTenantMembers(await listTenantDirectoryMembers(tenantCode));return{ok:true,data:{tenantCode:tenantCode,items:items,
|
|
2
|
+
totalCount:items.length},message:`Found ${items.length} tenant member(s)`}}};
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import{CliErrors}from"../../errors.js";function textOrNull(value){const normalized=value?.trim();return normalized?normalized:null}export function projectTenantMembers(members){const projected=new Map;for(const member of members){const userId=Number(member.userId);if(!Number.isFinite(userId)||userId<=0)continue;const next={userId:userId,username:textOrNull(member.username),displayName:textOrNull(member.nickname),role:member.adminFlag===true?"ADMIN":"MEMBER",status:textOrNull(member.status)};const existing=projected.get(userId);if(!existing){projected.set(userId,next);continue}existing.username??=next.username;existing.displayName??=next.displayName;existing.status??=next.status;if(next.role==="ADMIN")existing.role="ADMIN"}return[...projected.values()].sort((left,right)=>left.userId-right.userId)}export function assertTenantAccessible(tenantCode,memberships){if(memberships.some(membership=>membership.tenantCode===tenantCode)){return}
|
|
2
|
+
throw CliErrors.validation(`Tenant "${tenantCode}" is not available to the current account.`,"Check --tenant-code or login with an account that belongs to this tenant.")}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import{asDryRunResult}from"../../commands/common/dry-run.js";import{bindDingTalkSandboxAccount,DING_TALK_SANDBOX_BIND_PATH}from"../../core/api-client.js";import{CliErrors}from"../../errors.js";const PROVIDER_ID="dingtalk";const CURRENT_BINDING_WARNING="The current binding is not exposed by the server; before is unavailable.";function readDingTalkUserId(ctx){const dingTalkUserId=ctx.str("ding-talk-user-id").trim();if(!dingTalkUserId){throw CliErrors.validation("--ding-talk-user-id cannot be empty.","Pass the DingTalk user id returned by the sandbox.")}return dingTalkUserId}function buildBindingData(dingTalkUserId,dryRun){return{operation:"bind",selector:{providerId:PROVIDER_ID,dingTalkUserId:dingTalkUserId},before:null,after:{providerId:PROVIDER_ID,dingTalkUserId:dingTalkUserId,bound:true},dryRun:dryRun,backend:{method:"POST",path:DING_TALK_SANDBOX_BIND_PATH},warnings:[CURRENT_BINDING_WARNING]}}export const dingTalkSandboxBind={service:"user-account",command:"dingding-sandbox-bind",
|
|
2
|
+
description:"Bind the current platform user to a DingTalk sandbox account",risk:"write",requiresAuth:true,requiresAppCode:false,structuredErrors:true,flags:[{name:"ding-talk-user-id",type:"string",required:true,description:"DingTalk user id returned by the sandbox"}],async validate(ctx){readDingTalkUserId(ctx)},async dryRun(ctx){const dingTalkUserId=readDingTalkUserId(ctx);return asDryRunResult(buildBindingData(dingTalkUserId,true),{method:"POST",url:DING_TALK_SANDBOX_BIND_PATH})},async execute(ctx){const dingTalkUserId=readDingTalkUserId(ctx);const confirmed=await bindDingTalkSandboxAccount(dingTalkUserId);if(confirmed!==true){throw CliErrors.apiError("DingTalk sandbox account binding was not confirmed.","Retry with the same --ding-talk-user-id only after checking the current platform session.")}return{ok:true,data:buildBindingData(dingTalkUserId,false),message:"Bound current user to DingTalk sandbox account."}}};
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import{asDryRunResult}from"../../commands/common/dry-run.js";import{bindFeishuAccount,FEISHU_BIND_PATH}from"../../core/api-client.js";import{CliErrors}from"../../errors.js";const PROVIDER_ID="feishu";const CURRENT_BINDING_WARNING="The current binding is not exposed by the server; before is unavailable.";function readUnionId(ctx){const unionId=ctx.str("union-id").trim();if(!/^on_[A-Za-z0-9_-]+$/.test(unionId)){throw CliErrors.validation("--union-id must match on_ followed by letters, digits, underscores, or hyphens.","Pass a Feishu union id such as on_example_001.")}return unionId}function buildBindingData(unionId,dryRun){return{operation:"bind",selector:{providerId:PROVIDER_ID,unionId:unionId},before:null,after:{providerId:PROVIDER_ID,unionId:unionId,bound:true},dryRun:dryRun,backend:{method:"POST",path:FEISHU_BIND_PATH},warnings:[CURRENT_BINDING_WARNING]}}export const feishuBind={service:"user-account",command:"feishu-bind",
|
|
2
|
+
description:"Bind the current platform user to a Feishu account",risk:"write",requiresAuth:true,requiresAppCode:false,structuredErrors:true,flags:[{name:"union-id",type:"string",required:true,description:"Feishu union_id for the configured Feishu application developer"}],async validate(ctx){readUnionId(ctx)},async dryRun(ctx){const unionId=readUnionId(ctx);return asDryRunResult(buildBindingData(unionId,true),{method:"POST",url:FEISHU_BIND_PATH})},async execute(ctx){const unionId=readUnionId(ctx);const confirmed=await bindFeishuAccount(unionId);if(confirmed!==true){throw CliErrors.apiError("Feishu account binding was not confirmed.","Verify the current binding through the platform before explicitly retrying; do not automatically retry.")}return{ok:true,data:buildBindingData(unionId,false),message:"Bound current user to Feishu account."}}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{dingTalkSandboxBind}from"../../commands/user-account/dingding-sandbox-bind.js";import{feishuBind}from"../../commands/user-account/feishu-bind.js";export const userAccountDefinitions=[dingTalkSandboxBind,feishuBind];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{buildAppAddFlags,runAppAdd,validateAppName}from"../../commands/common/app-registry.js";export const workspaceAddDefinition={service:"workspace",command:"add",description:"Register an app profile in the current workspace (or --global)",risk:"write",requiresAuth:false,requiresAppCode:false,args:[{name:"name",description:"App profile name",required:true}],flags:buildAppAddFlags(),validate:ctx=>validateAppName(ctx,"workspace add"),execute:ctx=>runAppAdd(ctx,"workspace add")};
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import{CliErrors}from"../../errors.js";import{CLI_BIN_NAME}from"../../constant/cli.js";import{RABETBASE_ENV_VALUES}from"../../constant/env.js";import{RABETBASE_OUTPUT_FORMAT_VALUES}from"../../constant/output.js";import{RISK_LEVEL_VALUES}from"../../constant/risk.js";import{validateAppcode}from"../../commands/common/validate.js";import{readConfigFile,readRawConfigWithLayers,resolveWriteConfigPath,writeConfigFile}from"../../context.js";import{workspaceAddDefinition}from"../../commands/workspace/add.js";import{workspaceRemoveDefinition}from"../../commands/workspace/remove.js";import{normalizeStoredDefaultApp}from"../../config/schema.js";import{ENABLED_LOVRABET_REGION_VALUES}from"../../constant/region.js";const WORKSPACE_USAGE=`${CLI_BIN_NAME} workspace <init|use> --app <name> [--appcode <code>]`;const SAFE_PROFILE_KEYS=["appcode","apiGroup","region","env","apiDir","format","pageSize","riskLevel","locale"];const workspaceFlags=[{name:"app",type:"string",
|
|
2
|
+
description:"App profile name to use in this workspace"},{name:"appcode",type:"string",description:"App code to bind to this workspace"},{name:"apiGroup",type:"string",description:"Join key for app profiles that share one generated API model registry"},{name:"region",type:"string",description:"Country/region for this workspace app profile",enum:[...ENABLED_LOVRABET_REGION_VALUES]},{name:"env",type:"string",description:"Target environment",enum:[...RABETBASE_ENV_VALUES]},{name:"apiDir",type:"string",description:"API directory path for this workspace app profile"},{name:"defaultFormat",type:"string",description:"Default output format for this workspace app profile",enum:[...RABETBASE_OUTPUT_FORMAT_VALUES]},{name:"pageSize",type:"number",description:"Default page size for this workspace app profile"},{name:"riskLevel",type:"string",description:"Risk level for this workspace app profile",enum:[...RISK_LEVEL_VALUES]},{name:"locale",type:"string",
|
|
3
|
+
description:"App locale for this workspace app profile (not CLI language; reserved for later app use)"}];function isRecord(value){return!!value&&typeof value==="object"&&!Array.isArray(value)}function assertValidAppcode(appcode){const{valid:valid,message:message}=validateAppcode(appcode);if(!valid){throw CliErrors.validation(`Invalid appcode: ${appcode}`,message)}}function sanitizeProfile(profile){if(!isRecord(profile))return{};const sanitized={};for(const key of SAFE_PROFILE_KEYS){if(profile[key]!==undefined)sanitized[key]=profile[key]}return sanitized}function cloneProfile(profile){return isRecord(profile)?{...profile}:{}}function collectWorkspaceProfileOverrides(ctx){const profile={};const apiGroup=ctx.str("apiGroup");const region=ctx.str("region");const env=ctx.str("env");const apiDir=ctx.str("apiDir");const defaultFormat=ctx.str("defaultFormat");const pageSize=ctx.flag("pageSize");const riskLevel=ctx.str("riskLevel");const locale=ctx.str("locale")
|
|
4
|
+
;if(apiGroup)profile.apiGroup=apiGroup;if(region)profile.region=region;if(env)profile.env=env;if(apiDir)profile.apiDir=apiDir;if(defaultFormat)profile.format=defaultFormat;if(pageSize!==undefined&&pageSize!=="")profile.pageSize=Number(pageSize);if(riskLevel)profile.riskLevel=riskLevel;if(locale)profile.locale=locale;return profile}async function validateWorkspaceArgs(ctx){const app=ctx.str("app").trim();const appcode=ctx.str("appcode").trim();if(!app&&!appcode){throw CliErrors.validation("Missing workspace app selector.",`Use \`${CLI_BIN_NAME} workspace init --appcode <code>\` or \`${CLI_BIN_NAME} workspace use --app <name>\`.`)}if(appcode)assertValidAppcode(appcode)}function resolveKnownApps(){const{config:merged,layers:layers}=readRawConfigWithLayers();const mergedApps=isRecord(merged.apps)?merged.apps:{};const globalApps=isRecord(layers.globalConfig.apps)?layers.globalConfig.apps:{};return{...globalApps,...mergedApps}}async function configureWorkspace(ctx,operation){
|
|
5
|
+
const inputApp=ctx.str("app").trim();const inputAppcode=ctx.str("appcode").trim();const appName=inputApp||inputAppcode;if(!appName){throw CliErrors.validation("Missing workspace app selector.",`Use \`${CLI_BIN_NAME} workspace init --appcode <code>\` or \`${CLI_BIN_NAME} workspace use --app <name>\`.`)}if(inputAppcode)assertValidAppcode(inputAppcode);const configPath=resolveWriteConfigPath("project");const config=readConfigFile(configPath);const knownApps=resolveKnownApps();const projectApps=isRecord(config.apps)?{...config.apps}:{};const existingProjectProfile=cloneProfile(projectApps[appName]);const knownProfile=sanitizeProfile(knownApps[appName]);const sourceProfile=inputAppcode?{}:knownProfile;const resolvedAppcode=inputAppcode||sourceProfile.appcode;if(!resolvedAppcode){const available=Object.keys(knownApps)
|
|
6
|
+
;const hint=available.length===0?`Use \`${CLI_BIN_NAME} workspace ${operation} --app ${appName} --appcode <code>\`.`:`Pass --appcode <code>, or choose one of: ${available.join(", ")}`;throw CliErrors.validation(`App "${appName}" not found.`,hint)}assertValidAppcode(String(resolvedAppcode));const profile={...sourceProfile,...existingProjectProfile,appcode:String(resolvedAppcode),...collectWorkspaceProfileOverrides(ctx)};projectApps[appName]=profile;config.apps=projectApps;normalizeStoredDefaultApp(config,appName);delete config.appcode;delete config.app;if(profile.env){config.env=profile.env}writeConfigFile(configPath,config);return{ok:true,message:`Workspace ${operation==="init"?"initialized":"updated"}: ${appName} (appcode: ${profile.appcode}). Config: ${configPath}. Credentials: not written.`,data:{operation:`workspace.${operation}`,configPath:configPath,app:appName,appcode:profile.appcode,apiGroup:profile.apiGroup??null,region:profile.region??null,env:profile.env??null,
|
|
7
|
+
credentialsWritten:false}}}const workspaceInitDefinition={service:"workspace",command:"init",description:"Initialize the current workspace app binding",risk:"write",requiresAuth:false,requiresAppCode:false,args:[],flags:workspaceFlags,validate:validateWorkspaceArgs,execute:ctx=>configureWorkspace(ctx,"init")};const workspaceUseDefinition={service:"workspace",command:"use",description:"Switch the current workspace app binding",risk:"write",requiresAuth:false,requiresAppCode:false,args:[],flags:workspaceFlags,validate:validateWorkspaceArgs,execute:ctx=>configureWorkspace(ctx,"use")};export const workspaceDefinitions=[workspaceInitDefinition,workspaceUseDefinition,workspaceAddDefinition,workspaceRemoveDefinition];export{WORKSPACE_USAGE};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{buildAppRemoveFlags,runAppRemove,validateAppName}from"../../commands/common/app-registry.js";export const workspaceRemoveDefinition={service:"workspace",command:"remove",description:"Remove an app profile from the current workspace (or --global)",risk:"write",requiresAuth:false,requiresAppCode:false,args:[{name:"name",description:"App profile name to remove",required:true}],flags:buildAppRemoveFlags(),validate:ctx=>validateAppName(ctx,"workspace remove"),execute:ctx=>runAppRemove(ctx,"workspace remove")};
|
|
@@ -1 +1,8 @@
|
|
|
1
|
-
const a269_0x27b7d1=a269_0x4fd0;(function(_0x3abf4e,_0x168aaa){const _0x314c06=a269_0x4fd0,_0x42ef0e=_0x3abf4e();while(!![]){try{const _0x404ee0=parseInt(_0x314c06(0x173))/0x1*(-parseInt(_0x314c06(0x183))/0x2)+-parseInt(_0x314c06(0x17a))/0x3*(parseInt(_0x314c06(0x16f))/0x4)+-parseInt(_0x314c06(0x178))/0x5*(parseInt(_0x314c06(0x17c))/0x6)+parseInt(_0x314c06(0x19c))/0x7*(parseInt(_0x314c06(0x186))/0x8)+parseInt(_0x314c06(0x18c))/0x9+parseInt(_0x314c06(0x176))/0xa+parseInt(_0x314c06(0x163))/0xb;if(_0x404ee0===_0x168aaa)break;else _0x42ef0e['push'](_0x42ef0e['shift']());}catch(_0x1feceb){_0x42ef0e['push'](_0x42ef0e['shift']());}}}(a269_0x4576,0x34813));function a269_0x4576(){const _0x4241b5=[':\x20expected\x20an\x20HTTPS\x20origin\x20without\x20credentials,\x20path,\x20query,\x20or\x20fragment.','cwd','8nqHurD','runtime-domain','lovrabet','certificateDomain','Domain\x20config\x20file\x20not\x20found:\x20','domains','582768xrvpnO','skillDomain','\x20and\x20has\x20no\x20default.','username','search','cdn','agentDomain','https:','trim','localDomain','Enterprise\x20','length','userDomain','Allowed\x20fields:\x20','origin','kind','2721733oTQJtA','pathname','isArray','Invalid\x20enterprise\x20routing\x20manifest:\x20domains\x20must\x20be\x20an\x20object.','api-domain','protocol','Unsupported\x20routing\x20manifest:\x20expected\x20protocol\x20\x22','skill-domain','str','href','join','domain-config','base\x20URL','kb-domain','password','app-domain','runtimeDomain','appDomain','kbDomain','user-domain','keys','Update\x20the\x20manifest\x20so\x20both\x20CLIs\x20consume\x20the\x20same\x20routing\x20data.','Unsupported\x20domain\x20config\x20field(s):\x20','Invalid\x20domain\x20config:\x20expected\x20a\x20JSON\x20object.','skillHubDomain','Invalid\x20cdn.','\x22\x20and\x20kind\x20\x22','local-domain','validation','568656nixTBf','\x20does\x20not\x20provide\x20a\x20Domain\x20for\x20','kb-service-domain','string','utf8','default','mode','kbServiceDomain',':\x20expected\x20an\x20HTTPS\x20origin\x20or\x20consumer\x20Domain\x20object.','apiDomain','Invalid\x20','replace','763816MTNPaM','Invalid\x20domain\x20config:\x20provide\x20at\x20least\x20one\x20supported\x20Domain.','Invalid\x20domain\x20config\x20JSON:\x20','rabetbase-cli','7BOSSop','Enterprise\x20routing\x20manifest\x20requires\x20localDomain\x20and\x20certificateDomain\x20together.','filter','2384670vHSSqq','parse','135200qVhkVa','hash','6SSeiUN','enterprise-v1','12nYbLkt','includes','certificate-domain',':\x20\x22','legacy','\x22\x20is\x20not\x20a\x20valid\x20URL.','object','26482gJXujX'];a269_0x4576=function(){return _0x4241b5;};return a269_0x4576();}import{existsSync,readFileSync}from'node:fs';import{isAbsolute,resolve}from'node:path';import{CliErrors}from'../errors.js';import{ENTERPRISE_ROUTING_CDN_FIELDS,ENTERPRISE_ROUTING_DOMAIN_FIELDS,ENTERPRISE_ROUTING_KIND,ENTERPRISE_ROUTING_PROTOCOL,REQUIRED_ENTERPRISE_ROUTING_CDN_FIELDS,REQUIRED_ENTERPRISE_ROUTING_DOMAIN_FIELDS}from'../generated/routing-contract.js';export const DOMAIN_CONFIG_FIELDS=[a269_0x27b7d1(0x198),a269_0x27b7d1(0x16c),a269_0x27b7d1(0x1ac),a269_0x27b7d1(0x18d),a269_0x27b7d1(0x1ae),a269_0x27b7d1(0x16a),a269_0x27b7d1(0x1ad),a269_0x27b7d1(0x195),a269_0x27b7d1(0x189)];const DOMAIN_FLAGS={'userDomain':a269_0x27b7d1(0x1af),'apiDomain':a269_0x27b7d1(0x1a0),'runtimeDomain':a269_0x27b7d1(0x187),'skillDomain':a269_0x27b7d1(0x1a3),'kbDomain':a269_0x27b7d1(0x1a9),'kbServiceDomain':a269_0x27b7d1(0x165),'appDomain':a269_0x27b7d1(0x1ab),'localDomain':a269_0x27b7d1(0x1b7),'certificateDomain':a269_0x27b7d1(0x17e)};export const LEGACY_DOMAIN_CONFIG_FIELDS=[a269_0x27b7d1(0x192),'platformDomain',a269_0x27b7d1(0x1b4)];function a269_0x4fd0(_0x4bc73c,_0x346a3b){_0x4bc73c=_0x4bc73c-0x163;const _0x4576ba=a269_0x4576();let _0x4fd08a=_0x4576ba[_0x4bc73c];return _0x4fd08a;}const ENTERPRISE_TO_LOCAL_FIELD={'userDomain':a269_0x27b7d1(0x198),'apiDomain':'apiDomain','runtimeDomain':'runtimeDomain','skillDomain':'skillDomain','kbDomain':'kbDomain','kbServiceDomain':a269_0x27b7d1(0x16a),'appDomain':a269_0x27b7d1(0x1ad),'localDomain':'localDomain','certificateDomain':a269_0x27b7d1(0x189)},ROUTING_CONSUMER=a269_0x27b7d1(0x172);export function normalizeDomainOrigin(_0x50f109,_0xc43d57){const _0x2f9f25=a269_0x27b7d1;if(typeof _0xc43d57!==_0x2f9f25(0x166)||!_0xc43d57['trim']())throw CliErrors[_0x2f9f25(0x1b8)]('Invalid\x20'+_0x50f109+':\x20expected\x20a\x20non-empty\x20HTTPS\x20origin.');let _0x54a479;try{_0x54a479=new URL(_0xc43d57[_0x2f9f25(0x194)]());}catch{throw CliErrors[_0x2f9f25(0x1b8)](_0x2f9f25(0x16d)+_0x50f109+_0x2f9f25(0x17f)+_0xc43d57+_0x2f9f25(0x181));}if(_0x54a479[_0x2f9f25(0x1a1)]!==_0x2f9f25(0x193)||_0x54a479[_0x2f9f25(0x18f)]||_0x54a479[_0x2f9f25(0x1aa)]||_0x54a479['pathname']!=='/'&&_0x54a479[_0x2f9f25(0x19d)]!==''||_0x54a479[_0x2f9f25(0x190)]||_0x54a479[_0x2f9f25(0x179)])throw CliErrors[_0x2f9f25(0x1b8)](_0x2f9f25(0x16d)+_0x50f109+_0x2f9f25(0x184),'For\x20internal\x20deployments,\x20terminate\x20TLS\x20at\x20the\x20ingress,\x20reverse\x20proxy,\x20or\x20load\x20balancer;\x20an\x20internal\x20CA\x20is\x20supported.');return _0x54a479[_0x2f9f25(0x19a)];}export function normalizeRoutingDomainValue(_0x56f146,_0x3f6ef2){const _0x104d91=a269_0x27b7d1;if(typeof _0x3f6ef2===_0x104d91(0x166))return normalizeDomainOrigin(_0x56f146,_0x3f6ef2);if(!_0x3f6ef2||typeof _0x3f6ef2!=='object'||Array[_0x104d91(0x19e)](_0x3f6ef2))throw CliErrors[_0x104d91(0x1b8)](_0x104d91(0x16d)+_0x56f146+_0x104d91(0x16b));const _0xe88871=_0x3f6ef2,_0x26d8a0=_0xe88871[ROUTING_CONSUMER]??_0xe88871[_0x104d91(0x168)];if(_0x26d8a0===undefined)throw CliErrors[_0x104d91(0x1b8)](_0x104d91(0x196)+_0x56f146+_0x104d91(0x164)+ROUTING_CONSUMER+_0x104d91(0x18e));return normalizeDomainOrigin(_0x56f146,_0x26d8a0);}export function normalizeCdnBaseUrl(_0x31e8fe,_0x1ca377){const _0x1c5e1f=a269_0x27b7d1;if(typeof _0x1ca377!==_0x1c5e1f(0x166)||!_0x1ca377[_0x1c5e1f(0x194)]())throw CliErrors['validation']('Invalid\x20cdn.'+_0x31e8fe+':\x20expected\x20a\x20non-empty\x20HTTPS\x20URL.');const _0x331263=_0x1ca377[_0x1c5e1f(0x194)]()['replace'](/\/$/,'');let _0x380650;try{_0x380650=new URL(_0x331263);}catch{throw CliErrors[_0x1c5e1f(0x1b8)](_0x1c5e1f(0x1b5)+_0x31e8fe+':\x20\x22'+_0x1ca377+_0x1c5e1f(0x181));}if(_0x380650[_0x1c5e1f(0x1a1)]!==_0x1c5e1f(0x193)||_0x380650[_0x1c5e1f(0x18f)]||_0x380650['password']||_0x380650[_0x1c5e1f(0x190)]||_0x380650[_0x1c5e1f(0x179)]||_0x380650[_0x1c5e1f(0x1a5)][_0x1c5e1f(0x16e)](/\/$/,'')!==_0x331263||_0x31e8fe===_0x1c5e1f(0x188)&&_0x380650[_0x1c5e1f(0x19a)]!==_0x331263)throw CliErrors[_0x1c5e1f(0x1b8)](_0x1c5e1f(0x1b5)+_0x31e8fe+':\x20expected\x20an\x20HTTPS\x20'+(_0x31e8fe===_0x1c5e1f(0x188)?'origin':_0x1c5e1f(0x1a8))+'\x20without\x20credentials,\x20query,\x20or\x20fragment.');return _0x331263;}export function resolveEnterpriseRoutingConfig(_0x5383eb){const _0x3eac31=a269_0x27b7d1;return resolveEnterpriseRoutingManifest(_0x5383eb)?.[_0x3eac31(0x18b)];}export function resolveEnterpriseRoutingManifest(_0x28952e){const _0x4a15dc=a269_0x27b7d1;if(_0x28952e===undefined)return undefined;if(!_0x28952e||typeof _0x28952e!==_0x4a15dc(0x182)||Array[_0x4a15dc(0x19e)](_0x28952e))throw CliErrors[_0x4a15dc(0x1b8)]('Invalid\x20enterprise\x20routing\x20config:\x20expected\x20an\x20object.');return parseEnterpriseRoutingManifest(_0x28952e);}export function readDomainConfigInput(_0x56c88f){const _0x1e3cd1=a269_0x27b7d1,_0x46992e=isAbsolute(_0x56c88f)?_0x56c88f:resolve(process[_0x1e3cd1(0x185)](),_0x56c88f);if(!existsSync(_0x46992e))throw CliErrors[_0x1e3cd1(0x1b8)](_0x1e3cd1(0x18a)+_0x46992e);let _0x30bda8;try{_0x30bda8=JSON[_0x1e3cd1(0x177)](readFileSync(_0x46992e,_0x1e3cd1(0x167)));}catch{throw CliErrors[_0x1e3cd1(0x1b8)](_0x1e3cd1(0x171)+_0x46992e);}if(!_0x30bda8||typeof _0x30bda8!==_0x1e3cd1(0x182)||Array[_0x1e3cd1(0x19e)](_0x30bda8))throw CliErrors['validation'](_0x1e3cd1(0x1b3));const _0x70020d=_0x30bda8;if(_0x1e3cd1(0x1a1)in _0x70020d)return parseEnterpriseRoutingManifest(_0x70020d);const _0x387527=Object[_0x1e3cd1(0x1b0)](_0x70020d)[_0x1e3cd1(0x175)](_0x1baf1d=>!DOMAIN_CONFIG_FIELDS['includes'](_0x1baf1d));if(_0x387527[_0x1e3cd1(0x197)]>0x0)throw CliErrors[_0x1e3cd1(0x1b8)](_0x1e3cd1(0x1b2)+_0x387527[_0x1e3cd1(0x1a6)](',\x20'),_0x1e3cd1(0x199)+DOMAIN_CONFIG_FIELDS[_0x1e3cd1(0x1a6)](',\x20'));const _0x173041={};for(const _0x3cf25f of DOMAIN_CONFIG_FIELDS){_0x70020d[_0x3cf25f]!==undefined&&(_0x173041[_0x3cf25f]=normalizeDomainOrigin(_0x3cf25f,_0x70020d[_0x3cf25f]));}if(Object[_0x1e3cd1(0x1b0)](_0x173041)['length']===0x0)throw CliErrors[_0x1e3cd1(0x1b8)](_0x1e3cd1(0x170));return{'mode':_0x1e3cd1(0x180),'domains':_0x173041};}export function readDomainConfig(_0x3cf64e){const _0x4be3e9=a269_0x27b7d1;return readDomainConfigInput(_0x3cf64e)[_0x4be3e9(0x18b)];}export function resolveDomainConfigInput(_0x5652f9){const _0x5523a8=a269_0x27b7d1,_0x1a37e5=(_0x5652f9[_0x5523a8(0x1a4)](_0x5523a8(0x1a7))||'')[_0x5523a8(0x194)](),_0x34c010=_0x1a37e5?readDomainConfigInput(_0x1a37e5):{'mode':_0x5523a8(0x180),'domains':{}},_0x1dee58=DOMAIN_CONFIG_FIELDS[_0x5523a8(0x175)](_0x26c1c5=>Boolean((_0x5652f9[_0x5523a8(0x1a4)](DOMAIN_FLAGS[_0x26c1c5])||'')['trim']()));if(_0x34c010[_0x5523a8(0x169)]===_0x5523a8(0x17b)&&_0x1dee58[_0x5523a8(0x197)]>0x0)throw CliErrors[_0x5523a8(0x1b8)]('Enterprise\x20routing\x20manifests\x20cannot\x20be\x20combined\x20with\x20individual\x20Domain\x20flags.',_0x5523a8(0x1b1));for(const _0x892daf of DOMAIN_CONFIG_FIELDS){const _0x2c5fa2=(_0x5652f9[_0x5523a8(0x1a4)](DOMAIN_FLAGS[_0x892daf])||'')[_0x5523a8(0x194)]();if(_0x2c5fa2)_0x34c010[_0x5523a8(0x18b)][_0x892daf]=normalizeDomainOrigin(_0x892daf,_0x2c5fa2);}return _0x34c010;}export function resolveDomainFlags(_0x5cdaba){const _0x395e2c=a269_0x27b7d1;return resolveDomainConfigInput(_0x5cdaba)[_0x395e2c(0x18b)];}export function parseEnterpriseRoutingManifest(_0x3634ad){const _0x2b14b9=a269_0x27b7d1;if(_0x3634ad['protocol']!==ENTERPRISE_ROUTING_PROTOCOL||_0x3634ad[_0x2b14b9(0x19b)]!==ENTERPRISE_ROUTING_KIND)throw CliErrors[_0x2b14b9(0x1b8)](_0x2b14b9(0x1a2)+ENTERPRISE_ROUTING_PROTOCOL+_0x2b14b9(0x1b6)+ENTERPRISE_ROUTING_KIND+'\x22.');if(!_0x3634ad['domains']||typeof _0x3634ad[_0x2b14b9(0x18b)]!==_0x2b14b9(0x182)||Array[_0x2b14b9(0x19e)](_0x3634ad[_0x2b14b9(0x18b)]))throw CliErrors[_0x2b14b9(0x1b8)](_0x2b14b9(0x19f));if(!_0x3634ad[_0x2b14b9(0x191)]||typeof _0x3634ad[_0x2b14b9(0x191)]!==_0x2b14b9(0x182)||Array['isArray'](_0x3634ad[_0x2b14b9(0x191)]))throw CliErrors['validation']('Invalid\x20enterprise\x20routing\x20manifest:\x20cdn\x20must\x20be\x20an\x20object.');const _0xf9a5cb=_0x3634ad[_0x2b14b9(0x18b)],_0x23525f=REQUIRED_ENTERPRISE_ROUTING_DOMAIN_FIELDS[_0x2b14b9(0x175)](_0x1ebc92=>_0xf9a5cb[_0x1ebc92]===undefined);if(_0x23525f[_0x2b14b9(0x197)]>0x0)throw CliErrors['validation']('Enterprise\x20routing\x20manifest\x20is\x20missing\x20required\x20Domain(s):\x20'+_0x23525f[_0x2b14b9(0x1a6)](',\x20'));if(_0xf9a5cb[_0x2b14b9(0x195)]===undefined!==(_0xf9a5cb[_0x2b14b9(0x189)]===undefined))throw CliErrors[_0x2b14b9(0x1b8)](_0x2b14b9(0x174));const _0x11c8c6=_0x3634ad[_0x2b14b9(0x191)],_0x89348b=Object[_0x2b14b9(0x1b0)](_0x11c8c6)[_0x2b14b9(0x175)](_0x55fc35=>!ENTERPRISE_ROUTING_CDN_FIELDS[_0x2b14b9(0x17d)](_0x55fc35));if(_0x89348b[_0x2b14b9(0x197)]>0x0)throw CliErrors[_0x2b14b9(0x1b8)]('Unsupported\x20enterprise\x20CDN\x20field(s):\x20'+_0x89348b[_0x2b14b9(0x1a6)](',\x20'),_0x2b14b9(0x199)+ENTERPRISE_ROUTING_CDN_FIELDS['join'](',\x20'));const _0x5ed3f0=REQUIRED_ENTERPRISE_ROUTING_CDN_FIELDS[_0x2b14b9(0x175)](_0x3e56c5=>_0x11c8c6[_0x3e56c5]===undefined);if(_0x5ed3f0[_0x2b14b9(0x197)]>0x0)throw CliErrors[_0x2b14b9(0x1b8)]('Enterprise\x20routing\x20manifest\x20is\x20missing\x20required\x20CDN\x20field(s):\x20'+_0x5ed3f0[_0x2b14b9(0x1a6)](',\x20'));const _0x1bae96={};for(const _0x569787 of ENTERPRISE_ROUTING_CDN_FIELDS){_0x1bae96[_0x569787]=normalizeCdnBaseUrl(_0x569787,_0x11c8c6[_0x569787]);}const _0x44bf7d={},_0x1d0f4e={};for(const _0x2f4389 of ENTERPRISE_ROUTING_DOMAIN_FIELDS){const _0x33a61e=_0xf9a5cb[_0x2f4389];if(_0x33a61e===undefined)continue;const _0x40e35f=normalizeRoutingDomainValue(_0x2f4389,_0x33a61e);_0x44bf7d[_0x2f4389]=_0x40e35f;const _0x479d3c=ENTERPRISE_TO_LOCAL_FIELD[_0x2f4389];_0x479d3c&&(_0x1d0f4e[_0x479d3c]=_0x40e35f);}return{'mode':'enterprise-v1','domains':_0x1d0f4e,'manifestDomains':_0x44bf7d,'cdn':_0x1bae96};}
|
|
1
|
+
import{existsSync,readFileSync}from"node:fs";import{isAbsolute,resolve}from"node:path";import{CliErrors}from"../errors.js";import{ENTERPRISE_ROUTING_CDN_FIELDS,ENTERPRISE_ROUTING_DOMAIN_FIELDS,ENTERPRISE_ROUTING_KIND,ENTERPRISE_ROUTING_PROTOCOL,REQUIRED_ENTERPRISE_ROUTING_CDN_FIELDS,REQUIRED_ENTERPRISE_ROUTING_DOMAIN_FIELDS}from"../generated/routing-contract.js";export const DOMAIN_CONFIG_FIELDS=["userDomain","apiDomain","runtimeDomain","skillDomain","kbDomain","kbServiceDomain","appDomain","localDomain","certificateDomain"];const DOMAIN_FLAGS={userDomain:"user-domain",apiDomain:"api-domain",runtimeDomain:"runtime-domain",skillDomain:"skill-domain",kbDomain:"kb-domain",kbServiceDomain:"kb-service-domain",appDomain:"app-domain",localDomain:"local-domain",certificateDomain:"certificate-domain"};export const LEGACY_DOMAIN_CONFIG_FIELDS=["agentDomain","platformDomain","skillHubDomain"];const ENTERPRISE_TO_LOCAL_FIELD={userDomain:"userDomain",apiDomain:"apiDomain",
|
|
2
|
+
runtimeDomain:"runtimeDomain",skillDomain:"skillDomain",kbDomain:"kbDomain",kbServiceDomain:"kbServiceDomain",appDomain:"appDomain",localDomain:"localDomain",certificateDomain:"certificateDomain"};const ROUTING_CONSUMER="rabetbase-cli";export function normalizeDomainOrigin(field,input){if(typeof input!=="string"||!input.trim()){throw CliErrors.validation(`Invalid ${field}: expected a non-empty HTTPS origin.`)}let url;try{url=new URL(input.trim())}catch{throw CliErrors.validation(`Invalid ${field}: "${input}" is not a valid URL.`)}if(url.protocol!=="https:"||url.username||url.password||url.pathname!=="/"&&url.pathname!==""||url.search||url.hash){throw CliErrors.validation(`Invalid ${field}: expected an HTTPS origin without credentials, path, query, or fragment.`,"For internal deployments, terminate TLS at the ingress, reverse proxy, or load balancer; an internal CA is supported.")}return url.origin}export function normalizeRoutingDomainValue(field,input){
|
|
3
|
+
if(typeof input==="string")return normalizeDomainOrigin(field,input);if(!input||typeof input!=="object"||Array.isArray(input)){throw CliErrors.validation(`Invalid ${field}: expected an HTTPS origin or consumer Domain object.`)}const source=input;const resolved=source[ROUTING_CONSUMER]??source.default;if(resolved===undefined){throw CliErrors.validation(`Enterprise ${field} does not provide a Domain for ${ROUTING_CONSUMER} and has no default.`)}return normalizeDomainOrigin(field,resolved)}export function normalizeCdnBaseUrl(field,input){if(typeof input!=="string"||!input.trim()){throw CliErrors.validation(`Invalid cdn.${field}: expected a non-empty HTTPS URL.`)}const value=input.trim().replace(/\/$/,"");let url;try{url=new URL(value)}catch{throw CliErrors.validation(`Invalid cdn.${field}: "${input}" is not a valid URL.`)}if(url.protocol!=="https:"||url.username||url.password||url.search||url.hash||url.href.replace(/\/$/,"")!==value||field==="lovrabet"&&url.origin!==value){
|
|
4
|
+
throw CliErrors.validation(`Invalid cdn.${field}: expected an HTTPS ${field==="lovrabet"?"origin":"base URL"} without credentials, query, or fragment.`)}return value}export function resolveEnterpriseRoutingConfig(input){return resolveEnterpriseRoutingManifest(input)?.domains}export function resolveEnterpriseRoutingManifest(input){if(input===undefined)return undefined;if(!input||typeof input!=="object"||Array.isArray(input)){throw CliErrors.validation("Invalid enterprise routing config: expected an object.")}return parseEnterpriseRoutingManifest(input)}export function readDomainConfigInput(filePath){const absolutePath=isAbsolute(filePath)?filePath:resolve(process.cwd(),filePath);if(!existsSync(absolutePath)){throw CliErrors.validation(`Domain config file not found: ${absolutePath}`)}let parsed;try{parsed=JSON.parse(readFileSync(absolutePath,"utf8"))}catch{throw CliErrors.validation(`Invalid domain config JSON: ${absolutePath}`)}
|
|
5
|
+
if(!parsed||typeof parsed!=="object"||Array.isArray(parsed)){throw CliErrors.validation("Invalid domain config: expected a JSON object.")}const source=parsed;if("protocol"in source)return parseEnterpriseRoutingManifest(source);const unknown=Object.keys(source).filter(key=>!DOMAIN_CONFIG_FIELDS.includes(key));if(unknown.length>0){throw CliErrors.validation(`Unsupported domain config field(s): ${unknown.join(", ")}`,`Allowed fields: ${DOMAIN_CONFIG_FIELDS.join(", ")}`)}const result={};for(const field of DOMAIN_CONFIG_FIELDS){if(source[field]!==undefined){result[field]=normalizeDomainOrigin(field,source[field])}}if(Object.keys(result).length===0){throw CliErrors.validation("Invalid domain config: provide at least one supported Domain.")}return{mode:"legacy",domains:result}}export function readDomainConfig(filePath){return readDomainConfigInput(filePath).domains}export function resolveDomainConfigInput(ctx){const filePath=(ctx.str("domain-config")||"").trim()
|
|
6
|
+
;const input=filePath?readDomainConfigInput(filePath):{mode:"legacy",domains:{}};const explicitFields=DOMAIN_CONFIG_FIELDS.filter(field=>Boolean((ctx.str(DOMAIN_FLAGS[field])||"").trim()));if(input.mode==="enterprise-v1"&&explicitFields.length>0){throw CliErrors.validation("Enterprise routing manifests cannot be combined with individual Domain flags.","Update the manifest so both CLIs consume the same routing data.")}for(const field of DOMAIN_CONFIG_FIELDS){const value=(ctx.str(DOMAIN_FLAGS[field])||"").trim();if(value)input.domains[field]=normalizeDomainOrigin(field,value)}return input}export function resolveDomainFlags(ctx){return resolveDomainConfigInput(ctx).domains}export function parseEnterpriseRoutingManifest(source){if(source.protocol!==ENTERPRISE_ROUTING_PROTOCOL||source.kind!==ENTERPRISE_ROUTING_KIND){throw CliErrors.validation(`Unsupported routing manifest: expected protocol "${ENTERPRISE_ROUTING_PROTOCOL}" and kind "${ENTERPRISE_ROUTING_KIND}".`)}
|
|
7
|
+
if(!source.domains||typeof source.domains!=="object"||Array.isArray(source.domains)){throw CliErrors.validation("Invalid enterprise routing manifest: domains must be an object.")}if(!source.cdn||typeof source.cdn!=="object"||Array.isArray(source.cdn)){throw CliErrors.validation("Invalid enterprise routing manifest: cdn must be an object.")}const rawDomains=source.domains;const missing=REQUIRED_ENTERPRISE_ROUTING_DOMAIN_FIELDS.filter(field=>rawDomains[field]===undefined);if(missing.length>0){throw CliErrors.validation(`Enterprise routing manifest is missing required Domain(s): ${missing.join(", ")}`)}if(rawDomains.localDomain===undefined!==(rawDomains.certificateDomain===undefined)){throw CliErrors.validation("Enterprise routing manifest requires localDomain and certificateDomain together.")}const rawCdn=source.cdn;const unknownCdnFields=Object.keys(rawCdn).filter(field=>!ENTERPRISE_ROUTING_CDN_FIELDS.includes(field));if(unknownCdnFields.length>0){
|
|
8
|
+
throw CliErrors.validation(`Unsupported enterprise CDN field(s): ${unknownCdnFields.join(", ")}`,`Allowed fields: ${ENTERPRISE_ROUTING_CDN_FIELDS.join(", ")}`)}const missingCdnFields=REQUIRED_ENTERPRISE_ROUTING_CDN_FIELDS.filter(field=>rawCdn[field]===undefined);if(missingCdnFields.length>0){throw CliErrors.validation(`Enterprise routing manifest is missing required CDN field(s): ${missingCdnFields.join(", ")}`)}const cdn={};for(const field of ENTERPRISE_ROUTING_CDN_FIELDS){cdn[field]=normalizeCdnBaseUrl(field,rawCdn[field])}const manifestDomains={};const domains={};for(const field of ENTERPRISE_ROUTING_DOMAIN_FIELDS){const value=rawDomains[field];if(value===undefined)continue;const normalized=normalizeRoutingDomainValue(field,value);manifestDomains[field]=normalized;const localField=ENTERPRISE_TO_LOCAL_FIELD[field];if(localField){domains[localField]=normalized}}return{mode:"enterprise-v1",domains:domains,manifestDomains:manifestDomains,cdn:cdn}}
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
import{readFileSync,renameSync,unlinkSync,writeFileSync}from"node:fs";import{join}from"node:path";import{getActiveRegion,getActiveCdn,getApiDomain,getAppDomain,getCertificateDomain,getKbDomain,getLocalDomain,getRuntimeDomain,getSkillDomain,getUserDomain,isIndependentDeployment}from"../constant/domain.js";import{getOfficialRoutingProfile}from"../constant/routing-profile.js";export const PROJECT_DOMAIN_ROUTING_FILE_NAME="rabetbase.domain-routing.json";export const PROJECT_DOMAIN_ROUTING_PROTOCOL="lovrabet-project-domain-routing/v1";export function getProjectDomainRoutingManifest(){const region=getActiveRegion();const independent=isIndependentDeployment();const officialProfile=getOfficialRoutingProfile(region);const localDomain=getLocalDomain();const certificateDomain=getCertificateDomain();const cdn=getActiveCdn();if(!!localDomain!==!!certificateDomain){throw new Error("Independent deployment routing requires localDomain and certificateDomain together.")}return{
|
|
2
|
+
protocol:PROJECT_DOMAIN_ROUTING_PROTOCOL,mode:independent?"independent":"official",region:independent?null:region,domains:{api:getApiDomain(),runtime:getRuntimeDomain(),user:getUserDomain(),app:getAppDomain(),skill:getSkillDomain(),kb:getKbDomain()},cdn:cdn,local:localDomain&&certificateDomain?{origin:localDomain,certificateUrl:`${certificateDomain}/cert/lovrabet-dev.json`}:independent?{origin:"http://localhost"}:{origin:officialProfile.local.origin,certificateUrl:`${cdn.lovrabet}/cert/lovrabet-dev.json`}}}export function writeProjectDomainRoutingManifest(projectRoot){const manifest=getProjectDomainRoutingManifest();const filePath=join(projectRoot,PROJECT_DOMAIN_ROUTING_FILE_NAME);const content=`${JSON.stringify(manifest,null,2)}\n`;try{if(readFileSync(filePath,"utf8")===content){return{path:filePath,manifest:manifest,changed:false}}}catch{}const tempPath=`${filePath}.${process.pid}.${Date.now()}.tmp`;try{writeFileSync(tempPath,content,{encoding:"utf8",mode:420})
|
|
3
|
+
;renameSync(tempPath,filePath)}catch(error){try{unlinkSync(tempPath)}catch{}throw error}return{path:filePath,manifest:manifest,changed:true}}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import{CLI_BIN_NAME}from"../constant/cli.js";import{DEFAULT_LOVRABET_REGION,isInvalidLovrabetRegion,normalizeLovrabetRegion}from"../constant/region.js";import{CliErrors}from"../errors.js";export function selectConfiguredRegion(options){if(options.appRegion!==undefined&&options.appRegion!==null&&options.appRegion!==""){return{value:options.appRegion,source:"app"}}if(options.projectRegion!==undefined&&options.projectRegion!==null&&options.projectRegion!==""){return{value:options.projectRegion,source:"project"}}if(options.globalRegion!==undefined&&options.globalRegion!==null&&options.globalRegion!==""){return{value:options.globalRegion,source:"global"}}if(options.mergedRegion!==undefined&&options.mergedRegion!==null&&options.mergedRegion!==""){return{value:options.mergedRegion,source:"config"}}return{value:undefined,source:"default"}}function describeConfiguredRegion(value){return typeof value==="string"?JSON.stringify(value):`a value of type ${value===null?"null":typeof value}`}
|
|
2
|
+
export function resolveConfiguredRegion(value,location="Rabetbase configuration"){if(isInvalidLovrabetRegion(value)){throw CliErrors.validation(`Invalid country/region ${describeConfiguredRegion(value)} in ${location}.`,`Run \`${CLI_BIN_NAME} doctor\` to locate and repair the invalid configuration before retrying.`)}return normalizeLovrabetRegion(value)??DEFAULT_LOVRABET_REGION}export function resolveEffectiveRegion(options){const selected=selectConfiguredRegion(options);const location=selected.source==="app"?options.appName?`app profile "${options.appName}"`:"selected app profile":selected.source==="project"?"project Rabetbase configuration":selected.source==="global"?"global Rabetbase configuration":"Rabetbase configuration";return{region:resolveConfiguredRegion(selected.value,location),source:selected.source}}
|
package/lib/config/schema.js
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
const a272_0x5adbdf=a272_0xeba0;function a272_0xeba0(_0x478dad,_0x3ef0ff){_0x478dad=_0x478dad-0x10a;const _0x48c72c=a272_0x48c7();let _0xeba0b3=_0x48c72c[_0x478dad];return _0xeba0b3;}(function(_0xc0c4f0,_0x19725c){const _0xb6a064=a272_0xeba0,_0x12ad73=_0xc0c4f0();while(!![]){try{const _0x5b814d=-parseInt(_0xb6a064(0x114))/0x1*(-parseInt(_0xb6a064(0x13e))/0x2)+parseInt(_0xb6a064(0x11c))/0x3+parseInt(_0xb6a064(0x126))/0x4*(-parseInt(_0xb6a064(0x110))/0x5)+parseInt(_0xb6a064(0x129))/0x6*(-parseInt(_0xb6a064(0x10c))/0x7)+parseInt(_0xb6a064(0x122))/0x8*(parseInt(_0xb6a064(0x10b))/0x9)+-parseInt(_0xb6a064(0x115))/0xa*(-parseInt(_0xb6a064(0x116))/0xb)+-parseInt(_0xb6a064(0x10a))/0xc;if(_0x5b814d===_0x19725c)break;else _0x12ad73['push'](_0x12ad73['shift']());}catch(_0x168958){_0x12ad73['push'](_0x12ad73['shift']());}}}(a272_0x48c7,0xc73dd));import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{isDaily,isProduction,RABETBASE_ENV_VALUES}from'../constant/env.js';import{RABETBASE_OUTPUT_FORMAT_VALUES}from'../constant/output.js';import{RISK_LEVEL_VALUES}from'../constant/risk.js';import{ENABLED_LOVRABET_REGION_VALUES}from'../constant/region.js';export{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';export const PROJECT_CREATE_INHERITABLE_KEYS=['cookie',a272_0x5adbdf(0x131),a272_0x5adbdf(0x10f),a272_0x5adbdf(0x138),'riskLevel','region','routing',a272_0x5adbdf(0x11a),a272_0x5adbdf(0x11f),'runtimeDomain',a272_0x5adbdf(0x13d),'kbDomain','kbServiceDomain',a272_0x5adbdf(0x127),a272_0x5adbdf(0x10e),'certificateDomain'];export const TOP_LEVEL_CONFIG_KEYS=new Set([a272_0x5adbdf(0x12c),a272_0x5adbdf(0x13c),'locale',a272_0x5adbdf(0x138),a272_0x5adbdf(0x130),a272_0x5adbdf(0x131),a272_0x5adbdf(0x12b),'region',a272_0x5adbdf(0x11a),'apiDomain',a272_0x5adbdf(0x11d),a272_0x5adbdf(0x13d),'kbDomain',a272_0x5adbdf(0x11b),'appDomain',a272_0x5adbdf(0x10e),a272_0x5adbdf(0x13a)]);export const CONFIG_ENUM_VALUES={'env':[...RABETBASE_ENV_VALUES],'format':[...RABETBASE_OUTPUT_FORMAT_VALUES],'region':[...ENABLED_LOVRABET_REGION_VALUES]};function a272_0x48c7(){const _0x24af7d=['trim','356872qarCIA','toLowerCase','defaultApp','zh-CN','735836SXsOFO','appDomain','riskLevel','276lsDphJ','filter','apiDir','appcode','inherit','object','values','cookie','accessKey','has','Join\x20key\x20for\x20app\x20profiles\x20that\x20share\x20one\x20generated\x20API\x20model\x20registry','apps','Config\x20key\x20(','isArray','map','format','apiGroup','certificateDomain','Country/region\x20for\x20this\x20app\x20profile','env','skillDomain','2iIUOAY','Access\x20key','Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','en-US','entries','fromEntries','region','length','app','15626208ekIKjW','45aewYVM','50666aogXUK','keys','localDomain','locale','5fuxjNk','some','join','number','855884gvppum','3044810qVZYOQ','44FxqmMm','Auth\x20cookie','Default\x20page\x20size','App\x20locale\x20(not\x20CLI\x20language;\x20reserved\x20for\x20later\x20app\x20use)','userDomain','kbServiceDomain','1014993QetOHS','runtimeDomain','pageSize','apiDomain','string'];a272_0x48c7=function(){return _0x24af7d;};return a272_0x48c7();}export function formatConfigKeyList(_0x4dcf1f){const _0x4fd2e0=a272_0x5adbdf;return[..._0x4dcf1f][_0x4fd2e0(0x112)](',\x20');}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function isTopLevelConfigKey(_0x5e876c){const _0x1e7682=a272_0x5adbdf;return TOP_LEVEL_CONFIG_KEYS[_0x1e7682(0x132)](_0x5e876c);}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){const _0x350baf=a272_0x5adbdf;return _0x350baf(0x135)+getTopLevelConfigKeySummary()+')';}export const APP_PROFILE_FLAG_KEY_MAP={'apiGroup':a272_0x5adbdf(0x139),'region':a272_0x5adbdf(0x144),'env':a272_0x5adbdf(0x13c),'apiDir':a272_0x5adbdf(0x12b),'cookie':a272_0x5adbdf(0x130),'accessKey':'accessKey','defaultFormat':'format','pageSize':a272_0x5adbdf(0x11e),'riskLevel':a272_0x5adbdf(0x128),'locale':a272_0x5adbdf(0x10f)};export function getAppProfileFlagDefs(){const _0x311401=a272_0x5adbdf;return[{'name':_0x311401(0x139),'type':_0x311401(0x120),'description':_0x311401(0x133)},{'name':_0x311401(0x144),'type':_0x311401(0x120),'description':_0x311401(0x13b),'enum':[...ENABLED_LOVRABET_REGION_VALUES]},{'name':_0x311401(0x13c),'type':_0x311401(0x120),'description':'Target\x20environment','enum':[...RABETBASE_ENV_VALUES]},{'name':_0x311401(0x12b),'type':_0x311401(0x120),'description':'API\x20directory\x20path'},{'name':_0x311401(0x130),'type':_0x311401(0x120),'description':_0x311401(0x117),'hidden':!![]},{'name':_0x311401(0x131),'type':_0x311401(0x120),'description':_0x311401(0x13f),'hidden':!![]},{'name':'defaultFormat','type':_0x311401(0x120),'description':_0x311401(0x140),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':_0x311401(0x11e),'type':_0x311401(0x113),'description':_0x311401(0x118)},{'name':_0x311401(0x128),'type':'string','description':'Risk\x20level','enum':[...RISK_LEVEL_VALUES]},{'name':_0x311401(0x10f),'type':_0x311401(0x120),'description':_0x311401(0x119)}];}export function collectAppProfileOverrides(_0x2d1326){const _0x4794a2=a272_0x5adbdf,_0x1e4933={};for(const [_0x1fcebe,_0x3a3117]of Object['entries'](APP_PROFILE_FLAG_KEY_MAP)){const _0x384b2d=_0x2d1326(_0x1fcebe);if(!_0x384b2d)continue;_0x1e4933[_0x3a3117]=_0x3a3117===_0x4794a2(0x11e)?Number(_0x384b2d):_0x384b2d;}return _0x1e4933;}export function buildAppProfileListFields(_0x3f26cf){const _0x2afeaf=a272_0x5adbdf;return{'apiGroup':_0x3f26cf['apiGroup']??null,'region':_0x3f26cf[_0x2afeaf(0x144)]??null,'env':_0x3f26cf[_0x2afeaf(0x13c)]??null,'apiDir':_0x3f26cf['apiDir']??null,'hasCookie':!!_0x3f26cf[_0x2afeaf(0x130)],'hasAccessKey':!!_0x3f26cf[_0x2afeaf(0x131)],'format':_0x3f26cf[_0x2afeaf(0x138)]??null,'pageSize':_0x3f26cf['pageSize']??null,'riskLevel':_0x3f26cf[_0x2afeaf(0x128)]??null,'locale':_0x3f26cf[_0x2afeaf(0x10f)]??null};}export function buildAppDoctorFields(_0x4d65b0,_0x2fdc9d){const _0x508b65=a272_0x5adbdf;return{'region':{'value':_0x4d65b0[_0x508b65(0x144)]||_0x2fdc9d[_0x508b65(0x144)],'source':_0x4d65b0[_0x508b65(0x144)]?'app':_0x508b65(0x12d)},'env':{'value':_0x4d65b0[_0x508b65(0x13c)]||_0x2fdc9d[_0x508b65(0x13c)],'source':_0x4d65b0[_0x508b65(0x13c)]?_0x508b65(0x146):_0x508b65(0x12d)},'apiDir':{'value':_0x4d65b0['apiDir']||_0x2fdc9d[_0x508b65(0x12b)],'source':_0x4d65b0[_0x508b65(0x12b)]?'app':_0x508b65(0x12d)},'cookie':{'value':_0x4d65b0[_0x508b65(0x130)]||_0x2fdc9d[_0x508b65(0x130)],'source':_0x4d65b0[_0x508b65(0x130)]?'app':'inherit'},'accessKey':{'value':_0x4d65b0[_0x508b65(0x131)]||_0x2fdc9d[_0x508b65(0x131)],'source':_0x4d65b0[_0x508b65(0x131)]?'app':_0x508b65(0x12d)}};}export function buildCanonicalAppConfig(_0x507f78,_0x12a5b9){const _0x4d5e15=a272_0x5adbdf,_0x1864a2=_0x507f78[_0x4d5e15(0x137)](_0x5dfcc2=>String(_0x5dfcc2||'')[_0x4d5e15(0x121)]())[_0x4d5e15(0x12a)](Boolean);if(_0x1864a2[_0x4d5e15(0x145)]===0x0)return{};const _0x4fe915={};for(const _0xfb3616 of _0x1864a2){_0x4fe915[_0xfb3616]=_0x12a5b9&&!isProduction(_0x12a5b9)?{'appcode':_0xfb3616,'env':_0x12a5b9}:{'appcode':_0xfb3616};}return _0x1864a2[_0x4d5e15(0x145)]>0x1?{'apps':_0x4fe915,'defaultApp':_0x1864a2[0x0]}:{'apps':_0x4fe915};}export function normalizeStoredDefaultApp(_0x1c4b0d,_0x31f663){const _0x1946c0=a272_0x5adbdf,_0x4ef329=_0x1c4b0d['apps']&&typeof _0x1c4b0d['apps']===_0x1946c0(0x12e)?_0x1c4b0d[_0x1946c0(0x134)]:{},_0x38df84=Object[_0x1946c0(0x10d)](_0x4ef329);if(_0x38df84[_0x1946c0(0x145)]<=0x1)return delete _0x1c4b0d[_0x1946c0(0x124)],undefined;const _0x44e923=typeof _0x1c4b0d['defaultApp']==='string'&&_0x4ef329[_0x1c4b0d[_0x1946c0(0x124)]]?_0x1c4b0d[_0x1946c0(0x124)]:undefined,_0x3a2864=_0x31f663&&_0x4ef329[_0x31f663]?_0x31f663:_0x44e923;if(_0x3a2864)return _0x1c4b0d[_0x1946c0(0x124)]=_0x3a2864,_0x3a2864;return delete _0x1c4b0d[_0x1946c0(0x124)],undefined;}export function buildCanonicalProjectConfig(_0x5aa28b,_0x122dbd){const _0x2179b4=a272_0x5adbdf,{appCodes:appCodes=[],env:_0x5dc330,metadata:_0x453e6e}=_0x122dbd,_0x18eba0={..._0x5aa28b,..._0x453e6e||{}};delete _0x18eba0[_0x2179b4(0x12c)],delete _0x18eba0[_0x2179b4(0x146)];const _0x553a36=_0x5dc330||(typeof _0x18eba0[_0x2179b4(0x13c)]==='string'?_0x18eba0[_0x2179b4(0x13c)]:'')||DEFAULT_CONFIG_VALUES[_0x2179b4(0x13c)];if(isProduction(_0x553a36))delete _0x18eba0[_0x2179b4(0x13c)];else _0x18eba0[_0x2179b4(0x13c)]=_0x553a36;const _0x2b78f0=buildCanonicalAppConfig(appCodes,_0x553a36);if(Object[_0x2179b4(0x10d)](_0x2b78f0)[_0x2179b4(0x145)]>0x0){_0x18eba0[_0x2179b4(0x134)]=_0x2b78f0[_0x2179b4(0x134)];if(_0x2b78f0[_0x2179b4(0x124)])_0x18eba0[_0x2179b4(0x124)]=_0x2b78f0[_0x2179b4(0x124)];else delete _0x18eba0[_0x2179b4(0x124)];}return normalizeConfigForWrite(_0x18eba0);}function isRecord(_0x96f6b1){const _0x23f9ec=a272_0x5adbdf;return!!_0x96f6b1&&typeof _0x96f6b1===_0x23f9ec(0x12e)&&!Array[_0x23f9ec(0x136)](_0x96f6b1);}export function normalizeConfigForWrite(_0x5ce01c){const _0x417b34=a272_0x5adbdf,_0x439a8d={..._0x5ce01c},_0x3330dd=isRecord(_0x5ce01c[_0x417b34(0x134)])?_0x5ce01c[_0x417b34(0x134)]:undefined,_0x459963=_0x3330dd?Object[_0x417b34(0x143)](Object[_0x417b34(0x142)](_0x3330dd)[_0x417b34(0x137)](([_0x366d4a,_0x3e3360])=>[_0x366d4a,isRecord(_0x3e3360)?{..._0x3e3360}:_0x3e3360])):undefined;if(_0x459963){const _0xa8bec2=typeof _0x439a8d['env']===_0x417b34(0x120)?_0x439a8d[_0x417b34(0x13c)]:undefined,_0x4ffc9f=Object[_0x417b34(0x12f)](_0x459963)[_0x417b34(0x111)](_0x1e0806=>isRecord(_0x1e0806)&&typeof _0x1e0806['env']===_0x417b34(0x120)&&isProduction(_0x1e0806[_0x417b34(0x13c)]));if(_0xa8bec2&&isDaily(_0xa8bec2)&&_0x4ffc9f){for(const _0xa4b365 of Object[_0x417b34(0x12f)](_0x459963)){if(!isRecord(_0xa4b365))continue;if(_0xa4b365[_0x417b34(0x13c)]===undefined)_0xa4b365[_0x417b34(0x13c)]=_0xa8bec2;}delete _0x439a8d['env'];}for(const _0x35fe63 of Object[_0x417b34(0x12f)](_0x459963)){isRecord(_0x35fe63)&&typeof _0x35fe63[_0x417b34(0x13c)]===_0x417b34(0x120)&&isProduction(_0x35fe63[_0x417b34(0x13c)])&&delete _0x35fe63[_0x417b34(0x13c)];}_0x439a8d[_0x417b34(0x134)]=_0x459963;}return typeof _0x439a8d['env']==='string'&&isProduction(_0x439a8d[_0x417b34(0x13c)])&&delete _0x439a8d['env'],_0x439a8d;}const LOCALE_MAP={'zh':a272_0x5adbdf(0x125),'zh-cn':a272_0x5adbdf(0x125),'zh_cn':a272_0x5adbdf(0x125),'en':a272_0x5adbdf(0x141),'en-us':a272_0x5adbdf(0x141),'en_us':'en-US'};export function normalizeLocale(_0x4bff49){const _0x553b43=a272_0x5adbdf;if(!_0x4bff49)return null;return LOCALE_MAP[_0x4bff49[_0x553b43(0x123)]()]??null;}
|
|
1
|
+
import{DEFAULT_CONFIG_VALUES}from"../constant/defaults.js";import{isDaily,isProduction,RABETBASE_ENV_VALUES}from"../constant/env.js";import{RABETBASE_OUTPUT_FORMAT_VALUES}from"../constant/output.js";import{RISK_LEVEL_VALUES}from"../constant/risk.js";import{ENABLED_LOVRABET_REGION_VALUES}from"../constant/region.js";export{DEFAULT_CONFIG_VALUES}from"../constant/defaults.js";export const PROJECT_CREATE_INHERITABLE_KEYS=["cookie","accessKey","locale","format","riskLevel","region","routing","userDomain","apiDomain","runtimeDomain","skillDomain","kbDomain","kbServiceDomain","appDomain","localDomain","certificateDomain"];export const TOP_LEVEL_CONFIG_KEYS=new Set(["appcode","env","locale","format","cookie","accessKey","apiDir","region","userDomain","apiDomain","runtimeDomain","skillDomain","kbDomain","kbServiceDomain","appDomain","localDomain","certificateDomain"]);export const CONFIG_ENUM_VALUES={env:[...RABETBASE_ENV_VALUES],format:[...RABETBASE_OUTPUT_FORMAT_VALUES],
|
|
2
|
+
region:[...ENABLED_LOVRABET_REGION_VALUES]};export function formatConfigKeyList(keys){return[...keys].join(", ")}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS]}export function isTopLevelConfigKey(key){return TOP_LEVEL_CONFIG_KEYS.has(key)}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList())}export function getConfigCommandKeyDescription(){return`Config key (${getTopLevelConfigKeySummary()})`}export const APP_PROFILE_FLAG_KEY_MAP={apiGroup:"apiGroup",region:"region",env:"env",apiDir:"apiDir",cookie:"cookie",accessKey:"accessKey",defaultFormat:"format",pageSize:"pageSize",riskLevel:"riskLevel",locale:"locale"};export function getAppProfileFlagDefs(){return[{name:"apiGroup",type:"string",description:"Join key for app profiles that share one generated API model registry"},{name:"region",type:"string",description:"Country/region for this app profile",enum:[...ENABLED_LOVRABET_REGION_VALUES]},{name:"env",
|
|
3
|
+
type:"string",description:"Target environment",enum:[...RABETBASE_ENV_VALUES]},{name:"apiDir",type:"string",description:"API directory path"},{name:"cookie",type:"string",description:"Auth cookie",hidden:true},{name:"accessKey",type:"string",description:"Access key",hidden:true},{name:"defaultFormat",type:"string",description:"Default output format for this app (profile)",enum:[...RABETBASE_OUTPUT_FORMAT_VALUES]},{name:"pageSize",type:"number",description:"Default page size"},{name:"riskLevel",type:"string",description:"Risk level",enum:[...RISK_LEVEL_VALUES]},{name:"locale",type:"string",description:"App locale (not CLI language; reserved for later app use)"}]}export function collectAppProfileOverrides(getFlagValue){const profile={};for(const[flagKey,profileKey]of Object.entries(APP_PROFILE_FLAG_KEY_MAP)){const val=getFlagValue(flagKey);if(!val)continue;profile[profileKey]=profileKey==="pageSize"?Number(val):val}return profile}export function buildAppProfileListFields(profile){return{
|
|
4
|
+
apiGroup:profile.apiGroup??null,region:profile.region??null,env:profile.env??null,apiDir:profile.apiDir??null,hasCookie:!!profile.cookie,hasAccessKey:!!profile.accessKey,format:profile.format??null,pageSize:profile.pageSize??null,riskLevel:profile.riskLevel??null,locale:profile.locale??null}}export function buildAppDoctorFields(profile,effective){return{region:{value:profile.region||effective.region,source:profile.region?"app":"inherit"},env:{value:profile.env||effective.env,source:profile.env?"app":"inherit"},apiDir:{value:profile.apiDir||effective.apiDir,source:profile.apiDir?"app":"inherit"},cookie:{value:profile.cookie||effective.cookie,source:profile.cookie?"app":"inherit"},accessKey:{value:profile.accessKey||effective.accessKey,source:profile.accessKey?"app":"inherit"}}}export function buildCanonicalAppConfig(appCodes,env){const normalized=appCodes.map(code=>String(code||"").trim()).filter(Boolean);if(normalized.length===0)return{};const apps={};for(const appCode of normalized){
|
|
5
|
+
apps[appCode]=env&&!isProduction(env)?{appcode:appCode,env:env}:{appcode:appCode}}return normalized.length>1?{apps:apps,defaultApp:normalized[0]}:{apps:apps}}export function normalizeStoredDefaultApp(config,preferredApp){const apps=config.apps&&typeof config.apps==="object"?config.apps:{};const names=Object.keys(apps);if(names.length<=1){delete config.defaultApp;return undefined}const current=typeof config.defaultApp==="string"&&apps[config.defaultApp]?config.defaultApp:undefined;const selected=preferredApp&&apps[preferredApp]?preferredApp:current;if(selected){config.defaultApp=selected;return selected}delete config.defaultApp;return undefined}export function buildCanonicalProjectConfig(base,options){const{appCodes:appCodes=[],env:env,metadata:metadata}=options;const config={...base,...metadata||{}};delete config.appcode;delete config.app;const effectiveEnv=env||(typeof config.env==="string"?config.env:"")||DEFAULT_CONFIG_VALUES.env
|
|
6
|
+
;if(isProduction(effectiveEnv))delete config.env;else config.env=effectiveEnv;const appConfig=buildCanonicalAppConfig(appCodes,effectiveEnv);if(Object.keys(appConfig).length>0){config.apps=appConfig.apps;if(appConfig.defaultApp)config.defaultApp=appConfig.defaultApp;else delete config.defaultApp}return normalizeConfigForWrite(config)}function isRecord(value){return!!value&&typeof value==="object"&&!Array.isArray(value)}export function normalizeConfigForWrite(input){const config={...input};const inputApps=isRecord(input.apps)?input.apps:undefined;const apps=inputApps?Object.fromEntries(Object.entries(inputApps).map(([name,profile])=>[name,isRecord(profile)?{...profile}:profile])):undefined;if(apps){const topLevelEnv=typeof config.env==="string"?config.env:undefined;const hasDefaultOverride=Object.values(apps).some(profile=>isRecord(profile)&&typeof profile.env==="string"&&isProduction(profile.env));if(topLevelEnv&&isDaily(topLevelEnv)&&hasDefaultOverride){
|
|
7
|
+
for(const profile of Object.values(apps)){if(!isRecord(profile))continue;if(profile.env===undefined)profile.env=topLevelEnv}delete config.env}for(const profile of Object.values(apps)){if(isRecord(profile)&&typeof profile.env==="string"&&isProduction(profile.env)){delete profile.env}}config.apps=apps}if(typeof config.env==="string"&&isProduction(config.env)){delete config.env}return config}const LOCALE_MAP={zh:"zh-CN","zh-cn":"zh-CN",zh_cn:"zh-CN",en:"en-US","en-us":"en-US",en_us:"en-US"};export function normalizeLocale(value){if(!value)return null;return LOCALE_MAP[value.toLowerCase()]??null}
|
package/lib/constant/cdn.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import{getActiveCdn}from"../constant/domain.js";const RABETBASE_CDN_PROJECT="rabetbase-cli";const RABETBASE_CDN_CONFIG_ORIGIN="https://g.lovrabet.com";const CDN_CONFIG_PATH="config/index.json";const PROJECT_TEMPLATE_ASSET_PATH="templates/projects";const PROJECT_TEMPLATE_ARCHIVE_NAMES=Object.freeze({release:"sub-app-react-demo.zip",beta:"sub-app-react-demo-beta.zip"});export const RABETBASE_CDN_PROJECT_PATH=`/dist/${RABETBASE_CDN_PROJECT}`;function getRabetbaseCdnBaseUrl(){return`${getActiveCdn().lovrabet}${RABETBASE_CDN_PROJECT_PATH}`}export function getCliVersionPolicyUrl(){return`${RABETBASE_CDN_CONFIG_ORIGIN}${RABETBASE_CDN_PROJECT_PATH}/${CDN_CONFIG_PATH}`}export function getProjectTemplateAssetBaseUrl(){return`${getRabetbaseCdnBaseUrl()}/${PROJECT_TEMPLATE_ASSET_PATH}`}export function getProjectTemplateLegacyAssetBaseUrl(){return`${RABETBASE_CDN_CONFIG_ORIGIN}${RABETBASE_CDN_PROJECT_PATH}/${PROJECT_TEMPLATE_ASSET_PATH}`}
|
|
2
|
+
export function getProjectTemplateRelativeUrl(channel,version){const archiveName=version?`sub-app-react-demo-${version}.zip`:PROJECT_TEMPLATE_ARCHIVE_NAMES[channel];return`${RABETBASE_CDN_PROJECT_PATH}/${PROJECT_TEMPLATE_ASSET_PATH}/${archiveName}`}
|
package/lib/constant/cli.js
CHANGED
|
@@ -1 +1,8 @@
|
|
|
1
|
-
const a274_0x360a19=a274_0xf87c;(function(_0x3c8527,_0x6ad848){const _0x72199c=a274_0xf87c,_0x2bcec1=_0x3c8527();while(!![]){try{const _0x388d78=parseInt(_0x72199c(0x1c5))/0x1*(parseInt(_0x72199c(0x172))/0x2)+-parseInt(_0x72199c(0x1c3))/0x3*(-parseInt(_0x72199c(0x170))/0x4)+parseInt(_0x72199c(0x1a0))/0x5*(-parseInt(_0x72199c(0x17a))/0x6)+-parseInt(_0x72199c(0x15f))/0x7+parseInt(_0x72199c(0x150))/0x8*(-parseInt(_0x72199c(0x151))/0x9)+parseInt(_0x72199c(0x165))/0xa+-parseInt(_0x72199c(0x143))/0xb*(parseInt(_0x72199c(0x162))/0xc);if(_0x388d78===_0x6ad848)break;else _0x2bcec1['push'](_0x2bcec1['shift']());}catch(_0x3829a0){_0x2bcec1['push'](_0x2bcec1['shift']());}}}(a274_0x2f01,0x820c8));export const CLI_BIN_NAME='rabetbase';function a274_0xf87c(_0x2fb39e,_0x505755){_0x2fb39e=_0x2fb39e-0x143;const _0x2f0165=a274_0x2f01();let _0xf87cbf=_0x2f0165[_0x2fb39e];return _0xf87cbf;}function a274_0x2f01(){const _0x10cc3e=['all','sqlcode','boolean','global','sqlname','Force\x20overwrite','remote','codes','code','dry-run','Dataset\x20code','operation','Rabetbase\x20CLI','menu-ids','file','842743roSAbf','Operation\x20type','description','expectPath','map','skip-imports','title','datasetcode','Page\x20size','page','Record\x20ID','Use\x20remote','Comma-separated\x20metadata\x20codes','57808AYqwEN','126PyYAXH','flow-code','schemas','target','<name>','Description\x20file','env','tags','value','enable-bff-save','Description','meowKey','Page\x20number','taskId','7320243DnXbjv','Select\x20app\x20profile\x20by\x20name','JSON\x20params','48nQBOmM','enableBffSave','page-size','6268330fiFtci','function-node','expect-path','Expected\x20current\x20parent\x20menu\x20id','Type\x20filter','Environment','from-env','locale','expected-count','Code\x20filter','Override\x20appcode','109932TXSZes','flow-type','2053666KCYVPe','dbid','confirm','operation-type','pagesize','DB\x20ID','non-interactive','parent-id','6BONwJa','task-id','watch','Watch\x20mode','Config\x20key','Skip\x20import\x20generation','fromEntries','Read\x20value\x20from\x20environment\x20variable','keyword','Title','type','Read\x20value\x20from\x20stdin','appcode','Enable\x20Backend\x20Function\x20save','expectedChildrenCount','<expr>','Reveal\x20sensitive\x20value','sql','expected-children-count','Expected\x20current\x20menu\x20path','operationType','SQL\x20string','Force\x20non-interactive\x20mode\x20(CI)','description-file','force','app','key','Filter\x20JSON\x20output\x20(JQ_PATH\x20>\x20bundled\x20jq\x20>\x20PATH;\x20use\x20with\x20--format\x20json\x20or\x20compress)','Use\x20global\x20config\x20scope','datasetCode','SQL\x20name','App\x20locale\x20(workspace\x20pass-through;\x20not\x20CLI\x20language)','Output\x20path','Config\x20value','File\x20path','string','params','Maximum\x20search\x20hits','2597970lFQxar','Alias\x20for\x20--non-interactive','fromEnv','sort','label','yes','Use\x20project\x20config\x20scope','Name','Parent\x20menu\x20id','skipImports','Apply\x20to\x20all','output','Show\x20help','Flow\x20name','json\x20|\x20pretty\x20|\x20compress','clear','Keyword\x20filter','Function\x20node','flow-name','parentId','dbId','verbose','dryRun','expectedCount','sqlName','stdin','Expected\x20affected\x20count','Tags','query','reveal','help','Flow\x20type','Clear','project','dataset-code','93fUkXWt','format','1IPoJsO','topk','Search\x20query','functionNode','descriptionFile'];a274_0x2f01=function(){return _0x10cc3e;};return a274_0x2f01();}export const CLI_DISPLAY_NAME=a274_0x360a19(0x1d6);export const NPM_PACKAGE_NAME='@lovrabet/rabetbase-cli';export const GLOBAL_FLAGS=[{'name':a274_0x360a19(0x186),'meowKey':'appcode','type':a274_0x360a19(0x19d),'description':a274_0x360a19(0x16f),'hint':'<code>'},{'name':a274_0x360a19(0x193),'meowKey':a274_0x360a19(0x193),'type':a274_0x360a19(0x19d),'description':a274_0x360a19(0x160),'hint':a274_0x360a19(0x155)},{'name':a274_0x360a19(0x157),'meowKey':a274_0x360a19(0x157),'type':a274_0x360a19(0x19d),'description':a274_0x360a19(0x16a),'hint':'production\x20|\x20daily'},{'name':a274_0x360a19(0x1c4),'meowKey':a274_0x360a19(0x1c4),'type':'string','description':'Output\x20format','hint':a274_0x360a19(0x1ae)},{'name':'jq','meowKey':'jq','type':a274_0x360a19(0x19d),'description':a274_0x360a19(0x195),'hint':a274_0x360a19(0x189)},{'name':'dry-run','meowKey':a274_0x360a19(0x1b6),'type':a274_0x360a19(0x1cc),'description':'Preview\x20operation\x20without\x20executing'},{'name':a274_0x360a19(0x1a5),'meowKey':'yes','type':a274_0x360a19(0x1cc),'description':'Skip\x20confirmation\x20for\x20high-risk\x20writes'},{'name':a274_0x360a19(0x178),'meowKey':'nonInteractive','type':a274_0x360a19(0x1cc),'description':a274_0x360a19(0x190)},{'name':'global','meowKey':a274_0x360a19(0x1cd),'type':a274_0x360a19(0x1cc),'description':a274_0x360a19(0x196)},{'name':a274_0x360a19(0x1c1),'meowKey':a274_0x360a19(0x1c1),'type':a274_0x360a19(0x1cc),'description':a274_0x360a19(0x1a6)},{'name':'ci','meowKey':'ci','type':a274_0x360a19(0x1cc),'description':a274_0x360a19(0x1a1),'hidden':!![]},{'name':a274_0x360a19(0x1be),'meowKey':a274_0x360a19(0x1be),'type':a274_0x360a19(0x1cc),'description':a274_0x360a19(0x1ac)},{'name':a274_0x360a19(0x16c),'meowKey':a274_0x360a19(0x16c),'type':a274_0x360a19(0x19d),'description':a274_0x360a19(0x199),'hidden':!![],'hint':'zh-CN\x20|\x20en-US'},{'name':'name','meowKey':'name','type':a274_0x360a19(0x19d),'description':a274_0x360a19(0x1a7),'hidden':!![]},{'name':a274_0x360a19(0x149),'meowKey':a274_0x360a19(0x149),'type':a274_0x360a19(0x19d),'description':a274_0x360a19(0x183),'hidden':!![]},{'name':a274_0x360a19(0x1bc),'meowKey':a274_0x360a19(0x1bc),'type':a274_0x360a19(0x19d),'description':a274_0x360a19(0x1c7),'hidden':!![]},{'name':a274_0x360a19(0x1c6),'meowKey':'topk','type':'string','description':a274_0x360a19(0x19f),'hidden':!![]},{'name':a274_0x360a19(0x1af),'meowKey':a274_0x360a19(0x1af),'type':a274_0x360a19(0x1cc),'description':a274_0x360a19(0x1c0),'hidden':!![]},{'name':a274_0x360a19(0x17c),'meowKey':a274_0x360a19(0x17c),'type':'boolean','description':a274_0x360a19(0x17d),'hidden':!![]},{'name':a274_0x360a19(0x1ab),'meowKey':'output','type':a274_0x360a19(0x19d),'description':a274_0x360a19(0x19a),'hidden':!![]},{'name':a274_0x360a19(0x19e),'meowKey':a274_0x360a19(0x19e),'type':a274_0x360a19(0x19d),'description':a274_0x360a19(0x161),'hidden':!![]},{'name':a274_0x360a19(0x14a),'meowKey':'datasetcode','type':'string','description':a274_0x360a19(0x1d4),'hidden':!![]},{'name':a274_0x360a19(0x1ca),'meowKey':a274_0x360a19(0x1ca),'type':a274_0x360a19(0x1cc),'description':a274_0x360a19(0x1aa),'hidden':!![]},{'name':a274_0x360a19(0x15a),'meowKey':a274_0x360a19(0x163),'type':a274_0x360a19(0x1cc),'description':a274_0x360a19(0x187),'hidden':!![]},{'name':'id','meowKey':'id','type':a274_0x360a19(0x19d),'description':a274_0x360a19(0x14d),'hidden':!![]},{'name':'type','meowKey':a274_0x360a19(0x184),'type':a274_0x360a19(0x19d),'description':a274_0x360a19(0x169),'hidden':!![]},{'name':'file','meowKey':a274_0x360a19(0x1d8),'type':'string','description':a274_0x360a19(0x19c),'hidden':!![]},{'name':a274_0x360a19(0x152),'meowKey':'flowCode','type':'string','description':'Flow\x20code','hidden':!![]},{'name':a274_0x360a19(0x1b2),'meowKey':'flowName','type':'string','description':a274_0x360a19(0x1ad),'hidden':!![]},{'name':'flow-status','meowKey':'flowStatus','type':a274_0x360a19(0x19d),'description':'Flow\x20status','hidden':!![]},{'name':a274_0x360a19(0x171),'meowKey':'flowType','type':a274_0x360a19(0x19d),'description':a274_0x360a19(0x1bf),'hidden':!![]},{'name':a274_0x360a19(0x1c2),'meowKey':a274_0x360a19(0x197),'type':'string','description':a274_0x360a19(0x1d4),'hidden':!![]},{'name':a274_0x360a19(0x1cb),'meowKey':'sqlcode','type':'string','description':'SQL\x20code','hidden':!![]},{'name':'sql-name','meowKey':a274_0x360a19(0x1b8),'type':a274_0x360a19(0x19d),'description':a274_0x360a19(0x198),'hidden':!![]},{'name':a274_0x360a19(0x1ce),'meowKey':a274_0x360a19(0x1ce),'type':a274_0x360a19(0x19d),'description':a274_0x360a19(0x198),'hidden':!![]},{'name':'db-id','meowKey':a274_0x360a19(0x1b4),'type':a274_0x360a19(0x19d),'description':a274_0x360a19(0x177),'hidden':!![]},{'name':a274_0x360a19(0x173),'meowKey':'dbid','type':'string','description':'DB\x20ID','hidden':!![]},{'name':a274_0x360a19(0x145),'meowKey':a274_0x360a19(0x145),'type':a274_0x360a19(0x19d),'description':a274_0x360a19(0x15b),'hidden':!![]},{'name':a274_0x360a19(0x191),'meowKey':a274_0x360a19(0x1c9),'type':a274_0x360a19(0x19d),'description':a274_0x360a19(0x156),'hidden':!![]},{'name':'page','meowKey':a274_0x360a19(0x14c),'type':a274_0x360a19(0x19d),'description':a274_0x360a19(0x15d),'hidden':!![]},{'name':a274_0x360a19(0x164),'meowKey':'pageSize','type':a274_0x360a19(0x19d),'description':a274_0x360a19(0x14b),'hidden':!![]},{'name':a274_0x360a19(0x176),'meowKey':a274_0x360a19(0x176),'type':'string','description':a274_0x360a19(0x14b),'hidden':!![]},{'name':a274_0x360a19(0x182),'meowKey':a274_0x360a19(0x182),'type':'string','description':a274_0x360a19(0x1b0),'hidden':!![]},{'name':a274_0x360a19(0x1d2),'meowKey':'code','type':a274_0x360a19(0x19d),'description':a274_0x360a19(0x16e),'hidden':!![]},{'name':a274_0x360a19(0x18b),'meowKey':'sql','type':a274_0x360a19(0x19d),'description':a274_0x360a19(0x18f),'hidden':!![]},{'name':a274_0x360a19(0x153),'meowKey':a274_0x360a19(0x153),'type':'string','description':'Schemas','hidden':!![]},{'name':a274_0x360a19(0x1d5),'meowKey':a274_0x360a19(0x1d5),'type':'string','description':'Operation\x20type','hidden':!![]},{'name':a274_0x360a19(0x154),'meowKey':a274_0x360a19(0x154),'type':a274_0x360a19(0x19d),'description':'Target\x20path','hidden':!![]},{'name':a274_0x360a19(0x148),'meowKey':a274_0x360a19(0x1a9),'type':'boolean','description':a274_0x360a19(0x17f),'hidden':!![]},{'name':a274_0x360a19(0x194),'meowKey':a274_0x360a19(0x194),'type':a274_0x360a19(0x19d),'description':a274_0x360a19(0x17e),'hidden':!![]},{'name':a274_0x360a19(0x159),'meowKey':a274_0x360a19(0x159),'type':a274_0x360a19(0x19d),'description':a274_0x360a19(0x19b),'hidden':!![]},{'name':'tags','meowKey':a274_0x360a19(0x158),'type':a274_0x360a19(0x19d),'description':a274_0x360a19(0x1bb),'hidden':!![]},{'name':a274_0x360a19(0x1b9),'meowKey':a274_0x360a19(0x1b9),'type':a274_0x360a19(0x1cc),'description':a274_0x360a19(0x185),'hidden':!![]},{'name':a274_0x360a19(0x16b),'meowKey':a274_0x360a19(0x1a2),'type':a274_0x360a19(0x19d),'description':a274_0x360a19(0x181),'hidden':!![]},{'name':a274_0x360a19(0x1bd),'meowKey':'reveal','type':a274_0x360a19(0x1cc),'description':a274_0x360a19(0x18a),'hidden':!![]},{'name':a274_0x360a19(0x192),'meowKey':a274_0x360a19(0x192),'type':'boolean','description':a274_0x360a19(0x1cf),'hidden':!![]},{'name':a274_0x360a19(0x174),'meowKey':a274_0x360a19(0x174),'type':'boolean','description':'Confirm\x20destructive\x20action','hidden':!![]},{'name':a274_0x360a19(0x1d0),'meowKey':a274_0x360a19(0x1d0),'type':a274_0x360a19(0x1cc),'description':a274_0x360a19(0x14e),'hidden':!![]},{'name':a274_0x360a19(0x1b5),'meowKey':'verbose','type':a274_0x360a19(0x1cc),'description':'Verbose\x20output','hidden':!![]},{'name':a274_0x360a19(0x16d),'meowKey':a274_0x360a19(0x1b7),'type':'string','description':a274_0x360a19(0x1ba),'hidden':!![]},{'name':a274_0x360a19(0x1a4),'meowKey':a274_0x360a19(0x1a4),'type':'string','description':'Menu\x20label','hidden':!![]},{'name':a274_0x360a19(0x179),'meowKey':a274_0x360a19(0x1b3),'type':a274_0x360a19(0x19d),'description':a274_0x360a19(0x1a8),'hidden':!![]},{'name':'sort','meowKey':a274_0x360a19(0x1a3),'type':a274_0x360a19(0x19d),'description':'Menu\x20sort\x20value','hidden':!![]},{'name':'expect-parent-id','meowKey':'expectParentId','type':a274_0x360a19(0x19d),'description':a274_0x360a19(0x168),'hidden':!![]},{'name':a274_0x360a19(0x167),'meowKey':a274_0x360a19(0x146),'type':a274_0x360a19(0x19d),'description':a274_0x360a19(0x18d),'hidden':!![]},{'name':a274_0x360a19(0x18c),'meowKey':a274_0x360a19(0x188),'type':a274_0x360a19(0x19d),'description':'Expected\x20current\x20child\x20count','hidden':!![]},{'name':a274_0x360a19(0x1d7),'meowKey':'menuIds','type':a274_0x360a19(0x19d),'description':'Comma-separated\x20menu\x20IDs','hidden':!![]},{'name':a274_0x360a19(0x17b),'meowKey':a274_0x360a19(0x15e),'type':'string','description':'Asynchronous\x20task\x20ID','hidden':!![]},{'name':a274_0x360a19(0x175),'meowKey':a274_0x360a19(0x18e),'type':'string','description':a274_0x360a19(0x144),'hidden':!![]},{'name':a274_0x360a19(0x166),'meowKey':a274_0x360a19(0x1c8),'type':'string','description':a274_0x360a19(0x1b1),'hidden':!![]},{'name':a274_0x360a19(0x1d1),'meowKey':a274_0x360a19(0x1d1),'type':'string','description':a274_0x360a19(0x14f),'hidden':!![]}];export const PIPELINE_FLAG_NAMES=new Set([a274_0x360a19(0x186),a274_0x360a19(0x193),a274_0x360a19(0x157),'format','jq',a274_0x360a19(0x1d3),a274_0x360a19(0x1a5),a274_0x360a19(0x178),'ci']);export function buildMeowFlags(){const _0x18fb21=a274_0x360a19;return Object[_0x18fb21(0x180)](GLOBAL_FLAGS[_0x18fb21(0x147)](_0x5c9e0b=>[_0x5c9e0b[_0x18fb21(0x15c)],{'type':_0x5c9e0b[_0x18fb21(0x184)]}]));}
|
|
1
|
+
export const CLI_BIN_NAME="rabetbase";export const CLI_DISPLAY_NAME="Rabetbase CLI";export const NPM_PACKAGE_NAME="@lovrabet/rabetbase-cli";export const GLOBAL_FLAGS=[{name:"appcode",meowKey:"appcode",type:"string",description:"Override appcode",hint:"<code>"},{name:"app",meowKey:"app",type:"string",description:"Select app profile by name",hint:"<name>"},{name:"env",meowKey:"env",type:"string",description:"Environment",hint:"production | daily"},{name:"format",meowKey:"format",type:"string",description:"Output format",hint:"json | pretty | compress"},{name:"jq",meowKey:"jq",type:"string",description:"Filter JSON output (JQ_PATH > bundled jq > PATH; use with --format json or compress)",hint:"<expr>"},{name:"dry-run",meowKey:"dryRun",type:"boolean",description:"Preview operation without executing"},{name:"yes",meowKey:"yes",type:"boolean",description:"Skip confirmation for high-risk writes"},{name:"non-interactive",meowKey:"nonInteractive",type:"boolean",
|
|
2
|
+
description:"Force non-interactive mode (CI)"},{name:"global",meowKey:"global",type:"boolean",description:"Use global config scope"},{name:"project",meowKey:"project",type:"boolean",description:"Use project config scope"},{name:"ci",meowKey:"ci",type:"boolean",description:"Alias for --non-interactive",hidden:true},{name:"help",meowKey:"help",type:"boolean",description:"Show help"},{name:"locale",meowKey:"locale",type:"string",description:"App locale (workspace pass-through; not CLI language)",hidden:true,hint:"zh-CN | en-US"},{name:"name",meowKey:"name",type:"string",description:"Name",hidden:true},{name:"title",meowKey:"title",type:"string",description:"Title",hidden:true},{name:"query",meowKey:"query",type:"string",description:"Search query",hidden:true},{name:"topk",meowKey:"topk",type:"string",description:"Maximum search hits",hidden:true},{name:"clear",meowKey:"clear",type:"boolean",description:"Clear",hidden:true},{name:"watch",meowKey:"watch",type:"boolean",
|
|
3
|
+
description:"Watch mode",hidden:true},{name:"output",meowKey:"output",type:"string",description:"Output path",hidden:true},{name:"params",meowKey:"params",type:"string",description:"JSON params",hidden:true},{name:"datasetcode",meowKey:"datasetcode",type:"string",description:"Dataset code",hidden:true},{name:"all",meowKey:"all",type:"boolean",description:"Apply to all",hidden:true},{name:"enable-bff-save",meowKey:"enableBffSave",type:"boolean",description:"Enable Backend Function save",hidden:true},{name:"id",meowKey:"id",type:"string",description:"Record ID",hidden:true},{name:"type",meowKey:"type",type:"string",description:"Type filter",hidden:true},{name:"file",meowKey:"file",type:"string",description:"File path",hidden:true},{name:"flow-code",meowKey:"flowCode",type:"string",description:"Flow code",hidden:true},{name:"flow-name",meowKey:"flowName",type:"string",description:"Flow name",hidden:true},{name:"flow-status",meowKey:"flowStatus",type:"string",description:"Flow status",
|
|
4
|
+
hidden:true},{name:"flow-type",meowKey:"flowType",type:"string",description:"Flow type",hidden:true},{name:"dataset-code",meowKey:"datasetCode",type:"string",description:"Dataset code",hidden:true},{name:"sqlcode",meowKey:"sqlcode",type:"string",description:"SQL code",hidden:true},{name:"sql-name",meowKey:"sqlName",type:"string",description:"SQL name",hidden:true},{name:"sqlname",meowKey:"sqlname",type:"string",description:"SQL name",hidden:true},{name:"db-id",meowKey:"dbId",type:"string",description:"DB ID",hidden:true},{name:"dbid",meowKey:"dbid",type:"string",description:"DB ID",hidden:true},{name:"description",meowKey:"description",type:"string",description:"Description",hidden:true},{name:"description-file",meowKey:"descriptionFile",type:"string",description:"Description file",hidden:true},{name:"page",meowKey:"page",type:"string",description:"Page number",hidden:true},{name:"page-size",meowKey:"pageSize",type:"string",description:"Page size",hidden:true},{name:"pagesize",
|
|
5
|
+
meowKey:"pagesize",type:"string",description:"Page size",hidden:true},{name:"keyword",meowKey:"keyword",type:"string",description:"Keyword filter",hidden:true},{name:"code",meowKey:"code",type:"string",description:"Code filter",hidden:true},{name:"sql",meowKey:"sql",type:"string",description:"SQL string",hidden:true},{name:"schemas",meowKey:"schemas",type:"string",description:"Schemas",hidden:true},{name:"operation",meowKey:"operation",type:"string",description:"Operation type",hidden:true},{name:"target",meowKey:"target",type:"string",description:"Target path",hidden:true},{name:"skip-imports",meowKey:"skipImports",type:"boolean",description:"Skip import generation",hidden:true},{name:"key",meowKey:"key",type:"string",description:"Config key",hidden:true},{name:"value",meowKey:"value",type:"string",description:"Config value",hidden:true},{name:"tags",meowKey:"tags",type:"string",description:"Tags",hidden:true},{name:"stdin",meowKey:"stdin",type:"boolean",
|
|
6
|
+
description:"Read value from stdin",hidden:true},{name:"from-env",meowKey:"fromEnv",type:"string",description:"Read value from environment variable",hidden:true},{name:"reveal",meowKey:"reveal",type:"boolean",description:"Reveal sensitive value",hidden:true},{name:"force",meowKey:"force",type:"boolean",description:"Force overwrite",hidden:true},{name:"confirm",meowKey:"confirm",type:"boolean",description:"Confirm destructive action",hidden:true},{name:"remote",meowKey:"remote",type:"boolean",description:"Use remote",hidden:true},{name:"verbose",meowKey:"verbose",type:"boolean",description:"Verbose output",hidden:true},{name:"expected-count",meowKey:"expectedCount",type:"string",description:"Expected affected count",hidden:true},{name:"label",meowKey:"label",type:"string",description:"Menu label",hidden:true},{name:"parent-id",meowKey:"parentId",type:"string",description:"Parent menu id",hidden:true},{name:"sort",meowKey:"sort",type:"string",description:"Menu sort value",hidden:true},{
|
|
7
|
+
name:"expect-parent-id",meowKey:"expectParentId",type:"string",description:"Expected current parent menu id",hidden:true},{name:"expect-path",meowKey:"expectPath",type:"string",description:"Expected current menu path",hidden:true},{name:"expected-children-count",meowKey:"expectedChildrenCount",type:"string",description:"Expected current child count",hidden:true},{name:"menu-ids",meowKey:"menuIds",type:"string",description:"Comma-separated menu IDs",hidden:true},{name:"task-id",meowKey:"taskId",type:"string",description:"Asynchronous task ID",hidden:true},{name:"operation-type",meowKey:"operationType",type:"string",description:"Operation type",hidden:true},{name:"function-node",meowKey:"functionNode",type:"string",description:"Function node",hidden:true},{name:"codes",meowKey:"codes",type:"string",description:"Comma-separated metadata codes",hidden:true}];export const PIPELINE_FLAG_NAMES=new Set(["appcode","app","env","format","jq","dry-run","yes","non-interactive","ci"])
|
|
8
|
+
;export function buildMeowFlags(){return Object.fromEntries(GLOBAL_FLAGS.map(f=>[f.meowKey,{type:f.type}]))}
|
package/lib/constant/defaults.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{DEFAULT_API_DIR}from"../constant/paths.js";export const DEFAULT_CONFIG_VALUES={env:"production",format:"compress",locale:"en-US",riskLevel:"write",apiDir:DEFAULT_API_DIR};export const DEFAULT_COMMAND_OUTPUT_FORMAT="compress";
|
package/lib/constant/domain.js
CHANGED
|
@@ -1 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import{getEnv,isProduction}from"../constant/env.js";import{DEFAULT_LOVRABET_REGION}from"../constant/region.js";import{getOfficialRoutingCdn,getOfficialRoutingProfile}from"../constant/routing-profile.js";let customApiDomain;let customUserDomain;let customRuntimeDomain;let customSkillDomain;let customKbDomain;let customKbServiceDomain;let allowOfficialKbServiceDefault=true;let customAppDomain;let customLocalDomain;let customCertificateDomain;let customCdn;let activeRegion=DEFAULT_LOVRABET_REGION;function getActiveRegionDomains(){const profile=getOfficialRoutingProfile(activeRegion);return isProduction(getEnv())?profile.serviceDomains.production:profile.serviceDomains.daily??profile.serviceDomains.production}export function initDomains(domains){customApiDomain=domains?.apiDomain;customUserDomain=domains?.userDomain;customRuntimeDomain=domains?.runtimeDomain;customSkillDomain=domains?.skillDomain;customKbDomain=domains?.kbDomain;customKbServiceDomain=domains?.kbServiceDomain
|
|
2
|
+
;allowOfficialKbServiceDefault=domains?.allowOfficialKbServiceDefault??true;customAppDomain=domains?.appDomain;customLocalDomain=domains?.localDomain;customCertificateDomain=domains?.certificateDomain;customCdn=domains?.cdn;activeRegion=domains?.region??DEFAULT_LOVRABET_REGION}export const getUserDomain=()=>customUserDomain||getActiveRegionDomains().user;export const getApiDomain=()=>customApiDomain||getActiveRegionDomains().api;export const getRuntimeDomain=()=>customRuntimeDomain||getActiveRegionDomains().runtime;export const getSkillDomain=()=>customSkillDomain||getActiveRegionDomains().skill;export const getKbDomain=()=>customKbDomain||customApiDomain||getActiveRegionDomains().kb;export const getKbServiceDomain=()=>{if(customKbServiceDomain)return customKbServiceDomain;if(!allowOfficialKbServiceDefault)return undefined;return getActiveRegionDomains().kbService};export const getAppDomain=()=>customAppDomain||getActiveRegionDomains().app;export const getActiveRegion=()=>activeRegion
|
|
3
|
+
;export const getLocalDomain=()=>customLocalDomain;export const getCertificateDomain=()=>customCertificateDomain;export const getActiveCdn=()=>customCdn||getOfficialRoutingCdn(activeRegion);export function isIndependentDeployment(){return!!(customApiDomain||customUserDomain||customRuntimeDomain||customSkillDomain||customKbDomain||customAppDomain||customLocalDomain||customCertificateDomain)}export function getSdkClientRoutingConfig(){if(customRuntimeDomain&&customRuntimeDomain!==getActiveRegionDomains().runtime){return{runtimeDomain:customRuntimeDomain}}if(activeRegion!==DEFAULT_LOVRABET_REGION){return{runtimeDomain:getRuntimeDomain()}}return{}}export const getAppBaseUrl=appCode=>{const encodedAppCode=encodeURIComponent(appCode.trim());return isProduction(getEnv())?`${getAppDomain()}/app/${encodedAppCode}`:`${getAppDomain()}/web-app/app/${encodedAppCode}`};export const getPublishedAppDomain=appCode=>{const appUrl=new URL(getAppDomain())
|
|
4
|
+
;appUrl.hostname=`${appCode.trim()}.${appUrl.hostname}`;return appUrl.origin};
|
package/lib/constant/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export const RABETBASE_ENV_VALUES=["production","daily"];export function normalizeEnv(e){return e==="online"?"production":e}export function isProduction(e){return normalizeEnv(e)==="production"}export function isDaily(e){return normalizeEnv(e)==="daily"}export function isDev(e){const c=normalizeEnv(e);return c==="development"||c==="dev"}let env=normalizeEnv(process.env.RABETBASE_ENV||process.env.LOVRABET_ENV||"production");export function getEnv(){return env}export function initEnv(_env){env=normalizeEnv(_env)}
|
package/lib/constant/output.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export const RABETBASE_OUTPUT_FORMAT_VALUES=["json","pretty","compress"];
|
package/lib/constant/paths.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export const DEFAULT_API_DIR="./src/api";
|
package/lib/constant/region.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{DEFAULT_REGION,ENABLED_REGION_VALUES,REGION_ALIASES,REGION_VALUES}from"../generated/official-routing.js";export const LOVRABET_REGION_VALUES=REGION_VALUES;export const ENABLED_LOVRABET_REGION_VALUES=ENABLED_REGION_VALUES;export const DEFAULT_LOVRABET_REGION=DEFAULT_REGION;export function isLovrabetRegion(value){return typeof value==="string"&&LOVRABET_REGION_VALUES.includes(value)}export function isEnabledLovrabetRegion(value){return typeof value==="string"&&ENABLED_LOVRABET_REGION_VALUES.includes(value)}export function normalizeLovrabetRegion(value){if(typeof value!=="string")return undefined;const normalized=REGION_ALIASES[value]??value;return isLovrabetRegion(normalized)?normalized:undefined}export function isInvalidLovrabetRegion(value){return value!==undefined&&value!==null&&value!==""&&normalizeLovrabetRegion(value)===undefined}
|
package/lib/constant/risk.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export const RISK_LEVEL_VALUES=["read","write","high-risk-write"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{OFFICIAL_ROUTING_PROFILES as GENERATED_OFFICIAL_ROUTING_PROFILES,ROUTING_CATALOG_DIGEST}from"../generated/official-routing.js";export const OFFICIAL_ROUTING_PROFILES=GENERATED_OFFICIAL_ROUTING_PROFILES;export{ROUTING_CATALOG_DIGEST};export function getOfficialRoutingProfile(region){return OFFICIAL_ROUTING_PROFILES[region]}export function getOfficialRoutingCdn(region){const cdn=getOfficialRoutingProfile(region).cdn;if(!cdn.lovrabet){throw new Error(`Official routing for region "${region}" is not ready: Lovrabet CDN Domain is not configured.`)}return{libraries:cdn.libraries,lovrabet:cdn.lovrabet}}
|