0 | module Node.HTTPS.CreateServer
 1 |
 2 | import Node
 3 | import Node.HTTP.CreateServer as HTTP
 4 | import Node.Internal.Support
 5 | import public Node.Net.CreateServer as Net
 6 | import public Node.TLS.CreateServer as TLS
 7 | import public Node.TLS.CreateSecureContext as SecureContext
 8 |
 9 | public export
10 | Options : Type
11 | Options = HTTP.Options
12 |
13 | public export
14 | defaultOptions : HTTPS.CreateServer.Options
15 | defaultOptions = HTTP.defaultOptions
16 |
17 | namespace Command
18 |
19 |   public export
20 |   record Options where
21 |     constructor MkOptions
22 |     server: HTTPS.CreateServer.Options
23 |     context: SecureContext.Options
24 |     tls: TLS.Options
25 |     net: Net.Options
26 |
27 |   export
28 |   defaultOptions : HTTPS.CreateServer.Command.Options
29 |   defaultOptions = MkOptions
30 |     { server = HTTPS.CreateServer.defaultOptions
31 |     , context = defaultOptions
32 |     , tls = defaultOptions
33 |     , net = defaultOptions
34 |     }
35 |
36 |   %foreign """
37 |     node:lambda:
38 |     ( server
39 |     , secure
40 |     , tls
41 |     , net
42 |     ) => ({
43 |       ...net,
44 |       ...tls,
45 |       ...secure,
46 |       ...server
47 |     })
48 |     """
49 |   ffi_convertOptions :
50 |     Node HTTPS.CreateServer.Options
51 |     -> Node SecureContext.Options
52 |     -> Node TLS.Options
53 |     -> Node Net.Options
54 |     -> Node HTTPS.CreateServer.Command.Options
55 |
56 |   export
57 |   convertOptions : HTTPS.CreateServer.Command.Options -> Node HTTPS.CreateServer.Command.Options
58 |   convertOptions o = ffi_convertOptions
59 |     (convertOptions o.server)
60 |     (convertOptions o.context)
61 |     (convertOptions o.tls)
62 |     (convertOptions o.net)
63 |
64 |