@olea-bps/base 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/AppBar/index.js +84 -0
- package/components/AppBar/styles.js +27 -0
- package/components/BookDetail/index.js +268 -0
- package/components/BookDetail/styles.js +124 -0
- package/components/ComponentJobsFilter/index.js +188 -0
- package/components/ComponentJobsFilter/styles.js +12 -0
- package/components/ConnectivityWarning/index.js +65 -0
- package/components/ConnectivityWarning/styles.js +19 -0
- package/components/ContactDetail/index.js +232 -0
- package/components/ContactDetail/styles.js +32 -0
- package/components/CourseDetail/index.js +357 -0
- package/components/CourseDetail/styles.js +59 -0
- package/components/CourseDetailDialog/index.js +169 -0
- package/components/CourseDetailDialog/styles.js +116 -0
- package/components/CourseInfo/index.js +219 -0
- package/components/CourseInfo/styles.js +40 -0
- package/components/DevelopmentDialog/index.js +214 -0
- package/components/DevelopmentDialog/styles.js +10 -0
- package/components/EventCodeInput/index.js +149 -0
- package/components/EventCodeInput/styles.js +108 -0
- package/components/FlexMenuEntry/index.js +84 -0
- package/components/FlexMenuEntry/styles.js +27 -0
- package/components/MainMenuEntry/index.js +88 -0
- package/components/MainMenuEntry/styles.js +28 -0
- package/components/MealItem/index.js +87 -0
- package/components/MealItem/styles.js +84 -0
- package/components/MensaMenu/index.js +305 -0
- package/components/MensaMenu/styles.js +94 -0
- package/components/MensaSlider/index.js +188 -0
- package/components/MensaSlider/styles.js +53 -0
- package/components/Modal/index.js +106 -0
- package/components/Modal/styles.js +8 -0
- package/components/NewsDetail/index.js +377 -0
- package/components/NewsDetail/styles.js +77 -0
- package/components/NewsList/index.js +120 -0
- package/components/NewsList/styles.js +19 -0
- package/components/NewsListItem/index.js +89 -0
- package/components/NewsListItem/styles.js +32 -0
- package/components/OtherCourses/index.js +152 -0
- package/components/OtherCourses/styles.js +10 -0
- package/components/PtsDeparture/index.js +140 -0
- package/components/PtsDeparture/styles.js +7 -0
- package/components/PtsStation/index.js +186 -0
- package/components/PtsStation/styles.js +47 -0
- package/components/QuickLinks/index.js +127 -0
- package/components/QuickLinks/styles.js +45 -0
- package/components/RoomDetail/index.js +281 -0
- package/components/RoomDetail/styles.js +56 -0
- package/components/ScaledImage/index.js +92 -0
- package/components/SearchResults/index.js +362 -0
- package/components/SearchResults/styles.js +59 -0
- package/components/SettingSection/index.js +54 -0
- package/components/SettingSection/styles.js +15 -0
- package/components/SettingsDialog/index.js +52 -0
- package/components/SettingsDialog/styles.js +12 -0
- package/components/SettingsDialogRadio/index.js +66 -0
- package/components/SettingsDialogRadio/styles.js +7 -0
- package/components/SettingsDialogSelect/index.js +73 -0
- package/components/SettingsDialogSelect/styles.js +7 -0
- package/components/TimetableCodeInput/index.js +205 -0
- package/components/TimetableCodeInput/styles.js +28 -0
- package/components/TimetableDay/index.js +252 -0
- package/components/TimetableDay/styles.js +103 -0
- package/components/TimetableEvent/index.js +163 -0
- package/components/TimetableEvent/styles.js +108 -0
- package/components/TimetableList/index.js +180 -0
- package/components/TimetableList/styles.js +106 -0
- package/components/TimetableMonth/index.js +156 -0
- package/components/TimetableMonth/styles.js +29 -0
- package/components/TimetableWeek/index.js +230 -0
- package/components/TimetableWeek/styles.js +58 -0
- package/components/TopNews/index.js +282 -0
- package/components/TopNews/styles.js +125 -0
- package/components/TopNewsHtwk/index.js +279 -0
- package/components/TopNewsHtwk/styles.js +142 -0
- package/components/WebView/index.js +108 -0
- package/components/WebView/styles.js +11 -0
- package/context/context-callmanager/TucCallManager.js +74 -0
- package/context/context-callmanager/index.js +128 -0
- package/context/context-canteen/AsistServerApiProvider.js +126 -0
- package/context/context-canteen/CollektorVersion2ApiProvider.js +100 -0
- package/context/context-canteen/index.js +692 -0
- package/context/context-connectivity/index.js +85 -0
- package/context/context-event/AsistServerClient.js +82 -0
- package/context/context-event/index.js +205 -0
- package/context/context-flex-menu/AsistServerApiProvider.js +0 -0
- package/context/context-flex-menu/CollectorVersion2ApiProvider.js +32 -0
- package/context/context-flex-menu/index.js +160 -0
- package/context/context-info-dialog/CollektorVersion2ApiProvider.js +53 -0
- package/context/context-info-dialog/ProviderErrors.js +22 -0
- package/context/context-info-dialog/index.js +190 -0
- package/context/context-mails/MailService.js +147 -0
- package/context/context-mails/TucUnseenApiProvider.js +65 -0
- package/context/context-mails/index.js +131 -0
- package/context/context-news/CollektorVersion2ApiProvider.js +68 -0
- package/context/context-news/index.js +155 -0
- package/context/context-public-transport-ticket/CollektorVersion2ApiProvider.js +45 -0
- package/context/context-public-transport-ticket/ProviderErrors.js +11 -0
- package/context/context-public-transport-ticket/index.js +175 -0
- package/context/context-timetable/CollectorVersion2ApiProvider.js +102 -0
- package/context/context-timetable/ProviderErrors.js +22 -0
- package/context/context-timetable/TimetableService.js +357 -0
- package/context/context-timetable/index.js +215 -0
- package/context/context-user/index.js +586 -0
- package/index.js +178 -0
- package/libraries/base-api-provider/hooks.js +24 -0
- package/libraries/base-api-provider/http-api-provider.js +168 -0
- package/libraries/base-api-provider/index.js +20 -0
- package/libraries/core/api/canteens.js +88 -0
- package/libraries/core/api/corona.js +45 -0
- package/libraries/core/api/courses.js +54 -0
- package/libraries/core/api/device.js +98 -0
- package/libraries/core/api/feed.js +144 -0
- package/libraries/core/api/feedback.js +123 -0
- package/libraries/core/api/jobs.js +48 -0
- package/libraries/core/api/library.js +67 -0
- package/libraries/core/api/lostfound.js +77 -0
- package/libraries/core/api/occupancy.js +44 -0
- package/libraries/core/api/officehours.js +25 -0
- package/libraries/core/api/poi.js +25 -0
- package/libraries/core/api/pts.js +68 -0
- package/libraries/core/api/rooms.js +31 -0
- package/libraries/core/api/survey.js +121 -0
- package/libraries/core/api/telephone.js +32 -0
- package/libraries/core/api/tucrooms.js +31 -0
- package/libraries/core/constants/actions.js +75 -0
- package/libraries/core/constants/api.js +146 -0
- package/libraries/core/constants/enums.js +5 -0
- package/libraries/core/helper/date.js +9 -0
- package/libraries/core/helper/format.helper.js +2 -0
- package/libraries/core/index.js +60 -0
- package/libraries/core/redux/actions/notifications.js +6 -0
- package/libraries/core/redux/actions/setting.js +75 -0
- package/libraries/core/redux/actions/state.js +74 -0
- package/libraries/core/redux/asyncDispatch.js +27 -0
- package/libraries/core/redux/reducers/api.js +190 -0
- package/libraries/core/redux/reducers/index.js +32 -0
- package/libraries/core/redux/reducers/notifications.js +16 -0
- package/libraries/core/redux/reducers/setting.js +99 -0
- package/libraries/core/redux/reducers/state.js +122 -0
- package/libraries/core/redux/selectors.js +123 -0
- package/libraries/core/redux/store.js +40 -0
- package/libraries/core/services/data.js +96 -0
- package/libraries/core/services/root-navigation.js +36 -0
- package/libraries/core/services/search.js +175 -0
- package/libraries/core-plugins/enums/replaceTypes.js +53 -0
- package/libraries/core-plugins/index.js +21 -0
- package/libraries/core-plugins/redux/actions/plugin.js +13 -0
- package/libraries/core-plugins/redux/reducers/plugin.js +210 -0
- package/libraries/icons-openasist/index.js +143 -0
- package/libraries/notifications/index.js +268 -0
- package/libraries/notifications/services/subscriber.service.js +123 -0
- package/libraries/react-native-webview-autoheight/README.md +47 -0
- package/libraries/react-native-webview-autoheight/index.js +140 -0
- package/libraries/react-native-webview-autoheight/package.json +37 -0
- package/libraries/react-native-webview-autoheight/utils.js +268 -0
- package/libraries/redux-offline/.eslintignore +1 -0
- package/libraries/redux-offline/.github/ISSUE_TEMPLATE/redux-offline-core-issues-template.md +25 -0
- package/libraries/redux-offline/.prettierrc +6 -0
- package/libraries/redux-offline/LICENSE +21 -0
- package/libraries/redux-offline/README.md +133 -0
- package/libraries/redux-offline/flow-typed/npm/redux-logger_vx.x.x.js +109 -0
- package/libraries/redux-offline/flow-typed/npm/redux_v4.x.x.js +100 -0
- package/libraries/redux-offline/lib/actions.js +46 -0
- package/libraries/redux-offline/lib/config.js +15 -0
- package/libraries/redux-offline/lib/constants.js +17 -0
- package/libraries/redux-offline/lib/defaults/defaultCommit.js +11 -0
- package/libraries/redux-offline/lib/defaults/defaultRollback.js +11 -0
- package/libraries/redux-offline/lib/defaults/detectNetwork.js +33 -0
- package/libraries/redux-offline/lib/defaults/detectNetwork.native.js +211 -0
- package/libraries/redux-offline/lib/defaults/discard.js +18 -0
- package/libraries/redux-offline/lib/defaults/effect.js +87 -0
- package/libraries/redux-offline/lib/defaults/index.js +32 -0
- package/libraries/redux-offline/lib/defaults/offlineStateLens.js +24 -0
- package/libraries/redux-offline/lib/defaults/persist.js +9 -0
- package/libraries/redux-offline/lib/defaults/persist.native.js +17 -0
- package/libraries/redux-offline/lib/defaults/persistAutoRehydrate.js +8 -0
- package/libraries/redux-offline/lib/defaults/queue.js +27 -0
- package/libraries/redux-offline/lib/defaults/retry.js +29 -0
- package/libraries/redux-offline/lib/index.js +115 -0
- package/libraries/redux-offline/lib/middleware.js +56 -0
- package/libraries/redux-offline/lib/offlineActionTracker.js +43 -0
- package/libraries/redux-offline/lib/send.js +112 -0
- package/libraries/redux-offline/lib/types.js +3 -0
- package/libraries/redux-offline/lib/updater.js +111 -0
- package/libraries/redux-offline/package.json +69 -0
- package/libraries/redux-offline/src/__tests__/defaults/discard.js +22 -0
- package/libraries/redux-offline/src/__tests__/defaults/effect.js +118 -0
- package/libraries/redux-offline/src/__tests__/index.js +116 -0
- package/libraries/redux-offline/src/__tests__/middleware.js +185 -0
- package/libraries/redux-offline/src/__tests__/offlineActionTracker.js +54 -0
- package/libraries/redux-offline/src/__tests__/send.js +208 -0
- package/libraries/redux-offline/src/actions.js +36 -0
- package/libraries/redux-offline/src/config.js +9 -0
- package/libraries/redux-offline/src/constants.js +18 -0
- package/libraries/redux-offline/src/defaults/defaultCommit.js +7 -0
- package/libraries/redux-offline/src/defaults/defaultRollback.js +7 -0
- package/libraries/redux-offline/src/defaults/detectNetwork.js +16 -0
- package/libraries/redux-offline/src/defaults/detectNetwork.native.js +148 -0
- package/libraries/redux-offline/src/defaults/discard.js +19 -0
- package/libraries/redux-offline/src/defaults/effect.js +86 -0
- package/libraries/redux-offline/src/defaults/index.js +25 -0
- package/libraries/redux-offline/src/defaults/offlineStateLens.js +11 -0
- package/libraries/redux-offline/src/defaults/persist.js +4 -0
- package/libraries/redux-offline/src/defaults/persist.native.js +9 -0
- package/libraries/redux-offline/src/defaults/persistAutoRehydrate.js +4 -0
- package/libraries/redux-offline/src/defaults/queue.js +20 -0
- package/libraries/redux-offline/src/defaults/retry.js +18 -0
- package/libraries/redux-offline/src/index.js +138 -0
- package/libraries/redux-offline/src/middleware.js +52 -0
- package/libraries/redux-offline/src/offlineActionTracker.js +40 -0
- package/libraries/redux-offline/src/send.js +111 -0
- package/libraries/redux-offline/src/types.js +127 -0
- package/libraries/redux-offline/src/updater.js +141 -0
- package/libraries/redux-offline/typings.d.ts +150 -0
- package/libraries/redux-offline/yarn.lock +6460 -0
- package/libraries/stored-state/index.js +155 -0
- package/package.json +68 -0
- package/views/Callmanager/index.js +148 -0
- package/views/Callmanager/styles.js +62 -0
- package/views/Canteens/index.js +383 -0
- package/views/Canteens/styles.js +89 -0
- package/views/Dashboard/index.js +176 -0
- package/views/Dashboard/styles.js +16 -0
- package/views/DashboardHtwk/index.js +197 -0
- package/views/DashboardHtwk/styles.js +24 -0
- package/views/Event/index.js +373 -0
- package/views/Event/styles.js +63 -0
- package/views/FeedList/index.js +165 -0
- package/views/FeedList/styles.js +15 -0
- package/views/FeedNews/index.js +243 -0
- package/views/FeedNews/styles.js +32 -0
- package/views/Flexmenu/index.js +185 -0
- package/views/Flexmenu/styles.js +62 -0
- package/views/FlexmenuWebview/index.js +167 -0
- package/views/FlexmenuWebview/styles.js +16 -0
- package/views/Howhy/index.js +151 -0
- package/views/Howhy/styles.js +11 -0
- package/views/Jobs/index.js +217 -0
- package/views/Jobs/styles.js +41 -0
- package/views/MainMenu/index.js +283 -0
- package/views/MainMenu/styles.js +36 -0
- package/views/NewsTabbar/index.js +164 -0
- package/views/NewsTabbar/styles.js +27 -0
- package/views/Opal/index.js +136 -0
- package/views/Opal/styles.js +11 -0
- package/views/PublicTransportTicket/index.js +173 -0
- package/views/PublicTransportTicket/styles.js +17 -0
- package/views/Search/index.js +186 -0
- package/views/Search/styles.js +67 -0
- package/views/SettingsAccessibility/index.js +148 -0
- package/views/SettingsAccessibility/styles.js +13 -0
- package/views/SettingsAppInfo/index.js +86 -0
- package/views/SettingsAppInfo/styles.js +18 -0
- package/views/SettingsCanteens/index.js +249 -0
- package/views/SettingsCanteens/styles.js +33 -0
- package/views/SettingsGeneral/index.js +173 -0
- package/views/SettingsGeneral/styles.js +28 -0
- package/views/SettingsNotifications/index.js +204 -0
- package/views/SettingsNotifications/styles.js +38 -0
- package/views/SettingsUser/index.js +170 -0
- package/views/SettingsUser/styles.js +17 -0
- package/views/TimetableCalendar/index.js +387 -0
- package/views/TimetableCalendar/styles.js +121 -0
- package/views/TimetableList/index.js +402 -0
- package/views/TimetableList/styles.js +55 -0
- package/views/Webviews/index.js +158 -0
- package/views/Webviews/styles.js +11 -0
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
|
|
2
|
+
//------------------------------------
|
|
3
|
+
// feed : Feeds of university
|
|
4
|
+
// -----------------------------------
|
|
5
|
+
|
|
6
|
+
// IMPORTANT: THIS CONTAINS ONLY V2 OF FEEDS
|
|
7
|
+
|
|
8
|
+
import {ApiSettings, GETOptionsByLanguage} from '../constants/api';
|
|
9
|
+
import {action, commitAction, rollbackAction} from "../constants/actions";
|
|
10
|
+
import {store} from "../redux/store";
|
|
11
|
+
|
|
12
|
+
const defaultType = action.feedV3.getFeeds;
|
|
13
|
+
const defaultTypeTopNews = action.feedV3.getTopNews;
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
export const feedApi = {
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Get list of feeds
|
|
20
|
+
*/
|
|
21
|
+
getFeeds: (res) => {
|
|
22
|
+
const language = store.getState().settingReducer.settingsGeneral.language;
|
|
23
|
+
fetch(ApiSettings.getApiUrl(ApiSettings.feedV3.getFeeds) + '?rn='+ new Date().getTime(), GETOptionsByLanguage(language))
|
|
24
|
+
.then((response) => response.json())
|
|
25
|
+
.then((resJson) => {
|
|
26
|
+
if(resJson.feeds) {
|
|
27
|
+
res(resJson.feeds);
|
|
28
|
+
} else {
|
|
29
|
+
res(null);
|
|
30
|
+
}
|
|
31
|
+
})
|
|
32
|
+
.catch((error) => {
|
|
33
|
+
console.warn('Error Code: 1001 : ' + error);
|
|
34
|
+
res(null);
|
|
35
|
+
})
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Get feed by id
|
|
40
|
+
*/
|
|
41
|
+
getFeedById: (id, res) => {
|
|
42
|
+
const language = store.getState().settingReducer.settingsGeneral.language;
|
|
43
|
+
let url = ApiSettings.getApiUrl(ApiSettings.feedV3.getFeedById);
|
|
44
|
+
url = url.replace('{feed-id}', id);
|
|
45
|
+
|
|
46
|
+
fetch(url, GETOptionsByLanguage(language))
|
|
47
|
+
.then((response) => {
|
|
48
|
+
return response.json();
|
|
49
|
+
})
|
|
50
|
+
.then((resJson) => {
|
|
51
|
+
if(resJson.items) {
|
|
52
|
+
res(resJson.items);
|
|
53
|
+
} else {
|
|
54
|
+
res(0);
|
|
55
|
+
}
|
|
56
|
+
})
|
|
57
|
+
.catch((error) => {
|
|
58
|
+
console.warn('Error Code: 1002 : ' + error);
|
|
59
|
+
res(-1);
|
|
60
|
+
})
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Search for news by given string
|
|
65
|
+
*/
|
|
66
|
+
getSearchForNews: (search, res) => {
|
|
67
|
+
let url = ApiSettings.getApiUrl(ApiSettings.feedV3.getSearchForNews);
|
|
68
|
+
url = url.replace('{search}', decodeURI(search).trim());
|
|
69
|
+
|
|
70
|
+
fetch(url, GETOptions)
|
|
71
|
+
.then((response) => {
|
|
72
|
+
return response.json();
|
|
73
|
+
})
|
|
74
|
+
.then((resJson) => {
|
|
75
|
+
if(resJson.items) {
|
|
76
|
+
res(resJson.items);
|
|
77
|
+
} else {
|
|
78
|
+
res(null);
|
|
79
|
+
}
|
|
80
|
+
})
|
|
81
|
+
.catch((error) => {
|
|
82
|
+
console.warn('Error Code: 1036 : ' + error);
|
|
83
|
+
res(null);
|
|
84
|
+
})
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
getNewsById(id, res) {
|
|
88
|
+
// https://urz-asist.hrz.tu-chemnitz.de/asist/rest/app/v3/feed/tuc/feed-items/25896
|
|
89
|
+
// https://urz-asist.hrz.tu-chemnitz.de/asist/rest/app/v3/feed/htwkl/feed-items/152
|
|
90
|
+
const language = store.getState().settingReducer.settingsGeneral.language;
|
|
91
|
+
let url = ApiSettings.getApiUrl(ApiSettings.feedV3.getNewsById);
|
|
92
|
+
url = url.replace('{feed-id}', id);
|
|
93
|
+
|
|
94
|
+
fetch(url, GETOptionsByLanguage(language))
|
|
95
|
+
.then((response) => {
|
|
96
|
+
return response.json();
|
|
97
|
+
})
|
|
98
|
+
.then((resJson) => {
|
|
99
|
+
if(resJson) {
|
|
100
|
+
res(resJson);
|
|
101
|
+
} else {
|
|
102
|
+
res(0);
|
|
103
|
+
}
|
|
104
|
+
})
|
|
105
|
+
.catch((error) => {
|
|
106
|
+
console.warn('Error Code: 1039 : ' + error);
|
|
107
|
+
res(-1);
|
|
108
|
+
})
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
export const updateFeeds = () => {
|
|
113
|
+
const language = store.getState().settingReducer.settingsGeneral.language;
|
|
114
|
+
const headers = GETOptionsByLanguage(language).headers;
|
|
115
|
+
return {
|
|
116
|
+
type: defaultType,
|
|
117
|
+
meta: {
|
|
118
|
+
offline: {
|
|
119
|
+
effect: { url: ApiSettings.getApiUrl(ApiSettings.feedV3.getFeeds), method: 'GET', headers },
|
|
120
|
+
commit: { type: defaultType + commitAction },
|
|
121
|
+
rollback: { type: defaultType + rollbackAction }
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
// REDUX - OFFLINE
|
|
129
|
+
|
|
130
|
+
export const updateTopNews = () => {
|
|
131
|
+
const language = store.getState().settingReducer.settingsGeneral.language;
|
|
132
|
+
const headers = GETOptionsByLanguage(language).headers;
|
|
133
|
+
return {
|
|
134
|
+
type: defaultTypeTopNews,
|
|
135
|
+
meta: {
|
|
136
|
+
offline: {
|
|
137
|
+
effect: {url: ApiSettings.getApiUrl(ApiSettings.feedV3.getTopNews), method: 'GET', headers},
|
|
138
|
+
commit: {type: defaultTypeTopNews + commitAction},
|
|
139
|
+
rollback: {type: defaultTypeTopNews + rollbackAction}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
|
|
2
|
+
//------------------------------------
|
|
3
|
+
// feedback : Feedback for Courses
|
|
4
|
+
// -----------------------------------
|
|
5
|
+
|
|
6
|
+
import {ApiSettings, GETOptions, POSTOptions} from '../constants/api';
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
export const feedbackApi = {
|
|
10
|
+
/**
|
|
11
|
+
* Get feedback
|
|
12
|
+
*/
|
|
13
|
+
getFeedback: (courseId, date, res) => {
|
|
14
|
+
let url = ApiSettings.getApiUrl(ApiSettings.feedback.getFeedback);
|
|
15
|
+
url = url.replace('{courseid}', courseId);
|
|
16
|
+
url = url.replace('{date}', date);
|
|
17
|
+
|
|
18
|
+
fetch(url, GETOptions)
|
|
19
|
+
.then((response) => response.json())
|
|
20
|
+
.then((resJson) => {
|
|
21
|
+
res(resJson);
|
|
22
|
+
})
|
|
23
|
+
.catch((error) => {
|
|
24
|
+
console.warn('Error Code: 1010 : ' + error);
|
|
25
|
+
res(null);
|
|
26
|
+
})
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Get speed
|
|
31
|
+
*/
|
|
32
|
+
getSpeed: (courseId, date, res) => {
|
|
33
|
+
let url = ApiSettings.getApiUrl(ApiSettings.feedback.getSpeed);
|
|
34
|
+
url = url.replace('{courseid}', courseId);
|
|
35
|
+
url = url.replace('{date}', date);
|
|
36
|
+
|
|
37
|
+
fetch(url, GETOptions)
|
|
38
|
+
.then((response) => response.json())
|
|
39
|
+
.then((resJson) => {
|
|
40
|
+
res(resJson);
|
|
41
|
+
})
|
|
42
|
+
.catch((error) => {
|
|
43
|
+
console.warn('Error Code: 1011 : ' + error);
|
|
44
|
+
res(null);
|
|
45
|
+
})
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Get question
|
|
50
|
+
*/
|
|
51
|
+
getQuestion: (courseId, date, res) => {
|
|
52
|
+
let url = ApiSettings.getApiUrl(ApiSettings.feedback.getQuestion);
|
|
53
|
+
url = url.replace('{courseid}', courseId);
|
|
54
|
+
url = url.replace('{date}', date);
|
|
55
|
+
|
|
56
|
+
fetch(url, GETOptions)
|
|
57
|
+
.then((response) => response.json())
|
|
58
|
+
.then((resJson) => {
|
|
59
|
+
res(resJson);
|
|
60
|
+
})
|
|
61
|
+
.catch((error) => {
|
|
62
|
+
console.warn('Error Code: 1012 : ' + error);
|
|
63
|
+
res(null);
|
|
64
|
+
})
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Post feedback
|
|
69
|
+
*/
|
|
70
|
+
postFeedback: (courseId, date, res) => {
|
|
71
|
+
let url = ApiSettings.getApiUrl(ApiSettings.feedback.postFeedback);
|
|
72
|
+
url = url.replace('{courseid}', courseId);
|
|
73
|
+
url = url.replace('{date}', date);
|
|
74
|
+
|
|
75
|
+
fetch(url, POSTOptions)
|
|
76
|
+
.then((response) => response.json())
|
|
77
|
+
.then((resJson) => {
|
|
78
|
+
res(resJson);
|
|
79
|
+
})
|
|
80
|
+
.catch((error) => {
|
|
81
|
+
console.warn('Error Code: 1013 : ' + error);
|
|
82
|
+
res(null);
|
|
83
|
+
})
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Post speed
|
|
88
|
+
*/
|
|
89
|
+
postSpeed: (courseId, date, res) => {
|
|
90
|
+
let url = ApiSettings.getApiUrl(ApiSettings.feedback.postSpeed);
|
|
91
|
+
url = url.replace('{courseid}', courseId);
|
|
92
|
+
url = url.replace('{date}', date);
|
|
93
|
+
|
|
94
|
+
fetch(url, POSTOptions)
|
|
95
|
+
.then((response) => response.json())
|
|
96
|
+
.then((resJson) => {
|
|
97
|
+
res(resJson);
|
|
98
|
+
})
|
|
99
|
+
.catch((error) => {
|
|
100
|
+
console.warn('Error Code: 1014 : ' + error);
|
|
101
|
+
})
|
|
102
|
+
},
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Post question
|
|
106
|
+
*/
|
|
107
|
+
postQuestion: (courseId, date, res) => {
|
|
108
|
+
let url = ApiSettings.getApiUrl(ApiSettings.feedback.postQuestion);
|
|
109
|
+
url = url.replace('{courseid}', courseId);
|
|
110
|
+
url = url.replace('{date}', date);
|
|
111
|
+
|
|
112
|
+
fetch(url, POSTOptions)
|
|
113
|
+
.then((response) => response.json())
|
|
114
|
+
.then((resJson) => {
|
|
115
|
+
res(resJson);
|
|
116
|
+
})
|
|
117
|
+
.catch((error) => {
|
|
118
|
+
console.warn('Error Code: 1015 : ' + error);
|
|
119
|
+
res(null);
|
|
120
|
+
})
|
|
121
|
+
},
|
|
122
|
+
|
|
123
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
|
|
2
|
+
//------------------------------------
|
|
3
|
+
// jobsApi : Jobs
|
|
4
|
+
// -----------------------------------
|
|
5
|
+
|
|
6
|
+
import {ApiSettings, GETOptions} from '../constants/api';
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
export const jobsApi = {
|
|
10
|
+
/**
|
|
11
|
+
* get all jobs
|
|
12
|
+
*/
|
|
13
|
+
getAllJobs: (res) => {
|
|
14
|
+
let url = ApiSettings.getApiUrl(ApiSettings.job.getJobs);
|
|
15
|
+
|
|
16
|
+
fetch(url, GETOptions)
|
|
17
|
+
.then((response) => response.json())
|
|
18
|
+
.then((resJson) => {
|
|
19
|
+
if(resJson) {
|
|
20
|
+
res(resJson);
|
|
21
|
+
} else {
|
|
22
|
+
res(null);
|
|
23
|
+
}
|
|
24
|
+
})
|
|
25
|
+
.catch((error) => {
|
|
26
|
+
console.warn('Error Code: 1037 : ' + error);
|
|
27
|
+
res(null);
|
|
28
|
+
})
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
getJobCategories: (res) => {
|
|
32
|
+
let url = ApiSettings.getApiUrl(ApiSettings.job.getJobCategories);
|
|
33
|
+
|
|
34
|
+
fetch(url, GETOptions)
|
|
35
|
+
.then((response) => response.json())
|
|
36
|
+
.then((resJson) => {
|
|
37
|
+
if(resJson) {
|
|
38
|
+
res(resJson);
|
|
39
|
+
} else {
|
|
40
|
+
res(null);
|
|
41
|
+
}
|
|
42
|
+
})
|
|
43
|
+
.catch((error) => {
|
|
44
|
+
console.warn('Error Code: 1038 : ' + error);
|
|
45
|
+
res(null);
|
|
46
|
+
})
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
|
|
2
|
+
//------------------------------------
|
|
3
|
+
// library : Books and stuff
|
|
4
|
+
// -----------------------------------
|
|
5
|
+
|
|
6
|
+
import {ApiSettings, GETOptions} from '../constants/api';
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
export const libraryApi = {
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Search for book
|
|
13
|
+
*/
|
|
14
|
+
getSearchForBooks: (search, res) => {
|
|
15
|
+
let url = ApiSettings.getApiUrl(ApiSettings.library.getSearchForBooks);
|
|
16
|
+
url = url.replace('{search}', decodeURI(search).trim().replace(' ','%2B'));
|
|
17
|
+
|
|
18
|
+
fetch(url, GETOptions)
|
|
19
|
+
.then((response) => response.json())
|
|
20
|
+
.then((resJson) => {
|
|
21
|
+
if(resJson && resJson.books) {
|
|
22
|
+
res(resJson.books);
|
|
23
|
+
} else {
|
|
24
|
+
res(null);
|
|
25
|
+
}
|
|
26
|
+
})
|
|
27
|
+
.catch((error) => {
|
|
28
|
+
console.warn('Error Code: 1016 : ' + error);
|
|
29
|
+
res(null);
|
|
30
|
+
})
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Get extended search
|
|
35
|
+
*/
|
|
36
|
+
getSearchExtended : (res) => {
|
|
37
|
+
fetch(ApiSettings.getApiUrl(ApiSettings.library.getSearchExtended), GETOptions)
|
|
38
|
+
.then((response) => response.json())
|
|
39
|
+
.then((resJson) => {
|
|
40
|
+
if(resJson && resJson.books) {
|
|
41
|
+
res(resJson.books);
|
|
42
|
+
}
|
|
43
|
+
})
|
|
44
|
+
.catch((error) => {
|
|
45
|
+
console.warn('Error Code: 1017 : ' + error);
|
|
46
|
+
res(null);
|
|
47
|
+
})
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Get search details by book id
|
|
52
|
+
*/
|
|
53
|
+
getSearchDetailsByBookId : (bookId, res) => {
|
|
54
|
+
let url = ApiSettings.getApiUrl(ApiSettings.library.getSearchDetailsByBookId);
|
|
55
|
+
url = url.replace('{bookId}', bookId);
|
|
56
|
+
|
|
57
|
+
fetch(url, GETOptions)
|
|
58
|
+
.then((response) => response.json())
|
|
59
|
+
.then((resJson) => {
|
|
60
|
+
res(resJson);
|
|
61
|
+
})
|
|
62
|
+
.catch((error) => {
|
|
63
|
+
console.warn('Error Code: 1018 : ' + error);
|
|
64
|
+
res(null);
|
|
65
|
+
})
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
|
|
2
|
+
//------------------------------------
|
|
3
|
+
// lostfound : Lost and found for university
|
|
4
|
+
// -----------------------------------
|
|
5
|
+
|
|
6
|
+
import {ApiSettings, POSTOptions, GETOptions} from '../constants/api';
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
export const lostfoundApi = {
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Get lost items
|
|
14
|
+
*/
|
|
15
|
+
getLostItems: (res) => {
|
|
16
|
+
fetch(ApiSettings.getApiUrl(ApiSettings.lostfound.getLostItems), GETOptions)
|
|
17
|
+
.then((response) => response.json())
|
|
18
|
+
.then((resJson) => {
|
|
19
|
+
res(resJson);
|
|
20
|
+
})
|
|
21
|
+
.catch((error) => {
|
|
22
|
+
console.warn('Error Code: 1019 : ' + error);
|
|
23
|
+
res(null);
|
|
24
|
+
})
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Get found items
|
|
29
|
+
*/
|
|
30
|
+
getFoundItems: (res) => {
|
|
31
|
+
fetch(ApiSettings.getApiUrl(ApiSettings.lostfound.getFoundItems), GETOptions)
|
|
32
|
+
.then((response) => response.json())
|
|
33
|
+
.then((resJson) => {
|
|
34
|
+
res(resJson);
|
|
35
|
+
})
|
|
36
|
+
.catch((error) => {
|
|
37
|
+
console.warn('Error Code: 1020 : ' + error);
|
|
38
|
+
res(null);
|
|
39
|
+
})
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Report a item as found
|
|
44
|
+
*/
|
|
45
|
+
postReportItemAsFound: (deviceId, res) => {
|
|
46
|
+
let url = ApiSettings.getApiUrl(ApiSettings.lostfound.postReportItemAsFound);
|
|
47
|
+
url = url.replace('{deviceId}', deviceId);
|
|
48
|
+
|
|
49
|
+
fetch(url, POSTOptions)
|
|
50
|
+
.then((response) => response.json())
|
|
51
|
+
.then((resJson) => {
|
|
52
|
+
res(resJson);
|
|
53
|
+
})
|
|
54
|
+
.catch((error) => {
|
|
55
|
+
console.warn('Error Code: 1021 : ' + error);
|
|
56
|
+
res(null);
|
|
57
|
+
})
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Report a item as found
|
|
62
|
+
*/
|
|
63
|
+
postReportItemAsLost: (deviceId, res) => {
|
|
64
|
+
let url = ApiSettings.getApiUrl(ApiSettings.lostfound.postReportItemAsLost);
|
|
65
|
+
url = url.replace('{deviceId}', deviceId);
|
|
66
|
+
|
|
67
|
+
fetch(url, POSTOptions)
|
|
68
|
+
.then((response) => response.json())
|
|
69
|
+
.then((resJson) => {
|
|
70
|
+
res(resJson);
|
|
71
|
+
})
|
|
72
|
+
.catch((error) => {
|
|
73
|
+
console.warn('Error Code: 1022 : ' + error);
|
|
74
|
+
res(null);
|
|
75
|
+
})
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
|
|
2
|
+
//------------------------------------
|
|
3
|
+
// occupancy : Occupancy for specific POI
|
|
4
|
+
// -----------------------------------
|
|
5
|
+
|
|
6
|
+
import {ApiSettings, GETOptions} from '../constants/api';
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
export const occupanciesApi = {
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Get occupancies
|
|
14
|
+
*/
|
|
15
|
+
getOccupancies: (res) => {
|
|
16
|
+
fetch(ApiSettings.getApiUrl(ApiSettings.occupancy.getOccupancies), GETOptions)
|
|
17
|
+
.then((response) => response.json())
|
|
18
|
+
.then((resJson) => {
|
|
19
|
+
res(resJson);
|
|
20
|
+
})
|
|
21
|
+
.catch((error) => {
|
|
22
|
+
console.warn('Error Code: 1023 : ' + error);
|
|
23
|
+
res(null);
|
|
24
|
+
})
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Get occupancies of points of interesst
|
|
29
|
+
*/
|
|
30
|
+
getOccupanciesOfPoi: (poiId, res) => {
|
|
31
|
+
let url = ApiSettings.getApiUrl(ApiSettings.occupancy.getOccupanciesOfPoi);
|
|
32
|
+
url = url.replace('{poiid}', poiId);
|
|
33
|
+
|
|
34
|
+
fetch(url, GETOptions)
|
|
35
|
+
.then((response) => response.json())
|
|
36
|
+
.then((resJson) => {
|
|
37
|
+
res(resJson);
|
|
38
|
+
})
|
|
39
|
+
.catch((error) => {
|
|
40
|
+
console.warn('Error Code: 1024 : ' + error);
|
|
41
|
+
res(null);
|
|
42
|
+
})
|
|
43
|
+
}
|
|
44
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
|
|
2
|
+
//------------------------------------
|
|
3
|
+
// officehours : Office Hourse for specific POI
|
|
4
|
+
// -----------------------------------
|
|
5
|
+
|
|
6
|
+
import {ApiSettings, GETOptions} from '../constants/api';
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
export const officeHoursApi = {
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Get current weather
|
|
13
|
+
*/
|
|
14
|
+
getOfficehours: (res) => {
|
|
15
|
+
fetch(ApiSettings.getApiUrl(ApiSettings.officeHours.getOfficehours), GETOptions)
|
|
16
|
+
.then((response) => response.json())
|
|
17
|
+
.then((resJson) => {
|
|
18
|
+
res(resJson);
|
|
19
|
+
})
|
|
20
|
+
.catch((error) => {
|
|
21
|
+
console.warn('Error Code: 1025 : ' + error);
|
|
22
|
+
res(null);
|
|
23
|
+
})
|
|
24
|
+
}
|
|
25
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
|
|
2
|
+
//------------------------------------
|
|
3
|
+
// poi : Points of Interest for given university
|
|
4
|
+
// -----------------------------------
|
|
5
|
+
|
|
6
|
+
import {ApiSettings, GETOptions} from '../constants/api';
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
export const poiApi = {
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Get current weather
|
|
13
|
+
*/
|
|
14
|
+
getPointsOfInterest: (res) => {
|
|
15
|
+
fetch(ApiSettings.getApiUrl(ApiSettings.poi.getPointsOfInterest), GETOptions)
|
|
16
|
+
.then((response) => response.json())
|
|
17
|
+
.then((resJson) => {
|
|
18
|
+
res(resJson);
|
|
19
|
+
})
|
|
20
|
+
.catch((error) => {
|
|
21
|
+
console.warn('Error Code: 1026 : ' + error);
|
|
22
|
+
res(null);
|
|
23
|
+
})
|
|
24
|
+
}
|
|
25
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
|
|
2
|
+
//------------------------------------
|
|
3
|
+
// pts : public transportation system
|
|
4
|
+
// -----------------------------------
|
|
5
|
+
|
|
6
|
+
import {ApiSettings, GETOptions} from '../constants/api';
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
export const ptsApi = {
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Get stations
|
|
13
|
+
*/
|
|
14
|
+
getStations: (res) => {
|
|
15
|
+
fetch(ApiSettings.getApiUrl(ApiSettings.pts.getStations), GETOptions)
|
|
16
|
+
.then((response) => response.json())
|
|
17
|
+
.then((resJson) => {
|
|
18
|
+
res(resJson);
|
|
19
|
+
})
|
|
20
|
+
.catch((error) => {
|
|
21
|
+
console.warn('Error Code: 1027 : ' + error);
|
|
22
|
+
res(null);
|
|
23
|
+
})
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Get nearby stations
|
|
28
|
+
*/
|
|
29
|
+
getNearbyStations: (latitude, longitude, res) => {
|
|
30
|
+
let url = ApiSettings.getApiUrl(ApiSettings.pts.getNearbyStations);
|
|
31
|
+
url = url.replace('{latitude}', latitude);
|
|
32
|
+
url = url.replace('{longitude}', longitude);
|
|
33
|
+
|
|
34
|
+
fetch(url, GETOptions)
|
|
35
|
+
.then((response) => response.json())
|
|
36
|
+
.then((resJson) => {
|
|
37
|
+
res(resJson);
|
|
38
|
+
})
|
|
39
|
+
.catch((error) => {
|
|
40
|
+
console.warn('Error Code: 1028 : ' + error);
|
|
41
|
+
res(null);
|
|
42
|
+
})
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Get favorite stations
|
|
47
|
+
*/
|
|
48
|
+
getFavoritesStations: (stations, res) => {
|
|
49
|
+
let url = ApiSettings.getApiUrl(ApiSettings.pts.getFavoritesStations);
|
|
50
|
+
let stationText = '';
|
|
51
|
+
stations.forEach(station => {
|
|
52
|
+
stationText += 'station=CAG-' + station + '&';
|
|
53
|
+
});
|
|
54
|
+
stationText = stationText.substring(0, stationText.length - 1);
|
|
55
|
+
|
|
56
|
+
url = url.replace('{stations}', stationText);
|
|
57
|
+
|
|
58
|
+
fetch(url, GETOptions)
|
|
59
|
+
.then((response) => response.json())
|
|
60
|
+
.then((resJson) => {
|
|
61
|
+
res(resJson);
|
|
62
|
+
})
|
|
63
|
+
.catch((error) => {
|
|
64
|
+
console.warn('Error Code: 1036 : ' + error);
|
|
65
|
+
res(null);
|
|
66
|
+
})
|
|
67
|
+
}
|
|
68
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
|
|
2
|
+
//------------------------------------
|
|
3
|
+
// tucroomsApi : Rooms and stuff
|
|
4
|
+
// -----------------------------------
|
|
5
|
+
|
|
6
|
+
import {ApiSettings, GETOptions} from '../constants/api';
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
export const roomsApi = {
|
|
10
|
+
/**
|
|
11
|
+
* Search for rooms
|
|
12
|
+
*/
|
|
13
|
+
getSearchForRooms: (search, res) => {
|
|
14
|
+
let url = ApiSettings.getApiUrl(ApiSettings.rooms.getSearchForRooms);
|
|
15
|
+
url = url.replace('{search}', decodeURI(search).trim().replace(' ','%2B'));
|
|
16
|
+
|
|
17
|
+
fetch(url, GETOptions)
|
|
18
|
+
.then((response) => response.json())
|
|
19
|
+
.then((resJson) => {
|
|
20
|
+
if(resJson && resJson.length > 0) {
|
|
21
|
+
res(resJson);
|
|
22
|
+
} else {
|
|
23
|
+
res(null);
|
|
24
|
+
}
|
|
25
|
+
})
|
|
26
|
+
.catch((error) => {
|
|
27
|
+
console.warn('Error Code: 1020 : ' + error, url, GETOptions);
|
|
28
|
+
res(null);
|
|
29
|
+
})
|
|
30
|
+
}
|
|
31
|
+
}
|