@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
@@ -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",
@@ -466,7 +472,9 @@ exports.ComponentsSchemas = {
466
472
  "properties": {
467
473
  "url": {
468
474
  "format": "url",
469
- "type": "string"
475
+ "type": "string",
476
+ "title": "URL",
477
+ "description": "URL to the settings page."
470
478
  },
471
479
  "label": {
472
480
  "minLength": 1,
@@ -502,7 +510,7 @@ exports.ComponentsSchemas = {
502
510
  },
503
511
  "type": "array",
504
512
  "title": "Tabs",
505
- "description": "Tabs shown on the settings page."
513
+ "description": "List of tabs for the settings page."
506
514
  },
507
515
  "label": {
508
516
  "minLength": 1,
@@ -939,11 +947,15 @@ exports.ComponentsSchemas = {
939
947
  "ZA",
940
948
  "ZU"
941
949
  ],
942
- "type": "string"
950
+ "type": "string",
951
+ "title": "Language",
952
+ "description": "The language of the text."
943
953
  },
944
954
  "text": {
945
955
  "minLength": 1,
946
- "type": "string"
956
+ "type": "string",
957
+ "title": "Text",
958
+ "description": "The text content in the specified language."
947
959
  }
948
960
  },
949
961
  "type": "object",
@@ -1032,12 +1044,6 @@ exports.ComponentsSchemas = {
1032
1044
  "title": "Field Type",
1033
1045
  "description": "Type of the field."
1034
1046
  },
1035
- "repeatableMin": {
1036
- "type": "number"
1037
- },
1038
- "repeatableMax": {
1039
- "type": "number"
1040
- },
1041
1047
  "required": {
1042
1048
  "type": "boolean",
1043
1049
  "title": "Required",
@@ -1048,15 +1054,8 @@ exports.ComponentsSchemas = {
1048
1054
  "title": "Disabled",
1049
1055
  "description": "Whether the field is disabled."
1050
1056
  },
1051
- "visibleInOrder": {
1052
- "type": "boolean",
1053
- "title": "Visible In Order",
1054
- "description": "Whether the field is visible in order."
1055
- },
1056
- "visibleInClientPanel": {
1057
- "type": "boolean",
1058
- "title": "Visible In Client Panel",
1059
- "description": "Whether the field is visible in client panel."
1057
+ "hidden": {
1058
+ "type": "boolean"
1060
1059
  },
1061
1060
  "regexValidation": {
1062
1061
  "type": "string",
@@ -1068,27 +1067,32 @@ exports.ComponentsSchemas = {
1068
1067
  "items": {
1069
1068
  "$ref": "#/components/schemas/MultilangTextDto"
1070
1069
  },
1070
+ "minItems": 1,
1071
1071
  "type": "array",
1072
1072
  "title": "Regex Validation Error Message",
1073
1073
  "description": "Localized error message shown when regex validation fails."
1074
1074
  },
1075
1075
  "triggersRemoteValidation": {
1076
- "type": "boolean",
1077
- "title": "Triggers Remote Validation",
1078
- "description": "If true, field triggers remote validation."
1076
+ "type": "boolean"
1079
1077
  },
1080
1078
  "remoteValidationErrorMessage": {
1081
1079
  "items": {
1082
1080
  "$ref": "#/components/schemas/MultilangTextDto"
1083
1081
  },
1082
+ "minItems": 1,
1084
1083
  "type": "array",
1085
1084
  "title": "Remote Validation Error Message",
1086
- "description": "Localized error messages for remote validation."
1085
+ "description": "Localized error message shown when remote validation fails."
1087
1086
  },
1088
1087
  "upgradable": {
1089
1088
  "type": "boolean",
1090
1089
  "title": "Upgradable",
1091
1090
  "description": "Whether the item attribute is upgradable by the user."
1091
+ },
1092
+ "downgradable": {
1093
+ "type": "boolean",
1094
+ "title": "Downgradable",
1095
+ "description": "Whether the item attribute is downgradable by the user."
1092
1096
  }
1093
1097
  },
1094
1098
  "type": "object",
@@ -1098,10 +1102,7 @@ exports.ComponentsSchemas = {
1098
1102
  "value",
1099
1103
  "type",
1100
1104
  "required",
1101
- "disabled",
1102
- "visibleInOrder",
1103
- "visibleInClientPanel",
1104
- "upgradable"
1105
+ "disabled"
1105
1106
  ]
1106
1107
  },
1107
1108
  "InfoDto": {
@@ -1324,25 +1325,6 @@ exports.ComponentsSchemas = {
1324
1325
  "EN"
1325
1326
  ]
1326
1327
  },
1327
- "supportedActions": {
1328
- "items": {
1329
- "enum": [
1330
- "create",
1331
- "renew",
1332
- "upgrade",
1333
- "downgrade",
1334
- "transfer",
1335
- "trade",
1336
- "suspend",
1337
- "unsuspend",
1338
- "delete"
1339
- ],
1340
- "type": "string"
1341
- },
1342
- "type": "array",
1343
- "title": "Supported Actions",
1344
- "description": "Actions supported by this integration."
1345
- },
1346
1328
  "listenEvents": {
1347
1329
  "items": {
1348
1330
  "enum": [
@@ -1904,25 +1886,6 @@ exports.ComponentsSchemas = {
1904
1886
  "EN"
1905
1887
  ]
1906
1888
  },
1907
- "supportedActions": {
1908
- "items": {
1909
- "enum": [
1910
- "create",
1911
- "renew",
1912
- "upgrade",
1913
- "downgrade",
1914
- "transfer",
1915
- "trade",
1916
- "suspend",
1917
- "unsuspend",
1918
- "delete"
1919
- ],
1920
- "type": "string"
1921
- },
1922
- "type": "array",
1923
- "title": "Supported Actions",
1924
- "description": "Actions supported by this integration."
1925
- },
1926
1889
  "listenEvents": {
1927
1890
  "items": {
1928
1891
  "enum": [
@@ -2208,11 +2171,148 @@ exports.ComponentsSchemas = {
2208
2171
  "supportedLanguages"
2209
2172
  ]
2210
2173
  },
2174
+ "AttributeFieldDto": {
2175
+ "properties": {
2176
+ "visibleInOrder": {
2177
+ "type": "boolean",
2178
+ "title": "Visible In Order",
2179
+ "description": "Whether the field is visible in order view."
2180
+ },
2181
+ "visibleInClientPanel": {
2182
+ "type": "boolean",
2183
+ "title": "Visible In Client Panel",
2184
+ "description": "Whether the field is visible in the client panel."
2185
+ },
2186
+ "repeatableMin": {
2187
+ "type": "number",
2188
+ "title": "Repeatable Min",
2189
+ "description": "Minimum repeats for repeatable fields."
2190
+ },
2191
+ "repeatableMax": {
2192
+ "type": "number",
2193
+ "title": "Repeatable Max",
2194
+ "description": "Maximum repeats for repeatable fields."
2195
+ },
2196
+ "id": {
2197
+ "type": "string",
2198
+ "title": "ID",
2199
+ "description": "Unique identifier for the field."
2200
+ },
2201
+ "label": {
2202
+ "items": {
2203
+ "$ref": "#/components/schemas/MultilangTextDto"
2204
+ },
2205
+ "minItems": 1,
2206
+ "type": "array",
2207
+ "title": "Label",
2208
+ "description": "Multilingual label for the field."
2209
+ },
2210
+ "value": {
2211
+ "title": "Value",
2212
+ "description": "Value of the field. String/Number, or FieldOptionDto/FieldOptionDto[] depending on type.",
2213
+ "oneOf": [
2214
+ {
2215
+ "title": "String",
2216
+ "type": "string"
2217
+ },
2218
+ {
2219
+ "title": "Number",
2220
+ "type": "number"
2221
+ },
2222
+ {
2223
+ "title": "Option",
2224
+ "$ref": "#/components/schemas/FieldOptionDto"
2225
+ },
2226
+ {
2227
+ "title": "Options Array",
2228
+ "type": "array",
2229
+ "items": {
2230
+ "$ref": "#/components/schemas/FieldOptionDto"
2231
+ }
2232
+ }
2233
+ ]
2234
+ },
2235
+ "type": {
2236
+ "enum": [
2237
+ "TEXT_BOX",
2238
+ "TEXT_AREA",
2239
+ "SELECT",
2240
+ "MULTI_SELECT",
2241
+ "DESCRIPTION",
2242
+ "RADIO_BOX",
2243
+ "CHECKBOX",
2244
+ "SLIDER"
2245
+ ],
2246
+ "type": "string",
2247
+ "title": "Field Type",
2248
+ "description": "Type of the field."
2249
+ },
2250
+ "required": {
2251
+ "type": "boolean",
2252
+ "title": "Required",
2253
+ "description": "Whether the field is required."
2254
+ },
2255
+ "disabled": {
2256
+ "type": "boolean",
2257
+ "title": "Disabled",
2258
+ "description": "Whether the field is disabled."
2259
+ },
2260
+ "hidden": {
2261
+ "type": "boolean"
2262
+ },
2263
+ "regexValidation": {
2264
+ "type": "string",
2265
+ "title": "Regex Validation",
2266
+ "description": "Optional regex to validate input.",
2267
+ "example": "^[A-Za-z0-9_-]+$"
2268
+ },
2269
+ "regexValidationErrorMessage": {
2270
+ "items": {
2271
+ "$ref": "#/components/schemas/MultilangTextDto"
2272
+ },
2273
+ "minItems": 1,
2274
+ "type": "array",
2275
+ "title": "Regex Validation Error Message",
2276
+ "description": "Localized error message shown when regex validation fails."
2277
+ },
2278
+ "triggersRemoteValidation": {
2279
+ "type": "boolean"
2280
+ },
2281
+ "remoteValidationErrorMessage": {
2282
+ "items": {
2283
+ "$ref": "#/components/schemas/MultilangTextDto"
2284
+ },
2285
+ "minItems": 1,
2286
+ "type": "array",
2287
+ "title": "Remote Validation Error Message",
2288
+ "description": "Localized error message shown when remote validation fails."
2289
+ },
2290
+ "upgradable": {
2291
+ "type": "boolean",
2292
+ "title": "Upgradable",
2293
+ "description": "Whether the item attribute is upgradable by the user."
2294
+ },
2295
+ "downgradable": {
2296
+ "type": "boolean",
2297
+ "title": "Downgradable",
2298
+ "description": "Whether the item attribute is downgradable by the user."
2299
+ }
2300
+ },
2301
+ "type": "object",
2302
+ "required": [
2303
+ "id",
2304
+ "label",
2305
+ "value",
2306
+ "type",
2307
+ "required",
2308
+ "disabled"
2309
+ ]
2310
+ },
2211
2311
  "ProductInfoDto": {
2212
2312
  "properties": {
2213
2313
  "productAttributes": {
2214
2314
  "items": {
2215
- "$ref": "#/components/schemas/FieldDto"
2315
+ "$ref": "#/components/schemas/AttributeFieldDto"
2216
2316
  },
2217
2317
  "type": "array",
2218
2318
  "minItems": 1,
@@ -2221,7 +2321,7 @@ exports.ComponentsSchemas = {
2221
2321
  },
2222
2322
  "itemAttributes": {
2223
2323
  "items": {
2224
- "$ref": "#/components/schemas/FieldDto"
2324
+ "$ref": "#/components/schemas/AttributeFieldDto"
2225
2325
  },
2226
2326
  "type": "array",
2227
2327
  "minItems": 1,
@@ -2256,6 +2356,26 @@ exports.ComponentsSchemas = {
2256
2356
  "status_text": "status"
2257
2357
  }
2258
2358
  },
2359
+ "supportedActions": {
2360
+ "items": {
2361
+ "enum": [
2362
+ "create",
2363
+ "renew",
2364
+ "upgrade",
2365
+ "downgrade",
2366
+ "transfer",
2367
+ "trade",
2368
+ "suspend",
2369
+ "unsuspend",
2370
+ "delete"
2371
+ ],
2372
+ "type": "string"
2373
+ },
2374
+ "type": "array",
2375
+ "minLength": 1,
2376
+ "title": "Supported Actions",
2377
+ "description": "Actions supported by this integration."
2378
+ },
2259
2379
  "title": {
2260
2380
  "minLength": 1,
2261
2381
  "type": "string",
@@ -2474,25 +2594,6 @@ exports.ComponentsSchemas = {
2474
2594
  "EN"
2475
2595
  ]
2476
2596
  },
2477
- "supportedActions": {
2478
- "items": {
2479
- "enum": [
2480
- "create",
2481
- "renew",
2482
- "upgrade",
2483
- "downgrade",
2484
- "transfer",
2485
- "trade",
2486
- "suspend",
2487
- "unsuspend",
2488
- "delete"
2489
- ],
2490
- "type": "string"
2491
- },
2492
- "type": "array",
2493
- "title": "Supported Actions",
2494
- "description": "Actions supported by this integration."
2495
- },
2496
2597
  "listenEvents": {
2497
2598
  "items": {
2498
2599
  "enum": [
@@ -2773,6 +2874,7 @@ exports.ComponentsSchemas = {
2773
2874
  },
2774
2875
  "type": "object",
2775
2876
  "required": [
2877
+ "supportedActions",
2776
2878
  "title",
2777
2879
  "supportedLanguages"
2778
2880
  ]
@@ -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';