scripticus-schema 0.1.0__tar.gz → 0.1.1__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.
- {scripticus_schema-0.1.0 → scripticus_schema-0.1.1}/PKG-INFO +1 -1
- {scripticus_schema-0.1.0 → scripticus_schema-0.1.1}/pyproject.toml +1 -1
- scripticus_schema-0.1.1/src/scripticus_schema/index_api.py +48 -0
- {scripticus_schema-0.1.0 → scripticus_schema-0.1.1}/README.md +0 -0
- {scripticus_schema-0.1.0 → scripticus_schema-0.1.1}/src/scripticus_schema/__init__.py +0 -0
- {scripticus_schema-0.1.0 → scripticus_schema-0.1.1}/src/scripticus_schema/manifest.py +0 -0
- {scripticus_schema-0.1.0 → scripticus_schema-0.1.1}/src/scripticus_schema/semver.py +0 -0
- {scripticus_schema-0.1.0 → scripticus_schema-0.1.1}/src/scripticus_schema/treehash.py +0 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"""Wire models for the index service's read API (D30).
|
|
2
|
+
|
|
3
|
+
The first API schemas to be pinned down (D29 anticipated them): responses
|
|
4
|
+
for package version listing and search. The server builds them from the
|
|
5
|
+
index database; the client consumes them for `search` and version listing.
|
|
6
|
+
|
|
7
|
+
Contract notes encoded here rather than left to the server's discretion:
|
|
8
|
+
version listings are ordered newest-first by semver precedence (D16),
|
|
9
|
+
include yanked versions marked as such, and search results never include
|
|
10
|
+
yanked versions (npm-style yank).
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
from pydantic import BaseModel, Field
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class VersionSummary(BaseModel):
|
|
17
|
+
version: str
|
|
18
|
+
yanked: bool = False
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class PackageVersions(BaseModel):
|
|
22
|
+
"""Response for a package's version listing.
|
|
23
|
+
|
|
24
|
+
``versions`` is ordered newest-first by semver precedence and includes
|
|
25
|
+
yanked versions (marked), so a pinned/lockfile lookup can still see
|
|
26
|
+
them; ``description`` comes from the latest non-yanked version.
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
namespace: str
|
|
30
|
+
name: str
|
|
31
|
+
description: str = ""
|
|
32
|
+
versions: list[VersionSummary]
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class PackageSummary(BaseModel):
|
|
36
|
+
namespace: str
|
|
37
|
+
name: str
|
|
38
|
+
description: str = ""
|
|
39
|
+
latest_version: str
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
class SearchResults(BaseModel):
|
|
43
|
+
"""Response for a search query. Yanked versions are invisible here: a
|
|
44
|
+
package's ``latest_version`` is its latest non-yanked version, and a
|
|
45
|
+
package with every version yanked does not appear at all.
|
|
46
|
+
"""
|
|
47
|
+
|
|
48
|
+
results: list[PackageSummary] = Field(default_factory=list)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|