@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.
- package/LICENSE +23 -0
- package/README.md +16 -0
- package/dist/lib/ApiErrors.js +41 -0
- package/dist/lib/ApiErrors.js.map +1 -0
- package/dist/lib/BackgroundService.js +16 -0
- package/dist/lib/BackgroundService.js.map +1 -0
- package/dist/lib/BackgroundServiceManager.js +135 -0
- package/dist/lib/BackgroundServiceManager.js.map +1 -0
- package/dist/lib/BulkError.js +24 -0
- package/dist/lib/BulkError.js.map +1 -0
- package/dist/lib/EventListenerManager.js +161 -0
- package/dist/lib/EventListenerManager.js.map +1 -0
- package/dist/lib/NetUtils.js +103 -0
- package/dist/lib/NetUtils.js.map +1 -0
- package/dist/lib/NotificationUtils.js +34 -0
- package/dist/lib/NotificationUtils.js.map +1 -0
- package/dist/lib/ObjectFactory.js +90 -0
- package/dist/lib/ObjectFactory.js.map +1 -0
- package/dist/lib/OpenApiSpec.js +748 -0
- package/dist/lib/OpenApiSpec.js.map +1 -0
- package/dist/lib/Server.js +549 -0
- package/dist/lib/Server.js.map +1 -0
- package/dist/lib/Types.js +2 -0
- package/dist/lib/Types.js.map +1 -0
- package/dist/lib/auth/AuthMiddleware.js +229 -0
- package/dist/lib/auth/AuthMiddleware.js.map +1 -0
- package/dist/lib/auth/AuthStrategy.js +2 -0
- package/dist/lib/auth/AuthStrategy.js.map +1 -0
- package/dist/lib/auth/BasicStrategy.js +106 -0
- package/dist/lib/auth/BasicStrategy.js.map +1 -0
- package/dist/lib/auth/JWTStrategy.js +161 -0
- package/dist/lib/auth/JWTStrategy.js.map +1 -0
- package/dist/lib/auth/index.js +5 -0
- package/dist/lib/auth/index.js.map +1 -0
- package/dist/lib/database/ConnectionKinds.js +14 -0
- package/dist/lib/database/ConnectionKinds.js.map +1 -0
- package/dist/lib/database/ConnectionManager.js +161 -0
- package/dist/lib/database/ConnectionManager.js.map +1 -0
- package/dist/lib/database/MongoConnection.js +86 -0
- package/dist/lib/database/MongoConnection.js.map +1 -0
- package/dist/lib/database/MongoRepository.js +136 -0
- package/dist/lib/database/MongoRepository.js.map +1 -0
- package/dist/lib/database/MongoSchemaSync.js +136 -0
- package/dist/lib/database/MongoSchemaSync.js.map +1 -0
- package/dist/lib/database/NamingUtils.js +52 -0
- package/dist/lib/database/NamingUtils.js.map +1 -0
- package/dist/lib/database/TypeOrmSupport.js +146 -0
- package/dist/lib/database/TypeOrmSupport.js.map +1 -0
- package/dist/lib/database/index.js +7 -0
- package/dist/lib/database/index.js.map +1 -0
- package/dist/lib/decorators/DatabaseDecorators.js +52 -0
- package/dist/lib/decorators/DatabaseDecorators.js.map +1 -0
- package/dist/lib/decorators/DocDecorators.js +120 -0
- package/dist/lib/decorators/DocDecorators.js.map +1 -0
- package/dist/lib/decorators/EventDecorators.js +24 -0
- package/dist/lib/decorators/EventDecorators.js.map +1 -0
- package/dist/lib/decorators/ModelDecorators.js +173 -0
- package/dist/lib/decorators/ModelDecorators.js.map +1 -0
- package/dist/lib/decorators/PersistenceDecorators.js +177 -0
- package/dist/lib/decorators/PersistenceDecorators.js.map +1 -0
- package/dist/lib/decorators/RouteDecorators.js +324 -0
- package/dist/lib/decorators/RouteDecorators.js.map +1 -0
- package/dist/lib/decorators/index.js +7 -0
- package/dist/lib/decorators/index.js.map +1 -0
- package/dist/lib/http/Adapters.js +230 -0
- package/dist/lib/http/Adapters.js.map +1 -0
- package/dist/lib/http/Router.js +403 -0
- package/dist/lib/http/Router.js.map +1 -0
- package/dist/lib/http/WebSocket.js +82 -0
- package/dist/lib/http/WebSocket.js.map +1 -0
- package/dist/lib/http/index.js +4 -0
- package/dist/lib/http/index.js.map +1 -0
- package/dist/lib/http/types.js +5 -0
- package/dist/lib/http/types.js.map +1 -0
- package/dist/lib/index.js +18 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/models/BaseEntity.js +83 -0
- package/dist/lib/models/BaseEntity.js.map +1 -0
- package/dist/lib/models/BaseMongoEntity.js +40 -0
- package/dist/lib/models/BaseMongoEntity.js.map +1 -0
- package/dist/lib/models/ModelUtils.js +645 -0
- package/dist/lib/models/ModelUtils.js.map +1 -0
- package/dist/lib/models/RecoverableBaseEntity.js +39 -0
- package/dist/lib/models/RecoverableBaseEntity.js.map +1 -0
- package/dist/lib/models/RecoverableBaseMongoEntity.js +40 -0
- package/dist/lib/models/RecoverableBaseMongoEntity.js.map +1 -0
- package/dist/lib/models/RepoUtils.js +717 -0
- package/dist/lib/models/RepoUtils.js.map +1 -0
- package/dist/lib/models/SimpleEntity.js +42 -0
- package/dist/lib/models/SimpleEntity.js.map +1 -0
- package/dist/lib/models/SimpleMongoEntity.js +38 -0
- package/dist/lib/models/SimpleMongoEntity.js.map +1 -0
- package/dist/lib/models/StatusExtraData.js +15 -0
- package/dist/lib/models/StatusExtraData.js.map +1 -0
- package/dist/lib/models/index.js +10 -0
- package/dist/lib/models/index.js.map +1 -0
- package/dist/lib/routes/AdminRoute.js +268 -0
- package/dist/lib/routes/AdminRoute.js.map +1 -0
- package/dist/lib/routes/MetricsRoute.js +86 -0
- package/dist/lib/routes/MetricsRoute.js.map +1 -0
- package/dist/lib/routes/ModelRoute.js +481 -0
- package/dist/lib/routes/ModelRoute.js.map +1 -0
- package/dist/lib/routes/OpenAPIRoute.js +115 -0
- package/dist/lib/routes/OpenAPIRoute.js.map +1 -0
- package/dist/lib/routes/RouteUtils.js +445 -0
- package/dist/lib/routes/RouteUtils.js.map +1 -0
- package/dist/lib/routes/StatusRoute.js +55 -0
- package/dist/lib/routes/StatusRoute.js.map +1 -0
- package/dist/lib/routes/index.js +7 -0
- package/dist/lib/routes/index.js.map +1 -0
- package/dist/lib/security/ACLRouteMongo.js +194 -0
- package/dist/lib/security/ACLRouteMongo.js.map +1 -0
- package/dist/lib/security/ACLRouteSQL.js +193 -0
- package/dist/lib/security/ACLRouteSQL.js.map +1 -0
- package/dist/lib/security/ACLUtils.js +457 -0
- package/dist/lib/security/ACLUtils.js.map +1 -0
- package/dist/lib/security/AccessControlList.js +18 -0
- package/dist/lib/security/AccessControlList.js.map +1 -0
- package/dist/lib/security/AccessControlListMongo.js +155 -0
- package/dist/lib/security/AccessControlListMongo.js.map +1 -0
- package/dist/lib/security/AccessControlListSQL.js +149 -0
- package/dist/lib/security/AccessControlListSQL.js.map +1 -0
- package/dist/lib/security/index.js +3 -0
- package/dist/lib/security/index.js.map +1 -0
- package/dist/lib/test/index.js +3 -0
- package/dist/lib/test/index.js.map +1 -0
- package/dist/lib/test/request.js +99 -0
- package/dist/lib/test/request.js.map +1 -0
- package/dist/lib/test/requestws.js +173 -0
- package/dist/lib/test/requestws.js.map +1 -0
- package/dist/types/ApiErrors.d.ts +38 -0
- package/dist/types/BackgroundService.d.ts +30 -0
- package/dist/types/BackgroundServiceManager.d.ts +66 -0
- package/dist/types/BulkError.d.ts +11 -0
- package/dist/types/EventListenerManager.d.ts +36 -0
- package/dist/types/NetUtils.d.ts +29 -0
- package/dist/types/NotificationUtils.d.ts +25 -0
- package/dist/types/ObjectFactory.d.ts +17 -0
- package/dist/types/OpenApiSpec.d.ts +114 -0
- package/dist/types/Server.d.ts +180 -0
- package/dist/types/Types.d.ts +8 -0
- package/dist/types/auth/AuthMiddleware.d.ts +42 -0
- package/dist/types/auth/AuthStrategy.d.ts +32 -0
- package/dist/types/auth/BasicStrategy.d.ts +33 -0
- package/dist/types/auth/JWTStrategy.d.ts +61 -0
- package/dist/types/auth/index.d.ts +4 -0
- package/dist/types/database/ConnectionKinds.d.ts +7 -0
- package/dist/types/database/ConnectionManager.d.ts +35 -0
- package/dist/types/database/MongoConnection.d.ts +54 -0
- package/dist/types/database/MongoRepository.d.ts +92 -0
- package/dist/types/database/MongoSchemaSync.d.ts +41 -0
- package/dist/types/database/NamingUtils.d.ts +24 -0
- package/dist/types/database/TypeOrmSupport.d.ts +20 -0
- package/dist/types/database/index.d.ts +6 -0
- package/dist/types/decorators/DatabaseDecorators.d.ts +18 -0
- package/dist/types/decorators/DocDecorators.d.ts +69 -0
- package/dist/types/decorators/EventDecorators.d.ts +12 -0
- package/dist/types/decorators/ModelDecorators.d.ts +80 -0
- package/dist/types/decorators/PersistenceDecorators.d.ts +117 -0
- package/dist/types/decorators/RouteDecorators.d.ts +172 -0
- package/dist/types/decorators/index.d.ts +6 -0
- package/dist/types/http/Adapters.d.ts +68 -0
- package/dist/types/http/Router.d.ts +99 -0
- package/dist/types/http/WebSocket.d.ts +56 -0
- package/dist/types/http/index.d.ts +6 -0
- package/dist/types/http/types.d.ts +54 -0
- package/dist/types/index.d.ts +17 -0
- package/dist/types/models/BaseEntity.d.ts +29 -0
- package/dist/types/models/BaseMongoEntity.d.ts +13 -0
- package/dist/types/models/ModelUtils.d.ts +166 -0
- package/dist/types/models/RecoverableBaseEntity.d.ts +16 -0
- package/dist/types/models/RecoverableBaseMongoEntity.d.ts +16 -0
- package/dist/types/models/RepoUtils.d.ts +154 -0
- package/dist/types/models/SimpleEntity.d.ts +14 -0
- package/dist/types/models/SimpleMongoEntity.d.ts +15 -0
- package/dist/types/models/StatusExtraData.d.ts +6 -0
- package/dist/types/models/index.d.ts +9 -0
- package/dist/types/routes/AdminRoute.d.ts +47 -0
- package/dist/types/routes/MetricsRoute.d.ts +15 -0
- package/dist/types/routes/ModelRoute.d.ts +226 -0
- package/dist/types/routes/OpenAPIRoute.d.ts +17 -0
- package/dist/types/routes/RouteUtils.d.ts +55 -0
- package/dist/types/routes/StatusRoute.d.ts +11 -0
- package/dist/types/routes/index.d.ts +6 -0
- package/dist/types/security/ACLRouteMongo.d.ts +19 -0
- package/dist/types/security/ACLRouteSQL.d.ts +19 -0
- package/dist/types/security/ACLUtils.d.ts +94 -0
- package/dist/types/security/AccessControlList.d.ts +103 -0
- package/dist/types/security/AccessControlListMongo.d.ts +24 -0
- package/dist/types/security/AccessControlListSQL.d.ts +24 -0
- package/dist/types/security/index.d.ts +2 -0
- package/dist/types/test/index.d.ts +2 -0
- package/dist/types/test/request.d.ts +24 -0
- package/dist/types/test/requestws.d.ts +21 -0
- package/docs/Makefile +20 -0
- package/docs/conf.py +58 -0
- package/docs/index.rst +17 -0
- package/docs/make.bat +35 -0
- package/docs/reference/@rapidrest/namespaces/DatabaseDecorators/README.md +13 -0
- package/docs/reference/@rapidrest/namespaces/DatabaseDecorators/functions/MongoRepository.md +25 -0
- package/docs/reference/@rapidrest/namespaces/DatabaseDecorators/functions/RedisConnection.md +25 -0
- package/docs/reference/@rapidrest/namespaces/DatabaseDecorators/functions/Repository.md +25 -0
- package/docs/reference/@rapidrest/namespaces/DocDecorators/README.md +23 -0
- package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Default.md +25 -0
- package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Description.md +25 -0
- package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Document.md +25 -0
- package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Example.md +25 -0
- package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Format.md +25 -0
- package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Returns.md +28 -0
- package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Summary.md +25 -0
- package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Tags.md +25 -0
- package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/TypeInfo.md +28 -0
- package/docs/reference/@rapidrest/namespaces/DocDecorators/interfaces/DocumentsData.md +57 -0
- package/docs/reference/@rapidrest/namespaces/EventDecorators/README.md +12 -0
- package/docs/reference/@rapidrest/namespaces/EventDecorators/functions/EventListener.md +17 -0
- package/docs/reference/@rapidrest/namespaces/EventDecorators/functions/OnEvent.md +26 -0
- package/docs/reference/@rapidrest/namespaces/ModelDecorators/README.md +26 -0
- package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/Cache.md +25 -0
- package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/ChildEntity.md +18 -0
- package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/DataStore.md +25 -0
- package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/Identifier.md +27 -0
- package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/Protect.md +35 -0
- package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/Reference.md +25 -0
- package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/Shard.md +27 -0
- package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/TrackChanges.md +26 -0
- package/docs/reference/@rapidrest/namespaces/ModelDecorators/interfaces/PendingTypeOrmColumn.md +45 -0
- package/docs/reference/@rapidrest/namespaces/ModelDecorators/variables/pendingTypeOrmColumns.md +14 -0
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/README.md +25 -0
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/Column.md +25 -0
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/Entity.md +26 -0
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/Index.md +119 -0
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/PrimaryColumn.md +25 -0
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/Unique.md +68 -0
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/getColumnMetadata.md +26 -0
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/getEntityName.md +26 -0
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/getIndexMetadata.md +27 -0
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/interfaces/ColumnInfo.md +41 -0
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/interfaces/ColumnOptions.md +51 -0
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/interfaces/IndexInfo.md +41 -0
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/interfaces/IndexOptions.md +51 -0
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/README.md +36 -0
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/After.md +26 -0
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Auth.md +33 -0
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/AuthResult.md +31 -0
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Before.md +25 -0
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/ContentType.md +25 -0
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Delete.md +25 -0
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Get.md +25 -0
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Head.md +25 -0
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Header.md +25 -0
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Method.md +31 -0
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Model.md +25 -0
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Options.md +25 -0
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Param.md +26 -0
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Patch.md +25 -0
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Post.md +25 -0
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Protect.md +31 -0
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Put.md +25 -0
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Query.md +26 -0
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Request.md +31 -0
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/RequiresRole.md +26 -0
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Response.md +31 -0
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Route.md +25 -0
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Socket.md +33 -0
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/User.md +31 -0
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Validate.md +25 -0
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/WebSocket.md +25 -0
- package/docs/reference/README.md +20 -0
- package/docs/reference/classes/ACLUtils.md +251 -0
- package/docs/reference/classes/AdminRoute.md +51 -0
- package/docs/reference/classes/AuthMiddleware.md +131 -0
- package/docs/reference/classes/BackgroundService.md +117 -0
- package/docs/reference/classes/BackgroundServiceManager.md +172 -0
- package/docs/reference/classes/BaseEntity.md +82 -0
- package/docs/reference/classes/BaseMongoEntity.md +107 -0
- package/docs/reference/classes/BasicStrategy.md +89 -0
- package/docs/reference/classes/BasicStrategyOptions.md +91 -0
- package/docs/reference/classes/BulkError.md +271 -0
- package/docs/reference/classes/ConnectionManager.md +75 -0
- package/docs/reference/classes/EventListenerManager.md +88 -0
- package/docs/reference/classes/JWTStrategy.md +77 -0
- package/docs/reference/classes/JWTStrategyOptions.md +97 -0
- package/docs/reference/classes/MetricsRoute.md +27 -0
- package/docs/reference/classes/ModelRoute.md +527 -0
- package/docs/reference/classes/ModelUtils.md +448 -0
- package/docs/reference/classes/MongoConnection.md +218 -0
- package/docs/reference/classes/MongoRepository.md +354 -0
- package/docs/reference/classes/MongoSchemaSync.md +67 -0
- package/docs/reference/classes/NetUtils.md +90 -0
- package/docs/reference/classes/NotificationUtils.md +77 -0
- package/docs/reference/classes/ObjectFactory.md +336 -0
- package/docs/reference/classes/OpenAPIRoute.md +77 -0
- package/docs/reference/classes/OpenApiSpec.md +892 -0
- package/docs/reference/classes/RecoverableBaseEntity.md +114 -0
- package/docs/reference/classes/RecoverableBaseMongoEntity.md +124 -0
- package/docs/reference/classes/RedisTransport.md +2202 -0
- package/docs/reference/classes/RepoUtils.md +486 -0
- package/docs/reference/classes/RouteUtils.md +191 -0
- package/docs/reference/classes/Server.md +408 -0
- package/docs/reference/classes/SimpleEntity.md +48 -0
- package/docs/reference/classes/SimpleMongoEntity.md +66 -0
- package/docs/reference/classes/StatusExtraData.md +57 -0
- package/docs/reference/classes/StatusRoute.md +26 -0
- package/docs/reference/enumerations/ACLAction.md +63 -0
- package/docs/reference/enumerations/ApiErrorMessages.md +123 -0
- package/docs/reference/enumerations/ApiErrors.md +123 -0
- package/docs/reference/functions/isSqlDataSource.md +26 -0
- package/docs/reference/functions/resolveCollectionName.md +33 -0
- package/docs/reference/functions/snakeCase.md +28 -0
- package/docs/reference/globals.md +91 -0
- package/docs/reference/interfaces/ACLRecord.md +96 -0
- package/docs/reference/interfaces/AccessControlList.md +76 -0
- package/docs/reference/interfaces/AuthResult.md +55 -0
- package/docs/reference/interfaces/AuthStrategy.md +57 -0
- package/docs/reference/interfaces/CreateRequestOptions.md +121 -0
- package/docs/reference/interfaces/DeleteRequestOptions.md +147 -0
- package/docs/reference/interfaces/FindRequestOptions.md +133 -0
- package/docs/reference/interfaces/JWTAuthResult.md +84 -0
- package/docs/reference/interfaces/RepoCreateOptions.md +95 -0
- package/docs/reference/interfaces/RepoDeleteOptions.md +115 -0
- package/docs/reference/interfaces/RepoFindOptions.md +135 -0
- package/docs/reference/interfaces/RepoOperationOptions.md +69 -0
- package/docs/reference/interfaces/RepoUpdateOptions.md +111 -0
- package/docs/reference/interfaces/RequestOptions.md +112 -0
- package/docs/reference/interfaces/TruncateRequestOptions.md +175 -0
- package/docs/reference/interfaces/UpdateRequestOptions.md +149 -0
- package/docs/reference/type-aliases/OneOrMany.md +19 -0
- package/docs/reference/type-aliases/OneOrNull.md +19 -0
- package/docs/reference/type-aliases/PartialBaseEntity.md +17 -0
- package/docs/reference/type-aliases/PartialSimpleEntity.md +17 -0
- package/docs/reference/type-aliases/UpdateObject.md +19 -0
- package/package.json +125 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
[**@rapidrest/service-core**](../../../../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@rapidrest/service-core](../../../../globals.md) / [ModelDecorators](../README.md) / ChildEntity
|
|
6
|
+
|
|
7
|
+
# Function: ChildEntity()
|
|
8
|
+
|
|
9
|
+
> **ChildEntity**(): \<`T`\>(`constructor`) => \{(...`args`): `child`\<`T`\>; `prototype`: `child`\<`any`\>; \} & `T`
|
|
10
|
+
|
|
11
|
+
Defined in: [src/decorators/ModelDecorators.ts:45](https://github.com/rapidrest/service-core/blob/c8974caa9b5d3eb225bcbcd93945f2e588fe2f0a/src/decorators/ModelDecorators.ts#L45)
|
|
12
|
+
|
|
13
|
+
Indicates that a class is a child entity to some parent. Child entities will inherit all datastore configuration
|
|
14
|
+
of the parent, including cache settings.
|
|
15
|
+
|
|
16
|
+
## Returns
|
|
17
|
+
|
|
18
|
+
\<`T`\>(`constructor`) => \{(...`args`): `child`\<`T`\>; `prototype`: `child`\<`any`\>; \} & `T`
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
[**@rapidrest/service-core**](../../../../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@rapidrest/service-core](../../../../globals.md) / [ModelDecorators](../README.md) / DataStore
|
|
6
|
+
|
|
7
|
+
# Function: DataStore()
|
|
8
|
+
|
|
9
|
+
> **DataStore**(`datastore`): (`target`) => `void`
|
|
10
|
+
|
|
11
|
+
Defined in: [src/decorators/ModelDecorators.ts:73](https://github.com/rapidrest/service-core/blob/c8974caa9b5d3eb225bcbcd93945f2e588fe2f0a/src/decorators/ModelDecorators.ts#L73)
|
|
12
|
+
|
|
13
|
+
Indicates that the class describes an entity that will be persisted in the datastore with the given name.
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### datastore
|
|
18
|
+
|
|
19
|
+
`string`
|
|
20
|
+
|
|
21
|
+
The name of the datastore to store records of the decorated class.
|
|
22
|
+
|
|
23
|
+
## Returns
|
|
24
|
+
|
|
25
|
+
(`target`) => `void`
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
[**@rapidrest/service-core**](../../../../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@rapidrest/service-core](../../../../globals.md) / [ModelDecorators](../README.md) / Identifier
|
|
6
|
+
|
|
7
|
+
# Function: Identifier()
|
|
8
|
+
|
|
9
|
+
> **Identifier**(`target`, `propertyKey`): `void`
|
|
10
|
+
|
|
11
|
+
Defined in: [src/decorators/ModelDecorators.ts:87](https://github.com/rapidrest/service-core/blob/c8974caa9b5d3eb225bcbcd93945f2e588fe2f0a/src/decorators/ModelDecorators.ts#L87)
|
|
12
|
+
|
|
13
|
+
Apply this to a property that is considered a unique identifier.
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### target
|
|
18
|
+
|
|
19
|
+
`any`
|
|
20
|
+
|
|
21
|
+
### propertyKey
|
|
22
|
+
|
|
23
|
+
`string` \| `symbol`
|
|
24
|
+
|
|
25
|
+
## Returns
|
|
26
|
+
|
|
27
|
+
`void`
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
[**@rapidrest/service-core**](../../../../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@rapidrest/service-core](../../../../globals.md) / [ModelDecorators](../README.md) / Protect
|
|
6
|
+
|
|
7
|
+
# Function: Protect()
|
|
8
|
+
|
|
9
|
+
> **Protect**(`classACL?`, `recordACL?`): (`target`) => `void`
|
|
10
|
+
|
|
11
|
+
Defined in: [src/decorators/ModelDecorators.ts:109](https://github.com/rapidrest/service-core/blob/c8974caa9b5d3eb225bcbcd93945f2e588fe2f0a/src/decorators/ModelDecorators.ts#L109)
|
|
12
|
+
|
|
13
|
+
Apply this to a model class to indicate that it should be protected by the AccessControlList security system.
|
|
14
|
+
The `classACL` parameter specifies the default ACL governing access to general operations against the model class
|
|
15
|
+
(e.g. create, truncate, find). The `recordACL` parameter indicates whether or not per-record ACLs should be created
|
|
16
|
+
for this type in order to govern access to individual record operations (e.g. delete, update, find).
|
|
17
|
+
|
|
18
|
+
## Parameters
|
|
19
|
+
|
|
20
|
+
### classACL?
|
|
21
|
+
|
|
22
|
+
`PartialACL` = `...`
|
|
23
|
+
|
|
24
|
+
The default access control list to limit access to general class operations.
|
|
25
|
+
|
|
26
|
+
### recordACL?
|
|
27
|
+
|
|
28
|
+
`boolean` = `false`
|
|
29
|
+
|
|
30
|
+
Set to `true` to create an ACL for each new record of the given type, otherwise set to false. Default
|
|
31
|
+
is `false`.
|
|
32
|
+
|
|
33
|
+
## Returns
|
|
34
|
+
|
|
35
|
+
(`target`) => `void`
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
[**@rapidrest/service-core**](../../../../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@rapidrest/service-core](../../../../globals.md) / [ModelDecorators](../README.md) / Reference
|
|
6
|
+
|
|
7
|
+
# Function: Reference()
|
|
8
|
+
|
|
9
|
+
> **Reference**(`clazz`): (`target`, `propertyKey`) => `void`
|
|
10
|
+
|
|
11
|
+
Defined in: [src/decorators/ModelDecorators.ts:160](https://github.com/rapidrest/service-core/blob/c8974caa9b5d3eb225bcbcd93945f2e588fe2f0a/src/decorators/ModelDecorators.ts#L160)
|
|
12
|
+
|
|
13
|
+
Apply this to a property to indicate that the value is a reference to another stored entity.
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### clazz
|
|
18
|
+
|
|
19
|
+
`any`
|
|
20
|
+
|
|
21
|
+
The class type of the referenced object.
|
|
22
|
+
|
|
23
|
+
## Returns
|
|
24
|
+
|
|
25
|
+
(`target`, `propertyKey`) => `void`
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
[**@rapidrest/service-core**](../../../../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@rapidrest/service-core](../../../../globals.md) / [ModelDecorators](../README.md) / Shard
|
|
6
|
+
|
|
7
|
+
# Function: Shard()
|
|
8
|
+
|
|
9
|
+
> **Shard**(`config?`): (`target`) => `void`
|
|
10
|
+
|
|
11
|
+
Defined in: [src/decorators/ModelDecorators.ts:173](https://github.com/rapidrest/service-core/blob/c8974caa9b5d3eb225bcbcd93945f2e588fe2f0a/src/decorators/ModelDecorators.ts#L173)
|
|
12
|
+
|
|
13
|
+
Indicates that the class describes an entity that will be persisted in a sharded database collection.
|
|
14
|
+
|
|
15
|
+
Note: Only supported by MongoDB.
|
|
16
|
+
|
|
17
|
+
## Parameters
|
|
18
|
+
|
|
19
|
+
### config?
|
|
20
|
+
|
|
21
|
+
`any` = `...`
|
|
22
|
+
|
|
23
|
+
The sharding configuration to pass to the database server. Default value is `{ key: { uid: 1 }, unique: false, options: {} }`.
|
|
24
|
+
|
|
25
|
+
## Returns
|
|
26
|
+
|
|
27
|
+
(`target`) => `void`
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
[**@rapidrest/service-core**](../../../../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@rapidrest/service-core](../../../../globals.md) / [ModelDecorators](../README.md) / TrackChanges
|
|
6
|
+
|
|
7
|
+
# Function: TrackChanges()
|
|
8
|
+
|
|
9
|
+
> **TrackChanges**(`versions?`): (`target`) => `void`
|
|
10
|
+
|
|
11
|
+
Defined in: [src/decorators/ModelDecorators.ts:190](https://github.com/rapidrest/service-core/blob/c8974caa9b5d3eb225bcbcd93945f2e588fe2f0a/src/decorators/ModelDecorators.ts#L190)
|
|
12
|
+
|
|
13
|
+
Indicates that the class will track changes for each document update limited to the specified number of versions.
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### versions?
|
|
18
|
+
|
|
19
|
+
`number` = `-1`
|
|
20
|
+
|
|
21
|
+
The number of versions that will be tracked for each document change. Set to `-1` to store all
|
|
22
|
+
versions. Default value is `-1`.
|
|
23
|
+
|
|
24
|
+
## Returns
|
|
25
|
+
|
|
26
|
+
(`target`) => `void`
|
package/docs/reference/@rapidrest/namespaces/ModelDecorators/interfaces/PendingTypeOrmColumn.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
[**@rapidrest/service-core**](../../../../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@rapidrest/service-core](../../../../globals.md) / [ModelDecorators](../README.md) / PendingTypeOrmColumn
|
|
6
|
+
|
|
7
|
+
# Interface: PendingTypeOrmColumn
|
|
8
|
+
|
|
9
|
+
Defined in: [src/decorators/ModelDecorators.ts:12](https://github.com/rapidrest/service-core/blob/c8974caa9b5d3eb225bcbcd93945f2e588fe2f0a/src/decorators/ModelDecorators.ts#L12)
|
|
10
|
+
|
|
11
|
+
Describes a column registration that must be bridged into TypeORM's metadata storage when (and only when) a SQL
|
|
12
|
+
connection is established. Entries are queued here by decorators so that this module does not depend on the
|
|
13
|
+
optional `typeorm` package.
|
|
14
|
+
|
|
15
|
+
## Properties
|
|
16
|
+
|
|
17
|
+
### mode
|
|
18
|
+
|
|
19
|
+
> **mode**: `"regular"`
|
|
20
|
+
|
|
21
|
+
Defined in: [src/decorators/ModelDecorators.ts:15](https://github.com/rapidrest/service-core/blob/c8974caa9b5d3eb225bcbcd93945f2e588fe2f0a/src/decorators/ModelDecorators.ts#L15)
|
|
22
|
+
|
|
23
|
+
***
|
|
24
|
+
|
|
25
|
+
### options
|
|
26
|
+
|
|
27
|
+
> **options**: `any`
|
|
28
|
+
|
|
29
|
+
Defined in: [src/decorators/ModelDecorators.ts:16](https://github.com/rapidrest/service-core/blob/c8974caa9b5d3eb225bcbcd93945f2e588fe2f0a/src/decorators/ModelDecorators.ts#L16)
|
|
30
|
+
|
|
31
|
+
***
|
|
32
|
+
|
|
33
|
+
### propertyName
|
|
34
|
+
|
|
35
|
+
> **propertyName**: `string`
|
|
36
|
+
|
|
37
|
+
Defined in: [src/decorators/ModelDecorators.ts:14](https://github.com/rapidrest/service-core/blob/c8974caa9b5d3eb225bcbcd93945f2e588fe2f0a/src/decorators/ModelDecorators.ts#L14)
|
|
38
|
+
|
|
39
|
+
***
|
|
40
|
+
|
|
41
|
+
### target
|
|
42
|
+
|
|
43
|
+
> **target**: `any`
|
|
44
|
+
|
|
45
|
+
Defined in: [src/decorators/ModelDecorators.ts:13](https://github.com/rapidrest/service-core/blob/c8974caa9b5d3eb225bcbcd93945f2e588fe2f0a/src/decorators/ModelDecorators.ts#L13)
|
package/docs/reference/@rapidrest/namespaces/ModelDecorators/variables/pendingTypeOrmColumns.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
[**@rapidrest/service-core**](../../../../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@rapidrest/service-core](../../../../globals.md) / [ModelDecorators](../README.md) / pendingTypeOrmColumns
|
|
6
|
+
|
|
7
|
+
# Variable: pendingTypeOrmColumns
|
|
8
|
+
|
|
9
|
+
> `const` **pendingTypeOrmColumns**: [`PendingTypeOrmColumn`](../interfaces/PendingTypeOrmColumn.md)[] = `[]`
|
|
10
|
+
|
|
11
|
+
Defined in: [src/decorators/ModelDecorators.ts:23](https://github.com/rapidrest/service-core/blob/c8974caa9b5d3eb225bcbcd93945f2e588fe2f0a/src/decorators/ModelDecorators.ts#L23)
|
|
12
|
+
|
|
13
|
+
The list of column registrations waiting to be bridged into TypeORM's metadata storage. This list is drained by
|
|
14
|
+
the TypeORM support module when a SQL connection is created.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
[**@rapidrest/service-core**](../../../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@rapidrest/service-core](../../../globals.md) / PersistenceDecorators
|
|
6
|
+
|
|
7
|
+
# PersistenceDecorators
|
|
8
|
+
|
|
9
|
+
## Interfaces
|
|
10
|
+
|
|
11
|
+
- [ColumnInfo](interfaces/ColumnInfo.md)
|
|
12
|
+
- [ColumnOptions](interfaces/ColumnOptions.md)
|
|
13
|
+
- [IndexInfo](interfaces/IndexInfo.md)
|
|
14
|
+
- [IndexOptions](interfaces/IndexOptions.md)
|
|
15
|
+
|
|
16
|
+
## Functions
|
|
17
|
+
|
|
18
|
+
- [Column](functions/Column.md)
|
|
19
|
+
- [Entity](functions/Entity.md)
|
|
20
|
+
- [getColumnMetadata](functions/getColumnMetadata.md)
|
|
21
|
+
- [getEntityName](functions/getEntityName.md)
|
|
22
|
+
- [getIndexMetadata](functions/getIndexMetadata.md)
|
|
23
|
+
- [Index](functions/Index.md)
|
|
24
|
+
- [PrimaryColumn](functions/PrimaryColumn.md)
|
|
25
|
+
- [Unique](functions/Unique.md)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
[**@rapidrest/service-core**](../../../../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@rapidrest/service-core](../../../../globals.md) / [PersistenceDecorators](../README.md) / Column
|
|
6
|
+
|
|
7
|
+
# Function: Column()
|
|
8
|
+
|
|
9
|
+
> **Column**(`options?`): (`target`, `propertyKey`) => `void`
|
|
10
|
+
|
|
11
|
+
Defined in: [src/decorators/PersistenceDecorators.ts:95](https://github.com/rapidrest/service-core/blob/c8974caa9b5d3eb225bcbcd93945f2e588fe2f0a/src/decorators/PersistenceDecorators.ts#L95)
|
|
12
|
+
|
|
13
|
+
Indicates that the decorated property will be persisted as a column/property in the datastore.
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### options?
|
|
18
|
+
|
|
19
|
+
[`ColumnOptions`](../interfaces/ColumnOptions.md) = `{}`
|
|
20
|
+
|
|
21
|
+
The options describing the column.
|
|
22
|
+
|
|
23
|
+
## Returns
|
|
24
|
+
|
|
25
|
+
(`target`, `propertyKey`) => `void`
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
[**@rapidrest/service-core**](../../../../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@rapidrest/service-core](../../../../globals.md) / [PersistenceDecorators](../README.md) / Entity
|
|
6
|
+
|
|
7
|
+
# Function: Entity()
|
|
8
|
+
|
|
9
|
+
> **Entity**(`name?`): (`target`) => `void`
|
|
10
|
+
|
|
11
|
+
Defined in: [src/decorators/PersistenceDecorators.ts:198](https://github.com/rapidrest/service-core/blob/c8974caa9b5d3eb225bcbcd93945f2e588fe2f0a/src/decorators/PersistenceDecorators.ts#L198)
|
|
12
|
+
|
|
13
|
+
Indicates that the class describes an entity that is persisted to a datastore.
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### name?
|
|
18
|
+
|
|
19
|
+
`string`
|
|
20
|
+
|
|
21
|
+
The name of the collection (or table) that records will be stored in. Defaults to the snake_case
|
|
22
|
+
form of the class name.
|
|
23
|
+
|
|
24
|
+
## Returns
|
|
25
|
+
|
|
26
|
+
(`target`) => `void`
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
[**@rapidrest/service-core**](../../../../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@rapidrest/service-core](../../../../globals.md) / [PersistenceDecorators](../README.md) / Index
|
|
6
|
+
|
|
7
|
+
# Function: Index()
|
|
8
|
+
|
|
9
|
+
## Call Signature
|
|
10
|
+
|
|
11
|
+
> **Index**(`nameOrOptions?`, `options?`): `PropertyDecorator`
|
|
12
|
+
|
|
13
|
+
Defined in: [src/decorators/PersistenceDecorators.ts:133](https://github.com/rapidrest/service-core/blob/c8974caa9b5d3eb225bcbcd93945f2e588fe2f0a/src/decorators/PersistenceDecorators.ts#L133)
|
|
14
|
+
|
|
15
|
+
Declares a database index.
|
|
16
|
+
|
|
17
|
+
When applied to a property, creates an index on that single property:
|
|
18
|
+
```
|
|
19
|
+
@Index() // unnamed index
|
|
20
|
+
@Index("myName") // named index
|
|
21
|
+
@Index({ unique: true }) // unnamed unique index
|
|
22
|
+
@Index("myName", { unique: true }) // named unique index
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
When applied to a class, creates a compound index across the given properties:
|
|
26
|
+
```
|
|
27
|
+
@Index(["firstName", "lastName"])
|
|
28
|
+
@Index("fullName", ["firstName", "lastName"], { unique: true })
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Parameters
|
|
32
|
+
|
|
33
|
+
#### nameOrOptions?
|
|
34
|
+
|
|
35
|
+
`string` \| [`IndexOptions`](../interfaces/IndexOptions.md)
|
|
36
|
+
|
|
37
|
+
#### options?
|
|
38
|
+
|
|
39
|
+
[`IndexOptions`](../interfaces/IndexOptions.md)
|
|
40
|
+
|
|
41
|
+
### Returns
|
|
42
|
+
|
|
43
|
+
`PropertyDecorator`
|
|
44
|
+
|
|
45
|
+
## Call Signature
|
|
46
|
+
|
|
47
|
+
> **Index**(`fields`, `options?`): `ClassDecorator`
|
|
48
|
+
|
|
49
|
+
Defined in: [src/decorators/PersistenceDecorators.ts:134](https://github.com/rapidrest/service-core/blob/c8974caa9b5d3eb225bcbcd93945f2e588fe2f0a/src/decorators/PersistenceDecorators.ts#L134)
|
|
50
|
+
|
|
51
|
+
Declares a database index.
|
|
52
|
+
|
|
53
|
+
When applied to a property, creates an index on that single property:
|
|
54
|
+
```
|
|
55
|
+
@Index() // unnamed index
|
|
56
|
+
@Index("myName") // named index
|
|
57
|
+
@Index({ unique: true }) // unnamed unique index
|
|
58
|
+
@Index("myName", { unique: true }) // named unique index
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
When applied to a class, creates a compound index across the given properties:
|
|
62
|
+
```
|
|
63
|
+
@Index(["firstName", "lastName"])
|
|
64
|
+
@Index("fullName", ["firstName", "lastName"], { unique: true })
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Parameters
|
|
68
|
+
|
|
69
|
+
#### fields
|
|
70
|
+
|
|
71
|
+
`string`[]
|
|
72
|
+
|
|
73
|
+
#### options?
|
|
74
|
+
|
|
75
|
+
[`IndexOptions`](../interfaces/IndexOptions.md)
|
|
76
|
+
|
|
77
|
+
### Returns
|
|
78
|
+
|
|
79
|
+
`ClassDecorator`
|
|
80
|
+
|
|
81
|
+
## Call Signature
|
|
82
|
+
|
|
83
|
+
> **Index**(`name`, `fields`, `options?`): `ClassDecorator`
|
|
84
|
+
|
|
85
|
+
Defined in: [src/decorators/PersistenceDecorators.ts:135](https://github.com/rapidrest/service-core/blob/c8974caa9b5d3eb225bcbcd93945f2e588fe2f0a/src/decorators/PersistenceDecorators.ts#L135)
|
|
86
|
+
|
|
87
|
+
Declares a database index.
|
|
88
|
+
|
|
89
|
+
When applied to a property, creates an index on that single property:
|
|
90
|
+
```
|
|
91
|
+
@Index() // unnamed index
|
|
92
|
+
@Index("myName") // named index
|
|
93
|
+
@Index({ unique: true }) // unnamed unique index
|
|
94
|
+
@Index("myName", { unique: true }) // named unique index
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
When applied to a class, creates a compound index across the given properties:
|
|
98
|
+
```
|
|
99
|
+
@Index(["firstName", "lastName"])
|
|
100
|
+
@Index("fullName", ["firstName", "lastName"], { unique: true })
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Parameters
|
|
104
|
+
|
|
105
|
+
#### name
|
|
106
|
+
|
|
107
|
+
`string`
|
|
108
|
+
|
|
109
|
+
#### fields
|
|
110
|
+
|
|
111
|
+
`string`[]
|
|
112
|
+
|
|
113
|
+
#### options?
|
|
114
|
+
|
|
115
|
+
[`IndexOptions`](../interfaces/IndexOptions.md)
|
|
116
|
+
|
|
117
|
+
### Returns
|
|
118
|
+
|
|
119
|
+
`ClassDecorator`
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
[**@rapidrest/service-core**](../../../../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@rapidrest/service-core](../../../../globals.md) / [PersistenceDecorators](../README.md) / PrimaryColumn
|
|
6
|
+
|
|
7
|
+
# Function: PrimaryColumn()
|
|
8
|
+
|
|
9
|
+
> **PrimaryColumn**(`options?`): (`target`, `propertyKey`) => `void`
|
|
10
|
+
|
|
11
|
+
Defined in: [src/decorators/PersistenceDecorators.ts:111](https://github.com/rapidrest/service-core/blob/c8974caa9b5d3eb225bcbcd93945f2e588fe2f0a/src/decorators/PersistenceDecorators.ts#L111)
|
|
12
|
+
|
|
13
|
+
Indicates that the decorated property is a primary key column in the datastore.
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### options?
|
|
18
|
+
|
|
19
|
+
[`ColumnOptions`](../interfaces/ColumnOptions.md) = `{}`
|
|
20
|
+
|
|
21
|
+
The options describing the column.
|
|
22
|
+
|
|
23
|
+
## Returns
|
|
24
|
+
|
|
25
|
+
(`target`, `propertyKey`) => `void`
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
[**@rapidrest/service-core**](../../../../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@rapidrest/service-core](../../../../globals.md) / [PersistenceDecorators](../README.md) / Unique
|
|
6
|
+
|
|
7
|
+
# Function: Unique()
|
|
8
|
+
|
|
9
|
+
## Call Signature
|
|
10
|
+
|
|
11
|
+
> **Unique**(`name?`): `PropertyDecorator`
|
|
12
|
+
|
|
13
|
+
Defined in: [src/decorators/PersistenceDecorators.ts:179](https://github.com/rapidrest/service-core/blob/c8974caa9b5d3eb225bcbcd93945f2e588fe2f0a/src/decorators/PersistenceDecorators.ts#L179)
|
|
14
|
+
|
|
15
|
+
Declares a unique constraint. This is shorthand for `@Index` with the `unique` option set to `true` and may be
|
|
16
|
+
applied to a property (single-column constraint) or a class (compound constraint).
|
|
17
|
+
|
|
18
|
+
### Parameters
|
|
19
|
+
|
|
20
|
+
#### name?
|
|
21
|
+
|
|
22
|
+
`string`
|
|
23
|
+
|
|
24
|
+
### Returns
|
|
25
|
+
|
|
26
|
+
`PropertyDecorator`
|
|
27
|
+
|
|
28
|
+
## Call Signature
|
|
29
|
+
|
|
30
|
+
> **Unique**(`fields`): `ClassDecorator`
|
|
31
|
+
|
|
32
|
+
Defined in: [src/decorators/PersistenceDecorators.ts:180](https://github.com/rapidrest/service-core/blob/c8974caa9b5d3eb225bcbcd93945f2e588fe2f0a/src/decorators/PersistenceDecorators.ts#L180)
|
|
33
|
+
|
|
34
|
+
Declares a unique constraint. This is shorthand for `@Index` with the `unique` option set to `true` and may be
|
|
35
|
+
applied to a property (single-column constraint) or a class (compound constraint).
|
|
36
|
+
|
|
37
|
+
### Parameters
|
|
38
|
+
|
|
39
|
+
#### fields
|
|
40
|
+
|
|
41
|
+
`string`[]
|
|
42
|
+
|
|
43
|
+
### Returns
|
|
44
|
+
|
|
45
|
+
`ClassDecorator`
|
|
46
|
+
|
|
47
|
+
## Call Signature
|
|
48
|
+
|
|
49
|
+
> **Unique**(`name`, `fields`): `ClassDecorator`
|
|
50
|
+
|
|
51
|
+
Defined in: [src/decorators/PersistenceDecorators.ts:181](https://github.com/rapidrest/service-core/blob/c8974caa9b5d3eb225bcbcd93945f2e588fe2f0a/src/decorators/PersistenceDecorators.ts#L181)
|
|
52
|
+
|
|
53
|
+
Declares a unique constraint. This is shorthand for `@Index` with the `unique` option set to `true` and may be
|
|
54
|
+
applied to a property (single-column constraint) or a class (compound constraint).
|
|
55
|
+
|
|
56
|
+
### Parameters
|
|
57
|
+
|
|
58
|
+
#### name
|
|
59
|
+
|
|
60
|
+
`string`
|
|
61
|
+
|
|
62
|
+
#### fields
|
|
63
|
+
|
|
64
|
+
`string`[]
|
|
65
|
+
|
|
66
|
+
### Returns
|
|
67
|
+
|
|
68
|
+
`ClassDecorator`
|
package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/getColumnMetadata.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
[**@rapidrest/service-core**](../../../../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@rapidrest/service-core](../../../../globals.md) / [PersistenceDecorators](../README.md) / getColumnMetadata
|
|
6
|
+
|
|
7
|
+
# Function: getColumnMetadata()
|
|
8
|
+
|
|
9
|
+
> **getColumnMetadata**(`clazz`): [`ColumnInfo`](../interfaces/ColumnInfo.md)[]
|
|
10
|
+
|
|
11
|
+
Defined in: [src/decorators/PersistenceDecorators.ts:216](https://github.com/rapidrest/service-core/blob/c8974caa9b5d3eb225bcbcd93945f2e588fe2f0a/src/decorators/PersistenceDecorators.ts#L216)
|
|
12
|
+
|
|
13
|
+
Returns the merged list of persisted columns declared across the entire class hierarchy of the given model
|
|
14
|
+
class. Columns declared in subclasses override columns of the same property name declared in parent classes.
|
|
15
|
+
|
|
16
|
+
## Parameters
|
|
17
|
+
|
|
18
|
+
### clazz
|
|
19
|
+
|
|
20
|
+
`any`
|
|
21
|
+
|
|
22
|
+
The model class to retrieve column metadata for.
|
|
23
|
+
|
|
24
|
+
## Returns
|
|
25
|
+
|
|
26
|
+
[`ColumnInfo`](../interfaces/ColumnInfo.md)[]
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
[**@rapidrest/service-core**](../../../../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@rapidrest/service-core](../../../../globals.md) / [PersistenceDecorators](../README.md) / getEntityName
|
|
6
|
+
|
|
7
|
+
# Function: getEntityName()
|
|
8
|
+
|
|
9
|
+
> **getEntityName**(`clazz`): `string` \| `undefined`
|
|
10
|
+
|
|
11
|
+
Defined in: [src/decorators/PersistenceDecorators.ts:261](https://github.com/rapidrest/service-core/blob/c8974caa9b5d3eb225bcbcd93945f2e588fe2f0a/src/decorators/PersistenceDecorators.ts#L261)
|
|
12
|
+
|
|
13
|
+
Returns the explicit entity name declared via `@Entity(name)` on the given class or the nearest ancestor that
|
|
14
|
+
declares one, otherwise `undefined`.
|
|
15
|
+
|
|
16
|
+
## Parameters
|
|
17
|
+
|
|
18
|
+
### clazz
|
|
19
|
+
|
|
20
|
+
`any`
|
|
21
|
+
|
|
22
|
+
The model class to retrieve the entity name for.
|
|
23
|
+
|
|
24
|
+
## Returns
|
|
25
|
+
|
|
26
|
+
`string` \| `undefined`
|
package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/getIndexMetadata.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
[**@rapidrest/service-core**](../../../../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@rapidrest/service-core](../../../../globals.md) / [PersistenceDecorators](../README.md) / getIndexMetadata
|
|
6
|
+
|
|
7
|
+
# Function: getIndexMetadata()
|
|
8
|
+
|
|
9
|
+
> **getIndexMetadata**(`clazz`): [`IndexInfo`](../interfaces/IndexInfo.md)[]
|
|
10
|
+
|
|
11
|
+
Defined in: [src/decorators/PersistenceDecorators.ts:236](https://github.com/rapidrest/service-core/blob/c8974caa9b5d3eb225bcbcd93945f2e588fe2f0a/src/decorators/PersistenceDecorators.ts#L236)
|
|
12
|
+
|
|
13
|
+
Returns the merged list of indexes declared across the entire class hierarchy of the given model class,
|
|
14
|
+
including both property-level and class-level (compound) indexes. Indexes declared in subclasses override
|
|
15
|
+
indexes with the same identity (name, or column set when unnamed) declared in parent classes.
|
|
16
|
+
|
|
17
|
+
## Parameters
|
|
18
|
+
|
|
19
|
+
### clazz
|
|
20
|
+
|
|
21
|
+
`any`
|
|
22
|
+
|
|
23
|
+
The model class to retrieve index metadata for.
|
|
24
|
+
|
|
25
|
+
## Returns
|
|
26
|
+
|
|
27
|
+
[`IndexInfo`](../interfaces/IndexInfo.md)[]
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
[**@rapidrest/service-core**](../../../../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@rapidrest/service-core](../../../../globals.md) / [PersistenceDecorators](../README.md) / ColumnInfo
|
|
6
|
+
|
|
7
|
+
# Interface: ColumnInfo
|
|
8
|
+
|
|
9
|
+
Defined in: [src/decorators/PersistenceDecorators.ts:38](https://github.com/rapidrest/service-core/blob/c8974caa9b5d3eb225bcbcd93945f2e588fe2f0a/src/decorators/PersistenceDecorators.ts#L38)
|
|
10
|
+
|
|
11
|
+
Describes a single persisted column/property of a model class.
|
|
12
|
+
|
|
13
|
+
## Properties
|
|
14
|
+
|
|
15
|
+
### designType?
|
|
16
|
+
|
|
17
|
+
> `optional` **designType?**: `any`
|
|
18
|
+
|
|
19
|
+
Defined in: [src/decorators/PersistenceDecorators.ts:42](https://github.com/rapidrest/service-core/blob/c8974caa9b5d3eb225bcbcd93945f2e588fe2f0a/src/decorators/PersistenceDecorators.ts#L42)
|
|
20
|
+
|
|
21
|
+
The design type of the property as captured at decoration time.
|
|
22
|
+
|
|
23
|
+
***
|
|
24
|
+
|
|
25
|
+
### options
|
|
26
|
+
|
|
27
|
+
> **options**: [`ColumnOptions`](ColumnOptions.md)
|
|
28
|
+
|
|
29
|
+
Defined in: [src/decorators/PersistenceDecorators.ts:44](https://github.com/rapidrest/service-core/blob/c8974caa9b5d3eb225bcbcd93945f2e588fe2f0a/src/decorators/PersistenceDecorators.ts#L44)
|
|
30
|
+
|
|
31
|
+
The options that the column was declared with.
|
|
32
|
+
|
|
33
|
+
***
|
|
34
|
+
|
|
35
|
+
### propertyName
|
|
36
|
+
|
|
37
|
+
> **propertyName**: `string`
|
|
38
|
+
|
|
39
|
+
Defined in: [src/decorators/PersistenceDecorators.ts:40](https://github.com/rapidrest/service-core/blob/c8974caa9b5d3eb225bcbcd93945f2e588fe2f0a/src/decorators/PersistenceDecorators.ts#L40)
|
|
40
|
+
|
|
41
|
+
The name of the class property.
|