typespeed 2.0.20 → 2.0.22
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 +18 -13
- package/dist/core.decorator.js +1 -30
- package/dist/default/default-authentication.class.js +25 -0
- package/dist/default/express-server.class.js +11 -4
- package/dist/default/log-default.class.js +0 -6
- package/dist/factory/authentication-factory.class.js +11 -0
- package/dist/factory/log-factory.class.js +9 -0
- package/dist/route.decorator.js +92 -2
- package/dist/scaffold/command.js +1 -1
- package/dist/typespeed.d.ts +25 -3
- package/dist/typespeed.js +3 -1
- package/package.json +10 -1
- package/src/core.decorator.ts +1 -29
- package/src/default/default-authentication.class.ts +10 -0
- package/src/default/express-server.class.ts +12 -5
- package/src/default/log-default.class.ts +0 -10
- package/src/factory/authentication-factory.class.ts +9 -0
- package/src/factory/log-factory.class.ts +9 -2
- package/src/route.decorator.ts +91 -3
- package/src/scaffold/command.ts +1 -1
- package/src/typespeed.d.ts +25 -3
- package/src/typespeed.ts +1 -0
- package/test/node_modules/.package-lock.json +65 -101
- package/test/node_modules/@types/body-parser/LICENSE +21 -0
- package/test/node_modules/@types/body-parser/README.md +16 -0
- package/test/node_modules/@types/body-parser/index.d.ts +107 -0
- package/test/node_modules/@types/body-parser/package.json +58 -0
- package/test/node_modules/@types/connect/LICENSE +21 -0
- package/test/node_modules/@types/connect/README.md +16 -0
- package/test/node_modules/@types/connect/index.d.ts +93 -0
- package/test/node_modules/@types/connect/package.json +32 -0
- package/test/node_modules/@types/express/LICENSE +21 -0
- package/test/node_modules/@types/express/README.md +16 -0
- package/test/node_modules/@types/express/index.d.ts +136 -0
- package/test/node_modules/@types/express/package.json +45 -0
- package/test/node_modules/@types/express-serve-static-core/LICENSE +21 -0
- package/test/node_modules/@types/express-serve-static-core/README.md +16 -0
- package/test/node_modules/@types/express-serve-static-core/index.d.ts +1281 -0
- package/test/node_modules/@types/express-serve-static-core/package.json +55 -0
- package/test/node_modules/@types/mime/LICENSE +21 -0
- package/test/node_modules/@types/mime/Mime.d.ts +10 -0
- package/test/node_modules/@types/mime/README.md +16 -0
- package/test/node_modules/@types/mime/index.d.ts +35 -0
- package/test/node_modules/@types/mime/lite.d.ts +7 -0
- package/test/node_modules/@types/mime/package.json +29 -0
- package/test/node_modules/@types/qs/LICENSE +21 -0
- package/test/node_modules/@types/qs/README.md +16 -0
- package/test/node_modules/@types/qs/index.d.ts +62 -0
- package/test/node_modules/@types/qs/package.json +65 -0
- package/test/node_modules/@types/range-parser/LICENSE +21 -0
- package/test/node_modules/@types/range-parser/README.md +55 -0
- package/test/node_modules/@types/range-parser/index.d.ts +35 -0
- package/test/node_modules/@types/range-parser/package.json +25 -0
- package/test/node_modules/@types/send/LICENSE +21 -0
- package/test/node_modules/@types/send/README.md +16 -0
- package/test/node_modules/@types/send/index.d.ts +231 -0
- package/test/node_modules/@types/send/package.json +33 -0
- package/test/node_modules/@types/serve-static/LICENSE +21 -0
- package/test/node_modules/@types/serve-static/README.md +16 -0
- package/test/node_modules/@types/serve-static/index.d.ts +113 -0
- package/test/node_modules/@types/serve-static/package.json +38 -0
- package/test/src/config.json +5 -0
- package/test/src/custom-log.class.ts +6 -0
- package/test/src/jwt-authentication.class.ts +29 -0
- package/test/src/test-request.class.ts +36 -0
- package/test/node_modules/@acuminous/bitsyntax/.github/workflows/node-js-ci.yml +0 -17
- package/test/node_modules/@acuminous/bitsyntax/.github/workflows/node-js-publish.yml +0 -30
- package/test/node_modules/@acuminous/bitsyntax/LICENSE +0 -6
- package/test/node_modules/@acuminous/bitsyntax/LICENSE-MIT +0 -21
- package/test/node_modules/@acuminous/bitsyntax/Makefile +0 -15
- package/test/node_modules/@acuminous/bitsyntax/README.md +0 -308
- package/test/node_modules/@acuminous/bitsyntax/index.js +0 -10
- package/test/node_modules/@acuminous/bitsyntax/lib/compile.js +0 -303
- package/test/node_modules/@acuminous/bitsyntax/lib/constructor.js +0 -142
- package/test/node_modules/@acuminous/bitsyntax/lib/grammar.pegjs +0 -67
- package/test/node_modules/@acuminous/bitsyntax/lib/interp.js +0 -232
- package/test/node_modules/@acuminous/bitsyntax/lib/parse.js +0 -32
- package/test/node_modules/@acuminous/bitsyntax/lib/parser.js +0 -1173
- package/test/node_modules/@acuminous/bitsyntax/lib/pattern.js +0 -119
- package/test/node_modules/@acuminous/bitsyntax/package.json +0 -36
- package/test/node_modules/@acuminous/bitsyntax/test/consing.test.js +0 -50
- package/test/node_modules/@acuminous/bitsyntax/test/matching.test.js +0 -193
- package/test/node_modules/amqplib/.github/ISSUE_TEMPLATE/bug_report.md +0 -38
- package/test/node_modules/amqplib/.github/workflows/test.yml +0 -38
- package/test/node_modules/amqplib/CHANGELOG.md +0 -430
- package/test/node_modules/amqplib/LICENSE +0 -6
- package/test/node_modules/amqplib/LICENSE-MIT +0 -21
- package/test/node_modules/amqplib/Makefile +0 -47
- package/test/node_modules/amqplib/README.md +0 -157
- package/test/node_modules/amqplib/bin/generate-defs.js +0 -722
- package/test/node_modules/amqplib/callback_api.js +0 -22
- package/test/node_modules/amqplib/channel_api.js +0 -16
- package/test/node_modules/amqplib/examples/headers.js +0 -42
- package/test/node_modules/amqplib/examples/receive_generator.js +0 -39
- package/test/node_modules/amqplib/examples/send_generators.js +0 -42
- package/test/node_modules/amqplib/examples/ssl.js +0 -64
- package/test/node_modules/amqplib/examples/tutorials/README.md +0 -93
- package/test/node_modules/amqplib/examples/tutorials/callback_api/emit_log.js +0 -28
- package/test/node_modules/amqplib/examples/tutorials/callback_api/emit_log_direct.js +0 -30
- package/test/node_modules/amqplib/examples/tutorials/callback_api/emit_log_topic.js +0 -27
- package/test/node_modules/amqplib/examples/tutorials/callback_api/new_task.js +0 -27
- package/test/node_modules/amqplib/examples/tutorials/callback_api/receive.js +0 -30
- package/test/node_modules/amqplib/examples/tutorials/callback_api/receive_logs.js +0 -36
- package/test/node_modules/amqplib/examples/tutorials/callback_api/receive_logs_direct.js +0 -56
- package/test/node_modules/amqplib/examples/tutorials/callback_api/receive_logs_topic.js +0 -55
- package/test/node_modules/amqplib/examples/tutorials/callback_api/rpc_client.js +0 -49
- package/test/node_modules/amqplib/examples/tutorials/callback_api/rpc_server.js +0 -45
- package/test/node_modules/amqplib/examples/tutorials/callback_api/send.js +0 -29
- package/test/node_modules/amqplib/examples/tutorials/callback_api/worker.js +0 -35
- package/test/node_modules/amqplib/examples/tutorials/emit_log.js +0 -19
- package/test/node_modules/amqplib/examples/tutorials/emit_log_direct.js +0 -20
- package/test/node_modules/amqplib/examples/tutorials/emit_log_topic.js +0 -19
- package/test/node_modules/amqplib/examples/tutorials/new_task.js +0 -18
- package/test/node_modules/amqplib/examples/tutorials/package.json +0 -16
- package/test/node_modules/amqplib/examples/tutorials/receive.js +0 -21
- package/test/node_modules/amqplib/examples/tutorials/receive_logs.js +0 -28
- package/test/node_modules/amqplib/examples/tutorials/receive_logs_direct.js +0 -44
- package/test/node_modules/amqplib/examples/tutorials/receive_logs_topic.js +0 -43
- package/test/node_modules/amqplib/examples/tutorials/rpc_client.js +0 -52
- package/test/node_modules/amqplib/examples/tutorials/rpc_server.js +0 -39
- package/test/node_modules/amqplib/examples/tutorials/send.js +0 -23
- package/test/node_modules/amqplib/examples/tutorials/worker.js +0 -28
- package/test/node_modules/amqplib/examples/waitForConfirms.js +0 -22
- package/test/node_modules/amqplib/lib/api_args.js +0 -314
- package/test/node_modules/amqplib/lib/bitset.js +0 -130
- package/test/node_modules/amqplib/lib/callback_model.js +0 -327
- package/test/node_modules/amqplib/lib/channel.js +0 -499
- package/test/node_modules/amqplib/lib/channel_model.js +0 -302
- package/test/node_modules/amqplib/lib/codec.js +0 -321
- package/test/node_modules/amqplib/lib/connect.js +0 -189
- package/test/node_modules/amqplib/lib/connection.js +0 -663
- package/test/node_modules/amqplib/lib/credentials.js +0 -42
- package/test/node_modules/amqplib/lib/defs.js +0 -4966
- package/test/node_modules/amqplib/lib/error.js +0 -24
- package/test/node_modules/amqplib/lib/format.js +0 -40
- package/test/node_modules/amqplib/lib/frame.js +0 -113
- package/test/node_modules/amqplib/lib/heartbeat.js +0 -89
- package/test/node_modules/amqplib/lib/mux.js +0 -129
- package/test/node_modules/amqplib/package.json +0 -37
- package/test/node_modules/amqplib/test/bitset.js +0 -69
- package/test/node_modules/amqplib/test/callback_api.js +0 -312
- package/test/node_modules/amqplib/test/channel.js +0 -621
- package/test/node_modules/amqplib/test/channel_api.js +0 -596
- package/test/node_modules/amqplib/test/codec.js +0 -237
- package/test/node_modules/amqplib/test/connect.js +0 -197
- package/test/node_modules/amqplib/test/connection.js +0 -390
- package/test/node_modules/amqplib/test/data.js +0 -254
- package/test/node_modules/amqplib/test/frame.js +0 -198
- package/test/node_modules/amqplib/test/mux.js +0 -204
- package/test/node_modules/amqplib/test/util.js +0 -219
- package/test/node_modules/buffer-more-ints/.travis.yml +0 -6
- package/test/node_modules/buffer-more-ints/LICENSE +0 -19
- package/test/node_modules/buffer-more-ints/README.md +0 -69
- package/test/node_modules/buffer-more-ints/buffer-more-ints-tests.js +0 -183
- package/test/node_modules/buffer-more-ints/buffer-more-ints.js +0 -432
- package/test/node_modules/buffer-more-ints/package.json +0 -19
- package/test/node_modules/buffer-more-ints/polyfill.js +0 -71
- package/test/node_modules/core-util-is/LICENSE +0 -19
- package/test/node_modules/core-util-is/README.md +0 -3
- package/test/node_modules/core-util-is/lib/util.js +0 -107
- package/test/node_modules/core-util-is/package.json +0 -38
- package/test/node_modules/debug/LICENSE +0 -20
- package/test/node_modules/debug/README.md +0 -481
- package/test/node_modules/debug/package.json +0 -59
- package/test/node_modules/debug/src/browser.js +0 -269
- package/test/node_modules/debug/src/common.js +0 -274
- package/test/node_modules/debug/src/index.js +0 -10
- package/test/node_modules/debug/src/node.js +0 -263
- package/test/node_modules/inherits/LICENSE +0 -16
- package/test/node_modules/inherits/README.md +0 -42
- package/test/node_modules/inherits/inherits.js +0 -9
- package/test/node_modules/inherits/inherits_browser.js +0 -27
- package/test/node_modules/inherits/package.json +0 -29
- package/test/node_modules/isarray/README.md +0 -54
- package/test/node_modules/isarray/build/build.js +0 -209
- package/test/node_modules/isarray/component.json +0 -19
- package/test/node_modules/isarray/index.js +0 -3
- package/test/node_modules/isarray/package.json +0 -25
- package/test/node_modules/ms/index.js +0 -162
- package/test/node_modules/ms/license.md +0 -21
- package/test/node_modules/ms/package.json +0 -37
- package/test/node_modules/ms/readme.md +0 -60
- package/test/node_modules/querystringify/LICENSE +0 -22
- package/test/node_modules/querystringify/README.md +0 -61
- package/test/node_modules/querystringify/index.js +0 -118
- package/test/node_modules/querystringify/package.json +0 -38
- package/test/node_modules/readable-stream/LICENSE +0 -18
- package/test/node_modules/readable-stream/README.md +0 -15
- package/test/node_modules/readable-stream/duplex.js +0 -1
- package/test/node_modules/readable-stream/float.patch +0 -923
- package/test/node_modules/readable-stream/lib/_stream_duplex.js +0 -89
- package/test/node_modules/readable-stream/lib/_stream_passthrough.js +0 -46
- package/test/node_modules/readable-stream/lib/_stream_readable.js +0 -951
- package/test/node_modules/readable-stream/lib/_stream_transform.js +0 -209
- package/test/node_modules/readable-stream/lib/_stream_writable.js +0 -477
- package/test/node_modules/readable-stream/package.json +0 -32
- package/test/node_modules/readable-stream/passthrough.js +0 -1
- package/test/node_modules/readable-stream/readable.js +0 -10
- package/test/node_modules/readable-stream/transform.js +0 -1
- package/test/node_modules/readable-stream/writable.js +0 -1
- package/test/node_modules/requires-port/.travis.yml +0 -19
- package/test/node_modules/requires-port/LICENSE +0 -22
- package/test/node_modules/requires-port/README.md +0 -47
- package/test/node_modules/requires-port/index.js +0 -38
- package/test/node_modules/requires-port/package.json +0 -47
- package/test/node_modules/requires-port/test.js +0 -98
- package/test/node_modules/safe-buffer/LICENSE +0 -21
- package/test/node_modules/safe-buffer/README.md +0 -584
- package/test/node_modules/safe-buffer/index.d.ts +0 -187
- package/test/node_modules/safe-buffer/index.js +0 -62
- package/test/node_modules/safe-buffer/package.json +0 -37
- package/test/node_modules/string_decoder/LICENSE +0 -20
- package/test/node_modules/string_decoder/README.md +0 -7
- package/test/node_modules/string_decoder/index.js +0 -221
- package/test/node_modules/string_decoder/package.json +0 -25
- package/test/node_modules/url-parse/LICENSE +0 -22
- package/test/node_modules/url-parse/README.md +0 -153
- package/test/node_modules/url-parse/dist/url-parse.js +0 -755
- package/test/node_modules/url-parse/dist/url-parse.min.js +0 -1
- package/test/node_modules/url-parse/dist/url-parse.min.js.map +0 -1
- package/test/node_modules/url-parse/index.js +0 -589
- package/test/node_modules/url-parse/package.json +0 -49
package/src/route.decorator.ts
CHANGED
|
@@ -2,13 +2,15 @@ import * as express from "express";
|
|
|
2
2
|
import * as multiparty from "multiparty";
|
|
3
3
|
import { expressjwt } from "express-jwt";
|
|
4
4
|
import { getComponent } from "./core.decorator";
|
|
5
|
+
import { param } from "./database.decorator";
|
|
5
6
|
|
|
6
7
|
const routerMapper = {
|
|
7
8
|
"get": {},
|
|
8
9
|
"post": {},
|
|
9
10
|
"all": {}
|
|
10
11
|
};
|
|
11
|
-
|
|
12
|
+
const routerParams = {};
|
|
13
|
+
const routerParamsTotal = {};
|
|
12
14
|
const routerMiddleware = {};
|
|
13
15
|
function setRouter(app: express.Application) {
|
|
14
16
|
["get", "post", "all"].forEach(method => {
|
|
@@ -32,7 +34,19 @@ function mapperFunction(method: string, value: string) {
|
|
|
32
34
|
"invoker": async (req, res, next) => {
|
|
33
35
|
const routerBean = getComponent(target.constructor);
|
|
34
36
|
try {
|
|
35
|
-
|
|
37
|
+
let paramTotal = routerBean[propertyKey].length;
|
|
38
|
+
if(routerParamsTotal[[target.constructor.name, propertyKey].toString()]){
|
|
39
|
+
paramTotal = Math.max(paramTotal, routerParamsTotal[[target.constructor.name, propertyKey].toString()]);
|
|
40
|
+
}
|
|
41
|
+
let args = [req, res, next];
|
|
42
|
+
if(paramTotal > 0) {
|
|
43
|
+
for(let i = 0; i < paramTotal; i++) {
|
|
44
|
+
if(routerParams[[target.constructor.name, propertyKey, i].toString()]){
|
|
45
|
+
args[i] = routerParams[[target.constructor.name, propertyKey, i].toString()](req, res, next);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
const testResult = await routerBean[propertyKey].apply(routerBean, args);
|
|
36
50
|
if (typeof testResult === "object") {
|
|
37
51
|
res.json(testResult);
|
|
38
52
|
} else if (typeof testResult !== "undefined") {
|
|
@@ -75,8 +89,82 @@ function jwt(jwtConfig) {
|
|
|
75
89
|
}
|
|
76
90
|
}
|
|
77
91
|
|
|
92
|
+
function before(constructorFunction, methodName: string) {
|
|
93
|
+
const targetBean = getComponent(constructorFunction);
|
|
94
|
+
return function (target, propertyKey: string) {
|
|
95
|
+
const currentMethod = targetBean[methodName];
|
|
96
|
+
if(currentMethod.length > 0){
|
|
97
|
+
routerParamsTotal[[constructorFunction.name, methodName].toString()] = currentMethod.length;
|
|
98
|
+
}
|
|
99
|
+
Object.assign(targetBean, {
|
|
100
|
+
[methodName]: function (...args) {
|
|
101
|
+
target[propertyKey](...args);
|
|
102
|
+
return currentMethod.apply(targetBean, args);
|
|
103
|
+
}
|
|
104
|
+
})
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function after(constructorFunction, methodName: string) {
|
|
109
|
+
const targetBean = getComponent(constructorFunction);
|
|
110
|
+
return function (target, propertyKey: string) {
|
|
111
|
+
const currentMethod = targetBean[methodName];
|
|
112
|
+
if(currentMethod.length > 0){
|
|
113
|
+
routerParamsTotal[[constructorFunction.name, methodName].toString()] = currentMethod.length;
|
|
114
|
+
}
|
|
115
|
+
Object.assign(targetBean, {
|
|
116
|
+
[methodName]: function (...args) {
|
|
117
|
+
const result = currentMethod.apply(targetBean, args);
|
|
118
|
+
const afterResult = target[propertyKey](result);
|
|
119
|
+
return afterResult ?? result;
|
|
120
|
+
}
|
|
121
|
+
})
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function req(target: any, propertyKey: string, parameterIndex: number) {
|
|
126
|
+
const key = [target.constructor.name, propertyKey, parameterIndex].toString();
|
|
127
|
+
routerParams[key] = (req, res, next) => req;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function res(target: any, propertyKey: string, parameterIndex: number) {
|
|
131
|
+
const key = [target.constructor.name, propertyKey, parameterIndex].toString();
|
|
132
|
+
routerParams[key] = (req, res, next) => res;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function next(target: any, propertyKey: string, parameterIndex: number) {
|
|
136
|
+
const key = [target.constructor.name, propertyKey, parameterIndex].toString();
|
|
137
|
+
routerParams[key] = (req, res, next) => next;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function reqBody(target: any, propertyKey: string, parameterIndex: number) {
|
|
141
|
+
const key = [target.constructor.name, propertyKey, parameterIndex].toString();
|
|
142
|
+
routerParams[key] = (req, res, next) => req.body;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
function reqParam(paramName: string) {
|
|
146
|
+
return (target: any, propertyKey: string, parameterIndex: number) => {
|
|
147
|
+
const key = [target.constructor.name, propertyKey, parameterIndex].toString();
|
|
148
|
+
routerParams[key] = (req, res, next) => req.params[paramName];
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function reqQuery(paramName: string) {
|
|
153
|
+
return (target: any, propertyKey: string, parameterIndex: number) => {
|
|
154
|
+
const key = [target.constructor.name, propertyKey, parameterIndex].toString();
|
|
155
|
+
routerParams[key] = (req, res, next) => req.query[paramName];
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
function reqForm(paramName: string) {
|
|
160
|
+
return (target: any, propertyKey: string, parameterIndex: number) => {
|
|
161
|
+
const key = [target.constructor.name, propertyKey, parameterIndex].toString();
|
|
162
|
+
routerParams[key] = (req, res, next) => req.body[paramName];
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
78
166
|
const getMapping = (value: string) => mapperFunction("get", value);
|
|
79
167
|
const postMapping = (value: string) => mapperFunction("post", value);
|
|
80
168
|
const requestMapping = (value: string) => mapperFunction("all", value);
|
|
81
169
|
|
|
82
|
-
export { getMapping, postMapping, requestMapping, setRouter, upload, jwt };
|
|
170
|
+
export { next, reqBody, reqQuery, reqForm, reqParam, req, req as request, res, res as response, before, after, getMapping, postMapping, requestMapping, setRouter, upload, jwt };
|
package/src/scaffold/command.ts
CHANGED
package/src/typespeed.d.ts
CHANGED
|
@@ -192,12 +192,17 @@ declare abstract class LogFactory {
|
|
|
192
192
|
* 日志打印方法
|
|
193
193
|
* @param message 日志内容
|
|
194
194
|
*/
|
|
195
|
-
|
|
195
|
+
log(message?: any, ...optionalParams: any[]): void;
|
|
196
196
|
/**
|
|
197
197
|
* 错误日志打印方法
|
|
198
198
|
* @param message 日志内容
|
|
199
199
|
*/
|
|
200
|
-
|
|
200
|
+
error(message?: any, ...optionalParams: any[]): void;
|
|
201
|
+
/**
|
|
202
|
+
* 调试日志打印方法
|
|
203
|
+
* @param message 日志内容
|
|
204
|
+
*/
|
|
205
|
+
debug(message?: any, ...optionalParams: any[]): void;
|
|
201
206
|
}
|
|
202
207
|
/**数据源工厂类 */
|
|
203
208
|
declare abstract class DataSourceFactory {
|
|
@@ -234,6 +239,23 @@ declare abstract class CacheFactory {
|
|
|
234
239
|
/**清空缓存 */
|
|
235
240
|
abstract flush(): void;
|
|
236
241
|
}
|
|
242
|
+
/**认证类 */
|
|
243
|
+
declare abstract class AuthenticationFactory {
|
|
244
|
+
/**
|
|
245
|
+
* 路由页面执行前认证
|
|
246
|
+
* @param req 请求对象
|
|
247
|
+
* @param res 响应对象
|
|
248
|
+
* @param next 下一步函数
|
|
249
|
+
*/
|
|
250
|
+
preHandle(req: express.Request, res: express.Response, next: express.NextFunction): void;
|
|
251
|
+
/**
|
|
252
|
+
* 开始执行中间件前认证
|
|
253
|
+
* @param req 请求对象
|
|
254
|
+
* @param res 响应对象
|
|
255
|
+
* @param next 下一步函数
|
|
256
|
+
*/
|
|
257
|
+
afterCompletion(req: express.Request, res: express.Response, next: express.NextFunction): void;
|
|
258
|
+
}
|
|
237
259
|
/**Redis 操作类 */
|
|
238
260
|
declare class Redis extends IoRedis {
|
|
239
261
|
/**获取 Redis 实例 */
|
|
@@ -322,4 +344,4 @@ declare class ExpressServer extends ServerFactory {
|
|
|
322
344
|
private setDefaultMiddleware;
|
|
323
345
|
}
|
|
324
346
|
|
|
325
|
-
export { ExpressServer, LogDefault, NodeCache, RabbitMQ, rabbitListener, ReadWriteDb, Redis, CacheFactory, DataSourceFactory, LogFactory, ServerFactory, component, bean, resource, log, app, before, after, value, error, config, autoware, getBean, getComponent, schedule, getMapping, postMapping, requestMapping, setRouter, upload, jwt, insert, update, remove, select, param, resultType, cache, Model
|
|
347
|
+
export { ExpressServer, LogDefault, NodeCache, RabbitMQ, rabbitListener, ReadWriteDb, Redis, CacheFactory, DataSourceFactory, LogFactory, ServerFactory, AuthenticationFactory, component, bean, resource, log, app, before, after, value, error, config, autoware, getBean, getComponent, schedule, getMapping, postMapping, requestMapping, setRouter, upload, jwt, insert, update, remove, select, param, resultType, cache, Model};
|
package/src/typespeed.ts
CHANGED
|
@@ -7,6 +7,7 @@ export { default as LogFactory} from "./factory/log-factory.class";
|
|
|
7
7
|
export { default as CacheFactory} from "./factory/cache-factory.class";
|
|
8
8
|
export { default as DataSourceFactory} from "./factory/data-source-factory.class";
|
|
9
9
|
export { default as ServerFactory} from "./factory/server-factory.class";
|
|
10
|
+
export { default as AuthenticationFactory} from "./factory/authentication-factory.class";
|
|
10
11
|
|
|
11
12
|
export { default as ExpressServer} from "./default/express-server.class";
|
|
12
13
|
export { default as LogDefault} from "./default/log-default.class";
|
|
@@ -4,42 +4,82 @@
|
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
|
-
"node_modules/@
|
|
8
|
-
"version": "
|
|
9
|
-
"resolved": "https://registry.npmjs.org/@
|
|
10
|
-
"integrity": "sha512-
|
|
7
|
+
"node_modules/@types/body-parser": {
|
|
8
|
+
"version": "1.19.2",
|
|
9
|
+
"resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.2.tgz",
|
|
10
|
+
"integrity": "sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
"@types/connect": "*",
|
|
13
|
+
"@types/node": "*"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"node_modules/@types/connect": {
|
|
17
|
+
"version": "3.4.35",
|
|
18
|
+
"resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz",
|
|
19
|
+
"integrity": "sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==",
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@types/node": "*"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"node_modules/@types/express": {
|
|
25
|
+
"version": "4.17.17",
|
|
26
|
+
"resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.17.tgz",
|
|
27
|
+
"integrity": "sha512-Q4FmmuLGBG58btUnfS1c1r/NQdlp3DMfGDGig8WhfpA2YRUtEkxAjkZb0yvplJGYdF1fsQ81iMDcH24sSCNC/Q==",
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@types/body-parser": "*",
|
|
30
|
+
"@types/express-serve-static-core": "^4.17.33",
|
|
31
|
+
"@types/qs": "*",
|
|
32
|
+
"@types/serve-static": "*"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"node_modules/@types/express-serve-static-core": {
|
|
36
|
+
"version": "4.17.35",
|
|
37
|
+
"resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.35.tgz",
|
|
38
|
+
"integrity": "sha512-wALWQwrgiB2AWTT91CB62b6Yt0sNHpznUXeZEcnPU3DRdlDIz74x8Qg1UUYKSVFi+va5vKOLYRBI1bRKiLLKIg==",
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@types/node": "*",
|
|
41
|
+
"@types/qs": "*",
|
|
42
|
+
"@types/range-parser": "*",
|
|
43
|
+
"@types/send": "*"
|
|
18
44
|
}
|
|
19
45
|
},
|
|
46
|
+
"node_modules/@types/mime": {
|
|
47
|
+
"version": "1.3.2",
|
|
48
|
+
"resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.2.tgz",
|
|
49
|
+
"integrity": "sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw=="
|
|
50
|
+
},
|
|
20
51
|
"node_modules/@types/node": {
|
|
21
52
|
"version": "18.16.14",
|
|
22
53
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.16.14.tgz",
|
|
23
54
|
"integrity": "sha512-+ImzUB3mw2c5ISJUq0punjDilUQ5GnUim0ZRvchHIWJmOC0G+p0kzhXBqj6cDjK0QdPFwzrHWgrJp3RPvCG5qg=="
|
|
24
55
|
},
|
|
25
|
-
"node_modules/
|
|
26
|
-
"version": "
|
|
27
|
-
"resolved": "https://registry.npmjs.org/
|
|
28
|
-
"integrity": "sha512-
|
|
56
|
+
"node_modules/@types/qs": {
|
|
57
|
+
"version": "6.9.7",
|
|
58
|
+
"resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz",
|
|
59
|
+
"integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw=="
|
|
60
|
+
},
|
|
61
|
+
"node_modules/@types/range-parser": {
|
|
62
|
+
"version": "1.2.4",
|
|
63
|
+
"resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz",
|
|
64
|
+
"integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw=="
|
|
65
|
+
},
|
|
66
|
+
"node_modules/@types/send": {
|
|
67
|
+
"version": "0.17.1",
|
|
68
|
+
"resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.1.tgz",
|
|
69
|
+
"integrity": "sha512-Cwo8LE/0rnvX7kIIa3QHCkcuF21c05Ayb0ZfxPiv0W8VRiZiNW/WuRupHKpqqGVGf7SUA44QSOUKaEd9lIrd/Q==",
|
|
29
70
|
"dependencies": {
|
|
30
|
-
"@
|
|
31
|
-
"
|
|
32
|
-
"readable-stream": "1.x >=1.1.9",
|
|
33
|
-
"url-parse": "~1.5.10"
|
|
34
|
-
},
|
|
35
|
-
"engines": {
|
|
36
|
-
"node": ">=10"
|
|
71
|
+
"@types/mime": "^1",
|
|
72
|
+
"@types/node": "*"
|
|
37
73
|
}
|
|
38
74
|
},
|
|
39
|
-
"node_modules/
|
|
40
|
-
"version": "1.
|
|
41
|
-
"resolved": "https://registry.npmjs.org/
|
|
42
|
-
"integrity": "sha512-
|
|
75
|
+
"node_modules/@types/serve-static": {
|
|
76
|
+
"version": "1.15.1",
|
|
77
|
+
"resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.1.tgz",
|
|
78
|
+
"integrity": "sha512-NUo5XNiAdULrJENtJXZZ3fHtfMolzZwczzBbnAeBbqBwG+LaG6YaJtuwzwGSQZ2wsCrxjEhNNjAkKigy3n8teQ==",
|
|
79
|
+
"dependencies": {
|
|
80
|
+
"@types/mime": "*",
|
|
81
|
+
"@types/node": "*"
|
|
82
|
+
}
|
|
43
83
|
},
|
|
44
84
|
"node_modules/colors": {
|
|
45
85
|
"version": "1.4.0",
|
|
@@ -49,11 +89,6 @@
|
|
|
49
89
|
"node": ">=0.1.90"
|
|
50
90
|
}
|
|
51
91
|
},
|
|
52
|
-
"node_modules/core-util-is": {
|
|
53
|
-
"version": "1.0.3",
|
|
54
|
-
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
|
|
55
|
-
"integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ=="
|
|
56
|
-
},
|
|
57
92
|
"node_modules/dateformat": {
|
|
58
93
|
"version": "4.5.1",
|
|
59
94
|
"resolved": "https://registry.npmjs.org/dateformat/-/dateformat-4.5.1.tgz",
|
|
@@ -62,32 +97,6 @@
|
|
|
62
97
|
"node": "*"
|
|
63
98
|
}
|
|
64
99
|
},
|
|
65
|
-
"node_modules/debug": {
|
|
66
|
-
"version": "4.3.4",
|
|
67
|
-
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
|
|
68
|
-
"integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==",
|
|
69
|
-
"dependencies": {
|
|
70
|
-
"ms": "2.1.2"
|
|
71
|
-
},
|
|
72
|
-
"engines": {
|
|
73
|
-
"node": ">=6.0"
|
|
74
|
-
},
|
|
75
|
-
"peerDependenciesMeta": {
|
|
76
|
-
"supports-color": {
|
|
77
|
-
"optional": true
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
"node_modules/inherits": {
|
|
82
|
-
"version": "2.0.4",
|
|
83
|
-
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
|
84
|
-
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
|
|
85
|
-
},
|
|
86
|
-
"node_modules/isarray": {
|
|
87
|
-
"version": "0.0.1",
|
|
88
|
-
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
|
|
89
|
-
"integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ=="
|
|
90
|
-
},
|
|
91
100
|
"node_modules/mkdirp": {
|
|
92
101
|
"version": "1.0.4",
|
|
93
102
|
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",
|
|
@@ -99,42 +108,6 @@
|
|
|
99
108
|
"node": ">=10"
|
|
100
109
|
}
|
|
101
110
|
},
|
|
102
|
-
"node_modules/ms": {
|
|
103
|
-
"version": "2.1.2",
|
|
104
|
-
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
|
|
105
|
-
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
|
|
106
|
-
},
|
|
107
|
-
"node_modules/querystringify": {
|
|
108
|
-
"version": "2.2.0",
|
|
109
|
-
"resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz",
|
|
110
|
-
"integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ=="
|
|
111
|
-
},
|
|
112
|
-
"node_modules/readable-stream": {
|
|
113
|
-
"version": "1.1.14",
|
|
114
|
-
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz",
|
|
115
|
-
"integrity": "sha512-+MeVjFf4L44XUkhM1eYbD8fyEsxcV81pqMSR5gblfcLCHfZvbrqy4/qYHE+/R5HoBUT11WV5O08Cr1n3YXkWVQ==",
|
|
116
|
-
"dependencies": {
|
|
117
|
-
"core-util-is": "~1.0.0",
|
|
118
|
-
"inherits": "~2.0.1",
|
|
119
|
-
"isarray": "0.0.1",
|
|
120
|
-
"string_decoder": "~0.10.x"
|
|
121
|
-
}
|
|
122
|
-
},
|
|
123
|
-
"node_modules/requires-port": {
|
|
124
|
-
"version": "1.0.0",
|
|
125
|
-
"resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz",
|
|
126
|
-
"integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ=="
|
|
127
|
-
},
|
|
128
|
-
"node_modules/safe-buffer": {
|
|
129
|
-
"version": "5.1.2",
|
|
130
|
-
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
|
|
131
|
-
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
|
|
132
|
-
},
|
|
133
|
-
"node_modules/string_decoder": {
|
|
134
|
-
"version": "0.10.31",
|
|
135
|
-
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
|
|
136
|
-
"integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ=="
|
|
137
|
-
},
|
|
138
111
|
"node_modules/tinytim": {
|
|
139
112
|
"version": "0.1.1",
|
|
140
113
|
"resolved": "https://registry.npmjs.org/tinytim/-/tinytim-0.1.1.tgz",
|
|
@@ -156,15 +129,6 @@
|
|
|
156
129
|
"engines": {
|
|
157
130
|
"node": ">= 0.10.0"
|
|
158
131
|
}
|
|
159
|
-
},
|
|
160
|
-
"node_modules/url-parse": {
|
|
161
|
-
"version": "1.5.10",
|
|
162
|
-
"resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz",
|
|
163
|
-
"integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==",
|
|
164
|
-
"dependencies": {
|
|
165
|
-
"querystringify": "^2.1.1",
|
|
166
|
-
"requires-port": "^1.0.0"
|
|
167
|
-
}
|
|
168
132
|
}
|
|
169
133
|
}
|
|
170
134
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Microsoft Corporation.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Installation
|
|
2
|
+
> `npm install --save @types/body-parser`
|
|
3
|
+
|
|
4
|
+
# Summary
|
|
5
|
+
This package contains type definitions for body-parser (https://github.com/expressjs/body-parser).
|
|
6
|
+
|
|
7
|
+
# Details
|
|
8
|
+
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/body-parser.
|
|
9
|
+
|
|
10
|
+
### Additional Details
|
|
11
|
+
* Last updated: Tue, 16 Nov 2021 18:31:30 GMT
|
|
12
|
+
* Dependencies: [@types/connect](https://npmjs.com/package/@types/connect), [@types/node](https://npmjs.com/package/@types/node)
|
|
13
|
+
* Global values: none
|
|
14
|
+
|
|
15
|
+
# Credits
|
|
16
|
+
These definitions were written by [Santi Albo](https://github.com/santialbo), [Vilic Vane](https://github.com/vilic), [Jonathan Häberle](https://github.com/dreampulse), [Gevik Babakhani](https://github.com/blendsdk), [Tomasz Łaziuk](https://github.com/tlaziuk), [Jason Walton](https://github.com/jwalton), and [Piotr Błażejewicz](https://github.com/peterblazejewicz).
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
// Type definitions for body-parser 1.19
|
|
2
|
+
// Project: https://github.com/expressjs/body-parser
|
|
3
|
+
// Definitions by: Santi Albo <https://github.com/santialbo>
|
|
4
|
+
// Vilic Vane <https://github.com/vilic>
|
|
5
|
+
// Jonathan Häberle <https://github.com/dreampulse>
|
|
6
|
+
// Gevik Babakhani <https://github.com/blendsdk>
|
|
7
|
+
// Tomasz Łaziuk <https://github.com/tlaziuk>
|
|
8
|
+
// Jason Walton <https://github.com/jwalton>
|
|
9
|
+
// Piotr Błażejewicz <https://github.com/peterblazejewicz>
|
|
10
|
+
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
11
|
+
|
|
12
|
+
/// <reference types="node" />
|
|
13
|
+
|
|
14
|
+
import { NextHandleFunction } from 'connect';
|
|
15
|
+
import * as http from 'http';
|
|
16
|
+
|
|
17
|
+
// for docs go to https://github.com/expressjs/body-parser/tree/1.19.0#body-parser
|
|
18
|
+
|
|
19
|
+
declare namespace bodyParser {
|
|
20
|
+
interface BodyParser {
|
|
21
|
+
/**
|
|
22
|
+
* @deprecated use individual json/urlencoded middlewares
|
|
23
|
+
*/
|
|
24
|
+
(options?: OptionsJson & OptionsText & OptionsUrlencoded): NextHandleFunction;
|
|
25
|
+
/**
|
|
26
|
+
* Returns middleware that only parses json and only looks at requests
|
|
27
|
+
* where the Content-Type header matches the type option.
|
|
28
|
+
*/
|
|
29
|
+
json(options?: OptionsJson): NextHandleFunction;
|
|
30
|
+
/**
|
|
31
|
+
* Returns middleware that parses all bodies as a Buffer and only looks at requests
|
|
32
|
+
* where the Content-Type header matches the type option.
|
|
33
|
+
*/
|
|
34
|
+
raw(options?: Options): NextHandleFunction;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Returns middleware that parses all bodies as a string and only looks at requests
|
|
38
|
+
* where the Content-Type header matches the type option.
|
|
39
|
+
*/
|
|
40
|
+
text(options?: OptionsText): NextHandleFunction;
|
|
41
|
+
/**
|
|
42
|
+
* Returns middleware that only parses urlencoded bodies and only looks at requests
|
|
43
|
+
* where the Content-Type header matches the type option
|
|
44
|
+
*/
|
|
45
|
+
urlencoded(options?: OptionsUrlencoded): NextHandleFunction;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
interface Options {
|
|
49
|
+
/** When set to true, then deflated (compressed) bodies will be inflated; when false, deflated bodies are rejected. Defaults to true. */
|
|
50
|
+
inflate?: boolean | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* Controls the maximum request body size. If this is a number,
|
|
53
|
+
* then the value specifies the number of bytes; if it is a string,
|
|
54
|
+
* the value is passed to the bytes library for parsing. Defaults to '100kb'.
|
|
55
|
+
*/
|
|
56
|
+
limit?: number | string | undefined;
|
|
57
|
+
/**
|
|
58
|
+
* The type option is used to determine what media type the middleware will parse
|
|
59
|
+
*/
|
|
60
|
+
type?: string | string[] | ((req: http.IncomingMessage) => any) | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* The verify option, if supplied, is called as verify(req, res, buf, encoding),
|
|
63
|
+
* where buf is a Buffer of the raw request body and encoding is the encoding of the request.
|
|
64
|
+
*/
|
|
65
|
+
verify?(req: http.IncomingMessage, res: http.ServerResponse, buf: Buffer, encoding: string): void;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
interface OptionsJson extends Options {
|
|
69
|
+
/**
|
|
70
|
+
*
|
|
71
|
+
* The reviver option is passed directly to JSON.parse as the second argument.
|
|
72
|
+
*/
|
|
73
|
+
reviver?(key: string, value: any): any;
|
|
74
|
+
/**
|
|
75
|
+
* When set to `true`, will only accept arrays and objects;
|
|
76
|
+
* when `false` will accept anything JSON.parse accepts. Defaults to `true`.
|
|
77
|
+
*/
|
|
78
|
+
strict?: boolean | undefined;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
interface OptionsText extends Options {
|
|
82
|
+
/**
|
|
83
|
+
* Specify the default character set for the text content if the charset
|
|
84
|
+
* is not specified in the Content-Type header of the request.
|
|
85
|
+
* Defaults to `utf-8`.
|
|
86
|
+
*/
|
|
87
|
+
defaultCharset?: string | undefined;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
interface OptionsUrlencoded extends Options {
|
|
91
|
+
/**
|
|
92
|
+
* The extended option allows to choose between parsing the URL-encoded data
|
|
93
|
+
* with the querystring library (when `false`) or the qs library (when `true`).
|
|
94
|
+
*/
|
|
95
|
+
extended?: boolean | undefined;
|
|
96
|
+
/**
|
|
97
|
+
* The parameterLimit option controls the maximum number of parameters
|
|
98
|
+
* that are allowed in the URL-encoded data. If a request contains more parameters than this value,
|
|
99
|
+
* a 413 will be returned to the client. Defaults to 1000.
|
|
100
|
+
*/
|
|
101
|
+
parameterLimit?: number | undefined;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
declare const bodyParser: bodyParser.BodyParser;
|
|
106
|
+
|
|
107
|
+
export = bodyParser;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@types/body-parser",
|
|
3
|
+
"version": "1.19.2",
|
|
4
|
+
"description": "TypeScript definitions for body-parser",
|
|
5
|
+
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/body-parser",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"contributors": [
|
|
8
|
+
{
|
|
9
|
+
"name": "Santi Albo",
|
|
10
|
+
"url": "https://github.com/santialbo",
|
|
11
|
+
"githubUsername": "santialbo"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"name": "Vilic Vane",
|
|
15
|
+
"url": "https://github.com/vilic",
|
|
16
|
+
"githubUsername": "vilic"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"name": "Jonathan Häberle",
|
|
20
|
+
"url": "https://github.com/dreampulse",
|
|
21
|
+
"githubUsername": "dreampulse"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"name": "Gevik Babakhani",
|
|
25
|
+
"url": "https://github.com/blendsdk",
|
|
26
|
+
"githubUsername": "blendsdk"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"name": "Tomasz Łaziuk",
|
|
30
|
+
"url": "https://github.com/tlaziuk",
|
|
31
|
+
"githubUsername": "tlaziuk"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"name": "Jason Walton",
|
|
35
|
+
"url": "https://github.com/jwalton",
|
|
36
|
+
"githubUsername": "jwalton"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "Piotr Błażejewicz",
|
|
40
|
+
"url": "https://github.com/peterblazejewicz",
|
|
41
|
+
"githubUsername": "peterblazejewicz"
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
"main": "",
|
|
45
|
+
"types": "index.d.ts",
|
|
46
|
+
"repository": {
|
|
47
|
+
"type": "git",
|
|
48
|
+
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
|
49
|
+
"directory": "types/body-parser"
|
|
50
|
+
},
|
|
51
|
+
"scripts": {},
|
|
52
|
+
"dependencies": {
|
|
53
|
+
"@types/connect": "*",
|
|
54
|
+
"@types/node": "*"
|
|
55
|
+
},
|
|
56
|
+
"typesPublisherContentHash": "ad069aa8b9e8a95f66df025de11975c773540e4071000abdb7db565579b013ee",
|
|
57
|
+
"typeScriptVersion": "3.7"
|
|
58
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Microsoft Corporation.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Installation
|
|
2
|
+
> `npm install --save @types/connect`
|
|
3
|
+
|
|
4
|
+
# Summary
|
|
5
|
+
This package contains type definitions for connect (https://github.com/senchalabs/connect).
|
|
6
|
+
|
|
7
|
+
# Details
|
|
8
|
+
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/connect.
|
|
9
|
+
|
|
10
|
+
### Additional Details
|
|
11
|
+
* Last updated: Tue, 06 Jul 2021 20:32:28 GMT
|
|
12
|
+
* Dependencies: [@types/node](https://npmjs.com/package/@types/node)
|
|
13
|
+
* Global values: none
|
|
14
|
+
|
|
15
|
+
# Credits
|
|
16
|
+
These definitions were written by [Maxime LUCE](https://github.com/SomaticIT), and [Evan Hahn](https://github.com/EvanHahn).
|