scripticus-schema 0.1.1__tar.gz → 0.1.2__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.1
3
+ Version: 0.1.2
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.1"
3
+ version = "0.1.2"
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"
@@ -25,6 +25,12 @@ NAMESPACE_RE = re.compile(r"^[a-z][a-z0-9]*(-[a-z0-9]+)*$")
25
25
 
26
26
  KNOWN_OS = ("linux", "macos", "windows")
27
27
 
28
+ # One archive per format group: POSIX/macOS targets travel as .tar.gz,
29
+ # Windows as .zip (D26). The client packs by this table; the server checks
30
+ # at publish that an uploaded archive's format matches the manifest's
31
+ # declared platforms.
32
+ FORMAT_GROUPS = (("tar.gz", ("linux", "macos")), ("zip", ("windows",)))
33
+
28
34
 
29
35
  @dataclass(frozen=True)
30
36
  class Language:
@@ -0,0 +1,30 @@
1
+ """Wire models for the index service's publish (write-path) API (D32).
2
+
3
+ The request side is deliberately not modelled here: a publish is a
4
+ multipart upload of the package archive plus a Gitea token in the
5
+ ``Authorization`` header, and everything else — identity, variant tags,
6
+ dependencies, the content hash — is derived server-side from the archive
7
+ itself, which is never trusted to match any client-supplied claims (D8).
8
+ Only the response shape is contract.
9
+ """
10
+
11
+ from pydantic import BaseModel
12
+
13
+
14
+ class PublishedArtifact(BaseModel):
15
+ filename: str
16
+ archive_format: str # "tar.gz" | "zip"
17
+ platforms: list[str]
18
+ language: str
19
+ size: int
20
+
21
+
22
+ class PublishResult(BaseModel):
23
+ """Response for a successful publish: what the index now records."""
24
+
25
+ namespace: str
26
+ name: str
27
+ version: str
28
+ content_hash: str
29
+ publisher: str
30
+ artifact: PublishedArtifact