@northern.tech/store 0.41.3 → 0.43.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 +10 -11
- package/dist/actions.d.ts +10 -11
- package/dist/api/general-api.cjs +1 -1
- package/dist/api/general-api.cjs.map +1 -1
- package/dist/api/general-api.d.cts +0 -1
- package/dist/api/general-api.d.ts +0 -1
- package/dist/api/general-api.js +1 -1
- package/dist/api/users-api.cjs +1 -1
- package/dist/api/users-api.d.cts +1 -6
- package/dist/api/users-api.d.ts +1 -6
- package/dist/appSlice/constants.cjs +0 -5
- 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 +0 -5
- package/dist/appSlice/constants.js.map +1 -1
- package/dist/appSlice/index.cjs.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 -2
- package/dist/appSlice/mocks.d.ts +1 -2
- package/dist/appSlice/selectors.cjs.map +1 -1
- package/dist/appSlice/selectors.d.cts +9 -10
- package/dist/appSlice/selectors.d.ts +9 -10
- package/dist/appSlice/thunks.d.cts +2 -3
- package/dist/appSlice/thunks.d.ts +2 -3
- package/dist/auth.cjs +1 -1
- package/dist/auth.d.cts +3 -10
- package/dist/auth.d.ts +3 -10
- package/dist/auth.js +1 -1
- package/dist/commonConstants.d.cts +1 -1
- package/dist/commonConstants.d.ts +1 -1
- package/dist/commonConstants.js +1 -1
- package/dist/commonSelectors.cjs +4 -3
- package/dist/commonSelectors.cjs.map +1 -1
- package/dist/commonSelectors.d.cts +20 -21
- package/dist/commonSelectors.d.ts +20 -21
- package/dist/commonSelectors.js +4 -3
- package/dist/commonSelectors.js.map +1 -1
- package/dist/{constants-Sn4gnNA3.d.ts → constants-B3Jdkn2b.d.cts} +2 -5
- package/dist/{constants-Sn4gnNA3.d.cts → constants-B3Jdkn2b.d.ts} +2 -5
- package/dist/{constants-CzjK2gV-.d.ts → constants-B_H4squx.d.ts} +4 -4
- package/dist/{constants-D9o0Cnk_.d.ts → constants-C6TIYaY4.d.cts} +1 -2
- package/dist/{constants-D9o0Cnk_.d.cts → constants-C6TIYaY4.d.ts} +1 -2
- package/dist/{constants-6kYRTdox.d.ts → constants-CEwun8TL.d.cts} +3 -2
- package/dist/{constants-6kYRTdox.d.cts → constants-CEwun8TL.d.ts} +3 -2
- package/dist/constants-C_SC_VKE.cjs.map +1 -1
- package/dist/{constants-xpheFFkA.js → constants-CerzXHnQ.js} +3 -3
- package/dist/{constants-xpheFFkA.js.map → constants-CerzXHnQ.js.map} +1 -1
- package/dist/{constants-DAi2zOZN.d.cts → constants-Rl3FJzFf.d.cts} +4 -4
- package/dist/{constants-B_7FCJQX.d.ts → constants-nKSWZ8oD.d.cts} +3 -8
- package/dist/{constants-B_7FCJQX.d.cts → constants-nKSWZ8oD.d.ts} +3 -8
- package/dist/constants.cjs +2 -0
- package/dist/constants.d.cts +6 -6
- package/dist/constants.d.ts +6 -6
- package/dist/constants.js +3 -3
- package/dist/deploymentsSlice/constants.d.cts +1 -1
- package/dist/deploymentsSlice/constants.d.ts +1 -1
- package/dist/deploymentsSlice/constants.js +1 -1
- package/dist/deploymentsSlice/index.cjs.map +1 -1
- package/dist/deploymentsSlice/index.d.cts +1 -1
- package/dist/deploymentsSlice/index.d.ts +1 -1
- package/dist/deploymentsSlice/index.js +1 -1
- package/dist/deploymentsSlice/mocks.d.cts +1 -2
- package/dist/deploymentsSlice/mocks.d.ts +1 -2
- package/dist/deploymentsSlice/selectors.cjs.map +1 -1
- package/dist/deploymentsSlice/selectors.d.cts +9 -10
- package/dist/deploymentsSlice/selectors.d.ts +9 -10
- package/dist/deploymentsSlice/selectors.js +1 -1
- package/dist/deploymentsSlice/thunks.d.cts +7 -13
- package/dist/deploymentsSlice/thunks.d.ts +7 -13
- 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.cjs +5 -2
- package/dist/devicesSlice/index.cjs.map +1 -1
- package/dist/devicesSlice/index.d.cts +2 -2
- package/dist/devicesSlice/index.d.ts +2 -2
- package/dist/devicesSlice/index.js +6 -3
- package/dist/devicesSlice/index.js.map +1 -1
- package/dist/devicesSlice/mocks.d.cts +1 -0
- package/dist/devicesSlice/mocks.d.ts +1 -0
- package/dist/devicesSlice/mocks.js +1 -1
- package/dist/devicesSlice/selectors.cjs +2 -0
- package/dist/devicesSlice/selectors.cjs.map +1 -1
- package/dist/devicesSlice/selectors.d.cts +41 -41
- package/dist/devicesSlice/selectors.d.ts +41 -41
- package/dist/devicesSlice/selectors.js +3 -2
- package/dist/devicesSlice/selectors.js.map +1 -1
- package/dist/devicesSlice/thunks.cjs +1 -2
- package/dist/devicesSlice/thunks.d.cts +13 -25
- package/dist/devicesSlice/thunks.d.ts +13 -25
- package/dist/devicesSlice/thunks.js +2 -2
- package/dist/{index-Bb4yvvgG.d.ts → index-B8td4-rY.d.ts} +1 -2
- package/dist/{index-C5oQrJGU.d.ts → index-BAGyeC-q.d.ts} +2 -3
- package/dist/{index-CgPgKMve.d.cts → index-BgF6rhXn.d.cts} +3 -4
- package/dist/{index-BtGhTFBc.d.ts → index-BpamudGf.d.ts} +15 -17
- package/dist/{index-CnH51JfB.d.ts → index-Bs0c1-WY.d.ts} +4 -9
- package/dist/{index-m1c0qk2s.d.ts → index-C8uiyxnb.d.ts} +2 -3
- package/dist/{index-CSOj22xK.d.cts → index-C_LGDJN2.d.cts} +2 -3
- package/dist/{index-H9zg_3UV.d.ts → index-ChKTa1aL.d.ts} +2 -3
- package/dist/{index-DBUt8xVc.d.ts → index-CoObjWL4.d.cts} +1 -2
- package/dist/{index-DBUt8xVc.d.cts → index-CoObjWL4.d.ts} +1 -2
- package/dist/{index-BCErsO5h.d.ts → index-CpfhQHfg.d.ts} +3 -4
- package/dist/{index-BQCnJ5gh.d.cts → index-Ctj2r57a.d.cts} +2 -3
- package/dist/{index-Dn1SqQYh.d.cts → index-DeOpb2oK.d.cts} +4 -9
- package/dist/{index-VEayiYkv.d.cts → index-DiAjzARZ.d.cts} +2 -3
- package/dist/{index-vXsWdis1.d.cts → index-DnKVKM0G.d.cts} +15 -17
- package/dist/{index-EPmsL6Lb.d.cts → index-mvxjivTJ.d.cts} +1 -2
- package/dist/liststatehook.cjs.map +1 -1
- package/dist/liststatehook.d.cts +0 -1
- package/dist/liststatehook.d.ts +0 -1
- package/dist/locationutils.cjs.map +1 -1
- package/dist/locationutils.d.cts +14 -67
- package/dist/locationutils.d.ts +14 -67
- package/dist/locationutils.js +1 -1
- package/dist/monitorSlice/constants.d.cts +1 -1
- package/dist/monitorSlice/constants.d.ts +1 -1
- package/dist/monitorSlice/index.cjs.map +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 -2
- package/dist/monitorSlice/mocks.d.ts +1 -2
- package/dist/monitorSlice/mocks.js +1 -1
- package/dist/monitorSlice/selectors.d.cts +1 -2
- package/dist/monitorSlice/selectors.d.ts +1 -2
- package/dist/monitorSlice/thunks.d.cts +4 -5
- package/dist/monitorSlice/thunks.d.ts +4 -5
- package/dist/monitorSlice/thunks.js +1 -1
- package/dist/onboardingSlice/index.cjs.map +1 -1
- package/dist/onboardingSlice/index.d.cts +1 -1
- package/dist/onboardingSlice/index.d.ts +1 -1
- package/dist/onboardingSlice/mocks.d.cts +1 -2
- package/dist/onboardingSlice/mocks.d.ts +1 -2
- package/dist/onboardingSlice/selectors.d.cts +2 -3
- package/dist/onboardingSlice/selectors.d.ts +2 -3
- package/dist/onboardingSlice/thunks.d.cts +4 -4
- package/dist/onboardingSlice/thunks.d.ts +4 -4
- package/dist/organizationSlice/constants.js +1 -1
- package/dist/organizationSlice/index.cjs.map +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.map +1 -1
- package/dist/organizationSlice/selectors.d.cts +11 -16
- package/dist/organizationSlice/selectors.d.ts +11 -16
- package/dist/organizationSlice/selectors.js +1 -1
- package/dist/organizationSlice/thunks.d.cts +6 -7
- package/dist/organizationSlice/thunks.d.ts +6 -7
- package/dist/organizationSlice/types.d.cts +1 -1
- package/dist/organizationSlice/types.d.ts +1 -1
- package/dist/releasesSlice/constants.cjs +2 -0
- 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 +2 -1
- package/dist/releasesSlice/constants.js.map +1 -1
- package/dist/releasesSlice/index.cjs.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 +9 -10
- package/dist/releasesSlice/selectors.d.ts +9 -10
- package/dist/releasesSlice/thunks.cjs +1 -1
- package/dist/releasesSlice/thunks.cjs.map +1 -1
- package/dist/releasesSlice/thunks.d.cts +4 -5
- package/dist/releasesSlice/thunks.d.ts +4 -5
- package/dist/releasesSlice/thunks.js +1 -1
- package/dist/{rolldown-runtime-D6vf50IK.cjs → rolldown-runtime-VH7oDXx4.cjs} +1 -1
- package/dist/selectors.cjs +1 -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 +1 -2
- package/dist/sockethook.cjs.map +1 -1
- package/dist/sockethook.d.cts +1 -8
- package/dist/sockethook.d.ts +1 -8
- package/dist/sockethook.js +1 -2
- package/dist/sockethook.js.map +1 -1
- package/dist/{store-CkgokFlk.d.ts → store-B2_hrsgP.d.ts} +27 -48
- package/dist/{store-CGP5pCH8.d.cts → store-DquBGT7j.d.cts} +27 -48
- 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 +1 -1
- package/dist/storehooks.cjs +31 -20
- package/dist/storehooks.cjs.map +1 -1
- package/dist/storehooks.d.cts +13 -4
- package/dist/storehooks.d.ts +13 -4
- package/dist/storehooks.js +32 -22
- package/dist/storehooks.js.map +1 -1
- package/dist/thunks.cjs +16 -107
- 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 +16 -106
- package/dist/thunks.js.map +1 -1
- package/dist/{types-uHmaedGU.d.ts → types-B3qGQoMx.d.ts} +3 -4
- package/dist/{types-yQ0ypHMZ.d.cts → types-B80ckxiy.d.cts} +3 -4
- package/dist/useDeploymentDevice.cjs +1 -1
- package/dist/useDeploymentDevice.cjs.map +1 -1
- package/dist/usersSlice/constants.d.cts +1 -1
- package/dist/usersSlice/constants.d.ts +1 -1
- package/dist/usersSlice/constants.js +1 -1
- package/dist/usersSlice/index.cjs.map +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 +2 -3
- package/dist/usersSlice/mocks.d.ts +2 -3
- package/dist/usersSlice/mocks.js +1 -1
- package/dist/usersSlice/selectors.cjs.map +1 -1
- package/dist/usersSlice/selectors.d.cts +10 -11
- package/dist/usersSlice/selectors.d.ts +10 -11
- package/dist/usersSlice/selectors.js +1 -1
- package/dist/usersSlice/thunks.d.cts +5 -6
- package/dist/usersSlice/thunks.d.ts +5 -6
- package/dist/utils.cjs +2 -2
- 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 +3 -3
- package/dist/utils.js.map +1 -1
- package/package.json +9 -9
package/dist/thunks.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_rolldown_runtime = require("./rolldown-runtime-
|
|
2
|
+
const require_rolldown_runtime = require("./rolldown-runtime-VH7oDXx4.cjs");
|
|
3
3
|
const require_appSlice_constants = require("./appSlice/constants.cjs");
|
|
4
4
|
const require_constants = require("./constants-C_SC_VKE.cjs");
|
|
5
5
|
const require_onboardingSlice_constants = require("./onboardingSlice/constants.cjs");
|
|
@@ -201,7 +201,6 @@ const cleanPhases = (phases) => phases?.map(({ batch_size, batch_size_devices, s
|
|
|
201
201
|
batch_size_devices,
|
|
202
202
|
start_ts
|
|
203
203
|
}));
|
|
204
|
-
const MAX_PREVIOUS_PHASES_COUNT = 5;
|
|
205
204
|
const createDeployment = require_store.createAppAsyncThunk(`${require_deploymentsSlice_index.sliceName}/createDeployment`, ({ newDeployment }, { dispatch, getState }) => {
|
|
206
205
|
let request;
|
|
207
206
|
const { name, artifact_name, retries, update_control_map, autogenerate_delta } = newDeployment;
|
|
@@ -270,7 +269,7 @@ const createDeployment = require_store.createAppAsyncThunk(`${require_deployment
|
|
|
270
269
|
const standardPhases = (0, _northern_tech_utils_helpers.standardizePhases)(uniform_phases ? [uniform_phases] : phases);
|
|
271
270
|
const prevPhases = previousPhases.map(_northern_tech_utils_helpers.standardizePhases);
|
|
272
271
|
if (!prevPhases.find((previousPhaseList) => previousPhaseList.every((oldPhase) => standardPhases.find((phase) => (0, _northern_tech_utils_helpers.deepCompare)(phase, oldPhase))))) prevPhases.push(standardPhases);
|
|
273
|
-
newSettings.previousPhases = prevPhases.slice(-
|
|
272
|
+
newSettings.previousPhases = prevPhases.slice(-5);
|
|
274
273
|
}
|
|
275
274
|
tasks.push(dispatch(saveGlobalSettings(newSettings)));
|
|
276
275
|
}
|
|
@@ -495,14 +494,6 @@ const defaultAttributes = [
|
|
|
495
494
|
scope: "inventory",
|
|
496
495
|
attribute: "device_type"
|
|
497
496
|
},
|
|
498
|
-
{
|
|
499
|
-
scope: "inventory",
|
|
500
|
-
attribute: "mender_is_gateway"
|
|
501
|
-
},
|
|
502
|
-
{
|
|
503
|
-
scope: "inventory",
|
|
504
|
-
attribute: "mender_gateway_system_id"
|
|
505
|
-
},
|
|
506
497
|
{
|
|
507
498
|
scope: "inventory",
|
|
508
499
|
attribute: require_releasesSlice_constants.rootfsImageVersion
|
|
@@ -602,7 +593,8 @@ const addStaticGroup = require_store.createAppAsyncThunk(`${require_devicesSlice
|
|
|
602
593
|
})).catch((err) => require_store.commonErrorHandler(err, `Group could not be updated:`, dispatch)));
|
|
603
594
|
const removeReportsByGroupName = require_store.createAppAsyncThunk(`${require_devicesSlice_index.sliceName}/removeReportsByGroupName`, (groupName, { dispatch, getState }) => {
|
|
604
595
|
if (!groupName) return Promise.resolve();
|
|
605
|
-
|
|
596
|
+
const filteredReports = require_commonSelectors.getDeviceReportsForUser(getState()).filter((report) => report.group !== groupName);
|
|
597
|
+
dispatch(saveUserSettings({ reports: filteredReports }));
|
|
606
598
|
});
|
|
607
599
|
const removeStaticGroup = require_store.createAppAsyncThunk(`${require_devicesSlice_index.sliceName}/removeStaticGroup`, (groupName, { dispatch }) => require_api_general_api.default.delete(`${_northern_tech_utils_constants.inventoryApiUrl}/groups/${groupName}`).then(() => Promise.all([
|
|
608
600
|
dispatch(require_devicesSlice_index.actions.removeGroup(groupName)),
|
|
@@ -1200,7 +1192,8 @@ const getSnackbarMessage = (skipped, done, failed = 0) => {
|
|
|
1200
1192
|
return `${done ? `${done} ${(0, pluralize.default)("device", done)} ${(0, pluralize.default)("was", done)} updated successfully. ` : ""}${skipText}${failedText}`;
|
|
1201
1193
|
};
|
|
1202
1194
|
const updateDeviceAuth = require_store.createAppAsyncThunk(`${require_devicesSlice_index.sliceName}/updateDeviceAuth`, ({ deviceId, authId, status }, { dispatch, getState }) => require_api_general_api.default.put(`${_northern_tech_utils_constants.deviceAuthV2}/devices/${deviceId}/auth/${authId}/status`, { status }).then(() => Promise.all([dispatch(getDeviceAuth(deviceId)), dispatch(setSnackbar$2("Device authorization status was updated successfully"))])).catch((err) => {
|
|
1203
|
-
|
|
1195
|
+
const errorContext = err.response?.status === 422 ? "Device limit reached: You have reached your limit of accepted devices." : "There was a problem updating the device authorization status:";
|
|
1196
|
+
return require_store.commonErrorHandler(err, errorContext, dispatch);
|
|
1204
1197
|
}).then(() => Promise.resolve(dispatch(require_devicesSlice_index.actions.maybeUpdateDevicesByStatus({
|
|
1205
1198
|
deviceId,
|
|
1206
1199
|
authId
|
|
@@ -1360,93 +1353,10 @@ const prepareSearchArguments = ({ filters, group, state, status }) => {
|
|
|
1360
1353
|
filterTerms
|
|
1361
1354
|
};
|
|
1362
1355
|
};
|
|
1363
|
-
const
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
if (!hasFullFiltering) return Promise.resolve();
|
|
1368
|
-
const { attributes: deviceAttributes = {} } = require_devicesSlice_selectors.getDeviceById(state, id);
|
|
1369
|
-
const { mender_gateway_system_id = "" } = deviceAttributes;
|
|
1370
|
-
const filters = [{
|
|
1371
|
-
...require_constants.emptyFilter,
|
|
1372
|
-
key: "mender_is_gateway",
|
|
1373
|
-
operator: _northern_tech_utils_constants.DEVICE_FILTERING_OPTIONS.$ne.key,
|
|
1374
|
-
value: "true",
|
|
1375
|
-
scope: "inventory"
|
|
1376
|
-
}, {
|
|
1377
|
-
...require_constants.emptyFilter,
|
|
1378
|
-
key: "mender_gateway_system_id",
|
|
1379
|
-
value: mender_gateway_system_id,
|
|
1380
|
-
scope: "inventory"
|
|
1381
|
-
}];
|
|
1382
|
-
const { attributes, filterTerms } = prepareSearchArguments({
|
|
1383
|
-
filters,
|
|
1384
|
-
state
|
|
1385
|
-
});
|
|
1386
|
-
return require_api_general_api.default.post(`${_northern_tech_utils_constants.inventoryApiUrlV2}/filters/search`, {
|
|
1387
|
-
page,
|
|
1388
|
-
per_page: perPage,
|
|
1389
|
-
filters: filterTerms,
|
|
1390
|
-
sort: sortOptions,
|
|
1391
|
-
attributes
|
|
1392
|
-
}).catch((err) => require_store.commonErrorHandler(err, `There was an error getting system devices device ${id}.`, dispatch, "Please check your connection.")).then(({ data, headers }) => {
|
|
1393
|
-
const state = getState();
|
|
1394
|
-
const { devicesById, ids } = reduceReceivedDevices(data, [], state);
|
|
1395
|
-
const device = {
|
|
1396
|
-
...require_devicesSlice_selectors.getDeviceById(state, id),
|
|
1397
|
-
systemDeviceIds: ids,
|
|
1398
|
-
systemDeviceTotal: Number(headers[_northern_tech_utils_constants.headerNames.total])
|
|
1399
|
-
};
|
|
1400
|
-
return Promise.resolve(dispatch(require_devicesSlice_index.actions.receivedDevices({
|
|
1401
|
-
...devicesById,
|
|
1402
|
-
[id]: device
|
|
1403
|
-
})));
|
|
1404
|
-
});
|
|
1405
|
-
});
|
|
1406
|
-
const getGatewayDevices = require_store.createAppAsyncThunk(`${require_devicesSlice_index.sliceName}/getGatewayDevices`, (deviceId, { dispatch, getState }) => {
|
|
1407
|
-
const state = getState();
|
|
1408
|
-
const { attributes = {} } = require_devicesSlice_selectors.getDeviceById(state, deviceId);
|
|
1409
|
-
const { mender_gateway_system_id = "" } = attributes;
|
|
1410
|
-
const filters = [
|
|
1411
|
-
{
|
|
1412
|
-
...require_constants.emptyFilter,
|
|
1413
|
-
key: "id",
|
|
1414
|
-
operator: _northern_tech_utils_constants.DEVICE_FILTERING_OPTIONS.$ne.key,
|
|
1415
|
-
value: deviceId,
|
|
1416
|
-
scope: "identity"
|
|
1417
|
-
},
|
|
1418
|
-
{
|
|
1419
|
-
...require_constants.emptyFilter,
|
|
1420
|
-
key: "mender_is_gateway",
|
|
1421
|
-
value: "true",
|
|
1422
|
-
scope: "inventory"
|
|
1423
|
-
},
|
|
1424
|
-
{
|
|
1425
|
-
...require_constants.emptyFilter,
|
|
1426
|
-
key: "mender_gateway_system_id",
|
|
1427
|
-
value: mender_gateway_system_id,
|
|
1428
|
-
scope: "inventory"
|
|
1429
|
-
}
|
|
1430
|
-
];
|
|
1431
|
-
const { attributes: attributeSelection, filterTerms } = prepareSearchArguments({
|
|
1432
|
-
filters,
|
|
1433
|
-
state
|
|
1434
|
-
});
|
|
1435
|
-
return require_api_general_api.default.post(`${_northern_tech_utils_constants.inventoryApiUrlV2}/filters/search`, {
|
|
1436
|
-
page: 1,
|
|
1437
|
-
per_page: 500,
|
|
1438
|
-
filters: filterTerms,
|
|
1439
|
-
attributes: attributeSelection
|
|
1440
|
-
}).then(({ data }) => {
|
|
1441
|
-
const { ids } = reduceReceivedDevices(data, [], getState());
|
|
1442
|
-
const tasks = ids.map((deviceId) => dispatch(getDeviceInfo(deviceId)));
|
|
1443
|
-
tasks.push(Promise.resolve(dispatch(require_devicesSlice_index.actions.receivedDevice({
|
|
1444
|
-
id: deviceId,
|
|
1445
|
-
gatewayIds: ids
|
|
1446
|
-
}))));
|
|
1447
|
-
return Promise.all(tasks);
|
|
1448
|
-
});
|
|
1449
|
-
});
|
|
1356
|
+
const getDeviceComponents = require_store.createAppAsyncThunk(`${require_devicesSlice_index.sliceName}/getDeviceComponents`, (deviceId, { dispatch }) => require_api_general_api.default.get(`${_northern_tech_utils_constants.inventoryApiUrlV2alpha1}/devices/${deviceId}/components`).then(({ data }) => dispatch(require_devicesSlice_index.actions.receivedDevice({
|
|
1357
|
+
id: deviceId,
|
|
1358
|
+
components: data
|
|
1359
|
+
}))).catch((err) => require_store.commonErrorHandler(err, `There was an error retrieving components for device ${deviceId}.`, dispatch, require_store.commonErrorFallback)));
|
|
1450
1360
|
//#endregion
|
|
1451
1361
|
//#region src/onboardingSlice/thunks.ts
|
|
1452
1362
|
const cookies$2 = new universal_cookie.default();
|
|
@@ -1785,7 +1695,8 @@ const setTenantsListState = require_store.createAppAsyncThunk(`${require_organiz
|
|
|
1785
1695
|
return dispatch(require_organizationSlice_index.actions.setTenantListState({ ...nextState }));
|
|
1786
1696
|
});
|
|
1787
1697
|
const editTenant = require_store.createAppAsyncThunk(`${require_organizationSlice_index.sliceName}/editDeviceLimit`, ({ deviceLimits, id, name }, { dispatch, getState }) => {
|
|
1788
|
-
const
|
|
1698
|
+
const spLimits = require_organizationSlice_selectors.getSpLimits(getState());
|
|
1699
|
+
const device_limits = require_utils.convertToBackendSPLimits(deviceLimits, spLimits);
|
|
1789
1700
|
return require_api_general_api.default.put(`${_northern_tech_utils_constants.tenantadmApiUrlv2}/tenants/${id}/child`, {
|
|
1790
1701
|
device_limits,
|
|
1791
1702
|
name
|
|
@@ -1994,7 +1905,8 @@ const loginUser = require_store.createAppAsyncThunk(`${require_usersSlice_index.
|
|
|
1994
1905
|
}).then(({ text: token, contentType }) => {
|
|
1995
1906
|
if (contentType?.includes(_northern_tech_utils_constants.APPLICATION_JSON_CONTENT_TYPE)) {
|
|
1996
1907
|
const { id, kind } = token;
|
|
1997
|
-
const
|
|
1908
|
+
const type = kind.split("/")[1];
|
|
1909
|
+
const ssoLoginUrl = require_constants.SSO_TYPES[type].getStartUrl(id);
|
|
1998
1910
|
window.location.replace(ssoLoginUrl);
|
|
1999
1911
|
return;
|
|
2000
1912
|
}
|
|
@@ -2030,9 +1942,7 @@ const passwordResetComplete = require_store.createAppAsyncThunk(`${require_users
|
|
|
2030
1942
|
password: newPassword
|
|
2031
1943
|
}).catch((err = {}) => {
|
|
2032
1944
|
const { error, response = {} } = err;
|
|
2033
|
-
|
|
2034
|
-
if (response.status == 400) errorMsg = "the link you are using expired or the request is not valid, please try again.";
|
|
2035
|
-
else errorMsg = error;
|
|
1945
|
+
const errorMsg = response.status == 400 ? "the link you are using expired or the request is not valid, please try again." : error;
|
|
2036
1946
|
dispatch(setSnackbar("The password reset request cannot be processed: " + errorMsg));
|
|
2037
1947
|
return Promise.reject(err);
|
|
2038
1948
|
}));
|
|
@@ -2589,6 +2499,7 @@ exports.getDeviceAlerts = require_monitorSlice_thunks.getDeviceAlerts;
|
|
|
2589
2499
|
exports.getDeviceAttributes = getDeviceAttributes;
|
|
2590
2500
|
exports.getDeviceAuth = getDeviceAuth;
|
|
2591
2501
|
exports.getDeviceById = getDeviceById;
|
|
2502
|
+
exports.getDeviceComponents = getDeviceComponents;
|
|
2592
2503
|
exports.getDeviceConfig = getDeviceConfig;
|
|
2593
2504
|
exports.getDeviceConnect = getDeviceConnect;
|
|
2594
2505
|
exports.getDeviceDeployments = getDeviceDeployments;
|
|
@@ -2605,7 +2516,6 @@ exports.getDynamicGroups = getDynamicGroups;
|
|
|
2605
2516
|
exports.getExistingManifestTags = require_releasesSlice_thunks.getExistingManifestTags;
|
|
2606
2517
|
exports.getExistingReleaseTags = require_releasesSlice_thunks.getExistingReleaseTags;
|
|
2607
2518
|
exports.getExistingSoftwareTags = require_releasesSlice_thunks.getExistingSoftwareTags;
|
|
2608
|
-
exports.getGatewayDevices = getGatewayDevices;
|
|
2609
2519
|
exports.getGlobalSettings = getGlobalSettings;
|
|
2610
2520
|
exports.getGroupDevices = getGroupDevices;
|
|
2611
2521
|
exports.getGroups = getGroups;
|
|
@@ -2628,7 +2538,6 @@ exports.getSoftware = require_releasesSlice_thunks.getSoftware;
|
|
|
2628
2538
|
exports.getSoftwareList = require_releasesSlice_thunks.getSoftwareList;
|
|
2629
2539
|
exports.getSsoConfigById = getSsoConfigById;
|
|
2630
2540
|
exports.getSsoConfigs = getSsoConfigs;
|
|
2631
|
-
exports.getSystemDevices = getSystemDevices;
|
|
2632
2541
|
exports.getTargetLocation = getTargetLocation;
|
|
2633
2542
|
exports.getTenants = getTenants;
|
|
2634
2543
|
exports.getTestDeviceCount = getTestDeviceCount;
|