@tanstack/start-server-core 1.169.6 → 1.169.8

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.
@@ -1,5 +1,5 @@
1
1
  import { AsyncLocalStorage } from "node:async_hooks";
2
- import { H3Event, clearSession, deleteCookie, getRequestHost, getRequestIP, getRequestProtocol, getRequestURL, getSession, getValidatedQuery, parseCookies, sanitizeStatusCode, sanitizeStatusMessage, sealSession, setCookie, toResponse, unsealSession, updateSession, useSession } from "h3-v2";
2
+ import { H3Event, clearSession as clearSession$1, deleteCookie as deleteCookie$1, getRequestHost as getRequestHost$1, getRequestIP as getRequestIP$1, getRequestProtocol as getRequestProtocol$1, getRequestURL, getSession as getSession$1, getValidatedQuery as getValidatedQuery$1, parseCookies, sanitizeStatusCode, sanitizeStatusMessage, sealSession as sealSession$1, setCookie as setCookie$1, toResponse, unsealSession as unsealSession$1, updateSession as updateSession$1, useSession as useSession$1 } from "h3-v2";
3
3
  //#region src/request-response.ts
4
4
  var GLOBAL_EVENT_STORAGE_KEY = Symbol.for("tanstack-start:event-storage");
5
5
  var globalObj = globalThis;
@@ -60,8 +60,8 @@ function getRequestHeaders() {
60
60
  function getRequestHeader(name) {
61
61
  return getRequestHeaders().get(name) || void 0;
62
62
  }
63
- function getRequestIP$1(opts) {
64
- return getRequestIP(getH3Event(), opts);
63
+ function getRequestIP(opts) {
64
+ return getRequestIP$1(getH3Event(), opts);
65
65
  }
66
66
  /**
67
67
  * Get the request hostname.
@@ -70,8 +70,8 @@ function getRequestIP$1(opts) {
70
70
  *
71
71
  * If no host header is found, it will default to "localhost".
72
72
  */
73
- function getRequestHost$1(opts) {
74
- return getRequestHost(getH3Event(), opts);
73
+ function getRequestHost(opts) {
74
+ return getRequestHost$1(getH3Event(), opts);
75
75
  }
76
76
  /**
77
77
  * Get the full incoming request URL.
@@ -90,8 +90,8 @@ function getRequestUrl(opts) {
90
90
  *
91
91
  * If protocol cannot be determined, it will default to "http".
92
92
  */
93
- function getRequestProtocol$1(opts) {
94
- return getRequestProtocol(getH3Event(), opts);
93
+ function getRequestProtocol(opts) {
94
+ return getRequestProtocol$1(getH3Event(), opts);
95
95
  }
96
96
  function setResponseHeaders(headers) {
97
97
  const event = getH3Event();
@@ -159,8 +159,8 @@ function getCookie(name) {
159
159
  * setCookie('Authorization', '1234567')
160
160
  * ```
161
161
  */
162
- function setCookie$1(name, value, options) {
163
- setCookie(getH3Event(), name, value, options);
162
+ function setCookie(name, value, options) {
163
+ setCookie$1(getH3Event(), name, value, options);
164
164
  }
165
165
  /**
166
166
  * Remove a cookie by name.
@@ -170,8 +170,8 @@ function setCookie$1(name, value, options) {
170
170
  * deleteCookie('SessionId')
171
171
  * ```
172
172
  */
173
- function deleteCookie$1(name, options) {
174
- deleteCookie(getH3Event(), name, options);
173
+ function deleteCookie(name, options) {
174
+ deleteCookie$1(getH3Event(), name, options);
175
175
  }
176
176
  function getDefaultSessionConfig(config) {
177
177
  return {
@@ -182,38 +182,38 @@ function getDefaultSessionConfig(config) {
182
182
  /**
183
183
  * Create a session manager for the current request.
184
184
  */
185
- function useSession$1(config) {
186
- return useSession(getH3Event(), getDefaultSessionConfig(config));
185
+ function useSession(config) {
186
+ return useSession$1(getH3Event(), getDefaultSessionConfig(config));
187
187
  }
188
188
  /**
189
189
  * Get the session for the current request
190
190
  */
191
- function getSession$1(config) {
192
- return getSession(getH3Event(), getDefaultSessionConfig(config));
191
+ function getSession(config) {
192
+ return getSession$1(getH3Event(), getDefaultSessionConfig(config));
193
193
  }
194
194
  /**
195
195
  * Update the session data for the current request.
196
196
  */
197
- function updateSession$1(config, update) {
198
- return updateSession(getH3Event(), getDefaultSessionConfig(config), update);
197
+ function updateSession(config, update) {
198
+ return updateSession$1(getH3Event(), getDefaultSessionConfig(config), update);
199
199
  }
200
200
  /**
201
201
  * Encrypt and sign the session data for the current request.
202
202
  */
203
- function sealSession$1(config) {
204
- return sealSession(getH3Event(), getDefaultSessionConfig(config));
203
+ function sealSession(config) {
204
+ return sealSession$1(getH3Event(), getDefaultSessionConfig(config));
205
205
  }
206
206
  /**
207
207
  * Decrypt and verify the session data for the current request.
208
208
  */
209
- function unsealSession$1(config, sealed) {
210
- return unsealSession(getH3Event(), getDefaultSessionConfig(config), sealed);
209
+ function unsealSession(config, sealed) {
210
+ return unsealSession$1(getH3Event(), getDefaultSessionConfig(config), sealed);
211
211
  }
212
212
  /**
213
213
  * Clear the session data for the current request.
214
214
  */
215
- function clearSession$1(config) {
216
- return clearSession(getH3Event(), {
215
+ function clearSession(config) {
216
+ return clearSession$1(getH3Event(), {
217
217
  name: "start",
218
218
  ...config
219
219
  });
@@ -221,10 +221,10 @@ function clearSession$1(config) {
221
221
  function getResponse() {
222
222
  return getH3Event().res;
223
223
  }
224
- function getValidatedQuery$1(schema) {
225
- return getValidatedQuery(getH3Event(), schema);
224
+ function getValidatedQuery(schema) {
225
+ return getValidatedQuery$1(getH3Event(), schema);
226
226
  }
227
227
  //#endregion
228
- export { clearResponseHeaders, clearSession$1 as clearSession, deleteCookie$1 as deleteCookie, getCookie, getCookies, getRequest, getRequestHeader, getRequestHeaders, getRequestHost$1 as getRequestHost, getRequestIP$1 as getRequestIP, getRequestProtocol$1 as getRequestProtocol, getRequestUrl, getResponse, getResponseHeader, getResponseHeaders, getResponseStatus, getSession$1 as getSession, getValidatedQuery$1 as getValidatedQuery, removeResponseHeader, requestHandler, sealSession$1 as sealSession, setCookie$1 as setCookie, setResponseHeader, setResponseHeaders, setResponseStatus, unsealSession$1 as unsealSession, updateSession$1 as updateSession, useSession$1 as useSession };
228
+ export { clearResponseHeaders, clearSession, deleteCookie, getCookie, getCookies, getRequest, getRequestHeader, getRequestHeaders, getRequestHost, getRequestIP, getRequestProtocol, getRequestUrl, getResponse, getResponseHeader, getResponseHeaders, getResponseStatus, getSession, getValidatedQuery, removeResponseHeader, requestHandler, sealSession, setCookie, setResponseHeader, setResponseHeaders, setResponseStatus, unsealSession, updateSession, useSession };
229
229
 
230
230
  //# sourceMappingURL=request-response.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"request-response.js","names":[],"sources":["../../src/request-response.ts"],"sourcesContent":["import { AsyncLocalStorage } from 'node:async_hooks'\n\nimport {\n H3Event,\n clearSession as h3_clearSession,\n deleteCookie as h3_deleteCookie,\n getRequestHost as h3_getRequestHost,\n getRequestIP as h3_getRequestIP,\n getRequestProtocol as h3_getRequestProtocol,\n getRequestURL as h3_getRequestURL,\n getSession as h3_getSession,\n getValidatedQuery as h3_getValidatedQuery,\n parseCookies as h3_parseCookies,\n sanitizeStatusCode as h3_sanitizeStatusCode,\n sanitizeStatusMessage as h3_sanitizeStatusMessage,\n sealSession as h3_sealSession,\n setCookie as h3_setCookie,\n toResponse as h3_toResponse,\n unsealSession as h3_unsealSession,\n updateSession as h3_updateSession,\n useSession as h3_useSession,\n} from 'h3-v2'\nimport type {\n RequestHeaderMap,\n RequestHeaderName,\n ResponseHeaderMap,\n ResponseHeaderName,\n TypedHeaders,\n} from 'fetchdts'\n\nimport type { CookieSerializeOptions } from 'cookie-es'\nimport type {\n Session,\n SessionConfig,\n SessionData,\n SessionManager,\n SessionUpdate,\n} from './session'\nimport type { StandardSchemaV1 } from '@standard-schema/spec'\nimport type { RequestHandler } from './request-handler'\n\ninterface StartEvent {\n h3Event: H3Event\n}\n\n// Use a global symbol to ensure the same AsyncLocalStorage instance is shared\n// across different bundles that may each bundle this module.\nconst GLOBAL_EVENT_STORAGE_KEY = Symbol.for('tanstack-start:event-storage')\n\nconst globalObj = globalThis as typeof globalThis & {\n [GLOBAL_EVENT_STORAGE_KEY]?: AsyncLocalStorage<StartEvent>\n}\n\nif (!globalObj[GLOBAL_EVENT_STORAGE_KEY]) {\n globalObj[GLOBAL_EVENT_STORAGE_KEY] = new AsyncLocalStorage<StartEvent>()\n}\n\nconst eventStorage = globalObj[GLOBAL_EVENT_STORAGE_KEY]\n\nexport type { ResponseHeaderName, RequestHeaderName }\n\ntype HeadersWithGetSetCookie = Headers & {\n getSetCookie?: () => Array<string>\n}\n\ntype MaybePromise<T> = T | Promise<T>\n\nfunction isPromiseLike<T>(value: MaybePromise<T>): value is Promise<T> {\n return typeof (value as Promise<T>).then === 'function'\n}\n\nfunction getSetCookieValues(headers: Headers): Array<string> {\n const headersWithSetCookie = headers as HeadersWithGetSetCookie\n if (typeof headersWithSetCookie.getSetCookie === 'function') {\n return headersWithSetCookie.getSetCookie()\n }\n const value = headers.get('set-cookie')\n return value ? [value] : []\n}\n\nfunction mergeEventResponseHeaders(response: Response, event: H3Event): void {\n if (response.ok) {\n return\n }\n\n const eventSetCookies = getSetCookieValues(event.res.headers)\n if (eventSetCookies.length === 0) {\n return\n }\n\n const responseSetCookies = getSetCookieValues(response.headers)\n response.headers.delete('set-cookie')\n for (const cookie of responseSetCookies) {\n response.headers.append('set-cookie', cookie)\n }\n for (const cookie of eventSetCookies) {\n response.headers.append('set-cookie', cookie)\n }\n}\n\nfunction attachResponseHeaders<T>(\n value: MaybePromise<T>,\n event: H3Event,\n): MaybePromise<T> {\n if (isPromiseLike(value)) {\n return value.then((resolved) => {\n if (resolved instanceof Response) {\n mergeEventResponseHeaders(resolved, event)\n }\n return resolved\n })\n }\n\n if (value instanceof Response) {\n mergeEventResponseHeaders(value, event)\n }\n\n return value\n}\n\nexport function requestHandler<TRegister = unknown>(\n handler: RequestHandler<TRegister>,\n) {\n return (request: Request, requestOpts: any): Promise<Response> | Response => {\n let h3Event: H3Event\n try {\n h3Event = new H3Event(request)\n } catch (error) {\n if (error instanceof URIError) {\n return new Response(null, {\n status: 400,\n statusText: 'Bad Request',\n })\n }\n throw error\n }\n\n const response = eventStorage.run({ h3Event }, () =>\n handler(request, requestOpts),\n )\n return h3_toResponse(attachResponseHeaders(response, h3Event), h3Event)\n }\n}\n\nfunction getH3Event() {\n const event = eventStorage.getStore()\n if (!event) {\n throw new Error(\n `No StartEvent found in AsyncLocalStorage. Make sure you are using the function within the server runtime.`,\n )\n }\n return event.h3Event\n}\n\nexport function getRequest(): Request {\n const event = getH3Event()\n return event.req\n}\n\nexport function getRequestHeaders(): TypedHeaders<RequestHeaderMap> {\n return getH3Event().req.headers\n}\n\nexport function getRequestHeader(name: RequestHeaderName): string | undefined {\n return getRequestHeaders().get(name) || undefined\n}\n\nexport function getRequestIP(opts?: {\n /**\n * Use the X-Forwarded-For HTTP header set by proxies.\n *\n * Note: Make sure that this header can be trusted (your application running behind a CDN or reverse proxy) before enabling.\n */\n xForwardedFor?: boolean\n}) {\n return h3_getRequestIP(getH3Event(), opts)\n}\n\n/**\n * Get the request hostname.\n *\n * If `xForwardedHost` is `true`, it will use the `x-forwarded-host` header if it exists.\n *\n * If no host header is found, it will default to \"localhost\".\n */\nexport function getRequestHost(opts?: { xForwardedHost?: boolean }) {\n return h3_getRequestHost(getH3Event(), opts)\n}\n\n/**\n * Get the full incoming request URL.\n *\n * If `xForwardedHost` is `true`, it will use the `x-forwarded-host` header if it exists.\n *\n * If `xForwardedProto` is `false`, it will not use the `x-forwarded-proto` header.\n */\nexport function getRequestUrl(opts?: {\n xForwardedHost?: boolean\n xForwardedProto?: boolean\n}) {\n return h3_getRequestURL(getH3Event(), opts)\n}\n\n/**\n * Get the request protocol.\n *\n * If `x-forwarded-proto` header is set to \"https\", it will return \"https\". You can disable this behavior by setting `xForwardedProto` to `false`.\n *\n * If protocol cannot be determined, it will default to \"http\".\n */\nexport function getRequestProtocol(opts?: {\n xForwardedProto?: boolean\n}): 'http' | 'https' | (string & {}) {\n return h3_getRequestProtocol(getH3Event(), opts)\n}\n\nexport function setResponseHeaders(\n headers: TypedHeaders<ResponseHeaderMap>,\n): void {\n const event = getH3Event()\n for (const [name, value] of Object.entries(headers)) {\n event.res.headers.set(name, value)\n }\n}\n\nexport function getResponseHeaders(): TypedHeaders<ResponseHeaderMap> {\n const event = getH3Event()\n return event.res.headers\n}\n\nexport function getResponseHeader(\n name: ResponseHeaderName,\n): string | undefined {\n const event = getH3Event()\n return event.res.headers.get(name) || undefined\n}\n\nexport function setResponseHeader(\n name: ResponseHeaderName,\n value: string | Array<string>,\n): void {\n const event = getH3Event()\n if (Array.isArray(value)) {\n event.res.headers.delete(name)\n for (const valueItem of value) {\n event.res.headers.append(name, valueItem)\n }\n } else {\n event.res.headers.set(name, value)\n }\n}\nexport function removeResponseHeader(name: ResponseHeaderName): void {\n const event = getH3Event()\n event.res.headers.delete(name)\n}\n\nexport function clearResponseHeaders(\n headerNames?: Array<ResponseHeaderName>,\n): void {\n const event = getH3Event()\n // If headerNames is provided, clear only those headers\n if (headerNames && headerNames.length > 0) {\n for (const name of headerNames) {\n event.res.headers.delete(name)\n }\n // Otherwise, clear all headers\n } else {\n for (const name of event.res.headers.keys()) {\n event.res.headers.delete(name)\n }\n }\n}\n\nexport function getResponseStatus(): number {\n return getH3Event().res.status || 200\n}\n\nexport function setResponseStatus(code?: number, text?: string): void {\n const event = getH3Event()\n if (code) {\n event.res.status = h3_sanitizeStatusCode(code, event.res.status)\n }\n if (text) {\n event.res.statusText = h3_sanitizeStatusMessage(text)\n }\n}\n\n/**\n * Parse the request to get HTTP Cookie header string and return an object of all cookie name-value pairs.\n * @returns Object of cookie name-value pairs\n * ```ts\n * const cookies = getCookies()\n * ```\n */\nexport function getCookies(): Record<string, string> {\n const event = getH3Event()\n const cookies = h3_parseCookies(event)\n const definedCookies: Record<string, string> = Object.create(null)\n\n for (const [name, value] of Object.entries(cookies)) {\n if (value !== undefined) {\n definedCookies[name] = value\n }\n }\n\n return definedCookies\n}\n\n/**\n * Get a cookie value by name.\n * @param name Name of the cookie to get\n * @returns {*} Value of the cookie (String or undefined)\n * ```ts\n * const authorization = getCookie('Authorization')\n * ```\n */\nexport function getCookie(name: string): string | undefined {\n return getCookies()[name]\n}\n\n/**\n * Set a cookie value by name.\n * @param name Name of the cookie to set\n * @param value Value of the cookie to set\n * @param options {CookieSerializeOptions} Options for serializing the cookie\n * ```ts\n * setCookie('Authorization', '1234567')\n * ```\n */\nexport function setCookie(\n name: string,\n value: string,\n options?: CookieSerializeOptions,\n): void {\n const event = getH3Event()\n h3_setCookie(event, name, value, options)\n}\n\n/**\n * Remove a cookie by name.\n * @param name Name of the cookie to delete\n * @param serializeOptions {CookieSerializeOptions} Cookie options\n * ```ts\n * deleteCookie('SessionId')\n * ```\n */\nexport function deleteCookie(\n name: string,\n options?: CookieSerializeOptions,\n): void {\n const event = getH3Event()\n h3_deleteCookie(event, name, options)\n}\n\nfunction getDefaultSessionConfig(config: SessionConfig): SessionConfig {\n return {\n name: 'start',\n ...config,\n }\n}\n\n/**\n * Create a session manager for the current request.\n */\nexport function useSession<TSessionData extends SessionData = SessionData>(\n config: SessionConfig,\n): Promise<SessionManager<TSessionData>> {\n const event = getH3Event()\n return h3_useSession(event, getDefaultSessionConfig(config))\n}\n/**\n * Get the session for the current request\n */\nexport function getSession<TSessionData extends SessionData = SessionData>(\n config: SessionConfig,\n): Promise<Session<TSessionData>> {\n const event = getH3Event()\n return h3_getSession(event, getDefaultSessionConfig(config))\n}\n\n/**\n * Update the session data for the current request.\n */\nexport function updateSession<TSessionData extends SessionData = SessionData>(\n config: SessionConfig,\n update?: SessionUpdate<TSessionData>,\n): Promise<Session<TSessionData>> {\n const event = getH3Event()\n return h3_updateSession(event, getDefaultSessionConfig(config), update)\n}\n\n/**\n * Encrypt and sign the session data for the current request.\n */\nexport function sealSession(config: SessionConfig): Promise<string> {\n const event = getH3Event()\n return h3_sealSession(event, getDefaultSessionConfig(config))\n}\n/**\n * Decrypt and verify the session data for the current request.\n */\nexport function unsealSession(\n config: SessionConfig,\n sealed: string,\n): Promise<Partial<Session>> {\n const event = getH3Event()\n return h3_unsealSession(event, getDefaultSessionConfig(config), sealed)\n}\n\n/**\n * Clear the session data for the current request.\n */\nexport function clearSession(config: Partial<SessionConfig>): Promise<void> {\n const event = getH3Event()\n return h3_clearSession(event, { name: 'start', ...config })\n}\n\nexport function getResponse() {\n const event = getH3Event()\n return event.res\n}\n\n// not public API (yet)\nexport function getValidatedQuery<TSchema extends StandardSchema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AACF;;;;AAKA,SAAgB,aACd,QACuC;CAEvC,OAAO,WADO,WACO,GAAO,wBAAwB,MAAM,CAAC;AAC7D;;;;AAIA,SAAgB,aACd,QACgC;CAEhC,OAAO,WADO,WACO,GAAO,wBAAwB,MAAM,CAAC;AAC7D;;;;AAKA,SAAgB,gBACd,QACA,QACgC;CAEhC,OAAO,cADO,WACU,GAAO,wBAAwB,MAAM,GAAG,MAAM;AACxE;;;;AAKA,SAAgB,cAAY,QAAwC;CAElE,OAAO,YADO,WACQ,GAAO,wBAAwB,MAAM,CAAC;AAC9D;;;;AAIA,SAAgB,gBACd,QACA,QAC2B;CAE3B,OAAO,cADO,WACU,GAAO,wBAAwB,MAAM,GAAG,MAAM;AACxE;;;;AAKA,SAAgB,eAAa,QAA+C;CAE1E,OAAO,aADO,WACS,GAAO;EAAE,MAAM;EAAS,GAAG;CAAO,CAAC;AAC5D;AAEA,SAAgB,cAAc;CAE5B,OADc,WACP,EAAM;AACf;AAGA,SAAgB,oBACd,QACgD;CAChD,OAAO,kBAAqB,WAAW,GAAG,MAAM;AAClD"}
1
+ {"version":3,"file":"request-response.js","names":[],"sources":["../../src/request-response.ts"],"sourcesContent":["import { AsyncLocalStorage } from 'node:async_hooks'\n\nimport {\n H3Event,\n clearSession as h3_clearSession,\n deleteCookie as h3_deleteCookie,\n getRequestHost as h3_getRequestHost,\n getRequestIP as h3_getRequestIP,\n getRequestProtocol as h3_getRequestProtocol,\n getRequestURL as h3_getRequestURL,\n getSession as h3_getSession,\n getValidatedQuery as h3_getValidatedQuery,\n parseCookies as h3_parseCookies,\n sanitizeStatusCode as h3_sanitizeStatusCode,\n sanitizeStatusMessage as h3_sanitizeStatusMessage,\n sealSession as h3_sealSession,\n setCookie as h3_setCookie,\n toResponse as h3_toResponse,\n unsealSession as h3_unsealSession,\n updateSession as h3_updateSession,\n useSession as h3_useSession,\n} from 'h3-v2'\nimport type {\n RequestHeaderMap,\n RequestHeaderName,\n ResponseHeaderMap,\n ResponseHeaderName,\n TypedHeaders,\n} from 'fetchdts'\n\nimport type { CookieSerializeOptions } from 'cookie-es'\nimport type {\n Session,\n SessionConfig,\n SessionData,\n SessionManager,\n SessionUpdate,\n} from './session'\nimport type { StandardSchemaV1 } from '@standard-schema/spec'\nimport type { RequestHandler } from './request-handler'\n\ninterface StartEvent {\n h3Event: H3Event\n}\n\n// Use a global symbol to ensure the same AsyncLocalStorage instance is shared\n// across different bundles that may each bundle this module.\nconst GLOBAL_EVENT_STORAGE_KEY = Symbol.for('tanstack-start:event-storage')\n\nconst globalObj = globalThis as typeof globalThis & {\n [GLOBAL_EVENT_STORAGE_KEY]?: AsyncLocalStorage<StartEvent>\n}\n\nif (!globalObj[GLOBAL_EVENT_STORAGE_KEY]) {\n globalObj[GLOBAL_EVENT_STORAGE_KEY] = new AsyncLocalStorage<StartEvent>()\n}\n\nconst eventStorage = globalObj[GLOBAL_EVENT_STORAGE_KEY]\n\nexport type { ResponseHeaderName, RequestHeaderName }\n\ntype HeadersWithGetSetCookie = Headers & {\n getSetCookie?: () => Array<string>\n}\n\ntype MaybePromise<T> = T | Promise<T>\n\nfunction isPromiseLike<T>(value: MaybePromise<T>): value is Promise<T> {\n return typeof (value as Promise<T>).then === 'function'\n}\n\nfunction getSetCookieValues(headers: Headers): Array<string> {\n const headersWithSetCookie = headers as HeadersWithGetSetCookie\n if (typeof headersWithSetCookie.getSetCookie === 'function') {\n return headersWithSetCookie.getSetCookie()\n }\n const value = headers.get('set-cookie')\n return value ? [value] : []\n}\n\nfunction mergeEventResponseHeaders(response: Response, event: H3Event): void {\n if (response.ok) {\n return\n }\n\n const eventSetCookies = getSetCookieValues(event.res.headers)\n if (eventSetCookies.length === 0) {\n return\n }\n\n const responseSetCookies = getSetCookieValues(response.headers)\n response.headers.delete('set-cookie')\n for (const cookie of responseSetCookies) {\n response.headers.append('set-cookie', cookie)\n }\n for (const cookie of eventSetCookies) {\n response.headers.append('set-cookie', cookie)\n }\n}\n\nfunction attachResponseHeaders<T>(\n value: MaybePromise<T>,\n event: H3Event,\n): MaybePromise<T> {\n if (isPromiseLike(value)) {\n return value.then((resolved) => {\n if (resolved instanceof Response) {\n mergeEventResponseHeaders(resolved, event)\n }\n return resolved\n })\n }\n\n if (value instanceof Response) {\n mergeEventResponseHeaders(value, event)\n }\n\n return value\n}\n\nexport function requestHandler<TRegister = unknown>(\n handler: RequestHandler<TRegister>,\n) {\n return (request: Request, requestOpts: any): Promise<Response> | Response => {\n let h3Event: H3Event\n try {\n h3Event = new H3Event(request)\n } catch (error) {\n if (error instanceof URIError) {\n return new Response(null, {\n status: 400,\n statusText: 'Bad Request',\n })\n }\n throw error\n }\n\n const response = eventStorage.run({ h3Event }, () =>\n handler(request, requestOpts),\n )\n return h3_toResponse(attachResponseHeaders(response, h3Event), h3Event)\n }\n}\n\nfunction getH3Event() {\n const event = eventStorage.getStore()\n if (!event) {\n throw new Error(\n `No StartEvent found in AsyncLocalStorage. Make sure you are using the function within the server runtime.`,\n )\n }\n return event.h3Event\n}\n\nexport function getRequest(): Request {\n const event = getH3Event()\n return event.req\n}\n\nexport function getRequestHeaders(): TypedHeaders<RequestHeaderMap> {\n return getH3Event().req.headers\n}\n\nexport function getRequestHeader(name: RequestHeaderName): string | undefined {\n return getRequestHeaders().get(name) || undefined\n}\n\nexport function getRequestIP(opts?: {\n /**\n * Use the X-Forwarded-For HTTP header set by proxies.\n *\n * Note: Make sure that this header can be trusted (your application running behind a CDN or reverse proxy) before enabling.\n */\n xForwardedFor?: boolean\n}) {\n return h3_getRequestIP(getH3Event(), opts)\n}\n\n/**\n * Get the request hostname.\n *\n * If `xForwardedHost` is `true`, it will use the `x-forwarded-host` header if it exists.\n *\n * If no host header is found, it will default to \"localhost\".\n */\nexport function getRequestHost(opts?: { xForwardedHost?: boolean }) {\n return h3_getRequestHost(getH3Event(), opts)\n}\n\n/**\n * Get the full incoming request URL.\n *\n * If `xForwardedHost` is `true`, it will use the `x-forwarded-host` header if it exists.\n *\n * If `xForwardedProto` is `false`, it will not use the `x-forwarded-proto` header.\n */\nexport function getRequestUrl(opts?: {\n xForwardedHost?: boolean\n xForwardedProto?: boolean\n}) {\n return h3_getRequestURL(getH3Event(), opts)\n}\n\n/**\n * Get the request protocol.\n *\n * If `x-forwarded-proto` header is set to \"https\", it will return \"https\". You can disable this behavior by setting `xForwardedProto` to `false`.\n *\n * If protocol cannot be determined, it will default to \"http\".\n */\nexport function getRequestProtocol(opts?: {\n xForwardedProto?: boolean\n}): 'http' | 'https' | (string & {}) {\n return h3_getRequestProtocol(getH3Event(), opts)\n}\n\nexport function setResponseHeaders(\n headers: TypedHeaders<ResponseHeaderMap>,\n): void {\n const event = getH3Event()\n for (const [name, value] of Object.entries(headers)) {\n event.res.headers.set(name, value)\n }\n}\n\nexport function getResponseHeaders(): TypedHeaders<ResponseHeaderMap> {\n const event = getH3Event()\n return event.res.headers\n}\n\nexport function getResponseHeader(\n name: ResponseHeaderName,\n): string | undefined {\n const event = getH3Event()\n return event.res.headers.get(name) || undefined\n}\n\nexport function setResponseHeader(\n name: ResponseHeaderName,\n value: string | Array<string>,\n): void {\n const event = getH3Event()\n if (Array.isArray(value)) {\n event.res.headers.delete(name)\n for (const valueItem of value) {\n event.res.headers.append(name, valueItem)\n }\n } else {\n event.res.headers.set(name, value)\n }\n}\nexport function removeResponseHeader(name: ResponseHeaderName): void {\n const event = getH3Event()\n event.res.headers.delete(name)\n}\n\nexport function clearResponseHeaders(\n headerNames?: Array<ResponseHeaderName>,\n): void {\n const event = getH3Event()\n // If headerNames is provided, clear only those headers\n if (headerNames && headerNames.length > 0) {\n for (const name of headerNames) {\n event.res.headers.delete(name)\n }\n // Otherwise, clear all headers\n } else {\n for (const name of event.res.headers.keys()) {\n event.res.headers.delete(name)\n }\n }\n}\n\nexport function getResponseStatus(): number {\n return getH3Event().res.status || 200\n}\n\nexport function setResponseStatus(code?: number, text?: string): void {\n const event = getH3Event()\n if (code) {\n event.res.status = h3_sanitizeStatusCode(code, event.res.status)\n }\n if (text) {\n event.res.statusText = h3_sanitizeStatusMessage(text)\n }\n}\n\n/**\n * Parse the request to get HTTP Cookie header string and return an object of all cookie name-value pairs.\n * @returns Object of cookie name-value pairs\n * ```ts\n * const cookies = getCookies()\n * ```\n */\nexport function getCookies(): Record<string, string> {\n const event = getH3Event()\n const cookies = h3_parseCookies(event)\n const definedCookies: Record<string, string> = Object.create(null)\n\n for (const [name, value] of Object.entries(cookies)) {\n if (value !== undefined) {\n definedCookies[name] = value\n }\n }\n\n return definedCookies\n}\n\n/**\n * Get a cookie value by name.\n * @param name Name of the cookie to get\n * @returns {*} Value of the cookie (String or undefined)\n * ```ts\n * const authorization = getCookie('Authorization')\n * ```\n */\nexport function getCookie(name: string): string | undefined {\n return getCookies()[name]\n}\n\n/**\n * Set a cookie value by name.\n * @param name Name of the cookie to set\n * @param value Value of the cookie to set\n * @param options {CookieSerializeOptions} Options for serializing the cookie\n * ```ts\n * setCookie('Authorization', '1234567')\n * ```\n */\nexport function setCookie(\n name: string,\n value: string,\n options?: CookieSerializeOptions,\n): void {\n const event = getH3Event()\n h3_setCookie(event, name, value, options)\n}\n\n/**\n * Remove a cookie by name.\n * @param name Name of the cookie to delete\n * @param serializeOptions {CookieSerializeOptions} Cookie options\n * ```ts\n * deleteCookie('SessionId')\n * ```\n */\nexport function deleteCookie(\n name: string,\n options?: CookieSerializeOptions,\n): void {\n const event = getH3Event()\n h3_deleteCookie(event, name, options)\n}\n\nfunction getDefaultSessionConfig(config: SessionConfig): SessionConfig {\n return {\n name: 'start',\n ...config,\n }\n}\n\n/**\n * Create a session manager for the current request.\n */\nexport function useSession<TSessionData extends SessionData = SessionData>(\n config: SessionConfig,\n): Promise<SessionManager<TSessionData>> {\n const event = getH3Event()\n return h3_useSession(event, getDefaultSessionConfig(config))\n}\n/**\n * Get the session for the current request\n */\nexport function getSession<TSessionData extends SessionData = SessionData>(\n config: SessionConfig,\n): Promise<Session<TSessionData>> {\n const event = getH3Event()\n return h3_getSession(event, getDefaultSessionConfig(config))\n}\n\n/**\n * Update the session data for the current request.\n */\nexport function updateSession<TSessionData extends SessionData = SessionData>(\n config: SessionConfig,\n update?: SessionUpdate<TSessionData>,\n): Promise<Session<TSessionData>> {\n const event = getH3Event()\n return h3_updateSession(event, getDefaultSessionConfig(config), update)\n}\n\n/**\n * Encrypt and sign the session data for the current request.\n */\nexport function sealSession(config: SessionConfig): Promise<string> {\n const event = getH3Event()\n return h3_sealSession(event, getDefaultSessionConfig(config))\n}\n/**\n * Decrypt and verify the session data for the current request.\n */\nexport function unsealSession(\n config: SessionConfig,\n sealed: string,\n): Promise<Partial<Session>> {\n const event = getH3Event()\n return h3_unsealSession(event, getDefaultSessionConfig(config), sealed)\n}\n\n/**\n * Clear the session data for the current request.\n */\nexport function clearSession(config: Partial<SessionConfig>): Promise<void> {\n const event = getH3Event()\n return h3_clearSession(event, { name: 'start', ...config })\n}\n\nexport function getResponse() {\n const event = getH3Event()\n return event.res\n}\n\n// not public API (yet)\nexport function getValidatedQuery<TSchema extends StandardSchemaV1>(\n schema: StandardSchemaV1,\n): Promise<StandardSchemaV1.InferOutput<TSchema>> {\n return h3_getValidatedQuery(getH3Event(), schema)\n}\n"],"mappings":";;;AA+CA,IAAM,2BAA2B,OAAO,IAAI,8BAA8B;AAE1E,IAAM,YAAY;AAIlB,IAAI,CAAC,UAAU,2BACb,UAAU,4BAA4B,IAAI,kBAA8B;AAG1E,IAAM,eAAe,UAAU;AAU/B,SAAS,cAAiB,OAA6C;CACrE,OAAO,OAAQ,MAAqB,SAAS;AAC/C;AAEA,SAAS,mBAAmB,SAAiC;CAC3D,MAAM,uBAAuB;CAC7B,IAAI,OAAO,qBAAqB,iBAAiB,YAC/C,OAAO,qBAAqB,aAAa;CAE3C,MAAM,QAAQ,QAAQ,IAAI,YAAY;CACtC,OAAO,QAAQ,CAAC,KAAK,IAAI,CAAC;AAC5B;AAEA,SAAS,0BAA0B,UAAoB,OAAsB;CAC3E,IAAI,SAAS,IACX;CAGF,MAAM,kBAA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AAGA,SAAgB,kBACd,QACgD;CAChD,OAAO,oBAAqB,WAAW,GAAG,MAAM;AAClD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/start-server-core",
3
- "version": "1.169.6",
3
+ "version": "1.169.8",
4
4
  "description": "Modern and scalable routing for React applications",
5
5
  "author": "Tanner Linsley",
6
6
  "license": "MIT",
@@ -44,6 +44,12 @@
44
44
  "default": "./dist/esm/createSsrRpc.js"
45
45
  }
46
46
  },
47
+ "./request-response": {
48
+ "import": {
49
+ "types": "./dist/esm/request-response.d.ts",
50
+ "default": "./dist/esm/request-response.js"
51
+ }
52
+ },
47
53
  "./package.json": "./package.json"
48
54
  },
49
55
  "imports": {
@@ -70,9 +76,9 @@
70
76
  "h3-v2": "npm:h3@2.0.1-rc.20",
71
77
  "seroval": "^1.5.4",
72
78
  "@tanstack/history": "1.162.0",
73
- "@tanstack/start-storage-context": "1.167.9",
74
- "@tanstack/router-core": "1.171.7",
75
- "@tanstack/start-client-core": "1.170.5"
79
+ "@tanstack/router-core": "1.171.8",
80
+ "@tanstack/start-client-core": "1.170.6",
81
+ "@tanstack/start-storage-context": "1.167.10"
76
82
  },
77
83
  "devDependencies": {
78
84
  "@standard-schema/spec": "^1.0.0",