@alba-cars/common-modules
Version:
A package containing DTOs, validation classes and common modules and interfaces for Alba Cars
114 lines (113 loc) • 3.68 kB
TypeScript
type EndpointFunction = (_id: number | string) => string;
interface BaseEndpoint {
getAll: string | EndpointFunction;
create: string | EndpointFunction;
getOne: EndpointFunction;
deleteOne: EndpointFunction;
updateOne: EndpointFunction;
}
interface VehicleEndpoints extends BaseEndpoint {
getSimilar: EndpointFunction;
getOneBySlug: EndpointFunction;
getOneByRef: EndpointFunction;
publishVehicle: EndpointFunction;
unpublishVehicle: EndpointFunction;
reserveVehicle: EndpointFunction;
selfReserveVehicle: EndpointFunction;
markVehicleSold: EndpointFunction;
markVehicleDraft: EndpointFunction;
}
interface BlogEndpoints extends BaseEndpoint {
getOneBySlug: EndpointFunction;
}
type MetaEndpoints = BaseEndpoint & {
aiGenerateTitle: EndpointFunction;
aiGenerateDescription: EndpointFunction;
aiGenerateKeyword: EndpointFunction;
aiGenerateVehicleDescription: EndpointFunction;
};
type DepositEndpoints = BaseEndpoint & {
initiateRefund: string | EndpointFunction;
getOrCreateUserInformation: string;
};
type UserEndpoints = BaseEndpoint & {
changeProfilePicture: EndpointFunction;
deleteProfilePicture: EndpointFunction;
};
type TicketEndpoints = BaseEndpoint & {
getMyTickets: string;
getUserTickets: EndpointFunction;
getAgentTickets: EndpointFunction;
addMessage: EndpointFunction;
addDocument: EndpointFunction;
getDocuments: EndpointFunction;
reopenTicket: EndpointFunction;
};
type ReviewEndpoints = BaseEndpoint & {
changeReviewShowPublic: EndpointFunction;
};
type VehicleFeatureEndpoints = BaseEndpoint & {
changeIcon: EndpointFunction;
};
type DealDriveEndpoints = BaseEndpoint & {
getAllMakes: EndpointFunction;
getAllModels: EndpointFunction;
};
type FinanceEligibilityRequestEndpoints = BaseEndpoint & {
updateStatus: EndpointFunction;
};
type BankValuationRequestEndpoints = BaseEndpoint & {
estimate: string;
};
type APIEndpointType = {
vehicle: VehicleEndpoints;
blogs: BlogEndpoints;
vehicleFinance: BaseEndpoint;
TestDrive: BaseEndpoint;
vehicleMake: BaseEndpoint & {
getOneBySlug: (slug: string) => string;
};
vehicleModel: BaseEndpoint;
vehicleMeta: MetaEndpoints;
vehicleInspection: BaseEndpoint;
vehicleOrder: BaseEndpoint;
vehicleFeatures: VehicleFeatureEndpoints;
vehicleFeatureCategories: BaseEndpoint;
vehicleType: BaseEndpoint;
payment: BaseEndpoint;
deposit: DepositEndpoints;
agents: BaseEndpoint;
showroomVisit: BaseEndpoint;
sellCarRequest: BaseEndpoint;
financeEligibilityRequest: FinanceEligibilityRequestEndpoints;
vehicleReservations: BaseEndpoint;
languages: BaseEndpoint;
leads: BaseEndpoint;
leadPreferences: BaseEndpoint;
googleReview: ReviewEndpoints;
tickets: TicketEndpoints;
user: UserEndpoints;
faq: BaseEndpoint;
dealDrive: DealDriveEndpoints;
bankValuationRequest: BankValuationRequestEndpoints;
};
export declare const API_ENDPOINTS: APIEndpointType;
export declare const UTIL_ENDPOINTS: {
media: {
createS3Url: string;
preprocessMediaUrl: string;
removeS3Media: string;
removeVehicleMedia: string;
removeByIdentifier: string;
};
};
export declare const AUTH_ENDPOINTS: {
login: string;
register: string;
refreshAccessToken: string;
sendPhoneVerificationCode: string;
verifyPhoneAndLogin: string;
verifyAnyPhoneNumber: string;
checkPhoneNumberExists: string;
};
export {};