whet 0.0.1

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 (177) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +47 -0
  3. package/bin/HxOverrides.d.ts +8 -0
  4. package/bin/HxOverrides.js +54 -0
  5. package/bin/Lambda.d.ts +86 -0
  6. package/bin/Lambda.js +141 -0
  7. package/bin/Map.d.ts +5 -0
  8. package/bin/Reflect.d.ts +19 -0
  9. package/bin/Reflect.js +41 -0
  10. package/bin/Std.d.ts +49 -0
  11. package/bin/Std.js +96 -0
  12. package/bin/StdTypes.d.ts +57 -0
  13. package/bin/StringTools.d.ts +23 -0
  14. package/bin/StringTools.js +36 -0
  15. package/bin/commander/AddHelpTextContext.d.ts +6 -0
  16. package/bin/commander/AddHelpTextPosition.d.ts +2 -0
  17. package/bin/commander/CommandOptions.d.ts +6 -0
  18. package/bin/commander/ErrorOptions.d.ts +11 -0
  19. package/bin/commander/ExecutableCommandOptions.d.ts +7 -0
  20. package/bin/commander/HelpContext.d.ts +4 -0
  21. package/bin/commander/HookEvent.d.ts +2 -0
  22. package/bin/commander/OptionValueSource.d.ts +2 -0
  23. package/bin/commander/OutputConfiguration.d.ts +8 -0
  24. package/bin/commander/ParseOptions.d.ts +4 -0
  25. package/bin/commander/ParseOptionsResult.d.ts +5 -0
  26. package/bin/genes/Register.d.ts +15 -0
  27. package/bin/genes/Register.js +107 -0
  28. package/bin/genes/util/EsMap.d.ts +12 -0
  29. package/bin/genes/util/EsMap.js +51 -0
  30. package/bin/haxe/Constraints.d.ts +8 -0
  31. package/bin/haxe/Constraints.js +5 -0
  32. package/bin/haxe/Exception.d.ts +66 -0
  33. package/bin/haxe/Exception.js +88 -0
  34. package/bin/haxe/NativeStackTrace.d.ts +7 -0
  35. package/bin/haxe/PosInfos.d.ts +19 -0
  36. package/bin/haxe/Rest.d.ts +2 -0
  37. package/bin/haxe/ValueException.d.ts +24 -0
  38. package/bin/haxe/ValueException.js +36 -0
  39. package/bin/haxe/crypto/Crc32.d.ts +12 -0
  40. package/bin/haxe/crypto/Crc32.js +40 -0
  41. package/bin/haxe/ds/List.d.ts +31 -0
  42. package/bin/haxe/ds/List.js +55 -0
  43. package/bin/haxe/ds/ObjectMap.d.ts +7 -0
  44. package/bin/haxe/ds/ObjectMap.js +25 -0
  45. package/bin/haxe/ds/StringMap.d.ts +6 -0
  46. package/bin/haxe/ds/StringMap.js +25 -0
  47. package/bin/haxe/exceptions/NotImplementedException.d.ts +10 -0
  48. package/bin/haxe/exceptions/NotImplementedException.js +27 -0
  49. package/bin/haxe/exceptions/PosException.d.ts +19 -0
  50. package/bin/haxe/exceptions/PosException.js +36 -0
  51. package/bin/haxe/extern/Rest.d.ts +11 -0
  52. package/bin/haxe/io/ArrayBufferView.d.ts +2 -0
  53. package/bin/haxe/io/Bytes.d.ts +19 -0
  54. package/bin/haxe/io/Bytes.js +78 -0
  55. package/bin/haxe/io/BytesBuffer.d.ts +19 -0
  56. package/bin/haxe/io/BytesBuffer.js +67 -0
  57. package/bin/haxe/io/BytesData.d.ts +2 -0
  58. package/bin/haxe/io/BytesOutput.d.ts +18 -0
  59. package/bin/haxe/io/BytesOutput.js +39 -0
  60. package/bin/haxe/io/Encoding.d.ts +20 -0
  61. package/bin/haxe/io/Encoding.js +20 -0
  62. package/bin/haxe/io/Error.d.ts +35 -0
  63. package/bin/haxe/io/Error.js +31 -0
  64. package/bin/haxe/io/Output.d.ts +63 -0
  65. package/bin/haxe/io/Output.js +126 -0
  66. package/bin/haxe/io/Path.d.ts +109 -0
  67. package/bin/haxe/io/Path.js +217 -0
  68. package/bin/haxe/io/UInt8Array.d.ts +2 -0
  69. package/bin/haxe/iterators/ArrayIterator.d.ts +19 -0
  70. package/bin/haxe/iterators/ArrayIterator.js +35 -0
  71. package/bin/haxe/macro/Expr.d.ts +331 -0
  72. package/bin/haxe/macro/Type.d.ts +609 -0
  73. package/bin/haxe/zip/Compress.d.ts +5 -0
  74. package/bin/haxe/zip/Compress.js +21 -0
  75. package/bin/haxe/zip/Entry.d.ts +27 -0
  76. package/bin/haxe/zip/Entry.js +15 -0
  77. package/bin/haxe/zip/Tools.d.ts +5 -0
  78. package/bin/haxe/zip/Tools.js +24 -0
  79. package/bin/haxe/zip/Writer.d.ts +22 -0
  80. package/bin/haxe/zip/Writer.js +149 -0
  81. package/bin/js/Boot.d.ts +18 -0
  82. package/bin/js/Boot.js +225 -0
  83. package/bin/js/Node.d.ts +6 -0
  84. package/bin/js/lib/ArrayBuffer.d.ts +4 -0
  85. package/bin/js/lib/ArrayBuffer.js +24 -0
  86. package/bin/js/lib/Iterator.d.ts +23 -0
  87. package/bin/js/lib/Map.d.ts +2 -0
  88. package/bin/js/lib/Object.d.ts +82 -0
  89. package/bin/js/lib/Promise.d.ts +10 -0
  90. package/bin/js/lib/intl/NumberFormat.d.ts +114 -0
  91. package/bin/js/node/Buffer.d.ts +3 -0
  92. package/bin/js/node/ChildProcess.d.ts +424 -0
  93. package/bin/js/node/Crypto.d.ts +21 -0
  94. package/bin/js/node/Dns.d.ts +57 -0
  95. package/bin/js/node/Fs.d.ts +308 -0
  96. package/bin/js/node/Http.d.ts +114 -0
  97. package/bin/js/node/Https.d.ts +330 -0
  98. package/bin/js/node/Iterator.d.ts +5 -0
  99. package/bin/js/node/Path.d.ts +44 -0
  100. package/bin/js/node/Process.d.ts +6 -0
  101. package/bin/js/node/Tls.d.ts +304 -0
  102. package/bin/js/node/Url.d.ts +126 -0
  103. package/bin/js/node/Util.d.ts +115 -0
  104. package/bin/js/node/Zlib.d.ts +29 -0
  105. package/bin/js/node/buffer/Buffer.d.ts +23 -0
  106. package/bin/js/node/buffer/Buffer.js +24 -0
  107. package/bin/js/node/child_process/ChildProcess.d.ts +11 -0
  108. package/bin/js/node/console/Console.d.ts +26 -0
  109. package/bin/js/node/http/Agent.d.ts +40 -0
  110. package/bin/js/node/http/ClientRequest.d.ts +10 -0
  111. package/bin/js/node/https/Agent.d.ts +50 -0
  112. package/bin/js/node/net/Server.d.ts +22 -0
  113. package/bin/js/node/net/Socket.d.ts +101 -0
  114. package/bin/js/node/stream/Duplex.d.ts +86 -0
  115. package/bin/js/node/stream/Readable.d.ts +41 -0
  116. package/bin/js/node/stream/Transform.d.ts +92 -0
  117. package/bin/js/node/stream/Writable.d.ts +57 -0
  118. package/bin/js/node/tls/SecureContext.d.ts +74 -0
  119. package/bin/js/node/tls/TLSSocket.d.ts +47 -0
  120. package/bin/ts/Undefined.d.ts +5 -0
  121. package/bin/whet/Log.d.ts +16 -0
  122. package/bin/whet/Log.js +106 -0
  123. package/bin/whet/Project.d.ts +33 -0
  124. package/bin/whet/Project.js +71 -0
  125. package/bin/whet/Source.d.ts +51 -0
  126. package/bin/whet/Source.js +136 -0
  127. package/bin/whet/SourceHash.d.ts +15 -0
  128. package/bin/whet/SourceHash.js +68 -0
  129. package/bin/whet/SourceId.d.ts +10 -0
  130. package/bin/whet/SourceId.js +74 -0
  131. package/bin/whet/Stone.d.ts +88 -0
  132. package/bin/whet/Stone.js +157 -0
  133. package/bin/whet/Utils.d.ts +16 -0
  134. package/bin/whet/Utils.js +72 -0
  135. package/bin/whet/Whet.d.ts +4 -0
  136. package/bin/whet/Whet.js +117 -0
  137. package/bin/whet/cache/BaseCache.d.ts +27 -0
  138. package/bin/whet/cache/BaseCache.js +210 -0
  139. package/bin/whet/cache/Cache.d.ts +72 -0
  140. package/bin/whet/cache/Cache.js +57 -0
  141. package/bin/whet/cache/CacheManager.d.ts +23 -0
  142. package/bin/whet/cache/CacheManager.js +103 -0
  143. package/bin/whet/cache/FileCache.d.ts +35 -0
  144. package/bin/whet/cache/FileCache.js +295 -0
  145. package/bin/whet/cache/MemoryCache.d.ts +12 -0
  146. package/bin/whet/cache/MemoryCache.js +58 -0
  147. package/bin/whet/magic/MaybeArray.d.ts +4 -0
  148. package/bin/whet/magic/MaybeArray.js +25 -0
  149. package/bin/whet/magic/RoutePathType.d.ts +9 -0
  150. package/bin/whet/magic/RoutePathType.js +48 -0
  151. package/bin/whet/magic/RouteType.d.ts +12 -0
  152. package/bin/whet/magic/RouteType.js +70 -0
  153. package/bin/whet/magic/StoneId.d.ts +5 -0
  154. package/bin/whet/magic/StoneId.js +32 -0
  155. package/bin/whet/route/Route.d.ts +15 -0
  156. package/bin/whet/route/Route.js +81 -0
  157. package/bin/whet/route/RouteResult.d.ts +22 -0
  158. package/bin/whet/route/RouteResult.js +25 -0
  159. package/bin/whet/route/Router.d.ts +33 -0
  160. package/bin/whet/route/Router.js +224 -0
  161. package/bin/whet/stones/Files.d.ts +28 -0
  162. package/bin/whet/stones/Files.js +86 -0
  163. package/bin/whet/stones/JsonStone.d.ts +33 -0
  164. package/bin/whet/stones/JsonStone.js +117 -0
  165. package/bin/whet/stones/RemoteFile.d.ts +28 -0
  166. package/bin/whet/stones/RemoteFile.js +71 -0
  167. package/bin/whet/stones/Server.d.ts +42 -0
  168. package/bin/whet/stones/Server.js +113 -0
  169. package/bin/whet/stones/Zip.d.ts +30 -0
  170. package/bin/whet/stones/Zip.js +111 -0
  171. package/bin/whet/stones/haxe/HaxeBuild.d.ts +34 -0
  172. package/bin/whet/stones/haxe/HaxeBuild.js +89 -0
  173. package/bin/whet/stones/haxe/Hxml.d.ts +102 -0
  174. package/bin/whet/stones/haxe/Hxml.js +348 -0
  175. package/bin/whet.d.ts +20 -0
  176. package/bin/whet.js +18 -0
  177. package/package.json +32 -0
@@ -0,0 +1,330 @@
1
+ import {Socket} from "net"
2
+ import {SocketConnectOptionsTcp} from "./net/Socket"
3
+ import {Agent} from "http"
4
+ import {Buffer} from "buffer"
5
+
6
+ export type HttpsCreateServerOptions = {
7
+ /**
8
+ Specifies the `IncomingMessage` class to be used. Useful for extending the original `IncomingMessage`.
9
+
10
+ Default: `js.node.http.IncomingMessage`.
11
+ */
12
+ IncomingMessage?: null | any,
13
+ /**
14
+ possible NPN protocols. (Protocols should be ordered by their priority).
15
+ */
16
+ NPNProtocols?: null | string[] | Buffer,
17
+ /**
18
+ A function that will be called if client supports SNI TLS extension.
19
+ Two argument will be passed to it: `servername`, and `cb`.
20
+ SNICallback should invoke `cb(null, ctx)`, where `ctx` is a SecureContext instance.
21
+ (You can use tls.createSecureContext(...) to get proper `SecureContext`).
22
+ If `SNICallback` wasn't provided - default callback with high-level API will be used.
23
+ */
24
+ SNICallback?: null | ((servername: string, cb: ((arg0: Error) => SecureContext)) => void),
25
+ /**
26
+ Specifies the `ServerResponse` class to be used. Useful for extending the original `ServerResponse`.
27
+
28
+ Default: `ServerResponse`.
29
+ */
30
+ ServerResponse?: null | any,
31
+ /**
32
+ trusted certificates in PEM format.
33
+ If this is omitted several well known "root" CAs will be used, like VeriSign.
34
+ These are used to authorize connections.
35
+ */
36
+ ca?: null | string | Buffer[],
37
+ /**
38
+ certificate key of the server in PEM format.
39
+ */
40
+ cert?: null | string | Buffer,
41
+ /**
42
+ ciphers to use or exclude.
43
+
44
+ To mitigate BEAST attacks it is recommended that you use this option in conjunction with the `honorCipherOrder`
45
+ option described below to prioritize the non-CBC cipher.
46
+
47
+ Defaults to AES128-GCM-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH.
48
+
49
+ Consult the OpenSSL cipher list format documentation for details on the format.
50
+ ECDH (Elliptic Curve Diffie-Hellman) ciphers are not yet supported.
51
+ */
52
+ ciphers?: null | string,
53
+ /**
54
+ PEM encoded CRLs (Certificate Revocation List)
55
+ */
56
+ crl?: null | string | string[],
57
+ /**
58
+ Diffie Hellman parameters, required for Perfect Forward Secrecy.
59
+
60
+ Use openssl dhparam to create it. Its key length should be greater than or equal to 1024 bits,
61
+ otherwise it throws an error. It is strongly recommended to use 2048 bits or more for stronger security.
62
+ If omitted or invalid, it is silently discarded and DHE ciphers won't be available.
63
+ */
64
+ dhparam?: null | string | Buffer,
65
+ /**
66
+ named curve to use for ECDH key agreement or false to disable ECDH.
67
+
68
+ Defaults to prime256v1 (NIST P-256). Use `Crypto.getCurves` to obtain a list of available curve names.
69
+ On recent releases, openssl ecparam -list_curves will also display the name and description
70
+ of each available elliptic curve.
71
+ */
72
+ ecdhCurve?: null | string,
73
+ /**
74
+ Abort the connection if the SSL/TLS handshake does not finish in this many milliseconds.
75
+ The default is 120 seconds.
76
+ A 'clientError' is emitted on the `tls.Server` object whenever a handshake times out.
77
+ */
78
+ handshakeTimeout?: null | number,
79
+ /**
80
+ When choosing a cipher, use the server's preferences instead of the client preferences.
81
+ Default: true.
82
+ */
83
+ honorCipherOrder?: null | boolean,
84
+ /**
85
+ private key of the server in PEM format.
86
+ */
87
+ key?: null | string | Buffer,
88
+ /**
89
+ passphrase for the private key or pfx.
90
+ */
91
+ passphrase?: null | string,
92
+ /**
93
+ private key, certificate and CA certs of the server in PFX or PKCS12 format.
94
+ */
95
+ pfx?: null | string | Buffer,
96
+ /**
97
+ If true the server will reject any connection which is not authorized with the list of supplied CAs.
98
+ This option only has an effect if `requestCert` is true.
99
+ Default: false.
100
+ */
101
+ rejectUnauthorized?: null | boolean,
102
+ /**
103
+ If true the server will request a certificate from clients that connect
104
+ and attempt to verify that certificate.
105
+ Default: false.
106
+ */
107
+ requestCert?: null | boolean,
108
+ /**
109
+ The SSL method to use, e.g. SSLv3_method to force SSL version 3.
110
+ The possible values depend on your installation of OpenSSL and are defined in the constant SSL_METHODS.
111
+ */
112
+ secureProtocol?: null | string,
113
+ /**
114
+ opaque identifier for session resumption.
115
+ If `requestCert` is true, the default is MD5 hash value generated from command-line.
116
+ Otherwise, the default is not provided.
117
+ */
118
+ sessionIdContext?: null | string,
119
+ /**
120
+ An integer specifying the seconds after which TLS session identifiers
121
+ and TLS session tickets created by the server are timed out.
122
+ See SSL_CTX_set_timeout for more details.
123
+ */
124
+ sessionTimeout?: null | number,
125
+ /**
126
+ A 48-byte `Buffer` instance consisting of 16-byte prefix, 16-byte hmac key, 16-byte AES key.
127
+ You could use it to accept tls session tickets on multiple instances of tls server.
128
+
129
+ NOTE: Automatically shared between cluster module workers.
130
+ */
131
+ ticketKeys?: any
132
+ }
133
+
134
+ export type HttpsRequestOptions = {
135
+ /**
136
+ possible NPN protocols. (Protocols should be ordered by their priority).
137
+ */
138
+ NPNProtocols?: null | string[] | Buffer,
139
+ /**
140
+ Controls Agent behavior.
141
+
142
+ Possible values:
143
+
144
+ - `undefined` (default): use http.globalAgent for this host and port.
145
+ - `Agent` object: explicitly use the passed in `Agent`.
146
+ - `false` : causes a new `Agent` with default values to be used.
147
+ */
148
+ agent?: null | Agent | boolean,
149
+ /**
150
+ Basic authentication i.e. `'user:password'` to compute an Authorization header.
151
+ */
152
+ auth?: null | string,
153
+ /**
154
+ trusted certificates in PEM format.
155
+ If this is omitted several well known "root" CAs will be used, like VeriSign.
156
+ These are used to authorize connections.
157
+ */
158
+ ca?: null | string | Buffer[],
159
+ /**
160
+ certificate key of the server in PEM format.
161
+ */
162
+ cert?: null | string | Buffer,
163
+ /**
164
+ An override for checking server's hostname against the certificate.
165
+ Should return an error if verification fails. Return `js.Lib.undefined` if passing.
166
+ */
167
+ checkServerIdentity?: null | ((arg0: string, arg1: {
168
+ }) => any),
169
+ /**
170
+ ciphers to use or exclude.
171
+
172
+ To mitigate BEAST attacks it is recommended that you use this option in conjunction with the `honorCipherOrder`
173
+ option described below to prioritize the non-CBC cipher.
174
+
175
+ Defaults to AES128-GCM-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH.
176
+
177
+ Consult the OpenSSL cipher list format documentation for details on the format.
178
+ ECDH (Elliptic Curve Diffie-Hellman) ciphers are not yet supported.
179
+ */
180
+ ciphers?: null | string,
181
+ /**
182
+ A function that produces a socket/stream to use for the request when the `agent` option is not used.
183
+ This can be used to avoid creating a custom `Agent` class just to override the default `createConnection` function.
184
+ See [agent.createConnection()](https://nodejs.org/api/http.html#http_agent_createconnection_options_callback) for more details.
185
+ Any `Duplex` stream is a valid return value.
186
+ */
187
+ createConnection?: null | ((options: SocketConnectOptionsTcp, callabck?: ((err: Error, stream: IDuplex) => void)) => IDuplex),
188
+ /**
189
+ PEM encoded CRLs (Certificate Revocation List)
190
+ */
191
+ crl?: null | string | string[],
192
+ /**
193
+ Default port for the protocol.
194
+
195
+ Default: `agent.defaultPort` if an Agent is used, else `undefined`.
196
+ */
197
+ defaultPort?: null | number,
198
+ /**
199
+ Diffie Hellman parameters, required for Perfect Forward Secrecy.
200
+
201
+ Use openssl dhparam to create it. Its key length should be greater than or equal to 1024 bits,
202
+ otherwise it throws an error. It is strongly recommended to use 2048 bits or more for stronger security.
203
+ If omitted or invalid, it is silently discarded and DHE ciphers won't be available.
204
+ */
205
+ dhparam?: null | string | Buffer,
206
+ /**
207
+ named curve to use for ECDH key agreement or false to disable ECDH.
208
+
209
+ Defaults to prime256v1 (NIST P-256). Use `Crypto.getCurves` to obtain a list of available curve names.
210
+ On recent releases, openssl ecparam -list_curves will also display the name and description
211
+ of each available elliptic curve.
212
+ */
213
+ ecdhCurve?: null | string,
214
+ /**
215
+ IP address family to use when resolving `host` or `hostname`.
216
+ Valid values are `4` or `6`. When unspecified, both IP v4 and v6 will be used.
217
+ */
218
+ family?: null | number,
219
+ /**
220
+ An object containing request headers.
221
+ */
222
+ headers?: null | {[key: string]: string | string[]},
223
+ /**
224
+ When choosing a cipher, use the server's preferences instead of the client preferences.
225
+ Default: true.
226
+ */
227
+ honorCipherOrder?: null | boolean,
228
+ /**
229
+ A domain name or IP address of the server to issue the request to.
230
+
231
+ Default: `'localhost'`.
232
+ */
233
+ host?: null | string,
234
+ /**
235
+ Alias for `host`.
236
+ To support `url.parse()`, hostname will be used if both `host` and `hostname` are specified.
237
+ */
238
+ hostname?: null | string,
239
+ /**
240
+ private key of the server in PEM format.
241
+ */
242
+ key?: null | string | Buffer,
243
+ /**
244
+ Local interface to bind for network connections.
245
+ */
246
+ localAddress?: null | string,
247
+ /**
248
+ A string specifying the HTTP request method.
249
+
250
+ Default: `'GET'`.
251
+ */
252
+ method?: null | string,
253
+ /**
254
+ passphrase for the private key or pfx.
255
+ */
256
+ passphrase?: null | string,
257
+ /**
258
+ Request path. Should include query string if any. E.G. `'/index.html?page=12'`.
259
+ An exception is thrown when the request path contains illegal characters.
260
+ Currently, only spaces are rejected but that may change in the future.
261
+
262
+ Default: `'/'`.
263
+ */
264
+ path?: null | string,
265
+ /**
266
+ private key, certificate and CA certs of the server in PFX or PKCS12 format.
267
+ */
268
+ pfx?: null | string | Buffer,
269
+ /**
270
+ Port of remote server.
271
+
272
+ Default: `defaultPort` if set, else `80`.
273
+ */
274
+ port?: null | number,
275
+ /**
276
+ Protocol to use.
277
+
278
+ Default: `'http:'`.
279
+ */
280
+ protocol?: null | string,
281
+ /**
282
+ If true the server will reject any connection which is not authorized with the list of supplied CAs.
283
+ This option only has an effect if `requestCert` is true.
284
+ Default: false.
285
+ */
286
+ rejectUnauthorized?: null | boolean,
287
+ /**
288
+ If true - OCSP status request extension would be added to client hello,
289
+ and OCSPResponse event will be emitted on socket before establishing secure communication
290
+ */
291
+ requestOCSP?: null | boolean,
292
+ /**
293
+ The SSL method to use, e.g. SSLv3_method to force SSL version 3.
294
+ The possible values depend on your installation of OpenSSL and are defined in the constant SSL_METHODS.
295
+ */
296
+ secureProtocol?: null | string,
297
+ /**
298
+ Servername for SNI (Server Name Indication) TLS extension.
299
+ */
300
+ servername?: null | string,
301
+ /**
302
+ A Buffer instance, containing TLS session.
303
+ */
304
+ session?: any,
305
+ /**
306
+ opaque identifier for session resumption.
307
+ If `requestCert` is true, the default is MD5 hash value generated from command-line.
308
+ Otherwise, the default is not provided.
309
+ */
310
+ sessionIdContext?: null | string,
311
+ /**
312
+ Specifies whether or not to automatically add the Host header.
313
+ Defaults to `true`.
314
+ */
315
+ setHost?: null | boolean,
316
+ /**
317
+ Establish secure connection on a given socket rather than creating a new socket.
318
+ If this option is specified, `host` and `port` are ignored.
319
+ */
320
+ socket?: null | Socket,
321
+ /**
322
+ Unix Domain Socket (cannot be used if one of host or port is specified, those specify a TCP Socket).
323
+ */
324
+ socketPath?: null | string,
325
+ /**
326
+ A number specifying the socket timeout in milliseconds.
327
+ This will set the timeout before the socket is connected.
328
+ */
329
+ timeout?: null | number
330
+ }
@@ -0,0 +1,5 @@
1
+ import {Iterator as Iterator__1, IteratorStep as IteratorStep__1} from "../lib/Iterator"
2
+
3
+ export type Iterator<T> = Iterator__1<T>
4
+
5
+ export type IteratorStep<T> = IteratorStep__1<T>
@@ -0,0 +1,44 @@
1
+ import {Rest} from "../../haxe/extern/Rest"
2
+
3
+ /**
4
+ Path object returned from `Path.parse` and taken by `Path.format`.
5
+
6
+ @see https://nodejs.org/api/path.html#path_path_format_pathobject
7
+ */
8
+ export type PathObject = {
9
+ /**
10
+ E.g. "index.html" for "C:\path\dir\index.html"
11
+ */
12
+ base: string,
13
+ /**
14
+ E.g. "C:\path\dir" for "C:\path\dir\index.html"
15
+ */
16
+ dir: string,
17
+ /**
18
+ E.g. ".html" for "C:\path\dir\index.html"
19
+ */
20
+ ext: string,
21
+ /**
22
+ E.g. "index" for "C:\path\dir\index.html"
23
+ */
24
+ name: string,
25
+ /**
26
+ E.g. "C:\" for "C:\path\dir\index.html"
27
+ */
28
+ root: string
29
+ }
30
+
31
+ export type PathModule = {
32
+ basename: (path: string, ext?: string) => string,
33
+ delimiter: string,
34
+ dirname: (path: string) => string,
35
+ extname: (path: string) => string,
36
+ format: (pathObject: PathObject) => string,
37
+ isAbsolute: (path: string) => boolean,
38
+ join: (...paths: Rest<string>) => string,
39
+ normalize: (path: string) => string,
40
+ parse: (pathString: string) => PathObject,
41
+ relative: (from: string, to: string) => string,
42
+ resolve: (...paths: Rest<string>) => string,
43
+ sep: string
44
+ }
@@ -0,0 +1,6 @@
1
+
2
+ export type MemoryUsage = {
3
+ heapTotal: number,
4
+ heapUsed: number,
5
+ rss: number
6
+ }
@@ -0,0 +1,304 @@
1
+ import {Socket} from "net"
2
+ import {Buffer} from "buffer"
3
+
4
+ export type TlsOptionsBase = {
5
+ /**
6
+ possible NPN protocols. (Protocols should be ordered by their priority).
7
+ */
8
+ NPNProtocols?: null | string[] | Buffer,
9
+ /**
10
+ If true the server will reject any connection which is not authorized with the list of supplied CAs.
11
+ This option only has an effect if `requestCert` is true.
12
+ Default: false.
13
+ */
14
+ rejectUnauthorized?: null | boolean
15
+ }
16
+
17
+ export type TlsServerOptionsBase = {
18
+ /**
19
+ possible NPN protocols. (Protocols should be ordered by their priority).
20
+ */
21
+ NPNProtocols?: null | string[] | Buffer,
22
+ /**
23
+ A function that will be called if client supports SNI TLS extension.
24
+ Two argument will be passed to it: `servername`, and `cb`.
25
+ SNICallback should invoke `cb(null, ctx)`, where `ctx` is a SecureContext instance.
26
+ (You can use tls.createSecureContext(...) to get proper `SecureContext`).
27
+ If `SNICallback` wasn't provided - default callback with high-level API will be used.
28
+ */
29
+ SNICallback?: null | ((servername: string, cb: ((arg0: Error) => SecureContext)) => void),
30
+ /**
31
+ If true the server will reject any connection which is not authorized with the list of supplied CAs.
32
+ This option only has an effect if `requestCert` is true.
33
+ Default: false.
34
+ */
35
+ rejectUnauthorized?: null | boolean,
36
+ /**
37
+ If true the server will request a certificate from clients that connect
38
+ and attempt to verify that certificate.
39
+ Default: false.
40
+ */
41
+ requestCert?: null | boolean
42
+ }
43
+
44
+ export type TlsClientOptionsBase = {
45
+ /**
46
+ possible NPN protocols. (Protocols should be ordered by their priority).
47
+ */
48
+ NPNProtocols?: null | string[] | Buffer,
49
+ /**
50
+ If true the server will reject any connection which is not authorized with the list of supplied CAs.
51
+ This option only has an effect if `requestCert` is true.
52
+ Default: false.
53
+ */
54
+ rejectUnauthorized?: null | boolean,
55
+ /**
56
+ If true - OCSP status request extension would be added to client hello,
57
+ and OCSPResponse event will be emitted on socket before establishing secure communication
58
+ */
59
+ requestOCSP?: null | boolean,
60
+ /**
61
+ A Buffer instance, containing TLS session.
62
+ */
63
+ session?: any
64
+ }
65
+
66
+ /**
67
+ Base structure for options object used in tls methods.
68
+ */
69
+ export type TlsCreateServerOptions = {
70
+ /**
71
+ possible NPN protocols. (Protocols should be ordered by their priority).
72
+ */
73
+ NPNProtocols?: null | string[] | Buffer,
74
+ /**
75
+ A function that will be called if client supports SNI TLS extension.
76
+ Two argument will be passed to it: `servername`, and `cb`.
77
+ SNICallback should invoke `cb(null, ctx)`, where `ctx` is a SecureContext instance.
78
+ (You can use tls.createSecureContext(...) to get proper `SecureContext`).
79
+ If `SNICallback` wasn't provided - default callback with high-level API will be used.
80
+ */
81
+ SNICallback?: null | ((servername: string, cb: ((arg0: Error) => SecureContext)) => void),
82
+ /**
83
+ trusted certificates in PEM format.
84
+ If this is omitted several well known "root" CAs will be used, like VeriSign.
85
+ These are used to authorize connections.
86
+ */
87
+ ca?: null | string | Buffer[],
88
+ /**
89
+ certificate key of the server in PEM format.
90
+ */
91
+ cert?: null | string | Buffer,
92
+ /**
93
+ ciphers to use or exclude.
94
+
95
+ To mitigate BEAST attacks it is recommended that you use this option in conjunction with the `honorCipherOrder`
96
+ option described below to prioritize the non-CBC cipher.
97
+
98
+ Defaults to AES128-GCM-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH.
99
+
100
+ Consult the OpenSSL cipher list format documentation for details on the format.
101
+ ECDH (Elliptic Curve Diffie-Hellman) ciphers are not yet supported.
102
+ */
103
+ ciphers?: null | string,
104
+ /**
105
+ PEM encoded CRLs (Certificate Revocation List)
106
+ */
107
+ crl?: null | string | string[],
108
+ /**
109
+ Diffie Hellman parameters, required for Perfect Forward Secrecy.
110
+
111
+ Use openssl dhparam to create it. Its key length should be greater than or equal to 1024 bits,
112
+ otherwise it throws an error. It is strongly recommended to use 2048 bits or more for stronger security.
113
+ If omitted or invalid, it is silently discarded and DHE ciphers won't be available.
114
+ */
115
+ dhparam?: null | string | Buffer,
116
+ /**
117
+ named curve to use for ECDH key agreement or false to disable ECDH.
118
+
119
+ Defaults to prime256v1 (NIST P-256). Use `Crypto.getCurves` to obtain a list of available curve names.
120
+ On recent releases, openssl ecparam -list_curves will also display the name and description
121
+ of each available elliptic curve.
122
+ */
123
+ ecdhCurve?: null | string,
124
+ /**
125
+ Abort the connection if the SSL/TLS handshake does not finish in this many milliseconds.
126
+ The default is 120 seconds.
127
+ A 'clientError' is emitted on the `tls.Server` object whenever a handshake times out.
128
+ */
129
+ handshakeTimeout?: null | number,
130
+ /**
131
+ When choosing a cipher, use the server's preferences instead of the client preferences.
132
+ Default: true.
133
+ */
134
+ honorCipherOrder?: null | boolean,
135
+ /**
136
+ private key of the server in PEM format.
137
+ */
138
+ key?: null | string | Buffer,
139
+ /**
140
+ passphrase for the private key or pfx.
141
+ */
142
+ passphrase?: null | string,
143
+ /**
144
+ private key, certificate and CA certs of the server in PFX or PKCS12 format.
145
+ */
146
+ pfx?: null | string | Buffer,
147
+ /**
148
+ If true the server will reject any connection which is not authorized with the list of supplied CAs.
149
+ This option only has an effect if `requestCert` is true.
150
+ Default: false.
151
+ */
152
+ rejectUnauthorized?: null | boolean,
153
+ /**
154
+ If true the server will request a certificate from clients that connect
155
+ and attempt to verify that certificate.
156
+ Default: false.
157
+ */
158
+ requestCert?: null | boolean,
159
+ /**
160
+ The SSL method to use, e.g. SSLv3_method to force SSL version 3.
161
+ The possible values depend on your installation of OpenSSL and are defined in the constant SSL_METHODS.
162
+ */
163
+ secureProtocol?: null | string,
164
+ /**
165
+ opaque identifier for session resumption.
166
+ If `requestCert` is true, the default is MD5 hash value generated from command-line.
167
+ Otherwise, the default is not provided.
168
+ */
169
+ sessionIdContext?: null | string,
170
+ /**
171
+ An integer specifying the seconds after which TLS session identifiers
172
+ and TLS session tickets created by the server are timed out.
173
+ See SSL_CTX_set_timeout for more details.
174
+ */
175
+ sessionTimeout?: null | number,
176
+ /**
177
+ A 48-byte `Buffer` instance consisting of 16-byte prefix, 16-byte hmac key, 16-byte AES key.
178
+ You could use it to accept tls session tickets on multiple instances of tls server.
179
+
180
+ NOTE: Automatically shared between cluster module workers.
181
+ */
182
+ ticketKeys?: any
183
+ }
184
+
185
+ export type TlsConnectOptions = {
186
+ /**
187
+ possible NPN protocols. (Protocols should be ordered by their priority).
188
+ */
189
+ NPNProtocols?: null | string[] | Buffer,
190
+ /**
191
+ trusted certificates in PEM format.
192
+ If this is omitted several well known "root" CAs will be used, like VeriSign.
193
+ These are used to authorize connections.
194
+ */
195
+ ca?: null | string | Buffer[],
196
+ /**
197
+ certificate key of the server in PEM format.
198
+ */
199
+ cert?: null | string | Buffer,
200
+ /**
201
+ An override for checking server's hostname against the certificate.
202
+ Should return an error if verification fails. Return `js.Lib.undefined` if passing.
203
+ */
204
+ checkServerIdentity?: null | ((arg0: string, arg1: {
205
+ }) => any),
206
+ /**
207
+ ciphers to use or exclude.
208
+
209
+ To mitigate BEAST attacks it is recommended that you use this option in conjunction with the `honorCipherOrder`
210
+ option described below to prioritize the non-CBC cipher.
211
+
212
+ Defaults to AES128-GCM-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH.
213
+
214
+ Consult the OpenSSL cipher list format documentation for details on the format.
215
+ ECDH (Elliptic Curve Diffie-Hellman) ciphers are not yet supported.
216
+ */
217
+ ciphers?: null | string,
218
+ /**
219
+ PEM encoded CRLs (Certificate Revocation List)
220
+ */
221
+ crl?: null | string | string[],
222
+ /**
223
+ Diffie Hellman parameters, required for Perfect Forward Secrecy.
224
+
225
+ Use openssl dhparam to create it. Its key length should be greater than or equal to 1024 bits,
226
+ otherwise it throws an error. It is strongly recommended to use 2048 bits or more for stronger security.
227
+ If omitted or invalid, it is silently discarded and DHE ciphers won't be available.
228
+ */
229
+ dhparam?: null | string | Buffer,
230
+ /**
231
+ named curve to use for ECDH key agreement or false to disable ECDH.
232
+
233
+ Defaults to prime256v1 (NIST P-256). Use `Crypto.getCurves` to obtain a list of available curve names.
234
+ On recent releases, openssl ecparam -list_curves will also display the name and description
235
+ of each available elliptic curve.
236
+ */
237
+ ecdhCurve?: null | string,
238
+ /**
239
+ When choosing a cipher, use the server's preferences instead of the client preferences.
240
+ Default: true.
241
+ */
242
+ honorCipherOrder?: null | boolean,
243
+ /**
244
+ Host the client should connect to.
245
+ Defaults to 'localhost'
246
+ */
247
+ host?: null | string,
248
+ /**
249
+ private key of the server in PEM format.
250
+ */
251
+ key?: null | string | Buffer,
252
+ /**
253
+ passphrase for the private key or pfx.
254
+ */
255
+ passphrase?: null | string,
256
+ /**
257
+ Creates unix socket connection to path.
258
+ If this option is specified, host and port are ignored.
259
+ */
260
+ path?: null | string,
261
+ /**
262
+ private key, certificate and CA certs of the server in PFX or PKCS12 format.
263
+ */
264
+ pfx?: null | string | Buffer,
265
+ /**
266
+ Port the client should connect to
267
+ */
268
+ port?: null | number,
269
+ /**
270
+ If true the server will reject any connection which is not authorized with the list of supplied CAs.
271
+ This option only has an effect if `requestCert` is true.
272
+ Default: false.
273
+ */
274
+ rejectUnauthorized?: null | boolean,
275
+ /**
276
+ If true - OCSP status request extension would be added to client hello,
277
+ and OCSPResponse event will be emitted on socket before establishing secure communication
278
+ */
279
+ requestOCSP?: null | boolean,
280
+ /**
281
+ The SSL method to use, e.g. SSLv3_method to force SSL version 3.
282
+ The possible values depend on your installation of OpenSSL and are defined in the constant SSL_METHODS.
283
+ */
284
+ secureProtocol?: null | string,
285
+ /**
286
+ Servername for SNI (Server Name Indication) TLS extension.
287
+ */
288
+ servername?: null | string,
289
+ /**
290
+ A Buffer instance, containing TLS session.
291
+ */
292
+ session?: any,
293
+ /**
294
+ opaque identifier for session resumption.
295
+ If `requestCert` is true, the default is MD5 hash value generated from command-line.
296
+ Otherwise, the default is not provided.
297
+ */
298
+ sessionIdContext?: null | string,
299
+ /**
300
+ Establish secure connection on a given socket rather than creating a new socket.
301
+ If this option is specified, `host` and `port` are ignored.
302
+ */
303
+ socket?: null | Socket
304
+ }