mp-front-cli 0.0.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/README.md +1 -0
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +1 -0
- package/dist/core/rxSubjects/RxSubjectManager.d.ts +10 -0
- package/dist/core/rxSubjects/RxSubjectManager.d.ts.map +1 -0
- package/dist/core/rxSubjects/RxSubjectManager.js +19 -0
- package/dist/core/rxSubjects/subjectsManager.d.ts +4 -0
- package/dist/core/rxSubjects/subjectsManager.d.ts.map +1 -0
- package/dist/core/rxSubjects/subjectsManager.js +2 -0
- package/dist/core/services/ServiceToken.d.ts +13 -0
- package/dist/core/services/ServiceToken.d.ts.map +1 -0
- package/dist/core/services/ServiceToken.js +46 -0
- package/dist/core/utils/ApiMiddleware/index.d.ts +8 -0
- package/dist/core/utils/ApiMiddleware/index.d.ts.map +1 -0
- package/dist/core/utils/ApiMiddleware/index.js +27 -0
- package/dist/core/utils/CustomEncoder/index.d.ts +8 -0
- package/dist/core/utils/CustomEncoder/index.d.ts.map +1 -0
- package/dist/core/utils/CustomEncoder/index.js +32 -0
- package/dist/core/utils/CustomHeader/index.d.ts +232 -0
- package/dist/core/utils/CustomHeader/index.d.ts.map +1 -0
- package/dist/core/utils/CustomHeader/index.js +23 -0
- package/dist/core/utils/CustomLogger/index.d.ts +16 -0
- package/dist/core/utils/CustomLogger/index.d.ts.map +1 -0
- package/dist/core/utils/CustomLogger/index.js +63 -0
- package/dist/core/utils/CustomValidator/index.d.ts +7 -0
- package/dist/core/utils/CustomValidator/index.d.ts.map +1 -0
- package/dist/core/utils/CustomValidator/index.js +14 -0
- package/dist/core/utils/ErrorCatalog/index.d.ts +14 -0
- package/dist/core/utils/ErrorCatalog/index.d.ts.map +1 -0
- package/dist/core/utils/ErrorCatalog/index.js +122 -0
- package/dist/core/utils/MessageErrorBFF/index.d.ts +16 -0
- package/dist/core/utils/MessageErrorBFF/index.d.ts.map +1 -0
- package/dist/core/utils/MessageErrorBFF/index.js +21 -0
- package/dist/core/utils/apiRequest/FetchServiceBE.d.ts +14 -0
- package/dist/core/utils/apiRequest/FetchServiceBE.d.ts.map +1 -0
- package/dist/core/utils/apiRequest/FetchServiceBE.js +36 -0
- package/dist/core/utils/apiRequest/FetchServiceFE.d.ts +14 -0
- package/dist/core/utils/apiRequest/FetchServiceFE.d.ts.map +1 -0
- package/dist/core/utils/apiRequest/FetchServiceFE.js +38 -0
- package/dist/core/utils/index.d.ts +10 -0
- package/dist/core/utils/index.d.ts.map +1 -0
- package/dist/core/utils/index.js +9 -0
- package/dist/core/utils/interfaces/ApiResponse.d.ts +39 -0
- package/dist/core/utils/interfaces/ApiResponse.d.ts.map +1 -0
- package/dist/core/utils/interfaces/ApiResponse.js +1 -0
- package/dist/core/utils/interfaces/notifications.d.ts +14 -0
- package/dist/core/utils/interfaces/notifications.d.ts.map +1 -0
- package/dist/core/utils/interfaces/notifications.js +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/lang/common/errors/en_EN/index.d.ts +5 -0
- package/dist/lang/common/errors/en_EN/index.d.ts.map +1 -0
- package/dist/lang/common/errors/en_EN/index.js +4 -0
- package/dist/lang/common/errors/es_MX/index.d.ts +38 -0
- package/dist/lang/common/errors/es_MX/index.d.ts.map +1 -0
- package/dist/lang/common/errors/es_MX/index.js +37 -0
- package/dist/lang/common/errors/index.d.ts +3 -0
- package/dist/lang/common/errors/index.d.ts.map +1 -0
- package/dist/lang/common/errors/index.js +2 -0
- package/dist/lang/common/index.d.ts +2 -0
- package/dist/lang/common/index.d.ts.map +1 -0
- package/dist/lang/common/index.js +1 -0
- package/dist/lang/index.d.ts +3 -0
- package/dist/lang/index.d.ts.map +1 -0
- package/dist/lang/index.js +2 -0
- package/dist/lang/validator/en_EN/index.d.ts +5 -0
- package/dist/lang/validator/en_EN/index.d.ts.map +1 -0
- package/dist/lang/validator/en_EN/index.js +4 -0
- package/dist/lang/validator/es_MX/index.d.ts +41 -0
- package/dist/lang/validator/es_MX/index.d.ts.map +1 -0
- package/dist/lang/validator/es_MX/index.js +40 -0
- package/dist/lang/validator/index.d.ts +3 -0
- package/dist/lang/validator/index.d.ts.map +1 -0
- package/dist/lang/validator/index.js +2 -0
- package/package.json +31 -0
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# front-utils
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./utils";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Subject } from "rxjs";
|
|
2
|
+
declare class RxSubjectManager<T> {
|
|
3
|
+
private subject$;
|
|
4
|
+
getSubject(): import("rxjs").Observable<T>;
|
|
5
|
+
setSubject(data: T): void;
|
|
6
|
+
completeSubject(): void;
|
|
7
|
+
unsubscribeSubject(): Subject<T>;
|
|
8
|
+
}
|
|
9
|
+
export default RxSubjectManager;
|
|
10
|
+
//# sourceMappingURL=RxSubjectManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RxSubjectManager.d.ts","sourceRoot":"","sources":["../../../src/core/rxSubjects/RxSubjectManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAE/B,cAAM,gBAAgB,CAAC,CAAC;IACtB,OAAO,CAAC,QAAQ,CAAoB;IAEpC,UAAU;IAGV,UAAU,CAAC,IAAI,EAAE,CAAC;IAGlB,eAAe;IAGf,kBAAkB;CAKnB;AAED,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Subject } from "rxjs";
|
|
2
|
+
class RxSubjectManager {
|
|
3
|
+
subject$ = new Subject();
|
|
4
|
+
getSubject() {
|
|
5
|
+
return this.subject$.asObservable();
|
|
6
|
+
}
|
|
7
|
+
setSubject(data) {
|
|
8
|
+
this.subject$.next(data);
|
|
9
|
+
}
|
|
10
|
+
completeSubject() {
|
|
11
|
+
this.subject$.complete();
|
|
12
|
+
}
|
|
13
|
+
unsubscribeSubject() {
|
|
14
|
+
this.subject$.unsubscribe();
|
|
15
|
+
this.subject$ = new Subject();
|
|
16
|
+
return this.subject$;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export default RxSubjectManager;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subjectsManager.d.ts","sourceRoot":"","sources":["../../../src/core/rxSubjects/subjectsManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAElD,eAAO,MAAM,YAAY,oCAA2C,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CustomLogger } from "../utils/CustomLogger";
|
|
2
|
+
export declare class ServiceToken extends CustomLogger {
|
|
3
|
+
private API_AUTH_BACK_URL;
|
|
4
|
+
private API_AUTH_BACK_USERNAME_AUTH;
|
|
5
|
+
private API_AUTH_BACK_PASSWORD_AUTH;
|
|
6
|
+
private API_AUTH_BACK_USER;
|
|
7
|
+
private API_AUTH_BACK_SCOPE;
|
|
8
|
+
private API_AUTH_BACK_PASSWORD;
|
|
9
|
+
private headers;
|
|
10
|
+
constructor();
|
|
11
|
+
get(): import("rxjs").Observable<any>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=ServiceToken.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ServiceToken.d.ts","sourceRoot":"","sources":["../../../src/core/services/ServiceToken.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEpD,qBAAa,YAAa,SAAQ,YAAY;IAC5C,OAAO,CAAC,iBAAiB,CAAQ;IACjC,OAAO,CAAC,2BAA2B,CAAQ;IAC3C,OAAO,CAAC,2BAA2B,CAAQ;IAC3C,OAAO,CAAC,kBAAkB,CAAQ;IAClC,OAAO,CAAC,mBAAmB,CAAQ;IACnC,OAAO,CAAC,sBAAsB,CAAQ;IACtC,OAAO,CAAC,OAAO,CAAa;;IAqB5B,GAAG;CAsBJ"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { catchError, of, switchMap } from "rxjs";
|
|
2
|
+
import { fromFetch } from "rxjs/fetch";
|
|
3
|
+
import { CustomLogger } from "../utils/CustomLogger";
|
|
4
|
+
export class ServiceToken extends CustomLogger {
|
|
5
|
+
API_AUTH_BACK_URL;
|
|
6
|
+
API_AUTH_BACK_USERNAME_AUTH;
|
|
7
|
+
API_AUTH_BACK_PASSWORD_AUTH;
|
|
8
|
+
API_AUTH_BACK_USER;
|
|
9
|
+
API_AUTH_BACK_SCOPE;
|
|
10
|
+
API_AUTH_BACK_PASSWORD;
|
|
11
|
+
headers;
|
|
12
|
+
constructor() {
|
|
13
|
+
super();
|
|
14
|
+
this.API_AUTH_BACK_URL = process.env.API_AUTH_BACK_URL;
|
|
15
|
+
this.API_AUTH_BACK_USERNAME_AUTH = process.env.API_AUTH_BACK_USERNAME_AUTH;
|
|
16
|
+
this.API_AUTH_BACK_PASSWORD_AUTH = process.env.API_AUTH_BACK_PASSWORD_AUTH;
|
|
17
|
+
this.API_AUTH_BACK_USER = process.env.API_AUTH_BACK_USER;
|
|
18
|
+
this.API_AUTH_BACK_SCOPE = process.env.API_AUTH_BACK_SCOPE;
|
|
19
|
+
this.API_AUTH_BACK_PASSWORD = process.env.API_AUTH_BACK_PASSWORD;
|
|
20
|
+
const authString = `${this.API_AUTH_BACK_USERNAME_AUTH}:${this.API_AUTH_BACK_PASSWORD_AUTH}`;
|
|
21
|
+
const encodedAuthString = Buffer.from(authString).toString("base64");
|
|
22
|
+
this.headers = {
|
|
23
|
+
Accept: "application/json",
|
|
24
|
+
"Content-Type": "application/json;charset=UTF-8",
|
|
25
|
+
Authorization: `Basic ${encodedAuthString}`,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
get() {
|
|
29
|
+
this.logDebug("get ServiceToken");
|
|
30
|
+
return fromFetch(this.API_AUTH_BACK_URL, {
|
|
31
|
+
method: "POST",
|
|
32
|
+
headers: this.headers,
|
|
33
|
+
body: JSON.stringify({
|
|
34
|
+
user: this.API_AUTH_BACK_USER,
|
|
35
|
+
scope: this.API_AUTH_BACK_SCOPE,
|
|
36
|
+
password: this.API_AUTH_BACK_PASSWORD,
|
|
37
|
+
}),
|
|
38
|
+
}).pipe(switchMap((response) => response.json()), switchMap((data) => {
|
|
39
|
+
this.logDebug(`ServiceToken <URL>: \x1b[33m ${this.API_AUTH_BACK_URL} \x1b[37m <HEADERS>: \x1b[33m ${JSON.stringify(this.headers)} \x1b[37m <BODY>: \x1b[33m ${JSON.stringify(data)} \x1b[37m`);
|
|
40
|
+
return of(data?.data?.Token || "");
|
|
41
|
+
}), catchError((error) => {
|
|
42
|
+
this.logError(`ServiceToken ${error}`);
|
|
43
|
+
return of("");
|
|
44
|
+
}));
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Observable } from "rxjs";
|
|
2
|
+
import type { NextApiRequest, NextApiResponse } from "next";
|
|
3
|
+
import { ApiResponse } from "../interfaces/ApiResponse";
|
|
4
|
+
import { CustomValidator } from "../CustomValidator";
|
|
5
|
+
export declare class ApiMiddleware<TRes, TData> extends CustomValidator {
|
|
6
|
+
get(handle: (params: TData) => Observable<ApiResponse<TRes>>): (req: NextApiRequest, res: NextApiResponse) => void;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/utils/ApiMiddleware/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA6B,MAAM,MAAM,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,qBAAa,aAAa,CAAC,IAAI,EAAE,KAAK,CAAE,SAAQ,eAAe;IAE7D,GAAG,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,KAAK,KAAK,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,SAI7C,cAAc,OAAO,eAAe;CA6BpD"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { catchError, of, switchMap } from "rxjs";
|
|
2
|
+
import { ErrorHandler } from "@/core/rxSubjects/subjectsManager";
|
|
3
|
+
import { CustomValidator } from "../CustomValidator";
|
|
4
|
+
export class ApiMiddleware extends CustomValidator {
|
|
5
|
+
get(handle) {
|
|
6
|
+
this.logDebug("get ApiMiddleware");
|
|
7
|
+
return (req, res) => {
|
|
8
|
+
this.logDebug("return ApiMiddleware");
|
|
9
|
+
ErrorHandler.getSubject().subscribe({
|
|
10
|
+
next: (response) => {
|
|
11
|
+
this.logError(`ApiMiddleware ErrorHandler ${JSON.stringify(response)}`);
|
|
12
|
+
ErrorHandler.unsubscribeSubject();
|
|
13
|
+
return res.status(response.code ?? 520).json(response);
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
of(req).pipe(switchMap((req) => this.validateTokenFront(req)), switchMap((req) => of(this.decode(req.body))), switchMap((params) => handle(params)), catchError((error) => {
|
|
17
|
+
ErrorHandler.setSubject(error);
|
|
18
|
+
return of({});
|
|
19
|
+
})).subscribe({
|
|
20
|
+
next: (Resp) => {
|
|
21
|
+
ErrorHandler.unsubscribeSubject();
|
|
22
|
+
res.status(200).json(Resp);
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/utils/CustomEncoder/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE9C,qBAAa,aAAc,SAAQ,YAAY;IAE7C,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC;IAajB,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE;QAAE,MAAM,EAAE,MAAM,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE;CAiBjE"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { isString } from "lodash";
|
|
2
|
+
import { CustomLogger } from "../CustomLogger";
|
|
3
|
+
export class CustomEncoder extends CustomLogger {
|
|
4
|
+
encode(data) {
|
|
5
|
+
try {
|
|
6
|
+
this.logDebug("encode CustomEncoder", JSON.stringify(data));
|
|
7
|
+
const json = JSON.stringify(data);
|
|
8
|
+
const base64 = Buffer.from(json).toString("base64");
|
|
9
|
+
return JSON.stringify({ base64 });
|
|
10
|
+
}
|
|
11
|
+
catch (error) {
|
|
12
|
+
this.logError("error convert to base64");
|
|
13
|
+
}
|
|
14
|
+
return JSON.stringify(data);
|
|
15
|
+
}
|
|
16
|
+
decode(data) {
|
|
17
|
+
const { base64 } = data;
|
|
18
|
+
try {
|
|
19
|
+
this.logDebug("decode CustomEncoder", JSON.stringify(base64));
|
|
20
|
+
const regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
|
|
21
|
+
if (isString(base64) && regex.test(base64)) {
|
|
22
|
+
const json = Buffer.from(base64, "base64").toString();
|
|
23
|
+
const data = JSON.parse(json);
|
|
24
|
+
return data;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
this.logError("error convert to base64");
|
|
29
|
+
}
|
|
30
|
+
return base64;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
import { CustomValidator } from "../CustomValidator";
|
|
2
|
+
export declare class CustomHeader extends CustomValidator {
|
|
3
|
+
private headers;
|
|
4
|
+
constructor();
|
|
5
|
+
addTokenBackend(headers: HeadersInit): import("rxjs").Observable<{
|
|
6
|
+
Authorization: string;
|
|
7
|
+
length: number;
|
|
8
|
+
toString(): string;
|
|
9
|
+
toLocaleString(): string;
|
|
10
|
+
pop(): [string, string] | undefined;
|
|
11
|
+
push(...items: [string, string][]): number;
|
|
12
|
+
concat(...items: ConcatArray<[string, string]>[]): [string, string][];
|
|
13
|
+
concat(...items: ([string, string] | ConcatArray<[string, string]>)[]): [string, string][];
|
|
14
|
+
join(separator?: string | undefined): string;
|
|
15
|
+
reverse(): [string, string][];
|
|
16
|
+
shift(): [string, string] | undefined;
|
|
17
|
+
slice(start?: number | undefined, end?: number | undefined): [string, string][];
|
|
18
|
+
sort(compareFn?: ((a: [string, string], b: [string, string]) => number) | undefined): [string, string][];
|
|
19
|
+
splice(start: number, deleteCount?: number | undefined): [string, string][];
|
|
20
|
+
splice(start: number, deleteCount: number, ...items: [string, string][]): [string, string][];
|
|
21
|
+
unshift(...items: [string, string][]): number;
|
|
22
|
+
indexOf(searchElement: [string, string], fromIndex?: number | undefined): number;
|
|
23
|
+
lastIndexOf(searchElement: [string, string], fromIndex?: number | undefined): number;
|
|
24
|
+
every<S extends [string, string]>(predicate: (value: [string, string], index: number, array: [string, string][]) => value is S, thisArg?: any): this is S[];
|
|
25
|
+
every(predicate: (value: [string, string], index: number, array: [string, string][]) => unknown, thisArg?: any): boolean;
|
|
26
|
+
some(predicate: (value: [string, string], index: number, array: [string, string][]) => unknown, thisArg?: any): boolean;
|
|
27
|
+
forEach(callbackfn: (value: [string, string], index: number, array: [string, string][]) => void, thisArg?: any): void;
|
|
28
|
+
map<U>(callbackfn: (value: [string, string], index: number, array: [string, string][]) => U, thisArg?: any): U[];
|
|
29
|
+
filter<S_1 extends [string, string]>(predicate: (value: [string, string], index: number, array: [string, string][]) => value is S_1, thisArg?: any): S_1[];
|
|
30
|
+
filter(predicate: (value: [string, string], index: number, array: [string, string][]) => unknown, thisArg?: any): [string, string][];
|
|
31
|
+
reduce(callbackfn: (previousValue: [string, string], currentValue: [string, string], currentIndex: number, array: [string, string][]) => [string, string]): [string, string];
|
|
32
|
+
reduce(callbackfn: (previousValue: [string, string], currentValue: [string, string], currentIndex: number, array: [string, string][]) => [string, string], initialValue: [string, string]): [string, string];
|
|
33
|
+
reduce<U_1>(callbackfn: (previousValue: U_1, currentValue: [string, string], currentIndex: number, array: [string, string][]) => U_1, initialValue: U_1): U_1;
|
|
34
|
+
reduceRight(callbackfn: (previousValue: [string, string], currentValue: [string, string], currentIndex: number, array: [string, string][]) => [string, string]): [string, string];
|
|
35
|
+
reduceRight(callbackfn: (previousValue: [string, string], currentValue: [string, string], currentIndex: number, array: [string, string][]) => [string, string], initialValue: [string, string]): [string, string];
|
|
36
|
+
reduceRight<U_2>(callbackfn: (previousValue: U_2, currentValue: [string, string], currentIndex: number, array: [string, string][]) => U_2, initialValue: U_2): U_2;
|
|
37
|
+
find<S_2 extends [string, string]>(predicate: (value: [string, string], index: number, obj: [string, string][]) => value is S_2, thisArg?: any): S_2 | undefined;
|
|
38
|
+
find(predicate: (value: [string, string], index: number, obj: [string, string][]) => unknown, thisArg?: any): [string, string] | undefined;
|
|
39
|
+
findIndex(predicate: (value: [string, string], index: number, obj: [string, string][]) => unknown, thisArg?: any): number;
|
|
40
|
+
fill(value: [string, string], start?: number | undefined, end?: number | undefined): [string, string][];
|
|
41
|
+
copyWithin(target: number, start: number, end?: number | undefined): [string, string][];
|
|
42
|
+
entries(): IterableIterator<[number, [string, string]]>;
|
|
43
|
+
keys(): IterableIterator<number>;
|
|
44
|
+
values(): IterableIterator<[string, string]>;
|
|
45
|
+
includes(searchElement: [string, string], fromIndex?: number | undefined): boolean;
|
|
46
|
+
flatMap<U_3, This = undefined>(callback: (this: This, value: [string, string], index: number, array: [string, string][]) => U_3 | readonly U_3[], thisArg?: This | undefined): U_3[];
|
|
47
|
+
flat<A, D extends number = 1>(this: A, depth?: D | undefined): FlatArray<A, D>[];
|
|
48
|
+
at(index: number): [string, string] | undefined;
|
|
49
|
+
findLast<S_3 extends [string, string]>(predicate: (value: [string, string], index: number, array: [string, string][]) => value is S_3, thisArg?: any): S_3 | undefined;
|
|
50
|
+
findLast(predicate: (value: [string, string], index: number, array: [string, string][]) => unknown, thisArg?: any): [string, string] | undefined;
|
|
51
|
+
findLastIndex(predicate: (value: [string, string], index: number, array: [string, string][]) => unknown, thisArg?: any): number;
|
|
52
|
+
toReversed(): [string, string][];
|
|
53
|
+
toSorted(compareFn?: ((a: [string, string], b: [string, string]) => number) | undefined): [string, string][];
|
|
54
|
+
toSpliced(start: number, deleteCount: number, ...items: [string, string][]): [string, string][];
|
|
55
|
+
toSpliced(start: number, deleteCount?: number | undefined): [string, string][];
|
|
56
|
+
with(index: number, value: [string, string]): [string, string][];
|
|
57
|
+
[Symbol.iterator](): IterableIterator<[string, string]>;
|
|
58
|
+
[Symbol.unscopables]: {
|
|
59
|
+
[x: number]: boolean | undefined;
|
|
60
|
+
length?: boolean | undefined;
|
|
61
|
+
toString?: boolean | undefined;
|
|
62
|
+
toLocaleString?: boolean | undefined;
|
|
63
|
+
pop?: boolean | undefined;
|
|
64
|
+
push?: boolean | undefined;
|
|
65
|
+
concat?: boolean | undefined;
|
|
66
|
+
join?: boolean | undefined;
|
|
67
|
+
reverse?: boolean | undefined;
|
|
68
|
+
shift?: boolean | undefined;
|
|
69
|
+
slice?: boolean | undefined;
|
|
70
|
+
sort?: boolean | undefined;
|
|
71
|
+
splice?: boolean | undefined;
|
|
72
|
+
unshift?: boolean | undefined;
|
|
73
|
+
indexOf?: boolean | undefined;
|
|
74
|
+
lastIndexOf?: boolean | undefined;
|
|
75
|
+
every?: boolean | undefined;
|
|
76
|
+
some?: boolean | undefined;
|
|
77
|
+
forEach?: boolean | undefined;
|
|
78
|
+
map?: boolean | undefined;
|
|
79
|
+
filter?: boolean | undefined;
|
|
80
|
+
reduce?: boolean | undefined;
|
|
81
|
+
reduceRight?: boolean | undefined;
|
|
82
|
+
find?: boolean | undefined;
|
|
83
|
+
findIndex?: boolean | undefined;
|
|
84
|
+
fill?: boolean | undefined;
|
|
85
|
+
copyWithin?: boolean | undefined;
|
|
86
|
+
entries?: boolean | undefined;
|
|
87
|
+
keys?: boolean | undefined;
|
|
88
|
+
values?: boolean | undefined;
|
|
89
|
+
includes?: boolean | undefined;
|
|
90
|
+
flatMap?: boolean | undefined;
|
|
91
|
+
flat?: boolean | undefined;
|
|
92
|
+
at?: boolean | undefined;
|
|
93
|
+
findLast?: boolean | undefined;
|
|
94
|
+
findLastIndex?: boolean | undefined;
|
|
95
|
+
toReversed?: boolean | undefined;
|
|
96
|
+
toSorted?: boolean | undefined;
|
|
97
|
+
toSpliced?: boolean | undefined;
|
|
98
|
+
with?: boolean | undefined;
|
|
99
|
+
[Symbol.iterator]?: boolean | undefined;
|
|
100
|
+
readonly [Symbol.unscopables]?: boolean | undefined;
|
|
101
|
+
};
|
|
102
|
+
} | {
|
|
103
|
+
Authorization: string;
|
|
104
|
+
} | {
|
|
105
|
+
Authorization: string;
|
|
106
|
+
append(name: string, value: string): void;
|
|
107
|
+
delete(name: string): void;
|
|
108
|
+
get(name: string): string | null;
|
|
109
|
+
getSetCookie(): string[];
|
|
110
|
+
has(name: string): boolean;
|
|
111
|
+
set(name: string, value: string): void;
|
|
112
|
+
forEach(callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any): void;
|
|
113
|
+
entries(): IterableIterator<[string, string]>;
|
|
114
|
+
keys(): IterableIterator<string>;
|
|
115
|
+
values(): IterableIterator<string>;
|
|
116
|
+
[Symbol.iterator](): IterableIterator<[string, string]>;
|
|
117
|
+
}>;
|
|
118
|
+
getHeaders(): import("rxjs").Observable<{
|
|
119
|
+
Authorization: string;
|
|
120
|
+
length: number;
|
|
121
|
+
toString(): string;
|
|
122
|
+
toLocaleString(): string;
|
|
123
|
+
pop(): [string, string] | undefined;
|
|
124
|
+
push(...items: [string, string][]): number;
|
|
125
|
+
concat(...items: ConcatArray<[string, string]>[]): [string, string][];
|
|
126
|
+
concat(...items: ([string, string] | ConcatArray<[string, string]>)[]): [string, string][];
|
|
127
|
+
join(separator?: string | undefined): string;
|
|
128
|
+
reverse(): [string, string][];
|
|
129
|
+
shift(): [string, string] | undefined;
|
|
130
|
+
slice(start?: number | undefined, end?: number | undefined): [string, string][];
|
|
131
|
+
sort(compareFn?: ((a: [string, string], b: [string, string]) => number) | undefined): [string, string][];
|
|
132
|
+
splice(start: number, deleteCount?: number | undefined): [string, string][];
|
|
133
|
+
splice(start: number, deleteCount: number, ...items: [string, string][]): [string, string][];
|
|
134
|
+
unshift(...items: [string, string][]): number;
|
|
135
|
+
indexOf(searchElement: [string, string], fromIndex?: number | undefined): number;
|
|
136
|
+
lastIndexOf(searchElement: [string, string], fromIndex?: number | undefined): number;
|
|
137
|
+
every<S extends [string, string]>(predicate: (value: [string, string], index: number, array: [string, string][]) => value is S, thisArg?: any): this is S[];
|
|
138
|
+
every(predicate: (value: [string, string], index: number, array: [string, string][]) => unknown, thisArg?: any): boolean;
|
|
139
|
+
some(predicate: (value: [string, string], index: number, array: [string, string][]) => unknown, thisArg?: any): boolean;
|
|
140
|
+
forEach(callbackfn: (value: [string, string], index: number, array: [string, string][]) => void, thisArg?: any): void;
|
|
141
|
+
map<U>(callbackfn: (value: [string, string], index: number, array: [string, string][]) => U, thisArg?: any): U[];
|
|
142
|
+
filter<S_1 extends [string, string]>(predicate: (value: [string, string], index: number, array: [string, string][]) => value is S_1, thisArg?: any): S_1[];
|
|
143
|
+
filter(predicate: (value: [string, string], index: number, array: [string, string][]) => unknown, thisArg?: any): [string, string][];
|
|
144
|
+
reduce(callbackfn: (previousValue: [string, string], currentValue: [string, string], currentIndex: number, array: [string, string][]) => [string, string]): [string, string];
|
|
145
|
+
reduce(callbackfn: (previousValue: [string, string], currentValue: [string, string], currentIndex: number, array: [string, string][]) => [string, string], initialValue: [string, string]): [string, string];
|
|
146
|
+
reduce<U_1>(callbackfn: (previousValue: U_1, currentValue: [string, string], currentIndex: number, array: [string, string][]) => U_1, initialValue: U_1): U_1;
|
|
147
|
+
reduceRight(callbackfn: (previousValue: [string, string], currentValue: [string, string], currentIndex: number, array: [string, string][]) => [string, string]): [string, string];
|
|
148
|
+
reduceRight(callbackfn: (previousValue: [string, string], currentValue: [string, string], currentIndex: number, array: [string, string][]) => [string, string], initialValue: [string, string]): [string, string];
|
|
149
|
+
reduceRight<U_2>(callbackfn: (previousValue: U_2, currentValue: [string, string], currentIndex: number, array: [string, string][]) => U_2, initialValue: U_2): U_2;
|
|
150
|
+
find<S_2 extends [string, string]>(predicate: (value: [string, string], index: number, obj: [string, string][]) => value is S_2, thisArg?: any): S_2 | undefined;
|
|
151
|
+
find(predicate: (value: [string, string], index: number, obj: [string, string][]) => unknown, thisArg?: any): [string, string] | undefined;
|
|
152
|
+
findIndex(predicate: (value: [string, string], index: number, obj: [string, string][]) => unknown, thisArg?: any): number;
|
|
153
|
+
fill(value: [string, string], start?: number | undefined, end?: number | undefined): [string, string][];
|
|
154
|
+
copyWithin(target: number, start: number, end?: number | undefined): [string, string][];
|
|
155
|
+
entries(): IterableIterator<[number, [string, string]]>;
|
|
156
|
+
keys(): IterableIterator<number>;
|
|
157
|
+
values(): IterableIterator<[string, string]>;
|
|
158
|
+
includes(searchElement: [string, string], fromIndex?: number | undefined): boolean;
|
|
159
|
+
flatMap<U_3, This = undefined>(callback: (this: This, value: [string, string], index: number, array: [string, string][]) => U_3 | readonly U_3[], thisArg?: This | undefined): U_3[];
|
|
160
|
+
flat<A, D extends number = 1>(this: A, depth?: D | undefined): FlatArray<A, D>[];
|
|
161
|
+
at(index: number): [string, string] | undefined;
|
|
162
|
+
findLast<S_3 extends [string, string]>(predicate: (value: [string, string], index: number, array: [string, string][]) => value is S_3, thisArg?: any): S_3 | undefined;
|
|
163
|
+
findLast(predicate: (value: [string, string], index: number, array: [string, string][]) => unknown, thisArg?: any): [string, string] | undefined;
|
|
164
|
+
findLastIndex(predicate: (value: [string, string], index: number, array: [string, string][]) => unknown, thisArg?: any): number;
|
|
165
|
+
toReversed(): [string, string][];
|
|
166
|
+
toSorted(compareFn?: ((a: [string, string], b: [string, string]) => number) | undefined): [string, string][];
|
|
167
|
+
toSpliced(start: number, deleteCount: number, ...items: [string, string][]): [string, string][];
|
|
168
|
+
toSpliced(start: number, deleteCount?: number | undefined): [string, string][];
|
|
169
|
+
with(index: number, value: [string, string]): [string, string][];
|
|
170
|
+
[Symbol.iterator](): IterableIterator<[string, string]>;
|
|
171
|
+
[Symbol.unscopables]: {
|
|
172
|
+
[x: number]: boolean | undefined;
|
|
173
|
+
length?: boolean | undefined;
|
|
174
|
+
toString?: boolean | undefined;
|
|
175
|
+
toLocaleString?: boolean | undefined;
|
|
176
|
+
pop?: boolean | undefined;
|
|
177
|
+
push?: boolean | undefined;
|
|
178
|
+
concat?: boolean | undefined;
|
|
179
|
+
join?: boolean | undefined;
|
|
180
|
+
reverse?: boolean | undefined;
|
|
181
|
+
shift?: boolean | undefined;
|
|
182
|
+
slice?: boolean | undefined;
|
|
183
|
+
sort?: boolean | undefined;
|
|
184
|
+
splice?: boolean | undefined;
|
|
185
|
+
unshift?: boolean | undefined;
|
|
186
|
+
indexOf?: boolean | undefined;
|
|
187
|
+
lastIndexOf?: boolean | undefined;
|
|
188
|
+
every?: boolean | undefined;
|
|
189
|
+
some?: boolean | undefined;
|
|
190
|
+
forEach?: boolean | undefined;
|
|
191
|
+
map?: boolean | undefined;
|
|
192
|
+
filter?: boolean | undefined;
|
|
193
|
+
reduce?: boolean | undefined;
|
|
194
|
+
reduceRight?: boolean | undefined;
|
|
195
|
+
find?: boolean | undefined;
|
|
196
|
+
findIndex?: boolean | undefined;
|
|
197
|
+
fill?: boolean | undefined;
|
|
198
|
+
copyWithin?: boolean | undefined;
|
|
199
|
+
entries?: boolean | undefined;
|
|
200
|
+
keys?: boolean | undefined;
|
|
201
|
+
values?: boolean | undefined;
|
|
202
|
+
includes?: boolean | undefined;
|
|
203
|
+
flatMap?: boolean | undefined;
|
|
204
|
+
flat?: boolean | undefined;
|
|
205
|
+
at?: boolean | undefined;
|
|
206
|
+
findLast?: boolean | undefined;
|
|
207
|
+
findLastIndex?: boolean | undefined;
|
|
208
|
+
toReversed?: boolean | undefined;
|
|
209
|
+
toSorted?: boolean | undefined;
|
|
210
|
+
toSpliced?: boolean | undefined;
|
|
211
|
+
with?: boolean | undefined;
|
|
212
|
+
[Symbol.iterator]?: boolean | undefined;
|
|
213
|
+
readonly [Symbol.unscopables]?: boolean | undefined;
|
|
214
|
+
};
|
|
215
|
+
} | {
|
|
216
|
+
Authorization: string;
|
|
217
|
+
} | {
|
|
218
|
+
Authorization: string;
|
|
219
|
+
append(name: string, value: string): void;
|
|
220
|
+
delete(name: string): void;
|
|
221
|
+
get(name: string): string | null;
|
|
222
|
+
getSetCookie(): string[];
|
|
223
|
+
has(name: string): boolean;
|
|
224
|
+
set(name: string, value: string): void;
|
|
225
|
+
forEach(callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any): void;
|
|
226
|
+
entries(): IterableIterator<[string, string]>;
|
|
227
|
+
keys(): IterableIterator<string>;
|
|
228
|
+
values(): IterableIterator<string>;
|
|
229
|
+
[Symbol.iterator](): IterableIterator<[string, string]>;
|
|
230
|
+
}>;
|
|
231
|
+
}
|
|
232
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/utils/CustomHeader/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAEpD,qBAAa,YAAa,SAAQ,eAAe;IAC/C,OAAO,CAAC,OAAO,CAAa;;IAU5B,eAAe,CAAC,OAAO,EAAE,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAOpC,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQX"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { of, switchMap } from "rxjs";
|
|
2
|
+
import { ServiceToken } from "@/core/services/ServiceToken";
|
|
3
|
+
import { CustomValidator } from "../CustomValidator";
|
|
4
|
+
export class CustomHeader extends CustomValidator {
|
|
5
|
+
headers;
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
this.headers = {
|
|
9
|
+
Accept: "application/json",
|
|
10
|
+
"Content-Type": "application/json",
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
addTokenBackend(headers) {
|
|
14
|
+
this.logDebug("addTokenBackend CustomHeader", JSON.stringify(headers));
|
|
15
|
+
return new ServiceToken().get().pipe(switchMap((token) => of({ ...headers, Authorization: `Bearer ${token}` })));
|
|
16
|
+
}
|
|
17
|
+
getHeaders() {
|
|
18
|
+
this.logDebug("getHeaders CustomHeader");
|
|
19
|
+
return of({
|
|
20
|
+
...this.headers
|
|
21
|
+
}).pipe(switchMap((headers) => this.addTokenBackend(headers)));
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare class CustomLogger {
|
|
2
|
+
private appName;
|
|
3
|
+
private logsLevel;
|
|
4
|
+
private silentLogs;
|
|
5
|
+
constructor();
|
|
6
|
+
private consoleFormat;
|
|
7
|
+
private log;
|
|
8
|
+
logError(...message: string[]): void;
|
|
9
|
+
logWarn(...message: string[]): void;
|
|
10
|
+
logInfo(...message: string[]): void;
|
|
11
|
+
logHttp(...message: string[]): void;
|
|
12
|
+
logVerbose(...message: string[]): void;
|
|
13
|
+
logDebug(...message: string[]): void;
|
|
14
|
+
logSilly(...message: string[]): void;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/utils/CustomLogger/index.ts"],"names":[],"mappings":"AAoBA,qBAAa,YAAY;IACvB,OAAO,CAAC,OAAO,CAAQ;IACvB,OAAO,CAAC,SAAS,CAAQ;IACzB,OAAO,CAAC,UAAU,CAAS;;IAQ3B,OAAO,CAAC,aAAa;IAQrB,OAAO,CAAC,GAAG;IAMX,QAAQ,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI;IAIpC,OAAO,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI;IAInC,OAAO,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI;IAInC,OAAO,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI;IAInC,UAAU,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI;IAItC,QAAQ,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI;IAIpC,QAAQ,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI;CAGrC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
var Level;
|
|
2
|
+
(function (Level) {
|
|
3
|
+
Level[Level["error"] = 0] = "error";
|
|
4
|
+
Level[Level["warn"] = 1] = "warn";
|
|
5
|
+
Level[Level["info"] = 2] = "info";
|
|
6
|
+
Level[Level["http"] = 3] = "http";
|
|
7
|
+
Level[Level["verbose"] = 4] = "verbose";
|
|
8
|
+
Level[Level["debug"] = 5] = "debug";
|
|
9
|
+
Level[Level["silly"] = 6] = "silly";
|
|
10
|
+
})(Level || (Level = {}));
|
|
11
|
+
const colors = {
|
|
12
|
+
error: "\x1b[31m",
|
|
13
|
+
warn: "\x1b[33m",
|
|
14
|
+
info: "\x1b[34m",
|
|
15
|
+
http: "\x1b[35m",
|
|
16
|
+
verbose: "\x1b[32m",
|
|
17
|
+
debug: "\x1b[37m",
|
|
18
|
+
silly: "\x1b[37m",
|
|
19
|
+
};
|
|
20
|
+
export class CustomLogger {
|
|
21
|
+
appName;
|
|
22
|
+
logsLevel;
|
|
23
|
+
silentLogs;
|
|
24
|
+
constructor() {
|
|
25
|
+
this.appName = process.env.APP_LOGS_NAME;
|
|
26
|
+
this.logsLevel = process.env.LOGS_LEVEL;
|
|
27
|
+
this.silentLogs = process.env.SILENT_LOGS === "true";
|
|
28
|
+
}
|
|
29
|
+
consoleFormat(level, message) {
|
|
30
|
+
try {
|
|
31
|
+
return `${colors[level]} ${this.appName} [${new Date().toISOString()}] [${level.toUpperCase()}]: ${message.toString()} \x1b[37m`;
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
return message;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
log(level, message) {
|
|
38
|
+
if (level <= Level[this.logsLevel] && !this.silentLogs) {
|
|
39
|
+
console.log(this.consoleFormat(Level[level], message));
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
logError(...message) {
|
|
43
|
+
this.log(Level.error, message);
|
|
44
|
+
}
|
|
45
|
+
logWarn(...message) {
|
|
46
|
+
this.log(Level.warn, message);
|
|
47
|
+
}
|
|
48
|
+
logInfo(...message) {
|
|
49
|
+
this.log(Level.info, message);
|
|
50
|
+
}
|
|
51
|
+
logHttp(...message) {
|
|
52
|
+
this.log(Level.http, message);
|
|
53
|
+
}
|
|
54
|
+
logVerbose(...message) {
|
|
55
|
+
this.log(Level.verbose, message);
|
|
56
|
+
}
|
|
57
|
+
logDebug(...message) {
|
|
58
|
+
this.log(Level.debug, message);
|
|
59
|
+
}
|
|
60
|
+
logSilly(...message) {
|
|
61
|
+
this.log(Level.silly, message);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { NextApiRequest } from "next";
|
|
2
|
+
import type { NextRequest } from "next/server";
|
|
3
|
+
import { CustomEncoder } from "../CustomEncoder";
|
|
4
|
+
export declare class CustomValidator extends CustomEncoder {
|
|
5
|
+
validateTokenFront(req: NextApiRequest | NextRequest): Promise<NextApiRequest | NextRequest>;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/utils/CustomValidator/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,MAAM,CAAA;AAE1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAE9C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAEhD,qBAAa,eAAgB,SAAQ,aAAa;IAE1C,kBAAkB,CAAC,GAAG,EAAE,cAAc,GAAG,WAAW;CAU3D"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { getToken } from "next-auth/jwt";
|
|
2
|
+
import MessageErrorBFF from "../MessageErrorBFF";
|
|
3
|
+
import { CustomEncoder } from "../CustomEncoder";
|
|
4
|
+
export class CustomValidator extends CustomEncoder {
|
|
5
|
+
async validateTokenFront(req) {
|
|
6
|
+
this.logDebug("entra validate Token Front");
|
|
7
|
+
const token = await getToken({ req: req });
|
|
8
|
+
this.logDebug("Token Front", JSON.stringify(token));
|
|
9
|
+
if (!token) {
|
|
10
|
+
throw new MessageErrorBFF("UNAUTHORIZED").get();
|
|
11
|
+
}
|
|
12
|
+
return req;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ApiError } from "../interfaces/ApiResponse";
|
|
2
|
+
import { CustomLogger } from "../CustomLogger";
|
|
3
|
+
export declare class ErrorCatalog extends CustomLogger {
|
|
4
|
+
get(error?: string | Error | ApiError): {
|
|
5
|
+
title: string;
|
|
6
|
+
message: string;
|
|
7
|
+
code?: number | undefined;
|
|
8
|
+
type: "modal" | "message";
|
|
9
|
+
level: "error" | "success" | "warning" | "info" | "confirm";
|
|
10
|
+
payload?: {} | undefined;
|
|
11
|
+
clearCookieSession?: boolean | undefined;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/utils/ErrorCatalog/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AA0G9C,qBAAa,YAAa,SAAQ,YAAY;IAC5C,GAAG,CAAC,KAAK,GAAE,MAAM,GAAG,KAAK,GAAG,QAAoB;;;;;;;;;CAqBjD"}
|