@northern.tech/store 0.31.0 → 0.32.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 +5 -2
- package/dist/actions.d.ts +5 -2
- package/dist/api/general-api.cjs +2 -2
- package/dist/api/general-api.cjs.map +1 -1
- package/dist/api/general-api.js.map +1 -1
- package/dist/api/users-api.cjs +1 -1
- package/dist/api/users-api.cjs.map +1 -1
- package/dist/api/users-api.js.map +1 -1
- package/dist/appSlice/constants.cjs +1 -1
- package/dist/appSlice/constants.cjs.map +1 -1
- package/dist/appSlice/constants.js +2 -2
- package/dist/appSlice/constants.js.map +1 -1
- package/dist/appSlice/index.cjs.map +1 -1
- package/dist/appSlice/index.js.map +1 -1
- package/dist/appSlice/selectors.d.cts +2 -2
- package/dist/appSlice/selectors.d.ts +2 -2
- package/dist/appSlice/thunks.d.cts +1 -1
- package/dist/appSlice/thunks.d.ts +1 -1
- package/dist/auth.cjs +1 -1
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.js.map +1 -1
- package/dist/commonSelectors.cjs +1 -1
- package/dist/commonSelectors.cjs.map +1 -1
- package/dist/commonSelectors.d.cts +2 -2
- package/dist/commonSelectors.d.ts +2 -2
- package/dist/commonSelectors.js.map +1 -1
- package/dist/constants.cjs.map +1 -1
- package/dist/constants.js.map +1 -1
- package/dist/deploymentsSlice/index.cjs.map +1 -1
- package/dist/deploymentsSlice/index.js.map +1 -1
- package/dist/deploymentsSlice/selectors.cjs.map +1 -1
- package/dist/deploymentsSlice/selectors.d.cts +2 -2
- package/dist/deploymentsSlice/selectors.d.ts +2 -2
- package/dist/deploymentsSlice/selectors.js.map +1 -1
- package/dist/deploymentsSlice/thunks.d.cts +1 -1
- package/dist/deploymentsSlice/thunks.d.ts +1 -1
- package/dist/devicesSlice/index.cjs.map +1 -1
- package/dist/devicesSlice/index.js.map +1 -1
- package/dist/devicesSlice/selectors.cjs.map +1 -1
- package/dist/devicesSlice/selectors.d.cts +2 -2
- package/dist/devicesSlice/selectors.d.ts +2 -2
- package/dist/devicesSlice/selectors.js.map +1 -1
- package/dist/devicesSlice/thunks.d.cts +1 -1
- package/dist/devicesSlice/thunks.d.ts +1 -1
- package/dist/{index-WXwgRjLt.d.cts → index-C-q632wO.d.cts} +13 -6
- package/dist/{index-CQo3yTUa.d.ts → index-CyokFK2e.d.ts} +13 -6
- package/dist/liststatehook.cjs +5 -3
- package/dist/liststatehook.cjs.map +1 -1
- package/dist/liststatehook.js +5 -3
- package/dist/liststatehook.js.map +1 -1
- package/dist/locationutils.cjs.map +1 -1
- package/dist/locationutils.js.map +1 -1
- package/dist/monitorSlice/index.cjs.map +1 -1
- package/dist/monitorSlice/index.js.map +1 -1
- package/dist/monitorSlice/mocks.cjs.map +1 -1
- package/dist/monitorSlice/mocks.js.map +1 -1
- package/dist/monitorSlice/selectors.d.cts +1 -1
- package/dist/monitorSlice/selectors.d.ts +1 -1
- package/dist/monitorSlice/thunks.cjs.map +1 -1
- package/dist/monitorSlice/thunks.d.cts +1 -1
- package/dist/monitorSlice/thunks.d.ts +1 -1
- package/dist/monitorSlice/thunks.js.map +1 -1
- package/dist/onboardingSlice/index.cjs.map +1 -1
- package/dist/onboardingSlice/index.js.map +1 -1
- package/dist/onboardingSlice/mocks.cjs.map +1 -1
- package/dist/onboardingSlice/selectors.d.cts +1 -1
- package/dist/onboardingSlice/selectors.d.ts +1 -1
- package/dist/onboardingSlice/thunks.d.cts +1 -1
- package/dist/onboardingSlice/thunks.d.ts +1 -1
- package/dist/organizationSlice/index.cjs.map +1 -1
- package/dist/organizationSlice/index.js.map +1 -1
- package/dist/organizationSlice/selectors.cjs.map +1 -1
- package/dist/organizationSlice/selectors.d.cts +2 -2
- package/dist/organizationSlice/selectors.d.ts +2 -2
- package/dist/organizationSlice/selectors.js.map +1 -1
- package/dist/organizationSlice/thunks.d.cts +1 -1
- package/dist/organizationSlice/thunks.d.ts +1 -1
- package/dist/releasesSlice/index.cjs +26 -2
- package/dist/releasesSlice/index.cjs.map +1 -1
- package/dist/releasesSlice/index.d.cts +2 -2
- package/dist/releasesSlice/index.d.ts +2 -2
- package/dist/releasesSlice/index.js +26 -2
- package/dist/releasesSlice/index.js.map +1 -1
- package/dist/releasesSlice/mocks.d.cts +1 -1
- package/dist/releasesSlice/mocks.d.ts +1 -1
- package/dist/releasesSlice/selectors.cjs +15 -5
- package/dist/releasesSlice/selectors.cjs.map +1 -1
- package/dist/releasesSlice/selectors.d.cts +245 -9
- package/dist/releasesSlice/selectors.d.ts +245 -9
- package/dist/releasesSlice/selectors.js +12 -6
- package/dist/releasesSlice/selectors.js.map +1 -1
- package/dist/releasesSlice/thunks.cjs +121 -2
- package/dist/releasesSlice/thunks.cjs.map +1 -1
- package/dist/releasesSlice/thunks.d.cts +91 -7
- package/dist/releasesSlice/thunks.d.ts +91 -7
- package/dist/releasesSlice/thunks.js +115 -3
- package/dist/releasesSlice/thunks.js.map +1 -1
- package/dist/selectors.cjs +4 -0
- package/dist/selectors.d.cts +2 -2
- package/dist/selectors.d.ts +2 -2
- package/dist/selectors.js +2 -2
- package/dist/sockethook.cjs +2 -2
- package/dist/sockethook.cjs.map +1 -1
- package/dist/sockethook.js.map +1 -1
- package/dist/{store-Boqp1x2t.d.ts → store-D-xvZXiY.d.ts} +2 -2
- package/dist/{store-NOBz-rVZ.d.cts → store-b5cF2WB5.d.cts} +2 -2
- package/dist/store.cjs.map +1 -1
- package/dist/store.d.cts +1 -1
- package/dist/store.d.ts +1 -1
- package/dist/store.js.map +1 -1
- package/dist/storehooks.cjs +3 -3
- package/dist/storehooks.cjs.map +1 -1
- package/dist/storehooks.d.cts +1 -1
- package/dist/storehooks.d.ts +1 -1
- package/dist/storehooks.js.map +1 -1
- package/dist/thunks.cjs +18 -10
- package/dist/thunks.cjs.map +1 -1
- package/dist/thunks.d.cts +2 -2
- package/dist/thunks.d.ts +2 -2
- package/dist/thunks.js +8 -6
- package/dist/thunks.js.map +1 -1
- package/dist/useDeploymentDevice.cjs +1 -1
- package/dist/useDeploymentDevice.cjs.map +1 -1
- package/dist/useDeploymentDevice.js.map +1 -1
- package/dist/usersSlice/index.cjs.map +1 -1
- package/dist/usersSlice/index.js.map +1 -1
- package/dist/usersSlice/selectors.cjs.map +1 -1
- package/dist/usersSlice/selectors.d.cts +2 -2
- package/dist/usersSlice/selectors.d.ts +2 -2
- package/dist/usersSlice/selectors.js.map +1 -1
- package/dist/usersSlice/thunks.d.cts +1 -1
- package/dist/usersSlice/thunks.d.ts +1 -1
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.js.map +1 -1
- package/package.json +7 -7
package/dist/actions.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { lt as AlertChannelKey, mt as DeviceAuthState } from "./constants-BrGIx40B.cjs";
|
|
2
2
|
import { i as ReadState } from "./constants-G3wymKIl.cjs";
|
|
3
3
|
import { a as UserSettings, i as UserSession, n as GlobalSettings, r as User, t as CustomColumn } from "./index-BFlHWzjv.cjs";
|
|
4
|
-
import { n as ManifestsList, r as Release } from "./index-
|
|
4
|
+
import { n as ManifestsList, r as Release } from "./index-C-q632wO.cjs";
|
|
5
5
|
import { d as TenantList, i as Organization, l as SSOConfig, n as AuditLogSelectionState, o as ProductConfig, r as Card } from "./types-COdPU2QQ.cjs";
|
|
6
6
|
import { n as OnboardingSliceType, t as OnboardingApproach } from "./index-UPc3wvVd.cjs";
|
|
7
7
|
import { i as DeploymentConfig, l as SelectionState, r as DeploymentByStatusKey, t as Deployment } from "./index-BP0uAq36.cjs";
|
|
@@ -41,7 +41,8 @@ declare const _default: {
|
|
|
41
41
|
setShowStartupNotification: _$_reduxjs_toolkit0.ActionCreatorWithPayload<boolean, "users/setShowStartupNotification">;
|
|
42
42
|
receiveRelease: _$_reduxjs_toolkit0.ActionCreatorWithPayload<Release, "releases/receiveRelease">;
|
|
43
43
|
receiveReleases: _$_reduxjs_toolkit0.ActionCreatorWithPayload<Record<string, Release>, "releases/receiveReleases">;
|
|
44
|
-
|
|
44
|
+
receiveSoftwareTags: _$_reduxjs_toolkit0.ActionCreatorWithPayload<_$_northern_tech_types_types_gen0.Tags, "releases/receiveSoftwareTags">;
|
|
45
|
+
receiveReleaseTags: _$_reduxjs_toolkit0.ActionCreatorWithPayload<_$_northern_tech_types_types_gen0.Tags, "releases/receiveReleaseTags">;
|
|
45
46
|
receiveReleaseTypes: _$_reduxjs_toolkit0.ActionCreatorWithPayload<string[], "releases/receiveReleaseTypes">;
|
|
46
47
|
removeRelease: _$_reduxjs_toolkit0.ActionCreatorWithPayload<string, "releases/removeRelease">;
|
|
47
48
|
selectedRelease: _$_reduxjs_toolkit0.ActionCreatorWithPayload<string | null, "releases/selectedRelease">;
|
|
@@ -53,7 +54,9 @@ declare const _default: {
|
|
|
53
54
|
setActiveTab: _$_reduxjs_toolkit0.ActionCreatorWithPayload<"releases" | "delta" | "manifests", "releases/setActiveTab">;
|
|
54
55
|
receiveManifest: _$_reduxjs_toolkit0.ActionCreatorWithPayload<_$_northern_tech_types_types_gen0.Manifest, "releases/receiveManifest">;
|
|
55
56
|
receiveManifests: _$_reduxjs_toolkit0.ActionCreatorWithPayload<Record<string, _$_northern_tech_types_types_gen0.Manifest>, "releases/receiveManifests">;
|
|
57
|
+
receiveManifestTags: _$_reduxjs_toolkit0.ActionCreatorWithPayload<_$_northern_tech_types_types_gen0.Tags, "releases/receiveManifestTags">;
|
|
56
58
|
removeManifest: _$_reduxjs_toolkit0.ActionCreatorWithPayload<string, "releases/removeManifest">;
|
|
59
|
+
removeManifests: _$_reduxjs_toolkit0.ActionCreatorWithPayload<string[], "releases/removeManifests">;
|
|
57
60
|
selectedManifest: _$_reduxjs_toolkit0.ActionCreatorWithPayload<string | null, "releases/selectedManifest">;
|
|
58
61
|
setManifestsListState: _$_reduxjs_toolkit0.ActionCreatorWithPayload<ManifestsList, "releases/setManifestsListState">;
|
|
59
62
|
receiveAuditLogs: _$_reduxjs_toolkit0.ActionCreatorWithPayload<{
|
package/dist/actions.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { lt as AlertChannelKey, mt as DeviceAuthState } from "./constants-CjO3_FOH.js";
|
|
2
2
|
import { i as ReadState } from "./constants-Cpgyuy_r.js";
|
|
3
3
|
import { a as UserSettings, i as UserSession, n as GlobalSettings, r as User, t as CustomColumn } from "./index-ez3oxfRo.js";
|
|
4
|
-
import { n as ManifestsList, r as Release } from "./index-
|
|
4
|
+
import { n as ManifestsList, r as Release } from "./index-CyokFK2e.js";
|
|
5
5
|
import { d as TenantList, i as Organization, l as SSOConfig, n as AuditLogSelectionState, o as ProductConfig, r as Card } from "./types-BPyM8Inu.js";
|
|
6
6
|
import { n as OnboardingSliceType, t as OnboardingApproach } from "./index-CJkrL0oA.js";
|
|
7
7
|
import { i as DeploymentConfig, l as SelectionState, r as DeploymentByStatusKey, t as Deployment } from "./index-CkwVnIqd.js";
|
|
@@ -41,7 +41,8 @@ declare const _default: {
|
|
|
41
41
|
setShowStartupNotification: _$_reduxjs_toolkit0.ActionCreatorWithPayload<boolean, "users/setShowStartupNotification">;
|
|
42
42
|
receiveRelease: _$_reduxjs_toolkit0.ActionCreatorWithPayload<Release, "releases/receiveRelease">;
|
|
43
43
|
receiveReleases: _$_reduxjs_toolkit0.ActionCreatorWithPayload<Record<string, Release>, "releases/receiveReleases">;
|
|
44
|
-
|
|
44
|
+
receiveSoftwareTags: _$_reduxjs_toolkit0.ActionCreatorWithPayload<_$_northern_tech_types_types_gen0.Tags, "releases/receiveSoftwareTags">;
|
|
45
|
+
receiveReleaseTags: _$_reduxjs_toolkit0.ActionCreatorWithPayload<_$_northern_tech_types_types_gen0.Tags, "releases/receiveReleaseTags">;
|
|
45
46
|
receiveReleaseTypes: _$_reduxjs_toolkit0.ActionCreatorWithPayload<string[], "releases/receiveReleaseTypes">;
|
|
46
47
|
removeRelease: _$_reduxjs_toolkit0.ActionCreatorWithPayload<string, "releases/removeRelease">;
|
|
47
48
|
selectedRelease: _$_reduxjs_toolkit0.ActionCreatorWithPayload<string | null, "releases/selectedRelease">;
|
|
@@ -53,7 +54,9 @@ declare const _default: {
|
|
|
53
54
|
setActiveTab: _$_reduxjs_toolkit0.ActionCreatorWithPayload<"releases" | "delta" | "manifests", "releases/setActiveTab">;
|
|
54
55
|
receiveManifest: _$_reduxjs_toolkit0.ActionCreatorWithPayload<_$_northern_tech_types_types_gen0.Manifest, "releases/receiveManifest">;
|
|
55
56
|
receiveManifests: _$_reduxjs_toolkit0.ActionCreatorWithPayload<Record<string, _$_northern_tech_types_types_gen0.Manifest>, "releases/receiveManifests">;
|
|
57
|
+
receiveManifestTags: _$_reduxjs_toolkit0.ActionCreatorWithPayload<_$_northern_tech_types_types_gen0.Tags, "releases/receiveManifestTags">;
|
|
56
58
|
removeManifest: _$_reduxjs_toolkit0.ActionCreatorWithPayload<string, "releases/removeManifest">;
|
|
59
|
+
removeManifests: _$_reduxjs_toolkit0.ActionCreatorWithPayload<string[], "releases/removeManifests">;
|
|
57
60
|
selectedManifest: _$_reduxjs_toolkit0.ActionCreatorWithPayload<string | null, "releases/selectedManifest">;
|
|
58
61
|
setManifestsListState: _$_reduxjs_toolkit0.ActionCreatorWithPayload<ManifestsList, "releases/setManifestsListState">;
|
|
59
62
|
receiveAuditLogs: _$_reduxjs_toolkit0.ActionCreatorWithPayload<{
|
package/dist/api/general-api.cjs
CHANGED
|
@@ -6,9 +6,9 @@ const require_chunk = require("../chunk-CKQMccvm.cjs");
|
|
|
6
6
|
const require_constants = require("../constants.cjs");
|
|
7
7
|
const require_auth = require("../auth.cjs");
|
|
8
8
|
let universal_cookie = require("universal-cookie");
|
|
9
|
-
universal_cookie = require_chunk.__toESM(universal_cookie);
|
|
9
|
+
universal_cookie = require_chunk.__toESM(universal_cookie, 1);
|
|
10
10
|
let axios = require("axios");
|
|
11
|
-
axios = require_chunk.__toESM(axios);
|
|
11
|
+
axios = require_chunk.__toESM(axios, 1);
|
|
12
12
|
//#region src/api/general-api.ts
|
|
13
13
|
const cookies = new universal_cookie.default();
|
|
14
14
|
const unauthorizedRedirect = (error) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"general-api.cjs","names":["Cookies","getToken","TIMEOUTS"],"sources":["../../src/api/general-api.ts"],"sourcesContent":["// Copyright 2017 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 type { AxiosError, AxiosProgressEvent, AxiosRequestConfig, GenericAbortSignal, InternalAxiosRequestConfig } from 'axios';\nimport axios, { isCancel } from 'axios';\nimport Cookies from 'universal-cookie';\n\nimport { cleanUp, getToken } from '../auth';\nimport { TIMEOUTS } from '../constants';\n\nconst cookies = new Cookies();\n\nconst unauthorizedRedirect = (error: AxiosError): Promise<never> => {\n if (!isCancel(error) && error.response?.status === 401 && getToken() && !window.location.pathname.endsWith('/subscription')) {\n // a new jwt might have been set by sso while the current request was in-flight with an old token\n // => reload instead of logging out\n if (cookies.get('JWT', { doNotParse: true })) {\n window.location.reload();\n return Promise.reject(error);\n }\n cleanUp();\n window.location.replace('/ui/');\n }\n return Promise.reject(error);\n};\n\nexport const commonRequestConfig: AxiosRequestConfig = { timeout: TIMEOUTS.refreshDefault, headers: { 'Content-Type': 'application/json' } };\n\nexport const authenticatedRequest = axios.create(commonRequestConfig);\nauthenticatedRequest.interceptors.response.use(res => res, unauthorizedRedirect);\nauthenticatedRequest.interceptors.request.use(\n (config: InternalAxiosRequestConfig) => {\n config.headers.Authorization = `Bearer ${getToken()}`;\n return config;\n },\n (error: AxiosError) => Promise.reject(error)\n);\n\nconst Api = {\n get: authenticatedRequest.get,\n delete: <T = unknown, D = unknown>(url: string, data?: D) => authenticatedRequest.request<T>({ method: 'delete', url, data }),\n patch: authenticatedRequest.patch,\n post: authenticatedRequest.post,\n postUnauthorized: <T = unknown, D = unknown>(url: string, data?: D, config: AxiosRequestConfig = {}) =>\n axios.post<T>(url, data, { ...commonRequestConfig, ...config }),\n put: authenticatedRequest.put,\n upload: <T = unknown>(url: string, formData: FormData, progress: (event: AxiosProgressEvent) => void, cancelSignal: GenericAbortSignal) =>\n authenticatedRequest.post<T>(url, formData, {\n headers: { 'Content-Type': 'multipart/form-data' },\n onUploadProgress: progress,\n timeout: 0,\n signal: cancelSignal\n }),\n uploadPut: <T = unknown>(url: string, formData: FormData, progress: (event: AxiosProgressEvent) => void, cancelSignal: GenericAbortSignal) =>\n authenticatedRequest.put<T>(url, formData, {\n headers: { 'Content-Type': 'multipart/form-data' },\n onUploadProgress: progress,\n timeout: 0,\n signal: cancelSignal\n })\n};\n\nexport default Api;\n"],"mappings":";;;;;;;;;;;;AAoBA,MAAM,UAAU,IAAIA,iBAAAA,SAAS;AAE7B,MAAM,wBAAwB,UAAsC;
|
|
1
|
+
{"version":3,"file":"general-api.cjs","names":["Cookies","getToken","TIMEOUTS"],"sources":["../../src/api/general-api.ts"],"sourcesContent":["// Copyright 2017 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 type { AxiosError, AxiosProgressEvent, AxiosRequestConfig, GenericAbortSignal, InternalAxiosRequestConfig } from 'axios';\nimport axios, { isCancel } from 'axios';\nimport Cookies from 'universal-cookie';\n\nimport { cleanUp, getToken } from '../auth';\nimport { TIMEOUTS } from '../constants';\n\nconst cookies = new Cookies();\n\nconst unauthorizedRedirect = (error: AxiosError): Promise<never> => {\n if (!isCancel(error) && error.response?.status === 401 && getToken() && !window.location.pathname.endsWith('/subscription')) {\n // a new jwt might have been set by sso while the current request was in-flight with an old token\n // => reload instead of logging out\n if (cookies.get('JWT', { doNotParse: true })) {\n window.location.reload();\n return Promise.reject(error);\n }\n cleanUp();\n window.location.replace('/ui/');\n }\n return Promise.reject(error);\n};\n\nexport const commonRequestConfig: AxiosRequestConfig = { timeout: TIMEOUTS.refreshDefault, headers: { 'Content-Type': 'application/json' } };\n\nexport const authenticatedRequest = axios.create(commonRequestConfig);\nauthenticatedRequest.interceptors.response.use(res => res, unauthorizedRedirect);\nauthenticatedRequest.interceptors.request.use(\n (config: InternalAxiosRequestConfig) => {\n config.headers.Authorization = `Bearer ${getToken()}`;\n return config;\n },\n (error: AxiosError) => Promise.reject(error)\n);\n\nconst Api = {\n get: authenticatedRequest.get,\n delete: <T = unknown, D = unknown>(url: string, data?: D) => authenticatedRequest.request<T>({ method: 'delete', url, data }),\n patch: authenticatedRequest.patch,\n post: authenticatedRequest.post,\n postUnauthorized: <T = unknown, D = unknown>(url: string, data?: D, config: AxiosRequestConfig = {}) =>\n axios.post<T>(url, data, { ...commonRequestConfig, ...config }),\n put: authenticatedRequest.put,\n upload: <T = unknown>(url: string, formData: FormData, progress: (event: AxiosProgressEvent) => void, cancelSignal: GenericAbortSignal) =>\n authenticatedRequest.post<T>(url, formData, {\n headers: { 'Content-Type': 'multipart/form-data' },\n onUploadProgress: progress,\n timeout: 0,\n signal: cancelSignal\n }),\n uploadPut: <T = unknown>(url: string, formData: FormData, progress: (event: AxiosProgressEvent) => void, cancelSignal: GenericAbortSignal) =>\n authenticatedRequest.put<T>(url, formData, {\n headers: { 'Content-Type': 'multipart/form-data' },\n onUploadProgress: progress,\n timeout: 0,\n signal: cancelSignal\n })\n};\n\nexport default Api;\n"],"mappings":";;;;;;;;;;;;AAoBA,MAAM,UAAU,IAAIA,iBAAAA,SAA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S,EAAE,gBAAgB,uBAAuB;EAClD,kBAAkB;EAClB,SAAS;EACT,QAAQ;EACT,CAAC;CACL"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"general-api.js","names":[],"sources":["../../src/api/general-api.ts"],"sourcesContent":["// Copyright 2017 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 type { AxiosError, AxiosProgressEvent, AxiosRequestConfig, GenericAbortSignal, InternalAxiosRequestConfig } from 'axios';\nimport axios, { isCancel } from 'axios';\nimport Cookies from 'universal-cookie';\n\nimport { cleanUp, getToken } from '../auth';\nimport { TIMEOUTS } from '../constants';\n\nconst cookies = new Cookies();\n\nconst unauthorizedRedirect = (error: AxiosError): Promise<never> => {\n if (!isCancel(error) && error.response?.status === 401 && getToken() && !window.location.pathname.endsWith('/subscription')) {\n // a new jwt might have been set by sso while the current request was in-flight with an old token\n // => reload instead of logging out\n if (cookies.get('JWT', { doNotParse: true })) {\n window.location.reload();\n return Promise.reject(error);\n }\n cleanUp();\n window.location.replace('/ui/');\n }\n return Promise.reject(error);\n};\n\nexport const commonRequestConfig: AxiosRequestConfig = { timeout: TIMEOUTS.refreshDefault, headers: { 'Content-Type': 'application/json' } };\n\nexport const authenticatedRequest = axios.create(commonRequestConfig);\nauthenticatedRequest.interceptors.response.use(res => res, unauthorizedRedirect);\nauthenticatedRequest.interceptors.request.use(\n (config: InternalAxiosRequestConfig) => {\n config.headers.Authorization = `Bearer ${getToken()}`;\n return config;\n },\n (error: AxiosError) => Promise.reject(error)\n);\n\nconst Api = {\n get: authenticatedRequest.get,\n delete: <T = unknown, D = unknown>(url: string, data?: D) => authenticatedRequest.request<T>({ method: 'delete', url, data }),\n patch: authenticatedRequest.patch,\n post: authenticatedRequest.post,\n postUnauthorized: <T = unknown, D = unknown>(url: string, data?: D, config: AxiosRequestConfig = {}) =>\n axios.post<T>(url, data, { ...commonRequestConfig, ...config }),\n put: authenticatedRequest.put,\n upload: <T = unknown>(url: string, formData: FormData, progress: (event: AxiosProgressEvent) => void, cancelSignal: GenericAbortSignal) =>\n authenticatedRequest.post<T>(url, formData, {\n headers: { 'Content-Type': 'multipart/form-data' },\n onUploadProgress: progress,\n timeout: 0,\n signal: cancelSignal\n }),\n uploadPut: <T = unknown>(url: string, formData: FormData, progress: (event: AxiosProgressEvent) => void, cancelSignal: GenericAbortSignal) =>\n authenticatedRequest.put<T>(url, formData, {\n headers: { 'Content-Type': 'multipart/form-data' },\n onUploadProgress: progress,\n timeout: 0,\n signal: cancelSignal\n })\n};\n\nexport default Api;\n"],"mappings":";;;;;AAoBA,MAAM,UAAU,IAAI,SAAS;AAE7B,MAAM,wBAAwB,UAAsC;
|
|
1
|
+
{"version":3,"file":"general-api.js","names":[],"sources":["../../src/api/general-api.ts"],"sourcesContent":["// Copyright 2017 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 type { AxiosError, AxiosProgressEvent, AxiosRequestConfig, GenericAbortSignal, InternalAxiosRequestConfig } from 'axios';\nimport axios, { isCancel } from 'axios';\nimport Cookies from 'universal-cookie';\n\nimport { cleanUp, getToken } from '../auth';\nimport { TIMEOUTS } from '../constants';\n\nconst cookies = new Cookies();\n\nconst unauthorizedRedirect = (error: AxiosError): Promise<never> => {\n if (!isCancel(error) && error.response?.status === 401 && getToken() && !window.location.pathname.endsWith('/subscription')) {\n // a new jwt might have been set by sso while the current request was in-flight with an old token\n // => reload instead of logging out\n if (cookies.get('JWT', { doNotParse: true })) {\n window.location.reload();\n return Promise.reject(error);\n }\n cleanUp();\n window.location.replace('/ui/');\n }\n return Promise.reject(error);\n};\n\nexport const commonRequestConfig: AxiosRequestConfig = { timeout: TIMEOUTS.refreshDefault, headers: { 'Content-Type': 'application/json' } };\n\nexport const authenticatedRequest = axios.create(commonRequestConfig);\nauthenticatedRequest.interceptors.response.use(res => res, unauthorizedRedirect);\nauthenticatedRequest.interceptors.request.use(\n (config: InternalAxiosRequestConfig) => {\n config.headers.Authorization = `Bearer ${getToken()}`;\n return config;\n },\n (error: AxiosError) => Promise.reject(error)\n);\n\nconst Api = {\n get: authenticatedRequest.get,\n delete: <T = unknown, D = unknown>(url: string, data?: D) => authenticatedRequest.request<T>({ method: 'delete', url, data }),\n patch: authenticatedRequest.patch,\n post: authenticatedRequest.post,\n postUnauthorized: <T = unknown, D = unknown>(url: string, data?: D, config: AxiosRequestConfig = {}) =>\n axios.post<T>(url, data, { ...commonRequestConfig, ...config }),\n put: authenticatedRequest.put,\n upload: <T = unknown>(url: string, formData: FormData, progress: (event: AxiosProgressEvent) => void, cancelSignal: GenericAbortSignal) =>\n authenticatedRequest.post<T>(url, formData, {\n headers: { 'Content-Type': 'multipart/form-data' },\n onUploadProgress: progress,\n timeout: 0,\n signal: cancelSignal\n }),\n uploadPut: <T = unknown>(url: string, formData: FormData, progress: (event: AxiosProgressEvent) => void, cancelSignal: GenericAbortSignal) =>\n authenticatedRequest.put<T>(url, formData, {\n headers: { 'Content-Type': 'multipart/form-data' },\n onUploadProgress: progress,\n timeout: 0,\n signal: cancelSignal\n })\n};\n\nexport default Api;\n"],"mappings":";;;;;AAoBA,MAAM,UAAU,IAAI,SAAS;AAE7B,MAAM,wBAAwB,UAAsC;CAClE,IAAI,CAAC,SAAS,MAAM,IAAI,M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,7 @@ const require_chunk = require("../chunk-CKQMccvm.cjs");
|
|
|
2
2
|
const require_auth = require("../auth.cjs");
|
|
3
3
|
const require_api_general_api = require("./general-api.cjs");
|
|
4
4
|
let axios = require("axios");
|
|
5
|
-
axios = require_chunk.__toESM(axios);
|
|
5
|
+
axios = require_chunk.__toESM(axios, 1);
|
|
6
6
|
//#region src/api/users-api.ts
|
|
7
7
|
const Api = {
|
|
8
8
|
postLogin: (url, { email: username, password = "", ...body }) => axios.default.post(url, body, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"users-api.cjs","names":["commonRequestConfig","getToken"],"sources":["../../src/api/users-api.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 type { LoginOptions } from '@northern.tech/types/MenderTypes';\nimport axios from 'axios';\n\nimport { getToken } from '../auth';\nimport { commonRequestConfig } from './general-api';\n\ntype PostLoginBody = LoginOptions & {\n email: string;\n password?: string;\n};\n\ntype VerifyTFAData = Pick<LoginOptions, 'token2fa'>;\n\nconst Api = {\n postLogin: (url: string, { email: username, password = '', ...body }: PostLoginBody) =>\n axios\n .post(url, body, { ...commonRequestConfig, auth: { username, password } })\n .then(res => ({ text: res.data as string, code: res.status, contentType: res.headers?.['content-type'] as string | undefined })),\n putVerifyTFA: (url: string, userData: VerifyTFAData) => {\n let body: VerifyTFAData = {};\n if (Object.hasOwn(userData, 'token2fa')) {\n body = { token2fa: userData.token2fa };\n }\n return axios.put(url, body, { ...commonRequestConfig, headers: { ...commonRequestConfig.headers, Authorization: `Bearer ${getToken()}` } });\n }\n};\n\nexport default Api;\n"],"mappings":";;;;;;AA0BA,MAAM,MAAM;CACV,YAAY,KAAa,EAAE,OAAO,UAAU,WAAW,IAAI,GAAG,WAC5D,MAAA,QACG,KAAK,KAAK,MAAM;EAAE,GAAGA,wBAAAA;EAAqB,MAAM;GAAE;GAAU;GAAU;EAAE,CAAC,CACzE,MAAK,SAAQ;EAAE,MAAM,IAAI;EAAgB,MAAM,IAAI;EAAQ,aAAa,IAAI,UAAU;EAAuC,EAAE;CACpI,eAAe,KAAa,aAA4B;EACtD,IAAI,OAAsB,EAAE;
|
|
1
|
+
{"version":3,"file":"users-api.cjs","names":["commonRequestConfig","getToken"],"sources":["../../src/api/users-api.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 type { LoginOptions } from '@northern.tech/types/MenderTypes';\nimport axios from 'axios';\n\nimport { getToken } from '../auth';\nimport { commonRequestConfig } from './general-api';\n\ntype PostLoginBody = LoginOptions & {\n email: string;\n password?: string;\n};\n\ntype VerifyTFAData = Pick<LoginOptions, 'token2fa'>;\n\nconst Api = {\n postLogin: (url: string, { email: username, password = '', ...body }: PostLoginBody) =>\n axios\n .post(url, body, { ...commonRequestConfig, auth: { username, password } })\n .then(res => ({ text: res.data as string, code: res.status, contentType: res.headers?.['content-type'] as string | undefined })),\n putVerifyTFA: (url: string, userData: VerifyTFAData) => {\n let body: VerifyTFAData = {};\n if (Object.hasOwn(userData, 'token2fa')) {\n body = { token2fa: userData.token2fa };\n }\n return axios.put(url, body, { ...commonRequestConfig, headers: { ...commonRequestConfig.headers, Authorization: `Bearer ${getToken()}` } });\n }\n};\n\nexport default Api;\n"],"mappings":";;;;;;AA0BA,MAAM,MAAM;CACV,YAAY,KAAa,EAAE,OAAO,UAAU,WAAW,IAAI,GAAG,WAC5D,MAAA,QACG,KAAK,KAAK,MAAM;EAAE,GAAGA,wBAAAA;EAAqB,MAAM;GAAE;GAAU;GAAU;EAAE,CAAC,CACzE,MAAK,SAAQ;EAAE,MAAM,IAAI;EAAgB,MAAM,IAAI;EAAQ,aAAa,IAAI,UAAU;EAAuC,EAAE;CACpI,eAAe,KAAa,aAA4B;EACtD,IAAI,OAAsB,EAAE;EAC5B,IAAI,OAAO,OAAO,UAAU,WAAW,EACrC,OAAO,EAAE,UAAU,SAAS,UAAU;EAExC,OAAO,MAAA,QAAM,IAAI,KAAK,MAAM;GAAE,GAAGA,wBAAAA;GAAqB,SAAS;IAAE,GAAGA,wBAAAA,oBAAoB;IAAS,eAAe,UAAUC,aAAAA,UAAU;IAAI;GAAE,CAAC;;CAE9I"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"users-api.js","names":[],"sources":["../../src/api/users-api.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 type { LoginOptions } from '@northern.tech/types/MenderTypes';\nimport axios from 'axios';\n\nimport { getToken } from '../auth';\nimport { commonRequestConfig } from './general-api';\n\ntype PostLoginBody = LoginOptions & {\n email: string;\n password?: string;\n};\n\ntype VerifyTFAData = Pick<LoginOptions, 'token2fa'>;\n\nconst Api = {\n postLogin: (url: string, { email: username, password = '', ...body }: PostLoginBody) =>\n axios\n .post(url, body, { ...commonRequestConfig, auth: { username, password } })\n .then(res => ({ text: res.data as string, code: res.status, contentType: res.headers?.['content-type'] as string | undefined })),\n putVerifyTFA: (url: string, userData: VerifyTFAData) => {\n let body: VerifyTFAData = {};\n if (Object.hasOwn(userData, 'token2fa')) {\n body = { token2fa: userData.token2fa };\n }\n return axios.put(url, body, { ...commonRequestConfig, headers: { ...commonRequestConfig.headers, Authorization: `Bearer ${getToken()}` } });\n }\n};\n\nexport default Api;\n"],"mappings":";;;;AA0BA,MAAM,MAAM;CACV,YAAY,KAAa,EAAE,OAAO,UAAU,WAAW,IAAI,GAAG,WAC5D,MACG,KAAK,KAAK,MAAM;EAAE,GAAG;EAAqB,MAAM;GAAE;GAAU;GAAU;EAAE,CAAC,CACzE,MAAK,SAAQ;EAAE,MAAM,IAAI;EAAgB,MAAM,IAAI;EAAQ,aAAa,IAAI,UAAU;EAAuC,EAAE;CACpI,eAAe,KAAa,aAA4B;EACtD,IAAI,OAAsB,EAAE;
|
|
1
|
+
{"version":3,"file":"users-api.js","names":[],"sources":["../../src/api/users-api.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 type { LoginOptions } from '@northern.tech/types/MenderTypes';\nimport axios from 'axios';\n\nimport { getToken } from '../auth';\nimport { commonRequestConfig } from './general-api';\n\ntype PostLoginBody = LoginOptions & {\n email: string;\n password?: string;\n};\n\ntype VerifyTFAData = Pick<LoginOptions, 'token2fa'>;\n\nconst Api = {\n postLogin: (url: string, { email: username, password = '', ...body }: PostLoginBody) =>\n axios\n .post(url, body, { ...commonRequestConfig, auth: { username, password } })\n .then(res => ({ text: res.data as string, code: res.status, contentType: res.headers?.['content-type'] as string | undefined })),\n putVerifyTFA: (url: string, userData: VerifyTFAData) => {\n let body: VerifyTFAData = {};\n if (Object.hasOwn(userData, 'token2fa')) {\n body = { token2fa: userData.token2fa };\n }\n return axios.put(url, body, { ...commonRequestConfig, headers: { ...commonRequestConfig.headers, Authorization: `Bearer ${getToken()}` } });\n }\n};\n\nexport default Api;\n"],"mappings":";;;;AA0BA,MAAM,MAAM;CACV,YAAY,KAAa,EAAE,OAAO,UAAU,WAAW,IAAI,GAAG,WAC5D,MACG,KAAK,KAAK,MAAM;EAAE,GAAG;EAAqB,MAAM;GAAE;GAAU;GAAU;EAAE,CAAC,CACzE,MAAK,SAAQ;EAAE,MAAM,IAAI;EAAgB,MAAM,IAAI;EAAQ,aAAa,IAAI,UAAU;EAAuC,EAAE;CACpI,eAAe,KAAa,aAA4B;EACtD,IAAI,OAAsB,EAAE;EAC5B,IAAI,OAAO,OAAO,UAAU,WAAW,EACrC,OAAO,EAAE,UAAU,SAAS,UAAU;EAExC,OAAO,MAAM,IAAI,KAAK,MAAM;GAAE,GAAG;GAAqB,SAAS;IAAE,GAAG,oBAAoB;IAAS,eAAe,UAAU,UAAU;IAAI;GAAE,CAAC;;CAE9I"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.cjs","names":["BarChartIcon","PieChartIcon","yesUtil"],"sources":["../../src/appSlice/constants.ts"],"sourcesContent":["// Copyright 2019 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 { BarChart as BarChartIcon,
|
|
1
|
+
{"version":3,"file":"constants.cjs","names":["BarChartIcon","PieChartIcon","yesUtil"],"sources":["../../src/appSlice/constants.ts"],"sourcesContent":["// Copyright 2019 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 { BarChart as BarChartIcon, PieChartOutlined as PieChartIcon } from '@mui/icons-material';\n\nimport { yes as yesUtil } from '@northern.tech/utils';\n\nexport const chartTypes = {\n bar: { key: 'bar', Icon: BarChartIcon },\n pie: { key: 'pie', Icon: PieChartIcon }\n} as const;\nexport const emptyChartSelection = { software: '', group: '', chartType: chartTypes.bar.key, attribute: 'artifact_name' };\nexport const defaultReportType = 'distribution';\nexport const defaultReports = [{ ...emptyChartSelection, group: null, attribute: 'artifact_name', type: defaultReportType }];\n\nexport const BEGINNING_OF_TIME = '2016-01-01T00:00:00.000Z';\n\nexport const locations = {\n cn: { key: 'cn', title: 'China', location: 'hosted.mender.cn' },\n eu: { key: 'eu', title: 'EU', location: 'eu.hosted.mender.io' },\n us: { key: 'us', title: 'US', location: 'hosted.mender.io' }\n} as const;\nexport type AvailablePlans = 'os' | 'professional' | 'enterprise';\n\nexport type Plan = {\n description: string;\n id: AvailablePlans;\n name: string;\n};\n\nexport type AvailableAddon = 'configure' | 'troubleshoot' | 'monitor';\n\nexport const PLANS: { [key in AvailablePlans]: Plan } = {\n os: {\n id: 'os',\n name: 'Basic',\n description:\n 'The core features of Mender. To continue using Enterprise Trial features—like Delta updates, scheduled deployments, phased rollouts, device filtering, dynamic groups, RBAC, audit logs, and more—please upgrade to a higher plan.'\n },\n professional: {\n id: 'professional',\n name: 'Professional',\n description: 'Everything in Basic, plus enhanced update management and automation features.'\n },\n enterprise: {\n id: 'enterprise',\n name: 'Enterprise',\n description:\n 'Every advanced feature of Mender, tailored for complex and large-scale deployments. Not available as a monthly subscription — ask us for a quote.'\n }\n} as const;\nexport type Addon = {\n description: string;\n eligible: AvailablePlans[];\n id: string;\n needs: string[];\n title: string;\n};\n\nexport type AddonId = keyof typeof ADDONS;\n\n// the needs names need to be aligned with the name of the features in the appReducer, as they will be checked in the addonselection\nexport const ADDONS: { [key in AvailableAddon]: Addon } = {\n configure: {\n id: 'configure',\n title: 'Configure',\n description: 'Seamlessly configure applications and devices remotely – configure each device to its environment.',\n needs: ['hasDeviceConfig'],\n eligible: ['os', 'professional', 'enterprise']\n },\n monitor: {\n id: 'monitor',\n title: 'Monitor',\n description: 'Detect and analyze health issues of devices, services and applications. Set up alerts so you can act quickly.',\n needs: ['hasMonitor'],\n eligible: ['professional', 'enterprise']\n },\n troubleshoot: {\n id: 'troubleshoot',\n title: 'Troubleshoot',\n description: 'Secure, remote access to your devices – quickly diagnose and fix issues in real time.',\n needs: ['hasDeviceConnect'],\n eligible: ['os', 'professional', 'enterprise']\n }\n};\n\nexport const BENEFITS = {\n auditlog: {\n id: 'auditlog',\n benefit: 'gain access to logs for important events such as changes to devices, deployments and user management, as well as remote terminal session replays',\n requiredPlan: PLANS.enterprise.id\n },\n dashboard: { id: 'dashboard', benefit: 'actionable insights into the devices you are updating with Mender', requiredPlan: PLANS.enterprise.id },\n deltaGeneration: {\n id: 'deltaGeneration',\n benefit: 'automatic delta artifacts generation to minimize data transfer and improve the update delivery',\n requiredPlan: PLANS.enterprise.id\n },\n deviceConfiguration: { id: 'deviceConfiguration', benefit: 'device configuration features', requiredAddon: ADDONS.configure.id },\n deviceMonitor: { id: 'deviceMonitor', benefit: 'device monitoring features', requiredAddon: ADDONS.monitor.id, requiredPlan: PLANS.professional.id },\n deviceTroubleshoot: { id: 'deviceTroubleshoot', benefit: 'device troubleshooting features', requiredAddon: ADDONS.troubleshoot.id },\n dynamicGroups: { id: 'dynamicGroups', benefit: 'create dynamic groups to ease device management', requiredPlan: PLANS.enterprise.id },\n fullFiltering: { id: 'fullFiltering', benefit: 'filtering by multiple attributes to improve the device overview', requiredPlan: PLANS.professional.id },\n gateway: { id: 'gateway', benefit: 'see devices connected to your gateway device for easy access', requiredPlans: PLANS.professional.id },\n pausedDeployments: {\n id: 'pausedDeployments',\n benefit: 'granular control about update rollout to allow synchronization across your fleet',\n requiredPlan: PLANS.enterprise.id\n },\n phasedDeployments: { id: 'phasedDeployments', benefit: 'choose to roll out deployments in multiple phases', requiredPlan: PLANS.enterprise.id },\n rbac: { id: 'rbac', benefit: 'granular role based access control', requiredPlan: PLANS.enterprise.id },\n retryDeployments: { id: 'retryDeployments', benefit: 'optional retries for failed rollout attempts', requiredPlan: PLANS.professional.id },\n scheduledDeployments: {\n id: 'scheduledDeployments',\n benefit: 'scheduled deployments to steer the distribution of your updates.',\n requiredPlan: PLANS.professional.id\n },\n manifests: {\n id: 'manifests',\n benefit: 'orchestrate multi-component updates with manifests for complex device software management',\n requiredPlan: PLANS.enterprise.id\n },\n webhookEvents: {\n id: 'webhookEvents',\n benefit: 'receive inventory events and select which type(s) of events the webhook will receive',\n requiredPlan: PLANS.professional.id\n },\n\n default: { id: 'default', benefit: 'gain access to this feature', requiredPlan: PLANS.enterprise.id }\n} as const;\n\nexport const yes = yesUtil;\nexport const canAccess = yes;\n\nexport const DARK_MODE = 'dark';\nexport const LIGHT_MODE = 'light';\n"],"mappings":";;;;;AAiBA,MAAa,aAAa;CACxB,KAAK;EAAE,KAAK;EAAO,MAAMA,oBAAAA;EAAc;CACvC,KAAK;EAAE,KAAK;EAAO,MAAMC,oBAAAA;EAAc;CACxC;AACD,MAAa,sBAAsB;CAAE,UAAU;CAAI,OAAO;CAAI,WAAW,WAAW,IAAI;CAAK,WAAW;CAAiB;AACzH,MAAa,oBAAoB;AACjC,MAAa,iBAAiB,CAAC;CAAE,GAAG;CAAqB,OAAO;CAAM,WAAW;CAAiB,MAAM;CAAmB,CAAC;AAE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AS;EAAmD,cAAc,MAAM,WAAW;EAAI;CACrI,eAAe;EAAE,IAAI;EAAiB,SAAS;EAAmE,cAAc,MAAM,aAAa;EAAI;CACvJ,SAAS;EAAE,IAAI;EAAW,SAAS;EAAgE,eAAe,MAAM,aAAa;EAAI;CACzI,mBAAmB;EACjB,IAAI;EACJ,SAAS;EACT,cAAc,MAAM,WAAW;EAChC;CACD,mBAAmB;EAAE,IAAI;EAAqB,SAAS;EAAqD,cAAc,MAAM,WAAW;EAAI;CAC/I,MAAM;EAAE,IAAI;EAAQ,SAAS;EAAsC,cAAc,MAAM,WAAW;EAAI;CACtG,kBAAkB;EAAE,IAAI;EAAoB,SAAS;EAAgD,cAAc,MAAM,aAAa;EAAI;CAC1I,sBAAsB;EACpB,IAAI;EACJ,SAAS;EACT,cAAc,MAAM,aAAa;EAClC;CACD,WAAW;EACT,IAAI;EACJ,SAAS;EACT,cAAc,MAAM,WAAW;EAChC;CACD,eAAe;EACb,IAAI;EACJ,SAAS;EACT,cAAc,MAAM,aAAa;EAClC;CAED,SAAS;EAAE,IAAI;EAAW,SAAS;EAA+B,cAAc,MAAM,WAAW;EAAI;CACtG;AAED,MAAa,MAAMC,qBAAAA;AACnB,MAAa,YAAY;AAEzB,MAAa,YAAY;AACzB,MAAa,aAAa"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BarChart,
|
|
1
|
+
import { BarChart, PieChartOutlined } from "@mui/icons-material";
|
|
2
2
|
import { yes as yes$1 } from "@northern.tech/utils";
|
|
3
3
|
//#region src/appSlice/constants.ts
|
|
4
4
|
const chartTypes = {
|
|
@@ -8,7 +8,7 @@ const chartTypes = {
|
|
|
8
8
|
},
|
|
9
9
|
pie: {
|
|
10
10
|
key: "pie",
|
|
11
|
-
Icon:
|
|
11
|
+
Icon: PieChartOutlined
|
|
12
12
|
}
|
|
13
13
|
};
|
|
14
14
|
const emptyChartSelection = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","names":["BarChartIcon","PieChartIcon","yesUtil"],"sources":["../../src/appSlice/constants.ts"],"sourcesContent":["// Copyright 2019 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 { BarChart as BarChartIcon,
|
|
1
|
+
{"version":3,"file":"constants.js","names":["BarChartIcon","PieChartIcon","yesUtil"],"sources":["../../src/appSlice/constants.ts"],"sourcesContent":["// Copyright 2019 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 { BarChart as BarChartIcon, PieChartOutlined as PieChartIcon } from '@mui/icons-material';\n\nimport { yes as yesUtil } from '@northern.tech/utils';\n\nexport const chartTypes = {\n bar: { key: 'bar', Icon: BarChartIcon },\n pie: { key: 'pie', Icon: PieChartIcon }\n} as const;\nexport const emptyChartSelection = { software: '', group: '', chartType: chartTypes.bar.key, attribute: 'artifact_name' };\nexport const defaultReportType = 'distribution';\nexport const defaultReports = [{ ...emptyChartSelection, group: null, attribute: 'artifact_name', type: defaultReportType }];\n\nexport const BEGINNING_OF_TIME = '2016-01-01T00:00:00.000Z';\n\nexport const locations = {\n cn: { key: 'cn', title: 'China', location: 'hosted.mender.cn' },\n eu: { key: 'eu', title: 'EU', location: 'eu.hosted.mender.io' },\n us: { key: 'us', title: 'US', location: 'hosted.mender.io' }\n} as const;\nexport type AvailablePlans = 'os' | 'professional' | 'enterprise';\n\nexport type Plan = {\n description: string;\n id: AvailablePlans;\n name: string;\n};\n\nexport type AvailableAddon = 'configure' | 'troubleshoot' | 'monitor';\n\nexport const PLANS: { [key in AvailablePlans]: Plan } = {\n os: {\n id: 'os',\n name: 'Basic',\n description:\n 'The core features of Mender. To continue using Enterprise Trial features—like Delta updates, scheduled deployments, phased rollouts, device filtering, dynamic groups, RBAC, audit logs, and more—please upgrade to a higher plan.'\n },\n professional: {\n id: 'professional',\n name: 'Professional',\n description: 'Everything in Basic, plus enhanced update management and automation features.'\n },\n enterprise: {\n id: 'enterprise',\n name: 'Enterprise',\n description:\n 'Every advanced feature of Mender, tailored for complex and large-scale deployments. Not available as a monthly subscription — ask us for a quote.'\n }\n} as const;\nexport type Addon = {\n description: string;\n eligible: AvailablePlans[];\n id: string;\n needs: string[];\n title: string;\n};\n\nexport type AddonId = keyof typeof ADDONS;\n\n// the needs names need to be aligned with the name of the features in the appReducer, as they will be checked in the addonselection\nexport const ADDONS: { [key in AvailableAddon]: Addon } = {\n configure: {\n id: 'configure',\n title: 'Configure',\n description: 'Seamlessly configure applications and devices remotely – configure each device to its environment.',\n needs: ['hasDeviceConfig'],\n eligible: ['os', 'professional', 'enterprise']\n },\n monitor: {\n id: 'monitor',\n title: 'Monitor',\n description: 'Detect and analyze health issues of devices, services and applications. Set up alerts so you can act quickly.',\n needs: ['hasMonitor'],\n eligible: ['professional', 'enterprise']\n },\n troubleshoot: {\n id: 'troubleshoot',\n title: 'Troubleshoot',\n description: 'Secure, remote access to your devices – quickly diagnose and fix issues in real time.',\n needs: ['hasDeviceConnect'],\n eligible: ['os', 'professional', 'enterprise']\n }\n};\n\nexport const BENEFITS = {\n auditlog: {\n id: 'auditlog',\n benefit: 'gain access to logs for important events such as changes to devices, deployments and user management, as well as remote terminal session replays',\n requiredPlan: PLANS.enterprise.id\n },\n dashboard: { id: 'dashboard', benefit: 'actionable insights into the devices you are updating with Mender', requiredPlan: PLANS.enterprise.id },\n deltaGeneration: {\n id: 'deltaGeneration',\n benefit: 'automatic delta artifacts generation to minimize data transfer and improve the update delivery',\n requiredPlan: PLANS.enterprise.id\n },\n deviceConfiguration: { id: 'deviceConfiguration', benefit: 'device configuration features', requiredAddon: ADDONS.configure.id },\n deviceMonitor: { id: 'deviceMonitor', benefit: 'device monitoring features', requiredAddon: ADDONS.monitor.id, requiredPlan: PLANS.professional.id },\n deviceTroubleshoot: { id: 'deviceTroubleshoot', benefit: 'device troubleshooting features', requiredAddon: ADDONS.troubleshoot.id },\n dynamicGroups: { id: 'dynamicGroups', benefit: 'create dynamic groups to ease device management', requiredPlan: PLANS.enterprise.id },\n fullFiltering: { id: 'fullFiltering', benefit: 'filtering by multiple attributes to improve the device overview', requiredPlan: PLANS.professional.id },\n gateway: { id: 'gateway', benefit: 'see devices connected to your gateway device for easy access', requiredPlans: PLANS.professional.id },\n pausedDeployments: {\n id: 'pausedDeployments',\n benefit: 'granular control about update rollout to allow synchronization across your fleet',\n requiredPlan: PLANS.enterprise.id\n },\n phasedDeployments: { id: 'phasedDeployments', benefit: 'choose to roll out deployments in multiple phases', requiredPlan: PLANS.enterprise.id },\n rbac: { id: 'rbac', benefit: 'granular role based access control', requiredPlan: PLANS.enterprise.id },\n retryDeployments: { id: 'retryDeployments', benefit: 'optional retries for failed rollout attempts', requiredPlan: PLANS.professional.id },\n scheduledDeployments: {\n id: 'scheduledDeployments',\n benefit: 'scheduled deployments to steer the distribution of your updates.',\n requiredPlan: PLANS.professional.id\n },\n manifests: {\n id: 'manifests',\n benefit: 'orchestrate multi-component updates with manifests for complex device software management',\n requiredPlan: PLANS.enterprise.id\n },\n webhookEvents: {\n id: 'webhookEvents',\n benefit: 'receive inventory events and select which type(s) of events the webhook will receive',\n requiredPlan: PLANS.professional.id\n },\n\n default: { id: 'default', benefit: 'gain access to this feature', requiredPlan: PLANS.enterprise.id }\n} as const;\n\nexport const yes = yesUtil;\nexport const canAccess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_OPTIONS"],"sources":["../../src/appSlice/index.ts"],"sourcesContent":["// Copyright 2023 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 type { SnackbarProps } from '@mui/material';\n\nimport type { PayloadAction } from '@reduxjs/toolkit';\nimport { createSlice } from '@reduxjs/toolkit';\n\nimport type { SortOptions } from '../constants';\nimport { SORTING_OPTIONS } from '../constants';\n\nexport const sliceName = 'app';\n\nconst getYesterday = () => {\n const today = new Date();\n today.setDate(today.getDate() - 1);\n return today.toISOString();\n};\n\nexport type Repository = {\n name: string;\n version: string;\n};\n\nexport type VersionRelease = Partial<{ [versionInfo: string]: VersionRelease }> & {\n release?: string;\n release_date?: string;\n repos?: Repository[];\n supported_until?: string;\n};\n\nexport type SaasVersion = {\n date: string;\n tag: string;\n};\n\nexport type ReleaseData = {\n lts: string[];\n releases: {\n [version: string]: VersionRelease;\n };\n saas: SaasVersion[];\n};\nexport type TagData = { name: string }[];\n\nexport interface SnackbarContent extends Pick<SnackbarProps, 'action' | 'autoHideDuration' | 'message' | 'open'> {\n preventClickToCopy?: boolean;\n}\n\nexport interface SearchState {\n deviceIds: string[];\n isSearching: boolean;\n page?: number;\n perPage?: number;\n searchTerm: string;\n searchTotal: number;\n sort: SortOptions;\n}\n\nexport interface Upload {\n cancelSource: any;\n inprogress?: boolean;\n name?: string;\n progress: number;\n size?: number;\n}\n\ntype UILatestRelease = {\n releaseDate: string;\n repos: Record<string, string>;\n};\n\ntype VersionInformation = {\n [key: string]: string | UILatestRelease | undefined;\n backend?: string;\n GUI?: string;\n latestRelease?: UILatestRelease;\n};\n\nexport type SentryConfig = {\n isReduxEnabled?: string; // no parsing done here as this has to be accessed outside of the store\n location: string;\n replaysSessionSampleRate?: number;\n tracesSampleRate?: number;\n};\n\nexport type AppSliceType = {\n appInitDone: boolean;\n cancelSource: any;\n commit: string;\n demoArtifactLink: string;\n docsVersion: string;\n features: Record<string, boolean>;\n feedbackProbability: number;\n firstLoginAfterSignup: boolean;\n hostAddress: string | null;\n hostedAnnouncement: string;\n newThreshold: string;\n offlineThreshold: string;\n recaptchaSiteKey: string;\n searchState: SearchState;\n sentry: SentryConfig;\n snackbar: SnackbarContent;\n stripeAPIKey: string;\n trackerCode: string;\n uploadsById: Record<string, Upload>;\n versionInformation: VersionInformation;\n yesterday?: string;\n};\n\nexport const initialState: AppSliceType = {\n appInitDone: false,\n cancelSource: undefined,\n commit: '',\n demoArtifactLink: 'https://dgsbl4vditpls.cloudfront.net/mender-demo-artifact.mender',\n hostAddress: null,\n snackbar: {\n action: undefined,\n autoHideDuration: undefined,\n message: '',\n open: false,\n preventClickToCopy: false\n },\n // return boolean rather than organization details\n features: {\n hasAiEnabled: false,\n hasAuditlogs: false,\n hasDeltaProgress: false,\n hasMultitenancy: false,\n hasDeviceConfig: false,\n hasDeviceConnect: false,\n hasFeedbackEnabled: false,\n hasManifestsEnabled: false,\n hasMonitor: false,\n hasMCUEnabled: false,\n isHosted: true,\n isEnterprise: false\n },\n feedbackProbability: 0.3,\n firstLoginAfterSignup: false,\n hostedAnnouncement: '',\n docsVersion: '',\n recaptchaSiteKey: '',\n searchState: {\n deviceIds: [],\n searchTerm: '',\n searchTotal: 0,\n isSearching: false,\n sort: {\n direction: SORTING_OPTIONS.desc\n // key: null,\n // scope: null\n }\n },\n sentry: {\n location: '',\n replaysSessionSampleRate: 0.1,\n tracesSampleRate: 1.0\n },\n stripeAPIKey: '',\n trackerCode: '',\n uploadsById: {\n // id: { progress: 0, cancelSource: undefined }\n },\n newThreshold: getYesterday(),\n offlineThreshold: getYesterday(),\n versionInformation: {\n Integration: '',\n 'Mender-Artifact': '',\n 'Meta-Mender': ''\n },\n yesterday: undefined\n};\n\nexport const appSlice = createSlice({\n name: sliceName,\n initialState,\n reducers: {\n setFeatures: (state, action: PayloadAction<Record<string, boolean>>) => {\n state.features = {\n ...state.features,\n ...action.payload\n };\n },\n setSnackbar: (state, { payload }: PayloadAction<SnackbarContent | string>) => {\n if (typeof payload === 'string' || payload instanceof String) {\n state.snackbar = {\n ...initialState.snackbar,\n message: payload,\n open: !!payload\n };\n return;\n }\n const { message, autoHideDuration, action, preventClickToCopy = false } = payload;\n state.snackbar = {\n message,\n autoHideDuration,\n action,\n preventClickToCopy,\n open: !!message\n };\n },\n setFirstLoginAfterSignup: (state, action: PayloadAction<boolean>) => {\n state.firstLoginAfterSignup = action.payload;\n },\n setAnnouncement: (state, action: PayloadAction<string>) => {\n state.hostedAnnouncement = action.payload;\n },\n setSearchState: (state, action) => {\n state.searchState = {\n ...state.searchState,\n ...action.payload\n };\n },\n setOfflineThreshold: (state, action: PayloadAction<string>) => {\n state.offlineThreshold = action.payload;\n },\n initUpload: (state, action: PayloadAction<{ id: string; upload: Upload }>) => {\n const { id, upload } = action.payload;\n state.uploadsById[id] = upload;\n },\n uploadProgress: (state, action: PayloadAction<{ id: string; progress: number }>) => {\n const { id, progress } = action.payload;\n state.uploadsById[id] = {\n ...state.uploadsById[id],\n progress\n };\n },\n cleanUpUpload: (state, action: PayloadAction<string>) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { [action.payload]: current, ...remainder } = state.uploadsById;\n state.uploadsById = remainder;\n },\n setVersionInformation: (state, action: PayloadAction<VersionInformation>) => {\n state.versionInformation = {\n ...state.versionInformation,\n ...action.payload\n };\n },\n setEnvironmentData: (state, action) => ({ ...state, ...action.payload }),\n setAppInitDone: state => {\n state.appInitDone = true;\n }\n }\n});\n\nexport const actions = appSlice.actions;\nexport default appSlice.reducer;\n"],"mappings":";;;;;;;;AAqBA,MAAa,YAAY;AAEzB,MAAM,qBAAqB;CACzB,MAAM,wBAAQ,IAAI,MAAM;
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["SORTING_OPTIONS"],"sources":["../../src/appSlice/index.ts"],"sourcesContent":["// Copyright 2023 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 type { SnackbarProps } from '@mui/material';\n\nimport type { PayloadAction } from '@reduxjs/toolkit';\nimport { createSlice } from '@reduxjs/toolkit';\n\nimport type { SortOptions } from '../constants';\nimport { SORTING_OPTIONS } from '../constants';\n\nexport const sliceName = 'app';\n\nconst getYesterday = () => {\n const today = new Date();\n today.setDate(today.getDate() - 1);\n return today.toISOString();\n};\n\nexport type Repository = {\n name: string;\n version: string;\n};\n\nexport type VersionRelease = Partial<{ [versionInfo: string]: VersionRelease }> & {\n release?: string;\n release_date?: string;\n repos?: Repository[];\n supported_until?: string;\n};\n\nexport type SaasVersion = {\n date: string;\n tag: string;\n};\n\nexport type ReleaseData = {\n lts: string[];\n releases: {\n [version: string]: VersionRelease;\n };\n saas: SaasVersion[];\n};\nexport type TagData = { name: string }[];\n\nexport interface SnackbarContent extends Pick<SnackbarProps, 'action' | 'autoHideDuration' | 'message' | 'open'> {\n preventClickToCopy?: boolean;\n}\n\nexport interface SearchState {\n deviceIds: string[];\n isSearching: boolean;\n page?: number;\n perPage?: number;\n searchTerm: string;\n searchTotal: number;\n sort: SortOptions;\n}\n\nexport interface Upload {\n cancelSource: any;\n inprogress?: boolean;\n name?: string;\n progress: number;\n size?: number;\n}\n\ntype UILatestRelease = {\n releaseDate: string;\n repos: Record<string, string>;\n};\n\ntype VersionInformation = {\n [key: string]: string | UILatestRelease | undefined;\n backend?: string;\n GUI?: string;\n latestRelease?: UILatestRelease;\n};\n\nexport type SentryConfig = {\n isReduxEnabled?: string; // no parsing done here as this has to be accessed outside of the store\n location: string;\n replaysSessionSampleRate?: number;\n tracesSampleRate?: number;\n};\n\nexport type AppSliceType = {\n appInitDone: boolean;\n cancelSource: any;\n commit: string;\n demoArtifactLink: string;\n docsVersion: string;\n features: Record<string, boolean>;\n feedbackProbability: number;\n firstLoginAfterSignup: boolean;\n hostAddress: string | null;\n hostedAnnouncement: string;\n newThreshold: string;\n offlineThreshold: string;\n recaptchaSiteKey: string;\n searchState: SearchState;\n sentry: SentryConfig;\n snackbar: SnackbarContent;\n stripeAPIKey: string;\n trackerCode: string;\n uploadsById: Record<string, Upload>;\n versionInformation: VersionInformation;\n yesterday?: string;\n};\n\nexport const initialState: AppSliceType = {\n appInitDone: false,\n cancelSource: undefined,\n commit: '',\n demoArtifactLink: 'https://dgsbl4vditpls.cloudfront.net/mender-demo-artifact.mender',\n hostAddress: null,\n snackbar: {\n action: undefined,\n autoHideDuration: undefined,\n message: '',\n open: false,\n preventClickToCopy: false\n },\n // return boolean rather than organization details\n features: {\n hasAiEnabled: false,\n hasAuditlogs: false,\n hasDeltaProgress: false,\n hasMultitenancy: false,\n hasDeviceConfig: false,\n hasDeviceConnect: false,\n hasFeedbackEnabled: false,\n hasManifestsEnabled: false,\n hasMonitor: false,\n hasMCUEnabled: false,\n isHosted: true,\n isEnterprise: false\n },\n feedbackProbability: 0.3,\n firstLoginAfterSignup: false,\n hostedAnnouncement: '',\n docsVersion: '',\n recaptchaSiteKey: '',\n searchState: {\n deviceIds: [],\n searchTerm: '',\n searchTotal: 0,\n isSearching: false,\n sort: {\n direction: SORTING_OPTIONS.desc\n // key: null,\n // scope: null\n }\n },\n sentry: {\n location: '',\n replaysSessionSampleRate: 0.1,\n tracesSampleRate: 1.0\n },\n stripeAPIKey: '',\n trackerCode: '',\n uploadsById: {\n // id: { progress: 0, cancelSource: undefined }\n },\n newThreshold: getYesterday(),\n offlineThreshold: getYesterday(),\n versionInformation: {\n Integration: '',\n 'Mender-Artifact': '',\n 'Meta-Mender': ''\n },\n yesterday: undefined\n};\n\nexport const appSlice = createSlice({\n name: sliceName,\n initialState,\n reducers: {\n setFeatures: (state, action: PayloadAction<Record<string, boolean>>) => {\n state.features = {\n ...state.features,\n ...action.payload\n };\n },\n setSnackbar: (state, { payload }: PayloadAction<SnackbarContent | string>) => {\n if (typeof payload === 'string' || payload instanceof String) {\n state.snackbar = {\n ...initialState.snackbar,\n message: payload,\n open: !!payload\n };\n return;\n }\n const { message, autoHideDuration, action, preventClickToCopy = false } = payload;\n state.snackbar = {\n message,\n autoHideDuration,\n action,\n preventClickToCopy,\n open: !!message\n };\n },\n setFirstLoginAfterSignup: (state, action: PayloadAction<boolean>) => {\n state.firstLoginAfterSignup = action.payload;\n },\n setAnnouncement: (state, action: PayloadAction<string>) => {\n state.hostedAnnouncement = action.payload;\n },\n setSearchState: (state, action) => {\n state.searchState = {\n ...state.searchState,\n ...action.payload\n };\n },\n setOfflineThreshold: (state, action: PayloadAction<string>) => {\n state.offlineThreshold = action.payload;\n },\n initUpload: (state, action: PayloadAction<{ id: string; upload: Upload }>) => {\n const { id, upload } = action.payload;\n state.uploadsById[id] = upload;\n },\n uploadProgress: (state, action: PayloadAction<{ id: string; progress: number }>) => {\n const { id, progress } = action.payload;\n state.uploadsById[id] = {\n ...state.uploadsById[id],\n progress\n };\n },\n cleanUpUpload: (state, action: PayloadAction<string>) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { [action.payload]: current, ...remainder } = state.uploadsById;\n state.uploadsById = remainder;\n },\n setVersionInformation: (state, action: PayloadAction<VersionInformation>) => {\n state.versionInformation = {\n ...state.versionInformation,\n ...action.payload\n };\n },\n setEnvironmentData: (state, action) => ({ ...state, ...action.payload }),\n setAppInitDone: state => {\n state.appInitDone = true;\n }\n }\n});\n\nexport const actions = appSlice.actions;\nexport default appSlice.reducer;\n"],"mappings":";;;;;;;;AAqBA,M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B,UAAU;GAC1E,MAAM,WAAW;IACf;IACA;IACA;IACA;IACA,MAAM,CAAC,CAAC;IACT;;EAEH,2BAA2B,OAAO,WAAmC;GACnE,MAAM,wBAAwB,OAAO;;EAEvC,kBAAkB,OAAO,WAAkC;GACzD,MAAM,qBAAqB,OAAO;;EAEpC,iBAAiB,OAAO,WAAW;GACjC,MAAM,cAAc;IAClB,GAAG,MAAM;IACT,GAAG,OAAO;IACX;;EAEH,sBAAsB,OAAO,WAAkC;GAC7D,MAAM,mBAAmB,OAAO;;EAElC,aAAa,OAAO,WAA0D;GAC5E,MAAM,EAAE,IAAI,WAAW,OAAO;GAC9B,MAAM,YAAY,MAAM;;EAE1B,iBAAiB,OAAO,WAA4D;GAClF,MAAM,EAAE,IAAI,aAAa,OAAO;GAChC,MAAM,YAAY,MAAM;IACtB,GAAG,MAAM,YAAY;IACrB;IACD;;EAEH,gBAAgB,OAAO,WAAkC;GAEvD,MAAM,GAAG,OAAO,UAAU,SAAS,GAAG,cAAc,MAAM;GAC1D,MAAM,cAAc;;EAEtB,wBAAwB,OAAO,WAA8C;GAC3E,MAAM,qBAAqB;IACzB,GAAG,MAAM;IACT,GAAG,OAAO;IACX;;EAEH,qBAAqB,OAAO,YAAY;GAAE,GAAG;GAAO,GAAG,OAAO;GAAS;EACvE,iBAAgB,UAAS;GACvB,MAAM,cAAc;;EAEvB;CACF,CAAC;AAEF,MAAa,UAAU,SAAS;AAChC,IAAA,mBAAe,SAAS"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/appSlice/index.ts"],"sourcesContent":["// Copyright 2023 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 type { SnackbarProps } from '@mui/material';\n\nimport type { PayloadAction } from '@reduxjs/toolkit';\nimport { createSlice } from '@reduxjs/toolkit';\n\nimport type { SortOptions } from '../constants';\nimport { SORTING_OPTIONS } from '../constants';\n\nexport const sliceName = 'app';\n\nconst getYesterday = () => {\n const today = new Date();\n today.setDate(today.getDate() - 1);\n return today.toISOString();\n};\n\nexport type Repository = {\n name: string;\n version: string;\n};\n\nexport type VersionRelease = Partial<{ [versionInfo: string]: VersionRelease }> & {\n release?: string;\n release_date?: string;\n repos?: Repository[];\n supported_until?: string;\n};\n\nexport type SaasVersion = {\n date: string;\n tag: string;\n};\n\nexport type ReleaseData = {\n lts: string[];\n releases: {\n [version: string]: VersionRelease;\n };\n saas: SaasVersion[];\n};\nexport type TagData = { name: string }[];\n\nexport interface SnackbarContent extends Pick<SnackbarProps, 'action' | 'autoHideDuration' | 'message' | 'open'> {\n preventClickToCopy?: boolean;\n}\n\nexport interface SearchState {\n deviceIds: string[];\n isSearching: boolean;\n page?: number;\n perPage?: number;\n searchTerm: string;\n searchTotal: number;\n sort: SortOptions;\n}\n\nexport interface Upload {\n cancelSource: any;\n inprogress?: boolean;\n name?: string;\n progress: number;\n size?: number;\n}\n\ntype UILatestRelease = {\n releaseDate: string;\n repos: Record<string, string>;\n};\n\ntype VersionInformation = {\n [key: string]: string | UILatestRelease | undefined;\n backend?: string;\n GUI?: string;\n latestRelease?: UILatestRelease;\n};\n\nexport type SentryConfig = {\n isReduxEnabled?: string; // no parsing done here as this has to be accessed outside of the store\n location: string;\n replaysSessionSampleRate?: number;\n tracesSampleRate?: number;\n};\n\nexport type AppSliceType = {\n appInitDone: boolean;\n cancelSource: any;\n commit: string;\n demoArtifactLink: string;\n docsVersion: string;\n features: Record<string, boolean>;\n feedbackProbability: number;\n firstLoginAfterSignup: boolean;\n hostAddress: string | null;\n hostedAnnouncement: string;\n newThreshold: string;\n offlineThreshold: string;\n recaptchaSiteKey: string;\n searchState: SearchState;\n sentry: SentryConfig;\n snackbar: SnackbarContent;\n stripeAPIKey: string;\n trackerCode: string;\n uploadsById: Record<string, Upload>;\n versionInformation: VersionInformation;\n yesterday?: string;\n};\n\nexport const initialState: AppSliceType = {\n appInitDone: false,\n cancelSource: undefined,\n commit: '',\n demoArtifactLink: 'https://dgsbl4vditpls.cloudfront.net/mender-demo-artifact.mender',\n hostAddress: null,\n snackbar: {\n action: undefined,\n autoHideDuration: undefined,\n message: '',\n open: false,\n preventClickToCopy: false\n },\n // return boolean rather than organization details\n features: {\n hasAiEnabled: false,\n hasAuditlogs: false,\n hasDeltaProgress: false,\n hasMultitenancy: false,\n hasDeviceConfig: false,\n hasDeviceConnect: false,\n hasFeedbackEnabled: false,\n hasManifestsEnabled: false,\n hasMonitor: false,\n hasMCUEnabled: false,\n isHosted: true,\n isEnterprise: false\n },\n feedbackProbability: 0.3,\n firstLoginAfterSignup: false,\n hostedAnnouncement: '',\n docsVersion: '',\n recaptchaSiteKey: '',\n searchState: {\n deviceIds: [],\n searchTerm: '',\n searchTotal: 0,\n isSearching: false,\n sort: {\n direction: SORTING_OPTIONS.desc\n // key: null,\n // scope: null\n }\n },\n sentry: {\n location: '',\n replaysSessionSampleRate: 0.1,\n tracesSampleRate: 1.0\n },\n stripeAPIKey: '',\n trackerCode: '',\n uploadsById: {\n // id: { progress: 0, cancelSource: undefined }\n },\n newThreshold: getYesterday(),\n offlineThreshold: getYesterday(),\n versionInformation: {\n Integration: '',\n 'Mender-Artifact': '',\n 'Meta-Mender': ''\n },\n yesterday: undefined\n};\n\nexport const appSlice = createSlice({\n name: sliceName,\n initialState,\n reducers: {\n setFeatures: (state, action: PayloadAction<Record<string, boolean>>) => {\n state.features = {\n ...state.features,\n ...action.payload\n };\n },\n setSnackbar: (state, { payload }: PayloadAction<SnackbarContent | string>) => {\n if (typeof payload === 'string' || payload instanceof String) {\n state.snackbar = {\n ...initialState.snackbar,\n message: payload,\n open: !!payload\n };\n return;\n }\n const { message, autoHideDuration, action, preventClickToCopy = false } = payload;\n state.snackbar = {\n message,\n autoHideDuration,\n action,\n preventClickToCopy,\n open: !!message\n };\n },\n setFirstLoginAfterSignup: (state, action: PayloadAction<boolean>) => {\n state.firstLoginAfterSignup = action.payload;\n },\n setAnnouncement: (state, action: PayloadAction<string>) => {\n state.hostedAnnouncement = action.payload;\n },\n setSearchState: (state, action) => {\n state.searchState = {\n ...state.searchState,\n ...action.payload\n };\n },\n setOfflineThreshold: (state, action: PayloadAction<string>) => {\n state.offlineThreshold = action.payload;\n },\n initUpload: (state, action: PayloadAction<{ id: string; upload: Upload }>) => {\n const { id, upload } = action.payload;\n state.uploadsById[id] = upload;\n },\n uploadProgress: (state, action: PayloadAction<{ id: string; progress: number }>) => {\n const { id, progress } = action.payload;\n state.uploadsById[id] = {\n ...state.uploadsById[id],\n progress\n };\n },\n cleanUpUpload: (state, action: PayloadAction<string>) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { [action.payload]: current, ...remainder } = state.uploadsById;\n state.uploadsById = remainder;\n },\n setVersionInformation: (state, action: PayloadAction<VersionInformation>) => {\n state.versionInformation = {\n ...state.versionInformation,\n ...action.payload\n };\n },\n setEnvironmentData: (state, action) => ({ ...state, ...action.payload }),\n setAppInitDone: state => {\n state.appInitDone = true;\n }\n }\n});\n\nexport const actions = appSlice.actions;\nexport default appSlice.reducer;\n"],"mappings":";;;AAqBA,MAAa,YAAY;AAEzB,MAAM,qBAAqB;CACzB,MAAM,wBAAQ,IAAI,MAAM;
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/appSlice/index.ts"],"sourcesContent":["// Copyright 2023 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 type { SnackbarProps } from '@mui/material';\n\nimport type { PayloadAction } from '@reduxjs/toolkit';\nimport { createSlice } from '@reduxjs/toolkit';\n\nimport type { SortOptions } from '../constants';\nimport { SORTING_OPTIONS } from '../constants';\n\nexport const sliceName = 'app';\n\nconst getYesterday = () => {\n const today = new Date();\n today.setDate(today.getDate() - 1);\n return today.toISOString();\n};\n\nexport type Repository = {\n name: string;\n version: string;\n};\n\nexport type VersionRelease = Partial<{ [versionInfo: string]: VersionRelease }> & {\n release?: string;\n release_date?: string;\n repos?: Repository[];\n supported_until?: string;\n};\n\nexport type SaasVersion = {\n date: string;\n tag: string;\n};\n\nexport type ReleaseData = {\n lts: string[];\n releases: {\n [version: string]: VersionRelease;\n };\n saas: SaasVersion[];\n};\nexport type TagData = { name: string }[];\n\nexport interface SnackbarContent extends Pick<SnackbarProps, 'action' | 'autoHideDuration' | 'message' | 'open'> {\n preventClickToCopy?: boolean;\n}\n\nexport interface SearchState {\n deviceIds: string[];\n isSearching: boolean;\n page?: number;\n perPage?: number;\n searchTerm: string;\n searchTotal: number;\n sort: SortOptions;\n}\n\nexport interface Upload {\n cancelSource: any;\n inprogress?: boolean;\n name?: string;\n progress: number;\n size?: number;\n}\n\ntype UILatestRelease = {\n releaseDate: string;\n repos: Record<string, string>;\n};\n\ntype VersionInformation = {\n [key: string]: string | UILatestRelease | undefined;\n backend?: string;\n GUI?: string;\n latestRelease?: UILatestRelease;\n};\n\nexport type SentryConfig = {\n isReduxEnabled?: string; // no parsing done here as this has to be accessed outside of the store\n location: string;\n replaysSessionSampleRate?: number;\n tracesSampleRate?: number;\n};\n\nexport type AppSliceType = {\n appInitDone: boolean;\n cancelSource: any;\n commit: string;\n demoArtifactLink: string;\n docsVersion: string;\n features: Record<string, boolean>;\n feedbackProbability: number;\n firstLoginAfterSignup: boolean;\n hostAddress: string | null;\n hostedAnnouncement: string;\n newThreshold: string;\n offlineThreshold: string;\n recaptchaSiteKey: string;\n searchState: SearchState;\n sentry: SentryConfig;\n snackbar: SnackbarContent;\n stripeAPIKey: string;\n trackerCode: string;\n uploadsById: Record<string, Upload>;\n versionInformation: VersionInformation;\n yesterday?: string;\n};\n\nexport const initialState: AppSliceType = {\n appInitDone: false,\n cancelSource: undefined,\n commit: '',\n demoArtifactLink: 'https://dgsbl4vditpls.cloudfront.net/mender-demo-artifact.mender',\n hostAddress: null,\n snackbar: {\n action: undefined,\n autoHideDuration: undefined,\n message: '',\n open: false,\n preventClickToCopy: false\n },\n // return boolean rather than organization details\n features: {\n hasAiEnabled: false,\n hasAuditlogs: false,\n hasDeltaProgress: false,\n hasMultitenancy: false,\n hasDeviceConfig: false,\n hasDeviceConnect: false,\n hasFeedbackEnabled: false,\n hasManifestsEnabled: false,\n hasMonitor: false,\n hasMCUEnabled: false,\n isHosted: true,\n isEnterprise: false\n },\n feedbackProbability: 0.3,\n firstLoginAfterSignup: false,\n hostedAnnouncement: '',\n docsVersion: '',\n recaptchaSiteKey: '',\n searchState: {\n deviceIds: [],\n searchTerm: '',\n searchTotal: 0,\n isSearching: false,\n sort: {\n direction: SORTING_OPTIONS.desc\n // key: null,\n // scope: null\n }\n },\n sentry: {\n location: '',\n replaysSessionSampleRate: 0.1,\n tracesSampleRate: 1.0\n },\n stripeAPIKey: '',\n trackerCode: '',\n uploadsById: {\n // id: { progress: 0, cancelSource: undefined }\n },\n newThreshold: getYesterday(),\n offlineThreshold: getYesterday(),\n versionInformation: {\n Integration: '',\n 'Mender-Artifact': '',\n 'Meta-Mender': ''\n },\n yesterday: undefined\n};\n\nexport const appSlice = createSlice({\n name: sliceName,\n initialState,\n reducers: {\n setFeatures: (state, action: PayloadAction<Record<string, boolean>>) => {\n state.features = {\n ...state.features,\n ...action.payload\n };\n },\n setSnackbar: (state, { payload }: PayloadAction<SnackbarContent | string>) => {\n if (typeof payload === 'string' || payload instanceof String) {\n state.snackbar = {\n ...initialState.snackbar,\n message: payload,\n open: !!payload\n };\n return;\n }\n const { message, autoHideDuration, action, preventClickToCopy = false } = payload;\n state.snackbar = {\n message,\n autoHideDuration,\n action,\n preventClickToCopy,\n open: !!message\n };\n },\n setFirstLoginAfterSignup: (state, action: PayloadAction<boolean>) => {\n state.firstLoginAfterSignup = action.payload;\n },\n setAnnouncement: (state, action: PayloadAction<string>) => {\n state.hostedAnnouncement = action.payload;\n },\n setSearchState: (state, action) => {\n state.searchState = {\n ...state.searchState,\n ...action.payload\n };\n },\n setOfflineThreshold: (state, action: PayloadAction<string>) => {\n state.offlineThreshold = action.payload;\n },\n initUpload: (state, action: PayloadAction<{ id: string; upload: Upload }>) => {\n const { id, upload } = action.payload;\n state.uploadsById[id] = upload;\n },\n uploadProgress: (state, action: PayloadAction<{ id: string; progress: number }>) => {\n const { id, progress } = action.payload;\n state.uploadsById[id] = {\n ...state.uploadsById[id],\n progress\n };\n },\n cleanUpUpload: (state, action: PayloadAction<string>) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { [action.payload]: current, ...remainder } = state.uploadsById;\n state.uploadsById = remainder;\n },\n setVersionInformation: (state, action: PayloadAction<VersionInformation>) => {\n state.versionInformation = {\n ...state.versionInformation,\n ...action.payload\n };\n },\n setEnvironmentData: (state, action) => ({ ...state, ...action.payload }),\n setAppInitDone: state => {\n state.appInitDone = true;\n }\n }\n});\n\nexport const actions = appSlice.actions;\nexport default appSlice.reducer;\n"],"mappings":";;;AAqBA,MAAa,YAAY;AAEzB,MAAM,qBAAqB;CACzB,MAAM,wBAAQ,IAAI,MAAM;CACxB,MAAM,QAAQ,MAAM,SAAS,GAAG,EAAE;CAClC,OAAO,MAAM,aAAa;;AA8F5B,MAAa,eAA6B;CACxC,aAAa;CACb,cAAc,KAAA;CACd,QAAQ;CACR,kBAAkB;CAClB,aAAa;CACb,UAAU;EACR,QAAQ,KAAA;EACR,kBAAkB,KAAA;EAClB,SAAS;EACT,MAAM;EACN,oBAAoB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;;EAElC,aAAa,OAAO,WAA0D;GAC5E,MAAM,EAAE,IAAI,WAAW,OAAO;GAC9B,MAAM,YAAY,MAAM;;EAE1B,iBAAiB,OAAO,WAA4D;GAClF,MAAM,EAAE,IAAI,aAAa,OAAO;GAChC,MAAM,YAAY,MAAM;IACtB,GAAG,MAAM,YAAY;IACrB;IACD;;EAEH,gBAAgB,OAAO,WAAkC;GAEvD,MAAM,GAAG,OAAO,UAAU,SAAS,GAAG,cAAc,MAAM;GAC1D,MAAM,cAAc;;EAEtB,wBAAwB,OAAO,WAA8C;GAC3E,MAAM,qBAAqB;IACzB,GAAG,MAAM;IACT,GAAG,OAAO;IACX;;EAEH,qBAAqB,OAAO,YAAY;GAAE,GAAG;GAAO,GAAG,OAAO;GAAS;EACvE,iBAAgB,UAAS;GACvB,MAAM,cAAc;;EAEvB;CACF,CAAC;AAEF,MAAa,UAAU,SAAS;AAChC,IAAA,mBAAe,SAAS"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { o as UserSliceType } from "../index-BFlHWzjv.cjs";
|
|
2
|
-
import { i as ReleaseSliceType } from "../index-
|
|
2
|
+
import { i as ReleaseSliceType } from "../index-C-q632wO.cjs";
|
|
3
3
|
import { n as OnboardingSliceType } from "../index-UPc3wvVd.cjs";
|
|
4
4
|
import { o as DeploymentsSliceType } from "../index-BP0uAq36.cjs";
|
|
5
5
|
import { s as DeviceSliceType } from "../index-B64X5ozM.cjs";
|
|
6
6
|
import { a as SearchState, l as Upload, o as SentryConfig, s as SnackbarContent, t as AppSliceType } from "../index-DwACbyUg.cjs";
|
|
7
7
|
import { t as MonitorSliceType } from "../index-CT5hgXm9.cjs";
|
|
8
8
|
import { t as OrganizationSliceType } from "../index-BbaS7MzW.cjs";
|
|
9
|
-
import { r as RootState } from "../store-
|
|
9
|
+
import { r as RootState } from "../store-b5cF2WB5.cjs";
|
|
10
10
|
import * as _$reselect from "reselect";
|
|
11
11
|
|
|
12
12
|
//#region src/appSlice/selectors.d.ts
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { o as UserSliceType } from "../index-ez3oxfRo.js";
|
|
2
|
-
import { i as ReleaseSliceType } from "../index-
|
|
2
|
+
import { i as ReleaseSliceType } from "../index-CyokFK2e.js";
|
|
3
3
|
import { n as OnboardingSliceType } from "../index-CJkrL0oA.js";
|
|
4
4
|
import { o as DeploymentsSliceType } from "../index-CkwVnIqd.js";
|
|
5
5
|
import { s as DeviceSliceType } from "../index-BI9O8JWe.js";
|
|
6
6
|
import { a as SearchState, l as Upload, o as SentryConfig, s as SnackbarContent, t as AppSliceType } from "../index-Bp1WpATs.js";
|
|
7
7
|
import { t as MonitorSliceType } from "../index-DUvrw_Ed.js";
|
|
8
8
|
import { t as OrganizationSliceType } from "../index-C6wNUfiV.js";
|
|
9
|
-
import { r as RootState } from "../store-
|
|
9
|
+
import { r as RootState } from "../store-D-xvZXiY.js";
|
|
10
10
|
import * as _$reselect from "reselect";
|
|
11
11
|
|
|
12
12
|
//#region src/appSlice/selectors.d.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as SearchState } from "../index-DwACbyUg.cjs";
|
|
2
|
-
import { r as RootState, t as AppDispatch } from "../store-
|
|
2
|
+
import { r as RootState, t as AppDispatch } from "../store-b5cF2WB5.cjs";
|
|
3
3
|
import * as _$_reduxjs_toolkit0 from "@reduxjs/toolkit";
|
|
4
4
|
|
|
5
5
|
//#region src/appSlice/thunks.d.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as SearchState } from "../index-Bp1WpATs.js";
|
|
2
|
-
import { r as RootState, t as AppDispatch } from "../store-
|
|
2
|
+
import { r as RootState, t as AppDispatch } from "../store-D-xvZXiY.js";
|
|
3
3
|
import * as _$_reduxjs_toolkit0 from "@reduxjs/toolkit";
|
|
4
4
|
|
|
5
5
|
//#region src/appSlice/thunks.d.ts
|
package/dist/auth.cjs
CHANGED
|
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
const require_chunk = require("./chunk-CKQMccvm.cjs");
|
|
3
3
|
const require_constants = require("./constants.cjs");
|
|
4
4
|
let universal_cookie = require("universal-cookie");
|
|
5
|
-
universal_cookie = require_chunk.__toESM(universal_cookie);
|
|
5
|
+
universal_cookie = require_chunk.__toESM(universal_cookie, 1);
|
|
6
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();
|
package/dist/auth.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.cjs","names":["Cookies","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 { TIMEOUTS, maxSessionAge } 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};\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":";;;;;;;AAkBA,MAAM,UAAU,IAAIA,iBAAAA,SAAS;AAE7B,MAAM,eAAe,OAAO,OAAO;CAAE,OAAO;CAAI,WAAW,KAAA;CAAW,CAAC;AAEvE,IAAI,aAAa;AAEjB,MAAa,uBAAoC;CAC/C,IAAI,cAAc,EAAE,GAAG,cAAc;
|
|
1
|
+
{"version":3,"file":"auth.cjs","names":["Cookies","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 { TIMEOUTS, maxSessionAge } 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};\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":";;;;;;;AAkBA,MAAM,UAAU,IAAIA,iBAAAA,SAAS;AAE7B,MAAM,eAAe,OAAO,OAAO;CAAE,OAAO;CAAI,WAAW,KAAA;CAAW,CAAC;AAEvE,IAAI,aAAa;AAEjB,MAAa,uBAAoC;CAC/C,IAAI,cAAc,EAAE,GAAG,cAAc;CACrC,IAAI;EACF,cAAc,KAAK,MAAM,OAAO,aAAa,QAAQ,MAAM,IAAI,GAAG;SAC5D;CAKR,MAAM,qBAAqB,QAAQ,IAAI,OAAO,EAAE,YAAY,MAAM,CAAC,IAAI;CACvE,IAAI,oBAAoB;EACtB,eAAe,EAAE,OAAO,oBAAoB,CAAC;EAC7C,QAAQ,OAAO,MAAM;EACrB,QAAQ,OAAO,OAAO,EAAE,MAAM,KAAK,CAAC;EACpC,OAAO;GAAE,OAAO;GAAoB,WAAW,KAAA;GAAW;;CAE5D,IAAI,YAAY,aAAa,IAAI,KAAK,YAAY,UAAU,mBAAG,IAAI,MAAM,EAAE;EACzE,SAAS;EACT,OAAO,EAAE,GAAG,cAAc;;CAE5B,YAAY,QAAQ,YAAY,SAAS;CACzC,aAAa,YAAY;CACzB,OAAO;;AAGT,MAAa,iBAAkB,aAAa,aAAa,gBAAgB,CAAC;AAE1E,MAAa,kBAAkB,EAAE,OAAO,gBAA6B;CACnE,aAAa;CACb,OAAO,aAAa,QAAQ,OAAO,KAAK,UAAU;EAAE;EAAO;EAAW,CAAC,CAAC;;AAG1E,MAAa,gBAAgB;CAC3B,aAAa;CACb,QAAQ,OAAO,MAAM;CACrB,QAAQ,OAAO,OAAO,EAAE,MAAM,KAAK,CAAC;CACpC,OAAO,aAAa,WAAW,MAAM;CACrC,OAAO,aAAa,WAAW,QAAQ;;AAGzC,MAAa,gBAAgB,EAAE,WAAW,YAAY;CACpD,MAAM,kBAAkB,OAAO,OAAO,aAAa,QAAQ,QAAQ,CAAC;CACpE,IAAI,kBAAkB;CACtB,IAAI,iBAAiB;EAEnB,kBAAkB,mBADL,KAAK,KAAK,GAAGC,+BAAAA,gBAAgBC,kBAAAA,SAAS;EAEnD,IAAI,iBACF,OAAO,aAAa,WAAW,QAAQ;;CAG3C,IAAI,SAAS,cAAc,CAAC,mBAAmB,kBAAkB;EAC/D,MAAM,6BAAa,IAAI,MAAM;EAC7B,WAAW,WAAW,WAAW,YAAY,GAAGD,+BAAAA,cAAc;EAC9D,eAAe;GAAE;GAAO,WAAW,WAAW,aAAa;GAAE,CAAC"}
|
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 { TIMEOUTS, maxSessionAge } 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};\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":";;;AAkBA,MAAM,UAAU,IAAI,SAAS;AAE7B,MAAM,eAAe,OAAO,OAAO;CAAE,OAAO;CAAI,WAAW,KAAA;CAAW,CAAC;AAEvE,IAAI,aAAa;AAEjB,MAAa,uBAAoC;CAC/C,IAAI,cAAc,EAAE,GAAG,cAAc;
|
|
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 { TIMEOUTS, maxSessionAge } 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};\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":";;;AAkBA,MAAM,UAAU,IAAI,SAAS;AAE7B,MAAM,eAAe,OAAO,OAAO;CAAE,OAAO;CAAI,WAAW,KAAA;CAAW,CAAC;AAEvE,IAAI,aAAa;AAEjB,MAAa,uBAAoC;CAC/C,IAAI,cAAc,EAAE,GAAG,cAAc;CACrC,IAAI;EACF,cAAc,KAAK,MAAM,OAAO,aAAa,QAAQ,MAAM,IAAI,GAAG;SAC5D;CAKR,MAAM,qBAAqB,QAAQ,IAAI,OAAO,EAAE,YAAY,MAAM,CAAC,IAAI;CACvE,IAAI,oBAAoB;EACtB,eAAe,EAAE,OAAO,oBAAoB,CAAC;EAC7C,QAAQ,OAAO,MAAM;EACrB,QAAQ,OAAO,OAAO,EAAE,MAAM,KAAK,CAAC;EACpC,OAAO;GAAE,OAAO;GAAoB,WAAW,KAAA;GAAW;;CAE5D,IAAI,YAAY,aAAa,IAAI,KAAK,YAAY,UAAU,mBAAG,IAAI,MAAM,EAAE;EACzE,SAAS;EACT,OAAO,EAAE,GAAG,cAAc;;CAE5B,YAAY,QAAQ,YAAY,SAAS;CACzC,aAAa,YAAY;CACzB,OAAO;;AAGT,MAAa,iBAAkB,aAAa,aAAa,gBAAgB,CAAC;AAE1E,MAAa,kBAAkB,EAAE,OAAO,gBAA6B;CACnE,aAAa;CACb,OAAO,aAAa,QAAQ,OAAO,KAAK,UAAU;EAAE;EAAO;EAAW,CAAC,CAAC;;AAG1E,MAAa,gBAAgB;CAC3B,aAAa;CACb,QAAQ,OAAO,MAAM;CACrB,QAAQ,OAAO,OAAO,EAAE,MAAM,KAAK,CAAC;CACpC,OAAO,aAAa,WAAW,MAAM;CACrC,OAAO,aAAa,WAAW,QAAQ;;AAGzC,MAAa,gBAAgB,EAAE,WAAW,YAAY;CACpD,MAAM,kBAAkB,OAAO,OAAO,aAAa,QAAQ,QAAQ,CAAC;CACpE,IAAI,kBAAkB;CACtB,IAAI,iBAAiB;EAEnB,kBAAkB,mBADL,KAAK,KAAK,GAAG,gBAAgB,SAAS;EAEnD,IAAI,iBACF,OAAO,aAAa,WAAW,QAAQ;;CAG3C,IAAI,SAAS,cAAc,CAAC,mBAAmB,kBAAkB;EAC/D,MAAM,6BAAa,IAAI,MAAM;EAC7B,WAAW,WAAW,WAAW,YAAY,GAAG,cAAc;EAC9D,eAAe;GAAE;GAAO,WAAW,WAAW,aAAa;GAAE,CAAC"}
|
package/dist/commonSelectors.cjs
CHANGED
|
@@ -15,7 +15,7 @@ const require_usersSlice_selectors = require("./usersSlice/selectors.cjs");
|
|
|
15
15
|
let _reduxjs_toolkit = require("@reduxjs/toolkit");
|
|
16
16
|
let _northern_tech_utils_helpers = require("@northern.tech/utils/helpers");
|
|
17
17
|
let dayjs = require("dayjs");
|
|
18
|
-
dayjs = require_chunk.__toESM(dayjs);
|
|
18
|
+
dayjs = require_chunk.__toESM(dayjs, 1);
|
|
19
19
|
let _northern_tech_utils_constants = require("@northern.tech/utils/constants");
|
|
20
20
|
//#region src/commonSelectors.ts
|
|
21
21
|
const getIsEnterprise = (0, _reduxjs_toolkit.createSelector)([require_organizationSlice_selectors.getOrganization, require_appSlice_selectors.getFeatures], ({ plan = require_appSlice_constants.PLANS.os.id }, { isEnterprise, isHosted }) => isEnterprise || isHosted && plan === require_appSlice_constants.PLANS.enterprise.id);
|