@adventurelabs/scout-core 1.4.96 → 1.5.1

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 (142) hide show
  1. package/dist/api_keys/actions.d.ts +1 -2
  2. package/dist/api_keys/actions.js +4 -83
  3. package/dist/api_keys/queries.d.ts +4 -0
  4. package/dist/api_keys/queries.js +52 -0
  5. package/dist/helpers/artifacts.d.ts +10 -15
  6. package/dist/helpers/artifacts.internal.d.ts +22 -0
  7. package/dist/helpers/artifacts.internal.js +151 -0
  8. package/dist/helpers/artifacts.js +48 -81
  9. package/dist/helpers/client_abilities_jwt_keys.d.ts +3 -4
  10. package/dist/helpers/client_abilities_jwt_keys.js +7 -7
  11. package/dist/helpers/client_abilities_jwt_keys_internal.d.ts +9 -0
  12. package/dist/helpers/client_abilities_jwt_keys_internal.js +20 -0
  13. package/dist/helpers/client_abilities_token_server.d.ts +1 -5
  14. package/dist/helpers/client_abilities_token_server.js +2 -2
  15. package/dist/helpers/connectivity.d.ts +2 -3
  16. package/dist/helpers/connectivity.internal.d.ts +10 -0
  17. package/dist/helpers/connectivity.internal.js +47 -0
  18. package/dist/helpers/connectivity.js +6 -7
  19. package/dist/helpers/devices.d.ts +1 -3
  20. package/dist/helpers/devices.js +3 -12
  21. package/dist/helpers/devices.queries.d.ts +5 -0
  22. package/dist/helpers/devices.queries.js +10 -0
  23. package/dist/helpers/documents.d.ts +1 -0
  24. package/dist/helpers/documents.js +11 -2
  25. package/dist/helpers/embeddings.d.ts +1 -3
  26. package/dist/helpers/embeddings.internal.d.ts +5 -0
  27. package/dist/helpers/embeddings.internal.js +14 -0
  28. package/dist/helpers/embeddings.js +2 -2
  29. package/dist/helpers/events.d.ts +4 -6
  30. package/dist/helpers/events.internal.d.ts +13 -0
  31. package/dist/helpers/events.internal.js +88 -0
  32. package/dist/helpers/events.js +16 -17
  33. package/dist/helpers/herd_allowed_domains.d.ts +1 -3
  34. package/dist/helpers/herd_allowed_domains.js +2 -2
  35. package/dist/helpers/herd_allowed_domains_internal.d.ts +5 -0
  36. package/dist/helpers/herd_allowed_domains_internal.js +12 -0
  37. package/dist/helpers/herd_modules.queries.d.ts +3 -0
  38. package/dist/helpers/herd_modules.queries.js +106 -0
  39. package/dist/helpers/herd_roles.d.ts +12 -14
  40. package/dist/helpers/herd_roles.js +26 -34
  41. package/dist/helpers/herd_roles_internal.d.ts +18 -0
  42. package/dist/helpers/herd_roles_internal.js +159 -0
  43. package/dist/helpers/herd_scoped.queries.d.ts +7 -0
  44. package/dist/helpers/herd_scoped.queries.js +45 -0
  45. package/dist/helpers/herds.d.ts +2 -4
  46. package/dist/helpers/herds.js +11 -142
  47. package/dist/helpers/herds.queries.d.ts +5 -0
  48. package/dist/helpers/herds.queries.js +12 -0
  49. package/dist/helpers/index.d.ts +1 -0
  50. package/dist/helpers/index.js +1 -0
  51. package/dist/helpers/invitations.d.ts +4 -6
  52. package/dist/helpers/invitations.js +8 -8
  53. package/dist/helpers/invitations_internal.d.ts +10 -0
  54. package/dist/helpers/invitations_internal.js +63 -0
  55. package/dist/helpers/layers.d.ts +1 -3
  56. package/dist/helpers/layers.js +3 -18
  57. package/dist/helpers/layers.queries.d.ts +5 -0
  58. package/dist/helpers/layers.queries.js +20 -0
  59. package/dist/helpers/operating_contexts.d.ts +43 -0
  60. package/dist/helpers/operating_contexts.js +222 -0
  61. package/dist/helpers/plans.d.ts +1 -3
  62. package/dist/helpers/plans.js +3 -18
  63. package/dist/helpers/plans.queries.d.ts +5 -0
  64. package/dist/helpers/plans.queries.js +20 -0
  65. package/dist/helpers/providers.d.ts +1 -3
  66. package/dist/helpers/providers.js +3 -18
  67. package/dist/helpers/providers.queries.d.ts +5 -0
  68. package/dist/helpers/providers.queries.js +20 -0
  69. package/dist/helpers/pubsub_token_server.d.ts +1 -5
  70. package/dist/helpers/pubsub_token_server.js +2 -2
  71. package/dist/helpers/realtime_topic_access.d.ts +5 -0
  72. package/dist/helpers/realtime_topic_access.js +55 -0
  73. package/dist/helpers/session_summaries.d.ts +3 -4
  74. package/dist/helpers/session_summaries.js +13 -43
  75. package/dist/helpers/session_summaries.queries.d.ts +14 -0
  76. package/dist/helpers/session_summaries.queries.js +19 -0
  77. package/dist/helpers/sessions.d.ts +7 -8
  78. package/dist/helpers/sessions.js +23 -58
  79. package/dist/helpers/sessions.queries.d.ts +4 -0
  80. package/dist/helpers/sessions.queries.js +22 -0
  81. package/dist/helpers/storage.d.ts +2 -4
  82. package/dist/helpers/storage.js +7 -54
  83. package/dist/helpers/storage_internal.d.ts +4 -0
  84. package/dist/helpers/storage_internal.js +29 -0
  85. package/dist/helpers/tags.js +5 -5
  86. package/dist/helpers/users.d.ts +7 -8
  87. package/dist/helpers/users.js +13 -41
  88. package/dist/helpers/users.queries.d.ts +5 -0
  89. package/dist/helpers/users.queries.js +30 -0
  90. package/dist/helpers/versions_software_internal.d.ts +6 -0
  91. package/dist/helpers/versions_software_internal.js +53 -0
  92. package/dist/helpers/versions_software_server.d.ts +2 -3
  93. package/dist/helpers/versions_software_server.js +20 -18
  94. package/dist/hooks/index.d.ts +2 -1
  95. package/dist/hooks/index.js +2 -1
  96. package/dist/hooks/useAuthorizedRealtimeTopics.d.ts +1 -0
  97. package/dist/hooks/useAuthorizedRealtimeTopics.js +14 -0
  98. package/dist/hooks/useScoutRealtimeAnalysisJobs.d.ts +2 -1
  99. package/dist/hooks/useScoutRealtimeAnalysisJobs.js +3 -5
  100. package/dist/hooks/useScoutRealtimeAnalysisTasks.d.ts +2 -1
  101. package/dist/hooks/useScoutRealtimeAnalysisTasks.js +3 -5
  102. package/dist/hooks/useScoutRealtimeBroadcast.d.ts +9 -5
  103. package/dist/hooks/useScoutRealtimeBroadcast.js +118 -25
  104. package/dist/hooks/useScoutRealtimeConnectivity.d.ts +2 -1
  105. package/dist/hooks/useScoutRealtimeConnectivity.js +18 -76
  106. package/dist/hooks/useScoutRealtimeContacts.d.ts +2 -1
  107. package/dist/hooks/useScoutRealtimeContacts.js +3 -3
  108. package/dist/hooks/useScoutRealtimeDevices.d.ts +2 -1
  109. package/dist/hooks/useScoutRealtimeDevices.js +3 -64
  110. package/dist/hooks/useScoutRealtimeDocuments.d.ts +3 -3
  111. package/dist/hooks/useScoutRealtimeDocuments.js +7 -5
  112. package/dist/hooks/useScoutRealtimeEvents.d.ts +2 -1
  113. package/dist/hooks/useScoutRealtimeEvents.js +3 -69
  114. package/dist/hooks/useScoutRealtimeMaintenanceRequests.d.ts +2 -1
  115. package/dist/hooks/useScoutRealtimeMaintenanceRequests.js +3 -3
  116. package/dist/hooks/useScoutRealtimeOperatingContexts.d.ts +12 -0
  117. package/dist/hooks/useScoutRealtimeOperatingContexts.js +26 -0
  118. package/dist/hooks/useScoutRealtimeParts.d.ts +2 -1
  119. package/dist/hooks/useScoutRealtimeParts.js +3 -3
  120. package/dist/hooks/useScoutRealtimePins.d.ts +2 -1
  121. package/dist/hooks/useScoutRealtimePins.js +3 -69
  122. package/dist/hooks/useScoutRealtimePlans.d.ts +2 -1
  123. package/dist/hooks/useScoutRealtimePlans.js +3 -3
  124. package/dist/hooks/useScoutRealtimeSessionIncidents.d.ts +2 -1
  125. package/dist/hooks/useScoutRealtimeSessionIncidents.js +3 -3
  126. package/dist/hooks/useScoutRealtimeSessions.d.ts +2 -1
  127. package/dist/hooks/useScoutRealtimeSessions.js +3 -69
  128. package/dist/hooks/useScoutRealtimeTags.d.ts +2 -1
  129. package/dist/hooks/useScoutRealtimeTags.js +3 -69
  130. package/dist/hooks/useScoutRealtimeVersionsSoftware.d.ts +2 -1
  131. package/dist/hooks/useScoutRealtimeVersionsSoftware.js +3 -5
  132. package/dist/index.d.ts +2 -0
  133. package/dist/index.js +2 -0
  134. package/dist/providers/ScoutRefreshProvider.d.ts +1 -0
  135. package/dist/providers/ScoutRefreshProvider.js +3 -0
  136. package/dist/supabase/server.d.ts +4 -1
  137. package/dist/supabase/server.js +6 -5
  138. package/dist/types/db.d.ts +82 -0
  139. package/dist/types/realtime.d.ts +1 -0
  140. package/dist/types/supabase.d.ts +952 -100
  141. package/dist/types/supabase.js +26 -1
  142. package/package.json +1 -1
@@ -720,6 +720,57 @@ export type Database = {
720
720
  }
721
721
  ];
722
722
  };
723
+ document_conditions: {
724
+ Row: {
725
+ condition_text: string;
726
+ id: number;
727
+ inserted_at: string;
728
+ lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
729
+ lifecycle_changed_at: string;
730
+ lifecycle_changed_by: string | null;
731
+ lifecycle_reason: string | null;
732
+ localization_id: number;
733
+ requirement_text: string;
734
+ };
735
+ Insert: {
736
+ condition_text: string;
737
+ id?: number;
738
+ inserted_at?: string;
739
+ lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
740
+ lifecycle_changed_at?: string;
741
+ lifecycle_changed_by?: string | null;
742
+ lifecycle_reason?: string | null;
743
+ localization_id: number;
744
+ requirement_text: string;
745
+ };
746
+ Update: {
747
+ condition_text?: string;
748
+ id?: number;
749
+ inserted_at?: string;
750
+ lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
751
+ lifecycle_changed_at?: string;
752
+ lifecycle_changed_by?: string | null;
753
+ lifecycle_reason?: string | null;
754
+ localization_id?: number;
755
+ requirement_text?: string;
756
+ };
757
+ Relationships: [
758
+ {
759
+ foreignKeyName: "document_conditions_lifecycle_changed_by_fkey";
760
+ columns: ["lifecycle_changed_by"];
761
+ isOneToOne: false;
762
+ referencedRelation: "users";
763
+ referencedColumns: ["id"];
764
+ },
765
+ {
766
+ foreignKeyName: "document_conditions_localization_id_fkey";
767
+ columns: ["localization_id"];
768
+ isOneToOne: false;
769
+ referencedRelation: "localizations";
770
+ referencedColumns: ["id"];
771
+ }
772
+ ];
773
+ };
723
774
  document_template_abilities: {
724
775
  Row: {
725
776
  ability_id: number;
@@ -760,6 +811,7 @@ export type Database = {
760
811
  Row: {
761
812
  categories: string[];
762
813
  description: string | null;
814
+ document_condition_id: number | null;
763
815
  entity_for: Database["public"]["Enums"]["document_entity"] | null;
764
816
  id: number;
765
817
  inserted_at: string;
@@ -772,6 +824,7 @@ export type Database = {
772
824
  Insert: {
773
825
  categories?: string[];
774
826
  description?: string | null;
827
+ document_condition_id?: number | null;
775
828
  entity_for?: Database["public"]["Enums"]["document_entity"] | null;
776
829
  id?: number;
777
830
  inserted_at?: string;
@@ -784,6 +837,7 @@ export type Database = {
784
837
  Update: {
785
838
  categories?: string[];
786
839
  description?: string | null;
840
+ document_condition_id?: number | null;
787
841
  entity_for?: Database["public"]["Enums"]["document_entity"] | null;
788
842
  id?: number;
789
843
  inserted_at?: string;
@@ -794,6 +848,13 @@ export type Database = {
794
848
  uses_expiry?: boolean;
795
849
  };
796
850
  Relationships: [
851
+ {
852
+ foreignKeyName: "document_templates_document_condition_id_fkey";
853
+ columns: ["document_condition_id"];
854
+ isOneToOne: false;
855
+ referencedRelation: "document_conditions";
856
+ referencedColumns: ["id"];
857
+ },
797
858
  {
798
859
  foreignKeyName: "document_templates_issuer_id_fkey";
799
860
  columns: ["issuer_id"];
@@ -824,6 +885,7 @@ export type Database = {
824
885
  lifecycle_changed_at: string;
825
886
  lifecycle_changed_by: string | null;
826
887
  lifecycle_reason: string | null;
888
+ operating_context_id: number | null;
827
889
  product_id: number | null;
828
890
  related_herd_id: number | null;
829
891
  size_bytes: number | null;
@@ -848,6 +910,7 @@ export type Database = {
848
910
  lifecycle_changed_at?: string;
849
911
  lifecycle_changed_by?: string | null;
850
912
  lifecycle_reason?: string | null;
913
+ operating_context_id?: number | null;
851
914
  product_id?: number | null;
852
915
  related_herd_id?: number | null;
853
916
  size_bytes?: number | null;
@@ -872,6 +935,7 @@ export type Database = {
872
935
  lifecycle_changed_at?: string;
873
936
  lifecycle_changed_by?: string | null;
874
937
  lifecycle_reason?: string | null;
938
+ operating_context_id?: number | null;
875
939
  product_id?: number | null;
876
940
  related_herd_id?: number | null;
877
941
  size_bytes?: number | null;
@@ -919,6 +983,13 @@ export type Database = {
919
983
  referencedRelation: "users";
920
984
  referencedColumns: ["id"];
921
985
  },
986
+ {
987
+ foreignKeyName: "documents_operating_context_id_fkey";
988
+ columns: ["operating_context_id"];
989
+ isOneToOne: false;
990
+ referencedRelation: "operating_contexts";
991
+ referencedColumns: ["id"];
992
+ },
922
993
  {
923
994
  foreignKeyName: "documents_product_id_fkey";
924
995
  columns: ["product_id"];
@@ -1058,7 +1129,15 @@ export type Database = {
1058
1129
  media_type: Database["public"]["Enums"]["media_type"];
1059
1130
  media_url: string | null;
1060
1131
  message: string | null;
1132
+ origin_heading: number | null;
1133
+ origin_height: number | null;
1134
+ origin_location: unknown;
1135
+ origin_pitch: number | null;
1136
+ origin_roll: number | null;
1061
1137
  segmented_at: string | null;
1138
+ sensor_pitch: number | null;
1139
+ sensor_roll: number | null;
1140
+ sensor_yaw: number | null;
1062
1141
  session_id: number | null;
1063
1142
  tagged_at: string | null;
1064
1143
  timestamp_observation: string;
@@ -1082,7 +1161,15 @@ export type Database = {
1082
1161
  media_type?: Database["public"]["Enums"]["media_type"];
1083
1162
  media_url?: string | null;
1084
1163
  message?: string | null;
1164
+ origin_heading?: number | null;
1165
+ origin_height?: number | null;
1166
+ origin_location?: unknown;
1167
+ origin_pitch?: number | null;
1168
+ origin_roll?: number | null;
1085
1169
  segmented_at?: string | null;
1170
+ sensor_pitch?: number | null;
1171
+ sensor_roll?: number | null;
1172
+ sensor_yaw?: number | null;
1086
1173
  session_id?: number | null;
1087
1174
  tagged_at?: string | null;
1088
1175
  timestamp_observation?: string;
@@ -1106,7 +1193,15 @@ export type Database = {
1106
1193
  media_type?: Database["public"]["Enums"]["media_type"];
1107
1194
  media_url?: string | null;
1108
1195
  message?: string | null;
1196
+ origin_heading?: number | null;
1197
+ origin_height?: number | null;
1198
+ origin_location?: unknown;
1199
+ origin_pitch?: number | null;
1200
+ origin_roll?: number | null;
1109
1201
  segmented_at?: string | null;
1202
+ sensor_pitch?: number | null;
1203
+ sensor_roll?: number | null;
1204
+ sensor_yaw?: number | null;
1110
1205
  session_id?: number | null;
1111
1206
  tagged_at?: string | null;
1112
1207
  timestamp_observation?: string;
@@ -1661,214 +1756,927 @@ export type Database = {
1661
1756
  };
1662
1757
  Relationships: [
1663
1758
  {
1664
- foreignKeyName: "maintenance_requests_creator_user_id_fkey";
1665
- columns: ["creator_user_id"];
1759
+ foreignKeyName: "maintenance_requests_creator_user_id_fkey";
1760
+ columns: ["creator_user_id"];
1761
+ isOneToOne: false;
1762
+ referencedRelation: "users";
1763
+ referencedColumns: ["id"];
1764
+ },
1765
+ {
1766
+ foreignKeyName: "maintenance_requests_device_id_fkey";
1767
+ columns: ["device_id"];
1768
+ isOneToOne: false;
1769
+ referencedRelation: "devices";
1770
+ referencedColumns: ["id"];
1771
+ },
1772
+ {
1773
+ foreignKeyName: "maintenance_requests_part_id_fkey";
1774
+ columns: ["part_id"];
1775
+ isOneToOne: false;
1776
+ referencedRelation: "parts";
1777
+ referencedColumns: ["id"];
1778
+ },
1779
+ {
1780
+ foreignKeyName: "maintenance_requests_remediation_completed_user_id_fkey";
1781
+ columns: ["remediation_completed_user_id"];
1782
+ isOneToOne: false;
1783
+ referencedRelation: "users";
1784
+ referencedColumns: ["id"];
1785
+ },
1786
+ {
1787
+ foreignKeyName: "maintenance_requests_session_incident_id_fkey";
1788
+ columns: ["session_incident_id"];
1789
+ isOneToOne: false;
1790
+ referencedRelation: "session_incidents";
1791
+ referencedColumns: ["id"];
1792
+ },
1793
+ {
1794
+ foreignKeyName: "maintenance_requests_updated_by_user_id_fkey";
1795
+ columns: ["updated_by_user_id"];
1796
+ isOneToOne: false;
1797
+ referencedRelation: "users";
1798
+ referencedColumns: ["id"];
1799
+ }
1800
+ ];
1801
+ };
1802
+ manufacturers: {
1803
+ Row: {
1804
+ country: string | null;
1805
+ gln: string | null;
1806
+ id: number;
1807
+ inserted_at: string;
1808
+ lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
1809
+ lifecycle_changed_at: string;
1810
+ lifecycle_changed_by: string | null;
1811
+ lifecycle_reason: string | null;
1812
+ name: string;
1813
+ website: string | null;
1814
+ };
1815
+ Insert: {
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
+ Update: {
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
+ Relationships: [
1840
+ {
1841
+ foreignKeyName: "manufacturers_lifecycle_changed_by_fkey";
1842
+ columns: ["lifecycle_changed_by"];
1843
+ isOneToOne: false;
1844
+ referencedRelation: "users";
1845
+ referencedColumns: ["id"];
1846
+ }
1847
+ ];
1848
+ };
1849
+ models: {
1850
+ Row: {
1851
+ capabilities: string[];
1852
+ id: number;
1853
+ inserted_at: string;
1854
+ is_active: boolean;
1855
+ metadata: Json;
1856
+ name: string;
1857
+ version: string;
1858
+ weights_sha256: string | null;
1859
+ weights_uri: string | null;
1860
+ };
1861
+ Insert: {
1862
+ capabilities?: string[];
1863
+ id?: number;
1864
+ inserted_at?: string;
1865
+ is_active?: boolean;
1866
+ metadata?: Json;
1867
+ name: string;
1868
+ version?: string;
1869
+ weights_sha256?: string | null;
1870
+ weights_uri?: string | null;
1871
+ };
1872
+ Update: {
1873
+ capabilities?: string[];
1874
+ id?: number;
1875
+ inserted_at?: string;
1876
+ is_active?: boolean;
1877
+ metadata?: Json;
1878
+ name?: string;
1879
+ version?: string;
1880
+ weights_sha256?: string | null;
1881
+ weights_uri?: string | null;
1882
+ };
1883
+ Relationships: [];
1884
+ };
1885
+ models_per_jobs_per_herd: {
1886
+ Row: {
1887
+ enabled: boolean;
1888
+ herd_id: number;
1889
+ id: number;
1890
+ inserted_at: string;
1891
+ job_type: string;
1892
+ model_id: number;
1893
+ priority: number;
1894
+ };
1895
+ Insert: {
1896
+ enabled?: boolean;
1897
+ herd_id: number;
1898
+ id?: number;
1899
+ inserted_at?: string;
1900
+ job_type: string;
1901
+ model_id: number;
1902
+ priority?: number;
1903
+ };
1904
+ Update: {
1905
+ enabled?: boolean;
1906
+ herd_id?: number;
1907
+ id?: number;
1908
+ inserted_at?: string;
1909
+ job_type?: string;
1910
+ model_id?: number;
1911
+ priority?: number;
1912
+ };
1913
+ Relationships: [
1914
+ {
1915
+ foreignKeyName: "models_per_jobs_per_herd_herd_id_fkey";
1916
+ columns: ["herd_id"];
1917
+ isOneToOne: false;
1918
+ referencedRelation: "herds";
1919
+ referencedColumns: ["id"];
1920
+ },
1921
+ {
1922
+ foreignKeyName: "models_per_jobs_per_herd_model_id_fkey";
1923
+ columns: ["model_id"];
1924
+ isOneToOne: false;
1925
+ referencedRelation: "models";
1926
+ referencedColumns: ["id"];
1927
+ }
1928
+ ];
1929
+ };
1930
+ observations: {
1931
+ Row: {
1932
+ action_complete: boolean;
1933
+ action_required: string | null;
1934
+ description: string;
1935
+ id: number;
1936
+ inserted_at: string;
1937
+ session_id: number;
1938
+ timestamp: string | null;
1939
+ updated_at: string | null;
1940
+ };
1941
+ Insert: {
1942
+ action_complete?: boolean;
1943
+ action_required?: string | null;
1944
+ description: string;
1945
+ id?: number;
1946
+ inserted_at?: string;
1947
+ session_id: number;
1948
+ timestamp?: string | null;
1949
+ updated_at?: string | null;
1950
+ };
1951
+ Update: {
1952
+ action_complete?: boolean;
1953
+ action_required?: string | null;
1954
+ description?: string;
1955
+ id?: number;
1956
+ inserted_at?: string;
1957
+ session_id?: number;
1958
+ timestamp?: string | null;
1959
+ updated_at?: string | null;
1960
+ };
1961
+ Relationships: [
1962
+ {
1963
+ foreignKeyName: "observations_session_id_fkey";
1964
+ columns: ["session_id"];
1965
+ isOneToOne: false;
1966
+ referencedRelation: "sessions";
1967
+ referencedColumns: ["id"];
1968
+ }
1969
+ ];
1970
+ };
1971
+ operating_context_equipment_categories: {
1972
+ Row: {
1973
+ id: number;
1974
+ inserted_at: string;
1975
+ lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
1976
+ lifecycle_changed_at: string;
1977
+ lifecycle_changed_by: string | null;
1978
+ lifecycle_reason: string | null;
1979
+ localization_id: number;
1980
+ name: string;
1981
+ };
1982
+ Insert: {
1983
+ id?: number;
1984
+ inserted_at?: string;
1985
+ lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
1986
+ lifecycle_changed_at?: string;
1987
+ lifecycle_changed_by?: string | null;
1988
+ lifecycle_reason?: string | null;
1989
+ localization_id: number;
1990
+ name: string;
1991
+ };
1992
+ Update: {
1993
+ id?: number;
1994
+ inserted_at?: string;
1995
+ lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
1996
+ lifecycle_changed_at?: string;
1997
+ lifecycle_changed_by?: string | null;
1998
+ lifecycle_reason?: string | null;
1999
+ localization_id?: number;
2000
+ name?: string;
2001
+ };
2002
+ Relationships: [
2003
+ {
2004
+ foreignKeyName: "operating_context_equipment_categorie_lifecycle_changed_by_fkey";
2005
+ columns: ["lifecycle_changed_by"];
2006
+ isOneToOne: false;
2007
+ referencedRelation: "users";
2008
+ referencedColumns: ["id"];
2009
+ },
2010
+ {
2011
+ foreignKeyName: "operating_context_equipment_categories_localization_id_fkey";
2012
+ columns: ["localization_id"];
2013
+ isOneToOne: false;
2014
+ referencedRelation: "localizations";
2015
+ referencedColumns: ["id"];
2016
+ }
2017
+ ];
2018
+ };
2019
+ operating_context_equipment_items: {
2020
+ Row: {
2021
+ equipment_category_id: number;
2022
+ id: number;
2023
+ inserted_at: string;
2024
+ lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
2025
+ lifecycle_changed_at: string;
2026
+ lifecycle_changed_by: string | null;
2027
+ lifecycle_reason: string | null;
2028
+ name: string;
2029
+ };
2030
+ Insert: {
2031
+ equipment_category_id: number;
2032
+ id?: number;
2033
+ inserted_at?: string;
2034
+ lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
2035
+ lifecycle_changed_at?: string;
2036
+ lifecycle_changed_by?: string | null;
2037
+ lifecycle_reason?: string | null;
2038
+ name: string;
2039
+ };
2040
+ Update: {
2041
+ equipment_category_id?: number;
2042
+ id?: number;
2043
+ inserted_at?: string;
2044
+ lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
2045
+ lifecycle_changed_at?: string;
2046
+ lifecycle_changed_by?: string | null;
2047
+ lifecycle_reason?: string | null;
2048
+ name?: string;
2049
+ };
2050
+ Relationships: [
2051
+ {
2052
+ foreignKeyName: "operating_context_equipment_items_equipment_category_id_fkey";
2053
+ columns: ["equipment_category_id"];
2054
+ isOneToOne: false;
2055
+ referencedRelation: "operating_context_equipment_categories";
2056
+ referencedColumns: ["id"];
2057
+ },
2058
+ {
2059
+ foreignKeyName: "operating_context_equipment_items_lifecycle_changed_by_fkey";
2060
+ columns: ["lifecycle_changed_by"];
2061
+ isOneToOne: false;
2062
+ referencedRelation: "users";
2063
+ referencedColumns: ["id"];
2064
+ }
2065
+ ];
2066
+ };
2067
+ operating_context_equipment_requirements: {
2068
+ Row: {
2069
+ equipment_item_id: number;
2070
+ id: number;
2071
+ inserted_at: string;
2072
+ lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
2073
+ lifecycle_changed_at: string;
2074
+ lifecycle_changed_by: string | null;
2075
+ lifecycle_reason: string | null;
2076
+ operating_context_id: number;
2077
+ };
2078
+ Insert: {
2079
+ equipment_item_id: number;
2080
+ id?: number;
2081
+ inserted_at?: string;
2082
+ lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
2083
+ lifecycle_changed_at?: string;
2084
+ lifecycle_changed_by?: string | null;
2085
+ lifecycle_reason?: string | null;
2086
+ operating_context_id: number;
2087
+ };
2088
+ Update: {
2089
+ equipment_item_id?: number;
2090
+ id?: number;
2091
+ inserted_at?: string;
2092
+ lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
2093
+ lifecycle_changed_at?: string;
2094
+ lifecycle_changed_by?: string | null;
2095
+ lifecycle_reason?: string | null;
2096
+ operating_context_id?: number;
2097
+ };
2098
+ Relationships: [
2099
+ {
2100
+ foreignKeyName: "operating_context_equipment_requireme_lifecycle_changed_by_fkey";
2101
+ columns: ["lifecycle_changed_by"];
2102
+ isOneToOne: false;
2103
+ referencedRelation: "users";
2104
+ referencedColumns: ["id"];
2105
+ },
2106
+ {
2107
+ foreignKeyName: "operating_context_equipment_requireme_operating_context_id_fkey";
2108
+ columns: ["operating_context_id"];
2109
+ isOneToOne: false;
2110
+ referencedRelation: "operating_contexts";
2111
+ referencedColumns: ["id"];
2112
+ },
2113
+ {
2114
+ foreignKeyName: "operating_context_equipment_requirements_equipment_item_id_fkey";
2115
+ columns: ["equipment_item_id"];
2116
+ isOneToOne: false;
2117
+ referencedRelation: "operating_context_equipment_items";
2118
+ referencedColumns: ["id"];
2119
+ }
2120
+ ];
2121
+ };
2122
+ operating_context_payloads: {
2123
+ Row: {
2124
+ created_at: string;
2125
+ created_by: string;
2126
+ description: string | null;
2127
+ id: number;
2128
+ lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
2129
+ lifecycle_changed_at: string;
2130
+ lifecycle_changed_by: string | null;
2131
+ lifecycle_reason: string | null;
2132
+ operating_context_id: number;
2133
+ payload_type: Database["public"]["Enums"]["operating_context_payload_type"];
2134
+ updated_at: string;
2135
+ updated_by: string | null;
2136
+ weight_kg: number;
2137
+ };
2138
+ Insert: {
2139
+ created_at?: string;
2140
+ created_by: string;
2141
+ description?: string | null;
2142
+ id?: number;
2143
+ lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
2144
+ lifecycle_changed_at?: string;
2145
+ lifecycle_changed_by?: string | null;
2146
+ lifecycle_reason?: string | null;
2147
+ operating_context_id: number;
2148
+ payload_type: Database["public"]["Enums"]["operating_context_payload_type"];
2149
+ updated_at?: string;
2150
+ updated_by?: string | null;
2151
+ weight_kg: number;
2152
+ };
2153
+ Update: {
2154
+ created_at?: string;
2155
+ created_by?: string;
2156
+ description?: string | null;
2157
+ id?: number;
2158
+ lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
2159
+ lifecycle_changed_at?: string;
2160
+ lifecycle_changed_by?: string | null;
2161
+ lifecycle_reason?: string | null;
2162
+ operating_context_id?: number;
2163
+ payload_type?: Database["public"]["Enums"]["operating_context_payload_type"];
2164
+ updated_at?: string;
2165
+ updated_by?: string | null;
2166
+ weight_kg?: number;
2167
+ };
2168
+ Relationships: [
2169
+ {
2170
+ foreignKeyName: "operating_context_payloads_created_by_fkey";
2171
+ columns: ["created_by"];
2172
+ isOneToOne: false;
2173
+ referencedRelation: "users";
2174
+ referencedColumns: ["id"];
2175
+ },
2176
+ {
2177
+ foreignKeyName: "operating_context_payloads_lifecycle_changed_by_fkey";
2178
+ columns: ["lifecycle_changed_by"];
2179
+ isOneToOne: false;
2180
+ referencedRelation: "users";
2181
+ referencedColumns: ["id"];
2182
+ },
2183
+ {
2184
+ foreignKeyName: "operating_context_payloads_operating_context_id_fkey";
2185
+ columns: ["operating_context_id"];
2186
+ isOneToOne: false;
2187
+ referencedRelation: "operating_contexts";
2188
+ referencedColumns: ["id"];
2189
+ },
2190
+ {
2191
+ foreignKeyName: "operating_context_payloads_updated_by_fkey";
2192
+ columns: ["updated_by"];
2193
+ isOneToOne: false;
2194
+ referencedRelation: "users";
2195
+ referencedColumns: ["id"];
2196
+ }
2197
+ ];
2198
+ };
2199
+ operating_context_regions: {
2200
+ Row: {
2201
+ created_at: string;
2202
+ created_by: string;
2203
+ id: number;
2204
+ is_exclusion: boolean;
2205
+ lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
2206
+ lifecycle_changed_at: string;
2207
+ lifecycle_changed_by: string | null;
2208
+ lifecycle_reason: string | null;
2209
+ name: string | null;
2210
+ operating_context_id: number;
2211
+ region: unknown;
2212
+ updated_at: string;
2213
+ updated_by: string | null;
2214
+ weather_origin: unknown;
2215
+ };
2216
+ Insert: {
2217
+ created_at?: string;
2218
+ created_by: string;
2219
+ id?: number;
2220
+ is_exclusion: boolean;
2221
+ lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
2222
+ lifecycle_changed_at?: string;
2223
+ lifecycle_changed_by?: string | null;
2224
+ lifecycle_reason?: string | null;
2225
+ name?: string | null;
2226
+ operating_context_id: number;
2227
+ region: unknown;
2228
+ updated_at?: string;
2229
+ updated_by?: string | null;
2230
+ weather_origin?: unknown;
2231
+ };
2232
+ Update: {
2233
+ created_at?: string;
2234
+ created_by?: string;
2235
+ id?: number;
2236
+ is_exclusion?: boolean;
2237
+ lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
2238
+ lifecycle_changed_at?: string;
2239
+ lifecycle_changed_by?: string | null;
2240
+ lifecycle_reason?: string | null;
2241
+ name?: string | null;
2242
+ operating_context_id?: number;
2243
+ region?: unknown;
2244
+ updated_at?: string;
2245
+ updated_by?: string | null;
2246
+ weather_origin?: unknown;
2247
+ };
2248
+ Relationships: [
2249
+ {
2250
+ foreignKeyName: "operating_context_regions_created_by_fkey";
2251
+ columns: ["created_by"];
2252
+ isOneToOne: false;
2253
+ referencedRelation: "users";
2254
+ referencedColumns: ["id"];
2255
+ },
2256
+ {
2257
+ foreignKeyName: "operating_context_regions_lifecycle_changed_by_fkey";
2258
+ columns: ["lifecycle_changed_by"];
2259
+ isOneToOne: false;
2260
+ referencedRelation: "users";
2261
+ referencedColumns: ["id"];
2262
+ },
2263
+ {
2264
+ foreignKeyName: "operating_context_regions_operating_context_id_fkey";
2265
+ columns: ["operating_context_id"];
2266
+ isOneToOne: false;
2267
+ referencedRelation: "operating_contexts";
2268
+ referencedColumns: ["id"];
2269
+ },
2270
+ {
2271
+ foreignKeyName: "operating_context_regions_updated_by_fkey";
2272
+ columns: ["updated_by"];
2273
+ isOneToOne: false;
2274
+ referencedRelation: "users";
2275
+ referencedColumns: ["id"];
2276
+ }
2277
+ ];
2278
+ };
2279
+ operating_context_risks: {
2280
+ Row: {
2281
+ created_at: string;
2282
+ created_by: string;
2283
+ hazard: string;
2284
+ id: number;
2285
+ lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
2286
+ lifecycle_changed_at: string;
2287
+ lifecycle_changed_by: string | null;
2288
+ lifecycle_reason: string | null;
2289
+ mitigation: string;
2290
+ operating_context_id: number;
2291
+ probability_after: Database["public"]["Enums"]["operating_context_risk_probability"];
2292
+ probability_before: Database["public"]["Enums"]["operating_context_risk_probability"];
2293
+ severity_after: Database["public"]["Enums"]["operating_context_risk_severity"];
2294
+ severity_before: Database["public"]["Enums"]["operating_context_risk_severity"];
2295
+ updated_at: string;
2296
+ updated_by: string | null;
2297
+ };
2298
+ Insert: {
2299
+ created_at?: string;
2300
+ created_by: string;
2301
+ hazard: string;
2302
+ id?: number;
2303
+ lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
2304
+ lifecycle_changed_at?: string;
2305
+ lifecycle_changed_by?: string | null;
2306
+ lifecycle_reason?: string | null;
2307
+ mitigation: string;
2308
+ operating_context_id: number;
2309
+ probability_after: Database["public"]["Enums"]["operating_context_risk_probability"];
2310
+ probability_before: Database["public"]["Enums"]["operating_context_risk_probability"];
2311
+ severity_after: Database["public"]["Enums"]["operating_context_risk_severity"];
2312
+ severity_before: Database["public"]["Enums"]["operating_context_risk_severity"];
2313
+ updated_at?: string;
2314
+ updated_by?: string | null;
2315
+ };
2316
+ Update: {
2317
+ created_at?: string;
2318
+ created_by?: string;
2319
+ hazard?: string;
2320
+ id?: number;
2321
+ lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
2322
+ lifecycle_changed_at?: string;
2323
+ lifecycle_changed_by?: string | null;
2324
+ lifecycle_reason?: string | null;
2325
+ mitigation?: string;
2326
+ operating_context_id?: number;
2327
+ probability_after?: Database["public"]["Enums"]["operating_context_risk_probability"];
2328
+ probability_before?: Database["public"]["Enums"]["operating_context_risk_probability"];
2329
+ severity_after?: Database["public"]["Enums"]["operating_context_risk_severity"];
2330
+ severity_before?: Database["public"]["Enums"]["operating_context_risk_severity"];
2331
+ updated_at?: string;
2332
+ updated_by?: string | null;
2333
+ };
2334
+ Relationships: [
2335
+ {
2336
+ foreignKeyName: "operating_context_risks_created_by_fkey";
2337
+ columns: ["created_by"];
1666
2338
  isOneToOne: false;
1667
2339
  referencedRelation: "users";
1668
2340
  referencedColumns: ["id"];
1669
2341
  },
1670
2342
  {
1671
- foreignKeyName: "maintenance_requests_device_id_fkey";
1672
- columns: ["device_id"];
2343
+ foreignKeyName: "operating_context_risks_lifecycle_changed_by_fkey";
2344
+ columns: ["lifecycle_changed_by"];
1673
2345
  isOneToOne: false;
1674
- referencedRelation: "devices";
2346
+ referencedRelation: "users";
1675
2347
  referencedColumns: ["id"];
1676
2348
  },
1677
2349
  {
1678
- foreignKeyName: "maintenance_requests_part_id_fkey";
1679
- columns: ["part_id"];
2350
+ foreignKeyName: "operating_context_risks_operating_context_id_fkey";
2351
+ columns: ["operating_context_id"];
1680
2352
  isOneToOne: false;
1681
- referencedRelation: "parts";
2353
+ referencedRelation: "operating_contexts";
1682
2354
  referencedColumns: ["id"];
1683
2355
  },
1684
2356
  {
1685
- foreignKeyName: "maintenance_requests_remediation_completed_user_id_fkey";
1686
- columns: ["remediation_completed_user_id"];
2357
+ foreignKeyName: "operating_context_risks_updated_by_fkey";
2358
+ columns: ["updated_by"];
1687
2359
  isOneToOne: false;
1688
2360
  referencedRelation: "users";
1689
2361
  referencedColumns: ["id"];
2362
+ }
2363
+ ];
2364
+ };
2365
+ operating_context_role_assignments: {
2366
+ Row: {
2367
+ herd_id: number;
2368
+ id: number;
2369
+ inserted_at: string;
2370
+ lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
2371
+ lifecycle_changed_at: string;
2372
+ lifecycle_changed_by: string | null;
2373
+ lifecycle_reason: string | null;
2374
+ membership_id: number;
2375
+ operating_context_id: number;
2376
+ role_id: number;
2377
+ };
2378
+ Insert: {
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
+ Update: {
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
+ Relationships: [
2403
+ {
2404
+ foreignKeyName: "operating_context_role_assignment_context_fkey";
2405
+ columns: ["operating_context_id", "herd_id"];
2406
+ isOneToOne: false;
2407
+ referencedRelation: "operating_contexts";
2408
+ referencedColumns: ["id", "herd_id"];
1690
2409
  },
1691
2410
  {
1692
- foreignKeyName: "maintenance_requests_session_incident_id_fkey";
1693
- columns: ["session_incident_id"];
2411
+ foreignKeyName: "operating_context_role_assignment_membership_fkey";
2412
+ columns: ["membership_id", "herd_id"];
1694
2413
  isOneToOne: false;
1695
- referencedRelation: "session_incidents";
1696
- referencedColumns: ["id"];
2414
+ referencedRelation: "users_roles_per_herd";
2415
+ referencedColumns: ["id", "herd_id"];
1697
2416
  },
1698
2417
  {
1699
- foreignKeyName: "maintenance_requests_updated_by_user_id_fkey";
1700
- columns: ["updated_by_user_id"];
2418
+ foreignKeyName: "operating_context_role_assignments_lifecycle_changed_by_fkey";
2419
+ columns: ["lifecycle_changed_by"];
1701
2420
  isOneToOne: false;
1702
2421
  referencedRelation: "users";
1703
2422
  referencedColumns: ["id"];
2423
+ },
2424
+ {
2425
+ foreignKeyName: "operating_context_role_assignments_role_id_fkey";
2426
+ columns: ["role_id"];
2427
+ isOneToOne: false;
2428
+ referencedRelation: "operating_context_roles";
2429
+ referencedColumns: ["id"];
1704
2430
  }
1705
2431
  ];
1706
2432
  };
1707
- manufacturers: {
2433
+ operating_context_roles: {
1708
2434
  Row: {
1709
- country: string | null;
1710
- gln: string | null;
1711
2435
  id: number;
1712
2436
  inserted_at: string;
1713
2437
  lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
1714
2438
  lifecycle_changed_at: string;
1715
2439
  lifecycle_changed_by: string | null;
1716
2440
  lifecycle_reason: string | null;
2441
+ localization_id: number;
1717
2442
  name: string;
1718
- website: string | null;
1719
2443
  };
1720
2444
  Insert: {
1721
- country?: string | null;
1722
- gln?: string | null;
1723
2445
  id?: number;
1724
2446
  inserted_at?: string;
1725
2447
  lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
1726
2448
  lifecycle_changed_at?: string;
1727
2449
  lifecycle_changed_by?: string | null;
1728
2450
  lifecycle_reason?: string | null;
2451
+ localization_id: number;
1729
2452
  name: string;
1730
- website?: string | null;
1731
2453
  };
1732
2454
  Update: {
1733
- country?: string | null;
1734
- gln?: string | null;
1735
2455
  id?: number;
1736
2456
  inserted_at?: string;
1737
2457
  lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
1738
2458
  lifecycle_changed_at?: string;
1739
2459
  lifecycle_changed_by?: string | null;
1740
2460
  lifecycle_reason?: string | null;
2461
+ localization_id?: number;
1741
2462
  name?: string;
1742
- website?: string | null;
1743
2463
  };
1744
2464
  Relationships: [
1745
2465
  {
1746
- foreignKeyName: "manufacturers_lifecycle_changed_by_fkey";
2466
+ foreignKeyName: "operating_context_roles_lifecycle_changed_by_fkey";
1747
2467
  columns: ["lifecycle_changed_by"];
1748
2468
  isOneToOne: false;
1749
2469
  referencedRelation: "users";
1750
2470
  referencedColumns: ["id"];
2471
+ },
2472
+ {
2473
+ foreignKeyName: "operating_context_roles_localization_id_fkey";
2474
+ columns: ["localization_id"];
2475
+ isOneToOne: false;
2476
+ referencedRelation: "localizations";
2477
+ referencedColumns: ["id"];
1751
2478
  }
1752
2479
  ];
1753
2480
  };
1754
- models: {
2481
+ operating_context_types: {
1755
2482
  Row: {
1756
- capabilities: string[];
1757
2483
  id: number;
1758
2484
  inserted_at: string;
1759
- is_active: boolean;
1760
- metadata: Json;
2485
+ lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
2486
+ lifecycle_changed_at: string;
2487
+ lifecycle_changed_by: string | null;
2488
+ lifecycle_reason: string | null;
2489
+ localization_id: number;
1761
2490
  name: string;
1762
- version: string;
1763
- weights_sha256: string | null;
1764
- weights_uri: string | null;
1765
2491
  };
1766
2492
  Insert: {
1767
- capabilities?: string[];
1768
2493
  id?: number;
1769
2494
  inserted_at?: string;
1770
- is_active?: boolean;
1771
- metadata?: Json;
2495
+ lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
2496
+ lifecycle_changed_at?: string;
2497
+ lifecycle_changed_by?: string | null;
2498
+ lifecycle_reason?: string | null;
2499
+ localization_id: number;
1772
2500
  name: string;
1773
- version?: string;
1774
- weights_sha256?: string | null;
1775
- weights_uri?: string | null;
1776
2501
  };
1777
2502
  Update: {
1778
- capabilities?: string[];
1779
2503
  id?: number;
1780
2504
  inserted_at?: string;
1781
- is_active?: boolean;
1782
- metadata?: Json;
2505
+ lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
2506
+ lifecycle_changed_at?: string;
2507
+ lifecycle_changed_by?: string | null;
2508
+ lifecycle_reason?: string | null;
2509
+ localization_id?: number;
1783
2510
  name?: string;
1784
- version?: string;
1785
- weights_sha256?: string | null;
1786
- weights_uri?: string | null;
1787
2511
  };
1788
- Relationships: [];
2512
+ Relationships: [
2513
+ {
2514
+ foreignKeyName: "operating_context_types_lifecycle_changed_by_fkey";
2515
+ columns: ["lifecycle_changed_by"];
2516
+ isOneToOne: false;
2517
+ referencedRelation: "users";
2518
+ referencedColumns: ["id"];
2519
+ },
2520
+ {
2521
+ foreignKeyName: "operating_context_types_localization_id_fkey";
2522
+ columns: ["localization_id"];
2523
+ isOneToOne: false;
2524
+ referencedRelation: "localizations";
2525
+ referencedColumns: ["id"];
2526
+ }
2527
+ ];
1789
2528
  };
1790
- models_per_jobs_per_herd: {
2529
+ operating_context_weather_snapshots: {
1791
2530
  Row: {
1792
- enabled: boolean;
1793
- herd_id: number;
2531
+ collected_at: string;
2532
+ density_altitude_meters: number | null;
1794
2533
  id: number;
1795
2534
  inserted_at: string;
1796
- job_type: string;
1797
- model_id: number;
1798
- priority: number;
2535
+ kp_index: number | null;
2536
+ operating_context_region_id: number;
2537
+ precipitation_millimeters: number | null;
2538
+ static_buildup_category: string | null;
2539
+ temperature_max_celsius: number | null;
2540
+ temperature_min_celsius: number | null;
2541
+ visibility_meters: number | null;
2542
+ wind_heading_degrees: number | null;
2543
+ wind_speed_meters_per_second: number | null;
1799
2544
  };
1800
2545
  Insert: {
1801
- enabled?: boolean;
1802
- herd_id: number;
2546
+ collected_at: string;
2547
+ density_altitude_meters?: number | null;
1803
2548
  id?: number;
1804
2549
  inserted_at?: string;
1805
- job_type: string;
1806
- model_id: number;
1807
- priority?: number;
2550
+ kp_index?: number | null;
2551
+ operating_context_region_id: number;
2552
+ precipitation_millimeters?: number | null;
2553
+ static_buildup_category?: string | null;
2554
+ temperature_max_celsius?: number | null;
2555
+ temperature_min_celsius?: number | null;
2556
+ visibility_meters?: number | null;
2557
+ wind_heading_degrees?: number | null;
2558
+ wind_speed_meters_per_second?: number | null;
1808
2559
  };
1809
2560
  Update: {
1810
- enabled?: boolean;
1811
- herd_id?: number;
2561
+ collected_at?: string;
2562
+ density_altitude_meters?: number | null;
1812
2563
  id?: number;
1813
2564
  inserted_at?: string;
1814
- job_type?: string;
1815
- model_id?: number;
1816
- priority?: number;
2565
+ kp_index?: number | null;
2566
+ operating_context_region_id?: number;
2567
+ precipitation_millimeters?: number | null;
2568
+ static_buildup_category?: string | null;
2569
+ temperature_max_celsius?: number | null;
2570
+ temperature_min_celsius?: number | null;
2571
+ visibility_meters?: number | null;
2572
+ wind_heading_degrees?: number | null;
2573
+ wind_speed_meters_per_second?: number | null;
1817
2574
  };
1818
2575
  Relationships: [
1819
2576
  {
1820
- foreignKeyName: "models_per_jobs_per_herd_herd_id_fkey";
1821
- columns: ["herd_id"];
1822
- isOneToOne: false;
1823
- referencedRelation: "herds";
1824
- referencedColumns: ["id"];
1825
- },
1826
- {
1827
- foreignKeyName: "models_per_jobs_per_herd_model_id_fkey";
1828
- columns: ["model_id"];
2577
+ foreignKeyName: "operating_context_weather_snap_operating_context_region_id_fkey";
2578
+ columns: ["operating_context_region_id"];
1829
2579
  isOneToOne: false;
1830
- referencedRelation: "models";
2580
+ referencedRelation: "operating_context_regions";
1831
2581
  referencedColumns: ["id"];
1832
2582
  }
1833
2583
  ];
1834
2584
  };
1835
- observations: {
2585
+ operating_contexts: {
1836
2586
  Row: {
1837
- action_complete: boolean;
1838
- action_required: string | null;
1839
- description: string;
2587
+ altitude_agl_max: number;
2588
+ created_at: string;
2589
+ created_by: string;
2590
+ description: string | null;
2591
+ distance_max_from_home: number;
2592
+ herd_id: number;
1840
2593
  id: number;
1841
- inserted_at: string;
1842
- session_id: number;
1843
- timestamp: string | null;
1844
- updated_at: string | null;
2594
+ involves_third_party_land: boolean;
2595
+ lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
2596
+ lifecycle_changed_at: string;
2597
+ lifecycle_changed_by: string | null;
2598
+ lifecycle_reason: string | null;
2599
+ name: string;
2600
+ operating_context_type_id: number;
2601
+ updated_at: string;
2602
+ updated_by: string | null;
2603
+ valid_from: string;
2604
+ valid_to: string;
1845
2605
  };
1846
2606
  Insert: {
1847
- action_complete?: boolean;
1848
- action_required?: string | null;
1849
- description: string;
2607
+ altitude_agl_max: number;
2608
+ created_at?: string;
2609
+ created_by: string;
2610
+ description?: string | null;
2611
+ distance_max_from_home: number;
2612
+ herd_id: number;
1850
2613
  id?: number;
1851
- inserted_at?: string;
1852
- session_id: number;
1853
- timestamp?: string | null;
1854
- updated_at?: string | null;
2614
+ involves_third_party_land: boolean;
2615
+ lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
2616
+ lifecycle_changed_at?: string;
2617
+ lifecycle_changed_by?: string | null;
2618
+ lifecycle_reason?: string | null;
2619
+ name: string;
2620
+ operating_context_type_id: number;
2621
+ updated_at?: string;
2622
+ updated_by?: string | null;
2623
+ valid_from: string;
2624
+ valid_to: string;
1855
2625
  };
1856
2626
  Update: {
1857
- action_complete?: boolean;
1858
- action_required?: string | null;
1859
- description?: string;
2627
+ altitude_agl_max?: number;
2628
+ created_at?: string;
2629
+ created_by?: string;
2630
+ description?: string | null;
2631
+ distance_max_from_home?: number;
2632
+ herd_id?: number;
1860
2633
  id?: number;
1861
- inserted_at?: string;
1862
- session_id?: number;
1863
- timestamp?: string | null;
1864
- updated_at?: string | null;
2634
+ involves_third_party_land?: boolean;
2635
+ lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
2636
+ lifecycle_changed_at?: string;
2637
+ lifecycle_changed_by?: string | null;
2638
+ lifecycle_reason?: string | null;
2639
+ name?: string;
2640
+ operating_context_type_id?: number;
2641
+ updated_at?: string;
2642
+ updated_by?: string | null;
2643
+ valid_from?: string;
2644
+ valid_to?: string;
1865
2645
  };
1866
2646
  Relationships: [
1867
2647
  {
1868
- foreignKeyName: "observations_session_id_fkey";
1869
- columns: ["session_id"];
2648
+ foreignKeyName: "operating_contexts_created_by_fkey";
2649
+ columns: ["created_by"];
1870
2650
  isOneToOne: false;
1871
- referencedRelation: "sessions";
2651
+ referencedRelation: "users";
2652
+ referencedColumns: ["id"];
2653
+ },
2654
+ {
2655
+ foreignKeyName: "operating_contexts_herd_id_fkey";
2656
+ columns: ["herd_id"];
2657
+ isOneToOne: false;
2658
+ referencedRelation: "herds";
2659
+ referencedColumns: ["id"];
2660
+ },
2661
+ {
2662
+ foreignKeyName: "operating_contexts_lifecycle_changed_by_fkey";
2663
+ columns: ["lifecycle_changed_by"];
2664
+ isOneToOne: false;
2665
+ referencedRelation: "users";
2666
+ referencedColumns: ["id"];
2667
+ },
2668
+ {
2669
+ foreignKeyName: "operating_contexts_operating_context_type_id_fkey";
2670
+ columns: ["operating_context_type_id"];
2671
+ isOneToOne: false;
2672
+ referencedRelation: "operating_context_types";
2673
+ referencedColumns: ["id"];
2674
+ },
2675
+ {
2676
+ foreignKeyName: "operating_contexts_updated_by_fkey";
2677
+ columns: ["updated_by"];
2678
+ isOneToOne: false;
2679
+ referencedRelation: "users";
1872
2680
  referencedColumns: ["id"];
1873
2681
  }
1874
2682
  ];
@@ -4145,6 +4953,35 @@ export type Database = {
4145
4953
  subject_id: number;
4146
4954
  }[];
4147
4955
  };
4956
+ get_operating_context_weather_snapshots: {
4957
+ Args: {
4958
+ cursor_collected_at?: string;
4959
+ cursor_id?: number;
4960
+ limit_caller?: number;
4961
+ operating_context_id_caller: number;
4962
+ };
4963
+ Returns: {
4964
+ collected_at: string;
4965
+ density_altitude_meters: number | null;
4966
+ id: number;
4967
+ inserted_at: string;
4968
+ kp_index: number | null;
4969
+ operating_context_region_id: number;
4970
+ precipitation_millimeters: number | null;
4971
+ static_buildup_category: string | null;
4972
+ temperature_max_celsius: number | null;
4973
+ temperature_min_celsius: number | null;
4974
+ visibility_meters: number | null;
4975
+ wind_heading_degrees: number | null;
4976
+ wind_speed_meters_per_second: number | null;
4977
+ }[];
4978
+ SetofOptions: {
4979
+ from: "*";
4980
+ to: "operating_context_weather_snapshots";
4981
+ isOneToOne: false;
4982
+ isSetofReturn: true;
4983
+ };
4984
+ };
4148
4985
  get_parts_for_herd: {
4149
4986
  Args: {
4150
4987
  herd_id_caller: number;
@@ -4694,6 +5531,15 @@ export type Database = {
4694
5531
  };
4695
5532
  Returns: undefined;
4696
5533
  };
5534
+ resolve_dji_flight_record_device: {
5535
+ Args: {
5536
+ aircraft_serial_caller: string;
5537
+ uploader_id_caller: string;
5538
+ };
5539
+ Returns: {
5540
+ device_id: number;
5541
+ }[];
5542
+ };
4697
5543
  revoke_client_abilities_jwt_public_key: {
4698
5544
  Args: {
4699
5545
  p_kid: string;
@@ -4804,12 +5650,15 @@ export type Database = {
4804
5650
  analysis_work_status: "waiting" | "cancelled" | "processing" | "failed" | "success";
4805
5651
  app_permission: "herds.delete" | "events.delete";
4806
5652
  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";
4807
- document_entity: "user" | "herd" | "device" | "product";
5653
+ document_entity: "user" | "herd" | "device" | "product" | "operating_context";
4808
5654
  entity_lifecycle: "active" | "retired" | "deleted";
4809
5655
  health_item: "healthy" | "repairable" | "unrepairable";
4810
5656
  herd_invitation_status: "pending" | "accepted" | "revoked" | "expired";
4811
5657
  link_type: "wifi" | "ocusync" | "lte" | "satellite" | "mesh" | "lora" | "unknown";
4812
5658
  media_type: "image" | "video" | "audio" | "text";
5659
+ operating_context_payload_type: "drop_supply" | "drop_firestarter" | "other";
5660
+ operating_context_risk_probability: "extremely_improbable" | "improbable" | "unlikely" | "occasional" | "frequent";
5661
+ operating_context_risk_severity: "negligible" | "minor" | "major" | "hazardous" | "catastrophic";
4813
5662
  plan_type: "mission" | "fence" | "rally" | "markov";
4814
5663
  review_status: "pending" | "annotating" | "in_review" | "completed" | "rejected";
4815
5664
  session_end_reason: "completed" | "superseded" | "reporting_lost" | "inactivity_timeout" | "operator_cancelled" | "system_cancelled" | "other";
@@ -5136,12 +5985,15 @@ export declare const Constants: {
5136
5985
  readonly analysis_work_status: readonly ["waiting", "cancelled", "processing", "failed", "success"];
5137
5986
  readonly app_permission: readonly ["herds.delete", "events.delete"];
5138
5987
  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"];
5139
- readonly document_entity: readonly ["user", "herd", "device", "product"];
5988
+ readonly document_entity: readonly ["user", "herd", "device", "product", "operating_context"];
5140
5989
  readonly entity_lifecycle: readonly ["active", "retired", "deleted"];
5141
5990
  readonly health_item: readonly ["healthy", "repairable", "unrepairable"];
5142
5991
  readonly herd_invitation_status: readonly ["pending", "accepted", "revoked", "expired"];
5143
5992
  readonly link_type: readonly ["wifi", "ocusync", "lte", "satellite", "mesh", "lora", "unknown"];
5144
5993
  readonly media_type: readonly ["image", "video", "audio", "text"];
5994
+ readonly operating_context_payload_type: readonly ["drop_supply", "drop_firestarter", "other"];
5995
+ readonly operating_context_risk_probability: readonly ["extremely_improbable", "improbable", "unlikely", "occasional", "frequent"];
5996
+ readonly operating_context_risk_severity: readonly ["negligible", "minor", "major", "hazardous", "catastrophic"];
5145
5997
  readonly plan_type: readonly ["mission", "fence", "rally", "markov"];
5146
5998
  readonly review_status: readonly ["pending", "annotating", "in_review", "completed", "rejected"];
5147
5999
  readonly session_end_reason: readonly ["completed", "superseded", "reporting_lost", "inactivity_timeout", "operator_cancelled", "system_cancelled", "other"];