@alba-cars/common-modules 1.9.5 → 1.9.8
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/dist/core/network/endpoint-config.d.ts +9 -1
- package/dist/core/network/endpoint-config.js +12 -1
- package/dist/core/utils/global_validators.js +1 -1
- package/dist/features/google-review/data/dto/google_review_dto.d.ts +9 -0
- package/dist/features/google-review/data/dto/google_review_dto.js +62 -0
- package/dist/features/vehicle/data/dto/VehicleFilterDTO.d.ts +2 -0
- package/dist/features/vehicle/data/dto/VehicleFilterDTO.js +10 -0
- package/dist/features/vehicle/data/dto/VehicleMakeDTO.d.ts +2 -0
- package/dist/features/vehicle/data/dto/VehicleMakeDTO.js +10 -0
- package/dist/features/vehicle/data/utilities.d.ts +1 -0
- package/dist/features/vehicle/data/utilities.js +5 -0
- package/package.json +1 -1
|
@@ -9,6 +9,7 @@ interface BaseEndpoint {
|
|
|
9
9
|
interface VehicleEndpoints extends BaseEndpoint {
|
|
10
10
|
getSimilar: EndpointFunction;
|
|
11
11
|
getOneBySlug: EndpointFunction;
|
|
12
|
+
getOneByRef: EndpointFunction;
|
|
12
13
|
publishVehicle: EndpointFunction;
|
|
13
14
|
unpublishVehicle: EndpointFunction;
|
|
14
15
|
reserveVehicle: EndpointFunction;
|
|
@@ -37,12 +38,18 @@ type TicketEndpoints = BaseEndpoint & {
|
|
|
37
38
|
getUserTickets: EndpointFunction;
|
|
38
39
|
getAgentTickets: EndpointFunction;
|
|
39
40
|
};
|
|
41
|
+
type DealDriveEndpoints = BaseEndpoint & {
|
|
42
|
+
getAllMakes: EndpointFunction;
|
|
43
|
+
getAllModels: EndpointFunction;
|
|
44
|
+
};
|
|
40
45
|
type APIEndpointType = {
|
|
41
46
|
vehicle: VehicleEndpoints;
|
|
42
47
|
blogs: BlogEndpoints;
|
|
43
48
|
vehicleFinance: BaseEndpoint;
|
|
44
49
|
TestDrive: BaseEndpoint;
|
|
45
|
-
vehicleMake: BaseEndpoint
|
|
50
|
+
vehicleMake: BaseEndpoint & {
|
|
51
|
+
getOneBySlug: (slug: string) => string;
|
|
52
|
+
};
|
|
46
53
|
vehicleModel: BaseEndpoint;
|
|
47
54
|
vehicleMeta: MetaEndpoints;
|
|
48
55
|
vehicleInspection: BaseEndpoint;
|
|
@@ -64,6 +71,7 @@ type APIEndpointType = {
|
|
|
64
71
|
tickets: TicketEndpoints;
|
|
65
72
|
user: UserEndpoints;
|
|
66
73
|
faq: BaseEndpoint;
|
|
74
|
+
dealDrive: DealDriveEndpoints;
|
|
67
75
|
};
|
|
68
76
|
export declare const API_ENDPOINTS: APIEndpointType;
|
|
69
77
|
export declare const UTIL_ENDPOINTS: {
|
|
@@ -7,6 +7,7 @@ exports.API_ENDPOINTS = {
|
|
|
7
7
|
create: `/vehicle`,
|
|
8
8
|
getOne: (id) => `/vehicle/${id}`,
|
|
9
9
|
getOneBySlug: (slug) => `/vehicle/slug/${slug}`,
|
|
10
|
+
getOneByRef: (ref) => `/vehicle/ref/${ref}`,
|
|
10
11
|
getSimilar: (id) => `/vehicle/similar/${id}`,
|
|
11
12
|
deleteOne: (id) => `/vehicle/${id}`,
|
|
12
13
|
updateOne: (id) => `/vehicle/${id}`,
|
|
@@ -28,6 +29,7 @@ exports.API_ENDPOINTS = {
|
|
|
28
29
|
getAll: `/vehicle/makes`,
|
|
29
30
|
create: `/vehicle/makes`,
|
|
30
31
|
getOne: (id) => `/vehicle/makes/${id}`,
|
|
32
|
+
getOneBySlug: (slug) => `/vehicle/makes/slug/${slug}`,
|
|
31
33
|
deleteOne: (id) => `/vehicle/makes/${id}`,
|
|
32
34
|
updateOne: (id) => `/vehicle/makes/${id}`,
|
|
33
35
|
},
|
|
@@ -202,7 +204,16 @@ exports.API_ENDPOINTS = {
|
|
|
202
204
|
getOne: (id) => `/faqs/${id}`,
|
|
203
205
|
deleteOne: (id) => `/faqs/${id}`,
|
|
204
206
|
updateOne: (id) => `/faqs/${id}`,
|
|
205
|
-
}
|
|
207
|
+
},
|
|
208
|
+
dealDrive: {
|
|
209
|
+
getAll: `/deal-drive`,
|
|
210
|
+
create: `/deal-drive`,
|
|
211
|
+
getOne: (id) => `/deal-drive/${id}`,
|
|
212
|
+
deleteOne: (id) => `/deal-drive/${id}`,
|
|
213
|
+
updateOne: (id) => `/deal-drive/${id}`,
|
|
214
|
+
getAllMakes: (id) => `/deal-drive/brands`,
|
|
215
|
+
getAllModels: (id) => `/deal-drive/models`,
|
|
216
|
+
},
|
|
206
217
|
};
|
|
207
218
|
const utilRoutePrefix = "/utils";
|
|
208
219
|
exports.UTIL_ENDPOINTS = {
|
|
@@ -11,7 +11,7 @@ const validateChassisNumber = (value) => {
|
|
|
11
11
|
exports.validateChassisNumber = validateChassisNumber;
|
|
12
12
|
const validateVIN = (value) => {
|
|
13
13
|
// Regex to exclude I, O, Q and check for VIN's valid structure
|
|
14
|
-
const vinRegex = /^[A-HJ-NPR-Z0-9]{
|
|
14
|
+
const vinRegex = /^[A-HJ-NPR-Z0-9]{8}$/;
|
|
15
15
|
if (!vinRegex.test(value)) {
|
|
16
16
|
return "Invalid VIN format";
|
|
17
17
|
}
|
|
@@ -40,6 +40,15 @@ export declare class GoogleReviewResponseDTO {
|
|
|
40
40
|
}
|
|
41
41
|
export declare class ReviewGetDTO {
|
|
42
42
|
id: string;
|
|
43
|
+
placeId?: string;
|
|
44
|
+
platform?: ReviewPlatform;
|
|
45
|
+
comment?: string;
|
|
46
|
+
username?: string;
|
|
47
|
+
showPublic?: boolean;
|
|
48
|
+
minRating?: number;
|
|
49
|
+
maxRating?: number;
|
|
50
|
+
skip?: number;
|
|
51
|
+
take?: number;
|
|
43
52
|
filters?: ReviewFilter;
|
|
44
53
|
options?: ReviewOptions;
|
|
45
54
|
validate(): string[];
|
|
@@ -181,6 +181,68 @@ __decorate([
|
|
|
181
181
|
(0, class_validator_1.IsOptional)(),
|
|
182
182
|
__metadata("design:type", String)
|
|
183
183
|
], ReviewGetDTO.prototype, "id", void 0);
|
|
184
|
+
__decorate([
|
|
185
|
+
(0, class_validator_1.IsString)(),
|
|
186
|
+
(0, class_validator_1.IsOptional)(),
|
|
187
|
+
__metadata("design:type", String)
|
|
188
|
+
], ReviewGetDTO.prototype, "placeId", void 0);
|
|
189
|
+
__decorate([
|
|
190
|
+
(0, class_validator_1.IsEnum)(enums_1.ReviewPlatform),
|
|
191
|
+
(0, class_validator_1.IsOptional)(),
|
|
192
|
+
__metadata("design:type", String)
|
|
193
|
+
], ReviewGetDTO.prototype, "platform", void 0);
|
|
194
|
+
__decorate([
|
|
195
|
+
(0, class_validator_1.IsString)(),
|
|
196
|
+
(0, class_validator_1.IsOptional)(),
|
|
197
|
+
__metadata("design:type", String)
|
|
198
|
+
], ReviewGetDTO.prototype, "comment", void 0);
|
|
199
|
+
__decorate([
|
|
200
|
+
(0, class_validator_1.IsString)(),
|
|
201
|
+
(0, class_validator_1.IsOptional)(),
|
|
202
|
+
__metadata("design:type", String)
|
|
203
|
+
], ReviewGetDTO.prototype, "username", void 0);
|
|
204
|
+
__decorate([
|
|
205
|
+
(0, class_validator_1.IsBoolean)(),
|
|
206
|
+
(0, class_validator_1.IsOptional)(),
|
|
207
|
+
(0, class_transformer_1.Transform)(({ value }) => {
|
|
208
|
+
if (value === 'true')
|
|
209
|
+
return true;
|
|
210
|
+
if (value === 'false')
|
|
211
|
+
return false;
|
|
212
|
+
return value;
|
|
213
|
+
}),
|
|
214
|
+
__metadata("design:type", Boolean)
|
|
215
|
+
], ReviewGetDTO.prototype, "showPublic", void 0);
|
|
216
|
+
__decorate([
|
|
217
|
+
(0, class_validator_1.IsNumber)(),
|
|
218
|
+
(0, class_validator_1.IsOptional)(),
|
|
219
|
+
(0, class_validator_1.Min)(1),
|
|
220
|
+
(0, class_validator_1.Max)(5),
|
|
221
|
+
(0, class_transformer_1.Transform)(({ value }) => value ? Number(value) : undefined),
|
|
222
|
+
__metadata("design:type", Number)
|
|
223
|
+
], ReviewGetDTO.prototype, "minRating", void 0);
|
|
224
|
+
__decorate([
|
|
225
|
+
(0, class_validator_1.IsNumber)(),
|
|
226
|
+
(0, class_validator_1.IsOptional)(),
|
|
227
|
+
(0, class_validator_1.Min)(1),
|
|
228
|
+
(0, class_validator_1.Max)(5),
|
|
229
|
+
(0, class_transformer_1.Transform)(({ value }) => value ? Number(value) : undefined),
|
|
230
|
+
__metadata("design:type", Number)
|
|
231
|
+
], ReviewGetDTO.prototype, "maxRating", void 0);
|
|
232
|
+
__decorate([
|
|
233
|
+
(0, class_validator_1.IsNumber)(),
|
|
234
|
+
(0, class_validator_1.IsOptional)(),
|
|
235
|
+
(0, class_validator_1.Min)(0),
|
|
236
|
+
(0, class_transformer_1.Transform)(({ value }) => value ? Number(value) : undefined),
|
|
237
|
+
__metadata("design:type", Number)
|
|
238
|
+
], ReviewGetDTO.prototype, "skip", void 0);
|
|
239
|
+
__decorate([
|
|
240
|
+
(0, class_validator_1.IsNumber)(),
|
|
241
|
+
(0, class_validator_1.IsOptional)(),
|
|
242
|
+
(0, class_validator_1.Min)(1),
|
|
243
|
+
(0, class_transformer_1.Transform)(({ value }) => value ? Number(value) : undefined),
|
|
244
|
+
__metadata("design:type", Number)
|
|
245
|
+
], ReviewGetDTO.prototype, "take", void 0);
|
|
184
246
|
exports.ReviewGetDTO = ReviewGetDTO;
|
|
185
247
|
class ReviewFilter {
|
|
186
248
|
}
|
|
@@ -18,6 +18,7 @@ export declare class VehicleMakeFilter extends BaseFilter {
|
|
|
18
18
|
vehicles?: string | string[];
|
|
19
19
|
search?: string;
|
|
20
20
|
promoted?: boolean;
|
|
21
|
+
showInFooter?: boolean;
|
|
21
22
|
validate(): string[];
|
|
22
23
|
static fromPlain(plain: Record<string, unknown>): VehicleMakeFilter;
|
|
23
24
|
static toPlain(entity: any): Record<string, unknown>;
|
|
@@ -217,6 +218,7 @@ export declare class VehicleFilter extends BaseFilter {
|
|
|
217
218
|
export declare class VehicleUniqueFilter {
|
|
218
219
|
id?: string;
|
|
219
220
|
referenceNumber?: string;
|
|
221
|
+
refId?: string;
|
|
220
222
|
vin?: string;
|
|
221
223
|
chassisNumber?: string;
|
|
222
224
|
validate(): string[];
|
|
@@ -66,6 +66,11 @@ __decorate([
|
|
|
66
66
|
(0, class_validator_1.IsBoolean)(),
|
|
67
67
|
__metadata("design:type", Boolean)
|
|
68
68
|
], VehicleMakeFilter.prototype, "promoted", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, class_validator_1.IsOptional)(),
|
|
71
|
+
(0, class_validator_1.IsBoolean)(),
|
|
72
|
+
__metadata("design:type", Boolean)
|
|
73
|
+
], VehicleMakeFilter.prototype, "showInFooter", void 0);
|
|
69
74
|
exports.VehicleMakeFilter = VehicleMakeFilter;
|
|
70
75
|
// This filter is used to get a unique vehicle make by unique fields
|
|
71
76
|
class VehicleMakeUniqueFilter extends global_1.BaseFilter {
|
|
@@ -720,6 +725,11 @@ __decorate([
|
|
|
720
725
|
(0, class_validator_1.IsString)(),
|
|
721
726
|
__metadata("design:type", String)
|
|
722
727
|
], VehicleUniqueFilter.prototype, "referenceNumber", void 0);
|
|
728
|
+
__decorate([
|
|
729
|
+
(0, class_validator_1.IsOptional)(),
|
|
730
|
+
(0, class_validator_1.IsString)(),
|
|
731
|
+
__metadata("design:type", String)
|
|
732
|
+
], VehicleUniqueFilter.prototype, "refId", void 0);
|
|
723
733
|
__decorate([
|
|
724
734
|
(0, class_validator_1.IsOptional)(),
|
|
725
735
|
(0, class_validator_1.IsString)(),
|
|
@@ -24,6 +24,7 @@ export declare class VehicleMakeCreateDTO extends BaseCreateDTO {
|
|
|
24
24
|
metaDescription?: string;
|
|
25
25
|
metaKeywords?: string;
|
|
26
26
|
promoted?: boolean;
|
|
27
|
+
showInFooter?: boolean;
|
|
27
28
|
validate(): string[];
|
|
28
29
|
static fromPlain(plain: Record<string, unknown>): VehicleMakeCreateDTO;
|
|
29
30
|
static toPlain(entity: any): Record<string, unknown>;
|
|
@@ -36,6 +37,7 @@ export declare class VehicleMakeUpdateDTO extends BaseUpdateDTO {
|
|
|
36
37
|
metaDescription?: string;
|
|
37
38
|
metaKeywords?: string;
|
|
38
39
|
promoted?: boolean;
|
|
40
|
+
showInFooter?: boolean;
|
|
39
41
|
isActive?: boolean;
|
|
40
42
|
validate(): string[];
|
|
41
43
|
static fromPlain(plain: Record<string, unknown>): VehicleMakeUpdateDTO;
|
|
@@ -95,6 +95,11 @@ __decorate([
|
|
|
95
95
|
(0, class_validator_1.IsOptional)(),
|
|
96
96
|
__metadata("design:type", Boolean)
|
|
97
97
|
], VehicleMakeCreateDTO.prototype, "promoted", void 0);
|
|
98
|
+
__decorate([
|
|
99
|
+
(0, class_validator_1.IsBoolean)(),
|
|
100
|
+
(0, class_validator_1.IsOptional)(),
|
|
101
|
+
__metadata("design:type", Boolean)
|
|
102
|
+
], VehicleMakeCreateDTO.prototype, "showInFooter", void 0);
|
|
98
103
|
exports.VehicleMakeCreateDTO = VehicleMakeCreateDTO;
|
|
99
104
|
class VehicleMakeUpdateDTO extends BaseDTO_1.BaseUpdateDTO {
|
|
100
105
|
validate() {
|
|
@@ -146,6 +151,11 @@ __decorate([
|
|
|
146
151
|
(0, class_validator_1.IsOptional)(),
|
|
147
152
|
__metadata("design:type", Boolean)
|
|
148
153
|
], VehicleMakeUpdateDTO.prototype, "promoted", void 0);
|
|
154
|
+
__decorate([
|
|
155
|
+
(0, class_validator_1.IsBoolean)(),
|
|
156
|
+
(0, class_validator_1.IsOptional)(),
|
|
157
|
+
__metadata("design:type", Boolean)
|
|
158
|
+
], VehicleMakeUpdateDTO.prototype, "showInFooter", void 0);
|
|
149
159
|
__decorate([
|
|
150
160
|
(0, class_validator_1.IsBoolean)(),
|
|
151
161
|
(0, class_validator_1.IsOptional)(),
|
|
@@ -23,6 +23,7 @@ export declare class VehicleMakeFilter extends BaseFilter {
|
|
|
23
23
|
vehicles?: string | string[];
|
|
24
24
|
search?: string;
|
|
25
25
|
promoted?: boolean;
|
|
26
|
+
showInFooter?: boolean;
|
|
26
27
|
validate(): string[];
|
|
27
28
|
static fromPlain(plain: Record<string, unknown>): VehicleMakeFilter;
|
|
28
29
|
static toPlain(entity: any): Record<string, unknown>;
|
|
@@ -65,6 +65,11 @@ __decorate([
|
|
|
65
65
|
(0, class_validator_1.IsBoolean)(),
|
|
66
66
|
__metadata("design:type", Boolean)
|
|
67
67
|
], VehicleMakeFilter.prototype, "promoted", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, class_validator_1.IsOptional)(),
|
|
70
|
+
(0, class_validator_1.IsBoolean)(),
|
|
71
|
+
__metadata("design:type", Boolean)
|
|
72
|
+
], VehicleMakeFilter.prototype, "showInFooter", void 0);
|
|
68
73
|
exports.VehicleMakeFilter = VehicleMakeFilter;
|
|
69
74
|
// This filter is used to get a unique vehicle make by unique fields
|
|
70
75
|
class VehicleMakeUniqueFilter extends utilities_1.BaseFilter {
|
package/package.json
CHANGED