valtech-components 4.0.22 → 4.0.24

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.
Files changed (28) hide show
  1. package/esm2022/lib/components/molecules/check-input/check-input.component.mjs +3 -3
  2. package/esm2022/lib/components/molecules/select-input/select-input.component.mjs +3 -3
  3. package/esm2022/lib/components/organisms/create-org-modal/create-org-modal.component.mjs +14 -9
  4. package/esm2022/lib/components/organisms/edit-org-modal/edit-org-modal.component.mjs +14 -9
  5. package/esm2022/lib/components/organisms/form/form.component.mjs +3 -3
  6. package/esm2022/lib/components/organisms/invite-member-modal/invite-member-modal.component.mjs +15 -3
  7. package/esm2022/lib/components/organisms/member-detail-modal/member-detail-modal.component.mjs +15 -3
  8. package/esm2022/lib/components/organisms/member-import-modal/member-import-modal.component.mjs +15 -3
  9. package/esm2022/lib/components/organisms/organization-view/organization-view.component.mjs +19 -1
  10. package/esm2022/lib/components/organisms/transfer-ownership-modal/transfer-ownership-modal.component.mjs +16 -6
  11. package/esm2022/lib/services/app-version/app-version.service.mjs +69 -44
  12. package/esm2022/lib/services/app-version/config.mjs +61 -19
  13. package/esm2022/lib/services/app-version/index.mjs +2 -2
  14. package/esm2022/lib/services/app-version/types.mjs +1 -1
  15. package/esm2022/lib/services/org/types.mjs +1 -1
  16. package/esm2022/lib/version.mjs +2 -2
  17. package/fesm2022/valtech-components.mjs +230 -92
  18. package/fesm2022/valtech-components.mjs.map +1 -1
  19. package/lib/components/organisms/article/article.component.d.ts +2 -2
  20. package/lib/components/organisms/landing-steps/landing-steps.component.d.ts +1 -1
  21. package/lib/components/organisms/organization-view/organization-view.component.d.ts +1 -0
  22. package/lib/services/app-version/app-version.service.d.ts +15 -8
  23. package/lib/services/app-version/config.d.ts +30 -16
  24. package/lib/services/app-version/index.d.ts +1 -1
  25. package/lib/services/app-version/types.d.ts +34 -0
  26. package/lib/services/org/types.d.ts +2 -0
  27. package/lib/version.d.ts +1 -1
  28. package/package.json +1 -1
@@ -91,8 +91,8 @@ export declare class ArticleComponent implements OnInit {
91
91
  contentInterpolation?: Record<string, string | number>;
92
92
  icon?: import("valtech-components").IconMetada;
93
93
  shape?: "round";
94
- size?: "default" | "small" | "large";
95
- fill?: "default" | "clear" | "outline" | "solid";
94
+ size?: "small" | "default" | "large";
95
+ fill?: "outline" | "solid" | "default" | "clear";
96
96
  type: "reset" | "submit" | "button";
97
97
  token?: string;
98
98
  ref?: any;
@@ -4,7 +4,7 @@ export declare class LandingStepsComponent {
4
4
  private readonly props_;
5
5
  set props(v: LandingStepsMetadata);
6
6
  readonly p: import("@angular/core").Signal<LandingStepsMetadata>;
7
- readonly cols: import("@angular/core").Signal<2 | 3 | 4>;
7
+ readonly cols: import("@angular/core").Signal<2 | 4 | 3>;
8
8
  readonly accentColor: import("@angular/core").Signal<string>;
9
9
  static ɵfac: i0.ɵɵFactoryDeclaration<LandingStepsComponent, never>;
10
10
  static ɵcmp: i0.ɵɵComponentDeclaration<LandingStepsComponent, "val-landing-steps", never, { "props": { "alias": "props"; "required": false; }; }, {}, never, never, true, never>;
@@ -103,6 +103,7 @@ export declare class OrganizationViewComponent {
103
103
  private enrichWithProfiles;
104
104
  loadRoles(): void;
105
105
  roleLabel(roleIdOrName: string): string;
106
+ private mergeRoleDisplayNames;
106
107
  onViewMember(member: MemberDetail): void;
107
108
  protected tt(key: string): string;
108
109
  static ɵfac: i0.ɵɵFactoryDeclaration<OrganizationViewComponent, never>;
@@ -9,10 +9,14 @@ export declare class AppVersionService {
9
9
  private readonly serviceConfig;
10
10
  /** Plugin nativo opcional: provisto por apps Capacitor para Play Store / App Store. */
11
11
  private readonly platformPlugin;
12
+ /** Plugin HTTP opcional: alternativa a AppConfigService para apps sin Firebase. */
13
+ private readonly remotePlugin;
12
14
  private readonly document;
13
15
  private readonly destroyRef;
14
16
  /** True cuando el SW reportó un bundle nuevo listo (`VERSION_READY`). */
15
17
  private readonly swUpdateReady;
18
+ /** Config remota cargada por el plugin HTTP. Null hasta que carga o si no hay plugin. */
19
+ private readonly remoteConfig;
16
20
  /**
17
21
  * True cuando el usuario descartó el banner de actualización opcional.
18
22
  * El banner obligatorio (`update-required`) ignora este flag.
@@ -25,16 +29,14 @@ export declare class AppVersionService {
25
29
  */
26
30
  readonly currentVersion: Signal<string>;
27
31
  /**
28
- * Última versión publicada según el config remoto.
29
- * `null` si `AppConfigService` no está disponible o aún no cargó.
32
+ * Última versión publicada según el config remoto (AppConfigService o plugin HTTP).
33
+ * `null` si ninguna fuente está disponible o aún no cargó.
30
34
  */
31
35
  readonly latestVersion: Signal<string | null>;
32
36
  /**
33
37
  * Estado de la versión:
34
- * - `update-required` — la versión local quedó por debajo de `minVersion`
35
- * del config remoto. Hard gate. Solo si `AppConfigService` tiene datos.
36
- * - `update-available` — el SW descargó un bundle nuevo (`VERSION_READY`)
37
- * o `AppConfigService.hasUpdate` es true.
38
+ * - `update-required` — la versión local quedó por debajo de `minVersion`. Hard gate.
39
+ * - `update-available` SW bundle listo, AppConfigService o plugin HTTP detectaron versión nueva.
38
40
  * - `up-to-date` — en cualquier otro caso.
39
41
  */
40
42
  readonly status: Signal<AppVersionStatus>;
@@ -52,8 +54,7 @@ export declare class AppVersionService {
52
54
  */
53
55
  dismiss(): void;
54
56
  /**
55
- * Fuerza un chequeo de actualización del service worker.
56
- * No-op si el SW no está habilitado.
57
+ * Fuerza un chequeo: SW + plugin HTTP (si existe).
57
58
  */
58
59
  checkNow(): Promise<void>;
59
60
  /**
@@ -61,6 +62,12 @@ export declare class AppVersionService {
61
62
  * volver la app a foreground. Solo actúa si el SW está habilitado.
62
63
  */
63
64
  private wireServiceWorker;
65
+ /**
66
+ * Carga config remota via plugin HTTP al inicio, en foreground y en el intervalo periódico.
67
+ * Solo se llama si `remotePlugin` está provisto.
68
+ */
69
+ private wireRemotePlugin;
70
+ private loadRemoteConfig;
64
71
  static ɵfac: i0.ɵɵFactoryDeclaration<AppVersionService, never>;
65
72
  static ɵprov: i0.ɵɵInjectableDeclaration<AppVersionService>;
66
73
  }
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * AppVersion Provider
3
3
  *
4
- * Provider e injection token para el servicio de verificación de versión.
4
+ * Provider e injection tokens para el servicio de verificación de versión.
5
5
  */
6
6
  import { EnvironmentProviders, InjectionToken } from '@angular/core';
7
- import { AppVersionPlatformPlugin, AppVersionServiceConfig } from './types';
7
+ import { AppVersionHttpConfig, AppVersionPlatformPlugin, AppVersionRemotePlugin, AppVersionServiceConfig } from './types';
8
8
  /**
9
9
  * Token de inyección para la configuración de AppVersionService.
10
10
  */
@@ -14,27 +14,41 @@ export declare const VALTECH_APP_VERSION: InjectionToken<Required<AppVersionServ
14
14
  * Provisto opcionalmente por apps que corren en iOS/Android vía Capacitor.
15
15
  */
16
16
  export declare const APP_VERSION_PLATFORM_PLUGIN: InjectionToken<AppVersionPlatformPlugin>;
17
+ /**
18
+ * Token de inyección para el plugin de config remota vía HTTP.
19
+ * Alternativa a AppConfigService (Firestore) para apps sin Firebase.
20
+ */
21
+ export declare const APP_VERSION_REMOTE_PLUGIN: InjectionToken<AppVersionRemotePlugin>;
17
22
  /**
18
23
  * Provee el servicio de verificación de versión a la aplicación Angular.
19
24
  *
20
- * Detecta cuándo hay una versión nueva de la app combinando dos señales:
21
- * - `SwUpdate` (PWA service worker) — bundle nuevo descargado y listo.
22
- * - `AppConfigService` (config remoto en Firestore) — `version` / `minVersion`.
25
+ * @param config - `currentVersion` obligatorio (normalmente desde `package.json`).
26
+ *
27
+ * @example
28
+ * ```typescript
29
+ * provideValtechAppVersion({ currentVersion: pkg.version })
30
+ * ```
31
+ */
32
+ export declare function provideValtechAppVersion(config: AppVersionServiceConfig): EnvironmentProviders;
33
+ /**
34
+ * Provee config remota de versiones vía HTTP, como alternativa a AppConfigService (Firestore).
23
35
  *
24
- * @param config - Configuración del servicio. `currentVersion` es obligatorio.
25
- * @returns EnvironmentProviders para usar en bootstrapApplication.
36
+ * El endpoint debe retornar `{ version, minVersion? }` o se puede usar `mapResponse`
37
+ * para adaptar un response existente con otra forma.
26
38
  *
27
39
  * @example
28
40
  * ```typescript
29
- * // main.ts
30
- * import { provideValtechAppVersion } from 'valtech-components';
31
- * import pkg from '../package.json';
41
+ * // main.ts — endpoint ya compatible
42
+ * provideValtechAppVersionHttp({ url: `${env.apiUrl}api/app-version` })
32
43
  *
33
- * bootstrapApplication(AppComponent, {
34
- * providers: [
35
- * provideValtechAppVersion({ currentVersion: pkg.version }),
36
- * ],
37
- * });
44
+ * // main.ts — adaptar endpoint existente { android, web, minVersion }
45
+ * provideValtechAppVersionHttp({
46
+ * url: `${env.apiUrl}api/version`,
47
+ * mapResponse: (data: any) => ({
48
+ * version: Capacitor.isNativePlatform() ? data.android : (data.web ?? data.android),
49
+ * minVersion: data.minVersion,
50
+ * }),
51
+ * })
38
52
  * ```
39
53
  */
40
- export declare function provideValtechAppVersion(config: AppVersionServiceConfig): EnvironmentProviders;
54
+ export declare function provideValtechAppVersionHttp(config: AppVersionHttpConfig): EnvironmentProviders;
@@ -19,5 +19,5 @@
19
19
  * ```
20
20
  */
21
21
  export * from './types';
22
- export { VALTECH_APP_VERSION, APP_VERSION_PLATFORM_PLUGIN, provideValtechAppVersion } from './config';
22
+ export { VALTECH_APP_VERSION, APP_VERSION_PLATFORM_PLUGIN, APP_VERSION_REMOTE_PLUGIN, provideValtechAppVersion, provideValtechAppVersionHttp, } from './config';
23
23
  export { AppVersionService } from './app-version.service';
@@ -53,3 +53,37 @@ export declare const DEFAULT_APP_VERSION_SERVICE_CONFIG: Required<AppVersionServ
53
53
  export interface AppVersionPlatformPlugin {
54
54
  applyUpdate(): Promise<void>;
55
55
  }
56
+ /**
57
+ * Config remota de versiones retornada por el plugin HTTP o AppConfigService.
58
+ *
59
+ * Contrato mínimo esperado del endpoint:
60
+ * ```
61
+ * GET /api/version
62
+ * { "version": "1.2.3", "minVersion": "1.0.0" }
63
+ * ```
64
+ * Si el response tiene otra forma, usar `mapResponse` en `provideValtechAppVersionHttp`.
65
+ */
66
+ export interface AppVersionRemoteConfig {
67
+ version: string;
68
+ minVersion?: string;
69
+ }
70
+ /**
71
+ * Plugin de config remota para apps sin Firebase/Firestore.
72
+ *
73
+ * Implementado por la app consumidora (o generado con `provideValtechAppVersionHttp`)
74
+ * y provisto via `APP_VERSION_REMOTE_PLUGIN`.
75
+ */
76
+ export interface AppVersionRemotePlugin {
77
+ getRemoteConfig(): Promise<AppVersionRemoteConfig>;
78
+ }
79
+ /**
80
+ * Configuración para `provideValtechAppVersionHttp`.
81
+ *
82
+ * @property url - URL del endpoint de versiones.
83
+ * @property mapResponse - Transforma el response de la API al contrato estándar.
84
+ * Útil cuando el endpoint existente tiene otra forma (ej. `{ android, web }`).
85
+ */
86
+ export interface AppVersionHttpConfig {
87
+ url: string;
88
+ mapResponse?: (data: unknown) => AppVersionRemoteConfig;
89
+ }
@@ -58,6 +58,8 @@ export interface ListOrgMembersResponse {
58
58
  members: OrgMember[];
59
59
  nextToken?: string;
60
60
  count: number;
61
+ /** Backend SSOT para labels de roles en la respuesta (ADR-024 Phase 2). */
62
+ roleDisplayNames?: Record<string, Record<string, string>>;
61
63
  }
62
64
  export interface PendingInvitation {
63
65
  orgId: string;
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.22";
5
+ export declare const VERSION = "4.0.24";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valtech-components",
3
- "version": "4.0.22",
3
+ "version": "4.0.24",
4
4
  "private": false,
5
5
  "bin": {
6
6
  "valtech-firebase-config": "./src/lib/services/firebase/scripts/generate-sw-config.js"