@topconsultnpm/sdk-ts 6.20.0-dev2.7 → 6.20.0-dev2.9
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/dist/lib/helper/PlatformObjectValidator.js +41 -0
- package/dist/lib/helper/SDK_Localizator.js +10 -0
- package/dist/lib/helper/utils.js +2 -0
- package/dist/lib/openAPIs/TopMediaServiceClient.js +1 -1
- package/dist/types/helper/PlatformObjectValidator.d.ts +3 -1
- package/dist/types/helper/SDK_Localizator.d.ts +1 -0
- package/dist/types/helper/utils.d.ts +9 -7
- package/dist/types/openAPIs/TopMediaServiceClient.d.ts +1 -1
- package/package.json +31 -31
|
@@ -307,4 +307,45 @@ export class PlatformObjectValidator {
|
|
|
307
307
|
return dtdFrom;
|
|
308
308
|
});
|
|
309
309
|
}
|
|
310
|
+
static DataListValidator(d) {
|
|
311
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
312
|
+
var _a;
|
|
313
|
+
let vil = [];
|
|
314
|
+
this.ObjectNameValidator(d.name, TMPropertyNames.entityName, vil, TMPropertyNames.entityName);
|
|
315
|
+
this.RequiredObjectValidator(d.items, TMPropertyNames.items, vil, '');
|
|
316
|
+
if (d.items) {
|
|
317
|
+
if (d.items.length == 0)
|
|
318
|
+
this.RequiredNotEqualZeroNumberValidator_RequiredField((_a = d.items) === null || _a === void 0 ? void 0 : _a.length, TMPropertyNames.items, vil, '');
|
|
319
|
+
else {
|
|
320
|
+
let viList;
|
|
321
|
+
let i = 0;
|
|
322
|
+
for (let aid of d.items) {
|
|
323
|
+
i++;
|
|
324
|
+
viList = [];
|
|
325
|
+
yield this.DataListItemValidator(aid, viList, true);
|
|
326
|
+
for (let vi of viList) {
|
|
327
|
+
vil.push(new ValidationItem(vi.ResultType, vi.PropertyName, `${SDK_Localizator.DataListItem} #${i} - ${vi.Message}`));
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
for (let curdlid of d.items) {
|
|
331
|
+
let v = d.items.filter(i => i.value == curdlid.value);
|
|
332
|
+
if (v.length > 1) {
|
|
333
|
+
vil.push(new ValidationItem(ResultTypes.ERROR, "items", `Esistono più elementi della lista dati con valore ${v[0].value}`));
|
|
334
|
+
break;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
return vil;
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
static DataListItemValidator(dlid_1, vil_1) {
|
|
343
|
+
return __awaiter(this, arguments, void 0, function* (dlid, vil, showPropertyName = false) {
|
|
344
|
+
this.RequiredStringValidator(dlid.value, TMPropertyNames.value, vil, '');
|
|
345
|
+
if (!dlid.name) {
|
|
346
|
+
vil.push(new ValidationItem(ResultTypes.ERROR, "itemName", SDK_Localizator.RequiredField));
|
|
347
|
+
return;
|
|
348
|
+
}
|
|
349
|
+
});
|
|
350
|
+
}
|
|
310
351
|
}
|
|
@@ -68,6 +68,16 @@ export class SDK_Localizator {
|
|
|
68
68
|
default: return "Lista dati";
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
+
static get DataListItem() {
|
|
72
|
+
switch (this._cultureID) {
|
|
73
|
+
case CultureIDs.De_DE: return "Datenlistenelement";
|
|
74
|
+
case CultureIDs.En_US: return "Data list item";
|
|
75
|
+
case CultureIDs.Es_ES: return "Elemento de lista de datos";
|
|
76
|
+
case CultureIDs.Fr_FR: return "Élément de la liste de données";
|
|
77
|
+
case CultureIDs.Pt_PT: return "Elemento da lista de dados";
|
|
78
|
+
default: return "Elemento della lista dati";
|
|
79
|
+
}
|
|
80
|
+
}
|
|
71
81
|
static get DataLists() {
|
|
72
82
|
switch (this._cultureID) {
|
|
73
83
|
case CultureIDs.De_DE: return "Datenlisten";
|
package/dist/lib/helper/utils.js
CHANGED
|
@@ -13,10 +13,12 @@ export class TMPropertyNames {
|
|
|
13
13
|
}
|
|
14
14
|
TMPropertyNames.entityName = "name";
|
|
15
15
|
TMPropertyNames.fromTid = "fromTid";
|
|
16
|
+
TMPropertyNames.items = "items";
|
|
16
17
|
TMPropertyNames.join = "join";
|
|
17
18
|
TMPropertyNames.maxDcmtsToBeReturned = "maxDcmtsToBeReturned";
|
|
18
19
|
TMPropertyNames.orderBy = "orderBy";
|
|
19
20
|
TMPropertyNames.select = "select";
|
|
21
|
+
TMPropertyNames.value = "value";
|
|
20
22
|
TMPropertyNames.where = "where";
|
|
21
23
|
export class TMScopeNames {
|
|
22
24
|
}
|