sass-cms-template-common 0.0.12 → 0.0.14

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/server.d.ts CHANGED
@@ -326,6 +326,22 @@ export declare interface CkeditorPrompt {
326
326
  [key: string]: unknown;
327
327
  }
328
328
 
329
+ export declare interface ClassifiedNetworkError {
330
+ errorCode: NetworkErrorCode;
331
+ /** Si conviene reintentar la petición. */
332
+ retryable: boolean;
333
+ /** Mensaje crudo del error original (para el detalle copiable del toast). */
334
+ error: string;
335
+ }
336
+
337
+ /**
338
+ * Clasifica una excepción (error de axios en el servidor, o `TypeError:
339
+ * Failed to fetch` del navegador al invocar un server action) como error de
340
+ * red/servidor. Devuelve `null` si NO es un error de red (p. ej. un 4xx o una
341
+ * excepción de lógica): el caller lo trata entonces como error de negocio.
342
+ */
343
+ export declare function classifyNetworkError(error: unknown): ClassifiedNetworkError | null;
344
+
329
345
  /**
330
346
  * Servicios HTTP del módulo `audios` del CMS (solo endpoints JSON POST).
331
347
  *
@@ -583,6 +599,13 @@ export declare class CmsCopilotServices {
583
599
  * oportunidad: `save` | `like` | `dislike` | `assign` (permiso COPILOT_ACTION).
584
600
  */
585
601
  executeAction: (input: CopilotActionInput) => Promise<CopilotActionResponse>;
602
+ /**
603
+ * POST /copilot/snooze — "recordar luego" de una oportunidad de la campanita
604
+ * (permiso COPILOT_VIEW). La oportunidad desaparece de la campanita para el
605
+ * usuario y reaparece sola al vencer el plazo configurado.
606
+ * @param opportunityId - Id de la oportunidad a posponer.
607
+ */
608
+ snooze: (opportunityId: string) => Promise<CopilotSnoozeResponse>;
586
609
  }
587
610
 
588
611
  /**
@@ -1819,7 +1842,8 @@ export declare interface CopilotOpportunitiesResponse extends CmsResponse {
1819
1842
  *
1820
1843
  * La doc del gateway lista `id`, `topic` y `created_at`, pero el microservicio
1821
1844
  * (observado en dev) puede omitirlos: solo `title`, `status` y `score` están
1822
- * garantizados. El consumidor debe tolerar los faltantes.
1845
+ * garantizados. El consumidor debe tolerar los faltantes. En dev (2026-07-06) el
1846
+ * micro también entrega `source`, `type`, `reasons` e `is_followed`.
1823
1847
  */
1824
1848
  export declare interface CopilotOpportunity {
1825
1849
  id?: string;
@@ -1831,8 +1855,23 @@ export declare interface CopilotOpportunity {
1831
1855
  score?: number;
1832
1856
  /** Fecha de creación (ISO 8601, p. ej. "2026-06-26T10:15:00Z"). */
1833
1857
  created_at?: string;
1858
+ /** Fuente detectada (p. ej. "rss"). Verificado en dev 2026-07-06. */
1859
+ source?: CopilotOpportunitySource;
1860
+ /** Subtipo de match del micro (p. ej. "rss_match"). */
1861
+ type?: string;
1862
+ /** Motivos por los que el micro la propuso (para tooltip/detalle). */
1863
+ reasons?: string[];
1864
+ /** Si el editor ya la siguió/guardó (acción "save" de `copilot/actions`). */
1865
+ is_followed?: boolean;
1834
1866
  }
1835
1867
 
1868
+ /**
1869
+ * Fuente de la que el microservicio detectó la oportunidad. Valor observado en
1870
+ * dev hoy: `"rss"`. Se deja abierto (passthrough) para no romper cuando el micro
1871
+ * agregue fuentes nuevas.
1872
+ */
1873
+ declare type CopilotOpportunitySource = 'rss' | 'gtrends' | 'sconsole' | 'x' | (string & {});
1874
+
1836
1875
  /**
1837
1876
  * Estado de una oportunidad tal como lo entrega el microservicio (passthrough).
1838
1877
  * El único valor documentado hoy es `"open"`; se deja abierto para no romper
@@ -1840,6 +1879,18 @@ export declare interface CopilotOpportunity {
1840
1879
  */
1841
1880
  export declare type CopilotOpportunityStatus = 'open' | (string & {});
1842
1881
 
1882
+ /**
1883
+ * Cuerpo de la respuesta de POST /copilot/snooze (NAA-4645). El "recordar luego"
1884
+ * de la campanita: la oportunidad se oculta para ese usuario y reaparece sola al
1885
+ * vencer el plazo configurado.
1886
+ */
1887
+ export declare interface CopilotSnoozeResponse extends CmsResponse {
1888
+ copilotEnabled?: boolean;
1889
+ opportunity_id?: string;
1890
+ /** Momento hasta el cual la oportunidad queda oculta (ISO 8601 o epoch). */
1891
+ snoozed_until?: string | number;
1892
+ }
1893
+
1843
1894
  /** POST /dashboard/countNotificatio */
1844
1895
  export declare interface CountNotificationsResponse {
1845
1896
  status: string;
@@ -1847,10 +1898,32 @@ export declare interface CountNotificationsResponse {
1847
1898
  unreadNotifications?: number;
1848
1899
  }
1849
1900
 
1901
+ /**
1902
+ * Oportunidad editorial copilot presente en POST /dashboard/notification
1903
+ * (NAA-4645). El back manda hasta 3, ordenadas por `score` desc, y solo si hay.
1904
+ */
1905
+ export declare interface DashboardCopilotOpportunity {
1906
+ /** Id de la oportunidad (opportunity_id, requerido para el snooze). */
1907
+ id?: string;
1908
+ title: string;
1909
+ /** Tema/categoría de la oportunidad. */
1910
+ topic?: string;
1911
+ /** Puntaje de coincidencia editorial (0-100). */
1912
+ score?: number;
1913
+ /** Fecha de creación (ISO 8601, p. ej. "2026-06-26T10:15:00Z"). */
1914
+ created_at?: string;
1915
+ isRead?: boolean;
1916
+ }
1917
+
1850
1918
  /** Cuerpo de la respuesta de POST /dashboard/countNotifications. */
1851
1919
  export declare interface DashboardCountNotificationsResponse extends CmsResponse {
1852
1920
  /** Total de notificaciones no leídas del usuario autenticado. */
1853
1921
  unreadNotifications?: number;
1922
+ /**
1923
+ * Oportunidades copilot no leídas (NAA-4645). Ya está **sumado** dentro de
1924
+ * `unreadNotifications`; solo aparece si copilot aplica al usuario/publicación.
1925
+ */
1926
+ copilotOpportunities?: number;
1854
1927
  }
1855
1928
 
1856
1929
  /** Actividad vencida o por vencer presente en POST /dashboard/notification. */
@@ -1895,6 +1968,8 @@ export declare interface DashboardNotificationsResponse extends CmsResponse {
1895
1968
  newsTask?: DashboardNewsTask[];
1896
1969
  /** Actividades vencidas o por vencer. */
1897
1970
  expireTask?: DashboardExpireTask[];
1971
+ /** Oportunidades editoriales copilot (hasta 3, por `score` desc). NAA-4645. */
1972
+ copilot?: DashboardCopilotOpportunity[];
1898
1973
  }
1899
1974
 
1900
1975
  /** Evento de encoder de video presente en POST /dashboard/notification. */
@@ -2071,6 +2146,14 @@ export declare function getCommonError(errorCode: string | number | Array<string
2071
2146
 
2072
2147
  export declare function getDefaultPublicationSlug(sites: SiteSection[]): string;
2073
2148
 
2149
+ /**
2150
+ * Si un resultado ya devuelto por un server action es un envelope de error con
2151
+ * un código de red (`{ status: 'error', errorCode: 'net.*' }`), devuelve ese
2152
+ * código; si no, `null`. Permite reintentar cuando el fallo de red se detectó
2153
+ * en el servidor (Next→OpenCms) y viajó como `CmsResponse`.
2154
+ */
2155
+ export declare function getNetworkErrorCodeFromResult(result: unknown): NetworkErrorCode | null;
2156
+
2074
2157
  /**
2075
2158
  * Hora actual del sitio (equivalente al `getFormattedRedactionTimeUTC` del CMS
2076
2159
  * Angular): "ahora" formateado en la zona de redacción de la publicación.
@@ -2458,6 +2541,12 @@ declare interface ISitesServices {
2458
2541
  authentication: Authentication;
2459
2542
  }
2460
2543
 
2544
+ /** `true` si el código dado es uno de los códigos internos de red. */
2545
+ export declare function isNetworkErrorCode(code: string | null | undefined): boolean;
2546
+
2547
+ /** `true` si un código de red debe reintentarse. */
2548
+ export declare function isRetryableNetworkCode(code: string | null | undefined): boolean;
2549
+
2461
2550
  declare interface ITagsServices {
2462
2551
  axiosApi: AxiosInstance;
2463
2552
  authentication: Authentication;
@@ -2531,8 +2620,28 @@ export declare type NavLinkItem = {
2531
2620
  accent?: 'ai';
2532
2621
  /** Si el href apunta al admin legacy (JSP/Angular), se prefija con `legacyBaseUrl`. */
2533
2622
  legacy?: boolean;
2623
+ /**
2624
+ * Si la ruta del Angular master exige el id de publicación al final
2625
+ * (p. ej. `/admin/tags/:idPub`, `/admin/planning/:idPub`), se le agrega
2626
+ * `selectedPublicationId`. Solo aplica junto con `legacy`.
2627
+ */
2628
+ appendPublicationId?: boolean;
2534
2629
  };
2535
2630
 
2631
+ /** Códigos internos de error de red/servidor (no son del CMS). */
2632
+ export declare const NETWORK_ERROR_CODES: {
2633
+ /** Sin conexión a internet (no se pudo alcanzar el servidor). */
2634
+ readonly offline: "net.offline";
2635
+ /** La petición excedió el timeout. */
2636
+ readonly timeout: "net.timeout";
2637
+ /** El backend no responde (502/503/504). */
2638
+ readonly unavailable: "net.unavailable";
2639
+ /** Error interno del servidor (5xx genérico). */
2640
+ readonly server: "net.server";
2641
+ };
2642
+
2643
+ export declare type NetworkErrorCode = (typeof NETWORK_ERROR_CODES)[keyof typeof NETWORK_ERROR_CODES];
2644
+
2536
2645
  /** Cuerpo de la respuesta de POST /news/edit/adminNewsConfiguration. */
2537
2646
  export declare interface NewsAdminConfigurationResponse extends CmsResponse {
2538
2647
  [key: string]: unknown;
package/dist/server.js CHANGED
@@ -1,2 +1,2 @@
1
- import { $ as e, A as t, B as n, C as r, D as i, E as a, F 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, V as y, X as b, Y as x, Z as S, _ as C, a as w, b as T, c as E, d as D, et 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, nt as R, o as z, p as B, q as V, r as H, rt as U, s as W, t as G, tt as K, u as q, v as J, w as Y, x as X, y as Z, z as Q } from "./services-BjcJgeV1.js";
2
- export { i as CmsAudiosServices, t as CmsAuthLoginServices, o as CmsAuthServices, a as CmsCategoriesServices, v as CmsCkeditorServices, r as CmsCommentsServices, G as CmsCommonServices, _ as CmsContributionsServices, Y as CmsCopilotServices, m as CmsDashboardServices, Z as CmsEventsServices, J as CmsFileExplorerServices, C as CmsGeneralServices, A as CmsImagesServices, j as CmsNewsServices, I as CmsNotificationServices, B as CmsPeopleServices, k as CmsPlanningServices, D as CmsPollsServices, p as CmsPreviewServices, T as CmsProductivityPlanServices, f as CmsProfileServices, d as CmsPublicationsServices, q as CmsRecipesServices, X as CmsSectionsServices, N as CmsSitesServices, L as CmsTagsServices, H as CmsTranscribeServices, M as CmsTriviasServices, P as CmsUploadServices, F as CmsUsersServices, w as CmsVideosServices, z as CmsVodsServices, W as CmsWorkpaperServices, E as CmsZonesServices, U as commonErrorsEn, R as commonErrorsEs, K as commonErrorsPt, s as filterModulesByPermissions, l as findPublicationBySlug, V as findPublicationLabel, g as formatSiteDateTime, c as getAllPublications, h as getCommonError, x as getDefaultPublicationSlug, Q as getSiteNow, u as hasModulePermission, e as normalizeErrorCode, n as parseGmtOffsetMinutes, b as parsePublicationSlug, O as resolveErrorSeverity, y as toSiteWallClock, S as toTestId };
1
+ import { $ as e, A as t, B as n, C as r, D as i, E as a, F 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, V as y, X as b, Y as x, Z as S, _ as C, a as w, at as T, b as E, c as D, ct as O, d as k, et as A, f as j, g as M, h as N, i as P, it as F, j as I, k as L, l as R, m as z, n as B, nt as V, o as H, ot as U, p as W, q as G, r as K, rt as q, s as J, st as Y, t as X, tt as Z, u as Q, v as $, w as ee, x as te, y as ne, z as re } from "./services-DB5GX5UJ.js";
2
+ export { i as CmsAudiosServices, t as CmsAuthLoginServices, o as CmsAuthServices, a as CmsCategoriesServices, v as CmsCkeditorServices, r as CmsCommentsServices, X as CmsCommonServices, _ as CmsContributionsServices, ee as CmsCopilotServices, m as CmsDashboardServices, ne as CmsEventsServices, $ as CmsFileExplorerServices, C as CmsGeneralServices, M as CmsImagesServices, N as CmsNewsServices, z as CmsNotificationServices, W as CmsPeopleServices, j as CmsPlanningServices, k as CmsPollsServices, p as CmsPreviewServices, E as CmsProductivityPlanServices, f as CmsProfileServices, d as CmsPublicationsServices, Q as CmsRecipesServices, te as CmsSectionsServices, I as CmsSitesServices, B as CmsTagsServices, K as CmsTranscribeServices, P as CmsTriviasServices, L as CmsUploadServices, R as CmsUsersServices, w as CmsVideosServices, H as CmsVodsServices, J as CmsWorkpaperServices, D as CmsZonesServices, h as NETWORK_ERROR_CODES, e as classifyNetworkError, O as commonErrorsEn, Y as commonErrorsEs, U as commonErrorsPt, s as filterModulesByPermissions, l as findPublicationBySlug, G as findPublicationLabel, g as formatSiteDateTime, c as getAllPublications, q as getCommonError, x as getDefaultPublicationSlug, A as getNetworkErrorCodeFromResult, re as getSiteNow, u as hasModulePermission, Z as isNetworkErrorCode, V as isRetryableNetworkCode, F as normalizeErrorCode, n as parseGmtOffsetMinutes, b as parsePublicationSlug, T as resolveErrorSeverity, y as toSiteWallClock, S as toTestId };