harvester_sdk 1.0.57 → 1.0.59

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
@@ -336,6 +336,7 @@ export declare const MongoRegionSchema: Schema<any, import("mongoose").Model<any
336
336
  created_at: number;
337
337
  updated_at: number;
338
338
  status: "active" | "inactive" | "deleted";
339
+ consume_languages: string[];
339
340
  legend?: string | null | undefined;
340
341
  notes?: string | null | undefined;
341
342
  coordinates?: {
@@ -348,6 +349,7 @@ export declare const MongoRegionSchema: Schema<any, import("mongoose").Model<any
348
349
  created_at: number;
349
350
  updated_at: number;
350
351
  status: "active" | "inactive" | "deleted";
352
+ consume_languages: string[];
351
353
  legend?: string | null | undefined;
352
354
  notes?: string | null | undefined;
353
355
  coordinates?: {
@@ -360,6 +362,7 @@ export declare const MongoRegionSchema: Schema<any, import("mongoose").Model<any
360
362
  created_at: number;
361
363
  updated_at: number;
362
364
  status: "active" | "inactive" | "deleted";
365
+ consume_languages: string[];
363
366
  legend?: string | null | undefined;
364
367
  notes?: string | null | undefined;
365
368
  coordinates?: {
@@ -782,6 +785,7 @@ export declare const MongoEventSchema: Schema<any, import("mongoose").Model<any,
782
785
  timestamp: number;
783
786
  embeddings: number[];
784
787
  keywords: string[];
788
+ update_count: number;
785
789
  type?: string | null | undefined;
786
790
  region_id?: string | null | undefined;
787
791
  title?: string | null | undefined;
@@ -794,6 +798,7 @@ export declare const MongoEventSchema: Schema<any, import("mongoose").Model<any,
794
798
  data_geo: string[];
795
799
  platform?: "telegram" | "facebook" | "instagram" | "tiktok" | "website" | "youtube" | "twitter" | "x" | "reddit" | "linkedin" | "snapchat" | "whatsapp" | "discord" | "twitch" | null | undefined;
796
800
  timestamp?: number | null | undefined;
801
+ data_timestamp?: number | null | undefined;
797
802
  source_id?: any;
798
803
  data_id?: any;
799
804
  data_url?: string | null | undefined;
@@ -805,6 +810,7 @@ export declare const MongoEventSchema: Schema<any, import("mongoose").Model<any,
805
810
  data_geo: string[];
806
811
  platform?: "telegram" | "facebook" | "instagram" | "tiktok" | "website" | "youtube" | "twitter" | "x" | "reddit" | "linkedin" | "snapchat" | "whatsapp" | "discord" | "twitch" | null | undefined;
807
812
  timestamp?: number | null | undefined;
813
+ data_timestamp?: number | null | undefined;
808
814
  source_id?: any;
809
815
  data_id?: any;
810
816
  data_url?: string | null | undefined;
@@ -816,6 +822,7 @@ export declare const MongoEventSchema: Schema<any, import("mongoose").Model<any,
816
822
  data_geo: string[];
817
823
  platform?: "telegram" | "facebook" | "instagram" | "tiktok" | "website" | "youtube" | "twitter" | "x" | "reddit" | "linkedin" | "snapchat" | "whatsapp" | "discord" | "twitch" | null | undefined;
818
824
  timestamp?: number | null | undefined;
825
+ data_timestamp?: number | null | undefined;
819
826
  source_id?: any;
820
827
  data_id?: any;
821
828
  data_url?: string | null | undefined;
@@ -824,6 +831,12 @@ export declare const MongoEventSchema: Schema<any, import("mongoose").Model<any,
824
831
  author_id?: string | null | undefined;
825
832
  data_region_id?: string | null | undefined;
826
833
  }> | null | undefined;
834
+ translated_data?: Map<string, {
835
+ keywords: string[];
836
+ title?: string | null | undefined;
837
+ data_short?: string | null | undefined;
838
+ data?: string | null | undefined;
839
+ }> | null | undefined;
827
840
  event_id?: string | null | undefined;
828
841
  }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
829
842
  created_at: number;
@@ -831,6 +844,7 @@ export declare const MongoEventSchema: Schema<any, import("mongoose").Model<any,
831
844
  timestamp: number;
832
845
  embeddings: number[];
833
846
  keywords: string[];
847
+ update_count: number;
834
848
  type?: string | null | undefined;
835
849
  region_id?: string | null | undefined;
836
850
  title?: string | null | undefined;
@@ -843,6 +857,7 @@ export declare const MongoEventSchema: Schema<any, import("mongoose").Model<any,
843
857
  data_geo: string[];
844
858
  platform?: "telegram" | "facebook" | "instagram" | "tiktok" | "website" | "youtube" | "twitter" | "x" | "reddit" | "linkedin" | "snapchat" | "whatsapp" | "discord" | "twitch" | null | undefined;
845
859
  timestamp?: number | null | undefined;
860
+ data_timestamp?: number | null | undefined;
846
861
  source_id?: any;
847
862
  data_id?: any;
848
863
  data_url?: string | null | undefined;
@@ -854,6 +869,7 @@ export declare const MongoEventSchema: Schema<any, import("mongoose").Model<any,
854
869
  data_geo: string[];
855
870
  platform?: "telegram" | "facebook" | "instagram" | "tiktok" | "website" | "youtube" | "twitter" | "x" | "reddit" | "linkedin" | "snapchat" | "whatsapp" | "discord" | "twitch" | null | undefined;
856
871
  timestamp?: number | null | undefined;
872
+ data_timestamp?: number | null | undefined;
857
873
  source_id?: any;
858
874
  data_id?: any;
859
875
  data_url?: string | null | undefined;
@@ -865,6 +881,7 @@ export declare const MongoEventSchema: Schema<any, import("mongoose").Model<any,
865
881
  data_geo: string[];
866
882
  platform?: "telegram" | "facebook" | "instagram" | "tiktok" | "website" | "youtube" | "twitter" | "x" | "reddit" | "linkedin" | "snapchat" | "whatsapp" | "discord" | "twitch" | null | undefined;
867
883
  timestamp?: number | null | undefined;
884
+ data_timestamp?: number | null | undefined;
868
885
  source_id?: any;
869
886
  data_id?: any;
870
887
  data_url?: string | null | undefined;
@@ -873,6 +890,12 @@ export declare const MongoEventSchema: Schema<any, import("mongoose").Model<any,
873
890
  author_id?: string | null | undefined;
874
891
  data_region_id?: string | null | undefined;
875
892
  }> | null | undefined;
893
+ translated_data?: Map<string, {
894
+ keywords: string[];
895
+ title?: string | null | undefined;
896
+ data_short?: string | null | undefined;
897
+ data?: string | null | undefined;
898
+ }> | null | undefined;
876
899
  event_id?: string | null | undefined;
877
900
  }>, {}> & import("mongoose").FlatRecord<{
878
901
  created_at: number;
@@ -880,6 +903,7 @@ export declare const MongoEventSchema: Schema<any, import("mongoose").Model<any,
880
903
  timestamp: number;
881
904
  embeddings: number[];
882
905
  keywords: string[];
906
+ update_count: number;
883
907
  type?: string | null | undefined;
884
908
  region_id?: string | null | undefined;
885
909
  title?: string | null | undefined;
@@ -892,6 +916,7 @@ export declare const MongoEventSchema: Schema<any, import("mongoose").Model<any,
892
916
  data_geo: string[];
893
917
  platform?: "telegram" | "facebook" | "instagram" | "tiktok" | "website" | "youtube" | "twitter" | "x" | "reddit" | "linkedin" | "snapchat" | "whatsapp" | "discord" | "twitch" | null | undefined;
894
918
  timestamp?: number | null | undefined;
919
+ data_timestamp?: number | null | undefined;
895
920
  source_id?: any;
896
921
  data_id?: any;
897
922
  data_url?: string | null | undefined;
@@ -903,6 +928,7 @@ export declare const MongoEventSchema: Schema<any, import("mongoose").Model<any,
903
928
  data_geo: string[];
904
929
  platform?: "telegram" | "facebook" | "instagram" | "tiktok" | "website" | "youtube" | "twitter" | "x" | "reddit" | "linkedin" | "snapchat" | "whatsapp" | "discord" | "twitch" | null | undefined;
905
930
  timestamp?: number | null | undefined;
931
+ data_timestamp?: number | null | undefined;
906
932
  source_id?: any;
907
933
  data_id?: any;
908
934
  data_url?: string | null | undefined;
@@ -914,6 +940,7 @@ export declare const MongoEventSchema: Schema<any, import("mongoose").Model<any,
914
940
  data_geo: string[];
915
941
  platform?: "telegram" | "facebook" | "instagram" | "tiktok" | "website" | "youtube" | "twitter" | "x" | "reddit" | "linkedin" | "snapchat" | "whatsapp" | "discord" | "twitch" | null | undefined;
916
942
  timestamp?: number | null | undefined;
943
+ data_timestamp?: number | null | undefined;
917
944
  source_id?: any;
918
945
  data_id?: any;
919
946
  data_url?: string | null | undefined;
@@ -922,12 +949,67 @@ export declare const MongoEventSchema: Schema<any, import("mongoose").Model<any,
922
949
  author_id?: string | null | undefined;
923
950
  data_region_id?: string | null | undefined;
924
951
  }> | null | undefined;
952
+ translated_data?: Map<string, {
953
+ keywords: string[];
954
+ title?: string | null | undefined;
955
+ data_short?: string | null | undefined;
956
+ data?: string | null | undefined;
957
+ }> | null | undefined;
925
958
  event_id?: string | null | undefined;
926
959
  }> & {
927
960
  _id: import("mongoose").Types.ObjectId;
928
961
  } & {
929
962
  __v: number;
930
963
  }>;
964
+ export declare const MongoEventMonitoringSchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
965
+ versionKey: false;
966
+ toJSON: {
967
+ virtuals: true;
968
+ };
969
+ toObject: {
970
+ virtuals: true;
971
+ };
972
+ }, {
973
+ created_at: number;
974
+ region_id: string;
975
+ geo_selection_id: string;
976
+ geo_selection_title: string;
977
+ event_ids: string[];
978
+ data_count: number;
979
+ existing_events_count: number;
980
+ events_updated: number;
981
+ events_created: number;
982
+ skipped: boolean;
983
+ geo_selection_group_id?: string | null | undefined;
984
+ }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
985
+ created_at: number;
986
+ region_id: string;
987
+ geo_selection_id: string;
988
+ geo_selection_title: string;
989
+ event_ids: string[];
990
+ data_count: number;
991
+ existing_events_count: number;
992
+ events_updated: number;
993
+ events_created: number;
994
+ skipped: boolean;
995
+ geo_selection_group_id?: string | null | undefined;
996
+ }>, {}> & import("mongoose").FlatRecord<{
997
+ created_at: number;
998
+ region_id: string;
999
+ geo_selection_id: string;
1000
+ geo_selection_title: string;
1001
+ event_ids: string[];
1002
+ data_count: number;
1003
+ existing_events_count: number;
1004
+ events_updated: number;
1005
+ events_created: number;
1006
+ skipped: boolean;
1007
+ geo_selection_group_id?: string | null | undefined;
1008
+ }> & {
1009
+ _id: import("mongoose").Types.ObjectId;
1010
+ } & {
1011
+ __v: number;
1012
+ }>;
931
1013
  export declare const MongoGeoSelectionGroupSchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
932
1014
  versionKey: false;
933
1015
  toJSON: {
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.MongoGeoSelectionGroupSchema = exports.MongoEventSchema = exports.MongoServerReportSchema = exports.MongoRegionSummarySchema = exports.MongoApiKeySchema = exports.MongoGeoSelectionSchema = exports.MongoGeoSchema = exports.MongoSourceSchema = exports.MongoSourceGroupSchema = exports.MongoRegionSchema = exports.MongoDataSchema = exports.HarvesterSDKError = exports.createHarvesterSDK = exports.HarvesterSDK = void 0;
17
+ exports.MongoGeoSelectionGroupSchema = exports.MongoEventMonitoringSchema = exports.MongoEventSchema = exports.MongoServerReportSchema = exports.MongoRegionSummarySchema = exports.MongoApiKeySchema = exports.MongoGeoSelectionSchema = exports.MongoGeoSchema = exports.MongoSourceSchema = exports.MongoSourceGroupSchema = exports.MongoRegionSchema = exports.MongoDataSchema = exports.HarvesterSDKError = exports.createHarvesterSDK = exports.HarvesterSDK = void 0;
18
18
  // Export types for consumers
19
19
  __exportStar(require("./types"), exports);
20
20
  // Export SDK
@@ -167,7 +167,8 @@ exports.MongoRegionSchema = new mongoose_1.Schema({
167
167
  coordinates: {
168
168
  type: { type: String, enum: ['point', 'polygon'] },
169
169
  coordinates: { type: mongoose_1.Schema.Types.Mixed },
170
- }, // GeoJSON format
170
+ },
171
+ consume_languages: { type: [String] }, // e.g., dominant user languages that consume content from this region
171
172
  }, {
172
173
  versionKey: false,
173
174
  toJSON: { virtuals: true },
@@ -354,6 +355,7 @@ exports.MongoEventSchema = new mongoose_1.Schema({
354
355
  data: { type: String },
355
356
  created_at: { type: Number, default: Date.now },
356
357
  updated_at: { type: Number, default: Date.now },
358
+ update_count: { type: Number, default: 0 },
357
359
  keywords: { type: [String], default: [] },
358
360
  geo_selection: { type: mongoose_1.Schema.Types.Mixed },
359
361
  raw_data: {
@@ -364,6 +366,7 @@ exports.MongoEventSchema = new mongoose_1.Schema({
364
366
  data_id: { type: mongoose_1.Schema.Types.Mixed },
365
367
  data_url: { type: String },
366
368
  data_text: { type: String },
369
+ data_timestamp: { type: Number },
367
370
  author_username: { type: String },
368
371
  author_id: { type: String },
369
372
  timestamp: { type: Number },
@@ -373,7 +376,33 @@ exports.MongoEventSchema = new mongoose_1.Schema({
373
376
  ],
374
377
  default: undefined,
375
378
  },
376
- embeddings: { type: [Number], default: [] }, // vector embeddings for ML tasks
379
+ embeddings: { type: [Number], default: [] },
380
+ translated_data: {
381
+ type: Map,
382
+ of: new mongoose_1.Schema({
383
+ title: { type: String },
384
+ data_short: { type: String },
385
+ data: { type: String },
386
+ keywords: { type: [String], default: [] },
387
+ }),
388
+ }, // translated data for different languages, e.g., { "en": { title, data_short, data, keywords }, "ar": { ... } }
389
+ }, {
390
+ versionKey: false,
391
+ toJSON: { virtuals: true },
392
+ toObject: { virtuals: true },
393
+ });
394
+ exports.MongoEventMonitoringSchema = new mongoose_1.Schema({
395
+ geo_selection_id: { type: String, required: true },
396
+ geo_selection_title: { type: String, required: true },
397
+ region_id: { type: String, required: true },
398
+ geo_selection_group_id: { type: String },
399
+ event_ids: { type: [String], default: [] },
400
+ data_count: { type: Number, required: true },
401
+ existing_events_count: { type: Number, required: true },
402
+ events_updated: { type: Number, required: true },
403
+ events_created: { type: Number, required: true },
404
+ skipped: { type: Boolean, required: true },
405
+ created_at: { type: Number, default: Date.now, required: true },
377
406
  }, {
378
407
  versionKey: false,
379
408
  toJSON: { virtuals: true },
package/dist/types.d.ts CHANGED
@@ -10,6 +10,7 @@ export declare const platformEntityMap: {
10
10
  };
11
11
  export declare const priorityLevels: readonly ["none", "low", "medium", "high", "critical"];
12
12
  export declare const sourceStatusList: readonly ["active", "pending", "inactive", "requested", "discovered", "deleted"];
13
+ export declare const userLanguagesList: readonly ["hebrew", "arabic", "french", "german", "chinese", "russian", "portuguese", "spanish"];
13
14
  export declare const generalStatusList: readonly ["active", "inactive", "deleted"];
14
15
  export declare const zodRegionSchema: z.ZodObject<{
15
16
  _id: z.ZodOptional<z.ZodString>;
@@ -30,6 +31,7 @@ export declare const zodRegionSchema: z.ZodObject<{
30
31
  type?: "point" | "polygon" | undefined;
31
32
  coordinates?: [number, number] | [number, number][] | undefined;
32
33
  }>>;
34
+ consume_languages: z.ZodOptional<z.ZodArray<z.ZodEnum<["hebrew", "arabic", "french", "german", "chinese", "russian", "portuguese", "spanish"]>, "many">>;
33
35
  }, "strip", z.ZodTypeAny, {
34
36
  name: string;
35
37
  slug: string;
@@ -43,6 +45,7 @@ export declare const zodRegionSchema: z.ZodObject<{
43
45
  type?: "point" | "polygon" | undefined;
44
46
  coordinates?: [number, number] | [number, number][] | undefined;
45
47
  } | undefined;
48
+ consume_languages?: ("hebrew" | "arabic" | "french" | "german" | "chinese" | "russian" | "portuguese" | "spanish")[] | undefined;
46
49
  }, {
47
50
  name: string;
48
51
  slug: string;
@@ -56,6 +59,7 @@ export declare const zodRegionSchema: z.ZodObject<{
56
59
  type?: "point" | "polygon" | undefined;
57
60
  coordinates?: [number, number] | [number, number][] | undefined;
58
61
  } | undefined;
62
+ consume_languages?: ("hebrew" | "arabic" | "french" | "german" | "chinese" | "russian" | "portuguese" | "spanish")[] | undefined;
59
63
  }>;
60
64
  export declare const zodSourceGroupSchema: z.ZodObject<{
61
65
  _id: z.ZodOptional<z.ZodString>;
@@ -2140,6 +2144,7 @@ export declare const zodEventSchema: z.ZodObject<{
2140
2144
  data: z.ZodString;
2141
2145
  created_at: z.ZodNumber;
2142
2146
  updated_at: z.ZodNumber;
2147
+ update_count: z.ZodOptional<z.ZodNumber>;
2143
2148
  keywords: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2144
2149
  geo_selection: z.ZodObject<{
2145
2150
  _id: z.ZodOptional<z.ZodString>;
@@ -2240,6 +2245,22 @@ export declare const zodEventSchema: z.ZodObject<{
2240
2245
  data_region_id?: string | undefined;
2241
2246
  }>, "many">>;
2242
2247
  embeddings: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
2248
+ translated_data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
2249
+ title: z.ZodString;
2250
+ data_short: z.ZodString;
2251
+ data: z.ZodString;
2252
+ keywords: z.ZodArray<z.ZodString, "many">;
2253
+ }, "strip", z.ZodTypeAny, {
2254
+ title: string;
2255
+ keywords: string[];
2256
+ data_short: string;
2257
+ data: string;
2258
+ }, {
2259
+ title: string;
2260
+ keywords: string[];
2261
+ data_short: string;
2262
+ data: string;
2263
+ }>>>;
2243
2264
  }, "strip", z.ZodTypeAny, {
2244
2265
  created_at: number;
2245
2266
  updated_at: number;
@@ -2272,6 +2293,7 @@ export declare const zodEventSchema: z.ZodObject<{
2272
2293
  geo_selection_id?: string | undefined;
2273
2294
  geo_selection_title?: string | undefined;
2274
2295
  data_short?: string | undefined;
2296
+ update_count?: number | undefined;
2275
2297
  raw_data?: {
2276
2298
  platform: "telegram" | "facebook" | "instagram" | "tiktok" | "website" | "youtube" | "twitter" | "x" | "reddit" | "linkedin" | "snapchat" | "whatsapp" | "discord" | "twitch";
2277
2299
  source_id: string | number;
@@ -2285,6 +2307,12 @@ export declare const zodEventSchema: z.ZodObject<{
2285
2307
  author_id?: string | undefined;
2286
2308
  data_region_id?: string | undefined;
2287
2309
  }[] | undefined;
2310
+ translated_data?: Record<string, {
2311
+ title: string;
2312
+ keywords: string[];
2313
+ data_short: string;
2314
+ data: string;
2315
+ }> | undefined;
2288
2316
  }, {
2289
2317
  created_at: number;
2290
2318
  updated_at: number;
@@ -2317,6 +2345,7 @@ export declare const zodEventSchema: z.ZodObject<{
2317
2345
  geo_selection_id?: string | undefined;
2318
2346
  geo_selection_title?: string | undefined;
2319
2347
  data_short?: string | undefined;
2348
+ update_count?: number | undefined;
2320
2349
  raw_data?: {
2321
2350
  platform: "telegram" | "facebook" | "instagram" | "tiktok" | "website" | "youtube" | "twitter" | "x" | "reddit" | "linkedin" | "snapchat" | "whatsapp" | "discord" | "twitch";
2322
2351
  source_id: string | number;
@@ -2330,5 +2359,49 @@ export declare const zodEventSchema: z.ZodObject<{
2330
2359
  author_id?: string | undefined;
2331
2360
  data_region_id?: string | undefined;
2332
2361
  }[] | undefined;
2362
+ translated_data?: Record<string, {
2363
+ title: string;
2364
+ keywords: string[];
2365
+ data_short: string;
2366
+ data: string;
2367
+ }> | undefined;
2368
+ }>;
2369
+ export declare const zodEventMonitoringSchema: z.ZodObject<{
2370
+ geo_selection_id: z.ZodString;
2371
+ geo_selection_title: z.ZodString;
2372
+ region_id: z.ZodString;
2373
+ geo_selection_group_id: z.ZodOptional<z.ZodString>;
2374
+ event_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2375
+ data_count: z.ZodNumber;
2376
+ existing_events_count: z.ZodNumber;
2377
+ events_updated: z.ZodNumber;
2378
+ events_created: z.ZodNumber;
2379
+ skipped: z.ZodBoolean;
2380
+ created_at: z.ZodNumber;
2381
+ }, "strip", z.ZodTypeAny, {
2382
+ created_at: number;
2383
+ region_id: string;
2384
+ geo_selection_id: string;
2385
+ geo_selection_title: string;
2386
+ data_count: number;
2387
+ existing_events_count: number;
2388
+ events_updated: number;
2389
+ events_created: number;
2390
+ skipped: boolean;
2391
+ geo_selection_group_id?: string | undefined;
2392
+ event_ids?: string[] | undefined;
2393
+ }, {
2394
+ created_at: number;
2395
+ region_id: string;
2396
+ geo_selection_id: string;
2397
+ geo_selection_title: string;
2398
+ data_count: number;
2399
+ existing_events_count: number;
2400
+ events_updated: number;
2401
+ events_created: number;
2402
+ skipped: boolean;
2403
+ geo_selection_group_id?: string | undefined;
2404
+ event_ids?: string[] | undefined;
2333
2405
  }>;
2334
2406
  export type EventType = z.infer<typeof zodEventSchema>;
2407
+ export type EventMonitoringType = z.infer<typeof zodEventMonitoringSchema>;
package/dist/types.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.zodEventSchema = exports.zodServerReportSchema = exports.zodRegionSummarySchema = exports.zodDashboardStatsSchema = exports.zodDataSchemaWithValidation = exports.zodDataSchema = exports.authorSchema = exports.repliesInfoSchema = exports.mediaItemSchema = exports.websiteMetadataSchema = exports.tiktokMetadataSchema = exports.instagramMetadataSchema = exports.facebookMetadataSchema = exports.telegramMetadataSchema = exports.zodGeoSelectionSchema = exports.zodGeoSelectionGroupSchema = exports.zodGeoSchema = exports.zodSourceSchema = exports.zodSourceGroupSchema = exports.zodRegionSchema = exports.generalStatusList = exports.sourceStatusList = exports.priorityLevels = exports.platformEntityMap = exports.entityTypesList = exports.platformsList = void 0;
3
+ exports.zodEventMonitoringSchema = exports.zodEventSchema = exports.zodServerReportSchema = exports.zodRegionSummarySchema = exports.zodDashboardStatsSchema = exports.zodDataSchemaWithValidation = exports.zodDataSchema = exports.authorSchema = exports.repliesInfoSchema = exports.mediaItemSchema = exports.websiteMetadataSchema = exports.tiktokMetadataSchema = exports.instagramMetadataSchema = exports.facebookMetadataSchema = exports.telegramMetadataSchema = exports.zodGeoSelectionSchema = exports.zodGeoSelectionGroupSchema = exports.zodGeoSchema = exports.zodSourceSchema = exports.zodSourceGroupSchema = exports.zodRegionSchema = exports.generalStatusList = exports.userLanguagesList = exports.sourceStatusList = exports.priorityLevels = exports.platformEntityMap = exports.entityTypesList = exports.platformsList = void 0;
4
4
  const zod_1 = require("zod");
5
5
  exports.platformsList = [
6
6
  'telegram',
@@ -50,6 +50,16 @@ exports.sourceStatusList = [
50
50
  'discovered',
51
51
  'deleted', // sources that have been deleted
52
52
  ];
53
+ exports.userLanguagesList = [
54
+ 'hebrew',
55
+ 'arabic',
56
+ 'french',
57
+ 'german',
58
+ 'chinese',
59
+ 'russian',
60
+ 'portuguese',
61
+ 'spanish',
62
+ ];
53
63
  exports.generalStatusList = ['active', 'inactive', 'deleted'];
54
64
  exports.zodRegionSchema = zod_1.z.object({
55
65
  _id: zod_1.z.string().optional(),
@@ -71,6 +81,7 @@ exports.zodRegionSchema = zod_1.z.object({
71
81
  .optional(),
72
82
  })
73
83
  .optional(),
84
+ consume_languages: zod_1.z.array(zod_1.z.enum(exports.userLanguagesList)).optional(), // e.g., dominant user languages that consume content from this region
74
85
  });
75
86
  exports.zodSourceGroupSchema = zod_1.z.object({
76
87
  _id: zod_1.z.string().optional(),
@@ -445,6 +456,7 @@ exports.zodEventSchema = zod_1.z.object({
445
456
  data: zod_1.z.string(),
446
457
  created_at: zod_1.z.number(),
447
458
  updated_at: zod_1.z.number(),
459
+ update_count: zod_1.z.number().optional(),
448
460
  keywords: zod_1.z.array(zod_1.z.string()).optional(),
449
461
  geo_selection: exports.zodGeoSelectionSchema,
450
462
  raw_data: zod_1.z
@@ -462,5 +474,24 @@ exports.zodEventSchema = zod_1.z.object({
462
474
  data_region_id: zod_1.z.string().optional(),
463
475
  }))
464
476
  .optional(),
465
- embeddings: zod_1.z.array(zod_1.z.number()).optional(), // e.g., vector embeddings for ML tasks
477
+ embeddings: zod_1.z.array(zod_1.z.number()).optional(),
478
+ translated_data: zod_1.z.record(zod_1.z.string(), zod_1.z.object({
479
+ title: zod_1.z.string(),
480
+ data_short: zod_1.z.string(),
481
+ data: zod_1.z.string(),
482
+ keywords: zod_1.z.array(zod_1.z.string()),
483
+ })).optional(),
484
+ });
485
+ exports.zodEventMonitoringSchema = zod_1.z.object({
486
+ geo_selection_id: zod_1.z.string(),
487
+ geo_selection_title: zod_1.z.string(),
488
+ region_id: zod_1.z.string(),
489
+ geo_selection_group_id: zod_1.z.string().optional(),
490
+ event_ids: zod_1.z.array(zod_1.z.string()).optional(),
491
+ data_count: zod_1.z.number(),
492
+ existing_events_count: zod_1.z.number(),
493
+ events_updated: zod_1.z.number(),
494
+ events_created: zod_1.z.number(),
495
+ skipped: zod_1.z.boolean(),
496
+ created_at: zod_1.z.number(),
466
497
  });
package/index.ts CHANGED
@@ -11,6 +11,7 @@ import {
11
11
  platformsList,
12
12
  sourceStatusList,
13
13
  priorityLevels,
14
+ userLanguagesList,
14
15
  } from './types';
15
16
 
16
17
  export const MongoDataSchema = new Schema(
@@ -174,6 +175,7 @@ export const MongoRegionSchema = new Schema(
174
175
  type: { type: String, enum: ['point', 'polygon'] },
175
176
  coordinates: { type: Schema.Types.Mixed },
176
177
  }, // GeoJSON format
178
+ consume_languages: { type: [String] }, // e.g., dominant user languages that consume content from this region
177
179
  },
178
180
  {
179
181
  versionKey: false,
@@ -294,8 +296,6 @@ export const MongoGeoSchema = new Schema(
294
296
  },
295
297
  );
296
298
 
297
-
298
-
299
299
  export const MongoGeoSelectionSchema = new Schema(
300
300
  {
301
301
  geo_selection_group_id: { type: String }, // e.g., geo selection group ID
@@ -394,6 +394,7 @@ export const MongoEventSchema = new Schema(
394
394
  data: { type: String }, // in depth data about the event, this string is updated each time the object is updated
395
395
  created_at: { type: Number, default: Date.now }, // creation date
396
396
  updated_at: { type: Number, default: Date.now }, // last update date
397
+ update_count: { type: Number, default: 0 }, // how many times the event was updated
397
398
  keywords: { type: [String], default: [] }, // e.g., ['red sea', 'escalating']
398
399
  geo_selection: { type: Schema.Types.Mixed }, // embedded geo selection object
399
400
  raw_data: {
@@ -404,6 +405,7 @@ export const MongoEventSchema = new Schema(
404
405
  data_id: { type: Schema.Types.Mixed },
405
406
  data_url: { type: String },
406
407
  data_text: { type: String },
408
+ data_timestamp: { type: Number },
407
409
  author_username: { type: String },
408
410
  author_id: { type: String },
409
411
  timestamp: { type: Number },
@@ -414,6 +416,38 @@ export const MongoEventSchema = new Schema(
414
416
  default: undefined,
415
417
  }, // raw data items that triggered the event
416
418
  embeddings: { type: [Number], default: [] }, // vector embeddings for ML tasks
419
+ translated_data: {
420
+ type: Map,
421
+ of: new Schema({
422
+ title: { type: String },
423
+ data_short: { type: String },
424
+ data: { type: String },
425
+ keywords: { type: [String], default: [] },
426
+ }),
427
+ }, // translated data for different languages, e.g., { "en": { title, data_short, data, keywords }, "ar": { ... } }
428
+ },
429
+ {
430
+ versionKey: false,
431
+ toJSON: { virtuals: true },
432
+ toObject: { virtuals: true },
433
+ },
434
+ );
435
+
436
+
437
+
438
+ export const MongoEventMonitoringSchema = new Schema(
439
+ {
440
+ geo_selection_id: { type: String, required: true },
441
+ geo_selection_title: { type: String, required: true },
442
+ region_id: { type: String, required: true },
443
+ geo_selection_group_id: { type: String },
444
+ event_ids: { type: [String], default: [] },
445
+ data_count: { type: Number, required: true },
446
+ existing_events_count: { type: Number, required: true },
447
+ events_updated: { type: Number, required: true },
448
+ events_created: { type: Number, required: true },
449
+ skipped: { type: Boolean, required: true },
450
+ created_at: { type: Number, default: Date.now, required: true },
417
451
  },
418
452
  {
419
453
  versionKey: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "harvester_sdk",
3
- "version": "1.0.57",
3
+ "version": "1.0.59",
4
4
  "description": "SDK for interacting with the Harvester API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/types.ts CHANGED
@@ -53,6 +53,17 @@ export const sourceStatusList = [
53
53
  'deleted', // sources that have been deleted
54
54
  ] as const;
55
55
 
56
+ export const userLanguagesList = [
57
+ 'hebrew',
58
+ 'arabic',
59
+ 'french',
60
+ 'german',
61
+ 'chinese',
62
+ 'russian',
63
+ 'portuguese',
64
+ 'spanish',
65
+ ] as const;
66
+
56
67
  export const generalStatusList = ['active', 'inactive', 'deleted'] as const;
57
68
 
58
69
  export const zodRegionSchema = z.object({
@@ -75,6 +86,7 @@ export const zodRegionSchema = z.object({
75
86
  .optional(),
76
87
  })
77
88
  .optional(),
89
+ consume_languages: z.array(z.enum(userLanguagesList)).optional(), // e.g., dominant user languages that consume content from this region
78
90
  });
79
91
 
80
92
  export const zodSourceGroupSchema = z.object({
@@ -513,6 +525,7 @@ export const zodEventSchema = z.object({
513
525
  data: z.string(), // in depth data about the event, this string is updated each time the object is updated
514
526
  created_at: z.number(), // e.g., 1751210833000
515
527
  updated_at: z.number(), // e.g., 1751210833000
528
+ update_count: z.number().optional(), // e.g., 3 - how many times the event was updated
516
529
  keywords: z.array(z.string()).optional(), // e.g., ['red sea', 'escalating']
517
530
  geo_selection: zodGeoSelectionSchema,
518
531
  raw_data: z
@@ -533,6 +546,30 @@ export const zodEventSchema = z.object({
533
546
  )
534
547
  .optional(), // raw data items that triggered the event
535
548
  embeddings: z.array(z.number()).optional(), // e.g., vector embeddings for ML tasks
549
+ translated_data: z.record(
550
+ z.string(),
551
+ z.object({
552
+ title: z.string(),
553
+ data_short: z.string(),
554
+ data: z.string(),
555
+ keywords: z.array(z.string()),
556
+ }),
557
+ ).optional(),
558
+ });
559
+
560
+ export const zodEventMonitoringSchema = z.object({
561
+ geo_selection_id: z.string(),
562
+ geo_selection_title: z.string(),
563
+ region_id: z.string(),
564
+ geo_selection_group_id: z.string().optional(),
565
+ event_ids: z.array(z.string()).optional(),
566
+ data_count: z.number(),
567
+ existing_events_count: z.number(),
568
+ events_updated: z.number(),
569
+ events_created: z.number(),
570
+ skipped: z.boolean(),
571
+ created_at: z.number(),
536
572
  });
537
573
 
538
574
  export type EventType = z.infer<typeof zodEventSchema>;
575
+ export type EventMonitoringType = z.infer<typeof zodEventMonitoringSchema>;