harvester_sdk 1.0.19 → 1.0.21

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
@@ -93,7 +93,7 @@ export declare const MongoDataSchema: Schema<any, import("mongoose").Model<any,
93
93
  source_group_id?: string | null | undefined;
94
94
  data_id?: any;
95
95
  data_url?: string | null | undefined;
96
- data_original_type?: "image" | "video" | "link" | "document" | "post" | "comment" | "reply" | "photo" | "story" | "reel" | "article" | "text" | null | undefined;
96
+ data_original_type?: string | null | undefined;
97
97
  data_text?: string | null | undefined;
98
98
  data_language?: string | null | undefined;
99
99
  data_sentiment?: "positive" | "negative" | "neutral" | "mixed" | null | undefined;
@@ -186,7 +186,7 @@ export declare const MongoDataSchema: Schema<any, import("mongoose").Model<any,
186
186
  source_group_id?: string | null | undefined;
187
187
  data_id?: any;
188
188
  data_url?: string | null | undefined;
189
- data_original_type?: "image" | "video" | "link" | "document" | "post" | "comment" | "reply" | "photo" | "story" | "reel" | "article" | "text" | null | undefined;
189
+ data_original_type?: string | null | undefined;
190
190
  data_text?: string | null | undefined;
191
191
  data_language?: string | null | undefined;
192
192
  data_sentiment?: "positive" | "negative" | "neutral" | "mixed" | null | undefined;
@@ -279,7 +279,7 @@ export declare const MongoDataSchema: Schema<any, import("mongoose").Model<any,
279
279
  source_group_id?: string | null | undefined;
280
280
  data_id?: any;
281
281
  data_url?: string | null | undefined;
282
- data_original_type?: "image" | "video" | "link" | "document" | "post" | "comment" | "reply" | "photo" | "story" | "reel" | "article" | "text" | null | undefined;
282
+ data_original_type?: string | null | undefined;
283
283
  data_text?: string | null | undefined;
284
284
  data_language?: string | null | undefined;
285
285
  data_sentiment?: "positive" | "negative" | "neutral" | "mixed" | null | undefined;
@@ -416,6 +416,19 @@ export declare const MongoSourceSchema: Schema<any, import("mongoose").Model<any
416
416
  dominant_geos: string[];
417
417
  mentions_in_discovery: number;
418
418
  priority: "none" | "low" | "medium" | "high" | "critical";
419
+ errors: import("mongoose").Types.DocumentArray<{
420
+ is_handled: boolean;
421
+ message?: string | null | undefined;
422
+ timestamp?: number | null | undefined;
423
+ }, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
424
+ is_handled: boolean;
425
+ message?: string | null | undefined;
426
+ timestamp?: number | null | undefined;
427
+ }> & {
428
+ is_handled: boolean;
429
+ message?: string | null | undefined;
430
+ timestamp?: number | null | undefined;
431
+ }>;
419
432
  notes?: string | null | undefined;
420
433
  description?: string | null | undefined;
421
434
  region_id?: string | null | undefined;
@@ -447,6 +460,19 @@ export declare const MongoSourceSchema: Schema<any, import("mongoose").Model<any
447
460
  dominant_geos: string[];
448
461
  mentions_in_discovery: number;
449
462
  priority: "none" | "low" | "medium" | "high" | "critical";
463
+ errors: import("mongoose").Types.DocumentArray<{
464
+ is_handled: boolean;
465
+ message?: string | null | undefined;
466
+ timestamp?: number | null | undefined;
467
+ }, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
468
+ is_handled: boolean;
469
+ message?: string | null | undefined;
470
+ timestamp?: number | null | undefined;
471
+ }> & {
472
+ is_handled: boolean;
473
+ message?: string | null | undefined;
474
+ timestamp?: number | null | undefined;
475
+ }>;
450
476
  notes?: string | null | undefined;
451
477
  description?: string | null | undefined;
452
478
  region_id?: string | null | undefined;
@@ -478,6 +504,19 @@ export declare const MongoSourceSchema: Schema<any, import("mongoose").Model<any
478
504
  dominant_geos: string[];
479
505
  mentions_in_discovery: number;
480
506
  priority: "none" | "low" | "medium" | "high" | "critical";
507
+ errors: import("mongoose").Types.DocumentArray<{
508
+ is_handled: boolean;
509
+ message?: string | null | undefined;
510
+ timestamp?: number | null | undefined;
511
+ }, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
512
+ is_handled: boolean;
513
+ message?: string | null | undefined;
514
+ timestamp?: number | null | undefined;
515
+ }> & {
516
+ is_handled: boolean;
517
+ message?: string | null | undefined;
518
+ timestamp?: number | null | undefined;
519
+ }>;
481
520
  notes?: string | null | undefined;
482
521
  description?: string | null | undefined;
483
522
  region_id?: string | null | undefined;
@@ -514,22 +553,22 @@ export declare const MongoGeoSchema: Schema<any, import("mongoose").Model<any, a
514
553
  }, {
515
554
  subscribers: string[];
516
555
  is_used: boolean;
517
- geo_text?: string | null | undefined;
518
556
  timestamp?: number | null | undefined;
557
+ geo_text?: string | null | undefined;
519
558
  count?: number | null | undefined;
520
559
  region?: string | null | undefined;
521
560
  }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
522
561
  subscribers: string[];
523
562
  is_used: boolean;
524
- geo_text?: string | null | undefined;
525
563
  timestamp?: number | null | undefined;
564
+ geo_text?: string | null | undefined;
526
565
  count?: number | null | undefined;
527
566
  region?: string | null | undefined;
528
567
  }>, {}> & import("mongoose").FlatRecord<{
529
568
  subscribers: string[];
530
569
  is_used: boolean;
531
- geo_text?: string | null | undefined;
532
570
  timestamp?: number | null | undefined;
571
+ geo_text?: string | null | undefined;
533
572
  count?: number | null | undefined;
534
573
  region?: string | null | undefined;
535
574
  }> & {
package/dist/index.js CHANGED
@@ -42,20 +42,6 @@ exports.MongoDataSchema = new mongoose_1.Schema({
42
42
  data_url: { type: String },
43
43
  data_original_type: {
44
44
  type: String,
45
- enum: [
46
- 'post',
47
- 'comment',
48
- 'reply',
49
- 'video',
50
- 'image',
51
- 'photo',
52
- 'story',
53
- 'reel',
54
- 'article',
55
- 'link',
56
- 'document',
57
- 'text',
58
- ],
59
45
  },
60
46
  // Content
61
47
  data_text: { type: String },
@@ -249,6 +235,16 @@ exports.MongoSourceSchema = new mongoose_1.Schema({
249
235
  enum: types_1.priorityLevels,
250
236
  default: 'none',
251
237
  },
238
+ errors: {
239
+ type: [
240
+ {
241
+ timestamp: { type: Number },
242
+ message: { type: String },
243
+ is_handled: { type: Boolean, default: false },
244
+ },
245
+ ],
246
+ default: [],
247
+ }, // array of error objects
252
248
  }, {
253
249
  versionKey: false,
254
250
  toJSON: { virtuals: true },
package/dist/types.d.ts CHANGED
@@ -117,11 +117,29 @@ export declare const zodSourceSchema: z.ZodObject<{
117
117
  }>>;
118
118
  notes: z.ZodOptional<z.ZodString>;
119
119
  priority: z.ZodOptional<z.ZodEnum<["none", "low", "medium", "high", "critical"]>>;
120
+ errors: z.ZodArray<z.ZodObject<{
121
+ timestamp: z.ZodOptional<z.ZodNumber>;
122
+ message: z.ZodOptional<z.ZodString>;
123
+ is_handled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
124
+ }, "strip", z.ZodTypeAny, {
125
+ is_handled: boolean;
126
+ message?: string | undefined;
127
+ timestamp?: number | undefined;
128
+ }, {
129
+ message?: string | undefined;
130
+ timestamp?: number | undefined;
131
+ is_handled?: boolean | undefined;
132
+ }>, "many">;
120
133
  }, "strip", z.ZodTypeAny, {
121
134
  status: "active" | "pending" | "inactive" | "requested" | "discovered" | "deleted";
122
135
  platform: "telegram" | "facebook" | "instagram" | "tiktok" | "website" | "youtube" | "twitter" | "x" | "reddit" | "linkedin" | "snapchat" | "whatsapp" | "discord" | "twitch";
123
136
  entity: "website" | "profile" | "group" | "page" | "channel" | "hashtag";
124
137
  is_public: boolean;
138
+ errors: {
139
+ is_handled: boolean;
140
+ message?: string | undefined;
141
+ timestamp?: number | undefined;
142
+ }[];
125
143
  _id?: string | undefined;
126
144
  created_at?: number | undefined;
127
145
  updated_at?: number | undefined;
@@ -153,6 +171,11 @@ export declare const zodSourceSchema: z.ZodObject<{
153
171
  status: "active" | "pending" | "inactive" | "requested" | "discovered" | "deleted";
154
172
  platform: "telegram" | "facebook" | "instagram" | "tiktok" | "website" | "youtube" | "twitter" | "x" | "reddit" | "linkedin" | "snapchat" | "whatsapp" | "discord" | "twitch";
155
173
  entity: "website" | "profile" | "group" | "page" | "channel" | "hashtag";
174
+ errors: {
175
+ message?: string | undefined;
176
+ timestamp?: number | undefined;
177
+ is_handled?: boolean | undefined;
178
+ }[];
156
179
  _id?: string | undefined;
157
180
  created_at?: number | undefined;
158
181
  updated_at?: number | undefined;
@@ -193,15 +216,15 @@ export declare const zodGeoSchema: z.ZodObject<{
193
216
  }, "strip", z.ZodTypeAny, {
194
217
  is_used: boolean;
195
218
  _id?: string | undefined;
196
- geo_text?: string | undefined;
197
219
  timestamp?: number | undefined;
220
+ geo_text?: string | undefined;
198
221
  count?: number | undefined;
199
222
  region?: string | undefined;
200
223
  subscribers?: string[] | undefined;
201
224
  }, {
202
225
  _id?: string | undefined;
203
- geo_text?: string | undefined;
204
226
  timestamp?: number | undefined;
227
+ geo_text?: string | undefined;
205
228
  count?: number | undefined;
206
229
  region?: string | undefined;
207
230
  subscribers?: string[] | undefined;
package/dist/types.js CHANGED
@@ -34,7 +34,13 @@ exports.platformEntityMap = {
34
34
  tiktok: ['profile', 'hashtag'],
35
35
  website: ['website'],
36
36
  };
37
- exports.priorityLevels = ['none', 'low', 'medium', 'high', 'critical'];
37
+ exports.priorityLevels = [
38
+ 'none',
39
+ 'low',
40
+ 'medium',
41
+ 'high',
42
+ 'critical',
43
+ ];
38
44
  exports.sourceStatusList = [
39
45
  'active',
40
46
  'pending',
@@ -100,6 +106,11 @@ exports.zodSourceSchema = zod_1.z.object({
100
106
  .optional(),
101
107
  notes: zod_1.z.string().optional(),
102
108
  priority: zod_1.z.enum(exports.priorityLevels).optional(),
109
+ errors: zod_1.z.array(zod_1.z.object({
110
+ timestamp: zod_1.z.number().optional(),
111
+ message: zod_1.z.string().optional(),
112
+ is_handled: zod_1.z.boolean().optional().default(false),
113
+ })),
103
114
  });
104
115
  exports.zodGeoSchema = zod_1.z.object({
105
116
  _id: zod_1.z.string().optional(),
package/index.ts CHANGED
@@ -36,20 +36,6 @@ export const MongoDataSchema = new Schema(
36
36
  data_url: { type: String }, // direct link to the post
37
37
  data_original_type: {
38
38
  type: String,
39
- enum: [
40
- 'post',
41
- 'comment',
42
- 'reply',
43
- 'video',
44
- 'image',
45
- 'photo',
46
- 'story',
47
- 'reel',
48
- 'article',
49
- 'link',
50
- 'document',
51
- 'text',
52
- ],
53
39
  },
54
40
 
55
41
  // Content
@@ -266,6 +252,16 @@ export const MongoSourceSchema = new Schema(
266
252
  enum: priorityLevels,
267
253
  default: 'none',
268
254
  },
255
+ errors: {
256
+ type: [
257
+ {
258
+ timestamp: { type: Number },
259
+ message: { type: String },
260
+ is_handled: { type: Boolean, default: false },
261
+ },
262
+ ],
263
+ default: [],
264
+ }, // array of error objects
269
265
  },
270
266
  {
271
267
  versionKey: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "harvester_sdk",
3
- "version": "1.0.19",
3
+ "version": "1.0.21",
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
@@ -35,7 +35,13 @@ export const platformEntityMap = {
35
35
  website: ['website'],
36
36
  } as const;
37
37
 
38
- export const priorityLevels = ['none', 'low', 'medium', 'high', 'critical'] as const;
38
+ export const priorityLevels = [
39
+ 'none',
40
+ 'low',
41
+ 'medium',
42
+ 'high',
43
+ 'critical',
44
+ ] as const;
39
45
 
40
46
  export const sourceStatusList = [
41
47
  'active', // active and approved sources
@@ -106,6 +112,13 @@ export const zodSourceSchema = z.object({
106
112
  .optional(), // user who requested this source
107
113
  notes: z.string().optional(), // internal notes about the source
108
114
  priority: z.enum(priorityLevels).optional(),
115
+ errors: z.array(
116
+ z.object({
117
+ timestamp: z.number().optional(),
118
+ message: z.string().optional(),
119
+ is_handled: z.boolean().optional().default(false),
120
+ })
121
+ ),
109
122
  });
110
123
 
111
124
  export const zodGeoSchema = z.object({