@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
@@ -0,0 +1,222 @@
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.InvoiceContactData = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ const country_enum_1 = require("../enums/country.enum");
15
+ const class_validator_jsonschema_1 = require("class-validator-jsonschema");
16
+ /**
17
+ * Billing contact information sent from hoster.ai to invoice integrations.
18
+ * Contains the details of the person or business for whom an invoice will be issued.
19
+ */
20
+ class InvoiceContactData {
21
+ }
22
+ exports.InvoiceContactData = InvoiceContactData;
23
+ __decorate([
24
+ (0, class_validator_1.IsString)(),
25
+ (0, class_validator_1.IsNotEmpty)(),
26
+ (0, class_validator_jsonschema_1.JSONSchema)({
27
+ title: 'Invoice Contact ID',
28
+ description: 'Unique identifier for the invoice contact.',
29
+ type: 'string',
30
+ }),
31
+ __metadata("design:type", String)
32
+ ], InvoiceContactData.prototype, "invoiceContactId", void 0);
33
+ __decorate([
34
+ (0, class_validator_1.IsBoolean)(),
35
+ (0, class_validator_1.IsNotEmpty)(),
36
+ (0, class_validator_jsonschema_1.JSONSchema)({
37
+ title: 'Is Business Contact',
38
+ description: 'Whether this is a business contact or individual person.',
39
+ type: 'boolean',
40
+ }),
41
+ __metadata("design:type", Boolean)
42
+ ], InvoiceContactData.prototype, "isBusinessContact", void 0);
43
+ __decorate([
44
+ (0, class_validator_1.IsString)(),
45
+ (0, class_validator_1.IsNotEmpty)(),
46
+ (0, class_validator_jsonschema_1.JSONSchema)({
47
+ title: 'First Name',
48
+ description: 'Contact\'s first name.',
49
+ type: 'string',
50
+ }),
51
+ __metadata("design:type", String)
52
+ ], InvoiceContactData.prototype, "firstName", void 0);
53
+ __decorate([
54
+ (0, class_validator_1.IsString)(),
55
+ (0, class_validator_1.IsNotEmpty)(),
56
+ (0, class_validator_jsonschema_1.JSONSchema)({
57
+ title: 'Last Name',
58
+ description: 'Contact\'s last name.',
59
+ type: 'string',
60
+ }),
61
+ __metadata("design:type", String)
62
+ ], InvoiceContactData.prototype, "lastName", void 0);
63
+ __decorate([
64
+ (0, class_validator_1.IsString)(),
65
+ (0, class_validator_1.IsOptional)(),
66
+ (0, class_validator_jsonschema_1.JSONSchema)({
67
+ title: 'Business Name',
68
+ description: 'Business name (required when isBusinessContact is true).',
69
+ type: 'string',
70
+ }),
71
+ __metadata("design:type", String)
72
+ ], InvoiceContactData.prototype, "businessName", void 0);
73
+ __decorate([
74
+ (0, class_validator_1.IsEmail)(),
75
+ (0, class_validator_1.IsNotEmpty)(),
76
+ (0, class_validator_jsonschema_1.JSONSchema)({
77
+ title: 'Email',
78
+ description: 'Contact\'s email address.',
79
+ type: 'string',
80
+ format: 'email',
81
+ }),
82
+ __metadata("design:type", String)
83
+ ], InvoiceContactData.prototype, "email", void 0);
84
+ __decorate([
85
+ (0, class_validator_1.IsPhoneNumber)(),
86
+ (0, class_validator_1.IsNotEmpty)(),
87
+ (0, class_validator_jsonschema_1.JSONSchema)({
88
+ title: 'Telephone',
89
+ description: 'Primary telephone number in international format.',
90
+ type: 'string',
91
+ }),
92
+ __metadata("design:type", String)
93
+ ], InvoiceContactData.prototype, "telephone", void 0);
94
+ __decorate([
95
+ (0, class_validator_1.IsPhoneNumber)(),
96
+ (0, class_validator_1.IsOptional)(),
97
+ (0, class_validator_jsonschema_1.JSONSchema)({
98
+ title: 'Mobile',
99
+ description: 'Mobile phone number in international format.',
100
+ type: 'string',
101
+ }),
102
+ __metadata("design:type", String)
103
+ ], InvoiceContactData.prototype, "mobile", void 0);
104
+ __decorate([
105
+ (0, class_validator_1.IsString)(),
106
+ (0, class_validator_1.IsNotEmpty)(),
107
+ (0, class_validator_1.MinLength)(1),
108
+ (0, class_validator_1.MaxLength)(250),
109
+ (0, class_validator_jsonschema_1.JSONSchema)({
110
+ title: 'Address Line 1',
111
+ description: 'Primary address line (street, number).',
112
+ type: 'string',
113
+ minLength: 1,
114
+ maxLength: 250,
115
+ }),
116
+ __metadata("design:type", String)
117
+ ], InvoiceContactData.prototype, "address1", void 0);
118
+ __decorate([
119
+ (0, class_validator_1.IsString)(),
120
+ (0, class_validator_1.IsOptional)(),
121
+ (0, class_validator_1.MaxLength)(250),
122
+ (0, class_validator_jsonschema_1.JSONSchema)({
123
+ title: 'Address Line 2',
124
+ description: 'Secondary address line (building, floor, apartment).',
125
+ type: 'string',
126
+ maxLength: 250,
127
+ }),
128
+ __metadata("design:type", String)
129
+ ], InvoiceContactData.prototype, "address2", void 0);
130
+ __decorate([
131
+ (0, class_validator_1.IsString)(),
132
+ (0, class_validator_1.IsOptional)(),
133
+ (0, class_validator_1.MaxLength)(250),
134
+ (0, class_validator_jsonschema_1.JSONSchema)({
135
+ title: 'Address Line 3',
136
+ description: 'Additional address information.',
137
+ type: 'string',
138
+ maxLength: 250,
139
+ }),
140
+ __metadata("design:type", String)
141
+ ], InvoiceContactData.prototype, "address3", void 0);
142
+ __decorate([
143
+ (0, class_validator_1.IsString)(),
144
+ (0, class_validator_1.IsNotEmpty)(),
145
+ (0, class_validator_1.MinLength)(1),
146
+ (0, class_validator_1.MaxLength)(16),
147
+ (0, class_validator_jsonschema_1.JSONSchema)({
148
+ title: 'Postcode',
149
+ description: 'Postal/ZIP code.',
150
+ type: 'string',
151
+ minLength: 1,
152
+ maxLength: 16,
153
+ }),
154
+ __metadata("design:type", String)
155
+ ], InvoiceContactData.prototype, "postcode", void 0);
156
+ __decorate([
157
+ (0, class_validator_1.IsString)(),
158
+ (0, class_validator_1.IsNotEmpty)(),
159
+ (0, class_validator_1.MinLength)(1),
160
+ (0, class_validator_1.MaxLength)(250),
161
+ (0, class_validator_jsonschema_1.JSONSchema)({
162
+ title: 'City',
163
+ description: 'City name.',
164
+ type: 'string',
165
+ minLength: 1,
166
+ maxLength: 250,
167
+ }),
168
+ __metadata("design:type", String)
169
+ ], InvoiceContactData.prototype, "city", void 0);
170
+ __decorate([
171
+ (0, class_validator_1.IsEnum)(country_enum_1.CountryEnum),
172
+ (0, class_validator_1.IsNotEmpty)(),
173
+ (0, class_validator_jsonschema_1.JSONSchema)({
174
+ title: 'Country',
175
+ description: 'Country code.',
176
+ type: 'string',
177
+ enum: Object.values(country_enum_1.CountryEnum),
178
+ }),
179
+ __metadata("design:type", String)
180
+ ], InvoiceContactData.prototype, "country", void 0);
181
+ __decorate([
182
+ (0, class_validator_1.IsString)(),
183
+ (0, class_validator_1.IsOptional)(),
184
+ (0, class_validator_1.MaxLength)(250),
185
+ (0, class_validator_jsonschema_1.JSONSchema)({
186
+ title: 'State',
187
+ description: 'State/province/region.',
188
+ type: 'string',
189
+ maxLength: 250,
190
+ }),
191
+ __metadata("design:type", String)
192
+ ], InvoiceContactData.prototype, "state", void 0);
193
+ __decorate([
194
+ (0, class_validator_1.IsString)(),
195
+ (0, class_validator_1.IsOptional)(),
196
+ (0, class_validator_jsonschema_1.JSONSchema)({
197
+ title: 'TIN',
198
+ description: 'Tax Identification Number (TIN/VAT number).',
199
+ type: 'string',
200
+ }),
201
+ __metadata("design:type", String)
202
+ ], InvoiceContactData.prototype, "tin", void 0);
203
+ __decorate([
204
+ (0, class_validator_1.IsString)(),
205
+ (0, class_validator_1.IsOptional)(),
206
+ (0, class_validator_jsonschema_1.JSONSchema)({
207
+ title: 'Tax Office',
208
+ description: 'Tax office name or code.',
209
+ type: 'string',
210
+ }),
211
+ __metadata("design:type", String)
212
+ ], InvoiceContactData.prototype, "taxOffice", void 0);
213
+ __decorate([
214
+ (0, class_validator_1.IsString)(),
215
+ (0, class_validator_1.IsOptional)(),
216
+ (0, class_validator_jsonschema_1.JSONSchema)({
217
+ title: 'Profession',
218
+ description: 'Contact\'s profession or business activity.',
219
+ type: 'string',
220
+ }),
221
+ __metadata("design:type", String)
222
+ ], InvoiceContactData.prototype, "profession", void 0);
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Represents the data of a specific product item.
3
+ * This DTO is used to transfer detailed information about a product instance.
4
+ */
5
+ export declare class ItemDataDto {
6
+ /**
7
+ * The unique identifier for the product item.
8
+ */
9
+ itemId?: string;
10
+ /** Unique identifier for the product */
11
+ productId: string;
12
+ /** Name of the product */
13
+ productName: string;
14
+ /** Resource name associated with the product */
15
+ resourceName: string;
16
+ /**
17
+ * A record of product-level attributes.
18
+ * These are general attributes defined for the product type.
19
+ */
20
+ productAttributes: Record<string, unknown>;
21
+ /**
22
+ * A record of item-specific attributes.
23
+ * These are attributes that are unique to this particular instance of the product.
24
+ */
25
+ itemAttributes: Record<string, unknown>;
26
+ /**
27
+ * Data returned from the creation response.
28
+ * This field should not be present in the create request.
29
+ * @optional
30
+ */
31
+ creationResponseData?: Record<string, unknown>;
32
+ /** Start date of the product item */
33
+ startDate: string;
34
+ /** End date of the product item */
35
+ endDate: string;
36
+ /**
37
+ * The price of the product item without tax and discount.
38
+ */
39
+ price?: number;
40
+ /**
41
+ * The discount of the product item. The price after removing the discount
42
+ */
43
+ discountPrice?: number;
44
+ }
@@ -0,0 +1,131 @@
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.ItemDataDto = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ const class_validator_jsonschema_1 = require("class-validator-jsonschema");
15
+ /**
16
+ * Represents the data of a specific product item.
17
+ * This DTO is used to transfer detailed information about a product instance.
18
+ */
19
+ class ItemDataDto {
20
+ }
21
+ exports.ItemDataDto = ItemDataDto;
22
+ __decorate([
23
+ (0, class_validator_1.IsOptional)(),
24
+ (0, class_validator_1.IsString)(),
25
+ (0, class_validator_jsonschema_1.JSONSchema)({
26
+ title: 'Item ID',
27
+ description: 'The unique identifier for the product item.',
28
+ type: 'string',
29
+ }),
30
+ __metadata("design:type", String)
31
+ ], ItemDataDto.prototype, "itemId", void 0);
32
+ __decorate([
33
+ (0, class_validator_1.IsNotEmpty)(),
34
+ (0, class_validator_1.IsString)(),
35
+ (0, class_validator_jsonschema_1.JSONSchema)({
36
+ title: 'Product ID',
37
+ description: 'Unique identifier for the product.',
38
+ type: 'string',
39
+ }),
40
+ __metadata("design:type", String)
41
+ ], ItemDataDto.prototype, "productId", void 0);
42
+ __decorate([
43
+ (0, class_validator_1.IsNotEmpty)(),
44
+ (0, class_validator_1.IsString)(),
45
+ (0, class_validator_jsonschema_1.JSONSchema)({
46
+ title: 'Product Name',
47
+ description: 'Name of the product.',
48
+ type: 'string',
49
+ }),
50
+ __metadata("design:type", String)
51
+ ], ItemDataDto.prototype, "productName", void 0);
52
+ __decorate([
53
+ (0, class_validator_1.IsNotEmpty)(),
54
+ (0, class_validator_1.IsString)(),
55
+ (0, class_validator_jsonschema_1.JSONSchema)({
56
+ title: 'Resource Name',
57
+ description: 'Resource name associated with the product.',
58
+ type: 'string',
59
+ }),
60
+ __metadata("design:type", String)
61
+ ], ItemDataDto.prototype, "resourceName", void 0);
62
+ __decorate([
63
+ (0, class_validator_1.IsDefined)(),
64
+ (0, class_validator_jsonschema_1.JSONSchema)({
65
+ title: 'Product Attributes',
66
+ description: 'Product-level attributes defined for the product type.',
67
+ type: 'object',
68
+ additionalProperties: true,
69
+ }),
70
+ __metadata("design:type", Object)
71
+ ], ItemDataDto.prototype, "productAttributes", void 0);
72
+ __decorate([
73
+ (0, class_validator_1.IsDefined)(),
74
+ (0, class_validator_jsonschema_1.JSONSchema)({
75
+ title: 'Item Attributes',
76
+ description: 'Item-specific attributes unique to this product instance.',
77
+ type: 'object',
78
+ additionalProperties: true,
79
+ }),
80
+ __metadata("design:type", Object)
81
+ ], ItemDataDto.prototype, "itemAttributes", void 0);
82
+ __decorate([
83
+ (0, class_validator_1.IsOptional)(),
84
+ (0, class_validator_jsonschema_1.JSONSchema)({
85
+ title: 'Creation Response Data',
86
+ description: 'Data returned from the creation response.',
87
+ type: 'object',
88
+ additionalProperties: true,
89
+ }),
90
+ __metadata("design:type", Object)
91
+ ], ItemDataDto.prototype, "creationResponseData", void 0);
92
+ __decorate([
93
+ (0, class_validator_1.IsNotEmpty)(),
94
+ (0, class_validator_1.IsString)(),
95
+ (0, class_validator_jsonschema_1.JSONSchema)({
96
+ title: 'Start Date',
97
+ description: 'Start date of the product item.',
98
+ type: 'string',
99
+ }),
100
+ __metadata("design:type", String)
101
+ ], ItemDataDto.prototype, "startDate", void 0);
102
+ __decorate([
103
+ (0, class_validator_1.IsNotEmpty)(),
104
+ (0, class_validator_1.IsString)(),
105
+ (0, class_validator_jsonschema_1.JSONSchema)({
106
+ title: 'End Date',
107
+ description: 'End date of the product item.',
108
+ type: 'string',
109
+ }),
110
+ __metadata("design:type", String)
111
+ ], ItemDataDto.prototype, "endDate", void 0);
112
+ __decorate([
113
+ (0, class_validator_1.IsOptional)(),
114
+ (0, class_validator_1.IsNumber)(),
115
+ (0, class_validator_jsonschema_1.JSONSchema)({
116
+ title: 'Price',
117
+ description: 'The price of the product item without tax and discount.',
118
+ type: 'number',
119
+ }),
120
+ __metadata("design:type", Number)
121
+ ], ItemDataDto.prototype, "price", void 0);
122
+ __decorate([
123
+ (0, class_validator_1.IsOptional)(),
124
+ (0, class_validator_1.IsNumber)(),
125
+ (0, class_validator_jsonschema_1.JSONSchema)({
126
+ title: 'Discount Price',
127
+ description: 'The price after removing the discount.',
128
+ type: 'number',
129
+ }),
130
+ __metadata("design:type", Number)
131
+ ], ItemDataDto.prototype, "discountPrice", void 0);
@@ -13,6 +13,7 @@ exports.JwtDto = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
14
  const class_transformer_1 = require("class-transformer");
15
15
  const roles_enum_1 = require("../enums/roles.enum");
16
+ const class_validator_jsonschema_1 = require("class-validator-jsonschema");
16
17
  /**
17
18
  * DTO for the JWT payload.
18
19
  * This defines the structure of the data contained within the JWT.
@@ -22,21 +23,42 @@ class JwtPayloadDto {
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: 'Integration ID',
28
+ description: 'The unique identifier for the integration.',
29
+ type: 'string',
30
+ }),
25
31
  __metadata("design:type", String)
26
32
  ], JwtPayloadDto.prototype, "integrationId", void 0);
27
33
  __decorate([
28
34
  (0, class_validator_1.IsString)(),
29
35
  (0, class_validator_1.IsOptional)(),
36
+ (0, class_validator_jsonschema_1.JSONSchema)({
37
+ title: 'User ID',
38
+ description: 'The unique identifier for the user who triggered the API call.',
39
+ type: 'string',
40
+ }),
30
41
  __metadata("design:type", String)
31
42
  ], JwtPayloadDto.prototype, "userId", void 0);
32
43
  __decorate([
33
44
  (0, class_validator_1.IsString)(),
34
45
  (0, class_validator_1.IsNotEmpty)(),
46
+ (0, class_validator_jsonschema_1.JSONSchema)({
47
+ title: 'Company ID',
48
+ description: 'The unique identifier for the company.',
49
+ type: 'string',
50
+ }),
35
51
  __metadata("design:type", String)
36
52
  ], JwtPayloadDto.prototype, "companyId", void 0);
37
53
  __decorate([
38
54
  (0, class_validator_1.IsArray)(),
39
55
  (0, class_validator_1.IsEnum)(roles_enum_1.RolesEnum, { each: true }),
56
+ (0, class_validator_jsonschema_1.JSONSchema)({
57
+ title: 'Accepted Roles',
58
+ description: 'The roles accepted by the company for this integration.',
59
+ type: 'array',
60
+ items: { type: 'string', enum: Object.values(roles_enum_1.RolesEnum) },
61
+ }),
40
62
  __metadata("design:type", Array)
41
63
  ], JwtPayloadDto.prototype, "acceptedRoles", void 0);
42
64
  /**
@@ -50,5 +72,10 @@ __decorate([
50
72
  (0, class_validator_1.ValidateNested)(),
51
73
  (0, class_transformer_1.Type)(() => JwtPayloadDto),
52
74
  (0, class_validator_1.IsDefined)(),
75
+ (0, class_validator_jsonschema_1.JSONSchema)({
76
+ title: 'JWT',
77
+ description: 'The JWT payload containing user and company information.',
78
+ $ref: '#/components/schemas/JwtPayloadDto',
79
+ }),
53
80
  __metadata("design:type", JwtPayloadDto)
54
81
  ], JwtDto.prototype, "jwt", void 0);
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.MultilangTextDto = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
14
  const language_enum_1 = require("../enums/language.enum");
15
+ const class_validator_jsonschema_1 = require("class-validator-jsonschema");
15
16
  /**
16
17
  * DTO for multilingual text.
17
18
  * Used for providing text in multiple languages.
@@ -22,10 +23,21 @@ exports.MultilangTextDto = MultilangTextDto;
22
23
  __decorate([
23
24
  (0, class_validator_1.IsEnum)(language_enum_1.LanguageEnum),
24
25
  (0, class_validator_1.IsDefined)(),
26
+ (0, class_validator_jsonschema_1.JSONSchema)({
27
+ title: 'Language',
28
+ description: 'The language of the text.',
29
+ type: 'string',
30
+ enum: Object.values(language_enum_1.LanguageEnum),
31
+ }),
25
32
  __metadata("design:type", String)
26
33
  ], MultilangTextDto.prototype, "language", void 0);
27
34
  __decorate([
28
35
  (0, class_validator_1.IsString)(),
29
36
  (0, class_validator_1.IsNotEmpty)(),
37
+ (0, class_validator_jsonschema_1.JSONSchema)({
38
+ title: 'Text',
39
+ description: 'The text content in the specified language.',
40
+ type: 'string',
41
+ }),
30
42
  __metadata("design:type", String)
31
43
  ], MultilangTextDto.prototype, "text", void 0);
@@ -11,6 +11,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.EmailReceiverDto = 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 email recipients
16
17
  * Used to define the recipients of an email
@@ -21,6 +22,12 @@ exports.EmailReceiverDto = EmailReceiverDto;
21
22
  __decorate([
22
23
  (0, class_validator_1.IsNotEmpty)(),
23
24
  (0, class_validator_1.IsEmail)(),
25
+ (0, class_validator_jsonschema_1.JSONSchema)({
26
+ title: 'To',
27
+ description: 'The main email address.',
28
+ type: 'string',
29
+ format: 'email',
30
+ }),
24
31
  __metadata("design:type", String)
25
32
  ], EmailReceiverDto.prototype, "to", void 0);
26
33
  __decorate([
@@ -28,6 +35,12 @@ __decorate([
28
35
  (0, class_validator_1.IsArray)(),
29
36
  (0, class_validator_1.IsEmail)({}, { each: true }),
30
37
  (0, class_validator_1.ArrayUnique)(),
38
+ (0, class_validator_jsonschema_1.JSONSchema)({
39
+ title: 'CC',
40
+ description: 'List of email addresses for carbon copy.',
41
+ type: 'array',
42
+ items: { type: 'string', format: 'email' },
43
+ }),
31
44
  __metadata("design:type", Array)
32
45
  ], EmailReceiverDto.prototype, "cc", void 0);
33
46
  __decorate([
@@ -35,5 +48,11 @@ __decorate([
35
48
  (0, class_validator_1.IsArray)(),
36
49
  (0, class_validator_1.IsEmail)({}, { each: true }),
37
50
  (0, class_validator_1.ArrayUnique)(),
51
+ (0, class_validator_jsonschema_1.JSONSchema)({
52
+ title: 'BCC',
53
+ description: 'List of email addresses for blind carbon copy.',
54
+ type: 'array',
55
+ items: { type: 'string', format: 'email' },
56
+ }),
38
57
  __metadata("design:type", Array)
39
58
  ], EmailReceiverDto.prototype, "bcc", void 0);
@@ -11,6 +11,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.SmsReceiverDto = 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 SMS recipients
16
17
  * Used to define the recipients of an SMS message
@@ -22,5 +23,11 @@ __decorate([
22
23
  (0, class_validator_1.IsArray)(),
23
24
  (0, class_validator_1.ArrayUnique)(),
24
25
  (0, class_validator_1.IsPhoneNumber)(undefined, { each: true }),
26
+ (0, class_validator_jsonschema_1.JSONSchema)({
27
+ title: 'Receiver Phones',
28
+ description: 'List of recipient phone numbers.',
29
+ type: 'array',
30
+ items: { type: 'string' },
31
+ }),
25
32
  __metadata("design:type", Array)
26
33
  ], SmsReceiverDto.prototype, "receiverPhones", void 0);
@@ -0,0 +1,18 @@
1
+ import { EmailSenderDto } from '../sender/sender-email.dto';
2
+ import { PushSenderDto } from '../sender/sender-push.dto';
3
+ import { SmsSenderDto } from '../sender/sender-sms.dto';
4
+ import { EmailReceiverDto } from '../receiver/receiver-email.dto';
5
+ import { PushReceiverDto } from '../receiver/receiver-push.dto';
6
+ import { SmsReceiverDto } from '../receiver/receiver-sms.dto';
7
+ /**
8
+ * Request payload for sending a notification.
9
+ * Sent from hoster.ai to notification integrations (email, push, SMS).
10
+ */
11
+ export declare class NotificationSendRequestDto {
12
+ /** Unique identifier for the notification */
13
+ notificationId: string;
14
+ /** Sender details (type depends on integration: email, push, or SMS) */
15
+ sender: EmailSenderDto | PushSenderDto | SmsSenderDto;
16
+ /** Recipient details (type depends on integration: email, push, or SMS) */
17
+ receiver: EmailReceiverDto | PushReceiverDto | SmsReceiverDto;
18
+ }
@@ -0,0 +1,90 @@
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.NotificationSendRequestDto = void 0;
13
+ const class_transformer_1 = require("class-transformer");
14
+ const class_validator_1 = require("class-validator");
15
+ const class_validator_jsonschema_1 = require("class-validator-jsonschema");
16
+ const sender_email_dto_1 = require("../sender/sender-email.dto");
17
+ const sender_push_dto_1 = require("../sender/sender-push.dto");
18
+ const sender_sms_dto_1 = require("../sender/sender-sms.dto");
19
+ const receiver_email_dto_1 = require("../receiver/receiver-email.dto");
20
+ const receiver_push_dto_1 = require("../receiver/receiver-push.dto");
21
+ const receiver_sms_dto_1 = require("../receiver/receiver-sms.dto");
22
+ /**
23
+ * Request payload for sending a notification.
24
+ * Sent from hoster.ai to notification integrations (email, push, SMS).
25
+ */
26
+ class NotificationSendRequestDto {
27
+ }
28
+ exports.NotificationSendRequestDto = NotificationSendRequestDto;
29
+ __decorate([
30
+ (0, class_validator_1.IsNotEmpty)(),
31
+ (0, class_validator_1.IsString)(),
32
+ (0, class_validator_jsonschema_1.JSONSchema)({
33
+ title: 'Notification ID',
34
+ description: 'Unique identifier for the notification.',
35
+ type: 'string',
36
+ }),
37
+ __metadata("design:type", String)
38
+ ], NotificationSendRequestDto.prototype, "notificationId", void 0);
39
+ __decorate([
40
+ (0, class_validator_1.IsNotEmpty)(),
41
+ (0, class_validator_1.IsObject)(),
42
+ (0, class_validator_1.ValidateNested)(),
43
+ (0, class_transformer_1.Type)(() => Object, {
44
+ discriminator: {
45
+ property: '__type',
46
+ subTypes: [
47
+ { value: sender_email_dto_1.EmailSenderDto, name: 'email' },
48
+ { value: sender_push_dto_1.PushSenderDto, name: 'push' },
49
+ { value: sender_sms_dto_1.SmsSenderDto, name: 'sms' },
50
+ ],
51
+ },
52
+ keepDiscriminatorProperty: false,
53
+ }),
54
+ (0, class_validator_jsonschema_1.JSONSchema)({
55
+ title: 'Sender',
56
+ description: 'Sender details (type depends on integration: email, push, or SMS).',
57
+ oneOf: [
58
+ { $ref: '#/components/schemas/EmailSenderDto' },
59
+ { $ref: '#/components/schemas/PushSenderDto' },
60
+ { $ref: '#/components/schemas/SmsSenderDto' },
61
+ ],
62
+ }),
63
+ __metadata("design:type", Object)
64
+ ], NotificationSendRequestDto.prototype, "sender", void 0);
65
+ __decorate([
66
+ (0, class_validator_1.IsNotEmpty)(),
67
+ (0, class_validator_1.IsObject)(),
68
+ (0, class_validator_1.ValidateNested)(),
69
+ (0, class_transformer_1.Type)(() => Object, {
70
+ discriminator: {
71
+ property: '__type',
72
+ subTypes: [
73
+ { value: receiver_email_dto_1.EmailReceiverDto, name: 'email' },
74
+ { value: receiver_push_dto_1.PushReceiverDto, name: 'push' },
75
+ { value: receiver_sms_dto_1.SmsReceiverDto, name: 'sms' },
76
+ ],
77
+ },
78
+ keepDiscriminatorProperty: false,
79
+ }),
80
+ (0, class_validator_jsonschema_1.JSONSchema)({
81
+ title: 'Receiver',
82
+ description: 'Recipient details (type depends on integration: email, push, or SMS).',
83
+ oneOf: [
84
+ { $ref: '#/components/schemas/EmailReceiverDto' },
85
+ { $ref: '#/components/schemas/PushReceiverDto' },
86
+ { $ref: '#/components/schemas/SmsReceiverDto' },
87
+ ],
88
+ }),
89
+ __metadata("design:type", Object)
90
+ ], NotificationSendRequestDto.prototype, "receiver", void 0);
@@ -0,0 +1,9 @@
1
+ import { SuccessResponseDto } from "../../success-response.dto";
2
+ /**
3
+ * Response from notification integrations after successfully sending a notification.
4
+ * Returned to hoster.ai confirming the notification was sent.
5
+ */
6
+ export declare class NotificationSendResponseDto extends SuccessResponseDto {
7
+ /** Unique identifier for the sent notification */
8
+ notificationId: string;
9
+ }