@saltcorn/data 0.9.4-beta.1 → 0.9.4-beta.11

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 (85) hide show
  1. package/dist/base-plugin/actions.d.ts +109 -30
  2. package/dist/base-plugin/actions.d.ts.map +1 -1
  3. package/dist/base-plugin/actions.js +78 -21
  4. package/dist/base-plugin/actions.js.map +1 -1
  5. package/dist/base-plugin/fieldviews.d.ts.map +1 -1
  6. package/dist/base-plugin/fieldviews.js +18 -9
  7. package/dist/base-plugin/fieldviews.js.map +1 -1
  8. package/dist/base-plugin/index.d.ts +412 -410
  9. package/dist/base-plugin/index.d.ts.map +1 -1
  10. package/dist/base-plugin/types.d.ts.map +1 -1
  11. package/dist/base-plugin/types.js +8 -2
  12. package/dist/base-plugin/types.js.map +1 -1
  13. package/dist/base-plugin/viewtemplates/edit.d.ts +2 -0
  14. package/dist/base-plugin/viewtemplates/edit.d.ts.map +1 -1
  15. package/dist/base-plugin/viewtemplates/edit.js +148 -51
  16. package/dist/base-plugin/viewtemplates/edit.js.map +1 -1
  17. package/dist/base-plugin/viewtemplates/filter.d.ts.map +1 -1
  18. package/dist/base-plugin/viewtemplates/filter.js +26 -5
  19. package/dist/base-plugin/viewtemplates/filter.js.map +1 -1
  20. package/dist/base-plugin/viewtemplates/list.d.ts.map +1 -1
  21. package/dist/base-plugin/viewtemplates/list.js +4 -4
  22. package/dist/base-plugin/viewtemplates/list.js.map +1 -1
  23. package/dist/base-plugin/viewtemplates/show.d.ts +2 -0
  24. package/dist/base-plugin/viewtemplates/show.d.ts.map +1 -1
  25. package/dist/base-plugin/viewtemplates/show.js +110 -56
  26. package/dist/base-plugin/viewtemplates/show.js.map +1 -1
  27. package/dist/base-plugin/viewtemplates/viewable_fields.d.ts +2 -2
  28. package/dist/base-plugin/viewtemplates/viewable_fields.d.ts.map +1 -1
  29. package/dist/base-plugin/viewtemplates/viewable_fields.js +27 -35
  30. package/dist/base-plugin/viewtemplates/viewable_fields.js.map +1 -1
  31. package/dist/db/fixtures.d.ts.map +1 -1
  32. package/dist/db/fixtures.js +149 -30
  33. package/dist/db/fixtures.js.map +1 -1
  34. package/dist/db/state.d.ts.map +1 -1
  35. package/dist/db/state.js +2 -0
  36. package/dist/db/state.js.map +1 -1
  37. package/dist/migrate.d.ts +1 -0
  38. package/dist/migrate.d.ts.map +1 -1
  39. package/dist/migrate.js +6 -3
  40. package/dist/migrate.js.map +1 -1
  41. package/dist/migrations/202402071125.d.ts +2 -0
  42. package/dist/migrations/202402071125.d.ts.map +1 -0
  43. package/dist/migrations/202402071125.js +4 -0
  44. package/dist/migrations/202402071125.js.map +1 -0
  45. package/dist/models/config.d.ts.map +1 -1
  46. package/dist/models/config.js +6 -0
  47. package/dist/models/config.js.map +1 -1
  48. package/dist/models/expression.d.ts +2 -0
  49. package/dist/models/expression.d.ts.map +1 -1
  50. package/dist/models/expression.js +9 -0
  51. package/dist/models/expression.js.map +1 -1
  52. package/dist/models/field.d.ts +1 -1
  53. package/dist/models/field.d.ts.map +1 -1
  54. package/dist/models/field.js +2 -2
  55. package/dist/models/field.js.map +1 -1
  56. package/dist/models/index.d.ts +1 -1
  57. package/dist/models/page_group.d.ts +1 -0
  58. package/dist/models/page_group.d.ts.map +1 -1
  59. package/dist/models/page_group.js +1 -0
  60. package/dist/models/page_group.js.map +1 -1
  61. package/dist/models/view.d.ts +6 -0
  62. package/dist/models/view.d.ts.map +1 -1
  63. package/dist/models/view.js +10 -0
  64. package/dist/models/view.js.map +1 -1
  65. package/dist/plugin-helper.d.ts +8 -19
  66. package/dist/plugin-helper.d.ts.map +1 -1
  67. package/dist/plugin-helper.js +55 -60
  68. package/dist/plugin-helper.js.map +1 -1
  69. package/dist/tests/auxtest.test.js +4 -0
  70. package/dist/tests/auxtest.test.js.map +1 -1
  71. package/dist/tests/calc.test.js +11 -1
  72. package/dist/tests/calc.test.js.map +1 -1
  73. package/dist/tests/edit.test.js +204 -0
  74. package/dist/tests/edit.test.js.map +1 -1
  75. package/dist/tests/show.test.d.ts +2 -0
  76. package/dist/tests/show.test.d.ts.map +1 -0
  77. package/dist/tests/show.test.js +325 -0
  78. package/dist/tests/show.test.js.map +1 -0
  79. package/dist/tests/view.test.js +15 -1
  80. package/dist/tests/view.test.js.map +1 -1
  81. package/dist/utils.d.ts +2 -17
  82. package/dist/utils.d.ts.map +1 -1
  83. package/dist/utils.js +15 -32
  84. package/dist/utils.js.map +1 -1
  85. package/package.json +8 -7
@@ -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;
@@ -594,7 +447,40 @@ export const types: ({
594
447
  show: {
595
448
  isEdit: boolean;
596
449
  description: string;
597
- run: (s: any) => any;
450
+ run: (v: any) => any;
451
+ };
452
+ checkboxes: {
453
+ isEdit: boolean;
454
+ description: string;
455
+ run: (v: any) => any;
456
+ };
457
+ TrueFalse: {
458
+ isEdit: boolean;
459
+ description: string;
460
+ run: (v: any) => "" | "True" | "False";
461
+ };
462
+ edit: {
463
+ isEdit: boolean;
464
+ description: string;
465
+ configFields: ({
466
+ name: string;
467
+ label: string;
468
+ type: string;
469
+ attributes: {
470
+ options: string[];
471
+ };
472
+ } | {
473
+ name: string;
474
+ label: string;
475
+ 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;
598
484
  };
599
485
  show_with_html: {
600
486
  configFields: {
@@ -611,66 +497,144 @@ export const types: ({
611
497
  description: string;
612
498
  run: (v: any, req: any, attrs?: {}) => any;
613
499
  };
614
- edit: {
500
+ tristate: {
615
501
  isEdit: boolean;
616
- blockDisplay: boolean;
617
502
  description: string;
503
+ configFields: {
504
+ name: string;
505
+ label: string;
506
+ type: string;
507
+ }[];
618
508
  run: (nm: any, v: any, attrs: any, cls: any, required: any, field: any) => any;
619
509
  };
620
510
  };
621
511
  attributes: object[];
622
- read: (v: object) => 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;
623
516
  validate: () => boolean;
624
517
  } | {
625
518
  name: string;
626
519
  sql_name: string;
627
520
  js_type: string;
628
- contract: ({ min, max }: {
629
- min: number;
630
- max: number;
631
- }) => Function;
521
+ contract: () => Function;
522
+ attributes: object[];
632
523
  fieldviews: {
633
524
  show: {
634
525
  isEdit: boolean;
635
526
  description: string;
636
- run: (s: any) => string;
527
+ run: (d: any, req: any, attrs?: {}) => any;
637
528
  };
638
- edit: {
529
+ showDay: {
530
+ isEdit: boolean;
531
+ description: string;
532
+ run: (d: any, req: any) => any;
533
+ };
534
+ format: {
639
535
  isEdit: boolean;
640
- blockDisplay: boolean;
641
536
  description: string;
642
537
  configFields: {
643
538
  name: string;
644
539
  label: string;
645
540
  type: string;
541
+ sublabel: string;
646
542
  }[];
647
- run: (nm: any, v: any, attrs: any, cls: any, required: any, field: any) => any;
543
+ run: (d: any, req: any, options: any) => any;
648
544
  };
649
- number_slider: {
650
- configFields: (field: any) => {
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;
651
558
  name: string;
652
- type: any;
653
- required: boolean;
559
+ label: string;
560
+ sublabel: string;
561
+ default: string;
562
+ attributes: {
563
+ mode: string;
564
+ };
654
565
  }[];
655
566
  isEdit: boolean;
656
567
  description: string;
568
+ run: (v: any, req: any, attrs?: {}) => any;
569
+ };
570
+ edit: {
571
+ isEdit: boolean;
657
572
  blockDisplay: boolean;
658
- run: (nm: any, v: any, attrs: {} | undefined, cls: any, required: any, field: any) => any;
573
+ description: string;
574
+ run: (nm: any, v: any, attrs: any, cls: any, required: any, field: any) => any;
659
575
  };
660
- range_interval: {
661
- configFields: (field: any) => {
662
- name: string;
663
- type: any;
664
- required: boolean;
665
- }[];
576
+ editDay: {
666
577
  isEdit: boolean;
667
- isFilter: boolean;
668
578
  blockDisplay: boolean;
669
579
  description: string;
670
- run: (nm: any, v: any, attrs: {} | undefined, cls: any, required: any, field: any, state?: {}) => any;
580
+ run: (nm: any, v: any, attrs: any, cls: any, required: any, field: any) => any;
671
581
  };
672
- progress_bar: {
673
- configFields: (field: any) => ({
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) => ({
674
638
  name: string;
675
639
  type: string;
676
640
  label: string;
@@ -801,49 +765,103 @@ export const types: ({
801
765
  attributes: object[];
802
766
  read: (v: object) => string | number | undefined;
803
767
  validate: ({ min, max }: object) => boolean | object;
768
+ } | {
769
+ name: string;
770
+ sql_name: string;
771
+ js_type: string;
772
+ contract: () => Function;
773
+ fieldviews: {
774
+ show: {
775
+ isEdit: boolean;
776
+ description: string;
777
+ run: (s: any) => any;
778
+ };
779
+ show_with_html: {
780
+ configFields: {
781
+ input_type: string;
782
+ name: string;
783
+ label: string;
784
+ sublabel: string;
785
+ default: string;
786
+ attributes: {
787
+ mode: string;
788
+ };
789
+ }[];
790
+ isEdit: boolean;
791
+ description: string;
792
+ run: (v: any, req: any, attrs?: {}) => any;
793
+ };
794
+ edit: {
795
+ isEdit: boolean;
796
+ blockDisplay: boolean;
797
+ description: string;
798
+ run: (nm: any, v: any, attrs: any, cls: any, required: any, field: any) => any;
799
+ };
800
+ };
801
+ attributes: object[];
802
+ read: (v: object) => object;
803
+ validate: () => boolean;
804
804
  })[];
805
805
  export const viewtemplates: ({
806
806
  name: string;
807
807
  description: string;
808
- get_state_fields: () => object[];
809
- configuration_workflow: () => import("../models/workflow");
810
- run: (table_id: number, viewname: string, { columns, layout }: {
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, }: {
811
810
  columns: object[];
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[];
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 }: {
821
+ 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>;
821
827
  routes: {
822
- run_action: (table_id: any, viewname: any, config: any, body: any, { req, res }: {
823
- req: any;
828
+ run_action: (table_id: number, viewname: any, { columns, layout }: {
829
+ columns: object[];
830
+ layout: any;
831
+ }, body: object, { req, res }: {
832
+ req: object;
824
833
  res: any;
825
- }, { actionQuery }: {
826
- actionQuery: any;
827
- }) => Promise<any>;
834
+ }, { getRowQuery }: {
835
+ getRowQuery: any;
836
+ }) => Promise<object>;
828
837
  };
829
- queries: ({ table_id, viewname, configuration: { columns }, req, res, exttable_name, }: {
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, }: {
830
845
  table_id: any;
831
- viewname: any;
846
+ exttable_name: any;
847
+ name: any;
832
848
  configuration: {
833
849
  columns: any;
850
+ default_state: any;
834
851
  };
835
852
  req: any;
836
- res: any;
837
- exttable_name: any;
838
853
  }) => {
839
- actionQuery(state: any, rndid: any): Promise<{
840
- json: any;
841
- }>;
842
- distinctValuesQuery(state: any): Promise<{
843
- distinct_values: {};
844
- role: any;
854
+ listQuery(state: any, stateHash: any): Promise<{
855
+ rows: import("@saltcorn/db-common/internal").Row[];
856
+ rowCount: number;
845
857
  }>;
858
+ getRowQuery(id: any): Promise<import("@saltcorn/db-common/internal").Row | null>;
846
859
  };
860
+ configCheck: (view: any) => Promise<{
861
+ errors: string[];
862
+ warnings: string[];
863
+ }>;
864
+ connectedObjects: (configuration: any) => Promise<import("@saltcorn/types/base_types").ConnectedObjects>;
847
865
  } | {
848
866
  name: string;
849
867
  description: string;
@@ -989,6 +1007,7 @@ export const viewtemplates: ({
989
1007
  getRowByIdQuery: any;
990
1008
  }) => Promise<void>;
991
1009
  };
1010
+ interpolate_title_string(table_id: any, title: any, state: any): Promise<any>;
992
1011
  configCheck: (view: any) => Promise<{
993
1012
  errors: string[];
994
1013
  warnings: string[];
@@ -997,103 +1016,114 @@ export const viewtemplates: ({
997
1016
  } | {
998
1017
  name: string;
999
1018
  description: string;
1000
- configuration_workflow: (req: object) => import("../models/workflow");
1001
- run: (table_id: string, viewname: string, { participant_field, msg_relation, msgsender_field, msgview, msgform, participant_maxread_field, }: {
1002
- participant_field: string;
1003
- msg_relation: string;
1004
- msgsender_field: any;
1005
- msgview: string;
1006
- msgform: string;
1007
- participant_maxread_field: string;
1008
- }, state: object, { req, res }: {
1009
- req: object;
1010
- res: object;
1011
- }, { getRowQuery, updateQuery, optionsQuery }: {
1012
- getRowQuery: any;
1013
- updateQuery: any;
1014
- optionsQuery: any;
1015
- }) => Promise<div>;
1016
1019
  get_state_fields: () => object[];
1020
+ 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;
1017
1040
  display_state_form: boolean;
1018
1041
  routes: {
1019
- submit_msg_ajax: (table_id: any, viewname: string, { participant_field, msg_relation, msgsender_field, msgview, msgform, participant_maxread_field, }: {
1020
- participant_field: string;
1021
- msg_relation: string;
1022
- msgsender_field: any;
1023
- msgview: string;
1024
- msgform: string;
1025
- participant_maxread_field: string;
1042
+ run_action: (table_id: number, viewname: any, { columns, layout }: {
1043
+ columns: object[];
1044
+ layout: any;
1026
1045
  }, body: any, { req, res }: {
1027
1046
  req: object;
1028
- res: object;
1029
- }, { submitAjaxQuery }: {
1030
- submitAjaxQuery: any;
1047
+ res: any;
1048
+ }, { actionQuery }: {
1049
+ actionQuery: any;
1031
1050
  }) => Promise<object>;
1032
- ack_read: (table_id: any, viewname: any, { participant_field, participant_maxread_field }: {
1033
- participant_field: string;
1034
- participant_maxread_field: string;
1035
- }, body: any, { req, res }: {
1036
- req: object;
1037
- res: object;
1038
- }, { ackReadQuery }: {
1039
- ackReadQuery: any;
1040
- }) => Promise<void>;
1041
- 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>;
1042
1051
  };
1043
- noAutoTest: boolean;
1044
- authorize_join: ({ table_id, min_role, configuration: { participant_field } }: {
1045
- participant_field: object;
1046
- }, room_id: string, user: object) => Promise<object>;
1047
- virtual_triggers: (table_id: any, viewname: string, { participant_field, msg_relation, msgsender_field, msgview, msgform, participant_maxread_field, }: {
1048
- participant_field: any;
1049
- msg_relation: string;
1050
- msgsender_field: string;
1051
- msgview: string;
1052
- msgform: any;
1053
- participant_maxread_field: any;
1054
- }) => object[];
1055
- getStringsForI18n(): object[];
1056
- queries: ({ table_id, viewname, configuration: { columns, default_state }, req, }: {
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, }: {
1057
1057
  table_id: any;
1058
- viewname: any;
1058
+ exttable_name: any;
1059
+ name: any;
1059
1060
  configuration: {
1060
1061
  columns: any;
1061
- default_state: any;
1062
+ layout: any;
1062
1063
  };
1063
1064
  req: any;
1065
+ res: any;
1064
1066
  }) => {
1065
- 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>;
1066
- updateQuery(partRow: any, part_table_name: any, max_read_id: any, part_maxread_field: any): Promise<void>;
1067
- submitAjaxQuery(msg_relation: any, participant_field: any, body: any, msgform: any, msgsender_field: any, participant_maxread_field: any): Promise<{
1068
- json: {
1069
- msgid: {
1070
- error: string;
1071
- } | {
1072
- success: any;
1073
- };
1074
- error?: undefined;
1075
- };
1067
+ showQuery(state: any, fields: any): Promise<{
1068
+ rows: null;
1069
+ message: string;
1076
1070
  } | {
1077
- json: {
1078
- error: any;
1079
- msgid?: undefined;
1080
- };
1071
+ rows: import("@saltcorn/db-common/internal").Row[];
1072
+ message: null;
1081
1073
  }>;
1082
- ackReadQuery(participant_field: any, participant_maxread_field: any, body: any): Promise<{
1083
- json: {
1084
- error: string;
1085
- success?: undefined;
1086
- };
1087
- } | {
1088
- json: {
1089
- success: string;
1090
- error?: undefined;
1091
- };
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;
1092
1084
  }>;
1093
- fetchOlderMsgQuery(participant_field: any, body: any): Promise<import("@saltcorn/db-common/internal").Row | null>;
1094
- optionsQuery(reftable_name: any, type: any, attributes: any, where: any): Promise<any>;
1095
1085
  };
1086
+ configCheck: (view: any) => Promise<{
1087
+ errors: string[];
1088
+ warnings: string[];
1089
+ }>;
1096
1090
  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
+ }>;
1097
1127
  } | {
1098
1128
  name: string;
1099
1129
  description: string;
@@ -1138,155 +1168,103 @@ export const viewtemplates: ({
1138
1168
  name: string;
1139
1169
  description: string;
1140
1170
  get_state_fields: () => object[];
1141
- configuration_workflow: (req: object) => import("../models/workflow");
1142
- run: (table_id: string, viewname: string, { columns, layout, page_title, page_title_formula }: {
1143
- columns: object[];
1144
- layout: object;
1145
- page_title?: string | undefined;
1146
- page_title_formula: boolean;
1147
- }, state: object, extra: object, { showQuery }: {
1148
- showQuery: any;
1149
- }) => Promise<string>;
1150
- runMany: (table_id: number, viewname: string, { columns, layout }: {
1151
- columns: object[];
1152
- layout: object;
1153
- }, state: object, extra: object, { runManyQuery }: {
1154
- runManyQuery: any;
1155
- }) => Promise<object[]>;
1156
- renderRows: (table: object, viewname: string, { columns, layout }: {
1171
+ configuration_workflow: () => import("../models/workflow");
1172
+ run: (table_id: number, viewname: string, { columns, layout }: {
1157
1173
  columns: object[];
1158
1174
  layout: object;
1159
- }, extra: object, rows: object[], state: any) => Promise<string>;
1160
- initial_config: Function;
1175
+ }, state: object, extra: object, { distinctValuesQuery }: {
1176
+ distinctValuesQuery: any;
1177
+ }) => Promise<Layout>;
1178
+ initial_config: () => Promise<object>;
1161
1179
  display_state_form: boolean;
1180
+ getStringsForI18n({ layout }: {
1181
+ layout: any;
1182
+ }): string[];
1162
1183
  routes: {
1163
- run_action: (table_id: number, viewname: any, { columns, layout }: {
1164
- columns: object[];
1165
- layout: any;
1166
- }, body: any, { req, res }: {
1167
- req: object;
1184
+ run_action: (table_id: any, viewname: any, config: any, body: any, { req, res }: {
1185
+ req: any;
1168
1186
  res: any;
1169
1187
  }, { actionQuery }: {
1170
1188
  actionQuery: any;
1171
- }) => Promise<object>;
1189
+ }) => Promise<any>;
1172
1190
  };
1173
- getStringsForI18n({ layout }: {
1174
- layout: object;
1175
- }): string[];
1176
- queries: ({ table_id, exttable_name, name, configuration: { columns, layout }, req, res, }: {
1191
+ queries: ({ table_id, viewname, configuration: { columns }, req, res, exttable_name, }: {
1177
1192
  table_id: any;
1178
- exttable_name: any;
1179
- name: any;
1193
+ viewname: any;
1180
1194
  configuration: {
1181
1195
  columns: any;
1182
- layout: any;
1183
1196
  };
1184
1197
  req: any;
1185
1198
  res: any;
1199
+ exttable_name: any;
1186
1200
  }) => {
1187
- showQuery(state: any, fields: any): Promise<{
1188
- rows: null;
1189
- message: string;
1190
- } | {
1191
- rows: import("@saltcorn/db-common/internal").Row[];
1192
- message: null;
1193
- }>;
1194
- runManyQuery(state: any, { where, limit, offset, joinFieldsExtra, orderBy, orderDesc }: {
1195
- where: any;
1196
- limit: any;
1197
- offset: any;
1198
- joinFieldsExtra: any;
1199
- orderBy: any;
1200
- orderDesc: any;
1201
- }): Promise<import("@saltcorn/db-common/internal").Row[]>;
1202
- actionQuery(): Promise<{
1201
+ actionQuery(state: any, rndid: any): Promise<{
1203
1202
  json: any;
1204
1203
  }>;
1204
+ distinctValuesQuery(state: any): Promise<{
1205
+ distinct_values: {};
1206
+ role: any;
1207
+ }>;
1205
1208
  };
1206
- configCheck: (view: any) => Promise<{
1207
- errors: string[];
1208
- warnings: string[];
1209
- }>;
1210
- connectedObjects: (configuration: any) => Promise<import("@saltcorn/types/base_types").ConnectedObjects>;
1211
1209
  } | {
1212
1210
  name: string;
1213
1211
  description: string;
1214
1212
  configuration_workflow: (req: object) => import("../models/workflow");
1215
- 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, }: {
1216
- columns: object[];
1217
- view_to_create?: string | undefined;
1218
- create_view_display: string;
1219
- create_view_label?: string | undefined;
1220
- default_state?: object | undefined;
1221
- create_view_location?: string | undefined;
1222
- }, stateWithId?: object | undefined, extraOpts: object, { listQuery }: {
1223
- listQuery: any;
1224
- }) => Promise<any>;
1225
- view_quantity: string;
1226
- get_state_fields: (table_id: string, viewname: any, { columns }: {
1227
- columns: object[];
1228
- }) => Function;
1229
- initial_config: Function;
1230
- on_delete: (table_id: any, viewname: string, { default_state }: {
1231
- default_state: any;
1232
- }) => Promise<void>;
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;
1233
1230
  routes: {
1234
- run_action: (table_id: number, viewname: any, { columns, layout }: {
1235
- columns: object[];
1236
- layout: any;
1237
- }, body: object, { req, res }: {
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 }: {
1238
1239
  req: object;
1239
- res: any;
1240
- }, { getRowQuery }: {
1241
- getRowQuery: any;
1240
+ res: object;
1241
+ }, { submitAjaxQuery }: {
1242
+ submitAjaxQuery: any;
1242
1243
  }) => 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>;
1243
1254
  };
1244
- display_state_form: (opts: object) => boolean;
1245
- default_state_form: ({ default_state }: object) => boolean;
1246
- getStringsForI18n({ columns, create_view_label }: {
1247
- columns: any;
1248
- create_view_label: any;
1249
- }): string[];
1250
- queries: ({ table_id, exttable_name, name, configuration: { columns, default_state }, req, }: {
1251
- table_id: any;
1252
- exttable_name: any;
1253
- name: any;
1254
- configuration: {
1255
- columns: any;
1256
- default_state: any;
1257
- };
1258
- req: any;
1259
- }) => {
1260
- listQuery(state: any, stateHash: any): Promise<{
1261
- rows: import("@saltcorn/db-common/internal").Row[];
1262
- rowCount: number;
1263
- }>;
1264
- getRowQuery(id: any): Promise<import("@saltcorn/db-common/internal").Row | null>;
1265
- };
1266
- configCheck: (view: any) => Promise<{
1267
- errors: string[];
1268
- warnings: string[];
1269
- }>;
1270
- connectedObjects: (configuration: any) => Promise<import("@saltcorn/types/base_types").ConnectedObjects>;
1271
- } | {
1272
- name: string;
1273
- description: string;
1274
- configuration_workflow: (req: object) => import("../models/workflow");
1275
- run: (table_id: string, viewname: string, { list_view, show_view, list_width, subtables }: {
1276
- list_view: string;
1277
- show_view: string;
1278
- subtables: object;
1279
- }, state: any, extraArgs: any, { getRowQuery }: {
1280
- getRowQuery: any;
1281
- }) => Promise<div>;
1282
- get_state_fields: (table_id: any, viewname: any, { list_view, show_view }: {
1283
- list_view: string;
1284
- show_view: any;
1285
- }) => Promise<object[]>;
1286
- display_state_form: ({ list_view, _omit_state_form }: {
1287
- list_view: string;
1288
- _omit_state_form: boolean;
1289
- }) => boolean;
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[];
1290
1268
  queries: ({ table_id, viewname, configuration: { columns, default_state }, req, }: {
1291
1269
  table_id: any;
1292
1270
  viewname: any;
@@ -1296,14 +1274,38 @@ export const viewtemplates: ({
1296
1274
  };
1297
1275
  req: any;
1298
1276
  }) => {
1299
- getRowQuery(uniques: any): Promise<import("@saltcorn/db-common/internal").Row | null>;
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
+ };
1304
+ }>;
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>;
1300
1307
  };
1301
- connectedObjects: ({ list_view, subtables }: {
1302
- list_view: any;
1303
- subtables: any;
1304
- }) => Promise<{
1305
- embeddedViews: import("../models/view")[];
1306
- }>;
1308
+ connectedObjects: (configuration: any) => Promise<import("@saltcorn/types/base_types").ConnectedObjects>;
1307
1309
  })[];
1308
1310
  import fileviews = require("./fileviews");
1309
1311
  import actions = require("./actions");