harvester_sdk 1.0.11 → 1.0.12
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 +6 -0
- package/dist/index.js +11 -1
- package/dist/types.d.ts +12 -0
- package/dist/types.js +5 -2
- package/index.ts +11 -0
- package/package.json +1 -1
- package/types.ts +5 -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;
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -412,6 +415,7 @@ export declare const MongoSourceSchema: Schema<any, import("mongoose").Model<any
|
|
|
412
415
|
is_public: boolean;
|
|
413
416
|
metadata: any;
|
|
414
417
|
dominant_geos: string[];
|
|
418
|
+
priority: "low" | "medium" | "high" | "critical";
|
|
415
419
|
notes?: string | null | undefined;
|
|
416
420
|
description?: string | null | undefined;
|
|
417
421
|
region_id?: string | null | undefined;
|
|
@@ -438,6 +442,7 @@ export declare const MongoSourceSchema: Schema<any, import("mongoose").Model<any
|
|
|
438
442
|
is_public: boolean;
|
|
439
443
|
metadata: any;
|
|
440
444
|
dominant_geos: string[];
|
|
445
|
+
priority: "low" | "medium" | "high" | "critical";
|
|
441
446
|
notes?: string | null | undefined;
|
|
442
447
|
description?: string | null | undefined;
|
|
443
448
|
region_id?: string | null | undefined;
|
|
@@ -464,6 +469,7 @@ export declare const MongoSourceSchema: Schema<any, import("mongoose").Model<any
|
|
|
464
469
|
is_public: boolean;
|
|
465
470
|
metadata: any;
|
|
466
471
|
dominant_geos: string[];
|
|
472
|
+
priority: "low" | "medium" | "high" | "critical";
|
|
467
473
|
notes?: string | null | undefined;
|
|
468
474
|
description?: string | null | undefined;
|
|
469
475
|
region_id?: string | null | undefined;
|
package/dist/index.js
CHANGED
|
@@ -147,6 +147,11 @@ exports.MongoDataSchema = new mongoose_1.Schema({
|
|
|
147
147
|
mentions: { type: [String], default: [] },
|
|
148
148
|
// Platform-specific metadata (flexible)
|
|
149
149
|
metadata: { type: Object },
|
|
150
|
+
processing_status: {
|
|
151
|
+
type: String,
|
|
152
|
+
enum: ['raw', 'processed', 'error'],
|
|
153
|
+
default: 'raw',
|
|
154
|
+
},
|
|
150
155
|
processing_errors: { type: String },
|
|
151
156
|
}, {
|
|
152
157
|
versionKey: false,
|
|
@@ -233,7 +238,12 @@ exports.MongoSourceSchema = new mongoose_1.Schema({
|
|
|
233
238
|
},
|
|
234
239
|
default: undefined,
|
|
235
240
|
},
|
|
236
|
-
notes: { type: String },
|
|
241
|
+
notes: { type: String },
|
|
242
|
+
priority: {
|
|
243
|
+
type: String,
|
|
244
|
+
enum: ['low', 'medium', 'high', 'critical'],
|
|
245
|
+
default: 'medium',
|
|
246
|
+
},
|
|
237
247
|
}, {
|
|
238
248
|
versionKey: false,
|
|
239
249
|
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>;
|
|
@@ -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> | {
|
|
@@ -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<{
|
|
@@ -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> | {
|
|
@@ -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> | {
|
|
@@ -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(),
|
|
@@ -273,6 +275,7 @@ exports.zodDataSchema = zod_1.z.object({
|
|
|
273
275
|
exports.websiteMetadataSchema,
|
|
274
276
|
zod_1.z.record(zod_1.z.string(), zod_1.z.any()), // fallback for unknown platforms
|
|
275
277
|
]).optional(),
|
|
278
|
+
processing_status: zod_1.z.enum(['raw', 'processed', 'error']).optional().default('raw'),
|
|
276
279
|
processing_errors: zod_1.z.string().optional(),
|
|
277
280
|
});
|
|
278
281
|
// Add validation refinement for platform-specific fields
|
package/index.ts
CHANGED
|
@@ -150,6 +150,12 @@ export const MongoDataSchema = new Schema(
|
|
|
150
150
|
// Platform-specific metadata (flexible)
|
|
151
151
|
metadata: { type: Object },
|
|
152
152
|
|
|
153
|
+
processing_status: {
|
|
154
|
+
type: String,
|
|
155
|
+
enum: ['raw', 'processed', 'error'],
|
|
156
|
+
default: 'raw',
|
|
157
|
+
},
|
|
158
|
+
|
|
153
159
|
processing_errors: { type: String },
|
|
154
160
|
},
|
|
155
161
|
{
|
|
@@ -249,6 +255,11 @@ export const MongoSourceSchema = new Schema(
|
|
|
249
255
|
default: undefined,
|
|
250
256
|
}, // user who requested this source
|
|
251
257
|
notes: { type: String }, // internal notes about the source
|
|
258
|
+
priority: {
|
|
259
|
+
type: String,
|
|
260
|
+
enum: ['low', 'medium', 'high', 'critical'],
|
|
261
|
+
default: 'medium',
|
|
262
|
+
},
|
|
252
263
|
},
|
|
253
264
|
{
|
|
254
265
|
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({
|
|
@@ -301,6 +304,8 @@ export const zodDataSchema = z.object({
|
|
|
301
304
|
websiteMetadataSchema,
|
|
302
305
|
z.record(z.string(), z.any()), // fallback for unknown platforms
|
|
303
306
|
]).optional(),
|
|
307
|
+
|
|
308
|
+
processing_status: z.enum(['raw', 'processed', 'error']).optional().default('raw'),
|
|
304
309
|
|
|
305
310
|
processing_errors: z.string().optional(),
|
|
306
311
|
|