sass-cms-template-common 0.0.24 → 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 +62 -2
- package/dist/index.js +10 -9
- package/dist/index.js.map +1 -1
- package/dist/server.d.ts +58 -0
- package/dist/server.js +1 -1
- package/dist/{services-xDvlUc4t.js → services-ByTYzguw.js} +40 -1
- package/dist/services-ByTYzguw.js.map +1 -0
- package/package.json +1 -1
- package/dist/services-xDvlUc4t.js.map +0 -1
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-
|
|
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 };
|
|
@@ -226,6 +226,7 @@ var r = t("", {
|
|
|
226
226
|
pill: "999px"
|
|
227
227
|
}, o = {
|
|
228
228
|
button: "0 1px 2px rgba(0, 0, 0, 0.10)",
|
|
229
|
+
buttonSoft: "0 1px 2px rgba(0, 0, 0, 0.06)",
|
|
229
230
|
menu: "0px 1px 3px 0px rgba(0, 0, 0, 0.30), 0px 4px 8px 3px rgba(0, 0, 0, 0.15)",
|
|
230
231
|
menuSoft: "0 10px 30px rgba(0, 0, 0, 0.18)",
|
|
231
232
|
accountMenu: "0 10px 30px rgba(25, 28, 32, 0.18)",
|
|
@@ -400,6 +401,14 @@ var r = t("", {
|
|
|
400
401
|
assignBtnHover: {
|
|
401
402
|
light: "#C2CCE6",
|
|
402
403
|
dark: "#35507F"
|
|
404
|
+
},
|
|
405
|
+
generateBtn: {
|
|
406
|
+
light: "#2962FF",
|
|
407
|
+
dark: "#2962FF"
|
|
408
|
+
},
|
|
409
|
+
generateBtnHover: {
|
|
410
|
+
light: "#1D49C4",
|
|
411
|
+
dark: "#1D49C4"
|
|
403
412
|
}
|
|
404
413
|
}), g = h.values, _ = {
|
|
405
414
|
high: {
|
|
@@ -448,6 +457,10 @@ var r = t("", {
|
|
|
448
457
|
light: "#0F9D58",
|
|
449
458
|
dark: "#34C77B"
|
|
450
459
|
},
|
|
460
|
+
ga4: {
|
|
461
|
+
light: "#E8710A",
|
|
462
|
+
dark: "#F0A45E"
|
|
463
|
+
},
|
|
451
464
|
x: {
|
|
452
465
|
light: "#111111",
|
|
453
466
|
dark: "#E1E2E9"
|
|
@@ -542,6 +555,9 @@ var b = {
|
|
|
542
555
|
"008.004": "The note does not exist",
|
|
543
556
|
"008.005": "The scheduled publication date must be in the future",
|
|
544
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",
|
|
545
561
|
"008.012": "Error getting XSD definition",
|
|
546
562
|
"008.013": "Failed to unlock note on exit",
|
|
547
563
|
"008.014": "Note locked by someone else",
|
|
@@ -563,6 +579,8 @@ var b = {
|
|
|
563
579
|
"030.005": "The writer to assign is missing",
|
|
564
580
|
"030.006": "The Copilot service does not exist at the configured address",
|
|
565
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",
|
|
566
584
|
"999.000": "The request does not have the expected format",
|
|
567
585
|
"999.001a": "The request has an error that was not captured. Contact your Administrator and detail the steps you followed",
|
|
568
586
|
"999.002a": "An error occurred in the service",
|
|
@@ -637,6 +655,9 @@ var b = {
|
|
|
637
655
|
"008.004": "La nota no existe",
|
|
638
656
|
"008.005": "La fecha de publicación programada debe ser en el futuro",
|
|
639
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",
|
|
640
661
|
"008.012": "Error al obtener definición del XSD",
|
|
641
662
|
"008.013": "Error al desbloquear la nota en el exit",
|
|
642
663
|
"008.014": "Nota bloqueada por otra persona",
|
|
@@ -658,6 +679,8 @@ var b = {
|
|
|
658
679
|
"030.005": "Falta el redactor a asignar",
|
|
659
680
|
"030.006": "El servicio Copilot no existe en la dirección configurada",
|
|
660
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",
|
|
661
684
|
"999.000": "El requerimiento no cuenta con el formato esperado",
|
|
662
685
|
"999.001a": "El requerimiento tiene un error que no se capturó. Comuniquese con su Administrador y detalle los pasos que siguió",
|
|
663
686
|
"999.002a": "Se produjo un error en el servicio",
|
|
@@ -732,6 +755,9 @@ var b = {
|
|
|
732
755
|
"008.004": "A nota não existe",
|
|
733
756
|
"008.005": "A data de publicação programada deve ser futura",
|
|
734
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",
|
|
735
761
|
"008.012": "Erro ao obter definição XSD",
|
|
736
762
|
"008.013": "Falha ao desbloquear nota ao sair",
|
|
737
763
|
"008.014": "Nota bloqueada por outra pessoa",
|
|
@@ -753,6 +779,8 @@ var b = {
|
|
|
753
779
|
"030.005": "Falta o redator a atribuir",
|
|
754
780
|
"030.006": "O serviço Copilot não existe no endereço configurado",
|
|
755
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",
|
|
756
784
|
"999.000": "A solicitação não tem o formato esperado",
|
|
757
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",
|
|
758
786
|
"999.002a": "Ocorreu um erro no serviço",
|
|
@@ -1523,6 +1551,17 @@ var J = class {
|
|
|
1523
1551
|
return console.error("[/copilot/actions]", e), Promise.reject(e);
|
|
1524
1552
|
}
|
|
1525
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
|
+
};
|
|
1526
1565
|
snooze = async (e) => {
|
|
1527
1566
|
try {
|
|
1528
1567
|
return (await this.props.axiosApi.post("/copilot/snooze", {
|
|
@@ -4304,4 +4343,4 @@ var J = class {
|
|
|
4304
4343
|
//#endregion
|
|
4305
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 };
|
|
4306
4345
|
|
|
4307
|
-
//# sourceMappingURL=services-
|
|
4346
|
+
//# sourceMappingURL=services-ByTYzguw.js.map
|