@lovrabet/rabetbase-cli 2.5.7-beta.1 → 2.5.7
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.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/detail.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.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/design-context.js +1 -1
- package/lib/commands/dataset/design-start.js +1 -1
- package/lib/commands/dataset/design-status.js +1 -1
- package/lib/commands/dataset/design-sync-retry.js +1 -1
- package/lib/commands/dataset/design-sync-status.js +1 -1
- package/lib/commands/dataset/design-validate.js +1 -1
- package/lib/commands/dataset/detail.js +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/cross-db-analysis-shared.js +1 -1
- package/lib/commands/db/cross-db-analyze-latest.js +1 -1
- package/lib/commands/db/cross-db-analyze-start.js +1 -1
- package/lib/commands/db/cross-db-analyze-status.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/page-list.js +1 -1
- package/lib/commands/flow/publish.js +1 -1
- package/lib/commands/flow/runtime-resources-shared.js +1 -1
- package/lib/commands/flow/runtime-role-list.js +1 -1
- package/lib/commands/flow/runtime-role-user-list.js +1 -1
- package/lib/commands/flow/runtime-user-search.js +1 -1
- package/lib/commands/flow/shared.js +1 -1
- package/lib/commands/flow/update.js +1 -1
- package/lib/commands/flow/validate.js +1 -1
- package/lib/commands/instant-api-policy/current.js +1 -1
- package/lib/commands/instant-api-policy/index.js +1 -1
- package/lib/commands/instant-api-policy/init.js +1 -1
- package/lib/commands/instant-api-policy/publish.js +1 -1
- package/lib/commands/instant-api-policy/pull.js +1 -1
- package/lib/commands/instant-api-policy/revision.js +1 -1
- package/lib/commands/instant-api-policy/revisions.js +1 -1
- package/lib/commands/instant-api-policy/rollback.js +1 -1
- package/lib/commands/instant-api-policy/shared.js +1 -1
- package/lib/commands/instant-api-policy/validate.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/search.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/path.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/subapp-assets.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/subapp-assets-status.js +1 -1
- package/lib/commands/menu/subapp-assets-update.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/feishu-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.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-analysis.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.js +1 -1
- package/lib/core/instant-api-policy/config.js +1 -1
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/page/lr-smart-jsx.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.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/services/dataset-design/checkpoint.js +1 -1
- package/lib/services/dataset-design/commands.js +1 -1
- package/lib/services/dataset-design/contract.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- 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 +1 -1
- package/skills/rabetbase-dataset-generation/SKILL.md +1 -1
- package/skills/rabetbase-page-generation/SKILL.md +1 -1
- package/skills/rabetbase.manifest.json +3 -3
package/lib/core/bff/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a289_0x1b7659=a289_0x306b;(function(_0x4059fa,_0x55599d){const _0x217add=a289_0x306b,_0x509018=_0x4059fa();while(!![]){try{const _0x3a17aa=-parseInt(_0x217add(0x190))/0x1*(parseInt(_0x217add(0x188))/0x2)+-parseInt(_0x217add(0x191))/0x3+parseInt(_0x217add(0x192))/0x4*(-parseInt(_0x217add(0x193))/0x5)+parseInt(_0x217add(0x18f))/0x6*(parseInt(_0x217add(0x194))/0x7)+parseInt(_0x217add(0x18a))/0x8+-parseInt(_0x217add(0x189))/0x9*(-parseInt(_0x217add(0x18e))/0xa)+parseInt(_0x217add(0x18c))/0xb;if(_0x3a17aa===_0x55599d)break;else _0x509018['push'](_0x509018['shift']());}catch(_0x5caec3){_0x509018['push'](_0x509018['shift']());}}}(a289_0x4ba0,0x2803c));import{resolve}from'node:path';function a289_0x4ba0(){const _0xada517=['18jxCgRV','533984MJaFfS','bff','3484580ZvApEL','bff.lock.json','361010vkQpkq','24MsJORg','1cGDruC','106905mSPxiq','2712EmqHJq','2110YdQzcj','130543IVOEdU','/bff','89350ZSeJTc'];a289_0x4ba0=function(){return _0xada517;};return a289_0x4ba0();}import{findProjectRootDirectory}from'../../context.js';function a289_0x306b(_0x5d6ba8,_0x1d9366){_0x5d6ba8=_0x5d6ba8-0x188;const _0x4ba0cf=a289_0x4ba0();let _0x306bfc=_0x4ba0cf[_0x5d6ba8];return _0x306bfc;}const DOT_DIR='.rabetbase',LOCK_FILE_NAME=a289_0x1b7659(0x18d),TRASH_DIR_NAME='bff-trash';export function loadBffProjectConfig(_0xd2000e,_0x10f474){const _0x2e5b4a=a289_0x1b7659,_0x48bab3=resolve(_0x10f474??findProjectRootDirectory()),_0x4cad20=DOT_DIR+_0x2e5b4a(0x195),_0x345ad9=_0x4cad20+'/'+_0xd2000e;return{'projectRoot':_0x48bab3,'appCode':_0xd2000e,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x4cad20,'scriptsRoot':_0x345ad9,'scriptsRootDir':resolve(_0x48bab3,DOT_DIR,_0x2e5b4a(0x18b),_0xd2000e),'lockFilePath':resolve(_0x48bab3,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x48bab3,DOT_DIR,TRASH_DIR_NAME)};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a290_0x19a355=a290_0x24be;(function(_0x5bfb75,_0x1cde30){const _0x157d2d=a290_0x24be,_0x2da026=_0x5bfb75();while(!![]){try{const _0x1bd029=-parseInt(_0x157d2d(0x135))/0x1*(-parseInt(_0x157d2d(0x141))/0x2)+parseInt(_0x157d2d(0x142))/0x3*(parseInt(_0x157d2d(0x144))/0x4)+parseInt(_0x157d2d(0x146))/0x5+-parseInt(_0x157d2d(0x153))/0x6*(-parseInt(_0x157d2d(0x14c))/0x7)+-parseInt(_0x157d2d(0x140))/0x8+parseInt(_0x157d2d(0x14a))/0x9*(parseInt(_0x157d2d(0x15c))/0xa)+-parseInt(_0x157d2d(0x138))/0xb;if(_0x1bd029===_0x1cde30)break;else _0x2da026['push'](_0x2da026['shift']());}catch(_0x50dc73){_0x2da026['push'](_0x2da026['shift']());}}}(a290_0x5edd,0x387cd));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=['COMMON',a290_0x19a355(0x143),a290_0x19a355(0x15e)];export function normalizeBffType(_0x3d9397){const _0xa344fd=a290_0x19a355;if(!_0x3d9397)return undefined;const _0x34f6a4=_0x3d9397[_0xa344fd(0x13b)]()[_0xa344fd(0x13e)]();return SUPPORTED_BFF_TYPES[_0xa344fd(0x154)](_0x34f6a4)?_0x34f6a4:undefined;}async function scanJsFilesRecursively(_0x24a971,_0x31471d){const _0x45ae7e=a290_0x19a355,_0x32e381=[];try{const _0x4caa2d=await readdir(_0x24a971,{'withFileTypes':!![]});for(const _0x38100b of _0x4caa2d){const _0xc7c8a2=join(_0x24a971,_0x38100b[_0x45ae7e(0x156)]);if(_0x38100b[_0x45ae7e(0x158)]())_0x32e381[_0x45ae7e(0x15a)](...await scanJsFilesRecursively(_0xc7c8a2,_0x31471d+'/'+_0x38100b[_0x45ae7e(0x156)]));else _0x38100b[_0x45ae7e(0x151)]()&&_0x38100b[_0x45ae7e(0x156)][_0x45ae7e(0x149)](_0x45ae7e(0x15d))&&_0x32e381['push']({'lockKey':_0x31471d+'/'+_0x38100b['name']['replace'](/\.js$/,''),'filePath':_0xc7c8a2});}}catch(_0x23a296){if(_0x23a296[_0x45ae7e(0x147)]!==_0x45ae7e(0x13c))throw _0x23a296;}return _0x32e381;}async function scanFlatFunctions(_0x165c3e,_0x2e54d1){const _0x4b73f0=a290_0x19a355,_0x56ba66=join(_0x165c3e[_0x4b73f0(0x157)],_0x2e54d1),_0x3158ce=await scanJsFilesRecursively(_0x56ba66,_0x2e54d1);return _0x3158ce[_0x4b73f0(0x13f)](({lockKey:_0x5e8895,filePath:_0x2acc4e})=>({'type':_0x2e54d1,'name':_0x5e8895['split']('/')['at'](-0x1)??'','filePath':_0x2acc4e,'lockKey':_0x5e8895}));}async function scanHookFunctions(_0x313742){const _0x1309ad=a290_0x19a355,_0x3fe4ae=join(_0x313742[_0x1309ad(0x157)],_0x1309ad(0x15e)),_0x52487a=[];try{const _0x4478af=await readdir(_0x3fe4ae,{'withFileTypes':!![]});for(const _0x212e2f of _0x4478af){if(!_0x212e2f['isDirectory']())continue;const _0x4f936b=_0x212e2f[_0x1309ad(0x156)],_0x3b6c5a=join(_0x3fe4ae,_0x4f936b),_0x5bfcb2=await readdir(_0x3b6c5a,{'withFileTypes':!![]});for(const _0x2dea1d of _0x5bfcb2){if(!_0x2dea1d[_0x1309ad(0x158)]())continue;const _0x6f0068=_0x2dea1d['name'],_0x3ae584=join(_0x3b6c5a,_0x6f0068),_0x27fbde=await readdir(_0x3ae584,{'withFileTypes':!![]});for(const _0x1381b3 of _0x27fbde){if(!_0x1381b3[_0x1309ad(0x158)]())continue;const _0x539887=_0x1381b3['name'],_0x2e0517=join(_0x3ae584,_0x539887),_0x4682e4=await readdir(_0x2e0517,{'withFileTypes':!![]});for(const _0x9bcc2f of _0x4682e4){if(!_0x9bcc2f[_0x1309ad(0x151)]()||!_0x9bcc2f[_0x1309ad(0x156)][_0x1309ad(0x149)](_0x1309ad(0x15d)))continue;const _0x161ca0=_0x9bcc2f[_0x1309ad(0x156)][_0x1309ad(0x14b)](/\.js$/,'');_0x52487a[_0x1309ad(0x15a)]({'type':_0x1309ad(0x15e),'name':_0x161ca0,'filePath':join(_0x2e0517,_0x9bcc2f[_0x1309ad(0x156)]),'lockKey':'HOOK/'+_0x4f936b+'/'+_0x6f0068+'/'+_0x539887+'/'+_0x161ca0,'alias':_0x4f936b,'operationType':_0x6f0068,'functionNode':_0x539887});}}}}}catch(_0x34d110){if(_0x34d110[_0x1309ad(0x147)]!==_0x1309ad(0x13c))throw _0x34d110;}return _0x52487a;}function a290_0x5edd(){const _0x4a5c31=['toUpperCase','map','3154736GrHMIp','3554qMqNdz','216387rnTIdZ','ENDPOINT','12ixjIHd','every','1844515IADIfE','code','afterScriptId','endsWith','2031966nExbEK','replace','1139054YRERPi','test','scriptType','get','startsWith','isFile','datasetCode','6wIHsFR','includes','toLowerCase','name','scriptsRootDir','isDirectory','beforeScriptId','push','set','10KnZxwU','.js','HOOK','split','Unsafe\x20Backend\x20Function\x20lock\x20key\x20(traversal\x20or\x20invalid\x20segment):\x20','operationType','6viyRUn','COMMON','HOOK/','3946063KePYKD','before','functionName','trim','ENOENT','F_OK'];a290_0x5edd=function(){return _0x4a5c31;};return a290_0x5edd();}export async function scanLocalBffFunctions(_0x5278cf,_0x74eb60){const _0x48fe1d=a290_0x19a355;if(_0x74eb60===_0x48fe1d(0x136)||_0x74eb60===_0x48fe1d(0x143))return scanFlatFunctions(_0x5278cf,_0x74eb60);if(_0x74eb60==='HOOK')return scanHookFunctions(_0x5278cf);const [_0x1ea062,_0x2eed97,_0x5addd6]=await Promise['all']([scanFlatFunctions(_0x5278cf,_0x48fe1d(0x136)),scanFlatFunctions(_0x5278cf,_0x48fe1d(0x143)),scanHookFunctions(_0x5278cf)]);return[..._0x1ea062,..._0x2eed97,..._0x5addd6];}const SAFE_LOCK_KEY_SEGMENT=/^[A-Za-z0-9_$.-]+$/;export function isSafeLockKeySegment(_0x340aa9){const _0x4ac6fd=a290_0x19a355;return SAFE_LOCK_KEY_SEGMENT[_0x4ac6fd(0x14d)](_0x340aa9)&&_0x340aa9!=='.'&&_0x340aa9!=='..';}export function resolveLocalFilePathFromLockKey(_0x23e1b,_0x3bff5b){const _0x4656e9=a290_0x19a355,_0x465d26=_0x3bff5b[_0x4656e9(0x132)]('/');if(!_0x465d26[_0x4656e9(0x145)](isSafeLockKeySegment))throw new Error(_0x4656e9(0x133)+_0x3bff5b);const _0x38ab8c=resolve(join(_0x23e1b['scriptsRootDir'],..._0x465d26)+_0x4656e9(0x15d)),_0x26f30a=resolve(_0x23e1b[_0x4656e9(0x157)]);if(_0x38ab8c!==_0x26f30a&&!_0x38ab8c[_0x4656e9(0x150)](_0x26f30a+sep))throw new Error('Resolved\x20Backend\x20Function\x20script\x20path\x20escapes\x20scripts\x20root:\x20'+_0x38ab8c);return _0x38ab8c;}export function createHookLocationMap(_0x3ef095){const _0x195f2f=a290_0x19a355,_0x55d086=new Map();for(const _0xcf3455 of _0x3ef095){_0xcf3455[_0x195f2f(0x159)]&&_0x55d086[_0x195f2f(0x15b)](_0xcf3455['beforeScriptId'],{'datasetCode':_0xcf3455[_0x195f2f(0x152)],'operationType':snakeToCamel(_0xcf3455[_0x195f2f(0x134)]),'functionNode':_0x195f2f(0x139)}),_0xcf3455[_0x195f2f(0x148)]&&_0x55d086[_0x195f2f(0x15b)](_0xcf3455[_0x195f2f(0x148)],{'datasetCode':_0xcf3455[_0x195f2f(0x152)],'operationType':snakeToCamel(_0xcf3455['operationType']),'functionNode':'after'});}return _0x55d086;}export function resolveRemoteScriptTarget(_0xb5ebc,_0x2eacff,_0x2c24e0,_0xeae981,_0x609281){const _0x2e4d98=a290_0x19a355,_0x2b3e0e=normalizeBffType(_0x2eacff[_0x2e4d98(0x14e)]);if(!_0x2b3e0e||!_0x2eacff[_0x2e4d98(0x13a)])return null;if(_0x2b3e0e===_0x2e4d98(0x15e)){const _0x187002=_0x2eacff['id']?_0x2c24e0[_0x2e4d98(0x14f)](_0x2eacff['id']):undefined,_0x456ede=findHookLocationByRemoteId(_0xeae981,_0x2eacff['id']),_0x4ab97a=_0x187002?{..._0x456ede?.[_0x2e4d98(0x152)]===_0x187002[_0x2e4d98(0x152)]?_0x456ede:{},..._0x187002}:_0x456ede;if(!_0x4ab97a)return null;const _0x429263=_0x609281[_0x2e4d98(0x14f)](_0x4ab97a[_0x2e4d98(0x152)][_0x2e4d98(0x155)]()),_0x1df566=_0x429263??_0x4ab97a['datasetCode'],_0x24cc8b={..._0x4ab97a,'alias':_0x429263},_0x53eb76=_0x2e4d98(0x137)+_0x1df566+'/'+_0x24cc8b['operationType']+'/'+_0x24cc8b['functionNode']+'/'+_0x2eacff['functionName'];if(!_0x53eb76[_0x2e4d98(0x132)]('/')[_0x2e4d98(0x145)](isSafeLockKeySegment))return null;return{'lockKey':_0x53eb76,'filePath':resolveLocalFilePathFromLockKey(_0xb5ebc,_0x53eb76),'type':'HOOK','hookLocation':_0x24cc8b};}const _0x10c1fe=_0x2b3e0e+'/'+_0x2eacff['functionName'];if(!_0x10c1fe[_0x2e4d98(0x132)]('/')[_0x2e4d98(0x145)](isSafeLockKeySegment))return null;return{'lockKey':_0x10c1fe,'filePath':resolveLocalFilePathFromLockKey(_0xb5ebc,_0x10c1fe),'type':_0x2b3e0e};}export async function ensureParentDirectory(_0x4960a1){await mkdir(dirname(_0x4960a1),{'recursive':!![]});}function a290_0x24be(_0x301c80,_0x1da6de){_0x301c80=_0x301c80-0x132;const _0x5eddb9=a290_0x5edd();let _0x24beff=_0x5eddb9[_0x301c80];return _0x24beff;}export async function fileExists(_0xe685af){const _0x3ff6ef=a290_0x19a355;try{return await access(_0xe685af,constants[_0x3ff6ef(0x13d)]),!![];}catch{return![];}}export async function directoryExists(_0x4710ee){try{const _0x426c6e=await stat(_0x4710ee);return _0x426c6e['isDirectory']();}catch{return![];}}
|
package/lib/core/bff/hash.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a291_0x5219(_0x3968c2,_0x2455c7){_0x3968c2=_0x3968c2-0x163;const _0x5a9bf3=a291_0x5a9b();let _0x521934=_0x5a9bf3[_0x3968c2];return _0x521934;}(function(_0x4c131d,_0x4728b0){const _0x28e108=a291_0x5219,_0x5b42d6=_0x4c131d();while(!![]){try{const _0xd7906f=-parseInt(_0x28e108(0x16d))/0x1*(parseInt(_0x28e108(0x16a))/0x2)+-parseInt(_0x28e108(0x16c))/0x3*(parseInt(_0x28e108(0x169))/0x4)+parseInt(_0x28e108(0x168))/0x5*(-parseInt(_0x28e108(0x173))/0x6)+-parseInt(_0x28e108(0x167))/0x7*(parseInt(_0x28e108(0x163))/0x8)+parseInt(_0x28e108(0x170))/0x9+-parseInt(_0x28e108(0x172))/0xa*(parseInt(_0x28e108(0x16b))/0xb)+parseInt(_0x28e108(0x165))/0xc;if(_0xd7906f===_0x4728b0)break;else _0x5b42d6['push'](_0x5b42d6['shift']());}catch(_0x59d668){_0x5b42d6['push'](_0x5b42d6['shift']());}}}(a291_0x5a9b,0x4cb9d));function a291_0x5a9b(){const _0x337fd7=['utf8','30OddXUT','408NFgStU','3544VTQSZV','digest','32130456tSTbPx','update','6923AMseUc','31520BoaixV','672uDxdcb','2BfAseg','2113221IpuaKA','8262ulOcNa','505135pGURVx','md5','hex','429030xNThXg'];a291_0x5a9b=function(){return _0x337fd7;};return a291_0x5a9b();}import{readFile}from'node:fs/promises';import a291_0x39414 from'node:crypto';export function computeContentHash(_0x13747c){const _0x22ca31=a291_0x5219;return a291_0x39414['createHash'](_0x22ca31(0x16e))[_0x22ca31(0x166)](_0x13747c)[_0x22ca31(0x164)](_0x22ca31(0x16f));}export async function computeFileHash(_0x4d60ae){const _0x29a542=a291_0x5219,_0x36fda5=await readFile(_0x4d60ae,_0x29a542(0x171));return computeContentHash(_0x36fda5);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a292_0x3506(_0x5dfac9,_0x498d30){_0x5dfac9=_0x5dfac9-0xfe;const _0x4ae0b9=a292_0x4ae0();let _0x3506dc=_0x4ae0b9[_0x5dfac9];return _0x3506dc;}(function(_0x41f609,_0x4cceed){const _0x3ecca9=a292_0x3506,_0x4fc81c=_0x41f609();while(!![]){try{const _0x16cdd2=parseInt(_0x3ecca9(0x106))/0x1*(-parseInt(_0x3ecca9(0x130))/0x2)+parseInt(_0x3ecca9(0x125))/0x3*(-parseInt(_0x3ecca9(0x104))/0x4)+parseInt(_0x3ecca9(0x12f))/0x5+-parseInt(_0x3ecca9(0x127))/0x6*(-parseInt(_0x3ecca9(0x11f))/0x7)+parseInt(_0x3ecca9(0x123))/0x8*(-parseInt(_0x3ecca9(0x118))/0x9)+parseInt(_0x3ecca9(0x108))/0xa*(-parseInt(_0x3ecca9(0xff))/0xb)+-parseInt(_0x3ecca9(0x11e))/0xc*(-parseInt(_0x3ecca9(0x107))/0xd);if(_0x16cdd2===_0x4cceed)break;else _0x4fc81c['push'](_0x4fc81c['shift']());}catch(_0x4f9c5b){_0x4fc81c['push'](_0x4fc81c['shift']());}}}(a292_0x4ae0,0xb2a84));import{CliError}from'../../errors.js';export function trackedHookDirectoryMappings(_0x445fb9){const _0x1c0b5d=a292_0x3506,_0x4164ef=[];for(const [_0x1d38a5,_0x5df623]of Object[_0x1c0b5d(0x105)](_0x445fb9[_0x1c0b5d(0x128)])){const [_0x634dd2,_0x2941ea]=_0x1d38a5[_0x1c0b5d(0x134)]('/');if(_0x634dd2!==_0x1c0b5d(0x12e)||!_0x2941ea||!_0x5df623[_0x1c0b5d(0x113)])continue;_0x4164ef[_0x1c0b5d(0x131)]({'alias':_0x2941ea,'datasetCode':_0x5df623[_0x1c0b5d(0x113)]});}return _0x4164ef;}export function uniqueTrackedHookDirectoryByDataset(_0x74e9d1){const _0x3ae5f9=a292_0x3506,_0x390cd5=new Map();for(const _0x85d096 of trackedHookDirectoryMappings(_0x74e9d1)){const _0x311044=directoryIdentity(_0x85d096[_0x3ae5f9(0x113)]),_0x4158c6=_0x390cd5[_0x3ae5f9(0x102)](_0x311044)??new Map();_0x4158c6[_0x3ae5f9(0x12b)](directoryIdentity(_0x85d096[_0x3ae5f9(0x12c)]),_0x85d096[_0x3ae5f9(0x12c)]),_0x390cd5[_0x3ae5f9(0x12b)](_0x311044,_0x4158c6);}const _0x2af711=new Map();for(const [_0x40119a,_0x4d2560]of _0x390cd5){if(_0x4d2560[_0x3ae5f9(0x12a)]>0x1)throw hookDirectoryError(_0x3ae5f9(0x10d),_0x3ae5f9(0x11b)+_0x40119a+_0x3ae5f9(0x111)+[..._0x4d2560[_0x3ae5f9(0x10a)]()][_0x3ae5f9(0x110)](',\x20')+'.',{'datasetCode':_0x40119a,'directories':[..._0x4d2560[_0x3ae5f9(0x10a)]()]});_0x2af711[_0x3ae5f9(0x12b)](_0x40119a,[..._0x4d2560['values']()][0x0]);}return _0x2af711;}export function assertUnambiguousHookDirectoryMappings(_0x55e142){const _0x1112a5=a292_0x3506,_0x1a47a0=new Map();for(const {alias:_0x48d425,datasetCode:_0x110fda}of _0x55e142){const _0x3730e3=directoryIdentity(_0x48d425),_0x3bc47d=_0x1a47a0['get'](_0x3730e3)??new Set();_0x3bc47d['add'](_0x110fda),_0x1a47a0[_0x1112a5(0x12b)](_0x3730e3,_0x3bc47d);}for(const [_0x587244,_0x30ca84]of _0x1a47a0){if(_0x30ca84[_0x1112a5(0x12a)]>0x1)throw hookDirectoryError('HOOK_DIRECTORY_AMBIGUOUS',_0x1112a5(0x12d)+_0x587244+_0x1112a5(0x112),{'directoryName':_0x587244,'datasetCodes':[..._0x30ca84]});}}export function assertUnambiguousHookAliases(_0x55d3d7){const _0x1fc627=a292_0x3506,_0x4d0546=[..._0x55d3d7],_0x11447f=new Map(),_0x3af9cb=new Map();for(const {alias:_0x25786,datasetCode:_0x5aae94}of _0x4d0546){const _0x47e191=directoryIdentity(_0x25786),_0x125306=directoryIdentity(_0x5aae94),_0x22f1b8=_0x11447f[_0x1fc627(0x102)](_0x47e191)??new Set();_0x22f1b8['add'](_0x5aae94),_0x11447f['set'](_0x47e191,_0x22f1b8);const _0x2da73b=_0x3af9cb['get'](_0x125306)??new Set();_0x2da73b[_0x1fc627(0x133)](_0x25786),_0x3af9cb['set'](_0x125306,_0x2da73b);}for(const [_0x21fca2,_0x52c2d8]of _0x11447f){if(_0x52c2d8[_0x1fc627(0x12a)]>0x1)throw hookDirectoryError(_0x1fc627(0x132),'SDK\x20alias\x20\x22'+_0x21fca2+'\x22\x20resolves\x20to\x20multiple\x20Datasets.',{'alias':_0x21fca2,'datasetCodes':[..._0x52c2d8]});}for(const [_0x1b55a9,_0x1f744c]of _0x3af9cb){if(_0x1f744c[_0x1fc627(0x12a)]>0x1)throw hookDirectoryError(_0x1fc627(0x132),_0x1fc627(0x11b)+_0x1b55a9+_0x1fc627(0xfe),{'datasetCode':_0x1b55a9,'aliases':[..._0x1f744c]});}}export function buildHookDirectoryIndexes(_0x33b37f,_0x52030c=[]){const _0x1956a6=a292_0x3506,_0x3afafa=[..._0x52030c];assertUnambiguousHookDirectoryMappings(_0x3afafa[_0x1956a6(0x135)](([_0x572b9a,_0x26b691])=>({'alias':_0x572b9a,'datasetCode':_0x26b691})));const _0x344420=new Map(),_0x4e41de=new Map();for(const _0xe859c1 of _0x33b37f){appendUnique(_0x344420,directoryIdentity(_0xe859c1['code']),_0xe859c1,_0x49497b=>_0x49497b[_0x1956a6(0x114)]);}for(const [_0x418d63,_0x5e6511]of _0x3afafa){appendUnique(_0x4e41de,directoryIdentity(_0x418d63),_0x5e6511,_0x544807=>_0x544807);}return{'datasetCodeToDatasets':_0x344420,'aliasToDatasetCodes':_0x4e41de};}function a292_0x4ae0(){const _0x28c43e=['lockKey','Dataset\x20\x22','Cannot\x20resolve\x20HOOK\x20directory\x20\x22','\x22\x20collides\x20across\x20datasetCode\x20and\x20alias\x20namespaces.','36pfDbez','1557689gBTtUG','NFC','\x22\x20differs\x20only\x20by\x20case\x20from\x20another\x20Dataset\x20code.','HOOK_DIRECTORY_AMBIGUOUS','32984OmkhHZ','aliasToDatasetCodes','139509JgsYXz','details','30lSSEkT','functions','\x22\x20to\x20\x22','size','set','alias','HOOK\x20directory\x20\x22','HOOK','1887410ebIshu','6iVnMtG','push','HOOK_ALIAS_AMBIGUOUS','add','split','map','length','\x22\x20changed\x20mapping\x20from\x20Dataset\x20\x22','\x22\x20has\x20multiple\x20SDK\x20aliases\x20and\x20has\x20no\x20unique\x20HOOK\x20directory.','11ilfuRr','some','includes','get','HOOK_DATASET_NOT_FOUND','68ONIJHy','entries','78095zBdDhZ','5935891JkFkah','3158290ztaVvX','message','values','HOOK_DIRECTORY_UNRESOLVED','HOOK_MAPPING_DRIFT','HOOK_DUPLICATE_DIRECTORIES','datasetCodeToDatasets','name','join','\x22\x20has\x20multiple\x20tracked\x20HOOK\x20directories:\x20','\x22\x20resolves\x20to\x20multiple\x20Datasets.','datasetCode','code','normalize','\x22\x20points\x20to\x20a\x20Dataset\x20that\x20is\x20absent\x20from\x20current\x20platform\x20metadata.','\x22\x20to\x20a\x20Dataset\x20alias\x20or\x20datasetCode.','1719tVIHql','toLowerCase'];a292_0x4ae0=function(){return _0x28c43e;};return a292_0x4ae0();}export function resolvePushHookDirectory(_0x424977,_0x5f3099,_0x493158){const _0x338387=a292_0x3506,_0x5e50fb=directoryIdentity(_0x424977),_0xa592de=_0x493158[_0x338387(0x10e)]['get'](_0x5e50fb)??[],_0x2686fc=_0x493158[_0x338387(0x124)]['get'](_0x5e50fb)??[],_0x2b3b05=new Set([..._0xa592de[_0x338387(0x135)](_0x43c56f=>_0x43c56f[_0x338387(0x114)]),..._0x2686fc]);if(_0x2b3b05[_0x338387(0x12a)]>0x1)throw hookDirectoryError(_0x338387(0x122),_0x338387(0x12d)+_0x424977+_0x338387(0x11d),{'directoryName':_0x424977,'datasetCodes':[..._0x2b3b05]});const _0x8fad50=[..._0x2b3b05][0x0];if(_0x8fad50&&_0x5f3099?.[_0x338387(0x113)]&&_0x8fad50!==_0x5f3099['datasetCode'])throw hookDirectoryError(_0x338387(0x10c),'HOOK\x20directory\x20\x22'+_0x424977+_0x338387(0x137)+_0x5f3099[_0x338387(0x113)]+_0x338387(0x129)+_0x8fad50+'\x22.',{'directoryName':_0x424977,'datasetCode':_0x8fad50,'lockedDatasetCode':_0x5f3099[_0x338387(0x113)]});const _0x10cf17=_0x8fad50?findDatasetByCode(_0x493158,_0x8fad50):undefined,_0x2f7361=!!_0x8fad50&&_0x2686fc[_0x338387(0x101)](_0x8fad50);if(_0x10cf17)return{'dataset':_0x10cf17,'datasetCode':_0x10cf17[_0x338387(0x114)],..._0x2f7361?{'alias':_0x424977}:{},'directoryProtocol':_0x2f7361?_0x338387(0x12c):'datasetCode','warnings':[]};const _0x580048=_0x5f3099?.['datasetCode'];if(_0x580048){const _0x32ca87=findDatasetByCode(_0x493158,_0x580048);if(_0x32ca87)return{'dataset':_0x32ca87,'datasetCode':_0x32ca87[_0x338387(0x114)],..._0x5f3099['alias']?{'alias':_0x5f3099[_0x338387(0x12c)]}:{},'directoryProtocol':_0x5f3099[_0x338387(0x12c)]?_0x338387(0x12c):'datasetCode','warnings':[]};}if(_0x8fad50||_0x580048){const _0x2488a1=_0x8fad50??_0x580048;throw hookDirectoryError(_0x338387(0x103),_0x338387(0x12d)+_0x424977+_0x338387(0x116),{'directoryName':_0x424977,'datasetCode':_0x2488a1});}throw hookDirectoryError(_0x338387(0x10b),_0x338387(0x11c)+_0x424977+_0x338387(0x117),{'directoryName':_0x424977});}export function preflightPushHookDirectories(_0x599897,_0x7ed518,_0x38ebde,_0x2cae1c){const _0x2b6525=a292_0x3506,_0x349b97=new Map(),_0x8c12f6=new Map();for(const _0x4f66a8 of _0x599897){if(_0x4f66a8['type']!=='HOOK')continue;const _0x44ebe5=_0x4f66a8[_0x2b6525(0x12c)];if(!_0x44ebe5)throw hookDirectoryError(_0x2b6525(0x10b),'Incomplete\x20HOOK\x20path:\x20'+_0x4f66a8[_0x2b6525(0x11a)],{'lockKey':_0x4f66a8[_0x2b6525(0x11a)]});let _0x21a456;try{_0x21a456=resolvePushHookDirectory(_0x44ebe5,_0x7ed518[_0x2b6525(0x128)][_0x4f66a8[_0x2b6525(0x11a)]],_0x38ebde);}catch(_0x45ce79){if(_0x2cae1c&&_0x45ce79 instanceof CliError&&[_0x2b6525(0x103),_0x2b6525(0x10b)]['includes'](_0x45ce79[_0x2b6525(0x114)])){_0x2cae1c['set'](_0x4f66a8['lockKey'],_0x45ce79[_0x2b6525(0x109)]);continue;}throw _0x45ce79;}_0x349b97['set'](_0x4f66a8[_0x2b6525(0x11a)],_0x21a456);const _0x9296c2=_0x8c12f6['get'](_0x21a456[_0x2b6525(0x113)])??new Set();_0x9296c2['add'](_0x44ebe5),_0x8c12f6[_0x2b6525(0x12b)](_0x21a456['datasetCode'],_0x9296c2);}for(const [_0x1635cb,_0x47ea7b]of _0x8c12f6){if(_0x47ea7b[_0x2b6525(0x12a)]>0x1)throw hookDirectoryError(_0x2b6525(0x10d),'Dataset\x20\x22'+_0x1635cb+'\x22\x20is\x20represented\x20by\x20multiple\x20HOOK\x20directories:\x20'+[..._0x47ea7b]['join'](',\x20')+'.',{'datasetCode':_0x1635cb,'directories':[..._0x47ea7b]});}return _0x349b97;}export function hookDirectoryError(_0x54902b,_0x8c2a8d,_0x233415){const _0x33d09a=a292_0x3506,_0x22a190=new CliError(_0x54902b,0x2,_0x54902b+':\x20'+_0x8c2a8d);return _0x22a190[_0x33d09a(0x126)]=_0x233415,_0x22a190;}function findDatasetByCode(_0x5d4a8f,_0x1f4c9f){const _0x574285=a292_0x3506,_0x499cca=_0x5d4a8f['datasetCodeToDatasets'][_0x574285(0x102)](directoryIdentity(_0x1f4c9f))??[];if(_0x499cca[_0x574285(0x136)]>0x1)throw hookDirectoryError('HOOK_DATASET_CODE_AMBIGUOUS','Dataset\x20code\x20\x22'+_0x1f4c9f+_0x574285(0x121),{'datasetCode':_0x1f4c9f,'candidates':_0x499cca[_0x574285(0x135)](datasetFact)});return _0x499cca[0x0];}function directoryIdentity(_0x19b36d){const _0x3d38d0=a292_0x3506;return _0x19b36d[_0x3d38d0(0x115)](_0x3d38d0(0x120))[_0x3d38d0(0x119)]();}function appendUnique(_0x38b927,_0x9976c4,_0x42984f,_0x56ef9f){const _0x107d2a=a292_0x3506,_0x302e39=_0x38b927[_0x107d2a(0x102)](_0x9976c4)??[];!_0x302e39[_0x107d2a(0x100)](_0xee5f2f=>_0x56ef9f(_0xee5f2f)===_0x56ef9f(_0x42984f))&&_0x302e39['push'](_0x42984f),_0x38b927[_0x107d2a(0x12b)](_0x9976c4,_0x302e39);}function datasetFact(_0xf884fb){const _0x4212ea=a292_0x3506;return{'id':_0xf884fb['id'],'name':_0xf884fb[_0x4212ea(0x10f)],'datasetCode':_0xf884fb[_0x4212ea(0x114)]};}
|
|
1
|
+
(function(_0x5068d6,_0xd71283){const _0x9419b=a292_0x283d,_0x48a891=_0x5068d6();while(!![]){try{const _0x1db53c=-parseInt(_0x9419b(0xf6))/0x1+parseInt(_0x9419b(0xe9))/0x2+-parseInt(_0x9419b(0xec))/0x3+parseInt(_0x9419b(0xe4))/0x4+parseInt(_0x9419b(0xe6))/0x5*(-parseInt(_0x9419b(0xf3))/0x6)+-parseInt(_0x9419b(0xde))/0x7*(parseInt(_0x9419b(0x102))/0x8)+parseInt(_0x9419b(0x101))/0x9;if(_0x1db53c===_0xd71283)break;else _0x48a891['push'](_0x48a891['shift']());}catch(_0x5a3c09){_0x48a891['push'](_0x48a891['shift']());}}}(a292_0x2096,0xa1ad8));import{CliError}from'../../errors.js';export function trackedHookDirectoryMappings(_0x1b9fd8){const _0x5f5832=a292_0x283d,_0x428113=[];for(const [_0x4f4176,_0x296d24]of Object[_0x5f5832(0x10b)](_0x1b9fd8[_0x5f5832(0xe0)])){const [_0x553309,_0x1a9fd8]=_0x4f4176['split']('/');if(_0x553309!==_0x5f5832(0xe2)||!_0x1a9fd8||!_0x296d24[_0x5f5832(0x109)])continue;_0x428113[_0x5f5832(0xed)]({'alias':_0x1a9fd8,'datasetCode':_0x296d24[_0x5f5832(0x109)]});}return _0x428113;}export function uniqueTrackedHookDirectoryByDataset(_0x10a123){const _0x4830e3=a292_0x283d,_0x51501a=new Map();for(const _0x4de945 of trackedHookDirectoryMappings(_0x10a123)){const _0x4433bd=directoryIdentity(_0x4de945[_0x4830e3(0x109)]),_0x4faa72=_0x51501a[_0x4830e3(0xe7)](_0x4433bd)??new Map();_0x4faa72[_0x4830e3(0xf8)](directoryIdentity(_0x4de945['alias']),_0x4de945[_0x4830e3(0xfb)]),_0x51501a[_0x4830e3(0xf8)](_0x4433bd,_0x4faa72);}const _0x4b5d16=new Map();for(const [_0x28cb5b,_0xeb0e14]of _0x51501a){if(_0xeb0e14[_0x4830e3(0x10f)]>0x1)throw hookDirectoryError(_0x4830e3(0xee),_0x4830e3(0xdb)+_0x28cb5b+_0x4830e3(0xdd)+[..._0xeb0e14[_0x4830e3(0xe8)]()][_0x4830e3(0xf2)](',\x20')+'.',{'datasetCode':_0x28cb5b,'directories':[..._0xeb0e14[_0x4830e3(0xe8)]()]});_0x4b5d16[_0x4830e3(0xf8)](_0x28cb5b,[..._0xeb0e14[_0x4830e3(0xe8)]()][0x0]);}return _0x4b5d16;}export function assertUnambiguousHookDirectoryMappings(_0x19c8c8){const _0x470ee2=a292_0x283d,_0x5338d2=new Map();for(const {alias:_0x58091d,datasetCode:_0x4c9b42}of _0x19c8c8){const _0x276483=directoryIdentity(_0x58091d),_0x4dd781=_0x5338d2[_0x470ee2(0xe7)](_0x276483)??new Set();_0x4dd781[_0x470ee2(0xfc)](_0x4c9b42),_0x5338d2[_0x470ee2(0xf8)](_0x276483,_0x4dd781);}for(const [_0x5ab112,_0x11a702]of _0x5338d2){if(_0x11a702[_0x470ee2(0x10f)]>0x1)throw hookDirectoryError(_0x470ee2(0x108),'HOOK\x20directory\x20\x22'+_0x5ab112+_0x470ee2(0x100),{'directoryName':_0x5ab112,'datasetCodes':[..._0x11a702]});}}export function assertUnambiguousHookAliases(_0x3f73fe){const _0x533c5c=a292_0x283d,_0x4e4336=[..._0x3f73fe],_0x10869a=new Map(),_0xf326ca=new Map();for(const {alias:_0x1fb9c6,datasetCode:_0x5a6c85}of _0x4e4336){const _0x19c7c7=directoryIdentity(_0x1fb9c6),_0x3e2f7c=directoryIdentity(_0x5a6c85),_0x1a380f=_0x10869a[_0x533c5c(0xe7)](_0x19c7c7)??new Set();_0x1a380f[_0x533c5c(0xfc)](_0x5a6c85),_0x10869a[_0x533c5c(0xf8)](_0x19c7c7,_0x1a380f);const _0x1caa8a=_0xf326ca[_0x533c5c(0xe7)](_0x3e2f7c)??new Set();_0x1caa8a['add'](_0x1fb9c6),_0xf326ca[_0x533c5c(0xf8)](_0x3e2f7c,_0x1caa8a);}for(const [_0x4631c2,_0x4a0005]of _0x10869a){if(_0x4a0005['size']>0x1)throw hookDirectoryError(_0x533c5c(0x10e),_0x533c5c(0x104)+_0x4631c2+_0x533c5c(0x100),{'alias':_0x4631c2,'datasetCodes':[..._0x4a0005]});}for(const [_0x13b64e,_0x87e85a]of _0xf326ca){if(_0x87e85a['size']>0x1)throw hookDirectoryError(_0x533c5c(0x10e),_0x533c5c(0xdb)+_0x13b64e+_0x533c5c(0x103),{'datasetCode':_0x13b64e,'aliases':[..._0x87e85a]});}}export function buildHookDirectoryIndexes(_0x3f5692,_0x4a3d90=[]){const _0x188dcd=a292_0x283d,_0x424922=[..._0x4a3d90];assertUnambiguousHookDirectoryMappings(_0x424922[_0x188dcd(0xdf)](([_0x1b14fe,_0x5f2ac4])=>({'alias':_0x1b14fe,'datasetCode':_0x5f2ac4})));const _0x5c8112=new Map(),_0x4f3499=new Map();for(const _0x4ec905 of _0x3f5692){appendUnique(_0x5c8112,directoryIdentity(_0x4ec905[_0x188dcd(0xf7)]),_0x4ec905,_0x1a6a2b=>_0x1a6a2b[_0x188dcd(0xf7)]);}for(const [_0x149321,_0x433d29]of _0x424922){appendUnique(_0x4f3499,directoryIdentity(_0x149321),_0x433d29,_0x199312=>_0x199312);}return{'datasetCodeToDatasets':_0x5c8112,'aliasToDatasetCodes':_0x4f3499};}export function resolvePushHookDirectory(_0x4c8e5b,_0x243ad4,_0x4dcc37){const _0x108904=a292_0x283d,_0x50da12=directoryIdentity(_0x4c8e5b),_0x162c70=_0x4dcc37[_0x108904(0xdc)][_0x108904(0xe7)](_0x50da12)??[],_0x2c83dd=_0x4dcc37[_0x108904(0x10c)][_0x108904(0xe7)](_0x50da12)??[],_0x1c8bac=new Set([..._0x162c70[_0x108904(0xdf)](_0x38359f=>_0x38359f['code']),..._0x2c83dd]);if(_0x1c8bac[_0x108904(0x10f)]>0x1)throw hookDirectoryError('HOOK_DIRECTORY_AMBIGUOUS',_0x108904(0x10d)+_0x4c8e5b+_0x108904(0xf1),{'directoryName':_0x4c8e5b,'datasetCodes':[..._0x1c8bac]});const _0x102f55=[..._0x1c8bac][0x0];if(_0x102f55&&_0x243ad4?.[_0x108904(0x109)]&&_0x102f55!==_0x243ad4['datasetCode'])throw hookDirectoryError('HOOK_MAPPING_DRIFT',_0x108904(0x10d)+_0x4c8e5b+_0x108904(0xef)+_0x243ad4[_0x108904(0x109)]+_0x108904(0xe5)+_0x102f55+'\x22.',{'directoryName':_0x4c8e5b,'datasetCode':_0x102f55,'lockedDatasetCode':_0x243ad4[_0x108904(0x109)]});const _0x3bf9b5=_0x102f55?findDatasetByCode(_0x4dcc37,_0x102f55):undefined,_0x38e7e7=!!_0x102f55&&_0x2c83dd[_0x108904(0xfa)](_0x102f55);if(_0x3bf9b5)return{'dataset':_0x3bf9b5,'datasetCode':_0x3bf9b5[_0x108904(0xf7)],..._0x38e7e7?{'alias':_0x4c8e5b}:{},'directoryProtocol':_0x38e7e7?_0x108904(0xfb):'datasetCode','warnings':[]};const _0x1ed50c=_0x243ad4?.[_0x108904(0x109)];if(_0x1ed50c){const _0x33c24e=findDatasetByCode(_0x4dcc37,_0x1ed50c);if(_0x33c24e)return{'dataset':_0x33c24e,'datasetCode':_0x33c24e[_0x108904(0xf7)],..._0x243ad4[_0x108904(0xfb)]?{'alias':_0x243ad4['alias']}:{},'directoryProtocol':_0x243ad4[_0x108904(0xfb)]?_0x108904(0xfb):'datasetCode','warnings':[]};}if(_0x102f55||_0x1ed50c){const _0x35f91d=_0x102f55??_0x1ed50c;throw hookDirectoryError(_0x108904(0x105),_0x108904(0x10d)+_0x4c8e5b+'\x22\x20points\x20to\x20a\x20Dataset\x20that\x20is\x20absent\x20from\x20current\x20platform\x20metadata.',{'directoryName':_0x4c8e5b,'datasetCode':_0x35f91d});}throw hookDirectoryError(_0x108904(0xff),_0x108904(0x10a)+_0x4c8e5b+_0x108904(0xf5),{'directoryName':_0x4c8e5b});}export function preflightPushHookDirectories(_0x1a566f,_0x36a1ac,_0x43eafc,_0x30a992){const _0x201b65=a292_0x283d,_0x170119=new Map(),_0x2f4613=new Map();for(const _0x3fe057 of _0x1a566f){if(_0x3fe057[_0x201b65(0xfd)]!=='HOOK')continue;const _0x2505f8=_0x3fe057['alias'];if(!_0x2505f8)throw hookDirectoryError(_0x201b65(0xff),_0x201b65(0xf0)+_0x3fe057[_0x201b65(0xea)],{'lockKey':_0x3fe057[_0x201b65(0xea)]});let _0x2ace50;try{_0x2ace50=resolvePushHookDirectory(_0x2505f8,_0x36a1ac[_0x201b65(0xe0)][_0x3fe057[_0x201b65(0xea)]],_0x43eafc);}catch(_0x3d3fd1){if(_0x30a992&&_0x3d3fd1 instanceof CliError&&[_0x201b65(0x105),'HOOK_DIRECTORY_UNRESOLVED'][_0x201b65(0xfa)](_0x3d3fd1[_0x201b65(0xf7)])){_0x30a992[_0x201b65(0xf8)](_0x3fe057[_0x201b65(0xea)],_0x3d3fd1['message']);continue;}throw _0x3d3fd1;}_0x170119['set'](_0x3fe057[_0x201b65(0xea)],_0x2ace50);const _0xa47c34=_0x2f4613[_0x201b65(0xe7)](_0x2ace50['datasetCode'])??new Set();_0xa47c34['add'](_0x2505f8),_0x2f4613[_0x201b65(0xf8)](_0x2ace50[_0x201b65(0x109)],_0xa47c34);}for(const [_0x3df2e8,_0x40bd1f]of _0x2f4613){if(_0x40bd1f[_0x201b65(0x10f)]>0x1)throw hookDirectoryError(_0x201b65(0xee),_0x201b65(0xdb)+_0x3df2e8+_0x201b65(0x106)+[..._0x40bd1f][_0x201b65(0xf2)](',\x20')+'.',{'datasetCode':_0x3df2e8,'directories':[..._0x40bd1f]});}return _0x170119;}export function hookDirectoryError(_0x4f6282,_0x5de4a6,_0x45265){const _0x423840=a292_0x283d,_0x56c0cf=new CliError(_0x4f6282,0x2,_0x4f6282+':\x20'+_0x5de4a6);return _0x56c0cf[_0x423840(0xfe)]=_0x45265,_0x56c0cf;}function a292_0x283d(_0x556fa4,_0x26c462){_0x556fa4=_0x556fa4-0xda;const _0x20965f=a292_0x2096();let _0x283dad=_0x20965f[_0x556fa4];return _0x283dad;}function findDatasetByCode(_0x45e9ec,_0x2a06ca){const _0x25db60=a292_0x283d,_0x23bdb7=_0x45e9ec[_0x25db60(0xdc)]['get'](directoryIdentity(_0x2a06ca))??[];if(_0x23bdb7[_0x25db60(0xe1)]>0x1)throw hookDirectoryError(_0x25db60(0xf4),_0x25db60(0xf9)+_0x2a06ca+_0x25db60(0xeb),{'datasetCode':_0x2a06ca,'candidates':_0x23bdb7[_0x25db60(0xdf)](datasetFact)});return _0x23bdb7[0x0];}function a292_0x2096(){const _0x5c292a=['join','5418TkRQFB','HOOK_DATASET_CODE_AMBIGUOUS','\x22\x20to\x20a\x20Dataset\x20alias\x20or\x20datasetCode.','950471eWMdsk','code','set','Dataset\x20code\x20\x22','includes','alias','add','type','details','HOOK_DIRECTORY_UNRESOLVED','\x22\x20resolves\x20to\x20multiple\x20Datasets.','29593629YUdjHf','8aPEZKp','\x22\x20has\x20multiple\x20SDK\x20aliases\x20and\x20has\x20no\x20unique\x20HOOK\x20directory.','SDK\x20alias\x20\x22','HOOK_DATASET_NOT_FOUND','\x22\x20is\x20represented\x20by\x20multiple\x20HOOK\x20directories:\x20','normalize','HOOK_DIRECTORY_AMBIGUOUS','datasetCode','Cannot\x20resolve\x20HOOK\x20directory\x20\x22','entries','aliasToDatasetCodes','HOOK\x20directory\x20\x22','HOOK_ALIAS_AMBIGUOUS','size','NFC','Dataset\x20\x22','datasetCodeToDatasets','\x22\x20has\x20multiple\x20tracked\x20HOOK\x20directories:\x20','2824661VNKela','map','functions','length','HOOK','name','2082344zCljWm','\x22\x20to\x20\x22','6830GByxno','get','values','299436EMImPt','lockKey','\x22\x20differs\x20only\x20by\x20case\x20from\x20another\x20Dataset\x20code.','2126283VCvTAF','push','HOOK_DUPLICATE_DIRECTORIES','\x22\x20changed\x20mapping\x20from\x20Dataset\x20\x22','Incomplete\x20HOOK\x20path:\x20','\x22\x20collides\x20across\x20datasetCode\x20and\x20alias\x20namespaces.'];a292_0x2096=function(){return _0x5c292a;};return a292_0x2096();}function directoryIdentity(_0x5056e1){const _0x2a79ce=a292_0x283d;return _0x5056e1[_0x2a79ce(0x107)](_0x2a79ce(0xda))['toLowerCase']();}function appendUnique(_0x5adbd0,_0x464b67,_0x144bd2,_0x4e7393){const _0x3b1d08=a292_0x283d,_0x2f767c=_0x5adbd0[_0x3b1d08(0xe7)](_0x464b67)??[];!_0x2f767c['some'](_0xeacf9=>_0x4e7393(_0xeacf9)===_0x4e7393(_0x144bd2))&&_0x2f767c['push'](_0x144bd2),_0x5adbd0['set'](_0x464b67,_0x2f767c);}function datasetFact(_0x4d92fd){const _0x39ef2b=a292_0x283d;return{'id':_0x4d92fd['id'],'name':_0x4d92fd[_0x39ef2b(0xe3)],'datasetCode':_0x4d92fd[_0x39ef2b(0xf7)]};}
|
package/lib/core/bff/lock.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2bc0b7,_0x31b417){const _0x4a3de4=a293_0x3ff2,_0x36f9a3=_0x2bc0b7();while(!![]){try{const _0x426510=parseInt(_0x4a3de4(0x170))/0x1+-parseInt(_0x4a3de4(0x169))/0x2*(-parseInt(_0x4a3de4(0x16f))/0x3)+-parseInt(_0x4a3de4(0x16d))/0x4*(parseInt(_0x4a3de4(0x16a))/0x5)+parseInt(_0x4a3de4(0x15d))/0x6*(-parseInt(_0x4a3de4(0x168))/0x7)+-parseInt(_0x4a3de4(0x16b))/0x8*(parseInt(_0x4a3de4(0x161))/0x9)+-parseInt(_0x4a3de4(0x16c))/0xa*(-parseInt(_0x4a3de4(0x166))/0xb)+parseInt(_0x4a3de4(0x171))/0xc;if(_0x426510===_0x31b417)break;else _0x36f9a3['push'](_0x36f9a3['shift']());}catch(_0x41f88d){_0x36f9a3['push'](_0x36f9a3['shift']());}}}(a293_0x27a0,0xe6536));import{mkdir,readFile,writeFile}from'node:fs/promises';function a293_0x3ff2(_0x221c43,_0x291468){_0x221c43=_0x221c43-0x15b;const _0x27a0b2=a293_0x27a0();let _0x3ff2c2=_0x27a0b2[_0x221c43];return _0x3ff2c2;}import{dirname}from'node:path';function a293_0x27a0(){const _0x407cb2=['Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','\x22.\x20','\x22\x20vs\x20lock\x20\x22','8796zzKkaR','lastSync','functions',':\x20scriptsRoot\x20mismatch\x20—\x20','1755CFIXxV','scriptsRoot','utf8','parse','apps','1705YOZwCQ','Failed\x20to\x20read\x20Backend\x20Function\x20lock\x20file:\x20','4046OFbVvM','3628Qwpcpo','428410xvxpFx','56936JDUoJn','47920NdSfkR','20MfbuZc','current\x20\x22','381ttQVzy','637940HtKaSE','23950908AXyVVk','stringify'];a293_0x27a0=function(){return _0x407cb2;};return a293_0x27a0();}export function createEmptyBffLock(){return{'apps':{}};}export function ensureLockScope(_0x34cd0e,_0x3a3df7,_0x26b862,_0x20bfbb){const _0x5e311b=a293_0x3ff2,_0x4604b0={'apps':_0x34cd0e['apps']&&typeof _0x34cd0e[_0x5e311b(0x165)]==='object'?_0x34cd0e['apps']:{}};let _0x4747c8=_0x4604b0[_0x5e311b(0x165)][_0x3a3df7];if(!_0x4747c8)return _0x4747c8={'scriptsRoot':_0x26b862,'lastSync':'','functions':{}},_0x4604b0['apps'][_0x3a3df7]=_0x4747c8,{'lockData':_0x4604b0,'appLock':_0x4747c8};if(!_0x4747c8[_0x5e311b(0x162)])_0x4747c8[_0x5e311b(0x162)]=_0x26b862;else{if(_0x4747c8[_0x5e311b(0x162)]!==_0x26b862)throw new Error(_0x20bfbb+_0x5e311b(0x160)+(_0x5e311b(0x16e)+_0x26b862+_0x5e311b(0x15c)+_0x4747c8[_0x5e311b(0x162)]+_0x5e311b(0x15b))+_0x5e311b(0x173));}return!_0x4747c8[_0x5e311b(0x15f)]&&(_0x4747c8[_0x5e311b(0x15f)]={}),!_0x4747c8['lastSync']&&(_0x4747c8[_0x5e311b(0x15e)]=''),{'lockData':_0x4604b0,'appLock':_0x4747c8};}export async function readBffLockFile(_0x41f85c){const _0x83808a=a293_0x3ff2;try{const _0x4d12bd=await readFile(_0x41f85c,_0x83808a(0x163)),_0x4308f2=JSON[_0x83808a(0x164)](_0x4d12bd);return{'apps':_0x4308f2[_0x83808a(0x165)]&&typeof _0x4308f2[_0x83808a(0x165)]==='object'?_0x4308f2[_0x83808a(0x165)]:{}};}catch(_0x2bd7ac){if(_0x2bd7ac['code']==='ENOENT')return null;throw new Error(_0x83808a(0x167)+String(_0x2bd7ac));}}export async function writeBffLockFile(_0xc24ae3,_0x2a2ea5){const _0x5e2d78=a293_0x3ff2;await mkdir(dirname(_0xc24ae3),{'recursive':!![]}),await writeFile(_0xc24ae3,JSON[_0x5e2d78(0x172)](_0x2a2ea5,null,0x2),_0x5e2d78(0x163));}
|
package/lib/core/bff/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a295_0x394ded=a295_0x2568;(function(_0x55b13a,_0x1465d2){const _0x17fd70=a295_0x2568,_0x519fa9=_0x55b13a();while(!![]){try{const _0x5c2cc1=-parseInt(_0x17fd70(0x1fb))/0x1+parseInt(_0x17fd70(0x202))/0x2*(parseInt(_0x17fd70(0x1f0))/0x3)+-parseInt(_0x17fd70(0x204))/0x4*(-parseInt(_0x17fd70(0x1f2))/0x5)+parseInt(_0x17fd70(0x1fd))/0x6*(parseInt(_0x17fd70(0x1fa))/0x7)+parseInt(_0x17fd70(0x1f5))/0x8+-parseInt(_0x17fd70(0x1ed))/0x9+parseInt(_0x17fd70(0x1ef))/0xa*(-parseInt(_0x17fd70(0x1ec))/0xb);if(_0x5c2cc1===_0x1465d2)break;else _0x519fa9['push'](_0x519fa9['shift']());}catch(_0x41889e){_0x519fa9['push'](_0x519fa9['shift']());}}}(a295_0x5c1f,0x34a7f));function a295_0x2568(_0x1d8251,_0x25516f){_0x1d8251=_0x1d8251-0x1eb;const _0x5c1f23=a295_0x5c1f();let _0x256895=_0x5c1f23[_0x1d8251];return _0x256895;}export const DEFAULT_BFF_SCRIPT_DESCRIPTION=a295_0x394ded(0x1f4);function a295_0x5c1f(){const _0x2f8db6=['1208487iCUzZN','test','5eIQxtq','entries','TODO:\x20补充脚本功能描述','1010744NBvUQa','some','operationType','replace','remoteId','196VqyqGb','226206XKhzIh','TODO:\x20add\x20script\x20description','33414TKFBts','map','functionNode','match','split','2HpPTjk','toLowerCase','632284JCVznG','after','trim','1782ORYXCo','1676844BURgex','datasetCode','13270imrJoS'];a295_0x5c1f=function(){return _0x2f8db6;};return a295_0x5c1f();}const LEGACY_DEFAULT_BFF_SCRIPT_DESCRIPTION=a295_0x394ded(0x1fc);export function snakeToCamel(_0x449005){const _0x3b7754=a295_0x394ded;return _0x449005[_0x3b7754(0x203)]()['replace'](/_([a-z])/g,(_0x1d6780,_0xadd4c2)=>_0xadd4c2['toUpperCase']());}export function findHookLocationByRemoteId(_0x153802,_0x3d1ba8){const _0x35a990=a295_0x394ded;if(!_0x3d1ba8)return undefined;for(const [_0x21545a,_0x21d955]of Object[_0x35a990(0x1f3)](_0x153802)){if(_0x21d955[_0x35a990(0x1f9)]===_0x3d1ba8&&_0x21d955['datasetCode']&&_0x21d955[_0x35a990(0x1f7)]&&_0x21d955[_0x35a990(0x1ff)]){const _0x474206=_0x21545a[_0x35a990(0x201)]('/')[0x1];return{'alias':_0x474206||_0x21d955['alias'],'datasetCode':_0x21d955[_0x35a990(0x1ee)],'operationType':_0x21d955['operationType'],'functionNode':_0x21d955[_0x35a990(0x1ff)]};}}return undefined;}export function extractScriptDescription(_0x1f1f32){const _0x2cc347=a295_0x394ded,_0x4eb88f=_0x1f1f32['match'](/^\s*\/\*\*([\s\S]*?)\*\//);if(!_0x4eb88f?.[0x1])return undefined;const _0x2f0a59=_0x4eb88f[0x1],_0xad86b0=_0x4a785c=>{const _0x10a138=_0x4a785c?.['trim']();if(!_0x10a138||_0x10a138===DEFAULT_BFF_SCRIPT_DESCRIPTION||_0x10a138===LEGACY_DEFAULT_BFF_SCRIPT_DESCRIPTION)return undefined;return _0x10a138;},_0x7343d0=_0x2f0a59[_0x2cc347(0x200)](/^\s*\*\s*\[\s*脚本描述\s*]\s*(.+)$/m);if(_0x7343d0)return _0xad86b0(_0x7343d0[0x1]);const _0x16dfe6=_0x2f0a59[_0x2cc347(0x201)](/\r?\n/)[_0x2cc347(0x1fe)](_0x197f82=>_0x197f82[_0x2cc347(0x1f8)](/^\s*\*\s?/,'')[_0x2cc347(0x1eb)]()),_0x2fc069=_0x16dfe6[_0x2cc347(0x1f6)](_0x1e5803=>/^\[\s*脚本类型\s*]\s*\S+/[_0x2cc347(0x1f1)](_0x1e5803))&&_0x16dfe6[_0x2cc347(0x1f6)](_0x2aed42=>/^\[\s*脚本名称\s*]\s*\S+/[_0x2cc347(0x1f1)](_0x2aed42));if(!_0x2fc069)return undefined;for(const _0x26d67d of _0x16dfe6){if(!_0x26d67d||_0x26d67d['startsWith']('@')||/^\[[^\]]+]\s*/[_0x2cc347(0x1f1)](_0x26d67d))continue;return _0xad86b0(_0x26d67d);}return undefined;}export function isValidBffFunctionName(_0x549e63){const _0x5985d3=a295_0x394ded;return/^[A-Za-z_$][A-Za-z0-9_$]*$/[_0x5985d3(0x1f1)](_0x549e63);}export function normalizeHookFunctionNode(_0x2c146d){const _0x3e0807=a295_0x394ded;if(!_0x2c146d)return undefined;const _0x11e789=_0x2c146d['trim']()[_0x3e0807(0x203)]();if(_0x11e789==='before'||_0x11e789===_0x3e0807(0x205))return _0x11e789;return undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a296_0x32ad(_0x53d057,_0x354d8e){_0x53d057=_0x53d057-0x98;const _0x56930b=a296_0x5693();let _0x32ad01=_0x56930b[_0x53d057];return _0x32ad01;}const a296_0x8a0e11=a296_0x32ad;function a296_0x5693(){const _0x3ba4f7=['10948okFsCE','758532NnVFxx','519880HujLlV','/smartapi/db-analysis/cross-db/status','5301189Wpuajw','41838258bwpKTM','/smartapi/db-analysis/cross-db/latest-job','2455BUQpgl','2OmBGtH','6hlsSRQ','8783950VsHTib','/smartapi/db-analysis/cross-db/start','8udQydW','4828971KlCTlc'];a296_0x5693=function(){return _0x3ba4f7;};return a296_0x5693();}(function(_0x1a4e25,_0x2d76cb){const _0x49efa7=a296_0x32ad,_0x161249=_0x1a4e25();while(!![]){try{const _0x243a0a=-parseInt(_0x49efa7(0x9f))/0x1+parseInt(_0x49efa7(0xa5))/0x2*(-parseInt(_0x49efa7(0x9e))/0x3)+parseInt(_0x49efa7(0x9d))/0x4*(-parseInt(_0x49efa7(0xa4))/0x5)+-parseInt(_0x49efa7(0x98))/0x6*(-parseInt(_0x49efa7(0x9c))/0x7)+parseInt(_0x49efa7(0x9b))/0x8*(-parseInt(_0x49efa7(0xa1))/0x9)+-parseInt(_0x49efa7(0x99))/0xa+parseInt(_0x49efa7(0xa2))/0xb;if(_0x243a0a===_0x2d76cb)break;else _0x161249['push'](_0x161249['shift']());}catch(_0x1c5be6){_0x161249['push'](_0x161249['shift']());}}}(a296_0x5693,0xde00c));export const CROSS_DB_ANALYSIS_PATHS={'start':a296_0x8a0e11(0x9a),'status':a296_0x8a0e11(0xa0),'latest':a296_0x8a0e11(0xa3)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a297_0x183f98=a297_0x4d50;(function(_0x3a8921,_0x1ce420){const _0x31aa70=a297_0x4d50,_0x26e227=_0x3a8921();while(!![]){try{const _0x3d6d8b=parseInt(_0x31aa70(0x98))/0x1+-parseInt(_0x31aa70(0x9d))/0x2+-parseInt(_0x31aa70(0x99))/0x3+-parseInt(_0x31aa70(0x93))/0x4*(parseInt(_0x31aa70(0x97))/0x5)+-parseInt(_0x31aa70(0x96))/0x6*(parseInt(_0x31aa70(0x9a))/0x7)+-parseInt(_0x31aa70(0x9b))/0x8+parseInt(_0x31aa70(0x94))/0x9;if(_0x3d6d8b===_0x1ce420)break;else _0x26e227['push'](_0x26e227['shift']());}catch(_0x4e1a49){_0x26e227['push'](_0x26e227['shift']());}}}(a297_0x280e,0x1e595));function a297_0x4d50(_0xb55202,_0x372a70){_0xb55202=_0xb55202-0x93;const _0x280e79=a297_0x280e();let _0x4d5044=_0x280e79[_0xb55202];return _0x4d5044;}function a297_0x280e(){const _0x1dd7c3=['42520FgBSSD','416592lZHOGW','3393081FZmDES','/smartapi/cross-db-relation/query','1416WLTpjZ','10nWjsyk','153729iTrebv','141852mDzyGt','1092qzxIUx','742184lOlPDZ','/smartapi/cross-db-relation/delete'];a297_0x280e=function(){return _0x1dd7c3;};return a297_0x280e();}export const CROSS_DB_RELATION_PATHS={'list':a297_0x183f98(0x95),'create':'/smartapi/cross-db-relation/create','update':'/smartapi/cross-db-relation/update','delete':a297_0x183f98(0x9c)};
|
package/lib/core/db-resolver.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4e3c08,_0x3cf9b9){const _0x26adc6=a298_0x4ef0,_0x4f179c=_0x4e3c08();while(!![]){try{const _0x4bcaf1=parseInt(_0x26adc6(0x11c))/0x1*(-parseInt(_0x26adc6(0x12b))/0x2)+-parseInt(_0x26adc6(0x136))/0x3+-parseInt(_0x26adc6(0x12e))/0x4*(parseInt(_0x26adc6(0x135))/0x5)+parseInt(_0x26adc6(0x124))/0x6*(-parseInt(_0x26adc6(0x138))/0x7)+-parseInt(_0x26adc6(0x12a))/0x8*(-parseInt(_0x26adc6(0x12c))/0x9)+-parseInt(_0x26adc6(0x130))/0xa+-parseInt(_0x26adc6(0x12f))/0xb*(-parseInt(_0x26adc6(0x133))/0xc);if(_0x4bcaf1===_0x3cf9b9)break;else _0x4f179c['push'](_0x4f179c['shift']());}catch(_0x1fb16e){_0x4f179c['push'](_0x4f179c['shift']());}}}(a298_0x215d,0x3fd8d));function a298_0x4ef0(_0x348ec7,_0x7d8905){_0x348ec7=_0x348ec7-0x11b;const _0x215dc0=a298_0x215d();let _0x4ef066=_0x215dc0[_0x348ec7];return _0x4ef066;}import{listDatasets}from'../core/api-client.js';const cache=new Map();export async function listDatabases(_0xc82539){const _0x2e6812=a298_0x4ef0;if(cache[_0x2e6812(0x11d)](_0xc82539))return cache[_0x2e6812(0x122)](_0xc82539);const _0x52aad7=await listDatasets(_0xc82539),_0x422801=new Map();for(const _0x3dfa47 of _0x52aad7){const _0x2931ac=_0x3dfa47[_0x2e6812(0x11b)];_0x2931ac?.[_0x2e6812(0x134)]!=null&&_0x422801[_0x2e6812(0x123)](_0x2931ac[_0x2e6812(0x134)],_0x2931ac[_0x2e6812(0x12d)]??_0x2e6812(0x13b)+_0x2931ac[_0x2e6812(0x134)]);}const _0x27e9ef=[..._0x422801[_0x2e6812(0x11f)]()][_0x2e6812(0x13a)](([_0x4aecf3,_0x5531ff])=>({'dbId':_0x4aecf3,'dbName':_0x5531ff}));return cache['set'](_0xc82539,_0x27e9ef),_0x27e9ef;}export async function resolveDb(_0x2ff3cf,_0x47f116){const _0x211d14=a298_0x4ef0,_0x2d3b34=await listDatabases(_0x2ff3cf);if(_0x2d3b34[_0x211d14(0x127)]===0x0)return{'resolved':[],'error':_0x211d14(0x139)+_0x2ff3cf+_0x211d14(0x11e)};if(!_0x47f116)return{'resolved':_0x2d3b34};const _0x3265b6=Number(_0x47f116);if(!Number['isNaN'](_0x3265b6)){const _0x36bc25=_0x2d3b34[_0x211d14(0x128)](_0x3afa6c=>_0x3afa6c[_0x211d14(0x134)]===_0x3265b6);if(_0x36bc25)return{'resolved':[_0x36bc25]};}const _0x569127=_0x47f116['toLowerCase'](),_0x5ea694=_0x2d3b34[_0x211d14(0x129)](_0x210daa=>_0x210daa[_0x211d14(0x12d)][_0x211d14(0x131)]()['includes'](_0x569127));if(_0x5ea694[_0x211d14(0x127)]>0x0)return{'resolved':_0x5ea694};const _0x4acdbb=_0x2d3b34[_0x211d14(0x13a)](_0x141a78=>_0x141a78[_0x211d14(0x12d)]+'\x20('+_0x141a78[_0x211d14(0x134)]+')')[_0x211d14(0x132)](',\x20');return{'resolved':[],'error':_0x211d14(0x125)+_0x47f116+_0x211d14(0x121)+_0x2ff3cf+_0x211d14(0x120)+_0x4acdbb+'.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.'};}export async function resolveOneDb(_0x8c5662,_0x1240a7){const _0x15c8a0=a298_0x4ef0,{resolved:_0x36d24b,error:_0x3cc5c4}=await resolveDb(_0x8c5662,_0x1240a7);if(_0x3cc5c4)return{'db':null,'error':_0x3cc5c4};if(_0x36d24b[_0x15c8a0(0x127)]===0x1)return{'db':_0x36d24b[0x0]};if(!_0x1240a7){const _0x3ce7a9=_0x36d24b[_0x15c8a0(0x13a)](_0xd44d1=>_0xd44d1[_0x15c8a0(0x12d)]+'\x20('+_0xd44d1[_0x15c8a0(0x134)]+')')[_0x15c8a0(0x132)](',\x20');return{'db':null,'error':'Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20'+_0x3ce7a9};}const _0x4834a6=_0x36d24b['map'](_0xc5384b=>_0xc5384b[_0x15c8a0(0x12d)]+'\x20('+_0xc5384b[_0x15c8a0(0x134)]+')')[_0x15c8a0(0x132)](',\x20');return{'db':null,'error':'\x22'+_0x1240a7+_0x15c8a0(0x126)+_0x4834a6+_0x15c8a0(0x137)};}function a298_0x215d(){const _0x2c5c40=['toLowerCase','join','23165796gbhhGb','dbId','1205bpjXkt','451629ojCkpQ','.\x20Be\x20more\x20specific.','237538JhXbyJ','No\x20linked\x20databases\x20found\x20under\x20app\x20\x22','map','db-','dbtableConfig','414398zlLjGk','has','\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.','entries','\x22.\x20Available:\x20','\x22\x20under\x20app\x20\x22','get','set','66ZcIjHx','No\x20database\x20matching\x20\x22','\x22\x20matches\x20multiple\x20databases:\x20','length','find','filter','8uaQFqL','2xoJyLs','1003581lykwaY','dbName','8132kAwQUX','11xrvOFw','3523070oJJPmY'];a298_0x215d=function(){return _0x2c5c40;};return a298_0x215d();}export async function getDbName(_0x5f10a6,_0x5d5ba0){const _0x3324a4=a298_0x4ef0,_0x524dde=await listDatabases(_0x5f10a6);return _0x524dde['find'](_0xe9401b=>_0xe9401b[_0x3324a4(0x134)]===_0x5d5ba0)?.[_0x3324a4(0x12d)];}
|