@modern-js/bff-runtime 1.2.5-beta.0 → 1.2.5

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @modern-js/bff-runtime
2
2
 
3
+ ## 1.2.5
4
+
5
+ ### Patch Changes
6
+
7
+ - 4d5ca46d4: chore: remove farrow-http from dependencies
8
+ - @modern-js/server-utils@1.2.11
9
+
3
10
  ## 1.2.4
4
11
 
5
12
  ### Patch Changes
@@ -1,5 +1,4 @@
1
- export * from 'farrow-schema'; // export * from 'farrow-api';
2
- // export * from 'farrow-pipeline';
3
-
4
- export { match, isHandler, isSchemaHandler } from "./match";
5
- export * from '@modern-js/bff-core';
1
+ export * from 'farrow-schema';
2
+ export * from 'farrow-api';
3
+ export * from 'farrow-pipeline';
4
+ export { match, isHandler, isSchemaHandler } from "./match";
@@ -0,0 +1 @@
1
+ export {};
@@ -41,18 +41,32 @@ Object.keys(_farrowSchema).forEach(function (key) {
41
41
  });
42
42
  });
43
43
 
44
- var _match = require("./match");
44
+ var _farrowApi = require("farrow-api");
45
45
 
46
- var _bffCore = require("@modern-js/bff-core");
46
+ Object.keys(_farrowApi).forEach(function (key) {
47
+ if (key === "default" || key === "__esModule") return;
48
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
49
+ if (key in exports && exports[key] === _farrowApi[key]) return;
50
+ Object.defineProperty(exports, key, {
51
+ enumerable: true,
52
+ get: function () {
53
+ return _farrowApi[key];
54
+ }
55
+ });
56
+ });
57
+
58
+ var _farrowPipeline = require("farrow-pipeline");
47
59
 
48
- Object.keys(_bffCore).forEach(function (key) {
60
+ Object.keys(_farrowPipeline).forEach(function (key) {
49
61
  if (key === "default" || key === "__esModule") return;
50
62
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
51
- if (key in exports && exports[key] === _bffCore[key]) return;
63
+ if (key in exports && exports[key] === _farrowPipeline[key]) return;
52
64
  Object.defineProperty(exports, key, {
53
65
  enumerable: true,
54
66
  get: function () {
55
- return _bffCore[key];
67
+ return _farrowPipeline[key];
56
68
  }
57
69
  });
58
- });
70
+ });
71
+
72
+ var _match = require("./match");
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -1,5 +1,4 @@
1
- export * from 'farrow-schema'; // export * from 'farrow-api';
2
- // export * from 'farrow-pipeline';
3
-
4
- export { match, isHandler, isSchemaHandler } from "./match";
5
- export * from '@modern-js/bff-core';
1
+ export * from 'farrow-schema';
2
+ export * from 'farrow-api';
3
+ export * from 'farrow-pipeline';
4
+ export { match, isHandler, isSchemaHandler } from "./match";
@@ -0,0 +1 @@
1
+ export {};
@@ -1,7 +1,8 @@
1
1
  export * from 'farrow-schema';
2
+ export * from 'farrow-api';
3
+ export * from 'farrow-pipeline';
2
4
  export { match, isHandler, isSchemaHandler } from './match';
3
5
  export type { Handler, SchemaHandler } from './match';
4
6
  export type { RequestSchema, TypeOfRequestSchema, InputType } from './request';
5
7
  export type { HandleResult, HandleSuccess, InputValidationError, OutputValidationError } from './response';
6
- export type { RequestOption } from './compatible';
7
- export * from '@modern-js/bff-core';
8
+ export type { RequestOption } from './compatible';
@@ -1,6 +1,6 @@
1
- import { TypeOfRouterRequestField } from 'farrow-http/dist/router';
2
1
  import { SchemaCtorInput } from 'farrow-schema';
3
2
  import { MaybeAsync } from 'farrow-pipeline';
3
+ import type { TypeOfRouterRequestField } from './types';
4
4
  import { RequestSchema, TypeOfRequestSchema, PureTypeOfRequestSchema } from './request';
5
5
  import { HandleResult } from './response';
6
6
  export declare type NormalHandler = (...args: any[]) => any;
@@ -22,7 +22,7 @@ export declare type SchemaHandler<Req extends RequestSchema, Res extends SchemaC
22
22
  };
23
23
  export declare const isSchemaHandler: (input: any) => input is SchemaHandler<any, any>;
24
24
  export declare const isHandler: (input: any) => input is Handler<any, any>;
25
- export declare const baseMatch: <Req extends RequestSchema, Res extends SchemaCtorInput>(schema: Schema<Req, Res>, handler: Handler<import("farrow-http/dist/types").MarkReadOnlyDeep<Omit<{ [key in keyof Req]: import("./request").TypeOfRequestField<Req[key]> }, "data"> & import("farrow-http/dist/types").MarkReadOnlyDeep<Req extends {
25
+ export declare const baseMatch: <Req extends RequestSchema, Res extends SchemaCtorInput>(schema: Schema<Req, Res>, handler: Handler<import("./types").MarkReadOnlyDeep<Omit<{ [key in keyof Req]: import("./request").TypeOfRequestField<Req[key]> }, "data"> & import("./types").MarkReadOnlyDeep<Req extends {
26
26
  data: any;
27
27
  } ? Pick<{ [key_1 in keyof Req]: import("./request").TypeOfRequestField<Req[key_1]> }, "data"> : import("./request").RequestExtraType>>, TypeOfRouterRequestField<Res>>) => BaseSchemaHandler<Req, Res>;
28
28
  export declare const match: <Req extends RequestSchema, Res extends SchemaCtorInput>(schema: Schema<Req, Res>, handler: Handler<PureTypeOfRequestSchema<Req>, TypeOfRouterRequestField<Res>>) => SchemaHandler<Req, Res>;
@@ -1,6 +1,5 @@
1
- import { RouterSchemaDescriptor } from 'farrow-http/dist/router';
2
- import { MarkReadOnlyDeep } from 'farrow-http/dist/types';
3
1
  import { TypeOfFieldDescriptor, TypeOfFieldDescriptors, FieldDescriptor, FieldDescriptors } from 'farrow-schema';
2
+ import { MarkReadOnlyDeep, RouterSchemaDescriptor } from './types';
4
3
  export declare type RequestBaseSchema = {
5
4
  params?: RouterSchemaDescriptor;
6
5
  query?: RouterSchemaDescriptor;
@@ -0,0 +1,6 @@
1
+ import * as Schema from 'farrow-schema';
2
+ declare type Path = string | RegExp | Array<string | RegExp>;
3
+ export declare type TypeOfRouterRequestField<T> = T extends string | string[] ? string : T extends Path ? string : T extends Schema.FieldDescriptor ? Schema.TypeOfFieldDescriptor<T> : T extends Schema.FieldDescriptors ? Schema.TypeOfFieldDescriptors<T> : never;
4
+ export declare type RouterSchemaDescriptor = Schema.FieldDescriptors | (new () => Schema.ObjectType) | (new () => Schema.StructType);
5
+ export declare type MarkReadOnlyDeep<T> = T extends {} | any[] ? { readonly [key in keyof T]: MarkReadOnlyDeep<T[key]> } : T;
6
+ export {};
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "1.2.5-beta.0",
14
+ "version": "1.2.5",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/types/index.d.ts",
17
17
  "main": "./dist/js/node/index.js",
@@ -28,29 +28,26 @@
28
28
  }
29
29
  },
30
30
  "dependencies": {
31
- "@babel/runtime": "^7",
32
- "@modern-js/bff-core": "^1.0.0",
33
- "@modern-js/server-utils": "^1.2.6",
31
+ "@babel/runtime": "^7.18.0",
32
+ "@modern-js/server-utils": "^1.2.11",
34
33
  "farrow-api": "^1.10.8",
35
- "farrow-http": "^1.10.8",
36
34
  "farrow-pipeline": "^1.10.6",
37
35
  "farrow-schema": "^1.10.8"
38
36
  },
39
37
  "devDependencies": {
40
- "@scripts/build": "0.0.0",
41
- "@scripts/jest-config": "0.0.0",
42
38
  "@types/jest": "^27",
43
39
  "@types/node": "^14",
44
40
  "@types/react": "^17",
45
41
  "@types/react-dom": "^17",
46
- "jest": "^27",
47
42
  "ts-jest": "^27.0.5",
48
- "typescript": "^4"
43
+ "typescript": "^4",
44
+ "@scripts/build": "0.0.0",
45
+ "jest": "^27",
46
+ "@scripts/jest-config": "0.0.0"
49
47
  },
50
48
  "publishConfig": {
51
49
  "registry": "https://registry.npmjs.org/",
52
- "access": "public",
53
- "types": "./dist/types/index.d.ts"
50
+ "access": "public"
54
51
  },
55
52
  "wireit": {
56
53
  "build": {