Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: release package #36

Merged
merged 1 commit into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 0 additions & 54 deletions .changeset/bright-hats-arrive.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/modern-seals-glow.md

This file was deleted.

57 changes: 57 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,62 @@
# openapi-msw

## 0.3.0

### Minor Changes

- [#33](https://github.com/christoph-fricke/openapi-msw/pull/33) [`1f3958d`](https://github.com/christoph-fricke/openapi-msw/commit/1f3958dee1fce818b20c37bf486d6d73a0fcd1ea) Thanks [@christoph-fricke](https://github.com/christoph-fricke)! - Added `query` helper to resolver-info argument. It provides a type-safe wrapper around `URLSearchParams` for reading search parameters. As usual, the information about available parameters is inferred from your OpenAPI spec.

```typescript
/*
Imagine this endpoint specification for the following example:

/query-example:
get:
summary: Query Example
operationId: getQueryExample
parameters:
- name: filter
in: query
required: true
schema:
type: string
- name: page
in: query
schema:
type: number
- name: sort
in: query
required: false
schema:
type: string
enum: ["asc", "desc"]
- name: sortBy
in: query
schema:
type: array
items:
type: string
*/

const handler = http.get("/query-example", ({ query }) => {
const filter = query.get("filter"); // Typed as string
const page = query.get("page"); // Typed as string | null since it is not required
const sort = query.get("sort"); // Typed as "asc" | "desc" | null
const sortBy = query.getAll("sortBy"); // Typed as string[]

// Supported methods from URLSearchParams: get(), getAll(), has(), size
if (query.has("sort", "asc")) {
/* ... */
}

return HttpResponse.json({
/* ... */
});
});
```

- [#35](https://github.com/christoph-fricke/openapi-msw/pull/35) [`07fa9b0`](https://github.com/christoph-fricke/openapi-msw/commit/07fa9b0822c441708c70d3e0698a6dbe7577f58c) Thanks [@christoph-fricke](https://github.com/christoph-fricke)! - Restructured the library to add support for additional response resolver info. The enhanced `ResponseResolver` type and `ResponseResolverInfo` are available as exports.

## 0.2.2

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://json.schemastore.org/package.json",
"name": "openapi-msw",
"type": "module",
"version": "0.2.2",
"version": "0.3.0",
"license": "MIT",
"author": "Christoph Fricke <christoph@frickeonline.de>",
"description": "Tiny, type-safe wrapper around MSW for type inference from OpenAPI schemas.",
Expand Down