@alba-cars/common-modules 2.11.0 → 2.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -42
- package/dist/core/enums/Analytics.d.ts +24 -24
- package/dist/core/enums/HttpMethods.d.ts +12 -12
- package/dist/core/enums/HttpStatusCodes.d.ts +18 -18
- package/dist/core/enums/index.d.ts +3 -3
- package/dist/core/error-handling/AppError.d.ts +23 -23
- package/dist/core/error-handling/index.d.ts +1 -1
- package/dist/core/index.d.ts +5 -5
- package/dist/core/models/index.d.ts +3 -3
- package/dist/core/models/media/index.d.ts +1 -1
- package/dist/core/models/media/media_data.d.ts +5 -5
- package/dist/core/models/pagination/index.d.ts +1 -1
- package/dist/core/models/pagination/paginated_data.d.ts +23 -23
- package/dist/core/models/range.d.ts +4 -4
- package/dist/core/network/endpoint-config.d.ts +155 -155
- package/dist/core/network/fetch-api.d.ts +62 -62
- package/dist/core/network/index.d.ts +2 -2
- package/dist/core/utils/formatCurrency.d.ts +11 -11
- package/dist/core/utils/global-constants.d.ts +6 -6
- package/dist/core/utils/global-utils.d.ts +108 -108
- package/dist/core/utils/global_validators.d.ts +2 -2
- package/dist/core/utils/index.d.ts +4 -4
- package/dist/core/utils/query_flatten.d.ts +1 -1
- package/dist/features/auth/data/dto/AuthDTO.d.ts +32 -32
- package/dist/features/auth/data/dto/RoleDTO.d.ts +41 -41
- package/dist/features/auth/data/dto/UserDTO.d.ts +71 -71
- package/dist/features/auth/data/index.d.ts +3 -3
- package/dist/features/auth/index.d.ts +1 -1
- package/dist/features/bank-valuation-request/data/dto/BankValuationRequestDTO.d.ts +55 -55
- package/dist/features/bank-valuation-request/index.d.ts +1 -1
- package/dist/features/blog/data/dto/BlogDTO.d.ts +73 -73
- package/dist/features/blog/index.d.ts +1 -1
- package/dist/features/callback-request/data/dto/CallBackRequestDTO.d.ts +32 -32
- package/dist/features/callback-request/index.d.ts +1 -1
- package/dist/features/deposits/data/dto/DepositDTOs.d.ts +84 -84
- package/dist/features/deposits/data/index.d.ts +1 -1
- package/dist/features/deposits/index.d.ts +1 -1
- package/dist/features/faq/data/dtos/CreateFaqDTO.d.ts +15 -15
- package/dist/features/faq/data/dtos/FaqFetchDTO.d.ts +105 -105
- package/dist/features/faq/data/dtos/UpdateFaqDTO.d.ts +15 -15
- package/dist/features/faq/data/dtos/index.d.ts +3 -3
- package/dist/features/faq/data/enums/index.d.ts +6 -6
- package/dist/features/faq/data/index.d.ts +2 -2
- package/dist/features/faq/index.d.ts +1 -1
- package/dist/features/finance-eligibilty-request/data/dto/FinanceEligibilityRequestDTO.d.ts +144 -144
- package/dist/features/finance-eligibilty-request/data/index.d.ts +1 -1
- package/dist/features/finance-eligibilty-request/index.d.ts +1 -1
- package/dist/features/google-review/data/dto/google_review_dto.d.ts +103 -103
- package/dist/features/google-review/data/dto/index.d.ts +1 -1
- package/dist/features/google-review/data/enums/index.d.ts +4 -4
- package/dist/features/google-review/data/index.d.ts +2 -2
- package/dist/features/google-review/index.d.ts +1 -1
- package/dist/features/index.d.ts +18 -18
- package/dist/features/lead/data/dto/index.d.ts +4 -4
- package/dist/features/lead/data/dto/lead_documents_dto.d.ts +24 -24
- package/dist/features/lead/data/dto/lead_dto.d.ts +104 -104
- package/dist/features/lead/data/dto/lead_preference_history_dto.d.ts +84 -84
- package/dist/features/lead/data/dto/lead_prefernce_dto.d.ts +68 -68
- package/dist/features/lead/data/enum/index.d.ts +2 -2
- package/dist/features/lead/data/enum/lead_source_status_types.d.ts +15 -15
- package/dist/features/lead/data/enum/lead_status_type.d.ts +8 -8
- package/dist/features/lead/index.d.ts +2 -2
- package/dist/features/models/Bank.d.ts +9 -9
- package/dist/features/models/BankValuationRequest.d.ts +63 -63
- package/dist/features/models/BankValuationResult.d.ts +24 -24
- package/dist/features/models/Base.d.ts +12 -12
- package/dist/features/models/Color.d.ts +10 -10
- package/dist/features/models/Deposit.d.ts +18 -18
- package/dist/features/models/Lead.d.ts +25 -25
- package/dist/features/models/Payment.d.ts +46 -46
- package/dist/features/models/Roles.d.ts +7 -7
- package/dist/features/models/Ticket.d.ts +51 -51
- package/dist/features/models/User.d.ts +24 -24
- package/dist/features/models/UserFavoriteVehicle.d.ts +9 -9
- package/dist/features/models/Vehicle.d.ts +76 -76
- package/dist/features/models/VehicleBodyType.d.ts +8 -8
- package/dist/features/models/VehicleCategory.d.ts +6 -6
- package/dist/features/models/VehicleFeature.d.ts +10 -10
- package/dist/features/models/VehicleFeatureCategory.d.ts +7 -7
- package/dist/features/models/VehicleFinance.d.ts +24 -24
- package/dist/features/models/VehicleMake.d.ts +14 -14
- package/dist/features/models/VehicleMedia.d.ts +12 -12
- package/dist/features/models/VehicleMetaData.d.ts +11 -11
- package/dist/features/models/VehicleModel.d.ts +17 -17
- package/dist/features/models/VehicleOrder.d.ts +14 -14
- package/dist/features/models/_index.d.ts +14 -14
- package/dist/features/models/index.d.ts +21 -21
- package/dist/features/newsletter/data/dto/NewsletterDTO.d.ts +17 -17
- package/dist/features/newsletter/index.d.ts +1 -1
- package/dist/features/sales-team/data/dto/LanguageDTO.d.ts +20 -20
- package/dist/features/sales-team/data/dto/SalesAgentDTO.d.ts +191 -191
- package/dist/features/sales-team/data/index.d.ts +2 -2
- package/dist/features/sales-team/index.d.ts +1 -1
- package/dist/features/sell-car-request/data/dto/SellCarRequestDTO.d.ts +203 -203
- package/dist/features/sell-car-request/data/index.d.ts +1 -1
- package/dist/features/sell-car-request/index.d.ts +1 -1
- package/dist/features/showroom-visit/data/dto/ShowroomVisit.d.ts +69 -69
- package/dist/features/showroom-visit/data/enums/index.d.ts +11 -11
- package/dist/features/showroom-visit/data/index.d.ts +2 -2
- package/dist/features/showroom-visit/index.d.ts +1 -1
- package/dist/features/test-drive-request/api/GetTestDriveVehicles.d.ts +3 -3
- package/dist/features/test-drive-request/api/index.d.ts +1 -1
- package/dist/features/test-drive-request/data/dto/TestDriveRequestDTO.d.ts +51 -51
- package/dist/features/test-drive-request/data/enums/index.d.ts +24 -24
- package/dist/features/test-drive-request/data/index.d.ts +4 -4
- package/dist/features/test-drive-request/data/models/TestDriveRequest.d.ts +14 -14
- package/dist/features/test-drive-request/data/models/index.d.ts +2 -2
- package/dist/features/test-drive-request/data/utilities.d.ts +30 -30
- package/dist/features/test-drive-request/index.d.ts +2 -2
- package/dist/features/tickets/data/dto/TicketDto.d.ts +69 -69
- package/dist/features/tickets/data/enums/index.d.ts +18 -18
- package/dist/features/tickets/index.d.ts +2 -2
- package/dist/features/vehicle/data/dto/BaseDTO.d.ts +9 -9
- package/dist/features/vehicle/data/dto/ColorDTO.d.ts +10 -10
- package/dist/features/vehicle/data/dto/MediaDTO.d.ts +5 -5
- package/dist/features/vehicle/data/dto/PaymentDTO.d.ts +52 -52
- package/dist/features/vehicle/data/dto/SimilarVehicleDTO.d.ts +12 -12
- package/dist/features/vehicle/data/dto/VehicleCategoryDTO.d.ts +39 -39
- package/dist/features/vehicle/data/dto/VehicleDTO.d.ts +143 -143
- package/dist/features/vehicle/data/dto/VehicleFavoritesDTO.d.ts +14 -14
- package/dist/features/vehicle/data/dto/VehicleFeatureCategoriesDTO.d.ts +39 -39
- package/dist/features/vehicle/data/dto/VehicleFeatureDTO.d.ts +40 -40
- package/dist/features/vehicle/data/dto/VehicleFilterDTO.d.ts +257 -257
- package/dist/features/vehicle/data/dto/VehicleFinanceDTO.d.ts +63 -63
- package/dist/features/vehicle/data/dto/VehicleInspectionDTO.d.ts +147 -147
- package/dist/features/vehicle/data/dto/VehicleMakeDTO.d.ts +52 -52
- package/dist/features/vehicle/data/dto/VehicleMedia.d.ts +44 -44
- package/dist/features/vehicle/data/dto/VehicleModelDTO.d.ts +50 -50
- package/dist/features/vehicle/data/dto/VehicleOrderDTO.d.ts +34 -34
- package/dist/features/vehicle/data/dto/VehicleTypeDTO.d.ts +35 -35
- package/dist/features/vehicle/data/dto/VehicleWarrantyDTO.d.ts +9 -9
- package/dist/features/vehicle/data/dto/index.d.ts +20 -20
- package/dist/features/vehicle/data/enums/index.d.ts +40 -40
- package/dist/features/vehicle/data/index.d.ts +3 -3
- package/dist/features/vehicle/data/utilities.d.ts +185 -185
- package/dist/features/vehicle/index.d.ts +1 -1
- package/dist/features/vehicle-reservations/data/dto/VehicleReservationDTO.d.ts +106 -106
- package/dist/features/vehicle-reservations/data/dto/index.d.ts +1 -1
- package/dist/features/vehicle-reservations/data/enums/finance-type.d.ts +5 -5
- package/dist/features/vehicle-reservations/data/enums/index.d.ts +3 -3
- package/dist/features/vehicle-reservations/data/enums/reservation-type.d.ts +9 -9
- package/dist/features/vehicle-reservations/data/enums/vehicle-reservation-type.d.ts +4 -4
- package/dist/features/vehicle-reservations/index.d.ts +2 -2
- package/dist/global/dto/BaseGetDTO.d.ts +8 -8
- package/dist/global/dto/index.d.ts +1 -1
- package/dist/global/index.d.ts +2 -2
- package/dist/global/utilities.d.ts +53 -53
- package/dist/index.d.ts +5 -5
- package/dist/index.js +1 -1
- package/dist/models.d.ts +1 -1
- package/package.json +62 -62
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
interface ApiRequestOptions extends RequestInit {
|
|
2
|
-
headers?: Record<string, string>;
|
|
3
|
-
query?: Record<string, any>;
|
|
4
|
-
timeout?: number;
|
|
5
|
-
signal?: AbortSignal;
|
|
6
|
-
isRetry?: boolean;
|
|
7
|
-
}
|
|
8
|
-
type RequestInterceptor = (config: RequestInit & {
|
|
9
|
-
url: string;
|
|
10
|
-
options: ApiRequestOptions;
|
|
11
|
-
}) => Promise<RequestInit & {
|
|
12
|
-
url: string;
|
|
13
|
-
options: ApiRequestOptions;
|
|
14
|
-
}> | (RequestInit & {
|
|
15
|
-
url: string;
|
|
16
|
-
options: ApiRequestOptions;
|
|
17
|
-
});
|
|
18
|
-
type ResponseInterceptor = (response: Response, requestConfig: RequestInit & {
|
|
19
|
-
url: string;
|
|
20
|
-
options: ApiRequestOptions;
|
|
21
|
-
}) => Promise<Response> | Response;
|
|
22
|
-
type ResponseErrorInterceptor = (error: any, requestConfig: RequestInit & {
|
|
23
|
-
url: string;
|
|
24
|
-
options: ApiRequestOptions;
|
|
25
|
-
}) => Promise<any> | any;
|
|
26
|
-
declare class InterceptorManager {
|
|
27
|
-
private requestInterceptors;
|
|
28
|
-
private responseInterceptors;
|
|
29
|
-
private responseErrorInterceptors;
|
|
30
|
-
addRequestInterceptor(interceptor: RequestInterceptor): number;
|
|
31
|
-
addResponseInterceptor(interceptor: ResponseInterceptor): number;
|
|
32
|
-
addResponseErrorInterceptor(interceptor: ResponseErrorInterceptor): number;
|
|
33
|
-
removeRequestInterceptor(index: number): void;
|
|
34
|
-
removeResponseInterceptor(index: number): void;
|
|
35
|
-
removeResponseErrorInterceptor(index: number): void;
|
|
36
|
-
clearRequestInterceptors(): void;
|
|
37
|
-
clearResponseInterceptors(): void;
|
|
38
|
-
clearResponseErrorInterceptors(): void;
|
|
39
|
-
clearAllInterceptors(): void;
|
|
40
|
-
applyRequestInterceptors(config: RequestInit & {
|
|
41
|
-
url: string;
|
|
42
|
-
options: ApiRequestOptions;
|
|
43
|
-
}): Promise<RequestInit & {
|
|
44
|
-
url: string;
|
|
45
|
-
options: ApiRequestOptions;
|
|
46
|
-
}>;
|
|
47
|
-
applyResponseInterceptors(response: Response, requestConfig: RequestInit & {
|
|
48
|
-
url: string;
|
|
49
|
-
options: ApiRequestOptions;
|
|
50
|
-
}): Promise<Response>;
|
|
51
|
-
applyResponseErrorInterceptors(error: any, requestConfig: RequestInit & {
|
|
52
|
-
url: string;
|
|
53
|
-
options: ApiRequestOptions;
|
|
54
|
-
}): Promise<any>;
|
|
55
|
-
retryRequest<T>(config: RequestInit & {
|
|
56
|
-
url: string;
|
|
57
|
-
options: ApiRequestOptions;
|
|
58
|
-
}): Promise<T>;
|
|
59
|
-
}
|
|
60
|
-
export declare const interceptors: InterceptorManager;
|
|
61
|
-
export declare function apiRequest<T>(endpoint: string, options?: ApiRequestOptions): Promise<T>;
|
|
62
|
-
export {};
|
|
1
|
+
interface ApiRequestOptions extends RequestInit {
|
|
2
|
+
headers?: Record<string, string>;
|
|
3
|
+
query?: Record<string, any>;
|
|
4
|
+
timeout?: number;
|
|
5
|
+
signal?: AbortSignal;
|
|
6
|
+
isRetry?: boolean;
|
|
7
|
+
}
|
|
8
|
+
type RequestInterceptor = (config: RequestInit & {
|
|
9
|
+
url: string;
|
|
10
|
+
options: ApiRequestOptions;
|
|
11
|
+
}) => Promise<RequestInit & {
|
|
12
|
+
url: string;
|
|
13
|
+
options: ApiRequestOptions;
|
|
14
|
+
}> | (RequestInit & {
|
|
15
|
+
url: string;
|
|
16
|
+
options: ApiRequestOptions;
|
|
17
|
+
});
|
|
18
|
+
type ResponseInterceptor = (response: Response, requestConfig: RequestInit & {
|
|
19
|
+
url: string;
|
|
20
|
+
options: ApiRequestOptions;
|
|
21
|
+
}) => Promise<Response> | Response;
|
|
22
|
+
type ResponseErrorInterceptor = (error: any, requestConfig: RequestInit & {
|
|
23
|
+
url: string;
|
|
24
|
+
options: ApiRequestOptions;
|
|
25
|
+
}) => Promise<any> | any;
|
|
26
|
+
declare class InterceptorManager {
|
|
27
|
+
private requestInterceptors;
|
|
28
|
+
private responseInterceptors;
|
|
29
|
+
private responseErrorInterceptors;
|
|
30
|
+
addRequestInterceptor(interceptor: RequestInterceptor): number;
|
|
31
|
+
addResponseInterceptor(interceptor: ResponseInterceptor): number;
|
|
32
|
+
addResponseErrorInterceptor(interceptor: ResponseErrorInterceptor): number;
|
|
33
|
+
removeRequestInterceptor(index: number): void;
|
|
34
|
+
removeResponseInterceptor(index: number): void;
|
|
35
|
+
removeResponseErrorInterceptor(index: number): void;
|
|
36
|
+
clearRequestInterceptors(): void;
|
|
37
|
+
clearResponseInterceptors(): void;
|
|
38
|
+
clearResponseErrorInterceptors(): void;
|
|
39
|
+
clearAllInterceptors(): void;
|
|
40
|
+
applyRequestInterceptors(config: RequestInit & {
|
|
41
|
+
url: string;
|
|
42
|
+
options: ApiRequestOptions;
|
|
43
|
+
}): Promise<RequestInit & {
|
|
44
|
+
url: string;
|
|
45
|
+
options: ApiRequestOptions;
|
|
46
|
+
}>;
|
|
47
|
+
applyResponseInterceptors(response: Response, requestConfig: RequestInit & {
|
|
48
|
+
url: string;
|
|
49
|
+
options: ApiRequestOptions;
|
|
50
|
+
}): Promise<Response>;
|
|
51
|
+
applyResponseErrorInterceptors(error: any, requestConfig: RequestInit & {
|
|
52
|
+
url: string;
|
|
53
|
+
options: ApiRequestOptions;
|
|
54
|
+
}): Promise<any>;
|
|
55
|
+
retryRequest<T>(config: RequestInit & {
|
|
56
|
+
url: string;
|
|
57
|
+
options: ApiRequestOptions;
|
|
58
|
+
}): Promise<T>;
|
|
59
|
+
}
|
|
60
|
+
export declare const interceptors: InterceptorManager;
|
|
61
|
+
export declare function apiRequest<T>(endpoint: string, options?: ApiRequestOptions): Promise<T>;
|
|
62
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./endpoint-config";
|
|
2
|
-
export * from "./fetch-api";
|
|
1
|
+
export * from "./endpoint-config";
|
|
2
|
+
export * from "./fetch-api";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Formats a number as UAE Dirham (AED) currency with proper comma separation
|
|
3
|
-
* @param amount The numeric value to be formatted
|
|
4
|
-
* @param options Optional configuration for formatting
|
|
5
|
-
* @returns Formatted currency string
|
|
6
|
-
*/
|
|
7
|
-
export declare const formatCurrency: (amount?: number | null, options?: {
|
|
8
|
-
currency?: string;
|
|
9
|
-
minimumFractionDigits?: number;
|
|
10
|
-
maximumFractionDigits?: number;
|
|
11
|
-
}) => string;
|
|
1
|
+
/**
|
|
2
|
+
* Formats a number as UAE Dirham (AED) currency with proper comma separation
|
|
3
|
+
* @param amount The numeric value to be formatted
|
|
4
|
+
* @param options Optional configuration for formatting
|
|
5
|
+
* @returns Formatted currency string
|
|
6
|
+
*/
|
|
7
|
+
export declare const formatCurrency: (amount?: number | null, options?: {
|
|
8
|
+
currency?: string;
|
|
9
|
+
minimumFractionDigits?: number;
|
|
10
|
+
maximumFractionDigits?: number;
|
|
11
|
+
}) => string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export declare const ONE_MINUTE_MILLIS: number;
|
|
2
|
-
export declare const ONE_HOUR_MILLIS: number;
|
|
3
|
-
export declare const FIFTEEN_MINUTES_MILLIS: number;
|
|
4
|
-
export declare const THIRTY_MINUTES_MILLIS: number;
|
|
5
|
-
export declare const ONE_HOUR = 3600;
|
|
6
|
-
export declare const ONE_MINUTE = 60;
|
|
1
|
+
export declare const ONE_MINUTE_MILLIS: number;
|
|
2
|
+
export declare const ONE_HOUR_MILLIS: number;
|
|
3
|
+
export declare const FIFTEEN_MINUTES_MILLIS: number;
|
|
4
|
+
export declare const THIRTY_MINUTES_MILLIS: number;
|
|
5
|
+
export declare const ONE_HOUR = 3600;
|
|
6
|
+
export declare const ONE_MINUTE = 60;
|
|
@@ -1,108 +1,108 @@
|
|
|
1
|
-
import { Booleanish } from "../../global";
|
|
2
|
-
/**
|
|
3
|
-
* Deeply compares two objects for equality.
|
|
4
|
-
*
|
|
5
|
-
* @param obj1 - The first object to compare.
|
|
6
|
-
* @param obj2 - The second object to compare.
|
|
7
|
-
* @returns `true` if the objects are deeply equal, `false` otherwise.
|
|
8
|
-
*/
|
|
9
|
-
export declare const deepEqual: <T>(obj1: T, obj2: T) => boolean;
|
|
10
|
-
/**
|
|
11
|
-
* Checks if a value is a plain object (not an array or null)
|
|
12
|
-
*
|
|
13
|
-
* @template T
|
|
14
|
-
* @param {T} obj
|
|
15
|
-
* @returns {boolean}
|
|
16
|
-
*/
|
|
17
|
-
export declare const isPlainObject: <T>(obj: T) => boolean;
|
|
18
|
-
/**
|
|
19
|
-
* Checks if a value is a function
|
|
20
|
-
*
|
|
21
|
-
* @param {*} value
|
|
22
|
-
* @returns {boolean}
|
|
23
|
-
*/
|
|
24
|
-
export declare const isFunction: (value: any) => boolean;
|
|
25
|
-
type ComparatorFunction = (_a: any, _b: any) => number;
|
|
26
|
-
/**
|
|
27
|
-
* Function to sort an array by a specific key (for arrays of objects) or a comparator function
|
|
28
|
-
*
|
|
29
|
-
* @param {any[]} array
|
|
30
|
-
* @param {(string | ComparatorFunction)} key
|
|
31
|
-
* @returns {any[]}
|
|
32
|
-
*/
|
|
33
|
-
export declare const sortBy: (array: any[], key: string | ComparatorFunction) => any[];
|
|
34
|
-
export declare function generateRandomBase64(length: number): string;
|
|
35
|
-
export declare const formatValue: (n: number | string) => string;
|
|
36
|
-
interface TimeInput {
|
|
37
|
-
minutes?: number;
|
|
38
|
-
hours?: number;
|
|
39
|
-
seconds?: number;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Converts a time input to milliseconds
|
|
43
|
-
*/
|
|
44
|
-
export declare const timeAsMilliseconds: ({ minutes, hours, seconds }: TimeInput) => number;
|
|
45
|
-
/**
|
|
46
|
-
* Converts a time input to seconds
|
|
47
|
-
*/
|
|
48
|
-
export declare const timeAsSeconds: ({ minutes, hours, seconds }: TimeInput) => number;
|
|
49
|
-
/**
|
|
50
|
-
* Removes a key from an object or an array of objects (deeply)
|
|
51
|
-
*/
|
|
52
|
-
export declare function removeKeyFromObject(obj: any, keyToRemove: string): unknown;
|
|
53
|
-
/**
|
|
54
|
-
* Formats a number as a currency string (AED)
|
|
55
|
-
*/
|
|
56
|
-
export declare const currencyFormatter: ({ isDecimal, decimalPlaces }: {
|
|
57
|
-
isDecimal: boolean;
|
|
58
|
-
decimalPlaces: number;
|
|
59
|
-
}) => Intl.NumberFormat;
|
|
60
|
-
/**
|
|
61
|
-
* Safely parses a string or number into a number
|
|
62
|
-
*/
|
|
63
|
-
export declare const safeParseNumber: (value: string | number) => number;
|
|
64
|
-
/**
|
|
65
|
-
* Formats a number with commas
|
|
66
|
-
*/
|
|
67
|
-
export declare const formatNumberWithCommas: (value: string) => string;
|
|
68
|
-
/**
|
|
69
|
-
* Converts a single value or an array of values into an array
|
|
70
|
-
*/
|
|
71
|
-
export declare const makeArray: <T>(value: T | T[]) => T[];
|
|
72
|
-
/**
|
|
73
|
-
* Check if a value is empty (nullable or empty string)
|
|
74
|
-
*/
|
|
75
|
-
export declare const isEmpty: (value: any) => boolean;
|
|
76
|
-
/**
|
|
77
|
-
* Check if an object is an empty object
|
|
78
|
-
*/
|
|
79
|
-
export declare const isEmptyObject: (value: Record<string, any>) => boolean;
|
|
80
|
-
/**
|
|
81
|
-
* Check if a value is an empty array
|
|
82
|
-
*/
|
|
83
|
-
export declare const isEmptyArray: (value: any) => boolean;
|
|
84
|
-
/**
|
|
85
|
-
* Checks if a value is not empty (null, undefined, or empty string), not an empty object, and not an empty array
|
|
86
|
-
*/
|
|
87
|
-
export declare const hasValue: (value: any) => boolean;
|
|
88
|
-
/**
|
|
89
|
-
* Returns a pluralized string based on the value
|
|
90
|
-
* @example getPlural(1, 'item') => '1 item'
|
|
91
|
-
* @example getPlural(4, 'item') => '4 items'
|
|
92
|
-
* @example getPlural(2, 'person', 'people') => '2 people'
|
|
93
|
-
* @example getPlural(0, 'item') => '0 items'
|
|
94
|
-
*/
|
|
95
|
-
export declare const getPlural: (value: number, singular: string, plural?: string | null) => string;
|
|
96
|
-
/**
|
|
97
|
-
* Escapes special characters in a search term to prevent them from being interpreted as regex operators
|
|
98
|
-
*/
|
|
99
|
-
export declare const sanitizeRegexString: (input: string) => string;
|
|
100
|
-
/**
|
|
101
|
-
* Converts a value to a plain object by serializing to and from JSON
|
|
102
|
-
*/
|
|
103
|
-
export declare const toPlainObject: (value: unknown) => Record<string, any>;
|
|
104
|
-
/**
|
|
105
|
-
* Converts a Booleanish value (boolean | 'true' | '1' | 'false' | '0') to a boolean
|
|
106
|
-
*/
|
|
107
|
-
export declare const booleanize: (value: Booleanish) => boolean;
|
|
108
|
-
export {};
|
|
1
|
+
import { Booleanish } from "../../global";
|
|
2
|
+
/**
|
|
3
|
+
* Deeply compares two objects for equality.
|
|
4
|
+
*
|
|
5
|
+
* @param obj1 - The first object to compare.
|
|
6
|
+
* @param obj2 - The second object to compare.
|
|
7
|
+
* @returns `true` if the objects are deeply equal, `false` otherwise.
|
|
8
|
+
*/
|
|
9
|
+
export declare const deepEqual: <T>(obj1: T, obj2: T) => boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Checks if a value is a plain object (not an array or null)
|
|
12
|
+
*
|
|
13
|
+
* @template T
|
|
14
|
+
* @param {T} obj
|
|
15
|
+
* @returns {boolean}
|
|
16
|
+
*/
|
|
17
|
+
export declare const isPlainObject: <T>(obj: T) => boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Checks if a value is a function
|
|
20
|
+
*
|
|
21
|
+
* @param {*} value
|
|
22
|
+
* @returns {boolean}
|
|
23
|
+
*/
|
|
24
|
+
export declare const isFunction: (value: any) => boolean;
|
|
25
|
+
type ComparatorFunction = (_a: any, _b: any) => number;
|
|
26
|
+
/**
|
|
27
|
+
* Function to sort an array by a specific key (for arrays of objects) or a comparator function
|
|
28
|
+
*
|
|
29
|
+
* @param {any[]} array
|
|
30
|
+
* @param {(string | ComparatorFunction)} key
|
|
31
|
+
* @returns {any[]}
|
|
32
|
+
*/
|
|
33
|
+
export declare const sortBy: (array: any[], key: string | ComparatorFunction) => any[];
|
|
34
|
+
export declare function generateRandomBase64(length: number): string;
|
|
35
|
+
export declare const formatValue: (n: number | string) => string;
|
|
36
|
+
interface TimeInput {
|
|
37
|
+
minutes?: number;
|
|
38
|
+
hours?: number;
|
|
39
|
+
seconds?: number;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Converts a time input to milliseconds
|
|
43
|
+
*/
|
|
44
|
+
export declare const timeAsMilliseconds: ({ minutes, hours, seconds }: TimeInput) => number;
|
|
45
|
+
/**
|
|
46
|
+
* Converts a time input to seconds
|
|
47
|
+
*/
|
|
48
|
+
export declare const timeAsSeconds: ({ minutes, hours, seconds }: TimeInput) => number;
|
|
49
|
+
/**
|
|
50
|
+
* Removes a key from an object or an array of objects (deeply)
|
|
51
|
+
*/
|
|
52
|
+
export declare function removeKeyFromObject(obj: any, keyToRemove: string): unknown;
|
|
53
|
+
/**
|
|
54
|
+
* Formats a number as a currency string (AED)
|
|
55
|
+
*/
|
|
56
|
+
export declare const currencyFormatter: ({ isDecimal, decimalPlaces }: {
|
|
57
|
+
isDecimal: boolean;
|
|
58
|
+
decimalPlaces: number;
|
|
59
|
+
}) => Intl.NumberFormat;
|
|
60
|
+
/**
|
|
61
|
+
* Safely parses a string or number into a number
|
|
62
|
+
*/
|
|
63
|
+
export declare const safeParseNumber: (value: string | number) => number;
|
|
64
|
+
/**
|
|
65
|
+
* Formats a number with commas
|
|
66
|
+
*/
|
|
67
|
+
export declare const formatNumberWithCommas: (value: string) => string;
|
|
68
|
+
/**
|
|
69
|
+
* Converts a single value or an array of values into an array
|
|
70
|
+
*/
|
|
71
|
+
export declare const makeArray: <T>(value: T | T[]) => T[];
|
|
72
|
+
/**
|
|
73
|
+
* Check if a value is empty (nullable or empty string)
|
|
74
|
+
*/
|
|
75
|
+
export declare const isEmpty: (value: any) => boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Check if an object is an empty object
|
|
78
|
+
*/
|
|
79
|
+
export declare const isEmptyObject: (value: Record<string, any>) => boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Check if a value is an empty array
|
|
82
|
+
*/
|
|
83
|
+
export declare const isEmptyArray: (value: any) => boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Checks if a value is not empty (null, undefined, or empty string), not an empty object, and not an empty array
|
|
86
|
+
*/
|
|
87
|
+
export declare const hasValue: (value: any) => boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Returns a pluralized string based on the value
|
|
90
|
+
* @example getPlural(1, 'item') => '1 item'
|
|
91
|
+
* @example getPlural(4, 'item') => '4 items'
|
|
92
|
+
* @example getPlural(2, 'person', 'people') => '2 people'
|
|
93
|
+
* @example getPlural(0, 'item') => '0 items'
|
|
94
|
+
*/
|
|
95
|
+
export declare const getPlural: (value: number, singular: string, plural?: string | null) => string;
|
|
96
|
+
/**
|
|
97
|
+
* Escapes special characters in a search term to prevent them from being interpreted as regex operators
|
|
98
|
+
*/
|
|
99
|
+
export declare const sanitizeRegexString: (input: string) => string;
|
|
100
|
+
/**
|
|
101
|
+
* Converts a value to a plain object by serializing to and from JSON
|
|
102
|
+
*/
|
|
103
|
+
export declare const toPlainObject: (value: unknown) => Record<string, any>;
|
|
104
|
+
/**
|
|
105
|
+
* Converts a Booleanish value (boolean | 'true' | '1' | 'false' | '0') to a boolean
|
|
106
|
+
*/
|
|
107
|
+
export declare const booleanize: (value: Booleanish) => boolean;
|
|
108
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const validateChassisNumber: (value: string) => true | "Invalid Chassis Number";
|
|
2
|
-
export declare const validateVIN: (value: string) => true | "Invalid VIN format";
|
|
1
|
+
export declare const validateChassisNumber: (value: string) => true | "Invalid Chassis Number";
|
|
2
|
+
export declare const validateVIN: (value: string) => true | "Invalid VIN format";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from "./global-utils";
|
|
2
|
-
export * from "./global-constants";
|
|
3
|
-
export * from "./global_validators";
|
|
4
|
-
export * from "./formatCurrency";
|
|
1
|
+
export * from "./global-utils";
|
|
2
|
+
export * from "./global-constants";
|
|
3
|
+
export * from "./global_validators";
|
|
4
|
+
export * from "./formatCurrency";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
declare function flattenQuery(query: Record<string, any>): Record<string, any>;
|
|
1
|
+
declare function flattenQuery(query: Record<string, any>): Record<string, any>;
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { User } from "../../../models";
|
|
2
|
-
export declare class RegisterDTO {
|
|
3
|
-
email?: string;
|
|
4
|
-
password?: string;
|
|
5
|
-
name?: string;
|
|
6
|
-
phone?: string;
|
|
7
|
-
savedFavoriteVehicles?: string[];
|
|
8
|
-
static fromPlain(entity: any): RegisterDTO;
|
|
9
|
-
toPlain(): Record<string, unknown>;
|
|
10
|
-
validate?(): string[];
|
|
11
|
-
}
|
|
12
|
-
export declare class LoginDTO {
|
|
13
|
-
email: string;
|
|
14
|
-
password: string;
|
|
15
|
-
savedFavoriteVehicles?: string[];
|
|
16
|
-
static fromPlain(entity: any): LoginDTO;
|
|
17
|
-
toPlain(): Record<string, unknown>;
|
|
18
|
-
validate?(): string[];
|
|
19
|
-
}
|
|
20
|
-
export declare class OtpLoginDTO {
|
|
21
|
-
phone: string;
|
|
22
|
-
otp: string;
|
|
23
|
-
static fromPlain(entity: any): OtpLoginDTO;
|
|
24
|
-
toPlain(): Record<string, unknown>;
|
|
25
|
-
validate?(): string[];
|
|
26
|
-
}
|
|
27
|
-
export declare class AuthResponseDTO {
|
|
28
|
-
user: User;
|
|
29
|
-
token: string;
|
|
30
|
-
refreshToken?: string;
|
|
31
|
-
expiresAt?: number;
|
|
32
|
-
}
|
|
1
|
+
import { User } from "../../../models";
|
|
2
|
+
export declare class RegisterDTO {
|
|
3
|
+
email?: string;
|
|
4
|
+
password?: string;
|
|
5
|
+
name?: string;
|
|
6
|
+
phone?: string;
|
|
7
|
+
savedFavoriteVehicles?: string[];
|
|
8
|
+
static fromPlain(entity: any): RegisterDTO;
|
|
9
|
+
toPlain(): Record<string, unknown>;
|
|
10
|
+
validate?(): string[];
|
|
11
|
+
}
|
|
12
|
+
export declare class LoginDTO {
|
|
13
|
+
email: string;
|
|
14
|
+
password: string;
|
|
15
|
+
savedFavoriteVehicles?: string[];
|
|
16
|
+
static fromPlain(entity: any): LoginDTO;
|
|
17
|
+
toPlain(): Record<string, unknown>;
|
|
18
|
+
validate?(): string[];
|
|
19
|
+
}
|
|
20
|
+
export declare class OtpLoginDTO {
|
|
21
|
+
phone: string;
|
|
22
|
+
otp: string;
|
|
23
|
+
static fromPlain(entity: any): OtpLoginDTO;
|
|
24
|
+
toPlain(): Record<string, unknown>;
|
|
25
|
+
validate?(): string[];
|
|
26
|
+
}
|
|
27
|
+
export declare class AuthResponseDTO {
|
|
28
|
+
user: User;
|
|
29
|
+
token: string;
|
|
30
|
+
refreshToken?: string;
|
|
31
|
+
expiresAt?: number;
|
|
32
|
+
}
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import { User } from "../../../vehicle";
|
|
2
|
-
export declare class RoleGetDTO {
|
|
3
|
-
id: string;
|
|
4
|
-
name: string;
|
|
5
|
-
description?: string;
|
|
6
|
-
permissions: string[];
|
|
7
|
-
permissionsMap: Record<string, string[]>;
|
|
8
|
-
isActive: boolean;
|
|
9
|
-
createdAt: Date;
|
|
10
|
-
updatedAt: Date;
|
|
11
|
-
users?: User[];
|
|
12
|
-
static fromEntity(entity: any): RoleGetDTO;
|
|
13
|
-
toPlain(): Record<string, unknown>;
|
|
14
|
-
}
|
|
15
|
-
export declare class RoleCreateDTO {
|
|
16
|
-
name: string;
|
|
17
|
-
description?: string;
|
|
18
|
-
permissions: string[];
|
|
19
|
-
permissionsMap?: Record<string, string[]>;
|
|
20
|
-
isActive?: boolean;
|
|
21
|
-
validate(): string[];
|
|
22
|
-
static fromPlain(plain: Record<string, unknown>): RoleCreateDTO;
|
|
23
|
-
toPlain(): Record<string, unknown>;
|
|
24
|
-
}
|
|
25
|
-
export declare class RoleUpdateDTO {
|
|
26
|
-
name?: string;
|
|
27
|
-
description?: string;
|
|
28
|
-
permissions?: string[];
|
|
29
|
-
permissionsMap?: Record<string, string[]>;
|
|
30
|
-
isActive?: boolean;
|
|
31
|
-
validate(): string[];
|
|
32
|
-
static fromPlain(plain: Record<string, unknown>): RoleUpdateDTO;
|
|
33
|
-
toPlain(): Record<string, unknown>;
|
|
34
|
-
}
|
|
35
|
-
export declare class RolePermissionUpdateDTO {
|
|
36
|
-
permissions: string[];
|
|
37
|
-
permissionsMap?: Record<string, string[]>;
|
|
38
|
-
validate(): string[];
|
|
39
|
-
static fromPlain(plain: Record<string, unknown>): RolePermissionUpdateDTO;
|
|
40
|
-
toPlain(): Record<string, unknown>;
|
|
41
|
-
}
|
|
1
|
+
import { User } from "../../../vehicle";
|
|
2
|
+
export declare class RoleGetDTO {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
permissions: string[];
|
|
7
|
+
permissionsMap: Record<string, string[]>;
|
|
8
|
+
isActive: boolean;
|
|
9
|
+
createdAt: Date;
|
|
10
|
+
updatedAt: Date;
|
|
11
|
+
users?: User[];
|
|
12
|
+
static fromEntity(entity: any): RoleGetDTO;
|
|
13
|
+
toPlain(): Record<string, unknown>;
|
|
14
|
+
}
|
|
15
|
+
export declare class RoleCreateDTO {
|
|
16
|
+
name: string;
|
|
17
|
+
description?: string;
|
|
18
|
+
permissions: string[];
|
|
19
|
+
permissionsMap?: Record<string, string[]>;
|
|
20
|
+
isActive?: boolean;
|
|
21
|
+
validate(): string[];
|
|
22
|
+
static fromPlain(plain: Record<string, unknown>): RoleCreateDTO;
|
|
23
|
+
toPlain(): Record<string, unknown>;
|
|
24
|
+
}
|
|
25
|
+
export declare class RoleUpdateDTO {
|
|
26
|
+
name?: string;
|
|
27
|
+
description?: string;
|
|
28
|
+
permissions?: string[];
|
|
29
|
+
permissionsMap?: Record<string, string[]>;
|
|
30
|
+
isActive?: boolean;
|
|
31
|
+
validate(): string[];
|
|
32
|
+
static fromPlain(plain: Record<string, unknown>): RoleUpdateDTO;
|
|
33
|
+
toPlain(): Record<string, unknown>;
|
|
34
|
+
}
|
|
35
|
+
export declare class RolePermissionUpdateDTO {
|
|
36
|
+
permissions: string[];
|
|
37
|
+
permissionsMap?: Record<string, string[]>;
|
|
38
|
+
validate(): string[];
|
|
39
|
+
static fromPlain(plain: Record<string, unknown>): RolePermissionUpdateDTO;
|
|
40
|
+
toPlain(): Record<string, unknown>;
|
|
41
|
+
}
|