harvester_sdk 1.0.66 → 1.0.68

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/index.d.ts CHANGED
@@ -455,6 +455,7 @@ export declare const MongoSourceSchema: Schema<any, import("mongoose").Model<any
455
455
  title?: string | null | undefined;
456
456
  entity?: string | null | undefined;
457
457
  public_id?: any;
458
+ peer_id?: any;
458
459
  url?: string | null | undefined;
459
460
  language?: string | null | undefined;
460
461
  created_by?: string | null | undefined;
@@ -499,6 +500,7 @@ export declare const MongoSourceSchema: Schema<any, import("mongoose").Model<any
499
500
  title?: string | null | undefined;
500
501
  entity?: string | null | undefined;
501
502
  public_id?: any;
503
+ peer_id?: any;
502
504
  url?: string | null | undefined;
503
505
  language?: string | null | undefined;
504
506
  created_by?: string | null | undefined;
@@ -543,6 +545,7 @@ export declare const MongoSourceSchema: Schema<any, import("mongoose").Model<any
543
545
  title?: string | null | undefined;
544
546
  entity?: string | null | undefined;
545
547
  public_id?: any;
548
+ peer_id?: any;
546
549
  url?: string | null | undefined;
547
550
  language?: string | null | undefined;
548
551
  created_by?: string | null | undefined;
package/dist/index.js CHANGED
@@ -210,6 +210,7 @@ exports.MongoSourceSchema = new mongoose_1.Schema({
210
210
  // required: true,
211
211
  },
212
212
  public_id: { type: mongoose_1.Schema.Types.Mixed },
213
+ peer_id: { type: mongoose_1.Schema.Types.Mixed },
213
214
  url: { type: String },
214
215
  description: { type: String },
215
216
  language: { type: String },
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
@@ -137,6 +137,7 @@ export declare const zodSourceSchema: z.ZodObject<{
137
137
  platform: z.ZodEnum<["telegram", "facebook", "instagram", "tiktok", "website", "youtube", "twitter", "x", "reddit", "linkedin", "snapchat", "whatsapp", "discord", "twitch"]>;
138
138
  entity: z.ZodEnum<["profile", "group", "page", "channel", "hashtag", "website", "rss"]>;
139
139
  public_id: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
140
+ peer_id: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
140
141
  url: z.ZodOptional<z.ZodString>;
141
142
  description: z.ZodOptional<z.ZodString>;
142
143
  language: z.ZodOptional<z.ZodString>;
@@ -206,6 +207,7 @@ export declare const zodSourceSchema: z.ZodObject<{
206
207
  region_id?: string | undefined;
207
208
  title?: string | undefined;
208
209
  public_id?: string | number | undefined;
210
+ peer_id?: string | number | undefined;
209
211
  url?: string | undefined;
210
212
  language?: string | undefined;
211
213
  tags?: string[] | undefined;
@@ -242,6 +244,7 @@ export declare const zodSourceSchema: z.ZodObject<{
242
244
  region_id?: string | undefined;
243
245
  title?: string | undefined;
244
246
  public_id?: string | number | undefined;
247
+ peer_id?: string | number | undefined;
245
248
  url?: string | undefined;
246
249
  language?: string | undefined;
247
250
  tags?: string[] | undefined;
package/dist/types.js CHANGED
@@ -111,6 +111,7 @@ exports.zodSourceSchema = zod_1.z.object({
111
111
  platform: zod_1.z.enum(exports.platformsList),
112
112
  entity: zod_1.z.enum(exports.entityTypesList),
113
113
  public_id: zod_1.z.string().or(zod_1.z.number()).optional(),
114
+ peer_id: zod_1.z.string().or(zod_1.z.number()).optional(),
114
115
  url: zod_1.z.string().url().optional(),
115
116
  description: zod_1.z.string().optional(),
116
117
  language: zod_1.z.string().optional(),
package/index.ts CHANGED
@@ -225,6 +225,7 @@ export const MongoSourceSchema = new Schema(
225
225
  // required: true,
226
226
  }, // e.g., 'channel', 'group', 'page', 'profile', 'hashtag'
227
227
  public_id: { type: Schema.Types.Mixed }, // e.g., '@telegram_channel_id'
228
+ peer_id: { type: Schema.Types.Mixed }, // e.g., numeric ID used by some platforms
228
229
  url: { type: String }, // e.g., 'https://t.me/telegram_channel_name'
229
230
  description: { type: String }, // e.g., 'A channel about news and updates'
230
231
  language: { type: String },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "harvester_sdk",
3
- "version": "1.0.66",
3
+ "version": "1.0.68",
4
4
  "description": "SDK for interacting with the Harvester API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
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
@@ -120,6 +120,7 @@ export const zodSourceSchema = z.object({
120
120
  platform: z.enum(platformsList), // e.g., 'telegram', 'facebook' // INDEX
121
121
  entity: z.enum(entityTypesList), // e.g., 'channel', 'group', 'page', 'profile', 'hashtag'
122
122
  public_id: z.string().or(z.number()).optional(), // e.g., '@telegram_channel_id'
123
+ peer_id: z.string().or(z.number()).optional(), // e.g., numeric ID used by some platforms
123
124
  url: z.string().url().optional(), // e.g., 'https://t.me/telegram_channel_name'
124
125
  description: z.string().optional(), // e.g., 'A channel about news and updates'
125
126
  language: z.string().optional(),