@saltcorn/data 0.9.1-beta.1 → 0.9.1-beta.10

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 (102) hide show
  1. package/dist/base-plugin/actions.d.ts +6 -2
  2. package/dist/base-plugin/actions.d.ts.map +1 -1
  3. package/dist/base-plugin/actions.js +18 -5
  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 +4 -3
  7. package/dist/base-plugin/fieldviews.js.map +1 -1
  8. package/dist/base-plugin/index.d.ts +420 -330
  9. package/dist/base-plugin/index.d.ts.map +1 -1
  10. package/dist/base-plugin/types.d.ts +41 -15
  11. package/dist/base-plugin/types.d.ts.map +1 -1
  12. package/dist/base-plugin/types.js +48 -8
  13. package/dist/base-plugin/types.js.map +1 -1
  14. package/dist/base-plugin/viewtemplates/edit.d.ts.map +1 -1
  15. package/dist/base-plugin/viewtemplates/edit.js +21 -8
  16. package/dist/base-plugin/viewtemplates/edit.js.map +1 -1
  17. package/dist/base-plugin/viewtemplates/feed.d.ts +1 -1
  18. package/dist/base-plugin/viewtemplates/feed.d.ts.map +1 -1
  19. package/dist/base-plugin/viewtemplates/feed.js +31 -4
  20. package/dist/base-plugin/viewtemplates/feed.js.map +1 -1
  21. package/dist/base-plugin/viewtemplates/filter.d.ts.map +1 -1
  22. package/dist/base-plugin/viewtemplates/filter.js +16 -3
  23. package/dist/base-plugin/viewtemplates/filter.js.map +1 -1
  24. package/dist/base-plugin/viewtemplates/list.d.ts.map +1 -1
  25. package/dist/base-plugin/viewtemplates/list.js +1 -1
  26. package/dist/base-plugin/viewtemplates/list.js.map +1 -1
  27. package/dist/base-plugin/viewtemplates/show.d.ts.map +1 -1
  28. package/dist/base-plugin/viewtemplates/show.js +14 -7
  29. package/dist/base-plugin/viewtemplates/show.js.map +1 -1
  30. package/dist/base-plugin/viewtemplates/viewable_fields.d.ts +2 -2
  31. package/dist/base-plugin/viewtemplates/viewable_fields.d.ts.map +1 -1
  32. package/dist/base-plugin/viewtemplates/viewable_fields.js +18 -10
  33. package/dist/base-plugin/viewtemplates/viewable_fields.js.map +1 -1
  34. package/dist/db/fixtures.d.ts.map +1 -1
  35. package/dist/db/fixtures.js +15 -0
  36. package/dist/db/fixtures.js.map +1 -1
  37. package/dist/db/state.d.ts.map +1 -1
  38. package/dist/db/state.js +5 -2
  39. package/dist/db/state.js.map +1 -1
  40. package/dist/models/email.d.ts +6 -5
  41. package/dist/models/email.d.ts.map +1 -1
  42. package/dist/models/eventlog.js +1 -1
  43. package/dist/models/eventlog.js.map +1 -1
  44. package/dist/models/layout.d.ts.map +1 -1
  45. package/dist/models/layout.js +0 -1
  46. package/dist/models/layout.js.map +1 -1
  47. package/dist/models/page.d.ts.map +1 -1
  48. package/dist/models/page.js +12 -12
  49. package/dist/models/page.js.map +1 -1
  50. package/dist/models/plugin.d.ts +1 -0
  51. package/dist/models/plugin.d.ts.map +1 -1
  52. package/dist/models/plugin.js +5 -0
  53. package/dist/models/plugin.js.map +1 -1
  54. package/dist/models/table.d.ts.map +1 -1
  55. package/dist/models/table.js +26 -1
  56. package/dist/models/table.js.map +1 -1
  57. package/dist/models/table_constraints.d.ts.map +1 -1
  58. package/dist/models/table_constraints.js +4 -4
  59. package/dist/models/table_constraints.js.map +1 -1
  60. package/dist/models/trigger.d.ts +11 -4
  61. package/dist/models/trigger.d.ts.map +1 -1
  62. package/dist/models/trigger.js +20 -6
  63. package/dist/models/trigger.js.map +1 -1
  64. package/dist/models/user.d.ts +1 -0
  65. package/dist/models/user.d.ts.map +1 -1
  66. package/dist/models/user.js +22 -5
  67. package/dist/models/user.js.map +1 -1
  68. package/dist/models/view.d.ts.map +1 -1
  69. package/dist/models/view.js +16 -11
  70. package/dist/models/view.js.map +1 -1
  71. package/dist/plugin-helper.d.ts +10 -2
  72. package/dist/plugin-helper.d.ts.map +1 -1
  73. package/dist/plugin-helper.js +122 -20
  74. package/dist/plugin-helper.js.map +1 -1
  75. package/dist/tests/actions.test.js +292 -1
  76. package/dist/tests/actions.test.js.map +1 -1
  77. package/dist/tests/auxtest.test.js +40 -2
  78. package/dist/tests/auxtest.test.js.map +1 -1
  79. package/dist/tests/common_helpers.d.ts +1 -0
  80. package/dist/tests/common_helpers.d.ts.map +1 -1
  81. package/dist/tests/common_helpers.js +239 -1
  82. package/dist/tests/common_helpers.js.map +1 -1
  83. package/dist/tests/edit.test.d.ts +2 -0
  84. package/dist/tests/edit.test.d.ts.map +1 -0
  85. package/dist/tests/edit.test.js +463 -0
  86. package/dist/tests/edit.test.js.map +1 -0
  87. package/dist/tests/exact_views.test.js +14 -14
  88. package/dist/tests/exact_views.test.js.map +1 -1
  89. package/dist/tests/mocks.d.ts +6 -5
  90. package/dist/tests/mocks.d.ts.map +1 -1
  91. package/dist/tests/mocks.js +17 -5
  92. package/dist/tests/mocks.js.map +1 -1
  93. package/dist/tests/table.test.js +23 -1
  94. package/dist/tests/table.test.js.map +1 -1
  95. package/dist/tests/workflow.test.js +8 -2
  96. package/dist/tests/workflow.test.js.map +1 -1
  97. package/dist/utils.d.ts +5 -0
  98. package/dist/utils.d.ts.map +1 -1
  99. package/dist/utils.js +16 -0
  100. package/dist/utils.js.map +1 -1
  101. package/package.json +7 -8
  102. package/webpack.config.js +1 -1
@@ -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,92 +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: 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, }: {
602
- columns: object[];
603
- view_to_create?: string | undefined;
604
- create_view_display: string;
605
- create_view_label?: string | undefined;
606
- default_state?: object | undefined;
607
- create_view_location?: string | undefined;
608
- }, stateWithId?: object | undefined, extraOpts: object, { listQuery }: {
609
- listQuery: any;
610
- }) => Promise<any>;
611
- view_quantity: string;
612
- 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 }: {
613
693
  columns: object[];
614
- }) => Function;
615
- initial_config: Function;
616
- on_delete: (table_id: any, viewname: string, { default_state }: {
617
- default_state: any;
618
- }) => 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[];
619
703
  routes: {
620
- run_action: (table_id: number, viewname: any, { columns, layout }: {
621
- columns: object[];
622
- layout: any;
623
- }, body: object, { req, res }: {
624
- req: object;
704
+ run_action: (table_id: any, viewname: any, config: any, body: any, { req, res }: {
705
+ req: any;
625
706
  res: any;
626
- }, { getRowQuery }: {
627
- getRowQuery: any;
628
- }) => Promise<object>;
707
+ }, { actionQuery }: {
708
+ actionQuery: any;
709
+ }) => Promise<any>;
629
710
  };
630
- display_state_form: (opts: object) => boolean;
631
- default_state_form: ({ default_state }: object) => boolean;
632
- getStringsForI18n({ columns, create_view_label }: {
633
- columns: any;
634
- create_view_label: any;
635
- }): string[];
636
- queries: ({ table_id, exttable_name, name, configuration: { columns, default_state }, req, }: {
711
+ queries: ({ table_id, viewname, configuration: { columns }, req, res, exttable_name, }: {
637
712
  table_id: any;
638
- exttable_name: any;
639
- name: any;
713
+ viewname: any;
640
714
  configuration: {
641
715
  columns: any;
642
- default_state: any;
643
716
  };
644
717
  req: any;
718
+ res: any;
719
+ exttable_name: any;
645
720
  }) => {
646
- listQuery(state: any, stateHash: any): Promise<{
647
- rows: import("@saltcorn/db-common/internal").Row[];
648
- rowCount: number;
721
+ actionQuery(state: any, rndid: any): Promise<{
722
+ json: any;
723
+ }>;
724
+ distinctValuesQuery(state: any): Promise<{
725
+ distinct_values: {};
726
+ role: any;
649
727
  }>;
650
- getRowQuery(id: any): Promise<import("@saltcorn/db-common/internal").Row | null>;
651
728
  };
652
- configCheck: (view: any) => Promise<{
653
- errors: string[];
654
- warnings: string[];
655
- }>;
656
- connectedObjects: (configuration: any) => Promise<import("@saltcorn/types/base_types").ConnectedObjects>;
657
729
  } | {
658
730
  name: string;
659
731
  description: string;
@@ -803,6 +875,146 @@ export const viewtemplates: ({
803
875
  warnings: string[];
804
876
  }>;
805
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>;
806
1018
  } | {
807
1019
  name: string;
808
1020
  description: string;
@@ -881,179 +1093,81 @@ export const viewtemplates: ({
881
1093
  name: string;
882
1094
  description: string;
883
1095
  configuration_workflow: (req: object) => import("../models/workflow");
884
- run: (table_id: string, viewname: string, { list_view, show_view, list_width, subtables }: {
885
- list_view: string;
886
- show_view: string;
887
- subtables: object;
888
- }, state: any, extraArgs: any, { getRowQuery }: {
889
- getRowQuery: any;
890
- }) => Promise<div>;
891
- get_state_fields: (table_id: any, viewname: any, { list_view, show_view }: {
892
- list_view: string;
893
- show_view: any;
894
- }) => Promise<object[]>;
895
- display_state_form: ({ list_view, _omit_state_form }: {
896
- list_view: string;
897
- _omit_state_form: boolean;
898
- }) => boolean;
899
- queries: ({ table_id, viewname, configuration: { columns, default_state }, req, }: {
900
- table_id: any;
901
- viewname: any;
902
- configuration: {
903
- columns: any;
904
- default_state: any;
905
- };
906
- req: any;
907
- }) => {
908
- getRowQuery(uniques: any): Promise<import("@saltcorn/db-common/internal").Row | null>;
909
- };
910
- connectedObjects: ({ list_view, subtables }: {
911
- list_view: any;
912
- subtables: any;
913
- }) => Promise<{
914
- embeddedViews: import("../models/view")[];
915
- }>;
916
- } | {
917
- name: string;
918
- description: string;
919
- configuration_workflow: (req: object) => import("../models/workflow");
920
- 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, ...cols }: {
921
- show_view: string;
922
- order_field: name;
923
- descending: boolean;
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[];
924
1098
  view_to_create?: string | undefined;
925
1099
  create_view_display: string;
926
- in_card: boolean;
927
- masonry_columns: string;
928
- rows_per_page?: number | undefined;
929
- hide_pagination: boolean;
930
1100
  create_view_label?: string | undefined;
1101
+ default_state?: object | undefined;
931
1102
  create_view_location?: string | undefined;
932
- always_create_view: boolean;
933
- cols: any;
934
- }, state: object, extraArgs: any, { countRowsQuery }: {
935
- countRowsQuery: any;
936
- }) => Promise<div>;
937
- get_state_fields: (table_id: number, viewname: any, { show_view }: {
938
- show_view: any;
939
- }) => Promise<import("../models/field")>;
940
- display_state_form: boolean;
941
- getStringsForI18n({ create_view_label }: {
942
- create_view_label: any;
943
- }): string[] | Object[];
944
- queries: ({ table_id, viewname, configuration: { columns, default_state }, req, }: {
945
- table_id: any;
946
- viewname: any;
947
- configuration: {
948
- columns: any;
949
- default_state: any;
950
- };
951
- req: any;
952
- }) => {
953
- countRowsQuery(state: any): Promise<number>;
954
- };
955
- connectedObjects: (configuration: any) => Promise<import("@saltcorn/types/base_types").ConnectedObjects>;
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 }: {
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 }: {
962
1108
  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[];
1109
+ }) => Function;
1110
+ initial_config: Function;
1111
+ on_delete: (table_id: any, viewname: string, { default_state }: {
1112
+ default_state: any;
1113
+ }) => Promise<void>;
972
1114
  routes: {
973
- run_action: (table_id: any, viewname: any, config: any, body: any, { req, res }: {
974
- req: any;
1115
+ run_action: (table_id: number, viewname: any, { columns, layout }: {
1116
+ columns: object[];
1117
+ layout: any;
1118
+ }, body: object, { req, res }: {
1119
+ req: object;
975
1120
  res: any;
976
- }, { actionQuery }: {
977
- actionQuery: any;
978
- }) => Promise<any>;
1121
+ }, { getRowQuery }: {
1122
+ getRowQuery: any;
1123
+ }) => Promise<object>;
979
1124
  };
980
- queries: ({ table_id, viewname, configuration: { columns }, req, res, exttable_name, }: {
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, }: {
981
1132
  table_id: any;
982
- viewname: any;
1133
+ exttable_name: any;
1134
+ name: any;
983
1135
  configuration: {
984
1136
  columns: any;
1137
+ default_state: any;
985
1138
  };
986
1139
  req: any;
987
- res: any;
988
- exttable_name: any;
989
1140
  }) => {
990
- actionQuery(state: any, rndid: any): Promise<{
991
- json: any;
992
- }>;
993
- distinctValuesQuery(state: any): Promise<{
994
- distinct_values: {};
995
- role: any;
1141
+ listQuery(state: any, stateHash: any): Promise<{
1142
+ rows: import("@saltcorn/db-common/internal").Row[];
1143
+ rowCount: number;
996
1144
  }>;
1145
+ getRowQuery(id: any): Promise<import("@saltcorn/db-common/internal").Row | null>;
997
1146
  };
1147
+ configCheck: (view: any) => Promise<{
1148
+ errors: string[];
1149
+ warnings: string[];
1150
+ }>;
1151
+ connectedObjects: (configuration: any) => Promise<import("@saltcorn/types/base_types").ConnectedObjects>;
998
1152
  } | {
999
1153
  name: string;
1000
1154
  description: string;
1001
1155
  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 }: {
1156
+ run: (table_id: string, viewname: string, { list_view, show_view, list_width, subtables }: {
1157
+ list_view: string;
1158
+ show_view: string;
1159
+ subtables: object;
1160
+ }, state: any, extraArgs: any, { getRowQuery }: {
1013
1161
  getRowQuery: any;
1014
- updateQuery: any;
1015
- optionsQuery: any;
1016
1162
  }) => 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[];
1163
+ get_state_fields: (table_id: any, viewname: any, { list_view, show_view }: {
1164
+ list_view: string;
1165
+ show_view: any;
1166
+ }) => Promise<object[]>;
1167
+ display_state_form: ({ list_view, _omit_state_form }: {
1168
+ list_view: string;
1169
+ _omit_state_form: boolean;
1170
+ }) => boolean;
1057
1171
  queries: ({ table_id, viewname, configuration: { columns, default_state }, req, }: {
1058
1172
  table_id: any;
1059
1173
  viewname: any;
@@ -1063,38 +1177,14 @@ export const viewtemplates: ({
1063
1177
  };
1064
1178
  req: any;
1065
1179
  }) => {
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>;
1180
+ getRowQuery(uniques: any): Promise<import("@saltcorn/db-common/internal").Row | null>;
1096
1181
  };
1097
- connectedObjects: (configuration: any) => Promise<import("@saltcorn/types/base_types").ConnectedObjects>;
1182
+ connectedObjects: ({ list_view, subtables }: {
1183
+ list_view: any;
1184
+ subtables: any;
1185
+ }) => Promise<{
1186
+ embeddedViews: import("../models/view")[];
1187
+ }>;
1098
1188
  })[];
1099
1189
  import fileviews = require("./fileviews");
1100
1190
  import actions = require("./actions");