@adventurelabs/scout-core 1.0.122 → 1.0.124
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.
|
@@ -3,7 +3,6 @@ import { DeviceInsert, IDevice } from "../types/db";
|
|
|
3
3
|
import { IWebResponseCompatible } from "../types/requests";
|
|
4
4
|
import { SupabaseClient } from "@supabase/supabase-js";
|
|
5
5
|
export declare function get_devices_by_herd(herd_id: number, client: SupabaseClient<Database>): Promise<IWebResponseCompatible<IDevice[]>>;
|
|
6
|
-
export declare function get_device_by_id(device_id: number, client?: SupabaseClient<Database>): Promise<IWebResponseCompatible<IDevice | null>>;
|
|
7
6
|
export declare function serverUpdateDevice(updatedDevice: IDevice): Promise<IWebResponseCompatible<IDevice | null>>;
|
|
8
7
|
export declare function serverCreateDevice(newDevice: DeviceInsert): Promise<IWebResponseCompatible<IDevice | null>>;
|
|
9
8
|
export declare function serverDeleteDeviceById(device_id: number): Promise<IWebResponseCompatible<IDevice | null>>;
|
package/dist/helpers/devices.js
CHANGED
|
@@ -14,21 +14,6 @@ export async function get_devices_by_herd(herd_id, client) {
|
|
|
14
14
|
return response.to_compatible();
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
export async function get_device_by_id(device_id, client) {
|
|
18
|
-
if (!client) {
|
|
19
|
-
client = await newServerClient();
|
|
20
|
-
}
|
|
21
|
-
const { data, error } = await client.rpc("get_device_with_components_by_id", {
|
|
22
|
-
device_id_caller: device_id,
|
|
23
|
-
});
|
|
24
|
-
if (!data) {
|
|
25
|
-
return IWebResponse.error("No device found").to_compatible();
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
let response = IWebResponse.success(data);
|
|
29
|
-
return response.to_compatible();
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
17
|
export async function serverUpdateDevice(updatedDevice) {
|
|
33
18
|
// delete api keys, latitide, and longitude
|
|
34
19
|
const device_formatted = { ...updatedDevice };
|
|
@@ -1146,10 +1146,10 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
1146
1146
|
Args: {
|
|
1147
1147
|
device_id_caller: number;
|
|
1148
1148
|
};
|
|
1149
|
-
Returns: Database["public"]["CompositeTypes"]["
|
|
1149
|
+
Returns: Database["public"]["CompositeTypes"]["device_pretty_location"];
|
|
1150
1150
|
SetofOptions: {
|
|
1151
1151
|
from: "*";
|
|
1152
|
-
to: "
|
|
1152
|
+
to: "device_pretty_location";
|
|
1153
1153
|
isOneToOne: true;
|
|
1154
1154
|
isSetofReturn: false;
|
|
1155
1155
|
};
|
|
@@ -1384,6 +1384,15 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
1384
1384
|
user_status: "ONLINE" | "OFFLINE";
|
|
1385
1385
|
};
|
|
1386
1386
|
CompositeTypes: {
|
|
1387
|
+
component_detail: {
|
|
1388
|
+
id: number | null;
|
|
1389
|
+
serial_number: string | null;
|
|
1390
|
+
product_number: string | null;
|
|
1391
|
+
certificate_id: number | null;
|
|
1392
|
+
status: Database["public"]["Enums"]["component_status"] | null;
|
|
1393
|
+
created_at: string | null;
|
|
1394
|
+
updated_at: string | null;
|
|
1395
|
+
};
|
|
1387
1396
|
connectivity_with_coordinates: {
|
|
1388
1397
|
id: number | null;
|
|
1389
1398
|
session_id: number | null;
|
|
@@ -1447,7 +1456,7 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
1447
1456
|
description: string | null;
|
|
1448
1457
|
latitude: number | null;
|
|
1449
1458
|
longitude: number | null;
|
|
1450
|
-
components:
|
|
1459
|
+
components: Database["public"]["CompositeTypes"]["component_detail"][] | null;
|
|
1451
1460
|
};
|
|
1452
1461
|
event_and_tags: {
|
|
1453
1462
|
id: number | null;
|
package/dist/types/db.d.ts
CHANGED
|
@@ -30,6 +30,31 @@ export type IArtifact = Database["public"]["Tables"]["artifacts"]["Row"];
|
|
|
30
30
|
export type IArtifactWithMediaUrl = IArtifact & {
|
|
31
31
|
media_url?: string | null;
|
|
32
32
|
};
|
|
33
|
+
export type IComponentInfo = {
|
|
34
|
+
id: number;
|
|
35
|
+
serial_number: string;
|
|
36
|
+
product_number: string | null;
|
|
37
|
+
certificate_id: number | null;
|
|
38
|
+
status: Database["public"]["Enums"]["component_status"];
|
|
39
|
+
created_at: string;
|
|
40
|
+
updated_at: string | null;
|
|
41
|
+
};
|
|
42
|
+
export type IDeviceWithComponents = {
|
|
43
|
+
id: number;
|
|
44
|
+
inserted_at: string;
|
|
45
|
+
created_by: string | null;
|
|
46
|
+
herd_id: number;
|
|
47
|
+
device_type: Database["public"]["Enums"]["device_type"];
|
|
48
|
+
domain_name: string | null;
|
|
49
|
+
location: string | null;
|
|
50
|
+
altitude: number | null;
|
|
51
|
+
heading: number | null;
|
|
52
|
+
name: string | null;
|
|
53
|
+
description: string | null;
|
|
54
|
+
latitude: number | null;
|
|
55
|
+
longitude: number | null;
|
|
56
|
+
components: IComponentInfo[];
|
|
57
|
+
};
|
|
33
58
|
export type ComponentInsert = Database["public"]["Tables"]["components"]["Insert"];
|
|
34
59
|
export type VersionsSoftwareInsert = Database["public"]["Tables"]["versions_software"]["Insert"];
|
|
35
60
|
export type ArtifactInsert = Database["public"]["Tables"]["artifacts"]["Insert"];
|
package/dist/types/supabase.d.ts
CHANGED
|
@@ -1200,10 +1200,10 @@ export type Database = {
|
|
|
1200
1200
|
Args: {
|
|
1201
1201
|
device_id_caller: number;
|
|
1202
1202
|
};
|
|
1203
|
-
Returns: Database["public"]["CompositeTypes"]["
|
|
1203
|
+
Returns: Database["public"]["CompositeTypes"]["device_pretty_location"];
|
|
1204
1204
|
SetofOptions: {
|
|
1205
1205
|
from: "*";
|
|
1206
|
-
to: "
|
|
1206
|
+
to: "device_pretty_location";
|
|
1207
1207
|
isOneToOne: true;
|
|
1208
1208
|
isSetofReturn: false;
|
|
1209
1209
|
};
|
|
@@ -1438,6 +1438,15 @@ export type Database = {
|
|
|
1438
1438
|
user_status: "ONLINE" | "OFFLINE";
|
|
1439
1439
|
};
|
|
1440
1440
|
CompositeTypes: {
|
|
1441
|
+
component_detail: {
|
|
1442
|
+
id: number | null;
|
|
1443
|
+
serial_number: string | null;
|
|
1444
|
+
product_number: string | null;
|
|
1445
|
+
certificate_id: number | null;
|
|
1446
|
+
status: Database["public"]["Enums"]["component_status"] | null;
|
|
1447
|
+
created_at: string | null;
|
|
1448
|
+
updated_at: string | null;
|
|
1449
|
+
};
|
|
1441
1450
|
connectivity_with_coordinates: {
|
|
1442
1451
|
id: number | null;
|
|
1443
1452
|
session_id: number | null;
|
|
@@ -1501,7 +1510,7 @@ export type Database = {
|
|
|
1501
1510
|
description: string | null;
|
|
1502
1511
|
latitude: number | null;
|
|
1503
1512
|
longitude: number | null;
|
|
1504
|
-
components:
|
|
1513
|
+
components: Database["public"]["CompositeTypes"]["component_detail"][] | null;
|
|
1505
1514
|
};
|
|
1506
1515
|
event_and_tags: {
|
|
1507
1516
|
id: number | null;
|