@saltcorn/data 0.9.5-beta.20 → 0.9.5-beta.22

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.
Files changed (38) hide show
  1. package/dist/base-plugin/actions.d.ts.map +1 -1
  2. package/dist/base-plugin/actions.js +22 -5
  3. package/dist/base-plugin/actions.js.map +1 -1
  4. package/dist/base-plugin/index.d.ts +401 -401
  5. package/dist/base-plugin/types.d.ts +1 -1
  6. package/dist/base-plugin/types.d.ts.map +1 -1
  7. package/dist/base-plugin/types.js +12 -8
  8. package/dist/base-plugin/types.js.map +1 -1
  9. package/dist/base-plugin/viewtemplates/feed.d.ts +1 -1
  10. package/dist/base-plugin/viewtemplates/feed.d.ts.map +1 -1
  11. package/dist/base-plugin/viewtemplates/feed.js +21 -6
  12. package/dist/base-plugin/viewtemplates/feed.js.map +1 -1
  13. package/dist/base-plugin/viewtemplates/show.d.ts +1 -1
  14. package/dist/base-plugin/viewtemplates/show.d.ts.map +1 -1
  15. package/dist/base-plugin/viewtemplates/show.js +11 -3
  16. package/dist/base-plugin/viewtemplates/show.js.map +1 -1
  17. package/dist/db/state.d.ts +1 -0
  18. package/dist/db/state.d.ts.map +1 -1
  19. package/dist/db/state.js.map +1 -1
  20. package/dist/models/file.d.ts +1 -0
  21. package/dist/models/file.d.ts.map +1 -1
  22. package/dist/models/file.js +3 -0
  23. package/dist/models/file.js.map +1 -1
  24. package/dist/models/index.d.ts +1 -1
  25. package/dist/models/view.d.ts.map +1 -1
  26. package/dist/models/view.js +9 -2
  27. package/dist/models/view.js.map +1 -1
  28. package/dist/tests/exact_views.test.js +4 -4
  29. package/dist/tests/exact_views.test.js.map +1 -1
  30. package/dist/tests/file.test.js +3 -0
  31. package/dist/tests/file.test.js.map +1 -1
  32. package/dist/tests/mocks.js +1 -1
  33. package/dist/tests/mocks.js.map +1 -1
  34. package/dist/utils.d.ts +3 -2
  35. package/dist/utils.d.ts.map +1 -1
  36. package/dist/utils.js +16 -0
  37. package/dist/utils.js.map +1 -1
  38. package/package.json +8 -8
@@ -1,151 +1,4 @@
1
1
  export const types: ({
2
- name: string;
3
- sql_name: string;
4
- js_type: string;
5
- contract: () => Function;
6
- fieldviews: {
7
- show: {
8
- isEdit: boolean;
9
- description: string;
10
- run: (v: any) => any;
11
- };
12
- checkboxes: {
13
- isEdit: boolean;
14
- description: string;
15
- run: (v: any) => any;
16
- };
17
- TrueFalse: {
18
- isEdit: boolean;
19
- description: string;
20
- run: (v: any) => "" | "True" | "False";
21
- };
22
- edit: {
23
- isEdit: boolean;
24
- description: string;
25
- configFields: ({
26
- name: string;
27
- label: string;
28
- type: string;
29
- attributes: {
30
- options: string[];
31
- };
32
- } | {
33
- name: string;
34
- label: string;
35
- type: string;
36
- attributes?: undefined;
37
- })[];
38
- run: (nm: any, v: any, attrs: any, cls: any, required: any, field: any) => any;
39
- };
40
- switch: {
41
- isEdit: boolean;
42
- description: string;
43
- run: (nm: any, v: any, attrs: any, cls: any, required: any, field: any) => any;
44
- };
45
- show_with_html: {
46
- configFields: {
47
- input_type: string;
48
- name: string;
49
- label: string;
50
- sublabel: string;
51
- default: string;
52
- attributes: {
53
- mode: string;
54
- };
55
- }[];
56
- isEdit: boolean;
57
- description: string;
58
- run: (v: any, req: any, attrs?: {}) => any;
59
- };
60
- tristate: {
61
- isEdit: boolean;
62
- description: string;
63
- configFields: {
64
- name: string;
65
- label: string;
66
- type: string;
67
- }[];
68
- run: (nm: any, v: any, attrs: any, cls: any, required: any, field: any) => any;
69
- };
70
- };
71
- attributes: object[];
72
- readFromFormRecord: (rec: any, name: string) => boolean | null;
73
- read: (v: object) => boolean | null;
74
- readFromDB: (v: object) => object;
75
- listAs: (v: object) => object;
76
- validate: () => boolean;
77
- } | {
78
- name: string;
79
- sql_name: string;
80
- js_type: string;
81
- contract: () => Function;
82
- attributes: object[];
83
- fieldviews: {
84
- show: {
85
- isEdit: boolean;
86
- description: string;
87
- run: (d: any, req: any, attrs?: {}) => any;
88
- };
89
- showDay: {
90
- isEdit: boolean;
91
- description: string;
92
- run: (d: any, req: any) => any;
93
- };
94
- format: {
95
- isEdit: boolean;
96
- description: string;
97
- configFields: {
98
- name: string;
99
- label: string;
100
- type: string;
101
- sublabel: string;
102
- }[];
103
- run: (d: any, req: any, options: any) => any;
104
- };
105
- relative: {
106
- isEdit: boolean;
107
- description: string;
108
- run: (d: any, req: any) => string;
109
- };
110
- yearsAgo: {
111
- isEdit: boolean;
112
- description: string;
113
- run: (d: any, req: any) => string;
114
- };
115
- show_with_html: {
116
- configFields: {
117
- input_type: string;
118
- name: string;
119
- label: string;
120
- sublabel: string;
121
- default: string;
122
- attributes: {
123
- mode: string;
124
- };
125
- }[];
126
- isEdit: boolean;
127
- description: string;
128
- run: (v: any, req: any, attrs?: {}) => any;
129
- };
130
- edit: {
131
- isEdit: boolean;
132
- blockDisplay: boolean;
133
- description: string;
134
- run: (nm: any, v: any, attrs: any, cls: any, required: any, field: any) => any;
135
- };
136
- editDay: {
137
- isEdit: boolean;
138
- blockDisplay: boolean;
139
- description: string;
140
- run: (nm: any, v: any, attrs: any, cls: any, required: any, field: any) => any;
141
- };
142
- };
143
- presets: {
144
- Now: () => Date;
145
- };
146
- read: (v: object, attrs: object) => object;
147
- validate: () => boolean;
148
- } | {
149
2
  name: string;
150
3
  sql_name: string;
151
4
  js_type: string;
@@ -830,52 +683,218 @@ export const types: ({
830
683
  attributes: object[];
831
684
  read: (v: object) => string | number | undefined;
832
685
  validate: ({ min, max }: object) => boolean | object;
833
- })[];
834
- export const viewtemplates: ({
686
+ } | {
835
687
  name: string;
836
- description: string;
837
- get_state_fields: () => object[];
838
- configuration_workflow: () => import("../models/workflow");
839
- run: (table_id: number, viewname: string, { columns, layout }: {
840
- columns: object[];
841
- layout: object;
842
- }, state: object, extra: object, { distinctValuesQuery }: {
843
- distinctValuesQuery: any;
844
- }) => Promise<Layout>;
845
- initial_config: () => Promise<object>;
846
- display_state_form: boolean;
847
- getStringsForI18n({ layout }: {
848
- layout: any;
849
- }): string[];
850
- routes: {
851
- run_action: (table_id: any, viewname: any, config: any, body: any, { req, res }: {
852
- req: any;
853
- res: any;
854
- }, { actionQuery }: {
855
- actionQuery: any;
856
- }) => Promise<any>;
857
- };
858
- queries: ({ table_id, viewname, configuration: { columns }, req, res, exttable_name, }: {
859
- table_id: any;
860
- viewname: any;
861
- configuration: {
862
- columns: any;
688
+ sql_name: string;
689
+ js_type: string;
690
+ contract: () => Function;
691
+ attributes: object[];
692
+ fieldviews: {
693
+ show: {
694
+ isEdit: boolean;
695
+ description: string;
696
+ run: (d: any, req: any, attrs?: {}) => any;
863
697
  };
864
- req: any;
865
- res: any;
866
- exttable_name: any;
867
- }) => {
868
- actionQuery(state: any, rndid: any): Promise<{
869
- json: any;
870
- }>;
871
- distinctValuesQuery(state: any): Promise<{
872
- distinct_values: {};
873
- role: any;
874
- }>;
698
+ showDay: {
699
+ isEdit: boolean;
700
+ description: string;
701
+ run: (d: any, req: any) => any;
702
+ };
703
+ format: {
704
+ isEdit: boolean;
705
+ description: string;
706
+ configFields: {
707
+ name: string;
708
+ label: string;
709
+ type: string;
710
+ sublabel: string;
711
+ }[];
712
+ run: (d: any, req: any, options: any) => any;
713
+ };
714
+ relative: {
715
+ isEdit: boolean;
716
+ description: string;
717
+ run: (d: any, req: any) => string;
718
+ };
719
+ yearsAgo: {
720
+ isEdit: boolean;
721
+ description: string;
722
+ run: (d: any, req: any) => string;
723
+ };
724
+ show_with_html: {
725
+ configFields: {
726
+ input_type: string;
727
+ name: string;
728
+ label: string;
729
+ sublabel: string;
730
+ default: string;
731
+ attributes: {
732
+ mode: string;
733
+ };
734
+ }[];
735
+ isEdit: boolean;
736
+ description: string;
737
+ run: (v: any, req: any, attrs?: {}) => any;
738
+ };
739
+ edit: {
740
+ isEdit: boolean;
741
+ blockDisplay: boolean;
742
+ description: string;
743
+ run: (nm: any, v: any, attrs: any, cls: any, required: any, field: any) => any;
744
+ };
745
+ editDay: {
746
+ isEdit: boolean;
747
+ blockDisplay: boolean;
748
+ description: string;
749
+ run: (nm: any, v: any, attrs: any, cls: any, required: any, field: any) => any;
750
+ };
751
+ };
752
+ presets: {
753
+ Now: () => Date;
875
754
  };
755
+ read: (v: object, attrs: object) => object;
756
+ validate: () => boolean;
876
757
  } | {
877
758
  name: string;
878
- description: string;
759
+ sql_name: string;
760
+ js_type: string;
761
+ contract: () => Function;
762
+ fieldviews: {
763
+ show: {
764
+ isEdit: boolean;
765
+ description: string;
766
+ run: (v: any, req: any) => any;
767
+ };
768
+ checkboxes: {
769
+ isEdit: boolean;
770
+ description: string;
771
+ run: (v: any) => any;
772
+ };
773
+ TrueFalse: {
774
+ isEdit: boolean;
775
+ description: string;
776
+ run: (v: any) => "" | "True" | "False";
777
+ };
778
+ edit: {
779
+ isEdit: boolean;
780
+ description: string;
781
+ configFields: ({
782
+ name: string;
783
+ label: string;
784
+ type: string;
785
+ attributes: {
786
+ options: string[];
787
+ };
788
+ } | {
789
+ name: string;
790
+ label: string;
791
+ type: string;
792
+ attributes?: undefined;
793
+ })[];
794
+ run: (nm: any, v: any, attrs: any, cls: any, required: any, field: any) => any;
795
+ };
796
+ switch: {
797
+ isEdit: boolean;
798
+ description: string;
799
+ run: (nm: any, v: any, attrs: any, cls: any, required: any, field: any) => any;
800
+ };
801
+ show_with_html: {
802
+ configFields: {
803
+ input_type: string;
804
+ name: string;
805
+ label: string;
806
+ sublabel: string;
807
+ default: string;
808
+ attributes: {
809
+ mode: string;
810
+ };
811
+ }[];
812
+ isEdit: boolean;
813
+ description: string;
814
+ run: (v: any, req: any, attrs?: {}) => any;
815
+ };
816
+ tristate: {
817
+ isEdit: boolean;
818
+ description: string;
819
+ configFields: {
820
+ name: string;
821
+ label: string;
822
+ type: string;
823
+ }[];
824
+ run: (nm: any, v: any, attrs: any, cls: any, required: any, field: any) => any;
825
+ };
826
+ };
827
+ attributes: object[];
828
+ readFromFormRecord: (rec: any, name: string) => boolean | null;
829
+ read: (v: object) => boolean | null;
830
+ readFromDB: (v: object) => object;
831
+ listAs: (v: object) => object;
832
+ validate: () => boolean;
833
+ })[];
834
+ export const viewtemplates: ({
835
+ name: string;
836
+ description: string;
837
+ configuration_workflow: (req: object) => import("../models/workflow");
838
+ run: (table_id: string | number, viewname: string, { columns, layout, view_to_create, create_view_display, create_view_label, default_state, create_view_location, create_link_style, create_link_size, create_view_showif, }: {
839
+ columns: object[];
840
+ view_to_create?: string | undefined;
841
+ create_view_display: string;
842
+ create_view_label?: string | undefined;
843
+ default_state?: object | undefined;
844
+ create_view_location?: string | undefined;
845
+ }, stateWithId?: object | undefined, extraOpts: object, { listQuery }: {
846
+ listQuery: any;
847
+ }) => Promise<any>;
848
+ view_quantity: string;
849
+ get_state_fields: (table_id: string, viewname: any, { columns }: {
850
+ columns: object[];
851
+ }) => Function;
852
+ initial_config: Function;
853
+ on_delete: (table_id: any, viewname: string, { default_state }: {
854
+ default_state: any;
855
+ }) => Promise<void>;
856
+ routes: {
857
+ run_action: (table_id: number, viewname: any, { columns, layout }: {
858
+ columns: object[];
859
+ layout: any;
860
+ }, body: object, { req, res }: {
861
+ req: object;
862
+ res: any;
863
+ }, { getRowQuery }: {
864
+ getRowQuery: any;
865
+ }) => Promise<object>;
866
+ };
867
+ display_state_form: (opts: object) => boolean;
868
+ default_state_form: ({ default_state }: object) => boolean;
869
+ getStringsForI18n({ columns, create_view_label }: {
870
+ columns: any;
871
+ create_view_label: any;
872
+ }): string[];
873
+ queries: ({ table_id, exttable_name, name, configuration: { columns, layout, default_state }, req, }: {
874
+ table_id: any;
875
+ exttable_name: any;
876
+ name: any;
877
+ configuration: {
878
+ columns: any;
879
+ layout: any;
880
+ default_state: any;
881
+ };
882
+ req: any;
883
+ }) => {
884
+ listQuery(state: any, stateHash: any): Promise<{
885
+ rows: import("@saltcorn/db-common/internal").Row[];
886
+ rowCount: number;
887
+ }>;
888
+ getRowQuery(id: any): Promise<import("@saltcorn/db-common/internal").Row | null>;
889
+ };
890
+ configCheck: (view: any) => Promise<{
891
+ errors: string[];
892
+ warnings: string[];
893
+ }>;
894
+ connectedObjects: (configuration: any) => Promise<import("@saltcorn/types/base_types").ConnectedObjects>;
895
+ } | {
896
+ name: string;
897
+ description: string;
879
898
  configuration_workflow: (req: object) => import("../models/workflow");
880
899
  run: (table_id: number, viewname: string, cfg: any, state: string, { res, req }: {
881
900
  req: object;
@@ -1030,108 +1049,119 @@ export const viewtemplates: ({
1030
1049
  } | {
1031
1050
  name: string;
1032
1051
  description: string;
1033
- configuration_workflow: (req: object) => import("../models/workflow");
1034
- run: (table_id: string, viewname: string, { participant_field, msg_relation, msgsender_field, msgview, msgform, participant_maxread_field, }: {
1035
- participant_field: string;
1036
- msg_relation: string;
1037
- msgsender_field: any;
1038
- msgview: string;
1039
- msgform: string;
1040
- participant_maxread_field: string;
1041
- }, state: object, { req, res }: {
1042
- req: object;
1043
- res: object;
1044
- }, { getRowQuery, updateQuery, optionsQuery }: {
1045
- getRowQuery: any;
1046
- updateQuery: any;
1047
- optionsQuery: any;
1048
- }) => Promise<div>;
1049
1052
  get_state_fields: () => object[];
1053
+ configuration_workflow: (req: object) => import("../models/workflow");
1054
+ run: (table_id: string, viewname: string, { columns, layout, page_title, page_title_formula }: {
1055
+ columns: object[];
1056
+ layout: object;
1057
+ page_title?: string | undefined;
1058
+ page_title_formula: boolean;
1059
+ }, state: object, extra: object, { showQuery }: {
1060
+ showQuery: any;
1061
+ }) => Promise<string>;
1062
+ runMany: (table_id: number, viewname: string, { columns, layout }: {
1063
+ columns: object[];
1064
+ layout: object;
1065
+ }, state: object, extra: object, { runManyQuery }: {
1066
+ runManyQuery: any;
1067
+ }) => Promise<object[]>;
1068
+ renderRows: (table: object, viewname: string, { columns, layout }: {
1069
+ columns: object[];
1070
+ layout: object;
1071
+ }, extra: object, rows: object[], state: any) => Promise<string>;
1072
+ initial_config: Function;
1050
1073
  display_state_form: boolean;
1051
1074
  routes: {
1052
- submit_msg_ajax: (table_id: any, viewname: string, { participant_field, msg_relation, msgsender_field, msgview, msgform, participant_maxread_field, }: {
1053
- participant_field: string;
1054
- msg_relation: string;
1055
- msgsender_field: any;
1056
- msgview: string;
1057
- msgform: string;
1058
- participant_maxread_field: string;
1075
+ run_action: (table_id: number, viewname: any, { columns, layout }: {
1076
+ columns: object[];
1077
+ layout: any;
1059
1078
  }, body: any, { req, res }: {
1060
1079
  req: object;
1061
- res: object;
1062
- }, { submitAjaxQuery }: {
1063
- submitAjaxQuery: any;
1080
+ res: any;
1081
+ }, { actionQuery }: {
1082
+ actionQuery: any;
1064
1083
  }) => Promise<object>;
1065
- ack_read: (table_id: any, viewname: any, { participant_field, participant_maxread_field }: {
1066
- participant_field: string;
1067
- participant_maxread_field: string;
1068
- }, body: any, { req, res }: {
1069
- req: object;
1070
- res: object;
1071
- }, { ackReadQuery }: {
1072
- ackReadQuery: any;
1073
- }) => Promise<void>;
1074
- fetch_older_msg: (table_id: any, viewname: any, { participant_field, msg_relation, msgsender_field, msgview, msgform, participant_maxread_field, }: object, body: object, { req, res }: string, { fetchOlderMsgQuery }: any) => Promise<object>;
1075
1084
  };
1076
- noAutoTest: boolean;
1077
- authorize_join: ({ table_id, min_role, configuration: { participant_field } }: {
1078
- participant_field: object;
1079
- }, room_id: string, user: object) => Promise<object>;
1080
- virtual_triggers: (table_id: any, viewname: string, { participant_field, msg_relation, msgsender_field, msgview, msgform, participant_maxread_field, }: {
1081
- participant_field: any;
1082
- msg_relation: string;
1083
- msgsender_field: string;
1084
- msgview: string;
1085
- msgform: any;
1086
- participant_maxread_field: any;
1087
- }) => object[];
1088
- getStringsForI18n(): object[];
1089
- queries: ({ table_id, viewname, configuration: { columns, default_state }, req, }: {
1085
+ getStringsForI18n({ layout }: {
1086
+ layout: object;
1087
+ }): string[];
1088
+ interpolate_title_string(table_id: any, title: any, state: any): Promise<any>;
1089
+ queries: ({ table_id, exttable_name, name, configuration: { columns, layout }, req, res, }: {
1090
1090
  table_id: any;
1091
- viewname: any;
1091
+ exttable_name: any;
1092
+ name: any;
1092
1093
  configuration: {
1093
1094
  columns: any;
1094
- default_state: any;
1095
+ layout: any;
1095
1096
  };
1096
1097
  req: any;
1098
+ res: any;
1097
1099
  }) => {
1098
- getRowQuery(state_id: any, part_table_name: any, part_user_field: any, part_key_to_room: any): Promise<import("@saltcorn/db-common/internal").Row | null>;
1099
- updateQuery(partRow: any, part_table_name: any, max_read_id: any, part_maxread_field: any): Promise<void>;
1100
- submitAjaxQuery(msg_relation: any, participant_field: any, body: any, msgform: any, msgsender_field: any, participant_maxread_field: any): Promise<{
1101
- json: {
1102
- msgid: {
1103
- error: string;
1104
- } | {
1105
- success: any;
1106
- };
1107
- error?: undefined;
1108
- };
1109
- } | {
1110
- json: {
1111
- error: any;
1112
- msgid?: undefined;
1113
- };
1114
- }>;
1115
- ackReadQuery(participant_field: any, participant_maxread_field: any, body: any): Promise<{
1116
- json: {
1117
- error: string;
1118
- success?: undefined;
1119
- };
1100
+ showQuery(state: any): Promise<{
1101
+ rows: null;
1102
+ message: string;
1120
1103
  } | {
1121
- json: {
1122
- success: string;
1123
- error?: undefined;
1124
- };
1104
+ rows: import("@saltcorn/db-common/internal").Row[];
1105
+ message: null;
1106
+ }>;
1107
+ runManyQuery(state: any, { where, limit, offset, joinFieldsExtra, orderBy, orderDesc }: {
1108
+ where: any;
1109
+ limit: any;
1110
+ offset: any;
1111
+ joinFieldsExtra: any;
1112
+ orderBy: any;
1113
+ orderDesc: any;
1114
+ }): Promise<import("@saltcorn/db-common/internal").Row[]>;
1115
+ actionQuery(): Promise<{
1116
+ json: any;
1125
1117
  }>;
1126
- fetchOlderMsgQuery(participant_field: any, body: any): Promise<import("@saltcorn/db-common/internal").Row | null>;
1127
- optionsQuery(reftable_name: any, type: any, attributes: any, where: any): Promise<any>;
1128
1118
  };
1119
+ configCheck: (view: any) => Promise<{
1120
+ errors: string[];
1121
+ warnings: string[];
1122
+ }>;
1129
1123
  connectedObjects: (configuration: any) => Promise<import("@saltcorn/types/base_types").ConnectedObjects>;
1130
1124
  } | {
1131
1125
  name: string;
1132
1126
  description: string;
1133
1127
  configuration_workflow: (req: object) => import("../models/workflow");
1134
- run: (table_id: number, viewname: string, { show_view, order_field, descending, view_to_create, create_view_display, in_card, view_decoration, initial_open_accordions, title_formula, masonry_columns, rows_per_page, hide_pagination, create_view_label, create_view_location, create_link_style, create_link_size, create_view_showif, always_create_view, include_fml, exclusion_relation, exclusion_where, empty_view, groupby, ...cols }: {
1128
+ run: (table_id: string, viewname: string, { list_view, show_view, list_width, subtables }: {
1129
+ list_view: string;
1130
+ show_view: string;
1131
+ subtables: object;
1132
+ }, state: any, extraArgs: any, { getRowQuery }: {
1133
+ getRowQuery: any;
1134
+ }) => Promise<div>;
1135
+ get_state_fields: (table_id: any, viewname: any, { list_view, show_view }: {
1136
+ list_view: string;
1137
+ show_view: any;
1138
+ }) => Promise<object[]>;
1139
+ display_state_form: ({ list_view, _omit_state_form }: {
1140
+ list_view: string;
1141
+ _omit_state_form: boolean;
1142
+ }) => boolean;
1143
+ queries: ({ table_id, viewname, configuration: { columns, default_state }, req, }: {
1144
+ table_id: any;
1145
+ viewname: any;
1146
+ configuration: {
1147
+ columns: any;
1148
+ default_state: any;
1149
+ };
1150
+ req: any;
1151
+ }) => {
1152
+ getRowQuery(uniques: any): Promise<import("@saltcorn/db-common/internal").Row | null>;
1153
+ };
1154
+ connectedObjects: ({ list_view, subtables }: {
1155
+ list_view: any;
1156
+ subtables: any;
1157
+ }) => Promise<{
1158
+ embeddedViews: import("../models/view")[];
1159
+ }>;
1160
+ } | {
1161
+ name: string;
1162
+ description: string;
1163
+ configuration_workflow: (req: object) => import("../models/workflow");
1164
+ run: (table_id: number, viewname: string, { show_view, order_field, descending, view_to_create, create_view_display, in_card, view_decoration, initial_open_accordions, title_formula, masonry_columns, rows_per_page, hide_pagination, create_view_label, create_view_location, create_link_style, create_link_size, create_view_showif, always_create_view, include_fml, exclusion_relation, exclusion_where, empty_view, groupby, lazy_accordions, ...cols }: {
1135
1165
  show_view: string;
1136
1166
  order_field: void;
1137
1167
  descending: boolean;
@@ -1171,157 +1201,103 @@ export const viewtemplates: ({
1171
1201
  name: string;
1172
1202
  description: string;
1173
1203
  get_state_fields: () => object[];
1174
- configuration_workflow: (req: object) => import("../models/workflow");
1175
- run: (table_id: string, viewname: string, { columns, layout, page_title, page_title_formula }: {
1176
- columns: object[];
1177
- layout: object;
1178
- page_title?: string | undefined;
1179
- page_title_formula: boolean;
1180
- }, state: object, extra: object, { showQuery }: {
1181
- showQuery: any;
1182
- }) => Promise<string>;
1183
- runMany: (table_id: number, viewname: string, { columns, layout }: {
1184
- columns: object[];
1185
- layout: object;
1186
- }, state: object, extra: object, { runManyQuery }: {
1187
- runManyQuery: any;
1188
- }) => Promise<object[]>;
1189
- renderRows: (table: object, viewname: string, { columns, layout }: {
1204
+ configuration_workflow: () => import("../models/workflow");
1205
+ run: (table_id: number, viewname: string, { columns, layout }: {
1190
1206
  columns: object[];
1191
1207
  layout: object;
1192
- }, extra: object, rows: object[], state: any) => Promise<string>;
1193
- initial_config: Function;
1208
+ }, state: object, extra: object, { distinctValuesQuery }: {
1209
+ distinctValuesQuery: any;
1210
+ }) => Promise<Layout>;
1211
+ initial_config: () => Promise<object>;
1194
1212
  display_state_form: boolean;
1213
+ getStringsForI18n({ layout }: {
1214
+ layout: any;
1215
+ }): string[];
1195
1216
  routes: {
1196
- run_action: (table_id: number, viewname: any, { columns, layout }: {
1197
- columns: object[];
1198
- layout: any;
1199
- }, body: any, { req, res }: {
1200
- req: object;
1217
+ run_action: (table_id: any, viewname: any, config: any, body: any, { req, res }: {
1218
+ req: any;
1201
1219
  res: any;
1202
1220
  }, { actionQuery }: {
1203
1221
  actionQuery: any;
1204
- }) => Promise<object>;
1222
+ }) => Promise<any>;
1205
1223
  };
1206
- getStringsForI18n({ layout }: {
1207
- layout: object;
1208
- }): string[];
1209
- interpolate_title_string(table_id: any, title: any, state: any): Promise<any>;
1210
- queries: ({ table_id, exttable_name, name, configuration: { columns, layout }, req, res, }: {
1224
+ queries: ({ table_id, viewname, configuration: { columns }, req, res, exttable_name, }: {
1211
1225
  table_id: any;
1212
- exttable_name: any;
1213
- name: any;
1226
+ viewname: any;
1214
1227
  configuration: {
1215
1228
  columns: any;
1216
- layout: any;
1217
1229
  };
1218
1230
  req: any;
1219
1231
  res: any;
1232
+ exttable_name: any;
1220
1233
  }) => {
1221
- showQuery(state: any, fields: any): Promise<{
1222
- rows: null;
1223
- message: string;
1224
- } | {
1225
- rows: import("@saltcorn/db-common/internal").Row[];
1226
- message: null;
1227
- }>;
1228
- runManyQuery(state: any, { where, limit, offset, joinFieldsExtra, orderBy, orderDesc }: {
1229
- where: any;
1230
- limit: any;
1231
- offset: any;
1232
- joinFieldsExtra: any;
1233
- orderBy: any;
1234
- orderDesc: any;
1235
- }): Promise<import("@saltcorn/db-common/internal").Row[]>;
1236
- actionQuery(): Promise<{
1234
+ actionQuery(state: any, rndid: any): Promise<{
1237
1235
  json: any;
1238
1236
  }>;
1237
+ distinctValuesQuery(state: any): Promise<{
1238
+ distinct_values: {};
1239
+ role: any;
1240
+ }>;
1239
1241
  };
1240
- configCheck: (view: any) => Promise<{
1241
- errors: string[];
1242
- warnings: string[];
1243
- }>;
1244
- connectedObjects: (configuration: any) => Promise<import("@saltcorn/types/base_types").ConnectedObjects>;
1245
1242
  } | {
1246
1243
  name: string;
1247
1244
  description: string;
1248
1245
  configuration_workflow: (req: object) => import("../models/workflow");
1249
- run: (table_id: string | number, viewname: string, { columns, layout, view_to_create, create_view_display, create_view_label, default_state, create_view_location, create_link_style, create_link_size, create_view_showif, }: {
1250
- columns: object[];
1251
- view_to_create?: string | undefined;
1252
- create_view_display: string;
1253
- create_view_label?: string | undefined;
1254
- default_state?: object | undefined;
1255
- create_view_location?: string | undefined;
1256
- }, stateWithId?: object | undefined, extraOpts: object, { listQuery }: {
1257
- listQuery: any;
1258
- }) => Promise<any>;
1259
- view_quantity: string;
1260
- get_state_fields: (table_id: string, viewname: any, { columns }: {
1261
- columns: object[];
1262
- }) => Function;
1263
- initial_config: Function;
1264
- on_delete: (table_id: any, viewname: string, { default_state }: {
1265
- default_state: any;
1266
- }) => Promise<void>;
1246
+ run: (table_id: string, viewname: string, { participant_field, msg_relation, msgsender_field, msgview, msgform, participant_maxread_field, }: {
1247
+ participant_field: string;
1248
+ msg_relation: string;
1249
+ msgsender_field: any;
1250
+ msgview: string;
1251
+ msgform: string;
1252
+ participant_maxread_field: string;
1253
+ }, state: object, { req, res }: {
1254
+ req: object;
1255
+ res: object;
1256
+ }, { getRowQuery, updateQuery, optionsQuery }: {
1257
+ getRowQuery: any;
1258
+ updateQuery: any;
1259
+ optionsQuery: any;
1260
+ }) => Promise<div>;
1261
+ get_state_fields: () => object[];
1262
+ display_state_form: boolean;
1267
1263
  routes: {
1268
- run_action: (table_id: number, viewname: any, { columns, layout }: {
1269
- columns: object[];
1270
- layout: any;
1271
- }, body: object, { req, res }: {
1264
+ submit_msg_ajax: (table_id: any, viewname: string, { participant_field, msg_relation, msgsender_field, msgview, msgform, participant_maxread_field, }: {
1265
+ participant_field: string;
1266
+ msg_relation: string;
1267
+ msgsender_field: any;
1268
+ msgview: string;
1269
+ msgform: string;
1270
+ participant_maxread_field: string;
1271
+ }, body: any, { req, res }: {
1272
1272
  req: object;
1273
- res: any;
1274
- }, { getRowQuery }: {
1275
- getRowQuery: any;
1273
+ res: object;
1274
+ }, { submitAjaxQuery }: {
1275
+ submitAjaxQuery: any;
1276
1276
  }) => Promise<object>;
1277
+ ack_read: (table_id: any, viewname: any, { participant_field, participant_maxread_field }: {
1278
+ participant_field: string;
1279
+ participant_maxread_field: string;
1280
+ }, body: any, { req, res }: {
1281
+ req: object;
1282
+ res: object;
1283
+ }, { ackReadQuery }: {
1284
+ ackReadQuery: any;
1285
+ }) => Promise<void>;
1286
+ fetch_older_msg: (table_id: any, viewname: any, { participant_field, msg_relation, msgsender_field, msgview, msgform, participant_maxread_field, }: object, body: object, { req, res }: string, { fetchOlderMsgQuery }: any) => Promise<object>;
1277
1287
  };
1278
- display_state_form: (opts: object) => boolean;
1279
- default_state_form: ({ default_state }: object) => boolean;
1280
- getStringsForI18n({ columns, create_view_label }: {
1281
- columns: any;
1282
- create_view_label: any;
1283
- }): string[];
1284
- queries: ({ table_id, exttable_name, name, configuration: { columns, layout, default_state }, req, }: {
1285
- table_id: any;
1286
- exttable_name: any;
1287
- name: any;
1288
- configuration: {
1289
- columns: any;
1290
- layout: any;
1291
- default_state: any;
1292
- };
1293
- req: any;
1294
- }) => {
1295
- listQuery(state: any, stateHash: any): Promise<{
1296
- rows: import("@saltcorn/db-common/internal").Row[];
1297
- rowCount: number;
1298
- }>;
1299
- getRowQuery(id: any): Promise<import("@saltcorn/db-common/internal").Row | null>;
1300
- };
1301
- configCheck: (view: any) => Promise<{
1302
- errors: string[];
1303
- warnings: string[];
1304
- }>;
1305
- connectedObjects: (configuration: any) => Promise<import("@saltcorn/types/base_types").ConnectedObjects>;
1306
- } | {
1307
- name: string;
1308
- description: string;
1309
- configuration_workflow: (req: object) => import("../models/workflow");
1310
- run: (table_id: string, viewname: string, { list_view, show_view, list_width, subtables }: {
1311
- list_view: string;
1312
- show_view: string;
1313
- subtables: object;
1314
- }, state: any, extraArgs: any, { getRowQuery }: {
1315
- getRowQuery: any;
1316
- }) => Promise<div>;
1317
- get_state_fields: (table_id: any, viewname: any, { list_view, show_view }: {
1318
- list_view: string;
1319
- show_view: any;
1320
- }) => Promise<object[]>;
1321
- display_state_form: ({ list_view, _omit_state_form }: {
1322
- list_view: string;
1323
- _omit_state_form: boolean;
1324
- }) => boolean;
1288
+ noAutoTest: boolean;
1289
+ authorize_join: ({ table_id, min_role, configuration: { participant_field } }: {
1290
+ participant_field: object;
1291
+ }, room_id: string, user: object) => Promise<object>;
1292
+ virtual_triggers: (table_id: any, viewname: string, { participant_field, msg_relation, msgsender_field, msgview, msgform, participant_maxread_field, }: {
1293
+ participant_field: any;
1294
+ msg_relation: string;
1295
+ msgsender_field: string;
1296
+ msgview: string;
1297
+ msgform: any;
1298
+ participant_maxread_field: any;
1299
+ }) => object[];
1300
+ getStringsForI18n(): object[];
1325
1301
  queries: ({ table_id, viewname, configuration: { columns, default_state }, req, }: {
1326
1302
  table_id: any;
1327
1303
  viewname: any;
@@ -1331,14 +1307,38 @@ export const viewtemplates: ({
1331
1307
  };
1332
1308
  req: any;
1333
1309
  }) => {
1334
- getRowQuery(uniques: any): Promise<import("@saltcorn/db-common/internal").Row | null>;
1310
+ getRowQuery(state_id: any, part_table_name: any, part_user_field: any, part_key_to_room: any): Promise<import("@saltcorn/db-common/internal").Row | null>;
1311
+ updateQuery(partRow: any, part_table_name: any, max_read_id: any, part_maxread_field: any): Promise<void>;
1312
+ submitAjaxQuery(msg_relation: any, participant_field: any, body: any, msgform: any, msgsender_field: any, participant_maxread_field: any): Promise<{
1313
+ json: {
1314
+ msgid: {
1315
+ error: string;
1316
+ } | {
1317
+ success: any;
1318
+ };
1319
+ error?: undefined;
1320
+ };
1321
+ } | {
1322
+ json: {
1323
+ error: any;
1324
+ msgid?: undefined;
1325
+ };
1326
+ }>;
1327
+ ackReadQuery(participant_field: any, participant_maxread_field: any, body: any): Promise<{
1328
+ json: {
1329
+ error: string;
1330
+ success?: undefined;
1331
+ };
1332
+ } | {
1333
+ json: {
1334
+ success: string;
1335
+ error?: undefined;
1336
+ };
1337
+ }>;
1338
+ fetchOlderMsgQuery(participant_field: any, body: any): Promise<import("@saltcorn/db-common/internal").Row | null>;
1339
+ optionsQuery(reftable_name: any, type: any, attributes: any, where: any): Promise<any>;
1335
1340
  };
1336
- connectedObjects: ({ list_view, subtables }: {
1337
- list_view: any;
1338
- subtables: any;
1339
- }) => Promise<{
1340
- embeddedViews: import("../models/view")[];
1341
- }>;
1341
+ connectedObjects: (configuration: any) => Promise<import("@saltcorn/types/base_types").ConnectedObjects>;
1342
1342
  })[];
1343
1343
  import fileviews = require("./fileviews");
1344
1344
  import actions = require("./actions");