@saltcorn/data 0.9.0-beta.9 → 0.9.1-beta.0

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 (50) hide show
  1. package/dist/base-plugin/actions.d.ts +86 -8
  2. package/dist/base-plugin/actions.d.ts.map +1 -1
  3. package/dist/base-plugin/actions.js +103 -13
  4. package/dist/base-plugin/actions.js.map +1 -1
  5. package/dist/base-plugin/index.d.ts +394 -394
  6. package/dist/base-plugin/types.js +2 -2
  7. package/dist/base-plugin/types.js.map +1 -1
  8. package/dist/base-plugin/viewtemplates/edit.d.ts.map +1 -1
  9. package/dist/base-plugin/viewtemplates/edit.js +6 -3
  10. package/dist/base-plugin/viewtemplates/edit.js.map +1 -1
  11. package/dist/base-plugin/viewtemplates/feed.d.ts.map +1 -1
  12. package/dist/base-plugin/viewtemplates/feed.js +8 -2
  13. package/dist/base-plugin/viewtemplates/feed.js.map +1 -1
  14. package/dist/base-plugin/viewtemplates/show.d.ts.map +1 -1
  15. package/dist/base-plugin/viewtemplates/show.js +13 -0
  16. package/dist/base-plugin/viewtemplates/show.js.map +1 -1
  17. package/dist/base-plugin/viewtemplates/viewable_fields.d.ts.map +1 -1
  18. package/dist/base-plugin/viewtemplates/viewable_fields.js +5 -4
  19. package/dist/base-plugin/viewtemplates/viewable_fields.js.map +1 -1
  20. package/dist/migrations/202311011755.d.ts +3 -0
  21. package/dist/migrations/202311011755.d.ts.map +1 -0
  22. package/dist/migrations/202311011755.js +5 -0
  23. package/dist/migrations/202311011755.js.map +1 -0
  24. package/dist/models/email.d.ts +2 -0
  25. package/dist/models/email.d.ts.map +1 -1
  26. package/dist/models/email.js +1 -0
  27. package/dist/models/email.js.map +1 -1
  28. package/dist/models/field.d.ts.map +1 -1
  29. package/dist/models/field.js +1 -0
  30. package/dist/models/field.js.map +1 -1
  31. package/dist/models/index.d.ts +1 -1
  32. package/dist/models/page.d.ts +1 -0
  33. package/dist/models/page.d.ts.map +1 -1
  34. package/dist/models/page.js +3 -4
  35. package/dist/models/page.js.map +1 -1
  36. package/dist/models/table.d.ts.map +1 -1
  37. package/dist/models/table.js +3 -1
  38. package/dist/models/table.js.map +1 -1
  39. package/dist/models/workflow.d.ts.map +1 -1
  40. package/dist/models/workflow.js +10 -5
  41. package/dist/models/workflow.js.map +1 -1
  42. package/dist/tests/exact_views.test.js +2 -2
  43. package/dist/tests/exact_views.test.js.map +1 -1
  44. package/dist/tests/workflow.test.js +163 -0
  45. package/dist/tests/workflow.test.js.map +1 -1
  46. package/dist/utils.d.ts +1 -0
  47. package/dist/utils.d.ts.map +1 -1
  48. package/dist/utils.js +8 -0
  49. package/dist/utils.js.map +1 -1
  50. package/package.json +7 -7
@@ -363,17 +363,103 @@ export const types: ({
363
363
  show: {
364
364
  isEdit: boolean;
365
365
  description: string;
366
- run: (s: any) => any;
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";
367
377
  };
368
378
  edit: {
369
379
  isEdit: boolean;
370
- blockDisplay: boolean;
380
+ description: string;
381
+ configFields: {
382
+ name: string;
383
+ label: string;
384
+ type: string;
385
+ attributes: {
386
+ options: string[];
387
+ };
388
+ }[];
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;
371
398
  description: string;
372
399
  run: (nm: any, v: any, attrs: any, cls: any, required: any, field: any) => any;
373
400
  };
374
401
  };
375
402
  attributes: object[];
376
- read: (v: object) => 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
+ isEdit: boolean;
443
+ description: string;
444
+ run: (d: any, req: any) => string;
445
+ };
446
+ edit: {
447
+ isEdit: boolean;
448
+ blockDisplay: boolean;
449
+ description: string;
450
+ run: (nm: any, v: any, attrs: any, cls: any, required: any, field: any) => any;
451
+ };
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
+ };
462
+ read: (v: object, attrs: object) => object;
377
463
  validate: () => boolean;
378
464
  } | {
379
465
  name: string;
@@ -491,38 +577,11 @@ export const types: ({
491
577
  sql_name: string;
492
578
  js_type: string;
493
579
  contract: () => Function;
494
- attributes: object[];
495
580
  fieldviews: {
496
581
  show: {
497
582
  isEdit: boolean;
498
583
  description: string;
499
- run: (d: any, req: any) => any;
500
- };
501
- showDay: {
502
- isEdit: boolean;
503
- description: string;
504
- run: (d: any, req: any) => any;
505
- };
506
- format: {
507
- isEdit: boolean;
508
- description: string;
509
- configFields: {
510
- name: string;
511
- label: string;
512
- type: string;
513
- sublabel: string;
514
- }[];
515
- run: (d: any, req: any, options: any) => any;
516
- };
517
- relative: {
518
- isEdit: boolean;
519
- description: string;
520
- run: (d: any, req: any) => string;
521
- };
522
- yearsAgo: {
523
- isEdit: boolean;
524
- description: string;
525
- run: (d: any, req: any) => string;
584
+ run: (s: any) => any;
526
585
  };
527
586
  edit: {
528
587
  isEdit: boolean;
@@ -530,191 +589,165 @@ export const types: ({
530
589
  description: string;
531
590
  run: (nm: any, v: any, attrs: any, cls: any, required: any, field: any) => any;
532
591
  };
533
- editDay: {
534
- isEdit: boolean;
535
- blockDisplay: boolean;
536
- description: string;
537
- run: (nm: any, v: any, attrs: any, cls: any, required: any, field: any) => any;
538
- };
539
- };
540
- presets: {
541
- Now: () => Date;
542
- };
543
- read: (v: object, attrs: object) => object;
544
- validate: () => boolean;
545
- } | {
546
- name: string;
547
- sql_name: string;
548
- js_type: string;
549
- contract: () => Function;
550
- fieldviews: {
551
- show: {
552
- isEdit: boolean;
553
- description: string;
554
- run: (v: any) => any;
555
- };
556
- checkboxes: {
557
- isEdit: boolean;
558
- description: string;
559
- run: (v: any) => any;
560
- };
561
- TrueFalse: {
562
- isEdit: boolean;
563
- description: string;
564
- run: (v: any) => "" | "True" | "False";
565
- };
566
- edit: {
567
- isEdit: boolean;
568
- description: string;
569
- configFields: {
570
- name: string;
571
- label: string;
572
- type: string;
573
- attributes: {
574
- options: string[];
575
- };
576
- }[];
577
- run: (nm: any, v: any, attrs: any, cls: any, required: any, field: any) => any;
578
- };
579
- switch: {
580
- isEdit: boolean;
581
- description: string;
582
- run: (nm: any, v: any, attrs: any, cls: any, required: any, field: any) => any;
583
- };
584
- tristate: {
585
- isEdit: boolean;
586
- description: string;
587
- run: (nm: any, v: any, attrs: any, cls: any, required: any, field: any) => any;
588
- };
589
592
  };
590
593
  attributes: object[];
591
- readFromFormRecord: (rec: any, name: string) => boolean | null;
592
- read: (v: object) => boolean | null;
593
- readFromDB: (v: object) => object;
594
- listAs: (v: object) => object;
594
+ read: (v: object) => object;
595
595
  validate: () => boolean;
596
596
  })[];
597
597
  export const viewtemplates: ({
598
598
  name: string;
599
599
  description: string;
600
- configuration_workflow: (req: object) => import("../models/workflow");
601
- run: (table_id: string, viewname: string, { list_view, show_view, list_width, subtables }: {
602
- list_view: string;
603
- show_view: string;
604
- subtables: object;
605
- }, state: any, extraArgs: any, { getRowQuery }: {
606
- getRowQuery: any;
607
- }) => Promise<div>;
608
- get_state_fields: (table_id: any, viewname: any, { list_view, show_view }: {
609
- list_view: string;
610
- show_view: any;
611
- }) => Promise<object[]>;
612
- display_state_form: ({ list_view, _omit_state_form }: {
613
- list_view: string;
614
- _omit_state_form: boolean;
615
- }) => boolean;
616
- queries: ({ table_id, viewname, configuration: { columns, default_state }, req, }: {
600
+ get_state_fields: () => object[];
601
+ configuration_workflow: () => import("../models/workflow");
602
+ run: (table_id: number, viewname: string, { columns, layout }: {
603
+ columns: object[];
604
+ layout: object;
605
+ }, state: object, extra: object, { distinctValuesQuery }: {
606
+ distinctValuesQuery: any;
607
+ }) => Promise<Layout>;
608
+ initial_config: () => Promise<object>;
609
+ display_state_form: boolean;
610
+ getStringsForI18n({ layout }: {
611
+ layout: any;
612
+ }): string[];
613
+ routes: {
614
+ run_action: (table_id: any, viewname: any, config: any, body: any, { req, res }: {
615
+ req: any;
616
+ res: any;
617
+ }, { actionQuery }: {
618
+ actionQuery: any;
619
+ }) => Promise<any>;
620
+ };
621
+ queries: ({ table_id, viewname, configuration: { columns }, req, res, exttable_name, }: {
617
622
  table_id: any;
618
623
  viewname: any;
619
624
  configuration: {
620
625
  columns: any;
621
- default_state: any;
622
626
  };
623
627
  req: any;
628
+ res: any;
629
+ exttable_name: any;
624
630
  }) => {
625
- getRowQuery(uniques: any): Promise<import("@saltcorn/db-common/internal").Row | null>;
631
+ actionQuery(state: any, rndid: any): Promise<{
632
+ json: any;
633
+ }>;
634
+ distinctValuesQuery(state: any): Promise<{
635
+ distinct_values: {};
636
+ role: any;
637
+ }>;
626
638
  };
627
- connectedObjects: ({ list_view, subtables }: {
628
- list_view: any;
629
- subtables: any;
630
- }) => Promise<{
631
- embeddedViews: import("../models/view")[];
632
- }>;
633
639
  } | {
634
640
  name: string;
635
641
  description: string;
636
642
  configuration_workflow: (req: object) => import("../models/workflow");
637
- 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, }: {
643
+ run: (table_id: number, viewname: string, cfg: any, state: string, { res, req }: {
644
+ req: object;
645
+ res: object;
646
+ }, { editQuery }: {
647
+ editQuery: any;
648
+ }) => Promise<import("../models/form")>;
649
+ runMany: (table_id: number, viewname: string, { columns, layout, auto_save, split_paste }: {
650
+ columns: any;
651
+ layout: any;
652
+ }, state: State, extra: object, { editManyQuery, getRowQuery, optionsQuery }: {
653
+ editManyQuery: any;
654
+ getRowQuery: any;
655
+ optionsQuery: any;
656
+ }) => Promise<import("../models/form")[]>;
657
+ runPost: (table_id: number, viewname: string, { columns, layout, fixed, view_when_done, formula_destinations, auto_save, destination_type, dest_url_formula, page_when_done, }: {
638
658
  columns: object[];
639
- view_to_create?: string | undefined;
640
- create_view_display: string;
641
- create_view_label?: string | undefined;
642
- default_state?: object | undefined;
643
- create_view_location?: string | undefined;
644
- }, stateWithId?: object | undefined, extraOpts: object, { listQuery }: {
645
- listQuery: any;
646
- }) => Promise<any>;
647
- view_quantity: string;
648
- get_state_fields: (table_id: string, viewname: any, { columns }: {
649
- columns: object[];
650
- }) => Function;
651
- initial_config: Function;
652
- on_delete: (table_id: any, viewname: string, { default_state }: {
653
- default_state: any;
654
- }) => Promise<void>;
655
- routes: {
656
- run_action: (table_id: number, viewname: any, { columns, layout }: {
657
- columns: object[];
658
- layout: any;
659
- }, body: object, { req, res }: {
660
- req: object;
661
- res: any;
662
- }, { getRowQuery }: {
663
- getRowQuery: any;
664
- }) => Promise<object>;
665
- };
666
- display_state_form: (opts: object) => boolean;
667
- default_state_form: ({ default_state }: object) => boolean;
668
- getStringsForI18n({ columns, create_view_label }: {
659
+ layout: Layout;
660
+ fixed: object;
661
+ view_when_done: boolean;
662
+ formula_destinations: object[];
663
+ }, state: object, body: any, { res, req, redirect }: {
664
+ res: object;
665
+ req: object;
666
+ redirect: string;
667
+ }, { tryInsertQuery, tryUpdateQuery, getRowQuery, saveFileQuery, optionsQuery, getRowByIdQuery, }: {
668
+ tryInsertQuery: any;
669
+ tryUpdateQuery: any;
670
+ getRowQuery: any;
671
+ saveFileQuery: any;
672
+ optionsQuery: any;
673
+ getRowByIdQuery: any;
674
+ }, remote: any) => Promise<void>;
675
+ get_state_fields: (table_id: any, viewname: any, { columns }: {
669
676
  columns: any;
670
- create_view_label: any;
677
+ }) => Promise<object[]>;
678
+ initial_config: Function;
679
+ display_state_form: boolean;
680
+ authorise_post: ({ body, table_id, req }: {
681
+ body: object;
682
+ table_id: string;
683
+ req: object;
684
+ }, { authorizePostQuery }: {
685
+ authorizePostQuery: any;
686
+ }) => Promise<boolean>;
687
+ authorise_get: ({ query, table_id, req }: {
688
+ query: object;
689
+ rest: any;
690
+ }, { authorizeGetQuery }: {
691
+ authorizeGetQuery: any;
692
+ }) => Promise<boolean>;
693
+ getStringsForI18n({ layout }: {
694
+ layout: Layout;
671
695
  }): string[];
672
- queries: ({ table_id, exttable_name, name, configuration: { columns, default_state }, req, }: {
696
+ queries: ({ table_id, name, configuration: { columns, default_state, layout, auto_save, split_paste, destination_type, }, req, res, }: {
673
697
  table_id: any;
674
- exttable_name: any;
675
698
  name: any;
676
699
  configuration: {
677
700
  columns: any;
678
701
  default_state: any;
702
+ layout: any;
703
+ auto_save: any;
704
+ split_paste: any;
705
+ destination_type: any;
679
706
  };
680
707
  req: any;
708
+ res: any;
681
709
  }) => {
682
- listQuery(state: any, stateHash: any): Promise<{
710
+ editQuery(state: any, mobileReferrer: any): Promise<import("../models/form")>;
711
+ editManyQuery(state: any, { limit, offset, orderBy, orderDesc, where }: {
712
+ limit: any;
713
+ offset: any;
714
+ orderBy: any;
715
+ orderDesc: any;
716
+ where: any;
717
+ }): Promise<{
718
+ table: import("../models/table") | null;
719
+ fields: import("../models/field")[];
683
720
  rows: import("@saltcorn/db-common/internal").Row[];
684
- rowCount: number;
685
721
  }>;
686
- getRowQuery(id: any): Promise<import("@saltcorn/db-common/internal").Row | null>;
722
+ tryInsertQuery(row: any): Promise<{
723
+ error: string;
724
+ } | {
725
+ success: any;
726
+ }>;
727
+ tryUpdateQuery(row: any, id: any): Promise<any>;
728
+ saveFileQuery(fieldVal: any, fieldId: any, fieldView: any, row: any): Promise<string | number>;
729
+ authorizePostQuery(body: any, table_id: any): Promise<boolean | "" | null | undefined>;
730
+ authorizeGetQuery(query: any, table_id: any): Promise<string | boolean | null | undefined>;
731
+ getRowQuery(table_id: any, view_select: any, row_id: any): Promise<import("@saltcorn/db-common/internal").Row[]>;
732
+ getRowByIdQuery(id: any): Promise<import("@saltcorn/db-common/internal").Row | null>;
733
+ actionQuery(): Promise<{
734
+ json: any;
735
+ }>;
736
+ optionsQuery(reftable_name: any, type: any, attributes: any, where: any): Promise<any>;
737
+ updateMatchingQuery(where: any, updateVals: any, repeatFields: any, childRows: any): Promise<any[] | {
738
+ rowError: any;
739
+ inEditError?: undefined;
740
+ error?: undefined;
741
+ } | {
742
+ inEditError: any;
743
+ rowError?: undefined;
744
+ error?: undefined;
745
+ } | {
746
+ error: any;
747
+ rowError?: undefined;
748
+ inEditError?: undefined;
749
+ }>;
687
750
  };
688
- configCheck: (view: any) => Promise<{
689
- errors: string[];
690
- warnings: string[];
691
- }>;
692
- connectedObjects: (configuration: any) => Promise<import("@saltcorn/types/base_types").ConnectedObjects>;
693
- } | {
694
- name: string;
695
- description: string;
696
- get_state_fields: () => object[];
697
- configuration_workflow: (req: object) => import("../models/workflow");
698
- run: (table_id: string, viewname: string, { columns, layout, page_title, page_title_formula }: {
699
- columns: object[];
700
- layout: object;
701
- page_title?: string | undefined;
702
- page_title_formula: boolean;
703
- }, state: object, extra: object, { showQuery }: {
704
- showQuery: any;
705
- }) => Promise<string>;
706
- runMany: (table_id: number, viewname: string, { columns, layout }: {
707
- columns: object[];
708
- layout: object;
709
- }, state: object, extra: object, { runManyQuery }: {
710
- runManyQuery: any;
711
- }) => Promise<object[]>;
712
- renderRows: (table: object, viewname: string, { columns, layout }: {
713
- columns: object[];
714
- layout: object;
715
- }, extra: object, rows: object[], state: any) => Promise<string>;
716
- initial_config: Function;
717
- display_state_form: boolean;
718
751
  routes: {
719
752
  run_action: (table_id: number, viewname: any, { columns, layout }: {
720
753
  columns: object[];
@@ -725,85 +758,33 @@ export const viewtemplates: ({
725
758
  }, { actionQuery }: {
726
759
  actionQuery: any;
727
760
  }) => Promise<object>;
728
- };
729
- getStringsForI18n({ layout }: {
730
- layout: object;
731
- }): string[];
732
- queries: ({ table_id, exttable_name, name, configuration: { columns, layout }, req, res, }: {
733
- table_id: any;
734
- exttable_name: any;
735
- name: any;
736
- configuration: {
761
+ update_matching_rows: (table_id: any, viewname: any, { columns, layout, fixed, view_when_done, formula_destinations, auto_save, destination_type, dest_url_formula, page_when_done, }: {
737
762
  columns: any;
738
763
  layout: any;
739
- };
740
- req: any;
741
- res: any;
742
- }) => {
743
- showQuery(state: any, fields: any): Promise<{
744
- rows: null;
745
- message: string;
746
- } | {
747
- rows: import("@saltcorn/db-common/internal").Row[];
748
- message: null;
749
- }>;
750
- runManyQuery(state: any, { where, limit, offset, joinFieldsExtra, orderBy, orderDesc }: {
751
- where: any;
752
- limit: any;
753
- offset: any;
754
- joinFieldsExtra: any;
755
- orderBy: any;
756
- orderDesc: any;
757
- }): Promise<import("@saltcorn/db-common/internal").Row[]>;
758
- actionQuery(): Promise<{
759
- json: any;
760
- }>;
764
+ fixed: any;
765
+ view_when_done: any;
766
+ formula_destinations: any;
767
+ auto_save: any;
768
+ destination_type: any;
769
+ dest_url_formula: any;
770
+ page_when_done: any;
771
+ }, body: any, { req, res, redirect }: {
772
+ req: any;
773
+ res: any;
774
+ redirect: any;
775
+ }, { updateMatchingQuery, getRowQuery, saveFileQuery, optionsQuery, getRowByIdQuery, }: {
776
+ updateMatchingQuery: any;
777
+ getRowQuery: any;
778
+ saveFileQuery: any;
779
+ optionsQuery: any;
780
+ getRowByIdQuery: any;
781
+ }) => Promise<void>;
761
782
  };
762
783
  configCheck: (view: any) => Promise<{
763
784
  errors: string[];
764
785
  warnings: string[];
765
786
  }>;
766
787
  connectedObjects: (configuration: any) => Promise<import("@saltcorn/types/base_types").ConnectedObjects>;
767
- } | {
768
- name: string;
769
- description: string;
770
- configuration_workflow: (req: object) => import("../models/workflow");
771
- 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 }: {
772
- show_view: string;
773
- order_field: name;
774
- descending: boolean;
775
- view_to_create?: string | undefined;
776
- create_view_display: string;
777
- in_card: boolean;
778
- masonry_columns: string;
779
- rows_per_page?: number | undefined;
780
- hide_pagination: boolean;
781
- create_view_label?: string | undefined;
782
- create_view_location?: string | undefined;
783
- always_create_view: boolean;
784
- cols: any;
785
- }, state: object, extraArgs: any, { countRowsQuery }: {
786
- countRowsQuery: any;
787
- }) => Promise<div>;
788
- get_state_fields: (table_id: number, viewname: any, { show_view }: {
789
- show_view: any;
790
- }) => Promise<import("../models/field")>;
791
- display_state_form: boolean;
792
- getStringsForI18n({ create_view_label }: {
793
- create_view_label: any;
794
- }): string[] | Object[];
795
- queries: ({ table_id, viewname, configuration: { columns, default_state }, req, }: {
796
- table_id: any;
797
- viewname: any;
798
- configuration: {
799
- columns: any;
800
- default_state: any;
801
- };
802
- req: any;
803
- }) => {
804
- countRowsQuery(state: any): Promise<number>;
805
- };
806
- connectedObjects: (configuration: any) => Promise<import("@saltcorn/types/base_types").ConnectedObjects>;
807
788
  } | {
808
789
  name: string;
809
790
  description: string;
@@ -908,145 +889,170 @@ export const viewtemplates: ({
908
889
  name: string;
909
890
  description: string;
910
891
  configuration_workflow: (req: object) => import("../models/workflow");
911
- run: (table_id: number, viewname: string, cfg: any, state: string, { res, req }: {
912
- req: object;
913
- res: object;
914
- }, { editQuery }: {
915
- editQuery: any;
916
- }) => Promise<import("../models/form")>;
917
- runMany: (table_id: number, viewname: string, { columns, layout, auto_save, split_paste }: {
918
- columns: any;
919
- layout: any;
920
- }, state: State, extra: object, { editManyQuery, getRowQuery, optionsQuery }: {
921
- editManyQuery: any;
922
- getRowQuery: any;
923
- optionsQuery: any;
924
- }) => Promise<import("../models/form")[]>;
925
- runPost: (table_id: number, viewname: string, { columns, layout, fixed, view_when_done, formula_destinations, auto_save, destination_type, dest_url_formula, page_when_done, }: {
926
- columns: object[];
927
- layout: Layout;
928
- fixed: object;
929
- view_when_done: boolean;
930
- formula_destinations: object[];
931
- }, state: object, body: any, { res, req, redirect }: {
932
- res: object;
933
- req: object;
934
- redirect: string;
935
- }, { tryInsertQuery, tryUpdateQuery, getRowQuery, saveFileQuery, optionsQuery, getRowByIdQuery, }: {
936
- tryInsertQuery: any;
937
- tryUpdateQuery: any;
938
- getRowQuery: any;
939
- saveFileQuery: any;
940
- optionsQuery: any;
941
- getRowByIdQuery: any;
942
- }, remote: any) => Promise<void>;
943
- get_state_fields: (table_id: any, viewname: any, { columns }: {
944
- columns: any;
892
+ 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 }: {
893
+ show_view: string;
894
+ order_field: name;
895
+ descending: boolean;
896
+ view_to_create?: string | undefined;
897
+ create_view_display: string;
898
+ in_card: boolean;
899
+ masonry_columns: string;
900
+ rows_per_page?: number | undefined;
901
+ hide_pagination: boolean;
902
+ create_view_label?: string | undefined;
903
+ create_view_location?: string | undefined;
904
+ always_create_view: boolean;
905
+ cols: any;
906
+ }, state: object, extraArgs: any, { countRowsQuery }: {
907
+ countRowsQuery: any;
908
+ }) => Promise<div>;
909
+ get_state_fields: (table_id: number, viewname: any, { show_view }: {
910
+ show_view: any;
911
+ }) => Promise<import("../models/field")>;
912
+ display_state_form: boolean;
913
+ getStringsForI18n({ create_view_label }: {
914
+ create_view_label: any;
915
+ }): string[] | Object[];
916
+ queries: ({ table_id, viewname, configuration: { columns, default_state }, req, }: {
917
+ table_id: any;
918
+ viewname: any;
919
+ configuration: {
920
+ columns: any;
921
+ default_state: any;
922
+ };
923
+ req: any;
924
+ }) => {
925
+ countRowsQuery(state: any): Promise<number>;
926
+ };
927
+ connectedObjects: (configuration: any) => Promise<import("@saltcorn/types/base_types").ConnectedObjects>;
928
+ } | {
929
+ name: string;
930
+ description: string;
931
+ get_state_fields: () => object[];
932
+ configuration_workflow: (req: object) => import("../models/workflow");
933
+ run: (table_id: string, viewname: string, { columns, layout, page_title, page_title_formula }: {
934
+ columns: object[];
935
+ layout: object;
936
+ page_title?: string | undefined;
937
+ page_title_formula: boolean;
938
+ }, state: object, extra: object, { showQuery }: {
939
+ showQuery: any;
940
+ }) => Promise<string>;
941
+ runMany: (table_id: number, viewname: string, { columns, layout }: {
942
+ columns: object[];
943
+ layout: object;
944
+ }, state: object, extra: object, { runManyQuery }: {
945
+ runManyQuery: any;
945
946
  }) => Promise<object[]>;
947
+ renderRows: (table: object, viewname: string, { columns, layout }: {
948
+ columns: object[];
949
+ layout: object;
950
+ }, extra: object, rows: object[], state: any) => Promise<string>;
946
951
  initial_config: Function;
947
952
  display_state_form: boolean;
948
- authorise_post: ({ body, table_id, req }: {
949
- body: object;
950
- table_id: string;
951
- req: object;
952
- }, { authorizePostQuery }: {
953
- authorizePostQuery: any;
954
- }) => Promise<boolean>;
955
- authorise_get: ({ query, table_id, req }: {
956
- query: object;
957
- rest: any;
958
- }, { authorizeGetQuery }: {
959
- authorizeGetQuery: any;
960
- }) => Promise<boolean>;
953
+ routes: {
954
+ run_action: (table_id: number, viewname: any, { columns, layout }: {
955
+ columns: object[];
956
+ layout: any;
957
+ }, body: any, { req, res }: {
958
+ req: object;
959
+ res: any;
960
+ }, { actionQuery }: {
961
+ actionQuery: any;
962
+ }) => Promise<object>;
963
+ };
961
964
  getStringsForI18n({ layout }: {
962
- layout: Layout;
965
+ layout: object;
963
966
  }): string[];
964
- queries: ({ table_id, name, configuration: { columns, default_state, layout, auto_save, split_paste, destination_type, }, req, res, }: {
967
+ queries: ({ table_id, exttable_name, name, configuration: { columns, layout }, req, res, }: {
965
968
  table_id: any;
969
+ exttable_name: any;
966
970
  name: any;
967
971
  configuration: {
968
972
  columns: any;
969
- default_state: any;
970
973
  layout: any;
971
- auto_save: any;
972
- split_paste: any;
973
- destination_type: any;
974
974
  };
975
975
  req: any;
976
976
  res: any;
977
977
  }) => {
978
- editQuery(state: any, mobileReferrer: any): Promise<import("../models/form")>;
979
- editManyQuery(state: any, { limit, offset, orderBy, orderDesc, where }: {
978
+ showQuery(state: any, fields: any): Promise<{
979
+ rows: null;
980
+ message: string;
981
+ } | {
982
+ rows: import("@saltcorn/db-common/internal").Row[];
983
+ message: null;
984
+ }>;
985
+ runManyQuery(state: any, { where, limit, offset, joinFieldsExtra, orderBy, orderDesc }: {
986
+ where: any;
980
987
  limit: any;
981
988
  offset: any;
989
+ joinFieldsExtra: any;
982
990
  orderBy: any;
983
991
  orderDesc: any;
984
- where: any;
985
- }): Promise<{
986
- table: import("../models/table") | null;
987
- fields: import("../models/field")[];
988
- rows: import("@saltcorn/db-common/internal").Row[];
989
- }>;
990
- tryInsertQuery(row: any): Promise<{
991
- error: string;
992
- } | {
993
- success: any;
994
- }>;
995
- tryUpdateQuery(row: any, id: any): Promise<any>;
996
- saveFileQuery(fieldVal: any, fieldId: any, fieldView: any, row: any): Promise<string | number>;
997
- authorizePostQuery(body: any, table_id: any): Promise<boolean | "" | null | undefined>;
998
- authorizeGetQuery(query: any, table_id: any): Promise<string | boolean | null | undefined>;
999
- getRowQuery(table_id: any, view_select: any, row_id: any): Promise<import("@saltcorn/db-common/internal").Row[]>;
1000
- getRowByIdQuery(id: any): Promise<import("@saltcorn/db-common/internal").Row | null>;
992
+ }): Promise<import("@saltcorn/db-common/internal").Row[]>;
1001
993
  actionQuery(): Promise<{
1002
994
  json: any;
1003
995
  }>;
1004
- optionsQuery(reftable_name: any, type: any, attributes: any, where: any): Promise<any>;
1005
- updateMatchingQuery(where: any, updateVals: any, repeatFields: any, childRows: any): Promise<any[] | {
1006
- rowError: any;
1007
- inEditError?: undefined;
1008
- error?: undefined;
1009
- } | {
1010
- inEditError: any;
1011
- rowError?: undefined;
1012
- error?: undefined;
1013
- } | {
1014
- error: any;
1015
- rowError?: undefined;
1016
- inEditError?: undefined;
1017
- }>;
1018
996
  };
997
+ configCheck: (view: any) => Promise<{
998
+ errors: string[];
999
+ warnings: string[];
1000
+ }>;
1001
+ connectedObjects: (configuration: any) => Promise<import("@saltcorn/types/base_types").ConnectedObjects>;
1002
+ } | {
1003
+ name: string;
1004
+ description: string;
1005
+ configuration_workflow: (req: object) => import("../models/workflow");
1006
+ 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, }: {
1007
+ columns: object[];
1008
+ view_to_create?: string | undefined;
1009
+ create_view_display: string;
1010
+ create_view_label?: string | undefined;
1011
+ default_state?: object | undefined;
1012
+ create_view_location?: string | undefined;
1013
+ }, stateWithId?: object | undefined, extraOpts: object, { listQuery }: {
1014
+ listQuery: any;
1015
+ }) => Promise<any>;
1016
+ view_quantity: string;
1017
+ get_state_fields: (table_id: string, viewname: any, { columns }: {
1018
+ columns: object[];
1019
+ }) => Function;
1020
+ initial_config: Function;
1021
+ on_delete: (table_id: any, viewname: string, { default_state }: {
1022
+ default_state: any;
1023
+ }) => Promise<void>;
1019
1024
  routes: {
1020
1025
  run_action: (table_id: number, viewname: any, { columns, layout }: {
1021
1026
  columns: object[];
1022
1027
  layout: any;
1023
- }, body: any, { req, res }: {
1028
+ }, body: object, { req, res }: {
1024
1029
  req: object;
1025
1030
  res: any;
1026
- }, { actionQuery }: {
1027
- actionQuery: any;
1031
+ }, { getRowQuery }: {
1032
+ getRowQuery: any;
1028
1033
  }) => Promise<object>;
1029
- update_matching_rows: (table_id: any, viewname: any, { columns, layout, fixed, view_when_done, formula_destinations, auto_save, destination_type, dest_url_formula, page_when_done, }: {
1034
+ };
1035
+ display_state_form: (opts: object) => boolean;
1036
+ default_state_form: ({ default_state }: object) => boolean;
1037
+ getStringsForI18n({ columns, create_view_label }: {
1038
+ columns: any;
1039
+ create_view_label: any;
1040
+ }): string[];
1041
+ queries: ({ table_id, exttable_name, name, configuration: { columns, default_state }, req, }: {
1042
+ table_id: any;
1043
+ exttable_name: any;
1044
+ name: any;
1045
+ configuration: {
1030
1046
  columns: any;
1031
- layout: any;
1032
- fixed: any;
1033
- view_when_done: any;
1034
- formula_destinations: any;
1035
- auto_save: any;
1036
- destination_type: any;
1037
- dest_url_formula: any;
1038
- page_when_done: any;
1039
- }, body: any, { req, res, redirect }: {
1040
- req: any;
1041
- res: any;
1042
- redirect: any;
1043
- }, { updateMatchingQuery, getRowQuery, saveFileQuery, optionsQuery, getRowByIdQuery, }: {
1044
- updateMatchingQuery: any;
1045
- getRowQuery: any;
1046
- saveFileQuery: any;
1047
- optionsQuery: any;
1048
- getRowByIdQuery: any;
1049
- }) => Promise<void>;
1047
+ default_state: any;
1048
+ };
1049
+ req: any;
1050
+ }) => {
1051
+ listQuery(state: any, stateHash: any): Promise<{
1052
+ rows: import("@saltcorn/db-common/internal").Row[];
1053
+ rowCount: number;
1054
+ }>;
1055
+ getRowQuery(id: any): Promise<import("@saltcorn/db-common/internal").Row | null>;
1050
1056
  };
1051
1057
  configCheck: (view: any) => Promise<{
1052
1058
  errors: string[];
@@ -1056,45 +1062,39 @@ export const viewtemplates: ({
1056
1062
  } | {
1057
1063
  name: string;
1058
1064
  description: string;
1059
- get_state_fields: () => object[];
1060
- configuration_workflow: () => import("../models/workflow");
1061
- run: (table_id: number, viewname: string, { columns, layout }: {
1062
- columns: object[];
1063
- layout: object;
1064
- }, state: object, extra: object, { distinctValuesQuery }: {
1065
- distinctValuesQuery: any;
1066
- }) => Promise<Layout>;
1067
- initial_config: () => Promise<object>;
1068
- display_state_form: boolean;
1069
- getStringsForI18n({ layout }: {
1070
- layout: any;
1071
- }): string[];
1072
- routes: {
1073
- run_action: (table_id: any, viewname: any, config: any, body: any, { req, res }: {
1074
- req: any;
1075
- res: any;
1076
- }, { actionQuery }: {
1077
- actionQuery: any;
1078
- }) => Promise<any>;
1079
- };
1080
- queries: ({ table_id, viewname, configuration: { columns }, req, res, exttable_name, }: {
1065
+ configuration_workflow: (req: object) => import("../models/workflow");
1066
+ run: (table_id: string, viewname: string, { list_view, show_view, list_width, subtables }: {
1067
+ list_view: string;
1068
+ show_view: string;
1069
+ subtables: object;
1070
+ }, state: any, extraArgs: any, { getRowQuery }: {
1071
+ getRowQuery: any;
1072
+ }) => Promise<div>;
1073
+ get_state_fields: (table_id: any, viewname: any, { list_view, show_view }: {
1074
+ list_view: string;
1075
+ show_view: any;
1076
+ }) => Promise<object[]>;
1077
+ display_state_form: ({ list_view, _omit_state_form }: {
1078
+ list_view: string;
1079
+ _omit_state_form: boolean;
1080
+ }) => boolean;
1081
+ queries: ({ table_id, viewname, configuration: { columns, default_state }, req, }: {
1081
1082
  table_id: any;
1082
1083
  viewname: any;
1083
1084
  configuration: {
1084
1085
  columns: any;
1086
+ default_state: any;
1085
1087
  };
1086
1088
  req: any;
1087
- res: any;
1088
- exttable_name: any;
1089
1089
  }) => {
1090
- actionQuery(state: any, rndid: any): Promise<{
1091
- json: any;
1092
- }>;
1093
- distinctValuesQuery(state: any): Promise<{
1094
- distinct_values: {};
1095
- role: any;
1096
- }>;
1090
+ getRowQuery(uniques: any): Promise<import("@saltcorn/db-common/internal").Row | null>;
1097
1091
  };
1092
+ connectedObjects: ({ list_view, subtables }: {
1093
+ list_view: any;
1094
+ subtables: any;
1095
+ }) => Promise<{
1096
+ embeddedViews: import("../models/view")[];
1097
+ }>;
1098
1098
  })[];
1099
1099
  import fileviews = require("./fileviews");
1100
1100
  import actions = require("./actions");