@easyquery/enterprise 7.2.5 → 7.3.0-rc02

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.
@@ -5,7 +5,7 @@ var core$1 = require('@easydata/core');
5
5
  var ui = require('@easydata/ui');
6
6
 
7
7
  const majVer = 7;
8
- const minVer = 2;
8
+ const minVer = 3;
9
9
  const magics = [45, 128, 231];
10
10
  Math.trunc = Math.trunc || function (x) {
11
11
  if (isNaN(x)) {
@@ -827,12 +827,12 @@ class LCDialog {
827
827
  startPageOnSubmit(dlg) {
828
828
  const emailInput = document.getElementById('eqAuthEmail');
829
829
  const nameInput = document.getElementById('eqAuthName');
830
- const authEmail = emailInput.value;
831
- const authName = nameInput.value;
830
+ this.authEmail = emailInput.value;
831
+ this.authName = nameInput.value;
832
832
  dlg.disableButtons();
833
833
  this.http.post(core.equtils.combinePath(baseLicApiUrl, 'get-code'), {
834
- email: authEmail,
835
- name: authName,
834
+ email: this.authEmail,
835
+ name: this.authName,
836
836
  data: {
837
837
  ptag: this.context.backendInfo.type,
838
838
  apptype: this.context.backendInfo.subType,
@@ -842,7 +842,7 @@ class LCDialog {
842
842
  if (result.status !== 0) {
843
843
  throw new Error(result.message);
844
844
  }
845
- const dlg = this.dialogSet.openNext({ email: authEmail });
845
+ const dlg = this.dialogSet.openNext({ email: this.authEmail });
846
846
  setTimeout(() => {
847
847
  this.validateForm(dlg);
848
848
  const codeInput = document.getElementById('eqAuthCode');
@@ -852,7 +852,7 @@ class LCDialog {
852
852
  }, 200);
853
853
  })
854
854
  .catch(error => {
855
- dlg.showAlert(error.message, "error", true);
855
+ dlg.showAlert('Error: ' + error.message, "error", true);
856
856
  dlg.enableButtons();
857
857
  });
858
858
  return false;
@@ -863,6 +863,7 @@ class LCDialog {
863
863
  dlg.disableButtons();
864
864
  this.http.post(core.equtils.combinePath(baseLicApiUrl, 'get-key'), {
865
865
  token: authCode,
866
+ email: this.authEmail,
866
867
  ptag: this.context.backendInfo.type,
867
868
  version: eqVersion
868
869
  }, { dataType: 'json' })
@@ -899,7 +900,7 @@ class LCDialog {
899
900
  }
900
901
  })
901
902
  .catch(error => {
902
- dlg.showAlert(error.message, "error", true);
903
+ dlg.showAlert('Error: ' + error.message, "error", true);
903
904
  dlg.enableButtons();
904
905
  });
905
906
  return false;
@@ -999,16 +1000,23 @@ class EnterpriseEqContext extends core.EqContext {
999
1000
  keyOrInitCallback();
1000
1001
  })
1001
1002
  .catch(error => {
1002
- url = core.equtils.combinePath(this.getBaseEndpoint(), 'lck');
1003
- http.get(url)
1004
- .then(result => {
1005
- func(result.split("").reverse().join(""));
1006
- keyOrInitCallback();
1007
- })
1008
- .catch(error => this.throwError({
1009
- action: "LCK",
1010
- sourceError: error
1011
- }));
1003
+ if (error.status == 401) {
1004
+ //if the stutus is Not Autorized
1005
+ func('');
1006
+ }
1007
+ else {
1008
+ //otherwise try the old way
1009
+ url = core.equtils.combinePath(this.getBaseEndpoint(), 'lck');
1010
+ http.get(url)
1011
+ .then(result => {
1012
+ func(result.split("").reverse().join(""));
1013
+ keyOrInitCallback();
1014
+ })
1015
+ .catch(error => this.throwError({
1016
+ action: "LCK",
1017
+ sourceError: error
1018
+ }));
1019
+ }
1012
1020
  });
1013
1021
  }
1014
1022
  else {
@@ -3,7 +3,7 @@ import { HttpClient, EasyDataTable } from '@easydata/core';
3
3
  import { DefaultDialogService, domel } from '@easydata/ui';
4
4
 
5
5
  const majVer = 7;
6
- const minVer = 2;
6
+ const minVer = 3;
7
7
  const magics = [45, 128, 231];
8
8
  Math.trunc = Math.trunc || function (x) {
9
9
  if (isNaN(x)) {
@@ -825,12 +825,12 @@ class LCDialog {
825
825
  startPageOnSubmit(dlg) {
826
826
  const emailInput = document.getElementById('eqAuthEmail');
827
827
  const nameInput = document.getElementById('eqAuthName');
828
- const authEmail = emailInput.value;
829
- const authName = nameInput.value;
828
+ this.authEmail = emailInput.value;
829
+ this.authName = nameInput.value;
830
830
  dlg.disableButtons();
831
831
  this.http.post(equtils.combinePath(baseLicApiUrl, 'get-code'), {
832
- email: authEmail,
833
- name: authName,
832
+ email: this.authEmail,
833
+ name: this.authName,
834
834
  data: {
835
835
  ptag: this.context.backendInfo.type,
836
836
  apptype: this.context.backendInfo.subType,
@@ -840,7 +840,7 @@ class LCDialog {
840
840
  if (result.status !== 0) {
841
841
  throw new Error(result.message);
842
842
  }
843
- const dlg = this.dialogSet.openNext({ email: authEmail });
843
+ const dlg = this.dialogSet.openNext({ email: this.authEmail });
844
844
  setTimeout(() => {
845
845
  this.validateForm(dlg);
846
846
  const codeInput = document.getElementById('eqAuthCode');
@@ -850,7 +850,7 @@ class LCDialog {
850
850
  }, 200);
851
851
  })
852
852
  .catch(error => {
853
- dlg.showAlert(error.message, "error", true);
853
+ dlg.showAlert('Error: ' + error.message, "error", true);
854
854
  dlg.enableButtons();
855
855
  });
856
856
  return false;
@@ -861,6 +861,7 @@ class LCDialog {
861
861
  dlg.disableButtons();
862
862
  this.http.post(equtils.combinePath(baseLicApiUrl, 'get-key'), {
863
863
  token: authCode,
864
+ email: this.authEmail,
864
865
  ptag: this.context.backendInfo.type,
865
866
  version: eqVersion
866
867
  }, { dataType: 'json' })
@@ -897,7 +898,7 @@ class LCDialog {
897
898
  }
898
899
  })
899
900
  .catch(error => {
900
- dlg.showAlert(error.message, "error", true);
901
+ dlg.showAlert('Error: ' + error.message, "error", true);
901
902
  dlg.enableButtons();
902
903
  });
903
904
  return false;
@@ -997,16 +998,23 @@ class EnterpriseEqContext extends EqContext {
997
998
  keyOrInitCallback();
998
999
  })
999
1000
  .catch(error => {
1000
- url = equtils.combinePath(this.getBaseEndpoint(), 'lck');
1001
- http.get(url)
1002
- .then(result => {
1003
- func(result.split("").reverse().join(""));
1004
- keyOrInitCallback();
1005
- })
1006
- .catch(error => this.throwError({
1007
- action: "LCK",
1008
- sourceError: error
1009
- }));
1001
+ if (error.status == 401) {
1002
+ //if the stutus is Not Autorized
1003
+ func('');
1004
+ }
1005
+ else {
1006
+ //otherwise try the old way
1007
+ url = equtils.combinePath(this.getBaseEndpoint(), 'lck');
1008
+ http.get(url)
1009
+ .then(result => {
1010
+ func(result.split("").reverse().join(""));
1011
+ keyOrInitCallback();
1012
+ })
1013
+ .catch(error => this.throwError({
1014
+ action: "LCK",
1015
+ sourceError: error
1016
+ }));
1017
+ }
1010
1018
  });
1011
1019
  }
1012
1020
  else {
@@ -4,6 +4,8 @@ export declare class LCDialog {
4
4
  private dialogSet;
5
5
  private http;
6
6
  private context;
7
+ private authName;
8
+ private authEmail;
7
9
  constructor(context: EqContext);
8
10
  show(): void;
9
11
  protected isValidForm(form: HTMLElement): boolean | RegExpMatchArray;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easyquery/enterprise",
3
- "version": "7.2.5",
3
+ "version": "7.3.0-rc02",
4
4
  "description": "EasyQuery.JS Enterprise",
5
5
  "types": "./dist/types/public_api.d.ts",
6
6
  "main": "./dist/easyquery.enterprise.cjs.js",
@@ -27,10 +27,8 @@
27
27
  "bugs": "https://korzh.com/support",
28
28
  "license": "SEE LICENSE IN LICENSE.txt",
29
29
  "peerDependencies": {
30
- "@easydata/core": "^1.4.21",
31
- "@easydata/ui": "^1.4.21",
32
- "@easyquery/core": "^7.2.5",
33
- "@easyquery/ui": "^7.2.5"
30
+ "@easyquery/core": "^7.3.0-rc02",
31
+ "@easyquery/ui": "^7.3.0-rc02"
34
32
  },
35
33
  "files": [
36
34
  "dist"