harvester_sdk 1.0.18 → 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 +45 -6
- package/dist/index.js +13 -3
- package/dist/types.d.ts +29 -6
- package/dist/types.js +12 -1
- package/index.ts +14 -3
- package/package.json +1 -1
- package/types.ts +14 -1
package/dist/index.d.ts
CHANGED
|
@@ -415,7 +415,20 @@ export declare const MongoSourceSchema: Schema<any, import("mongoose").Model<any
|
|
|
415
415
|
metadata: any;
|
|
416
416
|
dominant_geos: string[];
|
|
417
417
|
mentions_in_discovery: number;
|
|
418
|
-
priority: "low" | "medium" | "high" | "critical";
|
|
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;
|
|
@@ -446,7 +459,20 @@ export declare const MongoSourceSchema: Schema<any, import("mongoose").Model<any
|
|
|
446
459
|
metadata: any;
|
|
447
460
|
dominant_geos: string[];
|
|
448
461
|
mentions_in_discovery: number;
|
|
449
|
-
priority: "low" | "medium" | "high" | "critical";
|
|
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;
|
|
@@ -477,7 +503,20 @@ export declare const MongoSourceSchema: Schema<any, import("mongoose").Model<any
|
|
|
477
503
|
metadata: any;
|
|
478
504
|
dominant_geos: string[];
|
|
479
505
|
mentions_in_discovery: number;
|
|
480
|
-
priority: "low" | "medium" | "high" | "critical";
|
|
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
|
@@ -54,7 +54,7 @@ exports.MongoDataSchema = new mongoose_1.Schema({
|
|
|
54
54
|
'article',
|
|
55
55
|
'link',
|
|
56
56
|
'document',
|
|
57
|
-
'text'
|
|
57
|
+
'text',
|
|
58
58
|
],
|
|
59
59
|
},
|
|
60
60
|
// Content
|
|
@@ -246,9 +246,19 @@ exports.MongoSourceSchema = new mongoose_1.Schema({
|
|
|
246
246
|
notes: { type: String },
|
|
247
247
|
priority: {
|
|
248
248
|
type: String,
|
|
249
|
-
enum:
|
|
250
|
-
default: '
|
|
249
|
+
enum: types_1.priorityLevels,
|
|
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
|
@@ -8,7 +8,7 @@ export declare const platformEntityMap: {
|
|
|
8
8
|
readonly tiktok: readonly ["profile", "hashtag"];
|
|
9
9
|
readonly website: readonly ["website"];
|
|
10
10
|
};
|
|
11
|
-
export declare const priorityLevels: readonly ["low", "medium", "high", "critical"];
|
|
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
13
|
export declare const generalStatusList: readonly ["active", "inactive", "deleted"];
|
|
14
14
|
export declare const zodRegionSchema: z.ZodObject<{
|
|
@@ -116,12 +116,30 @@ export declare const zodSourceSchema: z.ZodObject<{
|
|
|
116
116
|
requested_at?: number | undefined;
|
|
117
117
|
}>>;
|
|
118
118
|
notes: z.ZodOptional<z.ZodString>;
|
|
119
|
-
priority: z.ZodOptional<z.ZodEnum<["low", "medium", "high", "critical"]>>;
|
|
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;
|
|
@@ -148,11 +166,16 @@ export declare const zodSourceSchema: z.ZodObject<{
|
|
|
148
166
|
email?: string | undefined;
|
|
149
167
|
requested_at?: number | undefined;
|
|
150
168
|
} | undefined;
|
|
151
|
-
priority?: "low" | "medium" | "high" | "critical" | undefined;
|
|
169
|
+
priority?: "none" | "low" | "medium" | "high" | "critical" | undefined;
|
|
152
170
|
}, {
|
|
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;
|
|
@@ -180,7 +203,7 @@ export declare const zodSourceSchema: z.ZodObject<{
|
|
|
180
203
|
email?: string | undefined;
|
|
181
204
|
requested_at?: number | undefined;
|
|
182
205
|
} | undefined;
|
|
183
|
-
priority?: "low" | "medium" | "high" | "critical" | undefined;
|
|
206
|
+
priority?: "none" | "low" | "medium" | "high" | "critical" | undefined;
|
|
184
207
|
}>;
|
|
185
208
|
export declare const zodGeoSchema: z.ZodObject<{
|
|
186
209
|
_id: z.ZodOptional<z.ZodString>;
|
|
@@ -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 = [
|
|
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
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
platformsList,
|
|
8
8
|
entityTypesList,
|
|
9
9
|
sourceStatusList,
|
|
10
|
+
priorityLevels,
|
|
10
11
|
} from './types';
|
|
11
12
|
|
|
12
13
|
export const MongoDataSchema = new Schema(
|
|
@@ -47,7 +48,7 @@ export const MongoDataSchema = new Schema(
|
|
|
47
48
|
'article',
|
|
48
49
|
'link',
|
|
49
50
|
'document',
|
|
50
|
-
'text'
|
|
51
|
+
'text',
|
|
51
52
|
],
|
|
52
53
|
},
|
|
53
54
|
|
|
@@ -262,9 +263,19 @@ export const MongoSourceSchema = new Schema(
|
|
|
262
263
|
notes: { type: String }, // internal notes about the source
|
|
263
264
|
priority: {
|
|
264
265
|
type: String,
|
|
265
|
-
enum:
|
|
266
|
-
default: '
|
|
266
|
+
enum: priorityLevels,
|
|
267
|
+
default: 'none',
|
|
267
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
|
|
268
279
|
},
|
|
269
280
|
{
|
|
270
281
|
versionKey: false,
|
package/package.json
CHANGED
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 = [
|
|
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({
|