@hosterai/types 0.0.11 → 0.0.13
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 +53 -39
- package/dist/dtos/action.dto.d.ts +21 -3
- package/dist/dtos/action.dto.js +10 -0
- package/dist/dtos/attachment.dto.d.ts +1 -1
- package/dist/dtos/attachment.dto.js +1 -1
- package/dist/dtos/client-data.dto.d.ts +65 -0
- package/dist/dtos/client-data.dto.js +106 -0
- package/dist/dtos/company-data.dto.d.ts +57 -0
- package/dist/dtos/company-data.dto.js +5 -2
- package/dist/dtos/error-response.dto.d.ts +8 -6
- package/dist/dtos/error-response.dto.js +2 -2
- package/dist/dtos/field.dto.d.ts +5 -0
- package/dist/dtos/field.dto.js +5 -0
- package/dist/dtos/info.dto.d.ts +61 -64
- package/dist/dtos/info.dto.js +6 -4
- package/dist/dtos/jwt.dto.d.ts +12 -9
- package/dist/dtos/jwt.dto.js +6 -2
- package/dist/dtos/menu.dto.d.ts +26 -11
- package/dist/dtos/multilang-text.dto.d.ts +11 -0
- package/dist/dtos/multilang-text.dto.js +4 -0
- package/dist/dtos/notification/notification-info.dto.d.ts +15 -0
- package/dist/dtos/notification/notification-info.dto.js +4 -0
- package/dist/dtos/notification/{notification-request.dto.d.ts → notification-send-request.dto.d.ts} +6 -1
- package/dist/dtos/notification/{notification-request.dto.js → notification-send-request.dto.js} +11 -6
- package/dist/dtos/product/product-info.dto.d.ts +30 -0
- package/dist/dtos/product/product-info.dto.js +11 -0
- package/dist/dtos/product/product-item-data.dto.d.ts +31 -0
- package/dist/dtos/product/product-item-data.dto.js +43 -0
- package/dist/dtos/product/product.interface.d.ts +44 -0
- package/dist/dtos/product/product.interface.js +2 -0
- package/dist/dtos/product/requests/product-create-request.dto.d.ts +18 -0
- package/dist/dtos/product/requests/product-create-request.dto.js +37 -0
- package/dist/dtos/product/requests/product-delete-request.dto.d.ts +18 -0
- package/dist/dtos/product/requests/product-delete-request.dto.js +37 -0
- package/dist/dtos/product/requests/product-downgrade-request.dto.d.ts +24 -0
- package/dist/dtos/product/requests/product-downgrade-request.dto.js +44 -0
- package/dist/dtos/product/requests/product-downgradeable-request.dto.d.ts +18 -0
- package/dist/dtos/product/requests/product-downgradeable-request.dto.js +37 -0
- package/dist/dtos/product/requests/product-renew-request.dto.d.ts +18 -0
- package/dist/dtos/product/requests/product-renew-request.dto.js +37 -0
- package/dist/dtos/product/requests/product-suspend-request.dto.d.ts +18 -0
- package/dist/dtos/product/requests/product-suspend-request.dto.js +37 -0
- package/dist/dtos/product/requests/product-unsuspend-request.dto.d.ts +18 -0
- package/dist/dtos/product/requests/product-unsuspend-request.dto.js +37 -0
- package/dist/dtos/product/requests/product-upgrade-request.dto.d.ts +24 -0
- package/dist/dtos/product/requests/product-upgrade-request.dto.js +44 -0
- package/dist/dtos/product/requests/product-upgradeable-request.dto.d.ts +18 -0
- package/dist/dtos/product/requests/product-upgradeable-request.dto.js +37 -0
- package/dist/dtos/product/requests/product-validate-attributes-request.dto.d.ts +18 -0
- package/dist/dtos/product/requests/product-validate-attributes-request.dto.js +31 -0
- package/dist/dtos/product/responses/product-create-response.dto.d.ts +21 -0
- package/dist/dtos/product/responses/product-create-response.dto.js +11 -0
- package/dist/dtos/product/responses/product-delete-response.dto.d.ts +21 -0
- package/dist/dtos/product/responses/product-delete-response.dto.js +11 -0
- package/dist/dtos/product/responses/product-downgrade-response.dto.d.ts +21 -0
- package/dist/dtos/product/responses/product-downgrade-response.dto.js +11 -0
- package/dist/dtos/product/responses/product-downgradeable-response.dto.d.ts +22 -0
- package/dist/dtos/product/responses/product-downgradeable-response.dto.js +11 -0
- package/dist/dtos/product/responses/product-info-response.dto.d.ts +13 -0
- package/dist/dtos/product/responses/product-info-response.dto.js +11 -0
- package/dist/dtos/product/responses/product-renew-response.dto.d.ts +21 -0
- package/dist/dtos/product/responses/product-renew-response.dto.js +11 -0
- package/dist/dtos/product/responses/product-suspend-response.dto.d.ts +21 -0
- package/dist/dtos/product/responses/product-suspend-response.dto.js +11 -0
- package/dist/dtos/product/responses/product-unsuspend-response.dto.d.ts +21 -0
- package/dist/dtos/product/responses/product-unsuspend-response.dto.js +11 -0
- package/dist/dtos/product/responses/product-upgrade-response.dto.d.ts +22 -0
- package/dist/dtos/product/responses/product-upgrade-response.dto.js +11 -0
- package/dist/dtos/product/responses/product-upgradeable-response.dto.d.ts +22 -0
- package/dist/dtos/product/responses/product-upgradeable-response.dto.js +11 -0
- package/dist/dtos/product/responses/product-validate-attributes-response.dto.d.ts +13 -0
- package/dist/dtos/product/responses/product-validate-attributes-response.dto.js +11 -0
- package/dist/dtos/response-data.dto.d.ts +7 -0
- package/dist/dtos/response-data.dto.js +4 -0
- package/dist/dtos/setup-status-response.dto.d.ts +8 -0
- package/dist/dtos/setup-status-response.dto.js +4 -0
- package/dist/dtos/submenu.dto.d.ts +7 -0
- package/dist/dtos/submenu.dto.js +11 -0
- package/dist/dtos/success-response.dto.d.ts +4 -0
- package/dist/dtos/success-response.dto.js +4 -0
- package/dist/dtos/tab.dto.d.ts +0 -2
- package/dist/dtos/tab.dto.js +1 -4
- package/dist/dtos/task-response.dto.d.ts +4 -0
- package/dist/dtos/task-response.dto.js +4 -0
- package/dist/dtos/unit.dto.d.ts +16 -0
- package/dist/dtos/unit.dto.js +4 -0
- package/dist/enums/duration.enum.d.ts +23 -0
- package/dist/enums/duration.enum.js +27 -0
- package/dist/enums/events.enum.d.ts +2 -0
- package/dist/enums/events.enum.js +2 -0
- package/dist/enums/response-status.enum.d.ts +5 -0
- package/dist/enums/response-status.enum.js +9 -0
- package/dist/index.d.ts +57 -14
- package/dist/index.js +65 -19
- package/dist/validators/client-data-validator.d.ts +8 -0
- package/dist/validators/client-data-validator.js +17 -0
- package/dist/validators/notification-request-validator.js +2 -2
- package/dist/validators/product-create-request-validator.d.ts +8 -0
- package/dist/validators/product-create-request-validator.js +17 -0
- package/dist/validators/product-delete-request-validator.d.ts +8 -0
- package/dist/validators/product-delete-request-validator.js +17 -0
- package/dist/validators/product-downgrade-request-validator.d.ts +8 -0
- package/dist/validators/product-downgrade-request-validator.js +17 -0
- package/dist/validators/product-downgradeable-request-validator.d.ts +8 -0
- package/dist/validators/product-downgradeable-request-validator.js +17 -0
- package/dist/validators/product-renew-request-validator.d.ts +8 -0
- package/dist/validators/product-renew-request-validator.js +17 -0
- package/dist/validators/product-suspend-request-validator.d.ts +8 -0
- package/dist/validators/product-suspend-request-validator.js +17 -0
- package/dist/validators/product-unsuspend-request-validator.d.ts +8 -0
- package/dist/validators/product-unsuspend-request-validator.js +17 -0
- package/dist/validators/product-upgrade-request-validator.d.ts +8 -0
- package/dist/validators/product-upgrade-request-validator.js +17 -0
- package/dist/validators/product-upgradeable-request-validator.d.ts +8 -0
- package/dist/validators/product-upgradeable-request-validator.js +17 -0
- package/dist/validators/product-validate-attributes-request-validator.d.ts +8 -0
- package/dist/validators/product-validate-attributes-request-validator.js +17 -0
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -29,28 +29,29 @@ DTOs define the shape of data that is exchanged between different parts of the s
|
|
|
29
29
|
|
|
30
30
|
**Available DTOs:**
|
|
31
31
|
|
|
32
|
-
- `action.dto.ts`: Defines the structure for
|
|
32
|
+
- `action.dto.ts`: Defines the structure for a UI action.
|
|
33
33
|
- `attachment.dto.ts`: Represents a file attachment.
|
|
34
34
|
- `base-response.dto.ts`: A base structure for API responses.
|
|
35
|
+
- `client-data.dto.ts`: Defines the data structure for a client.
|
|
35
36
|
- `company-data.dto.ts`: Holds all the relevant data for a company.
|
|
36
|
-
- `error-response.dto.ts`: Defines the structure for error responses
|
|
37
|
-
- `field.dto.ts`: Represents a generic field
|
|
38
|
-
- `info.dto.ts`: Contains all
|
|
39
|
-
- `jwt.dto.ts`: DTOs related to JSON Web Tokens
|
|
37
|
+
- `error-response.dto.ts`: Defines the structure for error responses.
|
|
38
|
+
- `field.dto.ts`: Represents a generic field for forms or dynamic data.
|
|
39
|
+
- `info.dto.ts`: Contains all necessary information for a service integration.
|
|
40
|
+
- `jwt.dto.ts`: DTOs related to JSON Web Tokens.
|
|
40
41
|
- `menu.dto.ts`: Defines the structure for menu items.
|
|
41
42
|
- `multilang-text.dto.ts`: A DTO for handling text in multiple languages.
|
|
42
43
|
- `response-data.dto.ts`: A generic wrapper for response data.
|
|
43
44
|
- `setup-status-response.dto.ts`: DTO for returning the setup status.
|
|
44
45
|
- `success-response.dto.ts`: Defines the structure for successful API responses.
|
|
45
46
|
- `tab.dto.ts`: Represents a tab in a user interface.
|
|
46
|
-
- `submenu.dto.ts`: Represents a submenu item
|
|
47
|
+
- `submenu.dto.ts`: Represents a submenu item.
|
|
47
48
|
- `task-response.dto.ts`: DTO for responses related to background tasks.
|
|
48
49
|
- `unit.dto.ts`: Represents a unit for pay-per-use billing.
|
|
49
50
|
|
|
50
51
|
**Notification DTOs:**
|
|
51
52
|
|
|
52
53
|
- `notification/notification-info.dto.ts`: Contains detailed information about a notification.
|
|
53
|
-
- `notification/notification-request.dto.ts`: The primary DTO for requesting a new notification.
|
|
54
|
+
- `notification/notification-send-request.dto.ts`: The primary DTO for requesting a new notification.
|
|
54
55
|
- `notification/receiver/receiver-email.dto.ts`: Defines the receiver for an email notification.
|
|
55
56
|
- `notification/receiver/receiver-push.dto.ts`: Defines the receiver for a push notification.
|
|
56
57
|
- `notification/receiver/receiver-sms.dto.ts`: Defines the receiver for an SMS notification.
|
|
@@ -58,25 +59,38 @@ DTOs define the shape of data that is exchanged between different parts of the s
|
|
|
58
59
|
- `notification/sender/sender-push.dto.ts`: Defines the sender for a push notification.
|
|
59
60
|
- `notification/sender/sender-sms.dto.ts`: Defines the sender for an SMS notification.
|
|
60
61
|
|
|
62
|
+
**Product DTOs:**
|
|
63
|
+
|
|
64
|
+
- `product/product-info.dto.ts`: Contains detailed information about a product.
|
|
65
|
+
- `product/product-item-data.dto.ts`: Represents the data of a specific product item.
|
|
66
|
+
- `product/requests/*`: DTOs for product-related requests (create, delete, upgrade, etc.).
|
|
67
|
+
- `product/responses/*`: DTOs for product-related responses.
|
|
68
|
+
|
|
61
69
|
### Enums
|
|
62
70
|
|
|
63
|
-
Enums provide a set of named constants for common types,
|
|
71
|
+
Enums provide a set of named constants for common types, preventing errors with magic strings.
|
|
64
72
|
|
|
65
73
|
**Key Enums:**
|
|
66
74
|
|
|
67
|
-
- `ActionsEnum`: Defines
|
|
75
|
+
- `ActionsEnum`: Defines possible actions.
|
|
68
76
|
- `CountryEnum`: A list of all countries.
|
|
69
|
-
- `
|
|
70
|
-
- `
|
|
77
|
+
- `DurationEnum`: Defines billing durations (e.g., `MONTHLY`, `YEARLY`).
|
|
78
|
+
- `EventsEnum`: Defines triggerable events.
|
|
79
|
+
- `FieldTypeEnum`: Defines types of fields.
|
|
71
80
|
- `LanguageEnum`: A list of supported languages.
|
|
72
|
-
- `NotificationMessageTypeEnum`: Defines the type of notification (e.g., `EMAIL`, `SMS
|
|
81
|
+
- `NotificationMessageTypeEnum`: Defines the type of notification (e.g., `EMAIL`, `SMS`).
|
|
73
82
|
- `OpenMethodEnum`: Defines how an action's URL should be opened.
|
|
74
|
-
- `
|
|
83
|
+
- `ResponseStatusEnum`: Defines the status of a response (e.g., `COMPLETED`, `FAILED`).
|
|
84
|
+
- `RolesEnum`: Defines user roles.
|
|
75
85
|
- `SetupStatusEnum`: Defines the status of a setup process.
|
|
76
86
|
|
|
87
|
+
### Interfaces
|
|
88
|
+
|
|
89
|
+
- `product/product.interface.ts`: Defines the contract for a product module.
|
|
90
|
+
|
|
77
91
|
### Validators
|
|
78
92
|
|
|
79
|
-
This package includes validation functions that leverage `class-validator`
|
|
93
|
+
This package includes validation functions that leverage `class-validator` to ensure that incoming data conforms to the DTO definitions.
|
|
80
94
|
|
|
81
95
|
**Available Validators:**
|
|
82
96
|
|
|
@@ -91,45 +105,45 @@ This package includes validation functions that leverage `class-validator` and `
|
|
|
91
105
|
|
|
92
106
|
## Usage Example
|
|
93
107
|
|
|
94
|
-
Here is an example of how to use
|
|
108
|
+
Here is an example of how to use a DTO and its validator.
|
|
95
109
|
|
|
96
110
|
First, import the necessary DTO, Enum, and validator function:
|
|
97
111
|
|
|
98
112
|
```typescript
|
|
99
113
|
import {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
114
|
+
ProductCreateRequestDto,
|
|
115
|
+
ClientDataDto,
|
|
116
|
+
ProductItemDataDto,
|
|
117
|
+
DurationEnum,
|
|
118
|
+
validateProductCreateRequestDto, // Assuming a validator exists
|
|
103
119
|
} from '@hosterai/types';
|
|
104
120
|
|
|
105
|
-
// 1. Create a
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
sender: {
|
|
110
|
-
email: 'no-reply@hoster.ai',
|
|
111
|
-
name: 'HosterAI Team',
|
|
112
|
-
},
|
|
113
|
-
receiver: {
|
|
114
|
-
email: 'new-user@example.com',
|
|
121
|
+
// 1. Create a request object
|
|
122
|
+
const request: ProductCreateRequestDto = {
|
|
123
|
+
clientData: {
|
|
124
|
+
// ... client data
|
|
115
125
|
},
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
126
|
+
itemData: {
|
|
127
|
+
itemId: 'item-123',
|
|
128
|
+
productAttributes: {
|
|
129
|
+
// ... product attributes
|
|
130
|
+
},
|
|
131
|
+
itemAttributes: {
|
|
132
|
+
// ... item attributes
|
|
133
|
+
},
|
|
134
|
+
duration: DurationEnum.MONTHLY,
|
|
120
135
|
},
|
|
121
136
|
};
|
|
122
137
|
|
|
123
138
|
// 2. Validate the object
|
|
124
|
-
const errors =
|
|
139
|
+
// const errors = validateProductCreateRequestDto(request);
|
|
125
140
|
|
|
126
141
|
// 3. Check for errors
|
|
127
|
-
if (errors.length > 0) {
|
|
128
|
-
|
|
129
|
-
} else {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
}
|
|
142
|
+
// if (errors.length > 0) {
|
|
143
|
+
// console.error('Validation failed:', errors);
|
|
144
|
+
// } else {
|
|
145
|
+
// console.log('Validation successful!');
|
|
146
|
+
// }
|
|
133
147
|
```
|
|
134
148
|
|
|
135
149
|
## Building from Source
|
|
@@ -1,16 +1,34 @@
|
|
|
1
1
|
import { OpenMethodEnum } from '../enums/open-method.enum';
|
|
2
|
+
/**
|
|
3
|
+
* Defines the structure for a UI action.
|
|
4
|
+
* @example
|
|
5
|
+
* {
|
|
6
|
+
* "icon": "add",
|
|
7
|
+
* "label": "Create New",
|
|
8
|
+
* "openMethod": "ajax_call",
|
|
9
|
+
* "url": "/api/create"
|
|
10
|
+
* }
|
|
11
|
+
*/
|
|
2
12
|
export declare class ActionDto {
|
|
3
13
|
/**
|
|
4
|
-
* The
|
|
14
|
+
* The name of the icon to display for the action.
|
|
15
|
+
* @example "add"
|
|
5
16
|
*/
|
|
6
17
|
icon: string;
|
|
7
18
|
/**
|
|
8
|
-
* The label
|
|
19
|
+
* The text label for the action.
|
|
20
|
+
* @optional
|
|
21
|
+
* @example "Create New"
|
|
9
22
|
*/
|
|
10
23
|
label?: string;
|
|
24
|
+
/**
|
|
25
|
+
* The method by which the action's URL should be opened.
|
|
26
|
+
* @see OpenMethodEnum
|
|
27
|
+
*/
|
|
11
28
|
openMethod: OpenMethodEnum;
|
|
12
29
|
/**
|
|
13
|
-
* The
|
|
30
|
+
* The URL to navigate to when the action is triggered.
|
|
31
|
+
* @example "/api/create"
|
|
14
32
|
*/
|
|
15
33
|
url: string;
|
|
16
34
|
}
|
package/dist/dtos/action.dto.js
CHANGED
|
@@ -12,6 +12,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.ActionDto = void 0;
|
|
13
13
|
const class_validator_1 = require("class-validator");
|
|
14
14
|
const open_method_enum_1 = require("../enums/open-method.enum");
|
|
15
|
+
/**
|
|
16
|
+
* Defines the structure for a UI action.
|
|
17
|
+
* @example
|
|
18
|
+
* {
|
|
19
|
+
* "icon": "add",
|
|
20
|
+
* "label": "Create New",
|
|
21
|
+
* "openMethod": "ajax_call",
|
|
22
|
+
* "url": "/api/create"
|
|
23
|
+
* }
|
|
24
|
+
*/
|
|
15
25
|
class ActionDto {
|
|
16
26
|
}
|
|
17
27
|
exports.ActionDto = ActionDto;
|
|
@@ -27,7 +27,7 @@ __decorate([
|
|
|
27
27
|
(0, class_validator_1.IsNotEmpty)(),
|
|
28
28
|
(0, class_validator_1.IsString)(),
|
|
29
29
|
(0, class_validator_1.IsBase64)(),
|
|
30
|
-
__metadata("design:type",
|
|
30
|
+
__metadata("design:type", String)
|
|
31
31
|
], AttachmentDto.prototype, "content", void 0);
|
|
32
32
|
__decorate([
|
|
33
33
|
(0, class_validator_1.IsOptional)(),
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { CountryEnum } from '../enums/country.enum';
|
|
2
|
+
/**
|
|
3
|
+
* Defines the data structure for a client.
|
|
4
|
+
* This object is used to transfer client data between different parts of the application.
|
|
5
|
+
*/
|
|
6
|
+
export declare class ClientDataDto {
|
|
7
|
+
/**
|
|
8
|
+
* Email of the user
|
|
9
|
+
*/
|
|
10
|
+
email: string;
|
|
11
|
+
/**
|
|
12
|
+
* First name of the user
|
|
13
|
+
*/
|
|
14
|
+
firstName: string;
|
|
15
|
+
/**
|
|
16
|
+
* Last name of the user
|
|
17
|
+
*/
|
|
18
|
+
lastName: string;
|
|
19
|
+
/**
|
|
20
|
+
* Telephone number of the user
|
|
21
|
+
*/
|
|
22
|
+
telephone: string;
|
|
23
|
+
/**
|
|
24
|
+
* Mobile number of the user
|
|
25
|
+
*/
|
|
26
|
+
mobile?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Address line 1 of the user
|
|
29
|
+
*/
|
|
30
|
+
address1: string;
|
|
31
|
+
/**
|
|
32
|
+
* Address line 2 of the user
|
|
33
|
+
*/
|
|
34
|
+
address2?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Address line 3 of the user
|
|
37
|
+
*/
|
|
38
|
+
address3?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Postal code of the user
|
|
41
|
+
*/
|
|
42
|
+
postcode: string;
|
|
43
|
+
/**
|
|
44
|
+
* City of the user
|
|
45
|
+
*/
|
|
46
|
+
city: string;
|
|
47
|
+
/**
|
|
48
|
+
* Country code of the user
|
|
49
|
+
*/
|
|
50
|
+
country: CountryEnum;
|
|
51
|
+
/**
|
|
52
|
+
* State of the user
|
|
53
|
+
*/
|
|
54
|
+
state?: string;
|
|
55
|
+
/**
|
|
56
|
+
* VAT number of the user
|
|
57
|
+
* @optional
|
|
58
|
+
*/
|
|
59
|
+
vat?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Tax office of the user
|
|
62
|
+
* @optional
|
|
63
|
+
*/
|
|
64
|
+
taxOffice?: string;
|
|
65
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
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.ClientDataDto = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const country_enum_1 = require("../enums/country.enum");
|
|
15
|
+
/**
|
|
16
|
+
* Defines the data structure for a client.
|
|
17
|
+
* This object is used to transfer client data between different parts of the application.
|
|
18
|
+
*/
|
|
19
|
+
class ClientDataDto {
|
|
20
|
+
}
|
|
21
|
+
exports.ClientDataDto = ClientDataDto;
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, class_validator_1.IsDefined)(),
|
|
24
|
+
(0, class_validator_1.IsEmail)(),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], ClientDataDto.prototype, "email", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, class_validator_1.IsDefined)(),
|
|
29
|
+
(0, class_validator_1.IsString)(),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], ClientDataDto.prototype, "firstName", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, class_validator_1.IsDefined)(),
|
|
34
|
+
(0, class_validator_1.IsString)(),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], ClientDataDto.prototype, "lastName", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, class_validator_1.IsDefined)(),
|
|
39
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
40
|
+
(0, class_validator_1.IsString)(),
|
|
41
|
+
(0, class_validator_1.IsPhoneNumber)(),
|
|
42
|
+
__metadata("design:type", String)
|
|
43
|
+
], ClientDataDto.prototype, "telephone", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, class_validator_1.IsOptional)(),
|
|
46
|
+
(0, class_validator_1.IsPhoneNumber)(),
|
|
47
|
+
__metadata("design:type", String)
|
|
48
|
+
], ClientDataDto.prototype, "mobile", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, class_validator_1.IsDefined)(),
|
|
51
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
52
|
+
(0, class_validator_1.IsString)(),
|
|
53
|
+
(0, class_validator_1.MinLength)(1),
|
|
54
|
+
(0, class_validator_1.MaxLength)(250),
|
|
55
|
+
__metadata("design:type", String)
|
|
56
|
+
], ClientDataDto.prototype, "address1", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, class_validator_1.IsOptional)(),
|
|
59
|
+
(0, class_validator_1.MinLength)(0),
|
|
60
|
+
(0, class_validator_1.MaxLength)(250),
|
|
61
|
+
__metadata("design:type", String)
|
|
62
|
+
], ClientDataDto.prototype, "address2", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, class_validator_1.IsOptional)(),
|
|
65
|
+
(0, class_validator_1.MinLength)(0),
|
|
66
|
+
(0, class_validator_1.MaxLength)(250),
|
|
67
|
+
__metadata("design:type", String)
|
|
68
|
+
], ClientDataDto.prototype, "address3", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, class_validator_1.IsDefined)(),
|
|
71
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
72
|
+
(0, class_validator_1.IsString)(),
|
|
73
|
+
(0, class_validator_1.MinLength)(1),
|
|
74
|
+
(0, class_validator_1.MaxLength)(16),
|
|
75
|
+
__metadata("design:type", String)
|
|
76
|
+
], ClientDataDto.prototype, "postcode", void 0);
|
|
77
|
+
__decorate([
|
|
78
|
+
(0, class_validator_1.IsDefined)(),
|
|
79
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
80
|
+
(0, class_validator_1.IsString)(),
|
|
81
|
+
(0, class_validator_1.MinLength)(1),
|
|
82
|
+
(0, class_validator_1.MaxLength)(250),
|
|
83
|
+
__metadata("design:type", String)
|
|
84
|
+
], ClientDataDto.prototype, "city", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
(0, class_validator_1.IsDefined)(),
|
|
87
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
88
|
+
(0, class_validator_1.IsEnum)(country_enum_1.CountryEnum),
|
|
89
|
+
__metadata("design:type", String)
|
|
90
|
+
], ClientDataDto.prototype, "country", void 0);
|
|
91
|
+
__decorate([
|
|
92
|
+
(0, class_validator_1.IsOptional)(),
|
|
93
|
+
(0, class_validator_1.MinLength)(0),
|
|
94
|
+
(0, class_validator_1.MaxLength)(250),
|
|
95
|
+
__metadata("design:type", String)
|
|
96
|
+
], ClientDataDto.prototype, "state", void 0);
|
|
97
|
+
__decorate([
|
|
98
|
+
(0, class_validator_1.IsOptional)(),
|
|
99
|
+
(0, class_validator_1.IsString)(),
|
|
100
|
+
__metadata("design:type", String)
|
|
101
|
+
], ClientDataDto.prototype, "vat", void 0);
|
|
102
|
+
__decorate([
|
|
103
|
+
(0, class_validator_1.IsOptional)(),
|
|
104
|
+
(0, class_validator_1.IsString)(),
|
|
105
|
+
__metadata("design:type", String)
|
|
106
|
+
], ClientDataDto.prototype, "taxOffice", void 0);
|
|
@@ -1,22 +1,79 @@
|
|
|
1
1
|
import { CountryEnum } from '../enums/country.enum';
|
|
2
2
|
import { LanguageEnum } from '../enums/language.enum';
|
|
3
|
+
/**
|
|
4
|
+
* Data Transfer Object for company data.
|
|
5
|
+
*/
|
|
3
6
|
export declare class CompanyDataDto {
|
|
7
|
+
/**
|
|
8
|
+
* The unique identifier for the company.
|
|
9
|
+
*/
|
|
4
10
|
id: string;
|
|
11
|
+
/**
|
|
12
|
+
* The name of the company.
|
|
13
|
+
*/
|
|
5
14
|
name: string;
|
|
15
|
+
/**
|
|
16
|
+
* An array of email addresses associated with the company.
|
|
17
|
+
*/
|
|
6
18
|
emails: string[];
|
|
19
|
+
/**
|
|
20
|
+
* The email address used for invoicing.
|
|
21
|
+
*/
|
|
7
22
|
invoiceEmail: string;
|
|
23
|
+
/**
|
|
24
|
+
* The URL for the company's privacy policy.
|
|
25
|
+
*/
|
|
8
26
|
privacyPolicyUrl: string;
|
|
27
|
+
/**
|
|
28
|
+
* The default language for the company.
|
|
29
|
+
*/
|
|
9
30
|
defaultLanguage: LanguageEnum;
|
|
31
|
+
/**
|
|
32
|
+
* An array of supported languages for the company.
|
|
33
|
+
*/
|
|
10
34
|
languages: LanguageEnum[];
|
|
35
|
+
/**
|
|
36
|
+
* The primary telephone number for the company.
|
|
37
|
+
*/
|
|
11
38
|
telephone: string;
|
|
39
|
+
/**
|
|
40
|
+
* The mobile phone number for the company (optional).
|
|
41
|
+
*/
|
|
12
42
|
mobile?: string;
|
|
43
|
+
/**
|
|
44
|
+
* The first line of the company's address.
|
|
45
|
+
*/
|
|
13
46
|
address1: string;
|
|
47
|
+
/**
|
|
48
|
+
* The second line of the company's address (optional).
|
|
49
|
+
*/
|
|
14
50
|
address2?: string;
|
|
51
|
+
/**
|
|
52
|
+
* The third line of the company's address (optional).
|
|
53
|
+
*/
|
|
15
54
|
address3?: string;
|
|
55
|
+
/**
|
|
56
|
+
* The postal code for the company's address.
|
|
57
|
+
*/
|
|
16
58
|
postcode: string;
|
|
59
|
+
/**
|
|
60
|
+
* The city for the company's address.
|
|
61
|
+
*/
|
|
17
62
|
city: string;
|
|
63
|
+
/**
|
|
64
|
+
* The country for the company's address.
|
|
65
|
+
*/
|
|
18
66
|
country: CountryEnum;
|
|
67
|
+
/**
|
|
68
|
+
* The state or province for the company's address (optional).
|
|
69
|
+
*/
|
|
19
70
|
state?: string;
|
|
71
|
+
/**
|
|
72
|
+
* The VAT number for the company (optional).
|
|
73
|
+
*/
|
|
20
74
|
vat?: string;
|
|
75
|
+
/**
|
|
76
|
+
* The tax office for the company (optional).
|
|
77
|
+
*/
|
|
21
78
|
taxOffice?: string;
|
|
22
79
|
}
|
|
@@ -13,6 +13,9 @@ exports.CompanyDataDto = void 0;
|
|
|
13
13
|
const class_validator_1 = require("class-validator");
|
|
14
14
|
const country_enum_1 = require("../enums/country.enum");
|
|
15
15
|
const language_enum_1 = require("../enums/language.enum");
|
|
16
|
+
/**
|
|
17
|
+
* Data Transfer Object for company data.
|
|
18
|
+
*/
|
|
16
19
|
class CompanyDataDto {
|
|
17
20
|
}
|
|
18
21
|
exports.CompanyDataDto = CompanyDataDto;
|
|
@@ -49,11 +52,11 @@ __decorate([
|
|
|
49
52
|
__metadata("design:type", Array)
|
|
50
53
|
], CompanyDataDto.prototype, "languages", void 0);
|
|
51
54
|
__decorate([
|
|
52
|
-
(0, class_validator_1.
|
|
55
|
+
(0, class_validator_1.IsPhoneNumber)(),
|
|
53
56
|
__metadata("design:type", String)
|
|
54
57
|
], CompanyDataDto.prototype, "telephone", void 0);
|
|
55
58
|
__decorate([
|
|
56
|
-
(0, class_validator_1.
|
|
59
|
+
(0, class_validator_1.IsPhoneNumber)(),
|
|
57
60
|
(0, class_validator_1.IsOptional)(),
|
|
58
61
|
__metadata("design:type", String)
|
|
59
62
|
], CompanyDataDto.prototype, "mobile", void 0);
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* DTO for error response
|
|
3
|
-
* Used to return error information to the client
|
|
2
|
+
* DTO for error response.
|
|
3
|
+
* Used to return detailed error information to the client.
|
|
4
4
|
*/
|
|
5
5
|
export declare class ErrorResponseDto {
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
7
|
+
* A unique and specific error code for programmatic error handling.
|
|
8
|
+
* @example 400
|
|
9
9
|
*/
|
|
10
10
|
code: number;
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
12
|
+
* A developer-friendly error message or an array of messages.
|
|
13
|
+
* This can be a single string for a general error, or an array for multiple validation errors.
|
|
14
|
+
* @example "Validation failed"
|
|
15
|
+
* @example ["email must be an email", "password must be at least 8 characters"]
|
|
14
16
|
*/
|
|
15
17
|
errors?: string[] | string;
|
|
16
18
|
}
|
|
@@ -12,8 +12,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.ErrorResponseDto = void 0;
|
|
13
13
|
const class_validator_1 = require("class-validator");
|
|
14
14
|
/**
|
|
15
|
-
* DTO for error response
|
|
16
|
-
* Used to return error information to the client
|
|
15
|
+
* DTO for error response.
|
|
16
|
+
* Used to return detailed error information to the client.
|
|
17
17
|
*/
|
|
18
18
|
class ErrorResponseDto {
|
|
19
19
|
}
|
package/dist/dtos/field.dto.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { FieldTypeEnum } from '../enums/field-type.enum';
|
|
2
2
|
import { MultilangTextDto } from './multilang-text.dto';
|
|
3
|
+
/**
|
|
4
|
+
* Data Transfer Object for a form field.
|
|
5
|
+
* This class defines the structure and properties of a single field
|
|
6
|
+
* that can be used in a user interface form.
|
|
7
|
+
*/
|
|
3
8
|
export declare class FieldDto {
|
|
4
9
|
/**
|
|
5
10
|
* ID of action field
|
package/dist/dtos/field.dto.js
CHANGED
|
@@ -14,6 +14,11 @@ const class_validator_1 = require("class-validator");
|
|
|
14
14
|
const class_transformer_1 = require("class-transformer");
|
|
15
15
|
const field_type_enum_1 = require("../enums/field-type.enum");
|
|
16
16
|
const multilang_text_dto_1 = require("./multilang-text.dto");
|
|
17
|
+
/**
|
|
18
|
+
* Data Transfer Object for a form field.
|
|
19
|
+
* This class defines the structure and properties of a single field
|
|
20
|
+
* that can be used in a user interface form.
|
|
21
|
+
*/
|
|
17
22
|
class FieldDto {
|
|
18
23
|
constructor() {
|
|
19
24
|
/**
|