@messaia/cdk 18.1.2 → 18.2.0
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/esm2022/lib/base/components/base.component.mjs +5 -1
- package/esm2022/lib/base/components/generic-form-base.component.mjs +25 -3
- package/esm2022/lib/base/interfaces/ibase-component.mjs +1 -1
- package/esm2022/lib/base/interfaces/igeneric-form-base.mjs +1 -1
- package/esm2022/lib/common/models/icon.mjs +2 -2
- package/esm2022/lib/common/models/permission.mjs +29 -0
- package/esm2022/lib/common/public_api.mjs +2 -1
- package/esm2022/lib/http/services/generic.service.mjs +3 -3
- package/fesm2022/messaia-cdk.mjs +60 -6
- package/fesm2022/messaia-cdk.mjs.map +1 -1
- package/lib/base/components/base.component.d.ts +4 -0
- package/lib/base/components/generic-form-base.component.d.ts +9 -2
- package/lib/base/interfaces/ibase-component.d.ts +4 -0
- package/lib/base/interfaces/igeneric-form-base.d.ts +5 -1
- package/lib/common/models/icon.d.ts +1 -1
- package/lib/common/models/permission.d.ts +26 -0
- package/lib/common/public_api.d.ts +1 -0
- package/lib/http/services/generic.service.d.ts +1 -1
- package/package.json +1 -1
|
@@ -109,6 +109,10 @@ export declare abstract class BaseComponent implements IBaseComponent, OnInit, A
|
|
|
109
109
|
* Permission flag for creating new entries.
|
|
110
110
|
*/
|
|
111
111
|
canCreate: boolean;
|
|
112
|
+
/**
|
|
113
|
+
* Permission flag for reading new entries.
|
|
114
|
+
*/
|
|
115
|
+
canRead: boolean;
|
|
112
116
|
/**
|
|
113
117
|
* Permission flag for updating existing entries.
|
|
114
118
|
*/
|
|
@@ -7,6 +7,7 @@ import { ActivatedRoute } from '@angular/router';
|
|
|
7
7
|
import { Observable } from 'rxjs';
|
|
8
8
|
import { ActionItem } from '../../common/models/action-item';
|
|
9
9
|
import { IEntity } from '../../common/models/entity';
|
|
10
|
+
import { Permission } from '../../common/models/permission';
|
|
10
11
|
import { SaveAction } from '../../common/models/save-action';
|
|
11
12
|
import { FormDefinition } from '../../forms/models/form-definition';
|
|
12
13
|
import { FormFieldGroupDefinition } from '../../forms/models/form-field-group-definition';
|
|
@@ -212,12 +213,18 @@ export declare abstract class GenericFormBaseComponent<TEntity extends IEntity,
|
|
|
212
213
|
* @param callback - A function to be called after the item has been successfully loaded.
|
|
213
214
|
* This function will receive the loaded item as an argument.
|
|
214
215
|
*/
|
|
215
|
-
loadItem(callback?: (item:
|
|
216
|
+
loadItem(callback?: (item: {
|
|
217
|
+
entity: TEntity;
|
|
218
|
+
permissions: Permission;
|
|
219
|
+
}) => void): void;
|
|
216
220
|
/**
|
|
217
221
|
* Loads an item by ID asynchronously.
|
|
218
222
|
* @returns An Observable of the loaded entity.
|
|
219
223
|
*/
|
|
220
|
-
loadItemAsync(): Observable<
|
|
224
|
+
loadItemAsync(): Observable<{
|
|
225
|
+
entity: TEntity;
|
|
226
|
+
permissions: Permission;
|
|
227
|
+
}>;
|
|
221
228
|
/**
|
|
222
229
|
* Saves data into the database.
|
|
223
230
|
* This method validates the form, checks if it's valid, and sends data to the server to either update or create a new record.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { FormGroup, NgForm } from "@angular/forms";
|
|
2
2
|
import { Observable } from "rxjs";
|
|
3
3
|
import { IEntity } from "../../common/models/entity";
|
|
4
|
+
import { Permission } from "../../common/models/permission";
|
|
4
5
|
import { SaveAction } from "../../common/models/save-action";
|
|
5
6
|
import { IBaseComponent } from "./ibase-component";
|
|
6
7
|
export interface IGenericFormBaseComponent<TEntity extends IEntity | any> extends IBaseComponent {
|
|
@@ -51,7 +52,10 @@ export interface IGenericFormBaseComponent<TEntity extends IEntity | any> extend
|
|
|
51
52
|
/**
|
|
52
53
|
* Loads an item by ID asyncly
|
|
53
54
|
*/
|
|
54
|
-
loadItemAsync(): Observable<
|
|
55
|
+
loadItemAsync(): Observable<{
|
|
56
|
+
entity: TEntity;
|
|
57
|
+
permissions: Permission;
|
|
58
|
+
}>;
|
|
55
59
|
/**
|
|
56
60
|
* Saves data into database.
|
|
57
61
|
* @param action
|
|
@@ -32,7 +32,7 @@ export declare class Icon<TEntity = any, TContext = any> {
|
|
|
32
32
|
*/
|
|
33
33
|
hide?: (x?: TEntity, ctx?: TContext, index?: number) => any;
|
|
34
34
|
/**
|
|
35
|
-
* Constructs a new instance of
|
|
35
|
+
* Constructs a new instance of Icon.
|
|
36
36
|
* @param init Optional configuration object to initialize properties.
|
|
37
37
|
*/
|
|
38
38
|
constructor(init?: Partial<Icon<TEntity, TContext>>);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents the permissions associated with an entity.
|
|
3
|
+
*/
|
|
4
|
+
export declare class Permission {
|
|
5
|
+
/**
|
|
6
|
+
* Indicates whether the entity can be created (optional, based on use case).
|
|
7
|
+
*/
|
|
8
|
+
canCreate: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Indicates whether the entity can be viewed.
|
|
11
|
+
*/
|
|
12
|
+
canRead: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Indicates whether the entity can be edited.
|
|
15
|
+
*/
|
|
16
|
+
canUpdate: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Indicates whether the entity can be deleted.
|
|
19
|
+
*/
|
|
20
|
+
canDelete: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Constructs a new instance of Permission.
|
|
23
|
+
* @param init Optional configuration object to initialize properties.
|
|
24
|
+
*/
|
|
25
|
+
constructor(init?: Partial<Permission>);
|
|
26
|
+
}
|
|
@@ -13,6 +13,7 @@ export * from './models/enum-metadata';
|
|
|
13
13
|
export * from './models/icommon-handler-context';
|
|
14
14
|
export * from './models/name-number-projection';
|
|
15
15
|
export * from './models/name-projection';
|
|
16
|
+
export * from './models/permission';
|
|
16
17
|
export * from './models/title-projection';
|
|
17
18
|
export * from './pipes/bind';
|
|
18
19
|
export * from './pipes/data-source.pipe';
|
|
@@ -23,7 +23,7 @@ export declare class GenericService<T extends any> {
|
|
|
23
23
|
* @param params Adds query params to the request
|
|
24
24
|
* @param headers Adds headers to the request
|
|
25
25
|
*/
|
|
26
|
-
get<T>(id: string | number, params?: Object | null, headers?: Object, handleError?: boolean): Observable<any>;
|
|
26
|
+
get<T>(id: string | number, params?: Object | null, headers?: Object, handleError?: boolean, observeResponse?: boolean): Observable<any>;
|
|
27
27
|
/**
|
|
28
28
|
* Counts entities
|
|
29
29
|
*
|