@adventurelabs/scout-core 1.0.42 → 1.0.44
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/dist/api_keys/actions.d.ts +1 -1
- package/dist/api_keys/actions.js +1 -0
- package/dist/helpers/devices.js +2 -0
- package/dist/helpers/tags.d.ts +1 -1
- package/dist/providers/ScoutRefreshProvider.d.ts +2 -2
- package/dist/supabase/server.d.ts +2 -2
- package/dist/types/herd_module.js +7 -1
- package/dist/types/supabase.d.ts +2 -2
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IApiKeyScout } from "../types/db";
|
|
2
2
|
export declare function server_list_api_keys(device_id: string): Promise<IApiKeyScout[]>;
|
|
3
|
-
export declare function server_list_api_keys_batch(device_ids:
|
|
3
|
+
export declare function server_list_api_keys_batch(device_ids: string[]): Promise<{
|
|
4
4
|
[device_id: number]: IApiKeyScout[];
|
|
5
5
|
}>;
|
package/dist/api_keys/actions.js
CHANGED
|
@@ -20,6 +20,7 @@ export async function server_list_api_keys(device_id) {
|
|
|
20
20
|
export async function server_list_api_keys_batch(device_ids) {
|
|
21
21
|
const startTime = Date.now();
|
|
22
22
|
console.log(`[API Keys Batch] Starting batch load for ${device_ids.length} devices at ${new Date().toISOString()}`);
|
|
23
|
+
console.log(`[API Keys Batch] Debug: device_ids array:`, device_ids);
|
|
23
24
|
const supabase = await newServerClient();
|
|
24
25
|
console.log(`[API Keys Batch] Making RPC call to load_api_keys_batch...`);
|
|
25
26
|
const { data, error } = await supabase.rpc("load_api_keys_batch", {
|
package/dist/helpers/devices.js
CHANGED
|
@@ -6,6 +6,8 @@ export async function get_devices_by_herd(herd_id, client) {
|
|
|
6
6
|
const { data, error } = await client.rpc("get_devices_for_herd", {
|
|
7
7
|
herd_id_caller: herd_id,
|
|
8
8
|
});
|
|
9
|
+
console.log(`[get_devices_by_herd] Raw RPC response:`, data);
|
|
10
|
+
console.log(`[get_devices_by_herd] First device sample:`, data?.[0]);
|
|
9
11
|
if (!data) {
|
|
10
12
|
return IWebResponse.error("No devices found").to_compatible();
|
|
11
13
|
}
|
package/dist/helpers/tags.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export declare function server_delete_tags_by_ids(tag_ids: number[]): Promise<IW
|
|
|
5
5
|
export declare function server_update_tags(tags: ITag[]): Promise<IWebResponseCompatible<ITag[]>>;
|
|
6
6
|
export declare function server_get_more_events_with_tags_by_herd(herd_id: number, offset: number, page_count?: number): Promise<IWebResponseCompatible<IEventWithTags[]>>;
|
|
7
7
|
export declare function server_get_events_and_tags_for_device(device_id: number, limit?: number): Promise<IWebResponseCompatible<IEventWithTags[]>>;
|
|
8
|
-
export declare function server_get_events_and_tags_for_devices_batch(device_ids:
|
|
8
|
+
export declare function server_get_events_and_tags_for_devices_batch(device_ids: string[], limit?: number): Promise<IWebResponseCompatible<{
|
|
9
9
|
[device_id: number]: IEventWithTags[];
|
|
10
10
|
}>>;
|
|
11
11
|
export declare function get_event_and_tags_by_event_id(event_id: number): Promise<IWebResponseCompatible<IEventWithTags>>;
|
|
@@ -746,7 +746,7 @@ export declare function useSupabase(): SupabaseClient<Database, "public", {
|
|
|
746
746
|
};
|
|
747
747
|
load_api_keys_batch: {
|
|
748
748
|
Args: {
|
|
749
|
-
device_ids:
|
|
749
|
+
device_ids: string[];
|
|
750
750
|
};
|
|
751
751
|
Returns: {
|
|
752
752
|
device_id: number;
|
|
@@ -756,7 +756,7 @@ export declare function useSupabase(): SupabaseClient<Database, "public", {
|
|
|
756
756
|
};
|
|
757
757
|
get_events_and_tags_for_devices_batch: {
|
|
758
758
|
Args: {
|
|
759
|
-
device_ids:
|
|
759
|
+
device_ids: string[];
|
|
760
760
|
limit_per_device: number;
|
|
761
761
|
};
|
|
762
762
|
Returns: {
|
|
@@ -737,7 +737,7 @@ export declare function newServerClient(): Promise<import("@supabase/supabase-js
|
|
|
737
737
|
};
|
|
738
738
|
load_api_keys_batch: {
|
|
739
739
|
Args: {
|
|
740
|
-
device_ids:
|
|
740
|
+
device_ids: string[];
|
|
741
741
|
};
|
|
742
742
|
Returns: {
|
|
743
743
|
device_id: number;
|
|
@@ -747,7 +747,7 @@ export declare function newServerClient(): Promise<import("@supabase/supabase-js
|
|
|
747
747
|
};
|
|
748
748
|
get_events_and_tags_for_devices_batch: {
|
|
749
749
|
Args: {
|
|
750
|
-
device_ids:
|
|
750
|
+
device_ids: string[];
|
|
751
751
|
limit_per_device: number;
|
|
752
752
|
};
|
|
753
753
|
Returns: {
|
|
@@ -61,7 +61,13 @@ export class HerdModule {
|
|
|
61
61
|
if (new_devices.length > 0) {
|
|
62
62
|
const batchStartTime = Date.now();
|
|
63
63
|
try {
|
|
64
|
-
|
|
64
|
+
console.log(`[HerdModule] Debug: new_devices array:`, new_devices.map((d) => ({
|
|
65
|
+
id: d.id,
|
|
66
|
+
type: typeof d.id,
|
|
67
|
+
created_by: d.created_by,
|
|
68
|
+
name: d.name,
|
|
69
|
+
})));
|
|
70
|
+
const device_ids = new_devices.map((device) => (device.id ?? 0).toString());
|
|
65
71
|
console.log(`[HerdModule] Starting parallel batch load for ${device_ids.length} devices at ${new Date().toISOString()}:`, device_ids);
|
|
66
72
|
// Load API keys and events in parallel
|
|
67
73
|
console.log(`[HerdModule] Initiating Promise.all for API keys and events...`);
|
package/dist/types/supabase.d.ts
CHANGED
|
@@ -804,7 +804,7 @@ export type Database = {
|
|
|
804
804
|
};
|
|
805
805
|
load_api_keys_batch: {
|
|
806
806
|
Args: {
|
|
807
|
-
device_ids:
|
|
807
|
+
device_ids: string[];
|
|
808
808
|
};
|
|
809
809
|
Returns: {
|
|
810
810
|
device_id: number;
|
|
@@ -814,7 +814,7 @@ export type Database = {
|
|
|
814
814
|
};
|
|
815
815
|
get_events_and_tags_for_devices_batch: {
|
|
816
816
|
Args: {
|
|
817
|
-
device_ids:
|
|
817
|
+
device_ids: string[];
|
|
818
818
|
limit_per_device: number;
|
|
819
819
|
};
|
|
820
820
|
Returns: {
|