rpc-express-toolkit-safe 4.1.0 → 4.3.3
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/README.md +12 -7
- package/index.d.ts +0 -0
- package/index.js +0 -0
- package/package.json +28 -28
package/README.md
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
This package is a thin wrapper around `rpc-express-toolkit/safe` that enables a “safe preset” import path.
|
|
4
4
|
|
|
5
|
-
- Server
|
|
5
|
+
- Server class: `new RpcSafeEndpoint(app, context, options?)`
|
|
6
6
|
- Applies `{ safeEnabled: true, strictMode: true }` by default
|
|
7
|
-
- Client
|
|
7
|
+
- Client class: `new RpcSafeClient(endpoint, headers?, options?)`
|
|
8
8
|
- Applies `{ safeEnabled: true }` by default
|
|
9
9
|
|
|
10
10
|
Usage:
|
|
@@ -12,15 +12,20 @@ Usage:
|
|
|
12
12
|
```js
|
|
13
13
|
// Server
|
|
14
14
|
const express = require('express');
|
|
15
|
-
const {
|
|
15
|
+
const { RpcSafeEndpoint } = require('rpc-express-toolkit-safe');
|
|
16
16
|
const app = express();
|
|
17
17
|
app.use(express.json());
|
|
18
|
-
const rpc =
|
|
18
|
+
const rpc = new RpcSafeEndpoint(app, {}, { endpoint: '/api' });
|
|
19
19
|
|
|
20
20
|
// Client
|
|
21
|
-
const {
|
|
22
|
-
const client =
|
|
21
|
+
const { RpcSafeClient } = require('rpc-express-toolkit-safe');
|
|
22
|
+
const client = new RpcSafeClient('http://localhost:3000/api');
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
The deprecated `createSafeEndpoint()` and `createSafeClient()` factory functions are still exported for compatibility.
|
|
26
26
|
|
|
27
|
+
Under the hood this package simply exports from `rpc-express-toolkit/safe` and depends on `rpc-express-toolkit`.
|
|
28
|
+
|
|
29
|
+
## License
|
|
30
|
+
|
|
31
|
+
MIT. See [LICENSE](../../LICENSE).
|
package/index.d.ts
CHANGED
|
File without changes
|
package/index.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "rpc-express-toolkit-safe",
|
|
3
|
-
"version": "4.
|
|
4
|
-
"description": "Safe preset wrapper for rpc-express-toolkit (safeEnabled defaults to true).",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"main": "index.js",
|
|
7
|
-
"types": "index.d.ts",
|
|
8
|
-
"repository": {
|
|
9
|
-
"type": "git",
|
|
10
|
-
"url": "git+https://github.com/n-car/rpc-express-toolkit.git"
|
|
11
|
-
},
|
|
12
|
-
"keywords": [
|
|
13
|
-
"json-rpc",
|
|
14
|
-
"jsonrpc",
|
|
15
|
-
"express",
|
|
16
|
-
"rpc",
|
|
17
|
-
"safe",
|
|
18
|
-
"bigint",
|
|
19
|
-
"date",
|
|
20
|
-
"validation"
|
|
21
|
-
],
|
|
22
|
-
"peerDependencies": {
|
|
23
|
-
"rpc-express-toolkit": "
|
|
24
|
-
},
|
|
25
|
-
"dependencies": {
|
|
26
|
-
"rpc-express-toolkit": "
|
|
27
|
-
}
|
|
28
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "rpc-express-toolkit-safe",
|
|
3
|
+
"version": "4.3.3",
|
|
4
|
+
"description": "Safe preset wrapper for rpc-express-toolkit (safeEnabled defaults to true).",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"main": "index.js",
|
|
7
|
+
"types": "index.d.ts",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/n-car/rpc-express-toolkit.git"
|
|
11
|
+
},
|
|
12
|
+
"keywords": [
|
|
13
|
+
"json-rpc",
|
|
14
|
+
"jsonrpc",
|
|
15
|
+
"express",
|
|
16
|
+
"rpc",
|
|
17
|
+
"safe",
|
|
18
|
+
"bigint",
|
|
19
|
+
"date",
|
|
20
|
+
"validation"
|
|
21
|
+
],
|
|
22
|
+
"peerDependencies": {
|
|
23
|
+
"rpc-express-toolkit": "^4.3.3"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"rpc-express-toolkit": "^4.3.3"
|
|
27
|
+
}
|
|
28
|
+
}
|