openapi-typesafe-fetch 1.0.0-rc.0 → 1.0.0-rc.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +899 -0
- package/README.md +11 -4
- package/dist/helpers.cjs +3 -0
- package/dist/helpers.cjs.map +1 -0
- package/dist/helpers.d.cts +400 -0
- package/dist/helpers.d.mts +400 -0
- package/dist/helpers.d.ts +400 -0
- package/dist/helpers.mjs +2 -0
- package/dist/helpers.mjs.map +1 -0
- package/dist/index.cjs +380 -181
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +366 -85
- package/dist/index.d.mts +366 -83
- package/dist/index.d.ts +366 -85
- package/dist/index.mjs +380 -181
- package/dist/index.mjs.map +1 -1
- package/package.json +23 -13
- package/src/helpers.ts +611 -0
- package/src/index.d.ts +361 -81
- package/src/index.js +654 -228
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,899 @@
|
|
|
1
|
+
# openapi-typesafe-fetch
|
|
2
|
+
|
|
3
|
+
This package is a fork of `openapi-fetch`. The entries above `0.17.0` are releases of openapi-typesafe-fetch; `0.17.0` and the entries below it are the upstream history up to the fork point (upstream commit `d46a319a`), with `openapi-fetch` versions.
|
|
4
|
+
|
|
5
|
+
## 1.0.0-rc.10
|
|
6
|
+
|
|
7
|
+
### Patch Changes
|
|
8
|
+
|
|
9
|
+
- [#120](https://github.com/openapi-typesafe/openapi-typesafe/pull/120) [`e635904`](https://github.com/openapi-typesafe/openapi-typesafe/commit/e6359045a637d6edd0addf58b6703aabb2f3fceb) Thanks [@fedorello](https://github.com/fedorello)! - The `error` type now follows the media type of each error response, as the client reads it. An
|
|
10
|
+
error with a non-JSON media type, such as `text/plain`, is a `string` whatever its schema: a
|
|
11
|
+
`text/plain` error with an `integer` or `boolean` schema was typed as a number or a boolean, but
|
|
12
|
+
the client returns its text. An error with a media range such as `*/*`, `application/*` or
|
|
13
|
+
`text/*`, which may be JSON or not, is its schema or a `string`. `SuccessResponseJSON` and
|
|
14
|
+
`JSONLike` now count `text/*` as JSON too, like `application/*`. JSON errors keep their schemas, and success `data` is unchanged.
|
|
15
|
+
|
|
16
|
+
- [#120](https://github.com/openapi-typesafe/openapi-typesafe/pull/120) [`e635904`](https://github.com/openapi-typesafe/openapi-typesafe/commit/e6359045a637d6edd0addf58b6703aabb2f3fceb) Thanks [@fedorello](https://github.com/fedorello)! - A `parseAs` typed as a union with `undefined`, such as `"text" | undefined` passed on by a wrapper,
|
|
17
|
+
now types `data` as both bodies (`string` or the JSON body). It gave the JSON body only, while the
|
|
18
|
+
client reads the body as text when `parseAs` is `"text"`. `undefined` stays the default `"json"`.
|
|
19
|
+
|
|
20
|
+
## 1.0.0-rc.9
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- [#112](https://github.com/openapi-typesafe/openapi-typesafe/pull/112) [`05886b5`](https://github.com/openapi-typesafe/openapi-typesafe/commit/05886b5b8fdbb832f58abd12b9f8c741b0c73ad2) Thanks [@fedorello](https://github.com/fedorello)! - An error body is parsed as JSON only when its `Content-Type` is a JSON media type (`json` or a
|
|
25
|
+
`+json` suffix), or when the response has no `Content-Type` and the body is JSON. Any other error
|
|
26
|
+
body, such as `text/plain` or HTML, is returned as text, as its `string` type says. A `text/plain`
|
|
27
|
+
error body `429`, `true`, `0` or `null` came back as a number, a boolean or `null`, and with `0`
|
|
28
|
+
or `null` the check `if (error)` was skipped. openapi-fetch parses every error body, so this
|
|
29
|
+
differs from it.
|
|
30
|
+
|
|
31
|
+
- [#112](https://github.com/openapi-typesafe/openapi-typesafe/pull/112) [`05886b5`](https://github.com/openapi-typesafe/openapi-typesafe/commit/05886b5b8fdbb832f58abd12b9f8c741b0c73ad2) Thanks [@fedorello](https://github.com/fedorello)! - Code that is generic in the path compiles again. `SuccessResponse`, `ErrorResponse`,
|
|
32
|
+
`ErrorResponseJSON` and the `data` and `error` of `FetchResponse` for `Paths[Path]` gave the whole
|
|
33
|
+
`responses` map next to the response bodies, so assigning them to the bodies failed with TS2322.
|
|
34
|
+
They give the bodies now. This also fixes the error type of hook wrappers generic in the path.
|
|
35
|
+
|
|
36
|
+
- [#112](https://github.com/openapi-typesafe/openapi-typesafe/pull/112) [`05886b5`](https://github.com/openapi-typesafe/openapi-typesafe/commit/05886b5b8fdbb832f58abd12b9f8c741b0c73ad2) Thanks [@fedorello](https://github.com/fedorello)! - Every optional option of `createClient()` and of a request accepts `undefined` in its type, not
|
|
37
|
+
only the members of `querySerializer`: `baseUrl`, `fetch`, `Request`, `FormData`,
|
|
38
|
+
`querySerializer`, `bodySerializer`, `pathSerializer`, `headers`, `requestInitExt`, `parseAs`,
|
|
39
|
+
`middleware` and `params`. The client already counted `undefined` as left out, so a wrapper that
|
|
40
|
+
passes its own optional options on now compiles with `exactOptionalPropertyTypes`.
|
|
41
|
+
|
|
42
|
+
## 1.0.0-rc.8
|
|
43
|
+
|
|
44
|
+
### Patch Changes
|
|
45
|
+
|
|
46
|
+
- [#103](https://github.com/openapi-typesafe/openapi-typesafe/pull/103) [`091b864`](https://github.com/openapi-typesafe/openapi-typesafe/commit/091b864cdb6dd9e1ff5810d4d44cebee8a01a721) Thanks [@fedorello](https://github.com/fedorello)! - `createClient<any>()` types `data` and `error` as `any` again; they were `never`, so
|
|
47
|
+
`if (error)` made the whole result `never`. `SuccessResponse<any>` and `ErrorResponse<any>` are
|
|
48
|
+
`any` too.
|
|
49
|
+
|
|
50
|
+
- [#103](https://github.com/openapi-typesafe/openapi-typesafe/pull/103) [`091b864`](https://github.com/openapi-typesafe/openapi-typesafe/commit/091b864cdb6dd9e1ff5810d4d44cebee8a01a721) Thanks [@fedorello](https://github.com/fedorello)! - Response types follow what the client returns. `ErrorResponseJSON`, `SuccessResponseJSON` and the
|
|
51
|
+
`data` and `error` of a client made with ``createClient<paths, `${string}/json`>()`` keep a
|
|
52
|
+
JSON body of any JSON media type: an `application/problem+json` error, an
|
|
53
|
+
`application/vnd.api+json` success and `application/json; charset=utf-8` bodies were left out,
|
|
54
|
+
so the error could be `never` or miss a status. An error that is not JSON, such as the HTML page
|
|
55
|
+
of a proxy, is typed `string`, the text the client returns, instead of being left out.
|
|
56
|
+
|
|
57
|
+
- [#103](https://github.com/openapi-typesafe/openapi-typesafe/pull/103) [`091b864`](https://github.com/openapi-typesafe/openapi-typesafe/commit/091b864cdb6dd9e1ff5810d4d44cebee8a01a721) Thanks [@fedorello](https://github.com/fedorello)! - Every `querySerializer` option accepts `undefined` in its type, so a wrapper that passes its own
|
|
58
|
+
optional option on (`{ array: { explode: options.explode } }`) compiles with
|
|
59
|
+
`exactOptionalPropertyTypes`.
|
|
60
|
+
|
|
61
|
+
- [#103](https://github.com/openapi-typesafe/openapi-typesafe/pull/103) [`091b864`](https://github.com/openapi-typesafe/openapi-typesafe/commit/091b864cdb6dd9e1ff5810d4d44cebee8a01a721) Thanks [@fedorello](https://github.com/fedorello)! - `serializeArrayParam` and `serializeObjectParam` with a nested value in a path style (`simple`,
|
|
62
|
+
`label`, `matrix`) name `pathSerializer()` in their error, also inside your own `pathSerializer`,
|
|
63
|
+
instead of `querySerializer()`.
|
|
64
|
+
|
|
65
|
+
## 1.0.0-rc.7
|
|
66
|
+
|
|
67
|
+
### Patch Changes
|
|
68
|
+
|
|
69
|
+
- [#96](https://github.com/openapi-typesafe/openapi-typesafe/pull/96) [`171fa71`](https://github.com/openapi-typesafe/openapi-typesafe/commit/171fa71311107e4e26a9ae7a62b431662fb13de5) Thanks [@fedorello](https://github.com/fedorello)! - `SuccessResponseJSON`, `ErrorResponseJSON` and the `data` and `error` of a client made with
|
|
70
|
+
``createClient<paths, `${string}/json`>()`` leave out a response that has no JSON media type. It
|
|
71
|
+
added its whole `content` map, so a `text/html` 500 typed the error as `{ "text/html": string }`,
|
|
72
|
+
a value the client never returns.
|
|
73
|
+
|
|
74
|
+
- [#96](https://github.com/openapi-typesafe/openapi-typesafe/pull/96) [`171fa71`](https://github.com/openapi-typesafe/openapi-typesafe/commit/171fa71311107e4e26a9ae7a62b431662fb13de5) Thanks [@fedorello](https://github.com/fedorello)! - A nested array or object in a path parameter (`{ id: [[1]] }`) now fails with an error that names
|
|
75
|
+
`pathSerializer()`, the option that sends such values. It told you to write a `querySerializer()`,
|
|
76
|
+
which does not apply to the path.
|
|
77
|
+
|
|
78
|
+
- [#96](https://github.com/openapi-typesafe/openapi-typesafe/pull/96) [`171fa71`](https://github.com/openapi-typesafe/openapi-typesafe/commit/171fa71311107e4e26a9ae7a62b431662fb13de5) Thanks [@fedorello](https://github.com/fedorello)! - A request's `querySerializer` option set to `undefined` (`{ array: { explode: undefined } }`, as a
|
|
79
|
+
wrapper passes its own optional option on) now takes the client's value, as an option left out
|
|
80
|
+
does. It replaced the client's value, so the default style was sent.
|
|
81
|
+
|
|
82
|
+
## 1.0.0-rc.6
|
|
83
|
+
|
|
84
|
+
### Patch Changes
|
|
85
|
+
|
|
86
|
+
- [#87](https://github.com/openapi-typesafe/openapi-typesafe/pull/87) [`dfb0fe3`](https://github.com/openapi-typesafe/openapi-typesafe/commit/dfb0fe3c61a75d2b8ca512577f4b699049171a64) Thanks [@fedorello](https://github.com/fedorello)! - Leave out `null` and `undefined` items and members of arrays and objects in every parameter style, also in the path and headers (`ids=1,null`, `filter=owner,undefined` and `x-p: a,,b,1` were sent before), and default `explode` to `true` for the `form` query style only, as OpenAPI does, so `{ array: { style: "pipeDelimited" } }` sends `id=3|4|5`. A nested value in a header parameter now fails with an error that names header parameters, not `querySerializer()`.
|
|
87
|
+
|
|
88
|
+
## 1.0.0-rc.5
|
|
89
|
+
|
|
90
|
+
### Minor Changes
|
|
91
|
+
|
|
92
|
+
- [#68](https://github.com/openapi-typesafe/openapi-typesafe/pull/68) [`0f0792b`](https://github.com/openapi-typesafe/openapi-typesafe/commit/0f0792b8efa4f5139653cd285455f7d6165ddb95) Thanks [@fedorello](https://github.com/fedorello)! - A `FormData`, `Blob`, `File` or `ReadableStream` body from `undici` or another realm (an iframe) is
|
|
93
|
+
sent as it is: the client told a body by `instanceof`, so it JSON-encoded one of another class as
|
|
94
|
+
`{}`. `createClient` takes a `FormData` class next to `Request`: a multipart body is built with it,
|
|
95
|
+
and a FormData body of another class is copied into one of it, since undici's `Request` read the
|
|
96
|
+
platform's FormData as the text `[object FormData]`. With undici, pass
|
|
97
|
+
`createClient({ fetch, Request, FormData })` from the package. An instance of the platform's own
|
|
98
|
+
global class is still sent as it is, so the FormData, Blob and URLSearchParams of React Native and
|
|
99
|
+
the Blob and File of jsdom 20 (Jest 29), which have no type tag or no `arrayBuffer`, keep working.
|
|
100
|
+
|
|
101
|
+
- [#67](https://github.com/openapi-typesafe/openapi-typesafe/pull/67) [`fbaded2`](https://github.com/openapi-typesafe/openapi-typesafe/commit/fbaded241385d032d5b28d2c93d5e0a7d6ae292b) Thanks [@fedorello](https://github.com/fedorello)! - The client has a read-only `baseUrl`: the `baseUrl` option without its trailing slash, or `""`.
|
|
102
|
+
|
|
103
|
+
### Patch Changes
|
|
104
|
+
|
|
105
|
+
- [#68](https://github.com/openapi-typesafe/openapi-typesafe/pull/68) [`0f0792b`](https://github.com/openapi-typesafe/openapi-typesafe/commit/0f0792b8efa4f5139653cd285455f7d6165ddb95) Thanks [@fedorello](https://github.com/fedorello)! - An empty success body read with `parseAs: "text"`, `"blob"`, `"arrayBuffer"` or `"stream"` gives
|
|
106
|
+
`""`, an empty `Blob` or `ArrayBuffer`, or `response.body`, as its type says. A 204, an answer to
|
|
107
|
+
HEAD or a `Content-Length: 0` gave `undefined`, while the same empty body without a length gave
|
|
108
|
+
`""`. With the default `parseAs: "json"` an empty body is still `undefined`.
|
|
109
|
+
|
|
110
|
+
- [#68](https://github.com/openapi-typesafe/openapi-typesafe/pull/68) [`0f0792b`](https://github.com/openapi-typesafe/openapi-typesafe/commit/0f0792b8efa4f5139653cd285455f7d6165ddb95) Thanks [@fedorello](https://github.com/fedorello)! - `params.header` values are written in the `simple` style, the only style OpenAPI has for headers:
|
|
111
|
+
a `Date` as ISO 8601 (it was local time), an array as `a,b` (it was `a, b`) and an object as
|
|
112
|
+
`role,admin` (it was `[object Object]`), not percent-encoded, also in the names. A nested object or
|
|
113
|
+
array inside one throws, as in the query. An empty array or object sends no header, and `null`
|
|
114
|
+
still removes one.
|
|
115
|
+
|
|
116
|
+
- [#68](https://github.com/openapi-typesafe/openapi-typesafe/pull/68) [`0f0792b`](https://github.com/openapi-typesafe/openapi-typesafe/commit/0f0792b8efa4f5139653cd285455f7d6165ddb95) Thanks [@fedorello](https://github.com/fedorello)! - A form or multipart `Content-Type` with spaces or tabs before its parameters
|
|
117
|
+
(`application/x-www-form-urlencoded ; charset=utf-8`, RFC 9110 OWS) gives form data or `FormData`
|
|
118
|
+
again, in the runtime and in the result type of `defaultBodySerializer`; the object was sent as
|
|
119
|
+
JSON. The JSON check already took them.
|
|
120
|
+
|
|
121
|
+
- [#68](https://github.com/openapi-typesafe/openapi-typesafe/pull/68) [`0f0792b`](https://github.com/openapi-typesafe/openapi-typesafe/commit/0f0792b8efa4f5139653cd285455f7d6165ddb95) Thanks [@fedorello](https://github.com/fedorello)! - `style` and `explode` of the `array` and `object` options of `QuerySerializerOptions` are optional,
|
|
122
|
+
and one left out takes the client's value, else its default (`form` or `deepObject`, exploded): a
|
|
123
|
+
request's `{ array: { explode: false } }` keeps the client's `style`. `onError` may return an
|
|
124
|
+
`Error` of another realm (an iframe, `node:vm`); it was rejected as not an error.
|
|
125
|
+
|
|
126
|
+
- [#68](https://github.com/openapi-typesafe/openapi-typesafe/pull/68) [`0f0792b`](https://github.com/openapi-typesafe/openapi-typesafe/commit/0f0792b8efa4f5139653cd285455f7d6165ddb95) Thanks [@fedorello](https://github.com/fedorello)! - The query of a request whose path template has a fragment (`/docs#intro`) goes before the
|
|
127
|
+
fragment, joined with a query the template already has. It was added after the `#`, where it is
|
|
128
|
+
part of the fragment, so `fetch` never sent it.
|
|
129
|
+
|
|
130
|
+
- [#75](https://github.com/openapi-typesafe/openapi-typesafe/pull/75) [`a74608e`](https://github.com/openapi-typesafe/openapi-typesafe/commit/a74608ec36b0a938594e0d0fac10c9fb222c1742) Thanks [@fedorello](https://github.com/fedorello)! - `Readable` and `Writable` find the `$Read` and `$Write` properties of an object with an index
|
|
131
|
+
signature (`additionalProperties`). The keys were read through the index signature, so no
|
|
132
|
+
property was marked: a request body required the `readOnly` `id`, and a response kept the
|
|
133
|
+
`writeOnly` password. The helper types that `--read-write-markers` writes are fixed the same way.
|
|
134
|
+
|
|
135
|
+
- [#68](https://github.com/openapi-typesafe/openapi-typesafe/pull/68) [`0f0792b`](https://github.com/openapi-typesafe/openapi-typesafe/commit/0f0792b8efa4f5139653cd285455f7d6165ddb95) Thanks [@fedorello](https://github.com/fedorello)! - A response is typed as data or an error by the first digit of its status, as `response.ok` reads
|
|
136
|
+
it: a declared 205, 208 or 226 types `data` with its body, and a 419, a 3XX (read with
|
|
137
|
+
`redirect: "manual"`) or a 1XX types `error` with its body.
|
|
138
|
+
The types classified by two closed lists of statuses, `OkStatus` and `ErrorStatus`, which stay
|
|
139
|
+
exported. New helper types `SuccessStatusKey` and `ErrorStatusKey` name the statuses of each kind.
|
|
140
|
+
|
|
141
|
+
## 1.0.0-rc.4
|
|
142
|
+
|
|
143
|
+
### Minor Changes
|
|
144
|
+
|
|
145
|
+
- [#48](https://github.com/openapi-typesafe/openapi-typesafe/pull/48) [`cff72cd`](https://github.com/openapi-typesafe/openapi-typesafe/commit/cff72cd19bf7a68429f302e0ece79304fcb6ba5c) Thanks [@fedorello](https://github.com/fedorello)! - The client declares the helper types (`PathsWithMethod`, `FilterKeys`, `SuccessResponse`, …) in
|
|
146
|
+
its `openapi-typesafe-fetch/helpers` entry, and `openapi-typesafe-helpers` re-exports them. The
|
|
147
|
+
names of both packages are one declaration, so they mix, also in generic code: `Readable<T>` of one
|
|
148
|
+
package fits `Readable<T>` of the other. A library built with `declaration: true` under pnpm or
|
|
149
|
+
Yarn PnP that uses the client gets declarations that name `openapi-typesafe-fetch/helpers`, of a
|
|
150
|
+
package it depends on, under every `moduleResolution` (also `node10`): no TS2742 ("cannot be
|
|
151
|
+
named without a reference to …/openapi-typesafe-helpers") under pnpm, and no `import("openapi-typesafe-helpers")` that its users
|
|
152
|
+
cannot resolve under Yarn PnP. openapi-fetch fails the same way. The main entry exports the names
|
|
153
|
+
of openapi-fetch and no helper type, so `export type * from "openapi-typesafe-fetch"` next to a
|
|
154
|
+
type of the same name still compiles. The client no longer depends on `openapi-typesafe-helpers`,
|
|
155
|
+
so it has no runtime dependency.
|
|
156
|
+
|
|
157
|
+
### Patch Changes
|
|
158
|
+
|
|
159
|
+
- [#40](https://github.com/openapi-typesafe/openapi-typesafe/pull/40) [`bc4d41d`](https://github.com/openapi-typesafe/openapi-typesafe/commit/bc4d41d870d13fdb5eb1303744e5235308cdc2bb) Thanks [@fedorello](https://github.com/fedorello)! - A `Date` in an exploded query array or object (the default styles) is sent as ISO 8601
|
|
160
|
+
(`toISOString()`); openapi-fetch threw "Deeply-nested arrays/objects aren't supported". A `Date`
|
|
161
|
+
field of a `multipart/form-data` body is sent as ISO 8601 too. The places where openapi-fetch left
|
|
162
|
+
a `Date` out or sent it as a local time text are listed under Major Changes.
|
|
163
|
+
|
|
164
|
+
- [#47](https://github.com/openapi-typesafe/openapi-typesafe/pull/47) [`1c8af0d`](https://github.com/openapi-typesafe/openapi-typesafe/commit/1c8af0dc371ae8be5b595b055ee1ebc53916088f) Thanks [@fedorello](https://github.com/fedorello)! - `randomID`, exported at runtime as in openapi-fetch, is declared (`randomID(): string`) and listed
|
|
165
|
+
in the API docs, so TypeScript code can import it.
|
|
166
|
+
|
|
167
|
+
- [#61](https://github.com/openapi-typesafe/openapi-typesafe/pull/61) [`2afc816`](https://github.com/openapi-typesafe/openapi-typesafe/commit/2afc816881dab23d3dd8fe4d1a2d20456dd917f8) Thanks [@fedorello](https://github.com/fedorello)! - A `FormData` that `defaultBodySerializer` built gets the platform's boundary also when another
|
|
168
|
+
copy of the package built it, such as the CommonJS build next to the ES module build in one
|
|
169
|
+
application. A `bodySerializer` that wrapped the default one of the other build kept a boundary
|
|
170
|
+
set by hand, and the server could not split the parts. The form is marked with the registered
|
|
171
|
+
symbol `Symbol.for("openapi-typesafe-fetch/form")`, which is not a form field.
|
|
172
|
+
|
|
173
|
+
- [#40](https://github.com/openapi-typesafe/openapi-typesafe/pull/40) [`bc4d41d`](https://github.com/openapi-typesafe/openapi-typesafe/commit/bc4d41d870d13fdb5eb1303744e5235308cdc2bb) Thanks [@fedorello](https://github.com/fedorello)! - A success body that is not JSON, such as the HTML page of a proxy, throws a `SyntaxError` that
|
|
174
|
+
names the status, the `Content-Type` and the length of the body and says which `parseAs` to set
|
|
175
|
+
(`parseAs: "text"` for a `text/*` response), instead of a bare parser error. The error holds no
|
|
176
|
+
body text, which can be a secret such as an OAuth token: the parser's error, whose message quotes
|
|
177
|
+
the body, is not kept as `cause` either.
|
|
178
|
+
|
|
179
|
+
- [#47](https://github.com/openapi-typesafe/openapi-typesafe/pull/47) [`1c8af0d`](https://github.com/openapi-typesafe/openapi-typesafe/commit/1c8af0dc371ae8be5b595b055ee1ebc53916088f) Thanks [@fedorello](https://github.com/fedorello)! - A `ReadableStream` body, or an async iterable such as a Node.js `Readable`
|
|
180
|
+
(`fs.createReadStream()`), is sent as a stream, with the `duplex: "half"` option that the Fetch
|
|
181
|
+
standard requires for it. It was JSON-encoded (to `{}`, or to the internal fields of a `Readable`)
|
|
182
|
+
with a JSON `Content-Type`, so a streamed upload was lost without an error.
|
|
183
|
+
The declarations name the async iterable type with `/// <reference lib="es2018.asynciterable" />`,
|
|
184
|
+
so a project whose `lib` is older than ES2018 still compiles.
|
|
185
|
+
|
|
186
|
+
- [#48](https://github.com/openapi-typesafe/openapi-typesafe/pull/48) [`cff72cd`](https://github.com/openapi-typesafe/openapi-typesafe/commit/cff72cd19bf7a68429f302e0ece79304fcb6ba5c) Thanks [@fedorello](https://github.com/fedorello)! - A call with a union of paths (`client.GET(path)` with `path: "/a" | "/b"`) types `data` and
|
|
187
|
+
`error` as the union of each operation's types. In openapi-fetch a path without a response body
|
|
188
|
+
typed `data` as its content map, and a path with only a `default` response typed it `undefined`.
|
|
189
|
+
`SuccessResponse` and `ErrorResponse` of a union of response maps are the union of each map's
|
|
190
|
+
responses.
|
|
191
|
+
|
|
192
|
+
## 1.0.0-rc.3
|
|
193
|
+
|
|
194
|
+
### Patch Changes
|
|
195
|
+
|
|
196
|
+
- Updated dependencies []:
|
|
197
|
+
- openapi-typesafe-helpers@1.0.0-rc.3
|
|
198
|
+
|
|
199
|
+
## 1.0.0-rc.2
|
|
200
|
+
|
|
201
|
+
### Major Changes
|
|
202
|
+
|
|
203
|
+
- [#18](https://github.com/openapi-typesafe/openapi-typesafe/pull/18) [`bfd3e60`](https://github.com/openapi-typesafe/openapi-typesafe/commit/bfd3e605bdbe240d7a8a327a59d8924781016fbd) Thanks [@fedorello](https://github.com/fedorello)! - First stable release of openapi-typesafe-fetch, the successor of openapi-fetch 0.17 with the same
|
|
204
|
+
API: change the import from `openapi-fetch`. A library that imports `openapi-fetch` itself, such as
|
|
205
|
+
swr-openapi, needs it aliased to this package
|
|
206
|
+
([how](https://openapi-typesafe.github.io/openapi-typesafe/fetch/#libraries-built-on-openapi-fetch)). From 1.0 the package follows semver.
|
|
207
|
+
|
|
208
|
+
Changes that can need work when you move from openapi-fetch 0.17:
|
|
209
|
+
- `engines.node` is `>=22` (server code; browsers are not affected).
|
|
210
|
+
- `Blob`, `File`, `ArrayBuffer`, typed array and `URLSearchParams` bodies are sent as they are; they
|
|
211
|
+
were JSON-encoded to `{}`.
|
|
212
|
+
- An object body with `Content-Type: multipart/form-data` is sent as `FormData`, not JSON.
|
|
213
|
+
- A string body with a non-JSON `Content-Type` is sent as is, without JSON quotes (upstream
|
|
214
|
+
[#2555](https://github.com/openapi-ts/openapi-typescript/issues/2555), [#2382](https://github.com/openapi-ts/openapi-typescript/issues/2382)).
|
|
215
|
+
- A nested object in a form or multipart body throws; write a `bodySerializer` for it.
|
|
216
|
+
- Query parameter names and object keys are percent-encoded like values (`[ ] $ : @ ,` stay).
|
|
217
|
+
- A path parameter that makes a `.` or `..` segment, or a path that starts with `//`, rejects
|
|
218
|
+
before `fetch` is called (upstream [#2483](https://github.com/openapi-ts/openapi-typescript/issues/2483)).
|
|
219
|
+
- A path that already has a query string gets `&` before `params.query`, not a second `?`.
|
|
220
|
+
- `defaultBodySerializer` declares its real return type instead of `string`; check
|
|
221
|
+
`typeof result === "string"` where you used the result as a string.
|
|
222
|
+
- `HttpMethod` includes `"query"`: a hand-written `Record<HttpMethod, …>` needs a `query` entry.
|
|
223
|
+
|
|
224
|
+
### Patch Changes
|
|
225
|
+
|
|
226
|
+
- [#15](https://github.com/openapi-typesafe/openapi-typesafe/pull/15) [`5837bac`](https://github.com/openapi-typesafe/openapi-typesafe/commit/5837baca3bbcd58bd132622d9a4723e97bc5a9bc) Thanks [@fedorello](https://github.com/fedorello)! - A form body with `; charset=UTF-8` is sent as a form, and its `null` fields are left out.
|
|
227
|
+
|
|
228
|
+
- [#15](https://github.com/openapi-typesafe/openapi-typesafe/pull/15) [`5837bac`](https://github.com/openapi-typesafe/openapi-typesafe/commit/5837baca3bbcd58bd132622d9a4723e97bc5a9bc) Thanks [@fedorello](https://github.com/fedorello)! - Headers given as a list of pairs (`[["x-t", "1"]]`) work.
|
|
229
|
+
|
|
230
|
+
- [#16](https://github.com/openapi-typesafe/openapi-typesafe/pull/16) [`cd79dbd`](https://github.com/openapi-typesafe/openapi-typesafe/commit/cd79dbd39d33dc913ec101a4c46560dff801da4e) Thanks [@fedorello](https://github.com/fedorello)! - Path values with `$'`, `` $` ``, `$&` or `$$` are sent as written.
|
|
231
|
+
- Updated dependencies [[`cd79dbd`](https://github.com/openapi-typesafe/openapi-typesafe/commit/cd79dbd39d33dc913ec101a4c46560dff801da4e), [`bfd3e60`](https://github.com/openapi-typesafe/openapi-typesafe/commit/bfd3e605bdbe240d7a8a327a59d8924781016fbd)]:
|
|
232
|
+
- openapi-typesafe-helpers@1.0.0-rc.2
|
|
233
|
+
|
|
234
|
+
## 1.0.0-rc.1
|
|
235
|
+
|
|
236
|
+
### Patch Changes
|
|
237
|
+
|
|
238
|
+
- [#9](https://github.com/openapi-typesafe/openapi-typesafe/pull/9) [`14494f5`](https://github.com/openapi-typesafe/openapi-typesafe/commit/14494f5553575d15ad8f4d54f59ddabddb3a3e01) Thanks [@fedorello](https://github.com/fedorello)! - `createClient<any>()` no longer requires an init argument: `client.GET("/users/me")` compiles.
|
|
239
|
+
`RequestBodyOption<any>` was `{ body?: never } | { body: any }`, so `body` counted as required
|
|
240
|
+
(upstream [#2526](https://github.com/openapi-typesafe/openapi-typesafe/issues/2526)). It is now `{ body?: any }`.
|
|
241
|
+
|
|
242
|
+
- [#11](https://github.com/openapi-typesafe/openapi-typesafe/pull/11) [`578bd5d`](https://github.com/openapi-typesafe/openapi-typesafe/commit/578bd5df6e6937cc3a8870a78ff84bfa6837f0b7) Thanks [@fedorello](https://github.com/fedorello)! - The CommonJS declarations (`dist/index.d.cts`) now say what `require()` returns, as in
|
|
243
|
+
openapi-fetch and openapi-react-query they did not. For the fetch client it is
|
|
244
|
+
`{ default, ...named }`: `import createClient = require("openapi-typesafe-fetch")` type-checked
|
|
245
|
+
and then failed at runtime with "createClient is not a function"; use `.default` or a default
|
|
246
|
+
import. For the react-query client it is `createClient` itself; the exported types next to its
|
|
247
|
+
`export =` were an error (TS2309) with `skipLibCheck: false`, and are now in a namespace merged with
|
|
248
|
+
the function, so `import type { QueryKey } from "openapi-typesafe-react-query"` still works. Default
|
|
249
|
+
imports and ES modules do not change.
|
|
250
|
+
|
|
251
|
+
- [#9](https://github.com/openapi-typesafe/openapi-typesafe/pull/9) [`14494f5`](https://github.com/openapi-typesafe/openapi-typesafe/commit/14494f5553575d15ad8f4d54f59ddabddb3a3e01) Thanks [@fedorello](https://github.com/fedorello)! - An operation that declares no 2XX response types `data` with its `default` response, which covers
|
|
252
|
+
every undeclared status, successes too. `data` was `never` (upstream [#1862](https://github.com/openapi-typesafe/openapi-typesafe/issues/1862)). `SuccessResponse`
|
|
253
|
+
follows the same rule. With a 2XX response declared, `default` still types only `error`.
|
|
254
|
+
|
|
255
|
+
- [#9](https://github.com/openapi-typesafe/openapi-typesafe/pull/9) [`14494f5`](https://github.com/openapi-typesafe/openapi-typesafe/commit/14494f5553575d15ad8f4d54f59ddabddb3a3e01) Thanks [@fedorello](https://github.com/fedorello)! - Middleware may return a `Request` or `Response` from the `undici` package, from another realm (an
|
|
256
|
+
iframe, an Electron host) or of a custom `Request` class. They are recognized by their members, not
|
|
257
|
+
by `instanceof`, which rejected them with "onRequest: must return new Request()" (upstream [#1847](https://github.com/openapi-typesafe/openapi-typesafe/issues/1847)):
|
|
258
|
+
a `Request` by its `method`, `url` and `headers`, a `Response` by its `status` and `headers`.
|
|
259
|
+
`Headers` from the `undici` package passed as `headers` are no longer dropped.
|
|
260
|
+
|
|
261
|
+
- [#9](https://github.com/openapi-typesafe/openapi-typesafe/pull/9) [`14494f5`](https://github.com/openapi-typesafe/openapi-typesafe/commit/14494f5553575d15ad8f4d54f59ddabddb3a3e01) Thanks [@fedorello](https://github.com/fedorello)! - With a schema of hundreds of paths, a call with a wrong path reports the path and the editor
|
|
262
|
+
completes paths on TypeScript 5.4 to 6.0. It gave "Type instantiation is excessively deep and
|
|
263
|
+
possibly infinite" (TS2589) and no completion (upstream [#1882](https://github.com/openapi-typesafe/openapi-typesafe/issues/1882)): the init type of all operations
|
|
264
|
+
of the method was one deep type, and is now computed per operation. The type matrix checks this
|
|
265
|
+
with the GitHub schema on every supported TypeScript version.
|
|
266
|
+
|
|
267
|
+
- [#9](https://github.com/openapi-typesafe/openapi-typesafe/pull/9) [`14494f5`](https://github.com/openapi-typesafe/openapi-typesafe/commit/14494f5553575d15ad8f4d54f59ddabddb3a3e01) Thanks [@fedorello](https://github.com/fedorello)! - `Parameters<typeof $api.queryOptions>` (and of `useQuery`, `useSuspenseQuery` and the fetch
|
|
268
|
+
client's `request`) takes the arguments of every operation; its path was `never` (upstream [#2178](https://github.com/openapi-typesafe/openapi-typesafe/issues/2178)).
|
|
269
|
+
`PathsWithMethod<paths, HttpMethod>` is now every path that has some method; a known method or set
|
|
270
|
+
of methods still gives the paths that have each of them, as before. Code that is generic in the
|
|
271
|
+
paths, such as swr-openapi's hooks, compiles as with openapi-typescript's helpers. The init in those parameters is required when some operation
|
|
272
|
+
requires one (`IsInitOptional`), so a helper passes `{}` for a path that needs none. A single call
|
|
273
|
+
is checked as before, also with a union of paths or methods.
|
|
274
|
+
`ReturnType` of these generic functions stays `any`; the `queryOptions` docs show what to use.
|
|
275
|
+
|
|
276
|
+
- [#9](https://github.com/openapi-typesafe/openapi-typesafe/pull/9) [`14494f5`](https://github.com/openapi-typesafe/openapi-typesafe/commit/14494f5553575d15ad8f4d54f59ddabddb3a3e01) Thanks [@fedorello](https://github.com/fedorello)! - The method types take the generated `interface paths`: `UseQueryMethod`, `UseSuspenseQueryMethod`,
|
|
277
|
+
`UseInfiniteQueryMethod`, `UseMutationMethod`, `QueryOptionsFunction`, `QueryKey`,
|
|
278
|
+
`InfiniteQueryKey`, `ClientMethod` and `ClientRequestMethod` required
|
|
279
|
+
`Record<string, Record<HttpMethod, {}>>`, which an interface does not satisfy (TS2344, upstream
|
|
280
|
+
[#2267](https://github.com/openapi-typesafe/openapi-typesafe/issues/2267)). They now take any `Paths`, like `OpenapiQueryClient` and `Client`. `PathOperation` is the
|
|
281
|
+
new exported lookup of an operation; `MaybeOptionalInit` takes any key as its location.
|
|
282
|
+
|
|
283
|
+
- [#9](https://github.com/openapi-typesafe/openapi-typesafe/pull/9) [`14494f5`](https://github.com/openapi-typesafe/openapi-typesafe/commit/14494f5553575d15ad8f4d54f59ddabddb3a3e01) Thanks [@fedorello](https://github.com/fedorello)! - `createClient` and `createPathBasedClient` accept `fetch` and `Request` of another Fetch API
|
|
284
|
+
implementation, such as the `undici` package (upstream [#2562](https://github.com/openapi-typesafe/openapi-typesafe/issues/2562)). Their types are not the DOM lib's,
|
|
285
|
+
so an overload with `OtherFetchClientOptions` checks only that `fetch` returns a promise and
|
|
286
|
+
`Request` is a class. An inline `fetch` still gets a typed `Request` input.
|
|
287
|
+
- Updated dependencies [[`14494f5`](https://github.com/openapi-typesafe/openapi-typesafe/commit/14494f5553575d15ad8f4d54f59ddabddb3a3e01), [`14494f5`](https://github.com/openapi-typesafe/openapi-typesafe/commit/14494f5553575d15ad8f4d54f59ddabddb3a3e01)]:
|
|
288
|
+
- openapi-typesafe-helpers@1.0.0-rc.1
|
|
289
|
+
|
|
290
|
+
## 1.0.0-rc.0
|
|
291
|
+
|
|
292
|
+
### Minor Changes
|
|
293
|
+
|
|
294
|
+
- [`551c058`](https://github.com/openapi-typesafe/openapi-typesafe/commit/551c05889d32eaf1d328111e5c4d167e0337e5a4) Thanks [@fedorello](https://github.com/fedorello)! - The OpenAPI 3.2 `QUERY` method: `HttpMethod` includes `"query"`, the fetch client has
|
|
295
|
+
`client.QUERY(url, { body })` (also through `request("query", …)` and the path-based client), and
|
|
296
|
+
the react-query hooks accept `"query"`. A `Record<HttpMethod, …>` written by hand needs a `query`
|
|
297
|
+
entry. The path-based client maps only HTTP method keys, so `parameters` no longer shows up as a
|
|
298
|
+
`PARAMETERS()` call that always failed.
|
|
299
|
+
|
|
300
|
+
### Patch Changes
|
|
301
|
+
|
|
302
|
+
- [`16f572f`](https://github.com/openapi-typesafe/openapi-typesafe/commit/16f572fd582fbabe058abad2604ffb3299ddc97a) Thanks [@fedorello](https://github.com/fedorello)! - `defaultBodySerializer` recognizes headers from another JavaScript realm (an iframe, `node:vm`, Jest VM modules), so an `application/x-www-form-urlencoded` body is no longer sent as JSON there. Its type now declares the optional `headers` parameter. Fixes upstream [#2637](https://github.com/openapi-typesafe/openapi-typesafe/issues/2637).
|
|
303
|
+
|
|
304
|
+
- [`2b3671f`](https://github.com/openapi-typesafe/openapi-typesafe/commit/2b3671f126f78e24ead7ad785a55b79540ae9092) Thanks [@fedorello](https://github.com/fedorello)! - Middleware request ids come from a process-wide counter instead of `Math.random()`. Next.js prerendering rejected the random value as a side effect before uncached data. Ids stay unique, also across clients that share a middleware. Fixes upstream [#2486](https://github.com/openapi-typesafe/openapi-typesafe/issues/2486) (as [#2763](https://github.com/openapi-typesafe/openapi-typesafe/issues/2763) proposed).
|
|
305
|
+
|
|
306
|
+
- [`e49344a`](https://github.com/openapi-typesafe/openapi-typesafe/commit/e49344a208fb3bb38cd86f62c1395f8f7ca950f6) Thanks [@fedorello](https://github.com/fedorello)! - Packages contain only their build output, sources for source maps, the CLI, and the README, license and changelog. Coverage reports, local logs and tool configs are no longer packed.
|
|
307
|
+
|
|
308
|
+
- [`b775891`](https://github.com/openapi-typesafe/openapi-typesafe/commit/b775891e2ac748aeab4cb3106c1df44a0b7ddf30) Thanks [@kaigritun](https://github.com/kaigritun)! - fix(openapi-typesafe-fetch): handle empty error responses when Content-Length header is stripped
|
|
309
|
+
|
|
310
|
+
- [`bb9d754`](https://github.com/openapi-typesafe/openapi-typesafe/commit/bb9d754cbb4133ac1ae09f1a340af455f9482ecc) Thanks [@fedorello](https://github.com/fedorello)! - The error for an invalid middleware has a missing backtick back: "Middleware must be an object
|
|
311
|
+
with one of `onRequest()`, `onResponse()` or `onError()`".
|
|
312
|
+
|
|
313
|
+
- [`4091466`](https://github.com/openapi-typesafe/openapi-typesafe/commit/40914664dd3d9aba10c2720a78d226ba9355e5ba) Thanks [@fedorello](https://github.com/fedorello)! - An object body with `Content-Type: multipart/form-data` is now sent as `FormData`: one part per
|
|
314
|
+
field, a `Blob` or `File` as a file part, an array as one part per item. Before, it was
|
|
315
|
+
JSON-encoded, so every file upload needed its own `bodySerializer`. A `Content-Type` without a
|
|
316
|
+
`boundary` set by hand for a `FormData` body is dropped, so the platform sets the boundary and the
|
|
317
|
+
server can read the parts (openapi-typescript#1214). A nested object in such a body throws and
|
|
318
|
+
names `bodySerializer()`. See ADR-013, decision 10.
|
|
319
|
+
|
|
320
|
+
- [`3786df3`](https://github.com/openapi-typesafe/openapi-typesafe/commit/3786df3482727d6b728b7409ebc9ee8b66f3b97c) Thanks [@fedorello](https://github.com/fedorello)! - Query parameter names and object keys are now percent-encoded, like values. A key from your data,
|
|
321
|
+
such as the keys of an `additionalProperties` query object, could add a parameter (`a&admin`) or a
|
|
322
|
+
path segment (`a/b`). `[`, `]`, `$`, `:`, `@` and `,` stay as written, so `filter[status]` and
|
|
323
|
+
`$filter` are unchanged. See ADR-013, decision 9.
|
|
324
|
+
|
|
325
|
+
- [`77e1425`](https://github.com/openapi-typesafe/openapi-typesafe/commit/77e1425ac5b45833f2a69e12448056292f71803f) Thanks [@fedorello](https://github.com/fedorello)! - Request bodies that `fetch` sends as they are now go out unchanged, without a JSON `Content-Type`:
|
|
326
|
+
`Blob`, `File`, `URLSearchParams`, `ArrayBuffer` and typed arrays. Before, they were JSON-encoded to
|
|
327
|
+
`{}`, so a binary upload lost its data. A nested object in an `application/x-www-form-urlencoded`
|
|
328
|
+
body now throws instead of being sent as `[object Object]`, and a path that already has a query
|
|
329
|
+
string gets `&` instead of a second `?`. See ADR-013, decisions 6 to 8.
|
|
330
|
+
|
|
331
|
+
- [`4ddbce1`](https://github.com/openapi-typesafe/openapi-typesafe/commit/4ddbce1079976752abb426e79d27a744f9fe1cb3) Thanks [@fedorello](https://github.com/fedorello)! - `defaultPathSerializer` throws when a path parameter makes a `.` or `..` path segment, so a value like `..` can no longer move a request to another endpoint (path traversal). Such a request now rejects before `fetch` is called (ADR-013). Fixes upstream [#2483](https://github.com/openapi-typesafe/openapi-typesafe/issues/2483).
|
|
332
|
+
|
|
333
|
+
- [`f8ac0d6`](https://github.com/openapi-typesafe/openapi-typesafe/commit/f8ac0d6e8f35d317ccb41758b7a2f3dc1ecf1f87) Thanks [@fedorello](https://github.com/fedorello)! - A string request body is sent as is when the request sets a non-JSON `Content-Type` such as `text/plain`; before, it was JSON-encoded and got extra quotes. With a JSON `Content-Type`, or none, a string is still sent as a JSON string value (ADR-013). Fixes upstream [#2555](https://github.com/openapi-typesafe/openapi-typesafe/issues/2555), [#2382](https://github.com/openapi-typesafe/openapi-typesafe/issues/2382).
|
|
334
|
+
- Updated dependencies [[`e49344a`](https://github.com/openapi-typesafe/openapi-typesafe/commit/e49344a208fb3bb38cd86f62c1395f8f7ca950f6), [`551c058`](https://github.com/openapi-typesafe/openapi-typesafe/commit/551c05889d32eaf1d328111e5c4d167e0337e5a4), [`63275f8`](https://github.com/openapi-typesafe/openapi-typesafe/commit/63275f86ff7ba855338f09f87fb9567c8ed91300), [`d5dcbb3`](https://github.com/openapi-typesafe/openapi-typesafe/commit/d5dcbb3f38e4d583334977c50db92461085d4a11)]:
|
|
335
|
+
- openapi-typesafe-helpers@1.0.0-rc.0
|
|
336
|
+
|
|
337
|
+
## 0.17.0
|
|
338
|
+
|
|
339
|
+
### Minor Changes
|
|
340
|
+
|
|
341
|
+
- [#2549](https://github.com/openapi-ts/openapi-typescript/pull/2549) [`a690e52`](https://github.com/openapi-ts/openapi-typescript/commit/a690e526b7693479bc2f2f002d71a020fa5e4e16) Thanks [@abumalick](https://github.com/abumalick)! - Add readOnly/writeOnly support via `--read-write-markers` flag. When enabled, readOnly properties are wrapped with `$Read<T>` and writeOnly properties with `$Write<T>`. openapi-fetch uses `Readable<T>` and `Writable<T>` helpers to exclude these properties from responses and request bodies respectively.
|
|
342
|
+
|
|
343
|
+
### Patch Changes
|
|
344
|
+
|
|
345
|
+
- [#2572](https://github.com/openapi-ts/openapi-typescript/pull/2572) [`9350ddf`](https://github.com/openapi-ts/openapi-typescript/commit/9350ddfcd44b661a5288667ebfcf298868dd9784) Thanks [@luis-guideti](https://github.com/luis-guideti)! - Do not treat Content-Length=0 as empty when Transfer-Encoding is chunked
|
|
346
|
+
|
|
347
|
+
- Updated dependencies [[`a690e52`](https://github.com/openapi-ts/openapi-typescript/commit/a690e526b7693479bc2f2f002d71a020fa5e4e16)]:
|
|
348
|
+
- openapi-typescript-helpers@0.1.0
|
|
349
|
+
|
|
350
|
+
## 0.16.0
|
|
351
|
+
|
|
352
|
+
### Minor Changes
|
|
353
|
+
|
|
354
|
+
- [#2362](https://github.com/openapi-ts/openapi-typescript/pull/2362) [`9002418`](https://github.com/openapi-ts/openapi-typescript/commit/90024185c7a251b5dbedd148e4eb5d15b95409c8) Thanks [@luxass](https://github.com/luxass)! - Added support for setting a custom path serializers either globally or per request. This allows you to customize how path parameters are serialized in the URL. E.g. you can use a custom serializer to prevent encoding of a path parameter, if you need to pass a value that should not be encoded.
|
|
355
|
+
|
|
356
|
+
## 0.15.2
|
|
357
|
+
|
|
358
|
+
### Patch Changes
|
|
359
|
+
|
|
360
|
+
- [#2508](https://github.com/openapi-ts/openapi-typescript/pull/2508) [`89843b0`](https://github.com/openapi-ts/openapi-typescript/commit/89843b06296ac1b227cc27546009e79b3a749aaa) Thanks [@srbarba](https://github.com/srbarba)! - Use text() when no content-length is provided to avoid errors parsing empty bodies (200 with no content)
|
|
361
|
+
|
|
362
|
+
## 0.15.1
|
|
363
|
+
|
|
364
|
+
### Patch Changes
|
|
365
|
+
|
|
366
|
+
- [#2556](https://github.com/openapi-ts/openapi-typescript/pull/2556) [`36c0fb8`](https://github.com/openapi-ts/openapi-typescript/commit/36c0fb8a0504b27284843daaa9f49f80e2cfad0d) Thanks [@justAnArthur](https://github.com/justAnArthur)! - fix omit serializing for already serialized data
|
|
367
|
+
|
|
368
|
+
## 0.15.0
|
|
369
|
+
|
|
370
|
+
### Minor Changes
|
|
371
|
+
|
|
372
|
+
- [#2465](https://github.com/openapi-ts/openapi-typescript/pull/2465) [`8f96eb5`](https://github.com/openapi-ts/openapi-typescript/commit/8f96eb50f5ec060e2e9100e9a43d3fe98e9795c5) Thanks [@Kauabunga](https://github.com/Kauabunga)! - Enable request level middlewares option
|
|
373
|
+
|
|
374
|
+
## 0.14.1
|
|
375
|
+
|
|
376
|
+
### Patch Changes
|
|
377
|
+
|
|
378
|
+
- [#2407](https://github.com/openapi-ts/openapi-typescript/pull/2407) [`7527d1e`](https://github.com/openapi-ts/openapi-typescript/commit/7527d1e7502cd1e9621922f028b4736d85f25800) Thanks [@jthacker](https://github.com/jthacker)! - Fix Request parameter being ignored by client methods
|
|
379
|
+
|
|
380
|
+
## 0.14.0
|
|
381
|
+
|
|
382
|
+
### Minor Changes
|
|
383
|
+
|
|
384
|
+
- [#2310](https://github.com/openapi-ts/openapi-typescript/pull/2310) [`e66b5ce`](https://github.com/openapi-ts/openapi-typescript/commit/e66b5ce63bfcdc57c6ee942e5ed4e7667e64c290) Thanks [@drwpow](https://github.com/drwpow)! - Build package with unbuild. Also remove the minified version (openapi-fetch is only useful in a TypeScript/bundler environment, so there’s no sense in loading it from a CDN clientside).
|
|
385
|
+
|
|
386
|
+
## 0.13.8
|
|
387
|
+
|
|
388
|
+
### Patch Changes
|
|
389
|
+
|
|
390
|
+
- [#2096](https://github.com/openapi-ts/openapi-typescript/pull/2096) [`0058128`](https://github.com/openapi-ts/openapi-typescript/commit/0058128afa258180793ae2071022d89a688d8ddc) Thanks [@obulat](https://github.com/obulat)! - Encode the request body if `Content-Type` header is `x-www-form-urlencoded`
|
|
391
|
+
- [#2157](https://github.com/openapi-ts/openapi-typescript/pull/2157) [`419d9ac`](https://github.com/openapi-ts/openapi-typescript/commit/419d9ac6851cf780b81060ddc05c231c5225a17b) Thanks [@Rendez](https://github.com/Rendez)! - Fix overriding baseUrl per request without overriding default baseUrl
|
|
392
|
+
- [#2308](https://github.com/openapi-ts/openapi-typescript/pull/2308) [`81c031d`](https://github.com/openapi-ts/openapi-typescript/commit/81c031da8584ed49b033ebfc67bbb3e1ca258699) Thanks [@drwpow](https://github.com/drwpow)! - Improve header handling
|
|
393
|
+
|
|
394
|
+
## 0.13.7
|
|
395
|
+
|
|
396
|
+
### Patch Changes
|
|
397
|
+
|
|
398
|
+
- [#2256](https://github.com/openapi-ts/openapi-typescript/pull/2256) [`30c6da8`](https://github.com/openapi-ts/openapi-typescript/commit/30c6da800a00bda87da66dea6d04807e1379f06a) Thanks [@KajSzy](https://github.com/KajSzy)! - fix dynamic access to methods using wrapAsPathBasedClient
|
|
399
|
+
|
|
400
|
+
## 0.13.6
|
|
401
|
+
|
|
402
|
+
### Patch Changes
|
|
403
|
+
|
|
404
|
+
- [#2205](https://github.com/openapi-ts/openapi-typescript/pull/2205) [`4966560`](https://github.com/openapi-ts/openapi-typescript/commit/4966560790ad49fabb06d718115a82a779a5b74a) Thanks [@live-small](https://github.com/live-small)! - Fix HEAD method requests to prevent body parsing regardless of Content-Length header value
|
|
405
|
+
|
|
406
|
+
## 0.13.5
|
|
407
|
+
|
|
408
|
+
### Patch Changes
|
|
409
|
+
|
|
410
|
+
- [#2091](https://github.com/openapi-ts/openapi-typescript/pull/2091) [`ebe56f3`](https://github.com/openapi-ts/openapi-typescript/commit/ebe56f337561bfdd1bf1abdc56ba3d2f48c4d393) Thanks [@p-dubovitsky](https://github.com/p-dubovitsky)! - Allow returning Response from onRequest callback
|
|
411
|
+
|
|
412
|
+
## 0.13.4
|
|
413
|
+
|
|
414
|
+
### Patch Changes
|
|
415
|
+
|
|
416
|
+
- [#2063](https://github.com/openapi-ts/openapi-typescript/pull/2063) [`5935cd2`](https://github.com/openapi-ts/openapi-typescript/commit/5935cd25a05d3ec1f4c8bf222d65395a0b9ae5b4) Thanks [@kerwanp](https://github.com/kerwanp)! - add support for arbitrary method
|
|
417
|
+
|
|
418
|
+
## 0.13.3
|
|
419
|
+
|
|
420
|
+
### Patch Changes
|
|
421
|
+
|
|
422
|
+
Refresh of 0.13.2; corrupted package
|
|
423
|
+
|
|
424
|
+
## 0.13.2
|
|
425
|
+
|
|
426
|
+
### Patch Changes
|
|
427
|
+
|
|
428
|
+
- [#2020](https://github.com/openapi-ts/openapi-typescript/pull/2020) [`7081842`](https://github.com/openapi-ts/openapi-typescript/commit/70818420c1cd6ca2ad2529bf2d7936bd01f3ef42) Thanks [@mellster2012](https://github.com/mellster2012)! - Add client option to pass custom RequestInit object into fetch requests for supported implementations
|
|
429
|
+
|
|
430
|
+
## 0.13.1
|
|
431
|
+
|
|
432
|
+
### Patch Changes
|
|
433
|
+
|
|
434
|
+
- [#1974](https://github.com/openapi-ts/openapi-typescript/pull/1974) [`35c576c`](https://github.com/openapi-ts/openapi-typescript/commit/35c576c8b2852f66e641014d13ffcfdeb21e98a1) Thanks [@luchsamapparat](https://github.com/luchsamapparat)! - add onError handler to middleware
|
|
435
|
+
|
|
436
|
+
## 0.13.0
|
|
437
|
+
|
|
438
|
+
### Minor Changes
|
|
439
|
+
|
|
440
|
+
- [#1968](https://github.com/openapi-ts/openapi-typescript/pull/1968) [`267977e`](https://github.com/openapi-ts/openapi-typescript/commit/267977e369f7a84c5d828023e6175729e4dd4c22) Thanks [@DjordyKoert](https://github.com/DjordyKoert)! - 204 responses or response with a Content-Length of 0 will now return undefined instead of an empty object
|
|
441
|
+
|
|
442
|
+
## 0.12.5
|
|
443
|
+
|
|
444
|
+
### Patch Changes
|
|
445
|
+
|
|
446
|
+
- [#1937](https://github.com/openapi-ts/openapi-typescript/pull/1937) [`06163a2`](https://github.com/openapi-ts/openapi-typescript/commit/06163a2030eaf8d0579f624d86481e1205aef396) Thanks [@DjordyKoert](https://github.com/DjordyKoert)! - client data & error now return a union of possible types
|
|
447
|
+
|
|
448
|
+
- Updated dependencies [[`06163a2`](https://github.com/openapi-ts/openapi-typescript/commit/06163a2030eaf8d0579f624d86481e1205aef396)]:
|
|
449
|
+
- openapi-typescript-helpers@0.0.15
|
|
450
|
+
|
|
451
|
+
## 0.12.4
|
|
452
|
+
|
|
453
|
+
### Patch Changes
|
|
454
|
+
|
|
455
|
+
- Updated dependencies [[`abfad56`](https://github.com/openapi-ts/openapi-typescript/commit/abfad5659183f95f705598dc52ae2dfe7a18ec04)]:
|
|
456
|
+
- openapi-typescript-helpers@0.0.14
|
|
457
|
+
|
|
458
|
+
## 0.12.3
|
|
459
|
+
|
|
460
|
+
### Patch Changes
|
|
461
|
+
|
|
462
|
+
- [#1936](https://github.com/openapi-ts/openapi-typescript/pull/1936) [`d14aa65`](https://github.com/openapi-ts/openapi-typescript/commit/d14aa65207b8abd1f369965bbd32ebb581e8d741) Thanks [@BlakeSzabo](https://github.com/BlakeSzabo)! - Fix multiple empty arrays in query params appending extra ampersands
|
|
463
|
+
|
|
464
|
+
## 0.12.2
|
|
465
|
+
|
|
466
|
+
### Patch Changes
|
|
467
|
+
|
|
468
|
+
- [#1918](https://github.com/openapi-ts/openapi-typescript/pull/1918) [`e39d11e`](https://github.com/openapi-ts/openapi-typescript/commit/e39d11e5ac4e7f5fc2ce81e8a6d7792f91a6551a) Thanks [@yicrotkd](https://github.com/yicrotkd)! - Improve `Middleware` type definition to require either onRequest or onResponse
|
|
469
|
+
|
|
470
|
+
## 0.12.1
|
|
471
|
+
|
|
472
|
+
### Patch Changes
|
|
473
|
+
|
|
474
|
+
- [#1907](https://github.com/openapi-ts/openapi-typescript/pull/1907) [`efaa1e2`](https://github.com/openapi-ts/openapi-typescript/commit/efaa1e23b9cb0901fe026e48fbb4b347f0c95507) Thanks [@tobiasdcl](https://github.com/tobiasdcl)! - allow usage of custom Request class
|
|
475
|
+
|
|
476
|
+
## 0.12.0
|
|
477
|
+
|
|
478
|
+
### Minor Changes
|
|
479
|
+
|
|
480
|
+
- ⚠️ **Breaking Change** [#1826](https://github.com/openapi-ts/openapi-typescript/pull/1826) [`b893c44`](https://github.com/openapi-ts/openapi-typescript/commit/b893c44f4290917f24c2ef7cda106c540df9cb3d) Thanks [@goce-cz](https://github.com/goce-cz)! - Do not set content-type on body-less requests
|
|
481
|
+
|
|
482
|
+
## 0.11.3
|
|
483
|
+
|
|
484
|
+
### Patch Changes
|
|
485
|
+
|
|
486
|
+
- [#1825](https://github.com/openapi-ts/openapi-typescript/pull/1825) [`6038f8f`](https://github.com/openapi-ts/openapi-typescript/commit/6038f8fca09fa698c9dd9bc49349c49342c46ac2) Thanks [@goce-cz](https://github.com/goce-cz)! - Allow falsy values (except undefined) as a valid body
|
|
487
|
+
|
|
488
|
+
## 0.11.2
|
|
489
|
+
|
|
490
|
+
### Patch Changes
|
|
491
|
+
|
|
492
|
+
- [#1817](https://github.com/openapi-ts/openapi-typescript/pull/1817) [`2a4b067`](https://github.com/openapi-ts/openapi-typescript/commit/2a4b067f43f7e0b75aecbf5c2fb3013a4e96e591) Thanks [@Gruak](https://github.com/Gruak)! - Allow specifying baseUrl per request
|
|
493
|
+
|
|
494
|
+
- [#1842](https://github.com/openapi-ts/openapi-typescript/pull/1842) [`0e42cbb`](https://github.com/openapi-ts/openapi-typescript/commit/0e42cbb98e2a023c33685de65ab0b8dbf82cc4b3) Thanks [@gzm0](https://github.com/gzm0)! - fix: allow use of `PathBasedClient` with generated `paths`
|
|
495
|
+
|
|
496
|
+
## 0.11.1
|
|
497
|
+
|
|
498
|
+
### Patch Changes
|
|
499
|
+
|
|
500
|
+
- [#1831](https://github.com/openapi-ts/openapi-typescript/pull/1831) [`091e71a`](https://github.com/openapi-ts/openapi-typescript/commit/091e71ad4bf805be32261a53524f320c2fa42690) Thanks [@SebastienGllmt](https://github.com/SebastienGllmt)! - Add MethodResponse utility type to easily get the return type of an endpoint on a client
|
|
501
|
+
|
|
502
|
+
- [#1833](https://github.com/openapi-ts/openapi-typescript/pull/1833) [`cec023d`](https://github.com/openapi-ts/openapi-typescript/commit/cec023d3461c79ca355a88366949d0f6382e4e2a) Thanks [@ngraef](https://github.com/ngraef)! - Fix identification of required properties when `strictNullChecks` is disabled
|
|
503
|
+
|
|
504
|
+
- Updated dependencies [[`cec023d`](https://github.com/openapi-ts/openapi-typescript/commit/cec023d3461c79ca355a88366949d0f6382e4e2a)]:
|
|
505
|
+
- openapi-typescript-helpers@0.0.12
|
|
506
|
+
|
|
507
|
+
## 0.11.0
|
|
508
|
+
|
|
509
|
+
### Minor Changes
|
|
510
|
+
|
|
511
|
+
-- ⚠️ **Breaking Change** [#1791](https://github.com/openapi-ts/openapi-typescript/pull/1791) [`a956d5d`](https://github.com/openapi-ts/openapi-typescript/commit/a956d5d8480834402536283ee2f24ce8086698dc) Thanks [@gzm0](https://github.com/gzm0)! - Add support for `client["/endpoint"].GET()` style calls
|
|
512
|
+
|
|
513
|
+
## 0.10.6
|
|
514
|
+
|
|
515
|
+
### Patch Changes
|
|
516
|
+
|
|
517
|
+
- [#1809](https://github.com/openapi-ts/openapi-typescript/pull/1809) [`f21c05b`](https://github.com/openapi-ts/openapi-typescript/commit/f21c05b9afcc89ee6ef73edab4045620b410eb01) Thanks [@gzm0](https://github.com/gzm0)! - perf: remove unnecessary `async` keywords (for reduced code size)
|
|
518
|
+
|
|
519
|
+
- [#1827](https://github.com/openapi-ts/openapi-typescript/pull/1827) [`ba0d595`](https://github.com/openapi-ts/openapi-typescript/commit/ba0d595556661053b5ef310afafec4fcc116e206) Thanks [@ngraef](https://github.com/ngraef)! - Fix typing for environments without DOM lib
|
|
520
|
+
|
|
521
|
+
## 0.10.5
|
|
522
|
+
|
|
523
|
+
### Patch Changes
|
|
524
|
+
|
|
525
|
+
- [#1762](https://github.com/openapi-ts/openapi-typescript/pull/1762) [`7698546`](https://github.com/openapi-ts/openapi-typescript/commit/76985467402dc52d705902c21159387ddaff3519) Thanks [@thatsprettyfaroutman](https://github.com/thatsprettyfaroutman)! - Allow FormData through defaultBodySerializer
|
|
526
|
+
|
|
527
|
+
## 0.10.4
|
|
528
|
+
|
|
529
|
+
### Patch Changes
|
|
530
|
+
|
|
531
|
+
- Updated dependencies [[`bcc9222`](https://github.com/openapi-ts/openapi-typescript/commit/bcc92223c83ba074316e17534a173fee8da9cd41)]:
|
|
532
|
+
- openapi-typescript-helpers@0.0.11
|
|
533
|
+
|
|
534
|
+
## 0.10.3
|
|
535
|
+
|
|
536
|
+
### Patch Changes
|
|
537
|
+
|
|
538
|
+
- [#1717](https://github.com/openapi-ts/openapi-typescript/pull/1717) [`335530c`](https://github.com/openapi-ts/openapi-typescript/commit/335530c4f8f966d0154f19504585c462f5f5a409) Thanks [@kerwanp](https://github.com/kerwanp)! - Ignore configuration files in published package
|
|
539
|
+
|
|
540
|
+
- [#1717](https://github.com/openapi-ts/openapi-typescript/pull/1717) [`335530c`](https://github.com/openapi-ts/openapi-typescript/commit/335530c4f8f966d0154f19504585c462f5f5a409) Thanks [@kerwanp](https://github.com/kerwanp)! - Create own client type for easier reusability
|
|
541
|
+
|
|
542
|
+
- Updated dependencies [[`335530c`](https://github.com/openapi-ts/openapi-typescript/commit/335530c4f8f966d0154f19504585c462f5f5a409)]:
|
|
543
|
+
- openapi-typescript-helpers@0.0.10
|
|
544
|
+
|
|
545
|
+
## 0.10.2
|
|
546
|
+
|
|
547
|
+
### Patch Changes
|
|
548
|
+
|
|
549
|
+
- [#1696](https://github.com/openapi-ts/openapi-typescript/pull/1696) [`aea31a8`](https://github.com/openapi-ts/openapi-typescript/commit/aea31a8679b901745a98f856fea9d53dff6807b3) Thanks [@swachter](https://github.com/swachter)! - Fix: encode primitive path parameters
|
|
550
|
+
|
|
551
|
+
## 0.10.1
|
|
552
|
+
|
|
553
|
+
### Patch Changes
|
|
554
|
+
|
|
555
|
+
- [#1719](https://github.com/openapi-ts/openapi-typescript/pull/1719) [`a8f2253`](https://github.com/openapi-ts/openapi-typescript/commit/a8f2253d31f060f66fe8c5c69ae79b1f81e78587) Thanks [@drwpow](https://github.com/drwpow)! - Remove nanoid from dependencies
|
|
556
|
+
|
|
557
|
+
- [#1719](https://github.com/openapi-ts/openapi-typescript/pull/1719) [`a8f2253`](https://github.com/openapi-ts/openapi-typescript/commit/a8f2253d31f060f66fe8c5c69ae79b1f81e78587) Thanks [@drwpow](https://github.com/drwpow)! - Fix "failed to execute fetch on Window" error
|
|
558
|
+
|
|
559
|
+
- [#1719](https://github.com/openapi-ts/openapi-typescript/pull/1719) [`a8f2253`](https://github.com/openapi-ts/openapi-typescript/commit/a8f2253d31f060f66fe8c5c69ae79b1f81e78587) Thanks [@drwpow](https://github.com/drwpow)! - Revert customFetch API back to `fetch(input: Request)`
|
|
560
|
+
|
|
561
|
+
## 0.10.0
|
|
562
|
+
|
|
563
|
+
### Minor Changes
|
|
564
|
+
|
|
565
|
+
- ⚠️ **Breaking Change**: `openapi-typescript@7` is needed to work. You’ll get type errors with `openapi-typescript@6` and below.
|
|
566
|
+
- ⚠️ **Breaking Change**: The Middleware API has changed to be an object rather than `(request, options)` or `(response, options)`. [See Middleware docs](https://openapi-ts.dev/openapi-fetch/middleware-auth) for updated API.
|
|
567
|
+
- ⚠️ **Breaking Change**: The `Content-Type` header is no longer sent by default if a body payload is attached.
|
|
568
|
+
- ⚠️ **Breaking Change**: The `customFetch` type now calls `fetch(input: string, init: RequestInit)` and the types have been updated, rather than `fetch(input: Request)` introduced in `0.9.0`.
|
|
569
|
+
|
|
570
|
+
- Added `id` to middleware handlers that create a unique ID per-fetch
|
|
571
|
+
|
|
572
|
+
## 0.9.8
|
|
573
|
+
|
|
574
|
+
### Patch Changes
|
|
575
|
+
|
|
576
|
+
- [#1697](https://github.com/openapi-ts/openapi-typescript/pull/1697) [`e77ce50`](https://github.com/openapi-ts/openapi-typescript/commit/e77ce501e479f54fb783c19b99fa7a53a894732c) Thanks [@armandabric](https://github.com/armandabric)! - Expose original request on Middleware.onResponse
|
|
577
|
+
|
|
578
|
+
## 0.9.7
|
|
579
|
+
|
|
580
|
+
### Patch Changes
|
|
581
|
+
|
|
582
|
+
- [#1672](https://github.com/openapi-ts/openapi-typescript/pull/1672) [`64cb619`](https://github.com/openapi-ts/openapi-typescript/commit/64cb6193ddd94523636fd55ba308117f2614a2e2) Thanks [@jaredLunde](https://github.com/jaredLunde)! - Fixes issue where native properties were not excluded from custom properties in the CustomRequest class
|
|
583
|
+
|
|
584
|
+
## 0.9.6
|
|
585
|
+
|
|
586
|
+
### Patch Changes
|
|
587
|
+
|
|
588
|
+
- [#1653](https://github.com/openapi-ts/openapi-typescript/pull/1653) [`4f4253a`](https://github.com/openapi-ts/openapi-typescript/commit/4f4253a031820a664499b9df7ed5c8b192aa98b3) Thanks [@FreeAoi](https://github.com/FreeAoi)! - Let request object have custom properties
|
|
589
|
+
|
|
590
|
+
## 0.9.5
|
|
591
|
+
|
|
592
|
+
### Patch Changes
|
|
593
|
+
|
|
594
|
+
- [#1639](https://github.com/openapi-ts/openapi-typescript/pull/1639) [`645f436`](https://github.com/openapi-ts/openapi-typescript/commit/645f4366d2907b05eee1e6ec33d13edab8614fa1) Thanks [@FreeAoi](https://github.com/FreeAoi)! - fix request option types don't showing optional props correctly
|
|
595
|
+
|
|
596
|
+
## 0.9.4
|
|
597
|
+
|
|
598
|
+
### Patch Changes
|
|
599
|
+
|
|
600
|
+
- [#1597](https://github.com/openapi-ts/openapi-typescript/pull/1597) [`1f7ad9d`](https://github.com/openapi-ts/openapi-typescript/commit/1f7ad9d41f1f1ca7b1195a381c907393f9ef743b) Thanks [@armandabric](https://github.com/armandabric)! - Allow to select the response content type
|
|
601
|
+
|
|
602
|
+
- [#1585](https://github.com/openapi-ts/openapi-typescript/pull/1585) [`4e06f86`](https://github.com/openapi-ts/openapi-typescript/commit/4e06f86934e11f3dbc3aabee4b4e61dd62680782) Thanks [@mikestopcontinues](https://github.com/mikestopcontinues)! - Update types for path-methods object
|
|
603
|
+
|
|
604
|
+
- [#1610](https://github.com/openapi-ts/openapi-typescript/pull/1610) [`cc8073b`](https://github.com/openapi-ts/openapi-typescript/commit/cc8073b3ee42e7aaa546a9c6a0553c300d8882de) Thanks [@illright](https://github.com/illright)! - Fix data/error discrimination when there are empty-body errors
|
|
605
|
+
|
|
606
|
+
- [#1587](https://github.com/openapi-ts/openapi-typescript/pull/1587) [`2a66a64`](https://github.com/openapi-ts/openapi-typescript/commit/2a66a6483d755a090e57a457b22eb99696da098a) Thanks [@JE-lee](https://github.com/JE-lee)! - Fix the custom fetch type
|
|
607
|
+
|
|
608
|
+
## 0.9.3
|
|
609
|
+
|
|
610
|
+
### Patch Changes
|
|
611
|
+
|
|
612
|
+
- [#1580](https://github.com/openapi-ts/openapi-typescript/pull/1580) [`4c0c7fc`](https://github.com/openapi-ts/openapi-typescript/commit/4c0c7fc69dc6416dcf1fea785455bce8b9742704) Thanks [@drwpow](https://github.com/drwpow)! - Fix type errors
|
|
613
|
+
|
|
614
|
+
## 0.9.2
|
|
615
|
+
|
|
616
|
+
### Patch Changes
|
|
617
|
+
|
|
618
|
+
- [#1550](https://github.com/openapi-ts/openapi-typescript/pull/1550) [`a5a9cc7`](https://github.com/openapi-ts/openapi-typescript/commit/a5a9cc766f893fd93500a5a1ff909746194bfdc7) Thanks [@shirish87](https://github.com/shirish87)! - Fix 'Content-Type' header being removed from requests with multipart/form-data body
|
|
619
|
+
|
|
620
|
+
## 0.9.1
|
|
621
|
+
|
|
622
|
+
### Patch Changes
|
|
623
|
+
|
|
624
|
+
- [#1546](https://github.com/openapi-ts/openapi-typescript/pull/1546) [`cc64453`](https://github.com/openapi-ts/openapi-typescript/commit/cc64453c7f92c77c19bc45dc0f701a98ab461b16) Thanks [@drwpow](https://github.com/drwpow)! - Fix JSON consuming body
|
|
625
|
+
|
|
626
|
+
## 0.9.0
|
|
627
|
+
|
|
628
|
+
### Minor Changes
|
|
629
|
+
|
|
630
|
+
- [#1521](https://github.com/openapi-ts/openapi-typescript/pull/1521) [`b174dd6`](https://github.com/openapi-ts/openapi-typescript/commit/b174dd6a7668e2f1f6bf6bd086ba2dabf7fb669e) Thanks [@drwpow](https://github.com/drwpow)! - Add middleware support
|
|
631
|
+
|
|
632
|
+
- [#1521](https://github.com/openapi-ts/openapi-typescript/pull/1521) [`fc3a468`](https://github.com/openapi-ts/openapi-typescript/commit/fc3a468c4342e17d203712be358b30a3fb82ab1e) Thanks [@drwpow](https://github.com/drwpow)! - ⚠️ Breaking change (internal): fetch() is now called with new Request() to support middleware (which may affect test mocking)
|
|
633
|
+
|
|
634
|
+
- [#1521](https://github.com/openapi-ts/openapi-typescript/pull/1521) [`2551e4b`](https://github.com/openapi-ts/openapi-typescript/commit/2551e4bde41d5437a76c13bb5ba25ede4f14db10) Thanks [@drwpow](https://github.com/drwpow)! - ⚠️ **Breaking change**: Responses are no longer automatically `.clone()`’d in certain instances. Be sure to `.clone()` yourself if you need to access the raw body!
|
|
635
|
+
|
|
636
|
+
- [#1534](https://github.com/openapi-ts/openapi-typescript/pull/1534) [`2bbeb92`](https://github.com/openapi-ts/openapi-typescript/commit/2bbeb92244cb82a534abb016ffb5fbd1255d9db5) Thanks [@drwpow](https://github.com/drwpow)! - ⚠️ Breaking change: no longer supports deeply-nested objects/arrays for query & path serialization.
|
|
637
|
+
|
|
638
|
+
### Patch Changes
|
|
639
|
+
|
|
640
|
+
- [#1484](https://github.com/openapi-ts/openapi-typescript/pull/1484) [`49bbd72`](https://github.com/openapi-ts/openapi-typescript/commit/49bbd72800f7bc6c460a741c50d11eb216746290) Thanks [@drwpow](https://github.com/drwpow)! - Remove prepare script
|
|
641
|
+
|
|
642
|
+
- [#1479](https://github.com/openapi-ts/openapi-typescript/pull/1479) [`c6d945b`](https://github.com/openapi-ts/openapi-typescript/commit/c6d945be717bb3999178fb3a77292e41e1b7ab80) Thanks [@darwish](https://github.com/darwish)! - Fixed build of openapi-typescript-helpers for CommonJS environments
|
|
643
|
+
|
|
644
|
+
- [#1534](https://github.com/openapi-ts/openapi-typescript/pull/1534) [`2bbeb92`](https://github.com/openapi-ts/openapi-typescript/commit/2bbeb92244cb82a534abb016ffb5fbd1255d9db5) Thanks [@drwpow](https://github.com/drwpow)! - Add support for automatic label & matrix path serialization.
|
|
645
|
+
|
|
646
|
+
- [#1521](https://github.com/openapi-ts/openapi-typescript/pull/1521) [`fd44bd2`](https://github.com/openapi-ts/openapi-typescript/commit/fd44bd28d881715e30f5a71435f05f6bae13859d) Thanks [@drwpow](https://github.com/drwpow)! - Support arrays in headers
|
|
647
|
+
|
|
648
|
+
- [#1534](https://github.com/openapi-ts/openapi-typescript/pull/1534) [`2bbeb92`](https://github.com/openapi-ts/openapi-typescript/commit/2bbeb92244cb82a534abb016ffb5fbd1255d9db5) Thanks [@drwpow](https://github.com/drwpow)! - Remove leading question marks from querySerializer
|
|
649
|
+
|
|
650
|
+
- [#1530](https://github.com/openapi-ts/openapi-typescript/pull/1530) [`4765658`](https://github.com/openapi-ts/openapi-typescript/commit/4765658460e0850d005e3f08cd63c4949326349b) Thanks [@wydengyre](https://github.com/wydengyre)! - Exports the ClientMethod utility type.
|
|
651
|
+
|
|
652
|
+
- Updated dependencies [[`c6d945b`](https://github.com/openapi-ts/openapi-typescript/commit/c6d945be717bb3999178fb3a77292e41e1b7ab80)]:
|
|
653
|
+
- openapi-typescript-helpers@0.0.7
|
|
654
|
+
|
|
655
|
+
## 0.8.2
|
|
656
|
+
|
|
657
|
+
### Patch Changes
|
|
658
|
+
|
|
659
|
+
- [#1424](https://github.com/openapi-ts/openapi-typescript/pull/1424) [`8f5adb3`](https://github.com/openapi-ts/openapi-typescript/commit/8f5adb3700eacff287d8b3f62837cb823503d5a4) Thanks [@drwpow](https://github.com/drwpow)! - Separate TS types to be managed manually
|
|
660
|
+
|
|
661
|
+
- Updated dependencies [[`5be2082`](https://github.com/openapi-ts/openapi-typescript/commit/5be20827334c60e53222445561b9cfc526f4f6a9)]:
|
|
662
|
+
- openapi-typescript-helpers@0.0.5
|
|
663
|
+
|
|
664
|
+
## 0.8.1
|
|
665
|
+
|
|
666
|
+
### Patch Changes
|
|
667
|
+
|
|
668
|
+
- [#1404](https://github.com/openapi-ts/openapi-typescript/pull/1404) [`93204e4`](https://github.com/openapi-ts/openapi-typescript/commit/93204e4de1b6e0469fdc8b710f5b279671570a9a) Thanks [@drwpow](https://github.com/drwpow)! - Fix behavior for empty arrays and objects in default `querySerializer`
|
|
669
|
+
|
|
670
|
+
## 0.8.0
|
|
671
|
+
|
|
672
|
+
### Minor Changes
|
|
673
|
+
|
|
674
|
+
- [#1399](https://github.com/openapi-ts/openapi-typescript/pull/1399) [`4fca1e4`](https://github.com/openapi-ts/openapi-typescript/commit/4fca1e477f524223fa8921559caef6bb364dc194) Thanks [@drwpow](https://github.com/drwpow)! - ⚠️ **Breaking**: change default querySerializer behavior to produce `style: form`, `explode: true` query params [according to the OpenAPI specification](https://swagger.io/docs/specification/serialization/#query). Also adds support for `deepObject`s (square bracket style).
|
|
675
|
+
|
|
676
|
+
## 0.7.10
|
|
677
|
+
|
|
678
|
+
### Patch Changes
|
|
679
|
+
|
|
680
|
+
- [#1373](https://github.com/openapi-ts/openapi-typescript/pull/1373) [`fd3e96f`](https://github.com/openapi-ts/openapi-typescript/commit/fd3e96fb2e68a0d58b326331264809e76ca89672) Thanks [@HugeLetters](https://github.com/HugeLetters)! - Added the option to provide custom fetch function to individual API calls.
|
|
681
|
+
|
|
682
|
+
## 0.7.9
|
|
683
|
+
|
|
684
|
+
### Patch Changes
|
|
685
|
+
|
|
686
|
+
- [#1366](https://github.com/openapi-ts/openapi-typescript/pull/1366) [`04dbd6d`](https://github.com/openapi-ts/openapi-typescript/commit/04dbd6d84fffd1d88300421bae25e946f1c303da) Thanks [@drwpow](https://github.com/drwpow)! - Fix empty object being required param
|
|
687
|
+
|
|
688
|
+
- Updated dependencies [[`04dbd6d`](https://github.com/openapi-ts/openapi-typescript/commit/04dbd6d84fffd1d88300421bae25e946f1c303da)]:
|
|
689
|
+
- openapi-typescript-helpers@0.0.4
|
|
690
|
+
|
|
691
|
+
## 0.7.8
|
|
692
|
+
|
|
693
|
+
### Patch Changes
|
|
694
|
+
|
|
695
|
+
- [#1360](https://github.com/openapi-ts/openapi-typescript/pull/1360) [`b59e431`](https://github.com/openapi-ts/openapi-typescript/commit/b59e431d1876d1cc60dda5e9b59b6185b0136437) Thanks [@marcomuser](https://github.com/marcomuser)! - Fix CJS build for TypeScript
|
|
696
|
+
|
|
697
|
+
## 0.7.7
|
|
698
|
+
|
|
699
|
+
### Patch Changes
|
|
700
|
+
|
|
701
|
+
- Updated dependencies [[`996e51e`](https://github.com/openapi-ts/openapi-typescript/commit/996e51e9b475f4818af77301ed5c0ab458736cb9)]:
|
|
702
|
+
- openapi-typescript-helpers@0.0.3
|
|
703
|
+
|
|
704
|
+
## 0.7.6
|
|
705
|
+
|
|
706
|
+
### Patch Changes
|
|
707
|
+
|
|
708
|
+
- [#1332](https://github.com/openapi-ts/openapi-typescript/pull/1332) [`8e8ebfd`](https://github.com/openapi-ts/openapi-typescript/commit/8e8ebfdcd84ff6a3d7b6f5d00695fc11366b436e) Thanks [@drwpow](https://github.com/drwpow)! - Restore original .d.ts module-resolution behavior
|
|
709
|
+
|
|
710
|
+
## 0.7.5
|
|
711
|
+
|
|
712
|
+
### Patch Changes
|
|
713
|
+
|
|
714
|
+
- Updated dependencies [[`e63a345`](https://github.com/openapi-ts/openapi-typescript/commit/e63a34561c8137c4cfdef858a2272be32960ca4f)]:
|
|
715
|
+
- openapi-typescript-helpers@0.0.2
|
|
716
|
+
|
|
717
|
+
## 0.7.4
|
|
718
|
+
|
|
719
|
+
### Patch Changes
|
|
720
|
+
|
|
721
|
+
- [#1314](https://github.com/openapi-ts/openapi-typescript/pull/1314) [`181c4de`](https://github.com/openapi-ts/openapi-typescript/commit/181c4de395e9c337937f61d6dd5e0ba47954d893) Thanks [@drwpow](https://github.com/drwpow)! - Make headers typing friendlier
|
|
722
|
+
|
|
723
|
+
- [#1314](https://github.com/openapi-ts/openapi-typescript/pull/1314) [`181c4de`](https://github.com/openapi-ts/openapi-typescript/commit/181c4de395e9c337937f61d6dd5e0ba47954d893) Thanks [@drwpow](https://github.com/drwpow)! - Allow unsetting headers
|
|
724
|
+
|
|
725
|
+
## 0.7.3
|
|
726
|
+
|
|
727
|
+
### Patch Changes
|
|
728
|
+
|
|
729
|
+
- [#1300](https://github.com/openapi-ts/openapi-typescript/pull/1300) [`5939e20`](https://github.com/openapi-ts/openapi-typescript/commit/5939e20b86ca3019cbc0a1c7f6de2b15a806cf72) Thanks [@drwpow](https://github.com/drwpow)! - Use openapi-typescript-helpers package for types
|
|
730
|
+
|
|
731
|
+
## 0.7.2
|
|
732
|
+
|
|
733
|
+
### Patch Changes
|
|
734
|
+
|
|
735
|
+
- [#1242](https://github.com/openapi-ts/openapi-typescript/pull/1242) [`8d11701`](https://github.com/openapi-ts/openapi-typescript/commit/8d11701deb22d47bc8ef04b6210ea6722ecb461b) Thanks [@drwpow](https://github.com/drwpow)! - Fix impossible body typing
|
|
736
|
+
|
|
737
|
+
## 0.7.1
|
|
738
|
+
|
|
739
|
+
### Patch Changes
|
|
740
|
+
|
|
741
|
+
- [#1251](https://github.com/openapi-ts/openapi-typescript/pull/1251) [`80717a7`](https://github.com/openapi-ts/openapi-typescript/commit/80717a75ad20f2224a9a61d2a5b3d2b2bbd7c78b) Thanks [@drwpow](https://github.com/drwpow)! - Fix 2XX, 4XX, 5XX responses
|
|
742
|
+
|
|
743
|
+
## 0.7.0
|
|
744
|
+
|
|
745
|
+
### Minor Changes
|
|
746
|
+
|
|
747
|
+
- [#1243](https://github.com/openapi-ts/openapi-typescript/pull/1243) [`541abf4`](https://github.com/openapi-ts/openapi-typescript/commit/541abf4966cf6020de5e4bf4b93cfa9741ec9a00) Thanks [@drwpow](https://github.com/drwpow)! - ⚠️ Breaking: rename all methods to UPPERCASE (`GET()`, `POST()`, etc.)
|
|
748
|
+
|
|
749
|
+
## 0.6.2
|
|
750
|
+
|
|
751
|
+
### Patch Changes
|
|
752
|
+
|
|
753
|
+
- [#1239](https://github.com/openapi-ts/openapi-typescript/pull/1239) [`4c93067`](https://github.com/openapi-ts/openapi-typescript/commit/4c9306720daa65b1c1977030737a52121fd46668) Thanks [@drwpow](https://github.com/drwpow)! - Fix params.header inference
|
|
754
|
+
|
|
755
|
+
## 0.6.1
|
|
756
|
+
|
|
757
|
+
### Patch Changes
|
|
758
|
+
|
|
759
|
+
- [#1192](https://github.com/openapi-ts/openapi-typescript/pull/1192) [`38ee8b4`](https://github.com/openapi-ts/openapi-typescript/commit/38ee8b406ecf07e2dece05c4867a0bc5d27c309d) Thanks [@psychedelicious](https://github.com/psychedelicious)! - Fix header handling for FormData
|
|
760
|
+
|
|
761
|
+
## 0.6.0
|
|
762
|
+
|
|
763
|
+
### Minor Changes
|
|
764
|
+
|
|
765
|
+
- [`0380e9a`](https://github.com/openapi-ts/openapi-typescript/commit/0380e9a572f6edfcc6ca1242b7f11abd8fc24610) Thanks [@drwpow](https://github.com/drwpow)! - Add multipart/form-data request body support
|
|
766
|
+
|
|
767
|
+
- [`0380e9a`](https://github.com/openapi-ts/openapi-typescript/commit/0380e9a572f6edfcc6ca1242b7f11abd8fc24610) Thanks [@drwpow](https://github.com/drwpow)! - Breaking: openapi-fetch now just takes the first media type it finds rather than preferring JSON. This is because in the case of `multipart/form-data` vs `application/json`, it’s not inherently clear which you’d want. Or if there were multiple JSON-like media types.
|
|
768
|
+
|
|
769
|
+
## 0.5.0
|
|
770
|
+
|
|
771
|
+
### Minor Changes
|
|
772
|
+
|
|
773
|
+
- [#1183](https://github.com/openapi-ts/openapi-typescript/pull/1183) [`431a98f`](https://github.com/openapi-ts/openapi-typescript/commit/431a98f0b6d518aa8e780f063d680d380a8a12dd) Thanks [@psychedelicious](https://github.com/psychedelicious)! - Add global `querySerializer()` option to `createClient()`
|
|
774
|
+
|
|
775
|
+
### Patch Changes
|
|
776
|
+
|
|
777
|
+
- [#1186](https://github.com/openapi-ts/openapi-typescript/pull/1186) [`cd0a653`](https://github.com/openapi-ts/openapi-typescript/commit/cd0a65354b03fce8a6e28453b8760ac017205df1) Thanks [@drwpow](https://github.com/drwpow)! - Fix CJS build
|
|
778
|
+
|
|
779
|
+
## 0.4.0
|
|
780
|
+
|
|
781
|
+
### Minor Changes
|
|
782
|
+
|
|
783
|
+
- [#1176](https://github.com/openapi-ts/openapi-typescript/pull/1176) [`21fb484`](https://github.com/openapi-ts/openapi-typescript/pull/1176/commits/21fb4848f1e70e4423a5f20cae330210b5b813b4) Thanks [@kecrily](https://github.com/kecrily)! - Add CommonJS bundle
|
|
784
|
+
|
|
785
|
+
## 0.3.0
|
|
786
|
+
|
|
787
|
+
### Minor Changes
|
|
788
|
+
|
|
789
|
+
- [#1169](https://github.com/openapi-ts/openapi-typescript/pull/1169) [`74bfc0d`](https://github.com/openapi-ts/openapi-typescript/commit/74bfc0d879747790aed7942e11f4b277b9b0428d) Thanks [@drwpow](https://github.com/drwpow)! - Expose createFinalURL() logic for testing
|
|
790
|
+
|
|
791
|
+
- [#1169](https://github.com/openapi-ts/openapi-typescript/pull/1169) [`74bfc0d`](https://github.com/openapi-ts/openapi-typescript/commit/74bfc0d879747790aed7942e11f4b277b9b0428d) Thanks [@drwpow](https://github.com/drwpow)! - Automatically remove `undefined` and `null` query params without requiring querySerializer
|
|
792
|
+
|
|
793
|
+
- [#1169](https://github.com/openapi-ts/openapi-typescript/pull/1169) [`74bfc0d`](https://github.com/openapi-ts/openapi-typescript/commit/74bfc0d879747790aed7942e11f4b277b9b0428d) Thanks [@drwpow](https://github.com/drwpow)! - Allow overriding of JSON body parsing
|
|
794
|
+
|
|
795
|
+
### Patch Changes
|
|
796
|
+
|
|
797
|
+
- [#1169](https://github.com/openapi-ts/openapi-typescript/pull/1169) [`74bfc0d`](https://github.com/openapi-ts/openapi-typescript/commit/74bfc0d879747790aed7942e11f4b277b9b0428d) Thanks [@drwpow](https://github.com/drwpow)! - Clone response internally
|
|
798
|
+
|
|
799
|
+
- [#1169](https://github.com/openapi-ts/openapi-typescript/pull/1169) [`74bfc0d`](https://github.com/openapi-ts/openapi-typescript/commit/74bfc0d879747790aed7942e11f4b277b9b0428d) Thanks [@drwpow](https://github.com/drwpow)! - Strip trailing slashes from baseUrl
|
|
800
|
+
|
|
801
|
+
- [#1169](https://github.com/openapi-ts/openapi-typescript/pull/1169) [`74bfc0d`](https://github.com/openapi-ts/openapi-typescript/commit/74bfc0d879747790aed7942e11f4b277b9b0428d) Thanks [@drwpow](https://github.com/drwpow)! - Fix querySerializer typing
|
|
802
|
+
|
|
803
|
+
## 0.2.1
|
|
804
|
+
|
|
805
|
+
### Patch Changes
|
|
806
|
+
|
|
807
|
+
- [#1139](https://github.com/openapi-ts/openapi-typescript/pull/1139) [`30c01fa`](https://github.com/openapi-ts/openapi-typescript/commit/30c01fa3727a9696166a9bf44dd01693cc354a09) Thanks [@drwpow](https://github.com/drwpow)! - Treat `default` response as error
|
|
808
|
+
|
|
809
|
+
## 0.2.0
|
|
810
|
+
|
|
811
|
+
### Minor Changes
|
|
812
|
+
|
|
813
|
+
- 97c8757: Add custom fetch option (#51). Thanks, [@hd-o](https://github.com/hd-o)!
|
|
814
|
+
|
|
815
|
+
## 0.1.4
|
|
816
|
+
|
|
817
|
+
### Patch Changes
|
|
818
|
+
|
|
819
|
+
- 63ebe48: Fix request body type when optional (#48)
|
|
820
|
+
|
|
821
|
+
## 0.1.3
|
|
822
|
+
|
|
823
|
+
### Patch Changes
|
|
824
|
+
|
|
825
|
+
- 8c01480: Fix querySerializer signature
|
|
826
|
+
|
|
827
|
+
## 0.1.2
|
|
828
|
+
|
|
829
|
+
### Patch Changes
|
|
830
|
+
|
|
831
|
+
- e730cd8: Fix post() and options() types
|
|
832
|
+
|
|
833
|
+
## 0.1.1
|
|
834
|
+
|
|
835
|
+
### Patch Changes
|
|
836
|
+
|
|
837
|
+
- 5d1fb7d: Fix bad HTTP method lookup causing polymorphsim
|
|
838
|
+
|
|
839
|
+
## 0.1.0
|
|
840
|
+
|
|
841
|
+
### Minor Changes
|
|
842
|
+
|
|
843
|
+
- f878cd3: Add querySerializer
|
|
844
|
+
|
|
845
|
+
### Patch Changes
|
|
846
|
+
|
|
847
|
+
- 22197a1: Add missing type defs for minified build
|
|
848
|
+
- ff3174a: Fix type inference bugs
|
|
849
|
+
- 4ce3828: Skip parsing JSON for empty responses (#23)
|
|
850
|
+
- ff3ae1b: Skip parsing JSON for 204 responses (#28)
|
|
851
|
+
|
|
852
|
+
## 0.0.8
|
|
853
|
+
|
|
854
|
+
### Patch Changes
|
|
855
|
+
|
|
856
|
+
- 8e7cb46: Fix TypeScript lib error, simplify generated types
|
|
857
|
+
|
|
858
|
+
## 0.0.7
|
|
859
|
+
|
|
860
|
+
### Patch Changes
|
|
861
|
+
|
|
862
|
+
- fce1546: Support "application/json;charset=utf-8" content types (#15). Thanks, [@shinzui](https://github.com/shinzui)!
|
|
863
|
+
- 0899e0e: Add minified build (#18)
|
|
864
|
+
|
|
865
|
+
## 0.0.6
|
|
866
|
+
|
|
867
|
+
### Patch Changes
|
|
868
|
+
|
|
869
|
+
- 27c149c: Fix data, error sometimes returning undefined
|
|
870
|
+
|
|
871
|
+
## 0.0.5
|
|
872
|
+
|
|
873
|
+
### Patch Changes
|
|
874
|
+
|
|
875
|
+
- c818e65: Export BaseParams shared type (#8)
|
|
876
|
+
|
|
877
|
+
## 0.0.4
|
|
878
|
+
|
|
879
|
+
### Patch Changes
|
|
880
|
+
|
|
881
|
+
- ce99563: Fix optional requestBody in path
|
|
882
|
+
|
|
883
|
+
## 0.0.3
|
|
884
|
+
|
|
885
|
+
### Patch Changes
|
|
886
|
+
|
|
887
|
+
- b69cb51: Autocomplete URLs by path ([#2](https://github.com/drwpow/openapi-fetch/pull/2)). Thanks, [@mitchell-merry](https://github.com/mitchell-merry)!
|
|
888
|
+
|
|
889
|
+
## 0.0.2
|
|
890
|
+
|
|
891
|
+
### Patch Changes
|
|
892
|
+
|
|
893
|
+
- 5a47464: Fix module entry
|
|
894
|
+
|
|
895
|
+
## 0.0.1
|
|
896
|
+
|
|
897
|
+
### Patch Changes
|
|
898
|
+
|
|
899
|
+
- 55d7013: Encode path params
|