@northern.tech/store 0.34.0 → 0.35.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.
Files changed (59) hide show
  1. package/dist/actions.d.cts +9 -3
  2. package/dist/actions.d.ts +9 -3
  3. package/dist/appSlice/selectors.d.cts +2 -2
  4. package/dist/appSlice/selectors.d.ts +2 -2
  5. package/dist/appSlice/thunks.d.cts +1 -1
  6. package/dist/appSlice/thunks.d.ts +1 -1
  7. package/dist/commonSelectors.d.cts +2 -2
  8. package/dist/commonSelectors.d.ts +2 -2
  9. package/dist/deploymentsSlice/selectors.d.cts +2 -2
  10. package/dist/deploymentsSlice/selectors.d.ts +2 -2
  11. package/dist/deploymentsSlice/thunks.d.cts +1 -1
  12. package/dist/deploymentsSlice/thunks.d.ts +1 -1
  13. package/dist/devicesSlice/selectors.d.cts +2 -2
  14. package/dist/devicesSlice/selectors.d.ts +2 -2
  15. package/dist/devicesSlice/thunks.d.cts +1 -1
  16. package/dist/devicesSlice/thunks.d.ts +1 -1
  17. package/dist/{index-SwHfGav1.d.cts → index-D6J838hD.d.cts} +2 -1
  18. package/dist/{index-uxdvFzzE.d.ts → index-KZBwih6D.d.ts} +2 -1
  19. package/dist/monitorSlice/selectors.d.cts +1 -1
  20. package/dist/monitorSlice/selectors.d.ts +1 -1
  21. package/dist/monitorSlice/thunks.d.cts +12 -6
  22. package/dist/monitorSlice/thunks.d.ts +12 -6
  23. package/dist/onboardingSlice/selectors.d.cts +1 -1
  24. package/dist/onboardingSlice/selectors.d.ts +1 -1
  25. package/dist/onboardingSlice/thunks.d.cts +1 -1
  26. package/dist/onboardingSlice/thunks.d.ts +1 -1
  27. package/dist/organizationSlice/selectors.d.cts +2 -2
  28. package/dist/organizationSlice/selectors.d.ts +2 -2
  29. package/dist/organizationSlice/thunks.d.cts +20 -9
  30. package/dist/organizationSlice/thunks.d.ts +20 -9
  31. package/dist/releasesSlice/index.cjs +1 -0
  32. package/dist/releasesSlice/index.cjs.map +1 -1
  33. package/dist/releasesSlice/index.d.cts +1 -1
  34. package/dist/releasesSlice/index.d.ts +1 -1
  35. package/dist/releasesSlice/index.js +1 -0
  36. package/dist/releasesSlice/index.js.map +1 -1
  37. package/dist/releasesSlice/selectors.d.cts +2 -2
  38. package/dist/releasesSlice/selectors.d.ts +2 -2
  39. package/dist/releasesSlice/thunks.cjs +14 -10
  40. package/dist/releasesSlice/thunks.cjs.map +1 -1
  41. package/dist/releasesSlice/thunks.d.cts +2 -2
  42. package/dist/releasesSlice/thunks.d.ts +2 -2
  43. package/dist/releasesSlice/thunks.js +14 -10
  44. package/dist/releasesSlice/thunks.js.map +1 -1
  45. package/dist/{store-BjVukDvt.d.ts → store-BW01FNkb.d.ts} +2 -2
  46. package/dist/{store-BC3rDsIH.d.cts → store-BkLukXiT.d.cts} +2 -2
  47. package/dist/store.d.cts +1 -1
  48. package/dist/store.d.ts +1 -1
  49. package/dist/storehooks.d.cts +13 -13
  50. package/dist/storehooks.d.ts +13 -13
  51. package/dist/thunks.cjs +10 -7
  52. package/dist/thunks.cjs.map +1 -1
  53. package/dist/thunks.js +10 -7
  54. package/dist/thunks.js.map +1 -1
  55. package/dist/usersSlice/selectors.d.cts +2 -2
  56. package/dist/usersSlice/selectors.d.ts +2 -2
  57. package/dist/usersSlice/thunks.d.cts +28 -28
  58. package/dist/usersSlice/thunks.d.ts +28 -28
  59. package/package.json +1 -1
package/dist/thunks.js CHANGED
@@ -287,11 +287,11 @@ const createDeployment = createAppAsyncThunk(`${sliceName$1}/createDeployment`,
287
287
  trackDeploymentCreation(totalDeploymentCount, hasDeployments, trial_expiration);
288
288
  const { canManageUsers } = getUserCapabilities(getState());
289
289
  if (canManageUsers) {
290
- const { phases } = newDeployment;
290
+ const { phases = [], uniform_phases } = newDeployment;
291
291
  const { previousPhases = [] } = getGlobalSettings$1(getState());
292
292
  const newSettings = { hasDeployments: true };
293
293
  if (phases) {
294
- const standardPhases = standardizePhases(phases);
294
+ const standardPhases = standardizePhases(uniform_phases ? [uniform_phases] : phases);
295
295
  const prevPhases = previousPhases.map(standardizePhases);
296
296
  if (!prevPhases.find((previousPhaseList) => previousPhaseList.every((oldPhase) => standardPhases.find((phase) => deepCompare(phase, oldPhase))))) prevPhases.push(standardPhases);
297
297
  newSettings.previousPhases = prevPhases.slice(-1 * MAX_PREVIOUS_PHASES_COUNT);
@@ -1834,7 +1834,7 @@ const getCurrentSubscription = createAppAsyncThunk(`${sliceName$4}/getCurrentSub
1834
1834
  return commonErrorHandler(err, "There was an error retrieving your current subscription", dispatch, commonErrorFallback);
1835
1835
  }));
1836
1836
  const getProducts = createAppAsyncThunk(`${sliceName$4}/getEnabledTiers`, (_, { dispatch }) => Api.get(`${tenantadmApiUrlv2}/billing/products`).catch((err) => commonErrorHandler(err, "There was an error getting Mender products:", dispatch, commonErrorFallback)).then((res) => dispatch(actions$4.setProducts(transformProductResponse(res.data)))));
1837
- const requestPlanUpgrade = createAppAsyncThunk(`${sliceName$4}/requestPlanUpgrade`, (order, { dispatch }) => Api.post(`${tenantadmApiUrlv2}/billing/subscription`, order).catch((err) => commonErrorHandler(err, "There was an error sending your request", dispatch, commonErrorFallback)).then(() => Promise.all([setTimeout(() => dispatch(getDeviceLimits()), TIMEOUTS.threeSeconds), dispatch(getUserOrganization())])));
1837
+ const requestPlanUpgrade = createAppAsyncThunk(`${sliceName$4}/requestPlanUpgrade`, (order, { dispatch }) => Api.post(`${tenantadmApiUrlv2}/billing/subscription`, order).catch((err) => commonErrorHandler(err, "There was an error sending your request", dispatch, commonErrorFallback)).then(() => Promise.all([new Promise((resolve) => setTimeout(resolve, TIMEOUTS.threeSeconds)).then(() => dispatch(getDeviceLimits())), dispatch(getUserOrganization())])));
1838
1838
  const sendSupportMessage = createAppAsyncThunk(`${sliceName$4}/sendSupportMessage`, (content, { dispatch }) => Api.post(`${tenantadmApiUrlv2}/contact/support`, content).catch((err) => commonErrorHandler(err, "There was an error sending your request", dispatch, commonErrorFallback)).then(() => Promise.resolve(dispatch(setSnackbar$1({
1839
1839
  message: "Your request was sent successfully",
1840
1840
  autoHideDuration: TIMEOUTS.fiveSeconds
@@ -1849,11 +1849,14 @@ const requestPlanChange = createAppAsyncThunk(`${sliceName$4}/requestPlanChange`
1849
1849
  const downloadLicenseReport = createAppAsyncThunk(`${sliceName$4}/downloadLicenseReport`, (_, { dispatch }) => Api.get(`${deviceAuthV2}/license`).catch((err) => commonErrorHandler(err, "There was an error downloading the report", dispatch, commonErrorFallback)).then((res) => res.data));
1850
1850
  const createIntegration = createAppAsyncThunk(`${sliceName$4}/createIntegration`, ({ id, ...integration }, { dispatch }) => Api.post(`${iotManagerBaseURL}/integrations`, integration).catch((err) => commonErrorHandler(err, "There was an error creating the integration", dispatch, commonErrorFallback)).then(() => Promise.all([dispatch(setSnackbar$1("The integration was set up successfully")), dispatch(getIntegrations())])));
1851
1851
  const changeIntegration = createAppAsyncThunk(`${sliceName$4}/changeIntegration`, ({ id, credentials }, { dispatch }) => Api.put(`${iotManagerBaseURL}/integrations/${id}/credentials`, credentials).catch((err) => commonErrorHandler(err, "There was an error updating the integration", dispatch, commonErrorFallback)).then(() => Promise.all([dispatch(setSnackbar$1("The integration was updated successfully")), dispatch(getIntegrations())])));
1852
- const deleteIntegration = createAppAsyncThunk(`${sliceName$4}/deleteIntegration`, ({ id, provider }, { dispatch, getState }) => Api.delete(`${iotManagerBaseURL}/integrations/${id}`, {}).catch((err) => commonErrorHandler(err, "There was an error removing the integration", dispatch, commonErrorFallback)).then(() => {
1852
+ const deleteIntegration = createAppAsyncThunk(`${sliceName$4}/deleteIntegration`, async ({ id, provider }, { dispatch, getState }) => {
1853
+ await Api.delete(`${iotManagerBaseURL}/integrations/${id}`, {}).catch((err) => commonErrorHandler(err, "There was an error removing the integration", dispatch, commonErrorFallback));
1853
1854
  const integrations = getState().organization.externalDeviceIntegrations.filter((item) => provider !== item.provider);
1854
- return Promise.all([dispatch(setSnackbar$1("The integration was removed successfully")), dispatch(actions$4.receiveExternalDeviceIntegrations(integrations))]);
1855
- }));
1856
- const getIntegrations = createAppAsyncThunk(`${sliceName$4}/getIntegrations`, (_, { dispatch, getState }) => Api.get(`${iotManagerBaseURL}/integrations`).catch((err) => commonErrorHandler(err, "There was an error retrieving the integration", dispatch, commonErrorFallback)).then(({ data }) => {
1855
+ dispatch(setSnackbar$1("The integration was removed successfully"));
1856
+ dispatch(actions$4.receiveExternalDeviceIntegrations(integrations));
1857
+ await dispatch(getIntegrations()).unwrap();
1858
+ });
1859
+ const getIntegrations = createAppAsyncThunk(`${sliceName$4}/getIntegrations`, (_, { dispatch, getState }) => Api.get(`${iotManagerBaseURL}/integrations`).catch((err) => commonErrorHandler(err, "There was an error retrieving the integrations", dispatch, commonErrorFallback)).then(({ data }) => {
1857
1860
  const existingIntegrations = getState().organization.externalDeviceIntegrations;
1858
1861
  const integrations = data.reduce((accu, item) => {
1859
1862
  const integration = {