@colijnit/ioneconnector 1.0.137 → 1.0.140

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.
@@ -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>;
@@ -43,6 +43,9 @@ class ConnectorAuth {
43
43
  initNodeInstance(goodId) {
44
44
  return this.dataRepository.initNodeInstance(goodId);
45
45
  }
46
+ changeConnection(oldConnection, newConnection) {
47
+ return this.dataRepository.changeConnection(oldConnection, newConnection);
48
+ }
46
49
  copyInstance(instanceId, shouldSaveCurrentInstanceId) {
47
50
  return this.dataRepository.copyInstance(instanceId, shouldSaveCurrentInstanceId);
48
51
  }
@@ -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>;
@@ -39,6 +39,9 @@ class ConnectorPublic {
39
39
  }
40
40
  return response;
41
41
  }
42
+ async changeConnection(oldConnection, newConnection) {
43
+ return this.dataService.changeConnection(oldConnection, newConnection);
44
+ }
42
45
  copyInstance(instanceId, shouldSaveCurrentInstanceId) {
43
46
  return this.dataService.copyInstance(instanceId);
44
47
  }
@@ -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>;
@@ -122,17 +121,17 @@ export declare class Connector {
122
121
  getSelectorArticleThumbnail(documentKey: string, showLoader?: boolean): Promise<string>;
123
122
  getConcepts(): Promise<Concept[]>;
124
123
  getArticleGroups(): Promise<ArticleGroup[]>;
125
- handleSelectionsReceived(data: any): void;
126
- handleDecoNodesReceived(data: any): void;
124
+ private handleSelectionsReceived;
125
+ private handleDecoNodesReceived;
127
126
  private _nextCombNode;
128
127
  private _nextNode;
129
128
  private _cancelBack2node;
130
129
  private _navigateTo;
131
- getDeliveryDateDescription(date: Date): string;
132
- checkSkuOrId(skuOrId: string): Promise<number>;
130
+ private getDeliveryDateDescription;
131
+ private checkSkuOrId;
133
132
  getSelectionsToDisplay(allSelections: Selection[]): Selection[];
134
- getMappedMatchTable(data: any): MatchArticle[];
135
- getMappedFrozenArticle(data: any): FrozenArticle;
133
+ private getMappedMatchTable;
134
+ private getMappedFrozenArticle;
136
135
  static createConnector(options: Options, externalStorage: ExternalStorage): IoneApiConnection;
137
136
  private _handleConnectionReset;
138
137
  private _prepareAnswersAndImages;
@@ -107,6 +107,9 @@ class Connector {
107
107
  .catch((e) => Promise.reject(e));
108
108
  return this.connection.initNodeInstance(goodId);
109
109
  }
110
+ async changeConnection(oldConnection, newConnection) {
111
+ return this.connection.changeConnection(oldConnection, newConnection);
112
+ }
110
113
  getArticleQuickSel(id) {
111
114
  return this.connection.getArticleQuickSel(id);
112
115
  }
@@ -284,7 +287,7 @@ class Connector {
284
287
  const selections = [];
285
288
  const len = rawData ? rawData.length : 0;
286
289
  for (let i = 0; i < len; i++) {
287
- const selection = new selection_1.Selection(rawData[i]);
290
+ const selection = this.boFactory.makeWithRawBackendData(selection_1.Selection, rawData[i]);
288
291
  selection.instanceId = this.connection.currentInstanceId;
289
292
  selections.push(selection);
290
293
  }
@@ -6,6 +6,7 @@ export declare enum ArticleMethod {
6
6
  CheckChangableUnit = "checkChangableUnit",
7
7
  InitNode = "initNode",
8
8
  InitNodeInstance = "InitNodeInstance",
9
+ ChangeConnection = "changeConnection",
9
10
  CopyInstance = "copyInstance",
10
11
  ChangeInstance = "changeInstance",
11
12
  StoreInstance = "storeInstance",
@@ -9,6 +9,7 @@ var ArticleMethod;
9
9
  ArticleMethod["CheckChangableUnit"] = "checkChangableUnit";
10
10
  ArticleMethod["InitNode"] = "initNode";
11
11
  ArticleMethod["InitNodeInstance"] = "InitNodeInstance";
12
+ ArticleMethod["ChangeConnection"] = "changeConnection";
12
13
  ArticleMethod["CopyInstance"] = "copyInstance";
13
14
  ArticleMethod["ChangeInstance"] = "changeInstance";
14
15
  ArticleMethod["StoreInstance"] = "storeInstance";
@@ -2,6 +2,7 @@ export declare enum HdServiceMethod {
2
2
  CreatePublicSession = "createPublicSession",
3
3
  ClosePublicSession = "closePublicSession",
4
4
  InitNodeInstance = "initNodeInstance",
5
+ ChangeConnection = "changeConnection",
5
6
  CopyInstance = "copyInstance",
6
7
  NextNode = "nextNode",
7
8
  NextCombNode = "nextCombNode",
@@ -5,6 +5,7 @@ var HdServiceMethod;
5
5
  HdServiceMethod["CreatePublicSession"] = "createPublicSession";
6
6
  HdServiceMethod["ClosePublicSession"] = "closePublicSession";
7
7
  HdServiceMethod["InitNodeInstance"] = "initNodeInstance";
8
+ HdServiceMethod["ChangeConnection"] = "changeConnection";
8
9
  HdServiceMethod["CopyInstance"] = "copyInstance";
9
10
  HdServiceMethod["NextNode"] = "nextNode";
10
11
  HdServiceMethod["NextCombNode"] = "nextCombNode";
@@ -31,6 +31,7 @@ export interface IoneApiConnection {
31
31
  saveConfigurations(): Promise<boolean>;
32
32
  setInstanceToConfigure(instanceId: string, changeInstance: boolean): Promise<DataServiceResponseRoot>;
33
33
  initNodeInstance(goodId: number): Promise<any>;
34
+ changeConnection(oldConnection: string, newConnection: string): Promise<any>;
34
35
  copyInstance(instanceId: string, shouldSaveCurrentInstanceId: boolean): Promise<DataServiceResponseRoot>;
35
36
  getArticleQuickSel(goodId: number): Promise<Article>;
36
37
  getSuperArticleQuickSel(id: string): Promise<SuperArticle>;
@@ -56,6 +56,7 @@ export declare class DataRepositoryService {
56
56
  getQuestionAndAnswers(): Promise<any>;
57
57
  initNode(id: any): Promise<any>;
58
58
  initNodeInstance(id: any): Promise<any>;
59
+ changeConnection(oldConnection: string, newConnection: string): Promise<any>;
59
60
  copyInstance(instanceId: string, shouldSaveCurrentInstanceId: boolean): Promise<DataServiceResponseRoot>;
60
61
  getSelectorActiveOptionValuesPrices(): Promise<any>;
61
62
  getAnswerTexts(params: any): Promise<any>;
@@ -75,7 +75,7 @@ class DataRepositoryService {
75
75
  return new Promise((resolve, reject) => {
76
76
  return this.call(data)
77
77
  .then((result) => {
78
- if (result.data.validationResult && result.data.validationResult.success) {
78
+ if (result.data.validationResult && result.data.validationResult.success && result.data.resultObject) {
79
79
  return resolve(result.data.resultObject);
80
80
  }
81
81
  else {
@@ -373,6 +373,24 @@ class DataRepositoryService {
373
373
  });
374
374
  });
375
375
  }
376
+ changeConnection(oldConnection, newConnection) {
377
+ return new Promise((resolve, reject) => {
378
+ const params = { oldConnection: oldConnection, newConnection: newConnection };
379
+ const data = {
380
+ methodName: article_method_enum_1.ArticleMethod.ChangeConnection,
381
+ moduleName: module_name_enum_1.ModuleName.Articles,
382
+ refCursorAsArray: true,
383
+ parameterValues: params
384
+ };
385
+ return this.call(data)
386
+ .then((data) => {
387
+ return resolve(data);
388
+ })
389
+ .catch((e) => {
390
+ return reject(e);
391
+ });
392
+ });
393
+ }
376
394
  async copyInstance(instanceId, shouldSaveCurrentInstanceId) {
377
395
  const params = {
378
396
  sourceInstanceId: instanceId,
@@ -774,7 +792,7 @@ class DataRepositoryService {
774
792
  refCursorAsArray: true,
775
793
  parameterValues: params
776
794
  };
777
- return this.call(data, undefined, showLoader);
795
+ return this.call(data, data_service_method_enum_1.DataServiceMethod.ExecuteMethod, showLoader);
778
796
  }
779
797
  callGenerateFrozenArticle(configuratorStatistics) {
780
798
  const params = {};
@@ -36,6 +36,7 @@ export declare class HdDataService {
36
36
  set languageCode(value: string);
37
37
  constructor(sessionService: HdSessionService, boFactory: BusinessObjectFactory, options: Options);
38
38
  initNodeInstance(goodId: number, branch: string): Promise<any>;
39
+ changeConnection(oldConnection: string, newConnection: string): Promise<any>;
39
40
  copyInstance(instanceId: string): Promise<DataServiceResponseRoot>;
40
41
  nextNode(params: any): Promise<DataServiceResponseRoot>;
41
42
  nextCombNode(params: any): Promise<DataServiceResponseRoot>;
@@ -46,6 +46,11 @@ class HdDataService {
46
46
  const data = { ...this.createServiceRequestData(), parameterValues: params };
47
47
  return this._sessionService.call(hd_service_method_1.HdServiceMethod.InitNodeInstance, data);
48
48
  }
49
+ changeConnection(oldConnection, newConnection) {
50
+ const params = { instanceId: this._instanceId, oldConnection: oldConnection, newConnection: newConnection };
51
+ const data = { ...this.createServiceRequestData(), parameterValues: params };
52
+ return this._sessionService.call(hd_service_method_1.HdServiceMethod.ChangeConnection, data);
53
+ }
49
54
  copyInstance(instanceId) {
50
55
  const params = { instanceId: instanceId };
51
56
  const data = { ...this.createServiceRequestData(), parameterValues: params };
@@ -307,7 +312,7 @@ class HdDataService {
307
312
  });
308
313
  const result = response.data;
309
314
  if (result.validationResult && result.validationResult.success) {
310
- return result;
315
+ return result.resultObject['activeNodesPr'];
311
316
  }
312
317
  else {
313
318
  console.error("Error getting selector action prices (" + response.message + ")");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@colijnit/ioneconnector",
3
- "version": "1.0.137",
3
+ "version": "1.0.140",
4
4
  "scripts": {
5
5
  "build": "grunt clean && tsc",
6
6
  "browserify": "browserify build/connector.js --s colijn -o dist/out-tsc/bundle.js",