asfur 1.0.43 → 1.0.45
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 +56 -21
- package/dist/index.js +10 -1
- package/dist/types.d.ts +36 -21
- package/dist/types.js +12 -8
- package/index.ts +9 -0
- package/package.json +1 -1
- package/types.ts +15 -8
package/dist/index.d.ts
CHANGED
|
@@ -400,7 +400,7 @@ export declare const MongoQuerySchema: Schema<{
|
|
|
400
400
|
sources: string[];
|
|
401
401
|
time_range: {
|
|
402
402
|
type: "relative";
|
|
403
|
-
time: "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
403
|
+
time: "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";
|
|
404
404
|
} | {
|
|
405
405
|
type: "absolute";
|
|
406
406
|
start: number | Date;
|
|
@@ -416,7 +416,7 @@ export declare const MongoQuerySchema: Schema<{
|
|
|
416
416
|
sources: string[];
|
|
417
417
|
time_range: {
|
|
418
418
|
type: "relative";
|
|
419
|
-
time: "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
419
|
+
time: "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";
|
|
420
420
|
} | {
|
|
421
421
|
type: "absolute";
|
|
422
422
|
start: number | Date;
|
|
@@ -432,7 +432,7 @@ export declare const MongoQuerySchema: Schema<{
|
|
|
432
432
|
sources: string[];
|
|
433
433
|
time_range: {
|
|
434
434
|
type: "relative";
|
|
435
|
-
time: "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
435
|
+
time: "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";
|
|
436
436
|
} | {
|
|
437
437
|
type: "absolute";
|
|
438
438
|
start: number | Date;
|
|
@@ -448,7 +448,7 @@ export declare const MongoQuerySchema: Schema<{
|
|
|
448
448
|
sources: string[];
|
|
449
449
|
time_range: {
|
|
450
450
|
type: "relative";
|
|
451
|
-
time: "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
451
|
+
time: "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";
|
|
452
452
|
} | {
|
|
453
453
|
type: "absolute";
|
|
454
454
|
start: number | Date;
|
|
@@ -468,7 +468,7 @@ export declare const MongoQuerySchema: Schema<{
|
|
|
468
468
|
sources: string[];
|
|
469
469
|
time_range: {
|
|
470
470
|
type: "relative";
|
|
471
|
-
time: "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
471
|
+
time: "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";
|
|
472
472
|
} | {
|
|
473
473
|
type: "absolute";
|
|
474
474
|
start: number | Date;
|
|
@@ -484,7 +484,7 @@ export declare const MongoQuerySchema: Schema<{
|
|
|
484
484
|
sources: string[];
|
|
485
485
|
time_range: {
|
|
486
486
|
type: "relative";
|
|
487
|
-
time: "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
487
|
+
time: "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";
|
|
488
488
|
} | {
|
|
489
489
|
type: "absolute";
|
|
490
490
|
start: number | Date;
|
|
@@ -500,7 +500,7 @@ export declare const MongoQuerySchema: Schema<{
|
|
|
500
500
|
sources: string[];
|
|
501
501
|
time_range: {
|
|
502
502
|
type: "relative";
|
|
503
|
-
time: "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
503
|
+
time: "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";
|
|
504
504
|
} | {
|
|
505
505
|
type: "absolute";
|
|
506
506
|
start: number | Date;
|
|
@@ -517,59 +517,79 @@ export declare const MongoQuerySchema: Schema<{
|
|
|
517
517
|
__v: number;
|
|
518
518
|
}>;
|
|
519
519
|
export declare const MongoUserSettingsSchema: Schema<{
|
|
520
|
+
status: "inactive" | "active";
|
|
520
521
|
user_id: string;
|
|
521
522
|
sources: string[];
|
|
522
523
|
time_range: {
|
|
523
524
|
type: "relative";
|
|
524
|
-
time: "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
525
|
+
time: "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";
|
|
525
526
|
} | {
|
|
526
527
|
type: "absolute";
|
|
527
528
|
start: number | Date;
|
|
528
529
|
end: number | Date;
|
|
529
530
|
};
|
|
531
|
+
has_jobs_access: boolean;
|
|
532
|
+
active_jobs_limit: number;
|
|
530
533
|
_id?: string | undefined;
|
|
534
|
+
created_at?: number | Date | undefined;
|
|
535
|
+
updated_at?: number | Date | undefined;
|
|
531
536
|
thread_id?: string | undefined;
|
|
532
537
|
instructions?: string | undefined;
|
|
533
538
|
}, import("mongoose").Model<{
|
|
539
|
+
status: "inactive" | "active";
|
|
534
540
|
user_id: string;
|
|
535
541
|
sources: string[];
|
|
536
542
|
time_range: {
|
|
537
543
|
type: "relative";
|
|
538
|
-
time: "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
544
|
+
time: "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";
|
|
539
545
|
} | {
|
|
540
546
|
type: "absolute";
|
|
541
547
|
start: number | Date;
|
|
542
548
|
end: number | Date;
|
|
543
549
|
};
|
|
550
|
+
has_jobs_access: boolean;
|
|
551
|
+
active_jobs_limit: number;
|
|
544
552
|
_id?: string | undefined;
|
|
553
|
+
created_at?: number | Date | undefined;
|
|
554
|
+
updated_at?: number | Date | undefined;
|
|
545
555
|
thread_id?: string | undefined;
|
|
546
556
|
instructions?: string | undefined;
|
|
547
557
|
}, any, any, any, import("mongoose").Document<unknown, any, {
|
|
558
|
+
status: "inactive" | "active";
|
|
548
559
|
user_id: string;
|
|
549
560
|
sources: string[];
|
|
550
561
|
time_range: {
|
|
551
562
|
type: "relative";
|
|
552
|
-
time: "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
563
|
+
time: "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";
|
|
553
564
|
} | {
|
|
554
565
|
type: "absolute";
|
|
555
566
|
start: number | Date;
|
|
556
567
|
end: number | Date;
|
|
557
568
|
};
|
|
569
|
+
has_jobs_access: boolean;
|
|
570
|
+
active_jobs_limit: number;
|
|
558
571
|
_id?: string | undefined;
|
|
572
|
+
created_at?: number | Date | undefined;
|
|
573
|
+
updated_at?: number | Date | undefined;
|
|
559
574
|
thread_id?: string | undefined;
|
|
560
575
|
instructions?: string | undefined;
|
|
561
576
|
}, any> & {
|
|
577
|
+
status: "inactive" | "active";
|
|
562
578
|
user_id: string;
|
|
563
579
|
sources: string[];
|
|
564
580
|
time_range: {
|
|
565
581
|
type: "relative";
|
|
566
|
-
time: "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
582
|
+
time: "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";
|
|
567
583
|
} | {
|
|
568
584
|
type: "absolute";
|
|
569
585
|
start: number | Date;
|
|
570
586
|
end: number | Date;
|
|
571
587
|
};
|
|
588
|
+
has_jobs_access: boolean;
|
|
589
|
+
active_jobs_limit: number;
|
|
572
590
|
_id?: string | undefined;
|
|
591
|
+
created_at?: number | Date | undefined;
|
|
592
|
+
updated_at?: number | Date | undefined;
|
|
573
593
|
thread_id?: string | undefined;
|
|
574
594
|
instructions?: string | undefined;
|
|
575
595
|
} & Required<{
|
|
@@ -577,45 +597,60 @@ export declare const MongoUserSettingsSchema: Schema<{
|
|
|
577
597
|
}> & {
|
|
578
598
|
__v: number;
|
|
579
599
|
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, {
|
|
600
|
+
status: "inactive" | "active";
|
|
580
601
|
user_id: string;
|
|
581
602
|
sources: string[];
|
|
582
603
|
time_range: {
|
|
583
604
|
type: "relative";
|
|
584
|
-
time: "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
605
|
+
time: "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";
|
|
585
606
|
} | {
|
|
586
607
|
type: "absolute";
|
|
587
608
|
start: number | Date;
|
|
588
609
|
end: number | Date;
|
|
589
610
|
};
|
|
611
|
+
has_jobs_access: boolean;
|
|
612
|
+
active_jobs_limit: number;
|
|
590
613
|
_id?: string | undefined;
|
|
614
|
+
created_at?: number | Date | undefined;
|
|
615
|
+
updated_at?: number | Date | undefined;
|
|
591
616
|
thread_id?: string | undefined;
|
|
592
617
|
instructions?: string | undefined;
|
|
593
618
|
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
619
|
+
status: "inactive" | "active";
|
|
594
620
|
user_id: string;
|
|
595
621
|
sources: string[];
|
|
596
622
|
time_range: {
|
|
597
623
|
type: "relative";
|
|
598
|
-
time: "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
624
|
+
time: "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";
|
|
599
625
|
} | {
|
|
600
626
|
type: "absolute";
|
|
601
627
|
start: number | Date;
|
|
602
628
|
end: number | Date;
|
|
603
629
|
};
|
|
630
|
+
has_jobs_access: boolean;
|
|
631
|
+
active_jobs_limit: number;
|
|
604
632
|
_id?: string | undefined;
|
|
633
|
+
created_at?: number | Date | undefined;
|
|
634
|
+
updated_at?: number | Date | undefined;
|
|
605
635
|
thread_id?: string | undefined;
|
|
606
636
|
instructions?: string | undefined;
|
|
607
637
|
}>, {}> & import("mongoose").FlatRecord<{
|
|
638
|
+
status: "inactive" | "active";
|
|
608
639
|
user_id: string;
|
|
609
640
|
sources: string[];
|
|
610
641
|
time_range: {
|
|
611
642
|
type: "relative";
|
|
612
|
-
time: "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
643
|
+
time: "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";
|
|
613
644
|
} | {
|
|
614
645
|
type: "absolute";
|
|
615
646
|
start: number | Date;
|
|
616
647
|
end: number | Date;
|
|
617
648
|
};
|
|
649
|
+
has_jobs_access: boolean;
|
|
650
|
+
active_jobs_limit: number;
|
|
618
651
|
_id?: string | undefined;
|
|
652
|
+
created_at?: number | Date | undefined;
|
|
653
|
+
updated_at?: number | Date | undefined;
|
|
619
654
|
thread_id?: string | undefined;
|
|
620
655
|
instructions?: string | undefined;
|
|
621
656
|
}> & Required<{
|
|
@@ -703,7 +738,7 @@ export declare const MongoJobSchema: Schema<{
|
|
|
703
738
|
sources: string[];
|
|
704
739
|
time_range: {
|
|
705
740
|
type: "relative";
|
|
706
|
-
time: "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
741
|
+
time: "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";
|
|
707
742
|
} | {
|
|
708
743
|
type: "absolute";
|
|
709
744
|
start: number | Date;
|
|
@@ -733,7 +768,7 @@ export declare const MongoJobSchema: Schema<{
|
|
|
733
768
|
sources: string[];
|
|
734
769
|
time_range: {
|
|
735
770
|
type: "relative";
|
|
736
|
-
time: "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
771
|
+
time: "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";
|
|
737
772
|
} | {
|
|
738
773
|
type: "absolute";
|
|
739
774
|
start: number | Date;
|
|
@@ -763,7 +798,7 @@ export declare const MongoJobSchema: Schema<{
|
|
|
763
798
|
sources: string[];
|
|
764
799
|
time_range: {
|
|
765
800
|
type: "relative";
|
|
766
|
-
time: "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
801
|
+
time: "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";
|
|
767
802
|
} | {
|
|
768
803
|
type: "absolute";
|
|
769
804
|
start: number | Date;
|
|
@@ -793,7 +828,7 @@ export declare const MongoJobSchema: Schema<{
|
|
|
793
828
|
sources: string[];
|
|
794
829
|
time_range: {
|
|
795
830
|
type: "relative";
|
|
796
|
-
time: "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
831
|
+
time: "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";
|
|
797
832
|
} | {
|
|
798
833
|
type: "absolute";
|
|
799
834
|
start: number | Date;
|
|
@@ -827,7 +862,7 @@ export declare const MongoJobSchema: Schema<{
|
|
|
827
862
|
sources: string[];
|
|
828
863
|
time_range: {
|
|
829
864
|
type: "relative";
|
|
830
|
-
time: "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
865
|
+
time: "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";
|
|
831
866
|
} | {
|
|
832
867
|
type: "absolute";
|
|
833
868
|
start: number | Date;
|
|
@@ -857,7 +892,7 @@ export declare const MongoJobSchema: Schema<{
|
|
|
857
892
|
sources: string[];
|
|
858
893
|
time_range: {
|
|
859
894
|
type: "relative";
|
|
860
|
-
time: "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
895
|
+
time: "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";
|
|
861
896
|
} | {
|
|
862
897
|
type: "absolute";
|
|
863
898
|
start: number | Date;
|
|
@@ -887,7 +922,7 @@ export declare const MongoJobSchema: Schema<{
|
|
|
887
922
|
sources: string[];
|
|
888
923
|
time_range: {
|
|
889
924
|
type: "relative";
|
|
890
|
-
time: "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
925
|
+
time: "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";
|
|
891
926
|
} | {
|
|
892
927
|
type: "absolute";
|
|
893
928
|
start: number | Date;
|
package/dist/index.js
CHANGED
|
@@ -112,7 +112,16 @@ exports.MongoUserSettingsSchema = new mongoose_1.Schema({
|
|
|
112
112
|
},
|
|
113
113
|
user_id: { type: String, required: true },
|
|
114
114
|
thread_id: { type: String },
|
|
115
|
-
instructions: { type: String },
|
|
115
|
+
instructions: { type: String },
|
|
116
|
+
has_jobs_access: { type: Boolean, default: false },
|
|
117
|
+
active_jobs_limit: { type: Number, default: 5 },
|
|
118
|
+
created_at: { type: Date, default: Date.now },
|
|
119
|
+
updated_at: { type: Date, default: Date.now },
|
|
120
|
+
status: {
|
|
121
|
+
type: String,
|
|
122
|
+
enum: types_1.generalStatusList,
|
|
123
|
+
default: 'active',
|
|
124
|
+
}, // status of the user
|
|
116
125
|
}, {
|
|
117
126
|
versionKey: false,
|
|
118
127
|
toJSON: { virtuals: true },
|
package/dist/types.d.ts
CHANGED
|
@@ -141,16 +141,16 @@ export declare const zodDataSchema: z.ZodObject<{
|
|
|
141
141
|
caption?: string | undefined;
|
|
142
142
|
}[] | undefined;
|
|
143
143
|
}>;
|
|
144
|
-
export declare const relativeTimeRangeList: readonly ["last_12_hours", "last_24_hours", "last_48_hours", "last_72_hours", "last_week"];
|
|
144
|
+
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"];
|
|
145
145
|
export declare const zodRelativeTimeRangeSchema: z.ZodObject<{
|
|
146
146
|
type: z.ZodLiteral<"relative">;
|
|
147
|
-
time: z.ZodEnum<["last_12_hours", "last_24_hours", "last_48_hours", "last_72_hours", "last_week"]>;
|
|
147
|
+
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"]>;
|
|
148
148
|
}, "strip", z.ZodTypeAny, {
|
|
149
149
|
type: "relative";
|
|
150
|
-
time: "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
150
|
+
time: "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";
|
|
151
151
|
}, {
|
|
152
152
|
type: "relative";
|
|
153
|
-
time: "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
153
|
+
time: "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";
|
|
154
154
|
}>;
|
|
155
155
|
export declare const zodAbsoluteTimeRangeSchema: z.ZodObject<{
|
|
156
156
|
type: z.ZodLiteral<"absolute">;
|
|
@@ -172,13 +172,13 @@ export declare const zodQuerySchema: z.ZodObject<{
|
|
|
172
172
|
sources: z.ZodArray<z.ZodString, "many">;
|
|
173
173
|
time_range: z.ZodUnion<[z.ZodObject<{
|
|
174
174
|
type: z.ZodLiteral<"relative">;
|
|
175
|
-
time: z.ZodEnum<["last_12_hours", "last_24_hours", "last_48_hours", "last_72_hours", "last_week"]>;
|
|
175
|
+
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"]>;
|
|
176
176
|
}, "strip", z.ZodTypeAny, {
|
|
177
177
|
type: "relative";
|
|
178
|
-
time: "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
178
|
+
time: "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";
|
|
179
179
|
}, {
|
|
180
180
|
type: "relative";
|
|
181
|
-
time: "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
181
|
+
time: "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";
|
|
182
182
|
}>, z.ZodObject<{
|
|
183
183
|
type: z.ZodLiteral<"absolute">;
|
|
184
184
|
start: z.ZodUnion<[z.ZodDate, z.ZodNumber]>;
|
|
@@ -200,7 +200,7 @@ export declare const zodQuerySchema: z.ZodObject<{
|
|
|
200
200
|
sources: string[];
|
|
201
201
|
time_range: {
|
|
202
202
|
type: "relative";
|
|
203
|
-
time: "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
203
|
+
time: "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";
|
|
204
204
|
} | {
|
|
205
205
|
type: "absolute";
|
|
206
206
|
start: number | Date;
|
|
@@ -216,7 +216,7 @@ export declare const zodQuerySchema: z.ZodObject<{
|
|
|
216
216
|
sources: string[];
|
|
217
217
|
time_range: {
|
|
218
218
|
type: "relative";
|
|
219
|
-
time: "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
219
|
+
time: "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";
|
|
220
220
|
} | {
|
|
221
221
|
type: "absolute";
|
|
222
222
|
start: number | Date;
|
|
@@ -252,13 +252,13 @@ export declare const zodUserSettingsSchema: z.ZodObject<{
|
|
|
252
252
|
sources: z.ZodArray<z.ZodString, "many">;
|
|
253
253
|
time_range: z.ZodUnion<[z.ZodObject<{
|
|
254
254
|
type: z.ZodLiteral<"relative">;
|
|
255
|
-
time: z.ZodEnum<["last_12_hours", "last_24_hours", "last_48_hours", "last_72_hours", "last_week"]>;
|
|
255
|
+
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"]>;
|
|
256
256
|
}, "strip", z.ZodTypeAny, {
|
|
257
257
|
type: "relative";
|
|
258
|
-
time: "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
258
|
+
time: "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";
|
|
259
259
|
}, {
|
|
260
260
|
type: "relative";
|
|
261
|
-
time: "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
261
|
+
time: "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";
|
|
262
262
|
}>, z.ZodObject<{
|
|
263
263
|
type: z.ZodLiteral<"absolute">;
|
|
264
264
|
start: z.ZodUnion<[z.ZodDate, z.ZodNumber]>;
|
|
@@ -275,18 +275,28 @@ export declare const zodUserSettingsSchema: z.ZodObject<{
|
|
|
275
275
|
thread_id: z.ZodOptional<z.ZodString>;
|
|
276
276
|
user_id: z.ZodString;
|
|
277
277
|
instructions: z.ZodOptional<z.ZodString>;
|
|
278
|
+
has_jobs_access: z.ZodDefault<z.ZodBoolean>;
|
|
279
|
+
active_jobs_limit: z.ZodDefault<z.ZodNumber>;
|
|
280
|
+
created_at: z.ZodOptional<z.ZodUnion<[z.ZodDate, z.ZodNumber]>>;
|
|
281
|
+
updated_at: z.ZodOptional<z.ZodUnion<[z.ZodDate, z.ZodNumber]>>;
|
|
282
|
+
status: z.ZodDefault<z.ZodEnum<["active", "inactive"]>>;
|
|
278
283
|
}, "strip", z.ZodTypeAny, {
|
|
284
|
+
status: "inactive" | "active";
|
|
279
285
|
user_id: string;
|
|
280
286
|
sources: string[];
|
|
281
287
|
time_range: {
|
|
282
288
|
type: "relative";
|
|
283
|
-
time: "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
289
|
+
time: "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";
|
|
284
290
|
} | {
|
|
285
291
|
type: "absolute";
|
|
286
292
|
start: number | Date;
|
|
287
293
|
end: number | Date;
|
|
288
294
|
};
|
|
295
|
+
has_jobs_access: boolean;
|
|
296
|
+
active_jobs_limit: number;
|
|
289
297
|
_id?: string | undefined;
|
|
298
|
+
created_at?: number | Date | undefined;
|
|
299
|
+
updated_at?: number | Date | undefined;
|
|
290
300
|
thread_id?: string | undefined;
|
|
291
301
|
instructions?: string | undefined;
|
|
292
302
|
}, {
|
|
@@ -294,15 +304,20 @@ export declare const zodUserSettingsSchema: z.ZodObject<{
|
|
|
294
304
|
sources: string[];
|
|
295
305
|
time_range: {
|
|
296
306
|
type: "relative";
|
|
297
|
-
time: "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
307
|
+
time: "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";
|
|
298
308
|
} | {
|
|
299
309
|
type: "absolute";
|
|
300
310
|
start: number | Date;
|
|
301
311
|
end: number | Date;
|
|
302
312
|
};
|
|
303
313
|
_id?: string | undefined;
|
|
314
|
+
status?: "inactive" | "active" | undefined;
|
|
315
|
+
created_at?: number | Date | undefined;
|
|
316
|
+
updated_at?: number | Date | undefined;
|
|
304
317
|
thread_id?: string | undefined;
|
|
305
318
|
instructions?: string | undefined;
|
|
319
|
+
has_jobs_access?: boolean | undefined;
|
|
320
|
+
active_jobs_limit?: number | undefined;
|
|
306
321
|
}>;
|
|
307
322
|
export declare const zodConversationSchema: z.ZodObject<{
|
|
308
323
|
_id: z.ZodOptional<z.ZodString>;
|
|
@@ -349,13 +364,13 @@ export declare const zodJobSchema: z.ZodObject<{
|
|
|
349
364
|
sources: z.ZodArray<z.ZodString, "many">;
|
|
350
365
|
time_range: z.ZodUnion<[z.ZodObject<{
|
|
351
366
|
type: z.ZodLiteral<"relative">;
|
|
352
|
-
time: z.ZodEnum<["last_12_hours", "last_24_hours", "last_48_hours", "last_72_hours", "last_week"]>;
|
|
367
|
+
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"]>;
|
|
353
368
|
}, "strip", z.ZodTypeAny, {
|
|
354
369
|
type: "relative";
|
|
355
|
-
time: "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
370
|
+
time: "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";
|
|
356
371
|
}, {
|
|
357
372
|
type: "relative";
|
|
358
|
-
time: "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
373
|
+
time: "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";
|
|
359
374
|
}>, z.ZodObject<{
|
|
360
375
|
type: z.ZodLiteral<"absolute">;
|
|
361
376
|
start: z.ZodUnion<[z.ZodDate, z.ZodNumber]>;
|
|
@@ -377,7 +392,7 @@ export declare const zodJobSchema: z.ZodObject<{
|
|
|
377
392
|
sources: string[];
|
|
378
393
|
time_range: {
|
|
379
394
|
type: "relative";
|
|
380
|
-
time: "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
395
|
+
time: "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";
|
|
381
396
|
} | {
|
|
382
397
|
type: "absolute";
|
|
383
398
|
start: number | Date;
|
|
@@ -393,7 +408,7 @@ export declare const zodJobSchema: z.ZodObject<{
|
|
|
393
408
|
sources: string[];
|
|
394
409
|
time_range: {
|
|
395
410
|
type: "relative";
|
|
396
|
-
time: "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
411
|
+
time: "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";
|
|
397
412
|
} | {
|
|
398
413
|
type: "absolute";
|
|
399
414
|
start: number | Date;
|
|
@@ -416,7 +431,7 @@ export declare const zodJobSchema: z.ZodObject<{
|
|
|
416
431
|
sources: string[];
|
|
417
432
|
time_range: {
|
|
418
433
|
type: "relative";
|
|
419
|
-
time: "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
434
|
+
time: "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";
|
|
420
435
|
} | {
|
|
421
436
|
type: "absolute";
|
|
422
437
|
start: number | Date;
|
|
@@ -445,7 +460,7 @@ export declare const zodJobSchema: z.ZodObject<{
|
|
|
445
460
|
sources: string[];
|
|
446
461
|
time_range: {
|
|
447
462
|
type: "relative";
|
|
448
|
-
time: "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
463
|
+
time: "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";
|
|
449
464
|
} | {
|
|
450
465
|
type: "absolute";
|
|
451
466
|
start: number | Date;
|
package/dist/types.js
CHANGED
|
@@ -66,6 +66,11 @@ exports.zodDataSchema = zod_1.z.object({
|
|
|
66
66
|
.optional(), // media attachments
|
|
67
67
|
});
|
|
68
68
|
exports.relativeTimeRangeList = [
|
|
69
|
+
// 'last_10_minutes',
|
|
70
|
+
'last_30_minutes',
|
|
71
|
+
'last_1_hour',
|
|
72
|
+
'last_2_hours',
|
|
73
|
+
'last_6_hours',
|
|
69
74
|
'last_12_hours',
|
|
70
75
|
'last_24_hours',
|
|
71
76
|
'last_48_hours',
|
|
@@ -74,13 +79,7 @@ exports.relativeTimeRangeList = [
|
|
|
74
79
|
];
|
|
75
80
|
exports.zodRelativeTimeRangeSchema = zod_1.z.object({
|
|
76
81
|
type: zod_1.z.literal('relative'),
|
|
77
|
-
time: zod_1.z.enum(
|
|
78
|
-
'last_12_hours',
|
|
79
|
-
'last_24_hours',
|
|
80
|
-
'last_48_hours',
|
|
81
|
-
'last_72_hours',
|
|
82
|
-
'last_week',
|
|
83
|
-
]),
|
|
82
|
+
time: zod_1.z.enum(exports.relativeTimeRangeList),
|
|
84
83
|
});
|
|
85
84
|
exports.zodAbsoluteTimeRangeSchema = zod_1.z.object({
|
|
86
85
|
type: zod_1.z.literal('absolute'),
|
|
@@ -110,7 +109,12 @@ exports.zodUserSettingsSchema = zod_1.z.object({
|
|
|
110
109
|
time_range: exports.zodRelativeTimeRangeSchema.or(exports.zodAbsoluteTimeRangeSchema),
|
|
111
110
|
thread_id: zod_1.z.string().optional(),
|
|
112
111
|
user_id: zod_1.z.string().nonempty('User ID must be provided'),
|
|
113
|
-
instructions: zod_1.z.string().optional(),
|
|
112
|
+
instructions: zod_1.z.string().optional(),
|
|
113
|
+
has_jobs_access: zod_1.z.boolean().default(false),
|
|
114
|
+
active_jobs_limit: zod_1.z.number().default(5),
|
|
115
|
+
created_at: zod_1.z.coerce.date().or(zod_1.z.number()).optional(),
|
|
116
|
+
updated_at: zod_1.z.coerce.date().or(zod_1.z.number()).optional(),
|
|
117
|
+
status: zod_1.z.enum(exports.generalStatusList).default('active'), // status of the user
|
|
114
118
|
});
|
|
115
119
|
exports.zodConversationSchema = zod_1.z.object({
|
|
116
120
|
_id: zod_1.z.string().optional(),
|
package/index.ts
CHANGED
|
@@ -124,6 +124,15 @@ export const MongoUserSettingsSchema = new Schema<UserSettingsType>(
|
|
|
124
124
|
user_id: { type: String, required: true },
|
|
125
125
|
thread_id: { type: String },
|
|
126
126
|
instructions: { type: String }, // optional user instructions for the query
|
|
127
|
+
has_jobs_access: { type: Boolean, default: false }, // true if the user has access to jobs
|
|
128
|
+
active_jobs_limit: { type: Number, default: 5 }, // maximum number of active jobs allowed
|
|
129
|
+
created_at: { type: Date, default: Date.now }, // creation date
|
|
130
|
+
updated_at: { type: Date, default: Date.now }, // last update date
|
|
131
|
+
status: {
|
|
132
|
+
type: String,
|
|
133
|
+
enum: generalStatusList,
|
|
134
|
+
default: 'active',
|
|
135
|
+
}, // status of the user
|
|
127
136
|
},
|
|
128
137
|
{
|
|
129
138
|
versionKey: false,
|
package/package.json
CHANGED
package/types.ts
CHANGED
|
@@ -71,6 +71,11 @@ export const zodDataSchema = z.object({
|
|
|
71
71
|
});
|
|
72
72
|
|
|
73
73
|
export const relativeTimeRangeList = [
|
|
74
|
+
// 'last_10_minutes',
|
|
75
|
+
'last_30_minutes',
|
|
76
|
+
'last_1_hour',
|
|
77
|
+
'last_2_hours',
|
|
78
|
+
'last_6_hours',
|
|
74
79
|
'last_12_hours',
|
|
75
80
|
'last_24_hours',
|
|
76
81
|
'last_48_hours',
|
|
@@ -80,13 +85,7 @@ export const relativeTimeRangeList = [
|
|
|
80
85
|
|
|
81
86
|
export const zodRelativeTimeRangeSchema = z.object({
|
|
82
87
|
type: z.literal('relative'),
|
|
83
|
-
time: z.enum(
|
|
84
|
-
'last_12_hours',
|
|
85
|
-
'last_24_hours',
|
|
86
|
-
'last_48_hours',
|
|
87
|
-
'last_72_hours',
|
|
88
|
-
'last_week',
|
|
89
|
-
]),
|
|
88
|
+
time: z.enum(relativeTimeRangeList),
|
|
90
89
|
});
|
|
91
90
|
|
|
92
91
|
export const zodAbsoluteTimeRangeSchema = z.object({
|
|
@@ -121,6 +120,12 @@ export const zodUserSettingsSchema = z.object({
|
|
|
121
120
|
thread_id: z.string().optional(), // thread ID for the user settings
|
|
122
121
|
user_id: z.string().nonempty('User ID must be provided'), // user identifier
|
|
123
122
|
instructions: z.string().optional(), // optional user instructions for the query
|
|
123
|
+
has_jobs_access: z.boolean().default(false), // true if the user has access to jobs
|
|
124
|
+
active_jobs_limit: z.number().default(5), // maximum number of active jobs allowed
|
|
125
|
+
created_at: z.coerce.date().or(z.number()).optional(), // creation date
|
|
126
|
+
updated_at: z.coerce.date().or(z.number()).optional(), // last update date
|
|
127
|
+
status: z.enum(generalStatusList).default('active'), // status of the user
|
|
128
|
+
|
|
124
129
|
});
|
|
125
130
|
|
|
126
131
|
export const zodConversationSchema = z.object({
|
|
@@ -174,4 +179,6 @@ export type AddSourceToReviewType = Pick<
|
|
|
174
179
|
export type UserSettingsType = z.infer<typeof zodUserSettingsSchema>;
|
|
175
180
|
export type ConversationType = z.infer<typeof zodConversationSchema>;
|
|
176
181
|
export type JobType = z.infer<typeof zodJobSchema>;
|
|
177
|
-
export type CronScheduleResponseType = z.infer<
|
|
182
|
+
export type CronScheduleResponseType = z.infer<
|
|
183
|
+
typeof zodCronScheduleResponseSchema
|
|
184
|
+
>;
|