harvester_sdk 1.0.65 → 1.0.67
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/sdk.d.ts +12 -0
- package/dist/sdk.js +17 -0
- package/dist/types.d.ts +21 -0
- package/dist/types.js +1 -0
- package/package.json +1 -1
- package/sdk.ts +18 -0
- package/types.ts +21 -1
package/dist/sdk.d.ts
CHANGED
|
@@ -273,6 +273,18 @@ export declare class HarvesterSDK {
|
|
|
273
273
|
* ```
|
|
274
274
|
*/
|
|
275
275
|
getEvents(params: GetEventsParams): Promise<EventType[]>;
|
|
276
|
+
/**
|
|
277
|
+
* Get events by their ids
|
|
278
|
+
*
|
|
279
|
+
* @param event_ids - Array of event ids
|
|
280
|
+
* @returns Array of events
|
|
281
|
+
*
|
|
282
|
+
* @example
|
|
283
|
+
* ```typescript
|
|
284
|
+
* const events = await harvester.getEventsByIds(['event-id-1', 'event-id-2']);
|
|
285
|
+
* ```
|
|
286
|
+
*/
|
|
287
|
+
getEventsByIds(event_ids: string[]): Promise<EventType[]>;
|
|
276
288
|
/**
|
|
277
289
|
* Convert relative time to absolute time range
|
|
278
290
|
*/
|
package/dist/sdk.js
CHANGED
|
@@ -274,6 +274,23 @@ class HarvesterSDK {
|
|
|
274
274
|
});
|
|
275
275
|
return response.data.data;
|
|
276
276
|
}
|
|
277
|
+
/**
|
|
278
|
+
* Get events by their ids
|
|
279
|
+
*
|
|
280
|
+
* @param event_ids - Array of event ids
|
|
281
|
+
* @returns Array of events
|
|
282
|
+
*
|
|
283
|
+
* @example
|
|
284
|
+
* ```typescript
|
|
285
|
+
* const events = await harvester.getEventsByIds(['event-id-1', 'event-id-2']);
|
|
286
|
+
* ```
|
|
287
|
+
*/
|
|
288
|
+
async getEventsByIds(event_ids) {
|
|
289
|
+
const response = await this.client.get('/events/by-ids', {
|
|
290
|
+
params: this.buildQueryParams({ event_ids }),
|
|
291
|
+
});
|
|
292
|
+
return response.data.data;
|
|
293
|
+
}
|
|
277
294
|
// ============================================
|
|
278
295
|
// HELPER METHODS
|
|
279
296
|
// ============================================
|
package/dist/types.d.ts
CHANGED
|
@@ -2372,6 +2372,7 @@ export declare const zodEventSchema: z.ZodObject<{
|
|
|
2372
2372
|
}> | undefined;
|
|
2373
2373
|
}>;
|
|
2374
2374
|
export declare const zodEventMonitoringSchema: z.ZodObject<{
|
|
2375
|
+
_id: z.ZodOptional<z.ZodString>;
|
|
2375
2376
|
geo_selection_id: z.ZodString;
|
|
2376
2377
|
geo_selection_title: z.ZodString;
|
|
2377
2378
|
region_id: z.ZodString;
|
|
@@ -2427,6 +2428,7 @@ export declare const zodEventMonitoringSchema: z.ZodObject<{
|
|
|
2427
2428
|
completion_tokens_cost: number;
|
|
2428
2429
|
total_cost: number;
|
|
2429
2430
|
};
|
|
2431
|
+
_id?: string | undefined;
|
|
2430
2432
|
geo_selection_group_id?: string | undefined;
|
|
2431
2433
|
event_ids?: string[] | undefined;
|
|
2432
2434
|
}, {
|
|
@@ -2448,8 +2450,27 @@ export declare const zodEventMonitoringSchema: z.ZodObject<{
|
|
|
2448
2450
|
completion_tokens_cost: number;
|
|
2449
2451
|
total_cost: number;
|
|
2450
2452
|
};
|
|
2453
|
+
_id?: string | undefined;
|
|
2451
2454
|
geo_selection_group_id?: string | undefined;
|
|
2452
2455
|
event_ids?: string[] | undefined;
|
|
2453
2456
|
}>;
|
|
2454
2457
|
export type EventType = z.infer<typeof zodEventSchema>;
|
|
2455
2458
|
export type EventMonitoringType = z.infer<typeof zodEventMonitoringSchema>;
|
|
2459
|
+
export type EventMonitoringGrouped = {
|
|
2460
|
+
geo_selection_title: string;
|
|
2461
|
+
geo_selection_id: string;
|
|
2462
|
+
total_data_count: number;
|
|
2463
|
+
total_existing_events_count: number;
|
|
2464
|
+
total_events_updated: number;
|
|
2465
|
+
total_events_created: number;
|
|
2466
|
+
total_skipped: number;
|
|
2467
|
+
total_token_usage: {
|
|
2468
|
+
total_tokens: number;
|
|
2469
|
+
prompt_tokens: number;
|
|
2470
|
+
completion_tokens: number;
|
|
2471
|
+
prompt_tokens_cost: number;
|
|
2472
|
+
completion_tokens_cost: number;
|
|
2473
|
+
total_cost: number;
|
|
2474
|
+
};
|
|
2475
|
+
items: EventMonitoringType[];
|
|
2476
|
+
};
|
package/dist/types.js
CHANGED
|
@@ -484,6 +484,7 @@ exports.zodEventSchema = zod_1.z.object({
|
|
|
484
484
|
})).optional(),
|
|
485
485
|
});
|
|
486
486
|
exports.zodEventMonitoringSchema = zod_1.z.object({
|
|
487
|
+
_id: zod_1.z.string().optional(),
|
|
487
488
|
geo_selection_id: zod_1.z.string(),
|
|
488
489
|
geo_selection_title: zod_1.z.string(),
|
|
489
490
|
region_id: zod_1.z.string(),
|
package/package.json
CHANGED
package/sdk.ts
CHANGED
|
@@ -477,6 +477,24 @@ export class HarvesterSDK {
|
|
|
477
477
|
return response.data.data;
|
|
478
478
|
}
|
|
479
479
|
|
|
480
|
+
/**
|
|
481
|
+
* Get events by their ids
|
|
482
|
+
*
|
|
483
|
+
* @param event_ids - Array of event ids
|
|
484
|
+
* @returns Array of events
|
|
485
|
+
*
|
|
486
|
+
* @example
|
|
487
|
+
* ```typescript
|
|
488
|
+
* const events = await harvester.getEventsByIds(['event-id-1', 'event-id-2']);
|
|
489
|
+
* ```
|
|
490
|
+
*/
|
|
491
|
+
async getEventsByIds(event_ids: string[]): Promise<EventType[]> {
|
|
492
|
+
const response = await this.client.get<{ data: EventType[] }>('/events/by-ids', {
|
|
493
|
+
params: this.buildQueryParams({ event_ids }),
|
|
494
|
+
});
|
|
495
|
+
return response.data.data;
|
|
496
|
+
}
|
|
497
|
+
|
|
480
498
|
// ============================================
|
|
481
499
|
// HELPER METHODS
|
|
482
500
|
// ============================================
|
package/types.ts
CHANGED
|
@@ -559,6 +559,7 @@ export const zodEventSchema = z.object({
|
|
|
559
559
|
});
|
|
560
560
|
|
|
561
561
|
export const zodEventMonitoringSchema = z.object({
|
|
562
|
+
_id: z.string().optional(),
|
|
562
563
|
geo_selection_id: z.string(),
|
|
563
564
|
geo_selection_title: z.string(),
|
|
564
565
|
region_id: z.string(),
|
|
@@ -582,4 +583,23 @@ export const zodEventMonitoringSchema = z.object({
|
|
|
582
583
|
});
|
|
583
584
|
|
|
584
585
|
export type EventType = z.infer<typeof zodEventSchema>;
|
|
585
|
-
export type EventMonitoringType = z.infer<typeof zodEventMonitoringSchema>;
|
|
586
|
+
export type EventMonitoringType = z.infer<typeof zodEventMonitoringSchema>;
|
|
587
|
+
|
|
588
|
+
export type EventMonitoringGrouped = {
|
|
589
|
+
geo_selection_title: string;
|
|
590
|
+
geo_selection_id: string;
|
|
591
|
+
total_data_count: number;
|
|
592
|
+
total_existing_events_count: number;
|
|
593
|
+
total_events_updated: number;
|
|
594
|
+
total_events_created: number;
|
|
595
|
+
total_skipped: number;
|
|
596
|
+
total_token_usage: {
|
|
597
|
+
total_tokens: number;
|
|
598
|
+
prompt_tokens: number;
|
|
599
|
+
completion_tokens: number;
|
|
600
|
+
prompt_tokens_cost: number;
|
|
601
|
+
completion_tokens_cost: number;
|
|
602
|
+
total_cost: number;
|
|
603
|
+
};
|
|
604
|
+
items: EventMonitoringType[];
|
|
605
|
+
};
|