harvester_sdk 1.0.63 → 1.0.64
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 +18 -1
- package/dist/sdk.js +20 -0
- package/package.json +1 -1
- package/sdk.ts +29 -0
package/dist/sdk.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AxiosRequestConfig } from 'axios';
|
|
2
|
-
import { RegionType, DataType, platformsList, GeoSelectionType, RegionSummaryType } from './types';
|
|
2
|
+
import { RegionType, DataType, platformsList, GeoSelectionType, RegionSummaryType, EventType } from './types';
|
|
3
3
|
export interface HarvesterSDKConfig {
|
|
4
4
|
baseUrl: string;
|
|
5
5
|
apiKey?: string;
|
|
@@ -31,6 +31,11 @@ export interface GetGeosParams extends PaginationParams {
|
|
|
31
31
|
is_used?: boolean;
|
|
32
32
|
search?: string;
|
|
33
33
|
}
|
|
34
|
+
export interface GetEventsParams {
|
|
35
|
+
region_id: string;
|
|
36
|
+
created_at?: number;
|
|
37
|
+
geo_selection_id?: string;
|
|
38
|
+
}
|
|
34
39
|
export interface GetDataParams extends PaginationParams {
|
|
35
40
|
is_vector_search?: boolean;
|
|
36
41
|
region_id?: string;
|
|
@@ -256,6 +261,18 @@ export declare class HarvesterSDK {
|
|
|
256
261
|
count: number;
|
|
257
262
|
}[]>;
|
|
258
263
|
getSummariesByRegions(regionIds: string, params?: PaginationParams): Promise<PaginatedResponse<RegionSummaryType>>;
|
|
264
|
+
/**
|
|
265
|
+
* Get events
|
|
266
|
+
*
|
|
267
|
+
* @param params - Filter parameters (region_id is required)
|
|
268
|
+
* @returns Array of events
|
|
269
|
+
*
|
|
270
|
+
* @example
|
|
271
|
+
* ```typescript
|
|
272
|
+
* const events = await harvester.getEvents({ region_id: 'region-id' });
|
|
273
|
+
* ```
|
|
274
|
+
*/
|
|
275
|
+
getEvents(params: GetEventsParams): Promise<EventType[]>;
|
|
259
276
|
/**
|
|
260
277
|
* Convert relative time to absolute time range
|
|
261
278
|
*/
|
package/dist/sdk.js
CHANGED
|
@@ -255,6 +255,26 @@ class HarvesterSDK {
|
|
|
255
255
|
return response.data;
|
|
256
256
|
}
|
|
257
257
|
// ============================================
|
|
258
|
+
// EVENTS
|
|
259
|
+
// ============================================
|
|
260
|
+
/**
|
|
261
|
+
* Get events
|
|
262
|
+
*
|
|
263
|
+
* @param params - Filter parameters (region_id is required)
|
|
264
|
+
* @returns Array of events
|
|
265
|
+
*
|
|
266
|
+
* @example
|
|
267
|
+
* ```typescript
|
|
268
|
+
* const events = await harvester.getEvents({ region_id: 'region-id' });
|
|
269
|
+
* ```
|
|
270
|
+
*/
|
|
271
|
+
async getEvents(params) {
|
|
272
|
+
const response = await this.client.get('/events', {
|
|
273
|
+
params: this.buildQueryParams(params),
|
|
274
|
+
});
|
|
275
|
+
return response.data.data;
|
|
276
|
+
}
|
|
277
|
+
// ============================================
|
|
258
278
|
// HELPER METHODS
|
|
259
279
|
// ============================================
|
|
260
280
|
/**
|
package/package.json
CHANGED
package/sdk.ts
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
platformsList,
|
|
6
6
|
GeoSelectionType,
|
|
7
7
|
RegionSummaryType,
|
|
8
|
+
EventType,
|
|
8
9
|
} from './types';
|
|
9
10
|
|
|
10
11
|
// SDK Configuration
|
|
@@ -47,6 +48,12 @@ export interface GetGeosParams extends PaginationParams {
|
|
|
47
48
|
search?: string;
|
|
48
49
|
}
|
|
49
50
|
|
|
51
|
+
export interface GetEventsParams {
|
|
52
|
+
region_id: string;
|
|
53
|
+
created_at?: number;
|
|
54
|
+
geo_selection_id?: string;
|
|
55
|
+
}
|
|
56
|
+
|
|
50
57
|
export interface GetDataParams extends PaginationParams {
|
|
51
58
|
is_vector_search?: boolean;
|
|
52
59
|
// Region filters
|
|
@@ -448,6 +455,28 @@ export class HarvesterSDK {
|
|
|
448
455
|
return response.data;
|
|
449
456
|
}
|
|
450
457
|
|
|
458
|
+
// ============================================
|
|
459
|
+
// EVENTS
|
|
460
|
+
// ============================================
|
|
461
|
+
|
|
462
|
+
/**
|
|
463
|
+
* Get events
|
|
464
|
+
*
|
|
465
|
+
* @param params - Filter parameters (region_id is required)
|
|
466
|
+
* @returns Array of events
|
|
467
|
+
*
|
|
468
|
+
* @example
|
|
469
|
+
* ```typescript
|
|
470
|
+
* const events = await harvester.getEvents({ region_id: 'region-id' });
|
|
471
|
+
* ```
|
|
472
|
+
*/
|
|
473
|
+
async getEvents(params: GetEventsParams): Promise<EventType[]> {
|
|
474
|
+
const response = await this.client.get<{ data: EventType[] }>('/events', {
|
|
475
|
+
params: this.buildQueryParams(params),
|
|
476
|
+
});
|
|
477
|
+
return response.data.data;
|
|
478
|
+
}
|
|
479
|
+
|
|
451
480
|
// ============================================
|
|
452
481
|
// HELPER METHODS
|
|
453
482
|
// ============================================
|