@modern-js/bff-runtime 1.2.3 → 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 +15 -0
- package/dist/js/modern/types.js +1 -0
- package/dist/js/node/types.js +5 -0
- package/dist/js/treeshaking/match.js +3 -3
- package/dist/js/treeshaking/types.js +1 -0
- 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 +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
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
|
+
|
|
10
|
+
## 1.2.4
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- a1198d509: feat: bump babel 7.18.0
|
|
15
|
+
- Updated dependencies [a1198d509]
|
|
16
|
+
- @modern-js/server-utils@1.2.10
|
|
17
|
+
|
|
3
18
|
## 1.2.3
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
2
3
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
3
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
4
|
import { toSchemaCtor, Struct, NonStrict } from 'farrow-schema';
|
|
5
5
|
import { createSchemaValidator } from 'farrow-schema/validator';
|
|
6
6
|
import { HandleSuccess, InputValidationError, OutputValidationError } from "./response";
|
|
@@ -27,9 +27,9 @@ export var baseMatch = function baseMatch(schema, handler) {
|
|
|
27
27
|
var validateApiOutput = createSchemaValidator(toSchemaCtor(schema.response));
|
|
28
28
|
|
|
29
29
|
var handle = /*#__PURE__*/function () {
|
|
30
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(input) {
|
|
30
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(input) {
|
|
31
31
|
var inputResult, output, outputResult;
|
|
32
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
32
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
33
33
|
while (1) {
|
|
34
34
|
switch (_context.prev = _context.next) {
|
|
35
35
|
case 0:
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
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.
|
|
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,10 +28,9 @@
|
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@babel/runtime": "^7",
|
|
32
|
-
"@modern-js/server-utils": "^1.2.
|
|
31
|
+
"@babel/runtime": "^7.18.0",
|
|
32
|
+
"@modern-js/server-utils": "^1.2.11",
|
|
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
|
},
|
|
@@ -67,7 +66,8 @@
|
|
|
67
66
|
"files": [
|
|
68
67
|
"src/**/*",
|
|
69
68
|
"tsconfig.json",
|
|
70
|
-
"package.json"
|
|
69
|
+
"package.json",
|
|
70
|
+
"tests/**/*"
|
|
71
71
|
],
|
|
72
72
|
"output": []
|
|
73
73
|
}
|