sass-cms-template-common 0.0.13 → 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
  *
@@ -2130,6 +2146,14 @@ export declare function getCommonError(errorCode: string | number | Array<string
2130
2146
 
2131
2147
  export declare function getDefaultPublicationSlug(sites: SiteSection[]): string;
2132
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
+
2133
2157
  /**
2134
2158
  * Hora actual del sitio (equivalente al `getFormattedRedactionTimeUTC` del CMS
2135
2159
  * Angular): "ahora" formateado en la zona de redacción de la publicación.
@@ -2517,6 +2541,12 @@ declare interface ISitesServices {
2517
2541
  authentication: Authentication;
2518
2542
  }
2519
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
+
2520
2550
  declare interface ITagsServices {
2521
2551
  axiosApi: AxiosInstance;
2522
2552
  authentication: Authentication;
@@ -2590,8 +2620,28 @@ export declare type NavLinkItem = {
2590
2620
  accent?: 'ai';
2591
2621
  /** Si el href apunta al admin legacy (JSP/Angular), se prefija con `legacyBaseUrl`. */
2592
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;
2593
2629
  };
2594
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
+
2595
2645
  /** Cuerpo de la respuesta de POST /news/edit/adminNewsConfiguration. */
2596
2646
  export declare interface NewsAdminConfigurationResponse extends CmsResponse {
2597
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-DS4p6Tpl.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 };