@adventurelabs/scout-core 1.5.0 → 1.5.2

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.
Files changed (59) hide show
  1. package/dist/helpers/artifactMedia.d.ts +5 -0
  2. package/dist/helpers/artifactMedia.js +31 -0
  3. package/dist/helpers/artifacts.js +13 -19
  4. package/dist/helpers/documents.d.ts +1 -0
  5. package/dist/helpers/documents.js +11 -2
  6. package/dist/helpers/index.d.ts +1 -0
  7. package/dist/helpers/index.js +1 -0
  8. package/dist/helpers/operating_contexts.d.ts +43 -0
  9. package/dist/helpers/operating_contexts.js +222 -0
  10. package/dist/helpers/realtime_topic_access.d.ts +5 -0
  11. package/dist/helpers/realtime_topic_access.js +55 -0
  12. package/dist/hooks/index.d.ts +2 -1
  13. package/dist/hooks/index.js +2 -1
  14. package/dist/hooks/useAuthorizedRealtimeTopics.d.ts +1 -0
  15. package/dist/hooks/useAuthorizedRealtimeTopics.js +14 -0
  16. package/dist/hooks/useScoutRealtimeAnalysisJobs.d.ts +2 -1
  17. package/dist/hooks/useScoutRealtimeAnalysisJobs.js +3 -5
  18. package/dist/hooks/useScoutRealtimeAnalysisTasks.d.ts +2 -1
  19. package/dist/hooks/useScoutRealtimeAnalysisTasks.js +3 -5
  20. package/dist/hooks/useScoutRealtimeBroadcast.d.ts +9 -5
  21. package/dist/hooks/useScoutRealtimeBroadcast.js +118 -25
  22. package/dist/hooks/useScoutRealtimeConnectivity.d.ts +2 -1
  23. package/dist/hooks/useScoutRealtimeConnectivity.js +18 -76
  24. package/dist/hooks/useScoutRealtimeContacts.d.ts +2 -1
  25. package/dist/hooks/useScoutRealtimeContacts.js +3 -3
  26. package/dist/hooks/useScoutRealtimeDevices.d.ts +2 -1
  27. package/dist/hooks/useScoutRealtimeDevices.js +3 -64
  28. package/dist/hooks/useScoutRealtimeDocuments.d.ts +3 -3
  29. package/dist/hooks/useScoutRealtimeDocuments.js +7 -5
  30. package/dist/hooks/useScoutRealtimeEvents.d.ts +2 -1
  31. package/dist/hooks/useScoutRealtimeEvents.js +3 -69
  32. package/dist/hooks/useScoutRealtimeMaintenanceRequests.d.ts +2 -1
  33. package/dist/hooks/useScoutRealtimeMaintenanceRequests.js +3 -3
  34. package/dist/hooks/useScoutRealtimeOperatingContexts.d.ts +12 -0
  35. package/dist/hooks/useScoutRealtimeOperatingContexts.js +26 -0
  36. package/dist/hooks/useScoutRealtimeParts.d.ts +2 -1
  37. package/dist/hooks/useScoutRealtimeParts.js +3 -3
  38. package/dist/hooks/useScoutRealtimePins.d.ts +2 -1
  39. package/dist/hooks/useScoutRealtimePins.js +3 -69
  40. package/dist/hooks/useScoutRealtimePlans.d.ts +2 -1
  41. package/dist/hooks/useScoutRealtimePlans.js +3 -3
  42. package/dist/hooks/useScoutRealtimeSessionIncidents.d.ts +2 -1
  43. package/dist/hooks/useScoutRealtimeSessionIncidents.js +3 -3
  44. package/dist/hooks/useScoutRealtimeSessions.d.ts +2 -1
  45. package/dist/hooks/useScoutRealtimeSessions.js +3 -69
  46. package/dist/hooks/useScoutRealtimeTags.d.ts +2 -1
  47. package/dist/hooks/useScoutRealtimeTags.js +3 -69
  48. package/dist/hooks/useScoutRealtimeVersionsSoftware.d.ts +2 -1
  49. package/dist/hooks/useScoutRealtimeVersionsSoftware.js +3 -5
  50. package/dist/index.d.ts +2 -0
  51. package/dist/index.js +2 -0
  52. package/dist/providers/ScoutRefreshProvider.d.ts +1 -0
  53. package/dist/providers/ScoutRefreshProvider.js +3 -0
  54. package/dist/store/api.js +14 -34
  55. package/dist/types/db.d.ts +85 -0
  56. package/dist/types/realtime.d.ts +1 -0
  57. package/dist/types/supabase.d.ts +967 -100
  58. package/dist/types/supabase.js +26 -1
  59. package/package.json +1 -1
@@ -257,9 +257,13 @@ export type Database = {
257
257
  lifecycle_changed_by: string | null;
258
258
  lifecycle_reason: string | null;
259
259
  modality: string | null;
260
+ proxy_file_path: string | null;
261
+ proxy_generated_at: string | null;
260
262
  segmented_at: string | null;
261
263
  session_id: number | null;
262
264
  tagged_at: string | null;
265
+ thumbnail_file_path: string | null;
266
+ thumbnail_generated_at: string | null;
263
267
  timestamp_observation: string | null;
264
268
  timestamp_observation_end: string;
265
269
  tracked_at: string | null;
@@ -277,9 +281,13 @@ export type Database = {
277
281
  lifecycle_changed_by?: string | null;
278
282
  lifecycle_reason?: string | null;
279
283
  modality?: string | null;
284
+ proxy_file_path?: string | null;
285
+ proxy_generated_at?: string | null;
280
286
  segmented_at?: string | null;
281
287
  session_id?: number | null;
282
288
  tagged_at?: string | null;
289
+ thumbnail_file_path?: string | null;
290
+ thumbnail_generated_at?: string | null;
283
291
  timestamp_observation?: string | null;
284
292
  timestamp_observation_end?: string;
285
293
  tracked_at?: string | null;
@@ -297,9 +305,13 @@ export type Database = {
297
305
  lifecycle_changed_by?: string | null;
298
306
  lifecycle_reason?: string | null;
299
307
  modality?: string | null;
308
+ proxy_file_path?: string | null;
309
+ proxy_generated_at?: string | null;
300
310
  segmented_at?: string | null;
301
311
  session_id?: number | null;
302
312
  tagged_at?: string | null;
313
+ thumbnail_file_path?: string | null;
314
+ thumbnail_generated_at?: string | null;
303
315
  timestamp_observation?: string | null;
304
316
  timestamp_observation_end?: string;
305
317
  tracked_at?: string | null;
@@ -720,6 +732,57 @@ export type Database = {
720
732
  }
721
733
  ];
722
734
  };
735
+ document_conditions: {
736
+ Row: {
737
+ condition_text: string;
738
+ id: number;
739
+ inserted_at: string;
740
+ lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
741
+ lifecycle_changed_at: string;
742
+ lifecycle_changed_by: string | null;
743
+ lifecycle_reason: string | null;
744
+ localization_id: number;
745
+ requirement_text: string;
746
+ };
747
+ Insert: {
748
+ condition_text: string;
749
+ id?: number;
750
+ inserted_at?: string;
751
+ lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
752
+ lifecycle_changed_at?: string;
753
+ lifecycle_changed_by?: string | null;
754
+ lifecycle_reason?: string | null;
755
+ localization_id: number;
756
+ requirement_text: string;
757
+ };
758
+ Update: {
759
+ condition_text?: string;
760
+ id?: number;
761
+ inserted_at?: string;
762
+ lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
763
+ lifecycle_changed_at?: string;
764
+ lifecycle_changed_by?: string | null;
765
+ lifecycle_reason?: string | null;
766
+ localization_id?: number;
767
+ requirement_text?: string;
768
+ };
769
+ Relationships: [
770
+ {
771
+ foreignKeyName: "document_conditions_lifecycle_changed_by_fkey";
772
+ columns: ["lifecycle_changed_by"];
773
+ isOneToOne: false;
774
+ referencedRelation: "users";
775
+ referencedColumns: ["id"];
776
+ },
777
+ {
778
+ foreignKeyName: "document_conditions_localization_id_fkey";
779
+ columns: ["localization_id"];
780
+ isOneToOne: false;
781
+ referencedRelation: "localizations";
782
+ referencedColumns: ["id"];
783
+ }
784
+ ];
785
+ };
723
786
  document_template_abilities: {
724
787
  Row: {
725
788
  ability_id: number;
@@ -760,6 +823,7 @@ export type Database = {
760
823
  Row: {
761
824
  categories: string[];
762
825
  description: string | null;
826
+ document_condition_id: number | null;
763
827
  entity_for: Database["public"]["Enums"]["document_entity"] | null;
764
828
  id: number;
765
829
  inserted_at: string;
@@ -772,6 +836,7 @@ export type Database = {
772
836
  Insert: {
773
837
  categories?: string[];
774
838
  description?: string | null;
839
+ document_condition_id?: number | null;
775
840
  entity_for?: Database["public"]["Enums"]["document_entity"] | null;
776
841
  id?: number;
777
842
  inserted_at?: string;
@@ -784,6 +849,7 @@ export type Database = {
784
849
  Update: {
785
850
  categories?: string[];
786
851
  description?: string | null;
852
+ document_condition_id?: number | null;
787
853
  entity_for?: Database["public"]["Enums"]["document_entity"] | null;
788
854
  id?: number;
789
855
  inserted_at?: string;
@@ -794,6 +860,13 @@ export type Database = {
794
860
  uses_expiry?: boolean;
795
861
  };
796
862
  Relationships: [
863
+ {
864
+ foreignKeyName: "document_templates_document_condition_id_fkey";
865
+ columns: ["document_condition_id"];
866
+ isOneToOne: false;
867
+ referencedRelation: "document_conditions";
868
+ referencedColumns: ["id"];
869
+ },
797
870
  {
798
871
  foreignKeyName: "document_templates_issuer_id_fkey";
799
872
  columns: ["issuer_id"];
@@ -824,6 +897,7 @@ export type Database = {
824
897
  lifecycle_changed_at: string;
825
898
  lifecycle_changed_by: string | null;
826
899
  lifecycle_reason: string | null;
900
+ operating_context_id: number | null;
827
901
  product_id: number | null;
828
902
  related_herd_id: number | null;
829
903
  size_bytes: number | null;
@@ -848,6 +922,7 @@ export type Database = {
848
922
  lifecycle_changed_at?: string;
849
923
  lifecycle_changed_by?: string | null;
850
924
  lifecycle_reason?: string | null;
925
+ operating_context_id?: number | null;
851
926
  product_id?: number | null;
852
927
  related_herd_id?: number | null;
853
928
  size_bytes?: number | null;
@@ -872,6 +947,7 @@ export type Database = {
872
947
  lifecycle_changed_at?: string;
873
948
  lifecycle_changed_by?: string | null;
874
949
  lifecycle_reason?: string | null;
950
+ operating_context_id?: number | null;
875
951
  product_id?: number | null;
876
952
  related_herd_id?: number | null;
877
953
  size_bytes?: number | null;
@@ -919,6 +995,13 @@ export type Database = {
919
995
  referencedRelation: "users";
920
996
  referencedColumns: ["id"];
921
997
  },
998
+ {
999
+ foreignKeyName: "documents_operating_context_id_fkey";
1000
+ columns: ["operating_context_id"];
1001
+ isOneToOne: false;
1002
+ referencedRelation: "operating_contexts";
1003
+ referencedColumns: ["id"];
1004
+ },
922
1005
  {
923
1006
  foreignKeyName: "documents_product_id_fkey";
924
1007
  columns: ["product_id"];
@@ -1685,214 +1768,927 @@ export type Database = {
1685
1768
  };
1686
1769
  Relationships: [
1687
1770
  {
1688
- foreignKeyName: "maintenance_requests_creator_user_id_fkey";
1689
- columns: ["creator_user_id"];
1771
+ foreignKeyName: "maintenance_requests_creator_user_id_fkey";
1772
+ columns: ["creator_user_id"];
1773
+ isOneToOne: false;
1774
+ referencedRelation: "users";
1775
+ referencedColumns: ["id"];
1776
+ },
1777
+ {
1778
+ foreignKeyName: "maintenance_requests_device_id_fkey";
1779
+ columns: ["device_id"];
1780
+ isOneToOne: false;
1781
+ referencedRelation: "devices";
1782
+ referencedColumns: ["id"];
1783
+ },
1784
+ {
1785
+ foreignKeyName: "maintenance_requests_part_id_fkey";
1786
+ columns: ["part_id"];
1787
+ isOneToOne: false;
1788
+ referencedRelation: "parts";
1789
+ referencedColumns: ["id"];
1790
+ },
1791
+ {
1792
+ foreignKeyName: "maintenance_requests_remediation_completed_user_id_fkey";
1793
+ columns: ["remediation_completed_user_id"];
1794
+ isOneToOne: false;
1795
+ referencedRelation: "users";
1796
+ referencedColumns: ["id"];
1797
+ },
1798
+ {
1799
+ foreignKeyName: "maintenance_requests_session_incident_id_fkey";
1800
+ columns: ["session_incident_id"];
1801
+ isOneToOne: false;
1802
+ referencedRelation: "session_incidents";
1803
+ referencedColumns: ["id"];
1804
+ },
1805
+ {
1806
+ foreignKeyName: "maintenance_requests_updated_by_user_id_fkey";
1807
+ columns: ["updated_by_user_id"];
1808
+ isOneToOne: false;
1809
+ referencedRelation: "users";
1810
+ referencedColumns: ["id"];
1811
+ }
1812
+ ];
1813
+ };
1814
+ manufacturers: {
1815
+ Row: {
1816
+ country: string | null;
1817
+ gln: string | null;
1818
+ id: number;
1819
+ inserted_at: string;
1820
+ lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
1821
+ lifecycle_changed_at: string;
1822
+ lifecycle_changed_by: string | null;
1823
+ lifecycle_reason: string | null;
1824
+ name: string;
1825
+ website: string | null;
1826
+ };
1827
+ Insert: {
1828
+ country?: string | null;
1829
+ gln?: string | null;
1830
+ id?: number;
1831
+ inserted_at?: string;
1832
+ lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
1833
+ lifecycle_changed_at?: string;
1834
+ lifecycle_changed_by?: string | null;
1835
+ lifecycle_reason?: string | null;
1836
+ name: string;
1837
+ website?: string | null;
1838
+ };
1839
+ Update: {
1840
+ country?: string | null;
1841
+ gln?: string | null;
1842
+ id?: number;
1843
+ inserted_at?: string;
1844
+ lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
1845
+ lifecycle_changed_at?: string;
1846
+ lifecycle_changed_by?: string | null;
1847
+ lifecycle_reason?: string | null;
1848
+ name?: string;
1849
+ website?: string | null;
1850
+ };
1851
+ Relationships: [
1852
+ {
1853
+ foreignKeyName: "manufacturers_lifecycle_changed_by_fkey";
1854
+ columns: ["lifecycle_changed_by"];
1855
+ isOneToOne: false;
1856
+ referencedRelation: "users";
1857
+ referencedColumns: ["id"];
1858
+ }
1859
+ ];
1860
+ };
1861
+ models: {
1862
+ Row: {
1863
+ capabilities: string[];
1864
+ id: number;
1865
+ inserted_at: string;
1866
+ is_active: boolean;
1867
+ metadata: Json;
1868
+ name: string;
1869
+ version: string;
1870
+ weights_sha256: string | null;
1871
+ weights_uri: string | null;
1872
+ };
1873
+ Insert: {
1874
+ capabilities?: string[];
1875
+ id?: number;
1876
+ inserted_at?: string;
1877
+ is_active?: boolean;
1878
+ metadata?: Json;
1879
+ name: string;
1880
+ version?: string;
1881
+ weights_sha256?: string | null;
1882
+ weights_uri?: string | null;
1883
+ };
1884
+ Update: {
1885
+ capabilities?: string[];
1886
+ id?: number;
1887
+ inserted_at?: string;
1888
+ is_active?: boolean;
1889
+ metadata?: Json;
1890
+ name?: string;
1891
+ version?: string;
1892
+ weights_sha256?: string | null;
1893
+ weights_uri?: string | null;
1894
+ };
1895
+ Relationships: [];
1896
+ };
1897
+ models_per_jobs_per_herd: {
1898
+ Row: {
1899
+ enabled: boolean;
1900
+ herd_id: number;
1901
+ id: number;
1902
+ inserted_at: string;
1903
+ job_type: string;
1904
+ model_id: number;
1905
+ priority: number;
1906
+ };
1907
+ Insert: {
1908
+ enabled?: boolean;
1909
+ herd_id: number;
1910
+ id?: number;
1911
+ inserted_at?: string;
1912
+ job_type: string;
1913
+ model_id: number;
1914
+ priority?: number;
1915
+ };
1916
+ Update: {
1917
+ enabled?: boolean;
1918
+ herd_id?: number;
1919
+ id?: number;
1920
+ inserted_at?: string;
1921
+ job_type?: string;
1922
+ model_id?: number;
1923
+ priority?: number;
1924
+ };
1925
+ Relationships: [
1926
+ {
1927
+ foreignKeyName: "models_per_jobs_per_herd_herd_id_fkey";
1928
+ columns: ["herd_id"];
1929
+ isOneToOne: false;
1930
+ referencedRelation: "herds";
1931
+ referencedColumns: ["id"];
1932
+ },
1933
+ {
1934
+ foreignKeyName: "models_per_jobs_per_herd_model_id_fkey";
1935
+ columns: ["model_id"];
1936
+ isOneToOne: false;
1937
+ referencedRelation: "models";
1938
+ referencedColumns: ["id"];
1939
+ }
1940
+ ];
1941
+ };
1942
+ observations: {
1943
+ Row: {
1944
+ action_complete: boolean;
1945
+ action_required: string | null;
1946
+ description: string;
1947
+ id: number;
1948
+ inserted_at: string;
1949
+ session_id: number;
1950
+ timestamp: string | null;
1951
+ updated_at: string | null;
1952
+ };
1953
+ Insert: {
1954
+ action_complete?: boolean;
1955
+ action_required?: string | null;
1956
+ description: string;
1957
+ id?: number;
1958
+ inserted_at?: string;
1959
+ session_id: number;
1960
+ timestamp?: string | null;
1961
+ updated_at?: string | null;
1962
+ };
1963
+ Update: {
1964
+ action_complete?: boolean;
1965
+ action_required?: string | null;
1966
+ description?: string;
1967
+ id?: number;
1968
+ inserted_at?: string;
1969
+ session_id?: number;
1970
+ timestamp?: string | null;
1971
+ updated_at?: string | null;
1972
+ };
1973
+ Relationships: [
1974
+ {
1975
+ foreignKeyName: "observations_session_id_fkey";
1976
+ columns: ["session_id"];
1977
+ isOneToOne: false;
1978
+ referencedRelation: "sessions";
1979
+ referencedColumns: ["id"];
1980
+ }
1981
+ ];
1982
+ };
1983
+ operating_context_equipment_categories: {
1984
+ Row: {
1985
+ id: number;
1986
+ inserted_at: string;
1987
+ lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
1988
+ lifecycle_changed_at: string;
1989
+ lifecycle_changed_by: string | null;
1990
+ lifecycle_reason: string | null;
1991
+ localization_id: number;
1992
+ name: string;
1993
+ };
1994
+ Insert: {
1995
+ id?: number;
1996
+ inserted_at?: string;
1997
+ lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
1998
+ lifecycle_changed_at?: string;
1999
+ lifecycle_changed_by?: string | null;
2000
+ lifecycle_reason?: string | null;
2001
+ localization_id: number;
2002
+ name: string;
2003
+ };
2004
+ Update: {
2005
+ id?: number;
2006
+ inserted_at?: string;
2007
+ lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
2008
+ lifecycle_changed_at?: string;
2009
+ lifecycle_changed_by?: string | null;
2010
+ lifecycle_reason?: string | null;
2011
+ localization_id?: number;
2012
+ name?: string;
2013
+ };
2014
+ Relationships: [
2015
+ {
2016
+ foreignKeyName: "operating_context_equipment_categorie_lifecycle_changed_by_fkey";
2017
+ columns: ["lifecycle_changed_by"];
2018
+ isOneToOne: false;
2019
+ referencedRelation: "users";
2020
+ referencedColumns: ["id"];
2021
+ },
2022
+ {
2023
+ foreignKeyName: "operating_context_equipment_categories_localization_id_fkey";
2024
+ columns: ["localization_id"];
2025
+ isOneToOne: false;
2026
+ referencedRelation: "localizations";
2027
+ referencedColumns: ["id"];
2028
+ }
2029
+ ];
2030
+ };
2031
+ operating_context_equipment_items: {
2032
+ Row: {
2033
+ equipment_category_id: number;
2034
+ id: number;
2035
+ inserted_at: string;
2036
+ lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
2037
+ lifecycle_changed_at: string;
2038
+ lifecycle_changed_by: string | null;
2039
+ lifecycle_reason: string | null;
2040
+ name: string;
2041
+ };
2042
+ Insert: {
2043
+ equipment_category_id: number;
2044
+ id?: number;
2045
+ inserted_at?: string;
2046
+ lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
2047
+ lifecycle_changed_at?: string;
2048
+ lifecycle_changed_by?: string | null;
2049
+ lifecycle_reason?: string | null;
2050
+ name: string;
2051
+ };
2052
+ Update: {
2053
+ equipment_category_id?: number;
2054
+ id?: number;
2055
+ inserted_at?: string;
2056
+ lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
2057
+ lifecycle_changed_at?: string;
2058
+ lifecycle_changed_by?: string | null;
2059
+ lifecycle_reason?: string | null;
2060
+ name?: string;
2061
+ };
2062
+ Relationships: [
2063
+ {
2064
+ foreignKeyName: "operating_context_equipment_items_equipment_category_id_fkey";
2065
+ columns: ["equipment_category_id"];
2066
+ isOneToOne: false;
2067
+ referencedRelation: "operating_context_equipment_categories";
2068
+ referencedColumns: ["id"];
2069
+ },
2070
+ {
2071
+ foreignKeyName: "operating_context_equipment_items_lifecycle_changed_by_fkey";
2072
+ columns: ["lifecycle_changed_by"];
2073
+ isOneToOne: false;
2074
+ referencedRelation: "users";
2075
+ referencedColumns: ["id"];
2076
+ }
2077
+ ];
2078
+ };
2079
+ operating_context_equipment_requirements: {
2080
+ Row: {
2081
+ equipment_item_id: number;
2082
+ id: number;
2083
+ inserted_at: string;
2084
+ lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
2085
+ lifecycle_changed_at: string;
2086
+ lifecycle_changed_by: string | null;
2087
+ lifecycle_reason: string | null;
2088
+ operating_context_id: number;
2089
+ };
2090
+ Insert: {
2091
+ equipment_item_id: number;
2092
+ id?: number;
2093
+ inserted_at?: string;
2094
+ lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
2095
+ lifecycle_changed_at?: string;
2096
+ lifecycle_changed_by?: string | null;
2097
+ lifecycle_reason?: string | null;
2098
+ operating_context_id: number;
2099
+ };
2100
+ Update: {
2101
+ equipment_item_id?: number;
2102
+ id?: number;
2103
+ inserted_at?: string;
2104
+ lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
2105
+ lifecycle_changed_at?: string;
2106
+ lifecycle_changed_by?: string | null;
2107
+ lifecycle_reason?: string | null;
2108
+ operating_context_id?: number;
2109
+ };
2110
+ Relationships: [
2111
+ {
2112
+ foreignKeyName: "operating_context_equipment_requireme_lifecycle_changed_by_fkey";
2113
+ columns: ["lifecycle_changed_by"];
2114
+ isOneToOne: false;
2115
+ referencedRelation: "users";
2116
+ referencedColumns: ["id"];
2117
+ },
2118
+ {
2119
+ foreignKeyName: "operating_context_equipment_requireme_operating_context_id_fkey";
2120
+ columns: ["operating_context_id"];
2121
+ isOneToOne: false;
2122
+ referencedRelation: "operating_contexts";
2123
+ referencedColumns: ["id"];
2124
+ },
2125
+ {
2126
+ foreignKeyName: "operating_context_equipment_requirements_equipment_item_id_fkey";
2127
+ columns: ["equipment_item_id"];
2128
+ isOneToOne: false;
2129
+ referencedRelation: "operating_context_equipment_items";
2130
+ referencedColumns: ["id"];
2131
+ }
2132
+ ];
2133
+ };
2134
+ operating_context_payloads: {
2135
+ Row: {
2136
+ created_at: string;
2137
+ created_by: string;
2138
+ description: string | null;
2139
+ id: number;
2140
+ lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
2141
+ lifecycle_changed_at: string;
2142
+ lifecycle_changed_by: string | null;
2143
+ lifecycle_reason: string | null;
2144
+ operating_context_id: number;
2145
+ payload_type: Database["public"]["Enums"]["operating_context_payload_type"];
2146
+ updated_at: string;
2147
+ updated_by: string | null;
2148
+ weight_kg: number;
2149
+ };
2150
+ Insert: {
2151
+ created_at?: string;
2152
+ created_by: string;
2153
+ description?: string | null;
2154
+ id?: number;
2155
+ lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
2156
+ lifecycle_changed_at?: string;
2157
+ lifecycle_changed_by?: string | null;
2158
+ lifecycle_reason?: string | null;
2159
+ operating_context_id: number;
2160
+ payload_type: Database["public"]["Enums"]["operating_context_payload_type"];
2161
+ updated_at?: string;
2162
+ updated_by?: string | null;
2163
+ weight_kg: number;
2164
+ };
2165
+ Update: {
2166
+ created_at?: string;
2167
+ created_by?: string;
2168
+ description?: string | null;
2169
+ id?: number;
2170
+ lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
2171
+ lifecycle_changed_at?: string;
2172
+ lifecycle_changed_by?: string | null;
2173
+ lifecycle_reason?: string | null;
2174
+ operating_context_id?: number;
2175
+ payload_type?: Database["public"]["Enums"]["operating_context_payload_type"];
2176
+ updated_at?: string;
2177
+ updated_by?: string | null;
2178
+ weight_kg?: number;
2179
+ };
2180
+ Relationships: [
2181
+ {
2182
+ foreignKeyName: "operating_context_payloads_created_by_fkey";
2183
+ columns: ["created_by"];
2184
+ isOneToOne: false;
2185
+ referencedRelation: "users";
2186
+ referencedColumns: ["id"];
2187
+ },
2188
+ {
2189
+ foreignKeyName: "operating_context_payloads_lifecycle_changed_by_fkey";
2190
+ columns: ["lifecycle_changed_by"];
2191
+ isOneToOne: false;
2192
+ referencedRelation: "users";
2193
+ referencedColumns: ["id"];
2194
+ },
2195
+ {
2196
+ foreignKeyName: "operating_context_payloads_operating_context_id_fkey";
2197
+ columns: ["operating_context_id"];
2198
+ isOneToOne: false;
2199
+ referencedRelation: "operating_contexts";
2200
+ referencedColumns: ["id"];
2201
+ },
2202
+ {
2203
+ foreignKeyName: "operating_context_payloads_updated_by_fkey";
2204
+ columns: ["updated_by"];
2205
+ isOneToOne: false;
2206
+ referencedRelation: "users";
2207
+ referencedColumns: ["id"];
2208
+ }
2209
+ ];
2210
+ };
2211
+ operating_context_regions: {
2212
+ Row: {
2213
+ created_at: string;
2214
+ created_by: string;
2215
+ id: number;
2216
+ is_exclusion: boolean;
2217
+ lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
2218
+ lifecycle_changed_at: string;
2219
+ lifecycle_changed_by: string | null;
2220
+ lifecycle_reason: string | null;
2221
+ name: string | null;
2222
+ operating_context_id: number;
2223
+ region: unknown;
2224
+ updated_at: string;
2225
+ updated_by: string | null;
2226
+ weather_origin: unknown;
2227
+ };
2228
+ Insert: {
2229
+ created_at?: string;
2230
+ created_by: string;
2231
+ id?: number;
2232
+ is_exclusion: boolean;
2233
+ lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
2234
+ lifecycle_changed_at?: string;
2235
+ lifecycle_changed_by?: string | null;
2236
+ lifecycle_reason?: string | null;
2237
+ name?: string | null;
2238
+ operating_context_id: number;
2239
+ region: unknown;
2240
+ updated_at?: string;
2241
+ updated_by?: string | null;
2242
+ weather_origin?: unknown;
2243
+ };
2244
+ Update: {
2245
+ created_at?: string;
2246
+ created_by?: string;
2247
+ id?: number;
2248
+ is_exclusion?: boolean;
2249
+ lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
2250
+ lifecycle_changed_at?: string;
2251
+ lifecycle_changed_by?: string | null;
2252
+ lifecycle_reason?: string | null;
2253
+ name?: string | null;
2254
+ operating_context_id?: number;
2255
+ region?: unknown;
2256
+ updated_at?: string;
2257
+ updated_by?: string | null;
2258
+ weather_origin?: unknown;
2259
+ };
2260
+ Relationships: [
2261
+ {
2262
+ foreignKeyName: "operating_context_regions_created_by_fkey";
2263
+ columns: ["created_by"];
2264
+ isOneToOne: false;
2265
+ referencedRelation: "users";
2266
+ referencedColumns: ["id"];
2267
+ },
2268
+ {
2269
+ foreignKeyName: "operating_context_regions_lifecycle_changed_by_fkey";
2270
+ columns: ["lifecycle_changed_by"];
2271
+ isOneToOne: false;
2272
+ referencedRelation: "users";
2273
+ referencedColumns: ["id"];
2274
+ },
2275
+ {
2276
+ foreignKeyName: "operating_context_regions_operating_context_id_fkey";
2277
+ columns: ["operating_context_id"];
2278
+ isOneToOne: false;
2279
+ referencedRelation: "operating_contexts";
2280
+ referencedColumns: ["id"];
2281
+ },
2282
+ {
2283
+ foreignKeyName: "operating_context_regions_updated_by_fkey";
2284
+ columns: ["updated_by"];
2285
+ isOneToOne: false;
2286
+ referencedRelation: "users";
2287
+ referencedColumns: ["id"];
2288
+ }
2289
+ ];
2290
+ };
2291
+ operating_context_risks: {
2292
+ Row: {
2293
+ created_at: string;
2294
+ created_by: string;
2295
+ hazard: string;
2296
+ id: number;
2297
+ lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
2298
+ lifecycle_changed_at: string;
2299
+ lifecycle_changed_by: string | null;
2300
+ lifecycle_reason: string | null;
2301
+ mitigation: string;
2302
+ operating_context_id: number;
2303
+ probability_after: Database["public"]["Enums"]["operating_context_risk_probability"];
2304
+ probability_before: Database["public"]["Enums"]["operating_context_risk_probability"];
2305
+ severity_after: Database["public"]["Enums"]["operating_context_risk_severity"];
2306
+ severity_before: Database["public"]["Enums"]["operating_context_risk_severity"];
2307
+ updated_at: string;
2308
+ updated_by: string | null;
2309
+ };
2310
+ Insert: {
2311
+ created_at?: string;
2312
+ created_by: string;
2313
+ hazard: string;
2314
+ id?: number;
2315
+ lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
2316
+ lifecycle_changed_at?: string;
2317
+ lifecycle_changed_by?: string | null;
2318
+ lifecycle_reason?: string | null;
2319
+ mitigation: string;
2320
+ operating_context_id: number;
2321
+ probability_after: Database["public"]["Enums"]["operating_context_risk_probability"];
2322
+ probability_before: Database["public"]["Enums"]["operating_context_risk_probability"];
2323
+ severity_after: Database["public"]["Enums"]["operating_context_risk_severity"];
2324
+ severity_before: Database["public"]["Enums"]["operating_context_risk_severity"];
2325
+ updated_at?: string;
2326
+ updated_by?: string | null;
2327
+ };
2328
+ Update: {
2329
+ created_at?: string;
2330
+ created_by?: string;
2331
+ hazard?: string;
2332
+ id?: number;
2333
+ lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
2334
+ lifecycle_changed_at?: string;
2335
+ lifecycle_changed_by?: string | null;
2336
+ lifecycle_reason?: string | null;
2337
+ mitigation?: string;
2338
+ operating_context_id?: number;
2339
+ probability_after?: Database["public"]["Enums"]["operating_context_risk_probability"];
2340
+ probability_before?: Database["public"]["Enums"]["operating_context_risk_probability"];
2341
+ severity_after?: Database["public"]["Enums"]["operating_context_risk_severity"];
2342
+ severity_before?: Database["public"]["Enums"]["operating_context_risk_severity"];
2343
+ updated_at?: string;
2344
+ updated_by?: string | null;
2345
+ };
2346
+ Relationships: [
2347
+ {
2348
+ foreignKeyName: "operating_context_risks_created_by_fkey";
2349
+ columns: ["created_by"];
1690
2350
  isOneToOne: false;
1691
2351
  referencedRelation: "users";
1692
2352
  referencedColumns: ["id"];
1693
2353
  },
1694
2354
  {
1695
- foreignKeyName: "maintenance_requests_device_id_fkey";
1696
- columns: ["device_id"];
2355
+ foreignKeyName: "operating_context_risks_lifecycle_changed_by_fkey";
2356
+ columns: ["lifecycle_changed_by"];
1697
2357
  isOneToOne: false;
1698
- referencedRelation: "devices";
2358
+ referencedRelation: "users";
1699
2359
  referencedColumns: ["id"];
1700
2360
  },
1701
2361
  {
1702
- foreignKeyName: "maintenance_requests_part_id_fkey";
1703
- columns: ["part_id"];
2362
+ foreignKeyName: "operating_context_risks_operating_context_id_fkey";
2363
+ columns: ["operating_context_id"];
1704
2364
  isOneToOne: false;
1705
- referencedRelation: "parts";
2365
+ referencedRelation: "operating_contexts";
1706
2366
  referencedColumns: ["id"];
1707
2367
  },
1708
2368
  {
1709
- foreignKeyName: "maintenance_requests_remediation_completed_user_id_fkey";
1710
- columns: ["remediation_completed_user_id"];
2369
+ foreignKeyName: "operating_context_risks_updated_by_fkey";
2370
+ columns: ["updated_by"];
1711
2371
  isOneToOne: false;
1712
2372
  referencedRelation: "users";
1713
2373
  referencedColumns: ["id"];
2374
+ }
2375
+ ];
2376
+ };
2377
+ operating_context_role_assignments: {
2378
+ Row: {
2379
+ herd_id: number;
2380
+ id: number;
2381
+ inserted_at: string;
2382
+ lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
2383
+ lifecycle_changed_at: string;
2384
+ lifecycle_changed_by: string | null;
2385
+ lifecycle_reason: string | null;
2386
+ membership_id: number;
2387
+ operating_context_id: number;
2388
+ role_id: number;
2389
+ };
2390
+ Insert: {
2391
+ herd_id: number;
2392
+ id?: number;
2393
+ inserted_at?: string;
2394
+ lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
2395
+ lifecycle_changed_at?: string;
2396
+ lifecycle_changed_by?: string | null;
2397
+ lifecycle_reason?: string | null;
2398
+ membership_id: number;
2399
+ operating_context_id: number;
2400
+ role_id: number;
2401
+ };
2402
+ Update: {
2403
+ herd_id?: number;
2404
+ id?: number;
2405
+ inserted_at?: string;
2406
+ lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
2407
+ lifecycle_changed_at?: string;
2408
+ lifecycle_changed_by?: string | null;
2409
+ lifecycle_reason?: string | null;
2410
+ membership_id?: number;
2411
+ operating_context_id?: number;
2412
+ role_id?: number;
2413
+ };
2414
+ Relationships: [
2415
+ {
2416
+ foreignKeyName: "operating_context_role_assignment_context_fkey";
2417
+ columns: ["operating_context_id", "herd_id"];
2418
+ isOneToOne: false;
2419
+ referencedRelation: "operating_contexts";
2420
+ referencedColumns: ["id", "herd_id"];
1714
2421
  },
1715
2422
  {
1716
- foreignKeyName: "maintenance_requests_session_incident_id_fkey";
1717
- columns: ["session_incident_id"];
2423
+ foreignKeyName: "operating_context_role_assignment_membership_fkey";
2424
+ columns: ["membership_id", "herd_id"];
1718
2425
  isOneToOne: false;
1719
- referencedRelation: "session_incidents";
1720
- referencedColumns: ["id"];
2426
+ referencedRelation: "users_roles_per_herd";
2427
+ referencedColumns: ["id", "herd_id"];
1721
2428
  },
1722
2429
  {
1723
- foreignKeyName: "maintenance_requests_updated_by_user_id_fkey";
1724
- columns: ["updated_by_user_id"];
2430
+ foreignKeyName: "operating_context_role_assignments_lifecycle_changed_by_fkey";
2431
+ columns: ["lifecycle_changed_by"];
1725
2432
  isOneToOne: false;
1726
2433
  referencedRelation: "users";
1727
2434
  referencedColumns: ["id"];
2435
+ },
2436
+ {
2437
+ foreignKeyName: "operating_context_role_assignments_role_id_fkey";
2438
+ columns: ["role_id"];
2439
+ isOneToOne: false;
2440
+ referencedRelation: "operating_context_roles";
2441
+ referencedColumns: ["id"];
1728
2442
  }
1729
2443
  ];
1730
2444
  };
1731
- manufacturers: {
2445
+ operating_context_roles: {
1732
2446
  Row: {
1733
- country: string | null;
1734
- gln: string | null;
1735
2447
  id: number;
1736
2448
  inserted_at: string;
1737
2449
  lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
1738
2450
  lifecycle_changed_at: string;
1739
2451
  lifecycle_changed_by: string | null;
1740
2452
  lifecycle_reason: string | null;
2453
+ localization_id: number;
1741
2454
  name: string;
1742
- website: string | null;
1743
2455
  };
1744
2456
  Insert: {
1745
- country?: string | null;
1746
- gln?: string | null;
1747
2457
  id?: number;
1748
2458
  inserted_at?: string;
1749
2459
  lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
1750
2460
  lifecycle_changed_at?: string;
1751
2461
  lifecycle_changed_by?: string | null;
1752
2462
  lifecycle_reason?: string | null;
2463
+ localization_id: number;
1753
2464
  name: string;
1754
- website?: string | null;
1755
2465
  };
1756
2466
  Update: {
1757
- country?: string | null;
1758
- gln?: string | null;
1759
2467
  id?: number;
1760
2468
  inserted_at?: string;
1761
2469
  lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
1762
2470
  lifecycle_changed_at?: string;
1763
2471
  lifecycle_changed_by?: string | null;
1764
2472
  lifecycle_reason?: string | null;
2473
+ localization_id?: number;
1765
2474
  name?: string;
1766
- website?: string | null;
1767
2475
  };
1768
2476
  Relationships: [
1769
2477
  {
1770
- foreignKeyName: "manufacturers_lifecycle_changed_by_fkey";
2478
+ foreignKeyName: "operating_context_roles_lifecycle_changed_by_fkey";
1771
2479
  columns: ["lifecycle_changed_by"];
1772
2480
  isOneToOne: false;
1773
2481
  referencedRelation: "users";
1774
2482
  referencedColumns: ["id"];
2483
+ },
2484
+ {
2485
+ foreignKeyName: "operating_context_roles_localization_id_fkey";
2486
+ columns: ["localization_id"];
2487
+ isOneToOne: false;
2488
+ referencedRelation: "localizations";
2489
+ referencedColumns: ["id"];
1775
2490
  }
1776
2491
  ];
1777
2492
  };
1778
- models: {
2493
+ operating_context_types: {
1779
2494
  Row: {
1780
- capabilities: string[];
1781
2495
  id: number;
1782
2496
  inserted_at: string;
1783
- is_active: boolean;
1784
- metadata: Json;
2497
+ lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
2498
+ lifecycle_changed_at: string;
2499
+ lifecycle_changed_by: string | null;
2500
+ lifecycle_reason: string | null;
2501
+ localization_id: number;
1785
2502
  name: string;
1786
- version: string;
1787
- weights_sha256: string | null;
1788
- weights_uri: string | null;
1789
2503
  };
1790
2504
  Insert: {
1791
- capabilities?: string[];
1792
2505
  id?: number;
1793
2506
  inserted_at?: string;
1794
- is_active?: boolean;
1795
- metadata?: Json;
2507
+ lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
2508
+ lifecycle_changed_at?: string;
2509
+ lifecycle_changed_by?: string | null;
2510
+ lifecycle_reason?: string | null;
2511
+ localization_id: number;
1796
2512
  name: string;
1797
- version?: string;
1798
- weights_sha256?: string | null;
1799
- weights_uri?: string | null;
1800
2513
  };
1801
2514
  Update: {
1802
- capabilities?: string[];
1803
2515
  id?: number;
1804
2516
  inserted_at?: string;
1805
- is_active?: boolean;
1806
- metadata?: Json;
2517
+ lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
2518
+ lifecycle_changed_at?: string;
2519
+ lifecycle_changed_by?: string | null;
2520
+ lifecycle_reason?: string | null;
2521
+ localization_id?: number;
1807
2522
  name?: string;
1808
- version?: string;
1809
- weights_sha256?: string | null;
1810
- weights_uri?: string | null;
1811
2523
  };
1812
- Relationships: [];
2524
+ Relationships: [
2525
+ {
2526
+ foreignKeyName: "operating_context_types_lifecycle_changed_by_fkey";
2527
+ columns: ["lifecycle_changed_by"];
2528
+ isOneToOne: false;
2529
+ referencedRelation: "users";
2530
+ referencedColumns: ["id"];
2531
+ },
2532
+ {
2533
+ foreignKeyName: "operating_context_types_localization_id_fkey";
2534
+ columns: ["localization_id"];
2535
+ isOneToOne: false;
2536
+ referencedRelation: "localizations";
2537
+ referencedColumns: ["id"];
2538
+ }
2539
+ ];
1813
2540
  };
1814
- models_per_jobs_per_herd: {
2541
+ operating_context_weather_snapshots: {
1815
2542
  Row: {
1816
- enabled: boolean;
1817
- herd_id: number;
2543
+ collected_at: string;
2544
+ density_altitude_meters: number | null;
1818
2545
  id: number;
1819
2546
  inserted_at: string;
1820
- job_type: string;
1821
- model_id: number;
1822
- priority: number;
2547
+ kp_index: number | null;
2548
+ operating_context_region_id: number;
2549
+ precipitation_millimeters: number | null;
2550
+ static_buildup_category: string | null;
2551
+ temperature_max_celsius: number | null;
2552
+ temperature_min_celsius: number | null;
2553
+ visibility_meters: number | null;
2554
+ wind_heading_degrees: number | null;
2555
+ wind_speed_meters_per_second: number | null;
1823
2556
  };
1824
2557
  Insert: {
1825
- enabled?: boolean;
1826
- herd_id: number;
2558
+ collected_at: string;
2559
+ density_altitude_meters?: number | null;
1827
2560
  id?: number;
1828
2561
  inserted_at?: string;
1829
- job_type: string;
1830
- model_id: number;
1831
- priority?: number;
2562
+ kp_index?: number | null;
2563
+ operating_context_region_id: number;
2564
+ precipitation_millimeters?: number | null;
2565
+ static_buildup_category?: string | null;
2566
+ temperature_max_celsius?: number | null;
2567
+ temperature_min_celsius?: number | null;
2568
+ visibility_meters?: number | null;
2569
+ wind_heading_degrees?: number | null;
2570
+ wind_speed_meters_per_second?: number | null;
1832
2571
  };
1833
2572
  Update: {
1834
- enabled?: boolean;
1835
- herd_id?: number;
2573
+ collected_at?: string;
2574
+ density_altitude_meters?: number | null;
1836
2575
  id?: number;
1837
2576
  inserted_at?: string;
1838
- job_type?: string;
1839
- model_id?: number;
1840
- priority?: number;
2577
+ kp_index?: number | null;
2578
+ operating_context_region_id?: number;
2579
+ precipitation_millimeters?: number | null;
2580
+ static_buildup_category?: string | null;
2581
+ temperature_max_celsius?: number | null;
2582
+ temperature_min_celsius?: number | null;
2583
+ visibility_meters?: number | null;
2584
+ wind_heading_degrees?: number | null;
2585
+ wind_speed_meters_per_second?: number | null;
1841
2586
  };
1842
2587
  Relationships: [
1843
2588
  {
1844
- foreignKeyName: "models_per_jobs_per_herd_herd_id_fkey";
1845
- columns: ["herd_id"];
1846
- isOneToOne: false;
1847
- referencedRelation: "herds";
1848
- referencedColumns: ["id"];
1849
- },
1850
- {
1851
- foreignKeyName: "models_per_jobs_per_herd_model_id_fkey";
1852
- columns: ["model_id"];
2589
+ foreignKeyName: "operating_context_weather_snap_operating_context_region_id_fkey";
2590
+ columns: ["operating_context_region_id"];
1853
2591
  isOneToOne: false;
1854
- referencedRelation: "models";
2592
+ referencedRelation: "operating_context_regions";
1855
2593
  referencedColumns: ["id"];
1856
2594
  }
1857
2595
  ];
1858
2596
  };
1859
- observations: {
2597
+ operating_contexts: {
1860
2598
  Row: {
1861
- action_complete: boolean;
1862
- action_required: string | null;
1863
- description: string;
2599
+ altitude_agl_max: number;
2600
+ created_at: string;
2601
+ created_by: string;
2602
+ description: string | null;
2603
+ distance_max_from_home: number;
2604
+ herd_id: number;
1864
2605
  id: number;
1865
- inserted_at: string;
1866
- session_id: number;
1867
- timestamp: string | null;
1868
- updated_at: string | null;
2606
+ involves_third_party_land: boolean;
2607
+ lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
2608
+ lifecycle_changed_at: string;
2609
+ lifecycle_changed_by: string | null;
2610
+ lifecycle_reason: string | null;
2611
+ name: string;
2612
+ operating_context_type_id: number;
2613
+ updated_at: string;
2614
+ updated_by: string | null;
2615
+ valid_from: string;
2616
+ valid_to: string;
1869
2617
  };
1870
2618
  Insert: {
1871
- action_complete?: boolean;
1872
- action_required?: string | null;
1873
- description: string;
2619
+ altitude_agl_max: number;
2620
+ created_at?: string;
2621
+ created_by: string;
2622
+ description?: string | null;
2623
+ distance_max_from_home: number;
2624
+ herd_id: number;
1874
2625
  id?: number;
1875
- inserted_at?: string;
1876
- session_id: number;
1877
- timestamp?: string | null;
1878
- updated_at?: string | null;
2626
+ involves_third_party_land: boolean;
2627
+ lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
2628
+ lifecycle_changed_at?: string;
2629
+ lifecycle_changed_by?: string | null;
2630
+ lifecycle_reason?: string | null;
2631
+ name: string;
2632
+ operating_context_type_id: number;
2633
+ updated_at?: string;
2634
+ updated_by?: string | null;
2635
+ valid_from: string;
2636
+ valid_to: string;
1879
2637
  };
1880
2638
  Update: {
1881
- action_complete?: boolean;
1882
- action_required?: string | null;
1883
- description?: string;
2639
+ altitude_agl_max?: number;
2640
+ created_at?: string;
2641
+ created_by?: string;
2642
+ description?: string | null;
2643
+ distance_max_from_home?: number;
2644
+ herd_id?: number;
1884
2645
  id?: number;
1885
- inserted_at?: string;
1886
- session_id?: number;
1887
- timestamp?: string | null;
1888
- updated_at?: string | null;
2646
+ involves_third_party_land?: boolean;
2647
+ lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
2648
+ lifecycle_changed_at?: string;
2649
+ lifecycle_changed_by?: string | null;
2650
+ lifecycle_reason?: string | null;
2651
+ name?: string;
2652
+ operating_context_type_id?: number;
2653
+ updated_at?: string;
2654
+ updated_by?: string | null;
2655
+ valid_from?: string;
2656
+ valid_to?: string;
1889
2657
  };
1890
2658
  Relationships: [
1891
2659
  {
1892
- foreignKeyName: "observations_session_id_fkey";
1893
- columns: ["session_id"];
2660
+ foreignKeyName: "operating_contexts_created_by_fkey";
2661
+ columns: ["created_by"];
1894
2662
  isOneToOne: false;
1895
- referencedRelation: "sessions";
2663
+ referencedRelation: "users";
2664
+ referencedColumns: ["id"];
2665
+ },
2666
+ {
2667
+ foreignKeyName: "operating_contexts_herd_id_fkey";
2668
+ columns: ["herd_id"];
2669
+ isOneToOne: false;
2670
+ referencedRelation: "herds";
2671
+ referencedColumns: ["id"];
2672
+ },
2673
+ {
2674
+ foreignKeyName: "operating_contexts_lifecycle_changed_by_fkey";
2675
+ columns: ["lifecycle_changed_by"];
2676
+ isOneToOne: false;
2677
+ referencedRelation: "users";
2678
+ referencedColumns: ["id"];
2679
+ },
2680
+ {
2681
+ foreignKeyName: "operating_contexts_operating_context_type_id_fkey";
2682
+ columns: ["operating_context_type_id"];
2683
+ isOneToOne: false;
2684
+ referencedRelation: "operating_context_types";
2685
+ referencedColumns: ["id"];
2686
+ },
2687
+ {
2688
+ foreignKeyName: "operating_contexts_updated_by_fkey";
2689
+ columns: ["updated_by"];
2690
+ isOneToOne: false;
2691
+ referencedRelation: "users";
1896
2692
  referencedColumns: ["id"];
1897
2693
  }
1898
2694
  ];
@@ -3447,9 +4243,13 @@ export type Database = {
3447
4243
  lifecycle_changed_by: string | null;
3448
4244
  lifecycle_reason: string | null;
3449
4245
  modality: string | null;
4246
+ proxy_file_path: string | null;
4247
+ proxy_generated_at: string | null;
3450
4248
  segmented_at: string | null;
3451
4249
  session_id: number | null;
3452
4250
  tagged_at: string | null;
4251
+ thumbnail_file_path: string | null;
4252
+ thumbnail_generated_at: string | null;
3453
4253
  timestamp_observation: string | null;
3454
4254
  timestamp_observation_end: string;
3455
4255
  tracked_at: string | null;
@@ -3479,9 +4279,13 @@ export type Database = {
3479
4279
  lifecycle_changed_by: string | null;
3480
4280
  lifecycle_reason: string | null;
3481
4281
  modality: string | null;
4282
+ proxy_file_path: string | null;
4283
+ proxy_generated_at: string | null;
3482
4284
  segmented_at: string | null;
3483
4285
  session_id: number | null;
3484
4286
  tagged_at: string | null;
4287
+ thumbnail_file_path: string | null;
4288
+ thumbnail_generated_at: string | null;
3485
4289
  timestamp_observation: string | null;
3486
4290
  timestamp_observation_end: string;
3487
4291
  tracked_at: string | null;
@@ -3512,9 +4316,13 @@ export type Database = {
3512
4316
  lifecycle_changed_by: string | null;
3513
4317
  lifecycle_reason: string | null;
3514
4318
  modality: string | null;
4319
+ proxy_file_path: string | null;
4320
+ proxy_generated_at: string | null;
3515
4321
  segmented_at: string | null;
3516
4322
  session_id: number | null;
3517
4323
  tagged_at: string | null;
4324
+ thumbnail_file_path: string | null;
4325
+ thumbnail_generated_at: string | null;
3518
4326
  timestamp_observation: string | null;
3519
4327
  timestamp_observation_end: string;
3520
4328
  tracked_at: string | null;
@@ -3545,9 +4353,13 @@ export type Database = {
3545
4353
  lifecycle_changed_by: string | null;
3546
4354
  lifecycle_reason: string | null;
3547
4355
  modality: string | null;
4356
+ proxy_file_path: string | null;
4357
+ proxy_generated_at: string | null;
3548
4358
  segmented_at: string | null;
3549
4359
  session_id: number | null;
3550
4360
  tagged_at: string | null;
4361
+ thumbnail_file_path: string | null;
4362
+ thumbnail_generated_at: string | null;
3551
4363
  timestamp_observation: string | null;
3552
4364
  timestamp_observation_end: string;
3553
4365
  tracked_at: string | null;
@@ -3579,9 +4391,13 @@ export type Database = {
3579
4391
  lifecycle_changed_by: string | null;
3580
4392
  lifecycle_reason: string | null;
3581
4393
  modality: string | null;
4394
+ proxy_file_path: string | null;
4395
+ proxy_generated_at: string | null;
3582
4396
  segmented_at: string | null;
3583
4397
  session_id: number | null;
3584
4398
  tagged_at: string | null;
4399
+ thumbnail_file_path: string | null;
4400
+ thumbnail_generated_at: string | null;
3585
4401
  timestamp_observation: string | null;
3586
4402
  timestamp_observation_end: string;
3587
4403
  tracked_at: string | null;
@@ -3613,9 +4429,13 @@ export type Database = {
3613
4429
  lifecycle_changed_by: string | null;
3614
4430
  lifecycle_reason: string | null;
3615
4431
  modality: string | null;
4432
+ proxy_file_path: string | null;
4433
+ proxy_generated_at: string | null;
3616
4434
  segmented_at: string | null;
3617
4435
  session_id: number | null;
3618
4436
  tagged_at: string | null;
4437
+ thumbnail_file_path: string | null;
4438
+ thumbnail_generated_at: string | null;
3619
4439
  timestamp_observation: string | null;
3620
4440
  timestamp_observation_end: string;
3621
4441
  tracked_at: string | null;
@@ -3648,9 +4468,13 @@ export type Database = {
3648
4468
  lifecycle_changed_by: string | null;
3649
4469
  lifecycle_reason: string | null;
3650
4470
  modality: string | null;
4471
+ proxy_file_path: string | null;
4472
+ proxy_generated_at: string | null;
3651
4473
  segmented_at: string | null;
3652
4474
  session_id: number | null;
3653
4475
  tagged_at: string | null;
4476
+ thumbnail_file_path: string | null;
4477
+ thumbnail_generated_at: string | null;
3654
4478
  timestamp_observation: string | null;
3655
4479
  timestamp_observation_end: string;
3656
4480
  tracked_at: string | null;
@@ -3682,9 +4506,13 @@ export type Database = {
3682
4506
  lifecycle_changed_by: string | null;
3683
4507
  lifecycle_reason: string | null;
3684
4508
  modality: string | null;
4509
+ proxy_file_path: string | null;
4510
+ proxy_generated_at: string | null;
3685
4511
  segmented_at: string | null;
3686
4512
  session_id: number | null;
3687
4513
  tagged_at: string | null;
4514
+ thumbnail_file_path: string | null;
4515
+ thumbnail_generated_at: string | null;
3688
4516
  timestamp_observation: string | null;
3689
4517
  timestamp_observation_end: string;
3690
4518
  tracked_at: string | null;
@@ -3717,9 +4545,13 @@ export type Database = {
3717
4545
  lifecycle_changed_by: string | null;
3718
4546
  lifecycle_reason: string | null;
3719
4547
  modality: string | null;
4548
+ proxy_file_path: string | null;
4549
+ proxy_generated_at: string | null;
3720
4550
  segmented_at: string | null;
3721
4551
  session_id: number | null;
3722
4552
  tagged_at: string | null;
4553
+ thumbnail_file_path: string | null;
4554
+ thumbnail_generated_at: string | null;
3723
4555
  timestamp_observation: string | null;
3724
4556
  timestamp_observation_end: string;
3725
4557
  tracked_at: string | null;
@@ -4169,6 +5001,35 @@ export type Database = {
4169
5001
  subject_id: number;
4170
5002
  }[];
4171
5003
  };
5004
+ get_operating_context_weather_snapshots: {
5005
+ Args: {
5006
+ cursor_collected_at?: string;
5007
+ cursor_id?: number;
5008
+ limit_caller?: number;
5009
+ operating_context_id_caller: number;
5010
+ };
5011
+ Returns: {
5012
+ collected_at: string;
5013
+ density_altitude_meters: number | null;
5014
+ id: number;
5015
+ inserted_at: string;
5016
+ kp_index: number | null;
5017
+ operating_context_region_id: number;
5018
+ precipitation_millimeters: number | null;
5019
+ static_buildup_category: string | null;
5020
+ temperature_max_celsius: number | null;
5021
+ temperature_min_celsius: number | null;
5022
+ visibility_meters: number | null;
5023
+ wind_heading_degrees: number | null;
5024
+ wind_speed_meters_per_second: number | null;
5025
+ }[];
5026
+ SetofOptions: {
5027
+ from: "*";
5028
+ to: "operating_context_weather_snapshots";
5029
+ isOneToOne: false;
5030
+ isSetofReturn: true;
5031
+ };
5032
+ };
4172
5033
  get_parts_for_herd: {
4173
5034
  Args: {
4174
5035
  herd_id_caller: number;
@@ -4837,12 +5698,15 @@ export type Database = {
4837
5698
  analysis_work_status: "waiting" | "cancelled" | "processing" | "failed" | "success";
4838
5699
  app_permission: "herds.delete" | "events.delete";
4839
5700
  device_type: "trail_camera" | "drone_fixed_wing" | "drone_quad" | "gps_tracker" | "sentry_tower" | "smart_buoy" | "radio_mesh_base_station" | "radio_mesh_repeater" | "unknown" | "gps_tracker_vehicle" | "gps_tracker_person" | "radio_mesh_base_station_gateway" | "remote_controller" | "docking_station" | "smart_battery" | "charging_station";
4840
- document_entity: "user" | "herd" | "device" | "product";
5701
+ document_entity: "user" | "herd" | "device" | "product" | "operating_context";
4841
5702
  entity_lifecycle: "active" | "retired" | "deleted";
4842
5703
  health_item: "healthy" | "repairable" | "unrepairable";
4843
5704
  herd_invitation_status: "pending" | "accepted" | "revoked" | "expired";
4844
5705
  link_type: "wifi" | "ocusync" | "lte" | "satellite" | "mesh" | "lora" | "unknown";
4845
5706
  media_type: "image" | "video" | "audio" | "text";
5707
+ operating_context_payload_type: "drop_supply" | "drop_firestarter" | "other";
5708
+ operating_context_risk_probability: "extremely_improbable" | "improbable" | "unlikely" | "occasional" | "frequent";
5709
+ operating_context_risk_severity: "negligible" | "minor" | "major" | "hazardous" | "catastrophic";
4846
5710
  plan_type: "mission" | "fence" | "rally" | "markov";
4847
5711
  review_status: "pending" | "annotating" | "in_review" | "completed" | "rejected";
4848
5712
  session_end_reason: "completed" | "superseded" | "reporting_lost" | "inactivity_timeout" | "operator_cancelled" | "system_cancelled" | "other";
@@ -5169,12 +6033,15 @@ export declare const Constants: {
5169
6033
  readonly analysis_work_status: readonly ["waiting", "cancelled", "processing", "failed", "success"];
5170
6034
  readonly app_permission: readonly ["herds.delete", "events.delete"];
5171
6035
  readonly device_type: readonly ["trail_camera", "drone_fixed_wing", "drone_quad", "gps_tracker", "sentry_tower", "smart_buoy", "radio_mesh_base_station", "radio_mesh_repeater", "unknown", "gps_tracker_vehicle", "gps_tracker_person", "radio_mesh_base_station_gateway", "remote_controller", "docking_station", "smart_battery", "charging_station"];
5172
- readonly document_entity: readonly ["user", "herd", "device", "product"];
6036
+ readonly document_entity: readonly ["user", "herd", "device", "product", "operating_context"];
5173
6037
  readonly entity_lifecycle: readonly ["active", "retired", "deleted"];
5174
6038
  readonly health_item: readonly ["healthy", "repairable", "unrepairable"];
5175
6039
  readonly herd_invitation_status: readonly ["pending", "accepted", "revoked", "expired"];
5176
6040
  readonly link_type: readonly ["wifi", "ocusync", "lte", "satellite", "mesh", "lora", "unknown"];
5177
6041
  readonly media_type: readonly ["image", "video", "audio", "text"];
6042
+ readonly operating_context_payload_type: readonly ["drop_supply", "drop_firestarter", "other"];
6043
+ readonly operating_context_risk_probability: readonly ["extremely_improbable", "improbable", "unlikely", "occasional", "frequent"];
6044
+ readonly operating_context_risk_severity: readonly ["negligible", "minor", "major", "hazardous", "catastrophic"];
5178
6045
  readonly plan_type: readonly ["mission", "fence", "rally", "markov"];
5179
6046
  readonly review_status: readonly ["pending", "annotating", "in_review", "completed", "rejected"];
5180
6047
  readonly session_end_reason: readonly ["completed", "superseded", "reporting_lost", "inactivity_timeout", "operator_cancelled", "system_cancelled", "other"];