harvester_sdk 1.0.66 → 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/package.json +1 -1
- package/sdk.ts +18 -0
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/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
|
// ============================================
|