valtech-components 2.0.953 → 2.0.955
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/esm2022/lib/components/molecules/content-reaction/content-reaction.component.mjs +5 -3
- package/esm2022/lib/components/molecules/content-reaction/types.mjs +1 -1
- package/esm2022/lib/services/auth/auth.service.mjs +8 -1
- package/esm2022/lib/services/auth/types.mjs +1 -1
- package/esm2022/lib/services/content-platform/content.service.mjs +61 -1
- package/esm2022/lib/services/content-platform/types.mjs +1 -1
- package/esm2022/lib/version.mjs +2 -2
- package/fesm2022/valtech-components.mjs +71 -3
- package/fesm2022/valtech-components.mjs.map +1 -1
- package/lib/components/molecules/content-reaction/content-reaction.component.d.ts +1 -0
- package/lib/components/molecules/content-reaction/types.d.ts +7 -0
- package/lib/services/auth/types.d.ts +4 -0
- package/lib/services/content-platform/content.service.d.ts +33 -0
- package/lib/services/content-platform/types.d.ts +8 -0
- package/lib/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -41,6 +41,7 @@ export declare class ContentReactionComponent implements OnInit, OnChanges {
|
|
|
41
41
|
thankYouMessage: string;
|
|
42
42
|
disabled: boolean;
|
|
43
43
|
readonly: boolean;
|
|
44
|
+
variant: "buttons" | "emoji";
|
|
44
45
|
}>;
|
|
45
46
|
readonly activeReactionValues: import("@angular/core").Signal<ReactionValue[]>;
|
|
46
47
|
showCommentField: import("@angular/core").Signal<boolean>;
|
|
@@ -13,6 +13,13 @@ export interface ContentReactionMetadata {
|
|
|
13
13
|
commentPlaceholder?: string;
|
|
14
14
|
/** Máximo de caracteres del comentario (default: 500) */
|
|
15
15
|
maxCommentLength?: number;
|
|
16
|
+
/**
|
|
17
|
+
* Variante visual de los botones de reacción.
|
|
18
|
+
* - `'buttons'` (default): botones de texto redondeados ("Sí, mucho" / "No tanto").
|
|
19
|
+
* - `'emoji'`: iconos grandes configurables (caras, estrellas, thumbs, etc.).
|
|
20
|
+
* Pasar `emojis` implica `variant: 'emoji'` aunque no se declare explícitamente.
|
|
21
|
+
*/
|
|
22
|
+
variant?: 'buttons' | 'emoji';
|
|
16
23
|
/** Emojis personalizados [negative, neutral, positive] | [negative, positive] */
|
|
17
24
|
emojis?: [string, string, string] | [string, string];
|
|
18
25
|
/** Labels para emojis (accesibilidad) */
|
|
@@ -531,6 +531,10 @@ export interface SwitchOrgResponse {
|
|
|
531
531
|
operationId: string;
|
|
532
532
|
firebaseToken: string;
|
|
533
533
|
activeOrg: string;
|
|
534
|
+
/** Nuevo JWT con activeOrg actualizado. El FE lo almacena para que el
|
|
535
|
+
* bootstrap post-refresh use la org correcta en vez del JWT cacheado. */
|
|
536
|
+
accessToken?: string;
|
|
537
|
+
expiresIn?: number;
|
|
534
538
|
}
|
|
535
539
|
/** Tipos de eventos de sincronización entre pestañas */
|
|
536
540
|
export type AuthSyncEventType = 'LOGIN' | 'LOGOUT' | 'TOKEN_REFRESH' | 'PERMISSIONS_UPDATE' | 'ORG_SWITCH';
|
|
@@ -24,6 +24,7 @@ export declare class ContentService {
|
|
|
24
24
|
private readonly config;
|
|
25
25
|
private readonly http;
|
|
26
26
|
private readonly parser;
|
|
27
|
+
private readonly auth;
|
|
27
28
|
/** `true` si `provideValtechContent()` fue llamado en el bootstrap. */
|
|
28
29
|
readonly isConfigured: import("@angular/core").WritableSignal<boolean>;
|
|
29
30
|
/** Cache de las promesas de cada factory estática, keyed por locale. */
|
|
@@ -55,6 +56,28 @@ export declare class ContentService {
|
|
|
55
56
|
toArticle(doc: ContentDocument, config?: Partial<ArticleMetadata>): ArticleMetadata;
|
|
56
57
|
/** Limpia la cache de fuentes estáticas. Llamar al cambiar de locale en runtime. */
|
|
57
58
|
invalidate(): void;
|
|
59
|
+
/**
|
|
60
|
+
* Lista los documentos publicados de la org activa del usuario autenticado.
|
|
61
|
+
*
|
|
62
|
+
* Requiere sesión activa (`AuthService.isAuthenticated()`). El interceptor de
|
|
63
|
+
* auth agrega automáticamente `Authorization: Bearer {token}` a la request.
|
|
64
|
+
*
|
|
65
|
+
* @param type - Tipo de contenido (`'blog'`, `'news'`, …).
|
|
66
|
+
* @param options - `{ locale }` (default `'es'`).
|
|
67
|
+
* @returns Documentos de la org o `[]` si no hay config/sesión.
|
|
68
|
+
*/
|
|
69
|
+
listForOrg(type: ContentDocumentType, options?: ContentLoadOptions): Observable<ContentDocument[]>;
|
|
70
|
+
/**
|
|
71
|
+
* Carga un documento de la org activa del usuario autenticado por `slug`.
|
|
72
|
+
*
|
|
73
|
+
* Requiere sesión activa. El interceptor de auth agrega el Bearer token.
|
|
74
|
+
*
|
|
75
|
+
* @param type - Tipo de contenido.
|
|
76
|
+
* @param slug - Slug del documento.
|
|
77
|
+
* @param options - `{ locale }` (default `'es'`).
|
|
78
|
+
* @returns El documento o error si no se encuentra / no hay sesión.
|
|
79
|
+
*/
|
|
80
|
+
loadForOrg(type: ContentDocumentType, slug: string, options?: ContentLoadOptions): Observable<ContentDocument>;
|
|
58
81
|
/** Une estático + backend: estático gana por slug; orden por publishedAt desc. */
|
|
59
82
|
private merge;
|
|
60
83
|
/** Comparador: más reciente primero; sin `publishedAt` al final. */
|
|
@@ -65,6 +88,16 @@ export declare class ContentService {
|
|
|
65
88
|
private listBackend;
|
|
66
89
|
/** GET `{apiUrl}/v2/content/{type}/{locale}/{slug}` — detalle publicado. */
|
|
67
90
|
private loadBackend;
|
|
91
|
+
/**
|
|
92
|
+
* GET `{apiUrl}/v2/content/org?type=&locale=` — publicados de la org activa.
|
|
93
|
+
* El Bearer token lo añade el interceptor de auth automáticamente.
|
|
94
|
+
*/
|
|
95
|
+
private listBackendOrg;
|
|
96
|
+
/**
|
|
97
|
+
* GET `{apiUrl}/v2/content/org/{type}/{locale}/{slug}` — detalle de la org activa.
|
|
98
|
+
* El Bearer token lo añade el interceptor de auth automáticamente.
|
|
99
|
+
*/
|
|
100
|
+
private loadBackendOrg;
|
|
68
101
|
static ɵfac: i0.ɵɵFactoryDeclaration<ContentService, never>;
|
|
69
102
|
static ɵprov: i0.ɵɵInjectableDeclaration<ContentService>;
|
|
70
103
|
}
|
|
@@ -73,6 +73,14 @@ export interface ContentDocument {
|
|
|
73
73
|
status: ContentDocumentStatus;
|
|
74
74
|
/** Origen del documento (marca híbrida). */
|
|
75
75
|
source: ContentDocumentSource;
|
|
76
|
+
/**
|
|
77
|
+
* Alcance del documento.
|
|
78
|
+
* - `'app'`: contenido de la plataforma, visible a todos los users.
|
|
79
|
+
* - `'org'`: contenido privado de una organización, acceso autenticado.
|
|
80
|
+
*/
|
|
81
|
+
scope?: 'app' | 'org';
|
|
82
|
+
/** OrgID propietaria — presente cuando `scope === 'org'`. */
|
|
83
|
+
orgId?: string;
|
|
76
84
|
/** Fecha de publicación (ISO 8601). */
|
|
77
85
|
publishedAt?: string;
|
|
78
86
|
/** Fecha de creación (ISO 8601). */
|
package/lib/version.d.ts
CHANGED