@adventurelabs/scout-core 1.0.23 → 1.0.25
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.
- package/LICENSE +594 -0
- package/README.md +21 -21
- package/dist/helpers/index.d.ts +1 -0
- package/dist/helpers/index.js +1 -0
- package/dist/helpers/sessions.d.ts +30 -0
- package/dist/helpers/sessions.js +241 -0
- package/dist/hooks/useScoutDbListener.js +12 -0
- package/dist/providers/ScoutRefreshProvider.d.ts +130 -6
- package/dist/store/scout.js +6 -0
- package/dist/supabase/server.d.ts +130 -6
- package/dist/types/db.d.ts +18 -1
- package/dist/types/db.js +1 -16
- package/dist/types/supabase.d.ts +135 -6
- package/package.json +5 -5
package/dist/types/db.d.ts
CHANGED
|
@@ -16,6 +16,8 @@ export type IAction = Database["public"]["Tables"]["actions"]["Row"];
|
|
|
16
16
|
export type IZone = Database["public"]["Tables"]["zones"]["Row"];
|
|
17
17
|
export type IUserRolePerHerd = Database["public"]["Tables"]["users_roles_per_herd"]["Row"];
|
|
18
18
|
export type IHerd = Database["public"]["Tables"]["herds"]["Row"];
|
|
19
|
+
export type ISession = Database["public"]["Tables"]["sessions"]["Row"];
|
|
20
|
+
export type IConnectivity = Database["public"]["Tables"]["connectivity"]["Row"];
|
|
19
21
|
export type IEventWithTags = Database["public"]["CompositeTypes"]["event_with_tags"] & {
|
|
20
22
|
earthranger_url: string | null;
|
|
21
23
|
file_path: string | null;
|
|
@@ -26,6 +28,22 @@ export type IZonesAndActionsPrettyLocation = Database["public"]["CompositeTypes"
|
|
|
26
28
|
export interface IZoneWithActions extends IZone {
|
|
27
29
|
actions: IAction[];
|
|
28
30
|
}
|
|
31
|
+
export interface ISessionWithConnectivity extends ISession {
|
|
32
|
+
connectivity: IConnectivity[];
|
|
33
|
+
}
|
|
34
|
+
export interface ISessionWithEvents extends ISession {
|
|
35
|
+
events: IEvent[];
|
|
36
|
+
}
|
|
37
|
+
export interface ISessionWithConnectivityAndEvents extends ISession {
|
|
38
|
+
connectivity: IConnectivity[];
|
|
39
|
+
events: IEvent[];
|
|
40
|
+
}
|
|
41
|
+
export interface IConnectivityWithSession extends IConnectivity {
|
|
42
|
+
session: ISession;
|
|
43
|
+
}
|
|
44
|
+
export interface IEventWithSession extends IEvent {
|
|
45
|
+
session: ISession | null;
|
|
46
|
+
}
|
|
29
47
|
export type IUserAndRole = {
|
|
30
48
|
user: {
|
|
31
49
|
id: string;
|
|
@@ -40,4 +58,3 @@ export interface IApiKeyScout {
|
|
|
40
58
|
}
|
|
41
59
|
export type Tag = ITag;
|
|
42
60
|
export type TagClassName = string;
|
|
43
|
-
export declare const DUMMY_EVENT: IEvent;
|
package/dist/types/db.js
CHANGED
|
@@ -1,16 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export const DUMMY_EVENT = {
|
|
3
|
-
id: 0,
|
|
4
|
-
inserted_at: new Date().toISOString(),
|
|
5
|
-
device_id: 0,
|
|
6
|
-
message: "Dummy event",
|
|
7
|
-
media_url: "",
|
|
8
|
-
media_type: "image",
|
|
9
|
-
location: null,
|
|
10
|
-
altitude: 0,
|
|
11
|
-
heading: 0,
|
|
12
|
-
is_public: true,
|
|
13
|
-
timestamp_observation: new Date().toISOString(),
|
|
14
|
-
earthranger_url: null,
|
|
15
|
-
file_path: null,
|
|
16
|
-
};
|
|
1
|
+
export {};
|
package/dist/types/supabase.d.ts
CHANGED
|
@@ -68,6 +68,62 @@ export type Database = {
|
|
|
68
68
|
}
|
|
69
69
|
];
|
|
70
70
|
};
|
|
71
|
+
connectivity: {
|
|
72
|
+
Row: {
|
|
73
|
+
altitude: number;
|
|
74
|
+
h11_index: number;
|
|
75
|
+
h12_index: number;
|
|
76
|
+
h13_index: number;
|
|
77
|
+
h14_index: number;
|
|
78
|
+
heading: number;
|
|
79
|
+
id: number;
|
|
80
|
+
inserted_at: string;
|
|
81
|
+
location: unknown;
|
|
82
|
+
noise: number;
|
|
83
|
+
session_id: number;
|
|
84
|
+
signal: number;
|
|
85
|
+
timestamp_start: string;
|
|
86
|
+
};
|
|
87
|
+
Insert: {
|
|
88
|
+
altitude: number;
|
|
89
|
+
h11_index: number;
|
|
90
|
+
h12_index: number;
|
|
91
|
+
h13_index: number;
|
|
92
|
+
h14_index: number;
|
|
93
|
+
heading: number;
|
|
94
|
+
id?: number;
|
|
95
|
+
inserted_at?: string;
|
|
96
|
+
location: unknown;
|
|
97
|
+
noise: number;
|
|
98
|
+
session_id: number;
|
|
99
|
+
signal: number;
|
|
100
|
+
timestamp_start: string;
|
|
101
|
+
};
|
|
102
|
+
Update: {
|
|
103
|
+
altitude?: number;
|
|
104
|
+
h11_index?: number;
|
|
105
|
+
h12_index?: number;
|
|
106
|
+
h13_index?: number;
|
|
107
|
+
h14_index?: number;
|
|
108
|
+
heading?: number;
|
|
109
|
+
id?: number;
|
|
110
|
+
inserted_at?: string;
|
|
111
|
+
location?: unknown;
|
|
112
|
+
noise?: number;
|
|
113
|
+
session_id?: number;
|
|
114
|
+
signal?: number;
|
|
115
|
+
timestamp_start?: string;
|
|
116
|
+
};
|
|
117
|
+
Relationships: [
|
|
118
|
+
{
|
|
119
|
+
foreignKeyName: "connectivity_session_id_fkey";
|
|
120
|
+
columns: ["session_id"];
|
|
121
|
+
isOneToOne: false;
|
|
122
|
+
referencedRelation: "sessions";
|
|
123
|
+
referencedColumns: ["id"];
|
|
124
|
+
}
|
|
125
|
+
];
|
|
126
|
+
};
|
|
71
127
|
devices: {
|
|
72
128
|
Row: {
|
|
73
129
|
altitude: number | null;
|
|
@@ -144,22 +200,24 @@ export type Database = {
|
|
|
144
200
|
location: unknown | null;
|
|
145
201
|
media_type: Database["public"]["Enums"]["media_type"];
|
|
146
202
|
media_url: string | null;
|
|
147
|
-
message: string;
|
|
203
|
+
message: string | null;
|
|
204
|
+
session_id: number | null;
|
|
148
205
|
timestamp_observation: string;
|
|
149
206
|
};
|
|
150
207
|
Insert: {
|
|
151
|
-
altitude
|
|
208
|
+
altitude?: number;
|
|
152
209
|
device_id: number;
|
|
153
210
|
earthranger_url?: string | null;
|
|
154
211
|
file_path?: string | null;
|
|
155
|
-
heading
|
|
212
|
+
heading?: number;
|
|
156
213
|
id?: number;
|
|
157
214
|
inserted_at?: string;
|
|
158
215
|
is_public?: boolean;
|
|
159
216
|
location?: unknown | null;
|
|
160
217
|
media_type?: Database["public"]["Enums"]["media_type"];
|
|
161
218
|
media_url?: string | null;
|
|
162
|
-
message
|
|
219
|
+
message?: string | null;
|
|
220
|
+
session_id?: number | null;
|
|
163
221
|
timestamp_observation?: string;
|
|
164
222
|
};
|
|
165
223
|
Update: {
|
|
@@ -174,7 +232,8 @@ export type Database = {
|
|
|
174
232
|
location?: unknown | null;
|
|
175
233
|
media_type?: Database["public"]["Enums"]["media_type"];
|
|
176
234
|
media_url?: string | null;
|
|
177
|
-
message?: string;
|
|
235
|
+
message?: string | null;
|
|
236
|
+
session_id?: number | null;
|
|
178
237
|
timestamp_observation?: string;
|
|
179
238
|
};
|
|
180
239
|
Relationships: [
|
|
@@ -184,6 +243,13 @@ export type Database = {
|
|
|
184
243
|
isOneToOne: false;
|
|
185
244
|
referencedRelation: "devices";
|
|
186
245
|
referencedColumns: ["id"];
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
foreignKeyName: "events_session_id_fkey";
|
|
249
|
+
columns: ["session_id"];
|
|
250
|
+
isOneToOne: false;
|
|
251
|
+
referencedRelation: "sessions";
|
|
252
|
+
referencedColumns: ["id"];
|
|
187
253
|
}
|
|
188
254
|
];
|
|
189
255
|
};
|
|
@@ -269,6 +335,68 @@ export type Database = {
|
|
|
269
335
|
}
|
|
270
336
|
];
|
|
271
337
|
};
|
|
338
|
+
sessions: {
|
|
339
|
+
Row: {
|
|
340
|
+
altitude_average: number;
|
|
341
|
+
altitude_max: number;
|
|
342
|
+
altitude_min: number;
|
|
343
|
+
device_id: number;
|
|
344
|
+
distance_max_from_start: number;
|
|
345
|
+
distance_total: number;
|
|
346
|
+
id: number;
|
|
347
|
+
inserted_at: string;
|
|
348
|
+
locations: unknown;
|
|
349
|
+
software_version: string;
|
|
350
|
+
timestamp_end: string;
|
|
351
|
+
timestamp_start: string;
|
|
352
|
+
velocity_average: number;
|
|
353
|
+
velocity_max: number;
|
|
354
|
+
velocity_min: number;
|
|
355
|
+
};
|
|
356
|
+
Insert: {
|
|
357
|
+
altitude_average: number;
|
|
358
|
+
altitude_max: number;
|
|
359
|
+
altitude_min: number;
|
|
360
|
+
device_id: number;
|
|
361
|
+
distance_max_from_start: number;
|
|
362
|
+
distance_total: number;
|
|
363
|
+
id?: number;
|
|
364
|
+
inserted_at?: string;
|
|
365
|
+
locations: unknown;
|
|
366
|
+
software_version: string;
|
|
367
|
+
timestamp_end: string;
|
|
368
|
+
timestamp_start: string;
|
|
369
|
+
velocity_average: number;
|
|
370
|
+
velocity_max: number;
|
|
371
|
+
velocity_min: number;
|
|
372
|
+
};
|
|
373
|
+
Update: {
|
|
374
|
+
altitude_average?: number;
|
|
375
|
+
altitude_max?: number;
|
|
376
|
+
altitude_min?: number;
|
|
377
|
+
device_id?: number;
|
|
378
|
+
distance_max_from_start?: number;
|
|
379
|
+
distance_total?: number;
|
|
380
|
+
id?: number;
|
|
381
|
+
inserted_at?: string;
|
|
382
|
+
locations?: unknown;
|
|
383
|
+
software_version?: string;
|
|
384
|
+
timestamp_end?: string;
|
|
385
|
+
timestamp_start?: string;
|
|
386
|
+
velocity_average?: number;
|
|
387
|
+
velocity_max?: number;
|
|
388
|
+
velocity_min?: number;
|
|
389
|
+
};
|
|
390
|
+
Relationships: [
|
|
391
|
+
{
|
|
392
|
+
foreignKeyName: "sessions_device_id_fkey";
|
|
393
|
+
columns: ["device_id"];
|
|
394
|
+
isOneToOne: false;
|
|
395
|
+
referencedRelation: "devices";
|
|
396
|
+
referencedColumns: ["id"];
|
|
397
|
+
}
|
|
398
|
+
];
|
|
399
|
+
};
|
|
272
400
|
tags: {
|
|
273
401
|
Row: {
|
|
274
402
|
class_name: string;
|
|
@@ -556,7 +684,8 @@ export type Database = {
|
|
|
556
684
|
location: unknown | null;
|
|
557
685
|
media_type: Database["public"]["Enums"]["media_type"];
|
|
558
686
|
media_url: string | null;
|
|
559
|
-
message: string;
|
|
687
|
+
message: string | null;
|
|
688
|
+
session_id: number | null;
|
|
560
689
|
timestamp_observation: string;
|
|
561
690
|
}[];
|
|
562
691
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adventurelabs/scout-core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.25",
|
|
4
4
|
"description": "Core utilities and helpers for Adventure Labs Scout applications",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -23,15 +23,15 @@
|
|
|
23
23
|
"typescript"
|
|
24
24
|
],
|
|
25
25
|
"author": "Adventure Labs",
|
|
26
|
-
"license": "
|
|
26
|
+
"license": "GPL-3.0",
|
|
27
27
|
"repository": {
|
|
28
28
|
"type": "git",
|
|
29
|
-
"url": "https://github.com/
|
|
29
|
+
"url": "https://github.com/Adventurous-Bytes/scout.git"
|
|
30
30
|
},
|
|
31
31
|
"bugs": {
|
|
32
|
-
"url": "https://github.com/
|
|
32
|
+
"url": "https://github.com/Adventurous-Bytes/scout/issues"
|
|
33
33
|
},
|
|
34
|
-
"homepage": "https://github.com/
|
|
34
|
+
"homepage": "https://github.com/Adventurous-Bytes/scout#readme",
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"react": ">=18.0.0",
|
|
37
37
|
"react-dom": ">=18.0.0",
|