@acorex/modules 18.1.3 → 18.1.4
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/backend/lib/data/api/comment.mock.service.d.ts +62 -0
- package/backend/lib/data/index.d.ts +1 -0
- package/esm2022/backend/lib/data/api/comment.mock.service.mjs +142 -0
- package/esm2022/backend/lib/data/index.mjs +2 -1
- package/esm2022/notification-management/acorex-modules-notification-management.mjs +5 -0
- package/esm2022/notification-management/index.mjs +4 -0
- package/esm2022/notification-management/lib/entities/notification-channel.entity.mjs +329 -0
- package/esm2022/notification-management/lib/entities/notification-template.entity.mjs +298 -0
- package/esm2022/notification-management/lib/notification-management-mock-data.mjs +20 -0
- package/esm2022/notification-management/lib/notification-management.module.mjs +44 -0
- package/esm2022/notification-management/lib/notification-management.service.mjs +30 -0
- package/esm2022/template-management/acorex-modules-template-management.mjs +5 -0
- package/esm2022/template-management/index.mjs +4 -0
- package/esm2022/template-management/lib/entities/global-template.entity.mjs +298 -0
- package/esm2022/template-management/lib/entities/template-variable.entity.mjs +304 -0
- package/esm2022/template-management/lib/template-management-mock-data.mjs +11 -0
- package/esm2022/template-management/lib/template-management.module.mjs +45 -0
- package/esm2022/template-management/lib/template-management.service.mjs +24 -0
- package/fesm2022/acorex-modules-backend.mjs +141 -2
- package/fesm2022/acorex-modules-backend.mjs.map +1 -1
- package/fesm2022/acorex-modules-notification-management.mjs +728 -0
- package/fesm2022/acorex-modules-notification-management.mjs.map +1 -0
- package/fesm2022/acorex-modules-template-management.mjs +690 -0
- package/fesm2022/acorex-modules-template-management.mjs.map +1 -0
- package/notification-management/README.md +3 -0
- package/notification-management/index.d.ts +3 -0
- package/notification-management/lib/entities/notification-channel.entity.d.ts +3 -0
- package/notification-management/lib/entities/notification-template.entity.d.ts +3 -0
- package/notification-management/lib/notification-management-mock-data.d.ts +13 -0
- package/notification-management/lib/notification-management.module.d.ts +12 -0
- package/notification-management/lib/notification-management.service.d.ts +11 -0
- package/package.json +19 -7
- package/template-management/README.md +3 -0
- package/template-management/index.d.ts +3 -0
- package/template-management/lib/entities/global-template.entity.d.ts +3 -0
- package/template-management/lib/entities/template-variable.entity.d.ts +3 -0
- package/template-management/lib/template-management-mock-data.d.ts +7 -0
- package/template-management/lib/template-management.module.d.ts +12 -0
- package/template-management/lib/template-management.service.d.ts +9 -0
@@ -0,0 +1,11 @@
|
|
1
|
+
import { AXPDataGenerator } from '@acorex/platform/common';
|
2
|
+
export const GLOBAL_TEMPLATES = Array.from({ length: 5 }).map((_, i) => {
|
3
|
+
const name = AXPDataGenerator.string;
|
4
|
+
return {
|
5
|
+
id: AXPDataGenerator.uuid(),
|
6
|
+
name: name,
|
7
|
+
title: name,
|
8
|
+
content: AXPDataGenerator.string(200),
|
9
|
+
};
|
10
|
+
});
|
11
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVtcGxhdGUtbWFuYWdlbWVudC1tb2NrLWRhdGEuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9saWJzL21vZHVsZXMvdGVtcGxhdGUtbWFuYWdlbWVudC9zcmMvbGliL3RlbXBsYXRlLW1hbmFnZW1lbnQtbW9jay1kYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLHlCQUF5QixDQUFDO0FBRTNELE1BQU0sQ0FBQyxNQUFNLGdCQUFnQixHQUFHLEtBQUssQ0FBQyxJQUFJLENBQUMsRUFBRSxNQUFNLEVBQUUsQ0FBQyxFQUFFLENBQUMsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLEVBQUU7SUFDckUsTUFBTSxJQUFJLEdBQUcsZ0JBQWdCLENBQUMsTUFBTSxDQUFDO0lBQ3JDLE9BQU87UUFDTCxFQUFFLEVBQUUsZ0JBQWdCLENBQUMsSUFBSSxFQUFFO1FBQzNCLElBQUksRUFBRSxJQUFJO1FBQ1YsS0FBSyxFQUFFLElBQUk7UUFDWCxPQUFPLEVBQUUsZ0JBQWdCLENBQUMsTUFBTSxDQUFDLEdBQUcsQ0FBQztLQUN0QyxDQUFDO0FBQ0osQ0FBQyxDQUFDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBBWFBEYXRhR2VuZXJhdG9yIH0gZnJvbSAnQGFjb3JleC9wbGF0Zm9ybS9jb21tb24nO1xuXG5leHBvcnQgY29uc3QgR0xPQkFMX1RFTVBMQVRFUyA9IEFycmF5LmZyb20oeyBsZW5ndGg6IDUgfSkubWFwKChfLCBpKSA9PiB7XG4gIGNvbnN0IG5hbWUgPSBBWFBEYXRhR2VuZXJhdG9yLnN0cmluZztcbiAgcmV0dXJuIHtcbiAgICBpZDogQVhQRGF0YUdlbmVyYXRvci51dWlkKCksXG4gICAgbmFtZTogbmFtZSxcbiAgICB0aXRsZTogbmFtZSxcbiAgICBjb250ZW50OiBBWFBEYXRhR2VuZXJhdG9yLnN0cmluZygyMDApLFxuICB9O1xufSk7XG4iXX0=
|
@@ -0,0 +1,45 @@
|
|
1
|
+
import { AXPEntityDefinitionRegistryService } from '@acorex/platform/layout/entity';
|
2
|
+
import { Inject, Injector, NgModule, Optional } from '@angular/core';
|
3
|
+
import * as i0 from "@angular/core";
|
4
|
+
export class TemplateManagementModule {
|
5
|
+
static forRoot() {
|
6
|
+
return {
|
7
|
+
ngModule: TemplateManagementModule,
|
8
|
+
providers: [
|
9
|
+
{
|
10
|
+
provide: 'AXP_REGISTER_TEMPLATE_GLOBAL',
|
11
|
+
useFactory: async (entityRegistry, injector) => {
|
12
|
+
const globalTemplateEntity = await (await import('./entities/global-template.entity')).globalTemplateEntityFactory(injector);
|
13
|
+
entityRegistry.register(globalTemplateEntity);
|
14
|
+
//
|
15
|
+
const variableEntity = await (await import('./entities/template-variable.entity')).templateVariableEntityFactory(injector);
|
16
|
+
entityRegistry.register(variableEntity);
|
17
|
+
//
|
18
|
+
},
|
19
|
+
deps: [AXPEntityDefinitionRegistryService, Injector], // Add any dependencies if needed
|
20
|
+
},
|
21
|
+
],
|
22
|
+
};
|
23
|
+
}
|
24
|
+
/**
|
25
|
+
* @ignore
|
26
|
+
*/
|
27
|
+
constructor(instances) { }
|
28
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: TemplateManagementModule, deps: [{ token: 'AXP_REGISTER_TEMPLATE_GLOBAL', optional: true }], target: i0.ɵɵFactoryTarget.NgModule }); }
|
29
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.0", ngImport: i0, type: TemplateManagementModule }); }
|
30
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: TemplateManagementModule }); }
|
31
|
+
}
|
32
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: TemplateManagementModule, decorators: [{
|
33
|
+
type: NgModule,
|
34
|
+
args: [{
|
35
|
+
imports: [],
|
36
|
+
exports: [],
|
37
|
+
declarations: [],
|
38
|
+
}]
|
39
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
40
|
+
type: Optional
|
41
|
+
}, {
|
42
|
+
type: Inject,
|
43
|
+
args: ['AXP_REGISTER_TEMPLATE_GLOBAL']
|
44
|
+
}] }] });
|
45
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVtcGxhdGUtbWFuYWdlbWVudC5tb2R1bGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9saWJzL21vZHVsZXMvdGVtcGxhdGUtbWFuYWdlbWVudC9zcmMvbGliL3RlbXBsYXRlLW1hbmFnZW1lbnQubW9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SW5qZWN0b3IpID0+IHtcbiAgICAgICAgICAgIGNvbnN0IGdsb2JhbFRlbXBsYXRlRW50aXR5ID0gYXdhaXQgKFxuICAgICAgICAgICAgICBhd2FpdCBpbXBvcnQoJy4vZW50aXRpZXMvZ2xvYmFsLXRlbXBsYXRlLmVudGl0eScpXG4gICAgICAgICAgICApLmdsb2JhbFRlbXBsYXRlRW50aXR5RmFjdG9yeShpbmplY3Rvcik7XG4gICAgICAgICAgICBlbnRpdHlSZWdpc3RyeS5yZWdpc3RlcihnbG9iYWxUZW1wbGF0ZUVudGl0eSBhcyBhbnkpO1xuICAgICAgICAgICAgLy9cblxuICAgICAgICAgICAgY29uc3QgdmFyaWFibGVFbnRpdHkgPSBhd2FpdCAoXG4gICAgICAgICAgICAgIGF3YWl0IGltcG9ydCgnLi9lbnRpdGllcy90ZW1wbGF0ZS12YXJpYWJsZS5lbnRpdHknKVxuICAgICAgICAgICAgKS50ZW1wbGF0ZVZhcmlhYmxlRW50aXR5RmFjdG9yeShpbmplY3Rvcik7XG4gICAgICAgICAgICBlbnRpdHlSZWdpc3RyeS5yZWdpc3Rlcih2YXJpYWJsZUVudGl0eSBhcyBhbnkpO1xuICAgICAgICAgICAgLy9cbiAgICAgICAgICB9LFxuICAgICAgICAgIGRlcHM6IFtBWFBFbnRpdHlEZWZpbml0aW9uUmVnaXN0cnlTZXJ2aWNlLCBJbmplY3Rvcl0sIC8vIEFkZCBhbnkgZGVwZW5kZW5jaWVzIGlmIG5lZWRlZFxuICAgICAgICB9LFxuICAgICAgXSxcbiAgICB9O1xuICB9XG5cbiAgLyoqXG4gICAqIEBpZ25vcmVcbiAgICovXG4gIGNvbnN0cnVjdG9yKEBPcHRpb25hbCgpIEBJbmplY3QoJ0FYUF9SRUdJU1RFUl9URU1QTEFURV9HTE9CQUwnKSBpbnN0YW5jZXM6IGFueVtdKSB7fVxufVxuIl19
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import { AXPEntityDataProviderImpl, AXPStorageService } from '@acorex/platform/common';
|
2
|
+
import { Injectable, Injector } from '@angular/core';
|
3
|
+
import { GLOBAL_TEMPLATES } from './template-management-mock-data';
|
4
|
+
import * as i0 from "@angular/core";
|
5
|
+
export class TemplateManagementService {
|
6
|
+
constructor(injector) {
|
7
|
+
const storageService = injector.get(AXPStorageService);
|
8
|
+
//
|
9
|
+
this._globalTemplateDataProvider = new AXPEntityDataProviderImpl(storageService, 'globalTemplate');
|
10
|
+
this._globalTemplateDataProvider.initial(GLOBAL_TEMPLATES);
|
11
|
+
}
|
12
|
+
get globalTemplateDataProvider() {
|
13
|
+
return this._globalTemplateDataProvider;
|
14
|
+
}
|
15
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: TemplateManagementService, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
16
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: TemplateManagementService, providedIn: 'root' }); }
|
17
|
+
}
|
18
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: TemplateManagementService, decorators: [{
|
19
|
+
type: Injectable,
|
20
|
+
args: [{
|
21
|
+
providedIn: 'root',
|
22
|
+
}]
|
23
|
+
}], ctorParameters: () => [{ type: i0.Injector }] });
|
24
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVtcGxhdGUtbWFuYWdlbWVudC5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9tb2R1bGVzL3RlbXBsYXRlLW1hbmFnZW1lbnQvc3JjL2xpYi90ZW1wbGF0ZS1tYW5hZ2VtZW50LnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLHlC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4gIHByb3ZpZGVkSW46ICdyb290Jyxcbn0pXG5leHBvcnQgY2xhc3MgVGVtcGxhdGVNYW5hZ2VtZW50U2VydmljZSB7XG4gIHByb3RlY3RlZCBfZ2xvYmFsVGVtcGxhdGVEYXRhUHJvdmlkZXI6IGFueTtcblxuICBjb25zdHJ1Y3RvcihpbmplY3RvcjogSW5qZWN0b3IpIHtcbiAgICBjb25zdCBzdG9yYWdlU2VydmljZSA9IGluamVjdG9yLmdldChBWFBTdG9yYWdlU2VydmljZSk7XG4gICAgLy9cbiAgICB0aGlzLl9nbG9iYWxUZW1wbGF0ZURhdGFQcm92aWRlciA9IG5ldyBBWFBFbnRpdHlEYXRhUHJvdmlkZXJJbXBsPGFueT4oc3RvcmFnZVNlcnZpY2UsICdnbG9iYWxUZW1wbGF0ZScpO1xuICAgIHRoaXMuX2dsb2JhbFRlbXBsYXRlRGF0YVByb3ZpZGVyLmluaXRpYWwoR0xPQkFMX1RFTVBMQVRFUyk7XG4gIH1cblxuICBwdWJsaWMgZ2V0IGdsb2JhbFRlbXBsYXRlRGF0YVByb3ZpZGVyKCkge1xuICAgIHJldHVybiB0aGlzLl9nbG9iYWxUZW1wbGF0ZURhdGFQcm92aWRlcjtcbiAgfVxufVxuIl19
|
@@ -2,7 +2,7 @@ import * as i2 from '@acorex/modules/auth';
|
|
2
2
|
import { AXM_AUTH_CONFIG_TOKEN, AXMAuthModule } from '@acorex/modules/auth';
|
3
3
|
import * as i3 from '@acorex/platform/auth';
|
4
4
|
import { AXPSessionService, AXP_TENANT_LOADER, AXP_APPLICATION_LOADER, AXP_PERMISSION_LOADER, AXP_FEATURE_LOADER, AXPAuthModule } from '@acorex/platform/auth';
|
5
|
-
import { AXP_ROOT_CONFIG_TOKEN, AXPDataProvider } from '@acorex/platform/common';
|
5
|
+
import { AXP_ROOT_CONFIG_TOKEN, AXPStorageService, AXPDataGenerator, AXPDataProvider } from '@acorex/platform/common';
|
6
6
|
import * as i0 from '@angular/core';
|
7
7
|
import { inject, Injectable, Component, NgModule } from '@angular/core';
|
8
8
|
import * as i1$1 from '@angular/router';
|
@@ -581,6 +581,145 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
|
|
581
581
|
}]
|
582
582
|
}], ctorParameters: () => [{ type: i1$1.Router }, { type: i1$1.ActivatedRoute }] });
|
583
583
|
|
584
|
+
class AXMMockCommentService {
|
585
|
+
constructor() {
|
586
|
+
this.storageService = inject(AXPStorageService);
|
587
|
+
this.name = 'comments';
|
588
|
+
}
|
589
|
+
async get(params) {
|
590
|
+
const data = (await this.storageService.getAll(this.name));
|
591
|
+
return Promise.resolve({ totalCount: data.length, items: data });
|
592
|
+
}
|
593
|
+
async post(payload) {
|
594
|
+
const extraPayload = {
|
595
|
+
id: AXPDataGenerator.uuid(), // Generate a unique ID for the comment
|
596
|
+
memberId: AXPDataGenerator.uuid(), // Simulate member ID (e.g., the user posting)
|
597
|
+
memberType: AXPDataGenerator.pick(['user', 'admin']), // Simulate the member type (user/admin)
|
598
|
+
roomId: AXPDataGenerator.uuid(), // Generate a random room ID
|
599
|
+
messageVisibles: [], // Empty array for visibility, can be customized
|
600
|
+
messageStatuses: [], // Empty array for statuses, can be customized
|
601
|
+
messageHistories: [], // Empty array for history, can be customized
|
602
|
+
replies: [], // Initially no replies
|
603
|
+
isArchived: false, // Default to not archived
|
604
|
+
isLiked: false, // Default to not liked
|
605
|
+
reactionsCount: 0, // Default to 0 reactions
|
606
|
+
repliesCount: 0, // Default to 0 replies
|
607
|
+
user: {
|
608
|
+
userName: AXPDataGenerator.firstName().toLowerCase(),
|
609
|
+
firstName: AXPDataGenerator.firstName(),
|
610
|
+
lastName: AXPDataGenerator.lastName(),
|
611
|
+
picture: null,
|
612
|
+
id: AXPDataGenerator.uuid(),
|
613
|
+
},
|
614
|
+
};
|
615
|
+
const fullPayload = { ...payload, ...extraPayload };
|
616
|
+
if (payload.replyId) {
|
617
|
+
const message = await this.storageService.getOne(this.name, payload.replyId);
|
618
|
+
await this.storageService.updateOne(this.name, payload.replyId, {
|
619
|
+
...message,
|
620
|
+
replies: [...message.replies, fullPayload],
|
621
|
+
});
|
622
|
+
return Promise.resolve('done');
|
623
|
+
}
|
624
|
+
else {
|
625
|
+
await this.storageService.insertOne(this.name, fullPayload);
|
626
|
+
return Promise.resolve('done');
|
627
|
+
}
|
628
|
+
}
|
629
|
+
async put(payload) {
|
630
|
+
//const message = await this.storageService.getOne(this.name, payload.id);
|
631
|
+
await this.storageService.updateOne(this.name, payload.id, { content: payload.content });
|
632
|
+
return Promise.resolve('done');
|
633
|
+
}
|
634
|
+
async delete(payload) {
|
635
|
+
await this.storageService.deleteOne(this.name, payload.id);
|
636
|
+
return Promise.resolve();
|
637
|
+
}
|
638
|
+
async like(payload) {
|
639
|
+
const message = await this.storageService.getOne(this.name, payload.messageId);
|
640
|
+
await this.storageService.updateOne(this.name, payload.messageId, {
|
641
|
+
...message,
|
642
|
+
isLiked: !message.isLiked,
|
643
|
+
reactionsCount: message.isLiked ? --message.reactionsCount : ++message.reactionsCount,
|
644
|
+
});
|
645
|
+
return Promise.resolve('done');
|
646
|
+
}
|
647
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXMMockCommentService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
648
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXMMockCommentService, providedIn: 'root' }); }
|
649
|
+
}
|
650
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXMMockCommentService, decorators: [{
|
651
|
+
type: Injectable,
|
652
|
+
args: [{
|
653
|
+
providedIn: 'root',
|
654
|
+
}]
|
655
|
+
}] });
|
656
|
+
const COMMENTS = Array.from({ length: 10 }).map(() => {
|
657
|
+
const contentSource = [
|
658
|
+
'This is a comment.',
|
659
|
+
'I really like this!',
|
660
|
+
'Could you clarify your point?',
|
661
|
+
'Great job on this!',
|
662
|
+
'I have some suggestions.',
|
663
|
+
'This is quite insightful.',
|
664
|
+
'Thanks for sharing!',
|
665
|
+
'I disagree with this perspective.',
|
666
|
+
'Interesting take!',
|
667
|
+
'What do you think about this?',
|
668
|
+
];
|
669
|
+
const repliesCount = AXPDataGenerator.number(0, 3);
|
670
|
+
return {
|
671
|
+
id: AXPDataGenerator.uuid(),
|
672
|
+
entityId: 'test', // AXPDataGenerator.pick(ENTITIES).id,//need to fix
|
673
|
+
content: `<p>${AXPDataGenerator.pick(contentSource)}</p>`,
|
674
|
+
contentType: AXPDataGenerator.pick(['text', 'image', 'video']),
|
675
|
+
memberId: AXPDataGenerator.uuid(),
|
676
|
+
memberType: AXPDataGenerator.pick(['user', 'admin']),
|
677
|
+
roomId: AXPDataGenerator.uuid(),
|
678
|
+
isPrivate: AXPDataGenerator.boolean(),
|
679
|
+
replyId: null,
|
680
|
+
messageVisibles: [],
|
681
|
+
messageStatuses: [],
|
682
|
+
messageHistories: [],
|
683
|
+
replies: Array.from({ length: repliesCount }).map(() => {
|
684
|
+
return {
|
685
|
+
id: AXPDataGenerator.uuid(),
|
686
|
+
content: `<p>${AXPDataGenerator.pick(contentSource)}</p>`,
|
687
|
+
contentType: AXPDataGenerator.pick(['text']),
|
688
|
+
memberId: AXPDataGenerator.uuid(),
|
689
|
+
memberType: AXPDataGenerator.pick(['user', 'admin']),
|
690
|
+
roomId: AXPDataGenerator.uuid(),
|
691
|
+
isPrivate: AXPDataGenerator.boolean(),
|
692
|
+
replyId: AXPDataGenerator.uuid(),
|
693
|
+
messageVisibles: [],
|
694
|
+
messageStatuses: [],
|
695
|
+
messageHistories: [],
|
696
|
+
isArchived: AXPDataGenerator.boolean(),
|
697
|
+
isLiked: AXPDataGenerator.boolean(),
|
698
|
+
reactionsCount: AXPDataGenerator.number(0, 10),
|
699
|
+
repliesCount: 0,
|
700
|
+
user: {
|
701
|
+
userName: AXPDataGenerator.firstName().toLowerCase(),
|
702
|
+
firstName: AXPDataGenerator.firstName(),
|
703
|
+
lastName: AXPDataGenerator.lastName(),
|
704
|
+
picture: null,
|
705
|
+
id: AXPDataGenerator.uuid(),
|
706
|
+
},
|
707
|
+
};
|
708
|
+
}),
|
709
|
+
isArchived: AXPDataGenerator.boolean(),
|
710
|
+
isLiked: AXPDataGenerator.boolean(),
|
711
|
+
reactionsCount: AXPDataGenerator.number(0, 100),
|
712
|
+
repliesCount: repliesCount,
|
713
|
+
user: {
|
714
|
+
userName: AXPDataGenerator.firstName().toLowerCase(),
|
715
|
+
firstName: AXPDataGenerator.firstName(),
|
716
|
+
lastName: AXPDataGenerator.lastName(),
|
717
|
+
picture: null,
|
718
|
+
id: AXPDataGenerator.uuid(),
|
719
|
+
},
|
720
|
+
};
|
721
|
+
});
|
722
|
+
|
584
723
|
class AXMCommentService {
|
585
724
|
constructor() {
|
586
725
|
this.configs = inject(AXP_ROOT_CONFIG_TOKEN);
|
@@ -997,5 +1136,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
|
|
997
1136
|
* Generated bundle index. Do not edit.
|
998
1137
|
*/
|
999
1138
|
|
1000
|
-
export { AXMBackendDataProvider, AXMBackendModule, AXMCommentService, AXMConfigurationService, AXMFileManagementService, AXMLocalDataProvider, AXMModuleDesignerService, AXMOidcApplicationLoader, AXMOidcFeatureLoader, AXMOidcPermissionLoader, AXMOidcStrategy, AXMOidcTenantLoader };
|
1139
|
+
export { AXMBackendDataProvider, AXMBackendModule, AXMCommentService, AXMConfigurationService, AXMFileManagementService, AXMLocalDataProvider, AXMMockCommentService, AXMModuleDesignerService, AXMOidcApplicationLoader, AXMOidcFeatureLoader, AXMOidcPermissionLoader, AXMOidcStrategy, AXMOidcTenantLoader, COMMENTS };
|
1001
1140
|
//# sourceMappingURL=acorex-modules-backend.mjs.map
|