@rosoftlab/core 1.0.5-alpha-5 → 1.0.5-alpha-7
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/fesm2022/rosoftlab-core.mjs +1242 -1178
- package/fesm2022/rosoftlab-core.mjs.map +1 -1
- package/lib/auth/auth.service.d.ts +9 -3
- package/lib/auth/provide-auth.d.ts +1 -1
- package/lib/auth/tokens.d.ts +1 -0
- package/lib/base-components/base-crud-implementation.d.ts +2 -2
- package/lib/base-components/base-table-implementation.d.ts +2 -2
- package/lib/index.d.ts +2 -0
- package/lib/models/base.model.d.ts +9 -16
- package/lib/models/employee.d.ts +0 -1
- package/lib/models/menu.d.ts +0 -1
- package/lib/models/metadata-storage.d.ts +1 -0
- package/lib/models/right.d.ts +0 -1
- package/lib/models/role.d.ts +0 -1
- package/lib/models/user.d.ts +0 -1
- package/lib/services/base-datastore.service.d.ts +4 -3
- package/lib/services/base.service.d.ts +5 -4
- package/lib/services/datastore-port.d.ts +19 -0
- package/lib/services/employee.service.d.ts +2 -2
- package/lib/services/right.service.d.ts +3 -2
- package/lib/services/role.service.d.ts +3 -2
- package/lib/services/user.service.d.ts +3 -2
- package/lib/tokens/datastore-token.d.ts +3 -0
- package/lib/tokens/dynamic-form-tokens.d.ts +2 -2
- package/package.json +1 -1
|
@@ -1,11 +1,16 @@
|
|
|
1
|
+
import { HttpClient } from '@angular/common/http';
|
|
2
|
+
import type { UserManagerSettings } from 'oidc-client-ts';
|
|
1
3
|
import { UserManager } from 'oidc-client-ts';
|
|
4
|
+
import { Observable } from 'rxjs';
|
|
2
5
|
import * as i0 from "@angular/core";
|
|
3
6
|
export declare class AuthService {
|
|
4
7
|
private manager;
|
|
8
|
+
private http;
|
|
9
|
+
private guestSettings?;
|
|
5
10
|
private _authNavStatusSource;
|
|
6
|
-
authNavStatus$:
|
|
11
|
+
authNavStatus$: Observable<boolean>;
|
|
7
12
|
private user;
|
|
8
|
-
constructor(manager: UserManager);
|
|
13
|
+
constructor(manager: UserManager, http: HttpClient, guestSettings?: UserManagerSettings);
|
|
9
14
|
login(): void;
|
|
10
15
|
logout(): void;
|
|
11
16
|
completeAuthentication(): Promise<void>;
|
|
@@ -24,6 +29,7 @@ export declare class AuthService {
|
|
|
24
29
|
get organisationId(): string;
|
|
25
30
|
get organisationName(): string;
|
|
26
31
|
signout(): Promise<void>;
|
|
27
|
-
|
|
32
|
+
loginWithGuest(): Promise<void>;
|
|
33
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AuthService, [null, null, { optional: true; }]>;
|
|
28
34
|
static ɵprov: i0.ɵɵInjectableDeclaration<AuthService>;
|
|
29
35
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Provider } from '@angular/core';
|
|
2
2
|
import type { UserManagerSettings } from 'oidc-client-ts';
|
|
3
|
-
export declare function provideAuth(settings: UserManagerSettings): Provider[];
|
|
3
|
+
export declare function provideAuth(settings: UserManagerSettings, guest_settings?: UserManagerSettings): Provider[];
|
package/lib/auth/tokens.d.ts
CHANGED
|
@@ -3,3 +3,4 @@ export declare class Tokens {
|
|
|
3
3
|
import { InjectionToken } from '@angular/core';
|
|
4
4
|
import type { UserManagerSettings } from 'oidc-client-ts';
|
|
5
5
|
export declare const OIDC_CLIENT_SETTINGS: InjectionToken<UserManagerSettings>;
|
|
6
|
+
export declare const OIDC_GUEST_CLIENT_SETTINGS: InjectionToken<UserManagerSettings>;
|
|
@@ -9,8 +9,8 @@ export declare abstract class BaseCrudImplementation<T = any> {
|
|
|
9
9
|
protected route: ActivatedRoute;
|
|
10
10
|
protected translate: TranslateService;
|
|
11
11
|
protected location: Location;
|
|
12
|
-
protected modelService: import("@rosoftlab/core").BaseService<import("@rosoftlab/core").BaseModel
|
|
13
|
-
protected modelToken: import("@angular/core").Type<import("@rosoftlab/core").BaseModel
|
|
12
|
+
protected modelService: import("@rosoftlab/core").BaseService<import("@rosoftlab/core").BaseModel<string>>;
|
|
13
|
+
protected modelToken: import("@angular/core").Type<import("@rosoftlab/core").BaseModel<string>>;
|
|
14
14
|
protected dialogService: import("../interfaces/dialog.interface").IDialogService;
|
|
15
15
|
model: T | null;
|
|
16
16
|
modelName: string | null;
|
|
@@ -6,8 +6,8 @@ import * as i0 from "@angular/core";
|
|
|
6
6
|
export declare abstract class BaseTableImplementation<T = any, TEditArgs = any, TRemoveArgs = any> implements OnInit {
|
|
7
7
|
protected router: Router;
|
|
8
8
|
protected translate: TranslateService;
|
|
9
|
-
protected dataService: import("@rosoftlab/core").BaseService<import("@rosoftlab/core").BaseModel
|
|
10
|
-
protected modelToken: import("@angular/core").Type<import("@rosoftlab/core").BaseModel
|
|
9
|
+
protected dataService: import("@rosoftlab/core").BaseService<import("@rosoftlab/core").BaseModel<string>>;
|
|
10
|
+
protected modelToken: import("@angular/core").Type<import("@rosoftlab/core").BaseModel<string>>;
|
|
11
11
|
protected dialogService: import("../interfaces/dialog.interface").IDialogService;
|
|
12
12
|
basePath: string;
|
|
13
13
|
title: string;
|
package/lib/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export * from './interfaces/datastore-config.interface';
|
|
|
10
10
|
export * from './interfaces/model-config.interface';
|
|
11
11
|
export * from './interfaces/overrides.interface';
|
|
12
12
|
export * from './interfaces/property-converter.interface';
|
|
13
|
+
export * from './services/datastore-port';
|
|
13
14
|
export * from './models/base-meta.model';
|
|
14
15
|
export * from './models/base-query-data';
|
|
15
16
|
export * from './models/base.model';
|
|
@@ -24,3 +25,4 @@ export * from './rsl-base-module';
|
|
|
24
25
|
export * from './services/base.service';
|
|
25
26
|
export * from './services/local-file.service';
|
|
26
27
|
export * from './validators/pattern-validator';
|
|
28
|
+
export * from './tokens/datastore-token';
|
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
import { HttpHeaders } from '@angular/common/http';
|
|
2
1
|
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
|
|
3
|
-
import { Observable } from 'rxjs';
|
|
4
2
|
import { ModelConfig } from '../interfaces/model-config.interface';
|
|
5
|
-
import {
|
|
6
|
-
export declare class BaseModel {
|
|
7
|
-
protected _datastore: BaseDatastore;
|
|
3
|
+
import type { ModelType } from '../services/datastore-port';
|
|
4
|
+
export declare class BaseModel<TId = string> {
|
|
8
5
|
highlighted: boolean;
|
|
9
|
-
id:
|
|
6
|
+
id: TId;
|
|
10
7
|
[key: string]: any;
|
|
11
|
-
constructor(
|
|
12
|
-
save(params?: any, headers?: HttpHeaders, customUrl?: string, customBody?: any): Observable<this>;
|
|
13
|
-
patch(origModel: this, params?: any, headers?: HttpHeaders, customUrl?: string): Observable<this>;
|
|
14
|
-
replace(params?: any, headers?: HttpHeaders, customUrl?: string, customBody?: any): Observable<this>;
|
|
8
|
+
constructor(data?: any);
|
|
15
9
|
get attributeMetadata(): any;
|
|
16
10
|
set attributeMetadata(val: any);
|
|
17
11
|
get hasDirtyAttributes(): boolean;
|
|
@@ -19,13 +13,12 @@ export declare class BaseModel {
|
|
|
19
13
|
get modelConfig(): ModelConfig;
|
|
20
14
|
protected deserializeModel<T extends BaseModel>(modelType: ModelType<T>, data: any): T;
|
|
21
15
|
protected transformSerializedNamesToPropertyNames<T extends BaseModel>(modelType: ModelType<T>, attributes: any): any;
|
|
22
|
-
getModelPropertyNames(model: BaseModel): any;
|
|
23
|
-
getModelRequiredPropertyNames(model: BaseModel): any;
|
|
24
|
-
getModelDefaultPropertyValues(model: BaseModel): any;
|
|
25
|
-
getModelSubGroupPropertyNames(model: BaseModel): any;
|
|
16
|
+
getModelPropertyNames(model: BaseModel<any>): any;
|
|
17
|
+
getModelRequiredPropertyNames(model: BaseModel<any>): any;
|
|
18
|
+
getModelDefaultPropertyValues(model: BaseModel<any>): any;
|
|
19
|
+
getModelSubGroupPropertyNames(model: BaseModel<any>): any;
|
|
26
20
|
getFromGroup(fb: UntypedFormBuilder): UntypedFormGroup;
|
|
27
21
|
private getSubFromGroup;
|
|
28
|
-
getModelFromFormGroup(formGroup: UntypedFormGroup, id?:
|
|
29
|
-
getSerializedModel(): any;
|
|
22
|
+
getModelFromFormGroup(formGroup: UntypedFormGroup, id?: TId): void;
|
|
30
23
|
getCellClass(property: string): string;
|
|
31
24
|
}
|
package/lib/models/employee.d.ts
CHANGED
package/lib/models/menu.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare class MetadataStorage {
|
|
2
2
|
private static metadataMap;
|
|
3
3
|
static getMetadata(key: string, target: object, propertyKey?: string): any;
|
|
4
|
+
static getMergedMetadata(key: string, target: object): any;
|
|
4
5
|
static setMetadata(key: string, value: any, target: object, propertyKey?: string): void;
|
|
5
6
|
}
|
package/lib/models/right.d.ts
CHANGED
package/lib/models/role.d.ts
CHANGED
package/lib/models/user.d.ts
CHANGED
|
@@ -4,9 +4,9 @@ import { DatastoreConfig } from '../interfaces/datastore-config.interface';
|
|
|
4
4
|
import { BaseQueryData } from '../models/base-query-data';
|
|
5
5
|
import { BaseModel } from '../models/base.model';
|
|
6
6
|
import { CacheService } from './cache.service';
|
|
7
|
+
import type { DatastorePort, ModelType } from './datastore-port';
|
|
7
8
|
import * as i0 from "@angular/core";
|
|
8
|
-
export
|
|
9
|
-
export declare class BaseDatastore {
|
|
9
|
+
export declare class BaseDatastore implements DatastorePort {
|
|
10
10
|
protected httpClient: HttpClient;
|
|
11
11
|
protected cacheService: CacheService;
|
|
12
12
|
protected config: DatastoreConfig;
|
|
@@ -24,7 +24,7 @@ export declare class BaseDatastore {
|
|
|
24
24
|
patchCustom<U, T extends BaseModel>(modelType: ModelType<T>, body: any, params?: any, headers?: HttpHeaders, customUrl?: string): Observable<U>;
|
|
25
25
|
createRecord<T extends BaseModel>(modelType: ModelType<T>, data?: any): T;
|
|
26
26
|
saveRecord<T extends BaseModel>(attributesMetadata: any, model: T, params?: any, headers?: HttpHeaders, customUrl?: string, customBody?: any): Observable<T>;
|
|
27
|
-
patchRecord<T extends BaseModel>(attributesMetadata: any, model: T, origModel
|
|
27
|
+
patchRecord<T extends BaseModel>(attributesMetadata: any, model: T, origModel?: T, params?: any, headers?: HttpHeaders, customUrl?: string): Observable<T>;
|
|
28
28
|
replaceRecord<T extends BaseModel>(attributesMetadata: any, model: T, params?: any, headers?: HttpHeaders, customUrl?: string, customBody?: any): Observable<T>;
|
|
29
29
|
deleteRecord<T extends BaseModel>(modelType: ModelType<T>, id: string, headers?: HttpHeaders, customUrl?: string): Observable<{}>;
|
|
30
30
|
buildUrl<T extends BaseModel>(modelType: ModelType<T>, customUrl?: string): string;
|
|
@@ -36,6 +36,7 @@ export declare class BaseDatastore {
|
|
|
36
36
|
get datastoreConfig(): DatastoreConfig;
|
|
37
37
|
protected transformSerializedNamesToPropertyNames<T extends BaseModel>(modelType: ModelType<T>, attributes: any): any;
|
|
38
38
|
protected getModelPropertyNames(model: BaseModel): any;
|
|
39
|
+
protected getApiFieldMap<T extends BaseModel>(modelType: ModelType<T>): Record<string, string> | null;
|
|
39
40
|
buildHeaders(customHeaders?: HttpHeaders): HttpHeaders;
|
|
40
41
|
buildParams<T extends BaseModel>(modelType: ModelType<T>, params: any): HttpParams;
|
|
41
42
|
protected entityToModel<T extends BaseModel>(res: any, modelType: ModelType<T>, model?: T): T;
|
|
@@ -3,12 +3,12 @@ import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
|
|
|
3
3
|
import { Observable } from 'rxjs';
|
|
4
4
|
import { BaseQueryData } from '../models/base-query-data';
|
|
5
5
|
import { BaseModel } from '../models/base.model';
|
|
6
|
-
import {
|
|
6
|
+
import type { DatastorePort, ModelType } from './datastore-port';
|
|
7
7
|
import * as i0 from "@angular/core";
|
|
8
8
|
export declare class BaseService<T extends BaseModel> {
|
|
9
|
-
datastore:
|
|
9
|
+
datastore: DatastorePort;
|
|
10
10
|
modelType: ModelType<T>;
|
|
11
|
-
constructor(datastore:
|
|
11
|
+
constructor(datastore: DatastorePort);
|
|
12
12
|
setModelType(modelType: ModelType<T>): void;
|
|
13
13
|
get(id?: any, customInclude?: string): Observable<T>;
|
|
14
14
|
getAll(page: number, pageSize: number, sort?: string, filters?: string, customInclude?: string): Observable<BaseQueryData<T>>;
|
|
@@ -17,10 +17,11 @@ export declare class BaseService<T extends BaseModel> {
|
|
|
17
17
|
postCustom<U>(body: any, params?: any, headers?: HttpHeaders, customUrl?: string): Observable<U>;
|
|
18
18
|
patchCustom<U>(body: any, params?: any, headers?: HttpHeaders, customUrl?: string): Observable<U>;
|
|
19
19
|
save(docTypeOrFormGroup: T | UntypedFormGroup, id?: any, origModel?: T): Observable<T>;
|
|
20
|
-
patch(docTypeOrFormGroup: T | UntypedFormGroup, origModel
|
|
20
|
+
patch(docTypeOrFormGroup: T | UntypedFormGroup, origModel?: T, id?: any): Observable<T>;
|
|
21
21
|
newModel(data?: any): T;
|
|
22
22
|
toFormGroup(fb: UntypedFormBuilder, fromModel?: T): UntypedFormGroup;
|
|
23
23
|
fromFormGroup(formGroup: UntypedFormGroup, id?: any): T;
|
|
24
|
+
serializeModel(model: T): any;
|
|
24
25
|
getSelectValues(property: string): Observable<any[]>;
|
|
25
26
|
static ɵfac: i0.ɵɵFactoryDeclaration<BaseService<any>, never>;
|
|
26
27
|
static ɵprov: i0.ɵɵInjectableDeclaration<BaseService<any>>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { HttpHeaders } from '@angular/common/http';
|
|
2
|
+
import type { Observable } from 'rxjs';
|
|
3
|
+
import type { BaseQueryData } from '../models/base-query-data';
|
|
4
|
+
import type { BaseModel } from '../models/base.model';
|
|
5
|
+
export type ModelType<T extends BaseModel> = new (data: any) => T;
|
|
6
|
+
export interface DatastorePort {
|
|
7
|
+
findAll<T extends BaseModel>(modelType: ModelType<T>, params?: any, headers?: HttpHeaders, customUrl?: string): Observable<BaseQueryData<T>>;
|
|
8
|
+
findRecord<T extends BaseModel>(modelType: ModelType<T>, id?: string, params?: any, headers?: HttpHeaders, customUrl?: string): Observable<T>;
|
|
9
|
+
getCustom<U, T extends BaseModel>(modelType: ModelType<T>, params?: any, headers?: HttpHeaders, customUrl?: string, customResponseType?: any): Observable<U>;
|
|
10
|
+
postCustom<U, T extends BaseModel>(modelType: ModelType<T>, body: any, params?: any, headers?: HttpHeaders, customUrl?: string): Observable<U>;
|
|
11
|
+
patchCustom<U, T extends BaseModel>(modelType: ModelType<T>, body: any, params?: any, headers?: HttpHeaders, customUrl?: string): Observable<U>;
|
|
12
|
+
createRecord<T extends BaseModel>(modelType: ModelType<T>, data?: any): T;
|
|
13
|
+
saveRecord<T extends BaseModel>(attributesMetadata: any, model: T, params?: any, headers?: HttpHeaders, customUrl?: string, customBody?: any): Observable<T>;
|
|
14
|
+
patchRecord<T extends BaseModel>(attributesMetadata: any, model: T, origModel?: T, params?: any, headers?: HttpHeaders, customUrl?: string): Observable<T>;
|
|
15
|
+
replaceRecord<T extends BaseModel>(attributesMetadata: any, model: T, params?: any, headers?: HttpHeaders, customUrl?: string, customBody?: any): Observable<T>;
|
|
16
|
+
deleteRecord<T extends BaseModel>(modelType: ModelType<T>, id: string, headers?: HttpHeaders, customUrl?: string): Observable<{}>;
|
|
17
|
+
buildUrl<T extends BaseModel>(modelType: ModelType<T>, customUrl?: string): string;
|
|
18
|
+
modelToEntity<T extends BaseModel>(model: T, attributesMetadata: any, allAttributes?: boolean): any;
|
|
19
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { DatastorePort } from './datastore-port';
|
|
2
2
|
import { Employee } from '../models';
|
|
3
3
|
import { BaseService } from './base.service';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
export declare class EmployeeService extends BaseService<Employee> {
|
|
6
|
-
constructor(datastore:
|
|
6
|
+
constructor(datastore: DatastorePort);
|
|
7
7
|
static ɵfac: i0.ɵɵFactoryDeclaration<EmployeeService, never>;
|
|
8
8
|
static ɵprov: i0.ɵɵInjectableDeclaration<EmployeeService>;
|
|
9
9
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { DatastorePort } from './datastore-port';
|
|
2
|
+
import { Right } from '../core';
|
|
2
3
|
import { BaseService } from './base.service';
|
|
3
4
|
import * as i0 from "@angular/core";
|
|
4
5
|
export declare class RightService extends BaseService<Right> {
|
|
5
|
-
constructor(datastore:
|
|
6
|
+
constructor(datastore: DatastorePort);
|
|
6
7
|
static ɵfac: i0.ɵɵFactoryDeclaration<RightService, never>;
|
|
7
8
|
static ɵprov: i0.ɵɵInjectableDeclaration<RightService>;
|
|
8
9
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
-
import {
|
|
2
|
+
import type { DatastorePort } from './datastore-port';
|
|
3
|
+
import { Right } from '../core';
|
|
3
4
|
import { Role } from '../models/role';
|
|
4
5
|
import { BaseService } from './base.service';
|
|
5
6
|
import * as i0 from "@angular/core";
|
|
6
7
|
export declare class RoleService extends BaseService<Role> {
|
|
7
|
-
constructor(datastore:
|
|
8
|
+
constructor(datastore: DatastorePort);
|
|
8
9
|
getRoleRights(roleId: string): Observable<Right[]>;
|
|
9
10
|
static ɵfac: i0.ɵɵFactoryDeclaration<RoleService, never>;
|
|
10
11
|
static ɵprov: i0.ɵɵInjectableDeclaration<RoleService>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
-
import { BaseQueryData, BaseService,
|
|
2
|
+
import { BaseQueryData, BaseService, Menu, Right, User } from '../core';
|
|
3
|
+
import type { DatastorePort } from './datastore-port';
|
|
3
4
|
import * as i0 from "@angular/core";
|
|
4
5
|
export declare class UserService extends BaseService<User> {
|
|
5
6
|
userRights: Right[];
|
|
6
|
-
constructor(datastore:
|
|
7
|
+
constructor(datastore: DatastorePort);
|
|
7
8
|
getRights(): Observable<BaseQueryData<Right>>;
|
|
8
9
|
hasRightForLink(link: string): boolean;
|
|
9
10
|
getMenus(): Observable<BaseQueryData<Menu>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { InjectionToken, Type } from '@angular/core';
|
|
2
2
|
import { BaseModel } from '../models/base.model';
|
|
3
3
|
import { BaseService } from '../services/base.service';
|
|
4
|
-
export declare const MODEL_SERVICE: InjectionToken<BaseService<BaseModel
|
|
5
|
-
export declare const MODEL_TOKEN: InjectionToken<Type<BaseModel
|
|
4
|
+
export declare const MODEL_SERVICE: InjectionToken<BaseService<BaseModel<string>>>;
|
|
5
|
+
export declare const MODEL_TOKEN: InjectionToken<Type<BaseModel<string>>>;
|
|
6
6
|
export declare const RSL_FORM_IMPLEMENTATIONS_TOKEN: InjectionToken<Record<string, Type<any>>>;
|