unitysvc-core 0.2.2__tar.gz → 0.2.3__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.
- {unitysvc_core-0.2.2/src/unitysvc_core.egg-info → unitysvc_core-0.2.3}/PKG-INFO +1 -1
- {unitysvc_core-0.2.2 → unitysvc_core-0.2.3}/pyproject.toml +1 -1
- {unitysvc_core-0.2.2 → unitysvc_core-0.2.3}/src/unitysvc_core/models/__init__.py +2 -2
- {unitysvc_core-0.2.2 → unitysvc_core-0.2.3}/src/unitysvc_core/models/listing_data.py +2 -2
- {unitysvc_core-0.2.2 → unitysvc_core-0.2.3}/src/unitysvc_core/models/service.py +16 -15
- {unitysvc_core-0.2.2 → unitysvc_core-0.2.3/src/unitysvc_core.egg-info}/PKG-INFO +1 -1
- {unitysvc_core-0.2.2 → unitysvc_core-0.2.3}/src/unitysvc_core.egg-info/SOURCES.txt +1 -1
- unitysvc_core-0.2.2/tests/test_service_data.py → unitysvc_core-0.2.3/tests/test_service_status.py +6 -6
- {unitysvc_core-0.2.2 → unitysvc_core-0.2.3}/LICENSE +0 -0
- {unitysvc_core-0.2.2 → unitysvc_core-0.2.3}/README.md +0 -0
- {unitysvc_core-0.2.2 → unitysvc_core-0.2.3}/setup.cfg +0 -0
- {unitysvc_core-0.2.2 → unitysvc_core-0.2.3}/src/unitysvc_core/__init__.py +0 -0
- {unitysvc_core-0.2.2 → unitysvc_core-0.2.3}/src/unitysvc_core/models/base.py +0 -0
- {unitysvc_core-0.2.2 → unitysvc_core-0.2.3}/src/unitysvc_core/models/documents.py +0 -0
- {unitysvc_core-0.2.2 → unitysvc_core-0.2.3}/src/unitysvc_core/models/listing_v1.py +0 -0
- {unitysvc_core-0.2.2 → unitysvc_core-0.2.3}/src/unitysvc_core/models/offering_data.py +0 -0
- {unitysvc_core-0.2.2 → unitysvc_core-0.2.3}/src/unitysvc_core/models/offering_v1.py +0 -0
- {unitysvc_core-0.2.2 → unitysvc_core-0.2.3}/src/unitysvc_core/models/pricing.py +0 -0
- {unitysvc_core-0.2.2 → unitysvc_core-0.2.3}/src/unitysvc_core/models/promotion_data.py +0 -0
- {unitysvc_core-0.2.2 → unitysvc_core-0.2.3}/src/unitysvc_core/models/provider_data.py +0 -0
- {unitysvc_core-0.2.2 → unitysvc_core-0.2.3}/src/unitysvc_core/models/provider_v1.py +0 -0
- {unitysvc_core-0.2.2 → unitysvc_core-0.2.3}/src/unitysvc_core/models/service_group_data.py +0 -0
- {unitysvc_core-0.2.2 → unitysvc_core-0.2.3}/src/unitysvc_core/models/validators.py +0 -0
- {unitysvc_core-0.2.2 → unitysvc_core-0.2.3}/src/unitysvc_core/py.typed +0 -0
- {unitysvc_core-0.2.2 → unitysvc_core-0.2.3}/src/unitysvc_core/schema/base.json +0 -0
- {unitysvc_core-0.2.2 → unitysvc_core-0.2.3}/src/unitysvc_core/schema/listing_v1.json +0 -0
- {unitysvc_core-0.2.2 → unitysvc_core-0.2.3}/src/unitysvc_core/schema/offering_v1.json +0 -0
- {unitysvc_core-0.2.2 → unitysvc_core-0.2.3}/src/unitysvc_core/schema/promotion_v1.json +0 -0
- {unitysvc_core-0.2.2 → unitysvc_core-0.2.3}/src/unitysvc_core/schema/provider_v1.json +0 -0
- {unitysvc_core-0.2.2 → unitysvc_core-0.2.3}/src/unitysvc_core/schema/service_group_v1.json +0 -0
- {unitysvc_core-0.2.2 → unitysvc_core-0.2.3}/src/unitysvc_core/utils.py +0 -0
- {unitysvc_core-0.2.2 → unitysvc_core-0.2.3}/src/unitysvc_core/validator.py +0 -0
- {unitysvc_core-0.2.2 → unitysvc_core-0.2.3}/src/unitysvc_core.egg-info/dependency_links.txt +0 -0
- {unitysvc_core-0.2.2 → unitysvc_core-0.2.3}/src/unitysvc_core.egg-info/requires.txt +0 -0
- {unitysvc_core-0.2.2 → unitysvc_core-0.2.3}/src/unitysvc_core.egg-info/top_level.txt +0 -0
- {unitysvc_core-0.2.2 → unitysvc_core-0.2.3}/tests/test_pricing.py +0 -0
- {unitysvc_core-0.2.2 → unitysvc_core-0.2.3}/tests/test_service_group.py +0 -0
- {unitysvc_core-0.2.2 → unitysvc_core-0.2.3}/tests/test_utils.py +0 -0
- {unitysvc_core-0.2.2 → unitysvc_core-0.2.3}/tests/test_validator.py +0 -0
- {unitysvc_core-0.2.2 → unitysvc_core-0.2.3}/tests/test_validators.py +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "unitysvc-core"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.3"
|
|
8
8
|
description = "Shared data models and validation helpers for UnitySVC packages"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
authors = [{ name = "Bo Peng", email = "bo.peng@unitysvc.com" }]
|
|
@@ -70,7 +70,7 @@ from .service import (
|
|
|
70
70
|
AccessInterfaceData,
|
|
71
71
|
RateLimit,
|
|
72
72
|
ServiceConstraints,
|
|
73
|
-
|
|
73
|
+
ServiceStatus,
|
|
74
74
|
UpstreamAccessConfigData,
|
|
75
75
|
)
|
|
76
76
|
from .service_group_data import (
|
|
@@ -110,7 +110,7 @@ __all__ = [
|
|
|
110
110
|
"UpstreamAccessConfigData",
|
|
111
111
|
"RateLimit",
|
|
112
112
|
"ServiceConstraints",
|
|
113
|
-
"
|
|
113
|
+
"ServiceStatus",
|
|
114
114
|
# Enums
|
|
115
115
|
"AccessMethodEnum",
|
|
116
116
|
"AuthMethodEnum",
|
|
@@ -44,8 +44,8 @@ class ServiceListingData(BaseModel):
|
|
|
44
44
|
|
|
45
45
|
# NOTE: a listing carries no service_id. Service identity is backend-
|
|
46
46
|
# assigned provenance, not authored listing content — it lives in
|
|
47
|
-
# ``service.json``
|
|
48
|
-
#
|
|
47
|
+
# ``service.json`` (the ``ServiceStatus`` sidecar) and travels separately
|
|
48
|
+
# on upload/revision, never embedded in the listing.
|
|
49
49
|
|
|
50
50
|
# Listing identification
|
|
51
51
|
name: str | None = Field(
|
|
@@ -144,21 +144,22 @@ class UpstreamAccessConfigData(AccessInterfaceData):
|
|
|
144
144
|
)
|
|
145
145
|
|
|
146
146
|
|
|
147
|
-
class
|
|
148
|
-
"""Backend-assigned service identity
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
the
|
|
154
|
-
the
|
|
155
|
-
|
|
156
|
-
existing service.
|
|
157
|
-
|
|
158
|
-
Of these fields,
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
unknown keys from
|
|
147
|
+
class ServiceStatus(BaseModel):
|
|
148
|
+
"""Backend-assigned service **status / identity sidecar** (the ``service.json``
|
|
149
|
+
file) — *not* the authored service data.
|
|
150
|
+
|
|
151
|
+
A service's ``provider_data`` / ``offering_data`` / ``listing_data`` are the
|
|
152
|
+
authored service data; this is the *other*, backend-owned half — the status
|
|
153
|
+
record the backend materializes once a service exists. It is the
|
|
154
|
+
**round-trip** sidecar: the ingest task returns it, the seller stores it in
|
|
155
|
+
``service.json`` beside the spec files, and replays it on the next
|
|
156
|
+
upload/revision so the backend can match the upload to the existing service.
|
|
157
|
+
|
|
158
|
+
Of these fields, ``service_id`` and ``template_instance_id`` are consumed on
|
|
159
|
+
the way *in* (they declare which service / which template the publish
|
|
160
|
+
targets); the rest are populated on the way *out* as informational status /
|
|
161
|
+
provenance for the seller. ``extra="ignore"`` keeps unknown keys from
|
|
162
|
+
breaking either direction.
|
|
162
163
|
"""
|
|
163
164
|
|
|
164
165
|
model_config = ConfigDict(extra="ignore")
|
|
@@ -31,8 +31,8 @@ src/unitysvc_core/schema/promotion_v1.json
|
|
|
31
31
|
src/unitysvc_core/schema/provider_v1.json
|
|
32
32
|
src/unitysvc_core/schema/service_group_v1.json
|
|
33
33
|
tests/test_pricing.py
|
|
34
|
-
tests/test_service_data.py
|
|
35
34
|
tests/test_service_group.py
|
|
35
|
+
tests/test_service_status.py
|
|
36
36
|
tests/test_utils.py
|
|
37
37
|
tests/test_validator.py
|
|
38
38
|
tests/test_validators.py
|
unitysvc_core-0.2.2/tests/test_service_data.py → unitysvc_core-0.2.3/tests/test_service_status.py
RENAMED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
"""Tests for the
|
|
1
|
+
"""Tests for the ServiceStatus model (the service.json provenance structure)."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
from datetime import datetime
|
|
6
6
|
from uuid import UUID
|
|
7
7
|
|
|
8
|
-
from unitysvc_core.models import
|
|
8
|
+
from unitysvc_core.models import ServiceStatus
|
|
9
9
|
|
|
10
10
|
_SID = "2c1f9e7a-0000-0000-0000-000000000000"
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
def test_empty_service_data_has_no_identity() -> None:
|
|
14
|
-
sd =
|
|
14
|
+
sd = ServiceStatus()
|
|
15
15
|
assert sd.service_id is None
|
|
16
16
|
assert sd.time_created is None
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
def test_service_id_coerced_to_uuid() -> None:
|
|
20
|
-
sd =
|
|
20
|
+
sd = ServiceStatus.model_validate({"service_id": _SID})
|
|
21
21
|
assert sd.service_id == UUID(_SID)
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
def test_time_created_and_extra_fields() -> None:
|
|
25
25
|
# time_created is a recognized provenance field; unknown extras are
|
|
26
26
|
# tolerated (extra="ignore") rather than rejected.
|
|
27
|
-
sd =
|
|
27
|
+
sd = ServiceStatus.model_validate({"service_id": _SID, "time_created": "2026-01-01T00:00:00", "note": "x"})
|
|
28
28
|
assert sd.time_created == datetime(2026, 1, 1, 0, 0)
|
|
29
29
|
assert "note" not in sd.model_dump()
|
|
30
30
|
|
|
@@ -32,7 +32,7 @@ def test_time_created_and_extra_fields() -> None:
|
|
|
32
32
|
def test_full_identity_record_round_trips() -> None:
|
|
33
33
|
# The shape the ingest task returns and the seller persists to service.json.
|
|
34
34
|
rev = "11111111-0000-0000-0000-000000000000"
|
|
35
|
-
sd =
|
|
35
|
+
sd = ServiceStatus.model_validate(
|
|
36
36
|
{
|
|
37
37
|
"service_id": _SID,
|
|
38
38
|
"revision_of": rev,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|