sass-cms-template-common 0.0.6 → 0.0.7
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/index.d.ts +1794 -11
- package/dist/index.js +3944 -991
- package/dist/index.js.map +1 -1
- package/dist/server.d.ts +123 -4
- package/dist/server.js +2 -2
- package/dist/{services-BqEo-2mI.js → services-C2aqnM7h.js} +467 -75
- package/dist/services-C2aqnM7h.js.map +1 -0
- package/package.json +2 -1
- package/dist/services-BqEo-2mI.js.map +0 -1
package/dist/server.d.ts
CHANGED
|
@@ -581,6 +581,9 @@ export declare class CmsDashboardServices {
|
|
|
581
581
|
getNotifications: () => Promise<DashboardNotificationsResponse>;
|
|
582
582
|
}
|
|
583
583
|
|
|
584
|
+
/** Severidad de feedback derivada de un código de error. */
|
|
585
|
+
export declare type CmsErrorSeverity = 'warning' | 'error';
|
|
586
|
+
|
|
584
587
|
/** Evento del CMS. La forma exacta depende del recurso. */
|
|
585
588
|
export declare interface CmsEvent {
|
|
586
589
|
[key: string]: unknown;
|
|
@@ -1370,11 +1373,11 @@ export declare class CmsUsersServices {
|
|
|
1370
1373
|
addPin: (pin: string) => Promise<UserPinAddResponse>;
|
|
1371
1374
|
/** POST /users/pin/delete — elimina uno o más pins por ID. */
|
|
1372
1375
|
deletePins: (ids: number[]) => Promise<CmsResponse>;
|
|
1373
|
-
/** POST /users/
|
|
1376
|
+
/** POST /users/actions/setStatus — activa o desactiva un usuario. */
|
|
1374
1377
|
setUserStatus: (username: string, action: UserStatusAction) => Promise<CmsResponse>;
|
|
1375
|
-
/** POST /users/
|
|
1378
|
+
/** POST /users/actions/resetPass — restablece la contraseña de un usuario. */
|
|
1376
1379
|
resetPassword: (username: string) => Promise<CmsResponse>;
|
|
1377
|
-
/** POST /users/
|
|
1380
|
+
/** POST /users/actions/resetMfa — resetea la configuración MFA de un usuario. */
|
|
1378
1381
|
resetMfa: (username: string, reason: string) => Promise<CmsResponse>;
|
|
1379
1382
|
}
|
|
1380
1383
|
|
|
@@ -1668,6 +1671,36 @@ export declare interface CommentUserGetResponse extends CmsResponse {
|
|
|
1668
1671
|
phonenumber?: string;
|
|
1669
1672
|
}
|
|
1670
1673
|
|
|
1674
|
+
/**
|
|
1675
|
+
* CMS error code → readable message map (English).
|
|
1676
|
+
*
|
|
1677
|
+
* English counterpart of {@link commonErrorsEs}. See that file for the key
|
|
1678
|
+
* convention and the `código → código+'a'` fallback handled by
|
|
1679
|
+
* `getCommonError`.
|
|
1680
|
+
*/
|
|
1681
|
+
export declare const commonErrorsEn: Record<string, string>;
|
|
1682
|
+
|
|
1683
|
+
/**
|
|
1684
|
+
* Mapa de códigos de error del CMS → mensaje legible (español).
|
|
1685
|
+
*
|
|
1686
|
+
* Equivalente al `CommonErrorsEs` del Angular legacy (`cmsmedios-ux`). Es la
|
|
1687
|
+
* base compartida por todos los gestores; **se va ampliando** con cada código
|
|
1688
|
+
* nuevo que se aprenda durante el desarrollo (ver CLAUDE.md raíz).
|
|
1689
|
+
*
|
|
1690
|
+
* Convención de claves: el código tal cual lo devuelve el webservice
|
|
1691
|
+
* (`000.005`, `999.000`, …). Algunos mensajes genéricos usan el sufijo `a`
|
|
1692
|
+
* (`999.002a`) por compatibilidad con el legacy; `getCommonError` resuelve el
|
|
1693
|
+
* fallback `código → código+'a'` automáticamente.
|
|
1694
|
+
*/
|
|
1695
|
+
export declare const commonErrorsEs: Record<string, string>;
|
|
1696
|
+
|
|
1697
|
+
/**
|
|
1698
|
+
* Mapa de código de erro do CMS → mensagem legível (português).
|
|
1699
|
+
*
|
|
1700
|
+
* Equivalente em português de {@link commonErrorsEs}.
|
|
1701
|
+
*/
|
|
1702
|
+
export declare const commonErrorsPt: Record<string, string>;
|
|
1703
|
+
|
|
1671
1704
|
/**
|
|
1672
1705
|
* Contribución a actualizar (POST /contributions/edit).
|
|
1673
1706
|
*
|
|
@@ -1894,10 +1927,40 @@ export declare function findPublicationBySlug(sites: SiteSection[], slug: string
|
|
|
1894
1927
|
|
|
1895
1928
|
export declare function findPublicationLabel(sites: SiteSection[], publicationId: string): string;
|
|
1896
1929
|
|
|
1930
|
+
/**
|
|
1931
|
+
* Formatea un instante (epoch ms) en la zona horaria del sitio, de forma
|
|
1932
|
+
* estable entre navegadores.
|
|
1933
|
+
*
|
|
1934
|
+
* @param epochMs Instante en milisegundos (UTC).
|
|
1935
|
+
* @param gmtRedaction Offset GMT de la publicación.
|
|
1936
|
+
* @param localeTag Tag BCP 47 (p. ej. `"es-AR"`); usar `getIntlLocaleTag(locale)`.
|
|
1937
|
+
* @param options Opciones de `Intl.DateTimeFormat` (se fuerza `timeZone: 'UTC'`).
|
|
1938
|
+
*/
|
|
1939
|
+
export declare function formatSiteDateTime(epochMs: number, gmtRedaction: string | null | undefined, localeTag: string, options?: Intl.DateTimeFormatOptions): string;
|
|
1940
|
+
|
|
1897
1941
|
export declare function getAllPublications(sites: SiteSection[]): Publication[];
|
|
1898
1942
|
|
|
1943
|
+
/**
|
|
1944
|
+
* Resuelve el mensaje legible de un código de error en el idioma indicado.
|
|
1945
|
+
* Aplica el fallback legacy `código → código+'a'` (p. ej. `999.002` → `999.002a`)
|
|
1946
|
+
* y, si el idioma no tiene el código, cae a inglés. Devuelve `undefined` si el
|
|
1947
|
+
* código es desconocido (el caller debe usar entonces el `error` crudo o un
|
|
1948
|
+
* mensaje genérico).
|
|
1949
|
+
*/
|
|
1950
|
+
export declare function getCommonError(errorCode: string | number | Array<string | number> | null | undefined, locale?: Locale): string | undefined;
|
|
1951
|
+
|
|
1899
1952
|
export declare function getDefaultPublicationSlug(sites: SiteSection[]): string;
|
|
1900
1953
|
|
|
1954
|
+
/**
|
|
1955
|
+
* Hora actual del sitio (equivalente al `getFormattedRedactionTimeUTC` del CMS
|
|
1956
|
+
* Angular): "ahora" formateado en la zona de redacción de la publicación.
|
|
1957
|
+
*
|
|
1958
|
+
* @param gmtRedaction Offset GMT de la publicación.
|
|
1959
|
+
* @param localeTag Tag BCP 47 (p. ej. `"es-AR"`).
|
|
1960
|
+
* @param options Opciones de `Intl.DateTimeFormat`.
|
|
1961
|
+
*/
|
|
1962
|
+
export declare function getSiteNow(gmtRedaction: string | null | undefined, localeTag: string, options?: Intl.DateTimeFormatOptions): string;
|
|
1963
|
+
|
|
1901
1964
|
declare interface IAudiosServices {
|
|
1902
1965
|
axiosApi: AxiosInstance;
|
|
1903
1966
|
authentication: Authentication;
|
|
@@ -2302,6 +2365,8 @@ declare interface IZonesServices {
|
|
|
2302
2365
|
authentication: Authentication;
|
|
2303
2366
|
}
|
|
2304
2367
|
|
|
2368
|
+
declare type Locale = (typeof SUPPORTED_LOCALES)[number];
|
|
2369
|
+
|
|
2305
2370
|
/** Cuerpo de la respuesta de POST /auth/modulesAvailable */
|
|
2306
2371
|
export declare interface ModulesAvailableResponse {
|
|
2307
2372
|
modules: NavItemPermissions[];
|
|
@@ -2777,6 +2842,13 @@ export declare interface NewsViewsGetResponse extends CmsResponse {
|
|
|
2777
2842
|
[key: string]: unknown;
|
|
2778
2843
|
}
|
|
2779
2844
|
|
|
2845
|
+
/**
|
|
2846
|
+
* Normaliza un `errorCode` que puede venir como string, número o array (el CMS
|
|
2847
|
+
* devuelve un array de códigos cuando hay varias violaciones de contraseña).
|
|
2848
|
+
* Devuelve el primer código no vacío.
|
|
2849
|
+
*/
|
|
2850
|
+
export declare function normalizeErrorCode(errorCode: string | number | Array<string | number> | null | undefined): string | undefined;
|
|
2851
|
+
|
|
2780
2852
|
/** Cuerpo de la respuesta de POST /notification/adminConfiguration. */
|
|
2781
2853
|
export declare interface NotificationAdminConfigurationResponse extends CmsResponse {
|
|
2782
2854
|
/** Topics configurados para la publicación. */
|
|
@@ -2839,6 +2911,31 @@ export declare interface NotificationTopicsResponse extends CmsResponse {
|
|
|
2839
2911
|
topics?: NotificationTopic[];
|
|
2840
2912
|
}
|
|
2841
2913
|
|
|
2914
|
+
/**
|
|
2915
|
+
* Utilidades de hora del sitio (zona de redacción de la publicación).
|
|
2916
|
+
*
|
|
2917
|
+
* El backend entrega en cada `Publication` un offset GMT fijo
|
|
2918
|
+
* (`gmtRedaction`, p. ej. `"-3"` / `"+0"`) — NO una zona IANA. Por eso la
|
|
2919
|
+
* conversión se hace con un offset fijo y no contempla horario de verano
|
|
2920
|
+
* (DST). Es el equivalente, en React, de lo que en el CMS Angular hacía
|
|
2921
|
+
* `settings.service` (`getFormattedRedactionTimeStamp` /
|
|
2922
|
+
* `getFormattedRedactionTimeUTC`).
|
|
2923
|
+
*
|
|
2924
|
+
* El criterio: un timestamp del CMS es un instante en UTC (epoch ms). Para
|
|
2925
|
+
* mostrarlo "como lo ve la redacción" se desplaza el instante por el offset y
|
|
2926
|
+
* se formatea en `timeZone: 'UTC'`, de modo que el resultado es estable e
|
|
2927
|
+
* independiente de la zona horaria del navegador.
|
|
2928
|
+
*/
|
|
2929
|
+
/**
|
|
2930
|
+
* Convierte el offset GMT de una publicación a minutos.
|
|
2931
|
+
* Acepta `"-3"`, `"+3"`, `"3"`, `"+5:30"`, tolera prefijos `GMT`/`UTC` y
|
|
2932
|
+
* espacios. Si el valor no es interpretable, devuelve `0` (UTC).
|
|
2933
|
+
*
|
|
2934
|
+
* @param gmt Offset tal como llega en `Publication.gmtRedaction`.
|
|
2935
|
+
* @returns Offset en minutos respecto de UTC (negativo al oeste de Greenwich).
|
|
2936
|
+
*/
|
|
2937
|
+
export declare function parseGmtOffsetMinutes(gmt: string | null | undefined): number;
|
|
2938
|
+
|
|
2842
2939
|
export declare function parsePublicationSlug(slug: string): number;
|
|
2843
2940
|
|
|
2844
2941
|
/** Filtros de POST /contributions/paymentGateways/get. */
|
|
@@ -3650,6 +3747,12 @@ export declare interface Publication {
|
|
|
3650
3747
|
timeFormat: string;
|
|
3651
3748
|
type: string;
|
|
3652
3749
|
updateAdmin: PublicationUpdateAdmin;
|
|
3750
|
+
/**
|
|
3751
|
+
* Sub-sitios (multisitio) de esta publicación. Opcional: hoy el servicio no
|
|
3752
|
+
* lo devuelve y las publicaciones se listan planas. Cuando el backend lo
|
|
3753
|
+
* incluya, el selector los muestra como filas hijas expandibles con contador.
|
|
3754
|
+
*/
|
|
3755
|
+
children?: Publication[];
|
|
3653
3756
|
}
|
|
3654
3757
|
|
|
3655
3758
|
/**
|
|
@@ -3865,6 +3968,9 @@ export declare interface RecipesPublishCheckResponse extends CmsResponse {
|
|
|
3865
3968
|
[key: string]: unknown;
|
|
3866
3969
|
}
|
|
3867
3970
|
|
|
3971
|
+
/** Devuelve la severidad de toast para un código de error (`warning`/`error`). */
|
|
3972
|
+
export declare function resolveErrorSeverity(errorCode: string | number | Array<string | number> | null | undefined): CmsErrorSeverity;
|
|
3973
|
+
|
|
3868
3974
|
/** Sección de una publicación del CMS (forma devuelta por get/exist). */
|
|
3869
3975
|
export declare interface Section {
|
|
3870
3976
|
id?: number;
|
|
@@ -3962,6 +4068,8 @@ export declare interface SubscriptionsGetResponse extends CmsResponse {
|
|
|
3962
4068
|
[key: string]: unknown;
|
|
3963
4069
|
}
|
|
3964
4070
|
|
|
4071
|
+
declare const SUPPORTED_LOCALES: readonly ["es", "en", "pt"];
|
|
4072
|
+
|
|
3965
4073
|
/** Término/tag del CMS. La forma exacta depende del tipo y del endpoint. */
|
|
3966
4074
|
export declare interface Tag {
|
|
3967
4075
|
id?: number;
|
|
@@ -4136,6 +4244,17 @@ export declare interface TagUpdateInput {
|
|
|
4136
4244
|
[key: string]: unknown;
|
|
4137
4245
|
}
|
|
4138
4246
|
|
|
4247
|
+
/**
|
|
4248
|
+
* Desplaza un instante (epoch ms en UTC) al "reloj de pared" de la zona de
|
|
4249
|
+
* redacción del sitio. El número resultante, formateado con `timeZone: 'UTC'`,
|
|
4250
|
+
* muestra la hora local del sitio sin importar la zona del navegador.
|
|
4251
|
+
*
|
|
4252
|
+
* @param epochMs Instante en milisegundos (UTC).
|
|
4253
|
+
* @param gmtRedaction Offset GMT de la publicación.
|
|
4254
|
+
* @returns Epoch ms desplazado por el offset del sitio.
|
|
4255
|
+
*/
|
|
4256
|
+
export declare function toSiteWallClock(epochMs: number, gmtRedaction: string | null | undefined): number;
|
|
4257
|
+
|
|
4139
4258
|
/**
|
|
4140
4259
|
* Cuerpo de la respuesta de POST /transcribe/get.
|
|
4141
4260
|
*
|
|
@@ -4480,7 +4599,7 @@ export declare interface UsersPublicationResponse extends CmsResponse {
|
|
|
4480
4599
|
/** Estado posible de un usuario del sistema. */
|
|
4481
4600
|
export declare type UserStatus = 'active' | 'block' | 'pending';
|
|
4482
4601
|
|
|
4483
|
-
/** Acción soportada por POST /users/
|
|
4602
|
+
/** Acción soportada por POST /users/actions/setStatus. */
|
|
4484
4603
|
export declare type UserStatusAction = 'activate' | 'deactivate';
|
|
4485
4604
|
|
|
4486
4605
|
/** Video del CMS. La forma exacta depende del recurso y del formato pedido. */
|
package/dist/server.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { i as CmsAudiosServices,
|
|
1
|
+
import { $ as e, A as t, C as n, D as r, E as i, F as a, G as o, I as s, J as c, K as l, L as u, M as d, N as f, O as p, P as m, Q as h, R as g, S as _, T as v, U as y, W as b, X as x, Y as S, Z as C, _ as w, a as T, b as E, c as D, d as O, f as k, g as A, h as j, i as M, j as N, k as P, l as F, m as I, n as L, o as R, p as z, q as B, r as V, s as H, t as U, u as W, v as G, w as K, x as q, y as J } from "./services-C2aqnM7h.js";
|
|
2
|
+
export { i as CmsAudiosServices, P as CmsAuthLoginServices, m as CmsAuthServices, v as CmsCategoriesServices, K as CmsCkeditorServices, n as CmsCommentsServices, U as CmsCommonServices, _ as CmsContributionsServices, f as CmsDashboardServices, J as CmsEventsServices, G as CmsFileExplorerServices, w as CmsGeneralServices, A as CmsImagesServices, j as CmsNewsServices, I as CmsNotificationServices, z as CmsPeopleServices, k as CmsPlanningServices, O as CmsPollsServices, r as CmsPreviewServices, E as CmsProductivityPlanServices, d as CmsProfileServices, N as CmsPublicationsServices, W as CmsRecipesServices, q as CmsSectionsServices, t as CmsSitesServices, L as CmsTagsServices, V as CmsTranscribeServices, M as CmsTriviasServices, p as CmsUploadServices, F as CmsUsersServices, T as CmsVideosServices, R as CmsVodsServices, H as CmsWorkpaperServices, D as CmsZonesServices, e as commonErrorsEn, h as commonErrorsEs, C as commonErrorsPt, y as findPublicationBySlug, b as findPublicationLabel, a as formatSiteDateTime, o as getAllPublications, c as getCommonError, l as getDefaultPublicationSlug, s as getSiteNow, S as normalizeErrorCode, u as parseGmtOffsetMinutes, B as parsePublicationSlug, x as resolveErrorSeverity, g as toSiteWallClock };
|