Skip to content

Commit

Permalink
ci: release package (#36)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and github-actions[bot] authored Feb 15, 2024
1 parent bfe4fdf commit b272a84
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 62 deletions.
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 <[email protected]>",
"description": "Tiny, type-safe wrapper around MSW for type inference from OpenAPI schemas.",
Expand Down

0 comments on commit b272a84

Please sign in to comment.