asfur 1.0.64 → 1.0.66

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
@@ -247,6 +247,7 @@ export declare const MongoUserSettingsSchema: Schema<any, import("mongoose").Mod
247
247
  updated_at: NativeDate;
248
248
  user_id: string;
249
249
  sources: string[];
250
+ geos: string[];
250
251
  has_jobs_access: boolean;
251
252
  active_jobs_limit: number;
252
253
  time_range?: any;
@@ -258,6 +259,7 @@ export declare const MongoUserSettingsSchema: Schema<any, import("mongoose").Mod
258
259
  updated_at: NativeDate;
259
260
  user_id: string;
260
261
  sources: string[];
262
+ geos: string[];
261
263
  has_jobs_access: boolean;
262
264
  active_jobs_limit: number;
263
265
  time_range?: any;
@@ -269,6 +271,7 @@ export declare const MongoUserSettingsSchema: Schema<any, import("mongoose").Mod
269
271
  updated_at: NativeDate;
270
272
  user_id: string;
271
273
  sources: string[];
274
+ geos: string[];
272
275
  has_jobs_access: boolean;
273
276
  active_jobs_limit: number;
274
277
  time_range?: any;
@@ -381,18 +384,21 @@ export declare const MongoGeoSchema: Schema<any, import("mongoose").Model<any, a
381
384
  };
382
385
  }, {
383
386
  subscribers: string[];
387
+ is_used: boolean;
384
388
  timestamp?: number | null | undefined;
385
389
  geo_text?: string | null | undefined;
386
390
  count?: number | null | undefined;
387
391
  region?: string | null | undefined;
388
392
  }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
389
393
  subscribers: string[];
394
+ is_used: boolean;
390
395
  timestamp?: number | null | undefined;
391
396
  geo_text?: string | null | undefined;
392
397
  count?: number | null | undefined;
393
398
  region?: string | null | undefined;
394
399
  }>, {}> & import("mongoose").FlatRecord<{
395
400
  subscribers: string[];
401
+ is_used: boolean;
396
402
  timestamp?: number | null | undefined;
397
403
  geo_text?: string | null | undefined;
398
404
  count?: number | null | undefined;
@@ -402,3 +408,37 @@ export declare const MongoGeoSchema: Schema<any, import("mongoose").Model<any, a
402
408
  } & {
403
409
  __v: number;
404
410
  }>;
411
+ export declare const MongoGeoSelectionSchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
412
+ versionKey: false;
413
+ toJSON: {
414
+ virtuals: true;
415
+ };
416
+ toObject: {
417
+ virtuals: true;
418
+ };
419
+ }, {
420
+ geos: string[];
421
+ title?: string | null | undefined;
422
+ description?: string | null | undefined;
423
+ created_at?: number | null | undefined;
424
+ updated_at?: number | null | undefined;
425
+ region?: string | null | undefined;
426
+ }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
427
+ geos: string[];
428
+ title?: string | null | undefined;
429
+ description?: string | null | undefined;
430
+ created_at?: number | null | undefined;
431
+ updated_at?: number | null | undefined;
432
+ region?: string | null | undefined;
433
+ }>, {}> & import("mongoose").FlatRecord<{
434
+ geos: string[];
435
+ title?: string | null | undefined;
436
+ description?: string | null | undefined;
437
+ created_at?: number | null | undefined;
438
+ updated_at?: number | null | undefined;
439
+ region?: string | null | undefined;
440
+ }> & {
441
+ _id: import("mongoose").Types.ObjectId;
442
+ } & {
443
+ __v: number;
444
+ }>;
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.MongoGeoSchema = exports.MongoJobSchema = exports.MongoConversationSchema = exports.MongoUserSettingsSchema = exports.MongoQuerySchema = exports.MongoSourceSchema = exports.MongoInstructionsSchema = exports.MongoDataSchema = void 0;
17
+ exports.MongoGeoSelectionSchema = exports.MongoGeoSchema = exports.MongoJobSchema = exports.MongoConversationSchema = exports.MongoUserSettingsSchema = exports.MongoQuerySchema = exports.MongoSourceSchema = exports.MongoInstructionsSchema = exports.MongoDataSchema = void 0;
18
18
  // Export types for consumers
19
19
  __exportStar(require("./types"), exports);
20
20
  const mongoose_1 = require("mongoose");
@@ -109,6 +109,7 @@ exports.MongoQuerySchema = new mongoose_1.Schema({
109
109
  });
110
110
  exports.MongoUserSettingsSchema = new mongoose_1.Schema({
111
111
  sources: { type: [String] },
112
+ geos: { type: [String], default: [] },
112
113
  time_range: {
113
114
  type: mongoose_1.Schema.Types.Mixed,
114
115
  },
@@ -174,7 +175,20 @@ exports.MongoGeoSchema = new mongoose_1.Schema({
174
175
  timestamp: { type: Number },
175
176
  count: { type: Number },
176
177
  region: { type: String },
177
- subscribers: { type: [String], default: [] }, // array of user IDs who subscribed to this geo
178
+ subscribers: { type: [String], default: [] },
179
+ is_used: { type: Boolean, default: false }, // true if this geo is used in any source
180
+ }, {
181
+ versionKey: false,
182
+ toJSON: { virtuals: true },
183
+ toObject: { virtuals: true },
184
+ });
185
+ exports.MongoGeoSelectionSchema = new mongoose_1.Schema({
186
+ title: { type: String },
187
+ description: { type: String },
188
+ geos: { type: [String], default: [] },
189
+ region: { type: String },
190
+ created_at: { type: Number },
191
+ updated_at: { type: Number }, // last update date
178
192
  }, {
179
193
  versionKey: false,
180
194
  toJSON: { virtuals: true },
package/dist/types.d.ts CHANGED
@@ -271,6 +271,7 @@ export declare const zodInstructionsSchema: z.ZodObject<{
271
271
  export declare const zodUserSettingsSchema: z.ZodObject<{
272
272
  _id: z.ZodOptional<z.ZodString>;
273
273
  sources: z.ZodArray<z.ZodString, "many">;
274
+ geos: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
274
275
  time_range: z.ZodUnion<[z.ZodObject<{
275
276
  type: z.ZodLiteral<"relative">;
276
277
  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"]>;
@@ -319,6 +320,7 @@ export declare const zodUserSettingsSchema: z.ZodObject<{
319
320
  created_at?: number | Date | undefined;
320
321
  updated_at?: number | Date | undefined;
321
322
  thread_id?: string | undefined;
323
+ geos?: string[] | undefined;
322
324
  instructions?: string | undefined;
323
325
  }, {
324
326
  user_id: string;
@@ -336,6 +338,7 @@ export declare const zodUserSettingsSchema: z.ZodObject<{
336
338
  created_at?: number | Date | undefined;
337
339
  updated_at?: number | Date | undefined;
338
340
  thread_id?: string | undefined;
341
+ geos?: string[] | undefined;
339
342
  instructions?: string | undefined;
340
343
  has_jobs_access?: boolean | undefined;
341
344
  active_jobs_limit?: number | undefined;
@@ -525,23 +528,54 @@ export declare const zodCronScheduleResponseSchema: z.ZodObject<{
525
528
  error?: string | undefined;
526
529
  }>;
527
530
  export declare const zodGeoSchema: z.ZodObject<{
531
+ _id: z.ZodOptional<z.ZodString>;
528
532
  geo_text: z.ZodOptional<z.ZodString>;
529
533
  timestamp: z.ZodOptional<z.ZodNumber>;
530
534
  count: z.ZodOptional<z.ZodNumber>;
531
535
  region: z.ZodOptional<z.ZodString>;
532
536
  subscribers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
537
+ is_used: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
533
538
  }, "strip", z.ZodTypeAny, {
539
+ is_used: boolean;
540
+ _id?: string | undefined;
534
541
  subscribers?: string[] | undefined;
535
542
  timestamp?: number | undefined;
536
543
  geo_text?: string | undefined;
537
544
  count?: number | undefined;
538
545
  region?: string | undefined;
539
546
  }, {
547
+ _id?: string | undefined;
540
548
  subscribers?: string[] | undefined;
541
549
  timestamp?: number | undefined;
542
550
  geo_text?: string | undefined;
543
551
  count?: number | undefined;
544
552
  region?: string | undefined;
553
+ is_used?: boolean | undefined;
554
+ }>;
555
+ export declare const zodGeoSelectionSchema: z.ZodObject<{
556
+ _id: z.ZodOptional<z.ZodString>;
557
+ title: z.ZodOptional<z.ZodString>;
558
+ description: z.ZodOptional<z.ZodString>;
559
+ geos: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
560
+ region: z.ZodOptional<z.ZodString>;
561
+ created_at: z.ZodOptional<z.ZodNumber>;
562
+ updated_at: z.ZodOptional<z.ZodNumber>;
563
+ }, "strip", z.ZodTypeAny, {
564
+ _id?: string | undefined;
565
+ title?: string | undefined;
566
+ description?: string | undefined;
567
+ created_at?: number | undefined;
568
+ updated_at?: number | undefined;
569
+ geos?: string[] | undefined;
570
+ region?: string | undefined;
571
+ }, {
572
+ _id?: string | undefined;
573
+ title?: string | undefined;
574
+ description?: string | undefined;
575
+ created_at?: number | undefined;
576
+ updated_at?: number | undefined;
577
+ geos?: string[] | undefined;
578
+ region?: string | undefined;
545
579
  }>;
546
580
  export type SourceType = z.infer<typeof zodSourceSchema>;
547
581
  export type DataType = z.infer<typeof zodDataSchema>;
@@ -557,3 +591,4 @@ export type ConversationType = z.infer<typeof zodConversationSchema>;
557
591
  export type JobType = z.infer<typeof zodJobSchema>;
558
592
  export type CronScheduleResponseType = z.infer<typeof zodCronScheduleResponseSchema>;
559
593
  export type GeoType = z.infer<typeof zodGeoSchema>;
594
+ export type GeoSelectionType = z.infer<typeof zodGeoSelectionSchema>;
package/dist/types.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- 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.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;
4
4
  const zod_1 = require("zod");
5
5
  exports.platformsList = [
6
6
  'telegram',
@@ -114,6 +114,7 @@ exports.zodInstructionsSchema = zod_1.z.object({
114
114
  exports.zodUserSettingsSchema = zod_1.z.object({
115
115
  _id: zod_1.z.string().optional(),
116
116
  sources: zod_1.z.array(zod_1.z.string()),
117
+ geos: zod_1.z.array(zod_1.z.string()).optional(),
117
118
  time_range: exports.zodRelativeTimeRangeSchema.or(exports.zodAbsoluteTimeRangeSchema),
118
119
  thread_id: zod_1.z.string().optional(),
119
120
  user_id: zod_1.z.string().nonempty('User ID must be provided'),
@@ -157,9 +158,20 @@ exports.zodCronScheduleResponseSchema = zod_1.z.object({
157
158
  error: zod_1.z.string().optional(), // error message if the cron job is invalid
158
159
  });
159
160
  exports.zodGeoSchema = zod_1.z.object({
161
+ _id: zod_1.z.string().optional(),
160
162
  geo_text: zod_1.z.string().optional(),
161
163
  timestamp: zod_1.z.number().optional(),
162
164
  count: zod_1.z.number().optional(),
163
165
  region: zod_1.z.string().optional(),
164
- subscribers: zod_1.z.array(zod_1.z.string()).optional(), // array of user IDs who subscribed to this geo
166
+ subscribers: zod_1.z.array(zod_1.z.string()).optional(),
167
+ is_used: zod_1.z.boolean().optional().default(false), // true if this geo is used in any source
168
+ });
169
+ exports.zodGeoSelectionSchema = zod_1.z.object({
170
+ _id: zod_1.z.string().optional(),
171
+ title: zod_1.z.string().optional(),
172
+ description: zod_1.z.string().optional(),
173
+ geos: zod_1.z.array(zod_1.z.string()).optional(),
174
+ region: zod_1.z.string().optional(),
175
+ created_at: zod_1.z.number().optional(),
176
+ updated_at: zod_1.z.number().optional(), // last update date
165
177
  });
package/index.ts CHANGED
@@ -111,6 +111,7 @@ export const MongoQuerySchema = new Schema(
111
111
  export const MongoUserSettingsSchema = new Schema(
112
112
  {
113
113
  sources: { type: [String] }, // array of source _id strings
114
+ geos: { type: [String], default: [] }, // array of geo strings
114
115
  time_range: {
115
116
  type: Schema.Types.Mixed,
116
117
  },
@@ -189,6 +190,7 @@ export const MongoGeoSchema = new Schema(
189
190
  count: { type: Number }, // e.g., 42
190
191
  region: { type: String }, // e.g., "New York", "California"
191
192
  subscribers: { type: [String], default: [] }, // array of user IDs who subscribed to this geo
193
+ is_used: { type: Boolean, default: false }, // true if this geo is used in any source
192
194
  },
193
195
  {
194
196
  versionKey: false,
@@ -196,3 +198,19 @@ export const MongoGeoSchema = new Schema(
196
198
  toObject: { virtuals: true },
197
199
  }
198
200
  );
201
+
202
+ export const MongoGeoSelectionSchema = new Schema(
203
+ {
204
+ title: { type: String }, // e.g., "New York, USA"
205
+ description: { type: String }, // e.g., "A city in the USA"
206
+ geos: { type: [String], default: [] }, // e.g., ["New York", "Los Angeles"]
207
+ region: { type: String }, // e.g., "New York", "California"
208
+ created_at: { type: Number }, // creation date
209
+ updated_at: { type: Number }, // last update date
210
+ },
211
+ {
212
+ versionKey: false,
213
+ toJSON: { virtuals: true },
214
+ toObject: { virtuals: true },
215
+ }
216
+ );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asfur",
3
- "version": "1.0.64",
3
+ "version": "1.0.66",
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
@@ -124,6 +124,7 @@ export const zodInstructionsSchema = z.object({
124
124
  export const zodUserSettingsSchema = z.object({
125
125
  _id: z.string().optional(),
126
126
  sources: z.array(z.string()), // array of source _id strings
127
+ geos: z.array(z.string()).optional(), // array of geo strings
127
128
  time_range: zodRelativeTimeRangeSchema.or(zodAbsoluteTimeRangeSchema), // optional time range for the query
128
129
  thread_id: z.string().optional(), // thread ID for the user settings
129
130
  user_id: z.string().nonempty('User ID must be provided'), // user identifier
@@ -172,11 +173,23 @@ export const zodCronScheduleResponseSchema = z.object({
172
173
  });
173
174
 
174
175
  export const zodGeoSchema = z.object({
176
+ _id: z.string().optional(),
175
177
  geo_text: z.string().optional(), // e.g., "New York, USA"
176
178
  timestamp: z.number().optional(), // e.g., 1751210833000
177
179
  count: z.number().optional(), // e.g., 42
178
180
  region: z.string().optional(), // e.g., "New York", "California"
179
181
  subscribers: z.array(z.string()).optional(), // array of user IDs who subscribed to this geo
182
+ is_used: z.boolean().optional().default(false), // true if this geo is used in any source
183
+ });
184
+
185
+ export const zodGeoSelectionSchema = z.object({
186
+ _id: z.string().optional(),
187
+ title: z.string().optional(), // e.g., "New York, USA"
188
+ description: z.string().optional(), // e.g., "A city in the USA"
189
+ geos: z.array(z.string()).optional(), // e.g., ["New York", "Los Angeles"]
190
+ region: z.string().optional(), // e.g., "New York", "California"
191
+ created_at: z.number().optional(), // creation date
192
+ updated_at: z.number().optional(), // last update date
180
193
  });
181
194
 
182
195
  export type SourceType = z.infer<typeof zodSourceSchema>;
@@ -199,4 +212,5 @@ export type JobType = z.infer<typeof zodJobSchema>;
199
212
  export type CronScheduleResponseType = z.infer<
200
213
  typeof zodCronScheduleResponseSchema
201
214
  >;
202
- export type GeoType = z.infer<typeof zodGeoSchema>;
215
+ export type GeoType = z.infer<typeof zodGeoSchema>;
216
+ export type GeoSelectionType = z.infer<typeof zodGeoSelectionSchema>;