@sparkle-learning/core 0.0.65 → 0.0.67

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/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/sparkle-intro.cjs.entry.js +1 -1
  17. package/dist/cjs/{student.service-6a085b00.js → student.service-e8c0a40d.js} +6 -6
  18. package/dist/collection/components/sparkle-intro/sparkle-intro.js +1 -1
  19. package/dist/collection/services/httpService.js +4 -1
  20. package/dist/esm/{PrivateRoute-c83727f9.js → PrivateRoute-7f03b168.js} +1 -99
  21. package/dist/esm/{appdata.service-4497cdd5.js → appdata.service-f4433b21.js} +1 -1
  22. package/dist/esm/{assignment.service-8d31f141.js → assignment.service-5d1d98f6.js} +1 -1
  23. package/dist/esm/{httpService-7986aeed.js → auth.service-16db0809.js} +102 -3
  24. package/dist/esm/{facilitator.service-18c47bdf.js → facilitator.service-dbbc8486.js} +1 -1
  25. package/dist/esm/{feed.service-b4f3cae4.js → feed.service-c6dc6d53.js} +1 -1
  26. package/dist/esm/header-mobile-collapse_61.entry.js +7 -7
  27. package/dist/esm/index.js +2 -2
  28. package/dist/esm/{media.service-6e90bc41.js → media.service-e54a3ffd.js} +1 -1
  29. package/dist/esm/sparkle-assignment.entry.js +3 -3
  30. package/dist/esm/sparkle-facilitator-notes-form.entry.js +3 -3
  31. package/dist/esm/sparkle-feed-post.entry.js +5 -5
  32. package/dist/esm/sparkle-feedback.entry.js +3 -3
  33. package/dist/esm/sparkle-file-upload.entry.js +3 -3
  34. package/dist/esm/sparkle-goal-form.entry.js +4 -4
  35. package/dist/esm/sparkle-intro.entry.js +1 -1
  36. package/dist/esm/{student.service-12d66503.js → student.service-9b21ffa2.js} +1 -1
  37. package/dist/sparkle-core/index.esm.js +1 -1
  38. package/dist/sparkle-core/{p-38c842d5.entry.js → p-07e8ad22.entry.js} +1 -1
  39. package/dist/sparkle-core/p-1cde83fb.js +1 -0
  40. package/dist/sparkle-core/{p-5de1651a.entry.js → p-21af1e9e.entry.js} +4 -4
  41. package/dist/sparkle-core/{p-1adc98f6.js → p-4d470a94.js} +1 -1
  42. package/dist/sparkle-core/{p-b8d71ff4.js → p-4e36890b.js} +1 -1
  43. package/dist/sparkle-core/{p-f47fe1fe.entry.js → p-4ff307cc.entry.js} +1 -1
  44. package/dist/sparkle-core/p-83c39dfc.js +1 -0
  45. package/dist/sparkle-core/{p-4a0ab315.js → p-86774d01.js} +1 -1
  46. package/dist/sparkle-core/{p-517d51cc.entry.js → p-9363c0ff.entry.js} +1 -1
  47. package/dist/sparkle-core/{p-d0687f56.entry.js → p-a1e7c8b9.entry.js} +1 -1
  48. package/dist/sparkle-core/{p-5c333142.entry.js → p-b6d71c06.entry.js} +1 -1
  49. package/dist/sparkle-core/p-bf1f4cfb.entry.js +1 -0
  50. package/dist/sparkle-core/{p-0e8e539f.entry.js → p-bfc111bf.entry.js} +1 -1
  51. package/dist/sparkle-core/{p-39a31e43.js → p-c0c79958.js} +1 -1
  52. package/dist/sparkle-core/{p-3d81e425.js → p-dee198ac.js} +1 -1
  53. package/dist/sparkle-core/p-fb39c577.js +1 -0
  54. package/dist/sparkle-core/sparkle-core.esm.js +1 -1
  55. package/package.json +1 -1
  56. package/dist/sparkle-core/p-4fba3e4c.js +0 -1
  57. package/dist/sparkle-core/p-5c435d5a.entry.js +0 -1
  58. package/dist/sparkle-core/p-a6788e13.js +0 -1
  59. package/dist/sparkle-core/p-b06e2bef.js +0 -1
@@ -1,9 +1,6 @@
1
1
  'use strict';
2
2
 
3
3
  const index = require('./index-51e8292e.js');
4
- const localstorage_service = require('./localstorage.service-6346a41d.js');
5
- const httpService = require('./httpService-d2e7bf8f.js');
6
- const token_service = require('./token.service-7a41953d.js');
7
4
  const auth_store = require('./auth.store-1e630a7d.js');
8
5
 
9
6
  //import * as abpTypings from '../lib/abp';
@@ -122,101 +119,6 @@ async function initSetupConfig(config) {
122
119
  await setupConfig(config);
123
120
  }
124
121
 
125
- class AuthService {
126
- constructor() { }
127
- static getInstance() {
128
- if (!AuthService.instance) {
129
- AuthService.instance = new AuthService();
130
- }
131
- return AuthService.instance;
132
- }
133
- async authenticate(authenticationInput) {
134
- const headers = {
135
- 'Content-Type': 'application/json',
136
- };
137
- auth_store.AuthStore.state.loading = true;
138
- let result;
139
- try {
140
- result = await httpService.HttpService.http.post('api/Account/Authenticate', authenticationInput, {
141
- headers: headers,
142
- });
143
- if (result) {
144
- const authData = result.Data;
145
- const authUser = {
146
- Id: authData.Id,
147
- UserName: authData.UserName,
148
- Email: authData.Email,
149
- Roles: authData.Roles,
150
- IsVerified: authData.IsVerified,
151
- JWToken: authData.JWToken,
152
- IssuedOn: authData.IssuedOn,
153
- ExpiresOn: authData.ExpiresOn,
154
- RefreshToken: authData.RefreshToken,
155
- PhotoUrl: '',
156
- IsFacilitator: authData.Roles.indexOf('Facilitator') > 0,
157
- };
158
- //const expireDate = authenticationInput.RememberClient ? new Date(authUser.ExpiresOn) : undefined;
159
- // let authObj: EnvironmentAuthConfig = {
160
- // token: authUser.JWToken,
161
- // expiryDate: expireDate,
162
- // };
163
- // EnvironmentConfigService.getInstance().setupAuth(authObj);
164
- //sparkle.utils.setCookieValue(AppConsts.authorization.encrptedAuthTokenName, authUser.JWToken, expireDate, sparkle.appPath);
165
- await token_service.TokenService.getInstance().saveAuthUser(authUser);
166
- auth_store.AuthStore.state.loading = false;
167
- return authUser;
168
- }
169
- }
170
- catch (e) {
171
- auth_store.AuthStore.state.loading = false;
172
- return e;
173
- }
174
- }
175
- async googleAuthenticate(authenticationInput) {
176
- const headers = {
177
- 'Content-Type': 'application/json',
178
- };
179
- auth_store.AuthStore.state.loading = true;
180
- let result;
181
- try {
182
- result = await httpService.HttpService.http.post('api/Account/googleAuthenticate', authenticationInput, {
183
- headers: headers,
184
- });
185
- if (result) {
186
- const authData = result.Data;
187
- const authUser = {
188
- Id: authData.Id,
189
- UserName: authData.UserName,
190
- Email: authData.Email,
191
- Roles: authData.Roles,
192
- IsVerified: authData.IsVerified,
193
- JWToken: authData.JWToken,
194
- IssuedOn: authData.IssuedOn,
195
- ExpiresOn: authData.ExpiresOn,
196
- RefreshToken: authData.RefreshToken,
197
- PhotoUrl: '',
198
- IsFacilitator: authData.Roles.indexOf('Facilitator') > 0,
199
- };
200
- await token_service.TokenService.getInstance().saveAuthUser(authUser);
201
- auth_store.AuthStore.state.loading = false;
202
- return authUser;
203
- }
204
- }
205
- catch (e) {
206
- auth_store.AuthStore.state.loading = false;
207
- return e;
208
- }
209
- }
210
- async signOut() {
211
- await localstorage_service.remove(token_service.AppConsts.AUTH_USER_LOCALSTORAGE);
212
- await token_service.TokenService.getInstance().removeAuthUser();
213
- sessionStorage.clear();
214
- }
215
- async getLocalAuthUser() {
216
- return localstorage_service.get(token_service.AppConsts.AUTH_USER_LOCALSTORAGE);
217
- }
218
- }
219
-
220
122
  function isGranted(permissionName) {
221
123
  return sparkle.auth.isGranted(permissionName);
222
124
  }
@@ -246,7 +148,6 @@ const Route = (_a) => {
246
148
  };
247
149
  const PrivateRoute = Route;
248
150
 
249
- exports.AuthService = AuthService;
250
151
  exports.PrivateRoute = PrivateRoute;
251
152
  exports.initSetupConfig = initSetupConfig;
252
153
  exports.setupConfig = setupConfig;
@@ -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
  const util = require('./util-9035404f.js');
6
6
 
@@ -20,15 +20,15 @@ class AppDataService {
20
20
  return AppDataService.instance;
21
21
  }
22
22
  async getAllAppData(appId) {
23
- let result = await httpService.HttpService.http.get(`api/v1/AppData/${appId}`);
23
+ let result = await auth_service.HttpService.http.get(`api/v1/AppData/${appId}`);
24
24
  return result;
25
25
  }
26
26
  async createAppData(payload) {
27
- let result = await httpService.HttpService.http.post(`api/v1/AppData/`, payload);
27
+ let result = await auth_service.HttpService.http.post(`api/v1/AppData/`, payload);
28
28
  return result;
29
29
  }
30
30
  async updateAppData(payload) {
31
- let result = await httpService.HttpService.http.put(`api/v1/AppData/${payload.Id}`, payload);
31
+ let result = await auth_service.HttpService.http.put(`api/v1/AppData/${payload.Id}`, payload);
32
32
  return result;
33
33
  }
34
34
  async getAllGoals() {
@@ -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
 
5
5
  class AssignmentService {
6
6
  constructor() { }
@@ -11,7 +11,7 @@ class AssignmentService {
11
11
  return AssignmentService.instance;
12
12
  }
13
13
  async createAssignment(payload) {
14
- let result = await httpService.HttpService.http.post(`api/v1/Assignment/Create`, payload);
14
+ let result = await auth_service.HttpService.http.post(`api/v1/Assignment/Create`, payload);
15
15
  return result;
16
16
  }
17
17
  }
@@ -1,5 +1,6 @@
1
1
  'use strict';
2
2
 
3
+ const localstorage_service = require('./localstorage.service-6346a41d.js');
3
4
  const auth_store = require('./auth.store-1e630a7d.js');
4
5
  const overlays = require('./overlays-32df265a.js');
5
6
  const environmentConfig_service = require('./environment-config.service-c8ff1f3d.js');
@@ -635,6 +636,9 @@ class HttpService {
635
636
  }
636
637
  return response.data.Failed ? null : response.data;
637
638
  }, async (error) => {
639
+ if (error && error.response && error.response.status == 401) {
640
+ await AuthService.getInstance().signOut();
641
+ }
638
642
  if (error.response && error.response.data && error.response.data.ErrorMessage) {
639
643
  // The request was made and the server responded with a status code
640
644
  // that falls out of the range of 2xx
@@ -684,4 +688,100 @@ class HttpService {
684
688
  }
685
689
  }
686
690
 
691
+ class AuthService {
692
+ constructor() { }
693
+ static getInstance() {
694
+ if (!AuthService.instance) {
695
+ AuthService.instance = new AuthService();
696
+ }
697
+ return AuthService.instance;
698
+ }
699
+ async authenticate(authenticationInput) {
700
+ const headers = {
701
+ 'Content-Type': 'application/json',
702
+ };
703
+ auth_store.AuthStore.state.loading = true;
704
+ let result;
705
+ try {
706
+ result = await HttpService.http.post('api/Account/Authenticate', authenticationInput, {
707
+ headers: headers,
708
+ });
709
+ if (result) {
710
+ const authData = result.Data;
711
+ const authUser = {
712
+ Id: authData.Id,
713
+ UserName: authData.UserName,
714
+ Email: authData.Email,
715
+ Roles: authData.Roles,
716
+ IsVerified: authData.IsVerified,
717
+ JWToken: authData.JWToken,
718
+ IssuedOn: authData.IssuedOn,
719
+ ExpiresOn: authData.ExpiresOn,
720
+ RefreshToken: authData.RefreshToken,
721
+ PhotoUrl: '',
722
+ IsFacilitator: authData.Roles.indexOf('Facilitator') > 0,
723
+ };
724
+ //const expireDate = authenticationInput.RememberClient ? new Date(authUser.ExpiresOn) : undefined;
725
+ // let authObj: EnvironmentAuthConfig = {
726
+ // token: authUser.JWToken,
727
+ // expiryDate: expireDate,
728
+ // };
729
+ // EnvironmentConfigService.getInstance().setupAuth(authObj);
730
+ //sparkle.utils.setCookieValue(AppConsts.authorization.encrptedAuthTokenName, authUser.JWToken, expireDate, sparkle.appPath);
731
+ await token_service.TokenService.getInstance().saveAuthUser(authUser);
732
+ auth_store.AuthStore.state.loading = false;
733
+ return authUser;
734
+ }
735
+ }
736
+ catch (e) {
737
+ auth_store.AuthStore.state.loading = false;
738
+ return e;
739
+ }
740
+ }
741
+ async googleAuthenticate(authenticationInput) {
742
+ const headers = {
743
+ 'Content-Type': 'application/json',
744
+ };
745
+ auth_store.AuthStore.state.loading = true;
746
+ let result;
747
+ try {
748
+ result = await HttpService.http.post('api/Account/googleAuthenticate', authenticationInput, {
749
+ headers: headers,
750
+ });
751
+ if (result) {
752
+ const authData = result.Data;
753
+ const authUser = {
754
+ Id: authData.Id,
755
+ UserName: authData.UserName,
756
+ Email: authData.Email,
757
+ Roles: authData.Roles,
758
+ IsVerified: authData.IsVerified,
759
+ JWToken: authData.JWToken,
760
+ IssuedOn: authData.IssuedOn,
761
+ ExpiresOn: authData.ExpiresOn,
762
+ RefreshToken: authData.RefreshToken,
763
+ PhotoUrl: '',
764
+ IsFacilitator: authData.Roles.indexOf('Facilitator') > 0,
765
+ };
766
+ await token_service.TokenService.getInstance().saveAuthUser(authUser);
767
+ auth_store.AuthStore.state.loading = false;
768
+ return authUser;
769
+ }
770
+ }
771
+ catch (e) {
772
+ auth_store.AuthStore.state.loading = false;
773
+ return e;
774
+ }
775
+ }
776
+ async signOut() {
777
+ await localstorage_service.remove(token_service.AppConsts.AUTH_USER_LOCALSTORAGE);
778
+ await token_service.TokenService.getInstance().removeAuthUser();
779
+ sessionStorage.clear();
780
+ }
781
+ async getLocalAuthUser() {
782
+ return localstorage_service.get(token_service.AppConsts.AUTH_USER_LOCALSTORAGE);
783
+ }
784
+ }
785
+
786
+ exports.AuthService = AuthService;
687
787
  exports.HttpService = HttpService;
@@ -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 } = auth_store.createStore({
@@ -27,7 +27,7 @@ class FacilitatorService {
27
27
  }
28
28
  async fetchClasses() {
29
29
  facilitatorStore.state.classesLoading = true;
30
- let result = await httpService.HttpService.http.get(`api/v1/Teacher/Classes`);
30
+ let result = await auth_service.HttpService.http.get(`api/v1/Teacher/Classes`);
31
31
  if (result) {
32
32
  facilitatorStore.state.classes = result.Data;
33
33
  facilitatorStore.state.classesLoading = false;
@@ -36,7 +36,7 @@ class FacilitatorService {
36
36
  }
37
37
  async fetchDashboardData(payload) {
38
38
  facilitatorStore.state.dashboardDataLoading = true;
39
- let result = await httpService.HttpService.http.get(`api/v1/Teacher/Dashboard/${payload.ClassId}`);
39
+ let result = await auth_service.HttpService.http.get(`api/v1/Teacher/Dashboard/${payload.ClassId}`);
40
40
  if (result) {
41
41
  facilitatorStore.state.dashboardData = result.Data;
42
42
  facilitatorStore.state.dashboardDataLoading = false;
@@ -45,7 +45,7 @@ class FacilitatorService {
45
45
  }
46
46
  async fetchNotes(payload) {
47
47
  facilitatorStore.state.notesLoading = true;
48
- let result = await httpService.HttpService.http.get(`api/v1/Teacher/Notes/${payload.showAllNotes}`);
48
+ let result = await auth_service.HttpService.http.get(`api/v1/Teacher/Notes/${payload.showAllNotes}`);
49
49
  if (result) {
50
50
  if (payload.showAllNotes) {
51
51
  facilitatorStore.state.allPageNotes = result.Data;
@@ -59,7 +59,7 @@ class FacilitatorService {
59
59
  }
60
60
  async addFacilitatorNote(payload) {
61
61
  facilitatorStore.state.notesLoading = true;
62
- let result = await httpService.HttpService.http.post(`api/v1/Teacher/Notes`, payload);
62
+ let result = await auth_service.HttpService.http.post(`api/v1/Teacher/Notes`, payload);
63
63
  if (result) {
64
64
  facilitatorStore.state.pageNotes = [...facilitatorStore.state.pageNotes, result.Data];
65
65
  }
@@ -68,7 +68,7 @@ class FacilitatorService {
68
68
  }
69
69
  async updateFacilitatorNote(payload) {
70
70
  facilitatorStore.state.notesLoading = true;
71
- let result = await httpService.HttpService.http.put(`api/v1/Teacher/Notes/${payload.Id}`, payload);
71
+ let result = await auth_service.HttpService.http.put(`api/v1/Teacher/Notes/${payload.Id}`, payload);
72
72
  if (result) {
73
73
  facilitatorStore.state.pageNotes = facilitatorStore.state.pageNotes.map((item) => {
74
74
  if (item.Id == result.Data.Id) {
@@ -82,7 +82,7 @@ class FacilitatorService {
82
82
  }
83
83
  async deleteFacilitatorNote(id) {
84
84
  facilitatorStore.state.notesLoading = true;
85
- let result = await httpService.HttpService.http.delete(`api/v1/Teacher/Notes/${id}`);
85
+ let result = await auth_service.HttpService.http.delete(`api/v1/Teacher/Notes/${id}`);
86
86
  if (result) {
87
87
  facilitatorStore.state.pageNotes = facilitatorStore.state.pageNotes.filter(x => x.Id != id);
88
88
  }
@@ -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, reset } = auth_store.createStore({
@@ -21,7 +21,7 @@ class FeedService {
21
21
  }
22
22
  async getAllPosts() {
23
23
  feedStore.state.postsLoading = true;
24
- let result = await httpService.HttpService.http.get(`api/v1/Feed/GetAll`);
24
+ let result = await auth_service.HttpService.http.get(`api/v1/Feed/GetAll`);
25
25
  if (result) {
26
26
  feedStore.state.posts = result.Data;
27
27
  feedStore.state.postsLoading = false;
@@ -30,7 +30,7 @@ class FeedService {
30
30
  }
31
31
  async createPost(payload) {
32
32
  feedStore.state.createPostLoading = true;
33
- let result = await httpService.HttpService.http.post(`api/v1/Feed/PostFeed`, payload);
33
+ let result = await auth_service.HttpService.http.post(`api/v1/Feed/PostFeed`, payload);
34
34
  if (result) {
35
35
  feedStore.state.posts = [result.Data, ...feedStore.state.posts];
36
36
  feedStore.state.createPostLoading = false;
@@ -39,7 +39,7 @@ class FeedService {
39
39
  }
40
40
  async createPostComment(payload) {
41
41
  feedStore.state.postIdLoading = payload.PostId;
42
- let result = await httpService.HttpService.http.post(`api/v1/Feed/Comment`, payload);
42
+ let result = await auth_service.HttpService.http.post(`api/v1/Feed/Comment`, payload);
43
43
  if (result) {
44
44
  feedStore.state.posts = feedStore.state.posts.map((item) => {
45
45
  if (item.Id == result.Data.ClassFeedPostId) {
@@ -13,20 +13,20 @@ const index$3 = require('./index-9c7b27e4.js');
13
13
  const dir = require('./dir-5af5259a.js');
14
14
  const spinnerConfigs = require('./spinner-configs-0ac05f2d.js');
15
15
  const activeRouter = require('./active-router-f9e18bd8.js');
16
- const PrivateRoute = require('./PrivateRoute-475e69ce.js');
16
+ const PrivateRoute = require('./PrivateRoute-5587d53f.js');
17
17
  const assets_service = require('./assets.service-bfa75092.js');
18
18
  const auth_store = require('./auth.store-1e630a7d.js');
19
- const student_service = require('./student.service-6a085b00.js');
19
+ const auth_service = require('./auth.service-fa7cd4b6.js');
20
+ const student_service = require('./student.service-e8c0a40d.js');
20
21
  const environmentConfig_service = require('./environment-config.service-c8ff1f3d.js');
21
22
  const util = require('./util-9035404f.js');
22
- const facilitator_service = require('./facilitator.service-ff0e1659.js');
23
+ const facilitator_service = require('./facilitator.service-a46828df.js');
23
24
  const index$4 = require('./index-15ea05f5.js');
24
25
  const overlays = require('./overlays-32df265a.js');
25
26
  const signalR_service = require('./signalR.service-bd6b42f9.js');
26
- const httpService = require('./httpService-d2e7bf8f.js');
27
- const appdata_service = require('./appdata.service-ab6bfcc8.js');
28
- const feed_service = require('./feed.service-8eca4de6.js');
29
- const media_service = require('./media.service-8a1b9bc5.js');
27
+ const appdata_service = require('./appdata.service-0c34ed2d.js');
28
+ const feed_service = require('./feed.service-6d8f58e2.js');
29
+ const media_service = require('./media.service-dc1f8cf5.js');
30
30
  const localstorage_service = require('./localstorage.service-6346a41d.js');
31
31
  const token_service = require('./token.service-7a41953d.js');
32
32
  require('./hardware-back-button-92d97ff8.js');
@@ -3146,7 +3146,7 @@ const SparkleCourseRoot = class {
3146
3146
  ];
3147
3147
  }
3148
3148
  async signout() {
3149
- await PrivateRoute.AuthService.getInstance().signOut();
3149
+ await auth_service.AuthService.getInstance().signOut();
3150
3150
  this.history.replace('/login', {});
3151
3151
  }
3152
3152
  renderLogo() {
@@ -12688,7 +12688,7 @@ class AccountService {
12688
12688
  auth_store.AuthStore.state.loading = true;
12689
12689
  let result;
12690
12690
  try {
12691
- result = await httpService.HttpService.http.post('api/Account/Register', registerInput, {
12691
+ result = await auth_service.HttpService.http.post('api/Account/Register', registerInput, {
12692
12692
  headers: headers
12693
12693
  });
12694
12694
  if (result.Succeeded) {
@@ -12705,7 +12705,7 @@ class AccountService {
12705
12705
  auth_store.AuthStore.state.loading = true;
12706
12706
  let result;
12707
12707
  try {
12708
- result = await httpService.HttpService.http.post('api/Account/Forgot-Password', forgotPasswordInput);
12708
+ result = await auth_service.HttpService.http.post('api/Account/Forgot-Password', forgotPasswordInput);
12709
12709
  if (result.Succeeded) {
12710
12710
  auth_store.AuthStore.state.loading = false;
12711
12711
  }
@@ -12720,7 +12720,7 @@ class AccountService {
12720
12720
  auth_store.AuthStore.state.loading = true;
12721
12721
  let result;
12722
12722
  try {
12723
- result = await httpService.HttpService.http.post('api/Account/reset-password', resetPasswordInput);
12723
+ result = await auth_service.HttpService.http.post('api/Account/reset-password', resetPasswordInput);
12724
12724
  if (result.Succeeded) {
12725
12725
  auth_store.AuthStore.state.loading = false;
12726
12726
  }
@@ -13079,7 +13079,7 @@ const PageLogin = class {
13079
13079
  this.googleLoading = true;
13080
13080
  console.log(response);
13081
13081
  if (response.credential) {
13082
- let result = await PrivateRoute.AuthService.getInstance().googleAuthenticate({
13082
+ let result = await auth_service.AuthService.getInstance().googleAuthenticate({
13083
13083
  IdToken: response.credential,
13084
13084
  });
13085
13085
  console.log(result);
@@ -13154,7 +13154,7 @@ const PageLogin = class {
13154
13154
  this.submitted = true;
13155
13155
  if (this.password.valid && this.username.valid) {
13156
13156
  //await UserData.login(this.username.value);
13157
- let result = await PrivateRoute.AuthService.getInstance().authenticate({
13157
+ let result = await auth_service.AuthService.getInstance().authenticate({
13158
13158
  Email: this.username.value,
13159
13159
  Password: this.password.value,
13160
13160
  RememberClient: this.rememberMe.value,
@@ -13803,8 +13803,8 @@ const SparkleRoot = class {
13803
13803
  sparkle: Object.assign(Object.assign({}, this.config), { prod: true }),
13804
13804
  });
13805
13805
  //return Promise.reject();
13806
- await httpService.HttpService.getInstance();
13807
- await httpService.HttpService.init();
13806
+ await auth_service.HttpService.getInstance();
13807
+ await auth_service.HttpService.init();
13808
13808
  let auth = await localstorage_service.get(token_service.AppConsts.AUTH_USER_LOCALSTORAGE);
13809
13809
  console.log(auth);
13810
13810
  //TODO: check expiry as well
@@ -2,13 +2,13 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const PrivateRoute = require('./PrivateRoute-475e69ce.js');
5
+ const PrivateRoute = require('./PrivateRoute-5587d53f.js');
6
6
  const environmentConfig_service = require('./environment-config.service-c8ff1f3d.js');
7
7
  const assets_service = require('./assets.service-bfa75092.js');
8
+ const auth_service = require('./auth.service-fa7cd4b6.js');
8
9
  const auth_store = require('./auth.store-1e630a7d.js');
9
10
  require('./index-51e8292e.js');
10
11
  require('./localstorage.service-6346a41d.js');
11
- require('./httpService-d2e7bf8f.js');
12
12
  require('./overlays-32df265a.js');
13
13
  require('./ionic-global-2cde9d3a.js');
14
14
  require('./hardware-back-button-92d97ff8.js');
@@ -17,10 +17,10 @@ require('./token.service-7a41953d.js');
17
17
 
18
18
 
19
19
 
20
- exports.AuthService = PrivateRoute.AuthService;
21
20
  exports.PrivateRoute = PrivateRoute.PrivateRoute;
22
21
  exports.initSetupEnvironmentConfig = PrivateRoute.initSetupConfig;
23
22
  exports.setupEnvironmentConfig = PrivateRoute.setupConfig;
24
23
  exports.EnvironmentConfigService = environmentConfig_service.EnvironmentConfigService;
25
24
  exports.AssetsService = assets_service.AssetsService;
25
+ exports.AuthService = auth_service.AuthService;
26
26
  exports.AuthStore = auth_store.AuthStore;
@@ -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, reset } = auth_store.createStore({
@@ -24,7 +24,7 @@ class MediaService {
24
24
  mediaStore.state.mediaUploading = true;
25
25
  let result;
26
26
  try {
27
- result = await httpService.HttpService.http.post(`api/v1/MediaItems/Upload`, formData);
27
+ result = await auth_service.HttpService.http.post(`api/v1/MediaItems/Upload`, formData);
28
28
  if (result) {
29
29
  mediaStore.state.mediaUploading = false;
30
30
  }
@@ -3,16 +3,16 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-51e8292e.js');
6
- const assignment_service = require('./assignment.service-690fb59c.js');
6
+ const assignment_service = require('./assignment.service-981b8cb7.js');
7
7
  const token_service = require('./token.service-7a41953d.js');
8
- require('./httpService-d2e7bf8f.js');
8
+ require('./auth.service-fa7cd4b6.js');
9
+ require('./localstorage.service-6346a41d.js');
9
10
  require('./auth.store-1e630a7d.js');
10
11
  require('./overlays-32df265a.js');
11
12
  require('./ionic-global-2cde9d3a.js');
12
13
  require('./hardware-back-button-92d97ff8.js');
13
14
  require('./helpers-c2496722.js');
14
15
  require('./environment-config.service-c8ff1f3d.js');
15
- require('./localstorage.service-6346a41d.js');
16
16
 
17
17
  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}";
18
18
 
@@ -4,15 +4,15 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-51e8292e.js');
6
6
  const overlays = require('./overlays-32df265a.js');
7
- const facilitator_service = require('./facilitator.service-ff0e1659.js');
7
+ const facilitator_service = require('./facilitator.service-a46828df.js');
8
8
  require('./ionic-global-2cde9d3a.js');
9
9
  require('./hardware-back-button-92d97ff8.js');
10
10
  require('./helpers-c2496722.js');
11
- require('./httpService-d2e7bf8f.js');
11
+ require('./auth.service-fa7cd4b6.js');
12
+ require('./localstorage.service-6346a41d.js');
12
13
  require('./auth.store-1e630a7d.js');
13
14
  require('./environment-config.service-c8ff1f3d.js');
14
15
  require('./token.service-7a41953d.js');
15
- require('./localstorage.service-6346a41d.js');
16
16
 
17
17
  const LoadingSpinner = () => (index.h("div", { class: "spinner-border", role: "status" }));
18
18
 
@@ -3,19 +3,19 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-51e8292e.js');
6
- const assignment_service = require('./assignment.service-690fb59c.js');
7
- const feed_service = require('./feed.service-8eca4de6.js');
8
- const media_service = require('./media.service-8a1b9bc5.js');
6
+ const assignment_service = require('./assignment.service-981b8cb7.js');
7
+ const feed_service = require('./feed.service-6d8f58e2.js');
8
+ const media_service = require('./media.service-dc1f8cf5.js');
9
9
  const token_service = require('./token.service-7a41953d.js');
10
10
  const util = require('./util-9035404f.js');
11
- require('./httpService-d2e7bf8f.js');
11
+ require('./auth.service-fa7cd4b6.js');
12
+ require('./localstorage.service-6346a41d.js');
12
13
  require('./auth.store-1e630a7d.js');
13
14
  require('./overlays-32df265a.js');
14
15
  require('./ionic-global-2cde9d3a.js');
15
16
  require('./hardware-back-button-92d97ff8.js');
16
17
  require('./helpers-c2496722.js');
17
18
  require('./environment-config.service-c8ff1f3d.js');
18
- require('./localstorage.service-6346a41d.js');
19
19
 
20
20
  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}";
21
21
 
@@ -3,13 +3,13 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-51e8292e.js');
6
- const student_service = require('./student.service-6a085b00.js');
6
+ const student_service = require('./student.service-e8c0a40d.js');
7
7
  const overlays = require('./overlays-32df265a.js');
8
- require('./httpService-d2e7bf8f.js');
8
+ require('./auth.service-fa7cd4b6.js');
9
+ require('./localstorage.service-6346a41d.js');
9
10
  require('./auth.store-1e630a7d.js');
10
11
  require('./environment-config.service-c8ff1f3d.js');
11
12
  require('./token.service-7a41953d.js');
12
- require('./localstorage.service-6346a41d.js');
13
13
  require('./ionic-global-2cde9d3a.js');
14
14
  require('./hardware-back-button-92d97ff8.js');
15
15
  require('./helpers-c2496722.js');
@@ -3,8 +3,9 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-51e8292e.js');
6
- const media_service = require('./media.service-8a1b9bc5.js');
7
- require('./httpService-d2e7bf8f.js');
6
+ const media_service = require('./media.service-dc1f8cf5.js');
7
+ require('./auth.service-fa7cd4b6.js');
8
+ require('./localstorage.service-6346a41d.js');
8
9
  require('./auth.store-1e630a7d.js');
9
10
  require('./overlays-32df265a.js');
10
11
  require('./ionic-global-2cde9d3a.js');
@@ -12,7 +13,6 @@ require('./hardware-back-button-92d97ff8.js');
12
13
  require('./helpers-c2496722.js');
13
14
  require('./environment-config.service-c8ff1f3d.js');
14
15
  require('./token.service-7a41953d.js');
15
- require('./localstorage.service-6346a41d.js');
16
16
 
17
17
  const sparkleFileUploadCss = "";
18
18
 
@@ -6,16 +6,16 @@ const index = require('./index-51e8292e.js');
6
6
  const util = require('./util-9035404f.js');
7
7
  const environmentConfig_service = require('./environment-config.service-c8ff1f3d.js');
8
8
  const assets_service = require('./assets.service-bfa75092.js');
9
- const appdata_service = require('./appdata.service-ab6bfcc8.js');
10
- const feed_service = require('./feed.service-8eca4de6.js');
11
- require('./httpService-d2e7bf8f.js');
9
+ const appdata_service = require('./appdata.service-0c34ed2d.js');
10
+ const feed_service = require('./feed.service-6d8f58e2.js');
11
+ require('./auth.service-fa7cd4b6.js');
12
+ require('./localstorage.service-6346a41d.js');
12
13
  require('./auth.store-1e630a7d.js');
13
14
  require('./overlays-32df265a.js');
14
15
  require('./ionic-global-2cde9d3a.js');
15
16
  require('./hardware-back-button-92d97ff8.js');
16
17
  require('./helpers-c2496722.js');
17
18
  require('./token.service-7a41953d.js');
18
- require('./localstorage.service-6346a41d.js');
19
19
 
20
20
  const sparkleGoalFormCss = ":host{display:block}";
21
21