@openapi-qraft/tanstack-query-react-types 2.6.1 → 2.6.2
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 +12 -0
- package/dist/types/service-operation/ServiceOperationMutationFn.d.ts +1 -1
- package/dist/types/service-operation/ServiceOperationMutationFn.d.ts.map +1 -1
- package/dist/types/shared/ServiceOperationMutation.d.ts +8 -6
- package/dist/types/shared/ServiceOperationMutation.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/service-operation/ServiceOperationMutationFn.ts +16 -3
- package/src/shared/ServiceOperationMutation.ts +16 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @openapi-qraft/tanstack-query-react-types
|
|
2
2
|
|
|
3
|
+
## 2.6.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 41e2181: Added support for `meta` and `signal` for mutating operations.
|
|
8
|
+
|
|
9
|
+
## 2.6.2-beta.0
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 41e2181: Added support for `meta` and `signal` for mutating operations.
|
|
14
|
+
|
|
3
15
|
## 2.6.1
|
|
4
16
|
|
|
5
17
|
## 2.6.0
|
|
@@ -3,6 +3,6 @@ export interface ServiceOperationMutationFn<TSchema extends {
|
|
|
3
3
|
url: string;
|
|
4
4
|
method: string;
|
|
5
5
|
}, TBody, TMutationData, TMutationParams, TError> {
|
|
6
|
-
(options: ServiceOperationMutationFnOptions<TBody, TMutationParams>, client?: (schema: TSchema, options: ServiceOperationMutationFnOptions<TBody, TMutationParams>) => Promise<RequestFnResponse<TMutationData, TError>>): Promise<RequestFnResponse<TMutationData, TError>>;
|
|
6
|
+
<TMeta extends Record<string, any>, TSignal extends AbortSignal = AbortSignal>(options: ServiceOperationMutationFnOptions<TBody, TMutationParams, TMeta, TSignal>, client?: (schema: TSchema, options: ServiceOperationMutationFnOptions<TBody, TMutationParams, TMeta, TSignal>) => Promise<RequestFnResponse<TMutationData, TError>>): Promise<RequestFnResponse<TMutationData, TError>>;
|
|
7
7
|
}
|
|
8
8
|
//# sourceMappingURL=ServiceOperationMutationFn.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServiceOperationMutationFn.d.ts","sourceRoot":"","sources":["../../../src/service-operation/ServiceOperationMutationFn.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,iCAAiC,EAClC,MAAM,2CAA2C,CAAC;AAEnD,MAAM,WAAW,0BAA0B,CACzC,OAAO,SAAS;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EAC/C,KAAK,EACL,aAAa,EACb,eAAe,EACf,MAAM;IAEN,CACE,OAAO,EAAE,iCAAiC,
|
|
1
|
+
{"version":3,"file":"ServiceOperationMutationFn.d.ts","sourceRoot":"","sources":["../../../src/service-operation/ServiceOperationMutationFn.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,iCAAiC,EAClC,MAAM,2CAA2C,CAAC;AAEnD,MAAM,WAAW,0BAA0B,CACzC,OAAO,SAAS;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EAC/C,KAAK,EACL,aAAa,EACb,eAAe,EACf,MAAM;IAEN,CACE,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACjC,OAAO,SAAS,WAAW,GAAG,WAAW,EAEzC,OAAO,EAAE,iCAAiC,CACxC,KAAK,EACL,eAAe,EACf,KAAK,EACL,OAAO,CACR,EACD,MAAM,CAAC,EAAE,CACP,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,iCAAiC,CACxC,KAAK,EACL,eAAe,EACf,KAAK,EACL,OAAO,CACR,KACE,OAAO,CAAC,iBAAiB,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC,GACrD,OAAO,CAAC,iBAAiB,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC,CAAC;CACtD"}
|
|
@@ -1,24 +1,26 @@
|
|
|
1
1
|
import type { AreAllOptional } from '@openapi-qraft/tanstack-query-react-types';
|
|
2
2
|
import type { DeepReadonly } from './DeepReadonly.js';
|
|
3
|
-
interface QueryFnBaseUrlOptions {
|
|
3
|
+
interface QueryFnBaseUrlOptions<TMeta extends Record<string, any>, TSignal extends AbortSignal> {
|
|
4
4
|
/**
|
|
5
5
|
* Base URL to use for the request
|
|
6
6
|
* @example 'https://api.example.com'
|
|
7
7
|
*/
|
|
8
8
|
baseUrl?: string;
|
|
9
|
+
meta?: TMeta;
|
|
10
|
+
signal?: TSignal;
|
|
9
11
|
}
|
|
10
|
-
export type ServiceOperationMutationFnOptions<TBody, TParams> = AreAllOptional<TBody> extends true ? AreAllOptional<TParams> extends true ? void | ({
|
|
12
|
+
export type ServiceOperationMutationFnOptions<TBody, TParams, TMeta extends Record<string, any>, TSignal extends AbortSignal = AbortSignal> = AreAllOptional<TBody> extends true ? AreAllOptional<TParams> extends true ? void | ({
|
|
11
13
|
parameters?: DeepReadonly<TParams>;
|
|
12
14
|
body?: TBody;
|
|
13
|
-
} & QueryFnBaseUrlOptions) : {
|
|
15
|
+
} & QueryFnBaseUrlOptions<TMeta, TSignal>) : {
|
|
14
16
|
parameters: DeepReadonly<TParams>;
|
|
15
17
|
body?: TBody;
|
|
16
|
-
} & QueryFnBaseUrlOptions : AreAllOptional<TParams> extends true ? {
|
|
18
|
+
} & QueryFnBaseUrlOptions<TMeta, TSignal> : AreAllOptional<TParams> extends true ? {
|
|
17
19
|
parameters?: DeepReadonly<TParams>;
|
|
18
20
|
body: TBody;
|
|
19
|
-
} & QueryFnBaseUrlOptions : {
|
|
21
|
+
} & QueryFnBaseUrlOptions<TMeta, TSignal> : {
|
|
20
22
|
parameters: DeepReadonly<TParams>;
|
|
21
23
|
body: TBody;
|
|
22
|
-
} & QueryFnBaseUrlOptions
|
|
24
|
+
} & QueryFnBaseUrlOptions<TMeta, TSignal>;
|
|
23
25
|
export {};
|
|
24
26
|
//# sourceMappingURL=ServiceOperationMutation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServiceOperationMutation.d.ts","sourceRoot":"","sources":["../../../src/shared/ServiceOperationMutation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAChF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,UAAU,qBAAqB;
|
|
1
|
+
{"version":3,"file":"ServiceOperationMutation.d.ts","sourceRoot":"","sources":["../../../src/shared/ServiceOperationMutation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAChF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,UAAU,qBAAqB,CAC7B,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACjC,OAAO,SAAS,WAAW;IAE3B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,KAAK,CAAC;IACb,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,MAAM,iCAAiC,CAC3C,KAAK,EACL,OAAO,EACP,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACjC,OAAO,SAAS,WAAW,GAAG,WAAW,IAEzC,cAAc,CAAC,KAAK,CAAC,SAAS,IAAI,GAC9B,cAAc,CAAC,OAAO,CAAC,SAAS,IAAI,GAE9B,IAAI,GACJ,CAAC;IACC,UAAU,CAAC,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IACnC,IAAI,CAAC,EAAE,KAAK,CAAC;CACd,GAAG,qBAAqB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,GAC9C;IACE,UAAU,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IAClC,IAAI,CAAC,EAAE,KAAK,CAAC;CACd,GAAG,qBAAqB,CAAC,KAAK,EAAE,OAAO,CAAC,GAC3C,cAAc,CAAC,OAAO,CAAC,SAAS,IAAI,GAClC;IACE,UAAU,CAAC,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IACnC,IAAI,EAAE,KAAK,CAAC;CACb,GAAG,qBAAqB,CAAC,KAAK,EAAE,OAAO,CAAC,GACzC;IACE,UAAU,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IAClC,IAAI,EAAE,KAAK,CAAC;CACb,GAAG,qBAAqB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openapi-qraft/tanstack-query-react-types",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.2",
|
|
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",
|
|
@@ -10,11 +10,24 @@ export interface ServiceOperationMutationFn<
|
|
|
10
10
|
TMutationParams,
|
|
11
11
|
TError,
|
|
12
12
|
> {
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
<
|
|
14
|
+
TMeta extends Record<string, any>,
|
|
15
|
+
TSignal extends AbortSignal = AbortSignal,
|
|
16
|
+
>(
|
|
17
|
+
options: ServiceOperationMutationFnOptions<
|
|
18
|
+
TBody,
|
|
19
|
+
TMutationParams,
|
|
20
|
+
TMeta,
|
|
21
|
+
TSignal
|
|
22
|
+
>,
|
|
15
23
|
client?: (
|
|
16
24
|
schema: TSchema,
|
|
17
|
-
options: ServiceOperationMutationFnOptions<
|
|
25
|
+
options: ServiceOperationMutationFnOptions<
|
|
26
|
+
TBody,
|
|
27
|
+
TMutationParams,
|
|
28
|
+
TMeta,
|
|
29
|
+
TSignal
|
|
30
|
+
>
|
|
18
31
|
) => Promise<RequestFnResponse<TMutationData, TError>>
|
|
19
32
|
): Promise<RequestFnResponse<TMutationData, TError>>;
|
|
20
33
|
}
|
|
@@ -1,15 +1,25 @@
|
|
|
1
1
|
import type { AreAllOptional } from '@openapi-qraft/tanstack-query-react-types';
|
|
2
2
|
import type { DeepReadonly } from './DeepReadonly.js';
|
|
3
3
|
|
|
4
|
-
interface QueryFnBaseUrlOptions
|
|
4
|
+
interface QueryFnBaseUrlOptions<
|
|
5
|
+
TMeta extends Record<string, any>,
|
|
6
|
+
TSignal extends AbortSignal,
|
|
7
|
+
> {
|
|
5
8
|
/**
|
|
6
9
|
* Base URL to use for the request
|
|
7
10
|
* @example 'https://api.example.com'
|
|
8
11
|
*/
|
|
9
12
|
baseUrl?: string;
|
|
13
|
+
meta?: TMeta;
|
|
14
|
+
signal?: TSignal;
|
|
10
15
|
}
|
|
11
16
|
|
|
12
|
-
export type ServiceOperationMutationFnOptions<
|
|
17
|
+
export type ServiceOperationMutationFnOptions<
|
|
18
|
+
TBody,
|
|
19
|
+
TParams,
|
|
20
|
+
TMeta extends Record<string, any>,
|
|
21
|
+
TSignal extends AbortSignal = AbortSignal,
|
|
22
|
+
> =
|
|
13
23
|
AreAllOptional<TBody> extends true
|
|
14
24
|
? AreAllOptional<TParams> extends true
|
|
15
25
|
?
|
|
@@ -17,17 +27,17 @@ export type ServiceOperationMutationFnOptions<TBody, TParams> =
|
|
|
17
27
|
| ({
|
|
18
28
|
parameters?: DeepReadonly<TParams>;
|
|
19
29
|
body?: TBody;
|
|
20
|
-
} & QueryFnBaseUrlOptions)
|
|
30
|
+
} & QueryFnBaseUrlOptions<TMeta, TSignal>)
|
|
21
31
|
: {
|
|
22
32
|
parameters: DeepReadonly<TParams>;
|
|
23
33
|
body?: TBody;
|
|
24
|
-
} & QueryFnBaseUrlOptions
|
|
34
|
+
} & QueryFnBaseUrlOptions<TMeta, TSignal>
|
|
25
35
|
: AreAllOptional<TParams> extends true
|
|
26
36
|
? {
|
|
27
37
|
parameters?: DeepReadonly<TParams>;
|
|
28
38
|
body: TBody;
|
|
29
|
-
} & QueryFnBaseUrlOptions
|
|
39
|
+
} & QueryFnBaseUrlOptions<TMeta, TSignal>
|
|
30
40
|
: {
|
|
31
41
|
parameters: DeepReadonly<TParams>;
|
|
32
42
|
body: TBody;
|
|
33
|
-
} & QueryFnBaseUrlOptions
|
|
43
|
+
} & QueryFnBaseUrlOptions<TMeta, TSignal>;
|