@abgov/nx-adsp 12.8.0-beta.7 → 12.8.0-beta.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/nx-adsp",
3
- "version": "12.8.0-beta.7",
3
+ "version": "12.8.0-beta.8",
4
4
  "license": "Apache-2.0",
5
5
  "main": "src/index.js",
6
6
  "description": "Government of Alberta - Nx plugin for ADSP apps.",
@@ -12,7 +12,7 @@ export const initializeConfig = createAsyncThunk(
12
12
  'config/initialize',
13
13
  async (environment?: Record<string, unknown>) => {
14
14
  // Initialize state with environment and ADSP directory of services.
15
- const directoryUrl = environment?.directory?.['url'];
15
+ const directoryUrl = (environment?.directory as Record<string, string> | undefined)?.['url'];
16
16
 
17
17
  let directory: Record<string, string> = {};
18
18
  if (directoryUrl) {
@@ -56,7 +56,7 @@ const configSlice = createSlice({
56
56
  reducers: {},
57
57
  extraReducers: (builder) => {
58
58
  builder.addCase(initializeConfig.fulfilled, (state, { payload }) => {
59
- state.environment = payload.environment;
59
+ state.environment = payload.environment ?? {};
60
60
  state.directory = payload.directory;
61
61
  state.initialized = true;
62
62
  });
@@ -9,7 +9,7 @@ export interface IntakeState {
9
9
 
10
10
  export const initialIntakeState: IntakeState = {
11
11
  loadingStatus: 'not loaded',
12
- error: null,
12
+ error: '',
13
13
  };
14
14
 
15
15
  const intakeSlice = createSlice({
@@ -40,10 +40,10 @@ export const fetchPrivateResource = createAsyncThunk(
40
40
  );
41
41
 
42
42
  export const initialStartState: StartState = {
43
- apiPublicMessage: null,
44
- apiPrivateMessage: null,
43
+ apiPublicMessage: '',
44
+ apiPrivateMessage: '',
45
45
  loadingStatus: 'not loaded',
46
- error: null,
46
+ error: '',
47
47
  };
48
48
 
49
49
  export const startReducer = createReducer(initialStartState, (builder) => {
@@ -60,7 +60,7 @@ export const startReducer = createReducer(initialStartState, (builder) => {
60
60
  )
61
61
  .addCase(fetchPublicResource.rejected, (state: StartState, action) => {
62
62
  state.loadingStatus = 'error';
63
- state.error = action.error.message;
63
+ state.error = action.error.message ?? '';
64
64
  })
65
65
  .addCase(fetchPrivateResource.pending, (state: StartState) => {
66
66
  state.loadingStatus = 'loading';
@@ -74,16 +74,16 @@ export const startReducer = createReducer(initialStartState, (builder) => {
74
74
  )
75
75
  .addCase(fetchPrivateResource.rejected, (state: StartState, action) => {
76
76
  state.loadingStatus = 'error';
77
- state.error = action.error.message;
77
+ state.error = action.error.message ?? '';
78
78
  });
79
79
  });
80
80
 
81
81
  export const publicResourceSelector = createSelector(
82
- (state: unknown): StartState => state[START_FEATURE_KEY],
82
+ (state: { [START_FEATURE_KEY]: StartState }) => state[START_FEATURE_KEY],
83
83
  (start) => start.apiPublicMessage
84
84
  );
85
85
 
86
86
  export const privateResourceSelector = createSelector(
87
- (state: unknown): StartState => state[START_FEATURE_KEY],
87
+ (state: { [START_FEATURE_KEY]: StartState }) => state[START_FEATURE_KEY],
88
88
  (start) => start.apiPrivateMessage
89
89
  );
@@ -48,7 +48,7 @@ export const logoutUser = createAsyncThunk('user/logout', async () => {
48
48
 
49
49
  export async function getAccessToken(): Promise<string> {
50
50
  await keycloak.updateToken(30);
51
- return keycloak.token;
51
+ return keycloak.token as string;
52
52
  }
53
53
 
54
54
  const userSlice = createSlice({