@innet/server 2.0.0-alpha.9 → 2.0.0-beta.2

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 (345) hide show
  1. package/README.md +1063 -445
  2. package/handler/handler.d.ts +23 -18
  3. package/handler/handler.es6.js +15 -14
  4. package/handler/handler.js +14 -13
  5. package/hooks/index.d.ts +6 -1
  6. package/hooks/index.es6.js +6 -1
  7. package/hooks/index.js +6 -1
  8. package/hooks/useAction/useAction.es6.js +1 -1
  9. package/hooks/useAction/useAction.js +1 -1
  10. package/hooks/useApi/useApi.d.ts +1 -3
  11. package/hooks/useClientIp/useClientIp.d.ts +1 -1
  12. package/hooks/useEndpoint/useEndpoint.d.ts +1 -1
  13. package/hooks/useEndpoint/useEndpoint.es6.js +3 -1
  14. package/hooks/useEndpoint/useEndpoint.js +3 -1
  15. package/hooks/useHeaders/useHeaders.d.ts +0 -1
  16. package/hooks/useIsServerHttps/index.d.ts +1 -0
  17. package/hooks/useIsServerHttps/index.es6.js +1 -0
  18. package/hooks/useIsServerHttps/index.js +10 -0
  19. package/hooks/useIsServerHttps/useIsServerHttps.d.ts +3 -0
  20. package/hooks/useIsServerHttps/useIsServerHttps.es6.js +14 -0
  21. package/hooks/useIsServerHttps/useIsServerHttps.js +19 -0
  22. package/hooks/useNewSchema/useNewSchema.es6.js +2 -2
  23. package/hooks/useNewSchema/useNewSchema.js +2 -2
  24. package/hooks/useObjectSchemaContext/index.d.ts +1 -0
  25. package/hooks/useObjectSchemaContext/index.es6.js +1 -0
  26. package/hooks/useObjectSchemaContext/index.js +10 -0
  27. package/hooks/useObjectSchemaContext/useObjectSchemaContext.d.ts +3 -0
  28. package/hooks/useObjectSchemaContext/useObjectSchemaContext.es6.js +14 -0
  29. package/hooks/useObjectSchemaContext/useObjectSchemaContext.js +19 -0
  30. package/hooks/useRequest/index.es6.js +1 -1
  31. package/hooks/useRequest/index.js +0 -1
  32. package/hooks/useRequest/useRequest.d.ts +1 -5
  33. package/hooks/useRequest/useRequest.es6.js +4 -4
  34. package/hooks/useRequest/useRequest.js +3 -4
  35. package/hooks/useRequestHandler/index.d.ts +1 -0
  36. package/hooks/useRequestHandler/index.es6.js +1 -0
  37. package/hooks/useRequestHandler/index.js +10 -0
  38. package/hooks/useRequestHandler/useRequestHandler.d.ts +4 -0
  39. package/hooks/useRequestHandler/useRequestHandler.es6.js +14 -0
  40. package/hooks/useRequestHandler/useRequestHandler.js +19 -0
  41. package/hooks/useResponse/index.es6.js +1 -1
  42. package/hooks/useResponse/index.js +0 -1
  43. package/hooks/useResponse/useResponse.d.ts +1 -5
  44. package/hooks/useResponse/useResponse.es6.js +4 -4
  45. package/hooks/useResponse/useResponse.js +3 -4
  46. package/hooks/useSchemaType/useSchemaType.d.ts +3 -2
  47. package/hooks/useSchemaType/useSchemaType.es6.js +16 -9
  48. package/hooks/useSchemaType/useSchemaType.js +16 -9
  49. package/hooks/useServer/useServer.d.ts +2 -3
  50. package/hooks/useServer/useServer.es6.js +3 -1
  51. package/hooks/useServer/useServer.js +3 -1
  52. package/hooks/useServerPlugin/index.d.ts +1 -0
  53. package/hooks/useServerPlugin/index.es6.js +1 -0
  54. package/hooks/useServerPlugin/index.js +9 -0
  55. package/hooks/useServerPlugin/useServerPlugin.d.ts +2 -0
  56. package/hooks/useServerPlugin/useServerPlugin.es6.js +13 -0
  57. package/hooks/useServerPlugin/useServerPlugin.js +17 -0
  58. package/hooks/useServerPlugins/index.d.ts +1 -0
  59. package/hooks/useServerPlugins/index.es6.js +1 -0
  60. package/hooks/useServerPlugins/index.js +10 -0
  61. package/hooks/useServerPlugins/useServerPlugins.d.ts +4 -0
  62. package/hooks/useServerPlugins/useServerPlugins.es6.js +14 -0
  63. package/hooks/useServerPlugins/useServerPlugins.js +19 -0
  64. package/hooks/useServerPort/index.d.ts +1 -0
  65. package/hooks/useServerPort/index.es6.js +1 -0
  66. package/hooks/useServerPort/index.js +10 -0
  67. package/hooks/useServerPort/useServerPort.d.ts +3 -0
  68. package/hooks/useServerPort/useServerPort.es6.js +14 -0
  69. package/hooks/useServerPort/useServerPort.js +19 -0
  70. package/index.es6.js +15 -9
  71. package/index.js +30 -14
  72. package/package.json +15 -16
  73. package/plugins/handler/serverFn/serverFn.es6.js +1 -1
  74. package/plugins/handler/serverFn/serverFn.js +1 -1
  75. package/plugins/main/api/api.d.ts +11 -8
  76. package/plugins/main/api/api.es6.js +112 -113
  77. package/plugins/main/api/api.js +111 -112
  78. package/plugins/main/body/body.d.ts +1 -0
  79. package/plugins/main/contact/contact.d.ts +2 -2
  80. package/plugins/main/endpoint/endpoint.d.ts +21 -15
  81. package/plugins/main/endpoint/endpoint.es6.js +11 -9
  82. package/plugins/main/endpoint/endpoint.js +10 -8
  83. package/plugins/main/host/host.d.ts +5 -5
  84. package/plugins/main/host/host.es6.js +3 -1
  85. package/plugins/main/host/host.js +3 -1
  86. package/plugins/main/index.d.ts +2 -2
  87. package/plugins/main/index.es6.js +2 -2
  88. package/plugins/main/index.js +2 -2
  89. package/plugins/main/license/license.d.ts +5 -5
  90. package/plugins/main/param/param.d.ts +12 -11
  91. package/plugins/main/param/param.es6.js +6 -7
  92. package/plugins/main/param/param.js +5 -6
  93. package/plugins/main/preset/index.d.ts +1 -0
  94. package/plugins/main/preset/index.es6.js +1 -0
  95. package/plugins/{utils/prod → main/preset}/index.js +2 -2
  96. package/plugins/main/preset/preset.d.ts +3 -0
  97. package/plugins/main/preset/preset.es6.js +13 -0
  98. package/plugins/{utils/dev/dev.js → main/preset/preset.js} +9 -6
  99. package/plugins/main/response/index.es6.js +1 -1
  100. package/plugins/main/response/index.js +1 -0
  101. package/plugins/main/response/response.d.ts +6 -1
  102. package/plugins/main/response/response.es6.js +28 -12
  103. package/plugins/main/response/response.js +27 -10
  104. package/plugins/main/return/index.d.ts +1 -0
  105. package/plugins/main/return/index.es6.js +1 -0
  106. package/plugins/main/return/index.js +9 -0
  107. package/plugins/main/return/return.d.ts +4 -0
  108. package/plugins/main/return/return.es6.js +10 -0
  109. package/plugins/main/return/return.js +14 -0
  110. package/plugins/main/server/server.d.ts +6 -6
  111. package/plugins/main/server/server.es6.js +40 -16
  112. package/plugins/main/server/server.js +39 -15
  113. package/plugins/main/tag/tag.d.ts +3 -2
  114. package/plugins/main/tag/tag.es6.js +6 -4
  115. package/plugins/main/tag/tag.js +5 -3
  116. package/plugins/main/variable/variable.d.ts +5 -5
  117. package/plugins/main/variable/variable.es6.js +4 -3
  118. package/plugins/main/variable/variable.js +4 -3
  119. package/plugins/request/cms/cms.d.ts +1 -0
  120. package/plugins/request/cms/cms.es6.js +3 -4
  121. package/plugins/request/cms/cms.js +2 -3
  122. package/plugins/request/cookie/cookie.d.ts +2 -2
  123. package/plugins/request/cookie/cookie.es6.js +1 -2
  124. package/plugins/request/cookie/cookie.js +1 -2
  125. package/plugins/request/error/error.d.ts +41 -40
  126. package/plugins/request/error/error.es6.js +47 -45
  127. package/plugins/request/error/error.js +46 -44
  128. package/plugins/request/file/file.d.ts +1 -0
  129. package/plugins/request/file/file.es6.js +4 -6
  130. package/plugins/request/file/file.js +3 -5
  131. package/plugins/request/header/header.es6.js +1 -1
  132. package/plugins/request/header/header.js +1 -1
  133. package/plugins/request/proxy/proxy.d.ts +3 -1
  134. package/plugins/request/proxy/proxy.es6.js +5 -2
  135. package/plugins/request/proxy/proxy.js +5 -2
  136. package/plugins/request/redirect/redirect.d.ts +8 -7
  137. package/plugins/request/redirect/redirect.es6.js +7 -7
  138. package/plugins/request/redirect/redirect.js +7 -7
  139. package/plugins/request/success/success.d.ts +8 -6
  140. package/plugins/request/success/success.es6.js +21 -11
  141. package/plugins/request/success/success.js +20 -10
  142. package/plugins/schema/any/any.d.ts +5 -0
  143. package/plugins/schema/any/any.es6.js +27 -0
  144. package/plugins/schema/any/any.js +31 -0
  145. package/plugins/schema/array/array.d.ts +1 -0
  146. package/plugins/schema/array/array.es6.js +2 -3
  147. package/plugins/schema/array/array.js +1 -2
  148. package/plugins/schema/binary/binary.d.ts +3 -3
  149. package/plugins/schema/date/date.d.ts +1 -1
  150. package/plugins/schema/date/date.es6.js +8 -4
  151. package/plugins/schema/date/date.js +8 -4
  152. package/plugins/schema/field/field.d.ts +2 -0
  153. package/plugins/schema/field/field.es6.js +8 -8
  154. package/plugins/schema/field/field.js +6 -6
  155. package/plugins/schema/index.d.ts +1 -0
  156. package/plugins/schema/index.es6.js +1 -0
  157. package/plugins/schema/index.js +1 -0
  158. package/plugins/schema/integer/integer.d.ts +3 -3
  159. package/plugins/schema/integer/integer.es6.js +8 -3
  160. package/plugins/schema/integer/integer.js +8 -3
  161. package/plugins/schema/number/number.d.ts +2 -2
  162. package/plugins/schema/number/number.es6.js +1 -2
  163. package/plugins/schema/number/number.js +1 -2
  164. package/plugins/schema/object/object.d.ts +1 -0
  165. package/plugins/schema/object/object.es6.js +19 -7
  166. package/plugins/schema/object/object.js +18 -6
  167. package/plugins/schema/string/string.d.ts +2 -2
  168. package/plugins/schema/string/string.es6.js +44 -31
  169. package/plugins/schema/string/string.js +44 -31
  170. package/plugins/schema/tuple/tuple.d.ts +1 -0
  171. package/plugins/schema/tuple/tuple.es6.js +4 -5
  172. package/plugins/schema/tuple/tuple.js +3 -4
  173. package/plugins/schema/uuid/uuid.es6.js +5 -3
  174. package/plugins/schema/uuid/uuid.js +5 -3
  175. package/plugins/utils/blacklist/blacklist.d.ts +5 -0
  176. package/plugins/utils/blacklist/blacklist.es6.js +17 -0
  177. package/plugins/utils/blacklist/blacklist.js +21 -0
  178. package/plugins/utils/blacklist/index.d.ts +1 -0
  179. package/plugins/utils/blacklist/index.es6.js +1 -0
  180. package/plugins/utils/blacklist/index.js +9 -0
  181. package/plugins/utils/dts/dts.d.ts +2 -1
  182. package/plugins/utils/dts/dts.es6.js +2 -2
  183. package/plugins/utils/dts/dts.js +2 -2
  184. package/plugins/utils/env/env.d.ts +7 -0
  185. package/plugins/utils/env/env.es6.js +11 -0
  186. package/plugins/utils/{prod/prod.js → env/env.js} +5 -4
  187. package/plugins/utils/env/index.d.ts +1 -0
  188. package/plugins/utils/env/index.es6.js +1 -0
  189. package/plugins/utils/{dev → env}/index.js +2 -2
  190. package/plugins/utils/index.d.ts +3 -2
  191. package/plugins/utils/index.es6.js +3 -2
  192. package/plugins/utils/index.js +3 -2
  193. package/plugins/utils/protection/protection.d.ts +4 -4
  194. package/plugins/utils/protection/protection.es6.js +13 -16
  195. package/plugins/utils/protection/protection.js +13 -16
  196. package/plugins/utils/swagger/swagger.es6.js +7 -5
  197. package/plugins/utils/swagger/swagger.js +7 -5
  198. package/plugins/utils/whitelist/index.d.ts +1 -0
  199. package/plugins/utils/whitelist/index.es6.js +1 -0
  200. package/plugins/utils/whitelist/index.js +9 -0
  201. package/plugins/utils/whitelist/whitelist.d.ts +5 -0
  202. package/plugins/utils/whitelist/whitelist.es6.js +19 -0
  203. package/plugins/utils/whitelist/whitelist.js +23 -0
  204. package/types.d.ts +15 -22
  205. package/utils/FileData/Bin.d.ts +13 -13
  206. package/utils/FileData/Bin.es6.js +2 -2
  207. package/utils/FileData/Bin.js +2 -2
  208. package/utils/action/Action.d.ts +13 -14
  209. package/utils/action/Action.es6.js +92 -92
  210. package/utils/action/Action.js +91 -91
  211. package/utils/dateFormat/dateFormat.d.ts +1 -1
  212. package/utils/dateFormat/dateFormat.es6.js +1 -1
  213. package/utils/dateFormat/dateFormat.js +1 -1
  214. package/utils/decorators/once/once.es6.js +1 -1
  215. package/utils/decorators/once/once.js +1 -1
  216. package/utils/generateTypes/generateTypes.d.ts +2 -2
  217. package/utils/generateTypes/generateTypes.es6.js +85 -25
  218. package/utils/generateTypes/generateTypes.js +85 -25
  219. package/utils/getEndpoint/getEndpoint.es6.js +2 -2
  220. package/utils/getEndpoint/getEndpoint.js +2 -2
  221. package/utils/getOrAdd/getOrAdd.d.ts +1 -1
  222. package/utils/httpOnStart/httpOnStart.d.ts +1 -1
  223. package/utils/httpOnStart/httpOnStart.es6.js +1 -1
  224. package/utils/httpOnStart/httpOnStart.js +1 -1
  225. package/utils/parseBody/parseBody.d.ts +0 -1
  226. package/utils/parseBody/parseBody.es6.js +13 -16
  227. package/utils/parseBody/parseBody.js +13 -16
  228. package/utils/parseFormBody/parseFormBody.d.ts +0 -1
  229. package/utils/parseFormBody/parseFormBody.es6.js +41 -41
  230. package/utils/parseFormBody/parseFormBody.js +41 -41
  231. package/utils/parseSearch/parseSearch.es6.js +4 -1
  232. package/utils/parseSearch/parseSearch.js +4 -1
  233. package/utils/rules/arrayOf/arrayOf.es6.js +1 -1
  234. package/utils/rules/arrayOf/arrayOf.js +1 -1
  235. package/utils/rules/bin/bin.es6.js +4 -1
  236. package/utils/rules/bin/bin.js +4 -1
  237. package/utils/rules/binaryAccept/binaryAccept.es6.js +5 -2
  238. package/utils/rules/binaryAccept/binaryAccept.js +5 -2
  239. package/utils/rules/dateTo/dateTo.d.ts +1 -1
  240. package/utils/rules/dateTo/dateTo.es6.js +4 -1
  241. package/utils/rules/dateTo/dateTo.js +4 -1
  242. package/utils/rules/helpers.d.ts +1 -1
  243. package/utils/rules/helpers.es6.js +4 -1
  244. package/utils/rules/helpers.js +4 -1
  245. package/utils/rules/index.d.ts +0 -1
  246. package/utils/rules/index.es6.js +0 -1
  247. package/utils/rules/index.js +0 -1
  248. package/utils/rules/int/int.es6.js +17 -4
  249. package/utils/rules/int/int.js +17 -4
  250. package/utils/rules/max/max.d.ts +1 -1
  251. package/utils/rules/max/max.es6.js +10 -4
  252. package/utils/rules/max/max.js +10 -4
  253. package/utils/rules/maxBin/maxBin.es6.js +5 -2
  254. package/utils/rules/maxBin/maxBin.js +5 -2
  255. package/utils/rules/maxDate/maxDate.es6.js +5 -1
  256. package/utils/rules/maxDate/maxDate.js +5 -1
  257. package/utils/rules/maxLength/maxLength.es6.js +5 -2
  258. package/utils/rules/maxLength/maxLength.js +5 -2
  259. package/utils/rules/min/min.d.ts +1 -1
  260. package/utils/rules/min/min.es6.js +10 -4
  261. package/utils/rules/min/min.js +10 -4
  262. package/utils/rules/minBin/minBin.es6.js +5 -2
  263. package/utils/rules/minBin/minBin.js +5 -2
  264. package/utils/rules/minDate/minDate.es6.js +5 -1
  265. package/utils/rules/minDate/minDate.js +5 -1
  266. package/utils/rules/minLength/minLength.es6.js +5 -2
  267. package/utils/rules/minLength/minLength.js +5 -2
  268. package/utils/rules/num/num.es6.js +4 -1
  269. package/utils/rules/num/num.js +4 -1
  270. package/utils/rules/objectOf/objectOf.d.ts +1 -1
  271. package/utils/rules/objectOf/objectOf.es6.js +16 -3
  272. package/utils/rules/objectOf/objectOf.js +16 -3
  273. package/utils/rules/pattern/pattern.d.ts +1 -1
  274. package/utils/rules/pattern/pattern.es6.js +6 -1
  275. package/utils/rules/pattern/pattern.js +6 -1
  276. package/utils/rules/tupleOf/tupleOf.es6.js +1 -1
  277. package/utils/rules/tupleOf/tupleOf.js +1 -1
  278. package/utils/rules/values/values.es6.js +5 -2
  279. package/utils/rules/values/values.js +5 -2
  280. package/utils/stringifySearch/stringifySearch.es6.js +4 -1
  281. package/utils/stringifySearch/stringifySearch.js +4 -1
  282. package/example/app/App/App.d.ts +0 -1
  283. package/example/app/App/index.d.ts +0 -1
  284. package/example/index.d.ts +0 -1
  285. package/example/requests/index.d.ts +0 -1
  286. package/example/requests/todo/AddTodo/AddTodo.d.ts +0 -1
  287. package/example/requests/todo/AddTodo/index.d.ts +0 -1
  288. package/example/requests/todo/DeleteTodo/DeleteTodo.d.ts +0 -1
  289. package/example/requests/todo/DeleteTodo/index.d.ts +0 -1
  290. package/example/requests/todo/EditTodo/EditTodo.d.ts +0 -1
  291. package/example/requests/todo/EditTodo/index.d.ts +0 -1
  292. package/example/requests/todo/GetTodo/GetTodo.d.ts +0 -1
  293. package/example/requests/todo/GetTodo/index.d.ts +0 -1
  294. package/example/requests/todo/GetTodos/GetTodos.d.ts +0 -1
  295. package/example/requests/todo/GetTodos/index.d.ts +0 -1
  296. package/example/requests/todo/index.d.ts +0 -5
  297. package/example/requests/todo/todos.d.ts +0 -1
  298. package/example/schemas/app/ListQueryParams/ListQueryParams.d.ts +0 -1
  299. package/example/schemas/app/ListQueryParams/index.d.ts +0 -1
  300. package/example/schemas/app/ListSchema/ListSchema.d.ts +0 -4
  301. package/example/schemas/app/ListSchema/index.d.ts +0 -1
  302. package/example/schemas/app/index.d.ts +0 -2
  303. package/example/schemas/index.d.ts +0 -2
  304. package/example/schemas/todo/TodoSchema/TodoSchema.d.ts +0 -4
  305. package/example/schemas/todo/TodoSchema/index.d.ts +0 -1
  306. package/example/schemas/todo/index.d.ts +0 -1
  307. package/example/tags/Todo/Todo.d.ts +0 -1
  308. package/example/tags/Todo/index.d.ts +0 -1
  309. package/example/tags/index.d.ts +0 -1
  310. package/hooks/useRequestPlugin/index.d.ts +0 -1
  311. package/hooks/useRequestPlugin/index.es6.js +0 -1
  312. package/hooks/useRequestPlugin/index.js +0 -9
  313. package/hooks/useRequestPlugin/useRequestPlugin.d.ts +0 -2
  314. package/hooks/useRequestPlugin/useRequestPlugin.es6.js +0 -13
  315. package/hooks/useRequestPlugin/useRequestPlugin.js +0 -17
  316. package/openApi.test.d.ts +0 -1
  317. package/plugins/main/fallback/fallback.d.ts +0 -4
  318. package/plugins/main/fallback/fallback.es6.js +0 -19
  319. package/plugins/main/fallback/fallback.js +0 -23
  320. package/plugins/main/fallback/index.d.ts +0 -1
  321. package/plugins/main/fallback/index.es6.js +0 -1
  322. package/plugins/main/fallback/index.js +0 -9
  323. package/plugins/main/request/index.d.ts +0 -1
  324. package/plugins/main/request/index.es6.js +0 -1
  325. package/plugins/main/request/index.js +0 -9
  326. package/plugins/main/request/request.d.ts +0 -4
  327. package/plugins/main/request/request.es6.js +0 -21
  328. package/plugins/main/request/request.js +0 -25
  329. package/plugins/utils/dev/dev.d.ts +0 -4
  330. package/plugins/utils/dev/dev.es6.js +0 -10
  331. package/plugins/utils/dev/index.d.ts +0 -1
  332. package/plugins/utils/dev/index.es6.js +0 -1
  333. package/plugins/utils/prod/index.d.ts +0 -1
  334. package/plugins/utils/prod/index.es6.js +0 -1
  335. package/plugins/utils/prod/prod.d.ts +0 -4
  336. package/plugins/utils/prod/prod.es6.js +0 -10
  337. package/utils/decorators/once/once.test.d.ts +0 -1
  338. package/utils/generateTypes/generateTypes.test.d.ts +0 -1
  339. package/utils/parseSearch/parseSearch.test.d.ts +0 -1
  340. package/utils/rules/any/any.d.ts +0 -1
  341. package/utils/rules/any/any.es6.js +0 -5
  342. package/utils/rules/any/any.js +0 -9
  343. /package/{utils/rules → plugins/schema}/any/index.d.ts +0 -0
  344. /package/{utils/rules → plugins/schema}/any/index.es6.js +0 -0
  345. /package/{utils/rules → plugins/schema}/any/index.js +0 -0
@@ -2,63 +2,65 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var tslib = require('tslib');
6
5
  var innet = require('innet');
7
- var watchState = require('watch-state');
6
+ var jsx = require('@innet/jsx');
8
7
  require('../../../hooks/index.js');
9
8
  require('../../../utils/index.js');
10
9
  require('../../../utils/rules/index.js');
11
- var useServer = require('../../../hooks/useServer/useServer.js');
10
+ var useServerPlugins = require('../../../hooks/useServerPlugins/useServerPlugins.js');
12
11
  var useApi = require('../../../hooks/useApi/useApi.js');
13
- var Action = require('../../../utils/action/Action.js');
12
+ var useServerPlugin = require('../../../hooks/useServerPlugin/useServerPlugin.js');
13
+ var useAction = require('../../../hooks/useAction/useAction.js');
14
14
  var JSONString = require('../../../utils/JSONString/JSONString.js');
15
15
  var helpers = require('../../../utils/rules/helpers.js');
16
- var useResponse = require('../../../hooks/useResponse/useResponse.js');
17
- var useRequest = require('../../../hooks/useRequest/useRequest.js');
18
16
  var useParams = require('../../../hooks/useParams/useParams.js');
19
- var useAction = require('../../../hooks/useAction/useAction.js');
20
17
 
21
18
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
22
19
 
23
20
  var innet__default = /*#__PURE__*/_interopDefaultLegacy(innet);
24
21
 
25
22
  const api = () => {
26
- var _a;
27
23
  const handler = innet.useNewHandler();
28
- const { props = {}, children } = innet.useApp();
29
- const { server } = useServer.useServer();
30
- const { prefix = '', title = '' } = props, rest = tslib.__rest(props, ["prefix", "title"]);
31
- const info = Object.assign(Object.assign({}, rest), { version: (_a = rest.version) !== null && _a !== void 0 ? _a : '0.0.0', title });
24
+ const props = jsx.useProps();
25
+ const { children, exclude, include, prefix = process.env.INNET_API_PREFIX || '', title = '', version = process.env.INNET_API_VERSION || '0.0.0', ...rest } = props;
26
+ const info = { ...rest, title, version };
32
27
  const endpoints = {};
33
28
  const docs = {
34
- openapi: '3.1.0',
35
29
  info,
30
+ openapi: '3.1.0',
36
31
  paths: {},
37
32
  };
38
- const requestPlugins = new Set();
39
- const context = { docs, endpoints, prefix, requestPlugins, refRules: {} };
33
+ const plugins = new Set();
34
+ const context = { docs, endpoints, prefix, refRules: {} };
35
+ const condition = (action) => {
36
+ const path = action.parsedUrl.path;
37
+ const url = path.endsWith('/') ? path.slice(0, -1) : path;
38
+ if (!url.startsWith(prefix) || (exclude === null || exclude === void 0 ? void 0 : exclude.test(url))) {
39
+ return false;
40
+ }
41
+ if (include && !include.test(url)) {
42
+ return false;
43
+ }
44
+ return true;
45
+ };
46
+ useServerPlugins.serverPlugins.set(handler, plugins);
40
47
  useApi.apiContext.set(handler, context);
41
- const listener = (req, res) => tslib.__awaiter(void 0, void 0, void 0, function* () {
42
- var _b, _c, _d, _e, _f, _g;
43
- if (res.writableEnded)
48
+ useServerPlugin.useServerPlugin(async () => {
49
+ var _a, _b, _c, _d, _e, _f;
50
+ const action = useAction.useAction();
51
+ if (!condition(action))
44
52
  return;
45
- const action = new Action.Action(req, res);
53
+ const actionHandler = innet.useNewHandler();
46
54
  const path = action.parsedUrl.path;
47
55
  const url = path.endsWith('/') ? path.slice(0, -1) : path;
56
+ const { req, res, } = action;
48
57
  if (url === (prefix || '')) {
49
58
  res.setHeader('Content-Type', 'application/json');
50
59
  res.write(JSONString.JSONString(docs));
51
60
  res.end();
52
- return;
61
+ return null;
53
62
  }
54
- if (!url.startsWith(prefix)) {
55
- return;
56
- }
57
- for (const requestPlugin of requestPlugins) {
58
- if (requestPlugin(action))
59
- return;
60
- }
61
- const method = ((_c = (_b = req.method) === null || _b === void 0 ? void 0 : _b.toLowerCase()) !== null && _c !== void 0 ? _c : 'get');
63
+ const method = ((_b = (_a = req.method) === null || _a === void 0 ? void 0 : _a.toLowerCase()) !== null && _b !== void 0 ? _b : 'get');
62
64
  const rawSplitPath = url.slice(prefix.length).split('/').slice(1);
63
65
  const splitPath = rawSplitPath.at(-1) ? rawSplitPath : rawSplitPath.slice(0, -1);
64
66
  const endpoint = endpoints[method];
@@ -67,121 +69,118 @@ const api = () => {
67
69
  const [deep, currentEndpoint, params] = endpointQueue.shift();
68
70
  const key = splitPath[deep];
69
71
  if (deep + 1 === splitPath.length) {
70
- function run(runEndpoint, params) {
72
+ async function run(runEndpoint, params) {
71
73
  var _a, _b, _c, _d, _e;
72
- return tslib.__awaiter(this, void 0, void 0, function* () {
73
- const pathRules = (_a = runEndpoint.rules) === null || _a === void 0 ? void 0 : _a.path;
74
- const headerRules = (_b = runEndpoint.rules) === null || _b === void 0 ? void 0 : _b.header;
75
- const cookieRules = (_c = runEndpoint.rules) === null || _c === void 0 ? void 0 : _c.cookie;
76
- const searchRules = (_d = runEndpoint.rules) === null || _d === void 0 ? void 0 : _d.search;
77
- const bodyRules = (_e = runEndpoint.rules) === null || _e === void 0 ? void 0 : _e.body;
78
- if (pathRules) {
74
+ const pathRules = (_a = runEndpoint.rules) === null || _a === void 0 ? void 0 : _a.path;
75
+ const headerRules = (_b = runEndpoint.rules) === null || _b === void 0 ? void 0 : _b.header;
76
+ const cookieRules = (_c = runEndpoint.rules) === null || _c === void 0 ? void 0 : _c.cookie;
77
+ const searchRules = (_d = runEndpoint.rules) === null || _d === void 0 ? void 0 : _d.search;
78
+ const bodyRules = (_e = runEndpoint.rules) === null || _e === void 0 ? void 0 : _e.body;
79
+ if (pathRules) {
80
+ try {
81
+ Object.assign(params, pathRules(params, { in: 'path' }));
82
+ }
83
+ catch (_f) {
84
+ return false;
85
+ }
86
+ }
87
+ function checkActionRules(rules, key = 'search') {
88
+ if (rules) {
79
89
  try {
80
- Object.assign(params, pathRules(params, { in: 'path' }));
90
+ action[key] = rules(action[key]);
81
91
  }
82
- catch (_f) {
83
- return false;
84
- }
85
- }
86
- function checkActionRules(rules, key = 'search') {
87
- if (rules) {
88
- try {
89
- action[key] = rules(action[key]);
92
+ catch (e) {
93
+ res.setHeader('Content-Type', 'application/json');
94
+ if (e instanceof helpers.RulesError) {
95
+ res.statusCode = 400;
96
+ res.write(JSONString.JSONString({
97
+ data: {
98
+ ...e.data,
99
+ in: key,
100
+ },
101
+ error: 'requestValidation',
102
+ }));
103
+ res.end();
90
104
  }
91
- catch (e) {
92
- res.setHeader('Content-Type', 'application/json');
93
- if (e instanceof helpers.RulesError) {
94
- res.statusCode = 400;
95
- res.write(JSONString.JSONString({
96
- error: 'requestValidation',
97
- data: Object.assign(Object.assign({}, e.data), { in: key }),
98
- }));
99
- res.end();
100
- }
101
- else {
102
- console.error(e);
103
- res.statusCode = 500;
104
- res.write(JSONString.JSONString({
105
- error: 'unknown',
106
- data: { in: key },
107
- }));
108
- res.end();
109
- }
110
- return true;
105
+ else {
106
+ console.error(e);
107
+ res.statusCode = 500;
108
+ res.write(JSONString.JSONString({
109
+ data: { in: key },
110
+ error: 'unknown',
111
+ }));
112
+ res.end();
111
113
  }
114
+ return true;
112
115
  }
113
- return false;
114
116
  }
115
- if (checkActionRules(headerRules, 'headers'))
116
- return true;
117
- if (checkActionRules(cookieRules, 'cookies'))
118
- return true;
119
- if (checkActionRules(searchRules, 'search'))
117
+ return false;
118
+ }
119
+ if (checkActionRules(headerRules, 'headers'))
120
+ return true;
121
+ if (checkActionRules(cookieRules, 'cookies'))
122
+ return true;
123
+ if (checkActionRules(searchRules, 'search'))
124
+ return true;
125
+ if (bodyRules) {
126
+ await action.parseBody();
127
+ if (!action.body) {
128
+ res.statusCode = 400;
129
+ res.setHeader('Content-Type', 'application/json');
130
+ res.write(JSONString.JSONString({
131
+ error: 'requestBodyContentType',
132
+ }));
133
+ res.end();
120
134
  return true;
121
- if (bodyRules) {
122
- yield action.parseBody();
123
- if (!action.body) {
124
- res.statusCode = 400;
125
- res.setHeader('Content-Type', 'application/json');
126
- res.write(JSONString.JSONString({
127
- error: 'requestBodyContentType',
128
- }));
129
- res.end();
130
- return true;
131
- }
132
- if (checkActionRules(bodyRules, 'body'))
133
- return true;
134
135
  }
135
- const newHandler = Object.create(runEndpoint.handler);
136
- useResponse.responseContext.set(newHandler, res);
137
- useRequest.requestContext.set(newHandler, req);
138
- useParams.paramsContext.set(newHandler, params);
139
- useAction.actionContext.set(newHandler, action);
140
- innet__default["default"](runEndpoint.content, newHandler);
136
+ if (checkActionRules(bodyRules, 'body'))
137
+ return true;
138
+ }
139
+ useParams.paramsContext.set(actionHandler, params);
140
+ for (const plugin of runEndpoint.plugins) {
141
+ const result = await plugin();
142
+ if (result === undefined)
143
+ continue;
144
+ innet__default["default"](result, actionHandler);
141
145
  return true;
142
- });
146
+ }
147
+ return true;
143
148
  }
144
- if ((_e = (_d = currentEndpoint.static) === null || _d === void 0 ? void 0 : _d[key]) === null || _e === void 0 ? void 0 : _e.content) {
145
- if (!(yield run((_f = currentEndpoint.static) === null || _f === void 0 ? void 0 : _f[key], params)))
149
+ if ((_d = (_c = currentEndpoint.static) === null || _c === void 0 ? void 0 : _c[key]) === null || _d === void 0 ? void 0 : _d.plugins) {
150
+ if (!await run((_e = currentEndpoint.static) === null || _e === void 0 ? void 0 : _e[key], params))
146
151
  continue;
147
- return;
152
+ return null;
148
153
  }
149
154
  if (currentEndpoint.dynamic) {
150
155
  for (const dynamicEndpoint of currentEndpoint.dynamic) {
151
- if (dynamicEndpoint.content) {
152
- if (!(yield run(dynamicEndpoint, Object.assign(Object.assign({}, params), { [dynamicEndpoint.key.slice(1, -1)]: key }))))
156
+ if (dynamicEndpoint.plugins) {
157
+ if (!await run(dynamicEndpoint, { ...params, [dynamicEndpoint.key.slice(1, -1)]: key }))
153
158
  continue;
154
- return;
159
+ return null;
155
160
  }
156
161
  }
157
162
  }
158
163
  break;
159
164
  }
160
- if ((_g = currentEndpoint.static) === null || _g === void 0 ? void 0 : _g[key]) {
165
+ if ((_f = currentEndpoint.static) === null || _f === void 0 ? void 0 : _f[key]) {
161
166
  endpointQueue.push([deep + 1, currentEndpoint.static[key], params]);
162
167
  }
163
168
  if (currentEndpoint.dynamic) {
164
169
  for (const dynamicEndpoint of currentEndpoint.dynamic) {
165
- endpointQueue.push([deep + 1, dynamicEndpoint, Object.assign(Object.assign({}, params), { [dynamicEndpoint.key.slice(1, -1)]: key })]);
170
+ endpointQueue.push([deep + 1, dynamicEndpoint, { ...params, [dynamicEndpoint.key.slice(1, -1)]: key }]);
166
171
  }
167
172
  }
168
173
  }
169
- if (context.fallback) {
170
- const newHandler = Object.create(context.fallback.handler);
171
- useResponse.responseContext.set(newHandler, res);
172
- useRequest.requestContext.set(newHandler, req);
174
+ for (const plugin of plugins) {
175
+ const result = await plugin();
176
+ if (result === undefined)
177
+ continue;
178
+ const newHandler = Object.create(handler);
173
179
  useAction.actionContext.set(newHandler, action);
174
- innet__default["default"](context.fallback.children, newHandler);
175
- }
176
- else {
177
- res.statusCode = 404;
178
- res.end();
180
+ innet__default["default"](result, newHandler);
181
+ return null;
179
182
  }
180
183
  });
181
- server.on('request', listener);
182
- watchState.onDestroy(() => {
183
- server.off('request', listener);
184
- });
185
184
  innet__default["default"](children, handler);
186
185
  };
187
186
 
@@ -1,4 +1,5 @@
1
1
  import { type HandlerPlugin } from 'innet';
2
2
  export interface BodyProps {
3
+ children?: any;
3
4
  }
4
5
  export declare const body: HandlerPlugin;
@@ -1,10 +1,10 @@
1
1
  import { type HandlerPlugin } from 'innet';
2
2
  export interface ContactProps {
3
+ /** The email address of the contact person/organization. This MUST be in the form of an email address. */
4
+ email?: string;
3
5
  /** The identifying name of the contact person/organization. */
4
6
  name?: string;
5
7
  /** The URL pointing to the contact information. This MUST be in the form of a URL. */
6
8
  url?: string;
7
- /** The email address of the contact person/organization. This MUST be in the form of an email address. */
8
- email?: string;
9
9
  }
10
10
  export declare const contact: HandlerPlugin;
@@ -1,10 +1,27 @@
1
1
  import { type HandlerPlugin } from 'innet';
2
2
  import { type EndpointsMethods } from '../../../types';
3
3
  export interface EndpointProps {
4
+ children?: any;
5
+ /**
6
+ * Declares this operation to be deprecated.
7
+ * Consumers SHOULD refrain from usage of the declared operation.
8
+ * Default value is false.
9
+ * */
10
+ deprecated?: boolean;
11
+ /**
12
+ * An optional, string description, intended to apply to all operations in this path.
13
+ * [CommonMark syntax](https://spec.commonmark.org) MAY be used for rich text representation.
14
+ * */
15
+ description?: string;
4
16
  /**
5
17
  * A method of the endpoint.
6
18
  * */
7
19
  method: EndpointsMethods;
20
+ /**
21
+ * `operationId` is an optional unique string used to identify an operation.
22
+ * If provided, these IDs must be unique among all operations described in your API.
23
+ * */
24
+ operationId?: string;
8
25
  /**
9
26
  * A relative path to an individual endpoint.
10
27
  * The property MUST begin with a forward slash (/).
@@ -13,25 +30,14 @@ export interface EndpointProps {
13
30
  * Templated paths with the same hierarchy but different templated names MUST NOT exist as they are identical.
14
31
  * */
15
32
  path: string;
16
- /**
17
- * An optional, string summary, intended to apply to all operations in this path.
18
- * */
19
- summary?: string;
20
- /**
21
- * An optional, string description, intended to apply to all operations in this path.
22
- * [CommonMark syntax](https://spec.commonmark.org) MAY be used for rich text representation.
23
- * */
24
- description?: string;
25
- /**
26
- * Declares this operation to be deprecated.
27
- * Consumers SHOULD refrain from usage of the declared operation.
28
- * Default value is false.
29
- * */
30
- deprecated?: boolean;
31
33
  /**
32
34
  * Declares this operation to make an endpoint private.
33
35
  * That means the endpoint should not be described and will not be shown in the Open API documentation.
34
36
  * */
35
37
  private?: boolean;
38
+ /**
39
+ * An optional, string summary, intended to apply to all operations in this path.
40
+ * */
41
+ summary?: string;
36
42
  }
37
43
  export declare const endpoint: HandlerPlugin;
@@ -1,26 +1,25 @@
1
1
  import innet, { useNewHandler } from 'innet';
2
- import { useProps, useChildren } from '@innet/jsx';
2
+ import { useProps } from '@innet/jsx';
3
3
  import '../../../hooks/index.es6.js';
4
4
  import '../../../utils/index.es6.js';
5
5
  import { useTag } from '../../../hooks/useTag/useTag.es6.js';
6
6
  import { useApi } from '../../../hooks/useApi/useApi.es6.js';
7
7
  import { getEndpoint } from '../../../utils/getEndpoint/getEndpoint.es6.js';
8
8
  import { endpointContext } from '../../../hooks/useEndpoint/useEndpoint.es6.js';
9
+ import { serverPlugins } from '../../../hooks/useServerPlugins/useServerPlugins.es6.js';
9
10
 
10
11
  const endpoint = () => {
11
12
  const handler = useNewHandler();
12
13
  const tag = useTag();
13
- const { docs, endpoints } = useApi();
14
14
  const props = useProps();
15
- const { path, summary, description, deprecated, method, private: privateMode } = props;
16
- const children = useChildren();
15
+ const { docs, endpoints, } = useApi();
16
+ const { children, deprecated, description, method, operationId, path, private: privateMode, summary, } = props;
17
17
  const { paths } = docs;
18
18
  if (!paths)
19
19
  throw Error('cannot find paths in docs');
20
20
  if (!paths[path]) {
21
21
  paths[path] = {};
22
22
  }
23
- // @ts-expect-error: it's always an object
24
23
  if (paths[path][method]) {
25
24
  throw Error(`You cannot use the same endpoints ${method}:${path}`);
26
25
  }
@@ -28,6 +27,9 @@ const endpoint = () => {
28
27
  if (summary) {
29
28
  operation.summary = summary;
30
29
  }
30
+ if (operationId) {
31
+ operation.operationId = operationId;
32
+ }
31
33
  if (description) {
32
34
  operation.description = description;
33
35
  }
@@ -38,16 +40,16 @@ const endpoint = () => {
38
40
  operation.tags = [tag.name];
39
41
  }
40
42
  if (!privateMode) {
41
- // @ts-expect-error: it's always an object
42
43
  paths[path][method] = operation;
43
44
  }
44
45
  if (!endpoints[method]) {
45
- endpoints[method] = { key: '' };
46
+ endpoints[method] = { key: '', plugins: new Set() };
46
47
  }
47
- // @ts-expect-error: it's always an object
48
48
  const endpoint = getEndpoint(path, endpoints[method]);
49
49
  // @ts-expect-error: it's always an object
50
- endpointContext.set(handler, { operation, props, endpoint });
50
+ endpointContext.set(handler, { endpoint, operation, props });
51
+ // @ts-expect-error: it's always an object
52
+ serverPlugins.set(handler, endpoint.plugins);
51
53
  innet(children, handler);
52
54
  };
53
55
 
@@ -10,6 +10,7 @@ var useTag = require('../../../hooks/useTag/useTag.js');
10
10
  var useApi = require('../../../hooks/useApi/useApi.js');
11
11
  var getEndpoint = require('../../../utils/getEndpoint/getEndpoint.js');
12
12
  var useEndpoint = require('../../../hooks/useEndpoint/useEndpoint.js');
13
+ var useServerPlugins = require('../../../hooks/useServerPlugins/useServerPlugins.js');
13
14
 
14
15
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
15
16
 
@@ -18,17 +19,15 @@ var innet__default = /*#__PURE__*/_interopDefaultLegacy(innet);
18
19
  const endpoint = () => {
19
20
  const handler = innet.useNewHandler();
20
21
  const tag = useTag.useTag();
21
- const { docs, endpoints } = useApi.useApi();
22
22
  const props = jsx.useProps();
23
- const { path, summary, description, deprecated, method, private: privateMode } = props;
24
- const children = jsx.useChildren();
23
+ const { docs, endpoints, } = useApi.useApi();
24
+ const { children, deprecated, description, method, operationId, path, private: privateMode, summary, } = props;
25
25
  const { paths } = docs;
26
26
  if (!paths)
27
27
  throw Error('cannot find paths in docs');
28
28
  if (!paths[path]) {
29
29
  paths[path] = {};
30
30
  }
31
- // @ts-expect-error: it's always an object
32
31
  if (paths[path][method]) {
33
32
  throw Error(`You cannot use the same endpoints ${method}:${path}`);
34
33
  }
@@ -36,6 +35,9 @@ const endpoint = () => {
36
35
  if (summary) {
37
36
  operation.summary = summary;
38
37
  }
38
+ if (operationId) {
39
+ operation.operationId = operationId;
40
+ }
39
41
  if (description) {
40
42
  operation.description = description;
41
43
  }
@@ -46,16 +48,16 @@ const endpoint = () => {
46
48
  operation.tags = [tag.name];
47
49
  }
48
50
  if (!privateMode) {
49
- // @ts-expect-error: it's always an object
50
51
  paths[path][method] = operation;
51
52
  }
52
53
  if (!endpoints[method]) {
53
- endpoints[method] = { key: '' };
54
+ endpoints[method] = { key: '', plugins: new Set() };
54
55
  }
55
- // @ts-expect-error: it's always an object
56
56
  const endpoint = getEndpoint.getEndpoint(path, endpoints[method]);
57
57
  // @ts-expect-error: it's always an object
58
- useEndpoint.endpointContext.set(handler, { operation, props, endpoint });
58
+ useEndpoint.endpointContext.set(handler, { endpoint, operation, props });
59
+ // @ts-expect-error: it's always an object
60
+ useServerPlugins.serverPlugins.set(handler, endpoint.plugins);
59
61
  innet__default["default"](children, handler);
60
62
  };
61
63
 
@@ -1,5 +1,10 @@
1
1
  import { type HandlerPlugin } from 'innet';
2
2
  export interface HostProps {
3
+ /**
4
+ * An optional string describing the host designated by the URL.
5
+ * [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation.
6
+ * */
7
+ description?: string;
3
8
  /**
4
9
  * A URL to the target host.
5
10
  * This URL supports Server Variables and MAY be relative,
@@ -7,10 +12,5 @@ export interface HostProps {
7
12
  * Variable substitutions will be made when a variable is named in {brackets}.
8
13
  * */
9
14
  url: string;
10
- /**
11
- * An optional string describing the host designated by the URL.
12
- * [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation.
13
- * */
14
- description?: string;
15
15
  }
16
16
  export declare const host: HandlerPlugin;
@@ -16,7 +16,9 @@ const host = () => {
16
16
  target.servers = [];
17
17
  }
18
18
  const { servers } = operation || docs;
19
- const server = Object.assign({}, props);
19
+ const server = {
20
+ ...props,
21
+ };
20
22
  // @ts-expect-error: FIXME
21
23
  servers.push(server);
22
24
  handler[hostContext.key] = { server };
@@ -24,7 +24,9 @@ const host = () => {
24
24
  target.servers = [];
25
25
  }
26
26
  const { servers } = operation || docs;
27
- const server = Object.assign({}, props);
27
+ const server = {
28
+ ...props,
29
+ };
28
30
  // @ts-expect-error: FIXME
29
31
  servers.push(server);
30
32
  handler[useHost.hostContext.key] = { server };
@@ -7,7 +7,7 @@ export * from './variable';
7
7
  export * from './tag';
8
8
  export * from './endpoint';
9
9
  export * from './response';
10
- export * from './request';
10
+ export * from './return';
11
11
  export * from './param';
12
12
  export * from './body';
13
- export * from './fallback';
13
+ export * from './preset';
@@ -7,7 +7,7 @@ import './variable/index.es6.js';
7
7
  import './tag/index.es6.js';
8
8
  import './endpoint/index.es6.js';
9
9
  import './response/index.es6.js';
10
- import './request/index.es6.js';
10
+ import './return/index.es6.js';
11
11
  import './param/index.es6.js';
12
12
  import './body/index.es6.js';
13
- import './fallback/index.es6.js';
13
+ import './preset/index.es6.js';
@@ -9,8 +9,8 @@ require('./variable/index.js');
9
9
  require('./tag/index.js');
10
10
  require('./endpoint/index.js');
11
11
  require('./response/index.js');
12
- require('./request/index.js');
12
+ require('./return/index.js');
13
13
  require('./param/index.js');
14
14
  require('./body/index.js');
15
- require('./fallback/index.js');
15
+ require('./preset/index.js');
16
16
 
@@ -1,16 +1,16 @@
1
1
  import { type HandlerPlugin } from 'innet';
2
2
  export interface LicenseProps {
3
- /**
4
- * The license name used for the API.
5
- * @example: Apache 2.0
6
- * */
7
- name: string;
8
3
  /**
9
4
  * An [SPDX](https://spdx.org/spdx-specification-21-web-version#h.jxpfx0ykyb60) license expression for the API.
10
5
  * The `identifier` field is mutually exclusive of the `url` field.
11
6
  * @example: Apache-2.0
12
7
  * */
13
8
  identifier?: string;
9
+ /**
10
+ * The license name used for the API.
11
+ * @example: Apache 2.0
12
+ * */
13
+ name: string;
14
14
  /**
15
15
  * A URL to the license used for the API.
16
16
  * This MUST be in the form of a URL.
@@ -1,6 +1,18 @@
1
1
  import { type HandlerPlugin } from 'innet';
2
2
  import { type InParam } from '../../../types';
3
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;
4
16
  /**
5
17
  * The location of the parameter.
6
18
  * Possible values are "query", "header", "path" or "cookie".
@@ -14,22 +26,11 @@ export interface ParamProps {
14
26
  * - For all other cases, the `name` corresponds to the parameter name used by the `in` property.
15
27
  * */
16
28
  name: string;
17
- /**
18
- * A brief description of the parameter.
19
- * This could contain examples of use.
20
- * [CommonMark syntax](https://spec.commonmark.org) MAY be used for rich text representation.
21
- * */
22
- description?: string;
23
29
  /**
24
30
  * Determines whether this parameter is mandatory.
25
31
  * If the parameter location is "path", this property is `true` and its value MUST be `true`.
26
32
  * Otherwise, the property MAY be included and its default value is `false`.
27
33
  * */
28
34
  required?: boolean;
29
- /**
30
- * Specifies that a parameter is deprecated and SHOULD be transitioned out of usage.
31
- * Default value is `false`.
32
- * */
33
- deprecated?: boolean;
34
35
  }
35
36
  export declare const param: HandlerPlugin;