@innet/server 2.0.0-beta.6 → 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 (286) hide show
  1. package/README.md +28 -0
  2. package/hooks/useNewSchema/useNewSchema.es6.js +0 -1
  3. package/hooks/useNewSchema/useNewSchema.js +0 -1
  4. package/index.es6.js +2 -1
  5. package/index.js +3 -0
  6. package/package.json +2 -3
  7. package/plugins/main/endpoint/endpoint.es6.js +0 -2
  8. package/plugins/main/endpoint/endpoint.js +0 -2
  9. package/plugins/main/host/host.es6.js +0 -1
  10. package/plugins/main/host/host.js +0 -1
  11. package/plugins/main/tag/index.es6.js +1 -1
  12. package/plugins/main/tag/index.js +1 -0
  13. package/plugins/main/tag/tag.es6.js +18 -2
  14. package/plugins/main/tag/tag.js +18 -1
  15. package/plugins/main/variable/variable.es6.js +1 -4
  16. package/plugins/main/variable/variable.js +1 -4
  17. package/plugins/request/redirect/redirect.es6.js +0 -1
  18. package/plugins/request/redirect/redirect.js +0 -1
  19. package/plugins/schema/date/date.es6.js +0 -6
  20. package/plugins/schema/date/date.js +0 -6
  21. package/plugins/schema/field/field.es6.js +2 -1
  22. package/plugins/schema/field/field.js +2 -1
  23. package/plugins/schema/object/object.es6.js +4 -2
  24. package/plugins/schema/object/object.js +4 -2
  25. package/plugins/schema/tuple/tuple.es6.js +0 -1
  26. package/plugins/schema/tuple/tuple.js +0 -1
  27. package/plugins/schema/uuid/uuid.es6.js +0 -2
  28. package/plugins/schema/uuid/uuid.js +0 -2
  29. package/plugins/utils/swagger/swagger.es6.js +0 -1
  30. package/plugins/utils/swagger/swagger.js +0 -1
  31. package/utils/decorators/once/once.es6.js +0 -4
  32. package/utils/decorators/once/once.js +0 -4
  33. package/utils/generateTypes/generateTypes.es6.js +0 -1
  34. package/utils/generateTypes/generateTypes.js +0 -1
  35. package/utils/getSafeSchema/getSafeSchema.es6.js +5 -0
  36. package/utils/getSafeSchema/getSafeSchema.js +9 -0
  37. package/utils/getSafeSchema/index.es6.js +1 -0
  38. package/utils/getSafeSchema/index.js +9 -0
  39. package/utils/index.es6.js +1 -0
  40. package/utils/index.js +1 -0
  41. package/constants.d.ts +0 -4
  42. package/handler/handler.d.ts +0 -106
  43. package/handler/index.d.ts +0 -1
  44. package/hooks/index.d.ts +0 -33
  45. package/hooks/useAction/index.d.ts +0 -1
  46. package/hooks/useAction/useAction.d.ts +0 -4
  47. package/hooks/useApi/index.d.ts +0 -1
  48. package/hooks/useApi/useApi.d.ts +0 -11
  49. package/hooks/useBlock/index.d.ts +0 -1
  50. package/hooks/useBlock/useBlock.d.ts +0 -2
  51. package/hooks/useBody/index.d.ts +0 -1
  52. package/hooks/useBody/useBody.d.ts +0 -1
  53. package/hooks/useBodyFile/index.d.ts +0 -1
  54. package/hooks/useBodyFile/useBodyFile.d.ts +0 -3
  55. package/hooks/useClientIp/index.d.ts +0 -1
  56. package/hooks/useClientIp/useClientIp.d.ts +0 -1
  57. package/hooks/useComponentName/index.d.ts +0 -1
  58. package/hooks/useComponentName/useComponentName.d.ts +0 -1
  59. package/hooks/useCookies/index.d.ts +0 -1
  60. package/hooks/useCookies/useCookies.d.ts +0 -1
  61. package/hooks/useEffect/index.d.ts +0 -1
  62. package/hooks/useEffect/useEffect.d.ts +0 -2
  63. package/hooks/useEndpoint/index.d.ts +0 -1
  64. package/hooks/useEndpoint/useEndpoint.d.ts +0 -10
  65. package/hooks/useHeaders/index.d.ts +0 -1
  66. package/hooks/useHeaders/useHeaders.d.ts +0 -2
  67. package/hooks/useHost/index.d.ts +0 -1
  68. package/hooks/useHost/useHost.d.ts +0 -7
  69. package/hooks/useIsServerHttps/index.d.ts +0 -1
  70. package/hooks/useIsServerHttps/useIsServerHttps.d.ts +0 -3
  71. package/hooks/useNewSchema/index.d.ts +0 -1
  72. package/hooks/useNewSchema/useNewSchema.d.ts +0 -2
  73. package/hooks/useObjectRule/index.d.ts +0 -1
  74. package/hooks/useObjectRule/useObjectRule.d.ts +0 -4
  75. package/hooks/useObjectSchemaContext/index.d.ts +0 -1
  76. package/hooks/useObjectSchemaContext/useObjectSchemaContext.d.ts +0 -3
  77. package/hooks/useOneElementError/index.d.ts +0 -1
  78. package/hooks/useOneElementError/useOneElementError.d.ts +0 -1
  79. package/hooks/useParam/index.d.ts +0 -1
  80. package/hooks/useParam/useParam.d.ts +0 -7
  81. package/hooks/useParams/index.d.ts +0 -1
  82. package/hooks/useParams/useParams.d.ts +0 -3
  83. package/hooks/useParentRule/index.d.ts +0 -1
  84. package/hooks/useParentRule/useParentRule.d.ts +0 -4
  85. package/hooks/usePath/index.d.ts +0 -1
  86. package/hooks/usePath/usePath.d.ts +0 -1
  87. package/hooks/useRequest/index.d.ts +0 -1
  88. package/hooks/useRequest/useRequest.d.ts +0 -1
  89. package/hooks/useRequestHandler/index.d.ts +0 -1
  90. package/hooks/useRequestHandler/useRequestHandler.d.ts +0 -4
  91. package/hooks/useResponse/index.d.ts +0 -1
  92. package/hooks/useResponse/useResponse.d.ts +0 -1
  93. package/hooks/useRule/index.d.ts +0 -1
  94. package/hooks/useRule/useRule.d.ts +0 -6
  95. package/hooks/useSchemaContext/index.d.ts +0 -1
  96. package/hooks/useSchemaContext/useSchemaContext.d.ts +0 -5
  97. package/hooks/useSchemaType/index.d.ts +0 -1
  98. package/hooks/useSchemaType/useSchemaType.d.ts +0 -5
  99. package/hooks/useSearch/index.d.ts +0 -1
  100. package/hooks/useSearch/useSearch.d.ts +0 -1
  101. package/hooks/useServer/index.d.ts +0 -1
  102. package/hooks/useServer/useServer.d.ts +0 -10
  103. package/hooks/useServerPlugin/index.d.ts +0 -1
  104. package/hooks/useServerPlugin/useServerPlugin.d.ts +0 -2
  105. package/hooks/useServerPlugins/index.d.ts +0 -1
  106. package/hooks/useServerPlugins/useServerPlugins.d.ts +0 -4
  107. package/hooks/useServerPort/index.d.ts +0 -1
  108. package/hooks/useServerPort/useServerPort.d.ts +0 -3
  109. package/hooks/useTag/index.d.ts +0 -1
  110. package/hooks/useTag/useTag.d.ts +0 -3
  111. package/hooks/useThrow/index.d.ts +0 -1
  112. package/hooks/useThrow/useThrow.d.ts +0 -1
  113. package/index.d.ts +0 -6
  114. package/plugins/handler/index.d.ts +0 -1
  115. package/plugins/handler/serverFn/index.d.ts +0 -1
  116. package/plugins/handler/serverFn/serverFn.d.ts +0 -2
  117. package/plugins/index.d.ts +0 -5
  118. package/plugins/main/api/api.d.ts +0 -25
  119. package/plugins/main/api/index.d.ts +0 -1
  120. package/plugins/main/body/body.d.ts +0 -5
  121. package/plugins/main/body/index.d.ts +0 -1
  122. package/plugins/main/contact/contact.d.ts +0 -10
  123. package/plugins/main/contact/index.d.ts +0 -1
  124. package/plugins/main/endpoint/endpoint.d.ts +0 -43
  125. package/plugins/main/endpoint/index.d.ts +0 -1
  126. package/plugins/main/host/host.d.ts +0 -16
  127. package/plugins/main/host/index.d.ts +0 -1
  128. package/plugins/main/index.d.ts +0 -13
  129. package/plugins/main/license/index.d.ts +0 -1
  130. package/plugins/main/license/license.d.ts +0 -21
  131. package/plugins/main/param/index.d.ts +0 -1
  132. package/plugins/main/param/param.d.ts +0 -36
  133. package/plugins/main/preset/index.d.ts +0 -1
  134. package/plugins/main/preset/preset.d.ts +0 -3
  135. package/plugins/main/response/index.d.ts +0 -1
  136. package/plugins/main/response/response.d.ts +0 -21
  137. package/plugins/main/return/index.d.ts +0 -1
  138. package/plugins/main/return/return.d.ts +0 -4
  139. package/plugins/main/server/index.d.ts +0 -1
  140. package/plugins/main/server/server.d.ts +0 -13
  141. package/plugins/main/tag/index.d.ts +0 -1
  142. package/plugins/main/tag/tag.d.ts +0 -12
  143. package/plugins/main/variable/index.d.ts +0 -1
  144. package/plugins/main/variable/variable.d.ts +0 -24
  145. package/plugins/request/cms/cms.d.ts +0 -6
  146. package/plugins/request/cms/index.d.ts +0 -1
  147. package/plugins/request/cookie/cookie.d.ts +0 -7
  148. package/plugins/request/cookie/index.d.ts +0 -1
  149. package/plugins/request/error/error.d.ts +0 -61
  150. package/plugins/request/error/index.d.ts +0 -1
  151. package/plugins/request/file/file.d.ts +0 -5
  152. package/plugins/request/file/index.d.ts +0 -1
  153. package/plugins/request/header/header.d.ts +0 -6
  154. package/plugins/request/header/index.d.ts +0 -1
  155. package/plugins/request/index.d.ts +0 -8
  156. package/plugins/request/proxy/index.d.ts +0 -1
  157. package/plugins/request/proxy/proxy.d.ts +0 -8
  158. package/plugins/request/redirect/index.d.ts +0 -1
  159. package/plugins/request/redirect/redirect.d.ts +0 -18
  160. package/plugins/request/success/index.d.ts +0 -1
  161. package/plugins/request/success/success.d.ts +0 -19
  162. package/plugins/schema/any/any.d.ts +0 -5
  163. package/plugins/schema/any/index.d.ts +0 -1
  164. package/plugins/schema/array/array.d.ts +0 -9
  165. package/plugins/schema/array/index.d.ts +0 -1
  166. package/plugins/schema/binary/binary.d.ts +0 -9
  167. package/plugins/schema/binary/index.d.ts +0 -1
  168. package/plugins/schema/boolean/boolean.d.ts +0 -5
  169. package/plugins/schema/boolean/index.d.ts +0 -1
  170. package/plugins/schema/date/date.d.ts +0 -8
  171. package/plugins/schema/date/index.d.ts +0 -1
  172. package/plugins/schema/field/field.d.ts +0 -10
  173. package/plugins/schema/field/index.d.ts +0 -1
  174. package/plugins/schema/index.d.ts +0 -13
  175. package/plugins/schema/integer/index.d.ts +0 -1
  176. package/plugins/schema/integer/integer.d.ts +0 -45
  177. package/plugins/schema/null/index.d.ts +0 -1
  178. package/plugins/schema/null/null.d.ts +0 -5
  179. package/plugins/schema/number/index.d.ts +0 -1
  180. package/plugins/schema/number/number.d.ts +0 -41
  181. package/plugins/schema/object/index.d.ts +0 -1
  182. package/plugins/schema/object/object.d.ts +0 -6
  183. package/plugins/schema/string/index.d.ts +0 -1
  184. package/plugins/schema/string/string.d.ts +0 -36
  185. package/plugins/schema/tuple/index.d.ts +0 -1
  186. package/plugins/schema/tuple/tuple.d.ts +0 -6
  187. package/plugins/schema/uuid/index.d.ts +0 -1
  188. package/plugins/schema/uuid/uuid.d.ts +0 -6
  189. package/plugins/utils/blacklist/blacklist.d.ts +0 -5
  190. package/plugins/utils/blacklist/index.d.ts +0 -1
  191. package/plugins/utils/dts/dts.d.ts +0 -6
  192. package/plugins/utils/dts/index.d.ts +0 -1
  193. package/plugins/utils/env/env.d.ts +0 -7
  194. package/plugins/utils/env/index.d.ts +0 -1
  195. package/plugins/utils/index.d.ts +0 -7
  196. package/plugins/utils/protection/index.d.ts +0 -1
  197. package/plugins/utils/protection/protection.d.ts +0 -9
  198. package/plugins/utils/swagger/index.d.ts +0 -1
  199. package/plugins/utils/swagger/swagger.d.ts +0 -6
  200. package/plugins/utils/ui/index.d.ts +0 -1
  201. package/plugins/utils/ui/ui.d.ts +0 -13
  202. package/plugins/utils/whitelist/index.d.ts +0 -1
  203. package/plugins/utils/whitelist/whitelist.d.ts +0 -5
  204. package/types.d.ts +0 -69
  205. package/utils/FileData/Bin.d.ts +0 -47
  206. package/utils/FileData/index.d.ts +0 -1
  207. package/utils/JSONString/JSONString.d.ts +0 -1
  208. package/utils/JSONString/index.d.ts +0 -1
  209. package/utils/action/Action.d.ts +0 -31
  210. package/utils/action/index.d.ts +0 -1
  211. package/utils/dateFormat/dateFormat.d.ts +0 -2
  212. package/utils/dateFormat/index.d.ts +0 -1
  213. package/utils/decorators/index.d.ts +0 -1
  214. package/utils/decorators/once/index.d.ts +0 -1
  215. package/utils/decorators/once/once.d.ts +0 -4
  216. package/utils/generateTypes/generateTypes.d.ts +0 -3
  217. package/utils/generateTypes/index.d.ts +0 -1
  218. package/utils/getEndpoint/getEndpoint.d.ts +0 -2
  219. package/utils/getEndpoint/index.d.ts +0 -1
  220. package/utils/getOrAdd/getOrAdd.d.ts +0 -1
  221. package/utils/getOrAdd/index.d.ts +0 -1
  222. package/utils/httpOnStart/httpOnStart.d.ts +0 -2
  223. package/utils/httpOnStart/index.d.ts +0 -1
  224. package/utils/index.d.ts +0 -13
  225. package/utils/parseBody/index.d.ts +0 -1
  226. package/utils/parseBody/parseBody.d.ts +0 -2
  227. package/utils/parseFormBody/index.d.ts +0 -1
  228. package/utils/parseFormBody/parseFormBody.d.ts +0 -2
  229. package/utils/parseSearch/index.d.ts +0 -1
  230. package/utils/parseSearch/parseSearch.d.ts +0 -3
  231. package/utils/rules/arrayOf/arrayOf.d.ts +0 -2
  232. package/utils/rules/arrayOf/index.d.ts +0 -1
  233. package/utils/rules/bin/bin.d.ts +0 -2
  234. package/utils/rules/bin/index.d.ts +0 -1
  235. package/utils/rules/binaryAccept/binaryAccept.d.ts +0 -2
  236. package/utils/rules/binaryAccept/index.d.ts +0 -1
  237. package/utils/rules/constants.d.ts +0 -1
  238. package/utils/rules/dateTo/dateTo.d.ts +0 -2
  239. package/utils/rules/dateTo/index.d.ts +0 -1
  240. package/utils/rules/defaultTo/defaultTo.d.ts +0 -1
  241. package/utils/rules/defaultTo/index.d.ts +0 -1
  242. package/utils/rules/helpers.d.ts +0 -8
  243. package/utils/rules/index.d.ts +0 -28
  244. package/utils/rules/int/index.d.ts +0 -1
  245. package/utils/rules/int/int.d.ts +0 -2
  246. package/utils/rules/max/index.d.ts +0 -1
  247. package/utils/rules/max/max.d.ts +0 -1
  248. package/utils/rules/maxBin/index.d.ts +0 -1
  249. package/utils/rules/maxBin/maxBin.d.ts +0 -2
  250. package/utils/rules/maxDate/index.d.ts +0 -1
  251. package/utils/rules/maxDate/maxDate.d.ts +0 -1
  252. package/utils/rules/maxLength/index.d.ts +0 -1
  253. package/utils/rules/maxLength/maxLength.d.ts +0 -1
  254. package/utils/rules/min/index.d.ts +0 -1
  255. package/utils/rules/min/min.d.ts +0 -1
  256. package/utils/rules/minBin/index.d.ts +0 -1
  257. package/utils/rules/minBin/minBin.d.ts +0 -2
  258. package/utils/rules/minDate/index.d.ts +0 -1
  259. package/utils/rules/minDate/minDate.d.ts +0 -1
  260. package/utils/rules/minLength/index.d.ts +0 -1
  261. package/utils/rules/minLength/minLength.d.ts +0 -1
  262. package/utils/rules/nullable/index.d.ts +0 -1
  263. package/utils/rules/nullable/nullable.d.ts +0 -1
  264. package/utils/rules/num/index.d.ts +0 -1
  265. package/utils/rules/num/num.d.ts +0 -1
  266. package/utils/rules/objectOf/index.d.ts +0 -1
  267. package/utils/rules/objectOf/objectOf.d.ts +0 -3
  268. package/utils/rules/oneOf/index.d.ts +0 -1
  269. package/utils/rules/oneOf/oneOf.d.ts +0 -2
  270. package/utils/rules/optional/index.d.ts +0 -1
  271. package/utils/rules/optional/optional.d.ts +0 -2
  272. package/utils/rules/pattern/index.d.ts +0 -1
  273. package/utils/rules/pattern/pattern.d.ts +0 -1
  274. package/utils/rules/pipe/index.d.ts +0 -1
  275. package/utils/rules/pipe/pipe.d.ts +0 -2
  276. package/utils/rules/required/index.d.ts +0 -1
  277. package/utils/rules/required/required.d.ts +0 -2
  278. package/utils/rules/tupleOf/index.d.ts +0 -1
  279. package/utils/rules/tupleOf/tupleOf.d.ts +0 -2
  280. package/utils/rules/types.d.ts +0 -4
  281. package/utils/rules/uuidTo/index.d.ts +0 -1
  282. package/utils/rules/uuidTo/uuidTo.d.ts +0 -1
  283. package/utils/rules/values/index.d.ts +0 -1
  284. package/utils/rules/values/values.d.ts +0 -1
  285. package/utils/stringifySearch/index.d.ts +0 -1
  286. package/utils/stringifySearch/stringifySearch.d.ts +0 -2
@@ -1,21 +0,0 @@
1
- import { type HandlerPlugin } from 'innet';
2
- export interface LicenseProps {
3
- /**
4
- * An [SPDX](https://spdx.org/spdx-specification-21-web-version#h.jxpfx0ykyb60) license expression for the API.
5
- * The `identifier` field is mutually exclusive of the `url` field.
6
- * @example: Apache-2.0
7
- * */
8
- identifier?: string;
9
- /**
10
- * The license name used for the API.
11
- * @example: Apache 2.0
12
- * */
13
- name: string;
14
- /**
15
- * A URL to the license used for the API.
16
- * This MUST be in the form of a URL.
17
- * The `url` field is mutually exclusive of the `identifier` field.
18
- * */
19
- url?: string;
20
- }
21
- export declare const license: HandlerPlugin;
@@ -1 +0,0 @@
1
- export * from './param';
@@ -1,36 +0,0 @@
1
- import { type HandlerPlugin } from 'innet';
2
- import { type InParam } from '../../../types';
3
- export interface ParamProps {
4
- children?: any;
5
- /**
6
- * Specifies that a parameter is deprecated and SHOULD be transitioned out of usage.
7
- * Default value is `false`.
8
- * */
9
- deprecated?: boolean;
10
- /**
11
- * A brief description of the parameter.
12
- * This could contain examples of use.
13
- * [CommonMark syntax](https://spec.commonmark.org) MAY be used for rich text representation.
14
- * */
15
- description?: string;
16
- /**
17
- * The location of the parameter.
18
- * Possible values are "query", "header", "path" or "cookie".
19
- * */
20
- in: InParam;
21
- /**
22
- * The name of the parameter. Parameter names are *case sensitive*.
23
- *
24
- * - If `in` is "path", the `name` field MUST correspond to a template expression occurring within the `path` field in the `endpoint`. See [Path Templating](https://swagger.io/specification/#path-templating) for further information.
25
- * - If `in` is "header" and the `name` field is "Accept", "Content-Type" or "Authorization", the parameter definition SHALL be ignored.
26
- * - For all other cases, the `name` corresponds to the parameter name used by the `in` property.
27
- * */
28
- name: string;
29
- /**
30
- * Determines whether this parameter is mandatory.
31
- * If the parameter location is "path", this property is `true` and its value MUST be `true`.
32
- * Otherwise, the property MAY be included and its default value is `false`.
33
- * */
34
- required?: boolean;
35
- }
36
- export declare const param: HandlerPlugin;
@@ -1 +0,0 @@
1
- export * from './preset';
@@ -1,3 +0,0 @@
1
- export interface PresetProps {
2
- }
3
- export declare function preset(): void;
@@ -1 +0,0 @@
1
- export * from './response';
@@ -1,21 +0,0 @@
1
- import { type HandlerPlugin } from 'innet';
2
- import { type ErrorStatuses, type RedirectStatuses, type SuccessStatuses } from '../../request';
3
- export type StatusKey = ErrorStatuses | RedirectStatuses | SuccessStatuses;
4
- export interface ResponseProps {
5
- children?: any;
6
- /**
7
- * A description of the response.
8
- * [CommonMark syntax](https://spec.commonmark.org) MAY be used for rich text representation.
9
- * */
10
- description?: string;
11
- /**
12
- * Any [HTTP status code](https://swagger.io/specification/#http-codes) can be used as the property.
13
- * To define a range of response codes, this field MAY contain the uppercase wildcard character X.
14
- * For example, 2XX represents all response codes between [200-299].
15
- * Only the following range definitions are allowed: 1XX, 2XX, 3XX, 4XX, and 5XX.
16
- * */
17
- status?: 'default' | `${1 | 2 | 3 | 4 | 5}XX` | StatusKey | number;
18
- type?: string;
19
- }
20
- export declare const statuses: Record<StatusKey, number>;
21
- export declare const response: HandlerPlugin;
@@ -1 +0,0 @@
1
- export * from './return';
@@ -1,4 +0,0 @@
1
- import { type HandlerPlugin } from 'innet';
2
- export interface ReturnProps {
3
- }
4
- export declare const returnPlugin: HandlerPlugin;
@@ -1 +0,0 @@
1
- export * from './server';
@@ -1,13 +0,0 @@
1
- import { type HandlerPlugin } from 'innet';
2
- import { type IncomingMessage, type ServerResponse } from 'http';
3
- import { type ServerStartParams, type SSL } from '../../../types';
4
- export interface ServerProps {
5
- children?: any;
6
- onClose?: () => any;
7
- onError?: (e: Error) => any;
8
- onRequest?: (req: IncomingMessage, res: ServerResponse) => any;
9
- onStart?: (params: ServerStartParams) => any;
10
- port?: number;
11
- ssl?: SSL;
12
- }
13
- export declare const server: HandlerPlugin;
@@ -1 +0,0 @@
1
- export * from './tag';
@@ -1,12 +0,0 @@
1
- import { type HandlerPlugin } from 'innet';
2
- export interface TagProps {
3
- children?: any;
4
- /**
5
- * A description for the tag.
6
- * [CommonMark syntax](https://spec.commonmark.org) MAY be used for rich text representation.
7
- * */
8
- description?: string;
9
- /** The name of the tag. */
10
- name: string;
11
- }
12
- export declare const tag: HandlerPlugin;
@@ -1 +0,0 @@
1
- export * from './variable';
@@ -1,24 +0,0 @@
1
- import { type HandlerPlugin } from 'innet';
2
- export interface VariableProps {
3
- /**
4
- * An optional description for the server variable.
5
- * [CommonMark syntax](https://spec.commonmark.org) MAY be used for rich text representation.
6
- * */
7
- description?: string;
8
- /**
9
- * A server url parameter
10
- * */
11
- key: string;
12
- /**
13
- * The default value to use for substitution,
14
- * which SHALL be sent if an alternate value is not supplied.
15
- * If the `values` is defined, the `value` MUST exist in the `values`.
16
- * */
17
- value?: string;
18
- /**
19
- * An enumeration of string values to be used if the substitution options are from a limited set.
20
- * The array MUST NOT be empty.
21
- * */
22
- values?: [string, string, ...string[]];
23
- }
24
- export declare const variable: HandlerPlugin;
@@ -1,6 +0,0 @@
1
- export interface CmsProps {
2
- children?: any;
3
- dir?: string;
4
- prefix?: string;
5
- }
6
- export declare function cms(): void;
@@ -1 +0,0 @@
1
- export * from './cms';
@@ -1,7 +0,0 @@
1
- import { type HandlerPlugin } from 'innet';
2
- import { type Cookies } from 'cookie';
3
- export interface CookieProps extends Cookies {
4
- key: string;
5
- value?: string;
6
- }
7
- export declare const cookie: HandlerPlugin;
@@ -1 +0,0 @@
1
- export * from './cookie';
@@ -1,61 +0,0 @@
1
- import { type HandlerPlugin } from 'innet';
2
- export declare const errorStatuses: {
3
- readonly aTimeoutOccurred: 524;
4
- readonly authenticationTimeout: 419;
5
- readonly badGateway: 502;
6
- readonly badRequest: 400;
7
- readonly bandwidthLimitExceeded: 509;
8
- readonly clientClosedRequest: 499;
9
- readonly conflict: 409;
10
- readonly connectionTimedOut: 522;
11
- readonly expectationFailed: 417;
12
- readonly failedDependency: 424;
13
- readonly forbidden: 403;
14
- readonly gatewayTimeout: 504;
15
- readonly gone: 410;
16
- readonly HTTPVersionNotSupported: 505;
17
- readonly imATeapot: 418;
18
- readonly insufficientStorage: 507;
19
- readonly internalServerError: 500;
20
- readonly invalidSSLCertificate: 526;
21
- readonly lengthRequired: 411;
22
- readonly locked: 423;
23
- readonly loopDetected: 508;
24
- readonly methodNotAllowed: 405;
25
- readonly misdirectedRequest: 421;
26
- readonly networkAuthenticationRequired: 511;
27
- readonly notAcceptable: 406;
28
- readonly notExtended: 510;
29
- readonly notFound: 404;
30
- readonly notImplemented: 501;
31
- readonly originIsUnreachable: 523;
32
- readonly payloadTooLarge: 413;
33
- readonly paymentRequired: 402;
34
- readonly preconditionFailed: 412;
35
- readonly preconditionRequired: 428;
36
- readonly proxyAuthenticationRequired: 407;
37
- readonly rangeNotSatisfiable: 416;
38
- readonly requestHeaderFieldsTooLarge: 431;
39
- readonly requestTimeout: 408;
40
- readonly retryWith: 449;
41
- readonly serviceUnavailable: 503;
42
- readonly SSLHandshakeFailed: 525;
43
- readonly tooEarly: 425;
44
- readonly tooManyRequests: 429;
45
- readonly unauthorized: 401;
46
- readonly unavailableForLegalReasons: 451;
47
- readonly unknownError: 520;
48
- readonly unprocessableEntity: 422;
49
- readonly unsupportedMediaType: 415;
50
- readonly upgradeRequired: 426;
51
- readonly URITooLong: 414;
52
- readonly variantAlsoNegotiates: 506;
53
- readonly webServerIsDown: 521;
54
- };
55
- export type ErrorStatuses = keyof typeof errorStatuses;
56
- export interface ErrorProps {
57
- children?: any;
58
- code?: string;
59
- status?: ErrorStatuses | number;
60
- }
61
- export declare const error: HandlerPlugin;
@@ -1 +0,0 @@
1
- export * from './error';
@@ -1,5 +0,0 @@
1
- export interface FileProps {
2
- children?: any;
3
- path: string;
4
- }
5
- export declare function file(): void;
@@ -1 +0,0 @@
1
- export * from './file';
@@ -1,6 +0,0 @@
1
- import { type HandlerPlugin } from 'innet';
2
- export interface HeaderProps {
3
- key: string;
4
- value: string;
5
- }
6
- export declare const header: HandlerPlugin;
@@ -1 +0,0 @@
1
- export * from './header';
@@ -1,8 +0,0 @@
1
- export * from './cms';
2
- export * from './cookie';
3
- export * from './error';
4
- export * from './file';
5
- export * from './header';
6
- export * from './proxy';
7
- export * from './redirect';
8
- export * from './success';
@@ -1 +0,0 @@
1
- export * from './proxy';
@@ -1,8 +0,0 @@
1
- import { type HandlerPlugin } from 'innet';
2
- import { type IncomingMessage } from 'http';
3
- export interface ProxyProps {
4
- onProxyRes?: (res: IncomingMessage) => void;
5
- secure?: boolean;
6
- to: string;
7
- }
8
- export declare const proxy: HandlerPlugin;
@@ -1 +0,0 @@
1
- export * from './redirect';
@@ -1,18 +0,0 @@
1
- import { type HandlerPlugin } from 'innet';
2
- export declare const redirectStatuses: {
3
- found: number;
4
- movedPermanently: number;
5
- multipleChoices: number;
6
- notModified: number;
7
- permanentRedirect: number;
8
- seeOther: number;
9
- temporaryRedirect: number;
10
- useProxy: number;
11
- };
12
- export type RedirectStatuses = keyof typeof redirectStatuses;
13
- export interface RedirectProps {
14
- encode?: boolean;
15
- status?: RedirectStatuses | number;
16
- to: string;
17
- }
18
- export declare const redirect: HandlerPlugin;
@@ -1 +0,0 @@
1
- export * from './success';
@@ -1,19 +0,0 @@
1
- import { type HandlerPlugin } from 'innet';
2
- export declare const successStatuses: {
3
- readonly accepted: 202;
4
- readonly alreadyReported: 208;
5
- readonly created: 201;
6
- readonly multiStatus: 207;
7
- readonly noContent: 204;
8
- readonly ok: 200;
9
- readonly outside: 203;
10
- readonly partialContent: 206;
11
- readonly resetContent: 205;
12
- };
13
- export type SuccessStatuses = keyof typeof successStatuses;
14
- export interface SuccessProps {
15
- children?: any;
16
- status?: SuccessStatuses | number;
17
- type?: string;
18
- }
19
- export declare const success: HandlerPlugin;
@@ -1,5 +0,0 @@
1
- import { type HandlerPlugin } from 'innet';
2
- import { type BaseSchemaProps } from '../../../types';
3
- export interface AnyProps extends BaseSchemaProps<any> {
4
- }
5
- export declare const any: HandlerPlugin;
@@ -1 +0,0 @@
1
- export * from './any';
@@ -1,9 +0,0 @@
1
- import { type HandlerPlugin } from 'innet';
2
- import { type BaseSchemaProps } from '../../../types';
3
- export interface ArrayProps extends BaseSchemaProps<any[]> {
4
- children?: any;
5
- maxItems?: number;
6
- minItems?: number;
7
- uniqueItems?: boolean;
8
- }
9
- export declare const array: HandlerPlugin;
@@ -1 +0,0 @@
1
- export * from './array';
@@ -1,9 +0,0 @@
1
- import { type HandlerPlugin } from 'innet';
2
- export interface BinaryProps {
3
- accept?: string;
4
- description?: string;
5
- max?: number;
6
- min?: number;
7
- ref?: string;
8
- }
9
- export declare const binary: HandlerPlugin;
@@ -1 +0,0 @@
1
- export * from './binary';
@@ -1,5 +0,0 @@
1
- import { type HandlerPlugin } from 'innet';
2
- import { type BaseSchemaProps } from '../../../types';
3
- export interface BooleanProps extends BaseSchemaProps<boolean> {
4
- }
5
- export declare const boolean: HandlerPlugin;
@@ -1 +0,0 @@
1
- export * from './boolean';
@@ -1,8 +0,0 @@
1
- import { type HandlerPlugin } from 'innet';
2
- import { type ValuesSchemaProps } from '../../../types';
3
- import { type DateFormat } from '../../../utils';
4
- export interface DateProps extends ValuesSchemaProps<DateFormat> {
5
- max?: DateFormat;
6
- min?: DateFormat;
7
- }
8
- export declare const date: HandlerPlugin;
@@ -1 +0,0 @@
1
- export * from './date';
@@ -1,10 +0,0 @@
1
- import { type HandlerPlugin } from 'innet';
2
- export interface FieldProps {
3
- children?: any;
4
- deprecated?: boolean;
5
- key: string;
6
- optional?: boolean;
7
- readOnly?: boolean;
8
- writeOnly?: boolean;
9
- }
10
- export declare const field: HandlerPlugin;
@@ -1 +0,0 @@
1
- export * from './field';
@@ -1,13 +0,0 @@
1
- export * from './any';
2
- export * from './array';
3
- export * from './binary';
4
- export * from './boolean';
5
- export * from './date';
6
- export * from './field';
7
- export * from './integer';
8
- export * from './null';
9
- export * from './number';
10
- export * from './object';
11
- export * from './string';
12
- export * from './tuple';
13
- export * from './uuid';
@@ -1 +0,0 @@
1
- export * from './integer';
@@ -1,45 +0,0 @@
1
- import { type HandlerPlugin } from 'innet';
2
- import { type IntegerFormats, type ValuesSchemaProps } from '../../../types';
3
- export interface IntegerProps extends ValuesSchemaProps<bigint | number> {
4
- /**
5
- * The `exclusiveMaximum` keyword is used to restrict the value to be less than the specified number.
6
- * @example For example, the following value is valid:
7
- * ```tsx
8
- * <integer exclusiveMaximum={10} />
9
- * ```
10
- * @see https://swagger.io/docs/specification/v3_0/data-models/data-types/#numbers
11
- * */
12
- exclusiveMaximum?: bigint | boolean | number;
13
- /**
14
- * The `exclusiveMinimum` keyword is used to restrict the value to be greater than the specified number.
15
- * @example For example, the following value is valid:
16
- * ```tsx
17
- * <integer exclusiveMinimum={10} />
18
- * ```
19
- * @see https://swagger.io/docs/specification/v3_0/data-models/data-types/#numbers
20
- * */
21
- exclusiveMinimum?: bigint | boolean | number;
22
- /**
23
- * An optional format modifier serves as a hint at the contents and format of the string.
24
- * @example For example, the following value is valid:
25
- * ```tsx
26
- * <integer format='int64' />
27
- * ```
28
- * @see https://swagger.io/docs/specification/data-models/data-types/#numbers
29
- * */
30
- format?: IntegerFormats;
31
- /** Validate the integer number value by maximum. */
32
- max?: bigint | number;
33
- /** Validate the integer number value by minimum. */
34
- min?: bigint | number;
35
- /**
36
- * The `multipleOf` keyword is used to restrict the value to be a multiple of the specified number.
37
- * @example For example, the following value is valid:
38
- * ```tsx
39
- * <number multipleOf={2} />
40
- * ```
41
- * @see https://swagger.io/docs/specification/v3_0/data-models/data-types/#numbers
42
- * */
43
- multipleOf?: bigint | number;
44
- }
45
- export declare const integer: HandlerPlugin;
@@ -1 +0,0 @@
1
- export * from './null';
@@ -1,5 +0,0 @@
1
- import { type HandlerPlugin } from 'innet';
2
- import { type BaseSchemaProps } from '../../../types';
3
- export interface NullProps extends BaseSchemaProps<null> {
4
- }
5
- export declare const nullPlugin: HandlerPlugin;
@@ -1 +0,0 @@
1
- export * from './number';
@@ -1,41 +0,0 @@
1
- import { type HandlerPlugin } from 'innet';
2
- import { type ValuesSchemaProps } from '../../../types';
3
- export interface NumberProps extends ValuesSchemaProps<number> {
4
- /**
5
- * The `exclusiveMaximum` keyword is used to restrict the value to be less than the specified number.
6
- * @example For example, the following value is valid:
7
- * ```tsx
8
- * <number exclusiveMaximum={10} />
9
- * ```
10
- * @see https://swagger.io/docs/specification/v3_0/data-models/data-types/#numbers
11
- * */
12
- exclusiveMaximum?: boolean;
13
- /**
14
- * The `exclusiveMinimum` keyword is used to restrict the value to be greater than the specified number.
15
- * @example For example, the following value is valid:
16
- * ```tsx
17
- * <number exclusiveMinimum={10} />
18
- * ```
19
- * @see https://swagger.io/docs/specification/v3_0/data-models/data-types/#numbers
20
- * */
21
- exclusiveMinimum?: boolean;
22
- /**
23
- * An optional format modifier serves as a hint at the contents and format of the string.
24
- * @see https://swagger.io/docs/specification/v3_0/data-models/data-types/#numbers
25
- * */
26
- format?: 'double' | 'float' | (string & {});
27
- /** Validate the number value by maximum. */
28
- max?: number;
29
- /** Validate the number value by minimum. */
30
- min?: number;
31
- /**
32
- * The `multipleOf` keyword is used to restrict the value to be a multiple of the specified number.
33
- * @example For example, the following value is valid:
34
- * ```tsx
35
- * <number multipleOf={2} />
36
- * ```
37
- * @see https://swagger.io/docs/specification/v3_0/data-models/data-types/#numbers
38
- * */
39
- multipleOf?: number;
40
- }
41
- export declare const number: HandlerPlugin;
@@ -1 +0,0 @@
1
- export * from './object';
@@ -1,6 +0,0 @@
1
- import { type HandlerPlugin } from 'innet';
2
- import { type BaseSchemaProps } from '../../../types';
3
- export interface ObjectProps extends BaseSchemaProps<object> {
4
- children?: any;
5
- }
6
- export declare const object: HandlerPlugin;
@@ -1 +0,0 @@
1
- export * from './string';
@@ -1,36 +0,0 @@
1
- import { type HandlerPlugin } from 'innet';
2
- import { type ValuesSchemaProps } from '../../../types';
3
- export interface StringProps extends ValuesSchemaProps<string> {
4
- /**
5
- * An optional format modifier serves as a hint at the contents and format of the string.
6
- * @see https://swagger.io/docs/specification/v3_0/data-models/data-types/#strings
7
- * */
8
- format?: 'binary' | 'byte' | 'date' | 'date-time' | 'email' | 'hostname' | 'ipv4' | 'ipv6' | 'password' | 'uri' | 'uuid' | (string & {});
9
- /**
10
- * String length can be restricted using `min` and `max`.
11
- * @see https://swagger.io/docs/specification/v3_0/data-models/data-types/#strings
12
- * */
13
- max?: number;
14
- /**
15
- * String length can be restricted using `min` and `max`.
16
- * @see https://swagger.io/docs/specification/v3_0/data-models/data-types/#strings
17
- * */
18
- min?: number;
19
- /**
20
- * The pattern keyword lets you define a regular expression template for the string value.
21
- * Only the values that match this template will be accepted.
22
- * The regular expression syntax used is from JavaScript (more specifically, ECMA 262).
23
- * Regular expressions are case-sensitive, that is, [a-z] and [A-Z] are different expressions.
24
- * @example For example, the following pattern matches a Social Security Number (SSN) in the 123-45-6789 format:
25
- * ```tsx
26
- * <string pattern='^\d{3}-\d{2}-\d{4}$' />
27
- * ```
28
- * @see https://swagger.io/docs/specification/v3_0/data-models/data-types/#strings
29
- * */
30
- pattern?: RegExp | string;
31
- /**
32
- * The `patternId` keyword is used to reference a pattern from the OpenAPI specification.
33
- * */
34
- patternId?: string;
35
- }
36
- export declare const string: HandlerPlugin;
@@ -1 +0,0 @@
1
- export * from './tuple';
@@ -1,6 +0,0 @@
1
- import { type HandlerPlugin } from 'innet';
2
- import { type BaseSchemaProps } from '../../../types';
3
- export interface TupleProps extends BaseSchemaProps<any[]> {
4
- children?: any;
5
- }
6
- export declare const tuple: HandlerPlugin;
@@ -1 +0,0 @@
1
- export * from './uuid';
@@ -1,6 +0,0 @@
1
- import { type HandlerPlugin } from 'innet';
2
- import { type ValuesSchemaProps } from '../../../types';
3
- export interface UuidProps extends ValuesSchemaProps<string> {
4
- default?: 'new' | string;
5
- }
6
- export declare const uuid: HandlerPlugin;
@@ -1,5 +0,0 @@
1
- export interface BlacklistProps {
2
- children?: any;
3
- ip?: string | string[];
4
- }
5
- export declare function blacklist(): void;
@@ -1 +0,0 @@
1
- export * from './blacklist';
@@ -1,6 +0,0 @@
1
- import { type HandlerPlugin } from 'innet';
2
- export interface DtsProps {
3
- namespace?: string;
4
- path?: string;
5
- }
6
- export declare const dts: HandlerPlugin;