@saltcorn/data 1.0.0-beta.1 → 1.0.0-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base-plugin/actions.d.ts +134 -79
- package/dist/base-plugin/actions.d.ts.map +1 -1
- package/dist/base-plugin/actions.js +47 -0
- package/dist/base-plugin/actions.js.map +1 -1
- package/dist/base-plugin/fileviews.d.ts +23 -2
- package/dist/base-plugin/fileviews.js +40 -7
- package/dist/base-plugin/fileviews.js.map +1 -1
- package/dist/base-plugin/index.d.ts +143 -117
- package/dist/base-plugin/index.d.ts.map +1 -1
- package/dist/base-plugin/types.d.ts +13 -0
- package/dist/base-plugin/types.d.ts.map +1 -1
- package/dist/base-plugin/types.js +19 -1
- package/dist/base-plugin/types.js.map +1 -1
- package/dist/base-plugin/viewtemplates/list.d.ts.map +1 -1
- package/dist/base-plugin/viewtemplates/list.js +8 -3
- package/dist/base-plugin/viewtemplates/list.js.map +1 -1
- package/dist/db/state.d.ts +1 -0
- package/dist/db/state.d.ts.map +1 -1
- package/dist/db/state.js +6 -0
- package/dist/db/state.js.map +1 -1
- package/dist/models/config.d.ts.map +1 -1
- package/dist/models/config.js +24 -0
- package/dist/models/config.js.map +1 -1
- package/dist/models/expression.d.ts.map +1 -1
- package/dist/models/expression.js +2 -0
- package/dist/models/expression.js.map +1 -1
- package/dist/models/fieldrepeat.d.ts.map +1 -1
- package/dist/models/fieldrepeat.js +6 -1
- package/dist/models/fieldrepeat.js.map +1 -1
- package/dist/models/index.d.ts +5 -1
- package/dist/models/index.d.ts.map +1 -1
- package/dist/models/plugin.d.ts +2 -1
- package/dist/models/plugin.d.ts.map +1 -1
- package/dist/models/plugin.js +7 -2
- package/dist/models/plugin.js.map +1 -1
- package/dist/models/scheduler.d.ts +7 -11
- package/dist/models/scheduler.d.ts.map +1 -1
- package/dist/models/scheduler.js +26 -1
- package/dist/models/scheduler.js.map +1 -1
- package/dist/models/table.d.ts +3 -1
- package/dist/models/table.d.ts.map +1 -1
- package/dist/models/table.js +39 -4
- package/dist/models/table.js.map +1 -1
- package/dist/models/user.d.ts +1 -1
- package/dist/models/user.d.ts.map +1 -1
- package/dist/models/user.js +16 -5
- package/dist/models/user.js.map +1 -1
- package/dist/plugin-helper.d.ts +0 -1
- package/dist/tests/actions.test.js +97 -2
- package/dist/tests/actions.test.js.map +1 -1
- package/dist/tests/auxtest.test.js +12 -1
- package/dist/tests/auxtest.test.js.map +1 -1
- package/dist/tests/mocks.d.ts +13 -0
- package/dist/tests/mocks.d.ts.map +1 -1
- package/dist/tests/mocks.js +8 -0
- package/dist/tests/mocks.js.map +1 -1
- package/dist/utils.d.ts +2 -2
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +8 -3
- package/dist/utils.js.map +1 -1
- package/package.json +11 -13
|
@@ -443,10 +443,65 @@ export namespace modify_row {
|
|
|
443
443
|
}): Promise<any>;
|
|
444
444
|
export { run_8 as run };
|
|
445
445
|
}
|
|
446
|
-
export namespace
|
|
446
|
+
export namespace delete_rows {
|
|
447
447
|
const description_10: string;
|
|
448
448
|
export { description_10 as description };
|
|
449
|
-
|
|
449
|
+
export function configFields_10({ mode, when_trigger }: {
|
|
450
|
+
mode: any;
|
|
451
|
+
when_trigger: any;
|
|
452
|
+
}): Promise<({
|
|
453
|
+
name: string;
|
|
454
|
+
label: string;
|
|
455
|
+
type: string;
|
|
456
|
+
sublabel?: undefined;
|
|
457
|
+
input_type?: undefined;
|
|
458
|
+
showIf?: undefined;
|
|
459
|
+
options?: undefined;
|
|
460
|
+
required?: undefined;
|
|
461
|
+
class?: undefined;
|
|
462
|
+
} | {
|
|
463
|
+
name: string;
|
|
464
|
+
label: string;
|
|
465
|
+
sublabel: string;
|
|
466
|
+
input_type: string;
|
|
467
|
+
showIf: {
|
|
468
|
+
delete_triggering_row: boolean;
|
|
469
|
+
};
|
|
470
|
+
options: string[];
|
|
471
|
+
type?: undefined;
|
|
472
|
+
required?: undefined;
|
|
473
|
+
class?: undefined;
|
|
474
|
+
} | {
|
|
475
|
+
name: string;
|
|
476
|
+
label: string;
|
|
477
|
+
type: string;
|
|
478
|
+
sublabel: string;
|
|
479
|
+
required: boolean;
|
|
480
|
+
class: string;
|
|
481
|
+
showIf: {
|
|
482
|
+
delete_triggering_row: boolean;
|
|
483
|
+
};
|
|
484
|
+
input_type?: undefined;
|
|
485
|
+
options?: undefined;
|
|
486
|
+
})[]>;
|
|
487
|
+
export { configFields_10 as configFields };
|
|
488
|
+
export function run_9({ row, table, configuration: { delete_triggering_row, delete_where, table_name }, user, ...rest }: {
|
|
489
|
+
[x: string]: any;
|
|
490
|
+
row: any;
|
|
491
|
+
table: any;
|
|
492
|
+
configuration: {
|
|
493
|
+
delete_triggering_row: any;
|
|
494
|
+
delete_where: any;
|
|
495
|
+
table_name: any;
|
|
496
|
+
};
|
|
497
|
+
user: any;
|
|
498
|
+
}): Promise<void>;
|
|
499
|
+
export { run_9 as run };
|
|
500
|
+
}
|
|
501
|
+
export namespace navigate {
|
|
502
|
+
const description_11: string;
|
|
503
|
+
export { description_11 as description };
|
|
504
|
+
const configFields_11: ({
|
|
450
505
|
name: string;
|
|
451
506
|
label: string;
|
|
452
507
|
type: string;
|
|
@@ -465,8 +520,8 @@ export namespace navigate {
|
|
|
465
520
|
};
|
|
466
521
|
attributes?: undefined;
|
|
467
522
|
})[];
|
|
468
|
-
export {
|
|
469
|
-
export function
|
|
523
|
+
export { configFields_11 as configFields };
|
|
524
|
+
export function run_10({ row, user, configuration: { nav_action, url }, req }: {
|
|
470
525
|
row: any;
|
|
471
526
|
user: any;
|
|
472
527
|
configuration: {
|
|
@@ -495,12 +550,12 @@ export namespace navigate {
|
|
|
495
550
|
popup?: undefined;
|
|
496
551
|
eval_js?: undefined;
|
|
497
552
|
} | undefined>;
|
|
498
|
-
export {
|
|
553
|
+
export { run_10 as run };
|
|
499
554
|
}
|
|
500
555
|
export namespace step_control_flow {
|
|
501
|
-
const
|
|
502
|
-
export {
|
|
503
|
-
const
|
|
556
|
+
const description_12: string;
|
|
557
|
+
export { description_12 as description };
|
|
558
|
+
const configFields_12: ({
|
|
504
559
|
name: string;
|
|
505
560
|
label: string;
|
|
506
561
|
type: string;
|
|
@@ -519,8 +574,8 @@ export namespace step_control_flow {
|
|
|
519
574
|
};
|
|
520
575
|
attributes?: undefined;
|
|
521
576
|
})[];
|
|
522
|
-
export {
|
|
523
|
-
export function
|
|
577
|
+
export { configFields_12 as configFields };
|
|
578
|
+
export function run_11({ row, user, configuration: { control_action, step } }: {
|
|
524
579
|
row: any;
|
|
525
580
|
user: any;
|
|
526
581
|
configuration: {
|
|
@@ -540,14 +595,14 @@ export namespace step_control_flow {
|
|
|
540
595
|
halt_steps?: undefined;
|
|
541
596
|
goto_step?: undefined;
|
|
542
597
|
} | undefined>;
|
|
543
|
-
export {
|
|
598
|
+
export { run_11 as run };
|
|
544
599
|
}
|
|
545
600
|
export namespace form_action {
|
|
546
|
-
const
|
|
547
|
-
export {
|
|
601
|
+
const description_13: string;
|
|
602
|
+
export { description_13 as description };
|
|
548
603
|
const requireRow_4: boolean;
|
|
549
604
|
export { requireRow_4 as requireRow };
|
|
550
|
-
const
|
|
605
|
+
const configFields_13: {
|
|
551
606
|
name: string;
|
|
552
607
|
label: string;
|
|
553
608
|
type: string;
|
|
@@ -556,8 +611,8 @@ export namespace form_action {
|
|
|
556
611
|
options: string[];
|
|
557
612
|
};
|
|
558
613
|
}[];
|
|
559
|
-
export {
|
|
560
|
-
export function
|
|
614
|
+
export { configFields_13 as configFields };
|
|
615
|
+
export function run_12({ row, table, configuration: { form_action } }: {
|
|
561
616
|
row: any;
|
|
562
617
|
table: any;
|
|
563
618
|
configuration: {
|
|
@@ -572,12 +627,12 @@ export namespace form_action {
|
|
|
572
627
|
};
|
|
573
628
|
eval_js?: undefined;
|
|
574
629
|
}>;
|
|
575
|
-
export {
|
|
630
|
+
export { run_12 as run };
|
|
576
631
|
}
|
|
577
632
|
export namespace toast {
|
|
578
|
-
const
|
|
579
|
-
export {
|
|
580
|
-
const
|
|
633
|
+
const description_14: string;
|
|
634
|
+
export { description_14 as description };
|
|
635
|
+
const configFields_14: ({
|
|
581
636
|
name: string;
|
|
582
637
|
label: string;
|
|
583
638
|
type: string;
|
|
@@ -592,8 +647,8 @@ export namespace toast {
|
|
|
592
647
|
required: boolean;
|
|
593
648
|
attributes?: undefined;
|
|
594
649
|
})[];
|
|
595
|
-
export {
|
|
596
|
-
export function
|
|
650
|
+
export { configFields_14 as configFields };
|
|
651
|
+
export function run_13({ row, user, configuration: { type, notify_type, text } }: {
|
|
597
652
|
row: any;
|
|
598
653
|
user: any;
|
|
599
654
|
configuration: {
|
|
@@ -614,15 +669,15 @@ export namespace toast {
|
|
|
614
669
|
error?: undefined;
|
|
615
670
|
notify_success?: undefined;
|
|
616
671
|
}>;
|
|
617
|
-
export {
|
|
672
|
+
export { run_13 as run };
|
|
618
673
|
}
|
|
619
674
|
export namespace run_js_code {
|
|
620
|
-
const
|
|
621
|
-
export {
|
|
675
|
+
const description_15: string;
|
|
676
|
+
export { description_15 as description };
|
|
622
677
|
export namespace configFormOptions {
|
|
623
678
|
const formStyle: string;
|
|
624
679
|
}
|
|
625
|
-
export function
|
|
680
|
+
export function configFields_15({ table }: {
|
|
626
681
|
table: any;
|
|
627
682
|
}): Promise<({
|
|
628
683
|
name: string;
|
|
@@ -662,13 +717,13 @@ export namespace run_js_code {
|
|
|
662
717
|
help?: undefined;
|
|
663
718
|
showIf?: undefined;
|
|
664
719
|
})[]>;
|
|
665
|
-
export {
|
|
720
|
+
export { configFields_15 as configFields };
|
|
666
721
|
export { run_code as run };
|
|
667
722
|
}
|
|
668
723
|
export namespace run_js_code_in_field {
|
|
669
|
-
const
|
|
670
|
-
export {
|
|
671
|
-
export function
|
|
724
|
+
const description_16: string;
|
|
725
|
+
export { description_16 as description };
|
|
726
|
+
export function configFields_16({ table }: {
|
|
672
727
|
table: any;
|
|
673
728
|
}): Promise<({
|
|
674
729
|
name: string;
|
|
@@ -691,20 +746,20 @@ export namespace run_js_code_in_field {
|
|
|
691
746
|
required?: undefined;
|
|
692
747
|
attributes?: undefined;
|
|
693
748
|
})[]>;
|
|
694
|
-
export {
|
|
749
|
+
export { configFields_16 as configFields };
|
|
695
750
|
const requireRow_5: boolean;
|
|
696
751
|
export { requireRow_5 as requireRow };
|
|
697
|
-
const
|
|
698
|
-
export {
|
|
752
|
+
const run_14: base;
|
|
753
|
+
export { run_14 as run };
|
|
699
754
|
}
|
|
700
755
|
export namespace duplicate_row_prefill_edit {
|
|
701
|
-
export function
|
|
756
|
+
export function configFields_17({ table }: {
|
|
702
757
|
table: any;
|
|
703
758
|
}): Promise<any[]>;
|
|
704
|
-
export {
|
|
759
|
+
export { configFields_17 as configFields };
|
|
705
760
|
const requireRow_6: boolean;
|
|
706
761
|
export { requireRow_6 as requireRow };
|
|
707
|
-
export function
|
|
762
|
+
export function run_15({ row, table, configuration: { viewname, ...flds }, user }: {
|
|
708
763
|
row: any;
|
|
709
764
|
table: any;
|
|
710
765
|
configuration: {
|
|
@@ -715,12 +770,12 @@ export namespace duplicate_row_prefill_edit {
|
|
|
715
770
|
}): Promise<{
|
|
716
771
|
goto: string;
|
|
717
772
|
}>;
|
|
718
|
-
export {
|
|
773
|
+
export { run_15 as run };
|
|
719
774
|
}
|
|
720
775
|
export namespace set_user_language {
|
|
721
|
-
const
|
|
722
|
-
export {
|
|
723
|
-
export function
|
|
776
|
+
const description_17: string;
|
|
777
|
+
export { description_17 as description };
|
|
778
|
+
export function configFields_18({ table }: {
|
|
724
779
|
table: any;
|
|
725
780
|
}): Promise<{
|
|
726
781
|
name: string;
|
|
@@ -733,8 +788,8 @@ export namespace set_user_language {
|
|
|
733
788
|
}[];
|
|
734
789
|
};
|
|
735
790
|
}[]>;
|
|
736
|
-
export {
|
|
737
|
-
export function
|
|
791
|
+
export { configFields_18 as configFields };
|
|
792
|
+
export function run_16({ configuration: { language }, user, req, res }: {
|
|
738
793
|
configuration: {
|
|
739
794
|
language: any;
|
|
740
795
|
};
|
|
@@ -744,12 +799,12 @@ export namespace set_user_language {
|
|
|
744
799
|
}): Promise<{
|
|
745
800
|
reload_page: boolean;
|
|
746
801
|
}>;
|
|
747
|
-
export {
|
|
802
|
+
export { run_16 as run };
|
|
748
803
|
}
|
|
749
804
|
export namespace sync_table_from_external {
|
|
750
|
-
const
|
|
751
|
-
export {
|
|
752
|
-
export function
|
|
805
|
+
const description_18: string;
|
|
806
|
+
export { description_18 as description };
|
|
807
|
+
export function configFields_19({ table }: {
|
|
753
808
|
table: any;
|
|
754
809
|
}): Promise<({
|
|
755
810
|
name: string;
|
|
@@ -804,19 +859,19 @@ export namespace sync_table_from_external {
|
|
|
804
859
|
attributes?: undefined;
|
|
805
860
|
default?: undefined;
|
|
806
861
|
})[]>;
|
|
807
|
-
export {
|
|
808
|
-
export function
|
|
862
|
+
export { configFields_19 as configFields };
|
|
863
|
+
export function run_17({ configuration: { row_expr, table_src, table_dest, pk_field, delete_rows, match_field_names, }, user, ...rest }: {
|
|
809
864
|
row: object;
|
|
810
865
|
configuration: object;
|
|
811
866
|
user: object;
|
|
812
867
|
rest: any;
|
|
813
868
|
}): Promise<boolean | object>;
|
|
814
|
-
export {
|
|
869
|
+
export { run_17 as run };
|
|
815
870
|
}
|
|
816
871
|
export namespace reload_embedded_view {
|
|
817
|
-
const
|
|
818
|
-
export {
|
|
819
|
-
export function
|
|
872
|
+
const description_19: string;
|
|
873
|
+
export { description_19 as description };
|
|
874
|
+
export function configFields_20(): Promise<({
|
|
820
875
|
name: string;
|
|
821
876
|
label: string;
|
|
822
877
|
class: string;
|
|
@@ -843,8 +898,8 @@ export namespace reload_embedded_view {
|
|
|
843
898
|
required?: undefined;
|
|
844
899
|
attributes?: undefined;
|
|
845
900
|
})[]>;
|
|
846
|
-
export {
|
|
847
|
-
export function
|
|
901
|
+
export { configFields_20 as configFields };
|
|
902
|
+
export function run_18({ row, user, configuration: { view, new_state_fml, interval }, }: {
|
|
848
903
|
row: any;
|
|
849
904
|
user: any;
|
|
850
905
|
configuration: {
|
|
@@ -855,31 +910,31 @@ export namespace reload_embedded_view {
|
|
|
855
910
|
}): Promise<{
|
|
856
911
|
eval_js: string;
|
|
857
912
|
}>;
|
|
858
|
-
export {
|
|
913
|
+
export { run_18 as run };
|
|
859
914
|
}
|
|
860
915
|
export namespace sleep {
|
|
861
|
-
const
|
|
862
|
-
export {
|
|
863
|
-
const
|
|
916
|
+
const description_20: string;
|
|
917
|
+
export { description_20 as description };
|
|
918
|
+
const configFields_21: {
|
|
864
919
|
name: string;
|
|
865
920
|
label: string;
|
|
866
921
|
type: string;
|
|
867
922
|
required: boolean;
|
|
868
923
|
}[];
|
|
869
|
-
export {
|
|
870
|
-
export function
|
|
924
|
+
export { configFields_21 as configFields };
|
|
925
|
+
export function run_19({ configuration: { seconds } }: {
|
|
871
926
|
configuration: {
|
|
872
927
|
seconds: any;
|
|
873
928
|
};
|
|
874
929
|
}): Promise<{
|
|
875
930
|
eval_js: string;
|
|
876
931
|
}>;
|
|
877
|
-
export {
|
|
932
|
+
export { run_19 as run };
|
|
878
933
|
}
|
|
879
934
|
export namespace notify_user {
|
|
880
|
-
const
|
|
881
|
-
export {
|
|
882
|
-
export function
|
|
935
|
+
const description_21: string;
|
|
936
|
+
export { description_21 as description };
|
|
937
|
+
export function configFields_22(): ({
|
|
883
938
|
name: string;
|
|
884
939
|
label: string;
|
|
885
940
|
type: string;
|
|
@@ -890,18 +945,18 @@ export namespace notify_user {
|
|
|
890
945
|
required: boolean;
|
|
891
946
|
type: string;
|
|
892
947
|
})[];
|
|
893
|
-
export {
|
|
894
|
-
export function
|
|
948
|
+
export { configFields_22 as configFields };
|
|
949
|
+
export function run_20({ row, user, configuration: { title, body, link, user_spec }, }: {
|
|
895
950
|
row: object;
|
|
896
951
|
configuration: object;
|
|
897
952
|
user: object;
|
|
898
953
|
}): Promise<void>;
|
|
899
|
-
export {
|
|
954
|
+
export { run_20 as run };
|
|
900
955
|
}
|
|
901
956
|
export namespace convert_session_to_user {
|
|
902
|
-
const
|
|
903
|
-
export {
|
|
904
|
-
export function
|
|
957
|
+
const description_22: string;
|
|
958
|
+
export { description_22 as description };
|
|
959
|
+
export function configFields_23({ table }: {
|
|
905
960
|
table: any;
|
|
906
961
|
}): Promise<({
|
|
907
962
|
name: string;
|
|
@@ -922,8 +977,8 @@ export namespace convert_session_to_user {
|
|
|
922
977
|
input_type?: undefined;
|
|
923
978
|
options?: undefined;
|
|
924
979
|
})[]>;
|
|
925
|
-
export {
|
|
926
|
-
export function
|
|
980
|
+
export { configFields_23 as configFields };
|
|
981
|
+
export function run_21({ row, configuration: { table_name, session_field, user_field }, user, }: {
|
|
927
982
|
row: any;
|
|
928
983
|
configuration: {
|
|
929
984
|
table_name: any;
|
|
@@ -932,14 +987,14 @@ export namespace convert_session_to_user {
|
|
|
932
987
|
};
|
|
933
988
|
user: any;
|
|
934
989
|
}): Promise<void>;
|
|
935
|
-
export {
|
|
990
|
+
export { run_21 as run };
|
|
936
991
|
}
|
|
937
992
|
export namespace install_progressive_web_app {
|
|
938
|
-
const
|
|
939
|
-
export {
|
|
940
|
-
export function
|
|
941
|
-
export {
|
|
942
|
-
export function
|
|
993
|
+
const description_23: string;
|
|
994
|
+
export { description_23 as description };
|
|
995
|
+
export function configFields_24(): never[];
|
|
996
|
+
export { configFields_24 as configFields };
|
|
997
|
+
export function run_22({ req }: {
|
|
943
998
|
req: any;
|
|
944
999
|
}): Promise<{
|
|
945
1000
|
eval_js: string;
|
|
@@ -948,7 +1003,7 @@ export namespace install_progressive_web_app {
|
|
|
948
1003
|
error: any;
|
|
949
1004
|
eval_js?: undefined;
|
|
950
1005
|
}>;
|
|
951
|
-
export {
|
|
1006
|
+
export { run_22 as run };
|
|
952
1007
|
}
|
|
953
1008
|
export {};
|
|
954
1009
|
//# sourceMappingURL=actions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../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;;;;qBAkBJ;;;;;;IAUa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA2Bb;;IACI;;;;;;;;;;sBAsBJ;;;;;;;;;;;;;;;;;;;;;;;;;;IAwCI;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAoBJ;;;;;;;;;;;;;;;;;;;;;;;;;;IA2BI;;;;;;;;;;;;;;;;;;;mBAYJ;;;;;;;;;;;;;;;;;;IA6BI;;;;;;;;;;;;;;OA+BJ;;;;;;;;;;;;;;;;;;;;;;IA2BI;;;;;;;;;;;;;;;;;;;;OAYJ;;;;;;;;;IAkBa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA+Eb;;;;;;;IAca;;;;;;;;;;;;;;;;;;;;;;UAkCb;;;;;;;;IAoCa;;uBAsBb;;;;IAEI;;;;;;;;;;OAUJ;;;;;;IASa;;;;;;;;;;;;SAcb;;IACI;;;;;;;;;OAgBJ;;;;;;IAea;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAyDb;;IASI;;;;;kCAmFJ;;;;;;IAIa;;;;;;;;;;;;;;;;;;;;;;;;;;UAyBb;;IACI;;;;;;;;;;OAkBJ;;;;;;;;;;;;;IAYI;;;;;;OAMJ;;;;;;IAIa;;;;;;;;;;SAsBb;;IAQI;;;;sBA8BJ;;;;;;IAMa;;;;;;;;;;;;;;;;;;;;UA2Cb;;IACI;;;;;;;;sBAeJ;;;;;;IAKa,2CAAQ;;IACjB;;;;;;;;OAKJ"}
|
|
@@ -803,6 +803,53 @@ module.exports = {
|
|
|
803
803
|
return;
|
|
804
804
|
},
|
|
805
805
|
},
|
|
806
|
+
delete_rows: {
|
|
807
|
+
/**
|
|
808
|
+
* @param {object} opts
|
|
809
|
+
* @param {*} opts.table
|
|
810
|
+
* @returns {Promise<object[]>}
|
|
811
|
+
*/
|
|
812
|
+
description: "Modify the triggering row",
|
|
813
|
+
configFields: async ({ mode, when_trigger }) => {
|
|
814
|
+
const tables = await Table.find({}, { cached: true });
|
|
815
|
+
return [
|
|
816
|
+
{
|
|
817
|
+
name: "delete_triggering_row",
|
|
818
|
+
label: "Delete triggering row",
|
|
819
|
+
type: "Bool",
|
|
820
|
+
},
|
|
821
|
+
{
|
|
822
|
+
name: "table_name",
|
|
823
|
+
label: "Table",
|
|
824
|
+
sublabel: "Table on which to delete rows",
|
|
825
|
+
input_type: "select",
|
|
826
|
+
showIf: { delete_triggering_row: false },
|
|
827
|
+
options: tables.map((t) => t.name),
|
|
828
|
+
},
|
|
829
|
+
{
|
|
830
|
+
name: "delete_where",
|
|
831
|
+
label: "Delete where",
|
|
832
|
+
type: "String",
|
|
833
|
+
sublabel: "Where expression, ex. <code>{manager: id}</code>",
|
|
834
|
+
required: true,
|
|
835
|
+
class: "validate-expression",
|
|
836
|
+
showIf: { delete_triggering_row: false },
|
|
837
|
+
},
|
|
838
|
+
];
|
|
839
|
+
},
|
|
840
|
+
run: async ({ row, table, configuration: { delete_triggering_row, delete_where, table_name }, user, ...rest }) => {
|
|
841
|
+
if (delete_triggering_row) {
|
|
842
|
+
if (!table || !row?.[table.pk_name])
|
|
843
|
+
throw new Error("delete_rows cannot find triggering row");
|
|
844
|
+
await table.deleteRows({ [table.pk_name]: row[table.pk_name] }, user);
|
|
845
|
+
return;
|
|
846
|
+
}
|
|
847
|
+
const where = eval_expression(delete_where, row || {}, user, "recalculate_stored_fields where");
|
|
848
|
+
const tbl = Table.findOne({ name: table_name });
|
|
849
|
+
await tbl.deleteRows(where, user);
|
|
850
|
+
return;
|
|
851
|
+
},
|
|
852
|
+
},
|
|
806
853
|
/**
|
|
807
854
|
* @namespace
|
|
808
855
|
* @category saltcorn-data
|