@hosterai/types 0.0.26 → 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.
- package/README.md +49 -8
- package/dist/dtos/attachment.dto.js +17 -0
- package/dist/dtos/attribute-field.dto.d.ts +9 -10
- package/dist/dtos/attribute-field.dto.js +28 -38
- package/dist/dtos/base-response.dto.js +11 -0
- package/dist/dtos/client-data.dto.js +82 -0
- package/dist/dtos/company-data.dto.js +97 -0
- package/dist/dtos/country.dto.js +17 -0
- package/dist/dtos/error-response.dto.js +15 -0
- package/dist/dtos/field.dto.d.ts +17 -1
- package/dist/dtos/field.dto.js +41 -10
- package/dist/dtos/info.dto.d.ts +0 -6
- package/dist/dtos/info.dto.js +0 -24
- package/dist/dtos/invoice/invoice-item-data.dto.js +7 -0
- package/dist/dtos/invoice/requests/credit-note-request.dto.js +6 -0
- package/dist/dtos/invoice/requests/invoice-request.dto.js +6 -0
- package/dist/dtos/invoice/requests/proforma-invoice-request.dto.d.ts +3 -0
- package/dist/dtos/invoice/requests/proforma-invoice-request.dto.js +51 -3
- package/dist/dtos/invoice/requests/tax-details-request.dto.d.ts +31 -0
- package/dist/dtos/invoice/requests/tax-details-request.dto.js +84 -0
- package/dist/dtos/invoice/responses/proforma-invoice-response.dto.js +17 -0
- package/dist/dtos/invoice/responses/tax-details-response.dto.d.ts +20 -0
- package/dist/dtos/invoice/responses/tax-details-response.dto.js +56 -0
- package/dist/dtos/invoice/tin-validation-details.dto.d.ts +51 -0
- package/dist/dtos/invoice/tin-validation-details.dto.js +165 -0
- package/dist/dtos/invoice/transaction-data.dto.js +22 -0
- package/dist/dtos/invoice-contact-data.dto.js +102 -0
- package/dist/dtos/item-data.dto.d.ts +2 -2
- package/dist/dtos/item-data.dto.js +63 -2
- package/dist/dtos/jwt.dto.js +27 -0
- package/dist/dtos/multilang-text.dto.js +12 -0
- package/dist/dtos/notification/receiver/receiver-email.dto.js +19 -0
- package/dist/dtos/notification/receiver/receiver-sms.dto.js +7 -0
- package/dist/dtos/notification/requests/notification-send-request.dto.d.ts +3 -3
- package/dist/dtos/notification/requests/notification-send-request.dto.js +27 -3
- package/dist/dtos/notification/responses/notification-send-response.dto.js +6 -0
- package/dist/dtos/notification/sender/sender-email.dto.js +26 -0
- package/dist/dtos/notification/sender/sender-push.dto.js +36 -0
- package/dist/dtos/notification/sender/sender-sms.dto.js +11 -0
- package/dist/dtos/product/product-info.dto.d.ts +4 -4
- package/dist/dtos/product/product-info.dto.js +7 -7
- package/dist/dtos/product/product-item-data.dto.d.ts +1 -1
- package/dist/dtos/product/product-item-data.dto.js +8 -1
- package/dist/dtos/product/requests/product-create-request.dto.d.ts +1 -1
- package/dist/dtos/product/requests/product-create-request.dto.js +12 -1
- package/dist/dtos/product/requests/product-delete-request.dto.d.ts +1 -1
- package/dist/dtos/product/requests/product-delete-request.dto.js +12 -1
- package/dist/dtos/product/requests/product-downgradable-request.dto.d.ts +1 -1
- package/dist/dtos/product/requests/product-downgradable-request.dto.js +12 -1
- package/dist/dtos/product/requests/product-downgrade-request.dto.d.ts +1 -1
- package/dist/dtos/product/requests/product-downgrade-request.dto.js +17 -1
- package/dist/dtos/product/requests/product-renew-request.dto.d.ts +1 -1
- package/dist/dtos/product/requests/product-renew-request.dto.js +12 -1
- package/dist/dtos/product/requests/product-suspend-request.dto.d.ts +1 -1
- package/dist/dtos/product/requests/product-suspend-request.dto.js +12 -1
- package/dist/dtos/product/requests/product-unsuspend-request.dto.d.ts +1 -1
- package/dist/dtos/product/requests/product-unsuspend-request.dto.js +12 -1
- package/dist/dtos/product/requests/product-upgradable-request.dto.d.ts +1 -1
- package/dist/dtos/product/requests/product-upgradable-request.dto.js +12 -1
- package/dist/dtos/product/requests/product-upgrade-request.dto.d.ts +1 -1
- package/dist/dtos/product/requests/product-upgrade-request.dto.js +17 -1
- package/dist/dtos/product/responses/product-create-response.dto.js +37 -0
- package/dist/dtos/product/responses/product-delete-response.dto.js +37 -0
- package/dist/dtos/product/responses/product-downgradable-response.dto.js +37 -0
- package/dist/dtos/product/responses/product-downgrade-response.dto.js +37 -0
- package/dist/dtos/product/responses/product-info-response.dto.js +6 -0
- package/dist/dtos/product/responses/product-renew-response.dto.js +37 -0
- package/dist/dtos/product/responses/product-suspend-response.dto.js +37 -0
- package/dist/dtos/product/responses/product-unsuspend-response.dto.js +37 -0
- package/dist/dtos/product/responses/product-upgradable-response.dto.js +37 -0
- package/dist/dtos/product/responses/product-upgrade-response.dto.js +37 -0
- package/dist/dtos/requests/validate-attributes-request.dto.js +12 -0
- package/dist/dtos/response-data.dto.js +19 -0
- package/dist/dtos/responses/validate-attributes-response.dto.js +7 -0
- package/dist/dtos/setup-status-response.dto.js +20 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +24 -0
- package/dist/openapi/schemas/components.schemas.d.ts +152 -37
- package/dist/openapi/schemas/components.schemas.js +178 -96
- package/dist/validators/addon-field-validator.d.ts +9 -0
- package/dist/validators/addon-field-validator.js +14 -0
- package/dist/validators/addon-field-validator.spec.d.ts +1 -0
- package/dist/validators/addon-field-validator.spec.js +38 -0
- package/dist/validators/attachment-validator.d.ts +8 -0
- package/dist/validators/attachment-validator.js +17 -0
- package/dist/validators/attachment-validator.spec.d.ts +1 -0
- package/dist/validators/attachment-validator.spec.js +58 -0
- package/dist/validators/attribute-field-validator.d.ts +8 -0
- package/dist/validators/attribute-field-validator.js +17 -0
- package/dist/validators/attribute-field-validator.spec.d.ts +1 -0
- package/dist/validators/attribute-field-validator.spec.js +84 -0
- package/dist/validators/country-validator.d.ts +8 -0
- package/dist/validators/country-validator.js +17 -0
- package/dist/validators/country-validator.spec.d.ts +1 -0
- package/dist/validators/country-validator.spec.js +58 -0
- package/dist/validators/field-validator.spec.js +1 -29
- package/dist/validators/info-validator.d.ts +8 -0
- package/dist/validators/info-validator.js +17 -0
- package/dist/validators/info-validator.spec.d.ts +1 -0
- package/dist/validators/info-validator.spec.js +85 -0
- package/dist/validators/invoice-contact-data-validator.d.ts +8 -0
- package/dist/validators/invoice-contact-data-validator.js +17 -0
- package/dist/validators/invoice-contact-data-validator.spec.d.ts +1 -0
- package/dist/validators/invoice-contact-data-validator.spec.js +88 -0
- package/dist/validators/invoice-info-validator.d.ts +8 -0
- package/dist/validators/invoice-info-validator.js +17 -0
- package/dist/validators/invoice-info-validator.spec.d.ts +1 -0
- package/dist/validators/invoice-info-validator.spec.js +81 -0
- package/dist/validators/invoice-item-data-validator.d.ts +8 -0
- package/dist/validators/invoice-item-data-validator.js +17 -0
- package/dist/validators/invoice-item-data-validator.spec.d.ts +1 -0
- package/dist/validators/invoice-item-data-validator.spec.js +45 -0
- package/dist/validators/item-data-validator.d.ts +8 -0
- package/dist/validators/item-data-validator.js +17 -0
- package/dist/validators/item-data-validator.spec.d.ts +1 -0
- package/dist/validators/item-data-validator.spec.js +79 -0
- package/dist/validators/notification-request-validator.js +1 -1
- package/dist/validators/product-create-request-validator.js +1 -1
- package/dist/validators/product-delete-request-validator.js +1 -1
- package/dist/validators/product-downgradable-request-validator.js +1 -1
- package/dist/validators/product-downgrade-request-validator.js +1 -1
- package/dist/validators/product-info-validator.spec.js +5 -1
- package/dist/validators/product-item-data-validator.d.ts +8 -0
- package/dist/validators/product-item-data-validator.js +17 -0
- package/dist/validators/product-item-data-validator.spec.d.ts +1 -0
- package/dist/validators/product-item-data-validator.spec.js +60 -0
- package/dist/validators/product-renew-request-validator.js +1 -1
- package/dist/validators/product-suspend-request-validator.js +1 -1
- package/dist/validators/product-unsuspend-request-validator.js +1 -1
- package/dist/validators/product-upgradable-request-validator.js +1 -1
- package/dist/validators/product-upgrade-request-validator.js +1 -1
- package/dist/validators/tab-validator.d.ts +8 -0
- package/dist/validators/tab-validator.js +17 -0
- package/dist/validators/tab-validator.spec.d.ts +1 -0
- package/dist/validators/tab-validator.spec.js +49 -0
- package/dist/validators/tin-validation-details-validator.d.ts +8 -0
- package/dist/validators/tin-validation-details-validator.js +17 -0
- package/dist/validators/tin-validation-details-validator.spec.d.ts +1 -0
- package/dist/validators/tin-validation-details-validator.spec.js +77 -0
- package/dist/validators/transaction-data-validator.d.ts +8 -0
- package/dist/validators/transaction-data-validator.js +17 -0
- package/dist/validators/transaction-data-validator.spec.d.ts +1 -0
- package/dist/validators/transaction-data-validator.spec.js +62 -0
- 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",
|
|
@@ -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
|
-
"
|
|
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": [
|
|
@@ -1899,49 +1886,6 @@ exports.ComponentsSchemas = {
|
|
|
1899
1886
|
"EN"
|
|
1900
1887
|
]
|
|
1901
1888
|
},
|
|
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
1889
|
"listenEvents": {
|
|
1946
1890
|
"items": {
|
|
1947
1891
|
"enum": [
|
|
@@ -2227,11 +2171,148 @@ exports.ComponentsSchemas = {
|
|
|
2227
2171
|
"supportedLanguages"
|
|
2228
2172
|
]
|
|
2229
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
|
+
},
|
|
2230
2311
|
"ProductInfoDto": {
|
|
2231
2312
|
"properties": {
|
|
2232
2313
|
"productAttributes": {
|
|
2233
2314
|
"items": {
|
|
2234
|
-
"$ref": "#/components/schemas/
|
|
2315
|
+
"$ref": "#/components/schemas/AttributeFieldDto"
|
|
2235
2316
|
},
|
|
2236
2317
|
"type": "array",
|
|
2237
2318
|
"minItems": 1,
|
|
@@ -2240,7 +2321,7 @@ exports.ComponentsSchemas = {
|
|
|
2240
2321
|
},
|
|
2241
2322
|
"itemAttributes": {
|
|
2242
2323
|
"items": {
|
|
2243
|
-
"$ref": "#/components/schemas/
|
|
2324
|
+
"$ref": "#/components/schemas/AttributeFieldDto"
|
|
2244
2325
|
},
|
|
2245
2326
|
"type": "array",
|
|
2246
2327
|
"minItems": 1,
|
|
@@ -2275,7 +2356,7 @@ exports.ComponentsSchemas = {
|
|
|
2275
2356
|
"status_text": "status"
|
|
2276
2357
|
}
|
|
2277
2358
|
},
|
|
2278
|
-
"
|
|
2359
|
+
"supportedActions": {
|
|
2279
2360
|
"items": {
|
|
2280
2361
|
"enum": [
|
|
2281
2362
|
"create",
|
|
@@ -2793,6 +2874,7 @@ exports.ComponentsSchemas = {
|
|
|
2793
2874
|
},
|
|
2794
2875
|
"type": "object",
|
|
2795
2876
|
"required": [
|
|
2877
|
+
"supportedActions",
|
|
2796
2878
|
"title",
|
|
2797
2879
|
"supportedLanguages"
|
|
2798
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';
|
|
@@ -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
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ValidationError } from 'class-validator';
|
|
2
|
+
/**
|
|
3
|
+
* Validates a CountryDto object using class-validator decorators.
|
|
4
|
+
*
|
|
5
|
+
* @param data The object to validate as a CountryDto.
|
|
6
|
+
* @returns An array of validation errors, empty if validation succeeds.
|
|
7
|
+
*/
|
|
8
|
+
export declare function validateCountryDto(data: object): ValidationError[];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateCountryDto = validateCountryDto;
|
|
4
|
+
const class_validator_1 = require("class-validator");
|
|
5
|
+
const class_transformer_1 = require("class-transformer");
|
|
6
|
+
const country_dto_1 = require("../dtos/country.dto");
|
|
7
|
+
/**
|
|
8
|
+
* Validates a CountryDto object using class-validator decorators.
|
|
9
|
+
*
|
|
10
|
+
* @param data The object to validate as a CountryDto.
|
|
11
|
+
* @returns An array of validation errors, empty if validation succeeds.
|
|
12
|
+
*/
|
|
13
|
+
function validateCountryDto(data) {
|
|
14
|
+
const dto = (0, class_transformer_1.plainToInstance)(country_dto_1.CountryDto, data);
|
|
15
|
+
const errors = (0, class_validator_1.validateSync)(dto);
|
|
16
|
+
return errors;
|
|
17
|
+
}
|