@acorex/connectivity 20.0.9 → 20.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,7 +10,7 @@ import { inject, Injectable, NgModule } from '@angular/core';
10
10
  import { AXPLockService, AXPFileStorageStatus, AXPRegionalService, AXPFileStorageService } from '@acorex/platform/common';
11
11
  import { AXSafePipe } from '@acorex/core/pipes';
12
12
  import { RootConfig, AXMUsersEntityService, AXMSessionStatusTypes, AXMDeviceSessionsServiceImpl, AXMDeviceSessionsService } from '@acorex/modules/security-management';
13
- import { AXMFormTemplateTypes, RootConfig as RootConfig$1, AXMPermissionsKeys } from '@acorex/modules/form-template-management';
13
+ import { AXMFormTemplateTypes, RootConfig as RootConfig$1, AXMFormTemplateManagementCategoryEntityServiceImpl, AXMFormTemplateManagementCategoryEntityService, AXMPermissionsKeys } from '@acorex/modules/form-template-management';
14
14
  import { AXMOrganizationNodeType, RootConfig as RootConfig$2 } from '@acorex/modules/organization-management';
15
15
  import { RootConfig as RootConfig$3 } from '@acorex/modules/report-management';
16
16
  import { AXPWidgetsList } from '@acorex/modules/common';
@@ -18,7 +18,7 @@ import { RootConfig as RootConfig$4 } from '@acorex/modules/contact-management';
18
18
  import { AXPBarChartWidget, AXPAnalogClockWidget, AXPMinimalWeatherWidget, AXPAdvancedWeatherWidget, AXPStickyNoteWidget, AXPDonutChartWidget, AXPGaugeChartWidget, AXPLineChartWidget, AXPTaskListWidget, RootConfig as RootConfig$5 } from '@acorex/modules/dashboard-management';
19
19
  import { AXPMyNotificationDashboardWidget, RootConfig as RootConfig$a, AXMNotificationEntityService } from '@acorex/modules/notification-management';
20
20
  import { AXMChatService, AXMCommentService, RootConfig as RootConfig$6 } from '@acorex/modules/conversation';
21
- import { throttleTime, take, of, delay, firstValueFrom } from 'rxjs';
21
+ import { filter, throttleTime, take, of, delay, firstValueFrom } from 'rxjs';
22
22
  import { AXMPermissionsKeys as AXMPermissionsKeys$1, RootConfig as RootConfig$e } from '@acorex/modules/issue-management';
23
23
  import { RootConfig as RootConfig$7, AXMMetaDataDefinitionCategoryServiceImpl, AXMMetaDataDefinitionService, AXMMetaDataDefinitionCategoryService } from '@acorex/modules/platform-management';
24
24
  import { AXFileService } from '@acorex/core/file';
@@ -30,6 +30,7 @@ import { RootConfig as RootConfig$b } from '@acorex/modules/training-management'
30
30
  import { RootConfig as RootConfig$c } from '@acorex/modules/project-management';
31
31
  import { RootConfig as RootConfig$d, AXMFolderServiceImpl, AXMDocumentServiceImpl, AXMFolderService, AXMDocumentService } from '@acorex/modules/document-management';
32
32
  import { RootConfig as RootConfig$f } from '@acorex/modules/log-management';
33
+ import { RootConfig as RootConfig$g } from '@acorex/modules/data-management';
33
34
 
34
35
  class AXPDexieEntityStorageService extends Dexie {
35
36
  constructor() {
@@ -453,6 +454,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.7", ngImpor
453
454
  type: Injectable
454
455
  }] });
455
456
 
457
+ class AXCTemplateCategoryService extends AXMFormTemplateManagementCategoryEntityServiceImpl {
458
+ async insertOne(request) {
459
+ const result = await super.insertOne(request);
460
+ if (request.parentId != null) {
461
+ const parent = await super.getOne(request.parentId);
462
+ parent.childCount = (parent.childCount ?? 0) + 1;
463
+ await super.updateOne(parent.id, parent);
464
+ }
465
+ return result;
466
+ }
467
+ }
468
+
456
469
  class AXCFormTemplateManagementMockModule {
457
470
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.7", ngImport: i0, type: AXCFormTemplateManagementMockModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
458
471
  static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.7", ngImport: i0, type: AXCFormTemplateManagementMockModule }); }
@@ -467,6 +480,10 @@ class AXCFormTemplateManagementMockModule {
467
480
  useClass: AXPFormTemplateCategoryDataSeeder,
468
481
  multi: true,
469
482
  },
483
+ {
484
+ provide: AXMFormTemplateManagementCategoryEntityService,
485
+ useClass: AXCTemplateCategoryService,
486
+ },
470
487
  ] }); }
471
488
  }
472
489
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.7", ngImport: i0, type: AXCFormTemplateManagementMockModule, decorators: [{
@@ -486,6 +503,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.7", ngImpor
486
503
  useClass: AXPFormTemplateCategoryDataSeeder,
487
504
  multi: true,
488
505
  },
506
+ {
507
+ provide: AXMFormTemplateManagementCategoryEntityService,
508
+ useClass: AXCTemplateCategoryService,
509
+ },
489
510
  ],
490
511
  }]
491
512
  }] });
@@ -5407,7 +5428,13 @@ class AXPMessageDataSeeder {
5407
5428
  }
5408
5429
  async seed() {
5409
5430
  await this.storageService.initial(`${RootConfig$6.module.name}.${RootConfig$6.entities.message.name}`, MESSAGES);
5410
- this.chatService.messageSent$.pipe(throttleTime(1000), take(30)).subscribe(async (message) => {
5431
+ const currentUserId = this.sessionService.user?.id;
5432
+ if (!currentUserId) {
5433
+ return;
5434
+ }
5435
+ this.chatService.messageSent$
5436
+ .pipe(filter((message) => message.author.id === currentUserId), throttleTime(1000), take(30))
5437
+ .subscribe(async (message) => {
5411
5438
  try {
5412
5439
  const room = await this.chatService.getRoom(message.roomId);
5413
5440
  const otherMembers = room.members.filter((member) => member.id !== message.author.id);
@@ -5423,8 +5450,11 @@ class AXPMessageDataSeeder {
5423
5450
  }));
5424
5451
  const conversationLog = formattedHistory.join('\n');
5425
5452
  const randomMemberName = await this.getUserName(randomMember.id);
5426
- const systemPrompt = `You are ${randomMemberName}. Replay to last message Based on the following conversation, provide a short response. Do not include your name in the response.`;
5427
- const fullPrompt = `${systemPrompt}\n\nConversation History:\n${conversationLog}`;
5453
+ const behaviorPrompt = 'Keep in mind, be creative and a bit funny';
5454
+ const languagePrompt = 'Use the language of the conversation (if u see anyone speak farsi, speak farsi, else speak english';
5455
+ const systemPrompt = `You are ${randomMemberName}. Replay to last messages Based on the following conversation, provide a short response. Do not include your name in the response. make it like real conversation`;
5456
+ const attentionPrompt = `Pay attention to messages from ${this.sessionService.user?.title}`;
5457
+ const fullPrompt = `${systemPrompt}\n${behaviorPrompt}\n${languagePrompt}\n${attentionPrompt}\n\nConversation History:\n${conversationLog}`;
5428
5458
  const typingDuration = Math.random() * 1000 + 5000; // 1-2 seconds
5429
5459
  await this.chatService.startTyping(room.id, randomMember.id);
5430
5460
  const aiResponse = await this.aiResponderService.getAIResponse(fullPrompt);
@@ -5437,11 +5467,9 @@ class AXPMessageDataSeeder {
5437
5467
  console.error('Error seeding mock message:', error);
5438
5468
  }
5439
5469
  });
5440
- this.commentService.commentAdded$.pipe(throttleTime(1000), take(3)).subscribe(async (comment) => {
5441
- const currentUser = this.sessionService.user;
5442
- if (!currentUser || comment.author.id !== currentUser.id) {
5443
- return;
5444
- }
5470
+ this.commentService.commentAdded$
5471
+ .pipe(filter((comment) => comment.author.id === currentUserId), throttleTime(1000), take(3))
5472
+ .subscribe(async (comment) => {
5445
5473
  try {
5446
5474
  const { items: allUsers } = await this.usersService.query({ skip: 0, take: 100 });
5447
5475
  const otherUsers = allUsers.filter((u) => u.id !== comment.author.id);
@@ -5457,7 +5485,7 @@ class AXPMessageDataSeeder {
5457
5485
  }));
5458
5486
  const conversationLog = formattedHistory.join('\n');
5459
5487
  const randomUserName = await this.getUserName(randomUser.id);
5460
- const systemPrompt = `You are ${randomUserName}. Replay to last message Based on the following conversation, provide a short response. Do not include your name in the response.`;
5488
+ const systemPrompt = `You are ${randomUserName}. Replay to last messages Based on the following conversation, provide a short response. Do not include your name in the response.`;
5461
5489
  const fullPrompt = `${systemPrompt}\n\nConversation History:\n${conversationLog}`;
5462
5490
  const aiResponse = await this.aiResponderService.getAIResponse(fullPrompt);
5463
5491
  // Add a delay
@@ -5670,19 +5698,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.7", ngImpor
5670
5698
  }] });
5671
5699
 
5672
5700
  const OHS_ID = AXPDataGenerator.uuid();
5673
- const child1 = {
5701
+ const child1$1 = {
5674
5702
  id: AXPDataGenerator.uuid(),
5675
5703
  title: 'General',
5676
5704
  parentId: OHS_ID,
5677
5705
  childCount: 0,
5678
5706
  };
5679
- const child2 = {
5707
+ const child2$1 = {
5680
5708
  id: AXPDataGenerator.uuid(),
5681
5709
  title: 'License',
5682
5710
  parentId: OHS_ID,
5683
5711
  childCount: 0,
5684
5712
  };
5685
- const child3 = {
5713
+ const child3$1 = {
5686
5714
  id: AXPDataGenerator.uuid(),
5687
5715
  title: 'Training',
5688
5716
  parentId: OHS_ID,
@@ -5698,11 +5726,11 @@ const METADATA_CATEGORY_MOCK = [
5698
5726
  id: OHS_ID,
5699
5727
  title: 'OHS',
5700
5728
  childCount: 2,
5701
- children: [child1, child2, child3],
5729
+ children: [child1$1, child2$1, child3$1],
5702
5730
  },
5703
- child1,
5704
- child2,
5705
- child3,
5731
+ child1$1,
5732
+ child2$1,
5733
+ child3$1,
5706
5734
  ];
5707
5735
  const checkbox$2 = '{"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"}';
5708
5736
  const colorboxInterface = '{"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"}';
@@ -5908,55 +5936,75 @@ class AXCMetaDataDefinitionCategoryMockService extends AXMMetaDataDefinitionCate
5908
5936
  take: 1000,
5909
5937
  skip: 0,
5910
5938
  filter: {
5911
- logic: "and",
5912
- filters: [{
5913
- field: "parentId",
5939
+ logic: 'and',
5940
+ filters: [
5941
+ {
5942
+ field: 'parentId',
5914
5943
  operator: {
5915
- type: "isNull"
5916
- }
5917
- }]
5918
- }
5944
+ type: 'isNull',
5945
+ },
5946
+ },
5947
+ ],
5948
+ },
5919
5949
  });
5920
- const categories = await Promise.all(rootCategories.items.map(category => this.buildCategoryTree(category)));
5950
+ const categories = await Promise.all(rootCategories.items.map((category) => this.buildCategoryTree(category)));
5921
5951
  return categories;
5922
5952
  }
5923
5953
  async buildCategoryTree(category) {
5924
5954
  const itemsResult = await this.metaDataService.query({
5925
5955
  filter: {
5926
- logic: "and",
5927
- filters: [{
5928
- field: "categoryIds",
5956
+ logic: 'and',
5957
+ filters: [
5958
+ {
5959
+ field: 'categoryIds',
5929
5960
  operator: {
5930
- type: 'contains'
5961
+ type: 'contains',
5931
5962
  },
5932
- value: category.id
5933
- }]
5963
+ value: category.id,
5964
+ },
5965
+ ],
5934
5966
  },
5935
5967
  take: 1000,
5936
- skip: 0
5968
+ skip: 0,
5937
5969
  });
5938
5970
  const childCategoriesResult = await this.query({
5939
5971
  filter: {
5940
- logic: "and",
5941
- filters: [{
5942
- field: "parentId",
5972
+ logic: 'and',
5973
+ filters: [
5974
+ {
5975
+ field: 'parentId',
5943
5976
  operator: {
5944
- type: "equal"
5977
+ type: 'equal',
5945
5978
  },
5946
- value: category.id
5947
- }]
5979
+ value: category.id,
5980
+ },
5981
+ ],
5948
5982
  },
5949
5983
  take: 1000,
5950
- skip: 0
5984
+ skip: 0,
5951
5985
  });
5952
- const children = await Promise.all(childCategoriesResult.items.map(child => this.buildCategoryTree(child)));
5986
+ const children = await Promise.all(childCategoriesResult.items.map((child) => this.buildCategoryTree(child)));
5953
5987
  return {
5954
5988
  ...category,
5955
5989
  items: itemsResult.items,
5956
5990
  categories: children,
5957
- children: children
5991
+ children: children,
5958
5992
  };
5959
5993
  }
5994
+ async insertOne(request) {
5995
+ const result = await super.insertOne(request);
5996
+ if (request.parentId != null) {
5997
+ const parent = await super.getOne(request.parentId);
5998
+ parent.children?.push({
5999
+ ...request,
6000
+ id: result,
6001
+ children: [],
6002
+ });
6003
+ parent.childCount = parent.children?.length ?? 0;
6004
+ await super.updateOne(parent.id, parent);
6005
+ }
6006
+ return result;
6007
+ }
5960
6008
  }
5961
6009
 
5962
6010
  class FileStorageDatabase extends Dexie {
@@ -9232,6 +9280,119 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.7", ngImpor
9232
9280
  }]
9233
9281
  }] });
9234
9282
 
9283
+ const REPORT_ID = AXPDataGenerator.uuid();
9284
+ const child1 = {
9285
+ id: AXPDataGenerator.uuid(),
9286
+ title: 'Financial Reports',
9287
+ parentId: REPORT_ID,
9288
+ childCount: 0,
9289
+ };
9290
+ const child2 = {
9291
+ id: AXPDataGenerator.uuid(),
9292
+ title: 'User Reports',
9293
+ parentId: REPORT_ID,
9294
+ childCount: 0,
9295
+ };
9296
+ const child3 = {
9297
+ id: AXPDataGenerator.uuid(),
9298
+ title: 'System Reports',
9299
+ parentId: REPORT_ID,
9300
+ childCount: 0,
9301
+ };
9302
+ const QUERY_CATEGORY_MOCK = [
9303
+ {
9304
+ id: AXPDataGenerator.uuid(),
9305
+ title: 'General Queries',
9306
+ childCount: 0,
9307
+ },
9308
+ {
9309
+ id: REPORT_ID,
9310
+ title: 'Reports',
9311
+ childCount: 3,
9312
+ children: [child1, child2, child3],
9313
+ },
9314
+ child1,
9315
+ child2,
9316
+ child3,
9317
+ {
9318
+ id: AXPDataGenerator.uuid(),
9319
+ title: 'Analytics',
9320
+ childCount: 0,
9321
+ },
9322
+ ];
9323
+ const QUERY_MOCK = [
9324
+ {
9325
+ id: AXPDataGenerator.uuid(),
9326
+ name: 'user-list-query',
9327
+ title: 'User List Query',
9328
+ categoryIds: [QUERY_CATEGORY_MOCK[0].id],
9329
+ categories: [{ id: QUERY_CATEGORY_MOCK[0].id, title: QUERY_CATEGORY_MOCK[0].title }],
9330
+ },
9331
+ {
9332
+ id: AXPDataGenerator.uuid(),
9333
+ name: 'financial-report-query',
9334
+ title: 'Financial Report Query',
9335
+ categoryIds: [child1.id],
9336
+ categories: [{ id: child1.id, title: child1.title }],
9337
+ },
9338
+ {
9339
+ id: AXPDataGenerator.uuid(),
9340
+ name: 'system-status-query',
9341
+ title: 'System Status Query',
9342
+ categoryIds: [child3.id],
9343
+ categories: [{ id: child3.id, title: child3.title }],
9344
+ },
9345
+ {
9346
+ id: AXPDataGenerator.uuid(),
9347
+ name: 'analytics-dashboard-query',
9348
+ title: 'Analytics Dashboard Query',
9349
+ categoryIds: [QUERY_CATEGORY_MOCK[5].id],
9350
+ categories: [{ id: QUERY_CATEGORY_MOCK[5].id, title: QUERY_CATEGORY_MOCK[5].title }],
9351
+ },
9352
+ ];
9353
+
9354
+ class AXCQueryDataSeeder {
9355
+ constructor() {
9356
+ this.storageService = inject(AXPEntityStorageService);
9357
+ }
9358
+ async seed() {
9359
+ await this.storageService.initial(`${RootConfig$g.module.name}.${RootConfig$g.entities.queryCategory.name}`, QUERY_CATEGORY_MOCK);
9360
+ await this.storageService.initial(`${RootConfig$g.module.name}.${RootConfig$g.entities.query.name}`, QUERY_MOCK);
9361
+ }
9362
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.7", ngImport: i0, type: AXCQueryDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
9363
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.7", ngImport: i0, type: AXCQueryDataSeeder }); }
9364
+ }
9365
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.7", ngImport: i0, type: AXCQueryDataSeeder, decorators: [{
9366
+ type: Injectable
9367
+ }] });
9368
+
9369
+ class AXCDataManagementMockModule {
9370
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.7", ngImport: i0, type: AXCDataManagementMockModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
9371
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.7", ngImport: i0, type: AXCDataManagementMockModule }); }
9372
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.7", ngImport: i0, type: AXCDataManagementMockModule, providers: [
9373
+ {
9374
+ provide: AXP_DATA_SEEDER_TOKEN,
9375
+ useClass: AXCQueryDataSeeder,
9376
+ multi: true,
9377
+ },
9378
+ ] }); }
9379
+ }
9380
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.7", ngImport: i0, type: AXCDataManagementMockModule, decorators: [{
9381
+ type: NgModule,
9382
+ args: [{
9383
+ imports: [],
9384
+ exports: [],
9385
+ declarations: [],
9386
+ providers: [
9387
+ {
9388
+ provide: AXP_DATA_SEEDER_TOKEN,
9389
+ useClass: AXCQueryDataSeeder,
9390
+ multi: true,
9391
+ },
9392
+ ],
9393
+ }]
9394
+ }] });
9395
+
9235
9396
  class AXCMockModule {
9236
9397
  constructor(appInitService, injector) {
9237
9398
  const seederService = injector.get(AXPDataSeederService);
@@ -9262,7 +9423,8 @@ class AXCMockModule {
9262
9423
  AXCProjectManagementMockModule,
9263
9424
  AXCDocumentManagementMockModule,
9264
9425
  AXCIssueManagementMockModule,
9265
- AXCLogManagementMockModule] }); }
9426
+ AXCLogManagementMockModule,
9427
+ AXCDataManagementMockModule] }); }
9266
9428
  static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.7", ngImport: i0, type: AXCMockModule, providers: [
9267
9429
  {
9268
9430
  provide: AXPEntityStorageService,
@@ -9289,7 +9451,8 @@ class AXCMockModule {
9289
9451
  AXCProjectManagementMockModule,
9290
9452
  AXCDocumentManagementMockModule,
9291
9453
  AXCIssueManagementMockModule,
9292
- AXCLogManagementMockModule] }); }
9454
+ AXCLogManagementMockModule,
9455
+ AXCDataManagementMockModule] }); }
9293
9456
  }
9294
9457
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.7", ngImport: i0, type: AXCMockModule, decorators: [{
9295
9458
  type: NgModule,
@@ -9316,6 +9479,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.7", ngImpor
9316
9479
  AXCDocumentManagementMockModule,
9317
9480
  AXCIssueManagementMockModule,
9318
9481
  AXCLogManagementMockModule,
9482
+ AXCDataManagementMockModule,
9319
9483
  ],
9320
9484
  exports: [],
9321
9485
  declarations: [],
@@ -9333,5 +9497,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.7", ngImpor
9333
9497
  * Generated bundle index. Do not edit.
9334
9498
  */
9335
9499
 
9336
- export { AXCFileStorageService, AXCMockModule, AXPDexieEntityStorageService, MOCKStrategy };
9500
+ export { AXCAppTermDataSeeder, AXCAppVersionDataSeeder, AXCFileStorageService, AXCGlobalVariablesDataSeeder, AXCMetaDataDefinitionDataSeeder, AXCMockModule, AXCPlatformManagementMockModule, AXPDexieEntityStorageService, GLOBAL_VARIABLES, MOCKStrategy };
9337
9501
  //# sourceMappingURL=acorex-connectivity-mock.mjs.map