valtech-components 4.0.246 → 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.
- package/esm2022/lib/components/molecules/usage-meters/types.mjs +5 -0
- package/esm2022/lib/components/molecules/usage-meters/usage-meters.component.mjs +124 -0
- package/esm2022/lib/services/usage/usage.service.mjs +87 -0
- package/esm2022/lib/services/workflows/workflow.service.mjs +54 -0
- package/esm2022/lib/version.mjs +2 -2
- package/esm2022/public-api.mjs +5 -1
- package/fesm2022/valtech-components.mjs +255 -2
- package/fesm2022/valtech-components.mjs.map +1 -1
- package/lib/components/molecules/load-more/load-more.component.d.ts +1 -1
- package/lib/components/molecules/usage-meters/types.d.ts +24 -0
- package/lib/components/molecules/usage-meters/usage-meters.component.d.ts +26 -0
- package/lib/components/organisms/article/article.component.d.ts +2 -2
- package/lib/components/organisms/chat-window/chat-window.component.d.ts +1 -1
- package/lib/components/organisms/member-import-modal/member-import-modal.component.d.ts +1 -1
- package/lib/services/usage/usage.service.d.ts +25 -0
- package/lib/services/workflows/workflow.service.d.ts +47 -0
- package/lib/version.d.ts +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +4 -0
|
@@ -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<"
|
|
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?: "
|
|
96
|
+
size?: "small" | "default" | "large";
|
|
97
97
|
fill?: "default" | "clear" | "outline" | "solid";
|
|
98
|
-
type: "
|
|
98
|
+
type: "button" | "reset" | "submit";
|
|
99
99
|
token?: string;
|
|
100
100
|
ref?: any;
|
|
101
101
|
handler?: (value: any) => any;
|
|
@@ -53,7 +53,7 @@ export declare class ChatWindowComponent {
|
|
|
53
53
|
protected readonly replyingTo: import("@angular/core").WritableSignal<MessageReplyTo>;
|
|
54
54
|
protected readonly atBottom: import("@angular/core").WritableSignal<boolean>;
|
|
55
55
|
protected readonly hasNew: import("@angular/core").WritableSignal<boolean>;
|
|
56
|
-
protected readonly locale: import("@angular/core").Signal<"
|
|
56
|
+
protected readonly locale: import("@angular/core").Signal<"en-US" | "es-CL">;
|
|
57
57
|
constructor();
|
|
58
58
|
protected readonly rows: import("@angular/core").Signal<ChatRow[]>;
|
|
59
59
|
protected onScroll(): void;
|
|
@@ -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<"
|
|
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
package/package.json
CHANGED
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';
|