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 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 factory: `createSafeEndpoint(app, context, options?)`
5
+ - Server class: `new RpcSafeEndpoint(app, context, options?)`
6
6
  - Applies `{ safeEnabled: true, strictMode: true }` by default
7
- - Client factory: `createSafeClient(endpoint, headers?, options?)`
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 { createSafeEndpoint } = require('rpc-express-toolkit-safe');
15
+ const { RpcSafeEndpoint } = require('rpc-express-toolkit-safe');
16
16
  const app = express();
17
17
  app.use(express.json());
18
- const rpc = createSafeEndpoint(app, {}, { endpoint: '/api' });
18
+ const rpc = new RpcSafeEndpoint(app, {}, { endpoint: '/api' });
19
19
 
20
20
  // Client
21
- const { createSafeClient } = require('rpc-express-toolkit-safe');
22
- const client = createSafeClient('http://localhost:3000/api');
21
+ const { RpcSafeClient } = require('rpc-express-toolkit-safe');
22
+ const client = new RpcSafeClient('http://localhost:3000/api');
23
23
  ```
24
24
 
25
- Under the hood this package simply exports from `rpc-express-toolkit/safe` and depends on `rpc-express-toolkit >= 4.0.1`.
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.1.0",
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": "\u003e=4.1.0"
24
- },
25
- "dependencies": {
26
- "rpc-express-toolkit": "\u003e=4.1.0"
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
+ }