@rapidrest/service-core 1.0.0-beta.1

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 (332) hide show
  1. package/LICENSE +23 -0
  2. package/README.md +16 -0
  3. package/dist/lib/ApiErrors.js +41 -0
  4. package/dist/lib/ApiErrors.js.map +1 -0
  5. package/dist/lib/BackgroundService.js +16 -0
  6. package/dist/lib/BackgroundService.js.map +1 -0
  7. package/dist/lib/BackgroundServiceManager.js +135 -0
  8. package/dist/lib/BackgroundServiceManager.js.map +1 -0
  9. package/dist/lib/BulkError.js +24 -0
  10. package/dist/lib/BulkError.js.map +1 -0
  11. package/dist/lib/EventListenerManager.js +161 -0
  12. package/dist/lib/EventListenerManager.js.map +1 -0
  13. package/dist/lib/NetUtils.js +103 -0
  14. package/dist/lib/NetUtils.js.map +1 -0
  15. package/dist/lib/NotificationUtils.js +34 -0
  16. package/dist/lib/NotificationUtils.js.map +1 -0
  17. package/dist/lib/ObjectFactory.js +90 -0
  18. package/dist/lib/ObjectFactory.js.map +1 -0
  19. package/dist/lib/OpenApiSpec.js +748 -0
  20. package/dist/lib/OpenApiSpec.js.map +1 -0
  21. package/dist/lib/Server.js +549 -0
  22. package/dist/lib/Server.js.map +1 -0
  23. package/dist/lib/Types.js +2 -0
  24. package/dist/lib/Types.js.map +1 -0
  25. package/dist/lib/auth/AuthMiddleware.js +229 -0
  26. package/dist/lib/auth/AuthMiddleware.js.map +1 -0
  27. package/dist/lib/auth/AuthStrategy.js +2 -0
  28. package/dist/lib/auth/AuthStrategy.js.map +1 -0
  29. package/dist/lib/auth/BasicStrategy.js +106 -0
  30. package/dist/lib/auth/BasicStrategy.js.map +1 -0
  31. package/dist/lib/auth/JWTStrategy.js +161 -0
  32. package/dist/lib/auth/JWTStrategy.js.map +1 -0
  33. package/dist/lib/auth/index.js +5 -0
  34. package/dist/lib/auth/index.js.map +1 -0
  35. package/dist/lib/database/ConnectionKinds.js +14 -0
  36. package/dist/lib/database/ConnectionKinds.js.map +1 -0
  37. package/dist/lib/database/ConnectionManager.js +161 -0
  38. package/dist/lib/database/ConnectionManager.js.map +1 -0
  39. package/dist/lib/database/MongoConnection.js +86 -0
  40. package/dist/lib/database/MongoConnection.js.map +1 -0
  41. package/dist/lib/database/MongoRepository.js +136 -0
  42. package/dist/lib/database/MongoRepository.js.map +1 -0
  43. package/dist/lib/database/MongoSchemaSync.js +136 -0
  44. package/dist/lib/database/MongoSchemaSync.js.map +1 -0
  45. package/dist/lib/database/NamingUtils.js +52 -0
  46. package/dist/lib/database/NamingUtils.js.map +1 -0
  47. package/dist/lib/database/TypeOrmSupport.js +146 -0
  48. package/dist/lib/database/TypeOrmSupport.js.map +1 -0
  49. package/dist/lib/database/index.js +7 -0
  50. package/dist/lib/database/index.js.map +1 -0
  51. package/dist/lib/decorators/DatabaseDecorators.js +52 -0
  52. package/dist/lib/decorators/DatabaseDecorators.js.map +1 -0
  53. package/dist/lib/decorators/DocDecorators.js +120 -0
  54. package/dist/lib/decorators/DocDecorators.js.map +1 -0
  55. package/dist/lib/decorators/EventDecorators.js +24 -0
  56. package/dist/lib/decorators/EventDecorators.js.map +1 -0
  57. package/dist/lib/decorators/ModelDecorators.js +173 -0
  58. package/dist/lib/decorators/ModelDecorators.js.map +1 -0
  59. package/dist/lib/decorators/PersistenceDecorators.js +177 -0
  60. package/dist/lib/decorators/PersistenceDecorators.js.map +1 -0
  61. package/dist/lib/decorators/RouteDecorators.js +324 -0
  62. package/dist/lib/decorators/RouteDecorators.js.map +1 -0
  63. package/dist/lib/decorators/index.js +7 -0
  64. package/dist/lib/decorators/index.js.map +1 -0
  65. package/dist/lib/http/Adapters.js +230 -0
  66. package/dist/lib/http/Adapters.js.map +1 -0
  67. package/dist/lib/http/Router.js +403 -0
  68. package/dist/lib/http/Router.js.map +1 -0
  69. package/dist/lib/http/WebSocket.js +82 -0
  70. package/dist/lib/http/WebSocket.js.map +1 -0
  71. package/dist/lib/http/index.js +4 -0
  72. package/dist/lib/http/index.js.map +1 -0
  73. package/dist/lib/http/types.js +5 -0
  74. package/dist/lib/http/types.js.map +1 -0
  75. package/dist/lib/index.js +18 -0
  76. package/dist/lib/index.js.map +1 -0
  77. package/dist/lib/models/BaseEntity.js +83 -0
  78. package/dist/lib/models/BaseEntity.js.map +1 -0
  79. package/dist/lib/models/BaseMongoEntity.js +40 -0
  80. package/dist/lib/models/BaseMongoEntity.js.map +1 -0
  81. package/dist/lib/models/ModelUtils.js +645 -0
  82. package/dist/lib/models/ModelUtils.js.map +1 -0
  83. package/dist/lib/models/RecoverableBaseEntity.js +39 -0
  84. package/dist/lib/models/RecoverableBaseEntity.js.map +1 -0
  85. package/dist/lib/models/RecoverableBaseMongoEntity.js +40 -0
  86. package/dist/lib/models/RecoverableBaseMongoEntity.js.map +1 -0
  87. package/dist/lib/models/RepoUtils.js +717 -0
  88. package/dist/lib/models/RepoUtils.js.map +1 -0
  89. package/dist/lib/models/SimpleEntity.js +42 -0
  90. package/dist/lib/models/SimpleEntity.js.map +1 -0
  91. package/dist/lib/models/SimpleMongoEntity.js +38 -0
  92. package/dist/lib/models/SimpleMongoEntity.js.map +1 -0
  93. package/dist/lib/models/StatusExtraData.js +15 -0
  94. package/dist/lib/models/StatusExtraData.js.map +1 -0
  95. package/dist/lib/models/index.js +10 -0
  96. package/dist/lib/models/index.js.map +1 -0
  97. package/dist/lib/routes/AdminRoute.js +268 -0
  98. package/dist/lib/routes/AdminRoute.js.map +1 -0
  99. package/dist/lib/routes/MetricsRoute.js +86 -0
  100. package/dist/lib/routes/MetricsRoute.js.map +1 -0
  101. package/dist/lib/routes/ModelRoute.js +481 -0
  102. package/dist/lib/routes/ModelRoute.js.map +1 -0
  103. package/dist/lib/routes/OpenAPIRoute.js +115 -0
  104. package/dist/lib/routes/OpenAPIRoute.js.map +1 -0
  105. package/dist/lib/routes/RouteUtils.js +445 -0
  106. package/dist/lib/routes/RouteUtils.js.map +1 -0
  107. package/dist/lib/routes/StatusRoute.js +55 -0
  108. package/dist/lib/routes/StatusRoute.js.map +1 -0
  109. package/dist/lib/routes/index.js +7 -0
  110. package/dist/lib/routes/index.js.map +1 -0
  111. package/dist/lib/security/ACLRouteMongo.js +194 -0
  112. package/dist/lib/security/ACLRouteMongo.js.map +1 -0
  113. package/dist/lib/security/ACLRouteSQL.js +193 -0
  114. package/dist/lib/security/ACLRouteSQL.js.map +1 -0
  115. package/dist/lib/security/ACLUtils.js +457 -0
  116. package/dist/lib/security/ACLUtils.js.map +1 -0
  117. package/dist/lib/security/AccessControlList.js +18 -0
  118. package/dist/lib/security/AccessControlList.js.map +1 -0
  119. package/dist/lib/security/AccessControlListMongo.js +155 -0
  120. package/dist/lib/security/AccessControlListMongo.js.map +1 -0
  121. package/dist/lib/security/AccessControlListSQL.js +149 -0
  122. package/dist/lib/security/AccessControlListSQL.js.map +1 -0
  123. package/dist/lib/security/index.js +3 -0
  124. package/dist/lib/security/index.js.map +1 -0
  125. package/dist/lib/test/index.js +3 -0
  126. package/dist/lib/test/index.js.map +1 -0
  127. package/dist/lib/test/request.js +99 -0
  128. package/dist/lib/test/request.js.map +1 -0
  129. package/dist/lib/test/requestws.js +173 -0
  130. package/dist/lib/test/requestws.js.map +1 -0
  131. package/dist/types/ApiErrors.d.ts +38 -0
  132. package/dist/types/BackgroundService.d.ts +30 -0
  133. package/dist/types/BackgroundServiceManager.d.ts +66 -0
  134. package/dist/types/BulkError.d.ts +11 -0
  135. package/dist/types/EventListenerManager.d.ts +36 -0
  136. package/dist/types/NetUtils.d.ts +29 -0
  137. package/dist/types/NotificationUtils.d.ts +25 -0
  138. package/dist/types/ObjectFactory.d.ts +17 -0
  139. package/dist/types/OpenApiSpec.d.ts +114 -0
  140. package/dist/types/Server.d.ts +180 -0
  141. package/dist/types/Types.d.ts +8 -0
  142. package/dist/types/auth/AuthMiddleware.d.ts +42 -0
  143. package/dist/types/auth/AuthStrategy.d.ts +32 -0
  144. package/dist/types/auth/BasicStrategy.d.ts +33 -0
  145. package/dist/types/auth/JWTStrategy.d.ts +61 -0
  146. package/dist/types/auth/index.d.ts +4 -0
  147. package/dist/types/database/ConnectionKinds.d.ts +7 -0
  148. package/dist/types/database/ConnectionManager.d.ts +35 -0
  149. package/dist/types/database/MongoConnection.d.ts +54 -0
  150. package/dist/types/database/MongoRepository.d.ts +92 -0
  151. package/dist/types/database/MongoSchemaSync.d.ts +41 -0
  152. package/dist/types/database/NamingUtils.d.ts +24 -0
  153. package/dist/types/database/TypeOrmSupport.d.ts +20 -0
  154. package/dist/types/database/index.d.ts +6 -0
  155. package/dist/types/decorators/DatabaseDecorators.d.ts +18 -0
  156. package/dist/types/decorators/DocDecorators.d.ts +69 -0
  157. package/dist/types/decorators/EventDecorators.d.ts +12 -0
  158. package/dist/types/decorators/ModelDecorators.d.ts +80 -0
  159. package/dist/types/decorators/PersistenceDecorators.d.ts +117 -0
  160. package/dist/types/decorators/RouteDecorators.d.ts +172 -0
  161. package/dist/types/decorators/index.d.ts +6 -0
  162. package/dist/types/http/Adapters.d.ts +68 -0
  163. package/dist/types/http/Router.d.ts +99 -0
  164. package/dist/types/http/WebSocket.d.ts +56 -0
  165. package/dist/types/http/index.d.ts +6 -0
  166. package/dist/types/http/types.d.ts +54 -0
  167. package/dist/types/index.d.ts +17 -0
  168. package/dist/types/models/BaseEntity.d.ts +29 -0
  169. package/dist/types/models/BaseMongoEntity.d.ts +13 -0
  170. package/dist/types/models/ModelUtils.d.ts +166 -0
  171. package/dist/types/models/RecoverableBaseEntity.d.ts +16 -0
  172. package/dist/types/models/RecoverableBaseMongoEntity.d.ts +16 -0
  173. package/dist/types/models/RepoUtils.d.ts +154 -0
  174. package/dist/types/models/SimpleEntity.d.ts +14 -0
  175. package/dist/types/models/SimpleMongoEntity.d.ts +15 -0
  176. package/dist/types/models/StatusExtraData.d.ts +6 -0
  177. package/dist/types/models/index.d.ts +9 -0
  178. package/dist/types/routes/AdminRoute.d.ts +47 -0
  179. package/dist/types/routes/MetricsRoute.d.ts +15 -0
  180. package/dist/types/routes/ModelRoute.d.ts +226 -0
  181. package/dist/types/routes/OpenAPIRoute.d.ts +17 -0
  182. package/dist/types/routes/RouteUtils.d.ts +55 -0
  183. package/dist/types/routes/StatusRoute.d.ts +11 -0
  184. package/dist/types/routes/index.d.ts +6 -0
  185. package/dist/types/security/ACLRouteMongo.d.ts +19 -0
  186. package/dist/types/security/ACLRouteSQL.d.ts +19 -0
  187. package/dist/types/security/ACLUtils.d.ts +94 -0
  188. package/dist/types/security/AccessControlList.d.ts +103 -0
  189. package/dist/types/security/AccessControlListMongo.d.ts +24 -0
  190. package/dist/types/security/AccessControlListSQL.d.ts +24 -0
  191. package/dist/types/security/index.d.ts +2 -0
  192. package/dist/types/test/index.d.ts +2 -0
  193. package/dist/types/test/request.d.ts +24 -0
  194. package/dist/types/test/requestws.d.ts +21 -0
  195. package/docs/Makefile +20 -0
  196. package/docs/conf.py +58 -0
  197. package/docs/index.rst +17 -0
  198. package/docs/make.bat +35 -0
  199. package/docs/reference/@rapidrest/namespaces/DatabaseDecorators/README.md +13 -0
  200. package/docs/reference/@rapidrest/namespaces/DatabaseDecorators/functions/MongoRepository.md +25 -0
  201. package/docs/reference/@rapidrest/namespaces/DatabaseDecorators/functions/RedisConnection.md +25 -0
  202. package/docs/reference/@rapidrest/namespaces/DatabaseDecorators/functions/Repository.md +25 -0
  203. package/docs/reference/@rapidrest/namespaces/DocDecorators/README.md +23 -0
  204. package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Default.md +25 -0
  205. package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Description.md +25 -0
  206. package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Document.md +25 -0
  207. package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Example.md +25 -0
  208. package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Format.md +25 -0
  209. package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Returns.md +28 -0
  210. package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Summary.md +25 -0
  211. package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Tags.md +25 -0
  212. package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/TypeInfo.md +28 -0
  213. package/docs/reference/@rapidrest/namespaces/DocDecorators/interfaces/DocumentsData.md +57 -0
  214. package/docs/reference/@rapidrest/namespaces/EventDecorators/README.md +12 -0
  215. package/docs/reference/@rapidrest/namespaces/EventDecorators/functions/EventListener.md +17 -0
  216. package/docs/reference/@rapidrest/namespaces/EventDecorators/functions/OnEvent.md +26 -0
  217. package/docs/reference/@rapidrest/namespaces/ModelDecorators/README.md +26 -0
  218. package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/Cache.md +25 -0
  219. package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/ChildEntity.md +18 -0
  220. package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/DataStore.md +25 -0
  221. package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/Identifier.md +27 -0
  222. package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/Protect.md +35 -0
  223. package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/Reference.md +25 -0
  224. package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/Shard.md +27 -0
  225. package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/TrackChanges.md +26 -0
  226. package/docs/reference/@rapidrest/namespaces/ModelDecorators/interfaces/PendingTypeOrmColumn.md +45 -0
  227. package/docs/reference/@rapidrest/namespaces/ModelDecorators/variables/pendingTypeOrmColumns.md +14 -0
  228. package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/README.md +25 -0
  229. package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/Column.md +25 -0
  230. package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/Entity.md +26 -0
  231. package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/Index.md +119 -0
  232. package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/PrimaryColumn.md +25 -0
  233. package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/Unique.md +68 -0
  234. package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/getColumnMetadata.md +26 -0
  235. package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/getEntityName.md +26 -0
  236. package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/getIndexMetadata.md +27 -0
  237. package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/interfaces/ColumnInfo.md +41 -0
  238. package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/interfaces/ColumnOptions.md +51 -0
  239. package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/interfaces/IndexInfo.md +41 -0
  240. package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/interfaces/IndexOptions.md +51 -0
  241. package/docs/reference/@rapidrest/namespaces/RouteDecorators/README.md +36 -0
  242. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/After.md +26 -0
  243. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Auth.md +33 -0
  244. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/AuthResult.md +31 -0
  245. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Before.md +25 -0
  246. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/ContentType.md +25 -0
  247. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Delete.md +25 -0
  248. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Get.md +25 -0
  249. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Head.md +25 -0
  250. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Header.md +25 -0
  251. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Method.md +31 -0
  252. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Model.md +25 -0
  253. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Options.md +25 -0
  254. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Param.md +26 -0
  255. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Patch.md +25 -0
  256. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Post.md +25 -0
  257. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Protect.md +31 -0
  258. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Put.md +25 -0
  259. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Query.md +26 -0
  260. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Request.md +31 -0
  261. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/RequiresRole.md +26 -0
  262. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Response.md +31 -0
  263. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Route.md +25 -0
  264. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Socket.md +33 -0
  265. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/User.md +31 -0
  266. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Validate.md +25 -0
  267. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/WebSocket.md +25 -0
  268. package/docs/reference/README.md +20 -0
  269. package/docs/reference/classes/ACLUtils.md +251 -0
  270. package/docs/reference/classes/AdminRoute.md +51 -0
  271. package/docs/reference/classes/AuthMiddleware.md +131 -0
  272. package/docs/reference/classes/BackgroundService.md +117 -0
  273. package/docs/reference/classes/BackgroundServiceManager.md +172 -0
  274. package/docs/reference/classes/BaseEntity.md +82 -0
  275. package/docs/reference/classes/BaseMongoEntity.md +107 -0
  276. package/docs/reference/classes/BasicStrategy.md +89 -0
  277. package/docs/reference/classes/BasicStrategyOptions.md +91 -0
  278. package/docs/reference/classes/BulkError.md +271 -0
  279. package/docs/reference/classes/ConnectionManager.md +75 -0
  280. package/docs/reference/classes/EventListenerManager.md +88 -0
  281. package/docs/reference/classes/JWTStrategy.md +77 -0
  282. package/docs/reference/classes/JWTStrategyOptions.md +97 -0
  283. package/docs/reference/classes/MetricsRoute.md +27 -0
  284. package/docs/reference/classes/ModelRoute.md +527 -0
  285. package/docs/reference/classes/ModelUtils.md +448 -0
  286. package/docs/reference/classes/MongoConnection.md +218 -0
  287. package/docs/reference/classes/MongoRepository.md +354 -0
  288. package/docs/reference/classes/MongoSchemaSync.md +67 -0
  289. package/docs/reference/classes/NetUtils.md +90 -0
  290. package/docs/reference/classes/NotificationUtils.md +77 -0
  291. package/docs/reference/classes/ObjectFactory.md +336 -0
  292. package/docs/reference/classes/OpenAPIRoute.md +77 -0
  293. package/docs/reference/classes/OpenApiSpec.md +892 -0
  294. package/docs/reference/classes/RecoverableBaseEntity.md +114 -0
  295. package/docs/reference/classes/RecoverableBaseMongoEntity.md +124 -0
  296. package/docs/reference/classes/RedisTransport.md +2202 -0
  297. package/docs/reference/classes/RepoUtils.md +486 -0
  298. package/docs/reference/classes/RouteUtils.md +191 -0
  299. package/docs/reference/classes/Server.md +408 -0
  300. package/docs/reference/classes/SimpleEntity.md +48 -0
  301. package/docs/reference/classes/SimpleMongoEntity.md +66 -0
  302. package/docs/reference/classes/StatusExtraData.md +57 -0
  303. package/docs/reference/classes/StatusRoute.md +26 -0
  304. package/docs/reference/enumerations/ACLAction.md +63 -0
  305. package/docs/reference/enumerations/ApiErrorMessages.md +123 -0
  306. package/docs/reference/enumerations/ApiErrors.md +123 -0
  307. package/docs/reference/functions/isSqlDataSource.md +26 -0
  308. package/docs/reference/functions/resolveCollectionName.md +33 -0
  309. package/docs/reference/functions/snakeCase.md +28 -0
  310. package/docs/reference/globals.md +91 -0
  311. package/docs/reference/interfaces/ACLRecord.md +96 -0
  312. package/docs/reference/interfaces/AccessControlList.md +76 -0
  313. package/docs/reference/interfaces/AuthResult.md +55 -0
  314. package/docs/reference/interfaces/AuthStrategy.md +57 -0
  315. package/docs/reference/interfaces/CreateRequestOptions.md +121 -0
  316. package/docs/reference/interfaces/DeleteRequestOptions.md +147 -0
  317. package/docs/reference/interfaces/FindRequestOptions.md +133 -0
  318. package/docs/reference/interfaces/JWTAuthResult.md +84 -0
  319. package/docs/reference/interfaces/RepoCreateOptions.md +95 -0
  320. package/docs/reference/interfaces/RepoDeleteOptions.md +115 -0
  321. package/docs/reference/interfaces/RepoFindOptions.md +135 -0
  322. package/docs/reference/interfaces/RepoOperationOptions.md +69 -0
  323. package/docs/reference/interfaces/RepoUpdateOptions.md +111 -0
  324. package/docs/reference/interfaces/RequestOptions.md +112 -0
  325. package/docs/reference/interfaces/TruncateRequestOptions.md +175 -0
  326. package/docs/reference/interfaces/UpdateRequestOptions.md +149 -0
  327. package/docs/reference/type-aliases/OneOrMany.md +19 -0
  328. package/docs/reference/type-aliases/OneOrNull.md +19 -0
  329. package/docs/reference/type-aliases/PartialBaseEntity.md +17 -0
  330. package/docs/reference/type-aliases/PartialSimpleEntity.md +17 -0
  331. package/docs/reference/type-aliases/UpdateObject.md +19 -0
  332. package/package.json +125 -0
@@ -0,0 +1,166 @@
1
+ import type { Repository } from "typeorm";
2
+ import { MongoRepository } from "../database/MongoRepository.js";
3
+ import "reflect-metadata";
4
+ /**
5
+ * Utility class for working with data model classes.
6
+ *
7
+ * @author Jean-Philippe Steinmetz
8
+ */
9
+ export declare class ModelUtils {
10
+ /** The `typeorm` module containing the query operators used to build SQL queries. */
11
+ private static typeOrm;
12
+ /**
13
+ * Provides the `typeorm` module to use when building SQL queries. This is called automatically when a SQL
14
+ * datastore connection is established.
15
+ *
16
+ * @param module The `typeorm` module.
17
+ */
18
+ static setTypeOrm(module: any): void;
19
+ /**
20
+ * Returns the `typeorm` module, throwing an error if it has not been provided.
21
+ */
22
+ private static get orm();
23
+ /**
24
+ * Retrieves a list of all of the specified class's properties that have the @Identifier decorator applied.
25
+ *
26
+ * @param modelClass The class definition to search for identifiers from.
27
+ * @returns The list of all property names that have the @Identifier decorator applied.
28
+ */
29
+ static getIdPropertyNames(modelClass: any): string[];
30
+ /**
31
+ * Builds a query object for use with `find` functions of the given repository for retrieving objects matching the
32
+ * specified unique identifier.
33
+ *
34
+ * @param repo The repository to build the query for.
35
+ * @param modelClass The class definition of the data model to build a search query for.
36
+ * @param id The unique identifier to search for.
37
+ * @param version The version number of the document to search for.
38
+ * @param productUid The optional product uid that is associated with the uid (when a compound key is used).
39
+ * @returns An object that can be passed to a TypeORM `find` function.
40
+ */
41
+ static buildIdSearchQuery<T extends {}>(repo: Repository<T> | MongoRepository<T> | undefined, modelClass: any, id: any | any[], version?: number, productUid?: string): any;
42
+ /**
43
+ * Builds a TypeORM compatible query object for use in `find` functions for retrieving objects matching the
44
+ * specified unique identifier.
45
+ *
46
+ * @param modelClass The class definition of the data model to build a search query for.
47
+ * @param id The unique identifier to search for.
48
+ * @param version The version number of the document to search for.
49
+ * @param productUid The optional product uid that is associated with the uid (when a compound key is used).
50
+ * @returns An object that can be passed to a TypeORM `find` function.
51
+ */
52
+ static buildIdSearchQuerySQL(modelClass: any, id: any | any[], version?: number, productUid?: string): any;
53
+ /**
54
+ * Builds a MongoDB compatible query object for use in `find` functions for retrieving objects matching the
55
+ * specified unique identifier.
56
+ *
57
+ * @param modelClass The class definition of the data model to build a search query for.
58
+ * @param id The unique identifier to search for.
59
+ * @param version The version number of the document to search for.
60
+ * @param productUid The optional product uid that is associated with the uid (when a compound key is used).
61
+ * @returns An object that can be passed to a MongoDB `find` function.
62
+ */
63
+ static buildIdSearchQueryMongo(modelClass: any, id: any | any[], version?: number, productUid?: string): any;
64
+ /**
65
+ * Given a string containing a parameter value and/or a comparison operation return a TypeORM compatible find value.
66
+ * e.g.
67
+ * Given the string "myvalue" will return an Eq("myvalue") object.
68
+ * Given the string "Like(myvalue)" will return an Like("myvalue") object.
69
+ *
70
+ * @param param
71
+ */
72
+ private static getQueryParamValue;
73
+ /**
74
+ * Given a string containing a parameter value and/or a comparison operation return a MongoDB compatible find value.
75
+ * e.g.
76
+ * Given the string "myvalue" will return an `"myvalue"` object.
77
+ * Given the string "not(myvalue)" will return an `{ $not: "myvalue" }` object.
78
+ *
79
+ * @param param
80
+ */
81
+ private static getQueryParamValueMongo;
82
+ /**
83
+ * Builds a query object for the given criteria and repository. Query params can have a value containing a
84
+ * conditional operator to apply for the search. The operator is encoded with the format `op(value)`. The following
85
+ * operators are supported:
86
+ * * `eq` - Returns matches whose parameter exactly matches of the given value. e.g. `param = value`
87
+ * * `gt` - Returns matches whose parameter is greater than the given value. e.g. `param > value`
88
+ * * `gte` - Returns matches whose parameter is greater than or equal to the given value. e.g. `param >= value`
89
+ * * `in` - Returns matches whose parameter includes one of the given values. e.g. `param in ('value1', 'value2', 'value3', ...)`
90
+ * * `like` - Returns matches whose parameter is lexographically similar to the given value. `param like value`
91
+ * * `lt` - Returns matches whose parameter is less than the given value. e.g. `param < value`
92
+ * * `lte` - Returns matches whose parameter is less than or equal to than the given value. e.g. `param < value`
93
+ * * `not` - Returns matches whose parameter is not equal to the given value. e.g. `param not value`
94
+ * * `range` - Returns matches whose parameter is greater than or equal to first given value and less than or equal to the second. e.g. `param between(1,100)`
95
+ *
96
+ * When no operator is provided the comparison will always be evaluated as `eq`.
97
+ *
98
+ * NOTE: The result of this function is only compatible with the `aggregate()` function when MongoDB is used.
99
+ *
100
+ * @param modelClass The class definition of the data model to build a search query for.
101
+ * @param repo The repository to build a search query for.
102
+ * @param {any} params The URI parameters for the endpoint that was requested.
103
+ * @param {any} queryParams The URI query parameters that were included in the request.
104
+ * @param {bool} exactMatch Set to true to create a query where parameters are to be matched exactly, otherwise set to false to use a 'contains' search.
105
+ * @param {any} user The user that is performing the request.
106
+ * @returns {object} The TypeORM compatible query object.
107
+ */
108
+ static buildSearchQuery<T extends {}>(modelClass: any, repo: Repository<T> | MongoRepository<T> | undefined, params?: any, queryParams?: any, exactMatch?: boolean, user?: any): any;
109
+ /**
110
+ * Builds a TypeORM compatible query object for the given criteria. Query params can have a value containing a
111
+ * conditional operator to apply for the search. The operator is encoded with the format `op(value)`. The following
112
+ * operators are supported:
113
+ * * `eq` - Returns matches whose parameter exactly matches of the given value. e.g. `param = value`
114
+ * * `gt` - Returns matches whose parameter is greater than the given value. e.g. `param > value`
115
+ * * `gte` - Returns matches whose parameter is greater than or equal to the given value. e.g. `param >= value`
116
+ * * `in` - Returns matches whose parameter includes one of the given values. e.g. `param in ('value1', 'value2', 'value3', ...)`
117
+ * * `like` - Returns matches whose parameter is lexographically similar to the given value. `param like value`
118
+ * * `lt` - Returns matches whose parameter is less than the given value. e.g. `param < value`
119
+ * * `lte` - Returns matches whose parameter is less than or equal to than the given value. e.g. `param < value`
120
+ * * `not` - Returns matches whose parameter is not equal to the given value. e.g. `param not value`
121
+ * * `range` - Returns matches whose parameter is greater than or equal to first given value and less than or equal to the second. e.g. `param between(1,100)`
122
+ *
123
+ * When no operator is provided the comparison will always be evaluated as `eq`.
124
+ *
125
+ * @param modelClass The class definition of the data model to build a search query for.
126
+ * @param {any} params The URI parameters for the endpoint that was requested.
127
+ * @param {any} queryParams The URI query parameters that were included in the request.
128
+ * @param {bool} exactMatch Set to true to create a query where parameters are to be matched exactly, otherwise set to false to use a 'contains' search.
129
+ * @param {any} user The user that is performing the request.
130
+ * @returns {object} The TypeORM compatible query object.
131
+ */
132
+ static buildSearchQuerySQL(modelClass: any, params?: any, queryParams?: any, exactMatch?: boolean, user?: any): any;
133
+ /**
134
+ * Builds a MongoDB compatible query object for the given criteria. Query params can have a value containing a
135
+ * conditional operator to apply for the search. The operator is encoded with the format `op(value)`. The following
136
+ * operators are supported:
137
+ * * `eq` - Returns matches whose parameter exactly matches of the given value. e.g. `param = value`
138
+ * * `gt` - Returns matches whose parameter is greater than the given value. e.g. `param > value`
139
+ * * `gte` - Returns matches whose parameter is greater than or equal to the given value. e.g. `param >= value`
140
+ * * `in` - Returns matches whose parameter includes one of the given values. e.g. `param in ('value1', 'value2', 'value3', ...)`
141
+ * * `like` - Returns matches whose parameter is lexographically similar to the given value. `param like value`
142
+ * * `lt` - Returns matches whose parameter is less than the given value. e.g. `param < value`
143
+ * * `lte` - Returns matches whose parameter is less than or equal to than the given value. e.g. `param < value`
144
+ * * `not` - Returns matches whose parameter is not equal to the given value. e.g. `param not value`
145
+ * * `range` - Returns matches whose parameter is greater than or equal to first given value and less than or equal to the second. e.g. `param between(1,100)`
146
+ *
147
+ * When no operator is provided the comparison will always be evaluated as `eq`.
148
+ *
149
+ * NOTE: The result of this function is only compatible with the `aggregate()` function.
150
+ *
151
+ * @param modelClass The class definition of the data model to build a search query for.
152
+ * @param {any} params The URI parameters for the endpoint that was requested.
153
+ * @param {any} queryParams The URI query parameters that were included in the request.
154
+ * @param {bool} exactMatch Set to true to create a query where parameters are to be matched exactly, otherwise set to false to use a 'contains' search.
155
+ * @param {any} user The user that is performing the request.
156
+ * @returns {object} The TypeORM compatible query object.
157
+ */
158
+ static buildSearchQueryMongo(modelClass: any, params?: any, queryParams?: any, exactMatch?: boolean, user?: any): any;
159
+ /**
160
+ * Loads all model schema files from the specified path and returns a map containing all the definitions.
161
+ *
162
+ * @param src The path to the model files to load.
163
+ * @returns A map containing of all loaded model names to their class definitions.
164
+ */
165
+ static loadModels(src: string, result?: Map<string, any>): Promise<Map<string, any>>;
166
+ }
@@ -0,0 +1,16 @@
1
+ import { BaseEntity } from "./BaseEntity.js";
2
+ /**
3
+ * The `RecoverableBaseEntity` provides an entity base class for those classes wishing to implement
4
+ * soft delete capability. A soft delete means that a delete operation does not remove the entity
5
+ * from the database but instead simply marks it as deleted. To completely remove the entity from
6
+ * the database the user must explicitly specify the entity to be purged.
7
+ *
8
+ * @author Jean-Philippe Steinmetz <rapidrests@gmail.com>
9
+ */
10
+ export declare abstract class RecoverableBaseEntity extends BaseEntity {
11
+ /**
12
+ * Indicates if the document has been soft deleted.
13
+ */
14
+ deleted: boolean;
15
+ constructor(other?: Partial<RecoverableBaseEntity>);
16
+ }
@@ -0,0 +1,16 @@
1
+ import { RecoverableBaseEntity } from "./RecoverableBaseEntity.js";
2
+ /**
3
+ * The `RecoverableBaseMongoEntity` provides an entity base class for those classes wishing to implement
4
+ * soft delete capability. A soft delete means that a delete operation does not remove the entity
5
+ * from the database but instead simply marks it as deleted. To completely remove the entity from
6
+ * the database the user must explicitly specify the entity to be purged.
7
+ *
8
+ * @author Jean-Philippe Steinmetz <rapidrests@gmail.com>
9
+ */
10
+ export declare abstract class RecoverableBaseMongoEntity extends RecoverableBaseEntity {
11
+ /**
12
+ * The internal unique identifier used by MongoDB.
13
+ */
14
+ _id?: any;
15
+ constructor(other?: Partial<RecoverableBaseMongoEntity>);
16
+ }
@@ -0,0 +1,154 @@
1
+ import type { Repository } from "typeorm";
2
+ import { MongoRepository } from "../database/MongoRepository.js";
3
+ import { BaseEntity } from "../models/BaseEntity.js";
4
+ import { SimpleEntity } from "../models/SimpleEntity.js";
5
+ import { JWTUser } from "@rapidrest/core";
6
+ import { Redis } from "ioredis";
7
+ import { ObjectFactory } from "../ObjectFactory.js";
8
+ import { NotificationUtils } from "../NotificationUtils.js";
9
+ import { AccessControlList, ACLUtils } from "../security/index.js";
10
+ import { ConnectionManager } from "../database/index.js";
11
+ /**
12
+ * The available options used for `RepoUtils` operations.
13
+ */
14
+ export interface RepoOperationOptions {
15
+ /** Set to `true` to ignore the ACL permissions check. */
16
+ ignoreACL?: boolean;
17
+ /** An additional list of channel names to send push notifications to. */
18
+ pushChannels?: string[];
19
+ /** Indicates if a telemetry event should be broadcast for the request. */
20
+ recordEvent?: boolean;
21
+ /** Set to `true` to not send a push notification. */
22
+ skipPush?: boolean;
23
+ /** The authenticated user making the request. */
24
+ user?: JWTUser;
25
+ }
26
+ /**
27
+ * The available options for the `RepoUtils.create()` operation.
28
+ */
29
+ export interface RepoCreateOptions extends RepoOperationOptions {
30
+ /** The AccessControlList to use when creating a new object. */
31
+ acl?: AccessControlList;
32
+ }
33
+ /**
34
+ * The available options for the `RepoUtils.delete()` operation.
35
+ */
36
+ export interface RepoDeleteOptions extends RepoOperationOptions {
37
+ /** The desired product uid of the resource to delete. */
38
+ productUid?: string;
39
+ /** Set to true to permanently remove the object from the database (if applicable). */
40
+ purge?: boolean;
41
+ /** The desired version number of the resource to delete. */
42
+ version?: number | string;
43
+ }
44
+ export interface RepoFindOptions extends RepoOperationOptions {
45
+ /** The total number of resources to retrieve. */
46
+ limit?: number;
47
+ /** The page number of the paginated results to retrieve. */
48
+ page?: number;
49
+ /** The desired product uid of the resources to retrieve. */
50
+ productUid?: string;
51
+ /** Set to `true` to skip retrieval from the cache. Default is `false`. */
52
+ skipCache?: boolean;
53
+ /** The desired version number of the resources to retrieve. */
54
+ version?: number | string;
55
+ }
56
+ /**
57
+ * The available options for the `RepoUtils.update()` operation.
58
+ */
59
+ export interface RepoUpdateOptions<T extends BaseEntity | SimpleEntity> extends RepoOperationOptions {
60
+ /** The desired product uid of the resource to update. */
61
+ productUid?: string;
62
+ /** The desired version number of the resource to update. */
63
+ version?: number | string;
64
+ }
65
+ /**
66
+ * @author Jean-Philippe Steinmetz
67
+ */
68
+ export declare class RepoUtils<T extends BaseEntity | SimpleEntity> {
69
+ protected aclUtils?: ACLUtils;
70
+ /** The redis client that will be used as a 2nd level cache for all cacheable models. */
71
+ protected cacheClient?: Redis;
72
+ protected config: any;
73
+ protected connectionManager?: ConnectionManager;
74
+ /** The unique identifier of the default ACL for the model type. */
75
+ defaultACLUid: string;
76
+ protected logger: any;
77
+ protected modelClass: any;
78
+ protected objectFactory?: ObjectFactory;
79
+ protected notificationUtils?: NotificationUtils;
80
+ /** The model class associated with the controller to perform operations against. */
81
+ repo?: Repository<T> | MongoRepository<T>;
82
+ protected trustedRoles: string[];
83
+ constructor(modelClass: any, repo?: Repository<T> | MongoRepository<T>);
84
+ protected init(): Promise<void>;
85
+ /**
86
+ * The base key used to get or set data in the cache.
87
+ */
88
+ get baseCacheKey(): string;
89
+ count(query: any, options?: RepoFindOptions): Promise<number>;
90
+ /**
91
+ * Stores a new record of the provided object in the datastore. Performs pre-processing, permission checks against
92
+ * the class ACL, cache seeding, telemetry recording and push notifications.
93
+ *
94
+ * @param obj The object to store.
95
+ * @param acl The ACL to use
96
+ */
97
+ create(obj: Partial<T>, options?: RepoCreateOptions): Promise<T>;
98
+ delete(uid: string, options: RepoDeleteOptions): Promise<void>;
99
+ /**
100
+ * Retrieves an array of objects from the datastore matching the given search query. This function will first
101
+ * attempt to look up the results in the cache. Also checks ACLs for READ permission.
102
+ *
103
+ * @param query The constructed search query to run.
104
+ * @param options The additional options to consider during the search.
105
+ */
106
+ find(query: any, options?: RepoFindOptions): Promise<Array<T>>;
107
+ /**
108
+ * Retrieves the object with the given id from either the cache or the database. If retrieving from the database
109
+ * the cache is populated to speed up subsequent requests.
110
+ *
111
+ * @param id The unique identifier of the object to retrieve.
112
+ * @param options The additional options to consider during the search.
113
+ */
114
+ findOne(id: string, options?: RepoFindOptions): Promise<T | undefined>;
115
+ /**
116
+ * Returns the default access control list governing the model type. Returning a value of `undefined` will grant
117
+ * full acccess to any user (including unauthenticated anonymous users).
118
+ */
119
+ getDefaultACL(): AccessControlList | undefined;
120
+ /**
121
+ * Hashes the given query object to a unique string.
122
+ * @param query The query object to hash.
123
+ */
124
+ hashQuery(query: any): string;
125
+ /**
126
+ * Returns the class type (constructor) for the given object. This uses the `_fqn` or `_type` property of `obj` to
127
+ * identify the class. If neither property is defined `modelClass` is assumed.
128
+ *
129
+ * @param obj The object whose class type to look up.
130
+ * @returns The class type (constructor) associated with the given object.
131
+ */
132
+ getClassType(obj: any): any;
133
+ /**
134
+ * Creates a new instance of obj scoped to the correct model class or sub-class.
135
+ */
136
+ instantiateObject(obj: any, clazz?: any): T;
137
+ /**
138
+ * Search for existing object based on passed in id and version and product uid.
139
+ *
140
+ * The result of this function is compatible with all `Repository.find()` functions.
141
+ */
142
+ searchIdQuery(id: string, version?: number | string, productUid?: string): any;
143
+ truncate(query: any, options: RepoFindOptions): Promise<void>;
144
+ update(obj: Partial<T>, existing: T, options?: RepoUpdateOptions<T>): Promise<T>;
145
+ /**
146
+ * Performs validation on the object(s) provided. This function first calls `ObjectUtils.validate()` to check
147
+ * any class level defined validation functions. Second, it scans for any properties with the `@Reference`
148
+ * decorator and attempts to verify that an existing object for the given reference ID is valid.
149
+ *
150
+ * @param objs The object(s) to validate.
151
+ * @param options The optional set of arguments that can be passed to perform additonal checks.
152
+ */
153
+ validate(objs: Partial<T> | Partial<T>[], options?: RepoOperationOptions): Promise<void>;
154
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Provides a simple base class for all entity's that will be persisted with TypeORM. Unlike `BaseEntity` this class
3
+ * does not provide optimistic locking or date created and modified tracking.
4
+ *
5
+ * @author Jean-Philippe Steinmetz <rapidrests@gmail.com>
6
+ */
7
+ export declare abstract class SimpleEntity {
8
+ /**
9
+ * The universally unique identifier of the entity.
10
+ */
11
+ uid: string;
12
+ constructor(other?: Partial<SimpleEntity>);
13
+ }
14
+ export type PartialSimpleEntity<T extends SimpleEntity> = Partial<T> & Pick<T, "uid">;
@@ -0,0 +1,15 @@
1
+ import { ObjectId } from "mongodb";
2
+ import { SimpleEntity } from "./SimpleEntity.js";
3
+ /**
4
+ * Provides a simple base class for all entity's that will be persisted in a MongoDB database. Unlike
5
+ * `BaseMongoEntity` this class does not provide optimistic locking or date created and modified tracking.
6
+ *
7
+ * @author Jean-Philippe Steinmetz <rapidrests@gmail.com>
8
+ */
9
+ export declare abstract class SimpleMongoEntity extends SimpleEntity {
10
+ /**
11
+ * The internal unique identifier used by MongoDB.
12
+ */
13
+ _id?: ObjectId;
14
+ constructor(other?: Partial<SimpleMongoEntity>);
15
+ }
@@ -0,0 +1,6 @@
1
+ export declare class StatusExtraData {
2
+ private _data;
3
+ get data(): any;
4
+ set data(data: any);
5
+ constructor(other: Partial<StatusExtraData>);
6
+ }
@@ -0,0 +1,9 @@
1
+ export * from "./BaseEntity.js";
2
+ export * from "./BaseMongoEntity.js";
3
+ export * from "./ModelUtils.js";
4
+ export * from "./RecoverableBaseEntity.js";
5
+ export * from "./RecoverableBaseMongoEntity.js";
6
+ export * from "./RepoUtils.js";
7
+ export * from "./SimpleEntity.js";
8
+ export * from "./SimpleMongoEntity.js";
9
+ export * from "./StatusExtraData.js";
@@ -0,0 +1,47 @@
1
+ import { Redis } from "ioredis";
2
+ import Transport from "winston-transport";
3
+ /**
4
+ * Implements a Winston transport that pipes incoming log messages to a configured redis pubsub channel.
5
+ */
6
+ export declare class RedisTransport extends Transport {
7
+ private channel;
8
+ private redis;
9
+ constructor(opts: any);
10
+ close(): void;
11
+ log(info: any, next: Function): any;
12
+ }
13
+ /**
14
+ * The `AdminRoute` provides a default `/admin` endpoint that gives trusted users the following abilities:
15
+ *
16
+ * * Clear cache via `GET /admin/clear-cache`
17
+ * * Live tail the service logs via `GET /admin/logs`
18
+ * * Retrieve service dependencies via `GET /admin/dependencies`
19
+ * * Retrieve service release notes via `GET /admin/release-notes`
20
+ * * Restart the service via `GET /admin/restart`
21
+ *
22
+ * @author Jean-Philippe Steinmetz
23
+ */
24
+ export declare class AdminRoute {
25
+ /** A map of user uid's to active sockets. */
26
+ private activeSockets;
27
+ protected cacheClient?: Redis;
28
+ private cacheConnConfig;
29
+ private logger;
30
+ private logsConnConfig;
31
+ private redisClient?;
32
+ /** The underlying ReleaseNotes specification. */
33
+ private releaseNotes;
34
+ private serviceName?;
35
+ private trustedRoles;
36
+ /**
37
+ * Constructs a new `ReleaseNotesRoute` object with the specified defaults.
38
+ *
39
+ * @param releaseNotes The ReleaseNotes specification object to serve.
40
+ */
41
+ constructor(releaseNotes: string);
42
+ private init;
43
+ private clearCache;
44
+ private logs;
45
+ private get;
46
+ private restart;
47
+ }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Handles all REST API requests for the endpoint `/metrics'. This route handler produces Prometheus compatible metrics
3
+ * for use with a Prometheus based server.
4
+ *
5
+ * Services that wish to provide metrics to be exposed via this route can register them using the global registry
6
+ * from the provided `prom-client` dependency. See the `prom-client` documentation for more details.
7
+ */
8
+ export declare class MetricsRoute {
9
+ private metricsConfig;
10
+ private registry;
11
+ private trustedRoles;
12
+ constructor();
13
+ private getMetrics;
14
+ private getSingleMetric;
15
+ }