Commit c825c8d5a4c72c9646f30b8db09975dd166a5dc5

Authored by kristinlaahneolsen
1 parent 917cbd16

Siden Cassandra var greit å installere på mac, har Ali og Kristin jobbet i lag m…

…ed å sette opp en tilhørende keyspace med tabeller til applikasjonen vår. Foreløpig fungerer API for å hente ut og legge til hendelser, men kun på lokal maskin iom at contacktPoint er satt til localhost
Showing 737 changed files with 96222 additions and 173 deletions   Show diff stats

Too many changes.

To preserve performance only 100 of 737 files are displayed.

.DS_Store
No preview for this file type
Risiko/.idea/misc.xml
... ... @@ -24,7 +24,7 @@
24 24 </value>
25 25 </option>
26 26 </component>
27   - <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8 (1)" project-jdk-type="JavaSDK">
  27 + <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
28 28 <output url="file://$PROJECT_DIR$/build/classes" />
29 29 </component>
30 30 <component name="ProjectType">
... ...
restApi/.DS_Store 0 → 100644
No preview for this file type
restApi/.idea/restApi.iml
... ... @@ -4,5 +4,15 @@
4 4 <content url="file://$MODULE_DIR$" />
5 5 <orderEntry type="inheritedJdk" />
6 6 <orderEntry type="sourceFolder" forTests="false" />
  7 + <orderEntry type="module-library">
  8 + <library name="PHP Runtime" type="php">
  9 + <CLASSES>
  10 + <root url="jar://$APPLICATION_HOME_DIR$/plugins/php/lib/php.jar!/stubs/standard" />
  11 + </CLASSES>
  12 + <SOURCES>
  13 + <root url="jar://$APPLICATION_HOME_DIR$/plugins/php/lib/php.jar!/stubs/standard" />
  14 + </SOURCES>
  15 + </library>
  16 + </orderEntry>
7 17 </component>
8 18 </module>
9 19 \ No newline at end of file
... ...
restApi/.idea/workspace.xml
... ... @@ -2,18 +2,25 @@
2 2 <project version="4">
3 3 <component name="ChangeListManager">
4 4 <list default="true" id="8a337026-05ab-47b0-872d-ab1e8037e9a0" name="Default" comment="">
5   - <change afterPath="$PROJECT_DIR$/api/modules/activity.js" afterDir="false" />
6   - <change afterPath="$PROJECT_DIR$/api/modules/evaluation.js" afterDir="false" />
7   - <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
8   - <change beforePath="$PROJECT_DIR$/api/models/incident.js" beforeDir="false" afterPath="$PROJECT_DIR$/api/modules/incident.js" afterDir="false" />
9   - <change beforePath="$PROJECT_DIR$/api/routes/routes.js" beforeDir="false" afterPath="$PROJECT_DIR$/api/routes/routes.js" afterDir="false" />
  5 + <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../Risiko/.idea/misc.xml" afterPath="$PROJECT_DIR$/../Risiko/.idea/misc.xml" />
  6 + <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/restApi.iml" afterPath="$PROJECT_DIR$/.idea/restApi.iml" />
  7 + <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
  8 + <change type="MODIFICATION" beforePath="$PROJECT_DIR$/api/routes/routes.js" afterPath="$PROJECT_DIR$/api/routes/routes.js" />
  9 + <change type="MODIFICATION" beforePath="$PROJECT_DIR$/package-lock.json" afterPath="$PROJECT_DIR$/package-lock.json" />
  10 + <change type="MODIFICATION" beforePath="$PROJECT_DIR$/package.json" afterPath="$PROJECT_DIR$/package.json" />
  11 + <change type="MODIFICATION" beforePath="$PROJECT_DIR$/server.js" afterPath="$PROJECT_DIR$/server.js" />
10 12 </list>
11 13 <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
  14 + <option name="TRACKING_ENABLED" value="true" />
12 15 <option name="SHOW_DIALOG" value="false" />
13 16 <option name="HIGHLIGHT_CONFLICTS" value="true" />
14 17 <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
15 18 <option name="LAST_RESOLUTION" value="IGNORE" />
16 19 </component>
  20 + <component name="CreatePatchCommitExecutor">
  21 + <option name="PATCH_PATH" value="" />
  22 + </component>
  23 + <component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
17 24 <component name="FUSProjectUsageTrigger">
18 25 <session id="920369055">
19 26 <usages-collector id="statistics.lifecycle.project">
... ... @@ -51,38 +58,72 @@
51 58 </component>
52 59 <component name="FileEditorManager">
53 60 <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
54   - <file pinned="false" current-in-tab="true">
  61 + <file leaf-file-name="routes.js" pinned="false" current-in-tab="true">
55 62 <entry file="file://$PROJECT_DIR$/api/routes/routes.js">
56 63 <provider selected="true" editor-type-id="text-editor">
57   - <state relative-caret-position="187">
58   - <caret line="11" column="208" lean-forward="true" selection-start-line="11" selection-start-column="208" selection-end-line="11" selection-end-column="208" />
  64 + <state relative-caret-position="420">
  65 + <caret line="115" column="47" lean-forward="false" selection-start-line="115" selection-start-column="47" selection-end-line="115" selection-end-column="47" />
  66 + <folding />
59 67 </state>
60 68 </provider>
61 69 </entry>
62 70 </file>
63   - <file pinned="false" current-in-tab="false">
  71 + <file leaf-file-name="server.js" pinned="false" current-in-tab="false">
  72 + <entry file="file://$PROJECT_DIR$/server.js">
  73 + <provider selected="true" editor-type-id="text-editor">
  74 + <state relative-caret-position="105">
  75 + <caret line="7" column="0" lean-forward="false" selection-start-line="7" selection-start-column="0" selection-end-line="7" selection-end-column="0" />
  76 + <folding />
  77 + </state>
  78 + </provider>
  79 + </entry>
  80 + </file>
  81 + <file leaf-file-name="README.txt" pinned="false" current-in-tab="false">
  82 + <entry file="file://$PROJECT_DIR$/README.txt">
  83 + <provider selected="true" editor-type-id="text-editor">
  84 + <state relative-caret-position="120">
  85 + <caret line="8" column="58" lean-forward="false" selection-start-line="8" selection-start-column="58" selection-end-line="8" selection-end-column="58" />
  86 + <folding />
  87 + </state>
  88 + </provider>
  89 + </entry>
  90 + </file>
  91 + <file leaf-file-name="package.json" pinned="false" current-in-tab="false">
  92 + <entry file="file://$PROJECT_DIR$/package.json">
  93 + <provider selected="true" editor-type-id="text-editor">
  94 + <state relative-caret-position="360">
  95 + <caret line="24" column="0" lean-forward="false" selection-start-line="24" selection-start-column="0" selection-end-line="24" selection-end-column="0" />
  96 + <folding />
  97 + </state>
  98 + </provider>
  99 + </entry>
  100 + </file>
  101 + <file leaf-file-name="incident.js" pinned="false" current-in-tab="false">
64 102 <entry file="file://$PROJECT_DIR$/api/modules/incident.js">
65 103 <provider selected="true" editor-type-id="text-editor">
66   - <state relative-caret-position="153">
67   - <caret line="9" column="1" selection-start-line="9" selection-start-column="1" selection-end-line="9" selection-end-column="1" />
  104 + <state relative-caret-position="135">
  105 + <caret line="9" column="1" lean-forward="false" selection-start-line="9" selection-start-column="1" selection-end-line="9" selection-end-column="1" />
  106 + <folding />
68 107 </state>
69 108 </provider>
70 109 </entry>
71 110 </file>
72   - <file pinned="false" current-in-tab="false">
  111 + <file leaf-file-name="activity.js" pinned="false" current-in-tab="false">
73 112 <entry file="file://$PROJECT_DIR$/api/modules/activity.js">
74 113 <provider selected="true" editor-type-id="text-editor">
75   - <state>
76   - <caret column="19" selection-start-column="19" selection-end-column="19" />
  114 + <state relative-caret-position="0">
  115 + <caret line="0" column="19" lean-forward="false" selection-start-line="0" selection-start-column="19" selection-end-line="0" selection-end-column="19" />
  116 + <folding />
77 117 </state>
78 118 </provider>
79 119 </entry>
80 120 </file>
81   - <file pinned="false" current-in-tab="false">
  121 + <file leaf-file-name="evaluation.js" pinned="false" current-in-tab="false">
82 122 <entry file="file://$PROJECT_DIR$/api/modules/evaluation.js">
83 123 <provider selected="true" editor-type-id="text-editor">
84   - <state relative-caret-position="170">
85   - <caret line="10" column="1" selection-start-line="10" selection-start-column="1" selection-end-line="10" selection-end-column="1" />
  124 + <state relative-caret-position="150">
  125 + <caret line="10" column="1" lean-forward="false" selection-start-line="10" selection-start-column="1" selection-end-line="10" selection-end-column="1" />
  126 + <folding />
86 127 </state>
87 128 </provider>
88 129 </entry>
... ... @@ -121,14 +162,14 @@
121 162 <option value="$PROJECT_DIR$/api/controllers/risikoController.js" />
122 163 <option value="$PROJECT_DIR$/api/models/evaluationModel.js" />
123 164 <option value="$PROJECT_DIR$/api/routes/evaluationRoutes.js" />
124   - <option value="$PROJECT_DIR$/package.json" />
125   - <option value="$PROJECT_DIR$/server.js" />
126 165 <option value="$PROJECT_DIR$/api/models/Incident.js" />
127 166 <option value="$PROJECT_DIR$/api/models/models.js" />
128 167 <option value="$PROJECT_DIR$/api/models/incident.js" />
129 168 <option value="$PROJECT_DIR$/api/modules/incident.js" />
130 169 <option value="$PROJECT_DIR$/api/modules/evaluation.js" />
131 170 <option value="$PROJECT_DIR$/api/modules/activity.js" />
  171 + <option value="$PROJECT_DIR$/server.js" />
  172 + <option value="$PROJECT_DIR$/package.json" />
132 173 <option value="$PROJECT_DIR$/api/routes/routes.js" />
133 174 </list>
134 175 </option>
... ... @@ -150,53 +191,82 @@
150 191 </packageJsonPaths>
151 192 </component>
152 193 <component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" />
153   - <component name="ProjectFrameBounds" extendedState="6">
154   - <option name="x" value="-8" />
155   - <option name="y" value="-8" />
156   - <option name="width" value="1936" />
157   - <option name="height" value="1056" />
  194 + <component name="ProjectFrameBounds">
  195 + <option name="y" value="23" />
  196 + <option name="width" value="1440" />
  197 + <option name="height" value="873" />
158 198 </component>
159 199 <component name="ProjectLevelVcsManager" settingsEditedManually="true" />
160 200 <component name="ProjectView">
161   - <navigator proportions="" version="1">
  201 + <navigator currentView="ProjectPane" proportions="" version="1">
  202 + <flattenPackages />
  203 + <showMembers />
  204 + <showModules />
  205 + <showLibraryContents />
  206 + <hideEmptyPackages />
  207 + <abbreviatePackageNames />
  208 + <autoscrollToSource />
  209 + <autoscrollFromSource />
  210 + <sortByType />
  211 + <manualOrder />
162 212 <foldersAlwaysOnTop value="true" />
163 213 </navigator>
164 214 <panes>
  215 + <pane id="Scope" />
165 216 <pane id="ProjectPane">
166 217 <subPane>
167   - <expand>
168   - <path>
169   - <item name="restApi" type="b2602c69:ProjectViewProjectNode" />
170   - <item name="restApi" type="462c0819:PsiDirectoryNode" />
171   - </path>
172   - <path>
173   - <item name="restApi" type="b2602c69:ProjectViewProjectNode" />
174   - <item name="restApi" type="462c0819:PsiDirectoryNode" />
175   - <item name="api" type="462c0819:PsiDirectoryNode" />
176   - </path>
177   - <path>
178   - <item name="restApi" type="b2602c69:ProjectViewProjectNode" />
179   - <item name="restApi" type="462c0819:PsiDirectoryNode" />
180   - <item name="api" type="462c0819:PsiDirectoryNode" />
181   - <item name="modules" type="462c0819:PsiDirectoryNode" />
182   - </path>
183   - <path>
184   - <item name="restApi" type="b2602c69:ProjectViewProjectNode" />
185   - <item name="restApi" type="462c0819:PsiDirectoryNode" />
186   - <item name="api" type="462c0819:PsiDirectoryNode" />
187   - <item name="routes" type="462c0819:PsiDirectoryNode" />
188   - </path>
189   - </expand>
190   - <select />
  218 + <PATH>
  219 + <PATH_ELEMENT>
  220 + <option name="myItemId" value="restApi" />
  221 + <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
  222 + </PATH_ELEMENT>
  223 + <PATH_ELEMENT>
  224 + <option name="myItemId" value="restApi" />
  225 + <option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
  226 + </PATH_ELEMENT>
  227 + </PATH>
  228 + <PATH>
  229 + <PATH_ELEMENT>
  230 + <option name="myItemId" value="restApi" />
  231 + <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
  232 + </PATH_ELEMENT>
  233 + <PATH_ELEMENT>
  234 + <option name="myItemId" value="restApi" />
  235 + <option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
  236 + </PATH_ELEMENT>
  237 + <PATH_ELEMENT>
  238 + <option name="myItemId" value="api" />
  239 + <option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
  240 + </PATH_ELEMENT>
  241 + <PATH_ELEMENT>
  242 + <option name="myItemId" value="routes" />
  243 + <option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
  244 + </PATH_ELEMENT>
  245 + </PATH>
  246 + <PATH>
  247 + <PATH_ELEMENT>
  248 + <option name="myItemId" value="restApi" />
  249 + <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
  250 + </PATH_ELEMENT>
  251 + <PATH_ELEMENT>
  252 + <option name="myItemId" value="restApi" />
  253 + <option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
  254 + </PATH_ELEMENT>
  255 + <PATH_ELEMENT>
  256 + <option name="myItemId" value="api" />
  257 + <option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
  258 + </PATH_ELEMENT>
  259 + </PATH>
191 260 </subPane>
192 261 </pane>
193   - <pane id="Scope" />
  262 + <pane id="Scratches" />
194 263 </panes>
195 264 </component>
196 265 <component name="PropertiesComponent">
197 266 <property name="WebServerToolWindowFactoryState" value="false" />
198 267 <property name="last_opened_file_path" value="$PROJECT_DIR$" />
199 268 <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
  269 + <property name="nodejs_interpreter_path" value="/usr/local/bin/node" />
200 270 </component>
201 271 <component name="RunDashboard">
202 272 <option name="ruleStates">
... ... @@ -211,85 +281,13 @@
211 281 </option>
212 282 </component>
213 283 <component name="RunManager">
214   - <configuration default="true" type="Applet" factoryName="Applet">
215   - <module />
216   - <option name="WIDTH" value="400" />
217   - <option name="HEIGHT" value="300" />
218   - <option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
219   - <method />
220   - </configuration>
221   - <configuration default="true" type="Application" factoryName="Application">
222   - <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
223   - <option name="MAIN_CLASS_NAME" />
224   - <option name="VM_PARAMETERS" />
225   - <option name="PROGRAM_PARAMETERS" />
226   - <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
227   - <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
228   - <option name="ALTERNATIVE_JRE_PATH" />
229   - <option name="ENABLE_SWING_INSPECTOR" value="false" />
230   - <option name="ENV_VARIABLES" />
231   - <option name="PASS_PARENT_ENVS" value="true" />
232   - <module name="" />
233   - <envs />
234   - <method />
235   - </configuration>
236   - <configuration default="true" type="JUnit" factoryName="JUnit">
237   - <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
238   - <module name="" />
239   - <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
240   - <option name="ALTERNATIVE_JRE_PATH" />
241   - <option name="PACKAGE_NAME" />
242   - <option name="MAIN_CLASS_NAME" />
243   - <option name="METHOD_NAME" />
244   - <option name="TEST_OBJECT" value="class" />
245   - <option name="VM_PARAMETERS" value="-ea" />
246   - <option name="PARAMETERS" />
247   - <option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
248   - <option name="ENV_VARIABLES" />
249   - <option name="PASS_PARENT_ENVS" value="true" />
250   - <option name="TEST_SEARCH_SCOPE">
251   - <value defaultName="singleModule" />
252   - </option>
253   - <envs />
254   - <patterns />
255   - <method />
256   - </configuration>
257   - <configuration default="true" type="TestNG" factoryName="TestNG">
258   - <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
259   - <module name="" />
260   - <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
261   - <option name="ALTERNATIVE_JRE_PATH" />
262   - <option name="SUITE_NAME" />
263   - <option name="PACKAGE_NAME" />
264   - <option name="MAIN_CLASS_NAME" />
265   - <option name="METHOD_NAME" />
266   - <option name="GROUP_NAME" />
267   - <option name="TEST_OBJECT" value="CLASS" />
268   - <option name="VM_PARAMETERS" value="-ea" />
269   - <option name="PARAMETERS" />
270   - <option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
271   - <option name="OUTPUT_DIRECTORY" />
272   - <option name="ANNOTATION_TYPE" />
273   - <option name="ENV_VARIABLES" />
274   - <option name="PASS_PARENT_ENVS" value="true" />
275   - <option name="TEST_SEARCH_SCOPE">
276   - <value defaultName="singleModule" />
277   - </option>
278   - <option name="USE_DEFAULT_REPORTERS" value="false" />
279   - <option name="PROPERTIES_FILE" />
280   - <envs />
281   - <properties />
282   - <listeners />
283   - <method />
284   - </configuration>
285   - <configuration default="true" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
286   - <module name="" />
287   - <option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
288   - <option name="PROGRAM_PARAMETERS" />
289   - <predefined_log_file id="idea.log" enabled="true" />
  284 + <configuration default="true" type="NodeJSConfigurationType" factoryName="Node.js" path-to-node="project" working-dir="">
290 285 <method />
291 286 </configuration>
292 287 </component>
  288 + <component name="ShelveChangesManager" show_recycled="false">
  289 + <option name="remove_strategy" value="false" />
  290 + </component>
293 291 <component name="SvnConfiguration">
294 292 <configuration />
295 293 </component>
... ... @@ -305,88 +303,136 @@
305 303 <workItem from="1538838941552" duration="10339000" />
306 304 <workItem from="1538928470276" duration="5791000" />
307 305 <workItem from="1538934478875" duration="76000" />
  306 + <workItem from="1540900056741" duration="7082000" />
308 307 </task>
309 308 <servers />
310 309 </component>
311 310 <component name="TimeTrackingManager">
312   - <option name="totallyTimeSpent" value="17464000" />
  311 + <option name="totallyTimeSpent" value="24546000" />
313 312 </component>
314 313 <component name="ToolWindowManager">
315   - <frame x="-8" y="-8" width="2576" height="1416" extended-state="6" />
  314 + <frame x="0" y="23" width="1440" height="873" extended-state="0" />
  315 + <editor active="true" />
316 316 <layout>
317   - <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.19897558" />
318   - <window_info id="Structure" order="1" weight="0.25" />
319   - <window_info id="npm" order="2" side_tool="true" />
320   - <window_info id="Favorites" order="3" side_tool="true" />
321   - <window_info anchor="bottom" id="Message" order="0" />
322   - <window_info anchor="bottom" id="Find" order="1" />
323   - <window_info anchor="bottom" id="Run" order="2" />
324   - <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
325   - <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
326   - <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
327   - <window_info anchor="bottom" id="TODO" order="6" />
328   - <window_info anchor="bottom" id="Docker" order="7" show_stripe_button="false" />
329   - <window_info anchor="bottom" id="Version Control" order="8" />
330   - <window_info anchor="bottom" id="Terminal" order="9" />
331   - <window_info anchor="bottom" id="Event Log" order="10" side_tool="true" />
332   - <window_info anchor="right" id="Commander" order="0" weight="0.4" />
333   - <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
334   - <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
335   - <window_info anchor="right" id="Database" order="3" />
  317 + <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
  318 + <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
  319 + <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
  320 + <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
  321 + <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.329602" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
  322 + <window_info id="npm" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
  323 + <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
  324 + <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
  325 + <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
  326 + <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
  327 + <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
  328 + <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
  329 + <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
  330 + <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
  331 + <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
  332 + <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
  333 + <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
  334 + <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
336 335 </layout>
337 336 </component>
338 337 <component name="TypeScriptGeneratedFilesManager">
339   - <option name="version" value="1" />
  338 + <option name="processedProjectFiles" value="true" />
340 339 </component>
341 340 <component name="VcsContentAnnotationSettings">
342 341 <option name="myLimit" value="2678400000" />
343 342 </component>
  343 + <component name="XDebuggerManager">
  344 + <breakpoint-manager />
  345 + <watches-manager />
  346 + </component>
344 347 <component name="editorHistoryManager">
345   - <entry file="file://$PROJECT_DIR$/api/models/evaluationModel.js" />
346   - <entry file="file://$PROJECT_DIR$/api/models/models.js" />
347   - <entry file="file://$PROJECT_DIR$/api/controllers/evaluationController.js" />
348   - <entry file="file://$PROJECT_DIR$/package.json">
  348 + <entry file="file://$PROJECT_DIR$/api/routes/routes.js">
349 349 <provider selected="true" editor-type-id="text-editor">
350   - <state relative-caret-position="119">
351   - <caret line="7" column="21" selection-start-line="7" selection-start-column="21" selection-end-line="7" selection-end-column="21" />
  350 + <state relative-caret-position="0">
  351 + <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
  352 + <folding />
352 353 </state>
353 354 </provider>
354 355 </entry>
355   - <entry file="file://$PROJECT_DIR$/package-lock.json">
356   - <provider selected="true" editor-type-id="text-editor" />
  356 + <entry file="file://$PROJECT_DIR$/api/modules/incident.js">
  357 + <provider selected="true" editor-type-id="text-editor">
  358 + <state relative-caret-position="135">
  359 + <caret line="9" column="1" lean-forward="false" selection-start-line="9" selection-start-column="1" selection-end-line="9" selection-end-column="1" />
  360 + <folding />
  361 + </state>
  362 + </provider>
357 363 </entry>
358   - <entry file="file://$PROJECT_DIR$/server.js">
  364 + <entry file="file://$PROJECT_DIR$/api/modules/activity.js">
359 365 <provider selected="true" editor-type-id="text-editor">
360   - <state relative-caret-position="272">
361   - <caret line="16" column="3" selection-start-line="16" selection-start-column="3" selection-end-line="16" selection-end-column="3" />
  366 + <state relative-caret-position="0">
  367 + <caret line="0" column="19" lean-forward="false" selection-start-line="0" selection-start-column="19" selection-end-line="0" selection-end-column="19" />
  368 + <folding />
362 369 </state>
363 370 </provider>
364 371 </entry>
365   - <entry file="file://$PROJECT_DIR$/api/routes/routes.js">
  372 + <entry file="file://$PROJECT_DIR$/api/modules/evaluation.js">
366 373 <provider selected="true" editor-type-id="text-editor">
367   - <state relative-caret-position="187">
368   - <caret line="11" column="208" lean-forward="true" selection-start-line="11" selection-start-column="208" selection-end-line="11" selection-end-column="208" />
  374 + <state relative-caret-position="150">
  375 + <caret line="10" column="1" lean-forward="false" selection-start-line="10" selection-start-column="1" selection-end-line="10" selection-end-column="1" />
  376 + <folding />
369 377 </state>
370 378 </provider>
371 379 </entry>
  380 + <entry file="file://$PROJECT_DIR$/api/models/evaluationModel.js" />
  381 + <entry file="file://$PROJECT_DIR$/api/models/models.js" />
  382 + <entry file="file://$PROJECT_DIR$/api/controllers/evaluationController.js" />
372 383 <entry file="file://$PROJECT_DIR$/api/modules/incident.js">
373 384 <provider selected="true" editor-type-id="text-editor">
374   - <state relative-caret-position="153">
375   - <caret line="9" column="1" selection-start-line="9" selection-start-column="1" selection-end-line="9" selection-end-column="1" />
  385 + <state relative-caret-position="135">
  386 + <caret line="9" column="1" lean-forward="false" selection-start-line="9" selection-start-column="1" selection-end-line="9" selection-end-column="1" />
  387 + <folding />
376 388 </state>
377 389 </provider>
378 390 </entry>
379 391 <entry file="file://$PROJECT_DIR$/api/modules/activity.js">
380 392 <provider selected="true" editor-type-id="text-editor">
381   - <state>
382   - <caret column="19" selection-start-column="19" selection-end-column="19" />
  393 + <state relative-caret-position="0">
  394 + <caret line="0" column="19" lean-forward="false" selection-start-line="0" selection-start-column="19" selection-end-line="0" selection-end-column="19" />
  395 + <folding />
383 396 </state>
384 397 </provider>
385 398 </entry>
386 399 <entry file="file://$PROJECT_DIR$/api/modules/evaluation.js">
387 400 <provider selected="true" editor-type-id="text-editor">
388   - <state relative-caret-position="170">
389   - <caret line="10" column="1" selection-start-line="10" selection-start-column="1" selection-end-line="10" selection-end-column="1" />
  401 + <state relative-caret-position="150">
  402 + <caret line="10" column="1" lean-forward="false" selection-start-line="10" selection-start-column="1" selection-end-line="10" selection-end-column="1" />
  403 + <folding />
  404 + </state>
  405 + </provider>
  406 + </entry>
  407 + <entry file="file://$PROJECT_DIR$/README.txt">
  408 + <provider selected="true" editor-type-id="text-editor">
  409 + <state relative-caret-position="120">
  410 + <caret line="8" column="58" lean-forward="false" selection-start-line="8" selection-start-column="58" selection-end-line="8" selection-end-column="58" />
  411 + <folding />
  412 + </state>
  413 + </provider>
  414 + </entry>
  415 + <entry file="file://$PROJECT_DIR$/server.js">
  416 + <provider selected="true" editor-type-id="text-editor">
  417 + <state relative-caret-position="105">
  418 + <caret line="7" column="0" lean-forward="false" selection-start-line="7" selection-start-column="0" selection-end-line="7" selection-end-column="0" />
  419 + <folding />
  420 + </state>
  421 + </provider>
  422 + </entry>
  423 + <entry file="file://$PROJECT_DIR$/package.json">
  424 + <provider selected="true" editor-type-id="text-editor">
  425 + <state relative-caret-position="360">
  426 + <caret line="24" column="0" lean-forward="false" selection-start-line="24" selection-start-column="0" selection-end-line="24" selection-end-column="0" />
  427 + <folding />
  428 + </state>
  429 + </provider>
  430 + </entry>
  431 + <entry file="file://$PROJECT_DIR$/api/routes/routes.js">
  432 + <provider selected="true" editor-type-id="text-editor">
  433 + <state relative-caret-position="420">
  434 + <caret line="115" column="47" lean-forward="false" selection-start-line="115" selection-start-column="47" selection-end-line="115" selection-end-column="47" />
  435 + <folding />
390 436 </state>
391 437 </provider>
392 438 </entry>
... ...
restApi/api/.DS_Store 0 → 100644
No preview for this file type
restApi/api/routes/routes.js
1 1 //All endpoints will be defined in this file
2 2 const Incident = require("../modules/incident.js");
3 3  
  4 +
  5 +const uuid = require('uuid');
  6 +var cassandra = require("cassandra-driver");
  7 +
  8 +var client = new cassandra.Client({contactPoints: ['127.0.0.1']});
  9 +client.connect(function (err, result) {
  10 + if(err) console.log("Could not connect to Cassandra")
  11 + console.log('Successfully connected to Cassandra');
  12 +});
  13 +
  14 +
4 15 var mockIncidents = [
5 16 new Incident("1", "03.03.2018", "Bodø", "Datt på isen", "Datt på isen når jeg skuplle gå til bilen", "4"),
6 17 new Incident("2", "11.11.2012", "Oslo", "Bilkræsj", "Kræsjet med en annen bil", "2"),
... ... @@ -18,7 +29,7 @@ var appRouter = function(app) {
18 29  
19 30 //Get incident by id endpoint (http://localhost:3000/getIncident?id=1 will return the mock object with id 1)
20 31 app.get("/getIncident", function (req, res) {
21   -
  32 + /* MOCK
22 33 var foundIncident = null;
23 34  
24 35 //Search the array with mockIncidents and if id is found stop the loop and set foundIncident variable
... ... @@ -32,18 +43,56 @@ var appRouter = function(app) {
32 43 if (foundIncident == null) return res.send({"status": "error", "message": "id not found or missing"});
33 44  
34 45 return res.send(foundIncident);
  46 + */
  47 +
  48 +
  49 + client.execute('SELECT * FROM risk.incident WHERE id=' + req.query.id, [], function(err, result) {
  50 + if(err) {
  51 + console.log(err);
  52 + return res.send({"status": "error", "message": "Missing id, please use /getIncident?id=[id]"})
  53 + } else {
  54 + if (result.rows.length != 0)
  55 + return res.send(result.rows[0])
  56 + else
  57 + return res.send({"status": "error", "message": "Id not found"})
  58 +
  59 + }
  60 + });
  61 +
35 62 });
36 63  
37 64 //Get a JSON array of all mockIncidents if not empty
  65 +
38 66 app.get("/getAllIncidents", function (req, res) {
  67 +
  68 + /* MOCKDATA
39 69 if (mockIncidents != null && mockIncidents.length !== 0) return res.send(mockIncidents);
40 70  
41 71 return res.send({"status": "error", "message": "No mockIncidents found on the server"});
  72 + */
  73 +
  74 + client.execute('SELECT * FROM risk.incident', [], function (err, result) {
  75 + if(err) {
  76 + console.log(err);
  77 + return res.send({"status": "error", "message": "Something went wrong"})
  78 +
  79 + } else {
  80 + if (result.rows.length != 0)
  81 + return res.send(result.rows);
  82 + else
  83 + return res.send({"status": "error", "message": "No registered incidents"})
  84 + }
  85 +
  86 + })
  87 +
42 88 });
43 89  
44   - //Add a ned incident (http://localhost:3000/addIncident - with an "x-www-form-urlencoded" body of params)
  90 +
  91 +
  92 + //Add a new incident (http://localhost:3000/addIncident - with an "x-www-form-urlencoded" body of params)
45 93 app.post("/addIncident", function(req, res) {
46 94  
  95 + /*
47 96 // All these parameters must exist in the body with the exact name for this method to work
48 97 if(!req.body.id || !req.body.date || !req.body.location || !req.body.title || !req.body.description || !req.body.associatedEval) {
49 98 return res.send({"status": "error", "message": "missing a parameters"});
... ... @@ -51,11 +100,35 @@ var appRouter = function(app) {
51 100 /*
52 101 Here the request is successful and should be saved in the database but this is only a mock server
53 102 so the request body is returned to show that it is working (can be tested using Postman)
54   - */
  103 +
55 104 return res.send(req.body);
56 105 }
  106 + */
  107 +
  108 +
  109 +
  110 +
  111 +
  112 + if(!req.body.id || !req.body.date || !req.body.location || !req.body.title || !req.body.description || !req.body.associatedEval) {
  113 + return res.send({"status": "error", "message": "missing a parameters"});
  114 + } else {
  115 + const query = 'INSERT INTO risk.incident(id, uuid, date, location, title, description, associatedEval) VALUES(?,?,?,?,?,?,?)';
  116 + const params = [req.body.id, uuid(), new Date(req.body.date), req.body.location, req.body.title, req.body.description, req.body.associatedEval];
  117 + client.execute(query, params, { prepare: true }, function (err) {
  118 +
  119 + if (err) {
  120 + console.log(err);
  121 + return res.send({"status": "error", "message": "Something went wrong"})
  122 + }
  123 +
  124 + })
  125 + }
  126 +
57 127 });
58 128  
  129 +
  130 +
  131 +
59 132 //Update an incident (http://localhost:3000/updateIncident?id=1 will update the incident with id=1 with the params passed in the request body)
60 133 app.patch("/updateIncident", function (req, res) {
61 134 var foundIncident = null;
... ...
restApi/node_modules/.DS_Store 0 → 100644
No preview for this file type
restApi/node_modules/.bin/uuid 0 → 120000
  1 +../uuid/bin/uuid
0 2 \ No newline at end of file
... ...
restApi/node_modules/cassandra-driver/.nav 0 → 100644
  1 +getting-started
  2 +coding-rules
  3 +features
  4 +faq
... ...
restApi/node_modules/cassandra-driver/.travis.yml 0 → 100644
  1 +language: node_js
  2 +node_js:
  3 + - "8"
  4 + - "6"
  5 + - "4"
  6 +sudo: false
  7 +cache:
  8 + directories:
  9 + - node_modules
  10 +script:
  11 + - npm install -g eslint@4; npm run eslint;
  12 + - npm test
... ...
restApi/node_modules/cassandra-driver/CHANGELOG.md 0 → 100644
  1 +# ChangeLog - DataStax Node.js Driver
  2 +
  3 +## 3.5.0
  4 +
  5 +2018-04-17
  6 +
  7 +### Features
  8 +
  9 +- [NODEJS-407] - Add NO\_COMPACT option
  10 +- [NODEJS-412] - Log driver version on Client.connect
  11 +- [NODEJS-431] - Consider using OPTIONS for heatbeats instead of 'select key from system.local'
  12 +
  13 +### Bug fixes
  14 +
  15 +- [NODEJS-412] - Methods to retrieve schema metadata should reject promise when not connected
  16 +- [NODEJS-418] - Add jsdoc for each response error code
  17 +- [NODEJS-428] - Connection associated with reconnect is not fully closed when STARTUP times out on node that is unresponsive
  18 +- #271 - Use all columns from peers in ControlConnection
  19 +- #276 - Remove buffers `noAssert` argument
  20 +
  21 +
  22 +## 3.4.1
  23 +
  24 +2018-02-20
  25 +
  26 +### Bug Fixes
  27 +
  28 +- [NODEJS-429] - Additional validation needed in Encoder.setRoutingKeyFromUser to ensure provided routing key is valid
  29 +- [NODEJS-430] - Unexpected error when query execution doesn't include parameters which are part of the partition key
  30 +
  31 +## 3.4.0
  32 +
  33 +2018-02-05
  34 +
  35 +### Features
  36 +
  37 +- [NODEJS-95] - Expose node token and range information
  38 +- [NODEJS-335] - Avoid using Object.defineProperty() for type representations
  39 +- [NODEJS-344] - Verbose logging on Connection overhead
  40 +- [NODEJS-363] - Drop support for Node.js v0.10 and v0.12
  41 +- [NODEJS-378] - DCAwareRoundRobinPolicy: Warn when the local datacenter is not specified
  42 +- [NODEJS-388] - Drop support for domains
  43 +- [NODEJS-400] - Modify the message for batch log write failures
  44 +- [NODEJS-402] - Batch: Use routing key from first statement
  45 +- [NODEJS-404] - Use pooling.warmup to true as default
  46 +- [NODEJS-405] - Use system.peers in protocol negotiation
  47 +- [NODEJS-406] - Use ES2015 - Modernize codebase
  48 +- [NODEJS-409] - alreadyExists error does not include keyspace and table attributes
  49 +- [NODEJS-417] - Handle network stream backpressure when writing and limit write queue
  50 +
  51 +### Bug Fixes
  52 +
  53 +- [NODEJS-390] - Buffer.from() fails in older versions of Node.js v4 (lower than v4.5)
  54 +- [NODEJS-403] - NoHostAvailableError does not call super DriverError constructor
  55 +- [NODEJS-415] - Incorrect Murmur3 hashing of tokens which byte length satisfy length & 15 >= 12
  56 +- [NODEJS-419] - Token to Replica map can omit replicas for vnodes
  57 +
  58 +
  59 +## 3.3.0
  60 +
  61 +2017-09-19
  62 +
  63 +### Features
  64 +
  65 +- [NODEJS-82] - Speculative query retries
  66 +- [NODEJS-287] - Provide metrics on the state of connections to Cassandra
  67 +- [NODEJS-308] - Add CDC to TableOptionsMetadata and TableOptions for Cassandra 3.8+
  68 +- [NODEJS-309] - Allow prepared statements to be prepared on all nodes
  69 +- [NODEJS-339] - Avoid using deprecated Buffer constructors
  70 +- [NODEJS-343] - Improve performance of Murmur 3 partitioner
  71 +- [NODEJS-359] - Add 'applied' to ResultSet, similar to java-drivers ResultSet.wasApplied()
  72 +- [NODEJS-375] - Expose optional callbacks Uuid.random() as async overload
  73 +- [NODEJS-376] - Stringify tokens once to simplify computations when building token map
  74 +
  75 +### Bug Fixes
  76 +
  77 +- [NODEJS-365] - Routing key component length is encoded as int16 instead of uint16
  78 +- [NODEJS-370] - Consistency of trace queries is not configurable
  79 +- [NODEJS-373] - Empty string in a map field returned as null on query
  80 +
  81 +## 3.2.2
  82 +
  83 +2017-06-05
  84 +
  85 +### Bug Fixes
  86 +
  87 +- [NODEJS-346] - Shutdown doesn't work if error occurs after control connection initialization
  88 +- [NODEJS-347] - Metadata: Schema parser fails to handle index_options null values
  89 +- [NODEJS-355] - Domain without dots will not connect
  90 +- [NODEJS-358] - TokenAwarePolicy does not take statement keyspace into account
  91 +- [NODEJS-360] - ControlConnection: when any of the queries to refresh topology fail it will not attempt to reconnect
  92 +- [NODEJS-362] - Driver fails to encode Duration's with large values
  93 +
  94 +## 3.2.1
  95 +
  96 +2017-04-24
  97 +
  98 +### Features
  99 +
  100 +- [NODEJS-332] - Support Duration Type
  101 +- [NODEJS-338] - Make protocol negotiation more resilient
  102 +
  103 +## 3.2.0
  104 +
  105 +2017-01-17
  106 +
  107 +### Notable Changes
  108 +
  109 +- Promise support ([#194](https://github.com/datastax/nodejs-driver/pull/194)).
  110 +- Timestamp generation: client-side timestamps are generated and sent in the request by default when the
  111 +server supports it ([#195](https://github.com/datastax/nodejs-driver/pull/195)).
  112 +- Added `isIdempotent` query option which is set to `false` by default: future versions of the driver will use this
  113 + value to consider whether an execution should be retried or directly rethrown to the consumer without using the retry
  114 + policy ([#197](https://github.com/datastax/nodejs-driver/pull/197)).
  115 +
  116 +### Features
  117 +
  118 +- [NODEJS-322] - Timestamp Generator Support for providing Client Timestamps Improvement
  119 +- [NODEJS-189] - Support promises
  120 +- [NODEJS-230] - Expose ResultSet `@@iterator`
  121 +- [NODEJS-325] - Add explicit idempotency setting in the query options
  122 +
  123 +## 3.1.6
  124 +
  125 +2016-11-14
  126 +
  127 +### Bug Fixes
  128 +
  129 +- [NODEJS-294] - TokenAwarePolicy: Avoid yielding the primary replica first
  130 +
  131 +## 3.1.5
  132 +
  133 +2016-10-07
  134 +
  135 +### Bug Fixes
  136 +
  137 +- [NODEJS-313] - Client-to-node encryption: mark request as written before invoking socket.write()
  138 +
  139 +## 3.1.4
  140 +
  141 +2016-09-21
  142 +
  143 +### Bug Fixes
  144 +
  145 +- [NODEJS-310] - Reading streaming frames with flags can result in uncaught error
  146 +
  147 +## 3.1.3
  148 +
  149 +2016-08-31
  150 +
  151 +### Bug Fixes
  152 +
  153 +- [NODEJS-303] - Protocol version downgrade fails on OSX and Windows.
  154 +
  155 +## 3.1.2
  156 +
  157 +2016-08-30
  158 +
  159 +### Bug Fixes
  160 +
  161 +- [NODEJS-283] - Possible connection leak if pool is shutting down while core connections are being created.
  162 +- [NODEJS-288] - Callback never executed in error on subsequent Client.execute with Client configured with keyspace