deploy.sh 0.2.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/.eslintignore +1 -0
  2. package/.eslintrc +7 -9
  3. package/.github/workflows/ci.yml +48 -0
  4. package/.husky/pre-commit +5 -0
  5. package/{test/fixtures/unknown/.gitkeep → .prettierrc} +0 -0
  6. package/.release-it.json +5 -0
  7. package/CHANGELOG.md +26 -0
  8. package/README.md +5 -6
  9. package/__tests__/fixtures/unknown/.gitkeep +0 -0
  10. package/__tests__/lib/classifier.test.js +49 -0
  11. package/__tests__/lib/helpers/util.test.js +57 -0
  12. package/bin/deploy-delete.js +14 -0
  13. package/bin/deploy-deploy.js +34 -59
  14. package/bin/deploy-list.js +25 -52
  15. package/bin/deploy-login.js +36 -52
  16. package/bin/deploy-logout.js +9 -40
  17. package/bin/deploy-logs.js +22 -48
  18. package/bin/deploy-open.js +14 -37
  19. package/bin/deploy-register.js +37 -50
  20. package/bin/deploy-server.js +8 -5
  21. package/bin/deploy-whoami.js +8 -37
  22. package/bin/deploy.js +145 -19
  23. package/{test/fixtures → examples}/docker/Dockerfile +0 -0
  24. package/examples/docker/index.js +12 -0
  25. package/examples/node/index.js +8 -0
  26. package/{test/fixtures → examples}/node/package.json +0 -0
  27. package/examples/static/index.html +22 -0
  28. package/{test/fixtures → examples}/static/main.css +4 -2
  29. package/examples/static/out.gifcd +0 -0
  30. package/generate-docs.js +55 -0
  31. package/index.js +54 -55
  32. package/jsdoc.json +6 -3
  33. package/lib/classifier.js +24 -17
  34. package/lib/deploy.js +56 -64
  35. package/lib/helpers/cli.js +178 -207
  36. package/lib/helpers/util.js +94 -21
  37. package/lib/models/deployment.js +415 -474
  38. package/lib/models/request.js +77 -66
  39. package/lib/models/user.js +119 -144
  40. package/lib/server.js +187 -97
  41. package/lib/static/not-found.html +30 -0
  42. package/lib/static/page-could-not-load.html +30 -0
  43. package/lib/static/static-server.js +70 -0
  44. package/package.json +47 -34
  45. package/website/README.md +41 -0
  46. package/website/babel.config.js +3 -0
  47. package/website/docs/api/_category_.yml +1 -0
  48. package/website/docs/api/lib/classifier.js.md +11 -0
  49. package/website/docs/api/lib/deploy.js.md +13 -0
  50. package/website/docs/api/lib/helpers/cli.js.md +193 -0
  51. package/website/docs/api/lib/helpers/util.js.md +65 -0
  52. package/website/docs/api/lib/models/deployment.js.md +171 -0
  53. package/website/docs/api/lib/models/request.js.md +67 -0
  54. package/website/docs/api/lib/models/user.js.md +92 -0
  55. package/website/docs/api/lib/server.js.md +0 -0
  56. package/website/docs/api/lib/static/static-server.js.md +0 -0
  57. package/website/docs/intro.md +57 -0
  58. package/website/docusaurus.config.js +82 -0
  59. package/website/package-lock.json +25218 -0
  60. package/website/package.json +39 -0
  61. package/website/sidebars.js +31 -0
  62. package/website/src/components/HomepageFeatures/index.js +79 -0
  63. package/website/src/components/HomepageFeatures/styles.module.css +11 -0
  64. package/website/src/css/custom.css +39 -0
  65. package/website/src/pages/index.js +57 -0
  66. package/website/src/pages/index.module.css +23 -0
  67. package/website/static/.nojekyll +0 -0
  68. package/website/static/example.gif +0 -0
  69. package/website/static/example.mov +0 -0
  70. package/website/static/img/favicon.ico +0 -0
  71. package/website/static/img/intro/deploy.png +0 -0
  72. package/website/static/img/intro/logs.png +0 -0
  73. package/{docs → website/static/img}/logo.png +0 -0
  74. package/{docs → website/static/img}/logo.pxm +0 -0
  75. package/{docs → website/static/img}/logo@2x.png +0 -0
  76. package/.npmignore +0 -9
  77. package/.travis.yml +0 -9
  78. package/TODO.md +0 -12
  79. package/docs/code/classifier.js.html +0 -116
  80. package/docs/code/deploy.js.html +0 -138
  81. package/docs/code/fonts/OpenSans-Bold-webfont.eot +0 -0
  82. package/docs/code/fonts/OpenSans-Bold-webfont.svg +0 -1830
  83. package/docs/code/fonts/OpenSans-Bold-webfont.woff +0 -0
  84. package/docs/code/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
  85. package/docs/code/fonts/OpenSans-BoldItalic-webfont.svg +0 -1830
  86. package/docs/code/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
  87. package/docs/code/fonts/OpenSans-Italic-webfont.eot +0 -0
  88. package/docs/code/fonts/OpenSans-Italic-webfont.svg +0 -1830
  89. package/docs/code/fonts/OpenSans-Italic-webfont.woff +0 -0
  90. package/docs/code/fonts/OpenSans-Light-webfont.eot +0 -0
  91. package/docs/code/fonts/OpenSans-Light-webfont.svg +0 -1831
  92. package/docs/code/fonts/OpenSans-Light-webfont.woff +0 -0
  93. package/docs/code/fonts/OpenSans-LightItalic-webfont.eot +0 -0
  94. package/docs/code/fonts/OpenSans-LightItalic-webfont.svg +0 -1835
  95. package/docs/code/fonts/OpenSans-LightItalic-webfont.woff +0 -0
  96. package/docs/code/fonts/OpenSans-Regular-webfont.eot +0 -0
  97. package/docs/code/fonts/OpenSans-Regular-webfont.svg +0 -1831
  98. package/docs/code/fonts/OpenSans-Regular-webfont.woff +0 -0
  99. package/docs/code/fonts/OpenSans-Semibold-webfont.eot +0 -0
  100. package/docs/code/fonts/OpenSans-Semibold-webfont.svg +0 -1830
  101. package/docs/code/fonts/OpenSans-Semibold-webfont.ttf +0 -0
  102. package/docs/code/fonts/OpenSans-Semibold-webfont.woff +0 -0
  103. package/docs/code/fonts/OpenSans-SemiboldItalic-webfont.eot +0 -0
  104. package/docs/code/fonts/OpenSans-SemiboldItalic-webfont.svg +0 -1830
  105. package/docs/code/fonts/OpenSans-SemiboldItalic-webfont.ttf +0 -0
  106. package/docs/code/fonts/OpenSans-SemiboldItalic-webfont.woff +0 -0
  107. package/docs/code/global.html +0 -325
  108. package/docs/code/helpers_cli.js.html +0 -351
  109. package/docs/code/helpers_util.js.html +0 -127
  110. package/docs/code/index.html +0 -81
  111. package/docs/code/models_deployment.js.html +0 -593
  112. package/docs/code/models_request.js.html +0 -150
  113. package/docs/code/models_user.js.html +0 -232
  114. package/docs/code/module-lib_classifier.html +0 -246
  115. package/docs/code/module-lib_deploy.html +0 -350
  116. package/docs/code/module-lib_helpers_cli.html +0 -2067
  117. package/docs/code/module-lib_helpers_util.html +0 -608
  118. package/docs/code/module-models_deployment-Deployment.html +0 -359
  119. package/docs/code/module-models_deployment-DeploymentSchema.html +0 -359
  120. package/docs/code/module-models_deployment.Deployment.html +0 -359
  121. package/docs/code/module-models_deployment.html +0 -1851
  122. package/docs/code/module-models_request-Request.html +0 -409
  123. package/docs/code/module-models_request-RequestSchema.html +0 -359
  124. package/docs/code/module-models_request.html +0 -446
  125. package/docs/code/module-models_user-User.html +0 -306
  126. package/docs/code/module-models_user-UserSchema.html +0 -306
  127. package/docs/code/module-models_user.User.html +0 -306
  128. package/docs/code/module-models_user.html +0 -1200
  129. package/docs/code/scripts/linenumber.js +0 -25
  130. package/docs/code/scripts/prettify/Apache-License-2.0.txt +0 -202
  131. package/docs/code/scripts/prettify/lang-css.js +0 -2
  132. package/docs/code/scripts/prettify/prettify.js +0 -28
  133. package/docs/code/styles/jsdoc-default.css +0 -692
  134. package/docs/code/styles/prettify-jsdoc.css +0 -111
  135. package/docs/code/styles/prettify-tomorrow.css +0 -132
  136. package/docs/example-docker.gif +0 -0
  137. package/docs/example-node.gif +0 -0
  138. package/docs/example-static.gif +0 -0
  139. package/docs/index.html +0 -50
  140. package/docs/main.css +0 -12
  141. package/docs/psychic-min.css +0 -1
  142. package/lib/helpers/static-server.js +0 -69
  143. package/test/fixtures/docker/index.js +0 -12
  144. package/test/fixtures/node/index.js +0 -8
  145. package/test/fixtures/static/index.html +0 -14
  146. package/test/lib/classifier.js +0 -51
  147. package/test/lib/helpers/util.js +0 -30
@@ -1,1200 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8">
5
- <meta name="viewport" content="width=device-width,initial-scale=1">
6
- <title>models/user - Documentation</title>
7
-
8
- <script src="scripts/prettify/prettify.js"></script>
9
- <script src="scripts/prettify/lang-css.js"></script>
10
- <!--[if lt IE 9]>
11
- <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
12
- <![endif]-->
13
- <link type="text/css" rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
14
- <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
15
- <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
16
- </head>
17
- <body>
18
-
19
- <input type="checkbox" id="nav-trigger" class="nav-trigger" />
20
- <label for="nav-trigger" class="navicon-button x">
21
- <div class="navicon"></div>
22
- </label>
23
-
24
- <label for="nav-trigger" class="overlay"></label>
25
-
26
- <nav>
27
- <li class="nav-link nav-home-link"><a href="index.html">Home</a></li><li class="nav-heading">Classes</li><li class="nav-heading"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="module-models_deployment.Deployment.html">Deployment</a></span></li><li class="nav-heading"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="module-models_request-Request.html">Request</a></span></li><li class="nav-heading"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="module-models_user.User.html">User</a></span></li><li class="nav-heading">Modules</li><li class="nav-heading"><span class="nav-item-type type-module">M</span><span class="nav-item-name"><a href="module-lib_classifier.html">lib/classifier</a></span></li><li class="nav-heading"><span class="nav-item-type type-module">M</span><span class="nav-item-name"><a href="module-lib_deploy.html">lib/deploy</a></span></li><li class="nav-heading"><span class="nav-item-type type-module">M</span><span class="nav-item-name"><a href="module-lib_helpers_cli.html">lib/helpers/cli</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-lib_helpers_cli.html#~cacheCredentials">cacheCredentials</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-lib_helpers_cli.html#~createBundle">createBundle</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-lib_helpers_cli.html#~getCredentials">getCredentials</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-lib_helpers_cli.html#~getDeployments">getDeployments</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-lib_helpers_cli.html#~getLogs">getLogs</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-lib_helpers_cli.html#~login">login</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-lib_helpers_cli.html#~logout">logout</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-lib_helpers_cli.html#~register">register</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-lib_helpers_cli.html#~uploadBundle">uploadBundle</a></span></li><li class="nav-heading"><span class="nav-item-type type-module">M</span><span class="nav-item-name"><a href="module-lib_helpers_util.html">lib/helpers/util</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-lib_helpers_util.html#~contains">contains</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-lib_helpers_util.html#~getPort">getPort</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-lib_helpers_util.html#~hash">hash</a></span></li><li class="nav-heading"><span class="nav-item-type type-module">M</span><span class="nav-item-name"><a href="module-models_deployment.html">models/deployment</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-models_deployment.html#~decorate">decorate</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-models_deployment.html#~get">get</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-models_deployment.html#~getAll">getAll</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-models_deployment.html#~proxy">proxy</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-models_deployment.html#~remove">remove</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-models_deployment.html#~start">start</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-models_deployment.html#~stop">stop</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-models_deployment.html#~update">update</a></span></li><li class="nav-heading"><span class="nav-item-type type-module">M</span><span class="nav-item-name"><a href="module-models_request.html">models/request</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-models_request.html#~count">count</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-models_request.html#~log">log</a></span></li><li class="nav-heading"><span class="nav-item-type type-module">M</span><span class="nav-item-name"><a href="module-models_user.html">models/user</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-models_user.html#~authenticate">authenticate</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-models_user.html#~authenticateMiddleware">authenticateMiddleware</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-models_user.html#~get">get</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-models_user.html#~login">login</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-models_user.html#~logout">logout</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-models_user.html#~register">register</a></span></li>
28
- </nav>
29
-
30
- <div id="main">
31
-
32
- <h1 class="page-title">models/user</h1>
33
-
34
-
35
-
36
-
37
-
38
-
39
-
40
- <section>
41
-
42
- <header>
43
-
44
-
45
-
46
- </header>
47
-
48
- <article>
49
- <div class="container-overview">
50
-
51
-
52
-
53
-
54
-
55
- </div>
56
-
57
-
58
-
59
-
60
-
61
-
62
- <h3 class="subsection-title">Classes</h3>
63
-
64
- <dl>
65
- <dt><a href="module-models_user.User.html">User</a></dt>
66
- <dd></dd>
67
- </dl>
68
-
69
-
70
-
71
-
72
-
73
-
74
-
75
-
76
-
77
- <h3 class="subsection-title">Methods</h3>
78
-
79
-
80
-
81
- <div class="section-method">
82
-
83
-
84
-
85
- <h4 class="name" id="~authenticate"><span class="type-signature">(inner) </span>authenticate<span class="signature">(token, username)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
86
-
87
-
88
-
89
-
90
-
91
- <div class="description">
92
- <p>verify the username and token are valid</p>
93
- </div>
94
-
95
-
96
-
97
-
98
-
99
- <dl class="details">
100
-
101
-
102
-
103
-
104
-
105
-
106
-
107
-
108
-
109
-
110
-
111
-
112
-
113
-
114
-
115
-
116
-
117
-
118
-
119
-
120
-
121
-
122
-
123
-
124
-
125
-
126
- <dt class="tag-source">Source:</dt>
127
- <dd class="tag-source"><ul class="dummy"><li>
128
- <a href="models_user.js.html">models/user.js</a>, <a href="models_user.js.html#line56">line 56</a>
129
- </li></ul></dd>
130
-
131
-
132
-
133
-
134
-
135
-
136
-
137
- </dl>
138
-
139
-
140
-
141
-
142
-
143
-
144
-
145
-
146
-
147
- <h5>Parameters:</h5>
148
-
149
-
150
- <table class="params">
151
- <thead>
152
- <tr>
153
-
154
- <th>Name</th>
155
-
156
-
157
- <th>Type</th>
158
-
159
-
160
-
161
-
162
-
163
- <th class="last">Description</th>
164
- </tr>
165
- </thead>
166
-
167
- <tbody>
168
-
169
-
170
- <tr>
171
-
172
- <td class="name"><code>token</code></td>
173
-
174
-
175
- <td class="type">
176
-
177
-
178
- <span class="param-type"><code>String</code></span>
179
-
180
-
181
-
182
- </td>
183
-
184
-
185
-
186
-
187
-
188
- <td class="description last">
189
- <p>the token associated with the username</p>
190
-
191
- </td>
192
- </tr>
193
-
194
-
195
-
196
- <tr>
197
-
198
- <td class="name"><code>username</code></td>
199
-
200
-
201
- <td class="type">
202
-
203
-
204
- <span class="param-type"><code>String</code></span>
205
-
206
-
207
-
208
- </td>
209
-
210
-
211
-
212
-
213
-
214
- <td class="description last">
215
- <p>the username of the user</p>
216
-
217
- </td>
218
- </tr>
219
-
220
-
221
- </tbody>
222
- </table>
223
-
224
-
225
-
226
-
227
-
228
-
229
-
230
-
231
-
232
-
233
-
234
-
235
-
236
-
237
- <div class="section-returns">
238
- <h5>Returns:</h5>
239
-
240
-
241
-
242
- <dl class="param-type">
243
- <dt>
244
- Type:
245
- </dt>
246
- <dd>
247
-
248
- <span class="param-type"><code>Promise</code></span>
249
-
250
-
251
- </dd>
252
- </dl>
253
-
254
-
255
-
256
- </div>
257
-
258
-
259
-
260
- </div>
261
-
262
-
263
- <div class="section-method">
264
-
265
-
266
-
267
- <h4 class="name" id="~authenticateMiddleware"><span class="type-signature">(inner) </span>authenticateMiddleware<span class="signature">(req, res, next)</span><span class="type-signature"></span></h4>
268
-
269
-
270
-
271
-
272
-
273
- <div class="description">
274
- <p>middleware to verify the username and token are valid, will then set the user to req.user</p>
275
- </div>
276
-
277
-
278
-
279
-
280
-
281
- <dl class="details">
282
-
283
-
284
-
285
-
286
-
287
-
288
-
289
-
290
-
291
-
292
-
293
-
294
-
295
-
296
-
297
-
298
-
299
-
300
-
301
-
302
-
303
-
304
-
305
-
306
-
307
-
308
- <dt class="tag-source">Source:</dt>
309
- <dd class="tag-source"><ul class="dummy"><li>
310
- <a href="models_user.js.html">models/user.js</a>, <a href="models_user.js.html#line34">line 34</a>
311
- </li></ul></dd>
312
-
313
-
314
-
315
-
316
-
317
-
318
-
319
- </dl>
320
-
321
-
322
-
323
-
324
-
325
-
326
-
327
-
328
-
329
- <h5>Parameters:</h5>
330
-
331
-
332
- <table class="params">
333
- <thead>
334
- <tr>
335
-
336
- <th>Name</th>
337
-
338
-
339
- <th>Type</th>
340
-
341
-
342
-
343
-
344
-
345
- <th class="last">Description</th>
346
- </tr>
347
- </thead>
348
-
349
- <tbody>
350
-
351
-
352
- <tr>
353
-
354
- <td class="name"><code>req</code></td>
355
-
356
-
357
- <td class="type">
358
-
359
-
360
- <span class="param-type"><code>Object</code></span>
361
-
362
-
363
-
364
- </td>
365
-
366
-
367
-
368
-
369
-
370
- <td class="description last">
371
- <p>express request</p>
372
-
373
- </td>
374
- </tr>
375
-
376
-
377
-
378
- <tr>
379
-
380
- <td class="name"><code>res</code></td>
381
-
382
-
383
- <td class="type">
384
-
385
-
386
- <span class="param-type"><code>Object</code></span>
387
-
388
-
389
-
390
- </td>
391
-
392
-
393
-
394
-
395
-
396
- <td class="description last">
397
- <p>express response</p>
398
-
399
- </td>
400
- </tr>
401
-
402
-
403
-
404
- <tr>
405
-
406
- <td class="name"><code>next</code></td>
407
-
408
-
409
- <td class="type">
410
-
411
-
412
- <span class="param-type"><code>function</code></span>
413
-
414
-
415
-
416
- </td>
417
-
418
-
419
-
420
-
421
-
422
- <td class="description last">
423
- <p>callback to go to next middleware</p>
424
-
425
- </td>
426
- </tr>
427
-
428
-
429
- </tbody>
430
- </table>
431
-
432
-
433
-
434
-
435
-
436
-
437
-
438
-
439
-
440
-
441
-
442
-
443
-
444
-
445
-
446
-
447
- </div>
448
-
449
-
450
- <div class="section-method">
451
-
452
-
453
-
454
- <h4 class="name" id="~get"><span class="type-signature">(inner) </span>get<span class="signature">(token, username)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
455
-
456
-
457
-
458
-
459
-
460
- <div class="description">
461
- <p>returns the user if token and username are valid</p>
462
- </div>
463
-
464
-
465
-
466
-
467
-
468
- <dl class="details">
469
-
470
-
471
-
472
-
473
-
474
-
475
-
476
-
477
-
478
-
479
-
480
-
481
-
482
-
483
-
484
-
485
-
486
-
487
-
488
-
489
-
490
-
491
-
492
-
493
-
494
-
495
- <dt class="tag-source">Source:</dt>
496
- <dd class="tag-source"><ul class="dummy"><li>
497
- <a href="models_user.js.html">models/user.js</a>, <a href="models_user.js.html#line154">line 154</a>
498
- </li></ul></dd>
499
-
500
-
501
-
502
-
503
-
504
-
505
-
506
- </dl>
507
-
508
-
509
-
510
-
511
-
512
-
513
-
514
-
515
-
516
- <h5>Parameters:</h5>
517
-
518
-
519
- <table class="params">
520
- <thead>
521
- <tr>
522
-
523
- <th>Name</th>
524
-
525
-
526
- <th>Type</th>
527
-
528
-
529
-
530
-
531
-
532
- <th class="last">Description</th>
533
- </tr>
534
- </thead>
535
-
536
- <tbody>
537
-
538
-
539
- <tr>
540
-
541
- <td class="name"><code>token</code></td>
542
-
543
-
544
- <td class="type">
545
-
546
-
547
- <span class="param-type"><code>String</code></span>
548
-
549
-
550
-
551
- </td>
552
-
553
-
554
-
555
-
556
-
557
- <td class="description last">
558
- <p>the token associated with the username</p>
559
-
560
- </td>
561
- </tr>
562
-
563
-
564
-
565
- <tr>
566
-
567
- <td class="name"><code>username</code></td>
568
-
569
-
570
- <td class="type">
571
-
572
-
573
- <span class="param-type"><code>String</code></span>
574
-
575
-
576
-
577
- </td>
578
-
579
-
580
-
581
-
582
-
583
- <td class="description last">
584
- <p>the username of the user</p>
585
-
586
- </td>
587
- </tr>
588
-
589
-
590
- </tbody>
591
- </table>
592
-
593
-
594
-
595
-
596
-
597
-
598
-
599
-
600
-
601
-
602
-
603
-
604
-
605
-
606
- <div class="section-returns">
607
- <h5>Returns:</h5>
608
-
609
-
610
-
611
- <dl class="param-type">
612
- <dt>
613
- Type:
614
- </dt>
615
- <dd>
616
-
617
- <span class="param-type"><code>Promise</code></span>
618
-
619
-
620
- </dd>
621
- </dl>
622
-
623
-
624
-
625
- </div>
626
-
627
-
628
-
629
- </div>
630
-
631
-
632
- <div class="section-method">
633
-
634
-
635
-
636
- <h4 class="name" id="~login"><span class="type-signature">(inner) </span>login<span class="signature">(username, password)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
637
-
638
-
639
-
640
-
641
-
642
- <div class="description">
643
- <p>logs in a user and returns</p>
644
- </div>
645
-
646
-
647
-
648
-
649
-
650
- <dl class="details">
651
-
652
-
653
-
654
-
655
-
656
-
657
-
658
-
659
-
660
-
661
-
662
-
663
-
664
-
665
-
666
-
667
-
668
-
669
-
670
-
671
-
672
-
673
-
674
-
675
-
676
-
677
- <dt class="tag-source">Source:</dt>
678
- <dd class="tag-source"><ul class="dummy"><li>
679
- <a href="models_user.js.html">models/user.js</a>, <a href="models_user.js.html#line103">line 103</a>
680
- </li></ul></dd>
681
-
682
-
683
-
684
-
685
-
686
-
687
-
688
- </dl>
689
-
690
-
691
-
692
-
693
-
694
-
695
-
696
-
697
-
698
- <h5>Parameters:</h5>
699
-
700
-
701
- <table class="params">
702
- <thead>
703
- <tr>
704
-
705
- <th>Name</th>
706
-
707
-
708
- <th>Type</th>
709
-
710
-
711
-
712
-
713
-
714
- <th class="last">Description</th>
715
- </tr>
716
- </thead>
717
-
718
- <tbody>
719
-
720
-
721
- <tr>
722
-
723
- <td class="name"><code>username</code></td>
724
-
725
-
726
- <td class="type">
727
-
728
-
729
- <span class="param-type"><code>String</code></span>
730
-
731
-
732
-
733
- </td>
734
-
735
-
736
-
737
-
738
-
739
- <td class="description last">
740
- <p>the username of the user who is logging in</p>
741
-
742
- </td>
743
- </tr>
744
-
745
-
746
-
747
- <tr>
748
-
749
- <td class="name"><code>password</code></td>
750
-
751
-
752
- <td class="type">
753
-
754
-
755
- <span class="param-type"><code>String</code></span>
756
-
757
-
758
-
759
- </td>
760
-
761
-
762
-
763
-
764
-
765
- <td class="description last">
766
- <p>the password associated with the user</p>
767
-
768
- </td>
769
- </tr>
770
-
771
-
772
- </tbody>
773
- </table>
774
-
775
-
776
-
777
-
778
-
779
-
780
-
781
-
782
-
783
-
784
-
785
-
786
-
787
-
788
- <div class="section-returns">
789
- <h5>Returns:</h5>
790
-
791
-
792
-
793
- <dl class="param-type">
794
- <dt>
795
- Type:
796
- </dt>
797
- <dd>
798
-
799
- <span class="param-type"><code>Promise</code></span>
800
-
801
-
802
- </dd>
803
- </dl>
804
-
805
-
806
-
807
- </div>
808
-
809
-
810
-
811
- </div>
812
-
813
-
814
- <div class="section-method">
815
-
816
-
817
-
818
- <h4 class="name" id="~logout"><span class="type-signature">(inner) </span>logout<span class="signature">(token, username)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
819
-
820
-
821
-
822
-
823
-
824
- <div class="description">
825
- <p>logs out a user by deleting their token</p>
826
- </div>
827
-
828
-
829
-
830
-
831
-
832
- <dl class="details">
833
-
834
-
835
-
836
-
837
-
838
-
839
-
840
-
841
-
842
-
843
-
844
-
845
-
846
-
847
-
848
-
849
-
850
-
851
-
852
-
853
-
854
-
855
-
856
-
857
-
858
-
859
- <dt class="tag-source">Source:</dt>
860
- <dd class="tag-source"><ul class="dummy"><li>
861
- <a href="models_user.js.html">models/user.js</a>, <a href="models_user.js.html#line80">line 80</a>
862
- </li></ul></dd>
863
-
864
-
865
-
866
-
867
-
868
-
869
-
870
- </dl>
871
-
872
-
873
-
874
-
875
-
876
-
877
-
878
-
879
-
880
- <h5>Parameters:</h5>
881
-
882
-
883
- <table class="params">
884
- <thead>
885
- <tr>
886
-
887
- <th>Name</th>
888
-
889
-
890
- <th>Type</th>
891
-
892
-
893
-
894
-
895
-
896
- <th class="last">Description</th>
897
- </tr>
898
- </thead>
899
-
900
- <tbody>
901
-
902
-
903
- <tr>
904
-
905
- <td class="name"><code>token</code></td>
906
-
907
-
908
- <td class="type">
909
-
910
-
911
- <span class="param-type"><code>String</code></span>
912
-
913
-
914
-
915
- </td>
916
-
917
-
918
-
919
-
920
-
921
- <td class="description last">
922
- <p>the token associated with the username</p>
923
-
924
- </td>
925
- </tr>
926
-
927
-
928
-
929
- <tr>
930
-
931
- <td class="name"><code>username</code></td>
932
-
933
-
934
- <td class="type">
935
-
936
-
937
- <span class="param-type"><code>String</code></span>
938
-
939
-
940
-
941
- </td>
942
-
943
-
944
-
945
-
946
-
947
- <td class="description last">
948
- <p>the username of the user</p>
949
-
950
- </td>
951
- </tr>
952
-
953
-
954
- </tbody>
955
- </table>
956
-
957
-
958
-
959
-
960
-
961
-
962
-
963
-
964
-
965
-
966
-
967
-
968
-
969
-
970
- <div class="section-returns">
971
- <h5>Returns:</h5>
972
-
973
-
974
-
975
- <dl class="param-type">
976
- <dt>
977
- Type:
978
- </dt>
979
- <dd>
980
-
981
- <span class="param-type"><code>Promise</code></span>
982
-
983
-
984
- </dd>
985
- </dl>
986
-
987
-
988
-
989
- </div>
990
-
991
-
992
-
993
- </div>
994
-
995
-
996
- <div class="section-method">
997
-
998
-
999
-
1000
- <h4 class="name" id="~register"><span class="type-signature">(inner) </span>register<span class="signature">(username, password)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
1001
-
1002
-
1003
-
1004
-
1005
-
1006
- <div class="description">
1007
- <p>registers a user</p>
1008
- </div>
1009
-
1010
-
1011
-
1012
-
1013
-
1014
- <dl class="details">
1015
-
1016
-
1017
-
1018
-
1019
-
1020
-
1021
-
1022
-
1023
-
1024
-
1025
-
1026
-
1027
-
1028
-
1029
-
1030
-
1031
-
1032
-
1033
-
1034
-
1035
-
1036
-
1037
-
1038
-
1039
-
1040
-
1041
- <dt class="tag-source">Source:</dt>
1042
- <dd class="tag-source"><ul class="dummy"><li>
1043
- <a href="models_user.js.html">models/user.js</a>, <a href="models_user.js.html#line129">line 129</a>
1044
- </li></ul></dd>
1045
-
1046
-
1047
-
1048
-
1049
-
1050
-
1051
-
1052
- </dl>
1053
-
1054
-
1055
-
1056
-
1057
-
1058
-
1059
-
1060
-
1061
-
1062
- <h5>Parameters:</h5>
1063
-
1064
-
1065
- <table class="params">
1066
- <thead>
1067
- <tr>
1068
-
1069
- <th>Name</th>
1070
-
1071
-
1072
- <th>Type</th>
1073
-
1074
-
1075
-
1076
-
1077
-
1078
- <th class="last">Description</th>
1079
- </tr>
1080
- </thead>
1081
-
1082
- <tbody>
1083
-
1084
-
1085
- <tr>
1086
-
1087
- <td class="name"><code>username</code></td>
1088
-
1089
-
1090
- <td class="type">
1091
-
1092
-
1093
- <span class="param-type"><code>String</code></span>
1094
-
1095
-
1096
-
1097
- </td>
1098
-
1099
-
1100
-
1101
-
1102
-
1103
- <td class="description last">
1104
- <p>the username of the user who is logging in</p>
1105
-
1106
- </td>
1107
- </tr>
1108
-
1109
-
1110
-
1111
- <tr>
1112
-
1113
- <td class="name"><code>password</code></td>
1114
-
1115
-
1116
- <td class="type">
1117
-
1118
-
1119
- <span class="param-type"><code>String</code></span>
1120
-
1121
-
1122
-
1123
- </td>
1124
-
1125
-
1126
-
1127
-
1128
-
1129
- <td class="description last">
1130
- <p>the password associated with the user</p>
1131
-
1132
- </td>
1133
- </tr>
1134
-
1135
-
1136
- </tbody>
1137
- </table>
1138
-
1139
-
1140
-
1141
-
1142
-
1143
-
1144
-
1145
-
1146
-
1147
-
1148
-
1149
-
1150
-
1151
-
1152
- <div class="section-returns">
1153
- <h5>Returns:</h5>
1154
-
1155
-
1156
-
1157
- <dl class="param-type">
1158
- <dt>
1159
- Type:
1160
- </dt>
1161
- <dd>
1162
-
1163
- <span class="param-type"><code>Promise</code></span>
1164
-
1165
-
1166
- </dd>
1167
- </dl>
1168
-
1169
-
1170
-
1171
- </div>
1172
-
1173
-
1174
-
1175
- </div>
1176
-
1177
-
1178
-
1179
-
1180
-
1181
-
1182
- </article>
1183
-
1184
- </section>
1185
-
1186
-
1187
-
1188
-
1189
- </div>
1190
-
1191
- <br class="clear">
1192
-
1193
- <footer>
1194
- Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.4</a> on Mon Aug 14 2017 00:16:03 GMT-0700 (PDT) using the Minami theme.
1195
- </footer>
1196
-
1197
- <script>prettyPrint();</script>
1198
- <script src="scripts/linenumber.js"></script>
1199
- </body>
1200
- </html>