sass-cms-template-common 0.0.25 → 0.0.27

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
@@ -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-2zqQa6zN.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 };
@@ -409,6 +409,34 @@ var r = t("", {
409
409
  generateBtnHover: {
410
410
  light: "#1D49C4",
411
411
  dark: "#1D49C4"
412
+ },
413
+ cardBg: {
414
+ light: "#F9F9FF",
415
+ dark: "#1D2024"
416
+ },
417
+ iconBg: {
418
+ light: "#E0E5FC",
419
+ dark: "#26324D"
420
+ },
421
+ iconShadow: {
422
+ light: "rgba(41, 98, 255, 0.24)",
423
+ dark: "rgba(91, 140, 255, 0.30)"
424
+ },
425
+ iconGradientPurple: {
426
+ light: "#7C3AED",
427
+ dark: "#9B6BF5"
428
+ },
429
+ iconGradientBlue: {
430
+ light: "#2962FF",
431
+ dark: "#5B8CFF"
432
+ },
433
+ iconGradientGreen: {
434
+ light: "#1E8E3E",
435
+ dark: "#4FB86A"
436
+ },
437
+ iconGradientAmber: {
438
+ light: "#E8A33D",
439
+ dark: "#F0B968"
412
440
  }
413
441
  }), g = h.values, _ = {
414
442
  high: {
@@ -457,6 +485,10 @@ var r = t("", {
457
485
  light: "#0F9D58",
458
486
  dark: "#34C77B"
459
487
  },
488
+ ga4: {
489
+ light: "#E8710A",
490
+ dark: "#F0A45E"
491
+ },
460
492
  x: {
461
493
  light: "#111111",
462
494
  dark: "#E1E2E9"
@@ -551,6 +583,9 @@ var b = {
551
583
  "008.004": "The note does not exist",
552
584
  "008.005": "The scheduled publication date must be in the future",
553
585
  "008.006": "Unidentified error, check the variable \"error\"",
586
+ "008.008": "The note could not be created: invalid data",
587
+ "008.009": "The note could not be created in the CMS",
588
+ "008.010": "The publication has no edition type defined",
554
589
  "008.012": "Error getting XSD definition",
555
590
  "008.013": "Failed to unlock note on exit",
556
591
  "008.014": "Note locked by someone else",
@@ -572,6 +607,8 @@ var b = {
572
607
  "030.005": "The writer to assign is missing",
573
608
  "030.006": "The Copilot service does not exist at the configured address",
574
609
  "030.007": "The Copilot site of the publication is not valid",
610
+ "030.009": "Copilot did not return the generated article",
611
+ "030.010": "The note was generated but could not be created",
575
612
  "999.000": "The request does not have the expected format",
576
613
  "999.001a": "The request has an error that was not captured. Contact your Administrator and detail the steps you followed",
577
614
  "999.002a": "An error occurred in the service",
@@ -646,6 +683,9 @@ var b = {
646
683
  "008.004": "La nota no existe",
647
684
  "008.005": "La fecha de publicación programada debe ser en el futuro",
648
685
  "008.006": "Error no identificado, revisar la variable \"error\"",
686
+ "008.008": "No se pudo crear la nota: datos inválidos",
687
+ "008.009": "No se pudo crear la nota en el CMS",
688
+ "008.010": "La publicación no tiene un tipo de edición definido",
649
689
  "008.012": "Error al obtener definición del XSD",
650
690
  "008.013": "Error al desbloquear la nota en el exit",
651
691
  "008.014": "Nota bloqueada por otra persona",
@@ -667,6 +707,8 @@ var b = {
667
707
  "030.005": "Falta el redactor a asignar",
668
708
  "030.006": "El servicio Copilot no existe en la dirección configurada",
669
709
  "030.007": "El sitio Copilot de la publicación no es válido",
710
+ "030.009": "Copilot no devolvió el artículo generado",
711
+ "030.010": "La nota se generó pero no se pudo crear",
670
712
  "999.000": "El requerimiento no cuenta con el formato esperado",
671
713
  "999.001a": "El requerimiento tiene un error que no se capturó. Comuniquese con su Administrador y detalle los pasos que siguió",
672
714
  "999.002a": "Se produjo un error en el servicio",
@@ -741,6 +783,9 @@ var b = {
741
783
  "008.004": "A nota não existe",
742
784
  "008.005": "A data de publicação programada deve ser futura",
743
785
  "008.006": "Erro não identificado, verifique a variável \"erro\"",
786
+ "008.008": "Não foi possível criar a nota: dados inválidos",
787
+ "008.009": "Não foi possível criar a nota no CMS",
788
+ "008.010": "A publicação não tem um tipo de edição definido",
744
789
  "008.012": "Erro ao obter definição XSD",
745
790
  "008.013": "Falha ao desbloquear nota ao sair",
746
791
  "008.014": "Nota bloqueada por outra pessoa",
@@ -762,6 +807,8 @@ var b = {
762
807
  "030.005": "Falta o redator a atribuir",
763
808
  "030.006": "O serviço Copilot não existe no endereço configurado",
764
809
  "030.007": "O site Copilot da publicação não é válido",
810
+ "030.009": "O Copilot não retornou o artigo gerado",
811
+ "030.010": "A nota foi gerada, mas não foi possível criá-la",
765
812
  "999.000": "A solicitação não tem o formato esperado",
766
813
  "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
814
  "999.002a": "Ocorreu um erro no serviço",
@@ -1532,6 +1579,17 @@ var J = class {
1532
1579
  return console.error("[/copilot/actions]", e), Promise.reject(e);
1533
1580
  }
1534
1581
  };
1582
+ generate = async (e, t) => {
1583
+ try {
1584
+ return (await this.props.axiosApi.post("/copilot/generate", {
1585
+ authentication: this.authentication,
1586
+ opportunity_id: e,
1587
+ ...t !== void 0 && { model: t }
1588
+ })).data;
1589
+ } catch (e) {
1590
+ return console.error("[/copilot/generate]", e), Promise.reject(e);
1591
+ }
1592
+ };
1535
1593
  snooze = async (e) => {
1536
1594
  try {
1537
1595
  return (await this.props.axiosApi.post("/copilot/snooze", {
@@ -4313,4 +4371,4 @@ var J = class {
4313
4371
  //#endregion
4314
4372
  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
4373
 
4316
- //# sourceMappingURL=services-DoVB2Gol.js.map
4374
+ //# sourceMappingURL=services-2zqQa6zN.js.map