@sparkle-learning/core 0.0.64 → 0.0.66

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 (57) hide show
  1. package/dist/cjs/{PrivateRoute-475e69ce.js → PrivateRoute-5587d53f.js} +0 -99
  2. package/dist/cjs/{appdata.service-ab6bfcc8.js → appdata.service-0c34ed2d.js} +4 -4
  3. package/dist/cjs/{assignment.service-690fb59c.js → assignment.service-981b8cb7.js} +2 -2
  4. package/dist/cjs/{httpService-d2e7bf8f.js → auth.service-fa7cd4b6.js} +100 -0
  5. package/dist/cjs/{facilitator.service-ff0e1659.js → facilitator.service-a46828df.js} +7 -7
  6. package/dist/cjs/{feed.service-8eca4de6.js → feed.service-6d8f58e2.js} +4 -4
  7. package/dist/cjs/header-mobile-collapse_61.cjs.entry.js +15 -15
  8. package/dist/cjs/index.cjs.js +3 -3
  9. package/dist/cjs/{media.service-8a1b9bc5.js → media.service-dc1f8cf5.js} +2 -2
  10. package/dist/cjs/sparkle-assignment.cjs.entry.js +3 -3
  11. package/dist/cjs/sparkle-facilitator-notes-form.cjs.entry.js +3 -3
  12. package/dist/cjs/sparkle-feed-post.cjs.entry.js +5 -5
  13. package/dist/cjs/sparkle-feedback.cjs.entry.js +3 -3
  14. package/dist/cjs/sparkle-file-upload.cjs.entry.js +3 -3
  15. package/dist/cjs/sparkle-goal-form.cjs.entry.js +4 -4
  16. package/dist/cjs/{student.service-7e5385be.js → student.service-e8c0a40d.js} +23 -21
  17. package/dist/collection/services/httpService.js +4 -1
  18. package/dist/collection/services/student.service.js +18 -16
  19. package/dist/esm/{PrivateRoute-c83727f9.js → PrivateRoute-7f03b168.js} +1 -99
  20. package/dist/esm/{appdata.service-4497cdd5.js → appdata.service-f4433b21.js} +1 -1
  21. package/dist/esm/{assignment.service-8d31f141.js → assignment.service-5d1d98f6.js} +1 -1
  22. package/dist/esm/{httpService-7986aeed.js → auth.service-16db0809.js} +102 -3
  23. package/dist/esm/{facilitator.service-18c47bdf.js → facilitator.service-dbbc8486.js} +1 -1
  24. package/dist/esm/{feed.service-b4f3cae4.js → feed.service-c6dc6d53.js} +1 -1
  25. package/dist/esm/header-mobile-collapse_61.entry.js +7 -7
  26. package/dist/esm/index.js +2 -2
  27. package/dist/esm/{media.service-6e90bc41.js → media.service-e54a3ffd.js} +1 -1
  28. package/dist/esm/sparkle-assignment.entry.js +3 -3
  29. package/dist/esm/sparkle-facilitator-notes-form.entry.js +3 -3
  30. package/dist/esm/sparkle-feed-post.entry.js +5 -5
  31. package/dist/esm/sparkle-feedback.entry.js +3 -3
  32. package/dist/esm/sparkle-file-upload.entry.js +3 -3
  33. package/dist/esm/sparkle-goal-form.entry.js +4 -4
  34. package/dist/esm/{student.service-08af124f.js → student.service-9b21ffa2.js} +19 -17
  35. package/dist/sparkle-core/index.esm.js +1 -1
  36. package/dist/sparkle-core/{p-38c842d5.entry.js → p-07e8ad22.entry.js} +1 -1
  37. package/dist/sparkle-core/p-1cde83fb.js +1 -0
  38. package/dist/sparkle-core/{p-06ef8fb8.entry.js → p-21af1e9e.entry.js} +4 -4
  39. package/dist/sparkle-core/{p-1adc98f6.js → p-4d470a94.js} +1 -1
  40. package/dist/sparkle-core/{p-b8d71ff4.js → p-4e36890b.js} +1 -1
  41. package/dist/sparkle-core/{p-f47fe1fe.entry.js → p-4ff307cc.entry.js} +1 -1
  42. package/dist/sparkle-core/p-83c39dfc.js +1 -0
  43. package/dist/sparkle-core/{p-4a0ab315.js → p-86774d01.js} +1 -1
  44. package/dist/sparkle-core/{p-517d51cc.entry.js → p-9363c0ff.entry.js} +1 -1
  45. package/dist/sparkle-core/{p-d0687f56.entry.js → p-a1e7c8b9.entry.js} +1 -1
  46. package/dist/sparkle-core/{p-4d1cfcbe.entry.js → p-b6d71c06.entry.js} +1 -1
  47. package/dist/sparkle-core/{p-0e8e539f.entry.js → p-bfc111bf.entry.js} +1 -1
  48. package/dist/sparkle-core/{p-39a31e43.js → p-c0c79958.js} +1 -1
  49. package/dist/sparkle-core/p-dee198ac.js +1 -0
  50. package/dist/sparkle-core/p-fb39c577.js +1 -0
  51. package/dist/sparkle-core/sparkle-core.esm.js +1 -1
  52. package/dist/types/services/student.service.d.ts +1 -1
  53. package/package.json +1 -1
  54. package/dist/sparkle-core/p-4fba3e4c.js +0 -1
  55. package/dist/sparkle-core/p-a6788e13.js +0 -1
  56. package/dist/sparkle-core/p-b06e2bef.js +0 -1
  57. package/dist/sparkle-core/p-c9f753a4.js +0 -1
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const httpService = require('./httpService-d2e7bf8f.js');
3
+ const auth_service = require('./auth.service-fa7cd4b6.js');
4
4
  const auth_store = require('./auth.store-1e630a7d.js');
5
5
 
6
6
  const { state, onChange, reset } = auth_store.createStore({
@@ -28,39 +28,41 @@ class StudentService {
28
28
  return StudentService.instance;
29
29
  }
30
30
  async enrollClass(enrollInput) {
31
- let result = await httpService.HttpService.http.post('api/v1/Student/EnrollClass', enrollInput);
31
+ let result = await auth_service.HttpService.http.post('api/v1/Student/EnrollClass', enrollInput);
32
32
  if (result) {
33
- userStore.state.enrollmentList = [
34
- ...userStore.state.enrollmentList,
35
- result.Data
36
- ];
33
+ userStore.state.enrollmentList = [...userStore.state.enrollmentList, result.Data];
37
34
  }
38
35
  return result;
39
36
  }
40
37
  async leaveClass(leaveInput) {
41
- let result = await httpService.HttpService.http.post('api/v1/Student/LeaveClass', leaveInput);
38
+ let result = await auth_service.HttpService.http.post('api/v1/Student/LeaveClass', leaveInput);
42
39
  if (result) {
43
- userStore.state.enrollmentList = userStore.state.enrollmentList.filter((item) => item.Id != result.Data);
40
+ userStore.state.enrollmentList = userStore.state.enrollmentList.filter(item => item.Id != result.Data);
44
41
  }
45
42
  return result;
46
43
  }
47
44
  async fetchUserConfiguration() {
48
- let result = await httpService.HttpService.http.get('api/v1/Student/UserConfiguration');
49
- if (result) {
50
- userStore.state.enrollmentList = result.Data.EnrollmentList;
51
- userStore.state.user.FirstName = result.Data.FirstName;
52
- userStore.state.user.LastName = result.Data.LastName;
53
- userStore.state.user.ProfileText = result.Data.ProfileText;
54
- userStore.state.user.ProfileImage = result.Data.ProfileImage;
55
- userStore.state.user.IsVerified = result.Data.IsVerified;
56
- userStore.state.user.Roles = result.Data.Roles;
57
- userStore.state.user.FacilitatorClassList = result.Data.FacilitatorClassList;
45
+ try {
46
+ let result = await auth_service.HttpService.http.get('api/v1/Student/UserConfiguration');
47
+ if (result) {
48
+ userStore.state.enrollmentList = result.Data.EnrollmentList;
49
+ userStore.state.user.FirstName = result.Data.FirstName;
50
+ userStore.state.user.LastName = result.Data.LastName;
51
+ userStore.state.user.ProfileText = result.Data.ProfileText;
52
+ userStore.state.user.ProfileImage = result.Data.ProfileImage;
53
+ userStore.state.user.IsVerified = result.Data.IsVerified;
54
+ userStore.state.user.Roles = result.Data.Roles;
55
+ userStore.state.user.FacilitatorClassList = result.Data.FacilitatorClassList;
56
+ }
57
+ return result;
58
+ }
59
+ catch (e) {
60
+ return null;
58
61
  }
59
- return result;
60
62
  }
61
63
  async updateProfile(updateProfileInput) {
62
64
  userStore.state.updateLoading = true;
63
- let result = await httpService.HttpService.http.post('api/Account/update-profile', updateProfileInput);
65
+ let result = await auth_service.HttpService.http.post('api/Account/update-profile', updateProfileInput);
64
66
  console.log('after fetch', result);
65
67
  if (result) {
66
68
  userStore.state.updateLoading = false;
@@ -69,7 +71,7 @@ class StudentService {
69
71
  return result;
70
72
  }
71
73
  async submitFeedback(feedbackInput) {
72
- let result = await httpService.HttpService.http.post('api/v1/Feedback', feedbackInput);
74
+ let result = await auth_service.HttpService.http.post('api/v1/Feedback', feedbackInput);
73
75
  return result;
74
76
  }
75
77
  }
@@ -2,7 +2,7 @@ import axios from 'axios';
2
2
  import qs from 'qs';
3
3
  import { toastController } from '@ionic/core';
4
4
  import { TocStore } from '../stores/toc.store';
5
- import { EnvironmentConfigService } from '.';
5
+ import { AuthService, EnvironmentConfigService } from '.';
6
6
  import { TokenService } from './token.service';
7
7
  export class HttpService {
8
8
  constructor() { }
@@ -53,6 +53,9 @@ export class HttpService {
53
53
  }
54
54
  return response.data.Failed ? null : response.data;
55
55
  }, async (error) => {
56
+ if (error && error.response && error.response.status == 401) {
57
+ await AuthService.getInstance().signOut();
58
+ }
56
59
  if (error.response && error.response.data && error.response.data.ErrorMessage) {
57
60
  // The request was made and the server responded with a status code
58
61
  // that falls out of the range of 2xx
@@ -11,33 +11,35 @@ export class StudentService {
11
11
  async enrollClass(enrollInput) {
12
12
  let result = await HttpService.http.post('api/v1/Student/EnrollClass', enrollInput);
13
13
  if (result) {
14
- userStore.state.enrollmentList = [
15
- ...userStore.state.enrollmentList,
16
- result.Data
17
- ];
14
+ userStore.state.enrollmentList = [...userStore.state.enrollmentList, result.Data];
18
15
  }
19
16
  return result;
20
17
  }
21
18
  async leaveClass(leaveInput) {
22
19
  let result = await HttpService.http.post('api/v1/Student/LeaveClass', leaveInput);
23
20
  if (result) {
24
- userStore.state.enrollmentList = userStore.state.enrollmentList.filter((item) => item.Id != result.Data);
21
+ userStore.state.enrollmentList = userStore.state.enrollmentList.filter(item => item.Id != result.Data);
25
22
  }
26
23
  return result;
27
24
  }
28
25
  async fetchUserConfiguration() {
29
- let result = await HttpService.http.get('api/v1/Student/UserConfiguration');
30
- if (result) {
31
- userStore.state.enrollmentList = result.Data.EnrollmentList;
32
- userStore.state.user.FirstName = result.Data.FirstName;
33
- userStore.state.user.LastName = result.Data.LastName;
34
- userStore.state.user.ProfileText = result.Data.ProfileText;
35
- userStore.state.user.ProfileImage = result.Data.ProfileImage;
36
- userStore.state.user.IsVerified = result.Data.IsVerified;
37
- userStore.state.user.Roles = result.Data.Roles;
38
- userStore.state.user.FacilitatorClassList = result.Data.FacilitatorClassList;
26
+ try {
27
+ let result = await HttpService.http.get('api/v1/Student/UserConfiguration');
28
+ if (result) {
29
+ userStore.state.enrollmentList = result.Data.EnrollmentList;
30
+ userStore.state.user.FirstName = result.Data.FirstName;
31
+ userStore.state.user.LastName = result.Data.LastName;
32
+ userStore.state.user.ProfileText = result.Data.ProfileText;
33
+ userStore.state.user.ProfileImage = result.Data.ProfileImage;
34
+ userStore.state.user.IsVerified = result.Data.IsVerified;
35
+ userStore.state.user.Roles = result.Data.Roles;
36
+ userStore.state.user.FacilitatorClassList = result.Data.FacilitatorClassList;
37
+ }
38
+ return result;
39
+ }
40
+ catch (e) {
41
+ return null;
39
42
  }
40
- return result;
41
43
  }
42
44
  async updateProfile(updateProfileInput) {
43
45
  userStore.state.updateLoading = true;
@@ -1,7 +1,4 @@
1
1
  import { c as getAssetPath, h } from './index-c04b9ed5.js';
2
- import { r as remove, g as get } from './localstorage.service-4bf408c8.js';
3
- import { H as HttpService } from './httpService-7986aeed.js';
4
- import { T as TokenService, A as AppConsts } from './token.service-71a5d33f.js';
5
2
  import { A as AuthStore } from './auth.store-dba2c2da.js';
6
3
 
7
4
  //import * as abpTypings from '../lib/abp';
@@ -120,101 +117,6 @@ async function initSetupConfig(config) {
120
117
  await setupConfig(config);
121
118
  }
122
119
 
123
- class AuthService {
124
- constructor() { }
125
- static getInstance() {
126
- if (!AuthService.instance) {
127
- AuthService.instance = new AuthService();
128
- }
129
- return AuthService.instance;
130
- }
131
- async authenticate(authenticationInput) {
132
- const headers = {
133
- 'Content-Type': 'application/json',
134
- };
135
- AuthStore.state.loading = true;
136
- let result;
137
- try {
138
- result = await HttpService.http.post('api/Account/Authenticate', authenticationInput, {
139
- headers: headers,
140
- });
141
- if (result) {
142
- const authData = result.Data;
143
- const authUser = {
144
- Id: authData.Id,
145
- UserName: authData.UserName,
146
- Email: authData.Email,
147
- Roles: authData.Roles,
148
- IsVerified: authData.IsVerified,
149
- JWToken: authData.JWToken,
150
- IssuedOn: authData.IssuedOn,
151
- ExpiresOn: authData.ExpiresOn,
152
- RefreshToken: authData.RefreshToken,
153
- PhotoUrl: '',
154
- IsFacilitator: authData.Roles.indexOf('Facilitator') > 0,
155
- };
156
- //const expireDate = authenticationInput.RememberClient ? new Date(authUser.ExpiresOn) : undefined;
157
- // let authObj: EnvironmentAuthConfig = {
158
- // token: authUser.JWToken,
159
- // expiryDate: expireDate,
160
- // };
161
- // EnvironmentConfigService.getInstance().setupAuth(authObj);
162
- //sparkle.utils.setCookieValue(AppConsts.authorization.encrptedAuthTokenName, authUser.JWToken, expireDate, sparkle.appPath);
163
- await TokenService.getInstance().saveAuthUser(authUser);
164
- AuthStore.state.loading = false;
165
- return authUser;
166
- }
167
- }
168
- catch (e) {
169
- AuthStore.state.loading = false;
170
- return e;
171
- }
172
- }
173
- async googleAuthenticate(authenticationInput) {
174
- const headers = {
175
- 'Content-Type': 'application/json',
176
- };
177
- AuthStore.state.loading = true;
178
- let result;
179
- try {
180
- result = await HttpService.http.post('api/Account/googleAuthenticate', authenticationInput, {
181
- headers: headers,
182
- });
183
- if (result) {
184
- const authData = result.Data;
185
- const authUser = {
186
- Id: authData.Id,
187
- UserName: authData.UserName,
188
- Email: authData.Email,
189
- Roles: authData.Roles,
190
- IsVerified: authData.IsVerified,
191
- JWToken: authData.JWToken,
192
- IssuedOn: authData.IssuedOn,
193
- ExpiresOn: authData.ExpiresOn,
194
- RefreshToken: authData.RefreshToken,
195
- PhotoUrl: '',
196
- IsFacilitator: authData.Roles.indexOf('Facilitator') > 0,
197
- };
198
- await TokenService.getInstance().saveAuthUser(authUser);
199
- AuthStore.state.loading = false;
200
- return authUser;
201
- }
202
- }
203
- catch (e) {
204
- AuthStore.state.loading = false;
205
- return e;
206
- }
207
- }
208
- async signOut() {
209
- await remove(AppConsts.AUTH_USER_LOCALSTORAGE);
210
- await TokenService.getInstance().removeAuthUser();
211
- sessionStorage.clear();
212
- }
213
- async getLocalAuthUser() {
214
- return get(AppConsts.AUTH_USER_LOCALSTORAGE);
215
- }
216
- }
217
-
218
120
  function isGranted(permissionName) {
219
121
  return sparkle.auth.isGranted(permissionName);
220
122
  }
@@ -244,4 +146,4 @@ const Route = (_a) => {
244
146
  };
245
147
  const PrivateRoute = Route;
246
148
 
247
- export { AuthService as A, PrivateRoute as P, initSetupConfig as i, setupConfig as s };
149
+ export { PrivateRoute as P, initSetupConfig as i, setupConfig as s };
@@ -1,4 +1,4 @@
1
- import { H as HttpService } from './httpService-7986aeed.js';
1
+ import { H as HttpService } from './auth.service-16db0809.js';
2
2
  import { d as createStore } from './auth.store-dba2c2da.js';
3
3
  import { S as SparkleGlobal } from './util-458c62fb.js';
4
4
 
@@ -1,4 +1,4 @@
1
- import { H as HttpService } from './httpService-7986aeed.js';
1
+ import { H as HttpService } from './auth.service-16db0809.js';
2
2
 
3
3
  class AssignmentService {
4
4
  constructor() { }
@@ -1,7 +1,8 @@
1
- import { a as axios_1, u as utils, f as formats, s as sideChannel, T as TocStore } from './auth.store-dba2c2da.js';
1
+ import { r as remove, g as get } from './localstorage.service-4bf408c8.js';
2
+ import { a as axios_1, u as utils, f as formats, s as sideChannel, T as TocStore, A as AuthStore } from './auth.store-dba2c2da.js';
2
3
  import { t as toastController } from './overlays-4233a39d.js';
3
4
  import { E as EnvironmentConfigService } from './environment-config.service-b191f276.js';
4
- import { T as TokenService } from './token.service-71a5d33f.js';
5
+ import { T as TokenService, A as AppConsts } from './token.service-71a5d33f.js';
5
6
 
6
7
  var axios = axios_1;
7
8
 
@@ -633,6 +634,9 @@ class HttpService {
633
634
  }
634
635
  return response.data.Failed ? null : response.data;
635
636
  }, async (error) => {
637
+ if (error && error.response && error.response.status == 401) {
638
+ await AuthService.getInstance().signOut();
639
+ }
636
640
  if (error.response && error.response.data && error.response.data.ErrorMessage) {
637
641
  // The request was made and the server responded with a status code
638
642
  // that falls out of the range of 2xx
@@ -682,4 +686,99 @@ class HttpService {
682
686
  }
683
687
  }
684
688
 
685
- export { HttpService as H };
689
+ class AuthService {
690
+ constructor() { }
691
+ static getInstance() {
692
+ if (!AuthService.instance) {
693
+ AuthService.instance = new AuthService();
694
+ }
695
+ return AuthService.instance;
696
+ }
697
+ async authenticate(authenticationInput) {
698
+ const headers = {
699
+ 'Content-Type': 'application/json',
700
+ };
701
+ AuthStore.state.loading = true;
702
+ let result;
703
+ try {
704
+ result = await HttpService.http.post('api/Account/Authenticate', authenticationInput, {
705
+ headers: headers,
706
+ });
707
+ if (result) {
708
+ const authData = result.Data;
709
+ const authUser = {
710
+ Id: authData.Id,
711
+ UserName: authData.UserName,
712
+ Email: authData.Email,
713
+ Roles: authData.Roles,
714
+ IsVerified: authData.IsVerified,
715
+ JWToken: authData.JWToken,
716
+ IssuedOn: authData.IssuedOn,
717
+ ExpiresOn: authData.ExpiresOn,
718
+ RefreshToken: authData.RefreshToken,
719
+ PhotoUrl: '',
720
+ IsFacilitator: authData.Roles.indexOf('Facilitator') > 0,
721
+ };
722
+ //const expireDate = authenticationInput.RememberClient ? new Date(authUser.ExpiresOn) : undefined;
723
+ // let authObj: EnvironmentAuthConfig = {
724
+ // token: authUser.JWToken,
725
+ // expiryDate: expireDate,
726
+ // };
727
+ // EnvironmentConfigService.getInstance().setupAuth(authObj);
728
+ //sparkle.utils.setCookieValue(AppConsts.authorization.encrptedAuthTokenName, authUser.JWToken, expireDate, sparkle.appPath);
729
+ await TokenService.getInstance().saveAuthUser(authUser);
730
+ AuthStore.state.loading = false;
731
+ return authUser;
732
+ }
733
+ }
734
+ catch (e) {
735
+ AuthStore.state.loading = false;
736
+ return e;
737
+ }
738
+ }
739
+ async googleAuthenticate(authenticationInput) {
740
+ const headers = {
741
+ 'Content-Type': 'application/json',
742
+ };
743
+ AuthStore.state.loading = true;
744
+ let result;
745
+ try {
746
+ result = await HttpService.http.post('api/Account/googleAuthenticate', authenticationInput, {
747
+ headers: headers,
748
+ });
749
+ if (result) {
750
+ const authData = result.Data;
751
+ const authUser = {
752
+ Id: authData.Id,
753
+ UserName: authData.UserName,
754
+ Email: authData.Email,
755
+ Roles: authData.Roles,
756
+ IsVerified: authData.IsVerified,
757
+ JWToken: authData.JWToken,
758
+ IssuedOn: authData.IssuedOn,
759
+ ExpiresOn: authData.ExpiresOn,
760
+ RefreshToken: authData.RefreshToken,
761
+ PhotoUrl: '',
762
+ IsFacilitator: authData.Roles.indexOf('Facilitator') > 0,
763
+ };
764
+ await TokenService.getInstance().saveAuthUser(authUser);
765
+ AuthStore.state.loading = false;
766
+ return authUser;
767
+ }
768
+ }
769
+ catch (e) {
770
+ AuthStore.state.loading = false;
771
+ return e;
772
+ }
773
+ }
774
+ async signOut() {
775
+ await remove(AppConsts.AUTH_USER_LOCALSTORAGE);
776
+ await TokenService.getInstance().removeAuthUser();
777
+ sessionStorage.clear();
778
+ }
779
+ async getLocalAuthUser() {
780
+ return get(AppConsts.AUTH_USER_LOCALSTORAGE);
781
+ }
782
+ }
783
+
784
+ export { AuthService as A, HttpService as H };
@@ -1,4 +1,4 @@
1
- import { H as HttpService } from './httpService-7986aeed.js';
1
+ import { H as HttpService } from './auth.service-16db0809.js';
2
2
  import { d as createStore } from './auth.store-dba2c2da.js';
3
3
 
4
4
  const { state, onChange } = createStore({
@@ -1,4 +1,4 @@
1
- import { H as HttpService } from './httpService-7986aeed.js';
1
+ import { H as HttpService } from './auth.service-16db0809.js';
2
2
  import { d as createStore } from './auth.store-dba2c2da.js';
3
3
 
4
4
  const { state, reset } = createStore({
@@ -9,20 +9,20 @@ import { f as findClosestIonContent, d as disableContentScrollY, r as resetConte
9
9
  import { i as isRTL } from './dir-03012648.js';
10
10
  import { S as SPINNERS } from './spinner-configs-a37e628a.js';
11
11
  import { A as ActiveRouter } from './active-router-fc9e4e06.js';
12
- import { i as initSetupConfig, A as AuthService, P as PrivateRoute, s as setupConfig } from './PrivateRoute-c83727f9.js';
12
+ import { i as initSetupConfig, P as PrivateRoute, s as setupConfig } from './PrivateRoute-7f03b168.js';
13
13
  import { A as AssetsService } from './assets.service-def1d63c.js';
14
14
  import { A as AuthStore, c as createCommonjsModule, g as getDefaultExportFromCjs, b as commonjsGlobal, T as TocStore } from './auth.store-dba2c2da.js';
15
- import { u as userStore, S as StudentService } from './student.service-08af124f.js';
15
+ import { A as AuthService, H as HttpService } from './auth.service-16db0809.js';
16
+ import { u as userStore, S as StudentService } from './student.service-9b21ffa2.js';
16
17
  import { E as EnvironmentConfigService } from './environment-config.service-b191f276.js';
17
18
  import { s as sample, S as SparkleGlobal$1, d as date, M as MyHealthTemplate, a as MyHealthTemplateJSON, b as MyMoodTemplate, c as MyMoodTemplateJSON } from './util-458c62fb.js';
18
- import { F as FacilitatorService, f as facilitatorStore } from './facilitator.service-18c47bdf.js';
19
+ import { F as FacilitatorService, f as facilitatorStore } from './facilitator.service-dbbc8486.js';
19
20
  import { m as menuController } from './index-cded2d87.js';
20
21
  import { m as modalController, a as alertController, t as toastController } from './overlays-4233a39d.js';
21
22
  import { S as SignalRService, s as signalRStore } from './signalR.service-c33fba50.js';
22
- import { H as HttpService } from './httpService-7986aeed.js';
23
- import { A as AppDataService, g as goalStore } from './appdata.service-4497cdd5.js';
24
- import { F as FeedService, f as feedStore } from './feed.service-b4f3cae4.js';
25
- import { M as MediaService, m as mediaStore } from './media.service-6e90bc41.js';
23
+ import { A as AppDataService, g as goalStore } from './appdata.service-f4433b21.js';
24
+ import { F as FeedService, f as feedStore } from './feed.service-c6dc6d53.js';
25
+ import { M as MediaService, m as mediaStore } from './media.service-e54a3ffd.js';
26
26
  import { g as get$1 } from './localstorage.service-4bf408c8.js';
27
27
  import { A as AppConsts } from './token.service-71a5d33f.js';
28
28
  import './hardware-back-button-fa04d6e9.js';
package/dist/esm/index.js CHANGED
@@ -1,10 +1,10 @@
1
- export { A as AuthService, P as PrivateRoute, i as initSetupEnvironmentConfig, s as setupEnvironmentConfig } from './PrivateRoute-c83727f9.js';
1
+ export { P as PrivateRoute, i as initSetupEnvironmentConfig, s as setupEnvironmentConfig } from './PrivateRoute-7f03b168.js';
2
2
  export { E as EnvironmentConfigService } from './environment-config.service-b191f276.js';
3
3
  export { A as AssetsService } from './assets.service-def1d63c.js';
4
+ export { A as AuthService } from './auth.service-16db0809.js';
4
5
  export { A as AuthStore } from './auth.store-dba2c2da.js';
5
6
  import './index-c04b9ed5.js';
6
7
  import './localstorage.service-4bf408c8.js';
7
- import './httpService-7986aeed.js';
8
8
  import './overlays-4233a39d.js';
9
9
  import './ionic-global-4903e23e.js';
10
10
  import './hardware-back-button-fa04d6e9.js';
@@ -1,4 +1,4 @@
1
- import { H as HttpService } from './httpService-7986aeed.js';
1
+ import { H as HttpService } from './auth.service-16db0809.js';
2
2
  import { d as createStore } from './auth.store-dba2c2da.js';
3
3
 
4
4
  const { state, reset } = createStore({
@@ -1,14 +1,14 @@
1
1
  import { r as registerInstance, i as createEvent, h, H as Host, e as getElement } from './index-c04b9ed5.js';
2
- import { A as AssignmentService } from './assignment.service-8d31f141.js';
2
+ import { A as AssignmentService } from './assignment.service-5d1d98f6.js';
3
3
  import { T as TokenService } from './token.service-71a5d33f.js';
4
- import './httpService-7986aeed.js';
4
+ import './auth.service-16db0809.js';
5
+ import './localstorage.service-4bf408c8.js';
5
6
  import './auth.store-dba2c2da.js';
6
7
  import './overlays-4233a39d.js';
7
8
  import './ionic-global-4903e23e.js';
8
9
  import './hardware-back-button-fa04d6e9.js';
9
10
  import './helpers-bf0e23d6.js';
10
11
  import './environment-config.service-b191f276.js';
11
- import './localstorage.service-4bf408c8.js';
12
12
 
13
13
  const sparkleAssignmentCss = ":host{display:block}.assignment-footer-container{display:flex;justify-content:flex-end}.assignment-footer{display:flex;justify-content:space-between;align-items:center}.error{color:red;margin-right:10px}.success{color:green;margin-right:10px}.uploaded-image{display:block;max-height:140px;width:auto !important}";
14
14
 
@@ -1,14 +1,14 @@
1
1
  import { h, r as registerInstance, H as Host, e as getElement } from './index-c04b9ed5.js';
2
2
  import { t as toastController } from './overlays-4233a39d.js';
3
- import { F as FacilitatorService, f as facilitatorStore } from './facilitator.service-18c47bdf.js';
3
+ import { F as FacilitatorService, f as facilitatorStore } from './facilitator.service-dbbc8486.js';
4
4
  import './ionic-global-4903e23e.js';
5
5
  import './hardware-back-button-fa04d6e9.js';
6
6
  import './helpers-bf0e23d6.js';
7
- import './httpService-7986aeed.js';
7
+ import './auth.service-16db0809.js';
8
+ import './localstorage.service-4bf408c8.js';
8
9
  import './auth.store-dba2c2da.js';
9
10
  import './environment-config.service-b191f276.js';
10
11
  import './token.service-71a5d33f.js';
11
- import './localstorage.service-4bf408c8.js';
12
12
 
13
13
  const LoadingSpinner = () => (h("div", { class: "spinner-border", role: "status" }));
14
14
 
@@ -1,17 +1,17 @@
1
1
  import { r as registerInstance, h, H as Host, e as getElement } from './index-c04b9ed5.js';
2
- import { A as AssignmentService } from './assignment.service-8d31f141.js';
3
- import { F as FeedService } from './feed.service-b4f3cae4.js';
4
- import { M as MediaService } from './media.service-6e90bc41.js';
2
+ import { A as AssignmentService } from './assignment.service-5d1d98f6.js';
3
+ import { F as FeedService } from './feed.service-c6dc6d53.js';
4
+ import { M as MediaService } from './media.service-e54a3ffd.js';
5
5
  import { T as TokenService } from './token.service-71a5d33f.js';
6
6
  import { S as SparkleGlobal } from './util-458c62fb.js';
7
- import './httpService-7986aeed.js';
7
+ import './auth.service-16db0809.js';
8
+ import './localstorage.service-4bf408c8.js';
8
9
  import './auth.store-dba2c2da.js';
9
10
  import './overlays-4233a39d.js';
10
11
  import './ionic-global-4903e23e.js';
11
12
  import './hardware-back-button-fa04d6e9.js';
12
13
  import './helpers-bf0e23d6.js';
13
14
  import './environment-config.service-b191f276.js';
14
- import './localstorage.service-4bf408c8.js';
15
15
 
16
16
  const sparkleFeedPostCss = ":host{display:block}.post-footer-container{display:flex;justify-content:flex-end}.post-footer{display:flex;justify-content:space-between;align-items:center}.error{color:red;margin-right:10px}.success{color:green;margin-right:10px}.uploaded-image{display:block;max-height:140px;width:auto !important}.public-post-toggle{display:flex;justify-content:flex-end;align-items:center}.assignment-name{display:none}";
17
17
 
@@ -1,11 +1,11 @@
1
1
  import { r as registerInstance, h, H as Host, e as getElement } from './index-c04b9ed5.js';
2
- import { S as StudentService } from './student.service-08af124f.js';
2
+ import { S as StudentService } from './student.service-9b21ffa2.js';
3
3
  import { t as toastController } from './overlays-4233a39d.js';
4
- import './httpService-7986aeed.js';
4
+ import './auth.service-16db0809.js';
5
+ import './localstorage.service-4bf408c8.js';
5
6
  import './auth.store-dba2c2da.js';
6
7
  import './environment-config.service-b191f276.js';
7
8
  import './token.service-71a5d33f.js';
8
- import './localstorage.service-4bf408c8.js';
9
9
  import './ionic-global-4903e23e.js';
10
10
  import './hardware-back-button-fa04d6e9.js';
11
11
  import './helpers-bf0e23d6.js';
@@ -1,6 +1,7 @@
1
1
  import { r as registerInstance, i as createEvent, h, H as Host, e as getElement } from './index-c04b9ed5.js';
2
- import { M as MediaService } from './media.service-6e90bc41.js';
3
- import './httpService-7986aeed.js';
2
+ import { M as MediaService } from './media.service-e54a3ffd.js';
3
+ import './auth.service-16db0809.js';
4
+ import './localstorage.service-4bf408c8.js';
4
5
  import './auth.store-dba2c2da.js';
5
6
  import './overlays-4233a39d.js';
6
7
  import './ionic-global-4903e23e.js';
@@ -8,7 +9,6 @@ import './hardware-back-button-fa04d6e9.js';
8
9
  import './helpers-bf0e23d6.js';
9
10
  import './environment-config.service-b191f276.js';
10
11
  import './token.service-71a5d33f.js';
11
- import './localstorage.service-4bf408c8.js';
12
12
 
13
13
  const sparkleFileUploadCss = "";
14
14
 
@@ -2,16 +2,16 @@ import { r as registerInstance, h, e as getElement } from './index-c04b9ed5.js';
2
2
  import { S as SparkleGlobal, G as GetGoalAppData, e as MyGoalTemplate, f as MyGoalTemplateJSON } from './util-458c62fb.js';
3
3
  import { E as EnvironmentConfigService } from './environment-config.service-b191f276.js';
4
4
  import { A as AssetsService } from './assets.service-def1d63c.js';
5
- import { A as AppDataService, g as goalStore } from './appdata.service-4497cdd5.js';
6
- import { F as FeedService, f as feedStore } from './feed.service-b4f3cae4.js';
7
- import './httpService-7986aeed.js';
5
+ import { A as AppDataService, g as goalStore } from './appdata.service-f4433b21.js';
6
+ import { F as FeedService, f as feedStore } from './feed.service-c6dc6d53.js';
7
+ import './auth.service-16db0809.js';
8
+ import './localstorage.service-4bf408c8.js';
8
9
  import './auth.store-dba2c2da.js';
9
10
  import './overlays-4233a39d.js';
10
11
  import './ionic-global-4903e23e.js';
11
12
  import './hardware-back-button-fa04d6e9.js';
12
13
  import './helpers-bf0e23d6.js';
13
14
  import './token.service-71a5d33f.js';
14
- import './localstorage.service-4bf408c8.js';
15
15
 
16
16
  const sparkleGoalFormCss = ":host{display:block}";
17
17
 
@@ -1,4 +1,4 @@
1
- import { H as HttpService } from './httpService-7986aeed.js';
1
+ import { H as HttpService } from './auth.service-16db0809.js';
2
2
  import { d as createStore } from './auth.store-dba2c2da.js';
3
3
 
4
4
  const { state, onChange, reset } = createStore({
@@ -28,33 +28,35 @@ class StudentService {
28
28
  async enrollClass(enrollInput) {
29
29
  let result = await HttpService.http.post('api/v1/Student/EnrollClass', enrollInput);
30
30
  if (result) {
31
- userStore.state.enrollmentList = [
32
- ...userStore.state.enrollmentList,
33
- result.Data
34
- ];
31
+ userStore.state.enrollmentList = [...userStore.state.enrollmentList, result.Data];
35
32
  }
36
33
  return result;
37
34
  }
38
35
  async leaveClass(leaveInput) {
39
36
  let result = await HttpService.http.post('api/v1/Student/LeaveClass', leaveInput);
40
37
  if (result) {
41
- userStore.state.enrollmentList = userStore.state.enrollmentList.filter((item) => item.Id != result.Data);
38
+ userStore.state.enrollmentList = userStore.state.enrollmentList.filter(item => item.Id != result.Data);
42
39
  }
43
40
  return result;
44
41
  }
45
42
  async fetchUserConfiguration() {
46
- let result = await HttpService.http.get('api/v1/Student/UserConfiguration');
47
- if (result) {
48
- userStore.state.enrollmentList = result.Data.EnrollmentList;
49
- userStore.state.user.FirstName = result.Data.FirstName;
50
- userStore.state.user.LastName = result.Data.LastName;
51
- userStore.state.user.ProfileText = result.Data.ProfileText;
52
- userStore.state.user.ProfileImage = result.Data.ProfileImage;
53
- userStore.state.user.IsVerified = result.Data.IsVerified;
54
- userStore.state.user.Roles = result.Data.Roles;
55
- userStore.state.user.FacilitatorClassList = result.Data.FacilitatorClassList;
43
+ try {
44
+ let result = await HttpService.http.get('api/v1/Student/UserConfiguration');
45
+ if (result) {
46
+ userStore.state.enrollmentList = result.Data.EnrollmentList;
47
+ userStore.state.user.FirstName = result.Data.FirstName;
48
+ userStore.state.user.LastName = result.Data.LastName;
49
+ userStore.state.user.ProfileText = result.Data.ProfileText;
50
+ userStore.state.user.ProfileImage = result.Data.ProfileImage;
51
+ userStore.state.user.IsVerified = result.Data.IsVerified;
52
+ userStore.state.user.Roles = result.Data.Roles;
53
+ userStore.state.user.FacilitatorClassList = result.Data.FacilitatorClassList;
54
+ }
55
+ return result;
56
+ }
57
+ catch (e) {
58
+ return null;
56
59
  }
57
- return result;
58
60
  }
59
61
  async updateProfile(updateProfileInput) {
60
62
  userStore.state.updateLoading = true;