@lovrabet/rabetbase-cli 2.5.13-beta.1 → 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
package/lib/context.js
CHANGED
|
@@ -1 +1,9 @@
|
|
|
1
|
-
function a286_0x3d26(){const _0x1905b5=['regionSource','skillHubDomain','call','prototype','targetEnv','global\x20Rabetbase\x20configuration','string','app\x20profile\x20\x22','defaultApp','166cGiNDb','certificateDomain','daily','cookie','hasOwnProperty','apiDomain','env','setRawCommand','entries','production','216080UYBAaU','length','app','Rabetbase\x20configuration','172820tbThsn','domains','projectConfig','routingConfig','region','currentApp','13272WhNLjA','752135fSCBuI','localDomain','cwd','keys','35gbxMTz','trim','appcode','cdn','replace','argv','global','kbDomain','globalConfig','./constant/domain.js','source','project\x20Rabetbase\x20configuration','https://g.lovrabet.com/dist/lovrabet-skill','agentDomain','template_base_url','object','apiDir','63UUXPek','regionConfiguredValue','doctor','config','userDomain','slice','platformDomain','merged','routing','project','307506IVpEbF','4574950ONbgCW','skillDomain','60296komTxm','apps','some','kbServiceDomain','values','appDomain','raw','runtimeDomain','configuredRegion','filePath','map','setLogPath'];a286_0x3d26=function(){return _0x1905b5;};return a286_0x3d26();}const a286_0x440235=a286_0x1d54;(function(_0x14a62d,_0x565c63){const _0x2c015e=a286_0x1d54,_0x56922d=_0x14a62d();while(!![]){try{const _0x23b502=-parseInt(_0x2c015e(0x117))/0x1+-parseInt(_0x2c015e(0x10d))/0x2*(-parseInt(_0x2c015e(0x121))/0x3)+parseInt(_0x2c015e(0x11b))/0x4+parseInt(_0x2c015e(0x122))/0x5+-parseInt(_0x2c015e(0x141))/0x6*(-parseInt(_0x2c015e(0x126))/0x7)+parseInt(_0x2c015e(0xf8))/0x8*(parseInt(_0x2c015e(0x137))/0x9)+-parseInt(_0x2c015e(0xf6))/0xa;if(_0x23b502===_0x565c63)break;else _0x56922d['push'](_0x56922d['shift']());}catch(_0x3301dc){_0x56922d['push'](_0x56922d['shift']());}}}(a286_0x3d26,0x2fea7));import{CLI_BIN_NAME}from'./constant/cli.js';function a286_0x1d54(_0x224ae0,_0x294cd4){_0x224ae0=_0x224ae0-0xf6;const _0x3d267d=a286_0x3d26();let _0x1d549d=_0x3d267d[_0x224ae0];return _0x1d549d;}import{buildAuth}from'./context/auth-resolver.js';import{resolveAppConfig}from'./context/app-resolver.js';import{CONFIG_NAMES,NEW_CONFIG_NAME,findProjectRootDirectory,getGlobalConfigPath,getProjectConfigPath,inspectCliConfigJsonFile,isInProject,loadRawConfigLayers,mergeRawConfigLayers,readConfigFile,readRawConfig,readRawConfigWithLayers,resolveConfigPath,resolveWriteConfigPath,writeConfigFile}from'./context/config-loader.js';import{resolveConfiguredRegion,resolveEffectiveRegion}from'./config/region-config.js';import{resolveEnterpriseRoutingManifest}from'./config/domain-config.js';import{logger}from'./utils/logger.js';import{resolveApiModelSource}from'./api/model-source.js';export{CONFIG_NAMES,NEW_CONFIG_NAME,findProjectRootDirectory,getGlobalConfigPath,getProjectConfigPath,inspectCliConfigJsonFile,isInProject,loadRawConfigLayers,mergeRawConfigLayers,readConfigFile,readRawConfig,readRawConfigWithLayers,resolveConfigPath,resolveWriteConfigPath,writeConfigFile};function env(_0x1eef0d){return process.env[`RABETBASE_${_0x1eef0d}`]||process.env[`LOVRABET_${_0x1eef0d}`]||undefined;}function optionalString(_0x3e69fa){const _0x55d5c2=a286_0x1d54;return typeof _0x3e69fa==='string'&&_0x3e69fa[_0x55d5c2(0x127)]()?_0x3e69fa[_0x55d5c2(0x127)]():undefined;}export function isRoutingRecoveryService(_0x50c437){const _0x25a47f=a286_0x1d54;return _0x50c437===_0x25a47f(0x13a)||_0x50c437===_0x25a47f(0x139);}export async function createContext(_0x305909){const _0x370a0d=a286_0x1d54,{config:_0x481f43,layers:_0x20c501}=readRawConfigWithLayers(),_0x1a7709=buildConfig(_0x481f43,_0x305909,_0x20c501);await initGlobalEnvironment(_0x1a7709);const {getUserDomain:_0x269377,getApiDomain:_0x1b9528}=await import(_0x370a0d(0x12f)),_0x936922={'apiDomain':_0x1b9528(),'userDomain':_0x269377()},_0x12d5b5=await buildAuth(_0x1a7709);logger[_0x370a0d(0x103)](process[_0x370a0d(0x124)]());const _0x297d58=(CLI_BIN_NAME+'\x20'+process[_0x370a0d(0x12b)][_0x370a0d(0x13c)](0x2)['join']('\x20'))[_0x370a0d(0x127)]();logger[_0x370a0d(0x114)](_0x297d58);const {isNonInteractive:_0x364741}=await import('./utils/is-non-interactive.js'),_0x3b2bc4=_0x364741(_0x305909);return{'config':_0x1a7709,'auth':_0x12d5b5,'logger':logger,'env':_0x936922,'nonInteractive':_0x3b2bc4};}export function buildConfigFromFlags(_0x5b29e1){const {config:_0x6c20b5,layers:_0x1acfb1}=readRawConfigWithLayers();return buildConfig(_0x6c20b5,_0x5b29e1,_0x1acfb1);}export async function initGlobalEnvironment(_0x88face){const _0x21bd56=a286_0x1d54,_0xaa279d=_0x88face[_0x21bd56(0x104)]==='app'&&_0x88face['currentApp']?'app\x20profile\x20\x22'+_0x88face['currentApp']+'\x22':_0x88face[_0x21bd56(0x104)]===_0x21bd56(0x140)?_0x21bd56(0x131):_0x88face['regionSource']===_0x21bd56(0x12c)?_0x21bd56(0x109):_0x21bd56(0x11a);await initConfiguredEnvironment({'raw':_0x88face[_0x21bd56(0xfe)],'configuredRegion':_0x88face[_0x21bd56(0x138)]??_0x88face[_0x21bd56(0xfe)]?.[_0x21bd56(0x11f)]??_0x88face['region'],'regionLocation':_0xaa279d,'targetEnv':_0x88face[_0x21bd56(0x113)]});}async function initConfiguredEnvironment(_0x12e23b){const _0x407ca7=a286_0x1d54,_0x182ac2=resolveConfiguredRegion(_0x12e23b[_0x407ca7(0x100)],_0x12e23b['regionLocation']),_0x593b1a=resolveEnterpriseRoutingManifest(_0x12e23b['raw']?.[_0x407ca7(0x13f)]),_0x4ae326={'region':_0x182ac2,'apiDomain':_0x593b1a?_0x593b1a[_0x407ca7(0x11c)][_0x407ca7(0x112)]:optionalString(_0x12e23b['raw']?.[_0x407ca7(0x112)]),'userDomain':_0x593b1a?_0x593b1a['domains']['userDomain']:optionalString(_0x12e23b[_0x407ca7(0xfe)]?.[_0x407ca7(0x13b)]),'runtimeDomain':_0x593b1a?_0x593b1a[_0x407ca7(0x11c)]['runtimeDomain']:optionalString(_0x12e23b[_0x407ca7(0xfe)]?.['runtimeDomain']),'skillDomain':_0x593b1a?_0x593b1a[_0x407ca7(0x11c)]['skillDomain']:optionalString(_0x12e23b[_0x407ca7(0xfe)]?.[_0x407ca7(0xf7)])||optionalString(_0x12e23b[_0x407ca7(0xfe)]?.['skillHubDomain'])||optionalString(_0x12e23b['raw']?.[_0x407ca7(0x133)])||optionalString(_0x12e23b[_0x407ca7(0xfe)]?.[_0x407ca7(0x13d)]),'kbDomain':_0x593b1a?_0x593b1a[_0x407ca7(0x11c)][_0x407ca7(0x12d)]:optionalString(_0x12e23b[_0x407ca7(0xfe)]?.[_0x407ca7(0x12d)])||optionalString(_0x12e23b['raw']?.[_0x407ca7(0x133)])||optionalString(_0x12e23b[_0x407ca7(0xfe)]?.[_0x407ca7(0x13d)]),'kbServiceDomain':_0x593b1a?_0x593b1a[_0x407ca7(0x11c)]['kbServiceDomain']:optionalString(_0x12e23b[_0x407ca7(0xfe)]?.[_0x407ca7(0xfb)]),'appDomain':_0x593b1a?_0x593b1a[_0x407ca7(0x11c)][_0x407ca7(0xfd)]:optionalString(_0x12e23b[_0x407ca7(0xfe)]?.[_0x407ca7(0xfd)]),'localDomain':_0x593b1a?_0x593b1a[_0x407ca7(0x11c)][_0x407ca7(0x123)]:optionalString(_0x12e23b[_0x407ca7(0xfe)]?.[_0x407ca7(0x123)]),'certificateDomain':_0x593b1a?_0x593b1a[_0x407ca7(0x11c)][_0x407ca7(0x10e)]:optionalString(_0x12e23b[_0x407ca7(0xfe)]?.[_0x407ca7(0x10e)]),'cdn':_0x593b1a?.[_0x407ca7(0x129)],'allowOfficialKbServiceDefault':!(_0x593b1a!==undefined||[_0x407ca7(0x112),'userDomain',_0x407ca7(0xff),_0x407ca7(0xf7),'skillHubDomain','kbDomain',_0x407ca7(0xfb),'agentDomain',_0x407ca7(0x13d),_0x407ca7(0xfd),_0x407ca7(0x123),_0x407ca7(0x10e)][_0x407ca7(0xfa)](_0x11bee3=>Object[_0x407ca7(0x107)][_0x407ca7(0x111)]['call'](_0x12e23b[_0x407ca7(0xfe)]??{},_0x11bee3)))},{initEnv:_0x26eb4c}=await import('./constant/env.js'),{initDomains:_0x407ae7}=await import(_0x407ca7(0x12f));_0x26eb4c(_0x12e23b[_0x407ca7(0x108)]),_0x407ae7(_0x4ae326);}export async function initMultiAppEnvironment(_0x41c5bd){const _0x4f9b19=a286_0x1d54;await initConfiguredEnvironment({'raw':_0x41c5bd[_0x4f9b19(0x11e)],'configuredRegion':_0x41c5bd['region'],'regionLocation':_0x4f9b19(0x10b)+_0x41c5bd['name']+'\x22','targetEnv':_0x41c5bd[_0x4f9b19(0x113)]===_0x4f9b19(0x10f)?'daily':_0x4f9b19(0x116)});}export function getConfigAppCode(_0x46c77c){const _0xd117bc=a286_0x1d54,_0x32f70e=readRawConfig(_0x46c77c);if(_0x32f70e[_0xd117bc(0xf9)]&&typeof _0x32f70e[_0xd117bc(0xf9)]===_0xd117bc(0x135)){const _0x356035=_0x32f70e['defaultApp'];if(_0x356035)return _0x32f70e[_0xd117bc(0xf9)][_0x356035]?.[_0xd117bc(0x128)]?String(_0x32f70e[_0xd117bc(0xf9)][_0x356035][_0xd117bc(0x128)])['trim']():undefined;const _0xd1366e=Object[_0xd117bc(0xfc)](_0x32f70e[_0xd117bc(0xf9)]);if(_0xd1366e[_0xd117bc(0x118)]===0x1&&_0xd1366e[0x0]?.[_0xd117bc(0x128)])return String(_0xd1366e[0x0][_0xd117bc(0x128)])[_0xd117bc(0x127)]();}const _0x172846=_0x32f70e[_0xd117bc(0x128)]||_0x32f70e[_0xd117bc(0x119)];if(typeof _0x172846!=='string'||_0x172846[_0xd117bc(0x127)]()==='')return undefined;return _0x172846['trim']();}const CONNECTION_ROUTING_KEYS=['routing',a286_0x440235(0x112),'userDomain',a286_0x440235(0xff),a286_0x440235(0xf7),a286_0x440235(0x105),a286_0x440235(0x12d),a286_0x440235(0xfb),'agentDomain',a286_0x440235(0x13d),a286_0x440235(0xfd),a286_0x440235(0x123),a286_0x440235(0x10e)];function withAppProfileRouting(_0x1e94ee,_0x42a186){const _0x126855=a286_0x440235;if(!_0x42a186||_0x42a186[_0x126855(0xfb)]===undefined)return _0x1e94ee;return{..._0x1e94ee,'kbServiceDomain':_0x42a186['kbServiceDomain']};}function pickConnectionRoutingConfig(_0x40ff88,_0xf381fb){const _0x2dd9cd={'region':_0xf381fb};for(const _0x546bf2 of CONNECTION_ROUTING_KEYS){if(_0x40ff88[_0x546bf2]!==undefined)_0x2dd9cd[_0x546bf2]=_0x40ff88[_0x546bf2];}return _0x2dd9cd;}export function getMultiAppConfigs(_0x464cdf='project',_0x5e6ce2){const _0x156702=a286_0x440235,_0x42b78a=loadRawConfigLayers(_0x5e6ce2);let _0x20dbf0,_0x4001d6;const _0x31f7eb=mergeRawConfigLayers(_0x42b78a),_0xe2d512=_0x42b78a['globalConfig'][_0x156702(0xf9)]&&typeof _0x42b78a[_0x156702(0x12e)][_0x156702(0xf9)]===_0x156702(0x135)?_0x42b78a['globalConfig'][_0x156702(0xf9)]:{},_0xfc0778=_0x42b78a[_0x156702(0x11d)]['apps']&&typeof _0x42b78a[_0x156702(0x11d)][_0x156702(0xf9)]===_0x156702(0x135)?_0x42b78a['projectConfig']['apps']:{};_0x464cdf===_0x156702(0x13e)?(_0x20dbf0={..._0xe2d512,..._0xfc0778},_0x4001d6=_0x31f7eb['defaultApp']):(_0x20dbf0=_0x42b78a['projectConfig'][_0x156702(0xf9)],_0x4001d6=_0x42b78a[_0x156702(0x11d)][_0x156702(0x10c)]);!_0x4001d6&&_0x20dbf0&&typeof _0x20dbf0===_0x156702(0x135)&&Object[_0x156702(0x125)](_0x20dbf0)[_0x156702(0x118)]===0x1&&(_0x4001d6=Object[_0x156702(0x125)](_0x20dbf0)[0x0]);if(!_0x20dbf0||typeof _0x20dbf0!==_0x156702(0x135)||Object[_0x156702(0x125)](_0x20dbf0)[_0x156702(0x118)]===0x0)return null;return Object[_0x156702(0x115)](_0x20dbf0)[_0x156702(0x102)](([_0x5ad99a,_0xf9f8bf])=>{const _0x1b85dd=_0x156702,_0xe887b2=_0x464cdf===_0x1b85dd(0x140)||Object['prototype'][_0x1b85dd(0x111)][_0x1b85dd(0x106)](_0xfc0778,_0x5ad99a),_0x5555a1=withAppProfileRouting(_0xe887b2?_0x31f7eb:_0x42b78a[_0x1b85dd(0x12e)],_0xf9f8bf),_0x641098=resolveEffectiveRegion({'appRegion':_0xf9f8bf?.[_0x1b85dd(0x11f)],'projectRegion':_0xe887b2?_0x42b78a[_0x1b85dd(0x11d)][_0x1b85dd(0x11f)]:undefined,'globalRegion':_0x42b78a['globalConfig'][_0x1b85dd(0x11f)],'mergedRegion':_0x5555a1[_0x1b85dd(0x11f)],'appName':_0x5ad99a});return{'name':_0x5ad99a,'appcode':_0xf9f8bf?.[_0x1b85dd(0x128)]||'','apiGroup':optionalString(_0xf9f8bf?.['apiGroup']),'isDefault':_0x5ad99a===_0x4001d6,'region':_0x641098[_0x1b85dd(0x11f)],'regionSource':_0x641098[_0x1b85dd(0x130)],'env':_0xf9f8bf?.[_0x1b85dd(0x113)],'apiDir':optionalString(_0xf9f8bf?.['apiDir'])||optionalString(_0x5555a1[_0x1b85dd(0x136)]),'cookie':_0xf9f8bf?.[_0x1b85dd(0x110)]||undefined,'routingConfig':pickConnectionRoutingConfig(_0x5555a1,_0x641098[_0x1b85dd(0x11f)])};})['filter'](_0x3ada3a=>_0x3ada3a[_0x156702(0x128)]);}export function getTemplateBaseUrl(_0x2b3e47){const _0xa7d6ed=a286_0x440235,_0x987a94=readRawConfig(_0x2b3e47);if(_0x987a94[_0xa7d6ed(0x134)]&&typeof _0x987a94[_0xa7d6ed(0x134)]===_0xa7d6ed(0x10a))return _0x987a94['template_base_url'][_0xa7d6ed(0x12a)](/\/$/,'');return _0xa7d6ed(0x132);}function buildConfig(_0x48378e,_0x52a7b7,_0x142e4b){const _0x2d0506=a286_0x440235,_0x93e515=resolveAppConfig({'raw':_0x48378e,'flags':_0x52a7b7,'layers':_0x142e4b,'readEnv':env}),_0x9df9=_0x93e515[_0x2d0506(0x120)]?_0x93e515['apps'][_0x93e515[_0x2d0506(0x120)]]:undefined;return{..._0x93e515,'raw':withAppProfileRouting(_0x48378e,_0x9df9)};}export function resolveApiFilePath(_0x536b8c,_0x2d213d,_0x2ac8e6){const _0x22e9b3=a286_0x440235;return resolveApiModelSource(_0x536b8c,_0x2d213d,_0x2ac8e6)[_0x22e9b3(0x101)];}
|
|
1
|
+
import{CLI_BIN_NAME}from"./constant/cli.js";import{buildAuth}from"./context/auth-resolver.js";import{resolveAppConfig}from"./context/app-resolver.js";import{CONFIG_NAMES,NEW_CONFIG_NAME,findProjectRootDirectory,getGlobalConfigPath,getProjectConfigPath,inspectCliConfigJsonFile,isInProject,loadRawConfigLayers,mergeRawConfigLayers,readConfigFile,readRawConfig,readRawConfigWithLayers,resolveConfigPath,resolveWriteConfigPath,writeConfigFile}from"./context/config-loader.js";import{resolveConfiguredRegion,resolveEffectiveRegion}from"./config/region-config.js";import{resolveEnterpriseRoutingManifest}from"./config/domain-config.js";import{logger}from"./utils/logger.js";import{resolveApiModelSource}from"./api/model-source.js"
|
|
2
|
+
;export{CONFIG_NAMES,NEW_CONFIG_NAME,findProjectRootDirectory,getGlobalConfigPath,getProjectConfigPath,inspectCliConfigJsonFile,isInProject,loadRawConfigLayers,mergeRawConfigLayers,readConfigFile,readRawConfig,readRawConfigWithLayers,resolveConfigPath,resolveWriteConfigPath,writeConfigFile};function env(name){return process.env[`RABETBASE_${name}`]||process.env[`LOVRABET_${name}`]||undefined}function optionalString(value){return typeof value==="string"&&value.trim()?value.trim():undefined}export function isRoutingRecoveryService(service){return service==="config"||service==="doctor"}export async function createContext(flags){const{config:rawConfig,layers:layers}=readRawConfigWithLayers();const config=buildConfig(rawConfig,flags,layers);await initGlobalEnvironment(config);const{getUserDomain:getUserDomain,getApiDomain:getApiDomain}=await(import("./constant/domain.js"));const envInfo={apiDomain:getApiDomain(),userDomain:getUserDomain()};const auth=await buildAuth(config)
|
|
3
|
+
;logger.setLogPath(process.cwd());const rawCommand=`${CLI_BIN_NAME} ${process.argv.slice(2).join(" ")}`.trim();logger.setRawCommand(rawCommand);const{isNonInteractive:isNonInteractive}=await(import("./utils/is-non-interactive.js"));const nonInteractive=isNonInteractive(flags);return{config:config,auth:auth,logger:logger,env:envInfo,nonInteractive:nonInteractive}}export function buildConfigFromFlags(flags){const{config:config,layers:layers}=readRawConfigWithLayers();return buildConfig(config,flags,layers)}export async function initGlobalEnvironment(config){const regionLocation=config.regionSource==="app"&&config.currentApp?`app profile "${config.currentApp}"`:config.regionSource==="project"?"project Rabetbase configuration":config.regionSource==="global"?"global Rabetbase configuration":"Rabetbase configuration";await initConfiguredEnvironment({raw:config.raw,configuredRegion:config.regionConfiguredValue??config.raw?.region??config.region,regionLocation:regionLocation,
|
|
4
|
+
targetEnv:config.env})}async function initConfiguredEnvironment(options){const region=resolveConfiguredRegion(options.configuredRegion,options.regionLocation);const enterprise=resolveEnterpriseRoutingManifest(options.raw?.routing);const domains={region:region,apiDomain:enterprise?enterprise.domains.apiDomain:optionalString(options.raw?.apiDomain),userDomain:enterprise?enterprise.domains.userDomain:optionalString(options.raw?.userDomain),runtimeDomain:enterprise?enterprise.domains.runtimeDomain:optionalString(options.raw?.runtimeDomain),skillDomain:enterprise?enterprise.domains.skillDomain:optionalString(options.raw?.skillDomain)||optionalString(options.raw?.skillHubDomain)||optionalString(options.raw?.agentDomain)||optionalString(options.raw?.platformDomain),kbDomain:enterprise?enterprise.domains.kbDomain:optionalString(options.raw?.kbDomain)||optionalString(options.raw?.agentDomain)||optionalString(options.raw?.platformDomain),
|
|
5
|
+
kbServiceDomain:enterprise?enterprise.domains.kbServiceDomain:optionalString(options.raw?.kbServiceDomain),appDomain:enterprise?enterprise.domains.appDomain:optionalString(options.raw?.appDomain),localDomain:enterprise?enterprise.domains.localDomain:optionalString(options.raw?.localDomain),certificateDomain:enterprise?enterprise.domains.certificateDomain:optionalString(options.raw?.certificateDomain),cdn:enterprise?.cdn,allowOfficialKbServiceDefault:!(enterprise!==undefined||["apiDomain","userDomain","runtimeDomain","skillDomain","skillHubDomain","kbDomain","kbServiceDomain","agentDomain","platformDomain","appDomain","localDomain","certificateDomain"].some(key=>Object.prototype.hasOwnProperty.call(options.raw??{},key)))};const{initEnv:initEnv}=await(import("./constant/env.js"));const{initDomains:initDomains}=await(import("./constant/domain.js"));initEnv(options.targetEnv);initDomains(domains)}export async function initMultiAppEnvironment(app){await initConfiguredEnvironment({
|
|
6
|
+
raw:app.routingConfig,configuredRegion:app.region,regionLocation:`app profile "${app.name}"`,targetEnv:app.env==="daily"?"daily":"production"})}export function getConfigAppCode(projectRoot){const config=readRawConfig(projectRoot);if(config.apps&&typeof config.apps==="object"){const defaultApp=config.defaultApp;if(defaultApp){return config.apps[defaultApp]?.appcode?String(config.apps[defaultApp].appcode).trim():undefined}const entries=Object.values(config.apps);if(entries.length===1&&entries[0]?.appcode){return String(entries[0].appcode).trim()}}const appCode=config.appcode||config.app;if(typeof appCode!=="string"||appCode.trim()===""){return undefined}return appCode.trim()}const CONNECTION_ROUTING_KEYS=["routing","apiDomain","userDomain","runtimeDomain","skillDomain","skillHubDomain","kbDomain","kbServiceDomain","agentDomain","platformDomain","appDomain","localDomain","certificateDomain"];function withAppProfileRouting(config,profile){
|
|
7
|
+
if(!profile||profile.kbServiceDomain===undefined)return config;return{...config,kbServiceDomain:profile.kbServiceDomain}}function pickConnectionRoutingConfig(config,region){const routingConfig={region:region};for(const key of CONNECTION_ROUTING_KEYS){if(config[key]!==undefined)routingConfig[key]=config[key]}return routingConfig}export function getMultiAppConfigs(scope="project",projectRoot){const layers=loadRawConfigLayers(projectRoot);let apps;let defaultApp;const mergedConfig=mergeRawConfigLayers(layers);const globalApps=layers.globalConfig.apps&&typeof layers.globalConfig.apps==="object"?layers.globalConfig.apps:{};const projectApps=layers.projectConfig.apps&&typeof layers.projectConfig.apps==="object"?layers.projectConfig.apps:{};if(scope==="merged"){apps={...globalApps,...projectApps};defaultApp=mergedConfig.defaultApp}else{apps=layers.projectConfig.apps;defaultApp=layers.projectConfig.defaultApp}if(!defaultApp&&apps&&typeof apps==="object"&&Object.keys(apps).length===1){
|
|
8
|
+
defaultApp=Object.keys(apps)[0]}if(!apps||typeof apps!=="object"||Object.keys(apps).length===0){return null}return Object.entries(apps).map(([name,profile])=>{const isProjectApp=scope==="project"||Object.prototype.hasOwnProperty.call(projectApps,name);const routingConfig=withAppProfileRouting(isProjectApp?mergedConfig:layers.globalConfig,profile);const resolvedRegion=resolveEffectiveRegion({appRegion:profile?.region,projectRegion:isProjectApp?layers.projectConfig.region:undefined,globalRegion:layers.globalConfig.region,mergedRegion:routingConfig.region,appName:name});return{name:name,appcode:profile?.appcode||"",apiGroup:optionalString(profile?.apiGroup),isDefault:name===defaultApp,region:resolvedRegion.region,regionSource:resolvedRegion.source,env:profile?.env,apiDir:optionalString(profile?.apiDir)||optionalString(routingConfig.apiDir),cookie:profile?.cookie||undefined,routingConfig:pickConnectionRoutingConfig(routingConfig,resolvedRegion.region)}}).filter(app=>app.appcode)}
|
|
9
|
+
export function getTemplateBaseUrl(projectRoot){const config=readRawConfig(projectRoot);if(config.template_base_url&&typeof config.template_base_url==="string"){return config.template_base_url.replace(/\/$/,"")}return"https://g.lovrabet.com/dist/lovrabet-skill"}function buildConfig(raw,flags,layers){const resolved=resolveAppConfig({raw:raw,flags:flags,layers:layers,readEnv:env});const profile=resolved.currentApp?resolved.apps[resolved.currentApp]:undefined;return{...resolved,raw:withAppProfileRouting(raw,profile)}}export function resolveApiFilePath(apiDir,appCode,selectedAppName){return resolveApiModelSource(apiDir,appCode,selectedAppName).filePath}
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import{existsSync,readFileSync,realpathSync,statSync}from"node:fs";import{dirname,extname,isAbsolute,relative,resolve}from"node:path";import{MODEL_REGISTRY_FILE_NAME,getProfileModels,readModelRegistry}from"../api/model-registry-file.js";import{parseLegacyApiModels}from"../api/legacy-api-file.js";import{findProjectRootDirectory}from"../context/config-loader.js";const cache=new Map;const MAX_LOCAL_REEXPORT_DEPTH=8;const SOURCE_FILE_EXTENSIONS=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"];const LOCAL_REEXPORT_RE=/\bexport\s+(?:type\s+)?(?:\{[\s\S]*?\}|\*)\s+from\s*["']([^"']+)["']/g;const SOURCE_EXTENSIONS_BY_RUNTIME_EXTENSION={".js":[".ts",".tsx"],".jsx":[".tsx"],".mjs":[".mts"],".cjs":[".cts"]};function parseApiFile(content){return parseLegacyApiModels(content).flatMap(model=>model.alias?[{alias:model.alias,datasetCode:model.datasetCode,tableName:model.tableName,name:model.name}]:[])}function isWithinRoot(root,candidate){const path=relative(root,candidate)
|
|
2
|
+
;return path===""||!path.startsWith("..")&&!isAbsolute(path)}function resolveExistingFile(path){if(!existsSync(path))return undefined;try{return statSync(path).isFile()?realpathSync(path):undefined}catch{return undefined}}function reexportCandidatePaths(requestedPath){const requestedExtension=extname(requestedPath);if(!requestedExtension){return[...SOURCE_FILE_EXTENSIONS.map(extension=>`${requestedPath}${extension}`),...SOURCE_FILE_EXTENSIONS.map(extension=>resolve(requestedPath,`index${extension}`))]}const sourceExtensions=SOURCE_EXTENSIONS_BY_RUNTIME_EXTENSION[requestedExtension];if(!sourceExtensions)return[requestedPath];const sourcePath=requestedPath.slice(0,-requestedExtension.length);return[...sourceExtensions.map(extension=>`${sourcePath}${extension}`),requestedPath]}function resolveLocalReexport(importingFile,specifier,projectRoot){if(!specifier.startsWith("./")&&!specifier.startsWith("../"))return undefined;const requestedPath=resolve(dirname(importingFile),specifier)
|
|
3
|
+
;if(!isWithinRoot(projectRoot,requestedPath))return undefined;for(const candidate of reexportCandidatePaths(requestedPath)){const resolvedFile=resolveExistingFile(candidate);if(resolvedFile&&isWithinRoot(projectRoot,resolvedFile))return resolvedFile}return undefined}function parseApiFileTree(apiFilePath,projectRoot,minimumDepthByFile,depth){const resolvedFile=resolveExistingFile(apiFilePath);if(!resolvedFile)return[];const previousDepth=minimumDepthByFile.get(resolvedFile);if(previousDepth!==undefined&&previousDepth<=depth)return[];minimumDepthByFile.set(resolvedFile,depth);const content=readFileSync(resolvedFile,"utf-8");const entries=parseApiFile(content);if(depth>=MAX_LOCAL_REEXPORT_DEPTH)return entries;const localReexportRe=new RegExp(LOCAL_REEXPORT_RE.source,LOCAL_REEXPORT_RE.flags);let match;while((match=localReexportRe.exec(content))!==null){const importedFile=resolveLocalReexport(resolvedFile,match[1],projectRoot);if(importedFile){
|
|
4
|
+
entries.push(...parseApiFileTree(importedFile,projectRoot,minimumDepthByFile,depth+1))}}return entries}function aliasProjectRoot(apiFilePath){const root=findProjectRootDirectory(dirname(apiFilePath));try{return realpathSync(root)}catch{return root}}function uniqueAliasEntries(entries){const seen=new Set;return entries.filter(entry=>{const key=JSON.stringify(entry);if(seen.has(key))return false;seen.add(key);return true})}export function loadAliasMap(apiDir,appCode,resolvedFilePath,profileName){const apiFilePath=resolve(resolvedFilePath??resolve(process.cwd(),apiDir,"api.ts"));const cacheKey=profileName?`${apiFilePath}#${profileName}`:apiFilePath;if(cache.has(cacheKey))return cache.get(cacheKey);if(!existsSync(apiFilePath)){cache.set(cacheKey,[]);return[]}try{if(apiFilePath.endsWith(MODEL_REGISTRY_FILE_NAME)){const registry=readModelRegistry(apiFilePath);const effectiveProfile=profileName??registry?.defaultProfile
|
|
5
|
+
;const models=effectiveProfile&®istry?getProfileModels(registry,effectiveProfile):[];const entries=uniqueAliasEntries(models.flatMap(model=>model.alias?[{alias:model.alias,datasetCode:model.datasetCode,tableName:model.tableName,name:model.name}]:[]));cache.set(cacheKey,entries);return entries}const entries=uniqueAliasEntries(parseApiFileTree(apiFilePath,aliasProjectRoot(apiFilePath),new Map,0));cache.set(cacheKey,entries);return entries}catch{cache.set(cacheKey,[]);return[]}}export function resolveAlias(apiDir,alias,appCode,resolvedFilePath,profileName){if(!alias)return undefined;const entries=loadAliasMap(apiDir,appCode,resolvedFilePath,profileName);const matchingCodes=new Set(entries.filter(entry=>entry.alias===alias).map(entry=>entry.datasetCode));return matchingCodes.size===1?[...matchingCodes][0]:undefined}export function listAliases(apiDir,appCode,resolvedFilePath,profileName){return loadAliasMap(apiDir,appCode,resolvedFilePath,profileName)}
|
package/lib/core/api-client.d.ts
CHANGED
|
@@ -1268,35 +1268,42 @@ export declare function updateNotificationChannelConfig(input: NotificationChann
|
|
|
1268
1268
|
}): Promise<void>;
|
|
1269
1269
|
export declare function deleteNotificationChannelConfig(id: number, appCode: string): Promise<void>;
|
|
1270
1270
|
export interface AppConfigItem {
|
|
1271
|
-
id?: number;
|
|
1271
|
+
id?: number | string;
|
|
1272
1272
|
appCode: string;
|
|
1273
1273
|
key: string;
|
|
1274
1274
|
value?: string | null;
|
|
1275
1275
|
tags?: string | null;
|
|
1276
|
+
description?: string | null;
|
|
1276
1277
|
encrypted?: number | null;
|
|
1277
|
-
operatorId?: number | null;
|
|
1278
|
-
|
|
1279
|
-
|
|
1278
|
+
operatorId?: number | string | null;
|
|
1279
|
+
operatorUsername?: string | null;
|
|
1280
|
+
operatorNickname?: string | null;
|
|
1281
|
+
gmtCreate?: number | null;
|
|
1282
|
+
gmtModified?: number | null;
|
|
1280
1283
|
}
|
|
1281
1284
|
export interface AppConfigWriteInput {
|
|
1282
|
-
id?: number;
|
|
1285
|
+
id?: number | string;
|
|
1283
1286
|
appCode: string;
|
|
1284
1287
|
key: string;
|
|
1285
1288
|
value: string;
|
|
1286
1289
|
tags?: string;
|
|
1290
|
+
description?: string;
|
|
1287
1291
|
}
|
|
1288
1292
|
export declare function listAppConfigs(appCode: string, filters?: {
|
|
1289
1293
|
key?: string;
|
|
1290
1294
|
tags?: string;
|
|
1295
|
+
keyword?: string;
|
|
1291
1296
|
}): Promise<AppConfigItem[]>;
|
|
1292
1297
|
export declare function getAppConfigByKey(appCode: string, key: string): Promise<AppConfigItem | null>;
|
|
1298
|
+
/** Read an assembled metric through app-config with development Cookie. */
|
|
1299
|
+
export declare function getMetricDetail(appCode: string, name: string): Promise<unknown>;
|
|
1293
1300
|
export declare function createAppConfig(input: AppConfigWriteInput): Promise<unknown>;
|
|
1294
1301
|
export declare function updateAppConfig(input: AppConfigWriteInput & {
|
|
1295
|
-
id: number;
|
|
1302
|
+
id: number | string;
|
|
1296
1303
|
}): Promise<void>;
|
|
1297
1304
|
export declare function deleteAppConfig(params: {
|
|
1298
1305
|
appCode: string;
|
|
1299
|
-
id: number;
|
|
1306
|
+
id: number | string;
|
|
1300
1307
|
}): Promise<void>;
|
|
1301
1308
|
export declare function listDbLinks(appCode: string, options?: {
|
|
1302
1309
|
currentPage?: number;
|