asfur 1.0.79 → 1.0.81

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;
38
37
  created_at: number;
39
38
  updated_at: number;
39
+ timestamp: number;
40
40
  text_geo: string[];
41
41
  platform?: string | null | undefined;
42
42
  source_id?: string | null | undefined;
@@ -58,9 +58,9 @@ export declare const MongoDataSchema: Schema<any, import("mongoose").Model<any,
58
58
  author_id?: string | null | undefined;
59
59
  pipeline_name?: string | null | undefined;
60
60
  }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
61
- timestamp: number;
62
61
  created_at: number;
63
62
  updated_at: number;
63
+ timestamp: number;
64
64
  text_geo: string[];
65
65
  platform?: string | null | undefined;
66
66
  source_id?: string | null | undefined;
@@ -82,9 +82,9 @@ export declare const MongoDataSchema: Schema<any, import("mongoose").Model<any,
82
82
  author_id?: string | null | undefined;
83
83
  pipeline_name?: string | null | undefined;
84
84
  }>, {}> & import("mongoose").FlatRecord<{
85
- timestamp: number;
86
85
  created_at: number;
87
86
  updated_at: number;
87
+ timestamp: number;
88
88
  text_geo: string[];
89
89
  platform?: string | null | undefined;
90
90
  source_id?: string | null | undefined;
@@ -147,11 +147,11 @@ export declare const MongoSourceSchema: Schema<any, import("mongoose").Model<any
147
147
  virtuals: true;
148
148
  };
149
149
  }, {
150
- status: "approved" | "back_to_business" | "pending" | "inactive" | "in_review";
151
- subscribers: string[];
152
150
  title: string;
151
+ status: "approved" | "back_to_business" | "pending" | "inactive" | "in_review";
153
152
  created_at: number;
154
153
  updated_at: number;
154
+ subscribers: string[];
155
155
  platform: string;
156
156
  source_id: any;
157
157
  source_public_id: any;
@@ -166,11 +166,11 @@ export declare const MongoSourceSchema: Schema<any, import("mongoose").Model<any
166
166
  source_region?: string | null | undefined;
167
167
  server?: string | null | undefined;
168
168
  }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
169
- status: "approved" | "back_to_business" | "pending" | "inactive" | "in_review";
170
- subscribers: string[];
171
169
  title: string;
170
+ status: "approved" | "back_to_business" | "pending" | "inactive" | "in_review";
172
171
  created_at: number;
173
172
  updated_at: number;
173
+ subscribers: string[];
174
174
  platform: string;
175
175
  source_id: any;
176
176
  source_public_id: any;
@@ -185,11 +185,11 @@ export declare const MongoSourceSchema: Schema<any, import("mongoose").Model<any
185
185
  source_region?: string | null | undefined;
186
186
  server?: string | null | undefined;
187
187
  }>, {}> & import("mongoose").FlatRecord<{
188
- status: "approved" | "back_to_business" | "pending" | "inactive" | "in_review";
189
- subscribers: string[];
190
188
  title: string;
189
+ status: "approved" | "back_to_business" | "pending" | "inactive" | "in_review";
191
190
  created_at: number;
192
191
  updated_at: number;
192
+ subscribers: string[];
193
193
  platform: string;
194
194
  source_id: any;
195
195
  source_public_id: any;
@@ -218,6 +218,7 @@ export declare const MongoQuerySchema: Schema<any, import("mongoose").Model<any,
218
218
  };
219
219
  }, {
220
220
  geos: string[];
221
+ timestamp: number;
221
222
  user_id: string;
222
223
  sources: string[];
223
224
  geos_ids: string[];
@@ -228,6 +229,7 @@ export declare const MongoQuerySchema: Schema<any, import("mongoose").Model<any,
228
229
  user_time_zone?: string | null | undefined;
229
230
  }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
230
231
  geos: string[];
232
+ timestamp: number;
231
233
  user_id: string;
232
234
  sources: string[];
233
235
  geos_ids: string[];
@@ -238,6 +240,7 @@ export declare const MongoQuerySchema: Schema<any, import("mongoose").Model<any,
238
240
  user_time_zone?: string | null | undefined;
239
241
  }>, {}> & import("mongoose").FlatRecord<{
240
242
  geos: string[];
243
+ timestamp: number;
241
244
  user_id: string;
242
245
  sources: string[];
243
246
  geos_ids: string[];
@@ -403,24 +406,24 @@ export declare const MongoGeoSchema: Schema<any, import("mongoose").Model<any, a
403
406
  }, {
404
407
  subscribers: string[];
405
408
  is_used: boolean;
409
+ region?: string | null | undefined;
406
410
  geo_text?: string | null | undefined;
407
411
  timestamp?: number | null | undefined;
408
412
  count?: number | null | undefined;
409
- region?: string | null | undefined;
410
413
  }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
411
414
  subscribers: string[];
412
415
  is_used: boolean;
416
+ region?: string | null | undefined;
413
417
  geo_text?: string | null | undefined;
414
418
  timestamp?: number | null | undefined;
415
419
  count?: number | null | undefined;
416
- region?: string | null | undefined;
417
420
  }>, {}> & import("mongoose").FlatRecord<{
418
421
  subscribers: string[];
419
422
  is_used: boolean;
423
+ region?: string | null | undefined;
420
424
  geo_text?: string | null | undefined;
421
425
  timestamp?: number | null | undefined;
422
426
  count?: number | null | undefined;
423
- region?: string | null | undefined;
424
427
  }> & {
425
428
  _id: import("mongoose").Types.ObjectId;
426
429
  } & {
@@ -436,26 +439,26 @@ export declare const MongoGeoSelectionSchema: Schema<any, import("mongoose").Mod
436
439
  };
437
440
  }, {
438
441
  geos: string[];
439
- region?: string | null | undefined;
440
- type?: string | null | undefined;
441
442
  title?: string | null | undefined;
442
443
  description?: string | null | undefined;
444
+ type?: string | null | undefined;
445
+ region?: string | null | undefined;
443
446
  created_at?: number | null | undefined;
444
447
  updated_at?: number | null | undefined;
445
448
  }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
446
449
  geos: string[];
447
- region?: string | null | undefined;
448
- type?: string | null | undefined;
449
450
  title?: string | null | undefined;
450
451
  description?: string | null | undefined;
452
+ type?: string | null | undefined;
453
+ region?: string | null | undefined;
451
454
  created_at?: number | null | undefined;
452
455
  updated_at?: number | null | undefined;
453
456
  }>, {}> & import("mongoose").FlatRecord<{
454
457
  geos: string[];
455
- region?: string | null | undefined;
456
- type?: string | null | undefined;
457
458
  title?: string | null | undefined;
458
459
  description?: string | null | undefined;
460
+ type?: string | null | undefined;
461
+ region?: string | null | undefined;
459
462
  created_at?: number | null | undefined;
460
463
  updated_at?: number | null | undefined;
461
464
  }> & {
package/dist/index.js CHANGED
@@ -107,7 +107,8 @@ exports.MongoQuerySchema = new mongoose_1.Schema({
107
107
  },
108
108
  user_id: { type: String, required: true },
109
109
  user_instructions: { type: String },
110
- user_time_zone: { type: String }, // user's timezone
110
+ user_time_zone: { type: String },
111
+ timestamp: { type: Number, default: Date.now }, // creation date
111
112
  }, {
112
113
  versionKey: false,
113
114
  toJSON: { virtuals: true },
package/dist/types.d.ts CHANGED
@@ -2,6 +2,32 @@ 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 geoSelectionRegionsList: {
6
+ iran: {
7
+ title: string;
8
+ index: string;
9
+ };
10
+ gaza: {
11
+ title: string;
12
+ index: string;
13
+ };
14
+ west_bank: {
15
+ title: string;
16
+ index: string;
17
+ };
18
+ us_mexico_border: {
19
+ title: string;
20
+ index: string;
21
+ };
22
+ lebanon: {
23
+ title: string;
24
+ index: string;
25
+ };
26
+ };
27
+ export type GeoSelectionRegionsType = keyof typeof geoSelectionRegionsList;
28
+ export type GeoSelectionByRegion = {
29
+ [region in GeoSelectionRegionsType]: GeoSelectionType[];
30
+ };
5
31
  export declare const zodGeoSchema: z.ZodObject<{
6
32
  _id: z.ZodOptional<z.ZodString>;
7
33
  geo_text: z.ZodOptional<z.ZodString>;
@@ -13,17 +39,17 @@ export declare const zodGeoSchema: z.ZodObject<{
13
39
  }, "strip", z.ZodTypeAny, {
14
40
  is_used: boolean;
15
41
  _id?: string | undefined;
42
+ region?: string | undefined;
16
43
  geo_text?: string | undefined;
17
44
  timestamp?: number | undefined;
18
45
  count?: number | undefined;
19
- region?: string | undefined;
20
46
  subscribers?: string[] | undefined;
21
47
  }, {
22
48
  _id?: string | undefined;
49
+ region?: string | undefined;
23
50
  geo_text?: string | undefined;
24
51
  timestamp?: number | undefined;
25
52
  count?: number | undefined;
26
- region?: string | undefined;
27
53
  subscribers?: string[] | undefined;
28
54
  is_used?: boolean | undefined;
29
55
  }>;
@@ -38,20 +64,20 @@ export declare const zodGeoSelectionSchema: z.ZodObject<{
38
64
  updated_at: z.ZodOptional<z.ZodNumber>;
39
65
  }, "strip", z.ZodTypeAny, {
40
66
  _id?: string | undefined;
41
- region?: string | undefined;
42
- type?: string | undefined;
43
67
  title?: string | undefined;
44
68
  description?: string | undefined;
69
+ type?: string | undefined;
45
70
  geos?: string[] | undefined;
71
+ region?: string | undefined;
46
72
  created_at?: number | undefined;
47
73
  updated_at?: number | undefined;
48
74
  }, {
49
75
  _id?: string | undefined;
50
- region?: string | undefined;
51
- type?: string | undefined;
52
76
  title?: string | undefined;
53
77
  description?: string | undefined;
78
+ type?: string | undefined;
54
79
  geos?: string[] | undefined;
80
+ region?: string | undefined;
55
81
  created_at?: number | undefined;
56
82
  updated_at?: number | undefined;
57
83
  }>;
@@ -84,11 +110,11 @@ export declare const zodSourceSchema: z.ZodObject<{
84
110
  source_name: string;
85
111
  is_public: boolean;
86
112
  _id?: string | undefined;
87
- subscribers?: string[] | undefined;
88
113
  title?: string | undefined;
89
114
  description?: string | undefined;
90
115
  created_at?: number | undefined;
91
116
  updated_at?: number | undefined;
117
+ subscribers?: string[] | undefined;
92
118
  source_public_id?: string | number | undefined;
93
119
  last_text_id?: number | undefined;
94
120
  url?: string | undefined;
@@ -105,11 +131,11 @@ export declare const zodSourceSchema: z.ZodObject<{
105
131
  source_id: string | number;
106
132
  source_name: string;
107
133
  _id?: string | undefined;
108
- subscribers?: string[] | undefined;
109
134
  title?: string | undefined;
110
135
  description?: string | undefined;
111
136
  created_at?: number | undefined;
112
137
  updated_at?: number | undefined;
138
+ subscribers?: string[] | undefined;
113
139
  source_public_id?: string | number | undefined;
114
140
  last_text_id?: number | undefined;
115
141
  url?: string | undefined;
@@ -162,9 +188,9 @@ export declare const zodDataSchema: z.ZodObject<{
162
188
  pipeline_name: z.ZodOptional<z.ZodString>;
163
189
  source_region: z.ZodOptional<z.ZodString>;
164
190
  }, "strip", z.ZodTypeAny, {
165
- timestamp: number;
166
191
  created_at: number;
167
192
  updated_at: number;
193
+ timestamp: number;
168
194
  platform: "telegram" | "facebook" | "instagram" | "tiktok" | "website" | "document" | "other";
169
195
  source_id: string | number;
170
196
  source_public_id: string | number;
@@ -193,9 +219,9 @@ export declare const zodDataSchema: z.ZodObject<{
193
219
  author_id?: string | undefined;
194
220
  pipeline_name?: string | undefined;
195
221
  }, {
196
- timestamp: number;
197
222
  created_at: number;
198
223
  updated_at: number;
224
+ timestamp: number;
199
225
  platform: "telegram" | "facebook" | "instagram" | "tiktok" | "website" | "document" | "other";
200
226
  source_id: string | number;
201
227
  source_public_id: string | number;
@@ -281,6 +307,7 @@ export declare const zodQuerySchema: z.ZodObject<{
281
307
  user_id: z.ZodString;
282
308
  thread_id: z.ZodOptional<z.ZodString>;
283
309
  user_time_zone: z.ZodOptional<z.ZodString>;
310
+ timestamp: z.ZodOptional<z.ZodNumber>;
284
311
  }, "strip", z.ZodTypeAny, {
285
312
  user_id: string;
286
313
  time_range: {
@@ -294,6 +321,7 @@ export declare const zodQuerySchema: z.ZodObject<{
294
321
  _id?: string | undefined;
295
322
  title?: string | undefined;
296
323
  geos?: string[] | undefined;
324
+ timestamp?: number | undefined;
297
325
  query?: string | undefined;
298
326
  sources?: string[] | undefined;
299
327
  geos_ids?: string[] | undefined;
@@ -313,6 +341,7 @@ export declare const zodQuerySchema: z.ZodObject<{
313
341
  _id?: string | undefined;
314
342
  title?: string | undefined;
315
343
  geos?: string[] | undefined;
344
+ timestamp?: number | undefined;
316
345
  query?: string | undefined;
317
346
  sources?: string[] | undefined;
318
347
  geos_ids?: string[] | undefined;
@@ -435,8 +464,8 @@ export declare const zodConversationSchema: z.ZodObject<{
435
464
  }, {
436
465
  user_id: string;
437
466
  _id?: string | undefined;
438
- status?: "inactive" | "active" | undefined;
439
467
  title?: string | undefined;
468
+ status?: "inactive" | "active" | undefined;
440
469
  created_at?: number | Date | undefined;
441
470
  updated_at?: number | Date | undefined;
442
471
  thread_id?: string | undefined;
@@ -485,6 +514,7 @@ export declare const zodJobSchema: z.ZodObject<{
485
514
  user_id: z.ZodString;
486
515
  thread_id: z.ZodOptional<z.ZodString>;
487
516
  user_time_zone: z.ZodOptional<z.ZodString>;
517
+ timestamp: z.ZodOptional<z.ZodNumber>;
488
518
  }, "strip", z.ZodTypeAny, {
489
519
  user_id: string;
490
520
  time_range: {
@@ -498,6 +528,7 @@ export declare const zodJobSchema: z.ZodObject<{
498
528
  _id?: string | undefined;
499
529
  title?: string | undefined;
500
530
  geos?: string[] | undefined;
531
+ timestamp?: number | undefined;
501
532
  query?: string | undefined;
502
533
  sources?: string[] | undefined;
503
534
  geos_ids?: string[] | undefined;
@@ -517,6 +548,7 @@ export declare const zodJobSchema: z.ZodObject<{
517
548
  _id?: string | undefined;
518
549
  title?: string | undefined;
519
550
  geos?: string[] | undefined;
551
+ timestamp?: number | undefined;
520
552
  query?: string | undefined;
521
553
  sources?: string[] | undefined;
522
554
  geos_ids?: string[] | undefined;
@@ -544,6 +576,7 @@ export declare const zodJobSchema: z.ZodObject<{
544
576
  _id?: string | undefined;
545
577
  title?: string | undefined;
546
578
  geos?: string[] | undefined;
579
+ timestamp?: number | undefined;
547
580
  query?: string | undefined;
548
581
  sources?: string[] | undefined;
549
582
  geos_ids?: string[] | undefined;
@@ -577,6 +610,7 @@ export declare const zodJobSchema: z.ZodObject<{
577
610
  _id?: string | undefined;
578
611
  title?: string | undefined;
579
612
  geos?: string[] | undefined;
613
+ timestamp?: number | undefined;
580
614
  query?: string | undefined;
581
615
  sources?: string[] | undefined;
582
616
  geos_ids?: string[] | undefined;
package/dist/types.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.zodApiKeySchema = 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;
3
+ exports.zodApiKeySchema = 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.geoSelectionRegionsList = 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,28 @@ exports.statusList = [
19
19
  'in_review', // sources that are under review
20
20
  ];
21
21
  exports.generalStatusList = ['active', 'inactive'];
22
+ exports.geoSelectionRegionsList = {
23
+ iran: {
24
+ title: 'Iran',
25
+ index: 'iran',
26
+ },
27
+ gaza: {
28
+ title: 'Gaza',
29
+ index: 'gaza',
30
+ },
31
+ west_bank: {
32
+ title: 'West Bank',
33
+ index: 'west_bank',
34
+ },
35
+ us_mexico_border: {
36
+ title: 'US-Mexico Border',
37
+ index: 'us_mexico_border',
38
+ },
39
+ lebanon: {
40
+ title: 'Lebanon',
41
+ index: 'lebanon',
42
+ },
43
+ };
22
44
  exports.zodGeoSchema = zod_1.z.object({
23
45
  _id: zod_1.z.string().optional(),
24
46
  geo_text: zod_1.z.string().optional(),
@@ -128,7 +150,8 @@ exports.zodQuerySchema = zod_1.z.object({
128
150
  user_instructions: zod_1.z.string().optional(),
129
151
  user_id: zod_1.z.string().nonempty('User ID must be provided'),
130
152
  thread_id: zod_1.z.string().optional(),
131
- user_time_zone: zod_1.z.string().optional(), // user's timezone
153
+ user_time_zone: zod_1.z.string().optional(),
154
+ timestamp: zod_1.z.number().optional(), // creation date
132
155
  });
133
156
  exports.zodInstructionsSchema = zod_1.z.object({
134
157
  _id: zod_1.z.string().optional(),
package/index.ts CHANGED
@@ -106,6 +106,7 @@ export const MongoQuerySchema = new Schema(
106
106
  user_id: { type: String, required: true }, // user identifier
107
107
  user_instructions: { type: String }, // optional user instructions for the query
108
108
  user_time_zone: { type: String }, // user's timezone
109
+ timestamp: { type: Number, default: Date.now }, // creation date
109
110
  },
110
111
  {
111
112
  versionKey: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asfur",
3
- "version": "1.0.79",
3
+ "version": "1.0.81",
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,34 @@ export const statusList = [
20
20
 
21
21
  export const generalStatusList = ['active', 'inactive'] as const;
22
22
 
23
+ export const geoSelectionRegionsList = {
24
+ iran: {
25
+ title: 'Iran',
26
+ index: 'iran',
27
+ },
28
+ gaza: {
29
+ title: 'Gaza',
30
+ index: 'gaza',
31
+ },
32
+ west_bank: {
33
+ title: 'West Bank',
34
+ index: 'west_bank',
35
+ },
36
+ us_mexico_border: {
37
+ title: 'US-Mexico Border',
38
+ index: 'us_mexico_border',
39
+ },
40
+ lebanon: {
41
+ title: 'Lebanon',
42
+ index: 'lebanon',
43
+ },
44
+ }
45
+
46
+ export type GeoSelectionRegionsType = keyof typeof geoSelectionRegionsList;
47
+
48
+ export type GeoSelectionByRegion = {
49
+ [region in GeoSelectionRegionsType]: GeoSelectionType[];
50
+ };
23
51
 
24
52
  export const zodGeoSchema = z.object({
25
53
  _id: z.string().optional(),
@@ -140,6 +168,7 @@ export const zodQuerySchema = z.object({
140
168
  user_id: z.string().nonempty('User ID must be provided'), // user identifier
141
169
  thread_id: z.string().optional(), // thread ID for the user settings
142
170
  user_time_zone: z.string().optional(), // user's timezone
171
+ timestamp: z.number().optional(), // creation date
143
172
  });
144
173
 
145
174
  export const zodInstructionsSchema = z.object({