@techextensor/tab-core-utility 2.1.7 → 2.1.8
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 +64 -0
- package/esm2022/lib/tab-core-utility/app/constants/api-constants.mjs +33 -0
- package/esm2022/lib/tab-core-utility/app/constants/common.mjs +25 -0
- package/esm2022/lib/tab-core-utility/app/constants/error-messages.mjs +13 -0
- package/esm2022/lib/tab-core-utility/app/constants/storage-constants.mjs +16 -0
- package/esm2022/lib/tab-core-utility/app/crud/tab-delete.service.mjs +145 -0
- package/esm2022/lib/tab-core-utility/app/crud/tab-get.service.mjs +131 -0
- package/esm2022/lib/tab-core-utility/app/crud/tab-insert.service.mjs +77 -0
- package/esm2022/lib/tab-core-utility/app/crud/tab-update.service.mjs +105 -0
- package/esm2022/lib/tab-core-utility/app/crud/tab-workflow.service.mjs +43 -0
- package/esm2022/lib/tab-core-utility/app/enums/controllers.enum.mjs +26 -0
- package/esm2022/lib/tab-core-utility/app/enums/dsq.enum.mjs +48 -0
- package/esm2022/lib/tab-core-utility/app/enums/permission.enum.mjs +20 -0
- package/esm2022/lib/tab-core-utility/app/enums/query.enum.mjs +14 -0
- package/esm2022/lib/tab-core-utility/app/enums/workflow.enum.mjs +37 -0
- package/esm2022/lib/tab-core-utility/app/helpers/common/app.helpers.mjs +68 -0
- package/esm2022/lib/tab-core-utility/app/helpers/common/dsq.helpers.mjs +70 -0
- package/esm2022/lib/tab-core-utility/app/helpers/common/req-res.helpers.mjs +64 -0
- package/esm2022/lib/tab-core-utility/app/helpers/common/where-clause.helpers.mjs +208 -0
- package/esm2022/lib/tab-core-utility/app/helpers/screen/forms.helpers.mjs +38 -0
- package/esm2022/lib/tab-core-utility/app/helpers/screen/grid-column-data.helpers.mjs +78 -0
- package/esm2022/lib/tab-core-utility/app/helpers/screen/grid.helpers.mjs +112 -0
- package/esm2022/lib/tab-core-utility/app/helpers/screen/media-upload.helpers.mjs +77 -0
- package/esm2022/lib/tab-core-utility/app/helpers/screen/plugin.helpers.mjs +55 -0
- package/esm2022/lib/tab-core-utility/app/helpers/screen/screen.helpers.mjs +26 -0
- package/esm2022/lib/tab-core-utility/app/interfaces/auth.interface.mjs +2 -0
- package/esm2022/lib/tab-core-utility/app/interfaces/common-api.interface.mjs +2 -0
- package/esm2022/lib/tab-core-utility/app/interfaces/grid.interface.mjs +3 -0
- package/esm2022/lib/tab-core-utility/app/interfaces/orgInfo.interface.mjs +2 -0
- package/esm2022/lib/tab-core-utility/app/interfaces/schema.interface.mjs +2 -0
- package/esm2022/lib/tab-core-utility/app/interfaces/user.interface.mjs +2 -0
- package/esm2022/lib/tab-core-utility/app/models/api-query.class.mjs +47 -0
- package/esm2022/lib/tab-core-utility/app/models/app-object.class.mjs +30 -0
- package/esm2022/lib/tab-core-utility/app/models/common.class.mjs +12 -0
- package/esm2022/lib/tab-core-utility/app/models/data-source-queries.class.mjs +31 -0
- package/esm2022/lib/tab-core-utility/app/utils/filter.util.mjs +75 -0
- package/esm2022/lib/tab-core-utility/app/utils/form-builder.util.mjs +39 -0
- package/esm2022/lib/tab-core-utility/app/utils/json.util.mjs +138 -0
- package/esm2022/lib/tab-core-utility/app/utils/operators.util.mjs +129 -0
- package/esm2022/lib/tab-core-utility/app/utils/req-res.util.mjs +168 -0
- package/esm2022/lib/tab-core-utility/app/utils/tab-app.util.mjs +99 -0
- package/esm2022/lib/tab-core-utility/auth/auth.service.mjs +74 -0
- package/esm2022/lib/tab-core-utility/auth/idb-storage.service.mjs +69 -0
- package/esm2022/lib/tab-core-utility/auth/local-storage.service.mjs +52 -0
- package/esm2022/lib/tab-core-utility/auth/session-storage.service.mjs +52 -0
- package/esm2022/lib/tab-core-utility/core/error-handler/error-handler-interceptor.service.mjs +26 -0
- package/esm2022/lib/tab-core-utility/core/error-handler/error-handler.store.mjs +21 -0
- package/esm2022/lib/tab-core-utility/core/error-handler/models/error-handler.state.mjs +5 -0
- package/esm2022/lib/tab-core-utility/core/http-client/api-url.token.mjs +4 -0
- package/esm2022/lib/tab-core-utility/core/http-client/api.service.mjs +99 -0
- package/esm2022/lib/tab-core-utility/core/util/auth.utils.mjs +21 -0
- package/esm2022/lib/tab-core-utility/store/auth.store.mjs +43 -0
- package/esm2022/lib/tab-core-utility/store/orginfo.store.mjs +42 -0
- package/esm2022/lib/tab-core-utility/store/schema.store.mjs +68 -0
- package/esm2022/techextensor-tab-core-utility.mjs +5 -0
- package/{src/index.ts → index.d.ts} +53 -77
- package/lib/tab-core-utility/app/constants/api-constants.d.ts +30 -0
- package/lib/tab-core-utility/app/constants/common.d.ts +8 -0
- package/lib/tab-core-utility/app/constants/error-messages.d.ts +6 -0
- package/lib/tab-core-utility/app/constants/storage-constants.d.ts +15 -0
- package/lib/tab-core-utility/app/crud/tab-delete.service.d.ts +51 -0
- package/lib/tab-core-utility/app/crud/tab-get.service.d.ts +58 -0
- package/lib/tab-core-utility/app/crud/tab-insert.service.d.ts +37 -0
- package/lib/tab-core-utility/app/crud/tab-update.service.d.ts +14 -0
- package/lib/tab-core-utility/app/crud/tab-workflow.service.d.ts +20 -0
- package/lib/tab-core-utility/app/enums/controllers.enum.d.ts +24 -0
- package/lib/tab-core-utility/app/enums/dsq.enum.d.ts +42 -0
- package/lib/tab-core-utility/app/enums/permission.enum.d.ts +16 -0
- package/lib/tab-core-utility/app/enums/query.enum.d.ts +11 -0
- package/lib/tab-core-utility/app/enums/workflow.enum.d.ts +30 -0
- package/lib/tab-core-utility/app/helpers/common/app.helpers.d.ts +31 -0
- package/lib/tab-core-utility/app/helpers/common/dsq.helpers.d.ts +32 -0
- package/lib/tab-core-utility/app/helpers/common/req-res.helpers.d.ts +62 -0
- package/lib/tab-core-utility/app/helpers/common/where-clause.helpers.d.ts +82 -0
- package/lib/tab-core-utility/app/helpers/screen/forms.helpers.d.ts +11 -0
- package/lib/tab-core-utility/app/helpers/screen/grid-column-data.helpers.d.ts +33 -0
- package/lib/tab-core-utility/app/helpers/screen/grid.helpers.d.ts +63 -0
- package/lib/tab-core-utility/app/helpers/screen/media-upload.helpers.d.ts +38 -0
- package/lib/tab-core-utility/app/helpers/screen/plugin.helpers.d.ts +25 -0
- package/lib/tab-core-utility/app/helpers/screen/screen.helpers.d.ts +11 -0
- package/{src/lib/tab-core-utility/app/interfaces/auth.interface.ts → lib/tab-core-utility/app/interfaces/auth.interface.d.ts} +15 -18
- package/lib/tab-core-utility/app/interfaces/common-api.interface.d.ts +24 -0
- package/lib/tab-core-utility/app/interfaces/grid.interface.d.ts +110 -0
- package/lib/tab-core-utility/app/interfaces/orgInfo.interface.d.ts +31 -0
- package/lib/tab-core-utility/app/interfaces/schema.interface.d.ts +11 -0
- package/lib/tab-core-utility/app/interfaces/user.interface.d.ts +84 -0
- package/lib/tab-core-utility/app/models/api-query.class.d.ts +69 -0
- package/lib/tab-core-utility/app/models/app-object.class.d.ts +74 -0
- package/lib/tab-core-utility/app/models/common.class.d.ts +24 -0
- package/lib/tab-core-utility/app/models/data-source-queries.class.d.ts +95 -0
- package/lib/tab-core-utility/app/utils/filter.util.d.ts +30 -0
- package/lib/tab-core-utility/app/utils/form-builder.util.d.ts +13 -0
- package/lib/tab-core-utility/app/utils/json.util.d.ts +25 -0
- package/lib/tab-core-utility/app/utils/operators.util.d.ts +21 -0
- package/lib/tab-core-utility/app/utils/req-res.util.d.ts +61 -0
- package/lib/tab-core-utility/app/utils/tab-app.util.d.ts +48 -0
- package/lib/tab-core-utility/auth/auth.service.d.ts +53 -0
- package/lib/tab-core-utility/auth/idb-storage.service.d.ts +14 -0
- package/lib/tab-core-utility/auth/local-storage.service.d.ts +22 -0
- package/lib/tab-core-utility/auth/session-storage.service.d.ts +22 -0
- package/lib/tab-core-utility/core/error-handler/error-handler-interceptor.service.d.ts +3 -0
- package/lib/tab-core-utility/core/error-handler/error-handler.store.d.ts +10 -0
- package/lib/tab-core-utility/core/error-handler/models/error-handler.state.d.ts +5 -0
- package/lib/tab-core-utility/core/http-client/api-url.token.d.ts +3 -0
- package/lib/tab-core-utility/core/http-client/api.service.d.ts +65 -0
- package/lib/tab-core-utility/core/util/auth.utils.d.ts +9 -0
- package/lib/tab-core-utility/store/auth.store.d.ts +19 -0
- package/lib/tab-core-utility/store/orginfo.store.d.ts +22 -0
- package/lib/tab-core-utility/store/schema.store.d.ts +32 -0
- package/package.json +31 -18
- package/.eslintrc.json +0 -92
- package/README.md +0 -7
- package/jest.config.ts +0 -22
- package/ng-package.json +0 -7
- package/project.json +0 -42
- package/src/lib/tab-core-utility/app/constants/api-constants.ts +0 -33
- package/src/lib/tab-core-utility/app/constants/common.ts +0 -34
- package/src/lib/tab-core-utility/app/constants/error-messages.ts +0 -21
- package/src/lib/tab-core-utility/app/constants/storage-constants.ts +0 -17
- package/src/lib/tab-core-utility/app/crud/tab-delete.service.ts +0 -144
- package/src/lib/tab-core-utility/app/crud/tab-get.service.ts +0 -160
- package/src/lib/tab-core-utility/app/crud/tab-insert.service.ts +0 -75
- package/src/lib/tab-core-utility/app/crud/tab-update.service.ts +0 -105
- package/src/lib/tab-core-utility/app/crud/tab-workflow.service.ts +0 -39
- package/src/lib/tab-core-utility/app/enums/controllers.enum.ts +0 -24
- package/src/lib/tab-core-utility/app/enums/dsq.enum.ts +0 -46
- package/src/lib/tab-core-utility/app/enums/permission.enum.ts +0 -18
- package/src/lib/tab-core-utility/app/enums/query.enum.ts +0 -12
- package/src/lib/tab-core-utility/app/enums/workflow.enum.ts +0 -35
- package/src/lib/tab-core-utility/app/helpers/common/app.helpers.ts +0 -65
- package/src/lib/tab-core-utility/app/helpers/common/dsq.helpers.ts +0 -80
- package/src/lib/tab-core-utility/app/helpers/common/req-res.helpers.ts +0 -75
- package/src/lib/tab-core-utility/app/helpers/common/where-clause.helpers.ts +0 -262
- package/src/lib/tab-core-utility/app/helpers/screen/forms.helpers.ts +0 -33
- package/src/lib/tab-core-utility/app/helpers/screen/grid-column-data.helpers.ts +0 -88
- package/src/lib/tab-core-utility/app/helpers/screen/grid.helpers.ts +0 -113
- package/src/lib/tab-core-utility/app/helpers/screen/media-upload.helpers.ts +0 -74
- package/src/lib/tab-core-utility/app/helpers/screen/plugin.helpers.ts +0 -52
- package/src/lib/tab-core-utility/app/helpers/screen/screen.helpers.ts +0 -20
- package/src/lib/tab-core-utility/app/interfaces/common-api.interface.ts +0 -27
- package/src/lib/tab-core-utility/app/interfaces/grid.interface.ts +0 -118
- package/src/lib/tab-core-utility/app/interfaces/orgInfo.interface.ts +0 -34
- package/src/lib/tab-core-utility/app/interfaces/schema.interface.ts +0 -11
- package/src/lib/tab-core-utility/app/interfaces/user.interface.ts +0 -91
- package/src/lib/tab-core-utility/app/models/api-query.class.ts +0 -92
- package/src/lib/tab-core-utility/app/models/app-object.class.ts +0 -87
- package/src/lib/tab-core-utility/app/models/common.class.ts +0 -30
- package/src/lib/tab-core-utility/app/models/data-source-queries.class.ts +0 -114
- package/src/lib/tab-core-utility/app/utils/filter.util.ts +0 -78
- package/src/lib/tab-core-utility/app/utils/form-builder.util.ts +0 -31
- package/src/lib/tab-core-utility/app/utils/json.util.ts +0 -137
- package/src/lib/tab-core-utility/app/utils/operators.util.ts +0 -129
- package/src/lib/tab-core-utility/app/utils/req-res.util.ts +0 -189
- package/src/lib/tab-core-utility/app/utils/tab-app.util.ts +0 -131
- package/src/lib/tab-core-utility/auth/auth.service.spec.ts +0 -167
- package/src/lib/tab-core-utility/auth/auth.service.ts +0 -91
- package/src/lib/tab-core-utility/auth/idb-storage.service.ts +0 -77
- package/src/lib/tab-core-utility/auth/local-storage.service.spec.ts +0 -47
- package/src/lib/tab-core-utility/auth/local-storage.service.ts +0 -46
- package/src/lib/tab-core-utility/auth/session-storage.service.spec.ts +0 -47
- package/src/lib/tab-core-utility/auth/session-storage.service.ts +0 -46
- package/src/lib/tab-core-utility/core/error-handler/error-handler-interceptor.service.ts +0 -32
- package/src/lib/tab-core-utility/core/error-handler/error-handler.store.spec.ts +0 -16
- package/src/lib/tab-core-utility/core/error-handler/error-handler.store.ts +0 -26
- package/src/lib/tab-core-utility/core/error-handler/models/error-handler.state.ts +0 -9
- package/src/lib/tab-core-utility/core/http-client/api-url.token.ts +0 -4
- package/src/lib/tab-core-utility/core/http-client/api.service.spec.ts +0 -18
- package/src/lib/tab-core-utility/core/http-client/api.service.ts +0 -105
- package/src/lib/tab-core-utility/core/util/auth.utils.ts +0 -22
- package/src/lib/tab-core-utility/store/auth.store.ts +0 -54
- package/src/lib/tab-core-utility/store/orginfo.store.ts +0 -57
- package/src/lib/tab-core-utility/store/schema.store.ts +0 -85
- package/src/test-setup.ts +0 -8
- package/tsconfig.json +0 -29
- package/tsconfig.lib.json +0 -17
- package/tsconfig.lib.prod.json +0 -7
- package/tsconfig.spec.json +0 -16
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
import { Injectable, inject } from '@angular/core';
|
|
3
|
-
import { HttpClient, HttpParams, HttpHeaders } from '@angular/common/http';
|
|
4
|
-
import { Observable } from 'rxjs';
|
|
5
|
-
import { API_URL, Workflow_URL } from './api-url.token';
|
|
6
|
-
|
|
7
|
-
@Injectable({ providedIn: 'root' })
|
|
8
|
-
export class ApiService {
|
|
9
|
-
private readonly http = inject(HttpClient);
|
|
10
|
-
private readonly api_url = inject(API_URL);
|
|
11
|
-
private readonly workflow_url = inject(Workflow_URL);
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Makes an HTTP GET request to retrieve data from the specified URL.
|
|
15
|
-
* @param endPointName The URL for the HTTP GET request.
|
|
16
|
-
* @param params The query parameters for the request (default is an empty HttpParams object).
|
|
17
|
-
* @param reqHeader The custom headers for the request (optional).
|
|
18
|
-
* @returns An Observable emitting the response data of type T.
|
|
19
|
-
*/
|
|
20
|
-
get<T>(
|
|
21
|
-
endPointName: string,
|
|
22
|
-
params: HttpParams = new HttpParams(),
|
|
23
|
-
reqHeader?: HttpHeaders
|
|
24
|
-
): Observable<any> {
|
|
25
|
-
return this.http.get<T>(`${this.api_url}${endPointName}`, {
|
|
26
|
-
headers: reqHeader,
|
|
27
|
-
params,
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Makes an HTTP POST request to send data to the specified URL.
|
|
33
|
-
* @param endPointName The URL for the HTTP POST request.
|
|
34
|
-
* @param data The data to send with the request (optional).
|
|
35
|
-
* @param reqHeader The custom headers for the request (optional).
|
|
36
|
-
* @returns An Observable emitting the response data of type T.
|
|
37
|
-
*/
|
|
38
|
-
post<T, D>(endPointName: string, data?: D, reqHeader?: HttpHeaders): Observable<any> {
|
|
39
|
-
return this.http.post<T>(`${this.api_url}${endPointName}`, JSON.stringify(data), {
|
|
40
|
-
headers: reqHeader,
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Makes an HTTP PUT request to update data at the specified URL.
|
|
46
|
-
* @param endPointName The URL for the HTTP PUT request.
|
|
47
|
-
* @param data The data to send with the request.
|
|
48
|
-
* @param reqHeader The custom headers for the request (optional).
|
|
49
|
-
* @returns An Observable emitting the response data of type T.
|
|
50
|
-
*/
|
|
51
|
-
put<T, D>(endPointName: string, data: D, reqHeader?: HttpHeaders): Observable<any> {
|
|
52
|
-
return this.http.put<T>(`${this.api_url}${endPointName}`, JSON.stringify(data), {
|
|
53
|
-
headers: reqHeader,
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Makes an HTTP DELETE request to delete data from the specified URL.
|
|
59
|
-
* @param endPointName The URL for the HTTP DELETE request.
|
|
60
|
-
* @param reqHeader The custom headers for the request (optional).
|
|
61
|
-
* @returns An Observable emitting the response data of type T.
|
|
62
|
-
*/
|
|
63
|
-
delete<T>(endPointName: string, reqHeader?: HttpHeaders): Observable<any> {
|
|
64
|
-
return this.http.delete<T>(`${this.api_url}${endPointName}`, {
|
|
65
|
-
headers: reqHeader,
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Makes an HTTP GET request to retrieve blob data with custom headers.
|
|
72
|
-
* @param endPointName The URL for the HTTP request.
|
|
73
|
-
* @param params The query parameters for the request.
|
|
74
|
-
* @param reqHeader The custom headers for the request.
|
|
75
|
-
* @returns An Observable emitting the response as a Blob.
|
|
76
|
-
*/
|
|
77
|
-
getBlob<T>(endPointName: string, params: HttpParams = new HttpParams(), reqHeader?: HttpHeaders): Observable<any> {
|
|
78
|
-
return this.http.get<T>(`${this.api_url}${endPointName}`, { headers: reqHeader, params, responseType: 'blob' as 'json' });
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Makes an HTTP POST request to send data and retrieve blob data with custom headers.
|
|
83
|
-
* @param endPointName The URL for the HTTP request.
|
|
84
|
-
* @param data The data to send with the request.
|
|
85
|
-
* @param reqHeader The custom headers for the request.
|
|
86
|
-
* @returns An Observable emitting the response as a Blob.
|
|
87
|
-
*/
|
|
88
|
-
postBlob<T, D>(endPointName: string, data?: D, reqHeader?: HttpHeaders): Observable<any> {
|
|
89
|
-
return this.http.post<T>(`${this.api_url}${endPointName}`, data, { headers: reqHeader, responseType: 'blob' as 'json' });
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Makes an HTTP POST request to the specified endpoint for Workflow.
|
|
94
|
-
* @param endPointName The endpoint for the HTTP POST request.
|
|
95
|
-
* @param data The data to send with the request (optional).
|
|
96
|
-
* @param reqHeader The custom headers for the request (optional).
|
|
97
|
-
* @returns An Observable emitting the response data of type T.
|
|
98
|
-
*/
|
|
99
|
-
postWorkflow<T, D>(endPointName: string, data?: D, reqHeader?: HttpHeaders): Observable<any> {
|
|
100
|
-
return this.http.post<T>(`${this.workflow_url}${endPointName}`, JSON.stringify(data), {
|
|
101
|
-
headers: reqHeader,
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
}
|
|
@@ -1,22 +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
|
-
|
|
8
|
-
export class AuthUtils {
|
|
9
|
-
// -----------------------------------------------------------------------------------------------------
|
|
10
|
-
// @ Public methods
|
|
11
|
-
// -----------------------------------------------------------------------------------------------------
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Is token expired?
|
|
15
|
-
*
|
|
16
|
-
* @param token
|
|
17
|
-
* @param offsetSeconds
|
|
18
|
-
*/
|
|
19
|
-
static isTokenExpired(): boolean {
|
|
20
|
-
return true;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
import { inject } from "@angular/core";
|
|
3
|
-
import { signalStore, withState, withMethods, patchState, withHooks } from "@ngrx/signals";
|
|
4
|
-
import { Observable, tap } from "rxjs";
|
|
5
|
-
import { LoginUserRequest } from "../app/interfaces/auth.interface";
|
|
6
|
-
import { AuthService } from "../auth/auth.service";
|
|
7
|
-
import { LocalStorageService } from "../auth/local-storage.service";
|
|
8
|
-
import { StorageConstants } from "../app/constants/storage-constants";
|
|
9
|
-
import { UserStore } from "../app/interfaces/user.interface";
|
|
10
|
-
|
|
11
|
-
const initialState: UserStore = {
|
|
12
|
-
id: '',
|
|
13
|
-
name: '',
|
|
14
|
-
email: '',
|
|
15
|
-
avatar: '',
|
|
16
|
-
status: '',
|
|
17
|
-
token: ''
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export const authStore = signalStore(
|
|
21
|
-
{ providedIn: 'root' },
|
|
22
|
-
withState(initialState),
|
|
23
|
-
withMethods(
|
|
24
|
-
(store, authService = inject(AuthService), storage = inject(LocalStorageService)) => ({
|
|
25
|
-
checkUserlogin():boolean {
|
|
26
|
-
const UserInformation: UserStore = JSON.parse(storage.getLocalStorage(StorageConstants.userInfo));
|
|
27
|
-
if (UserInformation) {
|
|
28
|
-
patchState(store, UserInformation);
|
|
29
|
-
return true;
|
|
30
|
-
}
|
|
31
|
-
return false;
|
|
32
|
-
},
|
|
33
|
-
login(API_URL: string, credentials: LoginUserRequest): Observable<any> {
|
|
34
|
-
return authService.signIn(API_URL, credentials).pipe(
|
|
35
|
-
tap({
|
|
36
|
-
next: (res: any) => {
|
|
37
|
-
const userData: UserStore = {
|
|
38
|
-
id: res.Result.user.Id,
|
|
39
|
-
email: res.Result.user.Attributes.Email,
|
|
40
|
-
name: res.Result.user.PersonData.FirstName,
|
|
41
|
-
avatar: '',
|
|
42
|
-
status: '',
|
|
43
|
-
token: res.Result.Token
|
|
44
|
-
};
|
|
45
|
-
patchState(store, userData);
|
|
46
|
-
storage.setLocalStorage(StorageConstants.userInfo, userData);
|
|
47
|
-
},
|
|
48
|
-
error: ({ error }) => (console.log(error)),
|
|
49
|
-
})
|
|
50
|
-
);
|
|
51
|
-
},
|
|
52
|
-
})
|
|
53
|
-
)
|
|
54
|
-
);
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
import { inject } from '@angular/core';
|
|
3
|
-
import {
|
|
4
|
-
patchState,
|
|
5
|
-
signalStore,
|
|
6
|
-
withMethods,
|
|
7
|
-
withState,
|
|
8
|
-
} from '@ngrx/signals';
|
|
9
|
-
import { LocalStorageService } from '../auth/local-storage.service';
|
|
10
|
-
import { Info, OrgInfoResponse } from '../app/interfaces/orgInfo.interface';
|
|
11
|
-
import { TabGetService } from '../app/crud/tab-get.service';
|
|
12
|
-
import { StorageConstants } from '../app/constants/storage-constants';
|
|
13
|
-
|
|
14
|
-
const initialState: Info = {
|
|
15
|
-
FavIcon: '',
|
|
16
|
-
Org_Brand_Color: '',
|
|
17
|
-
Org_Logo: '',
|
|
18
|
-
Org_Menu_Logo: '',
|
|
19
|
-
ShowSignUp: '',
|
|
20
|
-
TagLine: '',
|
|
21
|
-
profileScreenID: '',
|
|
22
|
-
workFlowName: '',
|
|
23
|
-
OrganizationName: ''
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export const OrgInfoStore = signalStore(
|
|
27
|
-
{ providedIn: 'root' },
|
|
28
|
-
withState(initialState),
|
|
29
|
-
withMethods(
|
|
30
|
-
(store,
|
|
31
|
-
tabGet = inject(TabGetService),
|
|
32
|
-
storage = inject(LocalStorageService)) => ({
|
|
33
|
-
// To check Org info data exits or not in local storage
|
|
34
|
-
getOrganizationInformation: (orgInfoData: any) => {
|
|
35
|
-
const orgInfo:any = storage.getLocalStorage(StorageConstants.orgInfo);
|
|
36
|
-
if (orgInfo) {
|
|
37
|
-
patchState(store, JSON.parse(orgInfo));
|
|
38
|
-
} else {
|
|
39
|
-
tabGet.executeRAWDSQWithName(orgInfoData).subscribe({
|
|
40
|
-
next: (orgInfoRes: OrgInfoResponse) => {
|
|
41
|
-
|
|
42
|
-
if (orgInfoRes && orgInfoRes.IsSuccess && orgInfoRes.StatusCode === '200' && orgInfoRes.Result && orgInfoRes.Result.length > 0) {
|
|
43
|
-
const infoData: Info = JSON.parse(orgInfoRes.Result[0].LocaleSettings);
|
|
44
|
-
infoData.OrganizationName = orgInfoRes.Result[0].OrganizationName;
|
|
45
|
-
storage.setLocalStorage(StorageConstants.orgInfo, infoData);
|
|
46
|
-
patchState(store, infoData);
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
error: (response: Error) => {
|
|
50
|
-
console.log(response)
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
})
|
|
56
|
-
),
|
|
57
|
-
);
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
import { inject } from '@angular/core';
|
|
3
|
-
import {
|
|
4
|
-
patchState,
|
|
5
|
-
signalStore,
|
|
6
|
-
withMethods,
|
|
7
|
-
withState,
|
|
8
|
-
} from '@ngrx/signals';
|
|
9
|
-
import { LocalStorageService } from '../auth/local-storage.service';
|
|
10
|
-
import { AppHelper } from '../app/helpers/common/app.helpers';
|
|
11
|
-
import { StorageConstants } from '../app/constants/storage-constants';
|
|
12
|
-
import { Application } from '../app/models/app-object.class';
|
|
13
|
-
import { SchemaResponse } from '../app/interfaces/schema.interface';
|
|
14
|
-
import { Common } from '../app/constants/common';
|
|
15
|
-
import { IdbService } from '../auth/idb-storage.service';
|
|
16
|
-
|
|
17
|
-
const initialState: Application = {
|
|
18
|
-
ID: '',
|
|
19
|
-
AppName: '',
|
|
20
|
-
DisplayName: '',
|
|
21
|
-
PlatformVersion: '',
|
|
22
|
-
AppVersion: '',
|
|
23
|
-
Description: '',
|
|
24
|
-
AppObjects: [],
|
|
25
|
-
AppScreens: [],
|
|
26
|
-
AppMenus: [],
|
|
27
|
-
AppConfigurations: [],
|
|
28
|
-
Plugins: [],
|
|
29
|
-
WorkFlows: []
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export const SchemaStore = signalStore(
|
|
33
|
-
{ providedIn: 'root' },
|
|
34
|
-
withState(initialState),
|
|
35
|
-
withMethods(
|
|
36
|
-
(store, appHelper = inject(AppHelper), idbService = inject(IdbService)) => ({
|
|
37
|
-
// To check Org info data exits or not in local storage
|
|
38
|
-
getSchemaInformation:async () => {
|
|
39
|
-
const schemaInformation = await idbService.getItem(StorageConstants.tabData)
|
|
40
|
-
if (schemaInformation) {
|
|
41
|
-
// Common.tabJson = JSON.parse(schemaInformation);
|
|
42
|
-
patchState(store, JSON.parse(schemaInformation));
|
|
43
|
-
} else {
|
|
44
|
-
appHelper.getSchema()?.subscribe({
|
|
45
|
-
next: (value: SchemaResponse) => {
|
|
46
|
-
patchState(store, JSON.parse(value.Result));
|
|
47
|
-
Common.tabJson = JSON.parse(value.Result);
|
|
48
|
-
idbService.setItem(StorageConstants.tabData, JSON.parse(value.Result))
|
|
49
|
-
},
|
|
50
|
-
error: (response: Error) => {
|
|
51
|
-
console.log(response)
|
|
52
|
-
}
|
|
53
|
-
})
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
})
|
|
57
|
-
),
|
|
58
|
-
);
|
|
59
|
-
// Not
|
|
60
|
-
async function manageAppObjectAndAppFieldList(responseData: any, localStorageService: any) {
|
|
61
|
-
if (!responseData) return; // If no response data, exit function
|
|
62
|
-
const schemaJSONVal = {
|
|
63
|
-
AppObjects: responseData.AppObjects.map(async (item: any) => ({
|
|
64
|
-
ID: item.ID,
|
|
65
|
-
SystemDBTableName: item.SystemDBTableName,
|
|
66
|
-
Fields: await getFields(item.Fields),
|
|
67
|
-
})),
|
|
68
|
-
};
|
|
69
|
-
localStorageService.setLocalStorage(
|
|
70
|
-
StorageConstants.schemaJSON,
|
|
71
|
-
JSON.stringify(schemaJSONVal)
|
|
72
|
-
);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Retrieves fields from the given fields array.
|
|
77
|
-
* @param fields The array of fields
|
|
78
|
-
* @returns Array of fields with ID and SystemDBFieldName
|
|
79
|
-
*/
|
|
80
|
-
async function getFields(fields: any) {
|
|
81
|
-
return fields.map(({ ID, SystemDBFieldName }: any) => ({
|
|
82
|
-
ID,
|
|
83
|
-
SystemDBFieldName,
|
|
84
|
-
}));
|
|
85
|
-
}
|
package/src/test-setup.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
// @ts-expect-error https://thymikee.github.io/jest-preset-angular/docs/getting-started/test-environment
|
|
2
|
-
globalThis.ngJest = {
|
|
3
|
-
testEnvironmentOptions: {
|
|
4
|
-
errorOnUnknownElements: true,
|
|
5
|
-
errorOnUnknownProperties: true,
|
|
6
|
-
},
|
|
7
|
-
};
|
|
8
|
-
import 'jest-preset-angular/setup-jest';
|
package/tsconfig.json
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "es2022",
|
|
4
|
-
"useDefineForClassFields": false,
|
|
5
|
-
"forceConsistentCasingInFileNames": true,
|
|
6
|
-
"strict": true,
|
|
7
|
-
"noImplicitOverride": true,
|
|
8
|
-
"noPropertyAccessFromIndexSignature": true,
|
|
9
|
-
"noImplicitReturns": true,
|
|
10
|
-
"noFallthroughCasesInSwitch": true
|
|
11
|
-
},
|
|
12
|
-
"files": [],
|
|
13
|
-
"include": [],
|
|
14
|
-
"references": [
|
|
15
|
-
{
|
|
16
|
-
"path": "./tsconfig.lib.json"
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"path": "./tsconfig.spec.json"
|
|
20
|
-
}
|
|
21
|
-
],
|
|
22
|
-
"extends": "../../tsconfig.base.json",
|
|
23
|
-
"angularCompilerOptions": {
|
|
24
|
-
"enableI18nLegacyMessageIdFormat": false,
|
|
25
|
-
"strictInjectionParameters": true,
|
|
26
|
-
"strictInputAccessModifiers": true,
|
|
27
|
-
"strictTemplates": true
|
|
28
|
-
}
|
|
29
|
-
}
|
package/tsconfig.lib.json
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "./tsconfig.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"outDir": "../../dist/out-tsc",
|
|
5
|
-
"declaration": true,
|
|
6
|
-
"declarationMap": true,
|
|
7
|
-
"inlineSources": true,
|
|
8
|
-
"types": []
|
|
9
|
-
},
|
|
10
|
-
"exclude": [
|
|
11
|
-
"src/**/*.spec.ts",
|
|
12
|
-
"src/test-setup.ts",
|
|
13
|
-
"jest.config.ts",
|
|
14
|
-
"src/**/*.test.ts"
|
|
15
|
-
],
|
|
16
|
-
"include": ["src/**/*.ts"]
|
|
17
|
-
}
|
package/tsconfig.lib.prod.json
DELETED
package/tsconfig.spec.json
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "./tsconfig.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"outDir": "../../dist/out-tsc",
|
|
5
|
-
"module": "commonjs",
|
|
6
|
-
"target": "es2016",
|
|
7
|
-
"types": ["jest", "node"]
|
|
8
|
-
},
|
|
9
|
-
"files": ["src/test-setup.ts"],
|
|
10
|
-
"include": [
|
|
11
|
-
"jest.config.ts",
|
|
12
|
-
"src/**/*.test.ts",
|
|
13
|
-
"src/**/*.spec.ts",
|
|
14
|
-
"src/**/*.d.ts"
|
|
15
|
-
]
|
|
16
|
-
}
|