@blazedpath/commons 0.0.5 → 0.0.7

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.
@@ -9,19 +9,19 @@ class BlzConfig {
9
9
  this._config = null
10
10
  }
11
11
 
12
- async initialize(configToOverride = {}) {
12
+ async initialize(configToOverride = {}, appPath) {
13
13
  if (this._config != null) {
14
14
  console.warn('You are call BlzConfig.initialize multiple times. We will override the config')
15
15
  }
16
- this._config = await this.loadConfig(configToOverride)
16
+ this._config = await this.loadConfig(configToOverride, appPath)
17
17
  this.normalizeConfig(this._config)
18
18
  this.validateConfig(this._config)
19
19
  }
20
20
 
21
- async loadConfig(configToOverride) {
21
+ async loadConfig(configToOverride, appPath) {
22
22
 
23
23
  // It starts from the system configuration and the properties are added by environment variables
24
- const configPath = Path.join(__dirname, '../config.json')
24
+ const configPath = Path.join(appPath, '../config.json')
25
25
  if (!Fs.existsSync(configPath)) {
26
26
  throw new Error(`${configPath} config file not exists`)
27
27
  }
@@ -32,11 +32,11 @@ class BlzConfig {
32
32
 
33
33
  // look for the .env file within the system or at the solution level.
34
34
  let environmentPath = null
35
- if (Fs.existsSync(Path.join(__dirname, '../.env'))) {
36
- environmentPath = Path.join(__dirname, '../.env');
35
+ if (Fs.existsSync(Path.join(appPath, '../.env'))) {
36
+ environmentPath = Path.join(appPath, '../.env');
37
37
  }
38
- else if (Fs.existsSync(Path.join(__dirname, '../../.env'))) {
39
- environmentPath = Path.join(__dirname, '../../.env');
38
+ else if (Fs.existsSync(Path.join(appPath, '../../.env'))) {
39
+ environmentPath = Path.join(appPath, '../../.env');
40
40
  }
41
41
 
42
42
  // Check duplicate keys in .env
@@ -234,7 +234,6 @@ const convertValueFromType = async function (value, type) {
234
234
  // If i have a clob, or special type, the case might not be straightforward
235
235
  if (value._type.name === 'DB_TYPE_CLOB' ) {
236
236
  return await oraResult.outBinds[parameter.name].getData();
237
- break;
238
237
  }
239
238
  }
240
239
  }
@@ -398,15 +398,13 @@ permissions:
398
398
  - name: config_entry_process_manual_allocation
399
399
  domain: config
400
400
  rules:
401
- - path: /ep-manua-historicall-credit/**
402
- - path: /ep-manua-historicall-credit/**
403
401
  - path: /ep-manua-historicall-credit/**
404
402
  - path: /ep-manua-historicall-debit/**
405
403
  - path: /ep-manual-credit/**
406
- - path: /ep-manual-debit/**
407
404
  - path: /ep-manual-selected/**
408
405
  - path: /ep-out-manual-credit/**
409
406
  - path: /ep-out-manual-debit/**
407
+ - path: /ep-manual-debit/**
410
408
  - path: /api/ms-entry-process/unmatched/**
411
409
  - path: /api/ms-entry-process/unmatched-historial/**
412
410
  - name: config_entry_process_configuration
@@ -455,8 +453,6 @@ permissions:
455
453
  enable: false
456
454
  - path: /ep-manua-historicall-credit
457
455
  enable: false
458
- - path: /ep-manual-debit
459
- enable: false
460
456
  - path: /ep-manual-debit/**
461
457
  enable: false
462
458
  - path: /ep-out-manual-debit
@@ -484,82 +480,82 @@ permissions:
484
480
  enable: false
485
481
 
486
482
  # Dunning screen
487
- - path: /debtors/**
483
+ - path: /dunning/**
488
484
  actions: cc_dunningSuspendAccount
489
485
  enable: false
490
486
 
491
- - path: /debtors/**
487
+ - path: /dunning/**
492
488
  actions: cc_dunningUpdatePercentage
493
489
  enable: false
494
490
 
495
- - path: /debtors/**
491
+ - path: /dunning/**
496
492
  actions: cc_dunningResendInvoice
497
493
  enable: false
498
494
 
499
- - path: /debtors/**
495
+ - path: /dunning/**
500
496
  actions: cc_dunningSendReminder
501
497
  enable: false
502
498
 
503
- - path: /debtors/**
499
+ - path: /dunning/**
504
500
  actions: cc_dunningResetAging
505
501
  enable: false
506
502
 
507
- - path: /debtors/**
503
+ - path: /dunning/**
508
504
  actions: cc_dunningTerminationOfServices
509
505
  enable: false
510
506
 
511
- - path: /debtors/**
507
+ - path: /dunning/**
512
508
  actions: cc_dunningChangefPaymentResponsible
513
509
  enable: false
514
510
 
515
- - path: /debtors/**
511
+ - path: /dunning/**
516
512
  actions: cc_dunningSecurityDeposit
517
513
  enable: false
518
514
 
519
- - path: /debtors/**
515
+ - path: /dunning/**
520
516
  actions: cc_dunningChangePaymentMethod
521
517
  enable: false
522
518
 
523
- - path: /debtors/**
519
+ - path: /dunning/**
524
520
  actions: cc_dunningCaptureCreditDispute
525
521
  enable: false
526
522
 
527
- - path: /debtors/**
523
+ - path: /dunning/**
528
524
  actions: cc_dunningCaptureChargeDispute
529
525
  enable: false
530
526
 
531
- - path: /debtors/**
527
+ - path: /dunning/**
532
528
  actions: cc_dunningReverseWriteOff
533
529
  enable: false
534
530
 
535
- - path: /debtors/**
531
+ - path: /dunning/**
536
532
  actions: cc_dunningChangePlacementStatus
537
533
  enable: false
538
534
 
539
- - path: /debtors/**
535
+ - path: /dunning/**
540
536
  actions: cc_dunningAssignmentPlacement
541
537
  enable: false
542
538
 
543
- - path: /debtors/**
539
+ - path: /dunning/**
544
540
  actions: cc_dunningResendPaymentEmail
545
541
  enable: false
546
542
 
547
543
  # Billing account > Statements tab
548
- - path: /debtors/**
544
+ - path: /ledger/accounts/**
549
545
  actions: cc_billingAcountStatemantDownload
550
546
  enable: false
551
547
 
552
- - path: /debtors/**
548
+ - path: /ledger/accounts/**
553
549
  actions: cc_billingAcountStatemantResend
554
550
  enable: false
555
551
 
556
552
  # *** Generic Rule to apply in multiple widgets where a role disables all ***
557
- - path: /debtors/**
553
+ - path: /dunning/**
558
554
  actions: cc_dunningDisabled
559
555
  enable: false
560
556
 
561
557
  # Financing Account Bkr Send Message
562
- - path: /debtors/**
558
+ - path: /bkr/**
563
559
  actions: cc_bkrSendMessage
564
560
  enable: false
565
561
  # endregion
@@ -580,81 +576,77 @@ permissions:
580
576
  enable: false
581
577
 
582
578
  # Dunning screen
583
- - path: /debtors/**
579
+ - path: /dunning/**
584
580
  actions: bc_dunningSuspendAccount
585
581
  enable: false
586
582
 
587
- - path: /debtors/**
583
+ - path: /dunning/**
588
584
  actions: bc_dunningUpdatePercentage
589
585
  enable: false
590
586
 
591
- - path: /debtors/**
587
+ - path: /dunning/**
592
588
  actions: bc_dunningResendInvoice
593
589
  enable: false
594
590
 
595
- - path: /debtors/**
591
+ - path: /dunning/**
596
592
  actions: bc_dunningSendReminder
597
593
  enable: false
598
594
 
599
- - path: /debtors/**
595
+ - path: /dunning/**
600
596
  actions: bc_dunningResetAging
601
597
  enable: false
602
598
 
603
- - path: /debtors/**
599
+ - path: /dunning/**
604
600
  actions: bc_dunningTerminationOfServices
605
601
  enable: false
606
602
 
607
- - path: /debtors/**
603
+ - path: /dunning/**
608
604
  actions: bc_dunningChangefPaymentResponsible
609
605
  enable: false
610
606
 
611
- - path: /debtors/**
607
+ - path: /dunning/**
612
608
  actions: bc_dunningSecurityDeposit
613
609
  enable: false
614
610
 
615
- - path: /debtors/**
611
+ - path: /dunning/**
616
612
  actions: bc_dunningChangePaymentMethod
617
613
  enable: false
618
614
 
619
- - path: /debtors/**
615
+ - path: /dunning/**
620
616
  actions: bc_dunningCaptureCreditDispute
621
617
  enable: false
622
618
 
623
- - path: /debtors/**
619
+ - path: /dunning/**
624
620
  actions: bc_dunningCaptureChargeDispute
625
621
  enable: false
626
622
 
627
- - path: /debtors/**
623
+ - path: /dunning/**
628
624
  actions: bc_dunningReverseWriteOff
629
625
  enable: false
630
626
 
631
- - path: /debtors/**
627
+ - path: /dunning/**
632
628
  actions: bc_dunningChangePlacementStatus
633
629
  enable: false
634
630
 
635
- - path: /debtors/**
631
+ - path: /dunning/**
636
632
  actions: bc_dunningAssignmentPlacement
637
633
  enable: false
638
634
 
639
- - path: /debtors/**
635
+ - path: /dunning/**
640
636
  actions: bc_dunningResendPaymentEmail
641
637
  enable: false
642
638
 
643
- - path: /debtors/**
644
- actions: profile_viewOnly
645
- enable: false
646
-
647
639
  # Billing account > Statements tab
648
- - path: /debtors/**
640
+ - path: /ledger/accounts/**
649
641
  actions: bc_billingAcountStatemantDownload
650
642
  enable: false
651
643
 
652
- - path: /debtors/**
644
+ - path: /ledger/accounts/**
653
645
  actions: bc_billingAcountStatemantResend
654
646
  enable: false
655
647
 
656
648
  # Financing Account Bkr Send Message
657
- - path: /debtors/**
649
+ - path: /bkr/**
658
650
  actions: bc_bkrSendMessage
659
651
  enable: false
660
652
  # endregion
@@ -722,6 +714,10 @@ permissions:
722
714
  - path: /debtors
723
715
  - path: /debtor/**
724
716
  domain: agent
717
+ - name: agent_viewOnly
718
+ rules:
719
+ - path: /colm/**
720
+ domain: agent
725
721
  # 360 View
726
722
  - name: agent_consumer_costumer_360View_settlementDiscountCard
727
723
  rules:
@@ -732,62 +728,62 @@ permissions:
732
728
  # Dunning screen
733
729
  - name: agent_consumer_costumer_dunning_SuspendAccountCard
734
730
  rules:
735
- - path: /debtors/**
731
+ - path: /dunning/**
736
732
  actions: cc_dunningSuspendAccount
737
733
  enable: true
738
734
  domain: agent
739
735
  - name: agent_consumer_costumer_dunning_UpdatePercentageCard
740
736
  rules:
741
- - path: /debtors/**
737
+ - path: /dunning/**
742
738
  actions: cc_dunningUpdatePercentage
743
739
  enable: true
744
740
  domain: agent
745
741
  - name: agent_consumer_costumer_dunning_ResetAgingCard
746
742
  rules:
747
- - path: /debtors/**
743
+ - path: /dunning/**
748
744
  actions: cc_dunningResetAging
749
745
  enable: true
750
746
  domain: agent
751
747
  - name: agent_consumer_costumer_dunning_TerminationOfServicesCard
752
748
  rules:
753
- - path: /debtors/**
749
+ - path: /dunning/**
754
750
  actions: cc_dunningTerminationOfServices
755
751
  enable: true
756
752
  domain: agent
757
753
  - name: agent_consumer_costumer_dunning_ChangePaymentResponsibleCard
758
754
  rules:
759
- - path: /debtors/**
755
+ - path: /dunning/**
760
756
  actions: cc_dunningChangePaymentResponsible
761
757
  enable: true
762
758
  domain: agent
763
759
  - name: agent_consumer_costumer_dunning_CaptureChargeDisputeCard
764
760
  rules:
765
- - path: /debtors/**
761
+ - path: /dunning/**
766
762
  actions: cc_dunningCaptureChargeDispute
767
763
  enable: true
768
764
  domain: agent
769
765
  - name: agent_consumer_costumer_dunning_ReverseWriteOffCard
770
766
  rules:
771
- - path: /debtors/**
767
+ - path: /dunning/**
772
768
  actions: cc_dunningReverseWriteOff
773
769
  enable: true
774
770
  domain: agent
775
771
  - name: agent_consumer_costumer_dunning_ChangePlacementStatusCard
776
772
  rules:
777
- - path: /debtors/**
773
+ - path: /dunning/**
778
774
  actions: cc_dunningChangePlacementStatus
779
775
  enable: true
780
776
  domain: agent
781
777
  - name: agent_consumer_costumer_dunning_AssignmentPlacementCard
782
778
  rules:
783
- - path: /debtors/**
779
+ - path: /dunning/**
784
780
  actions: cc_dunningAssignmentPlacement
785
781
  enable: true
786
782
  domain: agent
787
783
  # Financing Account Bkr Send Message
788
784
  - name: agent_costumer_financing_accounts_bkr_send_message
789
785
  rules:
790
- - path: /debtors/**
786
+ - path: /bkr/**
791
787
  actions: cc_bkrSendMessage
792
788
  enable: true
793
789
  domain: agent
@@ -811,68 +807,62 @@ permissions:
811
807
  # Dunning screen
812
808
  - name: agent_business_costumer_dunning_SuspendAccountCard
813
809
  rules:
814
- - path: /debtors/**
810
+ - path: /dunning/**
815
811
  actions: bc_dunningSuspendAccount
816
812
  enable: true
817
813
  domain: agent
818
814
  - name: agent_business_costumer_dunning_UpdatePercentageCard
819
815
  rules:
820
- - path: /debtors/**
816
+ - path: /dunning/**
821
817
  actions: bc_dunningUpdatePercentage
822
818
  enable: true
823
819
  domain: agent
824
820
  - name: agent_business_costumer_dunning_ResetAgingCard
825
821
  rules:
826
- - path: /debtors/**
822
+ - path: /dunning/**
827
823
  actions: bc_dunningResetAging
828
824
  enable: true
829
825
  domain: agent
830
826
  - name: agent_business_costumer_dunning_TerminationOfServicesCard
831
827
  rules:
832
- - path: /debtors/**
828
+ - path: /dunning/**
833
829
  actions: bc_dunningTerminationOfServices
834
830
  enable: true
835
831
  domain: agent
836
832
  - name: agent_business_costumer_dunning_ChangePaymentResponsibleCard
837
833
  rules:
838
- - path: /debtors/**
834
+ - path: /dunning/**
839
835
  actions: bc_dunningChangePaymentResponsible
840
836
  enable: true
841
837
  domain: agent
842
838
  - name: agent_business_costumer_dunning_CaptureChargeDisputeCard
843
839
  rules:
844
- - path: /debtors/**
840
+ - path: /dunning/**
845
841
  actions: bc_dunningCaptureChargeDispute
846
842
  enable: true
847
843
  domain: agent
848
844
  - name: agent_business_costumer_dunning_ReverseWriteOffCard
849
845
  rules:
850
- - path: /debtors/**
846
+ - path: /dunning/**
851
847
  actions: bc_dunningReverseWriteOff
852
848
  enable: true
853
849
  domain: agent
854
850
  - name: agent_business_costumer_dunning_ChangePlacementStatusCard
855
851
  rules:
856
- - path: /debtors/**
852
+ - path: /dunning/**
857
853
  actions: bc_dunningChangePlacementStatus
858
854
  enable: true
859
855
  domain: agent
860
856
  - name: agent_business_costumer_dunning_AssignmentPlacementCard
861
857
  rules:
862
- - path: /debtors/**
858
+ - path: /dunning/**
863
859
  actions: bc_dunningAssignmentPlacement
864
860
  enable: true
865
861
  domain: agent
866
- - name: agent_profile_viewOnly_shows_menu
867
- rules:
868
- - path: /debtors/**
869
- actions: profile_viewOnly
870
- enable: true
871
- domain: agent
872
862
  # Financing Account Bkr Send Message
873
863
  - name: agent_business_financing_accounts_bkr_send_message
874
864
  rules:
875
- - path: /debtors/**
865
+ - path: /bkr/**
876
866
  actions: bc_bkrSendMessage
877
867
  enable: true
878
868
  domain: agent
@@ -885,17 +875,17 @@ permissions:
885
875
  - name: agent_task_management
886
876
  rules:
887
877
  - path: /taskManagement/**
878
+ - path: /taskManagement
888
879
  domain: agent
889
880
  # Entry Process Rules
890
881
  - name: agent_entry_process
891
882
  rules:
892
883
  - path: /ep-manual-credit/**
893
- - path: /ep-out-manual-credit
894
- - path: /ep-manua-historicall-credit
895
- - path: /ep-manual-debit
884
+ - path: /ep-out-manual-credit/**
885
+ - path: /ep-manua-historicall-credit/**
896
886
  - path: /ep-manual-debit/**
897
- - path: /ep-out-manual-debit
898
- - path: /ep-manua-historicall-debit
887
+ - path: /ep-out-manual-debit/**
888
+ - path: /ep-manua-historicall-debit/**
899
889
  domain: agent
900
890
  - name: agent_portal_apis
901
891
  rules:
@@ -938,13 +928,30 @@ permissions:
938
928
  - path: /api/ms-insight-management/**
939
929
  actions: GET
940
930
  - path: /api/party-management-ext/**
941
- actions: GET
931
+ actions: GET
942
932
  - path: /api/locations-ext/**
943
933
  actions: GET
934
+ - path: /api/ms-operation-executor/**
935
+ actions: GET
944
936
  - path: /api/entity-logs-management-ms/**
945
937
  actions: GET
946
938
  - path: /api/document-management-ext/**
947
939
  actions: GET
940
+ - path: /api/common-business-ext/**
941
+ actions: GET
942
+ - path: /api/collections-management-ext/**
943
+ actions: GET
944
+ - path: /api/dunning-management-ext/**
945
+ actions: GET
946
+ - path: /api/special-marks-management-ext/**
947
+ actions: GET
948
+ - path: /api/ms-insight-management/**
949
+ - path: /api/kpn-integrations/**
950
+ actions: GET
951
+ - path: /api/ms-operation-scheduler/**
952
+ actions: GET
953
+ - path: /api/bkr-ext/**
954
+ actions: GET
948
955
  domain: agent
949
956
 
950
957
  roles:
@@ -952,13 +959,13 @@ roles:
952
959
  applyToAll: true
953
960
  permissions:
954
961
  - config_disable_all
955
- - name: PCS.BackOffice
962
+ - name: Collections.BackOffice
956
963
  permissions:
957
964
  - config_home
958
965
  - config_entry_process_manual_allocation
959
- - name: PCS.Admin
966
+ - name: Collections.Admin
960
967
  extends:
961
- - PCS.BackOffice
968
+ - Collections.BackOffice
962
969
  permissions:
963
970
  - config_debtor_management
964
971
  - config_ledger_management
@@ -982,6 +989,10 @@ roles:
982
989
  - config_approval
983
990
  - config_administration
984
991
  - config_inbox
992
+ - agent_consumer_costumer
993
+ - agent_business_costumer
994
+ - agent_task_management
995
+ - agent_portal_apis
985
996
  # *** Agent Portal ***
986
997
  - name: AgentBase
987
998
  applyToAll: true
@@ -993,18 +1004,21 @@ roles:
993
1004
  - agent_consumer_costumer
994
1005
  - agent_business_costumer
995
1006
  - agent_viewonly_portal_apis
996
- - agent_profile_viewOnly_shows_menu
997
- - name: PCS.Agent
1007
+ - name: Collections.Agent
998
1008
  extends:
999
1009
  - Collections.ViewOnly
1000
1010
  permissions:
1001
1011
  - agent_task_management
1002
1012
  - agent_entry_process
1003
1013
  - agent_portal_apis
1004
- - agent_business_costumer_dunning_AssignmentPlacementCard
1005
- - name: PCS.Supervisor
1006
- extends:
1007
- - PCS.Agent
1014
+ - name: Collections.FinanceBV
1015
+ extends:
1016
+ - Collections.ViewOnly
1017
+ permissions:
1018
+ - agent_portal_apis
1019
+ - name: Collections.Supervisor
1020
+ extends:
1021
+ - Collections.Agent
1008
1022
  permissions:
1009
1023
  - agent_payment_responsibles
1010
1024
  - agent_consumer_costumer_360View_settlementDiscountCard
@@ -1028,16 +1042,9 @@ roles:
1028
1042
  - agent_business_costumer_dunning_ChangePlacementStatusCard
1029
1043
  - agent_business_costumer_dunning_AssignmentPlacementCard
1030
1044
  - name: Configuration.Admin
1031
- extends:
1032
- - PCS.Admin
1033
- - PCS.Supervisor
1034
- permissions:
1035
- - agent_costumer_financing_accounts_bkr_send_message
1036
- - agent_business_financing_accounts_bkr_send_message
1037
-
1038
- - name: Collections.FinanceBV
1039
- extends:
1040
- - PCS.Agent
1045
+ extends:
1046
+ - Collections.Admin
1047
+ - Collections.Supervisor
1041
1048
  permissions:
1042
- - agent_payment_responsibles
1043
-
1049
+ - agent_costumer_financing_accounts_bkr_send_message
1050
+ - agent_business_financing_accounts_bkr_send_message