@tap-payments/os-micro-frontend-shared 0.1.356-test.1 → 0.1.356-test.2
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/build/types/user.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AppDetails, WindowPreview, Segment, TableMode, Timezone
|
|
1
|
+
import { AppDetails, WindowPreview, Segment, TableMode, Timezone } from '../types/index.js';
|
|
2
2
|
import { SheetViewColumnsData } from './columnResizeStorage';
|
|
3
3
|
export declare function setSecretKey(): void;
|
|
4
4
|
export declare function getSecretKey(): string | null;
|
|
@@ -11,10 +11,10 @@ export declare const setLoggedInUserJwtToken: (token: string) => void;
|
|
|
11
11
|
export declare const getLoggedInUserJwtToken: () => string | null;
|
|
12
12
|
export declare const removeLoggedInUserJwtToken: () => void;
|
|
13
13
|
export declare const removeLoggedInUserData: () => void;
|
|
14
|
-
export declare const setLoggedInUserData: (data:
|
|
15
|
-
export declare const getLoggedInUserData: () =>
|
|
14
|
+
export declare const setLoggedInUserData: (data: any) => void;
|
|
15
|
+
export declare const getLoggedInUserData: () => Record<string, any> | null;
|
|
16
16
|
export declare const getLoggedInUserSegment: () => Segment | null;
|
|
17
|
-
export declare const getLoggedInUserActiveSegment: () =>
|
|
17
|
+
export declare const getLoggedInUserActiveSegment: () => Segment | null;
|
|
18
18
|
export declare const isJwtTokenExpired: () => boolean;
|
|
19
19
|
export declare const isUserLoggedInAndJwtTokenExistsAndNotExpired: () => boolean;
|
|
20
20
|
export declare const setReportRecord: (key: string, reportId: string) => void;
|
|
@@ -63,9 +63,11 @@ export const removeLoggedInUserJwtToken = () => {
|
|
|
63
63
|
export const removeLoggedInUserData = () => {
|
|
64
64
|
localStorage.removeItem(USER_DATA_KEY);
|
|
65
65
|
};
|
|
66
|
+
// eslint-disable-next-line
|
|
66
67
|
export const setLoggedInUserData = (data) => {
|
|
67
68
|
localStorage.setItem(USER_DATA_KEY, JSON.stringify(data));
|
|
68
69
|
};
|
|
70
|
+
// eslint-disable-next-line
|
|
69
71
|
export const getLoggedInUserData = () => {
|
|
70
72
|
const data = localStorage.getItem(USER_DATA_KEY);
|
|
71
73
|
if (!data)
|
|
@@ -85,11 +87,10 @@ export const getLoggedInUserSegment = () => {
|
|
|
85
87
|
return getSegmentData(userData === null || userData === void 0 ? void 0 : userData.segments, userData === null || userData === void 0 ? void 0 : userData.active_segment_id, userData === null || userData === void 0 ? void 0 : userData.active_segments);
|
|
86
88
|
};
|
|
87
89
|
export const getLoggedInUserActiveSegment = () => {
|
|
88
|
-
var _a;
|
|
89
90
|
const userData = getLoggedInUserData();
|
|
90
91
|
if (!userData)
|
|
91
92
|
return null;
|
|
92
|
-
return
|
|
93
|
+
return userData === null || userData === void 0 ? void 0 : userData.active_segments.find((segment) => segment.id === userData.active_segment_id);
|
|
93
94
|
};
|
|
94
95
|
export const isJwtTokenExpired = () => {
|
|
95
96
|
const token = getLoggedInUserJwtToken();
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tap-payments/os-micro-frontend-shared",
|
|
3
3
|
"description": "Shared components and utilities for Tap Payments micro frontends",
|
|
4
|
-
"version": "0.1.356-test.
|
|
5
|
-
"testVersion":
|
|
4
|
+
"version": "0.1.356-test.2",
|
|
5
|
+
"testVersion": 2,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
8
8
|
"module": "build/index.js",
|