@confect/foldkit 10.0.0-next.23 → 10.0.0-next.25

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 CHANGED
@@ -1,5 +1,23 @@
1
1
  # @confect/foldkit
2
2
 
3
+ ## 10.0.0-next.25
4
+
5
+ ### Minor Changes
6
+
7
+ - 1660d3a: Allow `setAuth` callbacks on `WebSocketClient` and Foldkit's `Client` to require Effect services. Provide those services when running `setAuth`; the token provider and authentication-state callback use them for later invocations, including token refreshes.
8
+
9
+ Keep scoped callback dependencies alive while authentication remains registered. Callbacks without dependencies continue to work unchanged.
10
+
11
+ ### Patch Changes
12
+
13
+ - f9958b9: Require `effect@^4.0.0-rc.118` and matching Effect platform packages. Upgrade Effect alongside Confect and replace `effect/unstable/*` imports with `effect/*`, using `effect/http-api` for HTTP API imports.
14
+
15
+ ## 10.0.0-next.24
16
+
17
+ ### Patch Changes
18
+
19
+ - 850a3c3: Require `effect@^4.0.0-rc.117` across `@confect/*` and `@effect/platform-node@^4.0.0-rc.117` for `@confect/server`'s optional Node integration. Upgrade these dependencies alongside Confect; existing Confect call sites are unchanged.
20
+
3
21
  ## 10.0.0-next.23
4
22
 
5
23
  No changes in this release.
package/dist/Client.d.ts CHANGED
@@ -11,9 +11,9 @@ import * as Option from "effect/Option";
11
11
  */
12
12
  export declare const make: (webSocketClient: WebSocketClient.WebSocketClient) => Effect.Effect<{
13
13
  url: string;
14
- setAuth: (fetchToken: (args: {
14
+ setAuth: <R1 = never, R2 = never>(fetchToken: (args: {
15
15
  forceRefreshToken: boolean;
16
- }) => Effect.Effect<string | null | undefined>, onChange?: (isAuthenticated: boolean) => Effect.Effect<void>) => Effect.Effect<void, never, never>;
16
+ }) => Effect.Effect<string | null | undefined, never, R1>, onChange?: (isAuthenticated: boolean) => Effect.Effect<void, never, R2>) => Effect.Effect<void, never, R1 | R2>;
17
17
  query: <Query extends import("@confect/core/Ref").AnyPublicQuery>(ref: Query, ...rest: import("@confect/core/Ref").OptionalArgs<Query>) => Effect.Effect<import("@confect/core/Ref").Returns<Query>, import("@confect/core/Ref").Error<Query> | WebSocketClient.WebSocketClientError | import("effect/Schema").SchemaError>;
18
18
  mutation: <Mutation extends import("@confect/core/Ref").AnyPublicMutation>(ref: Mutation, ...rest: import("@confect/core/Ref").OptionalArgs<Mutation>) => Effect.Effect<import("@confect/core/Ref").Returns<Mutation>, import("@confect/core/Ref").Error<Mutation> | WebSocketClient.WebSocketClientError | import("effect/Schema").SchemaError>;
19
19
  action: <Action extends import("@confect/core/Ref").AnyPublicAction>(ref: Action, ...rest: import("@confect/core/Ref").OptionalArgs<Action>) => Effect.Effect<import("@confect/core/Ref").Returns<Action>, import("@confect/core/Ref").Error<Action> | WebSocketClient.WebSocketClientError | import("effect/Schema").SchemaError>;
@@ -28,9 +28,9 @@ export declare const make: (webSocketClient: WebSocketClient.WebSocketClient) =>
28
28
  */
29
29
  export declare const Client: Context.Service<{
30
30
  url: string;
31
- setAuth: (fetchToken: (args: {
31
+ setAuth: <R1 = never, R2 = never>(fetchToken: (args: {
32
32
  forceRefreshToken: boolean;
33
- }) => Effect.Effect<string | null | undefined>, onChange?: (isAuthenticated: boolean) => Effect.Effect<void>) => Effect.Effect<void, never, never>;
33
+ }) => Effect.Effect<string | null | undefined, never, R1>, onChange?: (isAuthenticated: boolean) => Effect.Effect<void, never, R2>) => Effect.Effect<void, never, R1 | R2>;
34
34
  query: <Query extends import("@confect/core/Ref").AnyPublicQuery>(ref: Query, ...rest: import("@confect/core/Ref").OptionalArgs<Query>) => Effect.Effect<import("@confect/core/Ref").Returns<Query>, import("@confect/core/Ref").Error<Query> | WebSocketClient.WebSocketClientError | import("effect/Schema").SchemaError>;
35
35
  mutation: <Mutation extends import("@confect/core/Ref").AnyPublicMutation>(ref: Mutation, ...rest: import("@confect/core/Ref").OptionalArgs<Mutation>) => Effect.Effect<import("@confect/core/Ref").Returns<Mutation>, import("@confect/core/Ref").Error<Mutation> | WebSocketClient.WebSocketClientError | import("effect/Schema").SchemaError>;
36
36
  action: <Action extends import("@confect/core/Ref").AnyPublicAction>(ref: Action, ...rest: import("@confect/core/Ref").OptionalArgs<Action>) => Effect.Effect<import("@confect/core/Ref").Returns<Action>, import("@confect/core/Ref").Error<Action> | WebSocketClient.WebSocketClientError | import("effect/Schema").SchemaError>;
@@ -39,9 +39,9 @@ export declare const Client: Context.Service<{
39
39
  resolvePaginationId: (restored: Option.Option<number>) => Effect.Effect<number, never, never>;
40
40
  }, {
41
41
  url: string;
42
- setAuth: (fetchToken: (args: {
42
+ setAuth: <R1 = never, R2 = never>(fetchToken: (args: {
43
43
  forceRefreshToken: boolean;
44
- }) => Effect.Effect<string | null | undefined>, onChange?: (isAuthenticated: boolean) => Effect.Effect<void>) => Effect.Effect<void, never, never>;
44
+ }) => Effect.Effect<string | null | undefined, never, R1>, onChange?: (isAuthenticated: boolean) => Effect.Effect<void, never, R2>) => Effect.Effect<void, never, R1 | R2>;
45
45
  query: <Query extends import("@confect/core/Ref").AnyPublicQuery>(ref: Query, ...rest: import("@confect/core/Ref").OptionalArgs<Query>) => Effect.Effect<import("@confect/core/Ref").Returns<Query>, import("@confect/core/Ref").Error<Query> | WebSocketClient.WebSocketClientError | import("effect/Schema").SchemaError>;
46
46
  mutation: <Mutation extends import("@confect/core/Ref").AnyPublicMutation>(ref: Mutation, ...rest: import("@confect/core/Ref").OptionalArgs<Mutation>) => Effect.Effect<import("@confect/core/Ref").Returns<Mutation>, import("@confect/core/Ref").Error<Mutation> | WebSocketClient.WebSocketClientError | import("effect/Schema").SchemaError>;
47
47
  action: <Action extends import("@confect/core/Ref").AnyPublicAction>(ref: Action, ...rest: import("@confect/core/Ref").OptionalArgs<Action>) => Effect.Effect<import("@confect/core/Ref").Returns<Action>, import("@confect/core/Ref").Error<Action> | WebSocketClient.WebSocketClientError | import("effect/Schema").SchemaError>;
@@ -55,9 +55,9 @@ export type Client = typeof Client.Identifier;
55
55
  */
56
56
  export declare const layer: (address: string, options?: ConstructorParameters<typeof ConvexClient>[1]) => Layer.Layer<{
57
57
  url: string;
58
- setAuth: (fetchToken: (args: {
58
+ setAuth: <R1 = never, R2 = never>(fetchToken: (args: {
59
59
  forceRefreshToken: boolean;
60
- }) => Effect.Effect<string | null | undefined>, onChange?: (isAuthenticated: boolean) => Effect.Effect<void>) => Effect.Effect<void, never, never>;
60
+ }) => Effect.Effect<string | null | undefined, never, R1>, onChange?: (isAuthenticated: boolean) => Effect.Effect<void, never, R2>) => Effect.Effect<void, never, R1 | R2>;
61
61
  query: <Query extends import("@confect/core/Ref").AnyPublicQuery>(ref: Query, ...rest: import("@confect/core/Ref").OptionalArgs<Query>) => Effect.Effect<import("@confect/core/Ref").Returns<Query>, import("@confect/core/Ref").Error<Query> | WebSocketClient.WebSocketClientError | import("effect/Schema").SchemaError>;
62
62
  mutation: <Mutation extends import("@confect/core/Ref").AnyPublicMutation>(ref: Mutation, ...rest: import("@confect/core/Ref").OptionalArgs<Mutation>) => Effect.Effect<import("@confect/core/Ref").Returns<Mutation>, import("@confect/core/Ref").Error<Mutation> | WebSocketClient.WebSocketClientError | import("effect/Schema").SchemaError>;
63
63
  action: <Action extends import("@confect/core/Ref").AnyPublicAction>(ref: Action, ...rest: import("@confect/core/Ref").OptionalArgs<Action>) => Effect.Effect<import("@confect/core/Ref").Returns<Action>, import("@confect/core/Ref").Error<Action> | WebSocketClient.WebSocketClientError | import("effect/Schema").SchemaError>;
package/package.json CHANGED
@@ -1,22 +1,22 @@
1
1
  {
2
2
  "name": "@confect/foldkit",
3
3
  "description": "Client-side bindings for Foldkit apps",
4
- "version": "10.0.0-next.23",
4
+ "version": "10.0.0-next.25",
5
5
  "author": "RJ Dellecese",
6
6
  "bugs": {
7
7
  "url": "https://github.com/rjdellecese/confect/issues"
8
8
  },
9
9
  "devDependencies": {
10
- "@effect/vitest": "4.0.0-rc.115",
10
+ "@effect/vitest": "4.0.0-rc.118",
11
11
  "@types/node": "24.13.3",
12
12
  "confect-test-types": "0.0.0",
13
13
  "convex": "1.45.0",
14
- "effect": "4.0.0-rc.115",
14
+ "effect": "4.0.0-rc.118",
15
15
  "foldkit": "0.148.1",
16
16
  "tsdown": "0.23.0",
17
17
  "typescript": "7.0.2",
18
18
  "unrun": "0.3.1",
19
- "vitest": "5.0.0"
19
+ "vitest": "5.0.1"
20
20
  },
21
21
  "engines": {
22
22
  "node": ">=24"
@@ -51,9 +51,9 @@
51
51
  "main": "./dist/index.js",
52
52
  "module": "./dist/index.js",
53
53
  "peerDependencies": {
54
- "@confect/core": "^10.0.0-next.23",
55
- "@confect/js": "^10.0.0-next.23",
56
- "effect": "^4.0.0-rc.115",
54
+ "@confect/core": "^10.0.0-next.25",
55
+ "@confect/js": "^10.0.0-next.25",
56
+ "effect": "^4.0.0-rc.118",
57
57
  "foldkit": "^0.148.0"
58
58
  },
59
59
  "repository": {