@torpor/build 0.1.34 → 0.3.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 (164) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/dist/RouteType-g8Ce5gOd.js +107 -0
  3. package/dist/RouteType-g8Ce5gOd.js.map +1 -0
  4. package/dist/Server-CSpY_-Ba.d.ts +78 -0
  5. package/dist/Server-CSpY_-Ba.d.ts.map +1 -0
  6. package/dist/ServerEvent-2-CnAy1W.js +74 -0
  7. package/dist/ServerEvent-2-CnAy1W.js.map +1 -0
  8. package/dist/Site-D4x1l0p5.d.ts +67 -0
  9. package/dist/Site-D4x1l0p5.d.ts.map +1 -0
  10. package/dist/_page-CsdPubw4.js +33 -0
  11. package/dist/_page-CsdPubw4.js.map +1 -0
  12. package/dist/bin/index.d.ts +1 -1
  13. package/dist/bin/index.js +14 -19
  14. package/dist/bin/index.js.map +1 -1
  15. package/dist/connectMiddleware-DbLj0St1.js +252 -0
  16. package/dist/connectMiddleware-DbLj0St1.js.map +1 -0
  17. package/dist/index.d.ts +191 -182
  18. package/dist/index.d.ts.map +1 -0
  19. package/dist/index.js +109 -145
  20. package/dist/index.js.map +1 -1
  21. package/dist/nav.d.ts +14 -0
  22. package/dist/nav.d.ts.map +1 -0
  23. package/dist/nav.js +184 -0
  24. package/dist/nav.js.map +1 -0
  25. package/dist/pathToRegex-CTgx7hQP.js +11 -0
  26. package/dist/pathToRegex-CTgx7hQP.js.map +1 -0
  27. package/dist/response-D-XpIuMH.js +307 -0
  28. package/dist/response-D-XpIuMH.js.map +1 -0
  29. package/dist/response.d.ts +336 -151
  30. package/dist/response.d.ts.map +1 -0
  31. package/dist/response.js +4 -37
  32. package/dist/run-CNdaKSPR.js +331 -0
  33. package/dist/run-CNdaKSPR.js.map +1 -0
  34. package/dist/run.d.ts +11 -8
  35. package/dist/run.d.ts.map +1 -0
  36. package/dist/run.js +8 -18
  37. package/dist/seeOther-BmehiI4C.js +110 -0
  38. package/dist/seeOther-BmehiI4C.js.map +1 -0
  39. package/dist/server.d.ts +12 -11
  40. package/dist/server.d.ts.map +1 -0
  41. package/dist/server.js +5 -18
  42. package/dist/state.d.ts +14 -10
  43. package/dist/state.d.ts.map +1 -0
  44. package/dist/state.js +3 -7
  45. package/dist/test.d.ts +12 -11
  46. package/dist/test.d.ts.map +1 -0
  47. package/dist/test.js +152 -225
  48. package/dist/test.js.map +1 -1
  49. package/package.json +25 -29
  50. package/src/bin/index.ts +9 -11
  51. package/src/index.ts +3 -0
  52. package/src/nav/load.ts +9 -0
  53. package/src/nav/loadData.ts +121 -0
  54. package/src/nav/navigate.ts +154 -0
  55. package/src/nav/reload.ts +9 -0
  56. package/src/nav.ts +4 -0
  57. package/src/response/badRequest.ts +9 -4
  58. package/src/response/created.ts +10 -3
  59. package/src/response/forbidden.ts +11 -4
  60. package/src/response/found.ts +30 -0
  61. package/src/response/methodNotAllowed.ts +8 -4
  62. package/src/response/movedPermanently.ts +25 -0
  63. package/src/response/notFound.ts +14 -7
  64. package/src/response/notModified.ts +24 -4
  65. package/src/response/ok.ts +19 -10
  66. package/src/response/permanentRedirect.ts +30 -0
  67. package/src/response/seeOther.ts +9 -3
  68. package/src/response/serverError.ts +14 -2
  69. package/src/response/temporaryRedirect.ts +31 -0
  70. package/src/response/unauthorized.ts +11 -4
  71. package/src/response/unprocessable.ts +8 -2
  72. package/src/response.ts +8 -4
  73. package/src/run/prepareTemplate.ts +32 -0
  74. package/src/{site → run}/run.ts +1 -1
  75. package/src/{site → run}/runBuild.ts +2 -2
  76. package/src/{site → run}/runDev.ts +2 -2
  77. package/src/{site → run}/runPreview.ts +12 -2
  78. package/src/run.ts +4 -4
  79. package/src/server/Routerx.ts +3 -3
  80. package/src/server/Server.ts +3 -3
  81. package/src/server/ServerEvent.ts +1 -1
  82. package/src/server/connect/bufferToArrayBuffer.ts +8 -0
  83. package/src/server/connect/connectMiddleware.ts +4 -2
  84. package/src/server/connect/nodeMessageToNodeResponse.ts +2 -2
  85. package/src/server/types/ServerFunction.ts +3 -1
  86. package/src/site/Router.ts +3 -3
  87. package/src/site/clientEntry.ts +40 -273
  88. package/src/site/defaultAdapter.ts +1 -1
  89. package/src/site/serverEntry.ts +86 -50
  90. package/src/state/$page.ts +3 -12
  91. package/src/state/client.ts +6 -0
  92. package/src/state/internal.ts +45 -0
  93. package/src/test/runTest.ts +4 -4
  94. package/src/types/Adapter.ts +2 -4
  95. package/src/types/ClientState.ts +8 -0
  96. package/src/types/InternalState.ts +7 -0
  97. package/src/types/LayoutHandler.ts +2 -4
  98. package/src/types/LayoutPath.ts +10 -0
  99. package/src/types/ManifestRoute.ts +2 -4
  100. package/src/types/PageEndPoint.ts +5 -5
  101. package/src/types/PageLoadEvent.ts +2 -4
  102. package/src/types/PageServerAction.ts +1 -1
  103. package/src/types/PageServerEndPoint.ts +2 -4
  104. package/src/types/PageServerLoad.ts +1 -1
  105. package/src/types/PageState.ts +8 -0
  106. package/src/types/RouteHandler.ts +2 -4
  107. package/src/types/RouteLayoutHandler.ts +2 -4
  108. package/src/types/RouteMatchResult.ts +2 -4
  109. package/src/types/ServerHook.ts +3 -7
  110. package/src/types/ServerLoadEvent.ts +2 -4
  111. package/src/types/ServerRequest.ts +1 -1
  112. package/src/{site → utils}/pathToRegex.ts +1 -1
  113. package/{tsup.config.ts → tsdown.config.ts} +3 -4
  114. package/dist/Server-BC_dixZQ.d.cts +0 -71
  115. package/dist/Server-BC_dixZQ.d.ts +0 -71
  116. package/dist/Site-4tGiw2-I.d.ts +0 -63
  117. package/dist/Site-BXX-S541.d.cts +0 -63
  118. package/dist/bin/index.cjs +0 -755
  119. package/dist/bin/index.cjs.map +0 -1
  120. package/dist/bin/index.d.cts +0 -1
  121. package/dist/chunk-565UOT3F.js +0 -18
  122. package/dist/chunk-565UOT3F.js.map +0 -1
  123. package/dist/chunk-B2UNTYN5.js +0 -68
  124. package/dist/chunk-B2UNTYN5.js.map +0 -1
  125. package/dist/chunk-KKFND4HK.js +0 -85
  126. package/dist/chunk-KKFND4HK.js.map +0 -1
  127. package/dist/chunk-LO7P2LJE.js +0 -278
  128. package/dist/chunk-LO7P2LJE.js.map +0 -1
  129. package/dist/chunk-PTVHEJZ5.js +0 -152
  130. package/dist/chunk-PTVHEJZ5.js.map +0 -1
  131. package/dist/chunk-RHDSM5GS.js +0 -357
  132. package/dist/chunk-RHDSM5GS.js.map +0 -1
  133. package/dist/chunk-SJVHHGVW.js +0 -13
  134. package/dist/chunk-SJVHHGVW.js.map +0 -1
  135. package/dist/chunk-WVXAN4IV.js +0 -50
  136. package/dist/chunk-WVXAN4IV.js.map +0 -1
  137. package/dist/index.cjs +0 -322
  138. package/dist/index.cjs.map +0 -1
  139. package/dist/index.d.cts +0 -199
  140. package/dist/metafile-cjs.json +0 -1
  141. package/dist/metafile-esm.json +0 -1
  142. package/dist/response.cjs +0 -150
  143. package/dist/response.cjs.map +0 -1
  144. package/dist/response.d.cts +0 -166
  145. package/dist/response.js.map +0 -1
  146. package/dist/run.cjs +0 -764
  147. package/dist/run.cjs.map +0 -1
  148. package/dist/run.d.cts +0 -14
  149. package/dist/run.js.map +0 -1
  150. package/dist/server.cjs +0 -390
  151. package/dist/server.cjs.map +0 -1
  152. package/dist/server.d.cts +0 -17
  153. package/dist/server.js.map +0 -1
  154. package/dist/state.cjs +0 -44
  155. package/dist/state.cjs.map +0 -1
  156. package/dist/state.d.cts +0 -11
  157. package/dist/state.js.map +0 -1
  158. package/dist/test.cjs +0 -538
  159. package/dist/test.cjs.map +0 -1
  160. package/dist/test.d.cts +0 -15
  161. package/src/response/moved.ts +0 -16
  162. package/src/response/redirect.ts +0 -17
  163. package/src/site/prepareTemplate.ts +0 -20
  164. package/src/state/Page.ts +0 -8
@@ -1,166 +1,351 @@
1
+ //#region src/response/badRequest.d.ts
1
2
  /**
2
- * 400 Bad Request
3
- *
4
- * The server cannot or will not process the request due to something that is
5
- * perceived to be a client error (e.g., malformed request syntax, invalid
6
- * request message framing, or deceptive request routing).
7
- *
8
- * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400
9
- */
3
+ * 400 Bad Request
4
+ *
5
+ * The HTTP 400 Bad Request client error response status code indicates that the
6
+ * server would not process the request due to something the server considered
7
+ * to be a client error. The reason for a 400 response is typically due to
8
+ * malformed request syntax, invalid request message framing, or deceptive
9
+ * request routing.
10
+ *
11
+ * Clients that receive a 400 response should expect that repeating the request
12
+ * without modification will fail with the same error.
13
+ *
14
+ * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/400
15
+ */
10
16
  declare function badRequest(body?: object | string): Response;
11
-
12
- /**
13
- * 201 Created
14
- *
15
- * The request succeeded, and a new resource was created as a result. This is
16
- * typically the response sent after POST requests, or some PUT requests.
17
- *
18
- * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/201
19
- */
17
+ //#endregion
18
+ //#region src/response/created.d.ts
19
+ /**
20
+ * 201 Created
21
+ *
22
+ * The HTTP 201 Created successful response status code indicates that the HTTP
23
+ * request has led to the creation of a resource. This status code is commonly
24
+ * sent as the result of a POST request.
25
+ *
26
+ * The new resource, or a description and link to the new resource, is created
27
+ * before the response is returned. The newly-created items can be returned in
28
+ * the body of the response message, but must be locatable by the URL of the
29
+ * initiating request or by the URL in the value of the Location header provided
30
+ * with the response.
31
+ *
32
+ * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/201
33
+ */
20
34
  declare function created(body?: object | string): Response;
21
-
22
- /**
23
- * 403 Forbidden
24
- *
25
- * The client does not have access rights to the content; that is, it is
26
- * unauthorized, so the server is refusing to give the requested resource.
27
- * Unlike 401 Unauthorized, the client's identity is known to the server.
28
- *
29
- * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403
30
- */
35
+ //#endregion
36
+ //#region src/response/forbidden.d.ts
37
+ /**
38
+ * 403 Forbidden
39
+ *
40
+ * The HTTP 403 Forbidden client error response status code indicates that the
41
+ * server understood the request but refused to process it. This status is
42
+ * similar to 401, except that for 403 Forbidden responses, authenticating or
43
+ * re-authenticating makes no difference. The request failure is tied to
44
+ * application logic, such as insufficient permissions to a resource or action.
45
+ *
46
+ * Clients that receive a 403 response should expect that repeating the request
47
+ * without modification will fail with the same error. Server owners may decide
48
+ * to send a 404 response instead of a 403 if acknowledging the existence of a
49
+ * resource to clients with insufficient privileges is not desired.
50
+ *
51
+ * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/403
52
+ */
31
53
  declare function forbidden(body?: object | string): Response;
32
-
33
- /**
34
- * 405 Method Not Allowed
35
- *
36
- * The request method is known by the server but is not supported by the target
37
- * resource. For example, an API may not allow calling DELETE to remove a
38
- * resource.
39
- *
40
- * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/405
41
- */
54
+ //#endregion
55
+ //#region src/response/found.d.ts
56
+ /**
57
+ * 302 Found
58
+ *
59
+ * The HTTP 302 Found redirection response status code indicates that the
60
+ * requested resource has been temporarily moved to the URL in the Location
61
+ * header.
62
+ *
63
+ * A browser receiving this status will automatically request the resource at
64
+ * the URL in the Location header, redirecting the user to the new page. Search
65
+ * engines receiving this response will not attribute links to the original URL
66
+ * to the new resource, meaning no SEO value is transferred to the new URL.
67
+ *
68
+ * > Note: In the Fetch Standard, when a user agent receives a 302 in response
69
+ * > to a POST request, it uses the GET method in the subsequent redirection
70
+ * > request, as permitted by the HTTP specification. To avoid user agents
71
+ * > modifying the request, use 307 Temporary Redirect instead, as altering the
72
+ * > method after a 307 response is prohibited.
73
+ *
74
+ * > In cases where you want any request method to be changed to GET, use 303
75
+ * > See Other. This is useful when you want to give a response to a PUT method
76
+ * > that is not the uploaded resource but a confirmation message such as: "you
77
+ * > successfully uploaded XYZ".
78
+ *
79
+ * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/302
80
+ */
81
+ declare function permRedirect(location: string): Response;
82
+ //#endregion
83
+ //#region src/response/methodNotAllowed.d.ts
84
+ /**
85
+ * 405 Method Not Allowed
86
+ *
87
+ * The HTTP 405 Method Not Allowed client error response status code indicates
88
+ * that the server knows the request method, but the target resource doesn't
89
+ * support this method. The server must generate an Allow header in a 405
90
+ * response with a list of methods that the target resource currently supports.
91
+ *
92
+ * Improper server-side permissions set on files or directories may cause a 405
93
+ * response when the request would otherwise be expected to succeed.
94
+ *
95
+ * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/405
96
+ */
42
97
  declare function methodNotAllowed(body?: object | string): Response;
43
-
44
- /**
45
- * 308 Permanent Redirect
46
- *
47
- * This means that the resource is now permanently located at another URI,
48
- * specified by the Location: HTTP Response header. This has the same semantics
49
- * as the 301 Moved Permanently HTTP response code, with the exception that the
50
- * user agent must not change the HTTP method used: if a POST was used in the
51
- * first request, a POST must be used in the second request.
52
- *
53
- * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/308
54
- */
55
- declare function moved(location: string): Response;
56
-
57
- /**
58
- * 404 Not Found
59
- *
60
- * The server cannot find the requested resource. In the browser, this means the
61
- * URL is not recognized. In an API, this can also mean that the endpoint is
62
- * valid but the resource itself does not exist. Servers may also send this
63
- * response instead of 403 Forbidden to hide the existence of a resource from an
64
- * unauthorized client. This response code is probably the most well known due
65
- * to its frequent occurrence on the web.
66
- *
67
- * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/404
68
- */
98
+ //#endregion
99
+ //#region src/response/movedPermanently.d.ts
100
+ /**
101
+ * 301 Moved Permanently
102
+ *
103
+ * The HTTP 301 Moved Permanently redirection response status code indicates
104
+ * that the requested resource has been permanently moved to the URL in the
105
+ * Location header.
106
+ *
107
+ * A browser receiving this status will automatically request the resource at
108
+ * the URL in the Location header, redirecting the user to the new page. Search
109
+ * engines receiving this response will attribute links to the original URL to
110
+ * the redirected resource, passing the SEO ranking to the new URL.
111
+ *
112
+ * > Note: In the Fetch Standard, when a user agent receives a 301 in response
113
+ * > to a POST request, it uses the GET method in the subsequent redirection
114
+ * > request, as permitted by the HTTP specification. To avoid user agents
115
+ * > modifying the request, use 308 Permanent Redirect instead, as altering the
116
+ * > method after a 308 response is prohibited.
117
+ *
118
+ * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/301
119
+ */
120
+ declare function permRedirect$1(location: string): Response;
121
+ //#endregion
122
+ //#region src/response/notFound.d.ts
123
+ /**
124
+ * 404 Not Found
125
+ *
126
+ * The HTTP 404 Not Found client error response status code indicates that the
127
+ * server cannot find the requested resource. Links that lead to a 404 page are
128
+ * often called broken or dead links and can be subject to link rot.
129
+ *
130
+ * A 404 status code only indicates that the resource is missing without
131
+ * indicating if this is temporary or permanent. If a resource is permanently
132
+ * removed, servers should send the 410 Gone status instead.
133
+ *
134
+ * 404 errors on a website can lead to a poor user experience for your visitors,
135
+ * so the number of broken links (internal and external) should be minimized to
136
+ * prevent frustration for readers. Common causes of 404 responses are mistyped
137
+ * URLs or pages that are moved or deleted without redirection. For more
138
+ * information, see the Redirections in HTTP guide.
139
+ *
140
+ * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/404
141
+ */
69
142
  declare function notFound(body?: object | string): Response;
70
-
71
- /**
72
- * 304 Not Modified
73
- *
74
- * This is used for caching purposes. It tells the client that the response has
75
- * not been modified, so the client can continue to use the same cached version
76
- * of the response.
77
- *
78
- * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/304
79
- */
143
+ //#endregion
144
+ //#region src/response/notModified.d.ts
145
+ /**
146
+ * 304 Not Modified
147
+ *
148
+ * The HTTP 304 Not Modified redirection response status code indicates that
149
+ * there is no need to retransmit the requested resources.
150
+ *
151
+ * This response code is sent when the request is a conditional GET or HEAD
152
+ * request with an If-None-Match or an If-Modified-Since header and the
153
+ * condition evaluates to 'false'. It confirms that the resource cached by the
154
+ * client is still valid and that the server would have sent a 200 OK response
155
+ * with the resource if the condition evaluated to 'true'. See HTTP caching for
156
+ * more information.
157
+ *
158
+ * The response must not contain a body and must include the headers that would
159
+ * have been sent in an equivalent 200 response, such as:
160
+ *
161
+ * - Cache-Control
162
+ * - Content-Location
163
+ * - Date
164
+ * - ETag
165
+ * - Expires
166
+ * - Vary
167
+ *
168
+ * > Note: Many developer tools' network panels of browsers create extraneous
169
+ * > requests leading to 304 responses, so that access to the local cache is
170
+ * > visible to developers.
171
+ *
172
+ * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/304
173
+ */
80
174
  declare function notModified(location: string): Response;
81
-
82
- /**
83
- * 200 OK
84
- *
85
- * The request succeeded. The result meaning of "success" depends on the HTTP
86
- * method:
87
- * - GET: The resource has been fetched and transmitted in the message body.
88
- * - HEAD: The representation headers are included in the response without any
89
- * message body.
90
- * - PUT or POST: The resource describing the result of the action is
91
- * transmitted in the message body.
92
- * - TRACE: The message body contains the request message as received by the
93
- * server.
94
- *
95
- * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/200
96
- */
175
+ //#endregion
176
+ //#region src/response/ok.d.ts
177
+ /**
178
+ * 200 OK
179
+ *
180
+ * The HTTP 200 OK successful response status code indicates that a request has
181
+ * succeeded. A 200 OK response is cacheable by default.
182
+ *
183
+ * A 200 OK response has a different meaning and format depending on the HTTP
184
+ * request method. Here's how they vary for different methods:
185
+ *
186
+ * - GET: A resource was retrieved by the server and included in the response
187
+ * body.
188
+ * - POST: An action succeeded; the response has a message body describing the
189
+ * result.
190
+ * - HEAD: Identical to GET, except there is no message body.
191
+ * - TRACE: The response has a message body containing the request as received
192
+ * by the server.
193
+ *
194
+ * Although possible, successful PUT or DELETE requests often do not result in a
195
+ * 200 OK response. It is more common to see 201 Created if the resource is
196
+ * uploaded or created for the first time, or 204 No Content upon successful
197
+ * deletion of a resource.
198
+ *
199
+ * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/200
200
+ */
97
201
  declare function ok(body?: object | string): Response;
98
-
99
- /**
100
- * 307 Temporary Redirect
101
- *
102
- * The server sends this response to direct the client to get the requested
103
- * resource at another URI with the same method that was used in the prior
104
- * request. This has the same semantics as the 302 Found HTTP response code,
105
- * with the exception that the user agent must not change the HTTP method used:
106
- * if a POST was used in the first request, a POST must be used in the second
107
- * request.
108
- *
109
- * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/307
110
- */
111
- declare function redirect(location: string): Response;
112
-
113
- /**
114
- * Creates a response with the supplied status code and optional body.
115
- *
116
- * If the body is an object, it will be converted to JSON and the content-type
117
- * header set to "application/json". Otherwise, if the body is a string, the
118
- * content-type header will be set to "text/plain".
119
- */
202
+ //#endregion
203
+ //#region src/response/permanentRedirect.d.ts
204
+ /**
205
+ * 308 Permanent Redirect
206
+ *
207
+ * The HTTP 308 Permanent Redirect redirection response status code indicates
208
+ * that the requested resource has been permanently moved to the URL given by
209
+ * the Location header.
210
+ *
211
+ * A browser receiving this status will automatically request the resource at
212
+ * the URL in the Location header, redirecting the user to the new page. Search
213
+ * engines receiving this response will attribute links to the original URL to
214
+ * the redirected resource, passing the SEO ranking to the new URL.
215
+ *
216
+ * The request method and the body will not be modified by the client in the
217
+ * redirected request. A 301 Moved Permanently requires the request method and
218
+ * the body to remain unchanged when redirection is performed, but this is
219
+ * incorrectly handled by older clients to use the GET method instead.
220
+ *
221
+ * > Note: Some Web applications may use the 308 Permanent Redirect in a
222
+ * > non-standard way and for different purposes. For example, Google Drive uses
223
+ * > a 308 Resume Incomplete response to indicate to the client when an
224
+ * > unfinished upload has stalled. See Perform a resumable download on the
225
+ * > Google Drive documentation for more information.
226
+ *
227
+ * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/308
228
+ */
229
+ declare function permanentRedirect(location: string): Response;
230
+ //#endregion
231
+ //#region src/response/response.d.ts
232
+ /**
233
+ * Creates a response with the supplied status code and optional body.
234
+ *
235
+ * If the body is an object, it will be converted to JSON and the content-type
236
+ * header set to "application/json". Otherwise, if the body is a string, the
237
+ * content-type header will be set to "text/plain".
238
+ */
120
239
  declare function response(status: number, body?: object | string): Response;
121
-
122
- /**
123
- * 303 See Other
124
- *
125
- * The server sent this response to direct the client to get the requested
126
- * resource at another URI with a GET request.
127
- *
128
- * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/303
129
- */
240
+ //#endregion
241
+ //#region src/response/seeOther.d.ts
242
+ /**
243
+ * 303 See Other
244
+ *
245
+ * The HTTP 303 See Other redirection response status code indicates that the
246
+ * browser should redirect to the URL in the Location header instead of
247
+ * rendering the requested resource.
248
+ *
249
+ * This response code is often sent back as a result of PUT or POST methods so
250
+ * the client may retrieve a confirmation, or view a representation of a
251
+ * real-world object (see HTTP range-14). The method to retrieve the redirected
252
+ * resource is always GET.
253
+ *
254
+ * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/303
255
+ */
130
256
  declare function seeOther(location: string): Response;
131
-
132
- /**
133
- * 500 Server Error
134
- *
135
- * The server has encountered a situation it does not know how to handle.
136
- *
137
- * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500
138
- */
257
+ //#endregion
258
+ //#region src/response/serverError.d.ts
259
+ /**
260
+ * 500 Server Error
261
+ *
262
+ * The HTTP 500 Internal Server Error server error response status code
263
+ * indicates that the server encountered an unexpected condition that prevented
264
+ * it from fulfilling the request. This error is a generic "catch-all" response
265
+ * to server issues, indicating that the server cannot find a more appropriate
266
+ * 5XX error to respond with.
267
+ *
268
+ * If you're a visitor seeing 500 errors on a web page, these issues require
269
+ * investigation by server owners or administrators. There are many possible
270
+ * causes of 500 errors, including: improper server configuration, out-of-memory
271
+ * (OOM) issues, unhandled exceptions, improper file permissions, or other
272
+ * complex factors. Server administrators may proactively log occurrences of
273
+ * server error responses, like the 500 status code, with details about the
274
+ * initiating requests to improve the stability of a service in the future.
275
+ *
276
+ * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/500
277
+ */
139
278
  declare function serverError(body?: object | string): Response;
140
-
279
+ //#endregion
280
+ //#region src/response/temporaryRedirect.d.ts
141
281
  /**
142
- * Creates a redirect response with the supplied status code.
143
- */
282
+ * 307 Temporary Redirect
283
+ *
284
+ * The HTTP 307 Temporary Redirect redirection response status code indicates
285
+ * that the resource requested has been temporarily moved to the URL in the
286
+ * Location header.
287
+ *
288
+ * A browser receiving this status will automatically request the resource at
289
+ * the URL in the Location header, redirecting the user to the new page. Search
290
+ * engines receiving this response will not attribute links to the original URL
291
+ * to the new resource, meaning no SEO value is transferred to the new URL.
292
+ *
293
+ * The method and the body of the original request are reused to perform the
294
+ * redirected request. In the cases where you want the request method to be
295
+ * changed to GET, use 303 See Other instead. This is useful when you want to
296
+ * give an answer to a successful PUT request that is not the uploaded resource,
297
+ * but a status monitor or confirmation message like "You have successfully
298
+ * uploaded XYZ".
299
+ *
300
+ * The difference between 307 and 302 is that 307 guarantees that the client
301
+ * will not change the request method and body when the redirected request is
302
+ * made. With 302, older clients incorrectly changed the method to GET. 307 and
303
+ * 302 responses are identical when the request method is GET.
304
+ *
305
+ * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/307
306
+ */
307
+ declare function temporaryRedirect(location: string): Response;
308
+ //#endregion
309
+ //#region src/response/transfer.d.ts
310
+ /**
311
+ * Creates a redirect response with the supplied status code.
312
+ */
144
313
  declare function transfer(status: 300 | 301 | 302 | 303 | 304 | 307 | 308, location: string): Response;
145
-
146
- /**
147
- * 401 Unauthorized
148
- *
149
- * Although the HTTP standard specifies "unauthorized", semantically this
150
- * response means "unauthenticated". That is, the client must authenticate
151
- * itself to get the requested response.
152
- *
153
- * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/401
154
- */
314
+ //#endregion
315
+ //#region src/response/unauthorized.d.ts
316
+ /**
317
+ * 401 Unauthorized
318
+ *
319
+ * The HTTP 401 Unauthorized client error response status code indicates that a
320
+ * request was not successful because it lacks valid authentication credentials
321
+ * for the requested resource. This status code is sent with an HTTP
322
+ * WWW-Authenticate response header that contains information on the
323
+ * authentication scheme the server expects the client to include to make the
324
+ * request successfully.
325
+ *
326
+ * A 401 Unauthorized is similar to the 403 Forbidden response, except that a
327
+ * 403 is returned when a request contains valid credentials, but the client
328
+ * does not have permissions to perform a certain action.
329
+ *
330
+ * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/401
331
+ */
155
332
  declare function unauthorized(body?: object | string): Response;
156
-
157
- /**
158
- * 422 Unprocessable Content
159
- *
160
- * The request was well-formed but was unable to be followed due to semantic errors.
161
- *
162
- * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/422
163
- */
333
+ //#endregion
334
+ //#region src/response/unprocessable.d.ts
335
+ /**
336
+ * 422 Unprocessable Content
337
+ *
338
+ * The HTTP 422 Unprocessable Content client error response status code
339
+ * indicates that the server understood the content type of the request content,
340
+ * and the syntax of the request content was correct, but it was unable to
341
+ * process the contained instructions.
342
+ *
343
+ * Clients that receive a 422 response should expect that repeating the request
344
+ * without modification will fail with the same error.
345
+ *
346
+ * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/422
347
+ */
164
348
  declare function unprocessable(body?: object | string): Response;
165
-
166
- export { badRequest, created, forbidden, methodNotAllowed, moved, notFound, notModified, ok, redirect, response, seeOther, serverError, transfer, unauthorized, unprocessable };
349
+ //#endregion
350
+ export { badRequest, created, forbidden, permRedirect as found, methodNotAllowed, permRedirect$1 as movedPermanently, notFound, notModified, ok, permanentRedirect, response, seeOther, serverError, temporaryRedirect, transfer, unauthorized, unprocessable };
351
+ //# sourceMappingURL=response.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response.d.ts","names":[],"sources":["../src/response/badRequest.ts","../src/response/created.ts","../src/response/forbidden.ts","../src/response/found.ts","../src/response/methodNotAllowed.ts","../src/response/movedPermanently.ts","../src/response/notFound.ts","../src/response/notModified.ts","../src/response/ok.ts","../src/response/permanentRedirect.ts","../src/response/response.ts","../src/response/seeOther.ts","../src/response/serverError.ts","../src/response/temporaryRedirect.ts","../src/response/transfer.ts","../src/response/unauthorized.ts","../src/response/unprocessable.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;iBAgBwB,UAAA,0BAAoC;;;;;;;;;;;;;;;;;;iBCCpC,OAAA,0BAAiC;;;;;;;;;;;;;;;;;;;iBCCjC,SAAA,0BAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;AIGnC,iBHMA,YAAA,CGNkC,QAAA,EAAA,MAAA,CAAA,EHMF,QGNE;;;;;;;;;;;;;;;;AHMlC,iBCZA,gBAAA,CDYgC,IAAA,CAAA,EAAA,MAAA,GAAA,MAAA,CAAA,ECZU,QDYV;;;;;;;;;;;;;;;;;;;;;;;iBELhC,cAAA,oBAAgC;;;;;;;;;;;;;;;;;;;;;;iBCDhC,QAAA,0BAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACUlC,iBAAA,WAAA,CAA+B,QAAA,EAAA,MAAA,CAAA,EAAA,QAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;iBCL/B,EAAA,0BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;AFL5B,iBGMA,iBAAA,CHNkC,QAAA,EAAA,MAAA,CAAA,EGMG,QHNH;;;;;;;;;;iBIdlC,QAAA,0CAAkD;;;;;;;;;;;;;;;;;iBCSlD,QAAA,oBAA4B;;;;;;;;;;;;;;;;;;;;;;iBCK5B,WAAA,0BAAqC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBCOrC,iBAAA,oBAAqC;;;;;;iBCzBrC,QAAA,qEAGrB;;;;;;;;;;;;;;;;;;;iBCYqB,YAAA,0BAAsC;;;;;;;;;;;;;;;;AZStC,iBaZA,aAAA,CbYgC,IAAA,CAAA,EAAA,MAAA,GAAA,MAAA,CAAA,EaZO,QbYP"}
package/dist/response.js CHANGED
@@ -1,37 +1,4 @@
1
- import {
2
- badRequest,
3
- created,
4
- forbidden,
5
- methodNotAllowed,
6
- moved,
7
- notModified,
8
- redirect,
9
- serverError,
10
- unauthorized,
11
- unprocessable
12
- } from "./chunk-B2UNTYN5.js";
13
- import {
14
- notFound,
15
- ok,
16
- response,
17
- seeOther,
18
- transfer
19
- } from "./chunk-WVXAN4IV.js";
20
- export {
21
- badRequest,
22
- created,
23
- forbidden,
24
- methodNotAllowed,
25
- moved,
26
- notFound,
27
- notModified,
28
- ok,
29
- redirect,
30
- response,
31
- seeOther,
32
- serverError,
33
- transfer,
34
- unauthorized,
35
- unprocessable
36
- };
37
- //# sourceMappingURL=response.js.map
1
+ import { notFound, ok, response, seeOther, transfer } from "./seeOther-BmehiI4C.js";
2
+ import { badRequest, created, forbidden, methodNotAllowed, notModified, permRedirect as permRedirect$1, permRedirect$1 as permRedirect, permanentRedirect, serverError, temporaryRedirect, unauthorized, unprocessable } from "./response-D-XpIuMH.js";
3
+
4
+ export { badRequest, created, forbidden, permRedirect as found, methodNotAllowed, permRedirect$1 as movedPermanently, notFound, notModified, ok, permanentRedirect, response, seeOther, serverError, temporaryRedirect, transfer, unauthorized, unprocessable };