harvester_sdk 1.0.11 → 1.0.13
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 +15 -9
- package/dist/index.js +15 -4
- package/dist/types.d.ts +20 -8
- package/dist/types.js +6 -2
- package/index.ts +15 -3
- package/package.json +1 -1
- package/types.ts +6 -0
package/dist/index.d.ts
CHANGED
|
@@ -75,6 +75,7 @@ export declare const MongoDataSchema: Schema<any, import("mongoose").Model<any,
|
|
|
75
75
|
mime_type?: string | null | undefined;
|
|
76
76
|
}>;
|
|
77
77
|
is_reply: boolean;
|
|
78
|
+
processing_status: "raw" | "processed" | "error";
|
|
78
79
|
platform?: "telegram" | "facebook" | "instagram" | "tiktok" | "website" | null | undefined;
|
|
79
80
|
metadata?: any;
|
|
80
81
|
timestamp?: number | null | undefined;
|
|
@@ -92,7 +93,7 @@ export declare const MongoDataSchema: Schema<any, import("mongoose").Model<any,
|
|
|
92
93
|
source_group_id?: string | null | undefined;
|
|
93
94
|
data_id?: any;
|
|
94
95
|
data_url?: string | null | undefined;
|
|
95
|
-
data_original_type?: "image" | "video" | "link" | "document" | "post" | "comment" | "reply" | "photo" | "story" | "reel" | "article" | null | undefined;
|
|
96
|
+
data_original_type?: "image" | "video" | "link" | "document" | "post" | "comment" | "reply" | "photo" | "story" | "reel" | "article" | "text" | null | undefined;
|
|
96
97
|
data_text?: string | null | undefined;
|
|
97
98
|
data_language?: string | null | undefined;
|
|
98
99
|
data_sentiment?: "positive" | "negative" | "neutral" | "mixed" | null | undefined;
|
|
@@ -167,6 +168,7 @@ export declare const MongoDataSchema: Schema<any, import("mongoose").Model<any,
|
|
|
167
168
|
mime_type?: string | null | undefined;
|
|
168
169
|
}>;
|
|
169
170
|
is_reply: boolean;
|
|
171
|
+
processing_status: "raw" | "processed" | "error";
|
|
170
172
|
platform?: "telegram" | "facebook" | "instagram" | "tiktok" | "website" | null | undefined;
|
|
171
173
|
metadata?: any;
|
|
172
174
|
timestamp?: number | null | undefined;
|
|
@@ -184,7 +186,7 @@ export declare const MongoDataSchema: Schema<any, import("mongoose").Model<any,
|
|
|
184
186
|
source_group_id?: string | null | undefined;
|
|
185
187
|
data_id?: any;
|
|
186
188
|
data_url?: string | null | undefined;
|
|
187
|
-
data_original_type?: "image" | "video" | "link" | "document" | "post" | "comment" | "reply" | "photo" | "story" | "reel" | "article" | null | undefined;
|
|
189
|
+
data_original_type?: "image" | "video" | "link" | "document" | "post" | "comment" | "reply" | "photo" | "story" | "reel" | "article" | "text" | null | undefined;
|
|
188
190
|
data_text?: string | null | undefined;
|
|
189
191
|
data_language?: string | null | undefined;
|
|
190
192
|
data_sentiment?: "positive" | "negative" | "neutral" | "mixed" | null | undefined;
|
|
@@ -259,6 +261,7 @@ export declare const MongoDataSchema: Schema<any, import("mongoose").Model<any,
|
|
|
259
261
|
mime_type?: string | null | undefined;
|
|
260
262
|
}>;
|
|
261
263
|
is_reply: boolean;
|
|
264
|
+
processing_status: "raw" | "processed" | "error";
|
|
262
265
|
platform?: "telegram" | "facebook" | "instagram" | "tiktok" | "website" | null | undefined;
|
|
263
266
|
metadata?: any;
|
|
264
267
|
timestamp?: number | null | undefined;
|
|
@@ -276,7 +279,7 @@ export declare const MongoDataSchema: Schema<any, import("mongoose").Model<any,
|
|
|
276
279
|
source_group_id?: string | null | undefined;
|
|
277
280
|
data_id?: any;
|
|
278
281
|
data_url?: string | null | undefined;
|
|
279
|
-
data_original_type?: "image" | "video" | "link" | "document" | "post" | "comment" | "reply" | "photo" | "story" | "reel" | "article" | null | undefined;
|
|
282
|
+
data_original_type?: "image" | "video" | "link" | "document" | "post" | "comment" | "reply" | "photo" | "story" | "reel" | "article" | "text" | null | undefined;
|
|
280
283
|
data_text?: string | null | undefined;
|
|
281
284
|
data_language?: string | null | undefined;
|
|
282
285
|
data_sentiment?: "positive" | "negative" | "neutral" | "mixed" | null | undefined;
|
|
@@ -406,16 +409,17 @@ export declare const MongoSourceSchema: Schema<any, import("mongoose").Model<any
|
|
|
406
409
|
created_at: number;
|
|
407
410
|
updated_at: number;
|
|
408
411
|
status: "active" | "pending" | "inactive" | "requested" | "discovered" | "deleted";
|
|
409
|
-
platform:
|
|
410
|
-
entity: "website" | "profile" | "group" | "page" | "channel" | "hashtag";
|
|
412
|
+
platform: string;
|
|
411
413
|
tags: string[];
|
|
412
414
|
is_public: boolean;
|
|
413
415
|
metadata: any;
|
|
414
416
|
dominant_geos: string[];
|
|
417
|
+
priority: "low" | "medium" | "high" | "critical";
|
|
415
418
|
notes?: string | null | undefined;
|
|
416
419
|
description?: string | null | undefined;
|
|
417
420
|
region_id?: string | null | undefined;
|
|
418
421
|
title?: string | null | undefined;
|
|
422
|
+
entity?: string | null | undefined;
|
|
419
423
|
public_id?: any;
|
|
420
424
|
url?: string | null | undefined;
|
|
421
425
|
language?: string | null | undefined;
|
|
@@ -432,16 +436,17 @@ export declare const MongoSourceSchema: Schema<any, import("mongoose").Model<any
|
|
|
432
436
|
created_at: number;
|
|
433
437
|
updated_at: number;
|
|
434
438
|
status: "active" | "pending" | "inactive" | "requested" | "discovered" | "deleted";
|
|
435
|
-
platform:
|
|
436
|
-
entity: "website" | "profile" | "group" | "page" | "channel" | "hashtag";
|
|
439
|
+
platform: string;
|
|
437
440
|
tags: string[];
|
|
438
441
|
is_public: boolean;
|
|
439
442
|
metadata: any;
|
|
440
443
|
dominant_geos: string[];
|
|
444
|
+
priority: "low" | "medium" | "high" | "critical";
|
|
441
445
|
notes?: string | null | undefined;
|
|
442
446
|
description?: string | null | undefined;
|
|
443
447
|
region_id?: string | null | undefined;
|
|
444
448
|
title?: string | null | undefined;
|
|
449
|
+
entity?: string | null | undefined;
|
|
445
450
|
public_id?: any;
|
|
446
451
|
url?: string | null | undefined;
|
|
447
452
|
language?: string | null | undefined;
|
|
@@ -458,16 +463,17 @@ export declare const MongoSourceSchema: Schema<any, import("mongoose").Model<any
|
|
|
458
463
|
created_at: number;
|
|
459
464
|
updated_at: number;
|
|
460
465
|
status: "active" | "pending" | "inactive" | "requested" | "discovered" | "deleted";
|
|
461
|
-
platform:
|
|
462
|
-
entity: "website" | "profile" | "group" | "page" | "channel" | "hashtag";
|
|
466
|
+
platform: string;
|
|
463
467
|
tags: string[];
|
|
464
468
|
is_public: boolean;
|
|
465
469
|
metadata: any;
|
|
466
470
|
dominant_geos: string[];
|
|
471
|
+
priority: "low" | "medium" | "high" | "critical";
|
|
467
472
|
notes?: string | null | undefined;
|
|
468
473
|
description?: string | null | undefined;
|
|
469
474
|
region_id?: string | null | undefined;
|
|
470
475
|
title?: string | null | undefined;
|
|
476
|
+
entity?: string | null | undefined;
|
|
471
477
|
public_id?: any;
|
|
472
478
|
url?: string | null | undefined;
|
|
473
479
|
language?: string | null | undefined;
|
package/dist/index.js
CHANGED
|
@@ -54,6 +54,7 @@ exports.MongoDataSchema = new mongoose_1.Schema({
|
|
|
54
54
|
'article',
|
|
55
55
|
'link',
|
|
56
56
|
'document',
|
|
57
|
+
'text'
|
|
57
58
|
],
|
|
58
59
|
},
|
|
59
60
|
// Content
|
|
@@ -147,6 +148,11 @@ exports.MongoDataSchema = new mongoose_1.Schema({
|
|
|
147
148
|
mentions: { type: [String], default: [] },
|
|
148
149
|
// Platform-specific metadata (flexible)
|
|
149
150
|
metadata: { type: Object },
|
|
151
|
+
processing_status: {
|
|
152
|
+
type: String,
|
|
153
|
+
enum: ['raw', 'processed', 'error'],
|
|
154
|
+
default: 'raw',
|
|
155
|
+
},
|
|
150
156
|
processing_errors: { type: String },
|
|
151
157
|
}, {
|
|
152
158
|
versionKey: false,
|
|
@@ -197,13 +203,13 @@ exports.MongoSourceSchema = new mongoose_1.Schema({
|
|
|
197
203
|
title: { type: String },
|
|
198
204
|
platform: {
|
|
199
205
|
type: String,
|
|
200
|
-
enum:
|
|
206
|
+
// enum: platformsList,
|
|
201
207
|
required: true,
|
|
202
208
|
},
|
|
203
209
|
entity: {
|
|
204
210
|
type: String,
|
|
205
|
-
enum:
|
|
206
|
-
required: true,
|
|
211
|
+
// enum: entityTypesList,
|
|
212
|
+
// required: true,
|
|
207
213
|
},
|
|
208
214
|
public_id: { type: mongoose_1.Schema.Types.Mixed },
|
|
209
215
|
url: { type: String },
|
|
@@ -233,7 +239,12 @@ exports.MongoSourceSchema = new mongoose_1.Schema({
|
|
|
233
239
|
},
|
|
234
240
|
default: undefined,
|
|
235
241
|
},
|
|
236
|
-
notes: { type: String },
|
|
242
|
+
notes: { type: String },
|
|
243
|
+
priority: {
|
|
244
|
+
type: String,
|
|
245
|
+
enum: ['low', 'medium', 'high', 'critical'],
|
|
246
|
+
default: 'medium',
|
|
247
|
+
},
|
|
237
248
|
}, {
|
|
238
249
|
versionKey: false,
|
|
239
250
|
toJSON: { virtuals: true },
|
package/dist/types.d.ts
CHANGED
|
@@ -8,6 +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
12
|
export declare const sourceStatusList: readonly ["active", "pending", "inactive", "requested", "discovered", "deleted"];
|
|
12
13
|
export declare const generalStatusList: readonly ["active", "inactive", "deleted"];
|
|
13
14
|
export declare const zodRegionSchema: z.ZodObject<{
|
|
@@ -111,6 +112,7 @@ export declare const zodSourceSchema: z.ZodObject<{
|
|
|
111
112
|
requested_at?: number | undefined;
|
|
112
113
|
}>>;
|
|
113
114
|
notes: z.ZodOptional<z.ZodString>;
|
|
115
|
+
priority: z.ZodOptional<z.ZodEnum<["low", "medium", "high", "critical"]>>;
|
|
114
116
|
}, "strip", z.ZodTypeAny, {
|
|
115
117
|
status: "active" | "pending" | "inactive" | "requested" | "discovered" | "deleted";
|
|
116
118
|
platform: "telegram" | "facebook" | "instagram" | "tiktok" | "website";
|
|
@@ -138,6 +140,7 @@ export declare const zodSourceSchema: z.ZodObject<{
|
|
|
138
140
|
email?: string | undefined;
|
|
139
141
|
requested_at?: number | undefined;
|
|
140
142
|
} | undefined;
|
|
143
|
+
priority?: "low" | "medium" | "high" | "critical" | undefined;
|
|
141
144
|
}, {
|
|
142
145
|
status: "active" | "pending" | "inactive" | "requested" | "discovered" | "deleted";
|
|
143
146
|
platform: "telegram" | "facebook" | "instagram" | "tiktok" | "website";
|
|
@@ -165,6 +168,7 @@ export declare const zodSourceSchema: z.ZodObject<{
|
|
|
165
168
|
email?: string | undefined;
|
|
166
169
|
requested_at?: number | undefined;
|
|
167
170
|
} | undefined;
|
|
171
|
+
priority?: "low" | "medium" | "high" | "critical" | undefined;
|
|
168
172
|
}>;
|
|
169
173
|
export declare const zodGeoSchema: z.ZodObject<{
|
|
170
174
|
_id: z.ZodOptional<z.ZodString>;
|
|
@@ -468,7 +472,7 @@ export declare const zodDataSchema: z.ZodObject<{
|
|
|
468
472
|
source_dominant_geos: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
469
473
|
data_id: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
470
474
|
data_url: z.ZodOptional<z.ZodString>;
|
|
471
|
-
data_original_type: z.ZodOptional<z.ZodEnum<["post", "comment", "reply", "video", "image", "photo", "story", "reel", "article", "link", "document"]>>;
|
|
475
|
+
data_original_type: z.ZodOptional<z.ZodEnum<["post", "comment", "reply", "video", "image", "photo", "story", "reel", "article", "link", "document", "text"]>>;
|
|
472
476
|
data_text: z.ZodOptional<z.ZodString>;
|
|
473
477
|
data_language: z.ZodOptional<z.ZodString>;
|
|
474
478
|
data_geo: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
@@ -739,6 +743,7 @@ export declare const zodDataSchema: z.ZodObject<{
|
|
|
739
743
|
publish_date?: number | undefined;
|
|
740
744
|
category?: string | undefined;
|
|
741
745
|
}>, z.ZodRecord<z.ZodString, z.ZodAny>]>>;
|
|
746
|
+
processing_status: z.ZodDefault<z.ZodOptional<z.ZodEnum<["raw", "processed", "error"]>>>;
|
|
742
747
|
processing_errors: z.ZodOptional<z.ZodString>;
|
|
743
748
|
}, "strip", z.ZodTypeAny, {
|
|
744
749
|
created_at: number;
|
|
@@ -760,6 +765,7 @@ export declare const zodDataSchema: z.ZodObject<{
|
|
|
760
765
|
mime_type?: string | undefined;
|
|
761
766
|
}[];
|
|
762
767
|
is_reply: boolean;
|
|
768
|
+
processing_status: "raw" | "processed" | "error";
|
|
763
769
|
_id?: string | undefined;
|
|
764
770
|
platform?: "telegram" | "facebook" | "instagram" | "tiktok" | "website" | undefined;
|
|
765
771
|
metadata?: Record<string, any> | {
|
|
@@ -831,7 +837,7 @@ export declare const zodDataSchema: z.ZodObject<{
|
|
|
831
837
|
source_group_id?: string | undefined;
|
|
832
838
|
data_id?: string | number | undefined;
|
|
833
839
|
data_url?: string | undefined;
|
|
834
|
-
data_original_type?: "image" | "video" | "link" | "document" | "post" | "comment" | "reply" | "photo" | "story" | "reel" | "article" | undefined;
|
|
840
|
+
data_original_type?: "image" | "video" | "link" | "document" | "post" | "comment" | "reply" | "photo" | "story" | "reel" | "article" | "text" | undefined;
|
|
835
841
|
data_text?: string | undefined;
|
|
836
842
|
data_language?: string | undefined;
|
|
837
843
|
data_sentiment?: "positive" | "negative" | "neutral" | "mixed" | undefined;
|
|
@@ -944,7 +950,7 @@ export declare const zodDataSchema: z.ZodObject<{
|
|
|
944
950
|
source_dominant_geos?: string[] | undefined;
|
|
945
951
|
data_id?: string | number | undefined;
|
|
946
952
|
data_url?: string | undefined;
|
|
947
|
-
data_original_type?: "image" | "video" | "link" | "document" | "post" | "comment" | "reply" | "photo" | "story" | "reel" | "article" | undefined;
|
|
953
|
+
data_original_type?: "image" | "video" | "link" | "document" | "post" | "comment" | "reply" | "photo" | "story" | "reel" | "article" | "text" | undefined;
|
|
948
954
|
data_text?: string | undefined;
|
|
949
955
|
data_language?: string | undefined;
|
|
950
956
|
data_geo?: string[] | undefined;
|
|
@@ -991,6 +997,7 @@ export declare const zodDataSchema: z.ZodObject<{
|
|
|
991
997
|
} | undefined;
|
|
992
998
|
is_deleted?: boolean | undefined;
|
|
993
999
|
is_forwarded?: boolean | undefined;
|
|
1000
|
+
processing_status?: "raw" | "processed" | "error" | undefined;
|
|
994
1001
|
processing_errors?: string | undefined;
|
|
995
1002
|
}>;
|
|
996
1003
|
export declare const zodDataSchemaWithValidation: z.ZodEffects<z.ZodObject<{
|
|
@@ -1009,7 +1016,7 @@ export declare const zodDataSchemaWithValidation: z.ZodEffects<z.ZodObject<{
|
|
|
1009
1016
|
source_dominant_geos: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
1010
1017
|
data_id: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
1011
1018
|
data_url: z.ZodOptional<z.ZodString>;
|
|
1012
|
-
data_original_type: z.ZodOptional<z.ZodEnum<["post", "comment", "reply", "video", "image", "photo", "story", "reel", "article", "link", "document"]>>;
|
|
1019
|
+
data_original_type: z.ZodOptional<z.ZodEnum<["post", "comment", "reply", "video", "image", "photo", "story", "reel", "article", "link", "document", "text"]>>;
|
|
1013
1020
|
data_text: z.ZodOptional<z.ZodString>;
|
|
1014
1021
|
data_language: z.ZodOptional<z.ZodString>;
|
|
1015
1022
|
data_geo: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
@@ -1280,6 +1287,7 @@ export declare const zodDataSchemaWithValidation: z.ZodEffects<z.ZodObject<{
|
|
|
1280
1287
|
publish_date?: number | undefined;
|
|
1281
1288
|
category?: string | undefined;
|
|
1282
1289
|
}>, z.ZodRecord<z.ZodString, z.ZodAny>]>>;
|
|
1290
|
+
processing_status: z.ZodDefault<z.ZodOptional<z.ZodEnum<["raw", "processed", "error"]>>>;
|
|
1283
1291
|
processing_errors: z.ZodOptional<z.ZodString>;
|
|
1284
1292
|
}, "strip", z.ZodTypeAny, {
|
|
1285
1293
|
created_at: number;
|
|
@@ -1301,6 +1309,7 @@ export declare const zodDataSchemaWithValidation: z.ZodEffects<z.ZodObject<{
|
|
|
1301
1309
|
mime_type?: string | undefined;
|
|
1302
1310
|
}[];
|
|
1303
1311
|
is_reply: boolean;
|
|
1312
|
+
processing_status: "raw" | "processed" | "error";
|
|
1304
1313
|
_id?: string | undefined;
|
|
1305
1314
|
platform?: "telegram" | "facebook" | "instagram" | "tiktok" | "website" | undefined;
|
|
1306
1315
|
metadata?: Record<string, any> | {
|
|
@@ -1372,7 +1381,7 @@ export declare const zodDataSchemaWithValidation: z.ZodEffects<z.ZodObject<{
|
|
|
1372
1381
|
source_group_id?: string | undefined;
|
|
1373
1382
|
data_id?: string | number | undefined;
|
|
1374
1383
|
data_url?: string | undefined;
|
|
1375
|
-
data_original_type?: "image" | "video" | "link" | "document" | "post" | "comment" | "reply" | "photo" | "story" | "reel" | "article" | undefined;
|
|
1384
|
+
data_original_type?: "image" | "video" | "link" | "document" | "post" | "comment" | "reply" | "photo" | "story" | "reel" | "article" | "text" | undefined;
|
|
1376
1385
|
data_text?: string | undefined;
|
|
1377
1386
|
data_language?: string | undefined;
|
|
1378
1387
|
data_sentiment?: "positive" | "negative" | "neutral" | "mixed" | undefined;
|
|
@@ -1485,7 +1494,7 @@ export declare const zodDataSchemaWithValidation: z.ZodEffects<z.ZodObject<{
|
|
|
1485
1494
|
source_dominant_geos?: string[] | undefined;
|
|
1486
1495
|
data_id?: string | number | undefined;
|
|
1487
1496
|
data_url?: string | undefined;
|
|
1488
|
-
data_original_type?: "image" | "video" | "link" | "document" | "post" | "comment" | "reply" | "photo" | "story" | "reel" | "article" | undefined;
|
|
1497
|
+
data_original_type?: "image" | "video" | "link" | "document" | "post" | "comment" | "reply" | "photo" | "story" | "reel" | "article" | "text" | undefined;
|
|
1489
1498
|
data_text?: string | undefined;
|
|
1490
1499
|
data_language?: string | undefined;
|
|
1491
1500
|
data_geo?: string[] | undefined;
|
|
@@ -1532,6 +1541,7 @@ export declare const zodDataSchemaWithValidation: z.ZodEffects<z.ZodObject<{
|
|
|
1532
1541
|
} | undefined;
|
|
1533
1542
|
is_deleted?: boolean | undefined;
|
|
1534
1543
|
is_forwarded?: boolean | undefined;
|
|
1544
|
+
processing_status?: "raw" | "processed" | "error" | undefined;
|
|
1535
1545
|
processing_errors?: string | undefined;
|
|
1536
1546
|
}>, {
|
|
1537
1547
|
created_at: number;
|
|
@@ -1553,6 +1563,7 @@ export declare const zodDataSchemaWithValidation: z.ZodEffects<z.ZodObject<{
|
|
|
1553
1563
|
mime_type?: string | undefined;
|
|
1554
1564
|
}[];
|
|
1555
1565
|
is_reply: boolean;
|
|
1566
|
+
processing_status: "raw" | "processed" | "error";
|
|
1556
1567
|
_id?: string | undefined;
|
|
1557
1568
|
platform?: "telegram" | "facebook" | "instagram" | "tiktok" | "website" | undefined;
|
|
1558
1569
|
metadata?: Record<string, any> | {
|
|
@@ -1624,7 +1635,7 @@ export declare const zodDataSchemaWithValidation: z.ZodEffects<z.ZodObject<{
|
|
|
1624
1635
|
source_group_id?: string | undefined;
|
|
1625
1636
|
data_id?: string | number | undefined;
|
|
1626
1637
|
data_url?: string | undefined;
|
|
1627
|
-
data_original_type?: "image" | "video" | "link" | "document" | "post" | "comment" | "reply" | "photo" | "story" | "reel" | "article" | undefined;
|
|
1638
|
+
data_original_type?: "image" | "video" | "link" | "document" | "post" | "comment" | "reply" | "photo" | "story" | "reel" | "article" | "text" | undefined;
|
|
1628
1639
|
data_text?: string | undefined;
|
|
1629
1640
|
data_language?: string | undefined;
|
|
1630
1641
|
data_sentiment?: "positive" | "negative" | "neutral" | "mixed" | undefined;
|
|
@@ -1737,7 +1748,7 @@ export declare const zodDataSchemaWithValidation: z.ZodEffects<z.ZodObject<{
|
|
|
1737
1748
|
source_dominant_geos?: string[] | undefined;
|
|
1738
1749
|
data_id?: string | number | undefined;
|
|
1739
1750
|
data_url?: string | undefined;
|
|
1740
|
-
data_original_type?: "image" | "video" | "link" | "document" | "post" | "comment" | "reply" | "photo" | "story" | "reel" | "article" | undefined;
|
|
1751
|
+
data_original_type?: "image" | "video" | "link" | "document" | "post" | "comment" | "reply" | "photo" | "story" | "reel" | "article" | "text" | undefined;
|
|
1741
1752
|
data_text?: string | undefined;
|
|
1742
1753
|
data_language?: string | undefined;
|
|
1743
1754
|
data_geo?: string[] | undefined;
|
|
@@ -1784,6 +1795,7 @@ export declare const zodDataSchemaWithValidation: z.ZodEffects<z.ZodObject<{
|
|
|
1784
1795
|
} | undefined;
|
|
1785
1796
|
is_deleted?: boolean | undefined;
|
|
1786
1797
|
is_forwarded?: boolean | undefined;
|
|
1798
|
+
processing_status?: "raw" | "processed" | "error" | undefined;
|
|
1787
1799
|
processing_errors?: string | undefined;
|
|
1788
1800
|
}>;
|
|
1789
1801
|
export type RegionType = z.infer<typeof zodRegionSchema>;
|
package/dist/types.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getAllowedEntitiesForPlatform = exports.zodDataSchemaWithValidation = exports.zodDataSchema = exports.authorSchema = exports.repliesInfoSchema = exports.mediaItemSchema = exports.websiteMetadataSchema = exports.tiktokMetadataSchema = exports.instagramMetadataSchema = exports.facebookMetadataSchema = exports.telegramMetadataSchema = exports.zodGeoSelectionSchema = exports.zodGeoSchema = exports.zodSourceSchema = exports.zodSourceGroupSchema = exports.zodRegionSchema = exports.generalStatusList = exports.sourceStatusList = exports.platformEntityMap = exports.entityTypesList = exports.platformsList = void 0;
|
|
3
|
+
exports.getAllowedEntitiesForPlatform = exports.zodDataSchemaWithValidation = exports.zodDataSchema = exports.authorSchema = exports.repliesInfoSchema = exports.mediaItemSchema = exports.websiteMetadataSchema = exports.tiktokMetadataSchema = exports.instagramMetadataSchema = exports.facebookMetadataSchema = exports.telegramMetadataSchema = exports.zodGeoSelectionSchema = exports.zodGeoSchema = exports.zodSourceSchema = exports.zodSourceGroupSchema = exports.zodRegionSchema = exports.generalStatusList = 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',
|
|
@@ -25,6 +25,7 @@ exports.platformEntityMap = {
|
|
|
25
25
|
tiktok: ['profile', 'hashtag'],
|
|
26
26
|
website: ['website'],
|
|
27
27
|
};
|
|
28
|
+
exports.priorityLevels = ['low', 'medium', 'high', 'critical'];
|
|
28
29
|
exports.sourceStatusList = [
|
|
29
30
|
'active',
|
|
30
31
|
'pending',
|
|
@@ -84,7 +85,8 @@ exports.zodSourceSchema = zod_1.z.object({
|
|
|
84
85
|
requested_at: zod_1.z.number().optional(),
|
|
85
86
|
})
|
|
86
87
|
.optional(),
|
|
87
|
-
notes: zod_1.z.string().optional(),
|
|
88
|
+
notes: zod_1.z.string().optional(),
|
|
89
|
+
priority: zod_1.z.enum(exports.priorityLevels).optional(),
|
|
88
90
|
});
|
|
89
91
|
exports.zodGeoSchema = zod_1.z.object({
|
|
90
92
|
_id: zod_1.z.string().optional(),
|
|
@@ -223,6 +225,7 @@ exports.zodDataSchema = zod_1.z.object({
|
|
|
223
225
|
'article',
|
|
224
226
|
'link',
|
|
225
227
|
'document',
|
|
228
|
+
'text'
|
|
226
229
|
]).optional(),
|
|
227
230
|
// Content
|
|
228
231
|
data_text: zod_1.z.string().optional(),
|
|
@@ -273,6 +276,7 @@ exports.zodDataSchema = zod_1.z.object({
|
|
|
273
276
|
exports.websiteMetadataSchema,
|
|
274
277
|
zod_1.z.record(zod_1.z.string(), zod_1.z.any()), // fallback for unknown platforms
|
|
275
278
|
]).optional(),
|
|
279
|
+
processing_status: zod_1.z.enum(['raw', 'processed', 'error']).optional().default('raw'),
|
|
276
280
|
processing_errors: zod_1.z.string().optional(),
|
|
277
281
|
});
|
|
278
282
|
// Add validation refinement for platform-specific fields
|
package/index.ts
CHANGED
|
@@ -47,6 +47,7 @@ export const MongoDataSchema = new Schema(
|
|
|
47
47
|
'article',
|
|
48
48
|
'link',
|
|
49
49
|
'document',
|
|
50
|
+
'text'
|
|
50
51
|
],
|
|
51
52
|
},
|
|
52
53
|
|
|
@@ -150,6 +151,12 @@ export const MongoDataSchema = new Schema(
|
|
|
150
151
|
// Platform-specific metadata (flexible)
|
|
151
152
|
metadata: { type: Object },
|
|
152
153
|
|
|
154
|
+
processing_status: {
|
|
155
|
+
type: String,
|
|
156
|
+
enum: ['raw', 'processed', 'error'],
|
|
157
|
+
default: 'raw',
|
|
158
|
+
},
|
|
159
|
+
|
|
153
160
|
processing_errors: { type: String },
|
|
154
161
|
},
|
|
155
162
|
{
|
|
@@ -212,13 +219,13 @@ export const MongoSourceSchema = new Schema(
|
|
|
212
219
|
title: { type: String }, // e.g., 'Telegram Channel Name'
|
|
213
220
|
platform: {
|
|
214
221
|
type: String,
|
|
215
|
-
enum: platformsList,
|
|
222
|
+
// enum: platformsList,
|
|
216
223
|
required: true,
|
|
217
224
|
},
|
|
218
225
|
entity: {
|
|
219
226
|
type: String,
|
|
220
|
-
enum: entityTypesList,
|
|
221
|
-
required: true,
|
|
227
|
+
// enum: entityTypesList,
|
|
228
|
+
// required: true,
|
|
222
229
|
}, // e.g., 'channel', 'group', 'page', 'profile', 'hashtag'
|
|
223
230
|
public_id: { type: Schema.Types.Mixed }, // e.g., '@telegram_channel_id'
|
|
224
231
|
url: { type: String }, // e.g., 'https://t.me/telegram_channel_name'
|
|
@@ -249,6 +256,11 @@ export const MongoSourceSchema = new Schema(
|
|
|
249
256
|
default: undefined,
|
|
250
257
|
}, // user who requested this source
|
|
251
258
|
notes: { type: String }, // internal notes about the source
|
|
259
|
+
priority: {
|
|
260
|
+
type: String,
|
|
261
|
+
enum: ['low', 'medium', 'high', 'critical'],
|
|
262
|
+
default: 'medium',
|
|
263
|
+
},
|
|
252
264
|
},
|
|
253
265
|
{
|
|
254
266
|
versionKey: false,
|
package/package.json
CHANGED
package/types.ts
CHANGED
|
@@ -26,6 +26,8 @@ export const platformEntityMap = {
|
|
|
26
26
|
website: ['website'],
|
|
27
27
|
} as const;
|
|
28
28
|
|
|
29
|
+
export const priorityLevels = ['low', 'medium', 'high', 'critical'] as const;
|
|
30
|
+
|
|
29
31
|
export const sourceStatusList = [
|
|
30
32
|
'active', // active and approved sources
|
|
31
33
|
'pending', // sources that are pending approval
|
|
@@ -90,6 +92,7 @@ export const zodSourceSchema = z.object({
|
|
|
90
92
|
})
|
|
91
93
|
.optional(), // user who requested this source
|
|
92
94
|
notes: z.string().optional(), // internal notes about the source
|
|
95
|
+
priority: z.enum(priorityLevels).optional(),
|
|
93
96
|
});
|
|
94
97
|
|
|
95
98
|
export const zodGeoSchema = z.object({
|
|
@@ -242,6 +245,7 @@ export const zodDataSchema = z.object({
|
|
|
242
245
|
'article',
|
|
243
246
|
'link',
|
|
244
247
|
'document',
|
|
248
|
+
'text'
|
|
245
249
|
]).optional(),
|
|
246
250
|
|
|
247
251
|
// Content
|
|
@@ -301,6 +305,8 @@ export const zodDataSchema = z.object({
|
|
|
301
305
|
websiteMetadataSchema,
|
|
302
306
|
z.record(z.string(), z.any()), // fallback for unknown platforms
|
|
303
307
|
]).optional(),
|
|
308
|
+
|
|
309
|
+
processing_status: z.enum(['raw', 'processed', 'error']).optional().default('raw'),
|
|
304
310
|
|
|
305
311
|
processing_errors: z.string().optional(),
|
|
306
312
|
|