diff --git a/client/msw-handlers.ts b/client/msw-handlers.ts index a7d4b10..f380fa0 100644 --- a/client/msw-handlers.ts +++ b/client/msw-handlers.ts @@ -9,42 +9,24 @@ */ import { - compose, - context, - ResponseComposition, - ResponseTransformer, - rest, - RestContext, - RestHandler, - RestRequest, + http, + HttpHandler, + HttpResponse, + StrictResponse, + PathParams, } from "msw"; -import type { SnakeCasedPropertiesDeep as Snakify } from "type-fest"; +import type { + SnakeCasedPropertiesDeep as Snakify, + Promisable, +} from "type-fest"; import { z, ZodSchema } from "zod"; import type * as Api from "./Api"; import { snakeify } from "./util"; import * as schema from "./validate"; -type HandlerResult = Json | ResponseTransformer>; +type HandlerResult = Json | StrictResponse>; type StatusCode = number; -/** - * Custom transformer: convenience function for setting response `status` and/or - * `delay`. - * - * @see https://mswjs.io/docs/basics/response-transformer#custom-transformer - */ -export function json( - body: B, - options: { status?: number; delay?: number } = {} -): ResponseTransformer { - const { status = 200, delay = 0 } = options; - return compose( - context.status(status), - context.json(body), - context.delay(delay) - ); -} - // these are used for turning our nice JS-ified API types back into the original // API JSON types (snake cased and dates as strings) for use in our mock API @@ -61,827 +43,986 @@ type StringifyDates = T extends Date * purpose JSON type! */ export type Json = Snakify>; +export const json = HttpResponse.json; + +// Shortcut to reduce number of imports required in consumers +export { HttpResponse }; export interface MSWHandlers { /** `POST /device/auth` */ - deviceAuthRequest: (params: { req: RestRequest }) => StatusCode; + deviceAuthRequest: (params: { + req: Request; + cookies: Record; + }) => Promisable; /** `POST /device/confirm` */ deviceAuthConfirm: (params: { body: Json; - req: RestRequest; - }) => StatusCode; + req: Request; + cookies: Record; + }) => Promisable; /** `POST /device/token` */ - deviceAccessToken: (params: { req: RestRequest }) => StatusCode; + deviceAccessToken: (params: { + req: Request; + cookies: Record; + }) => Promisable; /** `POST /login/:siloName/saml/:providerName` */ loginSaml: (params: { path: Api.LoginSamlPathParams; - req: RestRequest; - }) => StatusCode; + req: Request; + cookies: Record; + }) => Promisable; /** `GET /v1/certificates` */ certificateList: (params: { query: Api.CertificateListQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `POST /v1/certificates` */ certificateCreate: (params: { body: Json; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `GET /v1/certificates/:certificate` */ certificateView: (params: { path: Api.CertificateViewPathParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `DELETE /v1/certificates/:certificate` */ certificateDelete: (params: { path: Api.CertificateDeletePathParams; - req: RestRequest; - }) => StatusCode; + req: Request; + cookies: Record; + }) => Promisable; /** `GET /v1/disks` */ diskList: (params: { query: Api.DiskListQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `POST /v1/disks` */ diskCreate: (params: { query: Api.DiskCreateQueryParams; body: Json; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `GET /v1/disks/:disk` */ diskView: (params: { path: Api.DiskViewPathParams; query: Api.DiskViewQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `DELETE /v1/disks/:disk` */ diskDelete: (params: { path: Api.DiskDeletePathParams; query: Api.DiskDeleteQueryParams; - req: RestRequest; - }) => StatusCode; + req: Request; + cookies: Record; + }) => Promisable; /** `POST /v1/disks/:disk/bulk-write` */ diskBulkWriteImport: (params: { path: Api.DiskBulkWriteImportPathParams; query: Api.DiskBulkWriteImportQueryParams; body: Json; - req: RestRequest; - }) => StatusCode; + req: Request; + cookies: Record; + }) => Promisable; /** `POST /v1/disks/:disk/bulk-write-start` */ diskBulkWriteImportStart: (params: { path: Api.DiskBulkWriteImportStartPathParams; query: Api.DiskBulkWriteImportStartQueryParams; - req: RestRequest; - }) => StatusCode; + req: Request; + cookies: Record; + }) => Promisable; /** `POST /v1/disks/:disk/bulk-write-stop` */ diskBulkWriteImportStop: (params: { path: Api.DiskBulkWriteImportStopPathParams; query: Api.DiskBulkWriteImportStopQueryParams; - req: RestRequest; - }) => StatusCode; + req: Request; + cookies: Record; + }) => Promisable; /** `POST /v1/disks/:disk/finalize` */ diskFinalizeImport: (params: { path: Api.DiskFinalizeImportPathParams; query: Api.DiskFinalizeImportQueryParams; body: Json; - req: RestRequest; - }) => StatusCode; + req: Request; + cookies: Record; + }) => Promisable; /** `POST /v1/disks/:disk/import` */ diskImportBlocksFromUrl: (params: { path: Api.DiskImportBlocksFromUrlPathParams; query: Api.DiskImportBlocksFromUrlQueryParams; body: Json; - req: RestRequest; - }) => StatusCode; + req: Request; + cookies: Record; + }) => Promisable; /** `GET /v1/disks/:disk/metrics/:metric` */ diskMetricsList: (params: { path: Api.DiskMetricsListPathParams; query: Api.DiskMetricsListQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `GET /v1/groups` */ groupList: (params: { query: Api.GroupListQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `GET /v1/groups/:groupId` */ groupView: (params: { path: Api.GroupViewPathParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `GET /v1/images` */ imageList: (params: { query: Api.ImageListQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `POST /v1/images` */ imageCreate: (params: { query: Api.ImageCreateQueryParams; body: Json; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `GET /v1/images/:image` */ imageView: (params: { path: Api.ImageViewPathParams; query: Api.ImageViewQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `DELETE /v1/images/:image` */ imageDelete: (params: { path: Api.ImageDeletePathParams; query: Api.ImageDeleteQueryParams; - req: RestRequest; - }) => StatusCode; + req: Request; + cookies: Record; + }) => Promisable; /** `POST /v1/images/:image/demote` */ imageDemote: (params: { path: Api.ImageDemotePathParams; query: Api.ImageDemoteQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `POST /v1/images/:image/promote` */ imagePromote: (params: { path: Api.ImagePromotePathParams; query: Api.ImagePromoteQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `GET /v1/instances` */ instanceList: (params: { query: Api.InstanceListQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `POST /v1/instances` */ instanceCreate: (params: { query: Api.InstanceCreateQueryParams; body: Json; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `GET /v1/instances/:instance` */ instanceView: (params: { path: Api.InstanceViewPathParams; query: Api.InstanceViewQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `DELETE /v1/instances/:instance` */ instanceDelete: (params: { path: Api.InstanceDeletePathParams; query: Api.InstanceDeleteQueryParams; - req: RestRequest; - }) => StatusCode; + req: Request; + cookies: Record; + }) => Promisable; /** `GET /v1/instances/:instance/disks` */ instanceDiskList: (params: { path: Api.InstanceDiskListPathParams; query: Api.InstanceDiskListQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `POST /v1/instances/:instance/disks/attach` */ instanceDiskAttach: (params: { path: Api.InstanceDiskAttachPathParams; query: Api.InstanceDiskAttachQueryParams; body: Json; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `POST /v1/instances/:instance/disks/detach` */ instanceDiskDetach: (params: { path: Api.InstanceDiskDetachPathParams; query: Api.InstanceDiskDetachQueryParams; body: Json; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `GET /v1/instances/:instance/external-ips` */ instanceExternalIpList: (params: { path: Api.InstanceExternalIpListPathParams; query: Api.InstanceExternalIpListQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `POST /v1/instances/:instance/migrate` */ instanceMigrate: (params: { path: Api.InstanceMigratePathParams; query: Api.InstanceMigrateQueryParams; body: Json; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `POST /v1/instances/:instance/reboot` */ instanceReboot: (params: { path: Api.InstanceRebootPathParams; query: Api.InstanceRebootQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `GET /v1/instances/:instance/serial-console` */ instanceSerialConsole: (params: { path: Api.InstanceSerialConsolePathParams; query: Api.InstanceSerialConsoleQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `GET /v1/instances/:instance/serial-console/stream` */ instanceSerialConsoleStream: (params: { path: Api.InstanceSerialConsoleStreamPathParams; query: Api.InstanceSerialConsoleStreamQueryParams; - req: RestRequest; - }) => StatusCode; + req: Request; + cookies: Record; + }) => Promisable; /** `POST /v1/instances/:instance/start` */ instanceStart: (params: { path: Api.InstanceStartPathParams; query: Api.InstanceStartQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `POST /v1/instances/:instance/stop` */ instanceStop: (params: { path: Api.InstanceStopPathParams; query: Api.InstanceStopQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `GET /v1/ip-pools` */ projectIpPoolList: (params: { query: Api.ProjectIpPoolListQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `GET /v1/ip-pools/:pool` */ projectIpPoolView: (params: { path: Api.ProjectIpPoolViewPathParams; query: Api.ProjectIpPoolViewQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `POST /v1/login/:siloName/local` */ loginLocal: (params: { path: Api.LoginLocalPathParams; body: Json; - req: RestRequest; - }) => StatusCode; + req: Request; + cookies: Record; + }) => Promisable; /** `POST /v1/logout` */ - logout: (params: { req: RestRequest }) => StatusCode; + logout: (params: { + req: Request; + cookies: Record; + }) => Promisable; /** `GET /v1/me` */ currentUserView: (params: { - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `GET /v1/me/groups` */ currentUserGroups: (params: { query: Api.CurrentUserGroupsQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `GET /v1/me/ssh-keys` */ currentUserSshKeyList: (params: { query: Api.CurrentUserSshKeyListQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `POST /v1/me/ssh-keys` */ currentUserSshKeyCreate: (params: { body: Json; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `GET /v1/me/ssh-keys/:sshKey` */ currentUserSshKeyView: (params: { path: Api.CurrentUserSshKeyViewPathParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `DELETE /v1/me/ssh-keys/:sshKey` */ currentUserSshKeyDelete: (params: { path: Api.CurrentUserSshKeyDeletePathParams; - req: RestRequest; - }) => StatusCode; + req: Request; + cookies: Record; + }) => Promisable; /** `GET /v1/metrics/:metricName` */ siloMetric: (params: { path: Api.SiloMetricPathParams; query: Api.SiloMetricQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `GET /v1/network-interfaces` */ instanceNetworkInterfaceList: (params: { query: Api.InstanceNetworkInterfaceListQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `POST /v1/network-interfaces` */ instanceNetworkInterfaceCreate: (params: { query: Api.InstanceNetworkInterfaceCreateQueryParams; body: Json; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `GET /v1/network-interfaces/:interface` */ instanceNetworkInterfaceView: (params: { path: Api.InstanceNetworkInterfaceViewPathParams; query: Api.InstanceNetworkInterfaceViewQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `PUT /v1/network-interfaces/:interface` */ instanceNetworkInterfaceUpdate: (params: { path: Api.InstanceNetworkInterfaceUpdatePathParams; query: Api.InstanceNetworkInterfaceUpdateQueryParams; body: Json; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `DELETE /v1/network-interfaces/:interface` */ instanceNetworkInterfaceDelete: (params: { path: Api.InstanceNetworkInterfaceDeletePathParams; query: Api.InstanceNetworkInterfaceDeleteQueryParams; - req: RestRequest; - }) => StatusCode; + req: Request; + cookies: Record; + }) => Promisable; /** `GET /v1/policy` */ policyView: (params: { - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `PUT /v1/policy` */ policyUpdate: (params: { body: Json; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `GET /v1/projects` */ projectList: (params: { query: Api.ProjectListQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `POST /v1/projects` */ projectCreate: (params: { body: Json; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `GET /v1/projects/:project` */ projectView: (params: { path: Api.ProjectViewPathParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `PUT /v1/projects/:project` */ projectUpdate: (params: { path: Api.ProjectUpdatePathParams; body: Json; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `DELETE /v1/projects/:project` */ projectDelete: (params: { path: Api.ProjectDeletePathParams; - req: RestRequest; - }) => StatusCode; + req: Request; + cookies: Record; + }) => Promisable; /** `GET /v1/projects/:project/policy` */ projectPolicyView: (params: { path: Api.ProjectPolicyViewPathParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `PUT /v1/projects/:project/policy` */ projectPolicyUpdate: (params: { path: Api.ProjectPolicyUpdatePathParams; body: Json; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `GET /v1/snapshots` */ snapshotList: (params: { query: Api.SnapshotListQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `POST /v1/snapshots` */ snapshotCreate: (params: { query: Api.SnapshotCreateQueryParams; body: Json; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `GET /v1/snapshots/:snapshot` */ snapshotView: (params: { path: Api.SnapshotViewPathParams; query: Api.SnapshotViewQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `DELETE /v1/snapshots/:snapshot` */ snapshotDelete: (params: { path: Api.SnapshotDeletePathParams; query: Api.SnapshotDeleteQueryParams; - req: RestRequest; - }) => StatusCode; + req: Request; + cookies: Record; + }) => Promisable; /** `GET /v1/system/hardware/disks` */ physicalDiskList: (params: { query: Api.PhysicalDiskListQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `GET /v1/system/hardware/racks` */ rackList: (params: { query: Api.RackListQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `GET /v1/system/hardware/racks/:rackId` */ rackView: (params: { path: Api.RackViewPathParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `GET /v1/system/hardware/sleds` */ sledList: (params: { query: Api.SledListQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `GET /v1/system/hardware/sleds/:sledId` */ sledView: (params: { path: Api.SledViewPathParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `GET /v1/system/hardware/sleds/:sledId/disks` */ sledPhysicalDiskList: (params: { path: Api.SledPhysicalDiskListPathParams; query: Api.SledPhysicalDiskListQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `GET /v1/system/hardware/sleds/:sledId/instances` */ sledInstanceList: (params: { path: Api.SledInstanceListPathParams; query: Api.SledInstanceListQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `GET /v1/system/hardware/switch-port` */ networkingSwitchPortList: (params: { query: Api.NetworkingSwitchPortListQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `POST /v1/system/hardware/switch-port/:port/settings` */ networkingSwitchPortApplySettings: (params: { path: Api.NetworkingSwitchPortApplySettingsPathParams; query: Api.NetworkingSwitchPortApplySettingsQueryParams; body: Json; - req: RestRequest; - }) => StatusCode; + req: Request; + cookies: Record; + }) => Promisable; /** `DELETE /v1/system/hardware/switch-port/:port/settings` */ networkingSwitchPortClearSettings: (params: { path: Api.NetworkingSwitchPortClearSettingsPathParams; query: Api.NetworkingSwitchPortClearSettingsQueryParams; - req: RestRequest; - }) => StatusCode; + req: Request; + cookies: Record; + }) => Promisable; /** `GET /v1/system/hardware/switches` */ switchList: (params: { query: Api.SwitchListQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `GET /v1/system/hardware/switches/:switchId` */ switchView: (params: { path: Api.SwitchViewPathParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `GET /v1/system/identity-providers` */ siloIdentityProviderList: (params: { query: Api.SiloIdentityProviderListQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `POST /v1/system/identity-providers/local/users` */ localIdpUserCreate: (params: { query: Api.LocalIdpUserCreateQueryParams; body: Json; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `DELETE /v1/system/identity-providers/local/users/:userId` */ localIdpUserDelete: (params: { path: Api.LocalIdpUserDeletePathParams; query: Api.LocalIdpUserDeleteQueryParams; - req: RestRequest; - }) => StatusCode; + req: Request; + cookies: Record; + }) => Promisable; /** `POST /v1/system/identity-providers/local/users/:userId/set-password` */ localIdpUserSetPassword: (params: { path: Api.LocalIdpUserSetPasswordPathParams; query: Api.LocalIdpUserSetPasswordQueryParams; body: Json; - req: RestRequest; - }) => StatusCode; + req: Request; + cookies: Record; + }) => Promisable; /** `POST /v1/system/identity-providers/saml` */ samlIdentityProviderCreate: (params: { query: Api.SamlIdentityProviderCreateQueryParams; body: Json; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `GET /v1/system/identity-providers/saml/:provider` */ samlIdentityProviderView: (params: { path: Api.SamlIdentityProviderViewPathParams; query: Api.SamlIdentityProviderViewQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `GET /v1/system/ip-pools` */ ipPoolList: (params: { query: Api.IpPoolListQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `POST /v1/system/ip-pools` */ ipPoolCreate: (params: { body: Json; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `GET /v1/system/ip-pools/:pool` */ ipPoolView: (params: { path: Api.IpPoolViewPathParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `PUT /v1/system/ip-pools/:pool` */ ipPoolUpdate: (params: { path: Api.IpPoolUpdatePathParams; body: Json; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `DELETE /v1/system/ip-pools/:pool` */ ipPoolDelete: (params: { path: Api.IpPoolDeletePathParams; - req: RestRequest; - }) => StatusCode; + req: Request; + cookies: Record; + }) => Promisable; /** `GET /v1/system/ip-pools/:pool/ranges` */ ipPoolRangeList: (params: { path: Api.IpPoolRangeListPathParams; query: Api.IpPoolRangeListQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `POST /v1/system/ip-pools/:pool/ranges/add` */ ipPoolRangeAdd: (params: { path: Api.IpPoolRangeAddPathParams; body: Json; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `POST /v1/system/ip-pools/:pool/ranges/remove` */ ipPoolRangeRemove: (params: { path: Api.IpPoolRangeRemovePathParams; body: Json; - req: RestRequest; - }) => StatusCode; + req: Request; + cookies: Record; + }) => Promisable; /** `GET /v1/system/ip-pools-service` */ ipPoolServiceView: (params: { - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `GET /v1/system/ip-pools-service/ranges` */ ipPoolServiceRangeList: (params: { query: Api.IpPoolServiceRangeListQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `POST /v1/system/ip-pools-service/ranges/add` */ ipPoolServiceRangeAdd: (params: { body: Json; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `POST /v1/system/ip-pools-service/ranges/remove` */ ipPoolServiceRangeRemove: (params: { body: Json; - req: RestRequest; - }) => StatusCode; + req: Request; + cookies: Record; + }) => Promisable; /** `GET /v1/system/metrics/:metricName` */ systemMetric: (params: { path: Api.SystemMetricPathParams; query: Api.SystemMetricQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `GET /v1/system/networking/address-lot` */ networkingAddressLotList: (params: { query: Api.NetworkingAddressLotListQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `POST /v1/system/networking/address-lot` */ networkingAddressLotCreate: (params: { body: Json; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `DELETE /v1/system/networking/address-lot/:addressLot` */ networkingAddressLotDelete: (params: { path: Api.NetworkingAddressLotDeletePathParams; - req: RestRequest; - }) => StatusCode; + req: Request; + cookies: Record; + }) => Promisable; /** `GET /v1/system/networking/address-lot/:addressLot/blocks` */ networkingAddressLotBlockList: (params: { path: Api.NetworkingAddressLotBlockListPathParams; query: Api.NetworkingAddressLotBlockListQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `GET /v1/system/networking/loopback-address` */ networkingLoopbackAddressList: (params: { query: Api.NetworkingLoopbackAddressListQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `POST /v1/system/networking/loopback-address` */ networkingLoopbackAddressCreate: (params: { body: Json; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `DELETE /v1/system/networking/loopback-address/:rackId/:switchLocation/:address/:subnetMask` */ networkingLoopbackAddressDelete: (params: { path: Api.NetworkingLoopbackAddressDeletePathParams; - req: RestRequest; - }) => StatusCode; + req: Request; + cookies: Record; + }) => Promisable; /** `GET /v1/system/networking/switch-port-settings` */ networkingSwitchPortSettingsList: (params: { query: Api.NetworkingSwitchPortSettingsListQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `POST /v1/system/networking/switch-port-settings` */ networkingSwitchPortSettingsCreate: (params: { body: Json; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `DELETE /v1/system/networking/switch-port-settings` */ networkingSwitchPortSettingsDelete: (params: { query: Api.NetworkingSwitchPortSettingsDeleteQueryParams; - req: RestRequest; - }) => StatusCode; + req: Request; + cookies: Record; + }) => Promisable; /** `GET /v1/system/networking/switch-port-settings/:port` */ networkingSwitchPortSettingsView: (params: { path: Api.NetworkingSwitchPortSettingsViewPathParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `GET /v1/system/policy` */ systemPolicyView: (params: { - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `PUT /v1/system/policy` */ systemPolicyUpdate: (params: { body: Json; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `GET /v1/system/roles` */ roleList: (params: { query: Api.RoleListQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `GET /v1/system/roles/:roleName` */ roleView: (params: { path: Api.RoleViewPathParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `GET /v1/system/silos` */ siloList: (params: { query: Api.SiloListQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `POST /v1/system/silos` */ siloCreate: (params: { body: Json; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `GET /v1/system/silos/:silo` */ siloView: (params: { path: Api.SiloViewPathParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `DELETE /v1/system/silos/:silo` */ siloDelete: (params: { path: Api.SiloDeletePathParams; - req: RestRequest; - }) => StatusCode; + req: Request; + cookies: Record; + }) => Promisable; /** `GET /v1/system/silos/:silo/policy` */ siloPolicyView: (params: { path: Api.SiloPolicyViewPathParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `PUT /v1/system/silos/:silo/policy` */ siloPolicyUpdate: (params: { path: Api.SiloPolicyUpdatePathParams; body: Json; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `GET /v1/system/users` */ siloUserList: (params: { query: Api.SiloUserListQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `GET /v1/system/users/:userId` */ siloUserView: (params: { path: Api.SiloUserViewPathParams; query: Api.SiloUserViewQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `GET /v1/system/users-builtin` */ userBuiltinList: (params: { query: Api.UserBuiltinListQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `GET /v1/system/users-builtin/:user` */ userBuiltinView: (params: { path: Api.UserBuiltinViewPathParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `GET /v1/users` */ userList: (params: { query: Api.UserListQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `GET /v1/vpc-firewall-rules` */ vpcFirewallRulesView: (params: { query: Api.VpcFirewallRulesViewQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `PUT /v1/vpc-firewall-rules` */ vpcFirewallRulesUpdate: (params: { query: Api.VpcFirewallRulesUpdateQueryParams; body: Json; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `GET /v1/vpc-router-routes` */ vpcRouterRouteList: (params: { query: Api.VpcRouterRouteListQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `POST /v1/vpc-router-routes` */ vpcRouterRouteCreate: (params: { query: Api.VpcRouterRouteCreateQueryParams; body: Json; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `GET /v1/vpc-router-routes/:route` */ vpcRouterRouteView: (params: { path: Api.VpcRouterRouteViewPathParams; query: Api.VpcRouterRouteViewQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `PUT /v1/vpc-router-routes/:route` */ vpcRouterRouteUpdate: (params: { path: Api.VpcRouterRouteUpdatePathParams; query: Api.VpcRouterRouteUpdateQueryParams; body: Json; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `DELETE /v1/vpc-router-routes/:route` */ vpcRouterRouteDelete: (params: { path: Api.VpcRouterRouteDeletePathParams; query: Api.VpcRouterRouteDeleteQueryParams; - req: RestRequest; - }) => StatusCode; + req: Request; + cookies: Record; + }) => Promisable; /** `GET /v1/vpc-routers` */ vpcRouterList: (params: { query: Api.VpcRouterListQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `POST /v1/vpc-routers` */ vpcRouterCreate: (params: { query: Api.VpcRouterCreateQueryParams; body: Json; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `GET /v1/vpc-routers/:router` */ vpcRouterView: (params: { path: Api.VpcRouterViewPathParams; query: Api.VpcRouterViewQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `PUT /v1/vpc-routers/:router` */ vpcRouterUpdate: (params: { path: Api.VpcRouterUpdatePathParams; query: Api.VpcRouterUpdateQueryParams; body: Json; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `DELETE /v1/vpc-routers/:router` */ vpcRouterDelete: (params: { path: Api.VpcRouterDeletePathParams; query: Api.VpcRouterDeleteQueryParams; - req: RestRequest; - }) => StatusCode; + req: Request; + cookies: Record; + }) => Promisable; /** `GET /v1/vpc-subnets` */ vpcSubnetList: (params: { query: Api.VpcSubnetListQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `POST /v1/vpc-subnets` */ vpcSubnetCreate: (params: { query: Api.VpcSubnetCreateQueryParams; body: Json; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `GET /v1/vpc-subnets/:subnet` */ vpcSubnetView: (params: { path: Api.VpcSubnetViewPathParams; query: Api.VpcSubnetViewQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `PUT /v1/vpc-subnets/:subnet` */ vpcSubnetUpdate: (params: { path: Api.VpcSubnetUpdatePathParams; query: Api.VpcSubnetUpdateQueryParams; body: Json; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `DELETE /v1/vpc-subnets/:subnet` */ vpcSubnetDelete: (params: { path: Api.VpcSubnetDeletePathParams; query: Api.VpcSubnetDeleteQueryParams; - req: RestRequest; - }) => StatusCode; + req: Request; + cookies: Record; + }) => Promisable; /** `GET /v1/vpc-subnets/:subnet/network-interfaces` */ vpcSubnetListNetworkInterfaces: (params: { path: Api.VpcSubnetListNetworkInterfacesPathParams; query: Api.VpcSubnetListNetworkInterfacesQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `GET /v1/vpcs` */ vpcList: (params: { query: Api.VpcListQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `POST /v1/vpcs` */ vpcCreate: (params: { query: Api.VpcCreateQueryParams; body: Json; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `GET /v1/vpcs/:vpc` */ vpcView: (params: { path: Api.VpcViewPathParams; query: Api.VpcViewQueryParams; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `PUT /v1/vpcs/:vpc` */ vpcUpdate: (params: { path: Api.VpcUpdatePathParams; query: Api.VpcUpdateQueryParams; body: Json; - req: RestRequest; - }) => HandlerResult; + req: Request; + cookies: Record; + }) => Promisable>; /** `DELETE /v1/vpcs/:vpc` */ vpcDelete: (params: { path: Api.VpcDeletePathParams; query: Api.VpcDeleteQueryParams; - req: RestRequest; - }) => StatusCode; + req: Request; + cookies: Record; + }) => Promisable; } function validateBody(schema: S, body: unknown) { @@ -891,8 +1032,12 @@ function validateBody(schema: S, body: unknown) { } return { bodyErr: json(result.error.issues, { status: 400 }) }; } -function validateParams(schema: S, req: RestRequest) { - const rawParams = new URLSearchParams(req.url.search); +function validateParams( + schema: S, + req: Request, + pathParams: PathParams +) { + const rawParams = new URLSearchParams(new URL(req.url).search); const params: [string, unknown][] = []; // Ensure numeric params like `limit` are parsed as numbers @@ -901,7 +1046,7 @@ function validateParams(schema: S, req: RestRequest) { } const result = schema.safeParse({ - path: req.params, + path: pathParams, query: Object.fromEntries(params), }); @@ -922,79 +1067,93 @@ const handler = paramSchema: ZodSchema | null, bodySchema: ZodSchema | null ) => - async (req: RestRequest, res: ResponseComposition, ctx: RestContext) => { + async ({ + request: req, + params: pathParams, + cookies, + }: { + request: Request; + params: PathParams; + cookies: Record; + }) => { const { params, paramsErr } = paramSchema - ? validateParams(paramSchema, req) + ? validateParams(paramSchema, req, pathParams) : { params: {}, paramsErr: undefined }; - if (paramsErr) return res(paramsErr); + if (paramsErr) return json(paramsErr, { status: 400 }); const { path, query } = params; const { body, bodyErr } = bodySchema ? validateBody(bodySchema, await req.json()) : { body: undefined, bodyErr: undefined }; - if (bodyErr) return res(bodyErr); + if (bodyErr) return json(bodyErr, { status: 400 }); try { // TypeScript can't narrow the handler down because there's not an explicit relationship between the schema // being present and the shape of the handler API. The type of this function could be resolved such that the // relevant schema is required if and only if the handler has a type that matches the inferred schema const result = await (handler as any).apply(null, [ - { path, query, body, req }, + { path, query, body, req, cookies }, ]); if (typeof result === "number") { - return res(ctx.status(result)); + return new HttpResponse(null, { status: result }); } if (typeof result === "function") { - return res(result as ResponseTransformer); + return result(); } - return res(json(result)); + if (result instanceof Response) { + return result; + } + return json(result); } catch (thrown) { if (typeof thrown === "number") { - return res(ctx.status(thrown)); + return new HttpResponse(null, { status: thrown }); } if (typeof thrown === "function") { - return res(thrown as ResponseTransformer); + return thrown(); } if (typeof thrown === "string") { - return res(json({ message: thrown }, { status: 400 })); + return json({ message: thrown }, { status: 400 }); + } + if (thrown instanceof Response) { + return thrown; } console.error("Unexpected mock error", thrown); - return res(json({ message: "Unknown Server Error" }, { status: 500 })); + return json({ message: "Unknown Server Error" }, { status: 500 }); } }; -export function makeHandlers(handlers: MSWHandlers): RestHandler[] { +export function makeHandlers(handlers: MSWHandlers): HttpHandler[] { return [ - rest.post( + http.post( "/device/auth", handler(handlers["deviceAuthRequest"], null, null) ), - rest.post( + http.post( "/device/confirm", handler(handlers["deviceAuthConfirm"], null, schema.DeviceAuthVerify) ), - rest.post( + http.post( "/device/token", handler(handlers["deviceAccessToken"], null, null) ), - rest.post( + http.post( "/login/:siloName/saml/:providerName", handler(handlers["loginSaml"], schema.LoginSamlParams, null) ), - rest.get( + http.get( "/v1/certificates", handler(handlers["certificateList"], schema.CertificateListParams, null) ), - rest.post( + http.post( "/v1/certificates", handler(handlers["certificateCreate"], null, schema.CertificateCreate) ), - rest.get( + http.get( "/v1/certificates/:certificate", handler(handlers["certificateView"], schema.CertificateViewParams, null) ), - rest.delete( + http.delete( "/v1/certificates/:certificate", handler( handlers["certificateDelete"], @@ -1002,11 +1161,11 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { null ) ), - rest.get( + http.get( "/v1/disks", handler(handlers["diskList"], schema.DiskListParams, null) ), - rest.post( + http.post( "/v1/disks", handler( handlers["diskCreate"], @@ -1014,15 +1173,15 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { schema.DiskCreate ) ), - rest.get( + http.get( "/v1/disks/:disk", handler(handlers["diskView"], schema.DiskViewParams, null) ), - rest.delete( + http.delete( "/v1/disks/:disk", handler(handlers["diskDelete"], schema.DiskDeleteParams, null) ), - rest.post( + http.post( "/v1/disks/:disk/bulk-write", handler( handlers["diskBulkWriteImport"], @@ -1030,7 +1189,7 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { schema.ImportBlocksBulkWrite ) ), - rest.post( + http.post( "/v1/disks/:disk/bulk-write-start", handler( handlers["diskBulkWriteImportStart"], @@ -1038,7 +1197,7 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { null ) ), - rest.post( + http.post( "/v1/disks/:disk/bulk-write-stop", handler( handlers["diskBulkWriteImportStop"], @@ -1046,7 +1205,7 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { null ) ), - rest.post( + http.post( "/v1/disks/:disk/finalize", handler( handlers["diskFinalizeImport"], @@ -1054,7 +1213,7 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { schema.FinalizeDisk ) ), - rest.post( + http.post( "/v1/disks/:disk/import", handler( handlers["diskImportBlocksFromUrl"], @@ -1062,23 +1221,23 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { schema.ImportBlocksFromUrl ) ), - rest.get( + http.get( "/v1/disks/:disk/metrics/:metric", handler(handlers["diskMetricsList"], schema.DiskMetricsListParams, null) ), - rest.get( + http.get( "/v1/groups", handler(handlers["groupList"], schema.GroupListParams, null) ), - rest.get( + http.get( "/v1/groups/:groupId", handler(handlers["groupView"], schema.GroupViewParams, null) ), - rest.get( + http.get( "/v1/images", handler(handlers["imageList"], schema.ImageListParams, null) ), - rest.post( + http.post( "/v1/images", handler( handlers["imageCreate"], @@ -1086,27 +1245,27 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { schema.ImageCreate ) ), - rest.get( + http.get( "/v1/images/:image", handler(handlers["imageView"], schema.ImageViewParams, null) ), - rest.delete( + http.delete( "/v1/images/:image", handler(handlers["imageDelete"], schema.ImageDeleteParams, null) ), - rest.post( + http.post( "/v1/images/:image/demote", handler(handlers["imageDemote"], schema.ImageDemoteParams, null) ), - rest.post( + http.post( "/v1/images/:image/promote", handler(handlers["imagePromote"], schema.ImagePromoteParams, null) ), - rest.get( + http.get( "/v1/instances", handler(handlers["instanceList"], schema.InstanceListParams, null) ), - rest.post( + http.post( "/v1/instances", handler( handlers["instanceCreate"], @@ -1114,19 +1273,19 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { schema.InstanceCreate ) ), - rest.get( + http.get( "/v1/instances/:instance", handler(handlers["instanceView"], schema.InstanceViewParams, null) ), - rest.delete( + http.delete( "/v1/instances/:instance", handler(handlers["instanceDelete"], schema.InstanceDeleteParams, null) ), - rest.get( + http.get( "/v1/instances/:instance/disks", handler(handlers["instanceDiskList"], schema.InstanceDiskListParams, null) ), - rest.post( + http.post( "/v1/instances/:instance/disks/attach", handler( handlers["instanceDiskAttach"], @@ -1134,7 +1293,7 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { schema.DiskPath ) ), - rest.post( + http.post( "/v1/instances/:instance/disks/detach", handler( handlers["instanceDiskDetach"], @@ -1142,7 +1301,7 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { schema.DiskPath ) ), - rest.get( + http.get( "/v1/instances/:instance/external-ips", handler( handlers["instanceExternalIpList"], @@ -1150,7 +1309,7 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { null ) ), - rest.post( + http.post( "/v1/instances/:instance/migrate", handler( handlers["instanceMigrate"], @@ -1158,11 +1317,11 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { schema.InstanceMigrate ) ), - rest.post( + http.post( "/v1/instances/:instance/reboot", handler(handlers["instanceReboot"], schema.InstanceRebootParams, null) ), - rest.get( + http.get( "/v1/instances/:instance/serial-console", handler( handlers["instanceSerialConsole"], @@ -1170,7 +1329,7 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { null ) ), - rest.get( + http.get( "/v1/instances/:instance/serial-console/stream", handler( handlers["instanceSerialConsoleStream"], @@ -1178,15 +1337,15 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { null ) ), - rest.post( + http.post( "/v1/instances/:instance/start", handler(handlers["instanceStart"], schema.InstanceStartParams, null) ), - rest.post( + http.post( "/v1/instances/:instance/stop", handler(handlers["instanceStop"], schema.InstanceStopParams, null) ), - rest.get( + http.get( "/v1/ip-pools", handler( handlers["projectIpPoolList"], @@ -1194,7 +1353,7 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { null ) ), - rest.get( + http.get( "/v1/ip-pools/:pool", handler( handlers["projectIpPoolView"], @@ -1202,7 +1361,7 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { null ) ), - rest.post( + http.post( "/v1/login/:siloName/local", handler( handlers["loginLocal"], @@ -1210,9 +1369,9 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { schema.UsernamePasswordCredentials ) ), - rest.post("/v1/logout", handler(handlers["logout"], null, null)), - rest.get("/v1/me", handler(handlers["currentUserView"], null, null)), - rest.get( + http.post("/v1/logout", handler(handlers["logout"], null, null)), + http.get("/v1/me", handler(handlers["currentUserView"], null, null)), + http.get( "/v1/me/groups", handler( handlers["currentUserGroups"], @@ -1220,7 +1379,7 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { null ) ), - rest.get( + http.get( "/v1/me/ssh-keys", handler( handlers["currentUserSshKeyList"], @@ -1228,11 +1387,11 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { null ) ), - rest.post( + http.post( "/v1/me/ssh-keys", handler(handlers["currentUserSshKeyCreate"], null, schema.SshKeyCreate) ), - rest.get( + http.get( "/v1/me/ssh-keys/:sshKey", handler( handlers["currentUserSshKeyView"], @@ -1240,7 +1399,7 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { null ) ), - rest.delete( + http.delete( "/v1/me/ssh-keys/:sshKey", handler( handlers["currentUserSshKeyDelete"], @@ -1248,11 +1407,11 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { null ) ), - rest.get( + http.get( "/v1/metrics/:metricName", handler(handlers["siloMetric"], schema.SiloMetricParams, null) ), - rest.get( + http.get( "/v1/network-interfaces", handler( handlers["instanceNetworkInterfaceList"], @@ -1260,7 +1419,7 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { null ) ), - rest.post( + http.post( "/v1/network-interfaces", handler( handlers["instanceNetworkInterfaceCreate"], @@ -1268,7 +1427,7 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { schema.InstanceNetworkInterfaceCreate ) ), - rest.get( + http.get( "/v1/network-interfaces/:interface", handler( handlers["instanceNetworkInterfaceView"], @@ -1276,7 +1435,7 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { null ) ), - rest.put( + http.put( "/v1/network-interfaces/:interface", handler( handlers["instanceNetworkInterfaceUpdate"], @@ -1284,7 +1443,7 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { schema.InstanceNetworkInterfaceUpdate ) ), - rest.delete( + http.delete( "/v1/network-interfaces/:interface", handler( handlers["instanceNetworkInterfaceDelete"], @@ -1292,24 +1451,24 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { null ) ), - rest.get("/v1/policy", handler(handlers["policyView"], null, null)), - rest.put( + http.get("/v1/policy", handler(handlers["policyView"], null, null)), + http.put( "/v1/policy", handler(handlers["policyUpdate"], null, schema.SiloRolePolicy) ), - rest.get( + http.get( "/v1/projects", handler(handlers["projectList"], schema.ProjectListParams, null) ), - rest.post( + http.post( "/v1/projects", handler(handlers["projectCreate"], null, schema.ProjectCreate) ), - rest.get( + http.get( "/v1/projects/:project", handler(handlers["projectView"], schema.ProjectViewParams, null) ), - rest.put( + http.put( "/v1/projects/:project", handler( handlers["projectUpdate"], @@ -1317,11 +1476,11 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { schema.ProjectUpdate ) ), - rest.delete( + http.delete( "/v1/projects/:project", handler(handlers["projectDelete"], schema.ProjectDeleteParams, null) ), - rest.get( + http.get( "/v1/projects/:project/policy", handler( handlers["projectPolicyView"], @@ -1329,7 +1488,7 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { null ) ), - rest.put( + http.put( "/v1/projects/:project/policy", handler( handlers["projectPolicyUpdate"], @@ -1337,11 +1496,11 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { schema.ProjectRolePolicy ) ), - rest.get( + http.get( "/v1/snapshots", handler(handlers["snapshotList"], schema.SnapshotListParams, null) ), - rest.post( + http.post( "/v1/snapshots", handler( handlers["snapshotCreate"], @@ -1349,35 +1508,35 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { schema.SnapshotCreate ) ), - rest.get( + http.get( "/v1/snapshots/:snapshot", handler(handlers["snapshotView"], schema.SnapshotViewParams, null) ), - rest.delete( + http.delete( "/v1/snapshots/:snapshot", handler(handlers["snapshotDelete"], schema.SnapshotDeleteParams, null) ), - rest.get( + http.get( "/v1/system/hardware/disks", handler(handlers["physicalDiskList"], schema.PhysicalDiskListParams, null) ), - rest.get( + http.get( "/v1/system/hardware/racks", handler(handlers["rackList"], schema.RackListParams, null) ), - rest.get( + http.get( "/v1/system/hardware/racks/:rackId", handler(handlers["rackView"], schema.RackViewParams, null) ), - rest.get( + http.get( "/v1/system/hardware/sleds", handler(handlers["sledList"], schema.SledListParams, null) ), - rest.get( + http.get( "/v1/system/hardware/sleds/:sledId", handler(handlers["sledView"], schema.SledViewParams, null) ), - rest.get( + http.get( "/v1/system/hardware/sleds/:sledId/disks", handler( handlers["sledPhysicalDiskList"], @@ -1385,11 +1544,11 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { null ) ), - rest.get( + http.get( "/v1/system/hardware/sleds/:sledId/instances", handler(handlers["sledInstanceList"], schema.SledInstanceListParams, null) ), - rest.get( + http.get( "/v1/system/hardware/switch-port", handler( handlers["networkingSwitchPortList"], @@ -1397,7 +1556,7 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { null ) ), - rest.post( + http.post( "/v1/system/hardware/switch-port/:port/settings", handler( handlers["networkingSwitchPortApplySettings"], @@ -1405,7 +1564,7 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { schema.SwitchPortApplySettings ) ), - rest.delete( + http.delete( "/v1/system/hardware/switch-port/:port/settings", handler( handlers["networkingSwitchPortClearSettings"], @@ -1413,15 +1572,15 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { null ) ), - rest.get( + http.get( "/v1/system/hardware/switches", handler(handlers["switchList"], schema.SwitchListParams, null) ), - rest.get( + http.get( "/v1/system/hardware/switches/:switchId", handler(handlers["switchView"], schema.SwitchViewParams, null) ), - rest.get( + http.get( "/v1/system/identity-providers", handler( handlers["siloIdentityProviderList"], @@ -1429,7 +1588,7 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { null ) ), - rest.post( + http.post( "/v1/system/identity-providers/local/users", handler( handlers["localIdpUserCreate"], @@ -1437,7 +1596,7 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { schema.UserCreate ) ), - rest.delete( + http.delete( "/v1/system/identity-providers/local/users/:userId", handler( handlers["localIdpUserDelete"], @@ -1445,7 +1604,7 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { null ) ), - rest.post( + http.post( "/v1/system/identity-providers/local/users/:userId/set-password", handler( handlers["localIdpUserSetPassword"], @@ -1453,7 +1612,7 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { schema.UserPassword ) ), - rest.post( + http.post( "/v1/system/identity-providers/saml", handler( handlers["samlIdentityProviderCreate"], @@ -1461,7 +1620,7 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { schema.SamlIdentityProviderCreate ) ), - rest.get( + http.get( "/v1/system/identity-providers/saml/:provider", handler( handlers["samlIdentityProviderView"], @@ -1469,19 +1628,19 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { null ) ), - rest.get( + http.get( "/v1/system/ip-pools", handler(handlers["ipPoolList"], schema.IpPoolListParams, null) ), - rest.post( + http.post( "/v1/system/ip-pools", handler(handlers["ipPoolCreate"], null, schema.IpPoolCreate) ), - rest.get( + http.get( "/v1/system/ip-pools/:pool", handler(handlers["ipPoolView"], schema.IpPoolViewParams, null) ), - rest.put( + http.put( "/v1/system/ip-pools/:pool", handler( handlers["ipPoolUpdate"], @@ -1489,15 +1648,15 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { schema.IpPoolUpdate ) ), - rest.delete( + http.delete( "/v1/system/ip-pools/:pool", handler(handlers["ipPoolDelete"], schema.IpPoolDeleteParams, null) ), - rest.get( + http.get( "/v1/system/ip-pools/:pool/ranges", handler(handlers["ipPoolRangeList"], schema.IpPoolRangeListParams, null) ), - rest.post( + http.post( "/v1/system/ip-pools/:pool/ranges/add", handler( handlers["ipPoolRangeAdd"], @@ -1505,7 +1664,7 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { schema.IpRange ) ), - rest.post( + http.post( "/v1/system/ip-pools/:pool/ranges/remove", handler( handlers["ipPoolRangeRemove"], @@ -1513,11 +1672,11 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { schema.IpRange ) ), - rest.get( + http.get( "/v1/system/ip-pools-service", handler(handlers["ipPoolServiceView"], null, null) ), - rest.get( + http.get( "/v1/system/ip-pools-service/ranges", handler( handlers["ipPoolServiceRangeList"], @@ -1525,19 +1684,19 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { null ) ), - rest.post( + http.post( "/v1/system/ip-pools-service/ranges/add", handler(handlers["ipPoolServiceRangeAdd"], null, schema.IpRange) ), - rest.post( + http.post( "/v1/system/ip-pools-service/ranges/remove", handler(handlers["ipPoolServiceRangeRemove"], null, schema.IpRange) ), - rest.get( + http.get( "/v1/system/metrics/:metricName", handler(handlers["systemMetric"], schema.SystemMetricParams, null) ), - rest.get( + http.get( "/v1/system/networking/address-lot", handler( handlers["networkingAddressLotList"], @@ -1545,7 +1704,7 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { null ) ), - rest.post( + http.post( "/v1/system/networking/address-lot", handler( handlers["networkingAddressLotCreate"], @@ -1553,7 +1712,7 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { schema.AddressLotCreate ) ), - rest.delete( + http.delete( "/v1/system/networking/address-lot/:addressLot", handler( handlers["networkingAddressLotDelete"], @@ -1561,7 +1720,7 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { null ) ), - rest.get( + http.get( "/v1/system/networking/address-lot/:addressLot/blocks", handler( handlers["networkingAddressLotBlockList"], @@ -1569,7 +1728,7 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { null ) ), - rest.get( + http.get( "/v1/system/networking/loopback-address", handler( handlers["networkingLoopbackAddressList"], @@ -1577,7 +1736,7 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { null ) ), - rest.post( + http.post( "/v1/system/networking/loopback-address", handler( handlers["networkingLoopbackAddressCreate"], @@ -1585,7 +1744,7 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { schema.LoopbackAddressCreate ) ), - rest.delete( + http.delete( "/v1/system/networking/loopback-address/:rackId/:switchLocation/:address/:subnetMask", handler( handlers["networkingLoopbackAddressDelete"], @@ -1593,7 +1752,7 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { null ) ), - rest.get( + http.get( "/v1/system/networking/switch-port-settings", handler( handlers["networkingSwitchPortSettingsList"], @@ -1601,7 +1760,7 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { null ) ), - rest.post( + http.post( "/v1/system/networking/switch-port-settings", handler( handlers["networkingSwitchPortSettingsCreate"], @@ -1609,7 +1768,7 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { schema.SwitchPortSettingsCreate ) ), - rest.delete( + http.delete( "/v1/system/networking/switch-port-settings", handler( handlers["networkingSwitchPortSettingsDelete"], @@ -1617,7 +1776,7 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { null ) ), - rest.get( + http.get( "/v1/system/networking/switch-port-settings/:port", handler( handlers["networkingSwitchPortSettingsView"], @@ -1625,43 +1784,43 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { null ) ), - rest.get( + http.get( "/v1/system/policy", handler(handlers["systemPolicyView"], null, null) ), - rest.put( + http.put( "/v1/system/policy", handler(handlers["systemPolicyUpdate"], null, schema.FleetRolePolicy) ), - rest.get( + http.get( "/v1/system/roles", handler(handlers["roleList"], schema.RoleListParams, null) ), - rest.get( + http.get( "/v1/system/roles/:roleName", handler(handlers["roleView"], schema.RoleViewParams, null) ), - rest.get( + http.get( "/v1/system/silos", handler(handlers["siloList"], schema.SiloListParams, null) ), - rest.post( + http.post( "/v1/system/silos", handler(handlers["siloCreate"], null, schema.SiloCreate) ), - rest.get( + http.get( "/v1/system/silos/:silo", handler(handlers["siloView"], schema.SiloViewParams, null) ), - rest.delete( + http.delete( "/v1/system/silos/:silo", handler(handlers["siloDelete"], schema.SiloDeleteParams, null) ), - rest.get( + http.get( "/v1/system/silos/:silo/policy", handler(handlers["siloPolicyView"], schema.SiloPolicyViewParams, null) ), - rest.put( + http.put( "/v1/system/silos/:silo/policy", handler( handlers["siloPolicyUpdate"], @@ -1669,27 +1828,27 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { schema.SiloRolePolicy ) ), - rest.get( + http.get( "/v1/system/users", handler(handlers["siloUserList"], schema.SiloUserListParams, null) ), - rest.get( + http.get( "/v1/system/users/:userId", handler(handlers["siloUserView"], schema.SiloUserViewParams, null) ), - rest.get( + http.get( "/v1/system/users-builtin", handler(handlers["userBuiltinList"], schema.UserBuiltinListParams, null) ), - rest.get( + http.get( "/v1/system/users-builtin/:user", handler(handlers["userBuiltinView"], schema.UserBuiltinViewParams, null) ), - rest.get( + http.get( "/v1/users", handler(handlers["userList"], schema.UserListParams, null) ), - rest.get( + http.get( "/v1/vpc-firewall-rules", handler( handlers["vpcFirewallRulesView"], @@ -1697,7 +1856,7 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { null ) ), - rest.put( + http.put( "/v1/vpc-firewall-rules", handler( handlers["vpcFirewallRulesUpdate"], @@ -1705,7 +1864,7 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { schema.VpcFirewallRuleUpdateParams ) ), - rest.get( + http.get( "/v1/vpc-router-routes", handler( handlers["vpcRouterRouteList"], @@ -1713,7 +1872,7 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { null ) ), - rest.post( + http.post( "/v1/vpc-router-routes", handler( handlers["vpcRouterRouteCreate"], @@ -1721,7 +1880,7 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { schema.RouterRouteCreate ) ), - rest.get( + http.get( "/v1/vpc-router-routes/:route", handler( handlers["vpcRouterRouteView"], @@ -1729,7 +1888,7 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { null ) ), - rest.put( + http.put( "/v1/vpc-router-routes/:route", handler( handlers["vpcRouterRouteUpdate"], @@ -1737,7 +1896,7 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { schema.RouterRouteUpdate ) ), - rest.delete( + http.delete( "/v1/vpc-router-routes/:route", handler( handlers["vpcRouterRouteDelete"], @@ -1745,11 +1904,11 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { null ) ), - rest.get( + http.get( "/v1/vpc-routers", handler(handlers["vpcRouterList"], schema.VpcRouterListParams, null) ), - rest.post( + http.post( "/v1/vpc-routers", handler( handlers["vpcRouterCreate"], @@ -1757,11 +1916,11 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { schema.VpcRouterCreate ) ), - rest.get( + http.get( "/v1/vpc-routers/:router", handler(handlers["vpcRouterView"], schema.VpcRouterViewParams, null) ), - rest.put( + http.put( "/v1/vpc-routers/:router", handler( handlers["vpcRouterUpdate"], @@ -1769,15 +1928,15 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { schema.VpcRouterUpdate ) ), - rest.delete( + http.delete( "/v1/vpc-routers/:router", handler(handlers["vpcRouterDelete"], schema.VpcRouterDeleteParams, null) ), - rest.get( + http.get( "/v1/vpc-subnets", handler(handlers["vpcSubnetList"], schema.VpcSubnetListParams, null) ), - rest.post( + http.post( "/v1/vpc-subnets", handler( handlers["vpcSubnetCreate"], @@ -1785,11 +1944,11 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { schema.VpcSubnetCreate ) ), - rest.get( + http.get( "/v1/vpc-subnets/:subnet", handler(handlers["vpcSubnetView"], schema.VpcSubnetViewParams, null) ), - rest.put( + http.put( "/v1/vpc-subnets/:subnet", handler( handlers["vpcSubnetUpdate"], @@ -1797,11 +1956,11 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { schema.VpcSubnetUpdate ) ), - rest.delete( + http.delete( "/v1/vpc-subnets/:subnet", handler(handlers["vpcSubnetDelete"], schema.VpcSubnetDeleteParams, null) ), - rest.get( + http.get( "/v1/vpc-subnets/:subnet/network-interfaces", handler( handlers["vpcSubnetListNetworkInterfaces"], @@ -1809,23 +1968,23 @@ export function makeHandlers(handlers: MSWHandlers): RestHandler[] { null ) ), - rest.get( + http.get( "/v1/vpcs", handler(handlers["vpcList"], schema.VpcListParams, null) ), - rest.post( + http.post( "/v1/vpcs", handler(handlers["vpcCreate"], schema.VpcCreateParams, schema.VpcCreate) ), - rest.get( + http.get( "/v1/vpcs/:vpc", handler(handlers["vpcView"], schema.VpcViewParams, null) ), - rest.put( + http.put( "/v1/vpcs/:vpc", handler(handlers["vpcUpdate"], schema.VpcUpdateParams, schema.VpcUpdate) ), - rest.delete( + http.delete( "/v1/vpcs/:vpc", handler(handlers["vpcDelete"], schema.VpcDeleteParams, null) ), diff --git a/generator/client/msw-handlers.ts b/generator/client/msw-handlers.ts index 35ebde7..db1db45 100644 --- a/generator/client/msw-handlers.ts +++ b/generator/client/msw-handlers.ts @@ -7,7 +7,6 @@ */ import type { OpenAPIV3 } from "openapi-types"; -import { OpenAPIV3 as O } from "openapi-types"; import { initIO } from "../io"; import { refToSchemaName } from "../schema/base"; import { snakeToCamel, snakeToPascal } from "../util"; @@ -36,39 +35,21 @@ export function generateMSWHandlers(spec: OpenAPIV3.Document) { w(` import { - compose, - context, - ResponseComposition, - ResponseTransformer, - rest, - RestContext, - RestHandler, - RestRequest, + http, + HttpHandler, + HttpResponse, + StrictResponse, + PathParams, } from "msw"; - import type { SnakeCasedPropertiesDeep as Snakify } from "type-fest"; + import type { SnakeCasedPropertiesDeep as Snakify, Promisable } from "type-fest"; import { z, ZodSchema } from "zod"; import type * as Api from "./Api"; import { snakeify } from "./util"; import * as schema from "./validate"; - type HandlerResult = Json | ResponseTransformer> + type HandlerResult = Json | StrictResponse>; type StatusCode = number - /** - * Custom transformer: convenience function for setting response \`status\` and/or - * \`delay\`. - * - * @see https://mswjs.io/docs/basics/response-transformer#custom-transformer - */ - export function json( - body: B, - options: { status?: number; delay?: number } = {} - ): ResponseTransformer { - const { status = 200, delay = 0 } = options - return compose(context.status(status), context.json(body), context.delay(delay)) - } - - // these are used for turning our nice JS-ified API types back into the original // API JSON types (snake cased and dates as strings) for use in our mock API @@ -85,6 +66,11 @@ export function generateMSWHandlers(spec: OpenAPIV3.Document) { * purpose JSON type! */ export type Json = Snakify> + export const json = HttpResponse.json + + + // Shortcut to reduce number of imports required in consumers + export { HttpResponse } `); w(`export interface MSWHandlers {`); @@ -120,10 +106,12 @@ export function generateMSWHandlers(spec: OpenAPIV3.Document) { const queryParamsType = queryParams?.length ? `query: Api.${snakeToPascal(opId)}QueryParams,` : ""; - const params = `params: { ${pathParamsType} ${queryParamsType} ${body} req: RestRequest }`; + const params = `params: { ${pathParamsType} ${queryParamsType} ${body} req: Request, cookies: Record }`; const resultType = - successType === "void" ? "StatusCode" : `HandlerResult<${successType}>`; + successType === "void" + ? "Promisable" + : `Promisable>`; w(`/** \`${method.toUpperCase()} ${formatPath(path)}\` */`); w(` ${opName}: (${params}) => ${resultType},`); @@ -138,8 +126,8 @@ export function generateMSWHandlers(spec: OpenAPIV3.Document) { } return { bodyErr: json(result.error.issues, { status: 400 }) } } - function validateParams(schema: S, req: RestRequest) { - const rawParams = new URLSearchParams(req.url.search) + function validateParams(schema: S, req: Request, pathParams: PathParams) { + const rawParams = new URLSearchParams(new URL(req.url).search) const params: [string, unknown][] = [] // Ensure numeric params like \`limit\` are parsed as numbers @@ -148,7 +136,7 @@ export function generateMSWHandlers(spec: OpenAPIV3.Document) { } const result = schema.safeParse({ - path: req.params, + path: pathParams, query: Object.fromEntries(params), }) @@ -164,46 +152,64 @@ export function generateMSWHandlers(spec: OpenAPIV3.Document) { } const handler = (handler: MSWHandlers[keyof MSWHandlers], paramSchema: ZodSchema | null, bodySchema: ZodSchema | null) => - async (req: RestRequest, res: ResponseComposition, ctx: RestContext) => { - const { params, paramsErr } = paramSchema ? validateParams(paramSchema, req) : { params: {}, paramsErr: undefined } - if (paramsErr) return res(paramsErr) + async ({ + request: req, + params: pathParams, + cookies + }: { + request: Request; + params: PathParams; + cookies: Record; + }) => { + const { params, paramsErr } = paramSchema + ? validateParams(paramSchema, req, pathParams) + : { params: {}, paramsErr: undefined }; + if (paramsErr) return json(paramsErr, { status: 400 }); const { path, query } = params - const { body, bodyErr } = bodySchema ? validateBody(bodySchema, await req.json()) : { body: undefined, bodyErr: undefined } - if (bodyErr) return res(bodyErr) + const { body, bodyErr } = bodySchema + ? validateBody(bodySchema, await req.json()) + : { body: undefined, bodyErr: undefined }; + if (bodyErr) return json(bodyErr, { status: 400 }); try { // TypeScript can't narrow the handler down because there's not an explicit relationship between the schema // being present and the shape of the handler API. The type of this function could be resolved such that the // relevant schema is required if and only if the handler has a type that matches the inferred schema - const result = await (handler as any).apply(null, [{path, query, body, req}]) + const result = await (handler as any).apply(null, [{path, query, body, req, cookies}]) if (typeof result === "number") { - return res(ctx.status(result)) + return new HttpResponse(null, { status: result }); } if (typeof result === "function") { - return res(result as ResponseTransformer) + return result(); } - return res(json(result)) + if (result instanceof Response) { + return result; + } + return json(result); } catch (thrown) { if (typeof thrown === 'number') { - return res(ctx.status(thrown)) + return new HttpResponse(null, { status: thrown }); } if (typeof thrown === "function") { - return res(thrown as ResponseTransformer) + return thrown(); } if (typeof thrown === "string") { - return res(json({ message: thrown }, { status: 400 })) + return json({ message: thrown }, { status: 400 }); + } + if (thrown instanceof Response) { + return thrown; } console.error('Unexpected mock error', thrown) - return res(json({ message: 'Unknown Server Error' }, { status: 500 })) + return json({ message: "Unknown Server Error" }, { status: 500 }); } } export function makeHandlers( handlers: MSWHandlers, - ): RestHandler[] { + ): HttpHandler[] { return [`); for (const { path, method, opId, conf } of iterPathConfig(spec.paths)) { const handler = snakeToCamel(opId); @@ -217,7 +223,7 @@ export function generateMSWHandlers(spec: OpenAPIV3.Document) { : "null"; w( - `rest.${method}('${formatPath( + `http.${method}('${formatPath( path )}', handler(handlers['${handler}'], ${paramSchema}, ${bodySchema})),` ); diff --git a/package-lock.json b/package-lock.json index 1f02e21..25d35ad 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "devDependencies": { "@types/node": "^18.7.20", "esbuild-register": "^3.3.3", - "msw": "^1.2.1", + "msw": "^2.0.0", "openapi-types": "^12.0.2", "prettier": "2.7.1", "swagger-parser": "^10.0.3", @@ -70,6 +70,33 @@ "openapi-types": ">=7" } }, + "node_modules/@bundled-es-modules/cookie": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@bundled-es-modules/cookie/-/cookie-2.0.0.tgz", + "integrity": "sha512-Or6YHg/kamKHpxULAdSqhGqnWFneIXu1NKvvfBBzKGwpVsYuFIQ5aBPHDnnoR3ghW1nvSkALd+EF9iMtY7Vjxw==", + "dev": true, + "dependencies": { + "cookie": "^0.5.0" + } + }, + "node_modules/@bundled-es-modules/js-levenshtein": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@bundled-es-modules/js-levenshtein/-/js-levenshtein-2.0.1.tgz", + "integrity": "sha512-DERMS3yfbAljKsQc0U2wcqGKUWpdFjwqWuoMugEJlqBnKO180/n+4SR/J8MRDt1AN48X1ovgoD9KrdVXcaa3Rg==", + "dev": true, + "dependencies": { + "js-levenshtein": "^1.1.6" + } + }, + "node_modules/@bundled-es-modules/statuses": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@bundled-es-modules/statuses/-/statuses-1.0.1.tgz", + "integrity": "sha512-yn7BklA5acgcBr+7w064fGV+SGIFySjCKpqjcWgBAIfrAkY+4GQTJJHQMeT3V/sgz23VTEVV8TtOmkvJAhFVfg==", + "dev": true, + "dependencies": { + "statuses": "^2.0.1" + } + }, "node_modules/@esbuild/android-arm": { "version": "0.17.18", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.17.18.tgz", @@ -434,35 +461,29 @@ "license": "MIT" }, "node_modules/@mswjs/cookies": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/@mswjs/cookies/-/cookies-0.2.2.tgz", - "integrity": "sha512-mlN83YSrcFgk7Dm1Mys40DLssI1KdJji2CMKN8eOlBqsTADYzj2+jWzsANsUTFbxDMWPD5e9bfA1RGqBpS3O1g==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@mswjs/cookies/-/cookies-1.0.0.tgz", + "integrity": "sha512-TdXoBdI+h/EDTsVLCX/34s4+9U0sWi92qFnIGUEikpMCSKLhBeujovyYVSoORNbYgsBH5ga7/tfxyWcEZAxiYA==", "dev": true, - "dependencies": { - "@types/set-cookie-parser": "^2.4.0", - "set-cookie-parser": "^2.4.6" - }, "engines": { "node": ">=14" } }, "node_modules/@mswjs/interceptors": { - "version": "0.17.6", - "resolved": "https://registry.npmjs.org/@mswjs/interceptors/-/interceptors-0.17.6.tgz", - "integrity": "sha512-201pBIWehTURb6q8Gheu4Zhvd3Ox1U4BJq5KiOQsYzkWyfiOG4pwcz5hPZIEryztgrf8/sdwABpvY757xMmfrQ==", + "version": "0.25.7", + "resolved": "https://registry.npmjs.org/@mswjs/interceptors/-/interceptors-0.25.7.tgz", + "integrity": "sha512-U7iFYs/qU/5jfz1VDpoYz3xqX9nzhsBXw7q923dv6GiGTy+m2ZLhD33L80R/shHOW/YWjeH6k16GbIHGw+bAng==", "dev": true, "dependencies": { - "@open-draft/until": "^1.0.3", - "@types/debug": "^4.1.7", - "@xmldom/xmldom": "^0.8.3", - "debug": "^4.3.3", - "headers-polyfill": "^3.1.0", + "@open-draft/deferred-promise": "^2.2.0", + "@open-draft/logger": "^0.3.0", + "@open-draft/until": "^2.0.0", + "is-node-process": "^1.2.0", "outvariant": "^1.2.1", - "strict-event-emitter": "^0.2.4", - "web-encoding": "^1.1.5" + "strict-event-emitter": "^0.5.1" }, "engines": { - "node": ">=14" + "node": ">=18" } }, "node_modules/@nodelib/fs.scandir": { @@ -497,10 +518,26 @@ "node": ">= 8" } }, + "node_modules/@open-draft/deferred-promise": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@open-draft/deferred-promise/-/deferred-promise-2.2.0.tgz", + "integrity": "sha512-CecwLWx3rhxVQF6V4bAgPS5t+So2sTbPgAzafKkVizyi7tlwpcFpdFqq+wqF2OwNBmqFuu6tOyouTuxgpMfzmA==", + "dev": true + }, + "node_modules/@open-draft/logger": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@open-draft/logger/-/logger-0.3.0.tgz", + "integrity": "sha512-X2g45fzhxH238HKO4xbSr7+wBS8Fvw6ixhTDuvLd5mqh6bJJCFAPwU9mPDxbcrRtfxv4u5IHCEH77BmxvXmmxQ==", + "dev": true, + "dependencies": { + "is-node-process": "^1.2.0", + "outvariant": "^1.4.0" + } + }, "node_modules/@open-draft/until": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@open-draft/until/-/until-1.0.3.tgz", - "integrity": "sha512-Aq58f5HiWdyDlFffbbSjAlv596h/cOnt2DO1w3DOC7OJ5EHs0hd/nycJfiu9RJbT6Yk6F1knnRRXNSpxoIVZ9Q==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@open-draft/until/-/until-2.1.0.tgz", + "integrity": "sha512-U69T3ItWHvLwGg5eJ0n3I62nWuE6ilHlmz7zM0npLBRvPRd7e6NYmg54vvRtP5mZG7kZqZCFVdsTWo7BPtBujg==", "dev": true }, "node_modules/@tootallnate/once": { @@ -543,15 +580,6 @@ "integrity": "sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==", "dev": true }, - "node_modules/@types/debug": { - "version": "4.1.7", - "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.7.tgz", - "integrity": "sha512-9AonUzyTjXXhEOa0DnqpzZi6VHlqKMswga9EXjpXnnqxwLtdvPPtlO8evrI5D9S6asFRCQ6v+wpiUKbw+vKqyg==", - "dev": true, - "dependencies": { - "@types/ms": "*" - } - }, "node_modules/@types/form-data": { "version": "0.0.33", "dev": true, @@ -573,12 +601,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@types/ms": { - "version": "0.7.31", - "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.31.tgz", - "integrity": "sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==", - "dev": true - }, "node_modules/@types/node": { "version": "18.7.20", "dev": true, @@ -591,14 +613,11 @@ "optional": true, "peer": true }, - "node_modules/@types/set-cookie-parser": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/@types/set-cookie-parser/-/set-cookie-parser-2.4.2.tgz", - "integrity": "sha512-fBZgytwhYAUkj/jC/FAV4RQ5EerRup1YQsXQCh8rZfiHkc4UahC192oH0smGwsXol3cL3A5oETuAHeQHmhXM4w==", - "dev": true, - "dependencies": { - "@types/node": "*" - } + "node_modules/@types/statuses": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@types/statuses/-/statuses-2.0.3.tgz", + "integrity": "sha512-NwCYScf83RIwCyi5/9cXocrJB//xrqMh5PMw3mYTSFGaI3DuVjBLfO/PCk7QVAC3Da8b9NjxNmTO9Aj9T3rl/Q==", + "dev": true }, "node_modules/@vitest/expect": { "version": "0.32.2", @@ -669,22 +688,6 @@ "url": "https://opencollective.com/vitest" } }, - "node_modules/@xmldom/xmldom": { - "version": "0.8.7", - "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.8.7.tgz", - "integrity": "sha512-sI1Ly2cODlWStkINzqGrZ8K6n+MTSbAeQnAipGyL+KZCXuHaRlj2gyyy8B/9MvsFFqN7XHryQnB2QwhzvJXovg==", - "dev": true, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/@zxing/text-encoding": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/@zxing/text-encoding/-/text-encoding-0.9.0.tgz", - "integrity": "sha512-U/4aVJ2mxI0aDNI8Uq0wEhMgY+u4CNtEb0om3+y3+niDAsoTCOB33UF0sxpzqzdqXLqmvc+vZyAt4O8pPdfkwA==", - "dev": true, - "optional": true - }, "node_modules/abab": { "version": "2.0.6", "dev": true, @@ -855,18 +858,6 @@ "optional": true, "peer": true }, - "node_modules/available-typed-arrays": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", - "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/balanced-match": { "version": "1.0.2", "dev": true, @@ -1016,6 +1007,8 @@ "version": "1.0.2", "dev": true, "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "function-bind": "^1.1.1", "get-intrinsic": "^1.0.2" @@ -1055,9 +1048,9 @@ } }, "node_modules/chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "dependencies": { "ansi-styles": "^4.1.0", @@ -1247,9 +1240,9 @@ } }, "node_modules/cookie": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", - "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", + "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", "dev": true, "engines": { "node": ">= 0.6" @@ -1417,22 +1410,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/define-properties": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz", - "integrity": "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==", - "dev": true, - "dependencies": { - "has-property-descriptors": "^1.0.0", - "object-keys": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/delayed-stream": { "version": "1.0.0", "dev": true, @@ -1495,61 +1472,6 @@ "url": "https://github.com/fb55/entities?sponsor=1" } }, - "node_modules/es-abstract": { - "version": "1.20.4", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.20.4.tgz", - "integrity": "sha512-0UtvRN79eMe2L+UNEF1BwRe364sj/DXhQ/k5FmivgoSdpM90b8Jc0mDzKMGo7QS0BVbOP/bTwBKNnDc9rNzaPA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "function.prototype.name": "^1.1.5", - "get-intrinsic": "^1.1.3", - "get-symbol-description": "^1.0.0", - "has": "^1.0.3", - "has-property-descriptors": "^1.0.0", - "has-symbols": "^1.0.3", - "internal-slot": "^1.0.3", - "is-callable": "^1.2.7", - "is-negative-zero": "^2.0.2", - "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.2", - "is-string": "^1.0.7", - "is-weakref": "^1.0.2", - "object-inspect": "^1.12.2", - "object-keys": "^1.1.1", - "object.assign": "^4.1.4", - "regexp.prototype.flags": "^1.4.3", - "safe-regex-test": "^1.0.0", - "string.prototype.trimend": "^1.0.5", - "string.prototype.trimstart": "^1.0.5", - "unbox-primitive": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/es-to-primitive": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", - "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", - "dev": true, - "dependencies": { - "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/esbuild": { "version": "0.17.18", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.17.18.tgz", @@ -1668,15 +1590,6 @@ "node": ">=0.10.0" } }, - "node_modules/events": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", - "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", - "dev": true, - "engines": { - "node": ">=0.8.x" - } - }, "node_modules/execa": { "version": "5.1.1", "dev": true, @@ -1787,15 +1700,6 @@ "node": ">=8" } }, - "node_modules/for-each": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", - "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", - "dev": true, - "dependencies": { - "is-callable": "^1.1.3" - } - }, "node_modules/form-data": { "version": "2.5.1", "dev": true, @@ -1811,6 +1715,19 @@ "node": ">= 0.12" } }, + "node_modules/formdata-node": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/formdata-node/-/formdata-node-4.4.1.tgz", + "integrity": "sha512-0iirZp3uVDjVGt9p49aTaqjk84TrglENEDuqfdlZQ1roC9CWlPk6Avf8EEnZNcAqPonwkG35x4n3ww/1THYAeQ==", + "dev": true, + "dependencies": { + "node-domexception": "1.0.0", + "web-streams-polyfill": "4.0.0-beta.3" + }, + "engines": { + "node": ">= 12.20" + } + }, "node_modules/fs.realpath": { "version": "1.0.0", "dev": true, @@ -1833,34 +1750,9 @@ "node_modules/function-bind": { "version": "1.1.1", "dev": true, - "license": "MIT" - }, - "node_modules/function.prototype.name": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.5.tgz", - "integrity": "sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.0", - "functions-have-names": "^1.2.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/functions-have-names": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", - "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } + "license": "MIT", + "optional": true, + "peer": true }, "node_modules/get-caller-file": { "version": "2.0.5", @@ -1884,6 +1776,8 @@ "version": "1.1.3", "dev": true, "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "function-bind": "^1.1.1", "has": "^1.0.3", @@ -1914,22 +1808,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/get-symbol-description": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", - "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/glob": { "version": "7.1.6", "dev": true, @@ -1980,9 +1858,9 @@ } }, "node_modules/graphql": { - "version": "16.6.0", - "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.6.0.tgz", - "integrity": "sha512-KPIBPDlW7NxrbT/eh4qPXz5FiFdL5UbaA0XUNz2Rp3Z3hqBSkbj0GVjwFDztsWVauZUWsbKHgMg++sk8UX0bkw==", + "version": "16.8.1", + "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.8.1.tgz", + "integrity": "sha512-59LZHPdGZVh695Ud9lRzPBVTtlX9ZCV150Er2W43ro37wVof0ctenSaskPPjN7lVTIN8mSZt8PHUNKZuNQUuxw==", "dev": true, "engines": { "node": "^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0" @@ -2008,6 +1886,8 @@ "version": "1.0.3", "dev": true, "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "function-bind": "^1.1.1" }, @@ -2015,15 +1895,6 @@ "node": ">= 0.4.0" } }, - "node_modules/has-bigints": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", - "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -2033,37 +1904,12 @@ "node": ">=8" } }, - "node_modules/has-property-descriptors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", - "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", - "dev": true, - "dependencies": { - "get-intrinsic": "^1.1.1" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/has-symbols": { "version": "1.0.3", "dev": true, "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-tostringtag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", - "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", - "dev": true, - "dependencies": { - "has-symbols": "^1.0.2" - }, + "optional": true, + "peer": true, "engines": { "node": ">= 0.4" }, @@ -2082,9 +1928,9 @@ } }, "node_modules/headers-polyfill": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/headers-polyfill/-/headers-polyfill-3.1.2.tgz", - "integrity": "sha512-tWCK4biJ6hcLqTviLXVR9DTRfYGQMXEIUj3gwJ2rZ5wO/at3XtkI4g8mCvFdUF9l1KMBNCfmNAdnahm1cgavQA==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/headers-polyfill/-/headers-polyfill-4.0.2.tgz", + "integrity": "sha512-EWGTfnTqAO2L/j5HZgoM/3z82L7necsJ0pO9Tp0X1wil3PDLrkypTBRgVO2ExehEEvUycejZD3FuRaXpZZc3kw==", "dev": true }, "node_modules/html-encoding-sniffer": { @@ -2251,48 +2097,6 @@ "node": ">=12.0.0" } }, - "node_modules/internal-slot": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz", - "integrity": "sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==", - "dev": true, - "dependencies": { - "get-intrinsic": "^1.1.0", - "has": "^1.0.3", - "side-channel": "^1.0.4" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/is-arguments": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", - "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-bigint": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", - "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", - "dev": true, - "dependencies": { - "has-bigints": "^1.0.1" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-binary-path": { "version": "2.1.0", "dev": true, @@ -2304,49 +2108,6 @@ "node": ">=8" } }, - "node_modules/is-boolean-object": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", - "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-callable": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", - "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-date-object": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", - "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", - "dev": true, - "dependencies": { - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-extglob": { "version": "2.1.1", "dev": true, @@ -2364,21 +2125,6 @@ "node": ">=8" } }, - "node_modules/is-generator-function": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", - "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", - "dev": true, - "dependencies": { - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-glob": { "version": "4.0.3", "dev": true, @@ -2399,18 +2145,6 @@ "node": ">=8" } }, - "node_modules/is-negative-zero": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", - "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-node-process": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/is-node-process/-/is-node-process-1.2.0.tgz", @@ -2425,21 +2159,6 @@ "node": ">=0.12.0" } }, - "node_modules/is-number-object": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", - "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", - "dev": true, - "dependencies": { - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-potential-custom-element-name": { "version": "1.0.1", "dev": true, @@ -2447,34 +2166,6 @@ "optional": true, "peer": true }, - "node_modules/is-regex": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", - "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-shared-array-buffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", - "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-stream": { "version": "2.0.1", "dev": true, @@ -2486,55 +2177,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-string": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", - "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", - "dev": true, - "dependencies": { - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-symbol": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", - "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", - "dev": true, - "dependencies": { - "has-symbols": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-typed-array": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.9.tgz", - "integrity": "sha512-kfrlnTTn8pZkfpJMUgYD7YZ3qzeJgWUn8XfVYBARc4wnmNOmLbmuuaAs3q5fvB0UJOn6yHAKaGTPM7d6ezoD/A==", - "dev": true, - "dependencies": { - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.2", - "es-abstract": "^1.20.0", - "for-each": "^0.3.3", - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-unicode-supported": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", @@ -2547,18 +2189,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-weakref": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", - "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/isarray": { "version": "1.0.0", "dev": true, @@ -2918,29 +2548,33 @@ "license": "MIT" }, "node_modules/msw": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/msw/-/msw-1.2.1.tgz", - "integrity": "sha512-bF7qWJQSmKn6bwGYVPXOxhexTCGD5oJSZg8yt8IBClxvo3Dx/1W0zqE1nX9BSWmzRsCKWfeGWcB/vpqV6aclpw==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/msw/-/msw-2.0.0.tgz", + "integrity": "sha512-lw9UHuzNCWoODHaThGeLLIIuzEBUQkj3fJXQnChHifMKbB2UmF2msHd4d/lnyqjAyD0XWoibdviW9wlstFPpkA==", "dev": true, "hasInstallScript": true, "dependencies": { - "@mswjs/cookies": "^0.2.2", - "@mswjs/interceptors": "^0.17.5", - "@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.0.0", + "@mswjs/interceptors": "^0.25.1", + "@open-draft/until": "^2.1.0", "@types/cookie": "^0.4.1", "@types/js-levenshtein": "^1.1.1", - "chalk": "4.1.1", + "@types/statuses": "^2.0.1", + "chalk": "^4.1.2", "chokidar": "^3.4.2", - "cookie": "^0.4.2", - "graphql": "^15.0.0 || ^16.0.0", - "headers-polyfill": "^3.1.2", + "formdata-node": "4.4.1", + "graphql": "^16.8.1", + "headers-polyfill": "^4.0.1", "inquirer": "^8.2.0", "is-node-process": "^1.2.0", "js-levenshtein": "^1.1.6", "node-fetch": "^2.6.7", "outvariant": "^1.4.0", "path-to-regexp": "^6.2.0", - "strict-event-emitter": "^0.4.3", + "strict-event-emitter": "^0.5.0", "type-fest": "^2.19.0", "yargs": "^17.3.1" }, @@ -2948,14 +2582,14 @@ "msw": "cli/index.js" }, "engines": { - "node": ">=14" + "node": ">=18" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/mswjs" }, "peerDependencies": { - "typescript": ">= 4.4.x <= 5.0.x" + "typescript": ">= 4.7.x <= 5.2.x" }, "peerDependenciesMeta": { "typescript": { @@ -2963,12 +2597,6 @@ } } }, - "node_modules/msw/node_modules/strict-event-emitter": { - "version": "0.4.6", - "resolved": "https://registry.npmjs.org/strict-event-emitter/-/strict-event-emitter-0.4.6.tgz", - "integrity": "sha512-12KWeb+wixJohmnwNFerbyiBrAlq5qJLwIt38etRtKtmmHyDSoGlIqFE9wx+4IwG0aDjI7GV8tc8ZccjWZZtTg==", - "dev": true - }, "node_modules/msw/node_modules/type-fest": { "version": "2.19.0", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", @@ -3015,6 +2643,25 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, + "node_modules/node-domexception": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "github", + "url": "https://paypal.me/jimmywarting" + } + ], + "engines": { + "node": ">=10.5.0" + } + }, "node_modules/node-fetch": { "version": "2.6.7", "dev": true, @@ -3072,33 +2719,8 @@ "version": "1.12.2", "dev": true, "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/object.assign": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", - "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "has-symbols": "^1.0.3", - "object-keys": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, + "optional": true, + "peer": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -3513,23 +3135,6 @@ "node": ">=8.10.0" } }, - "node_modules/regexp.prototype.flags": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz", - "integrity": "sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "functions-have-names": "^1.2.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -3637,20 +3242,6 @@ "dev": true, "license": "MIT" }, - "node_modules/safe-regex-test": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz", - "integrity": "sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.3", - "is-regex": "^1.1.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/safer-buffer": { "version": "2.1.2", "dev": true, @@ -3684,12 +3275,6 @@ "node": ">=10" } }, - "node_modules/set-cookie-parser": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.5.1.tgz", - "integrity": "sha512-1jeBGaKNGdEq4FgIrORu/N570dwoPYio8lSoYLWmX7sQ//0JY08Xh9o5pBcgmHQ/MbsYp/aZnOe1s1lIsbLprQ==", - "dev": true - }, "node_modules/shebang-command": { "version": "2.0.0", "dev": true, @@ -3713,6 +3298,8 @@ "version": "1.0.4", "dev": true, "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "call-bind": "^1.0.0", "get-intrinsic": "^1.0.2", @@ -3765,6 +3352,15 @@ "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", "dev": true }, + "node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/std-env": { "version": "3.3.3", "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.3.3.tgz", @@ -3772,13 +3368,10 @@ "dev": true }, "node_modules/strict-event-emitter": { - "version": "0.2.7", - "resolved": "https://registry.npmjs.org/strict-event-emitter/-/strict-event-emitter-0.2.7.tgz", - "integrity": "sha512-TavbHJ87WD2tDbKI7bTrmc6U4J4Qjh8E9fVvFkIFw2gCu34Wxstn2Yas0+4D78FJN8DOTEzxiT+udBdraRk4UQ==", - "dev": true, - "dependencies": { - "events": "^3.3.0" - } + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/strict-event-emitter/-/strict-event-emitter-0.5.1.tgz", + "integrity": "sha512-vMgjE/GGEPEFnhFub6pa4FmJBRBVOLpIII2hvCZ8Kzb7K0hlHo7mQv6xYrBvCL2LtAIBwFUK8wvuJgTVSQ5MFQ==", + "dev": true }, "node_modules/string_decoder": { "version": "1.1.1", @@ -3802,34 +3395,6 @@ "node": ">=8" } }, - "node_modules/string.prototype.trimend": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.5.tgz", - "integrity": "sha512-I7RGvmjV4pJ7O3kdf+LXFpVfdNOxtCW/2C8f6jNiW4+PQchwxkCDzlk1/7p+Wl4bqFIZeF47qAHXLuHHWKAxog==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.19.5" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/string.prototype.trimstart": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.5.tgz", - "integrity": "sha512-THx16TJCGlsN0o6dl2o6ncWUsdgnLRSA23rRE5pyGBw/mLr3Ej/R2LaqCtgP8VNMGZsvMWnf9ooZPyY2bHvUFg==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.19.5" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -4240,21 +3805,6 @@ "integrity": "sha512-TrY6DsjTQQgyS3E3dBaOXf0TpPD8u9FVrVYmKVegJuFw51n/YB9XPt+U6ydzFG5ZIN7+DIjPbNmXoBj9esYhgQ==", "dev": true }, - "node_modules/unbox-primitive": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", - "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "has-bigints": "^1.0.2", - "has-symbols": "^1.0.3", - "which-boxed-primitive": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/universalify": { "version": "0.2.0", "dev": true, @@ -4276,20 +3826,6 @@ "requires-port": "^1.0.0" } }, - "node_modules/util": { - "version": "0.12.4", - "resolved": "https://registry.npmjs.org/util/-/util-0.12.4.tgz", - "integrity": "sha512-bxZ9qtSlGUWSOy9Qa9Xgk11kSslpuZwaxCg4sNIDj6FLucDab2JxnHwyNTCpHMtK1MjoQiWQ6DiUMZYbSrO+Sw==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "is-arguments": "^1.0.4", - "is-generator-function": "^1.0.7", - "is-typed-array": "^1.1.3", - "safe-buffer": "^5.1.2", - "which-typed-array": "^1.1.2" - } - }, "node_modules/util-deprecate": { "version": "1.0.2", "dev": true, @@ -4493,16 +4029,13 @@ "defaults": "^1.0.3" } }, - "node_modules/web-encoding": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/web-encoding/-/web-encoding-1.1.5.tgz", - "integrity": "sha512-HYLeVCdJ0+lBYV2FvNZmv3HJ2Nt0QYXqZojk3d9FJOLkwnuhzM9tmamh8d7HPM8QqjKH8DeHkFTx+CFlWpZZDA==", + "node_modules/web-streams-polyfill": { + "version": "4.0.0-beta.3", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-4.0.0-beta.3.tgz", + "integrity": "sha512-QW95TCTaHmsYfHDybGMwO5IJIM93I/6vTRk+daHTWFPhwh+C8Cg7j7XyKrwrj8Ib6vYXe0ocYNrmzY4xAAN6ug==", "dev": true, - "dependencies": { - "util": "^0.12.3" - }, - "optionalDependencies": { - "@zxing/text-encoding": "0.9.0" + "engines": { + "node": ">= 14" } }, "node_modules/webidl-conversions": { @@ -4570,45 +4103,9 @@ }, "bin": { "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/which-boxed-primitive": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", - "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", - "dev": true, - "dependencies": { - "is-bigint": "^1.0.1", - "is-boolean-object": "^1.1.0", - "is-number-object": "^1.0.4", - "is-string": "^1.0.5", - "is-symbol": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/which-typed-array": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.8.tgz", - "integrity": "sha512-Jn4e5PItbcAHyLoRDwvPj1ypu27DJbtdYXUa5zsinrUx77Uvfb0cXwwnGMTn7cjUfhhqgVQnVJCwF+7cgU7tpw==", - "dev": true, - "dependencies": { - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.2", - "es-abstract": "^1.20.0", - "for-each": "^0.3.3", - "has-tostringtag": "^1.0.0", - "is-typed-array": "^1.1.9" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + }, + "engines": { + "node": ">= 8" } }, "node_modules/why-is-node-running": { @@ -4827,6 +4324,33 @@ "z-schema": "^5.0.1" } }, + "@bundled-es-modules/cookie": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@bundled-es-modules/cookie/-/cookie-2.0.0.tgz", + "integrity": "sha512-Or6YHg/kamKHpxULAdSqhGqnWFneIXu1NKvvfBBzKGwpVsYuFIQ5aBPHDnnoR3ghW1nvSkALd+EF9iMtY7Vjxw==", + "dev": true, + "requires": { + "cookie": "^0.5.0" + } + }, + "@bundled-es-modules/js-levenshtein": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@bundled-es-modules/js-levenshtein/-/js-levenshtein-2.0.1.tgz", + "integrity": "sha512-DERMS3yfbAljKsQc0U2wcqGKUWpdFjwqWuoMugEJlqBnKO180/n+4SR/J8MRDt1AN48X1ovgoD9KrdVXcaa3Rg==", + "dev": true, + "requires": { + "js-levenshtein": "^1.1.6" + } + }, + "@bundled-es-modules/statuses": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@bundled-es-modules/statuses/-/statuses-1.0.1.tgz", + "integrity": "sha512-yn7BklA5acgcBr+7w064fGV+SGIFySjCKpqjcWgBAIfrAkY+4GQTJJHQMeT3V/sgz23VTEVV8TtOmkvJAhFVfg==", + "dev": true, + "requires": { + "statuses": "^2.0.1" + } + }, "@esbuild/android-arm": { "version": "0.17.18", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.17.18.tgz", @@ -4992,29 +4516,23 @@ "dev": true }, "@mswjs/cookies": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/@mswjs/cookies/-/cookies-0.2.2.tgz", - "integrity": "sha512-mlN83YSrcFgk7Dm1Mys40DLssI1KdJji2CMKN8eOlBqsTADYzj2+jWzsANsUTFbxDMWPD5e9bfA1RGqBpS3O1g==", - "dev": true, - "requires": { - "@types/set-cookie-parser": "^2.4.0", - "set-cookie-parser": "^2.4.6" - } + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@mswjs/cookies/-/cookies-1.0.0.tgz", + "integrity": "sha512-TdXoBdI+h/EDTsVLCX/34s4+9U0sWi92qFnIGUEikpMCSKLhBeujovyYVSoORNbYgsBH5ga7/tfxyWcEZAxiYA==", + "dev": true }, "@mswjs/interceptors": { - "version": "0.17.6", - "resolved": "https://registry.npmjs.org/@mswjs/interceptors/-/interceptors-0.17.6.tgz", - "integrity": "sha512-201pBIWehTURb6q8Gheu4Zhvd3Ox1U4BJq5KiOQsYzkWyfiOG4pwcz5hPZIEryztgrf8/sdwABpvY757xMmfrQ==", + "version": "0.25.7", + "resolved": "https://registry.npmjs.org/@mswjs/interceptors/-/interceptors-0.25.7.tgz", + "integrity": "sha512-U7iFYs/qU/5jfz1VDpoYz3xqX9nzhsBXw7q923dv6GiGTy+m2ZLhD33L80R/shHOW/YWjeH6k16GbIHGw+bAng==", "dev": true, "requires": { - "@open-draft/until": "^1.0.3", - "@types/debug": "^4.1.7", - "@xmldom/xmldom": "^0.8.3", - "debug": "^4.3.3", - "headers-polyfill": "^3.1.0", + "@open-draft/deferred-promise": "^2.2.0", + "@open-draft/logger": "^0.3.0", + "@open-draft/until": "^2.0.0", + "is-node-process": "^1.2.0", "outvariant": "^1.2.1", - "strict-event-emitter": "^0.2.4", - "web-encoding": "^1.1.5" + "strict-event-emitter": "^0.5.1" } }, "@nodelib/fs.scandir": { @@ -5037,10 +4555,26 @@ "fastq": "^1.6.0" } }, + "@open-draft/deferred-promise": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@open-draft/deferred-promise/-/deferred-promise-2.2.0.tgz", + "integrity": "sha512-CecwLWx3rhxVQF6V4bAgPS5t+So2sTbPgAzafKkVizyi7tlwpcFpdFqq+wqF2OwNBmqFuu6tOyouTuxgpMfzmA==", + "dev": true + }, + "@open-draft/logger": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@open-draft/logger/-/logger-0.3.0.tgz", + "integrity": "sha512-X2g45fzhxH238HKO4xbSr7+wBS8Fvw6ixhTDuvLd5mqh6bJJCFAPwU9mPDxbcrRtfxv4u5IHCEH77BmxvXmmxQ==", + "dev": true, + "requires": { + "is-node-process": "^1.2.0", + "outvariant": "^1.4.0" + } + }, "@open-draft/until": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@open-draft/until/-/until-1.0.3.tgz", - "integrity": "sha512-Aq58f5HiWdyDlFffbbSjAlv596h/cOnt2DO1w3DOC7OJ5EHs0hd/nycJfiu9RJbT6Yk6F1knnRRXNSpxoIVZ9Q==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@open-draft/until/-/until-2.1.0.tgz", + "integrity": "sha512-U69T3ItWHvLwGg5eJ0n3I62nWuE6ilHlmz7zM0npLBRvPRd7e6NYmg54vvRtP5mZG7kZqZCFVdsTWo7BPtBujg==", "dev": true }, "@tootallnate/once": { @@ -5077,15 +4611,6 @@ "integrity": "sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==", "dev": true }, - "@types/debug": { - "version": "4.1.7", - "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.7.tgz", - "integrity": "sha512-9AonUzyTjXXhEOa0DnqpzZi6VHlqKMswga9EXjpXnnqxwLtdvPPtlO8evrI5D9S6asFRCQ6v+wpiUKbw+vKqyg==", - "dev": true, - "requires": { - "@types/ms": "*" - } - }, "@types/form-data": { "version": "0.0.33", "dev": true, @@ -5105,12 +4630,6 @@ "version": "7.0.9", "dev": true }, - "@types/ms": { - "version": "0.7.31", - "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.31.tgz", - "integrity": "sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==", - "dev": true - }, "@types/node": { "version": "18.7.20", "dev": true @@ -5121,14 +4640,11 @@ "optional": true, "peer": true }, - "@types/set-cookie-parser": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/@types/set-cookie-parser/-/set-cookie-parser-2.4.2.tgz", - "integrity": "sha512-fBZgytwhYAUkj/jC/FAV4RQ5EerRup1YQsXQCh8rZfiHkc4UahC192oH0smGwsXol3cL3A5oETuAHeQHmhXM4w==", - "dev": true, - "requires": { - "@types/node": "*" - } + "@types/statuses": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@types/statuses/-/statuses-2.0.3.tgz", + "integrity": "sha512-NwCYScf83RIwCyi5/9cXocrJB//xrqMh5PMw3mYTSFGaI3DuVjBLfO/PCk7QVAC3Da8b9NjxNmTO9Aj9T3rl/Q==", + "dev": true }, "@vitest/expect": { "version": "0.32.2", @@ -5184,19 +4700,6 @@ "pretty-format": "^27.5.1" } }, - "@xmldom/xmldom": { - "version": "0.8.7", - "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.8.7.tgz", - "integrity": "sha512-sI1Ly2cODlWStkINzqGrZ8K6n+MTSbAeQnAipGyL+KZCXuHaRlj2gyyy8B/9MvsFFqN7XHryQnB2QwhzvJXovg==", - "dev": true - }, - "@zxing/text-encoding": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/@zxing/text-encoding/-/text-encoding-0.9.0.tgz", - "integrity": "sha512-U/4aVJ2mxI0aDNI8Uq0wEhMgY+u4CNtEb0om3+y3+niDAsoTCOB33UF0sxpzqzdqXLqmvc+vZyAt4O8pPdfkwA==", - "dev": true, - "optional": true - }, "abab": { "version": "2.0.6", "dev": true, @@ -5312,12 +4815,6 @@ "optional": true, "peer": true }, - "available-typed-arrays": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", - "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", - "dev": true - }, "balanced-match": { "version": "1.0.2", "dev": true @@ -5415,6 +4912,8 @@ "call-bind": { "version": "1.0.2", "dev": true, + "optional": true, + "peer": true, "requires": { "function-bind": "^1.1.1", "get-intrinsic": "^1.0.2" @@ -5446,9 +4945,9 @@ } }, "chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "requires": { "ansi-styles": "^4.1.0", @@ -5580,9 +5079,9 @@ } }, "cookie": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", - "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", + "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", "dev": true }, "core-util-is": { @@ -5707,16 +5206,6 @@ "clone": "^1.0.2" } }, - "define-properties": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz", - "integrity": "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==", - "dev": true, - "requires": { - "has-property-descriptors": "^1.0.0", - "object-keys": "^1.1.1" - } - }, "delayed-stream": { "version": "1.0.0", "dev": true, @@ -5757,49 +5246,6 @@ "optional": true, "peer": true }, - "es-abstract": { - "version": "1.20.4", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.20.4.tgz", - "integrity": "sha512-0UtvRN79eMe2L+UNEF1BwRe364sj/DXhQ/k5FmivgoSdpM90b8Jc0mDzKMGo7QS0BVbOP/bTwBKNnDc9rNzaPA==", - "dev": true, - "requires": { - "call-bind": "^1.0.2", - "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "function.prototype.name": "^1.1.5", - "get-intrinsic": "^1.1.3", - "get-symbol-description": "^1.0.0", - "has": "^1.0.3", - "has-property-descriptors": "^1.0.0", - "has-symbols": "^1.0.3", - "internal-slot": "^1.0.3", - "is-callable": "^1.2.7", - "is-negative-zero": "^2.0.2", - "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.2", - "is-string": "^1.0.7", - "is-weakref": "^1.0.2", - "object-inspect": "^1.12.2", - "object-keys": "^1.1.1", - "object.assign": "^4.1.4", - "regexp.prototype.flags": "^1.4.3", - "safe-regex-test": "^1.0.0", - "string.prototype.trimend": "^1.0.5", - "string.prototype.trimstart": "^1.0.5", - "unbox-primitive": "^1.0.2" - } - }, - "es-to-primitive": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", - "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", - "dev": true, - "requires": { - "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.2" - } - }, "esbuild": { "version": "0.17.18", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.17.18.tgz", @@ -5876,12 +5322,6 @@ "version": "2.0.3", "dev": true }, - "events": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", - "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", - "dev": true - }, "execa": { "version": "5.1.1", "dev": true, @@ -5965,15 +5405,6 @@ "to-regex-range": "^5.0.1" } }, - "for-each": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", - "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", - "dev": true, - "requires": { - "is-callable": "^1.1.3" - } - }, "form-data": { "version": "2.5.1", "dev": true, @@ -5985,6 +5416,16 @@ "mime-types": "^2.1.12" } }, + "formdata-node": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/formdata-node/-/formdata-node-4.4.1.tgz", + "integrity": "sha512-0iirZp3uVDjVGt9p49aTaqjk84TrglENEDuqfdlZQ1roC9CWlPk6Avf8EEnZNcAqPonwkG35x4n3ww/1THYAeQ==", + "dev": true, + "requires": { + "node-domexception": "1.0.0", + "web-streams-polyfill": "4.0.0-beta.3" + } + }, "fs.realpath": { "version": "1.0.0", "dev": true @@ -5998,25 +5439,9 @@ }, "function-bind": { "version": "1.1.1", - "dev": true - }, - "function.prototype.name": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.5.tgz", - "integrity": "sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==", "dev": true, - "requires": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.0", - "functions-have-names": "^1.2.2" - } - }, - "functions-have-names": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", - "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", - "dev": true + "optional": true, + "peer": true }, "get-caller-file": { "version": "2.0.5", @@ -6033,6 +5458,8 @@ "get-intrinsic": { "version": "1.1.3", "dev": true, + "optional": true, + "peer": true, "requires": { "function-bind": "^1.1.1", "has": "^1.0.3", @@ -6049,16 +5476,6 @@ "version": "6.0.1", "dev": true }, - "get-symbol-description": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", - "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", - "dev": true, - "requires": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.1" - } - }, "glob": { "version": "7.1.6", "dev": true, @@ -6091,9 +5508,9 @@ } }, "graphql": { - "version": "16.6.0", - "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.6.0.tgz", - "integrity": "sha512-KPIBPDlW7NxrbT/eh4qPXz5FiFdL5UbaA0XUNz2Rp3Z3hqBSkbj0GVjwFDztsWVauZUWsbKHgMg++sk8UX0bkw==", + "version": "16.8.1", + "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.8.1.tgz", + "integrity": "sha512-59LZHPdGZVh695Ud9lRzPBVTtlX9ZCV150Er2W43ro37wVof0ctenSaskPPjN7lVTIN8mSZt8PHUNKZuNQUuxw==", "dev": true }, "happy-dom": { @@ -6114,43 +5531,23 @@ "has": { "version": "1.0.3", "dev": true, + "optional": true, + "peer": true, "requires": { "function-bind": "^1.1.1" } }, - "has-bigints": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", - "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", - "dev": true - }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, - "has-property-descriptors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", - "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", - "dev": true, - "requires": { - "get-intrinsic": "^1.1.1" - } - }, "has-symbols": { "version": "1.0.3", - "dev": true - }, - "has-tostringtag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", - "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", "dev": true, - "requires": { - "has-symbols": "^1.0.2" - } + "optional": true, + "peer": true }, "he": { "version": "1.2.0", @@ -6159,9 +5556,9 @@ "peer": true }, "headers-polyfill": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/headers-polyfill/-/headers-polyfill-3.1.2.tgz", - "integrity": "sha512-tWCK4biJ6hcLqTviLXVR9DTRfYGQMXEIUj3gwJ2rZ5wO/at3XtkI4g8mCvFdUF9l1KMBNCfmNAdnahm1cgavQA==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/headers-polyfill/-/headers-polyfill-4.0.2.tgz", + "integrity": "sha512-EWGTfnTqAO2L/j5HZgoM/3z82L7necsJ0pO9Tp0X1wil3PDLrkypTBRgVO2ExehEEvUycejZD3FuRaXpZZc3kw==", "dev": true }, "html-encoding-sniffer": { @@ -6281,36 +5678,6 @@ "wrap-ansi": "^7.0.0" } }, - "internal-slot": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz", - "integrity": "sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==", - "dev": true, - "requires": { - "get-intrinsic": "^1.1.0", - "has": "^1.0.3", - "side-channel": "^1.0.4" - } - }, - "is-arguments": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", - "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", - "dev": true, - "requires": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - } - }, - "is-bigint": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", - "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", - "dev": true, - "requires": { - "has-bigints": "^1.0.1" - } - }, "is-binary-path": { "version": "2.1.0", "dev": true, @@ -6318,31 +5685,6 @@ "binary-extensions": "^2.0.0" } }, - "is-boolean-object": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", - "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", - "dev": true, - "requires": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - } - }, - "is-callable": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", - "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", - "dev": true - }, - "is-date-object": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", - "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", - "dev": true, - "requires": { - "has-tostringtag": "^1.0.0" - } - }, "is-extglob": { "version": "2.1.1", "dev": true @@ -6353,15 +5695,6 @@ "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true }, - "is-generator-function": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", - "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", - "dev": true, - "requires": { - "has-tostringtag": "^1.0.0" - } - }, "is-glob": { "version": "4.0.3", "dev": true, @@ -6375,12 +5708,6 @@ "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", "dev": true }, - "is-negative-zero": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", - "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==", - "dev": true - }, "is-node-process": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/is-node-process/-/is-node-process-1.2.0.tgz", @@ -6391,90 +5718,22 @@ "version": "7.0.0", "dev": true }, - "is-number-object": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", - "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", - "dev": true, - "requires": { - "has-tostringtag": "^1.0.0" - } - }, "is-potential-custom-element-name": { "version": "1.0.1", "dev": true, "optional": true, "peer": true }, - "is-regex": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", - "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", - "dev": true, - "requires": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - } - }, - "is-shared-array-buffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", - "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", - "dev": true, - "requires": { - "call-bind": "^1.0.2" - } - }, "is-stream": { "version": "2.0.1", "dev": true }, - "is-string": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", - "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", - "dev": true, - "requires": { - "has-tostringtag": "^1.0.0" - } - }, - "is-symbol": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", - "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", - "dev": true, - "requires": { - "has-symbols": "^1.0.2" - } - }, - "is-typed-array": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.9.tgz", - "integrity": "sha512-kfrlnTTn8pZkfpJMUgYD7YZ3qzeJgWUn8XfVYBARc4wnmNOmLbmuuaAs3q5fvB0UJOn6yHAKaGTPM7d6ezoD/A==", - "dev": true, - "requires": { - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.2", - "es-abstract": "^1.20.0", - "for-each": "^0.3.3", - "has-tostringtag": "^1.0.0" - } - }, "is-unicode-supported": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", "dev": true }, - "is-weakref": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", - "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", - "dev": true, - "requires": { - "call-bind": "^1.0.2" - } - }, "isarray": { "version": "1.0.0", "dev": true, @@ -6734,38 +5993,36 @@ "dev": true }, "msw": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/msw/-/msw-1.2.1.tgz", - "integrity": "sha512-bF7qWJQSmKn6bwGYVPXOxhexTCGD5oJSZg8yt8IBClxvo3Dx/1W0zqE1nX9BSWmzRsCKWfeGWcB/vpqV6aclpw==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/msw/-/msw-2.0.0.tgz", + "integrity": "sha512-lw9UHuzNCWoODHaThGeLLIIuzEBUQkj3fJXQnChHifMKbB2UmF2msHd4d/lnyqjAyD0XWoibdviW9wlstFPpkA==", "dev": true, "requires": { - "@mswjs/cookies": "^0.2.2", - "@mswjs/interceptors": "^0.17.5", - "@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.0.0", + "@mswjs/interceptors": "^0.25.1", + "@open-draft/until": "^2.1.0", "@types/cookie": "^0.4.1", "@types/js-levenshtein": "^1.1.1", - "chalk": "4.1.1", + "@types/statuses": "^2.0.1", + "chalk": "^4.1.2", "chokidar": "^3.4.2", - "cookie": "^0.4.2", - "graphql": "^15.0.0 || ^16.0.0", - "headers-polyfill": "^3.1.2", + "formdata-node": "4.4.1", + "graphql": "^16.8.1", + "headers-polyfill": "^4.0.1", "inquirer": "^8.2.0", "is-node-process": "^1.2.0", "js-levenshtein": "^1.1.6", "node-fetch": "^2.6.7", "outvariant": "^1.4.0", "path-to-regexp": "^6.2.0", - "strict-event-emitter": "^0.4.3", + "strict-event-emitter": "^0.5.0", "type-fest": "^2.19.0", "yargs": "^17.3.1" }, "dependencies": { - "strict-event-emitter": { - "version": "0.4.6", - "resolved": "https://registry.npmjs.org/strict-event-emitter/-/strict-event-emitter-0.4.6.tgz", - "integrity": "sha512-12KWeb+wixJohmnwNFerbyiBrAlq5qJLwIt38etRtKtmmHyDSoGlIqFE9wx+4IwG0aDjI7GV8tc8ZccjWZZtTg==", - "dev": true - }, "type-fest": { "version": "2.19.0", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", @@ -6795,6 +6052,12 @@ "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==", "dev": true }, + "node-domexception": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", + "dev": true + }, "node-fetch": { "version": "2.6.7", "dev": true, @@ -6825,25 +6088,9 @@ }, "object-inspect": { "version": "1.12.2", - "dev": true - }, - "object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true - }, - "object.assign": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", - "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", "dev": true, - "requires": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "has-symbols": "^1.0.3", - "object-keys": "^1.1.1" - } + "optional": true, + "peer": true }, "once": { "version": "1.4.0", @@ -7105,17 +6352,6 @@ "picomatch": "^2.2.1" } }, - "regexp.prototype.flags": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz", - "integrity": "sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA==", - "dev": true, - "requires": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "functions-have-names": "^1.2.2" - } - }, "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -7181,17 +6417,6 @@ "version": "5.1.2", "dev": true }, - "safe-regex-test": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz", - "integrity": "sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==", - "dev": true, - "requires": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.3", - "is-regex": "^1.1.4" - } - }, "safer-buffer": { "version": "2.1.2", "dev": true @@ -7214,12 +6439,6 @@ "lru-cache": "^6.0.0" } }, - "set-cookie-parser": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.5.1.tgz", - "integrity": "sha512-1jeBGaKNGdEq4FgIrORu/N570dwoPYio8lSoYLWmX7sQ//0JY08Xh9o5pBcgmHQ/MbsYp/aZnOe1s1lIsbLprQ==", - "dev": true - }, "shebang-command": { "version": "2.0.0", "dev": true, @@ -7234,6 +6453,8 @@ "side-channel": { "version": "1.0.4", "dev": true, + "optional": true, + "peer": true, "requires": { "call-bind": "^1.0.0", "get-intrinsic": "^1.0.2", @@ -7270,6 +6491,12 @@ "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", "dev": true }, + "statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "dev": true + }, "std-env": { "version": "3.3.3", "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.3.3.tgz", @@ -7277,13 +6504,10 @@ "dev": true }, "strict-event-emitter": { - "version": "0.2.7", - "resolved": "https://registry.npmjs.org/strict-event-emitter/-/strict-event-emitter-0.2.7.tgz", - "integrity": "sha512-TavbHJ87WD2tDbKI7bTrmc6U4J4Qjh8E9fVvFkIFw2gCu34Wxstn2Yas0+4D78FJN8DOTEzxiT+udBdraRk4UQ==", - "dev": true, - "requires": { - "events": "^3.3.0" - } + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/strict-event-emitter/-/strict-event-emitter-0.5.1.tgz", + "integrity": "sha512-vMgjE/GGEPEFnhFub6pa4FmJBRBVOLpIII2hvCZ8Kzb7K0hlHo7mQv6xYrBvCL2LtAIBwFUK8wvuJgTVSQ5MFQ==", + "dev": true }, "string_decoder": { "version": "1.1.1", @@ -7303,28 +6527,6 @@ "strip-ansi": "^6.0.1" } }, - "string.prototype.trimend": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.5.tgz", - "integrity": "sha512-I7RGvmjV4pJ7O3kdf+LXFpVfdNOxtCW/2C8f6jNiW4+PQchwxkCDzlk1/7p+Wl4bqFIZeF47qAHXLuHHWKAxog==", - "dev": true, - "requires": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.19.5" - } - }, - "string.prototype.trimstart": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.5.tgz", - "integrity": "sha512-THx16TJCGlsN0o6dl2o6ncWUsdgnLRSA23rRE5pyGBw/mLr3Ej/R2LaqCtgP8VNMGZsvMWnf9ooZPyY2bHvUFg==", - "dev": true, - "requires": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.19.5" - } - }, "strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -7622,18 +6824,6 @@ "integrity": "sha512-TrY6DsjTQQgyS3E3dBaOXf0TpPD8u9FVrVYmKVegJuFw51n/YB9XPt+U6ydzFG5ZIN7+DIjPbNmXoBj9esYhgQ==", "dev": true }, - "unbox-primitive": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", - "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", - "dev": true, - "requires": { - "call-bind": "^1.0.2", - "has-bigints": "^1.0.2", - "has-symbols": "^1.0.3", - "which-boxed-primitive": "^1.0.2" - } - }, "universalify": { "version": "0.2.0", "dev": true, @@ -7650,20 +6840,6 @@ "requires-port": "^1.0.0" } }, - "util": { - "version": "0.12.4", - "resolved": "https://registry.npmjs.org/util/-/util-0.12.4.tgz", - "integrity": "sha512-bxZ9qtSlGUWSOy9Qa9Xgk11kSslpuZwaxCg4sNIDj6FLucDab2JxnHwyNTCpHMtK1MjoQiWQ6DiUMZYbSrO+Sw==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "is-arguments": "^1.0.4", - "is-generator-function": "^1.0.7", - "is-typed-array": "^1.1.3", - "safe-buffer": "^5.1.2", - "which-typed-array": "^1.1.2" - } - }, "util-deprecate": { "version": "1.0.2", "dev": true @@ -7766,15 +6942,11 @@ "defaults": "^1.0.3" } }, - "web-encoding": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/web-encoding/-/web-encoding-1.1.5.tgz", - "integrity": "sha512-HYLeVCdJ0+lBYV2FvNZmv3HJ2Nt0QYXqZojk3d9FJOLkwnuhzM9tmamh8d7HPM8QqjKH8DeHkFTx+CFlWpZZDA==", - "dev": true, - "requires": { - "@zxing/text-encoding": "0.9.0", - "util": "^0.12.3" - } + "web-streams-polyfill": { + "version": "4.0.0-beta.3", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-4.0.0-beta.3.tgz", + "integrity": "sha512-QW95TCTaHmsYfHDybGMwO5IJIM93I/6vTRk+daHTWFPhwh+C8Cg7j7XyKrwrj8Ib6vYXe0ocYNrmzY4xAAN6ug==", + "dev": true }, "webidl-conversions": { "version": "7.0.0", @@ -7824,33 +6996,6 @@ "isexe": "^2.0.0" } }, - "which-boxed-primitive": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", - "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", - "dev": true, - "requires": { - "is-bigint": "^1.0.1", - "is-boolean-object": "^1.1.0", - "is-number-object": "^1.0.4", - "is-string": "^1.0.5", - "is-symbol": "^1.0.3" - } - }, - "which-typed-array": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.8.tgz", - "integrity": "sha512-Jn4e5PItbcAHyLoRDwvPj1ypu27DJbtdYXUa5zsinrUx77Uvfb0cXwwnGMTn7cjUfhhqgVQnVJCwF+7cgU7tpw==", - "dev": true, - "requires": { - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.2", - "es-abstract": "^1.20.0", - "for-each": "^0.3.3", - "has-tostringtag": "^1.0.0", - "is-typed-array": "^1.1.9" - } - }, "why-is-node-running": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.2.2.tgz", diff --git a/package.json b/package.json index d42caf3..05c1952 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "devDependencies": { "@types/node": "^18.7.20", "esbuild-register": "^3.3.3", - "msw": "^1.2.1", + "msw": "^2.0.0", "openapi-types": "^12.0.2", "prettier": "2.7.1", "swagger-parser": "^10.0.3",