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.
- package/LICENSE +21 -0
- package/README.md +47 -0
- package/bin/HxOverrides.d.ts +8 -0
- package/bin/HxOverrides.js +54 -0
- package/bin/Lambda.d.ts +86 -0
- package/bin/Lambda.js +141 -0
- package/bin/Map.d.ts +5 -0
- package/bin/Reflect.d.ts +19 -0
- package/bin/Reflect.js +41 -0
- package/bin/Std.d.ts +49 -0
- package/bin/Std.js +96 -0
- package/bin/StdTypes.d.ts +57 -0
- package/bin/StringTools.d.ts +23 -0
- package/bin/StringTools.js +36 -0
- package/bin/commander/AddHelpTextContext.d.ts +6 -0
- package/bin/commander/AddHelpTextPosition.d.ts +2 -0
- package/bin/commander/CommandOptions.d.ts +6 -0
- package/bin/commander/ErrorOptions.d.ts +11 -0
- package/bin/commander/ExecutableCommandOptions.d.ts +7 -0
- package/bin/commander/HelpContext.d.ts +4 -0
- package/bin/commander/HookEvent.d.ts +2 -0
- package/bin/commander/OptionValueSource.d.ts +2 -0
- package/bin/commander/OutputConfiguration.d.ts +8 -0
- package/bin/commander/ParseOptions.d.ts +4 -0
- package/bin/commander/ParseOptionsResult.d.ts +5 -0
- package/bin/genes/Register.d.ts +15 -0
- package/bin/genes/Register.js +107 -0
- package/bin/genes/util/EsMap.d.ts +12 -0
- package/bin/genes/util/EsMap.js +51 -0
- package/bin/haxe/Constraints.d.ts +8 -0
- package/bin/haxe/Constraints.js +5 -0
- package/bin/haxe/Exception.d.ts +66 -0
- package/bin/haxe/Exception.js +88 -0
- package/bin/haxe/NativeStackTrace.d.ts +7 -0
- package/bin/haxe/PosInfos.d.ts +19 -0
- package/bin/haxe/Rest.d.ts +2 -0
- package/bin/haxe/ValueException.d.ts +24 -0
- package/bin/haxe/ValueException.js +36 -0
- package/bin/haxe/crypto/Crc32.d.ts +12 -0
- package/bin/haxe/crypto/Crc32.js +40 -0
- package/bin/haxe/ds/List.d.ts +31 -0
- package/bin/haxe/ds/List.js +55 -0
- package/bin/haxe/ds/ObjectMap.d.ts +7 -0
- package/bin/haxe/ds/ObjectMap.js +25 -0
- package/bin/haxe/ds/StringMap.d.ts +6 -0
- package/bin/haxe/ds/StringMap.js +25 -0
- package/bin/haxe/exceptions/NotImplementedException.d.ts +10 -0
- package/bin/haxe/exceptions/NotImplementedException.js +27 -0
- package/bin/haxe/exceptions/PosException.d.ts +19 -0
- package/bin/haxe/exceptions/PosException.js +36 -0
- package/bin/haxe/extern/Rest.d.ts +11 -0
- package/bin/haxe/io/ArrayBufferView.d.ts +2 -0
- package/bin/haxe/io/Bytes.d.ts +19 -0
- package/bin/haxe/io/Bytes.js +78 -0
- package/bin/haxe/io/BytesBuffer.d.ts +19 -0
- package/bin/haxe/io/BytesBuffer.js +67 -0
- package/bin/haxe/io/BytesData.d.ts +2 -0
- package/bin/haxe/io/BytesOutput.d.ts +18 -0
- package/bin/haxe/io/BytesOutput.js +39 -0
- package/bin/haxe/io/Encoding.d.ts +20 -0
- package/bin/haxe/io/Encoding.js +20 -0
- package/bin/haxe/io/Error.d.ts +35 -0
- package/bin/haxe/io/Error.js +31 -0
- package/bin/haxe/io/Output.d.ts +63 -0
- package/bin/haxe/io/Output.js +126 -0
- package/bin/haxe/io/Path.d.ts +109 -0
- package/bin/haxe/io/Path.js +217 -0
- package/bin/haxe/io/UInt8Array.d.ts +2 -0
- package/bin/haxe/iterators/ArrayIterator.d.ts +19 -0
- package/bin/haxe/iterators/ArrayIterator.js +35 -0
- package/bin/haxe/macro/Expr.d.ts +331 -0
- package/bin/haxe/macro/Type.d.ts +609 -0
- package/bin/haxe/zip/Compress.d.ts +5 -0
- package/bin/haxe/zip/Compress.js +21 -0
- package/bin/haxe/zip/Entry.d.ts +27 -0
- package/bin/haxe/zip/Entry.js +15 -0
- package/bin/haxe/zip/Tools.d.ts +5 -0
- package/bin/haxe/zip/Tools.js +24 -0
- package/bin/haxe/zip/Writer.d.ts +22 -0
- package/bin/haxe/zip/Writer.js +149 -0
- package/bin/js/Boot.d.ts +18 -0
- package/bin/js/Boot.js +225 -0
- package/bin/js/Node.d.ts +6 -0
- package/bin/js/lib/ArrayBuffer.d.ts +4 -0
- package/bin/js/lib/ArrayBuffer.js +24 -0
- package/bin/js/lib/Iterator.d.ts +23 -0
- package/bin/js/lib/Map.d.ts +2 -0
- package/bin/js/lib/Object.d.ts +82 -0
- package/bin/js/lib/Promise.d.ts +10 -0
- package/bin/js/lib/intl/NumberFormat.d.ts +114 -0
- package/bin/js/node/Buffer.d.ts +3 -0
- package/bin/js/node/ChildProcess.d.ts +424 -0
- package/bin/js/node/Crypto.d.ts +21 -0
- package/bin/js/node/Dns.d.ts +57 -0
- package/bin/js/node/Fs.d.ts +308 -0
- package/bin/js/node/Http.d.ts +114 -0
- package/bin/js/node/Https.d.ts +330 -0
- package/bin/js/node/Iterator.d.ts +5 -0
- package/bin/js/node/Path.d.ts +44 -0
- package/bin/js/node/Process.d.ts +6 -0
- package/bin/js/node/Tls.d.ts +304 -0
- package/bin/js/node/Url.d.ts +126 -0
- package/bin/js/node/Util.d.ts +115 -0
- package/bin/js/node/Zlib.d.ts +29 -0
- package/bin/js/node/buffer/Buffer.d.ts +23 -0
- package/bin/js/node/buffer/Buffer.js +24 -0
- package/bin/js/node/child_process/ChildProcess.d.ts +11 -0
- package/bin/js/node/console/Console.d.ts +26 -0
- package/bin/js/node/http/Agent.d.ts +40 -0
- package/bin/js/node/http/ClientRequest.d.ts +10 -0
- package/bin/js/node/https/Agent.d.ts +50 -0
- package/bin/js/node/net/Server.d.ts +22 -0
- package/bin/js/node/net/Socket.d.ts +101 -0
- package/bin/js/node/stream/Duplex.d.ts +86 -0
- package/bin/js/node/stream/Readable.d.ts +41 -0
- package/bin/js/node/stream/Transform.d.ts +92 -0
- package/bin/js/node/stream/Writable.d.ts +57 -0
- package/bin/js/node/tls/SecureContext.d.ts +74 -0
- package/bin/js/node/tls/TLSSocket.d.ts +47 -0
- package/bin/ts/Undefined.d.ts +5 -0
- package/bin/whet/Log.d.ts +16 -0
- package/bin/whet/Log.js +106 -0
- package/bin/whet/Project.d.ts +33 -0
- package/bin/whet/Project.js +71 -0
- package/bin/whet/Source.d.ts +51 -0
- package/bin/whet/Source.js +136 -0
- package/bin/whet/SourceHash.d.ts +15 -0
- package/bin/whet/SourceHash.js +68 -0
- package/bin/whet/SourceId.d.ts +10 -0
- package/bin/whet/SourceId.js +74 -0
- package/bin/whet/Stone.d.ts +88 -0
- package/bin/whet/Stone.js +157 -0
- package/bin/whet/Utils.d.ts +16 -0
- package/bin/whet/Utils.js +72 -0
- package/bin/whet/Whet.d.ts +4 -0
- package/bin/whet/Whet.js +117 -0
- package/bin/whet/cache/BaseCache.d.ts +27 -0
- package/bin/whet/cache/BaseCache.js +210 -0
- package/bin/whet/cache/Cache.d.ts +72 -0
- package/bin/whet/cache/Cache.js +57 -0
- package/bin/whet/cache/CacheManager.d.ts +23 -0
- package/bin/whet/cache/CacheManager.js +103 -0
- package/bin/whet/cache/FileCache.d.ts +35 -0
- package/bin/whet/cache/FileCache.js +295 -0
- package/bin/whet/cache/MemoryCache.d.ts +12 -0
- package/bin/whet/cache/MemoryCache.js +58 -0
- package/bin/whet/magic/MaybeArray.d.ts +4 -0
- package/bin/whet/magic/MaybeArray.js +25 -0
- package/bin/whet/magic/RoutePathType.d.ts +9 -0
- package/bin/whet/magic/RoutePathType.js +48 -0
- package/bin/whet/magic/RouteType.d.ts +12 -0
- package/bin/whet/magic/RouteType.js +70 -0
- package/bin/whet/magic/StoneId.d.ts +5 -0
- package/bin/whet/magic/StoneId.js +32 -0
- package/bin/whet/route/Route.d.ts +15 -0
- package/bin/whet/route/Route.js +81 -0
- package/bin/whet/route/RouteResult.d.ts +22 -0
- package/bin/whet/route/RouteResult.js +25 -0
- package/bin/whet/route/Router.d.ts +33 -0
- package/bin/whet/route/Router.js +224 -0
- package/bin/whet/stones/Files.d.ts +28 -0
- package/bin/whet/stones/Files.js +86 -0
- package/bin/whet/stones/JsonStone.d.ts +33 -0
- package/bin/whet/stones/JsonStone.js +117 -0
- package/bin/whet/stones/RemoteFile.d.ts +28 -0
- package/bin/whet/stones/RemoteFile.js +71 -0
- package/bin/whet/stones/Server.d.ts +42 -0
- package/bin/whet/stones/Server.js +113 -0
- package/bin/whet/stones/Zip.d.ts +30 -0
- package/bin/whet/stones/Zip.js +111 -0
- package/bin/whet/stones/haxe/HaxeBuild.d.ts +34 -0
- package/bin/whet/stones/haxe/HaxeBuild.js +89 -0
- package/bin/whet/stones/haxe/Hxml.d.ts +102 -0
- package/bin/whet/stones/haxe/Hxml.js +348 -0
- package/bin/whet.d.ts +20 -0
- package/bin/whet.js +18 -0
- package/package.json +32 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
Options for `Readable` private constructor.
|
|
4
|
+
For stream implementors only, see node.js API documentation
|
|
5
|
+
*/
|
|
6
|
+
export type ReadableNewOptions = {
|
|
7
|
+
/**
|
|
8
|
+
Whether this stream should automatically call `.destroy()` on itself after ending.
|
|
9
|
+
Default: `false`.
|
|
10
|
+
*/
|
|
11
|
+
autoDestroy?: null | boolean,
|
|
12
|
+
/**
|
|
13
|
+
Implementation for the `stream._destroy()` method.
|
|
14
|
+
*/
|
|
15
|
+
destroy?: null | ((err: null | Error, callback: ((arg0: null | Error) => void)) => void),
|
|
16
|
+
/**
|
|
17
|
+
Whether or not the stream should emit `'close'` after it has been destroyed.
|
|
18
|
+
Default: `true`.
|
|
19
|
+
*/
|
|
20
|
+
emitClose?: null | boolean,
|
|
21
|
+
/**
|
|
22
|
+
If specified, then buffers will be decoded to strings using the specified encoding.
|
|
23
|
+
Default: `null`.
|
|
24
|
+
*/
|
|
25
|
+
encoding?: null | string,
|
|
26
|
+
/**
|
|
27
|
+
The maximum number of bytes to store in the internal buffer before ceasing to read from the underlying resource.
|
|
28
|
+
Default: `16384` (16kb), or `16` for `objectMode` streams.
|
|
29
|
+
*/
|
|
30
|
+
highWaterMark?: null | number,
|
|
31
|
+
/**
|
|
32
|
+
Whether this stream should behave as a stream of objects.
|
|
33
|
+
Meaning that `stream.read(n)` returns a single value instead of a `Buffer` of size `n`.
|
|
34
|
+
Default: `false`.
|
|
35
|
+
*/
|
|
36
|
+
objectMode?: null | boolean,
|
|
37
|
+
/**
|
|
38
|
+
Implementation for the `stream._read()` method.
|
|
39
|
+
*/
|
|
40
|
+
read?: null | ((size: number) => void)
|
|
41
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import {Chunk} from "./Writable"
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
@see https://nodejs.org/api/stream.html#stream_new_stream_transform_options
|
|
5
|
+
*/
|
|
6
|
+
export type TransformNewOptions = {
|
|
7
|
+
/**
|
|
8
|
+
If set to `false`, then the stream will automatically end the writable side when the readable side ends. Default: `true`.
|
|
9
|
+
*/
|
|
10
|
+
allowHalfOpen?: null | boolean,
|
|
11
|
+
/**
|
|
12
|
+
Whether this stream should automatically call `.destroy()` on itself after ending.
|
|
13
|
+
Default: `false`.
|
|
14
|
+
*/
|
|
15
|
+
autoDestroy?: null | boolean,
|
|
16
|
+
/**
|
|
17
|
+
`decodeStrings` <boolean> Whether to encode `string`s passed to stream.write() to `Buffer`s (with the encoding specified in the stream.write() call) before passing them to stream._write().
|
|
18
|
+
Other types of data are not converted (i.e. `Buffer`s are not decoded into `string`s). Setting to false will prevent strings from being converted.
|
|
19
|
+
Default: `true`.
|
|
20
|
+
*/
|
|
21
|
+
decodeStrings?: null | boolean,
|
|
22
|
+
/**
|
|
23
|
+
`defaultEncoding` <string> The default encoding that is used when no encoding is specified as an argument to stream.write().
|
|
24
|
+
Default: `'utf8'`.
|
|
25
|
+
*/
|
|
26
|
+
defaultEncoding?: null | string,
|
|
27
|
+
/**
|
|
28
|
+
Implementation for the `stream._destroy()` method.
|
|
29
|
+
*/
|
|
30
|
+
destroy?: null | ((err: null | Error, callback: ((arg0: null | Error) => void)) => void),
|
|
31
|
+
/**
|
|
32
|
+
Whether or not the stream should emit `'close'` after it has been destroyed.
|
|
33
|
+
Default: `true`.
|
|
34
|
+
*/
|
|
35
|
+
emitClose?: null | boolean,
|
|
36
|
+
/**
|
|
37
|
+
If specified, then buffers will be decoded to strings using the specified encoding.
|
|
38
|
+
Default: `null`.
|
|
39
|
+
*/
|
|
40
|
+
encoding?: null | string,
|
|
41
|
+
/**
|
|
42
|
+
`final` <Function> Implementation for the stream._final() method.
|
|
43
|
+
*/
|
|
44
|
+
final_?: null | ((error: null | Error) => void),
|
|
45
|
+
/**
|
|
46
|
+
Implementation for the `stream._flush()` method.
|
|
47
|
+
*/
|
|
48
|
+
flush?: null | ((arg0: null | Error) => void),
|
|
49
|
+
/**
|
|
50
|
+
The maximum number of bytes to store in the internal buffer before ceasing to read from the underlying resource.
|
|
51
|
+
Default: `16384` (16kb), or `16` for `objectMode` streams.
|
|
52
|
+
*/
|
|
53
|
+
highWaterMark?: null | number,
|
|
54
|
+
/**
|
|
55
|
+
Whether this stream should behave as a stream of objects.
|
|
56
|
+
Meaning that `stream.read(n)` returns a single value instead of a `Buffer` of size `n`.
|
|
57
|
+
Default: `false`.
|
|
58
|
+
*/
|
|
59
|
+
objectMode?: null | boolean,
|
|
60
|
+
/**
|
|
61
|
+
Implementation for the `stream._read()` method.
|
|
62
|
+
*/
|
|
63
|
+
read?: null | ((size: number) => void),
|
|
64
|
+
/**
|
|
65
|
+
Sets `highWaterMark` for the readable side of the stream. Has no effect if `highWaterMark` is provided.
|
|
66
|
+
*/
|
|
67
|
+
readableHighWaterMark?: null | number,
|
|
68
|
+
/**
|
|
69
|
+
Sets `objectMode` for readable side of the stream. Has no effect if `objectMode` is `true`. Default: `false`.
|
|
70
|
+
*/
|
|
71
|
+
readableObjectMode?: null | boolean,
|
|
72
|
+
/**
|
|
73
|
+
Implementation for the `stream._transform()` method.
|
|
74
|
+
*/
|
|
75
|
+
transform?: null | ((chunk: any, encoding: string, callback: ((error: null | Error, data: any) => void)) => void),
|
|
76
|
+
/**
|
|
77
|
+
Sets `highWaterMark` for the writable side of the stream. Has no effect if `highWaterMark` is provided.
|
|
78
|
+
*/
|
|
79
|
+
writableHighWaterMark?: null | number,
|
|
80
|
+
/**
|
|
81
|
+
Sets `objectMode` for writable side of the stream. Has no effect if `objectMode` is `true`. Default: `false`.
|
|
82
|
+
*/
|
|
83
|
+
writableObjectMode?: null | boolean,
|
|
84
|
+
/**
|
|
85
|
+
`write` <Function> Implementation for the stream._write() method.
|
|
86
|
+
*/
|
|
87
|
+
write?: null | ((chunk: any, encoding: string, callback: ((arg0: null | Error) => void)) => void),
|
|
88
|
+
/**
|
|
89
|
+
`writev` <Function> Implementation for the stream._writev() method.
|
|
90
|
+
*/
|
|
91
|
+
writev?: null | ((chunks: Chunk[], callback: ((arg0: null | Error) => void)) => void)
|
|
92
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
@see https://nodejs.org/api/stream.html#stream_constructor_new_stream_writable_options
|
|
4
|
+
*/
|
|
5
|
+
export type WritableNewOptions = {
|
|
6
|
+
/**
|
|
7
|
+
`autoDestroy` <boolean> Whether this stream should automatically call .destroy() on itself after ending. Default: false.
|
|
8
|
+
*/
|
|
9
|
+
autoDestroy?: null | boolean,
|
|
10
|
+
/**
|
|
11
|
+
`decodeStrings` <boolean> Whether to encode `string`s passed to stream.write() to `Buffer`s (with the encoding specified in the stream.write() call) before passing them to stream._write().
|
|
12
|
+
Other types of data are not converted (i.e. `Buffer`s are not decoded into `string`s). Setting to false will prevent strings from being converted.
|
|
13
|
+
Default: `true`.
|
|
14
|
+
*/
|
|
15
|
+
decodeStrings?: null | boolean,
|
|
16
|
+
/**
|
|
17
|
+
`defaultEncoding` <string> The default encoding that is used when no encoding is specified as an argument to stream.write().
|
|
18
|
+
Default: `'utf8'`.
|
|
19
|
+
*/
|
|
20
|
+
defaultEncoding?: null | string,
|
|
21
|
+
/**
|
|
22
|
+
`destroy` <Function> Implementation for the stream._destroy() method.
|
|
23
|
+
*/
|
|
24
|
+
destroy?: null | ((error: null | Error, callback: ((arg0: null | Error) => void)) => void),
|
|
25
|
+
/**
|
|
26
|
+
`emitClose` <boolean> Whether or not the stream should emit `'close'` after it has been destroyed.
|
|
27
|
+
Default: `true`.
|
|
28
|
+
*/
|
|
29
|
+
emitClose?: null | boolean,
|
|
30
|
+
/**
|
|
31
|
+
`final` <Function> Implementation for the stream._final() method.
|
|
32
|
+
*/
|
|
33
|
+
final_?: null | ((error: null | Error) => void),
|
|
34
|
+
/**
|
|
35
|
+
`highWaterMark` <number> Buffer level when stream.write() starts returning `false`. Default: `16384` (16kb), or 16 for `objectMode` streams.
|
|
36
|
+
*/
|
|
37
|
+
highWaterMark?: null | number,
|
|
38
|
+
/**
|
|
39
|
+
`objectMode` <boolean> Whether or not the stream.write(anyObj) is a valid operation. When set,
|
|
40
|
+
it becomes possible to write JavaScript values other than string, `Buffer` or `Uint8Array` if supported by the stream implementation.
|
|
41
|
+
Default: `false`.
|
|
42
|
+
*/
|
|
43
|
+
objectMode?: null | boolean,
|
|
44
|
+
/**
|
|
45
|
+
`write` <Function> Implementation for the stream._write() method.
|
|
46
|
+
*/
|
|
47
|
+
write?: null | ((chunk: any, encoding: string, callback: ((arg0: null | Error) => void)) => void),
|
|
48
|
+
/**
|
|
49
|
+
`writev` <Function> Implementation for the stream._writev() method.
|
|
50
|
+
*/
|
|
51
|
+
writev?: null | ((chunks: Chunk[], callback: ((arg0: null | Error) => void)) => void)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export type Chunk = {
|
|
55
|
+
chunk: any,
|
|
56
|
+
encoding: string
|
|
57
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import {Buffer} from "buffer"
|
|
2
|
+
|
|
3
|
+
export type SecureContextOptions = {
|
|
4
|
+
/**
|
|
5
|
+
trusted certificates in PEM format.
|
|
6
|
+
If this is omitted several well known "root" CAs will be used, like VeriSign.
|
|
7
|
+
These are used to authorize connections.
|
|
8
|
+
*/
|
|
9
|
+
ca?: null | string | Buffer[],
|
|
10
|
+
/**
|
|
11
|
+
certificate key of the server in PEM format.
|
|
12
|
+
*/
|
|
13
|
+
cert?: null | string | Buffer,
|
|
14
|
+
/**
|
|
15
|
+
ciphers to use or exclude.
|
|
16
|
+
|
|
17
|
+
To mitigate BEAST attacks it is recommended that you use this option in conjunction with the `honorCipherOrder`
|
|
18
|
+
option described below to prioritize the non-CBC cipher.
|
|
19
|
+
|
|
20
|
+
Defaults to AES128-GCM-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH.
|
|
21
|
+
|
|
22
|
+
Consult the OpenSSL cipher list format documentation for details on the format.
|
|
23
|
+
ECDH (Elliptic Curve Diffie-Hellman) ciphers are not yet supported.
|
|
24
|
+
*/
|
|
25
|
+
ciphers?: null | string,
|
|
26
|
+
/**
|
|
27
|
+
PEM encoded CRLs (Certificate Revocation List)
|
|
28
|
+
*/
|
|
29
|
+
crl?: null | string | string[],
|
|
30
|
+
/**
|
|
31
|
+
Diffie Hellman parameters, required for Perfect Forward Secrecy.
|
|
32
|
+
|
|
33
|
+
Use openssl dhparam to create it. Its key length should be greater than or equal to 1024 bits,
|
|
34
|
+
otherwise it throws an error. It is strongly recommended to use 2048 bits or more for stronger security.
|
|
35
|
+
If omitted or invalid, it is silently discarded and DHE ciphers won't be available.
|
|
36
|
+
*/
|
|
37
|
+
dhparam?: null | string | Buffer,
|
|
38
|
+
/**
|
|
39
|
+
named curve to use for ECDH key agreement or false to disable ECDH.
|
|
40
|
+
|
|
41
|
+
Defaults to prime256v1 (NIST P-256). Use `Crypto.getCurves` to obtain a list of available curve names.
|
|
42
|
+
On recent releases, openssl ecparam -list_curves will also display the name and description
|
|
43
|
+
of each available elliptic curve.
|
|
44
|
+
*/
|
|
45
|
+
ecdhCurve?: null | string,
|
|
46
|
+
/**
|
|
47
|
+
When choosing a cipher, use the server's preferences instead of the client preferences.
|
|
48
|
+
Default: true.
|
|
49
|
+
*/
|
|
50
|
+
honorCipherOrder?: null | boolean,
|
|
51
|
+
/**
|
|
52
|
+
private key of the server in PEM format.
|
|
53
|
+
*/
|
|
54
|
+
key?: null | string | Buffer,
|
|
55
|
+
/**
|
|
56
|
+
passphrase for the private key or pfx.
|
|
57
|
+
*/
|
|
58
|
+
passphrase?: null | string,
|
|
59
|
+
/**
|
|
60
|
+
private key, certificate and CA certs of the server in PFX or PKCS12 format.
|
|
61
|
+
*/
|
|
62
|
+
pfx?: null | string | Buffer,
|
|
63
|
+
/**
|
|
64
|
+
The SSL method to use, e.g. SSLv3_method to force SSL version 3.
|
|
65
|
+
The possible values depend on your installation of OpenSSL and are defined in the constant SSL_METHODS.
|
|
66
|
+
*/
|
|
67
|
+
secureProtocol?: null | string,
|
|
68
|
+
/**
|
|
69
|
+
opaque identifier for session resumption.
|
|
70
|
+
If `requestCert` is true, the default is MD5 hash value generated from command-line.
|
|
71
|
+
Otherwise, the default is not provided.
|
|
72
|
+
*/
|
|
73
|
+
sessionIdContext?: null | string
|
|
74
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import {Server} from "net"
|
|
2
|
+
import {Buffer} from "buffer"
|
|
3
|
+
|
|
4
|
+
export type TLSSocketOptions = {
|
|
5
|
+
/**
|
|
6
|
+
possible NPN protocols. (Protocols should be ordered by their priority).
|
|
7
|
+
*/
|
|
8
|
+
NPNProtocols?: null | string[] | Buffer,
|
|
9
|
+
/**
|
|
10
|
+
A function that will be called if client supports SNI TLS extension.
|
|
11
|
+
Two argument will be passed to it: `servername`, and `cb`.
|
|
12
|
+
SNICallback should invoke `cb(null, ctx)`, where `ctx` is a SecureContext instance.
|
|
13
|
+
(You can use tls.createSecureContext(...) to get proper `SecureContext`).
|
|
14
|
+
If `SNICallback` wasn't provided - default callback with high-level API will be used.
|
|
15
|
+
*/
|
|
16
|
+
SNICallback?: null | ((servername: string, cb: ((arg0: Error) => SecureContext)) => void),
|
|
17
|
+
/**
|
|
18
|
+
If true - TLS socket will be instantiated in server-mode
|
|
19
|
+
*/
|
|
20
|
+
isServer?: null | boolean,
|
|
21
|
+
/**
|
|
22
|
+
If true the server will reject any connection which is not authorized with the list of supplied CAs.
|
|
23
|
+
This option only has an effect if `requestCert` is true.
|
|
24
|
+
Default: false.
|
|
25
|
+
*/
|
|
26
|
+
rejectUnauthorized?: null | boolean,
|
|
27
|
+
/**
|
|
28
|
+
If true the server will request a certificate from clients that connect
|
|
29
|
+
and attempt to verify that certificate.
|
|
30
|
+
Default: false.
|
|
31
|
+
*/
|
|
32
|
+
requestCert?: null | boolean,
|
|
33
|
+
/**
|
|
34
|
+
If true - OCSP status request extension would be added to client hello,
|
|
35
|
+
and OCSPResponse event will be emitted on socket before establishing secure communication
|
|
36
|
+
*/
|
|
37
|
+
requestOCSP?: null | boolean,
|
|
38
|
+
/**
|
|
39
|
+
An optional TLS context object from `Tls.createSecureContext`
|
|
40
|
+
*/
|
|
41
|
+
secureContext?: null | SecureContext,
|
|
42
|
+
server?: null | Server,
|
|
43
|
+
/**
|
|
44
|
+
A Buffer instance, containing TLS session.
|
|
45
|
+
*/
|
|
46
|
+
session?: any
|
|
47
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
`Undefined` corresponds to `void` in TypeScript; in haxe `Void` cannot be used as a field type (only function return) so we must use `Any` instead. This alias serves as documentation that the type is `void` and therefore value is `undefined`
|
|
4
|
+
*/
|
|
5
|
+
export type Undefined = any
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
|
|
2
|
+
export declare class Log {
|
|
3
|
+
static trace(...args: any[]): void
|
|
4
|
+
static debug(...args: any[]): void
|
|
5
|
+
static info(...args: any[]): void
|
|
6
|
+
static warn(...args: any[]): void
|
|
7
|
+
static error(...args: any[]): void
|
|
8
|
+
static fatal(...args: any[]): void
|
|
9
|
+
static logLevel: number
|
|
10
|
+
protected static log(level: number, ...args: any[]): void
|
|
11
|
+
protected static replacer(key: any, val: any): any
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export declare class LogLevel {
|
|
15
|
+
static fromString(s: string): null | number
|
|
16
|
+
}
|
package/bin/whet/Log.js
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import {Register} from "../genes/Register.js"
|
|
2
|
+
import {Reflect as Reflect__1} from "../Reflect.js"
|
|
3
|
+
|
|
4
|
+
const $global = Register.$global
|
|
5
|
+
|
|
6
|
+
export const Log = Register.global("$hxClasses")["whet.Log"] =
|
|
7
|
+
class Log {
|
|
8
|
+
static trace(...args) {
|
|
9
|
+
Log.log(10, ...args);
|
|
10
|
+
}
|
|
11
|
+
static debug(...args) {
|
|
12
|
+
Log.log(20, ...args);
|
|
13
|
+
}
|
|
14
|
+
static info(...args) {
|
|
15
|
+
Log.log(30, ...args);
|
|
16
|
+
}
|
|
17
|
+
static warn(...args) {
|
|
18
|
+
Log.log(40, ...args);
|
|
19
|
+
}
|
|
20
|
+
static error(...args) {
|
|
21
|
+
Log.log(50, ...args);
|
|
22
|
+
}
|
|
23
|
+
static fatal(...args) {
|
|
24
|
+
Log.log(60, ...args);
|
|
25
|
+
}
|
|
26
|
+
static log(level, ...args) {
|
|
27
|
+
if (level >= Log.logLevel) {
|
|
28
|
+
var out = {"level": level, "time": Date.now(), "msg": null};
|
|
29
|
+
var _g_current = 0;
|
|
30
|
+
while (_g_current < args.length) {
|
|
31
|
+
var arg = args[_g_current++];
|
|
32
|
+
if (arg == null) {
|
|
33
|
+
continue;
|
|
34
|
+
};
|
|
35
|
+
if (typeof(arg) == "string") {
|
|
36
|
+
if (out["msg"] == null) {
|
|
37
|
+
out["msg"] = arg;
|
|
38
|
+
} else if (typeof(out["msg"]) == "string") {
|
|
39
|
+
out["msg"] = [out["msg"], arg];
|
|
40
|
+
} else {
|
|
41
|
+
out["msg"].push(arg);
|
|
42
|
+
};
|
|
43
|
+
} else {
|
|
44
|
+
var obj = arg;
|
|
45
|
+
var _g1_keys = Reflect__1.fields(obj);
|
|
46
|
+
var _g1_index = 0;
|
|
47
|
+
while (_g1_index < _g1_keys.length) {
|
|
48
|
+
var key = _g1_keys[_g1_index++];
|
|
49
|
+
out[key] = obj[key];
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
process.stdout.write(JSON.stringify(out, Log.replacer) + "\n");
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
static replacer(key, val) {
|
|
57
|
+
if (val != null && typeof(val.toString) == "function" && val.toString != Object.prototype.toString) {
|
|
58
|
+
return val.toString();
|
|
59
|
+
};
|
|
60
|
+
return val;
|
|
61
|
+
}
|
|
62
|
+
static get __name__() {
|
|
63
|
+
return "whet.Log"
|
|
64
|
+
}
|
|
65
|
+
get __class__() {
|
|
66
|
+
return Log
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
Log.logLevel = 30
|
|
72
|
+
export const LogLevel = Register.global("$hxClasses")["whet._Log.LogLevel"] =
|
|
73
|
+
class LogLevel {
|
|
74
|
+
static fromString(s) {
|
|
75
|
+
switch (s.toLowerCase()) {
|
|
76
|
+
case "debug":
|
|
77
|
+
return 20;
|
|
78
|
+
break
|
|
79
|
+
case "error":
|
|
80
|
+
return 50;
|
|
81
|
+
break
|
|
82
|
+
case "fatal":
|
|
83
|
+
return 60;
|
|
84
|
+
break
|
|
85
|
+
case "info":
|
|
86
|
+
return 30;
|
|
87
|
+
break
|
|
88
|
+
case "trace":
|
|
89
|
+
return 10;
|
|
90
|
+
break
|
|
91
|
+
case "warn":
|
|
92
|
+
return 40;
|
|
93
|
+
break
|
|
94
|
+
default:
|
|
95
|
+
return null;
|
|
96
|
+
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
static get __name__() {
|
|
100
|
+
return "whet._Log.LogLevel_Impl_"
|
|
101
|
+
}
|
|
102
|
+
get __class__() {
|
|
103
|
+
return LogLevel
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {CacheManager} from "./cache/CacheManager"
|
|
2
|
+
import {AnyStone} from "./Stone"
|
|
3
|
+
import {Option, Command} from "commander"
|
|
4
|
+
|
|
5
|
+
export declare class Project {
|
|
6
|
+
constructor(config: ProjectConfig)
|
|
7
|
+
name: string
|
|
8
|
+
id: string
|
|
9
|
+
description: string
|
|
10
|
+
rootDir: string
|
|
11
|
+
cache: CacheManager
|
|
12
|
+
onInit: (config: any) => Promise<any>
|
|
13
|
+
protected options: Option[]
|
|
14
|
+
addCommand(cmd: Command, stone?: null | AnyStone): void
|
|
15
|
+
toString(): string
|
|
16
|
+
protected static projects: Project[]
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export type ProjectConfig = {
|
|
20
|
+
cache?: null | CacheManager,
|
|
21
|
+
description?: null | string,
|
|
22
|
+
id?: null | string,
|
|
23
|
+
name: string,
|
|
24
|
+
/**
|
|
25
|
+
* Called before first command is executed, but after configuration was parsed.
|
|
26
|
+
*/
|
|
27
|
+
onInit?: null | ((config: any) => Promise<any>),
|
|
28
|
+
/**
|
|
29
|
+
* Array of Commander.js options this project supports.
|
|
30
|
+
*/
|
|
31
|
+
options?: null | Option[],
|
|
32
|
+
rootDir?: null | string
|
|
33
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import {CacheManager} from "./cache/CacheManager.js"
|
|
2
|
+
import {Whet_Fields_} from "./Whet.js"
|
|
3
|
+
import {Log} from "./Log.js"
|
|
4
|
+
import * as Path from "path"
|
|
5
|
+
import {Path as Path__1} from "../haxe/io/Path.js"
|
|
6
|
+
import {Register} from "../genes/Register.js"
|
|
7
|
+
import {StringTools} from "../StringTools.js"
|
|
8
|
+
import {HxOverrides} from "../HxOverrides.js"
|
|
9
|
+
|
|
10
|
+
const $global = Register.$global
|
|
11
|
+
|
|
12
|
+
export const Project = Register.global("$hxClasses")["whet.Project"] =
|
|
13
|
+
class Project extends Register.inherits() {
|
|
14
|
+
new(config) {
|
|
15
|
+
this.cache = null;
|
|
16
|
+
var this1 = ["Instantiating new Project."];
|
|
17
|
+
Log.log(20, ...this1);
|
|
18
|
+
if (config == null || config.name == null) {
|
|
19
|
+
throw new Error("Must supply config and a name.");
|
|
20
|
+
};
|
|
21
|
+
this.name = config.name;
|
|
22
|
+
if (config.id == null) {
|
|
23
|
+
this.id = StringTools.replace(config.name, " ", "-").toLowerCase();
|
|
24
|
+
} else {
|
|
25
|
+
this.id = config.id;
|
|
26
|
+
};
|
|
27
|
+
this.description = config.description;
|
|
28
|
+
this.options = (config.options == null) ? [] : config.options;
|
|
29
|
+
this.onInit = config.onInit;
|
|
30
|
+
if (config.rootDir == null) {
|
|
31
|
+
var oldValue = Error.prepareStackTrace;
|
|
32
|
+
Error.prepareStackTrace = function (_, stack) {
|
|
33
|
+
return stack;
|
|
34
|
+
};
|
|
35
|
+
var file = new Error().stack[3].getFileName();
|
|
36
|
+
Error.prepareStackTrace = oldValue;
|
|
37
|
+
file = StringTools.replace(file, "file:///", "");
|
|
38
|
+
var s = Path.relative(process.cwd(), file);
|
|
39
|
+
var norm = "/" + Path__1.normalize((s.charAt(0) == "/") ? HxOverrides.substr(s, 1, null) : s);
|
|
40
|
+
var s1 = Path__1.addTrailingSlash(Path__1.directory((s.lastIndexOf("/") == s.length - 1) ? Path__1.addTrailingSlash(norm) : norm));
|
|
41
|
+
var norm = "/" + Path__1.normalize((s1.charAt(0) == "/") ? HxOverrides.substr(s1, 1, null) : s1);
|
|
42
|
+
this.rootDir = (s1.lastIndexOf("/") == s1.length - 1) ? Path__1.addTrailingSlash(norm) : norm;
|
|
43
|
+
} else {
|
|
44
|
+
var s = config.rootDir;
|
|
45
|
+
var norm = "/" + Path__1.normalize((s.charAt(0) == "/") ? HxOverrides.substr(s, 1, null) : s);
|
|
46
|
+
this.rootDir = (s.lastIndexOf("/") == s.length - 1) ? Path__1.addTrailingSlash(norm) : norm;
|
|
47
|
+
};
|
|
48
|
+
this.cache = (config.cache == null) ? new CacheManager(this) : config.cache;
|
|
49
|
+
Project.projects.push(this);
|
|
50
|
+
var this1 = ["New project created.", {"project": this, "projectCount": Project.projects.length}];
|
|
51
|
+
Log.log(30, ...this1);
|
|
52
|
+
}
|
|
53
|
+
addCommand(cmd, stone) {
|
|
54
|
+
if (stone != null) {
|
|
55
|
+
cmd.alias(stone.id + "." + cmd.name());
|
|
56
|
+
};
|
|
57
|
+
Whet_Fields_.program.addCommand(cmd);
|
|
58
|
+
}
|
|
59
|
+
toString() {
|
|
60
|
+
return "" + this.name + "@" + this.rootDir;
|
|
61
|
+
}
|
|
62
|
+
static get __name__() {
|
|
63
|
+
return "whet.Project"
|
|
64
|
+
}
|
|
65
|
+
get __class__() {
|
|
66
|
+
return Project
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
Project.projects = []
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import {AnyStone} from "./Stone"
|
|
2
|
+
import {SourceHash} from "./SourceHash"
|
|
3
|
+
import {Buffer} from "buffer"
|
|
4
|
+
|
|
5
|
+
export declare class Source {
|
|
6
|
+
protected constructor(data: SourceData[], hash: SourceHash, origin: AnyStone, ctime: number)
|
|
7
|
+
data: SourceData[]
|
|
8
|
+
hash: SourceHash
|
|
9
|
+
origin: AnyStone
|
|
10
|
+
ctime: number
|
|
11
|
+
protected dirPath: string
|
|
12
|
+
tryDirPath(): null | string
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Returns a directory path where this source data is stored.
|
|
16
|
+
* If none exists yet, generates a usable path through cache.
|
|
17
|
+
*/
|
|
18
|
+
getDirPath(): string
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Returns first result if `id` is null, or one equals to it.
|
|
22
|
+
*/
|
|
23
|
+
get(id?: null | string): SourceData
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export declare class SourceData {
|
|
27
|
+
protected constructor(id: string, data: Buffer)
|
|
28
|
+
data: Buffer
|
|
29
|
+
id: string
|
|
30
|
+
hash: SourceHash
|
|
31
|
+
source: Source
|
|
32
|
+
protected filePathId: string
|
|
33
|
+
protected filePath: string
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
Same as `getFilePath` but relative to project, not CWD.
|
|
37
|
+
*/
|
|
38
|
+
getFilePathId(idOverride?: null | string): Promise<string>
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
Path to a file for this source, relative to CWD.
|
|
42
|
+
*/
|
|
43
|
+
getFilePath(idOverride?: null | string): Promise<string>
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* `path` is the actual cwd-relative path. `pathId` is the project-relative source Id.
|
|
47
|
+
*/
|
|
48
|
+
static fromFile(id: string, path: string, pathId: string): Promise<SourceData>
|
|
49
|
+
static fromString(id: string, s: string): SourceData
|
|
50
|
+
static fromBytes(id: string, data: Buffer): SourceData
|
|
51
|
+
}
|