typespeed 2.0.20 → 2.0.22

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 (222) hide show
  1. package/README.md +18 -13
  2. package/dist/core.decorator.js +1 -30
  3. package/dist/default/default-authentication.class.js +25 -0
  4. package/dist/default/express-server.class.js +11 -4
  5. package/dist/default/log-default.class.js +0 -6
  6. package/dist/factory/authentication-factory.class.js +11 -0
  7. package/dist/factory/log-factory.class.js +9 -0
  8. package/dist/route.decorator.js +92 -2
  9. package/dist/scaffold/command.js +1 -1
  10. package/dist/typespeed.d.ts +25 -3
  11. package/dist/typespeed.js +3 -1
  12. package/package.json +10 -1
  13. package/src/core.decorator.ts +1 -29
  14. package/src/default/default-authentication.class.ts +10 -0
  15. package/src/default/express-server.class.ts +12 -5
  16. package/src/default/log-default.class.ts +0 -10
  17. package/src/factory/authentication-factory.class.ts +9 -0
  18. package/src/factory/log-factory.class.ts +9 -2
  19. package/src/route.decorator.ts +91 -3
  20. package/src/scaffold/command.ts +1 -1
  21. package/src/typespeed.d.ts +25 -3
  22. package/src/typespeed.ts +1 -0
  23. package/test/node_modules/.package-lock.json +65 -101
  24. package/test/node_modules/@types/body-parser/LICENSE +21 -0
  25. package/test/node_modules/@types/body-parser/README.md +16 -0
  26. package/test/node_modules/@types/body-parser/index.d.ts +107 -0
  27. package/test/node_modules/@types/body-parser/package.json +58 -0
  28. package/test/node_modules/@types/connect/LICENSE +21 -0
  29. package/test/node_modules/@types/connect/README.md +16 -0
  30. package/test/node_modules/@types/connect/index.d.ts +93 -0
  31. package/test/node_modules/@types/connect/package.json +32 -0
  32. package/test/node_modules/@types/express/LICENSE +21 -0
  33. package/test/node_modules/@types/express/README.md +16 -0
  34. package/test/node_modules/@types/express/index.d.ts +136 -0
  35. package/test/node_modules/@types/express/package.json +45 -0
  36. package/test/node_modules/@types/express-serve-static-core/LICENSE +21 -0
  37. package/test/node_modules/@types/express-serve-static-core/README.md +16 -0
  38. package/test/node_modules/@types/express-serve-static-core/index.d.ts +1281 -0
  39. package/test/node_modules/@types/express-serve-static-core/package.json +55 -0
  40. package/test/node_modules/@types/mime/LICENSE +21 -0
  41. package/test/node_modules/@types/mime/Mime.d.ts +10 -0
  42. package/test/node_modules/@types/mime/README.md +16 -0
  43. package/test/node_modules/@types/mime/index.d.ts +35 -0
  44. package/test/node_modules/@types/mime/lite.d.ts +7 -0
  45. package/test/node_modules/@types/mime/package.json +29 -0
  46. package/test/node_modules/@types/qs/LICENSE +21 -0
  47. package/test/node_modules/@types/qs/README.md +16 -0
  48. package/test/node_modules/@types/qs/index.d.ts +62 -0
  49. package/test/node_modules/@types/qs/package.json +65 -0
  50. package/test/node_modules/@types/range-parser/LICENSE +21 -0
  51. package/test/node_modules/@types/range-parser/README.md +55 -0
  52. package/test/node_modules/@types/range-parser/index.d.ts +35 -0
  53. package/test/node_modules/@types/range-parser/package.json +25 -0
  54. package/test/node_modules/@types/send/LICENSE +21 -0
  55. package/test/node_modules/@types/send/README.md +16 -0
  56. package/test/node_modules/@types/send/index.d.ts +231 -0
  57. package/test/node_modules/@types/send/package.json +33 -0
  58. package/test/node_modules/@types/serve-static/LICENSE +21 -0
  59. package/test/node_modules/@types/serve-static/README.md +16 -0
  60. package/test/node_modules/@types/serve-static/index.d.ts +113 -0
  61. package/test/node_modules/@types/serve-static/package.json +38 -0
  62. package/test/src/config.json +5 -0
  63. package/test/src/custom-log.class.ts +6 -0
  64. package/test/src/jwt-authentication.class.ts +29 -0
  65. package/test/src/test-request.class.ts +36 -0
  66. package/test/node_modules/@acuminous/bitsyntax/.github/workflows/node-js-ci.yml +0 -17
  67. package/test/node_modules/@acuminous/bitsyntax/.github/workflows/node-js-publish.yml +0 -30
  68. package/test/node_modules/@acuminous/bitsyntax/LICENSE +0 -6
  69. package/test/node_modules/@acuminous/bitsyntax/LICENSE-MIT +0 -21
  70. package/test/node_modules/@acuminous/bitsyntax/Makefile +0 -15
  71. package/test/node_modules/@acuminous/bitsyntax/README.md +0 -308
  72. package/test/node_modules/@acuminous/bitsyntax/index.js +0 -10
  73. package/test/node_modules/@acuminous/bitsyntax/lib/compile.js +0 -303
  74. package/test/node_modules/@acuminous/bitsyntax/lib/constructor.js +0 -142
  75. package/test/node_modules/@acuminous/bitsyntax/lib/grammar.pegjs +0 -67
  76. package/test/node_modules/@acuminous/bitsyntax/lib/interp.js +0 -232
  77. package/test/node_modules/@acuminous/bitsyntax/lib/parse.js +0 -32
  78. package/test/node_modules/@acuminous/bitsyntax/lib/parser.js +0 -1173
  79. package/test/node_modules/@acuminous/bitsyntax/lib/pattern.js +0 -119
  80. package/test/node_modules/@acuminous/bitsyntax/package.json +0 -36
  81. package/test/node_modules/@acuminous/bitsyntax/test/consing.test.js +0 -50
  82. package/test/node_modules/@acuminous/bitsyntax/test/matching.test.js +0 -193
  83. package/test/node_modules/amqplib/.github/ISSUE_TEMPLATE/bug_report.md +0 -38
  84. package/test/node_modules/amqplib/.github/workflows/test.yml +0 -38
  85. package/test/node_modules/amqplib/CHANGELOG.md +0 -430
  86. package/test/node_modules/amqplib/LICENSE +0 -6
  87. package/test/node_modules/amqplib/LICENSE-MIT +0 -21
  88. package/test/node_modules/amqplib/Makefile +0 -47
  89. package/test/node_modules/amqplib/README.md +0 -157
  90. package/test/node_modules/amqplib/bin/generate-defs.js +0 -722
  91. package/test/node_modules/amqplib/callback_api.js +0 -22
  92. package/test/node_modules/amqplib/channel_api.js +0 -16
  93. package/test/node_modules/amqplib/examples/headers.js +0 -42
  94. package/test/node_modules/amqplib/examples/receive_generator.js +0 -39
  95. package/test/node_modules/amqplib/examples/send_generators.js +0 -42
  96. package/test/node_modules/amqplib/examples/ssl.js +0 -64
  97. package/test/node_modules/amqplib/examples/tutorials/README.md +0 -93
  98. package/test/node_modules/amqplib/examples/tutorials/callback_api/emit_log.js +0 -28
  99. package/test/node_modules/amqplib/examples/tutorials/callback_api/emit_log_direct.js +0 -30
  100. package/test/node_modules/amqplib/examples/tutorials/callback_api/emit_log_topic.js +0 -27
  101. package/test/node_modules/amqplib/examples/tutorials/callback_api/new_task.js +0 -27
  102. package/test/node_modules/amqplib/examples/tutorials/callback_api/receive.js +0 -30
  103. package/test/node_modules/amqplib/examples/tutorials/callback_api/receive_logs.js +0 -36
  104. package/test/node_modules/amqplib/examples/tutorials/callback_api/receive_logs_direct.js +0 -56
  105. package/test/node_modules/amqplib/examples/tutorials/callback_api/receive_logs_topic.js +0 -55
  106. package/test/node_modules/amqplib/examples/tutorials/callback_api/rpc_client.js +0 -49
  107. package/test/node_modules/amqplib/examples/tutorials/callback_api/rpc_server.js +0 -45
  108. package/test/node_modules/amqplib/examples/tutorials/callback_api/send.js +0 -29
  109. package/test/node_modules/amqplib/examples/tutorials/callback_api/worker.js +0 -35
  110. package/test/node_modules/amqplib/examples/tutorials/emit_log.js +0 -19
  111. package/test/node_modules/amqplib/examples/tutorials/emit_log_direct.js +0 -20
  112. package/test/node_modules/amqplib/examples/tutorials/emit_log_topic.js +0 -19
  113. package/test/node_modules/amqplib/examples/tutorials/new_task.js +0 -18
  114. package/test/node_modules/amqplib/examples/tutorials/package.json +0 -16
  115. package/test/node_modules/amqplib/examples/tutorials/receive.js +0 -21
  116. package/test/node_modules/amqplib/examples/tutorials/receive_logs.js +0 -28
  117. package/test/node_modules/amqplib/examples/tutorials/receive_logs_direct.js +0 -44
  118. package/test/node_modules/amqplib/examples/tutorials/receive_logs_topic.js +0 -43
  119. package/test/node_modules/amqplib/examples/tutorials/rpc_client.js +0 -52
  120. package/test/node_modules/amqplib/examples/tutorials/rpc_server.js +0 -39
  121. package/test/node_modules/amqplib/examples/tutorials/send.js +0 -23
  122. package/test/node_modules/amqplib/examples/tutorials/worker.js +0 -28
  123. package/test/node_modules/amqplib/examples/waitForConfirms.js +0 -22
  124. package/test/node_modules/amqplib/lib/api_args.js +0 -314
  125. package/test/node_modules/amqplib/lib/bitset.js +0 -130
  126. package/test/node_modules/amqplib/lib/callback_model.js +0 -327
  127. package/test/node_modules/amqplib/lib/channel.js +0 -499
  128. package/test/node_modules/amqplib/lib/channel_model.js +0 -302
  129. package/test/node_modules/amqplib/lib/codec.js +0 -321
  130. package/test/node_modules/amqplib/lib/connect.js +0 -189
  131. package/test/node_modules/amqplib/lib/connection.js +0 -663
  132. package/test/node_modules/amqplib/lib/credentials.js +0 -42
  133. package/test/node_modules/amqplib/lib/defs.js +0 -4966
  134. package/test/node_modules/amqplib/lib/error.js +0 -24
  135. package/test/node_modules/amqplib/lib/format.js +0 -40
  136. package/test/node_modules/amqplib/lib/frame.js +0 -113
  137. package/test/node_modules/amqplib/lib/heartbeat.js +0 -89
  138. package/test/node_modules/amqplib/lib/mux.js +0 -129
  139. package/test/node_modules/amqplib/package.json +0 -37
  140. package/test/node_modules/amqplib/test/bitset.js +0 -69
  141. package/test/node_modules/amqplib/test/callback_api.js +0 -312
  142. package/test/node_modules/amqplib/test/channel.js +0 -621
  143. package/test/node_modules/amqplib/test/channel_api.js +0 -596
  144. package/test/node_modules/amqplib/test/codec.js +0 -237
  145. package/test/node_modules/amqplib/test/connect.js +0 -197
  146. package/test/node_modules/amqplib/test/connection.js +0 -390
  147. package/test/node_modules/amqplib/test/data.js +0 -254
  148. package/test/node_modules/amqplib/test/frame.js +0 -198
  149. package/test/node_modules/amqplib/test/mux.js +0 -204
  150. package/test/node_modules/amqplib/test/util.js +0 -219
  151. package/test/node_modules/buffer-more-ints/.travis.yml +0 -6
  152. package/test/node_modules/buffer-more-ints/LICENSE +0 -19
  153. package/test/node_modules/buffer-more-ints/README.md +0 -69
  154. package/test/node_modules/buffer-more-ints/buffer-more-ints-tests.js +0 -183
  155. package/test/node_modules/buffer-more-ints/buffer-more-ints.js +0 -432
  156. package/test/node_modules/buffer-more-ints/package.json +0 -19
  157. package/test/node_modules/buffer-more-ints/polyfill.js +0 -71
  158. package/test/node_modules/core-util-is/LICENSE +0 -19
  159. package/test/node_modules/core-util-is/README.md +0 -3
  160. package/test/node_modules/core-util-is/lib/util.js +0 -107
  161. package/test/node_modules/core-util-is/package.json +0 -38
  162. package/test/node_modules/debug/LICENSE +0 -20
  163. package/test/node_modules/debug/README.md +0 -481
  164. package/test/node_modules/debug/package.json +0 -59
  165. package/test/node_modules/debug/src/browser.js +0 -269
  166. package/test/node_modules/debug/src/common.js +0 -274
  167. package/test/node_modules/debug/src/index.js +0 -10
  168. package/test/node_modules/debug/src/node.js +0 -263
  169. package/test/node_modules/inherits/LICENSE +0 -16
  170. package/test/node_modules/inherits/README.md +0 -42
  171. package/test/node_modules/inherits/inherits.js +0 -9
  172. package/test/node_modules/inherits/inherits_browser.js +0 -27
  173. package/test/node_modules/inherits/package.json +0 -29
  174. package/test/node_modules/isarray/README.md +0 -54
  175. package/test/node_modules/isarray/build/build.js +0 -209
  176. package/test/node_modules/isarray/component.json +0 -19
  177. package/test/node_modules/isarray/index.js +0 -3
  178. package/test/node_modules/isarray/package.json +0 -25
  179. package/test/node_modules/ms/index.js +0 -162
  180. package/test/node_modules/ms/license.md +0 -21
  181. package/test/node_modules/ms/package.json +0 -37
  182. package/test/node_modules/ms/readme.md +0 -60
  183. package/test/node_modules/querystringify/LICENSE +0 -22
  184. package/test/node_modules/querystringify/README.md +0 -61
  185. package/test/node_modules/querystringify/index.js +0 -118
  186. package/test/node_modules/querystringify/package.json +0 -38
  187. package/test/node_modules/readable-stream/LICENSE +0 -18
  188. package/test/node_modules/readable-stream/README.md +0 -15
  189. package/test/node_modules/readable-stream/duplex.js +0 -1
  190. package/test/node_modules/readable-stream/float.patch +0 -923
  191. package/test/node_modules/readable-stream/lib/_stream_duplex.js +0 -89
  192. package/test/node_modules/readable-stream/lib/_stream_passthrough.js +0 -46
  193. package/test/node_modules/readable-stream/lib/_stream_readable.js +0 -951
  194. package/test/node_modules/readable-stream/lib/_stream_transform.js +0 -209
  195. package/test/node_modules/readable-stream/lib/_stream_writable.js +0 -477
  196. package/test/node_modules/readable-stream/package.json +0 -32
  197. package/test/node_modules/readable-stream/passthrough.js +0 -1
  198. package/test/node_modules/readable-stream/readable.js +0 -10
  199. package/test/node_modules/readable-stream/transform.js +0 -1
  200. package/test/node_modules/readable-stream/writable.js +0 -1
  201. package/test/node_modules/requires-port/.travis.yml +0 -19
  202. package/test/node_modules/requires-port/LICENSE +0 -22
  203. package/test/node_modules/requires-port/README.md +0 -47
  204. package/test/node_modules/requires-port/index.js +0 -38
  205. package/test/node_modules/requires-port/package.json +0 -47
  206. package/test/node_modules/requires-port/test.js +0 -98
  207. package/test/node_modules/safe-buffer/LICENSE +0 -21
  208. package/test/node_modules/safe-buffer/README.md +0 -584
  209. package/test/node_modules/safe-buffer/index.d.ts +0 -187
  210. package/test/node_modules/safe-buffer/index.js +0 -62
  211. package/test/node_modules/safe-buffer/package.json +0 -37
  212. package/test/node_modules/string_decoder/LICENSE +0 -20
  213. package/test/node_modules/string_decoder/README.md +0 -7
  214. package/test/node_modules/string_decoder/index.js +0 -221
  215. package/test/node_modules/string_decoder/package.json +0 -25
  216. package/test/node_modules/url-parse/LICENSE +0 -22
  217. package/test/node_modules/url-parse/README.md +0 -153
  218. package/test/node_modules/url-parse/dist/url-parse.js +0 -755
  219. package/test/node_modules/url-parse/dist/url-parse.min.js +0 -1
  220. package/test/node_modules/url-parse/dist/url-parse.min.js.map +0 -1
  221. package/test/node_modules/url-parse/index.js +0 -589
  222. package/test/node_modules/url-parse/package.json +0 -49
@@ -0,0 +1,231 @@
1
+ // Type definitions for send 0.17
2
+ // Project: https://github.com/pillarjs/send
3
+ // Definitions by: Mike Jerred <https://github.com/MikeJerred>
4
+ // Piotr Błażejewicz <https://github.com/peterblazejewicz>
5
+ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
6
+
7
+ /// <reference types="node" />
8
+
9
+ import * as stream from "stream";
10
+ import * as fs from "fs";
11
+ import * as m from "mime";
12
+
13
+ /**
14
+ * Create a new SendStream for the given path to send to a res.
15
+ * The req is the Node.js HTTP request and the path is a urlencoded path to send (urlencoded, not the actual file-system path).
16
+ */
17
+ declare function send(req: stream.Readable, path: string, options?: send.SendOptions): send.SendStream;
18
+
19
+ declare namespace send {
20
+ const mime: typeof m;
21
+ interface SendOptions {
22
+ /**
23
+ * Enable or disable accepting ranged requests, defaults to true.
24
+ * Disabling this will not send Accept-Ranges and ignore the contents of the Range request header.
25
+ */
26
+ acceptRanges?: boolean | undefined;
27
+
28
+ /**
29
+ * Enable or disable setting Cache-Control response header, defaults to true.
30
+ * Disabling this will ignore the maxAge option.
31
+ */
32
+ cacheControl?: boolean | undefined;
33
+
34
+ /**
35
+ * Set how "dotfiles" are treated when encountered.
36
+ * A dotfile is a file or directory that begins with a dot (".").
37
+ * Note this check is done on the path itself without checking if the path actually exists on the disk.
38
+ * If root is specified, only the dotfiles above the root are checked (i.e. the root itself can be within a dotfile when when set to "deny").
39
+ * 'allow' No special treatment for dotfiles.
40
+ * 'deny' Send a 403 for any request for a dotfile.
41
+ * 'ignore' Pretend like the dotfile does not exist and 404.
42
+ * The default value is similar to 'ignore', with the exception that this default will not ignore the files within a directory that begins with a dot, for backward-compatibility.
43
+ */
44
+ dotfiles?: "allow" | "deny" | "ignore" | undefined;
45
+
46
+ /**
47
+ * Byte offset at which the stream ends, defaults to the length of the file minus 1.
48
+ * The end is inclusive in the stream, meaning end: 3 will include the 4th byte in the stream.
49
+ */
50
+ end?: number | undefined;
51
+
52
+ /**
53
+ * Enable or disable etag generation, defaults to true.
54
+ */
55
+ etag?: boolean | undefined;
56
+
57
+ /**
58
+ * If a given file doesn't exist, try appending one of the given extensions, in the given order.
59
+ * By default, this is disabled (set to false).
60
+ * An example value that will serve extension-less HTML files: ['html', 'htm'].
61
+ * This is skipped if the requested file already has an extension.
62
+ */
63
+ extensions?: string[] | string | boolean | undefined;
64
+
65
+ /**
66
+ * Enable or disable the immutable directive in the Cache-Control response header, defaults to false.
67
+ * If set to true, the maxAge option should also be specified to enable caching.
68
+ * The immutable directive will prevent supported clients from making conditional requests during the life of the maxAge option to check if the file has changed.
69
+ * @default false
70
+ */
71
+ immutable?: boolean | undefined;
72
+
73
+ /**
74
+ * By default send supports "index.html" files, to disable this set false or to supply a new index pass a string or an array in preferred order.
75
+ */
76
+ index?: string[] | string | boolean | undefined;
77
+
78
+ /**
79
+ * Enable or disable Last-Modified header, defaults to true.
80
+ * Uses the file system's last modified value.
81
+ */
82
+ lastModified?: boolean | undefined;
83
+
84
+ /**
85
+ * Provide a max-age in milliseconds for http caching, defaults to 0.
86
+ * This can also be a string accepted by the ms module.
87
+ */
88
+ maxAge?: string | number | undefined;
89
+
90
+ /**
91
+ * Serve files relative to path.
92
+ */
93
+ root?: string | undefined;
94
+
95
+ /**
96
+ * Byte offset at which the stream starts, defaults to 0.
97
+ * The start is inclusive, meaning start: 2 will include the 3rd byte in the stream.
98
+ */
99
+ start?: number | undefined;
100
+ }
101
+
102
+ interface SendStream extends stream.Stream {
103
+ /**
104
+ * @deprecated pass etag as option
105
+ * Enable or disable etag generation.
106
+ */
107
+ etag(val: boolean): SendStream;
108
+
109
+ /**
110
+ * @deprecated use dotfiles option
111
+ * Enable or disable "hidden" (dot) files.
112
+ */
113
+ hidden(val: boolean): SendStream;
114
+
115
+ /**
116
+ * @deprecated pass index as option
117
+ * Set index `paths`, set to a falsy value to disable index support.
118
+ */
119
+ index(paths: string[] | string): SendStream;
120
+
121
+ /**
122
+ * @deprecated pass root as option
123
+ * Set root `path`.
124
+ */
125
+ root(paths: string): SendStream;
126
+
127
+ /**
128
+ * @deprecated pass root as option
129
+ * Set root `path`.
130
+ */
131
+ from(paths: string): SendStream;
132
+
133
+ /**
134
+ * @deprecated pass maxAge as option
135
+ * Set max-age to `maxAge`.
136
+ */
137
+ maxage(maxAge: string | number): SendStream;
138
+
139
+ /**
140
+ * Emit error with `status`.
141
+ */
142
+ error(status: number, error?: Error): void;
143
+
144
+ /**
145
+ * Check if the pathname ends with "/".
146
+ */
147
+ hasTrailingSlash(): boolean;
148
+
149
+ /**
150
+ * Check if this is a conditional GET request.
151
+ */
152
+ isConditionalGET(): boolean;
153
+
154
+ /**
155
+ * Strip content-* header fields.
156
+ */
157
+ removeContentHeaderFields(): void;
158
+
159
+ /**
160
+ * Respond with 304 not modified.
161
+ */
162
+ notModified(): void;
163
+
164
+ /**
165
+ * Raise error that headers already sent.
166
+ */
167
+ headersAlreadySent(): void;
168
+
169
+ /**
170
+ * Check if the request is cacheable, aka responded with 2xx or 304 (see RFC 2616 section 14.2{5,6}).
171
+ */
172
+ isCachable(): boolean;
173
+
174
+ /**
175
+ * Handle stat() error.
176
+ */
177
+ onStatError(error: Error): void;
178
+
179
+ /**
180
+ * Check if the cache is fresh.
181
+ */
182
+ isFresh(): boolean;
183
+
184
+ /**
185
+ * Check if the range is fresh.
186
+ */
187
+ isRangeFresh(): boolean;
188
+
189
+ /**
190
+ * Redirect to path.
191
+ */
192
+ redirect(path: string): void;
193
+
194
+ /**
195
+ * Pipe to `res`.
196
+ */
197
+ pipe<T extends NodeJS.WritableStream>(res: T): T;
198
+
199
+ /**
200
+ * Transfer `path`.
201
+ */
202
+ send(path: string, stat?: fs.Stats): void;
203
+
204
+ /**
205
+ * Transfer file for `path`.
206
+ */
207
+ sendFile(path: string): void;
208
+
209
+ /**
210
+ * Transfer index for `path`.
211
+ */
212
+ sendIndex(path: string): void;
213
+
214
+ /**
215
+ * Transfer index for `path`.
216
+ */
217
+ stream(path: string, options?: {}): void;
218
+
219
+ /**
220
+ * Set content-type based on `path` if it hasn't been explicitly set.
221
+ */
222
+ type(path: string): void;
223
+
224
+ /**
225
+ * Set response header fields, most fields may be pre-defined.
226
+ */
227
+ setHeader(path: string, stat: fs.Stats): void;
228
+ }
229
+ }
230
+
231
+ export = send;
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "@types/send",
3
+ "version": "0.17.1",
4
+ "description": "TypeScript definitions for send",
5
+ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/send",
6
+ "license": "MIT",
7
+ "contributors": [
8
+ {
9
+ "name": "Mike Jerred",
10
+ "url": "https://github.com/MikeJerred",
11
+ "githubUsername": "MikeJerred"
12
+ },
13
+ {
14
+ "name": "Piotr Błażejewicz",
15
+ "url": "https://github.com/peterblazejewicz",
16
+ "githubUsername": "peterblazejewicz"
17
+ }
18
+ ],
19
+ "main": "",
20
+ "types": "index.d.ts",
21
+ "repository": {
22
+ "type": "git",
23
+ "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
24
+ "directory": "types/send"
25
+ },
26
+ "scripts": {},
27
+ "dependencies": {
28
+ "@types/mime": "^1",
29
+ "@types/node": "*"
30
+ },
31
+ "typesPublisherContentHash": "11d86e6b6fa2c78b8659b4ad9d2f295175d5f4bd5fa11649b26a8c945ee3ffb3",
32
+ "typeScriptVersion": "3.6"
33
+ }
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) Microsoft Corporation.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE
@@ -0,0 +1,16 @@
1
+ # Installation
2
+ > `npm install --save @types/serve-static`
3
+
4
+ # Summary
5
+ This package contains type definitions for serve-static (https://github.com/expressjs/serve-static).
6
+
7
+ # Details
8
+ Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/serve-static.
9
+
10
+ ### Additional Details
11
+ * Last updated: Thu, 23 Feb 2023 19:02:39 GMT
12
+ * Dependencies: [@types/mime](https://npmjs.com/package/@types/mime), [@types/node](https://npmjs.com/package/@types/node)
13
+ * Global values: none
14
+
15
+ # Credits
16
+ These definitions were written by [Uros Smolnik](https://github.com/urossmolnik), [Linus Unnebäck](https://github.com/LinusU), and [Devansh Jethmalani](https://github.com/devanshj).
@@ -0,0 +1,113 @@
1
+ // Type definitions for serve-static 1.15
2
+ // Project: https://github.com/expressjs/serve-static
3
+ // Definitions by: Uros Smolnik <https://github.com/urossmolnik>
4
+ // Linus Unnebäck <https://github.com/LinusU>
5
+ // Devansh Jethmalani <https://github.com/devanshj>
6
+ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
7
+
8
+ /// <reference types="node" />
9
+ import * as m from "mime";
10
+ import * as http from "http";
11
+
12
+ /**
13
+ * Create a new middleware function to serve files from within a given root directory.
14
+ * The file to serve will be determined by combining req.url with the provided root directory.
15
+ * When a file is not found, instead of sending a 404 response, this module will instead call next() to move on to the next middleware, allowing for stacking and fall-backs.
16
+ */
17
+ declare function serveStatic<R extends http.ServerResponse>(
18
+ root: string,
19
+ options?: serveStatic.ServeStaticOptions<R>
20
+ ): serveStatic.RequestHandler<R>;
21
+
22
+ declare namespace serveStatic {
23
+ var mime: typeof m;
24
+ interface ServeStaticOptions<R extends http.ServerResponse = http.ServerResponse> {
25
+ /**
26
+ * Enable or disable accepting ranged requests, defaults to true.
27
+ * Disabling this will not send Accept-Ranges and ignore the contents of the Range request header.
28
+ */
29
+ acceptRanges?: boolean | undefined;
30
+
31
+ /**
32
+ * Enable or disable setting Cache-Control response header, defaults to true.
33
+ * Disabling this will ignore the immutable and maxAge options.
34
+ */
35
+ cacheControl?: boolean | undefined;
36
+
37
+ /**
38
+ * Set how "dotfiles" are treated when encountered. A dotfile is a file or directory that begins with a dot (".").
39
+ * Note this check is done on the path itself without checking if the path actually exists on the disk.
40
+ * If root is specified, only the dotfiles above the root are checked (i.e. the root itself can be within a dotfile when when set to "deny").
41
+ * The default value is 'ignore'.
42
+ * 'allow' No special treatment for dotfiles
43
+ * 'deny' Send a 403 for any request for a dotfile
44
+ * 'ignore' Pretend like the dotfile does not exist and call next()
45
+ */
46
+ dotfiles?: string | undefined;
47
+
48
+ /**
49
+ * Enable or disable etag generation, defaults to true.
50
+ */
51
+ etag?: boolean | undefined;
52
+
53
+ /**
54
+ * Set file extension fallbacks. When set, if a file is not found, the given extensions will be added to the file name and search for.
55
+ * The first that exists will be served. Example: ['html', 'htm'].
56
+ * The default value is false.
57
+ */
58
+ extensions?: string[] | false | undefined;
59
+
60
+ /**
61
+ * Let client errors fall-through as unhandled requests, otherwise forward a client error.
62
+ * The default value is true.
63
+ */
64
+ fallthrough?: boolean | undefined;
65
+
66
+ /**
67
+ * Enable or disable the immutable directive in the Cache-Control response header.
68
+ * If enabled, the maxAge option should also be specified to enable caching. The immutable directive will prevent supported clients from making conditional requests during the life of the maxAge option to check if the file has changed.
69
+ */
70
+ immutable?: boolean | undefined;
71
+
72
+ /**
73
+ * By default this module will send "index.html" files in response to a request on a directory.
74
+ * To disable this set false or to supply a new index pass a string or an array in preferred order.
75
+ */
76
+ index?: boolean | string | string[] | undefined;
77
+
78
+ /**
79
+ * Enable or disable Last-Modified header, defaults to true. Uses the file system's last modified value.
80
+ */
81
+ lastModified?: boolean | undefined;
82
+
83
+ /**
84
+ * Provide a max-age in milliseconds for http caching, defaults to 0. This can also be a string accepted by the ms module.
85
+ */
86
+ maxAge?: number | string | undefined;
87
+
88
+ /**
89
+ * Redirect to trailing "/" when the pathname is a dir. Defaults to true.
90
+ */
91
+ redirect?: boolean | undefined;
92
+
93
+ /**
94
+ * Function to set custom headers on response. Alterations to the headers need to occur synchronously.
95
+ * The function is called as fn(res, path, stat), where the arguments are:
96
+ * res the response object
97
+ * path the file path that is being sent
98
+ * stat the stat object of the file that is being sent
99
+ */
100
+ setHeaders?: ((res: R, path: string, stat: any) => any) | undefined;
101
+ }
102
+
103
+ interface RequestHandler<R extends http.ServerResponse> {
104
+ (request: http.IncomingMessage, response: R, next: () => void): any;
105
+ }
106
+
107
+ interface RequestHandlerConstructor<R extends http.ServerResponse> {
108
+ (root: string, options?: ServeStaticOptions<R>): RequestHandler<R>;
109
+ mime: typeof m;
110
+ }
111
+ }
112
+
113
+ export = serveStatic;
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "@types/serve-static",
3
+ "version": "1.15.1",
4
+ "description": "TypeScript definitions for serve-static",
5
+ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/serve-static",
6
+ "license": "MIT",
7
+ "contributors": [
8
+ {
9
+ "name": "Uros Smolnik",
10
+ "url": "https://github.com/urossmolnik",
11
+ "githubUsername": "urossmolnik"
12
+ },
13
+ {
14
+ "name": "Linus Unnebäck",
15
+ "url": "https://github.com/LinusU",
16
+ "githubUsername": "LinusU"
17
+ },
18
+ {
19
+ "name": "Devansh Jethmalani",
20
+ "url": "https://github.com/devanshj",
21
+ "githubUsername": "devanshj"
22
+ }
23
+ ],
24
+ "main": "",
25
+ "types": "index.d.ts",
26
+ "repository": {
27
+ "type": "git",
28
+ "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
29
+ "directory": "types/serve-static"
30
+ },
31
+ "scripts": {},
32
+ "dependencies": {
33
+ "@types/mime": "*",
34
+ "@types/node": "*"
35
+ },
36
+ "typesPublisherContentHash": "a5245bfbae31bb734209d348df3855b5fae08859f07b3de412d264f25a0b0232",
37
+ "typeScriptVersion": "4.2"
38
+ }
@@ -42,5 +42,10 @@
42
42
  "host": "localhost",
43
43
  "port": "6379",
44
44
  "db": 0
45
+ },
46
+ "jwt" : {
47
+ "secret": "shhhhhhared-secret",
48
+ "algorithms": ["HS256"],
49
+ "ignore": ["/first", "/second/testSession"]
45
50
  }
46
51
  }
@@ -23,4 +23,10 @@ export default class CustomLog extends LogFactory {
23
23
  public error(message?: any, ...optionalParams: any[]) : void {
24
24
  this.logger.error(message, ...optionalParams);
25
25
  }
26
+
27
+ public debug(message?: any, ...optionalParams: any[]) : void {
28
+ if(process.env.NODE_ENV === "development"){
29
+ this.logger.debug(message, ...optionalParams);
30
+ }
31
+ }
26
32
  }
@@ -0,0 +1,29 @@
1
+ import { AuthenticationFactory, bean, config } from "../../";
2
+ import express from "express";
3
+ import { expressjwt, GetVerificationKey } from "express-jwt";
4
+ import * as jwt from 'jsonwebtoken';
5
+
6
+ const jwtConfig: {
7
+ secret: jwt.Secret | GetVerificationKey;
8
+ algorithms: jwt.Algorithm[];
9
+ ignore: string[];
10
+ } = config("jwt");
11
+
12
+ export default class JwtAuthentication extends AuthenticationFactory {
13
+
14
+ //@bean
15
+ public getJwtAuthentication(): AuthenticationFactory {
16
+ return new JwtAuthentication();
17
+ }
18
+
19
+ public preHandle(req: express.Request, res: express.Response, next: express.NextFunction): void {
20
+ if(!jwtConfig.ignore.includes(req.path)) {
21
+ const jwtMiddleware = expressjwt(jwtConfig);
22
+ jwtMiddleware(req, res, (err) => {
23
+ if (err) {
24
+ next(err);
25
+ }
26
+ });
27
+ }
28
+ }
29
+ }
@@ -0,0 +1,36 @@
1
+ import { component, getMapping, postMapping, log } from "../../";
2
+ import { req, res, reqQuery, reqBody, reqForm, reqParam } from "../../src/route.decorator";
3
+
4
+
5
+ @component
6
+ export default class TestRequest {
7
+
8
+ @getMapping("/request/res")
9
+ testRes(@req req, @res res) {
10
+ res.send("test res");
11
+ }
12
+
13
+ @getMapping("/request/query")
14
+ testQuery(req, res, @reqQuery("id") id: number) {
15
+ log("id: " + id);
16
+ res.send("test query");
17
+ }
18
+
19
+ @postMapping("/request/body")
20
+ testBody(@res res, @reqBody body: object) {
21
+ log("body: " + JSON.stringify(body));
22
+ res.send("test body");
23
+ }
24
+
25
+ @postMapping("/request/form")
26
+ testForm(@res res, @reqForm("name") name: string) {
27
+ log("form: " + JSON.stringify(name));
28
+ res.send("test form");
29
+ }
30
+
31
+ @getMapping("/request/param/:id")
32
+ testParam(@res res, @reqParam("id") id: number) {
33
+ log("id: " + id);
34
+ res.send("test param");
35
+ }
36
+ }
@@ -1,17 +0,0 @@
1
- name: Node.js CI
2
-
3
- on: [push]
4
-
5
- jobs:
6
- build:
7
- runs-on: ubuntu-latest
8
- strategy:
9
- matrix:
10
- node-version: [12.x, 14.x, 16.x, 18.x]
11
- steps:
12
- - uses: actions/checkout@v2
13
- - uses: actions/setup-node@v2
14
- with:
15
- node-version: ${{ matrix.node-version }}
16
- - run: npm ci
17
- - run: npm test
@@ -1,30 +0,0 @@
1
- name: Node.js Publish
2
-
3
- on:
4
- release:
5
- types: [created]
6
-
7
- jobs:
8
- build:
9
- runs-on: ubuntu-latest
10
- steps:
11
- - uses: actions/checkout@v2
12
- - uses: actions/setup-node@v2
13
- with:
14
- node-version: "16.x"
15
- - run: npm ci
16
- - run: npm test
17
-
18
- publish-npm:
19
- needs: build
20
- runs-on: ubuntu-latest
21
- steps:
22
- - uses: actions/checkout@v2
23
- - uses: actions/setup-node@v2
24
- with:
25
- node-version: "16.x"
26
- registry-url: https://registry.npmjs.org/
27
- - run: npm ci
28
- - run: npm publish --access public
29
- env:
30
- NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
@@ -1,6 +0,0 @@
1
- bitsyntax-js copyright (c) 2012-2014
2
- Michael Bridgen <mikeb@squaremobius.net>
3
-
4
- This package, "bitsyntax-js", is licensed under the MIT License. A
5
- copy may be found in the file LICENSE-MIT in this directory, or
6
- downloaded from http://opensource.org/licenses/MIT.
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2012-2014 Michael Bridgen <mikeb@squaremobius.net>
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
@@ -1,15 +0,0 @@
1
- .PHONY: test all
2
-
3
- GRAMMAR=lib/grammar.pegjs
4
- PEGJS=./node_modules/.bin/pegjs
5
-
6
- all: lib/parser.js
7
-
8
- lib/parser.js: $(PEGJS)
9
- $(PEGJS) $(GRAMMAR) $@
10
-
11
- $(PEGJS):
12
- npm install
13
-
14
- test: lib/parser.js
15
- ./node_modules/.bin/zUnit