@northern.tech/store 0.45.0 → 0.45.1

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.
@@ -1431,7 +1431,7 @@ declare const getAuditlogDevice: ((state: {
1431
1431
  }) => {
1432
1432
  id?: string;
1433
1433
  identity_data?: import("@northern.tech/types/types.gen").IdentityData;
1434
- status?: (("accepted" | "pending" | "rejected" | "preauthorized" | "noauth" | undefined) & import("@northern.tech/types/types.gen").Status) | undefined;
1434
+ status?: (("pending" | "accepted" | "rejected" | "preauthorized" | "noauth" | undefined) & import("@northern.tech/types/types.gen").Status) | undefined;
1435
1435
  created_ts?: string;
1436
1436
  updated_ts?: string;
1437
1437
  check_in_time?: string;
@@ -1469,7 +1469,7 @@ declare const getAuditlogDevice: ((state: {
1469
1469
  resultFunc: (resultFuncArgs_0: AuditLog | undefined, resultFuncArgs_1: Record<string, Device>) => {
1470
1470
  id?: string;
1471
1471
  identity_data?: import("@northern.tech/types/types.gen").IdentityData;
1472
- status?: (("accepted" | "pending" | "rejected" | "preauthorized" | "noauth" | undefined) & import("@northern.tech/types/types.gen").Status) | undefined;
1472
+ status?: (("pending" | "accepted" | "rejected" | "preauthorized" | "noauth" | undefined) & import("@northern.tech/types/types.gen").Status) | undefined;
1473
1473
  created_ts?: string;
1474
1474
  updated_ts?: string;
1475
1475
  check_in_time?: string;
@@ -1503,7 +1503,7 @@ declare const getAuditlogDevice: ((state: {
1503
1503
  memoizedResultFunc: ((resultFuncArgs_0: AuditLog | undefined, resultFuncArgs_1: Record<string, Device>) => {
1504
1504
  id?: string;
1505
1505
  identity_data?: import("@northern.tech/types/types.gen").IdentityData;
1506
- status?: (("accepted" | "pending" | "rejected" | "preauthorized" | "noauth" | undefined) & import("@northern.tech/types/types.gen").Status) | undefined;
1506
+ status?: (("pending" | "accepted" | "rejected" | "preauthorized" | "noauth" | undefined) & import("@northern.tech/types/types.gen").Status) | undefined;
1507
1507
  created_ts?: string;
1508
1508
  updated_ts?: string;
1509
1509
  check_in_time?: string;
@@ -1541,7 +1541,7 @@ declare const getAuditlogDevice: ((state: {
1541
1541
  lastResult: () => {
1542
1542
  id?: string;
1543
1543
  identity_data?: import("@northern.tech/types/types.gen").IdentityData;
1544
- status?: (("accepted" | "pending" | "rejected" | "preauthorized" | "noauth" | undefined) & import("@northern.tech/types/types.gen").Status) | undefined;
1544
+ status?: (("pending" | "accepted" | "rejected" | "preauthorized" | "noauth" | undefined) & import("@northern.tech/types/types.gen").Status) | undefined;
1545
1545
  created_ts?: string;
1546
1546
  updated_ts?: string;
1547
1547
  check_in_time?: string;
@@ -1431,7 +1431,7 @@ declare const getAuditlogDevice: ((state: {
1431
1431
  }) => {
1432
1432
  id?: string;
1433
1433
  identity_data?: import("@northern.tech/types/types.gen").IdentityData;
1434
- status?: (("accepted" | "pending" | "rejected" | "preauthorized" | "noauth" | undefined) & import("@northern.tech/types/types.gen").Status) | undefined;
1434
+ status?: (("pending" | "accepted" | "rejected" | "preauthorized" | "noauth" | undefined) & import("@northern.tech/types/types.gen").Status) | undefined;
1435
1435
  created_ts?: string;
1436
1436
  updated_ts?: string;
1437
1437
  check_in_time?: string;
@@ -1469,7 +1469,7 @@ declare const getAuditlogDevice: ((state: {
1469
1469
  resultFunc: (resultFuncArgs_0: AuditLog | undefined, resultFuncArgs_1: Record<string, Device>) => {
1470
1470
  id?: string;
1471
1471
  identity_data?: import("@northern.tech/types/types.gen").IdentityData;
1472
- status?: (("accepted" | "pending" | "rejected" | "preauthorized" | "noauth" | undefined) & import("@northern.tech/types/types.gen").Status) | undefined;
1472
+ status?: (("pending" | "accepted" | "rejected" | "preauthorized" | "noauth" | undefined) & import("@northern.tech/types/types.gen").Status) | undefined;
1473
1473
  created_ts?: string;
1474
1474
  updated_ts?: string;
1475
1475
  check_in_time?: string;
@@ -1503,7 +1503,7 @@ declare const getAuditlogDevice: ((state: {
1503
1503
  memoizedResultFunc: ((resultFuncArgs_0: AuditLog | undefined, resultFuncArgs_1: Record<string, Device>) => {
1504
1504
  id?: string;
1505
1505
  identity_data?: import("@northern.tech/types/types.gen").IdentityData;
1506
- status?: (("accepted" | "pending" | "rejected" | "preauthorized" | "noauth" | undefined) & import("@northern.tech/types/types.gen").Status) | undefined;
1506
+ status?: (("pending" | "accepted" | "rejected" | "preauthorized" | "noauth" | undefined) & import("@northern.tech/types/types.gen").Status) | undefined;
1507
1507
  created_ts?: string;
1508
1508
  updated_ts?: string;
1509
1509
  check_in_time?: string;
@@ -1541,7 +1541,7 @@ declare const getAuditlogDevice: ((state: {
1541
1541
  lastResult: () => {
1542
1542
  id?: string;
1543
1543
  identity_data?: import("@northern.tech/types/types.gen").IdentityData;
1544
- status?: (("accepted" | "pending" | "rejected" | "preauthorized" | "noauth" | undefined) & import("@northern.tech/types/types.gen").Status) | undefined;
1544
+ status?: (("pending" | "accepted" | "rejected" | "preauthorized" | "noauth" | undefined) & import("@northern.tech/types/types.gen").Status) | undefined;
1545
1545
  created_ts?: string;
1546
1546
  updated_ts?: string;
1547
1547
  check_in_time?: string;
@@ -404,7 +404,7 @@ declare const searchDevices: import("@reduxjs/toolkit").AsyncThunk<{
404
404
  rejectedMeta?: unknown;
405
405
  }>;
406
406
  declare const searchIdentities: import("@reduxjs/toolkit").AsyncThunk<{
407
- devices: DeviceInventoryResponse[];
407
+ devices: unknown[];
408
408
  total: number;
409
409
  }, SearchIdentityParams, {
410
410
  dispatch: AppDispatch;
@@ -404,7 +404,7 @@ declare const searchDevices: import("@reduxjs/toolkit").AsyncThunk<{
404
404
  rejectedMeta?: unknown;
405
405
  }>;
406
406
  declare const searchIdentities: import("@reduxjs/toolkit").AsyncThunk<{
407
- devices: DeviceInventoryResponse[];
407
+ devices: unknown[];
408
408
  total: number;
409
409
  }, SearchIdentityParams, {
410
410
  dispatch: AppDispatch;
package/dist/thunks.cjs CHANGED
@@ -1023,7 +1023,7 @@ const searchDevices = require_store.createAppAsyncThunk(`${require_devicesSlice_
1023
1023
  searchTotal: Number(response.headers[_northern_tech_utils_constants.headerNames.total])
1024
1024
  };
1025
1025
  });
1026
- const searchIdentities = require_store.createAppAsyncThunk(`${require_devicesSlice_index.sliceName}/searchIdentities`, async (options, { dispatch }) => {
1026
+ const searchIdentities = require_store.createAppAsyncThunk(`${require_devicesSlice_index.sliceName}/searchIdentities`, async (options, { dispatch, getState }) => {
1027
1027
  const { attributes: additionalAttributes = [], page = defaultPage$1, per_page = defaultPerPage$1, ...remainder } = options;
1028
1028
  const response = await require_api_general_api.default.post(`${_northern_tech_utils_constants.inventoryApiUrlV2alpha1}/identities/search`, {
1029
1029
  ...remainder,
@@ -1031,8 +1031,9 @@ const searchIdentities = require_store.createAppAsyncThunk(`${require_devicesSli
1031
1031
  page,
1032
1032
  per_page
1033
1033
  }).catch((err) => require_store.commonErrorHandler(err, `devices couldn't be searched.`, dispatch, require_store.commonErrorFallback));
1034
+ const { devicesById } = reduceReceivedDevices(response.data, [], getState());
1034
1035
  return {
1035
- devices: response.data,
1036
+ devices: Object.values(devicesById),
1036
1037
  total: Number(response.headers[_northern_tech_utils_constants.headerNames.total])
1037
1038
  };
1038
1039
  });