@ruiapp/rapid-core 0.1.12 → 0.1.13
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/dist/core/eventManager.d.ts +1 -2
- package/dist/dataAccess/entityManager.d.ts +8 -6
- package/dist/index.d.ts +4 -0
- package/dist/index.js +402 -233
- package/dist/plugins/entityWatch/EntityWatchPlugin.d.ts +15 -0
- package/dist/plugins/entityWatch/EntityWatchPluginTypes.d.ts +15 -0
- package/dist/plugins/serverOperation/ServerOperationPlugin.d.ts +25 -0
- package/dist/plugins/serverOperation/ServerOperationPluginTypes.d.ts +11 -0
- package/dist/plugins/serverOperation/actionHandlers/index.d.ts +3 -0
- package/dist/plugins/serverOperation/actionHandlers/runServerOperation.d.ts +6 -0
- package/dist/types.d.ts +17 -2
- package/package.json +1 -1
- package/src/core/eventManager.ts +3 -4
- package/src/dataAccess/entityManager.ts +153 -10
- package/src/index.ts +5 -1
- package/src/plugins/dataManage/actionHandlers/addEntityRelations.ts +2 -50
- package/src/plugins/dataManage/actionHandlers/createCollectionEntitiesBatch.ts +1 -12
- package/src/plugins/dataManage/actionHandlers/createCollectionEntity.ts +1 -11
- package/src/plugins/dataManage/actionHandlers/deleteCollectionEntityById.ts +1 -20
- package/src/plugins/dataManage/actionHandlers/removeEntityRelations.ts +2 -48
- package/src/plugins/dataManage/actionHandlers/updateCollectionEntityById.ts +1 -25
- package/src/plugins/entityWatch/EntityWatchPlugin.ts +96 -0
- package/src/plugins/entityWatch/EntityWatchPluginTypes.ts +19 -0
- package/src/plugins/serverOperation/ServerOperationPlugin.ts +94 -0
- package/src/plugins/serverOperation/ServerOperationPluginTypes.ts +13 -0
- package/src/plugins/serverOperation/actionHandlers/index.ts +6 -0
- package/src/plugins/serverOperation/actionHandlers/runServerOperation.ts +15 -0
- package/src/server.ts +1 -1
- package/src/types.ts +13 -2
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export default class EventManager {
|
|
1
|
+
export default class EventManager<EventTypes extends Record<string, any[]>> {
|
|
3
2
|
#private;
|
|
4
3
|
constructor();
|
|
5
4
|
on<K extends keyof EventTypes>(eventName: K, listener: (...args: EventTypes[K]) => void): void;
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { CountEntityOptions, CountEntityResult, CreateEntityOptions, FindEntityOptions, IRpdDataAccessor, RpdDataModel, UpdateEntityByIdOptions } from "../types";
|
|
2
|
-
import { IRpdServer } from "../core/server";
|
|
1
|
+
import { AddEntityRelationsOptions, CountEntityOptions, CountEntityResult, CreateEntityOptions, FindEntityOptions, IRpdDataAccessor, RemoveEntityRelationsOptions, RpdDataModel, UpdateEntityByIdOptions } from "../types";
|
|
2
|
+
import { IRpdServer, RapidPlugin } from "../core/server";
|
|
3
3
|
export default class EntityManager<TEntity = any> {
|
|
4
4
|
#private;
|
|
5
5
|
constructor(server: IRpdServer, dataAccessor: IRpdDataAccessor);
|
|
6
|
+
getModel(): RpdDataModel;
|
|
6
7
|
findEntities(options: FindEntityOptions): Promise<TEntity[]>;
|
|
7
8
|
findEntity(options: FindEntityOptions): Promise<TEntity | null>;
|
|
8
9
|
findById(id: any): Promise<TEntity | null>;
|
|
9
|
-
createEntity(options: CreateEntityOptions): Promise<TEntity>;
|
|
10
|
-
updateEntityById(options: UpdateEntityByIdOptions): Promise<TEntity>;
|
|
10
|
+
createEntity(options: CreateEntityOptions, plugin: RapidPlugin): Promise<TEntity>;
|
|
11
|
+
updateEntityById(options: UpdateEntityByIdOptions, plugin: RapidPlugin): Promise<TEntity>;
|
|
11
12
|
count(options: CountEntityOptions): Promise<CountEntityResult>;
|
|
12
|
-
deleteById(id: any): Promise<void>;
|
|
13
|
-
|
|
13
|
+
deleteById(id: any, plugin: RapidPlugin): Promise<void>;
|
|
14
|
+
addRelations(options: AddEntityRelationsOptions, plugin: RapidPlugin): Promise<void>;
|
|
15
|
+
removeRelations(options: RemoveEntityRelationsOptions, plugin: RapidPlugin): Promise<void>;
|
|
14
16
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -13,3 +13,7 @@ export { default as RouteManagePlugin } from "./plugins/routeManage/RouteManageP
|
|
|
13
13
|
export { default as WebhooksPlugin } from "./plugins/webhooks/WebhooksPlugin";
|
|
14
14
|
export { default as AuthPlugin } from "./plugins/auth/AuthPlugin";
|
|
15
15
|
export { default as FileManagePlugin } from "./plugins/fileManage/FileManagePlugin";
|
|
16
|
+
export { default as ServerOperationPlugin } from "./plugins/serverOperation/ServerOperationPlugin";
|
|
17
|
+
export * from "./plugins/serverOperation/ServerOperationPluginTypes";
|
|
18
|
+
export { default as EntityWatchPlugin } from "./plugins/entityWatch/EntityWatchPlugin";
|
|
19
|
+
export * from "./plugins/entityWatch/EntityWatchPluginTypes";
|