@modern-js/bff-core 2.21.1 → 2.22.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 +9 -0
- package/dist/cjs/api.js +3 -1
- package/dist/cjs/client/generateClient.js +6 -2
- package/dist/cjs/client/result.js +6 -2
- package/dist/cjs/errors/http.js +6 -2
- package/dist/cjs/index.js +30 -10
- package/dist/cjs/operators/http.js +51 -17
- package/dist/cjs/router/constants.js +21 -7
- package/dist/cjs/router/index.js +3 -1
- package/dist/cjs/router/utils.js +15 -5
- package/dist/cjs/types.js +18 -6
- package/dist/cjs/utils/alias.js +9 -3
- package/dist/cjs/utils/debug.js +3 -1
- package/dist/cjs/utils/index.js +3 -1
- package/dist/cjs/utils/meta.js +12 -4
- package/dist/cjs/utils/storage.js +3 -1
- package/dist/cjs/utils/validate.js +9 -3
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
package/dist/cjs/api.js
CHANGED
|
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "Api", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return Api;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
11
|
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
10
12
|
require("reflect-metadata");
|
|
@@ -10,8 +10,12 @@ function _export(target, all) {
|
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
_export(exports, {
|
|
13
|
-
DEFAULT_CLIENT_REQUEST_CREATOR: ()
|
|
14
|
-
|
|
13
|
+
DEFAULT_CLIENT_REQUEST_CREATOR: function() {
|
|
14
|
+
return DEFAULT_CLIENT_REQUEST_CREATOR;
|
|
15
|
+
},
|
|
16
|
+
generateClient: function() {
|
|
17
|
+
return generateClient;
|
|
18
|
+
}
|
|
15
19
|
});
|
|
16
20
|
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
17
21
|
const _path = /* @__PURE__ */ _interop_require_wildcard._(require("path"));
|
package/dist/cjs/errors/http.js
CHANGED
|
@@ -10,8 +10,12 @@ function _export(target, all) {
|
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
_export(exports, {
|
|
13
|
-
HttpError: ()
|
|
14
|
-
|
|
13
|
+
HttpError: function() {
|
|
14
|
+
return HttpError;
|
|
15
|
+
},
|
|
16
|
+
ValidationError: function() {
|
|
17
|
+
return ValidationError;
|
|
18
|
+
}
|
|
15
19
|
});
|
|
16
20
|
const _define_property = require("@swc/helpers/_/_define_property");
|
|
17
21
|
class HttpError extends Error {
|
package/dist/cjs/index.js
CHANGED
|
@@ -10,16 +10,36 @@ function _export(target, all) {
|
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
_export(exports, {
|
|
13
|
-
Api: ()
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
13
|
+
Api: function() {
|
|
14
|
+
return _api.Api;
|
|
15
|
+
},
|
|
16
|
+
HttpError: function() {
|
|
17
|
+
return _http.HttpError;
|
|
18
|
+
},
|
|
19
|
+
ValidationError: function() {
|
|
20
|
+
return _http.ValidationError;
|
|
21
|
+
},
|
|
22
|
+
getRelativeRuntimePath: function() {
|
|
23
|
+
return _utils.getRelativeRuntimePath;
|
|
24
|
+
},
|
|
25
|
+
HANDLER_WITH_META: function() {
|
|
26
|
+
return _utils.HANDLER_WITH_META;
|
|
27
|
+
},
|
|
28
|
+
isWithMetaHandler: function() {
|
|
29
|
+
return _utils.isWithMetaHandler;
|
|
30
|
+
},
|
|
31
|
+
INPUT_PARAMS_DECIDER: function() {
|
|
32
|
+
return _utils.INPUT_PARAMS_DECIDER;
|
|
33
|
+
},
|
|
34
|
+
isInputParamsDeciderHandler: function() {
|
|
35
|
+
return _utils.isInputParamsDeciderHandler;
|
|
36
|
+
},
|
|
37
|
+
createStorage: function() {
|
|
38
|
+
return _utils.createStorage;
|
|
39
|
+
},
|
|
40
|
+
registerPaths: function() {
|
|
41
|
+
return _utils.registerPaths;
|
|
42
|
+
}
|
|
23
43
|
});
|
|
24
44
|
const _export_star = require("@swc/helpers/_/_export_star");
|
|
25
45
|
const _api = require("./api");
|
|
@@ -10,23 +10,57 @@ function _export(target, all) {
|
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
_export(exports, {
|
|
13
|
-
createHttpOperator: ()
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
13
|
+
createHttpOperator: function() {
|
|
14
|
+
return createHttpOperator;
|
|
15
|
+
},
|
|
16
|
+
Get: function() {
|
|
17
|
+
return Get;
|
|
18
|
+
},
|
|
19
|
+
Post: function() {
|
|
20
|
+
return Post;
|
|
21
|
+
},
|
|
22
|
+
Put: function() {
|
|
23
|
+
return Put;
|
|
24
|
+
},
|
|
25
|
+
Delete: function() {
|
|
26
|
+
return Delete;
|
|
27
|
+
},
|
|
28
|
+
Connect: function() {
|
|
29
|
+
return Connect;
|
|
30
|
+
},
|
|
31
|
+
Trace: function() {
|
|
32
|
+
return Trace;
|
|
33
|
+
},
|
|
34
|
+
Patch: function() {
|
|
35
|
+
return Patch;
|
|
36
|
+
},
|
|
37
|
+
Options: function() {
|
|
38
|
+
return Options;
|
|
39
|
+
},
|
|
40
|
+
Head: function() {
|
|
41
|
+
return Head;
|
|
42
|
+
},
|
|
43
|
+
Data: function() {
|
|
44
|
+
return Data;
|
|
45
|
+
},
|
|
46
|
+
Query: function() {
|
|
47
|
+
return Query;
|
|
48
|
+
},
|
|
49
|
+
Params: function() {
|
|
50
|
+
return Params;
|
|
51
|
+
},
|
|
52
|
+
Headers: function() {
|
|
53
|
+
return Headers;
|
|
54
|
+
},
|
|
55
|
+
HttpCode: function() {
|
|
56
|
+
return HttpCode;
|
|
57
|
+
},
|
|
58
|
+
SetHeaders: function() {
|
|
59
|
+
return SetHeaders;
|
|
60
|
+
},
|
|
61
|
+
Redirect: function() {
|
|
62
|
+
return Redirect;
|
|
63
|
+
}
|
|
30
64
|
});
|
|
31
65
|
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
32
66
|
const _types = require("../types");
|
|
@@ -10,13 +10,27 @@ function _export(target, all) {
|
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
_export(exports, {
|
|
13
|
-
APIMode: ()
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
APIMode: function() {
|
|
14
|
+
return APIMode;
|
|
15
|
+
},
|
|
16
|
+
AllHttpMethods: function() {
|
|
17
|
+
return AllHttpMethods;
|
|
18
|
+
},
|
|
19
|
+
FRAMEWORK_MODE_LAMBDA_DIR: function() {
|
|
20
|
+
return FRAMEWORK_MODE_LAMBDA_DIR;
|
|
21
|
+
},
|
|
22
|
+
FRAMEWORK_MODE_APP_DIR: function() {
|
|
23
|
+
return FRAMEWORK_MODE_APP_DIR;
|
|
24
|
+
},
|
|
25
|
+
INDEX_SUFFIX: function() {
|
|
26
|
+
return INDEX_SUFFIX;
|
|
27
|
+
},
|
|
28
|
+
API_DIR: function() {
|
|
29
|
+
return API_DIR;
|
|
30
|
+
},
|
|
31
|
+
API_FILE_RULES: function() {
|
|
32
|
+
return API_FILE_RULES;
|
|
33
|
+
}
|
|
20
34
|
});
|
|
21
35
|
const _types = require("../types");
|
|
22
36
|
const AllHttpMethods = Object.values(_types.HttpMethod);
|
package/dist/cjs/router/index.js
CHANGED
|
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "ApiRouter", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return ApiRouter;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
11
|
const _define_property = require("@swc/helpers/_/_define_property");
|
|
10
12
|
const _export_star = require("@swc/helpers/_/_export_star");
|
package/dist/cjs/router/utils.js
CHANGED
|
@@ -10,11 +10,21 @@ function _export(target, all) {
|
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
_export(exports, {
|
|
13
|
-
getFiles: ()
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
getFiles: function() {
|
|
14
|
+
return getFiles;
|
|
15
|
+
},
|
|
16
|
+
getPathFromFilename: function() {
|
|
17
|
+
return getPathFromFilename;
|
|
18
|
+
},
|
|
19
|
+
isHandler: function() {
|
|
20
|
+
return isHandler;
|
|
21
|
+
},
|
|
22
|
+
requireHandlerModule: function() {
|
|
23
|
+
return requireHandlerModule;
|
|
24
|
+
},
|
|
25
|
+
sortRoutes: function() {
|
|
26
|
+
return sortRoutes;
|
|
27
|
+
}
|
|
18
28
|
});
|
|
19
29
|
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
20
30
|
const _path = /* @__PURE__ */ _interop_require_default._(require("path"));
|
package/dist/cjs/types.js
CHANGED
|
@@ -10,12 +10,24 @@ function _export(target, all) {
|
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
_export(exports, {
|
|
13
|
-
OperatorType: ()
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
OperatorType: function() {
|
|
14
|
+
return OperatorType;
|
|
15
|
+
},
|
|
16
|
+
TriggerType: function() {
|
|
17
|
+
return TriggerType;
|
|
18
|
+
},
|
|
19
|
+
HttpMetadata: function() {
|
|
20
|
+
return HttpMetadata;
|
|
21
|
+
},
|
|
22
|
+
ResponseMetaType: function() {
|
|
23
|
+
return ResponseMetaType;
|
|
24
|
+
},
|
|
25
|
+
HttpMethod: function() {
|
|
26
|
+
return HttpMethod;
|
|
27
|
+
},
|
|
28
|
+
httpMethods: function() {
|
|
29
|
+
return httpMethods;
|
|
30
|
+
}
|
|
19
31
|
});
|
|
20
32
|
var OperatorType;
|
|
21
33
|
(function(OperatorType2) {
|
package/dist/cjs/utils/alias.js
CHANGED
|
@@ -10,9 +10,15 @@ function _export(target, all) {
|
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
_export(exports, {
|
|
13
|
-
getRelativeRuntimePath: ()
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
getRelativeRuntimePath: function() {
|
|
14
|
+
return getRelativeRuntimePath;
|
|
15
|
+
},
|
|
16
|
+
createMatchPath: function() {
|
|
17
|
+
return createMatchPath;
|
|
18
|
+
},
|
|
19
|
+
registerPaths: function() {
|
|
20
|
+
return registerPaths;
|
|
21
|
+
}
|
|
16
22
|
});
|
|
17
23
|
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
18
24
|
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
package/dist/cjs/utils/debug.js
CHANGED
|
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "debug", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return debug;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
11
|
const _utils = require("@modern-js/utils");
|
|
10
12
|
const debug = (0, _utils.createDebugger)("bff");
|
package/dist/cjs/utils/index.js
CHANGED
|
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "debug", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return _debug.debug;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
11
|
const _export_star = require("@swc/helpers/_/_export_star");
|
|
10
12
|
_export_star._(require("./storage"), exports);
|
package/dist/cjs/utils/meta.js
CHANGED
|
@@ -10,10 +10,18 @@ function _export(target, all) {
|
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
_export(exports, {
|
|
13
|
-
HANDLER_WITH_META: ()
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
HANDLER_WITH_META: function() {
|
|
14
|
+
return HANDLER_WITH_META;
|
|
15
|
+
},
|
|
16
|
+
INPUT_PARAMS_DECIDER: function() {
|
|
17
|
+
return INPUT_PARAMS_DECIDER;
|
|
18
|
+
},
|
|
19
|
+
isWithMetaHandler: function() {
|
|
20
|
+
return isWithMetaHandler;
|
|
21
|
+
},
|
|
22
|
+
isInputParamsDeciderHandler: function() {
|
|
23
|
+
return isInputParamsDeciderHandler;
|
|
24
|
+
}
|
|
17
25
|
});
|
|
18
26
|
const HANDLER_WITH_META = "HANDLER_WITH_META";
|
|
19
27
|
const INPUT_PARAMS_DECIDER = "INPUT_PARAMS_DECIDER";
|
|
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "createStorage", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return createStorage;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
11
|
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
10
12
|
const _async_hooks = /* @__PURE__ */ _interop_require_wildcard._(require("async_hooks"));
|
|
@@ -10,9 +10,15 @@ function _export(target, all) {
|
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
_export(exports, {
|
|
13
|
-
getTypeErrorMessage: ()
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
getTypeErrorMessage: function() {
|
|
14
|
+
return getTypeErrorMessage;
|
|
15
|
+
},
|
|
16
|
+
ERR_INVALID_ARG_TYPE: function() {
|
|
17
|
+
return ERR_INVALID_ARG_TYPE;
|
|
18
|
+
},
|
|
19
|
+
validateFunction: function() {
|
|
20
|
+
return validateFunction;
|
|
21
|
+
}
|
|
16
22
|
});
|
|
17
23
|
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
18
24
|
const _util = /* @__PURE__ */ _interop_require_default._(require("util"));
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "2.
|
|
18
|
+
"version": "2.22.0",
|
|
19
19
|
"jsnext:source": "./src/index.ts",
|
|
20
20
|
"types": "./dist/types/index.d.ts",
|
|
21
21
|
"main": "./dist/cjs/index.js",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"koa-compose": "^4.1.0",
|
|
32
32
|
"reflect-metadata": "^0.1.13",
|
|
33
33
|
"@swc/helpers": "0.5.1",
|
|
34
|
-
"@modern-js/bff-runtime": "2.
|
|
35
|
-
"@modern-js/utils": "2.
|
|
34
|
+
"@modern-js/bff-runtime": "2.22.0",
|
|
35
|
+
"@modern-js/utils": "2.22.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/jest": "^29",
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
"type-fest": "2.15.0",
|
|
45
45
|
"typescript": "^5",
|
|
46
46
|
"zod": "^3.17.3",
|
|
47
|
-
"@modern-js/types": "2.
|
|
48
|
-
"@scripts/jest-config": "2.
|
|
49
|
-
"@scripts/build": "2.
|
|
47
|
+
"@modern-js/types": "2.22.0",
|
|
48
|
+
"@scripts/jest-config": "2.22.0",
|
|
49
|
+
"@scripts/build": "2.22.0"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"zod": "^3.17.3",
|