@northern.tech/store 0.33.0 → 0.34.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.
@@ -1430,7 +1430,7 @@ declare const getAuditlogDevice: ((state: {
1430
1430
  }) => {
1431
1431
  id?: string;
1432
1432
  identity_data?: _$_northern_tech_types_types_gen0.IdentityData;
1433
- status?: (("accepted" | "pending" | "rejected" | "preauthorized" | "noauth" | undefined) & _$_northern_tech_types_types_gen0.Status) | undefined;
1433
+ status?: (("pending" | "accepted" | "rejected" | "preauthorized" | "noauth" | undefined) & _$_northern_tech_types_types_gen0.Status) | undefined;
1434
1434
  created_ts?: string;
1435
1435
  updated_ts?: string;
1436
1436
  check_in_time?: string;
@@ -1467,7 +1467,7 @@ declare const getAuditlogDevice: ((state: {
1467
1467
  resultFunc: (resultFuncArgs_0: AuditLog | undefined, resultFuncArgs_1: Record<string, Device>) => {
1468
1468
  id?: string;
1469
1469
  identity_data?: _$_northern_tech_types_types_gen0.IdentityData;
1470
- status?: (("accepted" | "pending" | "rejected" | "preauthorized" | "noauth" | undefined) & _$_northern_tech_types_types_gen0.Status) | undefined;
1470
+ status?: (("pending" | "accepted" | "rejected" | "preauthorized" | "noauth" | undefined) & _$_northern_tech_types_types_gen0.Status) | undefined;
1471
1471
  created_ts?: string;
1472
1472
  updated_ts?: string;
1473
1473
  check_in_time?: string;
@@ -1500,7 +1500,7 @@ declare const getAuditlogDevice: ((state: {
1500
1500
  memoizedResultFunc: ((resultFuncArgs_0: AuditLog | undefined, resultFuncArgs_1: Record<string, Device>) => {
1501
1501
  id?: string;
1502
1502
  identity_data?: _$_northern_tech_types_types_gen0.IdentityData;
1503
- status?: (("accepted" | "pending" | "rejected" | "preauthorized" | "noauth" | undefined) & _$_northern_tech_types_types_gen0.Status) | undefined;
1503
+ status?: (("pending" | "accepted" | "rejected" | "preauthorized" | "noauth" | undefined) & _$_northern_tech_types_types_gen0.Status) | undefined;
1504
1504
  created_ts?: string;
1505
1505
  updated_ts?: string;
1506
1506
  check_in_time?: string;
@@ -1537,7 +1537,7 @@ declare const getAuditlogDevice: ((state: {
1537
1537
  lastResult: () => {
1538
1538
  id?: string;
1539
1539
  identity_data?: _$_northern_tech_types_types_gen0.IdentityData;
1540
- status?: (("accepted" | "pending" | "rejected" | "preauthorized" | "noauth" | undefined) & _$_northern_tech_types_types_gen0.Status) | undefined;
1540
+ status?: (("pending" | "accepted" | "rejected" | "preauthorized" | "noauth" | undefined) & _$_northern_tech_types_types_gen0.Status) | undefined;
1541
1541
  created_ts?: string;
1542
1542
  updated_ts?: string;
1543
1543
  check_in_time?: string;
@@ -1430,7 +1430,7 @@ declare const getAuditlogDevice: ((state: {
1430
1430
  }) => {
1431
1431
  id?: string;
1432
1432
  identity_data?: _$_northern_tech_types_types_gen0.IdentityData;
1433
- status?: (("accepted" | "pending" | "rejected" | "preauthorized" | "noauth" | undefined) & _$_northern_tech_types_types_gen0.Status) | undefined;
1433
+ status?: (("pending" | "accepted" | "rejected" | "preauthorized" | "noauth" | undefined) & _$_northern_tech_types_types_gen0.Status) | undefined;
1434
1434
  created_ts?: string;
1435
1435
  updated_ts?: string;
1436
1436
  check_in_time?: string;
@@ -1467,7 +1467,7 @@ declare const getAuditlogDevice: ((state: {
1467
1467
  resultFunc: (resultFuncArgs_0: AuditLog | undefined, resultFuncArgs_1: Record<string, Device>) => {
1468
1468
  id?: string;
1469
1469
  identity_data?: _$_northern_tech_types_types_gen0.IdentityData;
1470
- status?: (("accepted" | "pending" | "rejected" | "preauthorized" | "noauth" | undefined) & _$_northern_tech_types_types_gen0.Status) | undefined;
1470
+ status?: (("pending" | "accepted" | "rejected" | "preauthorized" | "noauth" | undefined) & _$_northern_tech_types_types_gen0.Status) | undefined;
1471
1471
  created_ts?: string;
1472
1472
  updated_ts?: string;
1473
1473
  check_in_time?: string;
@@ -1500,7 +1500,7 @@ declare const getAuditlogDevice: ((state: {
1500
1500
  memoizedResultFunc: ((resultFuncArgs_0: AuditLog | undefined, resultFuncArgs_1: Record<string, Device>) => {
1501
1501
  id?: string;
1502
1502
  identity_data?: _$_northern_tech_types_types_gen0.IdentityData;
1503
- status?: (("accepted" | "pending" | "rejected" | "preauthorized" | "noauth" | undefined) & _$_northern_tech_types_types_gen0.Status) | undefined;
1503
+ status?: (("pending" | "accepted" | "rejected" | "preauthorized" | "noauth" | undefined) & _$_northern_tech_types_types_gen0.Status) | undefined;
1504
1504
  created_ts?: string;
1505
1505
  updated_ts?: string;
1506
1506
  check_in_time?: string;
@@ -1537,7 +1537,7 @@ declare const getAuditlogDevice: ((state: {
1537
1537
  lastResult: () => {
1538
1538
  id?: string;
1539
1539
  identity_data?: _$_northern_tech_types_types_gen0.IdentityData;
1540
- status?: (("accepted" | "pending" | "rejected" | "preauthorized" | "noauth" | undefined) & _$_northern_tech_types_types_gen0.Status) | undefined;
1540
+ status?: (("pending" | "accepted" | "rejected" | "preauthorized" | "noauth" | undefined) & _$_northern_tech_types_types_gen0.Status) | undefined;
1541
1541
  created_ts?: string;
1542
1542
  updated_ts?: string;
1543
1543
  check_in_time?: string;
@@ -30,7 +30,6 @@ declare const getDeploymentsByStatus: _$_reduxjs_toolkit0.AsyncThunk<unknown[],
30
30
  rejectedMeta?: unknown;
31
31
  }>;
32
32
  declare const createDeployment: _$_reduxjs_toolkit0.AsyncThunk<any, {
33
- hasNewRetryDefault: boolean;
34
33
  newDeployment: NewDeploymentTypeManagement | (NewDeploymentForGroup & {
35
34
  group: string;
36
35
  }) | NewDeploymentV2TypeManagement;
@@ -30,7 +30,6 @@ declare const getDeploymentsByStatus: _$_reduxjs_toolkit0.AsyncThunk<unknown[],
30
30
  rejectedMeta?: unknown;
31
31
  }>;
32
32
  declare const createDeployment: _$_reduxjs_toolkit0.AsyncThunk<any, {
33
- hasNewRetryDefault: boolean;
34
33
  newDeployment: NewDeploymentTypeManagement | (NewDeploymentForGroup & {
35
34
  group: string;
36
35
  }) | NewDeploymentV2TypeManagement;
@@ -32,17 +32,7 @@ declare const parseEnvironmentInfo: _$_reduxjs_toolkit0.AsyncThunk<[{
32
32
  }, {
33
33
  payload: any;
34
34
  type: "app/setEnvironmentData";
35
- }, _$_reduxjs_toolkit0.PayloadAction<unknown, string, {
36
- arg: void;
37
- requestId: string;
38
- requestStatus: "rejected";
39
- aborted: boolean;
40
- condition: boolean;
41
- } & ({
42
- rejectedWithValue: true;
43
- } | ({
44
- rejectedWithValue: false;
45
- } & {})), _$_reduxjs_toolkit0.SerializedError> | _$_reduxjs_toolkit0.PayloadAction<{
35
+ }, _$_reduxjs_toolkit0.PayloadAction<{
46
36
  payload: {
47
37
  [key: string]: string | {
48
38
  releaseDate: string;
@@ -60,7 +50,17 @@ declare const parseEnvironmentInfo: _$_reduxjs_toolkit0.AsyncThunk<[{
60
50
  arg: void;
61
51
  requestId: string;
62
52
  requestStatus: "fulfilled";
63
- }, never>], void, {
53
+ }, never> | _$_reduxjs_toolkit0.PayloadAction<unknown, string, {
54
+ arg: void;
55
+ requestId: string;
56
+ requestStatus: "rejected";
57
+ aborted: boolean;
58
+ condition: boolean;
59
+ } & ({
60
+ rejectedWithValue: true;
61
+ } | ({
62
+ rejectedWithValue: false;
63
+ } & {})), _$_reduxjs_toolkit0.SerializedError>], void, {
64
64
  dispatch: AppDispatch;
65
65
  state: RootState;
66
66
  extra?: unknown;
@@ -32,17 +32,7 @@ declare const parseEnvironmentInfo: _$_reduxjs_toolkit0.AsyncThunk<[{
32
32
  }, {
33
33
  payload: any;
34
34
  type: "app/setEnvironmentData";
35
- }, _$_reduxjs_toolkit0.PayloadAction<unknown, string, {
36
- arg: void;
37
- requestId: string;
38
- requestStatus: "rejected";
39
- aborted: boolean;
40
- condition: boolean;
41
- } & ({
42
- rejectedWithValue: true;
43
- } | ({
44
- rejectedWithValue: false;
45
- } & {})), _$_reduxjs_toolkit0.SerializedError> | _$_reduxjs_toolkit0.PayloadAction<{
35
+ }, _$_reduxjs_toolkit0.PayloadAction<{
46
36
  payload: {
47
37
  [key: string]: string | {
48
38
  releaseDate: string;
@@ -60,7 +50,17 @@ declare const parseEnvironmentInfo: _$_reduxjs_toolkit0.AsyncThunk<[{
60
50
  arg: void;
61
51
  requestId: string;
62
52
  requestStatus: "fulfilled";
63
- }, never>], void, {
53
+ }, never> | _$_reduxjs_toolkit0.PayloadAction<unknown, string, {
54
+ arg: void;
55
+ requestId: string;
56
+ requestStatus: "rejected";
57
+ aborted: boolean;
58
+ condition: boolean;
59
+ } & ({
60
+ rejectedWithValue: true;
61
+ } | ({
62
+ rejectedWithValue: false;
63
+ } & {})), _$_reduxjs_toolkit0.SerializedError>], void, {
64
64
  dispatch: AppDispatch;
65
65
  state: RootState;
66
66
  extra?: unknown;
package/dist/thunks.cjs CHANGED
@@ -236,7 +236,7 @@ const cleanPhases = (phases) => phases?.map(({ batch_size, batch_size_devices, s
236
236
  start_ts
237
237
  }));
238
238
  const MAX_PREVIOUS_PHASES_COUNT = 5;
239
- const createDeployment = require_store.createAppAsyncThunk(`${require_deploymentsSlice_index.sliceName}/createDeployment`, ({ newDeployment, hasNewRetryDefault = false }, { dispatch, getState }) => {
239
+ const createDeployment = require_store.createAppAsyncThunk(`${require_deploymentsSlice_index.sliceName}/createDeployment`, ({ newDeployment }, { dispatch, getState }) => {
240
240
  let request;
241
241
  const { name, artifact_name, retries, update_control_map, autogenerate_delta } = newDeployment;
242
242
  const common = {
@@ -297,12 +297,9 @@ const createDeployment = require_store.createAppAsyncThunk(`${require_deployment
297
297
  trackDeploymentCreation(totalDeploymentCount, hasDeployments, trial_expiration);
298
298
  const { canManageUsers } = require_commonSelectors.getUserCapabilities(getState());
299
299
  if (canManageUsers) {
300
- const { phases, retries } = newDeployment;
301
- const { previousPhases = [], retries: previousRetries = 0 } = require_usersSlice_selectors.getGlobalSettings(getState());
302
- const newSettings = {
303
- retries: hasNewRetryDefault ? retries : previousRetries,
304
- hasDeployments: true
305
- };
300
+ const { phases } = newDeployment;
301
+ const { previousPhases = [] } = require_usersSlice_selectors.getGlobalSettings(getState());
302
+ const newSettings = { hasDeployments: true };
306
303
  if (phases) {
307
304
  const standardPhases = (0, _northern_tech_utils_helpers.standardizePhases)(phases);
308
305
  const prevPhases = previousPhases.map(_northern_tech_utils_helpers.standardizePhases);
@@ -1949,20 +1946,7 @@ const handleLoginError = (err, { token2fa: has2FA, password }, rejectWithValue)
1949
1946
  const twoFAError = is2FABackend ? " and verification code" : "";
1950
1947
  return rejectWithValue({ error: `There was a problem logging in. Please check your email${twoFAError ? "," : " and"} password${twoFAError}. If you still have problems, contact an administrator.` });
1951
1948
  };
1952
- const loginUser = require_store.createAppAsyncThunk(`${require_usersSlice_index.sliceName}/loginUser`, ({ stayLoggedIn, ...userData }, { dispatch, rejectWithValue }) => require_api_users_api.postLogin(`${_northern_tech_utils_constants.useradmApiUrl}/auth/login`, {
1953
- ...userData,
1954
- no_expiry: stayLoggedIn
1955
- }).catch((err) => {
1956
- require_auth.cleanUp();
1957
- return Promise.reject(dispatch(handleLoginError(err, userData, rejectWithValue)));
1958
- }).then(({ text: token, contentType }) => {
1959
- if (contentType?.includes(_northern_tech_utils_constants.APPLICATION_JSON_CONTENT_TYPE)) {
1960
- const { id, kind } = token;
1961
- const ssoLoginUrl = require_constants.SSO_TYPES[kind.split("/")[1]].getStartUrl(id);
1962
- window.location.replace(ssoLoginUrl);
1963
- return;
1964
- }
1965
- if (contentType !== _northern_tech_utils_constants.APPLICATION_JWT_CONTENT_TYPE || !token) return;
1949
+ const finalizeJwtLogin = ({ dispatch, stayLoggedIn, token }) => {
1966
1950
  const now = /* @__PURE__ */ new Date();
1967
1951
  now.setSeconds(now.getSeconds() + _northern_tech_utils_constants.maxSessionAge);
1968
1952
  const expiresAt = stayLoggedIn ? void 0 : now.toISOString();
@@ -1982,6 +1966,37 @@ const loginUser = require_store.createAppAsyncThunk(`${require_usersSlice_index.
1982
1966
  token
1983
1967
  })));
1984
1968
  });
1969
+ };
1970
+ const confirmOAuthLink = require_store.createAppAsyncThunk(`${require_usersSlice_index.sliceName}/confirmOAuthLink`, ({ stayLoggedIn, ...userData }, { dispatch, rejectWithValue }) => require_api_users_api.postLogin(`${_northern_tech_utils_constants.useradmApiUrl}/oauth2/link`, userData).catch((err) => {
1971
+ require_auth.cleanUp();
1972
+ return Promise.reject(dispatch(handleLoginError(err, userData, rejectWithValue)));
1973
+ }).then(({ text: token, contentType }) => {
1974
+ if (contentType !== _northern_tech_utils_constants.APPLICATION_JWT_CONTENT_TYPE || !token) return;
1975
+ return finalizeJwtLogin({
1976
+ token,
1977
+ dispatch,
1978
+ stayLoggedIn
1979
+ });
1980
+ }));
1981
+ const loginUser = require_store.createAppAsyncThunk(`${require_usersSlice_index.sliceName}/loginUser`, ({ stayLoggedIn, ...userData }, { dispatch, rejectWithValue }) => require_api_users_api.postLogin(`${_northern_tech_utils_constants.useradmApiUrl}/auth/login`, {
1982
+ ...userData,
1983
+ no_expiry: stayLoggedIn
1984
+ }).catch((err) => {
1985
+ require_auth.cleanUp();
1986
+ return Promise.reject(dispatch(handleLoginError(err, userData, rejectWithValue)));
1987
+ }).then(({ text: token, contentType }) => {
1988
+ if (contentType?.includes(_northern_tech_utils_constants.APPLICATION_JSON_CONTENT_TYPE)) {
1989
+ const { id, kind } = token;
1990
+ const ssoLoginUrl = require_constants.SSO_TYPES[kind.split("/")[1]].getStartUrl(id);
1991
+ window.location.replace(ssoLoginUrl);
1992
+ return;
1993
+ }
1994
+ if (contentType !== _northern_tech_utils_constants.APPLICATION_JWT_CONTENT_TYPE || !token) return;
1995
+ return finalizeJwtLogin({
1996
+ token,
1997
+ dispatch,
1998
+ stayLoggedIn
1999
+ });
1985
2000
  }));
1986
2001
  const logoutUser = require_store.createAppAsyncThunk(`${require_usersSlice_index.sliceName}/logoutUser`, (_, { dispatch, getState }) => {
1987
2002
  if (Object.keys(getState().app.uploadsById).length) return Promise.reject();
@@ -2507,6 +2522,7 @@ exports.changeSsoConfig = changeSsoConfig;
2507
2522
  exports.checkEmailExists = checkEmailExists;
2508
2523
  exports.completeUpgrade = completeUpgrade;
2509
2524
  exports.confirmCardUpdate = confirmCardUpdate;
2525
+ exports.confirmOAuthLink = confirmOAuthLink;
2510
2526
  exports.createArtifact = require_releasesSlice_thunks.createArtifact;
2511
2527
  exports.createBillingProfile = createBillingProfile;
2512
2528
  exports.createDeployment = createDeployment;