@hosterai/types 0.0.21 → 0.0.23
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 +29 -2
- package/dist/dtos/field.dto.d.ts +8 -4
- package/dist/dtos/field.dto.js +17 -7
- package/dist/dtos/info/info-notification.dto.d.ts +5 -0
- package/dist/dtos/info/info-notification.dto.js +7 -0
- package/dist/dtos/info/info.dto.d.ts +196 -0
- package/dist/dtos/info/info.dto.js +278 -0
- package/dist/dtos/info.dto.d.ts +2 -0
- package/dist/dtos/info.dto.js +17 -0
- package/dist/dtos/notification/notification-info.dto.js +7 -3
- package/dist/dtos/notification/notification-request.dto.d.ts +20 -0
- package/dist/dtos/notification/notification-request.dto.js +31 -0
- package/dist/dtos/product/product.interface.d.ts +4 -4
- package/dist/dtos/receiver/receiver-email.dto.d.ts +20 -0
- package/dist/dtos/receiver/receiver-email.dto.js +39 -0
- package/dist/dtos/receiver/receiver-push.dto.d.ts +15 -0
- package/dist/dtos/receiver/receiver-push.dto.js +31 -0
- package/dist/dtos/receiver/receiver-sms.dto.d.ts +11 -0
- package/dist/dtos/receiver/receiver-sms.dto.js +26 -0
- package/dist/dtos/request.dto.d.ts +20 -0
- package/dist/dtos/request.dto.js +31 -0
- package/dist/dtos/requests/validate-attributes-request.dto.d.ts +18 -0
- package/dist/dtos/{product/requests/product-upgradeable-request.dto.js → requests/validate-attributes-request.dto.js} +11 -17
- package/dist/dtos/responses/validate-attributes-response.dto.d.ts +13 -0
- package/dist/dtos/responses/validate-attributes-response.dto.js +11 -0
- package/dist/dtos/sender/sender-email.dto.d.ts +25 -0
- package/dist/dtos/sender/sender-email.dto.js +46 -0
- package/dist/dtos/sender/sender-push.dto.d.ts +31 -0
- package/dist/dtos/sender/sender-push.dto.js +50 -0
- package/dist/dtos/sender/sender-sms.dto.d.ts +15 -0
- package/dist/dtos/sender/sender-sms.dto.js +30 -0
- package/dist/enums/actions.enum.d.ts +1 -0
- package/dist/enums/actions.enum.js +1 -0
- package/dist/enums/message-type.enum.d.ts +5 -0
- package/dist/enums/message-type.enum.js +9 -0
- package/dist/index.d.ts +2 -4
- package/dist/index.js +4 -4
- package/dist/openapi/schemas/components.schemas.d.ts +166 -221
- package/dist/openapi/schemas/components.schemas.js +549 -600
- package/dist/validators/field-validator.spec.js +11 -10
- package/dist/validators/product-info-validator.spec.js +18 -13
- package/dist/validators/product-validate-attributes-request-validator.d.ts +1 -1
- package/dist/validators/product-validate-attributes-request-validator.js +5 -5
- package/dist/validators/product-validate-attributes-request-validator.spec.js +3 -3
- package/package.json +1 -1
- package/dist/dtos/product/requests/product-downgradeable-request.dto.d.ts +0 -18
- package/dist/dtos/product/requests/product-downgradeable-request.dto.js +0 -37
- package/dist/dtos/product/requests/product-upgradeable-request.dto.d.ts +0 -18
- package/dist/dtos/product/responses/product-downgradeable-response.dto.d.ts +0 -22
- package/dist/dtos/product/responses/product-downgradeable-response.dto.js +0 -11
- package/dist/dtos/product/responses/product-upgradeable-response.dto.d.ts +0 -22
- package/dist/dtos/product/responses/product-upgradeable-response.dto.js +0 -11
- package/dist/validators/product-downgradeable-request-validator.d.ts +0 -8
- package/dist/validators/product-downgradeable-request-validator.js +0 -17
- package/dist/validators/product-upgradeable-request-validator.d.ts +0 -8
- package/dist/validators/product-upgradeable-request-validator.js +0 -17
|
@@ -11,7 +11,8 @@ const baseValidDto = {
|
|
|
11
11
|
type: field_type_enum_1.FieldTypeEnum.TEXT_BOX,
|
|
12
12
|
required: true,
|
|
13
13
|
disabled: false,
|
|
14
|
-
|
|
14
|
+
visibleInOrder: false,
|
|
15
|
+
visibleInClientPanel: false,
|
|
15
16
|
upgradable: false,
|
|
16
17
|
};
|
|
17
18
|
describe('FieldDto Validator', () => {
|
|
@@ -31,7 +32,7 @@ describe('FieldDto Validator', () => {
|
|
|
31
32
|
describe('Missing required fields', () => {
|
|
32
33
|
it('should return errors for all missing required fields (except upgradable)', () => {
|
|
33
34
|
const errors = (0, field_validator_1.validateFieldDto)({});
|
|
34
|
-
const requiredProps = ['id', 'label', 'value', 'type', 'required', 'disabled', '
|
|
35
|
+
const requiredProps = ['id', 'label', 'value', 'type', 'required', 'disabled', 'visibleInOrder', 'visibleInClientPanel'];
|
|
35
36
|
for (const prop of requiredProps) {
|
|
36
37
|
expect(errors.some(e => e.property === prop)).toBe(true);
|
|
37
38
|
}
|
|
@@ -74,26 +75,26 @@ describe('FieldDto Validator', () => {
|
|
|
74
75
|
});
|
|
75
76
|
});
|
|
76
77
|
describe('Repeatable constraints (AllOrNone and Min<=Max)', () => {
|
|
77
|
-
it('should fail when only
|
|
78
|
-
const dto = { ...baseValidDto,
|
|
78
|
+
it('should fail when only repeatableMin is present', () => {
|
|
79
|
+
const dto = { ...baseValidDto, repeatableMin: 1 };
|
|
79
80
|
const errors = (0, field_validator_1.validateFieldDto)(dto);
|
|
80
81
|
expect(errors.length).toBeGreaterThan(0);
|
|
81
82
|
// Class-level error; ensure at least one constraint exists
|
|
82
83
|
expect(errors.some(e => e.constraints && (e.constraints['AllOrNone'] || Object.values(e.constraints).some(msg => msg.includes('All of'))))).toBe(true);
|
|
83
84
|
});
|
|
84
|
-
it('should fail when only
|
|
85
|
-
const dto = { ...baseValidDto,
|
|
85
|
+
it('should fail when only repeatableMax is present', () => {
|
|
86
|
+
const dto = { ...baseValidDto, repeatableMax: 2 };
|
|
86
87
|
const errors = (0, field_validator_1.validateFieldDto)(dto);
|
|
87
88
|
expect(errors.length).toBeGreaterThan(0);
|
|
88
89
|
expect(errors.some(e => e.constraints && (e.constraints['AllOrNone'] || Object.values(e.constraints).some(msg => msg.includes('All of'))))).toBe(true);
|
|
89
90
|
});
|
|
90
|
-
it('should pass when both present and
|
|
91
|
-
const dto = { ...baseValidDto,
|
|
91
|
+
it('should pass when both present and repeatableMin <= repeatableMax', () => {
|
|
92
|
+
const dto = { ...baseValidDto, repeatableMin: 1, repeatableMax: 2 };
|
|
92
93
|
const errors = (0, field_validator_1.validateFieldDto)(dto);
|
|
93
94
|
expect(errors).toHaveLength(0);
|
|
94
95
|
});
|
|
95
|
-
it('should fail when both present and
|
|
96
|
-
const dto = { ...baseValidDto,
|
|
96
|
+
it('should fail when both present and repeatableMin > repeatableMax', () => {
|
|
97
|
+
const dto = { ...baseValidDto, repeatableMin: 3, repeatableMax: 2 };
|
|
97
98
|
const errors = (0, field_validator_1.validateFieldDto)(dto);
|
|
98
99
|
expect(errors.length).toBeGreaterThan(0);
|
|
99
100
|
expect(errors.some(e => e.constraints && (e.constraints['MinLessOrEqualMax'] || Object.values(e.constraints).some(msg => msg.includes('must be less than or equal'))))).toBe(true);
|
|
@@ -14,7 +14,8 @@ describe('ProductInfoDto Validator', () => {
|
|
|
14
14
|
type: field_type_enum_1.FieldTypeEnum.TEXT_BOX,
|
|
15
15
|
required: false,
|
|
16
16
|
disabled: false,
|
|
17
|
-
|
|
17
|
+
visibleInOrder: false,
|
|
18
|
+
visibleInClientPanel: true,
|
|
18
19
|
upgradable: false
|
|
19
20
|
};
|
|
20
21
|
const invalidField = {
|
|
@@ -170,7 +171,7 @@ describe('ProductInfoDto Validator', () => {
|
|
|
170
171
|
});
|
|
171
172
|
});
|
|
172
173
|
describe('FieldDto class-level constraints inside ProductInfoDto', () => {
|
|
173
|
-
it('fails when a FieldDto has only
|
|
174
|
+
it('fails when a FieldDto has only repeatableMin (AllOrNone)', () => {
|
|
174
175
|
const fieldWithOnlyMin = {
|
|
175
176
|
id: 'f1',
|
|
176
177
|
label: [{ language: language_enum_1.LanguageEnum.EN, text: 'label' }],
|
|
@@ -178,9 +179,10 @@ describe('ProductInfoDto Validator', () => {
|
|
|
178
179
|
type: field_type_enum_1.FieldTypeEnum.TEXT_BOX,
|
|
179
180
|
required: false,
|
|
180
181
|
disabled: false,
|
|
181
|
-
|
|
182
|
+
visibleInOrder: false,
|
|
183
|
+
visibleInClientPanel: true,
|
|
182
184
|
upgradable: false,
|
|
183
|
-
|
|
185
|
+
repeatableMin: 1,
|
|
184
186
|
};
|
|
185
187
|
const dto = {
|
|
186
188
|
title: 'Test',
|
|
@@ -191,7 +193,7 @@ describe('ProductInfoDto Validator', () => {
|
|
|
191
193
|
const errors = (0, product_info_validator_1.validateProductInfoDto)(dto);
|
|
192
194
|
expect(errors.length).toBeGreaterThan(0);
|
|
193
195
|
});
|
|
194
|
-
it('fails when a FieldDto has only
|
|
196
|
+
it('fails when a FieldDto has only repeatableMax (AllOrNone)', () => {
|
|
195
197
|
const fieldWithOnlyMax = {
|
|
196
198
|
id: 'f2',
|
|
197
199
|
label: [{ language: language_enum_1.LanguageEnum.EN, text: 'label' }],
|
|
@@ -199,9 +201,10 @@ describe('ProductInfoDto Validator', () => {
|
|
|
199
201
|
type: field_type_enum_1.FieldTypeEnum.TEXT_BOX,
|
|
200
202
|
required: false,
|
|
201
203
|
disabled: false,
|
|
202
|
-
|
|
204
|
+
visibleInOrder: false,
|
|
205
|
+
visibleInClientPanel: true,
|
|
203
206
|
upgradable: false,
|
|
204
|
-
|
|
207
|
+
repeatableMax: 2,
|
|
205
208
|
};
|
|
206
209
|
const dto = {
|
|
207
210
|
title: 'Test',
|
|
@@ -220,10 +223,11 @@ describe('ProductInfoDto Validator', () => {
|
|
|
220
223
|
type: field_type_enum_1.FieldTypeEnum.TEXT_BOX,
|
|
221
224
|
required: false,
|
|
222
225
|
disabled: false,
|
|
223
|
-
|
|
226
|
+
visibleInOrder: false,
|
|
227
|
+
visibleInClientPanel: true,
|
|
224
228
|
upgradable: false,
|
|
225
|
-
|
|
226
|
-
|
|
229
|
+
repeatableMin: 1,
|
|
230
|
+
repeatableMax: 2,
|
|
227
231
|
};
|
|
228
232
|
const dto = {
|
|
229
233
|
title: 'Test',
|
|
@@ -241,10 +245,11 @@ describe('ProductInfoDto Validator', () => {
|
|
|
241
245
|
type: field_type_enum_1.FieldTypeEnum.TEXT_BOX,
|
|
242
246
|
required: false,
|
|
243
247
|
disabled: false,
|
|
244
|
-
|
|
248
|
+
visibleInOrder: false,
|
|
249
|
+
visibleInClientPanel: true,
|
|
245
250
|
upgradable: false,
|
|
246
|
-
|
|
247
|
-
|
|
251
|
+
repeatableMin: 5,
|
|
252
|
+
repeatableMax: 2,
|
|
248
253
|
};
|
|
249
254
|
const dto = {
|
|
250
255
|
title: 'Test',
|
|
@@ -5,4 +5,4 @@ import { ValidationError } from 'class-validator';
|
|
|
5
5
|
* @param {Record<string, unknown>} plainObject - The plain object to validate.
|
|
6
6
|
* @returns {Promise<ValidationError[]>} - A promise that resolves with an array of validation errors.
|
|
7
7
|
*/
|
|
8
|
-
export declare const
|
|
8
|
+
export declare const validateValidateAttributesRequestDto: (plainObject: Record<string, unknown>) => Promise<ValidationError[]>;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.validateValidateAttributesRequestDto = void 0;
|
|
4
4
|
const class_validator_1 = require("class-validator");
|
|
5
5
|
const class_transformer_1 = require("class-transformer");
|
|
6
|
-
const
|
|
6
|
+
const validate_attributes_request_dto_1 = require("../dtos/requests/validate-attributes-request.dto");
|
|
7
7
|
/**
|
|
8
8
|
* Validates a product validate attributes request object.
|
|
9
9
|
*
|
|
10
10
|
* @param {Record<string, unknown>} plainObject - The plain object to validate.
|
|
11
11
|
* @returns {Promise<ValidationError[]>} - A promise that resolves with an array of validation errors.
|
|
12
12
|
*/
|
|
13
|
-
const
|
|
14
|
-
const request = (0, class_transformer_1.plainToInstance)(
|
|
13
|
+
const validateValidateAttributesRequestDto = async (plainObject) => {
|
|
14
|
+
const request = (0, class_transformer_1.plainToInstance)(validate_attributes_request_dto_1.ValidateAttributesRequestDto, plainObject);
|
|
15
15
|
return await (0, class_validator_1.validate)(request);
|
|
16
16
|
};
|
|
17
|
-
exports.
|
|
17
|
+
exports.validateValidateAttributesRequestDto = validateValidateAttributesRequestDto;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
require("reflect-metadata");
|
|
4
4
|
const product_validate_attributes_request_validator_1 = require("./product-validate-attributes-request-validator");
|
|
5
|
-
describe('
|
|
5
|
+
describe('validateValidateAttributesRequestDto', () => {
|
|
6
6
|
it('should return no errors for a valid request', async () => {
|
|
7
7
|
const validRequest = {
|
|
8
8
|
triggeredByKey: 'some-key',
|
|
@@ -11,7 +11,7 @@ describe('validateProductValidateAttributesRequestDto', () => {
|
|
|
11
11
|
attribute2: 123,
|
|
12
12
|
},
|
|
13
13
|
};
|
|
14
|
-
const errors = await (0, product_validate_attributes_request_validator_1.
|
|
14
|
+
const errors = await (0, product_validate_attributes_request_validator_1.validateValidateAttributesRequestDto)(validRequest);
|
|
15
15
|
expect(errors.length).toBe(0);
|
|
16
16
|
});
|
|
17
17
|
it('should return errors for an invalid request', async () => {
|
|
@@ -21,7 +21,7 @@ describe('validateProductValidateAttributesRequestDto', () => {
|
|
|
21
21
|
attribute2: 123,
|
|
22
22
|
},
|
|
23
23
|
};
|
|
24
|
-
const errors = await (0, product_validate_attributes_request_validator_1.
|
|
24
|
+
const errors = await (0, product_validate_attributes_request_validator_1.validateValidateAttributesRequestDto)(invalidRequest);
|
|
25
25
|
expect(errors.length).toBeGreaterThan(0);
|
|
26
26
|
});
|
|
27
27
|
});
|
package/package.json
CHANGED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ProductItemDataDto } from '../product-item-data.dto';
|
|
2
|
-
import { ClientDataDto } from '../../client-data.dto';
|
|
3
|
-
/**
|
|
4
|
-
* Represents a request to check if a product item is downgradable.
|
|
5
|
-
* This DTO contains all the necessary information for the check.
|
|
6
|
-
*/
|
|
7
|
-
export declare class ProductDowngradableRequestDto {
|
|
8
|
-
/**
|
|
9
|
-
* The client's data.
|
|
10
|
-
* This object holds all the relevant information about the client initiating the request.
|
|
11
|
-
*/
|
|
12
|
-
clientData: ClientDataDto;
|
|
13
|
-
/**
|
|
14
|
-
* The data of the product item to be checked.
|
|
15
|
-
* This object contains the specific details of the product instance being evaluated.
|
|
16
|
-
*/
|
|
17
|
-
itemData: ProductItemDataDto;
|
|
18
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.ProductDowngradableRequestDto = void 0;
|
|
13
|
-
const class_validator_1 = require("class-validator");
|
|
14
|
-
const class_transformer_1 = require("class-transformer");
|
|
15
|
-
const product_item_data_dto_1 = require("../product-item-data.dto");
|
|
16
|
-
const client_data_dto_1 = require("../../client-data.dto");
|
|
17
|
-
/**
|
|
18
|
-
* Represents a request to check if a product item is downgradable.
|
|
19
|
-
* This DTO contains all the necessary information for the check.
|
|
20
|
-
*/
|
|
21
|
-
class ProductDowngradableRequestDto {
|
|
22
|
-
}
|
|
23
|
-
exports.ProductDowngradableRequestDto = ProductDowngradableRequestDto;
|
|
24
|
-
__decorate([
|
|
25
|
-
(0, class_validator_1.IsDefined)(),
|
|
26
|
-
(0, class_validator_1.IsObject)(),
|
|
27
|
-
(0, class_validator_1.ValidateNested)(),
|
|
28
|
-
(0, class_transformer_1.Type)(() => client_data_dto_1.ClientDataDto),
|
|
29
|
-
__metadata("design:type", client_data_dto_1.ClientDataDto)
|
|
30
|
-
], ProductDowngradableRequestDto.prototype, "clientData", void 0);
|
|
31
|
-
__decorate([
|
|
32
|
-
(0, class_validator_1.IsDefined)(),
|
|
33
|
-
(0, class_validator_1.IsObject)(),
|
|
34
|
-
(0, class_validator_1.ValidateNested)(),
|
|
35
|
-
(0, class_transformer_1.Type)(() => product_item_data_dto_1.ProductItemDataDto),
|
|
36
|
-
__metadata("design:type", product_item_data_dto_1.ProductItemDataDto)
|
|
37
|
-
], ProductDowngradableRequestDto.prototype, "itemData", void 0);
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ProductItemDataDto } from '../product-item-data.dto';
|
|
2
|
-
import { ClientDataDto } from '../../client-data.dto';
|
|
3
|
-
/**
|
|
4
|
-
* Represents a request to check if a product item is upgradeable.
|
|
5
|
-
* This DTO contains all the necessary information for the check.
|
|
6
|
-
*/
|
|
7
|
-
export declare class ProductUpgradeableRequestDto {
|
|
8
|
-
/**
|
|
9
|
-
* The client's data.
|
|
10
|
-
* This object holds all the relevant information about the client initiating the request.
|
|
11
|
-
*/
|
|
12
|
-
clientData: ClientDataDto;
|
|
13
|
-
/**
|
|
14
|
-
* The data of the product item to be checked.
|
|
15
|
-
* This object contains the specific details of the product instance being evaluated.
|
|
16
|
-
*/
|
|
17
|
-
itemData: ProductItemDataDto;
|
|
18
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { ResponseStatusEnum } from '../../../enums/response-status.enum';
|
|
2
|
-
import { BaseResponse } from '../../base-response.dto';
|
|
3
|
-
/**
|
|
4
|
-
* Represents the response for a product downgradeable check.
|
|
5
|
-
* It indicates whether a product item is downgradeable and may contain additional data.
|
|
6
|
-
*/
|
|
7
|
-
export declare class ProductDowngradeableResponseDto extends BaseResponse {
|
|
8
|
-
/**
|
|
9
|
-
* The status of the response, indicating success or failure.
|
|
10
|
-
*/
|
|
11
|
-
status: ResponseStatusEnum;
|
|
12
|
-
/**
|
|
13
|
-
* The unique identifier of the product item being checked.
|
|
14
|
-
*/
|
|
15
|
-
itemId: string;
|
|
16
|
-
/**
|
|
17
|
-
* Optional data associated with the downgradeable check.
|
|
18
|
-
* Can contain details about available downgrades or reasons for failure.
|
|
19
|
-
* @optional
|
|
20
|
-
*/
|
|
21
|
-
data?: Record<string, unknown>;
|
|
22
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ProductDowngradeableResponseDto = void 0;
|
|
4
|
-
const base_response_dto_1 = require("../../base-response.dto");
|
|
5
|
-
/**
|
|
6
|
-
* Represents the response for a product downgradeable check.
|
|
7
|
-
* It indicates whether a product item is downgradeable and may contain additional data.
|
|
8
|
-
*/
|
|
9
|
-
class ProductDowngradeableResponseDto extends base_response_dto_1.BaseResponse {
|
|
10
|
-
}
|
|
11
|
-
exports.ProductDowngradeableResponseDto = ProductDowngradeableResponseDto;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { ResponseStatusEnum } from '../../../enums/response-status.enum';
|
|
2
|
-
import { BaseResponse } from '../../base-response.dto';
|
|
3
|
-
/**
|
|
4
|
-
* Represents the response for a product upgradeable check.
|
|
5
|
-
* It indicates whether a product item is upgradeable and may contain additional data.
|
|
6
|
-
*/
|
|
7
|
-
export declare class ProductUpgradeableResponseDto extends BaseResponse {
|
|
8
|
-
/**
|
|
9
|
-
* The status of the response, indicating success or failure.
|
|
10
|
-
*/
|
|
11
|
-
status: ResponseStatusEnum;
|
|
12
|
-
/**
|
|
13
|
-
* The unique identifier of the product item being checked.
|
|
14
|
-
*/
|
|
15
|
-
itemId: string;
|
|
16
|
-
/**
|
|
17
|
-
* Optional data associated with the upgradeable check.
|
|
18
|
-
* Can contain details about available upgrades or reasons for failure.
|
|
19
|
-
* @optional
|
|
20
|
-
*/
|
|
21
|
-
data?: Record<string, unknown>;
|
|
22
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ProductUpgradeableResponseDto = void 0;
|
|
4
|
-
const base_response_dto_1 = require("../../base-response.dto");
|
|
5
|
-
/**
|
|
6
|
-
* Represents the response for a product upgradeable check.
|
|
7
|
-
* It indicates whether a product item is upgradeable and may contain additional data.
|
|
8
|
-
*/
|
|
9
|
-
class ProductUpgradeableResponseDto extends base_response_dto_1.BaseResponse {
|
|
10
|
-
}
|
|
11
|
-
exports.ProductUpgradeableResponseDto = ProductUpgradeableResponseDto;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ValidationError } from 'class-validator';
|
|
2
|
-
/**
|
|
3
|
-
* Validates a product downgradable request object.
|
|
4
|
-
*
|
|
5
|
-
* @param {Record<string, unknown>} plainObject - The plain object to validate.
|
|
6
|
-
* @returns {Promise<ValidationError[]>} - A promise that resolves with an array of validation errors.
|
|
7
|
-
*/
|
|
8
|
-
export declare const validateProductDowngradableRequestDto: (plainObject: Record<string, unknown>) => Promise<ValidationError[]>;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateProductDowngradableRequestDto = void 0;
|
|
4
|
-
const class_validator_1 = require("class-validator");
|
|
5
|
-
const class_transformer_1 = require("class-transformer");
|
|
6
|
-
const product_downgradable_request_dto_1 = require("../dtos/product/requests/product-downgradable-request.dto");
|
|
7
|
-
/**
|
|
8
|
-
* Validates a product downgradable request object.
|
|
9
|
-
*
|
|
10
|
-
* @param {Record<string, unknown>} plainObject - The plain object to validate.
|
|
11
|
-
* @returns {Promise<ValidationError[]>} - A promise that resolves with an array of validation errors.
|
|
12
|
-
*/
|
|
13
|
-
const validateProductDowngradableRequestDto = async (plainObject) => {
|
|
14
|
-
const request = (0, class_transformer_1.plainToInstance)(product_downgradable_request_dto_1.ProductDowngradableRequestDto, plainObject);
|
|
15
|
-
return await (0, class_validator_1.validate)(request);
|
|
16
|
-
};
|
|
17
|
-
exports.validateProductDowngradableRequestDto = validateProductDowngradableRequestDto;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ValidationError } from 'class-validator';
|
|
2
|
-
/**
|
|
3
|
-
* Validates a product upgradeable request object.
|
|
4
|
-
*
|
|
5
|
-
* @param {Record<string, unknown>} plainObject - The plain object to validate.
|
|
6
|
-
* @returns {Promise<ValidationError[]>} - A promise that resolves with an array of validation errors.
|
|
7
|
-
*/
|
|
8
|
-
export declare const validateProductUpgradeableRequestDto: (plainObject: Record<string, unknown>) => Promise<ValidationError[]>;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateProductUpgradeableRequestDto = void 0;
|
|
4
|
-
const class_validator_1 = require("class-validator");
|
|
5
|
-
const class_transformer_1 = require("class-transformer");
|
|
6
|
-
const product_upgradeable_request_dto_1 = require("../dtos/product/requests/product-upgradeable-request.dto");
|
|
7
|
-
/**
|
|
8
|
-
* Validates a product upgradeable request object.
|
|
9
|
-
*
|
|
10
|
-
* @param {Record<string, unknown>} plainObject - The plain object to validate.
|
|
11
|
-
* @returns {Promise<ValidationError[]>} - A promise that resolves with an array of validation errors.
|
|
12
|
-
*/
|
|
13
|
-
const validateProductUpgradeableRequestDto = async (plainObject) => {
|
|
14
|
-
const request = (0, class_transformer_1.plainToInstance)(product_upgradeable_request_dto_1.ProductUpgradeableRequestDto, plainObject);
|
|
15
|
-
return await (0, class_validator_1.validate)(request);
|
|
16
|
-
};
|
|
17
|
-
exports.validateProductUpgradeableRequestDto = validateProductUpgradeableRequestDto;
|