@northern.tech/store 0.46.5 → 0.48.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions.d.cts +6 -6
- package/dist/actions.d.ts +6 -6
- package/dist/api/general-api.cjs +2 -2
- package/dist/api/general-api.cjs.map +1 -1
- package/dist/api/general-api.js +1 -1
- package/dist/api/general-api.js.map +1 -1
- package/dist/appSlice/constants.cjs +3 -4
- package/dist/appSlice/constants.cjs.map +1 -1
- package/dist/appSlice/constants.d.cts +1 -1
- package/dist/appSlice/constants.d.ts +1 -1
- package/dist/appSlice/constants.js +1 -2
- package/dist/appSlice/constants.js.map +1 -1
- package/dist/appSlice/index.d.cts +1 -1
- package/dist/appSlice/index.d.ts +1 -1
- package/dist/appSlice/index.js +1 -1
- package/dist/appSlice/mocks.d.cts +1 -1
- package/dist/appSlice/mocks.d.ts +1 -1
- package/dist/appSlice/selectors.cjs.map +1 -1
- package/dist/appSlice/selectors.d.cts +2 -130
- package/dist/appSlice/selectors.d.ts +2 -130
- package/dist/appSlice/selectors.js.map +1 -1
- package/dist/appSlice/thunks.d.cts +2 -2
- package/dist/appSlice/thunks.d.ts +2 -2
- package/dist/auth.cjs +3 -3
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.d.cts +1 -1
- package/dist/auth.d.ts +1 -1
- package/dist/auth.js +2 -1
- package/dist/auth.js.map +1 -1
- package/dist/commonConstants.cjs +4 -3
- package/dist/commonConstants.d.cts +2 -2
- package/dist/commonConstants.d.ts +2 -2
- package/dist/commonConstants.js +1 -1
- package/dist/commonSelectors.cjs +1 -1
- package/dist/commonSelectors.d.cts +80 -373
- package/dist/commonSelectors.d.ts +80 -373
- package/dist/commonSelectors.js +1 -1
- package/dist/constants-3gsHyxWr.d.ts +109 -0
- package/dist/{constants-B3NH1IQi.d.ts → constants-DOnQ-UzD.d.cts} +2 -3
- package/dist/{constants-B3NH1IQi.d.cts → constants-DOnQ-UzD.d.ts} +2 -3
- package/dist/{constants-MVizYy89.cjs → constants-DsOnY5o5.cjs} +1 -279
- package/dist/constants-DsOnY5o5.cjs.map +1 -0
- package/dist/constants-hMMMdt0R.d.cts +109 -0
- package/dist/{constants-nKSWZ8oD.d.ts → constants-tC3RR_Oo.d.cts} +2 -3
- package/dist/{constants-nKSWZ8oD.d.cts → constants-tC3RR_Oo.d.ts} +2 -3
- package/dist/{constants-D5hACLhF.js → constants-yul-O5hD.js} +3 -269
- package/dist/constants-yul-O5hD.js.map +1 -0
- package/dist/constants.cjs +6 -6
- package/dist/constants.d.cts +4 -4
- package/dist/constants.d.ts +4 -4
- package/dist/constants.js +2 -2
- package/dist/deploymentsSlice/constants.cjs +1 -1
- package/dist/deploymentsSlice/constants.js +1 -1
- package/dist/deploymentsSlice/index.cjs +1 -1
- package/dist/deploymentsSlice/index.js +1 -1
- package/dist/deploymentsSlice/selectors.cjs +1 -1
- package/dist/deploymentsSlice/selectors.cjs.map +1 -1
- package/dist/deploymentsSlice/selectors.d.cts +2 -97
- package/dist/deploymentsSlice/selectors.d.ts +2 -97
- package/dist/deploymentsSlice/selectors.js +1 -1
- package/dist/deploymentsSlice/selectors.js.map +1 -1
- package/dist/deploymentsSlice/thunks.d.cts +13 -13
- package/dist/deploymentsSlice/thunks.d.ts +13 -13
- package/dist/devicesSlice/constants.cjs +1 -1
- package/dist/devicesSlice/constants.d.cts +1 -1
- package/dist/devicesSlice/constants.d.ts +1 -1
- package/dist/devicesSlice/constants.js +1 -1
- package/dist/devicesSlice/index.d.cts +1 -1
- package/dist/devicesSlice/index.d.ts +1 -1
- package/dist/devicesSlice/index.js +1 -1
- package/dist/devicesSlice/mocks.js +1 -1
- package/dist/devicesSlice/selectors.cjs +1 -1
- package/dist/devicesSlice/selectors.cjs.map +1 -1
- package/dist/devicesSlice/selectors.d.cts +2 -887
- package/dist/devicesSlice/selectors.d.ts +2 -887
- package/dist/devicesSlice/selectors.js +1 -1
- package/dist/devicesSlice/selectors.js.map +1 -1
- package/dist/devicesSlice/thunks.d.cts +4 -4
- package/dist/devicesSlice/thunks.d.ts +4 -4
- package/dist/{index-fGVC5s1C.d.cts → index-B9jUHGsM.d.cts} +2 -2
- package/dist/{index-xxqlerg5.d.ts → index-BMi8ZqpV.d.ts} +2 -2
- package/dist/{index-BKU1G9-x.d.cts → index-BoZjwQHk.d.cts} +2 -2
- package/dist/{index-BfmRpbiJ.d.cts → index-C-6WkMAo.d.cts} +2 -2
- package/dist/{index-CRqnH_go.d.ts → index-CD39K38q.d.ts} +2 -2
- package/dist/{index-KxRmyFLr.d.cts → index-D8O1HJ8Q.d.cts} +2 -2
- package/dist/{index-BMsafOyJ.d.ts → index-DXfbW2gi.d.ts} +2 -2
- package/dist/{index-HjOSTTGF.d.cts → index-Dd_guNwA.d.cts} +2 -2
- package/dist/{index-CqhXqGLt.d.cts → index-DlTiYWBe.d.cts} +2 -2
- package/dist/{index-BVNS-Aut.d.ts → index-I82Wu-Ah.d.ts} +2 -2
- package/dist/{index--SKVGToc.d.ts → index-KQNyWRoG.d.ts} +2 -2
- package/dist/{index-D9GJhX1I.d.ts → index-uhmZ9qaP.d.ts} +2 -2
- package/dist/locationutils.cjs +1 -1
- package/dist/locationutils.d.cts +2 -2
- package/dist/locationutils.d.ts +2 -2
- package/dist/locationutils.js +1 -1
- package/dist/mockState.cjs +24 -0
- package/dist/mockState.cjs.map +1 -0
- package/dist/mockState.d.cts +7 -0
- package/dist/mockState.d.ts +7 -0
- package/dist/mockState.js +23 -0
- package/dist/mockState.js.map +1 -0
- package/dist/monitorSlice/constants.d.cts +1 -1
- package/dist/monitorSlice/constants.d.ts +1 -1
- package/dist/monitorSlice/index.d.cts +1 -1
- package/dist/monitorSlice/index.d.ts +1 -1
- package/dist/monitorSlice/index.js +1 -1
- package/dist/monitorSlice/mocks.d.cts +1 -1
- package/dist/monitorSlice/mocks.d.ts +1 -1
- package/dist/monitorSlice/mocks.js +1 -1
- package/dist/monitorSlice/selectors.cjs.map +1 -1
- package/dist/monitorSlice/selectors.d.cts +2 -10
- package/dist/monitorSlice/selectors.d.ts +2 -10
- package/dist/monitorSlice/selectors.js.map +1 -1
- package/dist/monitorSlice/thunks.cjs +2 -3
- package/dist/monitorSlice/thunks.cjs.map +1 -1
- package/dist/monitorSlice/thunks.d.cts +4 -4
- package/dist/monitorSlice/thunks.d.ts +4 -4
- package/dist/monitorSlice/thunks.js +3 -2
- package/dist/monitorSlice/thunks.js.map +1 -1
- package/dist/onboardingSlice/selectors.cjs.map +1 -1
- package/dist/onboardingSlice/selectors.d.cts +2 -6
- package/dist/onboardingSlice/selectors.d.ts +2 -6
- package/dist/onboardingSlice/selectors.js.map +1 -1
- package/dist/onboardingSlice/thunks.d.cts +3 -3
- package/dist/onboardingSlice/thunks.d.ts +3 -3
- package/dist/organizationSlice/constants.cjs +1 -1
- package/dist/organizationSlice/constants.js +1 -1
- package/dist/organizationSlice/index.cjs +1 -1
- package/dist/organizationSlice/index.d.cts +1 -1
- package/dist/organizationSlice/index.d.ts +1 -1
- package/dist/organizationSlice/index.js +1 -1
- package/dist/organizationSlice/mocks.d.cts +3 -3
- package/dist/organizationSlice/mocks.d.ts +3 -3
- package/dist/organizationSlice/mocks.js +1 -1
- package/dist/organizationSlice/selectors.cjs +1 -1
- package/dist/organizationSlice/selectors.cjs.map +1 -1
- package/dist/organizationSlice/selectors.d.cts +2 -472
- package/dist/organizationSlice/selectors.d.ts +2 -472
- package/dist/organizationSlice/selectors.js +1 -1
- package/dist/organizationSlice/selectors.js.map +1 -1
- package/dist/organizationSlice/thunks.d.cts +25 -21
- package/dist/organizationSlice/thunks.d.ts +25 -21
- package/dist/organizationSlice/types.d.cts +1 -1
- package/dist/organizationSlice/types.d.ts +1 -1
- package/dist/releasesSlice/constants.cjs +0 -2
- package/dist/releasesSlice/constants.cjs.map +1 -1
- package/dist/releasesSlice/constants.d.cts +2 -2
- package/dist/releasesSlice/constants.d.ts +2 -2
- package/dist/releasesSlice/constants.js +1 -2
- package/dist/releasesSlice/constants.js.map +1 -1
- package/dist/releasesSlice/index.d.cts +1 -1
- package/dist/releasesSlice/index.d.ts +1 -1
- package/dist/releasesSlice/index.js +1 -1
- package/dist/releasesSlice/mocks.js +1 -1
- package/dist/releasesSlice/selectors.cjs.map +1 -1
- package/dist/releasesSlice/selectors.d.cts +2 -795
- package/dist/releasesSlice/selectors.d.ts +2 -795
- package/dist/releasesSlice/selectors.js.map +1 -1
- package/dist/releasesSlice/thunks.cjs +18 -18
- package/dist/releasesSlice/thunks.cjs.map +1 -1
- package/dist/releasesSlice/thunks.d.cts +4 -4
- package/dist/releasesSlice/thunks.d.ts +4 -4
- package/dist/releasesSlice/thunks.js +3 -2
- package/dist/releasesSlice/thunks.js.map +1 -1
- package/dist/selectors-CH-yXu-7.d.cts +84 -0
- package/dist/selectors-CQYkG1VI.d.cts +9 -0
- package/dist/selectors-CR0q7rXC.d.cts +593 -0
- package/dist/selectors-CdCZGn7e.d.cts +99 -0
- package/dist/selectors-CdllyZyW.d.cts +363 -0
- package/dist/selectors-CftbLtXH.d.cts +14 -0
- package/dist/selectors-D2j3_Mnp.d.ts +363 -0
- package/dist/selectors-D78O3T1o.d.ts +99 -0
- package/dist/selectors-D9t4It2i.d.ts +84 -0
- package/dist/selectors-D_UFk4Uz.d.ts +14 -0
- package/dist/selectors-DuHGqmMJ.d.cts +712 -0
- package/dist/selectors-SvKXGJM5.d.ts +712 -0
- package/dist/selectors-eYLuQW4M.d.ts +593 -0
- package/dist/selectors-elCimAHX.d.ts +9 -0
- package/dist/selectors-qClZ9EXM.d.ts +374 -0
- package/dist/selectors-rto0SO4z.d.cts +374 -0
- package/dist/selectors.d.cts +9 -9
- package/dist/selectors.d.ts +9 -9
- package/dist/sockethook.cjs +4 -4
- package/dist/sockethook.cjs.map +1 -1
- package/dist/sockethook.js +2 -1
- package/dist/sockethook.js.map +1 -1
- package/dist/{store-DLp6ajT8.d.ts → store-BQcycBPp.d.ts} +15 -34
- package/dist/{store-Dw8Uo_Df.d.cts → store-CrLzRDCx.d.cts} +14 -33
- package/dist/store.cjs +2 -4
- package/dist/store.cjs.map +1 -1
- package/dist/store.d.cts +2 -2
- package/dist/store.d.ts +2 -2
- package/dist/store.js +2 -4
- package/dist/store.js.map +1 -1
- package/dist/thunks.cjs +39 -43
- package/dist/thunks.cjs.map +1 -1
- package/dist/thunks.js +19 -22
- package/dist/thunks.js.map +1 -1
- package/dist/{types-DY0J79yF.d.ts → types-DB1IOQX8.d.ts} +3 -3
- package/dist/{types-B67YW1jV.d.cts → types-DtTmD7Yn.d.cts} +3 -3
- package/dist/usersSlice/constants.cjs +1 -1
- package/dist/usersSlice/constants.js +1 -1
- package/dist/usersSlice/index.cjs +1 -1
- package/dist/usersSlice/index.d.cts +1 -1
- package/dist/usersSlice/index.d.ts +1 -1
- package/dist/usersSlice/index.js +1 -1
- package/dist/usersSlice/mocks.d.cts +1 -1
- package/dist/usersSlice/mocks.d.ts +1 -1
- package/dist/usersSlice/mocks.js +1 -1
- package/dist/usersSlice/selectors.cjs +3 -3
- package/dist/usersSlice/selectors.cjs.map +1 -1
- package/dist/usersSlice/selectors.d.cts +2 -466
- package/dist/usersSlice/selectors.d.ts +2 -466
- package/dist/usersSlice/selectors.js +2 -2
- package/dist/usersSlice/selectors.js.map +1 -1
- package/dist/usersSlice/thunks.d.cts +88 -88
- package/dist/usersSlice/thunks.d.ts +88 -88
- package/dist/utils.cjs +5 -8
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +4 -6
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
- package/dist/constants-BJuY-ODE.d.ts +0 -124
- package/dist/constants-C2O55iZu.d.cts +0 -124
- package/dist/constants-D5hACLhF.js.map +0 -1
- package/dist/constants-MVizYy89.cjs.map +0 -1
- package/dist/storehooks.cjs +0 -249
- package/dist/storehooks.cjs.map +0 -1
- package/dist/storehooks.d.cts +0 -49
- package/dist/storehooks.d.ts +0 -49
- package/dist/storehooks.js +0 -241
- package/dist/storehooks.js.map +0 -1
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { o as UserSliceType } from "./index
|
|
3
|
-
import { a as ReleaseSliceType } from "./index-
|
|
4
|
-
import { a as PricePreview } from "./types-
|
|
1
|
+
import { H as emptyUiPermissions, S as Role, Tt as FilterOperator, m as DeviceIssueOptionKey } from "./constants-3gsHyxWr.js";
|
|
2
|
+
import { o as UserSliceType } from "./index-KQNyWRoG.js";
|
|
3
|
+
import { a as ReleaseSliceType } from "./index-DXfbW2gi.js";
|
|
4
|
+
import { a as PricePreview } from "./types-DB1IOQX8.js";
|
|
5
5
|
import { n as OnboardingSliceType } from "./index-CoObjWL4.js";
|
|
6
6
|
import { o as DeploymentsSliceType, t as Deployment } from "./index-B8td4-rY.js";
|
|
7
|
-
import { c as DeviceSliceType, i as DeviceGroup, r as DeviceFilter, u as InventoryAttributes } from "./index-
|
|
8
|
-
import { t as AppSliceType } from "./index-
|
|
9
|
-
import { t as MonitorSliceType } from "./index-
|
|
10
|
-
import { t as OrganizationSliceType } from "./index-
|
|
7
|
+
import { c as DeviceSliceType, i as DeviceGroup, r as DeviceFilter, u as InventoryAttributes } from "./index-uhmZ9qaP.js";
|
|
8
|
+
import { t as AppSliceType } from "./index-BMi8ZqpV.js";
|
|
9
|
+
import { t as MonitorSliceType } from "./index-CD39K38q.js";
|
|
10
|
+
import { t as OrganizationSliceType } from "./index-I82Wu-Ah.js";
|
|
11
11
|
import { Reducer, UnknownAction } from "@reduxjs/toolkit";
|
|
12
|
+
import { isDarkMode as isDarkMode$1 } from "@northern.tech/utils/helpers";
|
|
12
13
|
import { TypedUseSelectorHook } from "react-redux";
|
|
13
14
|
import { AxiosError } from "axios";
|
|
14
15
|
import { AttributeFilterPredicate, AttributeResponse, FilterV2, InvoiceLineItem, Scope } from "@northern.tech/types/MenderTypes";
|
|
@@ -60,7 +61,7 @@ type ErrorWithResponse = AxiosError<{
|
|
|
60
61
|
}> & {
|
|
61
62
|
error?: string;
|
|
62
63
|
};
|
|
63
|
-
declare const extractErrorMessage: (err: ErrorWithResponse, fallback?: string) => string;
|
|
64
|
+
declare const extractErrorMessage$1: (err: ErrorWithResponse, fallback?: string) => string;
|
|
64
65
|
declare const ensureVersionString: (software: string, fallback: string) => string;
|
|
65
66
|
declare const stringToBoolean: (content: string | number | undefined) => boolean;
|
|
66
67
|
type DeploymentStats = {
|
|
@@ -89,7 +90,6 @@ type DeviceAttributeMap = {
|
|
|
89
90
|
tags: Record<string, string>;
|
|
90
91
|
};
|
|
91
92
|
declare const mapDeviceAttributes: (attributes?: AttributeResponse[]) => DeviceAttributeMap;
|
|
92
|
-
declare const isDarkMode: (mode: string) => boolean;
|
|
93
93
|
type Line = InvoiceLineItem & {
|
|
94
94
|
product: 'mender_standard' | 'mender_micro';
|
|
95
95
|
};
|
|
@@ -105,6 +105,7 @@ declare const dispatchDelayed: ({ action, delay, dispatch }: {
|
|
|
105
105
|
}) => number;
|
|
106
106
|
//#endregion
|
|
107
107
|
//#region src/store.d.ts
|
|
108
|
+
declare const resetEnvironment: () => void;
|
|
108
109
|
type MenderEnvironment = {
|
|
109
110
|
[key: string]: unknown;
|
|
110
111
|
demoArtifactPort?: string | number;
|
|
@@ -172,28 +173,8 @@ declare const getConfiguredStore: (options?: {
|
|
|
172
173
|
users: UserSliceType;
|
|
173
174
|
}, undefined, UnknownAction>;
|
|
174
175
|
}>, import("redux").StoreEnhancer]>>;
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
devices: DeviceSliceType;
|
|
178
|
-
deployments: DeploymentsSliceType;
|
|
179
|
-
monitor: MonitorSliceType;
|
|
180
|
-
onboarding: OnboardingSliceType;
|
|
181
|
-
organization: OrganizationSliceType;
|
|
182
|
-
releases: ReleaseSliceType;
|
|
183
|
-
users: UserSliceType;
|
|
184
|
-
}, UnknownAction, import("@reduxjs/toolkit").Tuple<[import("redux").StoreEnhancer<{
|
|
185
|
-
dispatch: import("redux-thunk").ThunkDispatch<{
|
|
186
|
-
app: AppSliceType;
|
|
187
|
-
devices: DeviceSliceType;
|
|
188
|
-
deployments: DeploymentsSliceType;
|
|
189
|
-
monitor: MonitorSliceType;
|
|
190
|
-
onboarding: OnboardingSliceType;
|
|
191
|
-
organization: OrganizationSliceType;
|
|
192
|
-
releases: ReleaseSliceType;
|
|
193
|
-
users: UserSliceType;
|
|
194
|
-
}, undefined, UnknownAction>;
|
|
195
|
-
}>, import("redux").StoreEnhancer]>>;
|
|
196
|
-
type AppDispatch = typeof store.dispatch;
|
|
176
|
+
type AppStore = ReturnType<typeof getConfiguredStore>;
|
|
177
|
+
type AppDispatch = AppStore['dispatch'];
|
|
197
178
|
type RootState = ReturnType<typeof rootReducer>;
|
|
198
179
|
declare const useAppDispatch: () => AppDispatch;
|
|
199
180
|
declare const useAppSelector: TypedUseSelectorHook<RootState>;
|
|
@@ -320,5 +301,5 @@ declare const createAppAsyncThunk: import("@reduxjs/toolkit").CreateAsyncThunkFu
|
|
|
320
301
|
};
|
|
321
302
|
};
|
|
322
303
|
//#endregion
|
|
323
|
-
export {
|
|
324
|
-
//# sourceMappingURL=store-
|
|
304
|
+
export { mapFiltersToTerms as A, getAttributeScopeLabel as C, isDarkMode$1 as D, groupDeploymentStats as E, progress as F, statCollector as I, stringToBoolean as L, mapUserRolesToUiPermissions as M, mergePermissions as N, listItemMapper as O, parseSubscriptionPreview as P, stripOrchestratorManifestPrefix as R, generateDeploymentGroupDetails as S, groupDeploymentDevicesStats as T, convertToBackendSPLimits as _, commonErrorFallback as a, extractErrorMessage$1 as b, getConfiguredStore as c, useAppDispatch as d, useAppSelector as f, convertDeviceListStateToFilters as g, FilterTerm as h, RootState as i, mapTermsToFilters as j, mapDeviceAttributes as k, resetEnvironment as l, ErrorWithResponse as m, AppStore as n, commonErrorHandler as o, DeploymentStats as p, MenderEnvironment as r, createAppAsyncThunk as s, AppDispatch as t, sessionReducer as u, dispatchDelayed as v, getDeploymentState as w, filtersFilter as x, ensureVersionString as y, stripUndefined as z };
|
|
305
|
+
//# sourceMappingURL=store-BQcycBPp.d.ts.map
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { o as UserSliceType } from "./index-
|
|
3
|
-
import { a as ReleaseSliceType } from "./index-
|
|
4
|
-
import { a as PricePreview } from "./types-
|
|
1
|
+
import { H as emptyUiPermissions, S as Role, Tt as FilterOperator, m as DeviceIssueOptionKey } from "./constants-hMMMdt0R.cjs";
|
|
2
|
+
import { o as UserSliceType } from "./index-DlTiYWBe.cjs";
|
|
3
|
+
import { a as ReleaseSliceType } from "./index-B9jUHGsM.cjs";
|
|
4
|
+
import { a as PricePreview } from "./types-DtTmD7Yn.cjs";
|
|
5
5
|
import { n as OnboardingSliceType } from "./index-CoObjWL4.cjs";
|
|
6
6
|
import { o as DeploymentsSliceType, t as Deployment } from "./index-mvxjivTJ.cjs";
|
|
7
|
-
import { c as DeviceSliceType, i as DeviceGroup, r as DeviceFilter, u as InventoryAttributes } from "./index-
|
|
8
|
-
import { t as AppSliceType } from "./index-
|
|
9
|
-
import { t as MonitorSliceType } from "./index-
|
|
10
|
-
import { t as OrganizationSliceType } from "./index-
|
|
7
|
+
import { c as DeviceSliceType, i as DeviceGroup, r as DeviceFilter, u as InventoryAttributes } from "./index-D8O1HJ8Q.cjs";
|
|
8
|
+
import { t as AppSliceType } from "./index-BoZjwQHk.cjs";
|
|
9
|
+
import { t as MonitorSliceType } from "./index-C-6WkMAo.cjs";
|
|
10
|
+
import { t as OrganizationSliceType } from "./index-Dd_guNwA.cjs";
|
|
11
11
|
import { AttributeFilterPredicate, AttributeResponse, FilterV2, InvoiceLineItem, Scope } from "@northern.tech/types/MenderTypes";
|
|
12
12
|
import { Reducer, UnknownAction } from "@reduxjs/toolkit";
|
|
13
13
|
import { AxiosError } from "axios";
|
|
14
14
|
import { TypedUseSelectorHook } from "react-redux";
|
|
15
|
+
import { isDarkMode } from "@northern.tech/utils/helpers";
|
|
15
16
|
//#region src/utils.d.ts
|
|
16
17
|
type FilterProcessorValue = string | string[] | number | boolean;
|
|
17
18
|
type FilterTerm = {
|
|
@@ -89,7 +90,6 @@ type DeviceAttributeMap = {
|
|
|
89
90
|
tags: Record<string, string>;
|
|
90
91
|
};
|
|
91
92
|
declare const mapDeviceAttributes: (attributes?: AttributeResponse[]) => DeviceAttributeMap;
|
|
92
|
-
declare const isDarkMode: (mode: string) => boolean;
|
|
93
93
|
type Line = InvoiceLineItem & {
|
|
94
94
|
product: 'mender_standard' | 'mender_micro';
|
|
95
95
|
};
|
|
@@ -105,6 +105,7 @@ declare const dispatchDelayed: ({ action, delay, dispatch }: {
|
|
|
105
105
|
}) => number;
|
|
106
106
|
//#endregion
|
|
107
107
|
//#region src/store.d.ts
|
|
108
|
+
declare const resetEnvironment: () => void;
|
|
108
109
|
type MenderEnvironment = {
|
|
109
110
|
[key: string]: unknown;
|
|
110
111
|
demoArtifactPort?: string | number;
|
|
@@ -172,28 +173,8 @@ declare const getConfiguredStore: (options?: {
|
|
|
172
173
|
users: UserSliceType;
|
|
173
174
|
}, undefined, UnknownAction>;
|
|
174
175
|
}>, import("redux").StoreEnhancer]>>;
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
devices: DeviceSliceType;
|
|
178
|
-
deployments: DeploymentsSliceType;
|
|
179
|
-
monitor: MonitorSliceType;
|
|
180
|
-
onboarding: OnboardingSliceType;
|
|
181
|
-
organization: OrganizationSliceType;
|
|
182
|
-
releases: ReleaseSliceType;
|
|
183
|
-
users: UserSliceType;
|
|
184
|
-
}, UnknownAction, import("@reduxjs/toolkit").Tuple<[import("redux").StoreEnhancer<{
|
|
185
|
-
dispatch: import("redux-thunk").ThunkDispatch<{
|
|
186
|
-
app: AppSliceType;
|
|
187
|
-
devices: DeviceSliceType;
|
|
188
|
-
deployments: DeploymentsSliceType;
|
|
189
|
-
monitor: MonitorSliceType;
|
|
190
|
-
onboarding: OnboardingSliceType;
|
|
191
|
-
organization: OrganizationSliceType;
|
|
192
|
-
releases: ReleaseSliceType;
|
|
193
|
-
users: UserSliceType;
|
|
194
|
-
}, undefined, UnknownAction>;
|
|
195
|
-
}>, import("redux").StoreEnhancer]>>;
|
|
196
|
-
type AppDispatch = typeof store.dispatch;
|
|
176
|
+
type AppStore = ReturnType<typeof getConfiguredStore>;
|
|
177
|
+
type AppDispatch = AppStore['dispatch'];
|
|
197
178
|
type RootState = ReturnType<typeof rootReducer>;
|
|
198
179
|
declare const useAppDispatch: () => AppDispatch;
|
|
199
180
|
declare const useAppSelector: TypedUseSelectorHook<RootState>;
|
|
@@ -320,5 +301,5 @@ declare const createAppAsyncThunk: import("@reduxjs/toolkit").CreateAsyncThunkFu
|
|
|
320
301
|
};
|
|
321
302
|
};
|
|
322
303
|
//#endregion
|
|
323
|
-
export {
|
|
324
|
-
//# sourceMappingURL=store-
|
|
304
|
+
export { mapFiltersToTerms as A, getAttributeScopeLabel as C, isDarkMode as D, groupDeploymentStats as E, progress as F, statCollector as I, stringToBoolean as L, mapUserRolesToUiPermissions as M, mergePermissions as N, listItemMapper as O, parseSubscriptionPreview as P, stripOrchestratorManifestPrefix as R, generateDeploymentGroupDetails as S, groupDeploymentDevicesStats as T, convertToBackendSPLimits as _, commonErrorFallback as a, extractErrorMessage as b, getConfiguredStore as c, useAppDispatch as d, useAppSelector as f, convertDeviceListStateToFilters as g, FilterTerm as h, RootState as i, mapTermsToFilters as j, mapDeviceAttributes as k, resetEnvironment as l, ErrorWithResponse as m, AppStore as n, commonErrorHandler as o, DeploymentStats as p, MenderEnvironment as r, createAppAsyncThunk as s, AppDispatch as t, sessionReducer as u, dispatchDelayed as v, getDeploymentState as w, filtersFilter as x, ensureVersionString as y, stripUndefined as z };
|
|
305
|
+
//# sourceMappingURL=store-CrLzRDCx.d.cts.map
|
package/dist/store.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_constants = require("./constants-
|
|
2
|
+
const require_constants = require("./constants-DsOnY5o5.cjs");
|
|
3
3
|
const require_appSlice_index = require("./appSlice/index.cjs");
|
|
4
4
|
const require_deploymentsSlice_index = require("./deploymentsSlice/index.cjs");
|
|
5
5
|
const require_devicesSlice_index = require("./devicesSlice/index.cjs");
|
|
@@ -18,7 +18,6 @@ let _sentry_react = require("@sentry/react");
|
|
|
18
18
|
const { setSnackbar, uploadProgress } = require_actions;
|
|
19
19
|
const keys = ["sessionDeploymentChecker", require_constants.settingsKeys.initialized];
|
|
20
20
|
const resetEnvironment = () => keys.forEach((key) => window.sessionStorage.removeItem(key));
|
|
21
|
-
resetEnvironment();
|
|
22
21
|
const commonErrorFallback = "Please check your connection.";
|
|
23
22
|
const commonErrorHandler = (err, errorContext, dispatch, fallback, mightBeAuthRelated = false) => {
|
|
24
23
|
const errMsg = (0, _northern_tech_utils_helpers.extractErrorMessage)(err, fallback);
|
|
@@ -103,7 +102,6 @@ const getConfiguredStore = (options = {}) => {
|
|
|
103
102
|
}).concat(rejectionLoggerMiddleware)
|
|
104
103
|
});
|
|
105
104
|
};
|
|
106
|
-
const store = getConfiguredStore({ preloadedState: {} });
|
|
107
105
|
const useAppDispatch = react_redux.useDispatch;
|
|
108
106
|
const useAppSelector = react_redux.useSelector;
|
|
109
107
|
const createAppAsyncThunk = _reduxjs_toolkit.createAsyncThunk.withTypes();
|
|
@@ -112,8 +110,8 @@ exports.commonErrorFallback = commonErrorFallback;
|
|
|
112
110
|
exports.commonErrorHandler = commonErrorHandler;
|
|
113
111
|
exports.createAppAsyncThunk = createAppAsyncThunk;
|
|
114
112
|
exports.getConfiguredStore = getConfiguredStore;
|
|
113
|
+
exports.resetEnvironment = resetEnvironment;
|
|
115
114
|
exports.sessionReducer = sessionReducer;
|
|
116
|
-
exports.store = store;
|
|
117
115
|
exports.useAppDispatch = useAppDispatch;
|
|
118
116
|
exports.useAppSelector = useAppSelector;
|
|
119
117
|
|
package/dist/store.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.cjs","names":["actions","settingsKeys","extractErrorMessage","getToken","preformatWithRequestID","combineReducers","appSlice","deviceSlice","deploymentSlice","monitorSlice","onboardingSlice","organizationSlice","releaseSlice","userSlice","isRejected","userActions","createReduxEnhancer","configureStore","organizationActions","useDispatch","useSelector","createAsyncThunk"],"sources":["../src/store.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 { useDispatch, useSelector } from 'react-redux';\nimport type { TypedUseSelectorHook } from 'react-redux';\n\nimport { extractErrorMessage, preformatWithRequestID } from '@northern.tech/utils/helpers';\nimport type { Middleware, Reducer, UnknownAction } from '@reduxjs/toolkit';\nimport { combineReducers, configureStore, createAsyncThunk, isRejected } from '@reduxjs/toolkit';\nimport { createReduxEnhancer } from '@sentry/react';\n\nimport actions from './actions';\nimport appSlice from './appSlice';\nimport { getToken } from './auth';\nimport { USER_LOGOUT, settingsKeys } from './constants';\nimport deploymentSlice from './deploymentsSlice';\nimport deviceSlice from './devicesSlice';\nimport monitorSlice from './monitorSlice';\nimport onboardingSlice from './onboardingSlice';\nimport organizationSlice, { actions as organizationActions } from './organizationSlice';\nimport releaseSlice from './releasesSlice';\nimport userSlice, { actions as userActions } from './usersSlice';\n\nconst { setSnackbar, uploadProgress } = actions;\n\n// exclude 'pendings-redirect' since this is expected to persist refreshes - the rest should be better to be redone\nconst keys = ['sessionDeploymentChecker', settingsKeys.initialized];\
|
|
1
|
+
{"version":3,"file":"store.cjs","names":["actions","settingsKeys","extractErrorMessage","getToken","preformatWithRequestID","combineReducers","appSlice","deviceSlice","deploymentSlice","monitorSlice","onboardingSlice","organizationSlice","releaseSlice","userSlice","isRejected","userActions","createReduxEnhancer","configureStore","organizationActions","useDispatch","useSelector","createAsyncThunk"],"sources":["../src/store.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 { useDispatch, useSelector } from 'react-redux';\nimport type { TypedUseSelectorHook } from 'react-redux';\n\nimport { extractErrorMessage, preformatWithRequestID } from '@northern.tech/utils/helpers';\nimport type { Middleware, Reducer, UnknownAction } from '@reduxjs/toolkit';\nimport { combineReducers, configureStore, createAsyncThunk, isRejected } from '@reduxjs/toolkit';\nimport { createReduxEnhancer } from '@sentry/react';\n\nimport actions from './actions';\nimport appSlice from './appSlice';\nimport { getToken } from './auth';\nimport { USER_LOGOUT, settingsKeys } from './constants';\nimport deploymentSlice from './deploymentsSlice';\nimport deviceSlice from './devicesSlice';\nimport monitorSlice from './monitorSlice';\nimport onboardingSlice from './onboardingSlice';\nimport organizationSlice, { actions as organizationActions } from './organizationSlice';\nimport releaseSlice from './releasesSlice';\nimport userSlice, { actions as userActions } from './usersSlice';\n\nconst { setSnackbar, uploadProgress } = actions;\n\n// exclude 'pendings-redirect' since this is expected to persist refreshes - the rest should be better to be redone\nconst keys = ['sessionDeploymentChecker', settingsKeys.initialized];\nexport const resetEnvironment = (): void => keys.forEach(key => window.sessionStorage.removeItem(key));\n\nexport type { ErrorWithResponse } from './utils';\n\nexport type MenderEnvironment = {\n [key: string]: unknown;\n demoArtifactPort?: string | number;\n disableOnboarding?: string;\n features: Record<string, string>;\n sentry?: { isReduxEnabled?: string | boolean };\n version: string;\n};\n\ndeclare global {\n interface Window {\n mender_environment?: MenderEnvironment;\n }\n}\n\nexport const commonErrorFallback = 'Please check your connection.';\nexport const commonErrorHandler = (\n err: { message?: string; response?: { data?: unknown } },\n errorContext: string,\n dispatch: AppDispatch,\n fallback?: string,\n mightBeAuthRelated = false\n): Promise<never> => {\n const errMsg = extractErrorMessage(err, fallback);\n if (mightBeAuthRelated || getToken()) {\n dispatch(setSnackbar({ message: preformatWithRequestID(err.response, `${errorContext} ${errMsg}`), action: 'Copy to clipboard' }));\n }\n return Promise.reject(err);\n};\n\nconst rootReducer = combineReducers({\n app: appSlice,\n devices: deviceSlice,\n deployments: deploymentSlice,\n monitor: monitorSlice,\n onboarding: onboardingSlice,\n organization: organizationSlice,\n releases: releaseSlice,\n users: userSlice\n});\n\ntype RootReducerState = ReturnType<typeof rootReducer>;\n\nconst sessionReducerImpl: Reducer<RootReducerState | undefined, UnknownAction> = (state, action) => {\n if (action.type === USER_LOGOUT) {\n state = undefined;\n }\n return rootReducer(state, action);\n};\n// Export for testing; cast to RootReducerState since undefined always falls through to initial slice states\nexport const sessionReducer = sessionReducerImpl as Reducer<RootReducerState>;\n\nconst rejectionLoggerMiddleware: Middleware = () => next => action => {\n if (isRejected(action)) {\n console.error('Rejection in action:', action);\n if (action.error) {\n console.error(action.error.stack);\n }\n }\n return next(action);\n};\n\nconst tracingActionIgnoreList = [userActions.successfullyLoggedIn.type, 'users/loginUser/pending', 'users/loginUser/fulfilled', 'users/loginUser/rejected'];\n\nconst sentryReduxEnhancer = createReduxEnhancer({\n actionTransformer: (action: UnknownAction) => {\n if (tracingActionIgnoreList.includes(action.type as string)) {\n return null;\n }\n return action;\n },\n // Transform the state to remove sensitive information\n stateTransformer: (state: RootState) => {\n const transformedState = {\n ...state,\n users: { ...state.users, currentSession: null },\n organization: {\n ...state.organization,\n organization: {\n ...state.organization.organization,\n tenant_token: null\n }\n }\n };\n return transformedState;\n }\n});\n\nexport const getConfiguredStore = (options: { [key: string]: unknown; preloadedState?: Partial<RootReducerState> } = {}) => {\n const { preloadedState, ...config } = options;\n return configureStore({\n ...config,\n preloadedState: preloadedState as RootReducerState,\n enhancers: getDefaultEnhancers => {\n // rely on the plain injected env object, as we're initializing the store only here\n if (window.mender_environment?.sentry?.isReduxEnabled) {\n return getDefaultEnhancers().concat(sentryReduxEnhancer);\n }\n return getDefaultEnhancers();\n },\n reducer: sessionReducer,\n // @ts-expect-error - GetDefaultMiddleware type mismatch between @reduxjs/toolkit and @sentry/react\n middleware: getDefaultMiddleware =>\n getDefaultMiddleware({\n immutableCheck: {\n ignoredPaths: ['app.uploadsById']\n },\n serializableCheck: {\n ignoredActions: [organizationActions.receiveExternalDeviceIntegrations.type, uploadProgress.type],\n ignoredActionPaths: ['uploads', /payload\\..*$/, 'meta.arg.file', 'meta.arg.integration.configHint'],\n ignoredPaths: ['app.uploadsById', 'organization.externalDeviceIntegrations']\n }\n }).concat(rejectionLoggerMiddleware)\n });\n};\nexport type AppStore = ReturnType<typeof getConfiguredStore>;\nexport type AppDispatch = AppStore['dispatch'];\nexport type RootState = ReturnType<typeof rootReducer>;\nexport const useAppDispatch: () => AppDispatch = useDispatch;\nexport const useAppSelector: TypedUseSelectorHook<RootState> = useSelector;\n\nexport const createAppAsyncThunk = createAsyncThunk.withTypes<{\n dispatch: AppDispatch;\n state: RootState;\n}>();\n"],"mappings":";;;;;;;;;;;;;;;;;AAiCA,MAAM,EAAE,aAAa,mBAAmBA;AAGxC,MAAM,OAAO,CAAC,4BAA4BC,kBAAAA,aAAa,WAAW;AAClE,MAAa,yBAA+B,KAAK,SAAQ,QAAO,OAAO,eAAe,WAAW,GAAG,CAAC;AAmBrG,MAAa,sBAAsB;AACnC,MAAa,sBACX,KACA,cACA,UACA,UACA,qBAAqB,UACF;CACnB,MAAM,UAAA,GAASC,6BAAAA,oBAAAA,CAAoB,KAAK,QAAQ;CAChD,IAAI,sBAAsBC,aAAAA,SAAS,GACjC,SAAS,YAAY;EAAE,UAAA,GAASC,6BAAAA,uBAAAA,CAAuB,IAAI,UAAU,GAAG,aAAa,GAAG,QAAQ;EAAG,QAAQ;CAAoB,CAAC,CAAC;CAEnI,OAAO,QAAQ,OAAO,GAAG;AAC3B;AAEA,MAAM,eAAA,GAAcC,iBAAAA,gBAAAA,CAAgB;CAClC,KAAKC,uBAAAA;CACL,SAASC,2BAAAA;CACT,aAAaC,+BAAAA;CACb,SAASC,2BAAAA;CACT,YAAYC,8BAAAA;CACZ,cAAcC,gCAAAA;CACd,UAAUC,4BAAAA;CACV,OAAOC,yBAAAA;AACT,CAAC;AAID,MAAM,sBAA4E,OAAO,WAAW;CAClG,IAAI,OAAO,SAAA,eACT,QAAQ,KAAA;CAEV,OAAO,YAAY,OAAO,MAAM;AAClC;AAEA,MAAa,iBAAiB;AAE9B,MAAM,mCAA8C,UAAQ,WAAU;CACpE,KAAA,GAAIC,iBAAAA,WAAAA,CAAW,MAAM,GAAG;EACtB,QAAQ,MAAM,wBAAwB,MAAM;EAC5C,IAAI,OAAO,OACT,QAAQ,MAAM,OAAO,MAAM,KAAK;CAEpC;CACA,OAAO,KAAK,MAAM;AACpB;AAEA,MAAM,0BAA0B;CAACC,yBAAAA,QAAY,qBAAqB;CAAM;CAA2B;CAA6B;AAA0B;AAE1J,MAAM,uBAAA,GAAsBC,cAAAA,oBAAAA,CAAoB;CAC9C,oBAAoB,WAA0B;EAC5C,IAAI,wBAAwB,SAAS,OAAO,IAAc,GACxD,OAAO;EAET,OAAO;CACT;CAEA,mBAAmB,UAAqB;EAYtC,OAAO;GAVL,GAAG;GACH,OAAO;IAAE,GAAG,MAAM;IAAO,gBAAgB;GAAK;GAC9C,cAAc;IACZ,GAAG,MAAM;IACT,cAAc;KACZ,GAAG,MAAM,aAAa;KACtB,cAAc;IAChB;GACF;EAEoB;CACxB;AACF,CAAC;AAED,MAAa,sBAAsB,UAAkF,CAAC,MAAM;CAC1H,MAAM,EAAE,gBAAgB,GAAG,WAAW;CACtC,QAAA,GAAOC,iBAAAA,eAAAA,CAAe;EACpB,GAAG;EACa;EAChB,YAAW,wBAAuB;GAEhC,IAAI,OAAO,oBAAoB,QAAQ,gBACrC,OAAO,oBAAoB,CAAC,CAAC,OAAO,mBAAmB;GAEzD,OAAO,oBAAoB;EAC7B;EACA,SAAS;EAET,aAAY,yBACV,qBAAqB;GACnB,gBAAgB,EACd,cAAc,CAAC,iBAAiB,EAClC;GACA,mBAAmB;IACjB,gBAAgB,CAACC,gCAAAA,QAAoB,kCAAkC,MAAM,eAAe,IAAI;IAChG,oBAAoB;KAAC;KAAW;KAAgB;KAAiB;IAAiC;IAClG,cAAc,CAAC,mBAAmB,yCAAyC;GAC7E;EACF,CAAC,CAAC,CAAC,OAAO,yBAAyB;CACvC,CAAC;AACH;AAIA,MAAa,iBAAoCC,YAAAA;AACjD,MAAa,iBAAkDC,YAAAA;AAE/D,MAAa,sBAAsBC,iBAAAA,iBAAiB,UAGjD"}
|
package/dist/store.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { AppDispatch, type ErrorWithResponse, MenderEnvironment, RootState, commonErrorFallback, commonErrorHandler, createAppAsyncThunk, getConfiguredStore,
|
|
1
|
+
import { a as commonErrorFallback, c as getConfiguredStore, d as useAppDispatch, f as useAppSelector, i as RootState, l as resetEnvironment, m as ErrorWithResponse, n as AppStore, o as commonErrorHandler, r as MenderEnvironment, s as createAppAsyncThunk, t as AppDispatch, u as sessionReducer } from "./store-CrLzRDCx.cjs";
|
|
2
|
+
export { AppDispatch, AppStore, type ErrorWithResponse, MenderEnvironment, RootState, commonErrorFallback, commonErrorHandler, createAppAsyncThunk, getConfiguredStore, resetEnvironment, sessionReducer, useAppDispatch, useAppSelector };
|
package/dist/store.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { AppDispatch, type ErrorWithResponse, MenderEnvironment, RootState, commonErrorFallback, commonErrorHandler, createAppAsyncThunk, getConfiguredStore,
|
|
1
|
+
import { a as commonErrorFallback, c as getConfiguredStore, d as useAppDispatch, f as useAppSelector, i as RootState, l as resetEnvironment, m as ErrorWithResponse, n as AppStore, o as commonErrorHandler, r as MenderEnvironment, s as createAppAsyncThunk, t as AppDispatch, u as sessionReducer } from "./store-BQcycBPp.js";
|
|
2
|
+
export { AppDispatch, AppStore, type ErrorWithResponse, MenderEnvironment, RootState, commonErrorFallback, commonErrorHandler, createAppAsyncThunk, getConfiguredStore, resetEnvironment, sessionReducer, useAppDispatch, useAppSelector };
|
package/dist/store.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $ as settingsKeys } from "./constants-yul-O5hD.js";
|
|
2
2
|
import appSlice_default from "./appSlice/index.js";
|
|
3
3
|
import deploymentsSlice_default from "./deploymentsSlice/index.js";
|
|
4
4
|
import devicesSlice_default from "./devicesSlice/index.js";
|
|
@@ -17,7 +17,6 @@ import { createReduxEnhancer } from "@sentry/react";
|
|
|
17
17
|
const { setSnackbar, uploadProgress } = actions_default;
|
|
18
18
|
const keys = ["sessionDeploymentChecker", settingsKeys.initialized];
|
|
19
19
|
const resetEnvironment = () => keys.forEach((key) => window.sessionStorage.removeItem(key));
|
|
20
|
-
resetEnvironment();
|
|
21
20
|
const commonErrorFallback = "Please check your connection.";
|
|
22
21
|
const commonErrorHandler = (err, errorContext, dispatch, fallback, mightBeAuthRelated = false) => {
|
|
23
22
|
const errMsg = extractErrorMessage(err, fallback);
|
|
@@ -102,11 +101,10 @@ const getConfiguredStore = (options = {}) => {
|
|
|
102
101
|
}).concat(rejectionLoggerMiddleware)
|
|
103
102
|
});
|
|
104
103
|
};
|
|
105
|
-
const store = getConfiguredStore({ preloadedState: {} });
|
|
106
104
|
const useAppDispatch = useDispatch;
|
|
107
105
|
const useAppSelector = useSelector;
|
|
108
106
|
const createAppAsyncThunk = createAsyncThunk.withTypes();
|
|
109
107
|
//#endregion
|
|
110
|
-
export { commonErrorFallback, commonErrorHandler, createAppAsyncThunk, getConfiguredStore,
|
|
108
|
+
export { commonErrorFallback, commonErrorHandler, createAppAsyncThunk, getConfiguredStore, resetEnvironment, sessionReducer, useAppDispatch, useAppSelector };
|
|
111
109
|
|
|
112
110
|
//# sourceMappingURL=store.js.map
|
package/dist/store.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.js","names":["actions","appSlice","deviceSlice","deploymentSlice","monitorSlice","onboardingSlice","organizationSlice","releaseSlice","userSlice","userActions","organizationActions"],"sources":["../src/store.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 { useDispatch, useSelector } from 'react-redux';\nimport type { TypedUseSelectorHook } from 'react-redux';\n\nimport { extractErrorMessage, preformatWithRequestID } from '@northern.tech/utils/helpers';\nimport type { Middleware, Reducer, UnknownAction } from '@reduxjs/toolkit';\nimport { combineReducers, configureStore, createAsyncThunk, isRejected } from '@reduxjs/toolkit';\nimport { createReduxEnhancer } from '@sentry/react';\n\nimport actions from './actions';\nimport appSlice from './appSlice';\nimport { getToken } from './auth';\nimport { USER_LOGOUT, settingsKeys } from './constants';\nimport deploymentSlice from './deploymentsSlice';\nimport deviceSlice from './devicesSlice';\nimport monitorSlice from './monitorSlice';\nimport onboardingSlice from './onboardingSlice';\nimport organizationSlice, { actions as organizationActions } from './organizationSlice';\nimport releaseSlice from './releasesSlice';\nimport userSlice, { actions as userActions } from './usersSlice';\n\nconst { setSnackbar, uploadProgress } = actions;\n\n// exclude 'pendings-redirect' since this is expected to persist refreshes - the rest should be better to be redone\nconst keys = ['sessionDeploymentChecker', settingsKeys.initialized];\
|
|
1
|
+
{"version":3,"file":"store.js","names":["actions","appSlice","deviceSlice","deploymentSlice","monitorSlice","onboardingSlice","organizationSlice","releaseSlice","userSlice","userActions","organizationActions"],"sources":["../src/store.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 { useDispatch, useSelector } from 'react-redux';\nimport type { TypedUseSelectorHook } from 'react-redux';\n\nimport { extractErrorMessage, preformatWithRequestID } from '@northern.tech/utils/helpers';\nimport type { Middleware, Reducer, UnknownAction } from '@reduxjs/toolkit';\nimport { combineReducers, configureStore, createAsyncThunk, isRejected } from '@reduxjs/toolkit';\nimport { createReduxEnhancer } from '@sentry/react';\n\nimport actions from './actions';\nimport appSlice from './appSlice';\nimport { getToken } from './auth';\nimport { USER_LOGOUT, settingsKeys } from './constants';\nimport deploymentSlice from './deploymentsSlice';\nimport deviceSlice from './devicesSlice';\nimport monitorSlice from './monitorSlice';\nimport onboardingSlice from './onboardingSlice';\nimport organizationSlice, { actions as organizationActions } from './organizationSlice';\nimport releaseSlice from './releasesSlice';\nimport userSlice, { actions as userActions } from './usersSlice';\n\nconst { setSnackbar, uploadProgress } = actions;\n\n// exclude 'pendings-redirect' since this is expected to persist refreshes - the rest should be better to be redone\nconst keys = ['sessionDeploymentChecker', settingsKeys.initialized];\nexport const resetEnvironment = (): void => keys.forEach(key => window.sessionStorage.removeItem(key));\n\nexport type { ErrorWithResponse } from './utils';\n\nexport type MenderEnvironment = {\n [key: string]: unknown;\n demoArtifactPort?: string | number;\n disableOnboarding?: string;\n features: Record<string, string>;\n sentry?: { isReduxEnabled?: string | boolean };\n version: string;\n};\n\ndeclare global {\n interface Window {\n mender_environment?: MenderEnvironment;\n }\n}\n\nexport const commonErrorFallback = 'Please check your connection.';\nexport const commonErrorHandler = (\n err: { message?: string; response?: { data?: unknown } },\n errorContext: string,\n dispatch: AppDispatch,\n fallback?: string,\n mightBeAuthRelated = false\n): Promise<never> => {\n const errMsg = extractErrorMessage(err, fallback);\n if (mightBeAuthRelated || getToken()) {\n dispatch(setSnackbar({ message: preformatWithRequestID(err.response, `${errorContext} ${errMsg}`), action: 'Copy to clipboard' }));\n }\n return Promise.reject(err);\n};\n\nconst rootReducer = combineReducers({\n app: appSlice,\n devices: deviceSlice,\n deployments: deploymentSlice,\n monitor: monitorSlice,\n onboarding: onboardingSlice,\n organization: organizationSlice,\n releases: releaseSlice,\n users: userSlice\n});\n\ntype RootReducerState = ReturnType<typeof rootReducer>;\n\nconst sessionReducerImpl: Reducer<RootReducerState | undefined, UnknownAction> = (state, action) => {\n if (action.type === USER_LOGOUT) {\n state = undefined;\n }\n return rootReducer(state, action);\n};\n// Export for testing; cast to RootReducerState since undefined always falls through to initial slice states\nexport const sessionReducer = sessionReducerImpl as Reducer<RootReducerState>;\n\nconst rejectionLoggerMiddleware: Middleware = () => next => action => {\n if (isRejected(action)) {\n console.error('Rejection in action:', action);\n if (action.error) {\n console.error(action.error.stack);\n }\n }\n return next(action);\n};\n\nconst tracingActionIgnoreList = [userActions.successfullyLoggedIn.type, 'users/loginUser/pending', 'users/loginUser/fulfilled', 'users/loginUser/rejected'];\n\nconst sentryReduxEnhancer = createReduxEnhancer({\n actionTransformer: (action: UnknownAction) => {\n if (tracingActionIgnoreList.includes(action.type as string)) {\n return null;\n }\n return action;\n },\n // Transform the state to remove sensitive information\n stateTransformer: (state: RootState) => {\n const transformedState = {\n ...state,\n users: { ...state.users, currentSession: null },\n organization: {\n ...state.organization,\n organization: {\n ...state.organization.organization,\n tenant_token: null\n }\n }\n };\n return transformedState;\n }\n});\n\nexport const getConfiguredStore = (options: { [key: string]: unknown; preloadedState?: Partial<RootReducerState> } = {}) => {\n const { preloadedState, ...config } = options;\n return configureStore({\n ...config,\n preloadedState: preloadedState as RootReducerState,\n enhancers: getDefaultEnhancers => {\n // rely on the plain injected env object, as we're initializing the store only here\n if (window.mender_environment?.sentry?.isReduxEnabled) {\n return getDefaultEnhancers().concat(sentryReduxEnhancer);\n }\n return getDefaultEnhancers();\n },\n reducer: sessionReducer,\n // @ts-expect-error - GetDefaultMiddleware type mismatch between @reduxjs/toolkit and @sentry/react\n middleware: getDefaultMiddleware =>\n getDefaultMiddleware({\n immutableCheck: {\n ignoredPaths: ['app.uploadsById']\n },\n serializableCheck: {\n ignoredActions: [organizationActions.receiveExternalDeviceIntegrations.type, uploadProgress.type],\n ignoredActionPaths: ['uploads', /payload\\..*$/, 'meta.arg.file', 'meta.arg.integration.configHint'],\n ignoredPaths: ['app.uploadsById', 'organization.externalDeviceIntegrations']\n }\n }).concat(rejectionLoggerMiddleware)\n });\n};\nexport type AppStore = ReturnType<typeof getConfiguredStore>;\nexport type AppDispatch = AppStore['dispatch'];\nexport type RootState = ReturnType<typeof rootReducer>;\nexport const useAppDispatch: () => AppDispatch = useDispatch;\nexport const useAppSelector: TypedUseSelectorHook<RootState> = useSelector;\n\nexport const createAppAsyncThunk = createAsyncThunk.withTypes<{\n dispatch: AppDispatch;\n state: RootState;\n}>();\n"],"mappings":";;;;;;;;;;;;;;;;AAiCA,MAAM,EAAE,aAAa,mBAAmBA;AAGxC,MAAM,OAAO,CAAC,4BAA4B,aAAa,WAAW;AAClE,MAAa,yBAA+B,KAAK,SAAQ,QAAO,OAAO,eAAe,WAAW,GAAG,CAAC;AAmBrG,MAAa,sBAAsB;AACnC,MAAa,sBACX,KACA,cACA,UACA,UACA,qBAAqB,UACF;CACnB,MAAM,SAAS,oBAAoB,KAAK,QAAQ;CAChD,IAAI,sBAAsB,SAAS,GACjC,SAAS,YAAY;EAAE,SAAS,uBAAuB,IAAI,UAAU,GAAG,aAAa,GAAG,QAAQ;EAAG,QAAQ;CAAoB,CAAC,CAAC;CAEnI,OAAO,QAAQ,OAAO,GAAG;AAC3B;AAEA,MAAM,cAAc,gBAAgB;CAClC,KAAKC;CACL,SAASC;CACT,aAAaC;CACb,SAASC;CACT,YAAYC;CACZ,cAAcC;CACd,UAAUC;CACV,OAAOC;AACT,CAAC;AAID,MAAM,sBAA4E,OAAO,WAAW;CAClG,IAAI,OAAO,SAAA,eACT,QAAQ,KAAA;CAEV,OAAO,YAAY,OAAO,MAAM;AAClC;AAEA,MAAa,iBAAiB;AAE9B,MAAM,mCAA8C,UAAQ,WAAU;CACpE,IAAI,WAAW,MAAM,GAAG;EACtB,QAAQ,MAAM,wBAAwB,MAAM;EAC5C,IAAI,OAAO,OACT,QAAQ,MAAM,OAAO,MAAM,KAAK;CAEpC;CACA,OAAO,KAAK,MAAM;AACpB;AAEA,MAAM,0BAA0B;CAACC,UAAY,qBAAqB;CAAM;CAA2B;CAA6B;AAA0B;AAE1J,MAAM,sBAAsB,oBAAoB;CAC9C,oBAAoB,WAA0B;EAC5C,IAAI,wBAAwB,SAAS,OAAO,IAAc,GACxD,OAAO;EAET,OAAO;CACT;CAEA,mBAAmB,UAAqB;EAYtC,OAAO;GAVL,GAAG;GACH,OAAO;IAAE,GAAG,MAAM;IAAO,gBAAgB;GAAK;GAC9C,cAAc;IACZ,GAAG,MAAM;IACT,cAAc;KACZ,GAAG,MAAM,aAAa;KACtB,cAAc;IAChB;GACF;EAEoB;CACxB;AACF,CAAC;AAED,MAAa,sBAAsB,UAAkF,CAAC,MAAM;CAC1H,MAAM,EAAE,gBAAgB,GAAG,WAAW;CACtC,OAAO,eAAe;EACpB,GAAG;EACa;EAChB,YAAW,wBAAuB;GAEhC,IAAI,OAAO,oBAAoB,QAAQ,gBACrC,OAAO,oBAAoB,CAAC,CAAC,OAAO,mBAAmB;GAEzD,OAAO,oBAAoB;EAC7B;EACA,SAAS;EAET,aAAY,yBACV,qBAAqB;GACnB,gBAAgB,EACd,cAAc,CAAC,iBAAiB,EAClC;GACA,mBAAmB;IACjB,gBAAgB,CAACC,QAAoB,kCAAkC,MAAM,eAAe,IAAI;IAChG,oBAAoB;KAAC;KAAW;KAAgB;KAAiB;IAAiC;IAClG,cAAc,CAAC,mBAAmB,yCAAyC;GAC7E;EACF,CAAC,CAAC,CAAC,OAAO,yBAAyB;CACvC,CAAC;AACH;AAIA,MAAa,iBAAoC;AACjD,MAAa,iBAAkD;AAE/D,MAAa,sBAAsB,iBAAiB,UAGjD"}
|
package/dist/thunks.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_rolldown_runtime = require("./rolldown-runtime-VH7oDXx4.cjs");
|
|
3
3
|
const require_appSlice_constants = require("./appSlice/constants.cjs");
|
|
4
|
-
const require_constants = require("./constants-
|
|
4
|
+
const require_constants = require("./constants-DsOnY5o5.cjs");
|
|
5
5
|
const require_onboardingSlice_constants = require("./onboardingSlice/constants.cjs");
|
|
6
6
|
const require_releasesSlice_constants = require("./releasesSlice/constants.cjs");
|
|
7
7
|
const require_appSlice_index = require("./appSlice/index.cjs");
|
|
@@ -24,6 +24,7 @@ const require_api_general_api = require("./api/general-api.cjs");
|
|
|
24
24
|
const require_monitorSlice_thunks = require("./monitorSlice/thunks.cjs");
|
|
25
25
|
const require_releasesSlice_thunks = require("./releasesSlice/thunks.cjs");
|
|
26
26
|
const require_api_users_api = require("./api/users-api.cjs");
|
|
27
|
+
let _northern_tech_utils_constants = require("@northern.tech/utils/constants");
|
|
27
28
|
let _northern_tech_utils_helpers = require("@northern.tech/utils/helpers");
|
|
28
29
|
let universal_cookie = require("universal-cookie");
|
|
29
30
|
universal_cookie = require_rolldown_runtime.__toESM(universal_cookie, 1);
|
|
@@ -42,7 +43,6 @@ dayjs_plugin_utc_js = require_rolldown_runtime.__toESM(dayjs_plugin_utc_js, 1);
|
|
|
42
43
|
let md5 = require("md5");
|
|
43
44
|
md5 = require_rolldown_runtime.__toESM(md5, 1);
|
|
44
45
|
let _northern_tech_utils_retrytimer = require("@northern.tech/utils/retrytimer");
|
|
45
|
-
let _northern_tech_utils_constants = require("@northern.tech/utils/constants");
|
|
46
46
|
//#region src/appSlice/thunks.ts
|
|
47
47
|
const cookies$3 = new universal_cookie.default();
|
|
48
48
|
const setFirstLoginAfterSignup = require_store.createAppAsyncThunk(`app/setFirstLoginAfterSignup`, (firstLoginAfterSignup, { dispatch }) => {
|
|
@@ -257,7 +257,7 @@ const createDeployment = require_store.createAppAsyncThunk(`${require_deployment
|
|
|
257
257
|
dispatch(getSingleDeployment(deploymentId)),
|
|
258
258
|
Promise.resolve(dispatch(setSnackbar$3({
|
|
259
259
|
message: "Deployment created successfully",
|
|
260
|
-
autoHideDuration:
|
|
260
|
+
autoHideDuration: _northern_tech_utils_constants.TIMEOUTS.fiveSeconds
|
|
261
261
|
})))
|
|
262
262
|
];
|
|
263
263
|
trackDeploymentCreation(totalDeploymentCount, hasDeployments, trial_expiration);
|
|
@@ -474,7 +474,7 @@ const saveDeltaDeploymentsConfig = require_store.createAppAsyncThunk(`${require_
|
|
|
474
474
|
return Promise.all([dispatch(require_deploymentsSlice_index.actions.setDeploymentsConfig(newConfig)), dispatch(setSnackbar$3("Settings saved successfully"))]);
|
|
475
475
|
});
|
|
476
476
|
});
|
|
477
|
-
const generateDeploymentLogAnalysis = require_store.createAppAsyncThunk(`${require_deploymentsSlice_index.sliceName}/generateDeploymentLogAnalysis`, ({ deploymentId, deviceId }, { dispatch, rejectWithValue }) => require_api_general_api.default.get(`${_northern_tech_utils_constants.apiRoot}/v1alpha1/deployments/deployments/${deploymentId}/devices/${deviceId}/log/explain`, { timeout: 60 *
|
|
477
|
+
const generateDeploymentLogAnalysis = require_store.createAppAsyncThunk(`${require_deploymentsSlice_index.sliceName}/generateDeploymentLogAnalysis`, ({ deploymentId, deviceId }, { dispatch, rejectWithValue }) => require_api_general_api.default.get(`${_northern_tech_utils_constants.apiRoot}/v1alpha1/deployments/deployments/${deploymentId}/devices/${deviceId}/log/explain`, { timeout: 60 * _northern_tech_utils_constants.TIMEOUTS.oneSecond }).then(({ data: result }) => Promise.resolve(result)).catch((err) => {
|
|
478
478
|
if (err.response.status === 429) return rejectWithValue(err.response);
|
|
479
479
|
require_store.commonErrorHandler(err, "There was an error analysing the deployment log:", dispatch);
|
|
480
480
|
}));
|
|
@@ -574,7 +574,7 @@ const removeDevicesFromGroup = require_store.createAppAsyncThunk(`${require_devi
|
|
|
574
574
|
deviceIds
|
|
575
575
|
})), dispatch(setSnackbar$2({
|
|
576
576
|
message: `The ${(0, pluralize.default)("devices", deviceIds.length)} ${(0, pluralize.default)("were", deviceIds.length)} removed from the group`,
|
|
577
|
-
autoHideDuration:
|
|
577
|
+
autoHideDuration: _northern_tech_utils_constants.TIMEOUTS.fiveSeconds
|
|
578
578
|
}))])));
|
|
579
579
|
const addStaticGroup = require_store.createAppAsyncThunk(`${require_devicesSlice_index.sliceName}/addStaticGroup`, ({ group, devices }, { dispatch, getState }) => dispatch(addDevicesToGroup({
|
|
580
580
|
group,
|
|
@@ -603,7 +603,7 @@ const removeStaticGroup = require_store.createAppAsyncThunk(`${require_devicesSl
|
|
|
603
603
|
dispatch(getGroups()),
|
|
604
604
|
dispatch(setSnackbar$2({
|
|
605
605
|
message: "Group was removed successfully",
|
|
606
|
-
autoHideDuration:
|
|
606
|
+
autoHideDuration: _northern_tech_utils_constants.TIMEOUTS.fiveSeconds
|
|
607
607
|
}))
|
|
608
608
|
])));
|
|
609
609
|
const getDynamicGroup = require_store.createAppAsyncThunk(`${require_devicesSlice_index.sliceName}/getDynamicGroupById`, (id, { dispatch }) => require_api_general_api.default.get(`${_northern_tech_utils_constants.inventoryApiUrlV2}/filters/${id}`).catch((err) => {
|
|
@@ -656,7 +656,7 @@ const removeDynamicGroup = require_store.createAppAsyncThunk(`${require_devicesS
|
|
|
656
656
|
dispatch(removeReportsByGroupName(groupName)),
|
|
657
657
|
dispatch(setSnackbar$2({
|
|
658
658
|
message: "Group was removed successfully",
|
|
659
|
-
autoHideDuration:
|
|
659
|
+
autoHideDuration: _northern_tech_utils_constants.TIMEOUTS.fiveSeconds
|
|
660
660
|
}))
|
|
661
661
|
]));
|
|
662
662
|
});
|
|
@@ -855,6 +855,7 @@ const getDeviceInfo = require_store.createAppAsyncThunk(`${require_devicesSlice_
|
|
|
855
855
|
tasks.push(dispatch(require_monitorSlice_thunks.getLatestDeviceAlerts({ id: deviceId })));
|
|
856
856
|
tasks.push(dispatch(require_monitorSlice_thunks.getDeviceMonitorConfig(deviceId)));
|
|
857
857
|
}
|
|
858
|
+
if (device.tier === "system") tasks.push(dispatch(getDeviceComponents(deviceId)));
|
|
858
859
|
}
|
|
859
860
|
return Promise.all(tasks);
|
|
860
861
|
});
|
|
@@ -1134,7 +1135,7 @@ const updateTypeMap = {
|
|
|
1134
1135
|
const triggerDeviceUpdate = require_store.createAppAsyncThunk(`${require_devicesSlice_index.sliceName}/triggerDeviceUpdate`, async ({ id, type }, { dispatch }) => {
|
|
1135
1136
|
await require_api_general_api.default.post(`${_northern_tech_utils_constants.deviceConnect}/devices/${id}/${updateTypeMap[type] ?? updateTypeMap.deploymentUpdate}`).catch((err) => require_store.commonErrorHandler(err, `The request couldn't be sent.`, dispatch));
|
|
1136
1137
|
dispatch(setSnackbar$2("Request has been sent."));
|
|
1137
|
-
await new Promise((resolve) => setTimeout(resolve,
|
|
1138
|
+
await new Promise((resolve) => setTimeout(resolve, _northern_tech_utils_constants.TIMEOUTS.threeSeconds));
|
|
1138
1139
|
return dispatch(getDeviceById(id));
|
|
1139
1140
|
});
|
|
1140
1141
|
const getSessionDetails = require_store.createAppAsyncThunk(`${require_devicesSlice_index.sliceName}/getSessionDetails`, ({ sessionId, deviceId, userId, startDate, endDate }) => {
|
|
@@ -1181,11 +1182,11 @@ const deviceFileUpload = require_store.createAppAsyncThunk(`${require_devicesSli
|
|
|
1181
1182
|
})), cancelSource.signal)
|
|
1182
1183
|
]).then(() => Promise.resolve(dispatch(setSnackbar$2({
|
|
1183
1184
|
message: "Upload successful",
|
|
1184
|
-
autoHideDuration:
|
|
1185
|
+
autoHideDuration: _northern_tech_utils_constants.TIMEOUTS.fiveSeconds
|
|
1185
1186
|
})))).catch((err) => {
|
|
1186
1187
|
if ((0, axios.isCancel)(err)) return dispatch(setSnackbar$2({
|
|
1187
1188
|
message: "The upload has been cancelled",
|
|
1188
|
-
autoHideDuration:
|
|
1189
|
+
autoHideDuration: _northern_tech_utils_constants.TIMEOUTS.fiveSeconds
|
|
1189
1190
|
}));
|
|
1190
1191
|
return require_store.commonErrorHandler(err, `Error uploading file to device.`, dispatch);
|
|
1191
1192
|
}).finally(() => dispatch(cleanUpUpload(uploadId)));
|
|
@@ -1250,7 +1251,7 @@ const deleteAuthset = require_store.createAppAsyncThunk(`${require_devicesSlice_
|
|
|
1250
1251
|
})))).finally(() => dispatch(setDeviceListState({ refreshTrigger: !getState().devices.deviceList.refreshTrigger }))));
|
|
1251
1252
|
const preauthDevice = require_store.createAppAsyncThunk(`${require_devicesSlice_index.sliceName}/preauthDevice`, (authset, { dispatch, rejectWithValue }) => require_api_general_api.default.post(`${_northern_tech_utils_constants.deviceAuthV2}/devices`, authset).then(() => Promise.resolve(dispatch(setSnackbar$2({
|
|
1252
1253
|
message: "Device was successfully added to the preauthorization list",
|
|
1253
|
-
autoHideDuration:
|
|
1254
|
+
autoHideDuration: _northern_tech_utils_constants.TIMEOUTS.fiveSeconds
|
|
1254
1255
|
})))).catch((err) => {
|
|
1255
1256
|
if (err.response.status === 409) return rejectWithValue("A device with a matching identity data set already exists");
|
|
1256
1257
|
return require_store.commonErrorHandler(err, "The device could not be added:", dispatch);
|
|
@@ -1278,7 +1279,7 @@ const applyDeviceConfig = require_store.createAppAsyncThunk(`${require_devicesSl
|
|
|
1278
1279
|
})))];
|
|
1279
1280
|
require_utils.dispatchDelayed({
|
|
1280
1281
|
action: getSingleDeployment(data.deployment_id),
|
|
1281
|
-
delay:
|
|
1282
|
+
delay: _northern_tech_utils_constants.TIMEOUTS.oneSecond,
|
|
1282
1283
|
dispatch
|
|
1283
1284
|
});
|
|
1284
1285
|
if (isDefault && canManageUsers) {
|
|
@@ -1482,7 +1483,7 @@ const cancelRequest = require_store.createAppAsyncThunk(`${require_organizationS
|
|
|
1482
1483
|
const { id: tenantId } = require_organizationSlice_selectors.getOrganization(getState());
|
|
1483
1484
|
return require_api_general_api.default.post(`${_northern_tech_utils_constants.tenantadmApiUrlv2}/tenants/${tenantId}/cancel`, { reason }).then(() => Promise.resolve(dispatch(setSnackbar$1({
|
|
1484
1485
|
message: "Deactivation request was sent successfully",
|
|
1485
|
-
autoHideDuration:
|
|
1486
|
+
autoHideDuration: _northern_tech_utils_constants.TIMEOUTS.fiveSeconds
|
|
1486
1487
|
}))));
|
|
1487
1488
|
});
|
|
1488
1489
|
const getTierId = (tierName) => tierName.replace("mender_", "");
|
|
@@ -1574,11 +1575,11 @@ const createOrganizationTrial = require_store.createAppAsyncThunk(`${require_org
|
|
|
1574
1575
|
const { headers } = await require_api_general_api.default.postUnauthorized(target, trialPayload).catch((err) => {
|
|
1575
1576
|
if (err.response?.status >= 400 && err.response?.status < 500) dispatch(setSnackbar$1({
|
|
1576
1577
|
message: err.response.data.error,
|
|
1577
|
-
autoHideDuration:
|
|
1578
|
+
autoHideDuration: _northern_tech_utils_constants.TIMEOUTS.fiveSeconds
|
|
1578
1579
|
}));
|
|
1579
1580
|
else dispatch(setSnackbar$1({
|
|
1580
1581
|
message: "There was an error creating your account",
|
|
1581
|
-
autoHideDuration:
|
|
1582
|
+
autoHideDuration: _northern_tech_utils_constants.TIMEOUTS.fiveSeconds
|
|
1582
1583
|
}));
|
|
1583
1584
|
return Promise.reject(err);
|
|
1584
1585
|
});
|
|
@@ -1589,7 +1590,7 @@ const createOrganizationTrial = require_store.createAppAsyncThunk(`${require_org
|
|
|
1589
1590
|
return new Promise((resolve) => setTimeout(() => {
|
|
1590
1591
|
window.location.assign(`${targetLocation}${headers.location || ""}`);
|
|
1591
1592
|
return resolve();
|
|
1592
|
-
},
|
|
1593
|
+
}, _northern_tech_utils_constants.TIMEOUTS.fiveSeconds));
|
|
1593
1594
|
});
|
|
1594
1595
|
const startCardUpdate = require_store.createAppAsyncThunk(`${require_organizationSlice_index.sliceName}/startCardUpdate`, (_, { dispatch }) => require_api_general_api.default.post(`${_northern_tech_utils_constants.tenantadmApiUrlv2}/billing/card`).then(({ data }) => {
|
|
1595
1596
|
dispatch(require_organizationSlice_index.actions.receiveSetupIntent(data.intent_id));
|
|
@@ -1669,7 +1670,7 @@ const addTenant = require_store.createAppAsyncThunk(`${require_organizationSlice
|
|
|
1669
1670
|
dispatch(setSnackbar$1("Tenant was created successfully."));
|
|
1670
1671
|
require_utils.dispatchDelayed({
|
|
1671
1672
|
action: getTenants(),
|
|
1672
|
-
delay:
|
|
1673
|
+
delay: _northern_tech_utils_constants.TIMEOUTS.oneSecond,
|
|
1673
1674
|
dispatch
|
|
1674
1675
|
});
|
|
1675
1676
|
}).catch((err) => require_store.commonErrorHandler(err, "There was an error creating tenant", dispatch, require_store.commonErrorFallback));
|
|
@@ -1721,7 +1722,7 @@ const editTenant = require_store.createAppAsyncThunk(`${require_organizationSlic
|
|
|
1721
1722
|
dispatch(getUserOrganization());
|
|
1722
1723
|
require_utils.dispatchDelayed({
|
|
1723
1724
|
action: getTenants(),
|
|
1724
|
-
delay:
|
|
1725
|
+
delay: _northern_tech_utils_constants.TIMEOUTS.oneSecond,
|
|
1725
1726
|
dispatch
|
|
1726
1727
|
});
|
|
1727
1728
|
});
|
|
@@ -1733,7 +1734,7 @@ const removeTenant = require_store.createAppAsyncThunk(`${require_organizationSl
|
|
|
1733
1734
|
await dispatch(getUserOrganization()).unwrap();
|
|
1734
1735
|
require_utils.dispatchDelayed({
|
|
1735
1736
|
action: getTenants(),
|
|
1736
|
-
delay:
|
|
1737
|
+
delay: _northern_tech_utils_constants.TIMEOUTS.oneSecond,
|
|
1737
1738
|
dispatch
|
|
1738
1739
|
});
|
|
1739
1740
|
}));
|
|
@@ -1776,17 +1777,17 @@ const getCurrentSubscription = require_store.createAppAsyncThunk(`${require_orga
|
|
|
1776
1777
|
return require_store.commonErrorHandler(err, "There was an error retrieving your current subscription", dispatch, require_store.commonErrorFallback);
|
|
1777
1778
|
}));
|
|
1778
1779
|
const getProducts = require_store.createAppAsyncThunk(`${require_organizationSlice_index.sliceName}/getEnabledTiers`, (_, { dispatch }) => require_api_general_api.default.get(`${_northern_tech_utils_constants.tenantadmApiUrlv2}/billing/products`).catch((err) => require_store.commonErrorHandler(err, "There was an error getting Mender products:", dispatch, require_store.commonErrorFallback)).then((res) => dispatch(require_organizationSlice_index.actions.setProducts(transformProductResponse(res.data)))));
|
|
1779
|
-
const requestPlanUpgrade = require_store.createAppAsyncThunk(`${require_organizationSlice_index.sliceName}/requestPlanUpgrade`, (order, { dispatch }) => require_api_general_api.default.post(`${_northern_tech_utils_constants.tenantadmApiUrlv2}/billing/subscription`, order).catch((err) => require_store.commonErrorHandler(err, "There was an error sending your request", dispatch, require_store.commonErrorFallback)).then(() => Promise.all([new Promise((resolve) => setTimeout(resolve,
|
|
1780
|
+
const requestPlanUpgrade = require_store.createAppAsyncThunk(`${require_organizationSlice_index.sliceName}/requestPlanUpgrade`, (order, { dispatch }) => require_api_general_api.default.post(`${_northern_tech_utils_constants.tenantadmApiUrlv2}/billing/subscription`, order).catch((err) => require_store.commonErrorHandler(err, "There was an error sending your request", dispatch, require_store.commonErrorFallback)).then(() => Promise.all([new Promise((resolve) => setTimeout(resolve, _northern_tech_utils_constants.TIMEOUTS.threeSeconds)).then(() => dispatch(getDeviceLimits())), dispatch(getUserOrganization())])));
|
|
1780
1781
|
const sendSupportMessage = require_store.createAppAsyncThunk(`${require_organizationSlice_index.sliceName}/sendSupportMessage`, (content, { dispatch }) => require_api_general_api.default.post(`${_northern_tech_utils_constants.tenantadmApiUrlv2}/contact/support`, content).catch((err) => require_store.commonErrorHandler(err, "There was an error sending your request", dispatch, require_store.commonErrorFallback)).then(() => Promise.resolve(dispatch(setSnackbar$1({
|
|
1781
1782
|
message: "Your request was sent successfully",
|
|
1782
|
-
autoHideDuration:
|
|
1783
|
+
autoHideDuration: _northern_tech_utils_constants.TIMEOUTS.fiveSeconds
|
|
1783
1784
|
})))));
|
|
1784
1785
|
const requestPlanChange = require_store.createAppAsyncThunk(`${require_organizationSlice_index.sliceName}/requestPlanChange`, ({ content, tenantId }, { dispatch, rejectWithValue }) => require_api_general_api.default.post(`${_northern_tech_utils_constants.tenantadmApiUrlv2}/tenants/${tenantId}/plan`, content).catch(async (err) => {
|
|
1785
1786
|
await require_store.commonErrorHandler(err, "There was an error sending your request", dispatch, require_store.commonErrorFallback);
|
|
1786
1787
|
rejectWithValue(err);
|
|
1787
1788
|
}).then(() => Promise.resolve(dispatch(setSnackbar$1({
|
|
1788
1789
|
message: "Your request was sent successfully",
|
|
1789
|
-
autoHideDuration:
|
|
1790
|
+
autoHideDuration: _northern_tech_utils_constants.TIMEOUTS.fiveSeconds
|
|
1790
1791
|
})))));
|
|
1791
1792
|
const downloadLicenseReport = require_store.createAppAsyncThunk(`${require_organizationSlice_index.sliceName}/downloadLicenseReport`, (_, { dispatch }) => require_api_general_api.default.get(`${_northern_tech_utils_constants.deviceAuthV2}/license`).catch((err) => require_store.commonErrorHandler(err, "There was an error downloading the report", dispatch, require_store.commonErrorFallback)).then((res) => res.data));
|
|
1792
1793
|
const createIntegration = require_store.createAppAsyncThunk(`${require_organizationSlice_index.sliceName}/createIntegration`, ({ id, ...integration }, { dispatch }) => require_api_general_api.default.post(`${_northern_tech_utils_constants.iotManagerBaseURL}/integrations`, integration).catch((err) => require_store.commonErrorHandler(err, "There was an error creating the integration", dispatch, require_store.commonErrorFallback)).then(() => Promise.all([dispatch(setSnackbar$1("The integration was set up successfully")), dispatch(getIntegrations())])));
|
|
@@ -1810,23 +1811,15 @@ const getIntegrations = require_store.createAppAsyncThunk(`${require_organizatio
|
|
|
1810
1811
|
}, []);
|
|
1811
1812
|
return Promise.resolve(dispatch(require_organizationSlice_index.actions.receiveExternalDeviceIntegrations(integrations)));
|
|
1812
1813
|
}));
|
|
1813
|
-
const getWebhookEvents = require_store.createAppAsyncThunk(`${require_organizationSlice_index.sliceName}/getWebhookEvents`, (config = {}, { dispatch
|
|
1814
|
-
const { integrationId,
|
|
1814
|
+
const getWebhookEvents = require_store.createAppAsyncThunk(`${require_organizationSlice_index.sliceName}/getWebhookEvents`, async (config = {}, { dispatch }) => {
|
|
1815
|
+
const { integrationId, page = defaultPage, perPage = defaultPerPage } = config;
|
|
1815
1816
|
const integrationFilter = integrationId ? `&integration_id=${integrationId}` : "";
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
integrationId,
|
|
1823
|
-
isFollowUp: true,
|
|
1824
|
-
knownTotal: page * perPage,
|
|
1825
|
-
page: page + 1,
|
|
1826
|
-
perPage: 1
|
|
1827
|
-
})));
|
|
1828
|
-
return Promise.all(tasks);
|
|
1829
|
-
});
|
|
1817
|
+
const { data, headers } = await require_api_general_api.default.get(`${_northern_tech_utils_constants.iotManagerBaseURL}/events?page=${page}&per_page=${perPage}${integrationFilter}`).catch((err) => require_store.commonErrorHandler(err, "There was an error retrieving activity for this integration", dispatch, require_store.commonErrorFallback));
|
|
1818
|
+
const total = Number(headers[_northern_tech_utils_constants.headerNames.total] || data.length);
|
|
1819
|
+
return dispatch(require_organizationSlice_index.actions.receiveWebhookEvents({
|
|
1820
|
+
value: data,
|
|
1821
|
+
total
|
|
1822
|
+
}));
|
|
1830
1823
|
});
|
|
1831
1824
|
const ssoConfigActions = {
|
|
1832
1825
|
create: {
|
|
@@ -1850,16 +1843,19 @@ const ssoConfigActions = {
|
|
|
1850
1843
|
error: "retrieving"
|
|
1851
1844
|
}
|
|
1852
1845
|
};
|
|
1853
|
-
const ssoConfigActionErrorHandler = (err, type) => (dispatch) =>
|
|
1846
|
+
const ssoConfigActionErrorHandler = (err, type, rejectWithValue) => (dispatch) => {
|
|
1847
|
+
const errorContext = `There was an error ${ssoConfigActions[type].error} the SSO configuration.`;
|
|
1848
|
+
return rejectWithValue ? Promise.reject(rejectWithValue(`${errorContext} ${require_utils.extractErrorMessage(err, require_store.commonErrorFallback)}`)) : require_store.commonErrorHandler(err, errorContext, dispatch, require_store.commonErrorFallback);
|
|
1849
|
+
};
|
|
1854
1850
|
const ssoConfigActionSuccessHandler = (type) => (dispatch) => dispatch(setSnackbar$1(`The SSO configuration was ${ssoConfigActions[type].success} successfully`));
|
|
1855
|
-
const storeSsoConfig = require_store.createAppAsyncThunk(`${require_organizationSlice_index.sliceName}/storeSsoConfig`, ({ config, contentType }, { dispatch }) => require_api_general_api.default.post(_northern_tech_utils_constants.ssoIdpApiUrlv1, config, { headers: {
|
|
1851
|
+
const storeSsoConfig = require_store.createAppAsyncThunk(`${require_organizationSlice_index.sliceName}/storeSsoConfig`, ({ config, contentType }, { dispatch, rejectWithValue }) => require_api_general_api.default.post(_northern_tech_utils_constants.ssoIdpApiUrlv1, config, { headers: {
|
|
1856
1852
|
"Content-Type": contentType,
|
|
1857
1853
|
Accept: "application/json"
|
|
1858
|
-
} }).catch((err) => dispatch(ssoConfigActionErrorHandler(err, "create"))).then(() => Promise.all([dispatch(ssoConfigActionSuccessHandler("create")), dispatch(getSsoConfigs())])));
|
|
1859
|
-
const changeSsoConfig = require_store.createAppAsyncThunk(`${require_organizationSlice_index.sliceName}/changeSsoConfig`, ({ config, contentType }, { dispatch }) => require_api_general_api.default.put(`${_northern_tech_utils_constants.ssoIdpApiUrlv1}/${config.id}`, config.config, { headers: {
|
|
1854
|
+
} }).catch((err) => dispatch(ssoConfigActionErrorHandler(err, "create", rejectWithValue))).then(() => Promise.all([dispatch(ssoConfigActionSuccessHandler("create")), dispatch(getSsoConfigs())])));
|
|
1855
|
+
const changeSsoConfig = require_store.createAppAsyncThunk(`${require_organizationSlice_index.sliceName}/changeSsoConfig`, ({ config, contentType }, { dispatch, rejectWithValue }) => require_api_general_api.default.put(`${_northern_tech_utils_constants.ssoIdpApiUrlv1}/${config.id}`, config.config, { headers: {
|
|
1860
1856
|
"Content-Type": contentType,
|
|
1861
1857
|
Accept: "application/json"
|
|
1862
|
-
} }).catch((err) => dispatch(ssoConfigActionErrorHandler(err, "edit"))).then(() => Promise.all([dispatch(ssoConfigActionSuccessHandler("edit")), dispatch(getSsoConfigs())])));
|
|
1858
|
+
} }).catch((err) => dispatch(ssoConfigActionErrorHandler(err, "edit", rejectWithValue))).then(() => Promise.all([dispatch(ssoConfigActionSuccessHandler("edit")), dispatch(getSsoConfigs())])));
|
|
1863
1859
|
const deleteSsoConfig = require_store.createAppAsyncThunk(`${require_organizationSlice_index.sliceName}/deleteSsoConfig`, ({ id }, { dispatch, getState }) => require_api_general_api.default.delete(`${_northern_tech_utils_constants.ssoIdpApiUrlv1}/${id}`).catch((err) => dispatch(ssoConfigActionErrorHandler(err, "remove"))).then(() => {
|
|
1864
1860
|
const configs = getState().organization.ssoConfigs.filter((item) => id !== item.id);
|
|
1865
1861
|
return Promise.all([dispatch(ssoConfigActionSuccessHandler("remove")), dispatch(require_organizationSlice_index.actions.receiveSsoConfigs(configs))]);
|