-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontrollers.js
More file actions
767 lines (661 loc) · 24.8 KB
/
controllers.js
File metadata and controls
767 lines (661 loc) · 24.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
var path = require('path');
var config = require(path.resolve('./config.js'));
var Client = require('node-rest-client').Client;
var striptags = require('striptags');
var client = new Client();
exports.identifySlackOauth = function(req, res, next){
if(Object.keys(req.query).length !== 0 &&
Object.keys(req.query)[0] === 'code' &&
Object.keys(req.query)[1] === 'state' &&
req.query.state === config.slackOauthState)
{
var slackOauthCode = req.query.code;
client.get('https://slack.com/api/oauth.access?client_id=' +
config.slackClientID + '&client_secret=' +
config.slackClientSecret + '&code=' + slackOauthCode +
'&redirect_uri=' + config.redirectURI, function(response, err){
res.redirect('/');
//TODO: Do something with access token...
//config.slackAccessToken = response.access_token;
});
}
else{
next();
}
};
exports.myusername = function(req, res){
var username = req.query.user_name;
res.json({
"text": "Hi! Your username is: " + username
});
};
exports.getCanvasAnnouncements = function(req, res){
var ids = [];
var courseNames = [];
var responseURL = req.body.response_url;
var txt = "";
var attach = [];
var lastWeek = new Date();
lastWeek.setDate(lastWeek.getDate() - 7);
res.status(200).json({
'text': "Retrieving announcements from the last 7 days...\n"
});
client.get("https://ufl.instructure.com/api/v1/courses?enrollment_state=active&access_token=" + config.canvasToken, function (data, response) {
for(var course in data){
var name = data[course].name;
var courseID = data[course].id;
if(courseID !== undefined && name !== undefined) {
ids.push(courseID);
courseNames.push(name);
}
}
var count = 0;
var announce = function(){
client.get("https://ufl.instructure.com/api/v1/announcements?context_codes=course_" + ids[count] + "&access_token=" + config.canvasToken, function (data, response) {
txt += "\n\n\n-------- " + courseNames[count] + " --------";
for(var course in data){
if(data[course] !== undefined){
var posted = new Date(data[course].posted_at);
if(posted.valueOf() >= lastWeek) {
var pretext = courseNames[count];
var title = data[course].title;
var title_link = data[course].html_url;
var footer = data[course].posted_at;
var textBody = striptags(data[course].message);
attach.push({
"pretext": pretext,
"title": title,
"footer": footer,
"title_link": title_link,
"text": textBody
});
};
}
}
count++;
if(count === ids.length){
if(attach === "") {
attach = "\n\nSorry, no announcements found";
}
var args = {
data: {"attachments": attach},
headers: {"Content-Type" : "application/json"}
}
client.post(responseURL, args, function(data, response) {});
}
if(count < ids.length){
announce();
}
});
}
announce();
});
}
var createDateAtBeginningOfDay = function(month, day, year){
var date = new Date();
date.setMonth(month);
date.setDate(day);
date.setFullYear(year);
date.setHours(0);
date.setMinutes(0);
date.setSeconds(0);
date.setMilliseconds(0);
return date;
}
var createDateFromTerm = function(courseTerm){
//TODO: index checking
var year = courseTerm.substring(courseTerm.length-2, courseTerm.length);
var term = courseTerm.substring(0, courseTerm.length-2).toLowerCase();
console.log(term);
//TODO: don't assume year is > 2000
var dateYear = 2000 + parseInt(year);
var termStartDate, termEndDate;
//TODO: add summer AND don't use UF specific dates
if(term === 'fall'){
termStartDate = createDateAtBeginningOfDay(7, 22, dateYear); //August 22nd
termEndDate = createDateAtBeginningOfDay(0, 4, dateYear + 1); //January 4th of following year
}
if(term === 'spring'){
termStartDate = createDateAtBeginningOfDay(0, 4, dateYear);
termEndDate = createDateAtBeginningOfDay(7, 22, dateYear);
}
return dateRangeObj = {
termStartDate: termStartDate,
termEndDate: termEndDate
};
};
exports.getCanvasCourses = function(req, res){
var dateObjToCompare;
if(req.body.text){
var courseTerm = req.body.text;
dateObjToCompare = createDateFromTerm(courseTerm);
}
client.get("https://ufl.instructure.com/api/v1/courses?per_page=100&access_token=" + config.canvasToken, function (data, response) {
var courses = [];
for(var course in data){
var courseName = data[course].name;
if(req.body.text && courseName !== undefined){
//Leaving to ease identification of date errors
// console.log(dateObjToCompare.termStartDate);
// console.log(dateObjToCompare.termEndDate);
// console.log(new Date(data[course].start_at));
// console.log(data[course].name);
// console.log('=================================');
var courseStartDate = new Date(data[course].start_at);
if(dateObjToCompare.termStartDate <= courseStartDate &&
dateObjToCompare.termEndDate > courseStartDate)
{
courses.push({'title' : courseName});
}
}
else if(courseName !== undefined){
courses.push({'title' : courseName});
}
}
var text;
if(courses.length === 0){
text = 'Sorry, no courses found for the specified criteria';
}
else{
text = 'The following courses are registered in your Canvas™ profile:';
}
res.json({
'text': text,
'attachments' : courses
});
});
};
exports.getCanvasProfile = function(req, res){
var info = [];
client.get("https://ufl.instructure.com/api/v1/users/self/profile?access_token=" + config.canvasToken, function (data, response) {
var name = data.short_name;
var url = data.avatar_url;
var email = data.login_id;
if(name !== undefined){
obj = {
'title': name,
'text': "Email: " + email,
'image_url' : url
}
info.push(obj);
}
res.json({
'text': 'User information: ',
'attachments': info
});
});
};
exports.getCanvasEvents = function(req, res){
var courses = [];
client.get("https://ufl.instructure.com/api/v1/users/self/upcoming_events?enrollment_state=active&access_token=" + config.canvasToken, function (data, response) {
for(var id in data){
var assignmentName = data[id].title;
var url = data[id].url;
var description = data[id].description;
var endAt = data[id].end_at;
if(assignmentName !== undefined){
console.log("EVENT: " + data[id].title + "\n");
console.log("URL: " + data[id].url + "\n");
console.log("DESCRIPTION: " + data[id].description + "\n");
console.log("EVENT AT: " + data[id].endAt + "\n");
obj = {
'title': "Event: " + assignmentName,
'text': "\n" + url + "\n Description: " + striptags(description) +
"\nEvent at: " + endAt +"\n"
}
courses.push(obj);
}
}
res.json({
'text': 'The following are upcoming: ',
'attachments': courses
});
});
};
exports.getCanvasAssign = function(req, res){
console.log(req.body);
var responseURL = req.body.response_url;
var searchTerm = req.body.text;
var usingSearchTerm = true;
var tokens = searchTerm.split(" ");
var ids = [];
var courseNames = [];
var txt = [];
var htmlURL;
var start = new Date();
var end = new Date("12/31/2100");
res.status(200).json({
'text': "Retrieving Assignments...\n"
});
if(tokens.length === 4) {
if(tokens[0].toUpperCase() === "START") {
usingSearchTerm = false;
start = new Date(tokens[1]);
}
if(tokens[2].toUpperCase() === "END") {
usingSearchTerm = false;
end = new Date(tokens[3]);
end.setSeconds(59);
end.setMinutes(59);
end.setHours(23);
}
}
else if(tokens.length === 2) {
if(tokens[0].toUpperCase() === "START") {
usingSearchTerm = false;
start = new Date(tokens[1]);
}
else if(tokens[0].toUpperCase() === "END") {
usingSearchTerm = false;
end = new Date(tokens[1]);
end.setSeconds(59);
end.setMinutes(59);
end.setHours(23);
}
}
client.get("https://ufl.instructure.com/api/v1/courses?enrollment_state=active&access_token=" + config.canvasToken, function (data, response) {
for(var course in data){
var courseID = data[course].id;
var name = data[course].name;
if(courseID !== undefined && name !== undefined) {
ids.push(courseID);
courseNames.push(name);
}
}
var count = 0;
var second = function() {
if(usingSearchTerm === true) {
var htmlUrl = "https://ufl.instructure.com/api/v1/courses/"+ids[count]+"/assignments?search_term=" + searchTerm + "&bucket=future&access_token=" + config.canvasToken;
}
else {
var htmlUrl = "https://ufl.instructure.com/api/v1/courses/"+ids[count]+"/assignments?access_token=" + config.canvasToken;
}
client.get(htmlUrl, function (data, response) {
for(var course in data){
var pretext = courseNames[count];
var textBody;
var title = data[course].name;
var title_link = data[course].html_url;
if(data[course].has_submitted_submissions === true) {
textBody = "Due: " + data[course].due_at + " | COMPLETE";
}
else {
textBody = "Due: " + data[course].due_at + " | INCOMPLETE";
}
var footer = "Points: " + data[course].points_possible;
if(course !== undefined && usingSearchTerm === true){
txt.push({
"pretext": pretext,
"title": title,
"title_link": title_link,
"text": textBody,
"footer": footer
});
}
else if(course !== undefined && usingSearchTerm === false) {
var assignmentDate = new Date(data[course].due_at);
console.log("assignment date: " + assignmentDate + ", Start: " + start + ", End: " + end);
if(assignmentDate <= end && assignmentDate >= start) {
txt.push({
"pretext": pretext,
"title": title,
"title_link": title_link,
"text": textBody,
"footer": footer
});
}
}
}
count++;
if(count < ids.length) {
second();
}
if(count === ids.length) {
if(txt.length === 0) {
txt.push({
"pretext": "Sorry, no assignments found"
});
}
var args = {
data: {"attachments": txt},
headers: {"Content-Type" : "application/json"}
}
client.post(responseURL, args, function(data, response) {});
}
});
};
second();
});
};
exports.getCanvasAnnouncements = function(req, res){
var ids = [];
var courseNames = [];
var responseURL = req.body.response_url;
var txt = "";
var attach = [];
var lastWeek = new Date();
lastWeek.setDate(lastWeek.getDate() - 7);
res.status(200).json({
'text': "Retrieving announcements from the last 7 days...\n"
});
client.get("https://ufl.instructure.com/api/v1/courses?enrollment_state=active&access_token=" + config.canvasToken, function (data, response) {
for(var course in data){
var name = data[course].name;
var courseID = data[course].id;
if(courseID !== undefined && name !== undefined) {
ids.push(courseID);
courseNames.push(name);
}
}
var count = 0;
var announce = function(){
client.get("https://ufl.instructure.com/api/v1/announcements?context_codes=course_" + ids[count] + "&access_token=" + config.canvasToken, function (data, response) {
txt += "\n\n\n-------- " + courseNames[count] + " --------";
for(var course in data){
if(data[course] !== undefined){
var posted = new Date(data[course].posted_at);
if(posted.valueOf() >= lastWeek) {
var pretext = courseNames[count];
var title = data[course].title;
var title_link = data[course].html_url;
var footer = data[course].posted_at;
var textBody = striptags(data[course].message);
attach.push({
"pretext": pretext,
"title": title,
"footer": footer,
"title_link": title_link,
"text": textBody
});
};
}
}
count++;
if(count === ids.length){
if(attach === "") {
attach = "\n\nSorry, no announcements found";
}
var args = {
data: {"attachments": attach},
headers: {"Content-Type" : "application/json"}
}
client.post(responseURL, args, function(data, response) {});
}
if(count < ids.length){
announce();
}
});
}
announce();
});
};
exports.getCourseEvents = function(req, res){
//coursename start [d/m/y] OR/AND end [d/m/y] OR allevents
var params = req.body.text;
var tokens = params.split(" ");
var courseCode = tokens[0];
var courseFound = false;
var calendarEvents = [];
console.log(courseCode);
client.get("https://ufl.instructure.com/api/v1/courses?per_page=100&access_token=" + config.canvasToken, function (data, response) {
for(var course in data){
console.log(data[course]);
console.log(data[course].course_code);
console.log('===============================');
if(data[course].course_code !== undefined){
console.log(data[course].course_code.toLowerCase().indexOf(courseCode.toLowerCase()));
}
if(data[course].course_code !== undefined &&
data[course].course_code.toLowerCase().indexOf(courseCode.toLowerCase()) > -1){
courseFound = true;
var courseContextCode = 'course_' + data[course].id;
console.log(courseContextCode);
//only coursecode was given, use today as default (from canvas API)
if(tokens.length === 1){
client.get('https://ufl.instructure.com/api/v1/calendar_events?per_page=100&contex_codes[]=' + courseContextCode + '&access_token=' + config.canvasToken, function(calData, response){
for(event in calData){
var calEventObj = {
'title' : calData[event].title,
'text' : 'Event URL: ' + calData[event].html_url + '\nEvent Start: ' +
new Date(calData[event].start_at) + '\nEvent End: ' +
new Date(calData[event].end_at) + '\nDescription: ' + striptags(calData[event].description)
};
calendarEvents.push(calEventObj);
}
var text;
if(calendarEvents.length === 0){
text = 'No calendar events found for \"' + courseCode + '\"';
}
else{
text = 'Calendar Events for ' + courseCode;
}
res.json({
'text': text,
'attachments': calendarEvents
});
});
}
//only start was specified
else if(tokens[1].toLowerCase() === 'start' && tokens.length === 3){
var dateTokens = tokens[2].split('/');
var month = dateTokens[0];
var day = dateTokens[1];
var year = dateTokens[3];
//TODO: make this more robust
if(year.length === 2){
year = '20' + year;
}
var startDate = year + '-' + month + '-' + day;
var endDate = year + '-' + month + '-' + (parseInt(day) + 1).toString();
client.get('https://ufl.instructure.com/api/v1/calendar_events?per_page=100&contex_codes[]=' + courseContextCode +
'&start_date=' + startDate + '&end_date=' + endDate + '&access_token=' + config.canvasToken, function(calData, response){
for(event in calData){
var calEventObj = {
'title' : calData[event].title,
'text' : 'Event URL: ' + calData[event].html_url + '\nEvent Start: ' +
new Date(calData[event].start_at) + '\nEvent End: ' +
new Date(calData[event].end_at) + '\nDescription: ' + striptags(calData[event].description)
};
calendarEvents.push(calEventObj);
}
var text;
if(calendarEvents.length === 0){
text = 'No calendar events found for \"' + courseCode + '\" for the specified date range';
}
else{
text = 'Calendar Events for ' + courseCode;
}
res.json({
'text': text,
'attachments': calendarEvents
});
});
}
//only end was specified
else if(tokens[1].toLowerCase() === 'end' && tokens.length === 3){
var dateTokens = tokens[2].split('/');
var month = dateTokens[0];
var day = dateTokens[1];
var year = dateTokens[3];
//TODO: make this more robust
if(year.length === 2){
year = '20' + year;
}
var endDate = year + '-' + month + '-' + day;
var startDate = year + '-' + month + '-' + (parseInt(day) - 1).toString(); //TODO: works for all days except month boundaries
client.get('https://ufl.instructure.com/api/v1/calendar_events?per_page=100&contex_codes[]=' + courseContextCode +
'&start_date=' + startDate + '&end_date=' + endDate + '&access_token=' + config.canvasToken, function(calData, response){
for(event in calData){
var calEventObj = {
'title' : calData[event].title,
'text' : 'Event URL: ' + calData[event].html_url + '\nEvent Start: ' +
new Date(calData[event].start_at) + '\nEvent End: ' +
new Date(calData[event].end_at) + '\nDescription: ' + striptags(calData[event].description)
};
calendarEvents.push(calEventObj);
}
var text;
if(calendarEvents.length === 0){
text = 'No calendar events found for \"' + courseCode + '\" for the specified date range';
}
else{
text = 'Calendar Events for ' + courseCode;
}
res.json({
'text': text,
'attachments': calendarEvents
});
});
}
//both start and end were specified
else if(tokens[1].toLowerCase() === 'start' && tokens[3].toLowerCase() === 'end' && tokens.length === 5){
var startDateTokens = tokens[2].split('/');
var endDateTokens = tokens[4].split('/');
var startMonth = startDateTokens[0];
var startDay = startDateTokens[1];
var startYear = startDateTokens[2];
if(startYear.length == 2){
startYear = '20' + startYear;
}
var endMonth = endDateTokens[0];
var endDay = endDateTokens[1];
var endYear = endDateTokens[2];
if(endYear.length == 2){
endYear = '20' + endYear;
}
var startDate = startYear + '-' + startMonth + '-' + startDay;
var endDate = endYear + '-' + endMonth + '-' + endDay;
client.get('https://ufl.instructure.com/api/v1/calendar_events?per_page=100&contex_codes[]=' + courseContextCode +
'&start_date=' + startDate + '&end_date=' + endDate + '&access_token=' + config.canvasToken, function(calData, response){
for(event in calData){
var calEventObj = {
'title' : calData[event].title,
'text' : 'Event URL: ' + calData[event].html_url + '\nEvent Start: ' +
new Date(calData[event].start_at) + '\nEvent End: ' +
new Date(calData[event].end_at) + '\nDescription: ' + striptags(calData[event].description)
};
calendarEvents.push(calEventObj);
}
var text;
if(calendarEvents.length === 0){
text = 'No calendar events found for \"' + courseCode + '\" for the specified date range';
}
else{
text = 'Calendar Events for ' + courseCode;
}
res.json({
'text': text,
'attachments': calendarEvents
});
});
}
//allevents specified
else if(tokens[1].toLowerCase() === 'allevents' && tokens.length === 2){
client.get('https://ufl.instructure.com/api/v1/calendar_events?per_page=100&contex_codes[]=' + courseContextCode + '&all_events=true&access_token=' + config.canvasToken, function(calData, response){
for(event in calData){
var calEventObj = {
'title' : calData[event].title,
'text' : 'Event URL: ' + calData[event].html_url + '\nEvent Start: ' +
new Date(calData[event].start_at) + '\nEvent End: ' +
new Date(calData[event].end_at) + '\nDescription: ' + striptags(calData[event].description)
};
calendarEvents.push(calEventObj);
}
var text;
if(calendarEvents.length === 0){
text = 'No calendar events found for \"' + courseCode + '\" for the specified date range';
}
else{
text = 'Calendar Events for ' + courseCode;
}
res.json({
'text': text,
'attachments': calendarEvents
});
});
}
//input not valid, tell user
else{
return res.json({
'text' : 'The options entered were not valid. Please use `\\onlinecoursemanager help` for more information.'
});
}
}
}
if(!courseFound){
return res.json({
'text' : 'No course with the course code \"' + courseCode + '\" can be found.'
});
}
});
};
exports.onlineCourseManagerHelp = function(req, res){
var body = req.body.text;
var n = body.search(/help/i);
if(n > -1){
var info = [];
obj1 = {
'color': "4183D7",
'text': "`/courses [term]`\nExample: `/courses Spring16`",
'title': "List course names you are registered to. Optionally filter by term (e.g. Spring16)",
'mrkdwn_in' : ["text"]
}
obj2 = {
'color': "4183D7",
'text': '`/assignments [keyword], /assignment start [day/month/year] end [day/month/year]`\nExample: `/assignments math worksheet`\nExample: `/assignments start 10/21/2016 end 10/31/2016`\nExample: `/assignments start 10/21/2016`\nExample: `/assignments end 10/31/2016`',
'title': "Search assignments by keyword or by due date.",
'mrkdwn_in' : ["text"]
}
obj3 = {
'color': "4183D7",
'text': '`/upcomingevents`',
'title': "Gets all upcoming events - tests, quizzes, and assignments.",
'mrkdwn_in' : ["text"]
}
obj4 = {
'color': "4183D7",
'text': '`/announcements`',
'title': "Lists all course announcements for the past 7 days.",
'mrkdwn_in' : ["text"]
}
obj5 = {
'color': "4183D7",
'text': '`/profile`',
'title': "Gets user's profile information.",
'mrkdwn_in' : ["text"]
}
obj6 = {
'color': "4183D7",
'text': '`/calendar coursecode start [d/m/y] OR/AND end [d/m/y] OR allevents`\nExample: `/calendar COP4600`\nExample: `/calendar COP4600 start 10/21/2016 end 10/31/2016`\nExample: `/calendar COP4600 start 10/21/2016`\nExample: `/calendar COP4600 end 10/31/2016`\nExample: `/calendar COP4600 allevents`',
'title': "List calendar events stored in Canvas given a course code (e.g. COP4600). Optionally show all calendar events or filter by a start and/or end date.",
'mrkdwn_in' : ["text"]
}
obj7 = {
'color': "4183D7",
'text': '`/onlinecoursemanager [help]`\nExample: `/onlinecoursemanager help`',
'title': "Shows list of commands and their purpose, if the user input is 'help'",
'mrkdwn_in' : ["text"]
}
info.push(obj1);
info.push(obj2);
info.push(obj3);
info.push(obj4);
info.push(obj5);
info.push(obj6);
info.push(obj7);
res.json({
'text': 'Here are the commands you can use with OnlineCourseManager.',
'attachments': info
});
}
else{
var info = [];
obj = {
'text': "Use '/onlinecoursemanager help' to see all the commands of this bot."
}
info.push(obj);
res.json({
'attachments': info
});
}
};