@blazetrails/actionpack 0.0.0-stage → 0.1.0-alpha0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.rdoc +57 -0
- package/dist/abstract-controller/asset-paths.d.ts +18 -0
- package/dist/abstract-controller/asset-paths.js +8 -0
- package/dist/abstract-controller/asset-paths.js.map +1 -0
- package/dist/abstract-controller/base.d.ts +63 -0
- package/dist/abstract-controller/base.js +237 -0
- package/dist/abstract-controller/base.js.map +1 -0
- package/dist/abstract-controller/caching/fragments.d.ts +39 -0
- package/dist/abstract-controller/caching/fragments.js +120 -0
- package/dist/abstract-controller/caching/fragments.js.map +1 -0
- package/dist/abstract-controller/caching.d.ts +40 -0
- package/dist/abstract-controller/caching.js +57 -0
- package/dist/abstract-controller/caching.js.map +1 -0
- package/dist/abstract-controller/callbacks.d.ts +101 -0
- package/dist/abstract-controller/callbacks.js +184 -0
- package/dist/abstract-controller/callbacks.js.map +1 -0
- package/dist/abstract-controller/collector.d.ts +10 -0
- package/dist/abstract-controller/collector.js +73 -0
- package/dist/abstract-controller/collector.js.map +1 -0
- package/dist/abstract-controller/deprecator.d.ts +3 -0
- package/dist/abstract-controller/deprecator.js +7 -0
- package/dist/abstract-controller/deprecator.js.map +1 -0
- package/dist/abstract-controller/error.d.ts +5 -0
- package/dist/abstract-controller/error.js +5 -0
- package/dist/abstract-controller/error.js.map +1 -0
- package/dist/abstract-controller/helpers.d.ts +67 -0
- package/dist/abstract-controller/helpers.js +182 -0
- package/dist/abstract-controller/helpers.js.map +1 -0
- package/dist/abstract-controller/index.d.ts +16 -0
- package/dist/abstract-controller/index.js +15 -0
- package/dist/abstract-controller/index.js.map +1 -0
- package/dist/abstract-controller/logger.d.ts +7 -0
- package/dist/abstract-controller/logger.js +10 -0
- package/dist/abstract-controller/logger.js.map +1 -0
- package/dist/abstract-controller/rendering.d.ts +54 -0
- package/dist/abstract-controller/rendering.js +119 -0
- package/dist/abstract-controller/rendering.js.map +1 -0
- package/dist/abstract-controller/trailties/routes-helpers.d.ts +34 -0
- package/dist/abstract-controller/trailties/routes-helpers.js +151 -0
- package/dist/abstract-controller/trailties/routes-helpers.js.map +1 -0
- package/dist/abstract-controller/translation.d.ts +29 -0
- package/dist/abstract-controller/translation.js +33 -0
- package/dist/abstract-controller/translation.js.map +1 -0
- package/dist/abstract-controller/url-for.d.ts +24 -0
- package/dist/abstract-controller/url-for.js +34 -0
- package/dist/abstract-controller/url-for.js.map +1 -0
- package/dist/action-controller/api/api-rendering.d.ts +6 -0
- package/dist/action-controller/api/api-rendering.js +16 -0
- package/dist/action-controller/api/api-rendering.js.map +1 -0
- package/dist/action-controller/api.d.ts +66 -0
- package/dist/action-controller/api.js +74 -0
- package/dist/action-controller/api.js.map +1 -0
- package/dist/action-controller/base.d.ts +416 -0
- package/dist/action-controller/base.js +154 -0
- package/dist/action-controller/base.js.map +1 -0
- package/dist/action-controller/caching.d.ts +19 -0
- package/dist/action-controller/caching.js +75 -0
- package/dist/action-controller/caching.js.map +1 -0
- package/dist/action-controller/deprecator.d.ts +4 -0
- package/dist/action-controller/deprecator.js +7 -0
- package/dist/action-controller/deprecator.js.map +1 -0
- package/dist/action-controller/form-builder.d.ts +17 -0
- package/dist/action-controller/form-builder.js +18 -0
- package/dist/action-controller/form-builder.js.map +1 -0
- package/dist/action-controller/index.d.ts +31 -0
- package/dist/action-controller/index.js +28 -0
- package/dist/action-controller/index.js.map +1 -0
- package/dist/action-controller/log-subscriber.d.ts +17 -0
- package/dist/action-controller/log-subscriber.js +113 -0
- package/dist/action-controller/log-subscriber.js.map +1 -0
- package/dist/action-controller/metal/allow-browser.d.ts +71 -0
- package/dist/action-controller/metal/allow-browser.js +129 -0
- package/dist/action-controller/metal/allow-browser.js.map +1 -0
- package/dist/action-controller/metal/basic-implicit-render.d.ts +13 -0
- package/dist/action-controller/metal/basic-implicit-render.js +14 -0
- package/dist/action-controller/metal/basic-implicit-render.js.map +1 -0
- package/dist/action-controller/metal/conditional-get.d.ts +57 -0
- package/dist/action-controller/metal/conditional-get.js +96 -0
- package/dist/action-controller/metal/conditional-get.js.map +1 -0
- package/dist/action-controller/metal/content-security-policy.d.ts +37 -0
- package/dist/action-controller/metal/content-security-policy.js +54 -0
- package/dist/action-controller/metal/content-security-policy.js.map +1 -0
- package/dist/action-controller/metal/cookies.d.ts +15 -0
- package/dist/action-controller/metal/cookies.js +15 -0
- package/dist/action-controller/metal/cookies.js.map +1 -0
- package/dist/action-controller/metal/data-streaming.d.ts +48 -0
- package/dist/action-controller/metal/data-streaming.js +76 -0
- package/dist/action-controller/metal/data-streaming.js.map +1 -0
- package/dist/action-controller/metal/default-headers.d.ts +12 -0
- package/dist/action-controller/metal/default-headers.js +13 -0
- package/dist/action-controller/metal/default-headers.js.map +1 -0
- package/dist/action-controller/metal/etag-with-flash.d.ts +2 -0
- package/dist/action-controller/metal/etag-with-flash.js +17 -0
- package/dist/action-controller/metal/etag-with-flash.js.map +1 -0
- package/dist/action-controller/metal/etag-with-template-digest.d.ts +23 -0
- package/dist/action-controller/metal/etag-with-template-digest.js +41 -0
- package/dist/action-controller/metal/etag-with-template-digest.js.map +1 -0
- package/dist/action-controller/metal/exceptions.d.ts +50 -0
- package/dist/action-controller/metal/exceptions.js +88 -0
- package/dist/action-controller/metal/exceptions.js.map +1 -0
- package/dist/action-controller/metal/flash.d.ts +36 -0
- package/dist/action-controller/metal/flash.js +55 -0
- package/dist/action-controller/metal/flash.js.map +1 -0
- package/dist/action-controller/metal/head.d.ts +18 -0
- package/dist/action-controller/metal/head.js +53 -0
- package/dist/action-controller/metal/head.js.map +1 -0
- package/dist/action-controller/metal/helpers.d.ts +38 -0
- package/dist/action-controller/metal/helpers.js +52 -0
- package/dist/action-controller/metal/helpers.js.map +1 -0
- package/dist/action-controller/metal/http-authentication.d.ts +82 -0
- package/dist/action-controller/metal/http-authentication.js +312 -0
- package/dist/action-controller/metal/http-authentication.js.map +1 -0
- package/dist/action-controller/metal/implicit-render.d.ts +47 -0
- package/dist/action-controller/metal/implicit-render.js +63 -0
- package/dist/action-controller/metal/implicit-render.js.map +1 -0
- package/dist/action-controller/metal/instrumentation.d.ts +39 -0
- package/dist/action-controller/metal/instrumentation.js +113 -0
- package/dist/action-controller/metal/instrumentation.js.map +1 -0
- package/dist/action-controller/metal/live.d.ts +109 -0
- package/dist/action-controller/metal/live.js +314 -0
- package/dist/action-controller/metal/live.js.map +1 -0
- package/dist/action-controller/metal/logging.d.ts +14 -0
- package/dist/action-controller/metal/logging.js +10 -0
- package/dist/action-controller/metal/logging.js.map +1 -0
- package/dist/action-controller/metal/mime-responds.d.ts +54 -0
- package/dist/action-controller/metal/mime-responds.js +149 -0
- package/dist/action-controller/metal/mime-responds.js.map +1 -0
- package/dist/action-controller/metal/parameter-encoding.d.ts +28 -0
- package/dist/action-controller/metal/parameter-encoding.js +51 -0
- package/dist/action-controller/metal/parameter-encoding.js.map +1 -0
- package/dist/action-controller/metal/params-wrapper.d.ts +96 -0
- package/dist/action-controller/metal/params-wrapper.js +223 -0
- package/dist/action-controller/metal/params-wrapper.js.map +1 -0
- package/dist/action-controller/metal/permissions-policy.d.ts +15 -0
- package/dist/action-controller/metal/permissions-policy.js +19 -0
- package/dist/action-controller/metal/permissions-policy.js.map +1 -0
- package/dist/action-controller/metal/rate-limiting.d.ts +48 -0
- package/dist/action-controller/metal/rate-limiting.js +32 -0
- package/dist/action-controller/metal/rate-limiting.js.map +1 -0
- package/dist/action-controller/metal/redirecting.d.ts +76 -0
- package/dist/action-controller/metal/redirecting.js +146 -0
- package/dist/action-controller/metal/redirecting.js.map +1 -0
- package/dist/action-controller/metal/renderers.d.ts +37 -0
- package/dist/action-controller/metal/renderers.js +108 -0
- package/dist/action-controller/metal/renderers.js.map +1 -0
- package/dist/action-controller/metal/rendering.d.ts +79 -0
- package/dist/action-controller/metal/rendering.js +165 -0
- package/dist/action-controller/metal/rendering.js.map +1 -0
- package/dist/action-controller/metal/request-forgery-protection.d.ts +269 -0
- package/dist/action-controller/metal/request-forgery-protection.js +494 -0
- package/dist/action-controller/metal/request-forgery-protection.js.map +1 -0
- package/dist/action-controller/metal/rescue.d.ts +16 -0
- package/dist/action-controller/metal/rescue.js +26 -0
- package/dist/action-controller/metal/rescue.js.map +1 -0
- package/dist/action-controller/metal/streaming.d.ts +14 -0
- package/dist/action-controller/metal/streaming.js +18 -0
- package/dist/action-controller/metal/streaming.js.map +1 -0
- package/dist/action-controller/metal/strong-parameters.d.ts +240 -0
- package/dist/action-controller/metal/strong-parameters.js +742 -0
- package/dist/action-controller/metal/strong-parameters.js.map +1 -0
- package/dist/action-controller/metal/testing.d.ts +11 -0
- package/dist/action-controller/metal/testing.js +20 -0
- package/dist/action-controller/metal/testing.js.map +1 -0
- package/dist/action-controller/metal/url-for.d.ts +12 -0
- package/dist/action-controller/metal/url-for.js +42 -0
- package/dist/action-controller/metal/url-for.js.map +1 -0
- package/dist/action-controller/metal.d.ts +68 -0
- package/dist/action-controller/metal.js +231 -0
- package/dist/action-controller/metal.js.map +1 -0
- package/dist/action-controller/renderer.d.ts +37 -0
- package/dist/action-controller/renderer.js +99 -0
- package/dist/action-controller/renderer.js.map +1 -0
- package/dist/action-controller/template-assertions.d.ts +8 -0
- package/dist/action-controller/template-assertions.js +8 -0
- package/dist/action-controller/template-assertions.js.map +1 -0
- package/dist/action-controller/test-case.d.ts +188 -0
- package/dist/action-controller/test-case.js +526 -0
- package/dist/action-controller/test-case.js.map +1 -0
- package/dist/action-controller/trailties/helpers.d.ts +9 -0
- package/dist/action-controller/trailties/helpers.js +23 -0
- package/dist/action-controller/trailties/helpers.js.map +1 -0
- package/dist/action-dispatch/action-dispatch.d.ts +4 -0
- package/dist/action-dispatch/action-dispatch.js +6 -0
- package/dist/action-dispatch/action-dispatch.js.map +1 -0
- package/dist/action-dispatch/constants.d.ts +12 -0
- package/dist/action-dispatch/constants.js +44 -0
- package/dist/action-dispatch/constants.js.map +1 -0
- package/dist/action-dispatch/deprecator.d.ts +23 -0
- package/dist/action-dispatch/deprecator.js +26 -0
- package/dist/action-dispatch/deprecator.js.map +1 -0
- package/dist/action-dispatch/http/cache.d.ts +73 -0
- package/dist/action-dispatch/http/cache.js +287 -0
- package/dist/action-dispatch/http/cache.js.map +1 -0
- package/dist/action-dispatch/http/content-disposition.d.ts +14 -0
- package/dist/action-dispatch/http/content-disposition.js +39 -0
- package/dist/action-dispatch/http/content-disposition.js.map +1 -0
- package/dist/action-dispatch/http/content-security-policy.d.ts +117 -0
- package/dist/action-dispatch/http/content-security-policy.js +442 -0
- package/dist/action-dispatch/http/content-security-policy.js.map +1 -0
- package/dist/action-dispatch/http/filter-parameters.d.ts +36 -0
- package/dist/action-dispatch/http/filter-parameters.js +69 -0
- package/dist/action-dispatch/http/filter-parameters.js.map +1 -0
- package/dist/action-dispatch/http/filter-redirect.d.ts +20 -0
- package/dist/action-dispatch/http/filter-redirect.js +54 -0
- package/dist/action-dispatch/http/filter-redirect.js.map +1 -0
- package/dist/action-dispatch/http/headers.d.ts +18 -0
- package/dist/action-dispatch/http/headers.js +89 -0
- package/dist/action-dispatch/http/headers.js.map +1 -0
- package/dist/action-dispatch/http/index.d.ts +16 -0
- package/dist/action-dispatch/http/index.js +16 -0
- package/dist/action-dispatch/http/index.js.map +1 -0
- package/dist/action-dispatch/http/mime-negotiation.d.ts +39 -0
- package/dist/action-dispatch/http/mime-negotiation.js +163 -0
- package/dist/action-dispatch/http/mime-negotiation.js.map +1 -0
- package/dist/action-dispatch/http/mime-type.d.ts +130 -0
- package/dist/action-dispatch/http/mime-type.js +425 -0
- package/dist/action-dispatch/http/mime-type.js.map +1 -0
- package/dist/action-dispatch/http/mime-types.d.ts +7 -0
- package/dist/action-dispatch/http/mime-types.js +46 -0
- package/dist/action-dispatch/http/mime-types.js.map +1 -0
- package/dist/action-dispatch/http/param-builder.d.ts +48 -0
- package/dist/action-dispatch/http/param-builder.js +257 -0
- package/dist/action-dispatch/http/param-builder.js.map +1 -0
- package/dist/action-dispatch/http/param-error.d.ts +14 -0
- package/dist/action-dispatch/http/param-error.js +34 -0
- package/dist/action-dispatch/http/param-error.js.map +1 -0
- package/dist/action-dispatch/http/parameters.d.ts +48 -0
- package/dist/action-dispatch/http/parameters.js +139 -0
- package/dist/action-dispatch/http/parameters.js.map +1 -0
- package/dist/action-dispatch/http/permissions-policy.d.ts +58 -0
- package/dist/action-dispatch/http/permissions-policy.js +291 -0
- package/dist/action-dispatch/http/permissions-policy.js.map +1 -0
- package/dist/action-dispatch/http/query-parser.d.ts +9 -0
- package/dist/action-dispatch/http/query-parser.js +64 -0
- package/dist/action-dispatch/http/query-parser.js.map +1 -0
- package/dist/action-dispatch/http/rack-cache.d.ts +39 -0
- package/dist/action-dispatch/http/rack-cache.js +68 -0
- package/dist/action-dispatch/http/rack-cache.js.map +1 -0
- package/dist/action-dispatch/http/request.d.ts +240 -0
- package/dist/action-dispatch/http/request.js +564 -0
- package/dist/action-dispatch/http/request.js.map +1 -0
- package/dist/action-dispatch/http/response.d.ts +229 -0
- package/dist/action-dispatch/http/response.js +691 -0
- package/dist/action-dispatch/http/response.js.map +1 -0
- package/dist/action-dispatch/http/upload.d.ts +28 -0
- package/dist/action-dispatch/http/upload.js +54 -0
- package/dist/action-dispatch/http/upload.js.map +1 -0
- package/dist/action-dispatch/http/url.d.ts +55 -0
- package/dist/action-dispatch/http/url.js +221 -0
- package/dist/action-dispatch/http/url.js.map +1 -0
- package/dist/action-dispatch/index.d.ts +48 -0
- package/dist/action-dispatch/index.js +50 -0
- package/dist/action-dispatch/index.js.map +1 -0
- package/dist/action-dispatch/journey/formatter.d.ts +57 -0
- package/dist/action-dispatch/journey/formatter.js +248 -0
- package/dist/action-dispatch/journey/formatter.js.map +1 -0
- package/dist/action-dispatch/journey/gtg/builder.d.ts +19 -0
- package/dist/action-dispatch/journey/gtg/builder.js +169 -0
- package/dist/action-dispatch/journey/gtg/builder.js.map +1 -0
- package/dist/action-dispatch/journey/gtg/index.d.ts +4 -0
- package/dist/action-dispatch/journey/gtg/index.js +4 -0
- package/dist/action-dispatch/journey/gtg/index.js.map +1 -0
- package/dist/action-dispatch/journey/gtg/simulator.d.ts +17 -0
- package/dist/action-dispatch/journey/gtg/simulator.js +36 -0
- package/dist/action-dispatch/journey/gtg/simulator.js.map +1 -0
- package/dist/action-dispatch/journey/gtg/transition-table.d.ts +38 -0
- package/dist/action-dispatch/journey/gtg/transition-table.js +261 -0
- package/dist/action-dispatch/journey/gtg/transition-table.js.map +1 -0
- package/dist/action-dispatch/journey/index.d.ts +15 -0
- package/dist/action-dispatch/journey/index.js +15 -0
- package/dist/action-dispatch/journey/index.js.map +1 -0
- package/dist/action-dispatch/journey/nfa/dot.d.ts +8 -0
- package/dist/action-dispatch/journey/nfa/dot.js +15 -0
- package/dist/action-dispatch/journey/nfa/dot.js.map +1 -0
- package/dist/action-dispatch/journey/nodes/node.d.ts +99 -0
- package/dist/action-dispatch/journey/nodes/node.js +224 -0
- package/dist/action-dispatch/journey/nodes/node.js.map +1 -0
- package/dist/action-dispatch/journey/parser.d.ts +25 -0
- package/dist/action-dispatch/journey/parser.js +96 -0
- package/dist/action-dispatch/journey/parser.js.map +1 -0
- package/dist/action-dispatch/journey/path/index.d.ts +2 -0
- package/dist/action-dispatch/journey/path/index.js +2 -0
- package/dist/action-dispatch/journey/path/index.js.map +1 -0
- package/dist/action-dispatch/journey/path/pattern.d.ts +66 -0
- package/dist/action-dispatch/journey/path/pattern.js +268 -0
- package/dist/action-dispatch/journey/path/pattern.js.map +1 -0
- package/dist/action-dispatch/journey/route.d.ts +151 -0
- package/dist/action-dispatch/journey/route.js +279 -0
- package/dist/action-dispatch/journey/route.js.map +1 -0
- package/dist/action-dispatch/journey/router/utils.d.ts +29 -0
- package/dist/action-dispatch/journey/router/utils.js +73 -0
- package/dist/action-dispatch/journey/router/utils.js.map +1 -0
- package/dist/action-dispatch/journey/router.d.ts +40 -0
- package/dist/action-dispatch/journey/router.js +146 -0
- package/dist/action-dispatch/journey/router.js.map +1 -0
- package/dist/action-dispatch/journey/routes.d.ts +29 -0
- package/dist/action-dispatch/journey/routes.js +76 -0
- package/dist/action-dispatch/journey/routes.js.map +1 -0
- package/dist/action-dispatch/journey/scanner.d.ts +28 -0
- package/dist/action-dispatch/journey/scanner.js +90 -0
- package/dist/action-dispatch/journey/scanner.js.map +1 -0
- package/dist/action-dispatch/journey/visitors.d.ts +109 -0
- package/dist/action-dispatch/journey/visitors.js +328 -0
- package/dist/action-dispatch/journey/visitors.js.map +1 -0
- package/dist/action-dispatch/journey/visualizer/fsm.css +30 -0
- package/dist/action-dispatch/journey/visualizer/fsm.js +159 -0
- package/dist/action-dispatch/journey/visualizer/index.html.tse +52 -0
- package/dist/action-dispatch/journey/visualizer/index.html.tse.js +61 -0
- package/dist/action-dispatch/journey/visualizer/index.html.tse.js.map +1 -0
- package/dist/action-dispatch/log-subscriber.d.ts +5 -0
- package/dist/action-dispatch/log-subscriber.js +18 -0
- package/dist/action-dispatch/log-subscriber.js.map +1 -0
- package/dist/action-dispatch/middleware/actionable-exceptions.d.ts +14 -0
- package/dist/action-dispatch/middleware/actionable-exceptions.js +57 -0
- package/dist/action-dispatch/middleware/actionable-exceptions.js.map +1 -0
- package/dist/action-dispatch/middleware/assume-ssl.d.ts +9 -0
- package/dist/action-dispatch/middleware/assume-ssl.js +15 -0
- package/dist/action-dispatch/middleware/assume-ssl.js.map +1 -0
- package/dist/action-dispatch/middleware/callbacks.d.ts +15 -0
- package/dist/action-dispatch/middleware/callbacks.js +32 -0
- package/dist/action-dispatch/middleware/callbacks.js.map +1 -0
- package/dist/action-dispatch/middleware/cookies.d.ts +282 -0
- package/dist/action-dispatch/middleware/cookies.js +599 -0
- package/dist/action-dispatch/middleware/cookies.js.map +1 -0
- package/dist/action-dispatch/middleware/debug-exceptions.d.ts +53 -0
- package/dist/action-dispatch/middleware/debug-exceptions.js +223 -0
- package/dist/action-dispatch/middleware/debug-exceptions.js.map +1 -0
- package/dist/action-dispatch/middleware/debug-locks.d.ts +14 -0
- package/dist/action-dispatch/middleware/debug-locks.js +111 -0
- package/dist/action-dispatch/middleware/debug-locks.js.map +1 -0
- package/dist/action-dispatch/middleware/debug-view.d.ts +16 -0
- package/dist/action-dispatch/middleware/debug-view.js +83 -0
- package/dist/action-dispatch/middleware/debug-view.js.map +1 -0
- package/dist/action-dispatch/middleware/exception-wrapper.d.ts +99 -0
- package/dist/action-dispatch/middleware/exception-wrapper.js +328 -0
- package/dist/action-dispatch/middleware/exception-wrapper.js.map +1 -0
- package/dist/action-dispatch/middleware/executor.d.ts +25 -0
- package/dist/action-dispatch/middleware/executor.js +45 -0
- package/dist/action-dispatch/middleware/executor.js.map +1 -0
- package/dist/action-dispatch/middleware/flash.d.ts +93 -0
- package/dist/action-dispatch/middleware/flash.js +221 -0
- package/dist/action-dispatch/middleware/flash.js.map +1 -0
- package/dist/action-dispatch/middleware/host-authorization.d.ts +65 -0
- package/dist/action-dispatch/middleware/host-authorization.js +170 -0
- package/dist/action-dispatch/middleware/host-authorization.js.map +1 -0
- package/dist/action-dispatch/middleware/public-exceptions.d.ts +10 -0
- package/dist/action-dispatch/middleware/public-exceptions.js +73 -0
- package/dist/action-dispatch/middleware/public-exceptions.js.map +1 -0
- package/dist/action-dispatch/middleware/reloader.d.ts +4 -0
- package/dist/action-dispatch/middleware/reloader.js +4 -0
- package/dist/action-dispatch/middleware/reloader.js.map +1 -0
- package/dist/action-dispatch/middleware/remote-ip.d.ts +37 -0
- package/dist/action-dispatch/middleware/remote-ip.js +191 -0
- package/dist/action-dispatch/middleware/remote-ip.js.map +1 -0
- package/dist/action-dispatch/middleware/request-id.d.ts +19 -0
- package/dist/action-dispatch/middleware/request-id.js +31 -0
- package/dist/action-dispatch/middleware/request-id.js.map +1 -0
- package/dist/action-dispatch/middleware/server-timing.d.ts +25 -0
- package/dist/action-dispatch/middleware/server-timing.js +73 -0
- package/dist/action-dispatch/middleware/server-timing.js.map +1 -0
- package/dist/action-dispatch/middleware/session/abstract-store.d.ts +53 -0
- package/dist/action-dispatch/middleware/session/abstract-store.js +124 -0
- package/dist/action-dispatch/middleware/session/abstract-store.js.map +1 -0
- package/dist/action-dispatch/middleware/session/cache-store.d.ts +34 -0
- package/dist/action-dispatch/middleware/session/cache-store.js +83 -0
- package/dist/action-dispatch/middleware/session/cache-store.js.map +1 -0
- package/dist/action-dispatch/middleware/session/cookie-store.d.ts +54 -0
- package/dist/action-dispatch/middleware/session/cookie-store.js +97 -0
- package/dist/action-dispatch/middleware/session/cookie-store.js.map +1 -0
- package/dist/action-dispatch/middleware/session/index.d.ts +5 -0
- package/dist/action-dispatch/middleware/session/index.js +5 -0
- package/dist/action-dispatch/middleware/session/index.js.map +1 -0
- package/dist/action-dispatch/middleware/session/mem-cache-store.d.ts +20 -0
- package/dist/action-dispatch/middleware/session/mem-cache-store.js +23 -0
- package/dist/action-dispatch/middleware/session/mem-cache-store.js.map +1 -0
- package/dist/action-dispatch/middleware/show-exceptions.d.ts +15 -0
- package/dist/action-dispatch/middleware/show-exceptions.js +87 -0
- package/dist/action-dispatch/middleware/show-exceptions.js.map +1 -0
- package/dist/action-dispatch/middleware/ssl.d.ts +54 -0
- package/dist/action-dispatch/middleware/ssl.js +138 -0
- package/dist/action-dispatch/middleware/ssl.js.map +1 -0
- package/dist/action-dispatch/middleware/stack.d.ts +68 -0
- package/dist/action-dispatch/middleware/stack.js +202 -0
- package/dist/action-dispatch/middleware/stack.js.map +1 -0
- package/dist/action-dispatch/middleware/static.d.ts +60 -0
- package/dist/action-dispatch/middleware/static.js +170 -0
- package/dist/action-dispatch/middleware/static.js.map +1 -0
- package/dist/action-dispatch/middleware/templates/rescues/_actions.html.tse +13 -0
- package/dist/action-dispatch/middleware/templates/rescues/_actions.html.tse.js +47 -0
- package/dist/action-dispatch/middleware/templates/rescues/_actions.html.tse.js.map +1 -0
- package/dist/action-dispatch/middleware/templates/rescues/_actions.text.tse +0 -0
- package/dist/action-dispatch/middleware/templates/rescues/_actions.text.tse.js +11 -0
- package/dist/action-dispatch/middleware/templates/rescues/_actions.text.tse.js.map +1 -0
- package/dist/action-dispatch/middleware/templates/rescues/_message_and_suggestions.html.tse +23 -0
- package/dist/action-dispatch/middleware/templates/rescues/_message_and_suggestions.html.tse.js +60 -0
- package/dist/action-dispatch/middleware/templates/rescues/_message_and_suggestions.html.tse.js.map +1 -0
- package/dist/action-dispatch/middleware/templates/rescues/_request_and_response.html.tse +17 -0
- package/dist/action-dispatch/middleware/templates/rescues/_request_and_response.html.tse.js +46 -0
- package/dist/action-dispatch/middleware/templates/rescues/_request_and_response.html.tse.js.map +1 -0
- package/dist/action-dispatch/middleware/templates/rescues/_request_and_response.text.tse +19 -0
- package/dist/action-dispatch/middleware/templates/rescues/_request_and_response.text.tse.js +42 -0
- package/dist/action-dispatch/middleware/templates/rescues/_request_and_response.text.tse.js.map +1 -0
- package/dist/action-dispatch/middleware/templates/rescues/_source.html.tse +33 -0
- package/dist/action-dispatch/middleware/templates/rescues/_source.html.tse.js +70 -0
- package/dist/action-dispatch/middleware/templates/rescues/_source.html.tse.js.map +1 -0
- package/dist/action-dispatch/middleware/templates/rescues/_source.text.tse +8 -0
- package/dist/action-dispatch/middleware/templates/rescues/_source.text.tse.js +41 -0
- package/dist/action-dispatch/middleware/templates/rescues/_source.text.tse.js.map +1 -0
- package/dist/action-dispatch/middleware/templates/rescues/_trace.html.tse +62 -0
- package/dist/action-dispatch/middleware/templates/rescues/_trace.html.tse.js +78 -0
- package/dist/action-dispatch/middleware/templates/rescues/_trace.html.tse.js.map +1 -0
- package/dist/action-dispatch/middleware/templates/rescues/_trace.text.tse +9 -0
- package/dist/action-dispatch/middleware/templates/rescues/_trace.text.tse.js +23 -0
- package/dist/action-dispatch/middleware/templates/rescues/_trace.text.tse.js.map +1 -0
- package/dist/action-dispatch/middleware/templates/rescues/blocked_host.html.tse +12 -0
- package/dist/action-dispatch/middleware/templates/rescues/blocked_host.html.tse.js +24 -0
- package/dist/action-dispatch/middleware/templates/rescues/blocked_host.html.tse.js.map +1 -0
- package/dist/action-dispatch/middleware/templates/rescues/blocked_host.text.tse +9 -0
- package/dist/action-dispatch/middleware/templates/rescues/blocked_host.text.tse.js +20 -0
- package/dist/action-dispatch/middleware/templates/rescues/blocked_host.text.tse.js.map +1 -0
- package/dist/action-dispatch/middleware/templates/rescues/diagnostics.html.tse +35 -0
- package/dist/action-dispatch/middleware/templates/rescues/diagnostics.html.tse.js +77 -0
- package/dist/action-dispatch/middleware/templates/rescues/diagnostics.html.tse.js.map +1 -0
- package/dist/action-dispatch/middleware/templates/rescues/diagnostics.text.tse +9 -0
- package/dist/action-dispatch/middleware/templates/rescues/diagnostics.text.tse.js +48 -0
- package/dist/action-dispatch/middleware/templates/rescues/diagnostics.text.tse.js.map +1 -0
- package/dist/action-dispatch/middleware/templates/rescues/invalid_statement.html.tse +24 -0
- package/dist/action-dispatch/middleware/templates/rescues/invalid_statement.html.tse.js +61 -0
- package/dist/action-dispatch/middleware/templates/rescues/invalid_statement.html.tse.js.map +1 -0
- package/dist/action-dispatch/middleware/templates/rescues/invalid_statement.text.tse +16 -0
- package/dist/action-dispatch/middleware/templates/rescues/invalid_statement.text.tse.js +55 -0
- package/dist/action-dispatch/middleware/templates/rescues/invalid_statement.text.tse.js.map +1 -0
- package/dist/action-dispatch/middleware/templates/rescues/layout.tse +284 -0
- package/dist/action-dispatch/middleware/templates/rescues/layout.tse.js +16 -0
- package/dist/action-dispatch/middleware/templates/rescues/layout.tse.js.map +1 -0
- package/dist/action-dispatch/middleware/templates/rescues/missing_exact_template.html.tse +23 -0
- package/dist/action-dispatch/middleware/templates/rescues/missing_exact_template.html.tse.js +45 -0
- package/dist/action-dispatch/middleware/templates/rescues/missing_exact_template.html.tse.js.map +1 -0
- package/dist/action-dispatch/middleware/templates/rescues/missing_exact_template.text.tse +3 -0
- package/dist/action-dispatch/middleware/templates/rescues/missing_exact_template.text.tse.js +14 -0
- package/dist/action-dispatch/middleware/templates/rescues/missing_exact_template.text.tse.js.map +1 -0
- package/dist/action-dispatch/middleware/templates/rescues/missing_template.html.tse +11 -0
- package/dist/action-dispatch/middleware/templates/rescues/missing_template.html.tse.js +41 -0
- package/dist/action-dispatch/middleware/templates/rescues/missing_template.html.tse.js.map +1 -0
- package/dist/action-dispatch/middleware/templates/rescues/missing_template.text.tse +3 -0
- package/dist/action-dispatch/middleware/templates/rescues/missing_template.text.tse.js +14 -0
- package/dist/action-dispatch/middleware/templates/rescues/missing_template.text.tse.js.map +1 -0
- package/dist/action-dispatch/middleware/templates/rescues/routing_error.html.tse +32 -0
- package/dist/action-dispatch/middleware/templates/rescues/routing_error.html.tse.js +58 -0
- package/dist/action-dispatch/middleware/templates/rescues/routing_error.html.tse.js.map +1 -0
- package/dist/action-dispatch/middleware/templates/rescues/routing_error.text.tse +11 -0
- package/dist/action-dispatch/middleware/templates/rescues/routing_error.text.tse.js +45 -0
- package/dist/action-dispatch/middleware/templates/rescues/routing_error.text.tse.js.map +1 -0
- package/dist/action-dispatch/middleware/templates/rescues/template_error.html.tse +20 -0
- package/dist/action-dispatch/middleware/templates/rescues/template_error.html.tse.js +53 -0
- package/dist/action-dispatch/middleware/templates/rescues/template_error.html.tse.js.map +1 -0
- package/dist/action-dispatch/middleware/templates/rescues/template_error.text.tse +7 -0
- package/dist/action-dispatch/middleware/templates/rescues/template_error.text.tse.js +46 -0
- package/dist/action-dispatch/middleware/templates/rescues/template_error.text.tse.js.map +1 -0
- package/dist/action-dispatch/middleware/templates/rescues/unknown_action.html.tse +6 -0
- package/dist/action-dispatch/middleware/templates/rescues/unknown_action.html.tse.js +35 -0
- package/dist/action-dispatch/middleware/templates/rescues/unknown_action.html.tse.js.map +1 -0
- package/dist/action-dispatch/middleware/templates/rescues/unknown_action.text.tse +3 -0
- package/dist/action-dispatch/middleware/templates/rescues/unknown_action.text.tse.js +14 -0
- package/dist/action-dispatch/middleware/templates/rescues/unknown_action.text.tse.js.map +1 -0
- package/dist/action-dispatch/middleware/templates/routes/_route.html.tse +19 -0
- package/dist/action-dispatch/middleware/templates/routes/_route.html.tse.js +51 -0
- package/dist/action-dispatch/middleware/templates/routes/_route.html.tse.js.map +1 -0
- package/dist/action-dispatch/middleware/templates/routes/_table.html.tse +232 -0
- package/dist/action-dispatch/middleware/templates/routes/_table.html.tse.js +46 -0
- package/dist/action-dispatch/middleware/templates/routes/_table.html.tse.js.map +1 -0
- package/dist/action-dispatch/request/index.d.ts +3 -0
- package/dist/action-dispatch/request/index.js +3 -0
- package/dist/action-dispatch/request/index.js.map +1 -0
- package/dist/action-dispatch/request/session.d.ts +78 -0
- package/dist/action-dispatch/request/session.js +278 -0
- package/dist/action-dispatch/request/session.js.map +1 -0
- package/dist/action-dispatch/request/utils.d.ts +43 -0
- package/dist/action-dispatch/request/utils.js +170 -0
- package/dist/action-dispatch/request/utils.js.map +1 -0
- package/dist/action-dispatch/routing/dispatcher.d.ts +11 -0
- package/dist/action-dispatch/routing/dispatcher.js +3 -0
- package/dist/action-dispatch/routing/dispatcher.js.map +1 -0
- package/dist/action-dispatch/routing/endpoint.d.ts +11 -0
- package/dist/action-dispatch/routing/endpoint.js +26 -0
- package/dist/action-dispatch/routing/endpoint.js.map +1 -0
- package/dist/action-dispatch/routing/index.d.ts +10 -0
- package/dist/action-dispatch/routing/index.js +9 -0
- package/dist/action-dispatch/routing/index.js.map +1 -0
- package/dist/action-dispatch/routing/inspector.d.ts +114 -0
- package/dist/action-dispatch/routing/inspector.js +294 -0
- package/dist/action-dispatch/routing/inspector.js.map +1 -0
- package/dist/action-dispatch/routing/mapper.d.ts +475 -0
- package/dist/action-dispatch/routing/mapper.js +1670 -0
- package/dist/action-dispatch/routing/mapper.js.map +1 -0
- package/dist/action-dispatch/routing/polymorphic-routes.d.ts +69 -0
- package/dist/action-dispatch/routing/polymorphic-routes.js +240 -0
- package/dist/action-dispatch/routing/polymorphic-routes.js.map +1 -0
- package/dist/action-dispatch/routing/redirection.d.ts +56 -0
- package/dist/action-dispatch/routing/redirection.js +187 -0
- package/dist/action-dispatch/routing/redirection.js.map +1 -0
- package/dist/action-dispatch/routing/route-set.d.ts +276 -0
- package/dist/action-dispatch/routing/route-set.js +1090 -0
- package/dist/action-dispatch/routing/route-set.js.map +1 -0
- package/dist/action-dispatch/routing/routes-proxy.d.ts +49 -0
- package/dist/action-dispatch/routing/routes-proxy.js +90 -0
- package/dist/action-dispatch/routing/routes-proxy.js.map +1 -0
- package/dist/action-dispatch/routing/url-for.d.ts +50 -0
- package/dist/action-dispatch/routing/url-for.js +131 -0
- package/dist/action-dispatch/routing/url-for.js.map +1 -0
- package/dist/action-dispatch/system-test-case.d.ts +58 -0
- package/dist/action-dispatch/system-test-case.js +124 -0
- package/dist/action-dispatch/system-test-case.js.map +1 -0
- package/dist/action-dispatch/system-testing/browser.d.ts +31 -0
- package/dist/action-dispatch/system-testing/browser.js +94 -0
- package/dist/action-dispatch/system-testing/browser.js.map +1 -0
- package/dist/action-dispatch/system-testing/driver.d.ts +45 -0
- package/dist/action-dispatch/system-testing/driver.js +111 -0
- package/dist/action-dispatch/system-testing/driver.js.map +1 -0
- package/dist/action-dispatch/system-testing/server.d.ts +27 -0
- package/dist/action-dispatch/system-testing/server.js +71 -0
- package/dist/action-dispatch/system-testing/server.js.map +1 -0
- package/dist/action-dispatch/system-testing/test-helpers/screenshot-helper.d.ts +70 -0
- package/dist/action-dispatch/system-testing/test-helpers/screenshot-helper.js +144 -0
- package/dist/action-dispatch/system-testing/test-helpers/screenshot-helper.js.map +1 -0
- package/dist/action-dispatch/system-testing/test-helpers/setup-and-teardown.d.ts +15 -0
- package/dist/action-dispatch/system-testing/test-helpers/setup-and-teardown.js +24 -0
- package/dist/action-dispatch/system-testing/test-helpers/setup-and-teardown.js.map +1 -0
- package/dist/action-dispatch/testing/assertion-response.d.ts +7 -0
- package/dist/action-dispatch/testing/assertion-response.js +46 -0
- package/dist/action-dispatch/testing/assertion-response.js.map +1 -0
- package/dist/action-dispatch/testing/assertions/response.d.ts +67 -0
- package/dist/action-dispatch/testing/assertions/response.js +94 -0
- package/dist/action-dispatch/testing/assertions/response.js.map +1 -0
- package/dist/action-dispatch/testing/assertions/routing.d.ts +77 -0
- package/dist/action-dispatch/testing/assertions/routing.js +296 -0
- package/dist/action-dispatch/testing/assertions/routing.js.map +1 -0
- package/dist/action-dispatch/testing/assertions.d.ts +37 -0
- package/dist/action-dispatch/testing/assertions.js +27 -0
- package/dist/action-dispatch/testing/assertions.js.map +1 -0
- package/dist/action-dispatch/testing/index.d.ts +10 -0
- package/dist/action-dispatch/testing/index.js +10 -0
- package/dist/action-dispatch/testing/index.js.map +1 -0
- package/dist/action-dispatch/testing/integration.d.ts +205 -0
- package/dist/action-dispatch/testing/integration.js +574 -0
- package/dist/action-dispatch/testing/integration.js.map +1 -0
- package/dist/action-dispatch/testing/request-encoder.d.ts +29 -0
- package/dist/action-dispatch/testing/request-encoder.js +80 -0
- package/dist/action-dispatch/testing/request-encoder.js.map +1 -0
- package/dist/action-dispatch/testing/test-helpers/page-dump-helper.d.ts +22 -0
- package/dist/action-dispatch/testing/test-helpers/page-dump-helper.js +58 -0
- package/dist/action-dispatch/testing/test-helpers/page-dump-helper.js.map +1 -0
- package/dist/action-dispatch/testing/test-process.d.ts +47 -0
- package/dist/action-dispatch/testing/test-process.js +46 -0
- package/dist/action-dispatch/testing/test-process.js.map +1 -0
- package/dist/action-dispatch/testing/test-request.d.ts +26 -0
- package/dist/action-dispatch/testing/test-request.js +78 -0
- package/dist/action-dispatch/testing/test-request.js.map +1 -0
- package/dist/action-dispatch/testing/test-response.d.ts +16 -0
- package/dist/action-dispatch/testing/test-response.js +29 -0
- package/dist/action-dispatch/testing/test-response.js.map +1 -0
- package/dist/action-pack/gem-version.d.ts +9 -0
- package/dist/action-pack/gem-version.js +15 -0
- package/dist/action-pack/gem-version.js.map +1 -0
- package/dist/action-pack/index.d.ts +3 -0
- package/dist/action-pack/index.js +3 -0
- package/dist/action-pack/index.js.map +1 -0
- package/dist/action-pack/version.d.ts +2 -0
- package/dist/action-pack/version.js +5 -0
- package/dist/action-pack/version.js.map +1 -0
- package/dist/constants.excluded.generated.d.ts +2 -0
- package/dist/constants.excluded.generated.js +57 -0
- package/dist/constants.excluded.generated.js.map +1 -0
- package/dist/constants.generated.d.ts +2 -0
- package/dist/constants.generated.js +489 -0
- package/dist/constants.generated.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/namespaces.d.ts +178 -0
- package/dist/namespaces.js +107 -0
- package/dist/namespaces.js.map +1 -0
- package/dist/system-testing.d.ts +5 -0
- package/dist/system-testing.js +5 -0
- package/dist/system-testing.js.map +1 -0
- package/dist/testing.d.ts +7 -0
- package/dist/testing.js +18 -0
- package/dist/testing.js.map +1 -0
- package/package.json +92 -3
- package/README.md +0 -3
|
@@ -0,0 +1,691 @@
|
|
|
1
|
+
import { cattrAccessor, include, presence, runLoadHooks } from "@blazetrails/activesupport";
|
|
2
|
+
import { aryJoin, rbCheckArrayType } from "@blazetrails/ruby-compat/array";
|
|
3
|
+
import { toEnum } from "@blazetrails/ruby-compat/enumerator";
|
|
4
|
+
import { File } from "@blazetrails/ruby-compat/file";
|
|
5
|
+
import { hashAset } from "@blazetrails/ruby-compat/hash";
|
|
6
|
+
import { rbClassNewInstance } from "@blazetrails/ruby-compat/include";
|
|
7
|
+
import { IO } from "@blazetrails/ruby-compat/io";
|
|
8
|
+
import { IOError } from "@blazetrails/ruby-compat/io-error";
|
|
9
|
+
import { rbClearMethodCache } from "@blazetrails/ruby-compat/method-cache";
|
|
10
|
+
import { basicObjRespondTo, rbObjAsString, rbFSend, rbObjRespondTo, rbProcCall, } from "@blazetrails/ruby-compat/object";
|
|
11
|
+
import { RuntimeError } from "@blazetrails/ruby-compat/runtime-error";
|
|
12
|
+
import { strNew } from "@blazetrails/ruby-compat/string/bytes";
|
|
13
|
+
import { stringSplit } from "@blazetrails/ruby-compat/string/split";
|
|
14
|
+
import { Struct } from "@blazetrails/ruby-compat/struct";
|
|
15
|
+
import { deleteSetCookieHeaderBang, Headers, HTTP_STATUS_CODES, ResponseHelpers as RackResponseHelpers, setCookieHeader, statusCode, unescape, } from "@blazetrails/rack";
|
|
16
|
+
import { UNPROCESSABLE_CONTENT } from "../constants.js";
|
|
17
|
+
import { cacheControlHeaders as _cacheControlHeaders, cacheControlSegments as _cacheControlSegments, generateStrongEtag as _generateStrongEtag, generateWeakEtag as _generateWeakEtag, Response as CacheResponse, handleConditionalGetBang as _handleConditionalGetBang, isDate as _isDate, isEtag as _isEtag, isLastModified as _isLastModified, isStrongEtag as _isStrongEtag, mergeAndNormalizeCacheControlBang as _mergeAndNormalizeCacheControlBang, isWeakEtag as _isWeakEtag, prepareCacheControlBang as _prepareCacheControlBang, strongEtag as _strongEtag, weakEtag as _weakEtag, } from "./cache.js";
|
|
18
|
+
import { filteredLocation as _filteredLocation, locationFilterMatch as _locationFilterMatch, locationFilters as _locationFilters, parameterFilteredLocation as _parameterFilteredLocation, } from "./filter-redirect.js";
|
|
19
|
+
const CONTENT_TYPE = "Content-Type";
|
|
20
|
+
const SET_COOKIE = "set-cookie";
|
|
21
|
+
const NO_CONTENT_CODES = [100, 101, 102, 103, 204, 205, 304];
|
|
22
|
+
const CONTENT_TYPE_PARSER = /^(?<mime_type>[^;\s]+\s*(?:;\s*(?:(?!charset)[^;\s])+)*)?(?:;\s*charset=(?<quote>"?)(?<charset>[^;\s]+)\k<quote>)?/;
|
|
23
|
+
/** @internal */
|
|
24
|
+
export class ContentTypeHeader extends Struct.new("mimeType", "charset") {
|
|
25
|
+
}
|
|
26
|
+
const NULL_CONTENT_TYPE_HEADER = new ContentTypeHeader(null, null);
|
|
27
|
+
const BODY_METHODS = { toAry: true, each: true, call: true, toPath: true };
|
|
28
|
+
/** @noRailsEquivalent PERMANENT */
|
|
29
|
+
async function* _eachChunks(each) {
|
|
30
|
+
const yielded = [];
|
|
31
|
+
let wake = null;
|
|
32
|
+
let done = false;
|
|
33
|
+
const eachChunk = Promise.resolve(each((chunk) => new Promise((resume) => {
|
|
34
|
+
yielded.push({ chunk, resume });
|
|
35
|
+
wake?.();
|
|
36
|
+
})))
|
|
37
|
+
.then(() => null, (error) => ({ error }))
|
|
38
|
+
.finally(() => {
|
|
39
|
+
done = true;
|
|
40
|
+
wake?.();
|
|
41
|
+
});
|
|
42
|
+
while (yielded.length > 0 || !done) {
|
|
43
|
+
const next = yielded.shift();
|
|
44
|
+
if (next) {
|
|
45
|
+
yield next.chunk;
|
|
46
|
+
next.resume();
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
await new Promise((resolve) => (wake = resolve));
|
|
50
|
+
wake = null;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
const failure = await eachChunk;
|
|
54
|
+
if (failure)
|
|
55
|
+
throw failure.error;
|
|
56
|
+
}
|
|
57
|
+
export class Buffer {
|
|
58
|
+
/** @internal */
|
|
59
|
+
_response;
|
|
60
|
+
/** @internal */
|
|
61
|
+
_buf;
|
|
62
|
+
/** @internal */
|
|
63
|
+
_closed = false;
|
|
64
|
+
/** @internal */
|
|
65
|
+
_strBody = null;
|
|
66
|
+
/** @internal */
|
|
67
|
+
_pendingBody = null;
|
|
68
|
+
constructor(response, buf) {
|
|
69
|
+
this._response = response;
|
|
70
|
+
this._buf = buf;
|
|
71
|
+
}
|
|
72
|
+
static BODY_METHODS = { toAry: true };
|
|
73
|
+
isRespondTo(method, includePrivate = false) {
|
|
74
|
+
if (Object.hasOwn(Buffer.BODY_METHODS, method)) {
|
|
75
|
+
return rbObjRespondTo(this._buf, method);
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
return basicObjRespondTo(this, method);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
toAry() {
|
|
82
|
+
if (this._strBody !== null) {
|
|
83
|
+
return [this.body];
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
return (this._buf = rbCheckArrayType(this._buf));
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
get body() {
|
|
90
|
+
if (this._strBody !== null)
|
|
91
|
+
return this._strBody;
|
|
92
|
+
if (this._pendingBody)
|
|
93
|
+
throw new RuntimeError("streaming ActionDispatch::Response body: await awaitBody before body");
|
|
94
|
+
let buf = "";
|
|
95
|
+
const pending = this.each((chunk) => {
|
|
96
|
+
const str = rbObjAsString(chunk);
|
|
97
|
+
buf += str instanceof Uint8Array ? strNew(Array.from(str)) : str;
|
|
98
|
+
});
|
|
99
|
+
if (pending instanceof Promise) {
|
|
100
|
+
this._pendingBody = { each: pending, buf: () => buf };
|
|
101
|
+
throw new RuntimeError("streaming ActionDispatch::Response body: await awaitBody before body");
|
|
102
|
+
}
|
|
103
|
+
this._strBody = buf;
|
|
104
|
+
return this._strBody;
|
|
105
|
+
}
|
|
106
|
+
/** @noRailsEquivalent PERMANENT */
|
|
107
|
+
async awaitBody() {
|
|
108
|
+
if (this._strBody !== null)
|
|
109
|
+
return this._strBody;
|
|
110
|
+
if (this._pendingBody) {
|
|
111
|
+
const { each, buf } = this._pendingBody;
|
|
112
|
+
await each;
|
|
113
|
+
return (this._strBody = buf());
|
|
114
|
+
}
|
|
115
|
+
let buf = "";
|
|
116
|
+
for await (const chunk of this) {
|
|
117
|
+
const str = rbObjAsString(chunk);
|
|
118
|
+
buf += str instanceof Uint8Array ? strNew(Array.from(str)) : str;
|
|
119
|
+
}
|
|
120
|
+
this._strBody = buf;
|
|
121
|
+
return this._strBody;
|
|
122
|
+
}
|
|
123
|
+
write(string) {
|
|
124
|
+
if (this.isClosed)
|
|
125
|
+
throw new IOError("closed stream");
|
|
126
|
+
this._strBody = null;
|
|
127
|
+
this._pendingBody = null;
|
|
128
|
+
this._response.commitBang();
|
|
129
|
+
return this._buf.push(string);
|
|
130
|
+
}
|
|
131
|
+
each(block) {
|
|
132
|
+
if (this._strBody !== null) {
|
|
133
|
+
if (!block)
|
|
134
|
+
return toEnum(this, "each");
|
|
135
|
+
return block(this._strBody);
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
return this.eachChunk(block);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
/** @noRailsEquivalent PERMANENT */
|
|
142
|
+
async *[Symbol.asyncIterator]() {
|
|
143
|
+
if (this._strBody !== null) {
|
|
144
|
+
yield this._strBody;
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
yield* _eachChunks((block) => this.eachChunk(block));
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
abort() { }
|
|
151
|
+
close() {
|
|
152
|
+
this._response.commitBang();
|
|
153
|
+
this._closed = true;
|
|
154
|
+
}
|
|
155
|
+
get isClosed() {
|
|
156
|
+
return this._closed;
|
|
157
|
+
}
|
|
158
|
+
/** @internal */
|
|
159
|
+
eachChunk(block) {
|
|
160
|
+
return rbFSend(this._buf, "each", block);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
export class RackBody {
|
|
164
|
+
/** @internal */
|
|
165
|
+
_response;
|
|
166
|
+
/**
|
|
167
|
+
* @internal
|
|
168
|
+
* @noRailsEquivalent PERMANENT
|
|
169
|
+
*/
|
|
170
|
+
_reader = null;
|
|
171
|
+
constructor(response) {
|
|
172
|
+
this._response = response;
|
|
173
|
+
for (const method of Object.keys(BODY_METHODS)) {
|
|
174
|
+
if (!this.isRespondTo(method)) {
|
|
175
|
+
Object.defineProperty(this, method, { value: undefined, configurable: true });
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
close() {
|
|
180
|
+
/** @inventedArm if — PERMANENT */
|
|
181
|
+
if (this._reader)
|
|
182
|
+
return this._reader.cancel().then(() => this._response.abort());
|
|
183
|
+
return this._response.abort();
|
|
184
|
+
}
|
|
185
|
+
get body() {
|
|
186
|
+
return this._response.body;
|
|
187
|
+
}
|
|
188
|
+
isRespondTo(method, includePrivate = false) {
|
|
189
|
+
if (Object.hasOwn(BODY_METHODS, method)) {
|
|
190
|
+
return rbObjRespondTo(this._response.stream, method);
|
|
191
|
+
}
|
|
192
|
+
else {
|
|
193
|
+
return basicObjRespondTo(this, method);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
toAry() {
|
|
197
|
+
return this._response.stream.toAry();
|
|
198
|
+
}
|
|
199
|
+
each(...args) {
|
|
200
|
+
return this._response.each(...args);
|
|
201
|
+
}
|
|
202
|
+
call(...arguments_) {
|
|
203
|
+
return rbProcCall(this._response.stream, ...arguments_);
|
|
204
|
+
}
|
|
205
|
+
toPath() {
|
|
206
|
+
return this._response.stream.toPath();
|
|
207
|
+
}
|
|
208
|
+
/** @noRailsEquivalent PERMANENT */
|
|
209
|
+
[Symbol.iterator]() {
|
|
210
|
+
const chunks = [];
|
|
211
|
+
this.each((chunk) => chunks.push(chunk));
|
|
212
|
+
return chunks[Symbol.iterator]();
|
|
213
|
+
}
|
|
214
|
+
/** @noRailsEquivalent PERMANENT */
|
|
215
|
+
async *[Symbol.asyncIterator]() {
|
|
216
|
+
const stream = this._response.stream;
|
|
217
|
+
this._response.sendingBang();
|
|
218
|
+
if (stream instanceof ReadableStream) {
|
|
219
|
+
const reader = (this._reader = stream.getReader());
|
|
220
|
+
try {
|
|
221
|
+
for (;;) {
|
|
222
|
+
const { done, value } = await reader.read();
|
|
223
|
+
if (done)
|
|
224
|
+
break;
|
|
225
|
+
yield value;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
finally {
|
|
229
|
+
await reader.cancel();
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
else if (typeof stream[Symbol.asyncIterator] === "function") {
|
|
233
|
+
for await (const chunk of stream)
|
|
234
|
+
yield chunk;
|
|
235
|
+
}
|
|
236
|
+
else {
|
|
237
|
+
const each = stream;
|
|
238
|
+
for await (const chunk of _eachChunks((block) => each.each(block)))
|
|
239
|
+
yield chunk;
|
|
240
|
+
}
|
|
241
|
+
this._response.sentBang();
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
export class FileBody {
|
|
245
|
+
_toPath;
|
|
246
|
+
constructor(path) {
|
|
247
|
+
this._toPath = path;
|
|
248
|
+
}
|
|
249
|
+
toPath() {
|
|
250
|
+
return this._toPath;
|
|
251
|
+
}
|
|
252
|
+
get body() {
|
|
253
|
+
return IO.binread(this.toPath());
|
|
254
|
+
}
|
|
255
|
+
each(block) {
|
|
256
|
+
File.open(this.toPath(), "rb", (file) => {
|
|
257
|
+
let chunk;
|
|
258
|
+
while ((chunk = file.read(16384)) !== null)
|
|
259
|
+
block(chunk);
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
/* eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging -- Ruby `include Rack::Response::Helpers` (`action_dispatch/http/response.rb:91`); the class/interface merge is how a mixin surfaces on the type side. */
|
|
264
|
+
export class Response {
|
|
265
|
+
static Headers = Headers;
|
|
266
|
+
static Header = Headers;
|
|
267
|
+
static {
|
|
268
|
+
cattrAccessor.call(this, "defaultCharset", { default: "utf-8" });
|
|
269
|
+
cattrAccessor.call(this, "defaultHeaders");
|
|
270
|
+
}
|
|
271
|
+
static rackStatusCode(status) {
|
|
272
|
+
if (UNPROCESSABLE_CONTENT === ":unprocessable_content") {
|
|
273
|
+
if (status === ":unprocessable_entity")
|
|
274
|
+
status = ":unprocessable_content";
|
|
275
|
+
}
|
|
276
|
+
else {
|
|
277
|
+
if (status === ":unprocessable_content")
|
|
278
|
+
status = ":unprocessable_entity";
|
|
279
|
+
}
|
|
280
|
+
return statusCode(status);
|
|
281
|
+
}
|
|
282
|
+
_status;
|
|
283
|
+
_headers;
|
|
284
|
+
_committed = false;
|
|
285
|
+
cv = [];
|
|
286
|
+
_sending = false;
|
|
287
|
+
_sent = false;
|
|
288
|
+
stream;
|
|
289
|
+
request = null;
|
|
290
|
+
constructor(status = 200, headers = {}, body = [], block) {
|
|
291
|
+
this._headers = new Headers();
|
|
292
|
+
for (const [key, value] of Object.entries(headers)) {
|
|
293
|
+
this._headers.set(key, value);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
static async new(status = 200, headers = {}, body = [], block) {
|
|
297
|
+
const response = rbClassNewInstance(this, status, headers, body, block);
|
|
298
|
+
await response.setBody(body);
|
|
299
|
+
response.status = status;
|
|
300
|
+
response.prepareCacheControlBang();
|
|
301
|
+
if (block)
|
|
302
|
+
block(response);
|
|
303
|
+
return response;
|
|
304
|
+
}
|
|
305
|
+
get status() {
|
|
306
|
+
return this._status;
|
|
307
|
+
}
|
|
308
|
+
set status(status) {
|
|
309
|
+
this._status = Response.rackStatusCode(status);
|
|
310
|
+
}
|
|
311
|
+
get code() {
|
|
312
|
+
return String(this._status);
|
|
313
|
+
}
|
|
314
|
+
get message() {
|
|
315
|
+
return HTTP_STATUS_CODES[this._status];
|
|
316
|
+
}
|
|
317
|
+
get headers() {
|
|
318
|
+
return this._headers;
|
|
319
|
+
}
|
|
320
|
+
getHeader(key) {
|
|
321
|
+
return this._headers.get(key);
|
|
322
|
+
}
|
|
323
|
+
setHeader(key, v) {
|
|
324
|
+
return hashAset(this._headers, key, v);
|
|
325
|
+
}
|
|
326
|
+
deleteHeader(key) {
|
|
327
|
+
return this._headers.delete(key);
|
|
328
|
+
}
|
|
329
|
+
get contentType() {
|
|
330
|
+
return presence(this.getHeader(CONTENT_TYPE));
|
|
331
|
+
}
|
|
332
|
+
set contentType(value) {
|
|
333
|
+
if (value == null)
|
|
334
|
+
return;
|
|
335
|
+
const newHeaderInfo = this.parseContentType(String(value));
|
|
336
|
+
const prevHeaderInfo = this.parsedContentTypeHeader();
|
|
337
|
+
let charset = newHeaderInfo.charset || prevHeaderInfo.charset;
|
|
338
|
+
if (!charset && !prevHeaderInfo.mimeType) {
|
|
339
|
+
charset = this.constructor.defaultCharset;
|
|
340
|
+
}
|
|
341
|
+
this.setContentType(newHeaderInfo.mimeType, charset);
|
|
342
|
+
}
|
|
343
|
+
get charset() {
|
|
344
|
+
const headerInfo = this.parsedContentTypeHeader();
|
|
345
|
+
return headerInfo.charset || this.constructor.defaultCharset;
|
|
346
|
+
}
|
|
347
|
+
set charset(charset) {
|
|
348
|
+
const contentType = this.parsedContentTypeHeader().mimeType;
|
|
349
|
+
if (charset === false) {
|
|
350
|
+
this.setContentType(contentType, undefined);
|
|
351
|
+
}
|
|
352
|
+
else {
|
|
353
|
+
const defaultCharset = this.constructor.defaultCharset;
|
|
354
|
+
this.setContentType(contentType, charset || defaultCharset);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
set sendingFile(v) {
|
|
358
|
+
if (v === true)
|
|
359
|
+
this.charset = false;
|
|
360
|
+
}
|
|
361
|
+
get body() {
|
|
362
|
+
if (rbObjRespondTo(this.stream, "toAry")) {
|
|
363
|
+
return aryJoin(this.stream
|
|
364
|
+
.toAry()
|
|
365
|
+
.map((part) => (part instanceof Uint8Array ? strNew(Array.from(part)) : part)));
|
|
366
|
+
}
|
|
367
|
+
else if (rbObjRespondTo(this.stream, "body")) {
|
|
368
|
+
return this.stream.body;
|
|
369
|
+
}
|
|
370
|
+
else {
|
|
371
|
+
return this.stream;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
async setBody(body) {
|
|
375
|
+
if (typeof body === "string" || body instanceof Uint8Array) {
|
|
376
|
+
this.stream = await this.buildBuffer(this, [body]);
|
|
377
|
+
}
|
|
378
|
+
else if (rbObjRespondTo(body, "toPath")) {
|
|
379
|
+
this.stream = body;
|
|
380
|
+
}
|
|
381
|
+
else if (rbObjRespondTo(body, "toAry")) {
|
|
382
|
+
this.stream = await this.buildBuffer(this, body);
|
|
383
|
+
}
|
|
384
|
+
else {
|
|
385
|
+
this.stream = body;
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
get contentLength() {
|
|
389
|
+
const cl = this.getHeader("content-length");
|
|
390
|
+
if (!cl)
|
|
391
|
+
return undefined;
|
|
392
|
+
return parseInt(cl, 10);
|
|
393
|
+
}
|
|
394
|
+
write(string) {
|
|
395
|
+
return this.stream.write(string);
|
|
396
|
+
}
|
|
397
|
+
close() {
|
|
398
|
+
const stream = this.stream;
|
|
399
|
+
if (typeof stream?.close === "function")
|
|
400
|
+
return stream.close();
|
|
401
|
+
}
|
|
402
|
+
get committed() {
|
|
403
|
+
return this._committed;
|
|
404
|
+
}
|
|
405
|
+
get location() {
|
|
406
|
+
return this.getHeader("location");
|
|
407
|
+
}
|
|
408
|
+
set location(url) {
|
|
409
|
+
this.setHeader("location", url);
|
|
410
|
+
}
|
|
411
|
+
filteredLocation() {
|
|
412
|
+
return _filteredLocation.call(this);
|
|
413
|
+
}
|
|
414
|
+
/** @internal */
|
|
415
|
+
setCookie(name, value) {
|
|
416
|
+
const header = this.getHeader(SET_COOKIE);
|
|
417
|
+
const cookie = setCookieHeader(name, value);
|
|
418
|
+
this.setHeader(SET_COOKIE, header === undefined ? cookie : `${header}\n${cookie}`);
|
|
419
|
+
}
|
|
420
|
+
deleteCookie(name, options = {}) {
|
|
421
|
+
const header = deleteSetCookieHeaderBang(this.getHeader(SET_COOKIE) ?? null, name, options);
|
|
422
|
+
this.setHeader(SET_COOKIE, Array.isArray(header) ? header.join("\n") : header);
|
|
423
|
+
}
|
|
424
|
+
get cookies() {
|
|
425
|
+
const cookies = {};
|
|
426
|
+
let header = this.getHeader(SET_COOKIE);
|
|
427
|
+
if (header != null) {
|
|
428
|
+
if (typeof header === "string")
|
|
429
|
+
header = stringSplit(header, "\n");
|
|
430
|
+
for (const cookie of header) {
|
|
431
|
+
const pair = stringSplit(cookie, ";")[0];
|
|
432
|
+
if (pair != null) {
|
|
433
|
+
const [key, value = null] = stringSplit(pair, "=").map((v) => unescape(v));
|
|
434
|
+
cookies[key] = value;
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
return cookies;
|
|
439
|
+
}
|
|
440
|
+
/** @internal */
|
|
441
|
+
get _cacheControl() {
|
|
442
|
+
return this.getHeader("cache-control");
|
|
443
|
+
}
|
|
444
|
+
set _cacheControl(value) {
|
|
445
|
+
if (value) {
|
|
446
|
+
this.setHeader("cache-control", value);
|
|
447
|
+
}
|
|
448
|
+
else {
|
|
449
|
+
this.deleteHeader("cache-control");
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
/** @missingRailsName status — PERMANENT */
|
|
453
|
+
toA() {
|
|
454
|
+
this.commitBang();
|
|
455
|
+
return this.rackResponse(this._status, this._headers.toH());
|
|
456
|
+
}
|
|
457
|
+
prepareBang() {
|
|
458
|
+
return this.toA();
|
|
459
|
+
}
|
|
460
|
+
bodyParts() {
|
|
461
|
+
const parts = [];
|
|
462
|
+
this.stream.each((x) => parts.push(x));
|
|
463
|
+
return parts;
|
|
464
|
+
}
|
|
465
|
+
sendFile(path) {
|
|
466
|
+
this.commitBang();
|
|
467
|
+
this.stream = new FileBody(path);
|
|
468
|
+
}
|
|
469
|
+
async resetBodyBang() {
|
|
470
|
+
this.stream = await this.buildBuffer(this, []);
|
|
471
|
+
}
|
|
472
|
+
each(block) {
|
|
473
|
+
this.sendingBang();
|
|
474
|
+
const x = this.stream.each(block);
|
|
475
|
+
this.sentBang();
|
|
476
|
+
return x;
|
|
477
|
+
}
|
|
478
|
+
abort() {
|
|
479
|
+
const s = this.stream;
|
|
480
|
+
if (!s)
|
|
481
|
+
return;
|
|
482
|
+
if (typeof s.abort === "function") {
|
|
483
|
+
return s.abort();
|
|
484
|
+
}
|
|
485
|
+
else if (typeof s.close === "function") {
|
|
486
|
+
return s.close();
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
commitBang() {
|
|
490
|
+
this.beforeCommitted();
|
|
491
|
+
this._committed = true;
|
|
492
|
+
for (const broadcast of this.cv.splice(0))
|
|
493
|
+
broadcast();
|
|
494
|
+
}
|
|
495
|
+
sendingBang() {
|
|
496
|
+
this.beforeSending();
|
|
497
|
+
this._sending = true;
|
|
498
|
+
for (const broadcast of this.cv.splice(0))
|
|
499
|
+
broadcast();
|
|
500
|
+
}
|
|
501
|
+
sentBang() {
|
|
502
|
+
this._sent = true;
|
|
503
|
+
for (const broadcast of this.cv.splice(0))
|
|
504
|
+
broadcast();
|
|
505
|
+
}
|
|
506
|
+
get isSending() {
|
|
507
|
+
return this._sending;
|
|
508
|
+
}
|
|
509
|
+
get isSent() {
|
|
510
|
+
return this._sent;
|
|
511
|
+
}
|
|
512
|
+
async awaitCommit() {
|
|
513
|
+
if (this._committed)
|
|
514
|
+
return;
|
|
515
|
+
while (!this._committed)
|
|
516
|
+
await new Promise((broadcast) => this.cv.push(broadcast));
|
|
517
|
+
/** @inventedArm setTimeout — PERMANENT */
|
|
518
|
+
await new Promise((resume) => setTimeout(resume, 0));
|
|
519
|
+
}
|
|
520
|
+
async awaitSent() {
|
|
521
|
+
while (!this._sent)
|
|
522
|
+
await new Promise((broadcast) => this.cv.push(broadcast));
|
|
523
|
+
}
|
|
524
|
+
get header() {
|
|
525
|
+
return this._headers;
|
|
526
|
+
}
|
|
527
|
+
hasHeader(key) {
|
|
528
|
+
return this._headers.hasKey(key);
|
|
529
|
+
}
|
|
530
|
+
get responseCode() {
|
|
531
|
+
return this._status;
|
|
532
|
+
}
|
|
533
|
+
get statusMessage() {
|
|
534
|
+
return this.message;
|
|
535
|
+
}
|
|
536
|
+
get redirectUrl() {
|
|
537
|
+
return this.location;
|
|
538
|
+
}
|
|
539
|
+
get mediaType() {
|
|
540
|
+
return this.parsedContentTypeHeader().mimeType;
|
|
541
|
+
}
|
|
542
|
+
/** @internal */
|
|
543
|
+
parseContentType(contentType) {
|
|
544
|
+
let match;
|
|
545
|
+
if (contentType && (match = CONTENT_TYPE_PARSER.exec(contentType))) {
|
|
546
|
+
return new ContentTypeHeader(match.groups["mime_type"] ?? null, match.groups["charset"] ?? null);
|
|
547
|
+
}
|
|
548
|
+
else {
|
|
549
|
+
return NULL_CONTENT_TYPE_HEADER;
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
/** @internal */
|
|
553
|
+
parsedContentTypeHeader() {
|
|
554
|
+
return this.parseContentType(this.getHeader(CONTENT_TYPE));
|
|
555
|
+
}
|
|
556
|
+
/** @internal */
|
|
557
|
+
setContentType(contentType, charset) {
|
|
558
|
+
let type = contentType ?? "";
|
|
559
|
+
if (charset)
|
|
560
|
+
type = `${type}; charset=${String(charset).toLowerCase()}`;
|
|
561
|
+
this.setHeader(CONTENT_TYPE, type);
|
|
562
|
+
}
|
|
563
|
+
/** @internal */
|
|
564
|
+
beforeCommitted() {
|
|
565
|
+
if (this._committed)
|
|
566
|
+
return;
|
|
567
|
+
this.assignDefaultContentTypeAndCharsetBang();
|
|
568
|
+
this.mergeAndNormalizeCacheControlBang(this.cacheControl);
|
|
569
|
+
this.handleConditionalGetBang();
|
|
570
|
+
this.handleNoContentBang();
|
|
571
|
+
}
|
|
572
|
+
/** @internal */
|
|
573
|
+
beforeSending() {
|
|
574
|
+
if (!this.committed)
|
|
575
|
+
this.commitBang();
|
|
576
|
+
if (!this.committed)
|
|
577
|
+
this.request.commitCookieJarBang();
|
|
578
|
+
}
|
|
579
|
+
/** @internal */
|
|
580
|
+
buildBuffer(response, body) {
|
|
581
|
+
return new Buffer(response, body);
|
|
582
|
+
}
|
|
583
|
+
/** @internal */
|
|
584
|
+
assignDefaultContentTypeAndCharsetBang() {
|
|
585
|
+
if (this.mediaType)
|
|
586
|
+
return;
|
|
587
|
+
const ct = this.parsedContentTypeHeader();
|
|
588
|
+
const charset = ct.charset ?? this.constructor.defaultCharset;
|
|
589
|
+
this.setContentType(ct.mimeType ?? "text/html", charset);
|
|
590
|
+
}
|
|
591
|
+
/** @internal */
|
|
592
|
+
handleNoContentBang() {
|
|
593
|
+
if (NO_CONTENT_CODES.includes(this._status)) {
|
|
594
|
+
this._headers.delete(CONTENT_TYPE);
|
|
595
|
+
this._headers.delete("Content-Length");
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
/** @internal */
|
|
599
|
+
rackResponse(status, headers) {
|
|
600
|
+
if (NO_CONTENT_CODES.includes(status))
|
|
601
|
+
return [status, headers, []];
|
|
602
|
+
return [status, headers, new RackBody(this)];
|
|
603
|
+
}
|
|
604
|
+
/** @internal */
|
|
605
|
+
generateWeakEtag(validators) {
|
|
606
|
+
return _generateWeakEtag(validators);
|
|
607
|
+
}
|
|
608
|
+
/** @internal */
|
|
609
|
+
generateStrongEtag(validators) {
|
|
610
|
+
return _generateStrongEtag(validators);
|
|
611
|
+
}
|
|
612
|
+
/** @internal */
|
|
613
|
+
prepareCacheControlBang() {
|
|
614
|
+
return _prepareCacheControlBang.call(this);
|
|
615
|
+
}
|
|
616
|
+
static mergeDefaultHeaders(original, defaults) {
|
|
617
|
+
if (!defaults)
|
|
618
|
+
return original;
|
|
619
|
+
return { ...defaults, ...original };
|
|
620
|
+
}
|
|
621
|
+
static async create(status = 200, headers = {}, body = [], { defaultHeaders } = {}) {
|
|
622
|
+
headers = this.mergeDefaultHeaders(headers, defaultHeaders ?? this.defaultHeaders);
|
|
623
|
+
return this.new(status, headers, body);
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
for (const name of ["lastModified", "date", "etag"]) {
|
|
627
|
+
Object.defineProperty(Response.prototype, name, {
|
|
628
|
+
...Object.getOwnPropertyDescriptor(CacheResponse.prototype, name),
|
|
629
|
+
configurable: true,
|
|
630
|
+
});
|
|
631
|
+
rbClearMethodCache();
|
|
632
|
+
}
|
|
633
|
+
Object.defineProperty(Response.prototype, "isLastModified", {
|
|
634
|
+
get() {
|
|
635
|
+
return _isLastModified.call(this);
|
|
636
|
+
},
|
|
637
|
+
configurable: true,
|
|
638
|
+
});
|
|
639
|
+
Object.defineProperty(Response.prototype, "isDate", {
|
|
640
|
+
get() {
|
|
641
|
+
return _isDate.call(this);
|
|
642
|
+
},
|
|
643
|
+
configurable: true,
|
|
644
|
+
});
|
|
645
|
+
Object.defineProperty(Response.prototype, "isEtag", {
|
|
646
|
+
get() {
|
|
647
|
+
return _isEtag.call(this);
|
|
648
|
+
},
|
|
649
|
+
configurable: true,
|
|
650
|
+
});
|
|
651
|
+
Response.prototype.weakEtag = function (v) {
|
|
652
|
+
_weakEtag.call(this, v);
|
|
653
|
+
};
|
|
654
|
+
Response.prototype.strongEtag = function (v) {
|
|
655
|
+
_strongEtag.call(this, v);
|
|
656
|
+
};
|
|
657
|
+
Response.prototype.isWeakEtag = function () {
|
|
658
|
+
return _isWeakEtag.call(this);
|
|
659
|
+
};
|
|
660
|
+
Response.prototype.isStrongEtag = function () {
|
|
661
|
+
return _isStrongEtag.call(this);
|
|
662
|
+
};
|
|
663
|
+
Response.prototype.handleConditionalGetBang = function () {
|
|
664
|
+
_handleConditionalGetBang.call(this);
|
|
665
|
+
};
|
|
666
|
+
Response.prototype.mergeAndNormalizeCacheControlBang = function (cacheControl) {
|
|
667
|
+
_mergeAndNormalizeCacheControlBang.call(this, cacheControl);
|
|
668
|
+
};
|
|
669
|
+
Response.prototype.cacheControlSegments = function () {
|
|
670
|
+
return _cacheControlSegments.call(this);
|
|
671
|
+
};
|
|
672
|
+
Response.prototype.cacheControlHeaders = function () {
|
|
673
|
+
return _cacheControlHeaders.call(this);
|
|
674
|
+
};
|
|
675
|
+
Response.prototype.locationFilters = function () {
|
|
676
|
+
return _locationFilters.call(this);
|
|
677
|
+
};
|
|
678
|
+
Response.prototype.isLocationFilterMatch = function () {
|
|
679
|
+
return _locationFilterMatch.call(this);
|
|
680
|
+
};
|
|
681
|
+
Response.prototype.parameterFilteredLocation = function () {
|
|
682
|
+
return _parameterFilteredLocation.call(this);
|
|
683
|
+
};
|
|
684
|
+
include(Response, RackResponseHelpers);
|
|
685
|
+
Object.defineProperty(Response.prototype, "cacheControl", {
|
|
686
|
+
...Object.getOwnPropertyDescriptor(RackResponseHelpers.prototype, "cacheControl"),
|
|
687
|
+
get: Object.getOwnPropertyDescriptor(CacheResponse.prototype, "cacheControl").get,
|
|
688
|
+
configurable: true,
|
|
689
|
+
});
|
|
690
|
+
runLoadHooks("action_dispatch_response", Response);
|
|
691
|
+
//# sourceMappingURL=response.js.map
|