@innet/server 2.0.0-beta.7 → 2.0.0-beta.8

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.
Files changed (283) hide show
  1. package/hooks/useNewSchema/useNewSchema.es6.js +0 -1
  2. package/hooks/useNewSchema/useNewSchema.js +0 -1
  3. package/index.es6.js +1 -0
  4. package/index.js +2 -0
  5. package/package.json +2 -3
  6. package/plugins/main/endpoint/endpoint.es6.js +0 -2
  7. package/plugins/main/endpoint/endpoint.js +0 -2
  8. package/plugins/main/host/host.es6.js +0 -1
  9. package/plugins/main/host/host.js +0 -1
  10. package/plugins/main/tag/tag.es6.js +0 -1
  11. package/plugins/main/tag/tag.js +0 -1
  12. package/plugins/main/variable/variable.es6.js +1 -4
  13. package/plugins/main/variable/variable.js +1 -4
  14. package/plugins/request/redirect/redirect.es6.js +0 -1
  15. package/plugins/request/redirect/redirect.js +0 -1
  16. package/plugins/schema/date/date.es6.js +0 -6
  17. package/plugins/schema/date/date.js +0 -6
  18. package/plugins/schema/field/field.es6.js +2 -1
  19. package/plugins/schema/field/field.js +2 -1
  20. package/plugins/schema/object/object.es6.js +4 -2
  21. package/plugins/schema/object/object.js +4 -2
  22. package/plugins/schema/tuple/tuple.es6.js +0 -1
  23. package/plugins/schema/tuple/tuple.js +0 -1
  24. package/plugins/schema/uuid/uuid.es6.js +0 -2
  25. package/plugins/schema/uuid/uuid.js +0 -2
  26. package/plugins/utils/swagger/swagger.es6.js +0 -1
  27. package/plugins/utils/swagger/swagger.js +0 -1
  28. package/utils/decorators/once/once.es6.js +0 -4
  29. package/utils/decorators/once/once.js +0 -4
  30. package/utils/generateTypes/generateTypes.es6.js +0 -1
  31. package/utils/generateTypes/generateTypes.js +0 -1
  32. package/utils/getSafeSchema/getSafeSchema.es6.js +5 -0
  33. package/utils/getSafeSchema/getSafeSchema.js +9 -0
  34. package/utils/getSafeSchema/index.es6.js +1 -0
  35. package/utils/getSafeSchema/index.js +9 -0
  36. package/utils/index.es6.js +1 -0
  37. package/utils/index.js +1 -0
  38. package/constants.d.ts +0 -4
  39. package/handler/handler.d.ts +0 -106
  40. package/handler/index.d.ts +0 -1
  41. package/hooks/index.d.ts +0 -33
  42. package/hooks/useAction/index.d.ts +0 -1
  43. package/hooks/useAction/useAction.d.ts +0 -4
  44. package/hooks/useApi/index.d.ts +0 -1
  45. package/hooks/useApi/useApi.d.ts +0 -11
  46. package/hooks/useBlock/index.d.ts +0 -1
  47. package/hooks/useBlock/useBlock.d.ts +0 -2
  48. package/hooks/useBody/index.d.ts +0 -1
  49. package/hooks/useBody/useBody.d.ts +0 -1
  50. package/hooks/useBodyFile/index.d.ts +0 -1
  51. package/hooks/useBodyFile/useBodyFile.d.ts +0 -3
  52. package/hooks/useClientIp/index.d.ts +0 -1
  53. package/hooks/useClientIp/useClientIp.d.ts +0 -1
  54. package/hooks/useComponentName/index.d.ts +0 -1
  55. package/hooks/useComponentName/useComponentName.d.ts +0 -1
  56. package/hooks/useCookies/index.d.ts +0 -1
  57. package/hooks/useCookies/useCookies.d.ts +0 -1
  58. package/hooks/useEffect/index.d.ts +0 -1
  59. package/hooks/useEffect/useEffect.d.ts +0 -2
  60. package/hooks/useEndpoint/index.d.ts +0 -1
  61. package/hooks/useEndpoint/useEndpoint.d.ts +0 -10
  62. package/hooks/useHeaders/index.d.ts +0 -1
  63. package/hooks/useHeaders/useHeaders.d.ts +0 -2
  64. package/hooks/useHost/index.d.ts +0 -1
  65. package/hooks/useHost/useHost.d.ts +0 -7
  66. package/hooks/useIsServerHttps/index.d.ts +0 -1
  67. package/hooks/useIsServerHttps/useIsServerHttps.d.ts +0 -3
  68. package/hooks/useNewSchema/index.d.ts +0 -1
  69. package/hooks/useNewSchema/useNewSchema.d.ts +0 -2
  70. package/hooks/useObjectRule/index.d.ts +0 -1
  71. package/hooks/useObjectRule/useObjectRule.d.ts +0 -4
  72. package/hooks/useObjectSchemaContext/index.d.ts +0 -1
  73. package/hooks/useObjectSchemaContext/useObjectSchemaContext.d.ts +0 -3
  74. package/hooks/useOneElementError/index.d.ts +0 -1
  75. package/hooks/useOneElementError/useOneElementError.d.ts +0 -1
  76. package/hooks/useParam/index.d.ts +0 -1
  77. package/hooks/useParam/useParam.d.ts +0 -7
  78. package/hooks/useParams/index.d.ts +0 -1
  79. package/hooks/useParams/useParams.d.ts +0 -3
  80. package/hooks/useParentRule/index.d.ts +0 -1
  81. package/hooks/useParentRule/useParentRule.d.ts +0 -4
  82. package/hooks/usePath/index.d.ts +0 -1
  83. package/hooks/usePath/usePath.d.ts +0 -1
  84. package/hooks/useRequest/index.d.ts +0 -1
  85. package/hooks/useRequest/useRequest.d.ts +0 -1
  86. package/hooks/useRequestHandler/index.d.ts +0 -1
  87. package/hooks/useRequestHandler/useRequestHandler.d.ts +0 -4
  88. package/hooks/useResponse/index.d.ts +0 -1
  89. package/hooks/useResponse/useResponse.d.ts +0 -1
  90. package/hooks/useRule/index.d.ts +0 -1
  91. package/hooks/useRule/useRule.d.ts +0 -6
  92. package/hooks/useSchemaContext/index.d.ts +0 -1
  93. package/hooks/useSchemaContext/useSchemaContext.d.ts +0 -5
  94. package/hooks/useSchemaType/index.d.ts +0 -1
  95. package/hooks/useSchemaType/useSchemaType.d.ts +0 -5
  96. package/hooks/useSearch/index.d.ts +0 -1
  97. package/hooks/useSearch/useSearch.d.ts +0 -1
  98. package/hooks/useServer/index.d.ts +0 -1
  99. package/hooks/useServer/useServer.d.ts +0 -10
  100. package/hooks/useServerPlugin/index.d.ts +0 -1
  101. package/hooks/useServerPlugin/useServerPlugin.d.ts +0 -2
  102. package/hooks/useServerPlugins/index.d.ts +0 -1
  103. package/hooks/useServerPlugins/useServerPlugins.d.ts +0 -4
  104. package/hooks/useServerPort/index.d.ts +0 -1
  105. package/hooks/useServerPort/useServerPort.d.ts +0 -3
  106. package/hooks/useTag/index.d.ts +0 -1
  107. package/hooks/useTag/useTag.d.ts +0 -3
  108. package/hooks/useThrow/index.d.ts +0 -1
  109. package/hooks/useThrow/useThrow.d.ts +0 -1
  110. package/index.d.ts +0 -6
  111. package/plugins/handler/index.d.ts +0 -1
  112. package/plugins/handler/serverFn/index.d.ts +0 -1
  113. package/plugins/handler/serverFn/serverFn.d.ts +0 -2
  114. package/plugins/index.d.ts +0 -5
  115. package/plugins/main/api/api.d.ts +0 -25
  116. package/plugins/main/api/index.d.ts +0 -1
  117. package/plugins/main/body/body.d.ts +0 -5
  118. package/plugins/main/body/index.d.ts +0 -1
  119. package/plugins/main/contact/contact.d.ts +0 -10
  120. package/plugins/main/contact/index.d.ts +0 -1
  121. package/plugins/main/endpoint/endpoint.d.ts +0 -43
  122. package/plugins/main/endpoint/index.d.ts +0 -1
  123. package/plugins/main/host/host.d.ts +0 -16
  124. package/plugins/main/host/index.d.ts +0 -1
  125. package/plugins/main/index.d.ts +0 -13
  126. package/plugins/main/license/index.d.ts +0 -1
  127. package/plugins/main/license/license.d.ts +0 -21
  128. package/plugins/main/param/index.d.ts +0 -1
  129. package/plugins/main/param/param.d.ts +0 -36
  130. package/plugins/main/preset/index.d.ts +0 -1
  131. package/plugins/main/preset/preset.d.ts +0 -3
  132. package/plugins/main/response/index.d.ts +0 -1
  133. package/plugins/main/response/response.d.ts +0 -21
  134. package/plugins/main/return/index.d.ts +0 -1
  135. package/plugins/main/return/return.d.ts +0 -4
  136. package/plugins/main/server/index.d.ts +0 -1
  137. package/plugins/main/server/server.d.ts +0 -13
  138. package/plugins/main/tag/index.d.ts +0 -1
  139. package/plugins/main/tag/tag.d.ts +0 -19
  140. package/plugins/main/variable/index.d.ts +0 -1
  141. package/plugins/main/variable/variable.d.ts +0 -24
  142. package/plugins/request/cms/cms.d.ts +0 -6
  143. package/plugins/request/cms/index.d.ts +0 -1
  144. package/plugins/request/cookie/cookie.d.ts +0 -7
  145. package/plugins/request/cookie/index.d.ts +0 -1
  146. package/plugins/request/error/error.d.ts +0 -61
  147. package/plugins/request/error/index.d.ts +0 -1
  148. package/plugins/request/file/file.d.ts +0 -5
  149. package/plugins/request/file/index.d.ts +0 -1
  150. package/plugins/request/header/header.d.ts +0 -6
  151. package/plugins/request/header/index.d.ts +0 -1
  152. package/plugins/request/index.d.ts +0 -8
  153. package/plugins/request/proxy/index.d.ts +0 -1
  154. package/plugins/request/proxy/proxy.d.ts +0 -8
  155. package/plugins/request/redirect/index.d.ts +0 -1
  156. package/plugins/request/redirect/redirect.d.ts +0 -18
  157. package/plugins/request/success/index.d.ts +0 -1
  158. package/plugins/request/success/success.d.ts +0 -19
  159. package/plugins/schema/any/any.d.ts +0 -5
  160. package/plugins/schema/any/index.d.ts +0 -1
  161. package/plugins/schema/array/array.d.ts +0 -9
  162. package/plugins/schema/array/index.d.ts +0 -1
  163. package/plugins/schema/binary/binary.d.ts +0 -9
  164. package/plugins/schema/binary/index.d.ts +0 -1
  165. package/plugins/schema/boolean/boolean.d.ts +0 -5
  166. package/plugins/schema/boolean/index.d.ts +0 -1
  167. package/plugins/schema/date/date.d.ts +0 -8
  168. package/plugins/schema/date/index.d.ts +0 -1
  169. package/plugins/schema/field/field.d.ts +0 -10
  170. package/plugins/schema/field/index.d.ts +0 -1
  171. package/plugins/schema/index.d.ts +0 -13
  172. package/plugins/schema/integer/index.d.ts +0 -1
  173. package/plugins/schema/integer/integer.d.ts +0 -45
  174. package/plugins/schema/null/index.d.ts +0 -1
  175. package/plugins/schema/null/null.d.ts +0 -5
  176. package/plugins/schema/number/index.d.ts +0 -1
  177. package/plugins/schema/number/number.d.ts +0 -41
  178. package/plugins/schema/object/index.d.ts +0 -1
  179. package/plugins/schema/object/object.d.ts +0 -6
  180. package/plugins/schema/string/index.d.ts +0 -1
  181. package/plugins/schema/string/string.d.ts +0 -36
  182. package/plugins/schema/tuple/index.d.ts +0 -1
  183. package/plugins/schema/tuple/tuple.d.ts +0 -6
  184. package/plugins/schema/uuid/index.d.ts +0 -1
  185. package/plugins/schema/uuid/uuid.d.ts +0 -6
  186. package/plugins/utils/blacklist/blacklist.d.ts +0 -5
  187. package/plugins/utils/blacklist/index.d.ts +0 -1
  188. package/plugins/utils/dts/dts.d.ts +0 -6
  189. package/plugins/utils/dts/index.d.ts +0 -1
  190. package/plugins/utils/env/env.d.ts +0 -7
  191. package/plugins/utils/env/index.d.ts +0 -1
  192. package/plugins/utils/index.d.ts +0 -7
  193. package/plugins/utils/protection/index.d.ts +0 -1
  194. package/plugins/utils/protection/protection.d.ts +0 -9
  195. package/plugins/utils/swagger/index.d.ts +0 -1
  196. package/plugins/utils/swagger/swagger.d.ts +0 -6
  197. package/plugins/utils/ui/index.d.ts +0 -1
  198. package/plugins/utils/ui/ui.d.ts +0 -13
  199. package/plugins/utils/whitelist/index.d.ts +0 -1
  200. package/plugins/utils/whitelist/whitelist.d.ts +0 -5
  201. package/types.d.ts +0 -69
  202. package/utils/FileData/Bin.d.ts +0 -47
  203. package/utils/FileData/index.d.ts +0 -1
  204. package/utils/JSONString/JSONString.d.ts +0 -1
  205. package/utils/JSONString/index.d.ts +0 -1
  206. package/utils/action/Action.d.ts +0 -31
  207. package/utils/action/index.d.ts +0 -1
  208. package/utils/dateFormat/dateFormat.d.ts +0 -2
  209. package/utils/dateFormat/index.d.ts +0 -1
  210. package/utils/decorators/index.d.ts +0 -1
  211. package/utils/decorators/once/index.d.ts +0 -1
  212. package/utils/decorators/once/once.d.ts +0 -4
  213. package/utils/generateTypes/generateTypes.d.ts +0 -3
  214. package/utils/generateTypes/index.d.ts +0 -1
  215. package/utils/getEndpoint/getEndpoint.d.ts +0 -2
  216. package/utils/getEndpoint/index.d.ts +0 -1
  217. package/utils/getOrAdd/getOrAdd.d.ts +0 -1
  218. package/utils/getOrAdd/index.d.ts +0 -1
  219. package/utils/httpOnStart/httpOnStart.d.ts +0 -2
  220. package/utils/httpOnStart/index.d.ts +0 -1
  221. package/utils/index.d.ts +0 -13
  222. package/utils/parseBody/index.d.ts +0 -1
  223. package/utils/parseBody/parseBody.d.ts +0 -2
  224. package/utils/parseFormBody/index.d.ts +0 -1
  225. package/utils/parseFormBody/parseFormBody.d.ts +0 -2
  226. package/utils/parseSearch/index.d.ts +0 -1
  227. package/utils/parseSearch/parseSearch.d.ts +0 -3
  228. package/utils/rules/arrayOf/arrayOf.d.ts +0 -2
  229. package/utils/rules/arrayOf/index.d.ts +0 -1
  230. package/utils/rules/bin/bin.d.ts +0 -2
  231. package/utils/rules/bin/index.d.ts +0 -1
  232. package/utils/rules/binaryAccept/binaryAccept.d.ts +0 -2
  233. package/utils/rules/binaryAccept/index.d.ts +0 -1
  234. package/utils/rules/constants.d.ts +0 -1
  235. package/utils/rules/dateTo/dateTo.d.ts +0 -2
  236. package/utils/rules/dateTo/index.d.ts +0 -1
  237. package/utils/rules/defaultTo/defaultTo.d.ts +0 -1
  238. package/utils/rules/defaultTo/index.d.ts +0 -1
  239. package/utils/rules/helpers.d.ts +0 -8
  240. package/utils/rules/index.d.ts +0 -28
  241. package/utils/rules/int/index.d.ts +0 -1
  242. package/utils/rules/int/int.d.ts +0 -2
  243. package/utils/rules/max/index.d.ts +0 -1
  244. package/utils/rules/max/max.d.ts +0 -1
  245. package/utils/rules/maxBin/index.d.ts +0 -1
  246. package/utils/rules/maxBin/maxBin.d.ts +0 -2
  247. package/utils/rules/maxDate/index.d.ts +0 -1
  248. package/utils/rules/maxDate/maxDate.d.ts +0 -1
  249. package/utils/rules/maxLength/index.d.ts +0 -1
  250. package/utils/rules/maxLength/maxLength.d.ts +0 -1
  251. package/utils/rules/min/index.d.ts +0 -1
  252. package/utils/rules/min/min.d.ts +0 -1
  253. package/utils/rules/minBin/index.d.ts +0 -1
  254. package/utils/rules/minBin/minBin.d.ts +0 -2
  255. package/utils/rules/minDate/index.d.ts +0 -1
  256. package/utils/rules/minDate/minDate.d.ts +0 -1
  257. package/utils/rules/minLength/index.d.ts +0 -1
  258. package/utils/rules/minLength/minLength.d.ts +0 -1
  259. package/utils/rules/nullable/index.d.ts +0 -1
  260. package/utils/rules/nullable/nullable.d.ts +0 -1
  261. package/utils/rules/num/index.d.ts +0 -1
  262. package/utils/rules/num/num.d.ts +0 -1
  263. package/utils/rules/objectOf/index.d.ts +0 -1
  264. package/utils/rules/objectOf/objectOf.d.ts +0 -3
  265. package/utils/rules/oneOf/index.d.ts +0 -1
  266. package/utils/rules/oneOf/oneOf.d.ts +0 -2
  267. package/utils/rules/optional/index.d.ts +0 -1
  268. package/utils/rules/optional/optional.d.ts +0 -2
  269. package/utils/rules/pattern/index.d.ts +0 -1
  270. package/utils/rules/pattern/pattern.d.ts +0 -1
  271. package/utils/rules/pipe/index.d.ts +0 -1
  272. package/utils/rules/pipe/pipe.d.ts +0 -2
  273. package/utils/rules/required/index.d.ts +0 -1
  274. package/utils/rules/required/required.d.ts +0 -2
  275. package/utils/rules/tupleOf/index.d.ts +0 -1
  276. package/utils/rules/tupleOf/tupleOf.d.ts +0 -2
  277. package/utils/rules/types.d.ts +0 -4
  278. package/utils/rules/uuidTo/index.d.ts +0 -1
  279. package/utils/rules/uuidTo/uuidTo.d.ts +0 -1
  280. package/utils/rules/values/index.d.ts +0 -1
  281. package/utils/rules/values/values.d.ts +0 -1
  282. package/utils/stringifySearch/index.d.ts +0 -1
  283. package/utils/stringifySearch/stringifySearch.d.ts +0 -2
package/types.d.ts DELETED
@@ -1,69 +0,0 @@
1
- import type { OpenAPIV3_1 as API } from 'openapi-types';
2
- import type { ApiErrorValue } from './constants';
3
- import { type ServerPlugin } from './hooks';
4
- import { type Rule, type RulesErrors } from './utils/rules';
5
- export type TagObject = API.TagObject;
6
- export type Document = API.Document;
7
- export type ServerObject = API.ServerObject;
8
- export type OperationObject = API.OperationObject;
9
- export type ResponseObject = API.ResponseObject;
10
- export type SchemaObject = API.SchemaObject;
11
- export type ArraySchemaObjectType = API.ArraySchemaObjectType;
12
- export type NonArraySchemaObjectType = API.NonArraySchemaObjectType;
13
- export type ArraySchemaObject = API.ArraySchemaObject;
14
- export type ReferenceObject = API.ReferenceObject;
15
- export type ParameterObject = API.ParameterObject;
16
- export type RequestBodyObject = API.RequestBodyObject;
17
- export type ObjectType = ArraySchemaObjectType | NonArraySchemaObjectType;
18
- export type RefSchemaObject = ReferenceObject | SchemaObject;
19
- export type Effect = () => void;
20
- export interface IValidationErrorData extends Record<string, any> {
21
- error: RulesErrors;
22
- }
23
- export type ValidationErrorData = IValidationErrorData | undefined;
24
- export interface EndpointRules {
25
- body?: Rule;
26
- cookie?: Rule;
27
- header?: Rule;
28
- path?: Rule;
29
- response?: Rule;
30
- search?: Rule;
31
- }
32
- export interface EndpointRulesMaps {
33
- cookie?: Record<string, Rule>;
34
- header?: Record<string, Rule>;
35
- path?: Record<string, Rule>;
36
- search?: Record<string, Rule>;
37
- }
38
- export interface Endpoint<I = unknown, O = unknown, E extends ApiErrorValue = ApiErrorValue, P extends InValidationErrorParam = InValidationErrorParam, D extends ValidationErrorData = ValidationErrorData> {
39
- dynamic?: Endpoint<I, O, E, P, D>[];
40
- key: string;
41
- plugins: Set<ServerPlugin>;
42
- rules?: EndpointRules;
43
- rulesMaps?: EndpointRulesMaps;
44
- static?: Record<string, Endpoint<I, O, E, P, D>>;
45
- }
46
- export type IntegerFormats = 'int32' | 'int64';
47
- export type EndpointsMethods = 'delete' | 'get' | 'head' | 'options' | 'patch' | 'post' | 'put' | 'trace';
48
- export type InParam = 'cookie' | 'header' | 'path' | 'query';
49
- export type InValidationErrorParam = 'body' | InParam;
50
- export type BodyType = 'application/json' | 'application/x-www-form-urlencoded' | 'multipart/form-data';
51
- export type Endpoints<I = unknown, O = unknown, E extends ApiErrorValue = ApiErrorValue, P extends InValidationErrorParam = InValidationErrorParam, D extends ValidationErrorData = ValidationErrorData> = Partial<Record<EndpointsMethods, Endpoint<I, O, E, P, D>>>;
52
- export interface SSL {
53
- cert: string;
54
- key: string;
55
- }
56
- export interface ServerStartParams {
57
- https: boolean;
58
- port: number;
59
- }
60
- export interface BaseSchemaProps<T> {
61
- default?: T;
62
- description?: string;
63
- example?: T;
64
- examples?: T[];
65
- ref?: string;
66
- }
67
- export interface ValuesSchemaProps<T> extends BaseSchemaProps<T> {
68
- values?: T[];
69
- }
@@ -1,47 +0,0 @@
1
- export interface BinOptions {
2
- disposition: string;
3
- /**
4
- * A field name of FormData request
5
- */
6
- fieldName: string;
7
- /**
8
- * Full origin file name
9
- */
10
- originalFilename: string;
11
- /**
12
- * Full path to the file on server, you MUST use it only on server side for the safe
13
- */
14
- path: string;
15
- /**
16
- * The file size
17
- */
18
- size: number;
19
- /**
20
- * MIME-type of the file
21
- */
22
- type: string;
23
- }
24
- export declare class Bin implements BinOptions {
25
- disposition: string;
26
- /**
27
- * The extension of the origin file from originalFilename
28
- */
29
- extension?: string;
30
- fieldName: string;
31
- /**
32
- * A file name, without extension
33
- */
34
- filename: string;
35
- originalFilename: string;
36
- path: string;
37
- size: number;
38
- type: string;
39
- constructor(options: BinOptions);
40
- toJSON(): {
41
- $: string;
42
- disposition: string;
43
- originalFilename: string;
44
- size: number;
45
- type: string;
46
- };
47
- }
@@ -1 +0,0 @@
1
- export * from './Bin';
@@ -1 +0,0 @@
1
- export declare function JSONString(target: any): string;
@@ -1 +0,0 @@
1
- export * from './JSONString';
@@ -1,31 +0,0 @@
1
- import { type Cookies, type SerializeOptions } from 'cookie';
2
- import { type IncomingHttpHeaders, type IncomingMessage, type ServerResponse } from 'http';
3
- import { type ParsedQs } from 'qs';
4
- import { type BodyType } from '../../types';
5
- export declare const URL_PARSER: RegExp;
6
- export interface ParsedUrl {
7
- path: string;
8
- search?: string;
9
- }
10
- export declare class Action {
11
- #private;
12
- readonly req: IncomingMessage;
13
- readonly res: ServerResponse;
14
- body?: object;
15
- constructor(req: IncomingMessage, res: ServerResponse);
16
- parseBody(): Promise<void>;
17
- setCookie(name: string, value?: string, options?: SerializeOptions): void;
18
- get bodyType(): BodyType | undefined;
19
- get clientIp(): string | null;
20
- get cookies(): Cookies;
21
- set cookies(value: Record<string, string>);
22
- get headers(): IncomingHttpHeaders;
23
- set headers(value: IncomingHttpHeaders);
24
- get originCookies(): Cookies;
25
- get originHeaders(): IncomingHttpHeaders;
26
- get originSearch(): ParsedQs;
27
- get parsedUrl(): ParsedUrl;
28
- get path(): string;
29
- get search(): ParsedQs;
30
- set search(value: ParsedQs);
31
- }
@@ -1 +0,0 @@
1
- export * from './Action';
@@ -1,2 +0,0 @@
1
- export type DateFormat = 'now' | Date | number | string;
2
- export declare function dateFormat(date?: DateFormat): Date | undefined;
@@ -1 +0,0 @@
1
- export * from './dateFormat';
@@ -1 +0,0 @@
1
- export * from './once';
@@ -1 +0,0 @@
1
- export * from './once';
@@ -1,4 +0,0 @@
1
- export declare function once<This, Args extends any[], Result = unknown>(target: (this: This, ...args: Args) => Result, context: ClassMethodDecoratorContext<This, (this: This, ...args: Args) => Result>): any;
2
- export declare function once<This, Args extends any[]>(target: (this: This, value: Args[0]) => void, context: ClassSetterDecoratorContext<This, Args[0]>): any;
3
- export declare function once<This, Value>(value: () => Value, context: ClassGetterDecoratorContext<This, Value>): any;
4
- export declare function once<This, Args extends any[], Result = unknown>(target: undefined, context: ClassFieldDecoratorContext<This, (...args: Args) => Result>): any;
@@ -1,3 +0,0 @@
1
- import { type Document, type SchemaObject } from '../../types';
2
- export declare function generateSchemaTypes(schema: SchemaObject, spaces?: number, lastChar?: string): string;
3
- export declare function generateTypes(docs: Document, namespace?: string): string;
@@ -1 +0,0 @@
1
- export * from './generateTypes';
@@ -1,2 +0,0 @@
1
- import { type Endpoint } from '../../types';
2
- export declare function getEndpoint(path: string, parentEndpoint: Endpoint): Endpoint<unknown, unknown, "requestValidation" | "requestBodyContentType", import("../../types").InValidationErrorParam, import("../../types").ValidationErrorData> | undefined;
@@ -1 +0,0 @@
1
- export * from './getEndpoint';
@@ -1 +0,0 @@
1
- export declare function getOrAdd<R = any>(target: object, path: number | string, defaultValues: any[]): R;
@@ -1 +0,0 @@
1
- export * from './getOrAdd';
@@ -1,2 +0,0 @@
1
- import { type ServerStartParams } from '../../types';
2
- export declare function httpOnStart({ https, port, }: ServerStartParams): void;
@@ -1 +0,0 @@
1
- export * from './httpOnStart';
package/utils/index.d.ts DELETED
@@ -1,13 +0,0 @@
1
- export * from './FileData';
2
- export * from './JSONString';
3
- export * from './action';
4
- export * from './decorators';
5
- export * from './generateTypes';
6
- export * from './getEndpoint';
7
- export * from './getOrAdd';
8
- export * from './httpOnStart';
9
- export * from './parseBody';
10
- export * from './parseFormBody';
11
- export * from './parseSearch';
12
- export * from './rules';
13
- export * from './stringifySearch';
@@ -1 +0,0 @@
1
- export * from './parseBody';
@@ -1,2 +0,0 @@
1
- import type http from 'http';
2
- export declare function parseBody(req: http.IncomingMessage): Promise<string>;
@@ -1 +0,0 @@
1
- export * from './parseFormBody';
@@ -1,2 +0,0 @@
1
- import type http from 'http';
2
- export declare function parseFormBody(req: http.IncomingMessage): Promise<object>;
@@ -1 +0,0 @@
1
- export * from './parseSearch';
@@ -1,3 +0,0 @@
1
- import { type IParseOptions, type ParsedQs } from 'qs';
2
- export declare const EMPTY_SEARCH: {};
3
- export declare function parseSearch<V extends ParsedQs>(search?: string, options?: IParseOptions): V;
@@ -1,2 +0,0 @@
1
- import { type Rule } from '../types';
2
- export declare function arrayOf(formatter: Rule): (value: any, data?: object) => any;
@@ -1 +0,0 @@
1
- export * from './arrayOf';
@@ -1,2 +0,0 @@
1
- import { Bin } from '../../FileData';
2
- export declare function bin(value: any, data?: object): Bin;
@@ -1 +0,0 @@
1
- export * from './bin';
@@ -1,2 +0,0 @@
1
- import { type Rule } from '../types';
2
- export declare function binaryAccept(accept: string): Rule;
@@ -1 +0,0 @@
1
- export * from './binaryAccept';
@@ -1 +0,0 @@
1
- export declare const rulesErrors: readonly ["oneOf", "number", "date", "uuid", "integer", "minimum", "boolean", "minDate", "maxDate", "maximum", "minLength", "maxLength", "values", "object", "array", "tuple", "required", "null", "pattern", "string", "binary", "binaryAccept", "minBin", "maxBin"];
@@ -1,2 +0,0 @@
1
- export type DateFormat = 'now' | Date | number | string;
2
- export declare function dateTo(value: any, data?: object): Date;
@@ -1 +0,0 @@
1
- export * from './dateTo';
@@ -1 +0,0 @@
1
- export declare function defaultTo(defaultValue: any): (value: any) => any;
@@ -1 +0,0 @@
1
- export * from './defaultTo';
@@ -1,8 +0,0 @@
1
- import { type RulesErrors } from './types';
2
- export declare class RulesError extends Error {
3
- data: {
4
- error: RulesErrors;
5
- } & object;
6
- constructor(error: RulesErrors, data?: object);
7
- }
8
- export declare function addKey(key: number | string, data?: any): string | number;
@@ -1,28 +0,0 @@
1
- export * from './arrayOf';
2
- export * from './bin';
3
- export * from './binaryAccept';
4
- export * from './constants';
5
- export * from './dateTo';
6
- export * from './defaultTo';
7
- export * from './helpers';
8
- export * from './int';
9
- export * from './max';
10
- export * from './maxBin';
11
- export * from './maxDate';
12
- export * from './maxLength';
13
- export * from './min';
14
- export * from './minBin';
15
- export * from './minDate';
16
- export * from './minLength';
17
- export * from './nullable';
18
- export * from './num';
19
- export * from './objectOf';
20
- export * from './oneOf';
21
- export * from './optional';
22
- export * from './pattern';
23
- export * from './pipe';
24
- export * from './required';
25
- export * from './tupleOf';
26
- export * from './types';
27
- export * from './uuidTo';
28
- export * from './values';
@@ -1 +0,0 @@
1
- export * from './int';
@@ -1,2 +0,0 @@
1
- import { type IntegerFormats } from '../../../types';
2
- export declare function int(format: IntegerFormats): (value: any, data?: object) => number | bigint;
@@ -1 +0,0 @@
1
- export * from './max';
@@ -1 +0,0 @@
1
- export declare function max(max: bigint | number): (value: any, data?: object) => any;
@@ -1 +0,0 @@
1
- export * from './maxBin';
@@ -1,2 +0,0 @@
1
- import { type Rule } from '../types';
2
- export declare function maxBin(max: number): Rule;
@@ -1 +0,0 @@
1
- export * from './maxDate';
@@ -1 +0,0 @@
1
- export declare function maxDate(max: Date): (value: any, data?: object) => Date;
@@ -1 +0,0 @@
1
- export * from './maxLength';
@@ -1 +0,0 @@
1
- export declare function maxLength(max: number): (value: any, data?: object) => string;
@@ -1 +0,0 @@
1
- export * from './min';
@@ -1 +0,0 @@
1
- export declare function min(min: bigint | number): (value: any, data?: object) => any;
@@ -1 +0,0 @@
1
- export * from './minBin';
@@ -1,2 +0,0 @@
1
- import { type Rule } from '../types';
2
- export declare function minBin(min: number): Rule;
@@ -1 +0,0 @@
1
- export * from './minDate';
@@ -1 +0,0 @@
1
- export declare function minDate(min: Date): (value: any, data?: object) => Date;
@@ -1 +0,0 @@
1
- export * from './minLength';
@@ -1 +0,0 @@
1
- export declare function minLength(min: number): (value: any, data?: object) => string;
@@ -1 +0,0 @@
1
- export * from './nullable';
@@ -1 +0,0 @@
1
- export declare function nullable(value: any, data?: object): null;
@@ -1 +0,0 @@
1
- export * from './num';
@@ -1 +0,0 @@
1
- export declare function num(value: any, data?: object): number;
@@ -1 +0,0 @@
1
- export * from './objectOf';
@@ -1,3 +0,0 @@
1
- import { type Rule } from '../types';
2
- export type ObjectOf = Record<string, Rule>;
3
- export declare function objectOf(map: ObjectOf, rest?: Rule): (value: any, data?: Record<string, any>) => any;
@@ -1 +0,0 @@
1
- export * from './oneOf';
@@ -1,2 +0,0 @@
1
- import { type Rule } from '../types';
2
- export declare function oneOf(formatters: Rule[]): (value: any, data?: object) => any;
@@ -1 +0,0 @@
1
- export * from './optional';
@@ -1,2 +0,0 @@
1
- import { type Rule } from '../types';
2
- export declare function optional(rule: Rule): (value: any, data?: object) => any;
@@ -1 +0,0 @@
1
- export * from './pattern';
@@ -1 +0,0 @@
1
- export declare function pattern(pattern: RegExp | string, patternId?: string): (value: any, data?: object) => any;
@@ -1 +0,0 @@
1
- export * from './pipe';
@@ -1,2 +0,0 @@
1
- import { type Rule } from '../types';
2
- export declare function pipe(...rules: Rule[]): Rule;
@@ -1 +0,0 @@
1
- export * from './required';
@@ -1,2 +0,0 @@
1
- import { type Rule } from '../types';
2
- export declare function required(rule?: Rule): (value: any, data?: object) => any;
@@ -1 +0,0 @@
1
- export * from './tupleOf';
@@ -1,2 +0,0 @@
1
- import { type Rule } from '../types';
2
- export declare function tupleOf(rules: Rule[]): (value: any, data?: object) => any[];
@@ -1,4 +0,0 @@
1
- import { type rulesErrors } from './constants';
2
- export type Rule = (value: any, data?: object) => any;
3
- export type SetRule = (rule: Rule) => Rule;
4
- export type RulesErrors = typeof rulesErrors[number];
@@ -1 +0,0 @@
1
- export * from './uuidTo';
@@ -1 +0,0 @@
1
- export declare function uuidTo(value: any, data?: object): any;
@@ -1 +0,0 @@
1
- export * from './values';
@@ -1 +0,0 @@
1
- export declare function values(values: any[]): (value: any, data?: object) => any;
@@ -1 +0,0 @@
1
- export * from './stringifySearch';
@@ -1,2 +0,0 @@
1
- import { type IStringifyOptions, type ParsedQs } from 'qs';
2
- export declare function stringifySearch(search: ParsedQs, options?: IStringifyOptions): string;