@colijnit/ioneconnector 2.0.3 → 2.0.6
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/build/connector.js +25 -57
- package/build/connector.unit.test.js +36 -67
- package/build/enum/backend-service-name.enum.js +4 -2
- package/build/enum/datasession-service-method.enum.js +4 -2
- package/build/enum/db-boolean-value-type.enum.js +15 -12
- package/build/enum/end-point.enum.js +4 -2
- package/build/enum/login-service-method.enum.js +4 -2
- package/build/enum/one-zero-bool-db-type.enum.js +6 -3
- package/build/enum/public-service-method.enum.js +4 -2
- package/build/enum/true-false-db-type.enum.js +6 -3
- package/build/enum/yes-no-db-type.enum.js +6 -3
- package/build/factory/decorators/boolean.decorator.js +34 -34
- package/build/factory/decorators/complex-array.decorator.js +18 -18
- package/build/factory/decorators/complex-field.decorator.js +18 -18
- package/build/factory/decorators/date-field.decorator.js +14 -14
- package/build/factory/decorators/db-field-alias.decorator.js +15 -15
- package/build/factory/decorators/json.decorator.js +12 -12
- package/build/factory/decorators/map-property.decorator.js +13 -13
- package/build/factory/decorators/no-db-field.decorator.js +13 -13
- package/build/factory/decorators/string-number.decorator.js +16 -16
- package/build/model/business-object.js +38 -39
- package/build/model/constant/java-constants.js +4 -2
- package/build/model/data-service-data.js +5 -6
- package/build/model/data-service-response-data.interface.js +2 -0
- package/build/model/data-service-response-data.js +31 -42
- package/build/model/data-service-response-exception.js +2 -0
- package/build/model/data-service-response-root.js +2 -0
- package/build/model/field-validation.interface.js +2 -0
- package/build/model/field-validation.js +14 -13
- package/build/model/field-validations-object.interface.js +2 -0
- package/build/model/field-validations-object.js +2 -0
- package/build/model/login-response.interface.js +2 -0
- package/build/model/login-response.js +6 -22
- package/build/model/login.js +20 -31
- package/build/model/options.js +6 -5
- package/build/model/paging-parameters.interface.js +5 -6
- package/build/model/paging-parameters.js +20 -23
- package/build/model/server-response-data.js +2 -0
- package/build/model/server-stack-trace-element.js +2 -0
- package/build/model/session.js +6 -5
- package/build/model/validation-message.interface.js +2 -0
- package/build/model/validation-message.js +22 -21
- package/build/model/validation-result.interface.js +2 -0
- package/build/model/validation-result.js +15 -15
- package/build/provider/ajax.service.js +70 -136
- package/build/provider/base-backend-connection.service.js +38 -73
- package/build/service/business-object-factory.js +47 -46
- package/build/service/datasession.service.js +18 -49
- package/build/service/encrypt.service.js +27 -18
- package/build/service/encrypt.service.unit.test.js +8 -6
- package/build/service/login.service.js +69 -110
- package/build/service/public.service.js +16 -16
- package/build/tests/int/connector.int.test.js +6 -4
- package/build/type/business-object-id-type.js +8 -6
- package/build/type/object-configuration-default-value-type.js +2 -0
- package/build/utils/array-utils.js +16 -17
- package/build/utils/business-object-utils.js +12 -13
- package/build/utils/date-utils.js +9 -10
- package/build/utils/function/is-nill.function.js +4 -1
- package/build/utils/function/not-nill.function.js +4 -1
- package/build/utils/image-utils.js +10 -11
- package/build/utils/number-utils.js +25 -28
- package/build/utils/object-utils.js +45 -51
- package/build/utils/parameter-value-conversion-utils.js +9 -10
- package/build/utils/promise-utils.js +14 -50
- package/build/utils/ref-code-utils.js +12 -17
- package/build/utils/string-utils.js +17 -19
- package/build/utils/url-utils.js +11 -12
- package/package.json +5 -2
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const date_utils_1 = require("../../utils/date-utils");
|
|
4
|
+
const PROP_META_KEY = "dateField";
|
|
5
|
+
function DateField() {
|
|
4
6
|
return function (target, propertyKey) {
|
|
5
7
|
if (!target || !propertyKey) {
|
|
6
8
|
return;
|
|
@@ -8,18 +10,16 @@ export function DateField() {
|
|
|
8
10
|
Reflect.defineMetadata(PROP_META_KEY, undefined, target, propertyKey);
|
|
9
11
|
};
|
|
10
12
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
DateFieldFieldDecorator.IsDateField = function (target, propertyKey) {
|
|
13
|
+
exports.DateField = DateField;
|
|
14
|
+
class DateFieldFieldDecorator {
|
|
15
|
+
static IsDateField(target, propertyKey) {
|
|
15
16
|
if (!target || !propertyKey || typeof target !== "object") {
|
|
16
17
|
return false;
|
|
17
18
|
}
|
|
18
19
|
return Reflect.hasMetadata(PROP_META_KEY, target, propertyKey);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
return DateUtils.StringAsDate(str);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
export { DateFieldFieldDecorator };
|
|
20
|
+
}
|
|
21
|
+
static StringAsDate(str) {
|
|
22
|
+
return date_utils_1.DateUtils.StringAsDate(str);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.DateFieldFieldDecorator = DateFieldFieldDecorator;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const PROP_META_KEY = "dbFldAlias";
|
|
4
|
+
const ALL_PROPS_META_KEY = "dbFldAliasProps";
|
|
5
|
+
function DbFieldAlias(alias) {
|
|
4
6
|
return function (target, propertyKey) {
|
|
5
7
|
if (!target || !propertyKey) {
|
|
6
8
|
return;
|
|
7
9
|
}
|
|
8
10
|
Reflect.defineMetadata(PROP_META_KEY, alias, target, propertyKey);
|
|
9
|
-
|
|
11
|
+
let aliesFields = Reflect.getMetadata(ALL_PROPS_META_KEY, target);
|
|
10
12
|
if (!aliesFields) {
|
|
11
13
|
aliesFields = new Set();
|
|
12
14
|
}
|
|
@@ -14,25 +16,23 @@ export function DbFieldAlias(alias) {
|
|
|
14
16
|
Reflect.defineMetadata(ALL_PROPS_META_KEY, aliesFields, target);
|
|
15
17
|
};
|
|
16
18
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
DbFieldAliasDecorator.GetDecoratedProperties = function (target) {
|
|
19
|
+
exports.DbFieldAlias = DbFieldAlias;
|
|
20
|
+
class DbFieldAliasDecorator {
|
|
21
|
+
static GetDecoratedProperties(target) {
|
|
21
22
|
if (!target || typeof target !== "object") {
|
|
22
23
|
return [];
|
|
23
24
|
}
|
|
24
|
-
|
|
25
|
+
const allProps = Reflect.getMetadata(ALL_PROPS_META_KEY, target);
|
|
25
26
|
if (!allProps) {
|
|
26
27
|
return [];
|
|
27
28
|
}
|
|
28
29
|
return Array.from(allProps);
|
|
29
|
-
}
|
|
30
|
-
|
|
30
|
+
}
|
|
31
|
+
static GetDbAlias(target, propertyKey) {
|
|
31
32
|
if (!target || !propertyKey || typeof target !== "object") {
|
|
32
33
|
return undefined;
|
|
33
34
|
}
|
|
34
35
|
return Reflect.getMetadata(PROP_META_KEY, target, propertyKey);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
export { DbFieldAliasDecorator };
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.DbFieldAliasDecorator = DbFieldAliasDecorator;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const PROP_META_KEY = "jsonField";
|
|
4
|
+
function JsonField() {
|
|
3
5
|
return function (target, propertyKey) {
|
|
4
6
|
if (!target || !propertyKey) {
|
|
5
7
|
return;
|
|
@@ -7,18 +9,16 @@ export function JsonField() {
|
|
|
7
9
|
Reflect.defineMetadata(PROP_META_KEY, undefined, target, propertyKey);
|
|
8
10
|
};
|
|
9
11
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
JsonFieldFieldDecorator.IsJsonField = function (target, propertyKey) {
|
|
12
|
+
exports.JsonField = JsonField;
|
|
13
|
+
class JsonFieldFieldDecorator {
|
|
14
|
+
static IsJsonField(target, propertyKey) {
|
|
14
15
|
if (!target || !propertyKey || typeof target !== "object") {
|
|
15
16
|
return false;
|
|
16
17
|
}
|
|
17
18
|
return Reflect.hasMetadata(PROP_META_KEY, target, propertyKey);
|
|
18
|
-
}
|
|
19
|
-
|
|
19
|
+
}
|
|
20
|
+
static StringAsJson(str) {
|
|
20
21
|
return JSON.parse(str);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
export { JsonFieldFieldDecorator };
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.JsonFieldFieldDecorator = JsonFieldFieldDecorator;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
require("reflect-metadata");
|
|
4
|
+
const PROP_META_KEY = "mapProperty";
|
|
5
|
+
function MapProperty(propName) {
|
|
4
6
|
return function (target, propertyKey) {
|
|
5
7
|
if (!target || !propertyKey) {
|
|
6
8
|
return;
|
|
@@ -8,21 +10,19 @@ export function MapProperty(propName) {
|
|
|
8
10
|
Reflect.defineMetadata(PROP_META_KEY, propName, target, propertyKey);
|
|
9
11
|
};
|
|
10
12
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
MapPropertyDecorator.IsMapProperty = function (target, propertyKey) {
|
|
13
|
+
exports.MapProperty = MapProperty;
|
|
14
|
+
class MapPropertyDecorator {
|
|
15
|
+
static IsMapProperty(target, propertyKey) {
|
|
15
16
|
if (!target || !propertyKey || typeof target !== "object") {
|
|
16
17
|
return false;
|
|
17
18
|
}
|
|
18
19
|
return Reflect.hasMetadata(PROP_META_KEY, target, propertyKey);
|
|
19
|
-
}
|
|
20
|
-
|
|
20
|
+
}
|
|
21
|
+
static GetMapProperty(target, propertyKey) {
|
|
21
22
|
if (!target || !propertyKey || typeof target !== "object") {
|
|
22
23
|
return undefined;
|
|
23
24
|
}
|
|
24
25
|
return Reflect.getMetadata(PROP_META_KEY, target, propertyKey);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
export { MapPropertyDecorator };
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.MapPropertyDecorator = MapPropertyDecorator;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const PROP_META_KEY = "noDbFld";
|
|
4
|
+
const ALL_PROPS_META_KEY = "noDbFldPrps";
|
|
5
|
+
function NoDbField() {
|
|
4
6
|
return function (target, propertyKey) {
|
|
5
7
|
if (!target || !propertyKey) {
|
|
6
8
|
return;
|
|
7
9
|
}
|
|
8
10
|
Reflect.defineMetadata(PROP_META_KEY, undefined, target, propertyKey);
|
|
9
|
-
|
|
11
|
+
let noDbFields = Reflect.getMetadata(ALL_PROPS_META_KEY, target);
|
|
10
12
|
if (!noDbFields) {
|
|
11
13
|
noDbFields = new Set();
|
|
12
14
|
}
|
|
@@ -14,19 +16,17 @@ export function NoDbField() {
|
|
|
14
16
|
Reflect.defineMetadata(ALL_PROPS_META_KEY, noDbFields, target);
|
|
15
17
|
};
|
|
16
18
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
NoDatabaseFieldDecorator.GetDecoratedProperties = function (target) {
|
|
19
|
+
exports.NoDbField = NoDbField;
|
|
20
|
+
class NoDatabaseFieldDecorator {
|
|
21
|
+
static GetDecoratedProperties(target) {
|
|
21
22
|
if (!target || typeof target !== "object") {
|
|
22
23
|
return [];
|
|
23
24
|
}
|
|
24
|
-
|
|
25
|
+
let allProps = Reflect.getMetadata(ALL_PROPS_META_KEY, target);
|
|
25
26
|
if (!allProps) {
|
|
26
27
|
return [];
|
|
27
28
|
}
|
|
28
29
|
return Array.from(allProps);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
export { NoDatabaseFieldDecorator };
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.NoDatabaseFieldDecorator = NoDatabaseFieldDecorator;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const number_utils_1 = require("../../utils/number-utils");
|
|
4
|
+
const PROP_META_KEY = "stringNumber";
|
|
5
|
+
function StringNumber() {
|
|
4
6
|
return function (target, propertyKey) {
|
|
5
7
|
if (!target || !propertyKey) {
|
|
6
8
|
return;
|
|
@@ -8,21 +10,19 @@ export function StringNumber() {
|
|
|
8
10
|
Reflect.defineMetadata(PROP_META_KEY, undefined, target, propertyKey);
|
|
9
11
|
};
|
|
10
12
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
StringNumberDecorator.IsStringNumber = function (target, propertyKey) {
|
|
13
|
+
exports.StringNumber = StringNumber;
|
|
14
|
+
class StringNumberDecorator {
|
|
15
|
+
static IsStringNumber(target, propertyKey) {
|
|
15
16
|
if (!target || !propertyKey || typeof target !== "object") {
|
|
16
17
|
return false;
|
|
17
18
|
}
|
|
18
19
|
return Reflect.hasMetadata(PROP_META_KEY, target, propertyKey);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
return NumberUtils.ParseFloatKeepPrecision(str);
|
|
22
|
-
}
|
|
23
|
-
|
|
20
|
+
}
|
|
21
|
+
static StringAsNumber(str) {
|
|
22
|
+
return number_utils_1.NumberUtils.ParseFloatKeepPrecision(str);
|
|
23
|
+
}
|
|
24
|
+
static NumberAsString(nr) {
|
|
24
25
|
return "" + nr;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
export { StringNumberDecorator };
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.StringNumberDecorator = StringNumberDecorator;
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const map_property_decorator_1 = require("../factory/decorators/map-property.decorator");
|
|
4
|
+
const boolean_decorator_1 = require("../factory/decorators/boolean.decorator");
|
|
5
|
+
const json_decorator_1 = require("../factory/decorators/json.decorator");
|
|
6
|
+
const complex_array_decorator_1 = require("../factory/decorators/complex-array.decorator");
|
|
7
|
+
class BusinessObject {
|
|
8
|
+
constructor() {
|
|
7
9
|
}
|
|
8
|
-
|
|
9
|
-
var _this = this;
|
|
10
|
-
if (rawData === void 0) { rawData = {}; }
|
|
10
|
+
setOwnMappedPropsFromRawData(rawData = {}) {
|
|
11
11
|
if (!rawData) {
|
|
12
12
|
return;
|
|
13
13
|
}
|
|
14
|
-
Object.keys(this).forEach(
|
|
15
|
-
if (MapPropertyDecorator.IsMapProperty(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
for (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
Object.keys(this).forEach((key) => {
|
|
15
|
+
if (map_property_decorator_1.MapPropertyDecorator.IsMapProperty(this, key)) {
|
|
16
|
+
const mapKeys = map_property_decorator_1.MapPropertyDecorator.GetMapProperty(this, key).split(',');
|
|
17
|
+
const len = mapKeys.length;
|
|
18
|
+
for (let i = 0; i < len; i++) {
|
|
19
|
+
const mapKey = mapKeys[i].trim();
|
|
20
|
+
const objProp = rawData[mapKey];
|
|
21
|
+
let decorated = false;
|
|
22
22
|
if (rawData.hasOwnProperty(mapKey)) {
|
|
23
|
-
if (BooleanTextDecorator.IsBooleanTextField(
|
|
24
|
-
|
|
23
|
+
if (boolean_decorator_1.BooleanTextDecorator.IsBooleanTextField(this, key)) {
|
|
24
|
+
this[key] = boolean_decorator_1.BooleanTextDecorator.GetLogicalBooleanValue(objProp);
|
|
25
25
|
decorated = true;
|
|
26
26
|
}
|
|
27
|
-
if (JsonFieldFieldDecorator.IsJsonField(
|
|
28
|
-
|
|
27
|
+
if (json_decorator_1.JsonFieldFieldDecorator.IsJsonField(this, key)) {
|
|
28
|
+
this[key] = json_decorator_1.JsonFieldFieldDecorator.StringAsJson(objProp);
|
|
29
29
|
decorated = true;
|
|
30
30
|
}
|
|
31
|
-
if (ComplexArrayDecorator.IsComplexArray(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
for (
|
|
36
|
-
|
|
31
|
+
if (complex_array_decorator_1.ComplexArrayDecorator.IsComplexArray(this, key)) {
|
|
32
|
+
const arrayClass = complex_array_decorator_1.ComplexArrayDecorator.GetComplexArrayType(this, key);
|
|
33
|
+
const origArray = this[key];
|
|
34
|
+
const newArray = [];
|
|
35
|
+
for (let j = 0; j < origArray.length; j++) {
|
|
36
|
+
const item = new arrayClass(origArray[j]);
|
|
37
37
|
newArray.push(item);
|
|
38
38
|
}
|
|
39
|
-
|
|
39
|
+
this[key] = newArray;
|
|
40
40
|
}
|
|
41
41
|
else {
|
|
42
42
|
if (!decorated) {
|
|
43
|
-
|
|
43
|
+
this[key] = objProp;
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
break;
|
|
@@ -49,20 +49,19 @@ var BusinessObject = (function () {
|
|
|
49
49
|
}
|
|
50
50
|
else {
|
|
51
51
|
if (rawData.hasOwnProperty(key)) {
|
|
52
|
-
|
|
53
|
-
if (BooleanTextDecorator.IsBooleanTextField(
|
|
54
|
-
|
|
52
|
+
const objProp = rawData[key];
|
|
53
|
+
if (boolean_decorator_1.BooleanTextDecorator.IsBooleanTextField(this, key)) {
|
|
54
|
+
this[key] = boolean_decorator_1.BooleanTextDecorator.GetLogicalBooleanValue(objProp);
|
|
55
55
|
}
|
|
56
|
-
else if (JsonFieldFieldDecorator.IsJsonField(
|
|
57
|
-
|
|
56
|
+
else if (json_decorator_1.JsonFieldFieldDecorator.IsJsonField(this, key)) {
|
|
57
|
+
this[key] = json_decorator_1.JsonFieldFieldDecorator.StringAsJson(objProp);
|
|
58
58
|
}
|
|
59
59
|
else {
|
|
60
|
-
|
|
60
|
+
this[key] = objProp;
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
});
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
export { BusinessObject };
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
exports.BusinessObject = BusinessObject;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export { DataServiceData };
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
class DataServiceData {
|
|
4
|
+
}
|
|
5
|
+
exports.DataServiceData = DataServiceData;
|
|
@@ -1,44 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const paging_parameters_1 = require("./paging-parameters");
|
|
4
|
+
const not_nill_function_1 = require("../utils/function/not-nill.function");
|
|
5
|
+
const validation_result_1 = require("./validation-result");
|
|
6
|
+
class DataServiceResponseData {
|
|
7
|
+
constructor(rawData) {
|
|
6
8
|
this.fieldNames = [];
|
|
7
|
-
this.pagingParameters = new PagingParameters();
|
|
9
|
+
this.pagingParameters = new paging_parameters_1.PagingParameters();
|
|
8
10
|
this.resultObjects = [];
|
|
9
|
-
this.validationResult = new ValidationResult();
|
|
11
|
+
this.validationResult = new validation_result_1.ValidationResult();
|
|
10
12
|
this.setData(rawData);
|
|
11
13
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
this.validationResult.messages.forEach(function (validationMessage) {
|
|
31
|
-
if (validationMessage) {
|
|
32
|
-
validationMsges.push(validationMessage.message);
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
return validationMsges.join("\n");
|
|
37
|
-
},
|
|
38
|
-
enumerable: true,
|
|
39
|
-
configurable: true
|
|
40
|
-
});
|
|
41
|
-
DataServiceResponseData.prototype.setData = function (rawData) {
|
|
14
|
+
get success() {
|
|
15
|
+
return (this.validationResult && this.validationResult.success);
|
|
16
|
+
}
|
|
17
|
+
get fail() {
|
|
18
|
+
return !this.success;
|
|
19
|
+
}
|
|
20
|
+
get validationMessagesAsString() {
|
|
21
|
+
const validationMsges = [];
|
|
22
|
+
if (this.validationResult && this.validationResult.messages) {
|
|
23
|
+
this.validationResult.messages.forEach((validationMessage) => {
|
|
24
|
+
if (validationMessage) {
|
|
25
|
+
validationMsges.push(validationMessage.message);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
return validationMsges.join("\n");
|
|
30
|
+
}
|
|
31
|
+
setData(rawData) {
|
|
42
32
|
if (!rawData) {
|
|
43
33
|
return;
|
|
44
34
|
}
|
|
@@ -48,7 +38,7 @@ var DataServiceResponseData = (function () {
|
|
|
48
38
|
if (rawData.pagingParameters) {
|
|
49
39
|
this.pagingParameters.setData(rawData.pagingParameters);
|
|
50
40
|
}
|
|
51
|
-
if (notNill(rawData.resultObject)) {
|
|
41
|
+
if (not_nill_function_1.notNill(rawData.resultObject)) {
|
|
52
42
|
this.resultObject = rawData.resultObject;
|
|
53
43
|
}
|
|
54
44
|
if (rawData.resultObjects) {
|
|
@@ -57,7 +47,6 @@ var DataServiceResponseData = (function () {
|
|
|
57
47
|
if (rawData.validationResult) {
|
|
58
48
|
this.validationResult.setData(rawData.validationResult);
|
|
59
49
|
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
export { DataServiceResponseData };
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.DataServiceResponseData = DataServiceResponseData;
|
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const validation_result_1 = require("./validation-result");
|
|
4
|
+
const validation_message_1 = require("./validation-message");
|
|
5
|
+
class FieldValidation {
|
|
6
|
+
constructor(rawData) {
|
|
5
7
|
this.messages = [];
|
|
6
8
|
this.subValidations = [];
|
|
7
9
|
this._setData(rawData);
|
|
8
10
|
}
|
|
9
|
-
|
|
11
|
+
_setData(rawData) {
|
|
10
12
|
if (rawData) {
|
|
11
13
|
if (rawData.messages) {
|
|
12
|
-
for (
|
|
13
|
-
this.messages.push(new ValidationMessage(rawData.messages[i]));
|
|
14
|
+
for (let i = 0, len = rawData.messages.length; i < len; i++) {
|
|
15
|
+
this.messages.push(new validation_message_1.ValidationMessage(rawData.messages[i]));
|
|
14
16
|
}
|
|
15
17
|
}
|
|
16
18
|
if (rawData.subValidations) {
|
|
17
|
-
for (
|
|
18
|
-
this.subValidations.push(new ValidationResult(rawData.subValidations[i]));
|
|
19
|
+
for (let i = 0, len = rawData.subValidations.length; i < len; i++) {
|
|
20
|
+
this.subValidations.push(new validation_result_1.ValidationResult(rawData.subValidations[i]));
|
|
19
21
|
}
|
|
20
22
|
}
|
|
21
23
|
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
export { FieldValidation };
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.FieldValidation = FieldValidation;
|
|
@@ -1,22 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
};
|
|
8
|
-
return function (d, b) {
|
|
9
|
-
extendStatics(d, b);
|
|
10
|
-
function __() { this.constructor = d; }
|
|
11
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
12
|
-
};
|
|
13
|
-
})();
|
|
14
|
-
import { BusinessObject } from "./business-object";
|
|
15
|
-
var LoginResponse = (function (_super) {
|
|
16
|
-
__extends(LoginResponse, _super);
|
|
17
|
-
function LoginResponse() {
|
|
18
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
19
|
-
}
|
|
20
|
-
return LoginResponse;
|
|
21
|
-
}(BusinessObject));
|
|
22
|
-
export { LoginResponse };
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const business_object_1 = require("./business-object");
|
|
4
|
+
class LoginResponse extends business_object_1.BusinessObject {
|
|
5
|
+
}
|
|
6
|
+
exports.LoginResponse = LoginResponse;
|