@shopify/remix-oxygen
Advanced tools
Comparing version 0.0.0-next-744c490-20230315124602 to 0.0.0-next-7aaa4e8-20230523161105
@@ -54,2 +54,3 @@ import { createCookieFactory, createCookieSessionStorageFactory, createSessionStorageFactory, createMemorySessionStorageFactory, createRequestHandler as createRequestHandler$1 } from '@remix-run/server-runtime'; | ||
mode, | ||
poweredByHeader = true, | ||
getLoadContext | ||
@@ -59,6 +60,10 @@ }) { | ||
return async (request) => { | ||
return handleRequest( | ||
const response = await handleRequest( | ||
request, | ||
await getLoadContext?.(request) | ||
); | ||
if (poweredByHeader) { | ||
response.headers.append("powered-by", "Hydrogen"); | ||
} | ||
return response; | ||
}; | ||
@@ -65,0 +70,0 @@ } |
import * as _remix_run_server_runtime from '@remix-run/server-runtime'; | ||
import { ServerBuild } from '@remix-run/server-runtime'; | ||
export { ActionArgs, ActionFunction, AppData, AppLoadContext, Cookie, CookieOptions, CookieParseOptions, CookieSerializeOptions, CookieSignatureOptions, DataFunctionArgs, EntryContext, ErrorBoundaryComponent, HandleDataRequestFunction, HandleDocumentRequestFunction, HeadersFunction, HtmlLinkDescriptor, HtmlMetaDescriptor, LinkDescriptor, LinksFunction, LoaderArgs, LoaderFunction, MaxPartSizeExceededError, MemoryUploadHandlerFilterArgs, MemoryUploadHandlerOptions, MetaDescriptor, MetaFunction, PageLinkDescriptor, RequestHandler, RouteComponent, RouteHandle, SerializeFrom, ServerBuild, ServerEntryModule, Session, SessionData, SessionIdStorageStrategy, SessionStorage, SignFunction, TypedResponse, UnsignFunction, UploadHandler, UploadHandlerPart, V2_MetaFunction, createSession, defer, isCookie, isSession, json, redirect, unstable_composeUploadHandlers, unstable_createMemoryUploadHandler, unstable_parseMultipartFormData } from '@remix-run/server-runtime'; | ||
export { ActionArgs, ActionFunction, AppData, AppLoadContext, Cookie, CookieOptions, CookieParseOptions, CookieSerializeOptions, CookieSignatureOptions, DataFunctionArgs, EntryContext, ErrorBoundaryComponent, HandleDataRequestFunction, HandleDocumentRequestFunction, HeadersFunction, HtmlLinkDescriptor, HtmlMetaDescriptor, LinkDescriptor, LinksFunction, LoaderArgs, LoaderFunction, MaxPartSizeExceededError, MemoryUploadHandlerFilterArgs, MemoryUploadHandlerOptions, MetaDescriptor, MetaFunction, PageLinkDescriptor, RequestHandler, RouteComponent, RouteHandle, SerializeFrom, ServerBuild, ServerEntryModule, Session, SessionData, SessionIdStorageStrategy, SessionStorage, SignFunction, TypedResponse, UnsignFunction, UploadHandler, UploadHandlerPart, V2_ServerRuntimeMetaDescriptor as V2_HtmlMetaDescriptor, V2_ServerRuntimeMetaArgs as V2_MetaArgs, V2_ServerRuntimeMetaDescriptor as V2_MetaDescriptor, V2_ServerRuntimeMetaFunction as V2_MetaFunction, createSession, defer, isCookie, isSession, json, redirect, unstable_composeUploadHandlers, unstable_createMemoryUploadHandler, unstable_parseMultipartFormData } from '@remix-run/server-runtime'; | ||
@@ -10,5 +10,6 @@ declare const createCookie: _remix_run_server_runtime.CreateCookieFunction; | ||
declare function createRequestHandler<Context = unknown>({ build, mode, getLoadContext, }: { | ||
declare function createRequestHandler<Context = unknown>({ build, mode, poweredByHeader, getLoadContext, }: { | ||
build: ServerBuild; | ||
mode?: string; | ||
poweredByHeader?: boolean; | ||
getLoadContext?: (request: Request) => Promise<Context> | Context; | ||
@@ -15,0 +16,0 @@ }): (request: Request) => Promise<Response>; |
import { createCookieFactory, createCookieSessionStorageFactory, createSessionStorageFactory, createMemorySessionStorageFactory, createRequestHandler } from '@remix-run/server-runtime'; | ||
export { MaxPartSizeExceededError, createSession, defer, isCookie, isSession, json, redirect, unstable_composeUploadHandlers, unstable_createMemoryUploadHandler, unstable_parseMultipartFormData } from '@remix-run/server-runtime'; | ||
var s=new TextEncoder,c=async(e,t)=>{let o=await p(t,["sign"]),r=s.encode(e),n=await crypto.subtle.sign("HMAC",o,r),a=btoa(String.fromCharCode(...new Uint8Array(n))).replace(/=+$/,"");return e+"."+a},u=async(e,t)=>{let o=e.lastIndexOf("."),r=e.slice(0,o),n=e.slice(o+1),a=await p(t,["verify"]),l=s.encode(r),y=g(atob(n));return await crypto.subtle.verify("HMAC",a,y,l)?r:!1};async function p(e,t){return await crypto.subtle.importKey("raw",s.encode(e),{name:"HMAC",hash:"SHA-256"},!1,t)}function g(e){let t=new Uint8Array(e.length);for(let o=0;o<e.length;o++)t[o]=e.charCodeAt(o);return t}var i=createCookieFactory({sign:c,unsign:u}),f=createCookieSessionStorageFactory(i),d=createSessionStorageFactory(i),H=createMemorySessionStorageFactory(d);function F({build:e,mode:t,getLoadContext:o}){let r=createRequestHandler(e,t);return async n=>r(n,await o?.(n))}function A(e){return e.headers.get("oxygen-buyer-ip")??void 0}function M(e){let t=e.headers;return {requestGroupId:t.get("request-id"),buyerIp:t.get("oxygen-buyer-ip"),cookie:t.get("cookie")}} | ||
var i=new TextEncoder,u=async(e,t)=>{let r=await d(t,["sign"]),o=i.encode(e),a=await crypto.subtle.sign("HMAC",r,o),n=btoa(String.fromCharCode(...new Uint8Array(a))).replace(/=+$/,"");return e+"."+n},p=async(e,t)=>{let r=e.lastIndexOf("."),o=e.slice(0,r),a=e.slice(r+1),n=await d(t,["verify"]),s=i.encode(o),y=g(atob(a));return await crypto.subtle.verify("HMAC",n,y,s)?o:!1};async function d(e,t){return await crypto.subtle.importKey("raw",i.encode(e),{name:"HMAC",hash:"SHA-256"},!1,t)}function g(e){let t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}var c=createCookieFactory({sign:u,unsign:p}),H=createCookieSessionStorageFactory(c),l=createSessionStorageFactory(c),f=createMemorySessionStorageFactory(l);function F({build:e,mode:t,poweredByHeader:r=!0,getLoadContext:o}){let a=createRequestHandler(e,t);return async n=>{let s=await a(n,await o?.(n));return r&&s.headers.append("powered-by","Hydrogen"),s}}function M(e){return e.headers.get("oxygen-buyer-ip")??void 0}function A(e){let t=e.headers;return {requestGroupId:t.get("request-id"),buyerIp:t.get("oxygen-buyer-ip"),cookie:t.get("cookie")}} | ||
export { i as createCookie, f as createCookieSessionStorage, H as createMemorySessionStorage, F as createRequestHandler, d as createSessionStorage, A as getBuyerIp, M as getStorefrontHeaders }; | ||
export { c as createCookie, H as createCookieSessionStorage, f as createMemorySessionStorage, F as createRequestHandler, l as createSessionStorage, M as getBuyerIp, A as getStorefrontHeaders }; | ||
//# sourceMappingURL=out.js.map | ||
//# sourceMappingURL=index.js.map |
@@ -8,4 +8,4 @@ { | ||
"type": "module", | ||
"version": "0.0.0-next-744c490-20230315124602", | ||
"license": "SEE LICENSE IN LICENSE.md", | ||
"version": "0.0.0-next-7aaa4e8-20230523161105", | ||
"license": "MIT", | ||
"main": "dist/index.cjs", | ||
@@ -44,3 +44,3 @@ "module": "dist/production/index.js", | ||
"dependencies": { | ||
"@remix-run/server-runtime": "1.14.0" | ||
"@remix-run/server-runtime": "1.15.0" | ||
}, | ||
@@ -47,0 +47,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Misc. License Issues
License(Experimental) A package's licensing information has fine-grained problems.
Found 1 instance in 1 package
46385
0
291
+ Added@remix-run/router@1.5.0(transitive)
+ Added@remix-run/server-runtime@1.15.0(transitive)
- Removed@remix-run/router@1.3.3(transitive)
- Removed@remix-run/server-runtime@1.14.0(transitive)