Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export async function deleteGraphUser(tenant: string, email: string) {
const user = caller(
`${process.env.GRAPH_HOST || 'graph'}:443`,
path.resolve(__dirname, 'graph.proto'),
'UserService',
);
await user.Delete({tenant, id: email}).catch(err => console.error(err));
}
export async function triggerActionsAlert(payload: Payload) {
logger.info('sending payload: %s', payload);
const actionsAlertService = caller(
`${process.env.GRAPH_HOST || 'graph'}:443`,
path.resolve(__dirname, 'graph.proto'),
'ActionsAlertService',
);
await actionsAlertService.Trigger(payload).catch(err => console.error(err));
}
export async function createGraphUser(
tenant: string,
email: string,
isOwner: boolean,
) {
const user = caller(
`${process.env.GRAPH_HOST || 'graph'}:443`,
path.resolve(__dirname, 'graph.proto'),
'UserService',
);
await user
.Create({tenant, id: email, isOwner})
.catch(err => console.error(err));
}