@hosterai/types 0.0.26 → 0.0.28

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 (180) hide show
  1. package/README.md +49 -8
  2. package/dist/dtos/attachment.dto.js +17 -0
  3. package/dist/dtos/attribute-field.dto.d.ts +9 -10
  4. package/dist/dtos/attribute-field.dto.js +28 -38
  5. package/dist/dtos/base-response.dto.js +11 -0
  6. package/dist/dtos/client-data.dto.js +82 -0
  7. package/dist/dtos/company-data.dto.js +97 -0
  8. package/dist/dtos/country.dto.js +17 -0
  9. package/dist/dtos/error-response.dto.js +15 -0
  10. package/dist/dtos/field.dto.d.ts +17 -1
  11. package/dist/dtos/field.dto.js +41 -10
  12. package/dist/dtos/info.dto.d.ts +0 -6
  13. package/dist/dtos/info.dto.js +0 -24
  14. package/dist/dtos/invoice/invoice-item-data.dto.js +7 -0
  15. package/dist/dtos/invoice/requests/credit-note-request.dto.js +6 -0
  16. package/dist/dtos/invoice/requests/invoice-request.dto.js +6 -0
  17. package/dist/dtos/invoice/requests/proforma-invoice-request.dto.d.ts +3 -0
  18. package/dist/dtos/invoice/requests/proforma-invoice-request.dto.js +51 -3
  19. package/dist/dtos/invoice/requests/tax-details-request.dto.d.ts +31 -0
  20. package/dist/dtos/invoice/requests/tax-details-request.dto.js +84 -0
  21. package/dist/dtos/invoice/responses/proforma-invoice-response.dto.js +17 -0
  22. package/dist/dtos/invoice/responses/tax-details-response.dto.d.ts +20 -0
  23. package/dist/dtos/invoice/responses/tax-details-response.dto.js +56 -0
  24. package/dist/dtos/invoice/tin-validation-details.dto.d.ts +51 -0
  25. package/dist/dtos/invoice/tin-validation-details.dto.js +165 -0
  26. package/dist/dtos/invoice/transaction-data.dto.js +22 -0
  27. package/dist/dtos/invoice-contact-data.dto.js +102 -0
  28. package/dist/dtos/item-data.dto.d.ts +2 -2
  29. package/dist/dtos/item-data.dto.js +63 -2
  30. package/dist/dtos/jwt.dto.js +27 -0
  31. package/dist/dtos/multilang-text.dto.js +12 -0
  32. package/dist/dtos/notification/receiver/receiver-email.dto.js +19 -0
  33. package/dist/dtos/notification/receiver/receiver-sms.dto.js +7 -0
  34. package/dist/dtos/notification/requests/notification-send-request.dto.d.ts +3 -3
  35. package/dist/dtos/notification/requests/notification-send-request.dto.js +27 -3
  36. package/dist/dtos/notification/responses/notification-send-response.dto.js +6 -0
  37. package/dist/dtos/notification/sender/sender-email.dto.js +26 -0
  38. package/dist/dtos/notification/sender/sender-push.dto.js +36 -0
  39. package/dist/dtos/notification/sender/sender-sms.dto.js +11 -0
  40. package/dist/dtos/product/product-info.dto.d.ts +4 -4
  41. package/dist/dtos/product/product-info.dto.js +7 -7
  42. package/dist/dtos/product/product-item-data.dto.d.ts +1 -1
  43. package/dist/dtos/product/product-item-data.dto.js +8 -1
  44. package/dist/dtos/product/requests/product-create-request.dto.d.ts +1 -1
  45. package/dist/dtos/product/requests/product-create-request.dto.js +12 -1
  46. package/dist/dtos/product/requests/product-delete-request.dto.d.ts +1 -1
  47. package/dist/dtos/product/requests/product-delete-request.dto.js +12 -1
  48. package/dist/dtos/product/requests/product-downgradable-request.dto.d.ts +1 -1
  49. package/dist/dtos/product/requests/product-downgradable-request.dto.js +12 -1
  50. package/dist/dtos/product/requests/product-downgrade-request.dto.d.ts +1 -1
  51. package/dist/dtos/product/requests/product-downgrade-request.dto.js +17 -1
  52. package/dist/dtos/product/requests/product-downgradeable-request.dto.d.ts +18 -0
  53. package/dist/dtos/product/requests/product-downgradeable-request.dto.js +37 -0
  54. package/dist/dtos/product/requests/product-renew-request.dto.d.ts +1 -1
  55. package/dist/dtos/product/requests/product-renew-request.dto.js +12 -1
  56. package/dist/dtos/product/requests/product-suspend-request.dto.d.ts +1 -1
  57. package/dist/dtos/product/requests/product-suspend-request.dto.js +12 -1
  58. package/dist/dtos/product/requests/product-unsuspend-request.dto.d.ts +1 -1
  59. package/dist/dtos/product/requests/product-unsuspend-request.dto.js +12 -1
  60. package/dist/dtos/product/requests/product-upgradable-request.dto.d.ts +1 -1
  61. package/dist/dtos/product/requests/product-upgradable-request.dto.js +12 -1
  62. package/dist/dtos/product/requests/product-upgrade-request.dto.d.ts +1 -1
  63. package/dist/dtos/product/requests/product-upgrade-request.dto.js +17 -1
  64. package/dist/dtos/product/requests/product-upgradeable-request.dto.d.ts +18 -0
  65. package/dist/dtos/product/requests/product-upgradeable-request.dto.js +37 -0
  66. package/dist/dtos/product/responses/product-create-response.dto.js +37 -0
  67. package/dist/dtos/product/responses/product-delete-response.dto.js +37 -0
  68. package/dist/dtos/product/responses/product-downgradable-response.dto.js +37 -0
  69. package/dist/dtos/product/responses/product-downgrade-response.dto.js +37 -0
  70. package/dist/dtos/product/responses/product-downgradeable-response.dto.d.ts +22 -0
  71. package/dist/dtos/product/responses/product-downgradeable-response.dto.js +11 -0
  72. package/dist/dtos/product/responses/product-info-response.dto.js +6 -0
  73. package/dist/dtos/product/responses/product-renew-response.dto.js +37 -0
  74. package/dist/dtos/product/responses/product-suspend-response.dto.js +37 -0
  75. package/dist/dtos/product/responses/product-unsuspend-response.dto.js +37 -0
  76. package/dist/dtos/product/responses/product-upgradable-response.dto.js +37 -0
  77. package/dist/dtos/product/responses/product-upgrade-response.dto.js +37 -0
  78. package/dist/dtos/product/responses/product-upgradeable-response.dto.d.ts +22 -0
  79. package/dist/dtos/product/responses/product-upgradeable-response.dto.js +11 -0
  80. package/dist/dtos/requests/validate-attributes-request.dto.js +12 -0
  81. package/dist/dtos/response-data.dto.js +19 -0
  82. package/dist/dtos/responses/validate-attributes-response.dto.js +7 -0
  83. package/dist/dtos/setup-status-response.dto.js +20 -0
  84. package/dist/enums/events.enum.d.ts +3 -0
  85. package/dist/enums/events.enum.js +3 -0
  86. package/dist/index.d.ts +24 -0
  87. package/dist/index.js +24 -0
  88. package/dist/openapi/schemas/components.schemas.d.ts +155 -40
  89. package/dist/openapi/schemas/components.schemas.js +187 -96
  90. package/dist/validators/addon-field-validator.d.ts +9 -0
  91. package/dist/validators/addon-field-validator.js +14 -0
  92. package/dist/validators/addon-field-validator.spec.d.ts +1 -0
  93. package/dist/validators/addon-field-validator.spec.js +38 -0
  94. package/dist/validators/attachment-validator.d.ts +8 -0
  95. package/dist/validators/attachment-validator.js +17 -0
  96. package/dist/validators/attachment-validator.spec.d.ts +1 -0
  97. package/dist/validators/attachment-validator.spec.js +58 -0
  98. package/dist/validators/attribute-field-validator.d.ts +8 -0
  99. package/dist/validators/attribute-field-validator.js +17 -0
  100. package/dist/validators/attribute-field-validator.spec.d.ts +1 -0
  101. package/dist/validators/attribute-field-validator.spec.js +84 -0
  102. package/dist/validators/country-validator.d.ts +8 -0
  103. package/dist/validators/country-validator.js +17 -0
  104. package/dist/validators/country-validator.spec.d.ts +1 -0
  105. package/dist/validators/country-validator.spec.js +58 -0
  106. package/dist/validators/field-validator.spec.js +1 -29
  107. package/dist/validators/info-validator.d.ts +8 -0
  108. package/dist/validators/info-validator.js +17 -0
  109. package/dist/validators/info-validator.spec.d.ts +1 -0
  110. package/dist/validators/info-validator.spec.js +85 -0
  111. package/dist/validators/invoice-contact-data-validator.d.ts +8 -0
  112. package/dist/validators/invoice-contact-data-validator.js +17 -0
  113. package/dist/validators/invoice-contact-data-validator.spec.d.ts +1 -0
  114. package/dist/validators/invoice-contact-data-validator.spec.js +88 -0
  115. package/dist/validators/invoice-info-validator.d.ts +8 -0
  116. package/dist/validators/invoice-info-validator.js +17 -0
  117. package/dist/validators/invoice-info-validator.spec.d.ts +1 -0
  118. package/dist/validators/invoice-info-validator.spec.js +81 -0
  119. package/dist/validators/invoice-item-data-validator.d.ts +8 -0
  120. package/dist/validators/invoice-item-data-validator.js +17 -0
  121. package/dist/validators/invoice-item-data-validator.spec.d.ts +1 -0
  122. package/dist/validators/invoice-item-data-validator.spec.js +45 -0
  123. package/dist/validators/item-data-validator.d.ts +8 -0
  124. package/dist/validators/item-data-validator.js +17 -0
  125. package/dist/validators/item-data-validator.spec.d.ts +1 -0
  126. package/dist/validators/item-data-validator.spec.js +79 -0
  127. package/dist/validators/notification-request-validator.js +1 -1
  128. package/dist/validators/product-create-request-validator.js +1 -1
  129. package/dist/validators/product-delete-request-validator.js +1 -1
  130. package/dist/validators/product-downgradable-request-validator.js +1 -1
  131. package/dist/validators/product-downgrade-request-validator.js +1 -1
  132. package/dist/validators/product-downgradeable-request-validator.d.ts +8 -0
  133. package/dist/validators/product-downgradeable-request-validator.js +17 -0
  134. package/dist/validators/product-info-validator.spec.js +5 -1
  135. package/dist/validators/product-item-data-validator.d.ts +8 -0
  136. package/dist/validators/product-item-data-validator.js +17 -0
  137. package/dist/validators/product-item-data-validator.spec.d.ts +1 -0
  138. package/dist/validators/product-item-data-validator.spec.js +60 -0
  139. package/dist/validators/product-renew-request-validator.js +1 -1
  140. package/dist/validators/product-suspend-request-validator.js +1 -1
  141. package/dist/validators/product-unsuspend-request-validator.js +1 -1
  142. package/dist/validators/product-upgradable-request-validator.js +1 -1
  143. package/dist/validators/product-upgrade-request-validator.js +1 -1
  144. package/dist/validators/product-upgradeable-request-validator.d.ts +8 -0
  145. package/dist/validators/product-upgradeable-request-validator.js +17 -0
  146. package/dist/validators/tab-validator.d.ts +8 -0
  147. package/dist/validators/tab-validator.js +17 -0
  148. package/dist/validators/tab-validator.spec.d.ts +1 -0
  149. package/dist/validators/tab-validator.spec.js +49 -0
  150. package/dist/validators/tin-validation-details-validator.d.ts +8 -0
  151. package/dist/validators/tin-validation-details-validator.js +17 -0
  152. package/dist/validators/tin-validation-details-validator.spec.d.ts +1 -0
  153. package/dist/validators/tin-validation-details-validator.spec.js +77 -0
  154. package/dist/validators/transaction-data-validator.d.ts +8 -0
  155. package/dist/validators/transaction-data-validator.js +17 -0
  156. package/dist/validators/transaction-data-validator.spec.d.ts +1 -0
  157. package/dist/validators/transaction-data-validator.spec.js +62 -0
  158. package/package.json +1 -1
  159. package/dist/dtos/info/info-notification.dto.d.ts +0 -5
  160. package/dist/dtos/info/info-notification.dto.js +0 -7
  161. package/dist/dtos/info/info.dto.d.ts +0 -196
  162. package/dist/dtos/info/info.dto.js +0 -278
  163. package/dist/dtos/notification/notification-request.dto.d.ts +0 -20
  164. package/dist/dtos/notification/notification-request.dto.js +0 -31
  165. package/dist/dtos/receiver/receiver-email.dto.d.ts +0 -20
  166. package/dist/dtos/receiver/receiver-email.dto.js +0 -39
  167. package/dist/dtos/receiver/receiver-push.dto.d.ts +0 -15
  168. package/dist/dtos/receiver/receiver-push.dto.js +0 -31
  169. package/dist/dtos/receiver/receiver-sms.dto.d.ts +0 -11
  170. package/dist/dtos/receiver/receiver-sms.dto.js +0 -26
  171. package/dist/dtos/request.dto.d.ts +0 -20
  172. package/dist/dtos/request.dto.js +0 -31
  173. package/dist/dtos/sender/sender-email.dto.d.ts +0 -25
  174. package/dist/dtos/sender/sender-email.dto.js +0 -46
  175. package/dist/dtos/sender/sender-push.dto.d.ts +0 -31
  176. package/dist/dtos/sender/sender-push.dto.js +0 -50
  177. package/dist/dtos/sender/sender-sms.dto.d.ts +0 -15
  178. package/dist/dtos/sender/sender-sms.dto.js +0 -30
  179. package/dist/enums/message-type.enum.d.ts +0 -5
  180. package/dist/enums/message-type.enum.js +0 -9
@@ -6,7 +6,9 @@ exports.ComponentsSchemas = {
6
6
  "properties": {
7
7
  "name": {
8
8
  "minLength": 1,
9
- "type": "string"
9
+ "type": "string",
10
+ "title": "Name",
11
+ "description": "Country name."
10
12
  },
11
13
  "code": {
12
14
  "enum": [
@@ -260,10 +262,14 @@ exports.ComponentsSchemas = {
260
262
  "TO",
261
263
  "TT"
262
264
  ],
263
- "type": "string"
265
+ "type": "string",
266
+ "title": "Code",
267
+ "description": "Country code."
264
268
  },
265
269
  "isEurope": {
266
- "type": "boolean"
270
+ "type": "boolean",
271
+ "title": "Is Europe",
272
+ "description": "Whether the country is in Europe."
267
273
  }
268
274
  },
269
275
  "type": "object",
@@ -941,11 +947,15 @@ exports.ComponentsSchemas = {
941
947
  "ZA",
942
948
  "ZU"
943
949
  ],
944
- "type": "string"
950
+ "type": "string",
951
+ "title": "Language",
952
+ "description": "The language of the text."
945
953
  },
946
954
  "text": {
947
955
  "minLength": 1,
948
- "type": "string"
956
+ "type": "string",
957
+ "title": "Text",
958
+ "description": "The text content in the specified language."
949
959
  }
950
960
  },
951
961
  "type": "object",
@@ -1039,6 +1049,14 @@ exports.ComponentsSchemas = {
1039
1049
  "title": "Required",
1040
1050
  "description": "Whether the field is required."
1041
1051
  },
1052
+ "disabled": {
1053
+ "type": "boolean",
1054
+ "title": "Disabled",
1055
+ "description": "Whether the field is disabled."
1056
+ },
1057
+ "hidden": {
1058
+ "type": "boolean"
1059
+ },
1042
1060
  "regexValidation": {
1043
1061
  "type": "string",
1044
1062
  "title": "Regex Validation",
@@ -1049,10 +1067,23 @@ exports.ComponentsSchemas = {
1049
1067
  "items": {
1050
1068
  "$ref": "#/components/schemas/MultilangTextDto"
1051
1069
  },
1070
+ "minItems": 1,
1052
1071
  "type": "array",
1053
1072
  "title": "Regex Validation Error Message",
1054
1073
  "description": "Localized error message shown when regex validation fails."
1055
1074
  },
1075
+ "triggersRemoteValidation": {
1076
+ "type": "boolean"
1077
+ },
1078
+ "remoteValidationErrorMessage": {
1079
+ "items": {
1080
+ "$ref": "#/components/schemas/MultilangTextDto"
1081
+ },
1082
+ "minItems": 1,
1083
+ "type": "array",
1084
+ "title": "Remote Validation Error Message",
1085
+ "description": "Localized error message shown when remote validation fails."
1086
+ },
1056
1087
  "upgradable": {
1057
1088
  "type": "boolean",
1058
1089
  "title": "Upgradable",
@@ -1071,8 +1102,7 @@ exports.ComponentsSchemas = {
1071
1102
  "value",
1072
1103
  "type",
1073
1104
  "required",
1074
- "upgradable",
1075
- "downgradable"
1105
+ "disabled"
1076
1106
  ]
1077
1107
  },
1078
1108
  "InfoDto": {
@@ -1295,49 +1325,6 @@ exports.ComponentsSchemas = {
1295
1325
  "EN"
1296
1326
  ]
1297
1327
  },
1298
- "supportedTypes": {
1299
- "items": {
1300
- "enum": [
1301
- "create",
1302
- "renew",
1303
- "upgrade",
1304
- "downgrade",
1305
- "transfer",
1306
- "trade",
1307
- "suspend",
1308
- "unsuspend",
1309
- "delete"
1310
- ],
1311
- "type": "string"
1312
- },
1313
- "type": "array",
1314
- "title": "Supported Actions",
1315
- "description": "Actions supported by this integration.",
1316
- "oneOf": [
1317
- {
1318
- "type": "string",
1319
- "enum": [
1320
- "create",
1321
- "renew",
1322
- "upgrade",
1323
- "downgrade",
1324
- "transfer",
1325
- "trade",
1326
- "suspend",
1327
- "unsuspend",
1328
- "delete"
1329
- ]
1330
- },
1331
- {
1332
- "type": "string",
1333
- "enum": [
1334
- "invoice",
1335
- "credit-note",
1336
- "proforma"
1337
- ]
1338
- }
1339
- ]
1340
- },
1341
1328
  "listenEvents": {
1342
1329
  "items": {
1343
1330
  "enum": [
@@ -1512,6 +1499,9 @@ exports.ComponentsSchemas = {
1512
1499
  "item/activated",
1513
1500
  "item/set-inactive",
1514
1501
  "item/processed",
1502
+ "item/refund-requested",
1503
+ "item/refund-accepted",
1504
+ "item/refund-rejected",
1515
1505
  "order/paid",
1516
1506
  "test",
1517
1507
  "dead-lettering",
@@ -1899,49 +1889,6 @@ exports.ComponentsSchemas = {
1899
1889
  "EN"
1900
1890
  ]
1901
1891
  },
1902
- "supportedTypes": {
1903
- "items": {
1904
- "enum": [
1905
- "create",
1906
- "renew",
1907
- "upgrade",
1908
- "downgrade",
1909
- "transfer",
1910
- "trade",
1911
- "suspend",
1912
- "unsuspend",
1913
- "delete"
1914
- ],
1915
- "type": "string"
1916
- },
1917
- "type": "array",
1918
- "title": "Supported Actions",
1919
- "description": "Actions supported by this integration.",
1920
- "oneOf": [
1921
- {
1922
- "type": "string",
1923
- "enum": [
1924
- "create",
1925
- "renew",
1926
- "upgrade",
1927
- "downgrade",
1928
- "transfer",
1929
- "trade",
1930
- "suspend",
1931
- "unsuspend",
1932
- "delete"
1933
- ]
1934
- },
1935
- {
1936
- "type": "string",
1937
- "enum": [
1938
- "invoice",
1939
- "credit-note",
1940
- "proforma"
1941
- ]
1942
- }
1943
- ]
1944
- },
1945
1892
  "listenEvents": {
1946
1893
  "items": {
1947
1894
  "enum": [
@@ -2116,6 +2063,9 @@ exports.ComponentsSchemas = {
2116
2063
  "item/activated",
2117
2064
  "item/set-inactive",
2118
2065
  "item/processed",
2066
+ "item/refund-requested",
2067
+ "item/refund-accepted",
2068
+ "item/refund-rejected",
2119
2069
  "order/paid",
2120
2070
  "test",
2121
2071
  "dead-lettering",
@@ -2227,11 +2177,148 @@ exports.ComponentsSchemas = {
2227
2177
  "supportedLanguages"
2228
2178
  ]
2229
2179
  },
2180
+ "AttributeFieldDto": {
2181
+ "properties": {
2182
+ "visibleInOrder": {
2183
+ "type": "boolean",
2184
+ "title": "Visible In Order",
2185
+ "description": "Whether the field is visible in order view."
2186
+ },
2187
+ "visibleInClientPanel": {
2188
+ "type": "boolean",
2189
+ "title": "Visible In Client Panel",
2190
+ "description": "Whether the field is visible in the client panel."
2191
+ },
2192
+ "repeatableMin": {
2193
+ "type": "number",
2194
+ "title": "Repeatable Min",
2195
+ "description": "Minimum repeats for repeatable fields."
2196
+ },
2197
+ "repeatableMax": {
2198
+ "type": "number",
2199
+ "title": "Repeatable Max",
2200
+ "description": "Maximum repeats for repeatable fields."
2201
+ },
2202
+ "id": {
2203
+ "type": "string",
2204
+ "title": "ID",
2205
+ "description": "Unique identifier for the field."
2206
+ },
2207
+ "label": {
2208
+ "items": {
2209
+ "$ref": "#/components/schemas/MultilangTextDto"
2210
+ },
2211
+ "minItems": 1,
2212
+ "type": "array",
2213
+ "title": "Label",
2214
+ "description": "Multilingual label for the field."
2215
+ },
2216
+ "value": {
2217
+ "title": "Value",
2218
+ "description": "Value of the field. String/Number, or FieldOptionDto/FieldOptionDto[] depending on type.",
2219
+ "oneOf": [
2220
+ {
2221
+ "title": "String",
2222
+ "type": "string"
2223
+ },
2224
+ {
2225
+ "title": "Number",
2226
+ "type": "number"
2227
+ },
2228
+ {
2229
+ "title": "Option",
2230
+ "$ref": "#/components/schemas/FieldOptionDto"
2231
+ },
2232
+ {
2233
+ "title": "Options Array",
2234
+ "type": "array",
2235
+ "items": {
2236
+ "$ref": "#/components/schemas/FieldOptionDto"
2237
+ }
2238
+ }
2239
+ ]
2240
+ },
2241
+ "type": {
2242
+ "enum": [
2243
+ "TEXT_BOX",
2244
+ "TEXT_AREA",
2245
+ "SELECT",
2246
+ "MULTI_SELECT",
2247
+ "DESCRIPTION",
2248
+ "RADIO_BOX",
2249
+ "CHECKBOX",
2250
+ "SLIDER"
2251
+ ],
2252
+ "type": "string",
2253
+ "title": "Field Type",
2254
+ "description": "Type of the field."
2255
+ },
2256
+ "required": {
2257
+ "type": "boolean",
2258
+ "title": "Required",
2259
+ "description": "Whether the field is required."
2260
+ },
2261
+ "disabled": {
2262
+ "type": "boolean",
2263
+ "title": "Disabled",
2264
+ "description": "Whether the field is disabled."
2265
+ },
2266
+ "hidden": {
2267
+ "type": "boolean"
2268
+ },
2269
+ "regexValidation": {
2270
+ "type": "string",
2271
+ "title": "Regex Validation",
2272
+ "description": "Optional regex to validate input.",
2273
+ "example": "^[A-Za-z0-9_-]+$"
2274
+ },
2275
+ "regexValidationErrorMessage": {
2276
+ "items": {
2277
+ "$ref": "#/components/schemas/MultilangTextDto"
2278
+ },
2279
+ "minItems": 1,
2280
+ "type": "array",
2281
+ "title": "Regex Validation Error Message",
2282
+ "description": "Localized error message shown when regex validation fails."
2283
+ },
2284
+ "triggersRemoteValidation": {
2285
+ "type": "boolean"
2286
+ },
2287
+ "remoteValidationErrorMessage": {
2288
+ "items": {
2289
+ "$ref": "#/components/schemas/MultilangTextDto"
2290
+ },
2291
+ "minItems": 1,
2292
+ "type": "array",
2293
+ "title": "Remote Validation Error Message",
2294
+ "description": "Localized error message shown when remote validation fails."
2295
+ },
2296
+ "upgradable": {
2297
+ "type": "boolean",
2298
+ "title": "Upgradable",
2299
+ "description": "Whether the item attribute is upgradable by the user."
2300
+ },
2301
+ "downgradable": {
2302
+ "type": "boolean",
2303
+ "title": "Downgradable",
2304
+ "description": "Whether the item attribute is downgradable by the user."
2305
+ }
2306
+ },
2307
+ "type": "object",
2308
+ "required": [
2309
+ "id",
2310
+ "label",
2311
+ "value",
2312
+ "type",
2313
+ "required",
2314
+ "disabled"
2315
+ ]
2316
+ },
2230
2317
  "ProductInfoDto": {
2231
2318
  "properties": {
2232
2319
  "productAttributes": {
2233
2320
  "items": {
2234
- "$ref": "#/components/schemas/FieldDto"
2321
+ "$ref": "#/components/schemas/AttributeFieldDto"
2235
2322
  },
2236
2323
  "type": "array",
2237
2324
  "minItems": 1,
@@ -2240,7 +2327,7 @@ exports.ComponentsSchemas = {
2240
2327
  },
2241
2328
  "itemAttributes": {
2242
2329
  "items": {
2243
- "$ref": "#/components/schemas/FieldDto"
2330
+ "$ref": "#/components/schemas/AttributeFieldDto"
2244
2331
  },
2245
2332
  "type": "array",
2246
2333
  "minItems": 1,
@@ -2275,7 +2362,7 @@ exports.ComponentsSchemas = {
2275
2362
  "status_text": "status"
2276
2363
  }
2277
2364
  },
2278
- "supportedTypes": {
2365
+ "supportedActions": {
2279
2366
  "items": {
2280
2367
  "enum": [
2281
2368
  "create",
@@ -2687,6 +2774,9 @@ exports.ComponentsSchemas = {
2687
2774
  "item/activated",
2688
2775
  "item/set-inactive",
2689
2776
  "item/processed",
2777
+ "item/refund-requested",
2778
+ "item/refund-accepted",
2779
+ "item/refund-rejected",
2690
2780
  "order/paid",
2691
2781
  "test",
2692
2782
  "dead-lettering",
@@ -2793,6 +2883,7 @@ exports.ComponentsSchemas = {
2793
2883
  },
2794
2884
  "type": "object",
2795
2885
  "required": [
2886
+ "supportedActions",
2796
2887
  "title",
2797
2888
  "supportedLanguages"
2798
2889
  ]
@@ -0,0 +1,9 @@
1
+ import { ValidationError } from 'class-validator';
2
+ /**
3
+ * Validates an AddonFieldDto object.
4
+ * Since AddonFieldDto is an empty subclass of FieldDto, this delegates to validateFieldDto.
5
+ *
6
+ * @param data The object to validate as an AddonFieldDto.
7
+ * @returns An array of validation errors, empty if validation succeeds.
8
+ */
9
+ export declare function validateAddonFieldDto(data: object): ValidationError[];
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateAddonFieldDto = validateAddonFieldDto;
4
+ const field_validator_1 = require("./field-validator");
5
+ /**
6
+ * Validates an AddonFieldDto object.
7
+ * Since AddonFieldDto is an empty subclass of FieldDto, this delegates to validateFieldDto.
8
+ *
9
+ * @param data The object to validate as an AddonFieldDto.
10
+ * @returns An array of validation errors, empty if validation succeeds.
11
+ */
12
+ function validateAddonFieldDto(data) {
13
+ return (0, field_validator_1.validateFieldDto)(data);
14
+ }
@@ -0,0 +1 @@
1
+ import 'reflect-metadata';
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ require("reflect-metadata");
4
+ const addon_field_validator_1 = require("./addon-field-validator");
5
+ const field_type_enum_1 = require("../enums/field-type.enum");
6
+ const language_enum_1 = require("../enums/language.enum");
7
+ const baseValidDto = {
8
+ id: 'addon-1',
9
+ label: [{ language: language_enum_1.LanguageEnum.ENGLISH, text: 'Addon Field' }],
10
+ value: 'test-value',
11
+ type: field_type_enum_1.FieldTypeEnum.TEXT_BOX,
12
+ required: true,
13
+ disabled: false,
14
+ upgradable: false,
15
+ };
16
+ describe('AddonFieldDto Validator', () => {
17
+ describe('Valid cases', () => {
18
+ it('should return no errors for a valid DTO', () => {
19
+ expect((0, addon_field_validator_1.validateAddonFieldDto)(baseValidDto)).toHaveLength(0);
20
+ });
21
+ });
22
+ describe('Missing required fields', () => {
23
+ it('should return errors when all fields are missing', () => {
24
+ const errors = (0, addon_field_validator_1.validateAddonFieldDto)({});
25
+ const requiredProps = ['id', 'label', 'value', 'type', 'required', 'disabled'];
26
+ for (const prop of requiredProps) {
27
+ expect(errors.some(e => e.property === prop)).toBe(true);
28
+ }
29
+ });
30
+ });
31
+ describe('Invalid field values', () => {
32
+ it('should return error for invalid type enum', () => {
33
+ const dto = { ...baseValidDto, type: 'not-a-valid-type' };
34
+ const errors = (0, addon_field_validator_1.validateAddonFieldDto)(dto);
35
+ expect(errors.some(e => e.property === 'type')).toBe(true);
36
+ });
37
+ });
38
+ });
@@ -0,0 +1,8 @@
1
+ import { ValidationError } from 'class-validator';
2
+ /**
3
+ * Validates an AttachmentDto object using class-validator decorators.
4
+ *
5
+ * @param data The object to validate as an AttachmentDto.
6
+ * @returns An array of validation errors, empty if validation succeeds.
7
+ */
8
+ export declare function validateAttachmentDto(data: object): ValidationError[];
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateAttachmentDto = validateAttachmentDto;
4
+ const class_validator_1 = require("class-validator");
5
+ const class_transformer_1 = require("class-transformer");
6
+ const attachment_dto_1 = require("../dtos/attachment.dto");
7
+ /**
8
+ * Validates an AttachmentDto object using class-validator decorators.
9
+ *
10
+ * @param data The object to validate as an AttachmentDto.
11
+ * @returns An array of validation errors, empty if validation succeeds.
12
+ */
13
+ function validateAttachmentDto(data) {
14
+ const dto = (0, class_transformer_1.plainToInstance)(attachment_dto_1.AttachmentDto, data);
15
+ const errors = (0, class_validator_1.validateSync)(dto);
16
+ return errors;
17
+ }
@@ -0,0 +1 @@
1
+ import 'reflect-metadata';
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ require("reflect-metadata");
4
+ const attachment_validator_1 = require("./attachment-validator");
5
+ const baseValidDto = {
6
+ filename: 'document.pdf',
7
+ content: 'SGVsbG8gV29ybGQ=', // "Hello World" in base64
8
+ };
9
+ describe('AttachmentDto Validator', () => {
10
+ describe('Valid cases', () => {
11
+ it('should return no errors for a valid DTO', () => {
12
+ expect((0, attachment_validator_1.validateAttachmentDto)(baseValidDto)).toHaveLength(0);
13
+ });
14
+ it('should return no errors with optional contentType', () => {
15
+ const dto = { ...baseValidDto, contentType: 'application/pdf' };
16
+ expect((0, attachment_validator_1.validateAttachmentDto)(dto)).toHaveLength(0);
17
+ });
18
+ });
19
+ describe('Missing required fields', () => {
20
+ it('should return errors when all fields are missing', () => {
21
+ const errors = (0, attachment_validator_1.validateAttachmentDto)({});
22
+ expect(errors.some(e => e.property === 'filename')).toBe(true);
23
+ expect(errors.some(e => e.property === 'content')).toBe(true);
24
+ });
25
+ it('should return error when filename is missing', () => {
26
+ const dto = { content: 'SGVsbG8=' };
27
+ const errors = (0, attachment_validator_1.validateAttachmentDto)(dto);
28
+ expect(errors.some(e => e.property === 'filename')).toBe(true);
29
+ });
30
+ it('should return error when content is missing', () => {
31
+ const dto = { filename: 'test.pdf' };
32
+ const errors = (0, attachment_validator_1.validateAttachmentDto)(dto);
33
+ expect(errors.some(e => e.property === 'content')).toBe(true);
34
+ });
35
+ });
36
+ describe('Invalid field values', () => {
37
+ it('should return error for empty filename', () => {
38
+ const dto = { ...baseValidDto, filename: '' };
39
+ const errors = (0, attachment_validator_1.validateAttachmentDto)(dto);
40
+ expect(errors.some(e => e.property === 'filename')).toBe(true);
41
+ });
42
+ it('should return error for empty content', () => {
43
+ const dto = { ...baseValidDto, content: '' };
44
+ const errors = (0, attachment_validator_1.validateAttachmentDto)(dto);
45
+ expect(errors.some(e => e.property === 'content')).toBe(true);
46
+ });
47
+ it('should return error for non-base64 content', () => {
48
+ const dto = { ...baseValidDto, content: 'not-valid-base64!!!' };
49
+ const errors = (0, attachment_validator_1.validateAttachmentDto)(dto);
50
+ expect(errors.some(e => e.property === 'content')).toBe(true);
51
+ });
52
+ it('should return error for non-string contentType', () => {
53
+ const dto = { ...baseValidDto, contentType: 123 };
54
+ const errors = (0, attachment_validator_1.validateAttachmentDto)(dto);
55
+ expect(errors.some(e => e.property === 'contentType')).toBe(true);
56
+ });
57
+ });
58
+ });
@@ -0,0 +1,8 @@
1
+ import { ValidationError } from 'class-validator';
2
+ /**
3
+ * Validates an AttributeFieldDto object using class-validator decorators.
4
+ *
5
+ * @param data The object to validate as an AttributeFieldDto.
6
+ * @returns An array of validation errors, empty if validation succeeds.
7
+ */
8
+ export declare function validateAttributeFieldDto(data: object): ValidationError[];
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateAttributeFieldDto = validateAttributeFieldDto;
4
+ const class_validator_1 = require("class-validator");
5
+ const class_transformer_1 = require("class-transformer");
6
+ const attribute_field_dto_1 = require("../dtos/attribute-field.dto");
7
+ /**
8
+ * Validates an AttributeFieldDto object using class-validator decorators.
9
+ *
10
+ * @param data The object to validate as an AttributeFieldDto.
11
+ * @returns An array of validation errors, empty if validation succeeds.
12
+ */
13
+ function validateAttributeFieldDto(data) {
14
+ const dto = (0, class_transformer_1.plainToInstance)(attribute_field_dto_1.AttributeFieldDto, data);
15
+ const errors = (0, class_validator_1.validateSync)(dto);
16
+ return errors;
17
+ }
@@ -0,0 +1 @@
1
+ import 'reflect-metadata';
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ require("reflect-metadata");
4
+ const attribute_field_validator_1 = require("./attribute-field-validator");
5
+ const field_type_enum_1 = require("../enums/field-type.enum");
6
+ const language_enum_1 = require("../enums/language.enum");
7
+ const baseValidDto = {
8
+ id: 'attr-1',
9
+ label: [{ language: language_enum_1.LanguageEnum.ENGLISH, text: 'CPU Cores' }],
10
+ value: '4',
11
+ type: field_type_enum_1.FieldTypeEnum.TEXT_BOX,
12
+ required: true,
13
+ disabled: false,
14
+ upgradable: false,
15
+ };
16
+ describe('AttributeFieldDto Validator', () => {
17
+ describe('Valid cases', () => {
18
+ it('should return no errors for a valid DTO (inherited fields only)', () => {
19
+ expect((0, attribute_field_validator_1.validateAttributeFieldDto)(baseValidDto)).toHaveLength(0);
20
+ });
21
+ it('should return no errors with optional visibleInOrder and visibleInClientPanel', () => {
22
+ const dto = { ...baseValidDto, visibleInOrder: true, visibleInClientPanel: false };
23
+ expect((0, attribute_field_validator_1.validateAttributeFieldDto)(dto)).toHaveLength(0);
24
+ });
25
+ it('should return no errors with both repeatableMin and repeatableMax', () => {
26
+ const dto = { ...baseValidDto, repeatableMin: 1, repeatableMax: 5 };
27
+ expect((0, attribute_field_validator_1.validateAttributeFieldDto)(dto)).toHaveLength(0);
28
+ });
29
+ it('should return no errors when repeatableMin equals repeatableMax', () => {
30
+ const dto = { ...baseValidDto, repeatableMin: 3, repeatableMax: 3 };
31
+ expect((0, attribute_field_validator_1.validateAttributeFieldDto)(dto)).toHaveLength(0);
32
+ });
33
+ });
34
+ describe('AllOrNone constraint on repeatableMin/repeatableMax', () => {
35
+ it('should return error when only repeatableMin is provided', () => {
36
+ const dto = { ...baseValidDto, repeatableMin: 1 };
37
+ const errors = (0, attribute_field_validator_1.validateAttributeFieldDto)(dto);
38
+ expect(errors.length).toBeGreaterThan(0);
39
+ });
40
+ it('should return error when only repeatableMax is provided', () => {
41
+ const dto = { ...baseValidDto, repeatableMax: 5 };
42
+ const errors = (0, attribute_field_validator_1.validateAttributeFieldDto)(dto);
43
+ expect(errors.length).toBeGreaterThan(0);
44
+ });
45
+ });
46
+ describe('MinLessOrEqual constraint on repeatableMin/repeatableMax', () => {
47
+ it('should return error when repeatableMin is greater than repeatableMax', () => {
48
+ const dto = { ...baseValidDto, repeatableMin: 10, repeatableMax: 5 };
49
+ const errors = (0, attribute_field_validator_1.validateAttributeFieldDto)(dto);
50
+ expect(errors.length).toBeGreaterThan(0);
51
+ });
52
+ });
53
+ describe('Invalid field values', () => {
54
+ it('should return error for non-boolean visibleInOrder', () => {
55
+ const dto = { ...baseValidDto, visibleInOrder: 'yes' };
56
+ const errors = (0, attribute_field_validator_1.validateAttributeFieldDto)(dto);
57
+ expect(errors.some(e => e.property === 'visibleInOrder')).toBe(true);
58
+ });
59
+ it('should return error for non-boolean visibleInClientPanel', () => {
60
+ const dto = { ...baseValidDto, visibleInClientPanel: 1 };
61
+ const errors = (0, attribute_field_validator_1.validateAttributeFieldDto)(dto);
62
+ expect(errors.some(e => e.property === 'visibleInClientPanel')).toBe(true);
63
+ });
64
+ it('should return error for non-number repeatableMin', () => {
65
+ const dto = { ...baseValidDto, repeatableMin: 'one', repeatableMax: 5 };
66
+ const errors = (0, attribute_field_validator_1.validateAttributeFieldDto)(dto);
67
+ expect(errors.some(e => e.property === 'repeatableMin')).toBe(true);
68
+ });
69
+ it('should return error for non-number repeatableMax', () => {
70
+ const dto = { ...baseValidDto, repeatableMin: 1, repeatableMax: 'five' };
71
+ const errors = (0, attribute_field_validator_1.validateAttributeFieldDto)(dto);
72
+ expect(errors.some(e => e.property === 'repeatableMax')).toBe(true);
73
+ });
74
+ });
75
+ describe('Inherited FieldDto validation', () => {
76
+ it('should return errors when inherited required fields are missing', () => {
77
+ const errors = (0, attribute_field_validator_1.validateAttributeFieldDto)({});
78
+ const requiredProps = ['id', 'label', 'value', 'type', 'required', 'disabled'];
79
+ for (const prop of requiredProps) {
80
+ expect(errors.some(e => e.property === prop)).toBe(true);
81
+ }
82
+ });
83
+ });
84
+ });