@saltcorn/data 0.9.1-beta.6 → 0.9.1-beta.8

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 (59) hide show
  1. package/dist/base-plugin/actions.d.ts.map +1 -1
  2. package/dist/base-plugin/actions.js +4 -0
  3. package/dist/base-plugin/actions.js.map +1 -1
  4. package/dist/base-plugin/index.d.ts +420 -330
  5. package/dist/base-plugin/index.d.ts.map +1 -1
  6. package/dist/base-plugin/types.d.ts +41 -15
  7. package/dist/base-plugin/types.d.ts.map +1 -1
  8. package/dist/base-plugin/types.js +46 -6
  9. package/dist/base-plugin/types.js.map +1 -1
  10. package/dist/base-plugin/viewtemplates/edit.d.ts.map +1 -1
  11. package/dist/base-plugin/viewtemplates/edit.js +7 -1
  12. package/dist/base-plugin/viewtemplates/edit.js.map +1 -1
  13. package/dist/models/email.d.ts +6 -5
  14. package/dist/models/email.d.ts.map +1 -1
  15. package/dist/models/eventlog.js +1 -1
  16. package/dist/models/eventlog.js.map +1 -1
  17. package/dist/models/table.d.ts.map +1 -1
  18. package/dist/models/table.js +26 -1
  19. package/dist/models/table.js.map +1 -1
  20. package/dist/models/trigger.d.ts +11 -4
  21. package/dist/models/trigger.d.ts.map +1 -1
  22. package/dist/models/trigger.js +20 -6
  23. package/dist/models/trigger.js.map +1 -1
  24. package/dist/models/user.d.ts +1 -0
  25. package/dist/models/user.d.ts.map +1 -1
  26. package/dist/models/user.js +22 -5
  27. package/dist/models/user.js.map +1 -1
  28. package/dist/models/view.d.ts.map +1 -1
  29. package/dist/models/view.js +4 -1
  30. package/dist/models/view.js.map +1 -1
  31. package/dist/plugin-helper.d.ts +11 -1
  32. package/dist/plugin-helper.d.ts.map +1 -1
  33. package/dist/plugin-helper.js +90 -20
  34. package/dist/plugin-helper.js.map +1 -1
  35. package/dist/tests/actions.test.js +127 -0
  36. package/dist/tests/actions.test.js.map +1 -1
  37. package/dist/tests/auxtest.test.js +29 -2
  38. package/dist/tests/auxtest.test.js.map +1 -1
  39. package/dist/tests/common_helpers.d.ts +1 -0
  40. package/dist/tests/common_helpers.d.ts.map +1 -1
  41. package/dist/tests/common_helpers.js +131 -1
  42. package/dist/tests/common_helpers.js.map +1 -1
  43. package/dist/tests/edit.test.d.ts +2 -0
  44. package/dist/tests/edit.test.d.ts.map +1 -0
  45. package/dist/tests/edit.test.js +463 -0
  46. package/dist/tests/edit.test.js.map +1 -0
  47. package/dist/tests/mocks.d.ts +6 -5
  48. package/dist/tests/mocks.d.ts.map +1 -1
  49. package/dist/tests/mocks.js +17 -5
  50. package/dist/tests/mocks.js.map +1 -1
  51. package/dist/tests/table.test.js +23 -1
  52. package/dist/tests/table.test.js.map +1 -1
  53. package/dist/tests/workflow.test.js +8 -2
  54. package/dist/tests/workflow.test.js.map +1 -1
  55. package/dist/utils.d.ts +1 -0
  56. package/dist/utils.d.ts.map +1 -1
  57. package/dist/utils.js +5 -0
  58. package/dist/utils.js.map +1 -1
  59. package/package.json +7 -7
@@ -1,4 +1,141 @@
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
+ run: (nm: any, v: any, attrs: any, cls: any, required: any, field: any) => any;
34
+ };
35
+ switch: {
36
+ isEdit: boolean;
37
+ description: string;
38
+ run: (nm: any, v: any, attrs: any, cls: any, required: any, field: any) => any;
39
+ };
40
+ show_with_html: {
41
+ configFields: {
42
+ input_type: string;
43
+ name: string;
44
+ label: string;
45
+ sublabel: string;
46
+ default: string;
47
+ attributes: {
48
+ mode: string;
49
+ };
50
+ }[];
51
+ isEdit: boolean;
52
+ description: string;
53
+ run: (v: any, req: any, attrs?: {}) => any;
54
+ };
55
+ tristate: {
56
+ isEdit: boolean;
57
+ description: string;
58
+ run: (nm: any, v: any, attrs: any, cls: any, required: any, field: any) => any;
59
+ };
60
+ };
61
+ attributes: object[];
62
+ readFromFormRecord: (rec: any, name: string) => boolean | null;
63
+ read: (v: object) => boolean | null;
64
+ readFromDB: (v: object) => object;
65
+ listAs: (v: object) => object;
66
+ validate: () => boolean;
67
+ } | {
68
+ name: string;
69
+ sql_name: string;
70
+ js_type: string;
71
+ contract: () => Function;
72
+ attributes: object[];
73
+ fieldviews: {
74
+ show: {
75
+ isEdit: boolean;
76
+ description: string;
77
+ run: (d: any, req: any, attrs?: {}) => any;
78
+ };
79
+ showDay: {
80
+ isEdit: boolean;
81
+ description: string;
82
+ run: (d: any, req: any) => any;
83
+ };
84
+ format: {
85
+ isEdit: boolean;
86
+ description: string;
87
+ configFields: {
88
+ name: string;
89
+ label: string;
90
+ type: string;
91
+ sublabel: string;
92
+ }[];
93
+ run: (d: any, req: any, options: any) => any;
94
+ };
95
+ relative: {
96
+ isEdit: boolean;
97
+ description: string;
98
+ run: (d: any, req: any) => string;
99
+ };
100
+ yearsAgo: {
101
+ isEdit: boolean;
102
+ description: string;
103
+ run: (d: any, req: any) => string;
104
+ };
105
+ show_with_html: {
106
+ configFields: {
107
+ input_type: string;
108
+ name: string;
109
+ label: string;
110
+ sublabel: string;
111
+ default: string;
112
+ attributes: {
113
+ mode: string;
114
+ };
115
+ }[];
116
+ isEdit: boolean;
117
+ description: string;
118
+ run: (v: any, req: any, attrs?: {}) => any;
119
+ };
120
+ edit: {
121
+ isEdit: boolean;
122
+ blockDisplay: boolean;
123
+ description: string;
124
+ run: (nm: any, v: any, attrs: any, cls: any, required: any, field: any) => any;
125
+ };
126
+ editDay: {
127
+ isEdit: boolean;
128
+ blockDisplay: boolean;
129
+ description: string;
130
+ run: (nm: any, v: any, attrs: any, cls: any, required: any, field: any) => any;
131
+ };
132
+ };
133
+ presets: {
134
+ Now: () => Date;
135
+ };
136
+ read: (v: object, attrs: object) => object;
137
+ validate: () => boolean;
138
+ } | {
2
139
  name: string;
3
140
  sql_name: string;
4
141
  js_type: string;
@@ -54,6 +191,21 @@ export const types: ({
54
191
  description: string;
55
192
  run: (s: any) => any;
56
193
  };
194
+ show_with_html: {
195
+ configFields: {
196
+ input_type: string;
197
+ name: string;
198
+ label: string;
199
+ sublabel: string;
200
+ default: string;
201
+ attributes: {
202
+ mode: string;
203
+ };
204
+ }[];
205
+ isEdit: boolean;
206
+ description: string;
207
+ run: (v: any, req: any, attrs?: {}) => any;
208
+ };
57
209
  edit: {
58
210
  isEdit: boolean;
59
211
  blockDisplay: boolean;
@@ -325,6 +477,21 @@ export const types: ({
325
477
  }[];
326
478
  run: (nm: any, v: any, attrs: {} | undefined, cls: any, required: any, field: any, state?: {}) => any;
327
479
  };
480
+ show_with_html: {
481
+ configFields: {
482
+ input_type: string;
483
+ name: string;
484
+ label: string;
485
+ sublabel: string;
486
+ default: string;
487
+ attributes: {
488
+ mode: string;
489
+ };
490
+ }[];
491
+ isEdit: boolean;
492
+ description: string;
493
+ run: (v: any, req: any, attrs?: {}) => any;
494
+ };
328
495
  show_star_rating: {
329
496
  description: string;
330
497
  configFields: (field: any) => {
@@ -363,85 +530,22 @@ export const types: ({
363
530
  show: {
364
531
  isEdit: boolean;
365
532
  description: string;
366
- run: (v: any) => any;
367
- };
368
- checkboxes: {
369
- isEdit: boolean;
370
- description: string;
371
- run: (v: any) => any;
372
- };
373
- TrueFalse: {
374
- isEdit: boolean;
375
- description: string;
376
- run: (v: any) => "" | "True" | "False";
533
+ run: (s: any) => any;
377
534
  };
378
- edit: {
379
- isEdit: boolean;
380
- description: string;
535
+ show_with_html: {
381
536
  configFields: {
537
+ input_type: string;
382
538
  name: string;
383
539
  label: string;
384
- type: string;
540
+ sublabel: string;
541
+ default: string;
385
542
  attributes: {
386
- options: string[];
543
+ mode: string;
387
544
  };
388
545
  }[];
389
- run: (nm: any, v: any, attrs: any, cls: any, required: any, field: any) => any;
390
- };
391
- switch: {
392
- isEdit: boolean;
393
- description: string;
394
- run: (nm: any, v: any, attrs: any, cls: any, required: any, field: any) => any;
395
- };
396
- tristate: {
397
- isEdit: boolean;
398
- description: string;
399
- run: (nm: any, v: any, attrs: any, cls: any, required: any, field: any) => any;
400
- };
401
- };
402
- attributes: object[];
403
- readFromFormRecord: (rec: any, name: string) => boolean | null;
404
- read: (v: object) => boolean | null;
405
- readFromDB: (v: object) => object;
406
- listAs: (v: object) => object;
407
- validate: () => boolean;
408
- } | {
409
- name: string;
410
- sql_name: string;
411
- js_type: string;
412
- contract: () => Function;
413
- attributes: object[];
414
- fieldviews: {
415
- show: {
416
- isEdit: boolean;
417
- description: string;
418
- run: (d: any, req: any) => any;
419
- };
420
- showDay: {
421
- isEdit: boolean;
422
- description: string;
423
- run: (d: any, req: any) => any;
424
- };
425
- format: {
426
- isEdit: boolean;
427
- description: string;
428
- configFields: {
429
- name: string;
430
- label: string;
431
- type: string;
432
- sublabel: string;
433
- }[];
434
- run: (d: any, req: any, options: any) => any;
435
- };
436
- relative: {
437
- isEdit: boolean;
438
- description: string;
439
- run: (d: any, req: any) => string;
440
- };
441
- yearsAgo: {
442
546
  isEdit: boolean;
443
547
  description: string;
444
- run: (d: any, req: any) => string;
548
+ run: (v: any, req: any, attrs?: {}) => any;
445
549
  };
446
550
  edit: {
447
551
  isEdit: boolean;
@@ -449,17 +553,9 @@ export const types: ({
449
553
  description: string;
450
554
  run: (nm: any, v: any, attrs: any, cls: any, required: any, field: any) => any;
451
555
  };
452
- editDay: {
453
- isEdit: boolean;
454
- blockDisplay: boolean;
455
- description: string;
456
- run: (nm: any, v: any, attrs: any, cls: any, required: any, field: any) => any;
457
- };
458
- };
459
- presets: {
460
- Now: () => Date;
461
556
  };
462
- read: (v: object, attrs: object) => object;
557
+ attributes: object[];
558
+ read: (v: object) => object;
463
559
  validate: () => boolean;
464
560
  } | {
465
561
  name: string;
@@ -568,132 +664,68 @@ export const types: ({
568
664
  blockDisplay: boolean;
569
665
  run: (nm: any, v: any, attrs: {} | undefined, cls: any, required: any, field: any, state?: {}) => any;
570
666
  };
667
+ show_with_html: {
668
+ configFields: {
669
+ input_type: string;
670
+ name: string;
671
+ label: string;
672
+ sublabel: string;
673
+ default: string;
674
+ attributes: {
675
+ mode: string;
676
+ };
677
+ }[];
678
+ isEdit: boolean;
679
+ description: string;
680
+ run: (v: any, req: any, attrs?: {}) => any;
681
+ };
571
682
  };
572
683
  attributes: object[];
573
684
  read: (v: object) => string | number | undefined;
574
685
  validate: ({ min, max }: object) => boolean | object;
575
- } | {
576
- name: string;
577
- sql_name: string;
578
- js_type: string;
579
- contract: () => Function;
580
- fieldviews: {
581
- show: {
582
- isEdit: boolean;
583
- description: string;
584
- run: (s: any) => any;
585
- };
586
- edit: {
587
- isEdit: boolean;
588
- blockDisplay: boolean;
589
- description: string;
590
- run: (nm: any, v: any, attrs: any, cls: any, required: any, field: any) => any;
591
- };
592
- };
593
- attributes: object[];
594
- read: (v: object) => object;
595
- validate: () => boolean;
596
- })[];
597
- export const viewtemplates: ({
686
+ })[];
687
+ export const viewtemplates: ({
598
688
  name: string;
599
689
  description: string;
600
- configuration_workflow: (req: object) => import("../models/workflow");
601
- 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, always_create_view, include_fml, empty_view, groupby, ...cols }: {
602
- show_view: string;
603
- order_field: name;
604
- descending: boolean;
605
- view_to_create?: string | undefined;
606
- create_view_display: string;
607
- in_card: boolean;
608
- masonry_columns: string;
609
- rows_per_page?: number | undefined;
610
- hide_pagination: boolean;
611
- create_view_label?: string | undefined;
612
- create_view_location?: string | undefined;
613
- always_create_view: boolean;
614
- cols: any;
615
- }, state: object, extraArgs: any, { countRowsQuery }: {
616
- countRowsQuery: any;
617
- }) => Promise<div>;
618
- get_state_fields: (table_id: number, viewname: any, { show_view }: {
619
- show_view: any;
620
- }) => Promise<import("../models/field")>;
621
- display_state_form: boolean;
622
- getStringsForI18n({ create_view_label }: {
623
- create_view_label: any;
624
- }): string[] | Object[];
625
- queries: ({ table_id, viewname, configuration: { columns, default_state }, req, }: {
626
- table_id: any;
627
- viewname: any;
628
- configuration: {
629
- columns: any;
630
- default_state: any;
631
- };
632
- req: any;
633
- }) => {
634
- countRowsQuery(state: any): Promise<number>;
635
- };
636
- connectedObjects: (configuration: any) => Promise<import("@saltcorn/types/base_types").ConnectedObjects>;
637
- } | {
638
- name: string;
639
- description: string;
640
- configuration_workflow: (req: object) => import("../models/workflow");
641
- 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, }: {
642
- columns: object[];
643
- view_to_create?: string | undefined;
644
- create_view_display: string;
645
- create_view_label?: string | undefined;
646
- default_state?: object | undefined;
647
- create_view_location?: string | undefined;
648
- }, stateWithId?: object | undefined, extraOpts: object, { listQuery }: {
649
- listQuery: any;
650
- }) => Promise<any>;
651
- view_quantity: string;
652
- get_state_fields: (table_id: string, viewname: any, { columns }: {
690
+ get_state_fields: () => object[];
691
+ configuration_workflow: () => import("../models/workflow");
692
+ run: (table_id: number, viewname: string, { columns, layout }: {
653
693
  columns: object[];
654
- }) => Function;
655
- initial_config: Function;
656
- on_delete: (table_id: any, viewname: string, { default_state }: {
657
- default_state: any;
658
- }) => Promise<void>;
694
+ layout: object;
695
+ }, state: object, extra: object, { distinctValuesQuery }: {
696
+ distinctValuesQuery: any;
697
+ }) => Promise<Layout>;
698
+ initial_config: () => Promise<object>;
699
+ display_state_form: boolean;
700
+ getStringsForI18n({ layout }: {
701
+ layout: any;
702
+ }): string[];
659
703
  routes: {
660
- run_action: (table_id: number, viewname: any, { columns, layout }: {
661
- columns: object[];
662
- layout: any;
663
- }, body: object, { req, res }: {
664
- req: object;
704
+ run_action: (table_id: any, viewname: any, config: any, body: any, { req, res }: {
705
+ req: any;
665
706
  res: any;
666
- }, { getRowQuery }: {
667
- getRowQuery: any;
668
- }) => Promise<object>;
707
+ }, { actionQuery }: {
708
+ actionQuery: any;
709
+ }) => Promise<any>;
669
710
  };
670
- display_state_form: (opts: object) => boolean;
671
- default_state_form: ({ default_state }: object) => boolean;
672
- getStringsForI18n({ columns, create_view_label }: {
673
- columns: any;
674
- create_view_label: any;
675
- }): string[];
676
- queries: ({ table_id, exttable_name, name, configuration: { columns, default_state }, req, }: {
711
+ queries: ({ table_id, viewname, configuration: { columns }, req, res, exttable_name, }: {
677
712
  table_id: any;
678
- exttable_name: any;
679
- name: any;
713
+ viewname: any;
680
714
  configuration: {
681
715
  columns: any;
682
- default_state: any;
683
716
  };
684
717
  req: any;
718
+ res: any;
719
+ exttable_name: any;
685
720
  }) => {
686
- listQuery(state: any, stateHash: any): Promise<{
687
- rows: import("@saltcorn/db-common/internal").Row[];
688
- rowCount: number;
721
+ actionQuery(state: any, rndid: any): Promise<{
722
+ json: any;
723
+ }>;
724
+ distinctValuesQuery(state: any): Promise<{
725
+ distinct_values: {};
726
+ role: any;
689
727
  }>;
690
- getRowQuery(id: any): Promise<import("@saltcorn/db-common/internal").Row | null>;
691
728
  };
692
- configCheck: (view: any) => Promise<{
693
- errors: string[];
694
- warnings: string[];
695
- }>;
696
- connectedObjects: (configuration: any) => Promise<import("@saltcorn/types/base_types").ConnectedObjects>;
697
729
  } | {
698
730
  name: string;
699
731
  description: string;
@@ -843,6 +875,146 @@ export const viewtemplates: ({
843
875
  warnings: string[];
844
876
  }>;
845
877
  connectedObjects: (configuration: any) => Promise<import("@saltcorn/types/base_types").ConnectedObjects>;
878
+ } | {
879
+ name: string;
880
+ description: string;
881
+ configuration_workflow: (req: object) => import("../models/workflow");
882
+ run: (table_id: string, viewname: string, { participant_field, msg_relation, msgsender_field, msgview, msgform, participant_maxread_field, }: {
883
+ participant_field: string;
884
+ msg_relation: string;
885
+ msgsender_field: any;
886
+ msgview: string;
887
+ msgform: string;
888
+ participant_maxread_field: string;
889
+ }, state: object, { req, res }: {
890
+ req: object;
891
+ res: object;
892
+ }, { getRowQuery, updateQuery, optionsQuery }: {
893
+ getRowQuery: any;
894
+ updateQuery: any;
895
+ optionsQuery: any;
896
+ }) => Promise<div>;
897
+ get_state_fields: () => object[];
898
+ display_state_form: boolean;
899
+ routes: {
900
+ submit_msg_ajax: (table_id: any, viewname: string, { participant_field, msg_relation, msgsender_field, msgview, msgform, participant_maxread_field, }: {
901
+ participant_field: string;
902
+ msg_relation: string;
903
+ msgsender_field: any;
904
+ msgview: string;
905
+ msgform: string;
906
+ participant_maxread_field: string;
907
+ }, body: any, { req, res }: {
908
+ req: object;
909
+ res: object;
910
+ }, { submitAjaxQuery }: {
911
+ submitAjaxQuery: any;
912
+ }) => Promise<object>;
913
+ ack_read: (table_id: any, viewname: any, { participant_field, participant_maxread_field }: {
914
+ participant_field: string;
915
+ participant_maxread_field: string;
916
+ }, body: any, { req, res }: {
917
+ req: object;
918
+ res: object;
919
+ }, { ackReadQuery }: {
920
+ ackReadQuery: any;
921
+ }) => Promise<void>;
922
+ 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>;
923
+ };
924
+ noAutoTest: boolean;
925
+ authorize_join: ({ table_id, min_role, configuration: { participant_field } }: {
926
+ participant_field: object;
927
+ }, room_id: string, user: object) => Promise<object>;
928
+ virtual_triggers: (table_id: any, viewname: string, { participant_field, msg_relation, msgsender_field, msgview, msgform, participant_maxread_field, }: {
929
+ participant_field: any;
930
+ msg_relation: string;
931
+ msgsender_field: string;
932
+ msgview: string;
933
+ msgform: any;
934
+ participant_maxread_field: any;
935
+ }) => object[];
936
+ getStringsForI18n(): object[];
937
+ queries: ({ table_id, viewname, configuration: { columns, default_state }, req, }: {
938
+ table_id: any;
939
+ viewname: any;
940
+ configuration: {
941
+ columns: any;
942
+ default_state: any;
943
+ };
944
+ req: any;
945
+ }) => {
946
+ 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>;
947
+ updateQuery(partRow: any, part_table_name: any, max_read_id: any, part_maxread_field: any): Promise<void>;
948
+ submitAjaxQuery(msg_relation: any, participant_field: any, body: any, msgform: any, msgsender_field: any, participant_maxread_field: any): Promise<{
949
+ json: {
950
+ msgid: {
951
+ error: string;
952
+ } | {
953
+ success: any;
954
+ };
955
+ error?: undefined;
956
+ };
957
+ } | {
958
+ json: {
959
+ error: any;
960
+ msgid?: undefined;
961
+ };
962
+ }>;
963
+ ackReadQuery(participant_field: any, participant_maxread_field: any, body: any): Promise<{
964
+ json: {
965
+ error: string;
966
+ success?: undefined;
967
+ };
968
+ } | {
969
+ json: {
970
+ success: string;
971
+ error?: undefined;
972
+ };
973
+ }>;
974
+ fetchOlderMsgQuery(participant_field: any, body: any): Promise<import("@saltcorn/db-common/internal").Row | null>;
975
+ optionsQuery(reftable_name: any, type: any, attributes: any, where: any): Promise<any>;
976
+ };
977
+ connectedObjects: (configuration: any) => Promise<import("@saltcorn/types/base_types").ConnectedObjects>;
978
+ } | {
979
+ name: string;
980
+ description: string;
981
+ configuration_workflow: (req: object) => import("../models/workflow");
982
+ 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, always_create_view, include_fml, empty_view, groupby, ...cols }: {
983
+ show_view: string;
984
+ order_field: name;
985
+ descending: boolean;
986
+ view_to_create?: string | undefined;
987
+ create_view_display: string;
988
+ in_card: boolean;
989
+ masonry_columns: string;
990
+ rows_per_page?: number | undefined;
991
+ hide_pagination: boolean;
992
+ create_view_label?: string | undefined;
993
+ create_view_location?: string | undefined;
994
+ always_create_view: boolean;
995
+ cols: any;
996
+ }, state: object, extraArgs: any, { countRowsQuery }: {
997
+ countRowsQuery: any;
998
+ }) => Promise<div>;
999
+ get_state_fields: (table_id: number, viewname: any, { show_view }: {
1000
+ show_view: any;
1001
+ }) => Promise<import("../models/field")>;
1002
+ display_state_form: boolean;
1003
+ getStringsForI18n({ create_view_label }: {
1004
+ create_view_label: any;
1005
+ }): string[] | Object[];
1006
+ queries: ({ table_id, viewname, configuration: { columns, default_state }, req, }: {
1007
+ table_id: any;
1008
+ viewname: any;
1009
+ configuration: {
1010
+ columns: any;
1011
+ default_state: any;
1012
+ };
1013
+ req: any;
1014
+ }) => {
1015
+ countRowsQuery(state: any): Promise<number>;
1016
+ };
1017
+ connectedObjects: (configuration: any) => Promise<import("@saltcorn/types/base_types").ConnectedObjects>;
846
1018
  } | {
847
1019
  name: string;
848
1020
  description: string;
@@ -917,6 +1089,66 @@ export const viewtemplates: ({
917
1089
  warnings: string[];
918
1090
  }>;
919
1091
  connectedObjects: (configuration: any) => Promise<import("@saltcorn/types/base_types").ConnectedObjects>;
1092
+ } | {
1093
+ name: string;
1094
+ description: string;
1095
+ configuration_workflow: (req: object) => import("../models/workflow");
1096
+ 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, }: {
1097
+ columns: object[];
1098
+ view_to_create?: string | undefined;
1099
+ create_view_display: string;
1100
+ create_view_label?: string | undefined;
1101
+ default_state?: object | undefined;
1102
+ create_view_location?: string | undefined;
1103
+ }, stateWithId?: object | undefined, extraOpts: object, { listQuery }: {
1104
+ listQuery: any;
1105
+ }) => Promise<any>;
1106
+ view_quantity: string;
1107
+ get_state_fields: (table_id: string, viewname: any, { columns }: {
1108
+ columns: object[];
1109
+ }) => Function;
1110
+ initial_config: Function;
1111
+ on_delete: (table_id: any, viewname: string, { default_state }: {
1112
+ default_state: any;
1113
+ }) => Promise<void>;
1114
+ routes: {
1115
+ run_action: (table_id: number, viewname: any, { columns, layout }: {
1116
+ columns: object[];
1117
+ layout: any;
1118
+ }, body: object, { req, res }: {
1119
+ req: object;
1120
+ res: any;
1121
+ }, { getRowQuery }: {
1122
+ getRowQuery: any;
1123
+ }) => Promise<object>;
1124
+ };
1125
+ display_state_form: (opts: object) => boolean;
1126
+ default_state_form: ({ default_state }: object) => boolean;
1127
+ getStringsForI18n({ columns, create_view_label }: {
1128
+ columns: any;
1129
+ create_view_label: any;
1130
+ }): string[];
1131
+ queries: ({ table_id, exttable_name, name, configuration: { columns, default_state }, req, }: {
1132
+ table_id: any;
1133
+ exttable_name: any;
1134
+ name: any;
1135
+ configuration: {
1136
+ columns: any;
1137
+ default_state: any;
1138
+ };
1139
+ req: any;
1140
+ }) => {
1141
+ listQuery(state: any, stateHash: any): Promise<{
1142
+ rows: import("@saltcorn/db-common/internal").Row[];
1143
+ rowCount: number;
1144
+ }>;
1145
+ getRowQuery(id: any): Promise<import("@saltcorn/db-common/internal").Row | null>;
1146
+ };
1147
+ configCheck: (view: any) => Promise<{
1148
+ errors: string[];
1149
+ warnings: string[];
1150
+ }>;
1151
+ connectedObjects: (configuration: any) => Promise<import("@saltcorn/types/base_types").ConnectedObjects>;
920
1152
  } | {
921
1153
  name: string;
922
1154
  description: string;
@@ -953,148 +1185,6 @@ export const viewtemplates: ({
953
1185
  }) => Promise<{
954
1186
  embeddedViews: import("../models/view")[];
955
1187
  }>;
956
- } | {
957
- name: string;
958
- description: string;
959
- get_state_fields: () => object[];
960
- configuration_workflow: () => import("../models/workflow");
961
- run: (table_id: number, viewname: string, { columns, layout }: {
962
- columns: object[];
963
- layout: object;
964
- }, state: object, extra: object, { distinctValuesQuery }: {
965
- distinctValuesQuery: any;
966
- }) => Promise<Layout>;
967
- initial_config: () => Promise<object>;
968
- display_state_form: boolean;
969
- getStringsForI18n({ layout }: {
970
- layout: any;
971
- }): string[];
972
- routes: {
973
- run_action: (table_id: any, viewname: any, config: any, body: any, { req, res }: {
974
- req: any;
975
- res: any;
976
- }, { actionQuery }: {
977
- actionQuery: any;
978
- }) => Promise<any>;
979
- };
980
- queries: ({ table_id, viewname, configuration: { columns }, req, res, exttable_name, }: {
981
- table_id: any;
982
- viewname: any;
983
- configuration: {
984
- columns: any;
985
- };
986
- req: any;
987
- res: any;
988
- exttable_name: any;
989
- }) => {
990
- actionQuery(state: any, rndid: any): Promise<{
991
- json: any;
992
- }>;
993
- distinctValuesQuery(state: any): Promise<{
994
- distinct_values: {};
995
- role: any;
996
- }>;
997
- };
998
- } | {
999
- name: string;
1000
- description: string;
1001
- configuration_workflow: (req: object) => import("../models/workflow");
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[];
1018
- display_state_form: boolean;
1019
- routes: {
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;
1027
- }, body: any, { req, res }: {
1028
- req: object;
1029
- res: object;
1030
- }, { submitAjaxQuery }: {
1031
- submitAjaxQuery: any;
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>;
1043
- };
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, }: {
1058
- table_id: any;
1059
- viewname: any;
1060
- configuration: {
1061
- columns: any;
1062
- default_state: any;
1063
- };
1064
- req: any;
1065
- }) => {
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
- };
1077
- } | {
1078
- json: {
1079
- error: any;
1080
- msgid?: undefined;
1081
- };
1082
- }>;
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
- };
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>;
1096
- };
1097
- connectedObjects: (configuration: any) => Promise<import("@saltcorn/types/base_types").ConnectedObjects>;
1098
1188
  })[];
1099
1189
  import fileviews = require("./fileviews");
1100
1190
  import actions = require("./actions");