Commit 466f0c04bb9cd4c97da1dbd2bfa9e5f72037fb29

Authored by Ali B
1 parent 46402b5a

Installed Body Parser to the project to support url encoded values and JSON. Set…

… up the server so it new accepts requestes at given endpoints. Made getIncident and getAllIncidents endpoints that now works (with mock data) and started working on patch method to update incidents
Showing 116 changed files with 12520 additions and 422 deletions   Show diff stats

Too many changes.

To preserve performance only 100 of 116 files are displayed.

Risiko/.idea/modules.xml
... ... @@ -3,9 +3,7 @@
3 3 <component name="ProjectModuleManager">
4 4 <modules>
5 5 <module fileurl="file://$PROJECT_DIR$/Risiko.iml" filepath="$PROJECT_DIR$/Risiko.iml" />
6   - <module fileurl="file://C:\Users\aliba\Desktop\ITE1893_Risikovurdering_Gruppe4\Risiko\Risiko.iml" filepath="C:\Users\aliba\Desktop\ITE1893_Risikovurdering_Gruppe4\Risiko\Risiko.iml" />
7 6 <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
8   - <module fileurl="file://C:\Users\aliba\Desktop\ITE1893_Risikovurdering_Gruppe4\Risiko\app\app.iml" filepath="C:\Users\aliba\Desktop\ITE1893_Risikovurdering_Gruppe4\Risiko\app\app.iml" />
9 7 </modules>
10 8 </component>
11 9 </project>
12 10 \ No newline at end of file
... ...
restApi/.idea/misc.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project version="4">
  3 + <component name="JavaScriptSettings">
  4 + <option name="languageLevel" value="JS_1_8_5" />
  5 + </component>
  6 +</project>
0 7 \ No newline at end of file
... ...
restApi/.idea/workspace.xml
... ... @@ -2,84 +2,176 @@
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 beforePath="" afterPath="$PROJECT_DIR$/.idea/vcs.xml" />
6   - <change beforePath="" afterPath="$PROJECT_DIR$/api/controllers/evaluationController.js" />
7   - <change beforePath="" afterPath="$PROJECT_DIR$/api/models/evaluationModel.js" />
8   - <change beforePath="" afterPath="$PROJECT_DIR$/api/routes/evaluationRoutes.js" />
9   - <change beforePath="" afterPath="$PROJECT_DIR$/server.js" />
10   - <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
11   - <change beforePath="$PROJECT_DIR$/package.json" afterPath="$PROJECT_DIR$/package.json" />
  5 + <change afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
  6 + <change beforePath="$PROJECT_DIR$/../Risiko/.idea/modules.xml" beforeDir="false" afterPath="$PROJECT_DIR$/../Risiko/.idea/modules.xml" 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/controllers/evaluationController.js" beforeDir="false" afterPath="$PROJECT_DIR$/api/models/incident.js" afterDir="false" />
  9 + <change beforePath="$PROJECT_DIR$/api/models/evaluationModel.js" beforeDir="false" afterPath="$PROJECT_DIR$/api/routes/routes.js" afterDir="false" />
  10 + <change beforePath="$PROJECT_DIR$/api/routes/evaluationRoutes.js" beforeDir="false" />
  11 + <change beforePath="$PROJECT_DIR$/node_modules/body-parser/HISTORY.md" beforeDir="false" afterPath="$PROJECT_DIR$/node_modules/body-parser/HISTORY.md" afterDir="false" />
  12 + <change beforePath="$PROJECT_DIR$/node_modules/body-parser/LICENSE" beforeDir="false" afterPath="$PROJECT_DIR$/node_modules/body-parser/LICENSE" afterDir="false" />
  13 + <change beforePath="$PROJECT_DIR$/node_modules/body-parser/README.md" beforeDir="false" afterPath="$PROJECT_DIR$/node_modules/body-parser/README.md" afterDir="false" />
  14 + <change beforePath="$PROJECT_DIR$/node_modules/body-parser/index.js" beforeDir="false" afterPath="$PROJECT_DIR$/node_modules/body-parser/index.js" afterDir="false" />
  15 + <change beforePath="$PROJECT_DIR$/node_modules/body-parser/lib/read.js" beforeDir="false" afterPath="$PROJECT_DIR$/node_modules/body-parser/lib/read.js" afterDir="false" />
  16 + <change beforePath="$PROJECT_DIR$/node_modules/body-parser/lib/types/json.js" beforeDir="false" afterPath="$PROJECT_DIR$/node_modules/body-parser/lib/types/json.js" afterDir="false" />
  17 + <change beforePath="$PROJECT_DIR$/node_modules/body-parser/lib/types/raw.js" beforeDir="false" afterPath="$PROJECT_DIR$/node_modules/body-parser/lib/types/raw.js" afterDir="false" />
  18 + <change beforePath="$PROJECT_DIR$/node_modules/body-parser/lib/types/text.js" beforeDir="false" afterPath="$PROJECT_DIR$/node_modules/body-parser/lib/types/text.js" afterDir="false" />
  19 + <change beforePath="$PROJECT_DIR$/node_modules/body-parser/lib/types/urlencoded.js" beforeDir="false" afterPath="$PROJECT_DIR$/node_modules/body-parser/lib/types/urlencoded.js" afterDir="false" />
  20 + <change beforePath="$PROJECT_DIR$/node_modules/body-parser/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/node_modules/body-parser/package.json" afterDir="false" />
  21 + <change beforePath="$PROJECT_DIR$/node_modules/iconv-lite/.npmignore" beforeDir="false" />
  22 + <change beforePath="$PROJECT_DIR$/node_modules/iconv-lite/.travis.yml" beforeDir="false" afterPath="$PROJECT_DIR$/node_modules/iconv-lite/.travis.yml" afterDir="false" />
  23 + <change beforePath="$PROJECT_DIR$/node_modules/iconv-lite/Changelog.md" beforeDir="false" afterPath="$PROJECT_DIR$/node_modules/iconv-lite/Changelog.md" afterDir="false" />
  24 + <change beforePath="$PROJECT_DIR$/node_modules/iconv-lite/LICENSE" beforeDir="false" afterPath="$PROJECT_DIR$/node_modules/iconv-lite/LICENSE" afterDir="false" />
  25 + <change beforePath="$PROJECT_DIR$/node_modules/iconv-lite/README.md" beforeDir="false" afterPath="$PROJECT_DIR$/node_modules/iconv-lite/README.md" afterDir="false" />
  26 + <change beforePath="$PROJECT_DIR$/node_modules/iconv-lite/encodings/dbcs-codec.js" beforeDir="false" afterPath="$PROJECT_DIR$/node_modules/iconv-lite/encodings/dbcs-codec.js" afterDir="false" />
  27 + <change beforePath="$PROJECT_DIR$/node_modules/iconv-lite/encodings/dbcs-data.js" beforeDir="false" afterPath="$PROJECT_DIR$/node_modules/iconv-lite/encodings/dbcs-data.js" afterDir="false" />
  28 + <change beforePath="$PROJECT_DIR$/node_modules/iconv-lite/encodings/index.js" beforeDir="false" afterPath="$PROJECT_DIR$/node_modules/iconv-lite/encodings/index.js" afterDir="false" />
  29 + <change beforePath="$PROJECT_DIR$/node_modules/iconv-lite/encodings/internal.js" beforeDir="false" afterPath="$PROJECT_DIR$/node_modules/iconv-lite/encodings/internal.js" afterDir="false" />
  30 + <change beforePath="$PROJECT_DIR$/node_modules/iconv-lite/encodings/sbcs-codec.js" beforeDir="false" afterPath="$PROJECT_DIR$/node_modules/iconv-lite/encodings/sbcs-codec.js" afterDir="false" />
  31 + <change beforePath="$PROJECT_DIR$/node_modules/iconv-lite/encodings/sbcs-data-generated.js" beforeDir="false" afterPath="$PROJECT_DIR$/node_modules/iconv-lite/encodings/sbcs-data-generated.js" afterDir="false" />
  32 + <change beforePath="$PROJECT_DIR$/node_modules/iconv-lite/encodings/sbcs-data.js" beforeDir="false" afterPath="$PROJECT_DIR$/node_modules/iconv-lite/encodings/sbcs-data.js" afterDir="false" />
  33 + <change beforePath="$PROJECT_DIR$/node_modules/iconv-lite/encodings/tables/big5-added.json" beforeDir="false" afterPath="$PROJECT_DIR$/node_modules/iconv-lite/encodings/tables/big5-added.json" afterDir="false" />
  34 + <change beforePath="$PROJECT_DIR$/node_modules/iconv-lite/encodings/tables/cp936.json" beforeDir="false" afterPath="$PROJECT_DIR$/node_modules/iconv-lite/encodings/tables/cp936.json" afterDir="false" />
  35 + <change beforePath="$PROJECT_DIR$/node_modules/iconv-lite/encodings/tables/cp949.json" beforeDir="false" afterPath="$PROJECT_DIR$/node_modules/iconv-lite/encodings/tables/cp949.json" afterDir="false" />
  36 + <change beforePath="$PROJECT_DIR$/node_modules/iconv-lite/encodings/tables/cp950.json" beforeDir="false" afterPath="$PROJECT_DIR$/node_modules/iconv-lite/encodings/tables/cp950.json" afterDir="false" />
  37 + <change beforePath="$PROJECT_DIR$/node_modules/iconv-lite/encodings/tables/eucjp.json" beforeDir="false" afterPath="$PROJECT_DIR$/node_modules/iconv-lite/encodings/tables/eucjp.json" afterDir="false" />
  38 + <change beforePath="$PROJECT_DIR$/node_modules/iconv-lite/encodings/tables/gbk-added.json" beforeDir="false" afterPath="$PROJECT_DIR$/node_modules/iconv-lite/encodings/tables/gbk-added.json" afterDir="false" />
  39 + <change beforePath="$PROJECT_DIR$/node_modules/iconv-lite/encodings/tables/shiftjis.json" beforeDir="false" afterPath="$PROJECT_DIR$/node_modules/iconv-lite/encodings/tables/shiftjis.json" afterDir="false" />
  40 + <change beforePath="$PROJECT_DIR$/node_modules/iconv-lite/encodings/utf16.js" beforeDir="false" afterPath="$PROJECT_DIR$/node_modules/iconv-lite/encodings/utf16.js" afterDir="false" />
  41 + <change beforePath="$PROJECT_DIR$/node_modules/iconv-lite/encodings/utf7.js" beforeDir="false" afterPath="$PROJECT_DIR$/node_modules/iconv-lite/encodings/utf7.js" afterDir="false" />
  42 + <change beforePath="$PROJECT_DIR$/node_modules/iconv-lite/lib/bom-handling.js" beforeDir="false" afterPath="$PROJECT_DIR$/node_modules/iconv-lite/lib/bom-handling.js" afterDir="false" />
  43 + <change beforePath="$PROJECT_DIR$/node_modules/iconv-lite/lib/extend-node.js" beforeDir="false" afterPath="$PROJECT_DIR$/node_modules/iconv-lite/lib/extend-node.js" afterDir="false" />
  44 + <change beforePath="$PROJECT_DIR$/node_modules/iconv-lite/lib/index.d.ts" beforeDir="false" afterPath="$PROJECT_DIR$/node_modules/iconv-lite/lib/index.d.ts" afterDir="false" />
  45 + <change beforePath="$PROJECT_DIR$/node_modules/iconv-lite/lib/index.js" beforeDir="false" afterPath="$PROJECT_DIR$/node_modules/iconv-lite/lib/index.js" afterDir="false" />
  46 + <change beforePath="$PROJECT_DIR$/node_modules/iconv-lite/lib/streams.js" beforeDir="false" afterPath="$PROJECT_DIR$/node_modules/iconv-lite/lib/streams.js" afterDir="false" />
  47 + <change beforePath="$PROJECT_DIR$/node_modules/iconv-lite/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/node_modules/iconv-lite/package.json" afterDir="false" />
  48 + <change beforePath="$PROJECT_DIR$/node_modules/raw-body/HISTORY.md" beforeDir="false" afterPath="$PROJECT_DIR$/node_modules/raw-body/HISTORY.md" afterDir="false" />
  49 + <change beforePath="$PROJECT_DIR$/node_modules/raw-body/LICENSE" beforeDir="false" afterPath="$PROJECT_DIR$/node_modules/raw-body/LICENSE" afterDir="false" />
  50 + <change beforePath="$PROJECT_DIR$/node_modules/raw-body/README.md" beforeDir="false" afterPath="$PROJECT_DIR$/node_modules/raw-body/README.md" afterDir="false" />
  51 + <change beforePath="$PROJECT_DIR$/node_modules/raw-body/index.d.ts" beforeDir="false" afterPath="$PROJECT_DIR$/node_modules/raw-body/index.d.ts" afterDir="false" />
  52 + <change beforePath="$PROJECT_DIR$/node_modules/raw-body/index.js" beforeDir="false" afterPath="$PROJECT_DIR$/node_modules/raw-body/index.js" afterDir="false" />
  53 + <change beforePath="$PROJECT_DIR$/node_modules/raw-body/node_modules/depd/History.md" beforeDir="false" />
  54 + <change beforePath="$PROJECT_DIR$/node_modules/raw-body/node_modules/depd/LICENSE" beforeDir="false" />
  55 + <change beforePath="$PROJECT_DIR$/node_modules/raw-body/node_modules/depd/Readme.md" beforeDir="false" />
  56 + <change beforePath="$PROJECT_DIR$/node_modules/raw-body/node_modules/depd/index.js" beforeDir="false" />
  57 + <change beforePath="$PROJECT_DIR$/node_modules/raw-body/node_modules/depd/lib/browser/index.js" beforeDir="false" />
  58 + <change beforePath="$PROJECT_DIR$/node_modules/raw-body/node_modules/depd/lib/compat/callsite-tostring.js" beforeDir="false" />
  59 + <change beforePath="$PROJECT_DIR$/node_modules/raw-body/node_modules/depd/lib/compat/event-listener-count.js" beforeDir="false" />
  60 + <change beforePath="$PROJECT_DIR$/node_modules/raw-body/node_modules/depd/lib/compat/index.js" beforeDir="false" />
  61 + <change beforePath="$PROJECT_DIR$/node_modules/raw-body/node_modules/depd/package.json" beforeDir="false" />
  62 + <change beforePath="$PROJECT_DIR$/node_modules/raw-body/node_modules/http-errors/HISTORY.md" beforeDir="false" />
  63 + <change beforePath="$PROJECT_DIR$/node_modules/raw-body/node_modules/http-errors/LICENSE" beforeDir="false" />
  64 + <change beforePath="$PROJECT_DIR$/node_modules/raw-body/node_modules/http-errors/README.md" beforeDir="false" />
  65 + <change beforePath="$PROJECT_DIR$/node_modules/raw-body/node_modules/http-errors/index.js" beforeDir="false" />
  66 + <change beforePath="$PROJECT_DIR$/node_modules/raw-body/node_modules/http-errors/package.json" beforeDir="false" />
  67 + <change beforePath="$PROJECT_DIR$/node_modules/raw-body/node_modules/setprototypeof/LICENSE" beforeDir="false" />
  68 + <change beforePath="$PROJECT_DIR$/node_modules/raw-body/node_modules/setprototypeof/README.md" beforeDir="false" />
  69 + <change beforePath="$PROJECT_DIR$/node_modules/raw-body/node_modules/setprototypeof/index.js" beforeDir="false" />
  70 + <change beforePath="$PROJECT_DIR$/node_modules/raw-body/node_modules/setprototypeof/package.json" beforeDir="false" />
  71 + <change beforePath="$PROJECT_DIR$/node_modules/raw-body/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/node_modules/raw-body/package.json" afterDir="false" />
  72 + <change beforePath="$PROJECT_DIR$/package-lock.json" beforeDir="false" afterPath="$PROJECT_DIR$/package-lock.json" afterDir="false" />
  73 + <change beforePath="$PROJECT_DIR$/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/package.json" afterDir="false" />
  74 + <change beforePath="$PROJECT_DIR$/server.js" beforeDir="false" afterPath="$PROJECT_DIR$/server.js" afterDir="false" />
12 75 </list>
13 76 <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
14   - <option name="TRACKING_ENABLED" value="true" />
15 77 <option name="SHOW_DIALOG" value="false" />
16 78 <option name="HIGHLIGHT_CONFLICTS" value="true" />
17 79 <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
18 80 <option name="LAST_RESOLUTION" value="IGNORE" />
19 81 </component>
  82 + <component name="FUSProjectUsageTrigger">
  83 + <session id="920369055">
  84 + <usages-collector id="statistics.lifecycle.project">
  85 + <counts>
  86 + <entry key="project.open.time.5" value="1" />
  87 + <entry key="project.opened" value="1" />
  88 + </counts>
  89 + </usages-collector>
  90 + <usages-collector id="statistics.file.extensions.edit">
  91 + <counts>
  92 + <entry key="js" value="3243" />
  93 + <entry key="json" value="3" />
  94 + </counts>
  95 + </usages-collector>
  96 + <usages-collector id="statistics.file.types.edit">
  97 + <counts>
  98 + <entry key="JSON" value="3" />
  99 + <entry key="JavaScript" value="3243" />
  100 + </counts>
  101 + </usages-collector>
  102 + <usages-collector id="statistics.file.extensions.open">
  103 + <counts>
  104 + <entry key="js" value="5" />
  105 + </counts>
  106 + </usages-collector>
  107 + <usages-collector id="statistics.file.types.open">
  108 + <counts>
  109 + <entry key="JavaScript" value="5" />
  110 + </counts>
  111 + </usages-collector>
  112 + </session>
  113 + </component>
20 114 <component name="FileEditorManager">
21   - <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
22   - <file leaf-file-name="package.json" pinned="false" current-in-tab="false">
23   - <entry file="file://$PROJECT_DIR$/package.json">
24   - <provider selected="true" editor-type-id="text-editor">
25   - <state relative-caret-position="136">
26   - <caret line="8" column="4" lean-forward="true" selection-start-line="8" selection-start-column="4" selection-end-line="8" selection-end-column="4" />
27   - <folding />
28   - </state>
29   - </provider>
30   - </entry>
31   - </file>
32   - <file leaf-file-name="package-lock.json" pinned="false" current-in-tab="false">
33   - <entry file="file://$PROJECT_DIR$/package-lock.json">
34   - <provider selected="true" editor-type-id="text-editor">
35   - <state relative-caret-position="0">
36   - <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
37   - <folding />
38   - </state>
39   - </provider>
40   - </entry>
41   - </file>
42   - <file leaf-file-name="server.js" pinned="false" current-in-tab="true">
43   - <entry file="file://$PROJECT_DIR$/server.js">
44   - <provider selected="true" editor-type-id="text-editor">
45   - <state relative-caret-position="102">
46   - <caret line="6" column="64" lean-forward="true" selection-start-line="6" selection-start-column="64" selection-end-line="6" selection-end-column="64" />
47   - <folding />
48   - </state>
49   - </provider>
50   - </entry>
51   - </file>
52   - <file leaf-file-name="evaluationController.js" pinned="false" current-in-tab="false">
53   - <entry file="file://$PROJECT_DIR$/api/controllers/evaluationController.js">
54   - <provider selected="true" editor-type-id="text-editor">
55   - <state relative-caret-position="0">
56   - <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
57   - <folding />
58   - </state>
59   - </provider>
60   - </entry>
61   - </file>
62   - <file leaf-file-name="evaluationModel.js" pinned="false" current-in-tab="false">
63   - <entry file="file://$PROJECT_DIR$/api/models/evaluationModel.js">
64   - <provider selected="true" editor-type-id="text-editor">
65   - <state relative-caret-position="0">
66   - <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
67   - <folding />
68   - </state>
69   - </provider>
70   - </entry>
71   - </file>
72   - <file leaf-file-name="evaluationRoutes.js" pinned="false" current-in-tab="false">
73   - <entry file="file://$PROJECT_DIR$/api/routes/evaluationRoutes.js">
74   - <provider selected="true" editor-type-id="text-editor">
75   - <state relative-caret-position="0">
76   - <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
77   - <folding />
78   - </state>
79   - </provider>
80   - </entry>
81   - </file>
82   - </leaf>
  115 + <splitter split-orientation="horizontal" split-proportion="0.5">
  116 + <split-first>
  117 + <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
  118 + <file pinned="false" current-in-tab="false">
  119 + <entry file="file://$PROJECT_DIR$/package.json">
  120 + <provider selected="true" editor-type-id="text-editor">
  121 + <state relative-caret-position="119">
  122 + <caret line="7" column="21" selection-start-line="7" selection-start-column="21" selection-end-line="7" selection-end-column="21" />
  123 + </state>
  124 + </provider>
  125 + </entry>
  126 + </file>
  127 + <file pinned="false" current-in-tab="false">
  128 + <entry file="file://$PROJECT_DIR$/package-lock.json">
  129 + <provider selected="true" editor-type-id="text-editor" />
  130 + </entry>
  131 + </file>
  132 + <file pinned="false" current-in-tab="false">
  133 + <entry file="file://$PROJECT_DIR$/server.js">
  134 + <provider selected="true" editor-type-id="text-editor">
  135 + <state>
  136 + <caret column="36" selection-start-column="36" selection-end-column="36" />
  137 + </state>
  138 + </provider>
  139 + </entry>
  140 + </file>
  141 + <file pinned="false" current-in-tab="true">
  142 + <entry file="file://$PROJECT_DIR$/api/models/incident.js">
  143 + <provider selected="true" editor-type-id="text-editor">
  144 + <state relative-caret-position="238">
  145 + <caret line="14" lean-forward="true" selection-start-line="14" selection-end-line="14" />
  146 + </state>
  147 + </provider>
  148 + </entry>
  149 + </file>
  150 + <file pinned="false" current-in-tab="false">
  151 + <entry file="file://$PROJECT_DIR$/api/routes/routes.js">
  152 + <provider selected="true" editor-type-id="text-editor">
  153 + <state relative-caret-position="17">
  154 + <caret line="1" column="6" selection-start-line="1" selection-start-column="6" selection-end-line="1" selection-end-column="6" />
  155 + </state>
  156 + </provider>
  157 + </entry>
  158 + </file>
  159 + </leaf>
  160 + </split-first>
  161 + <split-second>
  162 + <leaf>
  163 + <file pinned="false" current-in-tab="true">
  164 + <entry file="file://$PROJECT_DIR$/api/routes/routes.js">
  165 + <provider selected="true" editor-type-id="text-editor">
  166 + <state relative-caret-position="884">
  167 + <caret line="52" lean-forward="true" selection-start-line="52" selection-end-line="52" />
  168 + </state>
  169 + </provider>
  170 + </entry>
  171 + </file>
  172 + </leaf>
  173 + </split-second>
  174 + </splitter>
83 175 </component>
84 176 <component name="FileTemplateManagerImpl">
85 177 <option name="RECENT_TEMPLATES">
... ... @@ -109,6 +201,10 @@
109 201 <option value="$PROJECT_DIR$/api/routes/evaluationRoutes.js" />
110 202 <option value="$PROJECT_DIR$/package.json" />
111 203 <option value="$PROJECT_DIR$/server.js" />
  204 + <option value="$PROJECT_DIR$/api/models/Incident.js" />
  205 + <option value="$PROJECT_DIR$/api/models/models.js" />
  206 + <option value="$PROJECT_DIR$/api/models/incident.js" />
  207 + <option value="$PROJECT_DIR$/api/routes/routes.js" />
112 208 </list>
113 209 </option>
114 210 </component>
... ... @@ -123,6 +219,11 @@
123 219 <component name="NodeModulesDirectoryManager">
124 220 <handled-path value="$PROJECT_DIR$/node_modules" />
125 221 </component>
  222 + <component name="NodePackageJsonFileManager">
  223 + <packageJsonPaths>
  224 + <path value="$PROJECT_DIR$/package.json" />
  225 + </packageJsonPaths>
  226 + </component>
126 227 <component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" />
127 228 <component name="ProjectFrameBounds" extendedState="6">
128 229 <option name="x" value="-8" />
... ... @@ -132,50 +233,33 @@
132 233 </component>
133 234 <component name="ProjectLevelVcsManager" settingsEditedManually="true" />
134 235 <component name="ProjectView">
135   - <navigator currentView="ProjectPane" proportions="" version="1">
136   - <flattenPackages />
137   - <showMembers />
138   - <showModules />
139   - <showLibraryContents />
140   - <hideEmptyPackages />
141   - <abbreviatePackageNames />
142   - <autoscrollToSource />
143   - <autoscrollFromSource />
144   - <sortByType />
145   - <manualOrder />
  236 + <navigator proportions="" version="1">
146 237 <foldersAlwaysOnTop value="true" />
147 238 </navigator>
148 239 <panes>
149   - <pane id="Scratches" />
150 240 <pane id="ProjectPane">
151 241 <subPane>
152 242 <expand>
153 243 <path>
154 244 <item name="restApi" type="b2602c69:ProjectViewProjectNode" />
155   - <item name="restApi" type="2a2b976b:PhpTreeStructureProvider$1" />
  245 + <item name="restApi" type="462c0819:PsiDirectoryNode" />
156 246 </path>
157 247 <path>
158 248 <item name="restApi" type="b2602c69:ProjectViewProjectNode" />
159   - <item name="restApi" type="2a2b976b:PhpTreeStructureProvider$1" />
160   - <item name="api" type="2a2b976b:PhpTreeStructureProvider$1" />
  249 + <item name="restApi" type="462c0819:PsiDirectoryNode" />
  250 + <item name="api" type="462c0819:PsiDirectoryNode" />
161 251 </path>
162 252 <path>
163 253 <item name="restApi" type="b2602c69:ProjectViewProjectNode" />
164   - <item name="restApi" type="2a2b976b:PhpTreeStructureProvider$1" />
165   - <item name="api" type="2a2b976b:PhpTreeStructureProvider$1" />
166   - <item name="controllers" type="2a2b976b:PhpTreeStructureProvider$1" />
  254 + <item name="restApi" type="462c0819:PsiDirectoryNode" />
  255 + <item name="api" type="462c0819:PsiDirectoryNode" />
  256 + <item name="models" type="462c0819:PsiDirectoryNode" />
167 257 </path>
168 258 <path>
169 259 <item name="restApi" type="b2602c69:ProjectViewProjectNode" />
170   - <item name="restApi" type="2a2b976b:PhpTreeStructureProvider$1" />
171   - <item name="api" type="2a2b976b:PhpTreeStructureProvider$1" />
172   - <item name="models" type="2a2b976b:PhpTreeStructureProvider$1" />
173   - </path>
174   - <path>
175   - <item name="restApi" type="b2602c69:ProjectViewProjectNode" />
176   - <item name="restApi" type="2a2b976b:PhpTreeStructureProvider$1" />
177   - <item name="api" type="2a2b976b:PhpTreeStructureProvider$1" />
178   - <item name="routes" type="2a2b976b:PhpTreeStructureProvider$1" />
  260 + <item name="restApi" type="462c0819:PsiDirectoryNode" />
  261 + <item name="api" type="462c0819:PsiDirectoryNode" />
  262 + <item name="routes" type="462c0819:PsiDirectoryNode" />
179 263 </path>
180 264 </expand>
181 265 <select />
... ... @@ -185,9 +269,9 @@
185 269 </panes>
186 270 </component>
187 271 <component name="PropertiesComponent">
188   - <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
189 272 <property name="WebServerToolWindowFactoryState" value="false" />
190 273 <property name="last_opened_file_path" value="$PROJECT_DIR$" />
  274 + <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
191 275 </component>
192 276 <component name="RunDashboard">
193 277 <option name="ruleStates">
... ... @@ -281,9 +365,6 @@
281 365 <method />
282 366 </configuration>
283 367 </component>
284   - <component name="ShelveChangesManager" show_recycled="false">
285   - <option name="remove_strategy" value="false" />
286   - </component>
287 368 <component name="SvnConfiguration">
288 369 <configuration />
289 370 </component>
... ... @@ -296,35 +377,36 @@
296 377 <updated>1538753503688</updated>
297 378 <workItem from="1538753505199" duration="609000" />
298 379 <workItem from="1538754856928" duration="649000" />
  380 + <workItem from="1538838941552" duration="9343000" />
299 381 </task>
300 382 <servers />
301 383 </component>
302 384 <component name="TimeTrackingManager">
303   - <option name="totallyTimeSpent" value="1258000" />
  385 + <option name="totallyTimeSpent" value="10601000" />
304 386 </component>
305 387 <component name="ToolWindowManager">
306   - <frame x="-8" y="-8" width="1936" height="1056" extended-state="6" />
  388 + <frame x="-8" y="-8" width="2576" height="1416" extended-state="6" />
307 389 <editor active="true" />
308 390 <layout>
309   - <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.19936034" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
310   - <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" />
311   - <window_info id="Docker" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
312   - <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="7" side_tool="true" content_ui="tabs" />
313   - <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="3" side_tool="false" content_ui="tabs" />
314   - <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.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
315   - <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="2" side_tool="true" content_ui="tabs" />
316   - <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" />
317   - <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" />
318   - <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="7" side_tool="false" content_ui="tabs" />
319   - <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="2" side_tool="true" content_ui="tabs" />
320   - <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" />
321   - <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" />
322   - <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" />
323   - <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" />
324   - <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" />
325   - <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" />
326   - <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" />
327   - <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" />
  391 + <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.19897558" />
  392 + <window_info id="Structure" order="1" weight="0.25" />
  393 + <window_info id="npm" order="2" side_tool="true" />
  394 + <window_info id="Favorites" order="3" side_tool="true" />
  395 + <window_info anchor="bottom" id="Message" order="0" />
  396 + <window_info anchor="bottom" id="Find" order="1" />
  397 + <window_info anchor="bottom" id="Run" order="2" />
  398 + <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
  399 + <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
  400 + <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
  401 + <window_info anchor="bottom" id="TODO" order="6" />
  402 + <window_info anchor="bottom" id="Docker" order="7" show_stripe_button="false" />
  403 + <window_info anchor="bottom" id="Version Control" order="8" />
  404 + <window_info anchor="bottom" id="Terminal" order="9" />
  405 + <window_info anchor="bottom" id="Event Log" order="10" side_tool="true" />
  406 + <window_info anchor="right" id="Commander" order="0" weight="0.4" />
  407 + <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
  408 + <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
  409 + <window_info anchor="right" id="Database" order="3" />
328 410 </layout>
329 411 </component>
330 412 <component name="TypeScriptGeneratedFilesManager">
... ... @@ -333,64 +415,48 @@
333 415 <component name="VcsContentAnnotationSettings">
334 416 <option name="myLimit" value="2678400000" />
335 417 </component>
336   - <component name="XDebuggerManager">
337   - <breakpoint-manager />
338   - <watches-manager />
339   - </component>
340 418 <component name="editorHistoryManager">
341   - <entry file="file://$PROJECT_DIR$/package.json">
342   - <provider selected="true" editor-type-id="text-editor">
343   - <state relative-caret-position="0">
344   - <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
345   - <folding />
346   - </state>
347   - </provider>
  419 + <entry file="file://$PROJECT_DIR$/package-lock.json">
  420 + <provider selected="true" editor-type-id="text-editor" />
348 421 </entry>
349   - <entry file="file://$PROJECT_DIR$/api/controllers/evaluationController.js">
  422 + <entry file="file://$PROJECT_DIR$/package.json">
350 423 <provider selected="true" editor-type-id="text-editor">
351   - <state relative-caret-position="0">
352   - <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
353   - <folding />
  424 + <state relative-caret-position="119">
  425 + <caret line="7" column="21" selection-start-line="7" selection-start-column="21" selection-end-line="7" selection-end-column="21" />
354 426 </state>
355 427 </provider>
356 428 </entry>
357 429 <entry file="file://$PROJECT_DIR$/api/models/evaluationModel.js">
358   - <provider selected="true" editor-type-id="text-editor">
359   - <state relative-caret-position="0">
360   - <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
361   - <folding />
362   - </state>
363   - </provider>
  430 + <provider selected="true" editor-type-id="text-editor" />
364 431 </entry>
365   - <entry file="file://$PROJECT_DIR$/api/routes/evaluationRoutes.js">
  432 + <entry file="file://$PROJECT_DIR$/api/models/models.js">
366 433 <provider selected="true" editor-type-id="text-editor">
367   - <state relative-caret-position="0">
368   - <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
369   - <folding />
  434 + <state relative-caret-position="17">
  435 + <caret line="1" lean-forward="true" selection-start-line="1" selection-end-line="1" />
370 436 </state>
371 437 </provider>
372 438 </entry>
373   - <entry file="file://$PROJECT_DIR$/package-lock.json">
  439 + <entry file="file://$PROJECT_DIR$/server.js">
374 440 <provider selected="true" editor-type-id="text-editor">
375   - <state relative-caret-position="0">
376   - <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
377   - <folding />
  441 + <state>
  442 + <caret column="36" selection-start-column="36" selection-end-column="36" />
378 443 </state>
379 444 </provider>
380 445 </entry>
381   - <entry file="file://$PROJECT_DIR$/package.json">
  446 + <entry file="file://$PROJECT_DIR$/api/controllers/evaluationController.js">
  447 + <provider selected="true" editor-type-id="text-editor" />
  448 + </entry>
  449 + <entry file="file://$PROJECT_DIR$/api/routes/routes.js">
382 450 <provider selected="true" editor-type-id="text-editor">
383   - <state relative-caret-position="136">
384   - <caret line="8" column="4" lean-forward="true" selection-start-line="8" selection-start-column="4" selection-end-line="8" selection-end-column="4" />
385   - <folding />
  451 + <state relative-caret-position="17">
  452 + <caret line="1" column="6" selection-start-line="1" selection-start-column="6" selection-end-line="1" selection-end-column="6" />
386 453 </state>
387 454 </provider>
388 455 </entry>
389   - <entry file="file://$PROJECT_DIR$/server.js">
  456 + <entry file="file://$PROJECT_DIR$/api/models/incident.js">
390 457 <provider selected="true" editor-type-id="text-editor">
391   - <state relative-caret-position="102">
392   - <caret line="6" column="64" lean-forward="true" selection-start-line="6" selection-start-column="64" selection-end-line="6" selection-end-column="64" />
393   - <folding />
  458 + <state relative-caret-position="238">
  459 + <caret line="14" lean-forward="true" selection-start-line="14" selection-end-line="14" />
394 460 </state>
395 461 </provider>
396 462 </entry>
... ...
restApi/api/controllers/evaluationController.js deleted
restApi/api/models/evaluationModel.js deleted
restApi/api/models/incident.js 0 → 100644
  1 +var object = Incident.prototype;
  2 +
  3 +function Incident(id, date, location, title, description, associatedEval) {
  4 + this.id = id;
  5 + this.date = date;
  6 + this.location = location;
  7 + this.title = title;
  8 + this.description = description;
  9 + this.associatedEval = associatedEval;
  10 +}
  11 +
  12 +object.getId = function() {
  13 + return this.id;
  14 +};
  15 +
  16 +object.getDate = function() {
  17 + return this.date;
  18 +};
  19 +
  20 +object.getLocation = function() {
  21 + return this.location;
  22 +};
  23 +
  24 +object.getTitle = function() {
  25 + return this.title;
  26 +};
  27 +
  28 +object.getDescription = function() {
  29 + return this.description;
  30 +};
  31 +
  32 +object.getAssociatedEval = function() {
  33 + return this.associatedEval;
  34 +};
  35 +
  36 +module.exports = Incident;
0 37 \ No newline at end of file
... ...
restApi/api/routes/evaluationRoutes.js deleted
restApi/api/routes/routes.js 0 → 100644
  1 +//All endpoints will be defined in this file
  2 +const Incident = require("../models/incident.js");
  3 +var mockIncidents = [
  4 + new Incident("1", "03.03.2018", "Bodø", "Datt på isen", "Datt på isen når jeg skuplle gå til bilen", "4"),
  5 + new Incident("2", "11.11.2012", "Oslo", "Bilkræsj", "Kræsjet med en annen bil", "2"),
  6 + new Incident("3", "26.04.2018", "Bodø", "Tråkket over", "Tråkket over og vrikket foten", "5")
  7 +];
  8 +
  9 +var appRouter = function(app) {
  10 +
  11 + //Root endpoint (http://localhost:3000)
  12 + app.get("/", function(req, res) {
  13 + res.send("Evaluation API by Ali, Kristin and Anna is up and running...");
  14 + });
  15 +
  16 + //Get incident by id endpoint (http://localhost:3000/getIncident?id=1 will return the mock object)
  17 + app.get("/getIncident", function (req, res) {
  18 +
  19 + var foundIncident = null;
  20 +
  21 + //Search the array with mockIncidents and if id is found stop the loop and set foundIncident variable
  22 + mockIncidents.forEach(function (value) {
  23 + if (value.getId() === req.query.id) {
  24 + foundIncident = value;
  25 + return true;
  26 + }
  27 + });
  28 + //Check if id is specified as a query param and check if id is 1 (only id that we have as of this mock server)
  29 + if (foundIncident == null) return res.send({"status": "error", "message": "id not found or missing"});
  30 +
  31 + return res.send(foundIncident);
  32 + });
  33 +
  34 + //Get a JSON array of all mockIncidents if not empty
  35 + app.get("/getAllIncidents", function (req, res) {
  36 + if (mockIncidents != null && mockIncidents.length !== 0) return res.send(mockIncidents);
  37 +
  38 + return res.send({"status": "error", "message": "No mockIncidents found on the server"});
  39 + });
  40 +
  41 + //Add a ned incident (http://localhost:3000/addIncident - with an "x-www-form-urlencoded" body of params)
  42 + app.post("/addIncident", function(req, res) {
  43 + if(!req.body.id || !req.body.date || !req.body.location || !req.body.title || !req.body.description || !req.body.associatedEval) {
  44 + return res.send({"status": "error", "message": "missing a parameters"});
  45 + } else {
  46 + /*
  47 + Here the request is successful and should be saved in the database but this is only a mock server
  48 + so the request body is returned to show that it is working (can be tested using Postman)
  49 + */
  50 + return res.send(req.body);
  51 + }
  52 + });
  53 +
  54 + app.patch("/changeIncidentTitle", function (req, res) {
  55 +
  56 + });
  57 +
  58 +};
  59 +
  60 +module.exports = appRouter;
0 61 \ No newline at end of file
... ...
restApi/node_modules/body-parser/HISTORY.md
  1 +1.18.3 / 2018-05-14
  2 +===================
  3 +
  4 + * Fix stack trace for strict json parse error
  5 + * deps: depd@~1.1.2
  6 + - perf: remove argument reassignment
  7 + * deps: http-errors@~1.6.3
  8 + - deps: depd@~1.1.2
  9 + - deps: setprototypeof@1.1.0
  10 + - deps: statuses@'>= 1.3.1 < 2'
  11 + * deps: iconv-lite@0.4.23
  12 + - Fix loading encoding with year appended
  13 + - Fix deprecation warnings on Node.js 10+
  14 + * deps: qs@6.5.2
  15 + * deps: raw-body@2.3.3
  16 + - deps: http-errors@1.6.3
  17 + - deps: iconv-lite@0.4.23
  18 + * deps: type-is@~1.6.16
  19 + - deps: mime-types@~2.1.18
  20 +
1 21 1.18.2 / 2017-09-22
2 22 ===================
3 23  
... ...
restApi/node_modules/body-parser/README.md
... ... @@ -4,13 +4,18 @@
4 4 [![NPM Downloads][downloads-image]][downloads-url]
5 5 [![Build Status][travis-image]][travis-url]
6 6 [![Test Coverage][coveralls-image]][coveralls-url]
7   -[![Gratipay][gratipay-image]][gratipay-url]
8 7  
9 8 Node.js body parsing middleware.
10 9  
11 10 Parse incoming request bodies in a middleware before your handlers, available
12 11 under the `req.body` property.
13 12  
  13 +**Note** As `req.body`'s shape is based on user-controlled input, all
  14 +properties and values in this object are untrusted and should be validated
  15 +before trusting. For example, `req.body.foo.toString()` may fail in multiple
  16 +ways, for example the `foo` property may not be there or may not be a string,
  17 +and `toString` may not be a function and instead a string or other user input.
  18 +
14 19 [Learn about the anatomy of an HTTP transaction in Node.js](https://nodejs.org/en/docs/guides/anatomy-of-an-http-transaction/).
15 20  
16 21 _This does not handle multipart bodies_, due to their complex and typically
... ... @@ -100,12 +105,13 @@ accept anything `JSON.parse` accepts. Defaults to `true`.
100 105 ##### type
101 106  
102 107 The `type` option is used to determine what media type the middleware will
103   -parse. This option can be a function or a string. If a string, `type` option
104   -is passed directly to the [type-is](https://www.npmjs.org/package/type-is#readme)
105   -library and this can be an extension name (like `json`), a mime type (like
106   -`application/json`), or a mime type with a wildcard (like `*/*` or `*/json`).
107   -If a function, the `type` option is called as `fn(req)` and the request is
108   -parsed if it returns a truthy value. Defaults to `application/json`.
  108 +parse. This option can be a string, array of strings, or a function. If not a
  109 +function, `type` option is passed directly to the
  110 +[type-is](https://www.npmjs.org/package/type-is#readme) library and this can
  111 +be an extension name (like `json`), a mime type (like `application/json`), or
  112 +a mime type with a wildcard (like `*/*` or `*/json`). If a function, the `type`
  113 +option is called as `fn(req)` and the request is parsed if it returns a truthy
  114 +value. Defaults to `application/json`.
109 115  
110 116 ##### verify
111 117  
... ... @@ -143,9 +149,10 @@ to `&#39;100kb&#39;`.
143 149 ##### type
144 150  
145 151 The `type` option is used to determine what media type the middleware will
146   -parse. This option can be a function or a string. If a string, `type` option
147   -is passed directly to the [type-is](https://www.npmjs.org/package/type-is#readme)
148   -library and this can be an extension name (like `bin`), a mime type (like
  152 +parse. This option can be a string, array of strings, or a function.
  153 +If not a function, `type` option is passed directly to the
  154 +[type-is](https://www.npmjs.org/package/type-is#readme) library and this
  155 +can be an extension name (like `bin`), a mime type (like
149 156 `application/octet-stream`), or a mime type with a wildcard (like `*/*` or
150 157 `application/*`). If a function, the `type` option is called as `fn(req)`
151 158 and the request is parsed if it returns a truthy value. Defaults to
... ... @@ -192,12 +199,13 @@ to `&#39;100kb&#39;`.
192 199 ##### type
193 200  
194 201 The `type` option is used to determine what media type the middleware will
195   -parse. This option can be a function or a string. If a string, `type` option
196   -is passed directly to the [type-is](https://www.npmjs.org/package/type-is#readme)
197   -library and this can be an extension name (like `txt`), a mime type (like
198   -`text/plain`), or a mime type with a wildcard (like `*/*` or `text/*`).
199   -If a function, the `type` option is called as `fn(req)` and the request is
200   -parsed if it returns a truthy value. Defaults to `text/plain`.
  202 +parse. This option can be a string, array of strings, or a function. If not
  203 +a function, `type` option is passed directly to the
  204 +[type-is](https://www.npmjs.org/package/type-is#readme) library and this can
  205 +be an extension name (like `txt`), a mime type (like `text/plain`), or a mime
  206 +type with a wildcard (like `*/*` or `text/*`). If a function, the `type`
  207 +option is called as `fn(req)` and the request is parsed if it returns a
  208 +truthy value. Defaults to `text/plain`.
201 209  
202 210 ##### verify
203 211  
... ... @@ -256,9 +264,10 @@ than this value, a 413 will be returned to the client. Defaults to `1000`.
256 264 ##### type
257 265  
258 266 The `type` option is used to determine what media type the middleware will
259   -parse. This option can be a function or a string. If a string, `type` option
260   -is passed directly to the [type-is](https://www.npmjs.org/package/type-is#readme)
261   -library and this can be an extension name (like `urlencoded`), a mime type (like
  267 +parse. This option can be a string, array of strings, or a function. If not
  268 +a function, `type` option is passed directly to the
  269 +[type-is](https://www.npmjs.org/package/type-is#readme) library and this can
  270 +be an extension name (like `urlencoded`), a mime type (like
262 271 `application/x-www-form-urlencoded`), or a mime type with a wildcard (like
263 272 `*/x-www-form-urlencoded`). If a function, the `type` option is called as
264 273 `fn(req)` and the request is parsed if it returns a truthy value. Defaults
... ... @@ -434,5 +443,3 @@ app.use(bodyParser.text({ type: &#39;text/html&#39; }))
434 443 [coveralls-url]: https://coveralls.io/r/expressjs/body-parser?branch=master
435 444 [downloads-image]: https://img.shields.io/npm/dm/body-parser.svg
436 445 [downloads-url]: https://npmjs.org/package/body-parser
437   -[gratipay-image]: https://img.shields.io/gratipay/dougwilson.svg
438   -[gratipay-url]: https://www.gratipay.com/dougwilson/
... ...
restApi/node_modules/body-parser/lib/types/json.js
... ... @@ -89,6 +89,7 @@ function json (options) {
89 89 return JSON.parse(body, reviver)
90 90 } catch (e) {
91 91 throw normalizeJsonSyntaxError(e, {
  92 + message: e.message,
92 93 stack: e.stack
93 94 })
94 95 }
... ... @@ -208,12 +209,9 @@ function normalizeJsonSyntaxError (error, obj) {
208 209 }
209 210 }
210 211  
211   - var props = Object.keys(obj)
212   -
213   - for (var j = 0; j < props.length; j++) {
214   - var prop = props[j]
215   - error[prop] = obj[prop]
216   - }
  212 + // replace stack before message for Node.js 0.10 and below
  213 + error.stack = obj.stack.replace(error.message, obj.message)
  214 + error.message = obj.message
217 215  
218 216 return error
219 217 }
... ...
restApi/node_modules/body-parser/node_modules/qs/.editorconfig 0 → 100644
  1 +root = true
  2 +
  3 +[*]
  4 +indent_style = space
  5 +indent_size = 4
  6 +end_of_line = lf
  7 +charset = utf-8
  8 +trim_trailing_whitespace = true
  9 +insert_final_newline = true
  10 +max_line_length = 140
  11 +
  12 +[test/*]
  13 +max_line_length = off
  14 +
  15 +[*.md]
  16 +max_line_length = off
  17 +
  18 +[*.json]
  19 +max_line_length = off
  20 +
  21 +[Makefile]
  22 +max_line_length = off
  23 +
  24 +[CHANGELOG.md]
  25 +indent_style = space
  26 +indent_size = 2
  27 +
  28 +[LICENSE]
  29 +indent_size = 2
  30 +max_line_length = off
... ...
restApi/node_modules/body-parser/node_modules/qs/.eslintignore 0 → 100644
  1 +dist
... ...
restApi/node_modules/body-parser/node_modules/qs/.eslintrc 0 → 100644
  1 +{
  2 + "root": true,
  3 +
  4 + "extends": "@ljharb",
  5 +
  6 + "rules": {
  7 + "complexity": 0,
  8 + "consistent-return": 1,
  9 + "func-name-matching": 0,
  10 + "id-length": [2, { "min": 1, "max": 25, "properties": "never" }],
  11 + "indent": [2, 4],
  12 + "max-params": [2, 12],
  13 + "max-statements": [2, 45],
  14 + "no-continue": 1,
  15 + "no-magic-numbers": 0,
  16 + "no-restricted-syntax": [2, "BreakStatement", "DebuggerStatement", "ForInStatement", "LabeledStatement", "WithStatement"],
  17 + "operator-linebreak": [2, "before"],
  18 + }
  19 +}
... ...
restApi/node_modules/body-parser/node_modules/qs/CHANGELOG.md 0 → 100644
  1 +## **6.5.2**
  2 +- [Fix] use `safer-buffer` instead of `Buffer` constructor
  3 +- [Refactor] utils: `module.exports` one thing, instead of mutating `exports` (#230)
  4 +- [Dev Deps] update `browserify`, `eslint`, `iconv-lite`, `safer-buffer`, `tape`, `browserify`
  5 +
  6 +## **6.5.1**
  7 +- [Fix] Fix parsing & compacting very deep objects (#224)
  8 +- [Refactor] name utils functions
  9 +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape`
  10 +- [Tests] up to `node` `v8.4`; use `nvm install-latest-npm` so newer npm doesn’t break older node
  11 +- [Tests] Use precise dist for Node.js 0.6 runtime (#225)
  12 +- [Tests] make 0.6 required, now that it’s passing
  13 +- [Tests] on `node` `v8.2`; fix npm on node 0.6
  14 +
  15 +## **6.5.0**
  16 +- [New] add `utils.assign`
  17 +- [New] pass default encoder/decoder to custom encoder/decoder functions (#206)
  18 +- [New] `parse`/`stringify`: add `ignoreQueryPrefix`/`addQueryPrefix` options, respectively (#213)
  19 +- [Fix] Handle stringifying empty objects with addQueryPrefix (#217)
  20 +- [Fix] do not mutate `options` argument (#207)
  21 +- [Refactor] `parse`: cache index to reuse in else statement (#182)
  22 +- [Docs] add various badges to readme (#208)
  23 +- [Dev Deps] update `eslint`, `browserify`, `iconv-lite`, `tape`
  24 +- [Tests] up to `node` `v8.1`, `v7.10`, `v6.11`; npm v4.6 breaks on node < v1; npm v5+ breaks on node < v4
  25 +- [Tests] add `editorconfig-tools`
  26 +
  27 +## **6.4.0**
  28 +- [New] `qs.stringify`: add `encodeValuesOnly` option
  29 +- [Fix] follow `allowPrototypes` option during merge (#201, #201)
  30 +- [Fix] support keys starting with brackets (#202, #200)
  31 +- [Fix] chmod a-x
  32 +- [Dev Deps] update `eslint`
  33 +- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds
  34 +- [eslint] reduce warnings
  35 +
  36 +## **6.3.2**
  37 +- [Fix] follow `allowPrototypes` option during merge (#201, #200)
  38 +- [Dev Deps] update `eslint`
  39 +- [Fix] chmod a-x
  40 +- [Fix] support keys starting with brackets (#202, #200)
  41 +- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds
  42 +
  43 +## **6.3.1**
  44 +- [Fix] ensure that `allowPrototypes: false` does not ever shadow Object.prototype properties (thanks, @snyk!)
  45 +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `browserify`, `iconv-lite`, `qs-iconv`, `tape`
  46 +- [Tests] on all node minors; improve test matrix
  47 +- [Docs] document stringify option `allowDots` (#195)
  48 +- [Docs] add empty object and array values example (#195)
  49 +- [Docs] Fix minor inconsistency/typo (#192)
  50 +- [Docs] document stringify option `sort` (#191)
  51 +- [Refactor] `stringify`: throw faster with an invalid encoder
  52 +- [Refactor] remove unnecessary escapes (#184)
  53 +- Remove contributing.md, since `qs` is no longer part of `hapi` (#183)
  54 +
  55 +## **6.3.0**
  56 +- [New] Add support for RFC 1738 (#174, #173)
  57 +- [New] `stringify`: Add `serializeDate` option to customize Date serialization (#159)
  58 +- [Fix] ensure `utils.merge` handles merging two arrays
  59 +- [Refactor] only constructors should be capitalized
  60 +- [Refactor] capitalized var names are for constructors only
  61 +- [Refactor] avoid using a sparse array
  62 +- [Robustness] `formats`: cache `String#replace`
  63 +- [Dev Deps] update `browserify`, `eslint`, `@ljharb/eslint-config`; add `safe-publish-latest`
  64 +- [Tests] up to `node` `v6.8`, `v4.6`; improve test matrix
  65 +- [Tests] flesh out arrayLimit/arrayFormat tests (#107)
  66 +- [Tests] skip Object.create tests when null objects are not available
  67 +- [Tests] Turn on eslint for test files (#175)
  68 +
  69 +## **6.2.3**
  70 +- [Fix] follow `allowPrototypes` option during merge (#201, #200)
  71 +- [Fix] chmod a-x
  72 +- [Fix] support keys starting with brackets (#202, #200)
  73 +- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds
  74 +
  75 +## **6.2.2**
  76 +- [Fix] ensure that `allowPrototypes: false` does not ever shadow Object.prototype properties
  77 +
  78 +## **6.2.1**
  79 +- [Fix] ensure `key[]=x&key[]&key[]=y` results in 3, not 2, values
  80 +- [Refactor] Be explicit and use `Object.prototype.hasOwnProperty.call`
  81 +- [Tests] remove `parallelshell` since it does not reliably report failures
  82 +- [Tests] up to `node` `v6.3`, `v5.12`
  83 +- [Dev Deps] update `tape`, `eslint`, `@ljharb/eslint-config`, `qs-iconv`
  84 +
  85 +## [**6.2.0**](https://github.com/ljharb/qs/issues?milestone=36&state=closed)
  86 +- [New] pass Buffers to the encoder/decoder directly (#161)
  87 +- [New] add "encoder" and "decoder" options, for custom param encoding/decoding (#160)
  88 +- [Fix] fix compacting of nested sparse arrays (#150)
  89 +
  90 +## **6.1.2
  91 +- [Fix] follow `allowPrototypes` option during merge (#201, #200)
  92 +- [Fix] chmod a-x
  93 +- [Fix] support keys starting with brackets (#202, #200)
  94 +- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds
  95 +
  96 +## **6.1.1**
  97 +- [Fix] ensure that `allowPrototypes: false` does not ever shadow Object.prototype properties
  98 +
  99 +## [**6.1.0**](https://github.com/ljharb/qs/issues?milestone=35&state=closed)
  100 +- [New] allowDots option for `stringify` (#151)
  101 +- [Fix] "sort" option should work at a depth of 3 or more (#151)
  102 +- [Fix] Restore `dist` directory; will be removed in v7 (#148)
  103 +
  104 +## **6.0.4**
  105 +- [Fix] follow `allowPrototypes` option during merge (#201, #200)
  106 +- [Fix] chmod a-x
  107 +- [Fix] support keys starting with brackets (#202, #200)
  108 +- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds
  109 +
  110 +## **6.0.3**
  111 +- [Fix] ensure that `allowPrototypes: false` does not ever shadow Object.prototype properties
  112 +- [Fix] Restore `dist` directory; will be removed in v7 (#148)
  113 +
  114 +## [**6.0.2**](https://github.com/ljharb/qs/issues?milestone=33&state=closed)
  115 +- Revert ES6 requirement and restore support for node down to v0.8.
  116 +
  117 +## [**6.0.1**](https://github.com/ljharb/qs/issues?milestone=32&state=closed)
  118 +- [**#127**](https://github.com/ljharb/qs/pull/127) Fix engines definition in package.json
  119 +
  120 +## [**6.0.0**](https://github.com/ljharb/qs/issues?milestone=31&state=closed)
  121 +- [**#124**](https://github.com/ljharb/qs/issues/124) Use ES6 and drop support for node < v4
  122 +
  123 +## **5.2.1**
  124 +- [Fix] ensure `key[]=x&key[]&key[]=y` results in 3, not 2, values
  125 +