@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 +7 -0
- package/dist/js/modern/index.js +4 -5
- package/dist/js/modern/types.js +1 -0
- package/dist/js/node/index.js +20 -6
- package/dist/js/node/types.js +5 -0
- package/dist/js/treeshaking/index.js +4 -5
- package/dist/js/treeshaking/types.js +1 -0
- package/dist/types/index.d.ts +3 -2
- package/dist/types/match.d.ts +2 -2
- package/dist/types/request.d.ts +1 -2
- package/dist/types/types.d.ts +6 -0
- package/package.json +8 -11
package/CHANGELOG.md
CHANGED
package/dist/js/modern/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
export * from 'farrow-schema';
|
|
2
|
-
|
|
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 {};
|
package/dist/js/node/index.js
CHANGED
|
@@ -41,18 +41,32 @@ Object.keys(_farrowSchema).forEach(function (key) {
|
|
|
41
41
|
});
|
|
42
42
|
});
|
|
43
43
|
|
|
44
|
-
var
|
|
44
|
+
var _farrowApi = require("farrow-api");
|
|
45
45
|
|
|
46
|
-
|
|
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(
|
|
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] ===
|
|
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
|
|
67
|
+
return _farrowPipeline[key];
|
|
56
68
|
}
|
|
57
69
|
});
|
|
58
|
-
});
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
var _match = require("./match");
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
export * from 'farrow-schema';
|
|
2
|
-
|
|
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 {};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -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';
|
package/dist/types/match.d.ts
CHANGED
|
@@ -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("
|
|
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>;
|
package/dist/types/request.d.ts
CHANGED
|
@@ -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
|
|
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/
|
|
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": {
|