@fncts/http 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (211) hide show
  1. package/Body/api.d.ts +63 -0
  2. package/Body/definition.d.ts +53 -0
  3. package/Body.d.ts +2 -0
  4. package/BodyError.d.ts +30 -0
  5. package/Headers.d.ts +42 -0
  6. package/HttpApp.d.ts +46 -0
  7. package/IncomingMessage/api.d.ts +19 -0
  8. package/IncomingMessage/definition.d.ts +21 -0
  9. package/IncomingMessage.d.ts +2 -0
  10. package/Method.d.ts +2 -0
  11. package/Middleware.d.ts +24 -0
  12. package/QueryParams.d.ts +7 -0
  13. package/RequestError.d.ts +10 -0
  14. package/ResponseError.d.ts +14 -0
  15. package/Route/api.d.ts +37 -0
  16. package/Route/definition.d.ts +35 -0
  17. package/Route/internal.d.ts +17 -0
  18. package/Route.d.ts +2 -0
  19. package/RouteNotFound.d.ts +8 -0
  20. package/Router/api.d.ts +96 -0
  21. package/Router/definition.d.ts +28 -0
  22. package/Router/internal.d.ts +26 -0
  23. package/Router.d.ts +2 -0
  24. package/Server.d.ts +53 -0
  25. package/ServerError.d.ts +9 -0
  26. package/ServerRequest/api.d.ts +6 -0
  27. package/ServerRequest/definition.d.ts +30 -0
  28. package/ServerRequest/internal.d.ts +33 -0
  29. package/ServerRequest.d.ts +2 -0
  30. package/ServerResponse/api.d.ts +69 -0
  31. package/ServerResponse/definition.d.ts +30 -0
  32. package/ServerResponse.d.ts +2 -0
  33. package/Socket.d.ts +107 -0
  34. package/UrlParams.d.ts +21 -0
  35. package/_cjs/Body/api.cjs +93 -0
  36. package/_cjs/Body/api.cjs.map +1 -0
  37. package/_cjs/Body/definition.cjs +71 -0
  38. package/_cjs/Body/definition.cjs.map +1 -0
  39. package/_cjs/Body.cjs +28 -0
  40. package/_cjs/Body.cjs.map +1 -0
  41. package/_cjs/BodyError.cjs +43 -0
  42. package/_cjs/BodyError.cjs.map +1 -0
  43. package/_cjs/Headers.cjs +87 -0
  44. package/_cjs/Headers.cjs.map +1 -0
  45. package/_cjs/HttpApp.cjs +109 -0
  46. package/_cjs/HttpApp.cjs.map +1 -0
  47. package/_cjs/IncomingMessage/api.cjs +35 -0
  48. package/_cjs/IncomingMessage/api.cjs.map +1 -0
  49. package/_cjs/IncomingMessage/definition.cjs +20 -0
  50. package/_cjs/IncomingMessage/definition.cjs.map +1 -0
  51. package/_cjs/IncomingMessage.cjs +28 -0
  52. package/_cjs/IncomingMessage.cjs.map +1 -0
  53. package/_cjs/Method.cjs +10 -0
  54. package/_cjs/Method.cjs.map +1 -0
  55. package/_cjs/Middleware.cjs +16 -0
  56. package/_cjs/Middleware.cjs.map +1 -0
  57. package/_cjs/QueryParams.cjs +6 -0
  58. package/_cjs/QueryParams.cjs.map +1 -0
  59. package/_cjs/RequestError.cjs +19 -0
  60. package/_cjs/RequestError.cjs.map +1 -0
  61. package/_cjs/ResponseError.cjs +27 -0
  62. package/_cjs/ResponseError.cjs.map +1 -0
  63. package/_cjs/Route/api.cjs +61 -0
  64. package/_cjs/Route/api.cjs.map +1 -0
  65. package/_cjs/Route/definition.cjs +35 -0
  66. package/_cjs/Route/definition.cjs.map +1 -0
  67. package/_cjs/Route/internal.cjs +31 -0
  68. package/_cjs/Route/internal.cjs.map +1 -0
  69. package/_cjs/Route.cjs +28 -0
  70. package/_cjs/Route.cjs.map +1 -0
  71. package/_cjs/RouteNotFound.cjs +18 -0
  72. package/_cjs/RouteNotFound.cjs.map +1 -0
  73. package/_cjs/Router/api.cjs +141 -0
  74. package/_cjs/Router/api.cjs.map +1 -0
  75. package/_cjs/Router/definition.cjs +22 -0
  76. package/_cjs/Router/definition.cjs.map +1 -0
  77. package/_cjs/Router/internal.cjs +85 -0
  78. package/_cjs/Router/internal.cjs.map +1 -0
  79. package/_cjs/Router.cjs +28 -0
  80. package/_cjs/Router.cjs.map +1 -0
  81. package/_cjs/Server.cjs +53 -0
  82. package/_cjs/Server.cjs.map +1 -0
  83. package/_cjs/ServerError.cjs +21 -0
  84. package/_cjs/ServerError.cjs.map +1 -0
  85. package/_cjs/ServerRequest/api.cjs +14 -0
  86. package/_cjs/ServerRequest/api.cjs.map +1 -0
  87. package/_cjs/ServerRequest/definition.cjs +29 -0
  88. package/_cjs/ServerRequest/definition.cjs.map +1 -0
  89. package/_cjs/ServerRequest/internal.cjs +77 -0
  90. package/_cjs/ServerRequest/internal.cjs.map +1 -0
  91. package/_cjs/ServerRequest.cjs +28 -0
  92. package/_cjs/ServerRequest.cjs.map +1 -0
  93. package/_cjs/ServerResponse/api.cjs +157 -0
  94. package/_cjs/ServerResponse/api.cjs.map +1 -0
  95. package/_cjs/ServerResponse/definition.cjs +44 -0
  96. package/_cjs/ServerResponse/definition.cjs.map +1 -0
  97. package/_cjs/ServerResponse.cjs +28 -0
  98. package/_cjs/ServerResponse.cjs.map +1 -0
  99. package/_cjs/Socket.cjs +221 -0
  100. package/_cjs/Socket.cjs.map +1 -0
  101. package/_cjs/UrlParams.cjs +34 -0
  102. package/_cjs/UrlParams.cjs.map +1 -0
  103. package/_cjs/global.cjs +6 -0
  104. package/_cjs/global.cjs.map +1 -0
  105. package/_mjs/Body/api.mjs +78 -0
  106. package/_mjs/Body/api.mjs.map +1 -0
  107. package/_mjs/Body/definition.mjs +58 -0
  108. package/_mjs/Body/definition.mjs.map +1 -0
  109. package/_mjs/Body.mjs +5 -0
  110. package/_mjs/Body.mjs.map +1 -0
  111. package/_mjs/BodyError.mjs +33 -0
  112. package/_mjs/BodyError.mjs.map +1 -0
  113. package/_mjs/Headers.mjs +75 -0
  114. package/_mjs/Headers.mjs.map +1 -0
  115. package/_mjs/HttpApp.mjs +96 -0
  116. package/_mjs/HttpApp.mjs.map +1 -0
  117. package/_mjs/IncomingMessage/api.mjs +25 -0
  118. package/_mjs/IncomingMessage/api.mjs.map +1 -0
  119. package/_mjs/IncomingMessage/definition.mjs +13 -0
  120. package/_mjs/IncomingMessage/definition.mjs.map +1 -0
  121. package/_mjs/IncomingMessage.mjs +5 -0
  122. package/_mjs/IncomingMessage.mjs.map +1 -0
  123. package/_mjs/Method.mjs +4 -0
  124. package/_mjs/Method.mjs.map +1 -0
  125. package/_mjs/Middleware.mjs +9 -0
  126. package/_mjs/Middleware.mjs.map +1 -0
  127. package/_mjs/QueryParams.mjs +2 -0
  128. package/_mjs/QueryParams.mjs.map +1 -0
  129. package/_mjs/RequestError.mjs +12 -0
  130. package/_mjs/RequestError.mjs.map +1 -0
  131. package/_mjs/ResponseError.mjs +20 -0
  132. package/_mjs/ResponseError.mjs.map +1 -0
  133. package/_mjs/Route/api.mjs +48 -0
  134. package/_mjs/Route/api.mjs.map +1 -0
  135. package/_mjs/Route/definition.mjs +25 -0
  136. package/_mjs/Route/definition.mjs.map +1 -0
  137. package/_mjs/Route/internal.mjs +21 -0
  138. package/_mjs/Route/internal.mjs.map +1 -0
  139. package/_mjs/Route.mjs +5 -0
  140. package/_mjs/Route.mjs.map +1 -0
  141. package/_mjs/RouteNotFound.mjs +11 -0
  142. package/_mjs/RouteNotFound.mjs.map +1 -0
  143. package/_mjs/Router/api.mjs +123 -0
  144. package/_mjs/Router/api.mjs.map +1 -0
  145. package/_mjs/Router/definition.mjs +15 -0
  146. package/_mjs/Router/definition.mjs.map +1 -0
  147. package/_mjs/Router/internal.mjs +76 -0
  148. package/_mjs/Router/internal.mjs.map +1 -0
  149. package/_mjs/Router.mjs +5 -0
  150. package/_mjs/Router.mjs.map +1 -0
  151. package/_mjs/Server.mjs +41 -0
  152. package/_mjs/Server.mjs.map +1 -0
  153. package/_mjs/ServerError.mjs +14 -0
  154. package/_mjs/ServerError.mjs.map +1 -0
  155. package/_mjs/ServerRequest/api.mjs +8 -0
  156. package/_mjs/ServerRequest/api.mjs.map +1 -0
  157. package/_mjs/ServerRequest/definition.mjs +20 -0
  158. package/_mjs/ServerRequest/definition.mjs.map +1 -0
  159. package/_mjs/ServerRequest/internal.mjs +68 -0
  160. package/_mjs/ServerRequest/internal.mjs.map +1 -0
  161. package/_mjs/ServerRequest.mjs +5 -0
  162. package/_mjs/ServerRequest.mjs.map +1 -0
  163. package/_mjs/ServerResponse/api.mjs +138 -0
  164. package/_mjs/ServerResponse/api.mjs.map +1 -0
  165. package/_mjs/ServerResponse/definition.mjs +34 -0
  166. package/_mjs/ServerResponse/definition.mjs.map +1 -0
  167. package/_mjs/ServerResponse.mjs +5 -0
  168. package/_mjs/ServerResponse.mjs.map +1 -0
  169. package/_mjs/Socket.mjs +202 -0
  170. package/_mjs/Socket.mjs.map +1 -0
  171. package/_mjs/UrlParams.mjs +25 -0
  172. package/_mjs/UrlParams.mjs.map +1 -0
  173. package/_mjs/global.mjs +2 -0
  174. package/_mjs/global.mjs.map +1 -0
  175. package/_src/Body/api.ts +106 -0
  176. package/_src/Body/definition.ts +74 -0
  177. package/_src/Body.ts +5 -0
  178. package/_src/BodyError.ts +38 -0
  179. package/_src/Headers.ts +84 -0
  180. package/_src/HttpApp.ts +129 -0
  181. package/_src/IncomingMessage/api.ts +25 -0
  182. package/_src/IncomingMessage/definition.ts +20 -0
  183. package/_src/IncomingMessage.ts +5 -0
  184. package/_src/Method.ts +5 -0
  185. package/_src/Middleware.ts +29 -0
  186. package/_src/QueryParams.ts +7 -0
  187. package/_src/RequestError.ts +13 -0
  188. package/_src/ResponseError.ts +25 -0
  189. package/_src/Route/api.ts +53 -0
  190. package/_src/Route/definition.ts +40 -0
  191. package/_src/Route/internal.ts +25 -0
  192. package/_src/Route.ts +5 -0
  193. package/_src/RouteNotFound.ts +14 -0
  194. package/_src/Router/api.ts +161 -0
  195. package/_src/Router/definition.ts +29 -0
  196. package/_src/Router/internal.ts +95 -0
  197. package/_src/Router.ts +5 -0
  198. package/_src/Server.ts +88 -0
  199. package/_src/ServerError.ts +14 -0
  200. package/_src/ServerRequest/api.ts +10 -0
  201. package/_src/ServerRequest/definition.ts +33 -0
  202. package/_src/ServerRequest/internal.ts +106 -0
  203. package/_src/ServerRequest.ts +5 -0
  204. package/_src/ServerResponse/api.ts +177 -0
  205. package/_src/ServerResponse/definition.ts +51 -0
  206. package/_src/ServerResponse.ts +5 -0
  207. package/_src/Socket.ts +294 -0
  208. package/_src/UrlParams.ts +28 -0
  209. package/_src/global.ts +2 -0
  210. package/global.d.ts +1 -0
  211. package/package.json +27 -0
package/Server.d.ts ADDED
@@ -0,0 +1,53 @@
1
+ import { IO } from "@fncts/io/IO";
2
+ import { Scope } from "@fncts/io/Scope/definition";
3
+ import { Layer } from "@fncts/io/Layer";
4
+ import type { HttpApp } from "@fncts/http/HttpApp";
5
+ import type { Middleware } from "@fncts/http/Middleware";
6
+ import type { ServerRequest } from "@fncts/http/ServerRequest";
7
+ export declare const ServerTypeId: unique symbol;
8
+ export type ServerTypeId = typeof ServerTypeId;
9
+ /**
10
+ * @tsplus type fncts.http.Server
11
+ * @tsplus companion fncts.http.ServerOps
12
+ */
13
+ export declare abstract class Server {
14
+ readonly [ServerTypeId]: ServerTypeId;
15
+ abstract serve<R, E>(httpApp: HttpApp.Default<R, E>): IO<Exclude<R, ServerRequest> | Scope, never, void>;
16
+ abstract serve<R, E, App extends HttpApp.Default<any, any>>(httpApp: HttpApp.Default<R, E>, middleware: Middleware.Applied<R, E, App>): IO<Exclude<R, ServerRequest> | Scope, never, void>;
17
+ abstract readonly address: Address;
18
+ }
19
+ /**
20
+ * @tsplus static fncts.http.ServerOps Tag
21
+ * @tsplus location "@fncts/http/Server"
22
+ */
23
+ export declare const ServerTag: import("@fncts/base/data/Tag").Tag<Server, Server>;
24
+ export type Address = TcpAddress | UnixAddress;
25
+ export interface TcpAddress {
26
+ readonly _tag: "TcpAddress";
27
+ readonly hostname: string;
28
+ readonly port: number;
29
+ }
30
+ export interface UnixAddress {
31
+ readonly _tag: "UnixAddress";
32
+ readonly path: string;
33
+ }
34
+ /**
35
+ * @tsplus static fncts.http.ServerOps __call
36
+ * @tsplus location "@fncts/http/Server"
37
+ */
38
+ export declare function make(options: {
39
+ readonly serve: (httpApp: HttpApp.Default<never, unknown>, middleware?: Middleware) => IO<Scope, never, void>;
40
+ readonly address: Address;
41
+ }): Server;
42
+ /**
43
+ * @tsplus pipeable fncts.http.HttpApp serve
44
+ * @tsplus location "@fncts/http/Server"
45
+ */
46
+ export declare function serve(): <R, E>(httpApp: HttpApp.Default<R, E>) => Layer<Server | Exclude<R, ServerRequest | Scope>, never, never>;
47
+ export declare function serve<R, E, App extends HttpApp.Default<any, any>>(middleware: Middleware.Applied<R, E, App>): (httpApp: HttpApp.Default<R, E>, middleware: Middleware.Applied<R, E, App>) => Layer<Server | Exclude<R, ServerRequest | Scope>, never, never>;
48
+ /**
49
+ * @tsplus pipeable fncts.http.HttpApp serveIO
50
+ * @tsplus location "@fncts/http/Server"
51
+ */
52
+ export declare function serveIO(): <R, E>(httpApp: HttpApp.Default<R, E>) => IO<Server | Exclude<R, ServerRequest | Scope>, never, never>;
53
+ export declare function serveIO<R, E, App extends HttpApp.Default<any, any>>(middleware: Middleware.Applied<R, E, App>): (httpApp: HttpApp.Default<R, E>, middleware: Middleware.Applied<R, E, App>) => IO<Server | Exclude<R, ServerRequest | Scope>, never, never>;
@@ -0,0 +1,9 @@
1
+ import { Runtime } from "@fncts/base/data/FiberId";
2
+ export declare const clientAbortFiberId: Runtime;
3
+ export declare const ServeErrorTypeId: unique symbol;
4
+ export type ServeErrorTypeId = typeof ServeErrorTypeId;
5
+ export declare class ServeError extends Error {
6
+ readonly error?: unknown;
7
+ readonly [ServeErrorTypeId]: ServeErrorTypeId;
8
+ constructor(error?: unknown);
9
+ }
@@ -0,0 +1,6 @@
1
+ import type { ServerRequest } from "./definition.js";
2
+ /**
3
+ * @tsplus static fncts.http.ServerRequestOps fromWeb
4
+ * @tsplus location "@fncts/http/ServerRequest/api"
5
+ */
6
+ export declare function fromWeb(request: globalThis.Request): ServerRequest;
@@ -0,0 +1,30 @@
1
+ import { IO } from "@fncts/io/IO";
2
+ import type { Headers } from "../Headers.js";
3
+ import type { Method } from "../Method.js";
4
+ import type { RequestError } from "../RequestError.js";
5
+ import type { Socket } from "@fncts/http/Socket";
6
+ import { IncomingMessage } from "../IncomingMessage/definition.js";
7
+ export declare const ServerRequestTypeId: unique symbol;
8
+ export type ServerRequestTypeId = typeof ServerRequestTypeId;
9
+ /**
10
+ * @tsplus type fncts.http.ServerRequest
11
+ * @tsplus companion fncts.http.ServerRequestOps
12
+ */
13
+ export declare abstract class ServerRequest extends IncomingMessage<RequestError> {
14
+ readonly [ServerRequestTypeId]: ServerRequestTypeId;
15
+ abstract readonly source: unknown;
16
+ abstract readonly url: string;
17
+ abstract readonly originalUrl: string;
18
+ abstract readonly method: Method;
19
+ abstract upgrade: IO<never, RequestError, Socket>;
20
+ abstract modify(options: {
21
+ readonly url?: string;
22
+ readonly headers?: Headers;
23
+ readonly remoteAddress?: string;
24
+ }): ServerRequest;
25
+ }
26
+ /**
27
+ * @tsplus static fncts.http.ServerRequestOps Tag
28
+ * @tsplus location "@fncts/http/ServerRequest/definition"
29
+ */
30
+ export declare const ServerRequestTag: import("@fncts/base/data/Tag.js").Tag<ServerRequest, ServerRequest>;
@@ -0,0 +1,33 @@
1
+ import { Maybe } from "@fncts/base/data/Maybe/definition";
2
+ import { IO } from "@fncts/io/IO";
3
+ import { Stream } from "@fncts/io/Stream";
4
+ import type { Method } from "../Method.js";
5
+ import type { Socket } from "@fncts/http/Socket";
6
+ import { Headers } from "../Headers.js";
7
+ import { RequestError } from "../RequestError.js";
8
+ import { UrlParams } from "../UrlParams.js";
9
+ import { ServerRequest } from "./definition.js";
10
+ export declare class ServerRequestImpl extends ServerRequest {
11
+ readonly source: Request;
12
+ readonly url: string;
13
+ headersOverride?: Headers | undefined;
14
+ private remoteAddressOverride?;
15
+ constructor(source: Request, url: string, headersOverride?: Headers | undefined, remoteAddressOverride?: string | undefined);
16
+ get method(): Method;
17
+ get originalUrl(): string;
18
+ get remoteAddress(): import("@fncts/base/data/Maybe.js").Maybe<string>;
19
+ get headers(): Headers;
20
+ private textIO;
21
+ get text(): IO<never, RequestError, string>;
22
+ get json(): IO<never, RequestError, unknown>;
23
+ get urlParamsBody(): IO<never, RequestError, UrlParams>;
24
+ private arrayBufferIO;
25
+ get arrayBuffer(): IO<never, RequestError, ArrayBuffer>;
26
+ get stream(): Stream<never, RequestError, Uint8Array>;
27
+ modify(options: {
28
+ readonly url?: string | undefined;
29
+ readonly headers?: Headers | undefined;
30
+ readonly remoteAddress?: string | undefined;
31
+ }): ServerRequest;
32
+ get upgrade(): IO<never, RequestError, Socket>;
33
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./ServerRequest/definition.js";
2
+ export * from "./ServerRequest/api.js";
@@ -0,0 +1,69 @@
1
+ import { IO } from "@fncts/io/IO";
2
+ import { Schema } from "@fncts/schema/Schema/definition";
3
+ import { Stream } from "@fncts/io/Stream";
4
+ import type { BodyError } from "../BodyError.js";
5
+ import type { Options } from "./definition";
6
+ import { Body } from "../Body.js";
7
+ import { Headers } from "../Headers.js";
8
+ import { UrlParams } from "../UrlParams.js";
9
+ import { ServerResponse } from "./definition.js";
10
+ /**
11
+ * @tsplus static fncts.http.ServerResponseOps empty
12
+ * @tsplus location "@fncts/http/ServerResponse/api"
13
+ */
14
+ export declare function empty(options?: Options.WithContent): ServerResponse;
15
+ /**
16
+ * @tsplus static fncts.http.ServerResponseOps uint8Array
17
+ * @tsplus location "@fncts/http/ServerResponse/api"
18
+ */
19
+ export declare function uint8Array(body: Uint8Array, options?: Options.WithContentType): ServerResponse;
20
+ /**
21
+ * @tsplus static fncts.http.ServerResponseOps text
22
+ * @tsplus location "@fncts/http/ServerResponse/api"
23
+ */
24
+ export declare function text(body: string, options?: Options.WithContentType): ServerResponse;
25
+ /**
26
+ * @tsplus static fncts.http.ServerResponseOps json
27
+ * @tsplus location "@fncts/http/ServerResponse/api"
28
+ */
29
+ export declare function json(body: unknown, options?: Options.WithContent): IO<never, BodyError, ServerResponse>;
30
+ /**
31
+ * @tsplus static fncts.http.ServerResponseOps schemaJson
32
+ * @tsplus location "@fncts/http/ServerResponse/api"
33
+ */
34
+ export declare function schemaJson<A>(schema: Schema<A>): (body: A, options?: Options.WithContent) => IO<never, BodyError, ServerResponse>;
35
+ /**
36
+ * @tsplus static fncts.http.ServerResponseOps urlParams
37
+ * @tsplus location "@fncts/http/ServerResponse/api"
38
+ */
39
+ export declare function urlParams(body: UrlParams.Input, options?: Options.WithContent): ServerResponse;
40
+ /**
41
+ * @tsplus static fncts.http.ServerResponseOps stream
42
+ * @tsplus location "@fncts/http/ServerResponse/api"
43
+ */
44
+ export declare function stream(body: Stream<never, unknown, Uint8Array>, options?: Options): ServerResponse;
45
+ /**
46
+ * @tsplus pipeable fncts.http.ServerResponse setHeader
47
+ * @tsplus location "@fncts/http/ServerResponse/api"
48
+ */
49
+ export declare function setHeader(key: string, value: string): (self: ServerResponse) => ServerResponse;
50
+ /**
51
+ * @tsplus pipeable fncts.http.ServerResponse setHeaders
52
+ * @tsplus location "@fncts/http/ServerResponse/api"
53
+ */
54
+ export declare function setHeaders(headers: Headers.Input): (self: ServerResponse) => ServerResponse;
55
+ /**
56
+ * @tsplus pipeable fncts.http.ServerResponse setStatus
57
+ * @tsplus location "@fncts/http/ServerResponse/api"
58
+ */
59
+ export declare function setStatus(status: number, statusText?: string): (self: ServerResponse) => ServerResponse;
60
+ /**
61
+ * @tsplus pipeable fncts.http.ServerResponse setBody
62
+ * @tsplus location "@fncts/http/ServerResponse/api"
63
+ */
64
+ export declare function setBody(body: Body): (self: ServerResponse) => ServerResponse;
65
+ /**
66
+ * @tsplus pipeable fncts.http.ServerResponse toWeb
67
+ * @tsplus location "@fncts/http/ServerResponse/api"
68
+ */
69
+ export declare function toWeb(withoutBody?: boolean): (self: ServerResponse) => Response;
@@ -0,0 +1,30 @@
1
+ import type { Body } from "../Body.js";
2
+ import { Headers } from "../Headers.js";
3
+ export declare const ServerResponseTypeId: unique symbol;
4
+ export type ServerResponseTypeId = typeof ServerResponseTypeId;
5
+ /**
6
+ * @tsplus type fncts.http.ServerResponse
7
+ * @tsplus companion fncts.http.ServerResponseOps
8
+ */
9
+ export declare class ServerResponse {
10
+ readonly status: number;
11
+ readonly statusText: string | undefined;
12
+ readonly body: Body;
13
+ readonly [ServerResponseTypeId]: ServerResponseTypeId;
14
+ readonly headers: Headers;
15
+ constructor(status: number, statusText: string | undefined, headers: Headers, body: Body);
16
+ }
17
+ export interface Options {
18
+ status?: number;
19
+ statusText?: string;
20
+ headers?: Headers;
21
+ contentType?: string;
22
+ contentLength?: number;
23
+ }
24
+ export declare namespace Options {
25
+ interface WithContent extends Omit<Options, "contentType" | "contentLength"> {
26
+ }
27
+ interface WithContentType extends Omit<Options, "contentLength"> {
28
+ }
29
+ }
30
+ export declare function isServerResponse(u: unknown): u is ServerResponse;
@@ -0,0 +1,2 @@
1
+ export * from "./ServerResponse/definition.js";
2
+ export * from "./ServerResponse/api.js";
package/Socket.d.ts ADDED
@@ -0,0 +1,107 @@
1
+ import { IO, UIO } from "@fncts/io/IO";
2
+ import { Scope } from "@fncts/io/Scope/definition";
3
+ import { Channel } from "@fncts/io/Channel";
4
+ import { Conc } from "@fncts/base/collection/immutable/Conc";
5
+ import { Exit } from "@fncts/base/data/Exit/definition";
6
+ import { Duration } from "@fncts/base/data/Duration/definition";
7
+ import { Layer } from "@fncts/io/Layer";
8
+ export declare const SocketTypeId: unique symbol;
9
+ export type SocketTypeId = typeof SocketTypeId;
10
+ /**
11
+ * @tsplus type fncts.http.Socket
12
+ * @tsplus companion fncts.http.SocketOps
13
+ */
14
+ export declare abstract class Socket {
15
+ readonly [SocketTypeId]: SocketTypeId;
16
+ abstract run<R, E, A>(handler: (_: Uint8Array) => IO<R, E, A>): IO<R, E | SocketError, void>;
17
+ abstract writer: IO<Scope, never, (chunk: Uint8Array | CloseEvent) => UIO<void>>;
18
+ }
19
+ /**
20
+ * @tsplus static fncts.http.SocketOps Tag
21
+ * @tsplus location "@fncts/http/Socket"
22
+ */
23
+ export declare const SocketTag: import("@fncts/base/data/Tag").Tag<Socket, Socket>;
24
+ export declare const SocketGenericErrorTypeId: unique symbol;
25
+ export type SocketGenericErrorTypeId = typeof SocketGenericErrorTypeId;
26
+ export declare class SocketGenericError extends Error {
27
+ readonly reason: "Write" | "Read" | "Open" | "OpenTimeout";
28
+ readonly error: unknown;
29
+ readonly [SocketGenericErrorTypeId]: SocketGenericErrorTypeId;
30
+ constructor(reason: "Write" | "Read" | "Open" | "OpenTimeout", error: unknown);
31
+ }
32
+ export declare const SocketCloseErrorTypeId: unique symbol;
33
+ export type SocketCloseErrorTypeId = typeof SocketCloseErrorTypeId;
34
+ export declare class SocketCloseError extends Error {
35
+ readonly reason: "Close";
36
+ readonly code: number;
37
+ readonly closeReason: string | undefined;
38
+ readonly error: unknown;
39
+ readonly [SocketCloseErrorTypeId]: SocketCloseErrorTypeId;
40
+ constructor(reason: "Close", code: number, closeReason: string | undefined, error: unknown);
41
+ static isClean(isClean: (code: number) => boolean): (u: unknown) => u is SocketCloseError;
42
+ }
43
+ export declare function isSocketCloseError(u: unknown): u is SocketCloseError;
44
+ export type SocketError = SocketGenericError | SocketCloseError;
45
+ export declare const CloseEventTypeId: unique symbol;
46
+ export type CloseEventTypeId = typeof CloseEventTypeId;
47
+ export declare class CloseEvent {
48
+ readonly code: number;
49
+ readonly reason?: string | undefined;
50
+ readonly [CloseEventTypeId]: CloseEventTypeId;
51
+ constructor(code?: number, reason?: string | undefined);
52
+ }
53
+ export declare function isCloseEvent(u: unknown): u is CloseEvent;
54
+ /**
55
+ * @tsplus fluent fncts.http.Socket toChannel
56
+ * @tsplus location "@fncts/http/Socket"
57
+ */
58
+ export declare function toChannel<IE>(self: Socket): Channel<never, IE, Conc<Uint8Array | CloseEvent>, unknown, SocketError | IE, Conc<Uint8Array>, void>;
59
+ /**
60
+ * @tsplus fluent fncts.http.Socket toChannelWith
61
+ * @tsplus location "@fncts/http/Socket"
62
+ */
63
+ export declare function toChannelWith<IE = never>(self: Socket): Channel<never, IE, Conc<Uint8Array | CloseEvent>, unknown, SocketError | IE, Conc<Uint8Array>, void>;
64
+ /**
65
+ * @tsplus companion fncts.http.WebSocketOps
66
+ */
67
+ export interface WebSocket {
68
+ readonly _: unique symbol;
69
+ }
70
+ /**
71
+ * @tsplus static fncts.http.WebSocketOps Tag
72
+ * @tsplus location "@fncts/http/Socket"
73
+ */
74
+ export declare const WebSocketTag: import("@fncts/base/data/Tag").Tag<WebSocket, WebSocket>;
75
+ /**
76
+ * @tsplus static fncts.http.SocketOps makeWebSocket
77
+ * @tsplus static fncts.http.WebSocketOps __call
78
+ * @tsplus location "@fncts/http/Socket"
79
+ */
80
+ export declare function makeWebSocket(url: string, options?: {
81
+ readonly closeCodeIsError?: (code: number) => boolean;
82
+ readonly openTimeout?: Duration;
83
+ }): UIO<Socket>;
84
+ /**
85
+ * @tsplus static fncts.http.SocketOps fromWebSocket
86
+ * @tsplus location "@fncts/http/Socket"
87
+ */
88
+ export declare function fromWebSocket(acquire: IO<Scope, SocketError, globalThis.WebSocket>, options?: {
89
+ readonly closeCodeIsError?: (code: number) => boolean;
90
+ readonly openTimeout?: Duration;
91
+ }): UIO<Socket>;
92
+ /**
93
+ * @tsplus static fncts.http.SocketOps makeWebSocketChannel
94
+ * @tsplus static fncts.http.WebSocketOps makeChannel
95
+ * @tsplus location "@fncts/http/Socket"
96
+ */
97
+ export declare function makeWebSocketChannel<IE = never>(url: string, options?: {
98
+ readonly closeCodeIsError?: (code: number) => boolean;
99
+ }): Channel<never, IE, Conc<Uint8Array>, unknown, IE | SocketError, Conc<Uint8Array | string | CloseEvent>, void>;
100
+ /**
101
+ * @tsplus static fncts.http.SocketOps liveWebSocket
102
+ * @tsplus static fncts.http.WebSocketOps live
103
+ * @tsplus location "@fncts/http/Socket"
104
+ */
105
+ export declare function live(url: string, options?: {
106
+ readonly closeCodeIsError?: (code: number) => boolean;
107
+ }): Layer<never, never, Socket>;
package/UrlParams.d.ts ADDED
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @tsplus type fncts.http.UrlParams
3
+ * @tsplus type fncts.http.UrlParamsOps
4
+ */
5
+ export declare class UrlParams {
6
+ readonly backing: ReadonlyArray<readonly [string, string]>;
7
+ constructor(backing: ReadonlyArray<readonly [string, string]>);
8
+ }
9
+ export declare namespace UrlParams {
10
+ type Input = Readonly<Record<string, string>> | Iterable<readonly [string, string]> | URLSearchParams;
11
+ }
12
+ /**
13
+ * @tsplus static fncts.http.UrlParamsOps __call
14
+ * @tsplus location "@fncts/http/UrlParams"
15
+ */
16
+ export declare function make(input: UrlParams.Input): UrlParams;
17
+ /**
18
+ * @tsplus fluent fncts.http.UrlParams toString
19
+ * @tsplus location "@fncts/http/UrlParams"
20
+ */
21
+ export declare function toString(self: UrlParams): string;
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.empty = void 0;
7
+ exports.formData = formData;
8
+ exports.json = void 0;
9
+ exports.jsonSchema = jsonSchema;
10
+ exports.match = match;
11
+ exports.raw = raw;
12
+ exports.stream = stream;
13
+ exports.text = void 0;
14
+ exports.uint8Array = uint8Array;
15
+ var tsplus_module_1 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/IO/api"));
16
+ var tsplus_module_2 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/schema/Parser/api"));
17
+ var tsplus_module_3 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/http/Body/definition"));
18
+ var _BodyError = /*#__PURE__*/require("../BodyError.cjs");
19
+ var _definition2 = /*#__PURE__*/require("./definition.cjs");
20
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
21
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
22
+ const fileName_1 = "(@fncts/http) src/Body/api.ts";
23
+ const text = exports.text = text_1;
24
+ const json = exports.json = json_1;
25
+ /**
26
+ * @tsplus static fncts.http.BodyOps empty
27
+ */
28
+ const empty = exports.empty = /*#__PURE__*/new _definition2.Empty();
29
+ /**
30
+ * @tsplus static fncts.http.BodyOps raw
31
+ */
32
+ function raw(body, options) {
33
+ return new _definition2.Raw(body, options?.contentType, options?.contentLength);
34
+ }
35
+ /**
36
+ * @tsplus static fncts.http.BodyOps uint8Array
37
+ */
38
+ function uint8Array(body, contentType) {
39
+ return new _definition2.Uint8Array(body, contentType ?? "application/octet-stream");
40
+ }
41
+ const encoder = /*#__PURE__*/new TextEncoder();
42
+ /**
43
+ * @tsplus static fncts.http.BodyOps text
44
+ */
45
+ function text_1(body, contentType) {
46
+ return new _definition2.Uint8Array(encoder.encode(body), contentType ?? "text/plain");
47
+ }
48
+ /**
49
+ * @tsplus static fncts.http.BodyOps json
50
+ */
51
+ function json_1(body) {
52
+ return tsplus_module_1.tryCatch(() => text_1(JSON.stringify(body), "application/json"), error => new _BodyError.JsonError(error), fileName_1 + ":47:21");
53
+ }
54
+ /**
55
+ * @tsplus static fncts.http.BodyOps jsonSchema
56
+ */
57
+ function jsonSchema(schema) {
58
+ const encode = tsplus_module_2.encode(schema);
59
+ return body => tsplus_module_1.flatMap(json_1, fileName_1 + ":58:15")(tsplus_module_1.mapError(error => new _BodyError.SchemaError(error), fileName_1 + ":57:16")(encode(body)));
60
+ }
61
+ /**
62
+ * @tsplus static fncts.http.BodyOps formData
63
+ */
64
+ function formData(body) {
65
+ return new _definition2.FormData(body);
66
+ }
67
+ /**
68
+ * @tsplus static fncts.http.BodyOps stream
69
+ */
70
+ function stream(body, options) {
71
+ return new _definition2.Stream(body, options?.contentType ?? "application/octet-stream", options?.contentLength);
72
+ }
73
+ /**
74
+ * @tsplus pipeable fncts.http.Body match
75
+ */
76
+ function match(cases) {
77
+ return body => {
78
+ tsplus_module_3.concrete(body);
79
+ switch (body._tag) {
80
+ case 0 /* BodyTag.Empty */:
81
+ return cases.Empty(body);
82
+ case 1 /* BodyTag.Raw */:
83
+ return cases.Raw(body);
84
+ case 2 /* BodyTag.Uint8Array */:
85
+ return cases.Uint8Array(body);
86
+ case 3 /* BodyTag.FormData */:
87
+ return cases.FormData(body);
88
+ case 4 /* BodyTag.Stream */:
89
+ return cases.Stream(body);
90
+ }
91
+ };
92
+ }
93
+ //# sourceMappingURL=api.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.cjs","names":["_BodyError","require","_definition2","_getRequireWildcardCache","e","WeakMap","r","t","_interopRequireWildcard","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","text","exports","text_1","json","json_1","empty","Empty","raw","body","options","Raw","contentType","contentLength","uint8Array","Uint8Array","encoder","TextEncoder","encode","tsplus_module_1","tryCatch","JSON","stringify","error","JsonError","fileName_1","jsonSchema","schema","tsplus_module_2","flatMap","mapError","SchemaError","formData","FormData","stream","Stream","match","cases","tsplus_module_3","concrete","_tag"],"sources":["../../_src/Body/api.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;AAGA,IAAAA,UAAA,gBAAAC,OAAA;AAGA,IAAAC,YAAA,gBAAAD,OAAA;AAA2E,SAAAE,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAI,wBAAAJ,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAM,OAAA,EAAAN,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAI,GAAA,CAAAP,CAAA,UAAAG,CAAA,CAAAK,GAAA,CAAAR,CAAA,OAAAS,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAf,CAAA,oBAAAe,CAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAlB,CAAA,EAAAe,CAAA,SAAAI,CAAA,GAAAR,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAd,CAAA,EAAAe,CAAA,UAAAI,CAAA,KAAAA,CAAA,CAAAX,GAAA,IAAAW,CAAA,CAAAC,GAAA,IAAAR,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAI,CAAA,IAAAV,CAAA,CAAAM,CAAA,IAAAf,CAAA,CAAAe,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAN,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAiB,GAAA,CAAApB,CAAA,EAAAS,CAAA,GAAAA,CAAA;;MAgC3DY,IAAI,GAAAC,OAAA,CAAAD,IAAA,GAAAE,MAAA;MAOJC,IAAI,GAAAF,OAAA,CAAAE,IAAA,GAAAC,MAAA;AArCpB;;;AAGO,MAAMC,KAAK,GAAAJ,OAAA,CAAAI,KAAA,gBAAU,IAAIC,kBAAK,EAAE;AAEvC;;;AAGM,SAAUC,GAAGA,CACjBC,IAAa,EACbC,OAGC;EAED,OAAO,IAAIC,gBAAG,CAACF,IAAI,EAAEC,OAAO,EAAEE,WAAW,EAAEF,OAAO,EAAEG,aAAa,CAAC;AACpE;AAEA;;;AAGM,SAAUC,UAAUA,CAACL,IAA2B,EAAEG,WAAoB;EAC1E,OAAO,IAAIG,uBAAU,CAACN,IAAI,EAAEG,WAAW,IAAI,0BAA0B,CAAC;AACxE;AAEA,MAAMI,OAAO,gBAAG,IAAIC,WAAW,EAAE;AAEjC;;;AAGA,SAAAd,OAAqBM,IAAY,EAAEG,WAAoB;EACrD,OAAO,IAAIG,uBAAU,CAACC,OAAO,CAACE,MAAM,CAACT,IAAI,CAAC,EAAEG,WAAW,IAAI,YAAY,CAAC;AAC1E;AAEA;;;AAGA,SAAAP,OAAqBI,IAAa;EAChC,OAAOU,eAAA,CAAAC,QAAA,OAAYjB,MAAA,CAAKkB,IAAI,CAACC,SAAS,CAACb,IAAI,CAAC,EAAE,kBAAkB,CAAC,EAAGc,KAAK,IAAK,IAAIC,oBAAS,CAACD,KAAK,CAAC,EAAAE,UAAA,YAAC;AACrG;AAEA;;;AAGM,SAAUC,UAAUA,CAAIC,MAAiB;EAC7C,MAAMT,MAAM,GAAAU,eAAA,CAAAV,MAAA,CAAGS,MAAM,CAAO;EAC5B,OAAQlB,IAAO,IACbU,eAAA,CAAAU,OAAA,CAAAxB,MAAA,EAAAoB,UAAA,aAAAN,eAAA,CAAAW,QAAA,CACaP,KAAK,IAAK,IAAIQ,sBAAW,CAACR,KAAK,CAAC,EAAAE,UAAA,aAD7CP,MAAM,CAACT,IAAI,CAAC,CACkC,CACzB;AACzB;AAEA;;;AAGM,SAAUuB,QAAQA,CAACvB,IAAyB;EAChD,OAAO,IAAIwB,qBAAQ,CAACxB,IAAI,CAAC;AAC3B;AAEA;;;AAGM,SAAUyB,MAAMA,CACpBzB,IAA2D,EAC3DC,OAGC;EAED,OAAO,IAAIyB,mBAAM,CAAC1B,IAAI,EAAEC,OAAO,EAAEE,WAAW,IAAI,0BAA0B,EAAEF,OAAO,EAAEG,aAAa,CAAC;AACrG;AAEA;;;AAGM,SAAUuB,KAAKA,CAAgBC,KAMpC;EACC,OAAQ5B,IAAU,IAAuB;IACvC6B,eAAA,CAAAC,QAAA,CAAA9B,IAAI,CAAW;IACf,QAAQA,IAAI,CAAC+B,IAAI;MACf;QACE,OAAOH,KAAK,CAAC9B,KAAK,CAACE,IAAI,CAAC;MAC1B;QACE,OAAO4B,KAAK,CAAC1B,GAAG,CAACF,IAAI,CAAC;MACxB;QACE,OAAO4B,KAAK,CAACtB,UAAU,CAACN,IAAI,CAAC;MAC/B;QACE,OAAO4B,KAAK,CAACJ,QAAQ,CAACxB,IAAI,CAAC;MAC7B;QACE,OAAO4B,KAAK,CAACF,MAAM,CAAC1B,IAAI,CAAC;IAC7B;EACF,CAAC;AACH"}
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Uint8Array = exports.Stream = exports.Raw = exports.FormData = exports.Empty = exports.BodyTypeId = exports.Body = void 0;
7
+ exports.concrete = concrete;
8
+ var _a;
9
+ const BodyTypeId = exports.BodyTypeId = /*#__PURE__*/Symbol.for("fncts.http.BodyTypeId");
10
+ /**
11
+ * @tsplus type fncts.http.Body
12
+ * @tsplus companion fncts.http.BodyOps
13
+ */
14
+ class Body {
15
+ constructor() {
16
+ this[_a] = BodyTypeId;
17
+ }
18
+ }
19
+ exports.Body = Body;
20
+ _a = BodyTypeId;
21
+ class Empty extends Body {
22
+ constructor() {
23
+ super(...arguments);
24
+ this._tag = 0 /* BodyTag.Empty */;
25
+ }
26
+ }
27
+ exports.Empty = Empty;
28
+ class Raw extends Body {
29
+ constructor(body, contentType, contentLength) {
30
+ super();
31
+ this.body = body;
32
+ this.contentType = contentType;
33
+ this.contentLength = contentLength;
34
+ this._tag = 1 /* BodyTag.Raw */;
35
+ }
36
+ }
37
+ exports.Raw = Raw;
38
+ class Uint8Array extends Body {
39
+ constructor(body, contentType) {
40
+ super();
41
+ this.body = body;
42
+ this.contentType = contentType;
43
+ this._tag = 2 /* BodyTag.Uint8Array */;
44
+ }
45
+ }
46
+ exports.Uint8Array = Uint8Array;
47
+ class FormData extends Body {
48
+ constructor(formData) {
49
+ super();
50
+ this.formData = formData;
51
+ this._tag = 3 /* BodyTag.FormData */;
52
+ }
53
+ }
54
+ exports.FormData = FormData;
55
+ class Stream extends Body {
56
+ constructor(stream, contentType, contentLength) {
57
+ super();
58
+ this.stream = stream;
59
+ this.contentType = contentType;
60
+ this.contentLength = contentLength;
61
+ this._tag = 4 /* BodyTag.Stream */;
62
+ }
63
+ }
64
+ /**
65
+ * @tsplus fluent fncts.http.Body concrete
66
+ */
67
+ exports.Stream = Stream;
68
+ function concrete(self) {
69
+ //
70
+ }
71
+ //# sourceMappingURL=definition.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definition.cjs","names":["BodyTypeId","exports","Symbol","for","Body","constructor","_a","Empty","_tag","Raw","body","contentType","contentLength","Uint8Array","FormData","formData","Stream","stream","concrete","self"],"sources":["../../_src/Body/definition.ts"],"sourcesContent":[null],"mappings":";;;;;;;;AAEO,MAAMA,UAAU,GAAAC,OAAA,CAAAD,UAAA,gBAAGE,MAAM,CAACC,GAAG,CAAC,uBAAuB,CAAC;AAW7D;;;;AAIM,MAAgBC,IAAI;EAA1BC,YAAA;IACW,KAAAC,EAAA,CAAY,GAAeN,UAAU;EAGhD;;AAACC,OAAA,CAAAG,IAAA,GAAAA,IAAA;KAHWJ,UAAU;AAKhB,MAAOO,KAAM,SAAQH,IAAI;EAA/BC,YAAA;;IACW,KAAAG,IAAI;EACf;;AAACP,OAAA,CAAAM,KAAA,GAAAA,KAAA;AAEK,MAAOE,GAAI,SAAQL,IAAI;EAE3BC,YACWK,IAAa,EACbC,WAAoB,EACpBC,aAAsB;IAE/B,KAAK,EAAE;IAJE,KAAAF,IAAI,GAAJA,IAAI;IACJ,KAAAC,WAAW,GAAXA,WAAW;IACX,KAAAC,aAAa,GAAbA,aAAa;IAJf,KAAAJ,IAAI;EAOb;;AACDP,OAAA,CAAAQ,GAAA,GAAAA,GAAA;AAEK,MAAOI,UAAW,SAAQT,IAAI;EAElCC,YACWK,IAA2B,EAC3BC,WAAmB;IAE5B,KAAK,EAAE;IAHE,KAAAD,IAAI,GAAJA,IAAI;IACJ,KAAAC,WAAW,GAAXA,WAAW;IAHb,KAAAH,IAAI;EAMb;;AACDP,OAAA,CAAAY,UAAA,GAAAA,UAAA;AAEK,MAAOC,QAAS,SAAQV,IAAI;EAEhCC,YAAqBU,QAA6B;IAChD,KAAK,EAAE;IADY,KAAAA,QAAQ,GAARA,QAAQ;IADpB,KAAAP,IAAI;EAGb;;AACDP,OAAA,CAAAa,QAAA,GAAAA,QAAA;AAEK,MAAOE,MAAO,SAAQZ,IAAI;EAE9BC,YACWY,MAA6D,EAC7DN,WAAmB,EACnBC,aAAsB;IAE/B,KAAK,EAAE;IAJE,KAAAK,MAAM,GAANA,MAAM;IACN,KAAAN,WAAW,GAAXA,WAAW;IACX,KAAAC,aAAa,GAAbA,aAAa;IAJf,KAAAJ,IAAI;EAOb;;AAKF;;;AAAAP,OAAA,CAAAe,MAAA,GAAAA,MAAA;AAGM,SAAUE,QAAQA,CAACC,IAAU;EACjC;AAAA"}
package/_cjs/Body.cjs ADDED
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _definition = /*#__PURE__*/require("./Body/definition.cjs");
7
+ Object.keys(_definition).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _definition[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _definition[key];
14
+ }
15
+ });
16
+ });
17
+ var _api = /*#__PURE__*/require("./Body/api.cjs");
18
+ Object.keys(_api).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _api[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function () {
24
+ return _api[key];
25
+ }
26
+ });
27
+ });
28
+ //# sourceMappingURL=Body.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Body.cjs","names":["_definition","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_api"],"sources":["../_src/Body.ts"],"sourcesContent":[null],"mappings":";;;;;AAEA,IAAAA,WAAA,gBAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,WAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,WAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,WAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,IAAA,gBAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,IAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,IAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,IAAA,CAAAL,GAAA;IAAA;EAAA;AAAA"}
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.SchemaError = exports.JsonError = exports.BodyErrorTypeId = exports.BodyError = void 0;
7
+ exports.concrete = concrete;
8
+ var _a;
9
+ const BodyErrorTypeId = exports.BodyErrorTypeId = /*#__PURE__*/Symbol.for("fncts.http.BodyError");
10
+ /**
11
+ * @tsplus type fncts.http.BodyError
12
+ * @tsplus concrete fncts.http.BodyErrorOps
13
+ */
14
+ class BodyError {
15
+ constructor() {
16
+ this[_a] = BodyErrorTypeId;
17
+ }
18
+ }
19
+ exports.BodyError = BodyError;
20
+ _a = BodyErrorTypeId;
21
+ class JsonError extends BodyError {
22
+ constructor(error) {
23
+ super();
24
+ this.error = error;
25
+ this._tag = 0 /* BodyErrorTag.JsonError */;
26
+ }
27
+ }
28
+ exports.JsonError = JsonError;
29
+ class SchemaError extends BodyError {
30
+ constructor(error) {
31
+ super();
32
+ this.error = error;
33
+ this._tag = 1 /* BodyErrorTag.SchemaError */;
34
+ }
35
+ }
36
+ /**
37
+ * @tsplus fluent fncts.http.BodyError concrete
38
+ */
39
+ exports.SchemaError = SchemaError;
40
+ function concrete(self) {
41
+ //
42
+ }
43
+ //# sourceMappingURL=BodyError.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BodyError.cjs","names":["BodyErrorTypeId","exports","Symbol","for","BodyError","constructor","_a","JsonError","error","_tag","SchemaError","concrete","self"],"sources":["../_src/BodyError.ts"],"sourcesContent":[null],"mappings":";;;;;;;;AAAO,MAAMA,eAAe,GAAAC,OAAA,CAAAD,eAAA,gBAAGE,MAAM,CAACC,GAAG,CAAC,sBAAsB,CAAC;AAQjE;;;;AAIM,MAAgBC,SAAS;EAA/BC,YAAA;IACW,KAAAC,EAAA,CAAiB,GAAoBN,eAAe;EAC/D;;AAACC,OAAA,CAAAG,SAAA,GAAAA,SAAA;KADWJ,eAAe;AAGrB,MAAOO,SAAU,SAAQH,SAAS;EAEtCC,YAAqBG,KAAc;IACjC,KAAK,EAAE;IADY,KAAAA,KAAK,GAALA,KAAK;IADjB,KAAAC,IAAI;EAGb;;AACDR,OAAA,CAAAM,SAAA,GAAAA,SAAA;AAEK,MAAOG,WAAY,SAAQN,SAAS;EAExCC,YAAqBG,KAAmB;IACtC,KAAK,EAAE;IADY,KAAAA,KAAK,GAALA,KAAK;IADjB,KAAAC,IAAI;EAGb;;AAKF;;;AAAAR,OAAA,CAAAS,WAAA,GAAAA,WAAA;AAGM,SAAUC,QAAQA,CAACC,IAAe;EACtC;AAAA"}