@openapi-qraft/tanstack-query-react-types 2.15.0-beta.6 → 2.15.0-beta.7
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 +8 -0
- package/dist/types/service-operation/ServiceOperationQueryFn.d.ts +2 -2
- package/dist/types/service-operation/ServiceOperationQueryFn.d.ts.map +1 -1
- package/dist/types/shared/ServiceOperationQuery.d.ts +8 -11
- package/dist/types/shared/ServiceOperationQuery.d.ts.map +1 -1
- package/package.json +9 -9
- package/src/service-operation/ServiceOperationQueryFn.ts +5 -1
- package/src/shared/ServiceOperationQuery.ts +8 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @openapi-qraft/tanstack-query-react-types
|
|
2
2
|
|
|
3
|
+
## 2.15.0-beta.7
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- f43bc5c: When an operation has only optional parameters, the imperative operation function now accepts `QueryFnOptions` (e.g. `signal`, `meta`) without requiring a `parameters` argument. This matches how optional request fields are already handled for hooks and improves typing for direct `qraft.<service>.<operation>(…)` calls.
|
|
8
|
+
- 6a2f1ed: Updated repository dependencies to current compatible versions across the workspace.
|
|
9
|
+
- 55a23fd: Updated the openapi-typescript package to the current compatible version.
|
|
10
|
+
|
|
3
11
|
## 2.15.0-beta.6
|
|
4
12
|
|
|
5
13
|
## 2.15.0-beta.5
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { AreAllOptional, QueryFnOptionsByParameters, QueryFnOptionsByQueryKey, RequestFnResponse } from '@openapi-qraft/tanstack-query-react-types';
|
|
1
|
+
import type { AreAllOptional, QueryFnOptions, QueryFnOptionsByParameters, QueryFnOptionsByQueryKey, RequestFnResponse } from '@openapi-qraft/tanstack-query-react-types';
|
|
2
2
|
export interface ServiceOperationQueryFn<TSchema extends {
|
|
3
3
|
url: string;
|
|
4
4
|
method: string;
|
|
5
5
|
}, TOperationQueryFnData, TQueryParams, TError> {
|
|
6
|
-
<TMeta extends Record<string, any>, TSignal extends AbortSignal = AbortSignal>(options: QueryFnOptionsByQueryKey<TSchema, TQueryParams, TMeta, TSignal> | (AreAllOptional<TQueryParams> extends true ? QueryFnOptionsByParameters<TQueryParams, TMeta, TSignal> | void : QueryFnOptionsByParameters<TQueryParams, TMeta, TSignal>), client?: (schema: TSchema, options: {
|
|
6
|
+
<TMeta extends Record<string, any>, TSignal extends AbortSignal = AbortSignal>(options: QueryFnOptionsByQueryKey<TSchema, TQueryParams, TMeta, TSignal> | (AreAllOptional<TQueryParams> extends true ? QueryFnOptionsByParameters<TQueryParams, TMeta, TSignal> | QueryFnOptions<TMeta, TSignal> | void : QueryFnOptionsByParameters<TQueryParams, TMeta, TSignal>), client?: (schema: TSchema, options: {
|
|
7
7
|
parameters: TQueryParams;
|
|
8
8
|
signal?: TSignal;
|
|
9
9
|
meta?: TMeta;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServiceOperationQueryFn.d.ts","sourceRoot":"","sources":["../../../src/service-operation/ServiceOperationQueryFn.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,0BAA0B,EAC1B,wBAAwB,EACxB,iBAAiB,EAClB,MAAM,2CAA2C,CAAC;AAEnD,MAAM,WAAW,uBAAuB,CACtC,OAAO,SAAS;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EAC/C,qBAAqB,EACrB,YAAY,EACZ,MAAM;IAEN,CACE,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACjC,OAAO,SAAS,WAAW,GAAG,WAAW,EAEzC,OAAO,EACH,wBAAwB,CAAC,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,OAAO,CAAC,GAC/D,CAAC,cAAc,CAAC,YAAY,CAAC,SAAS,IAAI,
|
|
1
|
+
{"version":3,"file":"ServiceOperationQueryFn.d.ts","sourceRoot":"","sources":["../../../src/service-operation/ServiceOperationQueryFn.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,cAAc,EACd,0BAA0B,EAC1B,wBAAwB,EACxB,iBAAiB,EAClB,MAAM,2CAA2C,CAAC;AAEnD,MAAM,WAAW,uBAAuB,CACtC,OAAO,SAAS;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EAC/C,qBAAqB,EACrB,YAAY,EACZ,MAAM;IAEN,CACE,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACjC,OAAO,SAAS,WAAW,GAAG,WAAW,EAEzC,OAAO,EACH,wBAAwB,CAAC,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,OAAO,CAAC,GAC/D,CAAC,cAAc,CAAC,YAAY,CAAC,SAAS,IAAI,GAElC,0BAA0B,CAAC,YAAY,EAAE,KAAK,EAAE,OAAO,CAAC,GACxD,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC,GAC9B,IAAI,GACR,0BAA0B,CAAC,YAAY,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,EACjE,MAAM,CAAC,EAAE,CACP,MAAM,EAAE,OAAO,EACf,OAAO,EAAE;QACP,UAAU,EAAE,YAAY,CAAC;QACzB,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,IAAI,CAAC,EAAE,KAAK,CAAC;KACd,KACE,OAAO,CAAC,iBAAiB,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC,GAC7D,OAAO,CAAC,iBAAiB,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC,CAAC;CAC9D"}
|
|
@@ -1,26 +1,23 @@
|
|
|
1
1
|
import type { ServiceOperationQueryKey } from '@openapi-qraft/tanstack-query-react-types';
|
|
2
2
|
import type { DeepReadonly } from './DeepReadonly.js';
|
|
3
|
-
interface
|
|
3
|
+
export interface QueryFnOptions<TMeta extends Record<string, any>, TSignal extends AbortSignal = AbortSignal> {
|
|
4
4
|
signal?: TSignal;
|
|
5
5
|
meta?: TMeta;
|
|
6
|
+
/**
|
|
7
|
+
* Base URL to use for the request
|
|
8
|
+
* @example 'https://api.example.com'
|
|
9
|
+
*/
|
|
10
|
+
baseUrl?: string;
|
|
6
11
|
}
|
|
7
|
-
export interface QueryFnOptionsByParameters<TParams, TMeta extends Record<string, any>, TSignal extends AbortSignal = AbortSignal> extends
|
|
12
|
+
export interface QueryFnOptionsByParameters<TParams, TMeta extends Record<string, any>, TSignal extends AbortSignal = AbortSignal> extends QueryFnOptions<TMeta, TSignal> {
|
|
8
13
|
parameters: DeepReadonly<TParams>;
|
|
9
14
|
queryKey?: never;
|
|
10
15
|
}
|
|
11
16
|
export interface QueryFnOptionsByQueryKey<TSchema extends {
|
|
12
17
|
url: string;
|
|
13
18
|
method: string;
|
|
14
|
-
}, TParams, TMeta extends Record<string, any>, TSignal extends AbortSignal = AbortSignal> extends
|
|
19
|
+
}, TParams, TMeta extends Record<string, any>, TSignal extends AbortSignal = AbortSignal> extends QueryFnOptions<TMeta, TSignal> {
|
|
15
20
|
queryKey: ServiceOperationQueryKey<TSchema, TParams>;
|
|
16
21
|
parameters?: never;
|
|
17
22
|
}
|
|
18
|
-
interface QueryFnBaseUrlOptions {
|
|
19
|
-
/**
|
|
20
|
-
* Base URL to use for the request
|
|
21
|
-
* @example 'https://api.example.com'
|
|
22
|
-
*/
|
|
23
|
-
baseUrl?: string;
|
|
24
|
-
}
|
|
25
|
-
export {};
|
|
26
23
|
//# sourceMappingURL=ServiceOperationQuery.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServiceOperationQuery.d.ts","sourceRoot":"","sources":["../../../src/shared/ServiceOperationQuery.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2CAA2C,CAAC;AAC1F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,
|
|
1
|
+
{"version":3,"file":"ServiceOperationQuery.d.ts","sourceRoot":"","sources":["../../../src/shared/ServiceOperationQuery.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2CAA2C,CAAC;AAC1F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,MAAM,WAAW,cAAc,CAC7B,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACjC,OAAO,SAAS,WAAW,GAAG,WAAW;IAEzC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,KAAK,CAAC;IACb;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,0BAA0B,CACzC,OAAO,EACP,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACjC,OAAO,SAAS,WAAW,GAAG,WAAW,CACzC,SAAQ,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC;IACtC,UAAU,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IAElC,QAAQ,CAAC,EAAE,KAAK,CAAC;CAClB;AAED,MAAM,WAAW,wBAAwB,CACvC,OAAO,SAAS;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EAC/C,OAAO,EACP,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACjC,OAAO,SAAS,WAAW,GAAG,WAAW,CACzC,SAAQ,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC;IACtC,QAAQ,EAAE,wBAAwB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAErD,UAAU,CAAC,EAAE,KAAK,CAAC;CACpB"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openapi-qraft/tanstack-query-react-types",
|
|
3
|
-
"version": "2.15.0-beta.
|
|
3
|
+
"version": "2.15.0-beta.7",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "yarn clean && NODE_ENV=production rollup --config rollup.config.mjs && tsc --project tsconfig.build.json --emitDeclarationOnly",
|
|
6
6
|
"dev": "yarn clean && tsc --project tsconfig.build.json --watch --outDir ./dist/esm --noEmitOnError false",
|
|
7
7
|
"typecheck": "tsc --noEmit",
|
|
8
|
-
"lint": "eslint",
|
|
8
|
+
"lint": "eslint --max-warnings 0",
|
|
9
9
|
"clean": "rimraf dist/"
|
|
10
10
|
},
|
|
11
11
|
"type": "module",
|
|
@@ -35,13 +35,13 @@
|
|
|
35
35
|
"react": "^18 || ^19"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@openapi-qraft/eslint-config": "1.0.
|
|
39
|
-
"@openapi-qraft/rollup-config": "1.
|
|
40
|
-
"@tanstack/react-query": "^5.
|
|
41
|
-
"eslint": "^
|
|
42
|
-
"rimraf": "^6.1.
|
|
43
|
-
"rollup": "~4.
|
|
44
|
-
"typescript": "^5.
|
|
38
|
+
"@openapi-qraft/eslint-config": "1.1.0-beta.0",
|
|
39
|
+
"@openapi-qraft/rollup-config": "1.2.0-beta.0",
|
|
40
|
+
"@tanstack/react-query": "^5.96.1",
|
|
41
|
+
"eslint": "^10.1.0",
|
|
42
|
+
"rimraf": "^6.1.3",
|
|
43
|
+
"rollup": "~4.60.1",
|
|
44
|
+
"typescript": "^5.9.3"
|
|
45
45
|
},
|
|
46
46
|
"packageManager": "yarn@4.2.1",
|
|
47
47
|
"files": [
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
AreAllOptional,
|
|
3
|
+
QueryFnOptions,
|
|
3
4
|
QueryFnOptionsByParameters,
|
|
4
5
|
QueryFnOptionsByQueryKey,
|
|
5
6
|
RequestFnResponse,
|
|
@@ -18,7 +19,10 @@ export interface ServiceOperationQueryFn<
|
|
|
18
19
|
options:
|
|
19
20
|
| QueryFnOptionsByQueryKey<TSchema, TQueryParams, TMeta, TSignal>
|
|
20
21
|
| (AreAllOptional<TQueryParams> extends true
|
|
21
|
-
?
|
|
22
|
+
?
|
|
23
|
+
| QueryFnOptionsByParameters<TQueryParams, TMeta, TSignal>
|
|
24
|
+
| QueryFnOptions<TMeta, TSignal>
|
|
25
|
+
| void
|
|
22
26
|
: QueryFnOptionsByParameters<TQueryParams, TMeta, TSignal>),
|
|
23
27
|
client?: (
|
|
24
28
|
schema: TSchema,
|
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
import type { ServiceOperationQueryKey } from '@openapi-qraft/tanstack-query-react-types';
|
|
2
2
|
import type { DeepReadonly } from './DeepReadonly.js';
|
|
3
3
|
|
|
4
|
-
interface
|
|
4
|
+
export interface QueryFnOptions<
|
|
5
5
|
TMeta extends Record<string, any>,
|
|
6
6
|
TSignal extends AbortSignal = AbortSignal,
|
|
7
7
|
> {
|
|
8
8
|
signal?: TSignal;
|
|
9
9
|
meta?: TMeta;
|
|
10
|
+
/**
|
|
11
|
+
* Base URL to use for the request
|
|
12
|
+
* @example 'https://api.example.com'
|
|
13
|
+
*/
|
|
14
|
+
baseUrl?: string;
|
|
10
15
|
}
|
|
11
16
|
|
|
12
17
|
export interface QueryFnOptionsByParameters<
|
|
13
18
|
TParams,
|
|
14
19
|
TMeta extends Record<string, any>,
|
|
15
20
|
TSignal extends AbortSignal = AbortSignal,
|
|
16
|
-
>
|
|
17
|
-
extends QueryFnOptionsBase<TMeta, TSignal>, QueryFnBaseUrlOptions {
|
|
21
|
+
> extends QueryFnOptions<TMeta, TSignal> {
|
|
18
22
|
parameters: DeepReadonly<TParams>;
|
|
19
23
|
|
|
20
24
|
queryKey?: never;
|
|
@@ -25,17 +29,8 @@ export interface QueryFnOptionsByQueryKey<
|
|
|
25
29
|
TParams,
|
|
26
30
|
TMeta extends Record<string, any>,
|
|
27
31
|
TSignal extends AbortSignal = AbortSignal,
|
|
28
|
-
>
|
|
29
|
-
extends QueryFnOptionsBase<TMeta, TSignal>, QueryFnBaseUrlOptions {
|
|
32
|
+
> extends QueryFnOptions<TMeta, TSignal> {
|
|
30
33
|
queryKey: ServiceOperationQueryKey<TSchema, TParams>;
|
|
31
34
|
|
|
32
35
|
parameters?: never;
|
|
33
36
|
}
|
|
34
|
-
|
|
35
|
-
interface QueryFnBaseUrlOptions {
|
|
36
|
-
/**
|
|
37
|
-
* Base URL to use for the request
|
|
38
|
-
* @example 'https://api.example.com'
|
|
39
|
-
*/
|
|
40
|
-
baseUrl?: string;
|
|
41
|
-
}
|