@northern.tech/store 0.46.5 → 0.48.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/dist/actions.d.cts +6 -6
- package/dist/actions.d.ts +6 -6
- package/dist/api/general-api.cjs +2 -2
- package/dist/api/general-api.cjs.map +1 -1
- package/dist/api/general-api.js +1 -1
- package/dist/api/general-api.js.map +1 -1
- package/dist/appSlice/constants.cjs +3 -4
- package/dist/appSlice/constants.cjs.map +1 -1
- package/dist/appSlice/constants.d.cts +1 -1
- package/dist/appSlice/constants.d.ts +1 -1
- package/dist/appSlice/constants.js +1 -2
- package/dist/appSlice/constants.js.map +1 -1
- package/dist/appSlice/index.d.cts +1 -1
- package/dist/appSlice/index.d.ts +1 -1
- package/dist/appSlice/index.js +1 -1
- package/dist/appSlice/mocks.d.cts +1 -1
- package/dist/appSlice/mocks.d.ts +1 -1
- package/dist/appSlice/selectors.cjs.map +1 -1
- package/dist/appSlice/selectors.d.cts +2 -130
- package/dist/appSlice/selectors.d.ts +2 -130
- package/dist/appSlice/selectors.js.map +1 -1
- package/dist/appSlice/thunks.d.cts +2 -2
- package/dist/appSlice/thunks.d.ts +2 -2
- package/dist/auth.cjs +3 -3
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.d.cts +1 -1
- package/dist/auth.d.ts +1 -1
- package/dist/auth.js +2 -1
- package/dist/auth.js.map +1 -1
- package/dist/commonConstants.cjs +4 -3
- package/dist/commonConstants.d.cts +2 -2
- package/dist/commonConstants.d.ts +2 -2
- package/dist/commonConstants.js +1 -1
- package/dist/commonSelectors.cjs +1 -1
- package/dist/commonSelectors.d.cts +80 -373
- package/dist/commonSelectors.d.ts +80 -373
- package/dist/commonSelectors.js +1 -1
- package/dist/constants-3gsHyxWr.d.ts +109 -0
- package/dist/{constants-B3NH1IQi.d.ts → constants-DOnQ-UzD.d.cts} +2 -3
- package/dist/{constants-B3NH1IQi.d.cts → constants-DOnQ-UzD.d.ts} +2 -3
- package/dist/{constants-MVizYy89.cjs → constants-DsOnY5o5.cjs} +1 -279
- package/dist/constants-DsOnY5o5.cjs.map +1 -0
- package/dist/constants-hMMMdt0R.d.cts +109 -0
- package/dist/{constants-nKSWZ8oD.d.ts → constants-tC3RR_Oo.d.cts} +2 -3
- package/dist/{constants-nKSWZ8oD.d.cts → constants-tC3RR_Oo.d.ts} +2 -3
- package/dist/{constants-D5hACLhF.js → constants-yul-O5hD.js} +3 -269
- package/dist/constants-yul-O5hD.js.map +1 -0
- package/dist/constants.cjs +6 -6
- package/dist/constants.d.cts +4 -4
- package/dist/constants.d.ts +4 -4
- package/dist/constants.js +2 -2
- package/dist/deploymentsSlice/constants.cjs +1 -1
- package/dist/deploymentsSlice/constants.js +1 -1
- package/dist/deploymentsSlice/index.cjs +1 -1
- package/dist/deploymentsSlice/index.js +1 -1
- package/dist/deploymentsSlice/selectors.cjs +1 -1
- package/dist/deploymentsSlice/selectors.cjs.map +1 -1
- package/dist/deploymentsSlice/selectors.d.cts +2 -97
- package/dist/deploymentsSlice/selectors.d.ts +2 -97
- package/dist/deploymentsSlice/selectors.js +1 -1
- package/dist/deploymentsSlice/selectors.js.map +1 -1
- package/dist/deploymentsSlice/thunks.d.cts +13 -13
- package/dist/deploymentsSlice/thunks.d.ts +13 -13
- package/dist/devicesSlice/constants.cjs +1 -1
- package/dist/devicesSlice/constants.d.cts +1 -1
- package/dist/devicesSlice/constants.d.ts +1 -1
- package/dist/devicesSlice/constants.js +1 -1
- package/dist/devicesSlice/index.d.cts +1 -1
- package/dist/devicesSlice/index.d.ts +1 -1
- package/dist/devicesSlice/index.js +1 -1
- package/dist/devicesSlice/mocks.js +1 -1
- package/dist/devicesSlice/selectors.cjs +1 -1
- package/dist/devicesSlice/selectors.cjs.map +1 -1
- package/dist/devicesSlice/selectors.d.cts +2 -887
- package/dist/devicesSlice/selectors.d.ts +2 -887
- package/dist/devicesSlice/selectors.js +1 -1
- package/dist/devicesSlice/selectors.js.map +1 -1
- package/dist/devicesSlice/thunks.d.cts +4 -4
- package/dist/devicesSlice/thunks.d.ts +4 -4
- package/dist/{index-fGVC5s1C.d.cts → index-B9jUHGsM.d.cts} +2 -2
- package/dist/{index-xxqlerg5.d.ts → index-BMi8ZqpV.d.ts} +2 -2
- package/dist/{index-BKU1G9-x.d.cts → index-BoZjwQHk.d.cts} +2 -2
- package/dist/{index-BfmRpbiJ.d.cts → index-C-6WkMAo.d.cts} +2 -2
- package/dist/{index-CRqnH_go.d.ts → index-CD39K38q.d.ts} +2 -2
- package/dist/{index-KxRmyFLr.d.cts → index-D8O1HJ8Q.d.cts} +2 -2
- package/dist/{index-BMsafOyJ.d.ts → index-DXfbW2gi.d.ts} +2 -2
- package/dist/{index-HjOSTTGF.d.cts → index-Dd_guNwA.d.cts} +2 -2
- package/dist/{index-CqhXqGLt.d.cts → index-DlTiYWBe.d.cts} +2 -2
- package/dist/{index-BVNS-Aut.d.ts → index-I82Wu-Ah.d.ts} +2 -2
- package/dist/{index--SKVGToc.d.ts → index-KQNyWRoG.d.ts} +2 -2
- package/dist/{index-D9GJhX1I.d.ts → index-uhmZ9qaP.d.ts} +2 -2
- package/dist/locationutils.cjs +1 -1
- package/dist/locationutils.d.cts +2 -2
- package/dist/locationutils.d.ts +2 -2
- package/dist/locationutils.js +1 -1
- package/dist/mockState.cjs +24 -0
- package/dist/mockState.cjs.map +1 -0
- package/dist/mockState.d.cts +7 -0
- package/dist/mockState.d.ts +7 -0
- package/dist/mockState.js +23 -0
- package/dist/mockState.js.map +1 -0
- package/dist/monitorSlice/constants.d.cts +1 -1
- package/dist/monitorSlice/constants.d.ts +1 -1
- package/dist/monitorSlice/index.d.cts +1 -1
- package/dist/monitorSlice/index.d.ts +1 -1
- package/dist/monitorSlice/index.js +1 -1
- package/dist/monitorSlice/mocks.d.cts +1 -1
- package/dist/monitorSlice/mocks.d.ts +1 -1
- package/dist/monitorSlice/mocks.js +1 -1
- package/dist/monitorSlice/selectors.cjs.map +1 -1
- package/dist/monitorSlice/selectors.d.cts +2 -10
- package/dist/monitorSlice/selectors.d.ts +2 -10
- package/dist/monitorSlice/selectors.js.map +1 -1
- package/dist/monitorSlice/thunks.cjs +2 -3
- package/dist/monitorSlice/thunks.cjs.map +1 -1
- package/dist/monitorSlice/thunks.d.cts +4 -4
- package/dist/monitorSlice/thunks.d.ts +4 -4
- package/dist/monitorSlice/thunks.js +3 -2
- package/dist/monitorSlice/thunks.js.map +1 -1
- package/dist/onboardingSlice/selectors.cjs.map +1 -1
- package/dist/onboardingSlice/selectors.d.cts +2 -6
- package/dist/onboardingSlice/selectors.d.ts +2 -6
- package/dist/onboardingSlice/selectors.js.map +1 -1
- package/dist/onboardingSlice/thunks.d.cts +3 -3
- package/dist/onboardingSlice/thunks.d.ts +3 -3
- package/dist/organizationSlice/constants.cjs +1 -1
- package/dist/organizationSlice/constants.js +1 -1
- package/dist/organizationSlice/index.cjs +1 -1
- package/dist/organizationSlice/index.d.cts +1 -1
- package/dist/organizationSlice/index.d.ts +1 -1
- package/dist/organizationSlice/index.js +1 -1
- package/dist/organizationSlice/mocks.d.cts +3 -3
- package/dist/organizationSlice/mocks.d.ts +3 -3
- package/dist/organizationSlice/mocks.js +1 -1
- package/dist/organizationSlice/selectors.cjs +1 -1
- package/dist/organizationSlice/selectors.cjs.map +1 -1
- package/dist/organizationSlice/selectors.d.cts +2 -472
- package/dist/organizationSlice/selectors.d.ts +2 -472
- package/dist/organizationSlice/selectors.js +1 -1
- package/dist/organizationSlice/selectors.js.map +1 -1
- package/dist/organizationSlice/thunks.d.cts +25 -21
- package/dist/organizationSlice/thunks.d.ts +25 -21
- package/dist/organizationSlice/types.d.cts +1 -1
- package/dist/organizationSlice/types.d.ts +1 -1
- package/dist/releasesSlice/constants.cjs +0 -2
- package/dist/releasesSlice/constants.cjs.map +1 -1
- package/dist/releasesSlice/constants.d.cts +2 -2
- package/dist/releasesSlice/constants.d.ts +2 -2
- package/dist/releasesSlice/constants.js +1 -2
- package/dist/releasesSlice/constants.js.map +1 -1
- package/dist/releasesSlice/index.d.cts +1 -1
- package/dist/releasesSlice/index.d.ts +1 -1
- package/dist/releasesSlice/index.js +1 -1
- package/dist/releasesSlice/mocks.js +1 -1
- package/dist/releasesSlice/selectors.cjs.map +1 -1
- package/dist/releasesSlice/selectors.d.cts +2 -795
- package/dist/releasesSlice/selectors.d.ts +2 -795
- package/dist/releasesSlice/selectors.js.map +1 -1
- package/dist/releasesSlice/thunks.cjs +18 -18
- package/dist/releasesSlice/thunks.cjs.map +1 -1
- package/dist/releasesSlice/thunks.d.cts +4 -4
- package/dist/releasesSlice/thunks.d.ts +4 -4
- package/dist/releasesSlice/thunks.js +3 -2
- package/dist/releasesSlice/thunks.js.map +1 -1
- package/dist/selectors-CH-yXu-7.d.cts +84 -0
- package/dist/selectors-CQYkG1VI.d.cts +9 -0
- package/dist/selectors-CR0q7rXC.d.cts +593 -0
- package/dist/selectors-CdCZGn7e.d.cts +99 -0
- package/dist/selectors-CdllyZyW.d.cts +363 -0
- package/dist/selectors-CftbLtXH.d.cts +14 -0
- package/dist/selectors-D2j3_Mnp.d.ts +363 -0
- package/dist/selectors-D78O3T1o.d.ts +99 -0
- package/dist/selectors-D9t4It2i.d.ts +84 -0
- package/dist/selectors-D_UFk4Uz.d.ts +14 -0
- package/dist/selectors-DuHGqmMJ.d.cts +712 -0
- package/dist/selectors-SvKXGJM5.d.ts +712 -0
- package/dist/selectors-eYLuQW4M.d.ts +593 -0
- package/dist/selectors-elCimAHX.d.ts +9 -0
- package/dist/selectors-qClZ9EXM.d.ts +374 -0
- package/dist/selectors-rto0SO4z.d.cts +374 -0
- package/dist/selectors.d.cts +9 -9
- package/dist/selectors.d.ts +9 -9
- package/dist/sockethook.cjs +4 -4
- package/dist/sockethook.cjs.map +1 -1
- package/dist/sockethook.js +2 -1
- package/dist/sockethook.js.map +1 -1
- package/dist/{store-DLp6ajT8.d.ts → store-BQcycBPp.d.ts} +15 -34
- package/dist/{store-Dw8Uo_Df.d.cts → store-CrLzRDCx.d.cts} +14 -33
- package/dist/store.cjs +2 -4
- package/dist/store.cjs.map +1 -1
- package/dist/store.d.cts +2 -2
- package/dist/store.d.ts +2 -2
- package/dist/store.js +2 -4
- package/dist/store.js.map +1 -1
- package/dist/thunks.cjs +39 -43
- package/dist/thunks.cjs.map +1 -1
- package/dist/thunks.js +19 -22
- package/dist/thunks.js.map +1 -1
- package/dist/{types-DY0J79yF.d.ts → types-DB1IOQX8.d.ts} +3 -3
- package/dist/{types-B67YW1jV.d.cts → types-DtTmD7Yn.d.cts} +3 -3
- package/dist/usersSlice/constants.cjs +1 -1
- package/dist/usersSlice/constants.js +1 -1
- package/dist/usersSlice/index.cjs +1 -1
- package/dist/usersSlice/index.d.cts +1 -1
- package/dist/usersSlice/index.d.ts +1 -1
- package/dist/usersSlice/index.js +1 -1
- package/dist/usersSlice/mocks.d.cts +1 -1
- package/dist/usersSlice/mocks.d.ts +1 -1
- package/dist/usersSlice/mocks.js +1 -1
- package/dist/usersSlice/selectors.cjs +3 -3
- package/dist/usersSlice/selectors.cjs.map +1 -1
- package/dist/usersSlice/selectors.d.cts +2 -466
- package/dist/usersSlice/selectors.d.ts +2 -466
- package/dist/usersSlice/selectors.js +2 -2
- package/dist/usersSlice/selectors.js.map +1 -1
- package/dist/usersSlice/thunks.d.cts +88 -88
- package/dist/usersSlice/thunks.d.ts +88 -88
- package/dist/utils.cjs +5 -8
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +4 -6
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
- package/dist/constants-BJuY-ODE.d.ts +0 -124
- package/dist/constants-C2O55iZu.d.cts +0 -124
- package/dist/constants-D5hACLhF.js.map +0 -1
- package/dist/constants-MVizYy89.cjs.map +0 -1
- package/dist/storehooks.cjs +0 -249
- package/dist/storehooks.cjs.map +0 -1
- package/dist/storehooks.d.cts +0 -49
- package/dist/storehooks.d.ts +0 -49
- package/dist/storehooks.js +0 -241
- package/dist/storehooks.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as SearchState } from "../index-
|
|
2
|
-
import {
|
|
1
|
+
import { n as SearchState } from "../index-BMi8ZqpV.js";
|
|
2
|
+
import { i as RootState, t as AppDispatch } from "../store-BQcycBPp.js";
|
|
3
3
|
//#region src/appSlice/thunks.d.ts
|
|
4
4
|
export declare const setFirstLoginAfterSignup: import("@reduxjs/toolkit").AsyncThunk<void, boolean, {
|
|
5
5
|
dispatch: AppDispatch;
|
package/dist/auth.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_rolldown_runtime = require("./rolldown-runtime-VH7oDXx4.cjs");
|
|
3
|
-
const require_constants = require("./constants-
|
|
3
|
+
const require_constants = require("./constants-DsOnY5o5.cjs");
|
|
4
|
+
let _northern_tech_utils_constants = require("@northern.tech/utils/constants");
|
|
4
5
|
let universal_cookie = require("universal-cookie");
|
|
5
6
|
universal_cookie = require_rolldown_runtime.__toESM(universal_cookie, 1);
|
|
6
|
-
let _northern_tech_utils_constants = require("@northern.tech/utils/constants");
|
|
7
7
|
//#region src/auth.ts
|
|
8
8
|
const cookies = new universal_cookie.default();
|
|
9
9
|
const emptySession = Object.freeze({
|
|
@@ -54,7 +54,7 @@ const updateMaxAge = ({ expiresAt, token }) => {
|
|
|
54
54
|
const oAuthExpiration = Number(window.localStorage.getItem("oauth"));
|
|
55
55
|
let updateWithOAuth = false;
|
|
56
56
|
if (oAuthExpiration) {
|
|
57
|
-
updateWithOAuth = oAuthExpiration <= Date.now() + _northern_tech_utils_constants.maxSessionAge *
|
|
57
|
+
updateWithOAuth = oAuthExpiration <= Date.now() + _northern_tech_utils_constants.maxSessionAge * _northern_tech_utils_constants.TIMEOUTS.oneSecond;
|
|
58
58
|
if (updateWithOAuth) window.localStorage.removeItem("oauth");
|
|
59
59
|
}
|
|
60
60
|
if (token && expiresAt && (!oAuthExpiration || updateWithOAuth)) {
|
package/dist/auth.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.cjs","names":["Cookies","settingsKeys","maxSessionAge","TIMEOUTS"],"sources":["../src/auth.ts"],"sourcesContent":["// Copyright 2016 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport Cookies from 'universal-cookie';\n\nimport {
|
|
1
|
+
{"version":3,"file":"auth.cjs","names":["Cookies","settingsKeys","maxSessionAge","TIMEOUTS"],"sources":["../src/auth.ts"],"sourcesContent":["// Copyright 2016 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { TIMEOUTS } from '@northern.tech/utils/constants';\nimport Cookies from 'universal-cookie';\n\nimport { maxSessionAge, settingsKeys } from './constants';\nimport type { UserSession } from './usersSlice';\n\nconst cookies = new Cookies();\n\nconst emptySession = Object.freeze({ token: '', expiresAt: undefined }) as Readonly<UserSession>;\n\nlet tokenCache = '';\n\nexport const getSessionInfo = (): UserSession => {\n let sessionInfo = { ...emptySession } as UserSession;\n try {\n sessionInfo = JSON.parse(window.localStorage.getItem('JWT') ?? '');\n } catch {\n // most likely not logged in - nothing to do here\n }\n\n // check for cookie first to handles sso login while an old/expired token may still exist in cache/ localStorage\n const jwtTokenFromCookie = cookies.get('JWT', { doNotParse: true }) ?? '';\n if (jwtTokenFromCookie) {\n setSessionInfo({ token: jwtTokenFromCookie });\n cookies.remove('JWT');\n cookies.remove('JWT', { path: '/' });\n return { token: jwtTokenFromCookie, expiresAt: undefined };\n }\n if (sessionInfo.expiresAt && new Date(sessionInfo.expiresAt) < new Date()) {\n cleanUp();\n return { ...emptySession };\n }\n sessionInfo.token = sessionInfo.token || '';\n tokenCache = sessionInfo.token;\n return sessionInfo;\n};\n\nexport const getToken = () => (tokenCache ? tokenCache : getSessionInfo().token);\n\nexport const setSessionInfo = ({ token, expiresAt }: UserSession) => {\n tokenCache = token;\n window.localStorage.setItem('JWT', JSON.stringify({ token, expiresAt }));\n};\n\nexport const cleanUp = () => {\n tokenCache = '';\n cookies.remove('JWT');\n cookies.remove('JWT', { path: '/' });\n window.localStorage.removeItem('JWT');\n window.localStorage.removeItem('oauth');\n window.localStorage.removeItem(settingsKeys.colorScheme);\n};\n\nexport const updateMaxAge = ({ expiresAt, token }) => {\n const oAuthExpiration = Number(window.localStorage.getItem('oauth'));\n let updateWithOAuth = false;\n if (oAuthExpiration) {\n const soon = Date.now() + maxSessionAge * TIMEOUTS.oneSecond;\n updateWithOAuth = oAuthExpiration <= soon;\n if (updateWithOAuth) {\n window.localStorage.removeItem('oauth');\n }\n }\n if (token && expiresAt && (!oAuthExpiration || updateWithOAuth)) {\n const expiration = new Date();\n expiration.setSeconds(expiration.getSeconds() + maxSessionAge);\n setSessionInfo({ token, expiresAt: expiration.toISOString() });\n }\n};\n"],"mappings":";;;;;;;AAmBA,MAAM,UAAU,IAAIA,iBAAAA,QAAQ;AAE5B,MAAM,eAAe,OAAO,OAAO;CAAE,OAAO;CAAI,WAAW,KAAA;AAAU,CAAC;AAEtE,IAAI,aAAa;AAEjB,MAAa,uBAAoC;CAC/C,IAAI,cAAc,EAAE,GAAG,aAAa;CACpC,IAAI;EACF,cAAc,KAAK,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BAAa,IAAI,KAAK;EAC5B,WAAW,WAAW,WAAW,WAAW,IAAID,+BAAAA,aAAa;EAC7D,eAAe;GAAE;GAAO,WAAW,WAAW,YAAY;EAAE,CAAC;CAC/D;AACF"}
|
package/dist/auth.d.cts
CHANGED
package/dist/auth.d.ts
CHANGED
package/dist/auth.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $ as settingsKeys, M as maxSessionAge } from "./constants-yul-O5hD.js";
|
|
2
|
+
import { TIMEOUTS } from "@northern.tech/utils/constants";
|
|
2
3
|
import Cookies from "universal-cookie";
|
|
3
4
|
//#region src/auth.ts
|
|
4
5
|
const cookies = new Cookies();
|
package/dist/auth.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","names":[],"sources":["../src/auth.ts"],"sourcesContent":["// Copyright 2016 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport Cookies from 'universal-cookie';\n\nimport {
|
|
1
|
+
{"version":3,"file":"auth.js","names":[],"sources":["../src/auth.ts"],"sourcesContent":["// Copyright 2016 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { TIMEOUTS } from '@northern.tech/utils/constants';\nimport Cookies from 'universal-cookie';\n\nimport { maxSessionAge, settingsKeys } from './constants';\nimport type { UserSession } from './usersSlice';\n\nconst cookies = new Cookies();\n\nconst emptySession = Object.freeze({ token: '', expiresAt: undefined }) as Readonly<UserSession>;\n\nlet tokenCache = '';\n\nexport const getSessionInfo = (): UserSession => {\n let sessionInfo = { ...emptySession } as UserSession;\n try {\n sessionInfo = JSON.parse(window.localStorage.getItem('JWT') ?? '');\n } catch {\n // most likely not logged in - nothing to do here\n }\n\n // check for cookie first to handles sso login while an old/expired token may still exist in cache/ localStorage\n const jwtTokenFromCookie = cookies.get('JWT', { doNotParse: true }) ?? '';\n if (jwtTokenFromCookie) {\n setSessionInfo({ token: jwtTokenFromCookie });\n cookies.remove('JWT');\n cookies.remove('JWT', { path: '/' });\n return { token: jwtTokenFromCookie, expiresAt: undefined };\n }\n if (sessionInfo.expiresAt && new Date(sessionInfo.expiresAt) < new Date()) {\n cleanUp();\n return { ...emptySession };\n }\n sessionInfo.token = sessionInfo.token || '';\n tokenCache = sessionInfo.token;\n return sessionInfo;\n};\n\nexport const getToken = () => (tokenCache ? tokenCache : getSessionInfo().token);\n\nexport const setSessionInfo = ({ token, expiresAt }: UserSession) => {\n tokenCache = token;\n window.localStorage.setItem('JWT', JSON.stringify({ token, expiresAt }));\n};\n\nexport const cleanUp = () => {\n tokenCache = '';\n cookies.remove('JWT');\n cookies.remove('JWT', { path: '/' });\n window.localStorage.removeItem('JWT');\n window.localStorage.removeItem('oauth');\n window.localStorage.removeItem(settingsKeys.colorScheme);\n};\n\nexport const updateMaxAge = ({ expiresAt, token }) => {\n const oAuthExpiration = Number(window.localStorage.getItem('oauth'));\n let updateWithOAuth = false;\n if (oAuthExpiration) {\n const soon = Date.now() + maxSessionAge * TIMEOUTS.oneSecond;\n updateWithOAuth = oAuthExpiration <= soon;\n if (updateWithOAuth) {\n window.localStorage.removeItem('oauth');\n }\n }\n if (token && expiresAt && (!oAuthExpiration || updateWithOAuth)) {\n const expiration = new Date();\n expiration.setSe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AAY;CACpD,MAAM,kBAAkB,OAAO,OAAO,aAAa,QAAQ,OAAO,CAAC;CACnE,IAAI,kBAAkB;CACtB,IAAI,iBAAiB;EAEnB,kBAAkB,mBADL,KAAK,IAAI,IAAI,gBAAgB,SAAS;EAEnD,IAAI,iBACF,OAAO,aAAa,WAAW,OAAO;CAE1C;CACA,IAAI,SAAS,cAAc,CAAC,mBAAmB,kBAAkB;EAC/D,MAAM,6BAAa,IAAI,KAAK;EAC5B,WAAW,WAAW,WAAW,WAAW,IAAI,aAAa;EAC7D,eAAe;GAAE;GAAO,WAAW,WAAW,YAAY;EAAE,CAAC;CAC/D;AACF"}
|
package/dist/commonConstants.cjs
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_constants = require("./constants-
|
|
2
|
+
const require_constants = require("./constants-DsOnY5o5.cjs");
|
|
3
|
+
let _northern_tech_utils_constants = require("@northern.tech/utils/constants");
|
|
3
4
|
exports.ATTRIBUTE_SCOPE_LABELS = require_constants.ATTRIBUTE_SCOPE_LABELS;
|
|
4
5
|
exports.DEVICE_LIST_MAXIMUM_LENGTH = require_constants.DEVICE_LIST_MAXIMUM_LENGTH;
|
|
5
6
|
exports.DEVICE_ONLINE_CUTOFF = require_constants.DEVICE_ONLINE_CUTOFF;
|
|
6
7
|
exports.EXTERNAL_PROVIDER = require_constants.EXTERNAL_PROVIDER;
|
|
7
8
|
exports.MAX_PAGE_SIZE = require_constants.MAX_PAGE_SIZE;
|
|
8
9
|
exports.ORCHESTRATOR_MANIFEST_ATTRIBUTE_PREFIX = require_constants.ORCHESTRATOR_MANIFEST_ATTRIBUTE_PREFIX;
|
|
9
|
-
exports.TIMEOUTS =
|
|
10
|
+
exports.TIMEOUTS = _northern_tech_utils_constants.TIMEOUTS;
|
|
10
11
|
exports.UNGROUPED_GROUP = require_constants.UNGROUPED_GROUP;
|
|
11
|
-
exports.countries =
|
|
12
|
+
exports.countries = _northern_tech_utils_constants.countries;
|
|
12
13
|
exports.credentialTypes = require_constants.credentialTypes;
|
|
13
14
|
exports.defaultIdAttribute = require_constants.defaultIdAttribute;
|
|
14
15
|
exports.emptyWebhook = require_constants.emptyWebhook;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { At as
|
|
2
|
-
export { ATTRIBUTE_SCOPE_LABELS, DEVICE_LIST_MAXIMUM_LENGTH, DEVICE_ONLINE_CUTOFF, EXTERNAL_PROVIDER, FilterOperator, IdAttribute, MAX_PAGE_SIZE, ORCHESTRATOR_MANIFEST_ATTRIBUTE_PREFIX, TIMEOUTS, UNGROUPED_GROUP, Webhook, countries, credentialTypes, defaultIdAttribute, emptyWebhook, productOrder, timeUnits };
|
|
1
|
+
import { At as UNGROUPED_GROUP, Ct as DEVICE_ONLINE_CUTOFF, Dt as MAX_PAGE_SIZE, Et as IdAttribute, Ft as emptyWebhook, It as productOrder, Lt as timeUnits, Mt as countries, Nt as credentialTypes, Ot as ORCHESTRATOR_MANIFEST_ATTRIBUTE_PREFIX, Pt as defaultIdAttribute, St as DEVICE_LIST_MAXIMUM_LENGTH, Tt as FilterOperator, bt as ATTRIBUTE_SCOPE_LABELS, jt as Webhook, kt as TIMEOUTS, wt as EXTERNAL_PROVIDER, xt as CountryType } from "./constants-hMMMdt0R.cjs";
|
|
2
|
+
export { ATTRIBUTE_SCOPE_LABELS, type CountryType, DEVICE_LIST_MAXIMUM_LENGTH, DEVICE_ONLINE_CUTOFF, EXTERNAL_PROVIDER, FilterOperator, IdAttribute, MAX_PAGE_SIZE, ORCHESTRATOR_MANIFEST_ATTRIBUTE_PREFIX, TIMEOUTS, UNGROUPED_GROUP, Webhook, countries, credentialTypes, defaultIdAttribute, emptyWebhook, productOrder, timeUnits };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { At as
|
|
2
|
-
export { ATTRIBUTE_SCOPE_LABELS, DEVICE_LIST_MAXIMUM_LENGTH, DEVICE_ONLINE_CUTOFF, EXTERNAL_PROVIDER, FilterOperator, IdAttribute, MAX_PAGE_SIZE, ORCHESTRATOR_MANIFEST_ATTRIBUTE_PREFIX, TIMEOUTS, UNGROUPED_GROUP, Webhook, countries, credentialTypes, defaultIdAttribute, emptyWebhook, productOrder, timeUnits };
|
|
1
|
+
import { At as UNGROUPED_GROUP, Ct as DEVICE_ONLINE_CUTOFF, Dt as MAX_PAGE_SIZE, Et as IdAttribute, Ft as emptyWebhook, It as productOrder, Lt as timeUnits, Mt as countries, Nt as credentialTypes, Ot as ORCHESTRATOR_MANIFEST_ATTRIBUTE_PREFIX, Pt as defaultIdAttribute, St as DEVICE_LIST_MAXIMUM_LENGTH, Tt as FilterOperator, bt as ATTRIBUTE_SCOPE_LABELS, jt as Webhook, kt as TIMEOUTS, wt as EXTERNAL_PROVIDER, xt as CountryType } from "./constants-3gsHyxWr.js";
|
|
2
|
+
export { ATTRIBUTE_SCOPE_LABELS, type CountryType, DEVICE_LIST_MAXIMUM_LENGTH, DEVICE_ONLINE_CUTOFF, EXTERNAL_PROVIDER, FilterOperator, IdAttribute, MAX_PAGE_SIZE, ORCHESTRATOR_MANIFEST_ATTRIBUTE_PREFIX, TIMEOUTS, UNGROUPED_GROUP, Webhook, countries, credentialTypes, defaultIdAttribute, emptyWebhook, productOrder, timeUnits };
|
package/dist/commonConstants.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { At as
|
|
1
|
+
import { At as DEVICE_LIST_MAXIMUM_LENGTH, Bt as emptyWebhook, Ft as TIMEOUTS, Ht as timeUnits, It as UNGROUPED_GROUP, Lt as countries, Mt as EXTERNAL_PROVIDER, Nt as MAX_PAGE_SIZE, Pt as ORCHESTRATOR_MANIFEST_ATTRIBUTE_PREFIX, Rt as credentialTypes, Vt as productOrder, jt as DEVICE_ONLINE_CUTOFF, kt as ATTRIBUTE_SCOPE_LABELS, zt as defaultIdAttribute } from "./constants-yul-O5hD.js";
|
|
2
2
|
export { ATTRIBUTE_SCOPE_LABELS, DEVICE_LIST_MAXIMUM_LENGTH, DEVICE_ONLINE_CUTOFF, EXTERNAL_PROVIDER, MAX_PAGE_SIZE, ORCHESTRATOR_MANIFEST_ATTRIBUTE_PREFIX, TIMEOUTS, UNGROUPED_GROUP, countries, credentialTypes, defaultIdAttribute, emptyWebhook, productOrder, timeUnits };
|
package/dist/commonSelectors.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_rolldown_runtime = require("./rolldown-runtime-VH7oDXx4.cjs");
|
|
3
3
|
const require_appSlice_constants = require("./appSlice/constants.cjs");
|
|
4
|
-
const require_constants = require("./constants-
|
|
4
|
+
const require_constants = require("./constants-DsOnY5o5.cjs");
|
|
5
5
|
const require_onboardingSlice_constants = require("./onboardingSlice/constants.cjs");
|
|
6
6
|
const require_appSlice_selectors = require("./appSlice/selectors.cjs");
|
|
7
7
|
const require_deploymentsSlice_selectors = require("./deploymentsSlice/selectors.cjs");
|