@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.
Files changed (69) hide show
  1. package/build/connector.js +25 -57
  2. package/build/connector.unit.test.js +36 -67
  3. package/build/enum/backend-service-name.enum.js +4 -2
  4. package/build/enum/datasession-service-method.enum.js +4 -2
  5. package/build/enum/db-boolean-value-type.enum.js +15 -12
  6. package/build/enum/end-point.enum.js +4 -2
  7. package/build/enum/login-service-method.enum.js +4 -2
  8. package/build/enum/one-zero-bool-db-type.enum.js +6 -3
  9. package/build/enum/public-service-method.enum.js +4 -2
  10. package/build/enum/true-false-db-type.enum.js +6 -3
  11. package/build/enum/yes-no-db-type.enum.js +6 -3
  12. package/build/factory/decorators/boolean.decorator.js +34 -34
  13. package/build/factory/decorators/complex-array.decorator.js +18 -18
  14. package/build/factory/decorators/complex-field.decorator.js +18 -18
  15. package/build/factory/decorators/date-field.decorator.js +14 -14
  16. package/build/factory/decorators/db-field-alias.decorator.js +15 -15
  17. package/build/factory/decorators/json.decorator.js +12 -12
  18. package/build/factory/decorators/map-property.decorator.js +13 -13
  19. package/build/factory/decorators/no-db-field.decorator.js +13 -13
  20. package/build/factory/decorators/string-number.decorator.js +16 -16
  21. package/build/model/business-object.js +38 -39
  22. package/build/model/constant/java-constants.js +4 -2
  23. package/build/model/data-service-data.js +5 -6
  24. package/build/model/data-service-response-data.interface.js +2 -0
  25. package/build/model/data-service-response-data.js +31 -42
  26. package/build/model/data-service-response-exception.js +2 -0
  27. package/build/model/data-service-response-root.js +2 -0
  28. package/build/model/field-validation.interface.js +2 -0
  29. package/build/model/field-validation.js +14 -13
  30. package/build/model/field-validations-object.interface.js +2 -0
  31. package/build/model/field-validations-object.js +2 -0
  32. package/build/model/login-response.interface.js +2 -0
  33. package/build/model/login-response.js +6 -22
  34. package/build/model/login.js +20 -31
  35. package/build/model/options.js +6 -5
  36. package/build/model/paging-parameters.interface.js +5 -6
  37. package/build/model/paging-parameters.js +20 -23
  38. package/build/model/server-response-data.js +2 -0
  39. package/build/model/server-stack-trace-element.js +2 -0
  40. package/build/model/session.js +6 -5
  41. package/build/model/validation-message.interface.js +2 -0
  42. package/build/model/validation-message.js +22 -21
  43. package/build/model/validation-result.interface.js +2 -0
  44. package/build/model/validation-result.js +15 -15
  45. package/build/provider/ajax.service.js +70 -136
  46. package/build/provider/base-backend-connection.service.js +38 -73
  47. package/build/service/business-object-factory.js +47 -46
  48. package/build/service/datasession.service.js +18 -49
  49. package/build/service/encrypt.service.js +27 -18
  50. package/build/service/encrypt.service.unit.test.js +8 -6
  51. package/build/service/login.service.js +69 -110
  52. package/build/service/public.service.js +16 -16
  53. package/build/tests/int/connector.int.test.js +6 -4
  54. package/build/type/business-object-id-type.js +8 -6
  55. package/build/type/object-configuration-default-value-type.js +2 -0
  56. package/build/utils/array-utils.js +16 -17
  57. package/build/utils/business-object-utils.js +12 -13
  58. package/build/utils/date-utils.js +9 -10
  59. package/build/utils/function/is-nill.function.js +4 -1
  60. package/build/utils/function/not-nill.function.js +4 -1
  61. package/build/utils/image-utils.js +10 -11
  62. package/build/utils/number-utils.js +25 -28
  63. package/build/utils/object-utils.js +45 -51
  64. package/build/utils/parameter-value-conversion-utils.js +9 -10
  65. package/build/utils/promise-utils.js +14 -50
  66. package/build/utils/ref-code-utils.js +12 -17
  67. package/build/utils/string-utils.js +17 -19
  68. package/build/utils/url-utils.js +11 -12
  69. package/package.json +5 -2
@@ -1,5 +1,7 @@
1
- var Login = (function () {
2
- function Login() {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ class Login {
4
+ constructor() {
3
5
  this.upId = "";
4
6
  this.clientVersion = "";
5
7
  this.clientTimeZoneOffset = "0";
@@ -8,31 +10,19 @@ var Login = (function () {
8
10
  this._passWord = "gast3";
9
11
  this._userType = "H";
10
12
  }
11
- Object.defineProperty(Login.prototype, "passWord", {
12
- set: function (value) {
13
- this._passWord = value;
14
- },
15
- enumerable: true,
16
- configurable: true
17
- });
18
- Object.defineProperty(Login.prototype, "passWordClean", {
19
- get: function () {
20
- return this._passWordClean;
21
- },
22
- set: function (value) {
23
- this._passWordClean = value;
24
- },
25
- enumerable: true,
26
- configurable: true
27
- });
28
- Object.defineProperty(Login.prototype, "userName", {
29
- set: function (value) {
30
- this._userName = value;
31
- },
32
- enumerable: true,
33
- configurable: true
34
- });
35
- Login.prototype.getSerialized = function () {
13
+ set passWord(value) {
14
+ this._passWord = value;
15
+ }
16
+ get passWordClean() {
17
+ return this._passWordClean;
18
+ }
19
+ set userName(value) {
20
+ this._userName = value;
21
+ }
22
+ set passWordClean(value) {
23
+ this._passWordClean = value;
24
+ }
25
+ getSerialized() {
36
26
  return {
37
27
  userName: this._userName,
38
28
  userPassword: this._passWord,
@@ -42,7 +32,6 @@ var Login = (function () {
42
32
  userType: this._userType,
43
33
  clientTimeZoneOffset: this.clientTimeZoneOffset
44
34
  };
45
- };
46
- return Login;
47
- }());
48
- export { Login };
35
+ }
36
+ }
37
+ exports.Login = Login;
@@ -1,5 +1,7 @@
1
- var Options = (function () {
2
- function Options() {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ class Options {
4
+ constructor() {
3
5
  this.useWebsocket = false;
4
6
  this.useGroups = true;
5
7
  this.useRenders = false;
@@ -7,6 +9,5 @@ var Options = (function () {
7
9
  this.use3D = false;
8
10
  this.useLoginEncryption = false;
9
11
  }
10
- return Options;
11
- }());
12
- export { Options };
12
+ }
13
+ exports.Options = Options;
@@ -1,6 +1,5 @@
1
- var IPagingParameters = (function () {
2
- function IPagingParameters() {
3
- }
4
- return IPagingParameters;
5
- }());
6
- export { IPagingParameters };
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ class IPagingParameters {
4
+ }
5
+ exports.IPagingParameters = IPagingParameters;
@@ -1,39 +1,36 @@
1
- import { notNill } from "../utils/function/not-nill.function";
2
- var PagingParameters = (function () {
3
- function PagingParameters(pageLowerBound, pageUpperBound, maximumRows, isLastPage) {
4
- if (pageLowerBound === void 0) { pageLowerBound = 1; }
5
- if (pageUpperBound === void 0) { pageUpperBound = PagingParameters.DEFAULT_UPPER_BOUND; }
6
- if (maximumRows === void 0) { maximumRows = PagingParameters.DEFAULT_UPPER_BOUND; }
7
- if (isLastPage === void 0) { isLastPage = false; }
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const not_nill_function_1 = require("../utils/function/not-nill.function");
4
+ class PagingParameters {
5
+ constructor(pageLowerBound = 1, pageUpperBound = PagingParameters.DEFAULT_UPPER_BOUND, maximumRows = PagingParameters.DEFAULT_UPPER_BOUND, isLastPage = false) {
8
6
  this.pageLowerBound = pageLowerBound;
9
7
  this.pageUpperBound = pageUpperBound;
10
8
  this.maximumRows = maximumRows;
11
9
  this.isLastPage = isLastPage;
12
10
  }
13
- PagingParameters.prototype.setData = function (rawData) {
11
+ setData(rawData) {
14
12
  if (!rawData) {
15
13
  return;
16
14
  }
17
- if (notNill(rawData.pageLowerBound)) {
15
+ if (not_nill_function_1.notNill(rawData.pageLowerBound)) {
18
16
  this.pageLowerBound = rawData.pageLowerBound;
19
17
  }
20
- if (notNill(rawData.pageUpperBound)) {
18
+ if (not_nill_function_1.notNill(rawData.pageUpperBound)) {
21
19
  this.pageUpperBound = rawData.pageUpperBound;
22
20
  }
23
- if (notNill(rawData.maximumRows)) {
21
+ if (not_nill_function_1.notNill(rawData.maximumRows)) {
24
22
  this.maximumRows = rawData.maximumRows;
25
23
  }
26
- if (notNill(rawData.isLastPage)) {
24
+ if (not_nill_function_1.notNill(rawData.isLastPage)) {
27
25
  this.isLastPage = rawData.isLastPage;
28
26
  }
29
- };
30
- PagingParameters.DEFAULT_UPPER_BOUND = 1000;
31
- PagingParameters.DEFAULTS = new PagingParameters(1, PagingParameters.DEFAULT_UPPER_BOUND, PagingParameters.DEFAULT_UPPER_BOUND);
32
- PagingParameters.HUNDRED_RESULTS = new PagingParameters(1, 100, 100);
33
- PagingParameters.FIFTY_RESULTS = new PagingParameters(1, 50, 50);
34
- PagingParameters.TWENTY_RESULTS = new PagingParameters(1, 20, 20);
35
- PagingParameters.TEN_RESULTS = new PagingParameters(1, 10, 10);
36
- PagingParameters.ONE_RESULT = new PagingParameters(1, 1, 1);
37
- return PagingParameters;
38
- }());
39
- export { PagingParameters };
27
+ }
28
+ }
29
+ exports.PagingParameters = PagingParameters;
30
+ PagingParameters.DEFAULT_UPPER_BOUND = 1000;
31
+ PagingParameters.DEFAULTS = new PagingParameters(1, PagingParameters.DEFAULT_UPPER_BOUND, PagingParameters.DEFAULT_UPPER_BOUND);
32
+ PagingParameters.HUNDRED_RESULTS = new PagingParameters(1, 100, 100);
33
+ PagingParameters.FIFTY_RESULTS = new PagingParameters(1, 50, 50);
34
+ PagingParameters.TWENTY_RESULTS = new PagingParameters(1, 20, 20);
35
+ PagingParameters.TEN_RESULTS = new PagingParameters(1, 10, 10);
36
+ PagingParameters.ONE_RESULT = new PagingParameters(1, 1, 1);
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +1,8 @@
1
- var Session = (function () {
2
- function Session() {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ class Session {
4
+ constructor() {
3
5
  this.created = false;
4
6
  }
5
- return Session;
6
- }());
7
- export { Session };
7
+ }
8
+ exports.Session = Session;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
3
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
4
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -7,35 +8,35 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
8
  var __metadata = (this && this.__metadata) || function (k, v) {
8
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
10
  };
10
- import { BusinessObjectIDType } from "../type/business-object-id-type";
11
- import { NoDbField } from "../factory/decorators/no-db-field.decorator";
12
- import { notNill } from "../utils/function/not-nill.function";
13
- var ValidationMessage = (function () {
14
- function ValidationMessage(rawData) {
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const business_object_id_type_1 = require("../type/business-object-id-type");
13
+ const no_db_field_decorator_1 = require("../factory/decorators/no-db-field.decorator");
14
+ const not_nill_function_1 = require("../utils/function/not-nill.function");
15
+ class ValidationMessage {
16
+ constructor(rawData) {
15
17
  this.setData(rawData);
16
18
  }
17
- ValidationMessage.prototype.setData = function (rawData) {
19
+ setData(rawData) {
18
20
  if (!rawData) {
19
21
  return;
20
22
  }
21
- if (notNill(rawData.code)) {
23
+ if (not_nill_function_1.notNill(rawData.code)) {
22
24
  this.code = rawData.code;
23
25
  }
24
- if (notNill(rawData.message)) {
26
+ if (not_nill_function_1.notNill(rawData.message)) {
25
27
  this.message = rawData.message;
26
28
  }
27
- if (notNill(rawData.fieldId)) {
29
+ if (not_nill_function_1.notNill(rawData.fieldId)) {
28
30
  this.fieldId = rawData.fieldId;
29
31
  }
30
- };
31
- __decorate([
32
- NoDbField(),
33
- __metadata("design:type", Object)
34
- ], ValidationMessage.prototype, "boId", void 0);
35
- __decorate([
36
- NoDbField(),
37
- __metadata("design:type", String)
38
- ], ValidationMessage.prototype, "fieldLabel", void 0);
39
- return ValidationMessage;
40
- }());
41
- export { ValidationMessage };
32
+ }
33
+ }
34
+ __decorate([
35
+ no_db_field_decorator_1.NoDbField(),
36
+ __metadata("design:type", Object)
37
+ ], ValidationMessage.prototype, "boId", void 0);
38
+ __decorate([
39
+ no_db_field_decorator_1.NoDbField(),
40
+ __metadata("design:type", String)
41
+ ], ValidationMessage.prototype, "fieldLabel", void 0);
42
+ exports.ValidationMessage = ValidationMessage;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,14 +1,15 @@
1
- import { ObjectUtils } from "../utils/object-utils";
2
- import { ValidationMessage } from "./validation-message";
3
- import { FieldValidation } from "./field-validation";
4
- var ValidationResult = (function () {
5
- function ValidationResult(rawData) {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const object_utils_1 = require("../utils/object-utils");
4
+ const validation_message_1 = require("./validation-message");
5
+ const field_validation_1 = require("./field-validation");
6
+ class ValidationResult {
7
+ constructor(rawData) {
6
8
  this.messages = [];
7
9
  this.fieldValidations = {};
8
10
  this.setData(rawData);
9
11
  }
10
- ValidationResult.prototype.setData = function (rawData) {
11
- var _this = this;
12
+ setData(rawData) {
12
13
  if (!rawData) {
13
14
  return;
14
15
  }
@@ -21,17 +22,16 @@ var ValidationResult = (function () {
21
22
  this.validationId = rawData.validationId;
22
23
  if (rawData.messages) {
23
24
  this.messages.length = 0;
24
- for (var i = 0, len = rawData.messages.length; i < len; i++) {
25
- this.messages.push(new ValidationMessage(rawData.messages[i]));
25
+ for (let i = 0, len = rawData.messages.length; i < len; i++) {
26
+ this.messages.push(new validation_message_1.ValidationMessage(rawData.messages[i]));
26
27
  }
27
28
  }
28
29
  if (rawData.fieldValidations) {
29
30
  this.fieldValidations = {};
30
- ObjectUtils.ForOwnProperty(rawData.fieldValidations, function (validationFieldData, propKey) {
31
- _this.fieldValidations[propKey] = new FieldValidation(validationFieldData);
31
+ object_utils_1.ObjectUtils.ForOwnProperty(rawData.fieldValidations, (validationFieldData, propKey) => {
32
+ this.fieldValidations[propKey] = new field_validation_1.FieldValidation(validationFieldData);
32
33
  });
33
34
  }
34
- };
35
- return ValidationResult;
36
- }());
37
- export { ValidationResult };
35
+ }
36
+ }
37
+ exports.ValidationResult = ValidationResult;
@@ -1,16 +1,4 @@
1
- var __extends = (this && this.__extends) || (function () {
2
- var extendStatics = function (d, b) {
3
- extendStatics = Object.setPrototypeOf ||
4
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
- return extendStatics(d, b);
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
- })();
1
+ "use strict";
14
2
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
3
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
4
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -20,129 +8,83 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
20
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
21
9
  });
22
10
  };
23
- var __generator = (this && this.__generator) || function (thisArg, body) {
24
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
25
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
26
- function verb(n) { return function (v) { return step([n, v]); }; }
27
- function step(op) {
28
- if (f) throw new TypeError("Generator is already executing.");
29
- while (_) try {
30
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
31
- if (y = 0, t) op = [op[0] & 2, t.value];
32
- switch (op[0]) {
33
- case 0: case 1: t = op; break;
34
- case 4: _.label++; return { value: op[1], done: false };
35
- case 5: _.label++; y = op[1]; op = [0]; continue;
36
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
37
- default:
38
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
39
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
40
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
41
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
42
- if (t[2]) _.ops.pop();
43
- _.trys.pop(); continue;
44
- }
45
- op = body.call(thisArg, _);
46
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
47
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
48
- }
49
- };
50
- import { BackendServiceName } from "../enum/backend-service-name.enum";
51
- import { BaseBackendConnectionService } from "./base-backend-connection.service";
52
- import axios from "axios";
53
- import { UrlUtils } from "../utils/url-utils";
54
- import { DatasessionServiceMethod } from "../enum/datasession-service-method.enum";
55
- import { EndPoint } from "../enum/end-point.enum";
56
- var AjaxService = (function (_super) {
57
- __extends(AjaxService, _super);
58
- function AjaxService(options) {
59
- var _this = _super.call(this, options) || this;
60
- _this._showLoaderRequests = 0;
61
- _this._usePublicToken = true;
62
- _this._token = undefined;
63
- _this._timeout = 180000;
64
- _this._schema = options.schema;
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const backend_service_name_enum_1 = require("../enum/backend-service-name.enum");
13
+ const base_backend_connection_service_1 = require("./base-backend-connection.service");
14
+ const axios_1 = require("axios");
15
+ const url_utils_1 = require("../utils/url-utils");
16
+ const datasession_service_method_enum_1 = require("../enum/datasession-service-method.enum");
17
+ const end_point_enum_1 = require("../enum/end-point.enum");
18
+ class AjaxService extends base_backend_connection_service_1.BaseBackendConnectionService {
19
+ constructor(options) {
20
+ super(options);
21
+ this._showLoaderRequests = 0;
22
+ this._usePublicToken = true;
23
+ this._token = undefined;
24
+ this._timeout = 180000;
25
+ this._schema = options.schema;
65
26
  if (options && options.timeoutInMs) {
66
- _this._timeout = options.timeoutInMs;
27
+ this._timeout = options.timeoutInMs;
67
28
  }
68
- if (options && options.username && options.password) {
69
- _this._usePublicToken = false;
29
+ if (options && ((options.username && options.password) || options.session)) {
30
+ this._usePublicToken = false;
70
31
  }
71
- return _this;
72
32
  }
73
- AjaxService.prototype.call = function (method, data, showLoader, service, endPoint) {
74
- if (data === void 0) { data = {}; }
75
- if (showLoader === void 0) { showLoader = true; }
76
- if (service === void 0) { service = BackendServiceName.LoginService; }
77
- if (endPoint === void 0) { endPoint = EndPoint.AjaxService; }
78
- return __awaiter(this, void 0, void 0, function () {
79
- var _a;
80
- return __generator(this, function (_b) {
81
- switch (_b.label) {
82
- case 0:
83
- if (!(this._usePublicToken && !this._token)) return [3, 2];
84
- _a = this;
85
- return [4, this._createPublicSession()];
86
- case 1:
87
- _a._token = _b.sent();
88
- _b.label = 2;
89
- case 2:
90
- if (!(this._usePublicToken || (service === BackendServiceName.PublicService ||
91
- service === BackendServiceName.LoginService ||
92
- service === BackendServiceName.DatasessionService))) return [3, 3];
93
- return [2, this._doCall(method, data, showLoader, service, endPoint)];
94
- case 3: return [4, this.waitForLogin()];
95
- case 4:
96
- _b.sent();
97
- return [2, this._doCall(method, data, showLoader, service, endPoint)];
98
- }
99
- });
33
+ call(method, data = {}, showLoader = true, service = backend_service_name_enum_1.BackendServiceName.LoginService, endPoint = end_point_enum_1.EndPoint.AjaxService) {
34
+ return __awaiter(this, void 0, void 0, function* () {
35
+ if (this._usePublicToken && !this._token) {
36
+ this._token = yield this._createPublicSession();
37
+ }
38
+ if (this._usePublicToken || (service === backend_service_name_enum_1.BackendServiceName.PublicService ||
39
+ service === backend_service_name_enum_1.BackendServiceName.LoginService ||
40
+ service === backend_service_name_enum_1.BackendServiceName.DatasessionService)) {
41
+ return this._doCall(method, data, showLoader, service, endPoint);
42
+ }
43
+ else {
44
+ yield this.waitForLogin();
45
+ return this._doCall(method, data, showLoader, service, endPoint);
46
+ }
100
47
  });
101
- };
102
- AjaxService.prototype.close = function () {
48
+ }
49
+ close() {
103
50
  if (this._usePublicToken) {
104
- this._doCall(DatasessionServiceMethod.ClosePublicSession, {});
51
+ this._doCall(datasession_service_method_enum_1.DatasessionServiceMethod.ClosePublicSession, {});
105
52
  }
106
53
  else {
107
54
  this.closeDataSession();
108
55
  }
109
- };
110
- AjaxService.prototype._doCall = function (method, data, showLoader, service, endPoint) {
111
- var _this = this;
112
- if (data === void 0) { data = {}; }
113
- if (showLoader === void 0) { showLoader = true; }
114
- if (service === void 0) { service = BackendServiceName.LoginService; }
115
- if (endPoint === void 0) { endPoint = EndPoint.AjaxService; }
56
+ }
57
+ _doCall(method, data = {}, showLoader = true, service = backend_service_name_enum_1.BackendServiceName.LoginService, endPoint = end_point_enum_1.EndPoint.AjaxService) {
116
58
  if (showLoader) {
117
59
  this.setShowLoaderRequests(this._showLoaderRequests + 1);
118
60
  }
119
- return new Promise(function (resolve, reject) {
120
- var url = UrlUtils.createReadableUrl(method, data, _this.url, endPoint);
121
- var message;
122
- if (_this._usePublicToken) {
61
+ return new Promise((resolve, reject) => {
62
+ const url = url_utils_1.UrlUtils.createReadableUrl(method, data, this.url, endPoint);
63
+ let message;
64
+ if (this._usePublicToken) {
123
65
  message = JSON.stringify({
124
66
  method: method,
125
67
  data: data,
126
- token: _this._token
68
+ token: this._token
127
69
  });
128
70
  }
129
71
  else {
130
72
  message = JSON.stringify({
131
73
  service: service,
132
74
  method: method,
133
- id: _this.callId,
75
+ id: this.callId,
134
76
  data: data,
135
- dataSessionId: _this.session ? _this.session.dataSessionId : "",
136
- windowSessionId: _this.session ? _this.session.windowsId : "1",
137
- sessionId: _this.session ? _this.session.id : ""
77
+ dataSessionId: this.session ? this.session.dataSessionId : "",
78
+ windowSessionId: this.session ? this.session.windowsId : "1",
79
+ sessionId: this.session ? this.session.id : ""
138
80
  });
139
81
  }
140
- axios({
82
+ axios_1.default({
141
83
  method: 'post',
142
84
  url: url,
143
85
  data: message,
144
- timeout: _this._timeout
145
- }).then(function (response) {
86
+ timeout: this._timeout
87
+ }).then(response => {
146
88
  if (response.data) {
147
89
  if (response.data.exception) {
148
90
  resolve(response.data.exception);
@@ -151,27 +93,27 @@ var AjaxService = (function (_super) {
151
93
  resolve(response.data.data);
152
94
  }
153
95
  }
154
- }).catch(function (error) {
96
+ }).catch(error => {
155
97
  if (showLoader) {
156
- _this.setShowLoaderRequests(0);
98
+ this.setShowLoaderRequests(0);
157
99
  }
158
100
  if (error.code === "ECONNABORTED") {
159
- _this.connectionAborted.next();
101
+ this.connectionAborted.next();
160
102
  }
161
103
  else if (error.response && error.response.status === 500) {
162
- _this.resetConnection();
163
- _this.connectionResetInactivity.next();
104
+ this.resetConnection();
105
+ this.connectionResetInactivity.next();
164
106
  }
165
107
  reject(error);
166
108
  });
167
- }).then(function (response) {
109
+ }).then(response => {
168
110
  if (showLoader) {
169
- _this.setShowLoaderRequests(_this._showLoaderRequests - 1);
111
+ this.setShowLoaderRequests(this._showLoaderRequests - 1);
170
112
  }
171
- return new Promise(function (resolve) { return resolve(response); });
113
+ return new Promise((resolve) => { return resolve(response); });
172
114
  });
173
- };
174
- AjaxService.prototype.setShowLoaderRequests = function (amount) {
115
+ }
116
+ setShowLoaderRequests(amount) {
175
117
  this._showLoaderRequests = amount;
176
118
  if (this._showLoaderRequests > 0) {
177
119
  this.showLoader.next(true);
@@ -179,22 +121,14 @@ var AjaxService = (function (_super) {
179
121
  else {
180
122
  this.showLoader.next(false);
181
123
  }
182
- };
183
- AjaxService.prototype._createPublicSession = function () {
184
- return __awaiter(this, void 0, void 0, function () {
185
- var data;
186
- return __generator(this, function (_a) {
187
- switch (_a.label) {
188
- case 0:
189
- data = {
190
- upId: this._schema
191
- };
192
- return [4, this._doCall(DatasessionServiceMethod.CreatePublicSession, data, false, BackendServiceName.PublicService, EndPoint.PublicService)];
193
- case 1: return [2, _a.sent()];
194
- }
195
- });
124
+ }
125
+ _createPublicSession() {
126
+ return __awaiter(this, void 0, void 0, function* () {
127
+ const data = {
128
+ upId: this._schema
129
+ };
130
+ return yield this._doCall(datasession_service_method_enum_1.DatasessionServiceMethod.CreatePublicSession, data, false, backend_service_name_enum_1.BackendServiceName.PublicService, end_point_enum_1.EndPoint.PublicService);
196
131
  });
197
- };
198
- return AjaxService;
199
- }(BaseBackendConnectionService));
200
- export { AjaxService };
132
+ }
133
+ }
134
+ exports.AjaxService = AjaxService;