asfur 1.0.31 → 1.0.33

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
@@ -628,24 +628,32 @@ export declare const MongoConversationSchema: Schema<{
628
628
  user_id: string;
629
629
  _id?: string | undefined;
630
630
  title?: string | undefined;
631
+ created_at?: number | Date | undefined;
632
+ updated_at?: number | Date | undefined;
631
633
  thread_id?: string | undefined;
632
634
  }, import("mongoose").Model<{
633
635
  status: "inactive" | "active";
634
636
  user_id: string;
635
637
  _id?: string | undefined;
636
638
  title?: string | undefined;
639
+ created_at?: number | Date | undefined;
640
+ updated_at?: number | Date | undefined;
637
641
  thread_id?: string | undefined;
638
642
  }, any, any, any, import("mongoose").Document<unknown, any, {
639
643
  status: "inactive" | "active";
640
644
  user_id: string;
641
645
  _id?: string | undefined;
642
646
  title?: string | undefined;
647
+ created_at?: number | Date | undefined;
648
+ updated_at?: number | Date | undefined;
643
649
  thread_id?: string | undefined;
644
650
  }, any> & {
645
651
  status: "inactive" | "active";
646
652
  user_id: string;
647
653
  _id?: string | undefined;
648
654
  title?: string | undefined;
655
+ created_at?: number | Date | undefined;
656
+ updated_at?: number | Date | undefined;
649
657
  thread_id?: string | undefined;
650
658
  } & Required<{
651
659
  _id: string;
@@ -656,18 +664,24 @@ export declare const MongoConversationSchema: Schema<{
656
664
  user_id: string;
657
665
  _id?: string | undefined;
658
666
  title?: string | undefined;
667
+ created_at?: number | Date | undefined;
668
+ updated_at?: number | Date | undefined;
659
669
  thread_id?: string | undefined;
660
670
  }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
661
671
  status: "inactive" | "active";
662
672
  user_id: string;
663
673
  _id?: string | undefined;
664
674
  title?: string | undefined;
675
+ created_at?: number | Date | undefined;
676
+ updated_at?: number | Date | undefined;
665
677
  thread_id?: string | undefined;
666
678
  }>, {}> & import("mongoose").FlatRecord<{
667
679
  status: "inactive" | "active";
668
680
  user_id: string;
669
681
  _id?: string | undefined;
670
682
  title?: string | undefined;
683
+ created_at?: number | Date | undefined;
684
+ updated_at?: number | Date | undefined;
671
685
  thread_id?: string | undefined;
672
686
  }> & Required<{
673
687
  _id: string;
package/dist/index.js CHANGED
@@ -126,7 +126,9 @@ exports.MongoConversationSchema = new mongoose_1.Schema({
126
126
  type: String,
127
127
  enum: types_1.generalStatusList,
128
128
  default: 'active',
129
- }, // status of the conversation
129
+ },
130
+ created_at: { type: Date, default: Date.now },
131
+ updated_at: { type: Date, default: Date.now }, // last update date
130
132
  }, {
131
133
  versionKey: false,
132
134
  toJSON: { virtuals: true },
package/dist/types.d.ts CHANGED
@@ -310,19 +310,150 @@ export declare const zodConversationSchema: z.ZodObject<{
310
310
  title: z.ZodOptional<z.ZodString>;
311
311
  thread_id: z.ZodOptional<z.ZodString>;
312
312
  status: z.ZodDefault<z.ZodEnum<["active", "inactive"]>>;
313
+ created_at: z.ZodOptional<z.ZodUnion<[z.ZodDate, z.ZodNumber]>>;
314
+ updated_at: z.ZodOptional<z.ZodUnion<[z.ZodDate, z.ZodNumber]>>;
313
315
  }, "strip", z.ZodTypeAny, {
314
316
  status: "inactive" | "active";
315
317
  user_id: string;
316
318
  _id?: string | undefined;
317
319
  title?: string | undefined;
320
+ created_at?: number | Date | undefined;
321
+ updated_at?: number | Date | undefined;
318
322
  thread_id?: string | undefined;
319
323
  }, {
320
324
  user_id: string;
321
325
  _id?: string | undefined;
322
326
  title?: string | undefined;
323
327
  status?: "inactive" | "active" | undefined;
328
+ created_at?: number | Date | undefined;
329
+ updated_at?: number | Date | undefined;
324
330
  thread_id?: string | undefined;
325
331
  }>;
332
+ export declare const zodAutomationJobSchema: z.ZodObject<{
333
+ _id: z.ZodOptional<z.ZodString>;
334
+ job_name: z.ZodString;
335
+ job_description: z.ZodOptional<z.ZodString>;
336
+ created_at: z.ZodOptional<z.ZodUnion<[z.ZodDate, z.ZodNumber]>>;
337
+ updated_at: z.ZodOptional<z.ZodUnion<[z.ZodDate, z.ZodNumber]>>;
338
+ schedule: z.ZodOptional<z.ZodString>;
339
+ status: z.ZodDefault<z.ZodEnum<["active", "inactive"]>>;
340
+ user_id: z.ZodString;
341
+ query: z.ZodObject<{
342
+ _id: z.ZodOptional<z.ZodString>;
343
+ title: z.ZodOptional<z.ZodString>;
344
+ query: z.ZodOptional<z.ZodString>;
345
+ sources: z.ZodArray<z.ZodString, "many">;
346
+ time_range: z.ZodUnion<[z.ZodObject<{
347
+ type: z.ZodLiteral<"relative">;
348
+ time: z.ZodEnum<["last_12_hours", "last_24_hours", "last_48_hours", "last_72_hours", "last_week"]>;
349
+ }, "strip", z.ZodTypeAny, {
350
+ type: "relative";
351
+ time: "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
352
+ }, {
353
+ type: "relative";
354
+ time: "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
355
+ }>, z.ZodObject<{
356
+ type: z.ZodLiteral<"absolute">;
357
+ start: z.ZodUnion<[z.ZodDate, z.ZodNumber]>;
358
+ end: z.ZodUnion<[z.ZodDate, z.ZodNumber]>;
359
+ }, "strip", z.ZodTypeAny, {
360
+ type: "absolute";
361
+ start: number | Date;
362
+ end: number | Date;
363
+ }, {
364
+ type: "absolute";
365
+ start: number | Date;
366
+ end: number | Date;
367
+ }>]>;
368
+ user_instructions: z.ZodOptional<z.ZodString>;
369
+ user_id: z.ZodString;
370
+ thread_id: z.ZodOptional<z.ZodString>;
371
+ }, "strip", z.ZodTypeAny, {
372
+ user_id: string;
373
+ sources: string[];
374
+ time_range: {
375
+ type: "relative";
376
+ time: "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
377
+ } | {
378
+ type: "absolute";
379
+ start: number | Date;
380
+ end: number | Date;
381
+ };
382
+ _id?: string | undefined;
383
+ title?: string | undefined;
384
+ query?: string | undefined;
385
+ user_instructions?: string | undefined;
386
+ thread_id?: string | undefined;
387
+ }, {
388
+ user_id: string;
389
+ sources: string[];
390
+ time_range: {
391
+ type: "relative";
392
+ time: "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
393
+ } | {
394
+ type: "absolute";
395
+ start: number | Date;
396
+ end: number | Date;
397
+ };
398
+ _id?: string | undefined;
399
+ title?: string | undefined;
400
+ query?: string | undefined;
401
+ user_instructions?: string | undefined;
402
+ thread_id?: string | undefined;
403
+ }>;
404
+ }, "strip", z.ZodTypeAny, {
405
+ status: "inactive" | "active";
406
+ user_id: string;
407
+ query: {
408
+ user_id: string;
409
+ sources: string[];
410
+ time_range: {
411
+ type: "relative";
412
+ time: "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
413
+ } | {
414
+ type: "absolute";
415
+ start: number | Date;
416
+ end: number | Date;
417
+ };
418
+ _id?: string | undefined;
419
+ title?: string | undefined;
420
+ query?: string | undefined;
421
+ user_instructions?: string | undefined;
422
+ thread_id?: string | undefined;
423
+ };
424
+ job_name: string;
425
+ _id?: string | undefined;
426
+ created_at?: number | Date | undefined;
427
+ updated_at?: number | Date | undefined;
428
+ job_description?: string | undefined;
429
+ schedule?: string | undefined;
430
+ }, {
431
+ user_id: string;
432
+ query: {
433
+ user_id: string;
434
+ sources: string[];
435
+ time_range: {
436
+ type: "relative";
437
+ time: "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
438
+ } | {
439
+ type: "absolute";
440
+ start: number | Date;
441
+ end: number | Date;
442
+ };
443
+ _id?: string | undefined;
444
+ title?: string | undefined;
445
+ query?: string | undefined;
446
+ user_instructions?: string | undefined;
447
+ thread_id?: string | undefined;
448
+ };
449
+ job_name: string;
450
+ _id?: string | undefined;
451
+ status?: "inactive" | "active" | undefined;
452
+ created_at?: number | Date | undefined;
453
+ updated_at?: number | Date | undefined;
454
+ job_description?: string | undefined;
455
+ schedule?: string | undefined;
456
+ }>;
326
457
  export type SourceType = z.infer<typeof zodSourceSchema>;
327
458
  export type DataType = z.infer<typeof zodDataSchema>;
328
459
  export type QueryType = z.infer<typeof zodQuerySchema>;
@@ -334,3 +465,4 @@ export type RelativeTimeRangeType = (typeof relativeTimeRangeList)[number];
334
465
  export type AddSourceToReviewType = Pick<SourceType, 'platform' | 'url' | 'description' | 'source_public_id'>;
335
466
  export type UserSettingsType = z.infer<typeof zodUserSettingsSchema>;
336
467
  export type ConversationType = z.infer<typeof zodConversationSchema>;
468
+ export type AutomationJobType = z.infer<typeof zodAutomationJobSchema>;
package/dist/types.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- 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.zodAutomationJobSchema = 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',
@@ -117,5 +117,18 @@ exports.zodConversationSchema = zod_1.z.object({
117
117
  user_id: zod_1.z.string().nonempty('User ID must be provided'),
118
118
  title: zod_1.z.string().optional(),
119
119
  thread_id: zod_1.z.string().optional(),
120
- status: zod_1.z.enum(exports.generalStatusList).default('active'), // status of the conversation
120
+ status: zod_1.z.enum(exports.generalStatusList).default('active'),
121
+ created_at: zod_1.z.coerce.date().or(zod_1.z.number()).optional(),
122
+ updated_at: zod_1.z.coerce.date().or(zod_1.z.number()).optional(), // last update date
123
+ });
124
+ exports.zodAutomationJobSchema = zod_1.z.object({
125
+ _id: zod_1.z.string().optional(),
126
+ job_name: zod_1.z.string().nonempty('Job name must be provided'),
127
+ job_description: zod_1.z.string().optional(),
128
+ created_at: zod_1.z.coerce.date().or(zod_1.z.number()).optional(),
129
+ updated_at: zod_1.z.coerce.date().or(zod_1.z.number()).optional(),
130
+ schedule: zod_1.z.string().optional(),
131
+ status: zod_1.z.enum(exports.generalStatusList).default('active'),
132
+ user_id: zod_1.z.string().nonempty('User ID must be provided'),
133
+ query: exports.zodQuerySchema, // query associated with the job
121
134
  });
package/index.ts CHANGED
@@ -141,6 +141,8 @@ export const MongoConversationSchema = new Schema<ConversationType>(
141
141
  enum: generalStatusList,
142
142
  default: 'active',
143
143
  }, // status of the conversation
144
+ created_at: { type: Date, default: Date.now }, // creation date
145
+ updated_at: { type: Date, default: Date.now }, // last update date
144
146
  },
145
147
  {
146
148
  versionKey: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asfur",
3
- "version": "1.0.31",
3
+ "version": "1.0.33",
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
@@ -129,6 +129,20 @@ export const zodConversationSchema = z.object({
129
129
  title: z.string().optional(), // optional title for the conversation
130
130
  thread_id: z.string().optional(), // thread ID for the conversation
131
131
  status: z.enum(generalStatusList).default('active'), // status of the conversation
132
+ created_at: z.coerce.date().or(z.number()).optional(), // creation date
133
+ updated_at: z.coerce.date().or(z.number()).optional(), // last update date
134
+ });
135
+
136
+ export const zodAutomationJobSchema = z.object({
137
+ _id: z.string().optional(),
138
+ job_name: z.string().nonempty('Job name must be provided'), // name of the automation job
139
+ job_description: z.string().optional(), // optional description for the job
140
+ created_at: z.coerce.date().or(z.number()).optional(), // creation date
141
+ updated_at: z.coerce.date().or(z.number()).optional(), // last update date
142
+ schedule: z.string().optional(), // cron schedule for the job
143
+ status: z.enum(generalStatusList).default('active'), // status of the job
144
+ user_id: z.string().nonempty('User ID must be provided'), // user identifier
145
+ query: zodQuerySchema, // query associated with the job
132
146
  });
133
147
 
134
148
  export type SourceType = z.infer<typeof zodSourceSchema>;
@@ -147,3 +161,4 @@ export type AddSourceToReviewType = Pick<
147
161
  >;
148
162
  export type UserSettingsType = z.infer<typeof zodUserSettingsSchema>;
149
163
  export type ConversationType = z.infer<typeof zodConversationSchema>;
164
+ export type AutomationJobType = z.infer<typeof zodAutomationJobSchema>;