@techextensor/tab-core-utility 2.2.143 → 2.2.146
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/index.mjs +18 -8
- package/esm2022/lib/tab-core-utility/app/constants/api-constants.mjs +2 -2
- package/esm2022/lib/tab-core-utility/app/constants/common.mjs +2 -1
- package/esm2022/lib/tab-core-utility/app/crud/tab-blueprint.service.mjs +1 -1
- package/esm2022/lib/tab-core-utility/app/crud/tab-crud.service.mjs +200 -0
- package/esm2022/lib/tab-core-utility/app/crud/tab-formio.service.mjs +1 -1
- package/esm2022/lib/tab-core-utility/app/crud/tab-get.service.mjs +25 -38
- package/esm2022/lib/tab-core-utility/app/crud/tab-release.service.mjs +1 -1
- package/esm2022/lib/tab-core-utility/app/enums/common.enum.mjs +15 -1
- package/esm2022/lib/tab-core-utility/app/helpers/common/app.helpers.mjs +1 -1
- package/esm2022/lib/tab-core-utility/app/helpers/common/dsq.helpers.mjs +2 -5
- package/esm2022/lib/tab-core-utility/app/helpers/common/template.helpers.mjs +1 -1
- package/esm2022/lib/tab-core-utility/app/helpers/screen/media-upload.helpers.mjs +1 -1
- package/esm2022/lib/tab-core-utility/app/interfaces/common.interface.mjs +2 -0
- package/esm2022/lib/tab-core-utility/app/interfaces/orgInfo.interface.mjs +1 -1
- package/esm2022/lib/tab-core-utility/app/utils/json.util.mjs +17 -13
- package/esm2022/lib/tab-core-utility/auth/auth.service.mjs +1 -1
- package/esm2022/lib/tab-core-utility/core/http-client/api.service.mjs +1 -1
- package/esm2022/lib/tab-core-utility/core/pipe/translate.pipe.mjs +31 -0
- package/esm2022/lib/tab-core-utility/core/provider/notification.provider.mjs +18 -0
- package/esm2022/lib/tab-core-utility/core/provider/translation.provider.mjs +20 -0
- package/esm2022/lib/tab-core-utility/core/service/confirmation.service.mjs +77 -0
- package/esm2022/lib/tab-core-utility/core/service/notification.service.mjs +57 -0
- package/esm2022/lib/tab-core-utility/core/service/translation.service.mjs +100 -0
- package/index.d.ts +8 -7
- package/lib/tab-core-utility/app/constants/common.d.ts +1 -0
- package/lib/tab-core-utility/app/crud/tab-blueprint.service.d.ts +1 -1
- package/lib/tab-core-utility/app/crud/tab-crud.service.d.ts +70 -0
- package/lib/tab-core-utility/app/crud/tab-formio.service.d.ts +1 -1
- package/lib/tab-core-utility/app/crud/tab-get.service.d.ts +9 -7
- package/lib/tab-core-utility/app/crud/tab-release.service.d.ts +1 -1
- package/lib/tab-core-utility/app/enums/common.enum.d.ts +12 -0
- package/lib/tab-core-utility/app/helpers/common/app.helpers.d.ts +1 -1
- package/lib/tab-core-utility/app/helpers/common/template.helpers.d.ts +1 -1
- package/lib/tab-core-utility/app/helpers/screen/media-upload.helpers.d.ts +1 -1
- package/lib/tab-core-utility/app/interfaces/{common-api.interface.d.ts → common.interface.d.ts} +62 -1
- package/lib/tab-core-utility/app/interfaces/orgInfo.interface.d.ts +1 -1
- package/lib/tab-core-utility/app/utils/json.util.d.ts +1 -4
- package/lib/tab-core-utility/auth/auth.service.d.ts +1 -1
- package/lib/tab-core-utility/core/http-client/api.service.d.ts +1 -1
- package/lib/tab-core-utility/core/pipe/translate.pipe.d.ts +11 -0
- package/lib/tab-core-utility/core/provider/notification.provider.d.ts +8 -0
- package/lib/tab-core-utility/core/provider/translation.provider.d.ts +6 -0
- package/lib/tab-core-utility/core/service/confirmation.service.d.ts +53 -0
- package/lib/tab-core-utility/core/service/notification.service.d.ts +37 -0
- package/lib/tab-core-utility/core/service/translation.service.d.ts +50 -0
- package/package.json +4 -3
- package/esm2022/lib/tab-core-utility/app/interfaces/common-api.interface.mjs +0 -2
- package/esm2022/lib/tab-core-utility/core/error-handler/error-handler-interceptor.service.mjs +0 -26
- package/esm2022/lib/tab-core-utility/core/error-handler/error-handler.store.mjs +0 -21
- package/esm2022/lib/tab-core-utility/core/error-handler/models/error-handler.state.mjs +0 -5
- package/esm2022/lib/tab-core-utility/core/util/auth.utils.mjs +0 -21
- package/esm2022/lib/tab-core-utility/store/auth.store.mjs +0 -43
- package/esm2022/lib/tab-core-utility/store/orginfo.store.mjs +0 -42
- package/lib/tab-core-utility/core/error-handler/error-handler-interceptor.service.d.ts +0 -3
- package/lib/tab-core-utility/core/error-handler/error-handler.store.d.ts +0 -10
- package/lib/tab-core-utility/core/error-handler/models/error-handler.state.d.ts +0 -5
- package/lib/tab-core-utility/core/util/auth.utils.d.ts +0 -9
- package/lib/tab-core-utility/store/auth.store.d.ts +0 -19
- package/lib/tab-core-utility/store/orginfo.store.d.ts +0 -22
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CommonApiResponse, NextStatusPayload, UpdateStatusPayload } from "../interfaces/common
|
|
1
|
+
import { CommonApiResponse, NextStatusPayload, UpdateStatusPayload } from "../interfaces/common.interface";
|
|
2
2
|
import { Observable } from "rxjs";
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
export declare class TabBlueprintService {
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { CommonApiResponse, CrudDeletePayload, CrudGetPayload, CrudInsertPayload, CrudUpdatePayload } from "../interfaces/common.interface";
|
|
2
|
+
import { Observable } from "rxjs";
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class TabCrudService {
|
|
5
|
+
private readonly _metadataHelper;
|
|
6
|
+
private readonly _requestResponseHelper;
|
|
7
|
+
private readonly _dsqHelper;
|
|
8
|
+
private readonly _apiService;
|
|
9
|
+
/**
|
|
10
|
+
* Returns the AppObjectModel from the given payload.
|
|
11
|
+
* @param payload The payload with either dataSourceQueryIdOrName or appObjectIdOrName.
|
|
12
|
+
* @returns The AppObjectModel.
|
|
13
|
+
*/
|
|
14
|
+
private getAppObjectFromPayload;
|
|
15
|
+
/**
|
|
16
|
+
* Filters out invalid fields from the provided data based on the AppObjectModel.
|
|
17
|
+
* Optionally retains primary key fields.
|
|
18
|
+
*
|
|
19
|
+
* @param data The data object to filter.
|
|
20
|
+
* @param appObject The AppObjectModel used to validate the fields.
|
|
21
|
+
* @param keepPrimaryKey Optional flag to retain primary key fields. Defaults to false.
|
|
22
|
+
* @returns A new object with only valid fields.
|
|
23
|
+
*/
|
|
24
|
+
private filterValidAppObjectFields;
|
|
25
|
+
/**
|
|
26
|
+
* Generates a where clause based on the criteria provided.
|
|
27
|
+
*
|
|
28
|
+
* @param criteria The criteria object to generate the where clause from.
|
|
29
|
+
* @param crudTableName The CRUD table name to use in the where clause.
|
|
30
|
+
* @returns A new APIFilterCriteria object with the generated where clause.
|
|
31
|
+
*/
|
|
32
|
+
private generateWhereClause;
|
|
33
|
+
/**
|
|
34
|
+
* Executes a GET request to retrieve data from the specified data source query.
|
|
35
|
+
* @param payload The payload containing the criteria for the query and the AppObjectModel ID.
|
|
36
|
+
* @param headers Optional headers for the request.
|
|
37
|
+
* @returns An observable of the response from the API.
|
|
38
|
+
*/
|
|
39
|
+
get(payload: CrudGetPayload, headers?: any): Observable<CommonApiResponse>;
|
|
40
|
+
/**
|
|
41
|
+
* Inserts data into the specified table.
|
|
42
|
+
* @param payload The payload containing the data to insert and the AppObjectModel ID.
|
|
43
|
+
* @param headers Optional headers for the request.
|
|
44
|
+
* @returns An observable of the response from the API.
|
|
45
|
+
*/
|
|
46
|
+
insert(payload: CrudInsertPayload, headers?: any): Observable<CommonApiResponse>;
|
|
47
|
+
/**
|
|
48
|
+
* Updates data in the specified table.
|
|
49
|
+
* @param payload The payload containing the data to update, the criteria for the update, and the AppObjectModel ID.
|
|
50
|
+
* @param headers Optional headers for the request.
|
|
51
|
+
* @returns An observable of the response from the API.
|
|
52
|
+
*/
|
|
53
|
+
update(payload: CrudUpdatePayload, headers?: any): Observable<CommonApiResponse>;
|
|
54
|
+
/**
|
|
55
|
+
* Deletes data from the specified table.
|
|
56
|
+
* @param payload The payload containing the criteria for the delete and the AppObjectModel ID.
|
|
57
|
+
* @param headers Optional headers for the request.
|
|
58
|
+
* @returns An observable of the response from the API.
|
|
59
|
+
*/
|
|
60
|
+
delete(payload: CrudDeletePayload, headers?: any): Observable<CommonApiResponse>;
|
|
61
|
+
/**
|
|
62
|
+
* Executes a stored procedure using raw SQL.
|
|
63
|
+
* @param sp The stored procedure query string.
|
|
64
|
+
* @param headers Optional headers for the request.
|
|
65
|
+
* @returns The result of the API POST request.
|
|
66
|
+
*/
|
|
67
|
+
executeSp(sp: string, headers?: any): Observable<CommonApiResponse>;
|
|
68
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TabCrudService, never>;
|
|
69
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<TabCrudService>;
|
|
70
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CommonApiResponse, GetScreenConfig, ProcessRequestPayload } from "../interfaces/common
|
|
1
|
+
import { CommonApiResponse, GetScreenConfig, ProcessRequestPayload } from "../interfaces/common.interface";
|
|
2
2
|
import { Observable } from "rxjs";
|
|
3
3
|
import { BuildFormComponentType } from "../enums/common.enum";
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { APISelectQuery } from '../models/api-query.class';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { CommonApiResponse, HttpExecuteRequestPayload, ImprotDataPayload, RcordHistoryPayload, SearchDataPayload } from '../interfaces/common.interface';
|
|
2
4
|
import * as i0 from "@angular/core";
|
|
3
5
|
export declare class TabGetService {
|
|
4
6
|
private readonly apiService;
|
|
@@ -27,20 +29,20 @@ export declare class TabGetService {
|
|
|
27
29
|
* @param recordIds - Array of record IDs
|
|
28
30
|
* @returns Response from the API
|
|
29
31
|
*/
|
|
30
|
-
getHistory(
|
|
32
|
+
getHistory(payload: RcordHistoryPayload): Observable<CommonApiResponse>;
|
|
31
33
|
/**
|
|
32
34
|
* PMJAY Import
|
|
33
35
|
* @param data - Data for PMJAY import
|
|
34
36
|
* @returns Response from the API
|
|
35
37
|
*/
|
|
36
|
-
pmjayImport(data:
|
|
38
|
+
pmjayImport(data: ImprotDataPayload): any;
|
|
37
39
|
/**
|
|
38
40
|
* Executes a select query with optional parameters
|
|
39
41
|
* @param data - The select query data
|
|
40
42
|
* @param parameters - Optional parameters to be applied to the query
|
|
41
43
|
* @returns Result of the select query execution
|
|
42
44
|
*/
|
|
43
|
-
selectExecutor(data: APISelectQuery, parameters?: any):
|
|
45
|
+
selectExecutor(data: APISelectQuery, parameters?: any): Observable<CommonApiResponse>;
|
|
44
46
|
/**
|
|
45
47
|
* Executes a select query by its ID, using the provided parameters.
|
|
46
48
|
*
|
|
@@ -49,7 +51,7 @@ export declare class TabGetService {
|
|
|
49
51
|
* @returns The result of the select query execution.
|
|
50
52
|
* @throws An error if the API response status code is not '200'.
|
|
51
53
|
*/
|
|
52
|
-
executeSelectQueryById(selectQueryId: string, parameters?: any):
|
|
54
|
+
executeSelectQueryById(selectQueryId: string, parameters?: any): Observable<CommonApiResponse>;
|
|
53
55
|
removeWhereClauseForEmptyParams(filters: any[], parameters: Record<string, any>): any[];
|
|
54
56
|
/**
|
|
55
57
|
* Get Search Data
|
|
@@ -57,7 +59,7 @@ export declare class TabGetService {
|
|
|
57
59
|
* @param limit - Limit of search results
|
|
58
60
|
* @returns Response from the API
|
|
59
61
|
*/
|
|
60
|
-
getSearchData(
|
|
62
|
+
getSearchData(payload: SearchDataPayload, params?: any): Observable<CommonApiResponse>;
|
|
61
63
|
/**
|
|
62
64
|
* Executes an HTTP request with the specified method, URL, headers, and body.
|
|
63
65
|
*
|
|
@@ -67,13 +69,13 @@ export declare class TabGetService {
|
|
|
67
69
|
* @param body - The body content for methods like POST and PUT.
|
|
68
70
|
* @returns The API response corresponding to the request.
|
|
69
71
|
*/
|
|
70
|
-
executeHttpRequest(
|
|
72
|
+
executeHttpRequest(payload: HttpExecuteRequestPayload): any;
|
|
71
73
|
/**
|
|
72
74
|
* Generates an HTTP Request based on the provided DataSourceQuery name
|
|
73
75
|
* @param QueryName - The name of the DataSourceQuery
|
|
74
76
|
* @returns The result of the generated HTTP request
|
|
75
77
|
*/
|
|
76
|
-
generateHttpRequest(
|
|
78
|
+
generateHttpRequest(dataSourceQueryName: string): Observable<CommonApiResponse>;
|
|
77
79
|
static ɵfac: i0.ɵɵFactoryDeclaration<TabGetService, never>;
|
|
78
80
|
static ɵprov: i0.ɵɵInjectableDeclaration<TabGetService>;
|
|
79
81
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Observable } from "rxjs";
|
|
2
|
-
import { CommonApiResponse } from "../interfaces/common
|
|
2
|
+
import { CommonApiResponse } from "../interfaces/common.interface";
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
export declare class TabReleaseService {
|
|
5
5
|
private readonly apiService;
|
|
@@ -24,3 +24,15 @@ export declare enum JsonType {
|
|
|
24
24
|
AppObjectAccess = 1,
|
|
25
25
|
Language = 2
|
|
26
26
|
}
|
|
27
|
+
export declare enum NotificationType {
|
|
28
|
+
Success = "success",
|
|
29
|
+
Warning = "warning",
|
|
30
|
+
Error = "error",
|
|
31
|
+
Info = "info"
|
|
32
|
+
}
|
|
33
|
+
export declare enum HttpRequestType {
|
|
34
|
+
GET = "GET",
|
|
35
|
+
POST = "POST",
|
|
36
|
+
PUT = "PUT",
|
|
37
|
+
DELETE = "DELETE"
|
|
38
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
-
import { CloneDsqPayload, CommonApiResponse, GetDataJsonByTypePayload, PerformanceAnalyticsPayload, RefreshGlobalSearchDataPayload, RegisterAppObjectsPayload, ReportPayload, ScreenPerformancePayload, SyncAppFieldsPayload } from '../../interfaces/common
|
|
2
|
+
import { CloneDsqPayload, CommonApiResponse, GetDataJsonByTypePayload, PerformanceAnalyticsPayload, RefreshGlobalSearchDataPayload, RegisterAppObjectsPayload, ReportPayload, ScreenPerformancePayload, SyncAppFieldsPayload } from '../../interfaces/common.interface';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
export declare class AppHelper {
|
|
5
5
|
private readonly apiService;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
-
import { TemplateParsePayload } from '../../interfaces/common
|
|
2
|
+
import { TemplateParsePayload } from '../../interfaces/common.interface';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
export declare class TemplateHelper {
|
|
5
5
|
private readonly apiService;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
-
import { CommonApiResponse, UploadMediaFilesPayload } from '../../interfaces/common
|
|
2
|
+
import { CommonApiResponse, UploadMediaFilesPayload } from '../../interfaces/common.interface';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
export declare class MediaUploadHelper {
|
|
5
5
|
private readonly apiService;
|
package/lib/tab-core-utility/app/interfaces/{common-api.interface.d.ts → common.interface.d.ts}
RENAMED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IndividualConfig } from "ngx-toastr";
|
|
2
|
+
import { HttpRequestType, JsonType, NotificationType } from "../enums/common.enum";
|
|
2
3
|
export interface ApiResponse {
|
|
3
4
|
requestId: string;
|
|
4
5
|
isSuccess: boolean;
|
|
@@ -89,3 +90,63 @@ export interface ScreenPerformancePayload {
|
|
|
89
90
|
appObjectIds: string[];
|
|
90
91
|
};
|
|
91
92
|
}
|
|
93
|
+
export interface translatePayload {
|
|
94
|
+
language: string;
|
|
95
|
+
languageCode: number;
|
|
96
|
+
}
|
|
97
|
+
export interface BaseNotificationOptions {
|
|
98
|
+
message: string;
|
|
99
|
+
title?: string;
|
|
100
|
+
configuration?: Partial<IndividualConfig<any>> | undefined;
|
|
101
|
+
}
|
|
102
|
+
export interface NotificationOptions extends BaseNotificationOptions {
|
|
103
|
+
type: NotificationType;
|
|
104
|
+
}
|
|
105
|
+
export interface ConfirmationOptions {
|
|
106
|
+
title: string;
|
|
107
|
+
message: string;
|
|
108
|
+
primaryOption?: string;
|
|
109
|
+
secondaryOption?: string;
|
|
110
|
+
displayHeader?: boolean;
|
|
111
|
+
displayFooter?: boolean;
|
|
112
|
+
displayBody?: boolean;
|
|
113
|
+
displayPrimaryButton?: boolean;
|
|
114
|
+
displaySecondaryButton?: boolean;
|
|
115
|
+
displayCloseButton?: boolean;
|
|
116
|
+
}
|
|
117
|
+
export interface CrudBasePayload {
|
|
118
|
+
appObjectIdOrName?: string;
|
|
119
|
+
dataSourceQueryIdOrName?: string;
|
|
120
|
+
}
|
|
121
|
+
export interface CrudInsertPayload extends CrudBasePayload {
|
|
122
|
+
data: any;
|
|
123
|
+
}
|
|
124
|
+
export interface CrudUpdatePayload extends CrudInsertPayload {
|
|
125
|
+
criteria: any;
|
|
126
|
+
}
|
|
127
|
+
export interface CrudDeletePayload extends CrudBasePayload {
|
|
128
|
+
criteria: any;
|
|
129
|
+
}
|
|
130
|
+
export interface CrudGetPayload {
|
|
131
|
+
dataSourceQueryIdOrName: string;
|
|
132
|
+
criteria: any;
|
|
133
|
+
}
|
|
134
|
+
export interface ImprotDataPayload {
|
|
135
|
+
ImportObjectMappingId: string;
|
|
136
|
+
File: string;
|
|
137
|
+
ImportType: number;
|
|
138
|
+
}
|
|
139
|
+
export interface SearchDataPayload {
|
|
140
|
+
searchQuery: string;
|
|
141
|
+
limit: number;
|
|
142
|
+
}
|
|
143
|
+
export interface RcordHistoryPayload {
|
|
144
|
+
appObjectId: string;
|
|
145
|
+
recordIds: string[];
|
|
146
|
+
}
|
|
147
|
+
export interface HttpExecuteRequestPayload {
|
|
148
|
+
fullUrl: string;
|
|
149
|
+
method: HttpRequestType;
|
|
150
|
+
headers?: any;
|
|
151
|
+
body?: any;
|
|
152
|
+
}
|
|
@@ -9,10 +9,7 @@ export declare function validateJSON(str: string): boolean;
|
|
|
9
9
|
* @param obj The input object to create dynamic data from
|
|
10
10
|
* @returns The formatted array
|
|
11
11
|
*/
|
|
12
|
-
export declare function createDynamicData(obj: any):
|
|
13
|
-
AppFieldID: string;
|
|
14
|
-
Value: any;
|
|
15
|
-
}[] | null;
|
|
12
|
+
export declare function createDynamicData(obj: any): any;
|
|
16
13
|
/**
|
|
17
14
|
* Removes blank values from the input object
|
|
18
15
|
* @param dataObj The input object to remove blank values from
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
2
|
import { ChangePasswordUserRequest, LoginUserRequest, NewUserRequest, RefreshTokenRequest, RegisterTenant, ResetPasswordUserRequest, UserDetailsRequest } from '../app/interfaces/auth.interface';
|
|
3
|
-
import { CommonApiResponse } from '../app/interfaces/common
|
|
3
|
+
import { CommonApiResponse } from '../app/interfaces/common.interface';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
export declare class AuthService {
|
|
6
6
|
/**
|
|
@@ -20,7 +20,7 @@ export declare class ApiService {
|
|
|
20
20
|
* @param reqHeader The custom headers for the request (optional).
|
|
21
21
|
* @returns An Observable emitting the response data of type T.
|
|
22
22
|
*/
|
|
23
|
-
post<T, D>(endPointName: string, data?: D, reqHeader?: HttpHeaders): Observable<any>;
|
|
23
|
+
post<T, D>(endPointName: string, data?: D, reqHeader?: HttpHeaders): Observable<D | any>;
|
|
24
24
|
/**
|
|
25
25
|
* Makes an HTTP PUT request to update data at the specified URL.
|
|
26
26
|
* @param endPointName The URL for the HTTP PUT request.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PipeTransform, OnDestroy } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class TranslatePipe implements PipeTransform, OnDestroy {
|
|
4
|
+
private translationService;
|
|
5
|
+
private langChangeSub;
|
|
6
|
+
constructor();
|
|
7
|
+
transform(key: string, params?: any): string;
|
|
8
|
+
ngOnDestroy(): void;
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TranslatePipe, never>;
|
|
10
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<TranslatePipe, "translate", true>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { GlobalConfig } from 'ngx-toastr';
|
|
2
|
+
/**
|
|
3
|
+
* Provides the Toastr service with the specified configuration.
|
|
4
|
+
*
|
|
5
|
+
* @param {Partial<GlobalConfig>} [config] - Optional configuration object.
|
|
6
|
+
* @returns {any[]} - An array of providers.
|
|
7
|
+
*/
|
|
8
|
+
export declare function provideNotification(config?: Partial<GlobalConfig>): import("@angular/core").EnvironmentProviders[];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { TranslateLoader } from '@ngx-translate/core';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
export declare class CustomTranslateLoader implements TranslateLoader {
|
|
4
|
+
getTranslation(lang: string): Observable<any>;
|
|
5
|
+
}
|
|
6
|
+
export declare function provideTranslation(): import("@angular/core").EnvironmentProviders[];
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { ConfirmationOptions } from '../../app/interfaces/common.interface';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class ConfirmationService {
|
|
6
|
+
private conformationEmitter;
|
|
7
|
+
private dialogEmitter;
|
|
8
|
+
private removeEmitter;
|
|
9
|
+
/**
|
|
10
|
+
* Opens a confirmation dialog with the given title and message.
|
|
11
|
+
*
|
|
12
|
+
* This function will emit a value on the confirmation dialog emitter when the dialog is closed.
|
|
13
|
+
* The value emitted will be a boolean indicating whether the dialog was confirmed or canceled.
|
|
14
|
+
*
|
|
15
|
+
* @param {Object} config - The configuration for the dialog. Must have a 'title' and a 'message' property.
|
|
16
|
+
* @returns {Observable<boolean>} - An observable that emits a boolean indicating whether the dialog was confirmed or canceled.
|
|
17
|
+
*/
|
|
18
|
+
confirm(config?: ConfirmationOptions): Observable<boolean>;
|
|
19
|
+
/**
|
|
20
|
+
* Closes the confirmation dialog.
|
|
21
|
+
*
|
|
22
|
+
* This function emits a value on the remove emitter to close the confirmation dialog.
|
|
23
|
+
*
|
|
24
|
+
* @returns {void}
|
|
25
|
+
*/
|
|
26
|
+
closeDialog(): void;
|
|
27
|
+
/**
|
|
28
|
+
* Returns the emitter for the confirmation dialog.
|
|
29
|
+
*
|
|
30
|
+
* This emitter will emit a boolean indicating whether the dialog was confirmed or canceled.
|
|
31
|
+
*
|
|
32
|
+
* @returns {EventEmitter<boolean>} - The emitter for the confirmation dialog.
|
|
33
|
+
*/
|
|
34
|
+
getConformationEmitter(): EventEmitter<boolean>;
|
|
35
|
+
/**
|
|
36
|
+
* Returns the emitter for the confirmation dialog.
|
|
37
|
+
*
|
|
38
|
+
* This emitter will emit the config for the confirmation dialog.
|
|
39
|
+
*
|
|
40
|
+
* @returns {EventEmitter<any>} - The emitter for the confirmation dialog.
|
|
41
|
+
*/
|
|
42
|
+
getDialogEmitter(): EventEmitter<ConfirmationOptions>;
|
|
43
|
+
/**
|
|
44
|
+
* Returns the emitter for closing the confirmation dialog.
|
|
45
|
+
*
|
|
46
|
+
* This emitter can be subscribed to in order to close the confirmation dialog.
|
|
47
|
+
*
|
|
48
|
+
* @returns {EventEmitter<any>} - The emitter for closing the confirmation dialog.
|
|
49
|
+
*/
|
|
50
|
+
getRemoveEmitter(): EventEmitter<boolean>;
|
|
51
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ConfirmationService, never>;
|
|
52
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ConfirmationService>;
|
|
53
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { BaseNotificationOptions, NotificationOptions } from '../../app/interfaces/common.interface';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class NotificationService {
|
|
4
|
+
private readonly _tabToasterService;
|
|
5
|
+
/**
|
|
6
|
+
* Show a notification to the user.
|
|
7
|
+
*
|
|
8
|
+
* @param options The options for the notification.
|
|
9
|
+
*/
|
|
10
|
+
notify(options: NotificationOptions): void;
|
|
11
|
+
/**
|
|
12
|
+
* Displays a success notification to the user.
|
|
13
|
+
*
|
|
14
|
+
* @param options - The options for the notification, including message, title, and configuration.
|
|
15
|
+
*/
|
|
16
|
+
showSuccess(options: BaseNotificationOptions): void;
|
|
17
|
+
/**
|
|
18
|
+
* Displays a warning notification to the user.
|
|
19
|
+
*
|
|
20
|
+
* @param options - The options for the notification, including message, title, and configuration.
|
|
21
|
+
*/
|
|
22
|
+
showWarning(options: BaseNotificationOptions): void;
|
|
23
|
+
/**
|
|
24
|
+
* Displays an info notification to the user.
|
|
25
|
+
*
|
|
26
|
+
* @param options - The options for the notification, including message, title, and configuration.
|
|
27
|
+
*/
|
|
28
|
+
showInfo(options: BaseNotificationOptions): void;
|
|
29
|
+
/**
|
|
30
|
+
* Displays an error notification to the user.
|
|
31
|
+
*
|
|
32
|
+
* @param options - The options for the notification, including message, title, and configuration.
|
|
33
|
+
*/
|
|
34
|
+
showError(options: BaseNotificationOptions): void;
|
|
35
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NotificationService, never>;
|
|
36
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<NotificationService>;
|
|
37
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { translatePayload } from '../../app/interfaces/common.interface';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class TranslationService {
|
|
5
|
+
private defaultLanguage;
|
|
6
|
+
private currentLanguageSubject;
|
|
7
|
+
currentLanguage$: Observable<string>;
|
|
8
|
+
private readonly appHelper;
|
|
9
|
+
private readonly translateService;
|
|
10
|
+
constructor();
|
|
11
|
+
/**
|
|
12
|
+
* Gets the current active language
|
|
13
|
+
*/
|
|
14
|
+
getCurrentLanguage(): string;
|
|
15
|
+
/**
|
|
16
|
+
* Loads translations for a specific language from API
|
|
17
|
+
* @param languageCode The language code to load
|
|
18
|
+
* @param endpoint Optional API endpoint
|
|
19
|
+
*/
|
|
20
|
+
loadTranslations(payload: translatePayload): Observable<any>;
|
|
21
|
+
/**
|
|
22
|
+
* Stores translations in cache and updates ngx-translate
|
|
23
|
+
*/
|
|
24
|
+
setTranslations(lang: string, translations: any): void;
|
|
25
|
+
/**
|
|
26
|
+
* Changes the current language
|
|
27
|
+
* @param languageCode The language code to switch to
|
|
28
|
+
* @param translationData Optional pre-loaded translation data
|
|
29
|
+
*/
|
|
30
|
+
changeLanguage(payload: translatePayload): Observable<any>;
|
|
31
|
+
/**
|
|
32
|
+
* Translates a key
|
|
33
|
+
* @param key Translation key
|
|
34
|
+
* @param params Optional parameters for interpolation
|
|
35
|
+
*/
|
|
36
|
+
translate(key: string, params?: any): string;
|
|
37
|
+
/**
|
|
38
|
+
* Gets translation as observable (useful for async translations)
|
|
39
|
+
* @param key Translation key
|
|
40
|
+
* @param params Optional parameters for interpolation
|
|
41
|
+
*/
|
|
42
|
+
getTranslation(key: string, params?: any): Observable<string>;
|
|
43
|
+
/**
|
|
44
|
+
* Registers external library integration (like Syncfusion)
|
|
45
|
+
* @param handler Function to handle the integration
|
|
46
|
+
*/
|
|
47
|
+
registerIntegration(handler: (lang: string, translations: any) => void): void;
|
|
48
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TranslationService, never>;
|
|
49
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<TranslationService>;
|
|
50
|
+
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@techextensor/tab-core-utility",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.146",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": "^17.3.0",
|
|
6
6
|
"@angular/core": "^17.3.0",
|
|
7
7
|
"rxjs": "^7.8.1",
|
|
8
|
-
"@
|
|
9
|
-
"@
|
|
8
|
+
"@angular/router": "^17.3.0",
|
|
9
|
+
"@ngx-translate/core": "^15.0.0",
|
|
10
|
+
"ngx-toastr": "^19.0.0"
|
|
10
11
|
},
|
|
11
12
|
"dependencies": {
|
|
12
13
|
"tslib": "^2.3.0"
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export {};
|
|
2
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tbW9uLWFwaS5pbnRlcmZhY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9saWJzL2RhdGEtYWNjZXNzL3NyYy9saWIvdGFiLWNvcmUtdXRpbGl0eS9hcHAvaW50ZXJmYWNlcy9jb21tb24tYXBpLmludGVyZmFjZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgSnNvblR5cGUgfSBmcm9tIFwiLi4vZW51bXMvY29tbW9uLmVudW1cIjtcblxuLyogZXNsaW50LWRpc2FibGUgQHR5cGVzY3JpcHQtZXNsaW50L25vLWV4cGxpY2l0LWFueSAqL1xuZXhwb3J0IGludGVyZmFjZSBBcGlSZXNwb25zZSB7XG4gIHJlcXVlc3RJZDogc3RyaW5nO1xuICBpc1N1Y2Nlc3M6IGJvb2xlYW47XG4gIHJlc3VsdDogYW55O1xuICBlcnJvcnM6IHN0cmluZ1tdO1xufVxuXG5leHBvcnQgaW50ZXJmYWNlIFJlY29yZEluZm8ge1xuICBpc1N5c3RlbVJlY29yZDogYm9vbGVhbiB8IG51bGw7XG4gIGJsdWVwcmludElkOiBzdHJpbmcgfCBudWxsO1xuICBibHVlcHJpbnRTdGF0dXNJZDogc3RyaW5nIHwgbnVsbDtcbiAgcmVjb3JkSWQ6IHN0cmluZztcbiAgcHJpbWFyeUtleTogc3RyaW5nO1xufVxuXG5leHBvcnQgaW50ZXJmYWNlIENvbW1vbkFwaVJlc3BvbnNlIHtcbiAgUmVxdWVzdElkOiBzdHJpbmdcbiAgSXNTdWNjZXNzOiBib29sZWFuXG4gIFJlc3VsdDogYW55XG4g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Z1tdXG4gIH1cbn0iXX0=
|
package/esm2022/lib/tab-core-utility/core/error-handler/error-handler-interceptor.service.mjs
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
import { HttpErrorResponse } from '@angular/common/http';
|
|
3
|
-
import { inject } from '@angular/core';
|
|
4
|
-
import { throwError } from 'rxjs';
|
|
5
|
-
import { catchError } from 'rxjs/operators';
|
|
6
|
-
import { ErrorHandlerStore } from './error-handler.store';
|
|
7
|
-
export const errorHandlingInterceptor = (request, next) => {
|
|
8
|
-
const errorHandlerStore = inject(ErrorHandlerStore);
|
|
9
|
-
return next(request).pipe(catchError((error) => {
|
|
10
|
-
if (error instanceof HttpErrorResponse) {
|
|
11
|
-
switch (error.status) {
|
|
12
|
-
case 401:
|
|
13
|
-
errorHandlerStore.handleError401(error);
|
|
14
|
-
break;
|
|
15
|
-
case 404:
|
|
16
|
-
errorHandlerStore.handleError404(error);
|
|
17
|
-
break;
|
|
18
|
-
default:
|
|
19
|
-
throwError(() => error);
|
|
20
|
-
break;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
return throwError(() => error);
|
|
24
|
-
}));
|
|
25
|
-
};
|
|
26
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXJyb3ItaGFuZGxlci1pbnRlcmNlcHRvci5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9kYXRhLWFjY2Vzcy9zcmMvbGliL3RhYi1jb3JlLXV0aWxpdHkvY29yZS9lcnJvci1oYW5kbGVyL2Vycm9yLWhhbmRsZXItaW50ZXJjZXB0b3Iuc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSx1REFBdUQ7QUFDdkQsT0FBTyxFQUFFLGlCQUFpQixFQUF5QyxNQU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gICBlcnJvckhhbmRsZXJTdG9yZS5oYW5kbGVFcnJvcjQwNChlcnJvcik7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgdGhyb3dFcnJvcigoKSA9PiBlcnJvcik7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgcmV0dXJuIHRocm93RXJyb3IoKCkgPT4gZXJyb3IpO1xuICAgIH0pLFxuICApO1xufTtcbiJdfQ==
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { signalStore, withState, withMethods, patchState } from '@ngrx/signals';
|
|
2
|
-
import { inject } from '@angular/core';
|
|
3
|
-
import { Router } from '@angular/router';
|
|
4
|
-
import { errorHandlerInitialState } from './models/error-handler.state';
|
|
5
|
-
export const ErrorHandlerStore = signalStore({ providedIn: 'root' }, withState(errorHandlerInitialState), withMethods((store, router = inject(Router)) => ({
|
|
6
|
-
handleError401: (error) => {
|
|
7
|
-
patchState(store, {
|
|
8
|
-
code: error.status,
|
|
9
|
-
message: error.message,
|
|
10
|
-
});
|
|
11
|
-
router.navigate(['/login']);
|
|
12
|
-
},
|
|
13
|
-
handleError404: (error) => {
|
|
14
|
-
patchState(store, {
|
|
15
|
-
code: error.status,
|
|
16
|
-
message: error.message,
|
|
17
|
-
});
|
|
18
|
-
router.navigate(['/']);
|
|
19
|
-
},
|
|
20
|
-
})));
|
|
21
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXJyb3ItaGFuZGxlci5zdG9yZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvZGF0YS1hY2Nlc3Mvc3JjL2xpYi90YWItY29yZS11dGlsaXR5L2NvcmUvZXJyb3ItaGFuZGxlci9lcnJvci1oYW5kbGVyLnN0b3JlLnRzIl0sIm5hbWVzIjpbXSwibWFwc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bnNlKSA9PiB7XG4gICAgICBwYXRjaFN0YXRlKHN0b3JlLCB7XG4gICAgICAgIGNvZGU6IGVycm9yLnN0YXR1cyxcbiAgICAgICAgbWVzc2FnZTogZXJyb3IubWVzc2FnZSxcbiAgICAgIH0pO1xuICAgICAgcm91dGVyLm5hdmlnYXRlKFsnLyddKTtcbiAgICB9LFxuICB9KSksXG4pO1xuIl19
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export const errorHandlerInitialState = {
|
|
2
|
-
message: undefined,
|
|
3
|
-
code: -1,
|
|
4
|
-
};
|
|
5
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXJyb3ItaGFuZGxlci5zdGF0ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvZGF0YS1hY2Nlc3Mvc3JjL2xpYi90YWItY29yZS11dGlsaXR5L2NvcmUvZXJyb3ItaGFuZGxlci9tb2RlbHMvZXJyb3ItaGFuZGxlci5zdGF0ZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFLQSxNQUFNLENBQUMsTUFBTSx3QkFBd0IsR0FBc0I7SUFDekQsT0FBTyxFQUFFLFNBQVM7SUFDbEIsSUFBSSxFQUFFLENBQUMsQ0FBQztDQUNULENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgaW50ZXJmYWNlIEVycm9ySGFuZGxlclN0YXRlIHtcbiAgY29kZTogbnVtYmVyO1xuICBtZXNzYWdlOiBzdHJpbmcgfCB1bmRlZmluZWQ7XG59XG5cbmV4cG9ydCBjb25zdCBlcnJvckhhbmRsZXJJbml0aWFsU3RhdGU6IEVycm9ySGFuZGxlclN0YXRlID0ge1xuICBtZXNzYWdlOiB1bmRlZmluZWQsXG4gIGNvZGU6IC0xLFxufTtcbiJdfQ==
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
// -----------------------------------------------------------------------------------------------------
|
|
2
|
-
// @ AUTH UTILITIES
|
|
3
|
-
//
|
|
4
|
-
// Methods are derivations of the Auth0 Angular-JWT helper service methods
|
|
5
|
-
// https://github.com/auth0/angular2-jwt
|
|
6
|
-
// -----------------------------------------------------------------------------------------------------
|
|
7
|
-
export class AuthUtils {
|
|
8
|
-
// -----------------------------------------------------------------------------------------------------
|
|
9
|
-
// @ Public methods
|
|
10
|
-
// -----------------------------------------------------------------------------------------------------
|
|
11
|
-
/**
|
|
12
|
-
* Is token expired?
|
|
13
|
-
*
|
|
14
|
-
* @param token
|
|
15
|
-
* @param offsetSeconds
|
|
16
|
-
*/
|
|
17
|
-
static isTokenExpired() {
|
|
18
|
-
return true;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXV0aC51dGlscy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvZGF0YS1hY2Nlc3Mvc3JjL2xpYi90YWItY29yZS11dGlsaXR5L2NvcmUvdXRpbC9hdXRoLnV0aWxzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLHdHQUF3RztBQUN4RyxtQkFBbUI7QUFDbkIsRUFBRTtBQUNGLDBFQUEwRTtBQUMxRSx3Q0FBd0M7QUFDeEMsd0dBQXdHO0FBRXhHLE1BQU0sT0FBTyxTQUFTO0lBQ3BCLHdHQUF3RztJQUN4RyxtQkFBbUI7SUFDbkIsd0dBQXdHO0lBRXhHOzs7OztPQUtHO0lBQ0gsTUFBTSxDQUFDLGNBQWM7UUFDbkIsT0FBTyxJQUFJLENBQUM7SUFDZCxDQUFDO0NBQ0YiLCJzb3VyY2VzQ29udGVudCI6WyIvLyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tL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