harvester_sdk 1.0.19 → 1.0.20

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
@@ -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
@@ -249,6 +249,16 @@ exports.MongoSourceSchema = new mongoose_1.Schema({
249
249
  enum: types_1.priorityLevels,
250
250
  default: 'none',
251
251
  },
252
+ errors: {
253
+ type: [
254
+ {
255
+ timestamp: { type: Number },
256
+ message: { type: String },
257
+ is_handled: { type: Boolean, default: false },
258
+ },
259
+ ],
260
+ default: [],
261
+ }, // array of error objects
252
262
  }, {
253
263
  versionKey: false,
254
264
  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
@@ -266,6 +266,16 @@ export const MongoSourceSchema = new Schema(
266
266
  enum: priorityLevels,
267
267
  default: 'none',
268
268
  },
269
+ errors: {
270
+ type: [
271
+ {
272
+ timestamp: { type: Number },
273
+ message: { type: String },
274
+ is_handled: { type: Boolean, default: false },
275
+ },
276
+ ],
277
+ default: [],
278
+ }, // array of error objects
269
279
  },
270
280
  {
271
281
  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.20",
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({