asfur 1.0.68 → 1.0.70

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 CHANGED
@@ -34,9 +34,9 @@ export declare const MongoDataSchema: Schema<any, import("mongoose").Model<any,
34
34
  virtuals: true;
35
35
  };
36
36
  }, {
37
+ timestamp: number;
37
38
  created_at: number;
38
39
  updated_at: number;
39
- timestamp: number;
40
40
  text_geo: string[];
41
41
  platform?: string | null | undefined;
42
42
  source_id?: string | null | undefined;
@@ -56,9 +56,9 @@ export declare const MongoDataSchema: Schema<any, import("mongoose").Model<any,
56
56
  author_username?: string | null | undefined;
57
57
  author_id?: string | null | undefined;
58
58
  }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
59
+ timestamp: number;
59
60
  created_at: number;
60
61
  updated_at: number;
61
- timestamp: number;
62
62
  text_geo: string[];
63
63
  platform?: string | null | undefined;
64
64
  source_id?: string | null | undefined;
@@ -78,9 +78,9 @@ export declare const MongoDataSchema: Schema<any, import("mongoose").Model<any,
78
78
  author_username?: string | null | undefined;
79
79
  author_id?: string | null | undefined;
80
80
  }>, {}> & import("mongoose").FlatRecord<{
81
+ timestamp: number;
81
82
  created_at: number;
82
83
  updated_at: number;
83
- timestamp: number;
84
84
  text_geo: string[];
85
85
  platform?: string | null | undefined;
86
86
  source_id?: string | null | undefined;
@@ -141,57 +141,57 @@ export declare const MongoSourceSchema: Schema<any, import("mongoose").Model<any
141
141
  virtuals: true;
142
142
  };
143
143
  }, {
144
+ status: "approved" | "back_to_business" | "pending" | "inactive" | "in_review";
145
+ subscribers: string[];
144
146
  title: string;
147
+ created_at: number;
148
+ updated_at: number;
145
149
  platform: string;
146
- status: "approved" | "back_to_business" | "pending" | "inactive" | "in_review";
147
150
  source_id: any;
148
151
  source_public_id: any;
149
152
  source_name: string;
150
153
  tags: string[];
151
154
  is_public: boolean;
152
155
  metadata: any;
153
- created_at: number;
154
- updated_at: number;
155
- subscribers: string[];
156
+ description?: string | null | undefined;
156
157
  last_text_id?: number | null | undefined;
157
158
  url?: string | null | undefined;
158
- description?: string | null | undefined;
159
159
  source_geo?: string | null | undefined;
160
160
  source_region?: string | null | undefined;
161
161
  }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
162
+ status: "approved" | "back_to_business" | "pending" | "inactive" | "in_review";
163
+ subscribers: string[];
162
164
  title: string;
165
+ created_at: number;
166
+ updated_at: number;
163
167
  platform: string;
164
- status: "approved" | "back_to_business" | "pending" | "inactive" | "in_review";
165
168
  source_id: any;
166
169
  source_public_id: any;
167
170
  source_name: string;
168
171
  tags: string[];
169
172
  is_public: boolean;
170
173
  metadata: any;
171
- created_at: number;
172
- updated_at: number;
173
- subscribers: string[];
174
+ description?: string | null | undefined;
174
175
  last_text_id?: number | null | undefined;
175
176
  url?: string | null | undefined;
176
- description?: string | null | undefined;
177
177
  source_geo?: string | null | undefined;
178
178
  source_region?: string | null | undefined;
179
179
  }>, {}> & import("mongoose").FlatRecord<{
180
+ status: "approved" | "back_to_business" | "pending" | "inactive" | "in_review";
181
+ subscribers: string[];
180
182
  title: string;
183
+ created_at: number;
184
+ updated_at: number;
181
185
  platform: string;
182
- status: "approved" | "back_to_business" | "pending" | "inactive" | "in_review";
183
186
  source_id: any;
184
187
  source_public_id: any;
185
188
  source_name: string;
186
189
  tags: string[];
187
190
  is_public: boolean;
188
191
  metadata: any;
189
- created_at: number;
190
- updated_at: number;
191
- subscribers: string[];
192
+ description?: string | null | undefined;
192
193
  last_text_id?: number | null | undefined;
193
194
  url?: string | null | undefined;
194
- description?: string | null | undefined;
195
195
  source_geo?: string | null | undefined;
196
196
  source_region?: string | null | undefined;
197
197
  }> & {
@@ -208,25 +208,28 @@ export declare const MongoQuerySchema: Schema<any, import("mongoose").Model<any,
208
208
  virtuals: true;
209
209
  };
210
210
  }, {
211
+ geos: string[];
211
212
  user_id: string;
212
213
  sources: string[];
213
- geos: string[];
214
+ geos_ids: string[];
214
215
  time_range: any;
215
216
  title?: string | null | undefined;
216
217
  query?: string | null | undefined;
217
218
  user_instructions?: string | null | undefined;
218
219
  }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
220
+ geos: string[];
219
221
  user_id: string;
220
222
  sources: string[];
221
- geos: string[];
223
+ geos_ids: string[];
222
224
  time_range: any;
223
225
  title?: string | null | undefined;
224
226
  query?: string | null | undefined;
225
227
  user_instructions?: string | null | undefined;
226
228
  }>, {}> & import("mongoose").FlatRecord<{
229
+ geos: string[];
227
230
  user_id: string;
228
231
  sources: string[];
229
- geos: string[];
232
+ geos_ids: string[];
230
233
  time_range: any;
231
234
  title?: string | null | undefined;
232
235
  query?: string | null | undefined;
@@ -246,11 +249,11 @@ export declare const MongoUserSettingsSchema: Schema<any, import("mongoose").Mod
246
249
  };
247
250
  }, {
248
251
  status: "inactive" | "active";
252
+ geos: string[];
249
253
  created_at: NativeDate;
250
254
  updated_at: NativeDate;
251
255
  user_id: string;
252
256
  sources: string[];
253
- geos: string[];
254
257
  has_jobs_access: boolean;
255
258
  active_jobs_limit: number;
256
259
  time_range?: any;
@@ -258,11 +261,11 @@ export declare const MongoUserSettingsSchema: Schema<any, import("mongoose").Mod
258
261
  instructions?: string | null | undefined;
259
262
  }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
260
263
  status: "inactive" | "active";
264
+ geos: string[];
261
265
  created_at: NativeDate;
262
266
  updated_at: NativeDate;
263
267
  user_id: string;
264
268
  sources: string[];
265
- geos: string[];
266
269
  has_jobs_access: boolean;
267
270
  active_jobs_limit: number;
268
271
  time_range?: any;
@@ -270,11 +273,11 @@ export declare const MongoUserSettingsSchema: Schema<any, import("mongoose").Mod
270
273
  instructions?: string | null | undefined;
271
274
  }>, {}> & import("mongoose").FlatRecord<{
272
275
  status: "inactive" | "active";
276
+ geos: string[];
273
277
  created_at: NativeDate;
274
278
  updated_at: NativeDate;
275
279
  user_id: string;
276
280
  sources: string[];
277
- geos: string[];
278
281
  has_jobs_access: boolean;
279
282
  active_jobs_limit: number;
280
283
  time_range?: any;
@@ -388,22 +391,22 @@ export declare const MongoGeoSchema: Schema<any, import("mongoose").Model<any, a
388
391
  }, {
389
392
  subscribers: string[];
390
393
  is_used: boolean;
391
- timestamp?: number | null | undefined;
392
394
  geo_text?: string | null | undefined;
395
+ timestamp?: number | null | undefined;
393
396
  count?: number | null | undefined;
394
397
  region?: string | null | undefined;
395
398
  }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
396
399
  subscribers: string[];
397
400
  is_used: boolean;
398
- timestamp?: number | null | undefined;
399
401
  geo_text?: string | null | undefined;
402
+ timestamp?: number | null | undefined;
400
403
  count?: number | null | undefined;
401
404
  region?: string | null | undefined;
402
405
  }>, {}> & import("mongoose").FlatRecord<{
403
406
  subscribers: string[];
404
407
  is_used: boolean;
405
- timestamp?: number | null | undefined;
406
408
  geo_text?: string | null | undefined;
409
+ timestamp?: number | null | undefined;
407
410
  count?: number | null | undefined;
408
411
  region?: string | null | undefined;
409
412
  }> & {
@@ -421,28 +424,28 @@ export declare const MongoGeoSelectionSchema: Schema<any, import("mongoose").Mod
421
424
  };
422
425
  }, {
423
426
  geos: string[];
424
- title?: string | null | undefined;
427
+ region?: string | null | undefined;
425
428
  type?: string | null | undefined;
429
+ title?: string | null | undefined;
426
430
  description?: string | null | undefined;
427
431
  created_at?: number | null | undefined;
428
432
  updated_at?: number | null | undefined;
429
- region?: string | null | undefined;
430
433
  }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
431
434
  geos: string[];
432
- title?: string | null | undefined;
435
+ region?: string | null | undefined;
433
436
  type?: string | null | undefined;
437
+ title?: string | null | undefined;
434
438
  description?: string | null | undefined;
435
439
  created_at?: number | null | undefined;
436
440
  updated_at?: number | null | undefined;
437
- region?: string | null | undefined;
438
441
  }>, {}> & import("mongoose").FlatRecord<{
439
442
  geos: string[];
440
- title?: string | null | undefined;
443
+ region?: string | null | undefined;
441
444
  type?: string | null | undefined;
445
+ title?: string | null | undefined;
442
446
  description?: string | null | undefined;
443
447
  created_at?: number | null | undefined;
444
448
  updated_at?: number | null | undefined;
445
- region?: string | null | undefined;
446
449
  }> & {
447
450
  _id: import("mongoose").Types.ObjectId;
448
451
  } & {
package/dist/index.js CHANGED
@@ -97,6 +97,7 @@ exports.MongoQuerySchema = new mongoose_1.Schema({
97
97
  query: { type: String },
98
98
  sources: { type: [String] },
99
99
  geos: { type: [String], required: true },
100
+ geos_ids: { type: [String], required: true },
100
101
  time_range: {
101
102
  type: mongoose_1.Schema.Types.Mixed,
102
103
  required: true,
package/dist/types.d.ts CHANGED
@@ -2,6 +2,59 @@ import { z } from 'zod';
2
2
  export declare const platformsList: readonly ["telegram", "facebook", "instagram", "tiktok", "website", "document", "other"];
3
3
  export declare const statusList: readonly ["approved", "back_to_business", "pending", "inactive", "in_review"];
4
4
  export declare const generalStatusList: readonly ["active", "inactive"];
5
+ export declare const zodGeoSchema: z.ZodObject<{
6
+ _id: z.ZodOptional<z.ZodString>;
7
+ geo_text: z.ZodOptional<z.ZodString>;
8
+ timestamp: z.ZodOptional<z.ZodNumber>;
9
+ count: z.ZodOptional<z.ZodNumber>;
10
+ region: z.ZodOptional<z.ZodString>;
11
+ subscribers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
12
+ is_used: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
13
+ }, "strip", z.ZodTypeAny, {
14
+ is_used: boolean;
15
+ _id?: string | undefined;
16
+ geo_text?: string | undefined;
17
+ timestamp?: number | undefined;
18
+ count?: number | undefined;
19
+ region?: string | undefined;
20
+ subscribers?: string[] | undefined;
21
+ }, {
22
+ _id?: string | undefined;
23
+ geo_text?: string | undefined;
24
+ timestamp?: number | undefined;
25
+ count?: number | undefined;
26
+ region?: string | undefined;
27
+ subscribers?: string[] | undefined;
28
+ is_used?: boolean | undefined;
29
+ }>;
30
+ export declare const zodGeoSelectionSchema: z.ZodObject<{
31
+ _id: z.ZodOptional<z.ZodString>;
32
+ title: z.ZodOptional<z.ZodString>;
33
+ description: z.ZodOptional<z.ZodString>;
34
+ type: z.ZodOptional<z.ZodString>;
35
+ geos: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
36
+ region: z.ZodOptional<z.ZodString>;
37
+ created_at: z.ZodOptional<z.ZodNumber>;
38
+ updated_at: z.ZodOptional<z.ZodNumber>;
39
+ }, "strip", z.ZodTypeAny, {
40
+ _id?: string | undefined;
41
+ region?: string | undefined;
42
+ type?: string | undefined;
43
+ title?: string | undefined;
44
+ description?: string | undefined;
45
+ geos?: string[] | undefined;
46
+ created_at?: number | undefined;
47
+ updated_at?: number | undefined;
48
+ }, {
49
+ _id?: string | undefined;
50
+ region?: string | undefined;
51
+ type?: string | undefined;
52
+ title?: string | undefined;
53
+ description?: string | undefined;
54
+ geos?: string[] | undefined;
55
+ created_at?: number | undefined;
56
+ updated_at?: number | undefined;
57
+ }>;
5
58
  export declare const zodSourceSchema: z.ZodObject<{
6
59
  _id: z.ZodOptional<z.ZodString>;
7
60
  title: z.ZodOptional<z.ZodString>;
@@ -24,46 +77,46 @@ export declare const zodSourceSchema: z.ZodObject<{
24
77
  subscribers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
25
78
  source_region: z.ZodOptional<z.ZodString>;
26
79
  }, "strip", z.ZodTypeAny, {
27
- platform: "telegram" | "facebook" | "instagram" | "tiktok" | "website" | "document" | "other";
28
80
  status: "approved" | "back_to_business" | "pending" | "inactive" | "in_review";
81
+ platform: "telegram" | "facebook" | "instagram" | "tiktok" | "website" | "document" | "other";
29
82
  source_id: string | number;
30
83
  source_name: string;
31
84
  is_public: boolean;
32
85
  _id?: string | undefined;
86
+ subscribers?: string[] | undefined;
33
87
  title?: string | undefined;
88
+ description?: string | undefined;
89
+ created_at?: number | undefined;
90
+ updated_at?: number | undefined;
34
91
  source_public_id?: string | number | undefined;
35
92
  last_text_id?: number | undefined;
36
93
  url?: string | undefined;
37
- description?: string | undefined;
38
94
  language?: string | undefined;
39
95
  source_geo?: string | undefined;
40
96
  tags?: string[] | undefined;
41
97
  metadata?: Record<string, any> | undefined;
42
- created_at?: number | undefined;
43
- updated_at?: number | undefined;
44
98
  user_id?: string | undefined;
45
- subscribers?: string[] | undefined;
46
99
  source_region?: string | undefined;
47
100
  }, {
48
- platform: "telegram" | "facebook" | "instagram" | "tiktok" | "website" | "document" | "other";
49
101
  status: "approved" | "back_to_business" | "pending" | "inactive" | "in_review";
102
+ platform: "telegram" | "facebook" | "instagram" | "tiktok" | "website" | "document" | "other";
50
103
  source_id: string | number;
51
104
  source_name: string;
52
105
  _id?: string | undefined;
106
+ subscribers?: string[] | undefined;
53
107
  title?: string | undefined;
108
+ description?: string | undefined;
109
+ created_at?: number | undefined;
110
+ updated_at?: number | undefined;
54
111
  source_public_id?: string | number | undefined;
55
112
  last_text_id?: number | undefined;
56
113
  url?: string | undefined;
57
- description?: string | undefined;
58
114
  language?: string | undefined;
59
115
  source_geo?: string | undefined;
60
116
  tags?: string[] | undefined;
61
117
  is_public?: boolean | undefined;
62
118
  metadata?: Record<string, any> | undefined;
63
- created_at?: number | undefined;
64
- updated_at?: number | undefined;
65
119
  user_id?: string | undefined;
66
- subscribers?: string[] | undefined;
67
120
  source_region?: string | undefined;
68
121
  }>;
69
122
  export declare const zodDataSchema: z.ZodObject<{
@@ -104,15 +157,15 @@ export declare const zodDataSchema: z.ZodObject<{
104
157
  author_username: z.ZodOptional<z.ZodString>;
105
158
  author_id: z.ZodOptional<z.ZodString>;
106
159
  }, "strip", z.ZodTypeAny, {
160
+ timestamp: number;
161
+ created_at: number;
162
+ updated_at: number;
107
163
  platform: "telegram" | "facebook" | "instagram" | "tiktok" | "website" | "document" | "other";
108
164
  source_id: string | number;
109
165
  source_public_id: string | number;
110
166
  source_name: string;
111
- created_at: number;
112
- updated_at: number;
113
167
  platform_id: string | number;
114
168
  original_text_id: string | number;
115
- timestamp: number;
116
169
  text_geo: string[];
117
170
  _id?: string | undefined;
118
171
  language?: string | undefined;
@@ -133,15 +186,15 @@ export declare const zodDataSchema: z.ZodObject<{
133
186
  author_username?: string | undefined;
134
187
  author_id?: string | undefined;
135
188
  }, {
189
+ timestamp: number;
190
+ created_at: number;
191
+ updated_at: number;
136
192
  platform: "telegram" | "facebook" | "instagram" | "tiktok" | "website" | "document" | "other";
137
193
  source_id: string | number;
138
194
  source_public_id: string | number;
139
195
  source_name: string;
140
- created_at: number;
141
- updated_at: number;
142
196
  platform_id: string | number;
143
197
  original_text_id: string | number;
144
- timestamp: number;
145
198
  text_geo: string[];
146
199
  _id?: string | undefined;
147
200
  language?: string | undefined;
@@ -192,6 +245,7 @@ export declare const zodQuerySchema: z.ZodObject<{
192
245
  query: z.ZodOptional<z.ZodString>;
193
246
  sources: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
194
247
  geos: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
248
+ geos_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
195
249
  time_range: z.ZodUnion<[z.ZodObject<{
196
250
  type: z.ZodLiteral<"relative">;
197
251
  time: z.ZodEnum<["last_30_minutes", "last_1_hour", "last_2_hours", "last_6_hours", "last_12_hours", "last_24_hours", "last_48_hours", "last_72_hours", "last_week"]>;
@@ -229,9 +283,10 @@ export declare const zodQuerySchema: z.ZodObject<{
229
283
  };
230
284
  _id?: string | undefined;
231
285
  title?: string | undefined;
286
+ geos?: string[] | undefined;
232
287
  query?: string | undefined;
233
288
  sources?: string[] | undefined;
234
- geos?: string[] | undefined;
289
+ geos_ids?: string[] | undefined;
235
290
  user_instructions?: string | undefined;
236
291
  thread_id?: string | undefined;
237
292
  }, {
@@ -246,9 +301,10 @@ export declare const zodQuerySchema: z.ZodObject<{
246
301
  };
247
302
  _id?: string | undefined;
248
303
  title?: string | undefined;
304
+ geos?: string[] | undefined;
249
305
  query?: string | undefined;
250
306
  sources?: string[] | undefined;
251
- geos?: string[] | undefined;
307
+ geos_ids?: string[] | undefined;
252
308
  user_instructions?: string | undefined;
253
309
  thread_id?: string | undefined;
254
310
  }>;
@@ -320,9 +376,9 @@ export declare const zodUserSettingsSchema: z.ZodObject<{
320
376
  has_jobs_access: boolean;
321
377
  active_jobs_limit: number;
322
378
  _id?: string | undefined;
379
+ geos?: string[] | undefined;
323
380
  created_at?: number | Date | undefined;
324
381
  updated_at?: number | Date | undefined;
325
- geos?: string[] | undefined;
326
382
  thread_id?: string | undefined;
327
383
  instructions?: string | undefined;
328
384
  }, {
@@ -338,9 +394,9 @@ export declare const zodUserSettingsSchema: z.ZodObject<{
338
394
  };
339
395
  _id?: string | undefined;
340
396
  status?: "inactive" | "active" | undefined;
397
+ geos?: string[] | undefined;
341
398
  created_at?: number | Date | undefined;
342
399
  updated_at?: number | Date | undefined;
343
- geos?: string[] | undefined;
344
400
  thread_id?: string | undefined;
345
401
  instructions?: string | undefined;
346
402
  has_jobs_access?: boolean | undefined;
@@ -367,8 +423,8 @@ export declare const zodConversationSchema: z.ZodObject<{
367
423
  }, {
368
424
  user_id: string;
369
425
  _id?: string | undefined;
370
- title?: string | undefined;
371
426
  status?: "inactive" | "active" | undefined;
427
+ title?: string | undefined;
372
428
  created_at?: number | Date | undefined;
373
429
  updated_at?: number | Date | undefined;
374
430
  thread_id?: string | undefined;
@@ -390,6 +446,7 @@ export declare const zodJobSchema: z.ZodObject<{
390
446
  query: z.ZodOptional<z.ZodString>;
391
447
  sources: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
392
448
  geos: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
449
+ geos_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
393
450
  time_range: z.ZodUnion<[z.ZodObject<{
394
451
  type: z.ZodLiteral<"relative">;
395
452
  time: z.ZodEnum<["last_30_minutes", "last_1_hour", "last_2_hours", "last_6_hours", "last_12_hours", "last_24_hours", "last_48_hours", "last_72_hours", "last_week"]>;
@@ -427,9 +484,10 @@ export declare const zodJobSchema: z.ZodObject<{
427
484
  };
428
485
  _id?: string | undefined;
429
486
  title?: string | undefined;
487
+ geos?: string[] | undefined;
430
488
  query?: string | undefined;
431
489
  sources?: string[] | undefined;
432
- geos?: string[] | undefined;
490
+ geos_ids?: string[] | undefined;
433
491
  user_instructions?: string | undefined;
434
492
  thread_id?: string | undefined;
435
493
  }, {
@@ -444,9 +502,10 @@ export declare const zodJobSchema: z.ZodObject<{
444
502
  };
445
503
  _id?: string | undefined;
446
504
  title?: string | undefined;
505
+ geos?: string[] | undefined;
447
506
  query?: string | undefined;
448
507
  sources?: string[] | undefined;
449
- geos?: string[] | undefined;
508
+ geos_ids?: string[] | undefined;
450
509
  user_instructions?: string | undefined;
451
510
  thread_id?: string | undefined;
452
511
  }>;
@@ -469,9 +528,10 @@ export declare const zodJobSchema: z.ZodObject<{
469
528
  };
470
529
  _id?: string | undefined;
471
530
  title?: string | undefined;
531
+ geos?: string[] | undefined;
472
532
  query?: string | undefined;
473
533
  sources?: string[] | undefined;
474
- geos?: string[] | undefined;
534
+ geos_ids?: string[] | undefined;
475
535
  user_instructions?: string | undefined;
476
536
  thread_id?: string | undefined;
477
537
  };
@@ -500,9 +560,10 @@ export declare const zodJobSchema: z.ZodObject<{
500
560
  };
501
561
  _id?: string | undefined;
502
562
  title?: string | undefined;
563
+ geos?: string[] | undefined;
503
564
  query?: string | undefined;
504
565
  sources?: string[] | undefined;
505
- geos?: string[] | undefined;
566
+ geos_ids?: string[] | undefined;
506
567
  user_instructions?: string | undefined;
507
568
  thread_id?: string | undefined;
508
569
  };
@@ -535,59 +596,6 @@ export declare const zodCronScheduleResponseSchema: z.ZodObject<{
535
596
  schedule?: string | undefined;
536
597
  error?: string | undefined;
537
598
  }>;
538
- export declare const zodGeoSchema: z.ZodObject<{
539
- _id: z.ZodOptional<z.ZodString>;
540
- geo_text: z.ZodOptional<z.ZodString>;
541
- timestamp: z.ZodOptional<z.ZodNumber>;
542
- count: z.ZodOptional<z.ZodNumber>;
543
- region: z.ZodOptional<z.ZodString>;
544
- subscribers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
545
- is_used: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
546
- }, "strip", z.ZodTypeAny, {
547
- is_used: boolean;
548
- _id?: string | undefined;
549
- subscribers?: string[] | undefined;
550
- timestamp?: number | undefined;
551
- geo_text?: string | undefined;
552
- count?: number | undefined;
553
- region?: string | undefined;
554
- }, {
555
- _id?: string | undefined;
556
- subscribers?: string[] | undefined;
557
- timestamp?: number | undefined;
558
- geo_text?: string | undefined;
559
- count?: number | undefined;
560
- region?: string | undefined;
561
- is_used?: boolean | undefined;
562
- }>;
563
- export declare const zodGeoSelectionSchema: z.ZodObject<{
564
- _id: z.ZodOptional<z.ZodString>;
565
- title: z.ZodOptional<z.ZodString>;
566
- description: z.ZodOptional<z.ZodString>;
567
- type: z.ZodOptional<z.ZodString>;
568
- geos: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
569
- region: z.ZodOptional<z.ZodString>;
570
- created_at: z.ZodOptional<z.ZodNumber>;
571
- updated_at: z.ZodOptional<z.ZodNumber>;
572
- }, "strip", z.ZodTypeAny, {
573
- _id?: string | undefined;
574
- title?: string | undefined;
575
- type?: string | undefined;
576
- description?: string | undefined;
577
- created_at?: number | undefined;
578
- updated_at?: number | undefined;
579
- geos?: string[] | undefined;
580
- region?: string | undefined;
581
- }, {
582
- _id?: string | undefined;
583
- title?: string | undefined;
584
- type?: string | undefined;
585
- description?: string | undefined;
586
- created_at?: number | undefined;
587
- updated_at?: number | undefined;
588
- geos?: string[] | undefined;
589
- region?: string | undefined;
590
- }>;
591
599
  export type SourceType = z.infer<typeof zodSourceSchema>;
592
600
  export type DataType = z.infer<typeof zodDataSchema>;
593
601
  export type QueryType = z.infer<typeof zodQuerySchema>;
package/dist/types.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.zodGeoSelectionSchema = exports.zodGeoSchema = exports.zodCronScheduleResponseSchema = exports.zodJobSchema = exports.zodConversationSchema = exports.zodUserSettingsSchema = exports.zodInstructionsSchema = exports.zodQuerySchema = exports.zodAbsoluteTimeRangeSchema = exports.zodRelativeTimeRangeSchema = exports.relativeTimeRangeList = exports.zodDataSchema = exports.zodSourceSchema = exports.generalStatusList = exports.statusList = exports.platformsList = void 0;
3
+ exports.zodCronScheduleResponseSchema = exports.zodJobSchema = exports.zodConversationSchema = exports.zodUserSettingsSchema = exports.zodInstructionsSchema = exports.zodQuerySchema = exports.zodAbsoluteTimeRangeSchema = exports.zodRelativeTimeRangeSchema = exports.relativeTimeRangeList = exports.zodDataSchema = exports.zodSourceSchema = exports.zodGeoSelectionSchema = exports.zodGeoSchema = exports.generalStatusList = exports.statusList = exports.platformsList = void 0;
4
4
  const zod_1 = require("zod");
5
5
  exports.platformsList = [
6
6
  'telegram',
@@ -19,6 +19,25 @@ exports.statusList = [
19
19
  'in_review',
20
20
  ];
21
21
  exports.generalStatusList = ['active', 'inactive'];
22
+ exports.zodGeoSchema = zod_1.z.object({
23
+ _id: zod_1.z.string().optional(),
24
+ geo_text: zod_1.z.string().optional(),
25
+ timestamp: zod_1.z.number().optional(),
26
+ count: zod_1.z.number().optional(),
27
+ region: zod_1.z.string().optional(),
28
+ subscribers: zod_1.z.array(zod_1.z.string()).optional(),
29
+ is_used: zod_1.z.boolean().optional().default(false), // true if this geo is used in any source
30
+ });
31
+ exports.zodGeoSelectionSchema = zod_1.z.object({
32
+ _id: zod_1.z.string().optional(),
33
+ title: zod_1.z.string().optional(),
34
+ description: zod_1.z.string().optional(),
35
+ type: zod_1.z.string().optional(),
36
+ geos: zod_1.z.array(zod_1.z.string()).optional(),
37
+ region: zod_1.z.string().optional(),
38
+ created_at: zod_1.z.number().optional(),
39
+ updated_at: zod_1.z.number().optional(), // last update date
40
+ });
22
41
  exports.zodSourceSchema = zod_1.z.object({
23
42
  _id: zod_1.z.string().optional(),
24
43
  title: zod_1.z.string().optional(),
@@ -100,6 +119,7 @@ exports.zodQuerySchema = zod_1.z.object({
100
119
  query: zod_1.z.string().optional(),
101
120
  sources: zod_1.z.array(zod_1.z.string()).optional(),
102
121
  geos: zod_1.z.array(zod_1.z.string()).optional(),
122
+ geos_ids: zod_1.z.array(zod_1.z.string()).optional(),
103
123
  time_range: exports.zodRelativeTimeRangeSchema.or(exports.zodAbsoluteTimeRangeSchema),
104
124
  user_instructions: zod_1.z.string().optional(),
105
125
  user_id: zod_1.z.string().nonempty('User ID must be provided'),
@@ -158,22 +178,3 @@ exports.zodCronScheduleResponseSchema = zod_1.z.object({
158
178
  is_ok: zod_1.z.boolean(),
159
179
  error: zod_1.z.string().optional(), // error message if the cron job is invalid
160
180
  });
161
- exports.zodGeoSchema = zod_1.z.object({
162
- _id: zod_1.z.string().optional(),
163
- geo_text: zod_1.z.string().optional(),
164
- timestamp: zod_1.z.number().optional(),
165
- count: zod_1.z.number().optional(),
166
- region: zod_1.z.string().optional(),
167
- subscribers: zod_1.z.array(zod_1.z.string()).optional(),
168
- is_used: zod_1.z.boolean().optional().default(false), // true if this geo is used in any source
169
- });
170
- exports.zodGeoSelectionSchema = zod_1.z.object({
171
- _id: zod_1.z.string().optional(),
172
- title: zod_1.z.string().optional(),
173
- description: zod_1.z.string().optional(),
174
- type: zod_1.z.string().optional(),
175
- geos: zod_1.z.array(zod_1.z.string()).optional(),
176
- region: zod_1.z.string().optional(),
177
- created_at: zod_1.z.number().optional(),
178
- updated_at: zod_1.z.number().optional(), // last update date
179
- });
package/index.ts CHANGED
@@ -95,6 +95,7 @@ export const MongoQuerySchema = new Schema(
95
95
  query: { type: String }, // search query includes geo information where it should be extracted with LLM
96
96
  sources: { type: [String] }, // array of source _id strings
97
97
  geos: { type: [String], required: true }, // array of geo strings
98
+ geos_ids: { type: [String], required: true }, // array of geo _id strings
98
99
  time_range: {
99
100
  type: Schema.Types.Mixed, // can be relative or absolute time range
100
101
  required: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asfur",
3
- "version": "1.0.68",
3
+ "version": "1.0.70",
4
4
  "description": "SDK for interacting with the Asfur API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/types.ts CHANGED
@@ -20,6 +20,28 @@ export const statusList = [
20
20
 
21
21
  export const generalStatusList = ['active', 'inactive'] as const;
22
22
 
23
+
24
+ export const zodGeoSchema = z.object({
25
+ _id: z.string().optional(),
26
+ geo_text: z.string().optional(), // e.g., "New York, USA"
27
+ timestamp: z.number().optional(), // e.g., 1751210833000
28
+ count: z.number().optional(), // e.g., 42
29
+ region: z.string().optional(), // e.g., "New York", "California"
30
+ subscribers: z.array(z.string()).optional(), // array of user IDs who subscribed to this geo
31
+ is_used: z.boolean().optional().default(false), // true if this geo is used in any source
32
+ });
33
+
34
+ export const zodGeoSelectionSchema = z.object({
35
+ _id: z.string().optional(),
36
+ title: z.string().optional(), // e.g., "New York, USA"
37
+ description: z.string().optional(), // e.g., "A city in the USA"
38
+ type: z.string().optional(), // e.g., "city", "region", "country"
39
+ geos: z.array(z.string()).optional(), // e.g., ["New York", "Los Angeles"]
40
+ region: z.string().optional(), // e.g., "New York", "California"
41
+ created_at: z.number().optional(), // creation date
42
+ updated_at: z.number().optional(), // last update date
43
+ });
44
+
23
45
  export const zodSourceSchema = z.object({
24
46
  _id: z.string().optional(),
25
47
  title: z.string().optional(), // e.g., 'Telegram Channel Name'
@@ -108,6 +130,7 @@ export const zodQuerySchema = z.object({
108
130
  query: z.string().optional(), // search query includes geo information where it should be extracted with LLM
109
131
  sources: z.array(z.string()).optional(), // array of source _id strings
110
132
  geos: z.array(z.string()).optional(), // array of geo strings
133
+ geos_ids: z.array(z.string()).optional(), // array of geo _id strings
111
134
  time_range: zodRelativeTimeRangeSchema.or(zodAbsoluteTimeRangeSchema), // optional time range for the query
112
135
  user_instructions: z.string().optional(), // optional user instructions for the query
113
136
  user_id: z.string().nonempty('User ID must be provided'), // user identifier
@@ -173,26 +196,6 @@ export const zodCronScheduleResponseSchema = z.object({
173
196
  error: z.string().optional(), // error message if the cron job is invalid
174
197
  });
175
198
 
176
- export const zodGeoSchema = z.object({
177
- _id: z.string().optional(),
178
- geo_text: z.string().optional(), // e.g., "New York, USA"
179
- timestamp: z.number().optional(), // e.g., 1751210833000
180
- count: z.number().optional(), // e.g., 42
181
- region: z.string().optional(), // e.g., "New York", "California"
182
- subscribers: z.array(z.string()).optional(), // array of user IDs who subscribed to this geo
183
- is_used: z.boolean().optional().default(false), // true if this geo is used in any source
184
- });
185
-
186
- export const zodGeoSelectionSchema = z.object({
187
- _id: z.string().optional(),
188
- title: z.string().optional(), // e.g., "New York, USA"
189
- description: z.string().optional(), // e.g., "A city in the USA"
190
- type: z.string().optional(), // e.g., "city", "region", "country"
191
- geos: z.array(z.string()).optional(), // e.g., ["New York", "Los Angeles"]
192
- region: z.string().optional(), // e.g., "New York", "California"
193
- created_at: z.number().optional(), // creation date
194
- updated_at: z.number().optional(), // last update date
195
- });
196
199
 
197
200
  export type SourceType = z.infer<typeof zodSourceSchema>;
198
201
  export type DataType = z.infer<typeof zodDataSchema>;