compair-core 0.3.11__tar.gz → 0.3.12__tar.gz

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.

Potentially problematic release.


This version of compair-core might be problematic. Click here for more details.

Files changed (43) hide show
  1. {compair_core-0.3.11 → compair_core-0.3.12}/PKG-INFO +2 -1
  2. {compair_core-0.3.11 → compair_core-0.3.12}/README.md +1 -0
  3. {compair_core-0.3.11 → compair_core-0.3.12}/compair_core/api.py +30 -0
  4. {compair_core-0.3.11 → compair_core-0.3.12}/compair_core/server/app.py +8 -2
  5. {compair_core-0.3.11 → compair_core-0.3.12}/compair_core/server/routers/capabilities.py +1 -0
  6. {compair_core-0.3.11 → compair_core-0.3.12}/compair_core/server/settings.py +1 -0
  7. {compair_core-0.3.11 → compair_core-0.3.12}/compair_core.egg-info/PKG-INFO +2 -1
  8. {compair_core-0.3.11 → compair_core-0.3.12}/pyproject.toml +1 -1
  9. {compair_core-0.3.11 → compair_core-0.3.12}/LICENSE +0 -0
  10. {compair_core-0.3.11 → compair_core-0.3.12}/compair_core/__init__.py +0 -0
  11. {compair_core-0.3.11 → compair_core-0.3.12}/compair_core/compair/__init__.py +0 -0
  12. {compair_core-0.3.11 → compair_core-0.3.12}/compair_core/compair/celery_app.py +0 -0
  13. {compair_core-0.3.11 → compair_core-0.3.12}/compair_core/compair/default_groups.py +0 -0
  14. {compair_core-0.3.11 → compair_core-0.3.12}/compair_core/compair/embeddings.py +0 -0
  15. {compair_core-0.3.11 → compair_core-0.3.12}/compair_core/compair/feedback.py +0 -0
  16. {compair_core-0.3.11 → compair_core-0.3.12}/compair_core/compair/logger.py +0 -0
  17. {compair_core-0.3.11 → compair_core-0.3.12}/compair_core/compair/main.py +0 -0
  18. {compair_core-0.3.11 → compair_core-0.3.12}/compair_core/compair/models.py +0 -0
  19. {compair_core-0.3.11 → compair_core-0.3.12}/compair_core/compair/schema.py +0 -0
  20. {compair_core-0.3.11 → compair_core-0.3.12}/compair_core/compair/tasks.py +0 -0
  21. {compair_core-0.3.11 → compair_core-0.3.12}/compair_core/compair/utils.py +0 -0
  22. {compair_core-0.3.11 → compair_core-0.3.12}/compair_core/compair_email/__init__.py +0 -0
  23. {compair_core-0.3.11 → compair_core-0.3.12}/compair_core/compair_email/email.py +0 -0
  24. {compair_core-0.3.11 → compair_core-0.3.12}/compair_core/compair_email/email_core.py +0 -0
  25. {compair_core-0.3.11 → compair_core-0.3.12}/compair_core/compair_email/templates.py +0 -0
  26. {compair_core-0.3.11 → compair_core-0.3.12}/compair_core/compair_email/templates_core.py +0 -0
  27. {compair_core-0.3.11 → compair_core-0.3.12}/compair_core/server/__init__.py +0 -0
  28. {compair_core-0.3.11 → compair_core-0.3.12}/compair_core/server/deps.py +0 -0
  29. {compair_core-0.3.11 → compair_core-0.3.12}/compair_core/server/local_model/__init__.py +0 -0
  30. {compair_core-0.3.11 → compair_core-0.3.12}/compair_core/server/local_model/app.py +0 -0
  31. {compair_core-0.3.11 → compair_core-0.3.12}/compair_core/server/providers/__init__.py +0 -0
  32. {compair_core-0.3.11 → compair_core-0.3.12}/compair_core/server/providers/console_mailer.py +0 -0
  33. {compair_core-0.3.11 → compair_core-0.3.12}/compair_core/server/providers/contracts.py +0 -0
  34. {compair_core-0.3.11 → compair_core-0.3.12}/compair_core/server/providers/local_storage.py +0 -0
  35. {compair_core-0.3.11 → compair_core-0.3.12}/compair_core/server/providers/noop_analytics.py +0 -0
  36. {compair_core-0.3.11 → compair_core-0.3.12}/compair_core/server/providers/noop_billing.py +0 -0
  37. {compair_core-0.3.11 → compair_core-0.3.12}/compair_core/server/providers/noop_ocr.py +0 -0
  38. {compair_core-0.3.11 → compair_core-0.3.12}/compair_core/server/routers/__init__.py +0 -0
  39. {compair_core-0.3.11 → compair_core-0.3.12}/compair_core.egg-info/SOURCES.txt +0 -0
  40. {compair_core-0.3.11 → compair_core-0.3.12}/compair_core.egg-info/dependency_links.txt +0 -0
  41. {compair_core-0.3.11 → compair_core-0.3.12}/compair_core.egg-info/requires.txt +0 -0
  42. {compair_core-0.3.11 → compair_core-0.3.12}/compair_core.egg-info/top_level.txt +0 -0
  43. {compair_core-0.3.11 → compair_core-0.3.12}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: compair-core
3
- Version: 0.3.11
3
+ Version: 0.3.12
4
4
  Summary: Open-source foundation of the Compair collaboration platform.
5
5
  Author: RocketResearch, Inc.
6
6
  License: MIT
@@ -91,6 +91,7 @@ Key environment variables for the core edition:
91
91
  - `COMPAIR_EMAIL_BACKEND` – the core mailer logs emails to stdout; cloud overrides this with transactional delivery.
92
92
  - `COMPAIR_REQUIRE_AUTHENTICATION` (`true`) – set to `false` to run the API in single-user mode without login or account management. When disabled, Compair auto-provisions a local user, group, and long-lived session token so you can upload documents immediately.
93
93
  - `COMPAIR_SINGLE_USER_USERNAME` / `COMPAIR_SINGLE_USER_NAME` – override the email-style username and display name that are used for the auto-provisioned local user in single-user mode.
94
+ - `COMPAIR_INCLUDE_LEGACY_ROUTES` (`false`) – opt-in to the full legacy API surface (used by the hosted product) when running the core edition. Leave unset to expose only the streamlined single-user endpoints in Swagger.
94
95
 
95
96
  See `compair_core/server/settings.py` for the full settings surface.
96
97
 
@@ -56,6 +56,7 @@ Key environment variables for the core edition:
56
56
  - `COMPAIR_EMAIL_BACKEND` – the core mailer logs emails to stdout; cloud overrides this with transactional delivery.
57
57
  - `COMPAIR_REQUIRE_AUTHENTICATION` (`true`) – set to `false` to run the API in single-user mode without login or account management. When disabled, Compair auto-provisions a local user, group, and long-lived session token so you can upload documents immediately.
58
58
  - `COMPAIR_SINGLE_USER_USERNAME` / `COMPAIR_SINGLE_USER_NAME` – override the email-style username and display name that are used for the auto-provisioned local user in single-user mode.
59
+ - `COMPAIR_INCLUDE_LEGACY_ROUTES` (`false`) – opt-in to the full legacy API surface (used by the hosted product) when running the core edition. Leave unset to expose only the streamlined single-user endpoints in Swagger.
59
60
 
60
61
  See `compair_core/server/settings.py` for the full settings surface.
61
62
 
@@ -13,6 +13,7 @@ import psutil
13
13
  from celery.result import AsyncResult
14
14
  from fastapi import APIRouter, Body, Depends, File, Form, Header, HTTPException, Query, Request, UploadFile
15
15
  from fastapi.responses import HTMLResponse, RedirectResponse, StreamingResponse
16
+ from fastapi.routing import APIRoute
16
17
  from sqlalchemy import distinct, func, select, or_
17
18
  from sqlalchemy.orm import joinedload, Session
18
19
 
@@ -46,6 +47,7 @@ redis_client = redis.Redis.from_url(redis_url) if (redis and redis_url) else Non
46
47
  #from compair.main import process_document
47
48
 
48
49
  router = APIRouter()
50
+ core_router = APIRouter()
49
51
  WEB_URL = os.environ.get("WEB_URL")
50
52
  ADMIN_API_KEY = os.environ.get("ADMIN_API_KEY")
51
53
 
@@ -3497,6 +3499,34 @@ def submit_deactivate_request(
3497
3499
  return {"message": f"We’ve received your request and will delete your account and data shortly. If you change your mind, reach out within 24 hours at {EMAIL_USER}."}
3498
3500
 
3499
3501
 
3502
+ CORE_PATHS: set[str] = {
3503
+ "/login",
3504
+ "/load_session",
3505
+ "/load_groups",
3506
+ "/load_group",
3507
+ "/create_group",
3508
+ "/join_group",
3509
+ "/load_group_users",
3510
+ "/delete_group",
3511
+ "/load_documents",
3512
+ "/load_document",
3513
+ "/load_document_by_id",
3514
+ "/create_doc",
3515
+ "/process_doc",
3516
+ "/status/{task_id}",
3517
+ "/upload/ocr-file",
3518
+ "/ocr-file-result/{task_id}",
3519
+ "/load_chunks",
3520
+ "/load_references",
3521
+ "/load_feedback",
3522
+ "/documents/{document_id}/feedback",
3523
+ }
3524
+
3525
+ for route in router.routes:
3526
+ if isinstance(route, APIRoute) and route.path in CORE_PATHS:
3527
+ core_router.routes.append(route)
3528
+
3529
+
3500
3530
  def create_fastapi_app():
3501
3531
  """Backwards-compatible app factory for running this module directly."""
3502
3532
  from fastapi import FastAPI
@@ -28,9 +28,15 @@ def create_app(settings: Settings | None = None) -> FastAPI:
28
28
 
29
29
  app = FastAPI(title="Compair API", version=resolved_settings.version)
30
30
 
31
- from ..api import router as legacy_router
31
+ from ..api import core_router, router as legacy_router
32
32
 
33
- app.include_router(legacy_router)
33
+ if edition == "cloud":
34
+ app.include_router(legacy_router)
35
+ else:
36
+ if resolved_settings.include_legacy_routes:
37
+ app.include_router(legacy_router)
38
+ else:
39
+ app.include_router(core_router)
34
40
  app.include_router(capabilities_router)
35
41
 
36
42
  # Share the resolved settings with request handlers
@@ -38,4 +38,5 @@ def capabilities(settings: Settings = Depends(get_settings)) -> dict[str, object
38
38
  },
39
39
  "server": "Compair Cloud" if edition == "cloud" else "Compair Core",
40
40
  "version": settings.version,
41
+ "legacy_routes": settings.include_legacy_routes,
41
42
  }
@@ -19,6 +19,7 @@ class Settings(BaseSettings):
19
19
  require_authentication: bool = False
20
20
  single_user_username: str = "compair-local@example.com"
21
21
  single_user_name: str = "Compair Local User"
22
+ include_legacy_routes: bool = False
22
23
 
23
24
  # Core/local storage defaults
24
25
  local_upload_dir: str = "~/.compair-core/data/uploads"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: compair-core
3
- Version: 0.3.11
3
+ Version: 0.3.12
4
4
  Summary: Open-source foundation of the Compair collaboration platform.
5
5
  Author: RocketResearch, Inc.
6
6
  License: MIT
@@ -91,6 +91,7 @@ Key environment variables for the core edition:
91
91
  - `COMPAIR_EMAIL_BACKEND` – the core mailer logs emails to stdout; cloud overrides this with transactional delivery.
92
92
  - `COMPAIR_REQUIRE_AUTHENTICATION` (`true`) – set to `false` to run the API in single-user mode without login or account management. When disabled, Compair auto-provisions a local user, group, and long-lived session token so you can upload documents immediately.
93
93
  - `COMPAIR_SINGLE_USER_USERNAME` / `COMPAIR_SINGLE_USER_NAME` – override the email-style username and display name that are used for the auto-provisioned local user in single-user mode.
94
+ - `COMPAIR_INCLUDE_LEGACY_ROUTES` (`false`) – opt-in to the full legacy API surface (used by the hosted product) when running the core edition. Leave unset to expose only the streamlined single-user endpoints in Swagger.
94
95
 
95
96
  See `compair_core/server/settings.py` for the full settings surface.
96
97
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "compair-core"
7
- version = "0.3.11"
7
+ version = "0.3.12"
8
8
  description = "Open-source foundation of the Compair collaboration platform."
9
9
  readme = "README.md"
10
10
  license = { text = "MIT" }
File without changes
File without changes