valtech-components 4.0.245 → 4.0.247

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<"default" | "small" | "large">;
29
+ readonly size: import("@angular/core").Signal<"small" | "default" | "large">;
30
30
  readonly threshold: import("@angular/core").Signal<string>;
31
31
  readonly label: import("@angular/core").Signal<string>;
32
32
  private readonly _pendingComplete;
@@ -0,0 +1,24 @@
1
+ export interface UsageMetric {
2
+ /** Clave de la métrica (ej. "emails_month"). */
3
+ key: string;
4
+ /** Etiqueta visible ya resuelta por el consumer (ej. "Emails / mes"). */
5
+ label: string;
6
+ /** Consumo del período. */
7
+ used: number;
8
+ /** Tope; -1 = ilimitado. */
9
+ limit: number;
10
+ /** true si el tope es ilimitado (-1). */
11
+ unlimited: boolean;
12
+ }
13
+ export interface UsageMetersMetadata {
14
+ /** Título de la sección (opcional). */
15
+ title?: string;
16
+ /** Nombre de la app a la que pertenece este bloque (para vista multi-app). */
17
+ appName?: string;
18
+ /** Tier del plan, para mostrar como badge (ej. "Pro"). */
19
+ plan?: string;
20
+ /** Período (ej. "2026-06"). */
21
+ period?: string;
22
+ /** Métricas a mostrar. */
23
+ metrics: UsageMetric[];
24
+ }
@@ -0,0 +1,26 @@
1
+ import { UsageMetersMetadata } from './types';
2
+ import * as i0 from "@angular/core";
3
+ interface MeterRow {
4
+ key: string;
5
+ label: string;
6
+ usedLabel: string;
7
+ pct: number;
8
+ unlimited: boolean;
9
+ over: boolean;
10
+ }
11
+ /**
12
+ * val-usage-meters — bloque de consumo (uso vs tope por métrica) para el
13
+ * dashboard de monetización (ADR-046 D3). Presentacional: recibe los datos ya
14
+ * resueltos (UsageService los arma desde Firestore). Reutilizable single-app o
15
+ * por sección en multi-app (myvaltech account).
16
+ */
17
+ export declare class UsageMetersComponent {
18
+ private i18n;
19
+ readonly props: import("@angular/core").InputSignal<UsageMetersMetadata>;
20
+ constructor();
21
+ readonly rows: import("@angular/core").Signal<MeterRow[]>;
22
+ t(key: string): string;
23
+ static ɵfac: i0.ɵɵFactoryDeclaration<UsageMetersComponent, never>;
24
+ static ɵcmp: i0.ɵɵComponentDeclaration<UsageMetersComponent, "val-usage-meters", never, { "props": { "alias": "props"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
25
+ }
26
+ export {};
@@ -93,9 +93,9 @@ 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?: "default" | "small" | "large";
96
+ size?: "small" | "default" | "large";
97
97
  fill?: "default" | "clear" | "outline" | "solid";
98
- type: "reset" | "submit" | "button";
98
+ type: "button" | "reset" | "submit";
99
99
  token?: string;
100
100
  ref?: any;
101
101
  handler?: (value: any) => any;
@@ -35,6 +35,9 @@ export declare class ChatWindowComponent {
35
35
  readonly isOpen: import("@angular/core").InputSignal<boolean>;
36
36
  readonly typingUsers: import("@angular/core").InputSignal<string[]>;
37
37
  readonly isLoading: import("@angular/core").InputSignal<boolean>;
38
+ /** Muestra el botón de mensaje de voz (grabar clip). El dictado voz→texto va
39
+ * siempre. Default false (apps lo activan donde el transcode esté disponible). */
40
+ readonly showVoiceMessage: import("@angular/core").InputSignal<boolean>;
38
41
  readonly sendMessage: import("@angular/core").OutputEmitterRef<ChatComposerSendEvent>;
39
42
  readonly loadMore: import("@angular/core").OutputEmitterRef<void>;
40
43
  readonly reactionClick: import("@angular/core").OutputEmitterRef<{
@@ -50,7 +53,7 @@ export declare class ChatWindowComponent {
50
53
  protected readonly replyingTo: import("@angular/core").WritableSignal<MessageReplyTo>;
51
54
  protected readonly atBottom: import("@angular/core").WritableSignal<boolean>;
52
55
  protected readonly hasNew: import("@angular/core").WritableSignal<boolean>;
53
- protected readonly locale: import("@angular/core").Signal<"es-CL" | "en-US">;
56
+ protected readonly locale: import("@angular/core").Signal<"en-US" | "es-CL">;
54
57
  constructor();
55
58
  protected readonly rows: import("@angular/core").Signal<ChatRow[]>;
56
59
  protected onScroll(): void;
@@ -59,6 +62,6 @@ export declare class ChatWindowComponent {
59
62
  protected onAction(event: MessageBubbleAction): void;
60
63
  t(key: string): string;
61
64
  static ɵfac: i0.ɵɵFactoryDeclaration<ChatWindowComponent, never>;
62
- static ɵcmp: i0.ɵɵComponentDeclaration<ChatWindowComponent, "val-chat-window", never, { "convId": { "alias": "convId"; "required": false; "isSignal": true; }; "messages": { "alias": "messages"; "required": false; "isSignal": true; }; "currentUserId": { "alias": "currentUserId"; "required": false; "isSignal": true; }; "isOpen": { "alias": "isOpen"; "required": false; "isSignal": true; }; "typingUsers": { "alias": "typingUsers"; "required": false; "isSignal": true; }; "isLoading": { "alias": "isLoading"; "required": false; "isSignal": true; }; }, { "sendMessage": "sendMessage"; "loadMore": "loadMore"; "reactionClick": "reactionClick"; "deleteMessage": "deleteMessage"; "replyTo": "replyTo"; "editMessage": "editMessage"; "typing": "typing"; "voice": "voice"; }, never, never, true, never>;
65
+ static ɵcmp: i0.ɵɵComponentDeclaration<ChatWindowComponent, "val-chat-window", never, { "convId": { "alias": "convId"; "required": false; "isSignal": true; }; "messages": { "alias": "messages"; "required": false; "isSignal": true; }; "currentUserId": { "alias": "currentUserId"; "required": false; "isSignal": true; }; "isOpen": { "alias": "isOpen"; "required": false; "isSignal": true; }; "typingUsers": { "alias": "typingUsers"; "required": false; "isSignal": true; }; "isLoading": { "alias": "isLoading"; "required": false; "isSignal": true; }; "showVoiceMessage": { "alias": "showVoiceMessage"; "required": false; "isSignal": true; }; }, { "sendMessage": "sendMessage"; "loadMore": "loadMore"; "reactionClick": "reactionClick"; "deleteMessage": "deleteMessage"; "replyTo": "replyTo"; "editMessage": "editMessage"; "typing": "typing"; "voice": "voice"; }, never, never, true, never>;
63
66
  }
64
67
  export {};
@@ -28,7 +28,7 @@ export declare class MemberImportModalComponent implements OnInit {
28
28
  /** Namespace i18n. */
29
29
  i18nNamespace: string;
30
30
  csv: string;
31
- readonly importMode: import("@angular/core").WritableSignal<"paste" | "file">;
31
+ readonly importMode: import("@angular/core").WritableSignal<"file" | "paste">;
32
32
  readonly onConflictControl: FormControl<string>;
33
33
  readonly sendActivationControl: FormControl<boolean>;
34
34
  readonly conflictSelectProps: import("@angular/core").Signal<Partial<InputMetadata>>;
@@ -0,0 +1,25 @@
1
+ import { Observable } from 'rxjs';
2
+ import { UsageMetersMetadata } from '../../components/molecules/usage-meters/types';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * UsageService — lee el resumen de consumo (uso + límites + plan) en vivo desde
6
+ * Firestore y lo mapea a `UsageMetersMetadata` para `<val-usage-meters>`.
7
+ * (ADR-046 D3). Firestore es la fuente única (el backend proyecta usage+limits).
8
+ * Granular por app: `watch(appId, orgId)`. Multi-app: una suscripción por app.
9
+ */
10
+ export declare class UsageService {
11
+ private firestore;
12
+ private i18n;
13
+ constructor();
14
+ /** Período actual `YYYY-MM` (UTC), igual que el backend. */
15
+ currentPeriod(): string;
16
+ /**
17
+ * Observa el consumo de (org, app) en vivo. Lee el path absoluto
18
+ * `apps/{appId}/orgs/{orgId}/usage/{period}` (sin auto-prefix de la app actual,
19
+ * para soportar la vista multi-app desde account).
20
+ */
21
+ watch(appId: string, orgId: string, appName?: string, period?: string): Observable<UsageMetersMetadata>;
22
+ private toMetadata;
23
+ static ɵfac: i0.ɵɵFactoryDeclaration<UsageService, never>;
24
+ static ɵprov: i0.ɵɵInjectableDeclaration<UsageService>;
25
+ }
@@ -0,0 +1,47 @@
1
+ import { Observable } from 'rxjs';
2
+ import { ValtechAuthConfig } from '../auth/types';
3
+ import type { FirestoreDocument } from '../firebase/types';
4
+ import * as i0 from "@angular/core";
5
+ export type WorkflowStatus = 'RUNNING' | 'SUCCEEDED' | 'FAILED' | 'TIMED_OUT' | 'ABORTED';
6
+ /** Respuesta al arrancar un workflow (ADR-045). */
7
+ export interface WorkflowStartResult {
8
+ operationId: string;
9
+ workflow: string;
10
+ executionName: string;
11
+ executionArn: string;
12
+ status: 'RUNNING';
13
+ }
14
+ /**
15
+ * Estado de una ejecución de workflow proyectado a Firestore por el admin Lambda
16
+ * (apps/{appId}/orgs/{orgId}/workflows/{executionName}). Lo observa watch().
17
+ */
18
+ export interface WorkflowExecution extends FirestoreDocument {
19
+ name: string;
20
+ workflow: string;
21
+ executionArn: string;
22
+ status: WorkflowStatus;
23
+ appId: string;
24
+ orgId: string;
25
+ startedAt?: string;
26
+ stoppedAt?: string;
27
+ }
28
+ /**
29
+ * WorkflowService (ADR-045) — arranca state machines de Step Functions registradas
30
+ * y observa su ejecución en tiempo real (Firestore). Reusable por cualquier app.
31
+ *
32
+ * - start(name, input): dispara `POST /workflows/{name}/start` (el JWT lo inyecta
33
+ * el authInterceptor; orgId/appId se resuelven en el backend desde el contexto).
34
+ * - watch(executionName): onSnapshot del doc de estado, hasta SUCCEEDED/FAILED.
35
+ */
36
+ export declare class WorkflowService {
37
+ private config;
38
+ private http;
39
+ private auth;
40
+ private collections;
41
+ constructor(config: ValtechAuthConfig | null);
42
+ private get appIdHeader();
43
+ start(name: string, input?: Record<string, unknown>): Observable<WorkflowStartResult>;
44
+ watch(executionName: string): Observable<WorkflowExecution | null>;
45
+ static ɵfac: i0.ɵɵFactoryDeclaration<WorkflowService, [{ optional: true; }]>;
46
+ static ɵprov: i0.ɵɵInjectableDeclaration<WorkflowService>;
47
+ }
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.245";
5
+ export declare const VERSION = "4.0.247";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valtech-components",
3
- "version": "4.0.245",
3
+ "version": "4.0.247",
4
4
  "private": false,
5
5
  "bin": {
6
6
  "valtech-firebase-config": "./src/lib/services/firebase/scripts/generate-sw-config.js"
package/public-api.d.ts CHANGED
@@ -182,6 +182,9 @@ export * from './lib/components/molecules/media-object/media-object.component';
182
182
  export * from './lib/components/molecules/media-object/types';
183
183
  export * from './lib/components/molecules/stats-bar/stats-bar.component';
184
184
  export * from './lib/components/molecules/stats-bar/types';
185
+ export * from './lib/components/molecules/usage-meters/usage-meters.component';
186
+ export * from './lib/components/molecules/usage-meters/types';
187
+ export * from './lib/services/usage/usage.service';
185
188
  export * from './lib/components/molecules/article-card/article-card.component';
186
189
  export * from './lib/components/molecules/article-card/types';
187
190
  export * from './lib/components/molecules/cta-card/cta-card.component';
@@ -356,6 +359,7 @@ export * from './lib/services/download.service';
356
359
  export * from './lib/services/pdf/pdf.service';
357
360
  export * from './lib/services/pdf/types';
358
361
  export * from './lib/services/events/meta';
362
+ export * from './lib/services/workflows/workflow.service';
359
363
  export * from './lib/services/icons.service';
360
364
  export * from './lib/services/in-app-browser.service';
361
365
  export * from './lib/services/link-processor.service';