harvester_sdk 1.0.1
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/README.md +16 -0
- package/dist/index.d.ts +627 -0
- package/dist/index.js +269 -0
- package/dist/types.d.ts +375 -0
- package/dist/types.js +140 -0
- package/index.ts +306 -0
- package/package.json +33 -0
- package/tsconfig.json +14 -0
- package/types.ts +177 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.MongoApiKeySchema = exports.MongoGeoSelectionSchema = exports.MongoGeoSchema = exports.MongoJobSchema = exports.MongoConversationSchema = exports.MongoUserSettingsSchema = exports.MongoQuerySchema = exports.MongoSourceSchema = exports.MongoSourceGroupSchema = exports.MongoRegionSchema = exports.MongoInstructionsSchema = exports.MongoDataSchema = void 0;
|
|
18
|
+
// Export types for consumers
|
|
19
|
+
__exportStar(require("./types"), exports);
|
|
20
|
+
const mongoose_1 = require("mongoose");
|
|
21
|
+
const types_1 = require("./types");
|
|
22
|
+
exports.MongoDataSchema = new mongoose_1.Schema({
|
|
23
|
+
source_id: { type: mongoose_1.Schema.Types.Mixed, required: true },
|
|
24
|
+
source_public_id: { type: mongoose_1.Schema.Types.Mixed },
|
|
25
|
+
source_name: { type: String, required: true },
|
|
26
|
+
platform_id: { type: mongoose_1.Schema.Types.Mixed },
|
|
27
|
+
platform: {
|
|
28
|
+
type: String,
|
|
29
|
+
enum: types_1.platformsList,
|
|
30
|
+
required: true,
|
|
31
|
+
},
|
|
32
|
+
original_text_id: { type: mongoose_1.Schema.Types.Mixed },
|
|
33
|
+
original_text: { type: String },
|
|
34
|
+
translated_text: { type: String },
|
|
35
|
+
timestamp: { type: Number, required: true },
|
|
36
|
+
language: { type: String },
|
|
37
|
+
text_geo: { type: [String], default: [] },
|
|
38
|
+
source_geo: { type: String },
|
|
39
|
+
is_reply: { type: Boolean },
|
|
40
|
+
reply_to_message_id: { type: mongoose_1.Schema.Types.Mixed },
|
|
41
|
+
metadata: { type: Object },
|
|
42
|
+
created_at: { type: Number, default: Date.now },
|
|
43
|
+
updated_at: { type: Number, default: Date.now },
|
|
44
|
+
media: {
|
|
45
|
+
type: [
|
|
46
|
+
{
|
|
47
|
+
type: { type: String, enum: ['image', 'video', 'audio', 'link'] },
|
|
48
|
+
url: { type: String },
|
|
49
|
+
caption: { type: String },
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
},
|
|
53
|
+
author: { type: String },
|
|
54
|
+
replies: { type: mongoose_1.Schema.Types.Mixed },
|
|
55
|
+
entities: { type: mongoose_1.Schema.Types.Mixed },
|
|
56
|
+
author_username: { type: String },
|
|
57
|
+
author_id: { type: String },
|
|
58
|
+
pipeline_name: { type: String },
|
|
59
|
+
source_region: { type: String }, // e.g., "New York", "California"
|
|
60
|
+
}, {
|
|
61
|
+
versionKey: false,
|
|
62
|
+
toJSON: { virtuals: true },
|
|
63
|
+
toObject: { virtuals: true },
|
|
64
|
+
});
|
|
65
|
+
exports.MongoInstructionsSchema = new mongoose_1.Schema({
|
|
66
|
+
user_id: { type: String, required: true },
|
|
67
|
+
prompt: { type: String },
|
|
68
|
+
created_at: { type: Number, default: Date.now },
|
|
69
|
+
updated_at: { type: Number, default: Date.now },
|
|
70
|
+
}, {
|
|
71
|
+
versionKey: false,
|
|
72
|
+
toJSON: { virtuals: true },
|
|
73
|
+
toObject: { virtuals: true },
|
|
74
|
+
});
|
|
75
|
+
exports.MongoRegionSchema = new mongoose_1.Schema({
|
|
76
|
+
name: { type: String, required: true },
|
|
77
|
+
slug: { type: String, required: true },
|
|
78
|
+
legend: { type: String },
|
|
79
|
+
created_at: { type: Number, default: Date.now },
|
|
80
|
+
updated_at: { type: Number, default: Date.now }, // last update date
|
|
81
|
+
}, {
|
|
82
|
+
versionKey: false,
|
|
83
|
+
toJSON: { virtuals: true },
|
|
84
|
+
toObject: { virtuals: true },
|
|
85
|
+
});
|
|
86
|
+
exports.MongoSourceGroupSchema = new mongoose_1.Schema({
|
|
87
|
+
name: { type: String, required: true },
|
|
88
|
+
description: { type: String },
|
|
89
|
+
platform: {
|
|
90
|
+
type: String,
|
|
91
|
+
enum: types_1.platformsList,
|
|
92
|
+
required: true,
|
|
93
|
+
},
|
|
94
|
+
region_id: { type: String },
|
|
95
|
+
max_active_sources: { type: Number },
|
|
96
|
+
created_at: { type: Number, default: Date.now },
|
|
97
|
+
updated_at: { type: Number, default: Date.now }, // last update date
|
|
98
|
+
}, {
|
|
99
|
+
versionKey: false,
|
|
100
|
+
toJSON: { virtuals: true },
|
|
101
|
+
toObject: { virtuals: true },
|
|
102
|
+
});
|
|
103
|
+
exports.MongoSourceSchema = new mongoose_1.Schema({
|
|
104
|
+
title: { type: String },
|
|
105
|
+
platform: {
|
|
106
|
+
type: String,
|
|
107
|
+
enum: types_1.platformsList,
|
|
108
|
+
required: true,
|
|
109
|
+
},
|
|
110
|
+
entity: {
|
|
111
|
+
type: String,
|
|
112
|
+
enum: types_1.entityTypesList,
|
|
113
|
+
required: true,
|
|
114
|
+
},
|
|
115
|
+
public_id: { type: mongoose_1.Schema.Types.Mixed },
|
|
116
|
+
name: { type: String, required: true },
|
|
117
|
+
url: { type: String },
|
|
118
|
+
description: { type: String },
|
|
119
|
+
language: { type: String },
|
|
120
|
+
tags: { type: [String], default: [] },
|
|
121
|
+
status: {
|
|
122
|
+
type: String,
|
|
123
|
+
enum: types_1.zodSourceStatusList,
|
|
124
|
+
default: 'pending',
|
|
125
|
+
},
|
|
126
|
+
is_public: { type: Boolean, default: true },
|
|
127
|
+
metadata: { type: Object, default: {} },
|
|
128
|
+
created_at: { type: Number, default: Date.now },
|
|
129
|
+
updated_at: { type: Number, default: Date.now },
|
|
130
|
+
region_id: { type: String },
|
|
131
|
+
group_id: { type: String },
|
|
132
|
+
requested_by: {
|
|
133
|
+
type: {
|
|
134
|
+
user_id: { type: String },
|
|
135
|
+
username: { type: String },
|
|
136
|
+
full_name: { type: String },
|
|
137
|
+
email: { type: String },
|
|
138
|
+
requested_at: { type: Number },
|
|
139
|
+
},
|
|
140
|
+
default: undefined,
|
|
141
|
+
},
|
|
142
|
+
notes: { type: String }, // internal notes about the source
|
|
143
|
+
}, {
|
|
144
|
+
versionKey: false,
|
|
145
|
+
toJSON: { virtuals: true },
|
|
146
|
+
toObject: { virtuals: true },
|
|
147
|
+
});
|
|
148
|
+
exports.MongoQuerySchema = new mongoose_1.Schema({
|
|
149
|
+
title: { type: String },
|
|
150
|
+
query: { type: String },
|
|
151
|
+
sources: { type: [String] },
|
|
152
|
+
geos: { type: [String], required: true },
|
|
153
|
+
geos_ids: { type: [String], required: true },
|
|
154
|
+
time_range: {
|
|
155
|
+
type: mongoose_1.Schema.Types.Mixed,
|
|
156
|
+
required: true,
|
|
157
|
+
},
|
|
158
|
+
user_id: { type: String, required: true },
|
|
159
|
+
user_instructions: { type: String },
|
|
160
|
+
user_time_zone: { type: String },
|
|
161
|
+
timestamp: { type: Number, default: Date.now }, // creation date
|
|
162
|
+
}, {
|
|
163
|
+
versionKey: false,
|
|
164
|
+
toJSON: { virtuals: true },
|
|
165
|
+
toObject: { virtuals: true },
|
|
166
|
+
});
|
|
167
|
+
exports.MongoUserSettingsSchema = new mongoose_1.Schema({
|
|
168
|
+
sources: { type: [String] },
|
|
169
|
+
geos: { type: [String], default: [] },
|
|
170
|
+
time_range: {
|
|
171
|
+
type: mongoose_1.Schema.Types.Mixed,
|
|
172
|
+
},
|
|
173
|
+
user_id: { type: String, required: true },
|
|
174
|
+
thread_id: { type: String },
|
|
175
|
+
instructions: { type: String },
|
|
176
|
+
has_jobs_access: { type: Boolean, default: false },
|
|
177
|
+
active_jobs_limit: { type: Number, default: 5 },
|
|
178
|
+
created_at: { type: Date, default: Date.now },
|
|
179
|
+
updated_at: { type: Date, default: Date.now },
|
|
180
|
+
status: {
|
|
181
|
+
type: String,
|
|
182
|
+
enum: types_1.generalStatusList,
|
|
183
|
+
default: 'active',
|
|
184
|
+
}, // status of the user
|
|
185
|
+
}, {
|
|
186
|
+
versionKey: false,
|
|
187
|
+
toJSON: { virtuals: true },
|
|
188
|
+
toObject: { virtuals: true },
|
|
189
|
+
});
|
|
190
|
+
exports.MongoConversationSchema = new mongoose_1.Schema({
|
|
191
|
+
user_id: { type: String, required: true },
|
|
192
|
+
title: { type: String },
|
|
193
|
+
thread_id: { type: String },
|
|
194
|
+
status: {
|
|
195
|
+
type: String,
|
|
196
|
+
enum: types_1.generalStatusList,
|
|
197
|
+
default: 'active',
|
|
198
|
+
},
|
|
199
|
+
created_at: { type: Date, default: Date.now },
|
|
200
|
+
updated_at: { type: Date, default: Date.now },
|
|
201
|
+
is_job: { type: Boolean, default: false }, // true if this is a job conversation
|
|
202
|
+
}, {
|
|
203
|
+
versionKey: false,
|
|
204
|
+
toJSON: { virtuals: true },
|
|
205
|
+
toObject: { virtuals: true },
|
|
206
|
+
});
|
|
207
|
+
exports.MongoJobSchema = new mongoose_1.Schema({
|
|
208
|
+
user_id: { type: String, required: true },
|
|
209
|
+
job_name: { type: String, required: true },
|
|
210
|
+
job_description: { type: String },
|
|
211
|
+
status: {
|
|
212
|
+
type: String,
|
|
213
|
+
enum: types_1.generalStatusList,
|
|
214
|
+
default: 'active',
|
|
215
|
+
},
|
|
216
|
+
created_at: { type: Number, default: Date.now },
|
|
217
|
+
updated_at: { type: Number, default: Date.now },
|
|
218
|
+
schedule: { type: String },
|
|
219
|
+
schedule_text: { type: String },
|
|
220
|
+
active_until: { type: Number || undefined },
|
|
221
|
+
query: { type: mongoose_1.Schema.Types.Mixed, required: true },
|
|
222
|
+
conversation_id: { type: String },
|
|
223
|
+
thread_id: { type: String },
|
|
224
|
+
time_zone: { type: String }, // optional timezone for the job
|
|
225
|
+
}, {
|
|
226
|
+
versionKey: false,
|
|
227
|
+
toJSON: { virtuals: true },
|
|
228
|
+
toObject: { virtuals: true },
|
|
229
|
+
});
|
|
230
|
+
exports.MongoGeoSchema = new mongoose_1.Schema({
|
|
231
|
+
geo_text: { type: String },
|
|
232
|
+
timestamp: { type: Number },
|
|
233
|
+
count: { type: Number },
|
|
234
|
+
region: { type: String },
|
|
235
|
+
subscribers: { type: [String], default: [] },
|
|
236
|
+
is_used: { type: Boolean, default: false }, // true if this geo is used in any source
|
|
237
|
+
}, {
|
|
238
|
+
versionKey: false,
|
|
239
|
+
toJSON: { virtuals: true },
|
|
240
|
+
toObject: { virtuals: true },
|
|
241
|
+
});
|
|
242
|
+
exports.MongoGeoSelectionSchema = new mongoose_1.Schema({
|
|
243
|
+
title: { type: String },
|
|
244
|
+
description: { type: String },
|
|
245
|
+
type: { type: String },
|
|
246
|
+
geos: { type: [String], default: [] },
|
|
247
|
+
region: { type: String },
|
|
248
|
+
created_at: { type: Number },
|
|
249
|
+
updated_at: { type: Number }, // last update date
|
|
250
|
+
}, {
|
|
251
|
+
versionKey: false,
|
|
252
|
+
toJSON: { virtuals: true },
|
|
253
|
+
toObject: { virtuals: true },
|
|
254
|
+
});
|
|
255
|
+
exports.MongoApiKeySchema = new mongoose_1.Schema({
|
|
256
|
+
user_id: { type: String, required: true },
|
|
257
|
+
api_key: { type: String, required: true },
|
|
258
|
+
created_at: { type: Number, default: Date.now },
|
|
259
|
+
updated_at: { type: Number, default: Date.now },
|
|
260
|
+
status: {
|
|
261
|
+
type: String,
|
|
262
|
+
enum: types_1.generalStatusList,
|
|
263
|
+
default: 'active',
|
|
264
|
+
}, // status of the API key
|
|
265
|
+
}, {
|
|
266
|
+
versionKey: false,
|
|
267
|
+
toJSON: { virtuals: true },
|
|
268
|
+
toObject: { virtuals: true },
|
|
269
|
+
});
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const platformsList: readonly ["telegram", "facebook", "instagram", "tiktok", "website"];
|
|
3
|
+
export declare const entityTypesList: readonly ["profile", "group", "page", "channel", "hashtag", "website"];
|
|
4
|
+
export declare const platformEntityMap: {
|
|
5
|
+
readonly telegram: readonly ["channel", "group"];
|
|
6
|
+
readonly facebook: readonly ["profile", "page", "group"];
|
|
7
|
+
readonly instagram: readonly ["profile", "hashtag"];
|
|
8
|
+
readonly tiktok: readonly ["profile", "hashtag"];
|
|
9
|
+
readonly website: readonly ["website"];
|
|
10
|
+
};
|
|
11
|
+
export declare const zodSourceStatusList: readonly ["active", "pending", "inactive", "requested"];
|
|
12
|
+
export declare const generalStatusList: readonly ["active", "inactive"];
|
|
13
|
+
export declare const zodRegionSchema: z.ZodObject<{
|
|
14
|
+
_id: z.ZodOptional<z.ZodString>;
|
|
15
|
+
name: z.ZodString;
|
|
16
|
+
slug: z.ZodString;
|
|
17
|
+
legend: z.ZodOptional<z.ZodString>;
|
|
18
|
+
created_at: z.ZodOptional<z.ZodNumber>;
|
|
19
|
+
updated_at: z.ZodOptional<z.ZodNumber>;
|
|
20
|
+
}, "strip", z.ZodTypeAny, {
|
|
21
|
+
name: string;
|
|
22
|
+
slug: string;
|
|
23
|
+
_id?: string | undefined;
|
|
24
|
+
legend?: string | undefined;
|
|
25
|
+
created_at?: number | undefined;
|
|
26
|
+
updated_at?: number | undefined;
|
|
27
|
+
}, {
|
|
28
|
+
name: string;
|
|
29
|
+
slug: string;
|
|
30
|
+
_id?: string | undefined;
|
|
31
|
+
legend?: string | undefined;
|
|
32
|
+
created_at?: number | undefined;
|
|
33
|
+
updated_at?: number | undefined;
|
|
34
|
+
}>;
|
|
35
|
+
export declare const zodSourceGroupSchema: z.ZodObject<{
|
|
36
|
+
_id: z.ZodOptional<z.ZodString>;
|
|
37
|
+
name: z.ZodString;
|
|
38
|
+
description: z.ZodOptional<z.ZodString>;
|
|
39
|
+
platform: z.ZodEnum<["telegram", "facebook", "instagram", "tiktok", "website"]>;
|
|
40
|
+
region_id: z.ZodOptional<z.ZodString>;
|
|
41
|
+
max_active_sources: z.ZodOptional<z.ZodNumber>;
|
|
42
|
+
created_at: z.ZodOptional<z.ZodNumber>;
|
|
43
|
+
updated_at: z.ZodOptional<z.ZodNumber>;
|
|
44
|
+
}, "strip", z.ZodTypeAny, {
|
|
45
|
+
name: string;
|
|
46
|
+
platform: "telegram" | "facebook" | "instagram" | "tiktok" | "website";
|
|
47
|
+
_id?: string | undefined;
|
|
48
|
+
created_at?: number | undefined;
|
|
49
|
+
updated_at?: number | undefined;
|
|
50
|
+
description?: string | undefined;
|
|
51
|
+
region_id?: string | undefined;
|
|
52
|
+
max_active_sources?: number | undefined;
|
|
53
|
+
}, {
|
|
54
|
+
name: string;
|
|
55
|
+
platform: "telegram" | "facebook" | "instagram" | "tiktok" | "website";
|
|
56
|
+
_id?: string | undefined;
|
|
57
|
+
created_at?: number | undefined;
|
|
58
|
+
updated_at?: number | undefined;
|
|
59
|
+
description?: string | undefined;
|
|
60
|
+
region_id?: string | undefined;
|
|
61
|
+
max_active_sources?: number | undefined;
|
|
62
|
+
}>;
|
|
63
|
+
export declare const zodSourceSchema: z.ZodEffects<z.ZodObject<{
|
|
64
|
+
_id: z.ZodOptional<z.ZodString>;
|
|
65
|
+
title: z.ZodOptional<z.ZodString>;
|
|
66
|
+
platform: z.ZodEnum<["telegram", "facebook", "instagram", "tiktok", "website"]>;
|
|
67
|
+
entity: z.ZodEnum<["profile", "group", "page", "channel", "hashtag", "website"]>;
|
|
68
|
+
public_id: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
69
|
+
name: z.ZodString;
|
|
70
|
+
url: z.ZodOptional<z.ZodString>;
|
|
71
|
+
description: z.ZodOptional<z.ZodString>;
|
|
72
|
+
language: z.ZodOptional<z.ZodString>;
|
|
73
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
74
|
+
status: z.ZodEnum<["active", "pending", "inactive", "requested"]>;
|
|
75
|
+
is_public: z.ZodDefault<z.ZodBoolean>;
|
|
76
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
77
|
+
created_at: z.ZodOptional<z.ZodNumber>;
|
|
78
|
+
updated_at: z.ZodOptional<z.ZodNumber>;
|
|
79
|
+
region_id: z.ZodOptional<z.ZodString>;
|
|
80
|
+
group_id: z.ZodOptional<z.ZodString>;
|
|
81
|
+
requested_by: z.ZodOptional<z.ZodObject<{
|
|
82
|
+
user_id: z.ZodOptional<z.ZodString>;
|
|
83
|
+
username: z.ZodOptional<z.ZodString>;
|
|
84
|
+
full_name: z.ZodOptional<z.ZodString>;
|
|
85
|
+
email: z.ZodOptional<z.ZodString>;
|
|
86
|
+
requested_at: z.ZodOptional<z.ZodNumber>;
|
|
87
|
+
}, "strip", z.ZodTypeAny, {
|
|
88
|
+
user_id?: string | undefined;
|
|
89
|
+
username?: string | undefined;
|
|
90
|
+
full_name?: string | undefined;
|
|
91
|
+
email?: string | undefined;
|
|
92
|
+
requested_at?: number | undefined;
|
|
93
|
+
}, {
|
|
94
|
+
user_id?: string | undefined;
|
|
95
|
+
username?: string | undefined;
|
|
96
|
+
full_name?: string | undefined;
|
|
97
|
+
email?: string | undefined;
|
|
98
|
+
requested_at?: number | undefined;
|
|
99
|
+
}>>;
|
|
100
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
101
|
+
}, "strip", z.ZodTypeAny, {
|
|
102
|
+
name: string;
|
|
103
|
+
status: "active" | "pending" | "inactive" | "requested";
|
|
104
|
+
platform: "telegram" | "facebook" | "instagram" | "tiktok" | "website";
|
|
105
|
+
entity: "website" | "profile" | "group" | "page" | "channel" | "hashtag";
|
|
106
|
+
is_public: boolean;
|
|
107
|
+
_id?: string | undefined;
|
|
108
|
+
created_at?: number | undefined;
|
|
109
|
+
updated_at?: number | undefined;
|
|
110
|
+
description?: string | undefined;
|
|
111
|
+
region_id?: string | undefined;
|
|
112
|
+
title?: string | undefined;
|
|
113
|
+
public_id?: string | number | undefined;
|
|
114
|
+
url?: string | undefined;
|
|
115
|
+
language?: string | undefined;
|
|
116
|
+
tags?: string[] | undefined;
|
|
117
|
+
metadata?: Record<string, any> | undefined;
|
|
118
|
+
group_id?: string | undefined;
|
|
119
|
+
requested_by?: {
|
|
120
|
+
user_id?: string | undefined;
|
|
121
|
+
username?: string | undefined;
|
|
122
|
+
full_name?: string | undefined;
|
|
123
|
+
email?: string | undefined;
|
|
124
|
+
requested_at?: number | undefined;
|
|
125
|
+
} | undefined;
|
|
126
|
+
notes?: string | undefined;
|
|
127
|
+
}, {
|
|
128
|
+
name: string;
|
|
129
|
+
status: "active" | "pending" | "inactive" | "requested";
|
|
130
|
+
platform: "telegram" | "facebook" | "instagram" | "tiktok" | "website";
|
|
131
|
+
entity: "website" | "profile" | "group" | "page" | "channel" | "hashtag";
|
|
132
|
+
_id?: string | undefined;
|
|
133
|
+
created_at?: number | undefined;
|
|
134
|
+
updated_at?: number | undefined;
|
|
135
|
+
description?: string | undefined;
|
|
136
|
+
region_id?: string | undefined;
|
|
137
|
+
title?: string | undefined;
|
|
138
|
+
public_id?: string | number | undefined;
|
|
139
|
+
url?: string | undefined;
|
|
140
|
+
language?: string | undefined;
|
|
141
|
+
tags?: string[] | undefined;
|
|
142
|
+
is_public?: boolean | undefined;
|
|
143
|
+
metadata?: Record<string, any> | undefined;
|
|
144
|
+
group_id?: string | undefined;
|
|
145
|
+
requested_by?: {
|
|
146
|
+
user_id?: string | undefined;
|
|
147
|
+
username?: string | undefined;
|
|
148
|
+
full_name?: string | undefined;
|
|
149
|
+
email?: string | undefined;
|
|
150
|
+
requested_at?: number | undefined;
|
|
151
|
+
} | undefined;
|
|
152
|
+
notes?: string | undefined;
|
|
153
|
+
}>, {
|
|
154
|
+
name: string;
|
|
155
|
+
status: "active" | "pending" | "inactive" | "requested";
|
|
156
|
+
platform: "telegram" | "facebook" | "instagram" | "tiktok" | "website";
|
|
157
|
+
entity: "website" | "profile" | "group" | "page" | "channel" | "hashtag";
|
|
158
|
+
is_public: boolean;
|
|
159
|
+
_id?: string | undefined;
|
|
160
|
+
created_at?: number | undefined;
|
|
161
|
+
updated_at?: number | undefined;
|
|
162
|
+
description?: string | undefined;
|
|
163
|
+
region_id?: string | undefined;
|
|
164
|
+
title?: string | undefined;
|
|
165
|
+
public_id?: string | number | undefined;
|
|
166
|
+
url?: string | undefined;
|
|
167
|
+
language?: string | undefined;
|
|
168
|
+
tags?: string[] | undefined;
|
|
169
|
+
metadata?: Record<string, any> | undefined;
|
|
170
|
+
group_id?: string | undefined;
|
|
171
|
+
requested_by?: {
|
|
172
|
+
user_id?: string | undefined;
|
|
173
|
+
username?: string | undefined;
|
|
174
|
+
full_name?: string | undefined;
|
|
175
|
+
email?: string | undefined;
|
|
176
|
+
requested_at?: number | undefined;
|
|
177
|
+
} | undefined;
|
|
178
|
+
notes?: string | undefined;
|
|
179
|
+
}, {
|
|
180
|
+
name: string;
|
|
181
|
+
status: "active" | "pending" | "inactive" | "requested";
|
|
182
|
+
platform: "telegram" | "facebook" | "instagram" | "tiktok" | "website";
|
|
183
|
+
entity: "website" | "profile" | "group" | "page" | "channel" | "hashtag";
|
|
184
|
+
_id?: string | undefined;
|
|
185
|
+
created_at?: number | undefined;
|
|
186
|
+
updated_at?: number | undefined;
|
|
187
|
+
description?: string | undefined;
|
|
188
|
+
region_id?: string | undefined;
|
|
189
|
+
title?: string | undefined;
|
|
190
|
+
public_id?: string | number | undefined;
|
|
191
|
+
url?: string | undefined;
|
|
192
|
+
language?: string | undefined;
|
|
193
|
+
tags?: string[] | undefined;
|
|
194
|
+
is_public?: boolean | undefined;
|
|
195
|
+
metadata?: Record<string, any> | undefined;
|
|
196
|
+
group_id?: string | undefined;
|
|
197
|
+
requested_by?: {
|
|
198
|
+
user_id?: string | undefined;
|
|
199
|
+
username?: string | undefined;
|
|
200
|
+
full_name?: string | undefined;
|
|
201
|
+
email?: string | undefined;
|
|
202
|
+
requested_at?: number | undefined;
|
|
203
|
+
} | undefined;
|
|
204
|
+
notes?: string | undefined;
|
|
205
|
+
}>;
|
|
206
|
+
export declare const zodGeoSchema: z.ZodObject<{
|
|
207
|
+
_id: z.ZodOptional<z.ZodString>;
|
|
208
|
+
geo_text: z.ZodOptional<z.ZodString>;
|
|
209
|
+
timestamp: z.ZodOptional<z.ZodNumber>;
|
|
210
|
+
count: z.ZodOptional<z.ZodNumber>;
|
|
211
|
+
region: z.ZodOptional<z.ZodString>;
|
|
212
|
+
subscribers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
213
|
+
is_used: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
214
|
+
}, "strip", z.ZodTypeAny, {
|
|
215
|
+
is_used: boolean;
|
|
216
|
+
_id?: string | undefined;
|
|
217
|
+
geo_text?: string | undefined;
|
|
218
|
+
timestamp?: number | undefined;
|
|
219
|
+
count?: number | undefined;
|
|
220
|
+
region?: string | undefined;
|
|
221
|
+
subscribers?: string[] | undefined;
|
|
222
|
+
}, {
|
|
223
|
+
_id?: string | undefined;
|
|
224
|
+
geo_text?: string | undefined;
|
|
225
|
+
timestamp?: number | undefined;
|
|
226
|
+
count?: number | undefined;
|
|
227
|
+
region?: string | undefined;
|
|
228
|
+
subscribers?: string[] | undefined;
|
|
229
|
+
is_used?: boolean | undefined;
|
|
230
|
+
}>;
|
|
231
|
+
export declare const zodGeoSelectionSchema: z.ZodObject<{
|
|
232
|
+
_id: z.ZodOptional<z.ZodString>;
|
|
233
|
+
title: z.ZodOptional<z.ZodString>;
|
|
234
|
+
description: z.ZodOptional<z.ZodString>;
|
|
235
|
+
type: z.ZodOptional<z.ZodString>;
|
|
236
|
+
geos: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
237
|
+
region: z.ZodOptional<z.ZodString>;
|
|
238
|
+
created_at: z.ZodOptional<z.ZodNumber>;
|
|
239
|
+
updated_at: z.ZodOptional<z.ZodNumber>;
|
|
240
|
+
}, "strip", z.ZodTypeAny, {
|
|
241
|
+
_id?: string | undefined;
|
|
242
|
+
created_at?: number | undefined;
|
|
243
|
+
updated_at?: number | undefined;
|
|
244
|
+
type?: string | undefined;
|
|
245
|
+
description?: string | undefined;
|
|
246
|
+
title?: string | undefined;
|
|
247
|
+
region?: string | undefined;
|
|
248
|
+
geos?: string[] | undefined;
|
|
249
|
+
}, {
|
|
250
|
+
_id?: string | undefined;
|
|
251
|
+
created_at?: number | undefined;
|
|
252
|
+
updated_at?: number | undefined;
|
|
253
|
+
type?: string | undefined;
|
|
254
|
+
description?: string | undefined;
|
|
255
|
+
title?: string | undefined;
|
|
256
|
+
region?: string | undefined;
|
|
257
|
+
geos?: string[] | undefined;
|
|
258
|
+
}>;
|
|
259
|
+
export declare const zodDataSchema: z.ZodObject<{
|
|
260
|
+
text_geo: z.ZodArray<z.ZodString, "many">;
|
|
261
|
+
timestamp: z.ZodNumber;
|
|
262
|
+
platform: z.ZodEnum<["telegram", "facebook", "instagram", "tiktok", "website"]>;
|
|
263
|
+
source_region: z.ZodOptional<z.ZodString>;
|
|
264
|
+
_id: z.ZodOptional<z.ZodString>;
|
|
265
|
+
source_id: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
266
|
+
source_public_id: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
267
|
+
source_name: z.ZodString;
|
|
268
|
+
platform_id: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
269
|
+
original_text_id: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
270
|
+
original_text: z.ZodOptional<z.ZodString>;
|
|
271
|
+
translated_text: z.ZodOptional<z.ZodString>;
|
|
272
|
+
language: z.ZodOptional<z.ZodString>;
|
|
273
|
+
is_reply: z.ZodOptional<z.ZodBoolean>;
|
|
274
|
+
reply_to_message_id: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
275
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
276
|
+
created_at: z.ZodNumber;
|
|
277
|
+
updated_at: z.ZodNumber;
|
|
278
|
+
media: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
279
|
+
type: z.ZodEnum<["image", "video", "audio", "link"]>;
|
|
280
|
+
url: z.ZodString;
|
|
281
|
+
caption: z.ZodOptional<z.ZodString>;
|
|
282
|
+
}, "strip", z.ZodTypeAny, {
|
|
283
|
+
type: "image" | "video" | "audio" | "link";
|
|
284
|
+
url: string;
|
|
285
|
+
caption?: string | undefined;
|
|
286
|
+
}, {
|
|
287
|
+
type: "image" | "video" | "audio" | "link";
|
|
288
|
+
url: string;
|
|
289
|
+
caption?: string | undefined;
|
|
290
|
+
}>, "many">>;
|
|
291
|
+
author: z.ZodOptional<z.ZodString>;
|
|
292
|
+
replies: z.ZodOptional<z.ZodAny>;
|
|
293
|
+
entities: z.ZodOptional<z.ZodAny>;
|
|
294
|
+
author_username: z.ZodOptional<z.ZodString>;
|
|
295
|
+
author_id: z.ZodOptional<z.ZodString>;
|
|
296
|
+
group_id: z.ZodOptional<z.ZodString>;
|
|
297
|
+
}, "strip", z.ZodTypeAny, {
|
|
298
|
+
created_at: number;
|
|
299
|
+
updated_at: number;
|
|
300
|
+
platform: "telegram" | "facebook" | "instagram" | "tiktok" | "website";
|
|
301
|
+
timestamp: number;
|
|
302
|
+
text_geo: string[];
|
|
303
|
+
source_id: string | number;
|
|
304
|
+
source_public_id: string | number;
|
|
305
|
+
source_name: string;
|
|
306
|
+
platform_id: string | number;
|
|
307
|
+
original_text_id: string | number;
|
|
308
|
+
_id?: string | undefined;
|
|
309
|
+
language?: string | undefined;
|
|
310
|
+
metadata?: Record<string, any> | undefined;
|
|
311
|
+
group_id?: string | undefined;
|
|
312
|
+
source_region?: string | undefined;
|
|
313
|
+
original_text?: string | undefined;
|
|
314
|
+
translated_text?: string | undefined;
|
|
315
|
+
is_reply?: boolean | undefined;
|
|
316
|
+
reply_to_message_id?: string | number | undefined;
|
|
317
|
+
media?: {
|
|
318
|
+
type: "image" | "video" | "audio" | "link";
|
|
319
|
+
url: string;
|
|
320
|
+
caption?: string | undefined;
|
|
321
|
+
}[] | undefined;
|
|
322
|
+
author?: string | undefined;
|
|
323
|
+
replies?: any;
|
|
324
|
+
entities?: any;
|
|
325
|
+
author_username?: string | undefined;
|
|
326
|
+
author_id?: string | undefined;
|
|
327
|
+
}, {
|
|
328
|
+
created_at: number;
|
|
329
|
+
updated_at: number;
|
|
330
|
+
platform: "telegram" | "facebook" | "instagram" | "tiktok" | "website";
|
|
331
|
+
timestamp: number;
|
|
332
|
+
text_geo: string[];
|
|
333
|
+
source_id: string | number;
|
|
334
|
+
source_public_id: string | number;
|
|
335
|
+
source_name: string;
|
|
336
|
+
platform_id: string | number;
|
|
337
|
+
original_text_id: string | number;
|
|
338
|
+
_id?: string | undefined;
|
|
339
|
+
language?: string | undefined;
|
|
340
|
+
metadata?: Record<string, any> | undefined;
|
|
341
|
+
group_id?: string | undefined;
|
|
342
|
+
source_region?: string | undefined;
|
|
343
|
+
original_text?: string | undefined;
|
|
344
|
+
translated_text?: string | undefined;
|
|
345
|
+
is_reply?: boolean | undefined;
|
|
346
|
+
reply_to_message_id?: string | number | undefined;
|
|
347
|
+
media?: {
|
|
348
|
+
type: "image" | "video" | "audio" | "link";
|
|
349
|
+
url: string;
|
|
350
|
+
caption?: string | undefined;
|
|
351
|
+
}[] | undefined;
|
|
352
|
+
author?: string | undefined;
|
|
353
|
+
replies?: any;
|
|
354
|
+
entities?: any;
|
|
355
|
+
author_username?: string | undefined;
|
|
356
|
+
author_id?: string | undefined;
|
|
357
|
+
}>;
|
|
358
|
+
/**
|
|
359
|
+
* 'approved' - active and approved sources,
|
|
360
|
+
* 'back_to_business' - sources that were paused and now resumed,
|
|
361
|
+
* 'pending' - sources that are pending approval,
|
|
362
|
+
* 'inactive' - sources that are inactive,
|
|
363
|
+
* 'in_review' - sources that are under review
|
|
364
|
+
*/
|
|
365
|
+
export type RegionType = z.infer<typeof zodRegionSchema>;
|
|
366
|
+
export type SourceGroupType = z.infer<typeof zodSourceGroupSchema>;
|
|
367
|
+
export type SourceType = z.infer<typeof zodSourceSchema>;
|
|
368
|
+
export type DataType = z.infer<typeof zodDataSchema>;
|
|
369
|
+
export type StatusType = (typeof zodSourceStatusList)[number];
|
|
370
|
+
export type TimeRangeTypeLiteral = 'relative' | 'absolute';
|
|
371
|
+
export type AddSourceToReviewType = Pick<SourceType, 'platform' | 'url' | 'description'> & Partial<Pick<SourceType, 'public_id'>>;
|
|
372
|
+
export type GeoType = z.infer<typeof zodGeoSchema>;
|
|
373
|
+
export type GeoSelectionType = z.infer<typeof zodGeoSelectionSchema>;
|
|
374
|
+
export type PlatformEntityType<T extends typeof platformsList[number]> = typeof platformEntityMap[T][number];
|
|
375
|
+
export declare const getAllowedEntitiesForPlatform: (platform: (typeof platformsList)[number]) => readonly ["channel", "group"] | readonly ["profile", "page", "group"] | readonly ["profile", "hashtag"] | readonly ["website"];
|