@lovrabet/rabetbase-cli 2.5.3-beta.1 → 2.5.3-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/api-group.d.ts +22 -0
- package/lib/api/api-group.js +1 -0
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.d.ts +18 -2
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/generate-sdk-config-file.js +1 -1
- package/lib/api/legacy-api-file.d.ts +11 -0
- package/lib/api/legacy-api-file.js +1 -0
- package/lib/api/model-registry-file.d.ts +36 -0
- package/lib/api/model-registry-file.js +1 -0
- package/lib/api/model-registry-scaffold.d.ts +7 -0
- package/lib/api/model-registry-scaffold.js +1 -0
- package/lib/api/model-source.d.ts +6 -0
- package/lib/api/model-source.js +1 -0
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/logs.d.ts +7 -0
- package/lib/commands/bff/logs.js +1 -0
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.d.ts +7 -0
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/delete.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/dataset/batch-design.d.ts +21 -0
- package/lib/commands/dataset/batch-design.js +1 -0
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/cross-relation-create.d.ts +2 -0
- package/lib/commands/dataset/cross-relation-create.js +1 -0
- package/lib/commands/dataset/cross-relation-delete.d.ts +2 -0
- package/lib/commands/dataset/cross-relation-delete.js +1 -0
- package/lib/commands/dataset/cross-relation-list.d.ts +2 -0
- package/lib/commands/dataset/cross-relation-list.js +1 -0
- package/lib/commands/dataset/cross-relation-shared.d.ts +190 -0
- package/lib/commands/dataset/cross-relation-shared.js +1 -0
- package/lib/commands/dataset/cross-relation-update.d.ts +2 -0
- package/lib/commands/dataset/cross-relation-update.js +1 -0
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-restore.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/dataset/user-deleted-field-list.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/table-diff-shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/deployment/index.js +1 -1
- package/lib/commands/deployment/sync-all.js +1 -1
- package/lib/commands/deployment/sync-jobs.js +1 -1
- package/lib/commands/deployment/sync-status.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/flow/create.d.ts +2 -0
- package/lib/commands/flow/create.js +1 -0
- package/lib/commands/flow/detail.d.ts +2 -0
- package/lib/commands/flow/detail.js +1 -0
- package/lib/commands/flow/index.d.ts +3 -0
- package/lib/commands/flow/index.js +1 -0
- package/lib/commands/flow/list.d.ts +2 -0
- package/lib/commands/flow/list.js +1 -0
- package/lib/commands/flow/publish.d.ts +2 -0
- package/lib/commands/flow/publish.js +1 -0
- package/lib/commands/flow/runtime-resources-shared.d.ts +40 -0
- package/lib/commands/flow/runtime-resources-shared.js +1 -0
- package/lib/commands/flow/runtime-role-list.d.ts +2 -0
- package/lib/commands/flow/runtime-role-list.js +1 -0
- package/lib/commands/flow/runtime-role-user-list.d.ts +2 -0
- package/lib/commands/flow/runtime-role-user-list.js +1 -0
- package/lib/commands/flow/runtime-user-search.d.ts +2 -0
- package/lib/commands/flow/runtime-user-search.js +1 -0
- package/lib/commands/flow/shared.d.ts +41 -0
- package/lib/commands/flow/shared.js +1 -0
- package/lib/commands/flow/update.d.ts +2 -0
- package/lib/commands/flow/update.js +1 -0
- package/lib/commands/flow/validate.d.ts +3 -0
- package/lib/commands/flow/validate.js +1 -0
- package/lib/commands/instant-api-policy/current.js +1 -1
- package/lib/commands/instant-api-policy/index.js +1 -1
- package/lib/commands/instant-api-policy/init.js +1 -1
- package/lib/commands/instant-api-policy/publish.js +1 -1
- package/lib/commands/instant-api-policy/pull.js +1 -1
- package/lib/commands/instant-api-policy/revision.js +1 -1
- package/lib/commands/instant-api-policy/revisions.js +1 -1
- package/lib/commands/instant-api-policy/rollback.js +1 -1
- package/lib/commands/instant-api-policy/shared.js +1 -1
- package/lib/commands/instant-api-policy/validate.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/search.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.js +1 -1
- package/lib/commands/page/custom/update.js +1 -1
- package/lib/commands/page/data-list-status.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/api-architecture-upgrade.d.ts +28 -0
- package/lib/commands/project/api-architecture-upgrade.js +1 -0
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/domain-routing-sync.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.d.ts +30 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/rule/get.js +1 -1
- package/lib/commands/rule/index.js +1 -1
- package/lib/commands/rule/list.js +1 -1
- package/lib/commands/rule/set.js +1 -1
- package/lib/commands/rule/shared.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/project-domain-routing.js +1 -1
- package/lib/config/region-config.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/routing-profile.js +1 -1
- package/lib/context/app-resolver.d.ts +2 -0
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.d.ts +2 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.d.ts +13 -17
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.d.ts +176 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/hook-directory.d.ts +55 -0
- package/lib/core/bff/hook-directory.js +1 -0
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/types.d.ts +15 -0
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/cross-db-relation.d.ts +41 -0
- package/lib/core/cross-db-relation.js +1 -0
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/flow-config.d.ts +628 -0
- package/lib/core/flow-config.js +1 -0
- package/lib/core/instant-api-policy/config.js +1 -1
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/page/lr-smart-jsx.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.d.ts +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/supported-flags.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.d.ts +0 -10
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/types/index.d.ts +11 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.d.ts +12 -0
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +4 -1
- package/skills/rabetbase/SKILL.md +31 -9
- package/skills/rabetbase/guides/approval-flow-development-workflow.md +137 -0
- package/skills/rabetbase/guides/backend-function.md +19 -9
- package/skills/rabetbase/guides/bff-creation-workflow.md +10 -1
- package/skills/rabetbase/guides/conflict-detection.md +2 -0
- package/skills/rabetbase/guides/sdk-client-generation.md +112 -60
- package/skills/rabetbase/guides/typescript-sdk.md +9 -0
- package/skills/rabetbase/knowledge/approval-flow/config-json-schema.md +290 -0
- package/skills/rabetbase/references/rabetbase-api-pull.md +30 -19
- package/skills/rabetbase/references/rabetbase-app-list.md +1 -1
- package/skills/rabetbase/references/rabetbase-bff-create.md +1 -1
- package/skills/rabetbase/references/rabetbase-bff-logs.md +47 -0
- package/skills/rabetbase/references/rabetbase-bff-pull.md +7 -3
- package/skills/rabetbase/references/rabetbase-bff-push.md +10 -2
- package/skills/rabetbase/references/rabetbase-config.md +2 -1
- package/skills/rabetbase/references/rabetbase-dataset-cross-relations.md +60 -0
- package/skills/rabetbase/references/rabetbase-dataset-generate.md +52 -2
- package/skills/rabetbase/references/rabetbase-flow-commands.md +86 -0
- package/skills/rabetbase/references/rabetbase-flow-resources.md +83 -0
- package/skills/rabetbase/references/rabetbase-flow-runtime-boundary.md +25 -0
- package/skills/rabetbase/references/rabetbase-instant-api-policy.md +103 -11
- package/skills/rabetbase/references/rabetbase-notification-config-list.md +17 -0
- package/skills/rabetbase/references/rabetbase-project-create.md +3 -3
- package/skills/rabetbase/references/rabetbase-project-upgrade.md +24 -13
- package/skills/rabetbase.manifest.json +10 -3
- package/templates/README.md +16 -4
- package/templates/generate-api/model-runtime.ts.tpl +101 -0
- package/templates/generate-api/profile-api.ts.tpl +21 -0
- package/templates/generate-api/profile-client.ts.tpl +14 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { DatasetItem } from "../../core/api-client.js";
|
|
2
|
+
import type { BffLockEntry, BffLockScope, HookDirectoryProtocol, LocalBffFunction } from "../../core/bff/types.js";
|
|
3
|
+
export interface HookDirectoryWarning {
|
|
4
|
+
code: "DATASET_CODE_FALLBACK";
|
|
5
|
+
message: string;
|
|
6
|
+
datasetCode: string;
|
|
7
|
+
}
|
|
8
|
+
export interface HookDirectoryResolution {
|
|
9
|
+
dataset: DatasetItem;
|
|
10
|
+
datasetCode: string;
|
|
11
|
+
alias?: string;
|
|
12
|
+
directoryProtocol: HookDirectoryProtocol;
|
|
13
|
+
warnings: HookDirectoryWarning[];
|
|
14
|
+
}
|
|
15
|
+
export interface HookDirectoryIndexes {
|
|
16
|
+
datasetCodeToDatasets: Map<string, DatasetItem[]>;
|
|
17
|
+
aliasToDatasetCodes: Map<string, string[]>;
|
|
18
|
+
}
|
|
19
|
+
export interface HookAliasMapping {
|
|
20
|
+
alias: string;
|
|
21
|
+
datasetCode: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Returns the on-disk directory bindings from tracked HOOK entries. A lock
|
|
25
|
+
* key remains authoritative for existing files, including pre-alias and old
|
|
26
|
+
* tableName directories that must not be silently copied or renamed.
|
|
27
|
+
*/
|
|
28
|
+
export declare function trackedHookDirectoryMappings(appLock: BffLockScope): HookAliasMapping[];
|
|
29
|
+
/**
|
|
30
|
+
* Select the one historical directory a Dataset may continue using during
|
|
31
|
+
* pull. This lets a newly added remote HOOK join an existing tracked tree
|
|
32
|
+
* after an SDK alias rename, rather than creating a second local directory.
|
|
33
|
+
*/
|
|
34
|
+
export declare function uniqueTrackedHookDirectoryByDataset(appLock: BffLockScope): Map<string, string>;
|
|
35
|
+
/**
|
|
36
|
+
* Multiple historical directories may refer to one Dataset, but one physical
|
|
37
|
+
* directory must never resolve to different Datasets. This protects both
|
|
38
|
+
* push binding and pull target-path selection on case-insensitive file systems.
|
|
39
|
+
*/
|
|
40
|
+
export declare function assertUnambiguousHookDirectoryMappings(entries: Iterable<HookAliasMapping>): void;
|
|
41
|
+
/**
|
|
42
|
+
* A remote HOOK has exactly one local target directory. Reject ambiguous SDK
|
|
43
|
+
* aliases before a caller reduces them to a Map (which would silently choose
|
|
44
|
+
* an arbitrary Dataset) or uses them to derive a pull path.
|
|
45
|
+
*/
|
|
46
|
+
export declare function assertUnambiguousHookAliases(entries: Iterable<HookAliasMapping>): void;
|
|
47
|
+
/**
|
|
48
|
+
* Build the two supported HOOK directory namespaces. The preferred directory
|
|
49
|
+
* is the SDK alias; raw datasetCode remains the fallback for projects that do
|
|
50
|
+
* not have an alias or for previously downloaded deleted Datasets.
|
|
51
|
+
*/
|
|
52
|
+
export declare function buildHookDirectoryIndexes(datasets: DatasetItem[], aliasToDatasetCode?: Iterable<readonly [string, string]>): HookDirectoryIndexes;
|
|
53
|
+
export declare function resolvePushHookDirectory(directoryName: string, lockEntry: BffLockEntry | undefined, indexes: HookDirectoryIndexes): HookDirectoryResolution;
|
|
54
|
+
export declare function preflightPushHookDirectories(functions: LocalBffFunction[], appLock: BffLockScope, indexes: HookDirectoryIndexes, failures?: Map<string, string>): Map<string, HookDirectoryResolution>;
|
|
55
|
+
export declare function hookDirectoryError(code: string, message: string, details: Record<string, unknown>): Error;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x22cd45,_0xeb6741){const _0x40e167=a275_0x58ce,_0x493bd3=_0x22cd45();while(!![]){try{const _0x472543=-parseInt(_0x40e167(0x91))/0x1+parseInt(_0x40e167(0x76))/0x2*(parseInt(_0x40e167(0x7c))/0x3)+parseInt(_0x40e167(0x71))/0x4+-parseInt(_0x40e167(0x8d))/0x5+-parseInt(_0x40e167(0x98))/0x6*(-parseInt(_0x40e167(0x69))/0x7)+parseInt(_0x40e167(0x6b))/0x8+-parseInt(_0x40e167(0x79))/0x9;if(_0x472543===_0xeb6741)break;else _0x493bd3['push'](_0x493bd3['shift']());}catch(_0x59920c){_0x493bd3['push'](_0x493bd3['shift']());}}}(a275_0x847d,0xc124b));import{CliError}from'../../errors.js';function a275_0x847d(){const _0x11d3b9=['1267GjvqOV','datasetCode','9919136LCnugW','alias','\x22\x20changed\x20mapping\x20from\x20Dataset\x20\x22','get','Dataset\x20\x22','values','1139016cNcNmN','NFC','HOOK_ALIAS_AMBIGUOUS','HOOK_DIRECTORY_UNRESOLVED','HOOK_DIRECTORY_AMBIGUOUS','943442njgwds','HOOK\x20directory\x20\x22','toLowerCase','21579021GOVsJx','aliasToDatasetCodes','size','9ZaNGdQ','map','Incomplete\x20HOOK\x20path:\x20','\x22\x20points\x20to\x20a\x20Dataset\x20that\x20is\x20absent\x20from\x20current\x20platform\x20metadata.','HOOK','\x22\x20to\x20a\x20Dataset\x20alias\x20or\x20datasetCode.','add','includes','type','some','HOOK_DUPLICATE_DIRECTORIES','\x22\x20differs\x20only\x20by\x20case\x20from\x20another\x20Dataset\x20code.','datasetCodeToDatasets','\x22\x20has\x20multiple\x20SDK\x20aliases\x20and\x20has\x20no\x20unique\x20HOOK\x20directory.','\x22\x20resolves\x20to\x20multiple\x20Datasets.','set','push','2673300eLaOcG','message','functions','\x22\x20collides\x20across\x20datasetCode\x20and\x20alias\x20namespaces.','238472BPtKIj','lockKey','details','\x22\x20is\x20represented\x20by\x20multiple\x20HOOK\x20directories:\x20','join','SDK\x20alias\x20\x22','split','33882sDCtQD','HOOK_DATASET_NOT_FOUND','entries','Cannot\x20resolve\x20HOOK\x20directory\x20\x22','code'];a275_0x847d=function(){return _0x11d3b9;};return a275_0x847d();}export function trackedHookDirectoryMappings(_0x1934da){const _0x5cc7e4=a275_0x58ce,_0x7676a8=[];for(const [_0x240ce6,_0x396e05]of Object[_0x5cc7e4(0x66)](_0x1934da[_0x5cc7e4(0x8f)])){const [_0x571320,_0x1f614a]=_0x240ce6[_0x5cc7e4(0x97)]('/');if(_0x571320!==_0x5cc7e4(0x80)||!_0x1f614a||!_0x396e05[_0x5cc7e4(0x6a)])continue;_0x7676a8[_0x5cc7e4(0x8c)]({'alias':_0x1f614a,'datasetCode':_0x396e05[_0x5cc7e4(0x6a)]});}return _0x7676a8;}export function uniqueTrackedHookDirectoryByDataset(_0xc6b479){const _0x2f3c98=a275_0x58ce,_0x73f30a=new Map();for(const _0x305d58 of trackedHookDirectoryMappings(_0xc6b479)){const _0xa9eb8e=directoryIdentity(_0x305d58[_0x2f3c98(0x6a)]),_0x195a0f=_0x73f30a[_0x2f3c98(0x6e)](_0xa9eb8e)??new Map();_0x195a0f[_0x2f3c98(0x8b)](directoryIdentity(_0x305d58[_0x2f3c98(0x6c)]),_0x305d58[_0x2f3c98(0x6c)]),_0x73f30a[_0x2f3c98(0x8b)](_0xa9eb8e,_0x195a0f);}const _0x5e117e=new Map();for(const [_0x48c15d,_0x385aa3]of _0x73f30a){if(_0x385aa3[_0x2f3c98(0x7b)]>0x1)throw hookDirectoryError(_0x2f3c98(0x86),_0x2f3c98(0x6f)+_0x48c15d+'\x22\x20has\x20multiple\x20tracked\x20HOOK\x20directories:\x20'+[..._0x385aa3[_0x2f3c98(0x70)]()][_0x2f3c98(0x95)](',\x20')+'.',{'datasetCode':_0x48c15d,'directories':[..._0x385aa3['values']()]});_0x5e117e[_0x2f3c98(0x8b)](_0x48c15d,[..._0x385aa3[_0x2f3c98(0x70)]()][0x0]);}return _0x5e117e;}function a275_0x58ce(_0x11e368,_0x13a07a){_0x11e368=_0x11e368-0x66;const _0x847d05=a275_0x847d();let _0x58ce31=_0x847d05[_0x11e368];return _0x58ce31;}export function assertUnambiguousHookDirectoryMappings(_0x131188){const _0x11ddd5=a275_0x58ce,_0x5ebc8d=new Map();for(const {alias:_0x8e8fdd,datasetCode:_0x1191fa}of _0x131188){const _0x2fc225=directoryIdentity(_0x8e8fdd),_0x27284a=_0x5ebc8d[_0x11ddd5(0x6e)](_0x2fc225)??new Set();_0x27284a['add'](_0x1191fa),_0x5ebc8d[_0x11ddd5(0x8b)](_0x2fc225,_0x27284a);}for(const [_0x3da4ab,_0x207677]of _0x5ebc8d){if(_0x207677[_0x11ddd5(0x7b)]>0x1)throw hookDirectoryError(_0x11ddd5(0x75),_0x11ddd5(0x77)+_0x3da4ab+'\x22\x20resolves\x20to\x20multiple\x20Datasets.',{'directoryName':_0x3da4ab,'datasetCodes':[..._0x207677]});}}export function assertUnambiguousHookAliases(_0x53768c){const _0x3bb833=a275_0x58ce,_0x2e9b65=[..._0x53768c],_0x57c351=new Map(),_0x5bff91=new Map();for(const {alias:_0x581e25,datasetCode:_0x410cd2}of _0x2e9b65){const _0x5c18e6=directoryIdentity(_0x581e25),_0x1e3bcd=directoryIdentity(_0x410cd2),_0x3925b5=_0x57c351['get'](_0x5c18e6)??new Set();_0x3925b5[_0x3bb833(0x82)](_0x410cd2),_0x57c351[_0x3bb833(0x8b)](_0x5c18e6,_0x3925b5);const _0x37f742=_0x5bff91[_0x3bb833(0x6e)](_0x1e3bcd)??new Set();_0x37f742[_0x3bb833(0x82)](_0x581e25),_0x5bff91[_0x3bb833(0x8b)](_0x1e3bcd,_0x37f742);}for(const [_0x35d21e,_0x5b7048]of _0x57c351){if(_0x5b7048[_0x3bb833(0x7b)]>0x1)throw hookDirectoryError(_0x3bb833(0x73),_0x3bb833(0x96)+_0x35d21e+_0x3bb833(0x8a),{'alias':_0x35d21e,'datasetCodes':[..._0x5b7048]});}for(const [_0x143c73,_0x37c378]of _0x5bff91){if(_0x37c378[_0x3bb833(0x7b)]>0x1)throw hookDirectoryError(_0x3bb833(0x73),_0x3bb833(0x6f)+_0x143c73+_0x3bb833(0x89),{'datasetCode':_0x143c73,'aliases':[..._0x37c378]});}}export function buildHookDirectoryIndexes(_0x588e14,_0x39732c=[]){const _0x1762bf=a275_0x58ce,_0x4964d5=[..._0x39732c];assertUnambiguousHookDirectoryMappings(_0x4964d5[_0x1762bf(0x7d)](([_0xa0cc1a,_0x225905])=>({'alias':_0xa0cc1a,'datasetCode':_0x225905})));const _0x515e5f=new Map(),_0x41a128=new Map();for(const _0x4a31e2 of _0x588e14){appendUnique(_0x515e5f,directoryIdentity(_0x4a31e2[_0x1762bf(0x68)]),_0x4a31e2,_0x747605=>_0x747605[_0x1762bf(0x68)]);}for(const [_0x125151,_0xe73929]of _0x4964d5){appendUnique(_0x41a128,directoryIdentity(_0x125151),_0xe73929,_0x4903f8=>_0x4903f8);}return{'datasetCodeToDatasets':_0x515e5f,'aliasToDatasetCodes':_0x41a128};}export function resolvePushHookDirectory(_0x348007,_0x130916,_0x2f25b2){const _0x3337eb=a275_0x58ce,_0x4a9647=directoryIdentity(_0x348007),_0x3cfa1c=_0x2f25b2['datasetCodeToDatasets']['get'](_0x4a9647)??[],_0x3a0aed=_0x2f25b2[_0x3337eb(0x7a)][_0x3337eb(0x6e)](_0x4a9647)??[],_0x4b4f21=new Set([..._0x3cfa1c[_0x3337eb(0x7d)](_0x31cf29=>_0x31cf29[_0x3337eb(0x68)]),..._0x3a0aed]);if(_0x4b4f21['size']>0x1)throw hookDirectoryError('HOOK_DIRECTORY_AMBIGUOUS',_0x3337eb(0x77)+_0x348007+_0x3337eb(0x90),{'directoryName':_0x348007,'datasetCodes':[..._0x4b4f21]});const _0x5dbbd1=[..._0x4b4f21][0x0];if(_0x5dbbd1&&_0x130916?.[_0x3337eb(0x6a)]&&_0x5dbbd1!==_0x130916['datasetCode'])throw hookDirectoryError('HOOK_MAPPING_DRIFT',_0x3337eb(0x77)+_0x348007+_0x3337eb(0x6d)+_0x130916['datasetCode']+'\x22\x20to\x20\x22'+_0x5dbbd1+'\x22.',{'directoryName':_0x348007,'datasetCode':_0x5dbbd1,'lockedDatasetCode':_0x130916[_0x3337eb(0x6a)]});const _0x5b5bab=_0x5dbbd1?findDatasetByCode(_0x2f25b2,_0x5dbbd1):undefined,_0x3d052e=!!_0x5dbbd1&&_0x3a0aed[_0x3337eb(0x83)](_0x5dbbd1);if(_0x5b5bab)return{'dataset':_0x5b5bab,'datasetCode':_0x5b5bab['code'],..._0x3d052e?{'alias':_0x348007}:{},'directoryProtocol':_0x3d052e?'alias':_0x3337eb(0x6a),'warnings':[]};const _0x85ebc9=_0x130916?.['datasetCode'];if(_0x85ebc9){const _0x5d7eb3=findDatasetByCode(_0x2f25b2,_0x85ebc9);if(_0x5d7eb3)return{'dataset':_0x5d7eb3,'datasetCode':_0x5d7eb3[_0x3337eb(0x68)],..._0x130916[_0x3337eb(0x6c)]?{'alias':_0x130916[_0x3337eb(0x6c)]}:{},'directoryProtocol':_0x130916[_0x3337eb(0x6c)]?_0x3337eb(0x6c):_0x3337eb(0x6a),'warnings':[]};}if(_0x5dbbd1||_0x85ebc9){const _0x3db567=_0x5dbbd1??_0x85ebc9;throw hookDirectoryError(_0x3337eb(0x99),_0x3337eb(0x77)+_0x348007+_0x3337eb(0x7f),{'directoryName':_0x348007,'datasetCode':_0x3db567});}throw hookDirectoryError(_0x3337eb(0x74),_0x3337eb(0x67)+_0x348007+_0x3337eb(0x81),{'directoryName':_0x348007});}export function preflightPushHookDirectories(_0x472fd2,_0x352bdc,_0xd71155,_0x1a5ac7){const _0x2bfc39=a275_0x58ce,_0x28ac70=new Map(),_0x18e06d=new Map();for(const _0x162b19 of _0x472fd2){if(_0x162b19[_0x2bfc39(0x84)]!=='HOOK')continue;const _0x3bf5c4=_0x162b19[_0x2bfc39(0x6c)];if(!_0x3bf5c4)throw hookDirectoryError('HOOK_DIRECTORY_UNRESOLVED',_0x2bfc39(0x7e)+_0x162b19['lockKey'],{'lockKey':_0x162b19['lockKey']});let _0xc7d1d1;try{_0xc7d1d1=resolvePushHookDirectory(_0x3bf5c4,_0x352bdc[_0x2bfc39(0x8f)][_0x162b19[_0x2bfc39(0x92)]],_0xd71155);}catch(_0x3a56b0){if(_0x1a5ac7&&_0x3a56b0 instanceof CliError&&[_0x2bfc39(0x99),_0x2bfc39(0x74)][_0x2bfc39(0x83)](_0x3a56b0[_0x2bfc39(0x68)])){_0x1a5ac7[_0x2bfc39(0x8b)](_0x162b19[_0x2bfc39(0x92)],_0x3a56b0[_0x2bfc39(0x8e)]);continue;}throw _0x3a56b0;}_0x28ac70[_0x2bfc39(0x8b)](_0x162b19[_0x2bfc39(0x92)],_0xc7d1d1);const _0xd5b7b5=_0x18e06d[_0x2bfc39(0x6e)](_0xc7d1d1['datasetCode'])??new Set();_0xd5b7b5['add'](_0x3bf5c4),_0x18e06d[_0x2bfc39(0x8b)](_0xc7d1d1[_0x2bfc39(0x6a)],_0xd5b7b5);}for(const [_0x459b5b,_0x4512fb]of _0x18e06d){if(_0x4512fb['size']>0x1)throw hookDirectoryError(_0x2bfc39(0x86),_0x2bfc39(0x6f)+_0x459b5b+_0x2bfc39(0x94)+[..._0x4512fb]['join'](',\x20')+'.',{'datasetCode':_0x459b5b,'directories':[..._0x4512fb]});}return _0x28ac70;}export function hookDirectoryError(_0x35475d,_0xe84a56,_0x25cc18){const _0x43246c=a275_0x58ce,_0x2f45b5=new CliError(_0x35475d,0x2,_0x35475d+':\x20'+_0xe84a56);return _0x2f45b5[_0x43246c(0x93)]=_0x25cc18,_0x2f45b5;}function findDatasetByCode(_0x114594,_0x2925d7){const _0x5fb741=a275_0x58ce,_0x518136=_0x114594[_0x5fb741(0x88)]['get'](directoryIdentity(_0x2925d7))??[];if(_0x518136['length']>0x1)throw hookDirectoryError('HOOK_DATASET_CODE_AMBIGUOUS','Dataset\x20code\x20\x22'+_0x2925d7+_0x5fb741(0x87),{'datasetCode':_0x2925d7,'candidates':_0x518136['map'](datasetFact)});return _0x518136[0x0];}function directoryIdentity(_0x4fb738){const _0x1f8877=a275_0x58ce;return _0x4fb738['normalize'](_0x1f8877(0x72))[_0x1f8877(0x78)]();}function appendUnique(_0xddc69d,_0x3bd63b,_0x5af620,_0x2c05c7){const _0x3dfa51=a275_0x58ce,_0x290845=_0xddc69d[_0x3dfa51(0x6e)](_0x3bd63b)??[];!_0x290845[_0x3dfa51(0x85)](_0x7e7535=>_0x2c05c7(_0x7e7535)===_0x2c05c7(_0x5af620))&&_0x290845[_0x3dfa51(0x8c)](_0x5af620),_0xddc69d[_0x3dfa51(0x8b)](_0x3bd63b,_0x290845);}function datasetFact(_0x2afc30){return{'id':_0x2afc30['id'],'name':_0x2afc30['name'],'datasetCode':_0x2afc30['code']};}
|
package/lib/core/bff/lock.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4cf327,_0x51051d){const _0x6337fd=a276_0x3823,_0x4768f3=_0x4cf327();while(!![]){try{const _0x1f448d=parseInt(_0x6337fd(0x15d))/0x1+-parseInt(_0x6337fd(0x14d))/0x2+parseInt(_0x6337fd(0x156))/0x3+-parseInt(_0x6337fd(0x15e))/0x4*(-parseInt(_0x6337fd(0x160))/0x5)+parseInt(_0x6337fd(0x157))/0x6+parseInt(_0x6337fd(0x14f))/0x7*(-parseInt(_0x6337fd(0x158))/0x8)+parseInt(_0x6337fd(0x153))/0x9;if(_0x1f448d===_0x51051d)break;else _0x4768f3['push'](_0x4768f3['shift']());}catch(_0x58192f){_0x4768f3['push'](_0x4768f3['shift']());}}}(a276_0x17bb,0x6d260));import{mkdir,readFile,writeFile}from'node:fs/promises';function a276_0x17bb(){const _0x1cf243=['functions','2725470EQZbpE','code','utf8','885528OyodQJ','1324224JZGSZS','8iqVoco',':\x20scriptsRoot\x20mismatch\x20—\x20','current\x20\x22','Failed\x20to\x20read\x20Backend\x20Function\x20lock\x20file:\x20','\x22.\x20','556532GQOhoT','2820UZXKqj','apps','470HfbdFq','ENOENT','object','211700JhLHSE','scriptsRoot','6220130jMnWRU','lastSync','parse'];a276_0x17bb=function(){return _0x1cf243;};return a276_0x17bb();}function a276_0x3823(_0x3ec916,_0x4b37ad){_0x3ec916=_0x3ec916-0x14b;const _0x17bb81=a276_0x17bb();let _0x3823cd=_0x17bb81[_0x3ec916];return _0x3823cd;}import{dirname}from'node:path';export function createEmptyBffLock(){return{'apps':{}};}export function ensureLockScope(_0x1712d3,_0x1651ae,_0x4f6ff1,_0x957f36){const _0x540d36=a276_0x3823,_0x4a1a1f={'apps':_0x1712d3[_0x540d36(0x15f)]&&typeof _0x1712d3['apps']==='object'?_0x1712d3[_0x540d36(0x15f)]:{}};let _0x39a71b=_0x4a1a1f['apps'][_0x1651ae];if(!_0x39a71b)return _0x39a71b={'scriptsRoot':_0x4f6ff1,'lastSync':'','functions':{}},_0x4a1a1f['apps'][_0x1651ae]=_0x39a71b,{'lockData':_0x4a1a1f,'appLock':_0x39a71b};if(!_0x39a71b[_0x540d36(0x14e)])_0x39a71b[_0x540d36(0x14e)]=_0x4f6ff1;else{if(_0x39a71b[_0x540d36(0x14e)]!==_0x4f6ff1)throw new Error(_0x957f36+_0x540d36(0x159)+(_0x540d36(0x15a)+_0x4f6ff1+'\x22\x20vs\x20lock\x20\x22'+_0x39a71b['scriptsRoot']+_0x540d36(0x15c))+'Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.');}return!_0x39a71b['functions']&&(_0x39a71b[_0x540d36(0x152)]={}),!_0x39a71b[_0x540d36(0x150)]&&(_0x39a71b[_0x540d36(0x150)]=''),{'lockData':_0x4a1a1f,'appLock':_0x39a71b};}export async function readBffLockFile(_0x13ea89){const _0x3a68d6=a276_0x3823;try{const _0xd936d8=await readFile(_0x13ea89,_0x3a68d6(0x155)),_0x4bef2c=JSON[_0x3a68d6(0x151)](_0xd936d8);return{'apps':_0x4bef2c['apps']&&typeof _0x4bef2c[_0x3a68d6(0x15f)]===_0x3a68d6(0x14c)?_0x4bef2c['apps']:{}};}catch(_0x2af50f){if(_0x2af50f[_0x3a68d6(0x154)]===_0x3a68d6(0x14b))return null;throw new Error(_0x3a68d6(0x15b)+String(_0x2af50f));}}export async function writeBffLockFile(_0x5f1d27,_0x4cbd9c){await mkdir(dirname(_0x5f1d27),{'recursive':!![]}),await writeFile(_0x5f1d27,JSON['stringify'](_0x4cbd9c,null,0x2),'utf8');}
|
package/lib/core/bff/types.d.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* 仅类型,不含运行时逻辑。
|
|
6
6
|
*/
|
|
7
7
|
export type BffScriptType = "COMMON" | "ENDPOINT" | "HOOK";
|
|
8
|
+
export type HookDirectoryProtocol = "alias" | "datasetCode";
|
|
8
9
|
export interface HookLocation {
|
|
9
10
|
/** api.ts 中定义的别名,用于本地目录命名和 lockKey。从 statistics 构建时可能缺失,由命令层补充。 */
|
|
10
11
|
alias?: string;
|
|
@@ -42,6 +43,20 @@ export interface BffLockScope {
|
|
|
42
43
|
export interface BffLockFile {
|
|
43
44
|
apps: Record<string, BffLockScope>;
|
|
44
45
|
}
|
|
46
|
+
export interface BffSyncConflict {
|
|
47
|
+
code: "BFF_LOCAL_UNSYNCED" | "BFF_REMOTE_VERSION_CHANGED" | "BFF_REMOTE_VERSION_MISSING";
|
|
48
|
+
lockKey: string;
|
|
49
|
+
filePath: string;
|
|
50
|
+
remoteId?: number;
|
|
51
|
+
expectedVersion?: number;
|
|
52
|
+
message: string;
|
|
53
|
+
nextAction: {
|
|
54
|
+
action: "push_local" | "review_remote_and_merge";
|
|
55
|
+
command: string;
|
|
56
|
+
requiresReview: true;
|
|
57
|
+
message: string;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
45
60
|
export interface ScriptStatistics {
|
|
46
61
|
datasetCode: string;
|
|
47
62
|
operationType: string;
|
package/lib/core/bff/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a278_0x34c79e=a278_0xa445;(function(_0x6e6b35,_0x2e5335){const _0x1aca95=a278_0xa445,_0x9ece8=_0x6e6b35();while(!![]){try{const _0x9c4c4f=parseInt(_0x1aca95(0x1a8))/0x1*(parseInt(_0x1aca95(0x1a4))/0x2)+parseInt(_0x1aca95(0x1b7))/0x3+-parseInt(_0x1aca95(0x19f))/0x4*(parseInt(_0x1aca95(0x1ad))/0x5)+-parseInt(_0x1aca95(0x1ab))/0x6+parseInt(_0x1aca95(0x1a9))/0x7*(-parseInt(_0x1aca95(0x1b6))/0x8)+parseInt(_0x1aca95(0x1b5))/0x9*(-parseInt(_0x1aca95(0x1a5))/0xa)+parseInt(_0x1aca95(0x1b4))/0xb;if(_0x9c4c4f===_0x2e5335)break;else _0x9ece8['push'](_0x9ece8['shift']());}catch(_0x3434ef){_0x9ece8['push'](_0x9ece8['shift']());}}}(a278_0x5d3d,0xc29b3));export const DEFAULT_BFF_SCRIPT_DESCRIPTION=a278_0x34c79e(0x1b2);const LEGACY_DEFAULT_BFF_SCRIPT_DESCRIPTION=a278_0x34c79e(0x1b1);export function snakeToCamel(_0x2f3d7){const _0x3cfc45=a278_0x34c79e;return _0x2f3d7[_0x3cfc45(0x1ae)]()[_0x3cfc45(0x1a3)](/_([a-z])/g,(_0x37982f,_0x43a8a1)=>_0x43a8a1[_0x3cfc45(0x1a1)]());}function a278_0xa445(_0x441553,_0x46abb5){_0x441553=_0x441553-0x19f;const _0x5d3dc4=a278_0x5d3d();let _0xa4458c=_0x5d3dc4[_0x441553];return _0xa4458c;}export function findHookLocationByRemoteId(_0x1459ef,_0xa83cb0){const _0x1a9450=a278_0x34c79e;if(!_0xa83cb0)return undefined;for(const [_0x8d24af,_0xfdc945]of Object[_0x1a9450(0x1a6)](_0x1459ef)){if(_0xfdc945[_0x1a9450(0x1af)]===_0xa83cb0&&_0xfdc945['datasetCode']&&_0xfdc945['operationType']&&_0xfdc945[_0x1a9450(0x1a0)]){const _0x2a6ff4=_0x8d24af[_0x1a9450(0x1b0)]('/')[0x1];return{'alias':_0x2a6ff4||_0xfdc945['alias'],'datasetCode':_0xfdc945[_0x1a9450(0x1ac)],'operationType':_0xfdc945['operationType'],'functionNode':_0xfdc945[_0x1a9450(0x1a0)]};}}return undefined;}export function extractScriptDescription(_0x577b34){const _0x402e76=a278_0x34c79e,_0x323a3b=_0x577b34['match'](/^\s*\/\*\*([\s\S]*?)\*\//);if(!_0x323a3b?.[0x1])return undefined;const _0x3c9968=_0x323a3b[0x1],_0x17ed79=_0x4c551d=>{const _0x5c344d=a278_0xa445,_0x46341d=_0x4c551d?.[_0x5c344d(0x1a7)]();if(!_0x46341d||_0x46341d===DEFAULT_BFF_SCRIPT_DESCRIPTION||_0x46341d===LEGACY_DEFAULT_BFF_SCRIPT_DESCRIPTION)return undefined;return _0x46341d;},_0x29229a=_0x3c9968[_0x402e76(0x1a2)](/^\s*\*\s*\[\s*脚本描述\s*]\s*(.+)$/m);if(_0x29229a)return _0x17ed79(_0x29229a[0x1]);const _0x455f91=_0x3c9968[_0x402e76(0x1b0)](/\r?\n/)[_0x402e76(0x1b9)](_0x26c203=>_0x26c203[_0x402e76(0x1a3)](/^\s*\*\s?/,'')[_0x402e76(0x1a7)]()),_0x49200c=_0x455f91[_0x402e76(0x1aa)](_0x21cd0b=>/^\[\s*脚本类型\s*]\s*\S+/[_0x402e76(0x1b3)](_0x21cd0b))&&_0x455f91[_0x402e76(0x1aa)](_0x41a3ac=>/^\[\s*脚本名称\s*]\s*\S+/[_0x402e76(0x1b3)](_0x41a3ac));if(!_0x49200c)return undefined;for(const _0x147076 of _0x455f91){if(!_0x147076||_0x147076['startsWith']('@')||/^\[[^\]]+]\s*/['test'](_0x147076))continue;return _0x17ed79(_0x147076);}return undefined;}export function isValidBffFunctionName(_0x323ac0){const _0x5badaf=a278_0x34c79e;return/^[A-Za-z_$][A-Za-z0-9_$]*$/[_0x5badaf(0x1b3)](_0x323ac0);}function a278_0x5d3d(){const _0x5097fc=['map','3760736DzPqMT','functionNode','toUpperCase','match','replace','6FAupQD','664220ElTjWr','entries','trim','333255LqfLZq','154EVUWcy','some','5059380ndbpWn','datasetCode','5vbWdKR','toLowerCase','remoteId','split','TODO:\x20add\x20script\x20description','TODO:\x20补充脚本功能描述','test','36635335uMFOwF','126zRbnnc','513176wsXqbP','1774239ssjnfr','after'];a278_0x5d3d=function(){return _0x5097fc;};return a278_0x5d3d();}export function normalizeHookFunctionNode(_0x2aefa1){const _0x27dcba=a278_0x34c79e;if(!_0x2aefa1)return undefined;const _0x3408c5=_0x2aefa1[_0x27dcba(0x1a7)]()['toLowerCase']();if(_0x3408c5==='before'||_0x3408c5===_0x27dcba(0x1b8))return _0x3408c5;return undefined;}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ErRelationCardinality } from "../core/api-client.js";
|
|
2
|
+
export declare const CROSS_DB_RELATION_PATHS: {
|
|
3
|
+
readonly list: "/smartapi/cross-db-relation/query";
|
|
4
|
+
readonly create: "/smartapi/cross-db-relation/create";
|
|
5
|
+
readonly update: "/smartapi/cross-db-relation/update";
|
|
6
|
+
readonly delete: "/smartapi/cross-db-relation/delete";
|
|
7
|
+
};
|
|
8
|
+
export interface CrossDbRelationSource {
|
|
9
|
+
appCode: string;
|
|
10
|
+
fromDatasetCode: string;
|
|
11
|
+
fromField: string;
|
|
12
|
+
fromDblinkId?: number;
|
|
13
|
+
}
|
|
14
|
+
export interface CrossDbRelationMutation extends CrossDbRelationSource {
|
|
15
|
+
toDatasetCode: string;
|
|
16
|
+
toField: string;
|
|
17
|
+
refTableLabelName?: string;
|
|
18
|
+
cardinality?: ErRelationCardinality;
|
|
19
|
+
}
|
|
20
|
+
export interface CrossDbRelationQuery {
|
|
21
|
+
appCode: string;
|
|
22
|
+
fromDblinkId: number;
|
|
23
|
+
fromDatasetCode?: string;
|
|
24
|
+
fromField?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface CrossDbRelationDetail {
|
|
27
|
+
relationId: number | string;
|
|
28
|
+
fromDblinkId: number;
|
|
29
|
+
fromDatasetCode: string | null;
|
|
30
|
+
fromDatasetName: string | null;
|
|
31
|
+
fromTableName: string;
|
|
32
|
+
fromField: string;
|
|
33
|
+
toDblinkId: number;
|
|
34
|
+
toDatasetCode: string | null;
|
|
35
|
+
toDatasetName: string | null;
|
|
36
|
+
toTableName: string;
|
|
37
|
+
toField: string;
|
|
38
|
+
refTableLabelName: string;
|
|
39
|
+
cardinality: ErRelationCardinality | null;
|
|
40
|
+
relationType: number;
|
|
41
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a279_0x5eab(){const _0x5ec3b5=['12MqKlGm','141200UtXNgU','/smartapi/cross-db-relation/create','12GqBhuh','1875657jIKTTi','681655TSXBxk','361521inztYK','/smartapi/cross-db-relation/delete','12pvktmy','24tTGtPS','/smartapi/cross-db-relation/query','2729243JdNBvI','560317Aboqge','/smartapi/cross-db-relation/update','237884ARYbfb','16BOoBJl'];a279_0x5eab=function(){return _0x5ec3b5;};return a279_0x5eab();}function a279_0x3303(_0x3581a4,_0x3eec4e){_0x3581a4=_0x3581a4-0xd6;const _0x5eab1f=a279_0x5eab();let _0x33032c=_0x5eab1f[_0x3581a4];return _0x33032c;}const a279_0x312b32=a279_0x3303;(function(_0x5860f4,_0x4b090c){const _0x14b06f=a279_0x3303,_0x4c4770=_0x5860f4();while(!![]){try{const _0x38dcff=-parseInt(_0x14b06f(0xe5))/0x1+parseInt(_0x14b06f(0xd7))/0x2*(parseInt(_0x14b06f(0xe1))/0x3)+parseInt(_0x14b06f(0xd8))/0x4*(-parseInt(_0x14b06f(0xde))/0x5)+parseInt(_0x14b06f(0xd9))/0x6*(parseInt(_0x14b06f(0xdd))/0x7)+parseInt(_0x14b06f(0xe2))/0x8*(parseInt(_0x14b06f(0xdf))/0x9)+parseInt(_0x14b06f(0xda))/0xa+parseInt(_0x14b06f(0xe4))/0xb*(parseInt(_0x14b06f(0xdc))/0xc);if(_0x38dcff===_0x4b090c)break;else _0x4c4770['push'](_0x4c4770['shift']());}catch(_0xf6114e){_0x4c4770['push'](_0x4c4770['shift']());}}}(a279_0x5eab,0x46801));export const CROSS_DB_RELATION_PATHS={'list':a279_0x312b32(0xe3),'create':a279_0x312b32(0xdb),'update':a279_0x312b32(0xd6),'delete':a279_0x312b32(0xe0)};
|
package/lib/core/db-resolver.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x247533,_0x2e715b){const _0x5462b6=a280_0x16fa,_0x436d40=_0x247533();while(!![]){try{const _0x1ba1ae=-parseInt(_0x5462b6(0x1b1))/0x1+-parseInt(_0x5462b6(0x1b0))/0x2+parseInt(_0x5462b6(0x1ca))/0x3*(-parseInt(_0x5462b6(0x1be))/0x4)+parseInt(_0x5462b6(0x1b5))/0x5*(-parseInt(_0x5462b6(0x1cd))/0x6)+-parseInt(_0x5462b6(0x1bc))/0x7*(parseInt(_0x5462b6(0x1ba))/0x8)+parseInt(_0x5462b6(0x1c1))/0x9+-parseInt(_0x5462b6(0x1af))/0xa*(-parseInt(_0x5462b6(0x1bf))/0xb);if(_0x1ba1ae===_0x2e715b)break;else _0x436d40['push'](_0x436d40['shift']());}catch(_0x3e7b75){_0x436d40['push'](_0x436d40['shift']());}}}(a280_0xe26c,0x98f5a));import{listDatasets}from'../core/api-client.js';const cache=new Map();export async function listDatabases(_0x1c2547){const _0x54a5e8=a280_0x16fa;if(cache[_0x54a5e8(0x1b2)](_0x1c2547))return cache[_0x54a5e8(0x1b8)](_0x1c2547);const _0x2410c2=await listDatasets(_0x1c2547),_0x383169=new Map();for(const _0x1e002b of _0x2410c2){const _0x662b99=_0x1e002b[_0x54a5e8(0x1b6)];_0x662b99?.[_0x54a5e8(0x1ae)]!=null&&_0x383169['set'](_0x662b99['dbId'],_0x662b99[_0x54a5e8(0x1c6)]??_0x54a5e8(0x1cb)+_0x662b99[_0x54a5e8(0x1ae)]);}const _0x1d3223=[..._0x383169[_0x54a5e8(0x1c8)]()]['map'](([_0x62bc27,_0x421889])=>({'dbId':_0x62bc27,'dbName':_0x421889}));return cache['set'](_0x1c2547,_0x1d3223),_0x1d3223;}export async function resolveDb(_0xecb642,_0x5cbdf3){const _0x1bdc77=a280_0x16fa,_0x2dfc26=await listDatabases(_0xecb642);if(_0x2dfc26[_0x1bdc77(0x1c0)]===0x0)return{'resolved':[],'error':_0x1bdc77(0x1bb)+_0xecb642+_0x1bdc77(0x1c2)};if(!_0x5cbdf3)return{'resolved':_0x2dfc26};const _0x52b11a=Number(_0x5cbdf3);if(!Number[_0x1bdc77(0x1c4)](_0x52b11a)){const _0x352fcf=_0x2dfc26[_0x1bdc77(0x1bd)](_0x2db41e=>_0x2db41e[_0x1bdc77(0x1ae)]===_0x52b11a);if(_0x352fcf)return{'resolved':[_0x352fcf]};}const _0x10cdc1=_0x5cbdf3[_0x1bdc77(0x1b7)](),_0x5211b9=_0x2dfc26[_0x1bdc77(0x1c7)](_0x5afe33=>_0x5afe33[_0x1bdc77(0x1c6)][_0x1bdc77(0x1b7)]()['includes'](_0x10cdc1));if(_0x5211b9[_0x1bdc77(0x1c0)]>0x0)return{'resolved':_0x5211b9};const _0x62db79=_0x2dfc26[_0x1bdc77(0x1cc)](_0x153b3b=>_0x153b3b[_0x1bdc77(0x1c6)]+'\x20('+_0x153b3b[_0x1bdc77(0x1ae)]+')')[_0x1bdc77(0x1c9)](',\x20');return{'resolved':[],'error':_0x1bdc77(0x1b3)+_0x5cbdf3+'\x22\x20under\x20app\x20\x22'+_0xecb642+_0x1bdc77(0x1c3)+_0x62db79+_0x1bdc77(0x1c5)};}function a280_0xe26c(){const _0x162114=['filter','entries','join','6FxgXVG','db-','map','1616298YLXmGc','dbId','51410dbfGdL','2429366NwnNBq','639230gegRQD','has','No\x20database\x20matching\x20\x22','\x22\x20matches\x20multiple\x20databases:\x20','10qjXizu','dbtableConfig','toLowerCase','get','.\x20Be\x20more\x20specific.','116584QvzjuB','No\x20linked\x20databases\x20found\x20under\x20app\x20\x22','126AoVEAd','find','403604WNKzOP','4862EPCLmq','length','10898955iteQdG','\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.','\x22.\x20Available:\x20','isNaN','.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.','dbName'];a280_0xe26c=function(){return _0x162114;};return a280_0xe26c();}function a280_0x16fa(_0x493d19,_0x525631){_0x493d19=_0x493d19-0x1ae;const _0xe26cdb=a280_0xe26c();let _0x16fae7=_0xe26cdb[_0x493d19];return _0x16fae7;}export async function resolveOneDb(_0xc2bbdb,_0x28c2bf){const _0x11c204=a280_0x16fa,{resolved:_0x33bfaa,error:_0x5b6960}=await resolveDb(_0xc2bbdb,_0x28c2bf);if(_0x5b6960)return{'db':null,'error':_0x5b6960};if(_0x33bfaa[_0x11c204(0x1c0)]===0x1)return{'db':_0x33bfaa[0x0]};if(!_0x28c2bf){const _0x302fff=_0x33bfaa[_0x11c204(0x1cc)](_0x2d2695=>_0x2d2695[_0x11c204(0x1c6)]+'\x20('+_0x2d2695[_0x11c204(0x1ae)]+')')[_0x11c204(0x1c9)](',\x20');return{'db':null,'error':'Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20'+_0x302fff};}const _0x57be6d=_0x33bfaa['map'](_0x2816c3=>_0x2816c3['dbName']+'\x20('+_0x2816c3[_0x11c204(0x1ae)]+')')[_0x11c204(0x1c9)](',\x20');return{'db':null,'error':'\x22'+_0x28c2bf+_0x11c204(0x1b4)+_0x57be6d+_0x11c204(0x1b9)};}export async function getDbName(_0x595658,_0x16c475){const _0x6dd01d=a280_0x16fa,_0x46cab8=await listDatabases(_0x595658);return _0x46cab8[_0x6dd01d(0x1bd)](_0x19acef=>_0x19acef[_0x6dd01d(0x1ae)]===_0x16c475)?.[_0x6dd01d(0x1c6)];}
|