@rosoftlab/core 1.0.5-alpha-1 → 1.0.5-alpha-2
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 +393 -88
- package/fesm2022/rosoftlab-core.mjs.map +1 -1
- package/index.d.ts +5 -0
- package/lib/auth/auth.service.d.ts +29 -0
- package/lib/auth/index.d.ts +4 -0
- package/lib/auth/provide-auth.d.ts +3 -0
- package/lib/auth/tokens.d.ts +5 -0
- package/lib/auth/user-manager.factory.d.ts +5 -0
- package/lib/base-components/base-crud-implementation.d.ts +44 -0
- package/lib/base-components/base-form-edit.component.d.ts +56 -0
- package/lib/base-components/base-table-implementation.d.ts +56 -0
- package/lib/base-components/field-error-display/field-error-display.component.d.ts +7 -0
- package/lib/base-components/index.d.ts +3 -0
- package/lib/base-components/page-not-found/page-not-found.component.d.ts +8 -0
- package/lib/base-components/under-construction/under-construction.component.d.ts +6 -0
- package/lib/configurations.d.ts +6 -0
- package/lib/constants/symbols.d.ts +1 -0
- package/lib/converters/date/date.converter.d.ts +5 -0
- package/lib/core.d.ts +16 -0
- package/lib/decorators/attribute.decorator.d.ts +2 -0
- package/lib/decorators/base-datastore-config.decorator.d.ts +1 -0
- package/lib/decorators/base-model-config.decorator.d.ts +1 -0
- package/lib/decorators/custom.type.decorator.d.ts +1 -0
- package/lib/grid-layout-format.enum.d.ts +12 -0
- package/lib/index.d.ts +26 -0
- package/lib/interceptors/cache.interceptor.d.ts +13 -0
- package/lib/interceptors/index.d.ts +1 -0
- package/lib/interfaces/attribute-decorator-options.interface.d.ts +8 -0
- package/lib/interfaces/datastore-config.interface.d.ts +8 -0
- package/lib/interfaces/dialog.interface.d.ts +9 -0
- package/lib/interfaces/model-config.interface.d.ts +10 -0
- package/lib/interfaces/overrides.interface.d.ts +5 -0
- package/lib/interfaces/property-converter.interface.d.ts +4 -0
- package/lib/models/base-meta.model.d.ts +5 -0
- package/lib/models/base-query-data.d.ts +7 -0
- package/lib/models/base.model.d.ts +31 -0
- package/lib/models/employee.d.ts +12 -0
- package/lib/models/error-response.model.d.ts +17 -0
- package/lib/models/filter-request.d.ts +8 -0
- package/lib/models/index.d.ts +5 -0
- package/lib/models/menu.d.ts +15 -0
- package/lib/models/metadata-storage.d.ts +5 -0
- package/lib/models/right.d.ts +14 -0
- package/lib/models/role.d.ts +6 -0
- package/lib/models/rule.d.ts +5 -0
- package/lib/models/user.d.ts +8 -0
- package/lib/pipes/Nl2brPipe.pipe.d.ts +7 -0
- package/lib/pipes/input-error.pipe.d.ts +10 -0
- package/lib/providers.d.ts +2 -0
- package/lib/resolvers/dynamically-class-resolver.d.ts +3 -0
- package/lib/resolvers/dynamically-service-resolver.d.ts +3 -0
- package/lib/resolvers/index.d.ts +2 -0
- package/lib/rsl-base-module.d.ts +13 -0
- package/lib/services/base-datastore.service.d.ts +47 -0
- package/lib/services/base.service.d.ts +27 -0
- package/lib/services/cache.service.d.ts +11 -0
- package/lib/services/datastore.service.d.ts +12 -0
- package/lib/services/dialog.service.d.ts +7 -0
- package/lib/services/employee.service.d.ts +9 -0
- package/lib/services/index.d.ts +11 -0
- package/lib/services/local-file.service.d.ts +11 -0
- package/lib/services/right.service.d.ts +8 -0
- package/lib/services/role.service.d.ts +11 -0
- package/lib/services/route-history.service.d.ts +12 -0
- package/lib/services/translate-loader.service.d.ts +14 -0
- package/lib/services/user.service.d.ts +12 -0
- package/lib/tokens/table-tokens.d.ts +7 -0
- package/lib/utils.d.ts +2 -0
- package/lib/validators/pattern-validator.d.ts +4 -0
- package/package.json +9 -9
- package/public-api.d.ts +1 -0
- package/types/rosoftlab-core.d.ts +0 -507
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ModuleWithProviders } from '@angular/core';
|
|
2
|
+
import { Configurations } from './configurations';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import * as i1 from "@angular/common";
|
|
5
|
+
import * as i2 from "@ngx-translate/core";
|
|
6
|
+
import * as i3 from "@angular/forms";
|
|
7
|
+
import * as i4 from "@angular/common/http";
|
|
8
|
+
export declare class RslBaseModule {
|
|
9
|
+
static forRoot(config: Configurations): ModuleWithProviders<RslBaseModule>;
|
|
10
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RslBaseModule, never>;
|
|
11
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<RslBaseModule, never, [typeof i1.CommonModule, typeof i2.TranslateModule, typeof i3.ReactiveFormsModule], [typeof i4.HttpClientModule, typeof i2.TranslateModule]>;
|
|
12
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<RslBaseModule>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { HttpClient, HttpErrorResponse, HttpHeaders, HttpParams } from '@angular/common/http';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { DatastoreConfig } from '../interfaces/datastore-config.interface';
|
|
4
|
+
import { BaseQueryData } from '../models/base-query-data';
|
|
5
|
+
import { BaseModel } from '../models/base.model';
|
|
6
|
+
import { CacheService } from './cache.service';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
export type ModelType<T extends BaseModel> = new (datastore: BaseDatastore, data: any) => T;
|
|
9
|
+
export declare class BaseDatastore {
|
|
10
|
+
protected httpClient: HttpClient;
|
|
11
|
+
protected cacheService: CacheService;
|
|
12
|
+
protected config: DatastoreConfig;
|
|
13
|
+
private _store;
|
|
14
|
+
private toQueryString;
|
|
15
|
+
private get getDirtyAttributes();
|
|
16
|
+
get getAllAttributes(): (attributedMetadata: any, model?: any) => object;
|
|
17
|
+
private static getDirtyAttributes;
|
|
18
|
+
private static getAllAttributes;
|
|
19
|
+
constructor(httpClient: HttpClient, cacheService: CacheService);
|
|
20
|
+
findAll<T extends BaseModel>(modelType: ModelType<T>, params?: any, headers?: HttpHeaders, customUrl?: string): Observable<BaseQueryData<T>>;
|
|
21
|
+
findRecord<T extends BaseModel>(modelType: ModelType<T>, id?: string, params?: any, headers?: HttpHeaders, customUrl?: string): Observable<T>;
|
|
22
|
+
getCustom<U, T extends BaseModel>(modelType: ModelType<T>, params?: any, headers?: HttpHeaders, customUrl?: string, customResponseType?: any): Observable<U>;
|
|
23
|
+
postCustom<U, T extends BaseModel>(modelType: ModelType<T>, body: any, params?: any, headers?: HttpHeaders, customUrl?: string): Observable<U>;
|
|
24
|
+
patchCustom<U, T extends BaseModel>(modelType: ModelType<T>, body: any, params?: any, headers?: HttpHeaders, customUrl?: string): Observable<U>;
|
|
25
|
+
createRecord<T extends BaseModel>(modelType: ModelType<T>, data?: any): T;
|
|
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: T, params?: any, headers?: HttpHeaders, customUrl?: string): Observable<T>;
|
|
28
|
+
replaceRecord<T extends BaseModel>(attributesMetadata: any, model: T, params?: any, headers?: HttpHeaders, customUrl?: string, customBody?: any): Observable<T>;
|
|
29
|
+
deleteRecord<T extends BaseModel>(modelType: ModelType<T>, id: string, headers?: HttpHeaders, customUrl?: string): Observable<{}>;
|
|
30
|
+
buildUrl<T extends BaseModel>(modelType: ModelType<T>, customUrl?: string): string;
|
|
31
|
+
protected extractQueryData<T extends BaseModel>(res: any, modelType: ModelType<T>): BaseQueryData<T>;
|
|
32
|
+
protected deserializeModel<T extends BaseModel>(modelType: ModelType<T>, data: any): T;
|
|
33
|
+
protected handleError(error: HttpErrorResponse): Observable<never>;
|
|
34
|
+
protected parseMeta(body: any, modelType: ModelType<BaseModel>): any;
|
|
35
|
+
protected resetMetadataAttributes<T extends BaseModel>(res: T, attributesMetadata: any, modelType: ModelType<T>): T;
|
|
36
|
+
get datastoreConfig(): DatastoreConfig;
|
|
37
|
+
protected transformSerializedNamesToPropertyNames<T extends BaseModel>(modelType: ModelType<T>, attributes: any): any;
|
|
38
|
+
protected getModelPropertyNames(model: BaseModel): any;
|
|
39
|
+
buildHeaders(customHeaders?: HttpHeaders): HttpHeaders;
|
|
40
|
+
buildParams<T extends BaseModel>(modelType: ModelType<T>, params: any): HttpParams;
|
|
41
|
+
protected entityToModel<T extends BaseModel>(res: any, modelType: ModelType<T>, model?: T): T;
|
|
42
|
+
private extractRecordDataJson;
|
|
43
|
+
modelToEntity<T extends BaseModel>(model: T, attributesMetadata: any, allAttributes?: boolean): any;
|
|
44
|
+
private _toQueryString;
|
|
45
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BaseDatastore, never>;
|
|
46
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<BaseDatastore>;
|
|
47
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { HttpHeaders } from '@angular/common/http';
|
|
2
|
+
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
|
|
3
|
+
import { Observable } from 'rxjs';
|
|
4
|
+
import { BaseQueryData } from '../models/base-query-data';
|
|
5
|
+
import { BaseModel } from '../models/base.model';
|
|
6
|
+
import { BaseDatastore, ModelType } from './base-datastore.service';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
export declare class BaseService<T extends BaseModel> {
|
|
9
|
+
datastore: BaseDatastore;
|
|
10
|
+
modelType: ModelType<T>;
|
|
11
|
+
constructor(datastore: BaseDatastore);
|
|
12
|
+
setModelType(modelType: ModelType<T>): void;
|
|
13
|
+
get(id?: any, customInclude?: string): Observable<T>;
|
|
14
|
+
getAll(page: number, pageSize: number, sort?: string, filters?: string, customInclude?: string): Observable<BaseQueryData<T>>;
|
|
15
|
+
delete(id: any): Observable<{}>;
|
|
16
|
+
getCustom<U>(params?: any, headers?: HttpHeaders, customUrl?: string, customResponseType?: any): Observable<U>;
|
|
17
|
+
postCustom<U>(body: any, params?: any, headers?: HttpHeaders, customUrl?: string): Observable<U>;
|
|
18
|
+
patchCustom<U>(body: any, params?: any, headers?: HttpHeaders, customUrl?: string): Observable<U>;
|
|
19
|
+
save(docTypeOrFormGroup: T | UntypedFormGroup, id?: any, origModel?: T): Observable<T>;
|
|
20
|
+
patch(docTypeOrFormGroup: T | UntypedFormGroup, origModel: T, id?: any): Observable<T>;
|
|
21
|
+
newModel(data?: any): T;
|
|
22
|
+
toFormGroup(fb: UntypedFormBuilder, fromModel?: T): UntypedFormGroup;
|
|
23
|
+
fromFormGroup(formGroup: UntypedFormGroup, id?: any): T;
|
|
24
|
+
getSelectValues(property: string): Observable<any[]>;
|
|
25
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BaseService<any>, never>;
|
|
26
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<BaseService<any>>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class CacheService {
|
|
3
|
+
private cache;
|
|
4
|
+
constructor();
|
|
5
|
+
get(key: string): any;
|
|
6
|
+
set(key: string, data: any, expiresInMs: number): void;
|
|
7
|
+
delete(key: string): void;
|
|
8
|
+
clearCacheContainingKeyword(keyword: string): void;
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CacheService, never>;
|
|
10
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<CacheService>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { HttpClient } from '@angular/common/http';
|
|
2
|
+
import { Configurations } from '../configurations';
|
|
3
|
+
import { BaseDatastore } from './base-datastore.service';
|
|
4
|
+
import { CacheService } from './cache.service';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class DatastoreCore extends BaseDatastore {
|
|
7
|
+
private configExt;
|
|
8
|
+
private customConfig;
|
|
9
|
+
constructor(http: HttpClient, cacheService: CacheService, configExt: Configurations);
|
|
10
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DatastoreCore, never>;
|
|
11
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DatastoreCore>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
export interface DialogService {
|
|
3
|
+
confirm(message?: string, text?: string, confirmButtonText?: string, cancelButtonText?: string): Observable<boolean>;
|
|
4
|
+
showSaveMessage(message?: string, title?: string): Observable<boolean>;
|
|
5
|
+
showRegisteredMessage(message?: string, title?: string): Observable<boolean>;
|
|
6
|
+
showErrorMessage(e: any, message?: string): Observable<boolean>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DatastoreCore } from '../core';
|
|
2
|
+
import { Employee } from '../models';
|
|
3
|
+
import { BaseService } from './base.service';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class EmployeeService extends BaseService<Employee> {
|
|
6
|
+
constructor(datastore: DatastoreCore);
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EmployeeService, never>;
|
|
8
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<EmployeeService>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from './base-datastore.service';
|
|
2
|
+
export * from './base.service';
|
|
3
|
+
export * from './cache.service';
|
|
4
|
+
export * from './datastore.service';
|
|
5
|
+
export * from './dialog.service';
|
|
6
|
+
export * from './employee.service';
|
|
7
|
+
export * from './local-file.service';
|
|
8
|
+
export * from './role.service';
|
|
9
|
+
export * from './route-history.service';
|
|
10
|
+
export * from './translate-loader.service';
|
|
11
|
+
export * from './user.service';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { HttpClient } from '@angular/common/http';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class LocalFileService {
|
|
5
|
+
private http;
|
|
6
|
+
private cache;
|
|
7
|
+
constructor(http: HttpClient);
|
|
8
|
+
getJsonData(jsonUrl: string): Observable<any>;
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LocalFileService, never>;
|
|
10
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<LocalFileService>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DatastoreCore, Right } from '../core';
|
|
2
|
+
import { BaseService } from './base.service';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class RightService extends BaseService<Right> {
|
|
5
|
+
constructor(datastore: DatastoreCore);
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RightService, never>;
|
|
7
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<RightService>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { DatastoreCore, Right } from '../core';
|
|
3
|
+
import { Role } from '../models/role';
|
|
4
|
+
import { BaseService } from './base.service';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class RoleService extends BaseService<Role> {
|
|
7
|
+
constructor(datastore: DatastoreCore);
|
|
8
|
+
getRoleRights(roleId: string): Observable<Right[]>;
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RoleService, never>;
|
|
10
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<RoleService>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Router } from '@angular/router';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class RouteHistoryService {
|
|
4
|
+
private router;
|
|
5
|
+
private previousUrl;
|
|
6
|
+
private currentUrl;
|
|
7
|
+
constructor(router: Router);
|
|
8
|
+
getPreviousUrl(): string | null;
|
|
9
|
+
getCurrentUrl(): string | null;
|
|
10
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RouteHistoryService, never>;
|
|
11
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<RouteHistoryService>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { HttpClient } from '@angular/common/http';
|
|
2
|
+
import { TranslateLoader } from '@ngx-translate/core';
|
|
3
|
+
import { Observable } from 'rxjs';
|
|
4
|
+
import { Configurations } from '../configurations';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class TranslateloaderService implements TranslateLoader {
|
|
7
|
+
private httpClient;
|
|
8
|
+
private _apiUrl;
|
|
9
|
+
private headers;
|
|
10
|
+
constructor(httpClient: HttpClient, config: Configurations);
|
|
11
|
+
getTranslation(lang: string): Observable<any>;
|
|
12
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TranslateloaderService, never>;
|
|
13
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<TranslateloaderService>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { BaseQueryData, BaseService, DatastoreCore, Menu, Right, User } from '../core';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class UserService extends BaseService<User> {
|
|
5
|
+
userRights: Right[];
|
|
6
|
+
constructor(datastore: DatastoreCore);
|
|
7
|
+
getRights(): Observable<BaseQueryData<Right>>;
|
|
8
|
+
hasRightForLink(link: string): boolean;
|
|
9
|
+
getMenus(): Observable<BaseQueryData<Menu>>;
|
|
10
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<UserService, never>;
|
|
11
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<UserService>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { InjectionToken, Type } from '@angular/core';
|
|
2
|
+
import { BaseModel } from '../models/base.model';
|
|
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>>;
|
|
6
|
+
export declare const TABLE_IMPLEMENTATIONS_TOKEN: InjectionToken<Record<string, Type<any>>>;
|
|
7
|
+
export declare const CRUD_IMPLEMENTATIONS_TOKEN: InjectionToken<Record<string, Type<any>>>;
|
package/lib/utils.d.ts
ADDED
package/package.json
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rosoftlab/core",
|
|
3
|
-
"version": "1.0.5-alpha-
|
|
3
|
+
"version": "1.0.5-alpha-2",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@angular/common": "^
|
|
6
|
-
"@angular/core": "^
|
|
5
|
+
"@angular/common": "^19.2.8",
|
|
6
|
+
"@angular/core": "^19.2.8",
|
|
7
7
|
"fast-json-patch": "^3.1.1",
|
|
8
8
|
"date-fns": "^4.1.0",
|
|
9
|
-
"@types/qs": "^6.
|
|
10
|
-
"@ngx-translate/core": "^
|
|
9
|
+
"@types/qs": "^6.9.18",
|
|
10
|
+
"@ngx-translate/core": "^16.0.4",
|
|
11
11
|
"json-logic-js": "^2.0.5",
|
|
12
|
-
"@angular/cdk": "^
|
|
12
|
+
"@angular/cdk": "^19.2.11",
|
|
13
13
|
"oidc-client-ts": "^3.4.1"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"tslib": "^2.8.
|
|
16
|
+
"tslib": "^2.8.0"
|
|
17
17
|
},
|
|
18
18
|
"author": "rosoftlab",
|
|
19
19
|
"license": "ISC",
|
|
20
20
|
"module": "fesm2022/rosoftlab-core.mjs",
|
|
21
|
-
"typings": "
|
|
21
|
+
"typings": "index.d.ts",
|
|
22
22
|
"exports": {
|
|
23
23
|
"./package.json": {
|
|
24
24
|
"default": "./package.json"
|
|
25
25
|
},
|
|
26
26
|
".": {
|
|
27
|
-
"types": "./
|
|
27
|
+
"types": "./index.d.ts",
|
|
28
28
|
"default": "./fesm2022/rosoftlab-core.mjs"
|
|
29
29
|
}
|
|
30
30
|
},
|
package/public-api.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './lib/core';
|