asfur 1.0.63 → 1.0.65

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;
@@ -380,16 +383,22 @@ export declare const MongoGeoSchema: Schema<any, import("mongoose").Model<any, a
380
383
  virtuals: true;
381
384
  };
382
385
  }, {
386
+ subscribers: string[];
387
+ is_used: boolean;
383
388
  timestamp?: number | null | undefined;
384
389
  geo_text?: string | null | undefined;
385
390
  count?: number | null | undefined;
386
391
  region?: string | null | undefined;
387
392
  }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
393
+ subscribers: string[];
394
+ is_used: boolean;
388
395
  timestamp?: number | null | undefined;
389
396
  geo_text?: string | null | undefined;
390
397
  count?: number | null | undefined;
391
398
  region?: string | null | undefined;
392
399
  }>, {}> & import("mongoose").FlatRecord<{
400
+ subscribers: string[];
401
+ is_used: boolean;
393
402
  timestamp?: number | null | undefined;
394
403
  geo_text?: string | null | undefined;
395
404
  count?: number | null | undefined;
@@ -399,3 +408,37 @@ export declare const MongoGeoSchema: Schema<any, import("mongoose").Model<any, a
399
408
  } & {
400
409
  __v: number;
401
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
  },
@@ -173,7 +174,21 @@ exports.MongoGeoSchema = new mongoose_1.Schema({
173
174
  geo_text: { type: String },
174
175
  timestamp: { type: Number },
175
176
  count: { type: Number },
176
- region: { type: String }, // e.g., "New York", "California"
177
+ region: { type: String },
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
177
192
  }, {
178
193
  versionKey: false,
179
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;
@@ -529,16 +532,44 @@ export declare const zodGeoSchema: z.ZodObject<{
529
532
  timestamp: z.ZodOptional<z.ZodNumber>;
530
533
  count: z.ZodOptional<z.ZodNumber>;
531
534
  region: z.ZodOptional<z.ZodString>;
535
+ subscribers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
536
+ is_used: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
532
537
  }, "strip", z.ZodTypeAny, {
538
+ is_used: boolean;
539
+ subscribers?: string[] | undefined;
533
540
  timestamp?: number | undefined;
534
541
  geo_text?: string | undefined;
535
542
  count?: number | undefined;
536
543
  region?: string | undefined;
537
544
  }, {
545
+ subscribers?: string[] | undefined;
538
546
  timestamp?: number | undefined;
539
547
  geo_text?: string | undefined;
540
548
  count?: number | undefined;
541
549
  region?: string | undefined;
550
+ is_used?: boolean | undefined;
551
+ }>;
552
+ export declare const zodGeoSelectionSchema: z.ZodObject<{
553
+ title: z.ZodOptional<z.ZodString>;
554
+ description: z.ZodOptional<z.ZodString>;
555
+ geos: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
556
+ region: z.ZodOptional<z.ZodString>;
557
+ created_at: z.ZodOptional<z.ZodNumber>;
558
+ updated_at: z.ZodOptional<z.ZodNumber>;
559
+ }, "strip", z.ZodTypeAny, {
560
+ title?: string | undefined;
561
+ description?: string | undefined;
562
+ created_at?: number | undefined;
563
+ updated_at?: number | undefined;
564
+ geos?: string[] | undefined;
565
+ region?: string | undefined;
566
+ }, {
567
+ title?: string | undefined;
568
+ description?: string | undefined;
569
+ created_at?: number | undefined;
570
+ updated_at?: number | undefined;
571
+ geos?: string[] | undefined;
572
+ region?: string | undefined;
542
573
  }>;
543
574
  export type SourceType = z.infer<typeof zodSourceSchema>;
544
575
  export type DataType = z.infer<typeof zodDataSchema>;
@@ -554,3 +585,4 @@ export type ConversationType = z.infer<typeof zodConversationSchema>;
554
585
  export type JobType = z.infer<typeof zodJobSchema>;
555
586
  export type CronScheduleResponseType = z.infer<typeof zodCronScheduleResponseSchema>;
556
587
  export type GeoType = z.infer<typeof zodGeoSchema>;
588
+ 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'),
@@ -160,5 +161,15 @@ exports.zodGeoSchema = zod_1.z.object({
160
161
  geo_text: zod_1.z.string().optional(),
161
162
  timestamp: zod_1.z.number().optional(),
162
163
  count: zod_1.z.number().optional(),
163
- region: zod_1.z.string().optional(), // e.g., "New York", "California"
164
+ region: zod_1.z.string().optional(),
165
+ subscribers: zod_1.z.array(zod_1.z.string()).optional(),
166
+ is_used: zod_1.z.boolean().optional().default(false), // true if this geo is used in any source
167
+ });
168
+ exports.zodGeoSelectionSchema = zod_1.z.object({
169
+ title: zod_1.z.string().optional(),
170
+ description: zod_1.z.string().optional(),
171
+ geos: zod_1.z.array(zod_1.z.string()).optional(),
172
+ region: zod_1.z.string().optional(),
173
+ created_at: zod_1.z.number().optional(),
174
+ updated_at: zod_1.z.number().optional(), // last update date
164
175
  });
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
  },
@@ -188,6 +189,8 @@ export const MongoGeoSchema = new Schema(
188
189
  timestamp: { type: Number }, // e.g., 1751210833000
189
190
  count: { type: Number }, // e.g., 42
190
191
  region: { type: String }, // e.g., "New York", "California"
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
191
194
  },
192
195
  {
193
196
  versionKey: false,
@@ -195,3 +198,19 @@ export const MongoGeoSchema = new Schema(
195
198
  toObject: { virtuals: true },
196
199
  }
197
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.63",
3
+ "version": "1.0.65",
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
@@ -176,6 +177,17 @@ export const zodGeoSchema = z.object({
176
177
  timestamp: z.number().optional(), // e.g., 1751210833000
177
178
  count: z.number().optional(), // e.g., 42
178
179
  region: z.string().optional(), // e.g., "New York", "California"
180
+ subscribers: z.array(z.string()).optional(), // array of user IDs who subscribed to this geo
181
+ is_used: z.boolean().optional().default(false), // true if this geo is used in any source
182
+ });
183
+
184
+ export const zodGeoSelectionSchema = z.object({
185
+ title: z.string().optional(), // e.g., "New York, USA"
186
+ description: z.string().optional(), // e.g., "A city in the USA"
187
+ geos: z.array(z.string()).optional(), // e.g., ["New York", "Los Angeles"]
188
+ region: z.string().optional(), // e.g., "New York", "California"
189
+ created_at: z.number().optional(), // creation date
190
+ updated_at: z.number().optional(), // last update date
179
191
  });
180
192
 
181
193
  export type SourceType = z.infer<typeof zodSourceSchema>;
@@ -198,4 +210,5 @@ export type JobType = z.infer<typeof zodJobSchema>;
198
210
  export type CronScheduleResponseType = z.infer<
199
211
  typeof zodCronScheduleResponseSchema
200
212
  >;
201
- export type GeoType = z.infer<typeof zodGeoSchema>;
213
+ export type GeoType = z.infer<typeof zodGeoSchema>;
214
+ export type GeoSelectionType = z.infer<typeof zodGeoSelectionSchema>;