msw 2.11.0 → 2.11.1
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/lib/browser/index.js.map +1 -1
- package/lib/browser/index.mjs.map +1 -1
- package/lib/core/{HttpResponse-DiuKTgC7.d.mts → HttpResponse-B4YmE-GJ.d.mts} +1 -1
- package/lib/core/{HttpResponse-DlQEvD4q.d.ts → HttpResponse-BbwAqLE_.d.ts} +1 -1
- package/lib/core/HttpResponse.d.mts +1 -1
- package/lib/core/HttpResponse.d.ts +1 -1
- package/lib/core/HttpResponse.js.map +1 -1
- package/lib/core/HttpResponse.mjs.map +1 -1
- package/lib/core/SetupApi.d.mts +1 -1
- package/lib/core/SetupApi.d.ts +1 -1
- package/lib/core/getResponse.d.mts +1 -1
- package/lib/core/getResponse.d.ts +1 -1
- package/lib/core/graphql.d.mts +1 -1
- package/lib/core/graphql.d.ts +1 -1
- package/lib/core/handlers/GraphQLHandler.d.mts +1 -1
- package/lib/core/handlers/GraphQLHandler.d.ts +1 -1
- package/lib/core/handlers/HttpHandler.d.mts +1 -1
- package/lib/core/handlers/HttpHandler.d.ts +1 -1
- package/lib/core/handlers/RequestHandler.d.mts +1 -1
- package/lib/core/handlers/RequestHandler.d.ts +1 -1
- package/lib/core/http.d.mts +1 -1
- package/lib/core/http.d.ts +1 -1
- package/lib/core/index.d.mts +1 -1
- package/lib/core/index.d.ts +1 -1
- package/lib/core/passthrough.d.mts +1 -1
- package/lib/core/passthrough.d.ts +1 -1
- package/lib/core/utils/HttpResponse/decorators.d.mts +1 -1
- package/lib/core/utils/HttpResponse/decorators.d.ts +1 -1
- package/lib/core/utils/cookieStore.d.mts +10 -2
- package/lib/core/utils/cookieStore.d.ts +10 -2
- package/lib/core/utils/cookieStore.js +49 -146
- package/lib/core/utils/cookieStore.js.map +1 -1
- package/lib/core/utils/cookieStore.mjs +53 -136
- package/lib/core/utils/cookieStore.mjs.map +1 -1
- package/lib/core/utils/executeHandlers.d.mts +1 -1
- package/lib/core/utils/executeHandlers.d.ts +1 -1
- package/lib/core/utils/handleRequest.d.mts +1 -1
- package/lib/core/utils/handleRequest.d.ts +1 -1
- package/lib/core/utils/handleRequest.js +1 -1
- package/lib/core/utils/handleRequest.js.map +1 -1
- package/lib/core/utils/handleRequest.mjs +1 -1
- package/lib/core/utils/handleRequest.mjs.map +1 -1
- package/lib/core/utils/internal/isHandlerKind.d.mts +1 -1
- package/lib/core/utils/internal/isHandlerKind.d.ts +1 -1
- package/lib/core/utils/internal/parseGraphQLRequest.d.mts +1 -1
- package/lib/core/utils/internal/parseGraphQLRequest.d.ts +1 -1
- package/lib/core/utils/internal/parseMultipartData.d.mts +1 -1
- package/lib/core/utils/internal/parseMultipartData.d.ts +1 -1
- package/lib/core/utils/internal/requestHandlerUtils.d.mts +1 -1
- package/lib/core/utils/internal/requestHandlerUtils.d.ts +1 -1
- package/lib/core/utils/request/getRequestCookies.js +1 -1
- package/lib/core/utils/request/getRequestCookies.js.map +1 -1
- package/lib/core/utils/request/getRequestCookies.mjs +1 -1
- package/lib/core/utils/request/getRequestCookies.mjs.map +1 -1
- package/lib/core/utils/request/storeResponseCookies.d.mts +1 -1
- package/lib/core/utils/request/storeResponseCookies.d.ts +1 -1
- package/lib/core/utils/request/storeResponseCookies.js +2 -2
- package/lib/core/utils/request/storeResponseCookies.js.map +1 -1
- package/lib/core/utils/request/storeResponseCookies.mjs +2 -2
- package/lib/core/utils/request/storeResponseCookies.mjs.map +1 -1
- package/lib/core/ws/handleWebSocketEvent.d.mts +1 -1
- package/lib/core/ws/handleWebSocketEvent.d.ts +1 -1
- package/lib/iife/index.js +2589 -12070
- package/lib/iife/index.js.map +1 -1
- package/lib/mockServiceWorker.js +1 -1
- package/lib/node/index.js.map +1 -1
- package/lib/node/index.mjs.map +1 -1
- package/package.json +4 -4
- package/src/browser/setupWorker/setupWorker.ts +1 -1
- package/src/core/HttpResponse.ts +3 -3
- package/src/core/handlers/GraphQLHandler.test.ts +1 -1
- package/src/core/utils/cookieStore.ts +56 -198
- package/src/core/utils/handleRequest.ts +1 -1
- package/src/core/utils/request/getRequestCookies.ts +1 -1
- package/src/core/utils/request/storeResponseCookies.ts +3 -3
- package/src/core/utils/request/toPublicUrl.test.ts +1 -1
- package/src/core/ws/WebSocketClientManager.test.ts +1 -1
- package/src/node/SetupServerApi.ts +1 -1
|
@@ -300,7 +300,7 @@ declare class HttpResponse<BodyType extends DefaultBodyType> extends FetchRespon
|
|
|
300
300
|
*
|
|
301
301
|
* HttpResponse.arrayBuffer(buffer)
|
|
302
302
|
*/
|
|
303
|
-
static arrayBuffer
|
|
303
|
+
static arrayBuffer<BodyType extends ArrayBuffer | SharedArrayBuffer>(body?: BodyType, init?: HttpResponseInit): HttpResponse<BodyType>;
|
|
304
304
|
/**
|
|
305
305
|
* Create a `Response` with a `FormData` body.
|
|
306
306
|
* @example
|
|
@@ -300,7 +300,7 @@ declare class HttpResponse<BodyType extends DefaultBodyType> extends FetchRespon
|
|
|
300
300
|
*
|
|
301
301
|
* HttpResponse.arrayBuffer(buffer)
|
|
302
302
|
*/
|
|
303
|
-
static arrayBuffer
|
|
303
|
+
static arrayBuffer<BodyType extends ArrayBuffer | SharedArrayBuffer>(body?: BodyType, init?: HttpResponseInit): HttpResponse<BodyType>;
|
|
304
304
|
/**
|
|
305
305
|
* Create a `Response` with a `FormData` body.
|
|
306
306
|
* @example
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '@mswjs/interceptors';
|
|
2
|
-
export { m as DefaultUnsafeFetchResponse, o as HttpResponse, H as HttpResponseInit, S as StrictRequest, n as StrictResponse, l as bodyType } from './HttpResponse-
|
|
2
|
+
export { m as DefaultUnsafeFetchResponse, o as HttpResponse, H as HttpResponseInit, S as StrictRequest, n as StrictResponse, l as bodyType } from './HttpResponse-B4YmE-GJ.mjs';
|
|
3
3
|
import './typeUtils.mjs';
|
|
4
4
|
import './utils/internal/isIterable.mjs';
|
|
5
5
|
import 'graphql';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '@mswjs/interceptors';
|
|
2
|
-
export { m as DefaultUnsafeFetchResponse, o as HttpResponse, H as HttpResponseInit, S as StrictRequest, n as StrictResponse, l as bodyType } from './HttpResponse-
|
|
2
|
+
export { m as DefaultUnsafeFetchResponse, o as HttpResponse, H as HttpResponseInit, S as StrictRequest, n as StrictResponse, l as bodyType } from './HttpResponse-BbwAqLE_.js';
|
|
3
3
|
import './typeUtils.js';
|
|
4
4
|
import './utils/internal/isIterable.js';
|
|
5
5
|
import 'graphql';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/core/HttpResponse.ts"],"sourcesContent":["import { FetchResponse } from '@mswjs/interceptors'\nimport type { DefaultBodyType, JsonBodyType } from './handlers/RequestHandler'\nimport type { NoInfer } from './typeUtils'\nimport {\n decorateResponse,\n normalizeResponseInit,\n} from './utils/HttpResponse/decorators'\n\nexport interface HttpResponseInit extends ResponseInit {\n type?: ResponseType\n}\n\nexport const bodyType: unique symbol = Symbol('bodyType')\nexport type DefaultUnsafeFetchResponse = Response & {\n [bodyType]?: never\n}\n\nexport interface StrictRequest<BodyType extends JsonBodyType> extends Request {\n json(): Promise<BodyType>\n}\n\n/**\n * Opaque `Response` type that supports strict body type.\n *\n * @deprecated Please use {@link HttpResponse} instead.\n */\nexport type StrictResponse<BodyType extends DefaultBodyType> =\n HttpResponse<BodyType>\n\n/**\n * A drop-in replacement for the standard `Response` class\n * to allow additional features, like mocking the response `Set-Cookie` header.\n *\n * @example\n * new HttpResponse('Hello world', { status: 201 })\n * HttpResponse.json({ name: 'John' })\n * HttpResponse.formData(form)\n *\n * @see {@link https://mswjs.io/docs/api/http-response `HttpResponse` API reference}\n */\nexport class HttpResponse<\n BodyType extends DefaultBodyType,\n> extends FetchResponse {\n readonly [bodyType]: BodyType = null as any\n\n constructor(body?: NoInfer<BodyType> | null, init?: HttpResponseInit) {\n const responseInit = normalizeResponseInit(init)\n super(body as BodyInit, responseInit)\n decorateResponse(this, responseInit)\n }\n\n static error(): HttpResponse<any> {\n return super.error() as HttpResponse<any>\n }\n\n /**\n * Create a `Response` with a `Content-Type: \"text/plain\"` body.\n * @example\n * HttpResponse.text('hello world')\n * HttpResponse.text('Error', { status: 500 })\n */\n static text<BodyType extends string>(\n body?: NoInfer<BodyType> | null,\n init?: HttpResponseInit,\n ): HttpResponse<BodyType> {\n const responseInit = normalizeResponseInit(init)\n\n if (!responseInit.headers.has('Content-Type')) {\n responseInit.headers.set('Content-Type', 'text/plain')\n }\n\n // Automatically set the \"Content-Length\" response header\n // for non-empty text responses. This enforces consistency and\n // brings mocked responses closer to production.\n if (!responseInit.headers.has('Content-Length')) {\n responseInit.headers.set(\n 'Content-Length',\n body ? new Blob([body]).size.toString() : '0',\n )\n }\n\n return new HttpResponse(body, responseInit)\n }\n\n /**\n * Create a `Response` with a `Content-Type: \"application/json\"` body.\n * @example\n * HttpResponse.json({ firstName: 'John' })\n * HttpResponse.json({ error: 'Not Authorized' }, { status: 401 })\n */\n static json<BodyType extends JsonBodyType>(\n body?: NoInfer<BodyType> | null | undefined,\n init?: HttpResponseInit,\n ): HttpResponse<BodyType> {\n const responseInit = normalizeResponseInit(init)\n\n if (!responseInit.headers.has('Content-Type')) {\n responseInit.headers.set('Content-Type', 'application/json')\n }\n\n /**\n * @note TypeScript is incorrect here.\n * Stringifying undefined will return undefined.\n */\n const responseText = JSON.stringify(body) as string | undefined\n\n if (!responseInit.headers.has('Content-Length')) {\n responseInit.headers.set(\n 'Content-Length',\n responseText ? new Blob([responseText]).size.toString() : '0',\n )\n }\n\n return new HttpResponse(responseText as BodyType, responseInit)\n }\n\n /**\n * Create a `Response` with a `Content-Type: \"application/xml\"` body.\n * @example\n * HttpResponse.xml(`<user name=\"John\" />`)\n * HttpResponse.xml(`<article id=\"abc-123\" />`, { status: 201 })\n */\n static xml<BodyType extends string>(\n body?: BodyType | null,\n init?: HttpResponseInit,\n ): HttpResponse<BodyType> {\n const responseInit = normalizeResponseInit(init)\n\n if (!responseInit.headers.has('Content-Type')) {\n responseInit.headers.set('Content-Type', 'text/xml')\n }\n\n return new HttpResponse(body, responseInit)\n }\n\n /**\n * Create a `Response` with a `Content-Type: \"text/html\"` body.\n * @example\n * HttpResponse.html(`<p class=\"author\">Jane Doe</p>`)\n * HttpResponse.html(`<main id=\"abc-123\">Main text</main>`, { status: 201 })\n */\n static html<BodyType extends string>(\n body?: BodyType | null,\n init?: HttpResponseInit,\n ): HttpResponse<BodyType> {\n const responseInit = normalizeResponseInit(init)\n\n if (!responseInit.headers.has('Content-Type')) {\n responseInit.headers.set('Content-Type', 'text/html')\n }\n\n return new HttpResponse(body, responseInit)\n }\n\n /**\n * Create a `Response` with an `ArrayBuffer` body.\n * @example\n * const buffer = new ArrayBuffer(3)\n * const view = new Uint8Array(buffer)\n * view.set([1, 2, 3])\n *\n * HttpResponse.arrayBuffer(buffer)\n */\n static arrayBuffer(\n body?:
|
|
1
|
+
{"version":3,"sources":["../../src/core/HttpResponse.ts"],"sourcesContent":["import { FetchResponse } from '@mswjs/interceptors'\nimport type { DefaultBodyType, JsonBodyType } from './handlers/RequestHandler'\nimport type { NoInfer } from './typeUtils'\nimport {\n decorateResponse,\n normalizeResponseInit,\n} from './utils/HttpResponse/decorators'\n\nexport interface HttpResponseInit extends ResponseInit {\n type?: ResponseType\n}\n\nexport const bodyType: unique symbol = Symbol('bodyType')\nexport type DefaultUnsafeFetchResponse = Response & {\n [bodyType]?: never\n}\n\nexport interface StrictRequest<BodyType extends JsonBodyType> extends Request {\n json(): Promise<BodyType>\n}\n\n/**\n * Opaque `Response` type that supports strict body type.\n *\n * @deprecated Please use {@link HttpResponse} instead.\n */\nexport type StrictResponse<BodyType extends DefaultBodyType> =\n HttpResponse<BodyType>\n\n/**\n * A drop-in replacement for the standard `Response` class\n * to allow additional features, like mocking the response `Set-Cookie` header.\n *\n * @example\n * new HttpResponse('Hello world', { status: 201 })\n * HttpResponse.json({ name: 'John' })\n * HttpResponse.formData(form)\n *\n * @see {@link https://mswjs.io/docs/api/http-response `HttpResponse` API reference}\n */\nexport class HttpResponse<\n BodyType extends DefaultBodyType,\n> extends FetchResponse {\n readonly [bodyType]: BodyType = null as any\n\n constructor(body?: NoInfer<BodyType> | null, init?: HttpResponseInit) {\n const responseInit = normalizeResponseInit(init)\n super(body as BodyInit, responseInit)\n decorateResponse(this, responseInit)\n }\n\n static error(): HttpResponse<any> {\n return super.error() as HttpResponse<any>\n }\n\n /**\n * Create a `Response` with a `Content-Type: \"text/plain\"` body.\n * @example\n * HttpResponse.text('hello world')\n * HttpResponse.text('Error', { status: 500 })\n */\n static text<BodyType extends string>(\n body?: NoInfer<BodyType> | null,\n init?: HttpResponseInit,\n ): HttpResponse<BodyType> {\n const responseInit = normalizeResponseInit(init)\n\n if (!responseInit.headers.has('Content-Type')) {\n responseInit.headers.set('Content-Type', 'text/plain')\n }\n\n // Automatically set the \"Content-Length\" response header\n // for non-empty text responses. This enforces consistency and\n // brings mocked responses closer to production.\n if (!responseInit.headers.has('Content-Length')) {\n responseInit.headers.set(\n 'Content-Length',\n body ? new Blob([body]).size.toString() : '0',\n )\n }\n\n return new HttpResponse(body, responseInit)\n }\n\n /**\n * Create a `Response` with a `Content-Type: \"application/json\"` body.\n * @example\n * HttpResponse.json({ firstName: 'John' })\n * HttpResponse.json({ error: 'Not Authorized' }, { status: 401 })\n */\n static json<BodyType extends JsonBodyType>(\n body?: NoInfer<BodyType> | null | undefined,\n init?: HttpResponseInit,\n ): HttpResponse<BodyType> {\n const responseInit = normalizeResponseInit(init)\n\n if (!responseInit.headers.has('Content-Type')) {\n responseInit.headers.set('Content-Type', 'application/json')\n }\n\n /**\n * @note TypeScript is incorrect here.\n * Stringifying undefined will return undefined.\n */\n const responseText = JSON.stringify(body) as string | undefined\n\n if (!responseInit.headers.has('Content-Length')) {\n responseInit.headers.set(\n 'Content-Length',\n responseText ? new Blob([responseText]).size.toString() : '0',\n )\n }\n\n return new HttpResponse(responseText as BodyType, responseInit)\n }\n\n /**\n * Create a `Response` with a `Content-Type: \"application/xml\"` body.\n * @example\n * HttpResponse.xml(`<user name=\"John\" />`)\n * HttpResponse.xml(`<article id=\"abc-123\" />`, { status: 201 })\n */\n static xml<BodyType extends string>(\n body?: BodyType | null,\n init?: HttpResponseInit,\n ): HttpResponse<BodyType> {\n const responseInit = normalizeResponseInit(init)\n\n if (!responseInit.headers.has('Content-Type')) {\n responseInit.headers.set('Content-Type', 'text/xml')\n }\n\n return new HttpResponse(body, responseInit)\n }\n\n /**\n * Create a `Response` with a `Content-Type: \"text/html\"` body.\n * @example\n * HttpResponse.html(`<p class=\"author\">Jane Doe</p>`)\n * HttpResponse.html(`<main id=\"abc-123\">Main text</main>`, { status: 201 })\n */\n static html<BodyType extends string>(\n body?: BodyType | null,\n init?: HttpResponseInit,\n ): HttpResponse<BodyType> {\n const responseInit = normalizeResponseInit(init)\n\n if (!responseInit.headers.has('Content-Type')) {\n responseInit.headers.set('Content-Type', 'text/html')\n }\n\n return new HttpResponse(body, responseInit)\n }\n\n /**\n * Create a `Response` with an `ArrayBuffer` body.\n * @example\n * const buffer = new ArrayBuffer(3)\n * const view = new Uint8Array(buffer)\n * view.set([1, 2, 3])\n *\n * HttpResponse.arrayBuffer(buffer)\n */\n static arrayBuffer<BodyType extends ArrayBuffer | SharedArrayBuffer>(\n body?: BodyType,\n init?: HttpResponseInit,\n ): HttpResponse<BodyType> {\n const responseInit = normalizeResponseInit(init)\n\n if (!responseInit.headers.has('Content-Type')) {\n responseInit.headers.set('Content-Type', 'application/octet-stream')\n }\n\n if (body && !responseInit.headers.has('Content-Length')) {\n responseInit.headers.set('Content-Length', body.byteLength.toString())\n }\n\n return new HttpResponse(body, responseInit)\n }\n\n /**\n * Create a `Response` with a `FormData` body.\n * @example\n * const data = new FormData()\n * data.set('name', 'Alice')\n *\n * HttpResponse.formData(data)\n */\n static formData(\n body?: FormData,\n init?: HttpResponseInit,\n ): HttpResponse<FormData> {\n return new HttpRespon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Response.ts"],"sourcesContent":["import { FetchResponse } from '@mswjs/interceptors'\nimport type { DefaultBodyType, JsonBodyType } from './handlers/RequestHandler'\nimport type { NoInfer } from './typeUtils'\nimport {\n decorateResponse,\n normalizeResponseInit,\n} from './utils/HttpResponse/decorators'\n\nexport interface HttpResponseInit extends ResponseInit {\n type?: ResponseType\n}\n\nexport const bodyType: unique symbol = Symbol('bodyType')\nexport type DefaultUnsafeFetchResponse = Response & {\n [bodyType]?: never\n}\n\nexport interface StrictRequest<BodyType extends JsonBodyType> extends Request {\n json(): Promise<BodyType>\n}\n\n/**\n * Opaque `Response` type that supports strict body type.\n *\n * @deprecated Please use {@link HttpResponse} instead.\n */\nexport type StrictResponse<BodyType extends DefaultBodyType> =\n HttpResponse<BodyType>\n\n/**\n * A drop-in replacement for the standard `Response` class\n * to allow additional features, like mocking the response `Set-Cookie` header.\n *\n * @example\n * new HttpResponse('Hello world', { status: 201 })\n * HttpResponse.json({ name: 'John' })\n * HttpResponse.formData(form)\n *\n * @see {@link https://mswjs.io/docs/api/http-response `HttpResponse` API reference}\n */\nexport class HttpResponse<\n BodyType extends DefaultBodyType,\n> extends FetchResponse {\n readonly [bodyType]: BodyType = null as any\n\n constructor(body?: NoInfer<BodyType> | null, init?: HttpResponseInit) {\n const responseInit = normalizeResponseInit(init)\n super(body as BodyInit, responseInit)\n decorateResponse(this, responseInit)\n }\n\n static error(): HttpResponse<any> {\n return super.error() as HttpResponse<any>\n }\n\n /**\n * Create a `Response` with a `Content-Type: \"text/plain\"` body.\n * @example\n * HttpResponse.text('hello world')\n * HttpResponse.text('Error', { status: 500 })\n */\n static text<BodyType extends string>(\n body?: NoInfer<BodyType> | null,\n init?: HttpResponseInit,\n ): HttpResponse<BodyType> {\n const responseInit = normalizeResponseInit(init)\n\n if (!responseInit.headers.has('Content-Type')) {\n responseInit.headers.set('Content-Type', 'text/plain')\n }\n\n // Automatically set the \"Content-Length\" response header\n // for non-empty text responses. This enforces consistency and\n // brings mocked responses closer to production.\n if (!responseInit.headers.has('Content-Length')) {\n responseInit.headers.set(\n 'Content-Length',\n body ? new Blob([body]).size.toString() : '0',\n )\n }\n\n return new HttpResponse(body, responseInit)\n }\n\n /**\n * Create a `Response` with a `Content-Type: \"application/json\"` body.\n * @example\n * HttpResponse.json({ firstName: 'John' })\n * HttpResponse.json({ error: 'Not Authorized' }, { status: 401 })\n */\n static json<BodyType extends JsonBodyType>(\n body?: NoInfer<BodyType> | null | undefined,\n init?: HttpResponseInit,\n ): HttpResponse<BodyType> {\n const responseInit = normalizeResponseInit(init)\n\n if (!responseInit.headers.has('Content-Type')) {\n responseInit.headers.set('Content-Type', 'application/json')\n }\n\n /**\n * @note TypeScript is incorrect here.\n * Stringifying undefined will return undefined.\n */\n const responseText = JSON.stringify(body) as string | undefined\n\n if (!responseInit.headers.has('Content-Length')) {\n responseInit.headers.set(\n 'Content-Length',\n responseText ? new Blob([responseText]).size.toString() : '0',\n )\n }\n\n return new HttpResponse(responseText as BodyType, responseInit)\n }\n\n /**\n * Create a `Response` with a `Content-Type: \"application/xml\"` body.\n * @example\n * HttpResponse.xml(`<user name=\"John\" />`)\n * HttpResponse.xml(`<article id=\"abc-123\" />`, { status: 201 })\n */\n static xml<BodyType extends string>(\n body?: BodyType | null,\n init?: HttpResponseInit,\n ): HttpResponse<BodyType> {\n const responseInit = normalizeResponseInit(init)\n\n if (!responseInit.headers.has('Content-Type')) {\n responseInit.headers.set('Content-Type', 'text/xml')\n }\n\n return new HttpResponse(body, responseInit)\n }\n\n /**\n * Create a `Response` with a `Content-Type: \"text/html\"` body.\n * @example\n * HttpResponse.html(`<p class=\"author\">Jane Doe</p>`)\n * HttpResponse.html(`<main id=\"abc-123\">Main text</main>`, { status: 201 })\n */\n static html<BodyType extends string>(\n body?: BodyType | null,\n init?: HttpResponseInit,\n ): HttpResponse<BodyType> {\n const responseInit = normalizeResponseInit(init)\n\n if (!responseInit.headers.has('Content-Type')) {\n responseInit.headers.set('Content-Type', 'text/html')\n }\n\n return new HttpResponse(body, responseInit)\n }\n\n /**\n * Create a `Response` with an `ArrayBuffer` body.\n * @example\n * const buffer = new ArrayBuffer(3)\n * const view = new Uint8Array(buffer)\n * view.set([1, 2, 3])\n *\n * HttpResponse.arrayBuffer(buffer)\n */\n static arrayBuffer(\n body?:
|
|
1
|
+
{"version":3,"sources":["../../src/core/HttpResponse.ts"],"sourcesContent":["import { FetchResponse } from '@mswjs/interceptors'\nimport type { DefaultBodyType, JsonBodyType } from './handlers/RequestHandler'\nimport type { NoInfer } from './typeUtils'\nimport {\n decorateResponse,\n normalizeResponseInit,\n} from './utils/HttpResponse/decorators'\n\nexport interface HttpResponseInit extends ResponseInit {\n type?: ResponseType\n}\n\nexport const bodyType: unique symbol = Symbol('bodyType')\nexport type DefaultUnsafeFetchResponse = Response & {\n [bodyType]?: never\n}\n\nexport interface StrictRequest<BodyType extends JsonBodyType> extends Request {\n json(): Promise<BodyType>\n}\n\n/**\n * Opaque `Response` type that supports strict body type.\n *\n * @deprecated Please use {@link HttpResponse} instead.\n */\nexport type StrictResponse<BodyType extends DefaultBodyType> =\n HttpResponse<BodyType>\n\n/**\n * A drop-in replacement for the standard `Response` class\n * to allow additional features, like mocking the response `Set-Cookie` header.\n *\n * @example\n * new HttpResponse('Hello world', { status: 201 })\n * HttpResponse.json({ name: 'John' })\n * HttpResponse.formData(form)\n *\n * @see {@link https://mswjs.io/docs/api/http-response `HttpResponse` API reference}\n */\nexport class HttpResponse<\n BodyType extends DefaultBodyType,\n> extends FetchResponse {\n readonly [bodyType]: BodyType = null as any\n\n constructor(body?: NoInfer<BodyType> | null, init?: HttpResponseInit) {\n const responseInit = normalizeResponseInit(init)\n super(body as BodyInit, responseInit)\n decorateResponse(this, responseInit)\n }\n\n static error(): HttpResponse<any> {\n return super.error() as HttpResponse<any>\n }\n\n /**\n * Create a `Response` with a `Content-Type: \"text/plain\"` body.\n * @example\n * HttpResponse.text('hello world')\n * HttpResponse.text('Error', { status: 500 })\n */\n static text<BodyType extends string>(\n body?: NoInfer<BodyType> | null,\n init?: HttpResponseInit,\n ): HttpResponse<BodyType> {\n const responseInit = normalizeResponseInit(init)\n\n if (!responseInit.headers.has('Content-Type')) {\n responseInit.headers.set('Content-Type', 'text/plain')\n }\n\n // Automatically set the \"Content-Length\" response header\n // for non-empty text responses. This enforces consistency and\n // brings mocked responses closer to production.\n if (!responseInit.headers.has('Content-Length')) {\n responseInit.headers.set(\n 'Content-Length',\n body ? new Blob([body]).size.toString() : '0',\n )\n }\n\n return new HttpResponse(body, responseInit)\n }\n\n /**\n * Create a `Response` with a `Content-Type: \"application/json\"` body.\n * @example\n * HttpResponse.json({ firstName: 'John' })\n * HttpResponse.json({ error: 'Not Authorized' }, { status: 401 })\n */\n static json<BodyType extends JsonBodyType>(\n body?: NoInfer<BodyType> | null | undefined,\n init?: HttpResponseInit,\n ): HttpResponse<BodyType> {\n const responseInit = normalizeResponseInit(init)\n\n if (!responseInit.headers.has('Content-Type')) {\n responseInit.headers.set('Content-Type', 'application/json')\n }\n\n /**\n * @note TypeScript is incorrect here.\n * Stringifying undefined will return undefined.\n */\n const responseText = JSON.stringify(body) as string | undefined\n\n if (!responseInit.headers.has('Content-Length')) {\n responseInit.headers.set(\n 'Content-Length',\n responseText ? new Blob([responseText]).size.toString() : '0',\n )\n }\n\n return new HttpResponse(responseText as BodyType, responseInit)\n }\n\n /**\n * Create a `Response` with a `Content-Type: \"application/xml\"` body.\n * @example\n * HttpResponse.xml(`<user name=\"John\" />`)\n * HttpResponse.xml(`<article id=\"abc-123\" />`, { status: 201 })\n */\n static xml<BodyType extends string>(\n body?: BodyType | null,\n init?: HttpResponseInit,\n ): HttpResponse<BodyType> {\n const responseInit = normalizeResponseInit(init)\n\n if (!responseInit.headers.has('Content-Type')) {\n responseInit.headers.set('Content-Type', 'text/xml')\n }\n\n return new HttpResponse(body, responseInit)\n }\n\n /**\n * Create a `Response` with a `Content-Type: \"text/html\"` body.\n * @example\n * HttpResponse.html(`<p class=\"author\">Jane Doe</p>`)\n * HttpResponse.html(`<main id=\"abc-123\">Main text</main>`, { status: 201 })\n */\n static html<BodyType extends string>(\n body?: BodyType | null,\n init?: HttpResponseInit,\n ): HttpResponse<BodyType> {\n const responseInit = normalizeResponseInit(init)\n\n if (!responseInit.headers.has('Content-Type')) {\n responseInit.headers.set('Content-Type', 'text/html')\n }\n\n return new HttpResponse(body, responseInit)\n }\n\n /**\n * Create a `Response` with an `ArrayBuffer` body.\n * @example\n * const buffer = new ArrayBuffer(3)\n * const view = new Uint8Array(buffer)\n * view.set([1, 2, 3])\n *\n * HttpResponse.arrayBuffer(buffer)\n */\n static arrayBuffer<BodyType extends ArrayBuffer | SharedArrayBuffer>(\n body?: BodyType,\n init?: HttpResponseInit,\n ): HttpResponse<BodyType> {\n const responseInit = normalizeResponseInit(init)\n\n if (!responseInit.headers.has('Content-Type')) {\n responseInit.headers.set('Content-Type', 'application/octet-stream')\n }\n\n if (body && !responseInit.headers.has('Content-Length')) {\n responseInit.headers.set('Content-Length', body.byteLength.toString())\n }\n\n return new HttpResponse(body, responseInit)\n }\n\n /**\n * Create a `Response` with a `FormData` body.\n * @example\n * const data = new FormData()\n * data.set('name', 'Alice')\n *\n * HttpResponse.formData(data)\n */\n static formData(\n body?: FormData,\n init?: HttpResponseInit,\n ): HttpResponse<FormData> {\n return new HttpResponse(body, normalizeResponseInit(init))\n }\n}\n"],"mappings":"AAAA,SAAS,qBAAqB;AAG9B;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAMA,MAAM,WAA0B,OAAO,UAAU;AA4BjD,MAAM,qBAEH,cAAc;AAAA,EACtB,CAAU,QAAQ,IAAc;AAAA,EAEhC,YAAY,MAAiC,MAAyB;AACpE,UAAM,eAAe,sBAAsB,IAAI;AAC/C,UAAM,MAAkB,YAAY;AACpC,qBAAiB,MAAM,YAAY;AAAA,EACrC;AAAA,EAEA,OAAO,QAA2B;AAChC,WAAO,MAAM,MAAM;AAAA,EACrB;AAAA;AAAA;AAAA;AAAA;A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sBAAsB,IAAI;AAE/C,QAAI,CAAC,aAAa,QAAQ,IAAI,cAAc,GAAG;AAC7C,mBAAa,QAAQ,IAAI,gBAAgB,WAAW;AAAA,IACtD;AAEA,WAAO,IAAI,aAAa,MAAM,YAAY;AAAA,EAC5C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWA,OAAO,YACL,MACA,MACwB;AACxB,UAAM,eAAe,sBAAsB,IAAI;AAE/C,QAAI,CAAC,aAAa,QAAQ,IAAI,cAAc,GAAG;AAC7C,mBAAa,QAAQ,IAAI,gBAAgB,0BAA0B;AAAA,IACrE;AAEA,QAAI,QAAQ,CAAC,aAAa,QAAQ,IAAI,gBAAgB,GAAG;AACvD,mBAAa,QAAQ,IAAI,kBAAkB,KAAK,WAAW,SAAS,CAAC;AAAA,IACvE;AAEA,WAAO,IAAI,aAAa,MAAM,YAAY;AAAA,EAC5C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,OAAO,SACL,MACA,MACwB;AACxB,WAAO,IAAI,aAAa,MAAM,sBAAsB,IAAI,CAAC;AAAA,EAC3D;AACF;","names":[]}
|
package/lib/core/SetupApi.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EventMap, Emitter } from 'strict-event-emitter';
|
|
2
|
-
import { R as RequestHandler } from './HttpResponse-
|
|
2
|
+
import { R as RequestHandler } from './HttpResponse-B4YmE-GJ.mjs';
|
|
3
3
|
import { LifeCycleEventEmitter } from './sharedOptions.mjs';
|
|
4
4
|
import { Disposable } from './utils/internal/Disposable.mjs';
|
|
5
5
|
import { WebSocketHandler } from './handlers/WebSocketHandler.mjs';
|
package/lib/core/SetupApi.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EventMap, Emitter } from 'strict-event-emitter';
|
|
2
|
-
import { R as RequestHandler } from './HttpResponse-
|
|
2
|
+
import { R as RequestHandler } from './HttpResponse-BbwAqLE_.js';
|
|
3
3
|
import { LifeCycleEventEmitter } from './sharedOptions.js';
|
|
4
4
|
import { Disposable } from './utils/internal/Disposable.js';
|
|
5
5
|
import { WebSocketHandler } from './handlers/WebSocketHandler.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as RequestHandler, p as ResponseResolutionContext } from './HttpResponse-
|
|
1
|
+
import { R as RequestHandler, p as ResponseResolutionContext } from './HttpResponse-B4YmE-GJ.mjs';
|
|
2
2
|
import '@mswjs/interceptors';
|
|
3
3
|
import './utils/internal/isIterable.mjs';
|
|
4
4
|
import './typeUtils.mjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as RequestHandler, p as ResponseResolutionContext } from './HttpResponse-
|
|
1
|
+
import { R as RequestHandler, p as ResponseResolutionContext } from './HttpResponse-BbwAqLE_.js';
|
|
2
2
|
import '@mswjs/interceptors';
|
|
3
3
|
import './utils/internal/isIterable.js';
|
|
4
4
|
import './typeUtils.js';
|
package/lib/core/graphql.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DocumentNode } from 'graphql';
|
|
2
|
-
import { e as GraphQLQuery, f as GraphQLVariables, q as GraphQLHandlerNameSelector, k as GraphQLCustomPredicate, a as ResponseResolver, r as GraphQLResolverExtras, h as GraphQLResponseBody, c as RequestHandlerOptions, G as GraphQLHandler } from './HttpResponse-
|
|
2
|
+
import { e as GraphQLQuery, f as GraphQLVariables, q as GraphQLHandlerNameSelector, k as GraphQLCustomPredicate, a as ResponseResolver, r as GraphQLResolverExtras, h as GraphQLResponseBody, c as RequestHandlerOptions, G as GraphQLHandler } from './HttpResponse-B4YmE-GJ.mjs';
|
|
3
3
|
import { Path } from './utils/matching/matchRequestUrl.mjs';
|
|
4
4
|
import '@mswjs/interceptors';
|
|
5
5
|
import './utils/internal/isIterable.mjs';
|
package/lib/core/graphql.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DocumentNode } from 'graphql';
|
|
2
|
-
import { e as GraphQLQuery, f as GraphQLVariables, q as GraphQLHandlerNameSelector, k as GraphQLCustomPredicate, a as ResponseResolver, r as GraphQLResolverExtras, h as GraphQLResponseBody, c as RequestHandlerOptions, G as GraphQLHandler } from './HttpResponse-
|
|
2
|
+
import { e as GraphQLQuery, f as GraphQLVariables, q as GraphQLHandlerNameSelector, k as GraphQLCustomPredicate, a as ResponseResolver, r as GraphQLResolverExtras, h as GraphQLResponseBody, c as RequestHandlerOptions, G as GraphQLHandler } from './HttpResponse-BbwAqLE_.js';
|
|
3
3
|
import { Path } from './utils/matching/matchRequestUrl.js';
|
|
4
4
|
import '@mswjs/interceptors';
|
|
5
5
|
import './utils/internal/isIterable.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import 'graphql';
|
|
2
|
-
export { k as GraphQLCustomPredicate, E as GraphQLCustomPredicateResult, G as GraphQLHandler, B as GraphQLHandlerInfo, q as GraphQLHandlerNameSelector, i as GraphQLJsonRequestBody, j as GraphQLOperationType, F as GraphQLPredicate, e as GraphQLQuery, g as GraphQLRequestBody, C as GraphQLRequestParsedResult, r as GraphQLResolverExtras, h as GraphQLResponseBody, f as GraphQLVariables, I as isDocumentNode } from '../HttpResponse-
|
|
2
|
+
export { k as GraphQLCustomPredicate, E as GraphQLCustomPredicateResult, G as GraphQLHandler, B as GraphQLHandlerInfo, q as GraphQLHandlerNameSelector, i as GraphQLJsonRequestBody, j as GraphQLOperationType, F as GraphQLPredicate, e as GraphQLQuery, g as GraphQLRequestBody, C as GraphQLRequestParsedResult, r as GraphQLResolverExtras, h as GraphQLResponseBody, f as GraphQLVariables, I as isDocumentNode } from '../HttpResponse-B4YmE-GJ.mjs';
|
|
3
3
|
import '../utils/matching/matchRequestUrl.mjs';
|
|
4
4
|
import '@mswjs/interceptors';
|
|
5
5
|
import '../utils/internal/isIterable.mjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import 'graphql';
|
|
2
|
-
export { k as GraphQLCustomPredicate, E as GraphQLCustomPredicateResult, G as GraphQLHandler, B as GraphQLHandlerInfo, q as GraphQLHandlerNameSelector, i as GraphQLJsonRequestBody, j as GraphQLOperationType, F as GraphQLPredicate, e as GraphQLQuery, g as GraphQLRequestBody, C as GraphQLRequestParsedResult, r as GraphQLResolverExtras, h as GraphQLResponseBody, f as GraphQLVariables, I as isDocumentNode } from '../HttpResponse-
|
|
2
|
+
export { k as GraphQLCustomPredicate, E as GraphQLCustomPredicateResult, G as GraphQLHandler, B as GraphQLHandlerInfo, q as GraphQLHandlerNameSelector, i as GraphQLJsonRequestBody, j as GraphQLOperationType, F as GraphQLPredicate, e as GraphQLQuery, g as GraphQLRequestBody, C as GraphQLRequestParsedResult, r as GraphQLResolverExtras, h as GraphQLResponseBody, f as GraphQLVariables, I as isDocumentNode } from '../HttpResponse-BbwAqLE_.js';
|
|
3
3
|
import '../utils/matching/matchRequestUrl.js';
|
|
4
4
|
import '@mswjs/interceptors';
|
|
5
5
|
import '../utils/internal/isIterable.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as RequestHandler, s as RequestHandlerDefaultInfo, a as ResponseResolver, c as RequestHandlerOptions, p as ResponseResolutionContext } from '../HttpResponse-
|
|
1
|
+
import { R as RequestHandler, s as RequestHandlerDefaultInfo, a as ResponseResolver, c as RequestHandlerOptions, p as ResponseResolutionContext } from '../HttpResponse-B4YmE-GJ.mjs';
|
|
2
2
|
import { PathParams, Path, Match } from '../utils/matching/matchRequestUrl.mjs';
|
|
3
3
|
import '@mswjs/interceptors';
|
|
4
4
|
import '../utils/internal/isIterable.mjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as RequestHandler, s as RequestHandlerDefaultInfo, a as ResponseResolver, c as RequestHandlerOptions, p as ResponseResolutionContext } from '../HttpResponse-
|
|
1
|
+
import { R as RequestHandler, s as RequestHandlerDefaultInfo, a as ResponseResolver, c as RequestHandlerOptions, p as ResponseResolutionContext } from '../HttpResponse-BbwAqLE_.js';
|
|
2
2
|
import { PathParams, Path, Match } from '../utils/matching/matchRequestUrl.js';
|
|
3
3
|
import '@mswjs/interceptors';
|
|
4
4
|
import '../utils/internal/isIterable.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '../utils/internal/isIterable.mjs';
|
|
2
|
-
export { A as AsyncResponseResolverReturnType, D as DefaultBodyType, d as DefaultRequestMultipartBody, J as JsonBodyType, M as MaybeAsyncResponseResolverReturnType, R as RequestHandler, N as RequestHandlerArgs, s as RequestHandlerDefaultInfo, O as RequestHandlerExecutionResult, K as RequestHandlerInternalInfo, c as RequestHandlerOptions, a as ResponseResolver, L as ResponseResolverInfo, b as ResponseResolverReturnType } from '../HttpResponse-
|
|
2
|
+
export { A as AsyncResponseResolverReturnType, D as DefaultBodyType, d as DefaultRequestMultipartBody, J as JsonBodyType, M as MaybeAsyncResponseResolverReturnType, R as RequestHandler, N as RequestHandlerArgs, s as RequestHandlerDefaultInfo, O as RequestHandlerExecutionResult, K as RequestHandlerInternalInfo, c as RequestHandlerOptions, a as ResponseResolver, L as ResponseResolverInfo, b as ResponseResolverReturnType } from '../HttpResponse-B4YmE-GJ.mjs';
|
|
3
3
|
import '../typeUtils.mjs';
|
|
4
4
|
import '@mswjs/interceptors';
|
|
5
5
|
import 'graphql';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '../utils/internal/isIterable.js';
|
|
2
|
-
export { A as AsyncResponseResolverReturnType, D as DefaultBodyType, d as DefaultRequestMultipartBody, J as JsonBodyType, M as MaybeAsyncResponseResolverReturnType, R as RequestHandler, N as RequestHandlerArgs, s as RequestHandlerDefaultInfo, O as RequestHandlerExecutionResult, K as RequestHandlerInternalInfo, c as RequestHandlerOptions, a as ResponseResolver, L as ResponseResolverInfo, b as ResponseResolverReturnType } from '../HttpResponse-
|
|
2
|
+
export { A as AsyncResponseResolverReturnType, D as DefaultBodyType, d as DefaultRequestMultipartBody, J as JsonBodyType, M as MaybeAsyncResponseResolverReturnType, R as RequestHandler, N as RequestHandlerArgs, s as RequestHandlerDefaultInfo, O as RequestHandlerExecutionResult, K as RequestHandlerInternalInfo, c as RequestHandlerOptions, a as ResponseResolver, L as ResponseResolverInfo, b as ResponseResolverReturnType } from '../HttpResponse-BbwAqLE_.js';
|
|
3
3
|
import '../typeUtils.js';
|
|
4
4
|
import '@mswjs/interceptors';
|
|
5
5
|
import 'graphql';
|
package/lib/core/http.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as DefaultBodyType, a as ResponseResolver, c as RequestHandlerOptions } from './HttpResponse-
|
|
1
|
+
import { D as DefaultBodyType, a as ResponseResolver, c as RequestHandlerOptions } from './HttpResponse-B4YmE-GJ.mjs';
|
|
2
2
|
import { HttpRequestPredicate, HttpRequestResolverExtras, HttpHandler } from './handlers/HttpHandler.mjs';
|
|
3
3
|
import { PathParams } from './utils/matching/matchRequestUrl.mjs';
|
|
4
4
|
import '@mswjs/interceptors';
|
package/lib/core/http.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as DefaultBodyType, a as ResponseResolver, c as RequestHandlerOptions } from './HttpResponse-
|
|
1
|
+
import { D as DefaultBodyType, a as ResponseResolver, c as RequestHandlerOptions } from './HttpResponse-BbwAqLE_.js';
|
|
2
2
|
import { HttpRequestPredicate, HttpRequestResolverExtras, HttpHandler } from './handlers/HttpHandler.js';
|
|
3
3
|
import { PathParams } from './utils/matching/matchRequestUrl.js';
|
|
4
4
|
import '@mswjs/interceptors';
|
package/lib/core/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { SetupApi } from './SetupApi.mjs';
|
|
2
|
-
export { A as AsyncResponseResolverReturnType, D as DefaultBodyType, d as DefaultRequestMultipartBody, m as DefaultUnsafeFetchResponse, k as GraphQLCustomPredicate, G as GraphQLHandler, i as GraphQLJsonRequestBody, j as GraphQLOperationType, e as GraphQLQuery, g as GraphQLRequestBody, h as GraphQLResponseBody, f as GraphQLVariables, o as HttpResponse, H as HttpResponseInit, J as JsonBodyType, P as ParsedGraphQLRequest, R as RequestHandler, c as RequestHandlerOptions, a as ResponseResolver, b as ResponseResolverReturnType, S as StrictRequest, n as StrictResponse, l as bodyType } from './HttpResponse-
|
|
2
|
+
export { A as AsyncResponseResolverReturnType, D as DefaultBodyType, d as DefaultRequestMultipartBody, m as DefaultUnsafeFetchResponse, k as GraphQLCustomPredicate, G as GraphQLHandler, i as GraphQLJsonRequestBody, j as GraphQLOperationType, e as GraphQLQuery, g as GraphQLRequestBody, h as GraphQLResponseBody, f as GraphQLVariables, o as HttpResponse, H as HttpResponseInit, J as JsonBodyType, P as ParsedGraphQLRequest, R as RequestHandler, c as RequestHandlerOptions, a as ResponseResolver, b as ResponseResolverReturnType, S as StrictRequest, n as StrictResponse, l as bodyType } from './HttpResponse-B4YmE-GJ.mjs';
|
|
3
3
|
export { HttpRequestHandler, HttpResponseResolver, http } from './http.mjs';
|
|
4
4
|
export { HttpCustomPredicate, HttpHandler, HttpMethods, HttpRequestParsedResult, RequestQuery } from './handlers/HttpHandler.mjs';
|
|
5
5
|
export { GraphQLRequestHandler, GraphQLResponseResolver, graphql } from './graphql.mjs';
|
package/lib/core/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { SetupApi } from './SetupApi.js';
|
|
2
|
-
export { A as AsyncResponseResolverReturnType, D as DefaultBodyType, d as DefaultRequestMultipartBody, m as DefaultUnsafeFetchResponse, k as GraphQLCustomPredicate, G as GraphQLHandler, i as GraphQLJsonRequestBody, j as GraphQLOperationType, e as GraphQLQuery, g as GraphQLRequestBody, h as GraphQLResponseBody, f as GraphQLVariables, o as HttpResponse, H as HttpResponseInit, J as JsonBodyType, P as ParsedGraphQLRequest, R as RequestHandler, c as RequestHandlerOptions, a as ResponseResolver, b as ResponseResolverReturnType, S as StrictRequest, n as StrictResponse, l as bodyType } from './HttpResponse-
|
|
2
|
+
export { A as AsyncResponseResolverReturnType, D as DefaultBodyType, d as DefaultRequestMultipartBody, m as DefaultUnsafeFetchResponse, k as GraphQLCustomPredicate, G as GraphQLHandler, i as GraphQLJsonRequestBody, j as GraphQLOperationType, e as GraphQLQuery, g as GraphQLRequestBody, h as GraphQLResponseBody, f as GraphQLVariables, o as HttpResponse, H as HttpResponseInit, J as JsonBodyType, P as ParsedGraphQLRequest, R as RequestHandler, c as RequestHandlerOptions, a as ResponseResolver, b as ResponseResolverReturnType, S as StrictRequest, n as StrictResponse, l as bodyType } from './HttpResponse-BbwAqLE_.js';
|
|
3
3
|
export { HttpRequestHandler, HttpResponseResolver, http } from './http.js';
|
|
4
4
|
export { HttpCustomPredicate, HttpHandler, HttpMethods, HttpRequestParsedResult, RequestQuery } from './handlers/HttpHandler.js';
|
|
5
5
|
export { GraphQLRequestHandler, GraphQLResponseResolver, graphql } from './graphql.js';
|
|
@@ -1,5 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Cookie } from 'tough-cookie';
|
|
2
2
|
|
|
3
|
-
declare
|
|
3
|
+
declare class CookieStore {
|
|
4
|
+
#private;
|
|
5
|
+
constructor();
|
|
6
|
+
getCookies(url: string): Array<Cookie>;
|
|
7
|
+
setCookie(cookieName: string, url: string): Promise<void>;
|
|
8
|
+
private getCookieStoreIndex;
|
|
9
|
+
private persist;
|
|
10
|
+
}
|
|
11
|
+
declare const cookieStore: CookieStore;
|
|
4
12
|
|
|
5
13
|
export { cookieStore };
|
|
@@ -1,5 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Cookie } from 'tough-cookie';
|
|
2
2
|
|
|
3
|
-
declare
|
|
3
|
+
declare class CookieStore {
|
|
4
|
+
#private;
|
|
5
|
+
constructor();
|
|
6
|
+
getCookies(url: string): Array<Cookie>;
|
|
7
|
+
setCookie(cookieName: string, url: string): Promise<void>;
|
|
8
|
+
private getCookieStoreIndex;
|
|
9
|
+
private persist;
|
|
10
|
+
}
|
|
11
|
+
declare const cookieStore: CookieStore;
|
|
4
12
|
|
|
5
13
|
export { cookieStore };
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __export = (target, all) => {
|
|
9
7
|
for (var name in all)
|
|
@@ -17,171 +15,76 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
19
|
var cookieStore_exports = {};
|
|
30
20
|
__export(cookieStore_exports, {
|
|
31
21
|
cookieStore: () => cookieStore
|
|
32
22
|
});
|
|
33
23
|
module.exports = __toCommonJS(cookieStore_exports);
|
|
34
|
-
var import_outvariant = require("outvariant");
|
|
35
24
|
var import_is_node_process = require("is-node-process");
|
|
36
|
-
var
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
storageKey;
|
|
25
|
+
var import_outvariant = require("outvariant");
|
|
26
|
+
var import_tough_cookie = require("tough-cookie");
|
|
27
|
+
var import_jsonParse = require("./internal/jsonParse");
|
|
28
|
+
class CookieStore {
|
|
29
|
+
#storageKey = "__msw-cookie-store__";
|
|
30
|
+
#jar;
|
|
31
|
+
#memoryStore;
|
|
41
32
|
constructor() {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
this.synchronous = true;
|
|
48
|
-
this.storage = localStorage;
|
|
49
|
-
this.storageKey = "__msw-cookie-store__";
|
|
50
|
-
}
|
|
51
|
-
findCookie(domain, path, key, callback) {
|
|
52
|
-
try {
|
|
53
|
-
const store2 = this.getStore();
|
|
54
|
-
const cookies = this.filterCookiesFromList(store2, { domain, path, key });
|
|
55
|
-
callback(null, cookies[0] || null);
|
|
56
|
-
} catch (error) {
|
|
57
|
-
if (error instanceof Error) {
|
|
58
|
-
callback(error, null);
|
|
59
|
-
}
|
|
33
|
+
if (!(0, import_is_node_process.isNodeProcess)()) {
|
|
34
|
+
(0, import_outvariant.invariant)(
|
|
35
|
+
typeof localStorage !== "undefined",
|
|
36
|
+
"Failed to create a CookieStore: `localStorage` is not available in this environment. This is likely an issue with your environment, which has been detected as browser (or browser-like) environment and must implement global browser APIs correctly."
|
|
37
|
+
);
|
|
60
38
|
}
|
|
39
|
+
this.#memoryStore = new import_tough_cookie.MemoryCookieStore();
|
|
40
|
+
this.#memoryStore.idx = this.getCookieStoreIndex();
|
|
41
|
+
this.#jar = new import_tough_cookie.CookieJar(this.#memoryStore);
|
|
61
42
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
callback(null, []);
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
try {
|
|
68
|
-
const store2 = this.getStore();
|
|
69
|
-
const results = this.filterCookiesFromList(store2, {
|
|
70
|
-
domain,
|
|
71
|
-
path
|
|
72
|
-
});
|
|
73
|
-
callback(null, results);
|
|
74
|
-
} catch (error) {
|
|
75
|
-
if (error instanceof Error) {
|
|
76
|
-
callback(error, []);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
43
|
+
getCookies(url) {
|
|
44
|
+
return this.#jar.getCookiesSync(url);
|
|
79
45
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
const store2 = this.getStore();
|
|
86
|
-
store2.push(cookie);
|
|
87
|
-
this.updateStore(store2);
|
|
88
|
-
} catch (error) {
|
|
89
|
-
if (error instanceof Error) {
|
|
90
|
-
callback(error);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
46
|
+
async setCookie(cookieName, url) {
|
|
47
|
+
await this.#jar.setCookie(cookieName, url);
|
|
48
|
+
this.persist();
|
|
93
49
|
}
|
|
94
|
-
|
|
95
|
-
if (
|
|
96
|
-
|
|
97
|
-
newCookie.domain || "",
|
|
98
|
-
newCookie.path || "",
|
|
99
|
-
newCookie.key,
|
|
100
|
-
callback
|
|
101
|
-
);
|
|
102
|
-
return;
|
|
50
|
+
getCookieStoreIndex() {
|
|
51
|
+
if (typeof localStorage === "undefined") {
|
|
52
|
+
return {};
|
|
103
53
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
try {
|
|
108
|
-
const store2 = this.getStore();
|
|
109
|
-
const nextStore = this.deleteCookiesFromList(store2, { domain, path, key });
|
|
110
|
-
this.updateStore(nextStore);
|
|
111
|
-
callback(null);
|
|
112
|
-
} catch (error) {
|
|
113
|
-
if (error instanceof Error) {
|
|
114
|
-
callback(error);
|
|
115
|
-
}
|
|
54
|
+
const cookiesString = localStorage.getItem(this.#storageKey);
|
|
55
|
+
if (cookiesString == null) {
|
|
56
|
+
return {};
|
|
116
57
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
const store2 = this.getStore();
|
|
121
|
-
const nextStore = this.deleteCookiesFromList(store2, { domain, path });
|
|
122
|
-
this.updateStore(nextStore);
|
|
123
|
-
callback(null);
|
|
124
|
-
} catch (error) {
|
|
125
|
-
if (error instanceof Error) {
|
|
126
|
-
callback(error);
|
|
127
|
-
}
|
|
58
|
+
const rawCookies = (0, import_jsonParse.jsonParse)(cookiesString);
|
|
59
|
+
if (rawCookies == null) {
|
|
60
|
+
return {};
|
|
128
61
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
62
|
+
const cookies = {};
|
|
63
|
+
for (const rawCookie of rawCookies) {
|
|
64
|
+
const cookie = import_tough_cookie.Cookie.fromJSON(rawCookie);
|
|
65
|
+
if (cookie != null && cookie.domain != null && cookie.path != null) {
|
|
66
|
+
cookies[cookie.domain] ||= {};
|
|
67
|
+
cookies[cookie.domain][cookie.path] ||= {};
|
|
68
|
+
cookies[cookie.domain][cookie.path][cookie.key] = cookie;
|
|
136
69
|
}
|
|
137
70
|
}
|
|
71
|
+
return cookies;
|
|
138
72
|
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
if (json == null) {
|
|
143
|
-
return [];
|
|
144
|
-
}
|
|
145
|
-
const rawCookies = JSON.parse(json);
|
|
146
|
-
const cookies = [];
|
|
147
|
-
for (const rawCookie of rawCookies) {
|
|
148
|
-
const cookie = Cookie.fromJSON(rawCookie);
|
|
149
|
-
if (cookie != null) {
|
|
150
|
-
cookies.push(cookie);
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
return cookies;
|
|
154
|
-
} catch {
|
|
155
|
-
return [];
|
|
73
|
+
persist() {
|
|
74
|
+
if (typeof localStorage === "undefined") {
|
|
75
|
+
return;
|
|
156
76
|
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
filterCookiesFromList(cookies, matches) {
|
|
165
|
-
const result = [];
|
|
166
|
-
for (const cookie of cookies) {
|
|
167
|
-
if (matches.domain && !domainMatch(matches.domain, cookie.domain || "")) {
|
|
168
|
-
continue;
|
|
169
|
-
}
|
|
170
|
-
if (matches.path && !pathMatch(matches.path, cookie.path || "")) {
|
|
171
|
-
continue;
|
|
172
|
-
}
|
|
173
|
-
if (matches.key && cookie.key !== matches.key) {
|
|
174
|
-
continue;
|
|
77
|
+
const data = [];
|
|
78
|
+
const { idx } = this.#memoryStore;
|
|
79
|
+
for (const domain in idx) {
|
|
80
|
+
for (const path in idx[domain]) {
|
|
81
|
+
for (const key in idx[domain][path]) {
|
|
82
|
+
data.push(idx[domain][path][key].toJSON());
|
|
83
|
+
}
|
|
175
84
|
}
|
|
176
|
-
result.push(cookie);
|
|
177
85
|
}
|
|
178
|
-
|
|
179
|
-
}
|
|
180
|
-
deleteCookiesFromList(cookies, matches) {
|
|
181
|
-
const matchingCookies = this.filterCookiesFromList(cookies, matches);
|
|
182
|
-
return cookies.filter((cookie) => !matchingCookies.includes(cookie));
|
|
86
|
+
localStorage.setItem(this.#storageKey, JSON.stringify(data));
|
|
183
87
|
}
|
|
184
88
|
}
|
|
185
|
-
const
|
|
186
|
-
const cookieStore = new CookieJar(store);
|
|
89
|
+
const cookieStore = new CookieStore();
|
|
187
90
|
//# sourceMappingURL=cookieStore.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/core/utils/cookieStore.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../../../src/core/utils/cookieStore.ts"],"sourcesContent":["import { isNodeProcess } from 'is-node-process'\nimport { invariant } from 'outvariant'\nimport {\n Cookie,\n CookieJar,\n MemoryCookieStore,\n type MemoryCookieStoreIndex,\n} from 'tough-cookie'\nimport { jsonParse } from './internal/jsonParse'\n\nclass CookieStore {\n #storageKey = '__msw-cookie-store__'\n #jar: CookieJar\n #memoryStore: MemoryCookieStore\n\n constructor() {\n if (!isNodeProcess()) {\n invariant(\n typeof localStorage !== 'undefined',\n 'Failed to create a CookieStore: `localStorage` is not available in this environment. This is likely an issue with your environment, which has been detected as browser (or browser-like) environment and must implement global browser APIs correctly.',\n )\n }\n\n this.#memoryStore = new MemoryCookieStore()\n this.#memoryStore.idx = this.getCookieStoreIndex()\n this.#jar = new CookieJar(this.#memoryStore)\n }\n\n public getCookies(url: string): Array<Cookie> {\n return this.#jar.getCookiesSync(url)\n }\n\n public async setCookie(cookieName: string, url: string): Promise<void> {\n await this.#jar.setCookie(cookieName, url)\n this.persist()\n }\n\n private getCookieStoreIndex(): MemoryCookieStoreIndex {\n if (typeof localStorage === 'undefined') {\n return {}\n }\n\n const cookiesString = localStorage.getItem(this.#storageKey)\n if (cookiesString == null) {\n return {}\n }\n\n const rawCookies = jsonParse<Array<Record<string, unknown>>>(cookiesString)\n if (rawCookies == null) {\n return {}\n }\n\n const cookies: MemoryCookieStoreIndex = {}\n\n for (const rawCookie of rawCookies) {\n const cookie = Cookie.fromJSON(rawCookie)\n\n if (cookie != null && cookie.domain != null && cookie.path != null) {\n cookies[cookie.domain] ||= {}\n cookies[cookie.domain][cookie.path] ||= {}\n cookies[cookie.domain][cookie.path][cookie.key] = cookie\n }\n }\n\n return cookies\n }\n\n private persist(): void {\n if (typeof localStorage === 'undefined') {\n return\n }\n\n const data = []\n const { idx } = this.#memoryStore\n\n for (const domain in idx) {\n for (const path in idx[domain]) {\n for (const key in idx[domain][path]) {\n data.push(idx[domain][path][key].toJSON())\n }\n }\n }\n\n localStorage.setItem(this.#storageKey, JSON.stringify(data))\n }\n}\n\nexport const cookieStore = new CookieStore()\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,6BAA8B;AAC9B,wBAA0B;AAC1B,0BAKO;AACP,uBAA0B;AAE1B,MAAM,YAAY;AAAA,EAChB,cAAc;AAAA,EACd;AAAA,EACA;AAAA,EAEA,cAAc;AACZ,QAAI,KAAC,sCAAc,GAAG;AACpB;AAAA,QACE,OAAO,iBAAiB;AAAA,QACxB;AAAA,MACF;AAAA,IACF;AAEA,SAAK,eAAe,IAAI,sCAAkB;AAC1C,SAAK,aAAa,MAAM,KAAK,oBAAoB;AAC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