@adventurelabs/scout-core 1.4.84 → 1.4.86

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 (48) hide show
  1. package/dist/api_keys/actions.d.ts +2 -1
  2. package/dist/api_keys/actions.js +2 -2
  3. package/dist/helpers/contacts.d.ts +10 -0
  4. package/dist/helpers/contacts.js +71 -0
  5. package/dist/helpers/document_templates.d.ts +7 -0
  6. package/dist/helpers/document_templates.js +63 -0
  7. package/dist/helpers/documents.d.ts +12 -0
  8. package/dist/helpers/documents.js +107 -0
  9. package/dist/helpers/herds.js +92 -13
  10. package/dist/helpers/index.d.ts +9 -1
  11. package/dist/helpers/index.js +9 -1
  12. package/dist/helpers/issuers.d.ts +7 -0
  13. package/dist/helpers/issuers.js +63 -0
  14. package/dist/helpers/layers.d.ts +3 -0
  15. package/dist/helpers/layers.js +20 -0
  16. package/dist/helpers/lifecycle.d.ts +2 -1
  17. package/dist/helpers/lifecycle.js +9 -0
  18. package/dist/helpers/localizations.d.ts +6 -0
  19. package/dist/helpers/localizations.js +51 -0
  20. package/dist/helpers/maintenance_requests.d.ts +15 -0
  21. package/dist/helpers/maintenance_requests.js +128 -0
  22. package/dist/helpers/manufacturers.d.ts +8 -0
  23. package/dist/helpers/manufacturers.js +52 -0
  24. package/dist/helpers/parts.d.ts +8 -1
  25. package/dist/helpers/parts.js +38 -0
  26. package/dist/helpers/plans.d.ts +3 -0
  27. package/dist/helpers/plans.js +20 -0
  28. package/dist/helpers/product_numbers.d.ts +7 -0
  29. package/dist/helpers/product_numbers.js +66 -0
  30. package/dist/helpers/products.d.ts +9 -0
  31. package/dist/helpers/products.js +65 -0
  32. package/dist/helpers/providers.d.ts +3 -0
  33. package/dist/helpers/providers.js +20 -0
  34. package/dist/helpers/users.d.ts +1 -0
  35. package/dist/helpers/users.js +30 -0
  36. package/dist/helpers/zones.d.ts +2 -1
  37. package/dist/helpers/zones.js +2 -2
  38. package/dist/hooks/useScoutRefresh.js +24 -8
  39. package/dist/index.d.ts +13 -3
  40. package/dist/index.js +11 -1
  41. package/dist/store/scout.d.ts +1 -0
  42. package/dist/store/scout.js +18 -2
  43. package/dist/types/db.d.ts +38 -4
  44. package/dist/types/herd_module.d.ts +2 -17
  45. package/dist/types/herd_module.js +0 -166
  46. package/dist/types/supabase.d.ts +686 -45
  47. package/dist/types/supabase.js +1 -0
  48. package/package.json +1 -1
@@ -329,6 +329,50 @@ export type Database = {
329
329
  }
330
330
  ];
331
331
  };
332
+ calibrations: {
333
+ Row: {
334
+ id: number;
335
+ inserted_at: string;
336
+ lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
337
+ lifecycle_changed_at: string;
338
+ lifecycle_changed_by: string | null;
339
+ lifecycle_reason: string | null;
340
+ name: string | null;
341
+ notes: string | null;
342
+ parameters: Json;
343
+ };
344
+ Insert: {
345
+ id?: number;
346
+ inserted_at?: string;
347
+ lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
348
+ lifecycle_changed_at?: string;
349
+ lifecycle_changed_by?: string | null;
350
+ lifecycle_reason?: string | null;
351
+ name?: string | null;
352
+ notes?: string | null;
353
+ parameters?: Json;
354
+ };
355
+ Update: {
356
+ id?: number;
357
+ inserted_at?: string;
358
+ lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
359
+ lifecycle_changed_at?: string;
360
+ lifecycle_changed_by?: string | null;
361
+ lifecycle_reason?: string | null;
362
+ name?: string | null;
363
+ notes?: string | null;
364
+ parameters?: Json;
365
+ };
366
+ Relationships: [
367
+ {
368
+ foreignKeyName: "calibrations_lifecycle_changed_by_fkey";
369
+ columns: ["lifecycle_changed_by"];
370
+ isOneToOne: false;
371
+ referencedRelation: "users";
372
+ referencedColumns: ["id"];
373
+ }
374
+ ];
375
+ };
332
376
  certificates: {
333
377
  Row: {
334
378
  created_at: string;
@@ -514,41 +558,77 @@ export type Database = {
514
558
  }
515
559
  ];
516
560
  };
517
- credentials: {
561
+ contacts: {
518
562
  Row: {
519
563
  created_at: string;
520
- expiration: string | null;
564
+ created_by: string | null;
565
+ email: string | null;
566
+ herd_id: number;
521
567
  id: number;
522
- issuer: string;
523
- tracking_number: string | null;
524
- type: string;
525
- updated_at: string | null;
526
- user_id: string;
568
+ lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
569
+ lifecycle_changed_at: string;
570
+ lifecycle_changed_by: string | null;
571
+ lifecycle_reason: string | null;
572
+ name: string;
573
+ phone: string | null;
574
+ updated_at: string;
575
+ updated_by: string | null;
527
576
  };
528
577
  Insert: {
529
578
  created_at?: string;
530
- expiration?: string | null;
579
+ created_by?: string | null;
580
+ email?: string | null;
581
+ herd_id: number;
531
582
  id?: number;
532
- issuer: string;
533
- tracking_number?: string | null;
534
- type: string;
535
- updated_at?: string | null;
536
- user_id: string;
583
+ lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
584
+ lifecycle_changed_at?: string;
585
+ lifecycle_changed_by?: string | null;
586
+ lifecycle_reason?: string | null;
587
+ name: string;
588
+ phone?: string | null;
589
+ updated_at?: string;
590
+ updated_by?: string | null;
537
591
  };
538
592
  Update: {
539
593
  created_at?: string;
540
- expiration?: string | null;
594
+ created_by?: string | null;
595
+ email?: string | null;
596
+ herd_id?: number;
541
597
  id?: number;
542
- issuer?: string;
543
- tracking_number?: string | null;
544
- type?: string;
545
- updated_at?: string | null;
546
- user_id?: string;
598
+ lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
599
+ lifecycle_changed_at?: string;
600
+ lifecycle_changed_by?: string | null;
601
+ lifecycle_reason?: string | null;
602
+ name?: string;
603
+ phone?: string | null;
604
+ updated_at?: string;
605
+ updated_by?: string | null;
547
606
  };
548
607
  Relationships: [
549
608
  {
550
- foreignKeyName: "credentials_user_id_fkey";
551
- columns: ["user_id"];
609
+ foreignKeyName: "contacts_created_by_fkey";
610
+ columns: ["created_by"];
611
+ isOneToOne: false;
612
+ referencedRelation: "users";
613
+ referencedColumns: ["id"];
614
+ },
615
+ {
616
+ foreignKeyName: "contacts_herd_id_fkey";
617
+ columns: ["herd_id"];
618
+ isOneToOne: false;
619
+ referencedRelation: "herds";
620
+ referencedColumns: ["id"];
621
+ },
622
+ {
623
+ foreignKeyName: "contacts_lifecycle_changed_by_fkey";
624
+ columns: ["lifecycle_changed_by"];
625
+ isOneToOne: false;
626
+ referencedRelation: "users";
627
+ referencedColumns: ["id"];
628
+ },
629
+ {
630
+ foreignKeyName: "contacts_updated_by_fkey";
631
+ columns: ["updated_by"];
552
632
  isOneToOne: false;
553
633
  referencedRelation: "users";
554
634
  referencedColumns: ["id"];
@@ -634,6 +714,152 @@ export type Database = {
634
714
  }
635
715
  ];
636
716
  };
717
+ document_templates: {
718
+ Row: {
719
+ categories: string | null;
720
+ id: number;
721
+ inserted_at: string;
722
+ issuer_id: number | null;
723
+ localization_id: number | null;
724
+ name: string;
725
+ uses_expiry: boolean;
726
+ };
727
+ Insert: {
728
+ categories?: string | null;
729
+ id?: number;
730
+ inserted_at?: string;
731
+ issuer_id?: number | null;
732
+ localization_id?: number | null;
733
+ name: string;
734
+ uses_expiry?: boolean;
735
+ };
736
+ Update: {
737
+ categories?: string | null;
738
+ id?: number;
739
+ inserted_at?: string;
740
+ issuer_id?: number | null;
741
+ localization_id?: number | null;
742
+ name?: string;
743
+ uses_expiry?: boolean;
744
+ };
745
+ Relationships: [
746
+ {
747
+ foreignKeyName: "document_templates_issuer_id_fkey";
748
+ columns: ["issuer_id"];
749
+ isOneToOne: false;
750
+ referencedRelation: "issuers";
751
+ referencedColumns: ["id"];
752
+ },
753
+ {
754
+ foreignKeyName: "document_templates_localization_id_fkey";
755
+ columns: ["localization_id"];
756
+ isOneToOne: false;
757
+ referencedRelation: "localizations";
758
+ referencedColumns: ["id"];
759
+ }
760
+ ];
761
+ };
762
+ documents: {
763
+ Row: {
764
+ created_at: string;
765
+ created_by: string | null;
766
+ device_id: number | null;
767
+ herd_id: number | null;
768
+ id: number;
769
+ product_id: number | null;
770
+ size_bytes: number | null;
771
+ template_id: number | null;
772
+ updated_at: string;
773
+ updated_by: string | null;
774
+ uri: string;
775
+ user_id: string | null;
776
+ valid_from: string | null;
777
+ valid_to: string | null;
778
+ };
779
+ Insert: {
780
+ created_at?: string;
781
+ created_by?: string | null;
782
+ device_id?: number | null;
783
+ herd_id?: number | null;
784
+ id?: number;
785
+ product_id?: number | null;
786
+ size_bytes?: number | null;
787
+ template_id?: number | null;
788
+ updated_at?: string;
789
+ updated_by?: string | null;
790
+ uri: string;
791
+ user_id?: string | null;
792
+ valid_from?: string | null;
793
+ valid_to?: string | null;
794
+ };
795
+ Update: {
796
+ created_at?: string;
797
+ created_by?: string | null;
798
+ device_id?: number | null;
799
+ herd_id?: number | null;
800
+ id?: number;
801
+ product_id?: number | null;
802
+ size_bytes?: number | null;
803
+ template_id?: number | null;
804
+ updated_at?: string;
805
+ updated_by?: string | null;
806
+ uri?: string;
807
+ user_id?: string | null;
808
+ valid_from?: string | null;
809
+ valid_to?: string | null;
810
+ };
811
+ Relationships: [
812
+ {
813
+ foreignKeyName: "documents_created_by_fkey";
814
+ columns: ["created_by"];
815
+ isOneToOne: false;
816
+ referencedRelation: "users";
817
+ referencedColumns: ["id"];
818
+ },
819
+ {
820
+ foreignKeyName: "documents_device_id_fkey";
821
+ columns: ["device_id"];
822
+ isOneToOne: false;
823
+ referencedRelation: "devices";
824
+ referencedColumns: ["id"];
825
+ },
826
+ {
827
+ foreignKeyName: "documents_herd_id_fkey";
828
+ columns: ["herd_id"];
829
+ isOneToOne: false;
830
+ referencedRelation: "herds";
831
+ referencedColumns: ["id"];
832
+ },
833
+ {
834
+ foreignKeyName: "documents_product_id_fkey";
835
+ columns: ["product_id"];
836
+ isOneToOne: false;
837
+ referencedRelation: "products";
838
+ referencedColumns: ["id"];
839
+ },
840
+ {
841
+ foreignKeyName: "documents_template_id_fkey";
842
+ columns: ["template_id"];
843
+ isOneToOne: false;
844
+ referencedRelation: "document_templates";
845
+ referencedColumns: ["id"];
846
+ },
847
+ {
848
+ foreignKeyName: "documents_updated_by_fkey";
849
+ columns: ["updated_by"];
850
+ isOneToOne: false;
851
+ referencedRelation: "users";
852
+ referencedColumns: ["id"];
853
+ },
854
+ {
855
+ foreignKeyName: "documents_user_id_fkey";
856
+ columns: ["user_id"];
857
+ isOneToOne: false;
858
+ referencedRelation: "users";
859
+ referencedColumns: ["id"];
860
+ }
861
+ ];
862
+ };
637
863
  embeddings_vertex_multimodal_001: {
638
864
  Row: {
639
865
  artifact_id: number | null;
@@ -1126,48 +1352,73 @@ export type Database = {
1126
1352
  auto_delete_media_with_humans: boolean | null;
1127
1353
  auto_delete_media_with_no_tracks: boolean | null;
1128
1354
  description: string;
1129
- earthranger_domain: string | null;
1130
- earthranger_token: string | null;
1131
1355
  id: number;
1132
1356
  inserted_at: string;
1133
1357
  is_public: boolean;
1358
+ localization_id: number | null;
1134
1359
  location: unknown;
1135
1360
  slug: string;
1136
- video_publisher_token: string | null;
1137
- video_server_url: string | null;
1138
- video_subscriber_token: string | null;
1139
1361
  };
1140
1362
  Insert: {
1141
1363
  auto_delete_media_with_humans?: boolean | null;
1142
1364
  auto_delete_media_with_no_tracks?: boolean | null;
1143
1365
  description: string;
1144
- earthranger_domain?: string | null;
1145
- earthranger_token?: string | null;
1146
1366
  id?: number;
1147
1367
  inserted_at?: string;
1148
1368
  is_public?: boolean;
1369
+ localization_id?: number | null;
1149
1370
  location?: unknown;
1150
1371
  slug: string;
1151
- video_publisher_token?: string | null;
1152
- video_server_url?: string | null;
1153
- video_subscriber_token?: string | null;
1154
1372
  };
1155
1373
  Update: {
1156
1374
  auto_delete_media_with_humans?: boolean | null;
1157
1375
  auto_delete_media_with_no_tracks?: boolean | null;
1158
1376
  description?: string;
1159
- earthranger_domain?: string | null;
1160
- earthranger_token?: string | null;
1161
1377
  id?: number;
1162
1378
  inserted_at?: string;
1163
1379
  is_public?: boolean;
1380
+ localization_id?: number | null;
1164
1381
  location?: unknown;
1165
1382
  slug?: string;
1166
- video_publisher_token?: string | null;
1167
- video_server_url?: string | null;
1168
- video_subscriber_token?: string | null;
1169
1383
  };
1170
- Relationships: [];
1384
+ Relationships: [
1385
+ {
1386
+ foreignKeyName: "herds_localization_id_fkey";
1387
+ columns: ["localization_id"];
1388
+ isOneToOne: false;
1389
+ referencedRelation: "localizations";
1390
+ referencedColumns: ["id"];
1391
+ }
1392
+ ];
1393
+ };
1394
+ issuers: {
1395
+ Row: {
1396
+ id: number;
1397
+ inserted_at: string;
1398
+ localization_id: number | null;
1399
+ name: string;
1400
+ };
1401
+ Insert: {
1402
+ id?: number;
1403
+ inserted_at?: string;
1404
+ localization_id?: number | null;
1405
+ name: string;
1406
+ };
1407
+ Update: {
1408
+ id?: number;
1409
+ inserted_at?: string;
1410
+ localization_id?: number | null;
1411
+ name?: string;
1412
+ };
1413
+ Relationships: [
1414
+ {
1415
+ foreignKeyName: "issuers_localization_id_fkey";
1416
+ columns: ["localization_id"];
1417
+ isOneToOne: false;
1418
+ referencedRelation: "localizations";
1419
+ referencedColumns: ["id"];
1420
+ }
1421
+ ];
1171
1422
  };
1172
1423
  layers: {
1173
1424
  Row: {
@@ -1198,6 +1449,24 @@ export type Database = {
1198
1449
  }
1199
1450
  ];
1200
1451
  };
1452
+ localizations: {
1453
+ Row: {
1454
+ id: number;
1455
+ inserted_at: string;
1456
+ region: string;
1457
+ };
1458
+ Insert: {
1459
+ id?: number;
1460
+ inserted_at?: string;
1461
+ region: string;
1462
+ };
1463
+ Update: {
1464
+ id?: number;
1465
+ inserted_at?: string;
1466
+ region?: string;
1467
+ };
1468
+ Relationships: [];
1469
+ };
1201
1470
  maintenance: {
1202
1471
  Row: {
1203
1472
  created_at: string;
@@ -1236,6 +1505,140 @@ export type Database = {
1236
1505
  }
1237
1506
  ];
1238
1507
  };
1508
+ maintenance_requests: {
1509
+ Row: {
1510
+ created_at: string;
1511
+ creator_user_id: string | null;
1512
+ defect_timestamp: string;
1513
+ description: string;
1514
+ device_id: number | null;
1515
+ id: number;
1516
+ image: string | null;
1517
+ is_serviceable: boolean;
1518
+ part_id: number | null;
1519
+ remediation_completed_at: string | null;
1520
+ remediation_completed_user_id: string | null;
1521
+ remediation_notes: string | null;
1522
+ updated_at: string | null;
1523
+ updated_by_user_id: string | null;
1524
+ };
1525
+ Insert: {
1526
+ created_at?: string;
1527
+ creator_user_id?: string | null;
1528
+ defect_timestamp: string;
1529
+ description: string;
1530
+ device_id?: number | null;
1531
+ id?: number;
1532
+ image?: string | null;
1533
+ is_serviceable?: boolean;
1534
+ part_id?: number | null;
1535
+ remediation_completed_at?: string | null;
1536
+ remediation_completed_user_id?: string | null;
1537
+ remediation_notes?: string | null;
1538
+ updated_at?: string | null;
1539
+ updated_by_user_id?: string | null;
1540
+ };
1541
+ Update: {
1542
+ created_at?: string;
1543
+ creator_user_id?: string | null;
1544
+ defect_timestamp?: string;
1545
+ description?: string;
1546
+ device_id?: number | null;
1547
+ id?: number;
1548
+ image?: string | null;
1549
+ is_serviceable?: boolean;
1550
+ part_id?: number | null;
1551
+ remediation_completed_at?: string | null;
1552
+ remediation_completed_user_id?: string | null;
1553
+ remediation_notes?: string | null;
1554
+ updated_at?: string | null;
1555
+ updated_by_user_id?: string | null;
1556
+ };
1557
+ Relationships: [
1558
+ {
1559
+ foreignKeyName: "maintenance_requests_creator_user_id_fkey";
1560
+ columns: ["creator_user_id"];
1561
+ isOneToOne: false;
1562
+ referencedRelation: "users";
1563
+ referencedColumns: ["id"];
1564
+ },
1565
+ {
1566
+ foreignKeyName: "maintenance_requests_device_id_fkey";
1567
+ columns: ["device_id"];
1568
+ isOneToOne: false;
1569
+ referencedRelation: "devices";
1570
+ referencedColumns: ["id"];
1571
+ },
1572
+ {
1573
+ foreignKeyName: "maintenance_requests_part_id_fkey";
1574
+ columns: ["part_id"];
1575
+ isOneToOne: false;
1576
+ referencedRelation: "parts";
1577
+ referencedColumns: ["id"];
1578
+ },
1579
+ {
1580
+ foreignKeyName: "maintenance_requests_remediation_completed_user_id_fkey";
1581
+ columns: ["remediation_completed_user_id"];
1582
+ isOneToOne: false;
1583
+ referencedRelation: "users";
1584
+ referencedColumns: ["id"];
1585
+ },
1586
+ {
1587
+ foreignKeyName: "maintenance_requests_updated_by_user_id_fkey";
1588
+ columns: ["updated_by_user_id"];
1589
+ isOneToOne: false;
1590
+ referencedRelation: "users";
1591
+ referencedColumns: ["id"];
1592
+ }
1593
+ ];
1594
+ };
1595
+ manufacturers: {
1596
+ Row: {
1597
+ country: string | null;
1598
+ gln: string | null;
1599
+ id: number;
1600
+ inserted_at: string;
1601
+ lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
1602
+ lifecycle_changed_at: string;
1603
+ lifecycle_changed_by: string | null;
1604
+ lifecycle_reason: string | null;
1605
+ name: string;
1606
+ website: string | null;
1607
+ };
1608
+ Insert: {
1609
+ country?: string | null;
1610
+ gln?: string | null;
1611
+ id?: number;
1612
+ inserted_at?: string;
1613
+ lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
1614
+ lifecycle_changed_at?: string;
1615
+ lifecycle_changed_by?: string | null;
1616
+ lifecycle_reason?: string | null;
1617
+ name: string;
1618
+ website?: string | null;
1619
+ };
1620
+ Update: {
1621
+ country?: string | null;
1622
+ gln?: string | null;
1623
+ id?: number;
1624
+ inserted_at?: string;
1625
+ lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
1626
+ lifecycle_changed_at?: string;
1627
+ lifecycle_changed_by?: string | null;
1628
+ lifecycle_reason?: string | null;
1629
+ name?: string;
1630
+ website?: string | null;
1631
+ };
1632
+ Relationships: [
1633
+ {
1634
+ foreignKeyName: "manufacturers_lifecycle_changed_by_fkey";
1635
+ columns: ["lifecycle_changed_by"];
1636
+ isOneToOne: false;
1637
+ referencedRelation: "users";
1638
+ referencedColumns: ["id"];
1639
+ }
1640
+ ];
1641
+ };
1239
1642
  models: {
1240
1643
  Row: {
1241
1644
  capabilities: string[];
@@ -1404,12 +1807,15 @@ export type Database = {
1404
1807
  Row: {
1405
1808
  certificate_id: number | null;
1406
1809
  created_at: string;
1407
- device_id: number;
1810
+ device_id: number | null;
1811
+ health: Database["public"]["Enums"]["health_item"];
1812
+ herd_id: number | null;
1408
1813
  id: number;
1409
1814
  lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
1410
1815
  lifecycle_changed_at: string;
1411
1816
  lifecycle_changed_by: string | null;
1412
1817
  lifecycle_reason: string | null;
1818
+ primary_calibration_id: number | null;
1413
1819
  product_number: string;
1414
1820
  serial_number: string;
1415
1821
  updated_at: string | null;
@@ -1417,12 +1823,15 @@ export type Database = {
1417
1823
  Insert: {
1418
1824
  certificate_id?: number | null;
1419
1825
  created_at?: string;
1420
- device_id: number;
1826
+ device_id?: number | null;
1827
+ health?: Database["public"]["Enums"]["health_item"];
1828
+ herd_id?: number | null;
1421
1829
  id?: number;
1422
1830
  lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
1423
1831
  lifecycle_changed_at?: string;
1424
1832
  lifecycle_changed_by?: string | null;
1425
1833
  lifecycle_reason?: string | null;
1834
+ primary_calibration_id?: number | null;
1426
1835
  product_number: string;
1427
1836
  serial_number: string;
1428
1837
  updated_at?: string | null;
@@ -1430,12 +1839,15 @@ export type Database = {
1430
1839
  Update: {
1431
1840
  certificate_id?: number | null;
1432
1841
  created_at?: string;
1433
- device_id?: number;
1842
+ device_id?: number | null;
1843
+ health?: Database["public"]["Enums"]["health_item"];
1844
+ herd_id?: number | null;
1434
1845
  id?: number;
1435
1846
  lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
1436
1847
  lifecycle_changed_at?: string;
1437
1848
  lifecycle_changed_by?: string | null;
1438
1849
  lifecycle_reason?: string | null;
1850
+ primary_calibration_id?: number | null;
1439
1851
  product_number?: string;
1440
1852
  serial_number?: string;
1441
1853
  updated_at?: string | null;
@@ -1455,12 +1867,33 @@ export type Database = {
1455
1867
  referencedRelation: "devices";
1456
1868
  referencedColumns: ["id"];
1457
1869
  },
1870
+ {
1871
+ foreignKeyName: "parts_herd_id_fkey";
1872
+ columns: ["herd_id"];
1873
+ isOneToOne: false;
1874
+ referencedRelation: "herds";
1875
+ referencedColumns: ["id"];
1876
+ },
1458
1877
  {
1459
1878
  foreignKeyName: "parts_lifecycle_changed_by_fkey";
1460
1879
  columns: ["lifecycle_changed_by"];
1461
1880
  isOneToOne: false;
1462
1881
  referencedRelation: "users";
1463
1882
  referencedColumns: ["id"];
1883
+ },
1884
+ {
1885
+ foreignKeyName: "parts_primary_calibration_id_fkey";
1886
+ columns: ["primary_calibration_id"];
1887
+ isOneToOne: false;
1888
+ referencedRelation: "calibrations";
1889
+ referencedColumns: ["id"];
1890
+ },
1891
+ {
1892
+ foreignKeyName: "parts_product_number_fkey";
1893
+ columns: ["product_number"];
1894
+ isOneToOne: false;
1895
+ referencedRelation: "product_numbers";
1896
+ referencedColumns: ["product_number"];
1464
1897
  }
1465
1898
  ];
1466
1899
  };
@@ -1634,13 +2067,126 @@ export type Database = {
1634
2067
  }
1635
2068
  ];
1636
2069
  };
2070
+ product_numbers: {
2071
+ Row: {
2072
+ gtin: string | null;
2073
+ inserted_at: string;
2074
+ lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
2075
+ lifecycle_changed_at: string;
2076
+ lifecycle_changed_by: string | null;
2077
+ lifecycle_reason: string | null;
2078
+ notes: string | null;
2079
+ product_id: number;
2080
+ product_number: string;
2081
+ revision: string | null;
2082
+ };
2083
+ Insert: {
2084
+ gtin?: string | null;
2085
+ inserted_at?: string;
2086
+ lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
2087
+ lifecycle_changed_at?: string;
2088
+ lifecycle_changed_by?: string | null;
2089
+ lifecycle_reason?: string | null;
2090
+ notes?: string | null;
2091
+ product_id: number;
2092
+ product_number: string;
2093
+ revision?: string | null;
2094
+ };
2095
+ Update: {
2096
+ gtin?: string | null;
2097
+ inserted_at?: string;
2098
+ lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
2099
+ lifecycle_changed_at?: string;
2100
+ lifecycle_changed_by?: string | null;
2101
+ lifecycle_reason?: string | null;
2102
+ notes?: string | null;
2103
+ product_id?: number;
2104
+ product_number?: string;
2105
+ revision?: string | null;
2106
+ };
2107
+ Relationships: [
2108
+ {
2109
+ foreignKeyName: "product_numbers_lifecycle_changed_by_fkey";
2110
+ columns: ["lifecycle_changed_by"];
2111
+ isOneToOne: false;
2112
+ referencedRelation: "users";
2113
+ referencedColumns: ["id"];
2114
+ },
2115
+ {
2116
+ foreignKeyName: "product_numbers_product_id_fkey";
2117
+ columns: ["product_id"];
2118
+ isOneToOne: false;
2119
+ referencedRelation: "products";
2120
+ referencedColumns: ["id"];
2121
+ }
2122
+ ];
2123
+ };
2124
+ products: {
2125
+ Row: {
2126
+ category: string | null;
2127
+ description: string | null;
2128
+ id: number;
2129
+ inserted_at: string;
2130
+ lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
2131
+ lifecycle_changed_at: string;
2132
+ lifecycle_changed_by: string | null;
2133
+ lifecycle_reason: string | null;
2134
+ manufacturer_id: number;
2135
+ name: string;
2136
+ website: string | null;
2137
+ };
2138
+ Insert: {
2139
+ category?: string | null;
2140
+ description?: string | null;
2141
+ id?: number;
2142
+ inserted_at?: string;
2143
+ lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
2144
+ lifecycle_changed_at?: string;
2145
+ lifecycle_changed_by?: string | null;
2146
+ lifecycle_reason?: string | null;
2147
+ manufacturer_id: number;
2148
+ name: string;
2149
+ website?: string | null;
2150
+ };
2151
+ Update: {
2152
+ category?: string | null;
2153
+ description?: string | null;
2154
+ id?: number;
2155
+ inserted_at?: string;
2156
+ lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
2157
+ lifecycle_changed_at?: string;
2158
+ lifecycle_changed_by?: string | null;
2159
+ lifecycle_reason?: string | null;
2160
+ manufacturer_id?: number;
2161
+ name?: string;
2162
+ website?: string | null;
2163
+ };
2164
+ Relationships: [
2165
+ {
2166
+ foreignKeyName: "products_lifecycle_changed_by_fkey";
2167
+ columns: ["lifecycle_changed_by"];
2168
+ isOneToOne: false;
2169
+ referencedRelation: "users";
2170
+ referencedColumns: ["id"];
2171
+ },
2172
+ {
2173
+ foreignKeyName: "products_manufacturer_id_fkey";
2174
+ columns: ["manufacturer_id"];
2175
+ isOneToOne: false;
2176
+ referencedRelation: "manufacturers";
2177
+ referencedColumns: ["id"];
2178
+ }
2179
+ ];
2180
+ };
1637
2181
  providers: {
1638
2182
  Row: {
1639
2183
  created_at: string;
1640
2184
  herd_id: number;
1641
2185
  id: number;
1642
2186
  key: string | null;
2187
+ sensitivity_tier: number | null;
1643
2188
  source: string;
2189
+ timestamp_expiration: string | null;
1644
2190
  type: string;
1645
2191
  };
1646
2192
  Insert: {
@@ -1648,7 +2194,9 @@ export type Database = {
1648
2194
  herd_id: number;
1649
2195
  id?: number;
1650
2196
  key?: string | null;
2197
+ sensitivity_tier?: number | null;
1651
2198
  source: string;
2199
+ timestamp_expiration?: string | null;
1652
2200
  type: string;
1653
2201
  };
1654
2202
  Update: {
@@ -1656,7 +2204,9 @@ export type Database = {
1656
2204
  herd_id?: number;
1657
2205
  id?: number;
1658
2206
  key?: string | null;
2207
+ sensitivity_tier?: number | null;
1659
2208
  source?: string;
2209
+ timestamp_expiration?: string | null;
1660
2210
  type?: string;
1661
2211
  };
1662
2212
  Relationships: [
@@ -1785,6 +2335,65 @@ export type Database = {
1785
2335
  }
1786
2336
  ];
1787
2337
  };
2338
+ sensor_poses: {
2339
+ Row: {
2340
+ active_processing_modality: string | null;
2341
+ active_recording_modality: string | null;
2342
+ id: number;
2343
+ inserted_at: string;
2344
+ origin_heading: number | null;
2345
+ origin_height: number | null;
2346
+ origin_location: unknown;
2347
+ origin_pitch: number | null;
2348
+ origin_roll: number | null;
2349
+ part_id: number;
2350
+ sensor_pitch: number | null;
2351
+ sensor_roll: number | null;
2352
+ sensor_yaw: number | null;
2353
+ timestamp_observation: string;
2354
+ };
2355
+ Insert: {
2356
+ active_processing_modality?: string | null;
2357
+ active_recording_modality?: string | null;
2358
+ id?: number;
2359
+ inserted_at?: string;
2360
+ origin_heading?: number | null;
2361
+ origin_height?: number | null;
2362
+ origin_location?: unknown;
2363
+ origin_pitch?: number | null;
2364
+ origin_roll?: number | null;
2365
+ part_id: number;
2366
+ sensor_pitch?: number | null;
2367
+ sensor_roll?: number | null;
2368
+ sensor_yaw?: number | null;
2369
+ timestamp_observation: string;
2370
+ };
2371
+ Update: {
2372
+ active_processing_modality?: string | null;
2373
+ active_recording_modality?: string | null;
2374
+ id?: number;
2375
+ inserted_at?: string;
2376
+ origin_heading?: number | null;
2377
+ origin_height?: number | null;
2378
+ origin_location?: unknown;
2379
+ origin_pitch?: number | null;
2380
+ origin_roll?: number | null;
2381
+ part_id?: number;
2382
+ sensor_pitch?: number | null;
2383
+ sensor_roll?: number | null;
2384
+ sensor_yaw?: number | null;
2385
+ timestamp_observation?: string;
2386
+ };
2387
+ Relationships: [
2388
+ {
2389
+ foreignKeyName: "sensor_poses_part_id_fkey";
2390
+ columns: ["part_id"];
2391
+ isOneToOne: false;
2392
+ referencedRelation: "parts";
2393
+ referencedColumns: ["id"];
2394
+ }
2395
+ ];
2396
+ };
1788
2397
  sessions: {
1789
2398
  Row: {
1790
2399
  altitude_average: number;
@@ -3254,6 +3863,35 @@ export type Database = {
3254
3863
  isSetofReturn: true;
3255
3864
  };
3256
3865
  };
3866
+ get_maintenance_requests_for_herd: {
3867
+ Args: {
3868
+ herd_id_caller: number;
3869
+ limit_caller?: number;
3870
+ offset_caller?: number;
3871
+ };
3872
+ Returns: {
3873
+ created_at: string;
3874
+ creator_user_id: string | null;
3875
+ defect_timestamp: string;
3876
+ description: string;
3877
+ device_id: number | null;
3878
+ id: number;
3879
+ image: string | null;
3880
+ is_serviceable: boolean;
3881
+ part_id: number | null;
3882
+ remediation_completed_at: string | null;
3883
+ remediation_completed_user_id: string | null;
3884
+ remediation_notes: string | null;
3885
+ updated_at: string | null;
3886
+ updated_by_user_id: string | null;
3887
+ }[];
3888
+ SetofOptions: {
3889
+ from: "*";
3890
+ to: "maintenance_requests";
3891
+ isOneToOne: false;
3892
+ isSetofReturn: true;
3893
+ };
3894
+ };
3257
3895
  get_minimal_subjects_for_artifact: {
3258
3896
  Args: {
3259
3897
  artifact_id_caller: number;
@@ -3537,6 +4175,12 @@ export type Database = {
3537
4175
  };
3538
4176
  Returns: number;
3539
4177
  };
4178
+ get_total_maintenance_requests_for_herd: {
4179
+ Args: {
4180
+ herd_id_caller: number;
4181
+ };
4182
+ Returns: number;
4183
+ };
3540
4184
  get_zones_and_actions_for_herd: {
3541
4185
  Args: {
3542
4186
  herd_id_caller: number;
@@ -3850,6 +4494,7 @@ export type Database = {
3850
4494
  app_permission: "herds.delete" | "events.delete";
3851
4495
  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";
3852
4496
  entity_lifecycle: "active" | "retired" | "deleted";
4497
+ health_item: "healthy" | "repairable" | "unrepairable";
3853
4498
  herd_invitation_status: "pending" | "accepted" | "revoked" | "expired";
3854
4499
  media_type: "image" | "video" | "audio" | "text";
3855
4500
  plan_type: "mission" | "fence" | "rally" | "markov";
@@ -4014,11 +4659,6 @@ export type Database = {
4014
4659
  slug: string | null;
4015
4660
  description: string | null;
4016
4661
  is_public: boolean | null;
4017
- earthranger_domain: string | null;
4018
- earthranger_token: string | null;
4019
- video_publisher_token: string | null;
4020
- video_subscriber_token: string | null;
4021
- video_server_url: string | null;
4022
4662
  location: string | null;
4023
4663
  latitude: number | null;
4024
4664
  longitude: number | null;
@@ -4176,6 +4816,7 @@ export declare const Constants: {
4176
4816
  readonly app_permission: readonly ["herds.delete", "events.delete"];
4177
4817
  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"];
4178
4818
  readonly entity_lifecycle: readonly ["active", "retired", "deleted"];
4819
+ readonly health_item: readonly ["healthy", "repairable", "unrepairable"];
4179
4820
  readonly herd_invitation_status: readonly ["pending", "accepted", "revoked", "expired"];
4180
4821
  readonly media_type: readonly ["image", "video", "audio", "text"];
4181
4822
  readonly plan_type: readonly ["mission", "fence", "rally", "markov"];