@modern-js/bff-core 1.2.1-beta.0 → 1.2.1-beta.1

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.
@@ -23,7 +23,7 @@ export function Api(...args) {
23
23
  }
24
24
 
25
25
  const validateHandlers = operators.filter(operator => operator.validate).map(operator => operator.validate);
26
- const pipeHandlers = operators.filter(operator => operator.pipe).map(operator => operator.validate);
26
+ const pipeHandlers = operators.filter(operator => operator.pipe).map(operator => operator.pipe);
27
27
 
28
28
  async function runner(inputs) {
29
29
  const executeHelper = {
@@ -31,11 +31,14 @@ export function Api(...args) {
31
31
 
32
32
  get inputs() {
33
33
  return inputs;
34
- }
34
+ },
35
35
 
36
- }; // 肯定是要在 stack 后面加函数
37
- // 怎么终止中间件继续执行呢
36
+ set inputs(val) {
37
+ // eslint-disable-next-line no-param-reassign
38
+ inputs = val;
39
+ }
38
40
 
41
+ };
39
42
  const stack = [...validateHandlers, ...pipeHandlers];
40
43
  stack.push(async (helper, next) => {
41
44
  const res = await handler(inputs);
@@ -35,7 +35,7 @@ function Api(...args) {
35
35
  }
36
36
 
37
37
  const validateHandlers = operators.filter(operator => operator.validate).map(operator => operator.validate);
38
- const pipeHandlers = operators.filter(operator => operator.pipe).map(operator => operator.validate);
38
+ const pipeHandlers = operators.filter(operator => operator.pipe).map(operator => operator.pipe);
39
39
 
40
40
  async function runner(inputs) {
41
41
  const executeHelper = {
@@ -43,11 +43,14 @@ function Api(...args) {
43
43
 
44
44
  get inputs() {
45
45
  return inputs;
46
- }
46
+ },
47
47
 
48
- }; // 肯定是要在 stack 后面加函数
49
- // 怎么终止中间件继续执行呢
48
+ set inputs(val) {
49
+ // eslint-disable-next-line no-param-reassign
50
+ inputs = val;
51
+ }
50
52
 
53
+ };
51
54
  const stack = [...validateHandlers, ...pipeHandlers];
52
55
  stack.push(async (helper, next) => {
53
56
  const res = await handler(inputs);
@@ -34,7 +34,7 @@ export declare type InputSchemaMeata = Extract<HttpMetadata, HttpMetadata.Data |
34
34
  export declare type ExecuteFunc = (helper: ExecuteHelper, next: () => Promise<any>) => Promise<any>;
35
35
  export declare type ExecuteHelper = {
36
36
  result?: any;
37
- readonly inputs: any;
37
+ inputs: any;
38
38
  };
39
39
  export declare type MetadataHelper = {
40
40
  setMetadata: <T = any>(key: any, value: T) => void;
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "1.2.1-beta.0",
14
+ "version": "1.2.1-beta.1",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/types/index.d.ts",
17
17
  "main": "./dist/js/node/index.js",