@saltcorn/data 0.9.4-beta.2 → 0.9.4-beta.4

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.
@@ -1,4 +1,151 @@
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
+ } | {
2
149
  name: string;
3
150
  sql_name: string;
4
151
  js_type: string;
@@ -442,243 +589,96 @@ export const types: ({
442
589
  name: string;
443
590
  sql_name: string;
444
591
  js_type: string;
445
- contract: () => Function;
592
+ contract: ({ min, max }: {
593
+ min: number;
594
+ max: number;
595
+ }) => Function;
446
596
  fieldviews: {
447
597
  show: {
448
598
  isEdit: boolean;
449
599
  description: string;
450
- run: (v: any) => any;
600
+ run: (s: any) => string;
451
601
  };
452
- checkboxes: {
602
+ edit: {
453
603
  isEdit: boolean;
604
+ blockDisplay: boolean;
454
605
  description: string;
455
- run: (v: any) => any;
606
+ configFields: {
607
+ name: string;
608
+ label: string;
609
+ type: string;
610
+ }[];
611
+ run: (nm: any, v: any, attrs: any, cls: any, required: any, field: any) => any;
456
612
  };
457
- TrueFalse: {
613
+ number_slider: {
614
+ configFields: (field: any) => {
615
+ name: string;
616
+ type: any;
617
+ required: boolean;
618
+ }[];
458
619
  isEdit: boolean;
459
620
  description: string;
460
- run: (v: any) => "" | "True" | "False";
621
+ blockDisplay: boolean;
622
+ run: (nm: any, v: any, attrs: {} | undefined, cls: any, required: any, field: any) => any;
461
623
  };
462
- edit: {
624
+ range_interval: {
625
+ configFields: (field: any) => {
626
+ name: string;
627
+ type: any;
628
+ required: boolean;
629
+ }[];
463
630
  isEdit: boolean;
631
+ isFilter: boolean;
632
+ blockDisplay: boolean;
464
633
  description: string;
465
- configFields: ({
634
+ run: (nm: any, v: any, attrs: {} | undefined, cls: any, required: any, field: any, state?: {}) => any;
635
+ };
636
+ progress_bar: {
637
+ configFields: (field: any) => ({
466
638
  name: string;
467
- label: string;
468
639
  type: string;
469
- attributes: {
470
- options: string[];
640
+ label: string;
641
+ required?: undefined;
642
+ showIf?: undefined;
643
+ class?: undefined;
644
+ showif?: undefined;
645
+ } | {
646
+ name: string;
647
+ label: string;
648
+ type: any;
649
+ required: boolean;
650
+ showIf: {
651
+ max_min_formula: boolean;
471
652
  };
653
+ class?: undefined;
654
+ showif?: undefined;
472
655
  } | {
473
656
  name: string;
474
657
  label: string;
475
658
  type: string;
476
- attributes?: undefined;
477
- })[];
478
- run: (nm: any, v: any, attrs: any, cls: any, required: any, field: any) => any;
479
- };
480
- switch: {
481
- isEdit: boolean;
482
- description: string;
483
- run: (nm: any, v: any, attrs: any, cls: any, required: any, field: any) => any;
484
- };
485
- show_with_html: {
486
- configFields: {
487
- input_type: string;
659
+ class: string;
660
+ showIf: {
661
+ max_min_formula: boolean;
662
+ };
663
+ required?: undefined;
664
+ showif?: undefined;
665
+ } | {
488
666
  name: string;
667
+ type: string;
489
668
  label: string;
490
- sublabel: string;
491
- default: string;
492
- attributes: {
493
- mode: string;
669
+ showif: {
670
+ radial: boolean;
494
671
  };
495
- }[];
672
+ required?: undefined;
673
+ showIf?: undefined;
674
+ class?: undefined;
675
+ })[];
496
676
  isEdit: boolean;
497
677
  description: string;
498
678
  run: (v: any, req: any, attrs?: {}) => any;
499
679
  };
500
- tristate: {
501
- isEdit: boolean;
502
- description: string;
503
- configFields: {
504
- name: string;
505
- label: string;
506
- type: string;
507
- }[];
508
- run: (nm: any, v: any, attrs: any, cls: any, required: any, field: any) => any;
509
- };
510
- };
511
- attributes: object[];
512
- readFromFormRecord: (rec: any, name: string) => boolean | null;
513
- read: (v: object) => boolean | null;
514
- readFromDB: (v: object) => object;
515
- listAs: (v: object) => object;
516
- validate: () => boolean;
517
- } | {
518
- name: string;
519
- sql_name: string;
520
- js_type: string;
521
- contract: () => Function;
522
- attributes: object[];
523
- fieldviews: {
524
- show: {
525
- isEdit: boolean;
526
- description: string;
527
- run: (d: any, req: any, attrs?: {}) => any;
528
- };
529
- showDay: {
530
- isEdit: boolean;
531
- description: string;
532
- run: (d: any, req: any) => any;
533
- };
534
- format: {
535
- isEdit: boolean;
536
- description: string;
537
- configFields: {
538
- name: string;
539
- label: string;
540
- type: string;
541
- sublabel: string;
542
- }[];
543
- run: (d: any, req: any, options: any) => any;
544
- };
545
- relative: {
546
- isEdit: boolean;
547
- description: string;
548
- run: (d: any, req: any) => string;
549
- };
550
- yearsAgo: {
551
- isEdit: boolean;
552
- description: string;
553
- run: (d: any, req: any) => string;
554
- };
555
- show_with_html: {
556
- configFields: {
557
- input_type: string;
558
- name: string;
559
- label: string;
560
- sublabel: string;
561
- default: string;
562
- attributes: {
563
- mode: string;
564
- };
565
- }[];
566
- isEdit: boolean;
567
- description: string;
568
- run: (v: any, req: any, attrs?: {}) => any;
569
- };
570
- edit: {
571
- isEdit: boolean;
572
- blockDisplay: boolean;
573
- description: string;
574
- run: (nm: any, v: any, attrs: any, cls: any, required: any, field: any) => any;
575
- };
576
- editDay: {
577
- isEdit: boolean;
578
- blockDisplay: boolean;
579
- description: string;
580
- run: (nm: any, v: any, attrs: any, cls: any, required: any, field: any) => any;
581
- };
582
- };
583
- presets: {
584
- Now: () => Date;
585
- };
586
- read: (v: object, attrs: object) => object;
587
- validate: () => boolean;
588
- } | {
589
- name: string;
590
- sql_name: string;
591
- js_type: string;
592
- contract: ({ min, max }: {
593
- min: number;
594
- max: number;
595
- }) => Function;
596
- fieldviews: {
597
- show: {
598
- isEdit: boolean;
599
- description: string;
600
- run: (s: any) => string;
601
- };
602
- edit: {
603
- isEdit: boolean;
604
- blockDisplay: boolean;
605
- description: string;
606
- configFields: {
607
- name: string;
608
- label: string;
609
- type: string;
610
- }[];
611
- run: (nm: any, v: any, attrs: any, cls: any, required: any, field: any) => any;
612
- };
613
- number_slider: {
614
- configFields: (field: any) => {
615
- name: string;
616
- type: any;
617
- required: boolean;
618
- }[];
619
- isEdit: boolean;
620
- description: string;
621
- blockDisplay: boolean;
622
- run: (nm: any, v: any, attrs: {} | undefined, cls: any, required: any, field: any) => any;
623
- };
624
- range_interval: {
625
- configFields: (field: any) => {
626
- name: string;
627
- type: any;
628
- required: boolean;
629
- }[];
630
- isEdit: boolean;
631
- isFilter: boolean;
632
- blockDisplay: boolean;
633
- description: string;
634
- run: (nm: any, v: any, attrs: {} | undefined, cls: any, required: any, field: any, state?: {}) => any;
635
- };
636
- progress_bar: {
637
- configFields: (field: any) => ({
638
- name: string;
639
- type: string;
640
- label: string;
641
- required?: undefined;
642
- showIf?: undefined;
643
- class?: undefined;
644
- showif?: undefined;
645
- } | {
646
- name: string;
647
- label: string;
648
- type: any;
649
- required: boolean;
650
- showIf: {
651
- max_min_formula: boolean;
652
- };
653
- class?: undefined;
654
- showif?: undefined;
655
- } | {
656
- name: string;
657
- label: string;
658
- type: string;
659
- class: string;
660
- showIf: {
661
- max_min_formula: boolean;
662
- };
663
- required?: undefined;
664
- showif?: undefined;
665
- } | {
666
- name: string;
667
- type: string;
668
- label: string;
669
- showif: {
670
- radial: boolean;
671
- };
672
- required?: undefined;
673
- showIf?: undefined;
674
- class?: undefined;
675
- })[];
676
- isEdit: boolean;
677
- description: string;
678
- run: (v: any, req: any, attrs?: {}) => any;
679
- };
680
- heat_cell: {
681
- configFields: (field: any) => ({
680
+ heat_cell: {
681
+ configFields: (field: any) => ({
682
682
  name: string;
683
683
  type: string;
684
684
  label: string;
@@ -805,63 +805,45 @@ export const types: ({
805
805
  export const viewtemplates: ({
806
806
  name: string;
807
807
  description: string;
808
- configuration_workflow: (req: object) => import("../models/workflow");
809
- run: (table_id: string | number, viewname: string, { columns, view_to_create, create_view_display, create_view_label, default_state, create_view_location, create_link_style, create_link_size, create_view_showif, }: {
810
- columns: object[];
811
- view_to_create?: string | undefined;
812
- create_view_display: string;
813
- create_view_label?: string | undefined;
814
- default_state?: object | undefined;
815
- create_view_location?: string | undefined;
816
- }, stateWithId?: object | undefined, extraOpts: object, { listQuery }: {
817
- listQuery: any;
818
- }) => Promise<any>;
819
- view_quantity: string;
820
- get_state_fields: (table_id: string, viewname: any, { columns }: {
808
+ get_state_fields: () => object[];
809
+ configuration_workflow: () => import("../models/workflow");
810
+ run: (table_id: number, viewname: string, { columns, layout }: {
821
811
  columns: object[];
822
- }) => Function;
823
- initial_config: Function;
824
- on_delete: (table_id: any, viewname: string, { default_state }: {
825
- default_state: any;
826
- }) => Promise<void>;
812
+ layout: object;
813
+ }, state: object, extra: object, { distinctValuesQuery }: {
814
+ distinctValuesQuery: any;
815
+ }) => Promise<Layout>;
816
+ initial_config: () => Promise<object>;
817
+ display_state_form: boolean;
818
+ getStringsForI18n({ layout }: {
819
+ layout: any;
820
+ }): string[];
827
821
  routes: {
828
- run_action: (table_id: number, viewname: any, { columns, layout }: {
829
- columns: object[];
830
- layout: any;
831
- }, body: object, { req, res }: {
832
- req: object;
822
+ run_action: (table_id: any, viewname: any, config: any, body: any, { req, res }: {
823
+ req: any;
833
824
  res: any;
834
- }, { getRowQuery }: {
835
- getRowQuery: any;
836
- }) => Promise<object>;
825
+ }, { actionQuery }: {
826
+ actionQuery: any;
827
+ }) => Promise<any>;
837
828
  };
838
- display_state_form: (opts: object) => boolean;
839
- default_state_form: ({ default_state }: object) => boolean;
840
- getStringsForI18n({ columns, create_view_label }: {
841
- columns: any;
842
- create_view_label: any;
843
- }): string[];
844
- queries: ({ table_id, exttable_name, name, configuration: { columns, default_state }, req, }: {
829
+ queries: ({ table_id, viewname, configuration: { columns }, req, res, exttable_name, }: {
845
830
  table_id: any;
846
- exttable_name: any;
847
- name: any;
831
+ viewname: any;
848
832
  configuration: {
849
833
  columns: any;
850
- default_state: any;
851
834
  };
852
835
  req: any;
836
+ res: any;
837
+ exttable_name: any;
853
838
  }) => {
854
- listQuery(state: any, stateHash: any): Promise<{
855
- rows: import("@saltcorn/db-common/internal").Row[];
856
- rowCount: number;
839
+ actionQuery(state: any, rndid: any): Promise<{
840
+ json: any;
841
+ }>;
842
+ distinctValuesQuery(state: any): Promise<{
843
+ distinct_values: {};
844
+ role: any;
857
845
  }>;
858
- getRowQuery(id: any): Promise<import("@saltcorn/db-common/internal").Row | null>;
859
846
  };
860
- configCheck: (view: any) => Promise<{
861
- errors: string[];
862
- warnings: string[];
863
- }>;
864
- connectedObjects: (configuration: any) => Promise<import("@saltcorn/types/base_types").ConnectedObjects>;
865
847
  } | {
866
848
  name: string;
867
849
  description: string;
@@ -1016,114 +998,103 @@ export const viewtemplates: ({
1016
998
  } | {
1017
999
  name: string;
1018
1000
  description: string;
1019
- get_state_fields: () => object[];
1020
1001
  configuration_workflow: (req: object) => import("../models/workflow");
1021
- run: (table_id: string, viewname: string, { columns, layout, page_title, page_title_formula }: {
1022
- columns: object[];
1023
- layout: object;
1024
- page_title?: string | undefined;
1025
- page_title_formula: boolean;
1026
- }, state: object, extra: object, { showQuery }: {
1027
- showQuery: any;
1028
- }) => Promise<string>;
1029
- runMany: (table_id: number, viewname: string, { columns, layout }: {
1030
- columns: object[];
1031
- layout: object;
1032
- }, state: object, extra: object, { runManyQuery }: {
1033
- runManyQuery: any;
1034
- }) => Promise<object[]>;
1035
- renderRows: (table: object, viewname: string, { columns, layout }: {
1036
- columns: object[];
1037
- layout: object;
1038
- }, extra: object, rows: object[], state: any) => Promise<string>;
1039
- initial_config: Function;
1002
+ run: (table_id: string, viewname: string, { participant_field, msg_relation, msgsender_field, msgview, msgform, participant_maxread_field, }: {
1003
+ participant_field: string;
1004
+ msg_relation: string;
1005
+ msgsender_field: any;
1006
+ msgview: string;
1007
+ msgform: string;
1008
+ participant_maxread_field: string;
1009
+ }, state: object, { req, res }: {
1010
+ req: object;
1011
+ res: object;
1012
+ }, { getRowQuery, updateQuery, optionsQuery }: {
1013
+ getRowQuery: any;
1014
+ updateQuery: any;
1015
+ optionsQuery: any;
1016
+ }) => Promise<div>;
1017
+ get_state_fields: () => object[];
1040
1018
  display_state_form: boolean;
1041
1019
  routes: {
1042
- run_action: (table_id: number, viewname: any, { columns, layout }: {
1043
- columns: object[];
1044
- layout: any;
1020
+ submit_msg_ajax: (table_id: any, viewname: string, { participant_field, msg_relation, msgsender_field, msgview, msgform, participant_maxread_field, }: {
1021
+ participant_field: string;
1022
+ msg_relation: string;
1023
+ msgsender_field: any;
1024
+ msgview: string;
1025
+ msgform: string;
1026
+ participant_maxread_field: string;
1045
1027
  }, body: any, { req, res }: {
1046
1028
  req: object;
1047
- res: any;
1048
- }, { actionQuery }: {
1049
- actionQuery: any;
1029
+ res: object;
1030
+ }, { submitAjaxQuery }: {
1031
+ submitAjaxQuery: any;
1050
1032
  }) => Promise<object>;
1033
+ ack_read: (table_id: any, viewname: any, { participant_field, participant_maxread_field }: {
1034
+ participant_field: string;
1035
+ participant_maxread_field: string;
1036
+ }, body: any, { req, res }: {
1037
+ req: object;
1038
+ res: object;
1039
+ }, { ackReadQuery }: {
1040
+ ackReadQuery: any;
1041
+ }) => Promise<void>;
1042
+ 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>;
1051
1043
  };
1052
- getStringsForI18n({ layout }: {
1053
- layout: object;
1054
- }): string[];
1055
- interpolate_title_string(table_id: any, title: any, state: any): Promise<any>;
1056
- queries: ({ table_id, exttable_name, name, configuration: { columns, layout }, req, res, }: {
1044
+ noAutoTest: boolean;
1045
+ authorize_join: ({ table_id, min_role, configuration: { participant_field } }: {
1046
+ participant_field: object;
1047
+ }, room_id: string, user: object) => Promise<object>;
1048
+ virtual_triggers: (table_id: any, viewname: string, { participant_field, msg_relation, msgsender_field, msgview, msgform, participant_maxread_field, }: {
1049
+ participant_field: any;
1050
+ msg_relation: string;
1051
+ msgsender_field: string;
1052
+ msgview: string;
1053
+ msgform: any;
1054
+ participant_maxread_field: any;
1055
+ }) => object[];
1056
+ getStringsForI18n(): object[];
1057
+ queries: ({ table_id, viewname, configuration: { columns, default_state }, req, }: {
1057
1058
  table_id: any;
1058
- exttable_name: any;
1059
- name: any;
1059
+ viewname: any;
1060
1060
  configuration: {
1061
1061
  columns: any;
1062
- layout: any;
1062
+ default_state: any;
1063
1063
  };
1064
1064
  req: any;
1065
- res: any;
1066
1065
  }) => {
1067
- showQuery(state: any, fields: any): Promise<{
1068
- rows: null;
1069
- message: string;
1066
+ 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>;
1067
+ updateQuery(partRow: any, part_table_name: any, max_read_id: any, part_maxread_field: any): Promise<void>;
1068
+ submitAjaxQuery(msg_relation: any, participant_field: any, body: any, msgform: any, msgsender_field: any, participant_maxread_field: any): Promise<{
1069
+ json: {
1070
+ msgid: {
1071
+ error: string;
1072
+ } | {
1073
+ success: any;
1074
+ };
1075
+ error?: undefined;
1076
+ };
1070
1077
  } | {
1071
- rows: import("@saltcorn/db-common/internal").Row[];
1072
- message: null;
1078
+ json: {
1079
+ error: any;
1080
+ msgid?: undefined;
1081
+ };
1073
1082
  }>;
1074
- runManyQuery(state: any, { where, limit, offset, joinFieldsExtra, orderBy, orderDesc }: {
1075
- where: any;
1076
- limit: any;
1077
- offset: any;
1078
- joinFieldsExtra: any;
1079
- orderBy: any;
1080
- orderDesc: any;
1081
- }): Promise<import("@saltcorn/db-common/internal").Row[]>;
1082
- actionQuery(): Promise<{
1083
- json: any;
1083
+ ackReadQuery(participant_field: any, participant_maxread_field: any, body: any): Promise<{
1084
+ json: {
1085
+ error: string;
1086
+ success?: undefined;
1087
+ };
1088
+ } | {
1089
+ json: {
1090
+ success: string;
1091
+ error?: undefined;
1092
+ };
1084
1093
  }>;
1094
+ fetchOlderMsgQuery(participant_field: any, body: any): Promise<import("@saltcorn/db-common/internal").Row | null>;
1095
+ optionsQuery(reftable_name: any, type: any, attributes: any, where: any): Promise<any>;
1085
1096
  };
1086
- configCheck: (view: any) => Promise<{
1087
- errors: string[];
1088
- warnings: string[];
1089
- }>;
1090
1097
  connectedObjects: (configuration: any) => Promise<import("@saltcorn/types/base_types").ConnectedObjects>;
1091
- } | {
1092
- name: string;
1093
- description: string;
1094
- configuration_workflow: (req: object) => import("../models/workflow");
1095
- run: (table_id: string, viewname: string, { list_view, show_view, list_width, subtables }: {
1096
- list_view: string;
1097
- show_view: string;
1098
- subtables: object;
1099
- }, state: any, extraArgs: any, { getRowQuery }: {
1100
- getRowQuery: any;
1101
- }) => Promise<div>;
1102
- get_state_fields: (table_id: any, viewname: any, { list_view, show_view }: {
1103
- list_view: string;
1104
- show_view: any;
1105
- }) => Promise<object[]>;
1106
- display_state_form: ({ list_view, _omit_state_form }: {
1107
- list_view: string;
1108
- _omit_state_form: boolean;
1109
- }) => boolean;
1110
- queries: ({ table_id, viewname, configuration: { columns, default_state }, req, }: {
1111
- table_id: any;
1112
- viewname: any;
1113
- configuration: {
1114
- columns: any;
1115
- default_state: any;
1116
- };
1117
- req: any;
1118
- }) => {
1119
- getRowQuery(uniques: any): Promise<import("@saltcorn/db-common/internal").Row | null>;
1120
- };
1121
- connectedObjects: ({ list_view, subtables }: {
1122
- list_view: any;
1123
- subtables: any;
1124
- }) => Promise<{
1125
- embeddedViews: import("../models/view")[];
1126
- }>;
1127
1098
  } | {
1128
1099
  name: string;
1129
1100
  description: string;
@@ -1168,144 +1139,173 @@ export const viewtemplates: ({
1168
1139
  name: string;
1169
1140
  description: string;
1170
1141
  get_state_fields: () => object[];
1171
- configuration_workflow: () => import("../models/workflow");
1172
- run: (table_id: number, viewname: string, { columns, layout }: {
1142
+ configuration_workflow: (req: object) => import("../models/workflow");
1143
+ run: (table_id: string, viewname: string, { columns, layout, page_title, page_title_formula }: {
1173
1144
  columns: object[];
1174
1145
  layout: object;
1175
- }, state: object, extra: object, { distinctValuesQuery }: {
1176
- distinctValuesQuery: any;
1177
- }) => Promise<Layout>;
1178
- initial_config: () => Promise<object>;
1146
+ page_title?: string | undefined;
1147
+ page_title_formula: boolean;
1148
+ }, state: object, extra: object, { showQuery }: {
1149
+ showQuery: any;
1150
+ }) => Promise<string>;
1151
+ runMany: (table_id: number, viewname: string, { columns, layout }: {
1152
+ columns: object[];
1153
+ layout: object;
1154
+ }, state: object, extra: object, { runManyQuery }: {
1155
+ runManyQuery: any;
1156
+ }) => Promise<object[]>;
1157
+ renderRows: (table: object, viewname: string, { columns, layout }: {
1158
+ columns: object[];
1159
+ layout: object;
1160
+ }, extra: object, rows: object[], state: any) => Promise<string>;
1161
+ initial_config: Function;
1179
1162
  display_state_form: boolean;
1180
- getStringsForI18n({ layout }: {
1181
- layout: any;
1182
- }): string[];
1183
1163
  routes: {
1184
- run_action: (table_id: any, viewname: any, config: any, body: any, { req, res }: {
1185
- req: any;
1164
+ run_action: (table_id: number, viewname: any, { columns, layout }: {
1165
+ columns: object[];
1166
+ layout: any;
1167
+ }, body: any, { req, res }: {
1168
+ req: object;
1186
1169
  res: any;
1187
1170
  }, { actionQuery }: {
1188
1171
  actionQuery: any;
1189
- }) => Promise<any>;
1172
+ }) => Promise<object>;
1190
1173
  };
1191
- queries: ({ table_id, viewname, configuration: { columns }, req, res, exttable_name, }: {
1174
+ getStringsForI18n({ layout }: {
1175
+ layout: object;
1176
+ }): string[];
1177
+ interpolate_title_string(table_id: any, title: any, state: any): Promise<any>;
1178
+ queries: ({ table_id, exttable_name, name, configuration: { columns, layout }, req, res, }: {
1192
1179
  table_id: any;
1193
- viewname: any;
1180
+ exttable_name: any;
1181
+ name: any;
1194
1182
  configuration: {
1195
1183
  columns: any;
1184
+ layout: any;
1196
1185
  };
1197
1186
  req: any;
1198
1187
  res: any;
1199
- exttable_name: any;
1200
1188
  }) => {
1201
- actionQuery(state: any, rndid: any): Promise<{
1202
- json: any;
1189
+ showQuery(state: any, fields: any): Promise<{
1190
+ rows: null;
1191
+ message: string;
1192
+ } | {
1193
+ rows: import("@saltcorn/db-common/internal").Row[];
1194
+ message: null;
1203
1195
  }>;
1204
- distinctValuesQuery(state: any): Promise<{
1205
- distinct_values: {};
1206
- role: any;
1196
+ runManyQuery(state: any, { where, limit, offset, joinFieldsExtra, orderBy, orderDesc }: {
1197
+ where: any;
1198
+ limit: any;
1199
+ offset: any;
1200
+ joinFieldsExtra: any;
1201
+ orderBy: any;
1202
+ orderDesc: any;
1203
+ }): Promise<import("@saltcorn/db-common/internal").Row[]>;
1204
+ actionQuery(): Promise<{
1205
+ json: any;
1207
1206
  }>;
1208
1207
  };
1208
+ configCheck: (view: any) => Promise<{
1209
+ errors: string[];
1210
+ warnings: string[];
1211
+ }>;
1212
+ connectedObjects: (configuration: any) => Promise<import("@saltcorn/types/base_types").ConnectedObjects>;
1209
1213
  } | {
1210
1214
  name: string;
1211
1215
  description: string;
1212
1216
  configuration_workflow: (req: object) => import("../models/workflow");
1213
- run: (table_id: string, viewname: string, { participant_field, msg_relation, msgsender_field, msgview, msgform, participant_maxread_field, }: {
1214
- participant_field: string;
1215
- msg_relation: string;
1216
- msgsender_field: any;
1217
- msgview: string;
1218
- msgform: string;
1219
- participant_maxread_field: string;
1220
- }, state: object, { req, res }: {
1221
- req: object;
1222
- res: object;
1223
- }, { getRowQuery, updateQuery, optionsQuery }: {
1224
- getRowQuery: any;
1225
- updateQuery: any;
1226
- optionsQuery: any;
1227
- }) => Promise<div>;
1228
- get_state_fields: () => object[];
1229
- display_state_form: boolean;
1217
+ run: (table_id: string | number, viewname: string, { columns, view_to_create, create_view_display, create_view_label, default_state, create_view_location, create_link_style, create_link_size, create_view_showif, }: {
1218
+ columns: object[];
1219
+ view_to_create?: string | undefined;
1220
+ create_view_display: string;
1221
+ create_view_label?: string | undefined;
1222
+ default_state?: object | undefined;
1223
+ create_view_location?: string | undefined;
1224
+ }, stateWithId?: object | undefined, extraOpts: object, { listQuery }: {
1225
+ listQuery: any;
1226
+ }) => Promise<any>;
1227
+ view_quantity: string;
1228
+ get_state_fields: (table_id: string, viewname: any, { columns }: {
1229
+ columns: object[];
1230
+ }) => Function;
1231
+ initial_config: Function;
1232
+ on_delete: (table_id: any, viewname: string, { default_state }: {
1233
+ default_state: any;
1234
+ }) => Promise<void>;
1230
1235
  routes: {
1231
- submit_msg_ajax: (table_id: any, viewname: string, { participant_field, msg_relation, msgsender_field, msgview, msgform, participant_maxread_field, }: {
1232
- participant_field: string;
1233
- msg_relation: string;
1234
- msgsender_field: any;
1235
- msgview: string;
1236
- msgform: string;
1237
- participant_maxread_field: string;
1238
- }, body: any, { req, res }: {
1236
+ run_action: (table_id: number, viewname: any, { columns, layout }: {
1237
+ columns: object[];
1238
+ layout: any;
1239
+ }, body: object, { req, res }: {
1239
1240
  req: object;
1240
- res: object;
1241
- }, { submitAjaxQuery }: {
1242
- submitAjaxQuery: any;
1241
+ res: any;
1242
+ }, { getRowQuery }: {
1243
+ getRowQuery: any;
1243
1244
  }) => Promise<object>;
1244
- ack_read: (table_id: any, viewname: any, { participant_field, participant_maxread_field }: {
1245
- participant_field: string;
1246
- participant_maxread_field: string;
1247
- }, body: any, { req, res }: {
1248
- req: object;
1249
- res: object;
1250
- }, { ackReadQuery }: {
1251
- ackReadQuery: any;
1252
- }) => Promise<void>;
1253
- 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>;
1254
1245
  };
1255
- noAutoTest: boolean;
1256
- authorize_join: ({ table_id, min_role, configuration: { participant_field } }: {
1257
- participant_field: object;
1258
- }, room_id: string, user: object) => Promise<object>;
1259
- virtual_triggers: (table_id: any, viewname: string, { participant_field, msg_relation, msgsender_field, msgview, msgform, participant_maxread_field, }: {
1260
- participant_field: any;
1261
- msg_relation: string;
1262
- msgsender_field: string;
1263
- msgview: string;
1264
- msgform: any;
1265
- participant_maxread_field: any;
1266
- }) => object[];
1267
- getStringsForI18n(): object[];
1268
- queries: ({ table_id, viewname, configuration: { columns, default_state }, req, }: {
1246
+ display_state_form: (opts: object) => boolean;
1247
+ default_state_form: ({ default_state }: object) => boolean;
1248
+ getStringsForI18n({ columns, create_view_label }: {
1249
+ columns: any;
1250
+ create_view_label: any;
1251
+ }): string[];
1252
+ queries: ({ table_id, exttable_name, name, configuration: { columns, default_state }, req, }: {
1269
1253
  table_id: any;
1270
- viewname: any;
1254
+ exttable_name: any;
1255
+ name: any;
1271
1256
  configuration: {
1272
1257
  columns: any;
1273
1258
  default_state: any;
1274
1259
  };
1275
1260
  req: any;
1276
1261
  }) => {
1277
- 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>;
1278
- updateQuery(partRow: any, part_table_name: any, max_read_id: any, part_maxread_field: any): Promise<void>;
1279
- submitAjaxQuery(msg_relation: any, participant_field: any, body: any, msgform: any, msgsender_field: any, participant_maxread_field: any): Promise<{
1280
- json: {
1281
- msgid: {
1282
- error: string;
1283
- } | {
1284
- success: any;
1285
- };
1286
- error?: undefined;
1287
- };
1288
- } | {
1289
- json: {
1290
- error: any;
1291
- msgid?: undefined;
1292
- };
1293
- }>;
1294
- ackReadQuery(participant_field: any, participant_maxread_field: any, body: any): Promise<{
1295
- json: {
1296
- error: string;
1297
- success?: undefined;
1298
- };
1299
- } | {
1300
- json: {
1301
- success: string;
1302
- error?: undefined;
1303
- };
1262
+ listQuery(state: any, stateHash: any): Promise<{
1263
+ rows: import("@saltcorn/db-common/internal").Row[];
1264
+ rowCount: number;
1304
1265
  }>;
1305
- fetchOlderMsgQuery(participant_field: any, body: any): Promise<import("@saltcorn/db-common/internal").Row | null>;
1306
- optionsQuery(reftable_name: any, type: any, attributes: any, where: any): Promise<any>;
1266
+ getRowQuery(id: any): Promise<import("@saltcorn/db-common/internal").Row | null>;
1307
1267
  };
1268
+ configCheck: (view: any) => Promise<{
1269
+ errors: string[];
1270
+ warnings: string[];
1271
+ }>;
1308
1272
  connectedObjects: (configuration: any) => Promise<import("@saltcorn/types/base_types").ConnectedObjects>;
1273
+ } | {
1274
+ name: string;
1275
+ description: string;
1276
+ configuration_workflow: (req: object) => import("../models/workflow");
1277
+ run: (table_id: string, viewname: string, { list_view, show_view, list_width, subtables }: {
1278
+ list_view: string;
1279
+ show_view: string;
1280
+ subtables: object;
1281
+ }, state: any, extraArgs: any, { getRowQuery }: {
1282
+ getRowQuery: any;
1283
+ }) => Promise<div>;
1284
+ get_state_fields: (table_id: any, viewname: any, { list_view, show_view }: {
1285
+ list_view: string;
1286
+ show_view: any;
1287
+ }) => Promise<object[]>;
1288
+ display_state_form: ({ list_view, _omit_state_form }: {
1289
+ list_view: string;
1290
+ _omit_state_form: boolean;
1291
+ }) => boolean;
1292
+ queries: ({ table_id, viewname, configuration: { columns, default_state }, req, }: {
1293
+ table_id: any;
1294
+ viewname: any;
1295
+ configuration: {
1296
+ columns: any;
1297
+ default_state: any;
1298
+ };
1299
+ req: any;
1300
+ }) => {
1301
+ getRowQuery(uniques: any): Promise<import("@saltcorn/db-common/internal").Row | null>;
1302
+ };
1303
+ connectedObjects: ({ list_view, subtables }: {
1304
+ list_view: any;
1305
+ subtables: any;
1306
+ }) => Promise<{
1307
+ embeddedViews: import("../models/view")[];
1308
+ }>;
1309
1309
  })[];
1310
1310
  import fileviews = require("./fileviews");
1311
1311
  import actions = require("./actions");