@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
package/README.md
CHANGED
|
@@ -133,6 +133,7 @@ rabetbase config init --domain-config ./lovrabet-domains.json
|
|
|
133
133
|
"default": "https://kb.customer.example.com",
|
|
134
134
|
"rabetbase-cli": "https://kb-admin.customer.example.com"
|
|
135
135
|
},
|
|
136
|
+
"kbServiceDomain": "https://kb-service.customer.example.com",
|
|
136
137
|
"appDomain": "https://app.customer.example.com"
|
|
137
138
|
}
|
|
138
139
|
}
|
|
@@ -266,3 +267,13 @@ Important options:
|
|
|
266
267
|
## License
|
|
267
268
|
|
|
268
269
|
Licensed under the terms in `LICENSE`.
|
|
270
|
+
|
|
271
|
+
### Direct knowledge search (V2)
|
|
272
|
+
|
|
273
|
+
`rabetbase kb search` calls KB Service V2 directly. Official Mainland China and Indonesia connections resolve the endpoint automatically; independent deployments use their configured `kbServiceDomain`:
|
|
274
|
+
|
|
275
|
+
```sh
|
|
276
|
+
rabetbase kb search --appcode app-xxxxx --query "business rules" --format json
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
V2 sends the current developer Cookie directly to `/v2/development/apps/{appCode}/knowledge/search` and returns public/company knowledge. `--kb-service-url` can override the trusted HTTPS origin for one request without persisting it. Global has no registered KB endpoint and does not borrow another region's address. Missing routes fail closed; redirects and switching endpoints after request failures are disabled. KB management commands keep their existing `kbDomain` routing. See [KB workflow](skills/rabetbase/references/rabetbase-kb.md).
|
package/lib/api/api-doc.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a0_0x50bb2f=a0_0x378f;(function(_0x46f40c,_0x12107b){const _0x2225ee=a0_0x378f,_0x4a94e7=_0x46f40c();while(!![]){try{const _0x5b9a39=parseInt(_0x2225ee(0x1e9))/0x1+-parseInt(_0x2225ee(0x1e8))/0x2*(-parseInt(_0x2225ee(0x1d4))/0x3)+-parseInt(_0x2225ee(0x1d6))/0x4*(parseInt(_0x2225ee(0x1de))/0x5)+-parseInt(_0x2225ee(0x1ec))/0x6+parseInt(_0x2225ee(0x1f0))/0x7*(-parseInt(_0x2225ee(0x1df))/0x8)+-parseInt(_0x2225ee(0x1da))/0x9*(parseInt(_0x2225ee(0x1e0))/0xa)+parseInt(_0x2225ee(0x1dd))/0xb*(parseInt(_0x2225ee(0x1d9))/0xc);if(_0x5b9a39===_0x12107b)break;else _0x4a94e7['push'](_0x4a94e7['shift']());}catch(_0x957af2){_0x4a94e7['push'](_0x4a94e7['shift']());}}}(a0_0x58b0,0x19ea5));import{mkdirSync,writeFileSync}from'node:fs';import a0_0x138273 from'node:path';import{fetchDatasetDoc}from'../core/api-client.js';function a0_0x58b0(){const _0x53f8c3=['datasetCode','3kmgAkH','length','28JUeTOw','log','api-doc','90144mlANwe','421983eGQrUF','Waiting\x203\x20seconds...\x0a','push','583KqoeZP','93570fFxIFD','22328WBxvRo','30HilwCs','✗\x20Failed:\x20','name','success','✓\x20Generated:\x20','.md',']\x20Generating:\x20','Failed\x20to\x20generate\x20docs:\x20','383840syigkH','170213wRPxyx','Generated\x20docs\x20successfully:\x20','join','1156038yXScFM','message','error','./docs','476ZpssVQ','utf8'];a0_0x58b0=function(){return _0x53f8c3;};return a0_0x58b0();}function a0_0x378f(_0x195c1c,_0x32fb0b){_0x195c1c=_0x195c1c-0x1d3;const _0x58b064=a0_0x58b0();let _0x378ff5=_0x58b064[_0x195c1c];return _0x378ff5;}import{logger}from'../utils/logger.js';export{fetchDatasetDoc}from'../core/api-client.js';function delay(_0x15662a){return new Promise(_0x74dbd2=>setTimeout(_0x74dbd2,_0x15662a));}export async function generateDatasetDocs(_0x52cb60,_0x14f2b3,_0x29007a,_0x3e934d=a0_0x50bb2f(0x1ef),_0x12a215,_0x197535){const _0x50f0d3=a0_0x50bb2f;mkdirSync(_0x3e934d,{'recursive':!![]});const _0x3266a6=[],_0x18a981=_0x52cb60[_0x50f0d3(0x1d5)];console[_0x50f0d3(0x1d7)]('\x0a'+_0x18a981+'\x20datasets\x20to\x20generate\x20docs\x20for\x0a');for(let _0x3a82ce=0x0;_0x3a82ce<_0x52cb60['length'];_0x3a82ce++){const _0x145023=_0x52cb60[_0x3a82ce],_0xcb78df=_0x3a82ce+0x1,_0x45fbe0=_0x145023['tableName'];try{console[_0x50f0d3(0x1d7)]('['+_0xcb78df+'/'+_0x18a981+_0x50f0d3(0x1e6)+_0x45fbe0+'.md\x20('+_0x145023['name']+')');if(_0x12a215)_0x12a215(_0xcb78df,_0x18a981,_0x45fbe0);const _0x1a880d=await fetchDatasetDoc({'appCode':_0x14f2b3,'cookie':_0x29007a,'datasetCode':_0x145023['datasetCode'],'datasetId':_0x145023['id'],'enableAI':![],'extraParams':_0x197535}),_0x115adb=a0_0x138273[_0x50f0d3(0x1eb)](_0x3e934d,_0x45fbe0+'.md');writeFileSync(_0x115adb,_0x1a880d,{'encoding':_0x50f0d3(0x1f1)}),console[_0x50f0d3(0x1d7)](_0x50f0d3(0x1e4)+_0x45fbe0+_0x50f0d3(0x1e5)),logger[_0x50f0d3(0x1e3)](_0x50f0d3(0x1d8),_0x50f0d3(0x1ea)+_0x45fbe0,undefined,{'datasetCode':_0x145023[_0x50f0d3(0x1d3)],'datasetName':_0x145023[_0x50f0d3(0x1e2)],'filePath':_0x115adb,'progress':_0xcb78df+'/'+_0x18a981}),_0x3266a6[_0x50f0d3(0x1dc)]({'datasetCode':_0x145023[_0x50f0d3(0x1d3)],'datasetName':_0x145023['name'],'filePath':_0x115adb,'success':!![]});if(_0xcb78df<_0x18a981)await delay(0x1388);}catch(_0x73b4be){const _0x192f68=_0x73b4be instanceof Error?_0x73b4be[_0x50f0d3(0x1ed)]:String(_0x73b4be);console[_0x50f0d3(0x1d7)](_0x50f0d3(0x1e1)+_0x45fbe0+'.md\x20-\x20'+_0x192f68),logger[_0x50f0d3(0x1ee)](_0x50f0d3(0x1d8),_0x50f0d3(0x1e7)+_0x145023['datasetCode'],{'datasetCode':_0x145023[_0x50f0d3(0x1d3)],'datasetName':_0x145023[_0x50f0d3(0x1e2)],'error':_0x192f68,'progress':_0xcb78df+'/'+_0x18a981}),_0x3266a6[_0x50f0d3(0x1dc)]({'datasetCode':_0x145023['datasetCode'],'datasetName':_0x145023[_0x50f0d3(0x1e2)],'filePath':'','success':![],'error':_0x192f68}),_0xcb78df<_0x18a981&&(console['log'](_0x50f0d3(0x1db)),await delay(0xbb8));}}return _0x3266a6;}
|
package/lib/api/api-group.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a1_0x1cd32b=a1_0x1546;(function(_0x2196c7,_0x1b04e0){const _0x195fce=a1_0x1546,_0x2d827d=_0x2196c7();while(!![]){try{const _0x3f41f1=parseInt(_0x195fce(0x1bd))/0x1*(-parseInt(_0x195fce(0x1d7))/0x2)+parseInt(_0x195fce(0x1c0))/0x3+-parseInt(_0x195fce(0x1d9))/0x4*(-parseInt(_0x195fce(0x1c6))/0x5)+parseInt(_0x195fce(0x1c7))/0x6*(-parseInt(_0x195fce(0x1cd))/0x7)+-parseInt(_0x195fce(0x1d1))/0x8+-parseInt(_0x195fce(0x1d2))/0x9*(-parseInt(_0x195fce(0x1c9))/0xa)+-parseInt(_0x195fce(0x1c5))/0xb;if(_0x3f41f1===_0x1b04e0)break;else _0x2d827d['push'](_0x2d827d['shift']());}catch(_0x17b882){_0x2d827d['push'](_0x2d827d['shift']());}}}(a1_0x1422,0x1c076));import a1_0x310b8c from'node:path';import{CliErrors}from'../errors.js';export function normalizeApiDir(_0x4add3b,_0x58b549=process[a1_0x1cd32b(0x1d3)]()){const _0x48c900=a1_0x1cd32b;return a1_0x310b8c[_0x48c900(0x1ca)](_0x58b549,_0x4add3b);}function a1_0x1546(_0x3bdc32,_0x56c54e){_0x3bdc32=_0x3bdc32-0x1bc;const _0x142226=a1_0x1422();let _0x154613=_0x142226[_0x3bdc32];return _0x154613;}function normalizedApiGroup(_0x45c6de){const _0x10ca43=a1_0x1cd32b,_0x5508ef=_0x45c6de?.[_0x10ca43(0x1d4)]();return _0x5508ef||undefined;}function a1_0x1422(){const _0x5bed88=['API\x20directory\x20\x22','normalizedApiDir','values','442376LAUJex','57835ptoxyG','966EIsZHI','outputDir','271000NEIEdk','resolve','some','\x22\x20resolves\x20to\x20multiple\x20API\x20directories.','1645jUFgPU','API\x20group\x20\x22','flatMap','\x22\x20is\x20assigned\x20to\x20incompatible\x20API\x20groups.','12472nfJeqY','45mOqnTm','cwd','trim','get','apiGroup','842XZSLuL','size','4prAaVr','Profiles\x20sharing\x20one\x20apiDir\x20must\x20use\x20the\x20same\x20explicit\x20apiGroup.\x20Conflicting\x20profiles:\x20','.\x20Use\x20a\x20different\x20apiDir\x20for\x20a\x20separate\x20API.','add','validation','143gHHXah','filter','map','322656niPzjv','set'];a1_0x1422=function(){return _0x5bed88;};return a1_0x1422();}export function resolveApiProfileLayouts(_0x31173a,_0x3cc7a1,_0x40cc7d=process[a1_0x1cd32b(0x1d3)]()){const _0xcaa301=a1_0x1cd32b,_0x5bd07c=_0x31173a[_0xcaa301(0x1bf)](_0x24372f=>{const _0x5e4ca1=_0xcaa301,_0x16d688=_0x3cc7a1(_0x24372f);return{'app':_0x24372f,'outputDir':_0x16d688,'normalizedApiDir':normalizeApiDir(_0x16d688,_0x40cc7d),'apiGroup':normalizedApiGroup(_0x24372f[_0x5e4ca1(0x1d6)])};}),_0x5a298d=new Map();for(const _0x56294c of _0x5bd07c){if(!_0x56294c[_0xcaa301(0x1d6)])continue;const _0x10d2b6=_0x5a298d[_0xcaa301(0x1d5)](_0x56294c[_0xcaa301(0x1d6)])??new Set();_0x10d2b6[_0xcaa301(0x1dc)](_0x56294c[_0xcaa301(0x1c3)]),_0x5a298d[_0xcaa301(0x1c1)](_0x56294c[_0xcaa301(0x1d6)],_0x10d2b6);}for(const [_0x1cca14,_0x187e33]of _0x5a298d){if(_0x187e33[_0xcaa301(0x1d8)]>0x1)throw CliErrors[_0xcaa301(0x1bc)](_0xcaa301(0x1ce)+_0x1cca14+_0xcaa301(0x1cc),'Profiles\x20in\x20the\x20same\x20API\x20group\x20must\x20use\x20the\x20same\x20apiDir.');}const _0x3387d1=new Map();for(const _0xa330fe of _0x5bd07c){const _0xf92a41=_0x3387d1['get'](_0xa330fe[_0xcaa301(0x1c3)])??[];_0xf92a41['push'](_0xa330fe),_0x3387d1[_0xcaa301(0x1c1)](_0xa330fe[_0xcaa301(0x1c3)],_0xf92a41);}for(const _0x3a63d6 of _0x3387d1[_0xcaa301(0x1c4)]()){const _0x619633=new Set(_0x3a63d6[_0xcaa301(0x1cf)](_0x51a26d=>_0x51a26d['apiGroup']?[_0x51a26d[_0xcaa301(0x1d6)]]:[]));if(_0x619633[_0xcaa301(0x1d8)]===0x0)continue;if(_0x619633[_0xcaa301(0x1d8)]>0x1||_0x3a63d6[_0xcaa301(0x1cb)](_0x5805d4=>!_0x5805d4[_0xcaa301(0x1d6)])){const _0x7d1995=_0x3a63d6[_0xcaa301(0x1bf)](_0x13c77b=>_0x13c77b['app']['name'])['join'](',\x20');throw CliErrors['validation'](_0xcaa301(0x1c2)+_0x3a63d6[0x0][_0xcaa301(0x1c8)]+_0xcaa301(0x1d0),_0xcaa301(0x1da)+_0x7d1995+_0xcaa301(0x1db));}}return _0x5bd07c;}export function getRegistryGroup(_0x471126,_0x79591){const _0x5af528=a1_0x1cd32b;if(_0x79591[_0x5af528(0x1d6)])return _0x471126['filter'](_0x576bc7=>_0x576bc7[_0x5af528(0x1d6)]===_0x79591[_0x5af528(0x1d6)]);const _0x1fa622=_0x471126[_0x5af528(0x1be)](_0x2c6631=>_0x2c6631[_0x5af528(0x1c3)]===_0x79591[_0x5af528(0x1c3)]);return _0x1fa622['length']===0x1?_0x1fa622:undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1755c7,_0xdddefc){var _0x37c8f8=a2_0x3715,_0x2c9ea8=_0x1755c7();while(!![]){try{var _0x448992=parseInt(_0x37c8f8(0x8c))/0x1+parseInt(_0x37c8f8(0x91))/0x2+parseInt(_0x37c8f8(0x8f))/0x3+-parseInt(_0x37c8f8(0x8e))/0x4*(-parseInt(_0x37c8f8(0x95))/0x5)+-parseInt(_0x37c8f8(0x94))/0x6*(-parseInt(_0x37c8f8(0x90))/0x7)+-parseInt(_0x37c8f8(0x92))/0x8+parseInt(_0x37c8f8(0x8d))/0x9*(-parseInt(_0x37c8f8(0x93))/0xa);if(_0x448992===_0xdddefc)break;else _0x2c9ea8['push'](_0x2c9ea8['shift']());}catch(_0x250dbd){_0x2c9ea8['push'](_0x2c9ea8['shift']());}}}(a2_0x813a,0xe9ce8));export{fetchModelList}from'../core/api-client.js';function a2_0x3715(_0x35325b,_0x128bf5){_0x35325b=_0x35325b-0x8c;var _0x813a62=a2_0x813a();var _0x37155c=_0x813a62[_0x35325b];return _0x37155c;}function a2_0x813a(){var _0x2e30b2=['11669EeTwjQ','699452GvITnB','11564432pZKRPA','50nFuIMU','5604QhFoDr','5yynePU','837794VVqKEU','3881979trXpAy','4714820zwMuYg','1910034ylRfaB'];a2_0x813a=function(){return _0x2e30b2;};return a2_0x813a();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a3_0x19e9(_0x204524,_0x21e559){_0x204524=_0x204524-0xa0;const _0x29f28a=a3_0x29f2();let _0x19e9e6=_0x29f28a[_0x204524];return _0x19e9e6;}(function(_0xa5866f,_0x4fed1b){const _0x4d58fc=a3_0x19e9,_0x2f062a=_0xa5866f();while(!![]){try{const _0x448930=-parseInt(_0x4d58fc(0xc2))/0x1*(-parseInt(_0x4d58fc(0xc0))/0x2)+parseInt(_0x4d58fc(0xb7))/0x3*(parseInt(_0x4d58fc(0xa2))/0x4)+-parseInt(_0x4d58fc(0xa3))/0x5*(-parseInt(_0x4d58fc(0xd2))/0x6)+parseInt(_0x4d58fc(0xb0))/0x7+parseInt(_0x4d58fc(0xa1))/0x8+-parseInt(_0x4d58fc(0xc7))/0x9+-parseInt(_0x4d58fc(0xa8))/0xa;if(_0x448930===_0x4fed1b)break;else _0x2f062a['push'](_0x2f062a['shift']());}catch(_0x228203){_0x2f062a['push'](_0x2f062a['shift']());}}}(a3_0x29f2,0x9f27c));import a3_0x20c2ee from'prettier';import{existsSync,mkdirSync,writeFileSync,readFileSync}from'node:fs';import a3_0x536ee1 from'node:path';import{fileURLToPath}from'node:url';import{TemplateReplacer}from'../utils/template-replacer.js';import{CLI_BIN_NAME}from'../constant/cli.js';function a3_0x29f2(){const _0x263556=['alias','test','-client','\x20config\x20set\x20app\x20<value>`','scaffoldMode','CONFIG_NAMES.DEFAULT','key','overwritten','created','6VXafif',',\x20env:\x20','name','preserved','defaultName','none','typescript','client','api','LOVRABET_RUNTIME_DOMAIN','default','replace','refreshed','stringify','missing','.ts','7913168dOdFuJ','480596gaaOiy','4020995vRMoUa','basename','utf8','success','dirname','26083690azbHDs','API\x20scaffold\x20written.','join','init-api','overwriteTypescript','resolve','toUpperCase','../..','2894178bRSKel','modelRuntime','tableName','Please\x20configure\x20app\x20code\x20first\x20via\x20`','includes','length','modelProfile','15rHMWpt','{\x20apiConfigName:\x20','client.ts.tpl','-api','datasetCode','\x20refreshed;\x20existing\x20TypeScript\x20left\x20unchanged.','runtimeDomain','replaceApiContent','APP_','4OkPNjs','api.ts.tpl','540644cOufza','action','format',',\x20...LOVRABET_SDK_CONFIG\x20}','Model\x20facts\x20refreshed.','5657067oIeToM','path'];a3_0x29f2=function(){return _0x263556;};return a3_0x29f2();}import{logger}from'../utils/logger.js';import{isProduction}from'../constant/env.js';import{generateSdkConfigFile}from'../api/generate-sdk-config-file.js';import{MODEL_REGISTRY_FILE_NAME,MODEL_RUNTIME_FILE_NAME,updateModelRegistry}from'../api/model-registry-file.js';import{renderModelRegistryScaffold}from'../api/model-registry-scaffold.js';function fileAction(_0x153f27,_0x157cdb){const _0xfa41b8=a3_0x19e9;if(!_0x157cdb)return _0x153f27?_0xfa41b8(0xd5):_0xfa41b8(0xe0);return _0x153f27?_0xfa41b8(0xd0):_0xfa41b8(0xd1);}export async function generateApiFile(_0x85eaa1,_0x3ba2ff,_0x5e4d53,_0x323d98,_0x583c86,_0x2ac341,_0x6d880b,_0x17370c={},_0x5f5cb2={}){const _0x3d8d93=a3_0x19e9;if(!_0x5e4d53)throw new Error(_0x3d8d93(0xb3)+CLI_BIN_NAME+_0x3d8d93(0xcc));const _0x21648f=_0x323d98&&!_0x6d880b,_0x34dfd8=!!_0x5f5cb2['modelProfile'],_0x107668=_0x34dfd8||_0x21648f,_0x593c2d=_0x6d880b||_0x5e4d53,_0x3ca915=_0x34dfd8||_0x21648f?_0x3d8d93(0xdc):_0x593c2d,_0x37ad1c=_0x34dfd8||_0x21648f?_0x3d8d93(0xce):JSON[_0x3d8d93(0xdf)](_0x593c2d),_0x5d15de=!isProduction(_0x583c86),_0x493ed8=_0x5d15de?_0x3d8d93(0xd3)+JSON['stringify'](_0x583c86):'',_0x5532ac=_0x3d8d93(0xb8)+_0x37ad1c+_0x493ed8+_0x3d8d93(0xc5),_0x4182c6=_0x34dfd8?'':_0x3ba2ff,_0x14ce5e=_0x4182c6?_0x4182c6+_0x3d8d93(0xba):_0x3d8d93(0xda),_0x22ea31=_0x4182c6?_0x4182c6+_0x3d8d93(0xcb):_0x3d8d93(0xd9),_0xa409ea=_0x4182c6&&!/^app-[a-f0-9]+$/i[_0x3d8d93(0xca)](_0x4182c6)?_0x4182c6['replace'](/-/g,'_')[_0x3d8d93(0xae)]():'LOVRABET',_0x39e08c=/^\d/[_0x3d8d93(0xca)](_0xa409ea)?_0x3d8d93(0xbf)+_0xa409ea:_0xa409ea,_0x2ede72=_0x85eaa1['map'](_0x71f1f=>({'datasetCode':_0x71f1f[_0x3d8d93(0xbb)],'tableName':_0x71f1f[_0x3d8d93(0xb2)],'name':_0x71f1f[_0x3d8d93(0xd4)]||'','alias':_0x71f1f[_0x3d8d93(0xc9)]||_0x71f1f[_0x3d8d93(0xcf)]})),_0x1adeb3=fileURLToPath(import.meta.url),_0xfd6e42=a3_0x536ee1[_0x3d8d93(0xad)](a3_0x536ee1[_0x3d8d93(0xa7)](_0x1adeb3),_0x3d8d93(0xaf)),_0xafdfc5=a3_0x536ee1['join'](_0xfd6e42,'templates/generate-api'),_0x56cf81=a3_0x536ee1[_0x3d8d93(0xaa)](_0xafdfc5,_0x3d8d93(0xc1)),_0x1a40eb=a3_0x536ee1[_0x3d8d93(0xaa)](_0xafdfc5,_0x3d8d93(0xb9)),_0xbaf382=_0x2ac341;mkdirSync(_0xbaf382,{'recursive':!![]});const _0x1c86a5=_0x34dfd8?{}:_0x17370c,_0x282086=await generateSdkConfigFile(_0xbaf382,_0x1c86a5,_0x4182c6),_0x58a86f=a3_0x536ee1[_0x3d8d93(0xa4)](_0x282086,_0x3d8d93(0xa0)),_0x55ea3c=a3_0x536ee1[_0x3d8d93(0xaa)](_0xbaf382,_0x14ce5e+_0x3d8d93(0xa0)),_0x25cc20=a3_0x536ee1[_0x3d8d93(0xaa)](_0xbaf382,_0x22ea31+_0x3d8d93(0xa0)),_0x3a4a30=_0x5f5cb2[_0x3d8d93(0xac)]===!![],_0x3fbe0e=existsSync(_0x55ea3c),_0x5ea762=existsSync(_0x25cc20),_0x4a6d2b=_0x5f5cb2[_0x3d8d93(0xcd)]??(_0x3a4a30?_0x3d8d93(0xdd):_0x3d8d93(0xe0)),_0x4cbf53=_0x4a6d2b===_0x3d8d93(0xdd)||_0x4a6d2b==='missing'&&!_0x3fbe0e,_0x3be3a0=_0x4a6d2b==='replace'||_0x4a6d2b===_0x3d8d93(0xe0)&&!_0x5ea762,_0x251fa3=_0x5f5cb2[_0x3d8d93(0xb6)]?updateModelRegistry({'outputDir':_0xbaf382,'profileName':_0x5f5cb2[_0x3d8d93(0xb6)]['name'],'defaultProfile':_0x5f5cb2[_0x3d8d93(0xb6)][_0x3d8d93(0xd6)],'appCode':_0x5e4d53,'runtimeDomain':_0x5f5cb2['modelProfile'][_0x3d8d93(0xbd)],'models':_0x2ede72,'allowEmptyReplacement':_0x5f5cb2['allowEmptyModelReplacement']===!![]}):undefined,_0x5203c2=_0x251fa3?a3_0x536ee1[_0x3d8d93(0xaa)](_0xbaf382,MODEL_RUNTIME_FILE_NAME):undefined,_0xab1eed=_0x5203c2?existsSync(_0x5203c2):![],_0x382785=_0x34dfd8&&_0x4a6d2b!==_0x3d8d93(0xd7)?await renderModelRegistryScaffold(_0xbaf382):undefined;_0x5203c2&&_0x382785&&writeFileSync(_0x5203c2,_0x382785[_0x3d8d93(0xb1)],_0x3d8d93(0xa5));const _0x5e889a=_0x2ede72[0x0]?.[_0x3d8d93(0xc9)];if(_0x4cbf53){const _0x502b69=_0x382785?.[_0x3d8d93(0xda)]??readFileSync(_0x56cf81,'utf8'),_0x50afdb=_0x34dfd8?_0x502b69:TemplateReplacer['replaceApiContent'](_0x502b69,_0x5e4d53,_0x2ede72,_0x5e889a,_0x14ce5e,_0x37ad1c,undefined,_0x39e08c);writeFileSync(_0x55ea3c,await a3_0x20c2ee[_0x3d8d93(0xc4)](_0x50afdb,{'parser':_0x3d8d93(0xd8)}),{'encoding':'utf8'});}if(_0x3be3a0){const _0x4ad4d2=_0x382785?.['client']??readFileSync(_0x1a40eb,_0x3d8d93(0xa5)),_0x3fb479=_0x34dfd8?_0x4ad4d2:TemplateReplacer[_0x3d8d93(0xbe)](_0x4ad4d2,_0x5e4d53,_0x2ede72,_0x5e889a,_0x14ce5e,_0x37ad1c,_0x5532ac,_0x39e08c,_0x58a86f);writeFileSync(_0x25cc20,await a3_0x20c2ee['format'](_0x3fb479,{'parser':_0x3d8d93(0xd8)}),{'encoding':_0x3d8d93(0xa5)});}const _0x1005c3=_0x2ede72[_0x3d8d93(0xb5)],_0xa767e0={'api':{'path':_0x55ea3c,'action':fileAction(_0x3fbe0e,_0x4cbf53)},'client':{'path':_0x25cc20,'action':fileAction(_0x5ea762,_0x3be3a0)},'sdkConfig':{'path':_0x282086,'action':'refreshed'},..._0x251fa3?{'modelRegistry':{'path':_0x251fa3[_0x3d8d93(0xc8)],'action':_0x251fa3['existed']?_0x3d8d93(0xde):'created'},'modelRuntime':{'path':_0x5203c2,'action':_0x382785?_0xab1eed?'refreshed':'created':_0xab1eed?_0x3d8d93(0xd5):_0x3d8d93(0xe0)}}:{}},_0x53c16a=existsSync(_0x55ea3c)&&readFileSync(_0x55ea3c,_0x3d8d93(0xa5))[_0x3d8d93(0xb4)](MODEL_REGISTRY_FILE_NAME[_0x3d8d93(0xdd)]('.ts','')),_0xc7fa0a=existsSync(_0x25cc20)&&readFileSync(_0x25cc20,_0x3d8d93(0xa5))['includes'](_0x3d8d93(0xdb)),_0x3f3768=_0x34dfd8?!_0x53c16a||!_0xc7fa0a||!existsSync(_0x5203c2):![],_0x5a5a23=_0x34dfd8?_0x3f3768:_0xa767e0[_0x3d8d93(0xda)]['action']==='preserved'||_0xa767e0[_0x3d8d93(0xd9)][_0x3d8d93(0xc3)]===_0x3d8d93(0xd5);return logger[_0x3d8d93(0xa6)](_0x3d8d93(0xab),_0x5a5a23?a3_0x536ee1['basename'](_0x282086)+_0x3d8d93(0xbc):_0x34dfd8?_0x3d8d93(0xc6):_0x3d8d93(0xa9),undefined,{'apiFile':_0x55ea3c,'clientFile':_0x25cc20,'sdkConfig':_0x282086,'modelCount':_0x1005c3,'configName':_0x3ca915,'isDefaultConfig':_0x107668,'needsAgentMerge':_0x5a5a23,'needsProjectUpgrade':_0x3f3768,'files':_0xa767e0}),{'appCode':_0x5e4d53,'modelCount':_0x1005c3,'models':_0x2ede72,'apiFilePath':_0x55ea3c,'clientFilePath':_0x25cc20,'sdkConfigPath':_0x282086,'modelRegistryPath':_0x251fa3?.[_0x3d8d93(0xc8)],'modelRuntimePath':_0x5203c2,'modelProfile':_0x5f5cb2[_0x3d8d93(0xb6)]?.[_0x3d8d93(0xd4)],'configName':_0x3ca915,'isDefaultConfig':_0x107668,'sdkRouting':_0x1c86a5,'files':_0xa767e0,'needsAgentMerge':_0x5a5a23,'needsProjectUpgrade':_0x3f3768};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a4_0x357b(_0x5dadba,_0x33840c){_0x5dadba=_0x5dadba-0xe2;const _0x4a6792=a4_0x4a67();let _0x357ba5=_0x4a6792[_0x5dadba];return _0x357ba5;}(function(_0x5611e3,_0x504030){const _0x29377c=a4_0x357b,_0x2df188=_0x5611e3();while(!![]){try{const _0x4e4dd2=parseInt(_0x29377c(0xed))/0x1+-parseInt(_0x29377c(0xf9))/0x2*(parseInt(_0x29377c(0xe4))/0x3)+-parseInt(_0x29377c(0xe6))/0x4+-parseInt(_0x29377c(0xf4))/0x5*(parseInt(_0x29377c(0xe8))/0x6)+parseInt(_0x29377c(0xe2))/0x7*(parseInt(_0x29377c(0xe7))/0x8)+parseInt(_0x29377c(0xeb))/0x9*(parseInt(_0x29377c(0xf1))/0xa)+parseInt(_0x29377c(0xec))/0xb;if(_0x4e4dd2===_0x504030)break;else _0x2df188['push'](_0x2df188['shift']());}catch(_0x2a1b9a){_0x2df188['push'](_0x2df188['shift']());}}}(a4_0x4a67,0xa1292));import{mkdirSync,writeFileSync}from'node:fs';import a4_0x37ef58 from'node:path';function a4_0x4a67(){const _0x586f6a=['1445BDNdCx','join','/**\x0a\x20*\x20Lovrabet\x20SDK\x20runtime\x20routing.\x0a\x20*\x20Generated\x20by\x20Rabetbase\x20CLI.\x20Do\x20not\x20add\x20credentials\x20to\x20this\x20file.\x0a\x20*/\x0aexport\x20const\x20LOVRABET_SDK_CONFIG\x20=\x20',',\x0a}','push','2ZoVWgD',',\x0a\x20\x20','2724211ErprzM','stringify','3640977GeMluY','-sdk-config.ts','2447140XMWFIW','8JPWhNq','5082hReMbY','runtimeDomain:\x20','typescript','9gEFKCM','18126702MRXxiA','363423ApgCGq','{\x0a\x20\x20','length','utf8','3298630ddrTDs','runtimeDomain','format'];a4_0x4a67=function(){return _0x586f6a;};return a4_0x4a67();}import a4_0x2814e7 from'prettier';export const SDK_CONFIG_FILE_NAME='sdk-config.ts';export function getSdkConfigFileName(_0x1b17e2=''){const _0x115a3f=a4_0x357b;return _0x1b17e2?_0x1b17e2+_0x115a3f(0xe5):SDK_CONFIG_FILE_NAME;}export async function generateSdkConfigFile(_0x4c5ddc,_0x5ceb87={},_0x2399a1=''){const _0x30f55b=a4_0x357b,_0x92a6fa=[];_0x5ceb87[_0x30f55b(0xf2)]&&_0x92a6fa[_0x30f55b(0xf8)](_0x30f55b(0xe9)+JSON[_0x30f55b(0xe3)](_0x5ceb87[_0x30f55b(0xf2)]));const _0x4446c9=_0x92a6fa[_0x30f55b(0xef)]>0x0?_0x30f55b(0xee)+_0x92a6fa[_0x30f55b(0xf5)](_0x30f55b(0xfa))+_0x30f55b(0xf7):'{}',_0x45447b=_0x30f55b(0xf6)+_0x4446c9+'\x20as\x20const;\x0a';mkdirSync(_0x4c5ddc,{'recursive':!![]});const _0x1dcb05=a4_0x37ef58['join'](_0x4c5ddc,getSdkConfigFileName(_0x2399a1));return writeFileSync(_0x1dcb05,await a4_0x2814e7[_0x30f55b(0xf3)](_0x45447b,{'parser':_0x30f55b(0xea)}),_0x30f55b(0xf0)),_0x1dcb05;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5774eb,_0x10acfa){const _0xb67a36=a5_0x2e88,_0x34c4f5=_0x5774eb();while(!![]){try{const _0x5de59e=-parseInt(_0xb67a36(0x19f))/0x1+-parseInt(_0xb67a36(0x1a9))/0x2*(parseInt(_0xb67a36(0x1b4))/0x3)+parseInt(_0xb67a36(0x1aa))/0x4+parseInt(_0xb67a36(0x1b2))/0x5*(parseInt(_0xb67a36(0x1a7))/0x6)+parseInt(_0xb67a36(0x1af))/0x7*(parseInt(_0xb67a36(0x1ac))/0x8)+-parseInt(_0xb67a36(0x1a3))/0x9*(-parseInt(_0xb67a36(0x1b1))/0xa)+-parseInt(_0xb67a36(0x19d))/0xb;if(_0x5de59e===_0x10acfa)break;else _0x34c4f5['push'](_0x34c4f5['shift']());}catch(_0x2b49aa){_0x34c4f5['push'](_0x34c4f5['shift']());}}}(a5_0x2603,0xbb304));export function parseLegacyApiModels(_0x5c72dd){const _0x5f4d39=a5_0x2e88,_0x1f6498=[],_0x1b661a=/\{\s*datasetCode:\s*"([^"]+)"\s*,\s*tableName:\s*"([^"]+)"\s*,\s*name:\s*"([^"]*?)"\s*,\s*alias:\s*"([^"]+)"\s*,?\s*\}/g;let _0x2701d0;while((_0x2701d0=_0x1b661a[_0x5f4d39(0x1a1)](_0x5c72dd))!==null){_0x1f6498['push']({'datasetCode':_0x2701d0[0x1],'tableName':_0x2701d0[0x2],'name':_0x2701d0[0x3],'alias':_0x2701d0[0x4]});}return _0x1f6498;}export function parseLegacyApiAppCode(_0x17a6e6){const _0x4ad095=a5_0x2e88;return _0x17a6e6[_0x4ad095(0x1a5)](/export\s+const\s+[A-Z0-9_]*APP_CODE(?:\s*:\s*string)?\s*=\s*["']([^"']+)["']/)?.[0x1];}function stripComments(_0xc39434){const _0x298330=a5_0x2e88;return _0xc39434[_0x298330(0x1b5)](/\/\*[\s\S]*?\*\//g,'')[_0x298330(0x1b5)](/\/\/.*$/gm,'');}function a5_0x2e88(_0x2cb975,_0x28059c){_0x2cb975=_0x2cb975-0x19d;const _0x26031c=a5_0x2603();let _0x2e88b4=_0x26031c[_0x2cb975];return _0x2e88b4;}function a5_0x2603(){const _0x1d5759=['63DsXTxW','length','match','MODELS_CONFIG','12lJZhLV','includes','37242Huxvmd','3789448uVoEpU','APP_CODE','7411432DVXurw','test','some','7jtnanj','@lovrabet/sdk','2166090DsUZEq','764330sfafRU','map','57UmrqbF','replace','26655387MtxjJZ','endsWith','152046BYYVhQ','matchAll','exec','Generated\x20by\x20Rabetbase\x20CLI'];a5_0x2603=function(){return _0x1d5759;};return a5_0x2603();}export function isLegacyGeneratedApiScaffold(_0xe28ac0){const _0x4cebe2=a5_0x2e88;if(!_0xe28ac0['includes'](_0x4cebe2(0x1a2)))return![];const _0x46d128=stripComments(_0xe28ac0),_0x24da95=[..._0x46d128['matchAll'](/^import[\s\S]*?from\s+["']([^"']+)["'];?$/gm)][_0x4cebe2(0x1b3)](_0x2d35ea=>_0x2d35ea[0x1]);if(_0x24da95[_0x4cebe2(0x1a4)]!==0x1||_0x24da95[0x0]!==_0x4cebe2(0x1b0))return![];const _0x2bcf8c=[..._0x46d128[_0x4cebe2(0x1a0)](/^(?:export\s+)?const\s+([A-Za-z_$][\w$]*)/gm)]['map'](_0x49f4da=>_0x49f4da[0x1]);if(_0x2bcf8c[_0x4cebe2(0x1a4)]!==0x2||!_0x2bcf8c['some'](_0x2eed82=>_0x2eed82['endsWith'](_0x4cebe2(0x1ab)))||!_0x2bcf8c[_0x4cebe2(0x1ae)](_0x523ce2=>_0x523ce2[_0x4cebe2(0x19e)](_0x4cebe2(0x1a6))))return![];const _0x5ef694=[..._0x46d128[_0x4cebe2(0x1a0)](/^([A-Za-z_$][\w$]*)\s*\(/gm)]['map'](_0x1fee55=>_0x1fee55[0x1]);return _0x5ef694['length']===0x1&&_0x5ef694[0x0]==='registerModels';}export function isLegacyGeneratedClientScaffold(_0x42765b){const _0x437922=a5_0x2e88;if(!_0x42765b[_0x437922(0x1a8)](_0x437922(0x1a2)))return![];const _0x7f5439=stripComments(_0x42765b),_0x552e4a=[..._0x7f5439[_0x437922(0x1a0)](/^(?:import[\s\S]*?from\s+|import\s+)["']([^"']+)["'];?$/gm)][_0x437922(0x1b3)](_0x114efe=>_0x114efe[0x1]);if(_0x552e4a[_0x437922(0x1ae)](_0x3422df=>_0x3422df!==_0x437922(0x1b0)&&!/^\.\/(?:[\w-]+-)?(?:api|sdk-config)$/[_0x437922(0x1ad)](_0x3422df??'')))return![];const _0x45ba7d=[..._0x7f5439[_0x437922(0x1a0)](/^(?:export\s+)?const\s+([A-Za-z_$][\w$]*)/gm)]['map'](_0x46b408=>_0x46b408[0x1]);return _0x45ba7d[_0x437922(0x1a4)]===0x1&&_0x45ba7d[0x0]==='lovrabetClient';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a6_0xec9771=a6_0x143c;(function(_0xa46eb7,_0x703b8a){const _0x50d02c=a6_0x143c,_0x884f35=_0xa46eb7();while(!![]){try{const _0x458ac1=parseInt(_0x50d02c(0x124))/0x1*(parseInt(_0x50d02c(0x12c))/0x2)+parseInt(_0x50d02c(0x108))/0x3+parseInt(_0x50d02c(0x10f))/0x4+parseInt(_0x50d02c(0x129))/0x5*(-parseInt(_0x50d02c(0x11d))/0x6)+parseInt(_0x50d02c(0xee))/0x7*(-parseInt(_0x50d02c(0x12b))/0x8)+parseInt(_0x50d02c(0xfa))/0x9*(parseInt(_0x50d02c(0xf7))/0xa)+-parseInt(_0x50d02c(0xe7))/0xb*(-parseInt(_0x50d02c(0xf9))/0xc);if(_0x458ac1===_0x703b8a)break;else _0x884f35['push'](_0x884f35['shift']());}catch(_0x3ce7a8){_0x884f35['push'](_0x884f35['shift']());}}}(a6_0x3fa8,0xb90e6));import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import a6_0x21525b from'node:path';export const MODEL_REGISTRY_FILE_NAME='models.generated.ts';export const MODEL_RUNTIME_FILE_NAME=a6_0xec9771(0xfd);export const MODEL_REGISTRY_VERSION_MARKER=a6_0xec9771(0xe6);const LEGACY_MODEL_REGISTRY_V2_PROTOCOL=a6_0xec9771(0x10b),REGISTRY_START='/*\x20rabetbase-model-registry:start\x20*/',REGISTRY_END='/*\x20rabetbase-model-registry:end\x20*/';function emptyRegistry(_0x11cc62){return{'defaultProfile':_0x11cc62,'profiles':{},'models':[]};}function extractRegistryJson(_0x549566){const _0x3d908c=a6_0xec9771,_0x5ea11d=_0x549566['indexOf'](REGISTRY_START),_0x14d632=_0x549566[_0x3d908c(0x121)](REGISTRY_END);if(_0x5ea11d<0x0||_0x14d632<=_0x5ea11d)return undefined;return _0x549566['slice'](_0x5ea11d+REGISTRY_START['length'],_0x14d632)['trim']()[_0x3d908c(0x111)](/\s+as const satisfies LovrabetModelRegistry;?$/,'')['replace'](/;$/,'');}function migrateLegacyRegistry(_0x930ea5){const _0x4f0abb=a6_0xec9771,_0x205bd2=emptyRegistry(_0x930ea5[_0x4f0abb(0x115)]);for(const [_0x1727b4,_0x4cdc03]of Object[_0x4f0abb(0x117)](_0x930ea5[_0x4f0abb(0xe8)])){_0x205bd2['profiles'][_0x1727b4]={'appCode':_0x4cdc03['appCode'],'runtimeDomain':_0x4cdc03[_0x4f0abb(0x104)]},mergeProfileModels(_0x205bd2,_0x1727b4,_0x4cdc03['models']);}return _0x205bd2;}function generatedObjectLiteralToJson(_0x25754d){const _0x547012=a6_0xec9771;let _0x14484f='',_0x362c3f,_0x5d5315=![],_0x96b8b4;for(let _0x25a4ce=0x0;_0x25a4ce<_0x25754d[_0x547012(0x11b)];_0x25a4ce++){const _0x26bf51=_0x25754d[_0x25a4ce];if(_0x362c3f){_0x14484f+=_0x26bf51;if(_0x5d5315)_0x5d5315=![];else{if(_0x26bf51==='\x5c')_0x5d5315=!![];else{if(_0x26bf51===_0x362c3f)_0x362c3f=undefined;}}continue;}if(_0x26bf51==='\x22'){_0x362c3f=_0x26bf51,_0x14484f+=_0x26bf51,_0x96b8b4='value';continue;}if(_0x26bf51===','){let _0x4a7f13=_0x25a4ce+0x1;while(/\s/[_0x547012(0xf1)](_0x25754d[_0x4a7f13]??''))_0x4a7f13++;if(_0x25754d[_0x4a7f13]==='}'||_0x25754d[_0x4a7f13]===']')continue;_0x14484f+=_0x26bf51,_0x96b8b4=',';continue;}if(_0x26bf51==='{'||_0x26bf51==='['){_0x14484f+=_0x26bf51,_0x96b8b4=_0x26bf51;continue;}if(_0x26bf51==='}'||_0x26bf51===']'){_0x14484f+=_0x26bf51,_0x96b8b4=_0x26bf51;continue;}if((_0x96b8b4==='{'||_0x96b8b4===',')&&/[A-Za-z_$]/[_0x547012(0xf1)](_0x26bf51)){let _0x30576c=_0x25a4ce+0x1;while(/[A-Za-z0-9_$]/[_0x547012(0xf1)](_0x25754d[_0x30576c]??''))_0x30576c++;let _0x460b0f=_0x30576c;while(/\s/[_0x547012(0xf1)](_0x25754d[_0x460b0f]??''))_0x460b0f++;if(_0x25754d[_0x460b0f]===':'){_0x14484f+=JSON[_0x547012(0x102)](_0x25754d['slice'](_0x25a4ce,_0x30576c)),_0x25a4ce=_0x30576c-0x1,_0x96b8b4=_0x547012(0x106);continue;}}_0x14484f+=_0x26bf51;if(!/\s/['test'](_0x26bf51)&&_0x26bf51!==':')_0x96b8b4='value';}return _0x14484f;}function parseGeneratedRegistryJson(_0x5d86d3){const _0x367618=a6_0xec9771;try{return JSON['parse'](_0x5d86d3);}catch{return JSON[_0x367618(0x118)](generatedObjectLiteralToJson(_0x5d86d3));}}function normalizeModelEntries(_0x7ef8d8,_0x1eb3d5){const _0x536860=a6_0xec9771,_0xfe15b2=Object[_0x536860(0x105)](_0x7ef8d8),_0x131811=[];for(const _0x5a8d46 of _0x1eb3d5){if(!_0x5a8d46||typeof _0x5a8d46!=='object'||Array['isArray'](_0x5a8d46))return undefined;const _0x48b90a=_0x5a8d46;if(typeof _0x48b90a[_0x536860(0x112)]!==_0x536860(0x110)||typeof _0x48b90a[_0x536860(0xf4)]!==_0x536860(0x110)||typeof _0x48b90a[_0x536860(0x101)]!==_0x536860(0x110))return undefined;let _0x36d214;if(typeof _0x48b90a[_0x536860(0x128)]==='string'&&_0x48b90a[_0x536860(0xf0)]===undefined)_0x36d214=Object[_0x536860(0xed)](_0xfe15b2[_0x536860(0x127)](_0x4ccf1d=>[_0x4ccf1d,_0x48b90a[_0x536860(0x128)]]));else{if(_0x48b90a['datasetCode']===undefined&&_0x48b90a[_0x536860(0xf0)]&&typeof _0x48b90a[_0x536860(0xf0)]===_0x536860(0x11c)&&!Array[_0x536860(0x109)](_0x48b90a['datasetCodes'])&&Object[_0x536860(0xe9)](_0x48b90a[_0x536860(0xf0)])[_0x536860(0xf5)](_0x1a3230=>typeof _0x1a3230==='string'))_0x36d214={..._0x48b90a[_0x536860(0xf0)]};else return undefined;}_0x131811[_0x536860(0xf6)]({'alias':_0x48b90a['alias'],'tableName':_0x48b90a[_0x536860(0xf4)],'name':_0x48b90a[_0x536860(0x101)],'datasetCodes':_0x36d214});}return _0x131811;}export function parseModelRegistry(_0x242a8e){const _0x1f0c57=a6_0xec9771,_0x5eab22=extractRegistryJson(_0x242a8e);if(!_0x5eab22)return undefined;try{const _0xf64a4c=parseGeneratedRegistryJson(_0x5eab22);if(typeof _0xf64a4c[_0x1f0c57(0x115)]!=='string'||!_0xf64a4c[_0x1f0c57(0xe8)]||typeof _0xf64a4c['profiles']!==_0x1f0c57(0x11c))return undefined;if(_0xf64a4c[_0x1f0c57(0xfe)]==='lovrabet-model-registry/v1')return migrateLegacyRegistry(_0xf64a4c);if(!(_0xf64a4c[_0x1f0c57(0xfe)]===LEGACY_MODEL_REGISTRY_V2_PROTOCOL||_0xf64a4c['protocol']===undefined&&_0x242a8e[_0x1f0c57(0x103)](MODEL_REGISTRY_VERSION_MARKER))||!Array[_0x1f0c57(0x109)](_0xf64a4c[_0x1f0c57(0xea)]))return undefined;const _0x3bdc46=_0xf64a4c['profiles'],_0x1c09b5=normalizeModelEntries(_0x3bdc46,_0xf64a4c['models']);if(!_0x1c09b5)return undefined;return{'defaultProfile':_0xf64a4c['defaultProfile'],'profiles':_0x3bdc46,'models':_0x1c09b5};}catch{return undefined;}}export function readModelRegistry(_0xc2e9de){const _0x233824=a6_0xec9771;if(!existsSync(_0xc2e9de))return undefined;try{return parseModelRegistry(readFileSync(_0xc2e9de,_0x233824(0xec)));}catch{return undefined;}}function a6_0x3fa8(){const _0x2dfb3b=['parse','flatMap','now','length','object','73056WfZMkx','set','Model\x20alias\x20\x22','\x22\x20with\x20an\x20empty\x20result.\x20','indexOf','Table\x20\x22','\x22\x20in\x20profile\x20\x22','28979chiPXB','\x20as\x20const\x20satisfies\x20LovrabetModelRegistry;\x0a','.tmp','map','datasetCode','545LsUuwn','filter','8UocqQj','26GXiqqM','/*\x20rabetbase-model-registry:v2\x20*/','11KUstLZ','profiles','values','models','allowEmptyReplacement','utf8','fromEntries','7748993nWHoKa','profileName','datasetCodes','test','\x22\x20maps\x20to\x20table\x20\x22','join','tableName','every','push','64570xjFUbr','Refusing\x20to\x20replace\x20','6122028yXwgHU','468cDiyyJ','split','pid','model-runtime.ts','protocol','NOT-SET','\x22\x20and\x20\x22','name','stringify','includes','runtimeDomain','keys','key','\x0aexport\x20const\x20LOVRABET_MODEL_REGISTRY\x20=\x0a\x20\x20','3234495WjmgMT','isArray','outputDir','lovrabet-model-registry/v2','appCode','find','get','3565392nzgsNH','string','replace','alias','\x22\x20maps\x20to\x20alias\x20\x22','\x22\x20in\x20the\x20registry\x20but\x20\x22','defaultProfile','\x22\x20maps\x20to\x20both\x20aliases\x20\x22','entries'];a6_0x3fa8=function(){return _0x2dfb3b;};return a6_0x3fa8();}function registrySource(_0x1dd483){const _0x457356=a6_0xec9771,_0x4f406f=Object[_0x457356(0x105)](_0x1dd483[_0x457356(0xe8)]),_0x38ce75=_0x1dd483[_0x457356(0xea)][_0x457356(0x127)](_0x4cfeb5=>{const _0x2e2f7a=_0x457356,_0x9cc296=_0x4f406f[_0x2e2f7a(0x127)](_0x36b86f=>_0x4cfeb5[_0x2e2f7a(0xf0)][_0x36b86f]),_0x438409=_0x9cc296[0x0],_0x138d0d=_0x438409!==undefined&&_0x9cc296['every'](_0x261395=>_0x261395===_0x438409),_0x163839={'alias':_0x4cfeb5[_0x2e2f7a(0x112)],'tableName':_0x4cfeb5[_0x2e2f7a(0xf4)],'name':_0x4cfeb5[_0x2e2f7a(0x101)]};return _0x138d0d?{..._0x163839,'datasetCode':_0x438409}:{..._0x163839,'datasetCodes':_0x4cfeb5[_0x2e2f7a(0xf0)]};}),_0x1a1115=JSON[_0x457356(0x102)]({'defaultProfile':_0x1dd483[_0x457356(0x115)],'profiles':_0x1dd483[_0x457356(0xe8)],'models':_0x38ce75},null,0x2)[_0x457356(0xfb)]('\x0a')[_0x457356(0x127)](_0x138ce2=>'\x20\x20'+_0x138ce2)[_0x457356(0xf3)]('\x0a');return'/**\x0a\x20*\x20Dataset\x20model\x20facts\x20generated\x20by\x20Rabetbase\x20CLI.\x0a\x20*\x0a\x20*\x20This\x20file\x20is\x20safe\x20to\x20commit.\x20Do\x20not\x20edit\x20it\x20manually\x20and\x20never\x20add\x20credentials.\x0a\x20*/\x0a\x0aexport\x20interface\x20LovrabetModelProfile\x20{\x0a\x20\x20appCode:\x20string;\x0a\x20\x20runtimeDomain:\x20string;\x0a}\x0a\x0aexport\x20interface\x20LovrabetModelEntryMetadata\x20{\x0a\x20\x20alias:\x20string;\x0a\x20\x20tableName:\x20string;\x0a\x20\x20name:\x20string;\x0a}\x0a\x0aexport\x20type\x20LovrabetModelEntry\x20=\x20LovrabetModelEntryMetadata\x20&\x20(\x0a\x20\x20|\x20{\x20datasetCode:\x20string;\x20datasetCodes?:\x20never\x20}\x0a\x20\x20|\x20{\x20datasetCode?:\x20never;\x20datasetCodes:\x20Record<string,\x20string>\x20}\x0a);\x0a\x0aexport\x20interface\x20LovrabetModelRegistry\x20{\x0a\x20\x20defaultProfile:\x20string;\x0a\x20\x20profiles:\x20Record<string,\x20LovrabetModelProfile>;\x0a\x20\x20models:\x20LovrabetModelEntry[];\x0a}\x0a\x0a'+MODEL_REGISTRY_VERSION_MARKER+_0x457356(0x107)+REGISTRY_START+'\x0a'+_0x1a1115+_0x457356(0x125)+REGISTRY_END+'\x0a';}function mergeProfileModels(_0x22061d,_0x2306cd,_0x5c4e7b){const _0x3a390f=a6_0xec9771,_0xb1d577=_0x5c4e7b[_0x3a390f(0x127)](_0x11b207=>({..._0x11b207,'alias':_0x11b207[_0x3a390f(0x112)]||_0x11b207[_0x3a390f(0xf4)]})),_0x2c5d40=new Map(),_0x5eb472=new Map();for(const _0x3b29e4 of _0xb1d577){const _0x3229ee=_0x2c5d40[_0x3a390f(0x10e)](_0x3b29e4[_0x3a390f(0x112)]);if(_0x3229ee&&_0x3229ee!==_0x3b29e4[_0x3a390f(0xf4)])throw new Error(_0x3a390f(0x11f)+_0x3b29e4['alias']+'\x22\x20maps\x20to\x20both\x20\x22'+_0x3229ee+_0x3a390f(0x100)+_0x3b29e4['tableName']+'\x22\x20in\x20profile\x20\x22'+_0x2306cd+'\x22.');const _0x82addf=_0x5eb472[_0x3a390f(0x10e)](_0x3b29e4['tableName']);if(_0x82addf&&_0x82addf!==_0x3b29e4[_0x3a390f(0x112)])throw new Error(_0x3a390f(0x122)+_0x3b29e4['tableName']+_0x3a390f(0x116)+_0x82addf+_0x3a390f(0x100)+_0x3b29e4[_0x3a390f(0x112)]+'\x22\x20in\x20profile\x20\x22'+_0x2306cd+'\x22.');_0x2c5d40[_0x3a390f(0x11e)](_0x3b29e4[_0x3a390f(0x112)],_0x3b29e4[_0x3a390f(0xf4)]),_0x5eb472[_0x3a390f(0x11e)](_0x3b29e4[_0x3a390f(0xf4)],_0x3b29e4['alias']);const _0x4f77b1=_0x22061d[_0x3a390f(0xea)][_0x3a390f(0x10d)](_0x56aecf=>_0x56aecf[_0x3a390f(0x112)]===_0x3b29e4['alias']);if(_0x4f77b1&&_0x4f77b1[_0x3a390f(0xf4)]!==_0x3b29e4[_0x3a390f(0xf4)])throw new Error(_0x3a390f(0x11f)+_0x3b29e4[_0x3a390f(0x112)]+_0x3a390f(0xf2)+_0x4f77b1['tableName']+_0x3a390f(0x114)+_0x3b29e4['tableName']+_0x3a390f(0x123)+_0x2306cd+'\x22.');const _0x4f3894=_0x22061d[_0x3a390f(0xea)]['find'](_0x4171a7=>_0x4171a7[_0x3a390f(0xf4)]===_0x3b29e4[_0x3a390f(0xf4)]);if(_0x4f3894&&_0x4f3894['alias']!==_0x3b29e4[_0x3a390f(0x112)])throw new Error(_0x3a390f(0x122)+_0x3b29e4[_0x3a390f(0xf4)]+_0x3a390f(0x113)+_0x4f3894[_0x3a390f(0x112)]+_0x3a390f(0x114)+_0x3b29e4[_0x3a390f(0x112)]+_0x3a390f(0x123)+_0x2306cd+'\x22.');}for(const _0x35029a of _0x22061d['models']){delete _0x35029a[_0x3a390f(0xf0)][_0x2306cd];}for(const _0x119685 of _0xb1d577){let _0x6f5ef4=_0x22061d[_0x3a390f(0xea)][_0x3a390f(0x10d)](_0x5ef83f=>_0x5ef83f[_0x3a390f(0x112)]===_0x119685['alias']);!_0x6f5ef4&&(_0x6f5ef4={'alias':_0x119685[_0x3a390f(0x112)],'tableName':_0x119685['tableName'],'name':_0x119685[_0x3a390f(0x101)],'datasetCodes':{}},_0x22061d[_0x3a390f(0xea)][_0x3a390f(0xf6)](_0x6f5ef4)),(_0x2306cd===_0x22061d[_0x3a390f(0x115)]||!_0x6f5ef4[_0x3a390f(0xf0)][_0x22061d[_0x3a390f(0x115)]])&&(_0x6f5ef4[_0x3a390f(0x112)]=_0x119685['alias'],_0x6f5ef4['tableName']=_0x119685[_0x3a390f(0xf4)],_0x6f5ef4[_0x3a390f(0x101)]=_0x119685[_0x3a390f(0x101)]),_0x6f5ef4[_0x3a390f(0xf0)][_0x2306cd]=_0x119685[_0x3a390f(0x128)];}_0x22061d[_0x3a390f(0xea)]=_0x22061d[_0x3a390f(0xea)]['filter'](_0x12d3be=>Object[_0x3a390f(0x105)](_0x12d3be[_0x3a390f(0xf0)])['length']>0x0);}function a6_0x143c(_0x2447e6,_0x7caeb2){_0x2447e6=_0x2447e6-0xe6;const _0x3fa853=a6_0x3fa8();let _0x143cab=_0x3fa853[_0x2447e6];return _0x143cab;}function removeUnboundProfiles(_0x5078b8){const _0x3ec6f9=a6_0xec9771,_0x4f9d15=Object['entries'](_0x5078b8['profiles'])[_0x3ec6f9(0x12a)](([,_0x2eb828])=>_0x2eb828[_0x3ec6f9(0x10c)]===_0x3ec6f9(0xff))[_0x3ec6f9(0x127)](([_0x234ad9])=>_0x234ad9);if(_0x4f9d15['length']===0x0)return;for(const _0x1bc3a2 of _0x4f9d15){delete _0x5078b8['profiles'][_0x1bc3a2];for(const _0x16dc80 of _0x5078b8[_0x3ec6f9(0xea)]){delete _0x16dc80[_0x3ec6f9(0xf0)][_0x1bc3a2];}}_0x5078b8['models']=_0x5078b8[_0x3ec6f9(0xea)][_0x3ec6f9(0x12a)](_0x44c677=>Object[_0x3ec6f9(0x105)](_0x44c677['datasetCodes'])[_0x3ec6f9(0x11b)]>0x0);}export function getProfileModels(_0x13f32c,_0x13608f){const _0x206a00=a6_0xec9771;return _0x13f32c['models'][_0x206a00(0x119)](_0x50f847=>{const _0x32a5a6=_0x206a00,_0xfdbea9=_0x50f847[_0x32a5a6(0xf0)][_0x13608f];return _0xfdbea9?[{'datasetCode':_0xfdbea9,'tableName':_0x50f847[_0x32a5a6(0xf4)],'name':_0x50f847[_0x32a5a6(0x101)],'alias':_0x50f847['alias']}]:[];});}export function updateModelRegistry(_0x37deda){const _0xcf0a41=a6_0xec9771,_0xa9f8ce=a6_0x21525b[_0xcf0a41(0xf3)](_0x37deda['outputDir'],MODEL_REGISTRY_FILE_NAME),_0x4c21de=existsSync(_0xa9f8ce),_0x454066=readModelRegistry(_0xa9f8ce);if(_0x4c21de&&!_0x454066)throw new Error(MODEL_REGISTRY_FILE_NAME+'\x20is\x20not\x20a\x20valid\x20Rabetbase\x20generated\x20file.\x20Move\x20or\x20repair\x20it\x20before\x20pulling\x20models\x20again.');const _0x4a1907=_0x454066??emptyRegistry(_0x37deda['defaultProfile']);if(_0x37deda[_0xcf0a41(0x10c)]!==_0xcf0a41(0xff))removeUnboundProfiles(_0x4a1907);const _0x5044b7=_0x454066?getProfileModels(_0x454066,_0x37deda['profileName'])[_0xcf0a41(0x11b)]:0x0;if(_0x5044b7>0x0&&_0x37deda[_0xcf0a41(0xea)][_0xcf0a41(0x11b)]===0x0&&!_0x37deda[_0xcf0a41(0xeb)])throw new Error(_0xcf0a41(0xf8)+_0x5044b7+'\x20model(s)\x20in\x20profile\x20\x22'+_0x37deda[_0xcf0a41(0xef)]+_0xcf0a41(0x120)+'Verify\x20the\x20selected\x20app\x20and\x20login,\x20or\x20rerun\x20with\x20--force\x20--yes\x20if\x20the\x20profile\x20is\x20intentionally\x20empty.');_0x4a1907[_0xcf0a41(0x115)]=_0x37deda['defaultProfile'],_0x4a1907['profiles'][_0x37deda[_0xcf0a41(0xef)]]={'appCode':_0x37deda[_0xcf0a41(0x10c)],'runtimeDomain':_0x37deda[_0xcf0a41(0x104)]},mergeProfileModels(_0x4a1907,_0x37deda[_0xcf0a41(0xef)],_0x37deda[_0xcf0a41(0xea)]),mkdirSync(_0x37deda[_0xcf0a41(0x10a)],{'recursive':!![]});const _0x258f88=_0xa9f8ce+'.'+process[_0xcf0a41(0xfc)]+'.'+Date[_0xcf0a41(0x11a)]()+_0xcf0a41(0x126);try{writeFileSync(_0x258f88,registrySource(_0x4a1907),{'encoding':_0xcf0a41(0xec),'mode':0x1a4}),renameSync(_0x258f88,_0xa9f8ce);}catch(_0x5e3082){try{unlinkSync(_0x258f88);}catch{}throw _0x5e3082;}return{'path':_0xa9f8ce,'registry':_0x4a1907,'existed':_0x4c21de};}
|
|
1
|
+
function a6_0x4c74(_0x55dad6,_0x4f1aa0){_0x55dad6=_0x55dad6-0x143;const _0x3f9990=a6_0x3f99();let _0x4c7450=_0x3f9990[_0x55dad6];return _0x4c7450;}const a6_0x2794a4=a6_0x4c74;(function(_0x30c096,_0x3e2cf6){const _0x574734=a6_0x4c74,_0x10bdde=_0x30c096();while(!![]){try{const _0x46ae97=parseInt(_0x574734(0x179))/0x1*(parseInt(_0x574734(0x16b))/0x2)+-parseInt(_0x574734(0x15e))/0x3+-parseInt(_0x574734(0x187))/0x4+-parseInt(_0x574734(0x182))/0x5+parseInt(_0x574734(0x153))/0x6+-parseInt(_0x574734(0x161))/0x7+parseInt(_0x574734(0x16d))/0x8*(parseInt(_0x574734(0x144))/0x9);if(_0x46ae97===_0x3e2cf6)break;else _0x10bdde['push'](_0x10bdde['shift']());}catch(_0x651618){_0x10bdde['push'](_0x10bdde['shift']());}}}(a6_0x3f99,0x7ce7e));import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import a6_0x4f46ff from'node:path';export const MODEL_REGISTRY_FILE_NAME='models.generated.ts';export const MODEL_RUNTIME_FILE_NAME=a6_0x2794a4(0x174);export const MODEL_REGISTRY_VERSION_MARKER=a6_0x2794a4(0x17c);const LEGACY_MODEL_REGISTRY_V2_PROTOCOL='lovrabet-model-registry/v2',REGISTRY_START=a6_0x2794a4(0x16f),REGISTRY_END='/*\x20rabetbase-model-registry:end\x20*/';function emptyRegistry(_0x5d41bb){return{'defaultProfile':_0x5d41bb,'profiles':{},'models':[]};}function extractRegistryJson(_0x3c8202){const _0x25edb5=a6_0x2794a4,_0x270d62=_0x3c8202[_0x25edb5(0x151)](REGISTRY_START),_0x54b4b7=_0x3c8202[_0x25edb5(0x151)](REGISTRY_END);if(_0x270d62<0x0||_0x54b4b7<=_0x270d62)return undefined;return _0x3c8202[_0x25edb5(0x188)](_0x270d62+REGISTRY_START['length'],_0x54b4b7)['trim']()[_0x25edb5(0x17d)](/\s+as const satisfies LovrabetModelRegistry;?$/,'')[_0x25edb5(0x17d)](/;$/,'');}function migrateLegacyRegistry(_0xa234a9){const _0xbda6c5=a6_0x2794a4,_0x4b72a4=emptyRegistry(_0xa234a9[_0xbda6c5(0x181)]);for(const [_0x3f0174,_0x905e03]of Object[_0xbda6c5(0x14e)](_0xa234a9['profiles'])){_0x4b72a4[_0xbda6c5(0x186)][_0x3f0174]={'appCode':_0x905e03[_0xbda6c5(0x15a)],'runtimeDomain':_0x905e03[_0xbda6c5(0x143)]},mergeProfileModels(_0x4b72a4,_0x3f0174,_0x905e03[_0xbda6c5(0x178)]);}return _0x4b72a4;}function generatedObjectLiteralToJson(_0x26d6a8){const _0x4159b5=a6_0x2794a4;let _0x2d129e='',_0x5ba6ab,_0x1a16db=![],_0x252825;for(let _0x5d591b=0x0;_0x5d591b<_0x26d6a8[_0x4159b5(0x16e)];_0x5d591b++){const _0x115d1d=_0x26d6a8[_0x5d591b];if(_0x5ba6ab){_0x2d129e+=_0x115d1d;if(_0x1a16db)_0x1a16db=![];else{if(_0x115d1d==='\x5c')_0x1a16db=!![];else{if(_0x115d1d===_0x5ba6ab)_0x5ba6ab=undefined;}}continue;}if(_0x115d1d==='\x22'){_0x5ba6ab=_0x115d1d,_0x2d129e+=_0x115d1d,_0x252825=_0x4159b5(0x146);continue;}if(_0x115d1d===','){let _0xa03ea5=_0x5d591b+0x1;while(/\s/[_0x4159b5(0x168)](_0x26d6a8[_0xa03ea5]??''))_0xa03ea5++;if(_0x26d6a8[_0xa03ea5]==='}'||_0x26d6a8[_0xa03ea5]===']')continue;_0x2d129e+=_0x115d1d,_0x252825=',';continue;}if(_0x115d1d==='{'||_0x115d1d==='['){_0x2d129e+=_0x115d1d,_0x252825=_0x115d1d;continue;}if(_0x115d1d==='}'||_0x115d1d===']'){_0x2d129e+=_0x115d1d,_0x252825=_0x115d1d;continue;}if((_0x252825==='{'||_0x252825===',')&&/[A-Za-z_$]/[_0x4159b5(0x168)](_0x115d1d)){let _0x4f289a=_0x5d591b+0x1;while(/[A-Za-z0-9_$]/[_0x4159b5(0x168)](_0x26d6a8[_0x4f289a]??''))_0x4f289a++;let _0x441d2b=_0x4f289a;while(/\s/['test'](_0x26d6a8[_0x441d2b]??''))_0x441d2b++;if(_0x26d6a8[_0x441d2b]===':'){_0x2d129e+=JSON[_0x4159b5(0x180)](_0x26d6a8[_0x4159b5(0x188)](_0x5d591b,_0x4f289a)),_0x5d591b=_0x4f289a-0x1,_0x252825='key';continue;}}_0x2d129e+=_0x115d1d;if(!/\s/['test'](_0x115d1d)&&_0x115d1d!==':')_0x252825='value';}return _0x2d129e;}function parseGeneratedRegistryJson(_0x4d4dcd){const _0x26d605=a6_0x2794a4;try{return JSON[_0x26d605(0x145)](_0x4d4dcd);}catch{return JSON[_0x26d605(0x145)](generatedObjectLiteralToJson(_0x4d4dcd));}}function normalizeModelEntries(_0x35341b,_0x5056d5){const _0x994b03=a6_0x2794a4,_0x30ba4d=Object[_0x994b03(0x14d)](_0x35341b),_0x3ec71c=[];for(const _0x1d96a8 of _0x5056d5){if(!_0x1d96a8||typeof _0x1d96a8!==_0x994b03(0x176)||Array[_0x994b03(0x157)](_0x1d96a8))return undefined;const _0x5963f1=_0x1d96a8;if(typeof _0x5963f1[_0x994b03(0x185)]!==_0x994b03(0x172)||typeof _0x5963f1['tableName']!=='string'||typeof _0x5963f1['name']!==_0x994b03(0x172))return undefined;let _0x21a5cc;if(typeof _0x5963f1[_0x994b03(0x17e)]===_0x994b03(0x172)&&_0x5963f1[_0x994b03(0x154)]===undefined)_0x21a5cc=Object[_0x994b03(0x155)](_0x30ba4d[_0x994b03(0x16c)](_0x38d10a=>[_0x38d10a,_0x5963f1['datasetCode']]));else{if(_0x5963f1[_0x994b03(0x17e)]===undefined&&_0x5963f1[_0x994b03(0x154)]&&typeof _0x5963f1['datasetCodes']==='object'&&!Array[_0x994b03(0x157)](_0x5963f1[_0x994b03(0x154)])&&Object[_0x994b03(0x166)](_0x5963f1[_0x994b03(0x154)])[_0x994b03(0x164)](_0x2f1c9f=>typeof _0x2f1c9f===_0x994b03(0x172)))_0x21a5cc={..._0x5963f1[_0x994b03(0x154)]};else return undefined;}_0x3ec71c[_0x994b03(0x183)]({'alias':_0x5963f1[_0x994b03(0x185)],'tableName':_0x5963f1[_0x994b03(0x173)],'name':_0x5963f1['name'],'datasetCodes':_0x21a5cc});}return _0x3ec71c;}export function parseModelRegistry(_0x3f0309){const _0x48aa6a=a6_0x2794a4,_0x480f52=extractRegistryJson(_0x3f0309);if(!_0x480f52)return undefined;try{const _0x369f6b=parseGeneratedRegistryJson(_0x480f52);if(typeof _0x369f6b[_0x48aa6a(0x181)]!==_0x48aa6a(0x172)||!_0x369f6b[_0x48aa6a(0x186)]||typeof _0x369f6b['profiles']!==_0x48aa6a(0x176))return undefined;if(_0x369f6b[_0x48aa6a(0x160)]===_0x48aa6a(0x162))return migrateLegacyRegistry(_0x369f6b);if(!(_0x369f6b[_0x48aa6a(0x160)]===LEGACY_MODEL_REGISTRY_V2_PROTOCOL||_0x369f6b['protocol']===undefined&&_0x3f0309[_0x48aa6a(0x175)](MODEL_REGISTRY_VERSION_MARKER))||!Array[_0x48aa6a(0x157)](_0x369f6b[_0x48aa6a(0x178)]))return undefined;const _0x514bb9=_0x369f6b['profiles'],_0x54a232=normalizeModelEntries(_0x514bb9,_0x369f6b[_0x48aa6a(0x178)]);if(!_0x54a232)return undefined;return{'defaultProfile':_0x369f6b[_0x48aa6a(0x181)],'profiles':_0x514bb9,'models':_0x54a232};}catch{return undefined;}}export function readModelRegistry(_0x4db00f){const _0x45a004=a6_0x2794a4;if(!existsSync(_0x4db00f))return undefined;try{return parseModelRegistry(readFileSync(_0x4db00f,_0x45a004(0x148)));}catch{return undefined;}}function registrySource(_0x2ea4a){const _0x56e122=a6_0x2794a4,_0x48ce5d=Object['keys'](_0x2ea4a['profiles']),_0x1d2031=_0x2ea4a[_0x56e122(0x178)]['map'](_0x2d686b=>{const _0x1ca5fe=_0x56e122,_0x5dd4fb=_0x48ce5d[_0x1ca5fe(0x16c)](_0x397ff3=>_0x2d686b['datasetCodes'][_0x397ff3]),_0x41cb8b=_0x5dd4fb[0x0],_0x26e1c0=_0x41cb8b!==undefined&&_0x5dd4fb[_0x1ca5fe(0x164)](_0x13ad35=>_0x13ad35===_0x41cb8b),_0x5b5c4c={'alias':_0x2d686b[_0x1ca5fe(0x185)],'tableName':_0x2d686b[_0x1ca5fe(0x173)],'name':_0x2d686b[_0x1ca5fe(0x184)]};return _0x26e1c0?{..._0x5b5c4c,'datasetCode':_0x41cb8b}:{..._0x5b5c4c,'datasetCodes':_0x2d686b[_0x1ca5fe(0x154)]};}),_0x3d929c=JSON[_0x56e122(0x180)]({'defaultProfile':_0x2ea4a['defaultProfile'],'profiles':_0x2ea4a[_0x56e122(0x186)],'models':_0x1d2031},null,0x2)['split']('\x0a')['map'](_0x4df088=>'\x20\x20'+_0x4df088)[_0x56e122(0x15d)]('\x0a');return _0x56e122(0x170)+MODEL_REGISTRY_VERSION_MARKER+_0x56e122(0x15c)+REGISTRY_START+'\x0a'+_0x3d929c+_0x56e122(0x159)+REGISTRY_END+'\x0a';}function mergeProfileModels(_0x21bc9c,_0x307615,_0x45b701){const _0xdae28c=a6_0x2794a4,_0x415995=_0x45b701[_0xdae28c(0x16c)](_0x39dc3d=>({..._0x39dc3d,'alias':_0x39dc3d[_0xdae28c(0x185)]||_0x39dc3d[_0xdae28c(0x173)]})),_0xf8b67c=new Map(),_0x3ad581=new Map();for(const _0x2b8158 of _0x415995){const _0x325fb2=_0xf8b67c['get'](_0x2b8158[_0xdae28c(0x185)]);if(_0x325fb2&&_0x325fb2!==_0x2b8158[_0xdae28c(0x173)])throw new Error(_0xdae28c(0x16a)+_0x2b8158[_0xdae28c(0x185)]+_0xdae28c(0x165)+_0x325fb2+_0xdae28c(0x163)+_0x2b8158['tableName']+_0xdae28c(0x14a)+_0x307615+'\x22.');const _0x38261e=_0x3ad581[_0xdae28c(0x158)](_0x2b8158['tableName']);if(_0x38261e&&_0x38261e!==_0x2b8158[_0xdae28c(0x185)])throw new Error(_0xdae28c(0x149)+_0x2b8158[_0xdae28c(0x173)]+_0xdae28c(0x14b)+_0x38261e+_0xdae28c(0x163)+_0x2b8158['alias']+_0xdae28c(0x14a)+_0x307615+'\x22.');_0xf8b67c[_0xdae28c(0x169)](_0x2b8158['alias'],_0x2b8158['tableName']),_0x3ad581['set'](_0x2b8158[_0xdae28c(0x173)],_0x2b8158[_0xdae28c(0x185)]);const _0x50acd9=_0x21bc9c[_0xdae28c(0x178)][_0xdae28c(0x189)](_0x302282=>_0x302282[_0xdae28c(0x185)]===_0x2b8158[_0xdae28c(0x185)]);if(_0x50acd9&&_0x50acd9['tableName']!==_0x2b8158[_0xdae28c(0x173)])throw new Error('Model\x20alias\x20\x22'+_0x2b8158[_0xdae28c(0x185)]+_0xdae28c(0x177)+_0x50acd9['tableName']+'\x22\x20in\x20the\x20registry\x20but\x20\x22'+_0x2b8158[_0xdae28c(0x173)]+_0xdae28c(0x14a)+_0x307615+'\x22.');const _0x571c75=_0x21bc9c[_0xdae28c(0x178)][_0xdae28c(0x189)](_0x22fa40=>_0x22fa40[_0xdae28c(0x173)]===_0x2b8158[_0xdae28c(0x173)]);if(_0x571c75&&_0x571c75['alias']!==_0x2b8158[_0xdae28c(0x185)])throw new Error(_0xdae28c(0x149)+_0x2b8158[_0xdae28c(0x173)]+_0xdae28c(0x15b)+_0x571c75[_0xdae28c(0x185)]+_0xdae28c(0x18a)+_0x2b8158[_0xdae28c(0x185)]+_0xdae28c(0x14a)+_0x307615+'\x22.');}for(const _0x760305 of _0x21bc9c[_0xdae28c(0x178)]){delete _0x760305[_0xdae28c(0x154)][_0x307615];}for(const _0x5527fc of _0x415995){let _0xa1fe75=_0x21bc9c[_0xdae28c(0x178)][_0xdae28c(0x189)](_0x4dcb27=>_0x4dcb27['alias']===_0x5527fc[_0xdae28c(0x185)]);!_0xa1fe75&&(_0xa1fe75={'alias':_0x5527fc[_0xdae28c(0x185)],'tableName':_0x5527fc[_0xdae28c(0x173)],'name':_0x5527fc[_0xdae28c(0x184)],'datasetCodes':{}},_0x21bc9c['models'][_0xdae28c(0x183)](_0xa1fe75)),(_0x307615===_0x21bc9c[_0xdae28c(0x181)]||!_0xa1fe75[_0xdae28c(0x154)][_0x21bc9c[_0xdae28c(0x181)]])&&(_0xa1fe75[_0xdae28c(0x185)]=_0x5527fc['alias'],_0xa1fe75[_0xdae28c(0x173)]=_0x5527fc[_0xdae28c(0x173)],_0xa1fe75[_0xdae28c(0x184)]=_0x5527fc[_0xdae28c(0x184)]),_0xa1fe75[_0xdae28c(0x154)][_0x307615]=_0x5527fc['datasetCode'];}_0x21bc9c[_0xdae28c(0x178)]=_0x21bc9c[_0xdae28c(0x178)][_0xdae28c(0x17b)](_0x152a1f=>Object['keys'](_0x152a1f[_0xdae28c(0x154)])['length']>0x0);}function removeUnboundProfiles(_0x3b02d2){const _0x3add58=a6_0x2794a4,_0x2296e9=Object[_0x3add58(0x14e)](_0x3b02d2['profiles'])[_0x3add58(0x17b)](([,_0x334e5e])=>_0x334e5e['appCode']===_0x3add58(0x147))['map'](([_0x179aa4])=>_0x179aa4);if(_0x2296e9['length']===0x0)return;for(const _0x350087 of _0x2296e9){delete _0x3b02d2[_0x3add58(0x186)][_0x350087];for(const _0x4f3602 of _0x3b02d2['models']){delete _0x4f3602[_0x3add58(0x154)][_0x350087];}}_0x3b02d2[_0x3add58(0x178)]=_0x3b02d2[_0x3add58(0x178)]['filter'](_0x3bbbf9=>Object[_0x3add58(0x14d)](_0x3bbbf9[_0x3add58(0x154)])[_0x3add58(0x16e)]>0x0);}export function getProfileModels(_0x479262,_0x36b176){const _0x3f42ba=a6_0x2794a4;return _0x479262[_0x3f42ba(0x178)][_0x3f42ba(0x167)](_0x40a5cc=>{const _0x2ea494=_0x3f42ba,_0x4cb80d=_0x40a5cc[_0x2ea494(0x154)][_0x36b176];return _0x4cb80d?[{'datasetCode':_0x4cb80d,'tableName':_0x40a5cc[_0x2ea494(0x173)],'name':_0x40a5cc['name'],'alias':_0x40a5cc['alias']}]:[];});}function a6_0x3f99(){const _0x35d138=['stringify','defaultProfile','3818770GMgaYM','push','name','alias','profiles','3647896TzWGjq','slice','find','\x22\x20in\x20the\x20registry\x20but\x20\x22','runtimeDomain','1981359xxjhpE','parse','value','NOT-SET','utf8','Table\x20\x22','\x22\x20in\x20profile\x20\x22','\x22\x20maps\x20to\x20both\x20aliases\x20\x22','now','keys','entries','\x20model(s)\x20in\x20profile\x20\x22','Refusing\x20to\x20replace\x20','indexOf','\x20is\x20not\x20a\x20valid\x20Rabetbase\x20generated\x20file.\x20Move\x20or\x20repair\x20it\x20before\x20pulling\x20models\x20again.','5983962HRHOwC','datasetCodes','fromEntries','profileName','isArray','get','\x20as\x20const\x20satisfies\x20LovrabetModelRegistry;\x0a','appCode','\x22\x20maps\x20to\x20alias\x20\x22','\x0aexport\x20const\x20LOVRABET_MODEL_REGISTRY\x20=\x0a\x20\x20','join','826737WWFqsO','.tmp','protocol','5935762UjSwNF','lovrabet-model-registry/v1','\x22\x20and\x20\x22','every','\x22\x20maps\x20to\x20both\x20\x22','values','flatMap','test','set','Model\x20alias\x20\x22','2RCNOHP','map','72gqNRxV','length','/*\x20rabetbase-model-registry:start\x20*/','/**\x0a\x20*\x20Dataset\x20model\x20facts\x20generated\x20by\x20Rabetbase\x20CLI.\x0a\x20*\x0a\x20*\x20This\x20file\x20is\x20safe\x20to\x20commit.\x20Do\x20not\x20edit\x20it\x20manually\x20and\x20never\x20add\x20credentials.\x0a\x20*/\x0a\x0aexport\x20interface\x20LovrabetModelProfile\x20{\x0a\x20\x20appCode:\x20string;\x0a\x20\x20runtimeDomain:\x20string;\x0a}\x0a\x0aexport\x20interface\x20LovrabetModelEntryMetadata\x20{\x0a\x20\x20alias:\x20string;\x0a\x20\x20tableName:\x20string;\x0a\x20\x20name:\x20string;\x0a}\x0a\x0aexport\x20type\x20LovrabetModelEntry\x20=\x20LovrabetModelEntryMetadata\x20&\x20(\x0a\x20\x20|\x20{\x20datasetCode:\x20string;\x20datasetCodes?:\x20never\x20}\x0a\x20\x20|\x20{\x20datasetCode?:\x20never;\x20datasetCodes:\x20Record<string,\x20string>\x20}\x0a);\x0a\x0aexport\x20interface\x20LovrabetModelRegistry\x20{\x0a\x20\x20defaultProfile:\x20string;\x0a\x20\x20profiles:\x20Record<string,\x20LovrabetModelProfile>;\x0a\x20\x20models:\x20LovrabetModelEntry[];\x0a}\x0a\x0a','outputDir','string','tableName','model-runtime.ts','includes','object','\x22\x20maps\x20to\x20table\x20\x22','models','332201nZbnda','allowEmptyReplacement','filter','/*\x20rabetbase-model-registry:v2\x20*/','replace','datasetCode','\x22\x20with\x20an\x20empty\x20result.\x20'];a6_0x3f99=function(){return _0x35d138;};return a6_0x3f99();}export function updateModelRegistry(_0x34d509){const _0xfe5056=a6_0x2794a4,_0x657fa4=a6_0x4f46ff['join'](_0x34d509[_0xfe5056(0x171)],MODEL_REGISTRY_FILE_NAME),_0x275690=existsSync(_0x657fa4),_0x5de0c5=readModelRegistry(_0x657fa4);if(_0x275690&&!_0x5de0c5)throw new Error(MODEL_REGISTRY_FILE_NAME+_0xfe5056(0x152));const _0x5e35df=_0x5de0c5??emptyRegistry(_0x34d509[_0xfe5056(0x181)]);if(_0x34d509['appCode']!==_0xfe5056(0x147))removeUnboundProfiles(_0x5e35df);const _0x3a7efa=_0x5de0c5?getProfileModels(_0x5de0c5,_0x34d509['profileName'])[_0xfe5056(0x16e)]:0x0;if(_0x3a7efa>0x0&&_0x34d509[_0xfe5056(0x178)][_0xfe5056(0x16e)]===0x0&&!_0x34d509[_0xfe5056(0x17a)])throw new Error(_0xfe5056(0x150)+_0x3a7efa+_0xfe5056(0x14f)+_0x34d509[_0xfe5056(0x156)]+_0xfe5056(0x17f)+'Verify\x20the\x20selected\x20app\x20and\x20login,\x20or\x20rerun\x20with\x20--force\x20--yes\x20if\x20the\x20profile\x20is\x20intentionally\x20empty.');_0x5e35df[_0xfe5056(0x181)]=_0x34d509['defaultProfile'],_0x5e35df[_0xfe5056(0x186)][_0x34d509['profileName']]={'appCode':_0x34d509[_0xfe5056(0x15a)],'runtimeDomain':_0x34d509[_0xfe5056(0x143)]},mergeProfileModels(_0x5e35df,_0x34d509[_0xfe5056(0x156)],_0x34d509['models']),mkdirSync(_0x34d509[_0xfe5056(0x171)],{'recursive':!![]});const _0x25ceeb=_0x657fa4+'.'+process['pid']+'.'+Date[_0xfe5056(0x14c)]()+_0xfe5056(0x15f);try{writeFileSync(_0x25ceeb,registrySource(_0x5e35df),{'encoding':_0xfe5056(0x148),'mode':0x1a4}),renameSync(_0x25ceeb,_0x657fa4);}catch(_0x1f4c7c){try{unlinkSync(_0x25ceeb);}catch{}throw _0x1f4c7c;}return{'path':_0x657fa4,'registry':_0x5e35df,'existed':_0x275690};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a7_0x1ea307=a7_0x2c46;function a7_0x5b36(){const _0x48108e=['profile-client.ts.tpl','../../templates/generate-api','{ProjectRoutingImport}','1eoQNYr','454765uZzSNi','utf8','4Rressi','45773tnxMHA','1736456OGBsJo','5525355oQesch','relative','2306847crkGmJ','format','typescript','1328760Qayhpc','model-runtime.ts.tpl','join','replace','startsWith','54FuZHrS','all','resolve','16ciSCFB','cwd','profile-api.ts.tpl','4504956qTHCsG'];a7_0x5b36=function(){return _0x48108e;};return a7_0x5b36();}(function(_0x54a1e9,_0x1a6294){const _0x24c7d1=a7_0x2c46,_0x4d4892=_0x54a1e9();while(!![]){try{const _0x4da1e7=-parseInt(_0x24c7d1(0x192))/0x1*(parseInt(_0x24c7d1(0x197))/0x2)+parseInt(_0x24c7d1(0x19a))/0x3+-parseInt(_0x24c7d1(0x195))/0x4*(-parseInt(_0x24c7d1(0x193))/0x5)+parseInt(_0x24c7d1(0x1a8))/0x6+parseInt(_0x24c7d1(0x196))/0x7*(parseInt(_0x24c7d1(0x1a5))/0x8)+parseInt(_0x24c7d1(0x1a2))/0x9*(-parseInt(_0x24c7d1(0x19d))/0xa)+parseInt(_0x24c7d1(0x198))/0xb;if(_0x4da1e7===_0x1a6294)break;else _0x4d4892['push'](_0x4d4892['shift']());}catch(_0xcba617){_0x4d4892['push'](_0x4d4892['shift']());}}}(a7_0x5b36,0x70753));import{readFileSync}from'node:fs';import a7_0xfce944 from'node:path';import{fileURLToPath}from'node:url';import a7_0x3e9b0e from'prettier';import{PROJECT_DOMAIN_ROUTING_FILE_NAME}from'../config/project-domain-routing.js';function relativeImport(_0x50ad0a,_0x352372){const _0x29a772=a7_0x2c46;let _0x10f6e7=a7_0xfce944[_0x29a772(0x199)](_0x50ad0a,_0x352372)[_0x29a772(0x1a0)](/\\/g,'/');if(!_0x10f6e7[_0x29a772(0x1a1)]('.'))_0x10f6e7='./'+_0x10f6e7;return _0x10f6e7;}function a7_0x2c46(_0x232997,_0x3afe0a){_0x232997=_0x232997-0x191;const _0x5b3612=a7_0x5b36();let _0x2c4688=_0x5b3612[_0x232997];return _0x2c4688;}export async function renderModelRegistryScaffold(_0x15a4e9,_0xcab6a6=process[a7_0x1ea307(0x1a6)]()){const _0x14eb5b=a7_0x1ea307,_0x337a41=fileURLToPath(import.meta.url),_0xa4b681=a7_0xfce944[_0x14eb5b(0x1a4)](a7_0xfce944['dirname'](_0x337a41),_0x14eb5b(0x1aa)),_0x1c7be1=relativeImport(a7_0xfce944[_0x14eb5b(0x1a4)](_0x15a4e9),a7_0xfce944['resolve'](_0xcab6a6,PROJECT_DOMAIN_ROUTING_FILE_NAME)),_0x450d78=readFileSync(a7_0xfce944[_0x14eb5b(0x19f)](_0xa4b681,_0x14eb5b(0x1a7)),_0x14eb5b(0x194))[_0x14eb5b(0x1a0)](_0x14eb5b(0x191),_0x1c7be1),[_0x2d58f3,_0x4a4f9c,_0x34f0b2]=await Promise[_0x14eb5b(0x1a3)]([a7_0x3e9b0e[_0x14eb5b(0x19b)](_0x450d78,{'parser':_0x14eb5b(0x19c)}),a7_0x3e9b0e[_0x14eb5b(0x19b)](readFileSync(a7_0xfce944[_0x14eb5b(0x19f)](_0xa4b681,_0x14eb5b(0x1a9)),'utf8'),{'parser':_0x14eb5b(0x19c)}),a7_0x3e9b0e['format'](readFileSync(a7_0xfce944[_0x14eb5b(0x19f)](_0xa4b681,_0x14eb5b(0x19e)),'utf8'),{'parser':_0x14eb5b(0x19c)})]);return{'api':_0x2d58f3,'client':_0x4a4f9c,'modelRuntime':_0x34f0b2};}
|
package/lib/api/model-source.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a8_0x2281(){const _0x5b56b4=['defaultProfile','validation','Run\x20`','\x20api\x20pull\x20--app\x20','resolve','1130288jOnlpb','profiles','6930270yAHXyg','map','1226241xfIGJK','42nWfRaV','length','apiDir','find','AppCode\x20\x22','apps','object','Select\x20the\x20target\x20explicitly\x20with\x20--app\x20<profile>.','-api.ts','5lwQqeu','Model\x20profile\x20\x22','55052aTVnUW','entries','2036340knIPGB','api.ts','appcode','defaultApp','20279HhTdBI','3267648WCbCoe'];a8_0x2281=function(){return _0x5b56b4;};return a8_0x2281();}(function(_0x579cca,_0x50845f){const _0x4d74eb=a8_0x2589,_0x2ef47f=_0x579cca();while(!![]){try{const _0x565f8e=-parseInt(_0x4d74eb(0x1c1))/0x1*(-parseInt(_0x4d74eb(0x1c3))/0x2)+parseInt(_0x4d74eb(0x1d4))/0x3+-parseInt(_0x4d74eb(0x1d0))/0x4+-parseInt(_0x4d74eb(0x1c5))/0x5+-parseInt(_0x4d74eb(0x1d5))/0x6*(-parseInt(_0x4d74eb(0x1c9))/0x7)+-parseInt(_0x4d74eb(0x1ca))/0x8+parseInt(_0x4d74eb(0x1d2))/0x9;if(_0x565f8e===_0x50845f)break;else _0x2ef47f['push'](_0x2ef47f['shift']());}catch(_0x494c4c){_0x2ef47f['push'](_0x2ef47f['shift']());}}}(a8_0x2281,0x3a336));import{existsSync}from'node:fs';import a8_0x25013d from'node:path';import{readRawConfig}from'../context/config-loader.js';import{MODEL_REGISTRY_FILE_NAME,readModelRegistry}from'../api/model-registry-file.js';import{CliErrors}from'../errors.js';import{CLI_BIN_NAME}from'../constant/cli.js';function a8_0x2589(_0x260b0a,_0x302f27){_0x260b0a=_0x260b0a-0x1bb;const _0x2281ae=a8_0x2281();let _0x258988=_0x2281ae[_0x260b0a];return _0x258988;}export function resolveApiModelSource(_0x15a103,_0xf9c05a,_0x127e9c){const _0x293e91=a8_0x2589,_0x36cc68=a8_0x25013d[_0x293e91(0x1cf)](process['cwd'](),_0x15a103),_0x2e6c34=a8_0x25013d[_0x293e91(0x1cf)](_0x36cc68,_0x293e91(0x1c6)),_0x2869cb=a8_0x25013d['resolve'](_0x36cc68,MODEL_REGISTRY_FILE_NAME),_0x3d2de5=readModelRegistry(_0x2869cb);if(_0x3d2de5){const _0x46a5e8=_0xf9c05a?Object[_0x293e91(0x1c4)](_0x3d2de5[_0x293e91(0x1d1)])['filter'](([,_0xad0227])=>_0xad0227['appCode']===_0xf9c05a):[];if(_0x127e9c){if(_0x3d2de5[_0x293e91(0x1d1)][_0x127e9c])return{'filePath':_0x2869cb,'profileName':_0x127e9c};if(_0x46a5e8[_0x293e91(0x1d6)]>0x0)throw CliErrors[_0x293e91(0x1cc)](_0x293e91(0x1c2)+_0x127e9c+'\x22\x20is\x20missing\x20from\x20'+MODEL_REGISTRY_FILE_NAME+'.',_0x293e91(0x1cd)+CLI_BIN_NAME+_0x293e91(0x1ce)+_0x127e9c+'`\x20first.');}else{if(_0x46a5e8[_0x293e91(0x1d6)]===0x1)return{'filePath':_0x2869cb,'profileName':_0x46a5e8[0x0][0x0]};if(_0x46a5e8[_0x293e91(0x1d6)]>0x1)throw new Error(_0x293e91(0x1bc)+_0xf9c05a+'\x22\x20belongs\x20to\x20multiple\x20model\x20profiles:\x20'+_0x46a5e8[_0x293e91(0x1d3)](([_0x344092])=>_0x344092)['join'](',\x20')+'.\x20'+_0x293e91(0x1bf));if(_0x3d2de5[_0x293e91(0x1d1)][_0x3d2de5['defaultProfile']]&&!_0xf9c05a)return{'filePath':_0x2869cb,'profileName':_0x3d2de5[_0x293e91(0x1cb)]};}}if(!_0xf9c05a&&!_0x127e9c)return{'filePath':_0x2e6c34};const _0x36306c=readRawConfig(),_0x18f0f7=_0x36306c[_0x293e91(0x1bd)]&&typeof _0x36306c[_0x293e91(0x1bd)]===_0x293e91(0x1be)?_0x36306c[_0x293e91(0x1bd)]:{},_0x791d46=_0x127e9c&&_0x18f0f7[_0x127e9c]?[_0x127e9c,_0x18f0f7[_0x127e9c]]:Object[_0x293e91(0x1c4)](_0x18f0f7)[_0x293e91(0x1bb)](([,_0x1a3159])=>_0x1a3159?.[_0x293e91(0x1c7)]===_0xf9c05a);if(!_0x791d46)return{'filePath':_0x2e6c34};const [_0x36ee10,_0x304dce]=_0x791d46,_0x514442=typeof _0x36306c[_0x293e91(0x1c8)]==='string'?_0x36306c[_0x293e91(0x1c8)]:undefined;if(_0x304dce?.[_0x293e91(0x1d7)])return{'filePath':_0x2e6c34};if(_0x514442&&_0x36ee10!==_0x514442){const _0x98e471=a8_0x25013d[_0x293e91(0x1cf)](_0x36cc68,_0x36ee10+_0x293e91(0x1c0));if(existsSync(_0x98e471))return{'filePath':_0x98e471};}return{'filePath':_0x2e6c34};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x329f55,_0x40bb3d){const _0x5038d4=a9_0xd49c,_0x477ef7=_0x329f55();while(!![]){try{const _0x362b14=-parseInt(_0x5038d4(0x182))/0x1*(parseInt(_0x5038d4(0x17b))/0x2)+parseInt(_0x5038d4(0x176))/0x3+-parseInt(_0x5038d4(0x17f))/0x4*(-parseInt(_0x5038d4(0x170))/0x5)+parseInt(_0x5038d4(0x177))/0x6*(parseInt(_0x5038d4(0x179))/0x7)+parseInt(_0x5038d4(0x174))/0x8*(parseInt(_0x5038d4(0x180))/0x9)+-parseInt(_0x5038d4(0x171))/0xa+-parseInt(_0x5038d4(0x181))/0xb;if(_0x362b14===_0x40bb3d)break;else _0x477ef7['push'](_0x477ef7['shift']());}catch(_0x257957){_0x477ef7['push'](_0x477ef7['shift']());}}}(a9_0x2ed0,0x8cdc5));function a9_0xd49c(_0x58e676,_0xcf153d){_0x58e676=_0x58e676-0x170;const _0x2ed09a=a9_0x2ed0();let _0xd49c57=_0x2ed09a[_0x58e676];return _0xd49c57;}import{getIsSessionValid}from'../auth/is-session-valid.js';import{authServer}from'../auth/auth-server.js';function a9_0x2ed0(){const _0x2464bb=['1133674lfZqLz','start','No\x20valid\x20session.\x20Login\x20now?','validation','2222740kXbcCd','531JddUqI','12986820gCyMzA','2VmCCcB','nonInteractive','autoYes','*\x20Login\x20successful!','Logging\x20in...\x20Please\x20complete\x20login\x20in\x20your\x20browser.','5nZIQZx','197930EXSBDZ','Starting\x20browser\x20login.\x20Share\x20the\x20printed\x20URL\x20with\x20the\x20user.','Run\x20`','118136rBiALq','log','1374747FnonlI','4470DxofDv','√\x20Valid\x20session\x20detected,\x20no\x20login\x20required.','9639NCNiJN','Browser\x20login\x20cannot\x20run\x20in\x20non-interactive\x20mode.'];a9_0x2ed0=function(){return _0x2464bb;};return a9_0x2ed0();}import{CLI_BIN_NAME}from'../constant/cli.js';import{CliErrors}from'../errors.js';import{confirm}from'@inquirer/prompts';import a9_0x215a45 from'ora';export async function runAuthServer(_0x345ffb){const _0x449f0b=a9_0xd49c,_0x51aaa1=await getIsSessionValid();if(_0x51aaa1){console[_0x449f0b(0x175)](_0x449f0b(0x178));return;}if(_0x345ffb?.[_0x449f0b(0x183)]&&!_0x345ffb[_0x449f0b(0x184)])throw CliErrors[_0x449f0b(0x17e)](_0x449f0b(0x17a),_0x449f0b(0x173)+CLI_BIN_NAME+'\x20auth\x20login\x20--yes`\x20and\x20open\x20the\x20printed\x20URL\x20in\x20your\x20browser.');const _0x52ecec=_0x345ffb?.[_0x449f0b(0x184)]?!![]:await confirm({'message':_0x449f0b(0x17d),'default':!![]});if(!_0x52ecec)return;if(_0x345ffb?.[_0x449f0b(0x183)]){console[_0x449f0b(0x175)](_0x449f0b(0x172));const _0x53110f=await authServer({'silent':![],'openBrowser':![]});_0x53110f?console[_0x449f0b(0x175)](_0x449f0b(0x185)):console[_0x449f0b(0x175)]('!\x20Login\x20failed.');return;}const _0x53f4cc=a9_0x215a45(_0x449f0b(0x186))[_0x449f0b(0x17c)](),_0x118625=await authServer({'silent':!![],'openBrowser':!![]});_0x53f4cc['stop'](),_0x118625?console[_0x449f0b(0x175)](_0x449f0b(0x185)):console['log']('!\x20Login\x20failed.');}
|
package/lib/auth/auth-server.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a10_0x36b5fb=a10_0x1d8b;(function(_0x2023fc,_0x4bdef3){const _0x3c76ee=a10_0x1d8b,_0x3bceaa=_0x2023fc();while(!![]){try{const _0x4463b6=parseInt(_0x3c76ee(0x1e4))/0x1*(parseInt(_0x3c76ee(0x1c6))/0x2)+-parseInt(_0x3c76ee(0x1db))/0x3*(parseInt(_0x3c76ee(0x1e3))/0x4)+-parseInt(_0x3c76ee(0x1b2))/0x5*(-parseInt(_0x3c76ee(0x1c3))/0x6)+parseInt(_0x3c76ee(0x1e0))/0x7*(parseInt(_0x3c76ee(0x1d7))/0x8)+-parseInt(_0x3c76ee(0x1bf))/0x9*(-parseInt(_0x3c76ee(0x1dd))/0xa)+-parseInt(_0x3c76ee(0x1e2))/0xb*(-parseInt(_0x3c76ee(0x1ce))/0xc)+-parseInt(_0x3c76ee(0x1b3))/0xd;if(_0x4463b6===_0x4bdef3)break;else _0x3bceaa['push'](_0x3bceaa['shift']());}catch(_0x1a7bb0){_0x3bceaa['push'](_0x3bceaa['shift']());}}}(a10_0x5937,0x4714e));function a10_0x1d8b(_0x37794f,_0x392135){_0x37794f=_0x37794f-0x1b2;const _0x593735=a10_0x5937();let _0x1d8bd3=_0x593735[_0x37794f];return _0x1d8bd3;}import{writeFileSync}from'node:fs';import a10_0x22c0a8 from'node:http';import a10_0x48b267 from'node:https';import{getUserDomain}from'../constant/domain.js';import{getOfficialRoutingCdn,getOfficialRoutingProfile}from'../constant/routing-profile.js';import{getProjectDomainRoutingManifest}from'../config/project-domain-routing.js';import{exec}from'node:child_process';import{getIsSessionValid}from'../auth/is-session-valid.js';import{cookieFile}from'../auth/constant.js';import{buildLoginSuccessHtml}from'../auth/login-success-html.js';export const AUTH_LOGIN_TIMEOUT_MS=0xa*0x3c*0x3e8;export function resolveAuthCallbackRouting(_0x508011){const _0x4e40ac=a10_0x1d8b;if(!_0x508011)return getProjectDomainRoutingManifest()[_0x4e40ac(0x1be)];const _0x2134a4=getOfficialRoutingProfile(_0x508011),_0x45574a=getOfficialRoutingCdn(_0x508011);return{'origin':_0x2134a4[_0x4e40ac(0x1be)][_0x4e40ac(0x1c9)],'certificateUrl':_0x45574a[_0x4e40ac(0x1d1)]+_0x4e40ac(0x1c2)};}function a10_0x5937(){const _0x113667=['10FbWdRB','16436472oMfNLg','session','error','json','platform','⚠️\x20\x20Failed\x20to\x20open\x20browser\x20automatically','127.0.0.1','🔗\x20Please\x20copy\x20the\x20login\x20URL\x20into\x20your\x20browser:','end','📍\x20Login\x20URL:','💡\x20If\x20the\x20browser\x20does\x20not\x20open\x20automatically,\x20copy\x20the\x20login\x20URL\x20above\x20into\x20your\x20browser.','local','41661toxFHX','catch','object','/cert/lovrabet-dev.json','724686rAUYFH','utf-8','createServer','866SGdvnH','user','then','origin','silent','Auth\x20server\x20error:','port','🌐\x20Attempting\x20to\x20open\x20browser\x20automatically...','58932CNSgNW','close','!\x20Login\x20URL\x20expired\x20after\x2010\x20minutes.\x20Run\x20the\x20login\x20command\x20again\x20to\x20get\x20a\x20new\x20URL.','lovrabet','timeoutMs','open\x20\x22','win32','✅\x20Browser\x20opened.\x20Please\x20complete\x20login\x20in\x20the\x20browser.','xdg-open\x20\x22','2368tmrdDq','headers','cmd\x20/c\x20start\x20\x22\x22\x20\x22','log','9upXwhQ','listen','830pHgJbu','address','openBrowser','8848GGuUkn','text/html;\x20charset=utf-8','847LniJJL','372508xLWMDx','1055KNdKws','isAuth'];a10_0x5937=function(){return _0x113667;};return a10_0x5937();}function withPort(_0x1b8263,_0x3ab92f){const _0x4e144a=a10_0x1d8b,_0x219925=new URL(_0x1b8263);return _0x219925[_0x4e144a(0x1cc)]=String(_0x3ab92f),_0x219925[_0x4e144a(0x1c9)];}export async function authServer(_0x37bfb1){const _0x3fa7c6=a10_0x1d8b,_0x4b378c=_0x37bfb1?.[_0x3fa7c6(0x1ca)]||![],_0x5298fa=_0x37bfb1?.[_0x3fa7c6(0x1df)]??!![],_0x414eaa=_0x37bfb1?.[_0x3fa7c6(0x1d2)]??AUTH_LOGIN_TIMEOUT_MS;if(await getIsSessionValid())return!![];const _0x1e6cdd=resolveAuthCallbackRouting(),_0x5ef1e1=_0x1e6cdd['certificateUrl']?await(await fetch(_0x1e6cdd['certificateUrl']))['json']():undefined;return new Promise(async(_0x26a435,_0x3cefdf)=>{const _0x3de960=_0x3fa7c6;let _0x3bdea9=0x0,_0x2f8f4d=![],_0xcc62e7;const _0x24d9db=async(_0x1e22f2,_0x4ac0da)=>{const _0x141cb5=a10_0x1d8b,_0x509aee=getUserDomain(),_0x1bfc5e=_0x1e22f2[_0x141cb5(0x1d8)]['cookie']||'',_0x2a1b6e=await fetch(_0x509aee+'/api/auth/get-session',{'headers':{'cookie':_0x1bfc5e}})[_0x141cb5(0x1c8)](_0x20dfbf=>_0x20dfbf[_0x141cb5(0x1b6)]()),_0x19227d=_0x2a1b6e&&_0x2a1b6e[_0x141cb5(0x1b4)]&&_0x2a1b6e[_0x141cb5(0x1c7)];if(_0x19227d){writeFileSync(cookieFile,_0x1bfc5e,_0x141cb5(0x1c4));const _0x1455e4=buildLoginSuccessHtml();_0x4ac0da['writeHead'](0xc8,{'Content-Type':_0x141cb5(0x1e1)}),_0x4ac0da['end'](_0x1455e4),_0x5ab26a(!![]);}else{const _0xa4f5ec=encodeURIComponent(withPort(_0x1e6cdd[_0x141cb5(0x1c9)],_0x3bdea9));_0x4ac0da['writeHead'](0x12e,{'location':_0x509aee+'/sign-in?redirect='+_0xa4f5ec}),_0x4ac0da[_0x141cb5(0x1bb)]();return;}},_0x14f1a1=_0x5ef1e1?a10_0x48b267['createServer'](_0x5ef1e1,_0x24d9db):a10_0x22c0a8[_0x3de960(0x1c5)](_0x24d9db);function _0x5ab26a(_0x214686){const _0x19f6ca=_0x3de960;if(_0x2f8f4d)return;_0x2f8f4d=!![],_0xcc62e7&&clearTimeout(_0xcc62e7),_0x14f1a1[_0x19f6ca(0x1cf)](),_0x26a435(_0x214686);}_0x14f1a1[_0x3de960(0x1dc)](0x0,_0x3de960(0x1b9),()=>{const _0x40d0f4=_0x3de960,_0xf893df=_0x14f1a1[_0x40d0f4(0x1de)]();_0x3bdea9=typeof _0xf893df===_0x40d0f4(0x1c1)&&_0xf893df?_0xf893df[_0x40d0f4(0x1cc)]:Number(_0xf893df);const _0x4af864=withPort(_0x1e6cdd[_0x40d0f4(0x1c9)],_0x3bdea9);_0xcc62e7=setTimeout(()=>{const _0x3f9ee4=_0x40d0f4;!_0x4b378c&&console['log'](_0x3f9ee4(0x1d0)),_0x5ab26a(![]);},_0x414eaa);!_0x4b378c&&(console[_0x40d0f4(0x1da)]('🔐\x20Starting\x20login\x20service...'),console[_0x40d0f4(0x1da)](_0x40d0f4(0x1bc),_0x4af864),_0x5298fa?(console[_0x40d0f4(0x1da)](_0x40d0f4(0x1cd)),console[_0x40d0f4(0x1da)](''),console[_0x40d0f4(0x1da)](_0x40d0f4(0x1bd))):console['log']('💡\x20Open\x20the\x20login\x20URL\x20above\x20in\x20your\x20browser\x20to\x20complete\x20authorization.'),console[_0x40d0f4(0x1da)](''));if(!_0x5298fa)return;openInBrowser(_0x4af864)[_0x40d0f4(0x1c8)](_0x2fa2da=>{const _0x38f5b2=_0x40d0f4;!_0x4b378c&&(_0x2fa2da?console[_0x38f5b2(0x1da)](_0x38f5b2(0x1d5)):(console[_0x38f5b2(0x1da)](_0x38f5b2(0x1b8)),console[_0x38f5b2(0x1da)](_0x38f5b2(0x1ba),_0x4af864)),console['log'](''));})[_0x40d0f4(0x1c0)](()=>{const _0x4d3593=_0x40d0f4;!_0x4b378c&&(console[_0x4d3593(0x1da)]('⚠️\x20\x20Failed\x20to\x20open\x20browser\x20automatically'),console[_0x4d3593(0x1da)]('🔗\x20Please\x20copy\x20the\x20login\x20URL\x20into\x20your\x20browser:',_0x4af864),console[_0x4d3593(0x1da)](''));});}),_0x14f1a1['on'](_0x3de960(0x1b5),_0x2bbeab=>{const _0x2f7c6e=_0x3de960;if(_0x2f8f4d)return;_0x2f8f4d=!![],_0xcc62e7&&clearTimeout(_0xcc62e7),!_0x4b378c&&console['error'](_0x2f7c6e(0x1cb),_0x2bbeab),_0x14f1a1['close'](),_0x3cefdf(_0x2bbeab);});});}function openInBrowser(_0x3900f7){return new Promise(_0x24927c=>{const _0x14f42c=a10_0x1d8b,_0x104d49=process[_0x14f42c(0x1b7)];let _0x3ad2c0;if(_0x104d49===_0x14f42c(0x1d4))_0x3ad2c0=_0x14f42c(0x1d9)+_0x3900f7+'\x22';else _0x104d49==='darwin'?_0x3ad2c0=_0x14f42c(0x1d3)+_0x3900f7+'\x22':_0x3ad2c0=_0x14f42c(0x1d6)+_0x3900f7+'\x22';exec(_0x3ad2c0,_0x3f3926=>{_0x3f3926?_0x24927c(![]):_0x24927c(!![]);});});}if(import.meta.main){const isAuth=await authServer();console['log'](a10_0x36b5fb(0x1e5),isAuth);}
|
package/lib/auth/constant.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a11_0x53876c=a11_0x17bf;(function(_0x53d7fb,_0x57c845){const _0x331932=a11_0x17bf,_0x56500a=_0x53d7fb();while(!![]){try{const _0xffa8c2=parseInt(_0x331932(0x77))/0x1+parseInt(_0x331932(0x78))/0x2+-parseInt(_0x331932(0x7b))/0x3+-parseInt(_0x331932(0x80))/0x4+parseInt(_0x331932(0x7a))/0x5*(-parseInt(_0x331932(0x7f))/0x6)+parseInt(_0x331932(0x7e))/0x7*(-parseInt(_0x331932(0x7d))/0x8)+parseInt(_0x331932(0x7c))/0x9;if(_0xffa8c2===_0x57c845)break;else _0x56500a['push'](_0x56500a['shift']());}catch(_0x4d7a61){_0x56500a['push'](_0x56500a['shift']());}}}(a11_0x43ba,0xc4c6f));import{mkdirSync}from'node:fs';import{homedir}from'node:os';import{join}from'node:path';export const configDir=join(homedir(),a11_0x53876c(0x76));export const cookieFile=join(configDir,a11_0x53876c(0x79));function a11_0x17bf(_0x58eccf,_0x5b497c){_0x58eccf=_0x58eccf-0x76;const _0x43bafb=a11_0x43ba();let _0x17bf5e=_0x43bafb[_0x58eccf];return _0x17bf5e;}mkdirSync(configDir,{'recursive':!![]});function a11_0x43ba(){const _0x1a66d4=['238qiEiEB','66ZrlrCj','938740dcTMwJ','.lovrabet','1378624jFJzhm','587916ouukaF','cookie','251835JqrwnE','4713399GCwFzy','18409500zNoGts','129936oSyiXP'];a11_0x43ba=function(){return _0x1a66d4;};return a11_0x43ba();}
|
package/lib/auth/get-cookie.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x2da93c,_0x16ce36){var _0x19db0b=a12_0x2579,_0x28cf24=_0x2da93c();while(!![]){try{var _0xf3646c=parseInt(_0x19db0b(0x8c))/0x1+parseInt(_0x19db0b(0x8e))/0x2+-parseInt(_0x19db0b(0x90))/0x3*(parseInt(_0x19db0b(0x8a))/0x4)+parseInt(_0x19db0b(0x8d))/0x5+parseInt(_0x19db0b(0x8f))/0x6+parseInt(_0x19db0b(0x94))/0x7*(parseInt(_0x19db0b(0x8b))/0x8)+-parseInt(_0x19db0b(0x93))/0x9*(parseInt(_0x19db0b(0x92))/0xa);if(_0xf3646c===_0x16ce36)break;else _0x28cf24['push'](_0x28cf24['shift']());}catch(_0x3f5ff7){_0x28cf24['push'](_0x28cf24['shift']());}}}(a12_0x4d6a,0x839f6));import{readFileSync}from'node:fs';function a12_0x2579(_0x5ae507,_0x4ffb5e){_0x5ae507=_0x5ae507-0x8a;var _0x4d6ac9=a12_0x4d6a();var _0x257993=_0x4d6ac9[_0x5ae507];return _0x257993;}import{cookieFile}from'../auth/constant.js';function a12_0x4d6a(){var _0x159702=['utf-8','10RlgkDV','17874261MlCYTz','1435tMaoMI','904OaipZN','19912YKmgrj','908712ljEMUX','947130jWKvzl','1543366eFrcwE','3109290bnvoJd','4953afPRZL'];a12_0x4d6a=function(){return _0x159702;};return a12_0x4d6a();}export function getCookie(){var _0x9ef897=a12_0x2579;try{return readFileSync(cookieFile,_0x9ef897(0x91));}catch{}return'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x2b6c69,_0x391e8a){const _0x2ce001=a13_0x48cf,_0x4bf1c6=_0x2b6c69();while(!![]){try{const _0x51db9d=parseInt(_0x2ce001(0x1d1))/0x1+-parseInt(_0x2ce001(0x1d8))/0x2*(-parseInt(_0x2ce001(0x1d6))/0x3)+parseInt(_0x2ce001(0x1da))/0x4+-parseInt(_0x2ce001(0x1d2))/0x5*(parseInt(_0x2ce001(0x1d9))/0x6)+-parseInt(_0x2ce001(0x1d3))/0x7+-parseInt(_0x2ce001(0x1d4))/0x8*(-parseInt(_0x2ce001(0x1db))/0x9)+-parseInt(_0x2ce001(0x1d5))/0xa;if(_0x51db9d===_0x391e8a)break;else _0x4bf1c6['push'](_0x4bf1c6['shift']());}catch(_0x2cde89){_0x4bf1c6['push'](_0x4bf1c6['shift']());}}}(a13_0x102c,0x7c29e));import{existsSync,readFileSync}from'node:fs';import{getUserDomain}from'../constant/domain.js';function a13_0x48cf(_0x31e201,_0x3f3238){_0x31e201=_0x31e201-0x1d0;const _0x102ca8=a13_0x102c();let _0x48cf38=_0x102ca8[_0x31e201];return _0x48cf38;}import{cookieFile}from'../auth/constant.js';export async function getSessionUserInfo(){const _0x4b4134=a13_0x48cf;try{if(!existsSync(cookieFile))return null;const _0x18b206=readFileSync(cookieFile,_0x4b4134(0x1dc)),_0x516651=await fetch(getUserDomain()+_0x4b4134(0x1de),{'headers':{'cookie':_0x18b206}});if(!_0x516651['ok'])return null;const _0x29a101=await _0x516651[_0x4b4134(0x1dd)]();if(!_0x29a101[_0x4b4134(0x1d0)]||!_0x29a101[_0x4b4134(0x1d7)])return null;return _0x29a101;}catch{return null;}}function a13_0x102c(){const _0x60a8e2=['193455ODpVdf','utf-8','json','/api/auth/get-session','session','979185cRetCt','682060xqgsLQ','3694460YPxpvV','360rGMxhn','16832150QiVitP','79893KoOyYx','user','50DvUDZh','24tqBRNy','2611928gyWhYW'];a13_0x102c=function(){return _0x60a8e2;};return a13_0x102c();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a14_0x24c8(_0x36d84d,_0x41a2d7){_0x36d84d=_0x36d84d-0x124;const _0x2445c8=a14_0x2445();let _0x24c8e4=_0x2445c8[_0x36d84d];return _0x24c8e4;}(function(_0x239b33,_0x10f90){const _0x3b6401=a14_0x24c8,_0xd2ff2e=_0x239b33();while(!![]){try{const _0x35ef96=parseInt(_0x3b6401(0x12d))/0x1+parseInt(_0x3b6401(0x12b))/0x2*(parseInt(_0x3b6401(0x124))/0x3)+parseInt(_0x3b6401(0x128))/0x4+-parseInt(_0x3b6401(0x127))/0x5*(parseInt(_0x3b6401(0x132))/0x6)+parseInt(_0x3b6401(0x12e))/0x7+-parseInt(_0x3b6401(0x129))/0x8+-parseInt(_0x3b6401(0x130))/0x9;if(_0x35ef96===_0x10f90)break;else _0xd2ff2e['push'](_0xd2ff2e['shift']());}catch(_0x299174){_0xd2ff2e['push'](_0xd2ff2e['shift']());}}}(a14_0x2445,0x60d30));import{existsSync,readFileSync}from'node:fs';import{getUserDomain}from'../constant/domain.js';import{cookieFile}from'../auth/constant.js';export async function getIsSessionValid(){const _0x2ab555=a14_0x24c8;try{if(!existsSync(cookieFile))return![];const _0x232766=readFileSync(cookieFile,_0x2ab555(0x12f)),_0x48a66d=await fetch(getUserDomain()+_0x2ab555(0x126),{'headers':{'cookie':_0x232766}})[_0x2ab555(0x12a)](_0x559d84=>_0x559d84[_0x2ab555(0x12c)]());return _0x48a66d&&_0x48a66d[_0x2ab555(0x125)]&&_0x48a66d[_0x2ab555(0x131)];}catch{}return![];}function a14_0x2445(){const _0x9a77e3=['78EuqkcQ','json','316879ZxHnmN','2296567qqXGdZ','utf-8','3279861VTJohi','user','2286nSUrDh','20271atvlzK','session','/api/auth/get-session','7470FBSjyD','2357512PnaeyI','1341008xkqDba','then'];a14_0x2445=function(){return _0x9a77e3;};return a14_0x2445();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a15_0xaca9(){const _0x1fdfbe=['999336DasbFU','60mySnuj','4vYoubK','18OZeABP','1718485rJlJjC','Unable\x20to\x20close\x20automatically.\x20Please\x20close\x20this\x20tab\x20or\x20window\x20manually.','</div>\x0a\x20\x20\x20\x20<p\x20class=\x22cli-hint\x22>Rabetbase\x20CLI\x20·\x20session\x20saved\x20locally</p>\x0a\x20\x20</div>\x0a\x20\x20<script>\x0a\x20\x20(function(){\x0a\x20\x20\x20\x20var\x20t\x20=\x205;\x0a\x20\x20\x20\x20var\x20el\x20=\x20document.getElementById(\x27t\x27);\x0a\x20\x20\x20\x20var\x20manual\x20=\x20document.getElementById(\x27manualMsg\x27);\x0a\x20\x20\x20\x20var\x20id\x20=\x20setInterval(function(){\x0a\x20\x20\x20\x20\x20\x20t--;\x0a\x20\x20\x20\x20\x20\x20if\x20(t\x20<=\x200)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20clearInterval(id);\x0a\x20\x20\x20\x20\x20\x20\x20\x20el.textContent\x20=\x20\x270\x27;\x0a\x20\x20\x20\x20\x20\x20\x20\x20try\x20{\x20window.close();\x20}\x20catch(e)\x20{}\x0a\x20\x20\x20\x20\x20\x20\x20\x20setTimeout(function(){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(!window.closed)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20manual.style.display\x20=\x20\x27block\x27;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20},\x20300);\x0a\x20\x20\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20el.textContent\x20=\x20String(t);\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20},\x201000);\x0a\x20\x20})();\x0a\x20\x20</script>\x0a</body>\x0a</html>','67332ygnidu','329579IDrKCE','289980VUIaLh','<!doctype\x20html>\x0a<html\x20lang=\x22en\x22>\x0a<head>\x0a\x20\x20<meta\x20charset=\x22utf-8\x22>\x0a\x20\x20<meta\x20name=\x22viewport\x22\x20content=\x22width=device-width,\x20initial-scale=1\x22>\x0a\x20\x20<title>Login\x20successful\x20·\x20Rabetbase\x20CLI</title>\x0a\x20\x20<style>\x0a\x20\x20\x20\x20:root\x20{\x0a\x20\x20\x20\x20\x20\x20--bg0:\x20#0f1419;\x0a\x20\x20\x20\x20\x20\x20--bg1:\x20#1a2332;\x0a\x20\x20\x20\x20\x20\x20--card:\x20#ffffff;\x0a\x20\x20\x20\x20\x20\x20--text:\x20#1c2128;\x0a\x20\x20\x20\x20\x20\x20--muted:\x20#5c6570;\x0a\x20\x20\x20\x20\x20\x20--accent:\x20#2563eb;\x0a\x20\x20\x20\x20\x20\x20--accent-soft:\x20#eff6ff;\x0a\x20\x20\x20\x20\x20\x20--success:\x20#059669;\x0a\x20\x20\x20\x20\x20\x20--radius:\x2016px;\x0a\x20\x20\x20\x20\x20\x20--shadow:\x200\x2025px\x2050px\x20-12px\x20rgba(15,\x2020,\x2025,\x200.35);\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20*\x20{\x20box-sizing:\x20border-box;\x20}\x0a\x20\x20\x20\x20body\x20{\x0a\x20\x20\x20\x20\x20\x20margin:\x200;\x0a\x20\x20\x20\x20\x20\x20min-height:\x20100vh;\x0a\x20\x20\x20\x20\x20\x20display:\x20flex;\x0a\x20\x20\x20\x20\x20\x20align-items:\x20center;\x0a\x20\x20\x20\x20\x20\x20justify-content:\x20center;\x0a\x20\x20\x20\x20\x20\x20padding:\x2024px;\x0a\x20\x20\x20\x20\x20\x20font-family:\x20ui-sans-serif,\x20system-ui,\x20-apple-system,\x20\x22Segoe\x20UI\x22,\x20Roboto,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22Helvetica\x20Neue\x22,\x20Arial,\x20\x22Noto\x20Sans\x22,\x20\x22PingFang\x20SC\x22,\x20\x22Microsoft\x20YaHei\x22,\x20sans-serif;\x0a\x20\x20\x20\x20\x20\x20background:\x20linear-gradient(160deg,\x20var(--bg0)\x200%,\x20var(--bg1)\x2045%,\x20#243047\x20100%);\x0a\x20\x20\x20\x20\x20\x20color:\x20var(--text);\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20.card\x20{\x0a\x20\x20\x20\x20\x20\x20width:\x20100%;\x0a\x20\x20\x20\x20\x20\x20max-width:\x20420px;\x0a\x20\x20\x20\x20\x20\x20background:\x20var(--card);\x0a\x20\x20\x20\x20\x20\x20border-radius:\x20var(--radius);\x0a\x20\x20\x20\x20\x20\x20box-shadow:\x20var(--shadow);\x0a\x20\x20\x20\x20\x20\x20padding:\x2040px\x2036px\x2032px;\x0a\x20\x20\x20\x20\x20\x20text-align:\x20center;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20.icon\x20{\x0a\x20\x20\x20\x20\x20\x20width:\x2064px;\x0a\x20\x20\x20\x20\x20\x20height:\x2064px;\x0a\x20\x20\x20\x20\x20\x20margin:\x200\x20auto\x2020px;\x0a\x20\x20\x20\x20\x20\x20border-radius:\x2050%;\x0a\x20\x20\x20\x20\x20\x20background:\x20var(--accent-soft);\x0a\x20\x20\x20\x20\x20\x20display:\x20flex;\x0a\x20\x20\x20\x20\x20\x20align-items:\x20center;\x0a\x20\x20\x20\x20\x20\x20justify-content:\x20center;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20.icon\x20svg\x20{\x20width:\x2036px;\x20height:\x2036px;\x20}\x0a\x20\x20\x20\x20h1\x20{\x0a\x20\x20\x20\x20\x20\x20margin:\x200\x200\x2012px;\x0a\x20\x20\x20\x20\x20\x20font-size:\x201.375rem;\x0a\x20\x20\x20\x20\x20\x20font-weight:\x20600;\x0a\x20\x20\x20\x20\x20\x20letter-spacing:\x20-0.02em;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20p.lead\x20{\x0a\x20\x20\x20\x20\x20\x20margin:\x200\x200\x208px;\x0a\x20\x20\x20\x20\x20\x20font-size:\x200.9375rem;\x0a\x20\x20\x20\x20\x20\x20color:\x20var(--muted);\x0a\x20\x20\x20\x20\x20\x20line-height:\x201.55;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20.countdown\x20{\x0a\x20\x20\x20\x20\x20\x20display:\x20inline-flex;\x0a\x20\x20\x20\x20\x20\x20align-items:\x20center;\x0a\x20\x20\x20\x20\x20\x20gap:\x206px;\x0a\x20\x20\x20\x20\x20\x20margin-top:\x2016px;\x0a\x20\x20\x20\x20\x20\x20padding:\x208px\x2014px;\x0a\x20\x20\x20\x20\x20\x20font-size:\x200.875rem;\x0a\x20\x20\x20\x20\x20\x20font-variant-numeric:\x20tabular-nums;\x0a\x20\x20\x20\x20\x20\x20color:\x20var(--accent);\x0a\x20\x20\x20\x20\x20\x20background:\x20var(--accent-soft);\x0a\x20\x20\x20\x20\x20\x20border-radius:\x20999px;\x0a\x20\x20\x20\x20\x20\x20font-weight:\x20500;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20#manualMsg\x20{\x0a\x20\x20\x20\x20\x20\x20display:\x20none;\x0a\x20\x20\x20\x20\x20\x20margin-top:\x2020px;\x0a\x20\x20\x20\x20\x20\x20font-size:\x200.8125rem;\x0a\x20\x20\x20\x20\x20\x20color:\x20#b91c1c;\x0a\x20\x20\x20\x20\x20\x20line-height:\x201.45;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20.cli-hint\x20{\x0a\x20\x20\x20\x20\x20\x20margin-top:\x2028px;\x0a\x20\x20\x20\x20\x20\x20padding-top:\x2024px;\x0a\x20\x20\x20\x20\x20\x20border-top:\x201px\x20solid\x20#e8ecf0;\x0a\x20\x20\x20\x20\x20\x20font-size:\x200.75rem;\x0a\x20\x20\x20\x20\x20\x20color:\x20#8b949e;\x0a\x20\x20\x20\x20}\x0a\x20\x20</style>\x0a</head>\x0a<body>\x0a\x20\x20<div\x20class=\x22card\x22\x20role=\x22status\x22\x20aria-live=\x22polite\x22>\x0a\x20\x20\x20\x20<div\x20class=\x22icon\x22\x20aria-hidden=\x22true\x22>\x0a\x20\x20\x20\x20\x20\x20<svg\x20viewBox=\x220\x200\x2024\x2024\x22\x20fill=\x22none\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<circle\x20cx=\x2212\x22\x20cy=\x2212\x22\x20r=\x2210\x22\x20stroke=\x22#059669\x22\x20stroke-width=\x222\x22\x20fill=\x22none\x22/>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<path\x20d=\x22M8\x2012.5l2.5\x202.5L16\x209\x22\x20stroke=\x22#059669\x22\x20stroke-width=\x222\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22/>\x0a\x20\x20\x20\x20\x20\x20</svg>\x0a\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20<h1>Login\x20successful</h1>\x0a\x20\x20\x20\x20<p\x20class=\x22lead\x22>You\x20can\x20return\x20to\x20the\x20terminal\x20to\x20continue.\x20This\x20window\x20will\x20try\x20to\x20close\x20automatically.</p>\x0a\x20\x20\x20\x20<div\x20class=\x22countdown\x22>\x0a\x20\x20\x20\x20\x20\x20Closing\x20in\x20<span\x20id=\x22t\x22>5</span>s\x0a\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20<div\x20id=\x22manualMsg\x22>','35119FQnCNf','223422AvKzXr'];a15_0xaca9=function(){return _0x1fdfbe;};return a15_0xaca9();}(function(_0x30f945,_0x2b99d4){const _0xe410ae=a15_0x57a4,_0x14e28a=_0x30f945();while(!![]){try{const _0x261368=-parseInt(_0xe410ae(0xd4))/0x1+-parseInt(_0xe410ae(0xe0))/0x2+-parseInt(_0xe410ae(0xd8))/0x3+parseInt(_0xe410ae(0xdb))/0x4*(parseInt(_0xe410ae(0xdd))/0x5)+-parseInt(_0xe410ae(0xdc))/0x6*(-parseInt(_0xe410ae(0xd7))/0x7)+parseInt(_0xe410ae(0xd9))/0x8+-parseInt(_0xe410ae(0xd5))/0x9*(-parseInt(_0xe410ae(0xda))/0xa);if(_0x261368===_0x2b99d4)break;else _0x14e28a['push'](_0x14e28a['shift']());}catch(_0x58a90d){_0x14e28a['push'](_0x14e28a['shift']());}}}(a15_0xaca9,0x3a6a2));function a15_0x57a4(_0x1f192c,_0x562884){_0x1f192c=_0x1f192c-0xd4;const _0xaca928=a15_0xaca9();let _0x57a4c7=_0xaca928[_0x1f192c];return _0x57a4c7;}export function buildLoginSuccessHtml(){const _0x5b1b61=a15_0x57a4,_0x26ef48=_0x5b1b61(0xde);return _0x5b1b61(0xd6)+_0x26ef48+_0x5b1b61(0xdf);}
|
package/lib/auth/logout.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x1c8230,_0x2978d0){var _0xc2f6f6=a16_0x14d1,_0x1a5472=_0x1c8230();while(!![]){try{var _0x12e04e=-parseInt(_0xc2f6f6(0xfc))/0x1*(parseInt(_0xc2f6f6(0xf9))/0x2)+parseInt(_0xc2f6f6(0xf5))/0x3*(parseInt(_0xc2f6f6(0xf6))/0x4)+parseInt(_0xc2f6f6(0xfa))/0x5*(-parseInt(_0xc2f6f6(0xfd))/0x6)+-parseInt(_0xc2f6f6(0xf4))/0x7*(-parseInt(_0xc2f6f6(0xf2))/0x8)+-parseInt(_0xc2f6f6(0xfb))/0x9+parseInt(_0xc2f6f6(0xf1))/0xa*(-parseInt(_0xc2f6f6(0xf0))/0xb)+parseInt(_0xc2f6f6(0xef))/0xc;if(_0x12e04e===_0x2978d0)break;else _0x1a5472['push'](_0x1a5472['shift']());}catch(_0x4608f4){_0x1a5472['push'](_0x1a5472['shift']());}}}(a16_0x1f08,0x6bb21));import{unlinkSync,existsSync}from'node:fs';function a16_0x14d1(_0x5ccc5d,_0x2377f6){_0x5ccc5d=_0x5ccc5d-0xef;var _0x1f0830=a16_0x1f08();var _0x14d180=_0x1f0830[_0x5ccc5d];return _0x14d180;}function a16_0x1f08(){var _0x1e1242=['353636ulsVlU','log','!\x20Not\x20logged\x20in','22dsZWbJ','4315ikvbKw','2561004CXlcUb','26099rYxbCM','3678dPjRHd','11784540zlLHfG','7249ZFiMgh','3350yaPRZw','49736kCLsJJ','✓\x20Logged\x20out','182hkHEFY','21njzHnE'];a16_0x1f08=function(){return _0x1e1242;};return a16_0x1f08();}import{cookieFile}from'../auth/constant.js';export function logout(){var _0x3deb2d=a16_0x14d1;existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x3deb2d(0xf7)](_0x3deb2d(0xf3))):console[_0x3deb2d(0xf7)](_0x3deb2d(0xf8));}
|