sass-template-common 0.9.241 → 0.10.0
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/dist/sass-template-common.d.ts +31 -8
- package/dist/sass-template-common.js +1911 -1852
- package/dist/sass-template-common.umd.cjs +24 -24
- package/package.json +1 -1
|
@@ -497,8 +497,6 @@ export declare class CommonServices {
|
|
|
497
497
|
}, any, {}>> | undefined;
|
|
498
498
|
getMainMenu: (params: Params) => Promise<AxiosResponse<{
|
|
499
499
|
data: Array<MenuResponse>;
|
|
500
|
-
}, any, {}> | AxiosResponse<{
|
|
501
|
-
data: Array<MenuResponse>;
|
|
502
500
|
}, any, {}> | {
|
|
503
501
|
data: {
|
|
504
502
|
data: Array<MenuResponse>;
|
|
@@ -527,7 +525,9 @@ export declare class CommonServices {
|
|
|
527
525
|
getVideosList: (params: Params) => Promise<AxiosResponse<{
|
|
528
526
|
data: Array<VideoResponseData>;
|
|
529
527
|
}, any, {}>> | undefined;
|
|
530
|
-
getBanners: (params: Params) => Promise<{
|
|
528
|
+
getBanners: (params: Params) => Promise<AxiosResponse<{
|
|
529
|
+
data: Array<BannerResponse>;
|
|
530
|
+
}, any, {}> | {
|
|
531
531
|
data: {
|
|
532
532
|
data: Array<BannerResponse>;
|
|
533
533
|
};
|
|
@@ -537,10 +537,10 @@ export declare class CommonServices {
|
|
|
537
537
|
}, any, {}>> | undefined;
|
|
538
538
|
getRankingS3: (url: string, headers?: {
|
|
539
539
|
Referer: string;
|
|
540
|
-
}) => Promise<
|
|
540
|
+
}) => Promise<AxiosResponse<{
|
|
541
541
|
data: Array<NewListResponseData>;
|
|
542
542
|
}, any, {}> | {
|
|
543
|
-
data:
|
|
543
|
+
data: Array<NewListResponseData>;
|
|
544
544
|
}>;
|
|
545
545
|
getNews: (params: Params) => Promise<AxiosResponse<{
|
|
546
546
|
data: Array<NewListResponseData>;
|
|
@@ -561,9 +561,7 @@ export declare class CommonServices {
|
|
|
561
561
|
data: Array<NewListResponseData>;
|
|
562
562
|
}, any, {}>> | undefined;
|
|
563
563
|
getNewsItemsRelated: (path: string, params?: Params) => Promise<AxiosResponse<NewListResponse, any, {}> | {
|
|
564
|
-
data:
|
|
565
|
-
data: never[];
|
|
566
|
-
};
|
|
564
|
+
data: NewListResponse;
|
|
567
565
|
}> | undefined;
|
|
568
566
|
sendEmail: (data: EmailParams) => Promise<AxiosResponse<{
|
|
569
567
|
data: Array<ItemList>;
|
|
@@ -916,6 +914,12 @@ export declare type EmailParams = {
|
|
|
916
914
|
body: string;
|
|
917
915
|
};
|
|
918
916
|
|
|
917
|
+
/**
|
|
918
|
+
* Fallback completo (no solo `{data: []}`) para endpoints tipados `NewListResponse`:
|
|
919
|
+
* algunos consumidores leen `response.data.entity`/`site`/`publication`, no solo `.data.data`.
|
|
920
|
+
*/
|
|
921
|
+
export declare function emptyNewListResponse(): NewListResponse;
|
|
922
|
+
|
|
919
923
|
export declare function encodeApiEnv<T extends Record<string, any>>(env: T): Record<string, any>;
|
|
920
924
|
|
|
921
925
|
export declare interface Entity {
|
|
@@ -2982,6 +2986,25 @@ export declare interface ReportCommentParams {
|
|
|
2982
2986
|
|
|
2983
2987
|
export declare type ReportReasonKey = keyof typeof REPORT_REASONS;
|
|
2984
2988
|
|
|
2989
|
+
/**
|
|
2990
|
+
* Reintenta `fn` con backoff exponencial, acotando cada intento con `timeoutMs`
|
|
2991
|
+
* (un fetch a un bucket S3 colgado no debe bloquear el request indefinidamente).
|
|
2992
|
+
* Si se agotan los reintentos (o el error no es reintentable, ej. 404), registra el
|
|
2993
|
+
* fallo en DebugStore y devuelve `fallback` en vez de rechazar: una falla del bucket
|
|
2994
|
+
* no debe tumbar el render del sitio consumidor.
|
|
2995
|
+
*/
|
|
2996
|
+
export declare function resilientFetch<T, F>(fn: () => Promise<T> | T, fallback: F, { label, endpoint, params, retries, timeoutMs, baseDelayMs, }: ResilientFetchOptions): Promise<T | F>;
|
|
2997
|
+
|
|
2998
|
+
export declare interface ResilientFetchOptions {
|
|
2999
|
+
/** Identifica el fetch en logs y en el DebugStore (ej. '/news-list-zone', 'bucket:menu'). */
|
|
3000
|
+
label: string;
|
|
3001
|
+
endpoint?: string;
|
|
3002
|
+
params?: Record<string, any>;
|
|
3003
|
+
retries?: number;
|
|
3004
|
+
timeoutMs?: number;
|
|
3005
|
+
baseDelayMs?: number;
|
|
3006
|
+
}
|
|
3007
|
+
|
|
2985
3008
|
export declare interface RoutePathConfig {
|
|
2986
3009
|
autor: string | 'autor';
|
|
2987
3010
|
tema: string | 'tema';
|