@confect/js 10.0.0-next.22 → 10.0.0-next.24
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 +10 -0
- package/dist/HttpClient.d.ts +3 -1
- package/dist/HttpClient.d.ts.map +1 -1
- package/dist/HttpClient.js +3 -1
- package/dist/HttpClient.js.map +1 -1
- package/dist/WebSocketClient.d.ts +5 -1
- package/dist/WebSocketClient.d.ts.map +1 -1
- package/dist/WebSocketClient.js +5 -1
- package/dist/WebSocketClient.js.map +1 -1
- package/package.json +7 -6
- package/src/HttpClient.ts +3 -1
- package/src/WebSocketClient.ts +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @confect/js
|
|
2
2
|
|
|
3
|
+
## 10.0.0-next.24
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 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.
|
|
8
|
+
|
|
9
|
+
## 10.0.0-next.23
|
|
10
|
+
|
|
11
|
+
No changes in this release.
|
|
12
|
+
|
|
3
13
|
## 10.0.0-next.22
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
package/dist/HttpClient.d.ts
CHANGED
|
@@ -4,7 +4,9 @@ import * as Layer from "effect/Layer";
|
|
|
4
4
|
import * as InternalHttpClient from "./internal/HttpClient";
|
|
5
5
|
export { HttpClientError } from "./internal/HttpClient";
|
|
6
6
|
/**
|
|
7
|
-
* A Confect client which uses HTTP to communicate with your Convex backend.
|
|
7
|
+
* A Confect client which uses HTTP to communicate with your Convex backend.
|
|
8
|
+
* Works in any JS runtime that supports `fetch`. Wraps
|
|
9
|
+
* [ConvexHttpClient](https://docs.convex.dev/api/classes/browser.ConvexHttpClient).
|
|
8
10
|
*/
|
|
9
11
|
export declare const HttpClient: Context.Service<{
|
|
10
12
|
url: string;
|
package/dist/HttpClient.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HttpClient.d.ts","sourceRoot":"","sources":["../src/HttpClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,kBAAkB,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAoBxD
|
|
1
|
+
{"version":3,"file":"HttpClient.d.ts","sourceRoot":"","sources":["../src/HttpClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,kBAAkB,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAoBxD;;;;GAIG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;EAEtB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC,UAAU,CAAC;AAEtD,eAAO,MAAM,KAAK,YACP,MAAM,YACL,qBAAqB,CAAC,OAAO,gBAAgB,CAAC,CAAC,CAAC,CAAC;;;;;;;gBACJ,CAAC"}
|
package/dist/HttpClient.js
CHANGED
|
@@ -21,7 +21,9 @@ const make = (address, options) => {
|
|
|
21
21
|
});
|
|
22
22
|
};
|
|
23
23
|
/**
|
|
24
|
-
* A Confect client which uses HTTP to communicate with your Convex backend.
|
|
24
|
+
* A Confect client which uses HTTP to communicate with your Convex backend.
|
|
25
|
+
* Works in any JS runtime that supports `fetch`. Wraps
|
|
26
|
+
* [ConvexHttpClient](https://docs.convex.dev/api/classes/browser.ConvexHttpClient).
|
|
25
27
|
*/
|
|
26
28
|
const HttpClient = Context.Service("@confect/js/HttpClient");
|
|
27
29
|
const layer = (address, options) => Layer.sync(HttpClient, () => make(address, options));
|
package/dist/HttpClient.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HttpClient.js","names":["InternalHttpClient.make"],"sources":["../src/HttpClient.ts"],"sourcesContent":["import { ConvexHttpClient } from \"convex/browser\";\nimport * as Context from \"effect/Context\";\nimport * as Layer from \"effect/Layer\";\nimport * as InternalHttpClient from \"./internal/HttpClient\";\n\nexport { HttpClientError } from \"./internal/HttpClient\";\n\nconst make = (\n address: string,\n options?: ConstructorParameters<typeof ConvexHttpClient>[1],\n) => {\n const client = new ConvexHttpClient(address, options);\n return InternalHttpClient.make({\n url: client.url,\n setAuth: (token) => client.setAuth(token),\n clearAuth: () => client.clearAuth(),\n query: (functionReference, encodedArgs) =>\n client.query(functionReference, encodedArgs),\n mutation: (functionReference, encodedArgs) =>\n client.mutation(functionReference, encodedArgs),\n action: (functionReference, encodedArgs) =>\n client.action(functionReference, encodedArgs),\n });\n};\n\n/**\n * A Confect client which uses HTTP to communicate with your Convex backend
|
|
1
|
+
{"version":3,"file":"HttpClient.js","names":["InternalHttpClient.make"],"sources":["../src/HttpClient.ts"],"sourcesContent":["import { ConvexHttpClient } from \"convex/browser\";\nimport * as Context from \"effect/Context\";\nimport * as Layer from \"effect/Layer\";\nimport * as InternalHttpClient from \"./internal/HttpClient\";\n\nexport { HttpClientError } from \"./internal/HttpClient\";\n\nconst make = (\n address: string,\n options?: ConstructorParameters<typeof ConvexHttpClient>[1],\n) => {\n const client = new ConvexHttpClient(address, options);\n return InternalHttpClient.make({\n url: client.url,\n setAuth: (token) => client.setAuth(token),\n clearAuth: () => client.clearAuth(),\n query: (functionReference, encodedArgs) =>\n client.query(functionReference, encodedArgs),\n mutation: (functionReference, encodedArgs) =>\n client.mutation(functionReference, encodedArgs),\n action: (functionReference, encodedArgs) =>\n client.action(functionReference, encodedArgs),\n });\n};\n\n/**\n * A Confect client which uses HTTP to communicate with your Convex backend.\n * Works in any JS runtime that supports `fetch`. Wraps\n * [ConvexHttpClient](https://docs.convex.dev/api/classes/browser.ConvexHttpClient).\n */\nexport const HttpClient = Context.Service<ReturnType<typeof make>>(\n \"@confect/js/HttpClient\",\n);\n\nexport type HttpClient = typeof HttpClient.Identifier;\n\nexport const layer = (\n address: string,\n options?: ConstructorParameters<typeof ConvexHttpClient>[1],\n) => Layer.sync(HttpClient, () => make(address, options));\n"],"mappings":";;;;;;;;;;;AAOA,MAAM,QACJ,SACA,YACG;CACH,MAAM,SAAS,IAAI,iBAAiB,SAAS,OAAO;CACpD,OAAOA,OAAwB;EAC7B,KAAK,OAAO;EACZ,UAAU,UAAU,OAAO,QAAQ,KAAK;EACxC,iBAAiB,OAAO,UAAU;EAClC,QAAQ,mBAAmB,gBACzB,OAAO,MAAM,mBAAmB,WAAW;EAC7C,WAAW,mBAAmB,gBAC5B,OAAO,SAAS,mBAAmB,WAAW;EAChD,SAAS,mBAAmB,gBAC1B,OAAO,OAAO,mBAAmB,WAAW;CAChD,CAAC;AACH;;;;;;AAOA,MAAa,aAAa,QAAQ,QAChC,wBACF;AAIA,MAAa,SACX,SACA,YACG,MAAM,KAAK,kBAAkB,KAAK,SAAS,OAAO,CAAC"}
|
|
@@ -5,7 +5,11 @@ import * as Layer from "effect/Layer";
|
|
|
5
5
|
import * as InternalWebSocketClient from "./internal/WebSocketClient";
|
|
6
6
|
export { WebSocketClientError } from "./internal/WebSocketClient";
|
|
7
7
|
/**
|
|
8
|
-
* A Confect client which uses a WebSocket to communicate with your Convex
|
|
8
|
+
* A Confect client which uses a WebSocket to communicate with your Convex
|
|
9
|
+
* backend and supports reactive query subscriptions. The WebSocket connection
|
|
10
|
+
* is managed by the layer's scope and closed automatically when the scope ends.
|
|
11
|
+
* Wraps
|
|
12
|
+
* [ConvexClient](https://docs.convex.dev/api/classes/browser.ConvexClient).
|
|
9
13
|
*/
|
|
10
14
|
export declare const WebSocketClient: Context.Service<{
|
|
11
15
|
url: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebSocketClient.d.ts","sourceRoot":"","sources":["../src/WebSocketClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,uBAAuB,MAAM,4BAA4B,CAAC;AAEtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAiClE
|
|
1
|
+
{"version":3,"file":"WebSocketClient.d.ts","sourceRoot":"","sources":["../src/WebSocketClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,uBAAuB,MAAM,4BAA4B,CAAC;AAEtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAiClE;;;;;;GAMG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;EAEI,CAAC;AAEjC,MAAM,MAAM,eAAe,GAAG,OAAO,eAAe,CAAC,UAAU,CAAC;AAEhE,eAAO,MAAM,KAAK,YACP,MAAM,YACL,qBAAqB,CAAC,OAAO,YAAY,CAAC,CAAC,CAAC,CAAC;;;;;;;;;;gBACC,CAAC"}
|
package/dist/WebSocketClient.js
CHANGED
|
@@ -22,7 +22,11 @@ const make = (address, options) => makeScoped(address, Effect.sync(() => {
|
|
|
22
22
|
};
|
|
23
23
|
}));
|
|
24
24
|
/**
|
|
25
|
-
* A Confect client which uses a WebSocket to communicate with your Convex
|
|
25
|
+
* A Confect client which uses a WebSocket to communicate with your Convex
|
|
26
|
+
* backend and supports reactive query subscriptions. The WebSocket connection
|
|
27
|
+
* is managed by the layer's scope and closed automatically when the scope ends.
|
|
28
|
+
* Wraps
|
|
29
|
+
* [ConvexClient](https://docs.convex.dev/api/classes/browser.ConvexClient).
|
|
26
30
|
*/
|
|
27
31
|
const WebSocketClient = Context.Service("@confect/js/WebSocketClient");
|
|
28
32
|
const layer = (address, options) => Layer.effect(WebSocketClient, make(address, options));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebSocketClient.js","names":["InternalWebSocketClient.makeScoped"],"sources":["../src/WebSocketClient.ts"],"sourcesContent":["import { ConvexClient } from \"convex/browser\";\nimport * as Context from \"effect/Context\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as InternalWebSocketClient from \"./internal/WebSocketClient\";\n\nexport { WebSocketClientError } from \"./internal/WebSocketClient\";\n\nconst make = (\n address: string,\n options?: ConstructorParameters<typeof ConvexClient>[1],\n) =>\n InternalWebSocketClient.makeScoped(\n address,\n Effect.sync(() => {\n const convexClient = new ConvexClient(address, options);\n return {\n setAuth: (fetchToken, onChange) =>\n onChange === undefined\n ? convexClient.setAuth(fetchToken)\n : convexClient.setAuth(fetchToken, onChange),\n close: () => convexClient.close(),\n query: (functionReference, encodedArgs) =>\n convexClient.query(functionReference, encodedArgs),\n mutation: (functionReference, encodedArgs) =>\n convexClient.mutation(functionReference, encodedArgs),\n action: (functionReference, encodedArgs) =>\n convexClient.action(functionReference, encodedArgs),\n onUpdate: (functionReference, encodedArgs, onUpdate, onError) =>\n convexClient.onUpdate(\n functionReference,\n encodedArgs,\n onUpdate,\n onError,\n ),\n };\n }),\n );\n\n/**\n * A Confect client which uses a WebSocket to communicate with your Convex backend and supports reactive query subscriptions. The WebSocket connection is managed by the layer's scope and closed automatically when the scope ends
|
|
1
|
+
{"version":3,"file":"WebSocketClient.js","names":["InternalWebSocketClient.makeScoped"],"sources":["../src/WebSocketClient.ts"],"sourcesContent":["import { ConvexClient } from \"convex/browser\";\nimport * as Context from \"effect/Context\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as InternalWebSocketClient from \"./internal/WebSocketClient\";\n\nexport { WebSocketClientError } from \"./internal/WebSocketClient\";\n\nconst make = (\n address: string,\n options?: ConstructorParameters<typeof ConvexClient>[1],\n) =>\n InternalWebSocketClient.makeScoped(\n address,\n Effect.sync(() => {\n const convexClient = new ConvexClient(address, options);\n return {\n setAuth: (fetchToken, onChange) =>\n onChange === undefined\n ? convexClient.setAuth(fetchToken)\n : convexClient.setAuth(fetchToken, onChange),\n close: () => convexClient.close(),\n query: (functionReference, encodedArgs) =>\n convexClient.query(functionReference, encodedArgs),\n mutation: (functionReference, encodedArgs) =>\n convexClient.mutation(functionReference, encodedArgs),\n action: (functionReference, encodedArgs) =>\n convexClient.action(functionReference, encodedArgs),\n onUpdate: (functionReference, encodedArgs, onUpdate, onError) =>\n convexClient.onUpdate(\n functionReference,\n encodedArgs,\n onUpdate,\n onError,\n ),\n };\n }),\n );\n\n/**\n * A Confect client which uses a WebSocket to communicate with your Convex\n * backend and supports reactive query subscriptions. The WebSocket connection\n * is managed by the layer's scope and closed automatically when the scope ends.\n * Wraps\n * [ConvexClient](https://docs.convex.dev/api/classes/browser.ConvexClient).\n */\nexport const WebSocketClient = Context.Service<\n Effect.Success<ReturnType<typeof make>>\n>(\"@confect/js/WebSocketClient\");\n\nexport type WebSocketClient = typeof WebSocketClient.Identifier;\n\nexport const layer = (\n address: string,\n options?: ConstructorParameters<typeof ConvexClient>[1],\n) => Layer.effect(WebSocketClient, make(address, options));\n"],"mappings":";;;;;;;;;;;;AAQA,MAAM,QACJ,SACA,YAEAA,WACE,SACA,OAAO,WAAW;CAChB,MAAM,eAAe,IAAI,aAAa,SAAS,OAAO;CACtD,OAAO;EACL,UAAU,YAAY,aACpB,aAAa,KAAA,IACT,aAAa,QAAQ,UAAU,IAC/B,aAAa,QAAQ,YAAY,QAAQ;EAC/C,aAAa,aAAa,MAAM;EAChC,QAAQ,mBAAmB,gBACzB,aAAa,MAAM,mBAAmB,WAAW;EACnD,WAAW,mBAAmB,gBAC5B,aAAa,SAAS,mBAAmB,WAAW;EACtD,SAAS,mBAAmB,gBAC1B,aAAa,OAAO,mBAAmB,WAAW;EACpD,WAAW,mBAAmB,aAAa,UAAU,YACnD,aAAa,SACX,mBACA,aACA,UACA,OACF;CACJ;AACF,CAAC,CACH;;;;;;;;AASF,MAAa,kBAAkB,QAAQ,QAErC,6BAA6B;AAI/B,MAAa,SACX,SACA,YACG,MAAM,OAAO,iBAAiB,KAAK,SAAS,OAAO,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@confect/js",
|
|
3
3
|
"description": "JavaScript client bindings for any JS runtime",
|
|
4
|
-
"version": "10.0.0-next.
|
|
4
|
+
"version": "10.0.0-next.24",
|
|
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.
|
|
10
|
+
"@effect/vitest": "4.0.0-rc.117",
|
|
11
11
|
"@types/node": "24.13.3",
|
|
12
|
-
"effect": "4.0.0-rc.
|
|
12
|
+
"effect": "4.0.0-rc.117",
|
|
13
13
|
"tsdown": "0.23.0",
|
|
14
14
|
"typescript": "7.0.2",
|
|
15
15
|
"unrun": "0.3.1",
|
|
@@ -47,9 +47,9 @@
|
|
|
47
47
|
"main": "./dist/index.js",
|
|
48
48
|
"module": "./dist/index.js",
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@confect/core": "^10.0.0-next.
|
|
50
|
+
"@confect/core": "^10.0.0-next.24",
|
|
51
51
|
"convex": "^1.32.0",
|
|
52
|
-
"effect": "^4.0.0-rc.
|
|
52
|
+
"effect": "^4.0.0-rc.117"
|
|
53
53
|
},
|
|
54
54
|
"repository": {
|
|
55
55
|
"type": "git",
|
|
@@ -62,6 +62,7 @@
|
|
|
62
62
|
"clean": "shx rm -rf dist coverage node_modules",
|
|
63
63
|
"dev": "tsdown --watch --no-clean --config-loader unrun",
|
|
64
64
|
"test": "vitest run",
|
|
65
|
-
"typecheck": "tsc -b tsconfig.src.json"
|
|
65
|
+
"typecheck": "tsc -b tsconfig.src.json",
|
|
66
|
+
"typecheck:inexact": "tsc --noEmit --project tsconfig.json --exactOptionalPropertyTypes false"
|
|
66
67
|
}
|
|
67
68
|
}
|
package/src/HttpClient.ts
CHANGED
|
@@ -24,7 +24,9 @@ const make = (
|
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
|
-
* A Confect client which uses HTTP to communicate with your Convex backend.
|
|
27
|
+
* A Confect client which uses HTTP to communicate with your Convex backend.
|
|
28
|
+
* Works in any JS runtime that supports `fetch`. Wraps
|
|
29
|
+
* [ConvexHttpClient](https://docs.convex.dev/api/classes/browser.ConvexHttpClient).
|
|
28
30
|
*/
|
|
29
31
|
export const HttpClient = Context.Service<ReturnType<typeof make>>(
|
|
30
32
|
"@confect/js/HttpClient",
|
package/src/WebSocketClient.ts
CHANGED
|
@@ -38,7 +38,11 @@ const make = (
|
|
|
38
38
|
);
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
|
-
* A Confect client which uses a WebSocket to communicate with your Convex
|
|
41
|
+
* A Confect client which uses a WebSocket to communicate with your Convex
|
|
42
|
+
* backend and supports reactive query subscriptions. The WebSocket connection
|
|
43
|
+
* is managed by the layer's scope and closed automatically when the scope ends.
|
|
44
|
+
* Wraps
|
|
45
|
+
* [ConvexClient](https://docs.convex.dev/api/classes/browser.ConvexClient).
|
|
42
46
|
*/
|
|
43
47
|
export const WebSocketClient = Context.Service<
|
|
44
48
|
Effect.Success<ReturnType<typeof make>>
|