Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Introduce HooksService #8962

Merged
merged 15 commits into from
Jun 11, 2024
20 changes: 20 additions & 0 deletions packages/cli/src/services/hooks.service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { Service } from 'typedi';
import { UserService } from '@/services/user.service';
import type { AssignableRole, User } from '@/databases/entities/User';

/**
* Exposes functionality to be used by the cloud BE hooks.
* DO NOT DELETE any of the methods without making sure this is not used in cloud BE hooks.
*/
@Service()
export class HooksService {
constructor(private userService: UserService) {}

/**
* Invites users to the instance.
* This method is used in the cloud BE hooks, to invite members during sign-up
*/
async inviteUsers(owner: User, attributes: Array<{ email: string; role: AssignableRole }>) {
RicardoE105 marked this conversation as resolved.
Show resolved Hide resolved
return await this.userService.inviteUsers(owner, attributes);
RicardoE105 marked this conversation as resolved.
Show resolved Hide resolved
}
}
Loading