@modern-js/bff-runtime 1.2.4 → 1.3.0-alpha.0

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,22 @@
1
1
  # @modern-js/bff-runtime
2
2
 
3
+ ## 1.3.0-alpha.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 77a8e9e1b: feat: support bff operators
8
+
9
+ ### Patch Changes
10
+
11
+ - @modern-js/server-utils@1.2.12-alpha.0
12
+
13
+ ## 1.2.5
14
+
15
+ ### Patch Changes
16
+
17
+ - 4d5ca46d4: chore: remove farrow-http from dependencies
18
+ - @modern-js/server-utils@1.2.11
19
+
3
20
  ## 1.2.4
4
21
 
5
22
  ### Patch Changes
@@ -1,4 +1,4 @@
1
- export * from 'farrow-schema';
2
- export * from 'farrow-api';
3
- export * from 'farrow-pipeline';
1
+ export * from 'farrow-schema'; // export * from 'farrow-api';
2
+ // export * from 'farrow-pipeline';
3
+
4
4
  export { match, isHandler, isSchemaHandler } from "./match";
@@ -0,0 +1 @@
1
+ export {};
@@ -41,32 +41,4 @@ Object.keys(_farrowSchema).forEach(function (key) {
41
41
  });
42
42
  });
43
43
 
44
- var _farrowApi = require("farrow-api");
45
-
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");
59
-
60
- Object.keys(_farrowPipeline).forEach(function (key) {
61
- if (key === "default" || key === "__esModule") return;
62
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
63
- if (key in exports && exports[key] === _farrowPipeline[key]) return;
64
- Object.defineProperty(exports, key, {
65
- enumerable: true,
66
- get: function () {
67
- return _farrowPipeline[key];
68
- }
69
- });
70
- });
71
-
72
44
  var _match = require("./match");
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -1,4 +1,4 @@
1
- export * from 'farrow-schema';
2
- export * from 'farrow-api';
3
- export * from 'farrow-pipeline';
1
+ export * from 'farrow-schema'; // export * from 'farrow-api';
2
+ // export * from 'farrow-pipeline';
3
+
4
4
  export { match, isHandler, isSchemaHandler } from "./match";
@@ -0,0 +1 @@
1
+ export {};
@@ -1,6 +1,4 @@
1
1
  export * from 'farrow-schema';
2
- export * from 'farrow-api';
3
- export * from 'farrow-pipeline';
4
2
  export { match, isHandler, isSchemaHandler } from './match';
5
3
  export type { Handler, SchemaHandler } from './match';
6
4
  export type { RequestSchema, TypeOfRequestSchema, InputType } from './request';
@@ -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,8 +22,8 @@ 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
- } ? Pick<{ [key_1 in keyof Req]: import("./request").TypeOfRequestField<Req[key_1]> }, "data"> : import("./request").RequestExtraType>>, TypeOfRouterRequestField<Res>>) => BaseSchemaHandler<Req, Res>;
27
+ } ? Pick<Req extends infer T ? { [key_1 in keyof T]: import("./request").TypeOfRequestField<Req[key_1]> } : never, "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>;
29
29
  export {};
@@ -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.4",
14
+ "version": "1.3.0-alpha.0",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/types/index.d.ts",
17
17
  "main": "./dist/js/node/index.js",
@@ -29,22 +29,21 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@babel/runtime": "^7.18.0",
32
- "@modern-js/server-utils": "^1.2.10",
32
+ "@modern-js/server-utils": "^1.2.12-alpha.0",
33
33
  "farrow-api": "^1.10.8",
34
- "farrow-http": "^1.10.8",
35
34
  "farrow-pipeline": "^1.10.6",
36
35
  "farrow-schema": "^1.10.8"
37
36
  },
38
37
  "devDependencies": {
38
+ "@scripts/build": "0.0.0",
39
+ "@scripts/jest-config": "0.0.0",
39
40
  "@types/jest": "^27",
40
41
  "@types/node": "^14",
41
42
  "@types/react": "^17",
42
43
  "@types/react-dom": "^17",
43
- "ts-jest": "^27.0.5",
44
- "typescript": "^4",
45
- "@scripts/build": "0.0.0",
46
44
  "jest": "^27",
47
- "@scripts/jest-config": "0.0.0"
45
+ "ts-jest": "^27.0.5",
46
+ "typescript": "^4"
48
47
  },
49
48
  "publishConfig": {
50
49
  "registry": "https://registry.npmjs.org/",