@rebasepro/client 0.34.2 → 0.35.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/dist/admin.d.ts +4 -1
- package/dist/index.d.ts +13 -0
- package/dist/index.es.js +40 -2
- package/dist/index.es.js.map +1 -1
- package/dist/{offline-ET6xI1ZO.js → offline-DSkf2JrL.js} +2 -2
- package/dist/offline-DSkf2JrL.js.map +1 -0
- package/dist/rpc.d.ts +19 -0
- package/package.json +4 -4
- package/dist/offline-ET6xI1ZO.js.map +0 -1
package/dist/rpc.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Transport } from "./transport.js";
|
|
2
|
+
/**
|
|
3
|
+
* Call a SQL function the backend declares with `defineRpc`:
|
|
4
|
+
* `POST /rpc/<name>` with the named arguments as the JSON body.
|
|
5
|
+
*
|
|
6
|
+
* Resolves to the function's result: an array (of rows, or of values) for a
|
|
7
|
+
* set-returning function, the row or the value for any other, `null` for
|
|
8
|
+
* `void`. Runs as the signed-in user, or anonymously when nobody is.
|
|
9
|
+
*
|
|
10
|
+
* ```ts
|
|
11
|
+
* const proposal = await client.rpc<Proposal | null>("get_public_proposal", { token });
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* The arguments can be typed from the declaration, which a frontend imports
|
|
15
|
+
* as a type: `client.rpc<Proposal, RpcArgs<typeof getPublicProposal>>(…)`.
|
|
16
|
+
*/
|
|
17
|
+
export type RpcCall = <T = unknown, A extends Record<string, unknown> = Record<string, unknown>>(name: string, args?: A) => Promise<T>;
|
|
18
|
+
/** @internal */
|
|
19
|
+
export declare function createRpcCall(transport: Transport): RpcCall;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rebasepro/client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.35.0",
|
|
4
4
|
"description": "HTTP SDK client for the Rebase custom backend",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"rebase",
|
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
"./package.json": "./package.json"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@rebasepro/
|
|
45
|
-
"@rebasepro/
|
|
46
|
-
"@rebasepro/utils": "0.
|
|
44
|
+
"@rebasepro/common": "0.35.0",
|
|
45
|
+
"@rebasepro/types": "0.35.0",
|
|
46
|
+
"@rebasepro/utils": "0.35.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@jest/globals": "^30.4.1",
|