@ternaus/openapi-react-query 0.0.0-stage → 1.0.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Martin Paucot
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,67 @@
1
- # Temporary Holding Version
1
+ # @ternaus/openapi-react-query
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Fork of [openapi-react-query in openapi-ts/openapi-typescript](https://github.com/openapi-ts/openapi-typescript/tree/main/packages/openapi-react-query), maintained by [Vladimir Iglovikov](https://github.com/ternaus). The original authorship, Git history, and MIT license are preserved.
4
+
5
+ `@ternaus/openapi-react-query` is a typed client for [@tanstack/react-query](https://tanstack.com/query/latest/docs/framework/react/overview) that uses your OpenAPI schema.
6
+
7
+ TypeScript checks request fields and infers response shapes from the types generated by openapi-typescript. The client sends requests through openapi-fetch.
8
+
9
+ ## Setup
10
+
11
+ Requires React 19 and TanStack Query 5.
12
+
13
+ Install this library along with [openapi-fetch](../openapi-fetch) and [openapi-typescript](../openapi-typescript):
14
+
15
+ ```bash
16
+ npm i @ternaus/openapi-react-query @ternaus/openapi-fetch
17
+ npm i -D @ternaus/openapi-typescript typescript
18
+ ```
19
+
20
+ Next, generate TypeScript types from your OpenAPI schema using openapi-typescript:
21
+
22
+ ```bash
23
+ npx @ternaus/openapi-typescript ./path/to/api/v1.yaml -o ./src/lib/api/v1.d.ts
24
+ ```
25
+
26
+ ## Usage
27
+
28
+ Once your types have been generated from your schema, you can create a [fetch client](../openapi-fetch), a react-query client and start querying your API.
29
+
30
+ ```tsx
31
+ import createFetchClient from "@ternaus/openapi-fetch";
32
+ import createClient from "@ternaus/openapi-react-query";
33
+ import type { paths } from "./my-openapi-3-schema"; // generated by openapi-typescript
34
+
35
+ const fetchClient = createFetchClient<paths>({
36
+ baseUrl: "https://myapi.dev/v1/",
37
+ });
38
+ const $api = createClient(fetchClient);
39
+
40
+ const MyComponent = () => {
41
+ const { data, error, isPending } = $api.useQuery(
42
+ "get",
43
+ "/blogposts/{post_id}",
44
+ {
45
+ params: {
46
+ path: { post_id: 5 },
47
+ },
48
+ }
49
+ );
50
+
51
+ if (isPending || !data) return "Loading...";
52
+
53
+ if (error) return `An error occurred: ${error.message}`;
54
+
55
+ return <div>{data.title}</div>;
56
+ };
57
+ ```
58
+
59
+ > You can find more information about `createFetchClient` in the [openapi-fetch documentation](../openapi-fetch).
60
+
61
+ Clients share a cache by normalized `baseUrl`. Use `createClient(fetchClient, { cacheKey: "user-123" })` to separate users or middleware on the same server. Normal and infinite queries use different keys. Reuse `queryOptions(...).queryKey` for cache access and invalidation.
62
+
63
+ HTTP errors reject with their parsed payload. An empty error body produces an `Error` with the status in its message and the original `Response` in `cause`. Empty successful queries return `null`.
64
+
65
+ ## 📓 Docs
66
+
67
+ [View Docs](https://github.com/ternaus/js-tools/blob/main/docs/openapi-react-query/index.md)
@@ -0,0 +1,36 @@
1
+ import { type DataTag, type InfiniteData, type QueryClient, type SkipToken, type UseInfiniteQueryOptions, type UseInfiniteQueryResult, type UseMutationOptions, type UseMutationResult, type UseQueryOptions, type UseQueryResult, type UseSuspenseQueryOptions, type UseSuspenseQueryResult } from "@tanstack/react-query";
2
+ import type { CheckedInit, Client as FetchClient, FetchResponse, MaybeOptionalInit } from "@ternaus/openapi-fetch";
3
+ import type { HttpMethod, MediaType, PathsWithMethod, RequiredKeysOf } from "@ternaus/openapi-typescript-helpers";
4
+ type InferSelectReturnType<TData, TSelect> = TSelect extends (data: TData) => infer R ? R : TData;
5
+ type QueryData<T> = [T] extends [never] ? null : T extends undefined ? null : T;
6
+ type QueryInit<Init, Options> = CheckedInit<Init, Options> & {
7
+ [K in keyof UseQueryOptions]?: never;
8
+ } & {
9
+ [key: string]: unknown;
10
+ };
11
+ export type QueryKey<Paths extends Record<string, Record<HttpMethod, {}>>, Method extends HttpMethod, Path extends PathsWithMethod<Paths, Method>, Init = MaybeOptionalInit<Paths[Path], Method>, Mode extends "query" | "infinite" = "query"> = readonly [string, string | null, Mode, Method, Path, Init];
12
+ export type QueryOptionsFunction<Paths extends Record<string, Record<HttpMethod, {}>>, Media extends MediaType> = <Method extends HttpMethod, Path extends PathsWithMethod<Paths, Method>, Init extends MaybeOptionalInit<Paths[Path], Method>, Response extends Required<FetchResponse<Paths[Path][Method], Init, Media>>, Options extends Omit<UseQueryOptions<QueryData<Response["data"]>, Response["error"] | Error, InferSelectReturnType<QueryData<Response["data"]>, Options["select"]>, QueryKey<Paths, Method, Path>>, "queryKey" | "queryFn">>(method: Method, path: Path, ...[init, options]: RequiredKeysOf<Init> extends never ? [QueryInit<Init, MaybeOptionalInit<Paths[Path], Method>>?, Options?] : [QueryInit<Init, MaybeOptionalInit<Paths[Path], Method>>, Options?]) => NoInfer<Omit<UseQueryOptions<QueryData<Response["data"]>, Response["error"] | Error, InferSelectReturnType<QueryData<Response["data"]>, Options["select"]>, QueryKey<Paths, Method, Path>>, "queryFn" | "queryKey"> & {
13
+ queryKey: DataTag<QueryKey<Paths, Method, Path>, QueryData<Response["data"]>, Response["error"] | Error>;
14
+ queryFn: Exclude<UseQueryOptions<QueryData<Response["data"]>, Response["error"] | Error, InferSelectReturnType<QueryData<Response["data"]>, Options["select"]>, QueryKey<Paths, Method, Path>>["queryFn"], SkipToken | undefined>;
15
+ }>;
16
+ export type UseQueryMethod<Paths extends Record<string, Record<HttpMethod, {}>>, Media extends MediaType> = <Method extends HttpMethod, Path extends PathsWithMethod<Paths, Method>, Init extends MaybeOptionalInit<Paths[Path], Method>, Response extends Required<FetchResponse<Paths[Path][Method], Init, Media>>, Options extends Omit<UseQueryOptions<QueryData<Response["data"]>, Response["error"] | Error, InferSelectReturnType<QueryData<Response["data"]>, Options["select"]>, QueryKey<Paths, Method, Path>>, "queryKey" | "queryFn">>(method: Method, url: Path, ...[init, options, queryClient]: RequiredKeysOf<Init> extends never ? [QueryInit<Init, MaybeOptionalInit<Paths[Path], Method>>?, Options?, QueryClient?] : [QueryInit<Init, MaybeOptionalInit<Paths[Path], Method>>, Options?, QueryClient?]) => UseQueryResult<InferSelectReturnType<QueryData<Response["data"]>, Options["select"]>, Response["error"] | Error>;
17
+ export type UseInfiniteQueryMethod<Paths extends Record<string, Record<HttpMethod, {}>>, Media extends MediaType> = <Method extends HttpMethod, Path extends PathsWithMethod<Paths, Method>, Init extends MaybeOptionalInit<Paths[Path], Method>, Response extends Required<FetchResponse<Paths[Path][Method], Init, Media>>, Options extends Omit<UseInfiniteQueryOptions<QueryData<Response["data"]>, Response["error"] | Error, InferSelectReturnType<InfiniteData<QueryData<Response["data"]>>, Options["select"]>, QueryKey<Paths, Method, Path, Init, "infinite">, unknown>, "queryKey" | "queryFn"> & {
18
+ pageParamName?: string;
19
+ }>(method: Method, url: Path, init: QueryInit<Init, MaybeOptionalInit<Paths[Path], Method>>, options: Options, queryClient?: QueryClient) => UseInfiniteQueryResult<InferSelectReturnType<InfiniteData<QueryData<Response["data"]>>, Options["select"]>, Response["error"] | Error>;
20
+ export type UseSuspenseQueryMethod<Paths extends Record<string, Record<HttpMethod, {}>>, Media extends MediaType> = <Method extends HttpMethod, Path extends PathsWithMethod<Paths, Method>, Init extends MaybeOptionalInit<Paths[Path], Method>, Response extends Required<FetchResponse<Paths[Path][Method], Init, Media>>, Options extends Omit<UseSuspenseQueryOptions<QueryData<Response["data"]>, Response["error"] | Error, InferSelectReturnType<QueryData<Response["data"]>, Options["select"]>, QueryKey<Paths, Method, Path>>, "queryKey" | "queryFn">>(method: Method, url: Path, ...[init, options, queryClient]: RequiredKeysOf<Init> extends never ? [QueryInit<Init, MaybeOptionalInit<Paths[Path], Method>>?, Options?, QueryClient?] : [QueryInit<Init, MaybeOptionalInit<Paths[Path], Method>>, Options?, QueryClient?]) => UseSuspenseQueryResult<InferSelectReturnType<QueryData<Response["data"]>, Options["select"]>, Response["error"] | Error>;
21
+ export type UseMutationMethod<Paths extends Record<string, Record<HttpMethod, {}>>, Media extends MediaType> = <Method extends HttpMethod, Path extends PathsWithMethod<Paths, Method>, Init extends MaybeOptionalInit<Paths[Path], Method>, Response extends Required<FetchResponse<Paths[Path][Method], Init, Media>>, TOnMutateResult = unknown>(method: Method, url: Path, options?: Omit<UseMutationOptions<Response["data"], Response["error"] | Error, MaybeOptionalInit<Paths[Path], Method>, TOnMutateResult>, "mutationKey" | "mutationFn">, queryClient?: QueryClient) => UseMutationResult<Response["data"], Response["error"] | Error, MaybeOptionalInit<Paths[Path], Method>, TOnMutateResult>;
22
+ export interface OpenapiQueryClient<Paths extends {}, Media extends MediaType = MediaType> {
23
+ queryOptions: QueryOptionsFunction<Paths, Media>;
24
+ useQuery: UseQueryMethod<Paths, Media>;
25
+ useSuspenseQuery: UseSuspenseQueryMethod<Paths, Media>;
26
+ useInfiniteQuery: UseInfiniteQueryMethod<Paths, Media>;
27
+ useMutation: UseMutationMethod<Paths, Media>;
28
+ }
29
+ export type MethodResponse<CreatedClient extends OpenapiQueryClient<any, any>, Method extends HttpMethod, Path extends CreatedClient extends OpenapiQueryClient<infer Paths, infer _Media> ? PathsWithMethod<Paths, Method> : never, Options = object> = CreatedClient extends OpenapiQueryClient<infer Paths extends {
30
+ [key: string]: any;
31
+ }, infer Media extends MediaType> ? NonNullable<FetchResponse<Paths[Path][Method], Options, Media>["data"]> : never;
32
+ export interface ClientOptions {
33
+ cacheKey?: string;
34
+ }
35
+ export default function createClient<Paths extends {}, Media extends MediaType = MediaType>(client: FetchClient<Paths, Media>, { cacheKey }?: ClientOptions): OpenapiQueryClient<Paths, Media>;
36
+ export {};
package/dist/index.js ADDED
@@ -0,0 +1,52 @@
1
+ import { useInfiniteQuery, useMutation, useQuery, useSuspenseQuery, } from "@tanstack/react-query";
2
+ export default function createClient(client, { cacheKey } = {}) {
3
+ const scope = [client.baseUrl, cacheKey ?? null];
4
+ const fetch = async (method, path, init) => {
5
+ const fn = client[method.toUpperCase()];
6
+ const { data, error, response } = await fn(path, init);
7
+ if (!response.ok) {
8
+ throw error === undefined
9
+ ? new Error(`HTTP ${response.status} ${response.statusText}`.trim(), { cause: response })
10
+ : error;
11
+ }
12
+ return data;
13
+ };
14
+ const queryFn = ({ queryKey: [, , , method, path, init], signal, }) => fetch(method, path, { signal, ...init }).then((data) => data ?? null);
15
+ const queryOptions = (method, path, ...[init, options]) => ({
16
+ queryKey: [...scope, "query", method, path, init],
17
+ queryFn,
18
+ ...options,
19
+ });
20
+ return {
21
+ queryOptions,
22
+ useQuery: (method, path, ...[init, options, queryClient]) => useQuery(queryOptions(method, path, init, options), queryClient),
23
+ useSuspenseQuery: (method, path, ...[init, options, queryClient]) => useSuspenseQuery(queryOptions(method, path, init, options), queryClient),
24
+ useInfiniteQuery: (method, path, init, options, queryClient) => {
25
+ const { pageParamName = "cursor", ...restOptions } = options;
26
+ return useInfiniteQuery({
27
+ queryKey: [...scope, "infinite", method, path, init],
28
+ queryFn: ({ queryKey: [, , , method, path, init], pageParam, signal }) => {
29
+ const mergedInit = {
30
+ ...init,
31
+ signal,
32
+ params: {
33
+ ...init?.params,
34
+ query: {
35
+ ...init?.params?.query,
36
+ ...(pageParam === undefined ? {} : { [pageParamName]: pageParam }),
37
+ },
38
+ },
39
+ };
40
+ return fetch(method, path, mergedInit).then((data) => data ?? null);
41
+ },
42
+ ...restOptions,
43
+ }, queryClient);
44
+ },
45
+ useMutation: (method, path, options, queryClient) => useMutation({
46
+ mutationKey: [...scope, "mutation", method, path],
47
+ mutationFn: (init) => fetch(method, path, init),
48
+ ...options,
49
+ }, queryClient),
50
+ };
51
+ }
52
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"./","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAcL,gBAAgB,EAChB,WAAW,EACX,QAAQ,EACR,gBAAgB,GACjB,MAAM,uBAAuB,CAAC;AAmM/B,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,MAAiC,EACjC,EAAE,QAAQ,EAAE,GAAkB,EAAE;IAEhC,MAAM,KAAK,GAAG,CAAC,MAAM,CAAC,OAAO,EAAE,QAAQ,IAAI,IAAI,CAAU,CAAC;IAE1D,MAAM,KAAK,GAAG,KAAK,EACjB,MAAc,EACd,IAAU,EACV,IAAa,EACb,EAAE;QACF,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,EAAuB,CAAuC,CAAC;QACnG,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,MAAM,EAAE,CAAC,IAAI,EAAE,IAAW,CAAC,CAAC;QAC9D,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,MAAM,KAAK,KAAK,SAAS;gBACvB,CAAC,CAAC,IAAI,KAAK,CAAC,QAAQ,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC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AAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,93 @@
1
1
  {
2
2
  "name": "@ternaus/openapi-react-query",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "description": "Fast, type-safe @tanstack/react-query client to work with your OpenAPI schema.",
4
+ "version": "1.0.0",
5
+ "author": {
6
+ "name": "Martin Paucot",
7
+ "email": "contact@martin-paucot.fr"
8
+ },
9
+ "license": "MIT",
10
+ "type": "module",
11
+ "main": "./dist/index.js",
12
+ "exports": {
13
+ ".": {
14
+ "types": "./dist/index.d.ts",
15
+ "default": "./dist/index.js"
16
+ },
17
+ "./package.json": "./package.json"
18
+ },
19
+ "homepage": "https://ternaus.github.io/js-tools/openapi-react-query/",
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "git+https://github.com/ternaus/js-tools.git",
23
+ "directory": "packages/openapi-react-query"
24
+ },
25
+ "bugs": {
26
+ "url": "https://github.com/ternaus/js-tools/issues"
27
+ },
28
+ "keywords": [
29
+ "openapi",
30
+ "swagger",
31
+ "rest",
32
+ "api",
33
+ "oapi_3",
34
+ "oapi_3_1",
35
+ "typescript",
36
+ "fetch",
37
+ "react",
38
+ "react-query",
39
+ "tanstack"
40
+ ],
41
+ "dependencies": {
42
+ "@ternaus/openapi-typescript-helpers": "^1.0.0"
43
+ },
44
+ "devDependencies": {
45
+ "@tanstack/react-query": "5.104.0",
46
+ "@testing-library/react": "16.3.3",
47
+ "@types/react": "19.3.0",
48
+ "@types/react-dom": "19.3.0",
49
+ "msw": "3.0.1",
50
+ "@ternaus/openapi-fetch": "^1.0.0",
51
+ "react": "19.3.0",
52
+ "react-dom": "19.3.0",
53
+ "react-error-boundary": "6.1.6",
54
+ "@ternaus/openapi-typescript": "^8.0.0"
55
+ },
56
+ "peerDependencies": {
57
+ "@tanstack/react-query": "^5.80.0",
58
+ "@ternaus/openapi-fetch": "^1.0.0",
59
+ "react": "^19.0.0"
60
+ },
61
+ "engines": {
62
+ "node": "^24.15.0 || ^26.0.0"
63
+ },
64
+ "types": "./dist/index.d.ts",
65
+ "files": [
66
+ "dist",
67
+ "LICENSE",
68
+ "README.md"
69
+ ],
70
+ "sideEffects": false,
71
+ "maintainers": [
72
+ {
73
+ "name": "Vladimir Iglovikov",
74
+ "url": "https://github.com/ternaus"
75
+ }
76
+ ],
77
+ "publishConfig": {
78
+ "access": "public",
79
+ "provenance": true
80
+ },
81
+ "scripts": {
82
+ "build": "node ../../scripts/build.mjs",
83
+ "dev": "tsc -p tsconfig.build.json --watch",
84
+ "format": "biome format . --write",
85
+ "lint": "pnpm run lint:js && pnpm run typecheck",
86
+ "lint:js": "biome lint . --error-on-warnings",
87
+ "generate-types": "openapi-typescript test/fixtures/api.yaml -o test/fixtures/api.d.ts",
88
+ "test": "pnpm run generate-types && pnpm run test:js && pnpm run test:exports",
89
+ "test:js": "vitest run --config ../../vitest.config.ts --project openapi-react-query",
90
+ "test:exports": "publint --strict",
91
+ "typecheck": "tsc --noEmit"
92
+ }
6
93
  }