@universis/evaluations 1.0.26 → 1.0.28

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 (32) hide show
  1. package/dist/config/models/ClassInstructorEvaluationEvent.json +1 -1
  2. package/dist/config/models/CourseClassEvaluationEvent.json +89 -4
  3. package/dist/config/models/EvaluationAccessToken.json +19 -1
  4. package/dist/config/models/EvaluationDocument.json +17 -1
  5. package/dist/config/models/EvaluationEvent.json +13 -0
  6. package/dist/config/models/GenerateCourseClassTokenAction.json +57 -0
  7. package/dist/config/models/SendCourseClassTokenAction.json +52 -0
  8. package/dist/listeners/access-token-listener.js +76 -0
  9. package/dist/listeners/access-token-listener.js.map +1 -0
  10. package/dist/listeners/class-event-listener.js +184 -0
  11. package/dist/listeners/class-event-listener.js.map +1 -0
  12. package/dist/locales/el.json +3 -1
  13. package/dist/models/class-instructor-evaluation-event-model.js +1 -5
  14. package/dist/models/class-instructor-evaluation-event-model.js.map +1 -1
  15. package/dist/models/course-class-evaluation-event-model.js +340 -0
  16. package/dist/models/course-class-evaluation-event-model.js.map +1 -0
  17. package/dist/models/evaluation-event-model.js +156 -10
  18. package/dist/models/evaluation-event-model.js.map +1 -1
  19. package/package.json +1 -1
  20. package/src/config/models/ClassInstructorEvaluationEvent.json +1 -1
  21. package/src/config/models/CourseClassEvaluationEvent.json +89 -4
  22. package/src/config/models/EvaluationAccessToken.json +19 -1
  23. package/src/config/models/EvaluationDocument.json +17 -1
  24. package/src/config/models/EvaluationEvent.json +13 -0
  25. package/src/config/models/GenerateCourseClassTokenAction.json +57 -0
  26. package/src/config/models/SendCourseClassTokenAction.json +52 -0
  27. package/src/listeners/access-token-listener.js +75 -0
  28. package/src/listeners/class-event-listener.js +183 -0
  29. package/src/locales/el.json +3 -1
  30. package/src/models/class-instructor-evaluation-event-model.js +1 -5
  31. package/src/models/course-class-evaluation-event-model.js +339 -0
  32. package/src/models/evaluation-event-model.js +159 -13
@@ -7,6 +7,7 @@
7
7
  "sealed": false,
8
8
  "inherits": "EvaluationEvent",
9
9
  "version": "1.0",
10
+ "classPath": "./models/course-class-evaluation-event-model",
10
11
  "fields": [
11
12
  {
12
13
  "@id": "http://schema.org/courseClass",
@@ -22,6 +23,55 @@
22
23
  "description": "An organizer of an Event.",
23
24
  "type": "Department",
24
25
  "nullable": false
26
+ },
27
+ {
28
+ "name": "tokens",
29
+ "title": "Evaluation tokens",
30
+ "type": "EvaluationAccessToken",
31
+ "many": true,
32
+ "mapping": {
33
+ "parentModel": "CourseClassEvaluationEvent",
34
+ "childModel": "EvaluationAccessToken",
35
+ "parentField": "id",
36
+ "childField": "evaluationEvent",
37
+ "cascade": "delete",
38
+ "associationType": "association"
39
+ }
40
+ },
41
+ {
42
+ "name": "actions",
43
+ "title": "Generate token actions",
44
+ "type": "GenerateTokenAction",
45
+ "many": true,
46
+ "mapping": {
47
+ "parentModel": "CourseClassEvaluationEvent",
48
+ "childModel": "GenerateCourseClassTokenAction",
49
+ "parentField": "id",
50
+ "childField": "event",
51
+ "cascade": "delete",
52
+ "associationType": "association"
53
+ }
54
+ },
55
+ {
56
+ "name": "sendActions",
57
+ "title": "Send token actions",
58
+ "type": "SendTokenAction",
59
+ "many": true,
60
+ "mapping": {
61
+ "parentModel": "CourseClassEvaluationEvent",
62
+ "childModel": "SendCourseClassTokenAction",
63
+ "parentField": "id",
64
+ "childField": "event",
65
+ "cascade": "delete",
66
+ "associationType": "association"
67
+ }
68
+ },
69
+ {
70
+ "name": "numberOfStudents",
71
+ "title": "Μέγιστος αριθμός φοιτητών",
72
+ "description": "Αριθμός φοιτητών που μπορούν να αξιολογήσουν",
73
+ "type": "Integer",
74
+ "nullable": true
25
75
  }
26
76
  ],
27
77
  "privileges": [
@@ -30,14 +80,41 @@
30
80
  "type": "global"
31
81
  },
32
82
  {
33
- "mask": 1,
83
+ "mask": 31,
34
84
  "type": "global",
35
- "account": "*"
85
+ "account": "Administrators"
36
86
  },
37
87
  {
38
- "mask": 15,
88
+ "mask": 17,
89
+ "type": "self",
90
+ "account": "Registrar",
91
+ "filter": "courseClass/course/department eq departments()",
92
+ "scope": [
93
+ "qa"
94
+ ]
95
+ },
96
+ {
97
+ "mask": 17,
39
98
  "type": "global",
40
- "account": "Administrators"
99
+ "account": "QualityAssuranceUnit"
100
+ },
101
+ {
102
+ "mask": 31,
103
+ "type": "self",
104
+ "account": "QualityAssuranceDepartment",
105
+ "filter": "courseClass/course/department eq departments()",
106
+ "scope": [
107
+ "qa"
108
+ ]
109
+ },
110
+ {
111
+ "mask": 17,
112
+ "type": "self",
113
+ "account": "Instructors",
114
+ "filter": "instructor eq instructor()",
115
+ "scope": [
116
+ "teachers"
117
+ ]
41
118
  }
42
119
  ],
43
120
  "resultPrivileges": [
@@ -60,5 +137,13 @@
60
137
  "qa"
61
138
  ]
62
139
  }
140
+ ],
141
+ "eventListeners": [
142
+ {
143
+ "type": "@themost/data/previous-state-listener"
144
+ },
145
+ {
146
+ "type": "./listeners/class-event-listener"
147
+ }
63
148
  ]
64
149
  }
@@ -8,7 +8,7 @@
8
8
  "sealed": false,
9
9
  "hidden": false,
10
10
  "inherits": "AccessToken",
11
- "version": "1.2",
11
+ "version": "1.4.0",
12
12
  "classPath": "./models/evaluation-access-token-model",
13
13
  "fields": [
14
14
  {
@@ -93,6 +93,18 @@
93
93
  "description": "A boolean which represents whether the token has been used",
94
94
  "type": "Boolean",
95
95
  "value": "javascript:return 0;"
96
+ },
97
+ {
98
+ "name": "parentToken",
99
+ "description": "The parent evaluation access token.",
100
+ "type": "EvaluationAccessToken"
101
+ },
102
+ {
103
+ "name": "metadata",
104
+ "description": "The metadata of this token",
105
+ "type": "Json",
106
+ "many": false,
107
+ "nullable": true
96
108
  }
97
109
  ],
98
110
  "constraints": [
@@ -131,6 +143,12 @@
131
143
  "eventListeners": [
132
144
  {
133
145
  "type": "./listeners/force-set-state-listener"
146
+ },
147
+ {
148
+ "type": "@themost/data/previous-state-listener"
149
+ },
150
+ {
151
+ "type": "./listeners/access-token-listener"
134
152
  }
135
153
  ]
136
154
  }
@@ -6,7 +6,7 @@
6
6
  "title": "EvaluationDocument",
7
7
  "abstract": false,
8
8
  "sealed": false,
9
- "version": "1.0",
9
+ "version": "1.1",
10
10
  "inherits": "Attachment",
11
11
  "classPath": "./models/evaluation-document-model",
12
12
  "fields": [
@@ -41,7 +41,23 @@
41
41
  "validation": {
42
42
  "pattern": "^\\d+.\\d+.\\d+$"
43
43
  }
44
+ },
45
+ {
46
+ "@id": "http://schema.org/parentDocument",
47
+ "name": "parentDocument",
48
+ "title": "Parent evaluation document",
49
+ "type": "EvaluationDocument",
50
+ "mapping": {
51
+ "parentModel": "EvaluationDocument",
52
+ "childModel": "EvaluationDocument",
53
+ "parentField": "parentDocument",
54
+ "childField": "id",
55
+ "cascade": "delete",
56
+ "associationType": "association"
44
57
 
58
+ },
59
+ "nullable": true,
60
+ "editable": true
45
61
  }
46
62
  ],
47
63
  "privileges": [
@@ -29,6 +29,19 @@
29
29
  "type": "Text",
30
30
  "readonly": true,
31
31
  "value": "javascript:return this.model.name;"
32
+ },
33
+ {
34
+ "name": "subEvents",
35
+ "title": "Sub events",
36
+ "type": "EvaluationEvent",
37
+ "many": true,
38
+ "mapping": {
39
+ "parentModel": "EvaluationEvent",
40
+ "childModel": "EvaluationEvent",
41
+ "parentField": "id",
42
+ "childField": "superEvent",
43
+ "associationType": "association"
44
+ }
32
45
  }
33
46
  ],
34
47
  "privileges": [
@@ -0,0 +1,57 @@
1
+ {
2
+ "$schema": "https://themost-framework.github.io/themost/models/2018/2/schema.json",
3
+ "@id": "http://schema.org/GenerateCourseClassTokenAction",
4
+ "name": "GenerateCourseClassTokenAction",
5
+ "description": "The act of organizing tasks/objects/events by associating resources to it.",
6
+ "title": "GenerateCourseClassTokenAction",
7
+ "abstract": false,
8
+ "sealed": false,
9
+ "inherits": "GenerateTokenAction",
10
+ "version": "1.0",
11
+ "fields": [
12
+ {
13
+ "name": "event",
14
+ "title": "Γεγονός αξιολόγησης",
15
+ "type": "CourseClassEvaluationEvent",
16
+ "nullable": false
17
+ },
18
+ {
19
+ "name": "numberOfStudents",
20
+ "description": "Σύνολο φοιτητών",
21
+ "type": "Integer"
22
+ },
23
+ {
24
+ "name": "total",
25
+ "description": "Σύνολο tokens που δημιουργήθηκαν",
26
+ "type": "Integer"
27
+ }
28
+ ],
29
+ "privileges": [
30
+ {
31
+ "mask": 31,
32
+ "type": "global"
33
+ },
34
+ {
35
+ "mask": 31,
36
+ "type": "global",
37
+ "account": "Administrators"
38
+ },
39
+ {
40
+ "mask": 17,
41
+ "type": "self",
42
+ "account": "Registrar",
43
+ "filter": "event/organizer eq departments()"
44
+ },
45
+ {
46
+ "mask": 17,
47
+ "type": "global",
48
+ "account": "QualityAssuranceUnit"
49
+ },
50
+ {
51
+ "mask": 31,
52
+ "type": "self",
53
+ "account": "QualityAssuranceDepartment",
54
+ "filter": "event/organizer eq departments()"
55
+ }
56
+ ]
57
+ }
@@ -0,0 +1,52 @@
1
+ {
2
+ "$schema": "https://themost-framework.github.io/themost/models/2018/2/schema.json",
3
+ "@id": "http://schema.org/SendCourseClassTokenAction",
4
+ "name": "SendCourseClassTokenAction",
5
+ "description": "The act of organizing tasks/objects/events by associating resources to it.",
6
+ "title": "SendCourseClassTokenAction",
7
+ "abstract": false,
8
+ "sealed": false,
9
+ "inherits": "SendTokenAction",
10
+ "version": "1.1",
11
+ "fields": [
12
+ {
13
+ "name": "event",
14
+ "title": "Γεγονός αξιολόγησης",
15
+ "type": "CourseClassEvaluationEvent",
16
+ "nullable": false
17
+ },
18
+ {
19
+ "name": "numberOfStudents",
20
+ "description": "Σύνολο φοιτητών",
21
+ "type": "Integer"
22
+ }
23
+ ],
24
+ "privileges": [
25
+ {
26
+ "mask": 15,
27
+ "type": "global"
28
+ },
29
+ {
30
+ "mask": 15,
31
+ "type": "global",
32
+ "account": "Administrators"
33
+ },
34
+ {
35
+ "mask": 1,
36
+ "type": "self",
37
+ "account": "Registrar",
38
+ "filter": "event/courseClass/course/department eq departments()"
39
+ },
40
+ {
41
+ "mask": 1,
42
+ "type": "global",
43
+ "account": "QualityAssuranceUnit"
44
+ },
45
+ {
46
+ "mask": 1,
47
+ "type": "self",
48
+ "account": "QualityAssuranceDepartment",
49
+ "filter": "event/courseClass/course/department eq departments()"
50
+ }
51
+ ]
52
+ }
@@ -0,0 +1,75 @@
1
+ import { DataObjectState } from '@themost/data';
2
+
3
+ /**
4
+ *
5
+ * @param {DataEventArgs} event
6
+ */
7
+ async function afterSaveAsync(event) {
8
+ // get organizer from courseClass
9
+ const context = event.model.context;
10
+ const target = event.target;
11
+ if (event.state === DataObjectState.Update) {
12
+ const previous = event.previous;
13
+ // update also child evaluation tokens (send, used, metadata)
14
+ let relatedTokens = await context.model('EvaluationAccessToken')
15
+ .where('parentToken').equal(event.target.access_token)
16
+ .silent()
17
+ .getAllItems();
18
+ if (relatedTokens && relatedTokens.length > 0) {
19
+ relatedTokens = relatedTokens.map(x => {
20
+ x.sent = target.hasOwnProperty('sent') ? target.sent : x.sent;
21
+ x.metadata = target.hasOwnProperty('metadata') ? target.metadata : x.metadata;
22
+ return x;
23
+ });
24
+ }
25
+ await context.model('EvaluationAccessToken')
26
+ .silent().save(relatedTokens)
27
+ }
28
+ }
29
+
30
+ export function afterExecute(event, callback) {
31
+ return afterExecuteAsync(event).then(() => {
32
+ return callback();
33
+ }).catch(err => {
34
+ return callback(err);
35
+ });
36
+ }
37
+
38
+
39
+ export async function afterExecuteAsync(event) {
40
+ // calculate total tokens and total used tokens if events are expanded
41
+ if (event.emitter && event.emitter.$expand && Array.isArray(event.emitter.$expand)) {
42
+ // if tokens of classInstructorEvaluationEvents are expanded and $select and $groupby are present to mapping options
43
+ if (event.emitter.$expand.find(mapping => {
44
+ // $select and $groupby are present to mapping options
45
+ return typeof mapping === 'object'
46
+ ? mapping.name === 'tokens' && (mapping.options && mapping.options.$select && mapping.options.$groupby)
47
+ : mapping === 'tokens'
48
+ })) {
49
+ const results = Array.isArray(event.result) ? event.result : [event.result]
50
+ for (const result of results) {
51
+ if (Array.isArray(result.tokens) && result.tokens.length) {
52
+ // calculate total and used tokens
53
+ result.calculatedTotal = result.tokens.reduce((partial_sum, a) => partial_sum + a.total, 0)
54
+ const findUsed = result.tokens.find(x=>{
55
+ return x.used;
56
+ });
57
+ result.calculatedUsed = findUsed?findUsed.total:0;
58
+ }
59
+ }
60
+ }
61
+ }
62
+ }
63
+
64
+ /**
65
+ * @param {DataEventArgs} event
66
+ * @param {Function} callback
67
+ */
68
+ export function afterSave(event, callback) {
69
+ // execute async method
70
+ return afterSaveAsync(event).then(() => {
71
+ return callback();
72
+ }).catch(err => {
73
+ return callback(err);
74
+ });
75
+ }
@@ -0,0 +1,183 @@
1
+ import { DataObjectState } from '@themost/data';
2
+ /**
3
+ *
4
+ * @param {DataEventArgs} event
5
+ */
6
+ async function beforeSaveAsync(event) {
7
+ // get organizer from courseClass
8
+ const context = event.model.context;
9
+ if (event.target.courseClass) {
10
+ const organizer = await context.model('CourseClass')
11
+ .where('id').equal(event.target.courseClass)
12
+ .select('course/department').value();
13
+ event.target.organizer = organizer;
14
+ }
15
+ if (event.state === DataObjectState.Update) {
16
+ const previous = event.previous;
17
+ // check if endDate is changed and update expired field for tokens
18
+ if (event.target.endDate) {
19
+ const prevEndDate = event.previous.endDate;
20
+ const endDate = event.target.endDate;
21
+ prevEndDate.setHours(0, 0, 0, 0);
22
+ endDate.setHours(0, 0, 0, 0);
23
+ if (prevEndDate - endDate !== 0) {
24
+ let tokens = await context.model('EvaluationAccessToken').where('evaluationEvent').equal(event.target.id)
25
+ .and('used').notEqual(1)
26
+ .silent().getItems();
27
+ if (tokens.length > 0) {
28
+ tokens = tokens.map(x => {
29
+ x.expires = event.target.endDate;
30
+ return x;
31
+ });
32
+ // update tokens
33
+ await context.model('EvaluationAccessToken').silent().save(tokens);
34
+ }
35
+ // change endDate of related ClassInstructorEvaluationEvent - if any
36
+ const events = await context.model('ClassInstructorEvaluationEvent')
37
+ .where('superEvent').equal(event.target.id)
38
+ .getItems();
39
+ if (events && events.length > 0) {
40
+ events.map(x => {
41
+ x.endDate = event.target.endDate;
42
+ return x;
43
+ });
44
+ await context.model('ClassInstructorEvaluationEvent').silent().save(events);
45
+ }
46
+ }
47
+ }
48
+ }
49
+ }
50
+ /**
51
+ * @param {DataEventArgs} event
52
+ * @param {Function} callback
53
+ */
54
+ export function beforeSave(event, callback) {
55
+ beforeSaveAsync(event).then(() => {
56
+ return callback()
57
+ }).catch( err => {
58
+ return callback(err);
59
+ })
60
+ }
61
+
62
+ /**
63
+ *
64
+ * @param {DataEventArgs} event
65
+ */
66
+ async function afterSaveAsync(event) {
67
+ // get organizer from courseClass
68
+ const context = event.model.context;
69
+ if (event.state === DataObjectState.Insert) {
70
+ // get all courseClassInstructors and check if ClassInstructorEvaluationEvents should be created
71
+ const evaluationEvent = await context.model('CourseClassEvaluationEvent')
72
+ .where('id').equal(event.target.id).flatten()
73
+ .silent().getItem();
74
+ const childEvaluationDocument = await context.model('EvaluationDocument')
75
+ .where('parentDocument').equal(evaluationEvent.evaluationDocument).getItem();
76
+ if (childEvaluationDocument) {
77
+ const classInstructors = await context.model('CourseClassInstructor')
78
+ .where('courseClass').equal(evaluationEvent.courseClass).getAllItems();
79
+ const events = classInstructors.map(x => {
80
+ x.courseClassInstructor = x.id;
81
+ x.superEvent = event.target.id;
82
+ x.evaluationDocument = childEvaluationDocument
83
+ x.startDate = event.target.startDate;
84
+ x.endDate = event.target.endDate;
85
+ delete x.id;
86
+ return x;
87
+ });
88
+ await context.model('ClassInstructorEvaluationEvent').silent().save(events);
89
+ }
90
+ }
91
+ }
92
+
93
+ export function afterExecute(event, callback) {
94
+ return afterExecuteAsync(event).then(() => {
95
+ return callback();
96
+ }).catch(err => {
97
+ return callback(err);
98
+ });
99
+ }
100
+
101
+
102
+ export async function afterExecuteAsync(event) {
103
+ // calculate total tokens and total used tokens if events are expanded
104
+ if (event.emitter && event.emitter.$expand && Array.isArray(event.emitter.$expand)) {
105
+ // if tokens of classInstructorEvaluationEvents are expanded and $select and $groupby are present to mapping options
106
+ if (event.emitter.$expand.find(mapping => {
107
+ // $select and $groupby are present to mapping options
108
+ return typeof mapping === 'object'
109
+ ? mapping.name === 'tokens' && (mapping.options && mapping.options.$select && mapping.options.$groupby)
110
+ : mapping === 'tokens'
111
+ })) {
112
+ const results = Array.isArray(event.result) ? event.result : [event.result]
113
+ for (const result of results) {
114
+ if (Array.isArray(result.tokens) && result.tokens.length) {
115
+ // calculate total and used tokens
116
+ result.calculatedTotal = result.tokens.reduce((partial_sum, a) => partial_sum + a.total, 0)
117
+ const findUsed = result.tokens.find(x=>{
118
+ return x.used;
119
+ });
120
+ result.calculatedUsed = findUsed?findUsed.total:0;
121
+ }
122
+ }
123
+ }
124
+ }
125
+ }
126
+
127
+ /**
128
+ * @async
129
+ * @param {DataEventArgs} event
130
+ */
131
+ async function beforeRemoveAsync(event) {
132
+ // ensure associations
133
+ const context = event.model.context;
134
+ const evaluationEvent = context.model('EvaluationEvent').convert(event.target);
135
+ const form = await evaluationEvent.property('evaluationDocument').getItem();
136
+ if (form && form.resultType) {
137
+ if (context.model(form.resultType) == null) {
138
+ // ensure model is added to configuration
139
+ await evaluationEvent.getForm();
140
+ }
141
+ const answers = await context.model(form.resultType)
142
+ .where('evaluationEvent').equal(event.target.id)
143
+ .silent().count();
144
+ if (answers) {
145
+ throw new Error('Cannot remove evaluation event since there are responses associated with it')
146
+ }
147
+ }
148
+ // remove also related ClassInstructorEvaluationEvents
149
+ const relatedEvents = await context.model('ClassInstructorEvaluationEvent')
150
+ .where('superEvent').equal(event.target.id).select('id')
151
+ .getItems();
152
+ if (relatedEvents && relatedEvents.length > 0) {
153
+ await context.model('ClassInstructorEvaluationEvent').remove(relatedEvents);
154
+ }
155
+ }
156
+
157
+
158
+ /**
159
+ * @param {DataEventArgs} event
160
+ * @param {Function} callback
161
+ */
162
+ export function beforeRemove(event, callback) {
163
+ // execute async method
164
+ return beforeRemoveAsync(event).then(() => {
165
+ return callback();
166
+ }).catch(err => {
167
+ return callback(err);
168
+ });
169
+ }
170
+
171
+
172
+ /**
173
+ * @param {DataEventArgs} event
174
+ * @param {Function} callback
175
+ */
176
+ export function afterSave(event, callback) {
177
+ // execute async method
178
+ return afterSaveAsync(event).then(() => {
179
+ return callback();
180
+ }).catch(err => {
181
+ return callback(err);
182
+ });
183
+ }
@@ -16,5 +16,7 @@
16
16
  "Evaluation token has been expired" : "Ο κωδικός αξιολόγησης έχει λήξει",
17
17
  "The course evaluation has been closed and is no longer available": "Η αξιολόγηση του μαθήματος έχει κλείσει και δεν είναι πλέον διαθέσιμη",
18
18
  "Evaluation access token has been expired or is invalid.": "Ο κωδικός αξιολόγησης έχει λήξει ή δεν είναι έγκυρος",
19
- "The bulk sending process of tokens is already in progress": "Η μαζική αποστολή των μηνυμάτων έχει ήδη ξεκινήσει"
19
+ "The bulk sending process of tokens is already in progress": "Η μαζική αποστολή των μηνυμάτων έχει ήδη ξεκινήσει",
20
+ "Select at least one instructor to evaluate":"Επιλέξτε τουλάχιστον έναν/μία διδάσκοντα/ουσα για να αξιολογήσετε",
21
+ "A previous action for generating evaluation tokens has been found.": "Μια ενέργεια έκδοσης tokens είναι ήδη σε εξέλιξη"
20
22
  }
@@ -197,13 +197,11 @@ class ClassInstructorEvaluationEvent extends EvaluationEvent {
197
197
  students = await context.model('StudentCourseClass')
198
198
  .where('courseClass').equal(courseClass.id)
199
199
  .and('section').in(sectionIds)
200
- .select('email')
201
200
  .silent()
202
201
  .getAllItems();
203
202
  } else {
204
203
  students = await context.model('StudentCourseClass')
205
204
  .where('courseClass').equal(courseClass.id)
206
- .select('email', 'student')
207
205
  .silent()
208
206
  .getAllItems();
209
207
  }
@@ -227,11 +225,9 @@ class ClassInstructorEvaluationEvent extends EvaluationEvent {
227
225
  }
228
226
  // get tokens
229
227
  let tokens = await this.context.model('EvaluationAccessToken').where('evaluationEvent').equal(this.getId())
230
- .select('access_token')
231
228
  .silent()
232
229
  .getAllItems();
233
- // and map them to an array
234
- tokens = tokens.map(token => token.access_token);
230
+
235
231
  // get mail template
236
232
  const mailTemplate = await context.model('MailConfiguration')
237
233
  .where('target').equal('SendInstructorTokenAction')