@acorex/connectivity 19.2.12 → 19.2.15

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 (34) hide show
  1. package/api/lib/api-storage.service.d.ts +1 -1
  2. package/fesm2022/acorex-connectivity-api.mjs +2 -2
  3. package/fesm2022/acorex-connectivity-api.mjs.map +1 -1
  4. package/fesm2022/acorex-connectivity-mock.mjs +978 -65
  5. package/fesm2022/acorex-connectivity-mock.mjs.map +1 -1
  6. package/mock/lib/application-management/application.seeder.d.ts +1 -1
  7. package/mock/lib/conversation/chat/chat.seeder.d.ts +1 -1
  8. package/mock/lib/conversation/comments/comment.seeder.d.ts +1 -1
  9. package/mock/lib/document-management/document-type/document-type.mock.d.ts +2 -0
  10. package/mock/lib/document-management/document-type/document-type.seeder.d.ts +8 -0
  11. package/mock/lib/document-management/folder/folder.mock.data.d.ts +3 -0
  12. package/mock/lib/document-management/folder/folder.seeder.d.ts +8 -0
  13. package/mock/lib/document-management/folder/folder.service.d.ts +9 -0
  14. package/mock/lib/document-management/folder/index.d.ts +1 -0
  15. package/mock/lib/form-template-management/category.seeder.d.ts +2 -1
  16. package/mock/lib/mock.module.d.ts +2 -1
  17. package/mock/lib/mock.strategy.d.ts +1 -0
  18. package/mock/lib/notification-management/template.seeder.d.ts +1 -1
  19. package/mock/lib/organization-management/organization-management.seeder.d.ts +1 -1
  20. package/mock/lib/platform-management/app-term/app-term.seeder.d.ts +1 -1
  21. package/mock/lib/platform-management/app-version/app-version.seeder.d.ts +1 -1
  22. package/mock/lib/platform-management/common/regional-util.service.d.ts +1 -1
  23. package/mock/lib/platform-management/global-variables/global-variable.seeder.d.ts +1 -1
  24. package/mock/lib/platform-management/metadata/metadata.mock.d.ts +2 -0
  25. package/mock/lib/platform-management/metadata/metadata.seeder.d.ts +8 -0
  26. package/mock/lib/scheduler-job-management/scheduler-job.seeder.d.ts +1 -1
  27. package/mock/lib/security-management/datasource-provider.mock.service.d.ts +4 -0
  28. package/mock/lib/security-management/mock-data.d.ts +28 -0
  29. package/mock/lib/security-management/role.seeder.d.ts +10 -0
  30. package/mock/lib/security-management/security-management-mock.module.d.ts +6 -0
  31. package/mock/lib/security-management/user.seeder.d.ts +9 -0
  32. package/mock/lib/text-template-management/category.seeder.d.ts +1 -1
  33. package/mock/lib/text-template-management/template.seeder.d.ts +1 -1
  34. package/package.json +1 -1
@@ -1,24 +1,27 @@
1
1
  import { APPLICATION_SOURCE_NAME, MODULE_SOURCE_NAME, ENTITY_SOURCE_NAME, FEATURE_SOURCE_NAME, PERMISSION_SOURCE_NAME, PROPERTY_SOURCE_NAME, AXPModuleDesignerService } from '@acorex/modules/application-management';
2
- import { RootConfig as RootConfig$1, AXMNotificationEntityService } from '@acorex/modules/notification-management';
2
+ import { RootConfig, AXMFolderServiceImpl, AXMFolderService } from '@acorex/modules/document-management';
3
+ import { RootConfig as RootConfig$3, AXMNotificationEntityService } from '@acorex/modules/notification-management';
3
4
  import * as i1$1 from '@acorex/platform/auth';
4
- import { AXPSessionService, AXPAuthModule } from '@acorex/platform/auth';
5
- import { AXPDataGenerator, AXPDexieEntityStorageService, AXP_DATA_SEEDER_TOKEN, AXPEntityStorageService, AXPRegionalService, AXPFileStorageStatus, AXPFileStorageService, AXP_SEARCH_PROVIDER } from '@acorex/platform/common';
5
+ import { AXPSessionService, AXPPermissionProviderService, AXPAuthModule } from '@acorex/platform/auth';
6
+ import { AXPDataGenerator, AXPRegionalService, AXPFileStorageStatus, AXPFileStorageService, AXP_SEARCH_PROVIDER } from '@acorex/platform/common';
7
+ import { AXPDexieEntityStorageService, AXPEntityDefinitionRegistryService, AXP_DATA_SEEDER_TOKEN, AXPEntityStorageService } from '@acorex/platform/layout/entity';
6
8
  import * as i0 from '@angular/core';
7
9
  import { inject, Injectable, NgModule } from '@angular/core';
8
- import { AXPEntityDefinitionRegistryService } from '@acorex/platform/layout/entity';
9
10
  import * as i1 from '@acorex/modules/conversation';
10
11
  import { AXMConverstionModuleConst, AXMChatServiceImpl, AXMCommentServiceImpl, AXMChatModule, AXMChatService } from '@acorex/modules/conversation';
12
+ import { AXPDataGenerator as AXPDataGenerator$1 } from '@acorex/platform/core';
11
13
  import Dexie from 'dexie';
12
14
  import { AXP_WIDGET_DATASOURCE_PROVIDER } from '@acorex/platform/layout/builder';
15
+ import { RootConfig as RootConfig$1 } from '@acorex/modules/form-template-management';
13
16
  import { convertArrayToDataSource } from '@acorex/components/common';
14
- import { RootConfig } from '@acorex/modules/form-template-management';
15
- import { AXMOrganizationNodeType, RootConfig as RootConfig$2 } from '@acorex/modules/organization-management';
16
- import { RootConfig as RootConfig$3 } from '@acorex/modules/platform-management';
17
+ import { RootConfig as RootConfig$2 } from '@acorex/modules/security-management';
18
+ import { AXMOrganizationNodeType, RootConfig as RootConfig$4 } from '@acorex/modules/organization-management';
19
+ import { RootConfig as RootConfig$5 } from '@acorex/modules/platform-management';
17
20
  import { AXTranslationService } from '@acorex/core/translation';
18
21
  import { firstValueFrom } from 'rxjs';
19
22
  import { AXFileService } from '@acorex/core/file';
20
- import { RootConfig as RootConfig$4 } from '@acorex/modules/scheduler-job-management';
21
- import { RootConfig as RootConfig$5 } from '@acorex/modules/text-template-management';
23
+ import { RootConfig as RootConfig$6 } from '@acorex/modules/scheduler-job-management';
24
+ import { RootConfig as RootConfig$7 } from '@acorex/modules/text-template-management';
22
25
 
23
26
  const APPLICATIONS = Array.from({ length: 5 }).map((_, i) => {
24
27
  const source = ['appOne', 'appTwo', 'appThree', 'myCoolApp', 'awesomeApp', 'superApp'];
@@ -547,6 +550,414 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
547
550
  }]
548
551
  }] });
549
552
 
553
+ const DocumentTypeMocks = [
554
+ {
555
+ id: AXPDataGenerator$1.uuid(),
556
+ name: 'OHS',
557
+ title: 'Occupational Health and Safety Policy',
558
+ maxSize: 5000,
559
+ isEncrypted: false,
560
+ meta: [
561
+ {
562
+ name: 'checkbox',
563
+ title: 'Check Box',
564
+ interface: '{"type":"document-layout","children":[{"type":"page-layout","children":[{"type":"checkbox-editor","name":"checkbox-editor1","options":{"label":"i accept","readonly":false,"disabled":false},"defaultValue":false,"path":"accept-check-box"}],"name":"page-layout1"}],"name":"document"}',
565
+ },
566
+ ],
567
+ type: {
568
+ selectedItems: [
569
+ {
570
+ name: 'image.jpg',
571
+ title: 'Image/JPEG',
572
+ icon: 'fa-light fa-image ax-text-purple-500',
573
+ },
574
+ {
575
+ name: 'image.png',
576
+ title: 'Image/PNG',
577
+ icon: 'fa-light fa-image ax-text-purple-500',
578
+ },
579
+ {
580
+ name: 'image.gif',
581
+ title: 'Image/GIF',
582
+ icon: 'fa-light fa-image ax-text-purple-500',
583
+ },
584
+ ],
585
+ context: {
586
+ image: {
587
+ width: '22',
588
+ height: '33',
589
+ },
590
+ gift: {
591
+ duration: '11',
592
+ },
593
+ },
594
+ },
595
+ },
596
+ {
597
+ id: AXPDataGenerator$1.uuid(),
598
+ name: 'WHS',
599
+ title: 'Workplace Health and Safety Guidelines',
600
+ maxSize: 10000,
601
+ isEncrypted: true,
602
+ meta: [{ name: 'external', title: 'External', interface: '' }],
603
+ type: {
604
+ selectedItems: [
605
+ {
606
+ name: 'audio.mp3',
607
+ title: 'MP3',
608
+ icon: 'fa-light fa-file-audio ax-text-green-500',
609
+ },
610
+ {
611
+ name: 'audio.wav',
612
+ title: 'WAV',
613
+ icon: 'fa-light fa-file-audio ax-text-green-500',
614
+ },
615
+ ],
616
+ context: {
617
+ audio: {
618
+ bitrate: '320',
619
+ duration: '180',
620
+ },
621
+ },
622
+ },
623
+ },
624
+ ];
625
+
626
+ class AXCDocumentTypeDataSeeder {
627
+ constructor() {
628
+ this.storageService = inject(AXPDexieEntityStorageService);
629
+ }
630
+ async seed() {
631
+ await this.storageService.initial(`${RootConfig.module.name}.${RootConfig.entities.documentType.name}`, DocumentTypeMocks);
632
+ }
633
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCDocumentTypeDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
634
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCDocumentTypeDataSeeder }); }
635
+ }
636
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCDocumentTypeDataSeeder, decorators: [{
637
+ type: Injectable
638
+ }] });
639
+
640
+ const allFolders = [];
641
+ const allFiles = [];
642
+ const rootFolder = {
643
+ id: AXPDataGenerator$1.uuid(),
644
+ name: 'WHS Documentation',
645
+ color: '#FFFFFF',
646
+ description: 'Root folder for WHS/OHS Documentation',
647
+ parentId: undefined,
648
+ isSystem: true,
649
+ isHidden: false,
650
+ isDeleted: false,
651
+ createdAt: new Date(),
652
+ updatedAt: new Date(),
653
+ createdBy: 'system',
654
+ updatedBy: 'system',
655
+ folders: [],
656
+ documents: [],
657
+ };
658
+ // Updated sample file types with WHS/OHS specific examples
659
+ const sampleFileTypes = [
660
+ {
661
+ ext: 'pdf',
662
+ titles: [
663
+ 'Risk Assessment Report',
664
+ 'Safety Audit Checklist',
665
+ 'Emergency Response Plan',
666
+ 'Safety Training Manual'
667
+ ]
668
+ },
669
+ {
670
+ ext: 'docx',
671
+ titles: [
672
+ 'Incident Investigation Form',
673
+ 'Safety Meeting Minutes',
674
+ 'Hazard Report Template',
675
+ 'Safe Work Procedure'
676
+ ]
677
+ },
678
+ {
679
+ ext: 'xlsx',
680
+ titles: [
681
+ 'Incident Statistics',
682
+ 'Safety Training Matrix',
683
+ 'PPE Inventory List',
684
+ 'Risk Register'
685
+ ]
686
+ },
687
+ {
688
+ ext: 'jpg',
689
+ titles: [
690
+ 'Hazard Photo',
691
+ 'Safety Signage',
692
+ 'Emergency Exit Plan',
693
+ 'PPE Requirements Chart'
694
+ ]
695
+ },
696
+ {
697
+ ext: 'png',
698
+ titles: [
699
+ 'Safety Infographic',
700
+ 'Evacuation Map',
701
+ 'Incident Scene Photo',
702
+ 'Safety Procedure Diagram'
703
+ ]
704
+ },
705
+ {
706
+ ext: 'pptx',
707
+ titles: [
708
+ 'Safety Induction',
709
+ 'WHS Training Module',
710
+ 'Safety Committee Presentation',
711
+ 'Toolbox Talk'
712
+ ]
713
+ }
714
+ ];
715
+ const sites = ['Main Factory', 'Warehouse Complex', 'Office Building', 'Construction Site'];
716
+ const whsFolders = [
717
+ {
718
+ name: 'Policies and Procedures',
719
+ subFolders: ['Safety Policies', 'Standard Operating Procedures', 'Emergency Procedures', 'Work Instructions'],
720
+ commonFiles: ['WHS Policy Manual.pdf', 'Emergency Response Plan.pdf', 'Safety Management System.docx', 'Risk Management Framework.pdf']
721
+ },
722
+ {
723
+ name: 'Risk Management',
724
+ subFolders: ['Risk Assessments', 'Hazard Reports', 'Control Measures', 'Safety Audits'],
725
+ commonFiles: ['Risk Assessment Matrix.xlsx', 'Hazard Register.xlsx', 'Control Measure Checklist.pdf', 'Audit Schedule.xlsx']
726
+ },
727
+ {
728
+ name: 'Incident Management',
729
+ subFolders: ['Incident Reports', 'Investigations', 'Corrective Actions', 'Statistics'],
730
+ commonFiles: ['Incident Report Form.docx', 'Investigation Guidelines.pdf', 'Corrective Action Register.xlsx', 'Monthly Statistics.xlsx']
731
+ },
732
+ {
733
+ name: 'Training and Compliance',
734
+ subFolders: ['Training Records', 'Certifications', 'Competency Assessments', 'Toolbox Talks'],
735
+ commonFiles: ['Training Matrix.xlsx', 'Induction Package.pdf', 'Competency Framework.docx', 'Training Calendar.xlsx']
736
+ },
737
+ {
738
+ name: 'Safety Equipment',
739
+ subFolders: ['PPE Records', 'Equipment Inspections', 'Maintenance Records', 'Safety Data Sheets'],
740
+ commonFiles: ['PPE Register.xlsx', 'Equipment Maintenance Schedule.xlsx', 'Safety Equipment Inventory.xlsx', 'PPE Guidelines.pdf']
741
+ }
742
+ ];
743
+ sites.forEach((site) => {
744
+ const siteFolderId = AXPDataGenerator$1.uuid();
745
+ const siteFolder = {
746
+ id: siteFolderId,
747
+ name: site,
748
+ color: '#FFFFFF',
749
+ description: `WHS Documentation for ${site}`,
750
+ parentId: rootFolder.id,
751
+ isSystem: false,
752
+ isHidden: false,
753
+ isDeleted: false,
754
+ createdAt: new Date(),
755
+ updatedAt: new Date(),
756
+ createdBy: 'system',
757
+ updatedBy: 'system',
758
+ tenantId: site,
759
+ userId: undefined,
760
+ folders: [],
761
+ documents: [],
762
+ };
763
+ const safetyRoles = ['Safety Officer', 'Site Supervisor', 'WHS Representative'];
764
+ safetyRoles.forEach((role) => {
765
+ const roleFolderId = AXPDataGenerator$1.uuid();
766
+ const roleFolder = {
767
+ id: roleFolderId,
768
+ name: role,
769
+ color: '#FFFFFF',
770
+ description: `${role} Documentation`,
771
+ parentId: siteFolder.id,
772
+ isSystem: false,
773
+ isHidden: false,
774
+ isDeleted: false,
775
+ createdAt: new Date(),
776
+ updatedAt: new Date(),
777
+ createdBy: 'system',
778
+ updatedBy: 'system',
779
+ tenantId: site,
780
+ userId: role.toLowerCase().replace(/\s+/g, '_'),
781
+ folders: [],
782
+ documents: [],
783
+ };
784
+ sampleFileTypes.forEach((fileType) => {
785
+ fileType.titles.forEach((title) => {
786
+ if (Math.random() > 0.5) {
787
+ const file = {
788
+ id: AXPDataGenerator$1.uuid(),
789
+ name: `${title.toLowerCase().replace(/\s+/g, '-')}.${fileType.ext}`,
790
+ title: title,
791
+ parentId: roleFolderId,
792
+ };
793
+ allFiles.push(file);
794
+ roleFolder.documents?.push(file);
795
+ }
796
+ });
797
+ });
798
+ siteFolder.folders?.push(roleFolder);
799
+ allFolders.push(roleFolder);
800
+ });
801
+ whsFolders.forEach((dept) => {
802
+ const deptFolderId = AXPDataGenerator$1.uuid();
803
+ const deptFolder = {
804
+ id: deptFolderId,
805
+ name: dept.name,
806
+ color: '#' + Math.floor(Math.random() * 16777215).toString(16),
807
+ description: `${dept.name} documentation`,
808
+ parentId: siteFolder.id,
809
+ isSystem: false,
810
+ isHidden: false,
811
+ isDeleted: false,
812
+ createdAt: new Date(),
813
+ updatedAt: new Date(),
814
+ createdBy: 'system',
815
+ updatedBy: 'system',
816
+ tenantId: site,
817
+ folders: [],
818
+ documents: [],
819
+ };
820
+ dept.commonFiles.forEach((fileName) => {
821
+ const file = {
822
+ id: AXPDataGenerator$1.uuid(),
823
+ name: fileName,
824
+ title: fileName.split('.')[0],
825
+ parentId: deptFolderId,
826
+ };
827
+ allFiles.push(file);
828
+ deptFolder.documents?.push(file);
829
+ });
830
+ dept.subFolders.forEach((subFolderName) => {
831
+ const subFolderId = AXPDataGenerator$1.uuid();
832
+ const subFolder = {
833
+ id: subFolderId,
834
+ name: subFolderName,
835
+ color: '#' + Math.floor(Math.random() * 16777215).toString(16),
836
+ description: `${subFolderName} documentation`,
837
+ parentId: deptFolderId,
838
+ isSystem: false,
839
+ isHidden: false,
840
+ isDeleted: false,
841
+ createdAt: new Date(),
842
+ updatedAt: new Date(),
843
+ createdBy: 'system',
844
+ updatedBy: 'system',
845
+ tenantId: site,
846
+ folders: [],
847
+ documents: [],
848
+ };
849
+ sampleFileTypes.forEach((fileType) => {
850
+ fileType.titles.forEach((title) => {
851
+ if (Math.random() > 0.7) {
852
+ const file = {
853
+ id: AXPDataGenerator$1.uuid(),
854
+ name: `${title.toLowerCase().replace(/\s+/g, '-')}.${fileType.ext}`,
855
+ title: title,
856
+ parentId: subFolderId,
857
+ };
858
+ allFiles.push(file);
859
+ subFolder.documents?.push(file);
860
+ }
861
+ });
862
+ });
863
+ deptFolder.folders?.push(subFolder);
864
+ allFolders.push(subFolder);
865
+ });
866
+ siteFolder.folders?.push(deptFolder);
867
+ allFolders.push(deptFolder);
868
+ });
869
+ rootFolder.folders?.push(siteFolder);
870
+ allFolders.push(siteFolder);
871
+ });
872
+ allFolders.push(rootFolder);
873
+ const FOLDER_MOCK_DATA = allFolders;
874
+ const FILE_MOCK_DATA = allFiles;
875
+
876
+ class AXCFolderDataSeeder {
877
+ constructor() {
878
+ this.storageService = inject(AXPDexieEntityStorageService);
879
+ }
880
+ async seed() {
881
+ await this.storageService.initial(`${RootConfig.module.name}.${RootConfig.entities.folder.name}`, FOLDER_MOCK_DATA);
882
+ }
883
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCFolderDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
884
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCFolderDataSeeder }); }
885
+ }
886
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCFolderDataSeeder, decorators: [{
887
+ type: Injectable
888
+ }] });
889
+
890
+ class AXMFolderMockService extends AXMFolderServiceImpl {
891
+ async updateParentFolders(folder) {
892
+ if (folder.parentId) {
893
+ const parent = await this.getOne(folder.parentId);
894
+ if (parent && parent.id) {
895
+ if (!parent.folders) {
896
+ parent.folders = [];
897
+ }
898
+ const existingIndex = parent.folders.findIndex((f) => f.id === folder.id);
899
+ if (existingIndex === -1) {
900
+ parent.folders.push(folder);
901
+ }
902
+ else {
903
+ parent.folders[existingIndex] = folder;
904
+ }
905
+ await super.updateOne(parent.id, { folders: parent.folders });
906
+ await this.updateParentFolders(parent);
907
+ }
908
+ }
909
+ }
910
+ async removeFromParent(folder) {
911
+ if (folder.parentId) {
912
+ const parent = await this.getOne(folder.parentId);
913
+ if (parent && parent.id && parent.folders) {
914
+ parent.folders = parent.folders.filter((f) => f.id !== folder.id);
915
+ await super.updateOne(parent.id, { folders: parent.folders });
916
+ await this.updateParentFolders(parent);
917
+ }
918
+ }
919
+ }
920
+ async insertOne(request) {
921
+ const newId = await super.insertOne(request);
922
+ const folderData = {
923
+ ...request,
924
+ id: newId,
925
+ };
926
+ await this.updateParentFolders(folderData);
927
+ return newId;
928
+ }
929
+ async updateOne(id, values) {
930
+ const currentFolder = await this.getOne(id);
931
+ const updatedFolder = await super.updateOne(id, values);
932
+ if (currentFolder && values.parentId !== undefined && currentFolder.parentId !== values.parentId) {
933
+ await this.removeFromParent(currentFolder);
934
+ }
935
+ await this.updateParentFolders(updatedFolder);
936
+ return updatedFolder;
937
+ }
938
+ async deleteOne(id) {
939
+ const folderToDelete = await this.getOne(id);
940
+ if (folderToDelete) {
941
+ await this.removeFromParent(folderToDelete);
942
+ await super.deleteOne(id);
943
+ }
944
+ }
945
+ async getPath(folderId) {
946
+ const path = [];
947
+ let currentId = folderId;
948
+ while (currentId) {
949
+ const folder = await this.getOne(currentId);
950
+ if (!folder) {
951
+ // Folder not found in persisted storage
952
+ break;
953
+ }
954
+ path.push(folder);
955
+ currentId = folder.parentId ?? null;
956
+ }
957
+ return path.reverse();
958
+ }
959
+ }
960
+
550
961
  class EntitySearchProvider {
551
962
  async search(text) {
552
963
  const db = new Dexie('ACoreXPlatform');
@@ -561,11 +972,16 @@ class EntitySearchProvider {
561
972
  return filteredRecords.map((record) => ({
562
973
  group: `Module.${record.entityName}`,
563
974
  data: record,
564
- commands: {
565
- 'open-entity': {
975
+ command: {
976
+ // 'open-entity': {
977
+ // entity: record.entityName,
978
+ // data: record,
979
+ // },
980
+ name: 'open-entity',
981
+ options: {
566
982
  entity: record.entityName,
567
983
  data: record,
568
- },
984
+ }
569
985
  },
570
986
  }));
571
987
  }
@@ -588,6 +1004,83 @@ class EntitySearchProvider {
588
1004
  }
589
1005
  }
590
1006
 
1007
+ class AXPFormTemplateCategoryDataSeeder {
1008
+ constructor() {
1009
+ this.storageService = inject(AXPDexieEntityStorageService);
1010
+ }
1011
+ async seed() {
1012
+ await this.storageService.initial(`${RootConfig$1.module.name}.${RootConfig$1.entities.category.name}`, this.generateCategories());
1013
+ }
1014
+ generateCategories() {
1015
+ const categories = [];
1016
+ const rootCategories = [
1017
+ 'Risk Assessment',
1018
+ 'Servicing',
1019
+ 'Checklists',
1020
+ 'Incident Reporting',
1021
+ 'Emergency Procedures',
1022
+ 'Hazardous Materials',
1023
+ 'PPE (Personal Protective Equipment)',
1024
+ 'Workplace Ergonomics',
1025
+ 'Equipment Safety',
1026
+ 'Fire Safety',
1027
+ 'First Aid',
1028
+ 'Manual Handling',
1029
+ 'Electrical Safety',
1030
+ 'Confined Spaces',
1031
+ 'Chemical Safety',
1032
+ ];
1033
+ rootCategories.forEach((title) => {
1034
+ const categoryId = AXPDataGenerator.uuid();
1035
+ categories.push({ id: categoryId, title, parentId: undefined });
1036
+ });
1037
+ const childCategories = [
1038
+ {
1039
+ parent: 'Risk Assessment',
1040
+ children: ['Job Safety Analysis', 'Task Risk Assessment', 'General Hazard Identification'],
1041
+ },
1042
+ { parent: 'Incident Reporting', children: ['Near Miss Reports', 'Accident Reports', 'Injury Logs'] },
1043
+ {
1044
+ parent: 'Emergency Procedures',
1045
+ children: ['Fire Evacuation', 'Medical Emergencies', 'Chemical Spill Response'],
1046
+ },
1047
+ {
1048
+ parent: 'Hazardous Materials',
1049
+ children: ['Material Safety Data Sheets', 'Storage & Handling', 'Hazardous Waste Disposal'],
1050
+ },
1051
+ {
1052
+ parent: 'PPE (Personal Protective Equipment)',
1053
+ children: ['Protective Gloves', 'Eye Protection', 'Hearing Protection'],
1054
+ },
1055
+ { parent: 'Workplace Ergonomics', children: ['Seating Arrangements', 'Lifting Techniques', 'Workstation Setup'] },
1056
+ { parent: 'Equipment Safety', children: ['Machine Guarding', 'Lockout/Tagout', 'Inspection Procedures'] },
1057
+ { parent: 'Fire Safety', children: ['Fire Extinguishers', 'Fire Drills', 'Smoke Alarms'] },
1058
+ { parent: 'First Aid', children: ['CPR Training', 'First Aid Kits', 'Emergency Contacts'] },
1059
+ { parent: 'Manual Handling', children: ['Proper Lifting', 'Load Limits', 'Back Injury Prevention'] },
1060
+ {
1061
+ parent: 'Electrical Safety',
1062
+ children: ['Grounding & Wiring', 'High Voltage Procedures', 'Portable Equipment Checks'],
1063
+ },
1064
+ { parent: 'Confined Spaces', children: ['Permit-Required Spaces', 'Ventilation Protocols', 'Rescue Plans'] },
1065
+ { parent: 'Chemical Safety', children: ['Chemical Labeling', 'Exposure Limits', 'Emergency Showers'] },
1066
+ ];
1067
+ childCategories.forEach(({ parent, children }) => {
1068
+ const parentId = categories.find((c) => c.title === parent)?.id;
1069
+ if (parentId) {
1070
+ children.forEach((title) => {
1071
+ categories.push({ id: AXPDataGenerator.uuid(), title, parentId });
1072
+ });
1073
+ }
1074
+ });
1075
+ return categories;
1076
+ }
1077
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPFormTemplateCategoryDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1078
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPFormTemplateCategoryDataSeeder }); }
1079
+ }
1080
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPFormTemplateCategoryDataSeeder, decorators: [{
1081
+ type: Injectable
1082
+ }] });
1083
+
591
1084
  class AXPMockWidgetDataSourceProvider {
592
1085
  async items() {
593
1086
  return [
@@ -635,33 +1128,6 @@ class AXPMockWidgetDataSourceProvider {
635
1128
  }
636
1129
  }
637
1130
 
638
- class AXPFormTemplateCategoryDataSeeder {
639
- constructor() {
640
- this.storageService = inject(AXPDexieEntityStorageService);
641
- }
642
- async seed() {
643
- await this.storageService.initial(`${RootConfig.module.name}.${RootConfig.entities.category.name}`, [
644
- {
645
- id: AXPDataGenerator.uuid(),
646
- title: 'Risk Assessment'
647
- },
648
- {
649
- id: AXPDataGenerator.uuid(),
650
- title: 'Servicing'
651
- },
652
- {
653
- id: AXPDataGenerator.uuid(),
654
- title: 'Checklists'
655
- }
656
- ]);
657
- }
658
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPFormTemplateCategoryDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
659
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPFormTemplateCategoryDataSeeder }); }
660
- }
661
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPFormTemplateCategoryDataSeeder, decorators: [{
662
- type: Injectable
663
- }] });
664
-
665
1131
  class AXCFormTemplateManagementMockModule {
666
1132
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCFormTemplateManagementMockModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
667
1133
  static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.3", ngImport: i0, type: AXCFormTemplateManagementMockModule }); }
@@ -700,11 +1166,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
700
1166
  }] });
701
1167
 
702
1168
  class MOCKStrategy {
703
- constructor() { }
1169
+ constructor() {
1170
+ this.entityRegistery = inject(AXPEntityDefinitionRegistryService);
1171
+ }
704
1172
  get name() {
705
1173
  return 'user-pass';
706
1174
  }
707
1175
  async signin(credentials) {
1176
+ const entityRef = await this.entityRegistery.resolve(RootConfig$2.module.name, RootConfig$2.entities.users.name);
1177
+ const accessToken = 'access_token';
1178
+ const refreshToken = 'refresh_token';
708
1179
  try {
709
1180
  if (credentials.username == 'root' && credentials.password == '123') {
710
1181
  const user = {
@@ -713,8 +1184,6 @@ class MOCKStrategy {
713
1184
  title: 'Root User',
714
1185
  avatar: 'https://avatar.iran.liara.run/public/29',
715
1186
  };
716
- const accessToken = 'access_token';
717
- const refreshToken = 'refresh_token';
718
1187
  return {
719
1188
  succeed: true,
720
1189
  data: { user, accessToken, refreshToken },
@@ -727,8 +1196,6 @@ class MOCKStrategy {
727
1196
  title: 'Admin User',
728
1197
  avatar: 'https://avatar.iran.liara.run/public/47',
729
1198
  };
730
- const accessToken = 'access_token';
731
- const refreshToken = 'refresh_token';
732
1199
  return {
733
1200
  succeed: true,
734
1201
  data: { user, accessToken, refreshToken },
@@ -748,6 +1215,25 @@ class MOCKStrategy {
748
1215
  data: { user, accessToken, refreshToken },
749
1216
  };
750
1217
  }
1218
+ else {
1219
+ const func = entityRef?.queries.list?.execute;
1220
+ const users = await func({
1221
+ skip: 0,
1222
+ take: 1000,
1223
+ });
1224
+ const currentUser = users.items.find((u) => u.username === credentials.username && u.password === credentials.password);
1225
+ if (currentUser) {
1226
+ const user = {
1227
+ id: currentUser.id,
1228
+ name: currentUser.username,
1229
+ title: `${currentUser.firstname} ${currentUser.lastname}`,
1230
+ };
1231
+ return {
1232
+ succeed: true,
1233
+ data: { user, accessToken, refreshToken },
1234
+ };
1235
+ }
1236
+ }
751
1237
  return {
752
1238
  succeed: false,
753
1239
  };
@@ -866,7 +1352,7 @@ class AXCNotificationTemplateDataSeeder {
866
1352
  this.storageService = inject(AXPDexieEntityStorageService);
867
1353
  }
868
1354
  async seed() {
869
- await this.storageService.initial(`${RootConfig$1.module.name}.${RootConfig$1.entities.template.name}`, NOTIFICATION_TEMPLATES);
1355
+ await this.storageService.initial(`${RootConfig$3.module.name}.${RootConfig$3.entities.template.name}`, NOTIFICATION_TEMPLATES);
870
1356
  }
871
1357
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCNotificationTemplateDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
872
1358
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCNotificationTemplateDataSeeder }); }
@@ -1421,7 +1907,7 @@ class AXCOrganizationManagementDataSeeder {
1421
1907
  async seed() {
1422
1908
  const uuid = AXPDataGenerator.uuid;
1423
1909
  // Departments
1424
- await this.storageService.initial(RootConfig$2.entities.department.source, [
1910
+ await this.storageService.initial(RootConfig$4.entities.department.source, [
1425
1911
  {
1426
1912
  id: uuid(),
1427
1913
  title: 'Engineering Division',
@@ -1439,7 +1925,7 @@ class AXCOrganizationManagementDataSeeder {
1439
1925
  },
1440
1926
  ]);
1441
1927
  // Divisions
1442
- await this.storageService.initial(RootConfig$2.entities.division.source, [
1928
+ await this.storageService.initial(RootConfig$4.entities.division.source, [
1443
1929
  {
1444
1930
  id: uuid(),
1445
1931
  title: 'Software Development',
@@ -1457,7 +1943,7 @@ class AXCOrganizationManagementDataSeeder {
1457
1943
  },
1458
1944
  ]);
1459
1945
  // Branches
1460
- await this.storageService.initial(RootConfig$2.entities.branch.source, [
1946
+ await this.storageService.initial(RootConfig$4.entities.branch.source, [
1461
1947
  {
1462
1948
  id: uuid(),
1463
1949
  title: 'San Francisco Office',
@@ -1475,7 +1961,7 @@ class AXCOrganizationManagementDataSeeder {
1475
1961
  },
1476
1962
  ]);
1477
1963
  // Positions
1478
- await this.storageService.initial(RootConfig$2.entities.position.source, [
1964
+ await this.storageService.initial(RootConfig$4.entities.position.source, [
1479
1965
  {
1480
1966
  id: uuid(),
1481
1967
  title: 'Backend Developer',
@@ -1508,7 +1994,7 @@ class AXCOrganizationManagementDataSeeder {
1508
1994
  },
1509
1995
  ]);
1510
1996
  // Employment Types
1511
- await this.storageService.initial(RootConfig$2.entities.employmentType.source, [
1997
+ await this.storageService.initial(RootConfig$4.entities.employmentType.source, [
1512
1998
  {
1513
1999
  id: uuid(),
1514
2000
  title: 'Full-Time',
@@ -1536,7 +2022,7 @@ class AXCOrganizationManagementDataSeeder {
1536
2022
  },
1537
2023
  ]);
1538
2024
  // Employees
1539
- await this.storageService.initial(RootConfig$2.entities.employee.source, [
2025
+ await this.storageService.initial(RootConfig$4.entities.employee.source, [
1540
2026
  { id: uuid(), firstname: 'Jane', lastname: 'Smith', birthDate: new Date('1985-02-15'), employeeID: 'EMP002' },
1541
2027
  {
1542
2028
  id: uuid(),
@@ -1560,11 +2046,11 @@ class AXCOrganizationManagementDataSeeder {
1560
2046
  { id: uuid(), firstname: 'Vikram', lastname: 'Singh', birthDate: new Date('1982-07-14'), employeeID: 'EMP007' },
1561
2047
  ]);
1562
2048
  // Store Chart Data
1563
- await this.storageService.initial(RootConfig$2.entities.chart.source, [
2049
+ await this.storageService.initial(RootConfig$4.entities.chart.source, [
1564
2050
  {
1565
2051
  id: uuid(),
1566
2052
  version: '1.0',
1567
- data: PERSIAN_COMPANY_ORGANIZATION,
2053
+ data: SOFTWARE_COMPANY_ORGANIZATION,
1568
2054
  },
1569
2055
  ]);
1570
2056
  }
@@ -1686,7 +2172,7 @@ class AXCAppTermDataSeeder {
1686
2172
  this.storageService = inject(AXPDexieEntityStorageService);
1687
2173
  }
1688
2174
  async seed() {
1689
- await this.storageService.initial(`${RootConfig$3.module.name}.${RootConfig$3.entities.appTerm.name}`, APP_TERMS);
2175
+ await this.storageService.initial(`${RootConfig$5.module.name}.${RootConfig$5.entities.appTerm.name}`, APP_TERMS);
1690
2176
  }
1691
2177
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCAppTermDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1692
2178
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCAppTermDataSeeder }); }
@@ -1697,7 +2183,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
1697
2183
 
1698
2184
  const changeLog = [];
1699
2185
  for (let i = 0; i < 10; i++) {
1700
- changeLog.push(`This is a detailed description of the changes made in version 1.5.3${i}.
2186
+ changeLog.push(`This is a detailed description of the changes made in version 1.6.0${i}.
1701
2187
  It includes various updates, bug fixes, and improvements.
1702
2188
  The changes are extensive and cover multiple aspects of the application,
1703
2189
  ensuring better performance, enhanced security, and a more user-friendly interface.
@@ -1709,7 +2195,7 @@ const APP_VERSIONS = Array.from({ length: 10 }).map((element, i) => {
1709
2195
  publishDate.setDate(publishDate.getDate() - i * 7); // Subtract i weeks from the current date
1710
2196
  return {
1711
2197
  id: AXPDataGenerator.uuid(),
1712
- versionNumber: `1.5.3${i}`,
2198
+ versionNumber: `1.6.0${i}`,
1713
2199
  changeLog: changeLog[i],
1714
2200
  publishDate: publishDate.toString(),
1715
2201
  showFirstTimePopup: true,
@@ -1721,7 +2207,7 @@ class AXCAppVersionDataSeeder {
1721
2207
  this.storageService = inject(AXPDexieEntityStorageService);
1722
2208
  }
1723
2209
  async seed() {
1724
- await this.storageService.initial(`${RootConfig$3.module.name}.${RootConfig$3.entities.appVersion.name}`, APP_VERSIONS);
2210
+ await this.storageService.initial(`${RootConfig$5.module.name}.${RootConfig$5.entities.appVersion.name}`, APP_VERSIONS);
1725
2211
  }
1726
2212
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCAppVersionDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1727
2213
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCAppVersionDataSeeder }); }
@@ -1752,7 +2238,7 @@ class AXCGlobalVariablesDataSeeder {
1752
2238
  this.storageService = inject(AXPDexieEntityStorageService);
1753
2239
  }
1754
2240
  async seed() {
1755
- await this.storageService.initial(`${RootConfig$3.module.name}.${RootConfig$3.entities.globalVariable.name}`, GLOBAL_VARIABLES);
2241
+ await this.storageService.initial(`${RootConfig$5.module.name}.${RootConfig$5.entities.globalVariable.name}`, GLOBAL_VARIABLES);
1756
2242
  }
1757
2243
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCGlobalVariablesDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1758
2244
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCGlobalVariablesDataSeeder }); }
@@ -1781,11 +2267,11 @@ class AXCRegionalServiceImpl extends AXPRegionalService {
1781
2267
  }
1782
2268
  });
1783
2269
  }
1784
- async getProvinces(countryCode) {
2270
+ async getProvinces(countryId) {
1785
2271
  const lang = await firstValueFrom(this.languageService.langChanges$);
1786
2272
  const country = await this.getCountries();
1787
2273
  const data = country
1788
- .filter((c) => !countryCode || c.code === countryCode)
2274
+ .filter((c) => !countryId || c.code === countryId)
1789
2275
  .flatMap((c) => c.provinces?.map((province) => {
1790
2276
  if (lang == c.regional) {
1791
2277
  return {
@@ -1981,6 +2467,39 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
1981
2467
  type: Injectable
1982
2468
  }], ctorParameters: () => [] });
1983
2469
 
2470
+ const checkbox = '{"type":"document-layout","children":[{"type":"page-layout","children":[{"type":"checkbox-editor","name":"checkbox-editor1","options":{"label":"i accept","readonly":false,"disabled":false},"defaultValue":false,"path":"accept-check-box"}],"name":"page-layout1"}],"name":"document"}';
2471
+ const color = '{"type":"document-layout","children":[{"type":"page-layout","children":[{"type":"block-layout","name":"block-layout1","options":{"flexDirection":{"id":"ax-flex-row"},"flexJustifyContent":{"id":"ax-justify-normal"},"flexAlignItems":{"id":"ax-items-start"},"gap":2,"flexWrap":{"id":"ax-flex-nowrap"},"spacing":{"margin":"0px 0px 0px 0px","padding":"0px 0px 0px 0px"},"border":{"width":"0px","radius":"0px","color":"#000000","style":"none"},"flexOptions":{"gap":"0px","flexDirection":"row","flexWrap":"nowrap","justifyContent":"flex-start","alignItems":"flex-start"}}},"children":[{"type":"color-editor","name":"color-editor1","options":{"readonly":false,"disabled":false,"validations":{"required":{"rule":"required","message":"This field is required."}},"placeholder":"pick color"},"path":"color-box"}]}],"name":"page-layout1"}],"name":"document"}';
2472
+ const METADATA_MOCK = [
2473
+ {
2474
+ id: AXPDataGenerator$1.uuid(),
2475
+ name: 'checkbox',
2476
+ title: 'Checkbox',
2477
+ defaultValue: false,
2478
+ interface: checkbox,
2479
+ },
2480
+ {
2481
+ id: AXPDataGenerator$1.uuid(),
2482
+ name: 'color',
2483
+ title: 'Color',
2484
+ defaultValue: '#000000',
2485
+ interface: color,
2486
+ },
2487
+ ];
2488
+
2489
+ class AXCMetaDataDefinitionDataSeeder {
2490
+ constructor() {
2491
+ this.storageService = inject(AXPDexieEntityStorageService);
2492
+ }
2493
+ async seed() {
2494
+ await this.storageService.initial(`${RootConfig$5.module.name}.${RootConfig$5.entities.metaDataDefinition.name}`, METADATA_MOCK);
2495
+ }
2496
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCMetaDataDefinitionDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
2497
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCMetaDataDefinitionDataSeeder }); }
2498
+ }
2499
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCMetaDataDefinitionDataSeeder, decorators: [{
2500
+ type: Injectable
2501
+ }] });
2502
+
1984
2503
  const SCHEDULER_JOB = [
1985
2504
  {
1986
2505
  id: AXPDataGenerator.uuid(),
@@ -2003,7 +2522,7 @@ class AXCSchedulerJobDataSeeder {
2003
2522
  this.storageService = inject(AXPDexieEntityStorageService);
2004
2523
  }
2005
2524
  async seed() {
2006
- await this.storageService.initial(`${RootConfig$4.module.name}.${RootConfig$4.entities.schedulerJob.name}`, SCHEDULER_JOB);
2525
+ await this.storageService.initial(`${RootConfig$6.module.name}.${RootConfig$6.entities.schedulerJob.name}`, SCHEDULER_JOB);
2007
2526
  }
2008
2527
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCSchedulerJobDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
2009
2528
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCSchedulerJobDataSeeder }); }
@@ -2012,6 +2531,359 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
2012
2531
  type: Injectable
2013
2532
  }] });
2014
2533
 
2534
+ class AXPSecurityManagementMockWidgetDataSourceProvider {
2535
+ async items() {
2536
+ return [
2537
+ {
2538
+ name: 'mock.securityUsers',
2539
+ title: 'Security Users',
2540
+ valueField: 'id',
2541
+ textField: 'displayName',
2542
+ columns: [
2543
+ {
2544
+ name: 'id',
2545
+ title: 'Id',
2546
+ },
2547
+ {
2548
+ name: 'username',
2549
+ title: 'Username',
2550
+ },
2551
+ {
2552
+ name: 'displayName',
2553
+ title: 'Display Name',
2554
+ },
2555
+ ],
2556
+ samples: [
2557
+ {
2558
+ id: '1',
2559
+ username: 'johndoe',
2560
+ displayName: 'John Doe',
2561
+ },
2562
+ {
2563
+ id: '2',
2564
+ username: 'janesmith',
2565
+ displayName: 'Jane Smith',
2566
+ },
2567
+ ],
2568
+ source: () => convertArrayToDataSource([
2569
+ {
2570
+ id: '1',
2571
+ username: 'johndoe',
2572
+ displayName: 'John Doe',
2573
+ },
2574
+ {
2575
+ id: '2',
2576
+ username: 'janesmith',
2577
+ displayName: 'Jane Smith',
2578
+ },
2579
+ {
2580
+ id: '3',
2581
+ username: 'mikeross',
2582
+ displayName: 'Mike Ross',
2583
+ },
2584
+ ]),
2585
+ },
2586
+ {
2587
+ name: 'mock.securityRoles',
2588
+ title: 'Security Roles',
2589
+ valueField: 'id',
2590
+ textField: 'title',
2591
+ columns: [
2592
+ {
2593
+ name: 'id',
2594
+ title: 'Id',
2595
+ },
2596
+ {
2597
+ name: 'title',
2598
+ title: 'Title',
2599
+ },
2600
+ ],
2601
+ samples: [
2602
+ {
2603
+ id: 'admin',
2604
+ title: 'Administrator',
2605
+ },
2606
+ {
2607
+ id: 'user',
2608
+ title: 'Regular User',
2609
+ },
2610
+ ],
2611
+ source: () => convertArrayToDataSource([
2612
+ {
2613
+ id: 'admin',
2614
+ title: 'Administrator',
2615
+ },
2616
+ {
2617
+ id: 'manager',
2618
+ title: 'Manager',
2619
+ },
2620
+ {
2621
+ id: 'user',
2622
+ title: 'Regular User',
2623
+ },
2624
+ ]),
2625
+ },
2626
+ ];
2627
+ }
2628
+ }
2629
+
2630
+ // Now we only define role structure without permissions
2631
+ const mockRoleDefinitions = [
2632
+ {
2633
+ id: '1001',
2634
+ name: 'admin',
2635
+ title: 'Administrator',
2636
+ description: 'Full system access with all administrative privileges',
2637
+ permissions: [], // Will be filled dynamically
2638
+ },
2639
+ {
2640
+ id: '1002',
2641
+ name: 'manager',
2642
+ title: 'Manager',
2643
+ description: 'Manages users and has access to most system features',
2644
+ permissions: [],
2645
+ },
2646
+ {
2647
+ id: '1003',
2648
+ name: 'user',
2649
+ title: 'Regular User',
2650
+ description: 'Standard user with basic system access',
2651
+ permissions: [],
2652
+ },
2653
+ {
2654
+ id: '1004',
2655
+ name: 'readonly',
2656
+ title: 'Read Only',
2657
+ description: 'View-only access to specific system areas',
2658
+ permissions: [],
2659
+ },
2660
+ {
2661
+ id: '1005',
2662
+ name: 'support',
2663
+ title: 'Support Staff',
2664
+ description: 'Customer support and ticket management access',
2665
+ permissions: [],
2666
+ },
2667
+ {
2668
+ id: '1006',
2669
+ name: 'hr',
2670
+ title: 'Human Resources',
2671
+ description: 'Access to HR-related features and user management',
2672
+ permissions: [],
2673
+ },
2674
+ {
2675
+ id: '1007',
2676
+ name: 'finance',
2677
+ title: 'Finance',
2678
+ description: 'Access to financial reports and invoicing features',
2679
+ permissions: [],
2680
+ },
2681
+ {
2682
+ id: '1008',
2683
+ name: 'dev',
2684
+ title: 'Developer',
2685
+ description: 'Technical access to development and debugging features',
2686
+ permissions: [],
2687
+ },
2688
+ ];
2689
+ const mockUsers = [
2690
+ {
2691
+ username: 'johndoe',
2692
+ firstname: 'John',
2693
+ lastname: 'Doe',
2694
+ nationalCode: '1234567890',
2695
+ mobile: '555-123-4567',
2696
+ roleIds: [
2697
+ { id: '1001', title: 'Administrator' },
2698
+ { id: '1002', title: 'Manager' },
2699
+ ],
2700
+ },
2701
+ {
2702
+ username: 'janesmith',
2703
+ firstname: 'Jane',
2704
+ lastname: 'Smith',
2705
+ nationalCode: '0987654321',
2706
+ mobile: '555-987-6543',
2707
+ roleIds: [
2708
+ { id: '1002', title: 'Manager' },
2709
+ { id: '1006', title: 'Human Resources' },
2710
+ ],
2711
+ },
2712
+ {
2713
+ username: 'mikeross',
2714
+ firstname: 'Mike',
2715
+ lastname: 'Ross',
2716
+ nationalCode: '2468135790',
2717
+ mobile: '555-246-8135',
2718
+ roleIds: [
2719
+ { id: '1008', title: 'Developer' },
2720
+ { id: '1005', title: 'Support Staff' },
2721
+ ],
2722
+ },
2723
+ {
2724
+ username: 'emilyparker',
2725
+ firstname: 'Emily',
2726
+ lastname: 'Parker',
2727
+ nationalCode: '1357924680',
2728
+ mobile: '555-135-7924',
2729
+ roleIds: [{ id: '1003', title: 'Regular User' }],
2730
+ },
2731
+ {
2732
+ username: 'robertjohnson',
2733
+ firstname: 'Robert',
2734
+ lastname: 'Johnson',
2735
+ nationalCode: '9876543210',
2736
+ mobile: '555-987-6542',
2737
+ roleIds: [{ id: '1007', title: 'Finance' }],
2738
+ },
2739
+ {
2740
+ username: 'sarahwilliams',
2741
+ firstname: 'Sarah',
2742
+ lastname: 'Williams',
2743
+ nationalCode: '5678901234',
2744
+ mobile: '555-567-8901',
2745
+ roleIds: [{ id: '1004', title: 'Read Only' }],
2746
+ },
2747
+ {
2748
+ username: 'davidbrown',
2749
+ firstname: 'David',
2750
+ lastname: 'Brown',
2751
+ nationalCode: '3456789012',
2752
+ mobile: '555-345-6789',
2753
+ roleIds: [
2754
+ { id: '1003', title: 'Regular User' },
2755
+ { id: '1005', title: 'Support Staff' },
2756
+ ],
2757
+ },
2758
+ {
2759
+ username: 'lisadavis',
2760
+ firstname: 'Lisa',
2761
+ lastname: 'Davis',
2762
+ nationalCode: '7890123456',
2763
+ mobile: '555-789-0123',
2764
+ roleIds: [{ id: '1006', title: 'Human Resources' }],
2765
+ },
2766
+ {
2767
+ username: 'michaelwilson',
2768
+ firstname: 'Michael',
2769
+ lastname: 'Wilson',
2770
+ nationalCode: '6789012345',
2771
+ mobile: '555-678-9012',
2772
+ roleIds: [
2773
+ { id: '1002', title: 'Manager' },
2774
+ { id: '1007', title: 'Finance' },
2775
+ ],
2776
+ },
2777
+ {
2778
+ username: 'amandamiller',
2779
+ firstname: 'Amanda',
2780
+ lastname: 'Miller',
2781
+ nationalCode: '4567890123',
2782
+ mobile: '555-456-7890',
2783
+ roleIds: [{ id: '1008', title: 'Developer' }],
2784
+ },
2785
+ ];
2786
+
2787
+ class AXPSecurityManagementRoleDataSeeder {
2788
+ constructor() {
2789
+ this.storageService = inject(AXPDexieEntityStorageService);
2790
+ this.permissionService = inject(AXPPermissionProviderService);
2791
+ }
2792
+ async seed() {
2793
+ const permissions = await this.permissionService.permissions();
2794
+ const permissionKeys = permissions.map((p) => p.name);
2795
+ // Generate roles with random permissions from the actual permission list
2796
+ const roles = mockRoleDefinitions.map((role) => ({
2797
+ ...role,
2798
+ permissions: this.getRandomPermissions(permissionKeys, 2, 5), // Get 2-5 random permissions
2799
+ }));
2800
+ await this.storageService.initial(`${RootConfig$2.module.name}.${RootConfig$2.entities.roles.name}`, roles);
2801
+ }
2802
+ getRandomPermissions(permissions, min, max) {
2803
+ const count = Math.floor(Math.random() * (max - min + 1)) + min;
2804
+ const shuffled = [...permissions].sort(() => 0.5 - Math.random());
2805
+ return shuffled.slice(0, count);
2806
+ }
2807
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPSecurityManagementRoleDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
2808
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPSecurityManagementRoleDataSeeder }); }
2809
+ }
2810
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPSecurityManagementRoleDataSeeder, decorators: [{
2811
+ type: Injectable
2812
+ }] });
2813
+
2814
+ class AXPSecurityManagementUserDataSeeder {
2815
+ constructor() {
2816
+ this.storageService = inject(AXPDexieEntityStorageService);
2817
+ }
2818
+ async seed() {
2819
+ await this.storageService.initial(`${RootConfig$2.module.name}.${RootConfig$2.entities.users.name}`, this.generateUsers());
2820
+ }
2821
+ generateUsers() {
2822
+ return mockUsers.map((user) => ({
2823
+ id: AXPDataGenerator.uuid(),
2824
+ username: user.username,
2825
+ firstname: user.firstname,
2826
+ lastname: user.lastname,
2827
+ nationalCode: user.nationalCode,
2828
+ mobile: user.mobile,
2829
+ password: '123',
2830
+ roles: user.roleIds,
2831
+ }));
2832
+ }
2833
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPSecurityManagementUserDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
2834
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPSecurityManagementUserDataSeeder }); }
2835
+ }
2836
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPSecurityManagementUserDataSeeder, decorators: [{
2837
+ type: Injectable
2838
+ }] });
2839
+
2840
+ class AXCSecurityManagementMockModule {
2841
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCSecurityManagementMockModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
2842
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.3", ngImport: i0, type: AXCSecurityManagementMockModule }); }
2843
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCSecurityManagementMockModule, providers: [
2844
+ {
2845
+ provide: AXP_WIDGET_DATASOURCE_PROVIDER,
2846
+ useClass: AXPSecurityManagementMockWidgetDataSourceProvider,
2847
+ multi: true,
2848
+ },
2849
+ {
2850
+ provide: AXP_DATA_SEEDER_TOKEN,
2851
+ useClass: AXPSecurityManagementUserDataSeeder,
2852
+ multi: true,
2853
+ },
2854
+ {
2855
+ provide: AXP_DATA_SEEDER_TOKEN,
2856
+ useClass: AXPSecurityManagementRoleDataSeeder,
2857
+ multi: true,
2858
+ },
2859
+ ] }); }
2860
+ }
2861
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCSecurityManagementMockModule, decorators: [{
2862
+ type: NgModule,
2863
+ args: [{
2864
+ imports: [],
2865
+ exports: [],
2866
+ declarations: [],
2867
+ providers: [
2868
+ {
2869
+ provide: AXP_WIDGET_DATASOURCE_PROVIDER,
2870
+ useClass: AXPSecurityManagementMockWidgetDataSourceProvider,
2871
+ multi: true,
2872
+ },
2873
+ {
2874
+ provide: AXP_DATA_SEEDER_TOKEN,
2875
+ useClass: AXPSecurityManagementUserDataSeeder,
2876
+ multi: true,
2877
+ },
2878
+ {
2879
+ provide: AXP_DATA_SEEDER_TOKEN,
2880
+ useClass: AXPSecurityManagementRoleDataSeeder,
2881
+ multi: true,
2882
+ },
2883
+ ],
2884
+ }]
2885
+ }] });
2886
+
2015
2887
  const TEXT_TEMPLATE_CATEGORY = [
2016
2888
  {
2017
2889
  id: AXPDataGenerator.uuid(),
@@ -2134,7 +3006,7 @@ class AXCTextTemplateCategoryDataSeeder {
2134
3006
  this.storageService = inject(AXPDexieEntityStorageService);
2135
3007
  }
2136
3008
  async seed() {
2137
- await this.storageService.initial(`${RootConfig$5.module.name}.${RootConfig$5.entities.category.name}`, TEXT_TEMPLATE_CATEGORY);
3009
+ await this.storageService.initial(`${RootConfig$7.module.name}.${RootConfig$7.entities.category.name}`, TEXT_TEMPLATE_CATEGORY);
2138
3010
  }
2139
3011
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCTextTemplateCategoryDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
2140
3012
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCTextTemplateCategoryDataSeeder }); }
@@ -2148,7 +3020,7 @@ class AXCTextTemplateDataSeeder {
2148
3020
  this.storageService = inject(AXPDexieEntityStorageService);
2149
3021
  }
2150
3022
  async seed() {
2151
- await this.storageService.initial(`${RootConfig$5.module.name}.${RootConfig$5.entities.template.name}`, TEXT_TEMPLATES);
3023
+ await this.storageService.initial(`${RootConfig$7.module.name}.${RootConfig$7.entities.template.name}`, TEXT_TEMPLATES);
2152
3024
  }
2153
3025
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCTextTemplateDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
2154
3026
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCTextTemplateDataSeeder }); }
@@ -2161,7 +3033,8 @@ class AXCMockModule {
2161
3033
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCMockModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
2162
3034
  static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.3", ngImport: i0, type: AXCMockModule, imports: [i1$1.AXPAuthModule, AXCFormTemplateManagementMockModule,
2163
3035
  AXCFOrganizationManagementMockModule,
2164
- AXCConversationMockModule] }); }
3036
+ AXCConversationMockModule,
3037
+ AXCSecurityManagementMockModule] }); }
2165
3038
  static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCMockModule, providers: [
2166
3039
  AXPDexieEntityStorageService,
2167
3040
  {
@@ -2212,11 +3085,26 @@ class AXCMockModule {
2212
3085
  useClass: AXCAppTermDataSeeder,
2213
3086
  multi: true,
2214
3087
  },
3088
+ {
3089
+ provide: AXP_DATA_SEEDER_TOKEN,
3090
+ useClass: AXCMetaDataDefinitionDataSeeder,
3091
+ multi: true,
3092
+ },
2215
3093
  {
2216
3094
  provide: AXP_DATA_SEEDER_TOKEN,
2217
3095
  useClass: AXCAppTermDataSeeder,
2218
3096
  multi: true,
2219
3097
  },
3098
+ {
3099
+ provide: AXP_DATA_SEEDER_TOKEN,
3100
+ useClass: AXCFolderDataSeeder,
3101
+ multi: true,
3102
+ },
3103
+ {
3104
+ provide: AXP_DATA_SEEDER_TOKEN,
3105
+ useClass: AXCDocumentTypeDataSeeder,
3106
+ multi: true,
3107
+ },
2220
3108
  {
2221
3109
  provide: AXPModuleDesignerService,
2222
3110
  useClass: AXCModuleDesignerService,
@@ -2229,6 +3117,10 @@ class AXCMockModule {
2229
3117
  provide: AXPRegionalService,
2230
3118
  useClass: AXCRegionalServiceImpl,
2231
3119
  },
3120
+ {
3121
+ provide: AXMFolderService,
3122
+ useClass: AXMFolderMockService,
3123
+ },
2232
3124
  {
2233
3125
  provide: AXP_SEARCH_PROVIDER,
2234
3126
  useClass: EntitySearchProvider,
@@ -2239,7 +3131,8 @@ class AXCMockModule {
2239
3131
  }),
2240
3132
  AXCFormTemplateManagementMockModule,
2241
3133
  AXCFOrganizationManagementMockModule,
2242
- AXCConversationMockModule] }); }
3134
+ AXCConversationMockModule,
3135
+ AXCSecurityManagementMockModule] }); }
2243
3136
  }
2244
3137
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCMockModule, decorators: [{
2245
3138
  type: NgModule,
@@ -2251,6 +3144,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
2251
3144
  AXCFormTemplateManagementMockModule,
2252
3145
  AXCFOrganizationManagementMockModule,
2253
3146
  AXCConversationMockModule,
3147
+ AXCSecurityManagementMockModule,
2254
3148
  ],
2255
3149
  exports: [],
2256
3150
  declarations: [],
@@ -2304,11 +3198,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
2304
3198
  useClass: AXCAppTermDataSeeder,
2305
3199
  multi: true,
2306
3200
  },
3201
+ {
3202
+ provide: AXP_DATA_SEEDER_TOKEN,
3203
+ useClass: AXCMetaDataDefinitionDataSeeder,
3204
+ multi: true,
3205
+ },
2307
3206
  {
2308
3207
  provide: AXP_DATA_SEEDER_TOKEN,
2309
3208
  useClass: AXCAppTermDataSeeder,
2310
3209
  multi: true,
2311
3210
  },
3211
+ {
3212
+ provide: AXP_DATA_SEEDER_TOKEN,
3213
+ useClass: AXCFolderDataSeeder,
3214
+ multi: true,
3215
+ },
3216
+ {
3217
+ provide: AXP_DATA_SEEDER_TOKEN,
3218
+ useClass: AXCDocumentTypeDataSeeder,
3219
+ multi: true,
3220
+ },
2312
3221
  {
2313
3222
  provide: AXPModuleDesignerService,
2314
3223
  useClass: AXCModuleDesignerService,
@@ -2321,6 +3230,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
2321
3230
  provide: AXPRegionalService,
2322
3231
  useClass: AXCRegionalServiceImpl,
2323
3232
  },
3233
+ {
3234
+ provide: AXMFolderService,
3235
+ useClass: AXMFolderMockService,
3236
+ },
2324
3237
  {
2325
3238
  provide: AXP_SEARCH_PROVIDER,
2326
3239
  useClass: EntitySearchProvider,