UNPKG

fleeta-api-lib

Version:

A comprehensive library for fleet management applications - API, Auth, Device management

422 lines 11.8 kB
/** * Group API Type Definitions * Defines interfaces and types for group management functionality */ /** * Group data interface from API response */ export interface GroupData { groupManagementID: string; groupName: string; groupRegDT: string; } /** * Add group request parameters interface */ export interface AddGroupParams { email: string; user_token: string; groupNameList: string[]; tokenType?: 'web' | 'app'; } /** * Add group API response interface */ export interface AddGroupResponse { resultcode: string; message: string; response?: { groupData: GroupData[]; }; } /** * Group API error codes mapping */ export declare const GROUP_API_ERROR_MESSAGES: { readonly BC_ERR_AUTHENTICATION: "Authentication failed - please check your credentials"; readonly BC_ERR_INVALID_PARAMETER: "Invalid parameter provided"; readonly BC_ERR_SERVER: "Internal server error occurred"; }; /** * SubMaster information interface */ export interface SubMasterInfo { subMasterEmail: string; subMasterFirstName: string; subMasterLastName: string; subMasterStatus: string; subMasterProfilePath: string; } /** * Group list item interface */ export interface GroupListItem { groupManagementID: string; groupName: string; deviceCount: number; userCount: number; createDT: string; createUT: number; admins: SubMasterInfo[]; } /** * Get group list request parameters interface */ export interface GetGroupListParams { email: string; userToken: string; tokenType?: TokenType; ordering?: 0 | 1 | 2; keyword?: string; startIndex?: number; endIndex?: number; } /** * Get group list API response interface */ export interface GetGroupListResponse { resultcode: string; message: string; response?: { groupCount: number; groupListInfo: GroupListItem[]; }; } /** * Get group list error codes mapping */ export declare const GET_GROUP_LIST_ERROR_MESSAGES: { readonly BC_ERR_AUTHENTICATION: "Authentication failed - please check your credentials"; readonly BC_ERR_INVALID_PARAMETER: "Invalid parameter provided"; readonly BC_ERR_SERVER: "Internal server error occurred"; }; /** * Delete group request parameters interface */ export interface DeleteGroupParams { email: string; user_token: string; groupDeleteIDList: string[]; tokenType?: 'web' | 'app'; } /** * Delete group API response interface */ export interface DeleteGroupResponse { resultcode: string; message: string; response?: {}; } /** * Delete group error codes mapping */ export declare const DELETE_GROUP_ERROR_MESSAGES: { readonly BC_ERR_AUTHENTICATION: "Authentication failed - please check your credentials"; readonly BC_ERR_INVALID_PARAMETER: "Invalid parameter provided"; readonly BC_ERR_SERVER: "Internal server error occurred"; }; /** * Group rename item interface */ export interface GroupRenameItem { groupID: string; groupName: string; } /** * Rename group request parameters interface */ export interface RenameGroupParams { email: string; user_token: string; groupRenameList: GroupRenameItem[]; tokenType?: 'web' | 'app'; } /** * Rename group API response interface */ export interface RenameGroupResponse { resultcode: string; message: string; response?: {}; } /** * Rename group error codes mapping */ export declare const RENAME_GROUP_ERROR_MESSAGES: { readonly BC_ERR_AUTHENTICATION: "Authentication failed - please check your credentials"; readonly BC_ERR_INVALID_PARAMETER: "Invalid parameter provided"; readonly BC_ERR_SERVER: "Internal server error occurred"; }; /** * Assign SubMaster to group request parameters interface */ export interface AssignSubMasterToGroupParams { email: string; user_token: string; guestEmail: string; groupManagementID: string; tokenType?: 'web' | 'app'; } /** * Assign SubMaster to group API response interface */ export interface AssignSubMasterToGroupResponse { resultcode: string; message: string; } /** * Assign SubMaster to group error codes mapping */ export declare const ASSIGN_SUBMASTER_ERROR_MESSAGES: { readonly BC_ERR_AUTHENTICATION: "Authentication failed - please check your credentials"; readonly BC_ERR_INVALID_PARAMETER: "Invalid parameter provided"; readonly BC_ERR_UNAVAILABLE: "Operation not available - check SubMaster eligibility and group capacity"; readonly BC_ERR_SERVER: "Internal server error occurred"; }; /** * Unassign SubMaster from group request parameters interface */ export interface UnassignSubMasterFromGroupParams { email: string; user_token: string; guestEmail: string; groupManagementID: string; tokenType?: 'web' | 'app'; } /** * Unassign SubMaster from group API response interface */ export interface UnassignSubMasterFromGroupResponse { resultcode: string; message: string; } /** * Unassign SubMaster from group error codes mapping */ export declare const UNASSIGN_SUBMASTER_ERROR_MESSAGES: { readonly BC_ERR_AUTHENTICATION: "Authentication failed - please check your credentials"; readonly BC_ERR_INVALID_PARAMETER: "Invalid parameter provided"; readonly BC_ERR_UNAVAILABLE: "Operation not available - SubMaster may not be assigned to this group"; readonly BC_ERR_SERVER: "Internal server error occurred"; }; /** * Token type for requests */ export type TokenType = 'web' | 'app'; /** * Device assignment to group item interface */ export interface DeviceGroupAssignment { PSN: string; GroupName: string; GroupID: string; } /** * Add devices to group request parameters interface */ export interface AddDevicesToGroupParams { Email: string; UserToken: string; Add: DeviceGroupAssignment[]; TokenType?: TokenType; } /** * Add devices to group API response interface */ export interface AddDevicesToGroupResponse { resultcode: string; message: string; } /** * Add devices to group error codes mapping */ export declare const ADD_DEVICES_TO_GROUP_ERROR_MESSAGES: { readonly BC_ERR_AUTHENTICATION: "Authentication failed - please check your credentials"; readonly BC_ERR_INVALID_PARAMETER: "Invalid parameter provided"; readonly BC_ERR_SERVER: "Internal server error occurred or PSN already exists"; readonly BC_ERR_INVALID_PERMISSIONS: "Invalid permissions - insufficient privileges"; readonly BC_ERR_DUPLICATED_PSN: "PSN already exists in the group"; }; /** * Device removal from group item interface */ export interface DeviceGroupRemoval { PSN: string; GroupName: string; GroupID: string; } /** * Remove devices from group request parameters interface */ export interface RemoveDevicesFromGroupParams { Email: string; UserToken: string; Del: DeviceGroupRemoval[]; TokenType?: TokenType; } /** * Remove devices from group API response interface */ export interface RemoveDevicesFromGroupResponse { resultcode: string; message: string; } /** * Remove devices from group error codes mapping */ export declare const REMOVE_DEVICES_FROM_GROUP_ERROR_MESSAGES: { readonly BC_ERR_AUTHENTICATION: "Authentication failed - please check your credentials"; readonly BC_ERR_INVALID_PARAMETER: "Invalid parameter provided"; readonly BC_ERR_SERVER: "Internal server error occurred"; readonly BC_ERR_INVALID_PERMISSIONS: "Invalid permissions - insufficient privileges"; }; /** * Group allocation user information interface */ export interface GroupAllocationUser { Email: string; FirstName: string; LastName: string; Status: 'P' | 'A'; } /** * Group allocation device information interface */ export interface GroupAllocationDevice { PSN: string; DashCamName: string; Users?: GroupAllocationUser[]; } /** * Group dashcams item interface */ export interface GroupDashcamsItem { GroupID: string; GroupName: string; CreateDT: string; SubMasterEmail?: string; SubMasterFirstName?: string; SubMasterLastName?: string; SubMasterStatus?: 'P' | 'A'; SubMasterProfilePath?: string; DashCamUser?: GroupAllocationDevice[]; } /** * Get group devices request parameters interface */ export interface GetGroupDevicesParams { Email: string; UserToken: string; TokenType?: 'web' | 'app'; } /** * Get group devices API response interface */ export interface GetGroupDevicesResponse { resultcode: string; message: string; response?: { DashCamList: GroupDashcamsItem[]; }; } /** * Get group devices error codes mapping */ export declare const GET_GROUP_DEVICES_ERROR_MESSAGES: { readonly BC_ERR_AUTHENTICATION: "Authentication failed - please check your credentials"; readonly BC_ERR_INVALID_PARAMETER: "Invalid parameter provided"; readonly BC_ERR_SERVER: "Internal server error occurred"; readonly BC_ERR_INVALID_PERMISSIONS: "Invalid permissions - insufficient privileges"; }; /** * Assign user to device request parameters interface */ export interface AssignUserToDeviceParams { Email: string; UserToken: string; GroupID: string; PSN: string; UserEmail: string[]; TokenType?: 'web' | 'app'; } /** * Assign user to device API response interface */ export interface AssignUserToDeviceResponse { resultcode: string; message: string; } /** * Assign user to device error codes mapping */ export declare const ASSIGN_USER_TO_DEVICE_ERROR_MESSAGES: { readonly BC_ERR_AUTHENTICATION: "Authentication failed - please check your credentials"; readonly BC_ERR_INVALID_PARAMETER: "Invalid parameter provided"; readonly BC_ERR_SERVER: "Internal server error occurred"; readonly BC_ERR_INVALID_PERMISSIONS: "Invalid permissions - insufficient privileges"; readonly BC_ERR_EXCEED_USER_LIMIT_PER_CAM: "You've reached the user limit per camera"; }; /** * Unassign user from device request parameters interface */ export interface UnassignUserFromDeviceParams { Email: string; UserToken: string; GroupID: string; PSN: string; UserEmail: string; TokenType?: 'web' | 'app'; } /** * Unassign user from device API response interface */ export interface UnassignUserFromDeviceResponse { resultcode: string; message: string; } /** * Unassign user from device error codes mapping */ export declare const UNASSIGN_USER_FROM_DEVICE_ERROR_MESSAGES: { readonly BC_ERR_AUTHENTICATION: "Authentication failed - please check your credentials"; readonly BC_ERR_INVALID_PARAMETER: "Invalid parameter provided"; readonly BC_ERR_SERVER: "Internal server error occurred"; readonly BC_ERR_INVALID_PERMISSIONS: "Invalid permissions - insufficient privileges"; }; /** * Group user information interface (for dashcam allocation) */ export interface GroupUser { Email: string; FirstName: string; LastName: string; Status: 'A' | 'P'; } /** * Get group users request parameters interface */ export interface GetGroupUsersParams { Email: string; UserToken: string; TokenType?: 'web' | 'app'; } /** * Get group users API response interface */ export interface GetGroupUsersResponse { resultcode: string; message: string; response?: { Users: GroupUser[]; }; } /** * Get group users error codes mapping */ export declare const GET_GROUP_USERS_ERROR_MESSAGES: { readonly BC_ERR_AUTHENTICATION: "Authentication failed - please check your credentials"; readonly BC_ERR_INVALID_PARAMETER: "Invalid parameter provided"; readonly BC_ERR_SERVER: "Internal server error occurred"; readonly BC_ERR_INVALID_PERMISSIONS: "Invalid permissions - insufficient privileges"; }; //# sourceMappingURL=types.d.ts.map