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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scripticus-schema
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: A package manager and registry for scripts — shared contract: manifest schema, identity, versioning
5
5
  License-Expression: MIT
6
6
  Requires-Dist: pydantic>=2.7
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "scripticus-schema"
3
- version = "0.1.0"
3
+ version = "0.1.1"
4
4
  description = "A package manager and registry for scripts — shared contract: manifest schema, identity, versioning"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -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)