@northern.tech/store 0.9.0 → 0.11.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.cjs +7 -3
- package/dist/actions.cjs.map +1 -1
- package/dist/actions.d.cts +1 -1
- package/dist/actions.d.ts +1 -1
- package/dist/actions.js +6 -6
- package/dist/api/general-api.js +1 -1
- package/dist/api/users-api.js +1 -1
- package/dist/appSlice/index.js +1 -1
- package/dist/appSlice/mocks.js +1 -1
- package/dist/appSlice/thunks.cjs +17 -8
- package/dist/appSlice/thunks.cjs.map +1 -1
- package/dist/appSlice/thunks.js +15 -15
- package/dist/auth.js +1 -1
- package/dist/{chunk-ITGVP27I.js → chunk-4FNSLYK5.js} +11 -11
- package/dist/{chunk-MUZHPRLI.js → chunk-6KNRR7A5.js} +4 -4
- package/dist/{chunk-ZOF45MII.js → chunk-CUU3N6KW.js} +13 -13
- package/dist/{chunk-ZRSVD5QY.js → chunk-I3H5EFZK.js} +15 -15
- package/dist/{chunk-UVYRVFZX.js → chunk-MH5WPYQI.js} +11 -5
- package/dist/chunk-MH5WPYQI.js.map +1 -0
- package/dist/{chunk-VWNMAIL2.js → chunk-NVNO3I3K.js} +37 -28
- package/dist/chunk-NVNO3I3K.js.map +1 -0
- package/dist/{chunk-KQ6AGXRK.js → chunk-REZWSU22.js} +8 -4
- package/dist/chunk-REZWSU22.js.map +1 -0
- package/dist/{chunk-CKF76YO4.js → chunk-RFF52JYU.js} +1 -1
- package/dist/chunk-RFF52JYU.js.map +1 -0
- package/dist/{chunk-N3TU2WH2.js → chunk-X3NF4KNC.js} +5 -5
- package/dist/{chunk-VANBSJS5.js → chunk-ZNAJKEP2.js} +1 -1
- package/dist/chunk-ZNAJKEP2.js.map +1 -0
- package/dist/commonConstants.js +1 -1
- package/dist/commonSelectors.cjs +8 -3
- package/dist/commonSelectors.cjs.map +1 -1
- package/dist/commonSelectors.js +6 -6
- package/dist/constants.js +1 -1
- package/dist/deploymentsSlice/constants.js +1 -1
- package/dist/deploymentsSlice/index.js +1 -1
- package/dist/deploymentsSlice/mocks.js +1 -1
- package/dist/deploymentsSlice/selectors.js +1 -1
- package/dist/deploymentsSlice/thunks.cjs +17 -8
- package/dist/deploymentsSlice/thunks.cjs.map +1 -1
- package/dist/deploymentsSlice/thunks.js +15 -15
- package/dist/devicesSlice/constants.js +1 -1
- package/dist/devicesSlice/index.cjs +7 -3
- package/dist/devicesSlice/index.cjs.map +1 -1
- package/dist/devicesSlice/index.d.cts +4 -4
- package/dist/devicesSlice/index.d.ts +4 -4
- package/dist/devicesSlice/index.js +2 -2
- package/dist/devicesSlice/mocks.cjs +8 -4
- package/dist/devicesSlice/mocks.cjs.map +1 -1
- package/dist/devicesSlice/mocks.d.cts +5 -1
- package/dist/devicesSlice/mocks.d.ts +5 -1
- package/dist/devicesSlice/mocks.js +3 -3
- package/dist/devicesSlice/mocks.js.map +1 -1
- package/dist/devicesSlice/selectors.cjs +12 -5
- package/dist/devicesSlice/selectors.cjs.map +1 -1
- package/dist/devicesSlice/selectors.d.cts +310 -3
- package/dist/devicesSlice/selectors.d.ts +310 -3
- package/dist/devicesSlice/selectors.js +6 -4
- package/dist/devicesSlice/thunks.cjs +19 -10
- package/dist/devicesSlice/thunks.cjs.map +1 -1
- package/dist/devicesSlice/thunks.d.cts +5 -5
- package/dist/devicesSlice/thunks.d.ts +5 -5
- package/dist/devicesSlice/thunks.js +17 -17
- package/dist/liststatehook.js +1 -1
- package/dist/locationutils.js +1 -1
- package/dist/monitorSlice/index.js +1 -1
- package/dist/monitorSlice/mocks.js +1 -1
- package/dist/monitorSlice/thunks.cjs +15 -6
- package/dist/monitorSlice/thunks.cjs.map +1 -1
- package/dist/monitorSlice/thunks.js +13 -13
- 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/index.js +1 -1
- package/dist/onboardingSlice/mocks.cjs.map +1 -1
- package/dist/onboardingSlice/mocks.js +1 -1
- package/dist/onboardingSlice/thunks.cjs +27 -9
- package/dist/onboardingSlice/thunks.cjs.map +1 -1
- package/dist/onboardingSlice/thunks.js +15 -15
- package/dist/organizationSlice/constants.js +1 -1
- package/dist/organizationSlice/index.js +1 -1
- package/dist/organizationSlice/mocks.js +1 -1
- package/dist/organizationSlice/selectors.js +1 -1
- package/dist/organizationSlice/thunks.cjs +19 -10
- package/dist/organizationSlice/thunks.cjs.map +1 -1
- package/dist/organizationSlice/thunks.d.cts +3 -3
- package/dist/organizationSlice/thunks.d.ts +3 -3
- package/dist/organizationSlice/thunks.js +15 -15
- package/dist/releasesSlice/index.js +1 -1
- package/dist/releasesSlice/mocks.js +1 -1
- package/dist/releasesSlice/selectors.js +1 -1
- package/dist/releasesSlice/thunks.cjs +15 -6
- package/dist/releasesSlice/thunks.cjs.map +1 -1
- package/dist/releasesSlice/thunks.js +13 -13
- package/dist/selectors.cjs +12 -5
- package/dist/selectors.cjs.map +1 -1
- package/dist/selectors.d.cts +1 -1
- package/dist/selectors.d.ts +1 -1
- package/dist/selectors.js +37 -35
- package/dist/sockethook.js +1 -1
- package/dist/store.cjs +7 -3
- package/dist/store.cjs.map +1 -1
- package/dist/store.js +7 -7
- package/dist/storehooks.cjs +38 -17
- package/dist/storehooks.cjs.map +1 -1
- package/dist/storehooks.js +26 -23
- package/dist/storehooks.js.map +1 -1
- package/dist/thunks.cjs +31 -13
- package/dist/thunks.cjs.map +1 -1
- package/dist/thunks.d.cts +1 -1
- package/dist/thunks.d.ts +1 -1
- package/dist/thunks.js +17 -17
- package/dist/useDeploymentDevice.cjs +17 -8
- package/dist/useDeploymentDevice.cjs.map +1 -1
- package/dist/useDeploymentDevice.js +16 -16
- 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 +2 -2
- package/dist/usersSlice/mocks.cjs.map +1 -1
- package/dist/usersSlice/mocks.js +2 -2
- package/dist/usersSlice/selectors.js +1 -1
- package/dist/usersSlice/thunks.cjs +17 -8
- package/dist/usersSlice/thunks.cjs.map +1 -1
- package/dist/usersSlice/thunks.js +15 -15
- package/dist/utils.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-CKF76YO4.js.map +0 -1
- package/dist/chunk-KQ6AGXRK.js.map +0 -1
- package/dist/chunk-UVYRVFZX.js.map +0 -1
- package/dist/chunk-VANBSJS5.js.map +0 -1
- package/dist/chunk-VWNMAIL2.js.map +0 -1
- /package/dist/{chunk-ITGVP27I.js.map → chunk-4FNSLYK5.js.map} +0 -0
- /package/dist/{chunk-MUZHPRLI.js.map → chunk-6KNRR7A5.js.map} +0 -0
- /package/dist/{chunk-ZOF45MII.js.map → chunk-CUU3N6KW.js.map} +0 -0
- /package/dist/{chunk-ZRSVD5QY.js.map → chunk-I3H5EFZK.js.map} +0 -0
- /package/dist/{chunk-N3TU2WH2.js.map → chunk-X3NF4KNC.js.map} +0 -0
package/dist/storehooks.cjs
CHANGED
|
@@ -1081,7 +1081,11 @@ var initialState3 = {
|
|
|
1081
1081
|
// { items: [{ key: "someKey", count: 42 }], otherCount: 123, total: <otherCount + itemsCount> }
|
|
1082
1082
|
],
|
|
1083
1083
|
total: 0,
|
|
1084
|
-
|
|
1084
|
+
limits: {
|
|
1085
|
+
standard: 0,
|
|
1086
|
+
micro: 0,
|
|
1087
|
+
system: 0
|
|
1088
|
+
},
|
|
1085
1089
|
groups: {
|
|
1086
1090
|
byId: {
|
|
1087
1091
|
// groupName: { deviceIds: [], total: 0, filters: [] },
|
|
@@ -1187,8 +1191,8 @@ var devicesSlice = (0, import_toolkit3.createSlice)({
|
|
|
1187
1191
|
const { count, status } = action.payload;
|
|
1188
1192
|
state.byStatus[status].total = count;
|
|
1189
1193
|
},
|
|
1190
|
-
|
|
1191
|
-
state.
|
|
1194
|
+
setDeviceLimits: (state, action) => {
|
|
1195
|
+
state.limits = action.payload;
|
|
1192
1196
|
},
|
|
1193
1197
|
receivedDevice: (state, action) => {
|
|
1194
1198
|
state.byId[action.payload.id] = {
|
|
@@ -1808,7 +1812,7 @@ var getSortedFilteringAttributes = (0, import_toolkit11.createSelector)([getFilt
|
|
|
1808
1812
|
...filteringAttributes,
|
|
1809
1813
|
identityAttributes: [...filteringAttributes.identityAttributes, "id"]
|
|
1810
1814
|
}));
|
|
1811
|
-
var
|
|
1815
|
+
var getDeviceLimits = (state) => state.devices.limits;
|
|
1812
1816
|
var getFilteringAttributesLimit = (state) => state.devices.filteringAttributesLimit;
|
|
1813
1817
|
var getDeviceIdentityAttributes = (0, import_toolkit11.createSelector)(
|
|
1814
1818
|
[getFilteringAttributes, getFilteringAttributesLimit],
|
|
@@ -1846,9 +1850,14 @@ var getSelectedGroupInfo = (0, import_toolkit11.createSelector)(
|
|
|
1846
1850
|
return { groupCount, selectedGroup, groupFilters };
|
|
1847
1851
|
}
|
|
1848
1852
|
);
|
|
1853
|
+
var getCombinedLimit = (0, import_toolkit11.createSelector)(
|
|
1854
|
+
[getDeviceLimits],
|
|
1855
|
+
(deviceLimits) => Object.values(deviceLimits).reduce((accu, limit) => accu + Math.max(limit ?? 0, 0), 0)
|
|
1856
|
+
// limit might be -1 for unlimited devices
|
|
1857
|
+
);
|
|
1849
1858
|
var getLimitMaxed = (0, import_toolkit11.createSelector)(
|
|
1850
|
-
[getAcceptedDevices,
|
|
1851
|
-
({ total: acceptedDevices = 0 },
|
|
1859
|
+
[getAcceptedDevices, getCombinedLimit],
|
|
1860
|
+
({ total: acceptedDevices = 0 }, combinedLimit) => !!combinedLimit && combinedLimit <= acceptedDevices
|
|
1852
1861
|
);
|
|
1853
1862
|
var getGroupsByIdWithoutUngrouped = (0, import_toolkit11.createSelector)([getGroupsById], ({ [UNGROUPED_GROUP.id]: ungrouped, ...groups }) => groups);
|
|
1854
1863
|
var getGroupData = (0, import_toolkit11.createSelector)([getGroupsByIdWithoutUngrouped], (groups) => {
|
|
@@ -3367,9 +3376,9 @@ var getAllDeviceCounts = createAppAsyncThunk(
|
|
|
3367
3376
|
`${sliceName3}/getAllDeviceCounts`,
|
|
3368
3377
|
(_, { dispatch }) => Promise.all([import_constants5.DEVICE_STATES.accepted, import_constants5.DEVICE_STATES.pending].map((status) => dispatch(getDeviceCount(status))))
|
|
3369
3378
|
);
|
|
3370
|
-
var
|
|
3379
|
+
var getDeviceLimits2 = createAppAsyncThunk(
|
|
3371
3380
|
`${sliceName3}/getDeviceLimit`,
|
|
3372
|
-
(_, { dispatch }) => general_api_default.get(`${import_constants5.deviceAuthV2}/limits/
|
|
3381
|
+
(_, { dispatch }) => general_api_default.get(`${import_constants5.deviceAuthV2}/limits/devices`).then((res) => dispatch(actions3.setDeviceLimits(res.data)))
|
|
3373
3382
|
);
|
|
3374
3383
|
var setDeviceListState = createAppAsyncThunk(
|
|
3375
3384
|
`${sliceName3}/setDeviceListState`,
|
|
@@ -3949,13 +3958,22 @@ var deductOnboardingState = ({ devicesById, devicesByStatus, onboardingState, pa
|
|
|
3949
3958
|
const pendingDevices = devicesByStatus[import_constants5.DEVICE_STATES.pending].deviceIds;
|
|
3950
3959
|
let deviceType = onboardingState.deviceType ?? [];
|
|
3951
3960
|
deviceType = !deviceType.length && acceptedDevices.length && devicesById[acceptedDevices[0]].hasOwnProperty("attributes") ? devicesById[acceptedDevices[0]].attributes.device_type : deviceType;
|
|
3961
|
+
const deviceTier = acceptedDevices.length && devicesById[acceptedDevices[0]].tier;
|
|
3962
|
+
let approach = null;
|
|
3963
|
+
if (deviceType.some((type) => type.startsWith("qemu"))) {
|
|
3964
|
+
approach = "virtual";
|
|
3965
|
+
} else if (deviceType.some((type) => type.startsWith("esp32")) || deviceTier === "micro") {
|
|
3966
|
+
approach = "mcu";
|
|
3967
|
+
} else if (deviceType.length) {
|
|
3968
|
+
approach = "physical";
|
|
3969
|
+
}
|
|
3952
3970
|
const progress2 = applyOnboardingFallbacks(onboardingState.progress || determineProgress(acceptedDevices, pendingDevices, releases, pastDeployments));
|
|
3953
3971
|
return {
|
|
3954
3972
|
...onboardingState,
|
|
3955
3973
|
complete: !!(Boolean(userCookie) || onboardingState.complete || acceptedDevices.length > 1 && pendingDevices.length > 0 && releases.length > 1 && pastDeployments.length > 1 || acceptedDevices.length >= 1 && releases.length >= 2 && pastDeployments.length > 2 || acceptedDevices.length >= 1 && pendingDevices.length > 0 && releases.length >= 2 && pastDeployments.length >= 2 || orderedOnboardingSteps.findIndex((step) => step === progress2) >= orderedOnboardingSteps.length - 1 || onboardingState.disable || ![canDeploy, canManageDevices, canReadDeployments, canReadDevices, canReadReleases, canUploadReleases].every((i) => i)),
|
|
3956
3974
|
showTips: onboardingState.showTips != null ? onboardingState.showTips : true,
|
|
3957
3975
|
deviceType,
|
|
3958
|
-
approach: onboardingState.approach ||
|
|
3976
|
+
approach: onboardingState.approach || approach,
|
|
3959
3977
|
progress: progress2
|
|
3960
3978
|
};
|
|
3961
3979
|
};
|
|
@@ -4103,7 +4121,7 @@ var cancelUpgrade = createAppAsyncThunk(
|
|
|
4103
4121
|
);
|
|
4104
4122
|
var completeUpgrade = createAppAsyncThunk(
|
|
4105
4123
|
`${sliceName6}/completeUpgrade`,
|
|
4106
|
-
({ tenantId, plan, billing_profile }, { dispatch }) => general_api_default.post(`${import_constants5.tenantadmApiUrlv2}/tenants/${tenantId}/upgrade/complete`, { plan, billing_profile }).catch((err) => commonErrorHandler(err, `There was an error upgrading your account:`, dispatch)).then(() => Promise.all([dispatch(
|
|
4124
|
+
({ tenantId, plan, billing_profile }, { dispatch }) => general_api_default.post(`${import_constants5.tenantadmApiUrlv2}/tenants/${tenantId}/upgrade/complete`, { plan, billing_profile }).catch((err) => commonErrorHandler(err, `There was an error upgrading your account:`, dispatch)).then(() => Promise.all([dispatch(getDeviceLimits2()), dispatch(getUserOrganization())]))
|
|
4107
4125
|
);
|
|
4108
4126
|
var prepareAuditlogQuery = ({
|
|
4109
4127
|
startDate,
|
|
@@ -4265,7 +4283,7 @@ var getCurrentSubscription = createAppAsyncThunk(
|
|
|
4265
4283
|
);
|
|
4266
4284
|
var requestPlanUpgrade = createAppAsyncThunk(
|
|
4267
4285
|
`${sliceName6}/requestPlanUpgrade`,
|
|
4268
|
-
(order, { dispatch }) => general_api_default.post(`${import_constants5.tenantadmApiUrlv2}/billing/subscription`, order).catch((err) => commonErrorHandler(err, "There was an error sending your request", dispatch, commonErrorFallback)).then(() => Promise.all([setTimeout(() => dispatch(
|
|
4286
|
+
(order, { dispatch }) => general_api_default.post(`${import_constants5.tenantadmApiUrlv2}/billing/subscription`, order).catch((err) => commonErrorHandler(err, "There was an error sending your request", dispatch, commonErrorFallback)).then(() => Promise.all([setTimeout(() => dispatch(getDeviceLimits2()), TIMEOUTS.threeSeconds), dispatch(getUserOrganization())]))
|
|
4269
4287
|
);
|
|
4270
4288
|
var sendSupportMessage = createAppAsyncThunk(
|
|
4271
4289
|
`${sliceName6}/sendSupportMessage`,
|
|
@@ -5530,7 +5548,7 @@ var useAppInit = (userId) => {
|
|
|
5530
5548
|
if (isServiceProvider) {
|
|
5531
5549
|
return Promise.resolve(dispatch(getRoles()));
|
|
5532
5550
|
}
|
|
5533
|
-
|
|
5551
|
+
const tasks = [
|
|
5534
5552
|
dispatch(getDeviceAttributes()),
|
|
5535
5553
|
dispatch(getDeploymentsByStatus2({ status: DEPLOYMENT_STATES.finished, shouldSelect: false })),
|
|
5536
5554
|
dispatch(getDeploymentsByStatus2({ status: DEPLOYMENT_STATES.inprogress })),
|
|
@@ -5541,11 +5559,14 @@ var useAppInit = (userId) => {
|
|
|
5541
5559
|
dispatch(getDynamicGroups()),
|
|
5542
5560
|
dispatch(getGroups2()),
|
|
5543
5561
|
dispatch(getIntegrations()),
|
|
5544
|
-
dispatch(getReleases())
|
|
5545
|
-
|
|
5546
|
-
|
|
5547
|
-
|
|
5548
|
-
|
|
5562
|
+
dispatch(getReleases())
|
|
5563
|
+
];
|
|
5564
|
+
if (hasMultitenancy) {
|
|
5565
|
+
tasks.push(dispatch(getDeviceLimits2()));
|
|
5566
|
+
tasks.push(dispatch(getRoles()));
|
|
5567
|
+
}
|
|
5568
|
+
return Promise.all(tasks);
|
|
5569
|
+
}, [dispatch, hasMultitenancy, isServiceProvider]);
|
|
5549
5570
|
const interpretAppData = (0, import_react2.useCallback)(() => {
|
|
5550
5571
|
const settings = {};
|
|
5551
5572
|
if (cookies6.get("_ga") && typeof hasTrackingEnabled === "undefined") {
|