data-primals-engine 1.6.2 → 1.6.5
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/README.md +56 -911
- package/client/package-lock.json +64 -50
- package/client/package.json +6 -0
- package/client/src/App.scss +29 -0
- package/client/src/Dashboard.jsx +1 -1
- package/client/src/WorkflowEditor.jsx +101 -0
- package/client/src/WorkflowEditor.scss +29 -4
- package/client/src/_variables.scss +3 -0
- package/doc/automation-workflows.md +102 -0
- package/doc/core-concepts.md +33 -0
- package/doc/custom-api-endpoints.md +40 -0
- package/doc/dashboards-kpis-charts.md +49 -0
- package/doc/data-management.md +120 -0
- package/doc/data-models.md +75 -0
- package/doc/index.md +14 -0
- package/doc/roles-permissions.md +43 -0
- package/doc/users.md +30 -0
- package/package.json +7 -5
- package/src/client.js +6 -4
- package/src/core.js +31 -12
- package/src/defaultModels +1628 -0
- package/src/defaultModels.js +14 -0
- package/src/filter.js +110 -42
- package/src/modules/data/data.history.js +5 -1
- package/src/modules/data/data.js +2 -1
- package/src/modules/data/data.operations.js +116 -72
- package/src/modules/data/data.relations.js +1 -1
- package/src/modules/mongodb.js +2 -1
- package/src/modules/swagger.js +25 -5
- package/src/modules/user.js +138 -76
- package/src/modules/workflow.js +187 -177
- package/src/providers.js +1 -1
- package/swagger-en.yml +2308 -472
- package/swagger-fr.yml +487 -3
- package/test/core.test.js +341 -0
- package/test/data.history.integration.test.js +140 -16
- package/test/data.integration.test.js +137 -2
- package/test/user.test.js +201 -280
- package/test/workflow.integration.test.js +8 -0
package/swagger-fr.yml
CHANGED
|
@@ -473,8 +473,8 @@ components:
|
|
|
473
473
|
message:
|
|
474
474
|
type: string
|
|
475
475
|
example: "Opération réussie."
|
|
476
|
-
# --- Schémas de Modèles
|
|
477
|
-
|
|
476
|
+
# --- Schémas de Modèles ---
|
|
477
|
+
userPermission:
|
|
478
478
|
type: object
|
|
479
479
|
properties:
|
|
480
480
|
_id:
|
|
@@ -489,7 +489,51 @@ components:
|
|
|
489
489
|
type: string
|
|
490
490
|
description: Nom du modèle auquel appartient ce document
|
|
491
491
|
readOnly: true
|
|
492
|
-
default:
|
|
492
|
+
default: userPermission
|
|
493
|
+
_hash:
|
|
494
|
+
type: number
|
|
495
|
+
description: Hash du document pour les vérifications d'intégrité
|
|
496
|
+
readOnly: true
|
|
497
|
+
_pack:
|
|
498
|
+
type: string
|
|
499
|
+
description: Nom du pack auquel appartient ce document (le cas échéant)
|
|
500
|
+
readOnly: true
|
|
501
|
+
user:
|
|
502
|
+
type: string
|
|
503
|
+
description: ID of a user document
|
|
504
|
+
permission:
|
|
505
|
+
type: string
|
|
506
|
+
description: ID of a permission document
|
|
507
|
+
isGranted:
|
|
508
|
+
type: boolean
|
|
509
|
+
description: "True pour accorder la permission, False pour la révoquer explicitement."
|
|
510
|
+
expiresAt:
|
|
511
|
+
type: string
|
|
512
|
+
format: date-time
|
|
513
|
+
description: "Si défini, l'exception (l'octroi ou la révocation) est temporaire."
|
|
514
|
+
env:
|
|
515
|
+
type: string
|
|
516
|
+
description: ID of a env document
|
|
517
|
+
required:
|
|
518
|
+
- user
|
|
519
|
+
- permission
|
|
520
|
+
- isGranted
|
|
521
|
+
alert:
|
|
522
|
+
type: object
|
|
523
|
+
properties:
|
|
524
|
+
_id:
|
|
525
|
+
type: string
|
|
526
|
+
description: Identifiant unique du document (MongoDB ObjectId)
|
|
527
|
+
readOnly: true
|
|
528
|
+
_user:
|
|
529
|
+
type: string
|
|
530
|
+
description: Identifiant de l'utilisateur propriétaire de ce document
|
|
531
|
+
readOnly: true
|
|
532
|
+
_model:
|
|
533
|
+
type: string
|
|
534
|
+
description: Nom du modèle auquel appartient ce document
|
|
535
|
+
readOnly: true
|
|
536
|
+
default: alert
|
|
493
537
|
_hash:
|
|
494
538
|
type: number
|
|
495
539
|
description: Hash du document pour les vérifications d'intégrité
|
|
@@ -501,11 +545,451 @@ components:
|
|
|
501
545
|
name:
|
|
502
546
|
type: string
|
|
503
547
|
description: ""
|
|
548
|
+
targetModel:
|
|
549
|
+
type: string
|
|
550
|
+
description: ""
|
|
551
|
+
description:
|
|
552
|
+
type: string
|
|
553
|
+
description: ""
|
|
554
|
+
triggerCondition:
|
|
555
|
+
type: string
|
|
556
|
+
format: text
|
|
557
|
+
description: "La condition qui, si elle est remplie, déclenchera l'alerte."
|
|
558
|
+
frequency:
|
|
559
|
+
type: string
|
|
560
|
+
description: "À quelle fréquence vérifier si la condition est remplie."
|
|
561
|
+
isActive:
|
|
562
|
+
type: boolean
|
|
563
|
+
default: true
|
|
564
|
+
description: ""
|
|
565
|
+
sendEmail:
|
|
566
|
+
type: boolean
|
|
567
|
+
default: false
|
|
568
|
+
description: "Cochez pour envoyer également une notification par e-mail."
|
|
569
|
+
lastNotifiedAt:
|
|
570
|
+
type: string
|
|
571
|
+
format: date-time
|
|
572
|
+
description: "Timestamp de la dernière notification envoyée pour cette alerte."
|
|
573
|
+
message:
|
|
574
|
+
type: string
|
|
575
|
+
description: "Message personnalisé pour l'e-mail. Si vide, un message par défaut sera utilisé. Vous pouvez utiliser les variables {count}, {alert.name}...."
|
|
576
|
+
required:
|
|
577
|
+
- name
|
|
578
|
+
- targetModel
|
|
579
|
+
- triggerCondition
|
|
580
|
+
- frequency
|
|
581
|
+
env:
|
|
582
|
+
type: object
|
|
583
|
+
properties:
|
|
584
|
+
_id:
|
|
585
|
+
type: string
|
|
586
|
+
description: Identifiant unique du document (MongoDB ObjectId)
|
|
587
|
+
readOnly: true
|
|
588
|
+
_user:
|
|
589
|
+
type: string
|
|
590
|
+
description: Identifiant de l'utilisateur propriétaire de ce document
|
|
591
|
+
readOnly: true
|
|
592
|
+
_model:
|
|
593
|
+
type: string
|
|
594
|
+
description: Nom du modèle auquel appartient ce document
|
|
595
|
+
readOnly: true
|
|
596
|
+
default: env
|
|
597
|
+
_hash:
|
|
598
|
+
type: number
|
|
599
|
+
description: Hash du document pour les vérifications d'intégrité
|
|
600
|
+
readOnly: true
|
|
601
|
+
_pack:
|
|
602
|
+
type: string
|
|
603
|
+
description: Nom du pack auquel appartient ce document (le cas échéant)
|
|
604
|
+
readOnly: true
|
|
605
|
+
name:
|
|
606
|
+
type: string
|
|
607
|
+
description: ""
|
|
608
|
+
value:
|
|
609
|
+
type: string
|
|
610
|
+
description: ""
|
|
611
|
+
required:
|
|
612
|
+
- name
|
|
613
|
+
kpi:
|
|
614
|
+
type: object
|
|
615
|
+
properties:
|
|
616
|
+
_id:
|
|
617
|
+
type: string
|
|
618
|
+
description: Identifiant unique du document (MongoDB ObjectId)
|
|
619
|
+
readOnly: true
|
|
620
|
+
_user:
|
|
621
|
+
type: string
|
|
622
|
+
description: Identifiant de l'utilisateur propriétaire de ce document
|
|
623
|
+
readOnly: true
|
|
624
|
+
_model:
|
|
625
|
+
type: string
|
|
626
|
+
description: Nom du modèle auquel appartient ce document
|
|
627
|
+
readOnly: true
|
|
628
|
+
default: kpi
|
|
629
|
+
_hash:
|
|
630
|
+
type: number
|
|
631
|
+
description: Hash du document pour les vérifications d'intégrité
|
|
632
|
+
readOnly: true
|
|
633
|
+
_pack:
|
|
634
|
+
type: string
|
|
635
|
+
description: Nom du pack auquel appartient ce document (le cas échéant)
|
|
636
|
+
readOnly: true
|
|
637
|
+
name:
|
|
638
|
+
type: string
|
|
639
|
+
description: "Nom affiché du KPI (ex: Chiffre d'affaires total)"
|
|
640
|
+
description:
|
|
641
|
+
type: string
|
|
642
|
+
description: "Informations complémentaires sur le KPI"
|
|
643
|
+
targetModel:
|
|
644
|
+
type: string
|
|
645
|
+
description: "Nom du modèle sur lequel calculer le KPI (ex: order)"
|
|
646
|
+
aggregationType:
|
|
647
|
+
type: string
|
|
648
|
+
enum:
|
|
649
|
+
- count
|
|
650
|
+
- sum
|
|
651
|
+
- avg
|
|
652
|
+
- min
|
|
653
|
+
- max
|
|
654
|
+
description: "Type de calcul à effectuer"
|
|
655
|
+
aggregationField:
|
|
656
|
+
type: string
|
|
657
|
+
description: "Nom du champ numérique sur lequel appliquer l'agrégation (ex: totalAmount). Non requis pour 'count'."
|
|
658
|
+
matchFormula:
|
|
659
|
+
type: string
|
|
660
|
+
format: text
|
|
661
|
+
description: "Filtre JSON (MongoDB $match) à appliquer avant l'agrégation (ex: { \"status\": \"delivered\" })"
|
|
662
|
+
showTotal:
|
|
663
|
+
type: boolean
|
|
664
|
+
description: "Afficher le total"
|
|
665
|
+
showPercentTotal:
|
|
666
|
+
type: boolean
|
|
667
|
+
description: "Afficher le total en %"
|
|
668
|
+
totalMatchFormula:
|
|
669
|
+
type: string
|
|
670
|
+
format: text
|
|
671
|
+
description: "Formule pour le total (calcul %)"
|
|
672
|
+
unit:
|
|
673
|
+
type: string
|
|
674
|
+
description: "Unité à afficher (ex: €, $, utilisateurs)"
|
|
675
|
+
icon:
|
|
676
|
+
type: string
|
|
677
|
+
description: "Nom de l'icône (ex: FaUsers, FaShoppingCart)"
|
|
678
|
+
order:
|
|
679
|
+
type: number
|
|
680
|
+
description: "Ordre d'affichage sur un tableau de bord"
|
|
681
|
+
color:
|
|
682
|
+
type: string
|
|
683
|
+
format: color
|
|
684
|
+
description: "Couleur associée au KPI"
|
|
685
|
+
required:
|
|
686
|
+
- name
|
|
687
|
+
- targetModel
|
|
688
|
+
- aggregationType
|
|
689
|
+
imageGallery:
|
|
690
|
+
type: object
|
|
691
|
+
properties:
|
|
692
|
+
_id:
|
|
693
|
+
type: string
|
|
694
|
+
description: Identifiant unique du document (MongoDB ObjectId)
|
|
695
|
+
readOnly: true
|
|
696
|
+
_user:
|
|
697
|
+
type: string
|
|
698
|
+
description: Identifiant de l'utilisateur propriétaire de ce document
|
|
699
|
+
readOnly: true
|
|
700
|
+
_model:
|
|
701
|
+
type: string
|
|
702
|
+
description: Nom du modèle auquel appartient ce document
|
|
703
|
+
readOnly: true
|
|
704
|
+
default: imageGallery
|
|
705
|
+
_hash:
|
|
706
|
+
type: number
|
|
707
|
+
description: Hash du document pour les vérifications d'intégrité
|
|
708
|
+
readOnly: true
|
|
709
|
+
_pack:
|
|
710
|
+
type: string
|
|
711
|
+
description: Nom du pack auquel appartient ce document (le cas échéant)
|
|
712
|
+
readOnly: true
|
|
713
|
+
name:
|
|
714
|
+
type: string
|
|
715
|
+
description: "Le nom ou titre de la galerie d'images."
|
|
716
|
+
images:
|
|
717
|
+
type: array
|
|
718
|
+
items:
|
|
719
|
+
type: string
|
|
720
|
+
format: uuid
|
|
721
|
+
description: "Les fichiers images de cette galerie."
|
|
722
|
+
description:
|
|
723
|
+
type: string
|
|
724
|
+
description: "Description de la galerie (optionnel)."
|
|
725
|
+
tags:
|
|
726
|
+
type: array
|
|
727
|
+
items:
|
|
728
|
+
type: string
|
|
729
|
+
description: ID of a taxonomy document
|
|
730
|
+
createdAt:
|
|
731
|
+
type: string
|
|
732
|
+
format: date-time
|
|
733
|
+
description: "Date de création de la galerie (généralement géré par le système)."
|
|
734
|
+
required:
|
|
735
|
+
- name
|
|
736
|
+
budget:
|
|
737
|
+
type: object
|
|
738
|
+
properties:
|
|
739
|
+
_id:
|
|
740
|
+
type: string
|
|
741
|
+
description: Identifiant unique du document (MongoDB ObjectId)
|
|
742
|
+
readOnly: true
|
|
743
|
+
_user:
|
|
744
|
+
type: string
|
|
745
|
+
description: Identifiant de l'utilisateur propriétaire de ce document
|
|
746
|
+
readOnly: true
|
|
747
|
+
_model:
|
|
748
|
+
type: string
|
|
749
|
+
description: Nom du modèle auquel appartient ce document
|
|
750
|
+
readOnly: true
|
|
751
|
+
default: budget
|
|
752
|
+
_hash:
|
|
753
|
+
type: number
|
|
754
|
+
description: Hash du document pour les vérifications d'intégrité
|
|
755
|
+
readOnly: true
|
|
756
|
+
_pack:
|
|
757
|
+
type: string
|
|
758
|
+
description: Nom du pack auquel appartient ce document (le cas échéant)
|
|
759
|
+
readOnly: true
|
|
760
|
+
name:
|
|
761
|
+
type: string
|
|
762
|
+
description: "Nom ou description de la transaction (ex: Courses, Salaire Janvier)."
|
|
763
|
+
amount:
|
|
764
|
+
type: number
|
|
765
|
+
description: "Montant de la transaction. Positif pour un revenu, négatif pour une dépense."
|
|
766
|
+
currency:
|
|
767
|
+
type: string
|
|
768
|
+
description: ID of a currency document
|
|
769
|
+
transactionDate:
|
|
770
|
+
type: string
|
|
771
|
+
format: date-time
|
|
772
|
+
description: "Date à laquelle la transaction a eu lieu."
|
|
504
773
|
description:
|
|
505
774
|
type: string
|
|
775
|
+
description: "Notes ou détails supplémentaires sur la transaction."
|
|
776
|
+
paymentMethod:
|
|
777
|
+
type: string
|
|
778
|
+
description: "Méthode de paiement utilisée (ex: Carte de crédit, Espèces, Virement)."
|
|
779
|
+
category:
|
|
780
|
+
type: string
|
|
781
|
+
description: ID of a taxonomy document
|
|
782
|
+
isRecurring:
|
|
783
|
+
type: boolean
|
|
784
|
+
default: false
|
|
785
|
+
description: "Indique si cette transaction est récurrente."
|
|
786
|
+
recurringFrequency:
|
|
787
|
+
type: string
|
|
788
|
+
enum:
|
|
789
|
+
- daily
|
|
790
|
+
- weekly
|
|
791
|
+
- monthly
|
|
792
|
+
- yearly
|
|
793
|
+
description: ""
|
|
794
|
+
recurringEndDate:
|
|
795
|
+
type: string
|
|
796
|
+
format: date
|
|
506
797
|
description: ""
|
|
798
|
+
attachments:
|
|
799
|
+
type: array
|
|
800
|
+
items:
|
|
801
|
+
type: string
|
|
802
|
+
format: uuid
|
|
803
|
+
description: "Pièces jointes (reçus, factures)."
|
|
507
804
|
required:
|
|
508
805
|
- name
|
|
806
|
+
- amount
|
|
807
|
+
- currency
|
|
808
|
+
- transactionDate
|
|
809
|
+
event:
|
|
810
|
+
type: object
|
|
811
|
+
properties:
|
|
812
|
+
_id:
|
|
813
|
+
type: string
|
|
814
|
+
description: Identifiant unique du document (MongoDB ObjectId)
|
|
815
|
+
readOnly: true
|
|
816
|
+
_user:
|
|
817
|
+
type: string
|
|
818
|
+
description: Identifiant de l'utilisateur propriétaire de ce document
|
|
819
|
+
readOnly: true
|
|
820
|
+
_model:
|
|
821
|
+
type: string
|
|
822
|
+
description: Nom du modèle auquel appartient ce document
|
|
823
|
+
readOnly: true
|
|
824
|
+
default: event
|
|
825
|
+
_hash:
|
|
826
|
+
type: number
|
|
827
|
+
description: Hash du document pour les vérifications d'intégrité
|
|
828
|
+
readOnly: true
|
|
829
|
+
_pack:
|
|
830
|
+
type: string
|
|
831
|
+
description: Nom du pack auquel appartient ce document (le cas échéant)
|
|
832
|
+
readOnly: true
|
|
833
|
+
title:
|
|
834
|
+
type: string
|
|
835
|
+
description: "The title of the event"
|
|
836
|
+
description:
|
|
837
|
+
type: string
|
|
838
|
+
description: "A detailed description of the event, including agenda, speakers, and other relevant information."
|
|
839
|
+
startDate:
|
|
840
|
+
type: string
|
|
841
|
+
format: date-time
|
|
842
|
+
description: "The starting date and time of the event"
|
|
843
|
+
endDate:
|
|
844
|
+
type: string
|
|
845
|
+
format: date-time
|
|
846
|
+
description: "The ending date and time of the event"
|
|
847
|
+
location:
|
|
848
|
+
type: string
|
|
849
|
+
description: ID of a location document
|
|
850
|
+
categories:
|
|
851
|
+
type: array
|
|
852
|
+
items:
|
|
853
|
+
type: string
|
|
854
|
+
description: ID of a taxonomy document
|
|
855
|
+
organizer:
|
|
856
|
+
type: string
|
|
857
|
+
description: ID of a contact document
|
|
858
|
+
isOnline:
|
|
859
|
+
type: boolean
|
|
860
|
+
default: false
|
|
861
|
+
description: "Whether the event is online or in-person."
|
|
862
|
+
eventUrl:
|
|
863
|
+
type: string
|
|
864
|
+
format: uri
|
|
865
|
+
description: "A link to the official event webpage or registration page."
|
|
866
|
+
imageUrl:
|
|
867
|
+
type: string
|
|
868
|
+
format: uuid
|
|
869
|
+
description: "URL of the event image or banner."
|
|
870
|
+
status:
|
|
871
|
+
type: string
|
|
872
|
+
enum:
|
|
873
|
+
- scheduled
|
|
874
|
+
- ongoing
|
|
875
|
+
- completed
|
|
876
|
+
- cancelled
|
|
877
|
+
- postponed
|
|
878
|
+
description: "The current status of the event."
|
|
879
|
+
capacity:
|
|
880
|
+
type: number
|
|
881
|
+
description: "The maximum number of attendees allowed for the event."
|
|
882
|
+
price:
|
|
883
|
+
type: number
|
|
884
|
+
description: "The price of admission, if applicable."
|
|
885
|
+
currency:
|
|
886
|
+
type: string
|
|
887
|
+
description: ID of a currency document
|
|
888
|
+
registrationDeadline:
|
|
889
|
+
type: string
|
|
890
|
+
format: date-time
|
|
891
|
+
description: "The date by which attendees must register for the event."
|
|
892
|
+
attendees:
|
|
893
|
+
type: array
|
|
894
|
+
items:
|
|
895
|
+
type: string
|
|
896
|
+
description: ID of a contact document
|
|
897
|
+
sponsors:
|
|
898
|
+
type: array
|
|
899
|
+
items:
|
|
900
|
+
type: string
|
|
901
|
+
description: ID of a contact document
|
|
902
|
+
required:
|
|
903
|
+
- title
|
|
904
|
+
- startDate
|
|
905
|
+
- endDate
|
|
906
|
+
endpoint:
|
|
907
|
+
type: object
|
|
908
|
+
properties:
|
|
909
|
+
_id:
|
|
910
|
+
type: string
|
|
911
|
+
description: Identifiant unique du document (MongoDB ObjectId)
|
|
912
|
+
readOnly: true
|
|
913
|
+
_user:
|
|
914
|
+
type: string
|
|
915
|
+
description: Identifiant de l'utilisateur propriétaire de ce document
|
|
916
|
+
readOnly: true
|
|
917
|
+
_model:
|
|
918
|
+
type: string
|
|
919
|
+
description: Nom du modèle auquel appartient ce document
|
|
920
|
+
readOnly: true
|
|
921
|
+
default: endpoint
|
|
922
|
+
_hash:
|
|
923
|
+
type: number
|
|
924
|
+
description: Hash du document pour les vérifications d'intégrité
|
|
925
|
+
readOnly: true
|
|
926
|
+
_pack:
|
|
927
|
+
type: string
|
|
928
|
+
description: Nom du pack auquel appartient ce document (le cas échéant)
|
|
929
|
+
readOnly: true
|
|
930
|
+
isActive:
|
|
931
|
+
type: boolean
|
|
932
|
+
default: true
|
|
933
|
+
description: "If checked, the endpoint is active and can be called."
|
|
934
|
+
name:
|
|
935
|
+
type: string
|
|
936
|
+
description: "A human-readable name to identify the endpoint."
|
|
937
|
+
path:
|
|
938
|
+
type: string
|
|
939
|
+
description: "The URL path after /api/actions/ (e.g., 'send-welcome-email'). Do not include '/'."
|
|
940
|
+
method:
|
|
941
|
+
type: string
|
|
942
|
+
enum:
|
|
943
|
+
- GET
|
|
944
|
+
- POST
|
|
945
|
+
- PUT
|
|
946
|
+
- PATCH
|
|
947
|
+
- DELETE
|
|
948
|
+
description: "The HTTP method required to call this endpoint."
|
|
949
|
+
code:
|
|
950
|
+
type: string
|
|
951
|
+
format: text
|
|
952
|
+
description: "The script to execute. Must return a value or an object that will be the JSON response."
|
|
953
|
+
isPublic:
|
|
954
|
+
type: boolean
|
|
955
|
+
default: false
|
|
956
|
+
description: "Si coché, ce point d'accès sera accessible sans authentification."
|
|
957
|
+
required:
|
|
958
|
+
- isActive
|
|
959
|
+
- name
|
|
960
|
+
- path
|
|
961
|
+
- method
|
|
962
|
+
- code
|
|
963
|
+
permission:
|
|
964
|
+
type: object
|
|
965
|
+
properties:
|
|
966
|
+
_id:
|
|
967
|
+
type: string
|
|
968
|
+
description: Identifiant unique du document (MongoDB ObjectId)
|
|
969
|
+
readOnly: true
|
|
970
|
+
_user:
|
|
971
|
+
type: string
|
|
972
|
+
description: Identifiant de l'utilisateur propriétaire de ce document
|
|
973
|
+
readOnly: true
|
|
974
|
+
_model:
|
|
975
|
+
type: string
|
|
976
|
+
description: Nom du modèle auquel appartient ce document
|
|
977
|
+
readOnly: true
|
|
978
|
+
default: permission
|
|
979
|
+
_hash:
|
|
980
|
+
type: number
|
|
981
|
+
description: Hash du document pour les vérifications d'intégrité
|
|
982
|
+
readOnly: true
|
|
983
|
+
_pack:
|
|
984
|
+
type: string
|
|
985
|
+
description: Nom du pack auquel appartient ce document (le cas échéant)
|
|
986
|
+
readOnly: true
|
|
987
|
+
name:
|
|
988
|
+
type: string
|
|
989
|
+
description: ""
|
|
990
|
+
description:
|
|
991
|
+
type: string
|
|
992
|
+
description: ""
|
|
509
993
|
role:
|
|
510
994
|
type: object
|
|
511
995
|
properties:
|