@@ -17,21 +17,42 @@ class Node(typing.TypedDict):
1717 type : str
1818
1919
20- class Advisory (Node ):
20+ class AdvisoryBase (Node ):
2121 field_is_psa : typing .Literal ['0' , '1' ]
2222 field_affected_versions : str | None
23- field_project : EntityReferenceField
2423 field_fixed_in : list [EntityReferenceField ]
25- field_sa_reported_by : RichTextField | list [typing .Never ]
2624 field_sa_criticality : str
2725 field_sa_cve : list [str ]
28- field_sa_description : RichTextField
2926 created : str
3027 changed : str
3128 title : str
3229 url : str
3330
3431
32+ class Advisory (AdvisoryBase ):
33+ """
34+ Represents an advisory sourced from the Drupal JSON API that has been
35+ transformed to make it easier to work with
36+ """
37+
38+ field_project : EntityReferenceField | None
39+ field_sa_reported_by : RichTextField
40+ field_sa_description : RichTextField
41+
42+
43+ class AdvisoryRaw (AdvisoryBase ):
44+ """
45+ Represents an advisory provided by the Drupal JSON API without any post-processing.
46+
47+ This mainly means that object fields which don't have a value in the database
48+ will be represented by an empty list due to how associated arrays in PHP work
49+ """
50+
51+ field_project : EntityReferenceField | list [typing .Never ]
52+ field_sa_reported_by : RichTextField | list [typing .Never ]
53+ field_sa_description : RichTextField | list [typing .Never ]
54+
55+
3556class Project (Node ):
3657 # type will be project_module, project_theme, or project_core
3758 field_project_machine_name : str
0 commit comments