@colijnit/ioneconnector 1.0.136 → 1.0.139

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 (38) hide show
  1. package/build/connector-auth.d.ts +2 -0
  2. package/build/connector-auth.js +19 -26
  3. package/build/connector-public.d.ts +2 -0
  4. package/build/connector-public.js +12 -17
  5. package/build/connector.d.ts +8 -8
  6. package/build/connector.js +173 -204
  7. package/build/connector.unit.test.js +11 -1
  8. package/build/enum/article-method.enum.d.ts +1 -0
  9. package/build/enum/article-method.enum.js +1 -0
  10. package/build/enum/general-method.enum.d.ts +1 -0
  11. package/build/enum/general-method.enum.js +1 -0
  12. package/build/enum/general-object-name.enum.d.ts +2 -1
  13. package/build/enum/general-object-name.enum.js +1 -0
  14. package/build/enum/hd-service-method.d.ts +2 -0
  15. package/build/enum/hd-service-method.js +2 -0
  16. package/build/ione-api-connection.d.ts +2 -0
  17. package/build/model/catalog-definition.d.ts +24 -0
  18. package/build/model/catalog-definition.js +66 -0
  19. package/build/model/external-source-translation.d.ts +7 -0
  20. package/build/model/external-source-translation.js +6 -0
  21. package/build/provider/ajax.service.js +20 -30
  22. package/build/provider/base-backend-connection.service.js +2 -13
  23. package/build/provider/data-repository.service.d.ts +2 -0
  24. package/build/provider/data-repository.service.js +205 -232
  25. package/build/provider/hd-ajax.service.js +31 -39
  26. package/build/provider/hd-ajax.service.unit.test.js +15 -21
  27. package/build/service/datasession.service.js +2 -13
  28. package/build/service/encrypt.service.js +5 -2
  29. package/build/service/hd-data.service.d.ts +2 -0
  30. package/build/service/hd-data.service.js +562 -615
  31. package/build/service/hd-session.service.js +29 -44
  32. package/build/service/hd-session.service.unit.test.js +19 -28
  33. package/build/tests/int/connector-auth.int.test.js +7 -16
  34. package/build/tests/int/connector-public.int.test.js +10 -19
  35. package/build/tests/int/connector.int.test.js +9 -18
  36. package/build/utils/promise-utils.js +3 -12
  37. package/build/websocket/socket.js +2 -13
  38. package/package.json +7 -4
@@ -46,6 +46,7 @@ export declare class ConnectorAuth implements IoneApiConnection {
46
46
  saveConfigurations(): Promise<boolean>;
47
47
  setInstanceToConfigure(instanceId: string, changeInstance?: boolean): Promise<DataServiceResponseRoot>;
48
48
  initNodeInstance(goodId: number): Promise<any>;
49
+ changeConnection(oldConnection: string, newConnection: string): Promise<any>;
49
50
  copyInstance(instanceId: string, shouldSaveCurrentInstanceId: boolean): Promise<DataServiceResponseRoot>;
50
51
  getArticleQuickSel(goodId: number): Promise<Article>;
51
52
  getSuperArticleQuickSel(id: string): Promise<SuperArticle>;
@@ -57,6 +58,7 @@ export declare class ConnectorAuth implements IoneApiConnection {
57
58
  getSelectorActiveOptionValuesPrices(): Promise<any>;
58
59
  getAnswerTexts(params: any): Promise<any>;
59
60
  getDocumentContent(id: number, thumbnail: boolean): Promise<any>;
61
+ getCatalogDefinitions(showLoader?: boolean): Promise<any>;
60
62
  getSingleImage(nodeId: number | string, publication: number, includeMimetype: boolean, thumb: boolean, showLoader: boolean): Promise<string>;
61
63
  getDecos(): Promise<any>;
62
64
  getSelections(): Promise<any>;
@@ -1,13 +1,4 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  const data_repository_service_1 = require("./provider/data-repository.service");
13
4
  const rxjs_1 = require("rxjs");
@@ -34,28 +25,27 @@ class ConnectorAuth {
34
25
  this.dataRepository.showLoader.subscribe(value => this.showLoader.next(value));
35
26
  this.dataRepository.connectionResetInactivity.subscribe(() => this.connectionResetInactivity.next());
36
27
  }
37
- saveConfigurations() {
38
- return __awaiter(this, void 0, void 0, function* () {
39
- const result = yield this.dataRepository.storeInstance();
40
- return result.data.validationResult.success;
41
- });
42
- }
43
- setInstanceToConfigure(instanceId, changeInstance = true) {
44
- return __awaiter(this, void 0, void 0, function* () {
45
- if (this.currentInstanceId !== instanceId) {
46
- this.currentInstanceId = instanceId;
47
- if (changeInstance) {
48
- return yield this.dataRepository.changeInstance(instanceId);
49
- }
50
- else {
51
- return;
52
- }
28
+ async saveConfigurations() {
29
+ const result = await this.dataRepository.storeInstance();
30
+ return result.data.validationResult.success;
31
+ }
32
+ async setInstanceToConfigure(instanceId, changeInstance = true) {
33
+ if (this.currentInstanceId !== instanceId) {
34
+ this.currentInstanceId = instanceId;
35
+ if (changeInstance) {
36
+ return await this.dataRepository.changeInstance(instanceId);
37
+ }
38
+ else {
39
+ return;
53
40
  }
54
- });
41
+ }
55
42
  }
56
43
  initNodeInstance(goodId) {
57
44
  return this.dataRepository.initNodeInstance(goodId);
58
45
  }
46
+ changeConnection(oldConnection, newConnection) {
47
+ return this.dataRepository.changeConnection(oldConnection, newConnection);
48
+ }
59
49
  copyInstance(instanceId, shouldSaveCurrentInstanceId) {
60
50
  return this.dataRepository.copyInstance(instanceId, shouldSaveCurrentInstanceId);
61
51
  }
@@ -89,6 +79,9 @@ class ConnectorAuth {
89
79
  getDocumentContent(id, thumbnail) {
90
80
  return this.dataRepository.getDocumentContent(id, thumbnail);
91
81
  }
82
+ getCatalogDefinitions(showLoader = true) {
83
+ return this.dataRepository.getCatalogDefinitions(showLoader);
84
+ }
92
85
  getSingleImage(nodeId, publication, includeMimetype, thumb, showLoader) {
93
86
  return this.dataRepository.getSingleImage(nodeId, publication, includeMimetype, thumb, showLoader);
94
87
  }
@@ -41,6 +41,7 @@ export declare class ConnectorPublic implements IoneApiConnection {
41
41
  saveConfigurations(): Promise<boolean>;
42
42
  setInstanceToConfigure(instanceId: string, changeInstance?: boolean): Promise<DataServiceResponseRoot>;
43
43
  initNodeInstance(goodId: number): Promise<any>;
44
+ changeConnection(oldConnection: string, newConnection: string): Promise<any>;
44
45
  copyInstance(instanceId: string, shouldSaveCurrentInstanceId: boolean): Promise<DataServiceResponseRoot>;
45
46
  getArticleQuickSel(goodId: number): Promise<Article>;
46
47
  getSuperArticleQuickSel(id: string): Promise<SuperArticle>;
@@ -52,6 +53,7 @@ export declare class ConnectorPublic implements IoneApiConnection {
52
53
  getSelectorActiveOptionValuesPrices(): Promise<any>;
53
54
  getAnswerTexts(params: any): Promise<any>;
54
55
  getDocumentContent(id: number, thumbnail: boolean): Promise<any>;
56
+ getCatalogDefinitions(showLoader?: boolean): Promise<any>;
55
57
  getSingleImage(nodeId: number | string, publication: number, includeMimetype: boolean, thumb: boolean, showLoader: boolean): Promise<string>;
56
58
  getDecos(): Promise<any>;
57
59
  getSelections(): Promise<any>;
@@ -1,13 +1,4 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  const rxjs_1 = require("rxjs");
13
4
  const data_service_response_data_1 = require("./model/data-service-response-data");
@@ -41,14 +32,15 @@ class ConnectorPublic {
41
32
  };
42
33
  return Promise.resolve(responseRoot);
43
34
  }
44
- initNodeInstance(goodId) {
45
- return __awaiter(this, void 0, void 0, function* () {
46
- const response = yield this.dataService.initNodeInstance(goodId, this._branch);
47
- if (response && response.data && response.data.validationResult && response.data.validationResult.success) {
48
- this.setInstanceToConfigure(response.data.resultObject);
49
- }
50
- return response;
51
- });
35
+ async initNodeInstance(goodId) {
36
+ const response = await this.dataService.initNodeInstance(goodId, this._branch);
37
+ if (response && response.data && response.data.validationResult && response.data.validationResult.success) {
38
+ this.setInstanceToConfigure(response.data.resultObject);
39
+ }
40
+ return response;
41
+ }
42
+ async changeConnection(oldConnection, newConnection) {
43
+ return this.dataService.changeConnection(oldConnection, newConnection);
52
44
  }
53
45
  copyInstance(instanceId, shouldSaveCurrentInstanceId) {
54
46
  return this.dataService.copyInstance(instanceId);
@@ -84,6 +76,9 @@ class ConnectorPublic {
84
76
  getDocumentContent(id, thumbnail) {
85
77
  return this.dataService.getDocumentContent(id, thumbnail);
86
78
  }
79
+ getCatalogDefinitions(showLoader = true) {
80
+ return this.dataService.getCatalogDefinitions(showLoader);
81
+ }
87
82
  getSingleImage(nodeId, publication, includeMimetype, thumb, showLoader) {
88
83
  return this.dataService.getSingleImage(nodeId, publication, includeMimetype, thumb, showLoader);
89
84
  }
@@ -19,8 +19,6 @@ import { Tag } from "./model/tag";
19
19
  import { Color } from "./model/color";
20
20
  import { Catalog } from "./catalog";
21
21
  import { Atmosphere } from "./model/atmosphere";
22
- import { MatchArticle } from "./model/match-article";
23
- import { FrozenArticle } from "./model/frozen-article";
24
22
  import { ArticleFullObject } from "./model/article-full-object";
25
23
  import { IoneApiConnection } from "./ione-api-connection";
26
24
  import { Question } from "./model/question";
@@ -79,6 +77,7 @@ export declare class Connector {
79
77
  copyInstance(instanceId: string, shouldSaveCurrentInstanceId: boolean): Promise<DataServiceResponseRoot>;
80
78
  getArticle(skuOrId: string): Promise<Article>;
81
79
  initNodeInstance(skuOrId: string): Promise<any>;
80
+ changeConnection(oldConnection: string, newConnection: string): Promise<any>;
82
81
  getArticleQuickSel(id: number): Promise<Article>;
83
82
  getSuperArticle(id: string): Promise<SuperArticle>;
84
83
  getFullArticle(skuOrId: string): Promise<ArticleFullObject>;
@@ -89,6 +88,7 @@ export declare class Connector {
89
88
  getAnswersPrices(): Promise<AnswerPrice[]>;
90
89
  getAnswerInfo(answer: Answer): void;
91
90
  getDocumentContent(docId: number, thumbnail?: boolean): Promise<any>;
91
+ getCatalogDefinitions(showLoader?: boolean): Promise<any>;
92
92
  getImageForAnswerSelection(answerOrSelection: Answer | Selection, thumbNail?: boolean, showLoader?: boolean): void;
93
93
  getImageForAnswerOrSelection(answerOrSelection: Answer | Selection, publication?: number, thumbNail?: boolean, showLoader?: boolean): Promise<string>;
94
94
  getMoodImageForAnswerSelection(answerOrSelection: Answer | Selection, thumbNail?: boolean, showLoader?: boolean): void;
@@ -121,17 +121,17 @@ export declare class Connector {
121
121
  getSelectorArticleThumbnail(documentKey: string, showLoader?: boolean): Promise<string>;
122
122
  getConcepts(): Promise<Concept[]>;
123
123
  getArticleGroups(): Promise<ArticleGroup[]>;
124
- handleSelectionsReceived(data: any): void;
125
- handleDecoNodesReceived(data: any): void;
124
+ private handleSelectionsReceived;
125
+ private handleDecoNodesReceived;
126
126
  private _nextCombNode;
127
127
  private _nextNode;
128
128
  private _cancelBack2node;
129
129
  private _navigateTo;
130
- getDeliveryDateDescription(date: Date): string;
131
- checkSkuOrId(skuOrId: string): Promise<number>;
130
+ private getDeliveryDateDescription;
131
+ private checkSkuOrId;
132
132
  getSelectionsToDisplay(allSelections: Selection[]): Selection[];
133
- getMappedMatchTable(data: any): MatchArticle[];
134
- getMappedFrozenArticle(data: any): FrozenArticle;
133
+ private getMappedMatchTable;
134
+ private getMappedFrozenArticle;
135
135
  static createConnector(options: Options, externalStorage: ExternalStorage): IoneApiConnection;
136
136
  private _handleConnectionReset;
137
137
  private _prepareAnswersAndImages;