Skip to main content

omena_resolver/
types.rs

1use super::*;
2
3#[derive(Debug, Serialize)]
4#[serde(rename_all = "camelCase")]
5pub struct OmenaResolverBoundarySummaryV0 {
6    pub schema_version: &'static str,
7    pub product: &'static str,
8    pub resolver_name: &'static str,
9    pub input_version: String,
10    pub delegated_source_resolution_products: Vec<&'static str>,
11    pub resolver_owned_products: Vec<&'static str>,
12    pub source_resolution_query_count: usize,
13    pub source_resolution_candidate_count: usize,
14    pub source_resolution_evaluator_candidate_count: usize,
15    pub module_graph_module_count: usize,
16    pub module_graph_source_expression_edge_count: usize,
17    pub runtime_query_module_count: usize,
18    pub runtime_query_ready_module_count: usize,
19    pub source_resolution_runtime_expression_count: usize,
20    pub source_resolution_runtime_resolved_expression_count: usize,
21    pub ready_surfaces: Vec<&'static str>,
22    pub cme_coupled_surfaces: Vec<&'static str>,
23    pub next_decoupling_targets: Vec<&'static str>,
24}
25
26#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize)]
27#[serde(rename_all = "camelCase")]
28pub struct OmenaResolverModuleGraphSummaryV0 {
29    pub schema_version: String,
30    pub product: String,
31    pub input_version: String,
32    pub module_count: usize,
33    pub source_expression_edge_count: usize,
34    pub type_fact_edge_count: usize,
35    pub selector_count: usize,
36    pub unresolved_type_fact_count: usize,
37    pub modules: Vec<OmenaResolverModuleGraphModuleV0>,
38    pub unresolved_type_fact_expression_ids: Vec<String>,
39}
40
41#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize)]
42#[serde(rename_all = "camelCase")]
43pub struct OmenaResolverModuleGraphModuleV0 {
44    pub style_file_path: String,
45    pub source_expression_ids: Vec<String>,
46    pub source_expression_kinds: Vec<String>,
47    pub type_fact_expression_ids: Vec<String>,
48    pub selector_names: Vec<String>,
49    pub canonical_selector_names: Vec<String>,
50    pub has_source_input: bool,
51    pub has_style_input: bool,
52    pub has_type_fact_input: bool,
53}
54
55#[derive(Debug, Clone, PartialEq, Eq, Serialize)]
56#[serde(rename_all = "camelCase")]
57pub struct OmenaResolverRuntimeQueryBoundarySummaryV0 {
58    pub schema_version: &'static str,
59    pub product: &'static str,
60    pub input_product: String,
61    pub input_version: String,
62    pub module_query_count: usize,
63    pub fully_resolvable_module_count: usize,
64    pub source_only_module_count: usize,
65    pub style_only_module_count: usize,
66    pub unresolved_type_fact_count: usize,
67    pub runtime_capabilities: Vec<&'static str>,
68    pub blocking_gaps: Vec<&'static str>,
69    pub module_queries: Vec<OmenaResolverRuntimeModuleQueryV0>,
70}
71
72#[derive(Debug, Clone, PartialEq, Eq, Serialize)]
73#[serde(rename_all = "camelCase")]
74pub struct OmenaResolverRuntimeModuleQueryV0 {
75    pub style_file_path: String,
76    pub source_expression_ids: Vec<String>,
77    pub type_fact_expression_ids: Vec<String>,
78    pub selector_names: Vec<String>,
79    pub canonical_selector_names: Vec<String>,
80    pub can_resolve_source_expressions: bool,
81    pub can_check_type_fact_edges: bool,
82    pub can_query_selector_names: bool,
83    pub status: &'static str,
84}
85
86#[derive(Debug, Clone, PartialEq, Eq, Serialize)]
87#[serde(rename_all = "camelCase")]
88pub struct OmenaResolverSourceResolutionRuntimeIndexV0 {
89    pub schema_version: &'static str,
90    pub product: &'static str,
91    pub input_product: &'static str,
92    pub input_version: String,
93    pub expression_count: usize,
94    pub resolved_expression_count: usize,
95    pub unresolved_expression_count: usize,
96    pub blocking_gaps: Vec<&'static str>,
97    pub entries: Vec<OmenaResolverSourceResolutionRuntimeEntryV0>,
98}
99
100#[derive(Debug, Clone, PartialEq, Eq, Serialize)]
101#[serde(rename_all = "camelCase")]
102pub struct OmenaResolverSourceResolutionRuntimeEntryV0 {
103    pub query_id: String,
104    pub expression_id: String,
105    pub expression_kind: String,
106    pub style_file_path: String,
107    pub selector_names: Vec<String>,
108    pub finite_values: Option<Vec<String>>,
109    pub selector_certainty: String,
110    pub value_certainty: Option<String>,
111    pub selector_certainty_shape_kind: String,
112    pub value_certainty_shape_kind: String,
113    pub has_selector_match: bool,
114    pub has_finite_values: bool,
115    pub can_resolve_source_expression: bool,
116    pub status: &'static str,
117}
118
119#[derive(Debug, Clone, PartialEq, Eq, Serialize)]
120#[serde(rename_all = "camelCase")]
121pub struct OmenaResolverStylePackageManifestV0 {
122    pub package_json_path: String,
123    pub package_json_source: String,
124}
125
126#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize)]
127#[serde(rename_all = "camelCase")]
128pub struct OmenaResolverTsconfigPathMappingV0 {
129    pub base_path: String,
130    pub pattern: String,
131    pub target_patterns: Vec<String>,
132}
133
134#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize)]
135#[serde(rename_all = "camelCase")]
136pub struct OmenaResolverBundlerPathAliasMappingV0 {
137    pub pattern: String,
138    pub target_path: String,
139}
140
141#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize)]
142#[serde(rename_all = "camelCase")]
143pub struct OmenaResolverStyleModuleDiskCandidateIdentityV0 {
144    pub style_path: String,
145    pub metadata_identity: String,
146}
147
148#[derive(Debug, Clone, Copy, PartialEq, Eq)]
149pub struct OmenaResolverStyleModuleConfirmationOptionsV0<'a> {
150    pub allow_disk_confirmation: bool,
151    pub allow_live_disk_confirmation: bool,
152    pub max_disk_candidate_count: usize,
153    pub allow_unconfirmed_indexable_candidate: bool,
154    pub identity_index: Option<&'a OmenaResolverStyleModuleConfirmationIdentityIndexV0>,
155}
156
157impl<'a> Default for OmenaResolverStyleModuleConfirmationOptionsV0<'a> {
158    fn default() -> Self {
159        Self {
160            allow_disk_confirmation: false,
161            allow_live_disk_confirmation: false,
162            max_disk_candidate_count: 64,
163            allow_unconfirmed_indexable_candidate: false,
164            identity_index: None,
165        }
166    }
167}
168
169#[derive(Debug, Clone, PartialEq, Eq)]
170pub struct OmenaResolverStyleModuleConfirmationIdentityIndexV0 {
171    pub available_by_identity: BTreeMap<String, String>,
172    pub disk_by_identity: BTreeMap<String, String>,
173}
174
175#[derive(Debug, Clone, PartialEq, Eq, Serialize)]
176#[serde(rename_all = "camelCase")]
177pub struct OmenaResolverStyleModuleCandidateConfirmationV0 {
178    pub resolved_style_path: Option<String>,
179    pub confirmation_kind: &'static str,
180    pub disk_candidate_count: usize,
181    pub candidate_count: usize,
182}
183
184#[derive(Debug, Clone, PartialEq, Eq, Serialize)]
185#[serde(rename_all = "camelCase")]
186pub struct OmenaResolverStyleModuleResolutionV0 {
187    pub schema_version: &'static str,
188    pub product: &'static str,
189    pub from_style_path: String,
190    pub source: String,
191    pub resolved_style_path: Option<String>,
192    pub candidate_count: usize,
193    pub candidates: Vec<String>,
194    pub resolution_kind: &'static str,
195    pub symlink_chain: OmenaResolverSymlinkChainInspectionV0,
196}
197
198#[derive(Debug, Clone, PartialEq, Eq, Serialize)]
199#[serde(rename_all = "camelCase")]
200pub struct OmenaResolverSymlinkChainInspectionV0 {
201    pub schema_version: &'static str,
202    pub product: &'static str,
203    pub requested_path: String,
204    pub inspected_component_count: usize,
205    pub link_count: usize,
206    pub links: Vec<OmenaResolverSymlinkChainLinkV0>,
207}
208
209#[derive(Debug, Clone, PartialEq, Eq, Serialize)]
210#[serde(rename_all = "camelCase")]
211pub struct OmenaResolverSymlinkChainLinkV0 {
212    pub link_path: String,
213    pub target_path: String,
214    pub target_was_absolute: bool,
215}
216
217#[derive(Debug, Clone, PartialEq, Eq, Serialize)]
218#[serde(rename_all = "camelCase")]
219pub struct OmenaResolverSpecifierResolutionRuntimeV0 {
220    pub schema_version: &'static str,
221    pub product: &'static str,
222    pub from_style_path: String,
223    pub specifier_count: usize,
224    pub resolved_specifier_count: usize,
225    pub external_specifier_count: usize,
226    pub unresolved_specifier_count: usize,
227    pub entries: Vec<OmenaResolverSpecifierResolutionRuntimeEntryV0>,
228    pub ready_surfaces: Vec<&'static str>,
229}
230
231#[derive(Debug, Clone, PartialEq, Eq, Serialize)]
232#[serde(rename_all = "camelCase")]
233pub struct OmenaResolverSpecifierResolutionRuntimeEntryV0 {
234    pub source: String,
235    pub resolved_style_path: Option<String>,
236    pub candidate_count: usize,
237    pub resolution_kind: &'static str,
238    pub status: &'static str,
239}