sass-cms-template-common 0.0.25 → 0.0.26

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 CHANGED
@@ -1033,6 +1033,17 @@ export declare class CmsCopilotServices {
1033
1033
  * oportunidad: `save` | `like` | `dislike` | `assign` (permiso COPILOT_ACTION).
1034
1034
  */
1035
1035
  executeAction: (input: CopilotActionInput) => Promise<CopilotActionResponse>;
1036
+ /**
1037
+ * POST /copilot/generate — genera la nota con IA (Kundera) a partir de una
1038
+ * oportunidad y la crea en el CMS, devolviendo su `fileName` (path VFS) para
1039
+ * abrir el editor de noticias. Llamada **síncrona** (10–40s) que consume cuota,
1040
+ * marca la oportunidad como `actioned` y exige los permisos `COPILOT_ACTION` e
1041
+ * `IA_NEWS_CREATE` (NAA-4863; contrato verificado contra la ficha del endpoint).
1042
+ * @param opportunityId - Id de la oportunidad a generar.
1043
+ * @param model - Modelo de IA opcional (ej. `gemini-2.5-flash`); si se omite,
1044
+ * usa el default del microservicio.
1045
+ */
1046
+ generate: (opportunityId: string, model?: string) => Promise<CopilotGenerateResponse>;
1036
1047
  /**
1037
1048
  * POST /copilot/snooze — "recordar luego" de una oportunidad de la campanita
1038
1049
  * (permiso COPILOT_VIEW). La oportunidad desaparece de la campanita para el
@@ -2982,6 +2993,53 @@ export declare interface CopilotActionResponse extends CmsResponse {
2982
2993
  data?: CopilotActionData;
2983
2994
  }
2984
2995
 
2996
+ /**
2997
+ * Artículo generado por IA (Kundera) que devuelve POST /copilot/generate. Cada
2998
+ * campo viene solo si tuvo valor. Hoy la nota se crea con `title` + `body_markdown`
2999
+ * (crudo); el resto (tags, imágenes) se devuelve para reuso del front pero NO se
3000
+ * escribe en la nota (ver ficha del endpoint, NAA-4863).
3001
+ */
3002
+ export declare interface CopilotArticle {
3003
+ /** Título de la nota. */
3004
+ title?: string;
3005
+ /** Copete / bajada. */
3006
+ lead?: string;
3007
+ /** Cuerpo en Markdown (hoy se guarda crudo hasta que Kundera devuelva HTML). */
3008
+ body_markdown?: string;
3009
+ /** Resumen para SEO / meta description. */
3010
+ meta_description?: string;
3011
+ /** Tags sugeridos. */
3012
+ tags?: string[];
3013
+ /** Consulta sugerida para buscar la imagen de portada. */
3014
+ image_search_query?: string;
3015
+ /** Descripción de la imagen sugerida. */
3016
+ image_suggestion?: string;
3017
+ /** Advertencias editoriales de la IA. */
3018
+ warnings?: string[];
3019
+ }
3020
+
3021
+ /**
3022
+ * Cuerpo de la respuesta de POST /copilot/generate (NAA-4863).
3023
+ *
3024
+ * El endpoint genera el artículo con IA (Kundera) a partir de una oportunidad y
3025
+ * **crea la nota en el CMS** (misma lógica que `news/IAcreate/create`),
3026
+ * devolviendo el `fileName` (path VFS) para que el front abra el editor.
3027
+ */
3028
+ export declare interface CopilotGenerateResponse extends CmsResponse {
3029
+ copilotEnabled?: boolean;
3030
+ opportunity_id?: string;
3031
+ /** Código de resultado devuelto por el microservicio (omitido si es nulo). */
3032
+ code?: string;
3033
+ /**
3034
+ * Path VFS de la nota recién creada. El front lo usa para abrir el editor de
3035
+ * noticias (`/new_post/{fileName}/edit/{idPublicación}`). Solo si la creación
3036
+ * fue exitosa.
3037
+ */
3038
+ fileName?: string;
3039
+ /** Artículo generado por IA (título, cuerpo, tags, imágenes sugeridas…). */
3040
+ article?: CopilotArticle;
3041
+ }
3042
+
2985
3043
  /** Filtros opcionales de POST /copilot/opportunities (passthrough al micro). */
2986
3044
  export declare interface CopilotOpportunitiesFilters {
2987
3045
  /** Filtro de estado de las oportunidades (p. ej. "open"). */
@@ -7206,7 +7264,7 @@ export declare const sizes: {
7206
7264
 
7207
7265
  export declare type SourceColors = typeof sourceColors;
7208
7266
 
7209
- export declare const sourceColors: Record<"rss" | "gtrends" | "sconsole" | "x", string>;
7267
+ export declare const sourceColors: Record<"rss" | "gtrends" | "sconsole" | "ga4" | "x", string>;
7210
7268
 
7211
7269
  export declare type StateColors = typeof stateColors;
7212
7270
 
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as e, A as t, B as n, C as r, Ct as i, D as a, E as o, Et as s, F as c, G as l, H as u, I as d, J as f, K as p, L as m, M as h, N as g, O as _, P as v, Q as y, R as b, S as x, St as S, T as C, Tt as w, U as T, V as E, W as D, X as O, Y as ee, Z as te, _ as ne, _t as k, a as re, at as ie, b as ae, bt as oe, c as se, ct as ce, d as le, dt as ue, et as de, f as fe, ft as pe, g as me, gt as he, h as ge, ht as _e, i as ve, it as ye, j as be, k as xe, l as Se, lt as Ce, m as we, mt as Te, n as Ee, nt as De, o as Oe, ot as ke, p as Ae, pt as A, q as je, r as Me, rt as Ne, s as Pe, st as Fe, t as Ie, tt as Le, u as Re, ut as ze, v as Be, vt as j, w as Ve, wt as He, x as Ue, xt as M, y as We, yt as Ge, z as Ke } from "./services-DoVB2Gol.js";
1
+ import { $ as e, A as t, B as n, C as r, Ct as i, D as a, E as o, Et as s, F as c, G as l, H as u, I as d, J as f, K as p, L as m, M as h, N as g, O as _, P as v, Q as y, R as b, S as x, St as S, T as C, Tt as w, U as T, V as E, W as D, X as O, Y as ee, Z as te, _ as ne, _t as k, a as re, at as ie, b as ae, bt as oe, c as se, ct as ce, d as le, dt as ue, et as de, f as fe, ft as pe, g as me, gt as he, h as ge, ht as _e, i as ve, it as ye, j as be, k as xe, l as Se, lt as Ce, m as we, mt as Te, n as Ee, nt as De, o as Oe, ot as ke, p as Ae, pt as A, q as je, r as Me, rt as Ne, s as Pe, st as Fe, t as Ie, tt as Le, u as Re, ut as ze, v as Be, vt as j, w as Ve, wt as He, x as Ue, xt as M, y as We, yt as Ge, z as Ke } from "./services-ByTYzguw.js";
2
2
  import { ThemeProvider as qe, alpha as N, createTheme as Je, useColorScheme as Ye } from "@mui/material/styles";
3
3
  import { Fragment as Xe, cloneElement as Ze, createContext as Qe, forwardRef as $e, isValidElement as et, useCallback as tt, useContext as nt, useEffect as P, useId as rt, useMemo as F, useRef as it, useState as I } from "react";
4
4
  import { Fragment as L, jsx as R, jsxs as z } from "react/jsx-runtime";
package/dist/server.d.ts CHANGED
@@ -599,6 +599,17 @@ export declare class CmsCopilotServices {
599
599
  * oportunidad: `save` | `like` | `dislike` | `assign` (permiso COPILOT_ACTION).
600
600
  */
601
601
  executeAction: (input: CopilotActionInput) => Promise<CopilotActionResponse>;
602
+ /**
603
+ * POST /copilot/generate — genera la nota con IA (Kundera) a partir de una
604
+ * oportunidad y la crea en el CMS, devolviendo su `fileName` (path VFS) para
605
+ * abrir el editor de noticias. Llamada **síncrona** (10–40s) que consume cuota,
606
+ * marca la oportunidad como `actioned` y exige los permisos `COPILOT_ACTION` e
607
+ * `IA_NEWS_CREATE` (NAA-4863; contrato verificado contra la ficha del endpoint).
608
+ * @param opportunityId - Id de la oportunidad a generar.
609
+ * @param model - Modelo de IA opcional (ej. `gemini-2.5-flash`); si se omite,
610
+ * usa el default del microservicio.
611
+ */
612
+ generate: (opportunityId: string, model?: string) => Promise<CopilotGenerateResponse>;
602
613
  /**
603
614
  * POST /copilot/snooze — "recordar luego" de una oportunidad de la campanita
604
615
  * (permiso COPILOT_VIEW). La oportunidad desaparece de la campanita para el
@@ -1852,6 +1863,53 @@ export declare interface CopilotActionResponse extends CmsResponse {
1852
1863
  data?: CopilotActionData;
1853
1864
  }
1854
1865
 
1866
+ /**
1867
+ * Artículo generado por IA (Kundera) que devuelve POST /copilot/generate. Cada
1868
+ * campo viene solo si tuvo valor. Hoy la nota se crea con `title` + `body_markdown`
1869
+ * (crudo); el resto (tags, imágenes) se devuelve para reuso del front pero NO se
1870
+ * escribe en la nota (ver ficha del endpoint, NAA-4863).
1871
+ */
1872
+ export declare interface CopilotArticle {
1873
+ /** Título de la nota. */
1874
+ title?: string;
1875
+ /** Copete / bajada. */
1876
+ lead?: string;
1877
+ /** Cuerpo en Markdown (hoy se guarda crudo hasta que Kundera devuelva HTML). */
1878
+ body_markdown?: string;
1879
+ /** Resumen para SEO / meta description. */
1880
+ meta_description?: string;
1881
+ /** Tags sugeridos. */
1882
+ tags?: string[];
1883
+ /** Consulta sugerida para buscar la imagen de portada. */
1884
+ image_search_query?: string;
1885
+ /** Descripción de la imagen sugerida. */
1886
+ image_suggestion?: string;
1887
+ /** Advertencias editoriales de la IA. */
1888
+ warnings?: string[];
1889
+ }
1890
+
1891
+ /**
1892
+ * Cuerpo de la respuesta de POST /copilot/generate (NAA-4863).
1893
+ *
1894
+ * El endpoint genera el artículo con IA (Kundera) a partir de una oportunidad y
1895
+ * **crea la nota en el CMS** (misma lógica que `news/IAcreate/create`),
1896
+ * devolviendo el `fileName` (path VFS) para que el front abra el editor.
1897
+ */
1898
+ export declare interface CopilotGenerateResponse extends CmsResponse {
1899
+ copilotEnabled?: boolean;
1900
+ opportunity_id?: string;
1901
+ /** Código de resultado devuelto por el microservicio (omitido si es nulo). */
1902
+ code?: string;
1903
+ /**
1904
+ * Path VFS de la nota recién creada. El front lo usa para abrir el editor de
1905
+ * noticias (`/new_post/{fileName}/edit/{idPublicación}`). Solo si la creación
1906
+ * fue exitosa.
1907
+ */
1908
+ fileName?: string;
1909
+ /** Artículo generado por IA (título, cuerpo, tags, imágenes sugeridas…). */
1910
+ article?: CopilotArticle;
1911
+ }
1912
+
1855
1913
  /** Filtros opcionales de POST /copilot/opportunities (passthrough al micro). */
1856
1914
  export declare interface CopilotOpportunitiesFilters {
1857
1915
  /** Filtro de estado de las oportunidades (p. ej. "open"). */
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, H as s, I as c, J 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, dt as A, et as j, f as M, g as N, h as P, i as F, it as I, j as L, k as R, l as z, lt as B, m as V, n as H, nt as U, o as W, ot as G, p as K, q, r as J, rt as Y, s as X, st as Z, t as Q, tt as $, u as ee, ut as te, v as ne, w as re, x as ie, y as ae, z as oe } from "./services-DoVB2Gol.js";
1
+ import { $ as e, A as t, B as n, C as r, D as i, E as a, F as o, H as s, I as c, J 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, dt as A, et as j, f as M, g as N, h as P, i as F, it as I, j as L, k as R, l as z, lt as B, m as V, n as H, nt as U, o as W, ot as G, p as K, q, r as J, rt as Y, s as X, st as Z, t as Q, tt as $, u as ee, ut as te, v as ne, w as re, x as ie, y as ae, z as oe } from "./services-ByTYzguw.js";
2
2
  export { i as CmsAudiosServices, t as CmsAuthLoginServices, o as CmsAuthServices, a as CmsCategoriesServices, v as CmsCkeditorServices, r as CmsCommentsServices, Q as CmsCommonServices, _ as CmsContributionsServices, re as CmsCopilotServices, m as CmsDashboardServices, ae as CmsEventsServices, ne as CmsFileExplorerServices, C as CmsGeneralServices, N as CmsImagesServices, P as CmsNewsServices, V as CmsNotificationServices, K as CmsPeopleServices, M as CmsPlanningServices, k as CmsPollsServices, p as CmsPreviewServices, E as CmsProductivityPlanServices, f as CmsProfileServices, d as CmsPublicationsServices, ee as CmsRecipesServices, ie as CmsSectionsServices, L as CmsSitesServices, H as CmsTagsServices, J as CmsTranscribeServices, F as CmsTriviasServices, R as CmsUploadServices, z as CmsUsersServices, w as CmsVideosServices, W as CmsVodsServices, X as CmsWorkpaperServices, D as CmsZonesServices, $ as NETWORK_ERROR_CODES, U as classifyNetworkError, e as cmsNetworkBridge, A as commonErrorsEn, te as commonErrorsEs, B as commonErrorsPt, c as filterModulesByPermissions, q as findPublicationBySlug, l as findPublicationLabel, g as formatRelativeTime, oe as formatSiteDateTime, x as getAllPublications, G as getCommonError, b as getDefaultPublicationSlug, Y as getNetworkErrorCodeFromResult, n as getSiteNow, u as hasModulePermission, I as isNetworkErrorCode, T as isRetryableNetworkCode, Z as normalizeErrorCode, y as parseGmtOffsetMinutes, S as parsePublicationSlug, O as resolveErrorSeverity, j as resumeAxiosOnNetworkError, s as toSiteWallClock, h as toTestId };
@@ -457,6 +457,10 @@ var r = t("", {
457
457
  light: "#0F9D58",
458
458
  dark: "#34C77B"
459
459
  },
460
+ ga4: {
461
+ light: "#E8710A",
462
+ dark: "#F0A45E"
463
+ },
460
464
  x: {
461
465
  light: "#111111",
462
466
  dark: "#E1E2E9"
@@ -551,6 +555,9 @@ var b = {
551
555
  "008.004": "The note does not exist",
552
556
  "008.005": "The scheduled publication date must be in the future",
553
557
  "008.006": "Unidentified error, check the variable \"error\"",
558
+ "008.008": "The note could not be created: invalid data",
559
+ "008.009": "The note could not be created in the CMS",
560
+ "008.010": "The publication has no edition type defined",
554
561
  "008.012": "Error getting XSD definition",
555
562
  "008.013": "Failed to unlock note on exit",
556
563
  "008.014": "Note locked by someone else",
@@ -572,6 +579,8 @@ var b = {
572
579
  "030.005": "The writer to assign is missing",
573
580
  "030.006": "The Copilot service does not exist at the configured address",
574
581
  "030.007": "The Copilot site of the publication is not valid",
582
+ "030.009": "Copilot did not return the generated article",
583
+ "030.010": "The note was generated but could not be created",
575
584
  "999.000": "The request does not have the expected format",
576
585
  "999.001a": "The request has an error that was not captured. Contact your Administrator and detail the steps you followed",
577
586
  "999.002a": "An error occurred in the service",
@@ -646,6 +655,9 @@ var b = {
646
655
  "008.004": "La nota no existe",
647
656
  "008.005": "La fecha de publicación programada debe ser en el futuro",
648
657
  "008.006": "Error no identificado, revisar la variable \"error\"",
658
+ "008.008": "No se pudo crear la nota: datos inválidos",
659
+ "008.009": "No se pudo crear la nota en el CMS",
660
+ "008.010": "La publicación no tiene un tipo de edición definido",
649
661
  "008.012": "Error al obtener definición del XSD",
650
662
  "008.013": "Error al desbloquear la nota en el exit",
651
663
  "008.014": "Nota bloqueada por otra persona",
@@ -667,6 +679,8 @@ var b = {
667
679
  "030.005": "Falta el redactor a asignar",
668
680
  "030.006": "El servicio Copilot no existe en la dirección configurada",
669
681
  "030.007": "El sitio Copilot de la publicación no es válido",
682
+ "030.009": "Copilot no devolvió el artículo generado",
683
+ "030.010": "La nota se generó pero no se pudo crear",
670
684
  "999.000": "El requerimiento no cuenta con el formato esperado",
671
685
  "999.001a": "El requerimiento tiene un error que no se capturó. Comuniquese con su Administrador y detalle los pasos que siguió",
672
686
  "999.002a": "Se produjo un error en el servicio",
@@ -741,6 +755,9 @@ var b = {
741
755
  "008.004": "A nota não existe",
742
756
  "008.005": "A data de publicação programada deve ser futura",
743
757
  "008.006": "Erro não identificado, verifique a variável \"erro\"",
758
+ "008.008": "Não foi possível criar a nota: dados inválidos",
759
+ "008.009": "Não foi possível criar a nota no CMS",
760
+ "008.010": "A publicação não tem um tipo de edição definido",
744
761
  "008.012": "Erro ao obter definição XSD",
745
762
  "008.013": "Falha ao desbloquear nota ao sair",
746
763
  "008.014": "Nota bloqueada por outra pessoa",
@@ -762,6 +779,8 @@ var b = {
762
779
  "030.005": "Falta o redator a atribuir",
763
780
  "030.006": "O serviço Copilot não existe no endereço configurado",
764
781
  "030.007": "O site Copilot da publicação não é válido",
782
+ "030.009": "O Copilot não retornou o artigo gerado",
783
+ "030.010": "A nota foi gerada, mas não foi possível criá-la",
765
784
  "999.000": "A solicitação não tem o formato esperado",
766
785
  "999.001a": "O pedido tem um erro que não foi capturado. Entre em contato com seu administrador e detalhe as etapas que você seguiu",
767
786
  "999.002a": "Ocorreu um erro no serviço",
@@ -1532,6 +1551,17 @@ var J = class {
1532
1551
  return console.error("[/copilot/actions]", e), Promise.reject(e);
1533
1552
  }
1534
1553
  };
1554
+ generate = async (e, t) => {
1555
+ try {
1556
+ return (await this.props.axiosApi.post("/copilot/generate", {
1557
+ authentication: this.authentication,
1558
+ opportunity_id: e,
1559
+ ...t !== void 0 && { model: t }
1560
+ })).data;
1561
+ } catch (e) {
1562
+ return console.error("[/copilot/generate]", e), Promise.reject(e);
1563
+ }
1564
+ };
1535
1565
  snooze = async (e) => {
1536
1566
  try {
1537
1567
  return (await this.props.axiosApi.post("/copilot/snooze", {
@@ -4313,4 +4343,4 @@ var J = class {
4313
4343
  //#endregion
4314
4344
  export { j as $, ge as A, fe as B, we as C, s as Ct, be as D, xe as E, p as Et, J as F, F as G, W as H, q as I, B as J, P as K, he as L, Z as M, X as N, ye as O, Y as P, N as Q, me as R, Te as S, o as St, Se as T, d as Tt, L as U, U as V, I as W, V as X, R as Y, H as Z, Ae as _, c as _t, Ve as a, ue as at, De as b, ee as bt, Re as c, se as ct, Fe as d, x as dt, M as et, $ as f, y as ft, je as g, l as gt, Me as h, g as ht, He as i, le as it, Q as j, ve as k, Le as l, C as lt, Ne as m, te as mt, We as n, D as nt, Be as o, oe as ot, Pe as p, i as pt, z as q, Ue as r, de as rt, ze as s, w as st, Ge as t, T as tt, Ie as u, S as ut, ke as v, b as vt, Ce as w, re as wt, Ee as x, a as xt, Oe as y, ne as yt, K as z };
4315
4345
 
4316
- //# sourceMappingURL=services-DoVB2Gol.js.map
4346
+ //# sourceMappingURL=services-ByTYzguw.js.map