@delight-rpc/piscina 0.3.0 → 0.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
@@ -67,6 +67,8 @@ function createServer<IAPI extends object>(
67
67
  parameterValidators?: DelightRPC.ParameterValidators<IAPI>
68
68
  version?: `${number}.${number}.${number}`
69
69
  channel?: string
70
+ ownPropsOnly?: boolean
71
+ channel?: string | RegExp | AnyChannel
70
72
  }
71
73
  ): (req: unknown) => Promise<unknown>
72
74
  ```
package/lib/server.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import * as DelightRPC from 'delight-rpc';
2
- export declare function createServer<IAPI extends object>(api: DelightRPC.ImplementationOf<IAPI>, { parameterValidators, version, channel }?: {
2
+ export declare function createServer<IAPI extends object>(api: DelightRPC.ImplementationOf<IAPI>, { parameterValidators, version, channel, ownPropsOnly }?: {
3
3
  parameterValidators?: DelightRPC.ParameterValidators<IAPI>;
4
4
  version?: `${number}.${number}.${number}`;
5
- channel?: string;
5
+ channel?: string | RegExp | typeof DelightRPC.AnyChannel;
6
+ ownPropsOnly?: boolean;
6
7
  }): (req: unknown) => Promise<unknown>;
package/lib/server.js CHANGED
@@ -26,13 +26,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.createServer = void 0;
27
27
  const DelightRPC = __importStar(require("delight-rpc"));
28
28
  const prelude_1 = require("@blackglory/prelude");
29
- function createServer(api, { parameterValidators, version, channel } = {}) {
29
+ function createServer(api, { parameterValidators, version, channel, ownPropsOnly } = {}) {
30
30
  return async function handler(req) {
31
31
  if (DelightRPC.isRequest(req) || DelightRPC.isBatchRequest(req)) {
32
32
  const response = await DelightRPC.createResponse(api, req, {
33
33
  parameterValidators,
34
34
  version,
35
- channel
35
+ channel,
36
+ ownPropsOnly
36
37
  });
37
38
  if ((0, prelude_1.isntNull)(response)) {
38
39
  return response;
package/lib/server.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wDAAyC;AACzC,iDAA8C;AAE9C,SAAgB,YAAY,CAC1B,GAAsC,EACtC,EAAE,mBAAmB,EAAE,OAAO,EAAE,OAAO,KAInC,EAAE;IAEN,OAAO,KAAK,UAAU,OAAO,CAAC,GAAY;QACxC,IAAI,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,UAAU,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE;YAC/D,MAAM,QAAQ,GAAG,MAAM,UAAU,CAAC,cAAc,CAC9C,GAAG,EACH,GAAG,EACH;gBACE,mBAAmB;gBACnB,OAAO;gBACP,OAAO;aACR,CACF,CAAA;YAED,IAAI,IAAA,kBAAQ,EAAC,QAAQ,CAAC,EAAE;gBACtB,OAAO,QAAQ,CAAA;aAChB;SACF;IACH,CAAC,CAAA;AACH,CAAC;AAzBD,oCAyBC"}
1
+ {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wDAAyC;AACzC,iDAA8C;AAE9C,SAAgB,YAAY,CAC1B,GAAsC,EACtC,EAAE,mBAAmB,EAAE,OAAO,EAAE,OAAO,EAAE,YAAY,KAKjD,EAAE;IAEN,OAAO,KAAK,UAAU,OAAO,CAAC,GAAY;QACxC,IAAI,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,UAAU,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE;YAC/D,MAAM,QAAQ,GAAG,MAAM,UAAU,CAAC,cAAc,CAC9C,GAAG,EACH,GAAG,EACH;gBACE,mBAAmB;gBACnB,OAAO;gBACP,OAAO;gBACP,YAAY;aACb,CACF,CAAA;YAED,IAAI,IAAA,kBAAQ,EAAC,QAAQ,CAAC,EAAE;gBACtB,OAAO,QAAQ,CAAA;aAChB;SACF;IACH,CAAC,CAAA;AACH,CAAC;AA3BD,oCA2BC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@delight-rpc/piscina",
3
- "version": "0.3.0",
3
+ "version": "0.3.3",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "files": [
@@ -11,6 +11,7 @@
11
11
  "repository": "git@github.com:delight-rpc/piscina.git",
12
12
  "author": "BlackGlory <woshenmedoubuzhidao@blackglory.me>",
13
13
  "license": "MIT",
14
+ "sideEffects": false,
14
15
  "scripts": {
15
16
  "prepare": "ts-patch install -s",
16
17
  "lint": "eslint --ext .js,.jsx,.ts,.tsx --quiet src",
@@ -30,34 +31,34 @@
30
31
  },
31
32
  "devDependencies": {
32
33
  "@blackglory/jest-matchers": "^0.3.1",
33
- "@commitlint/cli": "^16.2.4",
34
- "@commitlint/config-conventional": "^16.2.4",
35
- "@types/jest": "^27.5.0",
34
+ "@commitlint/cli": "^17.0.2",
35
+ "@commitlint/config-conventional": "^17.0.2",
36
+ "@types/jest": "^27.5.1",
36
37
  "@types/node": "14",
37
- "@typescript-eslint/eslint-plugin": "^5.22.0",
38
- "@typescript-eslint/parser": "^5.22.0",
38
+ "@typescript-eslint/eslint-plugin": "^5.29.0",
39
+ "@typescript-eslint/parser": "^5.29.0",
39
40
  "cross-env": "^7.0.3",
40
- "delight-rpc": "^4.0.0",
41
- "eslint": "8.15.0",
41
+ "delight-rpc": "^4.2.1",
42
+ "eslint": "8.18.0",
42
43
  "husky": "4",
43
44
  "jest": "^27.5.1",
44
45
  "npm-run-all": "^4.1.5",
45
46
  "piscina": "^3.2.0",
46
47
  "return-style": "^1.0.0",
47
48
  "rimraf": "^3.0.2",
48
- "standard-version": "^9.3.2",
49
+ "standard-version": "^9.5.0",
49
50
  "ts-jest": "^27.1.4",
50
- "ts-node": "^10.7.0",
51
+ "ts-node": "^10.8.1",
51
52
  "ts-patch": "^2.0.1",
52
- "typescript": "^4.6.4",
53
+ "typescript": "^4.7.4",
53
54
  "typescript-transform-paths": "^3.3.1"
54
55
  },
55
56
  "peerDependencies": {
56
- "delight-rpc": "^4.0.0",
57
+ "delight-rpc": "^4.2.1",
57
58
  "piscina": "^3.2.0"
58
59
  },
59
60
  "dependencies": {
60
- "@blackglory/prelude": "^0.1.1",
61
+ "@blackglory/prelude": "^0.1.2",
61
62
  "@delight-rpc/protocol": "^2.2.0"
62
63
  }
63
64
  }