harvester_sdk 1.0.2 → 1.0.3
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 -15
- package/dist/types.d.ts +16 -4
- package/dist/types.js +17 -7
- package/package.json +1 -1
- package/types.ts +50 -36
package/dist/index.d.ts
CHANGED
|
@@ -266,6 +266,7 @@ export declare const MongoSourceSchema: Schema<any, import("mongoose").Model<any
|
|
|
266
266
|
tags: string[];
|
|
267
267
|
is_public: boolean;
|
|
268
268
|
metadata: any;
|
|
269
|
+
notes?: string | null | undefined;
|
|
269
270
|
description?: string | null | undefined;
|
|
270
271
|
region_id?: string | null | undefined;
|
|
271
272
|
title?: string | null | undefined;
|
|
@@ -280,7 +281,6 @@ export declare const MongoSourceSchema: Schema<any, import("mongoose").Model<any
|
|
|
280
281
|
email?: string | null | undefined;
|
|
281
282
|
requested_at?: number | null | undefined;
|
|
282
283
|
} | null | undefined;
|
|
283
|
-
notes?: string | null | undefined;
|
|
284
284
|
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
285
285
|
name: string;
|
|
286
286
|
created_at: number;
|
|
@@ -291,6 +291,7 @@ export declare const MongoSourceSchema: Schema<any, import("mongoose").Model<any
|
|
|
291
291
|
tags: string[];
|
|
292
292
|
is_public: boolean;
|
|
293
293
|
metadata: any;
|
|
294
|
+
notes?: string | null | undefined;
|
|
294
295
|
description?: string | null | undefined;
|
|
295
296
|
region_id?: string | null | undefined;
|
|
296
297
|
title?: string | null | undefined;
|
|
@@ -305,7 +306,6 @@ export declare const MongoSourceSchema: Schema<any, import("mongoose").Model<any
|
|
|
305
306
|
email?: string | null | undefined;
|
|
306
307
|
requested_at?: number | null | undefined;
|
|
307
308
|
} | null | undefined;
|
|
308
|
-
notes?: string | null | undefined;
|
|
309
309
|
}>, {}> & import("mongoose").FlatRecord<{
|
|
310
310
|
name: string;
|
|
311
311
|
created_at: number;
|
|
@@ -316,6 +316,7 @@ export declare const MongoSourceSchema: Schema<any, import("mongoose").Model<any
|
|
|
316
316
|
tags: string[];
|
|
317
317
|
is_public: boolean;
|
|
318
318
|
metadata: any;
|
|
319
|
+
notes?: string | null | undefined;
|
|
319
320
|
description?: string | null | undefined;
|
|
320
321
|
region_id?: string | null | undefined;
|
|
321
322
|
title?: string | null | undefined;
|
|
@@ -330,7 +331,6 @@ export declare const MongoSourceSchema: Schema<any, import("mongoose").Model<any
|
|
|
330
331
|
email?: string | null | undefined;
|
|
331
332
|
requested_at?: number | null | undefined;
|
|
332
333
|
} | null | undefined;
|
|
333
|
-
notes?: string | null | undefined;
|
|
334
334
|
}> & {
|
|
335
335
|
_id: import("mongoose").Types.ObjectId;
|
|
336
336
|
} & {
|
|
@@ -393,7 +393,7 @@ export declare const MongoUserSettingsSchema: Schema<any, import("mongoose").Mod
|
|
|
393
393
|
}, {
|
|
394
394
|
created_at: NativeDate;
|
|
395
395
|
updated_at: NativeDate;
|
|
396
|
-
status: "active" | "inactive";
|
|
396
|
+
status: "active" | "inactive" | "deleted";
|
|
397
397
|
user_id: string;
|
|
398
398
|
geos: string[];
|
|
399
399
|
sources: string[];
|
|
@@ -405,7 +405,7 @@ export declare const MongoUserSettingsSchema: Schema<any, import("mongoose").Mod
|
|
|
405
405
|
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
406
406
|
created_at: NativeDate;
|
|
407
407
|
updated_at: NativeDate;
|
|
408
|
-
status: "active" | "inactive";
|
|
408
|
+
status: "active" | "inactive" | "deleted";
|
|
409
409
|
user_id: string;
|
|
410
410
|
geos: string[];
|
|
411
411
|
sources: string[];
|
|
@@ -417,7 +417,7 @@ export declare const MongoUserSettingsSchema: Schema<any, import("mongoose").Mod
|
|
|
417
417
|
}>, {}> & import("mongoose").FlatRecord<{
|
|
418
418
|
created_at: NativeDate;
|
|
419
419
|
updated_at: NativeDate;
|
|
420
|
-
status: "active" | "inactive";
|
|
420
|
+
status: "active" | "inactive" | "deleted";
|
|
421
421
|
user_id: string;
|
|
422
422
|
geos: string[];
|
|
423
423
|
sources: string[];
|
|
@@ -442,7 +442,7 @@ export declare const MongoConversationSchema: Schema<any, import("mongoose").Mod
|
|
|
442
442
|
}, {
|
|
443
443
|
created_at: NativeDate;
|
|
444
444
|
updated_at: NativeDate;
|
|
445
|
-
status: "active" | "inactive";
|
|
445
|
+
status: "active" | "inactive" | "deleted";
|
|
446
446
|
user_id: string;
|
|
447
447
|
is_job: boolean;
|
|
448
448
|
title?: string | null | undefined;
|
|
@@ -450,7 +450,7 @@ export declare const MongoConversationSchema: Schema<any, import("mongoose").Mod
|
|
|
450
450
|
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
451
451
|
created_at: NativeDate;
|
|
452
452
|
updated_at: NativeDate;
|
|
453
|
-
status: "active" | "inactive";
|
|
453
|
+
status: "active" | "inactive" | "deleted";
|
|
454
454
|
user_id: string;
|
|
455
455
|
is_job: boolean;
|
|
456
456
|
title?: string | null | undefined;
|
|
@@ -458,7 +458,7 @@ export declare const MongoConversationSchema: Schema<any, import("mongoose").Mod
|
|
|
458
458
|
}>, {}> & import("mongoose").FlatRecord<{
|
|
459
459
|
created_at: NativeDate;
|
|
460
460
|
updated_at: NativeDate;
|
|
461
|
-
status: "active" | "inactive";
|
|
461
|
+
status: "active" | "inactive" | "deleted";
|
|
462
462
|
user_id: string;
|
|
463
463
|
is_job: boolean;
|
|
464
464
|
title?: string | null | undefined;
|
|
@@ -479,7 +479,7 @@ export declare const MongoJobSchema: Schema<any, import("mongoose").Model<any, a
|
|
|
479
479
|
}, {
|
|
480
480
|
created_at: number;
|
|
481
481
|
updated_at: number;
|
|
482
|
-
status: "active" | "inactive";
|
|
482
|
+
status: "active" | "inactive" | "deleted";
|
|
483
483
|
user_id: string;
|
|
484
484
|
query: any;
|
|
485
485
|
job_name: string;
|
|
@@ -493,7 +493,7 @@ export declare const MongoJobSchema: Schema<any, import("mongoose").Model<any, a
|
|
|
493
493
|
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
494
494
|
created_at: number;
|
|
495
495
|
updated_at: number;
|
|
496
|
-
status: "active" | "inactive";
|
|
496
|
+
status: "active" | "inactive" | "deleted";
|
|
497
497
|
user_id: string;
|
|
498
498
|
query: any;
|
|
499
499
|
job_name: string;
|
|
@@ -507,7 +507,7 @@ export declare const MongoJobSchema: Schema<any, import("mongoose").Model<any, a
|
|
|
507
507
|
}>, {}> & import("mongoose").FlatRecord<{
|
|
508
508
|
created_at: number;
|
|
509
509
|
updated_at: number;
|
|
510
|
-
status: "active" | "inactive";
|
|
510
|
+
status: "active" | "inactive" | "deleted";
|
|
511
511
|
user_id: string;
|
|
512
512
|
query: any;
|
|
513
513
|
job_name: string;
|
|
@@ -605,19 +605,19 @@ export declare const MongoApiKeySchema: Schema<any, import("mongoose").Model<any
|
|
|
605
605
|
}, {
|
|
606
606
|
created_at: number;
|
|
607
607
|
updated_at: number;
|
|
608
|
-
status: "active" | "inactive";
|
|
608
|
+
status: "active" | "inactive" | "deleted";
|
|
609
609
|
user_id: string;
|
|
610
610
|
api_key: string;
|
|
611
611
|
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
612
612
|
created_at: number;
|
|
613
613
|
updated_at: number;
|
|
614
|
-
status: "active" | "inactive";
|
|
614
|
+
status: "active" | "inactive" | "deleted";
|
|
615
615
|
user_id: string;
|
|
616
616
|
api_key: string;
|
|
617
617
|
}>, {}> & import("mongoose").FlatRecord<{
|
|
618
618
|
created_at: number;
|
|
619
619
|
updated_at: number;
|
|
620
|
-
status: "active" | "inactive";
|
|
620
|
+
status: "active" | "inactive" | "deleted";
|
|
621
621
|
user_id: string;
|
|
622
622
|
api_key: string;
|
|
623
623
|
}> & {
|
package/dist/types.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export declare const platformEntityMap: {
|
|
|
9
9
|
readonly website: readonly ["website"];
|
|
10
10
|
};
|
|
11
11
|
export declare const zodSourceStatusList: readonly ["active", "pending", "inactive", "requested", "deleted"];
|
|
12
|
-
export declare const generalStatusList: readonly ["active", "inactive"];
|
|
12
|
+
export declare const generalStatusList: readonly ["active", "inactive", "deleted"];
|
|
13
13
|
export declare const zodRegionSchema: z.ZodObject<{
|
|
14
14
|
_id: z.ZodOptional<z.ZodString>;
|
|
15
15
|
name: z.ZodString;
|
|
@@ -17,6 +17,8 @@ export declare const zodRegionSchema: z.ZodObject<{
|
|
|
17
17
|
legend: z.ZodOptional<z.ZodString>;
|
|
18
18
|
created_at: z.ZodOptional<z.ZodNumber>;
|
|
19
19
|
updated_at: z.ZodOptional<z.ZodNumber>;
|
|
20
|
+
status: z.ZodOptional<z.ZodEnum<["active", "inactive", "deleted"]>>;
|
|
21
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
20
22
|
}, "strip", z.ZodTypeAny, {
|
|
21
23
|
name: string;
|
|
22
24
|
slug: string;
|
|
@@ -24,6 +26,8 @@ export declare const zodRegionSchema: z.ZodObject<{
|
|
|
24
26
|
legend?: string | undefined;
|
|
25
27
|
created_at?: number | undefined;
|
|
26
28
|
updated_at?: number | undefined;
|
|
29
|
+
status?: "active" | "inactive" | "deleted" | undefined;
|
|
30
|
+
notes?: string | undefined;
|
|
27
31
|
}, {
|
|
28
32
|
name: string;
|
|
29
33
|
slug: string;
|
|
@@ -31,6 +35,8 @@ export declare const zodRegionSchema: z.ZodObject<{
|
|
|
31
35
|
legend?: string | undefined;
|
|
32
36
|
created_at?: number | undefined;
|
|
33
37
|
updated_at?: number | undefined;
|
|
38
|
+
status?: "active" | "inactive" | "deleted" | undefined;
|
|
39
|
+
notes?: string | undefined;
|
|
34
40
|
}>;
|
|
35
41
|
export declare const zodSourceGroupSchema: z.ZodObject<{
|
|
36
42
|
_id: z.ZodOptional<z.ZodString>;
|
|
@@ -41,12 +47,16 @@ export declare const zodSourceGroupSchema: z.ZodObject<{
|
|
|
41
47
|
max_active_sources: z.ZodOptional<z.ZodNumber>;
|
|
42
48
|
created_at: z.ZodOptional<z.ZodNumber>;
|
|
43
49
|
updated_at: z.ZodOptional<z.ZodNumber>;
|
|
50
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
51
|
+
status: z.ZodOptional<z.ZodEnum<["active", "inactive", "deleted"]>>;
|
|
44
52
|
}, "strip", z.ZodTypeAny, {
|
|
45
53
|
name: string;
|
|
46
54
|
platform: "telegram" | "facebook" | "instagram" | "tiktok" | "website";
|
|
47
55
|
_id?: string | undefined;
|
|
48
56
|
created_at?: number | undefined;
|
|
49
57
|
updated_at?: number | undefined;
|
|
58
|
+
status?: "active" | "inactive" | "deleted" | undefined;
|
|
59
|
+
notes?: string | undefined;
|
|
50
60
|
description?: string | undefined;
|
|
51
61
|
region_id?: string | undefined;
|
|
52
62
|
max_active_sources?: number | undefined;
|
|
@@ -56,6 +66,8 @@ export declare const zodSourceGroupSchema: z.ZodObject<{
|
|
|
56
66
|
_id?: string | undefined;
|
|
57
67
|
created_at?: number | undefined;
|
|
58
68
|
updated_at?: number | undefined;
|
|
69
|
+
status?: "active" | "inactive" | "deleted" | undefined;
|
|
70
|
+
notes?: string | undefined;
|
|
59
71
|
description?: string | undefined;
|
|
60
72
|
region_id?: string | undefined;
|
|
61
73
|
max_active_sources?: number | undefined;
|
|
@@ -107,6 +119,7 @@ export declare const zodSourceSchema: z.ZodObject<{
|
|
|
107
119
|
_id?: string | undefined;
|
|
108
120
|
created_at?: number | undefined;
|
|
109
121
|
updated_at?: number | undefined;
|
|
122
|
+
notes?: string | undefined;
|
|
110
123
|
description?: string | undefined;
|
|
111
124
|
region_id?: string | undefined;
|
|
112
125
|
title?: string | undefined;
|
|
@@ -123,7 +136,6 @@ export declare const zodSourceSchema: z.ZodObject<{
|
|
|
123
136
|
email?: string | undefined;
|
|
124
137
|
requested_at?: number | undefined;
|
|
125
138
|
} | undefined;
|
|
126
|
-
notes?: string | undefined;
|
|
127
139
|
}, {
|
|
128
140
|
name: string;
|
|
129
141
|
status: "active" | "pending" | "inactive" | "requested" | "deleted";
|
|
@@ -132,6 +144,7 @@ export declare const zodSourceSchema: z.ZodObject<{
|
|
|
132
144
|
_id?: string | undefined;
|
|
133
145
|
created_at?: number | undefined;
|
|
134
146
|
updated_at?: number | undefined;
|
|
147
|
+
notes?: string | undefined;
|
|
135
148
|
description?: string | undefined;
|
|
136
149
|
region_id?: string | undefined;
|
|
137
150
|
title?: string | undefined;
|
|
@@ -149,7 +162,6 @@ export declare const zodSourceSchema: z.ZodObject<{
|
|
|
149
162
|
email?: string | undefined;
|
|
150
163
|
requested_at?: number | undefined;
|
|
151
164
|
} | undefined;
|
|
152
|
-
notes?: string | undefined;
|
|
153
165
|
}>;
|
|
154
166
|
export declare const zodGeoSchema: z.ZodObject<{
|
|
155
167
|
_id: z.ZodOptional<z.ZodString>;
|
|
@@ -319,5 +331,5 @@ export type TimeRangeTypeLiteral = 'relative' | 'absolute';
|
|
|
319
331
|
export type AddSourceToReviewType = Pick<SourceType, 'platform' | 'url' | 'description'> & Partial<Pick<SourceType, 'public_id'>>;
|
|
320
332
|
export type GeoType = z.infer<typeof zodGeoSchema>;
|
|
321
333
|
export type GeoSelectionType = z.infer<typeof zodGeoSelectionSchema>;
|
|
322
|
-
export type PlatformEntityType<T extends typeof platformsList[number]> = typeof platformEntityMap[T][number];
|
|
334
|
+
export type PlatformEntityType<T extends (typeof platformsList)[number]> = (typeof platformEntityMap)[T][number];
|
|
323
335
|
export declare const getAllowedEntitiesForPlatform: (platform: (typeof platformsList)[number]) => readonly ["channel", "group"] | readonly ["profile", "page", "group"] | readonly ["profile", "hashtag"] | readonly ["website"];
|
package/dist/types.js
CHANGED
|
@@ -9,7 +9,14 @@ exports.platformsList = [
|
|
|
9
9
|
'tiktok',
|
|
10
10
|
'website',
|
|
11
11
|
];
|
|
12
|
-
exports.entityTypesList = [
|
|
12
|
+
exports.entityTypesList = [
|
|
13
|
+
'profile',
|
|
14
|
+
'group',
|
|
15
|
+
'page',
|
|
16
|
+
'channel',
|
|
17
|
+
'hashtag',
|
|
18
|
+
'website',
|
|
19
|
+
];
|
|
13
20
|
// Platform-specific entity mappings
|
|
14
21
|
exports.platformEntityMap = {
|
|
15
22
|
telegram: ['channel', 'group'],
|
|
@@ -23,16 +30,18 @@ exports.zodSourceStatusList = [
|
|
|
23
30
|
'pending',
|
|
24
31
|
'inactive',
|
|
25
32
|
'requested',
|
|
26
|
-
'deleted' // sources that have been deleted
|
|
33
|
+
'deleted', // sources that have been deleted
|
|
27
34
|
];
|
|
28
|
-
exports.generalStatusList = ['active', 'inactive'];
|
|
35
|
+
exports.generalStatusList = ['active', 'inactive', 'deleted'];
|
|
29
36
|
exports.zodRegionSchema = zod_1.z.object({
|
|
30
37
|
_id: zod_1.z.string().optional(),
|
|
31
38
|
name: zod_1.z.string(),
|
|
32
39
|
slug: zod_1.z.string(),
|
|
33
40
|
legend: zod_1.z.string().optional(),
|
|
34
41
|
created_at: zod_1.z.number().optional(),
|
|
35
|
-
updated_at: zod_1.z.number().optional(),
|
|
42
|
+
updated_at: zod_1.z.number().optional(),
|
|
43
|
+
status: zod_1.z.enum(exports.generalStatusList).optional(),
|
|
44
|
+
notes: zod_1.z.string().optional(), // internal notes about the region
|
|
36
45
|
});
|
|
37
46
|
exports.zodSourceGroupSchema = zod_1.z.object({
|
|
38
47
|
_id: zod_1.z.string().optional(),
|
|
@@ -42,10 +51,11 @@ exports.zodSourceGroupSchema = zod_1.z.object({
|
|
|
42
51
|
region_id: zod_1.z.string().optional(),
|
|
43
52
|
max_active_sources: zod_1.z.number().optional(),
|
|
44
53
|
created_at: zod_1.z.number().optional(),
|
|
45
|
-
updated_at: zod_1.z.number().optional(),
|
|
54
|
+
updated_at: zod_1.z.number().optional(),
|
|
55
|
+
notes: zod_1.z.string().optional(),
|
|
56
|
+
status: zod_1.z.enum(exports.generalStatusList).optional(),
|
|
46
57
|
});
|
|
47
|
-
exports.zodSourceSchema = zod_1.z
|
|
48
|
-
.object({
|
|
58
|
+
exports.zodSourceSchema = zod_1.z.object({
|
|
49
59
|
_id: zod_1.z.string().optional(),
|
|
50
60
|
title: zod_1.z.string().optional(),
|
|
51
61
|
platform: zod_1.z.enum(exports.platformsList),
|
package/package.json
CHANGED
package/types.ts
CHANGED
|
@@ -8,7 +8,14 @@ export const platformsList = [
|
|
|
8
8
|
'website',
|
|
9
9
|
] as const;
|
|
10
10
|
|
|
11
|
-
export const entityTypesList = [
|
|
11
|
+
export const entityTypesList = [
|
|
12
|
+
'profile',
|
|
13
|
+
'group',
|
|
14
|
+
'page',
|
|
15
|
+
'channel',
|
|
16
|
+
'hashtag',
|
|
17
|
+
'website',
|
|
18
|
+
] as const;
|
|
12
19
|
|
|
13
20
|
// Platform-specific entity mappings
|
|
14
21
|
export const platformEntityMap = {
|
|
@@ -24,10 +31,10 @@ export const zodSourceStatusList = [
|
|
|
24
31
|
'pending', // sources that are pending approval
|
|
25
32
|
'inactive', // sources that are inactive
|
|
26
33
|
'requested', // sources that are under review
|
|
27
|
-
'deleted' // sources that have been deleted
|
|
34
|
+
'deleted', // sources that have been deleted
|
|
28
35
|
] as const;
|
|
29
36
|
|
|
30
|
-
export const generalStatusList = ['active', 'inactive'] as const;
|
|
37
|
+
export const generalStatusList = ['active', 'inactive', 'deleted'] as const;
|
|
31
38
|
|
|
32
39
|
export const zodRegionSchema = z.object({
|
|
33
40
|
_id: z.string().optional(),
|
|
@@ -36,6 +43,8 @@ export const zodRegionSchema = z.object({
|
|
|
36
43
|
legend: z.string().optional(), // e.g., legend for maps
|
|
37
44
|
created_at: z.number().optional(), // creation date
|
|
38
45
|
updated_at: z.number().optional(), // last update date
|
|
46
|
+
status: z.enum(generalStatusList).optional(),
|
|
47
|
+
notes: z.string().optional(), // internal notes about the region
|
|
39
48
|
});
|
|
40
49
|
|
|
41
50
|
export const zodSourceGroupSchema = z.object({
|
|
@@ -47,38 +56,39 @@ export const zodSourceGroupSchema = z.object({
|
|
|
47
56
|
max_active_sources: z.number().optional(), // e.g., maximum number of active sources allowed
|
|
48
57
|
created_at: z.number().optional(), // creation date
|
|
49
58
|
updated_at: z.number().optional(), // last update date
|
|
59
|
+
notes: z.string().optional(), // internal notes about the source group
|
|
60
|
+
status: z.enum(generalStatusList).optional(),
|
|
50
61
|
});
|
|
51
62
|
|
|
52
|
-
export const zodSourceSchema = z
|
|
53
|
-
.
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
.
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
})
|
|
63
|
+
export const zodSourceSchema = z.object({
|
|
64
|
+
_id: z.string().optional(),
|
|
65
|
+
title: z.string().optional(), // e.g., 'Telegram Channel Name'
|
|
66
|
+
platform: z.enum(platformsList), // e.g., 'telegram', 'facebook'
|
|
67
|
+
entity: z.enum(entityTypesList), // e.g., 'channel', 'group', 'page', 'profile', 'hashtag'
|
|
68
|
+
public_id: z.string().or(z.number()).optional(), // e.g., '@telegram_channel_id'
|
|
69
|
+
name: z.string(), // e.g., 'Telegram Channel Name'
|
|
70
|
+
url: z.string().url().optional(), // e.g., 'https://t.me/telegram_channel_name'
|
|
71
|
+
description: z.string().optional(), // e.g., 'A channel about news and updates'
|
|
72
|
+
language: z.string().optional(),
|
|
73
|
+
tags: z.array(z.string()).optional(),
|
|
74
|
+
status: z.enum(zodSourceStatusList), // INDEX
|
|
75
|
+
is_public: z.boolean().default(true), // true if the source is public
|
|
76
|
+
metadata: z.record(z.string(), z.any()).optional(), // flexible per platform
|
|
77
|
+
created_at: z.number().optional(),
|
|
78
|
+
updated_at: z.number().optional(),
|
|
79
|
+
region_id: z.string().optional(), // e.g., region ID
|
|
80
|
+
group_id: z.string().optional(), // e.g., source group ID
|
|
81
|
+
requested_by: z
|
|
82
|
+
.object({
|
|
83
|
+
user_id: z.string().optional(),
|
|
84
|
+
username: z.string().optional(),
|
|
85
|
+
full_name: z.string().optional(),
|
|
86
|
+
email: z.string().optional(),
|
|
87
|
+
requested_at: z.number().optional(),
|
|
88
|
+
})
|
|
89
|
+
.optional(), // user who requested this source
|
|
90
|
+
notes: z.string().optional(), // internal notes about the source
|
|
91
|
+
});
|
|
82
92
|
|
|
83
93
|
export const zodGeoSchema = z.object({
|
|
84
94
|
_id: z.string().optional(),
|
|
@@ -154,15 +164,19 @@ export type TimeRangeTypeLiteral = 'relative' | 'absolute';
|
|
|
154
164
|
export type AddSourceToReviewType = Pick<
|
|
155
165
|
SourceType,
|
|
156
166
|
'platform' | 'url' | 'description'
|
|
157
|
-
> &
|
|
167
|
+
> &
|
|
168
|
+
Partial<Pick<SourceType, 'public_id'>>;
|
|
158
169
|
|
|
159
170
|
export type GeoType = z.infer<typeof zodGeoSchema>;
|
|
160
171
|
export type GeoSelectionType = z.infer<typeof zodGeoSelectionSchema>;
|
|
161
172
|
|
|
162
173
|
// Helper type to get allowed entities for a specific platform
|
|
163
|
-
export type PlatformEntityType<T extends typeof platformsList[number]> =
|
|
174
|
+
export type PlatformEntityType<T extends (typeof platformsList)[number]> =
|
|
175
|
+
(typeof platformEntityMap)[T][number];
|
|
164
176
|
|
|
165
177
|
// Helper function to get allowed entities for a platform
|
|
166
|
-
export const getAllowedEntitiesForPlatform = (
|
|
178
|
+
export const getAllowedEntitiesForPlatform = (
|
|
179
|
+
platform: (typeof platformsList)[number]
|
|
180
|
+
) => {
|
|
167
181
|
return platformEntityMap[platform];
|
|
168
182
|
};
|