@hosterai/types 0.0.25 → 0.0.27

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.
Files changed (162) hide show
  1. package/README.md +49 -8
  2. package/dist/dtos/addon-field.dto.d.ts +7 -0
  3. package/dist/dtos/addon-field.dto.js +11 -0
  4. package/dist/dtos/attachment.dto.js +17 -0
  5. package/dist/dtos/attribute-field.dto.d.ts +19 -0
  6. package/dist/dtos/attribute-field.dto.js +64 -0
  7. package/dist/dtos/base-response.dto.js +11 -0
  8. package/dist/dtos/client-data.dto.js +82 -0
  9. package/dist/dtos/company-data.dto.js +97 -0
  10. package/dist/dtos/country.dto.d.ts +7 -0
  11. package/dist/dtos/country.dto.js +21 -0
  12. package/dist/dtos/error-response.dto.js +15 -0
  13. package/dist/dtos/field.dto.d.ts +8 -13
  14. package/dist/dtos/field.dto.js +22 -47
  15. package/dist/dtos/info.dto.d.ts +0 -5
  16. package/dist/dtos/info.dto.js +0 -19
  17. package/dist/dtos/invoice/invoice-info.dto.d.ts +15 -0
  18. package/dist/dtos/invoice/invoice-info.dto.js +42 -0
  19. package/dist/dtos/invoice/invoice-item-data.dto.d.ts +10 -0
  20. package/dist/dtos/invoice/invoice-item-data.dto.js +34 -0
  21. package/dist/dtos/invoice/requests/credit-note-request.dto.d.ts +9 -0
  22. package/dist/dtos/invoice/requests/credit-note-request.dto.js +32 -0
  23. package/dist/dtos/invoice/requests/invoice-request.dto.d.ts +9 -0
  24. package/dist/dtos/invoice/requests/invoice-request.dto.js +32 -0
  25. package/dist/dtos/invoice/requests/proforma-invoice-request.dto.d.ts +24 -0
  26. package/dist/dtos/invoice/requests/proforma-invoice-request.dto.js +104 -0
  27. package/dist/dtos/invoice/requests/tax-details-request.dto.d.ts +31 -0
  28. package/dist/dtos/invoice/requests/tax-details-request.dto.js +84 -0
  29. package/dist/dtos/invoice/responses/credit-note-response.dto.d.ts +7 -0
  30. package/dist/dtos/invoice/responses/credit-note-response.dto.js +11 -0
  31. package/dist/dtos/invoice/responses/invoice-response.dto.d.ts +7 -0
  32. package/dist/dtos/invoice/responses/invoice-response.dto.js +11 -0
  33. package/dist/dtos/invoice/responses/proforma-invoice-response.dto.d.ts +12 -0
  34. package/dist/dtos/invoice/responses/proforma-invoice-response.dto.js +52 -0
  35. package/dist/dtos/invoice/responses/tax-details-response.dto.d.ts +20 -0
  36. package/dist/dtos/invoice/responses/tax-details-response.dto.js +56 -0
  37. package/dist/dtos/invoice/tin-validation-details.dto.d.ts +51 -0
  38. package/dist/dtos/invoice/tin-validation-details.dto.js +165 -0
  39. package/dist/dtos/invoice/transaction-data.dto.d.ts +14 -0
  40. package/dist/dtos/invoice/transaction-data.dto.js +64 -0
  41. package/dist/dtos/invoice-contact-data.dto.d.ts +43 -0
  42. package/dist/dtos/invoice-contact-data.dto.js +222 -0
  43. package/dist/dtos/item-data.dto.d.ts +44 -0
  44. package/dist/dtos/item-data.dto.js +131 -0
  45. package/dist/dtos/jwt.dto.js +27 -0
  46. package/dist/dtos/multilang-text.dto.js +12 -0
  47. package/dist/dtos/notification/receiver/receiver-email.dto.js +19 -0
  48. package/dist/dtos/notification/receiver/receiver-sms.dto.js +7 -0
  49. package/dist/dtos/notification/requests/notification-send-request.dto.d.ts +18 -0
  50. package/dist/dtos/notification/requests/notification-send-request.dto.js +90 -0
  51. package/dist/dtos/notification/responses/notification-send-response.dto.d.ts +9 -0
  52. package/dist/dtos/notification/responses/notification-send-response.dto.js +32 -0
  53. package/dist/dtos/notification/sender/sender-email.dto.js +26 -0
  54. package/dist/dtos/notification/sender/sender-push.dto.js +36 -0
  55. package/dist/dtos/notification/sender/sender-sms.dto.js +11 -0
  56. package/dist/dtos/product/product-info.dto.d.ts +8 -3
  57. package/dist/dtos/product/product-info.dto.js +25 -5
  58. package/dist/dtos/product/product-item-data.dto.d.ts +7 -28
  59. package/dist/dtos/product/product-item-data.dto.js +14 -23
  60. package/dist/dtos/product/requests/product-create-request.dto.js +11 -0
  61. package/dist/dtos/product/requests/product-delete-request.dto.js +11 -0
  62. package/dist/dtos/product/requests/product-downgradable-request.dto.js +11 -0
  63. package/dist/dtos/product/requests/product-downgrade-request.dto.js +16 -0
  64. package/dist/dtos/product/requests/product-renew-request.dto.js +11 -0
  65. package/dist/dtos/product/requests/product-suspend-request.dto.js +11 -0
  66. package/dist/dtos/product/requests/product-unsuspend-request.dto.js +11 -0
  67. package/dist/dtos/product/requests/product-upgradable-request.dto.js +11 -0
  68. package/dist/dtos/product/requests/product-upgrade-request.dto.js +16 -0
  69. package/dist/dtos/product/responses/product-create-response.dto.js +37 -0
  70. package/dist/dtos/product/responses/product-delete-response.dto.js +37 -0
  71. package/dist/dtos/product/responses/product-downgradable-response.dto.js +37 -0
  72. package/dist/dtos/product/responses/product-downgrade-response.dto.js +37 -0
  73. package/dist/dtos/product/responses/product-info-response.dto.js +23 -0
  74. package/dist/dtos/product/responses/product-renew-response.dto.js +37 -0
  75. package/dist/dtos/product/responses/product-suspend-response.dto.js +37 -0
  76. package/dist/dtos/product/responses/product-unsuspend-response.dto.js +37 -0
  77. package/dist/dtos/product/responses/product-upgradable-response.dto.js +37 -0
  78. package/dist/dtos/product/responses/product-upgrade-response.dto.js +37 -0
  79. package/dist/dtos/requests/validate-attributes-request.dto.js +12 -0
  80. package/dist/dtos/response-data.dto.js +19 -0
  81. package/dist/dtos/responses/validate-attributes-response.dto.js +25 -0
  82. package/dist/dtos/settings.dto.d.ts +18 -0
  83. package/dist/dtos/settings.dto.js +19 -2
  84. package/dist/dtos/setup-status-response.dto.js +20 -0
  85. package/dist/dtos/success-response.dto.d.ts +0 -4
  86. package/dist/dtos/success-response.dto.js +0 -14
  87. package/dist/enums/invoice/invoice-item-actions.enum.d.ts +8 -0
  88. package/dist/enums/invoice/invoice-item-actions.enum.js +12 -0
  89. package/dist/enums/invoice/invoice-types.enum.d.ts +5 -0
  90. package/dist/enums/invoice/invoice-types.enum.js +9 -0
  91. package/dist/enums/item-actions.enum.d.ts +11 -0
  92. package/dist/enums/item-actions.enum.js +16 -0
  93. package/dist/index.d.ts +36 -5
  94. package/dist/index.js +37 -7
  95. package/dist/openapi/schemas/components.schemas.d.ts +152 -49
  96. package/dist/openapi/schemas/components.schemas.js +191 -89
  97. package/dist/validators/addon-field-validator.d.ts +9 -0
  98. package/dist/validators/addon-field-validator.js +14 -0
  99. package/dist/validators/addon-field-validator.spec.d.ts +1 -0
  100. package/dist/validators/addon-field-validator.spec.js +38 -0
  101. package/dist/validators/attachment-validator.d.ts +8 -0
  102. package/dist/validators/attachment-validator.js +17 -0
  103. package/dist/validators/attachment-validator.spec.d.ts +1 -0
  104. package/dist/validators/attachment-validator.spec.js +58 -0
  105. package/dist/validators/attribute-field-validator.d.ts +8 -0
  106. package/dist/validators/attribute-field-validator.js +17 -0
  107. package/dist/validators/attribute-field-validator.spec.d.ts +1 -0
  108. package/dist/validators/attribute-field-validator.spec.js +84 -0
  109. package/dist/validators/country-validator.d.ts +8 -0
  110. package/dist/validators/country-validator.js +17 -0
  111. package/dist/validators/country-validator.spec.d.ts +1 -0
  112. package/dist/validators/country-validator.spec.js +58 -0
  113. package/dist/validators/field-validator.spec.js +1 -29
  114. package/dist/validators/info-validator.d.ts +8 -0
  115. package/dist/validators/info-validator.js +17 -0
  116. package/dist/validators/info-validator.spec.d.ts +1 -0
  117. package/dist/validators/info-validator.spec.js +85 -0
  118. package/dist/validators/invoice-contact-data-validator.d.ts +8 -0
  119. package/dist/validators/invoice-contact-data-validator.js +17 -0
  120. package/dist/validators/invoice-contact-data-validator.spec.d.ts +1 -0
  121. package/dist/validators/invoice-contact-data-validator.spec.js +88 -0
  122. package/dist/validators/invoice-info-validator.d.ts +8 -0
  123. package/dist/validators/invoice-info-validator.js +17 -0
  124. package/dist/validators/invoice-info-validator.spec.d.ts +1 -0
  125. package/dist/validators/invoice-info-validator.spec.js +81 -0
  126. package/dist/validators/invoice-item-data-validator.d.ts +8 -0
  127. package/dist/validators/invoice-item-data-validator.js +17 -0
  128. package/dist/validators/invoice-item-data-validator.spec.d.ts +1 -0
  129. package/dist/validators/invoice-item-data-validator.spec.js +45 -0
  130. package/dist/validators/item-data-validator.d.ts +8 -0
  131. package/dist/validators/item-data-validator.js +17 -0
  132. package/dist/validators/item-data-validator.spec.d.ts +1 -0
  133. package/dist/validators/item-data-validator.spec.js +79 -0
  134. package/dist/validators/notification-info-validator.spec.js +6 -6
  135. package/dist/validators/notification-request-validator.js +2 -2
  136. package/dist/validators/product-create-request-validator.js +1 -1
  137. package/dist/validators/product-delete-request-validator.js +1 -1
  138. package/dist/validators/product-downgradable-request-validator.js +1 -1
  139. package/dist/validators/product-downgrade-request-validator.js +1 -1
  140. package/dist/validators/product-info-validator.spec.js +20 -28
  141. package/dist/validators/product-item-data-validator.d.ts +8 -0
  142. package/dist/validators/product-item-data-validator.js +17 -0
  143. package/dist/validators/product-item-data-validator.spec.d.ts +1 -0
  144. package/dist/validators/product-item-data-validator.spec.js +60 -0
  145. package/dist/validators/product-renew-request-validator.js +1 -1
  146. package/dist/validators/product-suspend-request-validator.js +1 -1
  147. package/dist/validators/product-unsuspend-request-validator.js +1 -1
  148. package/dist/validators/product-upgradable-request-validator.js +1 -1
  149. package/dist/validators/product-upgrade-request-validator.js +1 -1
  150. package/dist/validators/tab-validator.d.ts +8 -0
  151. package/dist/validators/tab-validator.js +17 -0
  152. package/dist/validators/tab-validator.spec.d.ts +1 -0
  153. package/dist/validators/tab-validator.spec.js +49 -0
  154. package/dist/validators/tin-validation-details-validator.d.ts +8 -0
  155. package/dist/validators/tin-validation-details-validator.js +17 -0
  156. package/dist/validators/tin-validation-details-validator.spec.d.ts +1 -0
  157. package/dist/validators/tin-validation-details-validator.spec.js +77 -0
  158. package/dist/validators/transaction-data-validator.d.ts +8 -0
  159. package/dist/validators/transaction-data-validator.js +17 -0
  160. package/dist/validators/transaction-data-validator.spec.d.ts +1 -0
  161. package/dist/validators/transaction-data-validator.spec.js +62 -0
  162. package/package.json +1 -1
package/README.md CHANGED
@@ -61,7 +61,11 @@ DTOs define the shape of data that is exchanged between different parts of the s
61
61
  - `country.dto.ts`: Represents country metadata (name, ISO code, Europe flag).
62
62
  - `error-response.dto.ts`: Defines the structure for error responses.
63
63
  - `field.dto.ts`: Represents a generic field for forms or dynamic data.
64
+ - `attribute-field.dto.ts`: Extends `FieldDto` with product-specific attributes (visibleInOrder, visibleInClientPanel, repeatableMin, repeatableMax).
65
+ - `addon-field.dto.ts`: Extends `FieldDto` for seller-defined checkout fields.
64
66
  - `field-option.dto.ts`: Represents options for form fields (used for checkboxes, radioboxes, and selects).
67
+ - `item-data.dto.ts`: Represents the data of a specific product item (IDs, attributes, dates, pricing).
68
+ - `invoice-contact-data.dto.ts`: Billing contact information for invoice integrations.
65
69
  - `info.dto.ts`: Contains all necessary information for a service integration.
66
70
  - `jwt.dto.ts`: DTOs related to JSON Web Tokens.
67
71
  - `menu.dto.ts`: Defines the structure for menu items.
@@ -74,13 +78,13 @@ DTOs define the shape of data that is exchanged between different parts of the s
74
78
  - `success-response.dto.ts`: Defines the structure for successful API responses.
75
79
  - `tab.dto.ts`: Represents a tab in a user interface.
76
80
  - `submenu.dto.ts`: Represents a submenu item.
77
- - `task-response.dto.ts`: DTO for responses related to background tasks.
78
81
  - `unit.dto.ts`: Represents a unit for pay-per-use billing.
79
82
 
80
83
  **Notification DTOs:**
81
84
 
82
85
  - `notification/notification-info.dto.ts`: Contains detailed information about a notification.
83
- - `notification/notification-send-request.dto.ts`: The primary DTO for requesting a new notification.
86
+ - `notification/requests/notification-send-request.dto.ts`: The primary DTO for requesting a new notification.
87
+ - `notification/responses/notification-send-response.dto.ts`: Response after successfully sending a notification.
84
88
  - `notification/receiver/receiver-email.dto.ts`: Defines the receiver for an email notification.
85
89
  - `notification/receiver/receiver-push.dto.ts`: Defines the receiver for a push notification.
86
90
  - `notification/receiver/receiver-sms.dto.ts`: Defines the receiver for an SMS notification.
@@ -88,21 +92,42 @@ DTOs define the shape of data that is exchanged between different parts of the s
88
92
  - `notification/sender/sender-push.dto.ts`: Defines the sender for a push notification.
89
93
  - `notification/sender/sender-sms.dto.ts`: Defines the sender for an SMS notification.
90
94
 
95
+ **General Request/Response DTOs:**
96
+
97
+ - `requests/validate-attributes-request.dto.ts`: Defines the structure for validating product attributes.
98
+ - `responses/validate-attributes-response.dto.ts`: Response from validating product attributes.
99
+
91
100
  **Product DTOs:**
92
101
 
93
- - `product/product-info.dto.ts`: Contains detailed information about a product.
94
- - `product/product-item-data.dto.ts`: Represents the data of a specific product item.
95
- - `product/requests/product-validate-attributes-request.dto.ts`: Defines the structure for validating product attributes.
96
- - `product/requests/*`: DTOs for product-related requests (create, delete, upgrade, etc.).
102
+ - `product/product-info.dto.ts`: Contains detailed information about a product. Uses `AttributeFieldDto` for product/item attributes.
103
+ - `product/product-item-data.dto.ts`: Extends `ItemDataDto` with product-specific action type.
104
+ - `product/requests/*`: DTOs for product-related requests (create, delete, upgrade, downgrade, renew, suspend, unsuspend, upgradable, downgradable).
97
105
  - `product/responses/*`: DTOs for product-related responses.
98
106
 
107
+ **Invoice DTOs:**
108
+
109
+ - `invoice/invoice-info.dto.ts`: Contains detailed information about an invoice integration.
110
+ - `invoice/invoice-item-data.dto.ts`: Extends `ItemDataDto` with invoice-specific action type.
111
+ - `invoice/transaction-data.dto.ts`: Transaction details (ID, amount, payment method, date).
112
+ - `invoice/tin-validation-details.dto.ts`: Tax Identification Number validation details.
113
+ - `invoice/requests/proforma-invoice-request.dto.ts`: Request payload for creating a proforma invoice.
114
+ - `invoice/requests/invoice-request.dto.ts`: Request payload for creating a standard invoice.
115
+ - `invoice/requests/credit-note-request.dto.ts`: Request payload for creating a credit note.
116
+ - `invoice/requests/tax-details-request.dto.ts`: Request payload for calculating tax details.
117
+ - `invoice/responses/proforma-invoice-response.dto.ts`: Response after creating a proforma invoice.
118
+ - `invoice/responses/invoice-response.dto.ts`: Response after creating a standard invoice.
119
+ - `invoice/responses/credit-note-response.dto.ts`: Response after creating a credit note.
120
+ - `invoice/responses/tax-details-response.dto.ts`: Response with tax calculation details.
121
+
99
122
  ### Enums
100
123
 
101
124
  Enums provide a set of named constants for common types, preventing errors with magic strings.
102
125
 
103
126
  **Key Enums:**
104
127
 
105
- - `ActionsEnum`: Defines possible actions.
128
+ - `ProductItemActionsEnum`: Defines possible product item actions (create, renew, upgrade, downgrade, etc.).
129
+ - `InvoiceItemActionsEnum`: Defines possible invoice item actions (create, renew, upgrade, downgrade, transfer, trade).
130
+ - `InvoiceTypesEnum`: Defines invoice document types (invoice, credit-note, proforma).
106
131
  - `CountryEnum`: A list of all countries.
107
132
  - `DurationEnum`: Defines billing durations (e.g., `MONTHLY`, `YEARLY`).
108
133
  - `EventsEnum`: Defines triggerable events.
@@ -144,7 +169,14 @@ This package includes validation functions that leverage `class-validator` to en
144
169
  - `validateJwtDto`: Validates JWT data.
145
170
  - `validateMultilangTextDto`: Validates multilingual text objects.
146
171
  - `validateUnitDto`: Validates billing unit data.
147
- - `validateAttributesDto`: Validates attributes.
172
+ - `validateAttachmentDto`: Validates file attachments.
173
+ - `validateAttributeFieldDto`: Validates attribute fields.
174
+ - `validateAddonFieldDto`: Validates addon fields.
175
+ - `validateCountryDto`: Validates country data.
176
+ - `validateTabDto`: Validates tab data.
177
+ - `validateItemDataDto`: Validates item data.
178
+ - `validateProductItemDataDto`: Validates product item data.
179
+ - `validateInfoDto`: Validates integration info.
148
180
 
149
181
  **Panel Validators:**
150
182
  - `validateAdminPanelDto`: Validates admin panel configuration.
@@ -164,6 +196,13 @@ This package includes validation functions that leverage `class-validator` to en
164
196
  - `validateEmailReceiverDto`, `validateSmsReceiverDto`, `validatePushReceiverDto`: Validators for notification receivers.
165
197
  - `validateEmailSenderDto`, `validateSmsSenderDto`, `validatePushSenderDto`: Validators for notification senders.
166
198
 
199
+ **Invoice Validators:**
200
+ - `validateInvoiceInfoDto`: Validates invoice integration info.
201
+ - `validateInvoiceContactDataDto`: Validates invoice contact data.
202
+ - `validateInvoiceItemDataDto`: Validates invoice item data.
203
+ - `validateTinValidationDetailsDto`: Validates TIN validation details.
204
+ - `validateTransactionDataDto`: Validates transaction data.
205
+
167
206
  **Product Validators:**
168
207
  - `validateProductInfoDto`: Validates product information.
169
208
  - `validateProductCreateRequestDto`: Validates product creation requests.
@@ -174,6 +213,8 @@ This package includes validation functions that leverage `class-validator` to en
174
213
  - `validateProductSuspendRequestDto`: Validates product suspension requests.
175
214
  - `validateProductUnsuspendRequestDto`: Validates product unsuspension requests.
176
215
  - `validateProductUpgradableRequestDto`: Validates product upgradability checks.
216
+ - `validateProductDowngradableRequestDto`: Validates product downgradability checks.
217
+ - `validateValidateAttributesRequestDto`: Validates attribute validation requests.
177
218
 
178
219
 
179
220
  ### Custom Decorators
@@ -0,0 +1,7 @@
1
+ import { FieldDto } from "./field.dto";
2
+ /**
3
+ * Fields defined by the seller for a product, requested during checkout setup.
4
+ * These fields contain information relevant only to the seller, not to the integration.
5
+ */
6
+ export declare class AddonFieldDto extends FieldDto {
7
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AddonFieldDto = void 0;
4
+ const field_dto_1 = require("./field.dto");
5
+ /**
6
+ * Fields defined by the seller for a product, requested during checkout setup.
7
+ * These fields contain information relevant only to the seller, not to the integration.
8
+ */
9
+ class AddonFieldDto extends field_dto_1.FieldDto {
10
+ }
11
+ exports.AddonFieldDto = AddonFieldDto;
@@ -11,6 +11,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.AttachmentDto = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
+ const class_validator_jsonschema_1 = require("class-validator-jsonschema");
14
15
  /**
15
16
  * DTO for file attachments
16
17
  * Used for sending attached files with emails
@@ -21,16 +22,32 @@ exports.AttachmentDto = AttachmentDto;
21
22
  __decorate([
22
23
  (0, class_validator_1.IsNotEmpty)(),
23
24
  (0, class_validator_1.IsString)(),
25
+ (0, class_validator_jsonschema_1.JSONSchema)({
26
+ title: 'Filename',
27
+ description: 'The name of the attached file.',
28
+ type: 'string',
29
+ }),
24
30
  __metadata("design:type", String)
25
31
  ], AttachmentDto.prototype, "filename", void 0);
26
32
  __decorate([
27
33
  (0, class_validator_1.IsNotEmpty)(),
28
34
  (0, class_validator_1.IsString)(),
29
35
  (0, class_validator_1.IsBase64)(),
36
+ (0, class_validator_jsonschema_1.JSONSchema)({
37
+ title: 'Content',
38
+ description: 'The content of the file in Base64 encoding.',
39
+ type: 'string',
40
+ format: 'byte',
41
+ }),
30
42
  __metadata("design:type", String)
31
43
  ], AttachmentDto.prototype, "content", void 0);
32
44
  __decorate([
33
45
  (0, class_validator_1.IsOptional)(),
34
46
  (0, class_validator_1.IsString)(),
47
+ (0, class_validator_jsonschema_1.JSONSchema)({
48
+ title: 'Content Type',
49
+ description: 'The content type of the file (MIME type).',
50
+ type: 'string',
51
+ }),
35
52
  __metadata("design:type", String)
36
53
  ], AttachmentDto.prototype, "contentType", void 0);
@@ -0,0 +1,19 @@
1
+ import { FieldDto } from "./field.dto";
2
+ export declare class AttributeFieldDto extends FieldDto {
3
+ /**
4
+ * Indicates if the field is visible in orders
5
+ */
6
+ visibleInOrder?: boolean;
7
+ /**
8
+ * Indicates if the field is visible in client panel
9
+ */
10
+ visibleInClientPanel?: boolean;
11
+ /**
12
+ * Minimum repeats for repeatable fields
13
+ */
14
+ repeatableMin?: number;
15
+ /**
16
+ * Maximum repeats for repeatable fields
17
+ */
18
+ repeatableMax?: number;
19
+ }
@@ -0,0 +1,64 @@
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.AttributeFieldDto = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ const class_validator_jsonschema_1 = require("class-validator-jsonschema");
15
+ const field_dto_1 = require("./field.dto");
16
+ const all_or_none_validator_1 = require("../decorators/all-or-none.validator");
17
+ const min_less_or_equal_validator_1 = require("../decorators/min-less-or-equal.validator");
18
+ let AttributeFieldDto = class AttributeFieldDto extends field_dto_1.FieldDto {
19
+ };
20
+ exports.AttributeFieldDto = AttributeFieldDto;
21
+ __decorate([
22
+ (0, class_validator_1.IsBoolean)(),
23
+ (0, class_validator_1.IsOptional)(),
24
+ (0, class_validator_jsonschema_1.JSONSchema)({
25
+ title: 'Visible In Order',
26
+ description: 'Whether the field is visible in order view.',
27
+ type: 'boolean',
28
+ }),
29
+ __metadata("design:type", Boolean)
30
+ ], AttributeFieldDto.prototype, "visibleInOrder", void 0);
31
+ __decorate([
32
+ (0, class_validator_1.IsBoolean)(),
33
+ (0, class_validator_1.IsOptional)(),
34
+ (0, class_validator_jsonschema_1.JSONSchema)({
35
+ title: 'Visible In Client Panel',
36
+ description: 'Whether the field is visible in the client panel.',
37
+ type: 'boolean',
38
+ }),
39
+ __metadata("design:type", Boolean)
40
+ ], AttributeFieldDto.prototype, "visibleInClientPanel", void 0);
41
+ __decorate([
42
+ (0, class_validator_1.IsOptional)(),
43
+ (0, class_validator_1.IsNumber)(),
44
+ (0, class_validator_jsonschema_1.JSONSchema)({
45
+ title: 'Repeatable Min',
46
+ description: 'Minimum repeats for repeatable fields.',
47
+ type: 'number',
48
+ }),
49
+ __metadata("design:type", Number)
50
+ ], AttributeFieldDto.prototype, "repeatableMin", void 0);
51
+ __decorate([
52
+ (0, class_validator_1.IsOptional)(),
53
+ (0, class_validator_1.IsNumber)(),
54
+ (0, class_validator_jsonschema_1.JSONSchema)({
55
+ title: 'Repeatable Max',
56
+ description: 'Maximum repeats for repeatable fields.',
57
+ type: 'number',
58
+ }),
59
+ __metadata("design:type", Number)
60
+ ], AttributeFieldDto.prototype, "repeatableMax", void 0);
61
+ exports.AttributeFieldDto = AttributeFieldDto = __decorate([
62
+ (0, all_or_none_validator_1.AllOrNoneProperty)(['repeatableMin', 'repeatableMax']),
63
+ (0, min_less_or_equal_validator_1.MinLessOrEqualMaxProperty)(['repeatableMin', 'repeatableMax'])
64
+ ], AttributeFieldDto);
@@ -11,6 +11,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.BaseResponse = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
+ const class_validator_jsonschema_1 = require("class-validator-jsonschema");
14
15
  /**
15
16
  * Base response class
16
17
  * Used as a foundation for all API responses
@@ -21,10 +22,20 @@ exports.BaseResponse = BaseResponse;
21
22
  __decorate([
22
23
  (0, class_validator_1.IsNumber)(),
23
24
  (0, class_validator_1.IsNotEmpty)(),
25
+ (0, class_validator_jsonschema_1.JSONSchema)({
26
+ title: 'Code',
27
+ description: 'Response code.',
28
+ type: 'number',
29
+ }),
24
30
  __metadata("design:type", Number)
25
31
  ], BaseResponse.prototype, "code", void 0);
26
32
  __decorate([
27
33
  (0, class_validator_1.IsString)(),
28
34
  (0, class_validator_1.IsNotEmpty)(),
35
+ (0, class_validator_jsonschema_1.JSONSchema)({
36
+ title: 'Message',
37
+ description: 'Response message.',
38
+ type: 'string',
39
+ }),
29
40
  __metadata("design:type", String)
30
41
  ], BaseResponse.prototype, "message", void 0);
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.ClientDataDto = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
14
  const country_enum_1 = require("../enums/country.enum");
15
+ const class_validator_jsonschema_1 = require("class-validator-jsonschema");
15
16
  /**
16
17
  * Defines the data structure for a client.
17
18
  * This object is used to transfer client data between different parts of the application.
@@ -22,16 +23,32 @@ exports.ClientDataDto = ClientDataDto;
22
23
  __decorate([
23
24
  (0, class_validator_1.IsDefined)(),
24
25
  (0, class_validator_1.IsEmail)(),
26
+ (0, class_validator_jsonschema_1.JSONSchema)({
27
+ title: 'Email',
28
+ description: 'Email of the user.',
29
+ type: 'string',
30
+ format: 'email',
31
+ }),
25
32
  __metadata("design:type", String)
26
33
  ], ClientDataDto.prototype, "email", void 0);
27
34
  __decorate([
28
35
  (0, class_validator_1.IsDefined)(),
29
36
  (0, class_validator_1.IsString)(),
37
+ (0, class_validator_jsonschema_1.JSONSchema)({
38
+ title: 'First Name',
39
+ description: 'First name of the user.',
40
+ type: 'string',
41
+ }),
30
42
  __metadata("design:type", String)
31
43
  ], ClientDataDto.prototype, "firstName", void 0);
32
44
  __decorate([
33
45
  (0, class_validator_1.IsDefined)(),
34
46
  (0, class_validator_1.IsString)(),
47
+ (0, class_validator_jsonschema_1.JSONSchema)({
48
+ title: 'Last Name',
49
+ description: 'Last name of the user.',
50
+ type: 'string',
51
+ }),
35
52
  __metadata("design:type", String)
36
53
  ], ClientDataDto.prototype, "lastName", void 0);
37
54
  __decorate([
@@ -39,11 +56,21 @@ __decorate([
39
56
  (0, class_validator_1.IsNotEmpty)(),
40
57
  (0, class_validator_1.IsString)(),
41
58
  (0, class_validator_1.IsPhoneNumber)(),
59
+ (0, class_validator_jsonschema_1.JSONSchema)({
60
+ title: 'Telephone',
61
+ description: 'Telephone number of the user.',
62
+ type: 'string',
63
+ }),
42
64
  __metadata("design:type", String)
43
65
  ], ClientDataDto.prototype, "telephone", void 0);
44
66
  __decorate([
45
67
  (0, class_validator_1.IsOptional)(),
46
68
  (0, class_validator_1.IsPhoneNumber)(),
69
+ (0, class_validator_jsonschema_1.JSONSchema)({
70
+ title: 'Mobile',
71
+ description: 'Mobile number of the user.',
72
+ type: 'string',
73
+ }),
47
74
  __metadata("design:type", String)
48
75
  ], ClientDataDto.prototype, "mobile", void 0);
49
76
  __decorate([
@@ -52,18 +79,37 @@ __decorate([
52
79
  (0, class_validator_1.IsString)(),
53
80
  (0, class_validator_1.MinLength)(1),
54
81
  (0, class_validator_1.MaxLength)(250),
82
+ (0, class_validator_jsonschema_1.JSONSchema)({
83
+ title: 'Address Line 1',
84
+ description: 'Address line 1 of the user.',
85
+ type: 'string',
86
+ minLength: 1,
87
+ maxLength: 250,
88
+ }),
55
89
  __metadata("design:type", String)
56
90
  ], ClientDataDto.prototype, "address1", void 0);
57
91
  __decorate([
58
92
  (0, class_validator_1.IsOptional)(),
59
93
  (0, class_validator_1.MinLength)(0),
60
94
  (0, class_validator_1.MaxLength)(250),
95
+ (0, class_validator_jsonschema_1.JSONSchema)({
96
+ title: 'Address Line 2',
97
+ description: 'Address line 2 of the user.',
98
+ type: 'string',
99
+ maxLength: 250,
100
+ }),
61
101
  __metadata("design:type", String)
62
102
  ], ClientDataDto.prototype, "address2", void 0);
63
103
  __decorate([
64
104
  (0, class_validator_1.IsOptional)(),
65
105
  (0, class_validator_1.MinLength)(0),
66
106
  (0, class_validator_1.MaxLength)(250),
107
+ (0, class_validator_jsonschema_1.JSONSchema)({
108
+ title: 'Address Line 3',
109
+ description: 'Address line 3 of the user.',
110
+ type: 'string',
111
+ maxLength: 250,
112
+ }),
67
113
  __metadata("design:type", String)
68
114
  ], ClientDataDto.prototype, "address3", void 0);
69
115
  __decorate([
@@ -72,6 +118,13 @@ __decorate([
72
118
  (0, class_validator_1.IsString)(),
73
119
  (0, class_validator_1.MinLength)(1),
74
120
  (0, class_validator_1.MaxLength)(16),
121
+ (0, class_validator_jsonschema_1.JSONSchema)({
122
+ title: 'Postcode',
123
+ description: 'Postal code of the user.',
124
+ type: 'string',
125
+ minLength: 1,
126
+ maxLength: 16,
127
+ }),
75
128
  __metadata("design:type", String)
76
129
  ], ClientDataDto.prototype, "postcode", void 0);
77
130
  __decorate([
@@ -80,27 +133,56 @@ __decorate([
80
133
  (0, class_validator_1.IsString)(),
81
134
  (0, class_validator_1.MinLength)(1),
82
135
  (0, class_validator_1.MaxLength)(250),
136
+ (0, class_validator_jsonschema_1.JSONSchema)({
137
+ title: 'City',
138
+ description: 'City of the user.',
139
+ type: 'string',
140
+ minLength: 1,
141
+ maxLength: 250,
142
+ }),
83
143
  __metadata("design:type", String)
84
144
  ], ClientDataDto.prototype, "city", void 0);
85
145
  __decorate([
86
146
  (0, class_validator_1.IsDefined)(),
87
147
  (0, class_validator_1.IsNotEmpty)(),
88
148
  (0, class_validator_1.IsEnum)(country_enum_1.CountryEnum),
149
+ (0, class_validator_jsonschema_1.JSONSchema)({
150
+ title: 'Country',
151
+ description: 'Country code of the user.',
152
+ type: 'string',
153
+ enum: Object.values(country_enum_1.CountryEnum),
154
+ }),
89
155
  __metadata("design:type", String)
90
156
  ], ClientDataDto.prototype, "country", void 0);
91
157
  __decorate([
92
158
  (0, class_validator_1.IsOptional)(),
93
159
  (0, class_validator_1.MinLength)(0),
94
160
  (0, class_validator_1.MaxLength)(250),
161
+ (0, class_validator_jsonschema_1.JSONSchema)({
162
+ title: 'State',
163
+ description: 'State of the user.',
164
+ type: 'string',
165
+ maxLength: 250,
166
+ }),
95
167
  __metadata("design:type", String)
96
168
  ], ClientDataDto.prototype, "state", void 0);
97
169
  __decorate([
98
170
  (0, class_validator_1.IsOptional)(),
99
171
  (0, class_validator_1.IsString)(),
172
+ (0, class_validator_jsonschema_1.JSONSchema)({
173
+ title: 'VAT',
174
+ description: 'VAT number of the user.',
175
+ type: 'string',
176
+ }),
100
177
  __metadata("design:type", String)
101
178
  ], ClientDataDto.prototype, "vat", void 0);
102
179
  __decorate([
103
180
  (0, class_validator_1.IsOptional)(),
104
181
  (0, class_validator_1.IsString)(),
182
+ (0, class_validator_jsonschema_1.JSONSchema)({
183
+ title: 'Tax Office',
184
+ description: 'Tax office of the user.',
185
+ type: 'string',
186
+ }),
105
187
  __metadata("design:type", String)
106
188
  ], ClientDataDto.prototype, "taxOffice", void 0);
@@ -13,6 +13,7 @@ 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
+ const class_validator_jsonschema_1 = require("class-validator-jsonschema");
16
17
  /**
17
18
  * Data Transfer Object for company data.
18
19
  */
@@ -22,82 +23,178 @@ exports.CompanyDataDto = CompanyDataDto;
22
23
  __decorate([
23
24
  (0, class_validator_1.IsString)(),
24
25
  (0, class_validator_1.IsNotEmpty)(),
26
+ (0, class_validator_jsonschema_1.JSONSchema)({
27
+ title: 'ID',
28
+ description: 'The unique identifier for the company.',
29
+ type: 'string',
30
+ }),
25
31
  __metadata("design:type", String)
26
32
  ], CompanyDataDto.prototype, "id", void 0);
27
33
  __decorate([
28
34
  (0, class_validator_1.IsString)(),
29
35
  (0, class_validator_1.IsNotEmpty)(),
36
+ (0, class_validator_jsonschema_1.JSONSchema)({
37
+ title: 'Name',
38
+ description: 'The name of the company.',
39
+ type: 'string',
40
+ }),
30
41
  __metadata("design:type", String)
31
42
  ], CompanyDataDto.prototype, "name", void 0);
32
43
  __decorate([
33
44
  (0, class_validator_1.IsEmail)({}, { each: true }),
34
45
  (0, class_validator_1.IsArray)(),
46
+ (0, class_validator_jsonschema_1.JSONSchema)({
47
+ title: 'Emails',
48
+ description: 'Email addresses associated with the company.',
49
+ type: 'array',
50
+ items: { type: 'string', format: 'email' },
51
+ }),
35
52
  __metadata("design:type", Array)
36
53
  ], CompanyDataDto.prototype, "emails", void 0);
37
54
  __decorate([
38
55
  (0, class_validator_1.IsEmail)(),
56
+ (0, class_validator_jsonschema_1.JSONSchema)({
57
+ title: 'Invoice Email',
58
+ description: 'The email address used for invoicing.',
59
+ type: 'string',
60
+ format: 'email',
61
+ }),
39
62
  __metadata("design:type", String)
40
63
  ], CompanyDataDto.prototype, "invoiceEmail", void 0);
41
64
  __decorate([
42
65
  (0, class_validator_1.IsUrl)({ protocols: ['https'], require_protocol: true }),
66
+ (0, class_validator_jsonschema_1.JSONSchema)({
67
+ title: 'Privacy Policy URL',
68
+ description: 'The URL for the company\'s privacy policy.',
69
+ type: 'string',
70
+ format: 'uri',
71
+ }),
43
72
  __metadata("design:type", String)
44
73
  ], CompanyDataDto.prototype, "privacyPolicyUrl", void 0);
45
74
  __decorate([
46
75
  (0, class_validator_1.IsEnum)(language_enum_1.LanguageEnum),
76
+ (0, class_validator_jsonschema_1.JSONSchema)({
77
+ title: 'Default Language',
78
+ description: 'The default language for the company.',
79
+ type: 'string',
80
+ enum: Object.values(language_enum_1.LanguageEnum),
81
+ }),
47
82
  __metadata("design:type", String)
48
83
  ], CompanyDataDto.prototype, "defaultLanguage", void 0);
49
84
  __decorate([
50
85
  (0, class_validator_1.IsEnum)(language_enum_1.LanguageEnum, { each: true }),
51
86
  (0, class_validator_1.IsArray)(),
87
+ (0, class_validator_jsonschema_1.JSONSchema)({
88
+ title: 'Languages',
89
+ description: 'Supported languages for the company.',
90
+ type: 'array',
91
+ items: { type: 'string', enum: Object.values(language_enum_1.LanguageEnum) },
92
+ }),
52
93
  __metadata("design:type", Array)
53
94
  ], CompanyDataDto.prototype, "languages", void 0);
54
95
  __decorate([
55
96
  (0, class_validator_1.IsPhoneNumber)(),
97
+ (0, class_validator_jsonschema_1.JSONSchema)({
98
+ title: 'Telephone',
99
+ description: 'The primary telephone number for the company.',
100
+ type: 'string',
101
+ }),
56
102
  __metadata("design:type", String)
57
103
  ], CompanyDataDto.prototype, "telephone", void 0);
58
104
  __decorate([
59
105
  (0, class_validator_1.IsPhoneNumber)(),
60
106
  (0, class_validator_1.IsOptional)(),
107
+ (0, class_validator_jsonschema_1.JSONSchema)({
108
+ title: 'Mobile',
109
+ description: 'The mobile phone number for the company.',
110
+ type: 'string',
111
+ }),
61
112
  __metadata("design:type", String)
62
113
  ], CompanyDataDto.prototype, "mobile", void 0);
63
114
  __decorate([
64
115
  (0, class_validator_1.IsString)(),
116
+ (0, class_validator_jsonschema_1.JSONSchema)({
117
+ title: 'Address Line 1',
118
+ description: 'The first line of the company\'s address.',
119
+ type: 'string',
120
+ }),
65
121
  __metadata("design:type", String)
66
122
  ], CompanyDataDto.prototype, "address1", void 0);
67
123
  __decorate([
68
124
  (0, class_validator_1.IsString)(),
69
125
  (0, class_validator_1.IsOptional)(),
126
+ (0, class_validator_jsonschema_1.JSONSchema)({
127
+ title: 'Address Line 2',
128
+ description: 'The second line of the company\'s address.',
129
+ type: 'string',
130
+ }),
70
131
  __metadata("design:type", String)
71
132
  ], CompanyDataDto.prototype, "address2", void 0);
72
133
  __decorate([
73
134
  (0, class_validator_1.IsString)(),
74
135
  (0, class_validator_1.IsOptional)(),
136
+ (0, class_validator_jsonschema_1.JSONSchema)({
137
+ title: 'Address Line 3',
138
+ description: 'The third line of the company\'s address.',
139
+ type: 'string',
140
+ }),
75
141
  __metadata("design:type", String)
76
142
  ], CompanyDataDto.prototype, "address3", void 0);
77
143
  __decorate([
78
144
  (0, class_validator_1.IsString)(),
145
+ (0, class_validator_jsonschema_1.JSONSchema)({
146
+ title: 'Postcode',
147
+ description: 'The postal code for the company\'s address.',
148
+ type: 'string',
149
+ }),
79
150
  __metadata("design:type", String)
80
151
  ], CompanyDataDto.prototype, "postcode", void 0);
81
152
  __decorate([
82
153
  (0, class_validator_1.IsString)(),
154
+ (0, class_validator_jsonschema_1.JSONSchema)({
155
+ title: 'City',
156
+ description: 'The city for the company\'s address.',
157
+ type: 'string',
158
+ }),
83
159
  __metadata("design:type", String)
84
160
  ], CompanyDataDto.prototype, "city", void 0);
85
161
  __decorate([
86
162
  (0, class_validator_1.IsEnum)(country_enum_1.CountryEnum),
163
+ (0, class_validator_jsonschema_1.JSONSchema)({
164
+ title: 'Country',
165
+ description: 'The country for the company\'s address.',
166
+ type: 'string',
167
+ enum: Object.values(country_enum_1.CountryEnum),
168
+ }),
87
169
  __metadata("design:type", String)
88
170
  ], CompanyDataDto.prototype, "country", void 0);
89
171
  __decorate([
90
172
  (0, class_validator_1.IsString)(),
91
173
  (0, class_validator_1.IsOptional)(),
174
+ (0, class_validator_jsonschema_1.JSONSchema)({
175
+ title: 'State',
176
+ description: 'The state or province for the company\'s address.',
177
+ type: 'string',
178
+ }),
92
179
  __metadata("design:type", String)
93
180
  ], CompanyDataDto.prototype, "state", void 0);
94
181
  __decorate([
95
182
  (0, class_validator_1.IsString)(),
96
183
  (0, class_validator_1.IsOptional)(),
184
+ (0, class_validator_jsonschema_1.JSONSchema)({
185
+ title: 'VAT',
186
+ description: 'The VAT number for the company.',
187
+ type: 'string',
188
+ }),
97
189
  __metadata("design:type", String)
98
190
  ], CompanyDataDto.prototype, "vat", void 0);
99
191
  __decorate([
100
192
  (0, class_validator_1.IsString)(),
101
193
  (0, class_validator_1.IsOptional)(),
194
+ (0, class_validator_jsonschema_1.JSONSchema)({
195
+ title: 'Tax Office',
196
+ description: 'The tax office for the company.',
197
+ type: 'string',
198
+ }),
102
199
  __metadata("design:type", String)
103
200
  ], CompanyDataDto.prototype, "taxOffice", void 0);
@@ -1,6 +1,13 @@
1
1
  import { CountryEnum } from '../enums/country.enum';
2
+ /**
3
+ * Country information returned by the hoster.ai helper function.
4
+ * Used to provide a list of all available countries.
5
+ */
2
6
  export declare class CountryDto {
7
+ /** Country name */
3
8
  name: string;
9
+ /** Country code */
4
10
  code: CountryEnum;
11
+ /** Whether the country is in Europe */
5
12
  isEurope?: boolean;
6
13
  }