@beinformed/ui 1.15.1 → 1.17.0
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/CHANGELOG.md +20 -0
- package/esm/hooks/useAuthentication.js +4 -1
- package/esm/hooks/useAuthentication.js.map +1 -1
- package/esm/models/application/ApplicationModel.js +13 -2
- package/esm/models/application/ApplicationModel.js.map +1 -1
- package/esm/models/attributes/AttributeContent.js +4 -7
- package/esm/models/attributes/AttributeContent.js.map +1 -1
- package/esm/models/href/Href.js +11 -1
- package/esm/models/href/Href.js.map +1 -1
- package/esm/redux/actions/SignIn.js +9 -0
- package/esm/redux/actions/SignIn.js.map +1 -1
- package/esm/redux/reducers/AuthReducer.js +5 -0
- package/esm/redux/reducers/AuthReducer.js.map +1 -1
- package/esm/utils/helpers/checkResource.js +39 -0
- package/esm/utils/helpers/checkResource.js.map +1 -0
- package/esm/utils/index.js +1 -1
- package/esm/utils/index.js.map +1 -1
- package/lib/hooks/useAuthentication.js +3 -0
- package/lib/hooks/useAuthentication.js.flow +7 -5
- package/lib/hooks/useAuthentication.js.map +1 -1
- package/lib/models/application/ApplicationModel.js +13 -2
- package/lib/models/application/ApplicationModel.js.flow +7 -0
- package/lib/models/application/ApplicationModel.js.map +1 -1
- package/lib/models/attributes/AttributeContent.js +4 -7
- package/lib/models/attributes/AttributeContent.js.flow +3 -6
- package/lib/models/attributes/AttributeContent.js.map +1 -1
- package/lib/models/href/Href.js +11 -1
- package/lib/models/href/Href.js.flow +12 -1
- package/lib/models/href/Href.js.map +1 -1
- package/lib/redux/actions/SignIn.js +14 -2
- package/lib/redux/actions/SignIn.js.flow +8 -0
- package/lib/redux/actions/SignIn.js.map +1 -1
- package/lib/redux/reducers/AuthReducer.js +5 -0
- package/lib/redux/reducers/AuthReducer.js.flow +3 -0
- package/lib/redux/reducers/AuthReducer.js.map +1 -1
- package/lib/redux/reducers/__tests__/AuthReducer.spec.js.flow +52 -13
- package/lib/redux/types.js.flow +5 -0
- package/lib/utils/helpers/__tests__/checkResource.spec.js.flow +60 -0
- package/lib/utils/helpers/checkResource.js +54 -0
- package/lib/utils/helpers/checkResource.js.flow +42 -0
- package/lib/utils/helpers/checkResource.js.map +1 -0
- package/lib/utils/index.js +4 -4
- package/lib/utils/index.js.flow +1 -1
- package/lib/utils/index.js.map +1 -1
- package/package.json +10 -10
- package/src/hooks/useAuthentication.js +7 -5
- package/src/models/application/ApplicationModel.js +7 -0
- package/src/models/attributes/AttributeContent.js +3 -6
- package/src/models/href/Href.js +12 -1
- package/src/redux/actions/SignIn.js +8 -0
- package/src/redux/reducers/AuthReducer.js +3 -0
- package/src/redux/reducers/__tests__/AuthReducer.spec.js +52 -13
- package/src/redux/types.js +5 -0
- package/src/utils/helpers/__tests__/checkResource.spec.js +60 -0
- package/src/utils/helpers/checkResource.js +42 -0
- package/src/utils/index.js +1 -1
- package/esm/utils/helpers/checkResourceExists.js +0 -23
- package/esm/utils/helpers/checkResourceExists.js.map +0 -1
- package/lib/utils/helpers/checkResourceExists.js +0 -34
- package/lib/utils/helpers/checkResourceExists.js.flow +0 -21
- package/lib/utils/helpers/checkResourceExists.js.map +0 -1
- package/src/utils/helpers/checkResourceExists.js +0 -21
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
// @flow
|
|
2
|
-
import { BASE } from "../../constants/Constants";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Checks if a given url to a modular ui resource exists using a HEAD request to the resource (synchronous)
|
|
6
|
-
* When the resource returns a 404, the resource does not exists and the method returns false
|
|
7
|
-
*
|
|
8
|
-
* @param url
|
|
9
|
-
* @returns {boolean}
|
|
10
|
-
*/
|
|
11
|
-
export const resourceExists = (url: string): boolean => {
|
|
12
|
-
const fullUrl = `${BASE}/${url}`.replace(/\/\//g, "/");
|
|
13
|
-
|
|
14
|
-
const xhr = new XMLHttpRequest();
|
|
15
|
-
xhr.open("HEAD", fullUrl, false);
|
|
16
|
-
xhr.setRequestHeader("Accept", "application/json");
|
|
17
|
-
xhr.setRequestHeader("Content-Type", "application/json");
|
|
18
|
-
xhr.send();
|
|
19
|
-
|
|
20
|
-
return xhr.status !== 404;
|
|
21
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/helpers/checkResourceExists.js"],"names":["resourceExists","url","fullUrl","BASE","replace","xhr","XMLHttpRequest","open","setRequestHeader","send","status"],"mappings":";;;;;;;;;;;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,IAAMA,cAAc,GAAG,SAAjBA,cAAiB,CAACC,GAAD,EAA0B;AAAA;;AACtD,MAAMC,OAAO,GAAG,0CAAGC,eAAH,uBAAWF,GAAX,EAAiBG,OAAjB,CAAyB,OAAzB,EAAkC,GAAlC,CAAhB;AAEA,MAAMC,GAAG,GAAG,IAAIC,cAAJ,EAAZ;AACAD,EAAAA,GAAG,CAACE,IAAJ,CAAS,MAAT,EAAiBL,OAAjB,EAA0B,KAA1B;AACAG,EAAAA,GAAG,CAACG,gBAAJ,CAAqB,QAArB,EAA+B,kBAA/B;AACAH,EAAAA,GAAG,CAACG,gBAAJ,CAAqB,cAArB,EAAqC,kBAArC;AACAH,EAAAA,GAAG,CAACI,IAAJ;AAEA,SAAOJ,GAAG,CAACK,MAAJ,KAAe,GAAtB;AACD,CAVM","sourcesContent":["// @flow\nimport { BASE } from \"../../constants/Constants\";\n\n/**\n * Checks if a given url to a modular ui resource exists using a HEAD request to the resource (synchronous)\n * When the resource returns a 404, the resource does not exists and the method returns false\n *\n * @param url\n * @returns {boolean}\n */\nexport const resourceExists = (url: string): boolean => {\n const fullUrl = `${BASE}/${url}`.replace(/\\/\\//g, \"/\");\n\n const xhr = new XMLHttpRequest();\n xhr.open(\"HEAD\", fullUrl, false);\n xhr.setRequestHeader(\"Accept\", \"application/json\");\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.send();\n\n return xhr.status !== 404;\n};\n"],"file":"checkResourceExists.js"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
// @flow
|
|
2
|
-
import { BASE } from "../../constants/Constants";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Checks if a given url to a modular ui resource exists using a HEAD request to the resource (synchronous)
|
|
6
|
-
* When the resource returns a 404, the resource does not exists and the method returns false
|
|
7
|
-
*
|
|
8
|
-
* @param url
|
|
9
|
-
* @returns {boolean}
|
|
10
|
-
*/
|
|
11
|
-
export const resourceExists = (url: string): boolean => {
|
|
12
|
-
const fullUrl = `${BASE}/${url}`.replace(/\/\//g, "/");
|
|
13
|
-
|
|
14
|
-
const xhr = new XMLHttpRequest();
|
|
15
|
-
xhr.open("HEAD", fullUrl, false);
|
|
16
|
-
xhr.setRequestHeader("Accept", "application/json");
|
|
17
|
-
xhr.setRequestHeader("Content-Type", "application/json");
|
|
18
|
-
xhr.send();
|
|
19
|
-
|
|
20
|
-
return xhr.status !== 404;
|
|
21
|
-
};
|