asfur 1.0.73 → 1.0.79

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
@@ -44,6 +44,7 @@ export declare const MongoDataSchema: Schema<any, import("mongoose").Model<any,
44
44
  source_name?: string | null | undefined;
45
45
  source_geo?: string | null | undefined;
46
46
  metadata?: any;
47
+ source_region?: string | null | undefined;
47
48
  platform_id?: string | null | undefined;
48
49
  original_text_id?: string | null | undefined;
49
50
  original_text?: string | null | undefined;
@@ -55,6 +56,7 @@ export declare const MongoDataSchema: Schema<any, import("mongoose").Model<any,
55
56
  entities?: any;
56
57
  author_username?: string | null | undefined;
57
58
  author_id?: string | null | undefined;
59
+ pipeline_name?: string | null | undefined;
58
60
  }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
59
61
  timestamp: number;
60
62
  created_at: number;
@@ -66,6 +68,7 @@ export declare const MongoDataSchema: Schema<any, import("mongoose").Model<any,
66
68
  source_name?: string | null | undefined;
67
69
  source_geo?: string | null | undefined;
68
70
  metadata?: any;
71
+ source_region?: string | null | undefined;
69
72
  platform_id?: string | null | undefined;
70
73
  original_text_id?: string | null | undefined;
71
74
  original_text?: string | null | undefined;
@@ -77,6 +80,7 @@ export declare const MongoDataSchema: Schema<any, import("mongoose").Model<any,
77
80
  entities?: any;
78
81
  author_username?: string | null | undefined;
79
82
  author_id?: string | null | undefined;
83
+ pipeline_name?: string | null | undefined;
80
84
  }>, {}> & import("mongoose").FlatRecord<{
81
85
  timestamp: number;
82
86
  created_at: number;
@@ -88,6 +92,7 @@ export declare const MongoDataSchema: Schema<any, import("mongoose").Model<any,
88
92
  source_name?: string | null | undefined;
89
93
  source_geo?: string | null | undefined;
90
94
  metadata?: any;
95
+ source_region?: string | null | undefined;
91
96
  platform_id?: string | null | undefined;
92
97
  original_text_id?: string | null | undefined;
93
98
  original_text?: string | null | undefined;
@@ -99,6 +104,7 @@ export declare const MongoDataSchema: Schema<any, import("mongoose").Model<any,
99
104
  entities?: any;
100
105
  author_username?: string | null | undefined;
101
106
  author_id?: string | null | undefined;
107
+ pipeline_name?: string | null | undefined;
102
108
  }> & {
103
109
  _id: import("mongoose").Types.ObjectId;
104
110
  } & {
@@ -219,6 +225,7 @@ export declare const MongoQuerySchema: Schema<any, import("mongoose").Model<any,
219
225
  title?: string | null | undefined;
220
226
  query?: string | null | undefined;
221
227
  user_instructions?: string | null | undefined;
228
+ user_time_zone?: string | null | undefined;
222
229
  }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
223
230
  geos: string[];
224
231
  user_id: string;
@@ -228,6 +235,7 @@ export declare const MongoQuerySchema: Schema<any, import("mongoose").Model<any,
228
235
  title?: string | null | undefined;
229
236
  query?: string | null | undefined;
230
237
  user_instructions?: string | null | undefined;
238
+ user_time_zone?: string | null | undefined;
231
239
  }>, {}> & import("mongoose").FlatRecord<{
232
240
  geos: string[];
233
241
  user_id: string;
@@ -237,6 +245,7 @@ export declare const MongoQuerySchema: Schema<any, import("mongoose").Model<any,
237
245
  title?: string | null | undefined;
238
246
  query?: string | null | undefined;
239
247
  user_instructions?: string | null | undefined;
248
+ user_time_zone?: string | null | undefined;
240
249
  }> & {
241
250
  _id: import("mongoose").Types.ObjectId;
242
251
  } & {
package/dist/index.js CHANGED
@@ -39,6 +39,8 @@ exports.MongoDataSchema = new mongoose_1.Schema({
39
39
  author_username: String,
40
40
  author_id: String,
41
41
  reply_to_message_id: { type: String || Number },
42
+ pipeline_name: { type: String },
43
+ source_region: { type: String },
42
44
  created_at: { type: Number, default: Date.now },
43
45
  updated_at: { type: Number, default: Date.now },
44
46
  }, {
@@ -104,7 +106,8 @@ exports.MongoQuerySchema = new mongoose_1.Schema({
104
106
  required: true,
105
107
  },
106
108
  user_id: { type: String, required: true },
107
- user_instructions: { type: String }, // optional user instructions for the query
109
+ user_instructions: { type: String },
110
+ user_time_zone: { type: String }, // user's timezone
108
111
  }, {
109
112
  versionKey: false,
110
113
  toJSON: { virtuals: true },
package/dist/types.d.ts CHANGED
@@ -159,6 +159,8 @@ export declare const zodDataSchema: z.ZodObject<{
159
159
  entities: z.ZodOptional<z.ZodAny>;
160
160
  author_username: z.ZodOptional<z.ZodString>;
161
161
  author_id: z.ZodOptional<z.ZodString>;
162
+ pipeline_name: z.ZodOptional<z.ZodString>;
163
+ source_region: z.ZodOptional<z.ZodString>;
162
164
  }, "strip", z.ZodTypeAny, {
163
165
  timestamp: number;
164
166
  created_at: number;
@@ -174,6 +176,7 @@ export declare const zodDataSchema: z.ZodObject<{
174
176
  language?: string | undefined;
175
177
  source_geo?: string | undefined;
176
178
  metadata?: Record<string, any> | undefined;
179
+ source_region?: string | undefined;
177
180
  original_text?: string | undefined;
178
181
  translated_text?: string | undefined;
179
182
  is_reply?: boolean | undefined;
@@ -188,6 +191,7 @@ export declare const zodDataSchema: z.ZodObject<{
188
191
  entities?: any;
189
192
  author_username?: string | undefined;
190
193
  author_id?: string | undefined;
194
+ pipeline_name?: string | undefined;
191
195
  }, {
192
196
  timestamp: number;
193
197
  created_at: number;
@@ -203,6 +207,7 @@ export declare const zodDataSchema: z.ZodObject<{
203
207
  language?: string | undefined;
204
208
  source_geo?: string | undefined;
205
209
  metadata?: Record<string, any> | undefined;
210
+ source_region?: string | undefined;
206
211
  original_text?: string | undefined;
207
212
  translated_text?: string | undefined;
208
213
  is_reply?: boolean | undefined;
@@ -217,6 +222,7 @@ export declare const zodDataSchema: z.ZodObject<{
217
222
  entities?: any;
218
223
  author_username?: string | undefined;
219
224
  author_id?: string | undefined;
225
+ pipeline_name?: string | undefined;
220
226
  }>;
221
227
  export declare const relativeTimeRangeList: readonly ["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", "7_october"];
222
228
  export declare const zodRelativeTimeRangeSchema: z.ZodObject<{
@@ -274,6 +280,7 @@ export declare const zodQuerySchema: z.ZodObject<{
274
280
  user_instructions: z.ZodOptional<z.ZodString>;
275
281
  user_id: z.ZodString;
276
282
  thread_id: z.ZodOptional<z.ZodString>;
283
+ user_time_zone: z.ZodOptional<z.ZodString>;
277
284
  }, "strip", z.ZodTypeAny, {
278
285
  user_id: string;
279
286
  time_range: {
@@ -292,6 +299,7 @@ export declare const zodQuerySchema: z.ZodObject<{
292
299
  geos_ids?: string[] | undefined;
293
300
  user_instructions?: string | undefined;
294
301
  thread_id?: string | undefined;
302
+ user_time_zone?: string | undefined;
295
303
  }, {
296
304
  user_id: string;
297
305
  time_range: {
@@ -310,6 +318,7 @@ export declare const zodQuerySchema: z.ZodObject<{
310
318
  geos_ids?: string[] | undefined;
311
319
  user_instructions?: string | undefined;
312
320
  thread_id?: string | undefined;
321
+ user_time_zone?: string | undefined;
313
322
  }>;
314
323
  export declare const zodInstructionsSchema: z.ZodObject<{
315
324
  _id: z.ZodOptional<z.ZodString>;
@@ -475,6 +484,7 @@ export declare const zodJobSchema: z.ZodObject<{
475
484
  user_instructions: z.ZodOptional<z.ZodString>;
476
485
  user_id: z.ZodString;
477
486
  thread_id: z.ZodOptional<z.ZodString>;
487
+ user_time_zone: z.ZodOptional<z.ZodString>;
478
488
  }, "strip", z.ZodTypeAny, {
479
489
  user_id: string;
480
490
  time_range: {
@@ -493,6 +503,7 @@ export declare const zodJobSchema: z.ZodObject<{
493
503
  geos_ids?: string[] | undefined;
494
504
  user_instructions?: string | undefined;
495
505
  thread_id?: string | undefined;
506
+ user_time_zone?: string | undefined;
496
507
  }, {
497
508
  user_id: string;
498
509
  time_range: {
@@ -511,6 +522,7 @@ export declare const zodJobSchema: z.ZodObject<{
511
522
  geos_ids?: string[] | undefined;
512
523
  user_instructions?: string | undefined;
513
524
  thread_id?: string | undefined;
525
+ user_time_zone?: string | undefined;
514
526
  }>;
515
527
  active_until: z.ZodOptional<z.ZodUnion<[z.ZodDate, z.ZodNumber]>>;
516
528
  conversation_id: z.ZodOptional<z.ZodString>;
@@ -537,6 +549,7 @@ export declare const zodJobSchema: z.ZodObject<{
537
549
  geos_ids?: string[] | undefined;
538
550
  user_instructions?: string | undefined;
539
551
  thread_id?: string | undefined;
552
+ user_time_zone?: string | undefined;
540
553
  };
541
554
  job_name: string;
542
555
  _id?: string | undefined;
@@ -569,6 +582,7 @@ export declare const zodJobSchema: z.ZodObject<{
569
582
  geos_ids?: string[] | undefined;
570
583
  user_instructions?: string | undefined;
571
584
  thread_id?: string | undefined;
585
+ user_time_zone?: string | undefined;
572
586
  };
573
587
  job_name: string;
574
588
  _id?: string | undefined;
@@ -621,6 +635,13 @@ export declare const zodApiKeySchema: z.ZodObject<{
621
635
  created_at?: number | undefined;
622
636
  updated_at?: number | undefined;
623
637
  }>;
638
+ /**
639
+ * 'approved' - active and approved sources,
640
+ * 'back_to_business' - sources that were paused and now resumed,
641
+ * 'pending' - sources that are pending approval,
642
+ * 'inactive' - sources that are inactive,
643
+ * 'in_review' - sources that are under review
644
+ */
624
645
  export type SourceType = z.infer<typeof zodSourceSchema>;
625
646
  export type DataType = z.infer<typeof zodDataSchema>;
626
647
  export type QueryType = z.infer<typeof zodQuerySchema>;
package/dist/types.js CHANGED
@@ -16,7 +16,7 @@ exports.statusList = [
16
16
  'back_to_business',
17
17
  'pending',
18
18
  'inactive',
19
- 'in_review',
19
+ 'in_review', // sources that are under review
20
20
  ];
21
21
  exports.generalStatusList = ['active', 'inactive'];
22
22
  exports.zodGeoSchema = zod_1.z.object({
@@ -91,7 +91,9 @@ exports.zodDataSchema = zod_1.z.object({
91
91
  replies: zod_1.z.any().optional(),
92
92
  entities: zod_1.z.any().optional(),
93
93
  author_username: zod_1.z.string().optional(),
94
- author_id: zod_1.z.string().optional(), // e.g., author ID
94
+ author_id: zod_1.z.string().optional(),
95
+ pipeline_name: zod_1.z.string().optional(),
96
+ source_region: zod_1.z.string().optional(), // e.g., "New York", "California"
95
97
  });
96
98
  exports.relativeTimeRangeList = [
97
99
  // 'last_10_minutes',
@@ -125,7 +127,8 @@ exports.zodQuerySchema = zod_1.z.object({
125
127
  time_range: exports.zodRelativeTimeRangeSchema.or(exports.zodAbsoluteTimeRangeSchema),
126
128
  user_instructions: zod_1.z.string().optional(),
127
129
  user_id: zod_1.z.string().nonempty('User ID must be provided'),
128
- thread_id: zod_1.z.string().optional(), // thread ID for the user settings
130
+ thread_id: zod_1.z.string().optional(),
131
+ user_time_zone: zod_1.z.string().optional(), // user's timezone
129
132
  });
130
133
  exports.zodInstructionsSchema = zod_1.z.object({
131
134
  _id: zod_1.z.string().optional(),
package/index.ts CHANGED
@@ -25,6 +25,8 @@ export const MongoDataSchema = new Schema(
25
25
  author_username: String,
26
26
  author_id: String,
27
27
  reply_to_message_id: { type: String || Number },
28
+ pipeline_name: { type: String },
29
+ source_region: { type: String },
28
30
  created_at: { type: Number, default: Date.now },
29
31
  updated_at: { type: Number, default: Date.now },
30
32
  },
@@ -103,6 +105,7 @@ export const MongoQuerySchema = new Schema(
103
105
  },
104
106
  user_id: { type: String, required: true }, // user identifier
105
107
  user_instructions: { type: String }, // optional user instructions for the query
108
+ user_time_zone: { type: String }, // user's timezone
106
109
  },
107
110
  {
108
111
  versionKey: false,
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "asfur",
3
- "version": "1.0.73",
3
+ "version": "1.0.79",
4
4
  "description": "SDK for interacting with the Asfur API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "repository": {
8
- "url": "https://github.com/eretztzvi/asfur.sdk",
8
+ "url": "git+https://github.com/badgerdefense/asfur.sdk.git",
9
9
  "type": "git"
10
10
  },
11
11
  "scripts": {
package/types.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { z } from 'zod';
1
+ import { pipeline, z } from 'zod';
2
2
 
3
3
  export const platformsList = [
4
4
  'telegram',
@@ -11,11 +11,11 @@ export const platformsList = [
11
11
  ] as const;
12
12
 
13
13
  export const statusList = [
14
- 'approved',
15
- 'back_to_business',
16
- 'pending',
17
- 'inactive',
18
- 'in_review',
14
+ 'approved', // active and approved sources
15
+ 'back_to_business', // sources that were paused and now resumed
16
+ 'pending', // sources that are pending approval
17
+ 'inactive', // sources that are inactive
18
+ 'in_review', // sources that are under review
19
19
  ] as const;
20
20
 
21
21
  export const generalStatusList = ['active', 'inactive'] as const;
@@ -99,6 +99,8 @@ export const zodDataSchema = z.object({
99
99
  entities: z.any().optional(), // array of reply texts or IDs
100
100
  author_username: z.string().optional(), // e.g., author username
101
101
  author_id: z.string().optional(), // e.g., author ID
102
+ pipeline_name: z.string().optional(), // e.g., 'default_pipeline'
103
+ source_region: z.string().optional(), // e.g., "New York", "California"
102
104
  });
103
105
 
104
106
  export const relativeTimeRangeList = [
@@ -137,6 +139,7 @@ export const zodQuerySchema = z.object({
137
139
  user_instructions: z.string().optional(), // optional user instructions for the query
138
140
  user_id: z.string().nonempty('User ID must be provided'), // user identifier
139
141
  thread_id: z.string().optional(), // thread ID for the user settings
142
+ user_time_zone: z.string().optional(), // user's timezone
140
143
  });
141
144
 
142
145
  export const zodInstructionsSchema = z.object({
@@ -207,6 +210,13 @@ export const zodApiKeySchema = z.object({
207
210
  status: z.enum(generalStatusList).default('active'), // status of the API key
208
211
  });
209
212
 
213
+ /**
214
+ * 'approved' - active and approved sources,
215
+ * 'back_to_business' - sources that were paused and now resumed,
216
+ * 'pending' - sources that are pending approval,
217
+ * 'inactive' - sources that are inactive,
218
+ * 'in_review' - sources that are under review
219
+ */
210
220
  export type SourceType = z.infer<typeof zodSourceSchema>;
211
221
  export type DataType = z.infer<typeof zodDataSchema>;
212
222
  export type QueryType = z.infer<typeof zodQuerySchema>;