@tiesen/effect-tanstack-query 0.0.11 → 0.0.12

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/dist/index.d.mts CHANGED
@@ -1,7 +1,8 @@
1
- import { r as TanstackQueryOptionsProxy } from "./types-CCJtD9mu.mjs";
1
+ import { r as TanstackQueryOptionsProxy } from "./types-MoWlEtTb.mjs";
2
2
  import { Service } from "effect/Context";
3
3
  import { ManagedRuntime } from "effect/ManagedRuntime";
4
- //#region src/index.d.ts
4
+ import { NodeInspectSymbol } from "effect/Inspectable";
5
+ //#region src/create-proxy.d.ts
5
6
  /**
6
7
  * Creates a type-safe proxy that bridges Effect `HttpApiClient` endpoints
7
8
  * with TanStack Query options (`queryOptions`, `subscriptionOptions`, `mutationOptions`, and `getQueryKey`).
@@ -43,4 +44,4 @@ import { ManagedRuntime } from "effect/ManagedRuntime";
43
44
  */
44
45
  declare function createTanstackQueryOptionsProxy<TServiceTag, TService>(tag: Service<TServiceTag, TService>, runtime: ManagedRuntime<TServiceTag, never>): TanstackQueryOptionsProxy<TService>;
45
46
  //#endregion
46
- export { type TanstackQueryOptionsProxy, createTanstackQueryOptionsProxy };
47
+ export { type NodeInspectSymbol, type TanstackQueryOptionsProxy, createTanstackQueryOptionsProxy };
package/dist/react.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { n as SubscriptionReturns, t as SubscriptionOptions } from "./types-CCJtD9mu.mjs";
1
+ import { n as SubscriptionReturns, t as SubscriptionOptions } from "./types-MoWlEtTb.mjs";
2
2
  //#region src/react.d.ts
3
3
  declare function useSubscription<TData, TError>({ enabled, ...subscriptionOptions }: SubscriptionOptions<TData, TError> & {
4
4
  enabled?: boolean;
@@ -1,4 +1,4 @@
1
- import { DefinedInitialDataOptions, MutationOptions } from "@tanstack/react-query";
1
+ import { DefaultError, MutationOptions, QueryKey, QueryObserverOptions } from "@tanstack/query-core";
2
2
  import { Input } from "effect/Duration";
3
3
  import { Schema } from "effect/Schema";
4
4
  import { Client } from "effect/unstable/httpapi/HttpApiClient";
@@ -6,7 +6,7 @@ import { HttpApiEndpoint } from "effect/unstable/httpapi/HttpApiEndpoint";
6
6
  import { SseEventFromData, StreamSse } from "effect/unstable/httpapi/HttpApiSchema";
7
7
  //#region src/types.d.ts
8
8
  type TanstackQueryOptionsProxy<T> = T extends Client.Method<HttpApiEndpoint<infer _Key, infer Method, infer _Path, infer Params, infer Query, infer Payload, infer Headers, infer Success, infer Error, infer _Middleware>, infer _Error, infer _Requires> ? {
9
- queryOptions: Method extends 'GET' ? <TQuery = DefinedInitialDataOptions<UnwrapCodec<Success>, UnwrapCodec<Error>>>(input: MakeOptionalInput<([Params] extends [never] ? {} : {
9
+ queryOptions: Method extends 'GET' ? <TQuery = QueryOptions<UnwrapCodec<Success>, UnwrapCodec<Error>>>(input: MakeOptionalInput<([Params] extends [never] ? {} : {
10
10
  params: UnwrapCodec<Params>;
11
11
  }) & ([Query] extends [never] ? {} : {
12
12
  query: UnwrapCodec<Query>;
@@ -46,6 +46,9 @@ interface SubscriptionOptions<TData, TError> {
46
46
  onError?: (error: TError) => void;
47
47
  keepAliveTimeout?: Input;
48
48
  }
49
+ type QueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = QueryObserverOptions<TQueryFnData, TError, TData, TQueryFnData, TQueryKey> & {
50
+ subscribed?: boolean;
51
+ };
49
52
  interface SubscriptionReturns {
50
53
  status: 'connecting' | 'connected' | 'disconnected' | 'error';
51
54
  reconnect: () => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiesen/effect-tanstack-query",
3
- "version": "0.0.11",
3
+ "version": "0.0.12",
4
4
  "private": false,
5
5
  "description": "Effortlessly bridge Effect HTTP API clients with TanStack Query. Enjoy end-to-end type safety, zero-boilerplate options, and built-in streaming support out of the box.",
6
6
  "keywords": [
@@ -56,14 +56,14 @@
56
56
  },
57
57
  "devDependencies": {
58
58
  "@types/react": "^19.2.18",
59
- "oxfmt": "^0.61.0",
60
- "oxlint": "^1.76.0",
61
- "tegami": "^1.2.7",
59
+ "oxfmt": "^0.62.0",
60
+ "oxlint": "^1.77.0",
61
+ "tegami": "^1.3.1",
62
62
  "tsdown": "^0.22.14",
63
63
  "typescript": "^7.0.2"
64
64
  },
65
65
  "peerDependencies": {
66
- "@tanstack/react-query": ">=5.100.0",
66
+ "@tanstack/query-core": ">=5.100.0",
67
67
  "effect": ">=4.0.0-beta.100 || >=4.0.0",
68
68
  "react": ">=19.2.8"
69
69
  },
@@ -74,6 +74,6 @@
74
74
  },
75
75
  "packageManager": "bun@1.3.0",
76
76
  "patchedDependencies": {
77
- "tegami@1.2.7": "patches/tegami@1.2.7.patch"
77
+ "tegami@1.3.1": "patches/tegami@1.3.1.patch"
78
78
  }
79
79
  }