valtech-components 2.0.947 → 2.0.948

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.
@@ -0,0 +1,28 @@
1
+ import { AppRequest, RequestTypeConfig } from './types';
2
+ import * as i0 from "@angular/core";
3
+ /**
4
+ * Lectura de Requests / RequestTypes desde Firestore (one-shot, sin listener).
5
+ *
6
+ * El backend proyecta DynamoDB → Firestore (réplica de solo-lectura); el cliente
7
+ * lee desde acá en vez de pegarle al REST, así no se expone un endpoint JSON
8
+ * replayable y el acceso queda gobernado por las security rules. Las mutaciones
9
+ * (create/update/transition) siguen yendo por `RequestService` (REST → backend).
10
+ *
11
+ * Los paths se prefijan automáticamente con `apps/{appId}/` (FirestoreService),
12
+ * resultando en:
13
+ * - apps/{appId}/users/{uid}/requests
14
+ * - apps/{appId}/orgs/{orgId}/requests
15
+ * - apps/{appId}/orgs/{orgId}/requestTypes
16
+ */
17
+ export declare class RequestFirestoreService {
18
+ private factory;
19
+ private read;
20
+ /** Solicitudes enviadas por el usuario (scope usuario). */
21
+ listMyRequests(userId: string): Promise<AppRequest[]>;
22
+ /** Solicitudes de la organización (scope staff). */
23
+ listOrgRequests(orgId: string): Promise<AppRequest[]>;
24
+ /** Catálogo de tipos de solicitud de la organización. */
25
+ listRequestTypes(orgId: string): Promise<RequestTypeConfig[]>;
26
+ static ɵfac: i0.ɵɵFactoryDeclaration<RequestFirestoreService, never>;
27
+ static ɵprov: i0.ɵɵInjectableDeclaration<RequestFirestoreService>;
28
+ }
@@ -48,6 +48,8 @@ export interface FieldSchemaDef {
48
48
  options?: FieldOption[];
49
49
  order: number;
50
50
  }
51
+ /** Quién puede leer un tipo de solicitud (y sus solicitudes públicas). */
52
+ export type RequestVisibility = 'PUBLIC' | 'ORG' | 'INTERNAL';
51
53
  export interface RequestTypeConfig {
52
54
  typeId: string;
53
55
  appId: string;
@@ -56,6 +58,8 @@ export interface RequestTypeConfig {
56
58
  labelEn: string;
57
59
  fieldSchema: FieldSchemaDef[];
58
60
  allowAnonymous: boolean;
61
+ /** PUBLIC: cualquiera · ORG/INTERNAL: solo miembros de la org. Default ORG. */
62
+ visibility?: RequestVisibility;
59
63
  createdAt: string;
60
64
  updatedAt: string;
61
65
  }
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 = "2.0.947";
5
+ export declare const VERSION = "2.0.948";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valtech-components",
3
- "version": "2.0.947",
3
+ "version": "2.0.948",
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
@@ -363,3 +363,4 @@ export { ValtechErrorService, VALTECH_NETWORK_ERROR_KEY, } from './lib/services/
363
363
  export * from './lib/services/requests/types';
364
364
  export * from './lib/services/requests/request.service';
365
365
  export * from './lib/services/requests/request-form-builder.service';
366
+ export * from './lib/services/requests/request-firestore.service';