@rapidrest/service-core 1.0.0-rc.13 → 1.0.0-rc.16

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 (220) hide show
  1. package/dist/lib/OpenApiSpec.js +3 -2
  2. package/dist/lib/OpenApiSpec.js.map +1 -1
  3. package/dist/lib/Server.js +16 -71
  4. package/dist/lib/Server.js.map +1 -1
  5. package/dist/lib/database/TypeOrmSupport.js +18 -2
  6. package/dist/lib/database/TypeOrmSupport.js.map +1 -1
  7. package/dist/lib/decorators/DocDecorators.js +19 -1
  8. package/dist/lib/decorators/DocDecorators.js.map +1 -1
  9. package/dist/lib/decorators/PersistenceDecorators.js.map +1 -1
  10. package/dist/lib/models/RepoUtils.js.map +1 -1
  11. package/dist/lib/routes/{AdminRoute.js → BaseAdminRoute.js} +45 -36
  12. package/dist/lib/routes/BaseAdminRoute.js.map +1 -0
  13. package/dist/lib/routes/{MetricsRoute.js → BaseMetricsRoute.js} +28 -15
  14. package/dist/lib/routes/BaseMetricsRoute.js.map +1 -0
  15. package/dist/lib/routes/{OpenAPIRoute.js → BaseOpenAPIRoute.js} +31 -32
  16. package/dist/lib/routes/BaseOpenAPIRoute.js.map +1 -0
  17. package/dist/lib/routes/BasePushRoute.js +193 -0
  18. package/dist/lib/routes/BasePushRoute.js.map +1 -0
  19. package/dist/lib/routes/{StatusRoute.js → BaseStatusRoute.js} +36 -16
  20. package/dist/lib/routes/BaseStatusRoute.js.map +1 -0
  21. package/dist/lib/routes/CRUDRoute.js +13 -10
  22. package/dist/lib/routes/CRUDRoute.js.map +1 -1
  23. package/dist/lib/routes/index.js +5 -4
  24. package/dist/lib/routes/index.js.map +1 -1
  25. package/dist/lib/security/ACLUtils.js +7 -7
  26. package/dist/lib/security/ACLUtils.js.map +1 -1
  27. package/dist/lib/security/AccessControlListMongo.js +5 -1
  28. package/dist/lib/security/AccessControlListMongo.js.map +1 -1
  29. package/dist/lib/security/AccessControlListSQL.js +7 -3
  30. package/dist/lib/security/AccessControlListSQL.js.map +1 -1
  31. package/dist/lib/security/{ACLRouteMongo.js → BaseACLRoute.js} +59 -23
  32. package/dist/lib/security/BaseACLRoute.js.map +1 -0
  33. package/dist/lib/security/index.js +3 -0
  34. package/dist/lib/security/index.js.map +1 -1
  35. package/dist/lib/test/request.js +6 -2
  36. package/dist/lib/test/request.js.map +1 -1
  37. package/dist/types/Server.d.ts +21 -6
  38. package/dist/types/decorators/DocDecorators.d.ts +9 -0
  39. package/dist/types/decorators/PersistenceDecorators.d.ts +7 -0
  40. package/dist/types/routes/BaseAdminRoute.d.ts +59 -0
  41. package/dist/types/routes/BaseMetricsRoute.d.ts +37 -0
  42. package/dist/types/routes/BaseOpenAPIRoute.d.ts +33 -0
  43. package/dist/types/routes/BasePushRoute.d.ts +39 -0
  44. package/dist/types/routes/BaseStatusRoute.d.ts +37 -0
  45. package/dist/types/routes/CRUDRoute.d.ts +13 -10
  46. package/dist/types/routes/index.d.ts +5 -4
  47. package/dist/types/security/ACLUtils.d.ts +1 -1
  48. package/dist/types/security/AccessControlList.d.ts +1 -1
  49. package/dist/types/security/AccessControlListMongo.d.ts +1 -1
  50. package/dist/types/security/AccessControlListSQL.d.ts +1 -1
  51. package/dist/types/security/BaseACLRoute.d.ts +73 -0
  52. package/dist/types/security/index.d.ts +3 -0
  53. package/package.json +2 -5
  54. package/dist/lib/routes/AdminRoute.js.map +0 -1
  55. package/dist/lib/routes/MetricsRoute.js.map +0 -1
  56. package/dist/lib/routes/OpenAPIRoute.js.map +0 -1
  57. package/dist/lib/routes/StatusRoute.js.map +0 -1
  58. package/dist/lib/security/ACLRouteMongo.js.map +0 -1
  59. package/dist/lib/security/ACLRouteSQL.js +0 -201
  60. package/dist/lib/security/ACLRouteSQL.js.map +0 -1
  61. package/dist/types/routes/AdminRoute.d.ts +0 -47
  62. package/dist/types/routes/MetricsRoute.d.ts +0 -15
  63. package/dist/types/routes/OpenAPIRoute.d.ts +0 -17
  64. package/dist/types/routes/StatusRoute.d.ts +0 -12
  65. package/dist/types/security/ACLRouteMongo.d.ts +0 -31
  66. package/dist/types/security/ACLRouteSQL.d.ts +0 -31
  67. package/docs/Makefile +0 -20
  68. package/docs/conf.py +0 -58
  69. package/docs/index.rst +0 -17
  70. package/docs/make.bat +0 -35
  71. package/docs/reference/@rapidrest/namespaces/DatabaseDecorators/README.md +0 -13
  72. package/docs/reference/@rapidrest/namespaces/DatabaseDecorators/functions/MongoRepository.md +0 -25
  73. package/docs/reference/@rapidrest/namespaces/DatabaseDecorators/functions/RedisConnection.md +0 -25
  74. package/docs/reference/@rapidrest/namespaces/DatabaseDecorators/functions/Repository.md +0 -25
  75. package/docs/reference/@rapidrest/namespaces/DocDecorators/README.md +0 -23
  76. package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Default.md +0 -25
  77. package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Description.md +0 -25
  78. package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Document.md +0 -25
  79. package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Example.md +0 -25
  80. package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Format.md +0 -25
  81. package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Returns.md +0 -28
  82. package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Summary.md +0 -25
  83. package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Tags.md +0 -25
  84. package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/TypeInfo.md +0 -28
  85. package/docs/reference/@rapidrest/namespaces/DocDecorators/interfaces/DocumentsData.md +0 -57
  86. package/docs/reference/@rapidrest/namespaces/EventDecorators/README.md +0 -12
  87. package/docs/reference/@rapidrest/namespaces/EventDecorators/functions/EventListener.md +0 -17
  88. package/docs/reference/@rapidrest/namespaces/EventDecorators/functions/OnEvent.md +0 -26
  89. package/docs/reference/@rapidrest/namespaces/ModelDecorators/README.md +0 -26
  90. package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/Cache.md +0 -25
  91. package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/ChildEntity.md +0 -18
  92. package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/DataStore.md +0 -25
  93. package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/Identifier.md +0 -27
  94. package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/Protect.md +0 -35
  95. package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/Reference.md +0 -25
  96. package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/Shard.md +0 -27
  97. package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/TrackChanges.md +0 -26
  98. package/docs/reference/@rapidrest/namespaces/ModelDecorators/interfaces/PendingTypeOrmColumn.md +0 -45
  99. package/docs/reference/@rapidrest/namespaces/ModelDecorators/variables/pendingTypeOrmColumns.md +0 -14
  100. package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/README.md +0 -27
  101. package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/Column.md +0 -25
  102. package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/Entity.md +0 -25
  103. package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/Index.md +0 -119
  104. package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/PrimaryColumn.md +0 -25
  105. package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/Unique.md +0 -68
  106. package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/getColumnMetadata.md +0 -26
  107. package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/getEntityName.md +0 -26
  108. package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/getIndexMetadata.md +0 -27
  109. package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/interfaces/CollationOptions.md +0 -79
  110. package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/interfaces/ColumnInfo.md +0 -41
  111. package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/interfaces/ColumnOptions.md +0 -51
  112. package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/interfaces/EntityOptions.md +0 -32
  113. package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/interfaces/IndexInfo.md +0 -41
  114. package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/interfaces/IndexOptions.md +0 -61
  115. package/docs/reference/@rapidrest/namespaces/RouteDecorators/README.md +0 -36
  116. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/After.md +0 -26
  117. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Auth.md +0 -33
  118. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/AuthResult.md +0 -31
  119. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Before.md +0 -25
  120. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/ContentType.md +0 -25
  121. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Delete.md +0 -25
  122. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Get.md +0 -25
  123. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Head.md +0 -25
  124. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Header.md +0 -25
  125. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Method.md +0 -31
  126. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Model.md +0 -25
  127. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Options.md +0 -25
  128. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Param.md +0 -26
  129. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Patch.md +0 -25
  130. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Post.md +0 -25
  131. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Protect.md +0 -31
  132. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Put.md +0 -25
  133. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Query.md +0 -26
  134. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Request.md +0 -31
  135. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/RequiresRole.md +0 -26
  136. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Response.md +0 -31
  137. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Route.md +0 -25
  138. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Socket.md +0 -33
  139. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/User.md +0 -31
  140. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Validate.md +0 -25
  141. package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/WebSocket.md +0 -25
  142. package/docs/reference/README.md +0 -20
  143. package/docs/reference/classes/ACLUtils.md +0 -263
  144. package/docs/reference/classes/AdminRoute.md +0 -51
  145. package/docs/reference/classes/AuthMiddleware.md +0 -173
  146. package/docs/reference/classes/BackgroundService.md +0 -117
  147. package/docs/reference/classes/BackgroundServiceManager.md +0 -172
  148. package/docs/reference/classes/BaseEntity.md +0 -82
  149. package/docs/reference/classes/BaseMongoEntity.md +0 -107
  150. package/docs/reference/classes/BasicStrategy.md +0 -131
  151. package/docs/reference/classes/BasicStrategyOptions.md +0 -115
  152. package/docs/reference/classes/BulkError.md +0 -271
  153. package/docs/reference/classes/ConnectionManager.md +0 -75
  154. package/docs/reference/classes/EventListenerManager.md +0 -88
  155. package/docs/reference/classes/HttpRouter.md +0 -343
  156. package/docs/reference/classes/JWTStrategy.md +0 -100
  157. package/docs/reference/classes/JWTStrategyOptions.md +0 -97
  158. package/docs/reference/classes/MetricsRoute.md +0 -27
  159. package/docs/reference/classes/ModelRoute.md +0 -534
  160. package/docs/reference/classes/ModelUtils.md +0 -446
  161. package/docs/reference/classes/MongoConnection.md +0 -218
  162. package/docs/reference/classes/MongoRepository.md +0 -390
  163. package/docs/reference/classes/MongoSchemaSync.md +0 -97
  164. package/docs/reference/classes/NetUtils.md +0 -90
  165. package/docs/reference/classes/NotificationUtils.md +0 -77
  166. package/docs/reference/classes/ObjectFactory.md +0 -336
  167. package/docs/reference/classes/OpenAPIRoute.md +0 -77
  168. package/docs/reference/classes/OpenApiSpec.md +0 -892
  169. package/docs/reference/classes/RecoverableBaseEntity.md +0 -114
  170. package/docs/reference/classes/RecoverableBaseMongoEntity.md +0 -124
  171. package/docs/reference/classes/RedisTransport.md +0 -2202
  172. package/docs/reference/classes/RepoUtils.md +0 -482
  173. package/docs/reference/classes/RouteUtils.md +0 -191
  174. package/docs/reference/classes/Server.md +0 -408
  175. package/docs/reference/classes/SimpleEntity.md +0 -48
  176. package/docs/reference/classes/SimpleMongoEntity.md +0 -66
  177. package/docs/reference/classes/StatusExtraData.md +0 -57
  178. package/docs/reference/classes/StatusRoute.md +0 -26
  179. package/docs/reference/classes/UWSRequest.md +0 -226
  180. package/docs/reference/classes/UWSResponse.md +0 -257
  181. package/docs/reference/classes/UWSWebSocketShim.md +0 -958
  182. package/docs/reference/enumerations/ACLAction.md +0 -63
  183. package/docs/reference/enumerations/ApiErrorMessages.md +0 -123
  184. package/docs/reference/enumerations/ApiErrors.md +0 -123
  185. package/docs/reference/functions/createWebSocketStream.md +0 -27
  186. package/docs/reference/functions/isSqlDataSource.md +0 -26
  187. package/docs/reference/functions/readBody.md +0 -29
  188. package/docs/reference/functions/resolveCollectionName.md +0 -33
  189. package/docs/reference/functions/runChain.md +0 -40
  190. package/docs/reference/functions/snakeCase.md +0 -28
  191. package/docs/reference/globals.md +0 -106
  192. package/docs/reference/interfaces/ACLRecord.md +0 -96
  193. package/docs/reference/interfaces/AccessControlList.md +0 -76
  194. package/docs/reference/interfaces/AuthResult.md +0 -55
  195. package/docs/reference/interfaces/AuthStrategy.md +0 -95
  196. package/docs/reference/interfaces/CreateRequestOptions.md +0 -121
  197. package/docs/reference/interfaces/DeleteRequestOptions.md +0 -137
  198. package/docs/reference/interfaces/FindRequestOptions.md +0 -133
  199. package/docs/reference/interfaces/HttpRequest.md +0 -147
  200. package/docs/reference/interfaces/HttpResponse.md +0 -164
  201. package/docs/reference/interfaces/JWTAuthResult.md +0 -84
  202. package/docs/reference/interfaces/RepoCreateOptions.md +0 -95
  203. package/docs/reference/interfaces/RepoDeleteOptions.md +0 -105
  204. package/docs/reference/interfaces/RepoFindOptions.md +0 -125
  205. package/docs/reference/interfaces/RepoOperationOptions.md +0 -69
  206. package/docs/reference/interfaces/RepoUpdateOptions.md +0 -101
  207. package/docs/reference/interfaces/RequestOptions.md +0 -112
  208. package/docs/reference/interfaces/RequestWS.md +0 -225
  209. package/docs/reference/interfaces/TruncateRequestOptions.md +0 -161
  210. package/docs/reference/interfaces/UpdateRequestOptions.md +0 -139
  211. package/docs/reference/type-aliases/ErrorHandler.md +0 -35
  212. package/docs/reference/type-aliases/NextFunction.md +0 -23
  213. package/docs/reference/type-aliases/OneOrMany.md +0 -19
  214. package/docs/reference/type-aliases/OneOrNull.md +0 -19
  215. package/docs/reference/type-aliases/PartialBaseEntity.md +0 -17
  216. package/docs/reference/type-aliases/PartialSimpleEntity.md +0 -17
  217. package/docs/reference/type-aliases/RequestHandler.md +0 -31
  218. package/docs/reference/type-aliases/UpdateObject.md +0 -19
  219. package/docs/reference/type-aliases/WsUpgradeAuth.md +0 -27
  220. package/docs/reference/type-aliases/WsUpgradeAuthResult.md +0 -47
@@ -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,6 +1,6 @@
1
1
  {
2
2
  "name": "@rapidrest/service-core",
3
- "version": "1.0.0-rc.13",
3
+ "version": "1.0.0-rc.16",
4
4
  "description": "Provides all core functionality for RapidREST based backend services.",
5
5
  "repository": "https://github.com/rapidrest/service-core.git",
6
6
  "author": "RapidREST <rapidrests@gmail.com>",
@@ -12,8 +12,6 @@
12
12
  ],
13
13
  "scripts": {
14
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
15
  "lint": "eslint ./src ./test",
18
16
  "local-audit": "yarn install && yarn npm audit -A -R \"$@\"",
19
17
  "checkup": "yarn dlx @yarnpkg/doctor \"$@\"",
@@ -28,7 +26,6 @@
28
26
  },
29
27
  "dependencies": {
30
28
  "axios": "^1.17.0",
31
- "bson": "^7.2.0",
32
29
  "dayjs": "^1.11.21",
33
30
  "deepmerge": "^4.3.1",
34
31
  "node-schedule": "^2.1.1",
@@ -60,7 +57,7 @@
60
57
  }
61
58
  },
62
59
  "devDependencies": {
63
- "@rapidrest/core": "^1.3.0",
60
+ "@rapidrest/core": "^1.3.2",
64
61
  "@swc/core": "^1.15.41",
65
62
  "@types/ioredis-mock": "^8.2.7",
66
63
  "@types/node": "^25.9.2",
@@ -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,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E,CAAA;IAAc,WAAA,IAAI,CAAA;;;;6CAE/D;AAGM;IADN,MAAM,CAAC,CAAC,YAAY,EAAE,iBAAiB,CAAC,CAAC;IAErC,WAAA,KAAK,CAAC,IAAI,CAAC,CAAA;IAEX,WAAA,OAAO,CAAA;IACP,WAAA,IAAI,CAAA;;;;2CAGR;AAGM;IADN,MAAM,CAAC,YAAY,CAAC;IAEhB,WAAA,KAAK,CAAC,IAAI,CAAC,CAAA;IACX,WAAA,KAAK,CAAC,UAAU,CAAC,CAAA;IAEjB,WAAA,IAAI,CAAA;;;;mDAGR;AAGM;IADN,MAAM,CAAC,gBAAgB,CAAC;IAGpB,WAAA,OAAO,CAAA;IACP,WAAA,IAAI,CAAA;;;;+CAGR;AApIQ,aAAa;IAFzB,KAAK,CAAC,sBAAsB,CAAC;IAC7B,KAAK,CAAC,OAAO,CAAC;GACF,aAAa,CAqIzB"}
@@ -1,201 +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
- var __param = (this && this.__param) || function (paramIndex, decorator) {
11
- return function (target, key) { decorator(target, key, paramIndex); }
12
- };
13
- import { AccessControlListSQL } from "./AccessControlListSQL.js";
14
- import { ACLAction } from "./AccessControlList.js";
15
- import { ApiError, UserUtils } from "@rapidrest/core";
16
- import { ApiErrorMessages } from "../ApiErrors.js";
17
- import { Before, Model, Param, Query, Request, Response, Route, User } from "../decorators/RouteDecorators.js";
18
- import { CRUDRoute } from "../routes/CRUDRoute.js";
19
- let ACLRouteSQL = class ACLRouteSQL extends CRUDRoute {
20
- async checkPerms(params, user) {
21
- if (!user ||
22
- (!UserUtils.hasRoles(user, this.config.get("trusted_roles")) &&
23
- !(params.id && (await this.aclUtils?.hasPermission(user, params.id, ACLAction.FULL))))) {
24
- throw new ApiError(ApiErrorMessages.AUTH_PERMISSION_FAILURE, 403, ApiErrorMessages.AUTH_PERMISSION_FAILURE);
25
- }
26
- }
27
- /**
28
- * The `default_<uid>` records are regenerated from code on every server startup (see
29
- * `ACLUtils.saveDefaultACL`) and exist solely to seed the user-editable override record. They must never be
30
- * deleted or modified directly, even by an administrator, since doing so would have no lasting effect and would
31
- * only cause confusion.
32
- */
33
- checkNotDefault(id) {
34
- if (id && id.startsWith("default_")) {
35
- throw new ApiError(ApiErrorMessages.AUTH_PERMISSION_FAILURE, 403, ApiErrorMessages.AUTH_PERMISSION_FAILURE);
36
- }
37
- }
38
- /**
39
- * Bulk updates have no `:id` URI parameter to check a per-record permission against, so unlike `checkPerms`
40
- * we can't fall back to a per-record `FULL` permission check here. Require a trusted role for every bulk
41
- * update instead, and disallow touching any `default_<uid>` record (see `checkNotDefault`).
42
- */
43
- checkPermsBulk(objs, user) {
44
- if (!user) {
45
- throw new ApiError(ApiErrorMessages.AUTH_REQUIRED, 401, ApiErrorMessages.AUTH_REQUIRED);
46
- }
47
- if (!UserUtils.hasRoles(user, this.config.get("trusted_roles"))) {
48
- throw new ApiError(ApiErrorMessages.AUTH_PERMISSION_FAILURE, 403, ApiErrorMessages.AUTH_PERMISSION_FAILURE);
49
- }
50
- if (objs?.some((obj) => obj.uid && obj.uid.startsWith("default_"))) {
51
- throw new ApiError(ApiErrorMessages.AUTH_PERMISSION_FAILURE, 403, ApiErrorMessages.AUTH_PERMISSION_FAILURE);
52
- }
53
- }
54
- count(params, query, res, user) {
55
- return super.count(params, query, res, user);
56
- }
57
- create(obj, req, user) {
58
- return super.create(obj, req, user);
59
- }
60
- delete(id, version, purge, req, user) {
61
- return super.delete(id, version, purge, req, user);
62
- }
63
- exists(id, query, res, user) {
64
- return super.exists(id, query, res, user);
65
- }
66
- find(params, query, user) {
67
- return super.find(params, query, user);
68
- }
69
- async findById(id, query, user) {
70
- return super.findById(id, query, user);
71
- }
72
- truncate(params, query, user) {
73
- return super.truncate(params, query, user);
74
- }
75
- update(id, obj, req, user) {
76
- return super.update(id, obj, req, user);
77
- }
78
- updateProperty(id, propertyName, obj, user) {
79
- return super.updateProperty(id, propertyName, obj, user);
80
- }
81
- updateBulk(obj, req, user) {
82
- return super.updateBulk(obj, req, user);
83
- }
84
- };
85
- __decorate([
86
- __param(0, Param()),
87
- __param(1, User),
88
- __metadata("design:type", Function),
89
- __metadata("design:paramtypes", [Object, Object]),
90
- __metadata("design:returntype", Promise)
91
- ], ACLRouteSQL.prototype, "checkPerms", null);
92
- __decorate([
93
- __param(0, Param("id")),
94
- __metadata("design:type", Function),
95
- __metadata("design:paramtypes", [String]),
96
- __metadata("design:returntype", void 0)
97
- ], ACLRouteSQL.prototype, "checkNotDefault", null);
98
- __decorate([
99
- __param(1, User),
100
- __metadata("design:type", Function),
101
- __metadata("design:paramtypes", [Array, Object]),
102
- __metadata("design:returntype", void 0)
103
- ], ACLRouteSQL.prototype, "checkPermsBulk", null);
104
- __decorate([
105
- Before("checkPerms"),
106
- __param(0, Param()),
107
- __param(1, Query()),
108
- __param(2, Response),
109
- __param(3, User),
110
- __metadata("design:type", Function),
111
- __metadata("design:paramtypes", [Object, Object, Object, Object]),
112
- __metadata("design:returntype", Promise)
113
- ], ACLRouteSQL.prototype, "count", null);
114
- __decorate([
115
- Before("checkPerms"),
116
- __param(1, Request),
117
- __param(2, User),
118
- __metadata("design:type", Function),
119
- __metadata("design:paramtypes", [Object, Object, Object]),
120
- __metadata("design:returntype", Promise)
121
- ], ACLRouteSQL.prototype, "create", null);
122
- __decorate([
123
- Before(["checkPerms", "checkNotDefault"]),
124
- __param(0, Param("id")),
125
- __param(1, Query("version")),
126
- __param(2, Query("purge")),
127
- __param(3, Request),
128
- __param(4, User),
129
- __metadata("design:type", Function),
130
- __metadata("design:paramtypes", [String, Object, Object, Object, Object]),
131
- __metadata("design:returntype", Promise)
132
- ], ACLRouteSQL.prototype, "delete", null);
133
- __decorate([
134
- Before("checkPerms"),
135
- __param(0, Param("id")),
136
- __param(1, Query()),
137
- __param(2, Response),
138
- __param(3, User),
139
- __metadata("design:type", Function),
140
- __metadata("design:paramtypes", [String, Object, Object, Object]),
141
- __metadata("design:returntype", Promise)
142
- ], ACLRouteSQL.prototype, "exists", null);
143
- __decorate([
144
- Before("checkPerms"),
145
- __param(0, Param()),
146
- __param(1, Query()),
147
- __param(2, User),
148
- __metadata("design:type", Function),
149
- __metadata("design:paramtypes", [Object, Object, Object]),
150
- __metadata("design:returntype", Promise)
151
- ], ACLRouteSQL.prototype, "find", null);
152
- __decorate([
153
- Before("checkPerms"),
154
- __param(0, Param("id")),
155
- __param(1, Query()),
156
- __param(2, User),
157
- __metadata("design:type", Function),
158
- __metadata("design:paramtypes", [String, Object, Object]),
159
- __metadata("design:returntype", Promise)
160
- ], ACLRouteSQL.prototype, "findById", null);
161
- __decorate([
162
- Before("checkPerms"),
163
- __param(0, Param()),
164
- __param(1, Query()),
165
- __param(2, User),
166
- __metadata("design:type", Function),
167
- __metadata("design:paramtypes", [Object, Object, Object]),
168
- __metadata("design:returntype", Promise)
169
- ], ACLRouteSQL.prototype, "truncate", null);
170
- __decorate([
171
- Before(["checkPerms", "checkNotDefault"]),
172
- __param(0, Param("id")),
173
- __param(2, Request),
174
- __param(3, User),
175
- __metadata("design:type", Function),
176
- __metadata("design:paramtypes", [String, Object, Object, Object]),
177
- __metadata("design:returntype", Promise)
178
- ], ACLRouteSQL.prototype, "update", null);
179
- __decorate([
180
- Before("checkPerms"),
181
- __param(0, Param("id")),
182
- __param(1, Param("property")),
183
- __param(3, User),
184
- __metadata("design:type", Function),
185
- __metadata("design:paramtypes", [String, String, Object, Object]),
186
- __metadata("design:returntype", Promise)
187
- ], ACLRouteSQL.prototype, "updateProperty", null);
188
- __decorate([
189
- Before("checkPermsBulk"),
190
- __param(1, Request),
191
- __param(2, User),
192
- __metadata("design:type", Function),
193
- __metadata("design:paramtypes", [Array, Object, Object]),
194
- __metadata("design:returntype", Promise)
195
- ], ACLRouteSQL.prototype, "updateBulk", null);
196
- ACLRouteSQL = __decorate([
197
- Model(AccessControlListSQL),
198
- Route("/acls")
199
- ], ACLRouteSQL);
200
- export { ACLRouteSQL };
201
- //# sourceMappingURL=ACLRouteSQL.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ACLRouteSQL.js","sourceRoot":"","sources":["../../../src/security/ACLRouteSQL.ts"],"names":[],"mappings":";;;;;;;;;;;;AAIA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAW,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,kCAAkC,CAAC;AAC/G,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAI5C,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,SAA+B;IAC5C,AAAN,KAAK,CAAC,UAAU,CAAU,MAAW,EAAQ,IAAa;QAChE,IACI,CAAC,IAAI;YACL,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;gBACxD,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,MAAM,IAAI,CAAC,QAAQ,EAAE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A,KAAK,EAAE,CAAA;IAAc,WAAA,IAAI,CAAA;;;;uCAE3D;AAGY;IADZ,MAAM,CAAC,YAAY,CAAC;IAEhB,WAAA,KAAK,CAAC,IAAI,CAAC,CAAA;IACX,WAAA,KAAK,EAAE,CAAA;IACP,WAAA,IAAI,CAAA;;;;2CAGR;AAGM;IADN,MAAM,CAAC,YAAY,CAAC;IACJ,WAAA,KAAK,EAAE,CAAA;IAAe,WAAA,KAAK,EAAE,CAAA;IAAc,WAAA,IAAI,CAAA;;;;2CAE/D;AAGM;IADN,MAAM,CAAC,CAAC,YAAY,EAAE,iBAAiB,CAAC,CAAC;IAErC,WAAA,KAAK,CAAC,IAAI,CAAC,CAAA;IAEX,WAAA,OAAO,CAAA;IACP,WAAA,IAAI,CAAA;;;;yCAGR;AAGM;IADN,MAAM,CAAC,YAAY,CAAC;IAEhB,WAAA,KAAK,CAAC,IAAI,CAAC,CAAA;IACX,WAAA,KAAK,CAAC,UAAU,CAAC,CAAA;IAEjB,WAAA,IAAI,CAAA;;;;iDAGR;AAGM;IADN,MAAM,CAAC,gBAAgB,CAAC;IAGpB,WAAA,OAAO,CAAA;IACP,WAAA,IAAI,CAAA;;;;6CAGR;AA9HQ,WAAW;IAFvB,KAAK,CAAC,oBAAoB,CAAC;IAC3B,KAAK,CAAC,OAAO,CAAC;GACF,WAAW,CA+HvB"}
@@ -1,47 +0,0 @@
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
- }
@@ -1,15 +0,0 @@
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
- }
@@ -1,17 +0,0 @@
1
- /**
2
- * The `OpenAPIRoute` provides default routes to expose the service's OpenAPI specification.
3
- *
4
- * - `GET /` — Swagger UI HTML (loads swagger-ui-dist from CDN)
5
- * - `GET /openapi.json` — raw OpenAPI specification as JSON
6
- * - `GET /openapi.yaml` — raw OpenAPI specification as YAML
7
- *
8
- * @author Jean-Philippe Steinmetz
9
- */
10
- export declare class OpenAPIRoute {
11
- /** The underlying OpenAPI specification. */
12
- private apiSpec;
13
- getHTML(): string;
14
- getAPIDocs(): string;
15
- getJSON(): any;
16
- getYAML(): string;
17
- }
@@ -1,12 +0,0 @@
1
- /**
2
- * The `StatusRoute` provides a default `/status` endpoint the returns metadata information about the service such as
3
- * name, version.
4
- *
5
- * @author Jean-Philippe Steinmetz
6
- */
7
- export declare class StatusRoute {
8
- private serviceName;
9
- private serviceVersion;
10
- private statusExtraData;
11
- private get;
12
- }
@@ -1,31 +0,0 @@
1
- import type { HttpRequest, HttpResponse } from "../http/index.js";
2
- import { AccessControlListMongo } from "./AccessControlListMongo.js";
3
- import { JWTUser } from "@rapidrest/core";
4
- import { UpdateObject } from "../routes/ModelRoute.js";
5
- import { CRUDRoute } from "../routes/CRUDRoute.js";
6
- export declare class ACLRouteMongo extends CRUDRoute<AccessControlListMongo> {
7
- protected checkPerms(params: any, user: JWTUser): Promise<void>;
8
- /**
9
- * The `default_<uid>` records are regenerated from code on every server startup (see
10
- * `ACLUtils.saveDefaultACL`) and exist solely to seed the user-editable override record. They must never be
11
- * deleted or modified directly, even by an administrator, since doing so would have no lasting effect and would
12
- * only cause confusion.
13
- */
14
- protected checkNotDefault(id: string): void;
15
- /**
16
- * Bulk updates have no `:id` URI parameter to check a per-record permission against, so unlike `checkPerms`
17
- * we can't fall back to a per-record `FULL` permission check here. Require a trusted role for every bulk
18
- * update instead, and disallow touching any `default_<uid>` record (see `checkNotDefault`).
19
- */
20
- protected checkPermsBulk(objs: UpdateObject<AccessControlListMongo>[], user: JWTUser): void;
21
- count(params: any, query: any, res: HttpResponse, user?: JWTUser): Promise<any>;
22
- create(obj: AccessControlListMongo | AccessControlListMongo[], req: HttpRequest, user?: JWTUser): Promise<AccessControlListMongo | Array<AccessControlListMongo>>;
23
- delete(id: string, version: string | undefined, purge: string | undefined, req: HttpRequest, user?: JWTUser): Promise<void>;
24
- exists(id: string, query: any, res: HttpResponse, user?: JWTUser): Promise<any>;
25
- find(params: any, query: any, user?: JWTUser): Promise<Array<AccessControlListMongo>>;
26
- findById(id: string, query: any, user?: JWTUser): Promise<AccessControlListMongo | null>;
27
- truncate(params: any, query: any, user?: JWTUser): Promise<void>;
28
- update(id: string, obj: UpdateObject<AccessControlListMongo>, req: HttpRequest, user?: JWTUser): Promise<AccessControlListMongo>;
29
- updateProperty(id: string, propertyName: string, obj: any, user?: JWTUser): Promise<AccessControlListMongo>;
30
- updateBulk(obj: UpdateObject<AccessControlListMongo>[], req: HttpRequest, user?: JWTUser): Promise<AccessControlListMongo[]>;
31
- }
@@ -1,31 +0,0 @@
1
- import type { HttpRequest, HttpResponse } from "../http/index.js";
2
- import { AccessControlListSQL } from "./AccessControlListSQL.js";
3
- import { JWTUser } from "@rapidrest/core";
4
- import { UpdateObject } from "../routes/ModelRoute.js";
5
- import { CRUDRoute } from "../routes/CRUDRoute.js";
6
- export declare class ACLRouteSQL extends CRUDRoute<AccessControlListSQL> {
7
- protected checkPerms(params: any, user: JWTUser): Promise<void>;
8
- /**
9
- * The `default_<uid>` records are regenerated from code on every server startup (see
10
- * `ACLUtils.saveDefaultACL`) and exist solely to seed the user-editable override record. They must never be
11
- * deleted or modified directly, even by an administrator, since doing so would have no lasting effect and would
12
- * only cause confusion.
13
- */
14
- protected checkNotDefault(id: string): void;
15
- /**
16
- * Bulk updates have no `:id` URI parameter to check a per-record permission against, so unlike `checkPerms`
17
- * we can't fall back to a per-record `FULL` permission check here. Require a trusted role for every bulk
18
- * update instead, and disallow touching any `default_<uid>` record (see `checkNotDefault`).
19
- */
20
- protected checkPermsBulk(objs: UpdateObject<AccessControlListSQL>[], user: JWTUser): void;
21
- count(params: any, query: any, res: HttpResponse, user?: JWTUser): Promise<any>;
22
- create(obj: AccessControlListSQL | AccessControlListSQL[], req: HttpRequest, user?: JWTUser): Promise<AccessControlListSQL | Array<AccessControlListSQL>>;
23
- delete(id: string, version: string | undefined, purge: string | undefined, req: HttpRequest, user?: JWTUser): Promise<void>;
24
- exists(id: string, query: any, res: HttpResponse, user?: JWTUser): Promise<any>;
25
- find(params: any, query: any, user?: JWTUser): Promise<Array<AccessControlListSQL>>;
26
- findById(id: string, query: any, user?: JWTUser): Promise<AccessControlListSQL | null>;
27
- truncate(params: any, query: any, user?: JWTUser): Promise<void>;
28
- update(id: string, obj: UpdateObject<AccessControlListSQL>, req: HttpRequest, user?: JWTUser): Promise<AccessControlListSQL>;
29
- updateProperty(id: string, propertyName: string, obj: any, user?: JWTUser): Promise<AccessControlListSQL>;
30
- updateBulk(obj: UpdateObject<AccessControlListSQL>[], req: HttpRequest, user?: JWTUser): Promise<AccessControlListSQL[]>;
31
- }
package/docs/Makefile DELETED
@@ -1,20 +0,0 @@
1
- # Minimal makefile for Sphinx documentation
2
- #
3
-
4
- # You can set these variables from the command line, and also
5
- # from the environment for the first two.
6
- SPHINXOPTS ?=
7
- SPHINXBUILD ?= sphinx-build
8
- SOURCEDIR = .
9
- BUILDDIR = _build
10
-
11
- # Put it first so that "make" without argument is like "make help".
12
- help:
13
- @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14
-
15
- .PHONY: help Makefile
16
-
17
- # Catch-all target: route all unknown targets to Sphinx using the new
18
- # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19
- %: Makefile
20
- @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
package/docs/conf.py DELETED
@@ -1,58 +0,0 @@
1
- # Configuration file for the Sphinx documentation builder.
2
- #
3
- # This file only contains a selection of the most common options. For a full
4
- # list see the documentation:
5
- # https://www.sphinx-doc.org/en/master/usage/configuration.html
6
-
7
- # -- Path setup --------------------------------------------------------------
8
-
9
- # If extensions (or modules to document with autodoc) are in another directory,
10
- # add these directories to sys.path here. If the directory is relative to the
11
- # documentation root, use os.path.abspath to make it absolute, like shown here.
12
- #
13
- # import os
14
- # import sys
15
- # sys.path.insert(0, os.path.abspath('.'))
16
- import recommonmark
17
- from recommonmark.transform import AutoStructify
18
-
19
- source_suffix = ['.rst', '.md']
20
-
21
- # -- Project information -----------------------------------------------------
22
-
23
- project = 'Core Library'
24
- copyright = 'RapidREST All rights reserved.'
25
- author = 'RapidREST'
26
-
27
- # -- General configuration ---------------------------------------------------
28
-
29
- # Add any Sphinx extension module names here, as strings. They can be
30
- # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
31
- # ones.
32
- extensions = [
33
- 'recommonmark',
34
- 'sphinx.ext.autodoc',
35
- ]
36
-
37
- # List of patterns, relative to source directory, that match files and
38
- # directories to ignore when looking for source files.
39
- # This pattern also affects html_static_path and html_extra_path.
40
- exclude_patterns = []
41
-
42
- master_doc = 'index'
43
-
44
- # Add any paths that contain custom static files (such as style sheets) here,
45
- # relative to this directory. They are copied after the builtin static files,
46
- # so a file named "default.css" will overwrite the builtin "default.css".
47
- html_static_path = ['_static']
48
-
49
- # app setup hook
50
- def setup(app):
51
- app.add_config_value('recommonmark_config', {
52
- 'auto_toc_tree_section': 'Contents',
53
- 'enable_math': False,
54
- 'enable_inline_math': False,
55
- 'enable_eval_rst': True,
56
- 'enable_auto_doc_ref': True,
57
- }, True)
58
- app.add_transform(AutoStructify)
package/docs/index.rst DELETED
@@ -1,17 +0,0 @@
1
- ===============================================================================
2
- Services Core Library
3
- ===============================================================================
4
-
5
- Repository: ``git clone https://github.com/rapidrest/service-core.git``
6
-
7
- Provides all core functionality for RapidREST based backend services.
8
-
9
- .. toctree::
10
- :caption: Project Info
11
-
12
- reference/README
13
-
14
- .. toctree::
15
- :caption: API Reference
16
-
17
- reference/globals