valtech-components 4.0.222 → 4.0.223

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.
@@ -26,7 +26,7 @@ export declare class LoadMoreComponent {
26
26
  readonly color: import("@angular/core").Signal<string>;
27
27
  readonly fill: import("@angular/core").Signal<string>;
28
28
  readonly shape: import("@angular/core").Signal<string>;
29
- readonly size: import("@angular/core").Signal<"small" | "default" | "large">;
29
+ readonly size: import("@angular/core").Signal<"default" | "small" | "large">;
30
30
  readonly threshold: import("@angular/core").Signal<string>;
31
31
  readonly label: import("@angular/core").Signal<string>;
32
32
  private readonly _pendingComplete;
@@ -93,7 +93,7 @@ export declare class ArticleComponent implements OnInit {
93
93
  contentInterpolation?: Record<string, string | number>;
94
94
  icon?: import("valtech-components").IconMetada;
95
95
  shape?: "round";
96
- size?: "small" | "default" | "large";
96
+ size?: "default" | "small" | "large";
97
97
  fill?: "default" | "clear" | "outline" | "solid";
98
98
  type: "reset" | "submit" | "button";
99
99
  token?: string;
@@ -33,12 +33,17 @@ export declare class ConversationService {
33
33
  private get baseUrl();
34
34
  /**
35
35
  * Crea una nueva conversacion.
36
+ * El backend responde con un envelope { operationId, conversation } — lo
37
+ * desenvolvemos para devolver la Conversation directa.
36
38
  */
37
39
  createConversation(req: CreateConversationRequest): Observable<Conversation>;
38
40
  /**
39
- * Obtiene o crea una conversacion asociada a una entidad (post, request, etc.).
41
+ * Obtiene o crea una conversacion asociada a una entidad (post, request, org, etc.).
40
42
  * Usa el patron upsert del backend: si ya existe una conversacion para esa entidad,
41
43
  * la devuelve; si no, la crea.
44
+ *
45
+ * El backend espera { entityRef: { type, id }, type } y responde con un envelope
46
+ * { operationId, conversation, created }.
42
47
  */
43
48
  getOrCreateForEntity(entityType: string, entityId: string, type?: ConversationType): Observable<Conversation>;
44
49
  /**
@@ -50,7 +55,7 @@ export declare class ConversationService {
50
55
  */
51
56
  getConversation(convId: string): Observable<Conversation>;
52
57
  /**
53
- * Actualiza el titulo o estado de una conversacion.
58
+ * Actualiza el nombre o settings de una conversacion.
54
59
  */
55
60
  updateConversation(convId: string, req: UpdateConversationRequest): Observable<Conversation>;
56
61
  /**
@@ -7,45 +7,66 @@
7
7
  * /apps/{appId}/orgs/{orgId}/conversations/{convId}/typing/{userId}
8
8
  */
9
9
  import { FirestoreDocument } from '../firebase/types';
10
- /** Tipo de conversacion. */
11
- export type ConversationType = 'direct' | 'group' | 'entity';
12
- /** Estado de una conversacion. */
13
- export type ConversationStatus = 'open' | 'closed';
14
- /** Participante de una conversacion. */
15
- export interface ConversationParticipant {
16
- /** ID del usuario. */
17
- userId: string;
18
- /** Nombre visible del usuario. */
19
- displayName: string;
20
- /** URL del avatar del usuario (opcional). */
21
- avatarUrl?: string;
22
- /** Fecha en que se unio a la conversacion. */
23
- joinedAt: Date;
24
- /** Ultimo mensaje leido por este participante. */
25
- lastReadMsgId?: string;
10
+ /**
11
+ * Tipo de conversacion. Debe coincidir con el backend (services/conversation):
12
+ * thread = comentarios en entidad · group = canal grupal · dm = 1:1 directo.
13
+ */
14
+ export type ConversationType = 'thread' | 'group' | 'dm';
15
+ /** Visibilidad de una conversacion (quien puede unirse). */
16
+ export type ConvVisibility = 'org' | 'private' | 'public' | '';
17
+ /** Vinculo de la conversacion con una entidad del dominio. */
18
+ export interface EntityRef {
19
+ /** Tipo de entidad ('post' | 'request' | 'org' | 'custom', etc.). */
20
+ type: string;
21
+ /** ID de la entidad. */
22
+ id: string;
23
+ }
24
+ /** Configuracion de la conversacion. */
25
+ export interface ConvSettings {
26
+ /** Si la conversacion esta abierta para enviar mensajes. */
27
+ isOpen: boolean;
28
+ /** Quien puede unirse. */
29
+ visibility: ConvVisibility;
30
+ /** Si admite participantes anonimos. */
31
+ allowAnonymous: boolean;
32
+ /** Si requiere membresia de la org. */
33
+ requireMembership: boolean;
34
+ /** Maximo de participantes (0 = sin limite). */
35
+ maxParticipants: number;
26
36
  }
27
- /** Documento de conversacion en Firestore. */
28
- export interface Conversation extends FirestoreDocument {
37
+ /**
38
+ * Documento de conversacion. Refleja el contrato del backend
39
+ * (services/conversation/types.go) — la fuente de verdad es DynamoDB y el doc se
40
+ * proyecta a Firestore para las reglas de membresia. Por eso los campos son
41
+ * `convId`/`name`/`participants: string[]` y NO el shape antiguo.
42
+ */
43
+ export interface Conversation {
44
+ /** ID de la conversacion. */
45
+ convId: string;
29
46
  /** Tipo de conversacion. */
30
47
  type: ConversationType;
31
- /** Estado de la conversacion. */
32
- status: ConversationStatus;
33
- /** Participantes. */
34
- participants: ConversationParticipant[];
35
- /** Tipo de entidad asociada (para tipo entity). */
36
- entityType?: string;
37
- /** ID de la entidad asociada. */
38
- entityId?: string;
39
- /** Titulo de la conversacion (para grupos). */
40
- title?: string;
41
- /** ID del ultimo mensaje. */
42
- lastMsgId?: string;
43
- /** Texto del ultimo mensaje (preview). */
44
- lastMsgBody?: string;
45
- /** Fecha del ultimo mensaje. */
46
- lastMsgAt?: Date;
47
- /** Conteo de mensajes no leidos por userId. */
48
- unreadCount?: Record<string, number>;
48
+ /** ID de la app. */
49
+ appId: string;
50
+ /** ID de la org. */
51
+ orgId: string;
52
+ /** Nombre de la conversacion (para grupos). */
53
+ name?: string;
54
+ /** Entidad asociada (para tipo thread). */
55
+ entityRef?: EntityRef;
56
+ /** IDs de los participantes. */
57
+ participants: string[];
58
+ /** Configuracion. */
59
+ settings: ConvSettings;
60
+ /** ID del usuario que la creo. */
61
+ createdBy: string;
62
+ /** Fecha de creacion (ISO string). */
63
+ createdAt: string;
64
+ /** Fecha de ultima actualizacion (ISO string). */
65
+ updatedAt: string;
66
+ /** Fecha del ultimo mensaje (ISO string). */
67
+ lastMsgAt?: string;
68
+ /** Preview del ultimo mensaje. */
69
+ lastMsgPreview?: string;
49
70
  }
50
71
  /** Tipo de mensaje. */
51
72
  export type MessageType = 'text' | 'image' | 'file' | 'system';
@@ -118,28 +139,37 @@ export interface TypingDocument extends FirestoreDocument {
118
139
  export interface CreateConversationRequest {
119
140
  /** Tipo de conversacion. */
120
141
  type: ConversationType;
121
- /** IDs de los participantes iniciales. */
122
- participantIds?: string[];
123
- /** Para tipo entity: tipo de la entidad. */
124
- entityType?: string;
125
- /** Para tipo entity: ID de la entidad. */
126
- entityId?: string;
127
- /** Titulo (para grupos). */
128
- title?: string;
142
+ /** Nombre (para grupos). */
143
+ name?: string;
144
+ /** Entidad asociada (para tipo thread). */
145
+ entityRef?: EntityRef;
146
+ /** IDs de los participantes iniciales (ademas del creador). */
147
+ participants?: string[];
148
+ /** Configuracion inicial. */
149
+ settings?: Partial<ConvSettings>;
129
150
  }
130
151
  /** Request para actualizar una conversacion. */
131
152
  export interface UpdateConversationRequest {
132
- /** Nuevo titulo (opcional). */
133
- title?: string;
134
- /** Nuevo estado (opcional). */
135
- status?: ConversationStatus;
153
+ /** Nuevo nombre (opcional). */
154
+ name?: string;
155
+ /** Nueva configuracion (opcional). */
156
+ settings?: Partial<ConvSettings>;
157
+ }
158
+ /** Response que envuelve una sola conversacion (create / get / update / get-or-create). */
159
+ export interface ConversationResponse {
160
+ /** ID de operacion para tracing. */
161
+ operationId: string;
162
+ /** La conversacion. */
163
+ conversation: Conversation;
164
+ /** Si fue creada en esta llamada (solo get-or-create). */
165
+ created?: boolean;
136
166
  }
137
167
  /** Response de listado de conversaciones. */
138
168
  export interface ListConversationsResponse {
169
+ /** ID de operacion para tracing. */
170
+ operationId: string;
139
171
  /** Lista de conversaciones. */
140
172
  conversations: Conversation[];
141
173
  /** Cursor para paginacion. */
142
174
  nextCursor?: string;
143
- /** Si hay mas paginas. */
144
- hasMore: boolean;
145
175
  }
package/lib/version.d.ts CHANGED
@@ -2,4 +2,4 @@
2
2
  * Current version of valtech-components.
3
3
  * This is automatically updated during the publish process.
4
4
  */
5
- export declare const VERSION = "4.0.222";
5
+ export declare const VERSION = "4.0.223";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valtech-components",
3
- "version": "4.0.222",
3
+ "version": "4.0.223",
4
4
  "private": false,
5
5
  "bin": {
6
6
  "valtech-firebase-config": "./src/lib/services/firebase/scripts/generate-sw-config.js"