UNPKG

@vulog/aima-user

Version:

User management module for the AIMA platform. This module provides comprehensive functionality to manage users, profiles, billing groups, and user-related operations.

23 lines (19 loc) 770 B
import { Client } from '@vulog/aima-client'; import { z } from 'zod'; export const registerUserToService = async (client: Client, entityId: string, serviceId: string): Promise<void> => { const resultEntityId = z.string().uuid().safeParse(entityId); if (!resultEntityId.success) { throw new TypeError('Invalid entityId', { cause: resultEntityId.error.issues, }); } const resultServiceId = z.string().uuid().safeParse(serviceId); if (!resultServiceId.success) { throw new TypeError('Invalid serviceId', { cause: resultServiceId.error.issues, }); } await client.put( `boapi/proxy/user/fleets/${client.clientOptions.fleetId}/entities/${entityId}/services/${serviceId}` ); };