@rosoftlab/core 1.0.5-alpha-1 → 1.0.21-alpha-1
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 +172 -369
- package/fesm2022/rosoftlab-core.mjs.map +1 -1
- package/package.json +2 -2
- package/types/rosoftlab-core.d.ts +93 -140
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rosoftlab/core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.21-alpha-1",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": "^21.0.6",
|
|
6
6
|
"@angular/core": "^21.0.6",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"@types/qs": "^6.14.0",
|
|
10
10
|
"@ngx-translate/core": "^17.0.0",
|
|
11
11
|
"json-logic-js": "^2.0.5",
|
|
12
|
-
"@angular/cdk": "^
|
|
12
|
+
"@angular/cdk": "^21.0.5",
|
|
13
13
|
"oidc-client-ts": "^3.4.1"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
@@ -2,16 +2,15 @@ import * as rxjs from 'rxjs';
|
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { UserManager, UserManagerSettings } from 'oidc-client-ts';
|
|
4
4
|
import * as i0 from '@angular/core';
|
|
5
|
-
import { Provider, InjectionToken, OnInit,
|
|
5
|
+
import { Provider, InjectionToken, OnInit, ModuleWithProviders } from '@angular/core';
|
|
6
6
|
import * as i1 from '@angular/common';
|
|
7
7
|
import { Location } from '@angular/common';
|
|
8
8
|
import * as i3 from '@angular/forms';
|
|
9
|
-
import { UntypedFormBuilder, UntypedFormGroup
|
|
10
|
-
import { Router, ActivatedRoute
|
|
9
|
+
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
|
|
10
|
+
import { Router, ActivatedRoute } from '@angular/router';
|
|
11
11
|
import * as i2 from '@ngx-translate/core';
|
|
12
12
|
import { TranslateService, TranslateLoader } from '@ngx-translate/core';
|
|
13
|
-
import
|
|
14
|
-
import { HttpClient, HttpHeaders, HttpErrorResponse, HttpParams, HttpInterceptor, HttpRequest, HttpHandler, HttpEvent } from '@angular/common/http';
|
|
13
|
+
import { HttpHeaders, HttpClient, HttpErrorResponse, HttpParams } from '@angular/common/http';
|
|
15
14
|
|
|
16
15
|
declare class AuthService {
|
|
17
16
|
private manager;
|
|
@@ -73,6 +72,14 @@ declare class UnderConstructionComponent {
|
|
|
73
72
|
static ɵcmp: i0.ɵɵComponentDeclaration<UnderConstructionComponent, "rsl-under-construction", never, {}, {}, never, never, false, never>;
|
|
74
73
|
}
|
|
75
74
|
|
|
75
|
+
type ModelType<T> = new (datastore: IDatastore, data: any) => T;
|
|
76
|
+
interface IDatastore {
|
|
77
|
+
saveRecord(attributesMetadata: any, model: any, params?: any, headers?: any, customUrl?: string, customBody?: any): Observable<any>;
|
|
78
|
+
patchRecord(attributesMetadata: any, model: any, origModel: any, params?: any, headers?: any, customUrl?: string): Observable<any>;
|
|
79
|
+
replaceRecord(attributesMetadata: any, model: any, params?: any, headers?: any, customUrl?: string, customBody?: any): Observable<any>;
|
|
80
|
+
modelToEntity(model: any, attributesMetadata: any, allAttributes?: boolean): any;
|
|
81
|
+
}
|
|
82
|
+
|
|
76
83
|
declare class BaseMetaModel {
|
|
77
84
|
links: Array<any>;
|
|
78
85
|
meta: any;
|
|
@@ -89,6 +96,41 @@ interface ModelConfig {
|
|
|
89
96
|
bypassCache?: boolean;
|
|
90
97
|
}
|
|
91
98
|
|
|
99
|
+
declare class BaseModel {
|
|
100
|
+
protected _datastore: IDatastore;
|
|
101
|
+
highlighted: boolean;
|
|
102
|
+
id: any;
|
|
103
|
+
[key: string]: any;
|
|
104
|
+
constructor(_datastore: IDatastore, data?: any);
|
|
105
|
+
save(params?: any, headers?: HttpHeaders, customUrl?: string, customBody?: any): Observable<this>;
|
|
106
|
+
patch(origModel: this, params?: any, headers?: HttpHeaders, customUrl?: string): Observable<this>;
|
|
107
|
+
replace(params?: any, headers?: HttpHeaders, customUrl?: string, customBody?: any): Observable<this>;
|
|
108
|
+
get attributeMetadata(): any;
|
|
109
|
+
set attributeMetadata(val: any);
|
|
110
|
+
get hasDirtyAttributes(): boolean;
|
|
111
|
+
rollbackAttributes(): void;
|
|
112
|
+
get modelConfig(): ModelConfig;
|
|
113
|
+
protected deserializeModel<T extends BaseModel>(modelType: ModelType<T>, data: any): T;
|
|
114
|
+
protected transformSerializedNamesToPropertyNames<T extends BaseModel>(modelType: ModelType<T>, attributes: any): any;
|
|
115
|
+
getModelPropertyNames(model: BaseModel): any;
|
|
116
|
+
getModelRequiredPropertyNames(model: BaseModel): any;
|
|
117
|
+
getModelDefaultPropertyValues(model: BaseModel): any;
|
|
118
|
+
getModelSubGroupPropertyNames(model: BaseModel): any;
|
|
119
|
+
getFromGroup(fb: UntypedFormBuilder): UntypedFormGroup;
|
|
120
|
+
private getSubFromGroup;
|
|
121
|
+
getModelFromFormGroup(formGroup: UntypedFormGroup, id?: any): void;
|
|
122
|
+
getSerializedModel(): any;
|
|
123
|
+
getCellClass(property: string): string;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
declare class BaseQueryData<T> {
|
|
127
|
+
protected jsonApiModels: Array<T>;
|
|
128
|
+
protected metaData?: any;
|
|
129
|
+
constructor(jsonApiModels: Array<T>, metaData?: any);
|
|
130
|
+
getModels(): T[];
|
|
131
|
+
getMeta(): any;
|
|
132
|
+
}
|
|
133
|
+
|
|
92
134
|
interface Overrides {
|
|
93
135
|
getDirtyAttributes?: (attributedMetadata: any, model?: any) => object;
|
|
94
136
|
getAllAttributes?: (attributedMetadata: any, model?: any) => object;
|
|
@@ -103,14 +145,6 @@ interface DatastoreConfig {
|
|
|
103
145
|
mock?: boolean;
|
|
104
146
|
}
|
|
105
147
|
|
|
106
|
-
declare class BaseQueryData<T> {
|
|
107
|
-
protected jsonApiModels: Array<T>;
|
|
108
|
-
protected metaData?: any;
|
|
109
|
-
constructor(jsonApiModels: Array<T>, metaData?: any);
|
|
110
|
-
getModels(): T[];
|
|
111
|
-
getMeta(): any;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
148
|
declare class CacheService {
|
|
115
149
|
private cache;
|
|
116
150
|
constructor();
|
|
@@ -122,8 +156,7 @@ declare class CacheService {
|
|
|
122
156
|
static ɵprov: i0.ɵɵInjectableDeclaration<CacheService>;
|
|
123
157
|
}
|
|
124
158
|
|
|
125
|
-
|
|
126
|
-
declare class BaseDatastore {
|
|
159
|
+
declare class BaseDatastore implements IDatastore {
|
|
127
160
|
protected httpClient: HttpClient;
|
|
128
161
|
protected cacheService: CacheService;
|
|
129
162
|
protected config: DatastoreConfig;
|
|
@@ -163,33 +196,6 @@ declare class BaseDatastore {
|
|
|
163
196
|
static ɵprov: i0.ɵɵInjectableDeclaration<BaseDatastore>;
|
|
164
197
|
}
|
|
165
198
|
|
|
166
|
-
declare class BaseModel {
|
|
167
|
-
protected _datastore: BaseDatastore;
|
|
168
|
-
highlighted: boolean;
|
|
169
|
-
id: any;
|
|
170
|
-
[key: string]: any;
|
|
171
|
-
constructor(_datastore: BaseDatastore, data?: any);
|
|
172
|
-
save(params?: any, headers?: HttpHeaders, customUrl?: string, customBody?: any): Observable<this>;
|
|
173
|
-
patch(origModel: this, params?: any, headers?: HttpHeaders, customUrl?: string): Observable<this>;
|
|
174
|
-
replace(params?: any, headers?: HttpHeaders, customUrl?: string, customBody?: any): Observable<this>;
|
|
175
|
-
get attributeMetadata(): any;
|
|
176
|
-
set attributeMetadata(val: any);
|
|
177
|
-
get hasDirtyAttributes(): boolean;
|
|
178
|
-
rollbackAttributes(): void;
|
|
179
|
-
get modelConfig(): ModelConfig;
|
|
180
|
-
protected deserializeModel<T extends BaseModel>(modelType: ModelType<T>, data: any): T;
|
|
181
|
-
protected transformSerializedNamesToPropertyNames<T extends BaseModel>(modelType: ModelType<T>, attributes: any): any;
|
|
182
|
-
getModelPropertyNames(model: BaseModel): any;
|
|
183
|
-
getModelRequiredPropertyNames(model: BaseModel): any;
|
|
184
|
-
getModelDefaultPropertyValues(model: BaseModel): any;
|
|
185
|
-
getModelSubGroupPropertyNames(model: BaseModel): any;
|
|
186
|
-
getFromGroup(fb: UntypedFormBuilder): UntypedFormGroup;
|
|
187
|
-
private getSubFromGroup;
|
|
188
|
-
getModelFromFormGroup(formGroup: UntypedFormGroup, id?: any): void;
|
|
189
|
-
getSerializedModel(): any;
|
|
190
|
-
getCellClass(property: string): string;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
199
|
declare class BaseService<T extends BaseModel> {
|
|
194
200
|
datastore: BaseDatastore;
|
|
195
201
|
modelType: ModelType<T>;
|
|
@@ -265,13 +271,6 @@ declare abstract class BaseFormEditComponent<T extends BaseModel> implements OnI
|
|
|
265
271
|
static ɵcmp: i0.ɵɵComponentDeclaration<BaseFormEditComponent<any>, "app-base.form.edit", never, {}, {}, never, never, false, never>;
|
|
266
272
|
}
|
|
267
273
|
|
|
268
|
-
declare class Configurations {
|
|
269
|
-
baseUrl: string;
|
|
270
|
-
authUrl: string;
|
|
271
|
-
apiVersion: string;
|
|
272
|
-
constructor();
|
|
273
|
-
}
|
|
274
|
-
|
|
275
274
|
declare enum GridLayoutFormat {
|
|
276
275
|
none = 0,
|
|
277
276
|
date = 1,
|
|
@@ -285,6 +284,12 @@ declare enum CellTextAlign {
|
|
|
285
284
|
right = "right"
|
|
286
285
|
}
|
|
287
286
|
|
|
287
|
+
declare class MetadataStorage {
|
|
288
|
+
private static metadataMap;
|
|
289
|
+
static getMetadata(key: string, target: object, propertyKey?: string): any;
|
|
290
|
+
static setMetadata(key: string, value: any, target: object, propertyKey?: string): void;
|
|
291
|
+
}
|
|
292
|
+
|
|
288
293
|
interface PropertyConverter {
|
|
289
294
|
mask(value: any): any;
|
|
290
295
|
unmask(value: any): any;
|
|
@@ -302,74 +307,25 @@ declare function Attribute(options?: AttributeDecoratorOptions): PropertyDecorat
|
|
|
302
307
|
|
|
303
308
|
declare function BaseDatastoreConfig(config?: any): (target: any) => void;
|
|
304
309
|
|
|
305
|
-
declare
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
private expirationTime;
|
|
311
|
-
private cacheService;
|
|
312
|
-
private cache;
|
|
313
|
-
constructor(expirationTime: number, cacheService: CacheService);
|
|
314
|
-
intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>>;
|
|
315
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<CacheInterceptor, never>;
|
|
316
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<CacheInterceptor>;
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
interface JsonBaseError {
|
|
320
|
-
id?: string;
|
|
321
|
-
links?: Array<any>;
|
|
322
|
-
status?: string;
|
|
323
|
-
code?: string;
|
|
324
|
-
title?: string;
|
|
325
|
-
detail?: string;
|
|
326
|
-
source?: {
|
|
327
|
-
pointer?: string;
|
|
328
|
-
parameter?: string;
|
|
329
|
-
};
|
|
330
|
-
meta?: any;
|
|
331
|
-
}
|
|
332
|
-
declare class ErrorResponse {
|
|
333
|
-
errors?: JsonBaseError[];
|
|
334
|
-
constructor(errors?: JsonBaseError[]);
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
interface FilterRequest {
|
|
338
|
-
page?: number;
|
|
339
|
-
page_size?: number;
|
|
340
|
-
filters?: string;
|
|
341
|
-
sorts?: any;
|
|
342
|
-
group_by?: any;
|
|
343
|
-
distinct_columns?: any;
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
declare class Rule {
|
|
347
|
-
rule: any;
|
|
348
|
-
order: number;
|
|
349
|
-
parameters: string[];
|
|
310
|
+
declare class Configurations {
|
|
311
|
+
baseUrl: string;
|
|
312
|
+
authUrl: string;
|
|
313
|
+
apiVersion: string;
|
|
314
|
+
constructor();
|
|
350
315
|
}
|
|
351
316
|
|
|
352
|
-
declare
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
static
|
|
357
|
-
static
|
|
317
|
+
declare const PROVIDERS: any[];
|
|
318
|
+
declare class RslBaseModule {
|
|
319
|
+
static forRoot(config: Configurations): ModuleWithProviders<RslBaseModule>;
|
|
320
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RslBaseModule, never>;
|
|
321
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<RslBaseModule, never, [typeof i1.CommonModule, typeof i2.TranslateModule, typeof i3.ReactiveFormsModule], [typeof i2.TranslateModule]>;
|
|
322
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<RslBaseModule>;
|
|
358
323
|
}
|
|
359
324
|
|
|
360
|
-
declare
|
|
361
|
-
|
|
362
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<Nl2brPipe, never>;
|
|
363
|
-
static ɵpipe: i0.ɵɵPipeDeclaration<Nl2brPipe, "nl2br", false>;
|
|
364
|
-
}
|
|
325
|
+
declare function readFileAsync(file: File): Promise<any>;
|
|
326
|
+
declare function getValueFromJsonData(jsonData: any, key: string): any;
|
|
365
327
|
|
|
366
|
-
declare
|
|
367
|
-
private configExt;
|
|
368
|
-
private customConfig;
|
|
369
|
-
constructor(http: HttpClient, cacheService: CacheService, configExt: Configurations);
|
|
370
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<DatastoreCore, never>;
|
|
371
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<DatastoreCore>;
|
|
372
|
-
}
|
|
328
|
+
declare function BaseModelConfig(config?: any): (target: any) => void;
|
|
373
329
|
|
|
374
330
|
declare class Employee extends BaseModel {
|
|
375
331
|
id: string;
|
|
@@ -383,6 +339,15 @@ declare class Employee extends BaseModel {
|
|
|
383
339
|
extraData: string;
|
|
384
340
|
}
|
|
385
341
|
|
|
342
|
+
interface FilterRequest {
|
|
343
|
+
page?: number;
|
|
344
|
+
page_size?: number;
|
|
345
|
+
filters?: string;
|
|
346
|
+
sorts?: any;
|
|
347
|
+
group_by?: any;
|
|
348
|
+
distinct_columns?: any;
|
|
349
|
+
}
|
|
350
|
+
|
|
386
351
|
declare class Menu extends BaseModel {
|
|
387
352
|
id: string;
|
|
388
353
|
header?: string;
|
|
@@ -417,6 +382,12 @@ declare class Role extends BaseModel {
|
|
|
417
382
|
name: string;
|
|
418
383
|
}
|
|
419
384
|
|
|
385
|
+
declare class Rule {
|
|
386
|
+
rule: any;
|
|
387
|
+
order: number;
|
|
388
|
+
parameters: string[];
|
|
389
|
+
}
|
|
390
|
+
|
|
420
391
|
declare class User extends BaseModel {
|
|
421
392
|
id: string;
|
|
422
393
|
firstName: string;
|
|
@@ -425,6 +396,14 @@ declare class User extends BaseModel {
|
|
|
425
396
|
get fullName(): string;
|
|
426
397
|
}
|
|
427
398
|
|
|
399
|
+
declare class DatastoreCore extends BaseDatastore {
|
|
400
|
+
private configExt;
|
|
401
|
+
private customConfig;
|
|
402
|
+
constructor(http: HttpClient, cacheService: CacheService, configExt: Configurations);
|
|
403
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DatastoreCore, never>;
|
|
404
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DatastoreCore>;
|
|
405
|
+
}
|
|
406
|
+
|
|
428
407
|
declare class EmployeeService extends BaseService<Employee> {
|
|
429
408
|
constructor(datastore: DatastoreCore);
|
|
430
409
|
static ɵfac: i0.ɵɵFactoryDeclaration<EmployeeService, never>;
|
|
@@ -477,31 +456,5 @@ declare class UserService extends BaseService<User> {
|
|
|
477
456
|
static ɵprov: i0.ɵɵInjectableDeclaration<UserService>;
|
|
478
457
|
}
|
|
479
458
|
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
declare function DynamicallyModelResolver<T extends BaseModel>(modelsImport: any, className?: string | undefined): ResolveFn<T>;
|
|
483
|
-
|
|
484
|
-
declare function DynamicallyServiceResolver<T extends BaseModel, U extends BaseService<T>>(serviceImport: any, serviceName: string): ResolveFn<U>;
|
|
485
|
-
|
|
486
|
-
declare class RslBaseModule {
|
|
487
|
-
static forRoot(config: Configurations): ModuleWithProviders<RslBaseModule>;
|
|
488
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<RslBaseModule, never>;
|
|
489
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<RslBaseModule, never, [typeof i1.CommonModule, typeof i2.TranslateModule, typeof i3.ReactiveFormsModule], [typeof i4.HttpClientModule, typeof i2.TranslateModule]>;
|
|
490
|
-
static ɵinj: i0.ɵɵInjectorDeclaration<RslBaseModule>;
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
declare class CustomValidators {
|
|
494
|
-
static patternValidator(regex: RegExp, error: ValidationErrors): ValidatorFn;
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
declare class MetadataStorage {
|
|
498
|
-
private static metadataMap;
|
|
499
|
-
static getMetadata(key: string, target: object, propertyKey?: string): any;
|
|
500
|
-
static setMetadata(key: string, value: any, target: object, propertyKey?: string): void;
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
declare function readFileAsync(file: File): Promise<any>;
|
|
504
|
-
declare function getValueFromJsonData(jsonData: any, key: string): any;
|
|
505
|
-
|
|
506
|
-
export { Attribute, AuthService, BaseDatastore, BaseDatastoreConfig, BaseFormEditComponent, BaseMetaModel, BaseModel, BaseModelConfig, BaseQueryData, BaseService, CacheInterceptor, CacheService, CellTextAlign, Configurations, CustomType, CustomValidators, DatastoreCore, DynamicallyModelResolver, DynamicallyServiceResolver, Employee, EmployeeService, ErrorResponse, FieldErrorDisplayComponent, GridLayoutFormat, InputErrorPipe, LocalFileService, Menu, MetadataStorage, Nl2brPipe, OIDC_CLIENT_SETTINGS, PROVIDERS, PageNotFoundComponent, Right, Role, RoleService, RouteHistoryService, RslBaseModule, Rule, Tokens, TranslateloaderService, UnderConstructionComponent, User, UserService, getValueFromJsonData, provideAuth, provideOidcUserManager, readFileAsync };
|
|
507
|
-
export type { AttributeDecoratorOptions, DatastoreConfig, DialogService, FilterRequest, JsonBaseError, ModelConfig, ModelType, Overrides, PropertyConverter };
|
|
459
|
+
export { Attribute, AuthService, BaseDatastore, BaseDatastoreConfig, BaseFormEditComponent, BaseModel, BaseModelConfig, BaseQueryData, BaseService, CacheService, CellTextAlign, Configurations, DatastoreCore, Employee, EmployeeService, FieldErrorDisplayComponent, GridLayoutFormat, LocalFileService, Menu, MetadataStorage, OIDC_CLIENT_SETTINGS, PROVIDERS, PageNotFoundComponent, Right, Role, RoleService, RouteHistoryService, RslBaseModule, Rule, Tokens, TranslateloaderService, UnderConstructionComponent, User, UserService, getValueFromJsonData, provideAuth, provideOidcUserManager, readFileAsync };
|
|
460
|
+
export type { DialogService, FilterRequest };
|