@hosterai/types 0.0.13 → 0.0.15
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 +8 -1
- package/dist/dtos/field-option.dto.d.ts +19 -0
- package/dist/dtos/field-option.dto.js +42 -0
- package/dist/dtos/field.dto.d.ts +16 -8
- package/dist/dtos/field.dto.js +10 -4
- package/dist/dtos/info.dto.d.ts +2 -2
- package/dist/dtos/product/product.interface.d.ts +9 -11
- package/dist/dtos/product/requests/item-validate-attributes-request.dto.d.ts +23 -0
- package/dist/dtos/product/requests/item-validate-attributes-request.dto.js +39 -0
- package/dist/dtos/product/requests/product-downgradable-request.dto.d.ts +18 -0
- package/dist/dtos/product/requests/product-downgradable-request.dto.js +37 -0
- package/dist/dtos/product/requests/product-upgradable-request.dto.d.ts +18 -0
- package/dist/dtos/product/requests/product-upgradable-request.dto.js +37 -0
- package/dist/dtos/product/requests/product-validate-attributes-request.dto.d.ts +1 -1
- package/dist/dtos/product/requests/product-validate-attributes-request.dto.js +1 -1
- package/dist/dtos/product/responses/item-validate-attributes-response.dto.d.ts +13 -0
- package/dist/dtos/product/responses/item-validate-attributes-response.dto.js +11 -0
- package/dist/dtos/product/responses/product-downgradable-response.dto.d.ts +22 -0
- package/dist/dtos/product/responses/product-downgradable-response.dto.js +11 -0
- package/dist/dtos/product/responses/product-upgradable-response.dto.d.ts +22 -0
- package/dist/dtos/product/responses/product-upgradable-response.dto.js +11 -0
- package/dist/enums/actions.enum.d.ts +8 -8
- package/dist/enums/actions.enum.js +11 -11
- package/dist/enums/events.enum.d.ts +9 -8
- package/dist/enums/events.enum.js +9 -8
- package/dist/index.d.ts +9 -6
- package/dist/index.js +9 -6
- package/dist/validators/product-downgradable-request-validator.d.ts +8 -0
- package/dist/validators/product-downgradable-request-validator.js +17 -0
- package/dist/validators/product-downgradeable-request-validator.js +2 -2
- package/dist/validators/product-upgradable-request-validator.d.ts +8 -0
- package/dist/validators/product-upgradable-request-validator.js +17 -0
- package/package.json +7 -3
package/README.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @hosterai/types
|
|
2
2
|
|
|
3
|
+
This package contains the core types for the Hoster AI platform.
|
|
4
|
+
|
|
5
|
+
## Files
|
|
6
|
+
|
|
7
|
+
- `llm.txt`: Contains a list of large language models.
|
|
8
|
+
|
|
3
9
|
[](https://www.npmjs.com/package/@hosterai/types)
|
|
4
10
|
[](https://www.npmjs.com/package/@hosterai/types)
|
|
5
11
|
[](https://github.com/HosterAI/types/actions/workflows/ci.yml)
|
|
@@ -36,6 +42,7 @@ DTOs define the shape of data that is exchanged between different parts of the s
|
|
|
36
42
|
- `company-data.dto.ts`: Holds all the relevant data for a company.
|
|
37
43
|
- `error-response.dto.ts`: Defines the structure for error responses.
|
|
38
44
|
- `field.dto.ts`: Represents a generic field for forms or dynamic data.
|
|
45
|
+
- `field-option.dto.ts`: Represents options for form fields (used for checkboxes, radioboxes, and selects).
|
|
39
46
|
- `info.dto.ts`: Contains all necessary information for a service integration.
|
|
40
47
|
- `jwt.dto.ts`: DTOs related to JSON Web Tokens.
|
|
41
48
|
- `menu.dto.ts`: Defines the structure for menu items.
|
|
@@ -72,7 +79,7 @@ Enums provide a set of named constants for common types, preventing errors with
|
|
|
72
79
|
|
|
73
80
|
**Key Enums:**
|
|
74
81
|
|
|
75
|
-
- `
|
|
82
|
+
- `ProductActionsEnum`: Defines possible actions.
|
|
76
83
|
- `CountryEnum`: A list of all countries.
|
|
77
84
|
- `DurationEnum`: Defines billing durations (e.g., `MONTHLY`, `YEARLY`).
|
|
78
85
|
- `EventsEnum`: Defines triggerable events.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Data Transfer Object for field options.
|
|
3
|
+
* This class defines the structure and properties of a field option
|
|
4
|
+
* that can be used in form fields.
|
|
5
|
+
*/
|
|
6
|
+
export declare class FieldOptionDto {
|
|
7
|
+
/**
|
|
8
|
+
* Key of the field option
|
|
9
|
+
*/
|
|
10
|
+
key: string;
|
|
11
|
+
/**
|
|
12
|
+
* Value of the field option
|
|
13
|
+
*/
|
|
14
|
+
value: string;
|
|
15
|
+
/**
|
|
16
|
+
* Indicates if the field option is disabled
|
|
17
|
+
*/
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
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.FieldOptionDto = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
/**
|
|
15
|
+
* Data Transfer Object for field options.
|
|
16
|
+
* This class defines the structure and properties of a field option
|
|
17
|
+
* that can be used in form fields.
|
|
18
|
+
*/
|
|
19
|
+
class FieldOptionDto {
|
|
20
|
+
constructor() {
|
|
21
|
+
/**
|
|
22
|
+
* Indicates if the field option is disabled
|
|
23
|
+
*/
|
|
24
|
+
this.disabled = false;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.FieldOptionDto = FieldOptionDto;
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, class_validator_1.IsString)(),
|
|
30
|
+
(0, class_validator_1.IsDefined)(),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], FieldOptionDto.prototype, "key", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, class_validator_1.IsString)(),
|
|
35
|
+
(0, class_validator_1.IsDefined)(),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], FieldOptionDto.prototype, "value", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, class_validator_1.IsBoolean)(),
|
|
40
|
+
(0, class_validator_1.IsOptional)(),
|
|
41
|
+
__metadata("design:type", Boolean)
|
|
42
|
+
], FieldOptionDto.prototype, "disabled", void 0);
|
package/dist/dtos/field.dto.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FieldTypeEnum } from '../enums/field-type.enum';
|
|
2
2
|
import { MultilangTextDto } from './multilang-text.dto';
|
|
3
|
+
import { FieldOptionDto } from './field-option.dto';
|
|
3
4
|
/**
|
|
4
5
|
* Data Transfer Object for a form field.
|
|
5
6
|
* This class defines the structure and properties of a single field
|
|
@@ -15,11 +16,16 @@ export declare class FieldDto {
|
|
|
15
16
|
*/
|
|
16
17
|
label: MultilangTextDto[];
|
|
17
18
|
/**
|
|
18
|
-
* Value of
|
|
19
|
+
* Value of the field.
|
|
20
|
+
*
|
|
21
|
+
* String is when it is input, text area
|
|
22
|
+
* Number is when it is number
|
|
23
|
+
* FieldOptionDto is when it is checkbox
|
|
24
|
+
* FieldOptionDto[] is when it is radioboxes or select
|
|
19
25
|
*/
|
|
20
|
-
value: string | number |
|
|
26
|
+
value: string | number | FieldOptionDto | FieldOptionDto[];
|
|
21
27
|
/**
|
|
22
|
-
* Type of
|
|
28
|
+
* Type of the field
|
|
23
29
|
*/
|
|
24
30
|
type: FieldTypeEnum;
|
|
25
31
|
/**
|
|
@@ -43,15 +49,17 @@ export declare class FieldDto {
|
|
|
43
49
|
*/
|
|
44
50
|
regexValidationErrorMessage?: MultilangTextDto[];
|
|
45
51
|
/**
|
|
46
|
-
* Indicates if the field
|
|
52
|
+
* Indicates if the field triggers remote validation
|
|
47
53
|
*/
|
|
48
|
-
|
|
54
|
+
triggersRemoteValidation?: boolean;
|
|
49
55
|
/**
|
|
50
|
-
* Error message for the field
|
|
56
|
+
* Error message for the field for supported languages
|
|
51
57
|
*/
|
|
52
58
|
remoteValidationErrorMessage?: MultilangTextDto[];
|
|
53
59
|
/**
|
|
54
|
-
* The item attribute is
|
|
60
|
+
* The item attribute is upgradable
|
|
61
|
+
* If the user has the permission to upgrade the item from his panel
|
|
62
|
+
* TODO: Let's see if this approach is the best way for the user to upgrade their item
|
|
55
63
|
*/
|
|
56
|
-
|
|
64
|
+
upgradable: boolean;
|
|
57
65
|
}
|
package/dist/dtos/field.dto.js
CHANGED
|
@@ -22,9 +22,15 @@ const multilang_text_dto_1 = require("./multilang-text.dto");
|
|
|
22
22
|
class FieldDto {
|
|
23
23
|
constructor() {
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
25
|
+
* Indicates if the field triggers remote validation
|
|
26
26
|
*/
|
|
27
|
-
this.
|
|
27
|
+
this.triggersRemoteValidation = false;
|
|
28
|
+
/**
|
|
29
|
+
* The item attribute is upgradable
|
|
30
|
+
* If the user has the permission to upgrade the item from his panel
|
|
31
|
+
* TODO: Let's see if this approach is the best way for the user to upgrade their item
|
|
32
|
+
*/
|
|
33
|
+
this.upgradable = false;
|
|
28
34
|
}
|
|
29
35
|
}
|
|
30
36
|
exports.FieldDto = FieldDto;
|
|
@@ -74,7 +80,7 @@ __decorate([
|
|
|
74
80
|
(0, class_validator_1.IsBoolean)(),
|
|
75
81
|
(0, class_validator_1.IsOptional)(),
|
|
76
82
|
__metadata("design:type", Boolean)
|
|
77
|
-
], FieldDto.prototype, "
|
|
83
|
+
], FieldDto.prototype, "triggersRemoteValidation", void 0);
|
|
78
84
|
__decorate([
|
|
79
85
|
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
80
86
|
(0, class_transformer_1.Type)(() => multilang_text_dto_1.MultilangTextDto),
|
|
@@ -84,4 +90,4 @@ __decorate([
|
|
|
84
90
|
__decorate([
|
|
85
91
|
(0, class_validator_1.IsBoolean)(),
|
|
86
92
|
__metadata("design:type", Boolean)
|
|
87
|
-
], FieldDto.prototype, "
|
|
93
|
+
], FieldDto.prototype, "upgradable", void 0);
|
package/dist/dtos/info.dto.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ProductActionsEnum } from '../enums/actions.enum';
|
|
2
2
|
import { EventsEnum } from '../enums/events.enum';
|
|
3
3
|
import { LanguageEnum } from '../enums/language.enum';
|
|
4
4
|
import { RolesEnum } from '../enums/roles.enum';
|
|
@@ -34,7 +34,7 @@ export declare class InfoDto {
|
|
|
34
34
|
/**
|
|
35
35
|
* A list of actions that are supported by this integration.
|
|
36
36
|
*/
|
|
37
|
-
supportedActions?:
|
|
37
|
+
supportedActions?: ProductActionsEnum[];
|
|
38
38
|
/**
|
|
39
39
|
* A list of events that the integration listens to.
|
|
40
40
|
* This allows the integration to react to specific events in the system.
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Request } from 'express';
|
|
2
1
|
import { JwtDto } from '../jwt.dto';
|
|
3
2
|
import { ProductInfoResponseDto } from './responses/product-info-response.dto';
|
|
4
3
|
import { ErrorResponseDto } from '../error-response.dto';
|
|
@@ -11,18 +10,19 @@ import { ProductUpgradeRequestDto } from './requests/product-upgrade-request.dto
|
|
|
11
10
|
import { ProductDowngradeRequestDto } from './requests/product-downgrade-request.dto';
|
|
12
11
|
import { ProductSuspendRequestDto } from './requests/product-suspend-request.dto';
|
|
13
12
|
import { ProductUnsuspendRequestDto } from './requests/product-unsuspend-request.dto';
|
|
14
|
-
import {
|
|
15
|
-
import { ProductDowngradableRequestDto } from './requests/product-
|
|
13
|
+
import { ProductUpgradableRequestDto } from './requests/product-upgradable-request.dto';
|
|
14
|
+
import { ProductDowngradableRequestDto } from './requests/product-downgradable-request.dto';
|
|
16
15
|
import { ProductDowngradeResponseDto } from './responses/product-downgrade-response.dto';
|
|
17
|
-
import {
|
|
16
|
+
import { ProductUpgradableResponseDto } from './responses/product-upgradable-response.dto';
|
|
18
17
|
import { ProductSuspendResponseDto } from './responses/product-suspend-response.dto';
|
|
19
18
|
import { ProductUnsuspendResponseDto } from './responses/product-unsuspend-response.dto';
|
|
20
|
-
import {
|
|
19
|
+
import { ProductDowngradableResponseDto } from './responses/product-downgradable-response.dto';
|
|
21
20
|
import { ProductDeleteResponseDto } from './responses/product-delete-response.dto';
|
|
22
21
|
import { ProductDeleteRequestDto } from './requests/product-delete-request.dto';
|
|
23
22
|
import { ProductValidateAttributesRequestDto } from './requests/product-validate-attributes-request.dto';
|
|
24
23
|
import { ProductValidateAttributesResponseDto } from './responses/product-validate-attributes-response.dto';
|
|
25
24
|
import { SetupStatusResponseDto } from '../setup-status-response.dto';
|
|
25
|
+
import { CompanyDataDto } from '../company-data.dto';
|
|
26
26
|
export interface ProductControllerInterface {
|
|
27
27
|
info(request: Request & JwtDto): ProductInfoResponseDto | ErrorResponseDto;
|
|
28
28
|
create(requestBody: ProductCreateRequestDto & JwtDto): Promise<ProductCreateResponseDto>;
|
|
@@ -31,14 +31,12 @@ export interface ProductControllerInterface {
|
|
|
31
31
|
downgrade(requestBody: ProductDowngradeRequestDto & JwtDto): Promise<ProductDowngradeResponseDto>;
|
|
32
32
|
suspend(requestBody: ProductSuspendRequestDto & JwtDto): Promise<ProductSuspendResponseDto>;
|
|
33
33
|
unsuspend(requestBody: ProductUnsuspendRequestDto & JwtDto): Promise<ProductUnsuspendResponseDto>;
|
|
34
|
-
|
|
35
|
-
downgradeable(requestBody: ProductDowngradableRequestDto & JwtDto): Promise<
|
|
34
|
+
upgradable(requestBody: ProductUpgradableRequestDto & JwtDto): Promise<ProductUpgradableResponseDto>;
|
|
35
|
+
downgradeable(requestBody: ProductDowngradableRequestDto & JwtDto): Promise<ProductDowngradableResponseDto>;
|
|
36
36
|
delete(requestBody: ProductDeleteRequestDto & JwtDto): Promise<ProductDeleteResponseDto>;
|
|
37
37
|
validateProductAttributes(requestBody: ProductValidateAttributesRequestDto): Promise<ProductValidateAttributesResponseDto | ErrorResponseDto>;
|
|
38
38
|
validateItemAttributes(requestBody: ProductValidateAttributesRequestDto): Promise<ProductValidateAttributesResponseDto | ErrorResponseDto>;
|
|
39
39
|
setupStatus(): Promise<SetupStatusResponseDto>;
|
|
40
|
-
install(
|
|
41
|
-
uninstall(
|
|
42
|
-
companyId: string;
|
|
43
|
-
}): Promise<null | ErrorResponseDto>;
|
|
40
|
+
install(requestBody: CompanyDataDto & JwtDto): Promise<null | ErrorResponseDto>;
|
|
41
|
+
uninstall(requestBody: JwtDto): Promise<null | ErrorResponseDto>;
|
|
44
42
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ProductItemDataDto } from '../product-item-data.dto';
|
|
2
|
+
/**
|
|
3
|
+
* Represents a request to validate item attributes.
|
|
4
|
+
* This DTO is used when a client needs to check the validity of a set of attribute values
|
|
5
|
+
* before proceeding with an action, such as creating or updating an item.
|
|
6
|
+
*/
|
|
7
|
+
export declare class ItemValidateAttributesRequestDto {
|
|
8
|
+
/**
|
|
9
|
+
* The product data of the item.
|
|
10
|
+
*/
|
|
11
|
+
productData: ProductItemDataDto;
|
|
12
|
+
/**
|
|
13
|
+
* The key of the attribute that triggered the validation.
|
|
14
|
+
* This helps the server understand the context of the validation request,
|
|
15
|
+
* especially in cases where validation rules are interdependent.
|
|
16
|
+
*/
|
|
17
|
+
triggeredByKey: string;
|
|
18
|
+
/**
|
|
19
|
+
* A record of attribute values to be validated.
|
|
20
|
+
* The keys are the attribute identifiers, and the values are the data to be checked.
|
|
21
|
+
*/
|
|
22
|
+
attributeValues: Record<string, unknown>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
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.ItemValidateAttributesRequestDto = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const product_item_data_dto_1 = require("../product-item-data.dto");
|
|
15
|
+
const class_transformer_1 = require("class-transformer");
|
|
16
|
+
/**
|
|
17
|
+
* Represents a request to validate item attributes.
|
|
18
|
+
* This DTO is used when a client needs to check the validity of a set of attribute values
|
|
19
|
+
* before proceeding with an action, such as creating or updating an item.
|
|
20
|
+
*/
|
|
21
|
+
class ItemValidateAttributesRequestDto {
|
|
22
|
+
}
|
|
23
|
+
exports.ItemValidateAttributesRequestDto = ItemValidateAttributesRequestDto;
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, class_validator_1.IsDefined)(),
|
|
26
|
+
(0, class_transformer_1.Type)(() => product_item_data_dto_1.ProductItemDataDto),
|
|
27
|
+
(0, class_validator_1.ValidateNested)(),
|
|
28
|
+
__metadata("design:type", product_item_data_dto_1.ProductItemDataDto)
|
|
29
|
+
], ItemValidateAttributesRequestDto.prototype, "productData", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, class_validator_1.IsDefined)(),
|
|
32
|
+
(0, class_validator_1.IsString)(),
|
|
33
|
+
__metadata("design:type", String)
|
|
34
|
+
], ItemValidateAttributesRequestDto.prototype, "triggeredByKey", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, class_validator_1.IsDefined)(),
|
|
37
|
+
(0, class_validator_1.IsObject)(),
|
|
38
|
+
__metadata("design:type", Object)
|
|
39
|
+
], ItemValidateAttributesRequestDto.prototype, "attributeValues", void 0);
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
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);
|
|
@@ -0,0 +1,18 @@
|
|
|
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 upgradable.
|
|
5
|
+
* This DTO contains all the necessary information for the check.
|
|
6
|
+
*/
|
|
7
|
+
export declare class ProductUpgradableRequestDto {
|
|
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
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
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.ProductUpgradableRequestDto = 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 upgradable.
|
|
19
|
+
* This DTO contains all the necessary information for the check.
|
|
20
|
+
*/
|
|
21
|
+
class ProductUpgradableRequestDto {
|
|
22
|
+
}
|
|
23
|
+
exports.ProductUpgradableRequestDto = ProductUpgradableRequestDto;
|
|
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
|
+
], ProductUpgradableRequestDto.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
|
+
], ProductUpgradableRequestDto.prototype, "itemData", void 0);
|
|
@@ -14,5 +14,5 @@ export declare class ProductValidateAttributesRequestDto {
|
|
|
14
14
|
* A record of attribute values to be validated.
|
|
15
15
|
* The keys are the attribute identifiers, and the values are the data to be checked.
|
|
16
16
|
*/
|
|
17
|
-
|
|
17
|
+
attributeValues: Record<string, unknown>;
|
|
18
18
|
}
|
|
@@ -28,4 +28,4 @@ __decorate([
|
|
|
28
28
|
(0, class_validator_1.IsDefined)(),
|
|
29
29
|
(0, class_validator_1.IsObject)(),
|
|
30
30
|
__metadata("design:type", Object)
|
|
31
|
-
], ProductValidateAttributesRequestDto.prototype, "
|
|
31
|
+
], ProductValidateAttributesRequestDto.prototype, "attributeValues", void 0);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BaseResponse } from '../../base-response.dto';
|
|
2
|
+
import { FieldDto } from '../../field.dto';
|
|
3
|
+
/**
|
|
4
|
+
* Represents the response from validating item attributes.
|
|
5
|
+
* Contains the list of attributes that have been validated.
|
|
6
|
+
*/
|
|
7
|
+
export declare class ItemValidateAttributesResponseDto extends BaseResponse {
|
|
8
|
+
/**
|
|
9
|
+
* An array of field DTOs representing the validated attributes.
|
|
10
|
+
* Each `FieldDto` contains details about a single attribute.
|
|
11
|
+
*/
|
|
12
|
+
validatedAttributes: FieldDto[];
|
|
13
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ItemValidateAttributesResponseDto = void 0;
|
|
4
|
+
const base_response_dto_1 = require("../../base-response.dto");
|
|
5
|
+
/**
|
|
6
|
+
* Represents the response from validating item attributes.
|
|
7
|
+
* Contains the list of attributes that have been validated.
|
|
8
|
+
*/
|
|
9
|
+
class ItemValidateAttributesResponseDto extends base_response_dto_1.BaseResponse {
|
|
10
|
+
}
|
|
11
|
+
exports.ItemValidateAttributesResponseDto = ItemValidateAttributesResponseDto;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ResponseStatusEnum } from '../../../enums/response-status.enum';
|
|
2
|
+
import { BaseResponse } from '../../base-response.dto';
|
|
3
|
+
/**
|
|
4
|
+
* Represents the response for a product Downgradable check.
|
|
5
|
+
* It indicates whether a product item is Downgradable and may contain additional data.
|
|
6
|
+
*/
|
|
7
|
+
export declare class ProductDowngradableResponseDto 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 Downgradable check.
|
|
18
|
+
* Can contain details about available downgrades or reasons for failure.
|
|
19
|
+
* @optional
|
|
20
|
+
*/
|
|
21
|
+
data?: Record<string, unknown>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProductDowngradableResponseDto = void 0;
|
|
4
|
+
const base_response_dto_1 = require("../../base-response.dto");
|
|
5
|
+
/**
|
|
6
|
+
* Represents the response for a product Downgradable check.
|
|
7
|
+
* It indicates whether a product item is Downgradable and may contain additional data.
|
|
8
|
+
*/
|
|
9
|
+
class ProductDowngradableResponseDto extends base_response_dto_1.BaseResponse {
|
|
10
|
+
}
|
|
11
|
+
exports.ProductDowngradableResponseDto = ProductDowngradableResponseDto;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ResponseStatusEnum } from '../../../enums/response-status.enum';
|
|
2
|
+
import { BaseResponse } from '../../base-response.dto';
|
|
3
|
+
/**
|
|
4
|
+
* Represents the response for a product upgradable check.
|
|
5
|
+
* It indicates whether a product item is upgradable and may contain additional data.
|
|
6
|
+
*/
|
|
7
|
+
export declare class ProductUpgradableResponseDto 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 upgradable check.
|
|
18
|
+
* Can contain details about available upgrades or reasons for failure.
|
|
19
|
+
* @optional
|
|
20
|
+
*/
|
|
21
|
+
data?: Record<string, unknown>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProductUpgradableResponseDto = void 0;
|
|
4
|
+
const base_response_dto_1 = require("../../base-response.dto");
|
|
5
|
+
/**
|
|
6
|
+
* Represents the response for a product upgradable check.
|
|
7
|
+
* It indicates whether a product item is upgradable and may contain additional data.
|
|
8
|
+
*/
|
|
9
|
+
class ProductUpgradableResponseDto extends base_response_dto_1.BaseResponse {
|
|
10
|
+
}
|
|
11
|
+
exports.ProductUpgradableResponseDto = ProductUpgradableResponseDto;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export declare enum
|
|
2
|
-
CREATE = "
|
|
3
|
-
RENEW = "
|
|
4
|
-
UPGRADE = "
|
|
5
|
-
DOWNGRADE = "
|
|
6
|
-
SUSPEND = "
|
|
7
|
-
UNSUSPEND = "
|
|
8
|
-
DELETE = "
|
|
1
|
+
export declare enum ProductActionsEnum {
|
|
2
|
+
CREATE = "create",
|
|
3
|
+
RENEW = "renew",
|
|
4
|
+
UPGRADE = "upgrade",
|
|
5
|
+
DOWNGRADE = "downgrade",
|
|
6
|
+
SUSPEND = "suspend",
|
|
7
|
+
UNSUSPEND = "unsuspend",
|
|
8
|
+
DELETE = "delete"
|
|
9
9
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
var
|
|
5
|
-
(function (
|
|
3
|
+
exports.ProductActionsEnum = void 0;
|
|
4
|
+
var ProductActionsEnum;
|
|
5
|
+
(function (ProductActionsEnum) {
|
|
6
6
|
// Product Integration
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
})(
|
|
7
|
+
ProductActionsEnum["CREATE"] = "create";
|
|
8
|
+
ProductActionsEnum["RENEW"] = "renew";
|
|
9
|
+
ProductActionsEnum["UPGRADE"] = "upgrade";
|
|
10
|
+
ProductActionsEnum["DOWNGRADE"] = "downgrade";
|
|
11
|
+
ProductActionsEnum["SUSPEND"] = "suspend";
|
|
12
|
+
ProductActionsEnum["UNSUSPEND"] = "unsuspend";
|
|
13
|
+
ProductActionsEnum["DELETE"] = "delete";
|
|
14
|
+
})(ProductActionsEnum || (exports.ProductActionsEnum = ProductActionsEnum = {}));
|
|
@@ -79,14 +79,15 @@ export declare enum EventsEnum {
|
|
|
79
79
|
ADDON_CREATED = "addon/created",
|
|
80
80
|
ADDON_UPDATED = "addon/updated",
|
|
81
81
|
ADDON_DELETED = "addon/deleted",
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
82
|
+
TRANSACTION_CREATED = "transaction/created",
|
|
83
|
+
TRANSACTION_CANCELED = "transaction/canceled",
|
|
84
|
+
TRANSACTION_FAILED = "transaction/failed",
|
|
85
|
+
TRANSACTION_SUBSCRIBED = "transaction/subscribed",
|
|
86
|
+
TRANSACTION_UNSUBSCRIBED = "transaction/unsubscribed",
|
|
87
|
+
TRANSACTION_UPDATED = "transaction/updated",
|
|
88
|
+
TRANSACTION_DELETED = "transaction/deleted",
|
|
89
|
+
TRANSACTION_COMPLETED = "transaction/completed",
|
|
90
|
+
TRANSACTION_REFUNDED = "transaction/refunded",
|
|
90
91
|
TEMPLATE_CREATED = "template/created",
|
|
91
92
|
TEMPLATE_UPDATED = "template/updated",
|
|
92
93
|
TEMPLATE_DELETED = "template/deleted",
|
|
@@ -83,14 +83,15 @@ var EventsEnum;
|
|
|
83
83
|
EventsEnum["ADDON_CREATED"] = "addon/created";
|
|
84
84
|
EventsEnum["ADDON_UPDATED"] = "addon/updated";
|
|
85
85
|
EventsEnum["ADDON_DELETED"] = "addon/deleted";
|
|
86
|
-
EventsEnum["
|
|
87
|
-
EventsEnum["
|
|
88
|
-
EventsEnum["
|
|
89
|
-
EventsEnum["
|
|
90
|
-
EventsEnum["
|
|
91
|
-
EventsEnum["
|
|
92
|
-
EventsEnum["
|
|
93
|
-
EventsEnum["
|
|
86
|
+
EventsEnum["TRANSACTION_CREATED"] = "transaction/created";
|
|
87
|
+
EventsEnum["TRANSACTION_CANCELED"] = "transaction/canceled";
|
|
88
|
+
EventsEnum["TRANSACTION_FAILED"] = "transaction/failed";
|
|
89
|
+
EventsEnum["TRANSACTION_SUBSCRIBED"] = "transaction/subscribed";
|
|
90
|
+
EventsEnum["TRANSACTION_UNSUBSCRIBED"] = "transaction/unsubscribed";
|
|
91
|
+
EventsEnum["TRANSACTION_UPDATED"] = "transaction/updated";
|
|
92
|
+
EventsEnum["TRANSACTION_DELETED"] = "transaction/deleted";
|
|
93
|
+
EventsEnum["TRANSACTION_COMPLETED"] = "transaction/completed";
|
|
94
|
+
EventsEnum["TRANSACTION_REFUNDED"] = "transaction/refunded";
|
|
94
95
|
EventsEnum["TEMPLATE_CREATED"] = "template/created";
|
|
95
96
|
EventsEnum["TEMPLATE_UPDATED"] = "template/updated";
|
|
96
97
|
EventsEnum["TEMPLATE_DELETED"] = "template/deleted";
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export * from './dtos/client-data.dto';
|
|
|
6
6
|
export * from './dtos/company-data.dto';
|
|
7
7
|
export * from './dtos/error-response.dto';
|
|
8
8
|
export * from './dtos/field.dto';
|
|
9
|
+
export * from './dtos/field-option.dto';
|
|
9
10
|
export * from './dtos/info.dto';
|
|
10
11
|
export * from './dtos/jwt.dto';
|
|
11
12
|
export * from './dtos/menu.dto';
|
|
@@ -30,24 +31,26 @@ export * from './dtos/product/product-item-data.dto';
|
|
|
30
31
|
export * from './dtos/product/requests/product-create-request.dto';
|
|
31
32
|
export * from './dtos/product/requests/product-delete-request.dto';
|
|
32
33
|
export * from './dtos/product/requests/product-downgrade-request.dto';
|
|
33
|
-
export * from './dtos/product/requests/product-
|
|
34
|
+
export * from './dtos/product/requests/product-downgradable-request.dto';
|
|
34
35
|
export * from './dtos/product/requests/product-renew-request.dto';
|
|
35
36
|
export * from './dtos/product/requests/product-suspend-request.dto';
|
|
36
37
|
export * from './dtos/product/requests/product-unsuspend-request.dto';
|
|
37
38
|
export * from './dtos/product/requests/product-upgrade-request.dto';
|
|
38
|
-
export * from './dtos/product/requests/product-
|
|
39
|
+
export * from './dtos/product/requests/product-upgradable-request.dto';
|
|
39
40
|
export * from './dtos/product/requests/product-validate-attributes-request.dto';
|
|
41
|
+
export * from './dtos/product/requests/item-validate-attributes-request.dto';
|
|
40
42
|
export * from './dtos/product/responses/product-create-response.dto';
|
|
41
43
|
export * from './dtos/product/responses/product-delete-response.dto';
|
|
42
44
|
export * from './dtos/product/responses/product-downgrade-response.dto';
|
|
43
|
-
export * from './dtos/product/responses/product-
|
|
45
|
+
export * from './dtos/product/responses/product-downgradable-response.dto';
|
|
44
46
|
export * from './dtos/product/responses/product-info-response.dto';
|
|
45
47
|
export * from './dtos/product/responses/product-renew-response.dto';
|
|
46
48
|
export * from './dtos/product/responses/product-suspend-response.dto';
|
|
47
49
|
export * from './dtos/product/responses/product-unsuspend-response.dto';
|
|
48
50
|
export * from './dtos/product/responses/product-upgrade-response.dto';
|
|
49
|
-
export * from './dtos/product/responses/product-
|
|
51
|
+
export * from './dtos/product/responses/product-upgradable-response.dto';
|
|
50
52
|
export * from './dtos/product/responses/product-validate-attributes-response.dto';
|
|
53
|
+
export * from './dtos/product/responses/item-validate-attributes-response.dto';
|
|
51
54
|
export * from './enums/actions.enum';
|
|
52
55
|
export * from './enums/country.enum';
|
|
53
56
|
export * from './enums/duration.enum';
|
|
@@ -75,11 +78,11 @@ export * from './validators/client-data-validator';
|
|
|
75
78
|
export * from './validators/product-create-request-validator';
|
|
76
79
|
export * from './validators/product-delete-request-validator';
|
|
77
80
|
export * from './validators/product-downgrade-request-validator';
|
|
78
|
-
export * from './validators/product-
|
|
81
|
+
export * from './validators/product-downgradable-request-validator';
|
|
79
82
|
export * from './validators/product-renew-request-validator';
|
|
80
83
|
export * from './validators/product-suspend-request-validator';
|
|
81
84
|
export * from './validators/product-unsuspend-request-validator';
|
|
82
85
|
export * from './validators/product-upgrade-request-validator';
|
|
83
|
-
export * from './validators/product-
|
|
86
|
+
export * from './validators/product-upgradable-request-validator';
|
|
84
87
|
export * from './validators/product-validate-attributes-request-validator';
|
|
85
88
|
export * from './dtos/product/product.interface';
|
package/dist/index.js
CHANGED
|
@@ -23,6 +23,7 @@ __exportStar(require("./dtos/client-data.dto"), exports);
|
|
|
23
23
|
__exportStar(require("./dtos/company-data.dto"), exports);
|
|
24
24
|
__exportStar(require("./dtos/error-response.dto"), exports);
|
|
25
25
|
__exportStar(require("./dtos/field.dto"), exports);
|
|
26
|
+
__exportStar(require("./dtos/field-option.dto"), exports);
|
|
26
27
|
__exportStar(require("./dtos/info.dto"), exports);
|
|
27
28
|
__exportStar(require("./dtos/jwt.dto"), exports);
|
|
28
29
|
__exportStar(require("./dtos/menu.dto"), exports);
|
|
@@ -50,25 +51,27 @@ __exportStar(require("./dtos/product/product-item-data.dto"), exports);
|
|
|
50
51
|
__exportStar(require("./dtos/product/requests/product-create-request.dto"), exports);
|
|
51
52
|
__exportStar(require("./dtos/product/requests/product-delete-request.dto"), exports);
|
|
52
53
|
__exportStar(require("./dtos/product/requests/product-downgrade-request.dto"), exports);
|
|
53
|
-
__exportStar(require("./dtos/product/requests/product-
|
|
54
|
+
__exportStar(require("./dtos/product/requests/product-downgradable-request.dto"), exports);
|
|
54
55
|
__exportStar(require("./dtos/product/requests/product-renew-request.dto"), exports);
|
|
55
56
|
__exportStar(require("./dtos/product/requests/product-suspend-request.dto"), exports);
|
|
56
57
|
__exportStar(require("./dtos/product/requests/product-unsuspend-request.dto"), exports);
|
|
57
58
|
__exportStar(require("./dtos/product/requests/product-upgrade-request.dto"), exports);
|
|
58
|
-
__exportStar(require("./dtos/product/requests/product-
|
|
59
|
+
__exportStar(require("./dtos/product/requests/product-upgradable-request.dto"), exports);
|
|
59
60
|
__exportStar(require("./dtos/product/requests/product-validate-attributes-request.dto"), exports);
|
|
61
|
+
__exportStar(require("./dtos/product/requests/item-validate-attributes-request.dto"), exports);
|
|
60
62
|
// Product Responses
|
|
61
63
|
__exportStar(require("./dtos/product/responses/product-create-response.dto"), exports);
|
|
62
64
|
__exportStar(require("./dtos/product/responses/product-delete-response.dto"), exports);
|
|
63
65
|
__exportStar(require("./dtos/product/responses/product-downgrade-response.dto"), exports);
|
|
64
|
-
__exportStar(require("./dtos/product/responses/product-
|
|
66
|
+
__exportStar(require("./dtos/product/responses/product-downgradable-response.dto"), exports);
|
|
65
67
|
__exportStar(require("./dtos/product/responses/product-info-response.dto"), exports);
|
|
66
68
|
__exportStar(require("./dtos/product/responses/product-renew-response.dto"), exports);
|
|
67
69
|
__exportStar(require("./dtos/product/responses/product-suspend-response.dto"), exports);
|
|
68
70
|
__exportStar(require("./dtos/product/responses/product-unsuspend-response.dto"), exports);
|
|
69
71
|
__exportStar(require("./dtos/product/responses/product-upgrade-response.dto"), exports);
|
|
70
|
-
__exportStar(require("./dtos/product/responses/product-
|
|
72
|
+
__exportStar(require("./dtos/product/responses/product-upgradable-response.dto"), exports);
|
|
71
73
|
__exportStar(require("./dtos/product/responses/product-validate-attributes-response.dto"), exports);
|
|
74
|
+
__exportStar(require("./dtos/product/responses/item-validate-attributes-response.dto"), exports);
|
|
72
75
|
// Enums
|
|
73
76
|
__exportStar(require("./enums/actions.enum"), exports);
|
|
74
77
|
__exportStar(require("./enums/country.enum"), exports);
|
|
@@ -98,12 +101,12 @@ __exportStar(require("./validators/client-data-validator"), exports);
|
|
|
98
101
|
__exportStar(require("./validators/product-create-request-validator"), exports);
|
|
99
102
|
__exportStar(require("./validators/product-delete-request-validator"), exports);
|
|
100
103
|
__exportStar(require("./validators/product-downgrade-request-validator"), exports);
|
|
101
|
-
__exportStar(require("./validators/product-
|
|
104
|
+
__exportStar(require("./validators/product-downgradable-request-validator"), exports);
|
|
102
105
|
__exportStar(require("./validators/product-renew-request-validator"), exports);
|
|
103
106
|
__exportStar(require("./validators/product-suspend-request-validator"), exports);
|
|
104
107
|
__exportStar(require("./validators/product-unsuspend-request-validator"), exports);
|
|
105
108
|
__exportStar(require("./validators/product-upgrade-request-validator"), exports);
|
|
106
|
-
__exportStar(require("./validators/product-
|
|
109
|
+
__exportStar(require("./validators/product-upgradable-request-validator"), exports);
|
|
107
110
|
__exportStar(require("./validators/product-validate-attributes-request-validator"), exports);
|
|
108
111
|
// Interfaces
|
|
109
112
|
__exportStar(require("./dtos/product/product.interface"), exports);
|
|
@@ -0,0 +1,8 @@
|
|
|
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[]>;
|
|
@@ -0,0 +1,17 @@
|
|
|
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;
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.validateProductDowngradableRequestDto = void 0;
|
|
4
4
|
const class_validator_1 = require("class-validator");
|
|
5
5
|
const class_transformer_1 = require("class-transformer");
|
|
6
|
-
const
|
|
6
|
+
const product_downgradable_request_dto_1 = require("../dtos/product/requests/product-downgradable-request.dto");
|
|
7
7
|
/**
|
|
8
8
|
* Validates a product downgradable request object.
|
|
9
9
|
*
|
|
@@ -11,7 +11,7 @@ const product_downgradeable_request_dto_1 = require("../dtos/product/requests/pr
|
|
|
11
11
|
* @returns {Promise<ValidationError[]>} - A promise that resolves with an array of validation errors.
|
|
12
12
|
*/
|
|
13
13
|
const validateProductDowngradableRequestDto = async (plainObject) => {
|
|
14
|
-
const request = (0, class_transformer_1.plainToInstance)(
|
|
14
|
+
const request = (0, class_transformer_1.plainToInstance)(product_downgradable_request_dto_1.ProductDowngradableRequestDto, plainObject);
|
|
15
15
|
return await (0, class_validator_1.validate)(request);
|
|
16
16
|
};
|
|
17
17
|
exports.validateProductDowngradableRequestDto = validateProductDowngradableRequestDto;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ValidationError } from 'class-validator';
|
|
2
|
+
/**
|
|
3
|
+
* Validates a product upgradable 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 validateProductUpgradableRequestDto: (plainObject: Record<string, unknown>) => Promise<ValidationError[]>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateProductUpgradableRequestDto = void 0;
|
|
4
|
+
const class_validator_1 = require("class-validator");
|
|
5
|
+
const class_transformer_1 = require("class-transformer");
|
|
6
|
+
const product_upgradable_request_dto_1 = require("../dtos/product/requests/product-upgradable-request.dto");
|
|
7
|
+
/**
|
|
8
|
+
* Validates a product upgradable 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 validateProductUpgradableRequestDto = async (plainObject) => {
|
|
14
|
+
const request = (0, class_transformer_1.plainToInstance)(product_upgradable_request_dto_1.ProductUpgradableRequestDto, plainObject);
|
|
15
|
+
return await (0, class_validator_1.validate)(request);
|
|
16
|
+
};
|
|
17
|
+
exports.validateProductUpgradableRequestDto = validateProductUpgradableRequestDto;
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hosterai/types",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.15",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "tsc",
|
|
8
8
|
"test": "jest",
|
|
9
9
|
"coverage": "jest --coverage",
|
|
10
|
-
"lint": "eslint . --ext .ts",
|
|
10
|
+
"lint": "eslint . --ext .ts --fix",
|
|
11
11
|
"format": "prettier --write .",
|
|
12
12
|
"release": "npm run build && npm publish --access public"
|
|
13
13
|
},
|
|
@@ -15,6 +15,10 @@
|
|
|
15
15
|
"author": "",
|
|
16
16
|
"license": "MIT",
|
|
17
17
|
"description": "",
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/hoster-ai/types.git"
|
|
21
|
+
},
|
|
18
22
|
"devDependencies": {
|
|
19
23
|
"@types/express": "^5.0.3",
|
|
20
24
|
"@types/fs-extra": "^11.0.4",
|
|
@@ -37,7 +41,7 @@
|
|
|
37
41
|
"peerDependencies": {
|
|
38
42
|
"class-transformer": "^0.5.1",
|
|
39
43
|
"class-validator": "^0.14.2",
|
|
40
|
-
"express": "^5.
|
|
44
|
+
"express": "^4.0.0 || ^5.0.0",
|
|
41
45
|
"reflect-metadata": "^0.2.2"
|
|
42
46
|
},
|
|
43
47
|
"files": [
|