From 36f707873e01dae672ced94126b643192f59c666 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 12 Dec 2023 19:02:38 +0000 Subject: [PATCH] chore(ui): update dependency msw to v2 (#949) * chore(ui): update dependency msw to v2 Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * update storybook addon * update msw usage for 2.0 * fix type errors --------- Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Joe Karow <58997957+JoeKarow@users.noreply.github.com> --- .../router/location/mutation.update.schema.ts | 5 +- packages/api/schemas/create/orgLocation.ts | 5 +- packages/ui/.storybook/preview.tsx | 6 +- .../components/data-portal/AddressDrawer.tsx | 2 +- .../data-portal/MultiSelectPopover.tsx | 2 +- packages/ui/lib/getTrpcMock.ts | 56 +++--- packages/ui/mockData/location.ts | 2 +- packages/ui/mockData/login.ts | 41 +++-- packages/ui/modals/MoreFilter.tsx | 1 + packages/ui/other/DataViewer.tsx | 2 +- packages/ui/package.json | 4 +- packages/ui/public/mockServiceWorker.js | 170 ++++++++---------- pnpm-lock.yaml | 152 ++++++++-------- 13 files changed, 225 insertions(+), 223 deletions(-) diff --git a/packages/api/router/location/mutation.update.schema.ts b/packages/api/router/location/mutation.update.schema.ts index 0088ad8d7d..e19114b3a1 100644 --- a/packages/api/router/location/mutation.update.schema.ts +++ b/packages/api/router/location/mutation.update.schema.ts @@ -15,7 +15,7 @@ export const ZUpdateSchema = z city: z.string(), postCode: z.string().nullable(), primary: z.boolean(), - mailOnly: z.boolean().nullable(), + mailOnly: z.boolean(), longitude: z.number().nullable(), latitude: z.number().nullable(), geoJSON: Geometry, @@ -34,7 +34,7 @@ export const ZUpdateSchema = z .partial(), }) .transform(({ id, data }) => { - const { accessible, countryId, govDistId, services, mailOnly, ...rest } = data + const { accessible, countryId, govDistId, services, ...rest } = data const accessibleAttrId = allAttributes.find(({ tag }) => tag === 'wheelchair-accessible')?.id @@ -44,7 +44,6 @@ export const ZUpdateSchema = z where: { id }, data: { ...rest, - mailOnly: mailOnly === false ? null : mailOnly, ...(updateAccessibility ? accessible.boolean !== null ? { diff --git a/packages/api/schemas/create/orgLocation.ts b/packages/api/schemas/create/orgLocation.ts index 03dc2635fb..f377e1b468 100644 --- a/packages/api/schemas/create/orgLocation.ts +++ b/packages/api/schemas/create/orgLocation.ts @@ -168,7 +168,7 @@ export const EditOrgLocationSchema = z city: z.string(), postCode: z.string().nullable(), primary: z.boolean(), - mailOnly: z.boolean().nullable(), + mailOnly: z.boolean().default(false), longitude: z.number().nullable(), latitude: z.number().nullable(), geoJSON: Geometry, @@ -187,7 +187,7 @@ export const EditOrgLocationSchema = z .partial(), }) .transform(({ id, data }) => { - const { accessible, countryId, govDistId, services, mailOnly, ...rest } = data + const { accessible, countryId, govDistId, services, ...rest } = data const accessibleAttrId = allAttributes.find(({ tag }) => tag === 'wheelchair-accessible')?.id @@ -197,7 +197,6 @@ export const EditOrgLocationSchema = z where: { id }, data: { ...rest, - mailOnly: mailOnly === false ? null : mailOnly, ...(updateAccessibility ? accessible.boolean !== null ? { diff --git a/packages/ui/.storybook/preview.tsx b/packages/ui/.storybook/preview.tsx index f45418dc6e..7f9aa4b027 100644 --- a/packages/ui/.storybook/preview.tsx +++ b/packages/ui/.storybook/preview.tsx @@ -3,7 +3,7 @@ import './font.css' import { type BADGE } from '@geometricpanda/storybook-addon-badges' import { type Preview } from '@storybook/react' import { type WhyDidYouRenderOptions } from '@welldone-software/why-did-you-render' -import { type RequestHandler, rest } from 'msw' +import { http, passthrough, type RequestHandler } from 'msw' import { initialize as initializeMsw, mswLoader } from 'msw-storybook-addon' import { type BaseRouter } from 'next/dist/shared/lib/router/router' import { type Router } from 'next/router' @@ -35,7 +35,7 @@ initializeMsw({ }, }, onUnhandledRequest: ({ method, url }) => { - if (url.pathname.startsWith('/trpc' || '/api')) { + if (url.startsWith('/trpc' || '/api')) { console.error(`Unhandled ${method} request to ${url}. This exception has been only logged in the console, however, it's strongly recommended to resolve this error as you don't want unmocked data in Storybook stories. @@ -74,7 +74,7 @@ const preview: Preview = { // }, msw: { handlers: { - passthrough: rest.get(/^\/(?!api|trpc).*$/, (req) => req.passthrough()), + passthrough: http.get(/^\/(?!api|trpc).*$/, () => passthrough()), }, }, }, diff --git a/packages/ui/components/data-portal/AddressDrawer.tsx b/packages/ui/components/data-portal/AddressDrawer.tsx index eedeaccc99..79bd3777fa 100644 --- a/packages/ui/components/data-portal/AddressDrawer.tsx +++ b/packages/ui/components/data-portal/AddressDrawer.tsx @@ -77,7 +77,7 @@ const FormSchema = z.object({ city: z.string(), postCode: z.string().nullable().transform(transformNullString), primary: z.coerce.boolean(), - mailOnly: z.boolean().nullable(), + mailOnly: z.boolean(), longitude: z.coerce.number().nullable(), latitude: z.coerce.number().nullable(), geoWKT: z.string().nullable().transform(transformNullString), diff --git a/packages/ui/components/data-portal/MultiSelectPopover.tsx b/packages/ui/components/data-portal/MultiSelectPopover.tsx index 5c1fae2d42..b13dac26e6 100644 --- a/packages/ui/components/data-portal/MultiSelectPopover.tsx +++ b/packages/ui/components/data-portal/MultiSelectPopover.tsx @@ -113,7 +113,7 @@ export const MultiSelectPopover = ({ - + {items.map((props, index) => ( { +const getReqData = async (req: StrictRequest) => { if (req.method === 'POST') { const body = await req.clone().text() return body } - const query = req.url.search.charAt(0) === '?' ? req.url.search.substring(1) : req.url.search - const parsed = querystring.parse(query) + const url = new URL(req.url) + // const query = req.url.search.charAt(0) === '?' ? req.url.search.substring(1) : req.url.search + const parsed = querystring.parse(url.searchParams.toString()) if (parsed.input) { if (Array.isArray(parsed.input)) return parsed.input[0] ?? '' return parsed.input @@ -43,9 +45,9 @@ export const getTRPCMock = < O extends ApiOutput[K1][K2] | ((input: ApiInput[K1][K2]) => ApiOutput[K1][K2]), >( endpoint: TRPCEndpointSuccess | TRPCEndpointError -): RestHandler => { +): HttpHandler => { // #region msw handler - const fn = endpoint.type === 'mutation' ? rest.post : rest.get + const fn = endpoint.type === 'mutation' ? http.post : http.get const type = endpoint.type === 'mutation' ? 'mutation' : 'query' const trpcRequest = action(`${type === 'query' ? '❓' : '✍️'} tRPC Request [${endpoint.path.join('.')}]`) @@ -54,26 +56,40 @@ export const getTRPCMock = < if (typeof endpoint.response === 'function') { const { response } = endpoint - return fn(route, async (req, res, ctx) => { - const data = await getReqData(req) + return fn(route, async (ctx) => { + const data = await getReqData(ctx.request) + const transformed = transformer.parse(data) trpcRequest(transformed) - return res( - ctx.json(jsonRpcSuccessResponse(endpoint.path, response(transformed))), - ctx.delay(endpoint.delay) - ) + await delay(endpoint.delay) + const responseData = jsonRpcSuccessResponse(endpoint.path, response(transformed)) + return HttpResponse.json(responseData, { status: 200 }) }) } - return fn(route, async (req, res, ctx) => { - const data = await getReqData(req) + if (endpoint.error) { + return fn(route, async (ctx) => { + const data = await getReqData(ctx.request) + const transformed = transformer.parse(data) + trpcRequest(transformed) + await delay(endpoint.delay) + const responseData = jsonRpcErrorResponse(endpoint.path, endpoint.error) + const httpStatus = getHTTPStatusCodeFromError({ + code: endpoint.error.code, + message: endpoint.error.message, + name: endpoint.error.code, + }) + return HttpResponse.json(responseData, { status: httpStatus }) + }) + } + + return fn(route, async (ctx) => { + const data = await getReqData(ctx.request) const transformed = transformer.parse(data) trpcRequest(transformed) - if (endpoint.error) { - return res(ctx.json(jsonRpcErrorResponse(endpoint.path, endpoint.error)), ctx.delay(endpoint.delay)) - } - - return res(ctx.json(jsonRpcSuccessResponse(endpoint.path, endpoint.response)), ctx.delay(endpoint.delay)) + await delay(endpoint.delay) + const responseData = jsonRpcSuccessResponse(endpoint.path, endpoint.response) + return HttpResponse.json(responseData, { status: 200 }) }) // #endregion } @@ -100,5 +116,5 @@ export type MockDataObject

= { [K in keyof ApiOutput[P]]?: ApiOutput[P][K] | ((input: ApiInput[P][K]) => ApiOutput[P][K]) } export type MockHandlerObject

= { - [K in keyof ApiOutput[P]]?: RestHandler + [K in keyof ApiOutput[P]]?: HttpHandler } diff --git a/packages/ui/mockData/location.ts b/packages/ui/mockData/location.ts index 126de922b1..42e13608f5 100644 --- a/packages/ui/mockData/location.ts +++ b/packages/ui/mockData/location.ts @@ -13,7 +13,7 @@ const locationData = { countryId: 'ctry_01GW2HHDK9M26M80SG63T21SVH', latitude: 38.91, longitude: -77.032, - mailOnly: null, + mailOnly: false, published: true, accessible: { supplementId: undefined, diff --git a/packages/ui/mockData/login.ts b/packages/ui/mockData/login.ts index 3aae1214d3..c6c6487932 100644 --- a/packages/ui/mockData/login.ts +++ b/packages/ui/mockData/login.ts @@ -1,5 +1,5 @@ import { action } from '@storybook/addon-actions' -import { rest } from 'msw' +import { delay, http, HttpResponse, type PathParams } from 'msw' import querystring from 'querystring' @@ -14,27 +14,33 @@ const providerResponse = { } export const providers = () => - rest.get('/api/auth/providers', (req, res, ctx) => res(ctx.delay(), ctx.json(providerResponse))) + http.get('/api/auth/providers', async () => { + await delay() + return HttpResponse.json(providerResponse) + }) export const csrf = () => - rest.get('/api/auth/csrf', (req, res, ctx) => - res( - ctx.delay(), - ctx.json({ csrfToken: 'd11134f8413295d97df65b0dfdb7166db4bb1e49af48345a4d567a841ffd048b' }) - ) - ) + http.get('/api/auth/csrf', async () => { + await delay() + return HttpResponse.json({ + csrfToken: 'd11134f8413295d97df65b0dfdb7166db4bb1e49af48345a4d567a841ffd048b', + }) + }) export const signin = () => - rest.all('/api/auth/signin', (req, res, ctx) => { - return res(ctx.delay(), ctx.json({ ...req.params })) + http.all('/api/auth/signin', async (ctx) => { + await delay() + return HttpResponse.json({ ...ctx.params }) }) export const cognito = () => - rest.post('/api/auth/callback/cognito', async (req, res, ctx) => { - const body = await req.text() + http.post('/api/auth/callback/cognito', async (ctx) => { + const body = await ctx.request.text() const data = querystring.parse(body) const { password } = data + await delay() + if (password === 'good') { const returnData = { url: 'http://localhost:6006/?path=/story/modals-login--modal', @@ -43,7 +49,7 @@ export const cognito = () => error: undefined, } action('Login with good credentials')(returnData) - return res(ctx.delay(), ctx.json(returnData)) + return HttpResponse.json(returnData) } const returnData = { error: 'Incorrect username or password.', @@ -52,5 +58,12 @@ export const cognito = () => url: null, } action('Login with bad credentials')(returnData) - return res(ctx.delay(), ctx.status(401), ctx.json(returnData)) + return HttpResponse.json(returnData, { status: 401 }) }) + +interface SignInResponse { + error: string | undefined + status: number + ok: boolean + url: string | null +} diff --git a/packages/ui/modals/MoreFilter.tsx b/packages/ui/modals/MoreFilter.tsx index f4bdfce7c2..193eb3ed86 100644 --- a/packages/ui/modals/MoreFilter.tsx +++ b/packages/ui/modals/MoreFilter.tsx @@ -374,6 +374,7 @@ const MoreFilterBody = forwardRef( > diff --git a/packages/ui/other/DataViewer.tsx b/packages/ui/other/DataViewer.tsx index aa58f04ad5..2bbd815a0d 100644 --- a/packages/ui/other/DataViewer.tsx +++ b/packages/ui/other/DataViewer.tsx @@ -3,7 +3,7 @@ import { JsonViewer, type JsonViewerProps } from '@textea/json-viewer' export const DataViewer = ({ value, enableClipboard, dontCollapse, ...props }: DataViewerProps) => ( - + { - if (error.name === 'NetworkError') { - console.warn( - '[MSW] Successfully emulated a network error for the "%s %s" request.', - request.method, - request.url, - ) - return - } - - // At this point, any exception indicates an issue with the original request/response. - console.error( - `\ -[MSW] Caught an exception from the "%s %s" request (%s). This is probably not a problem with Mock Service Worker. There is likely an additional logging output above.`, - request.method, - request.url, - `${error.name}: ${error.message}`, - ) - }), - ) + const requestId = crypto.randomUUID() + event.respondWith(handleRequest(event, requestId)) }) async function handleRequest(event, requestId) { @@ -146,21 +120,24 @@ async function handleRequest(event, requestId) { // this message will pend indefinitely. if (client && activeClientIds.has(client.id)) { ;(async function () { - const clonedResponse = response.clone() - sendToClient(client, { - type: 'RESPONSE', - payload: { - requestId, - type: clonedResponse.type, - ok: clonedResponse.ok, - status: clonedResponse.status, - statusText: clonedResponse.statusText, - body: - clonedResponse.body === null ? null : await clonedResponse.text(), - headers: Object.fromEntries(clonedResponse.headers.entries()), - redirected: clonedResponse.redirected, + const responseClone = response.clone() + + sendToClient( + client, + { + type: 'RESPONSE', + payload: { + requestId, + isMockedResponse: IS_MOCKED_RESPONSE in response, + type: responseClone.type, + status: responseClone.status, + statusText: responseClone.statusText, + body: responseClone.body, + headers: Object.fromEntries(responseClone.headers.entries()), + }, }, - }) + [responseClone.body], + ) })() } @@ -196,20 +173,20 @@ async function resolveMainClient(event) { async function getResponse(event, client, requestId) { const { request } = event - const clonedRequest = request.clone() + + // Clone the request because it might've been already used + // (i.e. its body has been read and sent to the client). + const requestClone = request.clone() function passthrough() { - // Clone the request because it might've been already used - // (i.e. its body has been read and sent to the client). - const headers = Object.fromEntries(clonedRequest.headers.entries()) + const headers = Object.fromEntries(requestClone.headers.entries()) - // Remove MSW-specific request headers so the bypassed requests - // comply with the server's CORS preflight check. - // Operate with the headers as an object because request "Headers" - // are immutable. - delete headers['x-msw-bypass'] + // Remove internal MSW request header so the passthrough request + // complies with any potential CORS preflight checks on the server. + // Some servers forbid unknown request headers. + delete headers['x-msw-intention'] - return fetch(clonedRequest, { headers }) + return fetch(requestClone, { headers }) } // Bypass mocking when the client is not active. @@ -227,31 +204,36 @@ async function getResponse(event, client, requestId) { // Bypass requests with the explicit bypass header. // Such requests can be issued by "ctx.fetch()". - if (request.headers.get('x-msw-bypass') === 'true') { + const mswIntention = request.headers.get('x-msw-intention') + if (['bypass', 'passthrough'].includes(mswIntention)) { return passthrough() } // Notify the client that a request has been intercepted. - const clientMessage = await sendToClient(client, { - type: 'REQUEST', - payload: { - id: requestId, - url: request.url, - method: request.method, - headers: Object.fromEntries(request.headers.entries()), - cache: request.cache, - mode: request.mode, - credentials: request.credentials, - destination: request.destination, - integrity: request.integrity, - redirect: request.redirect, - referrer: request.referrer, - referrerPolicy: request.referrerPolicy, - body: await request.text(), - bodyUsed: request.bodyUsed, - keepalive: request.keepalive, + const requestBuffer = await request.arrayBuffer() + const clientMessage = await sendToClient( + client, + { + type: 'REQUEST', + payload: { + id: requestId, + url: request.url, + mode: request.mode, + method: request.method, + headers: Object.fromEntries(request.headers.entries()), + cache: request.cache, + credentials: request.credentials, + destination: request.destination, + integrity: request.integrity, + redirect: request.redirect, + referrer: request.referrer, + referrerPolicy: request.referrerPolicy, + body: requestBuffer, + keepalive: request.keepalive, + }, }, - }) + [requestBuffer], + ) switch (clientMessage.type) { case 'MOCK_RESPONSE': { @@ -261,21 +243,12 @@ async function getResponse(event, client, requestId) { case 'MOCK_NOT_FOUND': { return passthrough() } - - case 'NETWORK_ERROR': { - const { name, message } = clientMessage.data - const networkError = new Error(message) - networkError.name = name - - // Rejecting a "respondWith" promise emulates a network error. - throw networkError - } } return passthrough() } -function sendToClient(client, message) { +function sendToClient(client, message, transferrables = []) { return new Promise((resolve, reject) => { const channel = new MessageChannel() @@ -287,17 +260,28 @@ function sendToClient(client, message) { resolve(event.data) } - client.postMessage(message, [channel.port2]) + client.postMessage( + message, + [channel.port2].concat(transferrables.filter(Boolean)), + ) }) } -function sleep(timeMs) { - return new Promise((resolve) => { - setTimeout(resolve, timeMs) +async function respondWithMock(response) { + // Setting response status code to 0 is a no-op. + // However, when responding with a "Response.error()", the produced Response + // instance will have status code set to 0. Since it's not possible to create + // a Response instance with status code 0, handle that use-case separately. + if (response.status === 0) { + return Response.error() + } + + const mockedResponse = new Response(response.body, response) + + Reflect.defineProperty(mockedResponse, IS_MOCKED_RESPONSE, { + value: true, + enumerable: true, }) -} -async function respondWithMock(response) { - await sleep(response.delay) - return new Response(response.body, response) + return mockedResponse } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7ea56885a9..e681763964 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1552,11 +1552,11 @@ importers: specifier: 5.1.7 version: 5.1.7 msw: - specifier: 1.3.2 - version: 1.3.2(typescript@5.3.3) + specifier: 2.0.11 + version: 2.0.11(typescript@5.3.3) msw-storybook-addon: - specifier: 1.10.0 - version: 1.10.0(msw@1.3.2) + specifier: 2.0.0--canary.122.06f0c92.0 + version: 2.0.0--canary.122.06f0c92.0(msw@2.0.11) next: specifier: 14.0.4 version: 14.0.4(@babel/core@7.23.6)(react-dom@18.2.0)(react@18.2.0) @@ -3518,6 +3518,24 @@ packages: resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} dev: true + /@bundled-es-modules/cookie@2.0.0: + resolution: {integrity: sha512-Or6YHg/kamKHpxULAdSqhGqnWFneIXu1NKvvfBBzKGwpVsYuFIQ5aBPHDnnoR3ghW1nvSkALd+EF9iMtY7Vjxw==} + dependencies: + cookie: 0.5.0 + dev: true + + /@bundled-es-modules/js-levenshtein@2.0.1: + resolution: {integrity: sha512-DERMS3yfbAljKsQc0U2wcqGKUWpdFjwqWuoMugEJlqBnKO180/n+4SR/J8MRDt1AN48X1ovgoD9KrdVXcaa3Rg==} + dependencies: + js-levenshtein: 1.1.6 + dev: true + + /@bundled-es-modules/statuses@1.0.1: + resolution: {integrity: sha512-yn7BklA5acgcBr+7w064fGV+SGIFySjCKpqjcWgBAIfrAkY+4GQTJJHQMeT3V/sgz23VTEVV8TtOmkvJAhFVfg==} + dependencies: + statuses: 2.0.1 + dev: true + /@changesets/apply-release-plan@7.0.0: resolution: {integrity: sha512-vfi69JR416qC9hWmFGSxj7N6wA5J222XNBmezSVATPWDVPIF7gkd4d8CpbEbXmRWbVrkoli3oerGS6dcL/BGsQ==} dependencies: @@ -4945,28 +4963,21 @@ packages: lilconfig: 2.1.0 dev: false - /@mswjs/cookies@0.2.2: - resolution: {integrity: sha512-mlN83YSrcFgk7Dm1Mys40DLssI1KdJji2CMKN8eOlBqsTADYzj2+jWzsANsUTFbxDMWPD5e9bfA1RGqBpS3O1g==} - engines: {node: '>=14'} - dependencies: - '@types/set-cookie-parser': 2.4.7 - set-cookie-parser: 2.6.0 + /@mswjs/cookies@1.1.0: + resolution: {integrity: sha512-0ZcCVQxifZmhwNBoQIrystCb+2sWBY2Zw8lpfJBPCHGCA/HWqehITeCRVIv4VMy8MPlaHo2w2pTHFV2pFfqKPw==} + engines: {node: '>=18'} dev: true - /@mswjs/interceptors@0.17.10: - resolution: {integrity: sha512-N8x7eSLGcmUFNWZRxT1vsHvypzIRgQYdG0rJey/rZCy6zT/30qDt8Joj7FxzGNLSwXbeZqJOMqDurp7ra4hgbw==} - engines: {node: '>=14'} + /@mswjs/interceptors@0.25.13: + resolution: {integrity: sha512-xfjR81WwXPHwhDbqJRHlxYmboJuiSaIKpP4I5TJVFl/EmByOU13jOBT9hmEnxcjR3jvFYoqoNKt7MM9uqerj9A==} + engines: {node: '>=18'} dependencies: - '@open-draft/until': 1.0.3 - '@types/debug': 4.1.12 - '@xmldom/xmldom': 0.8.10 - debug: 4.3.4 - headers-polyfill: 3.2.5 + '@open-draft/deferred-promise': 2.2.0 + '@open-draft/logger': 0.3.0 + '@open-draft/until': 2.1.0 + is-node-process: 1.2.0 outvariant: 1.4.0 - strict-event-emitter: 0.2.8 - web-encoding: 1.1.5 - transitivePeerDependencies: - - supports-color + strict-event-emitter: 0.5.1 dev: true /@mui/base@5.0.0-beta.26(@types/react@18.2.43)(react-dom@18.2.0)(react@18.2.0): @@ -5522,8 +5533,19 @@ packages: '@octokit/openapi-types': 12.11.0 dev: true - /@open-draft/until@1.0.3: - resolution: {integrity: sha512-Aq58f5HiWdyDlFffbbSjAlv596h/cOnt2DO1w3DOC7OJ5EHs0hd/nycJfiu9RJbT6Yk6F1knnRRXNSpxoIVZ9Q==} + /@open-draft/deferred-promise@2.2.0: + resolution: {integrity: sha512-CecwLWx3rhxVQF6V4bAgPS5t+So2sTbPgAzafKkVizyi7tlwpcFpdFqq+wqF2OwNBmqFuu6tOyouTuxgpMfzmA==} + dev: true + + /@open-draft/logger@0.3.0: + resolution: {integrity: sha512-X2g45fzhxH238HKO4xbSr7+wBS8Fvw6ixhTDuvLd5mqh6bJJCFAPwU9mPDxbcrRtfxv4u5IHCEH77BmxvXmmxQ==} + dependencies: + is-node-process: 1.2.0 + outvariant: 1.4.0 + dev: true + + /@open-draft/until@2.1.0: + resolution: {integrity: sha512-U69T3ItWHvLwGg5eJ0n3I62nWuE6ilHlmz7zM0npLBRvPRd7e6NYmg54vvRtP5mZG7kZqZCFVdsTWo7BPtBujg==} dev: true /@opentelemetry/api-logs@0.45.1: @@ -9733,12 +9755,6 @@ packages: '@types/node': 20.10.4 dev: true - /@types/set-cookie-parser@2.4.7: - resolution: {integrity: sha512-+ge/loa0oTozxip6zmhRIk8Z/boU51wl9Q6QdLZcokIGMzY5lFXYy/x7Htj2HTC6/KZP1hUbZ1ekx8DYXICvWg==} - dependencies: - '@types/node': 20.10.4 - dev: true - /@types/shimmer@1.0.5: resolution: {integrity: sha512-9Hp0ObzwwO57DpLFF0InUjUm/II8GmKAvzbefxQTihCb7KI6yc9yzf0nLc4mVdby5N4DRCgQM2wCup9KTieeww==} dev: false @@ -9758,6 +9774,10 @@ packages: resolution: {integrity: sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==} dev: true + /@types/statuses@2.0.4: + resolution: {integrity: sha512-eqNDvZsCNY49OAXB0Firg/Sc2BgoWsntsLUdybGFOhAfCD6QJ2n9HXUIHGqt5qjrxmMv4wS8WLAw43ZkKcJ8Pw==} + dev: true + /@types/supports-color@8.1.3: resolution: {integrity: sha512-Hy6UMpxhE3j1tLpl27exp1XqHD7n8chAiNPzWfz16LPZoMMoSc4dzLl6w9qijkEb/r5O1ozdu1CWGA2L83ZeZg==} @@ -10194,11 +10214,6 @@ packages: react: 18.2.0 dev: true - /@xmldom/xmldom@0.8.10: - resolution: {integrity: sha512-2WALfTl4xo2SkGCYRt6rDTFfk9R1czmBvUQy12gK2KuRKIpWEhcbbzy8EZXtz/jkRqHX8bFEc6FC1HjX4TUWYw==} - engines: {node: '>=10.0.0'} - dev: true - /@xtuc/ieee754@1.2.0: resolution: {integrity: sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==} dev: true @@ -10245,12 +10260,6 @@ packages: rimraf: 3.0.2 dev: true - /@zxing/text-encoding@0.9.0: - resolution: {integrity: sha512-U/4aVJ2mxI0aDNI8Uq0wEhMgY+u4CNtEb0om3+y3+niDAsoTCOB33UF0sxpzqzdqXLqmvc+vZyAt4O8pPdfkwA==} - requiresBuild: true - dev: true - optional: true - /abbrev@1.1.1: resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} dev: false @@ -15157,8 +15166,8 @@ packages: upper-case: 1.1.3 dev: true - /headers-polyfill@3.2.5: - resolution: {integrity: sha512-tUCGvt191vNSQgttSyJoibR+VO+I6+iCHIUdhzEMJKE+EAL8BwCN7fUOZlY4ofOelNHsK+gEjxB/B+9N3EWtdA==} + /headers-polyfill@4.0.2: + resolution: {integrity: sha512-EWGTfnTqAO2L/j5HZgoM/3z82L7necsJ0pO9Tp0X1wil3PDLrkypTBRgVO2ExehEEvUycejZD3FuRaXpZZc3kw==} dev: true /hmac-drbg@1.0.1: @@ -18821,49 +18830,48 @@ packages: /ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - /msw-storybook-addon@1.10.0(msw@1.3.2): - resolution: {integrity: sha512-soCTMTf7DnLeaMnFHPrtVgbyeFTJALVvnDHpzzXpJad+HOzJgQdwU4EAzVfDs1q+X5cVEgxOdAhSMC7ljvnSXg==} + /msw-storybook-addon@2.0.0--canary.122.06f0c92.0(msw@2.0.11): + resolution: {integrity: sha512-Bm0kud8QoB5dVm3Zn9eWY+j9VTY5KEuNtFoGhCpliSjC6b+V196WzVeUOz5GQXixkx6cDFxawsow4rFDPKXTtQ==} peerDependencies: - msw: 1.2.1 || 1 + msw: ^2.0.9 || 1 dependencies: is-node-process: 1.2.0 - msw: 1.3.2(typescript@5.3.3) + msw: 2.0.11(typescript@5.3.3) dev: true - /msw@1.3.2(typescript@5.3.3): - resolution: {integrity: sha512-wKLhFPR+NitYTkQl5047pia0reNGgf0P6a1eTnA5aNlripmiz0sabMvvHcicE8kQ3/gZcI0YiPFWmYfowfm3lA==} - engines: {node: '>=14'} + /msw@2.0.11(typescript@5.3.3): + resolution: {integrity: sha512-dAXFS2DxZX0uFqMPhS3oUAu8S/5IQ5qKKSwtXl3/dMTeML0C8JfSvbeWtowYg6pu4Iehgp5L/pHLrlIcG++y/A==} + engines: {node: '>=18'} hasBin: true requiresBuild: true peerDependencies: - typescript: '>= 4.4.x <= 5.2.x || 5' + typescript: '>= 4.7.x <= 5.2.x || 5' peerDependenciesMeta: typescript: optional: true dependencies: - '@mswjs/cookies': 0.2.2 - '@mswjs/interceptors': 0.17.10 - '@open-draft/until': 1.0.3 + '@bundled-es-modules/cookie': 2.0.0 + '@bundled-es-modules/js-levenshtein': 2.0.1 + '@bundled-es-modules/statuses': 1.0.1 + '@mswjs/cookies': 1.1.0 + '@mswjs/interceptors': 0.25.13 + '@open-draft/until': 2.1.0 '@types/cookie': 0.4.1 '@types/js-levenshtein': 1.1.3 + '@types/statuses': 2.0.4 chalk: 4.1.2 chokidar: 3.5.3 - cookie: 0.4.2 graphql: 16.8.1 - headers-polyfill: 3.2.5 + headers-polyfill: 4.0.2 inquirer: 8.2.6 is-node-process: 1.2.0 js-levenshtein: 1.1.6 - node-fetch: 2.7.0 outvariant: 1.4.0 path-to-regexp: 6.2.1 - strict-event-emitter: 0.4.6 + strict-event-emitter: 0.5.1 type-fest: 2.19.0 typescript: 5.3.3 yargs: 17.7.2 - transitivePeerDependencies: - - encoding - - supports-color dev: true /multipipe@1.0.2: @@ -22166,10 +22174,6 @@ packages: /set-blocking@2.0.0: resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} - /set-cookie-parser@2.6.0: - resolution: {integrity: sha512-RVnVQxTXuerk653XfuliOxBP81Sf0+qfQE73LIYKcyMYHG94AuH0kgrQpRDuTZnSmjpysHmzxJXKNfa6PjFhyQ==} - dev: true - /set-function-length@1.1.1: resolution: {integrity: sha512-VoaqjbBJKiWtg4yRcKBQ7g7wnGnLV3M8oLvVWwOk2PdYY6PEFegR1vezXR0tw6fZGF9csVakIRjrJiy2veSBFQ==} engines: {node: '>= 0.4'} @@ -22831,14 +22835,8 @@ packages: queue-tick: 1.0.1 dev: true - /strict-event-emitter@0.2.8: - resolution: {integrity: sha512-KDf/ujU8Zud3YaLtMCcTI4xkZlZVIYxTLr+XIULexP+77EEVWixeXroLUXQXiVtH4XH2W7jr/3PT1v3zBuvc3A==} - dependencies: - events: 3.3.0 - dev: true - - /strict-event-emitter@0.4.6: - resolution: {integrity: sha512-12KWeb+wixJohmnwNFerbyiBrAlq5qJLwIt38etRtKtmmHyDSoGlIqFE9wx+4IwG0aDjI7GV8tc8ZccjWZZtTg==} + /strict-event-emitter@0.5.1: + resolution: {integrity: sha512-vMgjE/GGEPEFnhFub6pa4FmJBRBVOLpIII2hvCZ8Kzb7K0hlHo7mQv6xYrBvCL2LtAIBwFUK8wvuJgTVSQ5MFQ==} dev: true /strict-uri-encode@2.0.0: @@ -24609,14 +24607,6 @@ packages: defaults: 1.0.4 dev: true - /web-encoding@1.1.5: - resolution: {integrity: sha512-HYLeVCdJ0+lBYV2FvNZmv3HJ2Nt0QYXqZojk3d9FJOLkwnuhzM9tmamh8d7HPM8QqjKH8DeHkFTx+CFlWpZZDA==} - dependencies: - util: 0.12.5 - optionalDependencies: - '@zxing/text-encoding': 0.9.0 - dev: true - /web-namespaces@2.0.1: resolution: {integrity: sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ==}