@capsitech/react-utilities 0.1.11 → 0.1.14
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.
|
@@ -48,7 +48,7 @@ declare class ApiUtilityBase {
|
|
|
48
48
|
* @param config Configuration object
|
|
49
49
|
*/
|
|
50
50
|
configure(config: IApiUtilityConfig): void;
|
|
51
|
-
getResponse: <T = any>(endpoint: string, params?: any, options?: IAxiosRequestConfigWithoutParams) => Promise<AxiosResponse<T, any>>;
|
|
51
|
+
getResponse: <T = any>(endpoint: string, params?: any, options?: IAxiosRequestConfigWithoutParams) => Promise<AxiosResponse<T, any, {}>>;
|
|
52
52
|
get: <T = IApiResponse>(endpoint: string, params?: any, throwErrorOn401?: boolean, options?: IAxiosRequestConfigWithoutParams) => Promise<T>;
|
|
53
53
|
getResult: <T = any>(endpoint: string, params?: any, throwErrorOn401?: boolean, options?: IAxiosRequestConfigWithoutParams) => Promise<T | null>;
|
|
54
54
|
post: <T = IApiResponse>(endpoint: string, body: any, contentType?: string, options?: IAxiosRequestConfigWithoutParams) => Promise<T>;
|
|
@@ -47,7 +47,7 @@ export declare const getScreenScalingFactor: () => number | null;
|
|
|
47
47
|
* If it fails validation, it returns null
|
|
48
48
|
* @returns {number | null} validated value of screen's colorDepth
|
|
49
49
|
*/
|
|
50
|
-
export declare const
|
|
50
|
+
export declare const getScreenColorDepth: () => number | null;
|
|
51
51
|
/**
|
|
52
52
|
* Function that validates the user's window's interior width in pixels, and then returns it.
|
|
53
53
|
* If it fails validation, it returns null
|
|
@@ -118,19 +118,19 @@ export const getScreenScalingFactor = () => validateAndGetScreenDetail(window.de
|
|
|
118
118
|
* If it fails validation, it returns null
|
|
119
119
|
* @returns {number | null} validated value of screen's colorDepth
|
|
120
120
|
*/
|
|
121
|
-
export const
|
|
121
|
+
export const getScreenColorDepth = () => validateAndGetScreenDetail(screen.colorDepth);
|
|
122
122
|
/**
|
|
123
123
|
* Function that validates the user's window's interior width in pixels, and then returns it.
|
|
124
124
|
* If it fails validation, it returns null
|
|
125
125
|
* @returns {number | null} validated value of window's innerWidth
|
|
126
126
|
*/
|
|
127
|
-
export const getWindowWidth = () => validateAndGetScreenDetail(window.
|
|
127
|
+
export const getWindowWidth = () => validateAndGetScreenDetail(window.outerWidth);
|
|
128
128
|
/**
|
|
129
129
|
* Function that validates the user's window's interior height in pixels, and then returns it.
|
|
130
130
|
* If it fails validation, it returns null
|
|
131
131
|
* @returns {number | null} validated value of window's innerHeight
|
|
132
132
|
*/
|
|
133
|
-
export const getWindowHeight = () => validateAndGetScreenDetail(window.
|
|
133
|
+
export const getWindowHeight = () => validateAndGetScreenDetail(window.outerHeight);
|
|
134
134
|
/**
|
|
135
135
|
* The function returns users browser's do not track setting by checking the navigator
|
|
136
136
|
* and window object for the same
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getScreenColorDepth, getScreenHeight, getScreenScalingFactor, getScreenWidth, getTimezone, getWindowHeight, getWindowWidth } from './BrowserInfo';
|
|
2
2
|
/**
|
|
3
3
|
* Enum object of keys for each header in the Map returned by getFraudPreventionHeaders().headers
|
|
4
4
|
*/
|
|
@@ -14,14 +14,14 @@ export const fraudPreventionHeadersEnum = {
|
|
|
14
14
|
//BROWSER_USER_AGENT: 'Gov-Client-Browser-JS-User-Agent',
|
|
15
15
|
};
|
|
16
16
|
const getScreenData = () => {
|
|
17
|
-
const screenDetails = `width=${getScreenWidth()}&height=${getScreenHeight()}&scaling-factor=${getScreenScalingFactor()}&colour-depth=${
|
|
17
|
+
const screenDetails = `width=${getScreenWidth()}&height=${getScreenHeight()}&scaling-factor=${getScreenScalingFactor()}&colour-depth=${getScreenColorDepth()}`;
|
|
18
18
|
return encodeURI(screenDetails);
|
|
19
19
|
};
|
|
20
20
|
export const getScreenDetails = () => {
|
|
21
21
|
return {
|
|
22
22
|
width: getScreenWidth(),
|
|
23
23
|
height: getScreenHeight(),
|
|
24
|
-
colorDepth:
|
|
24
|
+
colorDepth: getScreenColorDepth(),
|
|
25
25
|
scalingFactor: getScreenScalingFactor(),
|
|
26
26
|
};
|
|
27
27
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capsitech/react-utilities",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.14",
|
|
4
4
|
"description": "A set of javascript utility methods",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"jsnext:main": "lib/index.js",
|
|
@@ -37,31 +37,34 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"dayjs": "^1.11.19",
|
|
40
|
-
"lodash": "^4.17.
|
|
40
|
+
"lodash": "^4.17.23"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"axios": "^1.13.
|
|
43
|
+
"axios": "^1.13.3",
|
|
44
44
|
"file-saver": "^2.0.5",
|
|
45
|
-
"qs": "^6.14.
|
|
45
|
+
"qs": "^6.14.1",
|
|
46
46
|
"react": ">=18",
|
|
47
47
|
"react-dom": ">=18"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@
|
|
51
|
-
"@
|
|
52
|
-
"@
|
|
50
|
+
"@babel/preset-env": "7.28.5",
|
|
51
|
+
"@babel/preset-react": "7.28.5",
|
|
52
|
+
"@babel/preset-typescript": "7.28.5",
|
|
53
|
+
"@storybook/addon-docs": "^10.1.11",
|
|
54
|
+
"@storybook/addon-webpack5-compiler-babel": "^4.0.0",
|
|
55
|
+
"@storybook/react-webpack5": "^10.1.11",
|
|
53
56
|
"@types/file-saver": "^2.0.7",
|
|
54
|
-
"@types/lodash": "4.17.
|
|
57
|
+
"@types/lodash": "4.17.23",
|
|
55
58
|
"@types/qs": "^6",
|
|
56
59
|
"@types/react": "^18.3.12",
|
|
57
|
-
"axios": "^1.
|
|
60
|
+
"axios": "^1.13.3",
|
|
58
61
|
"file-saver": "^2.0.5",
|
|
59
|
-
"qs": "^6.14.
|
|
62
|
+
"qs": "^6.14.1",
|
|
60
63
|
"react": "^18.3.1",
|
|
61
64
|
"react-dom": "^18.3.1",
|
|
62
65
|
"react-router-dom": "^7.8.1",
|
|
63
|
-
"rimraf": "6.
|
|
64
|
-
"storybook": "^
|
|
66
|
+
"rimraf": "6.1.2",
|
|
67
|
+
"storybook": "^10.1.11",
|
|
65
68
|
"typescript": "5.8.3"
|
|
66
69
|
},
|
|
67
70
|
"browserslist": {
|
|
@@ -76,5 +79,5 @@
|
|
|
76
79
|
"last 1 safari version"
|
|
77
80
|
]
|
|
78
81
|
},
|
|
79
|
-
"packageManager": "yarn@4.
|
|
82
|
+
"packageManager": "yarn@4.12.0"
|
|
80
83
|
}
|