@acontplus/ng-infrastructure 1.0.2 → 1.0.3
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/README.md +60 -6
- package/fesm2022/acontplus-ng-infrastructure.mjs +130 -92
- package/fesm2022/acontplus-ng-infrastructure.mjs.map +1 -1
- package/index.d.ts +18 -14
- package/package.json +8 -8
package/index.d.ts
CHANGED
|
@@ -54,7 +54,7 @@ interface HttpErrorLog extends HttpRequestLog {
|
|
|
54
54
|
status: number;
|
|
55
55
|
statusText: string;
|
|
56
56
|
message: string;
|
|
57
|
-
errorDetails:
|
|
57
|
+
errorDetails: unknown;
|
|
58
58
|
environment: string;
|
|
59
59
|
}
|
|
60
60
|
declare function createHttpContextConfig(overrides?: Partial<HttpContextConfig>): HttpContextConfig;
|
|
@@ -73,8 +73,8 @@ declare function withoutSpinner(): HttpContext;
|
|
|
73
73
|
*/
|
|
74
74
|
declare class ActiveRequestsTracker {
|
|
75
75
|
get count(): number;
|
|
76
|
-
add(request: HttpRequest<
|
|
77
|
-
remove(request: HttpRequest<
|
|
76
|
+
add(request: HttpRequest<unknown>): void;
|
|
77
|
+
remove(request: HttpRequest<unknown>): void;
|
|
78
78
|
static ɵfac: i0.ɵɵFactoryDeclaration<ActiveRequestsTracker, never>;
|
|
79
79
|
static ɵprov: i0.ɵɵInjectableDeclaration<ActiveRequestsTracker>;
|
|
80
80
|
}
|
|
@@ -103,10 +103,10 @@ declare abstract class BaseHttpRepository {
|
|
|
103
103
|
protected http: HttpClient;
|
|
104
104
|
protected abstract config: RepositoryConfig;
|
|
105
105
|
protected buildUrl(path?: string): string;
|
|
106
|
-
protected get<T>(path?: string, params?:
|
|
107
|
-
protected post<T>(path: string | undefined, body:
|
|
108
|
-
protected put<T>(path: string | undefined, body:
|
|
109
|
-
protected patch<T>(path
|
|
106
|
+
protected get<T>(path?: string, params?: Record<string, string | number | boolean>): Observable<T>;
|
|
107
|
+
protected post<T>(path: string | undefined, body: unknown): Observable<T>;
|
|
108
|
+
protected put<T>(path: string | undefined, body: unknown): Observable<T>;
|
|
109
|
+
protected patch<T>(path?: string, body?: unknown): Observable<T>;
|
|
110
110
|
protected delete<T>(path?: string): Observable<T>;
|
|
111
111
|
static ɵfac: i0.ɵɵFactoryDeclaration<BaseHttpRepository, never>;
|
|
112
112
|
static ɵprov: i0.ɵɵInjectableDeclaration<BaseHttpRepository>;
|
|
@@ -141,6 +141,10 @@ declare class RepositoryFactory {
|
|
|
141
141
|
declare class UserRepository {
|
|
142
142
|
private readonly tokenProvider;
|
|
143
143
|
getCurrentUser(): UserData | null;
|
|
144
|
+
/**
|
|
145
|
+
* Extract array field from decoded token, trying multiple possible field names
|
|
146
|
+
*/
|
|
147
|
+
private extractArrayField;
|
|
144
148
|
static ɵfac: i0.ɵɵFactoryDeclaration<UserRepository, never>;
|
|
145
149
|
static ɵprov: i0.ɵɵInjectableDeclaration<UserRepository>;
|
|
146
150
|
}
|
|
@@ -154,9 +158,9 @@ declare class AngularHttpAdapter implements HttpPort {
|
|
|
154
158
|
/** GET */
|
|
155
159
|
get<T>(url: string, options?: HttpOptions): Promise<T>;
|
|
156
160
|
/** POST */
|
|
157
|
-
post<T>(url: string, data?:
|
|
161
|
+
post<T>(url: string, data?: unknown, options?: HttpOptions): Promise<T>;
|
|
158
162
|
/** PUT */
|
|
159
|
-
put<T>(url: string, data?:
|
|
163
|
+
put<T>(url: string, data?: unknown, options?: HttpOptions): Promise<T>;
|
|
160
164
|
/** DELETE */
|
|
161
165
|
delete<T>(url: string, options?: HttpOptions): Promise<T>;
|
|
162
166
|
}
|
|
@@ -248,10 +252,10 @@ declare class CorrelationService {
|
|
|
248
252
|
|
|
249
253
|
declare class LoggingService {
|
|
250
254
|
private environment;
|
|
251
|
-
log(level: 'info' | 'warn' | 'error', message: string, context?:
|
|
252
|
-
info(message: string, context?:
|
|
253
|
-
warn(message: string, context?:
|
|
254
|
-
error(message: string, context?:
|
|
255
|
+
log(level: 'info' | 'warn' | 'error', message: string, context?: unknown): void;
|
|
256
|
+
info(message: string, context?: unknown): void;
|
|
257
|
+
warn(message: string, context?: unknown): void;
|
|
258
|
+
error(message: string, context?: unknown): void;
|
|
255
259
|
logHttpRequest(log: HttpRequestLog): void;
|
|
256
260
|
logHttpError(error: HttpErrorLog): void;
|
|
257
261
|
logNetworkError(correlationId: string): void;
|
|
@@ -269,7 +273,7 @@ declare abstract class BaseUseCase<TRequest = void, TResponse = void> implements
|
|
|
269
273
|
}
|
|
270
274
|
|
|
271
275
|
declare abstract class Command<TRequest, TResponse = void> extends BaseUseCase<TRequest, TResponse> {
|
|
272
|
-
protected validate(
|
|
276
|
+
protected validate(_request: TRequest): string[];
|
|
273
277
|
execute(request: TRequest): Observable<TResponse>;
|
|
274
278
|
protected abstract executeInternal(request: TRequest): Observable<TResponse>;
|
|
275
279
|
}
|
package/package.json
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acontplus/ng-infrastructure",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Acontplus Angular Infrastructure library for managing HTTP interceptors and repositories.",
|
|
5
|
-
"dependencies": {
|
|
6
|
-
"tslib": "^2.3.0"
|
|
7
|
-
},
|
|
8
5
|
"peerDependencies": {
|
|
9
|
-
"@acontplus/core": "^1.0.
|
|
10
|
-
"@acontplus/ng-config": "^1.0.
|
|
11
|
-
"@acontplus/ng-notifications": "^1.0.
|
|
12
|
-
"@acontplus/ng-components": "^1.0.
|
|
6
|
+
"@acontplus/core": "^1.0.15",
|
|
7
|
+
"@acontplus/ng-config": "^1.0.3",
|
|
8
|
+
"@acontplus/ng-notifications": "^1.0.8",
|
|
9
|
+
"@acontplus/ng-components": "^1.0.12",
|
|
13
10
|
"@angular/common": "^20.3.2",
|
|
14
11
|
"@angular/core": "^20.3.2"
|
|
15
12
|
},
|
|
@@ -63,5 +60,8 @@
|
|
|
63
60
|
"types": "./index.d.ts",
|
|
64
61
|
"default": "./fesm2022/acontplus-ng-infrastructure.mjs"
|
|
65
62
|
}
|
|
63
|
+
},
|
|
64
|
+
"dependencies": {
|
|
65
|
+
"tslib": "^2.3.0"
|
|
66
66
|
}
|
|
67
67
|
}
|