@innet/server 2.0.0-alpha.2 → 2.0.0-alpha.20
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/README.md +1105 -403
- package/example/requests/index.d.ts +1 -1
- package/example/requests/todo/AddTodo/AddTodo.d.ts +1 -0
- package/example/requests/todo/AddTodo/index.d.ts +1 -0
- package/example/requests/todo/DeleteTodo/DeleteTodo.d.ts +1 -0
- package/example/requests/todo/DeleteTodo/index.d.ts +1 -0
- package/example/requests/todo/EditTodo/EditTodo.d.ts +1 -0
- package/example/requests/todo/EditTodo/index.d.ts +1 -0
- package/example/requests/todo/GetTodo/GetTodo.d.ts +1 -0
- package/example/requests/todo/GetTodo/index.d.ts +1 -0
- package/example/requests/todo/GetTodos/GetTodos.d.ts +1 -0
- package/example/requests/todo/GetTodos/index.d.ts +1 -0
- package/example/requests/todo/index.d.ts +5 -0
- package/example/requests/todo/todos.d.ts +1 -0
- package/example/schemas/app/ListQueryParams/ListQueryParams.d.ts +1 -0
- package/example/schemas/app/ListQueryParams/index.d.ts +1 -0
- package/example/schemas/app/ListSchema/ListSchema.d.ts +4 -1
- package/example/schemas/app/index.d.ts +1 -0
- package/example/schemas/index.d.ts +1 -3
- package/example/schemas/todo/TodoSchema/TodoSchema.d.ts +4 -0
- package/example/schemas/todo/TodoSchema/index.d.ts +1 -0
- package/example/schemas/todo/index.d.ts +1 -0
- package/example/tags/Todo/Todo.d.ts +1 -0
- package/example/tags/Todo/index.d.ts +1 -0
- package/example/tags/index.d.ts +1 -1
- package/handler/handler.d.ts +11 -3
- package/handler/handler.es6.js +10 -2
- package/handler/handler.js +10 -2
- package/hooks/index.d.ts +4 -0
- package/hooks/index.es6.js +4 -0
- package/hooks/index.js +4 -0
- package/hooks/useAction/useAction.es6.js +1 -1
- package/hooks/useAction/useAction.js +1 -1
- package/hooks/useApi/useApi.d.ts +1 -3
- package/hooks/useClientIp/index.d.ts +1 -0
- package/hooks/useClientIp/index.es6.js +1 -0
- package/hooks/useClientIp/index.js +9 -0
- package/hooks/useClientIp/useClientIp.d.ts +1 -0
- package/hooks/useClientIp/useClientIp.es6.js +9 -0
- package/hooks/useClientIp/useClientIp.js +13 -0
- package/hooks/useComponentName/useComponentName.d.ts +1 -1
- package/hooks/useEndpoint/useEndpoint.es6.js +3 -1
- package/hooks/useEndpoint/useEndpoint.js +3 -1
- package/hooks/useObjectSchemaContext/index.d.ts +1 -0
- package/hooks/useObjectSchemaContext/index.es6.js +1 -0
- package/hooks/useObjectSchemaContext/index.js +10 -0
- package/hooks/useObjectSchemaContext/useObjectSchemaContext.d.ts +3 -0
- package/hooks/useObjectSchemaContext/useObjectSchemaContext.es6.js +14 -0
- package/hooks/useObjectSchemaContext/useObjectSchemaContext.js +19 -0
- package/hooks/useRequest/index.es6.js +1 -1
- package/hooks/useRequest/index.js +0 -1
- package/hooks/useRequest/useRequest.d.ts +1 -4
- package/hooks/useRequest/useRequest.es6.js +4 -4
- package/hooks/useRequest/useRequest.js +3 -4
- package/hooks/useResponse/index.es6.js +1 -1
- package/hooks/useResponse/index.js +0 -1
- package/hooks/useResponse/useResponse.d.ts +1 -4
- package/hooks/useResponse/useResponse.es6.js +4 -4
- package/hooks/useResponse/useResponse.js +3 -4
- package/hooks/useSchemaType/useSchemaType.d.ts +3 -2
- package/hooks/useSchemaType/useSchemaType.es6.js +2 -3
- package/hooks/useSchemaType/useSchemaType.js +2 -3
- package/hooks/useServer/useServer.d.ts +1 -0
- package/hooks/useServer/useServer.es6.js +3 -1
- package/hooks/useServer/useServer.js +3 -1
- package/hooks/useServerPlugin/index.d.ts +1 -0
- package/hooks/useServerPlugin/index.es6.js +1 -0
- package/hooks/useServerPlugin/index.js +9 -0
- package/hooks/useServerPlugin/useServerPlugin.d.ts +2 -0
- package/hooks/useServerPlugin/useServerPlugin.es6.js +13 -0
- package/hooks/useServerPlugin/useServerPlugin.js +17 -0
- package/hooks/useServerPlugins/index.d.ts +1 -0
- package/hooks/useServerPlugins/index.es6.js +1 -0
- package/hooks/useServerPlugins/index.js +10 -0
- package/hooks/useServerPlugins/useServerPlugins.d.ts +4 -0
- package/hooks/useServerPlugins/useServerPlugins.es6.js +14 -0
- package/hooks/useServerPlugins/useServerPlugins.js +19 -0
- package/index.es6.js +13 -5
- package/index.js +24 -6
- package/package.json +2 -2
- package/plugins/main/api/api.d.ts +2 -0
- package/plugins/main/api/api.es6.js +49 -51
- package/plugins/main/api/api.js +49 -51
- package/plugins/main/endpoint/endpoint.es6.js +4 -1
- package/plugins/main/endpoint/endpoint.js +4 -1
- package/plugins/main/index.d.ts +1 -1
- package/plugins/main/index.es6.js +1 -1
- package/plugins/main/index.js +1 -1
- package/plugins/main/preset/index.d.ts +1 -0
- package/plugins/main/preset/index.es6.js +1 -0
- package/{utils/rules/any/any.js → plugins/main/preset/index.js} +4 -4
- package/plugins/main/preset/preset.d.ts +3 -0
- package/plugins/main/preset/preset.es6.js +13 -0
- package/plugins/main/preset/preset.js +21 -0
- package/plugins/main/request/request.es6.js +2 -13
- package/plugins/main/request/request.js +2 -13
- package/plugins/main/response/index.es6.js +1 -1
- package/plugins/main/response/index.js +1 -0
- package/plugins/main/response/response.d.ts +6 -2
- package/plugins/main/response/response.es6.js +16 -8
- package/plugins/main/response/response.js +16 -7
- package/plugins/main/server/server.d.ts +3 -3
- package/plugins/main/server/server.es6.js +29 -7
- package/plugins/main/server/server.js +29 -7
- package/plugins/main/tag/tag.es6.js +4 -1
- package/plugins/main/tag/tag.js +4 -1
- package/plugins/request/cms/cms.es6.js +1 -1
- package/plugins/request/cms/cms.js +1 -1
- package/plugins/request/cookie/cookie.es6.js +3 -19
- package/plugins/request/cookie/cookie.js +3 -23
- package/plugins/request/proxy/proxy.d.ts +3 -0
- package/plugins/request/proxy/proxy.es6.js +4 -1
- package/plugins/request/proxy/proxy.js +4 -1
- package/plugins/request/redirect/redirect.d.ts +2 -1
- package/plugins/request/success/success.d.ts +1 -0
- package/plugins/request/success/success.es6.js +13 -4
- package/plugins/request/success/success.js +13 -4
- package/plugins/schema/any/any.d.ts +5 -0
- package/plugins/schema/any/any.es6.js +27 -0
- package/plugins/schema/any/any.js +31 -0
- package/plugins/schema/boolean/boolean.es6.js +2 -4
- package/plugins/schema/boolean/boolean.js +1 -3
- package/plugins/schema/field/field.es6.js +3 -5
- package/plugins/schema/field/field.js +2 -4
- package/plugins/schema/index.d.ts +1 -0
- package/plugins/schema/index.es6.js +1 -0
- package/plugins/schema/index.js +1 -0
- package/plugins/schema/object/object.es6.js +17 -4
- package/plugins/schema/object/object.js +17 -4
- package/plugins/utils/blacklist/blacklist.d.ts +4 -0
- package/plugins/utils/blacklist/blacklist.es6.js +18 -0
- package/plugins/utils/blacklist/blacklist.js +22 -0
- package/plugins/utils/blacklist/index.d.ts +1 -0
- package/plugins/utils/blacklist/index.es6.js +1 -0
- package/plugins/utils/blacklist/index.js +9 -0
- package/plugins/utils/dts/dts.d.ts +3 -3
- package/plugins/utils/dts/dts.es6.js +6 -25
- package/plugins/utils/dts/dts.js +5 -29
- package/plugins/utils/index.d.ts +3 -0
- package/plugins/utils/index.es6.js +3 -0
- package/plugins/utils/index.js +3 -0
- package/plugins/utils/protection/index.d.ts +1 -0
- package/plugins/utils/protection/index.es6.js +1 -0
- package/plugins/utils/protection/index.js +9 -0
- package/plugins/utils/protection/protection.d.ts +8 -0
- package/plugins/utils/protection/protection.es6.js +36 -0
- package/plugins/utils/protection/protection.js +40 -0
- package/plugins/utils/swagger/swagger.es6.js +10 -12
- package/plugins/utils/swagger/swagger.js +10 -12
- package/plugins/utils/whitelist/index.d.ts +1 -0
- package/plugins/utils/whitelist/index.es6.js +1 -0
- package/plugins/utils/whitelist/index.js +9 -0
- package/plugins/utils/whitelist/whitelist.d.ts +4 -0
- package/plugins/utils/whitelist/whitelist.es6.js +20 -0
- package/plugins/utils/whitelist/whitelist.js +24 -0
- package/types.d.ts +2 -10
- package/utils/action/Action.d.ts +7 -4
- package/utils/action/Action.es6.js +35 -11
- package/utils/action/Action.js +36 -12
- package/utils/generateTypes/generateTypes.d.ts +3 -0
- package/utils/generateTypes/generateTypes.es6.js +151 -0
- package/utils/generateTypes/generateTypes.js +156 -0
- package/utils/generateTypes/generateTypes.test.d.ts +1 -0
- package/utils/generateTypes/index.d.ts +1 -0
- package/utils/generateTypes/index.es6.js +1 -0
- package/utils/generateTypes/index.js +10 -0
- package/utils/getEndpoint/getEndpoint.es6.js +2 -2
- package/utils/getEndpoint/getEndpoint.js +2 -2
- package/utils/index.d.ts +1 -0
- package/utils/index.es6.js +1 -0
- package/utils/index.js +1 -0
- package/utils/rules/index.d.ts +0 -1
- package/utils/rules/index.es6.js +0 -1
- package/utils/rules/index.js +0 -1
- package/utils/rules/objectOf/objectOf.d.ts +1 -1
- package/utils/rules/objectOf/objectOf.es6.js +15 -2
- package/utils/rules/objectOf/objectOf.js +15 -2
- package/example/requests/partners/EditPartner/EditPartner.d.ts +0 -1
- package/example/requests/partners/EditPartner/index.d.ts +0 -1
- package/example/requests/partners/GetPartner/GetPartner.d.ts +0 -1
- package/example/requests/partners/GetPartner/index.d.ts +0 -1
- package/example/requests/partners/GetPartners/GetPartners.d.ts +0 -1
- package/example/requests/partners/GetPartners/index.d.ts +0 -1
- package/example/requests/partners/index.d.ts +0 -3
- package/example/schemas/address/AddressSchema/AddressSchema.d.ts +0 -1
- package/example/schemas/address/AddressSchema/index.d.ts +0 -1
- package/example/schemas/address/index.d.ts +0 -1
- package/example/schemas/location/LocationSchema/LocationSchema.d.ts +0 -1
- package/example/schemas/location/LocationSchema/index.d.ts +0 -1
- package/example/schemas/location/index.d.ts +0 -1
- package/example/schemas/partner/EditPartnerSchema/EditPartnerSchema.d.ts +0 -1
- package/example/schemas/partner/EditPartnerSchema/index.d.ts +0 -1
- package/example/schemas/partner/PartnerSchema/PartnerSchema.d.ts +0 -1
- package/example/schemas/partner/PartnerSchema/index.d.ts +0 -1
- package/example/schemas/partner/index.d.ts +0 -2
- package/example/tags/Partner/Partner.d.ts +0 -1
- package/example/tags/Partner/index.d.ts +0 -1
- package/plugins/main/fallback/fallback.d.ts +0 -4
- package/plugins/main/fallback/fallback.es6.js +0 -19
- package/plugins/main/fallback/fallback.js +0 -23
- package/plugins/main/fallback/index.d.ts +0 -1
- package/plugins/main/fallback/index.es6.js +0 -1
- package/plugins/main/fallback/index.js +0 -9
- package/utils/rules/any/any.d.ts +0 -1
- package/utils/rules/any/any.es6.js +0 -5
- /package/{utils/rules → plugins/schema}/any/index.d.ts +0 -0
- /package/{utils/rules → plugins/schema}/any/index.es6.js +0 -0
- /package/{utils/rules → plugins/schema}/any/index.js +0 -0
|
@@ -2,13 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var tslib = require('tslib');
|
|
5
6
|
var innet = require('innet');
|
|
6
7
|
var fs = require('node:fs');
|
|
7
8
|
var http = require('node:http');
|
|
8
9
|
var http2 = require('node:https');
|
|
9
10
|
var watchState = require('watch-state');
|
|
10
11
|
require('../../../hooks/index.js');
|
|
12
|
+
require('../../../utils/index.js');
|
|
11
13
|
var useServer = require('../../../hooks/useServer/useServer.js');
|
|
14
|
+
var useServerPlugins = require('../../../hooks/useServerPlugins/useServerPlugins.js');
|
|
15
|
+
var Action = require('../../../utils/action/Action.js');
|
|
16
|
+
var useAction = require('../../../hooks/useAction/useAction.js');
|
|
12
17
|
|
|
13
18
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
14
19
|
|
|
@@ -24,7 +29,7 @@ const server = () => {
|
|
|
24
29
|
const handler = innet.useNewHandler();
|
|
25
30
|
const { props = {}, children } = innet.useApp();
|
|
26
31
|
const { env } = process;
|
|
27
|
-
let { ssl: { key = (_a = env.
|
|
32
|
+
let { ssl: { key = (_a = env.INNET_SSL_KEY) !== null && _a !== void 0 ? _a : 'localhost.key', cert = (_b = env.INNET_SSL_CRT) !== null && _b !== void 0 ? _b : 'localhost.crt', } = {}, } = props;
|
|
28
33
|
try {
|
|
29
34
|
if (!isInvalidPath(key)) {
|
|
30
35
|
key = fs__default["default"].readFileSync(key).toString();
|
|
@@ -38,20 +43,37 @@ const server = () => {
|
|
|
38
43
|
cert = '';
|
|
39
44
|
}
|
|
40
45
|
const https = Boolean(key && cert);
|
|
41
|
-
const { port = Number((_c = env.
|
|
46
|
+
const { port = Number((_c = env.INNET_PORT) !== null && _c !== void 0 ? _c : (https ? 442 : 80)), onStart, onError, onRequest, onClose, } = props;
|
|
47
|
+
const plugins = new Set();
|
|
42
48
|
const server = https ? http2__default["default"].createServer({ key, cert }) : http__default["default"].createServer();
|
|
43
|
-
|
|
49
|
+
useServer.serverContext.set(handler, { server, port });
|
|
50
|
+
useServerPlugins.serverPlugins.set(handler, plugins);
|
|
44
51
|
watchState.onDestroy(() => {
|
|
45
|
-
var _a;
|
|
46
|
-
(_a = props.onDestroy) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
47
52
|
server.close();
|
|
48
53
|
});
|
|
49
54
|
if (onError) {
|
|
50
55
|
server.on('error', onError);
|
|
51
56
|
}
|
|
52
|
-
if (
|
|
53
|
-
server.
|
|
57
|
+
if (onClose) {
|
|
58
|
+
server.addListener('close', onClose);
|
|
54
59
|
}
|
|
60
|
+
server.on('request', (req, res) => {
|
|
61
|
+
onRequest === null || onRequest === void 0 ? void 0 : onRequest(req, res);
|
|
62
|
+
const action = new Action.Action(req, res);
|
|
63
|
+
const requestHandler = Object.create(handler);
|
|
64
|
+
useAction.actionContext.set(requestHandler, action);
|
|
65
|
+
function server() {
|
|
66
|
+
return tslib.__awaiter(this, void 0, void 0, function* () {
|
|
67
|
+
for (const plugin of plugins) {
|
|
68
|
+
const result = yield plugin();
|
|
69
|
+
if (result !== undefined) {
|
|
70
|
+
return result;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
innet__default["default"]({ type: server, props }, requestHandler);
|
|
76
|
+
});
|
|
55
77
|
innet__default["default"](children, handler);
|
|
56
78
|
server.listen(port, () => {
|
|
57
79
|
onStart === null || onStart === void 0 ? void 0 : onStart({ port, https });
|
|
@@ -11,7 +11,10 @@ const tag = () => {
|
|
|
11
11
|
const { name, description } = useProps();
|
|
12
12
|
const children = useChildren();
|
|
13
13
|
const { docs } = useApi();
|
|
14
|
-
const tag =
|
|
14
|
+
const tag = { name };
|
|
15
|
+
if (description) {
|
|
16
|
+
tag.description = description;
|
|
17
|
+
}
|
|
15
18
|
if (!docs.tags) {
|
|
16
19
|
docs.tags = [tag];
|
|
17
20
|
}
|
package/plugins/main/tag/tag.js
CHANGED
|
@@ -19,7 +19,10 @@ const tag = () => {
|
|
|
19
19
|
const { name, description } = jsx.useProps();
|
|
20
20
|
const children = jsx.useChildren();
|
|
21
21
|
const { docs } = useApi.useApi();
|
|
22
|
-
const tag =
|
|
22
|
+
const tag = { name };
|
|
23
|
+
if (description) {
|
|
24
|
+
tag.description = description;
|
|
25
|
+
}
|
|
23
26
|
if (!docs.tags) {
|
|
24
27
|
docs.tags = [tag];
|
|
25
28
|
}
|
|
@@ -7,7 +7,7 @@ import { usePath } from '../../../hooks/usePath/usePath.es6.js';
|
|
|
7
7
|
import { file } from '../file/file.es6.js';
|
|
8
8
|
|
|
9
9
|
function cms() {
|
|
10
|
-
const { prefix = '/', dir = '.' } = useProps() || {};
|
|
10
|
+
const { prefix = process.env.INNET_CMS_PREFIX || '/', dir = process.env.INNET_CMS_DIR || '.', } = useProps() || {};
|
|
11
11
|
const children = useChildren();
|
|
12
12
|
const handler = useHandler();
|
|
13
13
|
let url = usePath();
|
|
@@ -16,7 +16,7 @@ var innet__default = /*#__PURE__*/_interopDefaultLegacy(innet);
|
|
|
16
16
|
var path__default = /*#__PURE__*/_interopDefaultLegacy(path);
|
|
17
17
|
|
|
18
18
|
function cms() {
|
|
19
|
-
const { prefix = '/', dir = '.' } = jsx.useProps() || {};
|
|
19
|
+
const { prefix = process.env.INNET_CMS_PREFIX || '/', dir = process.env.INNET_CMS_DIR || '.', } = jsx.useProps() || {};
|
|
20
20
|
const children = jsx.useChildren();
|
|
21
21
|
const handler = innet.useHandler();
|
|
22
22
|
let url = usePath.usePath();
|
|
@@ -1,28 +1,12 @@
|
|
|
1
1
|
import { __rest } from 'tslib';
|
|
2
2
|
import { useProps } from '@innet/jsx';
|
|
3
|
-
import cookie$1 from 'cookie';
|
|
4
3
|
import '../../../hooks/index.es6.js';
|
|
5
|
-
import {
|
|
6
|
-
import { useThrow } from '../../../hooks/useThrow/useThrow.es6.js';
|
|
4
|
+
import { useAction } from '../../../hooks/useAction/useAction.es6.js';
|
|
7
5
|
|
|
8
6
|
const cookie = () => {
|
|
9
|
-
const
|
|
10
|
-
if (!res) {
|
|
11
|
-
useThrow('<{type}> MUST be in <request> or <fallback>');
|
|
12
|
-
}
|
|
7
|
+
const action = useAction();
|
|
13
8
|
const _a = useProps(), { key, value } = _a, opt = __rest(_a, ["key", "value"]);
|
|
14
|
-
|
|
15
|
-
if (typeof cookies === 'string') {
|
|
16
|
-
cookies = [cookies];
|
|
17
|
-
}
|
|
18
|
-
const normValue = typeof value === 'string' ? cookie$1.serialize(key, value, opt) : `${key}=; max-age=0`;
|
|
19
|
-
if (cookies) {
|
|
20
|
-
cookies.push(normValue);
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
cookies = normValue;
|
|
24
|
-
}
|
|
25
|
-
res.setHeader('Set-Cookie', cookies);
|
|
9
|
+
action.setCookie(key, value, opt);
|
|
26
10
|
};
|
|
27
11
|
|
|
28
12
|
export { cookie };
|
|
@@ -4,33 +4,13 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var tslib = require('tslib');
|
|
6
6
|
var jsx = require('@innet/jsx');
|
|
7
|
-
var cookie$1 = require('cookie');
|
|
8
7
|
require('../../../hooks/index.js');
|
|
9
|
-
var
|
|
10
|
-
var useThrow = require('../../../hooks/useThrow/useThrow.js');
|
|
11
|
-
|
|
12
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
13
|
-
|
|
14
|
-
var cookie__default = /*#__PURE__*/_interopDefaultLegacy(cookie$1);
|
|
8
|
+
var useAction = require('../../../hooks/useAction/useAction.js');
|
|
15
9
|
|
|
16
10
|
const cookie = () => {
|
|
17
|
-
const
|
|
18
|
-
if (!res) {
|
|
19
|
-
useThrow.useThrow('<{type}> MUST be in <request> or <fallback>');
|
|
20
|
-
}
|
|
11
|
+
const action = useAction.useAction();
|
|
21
12
|
const _a = jsx.useProps(), { key, value } = _a, opt = tslib.__rest(_a, ["key", "value"]);
|
|
22
|
-
|
|
23
|
-
if (typeof cookies === 'string') {
|
|
24
|
-
cookies = [cookies];
|
|
25
|
-
}
|
|
26
|
-
const normValue = typeof value === 'string' ? cookie__default["default"].serialize(key, value, opt) : `${key}=; max-age=0`;
|
|
27
|
-
if (cookies) {
|
|
28
|
-
cookies.push(normValue);
|
|
29
|
-
}
|
|
30
|
-
else {
|
|
31
|
-
cookies = normValue;
|
|
32
|
-
}
|
|
33
|
-
res.setHeader('Set-Cookie', cookies);
|
|
13
|
+
action.setCookie(key, value, opt);
|
|
34
14
|
};
|
|
35
15
|
|
|
36
16
|
exports.cookie = cookie;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
1
2
|
import { type HandlerPlugin } from 'innet';
|
|
3
|
+
import { type IncomingMessage } from 'http';
|
|
2
4
|
export interface ProxyProps {
|
|
3
5
|
to: string;
|
|
4
6
|
secure?: boolean;
|
|
7
|
+
onProxyRes?: (res: IncomingMessage) => void;
|
|
5
8
|
}
|
|
6
9
|
export declare const proxy: HandlerPlugin;
|
|
@@ -6,7 +6,7 @@ import { useResponse } from '../../../hooks/useResponse/useResponse.es6.js';
|
|
|
6
6
|
import { useThrow } from '../../../hooks/useThrow/useThrow.es6.js';
|
|
7
7
|
|
|
8
8
|
const proxy = () => {
|
|
9
|
-
const { to, secure } = useProps();
|
|
9
|
+
const { to, secure = false, onProxyRes } = useProps();
|
|
10
10
|
const req = useRequest();
|
|
11
11
|
const res = useResponse();
|
|
12
12
|
if (!req || !res) {
|
|
@@ -14,6 +14,9 @@ const proxy = () => {
|
|
|
14
14
|
}
|
|
15
15
|
const proxyServer = httpProxy.createProxyServer({});
|
|
16
16
|
delete req.headers.host;
|
|
17
|
+
if (onProxyRes) {
|
|
18
|
+
proxyServer.on('proxyRes', onProxyRes);
|
|
19
|
+
}
|
|
17
20
|
proxyServer.web(req, res, { target: to, secure });
|
|
18
21
|
};
|
|
19
22
|
|
|
@@ -14,7 +14,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
14
14
|
var httpProxy__default = /*#__PURE__*/_interopDefaultLegacy(httpProxy);
|
|
15
15
|
|
|
16
16
|
const proxy = () => {
|
|
17
|
-
const { to, secure } = jsx.useProps();
|
|
17
|
+
const { to, secure = false, onProxyRes } = jsx.useProps();
|
|
18
18
|
const req = useRequest.useRequest();
|
|
19
19
|
const res = useResponse.useResponse();
|
|
20
20
|
if (!req || !res) {
|
|
@@ -22,6 +22,9 @@ const proxy = () => {
|
|
|
22
22
|
}
|
|
23
23
|
const proxyServer = httpProxy__default["default"].createProxyServer({});
|
|
24
24
|
delete req.headers.host;
|
|
25
|
+
if (onProxyRes) {
|
|
26
|
+
proxyServer.on('proxyRes', onProxyRes);
|
|
27
|
+
}
|
|
25
28
|
proxyServer.web(req, res, { target: to, secure });
|
|
26
29
|
};
|
|
27
30
|
|
|
@@ -9,9 +9,10 @@ export declare const redirectStatuses: {
|
|
|
9
9
|
temporaryRedirect: number;
|
|
10
10
|
permanentRedirect: number;
|
|
11
11
|
};
|
|
12
|
+
export type RedirectStatuses = keyof typeof redirectStatuses;
|
|
12
13
|
export interface RedirectProps {
|
|
13
14
|
to: string;
|
|
14
15
|
encode?: boolean;
|
|
15
|
-
status?: number |
|
|
16
|
+
status?: number | RedirectStatuses;
|
|
16
17
|
}
|
|
17
18
|
export declare const redirect: HandlerPlugin;
|
|
@@ -17,15 +17,24 @@ const successStatuses = {
|
|
|
17
17
|
};
|
|
18
18
|
const success = () => {
|
|
19
19
|
const children = useChildren();
|
|
20
|
-
const
|
|
20
|
+
const { status, type } = useProps() || {};
|
|
21
21
|
const res = useResponse();
|
|
22
|
-
const status = props === null || props === void 0 ? void 0 : props.status;
|
|
23
22
|
if (!res) {
|
|
24
23
|
throw Error('<success> MUST be in <request>');
|
|
25
24
|
}
|
|
26
25
|
res.statusCode = typeof status === 'string' ? successStatuses[status] : status !== null && status !== void 0 ? status : ((children) ? 200 : 204);
|
|
27
|
-
if (children) {
|
|
28
|
-
|
|
26
|
+
if (children === null || children === void 0 ? void 0 : children[0]) {
|
|
27
|
+
const child = children[0];
|
|
28
|
+
const contentType = type || (['string', 'number', 'boolean', 'bigint'].includes(typeof child)
|
|
29
|
+
? 'text/plain'
|
|
30
|
+
: 'application/json');
|
|
31
|
+
res.setHeader('Content-Type', contentType);
|
|
32
|
+
if (contentType === 'application/json') {
|
|
33
|
+
res.write(JSONString(child));
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
res.write(String(child));
|
|
37
|
+
}
|
|
29
38
|
}
|
|
30
39
|
res.end();
|
|
31
40
|
};
|
|
@@ -21,15 +21,24 @@ const successStatuses = {
|
|
|
21
21
|
};
|
|
22
22
|
const success = () => {
|
|
23
23
|
const children = jsx.useChildren();
|
|
24
|
-
const
|
|
24
|
+
const { status, type } = jsx.useProps() || {};
|
|
25
25
|
const res = useResponse.useResponse();
|
|
26
|
-
const status = props === null || props === void 0 ? void 0 : props.status;
|
|
27
26
|
if (!res) {
|
|
28
27
|
throw Error('<success> MUST be in <request>');
|
|
29
28
|
}
|
|
30
29
|
res.statusCode = typeof status === 'string' ? successStatuses[status] : status !== null && status !== void 0 ? status : ((children) ? 200 : 204);
|
|
31
|
-
if (children) {
|
|
32
|
-
|
|
30
|
+
if (children === null || children === void 0 ? void 0 : children[0]) {
|
|
31
|
+
const child = children[0];
|
|
32
|
+
const contentType = type || (['string', 'number', 'boolean', 'bigint'].includes(typeof child)
|
|
33
|
+
? 'text/plain'
|
|
34
|
+
: 'application/json');
|
|
35
|
+
res.setHeader('Content-Type', contentType);
|
|
36
|
+
if (contentType === 'application/json') {
|
|
37
|
+
res.write(JSONString.JSONString(child));
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
res.write(String(child));
|
|
41
|
+
}
|
|
33
42
|
}
|
|
34
43
|
res.end();
|
|
35
44
|
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { useProps } from '@innet/jsx';
|
|
2
|
+
import '../../../hooks/index.es6.js';
|
|
3
|
+
import '../../../hooks/useParentRule/index.es6.js';
|
|
4
|
+
import '../../../utils/index.es6.js';
|
|
5
|
+
import { useSchemaType } from '../../../hooks/useSchemaType/useSchemaType.es6.js';
|
|
6
|
+
import { defaultTo } from '../../../utils/rules/defaultTo/defaultTo.es6.js';
|
|
7
|
+
import { useParentRule } from '../../../hooks/useParentRule/useParentRule.es6.js';
|
|
8
|
+
import { useRule } from '../../../hooks/useRule/useRule.es6.js';
|
|
9
|
+
import { pipe } from '../../../utils/rules/pipe/pipe.es6.js';
|
|
10
|
+
|
|
11
|
+
const any = () => {
|
|
12
|
+
const props = useProps();
|
|
13
|
+
useSchemaType('any', props);
|
|
14
|
+
const rules = [];
|
|
15
|
+
if ((props === null || props === void 0 ? void 0 : props.default) !== undefined) {
|
|
16
|
+
rules.push(defaultTo(props.default));
|
|
17
|
+
}
|
|
18
|
+
if ((props === null || props === void 0 ? void 0 : props.default) === undefined) {
|
|
19
|
+
const parentRule = useParentRule();
|
|
20
|
+
useRule(parentRule(pipe(...rules)));
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
useRule(pipe(...rules));
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export { any };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var jsx = require('@innet/jsx');
|
|
6
|
+
require('../../../hooks/index.js');
|
|
7
|
+
require('../../../hooks/useParentRule/index.js');
|
|
8
|
+
require('../../../utils/index.js');
|
|
9
|
+
var useSchemaType = require('../../../hooks/useSchemaType/useSchemaType.js');
|
|
10
|
+
var defaultTo = require('../../../utils/rules/defaultTo/defaultTo.js');
|
|
11
|
+
var useParentRule = require('../../../hooks/useParentRule/useParentRule.js');
|
|
12
|
+
var useRule = require('../../../hooks/useRule/useRule.js');
|
|
13
|
+
var pipe = require('../../../utils/rules/pipe/pipe.js');
|
|
14
|
+
|
|
15
|
+
const any = () => {
|
|
16
|
+
const props = jsx.useProps();
|
|
17
|
+
useSchemaType.useSchemaType('any', props);
|
|
18
|
+
const rules = [];
|
|
19
|
+
if ((props === null || props === void 0 ? void 0 : props.default) !== undefined) {
|
|
20
|
+
rules.push(defaultTo.defaultTo(props.default));
|
|
21
|
+
}
|
|
22
|
+
if ((props === null || props === void 0 ? void 0 : props.default) === undefined) {
|
|
23
|
+
const parentRule = useParentRule.useParentRule();
|
|
24
|
+
useRule.useRule(parentRule(pipe.pipe(...rules)));
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
useRule.useRule(pipe.pipe(...rules));
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
exports.any = any;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { useProps
|
|
1
|
+
import { useProps } from '@innet/jsx';
|
|
2
2
|
import '../../../hooks/index.es6.js';
|
|
3
3
|
import '../../../hooks/useParentRule/index.es6.js';
|
|
4
4
|
import '../../../utils/index.es6.js';
|
|
5
5
|
import { useBlock } from '../../../hooks/useBlock/useBlock.es6.js';
|
|
6
6
|
import { useSchemaType } from '../../../hooks/useSchemaType/useSchemaType.es6.js';
|
|
7
|
-
import { paramContext } from '../../../hooks/useParam/useParam.es6.js';
|
|
8
7
|
import { defaultTo } from '../../../utils/rules/defaultTo/defaultTo.es6.js';
|
|
9
8
|
import { useParentRule } from '../../../hooks/useParentRule/useParentRule.es6.js';
|
|
10
9
|
import { useRule } from '../../../hooks/useRule/useRule.es6.js';
|
|
@@ -14,12 +13,11 @@ const boolean = () => {
|
|
|
14
13
|
useBlock('path');
|
|
15
14
|
const props = useProps();
|
|
16
15
|
useSchemaType('boolean', props);
|
|
17
|
-
const param = useContext(paramContext);
|
|
18
16
|
const rules = [];
|
|
19
17
|
if ((props === null || props === void 0 ? void 0 : props.default) !== undefined) {
|
|
20
18
|
rules.push(defaultTo(props.default));
|
|
21
19
|
}
|
|
22
|
-
rules.push(
|
|
20
|
+
rules.push(val => val === 'true' || (val === 'false' ? false : Boolean(val)));
|
|
23
21
|
if ((props === null || props === void 0 ? void 0 : props.default) === undefined) {
|
|
24
22
|
const parentRule = useParentRule();
|
|
25
23
|
useRule(parentRule(pipe(...rules)));
|
|
@@ -8,7 +8,6 @@ require('../../../hooks/useParentRule/index.js');
|
|
|
8
8
|
require('../../../utils/index.js');
|
|
9
9
|
var useBlock = require('../../../hooks/useBlock/useBlock.js');
|
|
10
10
|
var useSchemaType = require('../../../hooks/useSchemaType/useSchemaType.js');
|
|
11
|
-
var useParam = require('../../../hooks/useParam/useParam.js');
|
|
12
11
|
var defaultTo = require('../../../utils/rules/defaultTo/defaultTo.js');
|
|
13
12
|
var useParentRule = require('../../../hooks/useParentRule/useParentRule.js');
|
|
14
13
|
var useRule = require('../../../hooks/useRule/useRule.js');
|
|
@@ -18,12 +17,11 @@ const boolean = () => {
|
|
|
18
17
|
useBlock.useBlock('path');
|
|
19
18
|
const props = jsx.useProps();
|
|
20
19
|
useSchemaType.useSchemaType('boolean', props);
|
|
21
|
-
const param = jsx.useContext(useParam.paramContext);
|
|
22
20
|
const rules = [];
|
|
23
21
|
if ((props === null || props === void 0 ? void 0 : props.default) !== undefined) {
|
|
24
22
|
rules.push(defaultTo.defaultTo(props.default));
|
|
25
23
|
}
|
|
26
|
-
rules.push(
|
|
24
|
+
rules.push(val => val === 'true' || (val === 'false' ? false : Boolean(val)));
|
|
27
25
|
if ((props === null || props === void 0 ? void 0 : props.default) === undefined) {
|
|
28
26
|
const parentRule = useParentRule.useParentRule();
|
|
29
27
|
useRule.useRule(parentRule(pipe.pipe(...rules)));
|
|
@@ -2,7 +2,8 @@ import innet, { useNewHandler } from 'innet';
|
|
|
2
2
|
import { useProps, useChildren } from '@innet/jsx';
|
|
3
3
|
import '../../../hooks/index.es6.js';
|
|
4
4
|
import '../../../utils/index.es6.js';
|
|
5
|
-
import {
|
|
5
|
+
import { useObjectSchemaContext } from '../../../hooks/useObjectSchemaContext/useObjectSchemaContext.es6.js';
|
|
6
|
+
import { schemaContext } from '../../../hooks/useSchemaContext/useSchemaContext.es6.js';
|
|
6
7
|
import { useObjectRule, objectRuleContext } from '../../../hooks/useObjectRule/useObjectRule.es6.js';
|
|
7
8
|
import { ruleContext } from '../../../hooks/useRule/useRule.es6.js';
|
|
8
9
|
import { required } from '../../../utils/rules/required/required.es6.js';
|
|
@@ -10,11 +11,8 @@ import { required } from '../../../utils/rules/required/required.es6.js';
|
|
|
10
11
|
const field = () => {
|
|
11
12
|
const handler = useNewHandler();
|
|
12
13
|
const { key, optional } = useProps();
|
|
13
|
-
const schema =
|
|
14
|
+
const schema = useObjectSchemaContext();
|
|
14
15
|
const children = useChildren();
|
|
15
|
-
if (Array.isArray(schema) || (schema === null || schema === void 0 ? void 0 : schema.type) !== 'object') {
|
|
16
|
-
throw Error('Use <field> inside <object>');
|
|
17
|
-
}
|
|
18
16
|
if (!schema.properties) {
|
|
19
17
|
schema.properties = {};
|
|
20
18
|
}
|
|
@@ -6,6 +6,7 @@ var innet = require('innet');
|
|
|
6
6
|
var jsx = require('@innet/jsx');
|
|
7
7
|
require('../../../hooks/index.js');
|
|
8
8
|
require('../../../utils/index.js');
|
|
9
|
+
var useObjectSchemaContext = require('../../../hooks/useObjectSchemaContext/useObjectSchemaContext.js');
|
|
9
10
|
var useSchemaContext = require('../../../hooks/useSchemaContext/useSchemaContext.js');
|
|
10
11
|
var useObjectRule = require('../../../hooks/useObjectRule/useObjectRule.js');
|
|
11
12
|
var useRule = require('../../../hooks/useRule/useRule.js');
|
|
@@ -18,11 +19,8 @@ var innet__default = /*#__PURE__*/_interopDefaultLegacy(innet);
|
|
|
18
19
|
const field = () => {
|
|
19
20
|
const handler = innet.useNewHandler();
|
|
20
21
|
const { key, optional } = jsx.useProps();
|
|
21
|
-
const schema =
|
|
22
|
+
const schema = useObjectSchemaContext.useObjectSchemaContext();
|
|
22
23
|
const children = jsx.useChildren();
|
|
23
|
-
if (Array.isArray(schema) || (schema === null || schema === void 0 ? void 0 : schema.type) !== 'object') {
|
|
24
|
-
throw Error('Use <field> inside <object>');
|
|
25
|
-
}
|
|
26
24
|
if (!schema.properties) {
|
|
27
25
|
schema.properties = {};
|
|
28
26
|
}
|
package/plugins/schema/index.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import innet, { useNewHandler } from 'innet';
|
|
2
2
|
import { useChildren, useProps } from '@innet/jsx';
|
|
3
|
+
import { callHandler } from '@innet/utils';
|
|
3
4
|
import '../../../hooks/index.es6.js';
|
|
4
5
|
import '../../../hooks/useParentRule/index.es6.js';
|
|
5
6
|
import '../../../utils/index.es6.js';
|
|
6
7
|
import { useBlock } from '../../../hooks/useBlock/useBlock.es6.js';
|
|
7
8
|
import { useApi } from '../../../hooks/useApi/useApi.es6.js';
|
|
8
9
|
import { useSchemaType } from '../../../hooks/useSchemaType/useSchemaType.es6.js';
|
|
10
|
+
import { objectSchemaContext } from '../../../hooks/useObjectSchemaContext/useObjectSchemaContext.es6.js';
|
|
9
11
|
import { schemaContext } from '../../../hooks/useSchemaContext/useSchemaContext.es6.js';
|
|
10
12
|
import { parentRuleContext, useParentRule } from '../../../hooks/useParentRule/useParentRule.es6.js';
|
|
11
13
|
import { defaultTo } from '../../../utils/rules/defaultTo/defaultTo.es6.js';
|
|
@@ -22,19 +24,23 @@ const object = () => {
|
|
|
22
24
|
const schema = useSchemaType('object', props);
|
|
23
25
|
const handler = useNewHandler();
|
|
24
26
|
if (schema) {
|
|
25
|
-
|
|
27
|
+
schema.additionalProperties = {};
|
|
28
|
+
objectSchemaContext.set(handler, schema);
|
|
29
|
+
schemaContext.set(handler, schema.additionalProperties);
|
|
26
30
|
parentRuleContext.reset(handler);
|
|
27
31
|
const rules = [];
|
|
28
32
|
const rulesMap = {};
|
|
29
33
|
if ((props === null || props === void 0 ? void 0 : props.default) !== undefined) {
|
|
30
34
|
rules.push(defaultTo(props.default));
|
|
31
35
|
}
|
|
36
|
+
let childRule = v => v;
|
|
37
|
+
const restRule = (value, data) => childRule(value, data);
|
|
32
38
|
if ((props === null || props === void 0 ? void 0 : props.default) !== undefined) {
|
|
33
|
-
rules.push(objectOf(rulesMap));
|
|
39
|
+
rules.push(objectOf(rulesMap, restRule));
|
|
34
40
|
}
|
|
35
41
|
else {
|
|
36
42
|
const parentRule = useParentRule();
|
|
37
|
-
rules.push(parentRule(objectOf(rulesMap)));
|
|
43
|
+
rules.push(parentRule(objectOf(rulesMap, restRule)));
|
|
38
44
|
}
|
|
39
45
|
const rule = pipe(...rules);
|
|
40
46
|
if (props.ref) {
|
|
@@ -42,9 +48,16 @@ const object = () => {
|
|
|
42
48
|
}
|
|
43
49
|
useRule(rule);
|
|
44
50
|
objectRuleContext.set(handler, rulesMap);
|
|
45
|
-
ruleContext.set(handler,
|
|
51
|
+
ruleContext.set(handler, rule => {
|
|
52
|
+
childRule = rule;
|
|
53
|
+
});
|
|
46
54
|
parentRuleContext.reset(handler);
|
|
47
55
|
innet(children, handler);
|
|
56
|
+
innet(() => {
|
|
57
|
+
if (!Object.keys(schema.additionalProperties).length) {
|
|
58
|
+
delete schema.additionalProperties;
|
|
59
|
+
}
|
|
60
|
+
}, callHandler);
|
|
48
61
|
}
|
|
49
62
|
else if (props.ref) {
|
|
50
63
|
useRule(refRules[props.ref]);
|
|
@@ -4,12 +4,14 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var innet = require('innet');
|
|
6
6
|
var jsx = require('@innet/jsx');
|
|
7
|
+
var utils = require('@innet/utils');
|
|
7
8
|
require('../../../hooks/index.js');
|
|
8
9
|
require('../../../hooks/useParentRule/index.js');
|
|
9
10
|
require('../../../utils/index.js');
|
|
10
11
|
var useBlock = require('../../../hooks/useBlock/useBlock.js');
|
|
11
12
|
var useApi = require('../../../hooks/useApi/useApi.js');
|
|
12
13
|
var useSchemaType = require('../../../hooks/useSchemaType/useSchemaType.js');
|
|
14
|
+
var useObjectSchemaContext = require('../../../hooks/useObjectSchemaContext/useObjectSchemaContext.js');
|
|
13
15
|
var useSchemaContext = require('../../../hooks/useSchemaContext/useSchemaContext.js');
|
|
14
16
|
var useParentRule = require('../../../hooks/useParentRule/useParentRule.js');
|
|
15
17
|
var defaultTo = require('../../../utils/rules/defaultTo/defaultTo.js');
|
|
@@ -30,19 +32,23 @@ const object = () => {
|
|
|
30
32
|
const schema = useSchemaType.useSchemaType('object', props);
|
|
31
33
|
const handler = innet.useNewHandler();
|
|
32
34
|
if (schema) {
|
|
33
|
-
|
|
35
|
+
schema.additionalProperties = {};
|
|
36
|
+
useObjectSchemaContext.objectSchemaContext.set(handler, schema);
|
|
37
|
+
useSchemaContext.schemaContext.set(handler, schema.additionalProperties);
|
|
34
38
|
useParentRule.parentRuleContext.reset(handler);
|
|
35
39
|
const rules = [];
|
|
36
40
|
const rulesMap = {};
|
|
37
41
|
if ((props === null || props === void 0 ? void 0 : props.default) !== undefined) {
|
|
38
42
|
rules.push(defaultTo.defaultTo(props.default));
|
|
39
43
|
}
|
|
44
|
+
let childRule = v => v;
|
|
45
|
+
const restRule = (value, data) => childRule(value, data);
|
|
40
46
|
if ((props === null || props === void 0 ? void 0 : props.default) !== undefined) {
|
|
41
|
-
rules.push(objectOf.objectOf(rulesMap));
|
|
47
|
+
rules.push(objectOf.objectOf(rulesMap, restRule));
|
|
42
48
|
}
|
|
43
49
|
else {
|
|
44
50
|
const parentRule = useParentRule.useParentRule();
|
|
45
|
-
rules.push(parentRule(objectOf.objectOf(rulesMap)));
|
|
51
|
+
rules.push(parentRule(objectOf.objectOf(rulesMap, restRule)));
|
|
46
52
|
}
|
|
47
53
|
const rule = pipe.pipe(...rules);
|
|
48
54
|
if (props.ref) {
|
|
@@ -50,9 +56,16 @@ const object = () => {
|
|
|
50
56
|
}
|
|
51
57
|
useRule.useRule(rule);
|
|
52
58
|
useObjectRule.objectRuleContext.set(handler, rulesMap);
|
|
53
|
-
useRule.ruleContext.set(handler,
|
|
59
|
+
useRule.ruleContext.set(handler, rule => {
|
|
60
|
+
childRule = rule;
|
|
61
|
+
});
|
|
54
62
|
useParentRule.parentRuleContext.reset(handler);
|
|
55
63
|
innet__default["default"](children, handler);
|
|
64
|
+
innet__default["default"](() => {
|
|
65
|
+
if (!Object.keys(schema.additionalProperties).length) {
|
|
66
|
+
delete schema.additionalProperties;
|
|
67
|
+
}
|
|
68
|
+
}, utils.callHandler);
|
|
56
69
|
}
|
|
57
70
|
else if (props.ref) {
|
|
58
71
|
useRule.useRule(refRules[props.ref]);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useProps, useChildren } from '@innet/jsx';
|
|
2
|
+
import '../../../hooks/index.es6.js';
|
|
3
|
+
import { useServerPlugin } from '../../../hooks/useServerPlugin/useServerPlugin.es6.js';
|
|
4
|
+
import { useAction } from '../../../hooks/useAction/useAction.es6.js';
|
|
5
|
+
|
|
6
|
+
function blacklist() {
|
|
7
|
+
const { ip = process.env.INNET_BLACKLIST_IP, } = useProps() || {};
|
|
8
|
+
const children = useChildren();
|
|
9
|
+
const ips = typeof ip === 'string' ? ip.split(',') : ip;
|
|
10
|
+
useServerPlugin(() => {
|
|
11
|
+
const action = useAction();
|
|
12
|
+
if (!action.clientIp || (ips === null || ips === void 0 ? void 0 : ips.includes(action.clientIp))) {
|
|
13
|
+
return children;
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export { blacklist };
|