@openapi-qraft/tanstack-query-react-types 2.10.2 → 2.11.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/CHANGELOG.md +6 -0
- package/dist/types/service-operation/ServiceOperationGetMutationCache.d.ts +12 -0
- package/dist/types/service-operation/ServiceOperationGetMutationCache.d.ts.map +1 -0
- package/dist/types/service-operation/index.d.ts +1 -0
- package/dist/types/service-operation/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/service-operation/ServiceOperationGetMutationCache.ts +68 -0
- package/src/service-operation/index.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { MutationFiltersByMutationKey, MutationFiltersByParameters, MutationVariables, OperationError } from '@openapi-qraft/tanstack-query-react-types';
|
|
2
|
+
import type { Mutation, MutationCache } from '@tanstack/react-query';
|
|
3
|
+
export interface ServiceOperationGetMutationCache<TSchema extends {
|
|
4
|
+
url: string;
|
|
5
|
+
method: string;
|
|
6
|
+
}, TBody, TMutationData, TMutationParams, TError> {
|
|
7
|
+
getMutationCache(): Omit<MutationCache, 'find' | 'findAll'> & {
|
|
8
|
+
find<TContext = unknown>(filters: MutationFiltersByParameters<TBody, TMutationData, TMutationParams, OperationError<TError>, TContext> | MutationFiltersByMutationKey<TSchema, TBody, TMutationData, TMutationParams, OperationError<TError>, TContext>): Mutation<TMutationData, TError, MutationVariables<TBody, TMutationParams>, TContext> | undefined;
|
|
9
|
+
findAll<TContext = unknown>(filters?: MutationFiltersByParameters<TBody, TMutationData, TMutationParams, OperationError<TError>, TContext> | MutationFiltersByMutationKey<TSchema, TBody, TMutationData, TMutationParams, OperationError<TError>, TContext>): Array<Mutation<TMutationData, TError, MutationVariables<TBody, TMutationParams>, TContext>>;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=ServiceOperationGetMutationCache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ServiceOperationGetMutationCache.d.ts","sourceRoot":"","sources":["../../../src/service-operation/ServiceOperationGetMutationCache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,4BAA4B,EAC5B,2BAA2B,EAC3B,iBAAiB,EACjB,cAAc,EACf,MAAM,2CAA2C,CAAC;AACnD,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAErE,MAAM,WAAW,gCAAgC,CAC/C,OAAO,SAAS;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EAC/C,KAAK,EACL,aAAa,EACb,eAAe,EACf,MAAM;IAEN,gBAAgB,IAAI,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC,GAAG;QAC5D,IAAI,CAAC,QAAQ,GAAG,OAAO,EACrB,OAAO,EACH,2BAA2B,CACzB,KAAK,EACL,aAAa,EACb,eAAe,EACf,cAAc,CAAC,MAAM,CAAC,EACtB,QAAQ,CACT,GACD,4BAA4B,CAC1B,OAAO,EACP,KAAK,EACL,aAAa,EACb,eAAe,EACf,cAAc,CAAC,MAAM,CAAC,EACtB,QAAQ,CACT,GAEH,QAAQ,CACN,aAAa,EACb,MAAM,EACN,iBAAiB,CAAC,KAAK,EAAE,eAAe,CAAC,EACzC,QAAQ,CACT,GACD,SAAS,CAAC;QACd,OAAO,CAAC,QAAQ,GAAG,OAAO,EACxB,OAAO,CAAC,EACJ,2BAA2B,CACzB,KAAK,EACL,aAAa,EACb,eAAe,EACf,cAAc,CAAC,MAAM,CAAC,EACtB,QAAQ,CACT,GACD,4BAA4B,CAC1B,OAAO,EACP,KAAK,EACL,aAAa,EACb,eAAe,EACf,cAAc,CAAC,MAAM,CAAC,EACtB,QAAQ,CACT,GACJ,KAAK,CACN,QAAQ,CACN,aAAa,EACb,MAAM,EACN,iBAAiB,CAAC,KAAK,EAAE,eAAe,CAAC,EACzC,QAAQ,CACT,CACF,CAAC;KACH,CAAC;CACH"}
|
|
@@ -22,6 +22,7 @@ export type * from './ServiceOperationUseIsFetchingQueries.js';
|
|
|
22
22
|
export type * from './ServiceOperationUseIsMutating.js';
|
|
23
23
|
export type * from './ServiceOperationUseMutation.js';
|
|
24
24
|
export type * from './ServiceOperationUseMutationState.js';
|
|
25
|
+
export type * from './ServiceOperationGetMutationCache.js';
|
|
25
26
|
export type * from './ServiceOperationUseQueries.js';
|
|
26
27
|
export type * from './ServiceOperationUseQuery.js';
|
|
27
28
|
export type * from './ServiceOperationUseSuspenseInfiniteQuery.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/service-operation/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,uBAAuB,CAAC;AAC3C,mBAAmB,oCAAoC,CAAC;AACxD,mBAAmB,yCAAyC,CAAC;AAC7D,mBAAmB,iCAAiC,CAAC;AACrD,mBAAmB,2CAA2C,CAAC;AAC/D,mBAAmB,qCAAqC,CAAC;AACzD,mBAAmB,mCAAmC,CAAC;AACvD,mBAAmB,oCAAoC,CAAC;AACxD,mBAAmB,wCAAwC,CAAC;AAC5D,mBAAmB,wCAAwC,CAAC;AAC5D,mBAAmB,wCAAwC,CAAC;AAC5D,mBAAmB,iCAAiC,CAAC;AACrD,mBAAmB,8BAA8B,CAAC;AAClD,mBAAmB,qCAAqC,CAAC;AACzD,mBAAmB,oCAAoC,CAAC;AACxD,mBAAmB,mCAAmC,CAAC;AACvD,mBAAmB,2CAA2C,CAAC;AAC/D,mBAAmB,qCAAqC,CAAC;AACzD,mBAAmB,mCAAmC,CAAC;AACvD,mBAAmB,uCAAuC,CAAC;AAC3D,mBAAmB,2CAA2C,CAAC;AAC/D,mBAAmB,oCAAoC,CAAC;AACxD,mBAAmB,kCAAkC,CAAC;AACtD,mBAAmB,uCAAuC,CAAC;AAC3D,mBAAmB,iCAAiC,CAAC;AACrD,mBAAmB,+BAA+B,CAAC;AACnD,mBAAmB,+CAA+C,CAAC;AACnE,mBAAmB,yCAAyC,CAAC;AAC7D,mBAAmB,uCAAuC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/service-operation/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,uBAAuB,CAAC;AAC3C,mBAAmB,oCAAoC,CAAC;AACxD,mBAAmB,yCAAyC,CAAC;AAC7D,mBAAmB,iCAAiC,CAAC;AACrD,mBAAmB,2CAA2C,CAAC;AAC/D,mBAAmB,qCAAqC,CAAC;AACzD,mBAAmB,mCAAmC,CAAC;AACvD,mBAAmB,oCAAoC,CAAC;AACxD,mBAAmB,wCAAwC,CAAC;AAC5D,mBAAmB,wCAAwC,CAAC;AAC5D,mBAAmB,wCAAwC,CAAC;AAC5D,mBAAmB,iCAAiC,CAAC;AACrD,mBAAmB,8BAA8B,CAAC;AAClD,mBAAmB,qCAAqC,CAAC;AACzD,mBAAmB,oCAAoC,CAAC;AACxD,mBAAmB,mCAAmC,CAAC;AACvD,mBAAmB,2CAA2C,CAAC;AAC/D,mBAAmB,qCAAqC,CAAC;AACzD,mBAAmB,mCAAmC,CAAC;AACvD,mBAAmB,uCAAuC,CAAC;AAC3D,mBAAmB,2CAA2C,CAAC;AAC/D,mBAAmB,oCAAoC,CAAC;AACxD,mBAAmB,kCAAkC,CAAC;AACtD,mBAAmB,uCAAuC,CAAC;AAC3D,mBAAmB,uCAAuC,CAAC;AAC3D,mBAAmB,iCAAiC,CAAC;AACrD,mBAAmB,+BAA+B,CAAC;AACnD,mBAAmB,+CAA+C,CAAC;AACnE,mBAAmB,yCAAyC,CAAC;AAC7D,mBAAmB,uCAAuC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openapi-qraft/tanstack-query-react-types",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.11.0",
|
|
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",
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
MutationFiltersByMutationKey,
|
|
3
|
+
MutationFiltersByParameters,
|
|
4
|
+
MutationVariables,
|
|
5
|
+
OperationError,
|
|
6
|
+
} from '@openapi-qraft/tanstack-query-react-types';
|
|
7
|
+
import type { Mutation, MutationCache } from '@tanstack/react-query';
|
|
8
|
+
|
|
9
|
+
export interface ServiceOperationGetMutationCache<
|
|
10
|
+
TSchema extends { url: string; method: string },
|
|
11
|
+
TBody,
|
|
12
|
+
TMutationData,
|
|
13
|
+
TMutationParams,
|
|
14
|
+
TError,
|
|
15
|
+
> {
|
|
16
|
+
getMutationCache(): Omit<MutationCache, 'find' | 'findAll'> & {
|
|
17
|
+
find<TContext = unknown>(
|
|
18
|
+
filters:
|
|
19
|
+
| MutationFiltersByParameters<
|
|
20
|
+
TBody,
|
|
21
|
+
TMutationData,
|
|
22
|
+
TMutationParams,
|
|
23
|
+
OperationError<TError>,
|
|
24
|
+
TContext
|
|
25
|
+
>
|
|
26
|
+
| MutationFiltersByMutationKey<
|
|
27
|
+
TSchema,
|
|
28
|
+
TBody,
|
|
29
|
+
TMutationData,
|
|
30
|
+
TMutationParams,
|
|
31
|
+
OperationError<TError>,
|
|
32
|
+
TContext
|
|
33
|
+
>
|
|
34
|
+
):
|
|
35
|
+
| Mutation<
|
|
36
|
+
TMutationData,
|
|
37
|
+
TError,
|
|
38
|
+
MutationVariables<TBody, TMutationParams>,
|
|
39
|
+
TContext
|
|
40
|
+
>
|
|
41
|
+
| undefined;
|
|
42
|
+
findAll<TContext = unknown>(
|
|
43
|
+
filters?:
|
|
44
|
+
| MutationFiltersByParameters<
|
|
45
|
+
TBody,
|
|
46
|
+
TMutationData,
|
|
47
|
+
TMutationParams,
|
|
48
|
+
OperationError<TError>,
|
|
49
|
+
TContext
|
|
50
|
+
>
|
|
51
|
+
| MutationFiltersByMutationKey<
|
|
52
|
+
TSchema,
|
|
53
|
+
TBody,
|
|
54
|
+
TMutationData,
|
|
55
|
+
TMutationParams,
|
|
56
|
+
OperationError<TError>,
|
|
57
|
+
TContext
|
|
58
|
+
>
|
|
59
|
+
): Array<
|
|
60
|
+
Mutation<
|
|
61
|
+
TMutationData,
|
|
62
|
+
TError,
|
|
63
|
+
MutationVariables<TBody, TMutationParams>,
|
|
64
|
+
TContext
|
|
65
|
+
>
|
|
66
|
+
>;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
@@ -22,6 +22,7 @@ export type * from './ServiceOperationUseIsFetchingQueries.js';
|
|
|
22
22
|
export type * from './ServiceOperationUseIsMutating.js';
|
|
23
23
|
export type * from './ServiceOperationUseMutation.js';
|
|
24
24
|
export type * from './ServiceOperationUseMutationState.js';
|
|
25
|
+
export type * from './ServiceOperationGetMutationCache.js';
|
|
25
26
|
export type * from './ServiceOperationUseQueries.js';
|
|
26
27
|
export type * from './ServiceOperationUseQuery.js';
|
|
27
28
|
export type * from './ServiceOperationUseSuspenseInfiniteQuery.js';
|