chatifai 1.0.25 → 1.0.27

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
@@ -416,36 +416,804 @@ export declare const PreDefinedQuerySchema: Schema<any, import("mongoose").Model
416
416
  } & {
417
417
  status: "active" | "inactive" | "archived";
418
418
  query: string;
419
- context_ids: string[];
420
- users_ids: string[];
421
- title?: string | null | undefined;
419
+ contexts: import("mongoose").Types.DocumentArray<{
420
+ entries?: {} | null | undefined;
421
+ keys?: {} | null | undefined;
422
+ values?: {} | null | undefined;
423
+ prototype?: {
424
+ toString: {} | null;
425
+ toLocaleString: {} | null;
426
+ constructor: {
427
+ length?: unknown;
428
+ toString: {} | null;
429
+ [Symbol.hasInstance]?: {} | null | undefined;
430
+ prototype?: unknown;
431
+ name?: unknown;
432
+ apply?: {} | null | undefined;
433
+ call?: {} | null | undefined;
434
+ bind?: {} | null | undefined;
435
+ arguments?: unknown;
436
+ caller?: any | null | undefined;
437
+ } | null;
438
+ valueOf: {} | null;
439
+ hasOwnProperty: {} | null;
440
+ isPrototypeOf: {} | null;
441
+ propertyIsEnumerable: {} | null;
442
+ } | null | undefined;
443
+ getPrototypeOf?: {} | null | undefined;
444
+ getOwnPropertyDescriptor?: {} | null | undefined;
445
+ getOwnPropertyNames?: {} | null | undefined;
446
+ create?: {} | null | undefined;
447
+ defineProperty?: {} | null | undefined;
448
+ defineProperties?: {} | null | undefined;
449
+ seal?: {} | null | undefined;
450
+ freeze?: {} | null | undefined;
451
+ preventExtensions?: {} | null | undefined;
452
+ isSealed?: {} | null | undefined;
453
+ isFrozen?: {} | null | undefined;
454
+ isExtensible?: {} | null | undefined;
455
+ assign?: {} | null | undefined;
456
+ getOwnPropertySymbols?: {} | null | undefined;
457
+ is?: {} | null | undefined;
458
+ setPrototypeOf?: {} | null | undefined;
459
+ getOwnPropertyDescriptors?: {} | null | undefined;
460
+ fromEntries?: {} | null | undefined;
461
+ }, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
462
+ entries?: {} | null | undefined;
463
+ keys?: {} | null | undefined;
464
+ values?: {} | null | undefined;
465
+ prototype?: {
466
+ toString: {} | null;
467
+ toLocaleString: {} | null;
468
+ constructor: {
469
+ length?: unknown;
470
+ toString: {} | null;
471
+ [Symbol.hasInstance]?: {} | null | undefined;
472
+ prototype?: unknown;
473
+ name?: unknown;
474
+ apply?: {} | null | undefined;
475
+ call?: {} | null | undefined;
476
+ bind?: {} | null | undefined;
477
+ arguments?: unknown;
478
+ caller?: any | null | undefined;
479
+ } | null;
480
+ valueOf: {} | null;
481
+ hasOwnProperty: {} | null;
482
+ isPrototypeOf: {} | null;
483
+ propertyIsEnumerable: {} | null;
484
+ } | null | undefined;
485
+ getPrototypeOf?: {} | null | undefined;
486
+ getOwnPropertyDescriptor?: {} | null | undefined;
487
+ getOwnPropertyNames?: {} | null | undefined;
488
+ create?: {} | null | undefined;
489
+ defineProperty?: {} | null | undefined;
490
+ defineProperties?: {} | null | undefined;
491
+ seal?: {} | null | undefined;
492
+ freeze?: {} | null | undefined;
493
+ preventExtensions?: {} | null | undefined;
494
+ isSealed?: {} | null | undefined;
495
+ isFrozen?: {} | null | undefined;
496
+ isExtensible?: {} | null | undefined;
497
+ assign?: {} | null | undefined;
498
+ getOwnPropertySymbols?: {} | null | undefined;
499
+ is?: {} | null | undefined;
500
+ setPrototypeOf?: {} | null | undefined;
501
+ getOwnPropertyDescriptors?: {} | null | undefined;
502
+ fromEntries?: {} | null | undefined;
503
+ }> & {
504
+ entries?: {} | null | undefined;
505
+ keys?: {} | null | undefined;
506
+ values?: {} | null | undefined;
507
+ prototype?: {
508
+ toString: {} | null;
509
+ toLocaleString: {} | null;
510
+ constructor: {
511
+ length?: unknown;
512
+ toString: {} | null;
513
+ [Symbol.hasInstance]?: {} | null | undefined;
514
+ prototype?: unknown;
515
+ name?: unknown;
516
+ apply?: {} | null | undefined;
517
+ call?: {} | null | undefined;
518
+ bind?: {} | null | undefined;
519
+ arguments?: unknown;
520
+ caller?: any | null | undefined;
521
+ } | null;
522
+ valueOf: {} | null;
523
+ hasOwnProperty: {} | null;
524
+ isPrototypeOf: {} | null;
525
+ propertyIsEnumerable: {} | null;
526
+ } | null | undefined;
527
+ getPrototypeOf?: {} | null | undefined;
528
+ getOwnPropertyDescriptor?: {} | null | undefined;
529
+ getOwnPropertyNames?: {} | null | undefined;
530
+ create?: {} | null | undefined;
531
+ defineProperty?: {} | null | undefined;
532
+ defineProperties?: {} | null | undefined;
533
+ seal?: {} | null | undefined;
534
+ freeze?: {} | null | undefined;
535
+ preventExtensions?: {} | null | undefined;
536
+ isSealed?: {} | null | undefined;
537
+ isFrozen?: {} | null | undefined;
538
+ isExtensible?: {} | null | undefined;
539
+ assign?: {} | null | undefined;
540
+ getOwnPropertySymbols?: {} | null | undefined;
541
+ is?: {} | null | undefined;
542
+ setPrototypeOf?: {} | null | undefined;
543
+ getOwnPropertyDescriptors?: {} | null | undefined;
544
+ fromEntries?: {} | null | undefined;
545
+ }>;
546
+ full_document_search: boolean;
547
+ users: import("mongoose").Types.DocumentArray<{
548
+ entries?: {} | null | undefined;
549
+ keys?: {} | null | undefined;
550
+ values?: {} | null | undefined;
551
+ prototype?: {
552
+ toString: {} | null;
553
+ toLocaleString: {} | null;
554
+ constructor: {
555
+ length?: unknown;
556
+ toString: {} | null;
557
+ [Symbol.hasInstance]?: {} | null | undefined;
558
+ prototype?: unknown;
559
+ name?: unknown;
560
+ apply?: {} | null | undefined;
561
+ call?: {} | null | undefined;
562
+ bind?: {} | null | undefined;
563
+ arguments?: unknown;
564
+ caller?: any | null | undefined;
565
+ } | null;
566
+ valueOf: {} | null;
567
+ hasOwnProperty: {} | null;
568
+ isPrototypeOf: {} | null;
569
+ propertyIsEnumerable: {} | null;
570
+ } | null | undefined;
571
+ getPrototypeOf?: {} | null | undefined;
572
+ getOwnPropertyDescriptor?: {} | null | undefined;
573
+ getOwnPropertyNames?: {} | null | undefined;
574
+ create?: {} | null | undefined;
575
+ defineProperty?: {} | null | undefined;
576
+ defineProperties?: {} | null | undefined;
577
+ seal?: {} | null | undefined;
578
+ freeze?: {} | null | undefined;
579
+ preventExtensions?: {} | null | undefined;
580
+ isSealed?: {} | null | undefined;
581
+ isFrozen?: {} | null | undefined;
582
+ isExtensible?: {} | null | undefined;
583
+ assign?: {} | null | undefined;
584
+ getOwnPropertySymbols?: {} | null | undefined;
585
+ is?: {} | null | undefined;
586
+ setPrototypeOf?: {} | null | undefined;
587
+ getOwnPropertyDescriptors?: {} | null | undefined;
588
+ fromEntries?: {} | null | undefined;
589
+ }, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
590
+ entries?: {} | null | undefined;
591
+ keys?: {} | null | undefined;
592
+ values?: {} | null | undefined;
593
+ prototype?: {
594
+ toString: {} | null;
595
+ toLocaleString: {} | null;
596
+ constructor: {
597
+ length?: unknown;
598
+ toString: {} | null;
599
+ [Symbol.hasInstance]?: {} | null | undefined;
600
+ prototype?: unknown;
601
+ name?: unknown;
602
+ apply?: {} | null | undefined;
603
+ call?: {} | null | undefined;
604
+ bind?: {} | null | undefined;
605
+ arguments?: unknown;
606
+ caller?: any | null | undefined;
607
+ } | null;
608
+ valueOf: {} | null;
609
+ hasOwnProperty: {} | null;
610
+ isPrototypeOf: {} | null;
611
+ propertyIsEnumerable: {} | null;
612
+ } | null | undefined;
613
+ getPrototypeOf?: {} | null | undefined;
614
+ getOwnPropertyDescriptor?: {} | null | undefined;
615
+ getOwnPropertyNames?: {} | null | undefined;
616
+ create?: {} | null | undefined;
617
+ defineProperty?: {} | null | undefined;
618
+ defineProperties?: {} | null | undefined;
619
+ seal?: {} | null | undefined;
620
+ freeze?: {} | null | undefined;
621
+ preventExtensions?: {} | null | undefined;
622
+ isSealed?: {} | null | undefined;
623
+ isFrozen?: {} | null | undefined;
624
+ isExtensible?: {} | null | undefined;
625
+ assign?: {} | null | undefined;
626
+ getOwnPropertySymbols?: {} | null | undefined;
627
+ is?: {} | null | undefined;
628
+ setPrototypeOf?: {} | null | undefined;
629
+ getOwnPropertyDescriptors?: {} | null | undefined;
630
+ fromEntries?: {} | null | undefined;
631
+ }> & {
632
+ entries?: {} | null | undefined;
633
+ keys?: {} | null | undefined;
634
+ values?: {} | null | undefined;
635
+ prototype?: {
636
+ toString: {} | null;
637
+ toLocaleString: {} | null;
638
+ constructor: {
639
+ length?: unknown;
640
+ toString: {} | null;
641
+ [Symbol.hasInstance]?: {} | null | undefined;
642
+ prototype?: unknown;
643
+ name?: unknown;
644
+ apply?: {} | null | undefined;
645
+ call?: {} | null | undefined;
646
+ bind?: {} | null | undefined;
647
+ arguments?: unknown;
648
+ caller?: any | null | undefined;
649
+ } | null;
650
+ valueOf: {} | null;
651
+ hasOwnProperty: {} | null;
652
+ isPrototypeOf: {} | null;
653
+ propertyIsEnumerable: {} | null;
654
+ } | null | undefined;
655
+ getPrototypeOf?: {} | null | undefined;
656
+ getOwnPropertyDescriptor?: {} | null | undefined;
657
+ getOwnPropertyNames?: {} | null | undefined;
658
+ create?: {} | null | undefined;
659
+ defineProperty?: {} | null | undefined;
660
+ defineProperties?: {} | null | undefined;
661
+ seal?: {} | null | undefined;
662
+ freeze?: {} | null | undefined;
663
+ preventExtensions?: {} | null | undefined;
664
+ isSealed?: {} | null | undefined;
665
+ isFrozen?: {} | null | undefined;
666
+ isExtensible?: {} | null | undefined;
667
+ assign?: {} | null | undefined;
668
+ getOwnPropertySymbols?: {} | null | undefined;
669
+ is?: {} | null | undefined;
670
+ setPrototypeOf?: {} | null | undefined;
671
+ getOwnPropertyDescriptors?: {} | null | undefined;
672
+ fromEntries?: {} | null | undefined;
673
+ }>;
674
+ click_count: number;
422
675
  created_at?: number | null | undefined;
423
676
  updated_at?: number | null | undefined;
424
677
  organization_id?: string | null | undefined;
678
+ instructions?: string | null | undefined;
679
+ query_name?: string | null | undefined;
680
+ query_hint?: string | null | undefined;
425
681
  }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
426
682
  createdAt: NativeDate;
427
683
  updatedAt: NativeDate;
428
684
  } & {
429
685
  status: "active" | "inactive" | "archived";
430
686
  query: string;
431
- context_ids: string[];
432
- users_ids: string[];
433
- title?: string | null | undefined;
687
+ contexts: import("mongoose").Types.DocumentArray<{
688
+ entries?: {} | null | undefined;
689
+ keys?: {} | null | undefined;
690
+ values?: {} | null | undefined;
691
+ prototype?: {
692
+ toString: {} | null;
693
+ toLocaleString: {} | null;
694
+ constructor: {
695
+ length?: unknown;
696
+ toString: {} | null;
697
+ [Symbol.hasInstance]?: {} | null | undefined;
698
+ prototype?: unknown;
699
+ name?: unknown;
700
+ apply?: {} | null | undefined;
701
+ call?: {} | null | undefined;
702
+ bind?: {} | null | undefined;
703
+ arguments?: unknown;
704
+ caller?: any | null | undefined;
705
+ } | null;
706
+ valueOf: {} | null;
707
+ hasOwnProperty: {} | null;
708
+ isPrototypeOf: {} | null;
709
+ propertyIsEnumerable: {} | null;
710
+ } | null | undefined;
711
+ getPrototypeOf?: {} | null | undefined;
712
+ getOwnPropertyDescriptor?: {} | null | undefined;
713
+ getOwnPropertyNames?: {} | null | undefined;
714
+ create?: {} | null | undefined;
715
+ defineProperty?: {} | null | undefined;
716
+ defineProperties?: {} | null | undefined;
717
+ seal?: {} | null | undefined;
718
+ freeze?: {} | null | undefined;
719
+ preventExtensions?: {} | null | undefined;
720
+ isSealed?: {} | null | undefined;
721
+ isFrozen?: {} | null | undefined;
722
+ isExtensible?: {} | null | undefined;
723
+ assign?: {} | null | undefined;
724
+ getOwnPropertySymbols?: {} | null | undefined;
725
+ is?: {} | null | undefined;
726
+ setPrototypeOf?: {} | null | undefined;
727
+ getOwnPropertyDescriptors?: {} | null | undefined;
728
+ fromEntries?: {} | null | undefined;
729
+ }, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
730
+ entries?: {} | null | undefined;
731
+ keys?: {} | null | undefined;
732
+ values?: {} | null | undefined;
733
+ prototype?: {
734
+ toString: {} | null;
735
+ toLocaleString: {} | null;
736
+ constructor: {
737
+ length?: unknown;
738
+ toString: {} | null;
739
+ [Symbol.hasInstance]?: {} | null | undefined;
740
+ prototype?: unknown;
741
+ name?: unknown;
742
+ apply?: {} | null | undefined;
743
+ call?: {} | null | undefined;
744
+ bind?: {} | null | undefined;
745
+ arguments?: unknown;
746
+ caller?: any | null | undefined;
747
+ } | null;
748
+ valueOf: {} | null;
749
+ hasOwnProperty: {} | null;
750
+ isPrototypeOf: {} | null;
751
+ propertyIsEnumerable: {} | null;
752
+ } | null | undefined;
753
+ getPrototypeOf?: {} | null | undefined;
754
+ getOwnPropertyDescriptor?: {} | null | undefined;
755
+ getOwnPropertyNames?: {} | null | undefined;
756
+ create?: {} | null | undefined;
757
+ defineProperty?: {} | null | undefined;
758
+ defineProperties?: {} | null | undefined;
759
+ seal?: {} | null | undefined;
760
+ freeze?: {} | null | undefined;
761
+ preventExtensions?: {} | null | undefined;
762
+ isSealed?: {} | null | undefined;
763
+ isFrozen?: {} | null | undefined;
764
+ isExtensible?: {} | null | undefined;
765
+ assign?: {} | null | undefined;
766
+ getOwnPropertySymbols?: {} | null | undefined;
767
+ is?: {} | null | undefined;
768
+ setPrototypeOf?: {} | null | undefined;
769
+ getOwnPropertyDescriptors?: {} | null | undefined;
770
+ fromEntries?: {} | null | undefined;
771
+ }> & {
772
+ entries?: {} | null | undefined;
773
+ keys?: {} | null | undefined;
774
+ values?: {} | null | undefined;
775
+ prototype?: {
776
+ toString: {} | null;
777
+ toLocaleString: {} | null;
778
+ constructor: {
779
+ length?: unknown;
780
+ toString: {} | null;
781
+ [Symbol.hasInstance]?: {} | null | undefined;
782
+ prototype?: unknown;
783
+ name?: unknown;
784
+ apply?: {} | null | undefined;
785
+ call?: {} | null | undefined;
786
+ bind?: {} | null | undefined;
787
+ arguments?: unknown;
788
+ caller?: any | null | undefined;
789
+ } | null;
790
+ valueOf: {} | null;
791
+ hasOwnProperty: {} | null;
792
+ isPrototypeOf: {} | null;
793
+ propertyIsEnumerable: {} | null;
794
+ } | null | undefined;
795
+ getPrototypeOf?: {} | null | undefined;
796
+ getOwnPropertyDescriptor?: {} | null | undefined;
797
+ getOwnPropertyNames?: {} | null | undefined;
798
+ create?: {} | null | undefined;
799
+ defineProperty?: {} | null | undefined;
800
+ defineProperties?: {} | null | undefined;
801
+ seal?: {} | null | undefined;
802
+ freeze?: {} | null | undefined;
803
+ preventExtensions?: {} | null | undefined;
804
+ isSealed?: {} | null | undefined;
805
+ isFrozen?: {} | null | undefined;
806
+ isExtensible?: {} | null | undefined;
807
+ assign?: {} | null | undefined;
808
+ getOwnPropertySymbols?: {} | null | undefined;
809
+ is?: {} | null | undefined;
810
+ setPrototypeOf?: {} | null | undefined;
811
+ getOwnPropertyDescriptors?: {} | null | undefined;
812
+ fromEntries?: {} | null | undefined;
813
+ }>;
814
+ full_document_search: boolean;
815
+ users: import("mongoose").Types.DocumentArray<{
816
+ entries?: {} | null | undefined;
817
+ keys?: {} | null | undefined;
818
+ values?: {} | null | undefined;
819
+ prototype?: {
820
+ toString: {} | null;
821
+ toLocaleString: {} | null;
822
+ constructor: {
823
+ length?: unknown;
824
+ toString: {} | null;
825
+ [Symbol.hasInstance]?: {} | null | undefined;
826
+ prototype?: unknown;
827
+ name?: unknown;
828
+ apply?: {} | null | undefined;
829
+ call?: {} | null | undefined;
830
+ bind?: {} | null | undefined;
831
+ arguments?: unknown;
832
+ caller?: any | null | undefined;
833
+ } | null;
834
+ valueOf: {} | null;
835
+ hasOwnProperty: {} | null;
836
+ isPrototypeOf: {} | null;
837
+ propertyIsEnumerable: {} | null;
838
+ } | null | undefined;
839
+ getPrototypeOf?: {} | null | undefined;
840
+ getOwnPropertyDescriptor?: {} | null | undefined;
841
+ getOwnPropertyNames?: {} | null | undefined;
842
+ create?: {} | null | undefined;
843
+ defineProperty?: {} | null | undefined;
844
+ defineProperties?: {} | null | undefined;
845
+ seal?: {} | null | undefined;
846
+ freeze?: {} | null | undefined;
847
+ preventExtensions?: {} | null | undefined;
848
+ isSealed?: {} | null | undefined;
849
+ isFrozen?: {} | null | undefined;
850
+ isExtensible?: {} | null | undefined;
851
+ assign?: {} | null | undefined;
852
+ getOwnPropertySymbols?: {} | null | undefined;
853
+ is?: {} | null | undefined;
854
+ setPrototypeOf?: {} | null | undefined;
855
+ getOwnPropertyDescriptors?: {} | null | undefined;
856
+ fromEntries?: {} | null | undefined;
857
+ }, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
858
+ entries?: {} | null | undefined;
859
+ keys?: {} | null | undefined;
860
+ values?: {} | null | undefined;
861
+ prototype?: {
862
+ toString: {} | null;
863
+ toLocaleString: {} | null;
864
+ constructor: {
865
+ length?: unknown;
866
+ toString: {} | null;
867
+ [Symbol.hasInstance]?: {} | null | undefined;
868
+ prototype?: unknown;
869
+ name?: unknown;
870
+ apply?: {} | null | undefined;
871
+ call?: {} | null | undefined;
872
+ bind?: {} | null | undefined;
873
+ arguments?: unknown;
874
+ caller?: any | null | undefined;
875
+ } | null;
876
+ valueOf: {} | null;
877
+ hasOwnProperty: {} | null;
878
+ isPrototypeOf: {} | null;
879
+ propertyIsEnumerable: {} | null;
880
+ } | null | undefined;
881
+ getPrototypeOf?: {} | null | undefined;
882
+ getOwnPropertyDescriptor?: {} | null | undefined;
883
+ getOwnPropertyNames?: {} | null | undefined;
884
+ create?: {} | null | undefined;
885
+ defineProperty?: {} | null | undefined;
886
+ defineProperties?: {} | null | undefined;
887
+ seal?: {} | null | undefined;
888
+ freeze?: {} | null | undefined;
889
+ preventExtensions?: {} | null | undefined;
890
+ isSealed?: {} | null | undefined;
891
+ isFrozen?: {} | null | undefined;
892
+ isExtensible?: {} | null | undefined;
893
+ assign?: {} | null | undefined;
894
+ getOwnPropertySymbols?: {} | null | undefined;
895
+ is?: {} | null | undefined;
896
+ setPrototypeOf?: {} | null | undefined;
897
+ getOwnPropertyDescriptors?: {} | null | undefined;
898
+ fromEntries?: {} | null | undefined;
899
+ }> & {
900
+ entries?: {} | null | undefined;
901
+ keys?: {} | null | undefined;
902
+ values?: {} | null | undefined;
903
+ prototype?: {
904
+ toString: {} | null;
905
+ toLocaleString: {} | null;
906
+ constructor: {
907
+ length?: unknown;
908
+ toString: {} | null;
909
+ [Symbol.hasInstance]?: {} | null | undefined;
910
+ prototype?: unknown;
911
+ name?: unknown;
912
+ apply?: {} | null | undefined;
913
+ call?: {} | null | undefined;
914
+ bind?: {} | null | undefined;
915
+ arguments?: unknown;
916
+ caller?: any | null | undefined;
917
+ } | null;
918
+ valueOf: {} | null;
919
+ hasOwnProperty: {} | null;
920
+ isPrototypeOf: {} | null;
921
+ propertyIsEnumerable: {} | null;
922
+ } | null | undefined;
923
+ getPrototypeOf?: {} | null | undefined;
924
+ getOwnPropertyDescriptor?: {} | null | undefined;
925
+ getOwnPropertyNames?: {} | null | undefined;
926
+ create?: {} | null | undefined;
927
+ defineProperty?: {} | null | undefined;
928
+ defineProperties?: {} | null | undefined;
929
+ seal?: {} | null | undefined;
930
+ freeze?: {} | null | undefined;
931
+ preventExtensions?: {} | null | undefined;
932
+ isSealed?: {} | null | undefined;
933
+ isFrozen?: {} | null | undefined;
934
+ isExtensible?: {} | null | undefined;
935
+ assign?: {} | null | undefined;
936
+ getOwnPropertySymbols?: {} | null | undefined;
937
+ is?: {} | null | undefined;
938
+ setPrototypeOf?: {} | null | undefined;
939
+ getOwnPropertyDescriptors?: {} | null | undefined;
940
+ fromEntries?: {} | null | undefined;
941
+ }>;
942
+ click_count: number;
434
943
  created_at?: number | null | undefined;
435
944
  updated_at?: number | null | undefined;
436
945
  organization_id?: string | null | undefined;
946
+ instructions?: string | null | undefined;
947
+ query_name?: string | null | undefined;
948
+ query_hint?: string | null | undefined;
437
949
  }>, {}> & import("mongoose").FlatRecord<{
438
950
  createdAt: NativeDate;
439
951
  updatedAt: NativeDate;
440
952
  } & {
441
953
  status: "active" | "inactive" | "archived";
442
954
  query: string;
443
- context_ids: string[];
444
- users_ids: string[];
445
- title?: string | null | undefined;
955
+ contexts: import("mongoose").Types.DocumentArray<{
956
+ entries?: {} | null | undefined;
957
+ keys?: {} | null | undefined;
958
+ values?: {} | null | undefined;
959
+ prototype?: {
960
+ toString: {} | null;
961
+ toLocaleString: {} | null;
962
+ constructor: {
963
+ length?: unknown;
964
+ toString: {} | null;
965
+ [Symbol.hasInstance]?: {} | null | undefined;
966
+ prototype?: unknown;
967
+ name?: unknown;
968
+ apply?: {} | null | undefined;
969
+ call?: {} | null | undefined;
970
+ bind?: {} | null | undefined;
971
+ arguments?: unknown;
972
+ caller?: any | null | undefined;
973
+ } | null;
974
+ valueOf: {} | null;
975
+ hasOwnProperty: {} | null;
976
+ isPrototypeOf: {} | null;
977
+ propertyIsEnumerable: {} | null;
978
+ } | null | undefined;
979
+ getPrototypeOf?: {} | null | undefined;
980
+ getOwnPropertyDescriptor?: {} | null | undefined;
981
+ getOwnPropertyNames?: {} | null | undefined;
982
+ create?: {} | null | undefined;
983
+ defineProperty?: {} | null | undefined;
984
+ defineProperties?: {} | null | undefined;
985
+ seal?: {} | null | undefined;
986
+ freeze?: {} | null | undefined;
987
+ preventExtensions?: {} | null | undefined;
988
+ isSealed?: {} | null | undefined;
989
+ isFrozen?: {} | null | undefined;
990
+ isExtensible?: {} | null | undefined;
991
+ assign?: {} | null | undefined;
992
+ getOwnPropertySymbols?: {} | null | undefined;
993
+ is?: {} | null | undefined;
994
+ setPrototypeOf?: {} | null | undefined;
995
+ getOwnPropertyDescriptors?: {} | null | undefined;
996
+ fromEntries?: {} | null | undefined;
997
+ }, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
998
+ entries?: {} | null | undefined;
999
+ keys?: {} | null | undefined;
1000
+ values?: {} | null | undefined;
1001
+ prototype?: {
1002
+ toString: {} | null;
1003
+ toLocaleString: {} | null;
1004
+ constructor: {
1005
+ length?: unknown;
1006
+ toString: {} | null;
1007
+ [Symbol.hasInstance]?: {} | null | undefined;
1008
+ prototype?: unknown;
1009
+ name?: unknown;
1010
+ apply?: {} | null | undefined;
1011
+ call?: {} | null | undefined;
1012
+ bind?: {} | null | undefined;
1013
+ arguments?: unknown;
1014
+ caller?: any | null | undefined;
1015
+ } | null;
1016
+ valueOf: {} | null;
1017
+ hasOwnProperty: {} | null;
1018
+ isPrototypeOf: {} | null;
1019
+ propertyIsEnumerable: {} | null;
1020
+ } | null | undefined;
1021
+ getPrototypeOf?: {} | null | undefined;
1022
+ getOwnPropertyDescriptor?: {} | null | undefined;
1023
+ getOwnPropertyNames?: {} | null | undefined;
1024
+ create?: {} | null | undefined;
1025
+ defineProperty?: {} | null | undefined;
1026
+ defineProperties?: {} | null | undefined;
1027
+ seal?: {} | null | undefined;
1028
+ freeze?: {} | null | undefined;
1029
+ preventExtensions?: {} | null | undefined;
1030
+ isSealed?: {} | null | undefined;
1031
+ isFrozen?: {} | null | undefined;
1032
+ isExtensible?: {} | null | undefined;
1033
+ assign?: {} | null | undefined;
1034
+ getOwnPropertySymbols?: {} | null | undefined;
1035
+ is?: {} | null | undefined;
1036
+ setPrototypeOf?: {} | null | undefined;
1037
+ getOwnPropertyDescriptors?: {} | null | undefined;
1038
+ fromEntries?: {} | null | undefined;
1039
+ }> & {
1040
+ entries?: {} | null | undefined;
1041
+ keys?: {} | null | undefined;
1042
+ values?: {} | null | undefined;
1043
+ prototype?: {
1044
+ toString: {} | null;
1045
+ toLocaleString: {} | null;
1046
+ constructor: {
1047
+ length?: unknown;
1048
+ toString: {} | null;
1049
+ [Symbol.hasInstance]?: {} | null | undefined;
1050
+ prototype?: unknown;
1051
+ name?: unknown;
1052
+ apply?: {} | null | undefined;
1053
+ call?: {} | null | undefined;
1054
+ bind?: {} | null | undefined;
1055
+ arguments?: unknown;
1056
+ caller?: any | null | undefined;
1057
+ } | null;
1058
+ valueOf: {} | null;
1059
+ hasOwnProperty: {} | null;
1060
+ isPrototypeOf: {} | null;
1061
+ propertyIsEnumerable: {} | null;
1062
+ } | null | undefined;
1063
+ getPrototypeOf?: {} | null | undefined;
1064
+ getOwnPropertyDescriptor?: {} | null | undefined;
1065
+ getOwnPropertyNames?: {} | null | undefined;
1066
+ create?: {} | null | undefined;
1067
+ defineProperty?: {} | null | undefined;
1068
+ defineProperties?: {} | null | undefined;
1069
+ seal?: {} | null | undefined;
1070
+ freeze?: {} | null | undefined;
1071
+ preventExtensions?: {} | null | undefined;
1072
+ isSealed?: {} | null | undefined;
1073
+ isFrozen?: {} | null | undefined;
1074
+ isExtensible?: {} | null | undefined;
1075
+ assign?: {} | null | undefined;
1076
+ getOwnPropertySymbols?: {} | null | undefined;
1077
+ is?: {} | null | undefined;
1078
+ setPrototypeOf?: {} | null | undefined;
1079
+ getOwnPropertyDescriptors?: {} | null | undefined;
1080
+ fromEntries?: {} | null | undefined;
1081
+ }>;
1082
+ full_document_search: boolean;
1083
+ users: import("mongoose").Types.DocumentArray<{
1084
+ entries?: {} | null | undefined;
1085
+ keys?: {} | null | undefined;
1086
+ values?: {} | null | undefined;
1087
+ prototype?: {
1088
+ toString: {} | null;
1089
+ toLocaleString: {} | null;
1090
+ constructor: {
1091
+ length?: unknown;
1092
+ toString: {} | null;
1093
+ [Symbol.hasInstance]?: {} | null | undefined;
1094
+ prototype?: unknown;
1095
+ name?: unknown;
1096
+ apply?: {} | null | undefined;
1097
+ call?: {} | null | undefined;
1098
+ bind?: {} | null | undefined;
1099
+ arguments?: unknown;
1100
+ caller?: any | null | undefined;
1101
+ } | null;
1102
+ valueOf: {} | null;
1103
+ hasOwnProperty: {} | null;
1104
+ isPrototypeOf: {} | null;
1105
+ propertyIsEnumerable: {} | null;
1106
+ } | null | undefined;
1107
+ getPrototypeOf?: {} | null | undefined;
1108
+ getOwnPropertyDescriptor?: {} | null | undefined;
1109
+ getOwnPropertyNames?: {} | null | undefined;
1110
+ create?: {} | null | undefined;
1111
+ defineProperty?: {} | null | undefined;
1112
+ defineProperties?: {} | null | undefined;
1113
+ seal?: {} | null | undefined;
1114
+ freeze?: {} | null | undefined;
1115
+ preventExtensions?: {} | null | undefined;
1116
+ isSealed?: {} | null | undefined;
1117
+ isFrozen?: {} | null | undefined;
1118
+ isExtensible?: {} | null | undefined;
1119
+ assign?: {} | null | undefined;
1120
+ getOwnPropertySymbols?: {} | null | undefined;
1121
+ is?: {} | null | undefined;
1122
+ setPrototypeOf?: {} | null | undefined;
1123
+ getOwnPropertyDescriptors?: {} | null | undefined;
1124
+ fromEntries?: {} | null | undefined;
1125
+ }, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
1126
+ entries?: {} | null | undefined;
1127
+ keys?: {} | null | undefined;
1128
+ values?: {} | null | undefined;
1129
+ prototype?: {
1130
+ toString: {} | null;
1131
+ toLocaleString: {} | null;
1132
+ constructor: {
1133
+ length?: unknown;
1134
+ toString: {} | null;
1135
+ [Symbol.hasInstance]?: {} | null | undefined;
1136
+ prototype?: unknown;
1137
+ name?: unknown;
1138
+ apply?: {} | null | undefined;
1139
+ call?: {} | null | undefined;
1140
+ bind?: {} | null | undefined;
1141
+ arguments?: unknown;
1142
+ caller?: any | null | undefined;
1143
+ } | null;
1144
+ valueOf: {} | null;
1145
+ hasOwnProperty: {} | null;
1146
+ isPrototypeOf: {} | null;
1147
+ propertyIsEnumerable: {} | null;
1148
+ } | null | undefined;
1149
+ getPrototypeOf?: {} | null | undefined;
1150
+ getOwnPropertyDescriptor?: {} | null | undefined;
1151
+ getOwnPropertyNames?: {} | null | undefined;
1152
+ create?: {} | null | undefined;
1153
+ defineProperty?: {} | null | undefined;
1154
+ defineProperties?: {} | null | undefined;
1155
+ seal?: {} | null | undefined;
1156
+ freeze?: {} | null | undefined;
1157
+ preventExtensions?: {} | null | undefined;
1158
+ isSealed?: {} | null | undefined;
1159
+ isFrozen?: {} | null | undefined;
1160
+ isExtensible?: {} | null | undefined;
1161
+ assign?: {} | null | undefined;
1162
+ getOwnPropertySymbols?: {} | null | undefined;
1163
+ is?: {} | null | undefined;
1164
+ setPrototypeOf?: {} | null | undefined;
1165
+ getOwnPropertyDescriptors?: {} | null | undefined;
1166
+ fromEntries?: {} | null | undefined;
1167
+ }> & {
1168
+ entries?: {} | null | undefined;
1169
+ keys?: {} | null | undefined;
1170
+ values?: {} | null | undefined;
1171
+ prototype?: {
1172
+ toString: {} | null;
1173
+ toLocaleString: {} | null;
1174
+ constructor: {
1175
+ length?: unknown;
1176
+ toString: {} | null;
1177
+ [Symbol.hasInstance]?: {} | null | undefined;
1178
+ prototype?: unknown;
1179
+ name?: unknown;
1180
+ apply?: {} | null | undefined;
1181
+ call?: {} | null | undefined;
1182
+ bind?: {} | null | undefined;
1183
+ arguments?: unknown;
1184
+ caller?: any | null | undefined;
1185
+ } | null;
1186
+ valueOf: {} | null;
1187
+ hasOwnProperty: {} | null;
1188
+ isPrototypeOf: {} | null;
1189
+ propertyIsEnumerable: {} | null;
1190
+ } | null | undefined;
1191
+ getPrototypeOf?: {} | null | undefined;
1192
+ getOwnPropertyDescriptor?: {} | null | undefined;
1193
+ getOwnPropertyNames?: {} | null | undefined;
1194
+ create?: {} | null | undefined;
1195
+ defineProperty?: {} | null | undefined;
1196
+ defineProperties?: {} | null | undefined;
1197
+ seal?: {} | null | undefined;
1198
+ freeze?: {} | null | undefined;
1199
+ preventExtensions?: {} | null | undefined;
1200
+ isSealed?: {} | null | undefined;
1201
+ isFrozen?: {} | null | undefined;
1202
+ isExtensible?: {} | null | undefined;
1203
+ assign?: {} | null | undefined;
1204
+ getOwnPropertySymbols?: {} | null | undefined;
1205
+ is?: {} | null | undefined;
1206
+ setPrototypeOf?: {} | null | undefined;
1207
+ getOwnPropertyDescriptors?: {} | null | undefined;
1208
+ fromEntries?: {} | null | undefined;
1209
+ }>;
1210
+ click_count: number;
446
1211
  created_at?: number | null | undefined;
447
1212
  updated_at?: number | null | undefined;
448
1213
  organization_id?: string | null | undefined;
1214
+ instructions?: string | null | undefined;
1215
+ query_name?: string | null | undefined;
1216
+ query_hint?: string | null | undefined;
449
1217
  }> & {
450
1218
  _id: import("mongoose").Types.ObjectId;
451
1219
  } & {
package/dist/index.js CHANGED
@@ -147,16 +147,20 @@ exports.ChunkSchema = new mongoose_1.Schema({
147
147
  });
148
148
  exports.PreDefinedQuerySchema = new mongoose_1.Schema({
149
149
  organization_id: { type: String },
150
- title: { type: String, minlength: 1, maxlength: 100 },
150
+ query_name: { type: String, minlength: 1, maxlength: 100 },
151
+ query_hint: { type: String, minlength: 1, maxlength: 100 },
151
152
  query: { type: String, required: true },
152
- context_ids: { type: [String] },
153
+ instructions: { type: String },
154
+ contexts: { type: [Object] },
153
155
  status: {
154
156
  type: String,
155
157
  enum: ['active', 'inactive', 'archived'],
156
158
  default: 'active',
157
159
  required: true,
158
160
  },
159
- users_ids: { type: [String] },
161
+ full_document_search: { type: Boolean, default: false },
162
+ users: { type: [Object] },
163
+ click_count: { type: Number, default: 0 },
160
164
  created_at: { type: Number },
161
165
  updated_at: { type: Number },
162
166
  }, {
package/dist/types.d.ts CHANGED
@@ -321,58 +321,289 @@ export declare const zodFullTextSchema: z.ZodObject<{
321
321
  export declare const zodPreDefinedQuerySchema: z.ZodObject<{
322
322
  _id: z.ZodOptional<z.ZodString>;
323
323
  organization_id: z.ZodOptional<z.ZodString>;
324
- title: z.ZodOptional<z.ZodString>;
324
+ query_name: z.ZodOptional<z.ZodString>;
325
+ query_hint: z.ZodOptional<z.ZodString>;
325
326
  query: z.ZodString;
326
- context_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
327
+ instructions: z.ZodOptional<z.ZodString>;
328
+ contexts: z.ZodOptional<z.ZodArray<z.ZodObject<{
329
+ _id: z.ZodOptional<z.ZodOptional<z.ZodString>>;
330
+ organization_id: z.ZodOptional<z.ZodOptional<z.ZodString>>;
331
+ title: z.ZodOptional<z.ZodString>;
332
+ ai_description: z.ZodOptional<z.ZodOptional<z.ZodString>>;
333
+ note: z.ZodOptional<z.ZodOptional<z.ZodString>>;
334
+ file_id: z.ZodOptional<z.ZodOptional<z.ZodString>>;
335
+ file_url: z.ZodOptional<z.ZodOptional<z.ZodString>>;
336
+ file_gcs_url: z.ZodOptional<z.ZodOptional<z.ZodString>>;
337
+ file_name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
338
+ type: z.ZodOptional<z.ZodOptional<z.ZodString>>;
339
+ size: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
340
+ tokens: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
341
+ is_active: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodBoolean>>>;
342
+ created_at: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
343
+ updated_at: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
344
+ uploaded_by: z.ZodOptional<z.ZodOptional<z.ZodObject<{
345
+ first_name: z.ZodOptional<z.ZodString>;
346
+ last_name: z.ZodOptional<z.ZodString>;
347
+ email: z.ZodOptional<z.ZodString>;
348
+ }, "strip", z.ZodTypeAny, {
349
+ email?: string | undefined;
350
+ first_name?: string | undefined;
351
+ last_name?: string | undefined;
352
+ }, {
353
+ email?: string | undefined;
354
+ first_name?: string | undefined;
355
+ last_name?: string | undefined;
356
+ }>>>;
357
+ bucket_name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
358
+ processing_status: z.ZodOptional<z.ZodOptional<z.ZodEnum<["pending", "processing", "completed", "failed"]>>>;
359
+ }, "strip", z.ZodTypeAny, {
360
+ _id?: string | undefined;
361
+ title?: string | undefined;
362
+ type?: string | undefined;
363
+ created_at?: number | undefined;
364
+ updated_at?: number | undefined;
365
+ organization_id?: string | undefined;
366
+ ai_description?: string | undefined;
367
+ note?: string | undefined;
368
+ file_id?: string | undefined;
369
+ file_url?: string | undefined;
370
+ file_gcs_url?: string | undefined;
371
+ file_name?: string | undefined;
372
+ size?: number | undefined;
373
+ tokens?: number | undefined;
374
+ is_active?: boolean | undefined;
375
+ uploaded_by?: {
376
+ email?: string | undefined;
377
+ first_name?: string | undefined;
378
+ last_name?: string | undefined;
379
+ } | undefined;
380
+ bucket_name?: string | undefined;
381
+ processing_status?: "pending" | "processing" | "completed" | "failed" | undefined;
382
+ }, {
383
+ _id?: string | undefined;
384
+ title?: string | undefined;
385
+ type?: string | undefined;
386
+ created_at?: number | undefined;
387
+ updated_at?: number | undefined;
388
+ organization_id?: string | undefined;
389
+ ai_description?: string | undefined;
390
+ note?: string | undefined;
391
+ file_id?: string | undefined;
392
+ file_url?: string | undefined;
393
+ file_gcs_url?: string | undefined;
394
+ file_name?: string | undefined;
395
+ size?: number | undefined;
396
+ tokens?: number | undefined;
397
+ is_active?: boolean | undefined;
398
+ uploaded_by?: {
399
+ email?: string | undefined;
400
+ first_name?: string | undefined;
401
+ last_name?: string | undefined;
402
+ } | undefined;
403
+ bucket_name?: string | undefined;
404
+ processing_status?: "pending" | "processing" | "completed" | "failed" | undefined;
405
+ }>, "many">>;
406
+ full_document_search: z.ZodOptional<z.ZodBoolean>;
327
407
  status: z.ZodDefault<z.ZodEnum<["active", "inactive", "archived"]>>;
328
- users_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
408
+ users: z.ZodOptional<z.ZodArray<z.ZodObject<{
409
+ _id: z.ZodOptional<z.ZodOptional<z.ZodString>>;
410
+ organization_memberships: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
411
+ clerk_user_id: z.ZodOptional<z.ZodString>;
412
+ email: z.ZodOptional<z.ZodString>;
413
+ first_name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
414
+ last_name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
415
+ active_until: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
416
+ notes: z.ZodOptional<z.ZodOptional<z.ZodString>>;
417
+ avatar: z.ZodOptional<z.ZodOptional<z.ZodString>>;
418
+ user_role: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodEnum<["admin", "member", "client"]>>>>;
419
+ created_at: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
420
+ updated_at: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
421
+ }, "strip", z.ZodTypeAny, {
422
+ _id?: string | undefined;
423
+ created_at?: number | undefined;
424
+ updated_at?: number | undefined;
425
+ organization_memberships?: string[] | undefined;
426
+ clerk_user_id?: string | undefined;
427
+ email?: string | undefined;
428
+ first_name?: string | undefined;
429
+ last_name?: string | undefined;
430
+ active_until?: number | undefined;
431
+ notes?: string | undefined;
432
+ avatar?: string | undefined;
433
+ user_role?: "admin" | "member" | "client" | undefined;
434
+ }, {
435
+ _id?: string | undefined;
436
+ created_at?: number | undefined;
437
+ updated_at?: number | undefined;
438
+ organization_memberships?: string[] | undefined;
439
+ clerk_user_id?: string | undefined;
440
+ email?: string | undefined;
441
+ first_name?: string | undefined;
442
+ last_name?: string | undefined;
443
+ active_until?: number | undefined;
444
+ notes?: string | undefined;
445
+ avatar?: string | undefined;
446
+ user_role?: "admin" | "member" | "client" | undefined;
447
+ }>, "many">>;
448
+ click_count: z.ZodOptional<z.ZodNumber>;
329
449
  created_at: z.ZodOptional<z.ZodNumber>;
330
450
  updated_at: z.ZodOptional<z.ZodNumber>;
331
451
  }, "strip", z.ZodTypeAny, {
332
452
  status: "active" | "inactive" | "archived";
333
453
  query: string;
334
454
  _id?: string | undefined;
335
- title?: string | undefined;
336
455
  created_at?: number | undefined;
337
456
  updated_at?: number | undefined;
338
457
  organization_id?: string | undefined;
339
- context_ids?: string[] | undefined;
340
- users_ids?: string[] | undefined;
458
+ instructions?: string | undefined;
459
+ query_name?: string | undefined;
460
+ query_hint?: string | undefined;
461
+ contexts?: {
462
+ _id?: string | undefined;
463
+ title?: string | undefined;
464
+ type?: string | undefined;
465
+ created_at?: number | undefined;
466
+ updated_at?: number | undefined;
467
+ organization_id?: string | undefined;
468
+ ai_description?: string | undefined;
469
+ note?: string | undefined;
470
+ file_id?: string | undefined;
471
+ file_url?: string | undefined;
472
+ file_gcs_url?: string | undefined;
473
+ file_name?: string | undefined;
474
+ size?: number | undefined;
475
+ tokens?: number | undefined;
476
+ is_active?: boolean | undefined;
477
+ uploaded_by?: {
478
+ email?: string | undefined;
479
+ first_name?: string | undefined;
480
+ last_name?: string | undefined;
481
+ } | undefined;
482
+ bucket_name?: string | undefined;
483
+ processing_status?: "pending" | "processing" | "completed" | "failed" | undefined;
484
+ }[] | undefined;
485
+ full_document_search?: boolean | undefined;
486
+ users?: {
487
+ _id?: string | undefined;
488
+ created_at?: number | undefined;
489
+ updated_at?: number | undefined;
490
+ organization_memberships?: string[] | undefined;
491
+ clerk_user_id?: string | undefined;
492
+ email?: string | undefined;
493
+ first_name?: string | undefined;
494
+ last_name?: string | undefined;
495
+ active_until?: number | undefined;
496
+ notes?: string | undefined;
497
+ avatar?: string | undefined;
498
+ user_role?: "admin" | "member" | "client" | undefined;
499
+ }[] | undefined;
500
+ click_count?: number | undefined;
341
501
  }, {
342
502
  query: string;
343
503
  _id?: string | undefined;
344
- title?: string | undefined;
345
504
  status?: "active" | "inactive" | "archived" | undefined;
346
505
  created_at?: number | undefined;
347
506
  updated_at?: number | undefined;
348
507
  organization_id?: string | undefined;
349
- context_ids?: string[] | undefined;
350
- users_ids?: string[] | undefined;
508
+ instructions?: string | undefined;
509
+ query_name?: string | undefined;
510
+ query_hint?: string | undefined;
511
+ contexts?: {
512
+ _id?: string | undefined;
513
+ title?: string | undefined;
514
+ type?: string | undefined;
515
+ created_at?: number | undefined;
516
+ updated_at?: number | undefined;
517
+ organization_id?: string | undefined;
518
+ ai_description?: string | undefined;
519
+ note?: string | undefined;
520
+ file_id?: string | undefined;
521
+ file_url?: string | undefined;
522
+ file_gcs_url?: string | undefined;
523
+ file_name?: string | undefined;
524
+ size?: number | undefined;
525
+ tokens?: number | undefined;
526
+ is_active?: boolean | undefined;
527
+ uploaded_by?: {
528
+ email?: string | undefined;
529
+ first_name?: string | undefined;
530
+ last_name?: string | undefined;
531
+ } | undefined;
532
+ bucket_name?: string | undefined;
533
+ processing_status?: "pending" | "processing" | "completed" | "failed" | undefined;
534
+ }[] | undefined;
535
+ full_document_search?: boolean | undefined;
536
+ users?: {
537
+ _id?: string | undefined;
538
+ created_at?: number | undefined;
539
+ updated_at?: number | undefined;
540
+ organization_memberships?: string[] | undefined;
541
+ clerk_user_id?: string | undefined;
542
+ email?: string | undefined;
543
+ first_name?: string | undefined;
544
+ last_name?: string | undefined;
545
+ active_until?: number | undefined;
546
+ notes?: string | undefined;
547
+ avatar?: string | undefined;
548
+ user_role?: "admin" | "member" | "client" | undefined;
549
+ }[] | undefined;
550
+ click_count?: number | undefined;
351
551
  }>;
352
552
  export declare const zodQuerySchema: z.ZodObject<{
353
553
  thread_id: z.ZodOptional<z.ZodString>;
354
554
  context_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
355
555
  organization_id: z.ZodString;
356
- user_id: z.ZodString;
556
+ user: z.ZodObject<{
557
+ user_id: z.ZodString;
558
+ first_name: z.ZodOptional<z.ZodString>;
559
+ last_name: z.ZodOptional<z.ZodString>;
560
+ email: z.ZodOptional<z.ZodString>;
561
+ }, "strip", z.ZodTypeAny, {
562
+ user_id: string;
563
+ email?: string | undefined;
564
+ first_name?: string | undefined;
565
+ last_name?: string | undefined;
566
+ }, {
567
+ user_id: string;
568
+ email?: string | undefined;
569
+ first_name?: string | undefined;
570
+ last_name?: string | undefined;
571
+ }>;
357
572
  query: z.ZodString;
358
573
  pre_defined_query_id: z.ZodOptional<z.ZodString>;
574
+ custom_instructions: z.ZodOptional<z.ZodString>;
575
+ full_document_search: z.ZodOptional<z.ZodBoolean>;
359
576
  timestamp: z.ZodNumber;
360
577
  }, "strip", z.ZodTypeAny, {
361
578
  organization_id: string;
362
579
  query: string;
363
- user_id: string;
580
+ user: {
581
+ user_id: string;
582
+ email?: string | undefined;
583
+ first_name?: string | undefined;
584
+ last_name?: string | undefined;
585
+ };
364
586
  timestamp: number;
365
- context_ids?: string[] | undefined;
587
+ full_document_search?: boolean | undefined;
366
588
  thread_id?: string | undefined;
589
+ context_ids?: string[] | undefined;
367
590
  pre_defined_query_id?: string | undefined;
591
+ custom_instructions?: string | undefined;
368
592
  }, {
369
593
  organization_id: string;
370
594
  query: string;
371
- user_id: string;
595
+ user: {
596
+ user_id: string;
597
+ email?: string | undefined;
598
+ first_name?: string | undefined;
599
+ last_name?: string | undefined;
600
+ };
372
601
  timestamp: number;
373
- context_ids?: string[] | undefined;
602
+ full_document_search?: boolean | undefined;
374
603
  thread_id?: string | undefined;
604
+ context_ids?: string[] | undefined;
375
605
  pre_defined_query_id?: string | undefined;
606
+ custom_instructions?: string | undefined;
376
607
  }>;
377
608
  export declare const zodThreadSchema: z.ZodObject<{
378
609
  _id: z.ZodOptional<z.ZodString>;
package/dist/types.js CHANGED
@@ -122,11 +122,15 @@ exports.zodFullTextSchema = zod_1.z.object({
122
122
  exports.zodPreDefinedQuerySchema = zod_1.z.object({
123
123
  _id: zod_1.z.string().optional(),
124
124
  organization_id: zod_1.z.string().optional(),
125
- title: zod_1.z.string().min(1).max(100).optional(),
125
+ query_name: zod_1.z.string().min(1).max(100).optional(),
126
+ query_hint: zod_1.z.string().min(1).max(100).optional(),
126
127
  query: zod_1.z.string().min(1),
127
- context_ids: zod_1.z.array(zod_1.z.string()).optional(),
128
+ instructions: zod_1.z.string().optional(),
129
+ contexts: zod_1.z.array(exports.zodContextSchema.partial()).optional(),
130
+ full_document_search: zod_1.z.boolean().optional(),
128
131
  status: zod_1.z.enum(['active', 'inactive', 'archived']).default('active'),
129
- users_ids: zod_1.z.array(zod_1.z.string()).optional(),
132
+ users: zod_1.z.array(exports.zodUserSchema.partial()).optional(),
133
+ click_count: zod_1.z.number().optional(),
130
134
  created_at: zod_1.z.number().optional(),
131
135
  updated_at: zod_1.z.number().optional(),
132
136
  });
@@ -135,9 +139,16 @@ exports.zodQuerySchema = zod_1.z.object({
135
139
  thread_id: zod_1.z.string().optional(),
136
140
  context_ids: zod_1.z.array(zod_1.z.string()).optional(),
137
141
  organization_id: zod_1.z.string(),
138
- user_id: zod_1.z.string(),
142
+ user: zod_1.z.object({
143
+ user_id: zod_1.z.string(),
144
+ first_name: zod_1.z.string().optional(),
145
+ last_name: zod_1.z.string().optional(),
146
+ email: zod_1.z.string().email().optional(),
147
+ }),
139
148
  query: zod_1.z.string().min(1),
140
149
  pre_defined_query_id: zod_1.z.string().optional(),
150
+ custom_instructions: zod_1.z.string().optional(),
151
+ full_document_search: zod_1.z.boolean().optional(),
141
152
  timestamp: zod_1.z.number(),
142
153
  });
143
154
  exports.zodThreadSchema = zod_1.z.object({
package/index.ts CHANGED
@@ -153,16 +153,20 @@ export const ChunkSchema = new Schema(
153
153
  export const PreDefinedQuerySchema = new Schema(
154
154
  {
155
155
  organization_id: { type: String },
156
- title: { type: String, minlength: 1, maxlength: 100 },
156
+ query_name: { type: String, minlength: 1, maxlength: 100 },
157
+ query_hint: { type: String, minlength: 1, maxlength: 100 },
157
158
  query: { type: String, required: true },
158
- context_ids: { type: [String] },
159
+ instructions: { type: String },
160
+ contexts: { type: [Object] },
159
161
  status: {
160
162
  type: String,
161
163
  enum: ['active', 'inactive', 'archived'],
162
164
  default: 'active',
163
165
  required: true,
164
166
  },
165
- users_ids: { type: [String] },
167
+ full_document_search: { type: Boolean, default: false },
168
+ users: { type: [Object] },
169
+ click_count: { type: Number, default: 0 },
166
170
  created_at: { type: Number },
167
171
  updated_at: { type: Number },
168
172
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chatifai",
3
- "version": "1.0.25",
3
+ "version": "1.0.27",
4
4
  "description": "SDK for interacting with the Chatifai API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/types.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { z } from 'zod';
1
+ import { custom, z } from 'zod';
2
2
 
3
3
  export const modelsList = [
4
4
  'gemini-2.5-flash-lite',
@@ -88,7 +88,6 @@ export const zodAgentSchema = z.object({
88
88
  updated_at: z.number().optional(),
89
89
  });
90
90
 
91
-
92
91
  export const zodChunkSchema = z.object({
93
92
  _id: z.string().optional(),
94
93
  chunk_id: z.string().optional(),
@@ -129,11 +128,15 @@ export const zodFullTextSchema = z.object({
129
128
  export const zodPreDefinedQuerySchema = z.object({
130
129
  _id: z.string().optional(),
131
130
  organization_id: z.string().optional(),
132
- title: z.string().min(1).max(100).optional(),
131
+ query_name: z.string().min(1).max(100).optional(),
132
+ query_hint: z.string().min(1).max(100).optional(), // A short hint to help users understand the purpose of the query
133
133
  query: z.string().min(1),
134
- context_ids: z.array(z.string()).optional(),
134
+ instructions: z.string().optional(),
135
+ contexts: z.array(zodContextSchema.partial()).optional(),
136
+ full_document_search: z.boolean().optional(),
135
137
  status: z.enum(['active', 'inactive', 'archived']).default('active'),
136
- users_ids: z.array(z.string()).optional(),
138
+ users: z.array(zodUserSchema.partial()).optional(),
139
+ click_count: z.number().optional(),
137
140
  created_at: z.number().optional(),
138
141
  updated_at: z.number().optional(),
139
142
  });
@@ -143,11 +146,18 @@ export const zodQuerySchema = z.object({
143
146
  thread_id: z.string().optional(), // If there is not thread id provided, a new thread will be created
144
147
  context_ids: z.array(z.string()).optional(), // Run on all organization files unless specific file ids are provided
145
148
  organization_id: z.string(), // Will be used to fetch the agent, contexts, chunks, etc.
146
- user_id: z.string(),
149
+ user: z.object({
150
+ user_id: z.string(),
151
+ first_name: z.string().optional(),
152
+ last_name: z.string().optional(),
153
+ email: z.string().email().optional(),
154
+ }),
147
155
  query: z.string().min(1),
148
156
  pre_defined_query_id: z.string().optional(),
157
+ custom_instructions: z.string().optional(),
158
+ full_document_search: z.boolean().optional(),
149
159
  timestamp: z.number(),
150
- })
160
+ });
151
161
 
152
162
  export const zodThreadSchema = z.object({
153
163
  _id: z.string().optional(),
@@ -189,7 +199,7 @@ export type QueueMessageBodyType<T> = {
189
199
  organization_id: string;
190
200
  data: T;
191
201
  timestamp: number;
192
- }
202
+ };
193
203
 
194
204
  export type OrganizationType = z.infer<typeof zodOrganizationSchema>;
195
205
  export type UserType = z.infer<typeof zodUserSchema>;
@@ -214,4 +224,4 @@ export enum FileType {
214
224
 
215
225
  export enum QueuesList {
216
226
  CONTEXT_PROCESS = 'context_process_queue',
217
- }
227
+ }