@adventurelabs/scout-core 1.4.74 → 1.4.75

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.
@@ -1,3539 +1,34 @@
1
1
  import { type UseScoutRefreshOptions } from "../hooks/useScoutRefresh";
2
- import { ReactNode } from "react";
2
+ import { type ReactNode } from "react";
3
3
  import { SupabaseClient } from "@supabase/supabase-js";
4
4
  import { Database } from "../types/supabase";
5
- interface ConnectionStatus {
6
- isConnected: boolean;
7
- isConnecting: boolean;
8
- lastError: string | null;
9
- retryCount: number;
10
- reconnect: () => void;
5
+ import { IClientAbilitiesTokenMint } from "../types/client_abilities_token";
6
+ export interface ClientAbilitiesMintState {
7
+ /** Set only after jose verification against DB pubkeys. */
8
+ mint: IClientAbilitiesTokenMint | null;
9
+ isLoading: boolean;
10
+ error: string | null;
11
+ refreshMint: () => Promise<void>;
11
12
  }
12
- export declare function useSupabase(): SupabaseClient<Database, "public", "public", {
13
- Tables: {
14
- actions: {
15
- Row: {
16
- id: number;
17
- inserted_at: string;
18
- opcode: number;
19
- trigger: string[];
20
- zone_id: number;
21
- };
22
- Insert: {
23
- id?: number;
24
- inserted_at?: string;
25
- opcode: number;
26
- trigger: string[];
27
- zone_id: number;
28
- };
29
- Update: {
30
- id?: number;
31
- inserted_at?: string;
32
- opcode?: number;
33
- trigger?: string[];
34
- zone_id?: number;
35
- };
36
- Relationships: [{
37
- foreignKeyName: "actions_zone_id_fkey";
38
- columns: ["zone_id"];
39
- isOneToOne: false;
40
- referencedRelation: "zones";
41
- referencedColumns: ["id"];
42
- }, {
43
- foreignKeyName: "actions_zone_id_fkey";
44
- columns: ["zone_id"];
45
- isOneToOne: false;
46
- referencedRelation: "zones_and_actions";
47
- referencedColumns: ["id"];
48
- }];
49
- };
50
- analysis_jobs: {
51
- Row: {
52
- id: number;
53
- inserted_at: string;
54
- job_type: string;
55
- status: Database["public"]["Enums"]["analysis_work_status"];
56
- timestamp_finished: string | null;
57
- timestamp_requested: string;
58
- timestamp_started: string | null;
59
- };
60
- Insert: {
61
- id?: number;
62
- inserted_at?: string;
63
- job_type?: string;
64
- status?: Database["public"]["Enums"]["analysis_work_status"];
65
- timestamp_finished?: string | null;
66
- timestamp_requested?: string;
67
- timestamp_started?: string | null;
68
- };
69
- Update: {
70
- id?: number;
71
- inserted_at?: string;
72
- job_type?: string;
73
- status?: Database["public"]["Enums"]["analysis_work_status"];
74
- timestamp_finished?: string | null;
75
- timestamp_requested?: string;
76
- timestamp_started?: string | null;
77
- };
78
- Relationships: [];
79
- };
80
- analysis_tasks: {
81
- Row: {
82
- artifact_id: number | null;
83
- cpu_core_seconds: number | null;
84
- cpu_memory_avg: number | null;
85
- event_id: number | null;
86
- execution_environment: string;
87
- frames_processed: number | null;
88
- gpu_memory_peak: number | null;
89
- gpu_seconds: number | null;
90
- id: number;
91
- job_id: number;
92
- model: string | null;
93
- status: Database["public"]["Enums"]["analysis_work_status"];
94
- task_type: string;
95
- time_finished: string | null;
96
- time_started: string | null;
97
- };
98
- Insert: {
99
- artifact_id?: number | null;
100
- cpu_core_seconds?: number | null;
101
- cpu_memory_avg?: number | null;
102
- event_id?: number | null;
103
- execution_environment: string;
104
- frames_processed?: number | null;
105
- gpu_memory_peak?: number | null;
106
- gpu_seconds?: number | null;
107
- id?: number;
108
- job_id: number;
109
- model?: string | null;
110
- status?: Database["public"]["Enums"]["analysis_work_status"];
111
- task_type: string;
112
- time_finished?: string | null;
113
- time_started?: string | null;
114
- };
115
- Update: {
116
- artifact_id?: number | null;
117
- cpu_core_seconds?: number | null;
118
- cpu_memory_avg?: number | null;
119
- event_id?: number | null;
120
- execution_environment?: string;
121
- frames_processed?: number | null;
122
- gpu_memory_peak?: number | null;
123
- gpu_seconds?: number | null;
124
- id?: number;
125
- job_id?: number;
126
- model?: string | null;
127
- status?: Database["public"]["Enums"]["analysis_work_status"];
128
- task_type?: string;
129
- time_finished?: string | null;
130
- time_started?: string | null;
131
- };
132
- Relationships: [{
133
- foreignKeyName: "analysis_tasks_artifact_id_fkey";
134
- columns: ["artifact_id"];
135
- isOneToOne: false;
136
- referencedRelation: "artifacts";
137
- referencedColumns: ["id"];
138
- }, {
139
- foreignKeyName: "analysis_tasks_event_id_fkey";
140
- columns: ["event_id"];
141
- isOneToOne: false;
142
- referencedRelation: "events";
143
- referencedColumns: ["id"];
144
- }, {
145
- foreignKeyName: "analysis_tasks_event_id_fkey";
146
- columns: ["event_id"];
147
- isOneToOne: false;
148
- referencedRelation: "events_with_tags";
149
- referencedColumns: ["id"];
150
- }, {
151
- foreignKeyName: "analysis_tasks_event_id_fkey";
152
- columns: ["event_id"];
153
- isOneToOne: false;
154
- referencedRelation: "events_with_tags_by_session";
155
- referencedColumns: ["id"];
156
- }, {
157
- foreignKeyName: "analysis_tasks_job_id_fkey";
158
- columns: ["job_id"];
159
- isOneToOne: false;
160
- referencedRelation: "analysis_jobs";
161
- referencedColumns: ["id"];
162
- }];
163
- };
164
- artifacts: {
165
- Row: {
166
- created_at: string;
167
- device_id: number;
168
- embedded_at: string | null;
169
- file_path: string;
170
- file_size_bytes: number | null;
171
- id: number;
172
- lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
173
- lifecycle_changed_at: string;
174
- lifecycle_changed_by: string | null;
175
- lifecycle_reason: string | null;
176
- modality: string | null;
177
- segmented_at: string | null;
178
- session_id: number | null;
179
- tagged_at: string | null;
180
- timestamp_observation: string | null;
181
- timestamp_observation_end: string;
182
- tracked_at: string | null;
183
- updated_at: string | null;
184
- };
185
- Insert: {
186
- created_at?: string;
187
- device_id: number;
188
- embedded_at?: string | null;
189
- file_path: string;
190
- file_size_bytes?: number | null;
191
- id?: number;
192
- lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
193
- lifecycle_changed_at?: string;
194
- lifecycle_changed_by?: string | null;
195
- lifecycle_reason?: string | null;
196
- modality?: string | null;
197
- segmented_at?: string | null;
198
- session_id?: number | null;
199
- tagged_at?: string | null;
200
- timestamp_observation?: string | null;
201
- timestamp_observation_end?: string;
202
- tracked_at?: string | null;
203
- updated_at?: string | null;
204
- };
205
- Update: {
206
- created_at?: string;
207
- device_id?: number;
208
- embedded_at?: string | null;
209
- file_path?: string;
210
- file_size_bytes?: number | null;
211
- id?: number;
212
- lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
213
- lifecycle_changed_at?: string;
214
- lifecycle_changed_by?: string | null;
215
- lifecycle_reason?: string | null;
216
- modality?: string | null;
217
- segmented_at?: string | null;
218
- session_id?: number | null;
219
- tagged_at?: string | null;
220
- timestamp_observation?: string | null;
221
- timestamp_observation_end?: string;
222
- tracked_at?: string | null;
223
- updated_at?: string | null;
224
- };
225
- Relationships: [{
226
- foreignKeyName: "artifacts_device_id_fkey";
227
- columns: ["device_id"];
228
- isOneToOne: false;
229
- referencedRelation: "devices";
230
- referencedColumns: ["id"];
231
- }, {
232
- foreignKeyName: "artifacts_lifecycle_changed_by_fkey";
233
- columns: ["lifecycle_changed_by"];
234
- isOneToOne: false;
235
- referencedRelation: "users";
236
- referencedColumns: ["id"];
237
- }, {
238
- foreignKeyName: "artifacts_session_id_fkey";
239
- columns: ["session_id"];
240
- isOneToOne: false;
241
- referencedRelation: "sessions";
242
- referencedColumns: ["id"];
243
- }];
244
- };
245
- certificates: {
246
- Row: {
247
- created_at: string;
248
- expiration: string | null;
249
- id: number;
250
- issuer: string;
251
- part_id: number | null;
252
- tracking_number: string | null;
253
- type: string;
254
- updated_at: string | null;
255
- };
256
- Insert: {
257
- created_at?: string;
258
- expiration?: string | null;
259
- id?: number;
260
- issuer: string;
261
- part_id?: number | null;
262
- tracking_number?: string | null;
263
- type: string;
264
- updated_at?: string | null;
265
- };
266
- Update: {
267
- created_at?: string;
268
- expiration?: string | null;
269
- id?: number;
270
- issuer?: string;
271
- part_id?: number | null;
272
- tracking_number?: string | null;
273
- type?: string;
274
- updated_at?: string | null;
275
- };
276
- Relationships: [{
277
- foreignKeyName: "certificates_part_id_fkey";
278
- columns: ["part_id"];
279
- isOneToOne: false;
280
- referencedRelation: "parts";
281
- referencedColumns: ["id"];
282
- }];
283
- };
284
- chat: {
285
- Row: {
286
- created_at: string;
287
- herd_id: number;
288
- id: number;
289
- message: string;
290
- sender: string | null;
291
- };
292
- Insert: {
293
- created_at?: string;
294
- herd_id: number;
295
- id?: number;
296
- message: string;
297
- sender?: string | null;
298
- };
299
- Update: {
300
- created_at?: string;
301
- herd_id?: number;
302
- id?: number;
303
- message?: string;
304
- sender?: string | null;
305
- };
306
- Relationships: [{
307
- foreignKeyName: "chat_herd_id_fkey";
308
- columns: ["herd_id"];
309
- isOneToOne: false;
310
- referencedRelation: "herds";
311
- referencedColumns: ["id"];
312
- }, {
313
- foreignKeyName: "chat_sender_fkey";
314
- columns: ["sender"];
315
- isOneToOne: false;
316
- referencedRelation: "users";
317
- referencedColumns: ["id"];
318
- }];
319
- };
320
- connectivity: {
321
- Row: {
322
- altitude: number;
323
- associated_station: string | null;
324
- bandwidth_hz: number | null;
325
- battery_percentage: number | null;
326
- battery_volts: number | null;
327
- device_id: number | null;
328
- frequency_hz: number | null;
329
- h11_index: string;
330
- h12_index: string;
331
- h13_index: string;
332
- h14_index: string;
333
- heading: number;
334
- id: number;
335
- inserted_at: string;
336
- location: unknown;
337
- mode: string | null;
338
- noise: number;
339
- session_id: number | null;
340
- signal: number;
341
- timestamp_start: string;
342
- };
343
- Insert: {
344
- altitude: number;
345
- associated_station?: string | null;
346
- bandwidth_hz?: number | null;
347
- battery_percentage?: number | null;
348
- battery_volts?: number | null;
349
- device_id?: number | null;
350
- frequency_hz?: number | null;
351
- h11_index: string;
352
- h12_index: string;
353
- h13_index: string;
354
- h14_index: string;
355
- heading: number;
356
- id?: number;
357
- inserted_at?: string;
358
- location: unknown;
359
- mode?: string | null;
360
- noise: number;
361
- session_id?: number | null;
362
- signal: number;
363
- timestamp_start: string;
364
- };
365
- Update: {
366
- altitude?: number;
367
- associated_station?: string | null;
368
- bandwidth_hz?: number | null;
369
- battery_percentage?: number | null;
370
- battery_volts?: number | null;
371
- device_id?: number | null;
372
- frequency_hz?: number | null;
373
- h11_index?: string;
374
- h12_index?: string;
375
- h13_index?: string;
376
- h14_index?: string;
377
- heading?: number;
378
- id?: number;
379
- inserted_at?: string;
380
- location?: unknown;
381
- mode?: string | null;
382
- noise?: number;
383
- session_id?: number | null;
384
- signal?: number;
385
- timestamp_start?: string;
386
- };
387
- Relationships: [{
388
- foreignKeyName: "connectivity_device_id_fkey";
389
- columns: ["device_id"];
390
- isOneToOne: false;
391
- referencedRelation: "devices";
392
- referencedColumns: ["id"];
393
- }, {
394
- foreignKeyName: "connectivity_session_id_fkey";
395
- columns: ["session_id"];
396
- isOneToOne: false;
397
- referencedRelation: "sessions";
398
- referencedColumns: ["id"];
399
- }];
400
- };
401
- credentials: {
402
- Row: {
403
- created_at: string;
404
- expiration: string | null;
405
- id: number;
406
- issuer: string;
407
- tracking_number: string | null;
408
- type: string;
409
- updated_at: string | null;
410
- user_id: string;
411
- };
412
- Insert: {
413
- created_at?: string;
414
- expiration?: string | null;
415
- id?: number;
416
- issuer: string;
417
- tracking_number?: string | null;
418
- type: string;
419
- updated_at?: string | null;
420
- user_id: string;
421
- };
422
- Update: {
423
- created_at?: string;
424
- expiration?: string | null;
425
- id?: number;
426
- issuer?: string;
427
- tracking_number?: string | null;
428
- type?: string;
429
- updated_at?: string | null;
430
- user_id?: string;
431
- };
432
- Relationships: [{
433
- foreignKeyName: "credentials_user_id_fkey";
434
- columns: ["user_id"];
435
- isOneToOne: false;
436
- referencedRelation: "users";
437
- referencedColumns: ["id"];
438
- }];
439
- };
440
- devices: {
441
- Row: {
442
- altitude: number | null;
443
- color: string | null;
444
- created_by: string;
445
- description: string;
446
- device_type: Database["public"]["Enums"]["device_type"];
447
- domain_name: string | null;
448
- heading: number | null;
449
- herd_id: number;
450
- id: number;
451
- inserted_at: string;
452
- lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
453
- lifecycle_changed_at: string;
454
- lifecycle_changed_by: string | null;
455
- lifecycle_reason: string | null;
456
- location: unknown;
457
- name: string;
458
- };
459
- Insert: {
460
- altitude?: number | null;
461
- color?: string | null;
462
- created_by: string;
463
- description: string;
464
- device_type?: Database["public"]["Enums"]["device_type"];
465
- domain_name?: string | null;
466
- heading?: number | null;
467
- herd_id: number;
468
- id?: number;
469
- inserted_at?: string;
470
- lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
471
- lifecycle_changed_at?: string;
472
- lifecycle_changed_by?: string | null;
473
- lifecycle_reason?: string | null;
474
- location?: unknown;
475
- name: string;
476
- };
477
- Update: {
478
- altitude?: number | null;
479
- color?: string | null;
480
- created_by?: string;
481
- description?: string;
482
- device_type?: Database["public"]["Enums"]["device_type"];
483
- domain_name?: string | null;
484
- heading?: number | null;
485
- herd_id?: number;
486
- id?: number;
487
- inserted_at?: string;
488
- lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
489
- lifecycle_changed_at?: string;
490
- lifecycle_changed_by?: string | null;
491
- lifecycle_reason?: string | null;
492
- location?: unknown;
493
- name?: string;
494
- };
495
- Relationships: [{
496
- foreignKeyName: "devices_created_by_fkey";
497
- columns: ["created_by"];
498
- isOneToOne: false;
499
- referencedRelation: "users";
500
- referencedColumns: ["id"];
501
- }, {
502
- foreignKeyName: "devices_herd_id_fkey";
503
- columns: ["herd_id"];
504
- isOneToOne: false;
505
- referencedRelation: "herds";
506
- referencedColumns: ["id"];
507
- }, {
508
- foreignKeyName: "devices_lifecycle_changed_by_fkey";
509
- columns: ["lifecycle_changed_by"];
510
- isOneToOne: false;
511
- referencedRelation: "users";
512
- referencedColumns: ["id"];
513
- }];
514
- };
515
- embeddings_vertex_multimodal_001: {
516
- Row: {
517
- artifact_id: number | null;
518
- created_at: string;
519
- embedding: string;
520
- event_id: number | null;
521
- frame_index: number;
522
- id: number;
523
- origin_heading: number | null;
524
- origin_height: number | null;
525
- origin_location: unknown;
526
- origin_pitch: number | null;
527
- origin_roll: number | null;
528
- sensor_pitch: number | null;
529
- sensor_roll: number | null;
530
- sensor_yaw: number | null;
531
- timestamp_observation: string | null;
532
- };
533
- Insert: {
534
- artifact_id?: number | null;
535
- created_at?: string;
536
- embedding: string;
537
- event_id?: number | null;
538
- frame_index?: number;
539
- id?: number;
540
- origin_heading?: number | null;
541
- origin_height?: number | null;
542
- origin_location?: unknown;
543
- origin_pitch?: number | null;
544
- origin_roll?: number | null;
545
- sensor_pitch?: number | null;
546
- sensor_roll?: number | null;
547
- sensor_yaw?: number | null;
548
- timestamp_observation?: string | null;
549
- };
550
- Update: {
551
- artifact_id?: number | null;
552
- created_at?: string;
553
- embedding?: string;
554
- event_id?: number | null;
555
- frame_index?: number;
556
- id?: number;
557
- origin_heading?: number | null;
558
- origin_height?: number | null;
559
- origin_location?: unknown;
560
- origin_pitch?: number | null;
561
- origin_roll?: number | null;
562
- sensor_pitch?: number | null;
563
- sensor_roll?: number | null;
564
- sensor_yaw?: number | null;
565
- timestamp_observation?: string | null;
566
- };
567
- Relationships: [{
568
- foreignKeyName: "embeddings_vertex_multimodal_001_artifact_id_fkey";
569
- columns: ["artifact_id"];
570
- isOneToOne: false;
571
- referencedRelation: "artifacts";
572
- referencedColumns: ["id"];
573
- }, {
574
- foreignKeyName: "embeddings_vertex_multimodal_001_event_id_fkey";
575
- columns: ["event_id"];
576
- isOneToOne: false;
577
- referencedRelation: "events";
578
- referencedColumns: ["id"];
579
- }, {
580
- foreignKeyName: "embeddings_vertex_multimodal_001_event_id_fkey";
581
- columns: ["event_id"];
582
- isOneToOne: false;
583
- referencedRelation: "events_with_tags";
584
- referencedColumns: ["id"];
585
- }, {
586
- foreignKeyName: "embeddings_vertex_multimodal_001_event_id_fkey";
587
- columns: ["event_id"];
588
- isOneToOne: false;
589
- referencedRelation: "events_with_tags_by_session";
590
- referencedColumns: ["id"];
591
- }];
592
- };
593
- events: {
594
- Row: {
595
- altitude: number;
596
- device_id: number;
597
- earthranger_url: string | null;
598
- embedded_at: string | null;
599
- file_path: string | null;
600
- heading: number;
601
- id: number;
602
- inserted_at: string;
603
- is_public: boolean;
604
- lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
605
- lifecycle_changed_at: string;
606
- lifecycle_changed_by: string | null;
607
- lifecycle_reason: string | null;
608
- location: unknown;
609
- media_type: Database["public"]["Enums"]["media_type"];
610
- media_url: string | null;
611
- message: string | null;
612
- segmented_at: string | null;
613
- session_id: number | null;
614
- tagged_at: string | null;
615
- timestamp_observation: string;
616
- tracked_at: string | null;
617
- };
618
- Insert: {
619
- altitude?: number;
620
- device_id: number;
621
- earthranger_url?: string | null;
622
- embedded_at?: string | null;
623
- file_path?: string | null;
624
- heading?: number;
625
- id?: number;
626
- inserted_at?: string;
627
- is_public?: boolean;
628
- lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
629
- lifecycle_changed_at?: string;
630
- lifecycle_changed_by?: string | null;
631
- lifecycle_reason?: string | null;
632
- location?: unknown;
633
- media_type?: Database["public"]["Enums"]["media_type"];
634
- media_url?: string | null;
635
- message?: string | null;
636
- segmented_at?: string | null;
637
- session_id?: number | null;
638
- tagged_at?: string | null;
639
- timestamp_observation?: string;
640
- tracked_at?: string | null;
641
- };
642
- Update: {
643
- altitude?: number;
644
- device_id?: number;
645
- earthranger_url?: string | null;
646
- embedded_at?: string | null;
647
- file_path?: string | null;
648
- heading?: number;
649
- id?: number;
650
- inserted_at?: string;
651
- is_public?: boolean;
652
- lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
653
- lifecycle_changed_at?: string;
654
- lifecycle_changed_by?: string | null;
655
- lifecycle_reason?: string | null;
656
- location?: unknown;
657
- media_type?: Database["public"]["Enums"]["media_type"];
658
- media_url?: string | null;
659
- message?: string | null;
660
- segmented_at?: string | null;
661
- session_id?: number | null;
662
- tagged_at?: string | null;
663
- timestamp_observation?: string;
664
- tracked_at?: string | null;
665
- };
666
- Relationships: [{
667
- foreignKeyName: "events_device_id_fkey";
668
- columns: ["device_id"];
669
- isOneToOne: false;
670
- referencedRelation: "devices";
671
- referencedColumns: ["id"];
672
- }, {
673
- foreignKeyName: "events_lifecycle_changed_by_fkey";
674
- columns: ["lifecycle_changed_by"];
675
- isOneToOne: false;
676
- referencedRelation: "users";
677
- referencedColumns: ["id"];
678
- }, {
679
- foreignKeyName: "events_session_id_fkey";
680
- columns: ["session_id"];
681
- isOneToOne: false;
682
- referencedRelation: "sessions";
683
- referencedColumns: ["id"];
684
- }];
685
- };
686
- health_metrics: {
687
- Row: {
688
- created_at: string;
689
- device_id: number;
690
- id: number;
691
- metric_name: string;
692
- source: string | null;
693
- timestamp: string;
694
- unit: string | null;
695
- value: number;
696
- };
697
- Insert: {
698
- created_at?: string;
699
- device_id: number;
700
- id?: number;
701
- metric_name: string;
702
- source?: string | null;
703
- timestamp: string;
704
- unit?: string | null;
705
- value: number;
706
- };
707
- Update: {
708
- created_at?: string;
709
- device_id?: number;
710
- id?: number;
711
- metric_name?: string;
712
- source?: string | null;
713
- timestamp?: string;
714
- unit?: string | null;
715
- value?: number;
716
- };
717
- Relationships: [{
718
- foreignKeyName: "health_metrics_device_id_fkey";
719
- columns: ["device_id"];
720
- isOneToOne: false;
721
- referencedRelation: "devices";
722
- referencedColumns: ["id"];
723
- }];
724
- };
725
- heartbeats: {
726
- Row: {
727
- created_at: string;
728
- device_id: number;
729
- id: number;
730
- timestamp: string;
731
- };
732
- Insert: {
733
- created_at?: string;
734
- device_id: number;
735
- id?: number;
736
- timestamp: string;
737
- };
738
- Update: {
739
- created_at?: string;
740
- device_id?: number;
741
- id?: number;
742
- timestamp?: string;
743
- };
744
- Relationships: [{
745
- foreignKeyName: "heartbeats_device_id_fkey";
746
- columns: ["device_id"];
747
- isOneToOne: false;
748
- referencedRelation: "devices";
749
- referencedColumns: ["id"];
750
- }];
751
- };
752
- herd_allowed_domains: {
753
- Row: {
754
- created_at: string;
755
- domain: string;
756
- herd_id: number;
757
- id: number;
758
- lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
759
- lifecycle_changed_at: string;
760
- lifecycle_changed_by: string | null;
761
- lifecycle_reason: string | null;
762
- };
763
- Insert: {
764
- created_at?: string;
765
- domain: string;
766
- herd_id: number;
767
- id?: number;
768
- lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
769
- lifecycle_changed_at?: string;
770
- lifecycle_changed_by?: string | null;
771
- lifecycle_reason?: string | null;
772
- };
773
- Update: {
774
- created_at?: string;
775
- domain?: string;
776
- herd_id?: number;
777
- id?: number;
778
- lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
779
- lifecycle_changed_at?: string;
780
- lifecycle_changed_by?: string | null;
781
- lifecycle_reason?: string | null;
782
- };
783
- Relationships: [{
784
- foreignKeyName: "herd_allowed_domains_herd_id_fkey";
785
- columns: ["herd_id"];
786
- isOneToOne: false;
787
- referencedRelation: "herds";
788
- referencedColumns: ["id"];
789
- }, {
790
- foreignKeyName: "herd_allowed_domains_lifecycle_changed_by_fkey";
791
- columns: ["lifecycle_changed_by"];
792
- isOneToOne: false;
793
- referencedRelation: "users";
794
- referencedColumns: ["id"];
795
- }];
796
- };
797
- herd_invitations: {
798
- Row: {
799
- accepted_at: string | null;
800
- created_at: string;
801
- email: string;
802
- expires_at: string | null;
803
- herd_id: number;
804
- id: number;
805
- invited_by: string;
806
- role: Database["public"]["Enums"]["role"];
807
- status: Database["public"]["Enums"]["herd_invitation_status"];
808
- };
809
- Insert: {
810
- accepted_at?: string | null;
811
- created_at?: string;
812
- email: string;
813
- expires_at?: string | null;
814
- herd_id: number;
815
- id?: number;
816
- invited_by: string;
817
- role: Database["public"]["Enums"]["role"];
818
- status?: Database["public"]["Enums"]["herd_invitation_status"];
819
- };
820
- Update: {
821
- accepted_at?: string | null;
822
- created_at?: string;
823
- email?: string;
824
- expires_at?: string | null;
825
- herd_id?: number;
826
- id?: number;
827
- invited_by?: string;
828
- role?: Database["public"]["Enums"]["role"];
829
- status?: Database["public"]["Enums"]["herd_invitation_status"];
830
- };
831
- Relationships: [{
832
- foreignKeyName: "herd_invitations_herd_id_fkey";
833
- columns: ["herd_id"];
834
- isOneToOne: false;
835
- referencedRelation: "herds";
836
- referencedColumns: ["id"];
837
- }, {
838
- foreignKeyName: "herd_invitations_invited_by_fkey";
839
- columns: ["invited_by"];
840
- isOneToOne: false;
841
- referencedRelation: "users";
842
- referencedColumns: ["id"];
843
- }];
844
- };
845
- herds: {
846
- Row: {
847
- auto_delete_media_with_humans: boolean | null;
848
- auto_delete_media_with_no_tracks: boolean | null;
849
- description: string;
850
- earthranger_domain: string | null;
851
- earthranger_token: string | null;
852
- id: number;
853
- inserted_at: string;
854
- is_public: boolean;
855
- location: unknown;
856
- slug: string;
857
- video_publisher_token: string | null;
858
- video_server_url: string | null;
859
- video_subscriber_token: string | null;
860
- };
861
- Insert: {
862
- auto_delete_media_with_humans?: boolean | null;
863
- auto_delete_media_with_no_tracks?: boolean | null;
864
- description: string;
865
- earthranger_domain?: string | null;
866
- earthranger_token?: string | null;
867
- id?: number;
868
- inserted_at?: string;
869
- is_public?: boolean;
870
- location?: unknown;
871
- slug: string;
872
- video_publisher_token?: string | null;
873
- video_server_url?: string | null;
874
- video_subscriber_token?: string | null;
875
- };
876
- Update: {
877
- auto_delete_media_with_humans?: boolean | null;
878
- auto_delete_media_with_no_tracks?: boolean | null;
879
- description?: string;
880
- earthranger_domain?: string | null;
881
- earthranger_token?: string | null;
882
- id?: number;
883
- inserted_at?: string;
884
- is_public?: boolean;
885
- location?: unknown;
886
- slug?: string;
887
- video_publisher_token?: string | null;
888
- video_server_url?: string | null;
889
- video_subscriber_token?: string | null;
890
- };
891
- Relationships: [];
892
- };
893
- layers: {
894
- Row: {
895
- created_at: string;
896
- features: import("../types/supabase").Json;
897
- herd_id: number;
898
- id: number;
899
- };
900
- Insert: {
901
- created_at?: string;
902
- features: import("../types/supabase").Json;
903
- herd_id: number;
904
- id?: number;
905
- };
906
- Update: {
907
- created_at?: string;
908
- features?: import("../types/supabase").Json;
909
- herd_id?: number;
910
- id?: number;
911
- };
912
- Relationships: [{
913
- foreignKeyName: "layers_herd_id_fkey";
914
- columns: ["herd_id"];
915
- isOneToOne: false;
916
- referencedRelation: "herds";
917
- referencedColumns: ["id"];
918
- }];
919
- };
920
- maintenance: {
921
- Row: {
922
- created_at: string;
923
- description: string | null;
924
- id: number;
925
- part_id: number;
926
- timestamp_completion: string;
927
- type: string | null;
928
- updated_at: string | null;
929
- };
930
- Insert: {
931
- created_at?: string;
932
- description?: string | null;
933
- id?: number;
934
- part_id: number;
935
- timestamp_completion: string;
936
- type?: string | null;
937
- updated_at?: string | null;
938
- };
939
- Update: {
940
- created_at?: string;
941
- description?: string | null;
942
- id?: number;
943
- part_id?: number;
944
- timestamp_completion?: string;
945
- type?: string | null;
946
- updated_at?: string | null;
947
- };
948
- Relationships: [{
949
- foreignKeyName: "maintenance_part_id_fkey";
950
- columns: ["part_id"];
951
- isOneToOne: false;
952
- referencedRelation: "parts";
953
- referencedColumns: ["id"];
954
- }];
955
- };
956
- observations: {
957
- Row: {
958
- action_complete: boolean;
959
- action_required: string | null;
960
- description: string;
961
- id: number;
962
- inserted_at: string;
963
- session_id: number;
964
- timestamp: string | null;
965
- updated_at: string | null;
966
- };
967
- Insert: {
968
- action_complete?: boolean;
969
- action_required?: string | null;
970
- description: string;
971
- id?: number;
972
- inserted_at?: string;
973
- session_id: number;
974
- timestamp?: string | null;
975
- updated_at?: string | null;
976
- };
977
- Update: {
978
- action_complete?: boolean;
979
- action_required?: string | null;
980
- description?: string;
981
- id?: number;
982
- inserted_at?: string;
983
- session_id?: number;
984
- timestamp?: string | null;
985
- updated_at?: string | null;
986
- };
987
- Relationships: [{
988
- foreignKeyName: "observations_session_id_fkey";
989
- columns: ["session_id"];
990
- isOneToOne: false;
991
- referencedRelation: "sessions";
992
- referencedColumns: ["id"];
993
- }];
994
- };
995
- operators: {
996
- Row: {
997
- action: string | null;
998
- created_at: string;
999
- id: number;
1000
- session_id: number | null;
1001
- timestamp: string | null;
1002
- user_id: string;
1003
- };
1004
- Insert: {
1005
- action?: string | null;
1006
- created_at?: string;
1007
- id?: number;
1008
- session_id?: number | null;
1009
- timestamp?: string | null;
1010
- user_id: string;
1011
- };
1012
- Update: {
1013
- action?: string | null;
1014
- created_at?: string;
1015
- id?: number;
1016
- session_id?: number | null;
1017
- timestamp?: string | null;
1018
- user_id?: string;
1019
- };
1020
- Relationships: [{
1021
- foreignKeyName: "operators_session_id_fkey";
1022
- columns: ["session_id"];
1023
- isOneToOne: false;
1024
- referencedRelation: "sessions";
1025
- referencedColumns: ["id"];
1026
- }, {
1027
- foreignKeyName: "operators_user_id_fkey";
1028
- columns: ["user_id"];
1029
- isOneToOne: false;
1030
- referencedRelation: "users";
1031
- referencedColumns: ["id"];
1032
- }];
1033
- };
1034
- parts: {
1035
- Row: {
1036
- certificate_id: number | null;
1037
- created_at: string;
1038
- device_id: number;
1039
- id: number;
1040
- lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
1041
- lifecycle_changed_at: string;
1042
- lifecycle_changed_by: string | null;
1043
- lifecycle_reason: string | null;
1044
- product_number: string;
1045
- serial_number: string;
1046
- updated_at: string | null;
1047
- };
1048
- Insert: {
1049
- certificate_id?: number | null;
1050
- created_at?: string;
1051
- device_id: number;
1052
- id?: number;
1053
- lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
1054
- lifecycle_changed_at?: string;
1055
- lifecycle_changed_by?: string | null;
1056
- lifecycle_reason?: string | null;
1057
- product_number: string;
1058
- serial_number: string;
1059
- updated_at?: string | null;
1060
- };
1061
- Update: {
1062
- certificate_id?: number | null;
1063
- created_at?: string;
1064
- device_id?: number;
1065
- id?: number;
1066
- lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
1067
- lifecycle_changed_at?: string;
1068
- lifecycle_changed_by?: string | null;
1069
- lifecycle_reason?: string | null;
1070
- product_number?: string;
1071
- serial_number?: string;
1072
- updated_at?: string | null;
1073
- };
1074
- Relationships: [{
1075
- foreignKeyName: "parts_certificate_id_fkey";
1076
- columns: ["certificate_id"];
1077
- isOneToOne: false;
1078
- referencedRelation: "certificates";
1079
- referencedColumns: ["id"];
1080
- }, {
1081
- foreignKeyName: "parts_device_id_fkey";
1082
- columns: ["device_id"];
1083
- isOneToOne: false;
1084
- referencedRelation: "devices";
1085
- referencedColumns: ["id"];
1086
- }, {
1087
- foreignKeyName: "parts_lifecycle_changed_by_fkey";
1088
- columns: ["lifecycle_changed_by"];
1089
- isOneToOne: false;
1090
- referencedRelation: "users";
1091
- referencedColumns: ["id"];
1092
- }];
1093
- };
1094
- pins: {
1095
- Row: {
1096
- altitude_relative_to_ground: number;
1097
- color: string;
1098
- created_at: string;
1099
- created_by: string | null;
1100
- description: string | null;
1101
- herd_id: number;
1102
- id: number;
1103
- location: unknown;
1104
- name: string;
1105
- };
1106
- Insert: {
1107
- altitude_relative_to_ground: number;
1108
- color: string;
1109
- created_at?: string;
1110
- created_by?: string | null;
1111
- description?: string | null;
1112
- herd_id: number;
1113
- id?: number;
1114
- location?: unknown;
1115
- name: string;
1116
- };
1117
- Update: {
1118
- altitude_relative_to_ground?: number;
1119
- color?: string;
1120
- created_at?: string;
1121
- created_by?: string | null;
1122
- description?: string | null;
1123
- herd_id?: number;
1124
- id?: number;
1125
- location?: unknown;
1126
- name?: string;
1127
- };
1128
- Relationships: [{
1129
- foreignKeyName: "pins_created_by_fkey";
1130
- columns: ["created_by"];
1131
- isOneToOne: false;
1132
- referencedRelation: "users";
1133
- referencedColumns: ["id"];
1134
- }, {
1135
- foreignKeyName: "pins_herd_id_fkey";
1136
- columns: ["herd_id"];
1137
- isOneToOne: false;
1138
- referencedRelation: "herds";
1139
- referencedColumns: ["id"];
1140
- }];
1141
- };
1142
- plans: {
1143
- Row: {
1144
- herd_id: number;
1145
- id: number;
1146
- inserted_at: string | null;
1147
- instructions: string;
1148
- name: string;
1149
- plan_type: Database["public"]["Enums"]["plan_type"];
1150
- };
1151
- Insert: {
1152
- herd_id: number;
1153
- id?: number;
1154
- inserted_at?: string | null;
1155
- instructions: string;
1156
- name: string;
1157
- plan_type?: Database["public"]["Enums"]["plan_type"];
1158
- };
1159
- Update: {
1160
- herd_id?: number;
1161
- id?: number;
1162
- inserted_at?: string | null;
1163
- instructions?: string;
1164
- name?: string;
1165
- plan_type?: Database["public"]["Enums"]["plan_type"];
1166
- };
1167
- Relationships: [{
1168
- foreignKeyName: "plans_herd_id_fkey";
1169
- columns: ["herd_id"];
1170
- isOneToOne: false;
1171
- referencedRelation: "herds";
1172
- referencedColumns: ["id"];
1173
- }];
1174
- };
1175
- platform_superadmins: {
1176
- Row: {
1177
- inserted_at: string;
1178
- user_id: string;
1179
- };
1180
- Insert: {
1181
- inserted_at?: string;
1182
- user_id: string;
1183
- };
1184
- Update: {
1185
- inserted_at?: string;
1186
- user_id?: string;
1187
- };
1188
- Relationships: [{
1189
- foreignKeyName: "platform_superadmins_user_id_fkey";
1190
- columns: ["user_id"];
1191
- isOneToOne: true;
1192
- referencedRelation: "users";
1193
- referencedColumns: ["id"];
1194
- }];
1195
- };
1196
- providers: {
1197
- Row: {
1198
- created_at: string;
1199
- herd_id: number;
1200
- id: number;
1201
- key: string | null;
1202
- source: string;
1203
- type: string;
1204
- };
1205
- Insert: {
1206
- created_at?: string;
1207
- herd_id: number;
1208
- id?: number;
1209
- key?: string | null;
1210
- source: string;
1211
- type: string;
1212
- };
1213
- Update: {
1214
- created_at?: string;
1215
- herd_id?: number;
1216
- id?: number;
1217
- key?: string | null;
1218
- source?: string;
1219
- type?: string;
1220
- };
1221
- Relationships: [{
1222
- foreignKeyName: "providers_herd_id_fkey";
1223
- columns: ["herd_id"];
1224
- isOneToOne: false;
1225
- referencedRelation: "herds";
1226
- referencedColumns: ["id"];
1227
- }];
1228
- };
1229
- pubsub_jwt_public_keys: {
1230
- Row: {
1231
- created_at: string;
1232
- kid: string;
1233
- public_jwk: import("../types/supabase").Json;
1234
- revoked_at: string | null;
1235
- };
1236
- Insert: {
1237
- created_at?: string;
1238
- kid: string;
1239
- public_jwk: import("../types/supabase").Json;
1240
- revoked_at?: string | null;
1241
- };
1242
- Update: {
1243
- created_at?: string;
1244
- kid?: string;
1245
- public_jwk?: import("../types/supabase").Json;
1246
- revoked_at?: string | null;
1247
- };
1248
- Relationships: [];
1249
- };
1250
- segmentations_sam3: {
1251
- Row: {
1252
- artifact_id: number | null;
1253
- conf: number | null;
1254
- created_at: string;
1255
- event_id: number | null;
1256
- frame_index: number;
1257
- id: number;
1258
- mask_rle: import("../types/supabase").Json;
1259
- origin_heading: number | null;
1260
- origin_height: number | null;
1261
- origin_location: unknown;
1262
- origin_pitch: number | null;
1263
- origin_roll: number | null;
1264
- sensor_pitch: number | null;
1265
- sensor_roll: number | null;
1266
- sensor_yaw: number | null;
1267
- subject_height: number | null;
1268
- subject_id: number | null;
1269
- subject_location: unknown;
1270
- timestamp_observation: string | null;
1271
- };
1272
- Insert: {
1273
- artifact_id?: number | null;
1274
- conf?: number | null;
1275
- created_at?: string;
1276
- event_id?: number | null;
1277
- frame_index?: number;
1278
- id?: number;
1279
- mask_rle: import("../types/supabase").Json;
1280
- origin_heading?: number | null;
1281
- origin_height?: number | null;
1282
- origin_location?: unknown;
1283
- origin_pitch?: number | null;
1284
- origin_roll?: number | null;
1285
- sensor_pitch?: number | null;
1286
- sensor_roll?: number | null;
1287
- sensor_yaw?: number | null;
1288
- subject_height?: number | null;
1289
- subject_id?: number | null;
1290
- subject_location?: unknown;
1291
- timestamp_observation?: string | null;
1292
- };
1293
- Update: {
1294
- artifact_id?: number | null;
1295
- conf?: number | null;
1296
- created_at?: string;
1297
- event_id?: number | null;
1298
- frame_index?: number;
1299
- id?: number;
1300
- mask_rle?: import("../types/supabase").Json;
1301
- origin_heading?: number | null;
1302
- origin_height?: number | null;
1303
- origin_location?: unknown;
1304
- origin_pitch?: number | null;
1305
- origin_roll?: number | null;
1306
- sensor_pitch?: number | null;
1307
- sensor_roll?: number | null;
1308
- sensor_yaw?: number | null;
1309
- subject_height?: number | null;
1310
- subject_id?: number | null;
1311
- subject_location?: unknown;
1312
- timestamp_observation?: string | null;
1313
- };
1314
- Relationships: [{
1315
- foreignKeyName: "segmentations_sam3_artifact_id_fkey";
1316
- columns: ["artifact_id"];
1317
- isOneToOne: false;
1318
- referencedRelation: "artifacts";
1319
- referencedColumns: ["id"];
1320
- }, {
1321
- foreignKeyName: "segmentations_sam3_event_id_fkey";
1322
- columns: ["event_id"];
1323
- isOneToOne: false;
1324
- referencedRelation: "events";
1325
- referencedColumns: ["id"];
1326
- }, {
1327
- foreignKeyName: "segmentations_sam3_event_id_fkey";
1328
- columns: ["event_id"];
1329
- isOneToOne: false;
1330
- referencedRelation: "events_with_tags";
1331
- referencedColumns: ["id"];
1332
- }, {
1333
- foreignKeyName: "segmentations_sam3_event_id_fkey";
1334
- columns: ["event_id"];
1335
- isOneToOne: false;
1336
- referencedRelation: "events_with_tags_by_session";
1337
- referencedColumns: ["id"];
1338
- }];
1339
- };
1340
- sessions: {
1341
- Row: {
1342
- altitude_average: number;
1343
- altitude_max: number;
1344
- altitude_min: number;
1345
- battery_id: number | null;
1346
- device_id: number;
1347
- distance_max_from_start: number;
1348
- distance_total: number;
1349
- id: number;
1350
- inserted_at: string;
1351
- lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
1352
- lifecycle_changed_at: string;
1353
- lifecycle_changed_by: string | null;
1354
- lifecycle_reason: string | null;
1355
- locations: unknown;
1356
- post_approver: string | null;
1357
- software_version: string;
1358
- timestamp_end: string | null;
1359
- timestamp_start: string;
1360
- velocity_average: number;
1361
- velocity_max: number;
1362
- velocity_min: number;
1363
- };
1364
- Insert: {
1365
- altitude_average: number;
1366
- altitude_max: number;
1367
- altitude_min: number;
1368
- battery_id?: number | null;
1369
- device_id: number;
1370
- distance_max_from_start: number;
1371
- distance_total: number;
1372
- id?: number;
1373
- inserted_at?: string;
1374
- lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
1375
- lifecycle_changed_at?: string;
1376
- lifecycle_changed_by?: string | null;
1377
- lifecycle_reason?: string | null;
1378
- locations?: unknown;
1379
- post_approver?: string | null;
1380
- software_version: string;
1381
- timestamp_end?: string | null;
1382
- timestamp_start: string;
1383
- velocity_average: number;
1384
- velocity_max: number;
1385
- velocity_min: number;
1386
- };
1387
- Update: {
1388
- altitude_average?: number;
1389
- altitude_max?: number;
1390
- altitude_min?: number;
1391
- battery_id?: number | null;
1392
- device_id?: number;
1393
- distance_max_from_start?: number;
1394
- distance_total?: number;
1395
- id?: number;
1396
- inserted_at?: string;
1397
- lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
1398
- lifecycle_changed_at?: string;
1399
- lifecycle_changed_by?: string | null;
1400
- lifecycle_reason?: string | null;
1401
- locations?: unknown;
1402
- post_approver?: string | null;
1403
- software_version?: string;
1404
- timestamp_end?: string | null;
1405
- timestamp_start?: string;
1406
- velocity_average?: number;
1407
- velocity_max?: number;
1408
- velocity_min?: number;
1409
- };
1410
- Relationships: [{
1411
- foreignKeyName: "sessions_battery_id_fkey";
1412
- columns: ["battery_id"];
1413
- isOneToOne: false;
1414
- referencedRelation: "parts";
1415
- referencedColumns: ["id"];
1416
- }, {
1417
- foreignKeyName: "sessions_device_id_fkey";
1418
- columns: ["device_id"];
1419
- isOneToOne: false;
1420
- referencedRelation: "devices";
1421
- referencedColumns: ["id"];
1422
- }, {
1423
- foreignKeyName: "sessions_lifecycle_changed_by_fkey";
1424
- columns: ["lifecycle_changed_by"];
1425
- isOneToOne: false;
1426
- referencedRelation: "users";
1427
- referencedColumns: ["id"];
1428
- }, {
1429
- foreignKeyName: "sessions_post_approver_fkey";
1430
- columns: ["post_approver"];
1431
- isOneToOne: false;
1432
- referencedRelation: "users";
1433
- referencedColumns: ["id"];
1434
- }];
1435
- };
1436
- tags: {
1437
- Row: {
1438
- artifact_id: number | null;
1439
- class: string;
1440
- conf: number;
1441
- detector: string;
1442
- event_id: number | null;
1443
- frame_index: number;
1444
- height: number;
1445
- id: number;
1446
- inserted_at: string;
1447
- observation_type: Database["public"]["Enums"]["tag_observation_type"];
1448
- origin_heading: number | null;
1449
- origin_height: number | null;
1450
- origin_location: unknown;
1451
- origin_pitch: number | null;
1452
- origin_roll: number | null;
1453
- score: number | null;
1454
- score_source: string | null;
1455
- sensor_pitch: number | null;
1456
- sensor_roll: number | null;
1457
- sensor_yaw: number | null;
1458
- subject_height: number | null;
1459
- subject_id: number | null;
1460
- subject_location: unknown;
1461
- timestamp_observation: string | null;
1462
- width: number;
1463
- x: number;
1464
- y: number;
1465
- };
1466
- Insert: {
1467
- artifact_id?: number | null;
1468
- class: string;
1469
- conf: number;
1470
- detector?: string;
1471
- event_id?: number | null;
1472
- frame_index?: number;
1473
- height?: number;
1474
- id?: number;
1475
- inserted_at?: string;
1476
- observation_type: Database["public"]["Enums"]["tag_observation_type"];
1477
- origin_heading?: number | null;
1478
- origin_height?: number | null;
1479
- origin_location?: unknown;
1480
- origin_pitch?: number | null;
1481
- origin_roll?: number | null;
1482
- score?: number | null;
1483
- score_source?: string | null;
1484
- sensor_pitch?: number | null;
1485
- sensor_roll?: number | null;
1486
- sensor_yaw?: number | null;
1487
- subject_height?: number | null;
1488
- subject_id?: number | null;
1489
- subject_location?: unknown;
1490
- timestamp_observation?: string | null;
1491
- width: number;
1492
- x: number;
1493
- y: number;
1494
- };
1495
- Update: {
1496
- artifact_id?: number | null;
1497
- class?: string;
1498
- conf?: number;
1499
- detector?: string;
1500
- event_id?: number | null;
1501
- frame_index?: number;
1502
- height?: number;
1503
- id?: number;
1504
- inserted_at?: string;
1505
- observation_type?: Database["public"]["Enums"]["tag_observation_type"];
1506
- origin_heading?: number | null;
1507
- origin_height?: number | null;
1508
- origin_location?: unknown;
1509
- origin_pitch?: number | null;
1510
- origin_roll?: number | null;
1511
- score?: number | null;
1512
- score_source?: string | null;
1513
- sensor_pitch?: number | null;
1514
- sensor_roll?: number | null;
1515
- sensor_yaw?: number | null;
1516
- subject_height?: number | null;
1517
- subject_id?: number | null;
1518
- subject_location?: unknown;
1519
- timestamp_observation?: string | null;
1520
- width?: number;
1521
- x?: number;
1522
- y?: number;
1523
- };
1524
- Relationships: [{
1525
- foreignKeyName: "tags_artifact_id_fkey";
1526
- columns: ["artifact_id"];
1527
- isOneToOne: false;
1528
- referencedRelation: "artifacts";
1529
- referencedColumns: ["id"];
1530
- }, {
1531
- foreignKeyName: "tags_event_id_fkey";
1532
- columns: ["event_id"];
1533
- isOneToOne: false;
1534
- referencedRelation: "events";
1535
- referencedColumns: ["id"];
1536
- }, {
1537
- foreignKeyName: "tags_event_id_fkey";
1538
- columns: ["event_id"];
1539
- isOneToOne: false;
1540
- referencedRelation: "events_with_tags";
1541
- referencedColumns: ["id"];
1542
- }, {
1543
- foreignKeyName: "tags_event_id_fkey";
1544
- columns: ["event_id"];
1545
- isOneToOne: false;
1546
- referencedRelation: "events_with_tags_by_session";
1547
- referencedColumns: ["id"];
1548
- }];
1549
- };
1550
- users: {
1551
- Row: {
1552
- auto_approve_sessions: boolean;
1553
- earthranger_id: string | null;
1554
- first: string | null;
1555
- id: string;
1556
- is_registered: boolean;
1557
- last: string | null;
1558
- lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
1559
- lifecycle_changed_at: string;
1560
- lifecycle_changed_by: string | null;
1561
- lifecycle_reason: string | null;
1562
- signature_base64: string | null;
1563
- title: string | null;
1564
- username: string | null;
1565
- };
1566
- Insert: {
1567
- auto_approve_sessions?: boolean;
1568
- earthranger_id?: string | null;
1569
- first?: string | null;
1570
- id: string;
1571
- is_registered?: boolean;
1572
- last?: string | null;
1573
- lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
1574
- lifecycle_changed_at?: string;
1575
- lifecycle_changed_by?: string | null;
1576
- lifecycle_reason?: string | null;
1577
- signature_base64?: string | null;
1578
- title?: string | null;
1579
- username?: string | null;
1580
- };
1581
- Update: {
1582
- auto_approve_sessions?: boolean;
1583
- earthranger_id?: string | null;
1584
- first?: string | null;
1585
- id?: string;
1586
- is_registered?: boolean;
1587
- last?: string | null;
1588
- lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
1589
- lifecycle_changed_at?: string;
1590
- lifecycle_changed_by?: string | null;
1591
- lifecycle_reason?: string | null;
1592
- signature_base64?: string | null;
1593
- title?: string | null;
1594
- username?: string | null;
1595
- };
1596
- Relationships: [{
1597
- foreignKeyName: "users_lifecycle_changed_by_fkey";
1598
- columns: ["lifecycle_changed_by"];
1599
- isOneToOne: false;
1600
- referencedRelation: "users";
1601
- referencedColumns: ["id"];
1602
- }];
1603
- };
1604
- users_roles_per_herd: {
1605
- Row: {
1606
- herd_id: number;
1607
- id: number;
1608
- inserted_at: string;
1609
- lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
1610
- lifecycle_changed_at: string;
1611
- lifecycle_changed_by: string | null;
1612
- lifecycle_reason: string | null;
1613
- role: Database["public"]["Enums"]["role"];
1614
- user_id: string;
1615
- };
1616
- Insert: {
1617
- herd_id: number;
1618
- id?: number;
1619
- inserted_at?: string;
1620
- lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
1621
- lifecycle_changed_at?: string;
1622
- lifecycle_changed_by?: string | null;
1623
- lifecycle_reason?: string | null;
1624
- role: Database["public"]["Enums"]["role"];
1625
- user_id: string;
1626
- };
1627
- Update: {
1628
- herd_id?: number;
1629
- id?: number;
1630
- inserted_at?: string;
1631
- lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
1632
- lifecycle_changed_at?: string;
1633
- lifecycle_changed_by?: string | null;
1634
- lifecycle_reason?: string | null;
1635
- role?: Database["public"]["Enums"]["role"];
1636
- user_id?: string;
1637
- };
1638
- Relationships: [{
1639
- foreignKeyName: "users_roles_per_herd_herd_id_fkey";
1640
- columns: ["herd_id"];
1641
- isOneToOne: false;
1642
- referencedRelation: "herds";
1643
- referencedColumns: ["id"];
1644
- }, {
1645
- foreignKeyName: "users_roles_per_herd_lifecycle_changed_by_fkey";
1646
- columns: ["lifecycle_changed_by"];
1647
- isOneToOne: false;
1648
- referencedRelation: "users";
1649
- referencedColumns: ["id"];
1650
- }, {
1651
- foreignKeyName: "users_roles_per_herd_user_id_fkey";
1652
- columns: ["user_id"];
1653
- isOneToOne: false;
1654
- referencedRelation: "users";
1655
- referencedColumns: ["id"];
1656
- }];
1657
- };
1658
- versions_software: {
1659
- Row: {
1660
- broken: boolean;
1661
- commit_hash: string | null;
1662
- created_at: string;
1663
- description: string;
1664
- hyperlink: string | null;
1665
- id: number;
1666
- min: boolean;
1667
- path_build_artifact: string | null;
1668
- pre: boolean;
1669
- stable: boolean;
1670
- system: string;
1671
- title: string | null;
1672
- updated_at: string | null;
1673
- version: string;
1674
- };
1675
- Insert: {
1676
- broken?: boolean;
1677
- commit_hash?: string | null;
1678
- created_at?: string;
1679
- description: string;
1680
- hyperlink?: string | null;
1681
- id?: number;
1682
- min?: boolean;
1683
- path_build_artifact?: string | null;
1684
- pre?: boolean;
1685
- stable?: boolean;
1686
- system: string;
1687
- title?: string | null;
1688
- updated_at?: string | null;
1689
- version: string;
1690
- };
1691
- Update: {
1692
- broken?: boolean;
1693
- commit_hash?: string | null;
1694
- created_at?: string;
1695
- description?: string;
1696
- hyperlink?: string | null;
1697
- id?: number;
1698
- min?: boolean;
1699
- path_build_artifact?: string | null;
1700
- pre?: boolean;
1701
- stable?: boolean;
1702
- system?: string;
1703
- title?: string | null;
1704
- updated_at?: string | null;
1705
- version?: string;
1706
- };
1707
- Relationships: [];
1708
- };
1709
- zones: {
1710
- Row: {
1711
- herd_id: number;
1712
- id: number;
1713
- inserted_at: string;
1714
- region: unknown;
1715
- };
1716
- Insert: {
1717
- herd_id: number;
1718
- id?: number;
1719
- inserted_at?: string;
1720
- region: unknown;
1721
- };
1722
- Update: {
1723
- herd_id?: number;
1724
- id?: number;
1725
- inserted_at?: string;
1726
- region?: unknown;
1727
- };
1728
- Relationships: [{
1729
- foreignKeyName: "zones_herd_id_fkey";
1730
- columns: ["herd_id"];
1731
- isOneToOne: false;
1732
- referencedRelation: "herds";
1733
- referencedColumns: ["id"];
1734
- }];
1735
- };
1736
- };
1737
- Views: {
1738
- events_with_tags: {
1739
- Row: {
1740
- altitude: number | null;
1741
- device_id: number | null;
1742
- earthranger_url: string | null;
1743
- embedded_at: string | null;
1744
- file_path: string | null;
1745
- heading: number | null;
1746
- herd_id: number | null;
1747
- id: number | null;
1748
- inserted_at: string | null;
1749
- is_public: boolean | null;
1750
- location: unknown;
1751
- media_type: Database["public"]["Enums"]["media_type"] | null;
1752
- media_url: string | null;
1753
- message: string | null;
1754
- segmented_at: string | null;
1755
- session_id: number | null;
1756
- tagged_at: string | null;
1757
- tags: Database["public"]["Tables"]["tags"]["Row"][] | null;
1758
- timestamp_observation: string | null;
1759
- };
1760
- Relationships: [{
1761
- foreignKeyName: "devices_herd_id_fkey";
1762
- columns: ["herd_id"];
1763
- isOneToOne: false;
1764
- referencedRelation: "herds";
1765
- referencedColumns: ["id"];
1766
- }, {
1767
- foreignKeyName: "events_device_id_fkey";
1768
- columns: ["device_id"];
1769
- isOneToOne: false;
1770
- referencedRelation: "devices";
1771
- referencedColumns: ["id"];
1772
- }, {
1773
- foreignKeyName: "events_session_id_fkey";
1774
- columns: ["session_id"];
1775
- isOneToOne: false;
1776
- referencedRelation: "sessions";
1777
- referencedColumns: ["id"];
1778
- }];
1779
- };
1780
- events_with_tags_by_session: {
1781
- Row: {
1782
- altitude: number | null;
1783
- device_id: number | null;
1784
- earthranger_url: string | null;
1785
- file_path: string | null;
1786
- heading: number | null;
1787
- herd_id: number | null;
1788
- id: number | null;
1789
- inserted_at: string | null;
1790
- is_public: boolean | null;
1791
- location: unknown;
1792
- media_type: Database["public"]["Enums"]["media_type"] | null;
1793
- media_url: string | null;
1794
- message: string | null;
1795
- session_id: number | null;
1796
- tags: Database["public"]["Tables"]["tags"]["Row"][] | null;
1797
- timestamp_observation: string | null;
1798
- };
1799
- Relationships: [{
1800
- foreignKeyName: "devices_herd_id_fkey";
1801
- columns: ["herd_id"];
1802
- isOneToOne: false;
1803
- referencedRelation: "herds";
1804
- referencedColumns: ["id"];
1805
- }, {
1806
- foreignKeyName: "events_device_id_fkey";
1807
- columns: ["device_id"];
1808
- isOneToOne: false;
1809
- referencedRelation: "devices";
1810
- referencedColumns: ["id"];
1811
- }, {
1812
- foreignKeyName: "events_session_id_fkey";
1813
- columns: ["session_id"];
1814
- isOneToOne: false;
1815
- referencedRelation: "sessions";
1816
- referencedColumns: ["id"];
1817
- }];
1818
- };
1819
- zones_and_actions: {
1820
- Row: {
1821
- actions: Database["public"]["Tables"]["actions"]["Row"][] | null;
1822
- herd_id: number | null;
1823
- id: number | null;
1824
- inserted_at: string | null;
1825
- region: unknown;
1826
- };
1827
- Relationships: [{
1828
- foreignKeyName: "zones_herd_id_fkey";
1829
- columns: ["herd_id"];
1830
- isOneToOne: false;
1831
- referencedRelation: "herds";
1832
- referencedColumns: ["id"];
1833
- }];
1834
- };
1835
- };
1836
- Functions: {
1837
- accept_herd_invitations_for_current_user: {
1838
- Args: {
1839
- p_invitation_ids: number[];
1840
- };
1841
- Returns: {
1842
- accepted_at: string | null;
1843
- created_at: string;
1844
- email: string;
1845
- expires_at: string | null;
1846
- herd_id: number;
1847
- id: number;
1848
- invited_by: string;
1849
- role: Database["public"]["Enums"]["role"];
1850
- status: Database["public"]["Enums"]["herd_invitation_status"];
1851
- }[];
1852
- SetofOptions: {
1853
- from: "*";
1854
- to: "herd_invitations";
1855
- isOneToOne: false;
1856
- isSetofReturn: true;
1857
- };
1858
- };
1859
- ack_queue_message: {
1860
- Args: {
1861
- message_id: number;
1862
- queue_name: string;
1863
- };
1864
- Returns: boolean;
1865
- };
1866
- analyze_device_heartbeats: {
1867
- Args: {
1868
- p_device_id: number;
1869
- p_lookback_minutes?: number;
1870
- p_window_minutes?: number;
1871
- };
1872
- Returns: Database["public"]["CompositeTypes"]["device_heartbeat_analysis"];
1873
- SetofOptions: {
1874
- from: "*";
1875
- to: "device_heartbeat_analysis";
1876
- isOneToOne: true;
1877
- isSetofReturn: false;
1878
- };
1879
- };
1880
- analyze_herd_device_heartbeats: {
1881
- Args: {
1882
- p_device_types?: Database["public"]["Enums"]["device_type"][];
1883
- p_herd_id: number;
1884
- p_lookback_minutes?: number;
1885
- p_window_minutes?: number;
1886
- };
1887
- Returns: Database["public"]["CompositeTypes"]["device_heartbeat_analysis"][];
1888
- SetofOptions: {
1889
- from: "*";
1890
- to: "device_heartbeat_analysis";
1891
- isOneToOne: false;
1892
- isSetofReturn: true;
1893
- };
1894
- };
1895
- auto_assign_session_post_approver: {
1896
- Args: never;
1897
- Returns: number;
1898
- };
1899
- check_realtime_schema_status: {
1900
- Args: never;
1901
- Returns: {
1902
- check_type: string;
1903
- details: string;
1904
- schema_name: string;
1905
- status: string;
1906
- table_name: string;
1907
- }[];
1908
- };
1909
- create_herd_invitation: {
1910
- Args: {
1911
- p_email: string;
1912
- p_expires_at?: string;
1913
- p_herd_id: number;
1914
- p_role: Database["public"]["Enums"]["role"];
1915
- };
1916
- Returns: {
1917
- accepted_at: string | null;
1918
- created_at: string;
1919
- email: string;
1920
- expires_at: string | null;
1921
- herd_id: number;
1922
- id: number;
1923
- invited_by: string;
1924
- role: Database["public"]["Enums"]["role"];
1925
- status: Database["public"]["Enums"]["herd_invitation_status"];
1926
- };
1927
- SetofOptions: {
1928
- from: "*";
1929
- to: "herd_invitations";
1930
- isOneToOne: true;
1931
- isSetofReturn: false;
1932
- };
1933
- };
1934
- delete_all_orphaned_sessions: {
1935
- Args: {
1936
- min_age_seconds?: number;
1937
- };
1938
- Returns: {
1939
- age_seconds: number;
1940
- device_id: number;
1941
- session_id: number;
1942
- status: string;
1943
- timestamp_start: string;
1944
- }[];
1945
- };
1946
- delete_orphaned_session: {
1947
- Args: {
1948
- min_age_seconds?: number;
1949
- session_id_param: number;
1950
- };
1951
- Returns: {
1952
- age_seconds: number;
1953
- connectivity_count: number;
1954
- device_id: number;
1955
- session_id: number;
1956
- status: string;
1957
- timestamp_start: string;
1958
- }[];
1959
- };
1960
- expire_herd_invitations: {
1961
- Args: never;
1962
- Returns: number;
1963
- };
1964
- fix_all_sessions_missing_distance: {
1965
- Args: never;
1966
- Returns: {
1967
- device_id: number;
1968
- new_distance_max_from_start: number;
1969
- new_distance_total: number;
1970
- old_distance_max_from_start: number;
1971
- old_distance_total: number;
1972
- session_id: number;
1973
- status: string;
1974
- }[];
1975
- };
1976
- fix_all_sessions_missing_end_timestamps: {
1977
- Args: never;
1978
- Returns: {
1979
- device_id: number;
1980
- new_timestamp_end: string;
1981
- old_timestamp_end: string;
1982
- session_id: number;
1983
- status: string;
1984
- }[];
1985
- };
1986
- fix_session_distance_from_connectivity: {
1987
- Args: {
1988
- session_id_param: number;
1989
- };
1990
- Returns: {
1991
- new_distance_max_from_start: number;
1992
- new_distance_total: number;
1993
- old_distance_max_from_start: number;
1994
- old_distance_total: number;
1995
- session_id: number;
1996
- status: string;
1997
- }[];
1998
- };
1999
- fix_session_end_timestamp: {
2000
- Args: {
2001
- session_id_param: number;
2002
- };
2003
- Returns: {
2004
- new_timestamp_end: string;
2005
- old_timestamp_end: string;
2006
- session_id: number;
2007
- status: string;
2008
- }[];
2009
- };
2010
- get_artifact_ids_for_session: {
2011
- Args: {
2012
- session_id_caller: number;
2013
- };
2014
- Returns: number[];
2015
- };
2016
- get_artifacts_for_device: {
2017
- Args: {
2018
- device_id_caller: number;
2019
- limit_caller?: number;
2020
- offset_caller?: number;
2021
- };
2022
- Returns: {
2023
- created_at: string;
2024
- device_id: number;
2025
- embedded_at: string | null;
2026
- file_path: string;
2027
- file_size_bytes: number | null;
2028
- id: number;
2029
- lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
2030
- lifecycle_changed_at: string;
2031
- lifecycle_changed_by: string | null;
2032
- lifecycle_reason: string | null;
2033
- modality: string | null;
2034
- segmented_at: string | null;
2035
- session_id: number | null;
2036
- tagged_at: string | null;
2037
- timestamp_observation: string | null;
2038
- timestamp_observation_end: string;
2039
- tracked_at: string | null;
2040
- updated_at: string | null;
2041
- }[];
2042
- SetofOptions: {
2043
- from: "*";
2044
- to: "artifacts";
2045
- isOneToOne: false;
2046
- isSetofReturn: true;
2047
- };
2048
- };
2049
- get_artifacts_for_devices_batch: {
2050
- Args: {
2051
- device_ids: number[];
2052
- limit_per_device?: number;
2053
- };
2054
- Returns: {
2055
- created_at: string;
2056
- device_id: number;
2057
- embedded_at: string | null;
2058
- file_path: string;
2059
- file_size_bytes: number | null;
2060
- id: number;
2061
- lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
2062
- lifecycle_changed_at: string;
2063
- lifecycle_changed_by: string | null;
2064
- lifecycle_reason: string | null;
2065
- modality: string | null;
2066
- segmented_at: string | null;
2067
- session_id: number | null;
2068
- tagged_at: string | null;
2069
- timestamp_observation: string | null;
2070
- timestamp_observation_end: string;
2071
- tracked_at: string | null;
2072
- updated_at: string | null;
2073
- }[];
2074
- SetofOptions: {
2075
- from: "*";
2076
- to: "artifacts";
2077
- isOneToOne: false;
2078
- isSetofReturn: true;
2079
- };
2080
- } | {
2081
- Args: {
2082
- device_ids: number[];
2083
- end_timestamp?: string;
2084
- limit_per_device?: number;
2085
- start_timestamp?: string;
2086
- };
2087
- Returns: {
2088
- created_at: string;
2089
- device_id: number;
2090
- embedded_at: string | null;
2091
- file_path: string;
2092
- file_size_bytes: number | null;
2093
- id: number;
2094
- lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
2095
- lifecycle_changed_at: string;
2096
- lifecycle_changed_by: string | null;
2097
- lifecycle_reason: string | null;
2098
- modality: string | null;
2099
- segmented_at: string | null;
2100
- session_id: number | null;
2101
- tagged_at: string | null;
2102
- timestamp_observation: string | null;
2103
- timestamp_observation_end: string;
2104
- tracked_at: string | null;
2105
- updated_at: string | null;
2106
- }[];
2107
- SetofOptions: {
2108
- from: "*";
2109
- to: "artifacts";
2110
- isOneToOne: false;
2111
- isSetofReturn: true;
2112
- };
2113
- };
2114
- get_artifacts_for_herd: {
2115
- Args: {
2116
- herd_id_caller: number;
2117
- limit_caller?: number;
2118
- offset_caller?: number;
2119
- };
2120
- Returns: {
2121
- created_at: string;
2122
- device_id: number;
2123
- embedded_at: string | null;
2124
- file_path: string;
2125
- file_size_bytes: number | null;
2126
- id: number;
2127
- lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
2128
- lifecycle_changed_at: string;
2129
- lifecycle_changed_by: string | null;
2130
- lifecycle_reason: string | null;
2131
- modality: string | null;
2132
- segmented_at: string | null;
2133
- session_id: number | null;
2134
- tagged_at: string | null;
2135
- timestamp_observation: string | null;
2136
- timestamp_observation_end: string;
2137
- tracked_at: string | null;
2138
- updated_at: string | null;
2139
- }[];
2140
- SetofOptions: {
2141
- from: "*";
2142
- to: "artifacts";
2143
- isOneToOne: false;
2144
- isSetofReturn: true;
2145
- };
2146
- } | {
2147
- Args: {
2148
- end_timestamp?: string;
2149
- herd_id_caller: number;
2150
- limit_caller?: number;
2151
- offset_caller?: number;
2152
- start_timestamp?: string;
2153
- };
2154
- Returns: {
2155
- created_at: string;
2156
- device_id: number;
2157
- embedded_at: string | null;
2158
- file_path: string;
2159
- file_size_bytes: number | null;
2160
- id: number;
2161
- lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
2162
- lifecycle_changed_at: string;
2163
- lifecycle_changed_by: string | null;
2164
- lifecycle_reason: string | null;
2165
- modality: string | null;
2166
- segmented_at: string | null;
2167
- session_id: number | null;
2168
- tagged_at: string | null;
2169
- timestamp_observation: string | null;
2170
- timestamp_observation_end: string;
2171
- tracked_at: string | null;
2172
- updated_at: string | null;
2173
- }[];
2174
- SetofOptions: {
2175
- from: "*";
2176
- to: "artifacts";
2177
- isOneToOne: false;
2178
- isSetofReturn: true;
2179
- };
2180
- };
2181
- get_artifacts_infinite_by_device: {
2182
- Args: {
2183
- cursor_id?: number;
2184
- cursor_timestamp?: string;
2185
- device_id_caller: number;
2186
- limit_caller?: number;
2187
- };
2188
- Returns: {
2189
- created_at: string;
2190
- device_id: number;
2191
- embedded_at: string | null;
2192
- file_path: string;
2193
- file_size_bytes: number | null;
2194
- id: number;
2195
- lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
2196
- lifecycle_changed_at: string;
2197
- lifecycle_changed_by: string | null;
2198
- lifecycle_reason: string | null;
2199
- modality: string | null;
2200
- segmented_at: string | null;
2201
- session_id: number | null;
2202
- tagged_at: string | null;
2203
- timestamp_observation: string | null;
2204
- timestamp_observation_end: string;
2205
- tracked_at: string | null;
2206
- updated_at: string | null;
2207
- }[];
2208
- SetofOptions: {
2209
- from: "*";
2210
- to: "artifacts";
2211
- isOneToOne: false;
2212
- isSetofReturn: true;
2213
- };
2214
- } | {
2215
- Args: {
2216
- cursor_id?: number;
2217
- cursor_timestamp?: string;
2218
- device_id_caller: number;
2219
- limit_caller?: number;
2220
- range_end?: string;
2221
- range_start?: string;
2222
- };
2223
- Returns: {
2224
- created_at: string;
2225
- device_id: number;
2226
- embedded_at: string | null;
2227
- file_path: string;
2228
- file_size_bytes: number | null;
2229
- id: number;
2230
- lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
2231
- lifecycle_changed_at: string;
2232
- lifecycle_changed_by: string | null;
2233
- lifecycle_reason: string | null;
2234
- modality: string | null;
2235
- segmented_at: string | null;
2236
- session_id: number | null;
2237
- tagged_at: string | null;
2238
- timestamp_observation: string | null;
2239
- timestamp_observation_end: string;
2240
- tracked_at: string | null;
2241
- updated_at: string | null;
2242
- }[];
2243
- SetofOptions: {
2244
- from: "*";
2245
- to: "artifacts";
2246
- isOneToOne: false;
2247
- isSetofReturn: true;
2248
- };
2249
- };
2250
- get_artifacts_infinite_by_herd: {
2251
- Args: {
2252
- cursor_id?: number;
2253
- cursor_timestamp?: string;
2254
- herd_id_caller: number;
2255
- limit_caller?: number;
2256
- };
2257
- Returns: {
2258
- created_at: string;
2259
- device_id: number;
2260
- embedded_at: string | null;
2261
- file_path: string;
2262
- file_size_bytes: number | null;
2263
- id: number;
2264
- lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
2265
- lifecycle_changed_at: string;
2266
- lifecycle_changed_by: string | null;
2267
- lifecycle_reason: string | null;
2268
- modality: string | null;
2269
- segmented_at: string | null;
2270
- session_id: number | null;
2271
- tagged_at: string | null;
2272
- timestamp_observation: string | null;
2273
- timestamp_observation_end: string;
2274
- tracked_at: string | null;
2275
- updated_at: string | null;
2276
- }[];
2277
- SetofOptions: {
2278
- from: "*";
2279
- to: "artifacts";
2280
- isOneToOne: false;
2281
- isSetofReturn: true;
2282
- };
2283
- } | {
2284
- Args: {
2285
- cursor_id?: number;
2286
- cursor_timestamp?: string;
2287
- herd_id_caller: number;
2288
- limit_caller?: number;
2289
- range_end?: string;
2290
- range_start?: string;
2291
- };
2292
- Returns: {
2293
- created_at: string;
2294
- device_id: number;
2295
- embedded_at: string | null;
2296
- file_path: string;
2297
- file_size_bytes: number | null;
2298
- id: number;
2299
- lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
2300
- lifecycle_changed_at: string;
2301
- lifecycle_changed_by: string | null;
2302
- lifecycle_reason: string | null;
2303
- modality: string | null;
2304
- segmented_at: string | null;
2305
- session_id: number | null;
2306
- tagged_at: string | null;
2307
- timestamp_observation: string | null;
2308
- timestamp_observation_end: string;
2309
- tracked_at: string | null;
2310
- updated_at: string | null;
2311
- }[];
2312
- SetofOptions: {
2313
- from: "*";
2314
- to: "artifacts";
2315
- isOneToOne: false;
2316
- isSetofReturn: true;
2317
- };
2318
- };
2319
- get_connectivity_for_artifact: {
2320
- Args: {
2321
- artifact_id_caller: number;
2322
- max_elements_caller?: number;
2323
- };
2324
- Returns: Database["public"]["CompositeTypes"]["connectivity_with_coordinates"][];
2325
- SetofOptions: {
2326
- from: "*";
2327
- to: "connectivity_with_coordinates";
2328
- isOneToOne: false;
2329
- isSetofReturn: true;
2330
- };
2331
- };
2332
- get_connectivity_for_event: {
2333
- Args: {
2334
- event_id_caller: number;
2335
- max_elements_caller?: number;
2336
- };
2337
- Returns: Database["public"]["CompositeTypes"]["connectivity_with_coordinates"][];
2338
- SetofOptions: {
2339
- from: "*";
2340
- to: "connectivity_with_coordinates";
2341
- isOneToOne: false;
2342
- isSetofReturn: true;
2343
- };
2344
- };
2345
- get_connectivity_for_herd_time_range: {
2346
- Args: {
2347
- end_timestamp_caller: string;
2348
- herd_id_caller: number;
2349
- max_elements_caller?: number;
2350
- start_timestamp_caller: string;
2351
- };
2352
- Returns: Database["public"]["CompositeTypes"]["connectivity_with_coordinates"][];
2353
- SetofOptions: {
2354
- from: "*";
2355
- to: "connectivity_with_coordinates";
2356
- isOneToOne: false;
2357
- isSetofReturn: true;
2358
- };
2359
- } | {
2360
- Args: {
2361
- end_timestamp_caller: string;
2362
- herd_id_caller: number;
2363
- max_elements_caller?: number;
2364
- offset_caller?: number;
2365
- start_timestamp_caller: string;
2366
- };
2367
- Returns: Database["public"]["CompositeTypes"]["connectivity_with_coordinates"][];
2368
- SetofOptions: {
2369
- from: "*";
2370
- to: "connectivity_with_coordinates";
2371
- isOneToOne: false;
2372
- isSetofReturn: true;
2373
- };
2374
- } | {
2375
- Args: {
2376
- end_timestamp_caller: string;
2377
- herd_id_caller: number;
2378
- max_elements_caller?: number;
2379
- sample_caller?: boolean;
2380
- start_timestamp_caller: string;
2381
- };
2382
- Returns: Database["public"]["CompositeTypes"]["connectivity_with_coordinates"][];
2383
- SetofOptions: {
2384
- from: "*";
2385
- to: "connectivity_with_coordinates";
2386
- isOneToOne: false;
2387
- isSetofReturn: true;
2388
- };
2389
- };
2390
- get_connectivity_with_coordinates: {
2391
- Args: {
2392
- session_id_caller: number;
2393
- };
2394
- Returns: Database["public"]["CompositeTypes"]["connectivity_with_coordinates"][];
2395
- SetofOptions: {
2396
- from: "*";
2397
- to: "connectivity_with_coordinates";
2398
- isOneToOne: false;
2399
- isSetofReturn: true;
2400
- };
2401
- };
2402
- get_connectivity_with_coordinates_by_device_and_timestamp: {
2403
- Args: {
2404
- device_id_caller: number;
2405
- timestamp_filter: string;
2406
- };
2407
- Returns: Database["public"]["CompositeTypes"]["connectivity_with_coordinates"][];
2408
- SetofOptions: {
2409
- from: "*";
2410
- to: "connectivity_with_coordinates";
2411
- isOneToOne: false;
2412
- isSetofReturn: true;
2413
- };
2414
- };
2415
- get_device_by_api_key: {
2416
- Args: {
2417
- device_api_key: string;
2418
- };
2419
- Returns: Database["public"]["CompositeTypes"]["device_pretty_location"];
2420
- SetofOptions: {
2421
- from: "*";
2422
- to: "device_pretty_location";
2423
- isOneToOne: true;
2424
- isSetofReturn: false;
2425
- };
2426
- };
2427
- get_device_by_id: {
2428
- Args: {
2429
- device_id_caller: number;
2430
- };
2431
- Returns: Database["public"]["CompositeTypes"]["device_pretty_location"];
2432
- SetofOptions: {
2433
- from: "*";
2434
- to: "device_pretty_location";
2435
- isOneToOne: true;
2436
- isSetofReturn: false;
2437
- };
2438
- };
2439
- get_device_id_from_key: {
2440
- Args: {
2441
- device_api_key: string;
2442
- };
2443
- Returns: number;
2444
- };
2445
- get_devices_for_herd: {
2446
- Args: {
2447
- herd_id_caller: number;
2448
- };
2449
- Returns: Database["public"]["CompositeTypes"]["device_pretty_location"][];
2450
- SetofOptions: {
2451
- from: "*";
2452
- to: "device_pretty_location";
2453
- isOneToOne: false;
2454
- isSetofReturn: true;
2455
- };
2456
- };
2457
- get_events_and_tags_for_device: {
2458
- Args: {
2459
- device_id_caller: number;
2460
- limit_caller: number;
2461
- };
2462
- Returns: Database["public"]["CompositeTypes"]["event_and_tags_pretty_location"][];
2463
- SetofOptions: {
2464
- from: "*";
2465
- to: "event_and_tags_pretty_location";
2466
- isOneToOne: false;
2467
- isSetofReturn: true;
2468
- };
2469
- };
2470
- get_events_and_tags_for_devices_batch: {
2471
- Args: {
2472
- device_ids: number[];
2473
- limit_per_device?: number;
2474
- };
2475
- Returns: Database["public"]["CompositeTypes"]["event_and_tags_pretty_location"][];
2476
- SetofOptions: {
2477
- from: "*";
2478
- to: "event_and_tags_pretty_location";
2479
- isOneToOne: false;
2480
- isSetofReturn: true;
2481
- };
2482
- };
2483
- get_events_and_tags_for_herd: {
2484
- Args: {
2485
- herd_id_caller: number;
2486
- limit_caller: number;
2487
- offset_caller: number;
2488
- };
2489
- Returns: Database["public"]["CompositeTypes"]["event_and_tags_pretty_location"][];
2490
- SetofOptions: {
2491
- from: "*";
2492
- to: "event_and_tags_pretty_location";
2493
- isOneToOne: false;
2494
- isSetofReturn: true;
2495
- };
2496
- };
2497
- get_events_and_tags_for_session: {
2498
- Args: {
2499
- limit_caller: number;
2500
- offset_caller: number;
2501
- session_id_caller: number;
2502
- };
2503
- Returns: Database["public"]["CompositeTypes"]["event_and_tags_pretty_location"][];
2504
- SetofOptions: {
2505
- from: "*";
2506
- to: "event_and_tags_pretty_location";
2507
- isOneToOne: false;
2508
- isSetofReturn: true;
2509
- };
2510
- };
2511
- get_events_infinite_by_device: {
2512
- Args: {
2513
- cursor_id?: number;
2514
- cursor_timestamp?: string;
2515
- device_id_caller: number;
2516
- limit_caller?: number;
2517
- };
2518
- Returns: Database["public"]["CompositeTypes"]["event_and_tags_pretty_location"][];
2519
- SetofOptions: {
2520
- from: "*";
2521
- to: "event_and_tags_pretty_location";
2522
- isOneToOne: false;
2523
- isSetofReturn: true;
2524
- };
2525
- } | {
2526
- Args: {
2527
- cursor_id?: number;
2528
- cursor_timestamp?: string;
2529
- device_id_caller: number;
2530
- limit_caller?: number;
2531
- range_end?: string;
2532
- range_start?: string;
2533
- };
2534
- Returns: Database["public"]["CompositeTypes"]["event_and_tags_pretty_location"][];
2535
- SetofOptions: {
2536
- from: "*";
2537
- to: "event_and_tags_pretty_location";
2538
- isOneToOne: false;
2539
- isSetofReturn: true;
2540
- };
2541
- };
2542
- get_events_infinite_by_herd: {
2543
- Args: {
2544
- cursor_id?: number;
2545
- cursor_timestamp?: string;
2546
- herd_id_caller: number;
2547
- limit_caller?: number;
2548
- };
2549
- Returns: Database["public"]["CompositeTypes"]["event_and_tags_pretty_location"][];
2550
- SetofOptions: {
2551
- from: "*";
2552
- to: "event_and_tags_pretty_location";
2553
- isOneToOne: false;
2554
- isSetofReturn: true;
2555
- };
2556
- } | {
2557
- Args: {
2558
- cursor_id?: number;
2559
- cursor_timestamp?: string;
2560
- herd_id_caller: number;
2561
- limit_caller?: number;
2562
- range_end?: string;
2563
- range_start?: string;
2564
- };
2565
- Returns: Database["public"]["CompositeTypes"]["event_and_tags_pretty_location"][];
2566
- SetofOptions: {
2567
- from: "*";
2568
- to: "event_and_tags_pretty_location";
2569
- isOneToOne: false;
2570
- isSetofReturn: true;
2571
- };
2572
- };
2573
- get_events_with_tags_for_herd: {
2574
- Args: {
2575
- herd_id_caller: number;
2576
- limit_caller: number;
2577
- offset_caller: number;
2578
- };
2579
- Returns: Database["public"]["CompositeTypes"]["event_with_tags"][];
2580
- SetofOptions: {
2581
- from: "*";
2582
- to: "event_with_tags";
2583
- isOneToOne: false;
2584
- isSetofReturn: true;
2585
- };
2586
- };
2587
- get_feed_infinite_by_device: {
2588
- Args: {
2589
- cursor_feed_type?: string;
2590
- cursor_id?: number;
2591
- cursor_timestamp?: string;
2592
- device_id_caller: number;
2593
- limit_caller?: number;
2594
- };
2595
- Returns: Database["public"]["CompositeTypes"]["feed_item"][];
2596
- SetofOptions: {
2597
- from: "*";
2598
- to: "feed_item";
2599
- isOneToOne: false;
2600
- isSetofReturn: true;
2601
- };
2602
- } | {
2603
- Args: {
2604
- cursor_feed_type?: string;
2605
- cursor_id?: number;
2606
- cursor_timestamp?: string;
2607
- device_id_caller: number;
2608
- limit_caller?: number;
2609
- range_end?: string;
2610
- range_start?: string;
2611
- };
2612
- Returns: Database["public"]["CompositeTypes"]["feed_item"][];
2613
- SetofOptions: {
2614
- from: "*";
2615
- to: "feed_item";
2616
- isOneToOne: false;
2617
- isSetofReturn: true;
2618
- };
2619
- };
2620
- get_feed_infinite_by_herd: {
2621
- Args: {
2622
- cursor_feed_type?: string;
2623
- cursor_id?: number;
2624
- cursor_timestamp?: string;
2625
- herd_id_caller: number;
2626
- limit_caller?: number;
2627
- };
2628
- Returns: Database["public"]["CompositeTypes"]["feed_item"][];
2629
- SetofOptions: {
2630
- from: "*";
2631
- to: "feed_item";
2632
- isOneToOne: false;
2633
- isSetofReturn: true;
2634
- };
2635
- } | {
2636
- Args: {
2637
- cursor_feed_type?: string;
2638
- cursor_id?: number;
2639
- cursor_timestamp?: string;
2640
- herd_id_caller: number;
2641
- limit_caller?: number;
2642
- range_end?: string;
2643
- range_start?: string;
2644
- };
2645
- Returns: Database["public"]["CompositeTypes"]["feed_item"][];
2646
- SetofOptions: {
2647
- from: "*";
2648
- to: "feed_item";
2649
- isOneToOne: false;
2650
- isSetofReturn: true;
2651
- };
2652
- };
2653
- get_health_metrics_summary: {
2654
- Args: {
2655
- p_device_id: number;
2656
- p_lookback_minutes?: number;
2657
- };
2658
- Returns: {
2659
- avg_value: number;
2660
- count: number;
2661
- max_value: number;
2662
- metric_name: string;
2663
- min_value: number;
2664
- }[];
2665
- };
2666
- get_herd_invitations_for_current_user: {
2667
- Args: never;
2668
- Returns: Database["public"]["CompositeTypes"]["herd_invitation_with_herd_slug"][];
2669
- SetofOptions: {
2670
- from: "*";
2671
- to: "herd_invitation_with_herd_slug";
2672
- isOneToOne: false;
2673
- isSetofReturn: true;
2674
- };
2675
- };
2676
- get_herd_uptime_summary: {
2677
- Args: {
2678
- p_device_types?: Database["public"]["Enums"]["device_type"][];
2679
- p_herd_id: number;
2680
- p_lookback_minutes?: number;
2681
- p_window_minutes?: number;
2682
- };
2683
- Returns: {
2684
- average_heartbeat_interval: number;
2685
- offline_devices: number;
2686
- online_devices: number;
2687
- overall_uptime_percentage: number;
2688
- total_devices: number;
2689
- total_heartbeats: number;
2690
- }[];
2691
- };
2692
- get_herds_with_location: {
2693
- Args: never;
2694
- Returns: Database["public"]["CompositeTypes"]["herds_pretty_location"][];
2695
- SetofOptions: {
2696
- from: "*";
2697
- to: "herds_pretty_location";
2698
- isOneToOne: false;
2699
- isSetofReturn: true;
2700
- };
2701
- };
2702
- get_minimal_subjects_for_artifact: {
2703
- Args: {
2704
- artifact_id_caller: number;
2705
- detector_models_caller?: string[];
2706
- max_elements_caller?: number;
2707
- min_avg_conf_caller?: number;
2708
- min_count_caller?: number;
2709
- };
2710
- Returns: {
2711
- avg_conf: number;
2712
- first_tag_frame_index: number;
2713
- last_tag_frame_index: number;
2714
- num_tags: number;
2715
- subject_id: number;
2716
- }[];
2717
- };
2718
- get_pins_for_herd: {
2719
- Args: {
2720
- herd_id_caller: number;
2721
- };
2722
- Returns: Database["public"]["CompositeTypes"]["pins_pretty_location"][];
2723
- SetofOptions: {
2724
- from: "*";
2725
- to: "pins_pretty_location";
2726
- isOneToOne: false;
2727
- isSetofReturn: true;
2728
- };
2729
- };
2730
- get_pubsub_jwt_public_keys: {
2731
- Args: never;
2732
- Returns: import("../types/supabase").Json;
2733
- };
2734
- get_pubsub_token_claims: {
2735
- Args: never;
2736
- Returns: import("../types/supabase").Json;
2737
- };
2738
- get_segmentations_sam3_for_artifact: {
2739
- Args: {
2740
- artifact_id_caller: number;
2741
- end_timestamp_caller?: string;
2742
- max_elements_caller?: number;
2743
- start_timestamp_caller?: string;
2744
- };
2745
- Returns: Database["public"]["CompositeTypes"]["segmentations_sam3_pretty"][];
2746
- SetofOptions: {
2747
- from: "*";
2748
- to: "segmentations_sam3_pretty";
2749
- isOneToOne: false;
2750
- isSetofReturn: true;
2751
- };
2752
- };
2753
- get_segmentations_sam3_for_artifact_by_frame_index: {
2754
- Args: {
2755
- artifact_id_caller: number;
2756
- frame_index_end_caller: number;
2757
- frame_index_start_caller: number;
2758
- max_elements_caller?: number;
2759
- min_conf_caller?: number;
2760
- };
2761
- Returns: Database["public"]["CompositeTypes"]["segmentations_sam3_pretty"][];
2762
- SetofOptions: {
2763
- from: "*";
2764
- to: "segmentations_sam3_pretty";
2765
- isOneToOne: false;
2766
- isSetofReturn: true;
2767
- };
2768
- };
2769
- get_segmentations_sam3_for_artifact_by_subject_id: {
2770
- Args: {
2771
- artifact_id_caller: number;
2772
- max_elements_caller?: number;
2773
- subject_id_caller: number;
2774
- };
2775
- Returns: Database["public"]["CompositeTypes"]["segmentations_sam3_pretty"][];
2776
- SetofOptions: {
2777
- from: "*";
2778
- to: "segmentations_sam3_pretty";
2779
- isOneToOne: false;
2780
- isSetofReturn: true;
2781
- };
2782
- };
2783
- get_segmentations_sam3_for_event: {
2784
- Args: {
2785
- end_timestamp_caller?: string;
2786
- event_id_caller: number;
2787
- max_elements_caller?: number;
2788
- start_timestamp_caller?: string;
2789
- };
2790
- Returns: Database["public"]["CompositeTypes"]["segmentations_sam3_pretty"][];
2791
- SetofOptions: {
2792
- from: "*";
2793
- to: "segmentations_sam3_pretty";
2794
- isOneToOne: false;
2795
- isSetofReturn: true;
2796
- };
2797
- };
2798
- get_session_by_id: {
2799
- Args: {
2800
- session_id_caller: number;
2801
- };
2802
- Returns: Database["public"]["CompositeTypes"]["session_with_coordinates"][];
2803
- SetofOptions: {
2804
- from: "*";
2805
- to: "session_with_coordinates";
2806
- isOneToOne: false;
2807
- isSetofReturn: true;
2808
- };
2809
- };
2810
- get_session_summaries: {
2811
- Args: {
2812
- device_id_caller?: number;
2813
- end_date_caller?: string;
2814
- herd_id_caller?: number;
2815
- min_distance_meters_caller?: number;
2816
- min_duration_minutes_caller?: number;
2817
- product_numbers_caller?: string[];
2818
- start_date_caller?: string;
2819
- };
2820
- Returns: import("../types/supabase").Json;
2821
- };
2822
- get_session_usage_over_time: {
2823
- Args: {
2824
- device_id_caller?: number;
2825
- end_date_caller?: string;
2826
- herd_id_caller?: number;
2827
- min_distance_meters_caller?: number;
2828
- min_duration_minutes_caller?: number;
2829
- product_numbers_caller?: string[];
2830
- start_date_caller?: string;
2831
- };
2832
- Returns: import("../types/supabase").Json;
2833
- };
2834
- get_sessions_infinite_by_device: {
2835
- Args: {
2836
- cursor_id?: number;
2837
- cursor_timestamp?: string;
2838
- device_id_caller: number;
2839
- limit_caller?: number;
2840
- min_flight_distance_meters?: number;
2841
- min_flight_time_minutes?: number;
2842
- product_numbers_caller?: string[];
2843
- range_end?: string;
2844
- range_start?: string;
2845
- };
2846
- Returns: Database["public"]["CompositeTypes"]["session_with_coordinates"][];
2847
- SetofOptions: {
2848
- from: "*";
2849
- to: "session_with_coordinates";
2850
- isOneToOne: false;
2851
- isSetofReturn: true;
2852
- };
2853
- };
2854
- get_sessions_infinite_by_herd: {
2855
- Args: {
2856
- cursor_id?: number;
2857
- cursor_timestamp?: string;
2858
- herd_id_caller: number;
2859
- limit_caller?: number;
2860
- min_flight_distance_meters?: number;
2861
- min_flight_time_minutes?: number;
2862
- product_numbers_caller?: string[];
2863
- range_end?: string;
2864
- range_start?: string;
2865
- };
2866
- Returns: Database["public"]["CompositeTypes"]["session_with_coordinates"][];
2867
- SetofOptions: {
2868
- from: "*";
2869
- to: "session_with_coordinates";
2870
- isOneToOne: false;
2871
- isSetofReturn: true;
2872
- };
2873
- };
2874
- get_sessions_with_coordinates: {
2875
- Args: {
2876
- herd_id_caller: number;
2877
- };
2878
- Returns: Database["public"]["CompositeTypes"]["session_with_coordinates"][];
2879
- SetofOptions: {
2880
- from: "*";
2881
- to: "session_with_coordinates";
2882
- isOneToOne: false;
2883
- isSetofReturn: true;
2884
- };
2885
- };
2886
- get_sessions_with_coordinates_by_device: {
2887
- Args: {
2888
- device_id_caller: number;
2889
- };
2890
- Returns: Database["public"]["CompositeTypes"]["session_with_coordinates"][];
2891
- SetofOptions: {
2892
- from: "*";
2893
- to: "session_with_coordinates";
2894
- isOneToOne: false;
2895
- isSetofReturn: true;
2896
- };
2897
- };
2898
- get_tags_for_artifact: {
2899
- Args: {
2900
- artifact_id_caller: number;
2901
- detector_models_caller?: string[];
2902
- end_timestamp_caller?: string;
2903
- max_elements_caller?: number;
2904
- start_timestamp_caller?: string;
2905
- };
2906
- Returns: Database["public"]["CompositeTypes"]["tags_pretty_location"][];
2907
- SetofOptions: {
2908
- from: "*";
2909
- to: "tags_pretty_location";
2910
- isOneToOne: false;
2911
- isSetofReturn: true;
2912
- };
2913
- };
2914
- get_tags_for_artifact_by_frame_index: {
2915
- Args: {
2916
- artifact_id_caller: number;
2917
- detector_models_caller?: string[];
2918
- frame_index_end_caller: number;
2919
- frame_index_start_caller: number;
2920
- max_elements_caller?: number;
2921
- min_conf_caller: number;
2922
- };
2923
- Returns: Database["public"]["CompositeTypes"]["tags_pretty_location"][];
2924
- SetofOptions: {
2925
- from: "*";
2926
- to: "tags_pretty_location";
2927
- isOneToOne: false;
2928
- isSetofReturn: true;
2929
- };
2930
- };
2931
- get_tags_for_artifact_by_subject_id: {
2932
- Args: {
2933
- artifact_id_caller: number;
2934
- detector_models_caller?: string[];
2935
- max_elements_caller?: number;
2936
- subject_id_caller: number;
2937
- };
2938
- Returns: Database["public"]["CompositeTypes"]["tags_pretty_location"][];
2939
- SetofOptions: {
2940
- from: "*";
2941
- to: "tags_pretty_location";
2942
- isOneToOne: false;
2943
- isSetofReturn: true;
2944
- };
2945
- };
2946
- get_tags_for_event: {
2947
- Args: {
2948
- detector_models_caller?: string[];
2949
- end_timestamp_caller?: string;
2950
- event_id_caller: number;
2951
- max_elements_caller?: number;
2952
- start_timestamp_caller?: string;
2953
- };
2954
- Returns: Database["public"]["CompositeTypes"]["tags_pretty_location"][];
2955
- SetofOptions: {
2956
- from: "*";
2957
- to: "tags_pretty_location";
2958
- isOneToOne: false;
2959
- isSetofReturn: true;
2960
- };
2961
- };
2962
- get_total_artifacts_for_herd: {
2963
- Args: {
2964
- herd_id_caller: number;
2965
- };
2966
- Returns: number;
2967
- };
2968
- get_total_events_for_herd_with_session_filter: {
2969
- Args: {
2970
- exclude_session_events: boolean;
2971
- herd_id_caller: number;
2972
- };
2973
- Returns: number;
2974
- };
2975
- get_total_events_for_session: {
2976
- Args: {
2977
- session_id_caller: number;
2978
- };
2979
- Returns: number;
2980
- };
2981
- get_zones_and_actions_for_herd: {
2982
- Args: {
2983
- herd_id_caller: number;
2984
- limit_caller: number;
2985
- offset_caller: number;
2986
- };
2987
- Returns: Database["public"]["CompositeTypes"]["zones_and_actions_pretty_location"][];
2988
- SetofOptions: {
2989
- from: "*";
2990
- to: "zones_and_actions_pretty_location";
2991
- isOneToOne: false;
2992
- isSetofReturn: true;
2993
- };
2994
- };
2995
- is_platform_superadmin_current_user: {
2996
- Args: never;
2997
- Returns: boolean;
2998
- };
2999
- is_scout_email_valid: {
3000
- Args: {
3001
- p_email: string;
3002
- };
3003
- Returns: boolean;
3004
- };
3005
- leave_herd_for_current_user: {
3006
- Args: {
3007
- p_herd_id: number;
3008
- };
3009
- Returns: {
3010
- herd_id: number;
3011
- id: number;
3012
- inserted_at: string;
3013
- lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
3014
- lifecycle_changed_at: string;
3015
- lifecycle_changed_by: string | null;
3016
- lifecycle_reason: string | null;
3017
- role: Database["public"]["Enums"]["role"];
3018
- user_id: string;
3019
- };
3020
- SetofOptions: {
3021
- from: "*";
3022
- to: "users_roles_per_herd";
3023
- isOneToOne: true;
3024
- isSetofReturn: false;
3025
- };
3026
- };
3027
- remove_user_from_herd_for_admin: {
3028
- Args: {
3029
- p_herd_id: number;
3030
- p_user_id: string;
3031
- };
3032
- Returns: {
3033
- herd_id: number;
3034
- id: number;
3035
- inserted_at: string;
3036
- lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
3037
- lifecycle_changed_at: string;
3038
- lifecycle_changed_by: string | null;
3039
- lifecycle_reason: string | null;
3040
- role: Database["public"]["Enums"]["role"];
3041
- user_id: string;
3042
- };
3043
- SetofOptions: {
3044
- from: "*";
3045
- to: "users_roles_per_herd";
3046
- isOneToOne: true;
3047
- isSetofReturn: false;
3048
- };
3049
- };
3050
- load_api_keys: {
3051
- Args: {
3052
- id_of_device: number;
3053
- };
3054
- Returns: {
3055
- error: true;
3056
- } & "Could not choose the best candidate function between: public.load_api_keys(id_of_device => int8), public.load_api_keys(id_of_device => text). Try renaming the parameters or the function itself in the database so function overloading can be resolved";
3057
- } | {
3058
- Args: {
3059
- id_of_device: string;
3060
- };
3061
- Returns: {
3062
- error: true;
3063
- } & "Could not choose the best candidate function between: public.load_api_keys(id_of_device => int8), public.load_api_keys(id_of_device => text). Try renaming the parameters or the function itself in the database so function overloading can be resolved";
3064
- };
3065
- load_api_keys_batch: {
3066
- Args: {
3067
- device_ids: number[];
3068
- };
3069
- Returns: {
3070
- api_key_id: string;
3071
- api_key_key: string;
3072
- device_id: number;
3073
- }[];
3074
- };
3075
- load_api_keys_old: {
3076
- Args: {
3077
- id_of_device: string;
3078
- };
3079
- Returns: string[];
3080
- };
3081
- match_artifacts_by_vertex_embedding: {
3082
- Args: {
3083
- herd_id_caller?: number;
3084
- match_count: number;
3085
- match_threshold: number;
3086
- query_embedding: string;
3087
- };
3088
- Returns: Database["public"]["CompositeTypes"]["embedding_match"][];
3089
- SetofOptions: {
3090
- from: "*";
3091
- to: "embedding_match";
3092
- isOneToOne: false;
3093
- isSetofReturn: true;
3094
- };
3095
- };
3096
- match_events_by_vertex_embedding: {
3097
- Args: {
3098
- herd_id_caller?: number;
3099
- match_count: number;
3100
- match_threshold: number;
3101
- query_embedding: string;
3102
- };
3103
- Returns: Database["public"]["CompositeTypes"]["embedding_match"][];
3104
- SetofOptions: {
3105
- from: "*";
3106
- to: "embedding_match";
3107
- isOneToOne: false;
3108
- isSetofReturn: true;
3109
- };
3110
- };
3111
- migrate_conservaition_users_to_sentala: {
3112
- Args: {
3113
- preview?: boolean;
3114
- source_domains?: string[];
3115
- target_domain?: string;
3116
- };
3117
- Returns: {
3118
- action: string;
3119
- detail: string;
3120
- source_email: string;
3121
- source_user_id: string;
3122
- target_email: string;
3123
- target_user_id: string;
3124
- }[];
3125
- };
3126
- preview_fix_all_sessions_missing_distance: {
3127
- Args: never;
3128
- Returns: {
3129
- device_id: number;
3130
- new_distance_max_from_start: number;
3131
- new_distance_total: number;
3132
- old_distance_max_from_start: number;
3133
- old_distance_total: number;
3134
- session_id: number;
3135
- status: string;
3136
- }[];
3137
- };
3138
- preview_fix_session_distance_from_connectivity: {
3139
- Args: {
3140
- session_id_param: number;
3141
- };
3142
- Returns: {
3143
- new_distance_max_from_start: number;
3144
- new_distance_total: number;
3145
- old_distance_max_from_start: number;
3146
- old_distance_total: number;
3147
- session_id: number;
3148
- status: string;
3149
- }[];
3150
- };
3151
- reject_herd_invitations_for_current_user: {
3152
- Args: {
3153
- p_invitation_ids: number[];
3154
- };
3155
- Returns: {
3156
- accepted_at: string | null;
3157
- created_at: string;
3158
- email: string;
3159
- expires_at: string | null;
3160
- herd_id: number;
3161
- id: number;
3162
- invited_by: string;
3163
- role: Database["public"]["Enums"]["role"];
3164
- status: Database["public"]["Enums"]["herd_invitation_status"];
3165
- }[];
3166
- SetofOptions: {
3167
- from: "*";
3168
- to: "herd_invitations";
3169
- isOneToOne: false;
3170
- isSetofReturn: true;
3171
- };
3172
- };
3173
- remove_rls_broadcast_triggers: {
3174
- Args: never;
3175
- Returns: undefined;
3176
- };
3177
- revoke_herd_invitations: {
3178
- Args: {
3179
- p_invitation_ids: number[];
3180
- };
3181
- Returns: {
3182
- accepted_at: string | null;
3183
- created_at: string;
3184
- email: string;
3185
- expires_at: string | null;
3186
- herd_id: number;
3187
- id: number;
3188
- invited_by: string;
3189
- role: Database["public"]["Enums"]["role"];
3190
- status: Database["public"]["Enums"]["herd_invitation_status"];
3191
- }[];
3192
- SetofOptions: {
3193
- from: "*";
3194
- to: "herd_invitations";
3195
- isOneToOne: false;
3196
- isSetofReturn: true;
3197
- };
3198
- };
3199
- revoke_pubsub_jwt_public_key: {
3200
- Args: {
3201
- p_kid: string;
3202
- };
3203
- Returns: undefined;
3204
- };
3205
- search_embeddings_vertex_multimodal_001: {
3206
- Args: {
3207
- herd_id_caller?: number;
3208
- match_count: number;
3209
- match_threshold: number;
3210
- query_embedding: string;
3211
- };
3212
- Returns: Database["public"]["CompositeTypes"]["embedding_search_result"][];
3213
- SetofOptions: {
3214
- from: "*";
3215
- to: "embedding_search_result";
3216
- isOneToOne: false;
3217
- isSetofReturn: true;
3218
- };
3219
- };
3220
- set_herd_location: {
3221
- Args: {
3222
- p_herd_id: number;
3223
- p_latitude: number;
3224
- p_longitude: number;
3225
- };
3226
- Returns: undefined;
3227
- };
3228
- sync_orphan_session_links: {
3229
- Args: {
3230
- preview?: boolean;
3231
- };
3232
- Returns: {
3233
- assigned_session_id: number;
3234
- candidate_session_count: number;
3235
- device_id: number;
3236
- entity_id: number;
3237
- entity_type: string;
3238
- old_session_id: number;
3239
- status: string;
3240
- }[];
3241
- };
3242
- transfer_device_to_herd: {
3243
- Args: {
3244
- p_device_id: number;
3245
- p_target_herd_id: number;
3246
- };
3247
- Returns: undefined;
3248
- };
3249
- upsert_pubsub_jwt_public_key: {
3250
- Args: {
3251
- p_kid: string;
3252
- p_public_jwk: import("../types/supabase").Json;
3253
- };
3254
- Returns: undefined;
3255
- };
3256
- };
3257
- Enums: {
3258
- analysis_work_status: "waiting" | "cancelled" | "processing" | "failed" | "success";
3259
- app_permission: "herds.delete" | "events.delete";
3260
- 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";
3261
- entity_lifecycle: "active" | "retired" | "deleted";
3262
- herd_invitation_status: "pending" | "accepted" | "revoked" | "expired";
3263
- media_type: "image" | "video" | "audio" | "text";
3264
- plan_type: "mission" | "fence" | "rally" | "markov";
3265
- role: "admin" | "editor" | "viewer";
3266
- tag_observation_type: "manual" | "auto";
3267
- user_status: "ONLINE" | "OFFLINE";
3268
- };
3269
- CompositeTypes: {
3270
- connectivity_with_coordinates: {
3271
- id: number | null;
3272
- session_id: number | null;
3273
- device_id: number | null;
3274
- inserted_at: string | null;
3275
- timestamp_start: string | null;
3276
- signal: number | null;
3277
- noise: number | null;
3278
- altitude: number | null;
3279
- heading: number | null;
3280
- latitude: number | null;
3281
- longitude: number | null;
3282
- h14_index: string | null;
3283
- h13_index: string | null;
3284
- h12_index: string | null;
3285
- h11_index: string | null;
3286
- battery_percentage: number | null;
3287
- frequency_hz: number | null;
3288
- bandwidth_hz: number | null;
3289
- associated_station: string | null;
3290
- mode: string | null;
3291
- battery_volts: number | null;
3292
- };
3293
- device_heartbeat_analysis: {
3294
- device_id: number | null;
3295
- is_online: boolean | null;
3296
- last_heartbeat_time: string | null;
3297
- minutes_since_last_heartbeat: number | null;
3298
- heartbeat_history: boolean[] | null;
3299
- uptime_percentage: number | null;
3300
- heartbeat_intervals: number[] | null;
3301
- average_heartbeat_interval: number | null;
3302
- total_heartbeats: number | null;
3303
- analysis_window_start: string | null;
3304
- analysis_window_end: string | null;
3305
- };
3306
- device_pretty_location: {
3307
- id: number | null;
3308
- inserted_at: string | null;
3309
- created_by: string | null;
3310
- herd_id: number | null;
3311
- device_type: Database["public"]["Enums"]["device_type"] | null;
3312
- domain_name: string | null;
3313
- location: string | null;
3314
- altitude: number | null;
3315
- heading: number | null;
3316
- name: string | null;
3317
- description: string | null;
3318
- latitude: number | null;
3319
- longitude: number | null;
3320
- color: string | null;
3321
- };
3322
- embedding_match: {
3323
- id: number | null;
3324
- confidence: number | null;
3325
- };
3326
- embedding_search_result: {
3327
- id: number | null;
3328
- event_id: number | null;
3329
- artifact_id: number | null;
3330
- confidence: number | null;
3331
- };
3332
- event_and_tags: {
3333
- id: number | null;
3334
- inserted_at: string | null;
3335
- message: string | null;
3336
- media_url: string | null;
3337
- latitude: number | null;
3338
- longitude: number | null;
3339
- altitude: number | null;
3340
- heading: number | null;
3341
- media_type: Database["public"]["Enums"]["media_type"] | null;
3342
- device_id: number | null;
3343
- timestamp_observation: string | null;
3344
- is_public: boolean | null;
3345
- tags: Database["public"]["Tables"]["tags"]["Row"][] | null;
3346
- herd_id: number | null;
3347
- };
3348
- event_and_tags_pretty_location: {
3349
- id: number | null;
3350
- inserted_at: string | null;
3351
- message: string | null;
3352
- media_url: string | null;
3353
- file_path: string | null;
3354
- latitude: number | null;
3355
- longitude: number | null;
3356
- earthranger_url: string | null;
3357
- altitude: number | null;
3358
- heading: number | null;
3359
- media_type: Database["public"]["Enums"]["media_type"] | null;
3360
- device_id: number | null;
3361
- timestamp_observation: string | null;
3362
- is_public: boolean | null;
3363
- tags: Database["public"]["CompositeTypes"]["tags_pretty_location"][] | null;
3364
- herd_id: number | null;
3365
- embedded_at: string | null;
3366
- segmented_at: string | null;
3367
- tagged_at: string | null;
3368
- };
3369
- event_plus_tags: {
3370
- id: number | null;
3371
- inserted_at: string | null;
3372
- message: string | null;
3373
- media_url: string | null;
3374
- location: unknown;
3375
- earthranger_url: string | null;
3376
- altitude: number | null;
3377
- heading: number | null;
3378
- media_type: Database["public"]["Enums"]["media_type"] | null;
3379
- device_id: number | null;
3380
- timestamp_observation: string | null;
3381
- is_public: boolean | null;
3382
- tags: Database["public"]["Tables"]["tags"]["Row"][] | null;
3383
- herd_id: number | null;
3384
- };
3385
- event_with_tags: {
3386
- id: number | null;
3387
- inserted_at: string | null;
3388
- message: string | null;
3389
- media_url: string | null;
3390
- latitude: number | null;
3391
- longitude: number | null;
3392
- altitude: number | null;
3393
- heading: number | null;
3394
- media_type: Database["public"]["Enums"]["media_type"] | null;
3395
- device_id: number | null;
3396
- timestamp_observation: string | null;
3397
- is_public: boolean | null;
3398
- tags: Database["public"]["Tables"]["tags"]["Row"][] | null;
3399
- };
3400
- feed_item: {
3401
- feed_type: string | null;
3402
- sort_ts: string | null;
3403
- sort_id: number | null;
3404
- event_data: Database["public"]["CompositeTypes"]["event_and_tags_pretty_location"] | null;
3405
- artifact_data: Database["public"]["Tables"]["artifacts"]["Row"] | null;
3406
- };
3407
- herd_invitation_with_herd_slug: {
3408
- id: number | null;
3409
- email: string | null;
3410
- herd_id: number | null;
3411
- role: Database["public"]["Enums"]["role"] | null;
3412
- invited_by: string | null;
3413
- status: Database["public"]["Enums"]["herd_invitation_status"] | null;
3414
- created_at: string | null;
3415
- accepted_at: string | null;
3416
- expires_at: string | null;
3417
- herd_slug: string | null;
3418
- };
3419
- herds_pretty_location: {
3420
- id: number | null;
3421
- inserted_at: string | null;
3422
- slug: string | null;
3423
- description: string | null;
3424
- is_public: boolean | null;
3425
- earthranger_domain: string | null;
3426
- earthranger_token: string | null;
3427
- video_publisher_token: string | null;
3428
- video_subscriber_token: string | null;
3429
- video_server_url: string | null;
3430
- location: string | null;
3431
- latitude: number | null;
3432
- longitude: number | null;
3433
- auto_delete_media_with_humans: boolean | null;
3434
- auto_delete_media_with_no_tracks: boolean | null;
3435
- };
3436
- pins_pretty_location: {
3437
- id: number | null;
3438
- created_at: string | null;
3439
- location: unknown;
3440
- altitude_relative_to_ground: number | null;
3441
- color: string | null;
3442
- name: string | null;
3443
- description: string | null;
3444
- herd_id: number | null;
3445
- created_by: string | null;
3446
- latitude: number | null;
3447
- longitude: number | null;
3448
- };
3449
- segmentations_sam3_pretty: {
3450
- id: number | null;
3451
- created_at: string | null;
3452
- event_id: number | null;
3453
- artifact_id: number | null;
3454
- frame_index: number | null;
3455
- mask_rle: import("../types/supabase").Json | null;
3456
- conf: number | null;
3457
- timestamp_observation: string | null;
3458
- origin_location: unknown;
3459
- origin_pitch: number | null;
3460
- origin_heading: number | null;
3461
- origin_roll: number | null;
3462
- sensor_pitch: number | null;
3463
- sensor_yaw: number | null;
3464
- sensor_roll: number | null;
3465
- origin_height: number | null;
3466
- subject_location: unknown;
3467
- subject_height: number | null;
3468
- origin_latitude: number | null;
3469
- origin_longitude: number | null;
3470
- subject_latitude: number | null;
3471
- subject_longitude: number | null;
3472
- subject_id: number | null;
3473
- };
3474
- session_with_coordinates: {
3475
- id: number | null;
3476
- device_id: number | null;
3477
- timestamp_start: string | null;
3478
- timestamp_end: string | null;
3479
- inserted_at: string | null;
3480
- software_version: string | null;
3481
- locations_geojson: import("../types/supabase").Json | null;
3482
- altitude_max: number | null;
3483
- altitude_min: number | null;
3484
- altitude_average: number | null;
3485
- velocity_max: number | null;
3486
- velocity_min: number | null;
3487
- velocity_average: number | null;
3488
- distance_total: number | null;
3489
- distance_max_from_start: number | null;
3490
- };
3491
- tags_pretty_location: {
3492
- id: number | null;
3493
- inserted_at: string | null;
3494
- artifact_id: number | null;
3495
- event_id: number | null;
3496
- detector: string | null;
3497
- width: number | null;
3498
- height: number | null;
3499
- conf: number | null;
3500
- x: number | null;
3501
- y: number | null;
3502
- class: string | null;
3503
- timestamp_observation: string | null;
3504
- frame_index: number | null;
3505
- origin_location: unknown;
3506
- origin_pitch: number | null;
3507
- origin_heading: number | null;
3508
- origin_roll: number | null;
3509
- sensor_pitch: number | null;
3510
- sensor_yaw: number | null;
3511
- sensor_roll: number | null;
3512
- origin_height: number | null;
3513
- subject_location: unknown;
3514
- subject_height: number | null;
3515
- origin_latitude: number | null;
3516
- origin_longitude: number | null;
3517
- subject_latitude: number | null;
3518
- subject_longitude: number | null;
3519
- subject_id: number | null;
3520
- score: number | null;
3521
- score_source: string | null;
3522
- };
3523
- zones_and_actions_pretty_location: {
3524
- id: number | null;
3525
- inserted_at: string | null;
3526
- region: string | null;
3527
- herd_id: number | null;
3528
- actions: Database["public"]["Tables"]["actions"]["Row"][] | null;
3529
- };
3530
- };
3531
- }, {
3532
- PostgrestVersion: "13.0.5";
3533
- }>;
3534
- export declare function useConnectionStatus(): ConnectionStatus;
13
+ export interface ScoutRefreshAbilityParams {
14
+ /** Mint and verify a client abilities JWT. Default: `true`. */
15
+ mintClientAbilitiesToken?: boolean;
16
+ /**
17
+ * Expected JWT lifetime in seconds (default 1 hour).
18
+ * Align with edge `CLIENT_ABILITIES_TOKEN_TTL_SEC`; used to schedule re-mint
19
+ * (falls back when `exp` is missing; otherwise uses `exp` from the mint).
20
+ */
21
+ clientAbilitiesTokenTtlSec?: number;
22
+ /** Re-mint this many seconds before expiry (default 120). */
23
+ refreshBeforeExpirySec?: number;
24
+ /** Ms to cache pubkey RPC results (default 10 min). */
25
+ publicKeysCacheTtlMs?: number;
26
+ }
27
+ export declare function useSupabase(): SupabaseClient<Database>;
28
+ /** Verified client abilities JWT (minted on a schedule by ScoutRefreshProvider). */
29
+ export declare function useClientAbilitiesMint(): ClientAbilitiesMintState;
3535
30
  export interface ScoutRefreshProviderProps extends UseScoutRefreshOptions {
3536
31
  children: ReactNode;
32
+ abilityParams?: ScoutRefreshAbilityParams;
3537
33
  }
3538
- export declare function ScoutRefreshProvider({ children, ...refreshOptions }: ScoutRefreshProviderProps): import("react/jsx-runtime").JSX.Element;
3539
- export {};
34
+ export declare function ScoutRefreshProvider({ children, abilityParams, ...refreshOptions }: ScoutRefreshProviderProps): import("react/jsx-runtime").JSX.Element;