katanakit-js 6.4.3 → 6.7.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 +4 -3
- package/dist/adapters/express/server.d.ts +133 -1
- package/dist/adapters/express/server.d.ts.map +1 -1
- package/dist/adapters/express/server.js +199 -97
- package/dist/adapters/express/server.js.map +1 -1
- package/dist/adapters/insforge/insforge.service.d.ts +139 -4
- package/dist/adapters/insforge/insforge.service.d.ts.map +1 -1
- package/dist/adapters/insforge/insforge.service.js +383 -213
- package/dist/adapters/insforge/insforge.service.js.map +1 -1
- package/dist/adapters/notion/notion.service.d.ts +130 -144
- package/dist/adapters/notion/notion.service.d.ts.map +1 -1
- package/dist/adapters/notion/notion.service.js +330 -341
- package/dist/adapters/notion/notion.service.js.map +1 -1
- package/dist/adapters/telegram/telegram.service.d.ts +82 -13
- package/dist/adapters/telegram/telegram.service.d.ts.map +1 -1
- package/dist/adapters/telegram/telegram.service.js +133 -55
- package/dist/adapters/telegram/telegram.service.js.map +1 -1
- package/dist/adapters/wordpress/wordpress.service.d.ts +181 -110
- package/dist/adapters/wordpress/wordpress.service.d.ts.map +1 -1
- package/dist/adapters/wordpress/wordpress.service.js +556 -465
- package/dist/adapters/wordpress/wordpress.service.js.map +1 -1
- package/dist/core/services/access.service.d.ts +167 -4
- package/dist/core/services/access.service.d.ts.map +1 -1
- package/dist/core/services/access.service.js +241 -31
- package/dist/core/services/access.service.js.map +1 -1
- package/dist/core/services/agent.service.d.ts +182 -27
- package/dist/core/services/agent.service.d.ts.map +1 -1
- package/dist/core/services/agent.service.js +296 -164
- package/dist/core/services/agent.service.js.map +1 -1
- package/dist/core/services/assistant.service.d.ts +96 -5
- package/dist/core/services/assistant.service.d.ts.map +1 -1
- package/dist/core/services/assistant.service.js +171 -66
- package/dist/core/services/assistant.service.js.map +1 -1
- package/dist/core/services/dates.service.d.ts +183 -11
- package/dist/core/services/dates.service.d.ts.map +1 -1
- package/dist/core/services/dates.service.js +256 -57
- package/dist/core/services/dates.service.js.map +1 -1
- package/dist/core/services/http.service.d.ts +172 -133
- package/dist/core/services/http.service.d.ts.map +1 -1
- package/dist/core/services/http.service.js +381 -310
- package/dist/core/services/http.service.js.map +1 -1
- package/dist/core/services/logger.service.d.ts +96 -34
- package/dist/core/services/logger.service.d.ts.map +1 -1
- package/dist/core/services/logger.service.js +128 -41
- package/dist/core/services/logger.service.js.map +1 -1
- package/dist/core/services/query.service.d.ts +101 -0
- package/dist/core/services/query.service.d.ts.map +1 -1
- package/dist/core/services/query.service.js +131 -14
- package/dist/core/services/query.service.js.map +1 -1
- package/dist/core/services/utils.service.d.ts +286 -131
- package/dist/core/services/utils.service.d.ts.map +1 -1
- package/dist/core/services/utils.service.js +417 -227
- package/dist/core/services/utils.service.js.map +1 -1
- package/dist/core/services/validation.service.d.ts +48 -3
- package/dist/core/services/validation.service.d.ts.map +1 -1
- package/dist/core/services/validation.service.js +75 -23
- package/dist/core/services/validation.service.js.map +1 -1
- package/dist/infrastructure/decorators/cache.decorator.d.ts +53 -0
- package/dist/infrastructure/decorators/cache.decorator.d.ts.map +1 -0
- package/dist/infrastructure/decorators/cache.decorator.js +47 -0
- package/dist/infrastructure/decorators/cache.decorator.js.map +1 -0
- package/dist/infrastructure/decorators/index.d.ts +4 -0
- package/dist/infrastructure/decorators/index.d.ts.map +1 -0
- package/dist/infrastructure/decorators/index.js +4 -0
- package/dist/infrastructure/decorators/index.js.map +1 -0
- package/dist/infrastructure/decorators/logger.decorator.d.ts +38 -0
- package/dist/infrastructure/decorators/logger.decorator.d.ts.map +1 -0
- package/dist/infrastructure/decorators/logger.decorator.js +66 -0
- package/dist/infrastructure/decorators/logger.decorator.js.map +1 -0
- package/dist/infrastructure/decorators/retry.decorator.d.ts +37 -0
- package/dist/infrastructure/decorators/retry.decorator.d.ts.map +1 -0
- package/dist/infrastructure/decorators/retry.decorator.js +54 -0
- package/dist/infrastructure/decorators/retry.decorator.js.map +1 -0
- package/dist/infrastructure/dom/dom.service.d.ts +11 -5
- package/dist/infrastructure/dom/dom.service.d.ts.map +1 -1
- package/dist/infrastructure/dom/dom.service.js +20 -6
- package/dist/infrastructure/dom/dom.service.js.map +1 -1
- package/dist/infrastructure/index.d.ts +1 -0
- package/dist/infrastructure/index.d.ts.map +1 -1
- package/dist/infrastructure/index.js +1 -0
- package/dist/infrastructure/index.js.map +1 -1
- package/dist/prisma/schema.json +17 -13
- package/dist/styles.css +2 -0
- package/package.json +32 -38
- package/scss/_flags.scss +179 -0
- package/scss/_functions.scss +168 -0
- package/scss/_mixins.scss +658 -0
- package/scss/_reset.scss +275 -0
- package/scss/_utilities.scss +449 -0
- package/scss/_variables.scss +539 -0
- package/scss/components/_index.scss +50 -0
- package/scss/demo.scss +12 -0
- package/scss/main.scss +56 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.service.js","sourceRoot":"","sources":["../../../src/core/services/utils.service.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"utils.service.js","sourceRoot":"","sources":["../../../src/core/services/utils.service.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,OAAO,YAAY;IAChB,MAAM,CAAC,QAAQ,CAAe;IAEtC;;OAEG;IACH,gBAAuB,CAAC;IAExB;;;;;;;;;;OAUG;IACH,MAAM,CAAC,WAAW;QACjB,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC;YAC5B,YAAY,CAAC,QAAQ,GAAG,IAAI,YAAY,EAAE,CAAC;QAC5C,CAAC;QACD,OAAO,YAAY,CAAC,QAAQ,CAAC;IAC9B,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,SAAS,CAAI,KAAU;QACtB,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;IAC5B,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAI,KAAU,EAAE,IAAY;QACnC,IAAI,IAAI,IAAI,CAAC;YA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AsB,EAAE,QAAQ,GAAG,CAAC;IAC5D,OAAO,YAAY,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;AAC7D,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,UAAU,CAAC,OAAiB;IAC3C,OAAO,YAAY,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;AACvD,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAC7B,KAAQ;IAKR,OAAO,YAAY,CAAC,WAAW,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;AACzD,CAAC"}
|
|
@@ -1,9 +1,54 @@
|
|
|
1
1
|
import type { z } from "zod";
|
|
2
2
|
import type { FetchResult } from "../../types/index.js";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* ValidationService - Singleton para validaciones.
|
|
5
|
+
*
|
|
6
|
+
* Aplica el patrón Singleton: una única instancia que centraliza la
|
|
7
|
+
* validación de datos desconocidos (respuestas de API, configs, input de
|
|
8
|
+
* usuario) contra esquemas Zod devolviendo Safe Results en vez de lanzar
|
|
9
|
+
* excepciones. Puro y sin I/O, seguro para SSR.
|
|
10
|
+
*/
|
|
11
|
+
export declare class ValidationService {
|
|
12
|
+
private static instance;
|
|
13
|
+
/**
|
|
14
|
+
* Constructor privado - enforce singleton.
|
|
15
|
+
*/
|
|
16
|
+
private constructor();
|
|
17
|
+
/**
|
|
18
|
+
* Obtiene la instancia única del ValidationService (Singleton).
|
|
19
|
+
*
|
|
20
|
+
* @returns La instancia única de {@link ValidationService}.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* const validator = ValidationService.getInstance();
|
|
25
|
+
* validator.useValidate(SmartVideoOptionsSchema, raw);
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
static getInstance(): ValidationService;
|
|
29
|
+
/**
|
|
30
|
+
* Validates unknown data (API responses, configs, user input) against a
|
|
31
|
+
* Zod schema and returns a Safe Result instead of throwing.
|
|
32
|
+
* Framework-agnostic and pure: no I/O, SSR-safe.
|
|
33
|
+
*
|
|
34
|
+
* @typeParam T - The validated output type (`z.infer` of the schema).
|
|
35
|
+
* @param schema - Any Zod schema.
|
|
36
|
+
* @param data - Unknown input to validate.
|
|
37
|
+
* @returns `FetchResult<T>` with typed data or a `Validation Error`.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```ts
|
|
41
|
+
* import { SmartVideoOptionsSchema } from "katanakit-js/schemas";
|
|
42
|
+
*
|
|
43
|
+
* const result = useValidate(SmartVideoOptionsSchema, JSON.parse(raw));
|
|
44
|
+
* if (result.ok) useBuildVideoEmbed(result.data);
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
useValidate<T>(schema: z.ZodType<T>, data: unknown): FetchResult<T>;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Validates unknown data against a Zod schema and returns a Safe Result.
|
|
51
|
+
* Wrapper sobre {@link ValidationService} (backward compatibility).
|
|
7
52
|
*
|
|
8
53
|
* @typeParam T - The validated output type (`z.infer` of the schema).
|
|
9
54
|
* @param schema - Any Zod schema.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.service.d.ts","sourceRoot":"","sources":["../../../src/core/services/validation.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"validation.service.d.ts","sourceRoot":"","sources":["../../../src/core/services/validation.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD;;;;;;;GAOG;AACH,qBAAa,iBAAiB;IAC7B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAoB;IAE3C;;OAEG;IACH,OAAO;IAEP;;;;;;;;;;OAUG;IACH,MAAM,CAAC,WAAW,IAAI,iBAAiB;IAOvC;;;;;;;;;;;;;;;;;OAiBG;IACH,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,GAAG,WAAW,CAAC,CAAC,CAAC;CAsBnE;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,GAAG,WAAW,CAAC,CAAC,CAAC,CAElF"}
|
|
@@ -1,7 +1,78 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* ValidationService - Singleton para validaciones.
|
|
3
|
+
*
|
|
4
|
+
* Aplica el patrón Singleton: una única instancia que centraliza la
|
|
5
|
+
* validación de datos desconocidos (respuestas de API, configs, input de
|
|
6
|
+
* usuario) contra esquemas Zod devolviendo Safe Results en vez de lanzar
|
|
7
|
+
* excepciones. Puro y sin I/O, seguro para SSR.
|
|
8
|
+
*/
|
|
9
|
+
export class ValidationService {
|
|
10
|
+
static instance;
|
|
11
|
+
/**
|
|
12
|
+
* Constructor privado - enforce singleton.
|
|
13
|
+
*/
|
|
14
|
+
constructor() { }
|
|
15
|
+
/**
|
|
16
|
+
* Obtiene la instancia única del ValidationService (Singleton).
|
|
17
|
+
*
|
|
18
|
+
* @returns La instancia única de {@link ValidationService}.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```ts
|
|
22
|
+
* const validator = ValidationService.getInstance();
|
|
23
|
+
* validator.useValidate(SmartVideoOptionsSchema, raw);
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
static getInstance() {
|
|
27
|
+
if (!ValidationService.instance) {
|
|
28
|
+
ValidationService.instance = new ValidationService();
|
|
29
|
+
}
|
|
30
|
+
return ValidationService.instance;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Validates unknown data (API responses, configs, user input) against a
|
|
34
|
+
* Zod schema and returns a Safe Result instead of throwing.
|
|
35
|
+
* Framework-agnostic and pure: no I/O, SSR-safe.
|
|
36
|
+
*
|
|
37
|
+
* @typeParam T - The validated output type (`z.infer` of the schema).
|
|
38
|
+
* @param schema - Any Zod schema.
|
|
39
|
+
* @param data - Unknown input to validate.
|
|
40
|
+
* @returns `FetchResult<T>` with typed data or a `Validation Error`.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* import { SmartVideoOptionsSchema } from "katanakit-js/schemas";
|
|
45
|
+
*
|
|
46
|
+
* const result = useValidate(SmartVideoOptionsSchema, JSON.parse(raw));
|
|
47
|
+
* if (result.ok) useBuildVideoEmbed(result.data);
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
useValidate(schema, data) {
|
|
51
|
+
const parsed = schema.safeParse(data);
|
|
52
|
+
if (parsed.success) {
|
|
53
|
+
return { data: parsed.data, error: null, url: "", status: 200, ok: true };
|
|
54
|
+
}
|
|
55
|
+
const details = parsed.error.issues.map((issue) => ({
|
|
56
|
+
path: issue.path.join("."),
|
|
57
|
+
message: issue.message,
|
|
58
|
+
}));
|
|
59
|
+
const summary = details.map((d) => (d.path ? `${d.path}: ${d.message}` : d.message)).join("; ");
|
|
60
|
+
return {
|
|
61
|
+
data: null,
|
|
62
|
+
error: {
|
|
63
|
+
message: `Validation Error: ${summary || "invalid data"}`,
|
|
64
|
+
status: 400,
|
|
65
|
+
details,
|
|
66
|
+
},
|
|
67
|
+
url: "",
|
|
68
|
+
status: 400,
|
|
69
|
+
ok: false,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Validates unknown data against a Zod schema and returns a Safe Result.
|
|
75
|
+
* Wrapper sobre {@link ValidationService} (backward compatibility).
|
|
5
76
|
*
|
|
6
77
|
* @typeParam T - The validated output type (`z.infer` of the schema).
|
|
7
78
|
* @param schema - Any Zod schema.
|
|
@@ -17,25 +88,6 @@
|
|
|
17
88
|
* ```
|
|
18
89
|
*/
|
|
19
90
|
export function useValidate(schema, data) {
|
|
20
|
-
|
|
21
|
-
if (parsed.success) {
|
|
22
|
-
return { data: parsed.data, error: null, url: "", status: 200, ok: true };
|
|
23
|
-
}
|
|
24
|
-
const details = parsed.error.issues.map((issue) => ({
|
|
25
|
-
path: issue.path.join("."),
|
|
26
|
-
message: issue.message,
|
|
27
|
-
}));
|
|
28
|
-
const summary = details.map((d) => (d.path ? `${d.path}: ${d.message}` : d.message)).join("; ");
|
|
29
|
-
return {
|
|
30
|
-
data: null,
|
|
31
|
-
error: {
|
|
32
|
-
message: `Validation Error: ${summary || "invalid data"}`,
|
|
33
|
-
status: 400,
|
|
34
|
-
details,
|
|
35
|
-
},
|
|
36
|
-
url: "",
|
|
37
|
-
status: 400,
|
|
38
|
-
ok: false,
|
|
39
|
-
};
|
|
91
|
+
return ValidationService.getInstance().useValidate(schema, data);
|
|
40
92
|
}
|
|
41
93
|
//# sourceMappingURL=validation.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.service.js","sourceRoot":"","sources":["../../../src/core/services/validation.service.ts"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"validation.service.js","sourceRoot":"","sources":["../../../src/core/services/validation.service.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AACH,MAAM,OAAO,iBAAiB;IACrB,MAAM,CAAC,QAAQ,CAAoB;IAE3C;;OAEG;IACH,gBAAuB,CAAC;IAExB;;;;;;;;;;OAUG;IACH,MAAM,CAAC,WAAW;QACjB,IAAI,CAAC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ACD;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,WAAW,CAAI,MAAoB,EAAE,IAAa;IACjE,OAAO,iBAAiB,CAAC,WAAW,EAAE,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CacheDecorator - Decorator Pattern para caché de resultados.
|
|
3
|
+
*
|
|
4
|
+
* Envuelve una función asíncrona y memoiza su resultado por clave (los
|
|
5
|
+
* argumentos serializados por defecto). No modifica la función original:
|
|
6
|
+
* la caché se añade en tiempo de composición (Open/Closed).
|
|
7
|
+
*
|
|
8
|
+
* Nota: el nombre usa mayúscula inicial porque es un decorador composible,
|
|
9
|
+
* no una función utilitaria (`use*`) del API pública.
|
|
10
|
+
*
|
|
11
|
+
* @typeParam T - Tipo de la función envuelta.
|
|
12
|
+
* @param fn - La función asíncrona a decorar.
|
|
13
|
+
* @param options - TTL en ms y estrategia de clave.
|
|
14
|
+
* @returns La función decorada con caché.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* import { CacheDecorator } from "katanakit-js";
|
|
19
|
+
*
|
|
20
|
+
* const getCached = CacheDecorator(fetchUser, { ttlMs: 60_000 });
|
|
21
|
+
* await getCached(1); // consulta
|
|
22
|
+
* await getCached(1); // sirve de caché
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @remarks Keys live in a `Map` (no prototype-pollution risk). Expired
|
|
26
|
+
* entries are reclaimed lazily — when their key is requested again — and
|
|
27
|
+
* `useClearCache()` drops everything. For high-cardinality keys (unbounded
|
|
28
|
+
* input space) call `useClearCache()` periodically or set a `ttlMs`.
|
|
29
|
+
*/
|
|
30
|
+
export interface CacheDecoratorOptions {
|
|
31
|
+
/** Time-to-live de cada entrada en milisegundos. `0` = sin expiración. */
|
|
32
|
+
ttlMs?: number;
|
|
33
|
+
/** Genera la clave de caché a partir de los argumentos. */
|
|
34
|
+
keyFn?: (...args: unknown[]) => string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Decorates an async function with memoized results (Decorator Pattern).
|
|
38
|
+
*
|
|
39
|
+
* @typeParam T - The async function type.
|
|
40
|
+
* @param fn - The function to decorate.
|
|
41
|
+
* @param options - TTL and key strategy.
|
|
42
|
+
* @returns The decorated function with an attached cache registry.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* const getCached = CacheDecorator(async (id: number) => fetchUser(id), { ttlMs: 30_000 });
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
export declare function CacheDecorator<T extends (...args: never[]) => Promise<unknown>>(fn: T, options?: CacheDecoratorOptions): T & {
|
|
50
|
+
useClearCache: () => void;
|
|
51
|
+
useCacheSize: () => number;
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=cache.decorator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache.decorator.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/decorators/cache.decorator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,WAAW,qBAAqB;IACrC,0EAA0E;IAC1E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2DAA2D;IAC3D,KAAK,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,MAAM,CAAC;CACvC;AAsBD;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,OAAO,CAAC,OAAO,CAAC,EAC9E,EAAE,EAAE,CAAC,EACL,OAAO,GAAE,qBAA0B,GACjC,CAAC,GAAG;IAAE,aAAa,EAAE,MAAM,IAAI,CAAC;IAAC,YAAY,EAAE,MAAM,MAAM,CAAA;CAAE,CA8B/D"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/** Default key function: JSON of the arguments with a stable shape. */
|
|
2
|
+
function defaultKeyFn(...args) {
|
|
3
|
+
return JSON.stringify(args);
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Creates a cache key from `fn` identity plus the call arguments, so two
|
|
7
|
+
* decorated functions never share entries even with identical arguments.
|
|
8
|
+
*/
|
|
9
|
+
function makeKey(fn, key) {
|
|
10
|
+
const fnId = fn.name || "anonymous";
|
|
11
|
+
return `${fnId}:${key}`;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Decorates an async function with memoized results (Decorator Pattern).
|
|
15
|
+
*
|
|
16
|
+
* @typeParam T - The async function type.
|
|
17
|
+
* @param fn - The function to decorate.
|
|
18
|
+
* @param options - TTL and key strategy.
|
|
19
|
+
* @returns The decorated function with an attached cache registry.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```ts
|
|
23
|
+
* const getCached = CacheDecorator(async (id: number) => fetchUser(id), { ttlMs: 30_000 });
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export function CacheDecorator(fn, options = {}) {
|
|
27
|
+
const { ttlMs = 0, keyFn = defaultKeyFn } = options;
|
|
28
|
+
const store = new Map();
|
|
29
|
+
const decorated = async (...args) => {
|
|
30
|
+
const key = makeKey(fn, keyFn(...args));
|
|
31
|
+
const now = Date.now();
|
|
32
|
+
const hit = store.get(key);
|
|
33
|
+
if (hit && (ttlMs === 0 || hit.expiresAt > now)) {
|
|
34
|
+
return hit.value;
|
|
35
|
+
}
|
|
36
|
+
const value = (await fn(...args));
|
|
37
|
+
store.set(key, { value, expiresAt: now + ttlMs });
|
|
38
|
+
return value;
|
|
39
|
+
};
|
|
40
|
+
const result = decorated;
|
|
41
|
+
/** Empties the cache (all entries). */
|
|
42
|
+
result.useClearCache = () => store.clear();
|
|
43
|
+
/** Number of entries currently held (expired entries included until evicted). */
|
|
44
|
+
result.useCacheSize = () => store.size;
|
|
45
|
+
return result;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=cache.decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache.decorator.js","sourceRoot":"","sources":["../../../src/infrastructure/decorators/cache.decorator.ts"],"names":[],"mappings":"AA0CA,uEAAuE;AACvE,SAAS,YAAY,CAAC,GAAG,IAAe;IACvC,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;AAC7B,CAAC;AAED;;;GAGG;AACH,SAAS,OAAO,CAAC,EAAiC,EAAE,GAAW;IAC9D,MAAM,IAAI,GAAG,EAAE,CAAC,IAAI,IAAI,WAAW,CAAC;IACpC,OAAO,GAAG,IAAI,IAAI,GAAG,EAAE,CAAC;AACzB,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,cAAc,CAC7B,EAAK,EACL,UAAiC,EAAE;IAEnC,MAAM,EAAE,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,YAAY,EAAE,GAAG,OAAO,CAAC;IACpD,MAAM,KAAK,GAAG,IAAI,GAAG,EAAsB,CAAC;IAE5C,MAAM,SAAS,GAAG,KAAK,EAAE,GAAG,IAAmB,EAAmC,EAAE;QACnF,MAAM,GAAG,GAAG,OAAO,CAAC,EAAE,EAAE,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;QACxC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAEvB,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC3B,IAAI,GAAG,IAAI,CAAC,KAAK,KAAK,CAAC,IAAI,GAAG,CAAC,SAAS,GAAG,GAAG,CAAC,EAAE,CAAC;YACjD,OAAO,GAAG,CAAC,KAA+B,CAAC;QAC5C,CAAC;QAED,MAAM,KAAK,GAAG,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,CAAC,CAA2B,CAAC;QAC5D,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,GAAG,KAAK,EAAE,CAAC,CAAC;QAClD,OAAO,KAAK,CAAC;IACd,CAAC,CAAC;IAEF,MAAM,MAAM,GAAG,SAGd,CAAC;IAEF,uCAAuC;IACvC,MAAM,CAAC,aAAa,GAAG,GAAG,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IAE3C,iFAAiF;IACjF,MAAM,CAAC,YAAY,GAAG,GAAG,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC;IAEvC,OAAO,MAAM,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/decorators/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,KAAK,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAClF,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/infrastructure/decorators/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAA8B,MAAM,sBAAsB,CAAC;AAClF,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { LogLevel } from "../../types/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* LoggerDecorator - Decorator Pattern para trazado de llamadas.
|
|
4
|
+
*
|
|
5
|
+
* Envuelve una función (sync o async) y registra cada invocación con sus
|
|
6
|
+
* argumentos, el resultado y la duración. No modifica la función original:
|
|
7
|
+
* el logging se añade en tiempo de composición (Open/Closed).
|
|
8
|
+
*
|
|
9
|
+
* Nota: el nombre usa mayúscula inicial porque es un decorador composible,
|
|
10
|
+
* no una función utilitaria (`use*`) del API pública.
|
|
11
|
+
*
|
|
12
|
+
* @typeParam T - Tipo de la función envuelta.
|
|
13
|
+
* @param fn - La función a decorar.
|
|
14
|
+
* @param label - Nombre legible que aparece en los logs (default: `fn.name`).
|
|
15
|
+
* @param level - Nivel de log para el resultado (default: `"log"`).
|
|
16
|
+
* @returns La función decorada con logging.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* import { LoggerDecorator } from "katanakit-js";
|
|
21
|
+
*
|
|
22
|
+
* const traced = LoggerDecorator(fetchUser, "fetchUser");
|
|
23
|
+
* await traced(1);
|
|
24
|
+
* // [fetchUser] start { args: [1] }
|
|
25
|
+
* // [fetchUser] ok (12ms) { result: {...} }
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* @example Composición
|
|
29
|
+
* ```ts
|
|
30
|
+
* const robust = RetryDecorator(LoggerDecorator(flakyRequest, "flaky"), 2);
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* @remarks **Security**: arguments and results are logged verbatim. Do NOT
|
|
34
|
+
* decorate functions that receive secrets (API keys, tokens, passwords) —
|
|
35
|
+
* wrap a redacting adapter instead, or strip sensitive fields before calling.
|
|
36
|
+
*/
|
|
37
|
+
export declare function LoggerDecorator<T extends (...args: never[]) => unknown>(fn: T, label?: string, level?: LogLevel): T;
|
|
38
|
+
//# sourceMappingURL=logger.decorator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.decorator.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/decorators/logger.decorator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAErD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,OAAO,EACtE,EAAE,EAAE,CAAC,EACL,KAAK,CAAC,EAAE,MAAM,EACd,KAAK,GAAE,QAAgB,GACrB,CAAC,CAgCH"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { useLogger } from "../../core/services/logger.service.js";
|
|
2
|
+
/**
|
|
3
|
+
* LoggerDecorator - Decorator Pattern para trazado de llamadas.
|
|
4
|
+
*
|
|
5
|
+
* Envuelve una función (sync o async) y registra cada invocación con sus
|
|
6
|
+
* argumentos, el resultado y la duración. No modifica la función original:
|
|
7
|
+
* el logging se añade en tiempo de composición (Open/Closed).
|
|
8
|
+
*
|
|
9
|
+
* Nota: el nombre usa mayúscula inicial porque es un decorador composible,
|
|
10
|
+
* no una función utilitaria (`use*`) del API pública.
|
|
11
|
+
*
|
|
12
|
+
* @typeParam T - Tipo de la función envuelta.
|
|
13
|
+
* @param fn - La función a decorar.
|
|
14
|
+
* @param label - Nombre legible que aparece en los logs (default: `fn.name`).
|
|
15
|
+
* @param level - Nivel de log para el resultado (default: `"log"`).
|
|
16
|
+
* @returns La función decorada con logging.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* import { LoggerDecorator } from "katanakit-js";
|
|
21
|
+
*
|
|
22
|
+
* const traced = LoggerDecorator(fetchUser, "fetchUser");
|
|
23
|
+
* await traced(1);
|
|
24
|
+
* // [fetchUser] start { args: [1] }
|
|
25
|
+
* // [fetchUser] ok (12ms) { result: {...} }
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* @example Composición
|
|
29
|
+
* ```ts
|
|
30
|
+
* const robust = RetryDecorator(LoggerDecorator(flakyRequest, "flaky"), 2);
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* @remarks **Security**: arguments and results are logged verbatim. Do NOT
|
|
34
|
+
* decorate functions that receive secrets (API keys, tokens, passwords) —
|
|
35
|
+
* wrap a redacting adapter instead, or strip sensitive fields before calling.
|
|
36
|
+
*/
|
|
37
|
+
export function LoggerDecorator(fn, label, level = "log") {
|
|
38
|
+
const name = label ?? fn.name ?? "anonymous";
|
|
39
|
+
const decorated = (...args) => {
|
|
40
|
+
const startedAt = Date.now();
|
|
41
|
+
useLogger(`${name} start`, { args }, level);
|
|
42
|
+
try {
|
|
43
|
+
const result = fn(...args);
|
|
44
|
+
// Trace async results when the function returns a promise.
|
|
45
|
+
if (result instanceof Promise) {
|
|
46
|
+
return result
|
|
47
|
+
.then((value) => {
|
|
48
|
+
useLogger(`${name} ok (${Date.now() - startedAt}ms)`, { result: value }, level);
|
|
49
|
+
return value;
|
|
50
|
+
})
|
|
51
|
+
.catch((error) => {
|
|
52
|
+
useLogger(`${name} error (${Date.now() - startedAt}ms)`, { error }, "error");
|
|
53
|
+
throw error;
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
useLogger(`${name} ok (${Date.now() - startedAt}ms)`, { result }, level);
|
|
57
|
+
return result;
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
useLogger(`${name} error (${Date.now() - startedAt}ms)`, { error }, "error");
|
|
61
|
+
throw error;
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
return decorated;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=logger.decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.decorator.js","sourceRoot":"","sources":["../../../src/infrastructure/decorators/logger.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAC;AAGlE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,UAAU,eAAe,CAC9B,EAAK,EACL,KAAc,EACd,QAAkB,KAAK;IAEvB,MAAM,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC,IAAI,IAAI,WAAW,CAAC;IAE7C,MAAM,SAAS,GAAG,CAAC,GAAG,IAAmB,E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|
+
* RetryDecorator - Decorator Pattern para reintentos.
|
|
3
|
+
*
|
|
4
|
+
* Envuelve una función asíncrona y la re-ejecuta cuando lanza, con un
|
|
5
|
+
* intervalo fijo entre intentos. No modifica la función original: la
|
|
6
|
+
* decoración se aplica en tiempo de composición (Open/Closed).
|
|
7
|
+
*
|
|
8
|
+
* Nota: el nombre usa mayúscula inicial porque es un decorador composible,
|
|
9
|
+
* no una función utilitaria (`use*`) del API pública.
|
|
10
|
+
*
|
|
11
|
+
* @typeParam T - Tipo de la función envuelta.
|
|
12
|
+
* @param fn - La función asíncrona a decorar.
|
|
13
|
+
* @param retries - Número máximo de reintentos adicionales (default `3`).
|
|
14
|
+
* @param delayMs - Intervalo entre intentos en ms (default `1000`).
|
|
15
|
+
* @returns La función decorada con reintentos.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* import { RetryDecorator } from "katanakit-js";
|
|
20
|
+
*
|
|
21
|
+
* const fetchWithRetry = RetryDecorator(() => fetch("/api"), 3, 500);
|
|
22
|
+
* // reintenta hasta 3 veces con 500ms de espera antes de propagar el error
|
|
23
|
+
* await fetchWithRetry();
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @example Composición con otros decoradores
|
|
27
|
+
* ```ts
|
|
28
|
+
* const robust = RetryDecorator(LoggerDecorator(flakyRequest), 2, 200);
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @remarks Only **thrown** errors trigger a retry. KatanaKit's Safe Result
|
|
32
|
+
* helpers (`useFetch`, `useGet`, ...) never throw — they return `{ ok: false }`
|
|
33
|
+
* — so they are not retried as-is. To retry those, make `fn` throw on failure
|
|
34
|
+
* (e.g. unwrap with `useSafeQueryFn`) or check `result.ok` inside `fn`.
|
|
35
|
+
*/
|
|
36
|
+
export declare function RetryDecorator<T extends (...args: never[]) => Promise<unknown>>(fn: T, retries?: number, delayMs?: number): T;
|
|
37
|
+
//# sourceMappingURL=retry.decorator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retry.decorator.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/decorators/retry.decorator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,OAAO,CAAC,OAAO,CAAC,EAC9E,EAAE,EAAE,CAAC,EACL,OAAO,SAAI,EACX,OAAO,SAAO,GACZ,CAAC,CAmBH"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RetryDecorator - Decorator Pattern para reintentos.
|
|
3
|
+
*
|
|
4
|
+
* Envuelve una función asíncrona y la re-ejecuta cuando lanza, con un
|
|
5
|
+
* intervalo fijo entre intentos. No modifica la función original: la
|
|
6
|
+
* decoración se aplica en tiempo de composición (Open/Closed).
|
|
7
|
+
*
|
|
8
|
+
* Nota: el nombre usa mayúscula inicial porque es un decorador composible,
|
|
9
|
+
* no una función utilitaria (`use*`) del API pública.
|
|
10
|
+
*
|
|
11
|
+
* @typeParam T - Tipo de la función envuelta.
|
|
12
|
+
* @param fn - La función asíncrona a decorar.
|
|
13
|
+
* @param retries - Número máximo de reintentos adicionales (default `3`).
|
|
14
|
+
* @param delayMs - Intervalo entre intentos en ms (default `1000`).
|
|
15
|
+
* @returns La función decorada con reintentos.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* import { RetryDecorator } from "katanakit-js";
|
|
20
|
+
*
|
|
21
|
+
* const fetchWithRetry = RetryDecorator(() => fetch("/api"), 3, 500);
|
|
22
|
+
* // reintenta hasta 3 veces con 500ms de espera antes de propagar el error
|
|
23
|
+
* await fetchWithRetry();
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @example Composición con otros decoradores
|
|
27
|
+
* ```ts
|
|
28
|
+
* const robust = RetryDecorator(LoggerDecorator(flakyRequest), 2, 200);
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @remarks Only **thrown** errors trigger a retry. KatanaKit's Safe Result
|
|
32
|
+
* helpers (`useFetch`, `useGet`, ...) never throw — they return `{ ok: false }`
|
|
33
|
+
* — so they are not retried as-is. To retry those, make `fn` throw on failure
|
|
34
|
+
* (e.g. unwrap with `useSafeQueryFn`) or check `result.ok` inside `fn`.
|
|
35
|
+
*/
|
|
36
|
+
export function RetryDecorator(fn, retries = 3, delayMs = 1000) {
|
|
37
|
+
const decorated = async (...args) => {
|
|
38
|
+
let lastError;
|
|
39
|
+
for (let attempt = 0; attempt <= retries; attempt++) {
|
|
40
|
+
try {
|
|
41
|
+
return (await fn(...args));
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
lastError = error;
|
|
45
|
+
if (attempt < retries && delayMs > 0) {
|
|
46
|
+
await new Promise((resolve) => setTimeout(resolve, delayMs));
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
throw lastError;
|
|
51
|
+
};
|
|
52
|
+
return decorated;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=retry.decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retry.decorator.js","sourceRoot":"","sources":["../../../src/infrastructure/decorators/retry.decorator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,UAAU,cAAc,CAC7B,EAAK,EACL,OAAO,GAAG,CAAC,EACX,OAAO,GAAG,IAAI;IAEd,MAAM,SAAS,GAAG,KAAK,EAAE,GAAG,IAAmB,EAAmC,EAAE;QACnF,IAAI,SAAkB,CAAC;QAEvB,KAAK,IAAI,OAAO,GAAG,CAAC,EAAE,OAAO,IAAI,OAAO,EAAE,OAAO,EAAE,EAAE,CAAC;YACrD,IAAI,CAAC;gBACJ,OAAO,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,CAAC,CAA2B,CAAC;YACtD,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,SAAS,GAAG,KAAK,CAAC;gBAClB,IAAI,OAAO,GAAG,OAAO,IAAI,OAAO,GAAG,CAAC,EAAE,CAAC;oBACtC,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;gBAC9D,CAAC;YACF,CAAC;QACF,CAAC;QAED,MAAM,SAAS,CAAC;IACjB,CAAC,CAAC;IAEF,OAAO,SAAc,CAAC;AACvB,CAAC"}
|
|
@@ -299,14 +299,20 @@ export declare const useSetText: (target: Element | string, text: string) => voi
|
|
|
299
299
|
*/
|
|
300
300
|
export declare const useAppend: (target: Element | string, child: Element | string) => void;
|
|
301
301
|
/**
|
|
302
|
-
*
|
|
303
|
-
*
|
|
304
|
-
* @param target - A CSS selector string or an Element instance.
|
|
302
|
+
* Closes a modal by adding the "hidden" class or removing it from the DOM.
|
|
303
|
+
* Clicking outside the modal or calling this function will hide it.
|
|
305
304
|
*
|
|
305
|
+
* @param modalSelector - A CSS selector string for the modal element.
|
|
306
|
+
* @param useRemoveDOM - If `true`, removes the modal from the DOM entirely.
|
|
307
|
+
* If `false`, only adds the "hidden" class (CSS `display: none`).
|
|
306
308
|
* @example
|
|
307
309
|
* ```ts
|
|
308
|
-
*
|
|
310
|
+
* // Hide modal with CSS hidden class (keeps element in DOM)
|
|
311
|
+
* useModalClose(".modal-overlay", false);
|
|
312
|
+
*
|
|
313
|
+
* // Remove modal from DOM completely
|
|
314
|
+
* useModalClose(".modal-overlay", true);
|
|
309
315
|
* ```
|
|
310
316
|
*/
|
|
311
|
-
export declare const
|
|
317
|
+
export declare const useModalClose: (modalSelector: string, useRemoveDOM?: boolean) => void;
|
|
312
318
|
//# sourceMappingURL=dom.service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1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