@lovrabet/rabetbase-cli 2.5.3 → 2.5.4-beta.2
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 +11 -0
- package/lib/api/api-doc.js +1 -1
- package/lib/api/api-group.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/generate-sdk-config-file.js +1 -1
- package/lib/api/legacy-api-file.js +1 -1
- package/lib/api/model-registry-file.js +1 -1
- package/lib/api/model-registry-scaffold.js +1 -1
- package/lib/api/model-source.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/logs.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/delete.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.d.ts +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/dataset/batch-design.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/cross-relation-create.js +1 -1
- package/lib/commands/dataset/cross-relation-delete.js +1 -1
- package/lib/commands/dataset/cross-relation-list.js +1 -1
- package/lib/commands/dataset/cross-relation-shared.js +1 -1
- package/lib/commands/dataset/cross-relation-update.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-restore.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/dataset/user-deleted-field-list.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/table-diff-shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/deployment/index.js +1 -1
- package/lib/commands/deployment/sync-all.js +1 -1
- package/lib/commands/deployment/sync-jobs.js +1 -1
- package/lib/commands/deployment/sync-status.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/flow/create.js +1 -1
- package/lib/commands/flow/detail.js +1 -1
- package/lib/commands/flow/index.js +1 -1
- package/lib/commands/flow/list.js +1 -1
- package/lib/commands/flow/publish.js +1 -1
- package/lib/commands/flow/runtime-resources-shared.js +1 -1
- package/lib/commands/flow/runtime-role-list.js +1 -1
- package/lib/commands/flow/runtime-role-user-list.js +1 -1
- package/lib/commands/flow/runtime-user-search.js +1 -1
- package/lib/commands/flow/shared.d.ts +2 -0
- package/lib/commands/flow/shared.js +1 -1
- package/lib/commands/flow/update.js +1 -1
- package/lib/commands/flow/validate.js +1 -1
- package/lib/commands/instant-api-policy/current.js +1 -1
- package/lib/commands/instant-api-policy/index.js +1 -1
- package/lib/commands/instant-api-policy/init.js +1 -1
- package/lib/commands/instant-api-policy/publish.js +1 -1
- package/lib/commands/instant-api-policy/pull.js +1 -1
- package/lib/commands/instant-api-policy/revision.js +1 -1
- package/lib/commands/instant-api-policy/revisions.js +1 -1
- package/lib/commands/instant-api-policy/rollback.js +1 -1
- package/lib/commands/instant-api-policy/shared.js +1 -1
- package/lib/commands/instant-api-policy/validate.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/search.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.js +1 -1
- package/lib/commands/page/custom/update.js +1 -1
- package/lib/commands/page/data-list-status.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/api-architecture-upgrade.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/domain-routing-sync.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/rule/get.js +1 -1
- package/lib/commands/rule/index.js +1 -1
- package/lib/commands/rule/list.js +1 -1
- package/lib/commands/rule/set.js +1 -1
- package/lib/commands/rule/shared.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/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.d.ts +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.d.ts +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.d.ts +4 -0
- 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.d.ts +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/routing-profile.d.ts +14 -1
- package/lib/constant/routing-profile.js +1 -1
- package/lib/context/app-resolver.d.ts +1 -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.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/hook-directory.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/cross-db-relation.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/flow-config.d.ts +11 -10
- package/lib/core/flow-config.js +1 -1
- package/lib/core/instant-api-policy/config.js +1 -1
- package/lib/core/kb-search-client.d.ts +7 -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.d.ts +5 -2
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/supported-flags.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/generated/official-routing.d.ts +15 -3
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.d.ts +2 -2
- 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 +5 -0
- 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/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/rabetbase/SKILL.md +31 -17
- package/skills/rabetbase/guides/approval-flow-development-workflow.md +33 -11
- package/skills/rabetbase/guides/best-practices.md +1 -1
- package/skills/rabetbase/guides/conflict-detection.md +44 -92
- package/skills/rabetbase/guides/custom-page-flow-sdk.md +642 -0
- package/skills/rabetbase/guides/custom-page-flow-timeline-display.md +289 -0
- package/skills/rabetbase/guides/custom-page-workflow.md +12 -3
- package/skills/rabetbase/guides/sql-creation-workflow.md +44 -26
- package/skills/rabetbase/guides/sql-mybatis.md +18 -49
- package/skills/rabetbase/guides/typescript-sdk.md +18 -0
- package/skills/rabetbase/knowledge/approval-flow/config-json-schema.md +22 -6
- package/skills/rabetbase/knowledge/components.md +34 -28
- package/skills/rabetbase/knowledge/custom-page/generation-standards.md +2 -0
- package/skills/rabetbase/references/rabetbase-config.md +6 -4
- package/skills/rabetbase/references/rabetbase-flow-commands.md +8 -4
- package/skills/rabetbase/references/rabetbase-flow-resources.md +3 -3
- package/skills/rabetbase/references/rabetbase-flow-runtime-boundary.md +2 -0
- package/skills/rabetbase/references/rabetbase-init.md +7 -5
- package/skills/rabetbase/references/rabetbase-kb.md +14 -4
- package/skills/rabetbase/references/rabetbase-page-custom-detail.md +3 -1
- package/skills/rabetbase/references/rabetbase-page-custom-list.md +3 -0
- package/skills/rabetbase/references/rabetbase-sql-push.md +5 -0
- package/skills/rabetbase/references/rabetbase-sql-validate.md +12 -6
- package/skills/rabetbase.manifest.json +5 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a273_0x5b3766=a273_0x14f3;(function(_0x1f781b,_0x2e2088){const _0x3414b9=a273_0x14f3,_0x5e73f0=_0x1f781b();while(!![]){try{const _0x12cd9b=parseInt(_0x3414b9(0x1a8))/0x1*(-parseInt(_0x3414b9(0x1c5))/0x2)+parseInt(_0x3414b9(0x1c3))/0x3+parseInt(_0x3414b9(0x1a6))/0x4+parseInt(_0x3414b9(0x1c0))/0x5+parseInt(_0x3414b9(0x1cb))/0x6*(-parseInt(_0x3414b9(0x1ce))/0x7)+-parseInt(_0x3414b9(0x1b3))/0x8*(parseInt(_0x3414b9(0x1b6))/0x9)+-parseInt(_0x3414b9(0x1ad))/0xa;if(_0x12cd9b===_0x2e2088)break;else _0x5e73f0['push'](_0x5e73f0['shift']());}catch(_0x5404e0){_0x5e73f0['push'](_0x5e73f0['shift']());}}}(a273_0xb17e,0x3f113));import{access,mkdir,readdir,stat}from'node:fs/promises';import{constants}from'node:fs';import{dirname,join,resolve,sep}from'node:path';import{findHookLocationByRemoteId,snakeToCamel}from'../../core/bff/utils.js';export const SUPPORTED_BFF_TYPES=[a273_0x5b3766(0x1ba),a273_0x5b3766(0x1bb),'HOOK'];export function normalizeBffType(_0x2e3ec6){const _0x278210=a273_0x5b3766;if(!_0x2e3ec6)return undefined;const _0x355803=_0x2e3ec6[_0x278210(0x1ae)]()['toUpperCase']();return SUPPORTED_BFF_TYPES[_0x278210(0x1b9)](_0x355803)?_0x355803:undefined;}async function scanJsFilesRecursively(_0x2bbaad,_0x414f95){const _0x5c1977=a273_0x5b3766,_0xc6090e=[];try{const _0x42adb5=await readdir(_0x2bbaad,{'withFileTypes':!![]});for(const _0x3ae7fe of _0x42adb5){const _0x29f46e=join(_0x2bbaad,_0x3ae7fe[_0x5c1977(0x1ca)]);if(_0x3ae7fe[_0x5c1977(0x1b1)]())_0xc6090e[_0x5c1977(0x1b5)](...await scanJsFilesRecursively(_0x29f46e,_0x414f95+'/'+_0x3ae7fe[_0x5c1977(0x1ca)]));else _0x3ae7fe[_0x5c1977(0x1be)]()&&_0x3ae7fe[_0x5c1977(0x1ca)]['endsWith'](_0x5c1977(0x1ac))&&_0xc6090e['push']({'lockKey':_0x414f95+'/'+_0x3ae7fe[_0x5c1977(0x1ca)][_0x5c1977(0x1aa)](/\.js$/,''),'filePath':_0x29f46e});}}catch(_0x15c74f){if(_0x15c74f[_0x5c1977(0x1c7)]!==_0x5c1977(0x1af))throw _0x15c74f;}return _0xc6090e;}function a273_0x14f3(_0x372821,_0x33b618){_0x372821=_0x372821-0x1a6;const _0xb17ef6=a273_0xb17e();let _0x14f3ae=_0xb17ef6[_0x372821];return _0x14f3ae;}async function scanFlatFunctions(_0x342986,_0x4f75e1){const _0x5af757=a273_0x5b3766,_0x1e5b4f=join(_0x342986[_0x5af757(0x1b4)],_0x4f75e1),_0x5af8e2=await scanJsFilesRecursively(_0x1e5b4f,_0x4f75e1);return _0x5af8e2[_0x5af757(0x1cc)](({lockKey:_0x18c960,filePath:_0x517604})=>({'type':_0x4f75e1,'name':_0x18c960[_0x5af757(0x1b0)]('/')['at'](-0x1)??'','filePath':_0x517604,'lockKey':_0x18c960}));}async function scanHookFunctions(_0x253723){const _0xd58847=a273_0x5b3766,_0x41fe1f=join(_0x253723[_0xd58847(0x1b4)],_0xd58847(0x1bc)),_0x239ada=[];try{const _0x26149d=await readdir(_0x41fe1f,{'withFileTypes':!![]});for(const _0x3d8768 of _0x26149d){if(!_0x3d8768['isDirectory']())continue;const _0x1288f9=_0x3d8768['name'],_0x5cdba4=join(_0x41fe1f,_0x1288f9),_0x3793d8=await readdir(_0x5cdba4,{'withFileTypes':!![]});for(const _0x2f3c5a of _0x3793d8){if(!_0x2f3c5a[_0xd58847(0x1b1)]())continue;const _0x3dd374=_0x2f3c5a[_0xd58847(0x1ca)],_0x14f58a=join(_0x5cdba4,_0x3dd374),_0x23f068=await readdir(_0x14f58a,{'withFileTypes':!![]});for(const _0x5a5fc4 of _0x23f068){if(!_0x5a5fc4[_0xd58847(0x1b1)]())continue;const _0x6a69a0=_0x5a5fc4[_0xd58847(0x1ca)],_0x47628a=join(_0x14f58a,_0x6a69a0),_0x22a486=await readdir(_0x47628a,{'withFileTypes':!![]});for(const _0x2b4092 of _0x22a486){if(!_0x2b4092[_0xd58847(0x1be)]()||!_0x2b4092[_0xd58847(0x1ca)][_0xd58847(0x1c1)](_0xd58847(0x1ac)))continue;const _0x3555cc=_0x2b4092['name'][_0xd58847(0x1aa)](/\.js$/,'');_0x239ada[_0xd58847(0x1b5)]({'type':_0xd58847(0x1bc),'name':_0x3555cc,'filePath':join(_0x47628a,_0x2b4092['name']),'lockKey':_0xd58847(0x1c2)+_0x1288f9+'/'+_0x3dd374+'/'+_0x6a69a0+'/'+_0x3555cc,'alias':_0x1288f9,'operationType':_0x3dd374,'functionNode':_0x6a69a0});}}}}}catch(_0x2ba3bb){if(_0x2ba3bb[_0xd58847(0x1c7)]!=='ENOENT')throw _0x2ba3bb;}return _0x239ada;}export async function scanLocalBffFunctions(_0x579362,_0x3cd836){const _0x534753=a273_0x5b3766;if(_0x3cd836===_0x534753(0x1ba)||_0x3cd836===_0x534753(0x1bb))return scanFlatFunctions(_0x579362,_0x3cd836);if(_0x3cd836===_0x534753(0x1bc))return scanHookFunctions(_0x579362);const [_0x28221b,_0xf5f71b,_0x5d4cf9]=await Promise['all']([scanFlatFunctions(_0x579362,_0x534753(0x1ba)),scanFlatFunctions(_0x579362,'ENDPOINT'),scanHookFunctions(_0x579362)]);return[..._0x28221b,..._0xf5f71b,..._0x5d4cf9];}const SAFE_LOCK_KEY_SEGMENT=/^[A-Za-z0-9_$.-]+$/;export function isSafeLockKeySegment(_0x36e2c1){const _0xfadae4=a273_0x5b3766;return SAFE_LOCK_KEY_SEGMENT[_0xfadae4(0x1cf)](_0x36e2c1)&&_0x36e2c1!=='.'&&_0x36e2c1!=='..';}function a273_0xb17e(){const _0x410e69=['ENOENT','split','isDirectory','operationType','776uzzACB','scriptsRootDir','push','21816LHgLiJ','F_OK','set','includes','COMMON','ENDPOINT','HOOK','functionNode','isFile','datasetCode','475825GjdzZw','endsWith','HOOK/','1075812Lsqtsf','Resolved\x20Backend\x20Function\x20script\x20path\x20escapes\x20scripts\x20root:\x20','2LILgDH','get','code','startsWith','Unsafe\x20Backend\x20Function\x20lock\x20key\x20(traversal\x20or\x20invalid\x20segment):\x20','name','731454RQfxRx','map','every','7pJWuIr','test','1548052yTgOuO','afterScriptId','142079vzyJtb','functionName','replace','beforeScriptId','.js','833430nQTExt','trim'];a273_0xb17e=function(){return _0x410e69;};return a273_0xb17e();}export function resolveLocalFilePathFromLockKey(_0x199e27,_0x268b96){const _0x31c772=a273_0x5b3766,_0x34c0a8=_0x268b96['split']('/');if(!_0x34c0a8[_0x31c772(0x1cd)](isSafeLockKeySegment))throw new Error(_0x31c772(0x1c9)+_0x268b96);const _0x5f2665=resolve(join(_0x199e27['scriptsRootDir'],..._0x34c0a8)+_0x31c772(0x1ac)),_0x473ee7=resolve(_0x199e27[_0x31c772(0x1b4)]);if(_0x5f2665!==_0x473ee7&&!_0x5f2665[_0x31c772(0x1c8)](_0x473ee7+sep))throw new Error(_0x31c772(0x1c4)+_0x5f2665);return _0x5f2665;}export function createHookLocationMap(_0x3de2c3){const _0xe25e66=a273_0x5b3766,_0x2f0646=new Map();for(const _0x229817 of _0x3de2c3){_0x229817[_0xe25e66(0x1ab)]&&_0x2f0646['set'](_0x229817['beforeScriptId'],{'datasetCode':_0x229817[_0xe25e66(0x1bf)],'operationType':snakeToCamel(_0x229817['operationType']),'functionNode':'before'}),_0x229817[_0xe25e66(0x1a7)]&&_0x2f0646[_0xe25e66(0x1b8)](_0x229817[_0xe25e66(0x1a7)],{'datasetCode':_0x229817[_0xe25e66(0x1bf)],'operationType':snakeToCamel(_0x229817['operationType']),'functionNode':'after'});}return _0x2f0646;}export function resolveRemoteScriptTarget(_0x552e55,_0x5db57f,_0x57ea42,_0x2c7035,_0x4b5fc0){const _0x225e53=a273_0x5b3766,_0x3eafdd=normalizeBffType(_0x5db57f['scriptType']);if(!_0x3eafdd||!_0x5db57f[_0x225e53(0x1a9)])return null;if(_0x3eafdd===_0x225e53(0x1bc)){const _0x4b79d8=_0x5db57f['id']?_0x57ea42[_0x225e53(0x1c6)](_0x5db57f['id']):undefined,_0x2af0e7=findHookLocationByRemoteId(_0x2c7035,_0x5db57f['id']),_0x4e26aa=_0x4b79d8?{..._0x2af0e7?.['datasetCode']===_0x4b79d8[_0x225e53(0x1bf)]?_0x2af0e7:{},..._0x4b79d8}:_0x2af0e7;if(!_0x4e26aa)return null;const _0x10f774=_0x4b5fc0[_0x225e53(0x1c6)](_0x4e26aa[_0x225e53(0x1bf)]['toLowerCase']()),_0x4039fe=_0x10f774??_0x4e26aa[_0x225e53(0x1bf)],_0x1562a1={..._0x4e26aa,'alias':_0x10f774},_0x3c3bd9=_0x225e53(0x1c2)+_0x4039fe+'/'+_0x1562a1[_0x225e53(0x1b2)]+'/'+_0x1562a1[_0x225e53(0x1bd)]+'/'+_0x5db57f['functionName'];if(!_0x3c3bd9[_0x225e53(0x1b0)]('/')[_0x225e53(0x1cd)](isSafeLockKeySegment))return null;return{'lockKey':_0x3c3bd9,'filePath':resolveLocalFilePathFromLockKey(_0x552e55,_0x3c3bd9),'type':_0x225e53(0x1bc),'hookLocation':_0x1562a1};}const _0xef46e6=_0x3eafdd+'/'+_0x5db57f['functionName'];if(!_0xef46e6[_0x225e53(0x1b0)]('/')['every'](isSafeLockKeySegment))return null;return{'lockKey':_0xef46e6,'filePath':resolveLocalFilePathFromLockKey(_0x552e55,_0xef46e6),'type':_0x3eafdd};}export async function ensureParentDirectory(_0x473e3c){await mkdir(dirname(_0x473e3c),{'recursive':!![]});}export async function fileExists(_0x9113aa){const _0x2573c2=a273_0x5b3766;try{return await access(_0x9113aa,constants[_0x2573c2(0x1b7)]),!![];}catch{return![];}}export async function directoryExists(_0xa107f8){const _0x2f4261=a273_0x5b3766;try{const _0x21a569=await stat(_0xa107f8);return _0x21a569[_0x2f4261(0x1b1)]();}catch{return![];}}
|
package/lib/core/bff/hash.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2f1ef7,_0x6f8ae2){const _0x2e6c3f=a274_0x1a8a,_0x41b0a0=_0x2f1ef7();while(!![]){try{const _0xcdd0ab=parseInt(_0x2e6c3f(0x166))/0x1*(-parseInt(_0x2e6c3f(0x170))/0x2)+parseInt(_0x2e6c3f(0x168))/0x3*(parseInt(_0x2e6c3f(0x176))/0x4)+parseInt(_0x2e6c3f(0x167))/0x5+parseInt(_0x2e6c3f(0x164))/0x6*(-parseInt(_0x2e6c3f(0x171))/0x7)+-parseInt(_0x2e6c3f(0x165))/0x8*(-parseInt(_0x2e6c3f(0x173))/0x9)+parseInt(_0x2e6c3f(0x174))/0xa*(parseInt(_0x2e6c3f(0x16e))/0xb)+parseInt(_0x2e6c3f(0x16d))/0xc*(-parseInt(_0x2e6c3f(0x172))/0xd);if(_0xcdd0ab===_0x6f8ae2)break;else _0x41b0a0['push'](_0x41b0a0['shift']());}catch(_0x2a8454){_0x41b0a0['push'](_0x41b0a0['shift']());}}}(a274_0x439e,0x9b26a));import{readFile}from'node:fs/promises';import a274_0xe491dc from'node:crypto';function a274_0x1a8a(_0x58aa07,_0x12c6a6){_0x58aa07=_0x58aa07-0x164;const _0x439eb4=a274_0x439e();let _0x1a8a91=_0x439eb4[_0x58aa07];return _0x1a8a91;}export function computeContentHash(_0x2ee680){const _0x41822e=a274_0x1a8a;return a274_0xe491dc[_0x41822e(0x169)](_0x41822e(0x16b))[_0x41822e(0x16c)](_0x2ee680)[_0x41822e(0x16f)](_0x41822e(0x175));}export async function computeFileHash(_0x4f24ca){const _0x3c3d8d=a274_0x1a8a,_0x2410a5=await readFile(_0x4f24ca,_0x3c3d8d(0x16a));return computeContentHash(_0x2410a5);}function a274_0x439e(){const _0x53d0d8=['2334387TvWGfr','createHash','utf8','md5','update','27247272tOwuog','348293gUbXCO','digest','2WMiZMX','33817lxjFgv','13LXjmwh','9DMPcnw','330yhDIhD','hex','4FWrmwQ','186IOTIDT','9462424ouDOdp','1182914EwAexN','6164840MnaISI'];a274_0x439e=function(){return _0x53d0d8;};return a274_0x439e();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x20e84b,_0x2ffb10){const _0x490a00=a275_0xa277,_0x1a624e=_0x20e84b();while(!![]){try{const _0x15c504=parseInt(_0x490a00(0xb5))/0x1*(parseInt(_0x490a00(0xa2))/0x2)+-parseInt(_0x490a00(0xac))/0x3*(-parseInt(_0x490a00(0xb0))/0x4)+-parseInt(_0x490a00(0xcf))/0x5*(parseInt(_0x490a00(0xc6))/0x6)+-parseInt(_0x490a00(0xb9))/0x7*(-parseInt(_0x490a00(0xab))/0x8)+parseInt(_0x490a00(0xbf))/0x9*(-parseInt(_0x490a00(0xae))/0xa)+-parseInt(_0x490a00(0xc5))/0xb*(parseInt(_0x490a00(0xca))/0xc)+parseInt(_0x490a00(0xce))/0xd;if(_0x15c504===_0x2ffb10)break;else _0x1a624e['push'](_0x1a624e['shift']());}catch(_0x54034e){_0x1a624e['push'](_0x1a624e['shift']());}}}(a275_0x4121,0x56eee));import{CliError}from'../../errors.js';export function trackedHookDirectoryMappings(_0x5b65b3){const _0x5922c3=a275_0xa277,_0x3f8cc8=[];for(const [_0x514f73,_0x4d51d6]of Object[_0x5922c3(0xb3)](_0x5b65b3[_0x5922c3(0xbb)])){const [_0x138b2d,_0x6e02e6]=_0x514f73[_0x5922c3(0xaf)]('/');if(_0x138b2d!==_0x5922c3(0xba)||!_0x6e02e6||!_0x4d51d6[_0x5922c3(0xa5)])continue;_0x3f8cc8['push']({'alias':_0x6e02e6,'datasetCode':_0x4d51d6[_0x5922c3(0xa5)]});}return _0x3f8cc8;}export function uniqueTrackedHookDirectoryByDataset(_0x5de6ab){const _0x122fce=a275_0xa277,_0x1e8cc1=new Map();for(const _0x612c4b of trackedHookDirectoryMappings(_0x5de6ab)){const _0x4ea95f=directoryIdentity(_0x612c4b[_0x122fce(0xa5)]),_0x30927e=_0x1e8cc1[_0x122fce(0xc4)](_0x4ea95f)??new Map();_0x30927e['set'](directoryIdentity(_0x612c4b[_0x122fce(0xa0)]),_0x612c4b['alias']),_0x1e8cc1['set'](_0x4ea95f,_0x30927e);}const _0x12e58a=new Map();for(const [_0x26840b,_0x5e5ad0]of _0x1e8cc1){if(_0x5e5ad0['size']>0x1)throw hookDirectoryError(_0x122fce(0xd2),_0x122fce(0xc8)+_0x26840b+_0x122fce(0x9f)+[..._0x5e5ad0[_0x122fce(0xd0)]()][_0x122fce(0xb6)](',\x20')+'.',{'datasetCode':_0x26840b,'directories':[..._0x5e5ad0[_0x122fce(0xd0)]()]});_0x12e58a['set'](_0x26840b,[..._0x5e5ad0[_0x122fce(0xd0)]()][0x0]);}return _0x12e58a;}export function assertUnambiguousHookDirectoryMappings(_0x127a8e){const _0x781d15=a275_0xa277,_0x17990c=new Map();for(const {alias:_0x4d9cde,datasetCode:_0x515eaa}of _0x127a8e){const _0x23d639=directoryIdentity(_0x4d9cde),_0x336f5c=_0x17990c[_0x781d15(0xc4)](_0x23d639)??new Set();_0x336f5c[_0x781d15(0xad)](_0x515eaa),_0x17990c['set'](_0x23d639,_0x336f5c);}for(const [_0x13599c,_0x19470b]of _0x17990c){if(_0x19470b[_0x781d15(0xb4)]>0x1)throw hookDirectoryError(_0x781d15(0xcb),_0x781d15(0xc3)+_0x13599c+_0x781d15(0xc2),{'directoryName':_0x13599c,'datasetCodes':[..._0x19470b]});}}function a275_0x4121(){const _0x2f9a8e=['1095565JfQqay','values','datasetCodeToDatasets','HOOK_DUPLICATE_DIRECTORIES','name','aliasToDatasetCodes','set','\x22\x20has\x20multiple\x20tracked\x20HOOK\x20directories:\x20','alias','HOOK_MAPPING_DRIFT','79216dmQLKU','Incomplete\x20HOOK\x20path:\x20','Dataset\x20code\x20\x22','datasetCode','\x22\x20differs\x20only\x20by\x20case\x20from\x20another\x20Dataset\x20code.','map','lockKey','\x22\x20collides\x20across\x20datasetCode\x20and\x20alias\x20namespaces.','HOOK_DATASET_NOT_FOUND','283448VntstF','5601WtLuUY','add','221230lKtnht','split','1228wBpyKa','HOOK_ALIAS_AMBIGUOUS','push','entries','size','14jArncV','join','includes','\x22\x20to\x20a\x20Dataset\x20alias\x20or\x20datasetCode.','7WXFumB','HOOK','functions','type','\x22\x20points\x20to\x20a\x20Dataset\x20that\x20is\x20absent\x20from\x20current\x20platform\x20metadata.','\x22\x20changed\x20mapping\x20from\x20Dataset\x20\x22','189grGRGC','details','\x22\x20is\x20represented\x20by\x20multiple\x20HOOK\x20directories:\x20','\x22\x20resolves\x20to\x20multiple\x20Datasets.','HOOK\x20directory\x20\x22','get','9064UVvLhk','12DCMSyp','HOOK_DIRECTORY_UNRESOLVED','Dataset\x20\x22','HOOK_DATASET_CODE_AMBIGUOUS','8700LVOkBv','HOOK_DIRECTORY_AMBIGUOUS','code','message','9011275SnkVXP'];a275_0x4121=function(){return _0x2f9a8e;};return a275_0x4121();}export function assertUnambiguousHookAliases(_0x41e311){const _0x5cccc0=a275_0xa277,_0xa7e9d=[..._0x41e311],_0x3f5d23=new Map(),_0x25a4c9=new Map();for(const {alias:_0x1fe29d,datasetCode:_0x1b8854}of _0xa7e9d){const _0x3d786f=directoryIdentity(_0x1fe29d),_0x3b3f4c=directoryIdentity(_0x1b8854),_0x4dc67d=_0x3f5d23[_0x5cccc0(0xc4)](_0x3d786f)??new Set();_0x4dc67d[_0x5cccc0(0xad)](_0x1b8854),_0x3f5d23[_0x5cccc0(0x9e)](_0x3d786f,_0x4dc67d);const _0x684691=_0x25a4c9[_0x5cccc0(0xc4)](_0x3b3f4c)??new Set();_0x684691['add'](_0x1fe29d),_0x25a4c9[_0x5cccc0(0x9e)](_0x3b3f4c,_0x684691);}for(const [_0x149aa2,_0x5a0193]of _0x3f5d23){if(_0x5a0193['size']>0x1)throw hookDirectoryError(_0x5cccc0(0xb1),'SDK\x20alias\x20\x22'+_0x149aa2+'\x22\x20resolves\x20to\x20multiple\x20Datasets.',{'alias':_0x149aa2,'datasetCodes':[..._0x5a0193]});}for(const [_0x4ccba2,_0x407b14]of _0x25a4c9){if(_0x407b14[_0x5cccc0(0xb4)]>0x1)throw hookDirectoryError(_0x5cccc0(0xb1),_0x5cccc0(0xc8)+_0x4ccba2+'\x22\x20has\x20multiple\x20SDK\x20aliases\x20and\x20has\x20no\x20unique\x20HOOK\x20directory.',{'datasetCode':_0x4ccba2,'aliases':[..._0x407b14]});}}export function buildHookDirectoryIndexes(_0x3e5a4b,_0x4a20f7=[]){const _0x3029d8=a275_0xa277,_0x4c939e=[..._0x4a20f7];assertUnambiguousHookDirectoryMappings(_0x4c939e[_0x3029d8(0xa7)](([_0x52697b,_0x3ba682])=>({'alias':_0x52697b,'datasetCode':_0x3ba682})));const _0x1ba200=new Map(),_0x53741c=new Map();for(const _0x5c560f of _0x3e5a4b){appendUnique(_0x1ba200,directoryIdentity(_0x5c560f[_0x3029d8(0xcc)]),_0x5c560f,_0x35f2fb=>_0x35f2fb[_0x3029d8(0xcc)]);}for(const [_0x262548,_0x5da4d4]of _0x4c939e){appendUnique(_0x53741c,directoryIdentity(_0x262548),_0x5da4d4,_0x3aeeb8=>_0x3aeeb8);}return{'datasetCodeToDatasets':_0x1ba200,'aliasToDatasetCodes':_0x53741c};}export function resolvePushHookDirectory(_0x369090,_0x4e3a06,_0x2a9348){const _0x3265a9=a275_0xa277,_0x5ba0ef=directoryIdentity(_0x369090),_0x4c797e=_0x2a9348[_0x3265a9(0xd1)][_0x3265a9(0xc4)](_0x5ba0ef)??[],_0x54d118=_0x2a9348[_0x3265a9(0xd4)][_0x3265a9(0xc4)](_0x5ba0ef)??[],_0x481a4b=new Set([..._0x4c797e[_0x3265a9(0xa7)](_0x15e722=>_0x15e722[_0x3265a9(0xcc)]),..._0x54d118]);if(_0x481a4b['size']>0x1)throw hookDirectoryError('HOOK_DIRECTORY_AMBIGUOUS',_0x3265a9(0xc3)+_0x369090+_0x3265a9(0xa9),{'directoryName':_0x369090,'datasetCodes':[..._0x481a4b]});const _0x329072=[..._0x481a4b][0x0];if(_0x329072&&_0x4e3a06?.['datasetCode']&&_0x329072!==_0x4e3a06[_0x3265a9(0xa5)])throw hookDirectoryError(_0x3265a9(0xa1),_0x3265a9(0xc3)+_0x369090+_0x3265a9(0xbe)+_0x4e3a06[_0x3265a9(0xa5)]+'\x22\x20to\x20\x22'+_0x329072+'\x22.',{'directoryName':_0x369090,'datasetCode':_0x329072,'lockedDatasetCode':_0x4e3a06[_0x3265a9(0xa5)]});const _0x1b5f93=_0x329072?findDatasetByCode(_0x2a9348,_0x329072):undefined,_0x5d0446=!!_0x329072&&_0x54d118[_0x3265a9(0xb7)](_0x329072);if(_0x1b5f93)return{'dataset':_0x1b5f93,'datasetCode':_0x1b5f93[_0x3265a9(0xcc)],..._0x5d0446?{'alias':_0x369090}:{},'directoryProtocol':_0x5d0446?'alias':_0x3265a9(0xa5),'warnings':[]};const _0xb84a8a=_0x4e3a06?.[_0x3265a9(0xa5)];if(_0xb84a8a){const _0x33f794=findDatasetByCode(_0x2a9348,_0xb84a8a);if(_0x33f794)return{'dataset':_0x33f794,'datasetCode':_0x33f794['code'],..._0x4e3a06[_0x3265a9(0xa0)]?{'alias':_0x4e3a06['alias']}:{},'directoryProtocol':_0x4e3a06[_0x3265a9(0xa0)]?_0x3265a9(0xa0):_0x3265a9(0xa5),'warnings':[]};}if(_0x329072||_0xb84a8a){const _0x3eab8a=_0x329072??_0xb84a8a;throw hookDirectoryError(_0x3265a9(0xaa),_0x3265a9(0xc3)+_0x369090+_0x3265a9(0xbd),{'directoryName':_0x369090,'datasetCode':_0x3eab8a});}throw hookDirectoryError(_0x3265a9(0xc7),'Cannot\x20resolve\x20HOOK\x20directory\x20\x22'+_0x369090+_0x3265a9(0xb8),{'directoryName':_0x369090});}function a275_0xa277(_0x2cb5e3,_0x5ee121){_0x2cb5e3=_0x2cb5e3-0x9e;const _0x412112=a275_0x4121();let _0xa277de=_0x412112[_0x2cb5e3];return _0xa277de;}export function preflightPushHookDirectories(_0x49d64b,_0x5b848f,_0x49f75c,_0x541be2){const _0x50f1e6=a275_0xa277,_0x21fb5e=new Map(),_0x592102=new Map();for(const _0x5f432c of _0x49d64b){if(_0x5f432c[_0x50f1e6(0xbc)]!=='HOOK')continue;const _0xe64a62=_0x5f432c['alias'];if(!_0xe64a62)throw hookDirectoryError(_0x50f1e6(0xc7),_0x50f1e6(0xa3)+_0x5f432c['lockKey'],{'lockKey':_0x5f432c['lockKey']});let _0x12473c;try{_0x12473c=resolvePushHookDirectory(_0xe64a62,_0x5b848f[_0x50f1e6(0xbb)][_0x5f432c[_0x50f1e6(0xa8)]],_0x49f75c);}catch(_0x15521e){if(_0x541be2&&_0x15521e instanceof CliError&&['HOOK_DATASET_NOT_FOUND',_0x50f1e6(0xc7)][_0x50f1e6(0xb7)](_0x15521e[_0x50f1e6(0xcc)])){_0x541be2[_0x50f1e6(0x9e)](_0x5f432c[_0x50f1e6(0xa8)],_0x15521e[_0x50f1e6(0xcd)]);continue;}throw _0x15521e;}_0x21fb5e[_0x50f1e6(0x9e)](_0x5f432c['lockKey'],_0x12473c);const _0xe891c3=_0x592102[_0x50f1e6(0xc4)](_0x12473c[_0x50f1e6(0xa5)])??new Set();_0xe891c3[_0x50f1e6(0xad)](_0xe64a62),_0x592102[_0x50f1e6(0x9e)](_0x12473c[_0x50f1e6(0xa5)],_0xe891c3);}for(const [_0x5e411f,_0x4126c7]of _0x592102){if(_0x4126c7[_0x50f1e6(0xb4)]>0x1)throw hookDirectoryError(_0x50f1e6(0xd2),_0x50f1e6(0xc8)+_0x5e411f+_0x50f1e6(0xc1)+[..._0x4126c7][_0x50f1e6(0xb6)](',\x20')+'.',{'datasetCode':_0x5e411f,'directories':[..._0x4126c7]});}return _0x21fb5e;}export function hookDirectoryError(_0x204de3,_0x98d2d1,_0x577e93){const _0x448805=a275_0xa277,_0x200e1e=new CliError(_0x204de3,0x2,_0x204de3+':\x20'+_0x98d2d1);return _0x200e1e[_0x448805(0xc0)]=_0x577e93,_0x200e1e;}function findDatasetByCode(_0x55c015,_0x8352a7){const _0x4c07c7=a275_0xa277,_0x2a893d=_0x55c015[_0x4c07c7(0xd1)][_0x4c07c7(0xc4)](directoryIdentity(_0x8352a7))??[];if(_0x2a893d['length']>0x1)throw hookDirectoryError(_0x4c07c7(0xc9),_0x4c07c7(0xa4)+_0x8352a7+_0x4c07c7(0xa6),{'datasetCode':_0x8352a7,'candidates':_0x2a893d[_0x4c07c7(0xa7)](datasetFact)});return _0x2a893d[0x0];}function directoryIdentity(_0x265e14){return _0x265e14['normalize']('NFC')['toLowerCase']();}function appendUnique(_0xe706a6,_0x4e169c,_0x22faae,_0x58ab94){const _0x5e36a4=a275_0xa277,_0x170156=_0xe706a6[_0x5e36a4(0xc4)](_0x4e169c)??[];!_0x170156['some'](_0x2f8891=>_0x58ab94(_0x2f8891)===_0x58ab94(_0x22faae))&&_0x170156[_0x5e36a4(0xb2)](_0x22faae),_0xe706a6[_0x5e36a4(0x9e)](_0x4e169c,_0x170156);}function datasetFact(_0x28e523){const _0xe57314=a275_0xa277;return{'id':_0x28e523['id'],'name':_0x28e523[_0xe57314(0xd3)],'datasetCode':_0x28e523[_0xe57314(0xcc)]};}
|
|
1
|
+
(function(_0x14c73f,_0x20281e){const _0x3a4dd1=a275_0x241c,_0x502f18=_0x14c73f();while(!![]){try{const _0x3e2d60=parseInt(_0x3a4dd1(0x152))/0x1*(-parseInt(_0x3a4dd1(0x164))/0x2)+parseInt(_0x3a4dd1(0x156))/0x3*(-parseInt(_0x3a4dd1(0x17a))/0x4)+parseInt(_0x3a4dd1(0x16e))/0x5*(-parseInt(_0x3a4dd1(0x168))/0x6)+-parseInt(_0x3a4dd1(0x16f))/0x7+-parseInt(_0x3a4dd1(0x170))/0x8*(parseInt(_0x3a4dd1(0x185))/0x9)+parseInt(_0x3a4dd1(0x14d))/0xa+parseInt(_0x3a4dd1(0x187))/0xb;if(_0x3e2d60===_0x20281e)break;else _0x502f18['push'](_0x502f18['shift']());}catch(_0x5272ef){_0x502f18['push'](_0x502f18['shift']());}}}(a275_0x5e1b,0x21755));import{CliError}from'../../errors.js';export function trackedHookDirectoryMappings(_0x48896b){const _0x121fe6=a275_0x241c,_0x461c7c=[];for(const [_0x23608e,_0x320888]of Object[_0x121fe6(0x171)](_0x48896b[_0x121fe6(0x14f)])){const [_0x2a48a4,_0x4249e7]=_0x23608e[_0x121fe6(0x15b)]('/');if(_0x2a48a4!==_0x121fe6(0x15c)||!_0x4249e7||!_0x320888[_0x121fe6(0x16c)])continue;_0x461c7c['push']({'alias':_0x4249e7,'datasetCode':_0x320888[_0x121fe6(0x16c)]});}return _0x461c7c;}export function uniqueTrackedHookDirectoryByDataset(_0x2b27d2){const _0x2cc591=a275_0x241c,_0x3a2ad5=new Map();for(const _0x18ab0d of trackedHookDirectoryMappings(_0x2b27d2)){const _0x3cda11=directoryIdentity(_0x18ab0d['datasetCode']),_0x5330b3=_0x3a2ad5[_0x2cc591(0x16b)](_0x3cda11)??new Map();_0x5330b3['set'](directoryIdentity(_0x18ab0d['alias']),_0x18ab0d[_0x2cc591(0x17b)]),_0x3a2ad5['set'](_0x3cda11,_0x5330b3);}const _0x37757b=new Map();for(const [_0x1a187d,_0x2f8bee]of _0x3a2ad5){if(_0x2f8bee['size']>0x1)throw hookDirectoryError(_0x2cc591(0x159),_0x2cc591(0x184)+_0x1a187d+_0x2cc591(0x17f)+[..._0x2f8bee['values']()]['join'](',\x20')+'.',{'datasetCode':_0x1a187d,'directories':[..._0x2f8bee[_0x2cc591(0x151)]()]});_0x37757b[_0x2cc591(0x17e)](_0x1a187d,[..._0x2f8bee['values']()][0x0]);}return _0x37757b;}export function assertUnambiguousHookDirectoryMappings(_0x1e7147){const _0x5c0cfd=a275_0x241c,_0x1213a5=new Map();for(const {alias:_0x1bdfca,datasetCode:_0x37f1a1}of _0x1e7147){const _0x15726d=directoryIdentity(_0x1bdfca),_0x55be00=_0x1213a5[_0x5c0cfd(0x16b)](_0x15726d)??new Set();_0x55be00[_0x5c0cfd(0x155)](_0x37f1a1),_0x1213a5[_0x5c0cfd(0x17e)](_0x15726d,_0x55be00);}for(const [_0x51f413,_0x1bca78]of _0x1213a5){if(_0x1bca78[_0x5c0cfd(0x150)]>0x1)throw hookDirectoryError('HOOK_DIRECTORY_AMBIGUOUS',_0x5c0cfd(0x175)+_0x51f413+'\x22\x20resolves\x20to\x20multiple\x20Datasets.',{'directoryName':_0x51f413,'datasetCodes':[..._0x1bca78]});}}export function assertUnambiguousHookAliases(_0x4f592c){const _0x5e2240=a275_0x241c,_0x44ee80=[..._0x4f592c],_0x2fb12c=new Map(),_0x5853d7=new Map();for(const {alias:_0xebe7d3,datasetCode:_0x4a24d2}of _0x44ee80){const _0xd0573=directoryIdentity(_0xebe7d3),_0x38f639=directoryIdentity(_0x4a24d2),_0x18fc9d=_0x2fb12c[_0x5e2240(0x16b)](_0xd0573)??new Set();_0x18fc9d['add'](_0x4a24d2),_0x2fb12c[_0x5e2240(0x17e)](_0xd0573,_0x18fc9d);const _0x3e20aa=_0x5853d7[_0x5e2240(0x16b)](_0x38f639)??new Set();_0x3e20aa['add'](_0xebe7d3),_0x5853d7['set'](_0x38f639,_0x3e20aa);}for(const [_0xdd7c61,_0x5e6160]of _0x2fb12c){if(_0x5e6160[_0x5e2240(0x150)]>0x1)throw hookDirectoryError('HOOK_ALIAS_AMBIGUOUS',_0x5e2240(0x15a)+_0xdd7c61+_0x5e2240(0x16d),{'alias':_0xdd7c61,'datasetCodes':[..._0x5e6160]});}for(const [_0x152304,_0xaf481c]of _0x5853d7){if(_0xaf481c[_0x5e2240(0x150)]>0x1)throw hookDirectoryError(_0x5e2240(0x182),_0x5e2240(0x184)+_0x152304+'\x22\x20has\x20multiple\x20SDK\x20aliases\x20and\x20has\x20no\x20unique\x20HOOK\x20directory.',{'datasetCode':_0x152304,'aliases':[..._0xaf481c]});}}export function buildHookDirectoryIndexes(_0x1e95d0,_0x233d81=[]){const _0x3cbdfe=a275_0x241c,_0x4a79f8=[..._0x233d81];assertUnambiguousHookDirectoryMappings(_0x4a79f8[_0x3cbdfe(0x181)](([_0x1d6f0a,_0x1a83aa])=>({'alias':_0x1d6f0a,'datasetCode':_0x1a83aa})));const _0x44c464=new Map(),_0x36ad71=new Map();for(const _0x55aa9c of _0x1e95d0){appendUnique(_0x44c464,directoryIdentity(_0x55aa9c[_0x3cbdfe(0x17c)]),_0x55aa9c,_0xf3b962=>_0xf3b962[_0x3cbdfe(0x17c)]);}for(const [_0x24028b,_0x34df3c]of _0x4a79f8){appendUnique(_0x36ad71,directoryIdentity(_0x24028b),_0x34df3c,_0x3105d4=>_0x3105d4);}return{'datasetCodeToDatasets':_0x44c464,'aliasToDatasetCodes':_0x36ad71};}function a275_0x241c(_0x5e984b,_0x239487){_0x5e984b=_0x5e984b-0x14d;const _0x5e1b83=a275_0x5e1b();let _0x241c10=_0x5e1b83[_0x5e984b];return _0x241c10;}export function resolvePushHookDirectory(_0xbabc3e,_0x21e688,_0x3b6846){const _0x487e66=a275_0x241c,_0x253d03=directoryIdentity(_0xbabc3e),_0x59053e=_0x3b6846[_0x487e66(0x163)][_0x487e66(0x16b)](_0x253d03)??[],_0x29c46f=_0x3b6846[_0x487e66(0x172)][_0x487e66(0x16b)](_0x253d03)??[],_0x24e58b=new Set([..._0x59053e[_0x487e66(0x181)](_0x3ae0a6=>_0x3ae0a6[_0x487e66(0x17c)]),..._0x29c46f]);if(_0x24e58b['size']>0x1)throw hookDirectoryError(_0x487e66(0x176),'HOOK\x20directory\x20\x22'+_0xbabc3e+_0x487e66(0x169),{'directoryName':_0xbabc3e,'datasetCodes':[..._0x24e58b]});const _0x16d251=[..._0x24e58b][0x0];if(_0x16d251&&_0x21e688?.[_0x487e66(0x16c)]&&_0x16d251!==_0x21e688['datasetCode'])throw hookDirectoryError(_0x487e66(0x188),_0x487e66(0x175)+_0xbabc3e+'\x22\x20changed\x20mapping\x20from\x20Dataset\x20\x22'+_0x21e688[_0x487e66(0x16c)]+_0x487e66(0x16a)+_0x16d251+'\x22.',{'directoryName':_0xbabc3e,'datasetCode':_0x16d251,'lockedDatasetCode':_0x21e688[_0x487e66(0x16c)]});const _0x24cb5c=_0x16d251?findDatasetByCode(_0x3b6846,_0x16d251):undefined,_0x4bff43=!!_0x16d251&&_0x29c46f[_0x487e66(0x158)](_0x16d251);if(_0x24cb5c)return{'dataset':_0x24cb5c,'datasetCode':_0x24cb5c['code'],..._0x4bff43?{'alias':_0xbabc3e}:{},'directoryProtocol':_0x4bff43?'alias':_0x487e66(0x16c),'warnings':[]};const _0x223298=_0x21e688?.[_0x487e66(0x16c)];if(_0x223298){const _0x39e609=findDatasetByCode(_0x3b6846,_0x223298);if(_0x39e609)return{'dataset':_0x39e609,'datasetCode':_0x39e609[_0x487e66(0x17c)],..._0x21e688[_0x487e66(0x17b)]?{'alias':_0x21e688['alias']}:{},'directoryProtocol':_0x21e688['alias']?_0x487e66(0x17b):_0x487e66(0x16c),'warnings':[]};}if(_0x16d251||_0x223298){const _0x584b0f=_0x16d251??_0x223298;throw hookDirectoryError(_0x487e66(0x161),_0x487e66(0x175)+_0xbabc3e+_0x487e66(0x178),{'directoryName':_0xbabc3e,'datasetCode':_0x584b0f});}throw hookDirectoryError(_0x487e66(0x183),_0x487e66(0x166)+_0xbabc3e+_0x487e66(0x186),{'directoryName':_0xbabc3e});}export function preflightPushHookDirectories(_0x233402,_0x17c2a7,_0x2478f6,_0x4186a4){const _0x237510=a275_0x241c,_0x13785a=new Map(),_0x42682a=new Map();for(const _0x16dfa5 of _0x233402){if(_0x16dfa5[_0x237510(0x15e)]!==_0x237510(0x15c))continue;const _0x38b12a=_0x16dfa5[_0x237510(0x17b)];if(!_0x38b12a)throw hookDirectoryError(_0x237510(0x183),_0x237510(0x160)+_0x16dfa5[_0x237510(0x157)],{'lockKey':_0x16dfa5[_0x237510(0x157)]});let _0x186834;try{_0x186834=resolvePushHookDirectory(_0x38b12a,_0x17c2a7[_0x237510(0x14f)][_0x16dfa5[_0x237510(0x157)]],_0x2478f6);}catch(_0x4ddb01){if(_0x4186a4&&_0x4ddb01 instanceof CliError&&[_0x237510(0x161),_0x237510(0x183)][_0x237510(0x158)](_0x4ddb01[_0x237510(0x17c)])){_0x4186a4['set'](_0x16dfa5[_0x237510(0x157)],_0x4ddb01[_0x237510(0x14e)]);continue;}throw _0x4ddb01;}_0x13785a['set'](_0x16dfa5['lockKey'],_0x186834);const _0x3dd10a=_0x42682a[_0x237510(0x16b)](_0x186834[_0x237510(0x16c)])??new Set();_0x3dd10a[_0x237510(0x155)](_0x38b12a),_0x42682a[_0x237510(0x17e)](_0x186834[_0x237510(0x16c)],_0x3dd10a);}for(const [_0x7ac124,_0x45ebc5]of _0x42682a){if(_0x45ebc5[_0x237510(0x150)]>0x1)throw hookDirectoryError(_0x237510(0x159),_0x237510(0x184)+_0x7ac124+_0x237510(0x154)+[..._0x45ebc5][_0x237510(0x177)](',\x20')+'.',{'datasetCode':_0x7ac124,'directories':[..._0x45ebc5]});}return _0x13785a;}function a275_0x5e1b(){const _0x175068=['75weeNAr','427854qgJysZ','305344kiVOhR','entries','aliasToDatasetCodes','push','toLowerCase','HOOK\x20directory\x20\x22','HOOK_DIRECTORY_AMBIGUOUS','join','\x22\x20points\x20to\x20a\x20Dataset\x20that\x20is\x20absent\x20from\x20current\x20platform\x20metadata.','name','44WHZUxD','alias','code','some','set','\x22\x20has\x20multiple\x20tracked\x20HOOK\x20directories:\x20','\x22\x20differs\x20only\x20by\x20case\x20from\x20another\x20Dataset\x20code.','map','HOOK_ALIAS_AMBIGUOUS','HOOK_DIRECTORY_UNRESOLVED','Dataset\x20\x22','18rYSphk','\x22\x20to\x20a\x20Dataset\x20alias\x20or\x20datasetCode.','4124296NyWXHO','HOOK_MAPPING_DRIFT','2716110NqNRWq','message','functions','size','values','27376NnYpLp','NFC','\x22\x20is\x20represented\x20by\x20multiple\x20HOOK\x20directories:\x20','add','23259fkFSDx','lockKey','includes','HOOK_DUPLICATE_DIRECTORIES','SDK\x20alias\x20\x22','split','HOOK','Dataset\x20code\x20\x22','type','details','Incomplete\x20HOOK\x20path:\x20','HOOK_DATASET_NOT_FOUND','HOOK_DATASET_CODE_AMBIGUOUS','datasetCodeToDatasets','12gpptUc','normalize','Cannot\x20resolve\x20HOOK\x20directory\x20\x22','length','49002KeNpQK','\x22\x20collides\x20across\x20datasetCode\x20and\x20alias\x20namespaces.','\x22\x20to\x20\x22','get','datasetCode','\x22\x20resolves\x20to\x20multiple\x20Datasets.'];a275_0x5e1b=function(){return _0x175068;};return a275_0x5e1b();}export function hookDirectoryError(_0x335a3c,_0x3da091,_0x125486){const _0x10515a=a275_0x241c,_0xe41e84=new CliError(_0x335a3c,0x2,_0x335a3c+':\x20'+_0x3da091);return _0xe41e84[_0x10515a(0x15f)]=_0x125486,_0xe41e84;}function findDatasetByCode(_0x2fba41,_0xe8dc60){const _0x256926=a275_0x241c,_0x1987be=_0x2fba41['datasetCodeToDatasets'][_0x256926(0x16b)](directoryIdentity(_0xe8dc60))??[];if(_0x1987be[_0x256926(0x167)]>0x1)throw hookDirectoryError(_0x256926(0x162),_0x256926(0x15d)+_0xe8dc60+_0x256926(0x180),{'datasetCode':_0xe8dc60,'candidates':_0x1987be[_0x256926(0x181)](datasetFact)});return _0x1987be[0x0];}function directoryIdentity(_0x50ff33){const _0x27f577=a275_0x241c;return _0x50ff33[_0x27f577(0x165)](_0x27f577(0x153))[_0x27f577(0x174)]();}function appendUnique(_0x7ebd73,_0x55e3a7,_0x5b3c60,_0x29732c){const _0x5eac03=a275_0x241c,_0x8af5f4=_0x7ebd73[_0x5eac03(0x16b)](_0x55e3a7)??[];!_0x8af5f4[_0x5eac03(0x17d)](_0x19da03=>_0x29732c(_0x19da03)===_0x29732c(_0x5b3c60))&&_0x8af5f4[_0x5eac03(0x173)](_0x5b3c60),_0x7ebd73[_0x5eac03(0x17e)](_0x55e3a7,_0x8af5f4);}function datasetFact(_0x7ee948){const _0x57e86a=a275_0x241c;return{'id':_0x7ee948['id'],'name':_0x7ee948[_0x57e86a(0x179)],'datasetCode':_0x7ee948['code']};}
|
package/lib/core/bff/lock.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x2c7731,_0x57577f){const _0x496d89=a276_0x42ad,_0x454afd=_0x2c7731();while(!![]){try{const _0x18cab1=parseInt(_0x496d89(0x12f))/0x1*(-parseInt(_0x496d89(0x138))/0x2)+parseInt(_0x496d89(0x130))/0x3+parseInt(_0x496d89(0x13c))/0x4+-parseInt(_0x496d89(0x135))/0x5+parseInt(_0x496d89(0x139))/0x6+-parseInt(_0x496d89(0x13d))/0x7*(-parseInt(_0x496d89(0x126))/0x8)+-parseInt(_0x496d89(0x12e))/0x9*(parseInt(_0x496d89(0x13a))/0xa);if(_0x18cab1===_0x57577f)break;else _0x454afd['push'](_0x454afd['shift']());}catch(_0x4aacb1){_0x454afd['push'](_0x454afd['shift']());}}}(a276_0x5d64,0x7e5de));function a276_0x5d64(){const _0x350e1d=['current\x20\x22','utf8','object','2084045AFkXKe','scriptsRoot',':\x20scriptsRoot\x20mismatch\x20—\x20','596bDNaVP','6078414ufhEnE','20914770EsBdxM','code','3435188YiqCXS','321916APsMIp','40QxMdVe','Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','\x22\x20vs\x20lock\x20\x22','ENOENT','lastSync','apps','functions','Failed\x20to\x20read\x20Backend\x20Function\x20lock\x20file:\x20','9kbwBjA','364SJfyRf','3097650NXYAbC','parse'];a276_0x5d64=function(){return _0x350e1d;};return a276_0x5d64();}function a276_0x42ad(_0x1c3f9f,_0x321656){_0x1c3f9f=_0x1c3f9f-0x126;const _0x5d640e=a276_0x5d64();let _0x42ada7=_0x5d640e[_0x1c3f9f];return _0x42ada7;}import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyBffLock(){return{'apps':{}};}export function ensureLockScope(_0x41e7cd,_0x10bd92,_0xa24ec0,_0x4b7d01){const _0x388ac9=a276_0x42ad,_0x5c1e8b={'apps':_0x41e7cd[_0x388ac9(0x12b)]&&typeof _0x41e7cd[_0x388ac9(0x12b)]==='object'?_0x41e7cd[_0x388ac9(0x12b)]:{}};let _0xfcda2f=_0x5c1e8b[_0x388ac9(0x12b)][_0x10bd92];if(!_0xfcda2f)return _0xfcda2f={'scriptsRoot':_0xa24ec0,'lastSync':'','functions':{}},_0x5c1e8b['apps'][_0x10bd92]=_0xfcda2f,{'lockData':_0x5c1e8b,'appLock':_0xfcda2f};if(!_0xfcda2f['scriptsRoot'])_0xfcda2f['scriptsRoot']=_0xa24ec0;else{if(_0xfcda2f[_0x388ac9(0x136)]!==_0xa24ec0)throw new Error(_0x4b7d01+_0x388ac9(0x137)+(_0x388ac9(0x132)+_0xa24ec0+_0x388ac9(0x128)+_0xfcda2f[_0x388ac9(0x136)]+'\x22.\x20')+_0x388ac9(0x127));}return!_0xfcda2f[_0x388ac9(0x12c)]&&(_0xfcda2f[_0x388ac9(0x12c)]={}),!_0xfcda2f[_0x388ac9(0x12a)]&&(_0xfcda2f[_0x388ac9(0x12a)]=''),{'lockData':_0x5c1e8b,'appLock':_0xfcda2f};}export async function readBffLockFile(_0x39cb0b){const _0x56c7e8=a276_0x42ad;try{const _0x2cfd3b=await readFile(_0x39cb0b,_0x56c7e8(0x133)),_0xe7555f=JSON[_0x56c7e8(0x131)](_0x2cfd3b);return{'apps':_0xe7555f[_0x56c7e8(0x12b)]&&typeof _0xe7555f[_0x56c7e8(0x12b)]===_0x56c7e8(0x134)?_0xe7555f[_0x56c7e8(0x12b)]:{}};}catch(_0x4a3c6b){if(_0x4a3c6b[_0x56c7e8(0x13b)]===_0x56c7e8(0x129))return null;throw new Error(_0x56c7e8(0x12d)+String(_0x4a3c6b));}}export async function writeBffLockFile(_0x204d9c,_0x4d4c74){const _0x551661=a276_0x42ad;await mkdir(dirname(_0x204d9c),{'recursive':!![]}),await writeFile(_0x204d9c,JSON['stringify'](_0x4d4c74,null,0x2),_0x551661(0x133));}
|
package/lib/core/bff/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a278_0x2b75e9=a278_0x4f58;(function(_0x31e6ad,_0x48aafa){const _0x115ace=a278_0x4f58,_0x46a9d8=_0x31e6ad();while(!![]){try{const _0x5c7870=-parseInt(_0x115ace(0x85))/0x1+-parseInt(_0x115ace(0x80))/0x2+-parseInt(_0x115ace(0x8b))/0x3+-parseInt(_0x115ace(0x8d))/0x4+-parseInt(_0x115ace(0x87))/0x5*(-parseInt(_0x115ace(0x98))/0x6)+-parseInt(_0x115ace(0x82))/0x7*(parseInt(_0x115ace(0x8e))/0x8)+parseInt(_0x115ace(0x7f))/0x9*(parseInt(_0x115ace(0x94))/0xa);if(_0x5c7870===_0x48aafa)break;else _0x46a9d8['push'](_0x46a9d8['shift']());}catch(_0x417a9e){_0x46a9d8['push'](_0x46a9d8['shift']());}}}(a278_0x1d90,0xefa97));export const DEFAULT_BFF_SCRIPT_DESCRIPTION='TODO:\x20补充脚本功能描述';function a278_0x4f58(_0x1f0780,_0xeb5cdd){_0x1f0780=_0x1f0780-0x7f;const _0x1d9086=a278_0x1d90();let _0x4f58e8=_0x1d9086[_0x1f0780];return _0x4f58e8;}const LEGACY_DEFAULT_BFF_SCRIPT_DESCRIPTION=a278_0x2b75e9(0x86);export function snakeToCamel(_0x3ed616){const _0x5df705=a278_0x2b75e9;return _0x3ed616[_0x5df705(0x8f)]()['replace'](/_([a-z])/g,(_0x337121,_0xac0917)=>_0xac0917['toUpperCase']());}export function findHookLocationByRemoteId(_0x18845a,_0x567ff5){const _0x3e62e4=a278_0x2b75e9;if(!_0x567ff5)return undefined;for(const [_0x4eb341,_0x55c084]of Object[_0x3e62e4(0x8c)](_0x18845a)){if(_0x55c084[_0x3e62e4(0x88)]===_0x567ff5&&_0x55c084[_0x3e62e4(0x8a)]&&_0x55c084['operationType']&&_0x55c084[_0x3e62e4(0x96)]){const _0x4f3aab=_0x4eb341[_0x3e62e4(0x92)]('/')[0x1];return{'alias':_0x4f3aab||_0x55c084['alias'],'datasetCode':_0x55c084[_0x3e62e4(0x8a)],'operationType':_0x55c084[_0x3e62e4(0x89)],'functionNode':_0x55c084[_0x3e62e4(0x96)]};}}return undefined;}function a278_0x1d90(){const _0x8ce415=['1542454yNASEJ','TODO:\x20add\x20script\x20description','1103555RJgXPF','remoteId','operationType','datasetCode','2244051YyfFVI','entries','3426496VNJCWo','1375768vJNzeF','toLowerCase','before','after','split','match','20644620LlLFbp','startsWith','functionNode','trim','6gkleZv','27nCdova','2850984XFuCKS','test','35IzjesI','map','some'];a278_0x1d90=function(){return _0x8ce415;};return a278_0x1d90();}export function extractScriptDescription(_0x5d276d){const _0x51a8b1=a278_0x2b75e9,_0x31641d=_0x5d276d[_0x51a8b1(0x93)](/^\s*\/\*\*([\s\S]*?)\*\//);if(!_0x31641d?.[0x1])return undefined;const _0x20d8fe=_0x31641d[0x1],_0x29f25d=_0x5d90a5=>{const _0x222ee8=_0x5d90a5?.['trim']();if(!_0x222ee8||_0x222ee8===DEFAULT_BFF_SCRIPT_DESCRIPTION||_0x222ee8===LEGACY_DEFAULT_BFF_SCRIPT_DESCRIPTION)return undefined;return _0x222ee8;},_0x30c565=_0x20d8fe['match'](/^\s*\*\s*\[\s*脚本描述\s*]\s*(.+)$/m);if(_0x30c565)return _0x29f25d(_0x30c565[0x1]);const _0x31615c=_0x20d8fe['split'](/\r?\n/)[_0x51a8b1(0x83)](_0x5efba2=>_0x5efba2['replace'](/^\s*\*\s?/,'')[_0x51a8b1(0x97)]()),_0x3dc1a5=_0x31615c[_0x51a8b1(0x84)](_0x28ce81=>/^\[\s*脚本类型\s*]\s*\S+/[_0x51a8b1(0x81)](_0x28ce81))&&_0x31615c[_0x51a8b1(0x84)](_0x462a33=>/^\[\s*脚本名称\s*]\s*\S+/['test'](_0x462a33));if(!_0x3dc1a5)return undefined;for(const _0x1f73f7 of _0x31615c){if(!_0x1f73f7||_0x1f73f7[_0x51a8b1(0x95)]('@')||/^\[[^\]]+]\s*/[_0x51a8b1(0x81)](_0x1f73f7))continue;return _0x29f25d(_0x1f73f7);}return undefined;}export function isValidBffFunctionName(_0x517817){const _0x3a4ce3=a278_0x2b75e9;return/^[A-Za-z_$][A-Za-z0-9_$]*$/[_0x3a4ce3(0x81)](_0x517817);}export function normalizeHookFunctionNode(_0x45719c){const _0x4457fb=a278_0x2b75e9;if(!_0x45719c)return undefined;const _0x5789f4=_0x45719c[_0x4457fb(0x97)]()[_0x4457fb(0x8f)]();if(_0x5789f4===_0x4457fb(0x90)||_0x5789f4===_0x4457fb(0x91))return _0x5789f4;return undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a279_0xabc2(_0x5d532b,_0x5650c3){_0x5d532b=_0x5d532b-0x15c;const _0xfb3a68=a279_0xfb3a();let _0xabc24=_0xfb3a68[_0x5d532b];return _0xabc24;}const a279_0x4b4867=a279_0xabc2;(function(_0x3f9ebc,_0xa1109c){const _0x3a0d6a=a279_0xabc2,_0x5ef314=_0x3f9ebc();while(!![]){try{const _0x44b99c=-parseInt(_0x3a0d6a(0x168))/0x1*(parseInt(_0x3a0d6a(0x15e))/0x2)+parseInt(_0x3a0d6a(0x15d))/0x3*(-parseInt(_0x3a0d6a(0x166))/0x4)+parseInt(_0x3a0d6a(0x160))/0x5+parseInt(_0x3a0d6a(0x164))/0x6*(parseInt(_0x3a0d6a(0x15f))/0x7)+-parseInt(_0x3a0d6a(0x15c))/0x8+-parseInt(_0x3a0d6a(0x165))/0x9+-parseInt(_0x3a0d6a(0x163))/0xa*(-parseInt(_0x3a0d6a(0x162))/0xb);if(_0x44b99c===_0xa1109c)break;else _0x5ef314['push'](_0x5ef314['shift']());}catch(_0x562a68){_0x5ef314['push'](_0x5ef314['shift']());}}}(a279_0xfb3a,0xe549c));export const CROSS_DB_RELATION_PATHS={'list':a279_0x4b4867(0x167),'create':a279_0x4b4867(0x161),'update':'/smartapi/cross-db-relation/update','delete':'/smartapi/cross-db-relation/delete'};function a279_0xfb3a(){const _0x38894f=['4764044ZSNpoK','/smartapi/cross-db-relation/query','2161JTTCmc','6692232xZuutF','3QPBGQT','1120psQAPf','784iMsuaf','2501405BpBSGt','/smartapi/cross-db-relation/create','1111lFbNsd','408040bCKTOQ','25728tnqhcJ','8323893zChofw'];a279_0xfb3a=function(){return _0x38894f;};return a279_0xfb3a();}
|
package/lib/core/db-resolver.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xf52464,_0x3a04f7){const _0x23673a=a280_0x371d,_0x176761=_0xf52464();while(!![]){try{const _0x4b95dd=parseInt(_0x23673a(0x143))/0x1+parseInt(_0x23673a(0x152))/0x2+-parseInt(_0x23673a(0x156))/0x3+-parseInt(_0x23673a(0x15b))/0x4+-parseInt(_0x23673a(0x15f))/0x5*(parseInt(_0x23673a(0x15c))/0x6)+-parseInt(_0x23673a(0x149))/0x7+-parseInt(_0x23673a(0x150))/0x8*(-parseInt(_0x23673a(0x148))/0x9);if(_0x4b95dd===_0x3a04f7)break;else _0x176761['push'](_0x176761['shift']());}catch(_0x4eb00b){_0x176761['push'](_0x176761['shift']());}}}(a280_0x55c4,0x22f9c));import{listDatasets}from'../core/api-client.js';function a280_0x55c4(){const _0x87cb42=['db-','get','find','551772HfKJTF','filter','map','\x22.\x20Available:\x20','dbId','183336jowjnD','256458WgKrxp','includes','dbtableConfig','5SejeWv','Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20','108742zETdBq','join','.\x20Be\x20more\x20specific.','length','entries','63oQsEbU','628789zMmNOq','set','has','dbName','\x22\x20matches\x20multiple\x20databases:\x20','\x22\x20under\x20app\x20\x22','toLowerCase','275816vgEaTY','No\x20database\x20matching\x20\x22','311014DebpVb'];a280_0x55c4=function(){return _0x87cb42;};return a280_0x55c4();}const cache=new Map();export async function listDatabases(_0x3743bb){const _0x349bab=a280_0x371d;if(cache[_0x349bab(0x14b)](_0x3743bb))return cache[_0x349bab(0x154)](_0x3743bb);const _0x156291=await listDatasets(_0x3743bb),_0xc4482a=new Map();for(const _0x56ce03 of _0x156291){const _0x62da84=_0x56ce03[_0x349bab(0x15e)];_0x62da84?.['dbId']!=null&&_0xc4482a[_0x349bab(0x14a)](_0x62da84[_0x349bab(0x15a)],_0x62da84[_0x349bab(0x14c)]??_0x349bab(0x153)+_0x62da84[_0x349bab(0x15a)]);}const _0x242ece=[..._0xc4482a[_0x349bab(0x147)]()][_0x349bab(0x158)](([_0x5bb6a1,_0x41475c])=>({'dbId':_0x5bb6a1,'dbName':_0x41475c}));return cache['set'](_0x3743bb,_0x242ece),_0x242ece;}export async function resolveDb(_0x4cedb9,_0x4c9fd2){const _0x3a2b2d=a280_0x371d,_0x222864=await listDatabases(_0x4cedb9);if(_0x222864[_0x3a2b2d(0x146)]===0x0)return{'resolved':[],'error':'No\x20linked\x20databases\x20found\x20under\x20app\x20\x22'+_0x4cedb9+'\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.'};if(!_0x4c9fd2)return{'resolved':_0x222864};const _0x4547fd=Number(_0x4c9fd2);if(!Number['isNaN'](_0x4547fd)){const _0x198a8b=_0x222864['find'](_0xfd1d9=>_0xfd1d9[_0x3a2b2d(0x15a)]===_0x4547fd);if(_0x198a8b)return{'resolved':[_0x198a8b]};}const _0x556886=_0x4c9fd2['toLowerCase'](),_0x557ed3=_0x222864[_0x3a2b2d(0x157)](_0xab3142=>_0xab3142[_0x3a2b2d(0x14c)][_0x3a2b2d(0x14f)]()[_0x3a2b2d(0x15d)](_0x556886));if(_0x557ed3['length']>0x0)return{'resolved':_0x557ed3};const _0x1f07bd=_0x222864[_0x3a2b2d(0x158)](_0xb05558=>_0xb05558['dbName']+'\x20('+_0xb05558['dbId']+')')[_0x3a2b2d(0x144)](',\x20');return{'resolved':[],'error':_0x3a2b2d(0x151)+_0x4c9fd2+_0x3a2b2d(0x14e)+_0x4cedb9+_0x3a2b2d(0x159)+_0x1f07bd+'.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.'};}export async function resolveOneDb(_0x241fe0,_0x42d3e8){const _0x56e630=a280_0x371d,{resolved:_0x408006,error:_0x2ca84b}=await resolveDb(_0x241fe0,_0x42d3e8);if(_0x2ca84b)return{'db':null,'error':_0x2ca84b};if(_0x408006[_0x56e630(0x146)]===0x1)return{'db':_0x408006[0x0]};if(!_0x42d3e8){const _0x297403=_0x408006[_0x56e630(0x158)](_0x511493=>_0x511493[_0x56e630(0x14c)]+'\x20('+_0x511493[_0x56e630(0x15a)]+')')[_0x56e630(0x144)](',\x20');return{'db':null,'error':_0x56e630(0x160)+_0x297403};}const _0x50d8e0=_0x408006[_0x56e630(0x158)](_0x56e9c9=>_0x56e9c9[_0x56e630(0x14c)]+'\x20('+_0x56e9c9[_0x56e630(0x15a)]+')')[_0x56e630(0x144)](',\x20');return{'db':null,'error':'\x22'+_0x42d3e8+_0x56e630(0x14d)+_0x50d8e0+_0x56e630(0x145)};}function a280_0x371d(_0x359105,_0x195aec){_0x359105=_0x359105-0x143;const _0x55c45e=a280_0x55c4();let _0x371d12=_0x55c45e[_0x359105];return _0x371d12;}export async function getDbName(_0x2288f8,_0x1bf69a){const _0x16b773=a280_0x371d,_0x1e3c62=await listDatabases(_0x2288f8);return _0x1e3c62[_0x16b773(0x155)](_0x9889f2=>_0x9889f2['dbId']===_0x1bf69a)?.[_0x16b773(0x14c)];}
|
|
@@ -79,8 +79,8 @@ export interface FlowNode extends FlowJsonObject {
|
|
|
79
79
|
id: string;
|
|
80
80
|
type: FlowNodeType;
|
|
81
81
|
name: string;
|
|
82
|
-
/** Optional custom-page navigation target for
|
|
83
|
-
|
|
82
|
+
/** Optional custom-page navigation target for an APPROVAL or END node. */
|
|
83
|
+
path?: string;
|
|
84
84
|
position: {
|
|
85
85
|
x: number;
|
|
86
86
|
y: number;
|
|
@@ -120,8 +120,8 @@ export interface FlowEdge extends FlowJsonObject {
|
|
|
120
120
|
export interface FlowJson extends FlowJsonObject {
|
|
121
121
|
/** Only applies to INDEPENDENT_FLOW; missing values default to CUSTOM_PAGE. */
|
|
122
122
|
pageMode?: FlowPageMode;
|
|
123
|
-
/** Optional custom-page navigation
|
|
124
|
-
|
|
123
|
+
/** Optional custom-page navigation path used before starting a workflow. */
|
|
124
|
+
startPath?: string;
|
|
125
125
|
nodes: FlowNode[];
|
|
126
126
|
edges: FlowEdge[];
|
|
127
127
|
}
|
|
@@ -221,9 +221,9 @@ export declare const FLOW_CONFIG_JSON_SCHEMA: {
|
|
|
221
221
|
readonly type: "string";
|
|
222
222
|
readonly minLength: 1;
|
|
223
223
|
};
|
|
224
|
-
readonly
|
|
225
|
-
readonly type: "
|
|
226
|
-
readonly
|
|
224
|
+
readonly path: {
|
|
225
|
+
readonly type: "string";
|
|
226
|
+
readonly minLength: 1;
|
|
227
227
|
};
|
|
228
228
|
readonly position: {
|
|
229
229
|
readonly $ref: "#/$defs/position";
|
|
@@ -560,9 +560,10 @@ export declare const FLOW_CONFIG_JSON_SCHEMA: {
|
|
|
560
560
|
readonly pageMode: {
|
|
561
561
|
readonly const: "CUSTOM_PAGE";
|
|
562
562
|
};
|
|
563
|
-
readonly startPageId:
|
|
564
|
-
|
|
565
|
-
readonly
|
|
563
|
+
readonly startPageId: false;
|
|
564
|
+
readonly startPath: {
|
|
565
|
+
readonly type: "string";
|
|
566
|
+
readonly minLength: 1;
|
|
566
567
|
};
|
|
567
568
|
readonly nodes: {
|
|
568
569
|
readonly type: "array";
|