varminer-app-header 2.1.5 → 2.1.7

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.
@@ -1,3 +1,42 @@
1
+ /** localStorage key used by IAM app for user details (GET /v1/userManagement/userDetails response). */
2
+ export declare const USER_DETAILS_STORAGE_KEY = "linn-i-am-userDetails";
3
+ /** Stored value is the full API response from userDetails. */
4
+ export interface UserDetailsStoredResponse {
5
+ status: "SUCCESS" | "FAILURE";
6
+ statusinfo: {
7
+ code: string;
8
+ message: string;
9
+ };
10
+ data?: {
11
+ usersDetails: UserDetailsItem[];
12
+ };
13
+ errors?: Record<string, string> | null;
14
+ }
15
+ export interface UserDetailsItem {
16
+ userId: number;
17
+ firstName: string;
18
+ lastName: string;
19
+ email: string;
20
+ status: string;
21
+ roles?: string[];
22
+ lastLogin?: string;
23
+ createdDate?: string;
24
+ contactNumber?: {
25
+ phoneType: string;
26
+ phoneNumber: string;
27
+ }[];
28
+ timeZone?: string;
29
+ workInfo?: {
30
+ jobTitle?: string;
31
+ department?: string;
32
+ supervisor?: string;
33
+ };
34
+ }
35
+ /**
36
+ * Read user details from IAM app localStorage (set after verify-OTP on same origin).
37
+ * Does not write or overwrite this key; IAM app is the source of truth.
38
+ */
39
+ export declare function getStoredUserDetails(): UserDetailsItem | null;
1
40
  export declare const getUserDataFromStorage: () => {
2
41
  name: any;
3
42
  email: any;
@@ -22,13 +61,23 @@ export declare const getAllDataFromStorage: () => any;
22
61
  */
23
62
  export declare const getProfilePictureUrl: (baseUrl?: string) => string | null;
24
63
  /**
25
- * Fetch profile picture from API with headers and return as blob URL
26
- * This function fetches the image with required headers (X-Message-Id, X-Correlation-Id)
27
- * and converts it to a blob URL that can be used in img src
64
+ * Fetch profile picture from API with headers, get S3 URL, generate presigned URL, and return as blob URL
65
+ * This function:
66
+ * 1. Fetches the profile picture path from the API
67
+ * 2. Extracts the S3 filePath from the JSON response
68
+ * 3. Generates a presigned URL for the S3 object
69
+ * 4. Fetches the image using the presigned URL
70
+ * 5. Converts it to a blob URL that can be used in img src
28
71
  * @param baseUrl - Base URL for the object store API (default: http://objectstore.impact0mics.local:9012)
29
72
  * @param messageId - Optional message ID for X-Message-Id header (default: generated UUID)
30
73
  * @param correlationId - Optional correlation ID for X-Correlation-Id header (default: generated UUID)
74
+ * @param awsConfig - AWS configuration (accessKeyId, secretAccessKey, region, bucket)
31
75
  * @returns Promise that resolves to blob URL string or null if fetch fails
32
76
  */
33
- export declare const fetchProfilePictureAsBlobUrl: (baseUrl?: string, messageId?: string, correlationId?: string) => Promise<string | null>;
77
+ export declare const fetchProfilePictureAsBlobUrl: (baseUrl?: string, messageId?: string, correlationId?: string, awsConfig?: {
78
+ accessKeyId: string;
79
+ secretAccessKey: string;
80
+ region?: string;
81
+ bucket?: string;
82
+ }) => Promise<string | null>;
34
83
  //# sourceMappingURL=localStorage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"localStorage.d.ts","sourceRoot":"","sources":["../../src/utils/localStorage.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB;;;;;;QAgElC,CAAC;AAEF,eAAO,MAAM,+BAA+B,QAAO,MAkClD,CAAC;AAEF,eAAO,MAAM,0BAA0B,QAAO,MAAM,GAAG,SAkCtD,CAAC;AAEF,eAAO,MAAM,wBAAwB,QAAO,MAAM,GAAG,IAOpD,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,QAAQ,MAAM,KAAG,IAMvD,CAAC;AA+BF;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,WAsHjC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,GAAI,UAAS,MAAoD,KAAG,MAAM,GAAG,IA+B7G,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,4BAA4B,GACvC,UAAS,MAAoD,EAC7D,YAAY,MAAM,EAClB,gBAAgB,MAAM,KACrB,OAAO,CAAC,MAAM,GAAG,IAAI,CA6CvB,CAAC"}
1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AAG,SAkCtD,CAAC;AAEF,eAAO,MAAM,wBAAwB,QAAO,MAAM,GAAG,IAOpD,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,QAAQ,MAAM,KAAG,IAMvD,CAAC;AA+BF;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,WAsHjC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,GAAI,UAAS,MAAoD,KAAG,MAAM,GAAG,IA+B7G,CAAC;AAwHF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,4BAA4B,GACvC,UAAS,MAAoD,EAC7D,YAAY,MAAM,EAClB,gBAAgB,MAAM,EACtB,YAAY;IACV,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,KACA,OAAO,CAAC,MAAM,GAAG,IAAI,CAoFvB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "varminer-app-header",
3
- "version": "2.1.5",
3
+ "version": "2.1.7",
4
4
  "type": "module",
5
5
  "description": "A plug-and-play React header component with Material-UI, drawer toggle, notifications, and user profile menu",
6
6
  "main": "dist/index.js",