Plugin API Reference
Shared APIs, decorators, guards, and base classes available to all plugins.
Base Classesโ
TenantOrganizationBaseEntityโ
All plugin entities should extend this class for automatic tenant and organization scoping:
export class TenantOrganizationBaseEntity extends TenantBaseEntity {
organizationId: string;
organization: Organization;
}
TenantAwareCrudServiceโ
Provides CRUD operations with automatic tenant filtering:
export class TenantAwareCrudService<T> extends CrudService<T> {
findAll(filter?: FindManyOptions<T>): Promise<IPagination<T>>;
findOneByIdString(id: string, options?: FindOneOptions<T>): Promise<T>;
create(entity: DeepPartial<T>): Promise<T>;
update(id: string, entity: DeepPartial<T>): Promise<UpdateResult | T>;
delete(id: string): Promise<DeleteResult>;
}
CrudControllerโ
Base controller with standard REST endpoints:
export class CrudController<T> {
constructor(protected readonly crudService: CrudService<T>) {}
}
Guardsโ
| Guard | Description |
|---|---|
TenantPermissionGuard | Ensures request is tenant-scoped |
PermissionGuard | Checks user permissions |
OrganizationPermissionGuard | Checks org-level perms |
RoleGuard | Checks user role |