@colijnit/mainapi 1.0.11 → 1.0.13

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/main-api.js CHANGED
@@ -11,6 +11,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.MainApi = void 0;
13
13
  const rxjs_1 = require("rxjs");
14
+ const session_1 = require("@colijnit/ioneconnector/build/model/session");
14
15
  const ioneconnector_1 = require("@colijnit/ioneconnector");
15
16
  const main_auth_1 = require("./main-auth");
16
17
  const main_public_1 = require("./main-public");
@@ -19,7 +20,7 @@ class MainApi {
19
20
  this.showLoader = new rxjs_1.Subject();
20
21
  this.connectionAborted = new rxjs_1.Subject();
21
22
  this.connectionResetInactivity = new rxjs_1.Subject();
22
- this.session = undefined;
23
+ this.session = new session_1.Session();
23
24
  this.useLoginEncryption = false;
24
25
  this._subs = [];
25
26
  if (options) {
@@ -37,10 +38,10 @@ class MainApi {
37
38
  this.mainApi.connector = this._connector;
38
39
  this.mainApi.languageCode = this.languageCode;
39
40
  this.mainApi.branchNr = this.branch;
40
- if (!this.session && this._connector.hasOwnProperty("session")) {
41
+ if (this._connector.hasOwnProperty("session")) {
41
42
  this.session = this._connector["session"];
42
43
  }
43
- this._subs.push(this.mainApi.showLoader.subscribe(value => this.showLoader.next(value)), this.mainApi.connectionAborted.subscribe(() => this.connectionAborted.next()), this.mainApi.connectionResetInactivity.subscribe(() => this._handleConnectionReset()));
44
+ this._subs.push(this._connector.showLoader.subscribe(value => this.showLoader.next(value)), this._connector.connectionAborted.subscribe(() => this.connectionAborted.next()), this._connector.connectionResetInactivity.subscribe(() => this._handleConnectionReset()));
44
45
  }
45
46
  getSequenceValue(sequenceName, noSequence = false) {
46
47
  return __awaiter(this, void 0, void 0, function* () {
@@ -72,7 +73,7 @@ class MainApi {
72
73
  return this.mainApi.getPackageStickerPrintLayouts();
73
74
  }
74
75
  static createConnector(options) {
75
- if ((options.username && options.password) || options.session) {
76
+ if (options.username && options.password) {
76
77
  return new main_auth_1.MainAuth();
77
78
  }
78
79
  return new main_public_1.MainPublic();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@colijnit/mainapi",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "scripts": {
5
5
  "build": "grunt clean && tsc",
6
6
  "browserify": "browserify build/connector.js --s colijn -o dist/out-tsc/bundle.js",
@@ -20,15 +20,14 @@
20
20
  "private": false,
21
21
  "dependencies": {
22
22
  "reflect-metadata": "^0.1.12",
23
- "rxjs": "~6.5.4",
24
- "rxjs-compat": "^6.6.3"
23
+ "rxjs": "6.6.3"
25
24
  },
26
25
  "peerDependencies": {
27
- "@colijnit/ioneconnector": ">=2.1.10"
26
+ "@colijnit/ioneconnector": ">=2.1.13"
28
27
  },
29
28
  "devDependencies": {
30
29
  "@types/jest": "^24.0.13",
31
- "@colijnit/ioneconnector": "2.1.10",
30
+ "@colijnit/ioneconnector": "2.1.13",
32
31
  "grunt": "^1.0.3",
33
32
  "grunt-clean": "^0.4.0",
34
33
  "grunt-contrib-clean": "^1.1.0",