dsw-models 4.25.1__py2.py3-none-any.whl → 4.26.0__py2.py3-none-any.whl

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.
dsw/models/build_info.py CHANGED
@@ -9,9 +9,9 @@ BuildInfo = namedtuple(
9
9
  )
10
10
 
11
11
  BUILD_INFO = BuildInfo(
12
- version='v4.25.1~31a01b8',
13
- built_at='2025-12-19 12:48:51Z',
14
- sha='31a01b81b38254d1f771f4b109b60550a1debfa2',
12
+ version='v4.26.0~6fb9cb8',
13
+ built_at='2026-01-06 12:20:00Z',
14
+ sha='6fb9cb8a23068c7f699e72b0d22ff975db2ead69',
15
15
  branch='HEAD',
16
- tag='v4.25.1',
16
+ tag='v4.26.0',
17
17
  )
dsw/models/common.py ADDED
@@ -0,0 +1,19 @@
1
+ import uuid
2
+
3
+ import pydantic
4
+
5
+
6
+ NULL_UUID = uuid.UUID('00000000-0000-0000-0000-000000000000')
7
+
8
+
9
+ def to_camel(s: str) -> str:
10
+ parts = s.split("_")
11
+ return parts[0] + "".join(word.capitalize() for word in parts[1:])
12
+
13
+
14
+ class BaseModel(pydantic.BaseModel):
15
+ model_config = pydantic.ConfigDict(
16
+ alias_generator=to_camel,
17
+ populate_by_name=True,
18
+ extra="forbid",
19
+ )
@@ -0,0 +1,45 @@
1
+ from uuid import UUID
2
+
3
+ import pydantic
4
+
5
+ from ..common import BaseModel
6
+
7
+
8
+ class PackagePattern(BaseModel):
9
+ organization_id: str | None
10
+ km_id: str | None
11
+ min_version: str | None
12
+ max_version: str | None
13
+
14
+
15
+ class DocumentTemplateStep(BaseModel):
16
+ name: str
17
+ options: dict[str, str]
18
+
19
+
20
+ class DocumentTemplateFormat(BaseModel):
21
+ uuid: UUID
22
+ name: str
23
+ icon: str = ""
24
+ steps: list[DocumentTemplateStep]
25
+
26
+
27
+ class DocumentTemplateTDK(BaseModel):
28
+ version: str
29
+ readme_file: str | None
30
+ files: list[str]
31
+
32
+
33
+ class DocumentTemplateMetadata(BaseModel):
34
+ id: str | None
35
+ organization_id: str
36
+ template_id: str
37
+ version: str
38
+ name: str
39
+ description: str
40
+ metamodel_version: str
41
+ license: str
42
+ readme: str
43
+ allowed_packages: list[PackagePattern]
44
+ formats: list[DocumentTemplateFormat]
45
+ tdk: DocumentTemplateTDK | None = pydantic.Field(default=None, alias='_tdk')
File without changes
@@ -0,0 +1,166 @@
1
+ import typing
2
+ from uuid import UUID
3
+
4
+ import pydantic
5
+
6
+ from ..common import BaseModel
7
+
8
+
9
+ class MetricMeasure(BaseModel):
10
+ metric_uuid: UUID
11
+ measure: float = pydantic.Field(ge=0.0, le=1.0)
12
+ weight: float = pydantic.Field(ge=0.0, le=1.0)
13
+
14
+
15
+ class KeyValue(BaseModel):
16
+ key: str
17
+ value: str
18
+
19
+
20
+ TAnnotations = list[KeyValue]
21
+ THeaders = list[KeyValue]
22
+ TQuestionValueType = typing.Literal[
23
+ 'StringQuestionValueType',
24
+ 'NumberQuestionValueType',
25
+ 'DateQuestionValueType',
26
+ 'DateTimeQuestionValueType',
27
+ 'TimeQuestionValueType',
28
+ 'TextQuestionValueType',
29
+ 'EmailQuestionValueType',
30
+ 'UrlQuestionValueType',
31
+ 'ColorQuestionValueType',
32
+ ]
33
+
34
+
35
+ class MinLengthQuestionValidation(pydantic.BaseModel):
36
+ type: typing.Literal['MinLengthQuestionValidation'] = 'MinLengthQuestionValidation'
37
+ value: int
38
+
39
+
40
+ class MaxLengthQuestionValidation(pydantic.BaseModel):
41
+ type: typing.Literal['MaxLengthQuestionValidation'] = 'MaxLengthQuestionValidation'
42
+ value: int
43
+
44
+
45
+ class RegexQuestionValidation(pydantic.BaseModel):
46
+ type: typing.Literal['RegexQuestionValidation'] = 'RegexQuestionValidation'
47
+ value: str
48
+
49
+
50
+ class OrcidQuestionValidation(pydantic.BaseModel):
51
+ type: typing.Literal['OrcidQuestionValidation'] = 'OrcidQuestionValidation'
52
+
53
+
54
+ class DoiQuestionValidation(pydantic.BaseModel):
55
+ type: typing.Literal['DoiQuestionValidation'] = 'DoiQuestionValidation'
56
+
57
+
58
+ class MinNumberQuestionValidation(pydantic.BaseModel):
59
+ type: typing.Literal['MinNumberQuestionValidation'] = 'MinNumberQuestionValidation'
60
+ value: float
61
+
62
+
63
+ class MaxNumberQuestionValidation(pydantic.BaseModel):
64
+ type: typing.Literal['MaxNumberQuestionValidation'] = 'MaxNumberQuestionValidation'
65
+ value: float
66
+
67
+
68
+ class FromDateQuestionValidation(pydantic.BaseModel):
69
+ type: typing.Literal['FromDateQuestionValidation'] = 'FromDateQuestionValidation'
70
+ value: str # ISO 8601 date string, e.g., '2023-10-01'
71
+
72
+
73
+ class ToDateQuestionValidation(pydantic.BaseModel):
74
+ type: typing.Literal['ToDateQuestionValidation'] = 'ToDateQuestionValidation'
75
+ value: str # ISO 8601 date string, e.g., '2023-10-31'
76
+
77
+
78
+ class FromDateTimeQuestionValidation(pydantic.BaseModel):
79
+ type: typing.Literal['FromDateTimeQuestionValidation'] = 'FromDateTimeQuestionValidation'
80
+ value: str # ISO 8601 datetime string, e.g., '2023-10-01T12:00:00Z'
81
+
82
+
83
+ class ToDateTimeQuestionValidation(pydantic.BaseModel):
84
+ type: typing.Literal['ToDateTimeQuestionValidation'] = 'ToDateTimeQuestionValidation'
85
+ value: str # ISO 8601 datetime string, e.g., '2023
86
+
87
+
88
+ class FromTimeQuestionValidation(pydantic.BaseModel):
89
+ type: typing.Literal['FromTimeQuestionValidation'] = 'FromTimeQuestionValidation'
90
+ value: str # ISO 8601 time string, e.g., '12:00:00'
91
+
92
+
93
+ class ToTimeQuestionValidation(pydantic.BaseModel):
94
+ type: typing.Literal['ToTimeQuestionValidation'] = 'ToTimeQuestionValidation'
95
+ value: str # ISO 8601 time string, e.g., '13:00:00'
96
+
97
+
98
+ class DomainQuestionValidation(pydantic.BaseModel):
99
+ type: typing.Literal['DomainQuestionValidation'] = 'DomainQuestionValidation'
100
+ value: str # Domain name, e.g., 'example.com'
101
+
102
+
103
+ QuestionValidation = typing.Annotated[
104
+ typing.Union[
105
+ MinLengthQuestionValidation,
106
+ MaxLengthQuestionValidation,
107
+ RegexQuestionValidation,
108
+ OrcidQuestionValidation,
109
+ DoiQuestionValidation,
110
+ MinNumberQuestionValidation,
111
+ MaxNumberQuestionValidation,
112
+ FromDateQuestionValidation,
113
+ ToDateQuestionValidation,
114
+ FromDateTimeQuestionValidation,
115
+ ToDateTimeQuestionValidation,
116
+ FromTimeQuestionValidation,
117
+ ToTimeQuestionValidation,
118
+ DomainQuestionValidation,
119
+ ],
120
+ pydantic.Field(discriminator='type'),
121
+ ]
122
+
123
+
124
+ class TypeHintRequest(BaseModel):
125
+ method: str
126
+ url: str
127
+ headers: THeaders
128
+ body: str | None
129
+
130
+
131
+ class BaseTypeHintResponse(BaseModel):
132
+ response_type: str
133
+
134
+
135
+ class SuccessTypeHintResponse(BaseTypeHintResponse):
136
+ response_type: typing.Literal['SuccessTypeHintResponse'] = 'SuccessTypeHintResponse'
137
+ status: int
138
+ content_type: str | None
139
+ body: str
140
+
141
+
142
+ class RemoteErrorTypeHintResponse(BaseTypeHintResponse):
143
+ response_type: typing.Literal['RemoteErrorTypeHintResponse'] = 'RemoteErrorTypeHintResponse'
144
+ status: int
145
+ content_type: str | None
146
+ body: str
147
+
148
+
149
+ class RequestFailedTypeHintResponse(BaseTypeHintResponse):
150
+ response_type: typing.Literal['RequestFailedTypeHintResponse'] = 'RequestFailedTypeHintResponse'
151
+ message: str
152
+
153
+
154
+ TypeHintResponse = typing.Annotated[
155
+ typing.Union[
156
+ SuccessTypeHintResponse,
157
+ RemoteErrorTypeHintResponse,
158
+ RequestFailedTypeHintResponse,
159
+ ],
160
+ pydantic.Field(discriminator='response_type'),
161
+ ]
162
+
163
+
164
+ class TypeHintExchange(BaseModel):
165
+ request: TypeHintRequest
166
+ response: TypeHintResponse