@rapidrest/service-core 1.0.0-rc.2 → 1.0.0-rc.21

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 (250) hide show
  1. package/dist/lib/BackgroundService.js +0 -4
  2. package/dist/lib/BackgroundService.js.map +1 -1
  3. package/dist/lib/BackgroundServiceManager.js +21 -4
  4. package/dist/lib/BackgroundServiceManager.js.map +1 -1
  5. package/dist/lib/EventListenerManager.js.map +1 -1
  6. package/dist/lib/OpenApiSpec.js +3 -2
  7. package/dist/lib/OpenApiSpec.js.map +1 -1
  8. package/dist/lib/Server.js +18 -79
  9. package/dist/lib/Server.js.map +1 -1
  10. package/dist/lib/database/TypeOrmSupport.js +18 -2
  11. package/dist/lib/database/TypeOrmSupport.js.map +1 -1
  12. package/dist/lib/decorators/DocDecorators.js +19 -1
  13. package/dist/lib/decorators/DocDecorators.js.map +1 -1
  14. package/dist/lib/decorators/PersistenceDecorators.js.map +1 -1
  15. package/dist/lib/decorators/RouteDecorators.js +71 -20
  16. package/dist/lib/decorators/RouteDecorators.js.map +1 -1
  17. package/dist/lib/http/Adapters.js +45 -2
  18. package/dist/lib/http/Adapters.js.map +1 -1
  19. package/dist/lib/http/Router.js +53 -56
  20. package/dist/lib/http/Router.js.map +1 -1
  21. package/dist/lib/models/ModelUtils.js +18 -8
  22. package/dist/lib/models/ModelUtils.js.map +1 -1
  23. package/dist/lib/models/RepoUtils.js +96 -31
  24. package/dist/lib/models/RepoUtils.js.map +1 -1
  25. package/dist/lib/routes/{AdminRoute.js → BaseAdminRoute.js} +51 -36
  26. package/dist/lib/routes/BaseAdminRoute.js.map +1 -0
  27. package/dist/lib/routes/{MetricsRoute.js → BaseMetricsRoute.js} +28 -15
  28. package/dist/lib/routes/BaseMetricsRoute.js.map +1 -0
  29. package/dist/lib/routes/{OpenAPIRoute.js → BaseOpenAPIRoute.js} +31 -32
  30. package/dist/lib/routes/BaseOpenAPIRoute.js.map +1 -0
  31. package/dist/lib/routes/BasePushRoute.js +193 -0
  32. package/dist/lib/routes/BasePushRoute.js.map +1 -0
  33. package/dist/lib/routes/BaseStaticRoute.js +152 -0
  34. package/dist/lib/routes/BaseStaticRoute.js.map +1 -0
  35. package/dist/lib/routes/BaseStatusRoute.js +79 -0
  36. package/dist/lib/routes/BaseStatusRoute.js.map +1 -0
  37. package/dist/lib/routes/CRUDRoute.js +238 -0
  38. package/dist/lib/routes/CRUDRoute.js.map +1 -0
  39. package/dist/lib/routes/ModelRoute.js +20 -28
  40. package/dist/lib/routes/ModelRoute.js.map +1 -1
  41. package/dist/lib/routes/index.js +7 -4
  42. package/dist/lib/routes/index.js.map +1 -1
  43. package/dist/lib/security/ACLUtils.js +10 -13
  44. package/dist/lib/security/ACLUtils.js.map +1 -1
  45. package/dist/lib/security/AccessControlListMongo.js +5 -1
  46. package/dist/lib/security/AccessControlListMongo.js.map +1 -1
  47. package/dist/lib/security/AccessControlListSQL.js +7 -3
  48. package/dist/lib/security/AccessControlListSQL.js.map +1 -1
  49. package/dist/lib/security/BaseACLRoute.js +239 -0
  50. package/dist/lib/security/BaseACLRoute.js.map +1 -0
  51. package/dist/lib/security/index.js +3 -0
  52. package/dist/lib/security/index.js.map +1 -1
  53. package/dist/lib/test/request.js +6 -2
  54. package/dist/lib/test/request.js.map +1 -1
  55. package/dist/types/BackgroundService.d.ts +0 -5
  56. package/dist/types/BackgroundServiceManager.d.ts +1 -1
  57. package/dist/types/EventListenerManager.d.ts +4 -4
  58. package/dist/types/Server.d.ts +21 -6
  59. package/dist/types/decorators/DocDecorators.d.ts +9 -0
  60. package/dist/types/decorators/PersistenceDecorators.d.ts +7 -0
  61. package/dist/types/decorators/RouteDecorators.d.ts +14 -5
  62. package/dist/types/http/Adapters.d.ts +19 -0
  63. package/dist/types/http/Router.d.ts +6 -6
  64. package/dist/types/models/ModelUtils.d.ts +2 -1
  65. package/dist/types/routes/BaseAdminRoute.d.ts +59 -0
  66. package/dist/types/routes/BaseMetricsRoute.d.ts +37 -0
  67. package/dist/types/routes/BaseOpenAPIRoute.d.ts +33 -0
  68. package/dist/types/routes/BasePushRoute.d.ts +39 -0
  69. package/dist/types/routes/BaseStaticRoute.d.ts +44 -0
  70. package/dist/types/routes/BaseStatusRoute.d.ts +37 -0
  71. package/dist/types/routes/CRUDRoute.d.ts +47 -0
  72. package/dist/types/routes/ModelRoute.d.ts +23 -16
  73. package/dist/types/routes/index.d.ts +7 -4
  74. package/dist/types/security/ACLUtils.d.ts +1 -1
  75. package/dist/types/security/AccessControlList.d.ts +1 -1
  76. package/dist/types/security/AccessControlListMongo.d.ts +1 -1
  77. package/dist/types/security/AccessControlListSQL.d.ts +1 -1
  78. package/dist/types/security/BaseACLRoute.d.ts +73 -0
  79. package/dist/types/security/index.d.ts +3 -0
  80. package/package.json +132 -129
  81. package/tsconfig.export.json +17 -0
  82. package/dist/lib/routes/AdminRoute.js.map +0 -1
  83. package/dist/lib/routes/MetricsRoute.js.map +0 -1
  84. package/dist/lib/routes/OpenAPIRoute.js.map +0 -1
  85. package/dist/lib/routes/StatusRoute.js +0 -55
  86. package/dist/lib/routes/StatusRoute.js.map +0 -1
  87. package/dist/lib/security/ACLRouteMongo.js +0 -194
  88. package/dist/lib/security/ACLRouteMongo.js.map +0 -1
  89. package/dist/lib/security/ACLRouteSQL.js +0 -193
  90. package/dist/lib/security/ACLRouteSQL.js.map +0 -1
  91. package/dist/types/routes/AdminRoute.d.ts +0 -47
  92. package/dist/types/routes/MetricsRoute.d.ts +0 -15
  93. package/dist/types/routes/OpenAPIRoute.d.ts +0 -17
  94. package/dist/types/routes/StatusRoute.d.ts +0 -11
  95. package/dist/types/security/ACLRouteMongo.d.ts +0 -19
  96. package/dist/types/security/ACLRouteSQL.d.ts +0 -19
  97. package/docs/Makefile +0 -20
  98. package/docs/conf.py +0 -58
  99. package/docs/index.rst +0 -17
  100. package/docs/make.bat +0 -35
  101. package/docs/reference/@rapidrest/namespaces/DatabaseDecorators/README.md +0 -13
  102. package/docs/reference/@rapidrest/namespaces/DatabaseDecorators/functions/MongoRepository.md +0 -25
  103. package/docs/reference/@rapidrest/namespaces/DatabaseDecorators/functions/RedisConnection.md +0 -25
  104. package/docs/reference/@rapidrest/namespaces/DatabaseDecorators/functions/Repository.md +0 -25
  105. package/docs/reference/@rapidrest/namespaces/DocDecorators/README.md +0 -23
  106. package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Default.md +0 -25
  107. package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Description.md +0 -25
  108. package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Document.md +0 -25
  109. package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Example.md +0 -25
  110. package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Format.md +0 -25
  111. package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Returns.md +0 -28
  112. package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Summary.md +0 -25
  113. package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Tags.md +0 -25
  114. package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/TypeInfo.md +0 -28
  115. package/docs/reference/@rapidrest/namespaces/DocDecorators/interfaces/DocumentsData.md +0 -57
  116. package/docs/reference/@rapidrest/namespaces/EventDecorators/README.md +0 -12
  117. package/docs/reference/@rapidrest/namespaces/EventDecorators/functions/EventListener.md +0 -17
  118. package/docs/reference/@rapidrest/namespaces/EventDecorators/functions/OnEvent.md +0 -26
  119. package/docs/reference/@rapidrest/namespaces/ModelDecorators/README.md +0 -26
  120. package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/Cache.md +0 -25
  121. package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/ChildEntity.md +0 -18
  122. package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/DataStore.md +0 -25
  123. package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/Identifier.md +0 -27
  124. package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/Protect.md +0 -35
  125. package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/Reference.md +0 -25
  126. package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/Shard.md +0 -27
  127. package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/TrackChanges.md +0 -26
  128. package/docs/reference/@rapidrest/namespaces/ModelDecorators/interfaces/PendingTypeOrmColumn.md +0 -45
  129. package/docs/reference/@rapidrest/namespaces/ModelDecorators/variables/pendingTypeOrmColumns.md +0 -14
  130. package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/README.md +0 -27
  131. package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/Column.md +0 -25
  132. package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/Entity.md +0 -25
  133. package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/Index.md +0 -119
  134. package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/PrimaryColumn.md +0 -25
  135. package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/Unique.md +0 -68
  136. package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/getColumnMetadata.md +0 -26
  137. package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/getEntityName.md +0 -26
  138. package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/getIndexMetadata.md +0 -27
  139. package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/interfaces/CollationOptions.md +0 -79
  140. package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/interfaces/ColumnInfo.md +0 -41
  141. package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/interfaces/ColumnOptions.md +0 -51
  142. package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/interfaces/EntityOptions.md +0 -32
  143. package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/interfaces/IndexInfo.md +0 -41
  144. package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/interfaces/IndexOptions.md +0 -61
  145. package/docs/reference/@rapidrest/namespaces/RouteDecorators/README.md +0 -36
  146. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/After.md +0 -26
  147. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Auth.md +0 -33
  148. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/AuthResult.md +0 -31
  149. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Before.md +0 -25
  150. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/ContentType.md +0 -25
  151. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Delete.md +0 -25
  152. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Get.md +0 -25
  153. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Head.md +0 -25
  154. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Header.md +0 -25
  155. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Method.md +0 -31
  156. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Model.md +0 -25
  157. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Options.md +0 -25
  158. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Param.md +0 -26
  159. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Patch.md +0 -25
  160. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Post.md +0 -25
  161. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Protect.md +0 -31
  162. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Put.md +0 -25
  163. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Query.md +0 -26
  164. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Request.md +0 -31
  165. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/RequiresRole.md +0 -26
  166. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Response.md +0 -31
  167. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Route.md +0 -25
  168. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Socket.md +0 -33
  169. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/User.md +0 -31
  170. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Validate.md +0 -25
  171. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/WebSocket.md +0 -25
  172. package/docs/reference/README.md +0 -20
  173. package/docs/reference/classes/ACLUtils.md +0 -263
  174. package/docs/reference/classes/AdminRoute.md +0 -51
  175. package/docs/reference/classes/AuthMiddleware.md +0 -173
  176. package/docs/reference/classes/BackgroundService.md +0 -117
  177. package/docs/reference/classes/BackgroundServiceManager.md +0 -172
  178. package/docs/reference/classes/BaseEntity.md +0 -82
  179. package/docs/reference/classes/BaseMongoEntity.md +0 -107
  180. package/docs/reference/classes/BasicStrategy.md +0 -131
  181. package/docs/reference/classes/BasicStrategyOptions.md +0 -115
  182. package/docs/reference/classes/BulkError.md +0 -271
  183. package/docs/reference/classes/ConnectionManager.md +0 -75
  184. package/docs/reference/classes/EventListenerManager.md +0 -88
  185. package/docs/reference/classes/HttpRouter.md +0 -343
  186. package/docs/reference/classes/JWTStrategy.md +0 -100
  187. package/docs/reference/classes/JWTStrategyOptions.md +0 -97
  188. package/docs/reference/classes/MetricsRoute.md +0 -27
  189. package/docs/reference/classes/ModelRoute.md +0 -527
  190. package/docs/reference/classes/ModelUtils.md +0 -430
  191. package/docs/reference/classes/MongoConnection.md +0 -218
  192. package/docs/reference/classes/MongoRepository.md +0 -390
  193. package/docs/reference/classes/MongoSchemaSync.md +0 -97
  194. package/docs/reference/classes/NetUtils.md +0 -90
  195. package/docs/reference/classes/NotificationUtils.md +0 -77
  196. package/docs/reference/classes/ObjectFactory.md +0 -336
  197. package/docs/reference/classes/OpenAPIRoute.md +0 -77
  198. package/docs/reference/classes/OpenApiSpec.md +0 -892
  199. package/docs/reference/classes/RecoverableBaseEntity.md +0 -114
  200. package/docs/reference/classes/RecoverableBaseMongoEntity.md +0 -124
  201. package/docs/reference/classes/RedisTransport.md +0 -2202
  202. package/docs/reference/classes/RepoUtils.md +0 -482
  203. package/docs/reference/classes/RouteUtils.md +0 -191
  204. package/docs/reference/classes/Server.md +0 -408
  205. package/docs/reference/classes/SimpleEntity.md +0 -48
  206. package/docs/reference/classes/SimpleMongoEntity.md +0 -66
  207. package/docs/reference/classes/StatusExtraData.md +0 -57
  208. package/docs/reference/classes/StatusRoute.md +0 -26
  209. package/docs/reference/classes/UWSRequest.md +0 -226
  210. package/docs/reference/classes/UWSResponse.md +0 -257
  211. package/docs/reference/classes/UWSWebSocketShim.md +0 -958
  212. package/docs/reference/enumerations/ACLAction.md +0 -63
  213. package/docs/reference/enumerations/ApiErrorMessages.md +0 -123
  214. package/docs/reference/enumerations/ApiErrors.md +0 -123
  215. package/docs/reference/functions/createWebSocketStream.md +0 -27
  216. package/docs/reference/functions/isSqlDataSource.md +0 -26
  217. package/docs/reference/functions/readBody.md +0 -29
  218. package/docs/reference/functions/resolveCollectionName.md +0 -33
  219. package/docs/reference/functions/runChain.md +0 -40
  220. package/docs/reference/functions/snakeCase.md +0 -28
  221. package/docs/reference/globals.md +0 -106
  222. package/docs/reference/interfaces/ACLRecord.md +0 -96
  223. package/docs/reference/interfaces/AccessControlList.md +0 -76
  224. package/docs/reference/interfaces/AuthResult.md +0 -55
  225. package/docs/reference/interfaces/AuthStrategy.md +0 -95
  226. package/docs/reference/interfaces/CreateRequestOptions.md +0 -121
  227. package/docs/reference/interfaces/DeleteRequestOptions.md +0 -137
  228. package/docs/reference/interfaces/FindRequestOptions.md +0 -133
  229. package/docs/reference/interfaces/HttpRequest.md +0 -147
  230. package/docs/reference/interfaces/HttpResponse.md +0 -164
  231. package/docs/reference/interfaces/JWTAuthResult.md +0 -84
  232. package/docs/reference/interfaces/RepoCreateOptions.md +0 -95
  233. package/docs/reference/interfaces/RepoDeleteOptions.md +0 -105
  234. package/docs/reference/interfaces/RepoFindOptions.md +0 -125
  235. package/docs/reference/interfaces/RepoOperationOptions.md +0 -69
  236. package/docs/reference/interfaces/RepoUpdateOptions.md +0 -101
  237. package/docs/reference/interfaces/RequestOptions.md +0 -112
  238. package/docs/reference/interfaces/RequestWS.md +0 -225
  239. package/docs/reference/interfaces/TruncateRequestOptions.md +0 -161
  240. package/docs/reference/interfaces/UpdateRequestOptions.md +0 -139
  241. package/docs/reference/type-aliases/ErrorHandler.md +0 -35
  242. package/docs/reference/type-aliases/NextFunction.md +0 -23
  243. package/docs/reference/type-aliases/OneOrMany.md +0 -19
  244. package/docs/reference/type-aliases/OneOrNull.md +0 -19
  245. package/docs/reference/type-aliases/PartialBaseEntity.md +0 -17
  246. package/docs/reference/type-aliases/PartialSimpleEntity.md +0 -17
  247. package/docs/reference/type-aliases/RequestHandler.md +0 -31
  248. package/docs/reference/type-aliases/UpdateObject.md +0 -19
  249. package/docs/reference/type-aliases/WsUpgradeAuth.md +0 -27
  250. package/docs/reference/type-aliases/WsUpgradeAuthResult.md +0 -47
@@ -1,6 +1,9 @@
1
- export * from "./AdminRoute.js";
2
- export * from "./MetricsRoute.js";
1
+ export * from "./BaseAdminRoute.js";
2
+ export * from "./BaseMetricsRoute.js";
3
+ export * from "./BaseOpenAPIRoute.js";
4
+ export * from "./BasePushRoute.js";
5
+ export * from "./BaseStaticRoute.js";
6
+ export * from "./BaseStatusRoute.js";
7
+ export * from "./CRUDRoute.js";
3
8
  export * from "./ModelRoute.js";
4
- export * from "./OpenAPIRoute.js";
5
9
  export * from "./RouteUtils.js";
6
- export * from "./StatusRoute.js";
@@ -45,7 +45,7 @@ export declare class ACLUtils {
45
45
  * @param entityId The unique identifier of the ACL to retrieve.
46
46
  * @param parentUids The list of already found parent UIDs. This is used to break circular dependencies.
47
47
  */
48
- findACL(entityId: string, parentUids?: string[], reqCache?: Map<string, AccessControlList | null>): Promise<AccessControlList | null>;
48
+ findACL(entityId: string, parentUids?: string[], reqCache?: Map<string, AccessControlList | undefined>): Promise<AccessControlList | undefined>;
49
49
  /**
50
50
  * Deletes the ACL with the given identifier from the database.
51
51
  * @param uid The unique identifier of the ACL to remove.
@@ -90,7 +90,7 @@ export interface AccessControlList {
90
90
  /**
91
91
  * The parent access control list that this instance inherits permissions from.
92
92
  */
93
- parent?: AccessControlList | null;
93
+ parent?: AccessControlList;
94
94
  /**
95
95
  * The universally unique identifier of the parent `AccessControlList` that this object will inherit permissions
96
96
  * from.
@@ -18,7 +18,7 @@ export declare class ACLRecordMongo implements ACLRecord {
18
18
  */
19
19
  export declare class AccessControlListMongo extends BaseMongoEntity implements AccessControlList {
20
20
  parent?: AccessControlList;
21
- parentUid?: string | undefined;
21
+ parentUid?: string;
22
22
  records: ACLRecordMongo[];
23
23
  constructor(other?: any);
24
24
  }
@@ -18,7 +18,7 @@ export declare class ACLRecordSQL implements ACLRecord {
18
18
  */
19
19
  export declare class AccessControlListSQL extends BaseEntity implements AccessControlList {
20
20
  parent?: AccessControlList;
21
- parentUid?: string | undefined;
21
+ parentUid?: string;
22
22
  records: ACLRecordSQL[];
23
23
  constructor(other?: any);
24
24
  }
@@ -0,0 +1,73 @@
1
+ import type { HttpRequest, HttpResponse } from "../http/index.js";
2
+ import { AccessControlList } from "./AccessControlList.js";
3
+ import { JWTUser } from "@rapidrest/core";
4
+ import { UpdateObject } from "../routes/ModelRoute.js";
5
+ import { CRUDRoute } from "../routes/CRUDRoute.js";
6
+ /**
7
+ * The `BaseACLRoute` class provides a base set of endpoints for managing Access Control List records.
8
+ *
9
+ * Exposed endpoints:
10
+ *
11
+ * | Name | HTTP Method | What it does |
12
+ * | --- | --- | --- |
13
+ * | `count` | `HEAD /` | Counts the number of ACLs matching the provided set of criteria in the request's query parameters. Returns the count as the value of the `Content-Length` header. |
14
+ * | `create` | `POST /` | Adds one or more new ACLs to the datastore. |
15
+ * | `delete` | `DELETE /:id` | Removes an existing ACL from the datastore. |
16
+ * | `exists` | `HEAD /:id` | Checks if the ACL with the given ID exists in the datastore. Sets `Content-Length` header to `1` if the ACL exists, otherwise `0`. |
17
+ * | `find` | `GET /` | Returns all ACLs matching the provided set of criteria in the request's query parameters. |
18
+ * | `findById` | `GET /:id` | Returns a single ACL with a specified unique identifier. |
19
+ * | `truncate` | `DELETE /` | Removes all ACLs from the datastore. |
20
+ * | `update` | `PUT /:id` | Modifies an existing ACL in the datastore. |
21
+ * | `updateBulk` | `PUT /` | Modifies multiple existing ACLs in the datastore. |
22
+ * | `updateProperty` | `PUT /:id/:property` | Modifies an single property of the given name of an existing ACL in the datastore. |
23
+ *
24
+ * !!Note!! that the `BaseACLRoute` is not automatically registered with a server by default. You must create
25
+ * your own class that extends `BaseACLRoute` and apply the desired base path with `@Route()`.
26
+ *
27
+ * @example
28
+ * ```ts
29
+ * import { AccessControlListMongo, BaseACLRoute, RouteDecorators } from "@rapidrest/service-core";
30
+ * const { Model, Route } = RouteDecorators;
31
+ *
32
+ * @Model(AccessControlListMongo)
33
+ * @Route("/acls")
34
+ * export class ACLRoute extends BaseACLRoute<AccessControlListMongo> {}
35
+ * ```
36
+ * @example
37
+ * ```ts
38
+ * import { AccessControlListSQL, BaseACLRoute, RouteDecorators } from "@rapidrest/service-core";
39
+ * const { Model, Route } = RouteDecorators;
40
+ *
41
+ * @Model(AccessControlListSQL)
42
+ * @Route("/acls")
43
+ * export class ACLRoute extends BaseACLRoute<AccessControlListSQL> {}
44
+ * ```
45
+ *
46
+ * @author Jean-Philippe Steinmetz
47
+ */
48
+ export declare abstract class BaseACLRoute<T extends AccessControlList> extends CRUDRoute<T> {
49
+ protected checkPerms(params: any, user: JWTUser): Promise<void>;
50
+ /**
51
+ * The `default_<uid>` records are regenerated from code on every server startup (see
52
+ * `ACLUtils.saveDefaultACL`) and exist solely to seed the user-editable override record. They must never be
53
+ * deleted or modified directly, even by an administrator, since doing so would have no lasting effect and would
54
+ * only cause confusion.
55
+ */
56
+ protected checkNotDefault(id: string): void;
57
+ /**
58
+ * Bulk updates have no `:id` URI parameter to check a per-record permission against, so unlike `checkPerms`
59
+ * we can't fall back to a per-record `FULL` permission check here. Require a trusted role for every bulk
60
+ * update instead, and disallow touching any `default_<uid>` record (see `checkNotDefault`).
61
+ */
62
+ protected checkPermsBulk(objs: UpdateObject<T>[], user: JWTUser): void;
63
+ count(params: any, query: any, res: HttpResponse, user?: JWTUser): Promise<any>;
64
+ create(obj: T | T[], req: HttpRequest, user?: JWTUser): Promise<T | Array<T>>;
65
+ delete(id: string, version: string | undefined, purge: string | undefined, req: HttpRequest, user?: JWTUser): Promise<void>;
66
+ exists(id: string, query: any, res: HttpResponse, user?: JWTUser): Promise<any>;
67
+ find(params: any, query: any, user?: JWTUser): Promise<Array<T>>;
68
+ findById(id: string, query: any, user?: JWTUser): Promise<T | null>;
69
+ truncate(params: any, query: any, user?: JWTUser): Promise<void>;
70
+ update(id: string, obj: UpdateObject<T>, req: HttpRequest, user?: JWTUser): Promise<T>;
71
+ updateProperty(id: string, propertyName: string, obj: any, user?: JWTUser): Promise<T>;
72
+ updateBulk(obj: UpdateObject<T>[], req: HttpRequest, user?: JWTUser): Promise<T[]>;
73
+ }
@@ -1,2 +1,5 @@
1
1
  export * from "./AccessControlList.js";
2
+ export * from "./AccessControlListMongo.js";
3
+ export * from "./AccessControlListSQL.js";
2
4
  export * from "./ACLUtils.js";
5
+ export * from "./BaseACLRoute.js";
package/package.json CHANGED
@@ -1,129 +1,132 @@
1
- {
2
- "name": "@rapidrest/service-core",
3
- "version": "1.0.0-rc.2",
4
- "description": "Provides all core functionality for RapidREST based backend services.",
5
- "repository": "https://github.com/rapidrest/service-core.git",
6
- "author": "RapidREST <rapidrests@gmail.com>",
7
- "license": "MIT",
8
- "contributors": [
9
- "Jean-Philippe Steinmetz",
10
- "Arthur Thompson",
11
- "Thomas Buscaglia"
12
- ],
13
- "scripts": {
14
- "build": "yarn lint && rimraf dist && tsc",
15
- "deploy-docs": "ts-node tools/gh-pages-publish",
16
- "docs": "typedoc --plugin typedoc-plugin-markdown --out docs/reference src",
17
- "lint": "eslint ./src ./test",
18
- "local-audit": "yarn install && yarn npm audit -A -R \"$@\"",
19
- "checkup": "yarn dlx @yarnpkg/doctor \"$@\"",
20
- "dependency-check": "yarn dlx depcheck \"$@\"",
21
- "report-coverage": "cat ./coverage/lcov.info | coveralls",
22
- "bench": "tsx bench/index.ts",
23
- "bench:baseline": "yarn bench 2>&1 | tee bench/baseline.txt",
24
- "test": "vitest run",
25
- "test:prod": "npm run lint && vitest run --coverage",
26
- "test:watch": "vitest",
27
- "postversion": "git push && git push --tags"
28
- },
29
- "dependencies": {
30
- "axios": "^1.17.0",
31
- "bson": "^7.2.0",
32
- "dayjs": "^1.11.21",
33
- "deepmerge": "^4.3.1",
34
- "node-schedule": "^2.1.1",
35
- "uWebSockets.js": "uNetworking/uWebSockets.js#v20.68.0",
36
- "winston-transport": "^4.9.0",
37
- "ws": "^8.21.0"
38
- },
39
- "peerDependencies": {
40
- "@rapidrest/core": "1.x",
41
- "ioredis": "5.x",
42
- "lodash-es": "4.x",
43
- "mongodb": "^7.0.0",
44
- "openapi3-ts": "4.x",
45
- "prom-client": "15.x",
46
- "reflect-metadata": "0.2.x",
47
- "typeorm": "0.3.x",
48
- "uWebSockets.js": "*",
49
- "winston": "3.x"
50
- },
51
- "peerDependenciesMeta": {
52
- "ioredis": {
53
- "optional": true
54
- },
55
- "mongodb": {
56
- "optional": true
57
- },
58
- "typeorm": {
59
- "optional": true
60
- }
61
- },
62
- "devDependencies": {
63
- "@rapidrest/core": "^1.3.0",
64
- "@swc/core": "^1.15.41",
65
- "@types/ioredis-mock": "^8.2.7",
66
- "@types/node": "^25.9.2",
67
- "@types/node-schedule": "^2.1.8",
68
- "@types/rimraf": "^4.0.5",
69
- "@types/sqlite3": "^5.1.0",
70
- "@types/uuid": "^11.0.0",
71
- "@types/ws": "^8.18.1",
72
- "@typescript-eslint/eslint-plugin": "^8.61.0",
73
- "@typescript-eslint/parser": "^8.61.0",
74
- "@vitest/coverage-v8": "^4.1.8",
75
- "autocannon": "^8.0.0",
76
- "coveralls": "^3.1.1",
77
- "eslint": "^10.4.1",
78
- "eslint-config-prettier": "^10.1.8",
79
- "eslint-plugin-import": "^2.32.0",
80
- "eslint-plugin-jsdoc": "^63.0.2",
81
- "globals": "^17.6.0",
82
- "ioredis": "^5.11.1",
83
- "ioredis-mock": "^8.13.1",
84
- "lodash-es": "^4.18.1",
85
- "mongodb": "^7.3.0",
86
- "mongodb-memory-server": "^11.2.0",
87
- "nconf": "^0.13.0",
88
- "openapi3-ts": "^4.6.0",
89
- "pg": "^8.21.0",
90
- "prom-client": "^15.1.3",
91
- "reflect-metadata": "^0.2.2",
92
- "rimraf": "^6.1.3",
93
- "sqlite3": "^6.0.1",
94
- "ts-node": "^10.9.2",
95
- "tsx": "^4.19.3",
96
- "typedoc": "^0.28.19",
97
- "typedoc-plugin-markdown": "^4.12.0",
98
- "typeorm": "^0.3.20",
99
- "typescript": "^6.0.3",
100
- "unplugin-swc": "^1.5.9",
101
- "uuid": "^14.0.0",
102
- "vitest": "^4.1.8",
103
- "winston": "^3.19.0",
104
- "ws": "^8.21.0"
105
- },
106
- "resolutions": {
107
- "cross-spawn": "^7.0.5"
108
- },
109
- "packageManager": "yarn@4.5.3",
110
- "engines": {
111
- "node": ">=24.0.0"
112
- },
113
- "publishConfig": {
114
- "registry": "https://registry.npmjs.org/"
115
- },
116
- "type": "module",
117
- "main": "dist/lib/index.js",
118
- "exports": {
119
- ".": {
120
- "import": "./dist/lib/index.js",
121
- "types": "./dist/types/index.d.ts"
122
- }
123
- },
124
- "typings": "dist/types/index.d.ts",
125
- "files": [
126
- "dist",
127
- "docs"
128
- ]
129
- }
1
+ {
2
+ "name": "@rapidrest/service-core",
3
+ "version": "1.0.0-rc.21",
4
+ "description": "Provides all core functionality for RapidREST based backend services.",
5
+ "repository": "https://github.com/rapidrest/service-core.git",
6
+ "author": "RapidREST <rapidrests@gmail.com>",
7
+ "license": "MIT",
8
+ "contributors": [
9
+ "Jean-Philippe Steinmetz",
10
+ "Arthur Thompson",
11
+ "Thomas Buscaglia"
12
+ ],
13
+ "scripts": {
14
+ "build": "yarn lint && rimraf dist && tsc",
15
+ "lint": "eslint ./src ./test",
16
+ "local-audit": "yarn install && yarn npm audit -A -R \"$@\"",
17
+ "checkup": "yarn dlx @yarnpkg/doctor \"$@\"",
18
+ "dependency-check": "yarn dlx depcheck \"$@\"",
19
+ "report-coverage": "cat ./coverage/lcov.info | coveralls",
20
+ "bench": "tsx bench/index.ts",
21
+ "bench:baseline": "yarn bench 2>&1 | tee bench/baseline.txt",
22
+ "test": "vitest run",
23
+ "test:prod": "npm run lint && vitest run --coverage",
24
+ "test:watch": "vitest",
25
+ "postversion": "git push && git push --tags"
26
+ },
27
+ "dependencies": {
28
+ "axios": "^1.17.0",
29
+ "dayjs": "^1.11.21",
30
+ "deepmerge": "^4.3.1",
31
+ "node-schedule": "^2.1.1",
32
+ "uWebSockets.js": "uNetworking/uWebSockets.js#v20.68.0",
33
+ "winston-transport": "^4.9.0",
34
+ "ws": "^8.21.0"
35
+ },
36
+ "peerDependencies": {
37
+ "@rapidrest/core": "1.x",
38
+ "ioredis": "5.x",
39
+ "lodash-es": "4.x",
40
+ "mongodb": "^7.0.0",
41
+ "openapi3-ts": "4.x",
42
+ "prom-client": "15.x",
43
+ "reflect-metadata": "0.2.x",
44
+ "typeorm": "0.3.x",
45
+ "uWebSockets.js": "*",
46
+ "winston": "3.x"
47
+ },
48
+ "peerDependenciesMeta": {
49
+ "ioredis": {
50
+ "optional": true
51
+ },
52
+ "mongodb": {
53
+ "optional": true
54
+ },
55
+ "typeorm": {
56
+ "optional": true
57
+ }
58
+ },
59
+ "devDependencies": {
60
+ "@rapidrest/core": "^1.3.2",
61
+ "@swc/core": "^1.15.41",
62
+ "@types/ioredis-mock": "^8.2.7",
63
+ "@types/node": "^25.9.2",
64
+ "@types/node-schedule": "^2.1.8",
65
+ "@types/rimraf": "^4.0.5",
66
+ "@types/sqlite3": "^5.1.0",
67
+ "@types/uuid": "^11.0.0",
68
+ "@types/ws": "^8.18.1",
69
+ "@typescript-eslint/eslint-plugin": "^8.61.0",
70
+ "@typescript-eslint/parser": "^8.61.0",
71
+ "@vitest/coverage-v8": "^4.1.8",
72
+ "autocannon": "^8.0.0",
73
+ "coveralls": "^3.1.1",
74
+ "eslint": "^10.4.1",
75
+ "eslint-config-prettier": "^10.1.8",
76
+ "eslint-plugin-import": "^2.32.0",
77
+ "eslint-plugin-jsdoc": "^63.0.2",
78
+ "globals": "^17.6.0",
79
+ "ioredis": "^5.11.1",
80
+ "ioredis-mock": "^8.13.1",
81
+ "lodash-es": "^4.18.1",
82
+ "mongodb": "^7.3.0",
83
+ "mongodb-memory-server": "^11.2.0",
84
+ "nconf": "^0.13.0",
85
+ "openapi3-ts": "^4.6.0",
86
+ "pg": "^8.21.0",
87
+ "prom-client": "^15.1.3",
88
+ "reflect-metadata": "^0.2.2",
89
+ "rimraf": "^6.1.3",
90
+ "sqlite3": "^6.0.1",
91
+ "ts-node": "^10.9.2",
92
+ "tsx": "^4.19.3",
93
+ "typedoc": "^0.28.19",
94
+ "typedoc-plugin-markdown": "^4.12.0",
95
+ "typeorm": "^0.3.20",
96
+ "typescript": "^6.0.3",
97
+ "unplugin-swc": "^1.5.9",
98
+ "uuid": "^14.0.0",
99
+ "vitest": "^4.1.8",
100
+ "winston": "^3.19.0",
101
+ "ws": "^8.21.0"
102
+ },
103
+ "resolutions": {
104
+ "cross-spawn": "^7.0.5"
105
+ },
106
+ "packageManager": "yarn@4.5.3",
107
+ "engines": {
108
+ "node": ">=24.0.0"
109
+ },
110
+ "publishConfig": {
111
+ "registry": "https://registry.npmjs.org/"
112
+ },
113
+ "type": "module",
114
+ "main": "dist/lib/index.js",
115
+ "exports": {
116
+ ".": {
117
+ "import": "./dist/lib/index.js",
118
+ "types": "./dist/types/index.d.ts"
119
+ },
120
+ "./test": {
121
+ "import": "./dist/lib/test/index.js",
122
+ "types": "./dist/types/test/index.d.ts"
123
+ },
124
+ "./tsconfig": "./tsconfig.export.json"
125
+ },
126
+ "typings": "dist/types/index.d.ts",
127
+ "files": [
128
+ "dist",
129
+ "docs",
130
+ "tsconfig.export.json"
131
+ ]
132
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "compilerOptions": {
3
+ "moduleResolution": "NodeNext",
4
+ "target": "ES2020",
5
+ "module": "NodeNext",
6
+ "strict": true,
7
+ "sourceMap": false,
8
+ "declaration": false,
9
+ "allowSyntheticDefaultImports": true,
10
+ "experimentalDecorators": true,
11
+ "emitDecoratorMetadata": true,
12
+ "noImplicitAny": false,
13
+ "rootDir": "src",
14
+ "outDir": "dist"
15
+ },
16
+ "include": ["src"]
17
+ }
@@ -1 +0,0 @@
1
- {"version":3,"file":"AdminRoute.js","sourceRoot":"","sources":["../../../src/routes/AdminRoute.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+EAA+E;AAC/E,kDAAkD;AAClD,+EAA+E;AAC/E,OAAO,EAAE,QAAQ,EAAW,gBAAgB,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjF,OAAO,EAAE,KAAK,EAAc,MAAM,SAAS,CAAC;AAC5C,OAAO,SAAS,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAC1G,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAEtE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC9D,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,gBAAgB,CAAC;AAElD;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,SAAS;IAIzC,YAAY,IAAS;QACjB,KAAK,CAAC,IAAI,CAAC,CAAC;QACZ,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC;QAChC,IAA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O;QACV,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;IAClC,CAAC;IAOM,OAAO;QACV,OAAO,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC;IACxC,CAAC;CACJ,CAAA;AApCW;IADP,MAAM,CAAC,WAAW,CAAC;8BACH,WAAW;6CAAqB;AAO1C;IALN,OAAO,CAAC,sCAAsC,CAAC;IAC/C,WAAW,CAAC,mEAAmE,CAAC;IAChF,GAAG,EAAE;IACL,WAAW,CAAC,WAAW,CAAC;IACxB,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;;;;2CAGjB;AAOM;IALN,OAAO,CAAC,0BAA0B,CAAC;IACnC,WAAW,CAAC,mEAAmE,CAAC;IAChF,GAAG,CAAC,UAAU,CAAC;IACf,WAAW,CAAC,WAAW,CAAC;IACxB,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;;;;8CAGjB;AAMM;IAJN,OAAO,CAAC,sCAAsC,CAAC;IAC/C,WAAW,CAAC,mEAAmE,CAAC;IAChF,GAAG,CAAC,cAAc,CAAC;IACnB,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;;;;2CAGjB;AAOM;IALN,OAAO,CAAC,sCAAsC,CAAC;IAC/C,WAAW,CAAC,mEAAmE,CAAC;IAChF,GAAG,CAAC,cAAc,CAAC;IACnB,WAAW,CAAC,WAAW,CAAC;IACxB,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;;;;2CAGjB;AAtCQ,YAAY;IADxB,KAAK,CAAC,GAAG,CAAC;GACE,YAAY,CAuCxB"}
@@ -1,55 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- var __metadata = (this && this.__metadata) || function (k, v) {
8
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
- };
10
- ///////////////////////////////////////////////////////////////////////////////
11
- // Copyright (C) 2020-2026 Jean-Philippe Steinmetz
12
- ///////////////////////////////////////////////////////////////////////////////
13
- import { Get, Route } from "../decorators/RouteDecorators.js";
14
- import { Description, Returns, Summary } from "../decorators/DocDecorators.js";
15
- import { ObjectDecorators } from "@rapidrest/core";
16
- import { StatusExtraData } from "../models/StatusExtraData.js";
17
- const { Config, Inject } = ObjectDecorators;
18
- /**
19
- * The `StatusRoute` provides a default `/status` endpoint the returns metadata information about the service such as
20
- * name, version.
21
- *
22
- * @author Jean-Philippe Steinmetz
23
- */
24
- let StatusRoute = class StatusRoute {
25
- get() {
26
- return {
27
- name: this.config.get("service_name"),
28
- time: new Date().toISOString(),
29
- version: this.config.get("version"),
30
- ...this.statusExtraData?.data
31
- };
32
- }
33
- };
34
- __decorate([
35
- Config(),
36
- __metadata("design:type", Object)
37
- ], StatusRoute.prototype, "config", void 0);
38
- __decorate([
39
- Inject(StatusExtraData),
40
- __metadata("design:type", Object)
41
- ], StatusRoute.prototype, "statusExtraData", void 0);
42
- __decorate([
43
- Summary("{{serviceName}} servrice and operational status"),
44
- Description("Returns information about the service and it's operational status."),
45
- Get(),
46
- Returns([Object]),
47
- __metadata("design:type", Function),
48
- __metadata("design:paramtypes", []),
49
- __metadata("design:returntype", Object)
50
- ], StatusRoute.prototype, "get", null);
51
- StatusRoute = __decorate([
52
- Route("/status")
53
- ], StatusRoute);
54
- export { StatusRoute };
55
- //# sourceMappingURL=StatusRoute.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"StatusRoute.js","sourceRoot":"","sources":["../../../src/routes/StatusRoute.ts"],"names":[],"mappings":";;;;;;;;;AAAA,+EAA+E;AAC/E,kDAAkD;AAClD,+EAA+E;AAC/E,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,gBAAgB,CAAC;AAE5C;;;;;GAKG;AAEI,IAAM,WAAW,GAAjB,MAAM,WAAW;IAYZ,GAAG;QACP,OAAO;YACH,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC;YACrC,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YAC9B,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC;YACnC,GAAG,IAAI,CAAC,eAAe,EAAE,IAAI;SAChC,CAAC;IACN,CAAC;CACJ,CAAA;AAlBW;IADP,MAAM,EAAE;;2CACW;AAGZ;IADP,MAAM,CAAC,eAAe,CAAC;;oDAC6B;AAO7C;IAJP,OAAO,CAAC,iDAAiD,CAAC;IAC1D,WAAW,CAAC,oEAAoE,CAAC;IACjF,GAAG,EAAE;IACL,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;;;;sCAQjB;AAnBQ,WAAW;IADvB,KAAK,CAAC,SAAS,CAAC;GACJ,WAAW,CAoBvB"}