@torpor/build 0.2.0 → 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.
- package/CHANGELOG.md +31 -0
- package/dist/RouteType-g8Ce5gOd.js +107 -0
- package/dist/RouteType-g8Ce5gOd.js.map +1 -0
- package/dist/Server-CSpY_-Ba.d.ts +78 -0
- package/dist/Server-CSpY_-Ba.d.ts.map +1 -0
- package/dist/ServerEvent-2-CnAy1W.js +74 -0
- package/dist/ServerEvent-2-CnAy1W.js.map +1 -0
- package/dist/Site-D4x1l0p5.d.ts +67 -0
- package/dist/Site-D4x1l0p5.d.ts.map +1 -0
- package/dist/_page-CsdPubw4.js +33 -0
- package/dist/_page-CsdPubw4.js.map +1 -0
- package/dist/bin/index.d.ts +1 -1
- package/dist/bin/index.js +14 -19
- package/dist/bin/index.js.map +1 -1
- package/dist/connectMiddleware-DbLj0St1.js +252 -0
- package/dist/connectMiddleware-DbLj0St1.js.map +1 -0
- package/dist/index.d.ts +188 -179
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +109 -145
- package/dist/index.js.map +1 -1
- package/dist/nav.d.ts +14 -0
- package/dist/nav.d.ts.map +1 -0
- package/dist/nav.js +184 -0
- package/dist/nav.js.map +1 -0
- package/dist/pathToRegex-CTgx7hQP.js +11 -0
- package/dist/pathToRegex-CTgx7hQP.js.map +1 -0
- package/dist/response-D-XpIuMH.js +307 -0
- package/dist/response-D-XpIuMH.js.map +1 -0
- package/dist/response.d.ts +336 -151
- package/dist/response.d.ts.map +1 -0
- package/dist/response.js +4 -37
- package/dist/run-CNdaKSPR.js +331 -0
- package/dist/run-CNdaKSPR.js.map +1 -0
- package/dist/run.d.ts +11 -8
- package/dist/run.d.ts.map +1 -0
- package/dist/run.js +8 -18
- package/dist/seeOther-BmehiI4C.js +110 -0
- package/dist/seeOther-BmehiI4C.js.map +1 -0
- package/dist/server.d.ts +12 -11
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +5 -18
- package/dist/state.d.ts +14 -10
- package/dist/state.d.ts.map +1 -0
- package/dist/state.js +3 -7
- package/dist/test.d.ts +12 -11
- package/dist/test.d.ts.map +1 -0
- package/dist/test.js +152 -225
- package/dist/test.js.map +1 -1
- package/package.json +25 -29
- package/src/bin/index.ts +9 -11
- package/src/index.ts +3 -0
- package/src/nav/load.ts +9 -0
- package/src/nav/loadData.ts +121 -0
- package/src/nav/navigate.ts +154 -0
- package/src/nav/reload.ts +9 -0
- package/src/nav.ts +4 -0
- package/src/response/badRequest.ts +9 -4
- package/src/response/created.ts +10 -3
- package/src/response/forbidden.ts +11 -4
- package/src/response/found.ts +30 -0
- package/src/response/methodNotAllowed.ts +8 -4
- package/src/response/movedPermanently.ts +25 -0
- package/src/response/notFound.ts +14 -7
- package/src/response/notModified.ts +24 -4
- package/src/response/ok.ts +19 -10
- package/src/response/permanentRedirect.ts +30 -0
- package/src/response/seeOther.ts +9 -3
- package/src/response/serverError.ts +14 -2
- package/src/response/temporaryRedirect.ts +31 -0
- package/src/response/unauthorized.ts +11 -4
- package/src/response/unprocessable.ts +8 -2
- package/src/response.ts +8 -4
- package/src/{site → run}/prepareTemplate.ts +1 -1
- package/src/{site → run}/run.ts +1 -1
- package/src/{site → run}/runBuild.ts +2 -2
- package/src/{site → run}/runDev.ts +2 -2
- package/src/{site → run}/runPreview.ts +1 -1
- package/src/run.ts +4 -4
- package/src/server/Routerx.ts +3 -3
- package/src/server/Server.ts +3 -3
- package/src/server/connect/connectMiddleware.ts +2 -1
- package/src/server/connect/nodeMessageToNodeResponse.ts +2 -2
- package/src/site/Router.ts +3 -3
- package/src/site/clientEntry.ts +11 -269
- package/src/site/defaultAdapter.ts +1 -1
- package/src/site/serverEntry.ts +67 -44
- package/src/state/$page.ts +3 -12
- package/src/state/client.ts +6 -0
- package/src/state/internal.ts +45 -0
- package/src/test/runTest.ts +1 -1
- package/src/types/Adapter.ts +2 -4
- package/src/types/ClientState.ts +8 -0
- package/src/types/InternalState.ts +7 -0
- package/src/types/LayoutHandler.ts +2 -4
- package/src/types/LayoutPath.ts +10 -0
- package/src/types/ManifestRoute.ts +2 -4
- package/src/types/PageEndPoint.ts +2 -4
- package/src/types/PageLoadEvent.ts +2 -4
- package/src/types/PageServerEndPoint.ts +2 -4
- package/src/types/PageState.ts +8 -0
- package/src/types/RouteHandler.ts +2 -4
- package/src/types/RouteLayoutHandler.ts +2 -4
- package/src/types/RouteMatchResult.ts +2 -4
- package/src/types/ServerHook.ts +3 -7
- package/src/types/ServerLoadEvent.ts +2 -4
- package/src/{site → utils}/pathToRegex.ts +1 -1
- package/{tsup.config.ts → tsdown.config.ts} +3 -4
- package/dist/Server-CNZWh5ca.d.cts +0 -71
- package/dist/Server-CNZWh5ca.d.ts +0 -71
- package/dist/Site-C2020GV_.d.ts +0 -63
- package/dist/Site-DQojGpE-.d.cts +0 -63
- package/dist/bin/index.cjs +0 -778
- package/dist/bin/index.cjs.map +0 -1
- package/dist/bin/index.d.cts +0 -1
- package/dist/chunk-565UOT3F.js +0 -18
- package/dist/chunk-565UOT3F.js.map +0 -1
- package/dist/chunk-B2UNTYN5.js +0 -68
- package/dist/chunk-B2UNTYN5.js.map +0 -1
- package/dist/chunk-CZHJQCPI.js +0 -286
- package/dist/chunk-CZHJQCPI.js.map +0 -1
- package/dist/chunk-PTVHEJZ5.js +0 -152
- package/dist/chunk-PTVHEJZ5.js.map +0 -1
- package/dist/chunk-SJVHHGVW.js +0 -13
- package/dist/chunk-SJVHHGVW.js.map +0 -1
- package/dist/chunk-TDOXEXG6.js +0 -85
- package/dist/chunk-TDOXEXG6.js.map +0 -1
- package/dist/chunk-WVXAN4IV.js +0 -50
- package/dist/chunk-WVXAN4IV.js.map +0 -1
- package/dist/chunk-YRBEYKQM.js +0 -372
- package/dist/chunk-YRBEYKQM.js.map +0 -1
- package/dist/index.cjs +0 -322
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -199
- package/dist/metafile-cjs.json +0 -1
- package/dist/metafile-esm.json +0 -1
- package/dist/response.cjs +0 -150
- package/dist/response.cjs.map +0 -1
- package/dist/response.d.cts +0 -166
- package/dist/response.js.map +0 -1
- package/dist/run.cjs +0 -787
- package/dist/run.cjs.map +0 -1
- package/dist/run.d.cts +0 -14
- package/dist/run.js.map +0 -1
- package/dist/server.cjs +0 -398
- package/dist/server.cjs.map +0 -1
- package/dist/server.d.cts +0 -17
- package/dist/server.js.map +0 -1
- package/dist/state.cjs +0 -44
- package/dist/state.cjs.map +0 -1
- package/dist/state.d.cts +0 -11
- package/dist/state.js.map +0 -1
- package/dist/test.cjs +0 -538
- package/dist/test.cjs.map +0 -1
- package/dist/test.d.cts +0 -15
- package/src/response/moved.ts +0 -16
- package/src/response/redirect.ts +0 -17
- package/src/state/Page.ts +0 -8
package/dist/metafile-esm.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"inputs":{"src/site/pathToRegex.ts":{"bytes":459,"imports":[],"format":"esm"},"src/site/Router.ts":{"bytes":4384,"imports":[{"path":"src/site/pathToRegex.ts","kind":"import-statement","original":"./pathToRegex"}],"format":"esm"},"src/types/RouteType.ts":{"bytes":488,"imports":[],"format":"esm"},"src/site/defaultAdapter.ts":{"bytes":282,"imports":[{"path":"../types/Adapter","kind":"import-statement","external":true}],"format":"esm"},"src/site/Site.ts":{"bytes":5729,"imports":[{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"vite","kind":"import-statement","external":true},{"path":"vite-tsconfig-paths","kind":"import-statement","external":true},{"path":"src/types/RouteType.ts","kind":"import-statement","original":"../types/RouteType"},{"path":"src/site/defaultAdapter.ts","kind":"import-statement","original":"./defaultAdapter"}],"format":"esm"},"src/index.ts":{"bytes":838,"imports":[{"path":"src/site/Router.ts","kind":"import-statement","original":"./site/Router"},{"path":"src/site/Site.ts","kind":"import-statement","original":"./site/Site"}],"format":"esm"},"src/response/response.ts":{"bytes":691,"imports":[],"format":"esm"},"src/response/badRequest.ts":{"bytes":468,"imports":[{"path":"src/response/response.ts","kind":"import-statement","original":"./response"}],"format":"esm"},"src/response/created.ts":{"bytes":384,"imports":[{"path":"src/response/response.ts","kind":"import-statement","original":"./response"}],"format":"esm"},"src/response/forbidden.ts":{"bytes":473,"imports":[{"path":"src/response/response.ts","kind":"import-statement","original":"./response"}],"format":"esm"},"src/response/methodNotAllowed.ts":{"bytes":443,"imports":[{"path":"src/response/response.ts","kind":"import-statement","original":"./response"}],"format":"esm"},"src/response/transfer.ts":{"bytes":264,"imports":[],"format":"esm"},"src/response/moved.ts":{"bytes":613,"imports":[{"path":"src/response/transfer.ts","kind":"import-statement","original":"./transfer"}],"format":"esm"},"src/response/notFound.ts":{"bytes":686,"imports":[{"path":"src/response/response.ts","kind":"import-statement","original":"./response"}],"format":"esm"},"src/response/notModified.ts":{"bytes":419,"imports":[{"path":"src/response/transfer.ts","kind":"import-statement","original":"./transfer"}],"format":"esm"},"src/response/ok.ts":{"bytes":684,"imports":[{"path":"src/response/response.ts","kind":"import-statement","original":"./response"}],"format":"esm"},"src/response/redirect.ts":{"bytes":640,"imports":[{"path":"src/response/transfer.ts","kind":"import-statement","original":"./transfer"}],"format":"esm"},"src/response/seeOther.ts":{"bytes":355,"imports":[{"path":"src/response/transfer.ts","kind":"import-statement","original":"./transfer"}],"format":"esm"},"src/response/serverError.ts":{"bytes":333,"imports":[{"path":"src/response/response.ts","kind":"import-statement","original":"./response"}],"format":"esm"},"src/response/unauthorized.ts":{"bytes":450,"imports":[{"path":"src/response/response.ts","kind":"import-statement","original":"./response"}],"format":"esm"},"src/response/unprocessable.ts":{"bytes":356,"imports":[{"path":"src/response/response.ts","kind":"import-statement","original":"./response"}],"format":"esm"},"src/response.ts":{"bytes":886,"imports":[{"path":"src/response/badRequest.ts","kind":"import-statement","original":"./response/badRequest"},{"path":"src/response/created.ts","kind":"import-statement","original":"./response/created"},{"path":"src/response/forbidden.ts","kind":"import-statement","original":"./response/forbidden"},{"path":"src/response/methodNotAllowed.ts","kind":"import-statement","original":"./response/methodNotAllowed"},{"path":"src/response/moved.ts","kind":"import-statement","original":"./response/moved"},{"path":"src/response/notFound.ts","kind":"import-statement","original":"./response/notFound"},{"path":"src/response/notModified.ts","kind":"import-statement","original":"./response/notModified"},{"path":"src/response/ok.ts","kind":"import-statement","original":"./response/ok"},{"path":"src/response/redirect.ts","kind":"import-statement","original":"./response/redirect"},{"path":"src/response/response.ts","kind":"import-statement","original":"./response/response"},{"path":"src/response/seeOther.ts","kind":"import-statement","original":"./response/seeOther"},{"path":"src/response/serverError.ts","kind":"import-statement","original":"./response/serverError"},{"path":"src/response/transfer.ts","kind":"import-statement","original":"./response/transfer"},{"path":"src/response/unauthorized.ts","kind":"import-statement","original":"./response/unauthorized"},{"path":"src/response/unprocessable.ts","kind":"import-statement","original":"./response/unprocessable"}],"format":"esm"},"src/site/manifest.ts":{"bytes":1553,"imports":[{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"vite","kind":"import-statement","external":true},{"path":"./Site","kind":"import-statement","external":true}],"format":"esm"},"src/site/runBuild.ts":{"bytes":2902,"imports":[{"path":"@torpor/unplugin/vite","kind":"import-statement","external":true},{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"vite","kind":"import-statement","external":true},{"path":"./Site.ts","kind":"import-statement","external":true},{"path":"src/site/manifest.ts","kind":"import-statement","original":"./manifest.ts"}],"format":"esm"},"src/server/CookieHelper.ts":{"bytes":1078,"imports":[{"path":"cookie","kind":"import-statement","external":true}],"format":"esm"},"src/server/HeaderHelper.ts":{"bytes":571,"imports":[],"format":"esm"},"src/server/ServerEvent.ts":{"bytes":974,"imports":[{"path":"src/server/CookieHelper.ts","kind":"import-statement","original":"./CookieHelper"},{"path":"src/server/HeaderHelper.ts","kind":"import-statement","original":"./HeaderHelper"}],"format":"esm"},"src/server/Server.ts":{"bytes":3639,"imports":[{"path":"src/site/pathToRegex.ts","kind":"import-statement","original":"../site/pathToRegex"},{"path":"src/server/ServerEvent.ts","kind":"import-statement","original":"./ServerEvent"}],"format":"esm"},"src/server/connect/bufferToArrayBuffer.ts":{"bytes":260,"imports":[],"format":"esm"},"src/server/connect/flattenHeaders.ts":{"bytes":1017,"imports":[{"path":"node:http","kind":"import-statement","external":true},{"path":"node:http2","kind":"import-statement","external":true}],"format":"esm"},"src/server/connect/nodeMessageToNodeResponse.ts":{"bytes":2363,"imports":[{"path":"http","kind":"import-statement","external":true},{"path":"stream","kind":"import-statement","external":true}],"format":"esm"},"src/server/connect/readableToBuffer.ts":{"bytes":388,"imports":[{"path":"node:stream","kind":"import-statement","external":true}],"format":"esm"},"src/server/connect/requestToNodeMessage.ts":{"bytes":1109,"imports":[{"path":"node:http","kind":"import-statement","external":true},{"path":"stream","kind":"import-statement","external":true}],"format":"esm"},"src/server/connect/connectMiddleware.ts":{"bytes":2733,"imports":[{"path":"node:http","kind":"import-statement","external":true},{"path":"src/server/connect/bufferToArrayBuffer.ts","kind":"import-statement","original":"./bufferToArrayBuffer"},{"path":"src/server/connect/flattenHeaders.ts","kind":"import-statement","original":"./flattenHeaders"},{"path":"src/server/connect/nodeMessageToNodeResponse.ts","kind":"import-statement","original":"./nodeMessageToNodeResponse"},{"path":"src/server/connect/readableToBuffer.ts","kind":"import-statement","original":"./readableToBuffer"},{"path":"src/server/connect/requestToNodeMessage.ts","kind":"import-statement","original":"./requestToNodeMessage"}],"format":"esm"},"src/site/prepareTemplate.ts":{"bytes":1281,"imports":[],"format":"esm"},"src/site/runDev.ts":{"bytes":3655,"imports":[{"path":"@torpor/unplugin/esbuild","kind":"import-statement","external":true},{"path":"@torpor/unplugin/vite","kind":"import-statement","external":true},{"path":"dotenv","kind":"import-statement","external":true},{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"vite","kind":"import-statement","external":true},{"path":"src/response.ts","kind":"import-statement","original":"../response.ts"},{"path":"src/server/Server.ts","kind":"import-statement","original":"../server/Server.ts"},{"path":"src/server/connect/connectMiddleware.ts","kind":"import-statement","original":"../server/connect/connectMiddleware.ts"},{"path":"./Site.ts","kind":"import-statement","external":true},{"path":"src/site/manifest.ts","kind":"import-statement","original":"./manifest.ts"},{"path":"src/site/prepareTemplate.ts","kind":"import-statement","original":"./prepareTemplate.ts"}],"format":"esm"},"src/server/contentType.ts":{"bytes":2679,"imports":[],"format":"esm"},"src/site/runPreview.ts":{"bytes":2833,"imports":[{"path":"dotenv","kind":"import-statement","external":true},{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"src/response.ts","kind":"import-statement","original":"../response.ts"},{"path":"src/server/Server.ts","kind":"import-statement","original":"../server/Server.ts"},{"path":"src/server/contentType.ts","kind":"import-statement","original":"../server/contentType.ts"},{"path":"./Site","kind":"import-statement","external":true},{"path":"src/site/prepareTemplate.ts","kind":"import-statement","original":"./prepareTemplate.ts"},{"path":"src/site/runBuild.ts","kind":"import-statement","original":"./runBuild"}],"format":"esm"},"src/site/run.ts":{"bytes":1695,"imports":[{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"vite","kind":"import-statement","external":true},{"path":"./Site","kind":"import-statement","external":true},{"path":"src/site/runBuild.ts","kind":"import-statement","original":"./runBuild"},{"path":"src/site/runDev.ts","kind":"import-statement","original":"./runDev"},{"path":"src/site/runPreview.ts","kind":"import-statement","original":"./runPreview"}],"format":"esm"},"src/run.ts":{"bytes":197,"imports":[{"path":"src/site/run.ts","kind":"import-statement","original":"./site/run"},{"path":"src/site/runBuild.ts","kind":"import-statement","original":"./site/runBuild"},{"path":"src/site/runDev.ts","kind":"import-statement","original":"./site/runDev"},{"path":"src/site/runPreview.ts","kind":"import-statement","original":"./site/runPreview"}],"format":"esm"},"src/server.ts":{"bytes":334,"imports":[{"path":"src/server/CookieHelper.ts","kind":"import-statement","original":"./server/CookieHelper"},{"path":"src/server/HeaderHelper.ts","kind":"import-statement","original":"./server/HeaderHelper"},{"path":"src/server/Server.ts","kind":"import-statement","original":"./server/Server"},{"path":"src/server/ServerEvent.ts","kind":"import-statement","original":"./server/ServerEvent"},{"path":"src/server/connect/connectMiddleware.ts","kind":"import-statement","original":"./server/connect/connectMiddleware"}],"format":"esm"},"src/state/$page.ts":{"bytes":231,"imports":[{"path":"@torpor/view","kind":"import-statement","external":true},{"path":"./Page","kind":"import-statement","external":true}],"format":"esm"},"src/state.ts":{"bytes":54,"imports":[{"path":"src/state/$page.ts","kind":"import-statement","original":"./state/$page"}],"format":"esm"},"src/test/runTest.ts":{"bytes":9879,"imports":[{"path":"@torpor/view","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"src/response/notFound.ts","kind":"import-statement","original":"../response/notFound.ts"},{"path":"src/response/ok.ts","kind":"import-statement","original":"../response/ok.ts"},{"path":"src/response/seeOther.ts","kind":"import-statement","original":"../response/seeOther.ts"},{"path":"src/server/ServerEvent.ts","kind":"import-statement","original":"../server/ServerEvent.ts"},{"path":"src/site/Router.ts","kind":"import-statement","original":"../site/Router.ts"},{"path":"../site/Site","kind":"import-statement","external":true},{"path":"src/state/$page.ts","kind":"import-statement","original":"../state/$page.ts"},{"path":"../types/RouteHandler.ts","kind":"import-statement","external":true},{"path":"src/types/RouteType.ts","kind":"import-statement","original":"../types/RouteType"}],"format":"esm"},"src/test.ts":{"bytes":59,"imports":[{"path":"src/test/runTest.ts","kind":"import-statement","original":"./test/runTest"}],"format":"esm"},"src/bin/index.ts":{"bytes":351,"imports":[{"path":"src/site/run.ts","kind":"import-statement","original":"../site/run"}],"format":"esm"}},"outputs":{"dist/index.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":9518},"dist/index.js":{"imports":[{"path":"dist/chunk-PTVHEJZ5.js","kind":"import-statement"},{"path":"dist/chunk-SJVHHGVW.js","kind":"import-statement"},{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"vite-tsconfig-paths","kind":"import-statement","external":true}],"exports":["Router","Site"],"entryPoint":"src/index.ts","inputs":{"src/site/Site.ts":{"bytesInOutput":4640},"src/site/defaultAdapter.ts":{"bytesInOutput":154},"src/index.ts":{"bytesInOutput":0}},"bytes":5114},"dist/response.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/response.js":{"imports":[{"path":"dist/chunk-B2UNTYN5.js","kind":"import-statement"},{"path":"dist/chunk-WVXAN4IV.js","kind":"import-statement"}],"exports":["badRequest","created","forbidden","methodNotAllowed","moved","notFound","notModified","ok","redirect","response","seeOther","serverError","transfer","unauthorized","unprocessable"],"entryPoint":"src/response.ts","inputs":{},"bytes":479},"dist/run.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/run.js":{"imports":[{"path":"dist/chunk-YRBEYKQM.js","kind":"import-statement"},{"path":"dist/chunk-B2UNTYN5.js","kind":"import-statement"},{"path":"dist/chunk-CZHJQCPI.js","kind":"import-statement"},{"path":"dist/chunk-WVXAN4IV.js","kind":"import-statement"},{"path":"dist/chunk-TDOXEXG6.js","kind":"import-statement"},{"path":"dist/chunk-SJVHHGVW.js","kind":"import-statement"}],"exports":["run","runBuild","runDev","runPreview"],"entryPoint":"src/run.ts","inputs":{"src/run.ts":{"bytesInOutput":0}},"bytes":285},"dist/server.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/server.js":{"imports":[{"path":"dist/chunk-CZHJQCPI.js","kind":"import-statement"},{"path":"dist/chunk-TDOXEXG6.js","kind":"import-statement"},{"path":"dist/chunk-SJVHHGVW.js","kind":"import-statement"}],"exports":["CookieHelper","HeaderHelper","Server","ServerEvent","connectMiddleware"],"entryPoint":"src/server.ts","inputs":{"src/server.ts":{"bytesInOutput":0}},"bytes":273},"dist/state.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/state.js":{"imports":[{"path":"dist/chunk-565UOT3F.js","kind":"import-statement"}],"exports":["$page"],"entryPoint":"src/state.ts","inputs":{"src/state.ts":{"bytesInOutput":0}},"bytes":90},"dist/test.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":15687},"dist/test.js":{"imports":[{"path":"dist/chunk-PTVHEJZ5.js","kind":"import-statement"},{"path":"dist/chunk-565UOT3F.js","kind":"import-statement"},{"path":"dist/chunk-WVXAN4IV.js","kind":"import-statement"},{"path":"dist/chunk-TDOXEXG6.js","kind":"import-statement"},{"path":"dist/chunk-SJVHHGVW.js","kind":"import-statement"},{"path":"path","kind":"import-statement","external":true}],"exports":["runTest"],"entryPoint":"src/test.ts","inputs":{"src/test/runTest.ts":{"bytesInOutput":6540},"src/test.ts":{"bytesInOutput":0}},"bytes":6964},"dist/chunk-PTVHEJZ5.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":8181},"dist/chunk-PTVHEJZ5.js":{"imports":[{"path":"dist/chunk-SJVHHGVW.js","kind":"import-statement"}],"exports":["ERROR_ROUTE","HOOK_ROUTE","HOOK_SERVER_ROUTE","LAYOUT_ROUTE","LAYOUT_SERVER_ROUTE","PAGE_ROUTE","PAGE_SERVER_ROUTE","Router","SERVER_ROUTE"],"inputs":{"src/site/Router.ts":{"bytesInOutput":3398},"src/types/RouteType.ts":{"bytesInOutput":188}},"bytes":3851},"dist/chunk-565UOT3F.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":573},"dist/chunk-565UOT3F.js":{"imports":[{"path":"@torpor/view","kind":"import-statement","external":true}],"exports":["page_default"],"inputs":{"src/state/$page.ts":{"bytesInOutput":209}},"bytes":259},"dist/bin/index.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":771},"dist/bin/index.js":{"imports":[{"path":"dist/chunk-YRBEYKQM.js","kind":"import-statement"},{"path":"dist/chunk-B2UNTYN5.js","kind":"import-statement"},{"path":"dist/chunk-CZHJQCPI.js","kind":"import-statement"},{"path":"dist/chunk-WVXAN4IV.js","kind":"import-statement"},{"path":"dist/chunk-TDOXEXG6.js","kind":"import-statement"},{"path":"dist/chunk-SJVHHGVW.js","kind":"import-statement"}],"exports":[],"entryPoint":"src/bin/index.ts","inputs":{"src/bin/index.ts":{"bytesInOutput":309}},"bytes":552},"dist/chunk-YRBEYKQM.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":26540},"dist/chunk-YRBEYKQM.js":{"imports":[{"path":"dist/chunk-B2UNTYN5.js","kind":"import-statement"},{"path":"dist/chunk-CZHJQCPI.js","kind":"import-statement"},{"path":"@torpor/unplugin/vite","kind":"import-statement","external":true},{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"vite","kind":"import-statement","external":true},{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"@torpor/unplugin/esbuild","kind":"import-statement","external":true},{"path":"@torpor/unplugin/vite","kind":"import-statement","external":true},{"path":"dotenv","kind":"import-statement","external":true},{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"vite","kind":"import-statement","external":true},{"path":"dotenv","kind":"import-statement","external":true},{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"vite","kind":"import-statement","external":true}],"exports":["run","runBuild","runDev","runPreview"],"inputs":{"src/site/runBuild.ts":{"bytesInOutput":2154},"src/site/manifest.ts":{"bytesInOutput":1168},"src/site/runDev.ts":{"bytesInOutput":1743},"src/site/prepareTemplate.ts":{"bytesInOutput":938},"src/site/runPreview.ts":{"bytesInOutput":1883},"src/server/contentType.ts":{"bytesInOutput":2608},"src/site/run.ts":{"bytesInOutput":1333}},"bytes":12261},"dist/chunk-B2UNTYN5.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":5823},"dist/chunk-B2UNTYN5.js":{"imports":[{"path":"dist/chunk-WVXAN4IV.js","kind":"import-statement"}],"exports":["badRequest","created","forbidden","methodNotAllowed","moved","notModified","redirect","serverError","unauthorized","unprocessable"],"inputs":{"src/response/badRequest.ts":{"bytesInOutput":77},"src/response/created.ts":{"bytesInOutput":57},"src/response/forbidden.ts":{"bytesInOutput":74},"src/response/methodNotAllowed.ts":{"bytesInOutput":90},"src/response/moved.ts":{"bytesInOutput":63},"src/response/notModified.ts":{"bytesInOutput":69},"src/response/redirect.ts":{"bytesInOutput":66},"src/response/serverError.ts":{"bytesInOutput":79},"src/response/unauthorized.ts":{"bytesInOutput":80},"src/response/unprocessable.ts":{"bytesInOutput":82},"src/response.ts":{"bytesInOutput":0}},"bytes":1265},"dist/chunk-CZHJQCPI.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":18219},"dist/chunk-CZHJQCPI.js":{"imports":[{"path":"dist/chunk-TDOXEXG6.js","kind":"import-statement"},{"path":"dist/chunk-SJVHHGVW.js","kind":"import-statement"},{"path":"http","kind":"import-statement","external":true},{"path":"stream","kind":"import-statement","external":true},{"path":"stream","kind":"import-statement","external":true}],"exports":["Server","connectMiddleware"],"inputs":{"src/server/Server.ts":{"bytesInOutput":2756},"src/server/connect/bufferToArrayBuffer.ts":{"bytesInOutput":141},"src/server/connect/flattenHeaders.ts":{"bytesInOutput":472},"src/server/connect/nodeMessageToNodeResponse.ts":{"bytesInOutput":1380},"src/server/connect/readableToBuffer.ts":{"bytesInOutput":304},"src/server/connect/requestToNodeMessage.ts":{"bytesInOutput":513},"src/server/connect/connectMiddleware.ts":{"bytesInOutput":1402}},"bytes":7415},"dist/chunk-WVXAN4IV.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":3655},"dist/chunk-WVXAN4IV.js":{"imports":[],"exports":["notFound","ok","response","seeOther","transfer"],"inputs":{"src/response/response.ts":{"bytesInOutput":334},"src/response/transfer.ts":{"bytesInOutput":124},"src/response/notFound.ts":{"bytesInOutput":73},"src/response/ok.ts":{"bytesInOutput":52},"src/response/seeOther.ts":{"bytesInOutput":66}},"bytes":853},"dist/chunk-TDOXEXG6.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":4628},"dist/chunk-TDOXEXG6.js":{"imports":[{"path":"cookie","kind":"import-statement","external":true}],"exports":["CookieHelper","HeaderHelper","ServerEvent"],"inputs":{"src/server/CookieHelper.ts":{"bytesInOutput":747},"src/server/HeaderHelper.ts":{"bytesInOutput":397},"src/server/ServerEvent.ts":{"bytesInOutput":696}},"bytes":1990},"dist/chunk-SJVHHGVW.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":860},"dist/chunk-SJVHHGVW.js":{"imports":[],"exports":["pathToRegex"],"inputs":{"src/site/pathToRegex.ts":{"bytesInOutput":301}},"bytes":355}}}
|
package/dist/response.cjs
DELETED
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/response.ts
|
|
21
|
-
var response_exports = {};
|
|
22
|
-
__export(response_exports, {
|
|
23
|
-
badRequest: () => badRequest,
|
|
24
|
-
created: () => created,
|
|
25
|
-
forbidden: () => forbidden,
|
|
26
|
-
methodNotAllowed: () => methodNotAllowed,
|
|
27
|
-
moved: () => moved,
|
|
28
|
-
notFound: () => notFound,
|
|
29
|
-
notModified: () => notModified,
|
|
30
|
-
ok: () => ok,
|
|
31
|
-
redirect: () => redirect,
|
|
32
|
-
response: () => response,
|
|
33
|
-
seeOther: () => seeOther,
|
|
34
|
-
serverError: () => serverError,
|
|
35
|
-
transfer: () => transfer,
|
|
36
|
-
unauthorized: () => unauthorized,
|
|
37
|
-
unprocessable: () => unprocessable
|
|
38
|
-
});
|
|
39
|
-
module.exports = __toCommonJS(response_exports);
|
|
40
|
-
|
|
41
|
-
// src/response/response.ts
|
|
42
|
-
function response(status, body) {
|
|
43
|
-
let headers = void 0;
|
|
44
|
-
if (body) {
|
|
45
|
-
if (typeof body === "object") {
|
|
46
|
-
headers = { "content-type": "application/json" };
|
|
47
|
-
body = JSON.stringify(body);
|
|
48
|
-
} else {
|
|
49
|
-
headers = { "content-type": "text/plain" };
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
return new Response(body, {
|
|
53
|
-
status,
|
|
54
|
-
headers
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
// src/response/badRequest.ts
|
|
59
|
-
function badRequest(body) {
|
|
60
|
-
return response(400, body ?? "Bad request");
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// src/response/created.ts
|
|
64
|
-
function created(body) {
|
|
65
|
-
return response(201, body);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// src/response/forbidden.ts
|
|
69
|
-
function forbidden(body) {
|
|
70
|
-
return response(403, body ?? "Forbidden");
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
// src/response/methodNotAllowed.ts
|
|
74
|
-
function methodNotAllowed(body) {
|
|
75
|
-
return response(405, body ?? "Method not allowed");
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
// src/response/transfer.ts
|
|
79
|
-
function transfer(status, location) {
|
|
80
|
-
return new Response(null, {
|
|
81
|
-
status,
|
|
82
|
-
headers: {
|
|
83
|
-
location
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
// src/response/moved.ts
|
|
89
|
-
function moved(location) {
|
|
90
|
-
return transfer(308, location);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
// src/response/notFound.ts
|
|
94
|
-
function notFound(body) {
|
|
95
|
-
return response(404, body ?? "Not found");
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
// src/response/notModified.ts
|
|
99
|
-
function notModified(location) {
|
|
100
|
-
return transfer(304, location);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
// src/response/ok.ts
|
|
104
|
-
function ok(body) {
|
|
105
|
-
return response(200, body);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
// src/response/redirect.ts
|
|
109
|
-
function redirect(location) {
|
|
110
|
-
return transfer(307, location);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
// src/response/seeOther.ts
|
|
114
|
-
function seeOther(location) {
|
|
115
|
-
return transfer(303, location);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
// src/response/serverError.ts
|
|
119
|
-
function serverError(body) {
|
|
120
|
-
return response(500, body ?? "Server error");
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
// src/response/unauthorized.ts
|
|
124
|
-
function unauthorized(body) {
|
|
125
|
-
return response(401, body ?? "Unauthorized");
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
// src/response/unprocessable.ts
|
|
129
|
-
function unprocessable(body) {
|
|
130
|
-
return response(422, body ?? "Unprocessable");
|
|
131
|
-
}
|
|
132
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
133
|
-
0 && (module.exports = {
|
|
134
|
-
badRequest,
|
|
135
|
-
created,
|
|
136
|
-
forbidden,
|
|
137
|
-
methodNotAllowed,
|
|
138
|
-
moved,
|
|
139
|
-
notFound,
|
|
140
|
-
notModified,
|
|
141
|
-
ok,
|
|
142
|
-
redirect,
|
|
143
|
-
response,
|
|
144
|
-
seeOther,
|
|
145
|
-
serverError,
|
|
146
|
-
transfer,
|
|
147
|
-
unauthorized,
|
|
148
|
-
unprocessable
|
|
149
|
-
});
|
|
150
|
-
//# sourceMappingURL=response.cjs.map
|
package/dist/response.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/response.ts","../src/response/response.ts","../src/response/badRequest.ts","../src/response/created.ts","../src/response/forbidden.ts","../src/response/methodNotAllowed.ts","../src/response/transfer.ts","../src/response/moved.ts","../src/response/notFound.ts","../src/response/notModified.ts","../src/response/ok.ts","../src/response/redirect.ts","../src/response/seeOther.ts","../src/response/serverError.ts","../src/response/unauthorized.ts","../src/response/unprocessable.ts"],"sourcesContent":["import badRequest from \"./response/badRequest\";\nimport created from \"./response/created\";\nimport forbidden from \"./response/forbidden\";\nimport methodNotAllowed from \"./response/methodNotAllowed\";\nimport moved from \"./response/moved\";\nimport notFound from \"./response/notFound\";\nimport notModified from \"./response/notModified\";\nimport ok from \"./response/ok\";\nimport redirect from \"./response/redirect\";\nimport response from \"./response/response\";\nimport seeOther from \"./response/seeOther\";\nimport serverError from \"./response/serverError\";\nimport transfer from \"./response/transfer\";\nimport unauthorized from \"./response/unauthorized\";\nimport unprocessable from \"./response/unprocessable\";\n\nexport {\n\tresponse,\n\tok,\n\tcreated,\n\ttransfer,\n\tseeOther,\n\tnotModified,\n\tredirect,\n\tmoved,\n\tbadRequest,\n\tunauthorized,\n\tforbidden,\n\tnotFound,\n\tmethodNotAllowed,\n\tunprocessable,\n\tserverError,\n};\n","/**\n * Creates a response with the supplied status code and optional body.\n *\n * If the body is an object, it will be converted to JSON and the content-type\n * header set to \"application/json\". Otherwise, if the body is a string, the\n * content-type header will be set to \"text/plain\".\n */\nexport default function response(status: number, body?: object | string): Response {\n\tlet headers: Record<string, string> | undefined = undefined;\n\tif (body) {\n\t\tif (typeof body === \"object\") {\n\t\t\theaders = { \"content-type\": \"application/json\" };\n\t\t\tbody = JSON.stringify(body);\n\t\t} else {\n\t\t\theaders = { \"content-type\": \"text/plain\" };\n\t\t}\n\t}\n\treturn new Response(body, {\n\t\tstatus,\n\t\theaders,\n\t});\n}\n","import response from \"./response\";\n\n/**\n * 400 Bad Request\n *\n * The server cannot or will not process the request due to something that is\n * perceived to be a client error (e.g., malformed request syntax, invalid\n * request message framing, or deceptive request routing).\n *\n * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400\n */\nexport default function badRequest(body?: object | string): Response {\n\treturn response(400, body ?? \"Bad request\");\n}\n","import response from \"./response\";\n\n/**\n * 201 Created\n *\n * The request succeeded, and a new resource was created as a result. This is\n * typically the response sent after POST requests, or some PUT requests.\n *\n * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/201\n */\nexport default function created(body?: object | string): Response {\n\treturn response(201, body);\n}\n","import response from \"./response\";\n\n/**\n * 403 Forbidden\n *\n * The client does not have access rights to the content; that is, it is\n * unauthorized, so the server is refusing to give the requested resource.\n * Unlike 401 Unauthorized, the client's identity is known to the server.\n *\n * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403\n */\nexport default function forbidden(body?: object | string): Response {\n\treturn response(403, body ?? \"Forbidden\");\n}\n","import response from \"./response\";\n\n/**\n * 405 Method Not Allowed\n *\n * The request method is known by the server but is not supported by the target\n * resource. For example, an API may not allow calling DELETE to remove a\n * resource.\n *\n * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/405\n */\nexport default function methodNotAllowed(body?: object | string): Response {\n\treturn response(405, body ?? \"Method not allowed\");\n}\n","/**\n * Creates a redirect response with the supplied status code.\n */\nexport default function transfer(\n\tstatus: 300 | 301 | 302 | 303 | 304 | 307 | 308,\n\tlocation: string,\n): Response {\n\treturn new Response(null, {\n\t\tstatus,\n\t\theaders: {\n\t\t\tlocation,\n\t\t},\n\t});\n}\n","import transfer from \"./transfer\";\n\n/**\n * 308 Permanent Redirect\n *\n * This means that the resource is now permanently located at another URI,\n * specified by the Location: HTTP Response header. This has the same semantics\n * as the 301 Moved Permanently HTTP response code, with the exception that the\n * user agent must not change the HTTP method used: if a POST was used in the\n * first request, a POST must be used in the second request.\n *\n * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/308\n */\nexport default function moved(location: string): Response {\n\treturn transfer(308, location);\n}\n","import response from \"./response\";\n\n/**\n * 404 Not Found\n *\n * The server cannot find the requested resource. In the browser, this means the\n * URL is not recognized. In an API, this can also mean that the endpoint is\n * valid but the resource itself does not exist. Servers may also send this\n * response instead of 403 Forbidden to hide the existence of a resource from an\n * unauthorized client. This response code is probably the most well known due\n * to its frequent occurrence on the web.\n *\n * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/404\n */\nexport default function notFound(body?: object | string): Response {\n\treturn response(404, body ?? \"Not found\");\n}\n","import transfer from \"./transfer\";\n\n/**\n * 304 Not Modified\n *\n * This is used for caching purposes. It tells the client that the response has\n * not been modified, so the client can continue to use the same cached version\n * of the response.\n *\n * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/304\n */\nexport default function notModified(location: string): Response {\n\treturn transfer(304, location);\n}\n","import response from \"./response\";\n\n/**\n * 200 OK\n *\n * The request succeeded. The result meaning of \"success\" depends on the HTTP\n * method:\n * - GET: The resource has been fetched and transmitted in the message body.\n * - HEAD: The representation headers are included in the response without any\n * message body.\n * - PUT or POST: The resource describing the result of the action is\n * transmitted in the message body.\n * - TRACE: The message body contains the request message as received by the\n * server.\n *\n * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/200\n */\nexport default function ok(body?: object | string): Response {\n\treturn response(200, body);\n}\n","import transfer from \"./transfer\";\n\n/**\n * 307 Temporary Redirect\n *\n * The server sends this response to direct the client to get the requested\n * resource at another URI with the same method that was used in the prior\n * request. This has the same semantics as the 302 Found HTTP response code,\n * with the exception that the user agent must not change the HTTP method used:\n * if a POST was used in the first request, a POST must be used in the second\n * request.\n *\n * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/307\n */\nexport default function redirect(location: string): Response {\n\treturn transfer(307, location);\n}\n","import transfer from \"./transfer\";\n\n/**\n * 303 See Other\n *\n * The server sent this response to direct the client to get the requested\n * resource at another URI with a GET request.\n *\n * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/303\n */\nexport default function seeOther(location: string): Response {\n\treturn transfer(303, location);\n}\n","import response from \"./response\";\n\n/**\n * 500 Server Error\n *\n * The server has encountered a situation it does not know how to handle.\n *\n * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500\n */\nexport default function serverError(body?: object | string): Response {\n\treturn response(500, body ?? \"Server error\");\n}\n","import response from \"./response\";\n\n/**\n * 401 Unauthorized\n *\n * Although the HTTP standard specifies \"unauthorized\", semantically this\n * response means \"unauthenticated\". That is, the client must authenticate\n * itself to get the requested response.\n *\n * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/401\n */\nexport default function unauthorized(body?: object | string): Response {\n\treturn response(401, body ?? \"Unauthorized\");\n}\n","import response from \"./response\";\n\n/**\n * 422 Unprocessable Content\n *\n * The request was well-formed but was unable to be followed due to semantic errors.\n *\n * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/422\n */\nexport default function unprocessable(body?: object | string): Response {\n\treturn response(422, body ?? \"Unprocessable\");\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACOe,SAAR,SAA0B,QAAgB,MAAkC;AAClF,MAAI,UAA8C;AAClD,MAAI,MAAM;AACT,QAAI,OAAO,SAAS,UAAU;AAC7B,gBAAU,EAAE,gBAAgB,mBAAmB;AAC/C,aAAO,KAAK,UAAU,IAAI;AAAA,IAC3B,OAAO;AACN,gBAAU,EAAE,gBAAgB,aAAa;AAAA,IAC1C;AAAA,EACD;AACA,SAAO,IAAI,SAAS,MAAM;AAAA,IACzB;AAAA,IACA;AAAA,EACD,CAAC;AACF;;;ACVe,SAAR,WAA4B,MAAkC;AACpE,SAAO,SAAS,KAAK,QAAQ,aAAa;AAC3C;;;ACHe,SAAR,QAAyB,MAAkC;AACjE,SAAO,SAAS,KAAK,IAAI;AAC1B;;;ACDe,SAAR,UAA2B,MAAkC;AACnE,SAAO,SAAS,KAAK,QAAQ,WAAW;AACzC;;;ACFe,SAAR,iBAAkC,MAAkC;AAC1E,SAAO,SAAS,KAAK,QAAQ,oBAAoB;AAClD;;;ACVe,SAAR,SACN,QACA,UACW;AACX,SAAO,IAAI,SAAS,MAAM;AAAA,IACzB;AAAA,IACA,SAAS;AAAA,MACR;AAAA,IACD;AAAA,EACD,CAAC;AACF;;;ACAe,SAAR,MAAuB,UAA4B;AACzD,SAAO,SAAS,KAAK,QAAQ;AAC9B;;;ACDe,SAAR,SAA0B,MAAkC;AAClE,SAAO,SAAS,KAAK,QAAQ,WAAW;AACzC;;;ACLe,SAAR,YAA6B,UAA4B;AAC/D,SAAO,SAAS,KAAK,QAAQ;AAC9B;;;ACIe,SAAR,GAAoB,MAAkC;AAC5D,SAAO,SAAS,KAAK,IAAI;AAC1B;;;ACLe,SAAR,SAA0B,UAA4B;AAC5D,SAAO,SAAS,KAAK,QAAQ;AAC9B;;;ACNe,SAAR,SAA0B,UAA4B;AAC5D,SAAO,SAAS,KAAK,QAAQ;AAC9B;;;ACHe,SAAR,YAA6B,MAAkC;AACrE,SAAO,SAAS,KAAK,QAAQ,cAAc;AAC5C;;;ACAe,SAAR,aAA8B,MAAkC;AACtE,SAAO,SAAS,KAAK,QAAQ,cAAc;AAC5C;;;ACJe,SAAR,cAA+B,MAAkC;AACvE,SAAO,SAAS,KAAK,QAAQ,eAAe;AAC7C;","names":[]}
|
package/dist/response.d.cts
DELETED
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
/**
|
|
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
|
-
*/
|
|
10
|
-
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
|
-
*/
|
|
20
|
-
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
|
-
*/
|
|
31
|
-
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
|
-
*/
|
|
42
|
-
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
|
-
*/
|
|
69
|
-
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
|
-
*/
|
|
80
|
-
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
|
-
*/
|
|
97
|
-
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
|
-
*/
|
|
120
|
-
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
|
-
*/
|
|
130
|
-
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
|
-
*/
|
|
139
|
-
declare function serverError(body?: object | string): Response;
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* Creates a redirect response with the supplied status code.
|
|
143
|
-
*/
|
|
144
|
-
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
|
-
*/
|
|
155
|
-
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
|
-
*/
|
|
164
|
-
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 };
|
package/dist/response.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|