@tuyau/query-core 1.1.0 → 1.1.1

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/build/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { QueryFilters, SkipToken, skipToken, QueryFunctionContext } from '@tanstack/query-core';
2
- import { RawRequestArgs, BaseRequestOptions } from '@tuyau/core/types';
2
+ import { BaseRequestOptions, RawRequestArgs } from '@tuyau/core/types';
3
3
  import { Tuyau } from '@tuyau/core/client';
4
4
 
5
5
  /**
@@ -164,6 +164,7 @@ interface CreateMutationFnOptions {
164
164
  opts?: TuyauQueryBaseOptions;
165
165
  routeName: string;
166
166
  client: Tuyau<any>;
167
+ globalOptions?: TuyauRequestOptions;
167
168
  }
168
169
  /**
169
170
  * Creates a TanStack Query `mutationFn` from Tuyau route information.
@@ -171,4 +172,5 @@ interface CreateMutationFnOptions {
171
172
  */
172
173
  declare function createMutationFn(options: CreateMutationFnOptions): (request: any) => Promise<any>;
173
174
 
174
- export { type CreateInfiniteQueryFnOptions, type CreateMutationFnOptions, type CreateQueryFnOptions, type DecorateRouterKeyable, type DistributiveOmit, type Fn, type QueryType, type TuyauMutationKey, type TuyauQueryBaseOptions, type TuyauQueryKey, type TuyauRequestOptions, type WithRequired, buildKey, createInfiniteQueryFn, createMutationFn, createQueryFn, extractKyOptions, getMutationKeyInternal, invoke, isObject, segmentsToRouteName, toSnakeCase };
175
+ export { buildKey, createInfiniteQueryFn, createMutationFn, createQueryFn, extractKyOptions, getMutationKeyInternal, invoke, isObject, segmentsToRouteName, toSnakeCase };
176
+ export type { CreateInfiniteQueryFnOptions, CreateMutationFnOptions, CreateQueryFnOptions, DecorateRouterKeyable, DistributiveOmit, Fn, QueryType, TuyauMutationKey, TuyauQueryBaseOptions, TuyauQueryKey, TuyauRequestOptions, WithRequired };
package/build/index.js CHANGED
@@ -62,6 +62,7 @@ function createQueryFn(options) {
62
62
  const effectiveAbortOnUnmount = opts?.tuyau?.abortOnUnmount ?? globalOptions?.abortOnUnmount ?? false;
63
63
  const kyOptions = extractKyOptions(opts?.tuyau);
64
64
  return await client.request(routeName, {
65
+ ...extractKyOptions(globalOptions),
65
66
  ...request,
66
67
  ...kyOptions,
67
68
  retry: 0,
@@ -96,6 +97,7 @@ function createInfiniteQueryFn(options) {
96
97
  requestArgs = { query: pageParam !== void 0 ? { [pageParamKey]: pageParam } : {} };
97
98
  }
98
99
  return await client.request(routeName, {
100
+ ...extractKyOptions(globalOptions),
99
101
  ...requestArgs,
100
102
  ...kyOptions,
101
103
  retry: 0,
@@ -115,6 +117,7 @@ function createMutationFn(options) {
115
117
  const kyOptions = extractKyOptions(options.opts?.tuyau);
116
118
  const requestArgs = request || {};
117
119
  return await options.client.request(options.routeName, {
120
+ ...extractKyOptions(options.globalOptions),
118
121
  ...requestArgs,
119
122
  ...kyOptions,
120
123
  retry: 0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tuyau/query-core",
3
3
  "type": "module",
4
- "version": "1.1.0",
4
+ "version": "1.1.1",
5
5
  "description": "Shared utilities for Tuyau Tanstack Query integrations",
6
6
  "author": "Julien Ripouteau <julien@ripouteau.com>",
7
7
  "license": "MIT",
@@ -36,8 +36,8 @@
36
36
  "@tuyau/core": "^1.0.0-beta.9"
37
37
  },
38
38
  "devDependencies": {
39
- "@tanstack/query-core": "^5.74.7",
40
- "@tuyau/core": "1.2.1"
39
+ "@tanstack/query-core": "^5.104.3",
40
+ "@tuyau/core": "1.2.3"
41
41
  },
42
42
  "tsup": {
43
43
  "entry": [