@colijnit/ioneconnector 1.0.135 → 1.0.138
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/connector-auth.d.ts +2 -0
- package/build/connector-auth.js +19 -26
- package/build/connector-public.d.ts +2 -0
- package/build/connector-public.js +12 -17
- package/build/connector.d.ts +8 -8
- package/build/connector.js +173 -204
- package/build/connector.unit.test.js +11 -1
- package/build/enum/article-method.enum.d.ts +1 -0
- package/build/enum/article-method.enum.js +1 -0
- package/build/enum/general-method.enum.d.ts +1 -0
- package/build/enum/general-method.enum.js +1 -0
- package/build/enum/general-object-name.enum.d.ts +2 -1
- package/build/enum/general-object-name.enum.js +1 -0
- package/build/enum/hd-service-method.d.ts +2 -0
- package/build/enum/hd-service-method.js +2 -0
- package/build/ione-api-connection.d.ts +2 -0
- package/build/model/catalog-definition.d.ts +24 -0
- package/build/model/catalog-definition.js +66 -0
- package/build/model/external-source-translation.d.ts +7 -0
- package/build/model/external-source-translation.js +6 -0
- package/build/model/question.d.ts +1 -0
- package/build/model/question.js +1 -0
- package/build/provider/ajax.service.js +20 -30
- package/build/provider/base-backend-connection.service.js +2 -13
- package/build/provider/data-repository.service.d.ts +2 -0
- package/build/provider/data-repository.service.js +203 -230
- package/build/provider/hd-ajax.service.js +31 -39
- package/build/provider/hd-ajax.service.unit.test.js +15 -21
- package/build/service/datasession.service.js +2 -13
- package/build/service/encrypt.service.js +5 -2
- package/build/service/hd-data.service.d.ts +2 -0
- package/build/service/hd-data.service.js +562 -615
- package/build/service/hd-session.service.js +29 -44
- package/build/service/hd-session.service.unit.test.js +19 -28
- package/build/tests/int/connector-auth.int.test.js +7 -16
- package/build/tests/int/connector-public.int.test.js +10 -19
- package/build/tests/int/connector.int.test.js +9 -18
- package/build/utils/promise-utils.js +3 -12
- package/build/websocket/socket.js +2 -13
- package/package.json +7 -4
|
@@ -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 hd_service_method_1 = require("../enum/hd-service-method");
|
|
13
4
|
const color_1 = require("../model/color");
|
|
@@ -52,707 +43,663 @@ class HdDataService {
|
|
|
52
43
|
if (branch) {
|
|
53
44
|
params.branchNr = branch;
|
|
54
45
|
}
|
|
55
|
-
const data =
|
|
46
|
+
const data = { ...this.createServiceRequestData(), parameterValues: params };
|
|
56
47
|
return this._sessionService.call(hd_service_method_1.HdServiceMethod.InitNodeInstance, data);
|
|
57
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
|
+
}
|
|
58
54
|
copyInstance(instanceId) {
|
|
59
55
|
const params = { instanceId: instanceId };
|
|
60
|
-
const data =
|
|
56
|
+
const data = { ...this.createServiceRequestData(), parameterValues: params };
|
|
61
57
|
return this._sessionService.call(hd_service_method_1.HdServiceMethod.CopyInstance, data);
|
|
62
58
|
}
|
|
63
59
|
nextNode(params) {
|
|
64
60
|
params.instanceId = this._instanceId;
|
|
65
|
-
const data =
|
|
61
|
+
const data = { ...this.createServiceRequestData(), parameterValues: params };
|
|
66
62
|
return this._sessionService.call(hd_service_method_1.HdServiceMethod.NextNode, data);
|
|
67
63
|
}
|
|
68
64
|
nextCombNode(params) {
|
|
69
65
|
params.instanceId = this._instanceId;
|
|
70
|
-
const data =
|
|
66
|
+
const data = { ...this.createServiceRequestData(), parameterValues: params };
|
|
71
67
|
return this._sessionService.call(hd_service_method_1.HdServiceMethod.NextCombNode, data);
|
|
72
68
|
}
|
|
73
69
|
back2Node(params) {
|
|
74
70
|
params.instanceId = this._instanceId;
|
|
75
|
-
const data =
|
|
71
|
+
const data = { ...this.createServiceRequestData(), parameterValues: params };
|
|
76
72
|
return this._sessionService.call(hd_service_method_1.HdServiceMethod.Back2Node, data);
|
|
77
73
|
}
|
|
78
74
|
repeatOption(params) {
|
|
79
75
|
params.instanceId = this._instanceId;
|
|
80
|
-
const data =
|
|
76
|
+
const data = { ...this.createServiceRequestData(), parameterValues: params };
|
|
81
77
|
return this._sessionService.call(hd_service_method_1.HdServiceMethod.RepeatOption, data);
|
|
82
78
|
}
|
|
83
79
|
cancelBack2Node(params) {
|
|
84
80
|
params.instanceId = this._instanceId;
|
|
85
|
-
const data =
|
|
81
|
+
const data = { ...this.createServiceRequestData(), parameterValues: params };
|
|
86
82
|
return this._sessionService.call(hd_service_method_1.HdServiceMethod.CancelBack2Node, data);
|
|
87
83
|
}
|
|
88
84
|
navigateTo(params) {
|
|
89
85
|
params.instanceId = this._instanceId;
|
|
90
|
-
const data =
|
|
86
|
+
const data = { ...this.createServiceRequestData(), parameterValues: params };
|
|
91
87
|
return this._sessionService.call(hd_service_method_1.HdServiceMethod.NavigateTo, data);
|
|
92
88
|
}
|
|
93
|
-
getMatchTable() {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
return Promise.reject(e);
|
|
100
|
-
});
|
|
101
|
-
const result = response.data;
|
|
102
|
-
if (result.validationResult && result.validationResult.success) {
|
|
103
|
-
return result.resultObject ? result.resultObject["oMatchTable"] : null;
|
|
104
|
-
}
|
|
105
|
-
else {
|
|
106
|
-
console.error("Error retrieving match table data (" + response.message + ")");
|
|
107
|
-
return null;
|
|
108
|
-
}
|
|
89
|
+
async getMatchTable() {
|
|
90
|
+
const params = { instanceId: this._instanceId };
|
|
91
|
+
const data = { ...this.createServiceRequestData(), parameterValues: params };
|
|
92
|
+
const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.SelectorMatchTable, data)
|
|
93
|
+
.catch((e) => {
|
|
94
|
+
return Promise.reject(e);
|
|
109
95
|
});
|
|
96
|
+
const result = response.data;
|
|
97
|
+
if (result.validationResult && result.validationResult.success) {
|
|
98
|
+
return result.resultObject ? result.resultObject["oMatchTable"] : null;
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
console.error("Error retrieving match table data (" + response.message + ")");
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
110
104
|
}
|
|
111
|
-
getFrozenArticle(configuratorStatistics) {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
}
|
|
136
|
-
});
|
|
105
|
+
async getFrozenArticle(configuratorStatistics) {
|
|
106
|
+
const params = { instanceId: this._instanceId };
|
|
107
|
+
if (configuratorStatistics) {
|
|
108
|
+
params.configuratorStatisticsEnvironment = configuratorStatistics;
|
|
109
|
+
}
|
|
110
|
+
const data = { ...this.createServiceRequestData(), parameterValues: params };
|
|
111
|
+
const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.GenerateFrozenArticle, data)
|
|
112
|
+
.catch((e) => {
|
|
113
|
+
return Promise.reject(e);
|
|
114
|
+
});
|
|
115
|
+
if (response && response.data && response.data.validationResult && response.data.validationResult.success) {
|
|
116
|
+
const articles = this._boFactory.makeBOArrayFromRawBackendDataArray(selector_article_1.SelectorArticle, response.data.resultObject);
|
|
117
|
+
const composedArticle = !!articles[0].compositionArticleNo;
|
|
118
|
+
let frozenart;
|
|
119
|
+
frozenart = this._boFactory.makeWithRawBackendData(selector_article_1.SelectorArticle, articles[0]);
|
|
120
|
+
if (composedArticle) {
|
|
121
|
+
frozenart.compositions = [];
|
|
122
|
+
frozenart.compositions.push(articles);
|
|
123
|
+
}
|
|
124
|
+
return frozenart;
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
return Promise.reject(response);
|
|
128
|
+
}
|
|
137
129
|
}
|
|
138
|
-
getJsonArticleFlatTree(goodId) {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
return Promise.reject(e);
|
|
145
|
-
});
|
|
146
|
-
const result = response.data;
|
|
147
|
-
if (result.validationResult && result.validationResult.success) {
|
|
148
|
-
return result.resultObject;
|
|
149
|
-
}
|
|
150
|
-
else {
|
|
151
|
-
console.error("Error getting article tree");
|
|
152
|
-
return null;
|
|
153
|
-
}
|
|
130
|
+
async getJsonArticleFlatTree(goodId) {
|
|
131
|
+
const params = { goodId: goodId };
|
|
132
|
+
const data = { ...this.createServiceRequestData(), parameterValues: params };
|
|
133
|
+
const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.GetArticleTree, data)
|
|
134
|
+
.catch((e) => {
|
|
135
|
+
return Promise.reject(e);
|
|
154
136
|
});
|
|
137
|
+
const result = response.data;
|
|
138
|
+
if (result.validationResult && result.validationResult.success) {
|
|
139
|
+
return result.resultObject;
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
console.error("Error getting article tree");
|
|
143
|
+
return null;
|
|
144
|
+
}
|
|
155
145
|
}
|
|
156
|
-
getLastFrozenArticle() {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
return Promise.reject(e);
|
|
163
|
-
});
|
|
164
|
-
const result = response.data;
|
|
165
|
-
if (result.validationResult && result.validationResult.success) {
|
|
166
|
-
return result.resultObject;
|
|
167
|
-
}
|
|
168
|
-
else {
|
|
169
|
-
console.error("Error creating article (" + response.message + ")");
|
|
170
|
-
return null;
|
|
171
|
-
}
|
|
146
|
+
async getLastFrozenArticle() {
|
|
147
|
+
const params = { instanceId: this._instanceId };
|
|
148
|
+
const data = { ...this.createServiceRequestData(), parameterValues: params };
|
|
149
|
+
const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.GetLastFrozenArticle, data)
|
|
150
|
+
.catch((e) => {
|
|
151
|
+
return Promise.reject(e);
|
|
172
152
|
});
|
|
153
|
+
const result = response.data;
|
|
154
|
+
if (result.validationResult && result.validationResult.success) {
|
|
155
|
+
return result.resultObject;
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
console.error("Error creating article (" + response.message + ")");
|
|
159
|
+
return null;
|
|
160
|
+
}
|
|
173
161
|
}
|
|
174
|
-
getSkipButtonImageAndText(goodId) {
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
}
|
|
193
|
-
});
|
|
162
|
+
async getSkipButtonImageAndText(goodId) {
|
|
163
|
+
const params = { instanceId: this._instanceId };
|
|
164
|
+
if (goodId) {
|
|
165
|
+
params.goodId = goodId;
|
|
166
|
+
}
|
|
167
|
+
const data = { ...this.createServiceRequestData(), parameterValues: params };
|
|
168
|
+
const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.GetSkipButtonImageAndText, data)
|
|
169
|
+
.catch((e) => {
|
|
170
|
+
return Promise.reject(e);
|
|
171
|
+
});
|
|
172
|
+
const result = response.data;
|
|
173
|
+
if (result.validationResult && result.validationResult.success) {
|
|
174
|
+
return this._boFactory.makeWithRawBackendData(skip_button_info_1.SkipButtonInfo, result.resultObject);
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
console.error("Error retrieving skip button image and text (" + response.message + ")");
|
|
178
|
+
return null;
|
|
179
|
+
}
|
|
194
180
|
}
|
|
195
|
-
getArticleQuickSel(goodId, branch) {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
if (result.
|
|
208
|
-
|
|
209
|
-
console.error("Article not found!");
|
|
210
|
-
return null;
|
|
211
|
-
}
|
|
212
|
-
return new article_1.Article(result.resultObject.oArticle[0]);
|
|
213
|
-
}
|
|
214
|
-
else {
|
|
215
|
-
console.error("Error retrieving article data");
|
|
181
|
+
async getArticleQuickSel(goodId, branch) {
|
|
182
|
+
const params = { goodId: goodId };
|
|
183
|
+
if (branch) {
|
|
184
|
+
params.branchNr = branch;
|
|
185
|
+
}
|
|
186
|
+
const data = { ...this.createServiceRequestData(), parameterValues: params };
|
|
187
|
+
const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.ArticleQuickSel, data)
|
|
188
|
+
.catch((e) => {
|
|
189
|
+
return Promise.reject(e);
|
|
190
|
+
});
|
|
191
|
+
const result = response.data;
|
|
192
|
+
if (result.validationResult && result.validationResult.success) {
|
|
193
|
+
if (!result.resultObject) {
|
|
194
|
+
console.error("Article not found!");
|
|
216
195
|
return null;
|
|
217
196
|
}
|
|
218
|
-
|
|
197
|
+
return new article_1.Article(result.resultObject.oArticle[0]);
|
|
198
|
+
}
|
|
199
|
+
else {
|
|
200
|
+
console.error("Error retrieving article data");
|
|
201
|
+
return null;
|
|
202
|
+
}
|
|
219
203
|
}
|
|
220
|
-
getSuperArticleQuickSel(id, branch) {
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
if (result.
|
|
233
|
-
|
|
234
|
-
console.error("Super article not found!");
|
|
235
|
-
return null;
|
|
236
|
-
}
|
|
237
|
-
return new super_article_1.SuperArticle(result.resultObject.oArticle[0]);
|
|
238
|
-
}
|
|
239
|
-
else {
|
|
240
|
-
console.error("Error retrieving article data");
|
|
204
|
+
async getSuperArticleQuickSel(id, branch) {
|
|
205
|
+
const params = { superArtId: id };
|
|
206
|
+
if (branch) {
|
|
207
|
+
params.branchNr = branch;
|
|
208
|
+
}
|
|
209
|
+
const data = { ...this.createServiceRequestData(), parameterValues: params };
|
|
210
|
+
const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.SuperArticleQuickSel, data)
|
|
211
|
+
.catch((e) => {
|
|
212
|
+
return Promise.reject(e);
|
|
213
|
+
});
|
|
214
|
+
const result = response.data;
|
|
215
|
+
if (result.validationResult && result.validationResult.success) {
|
|
216
|
+
if (!result.resultObject) {
|
|
217
|
+
console.error("Super article not found!");
|
|
241
218
|
return null;
|
|
242
219
|
}
|
|
243
|
-
|
|
220
|
+
return new super_article_1.SuperArticle(result.resultObject.oArticle[0]);
|
|
221
|
+
}
|
|
222
|
+
else {
|
|
223
|
+
console.error("Error retrieving article data");
|
|
224
|
+
return null;
|
|
225
|
+
}
|
|
244
226
|
}
|
|
245
|
-
getGoodIdFromArticleNr(sku) {
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
return Promise.reject(e);
|
|
252
|
-
});
|
|
253
|
-
const result = response.data;
|
|
254
|
-
if (result.validationResult && result.validationResult.success) {
|
|
255
|
-
return result.resultObject;
|
|
256
|
-
}
|
|
257
|
-
else {
|
|
258
|
-
console.error("Error retrieving article (" + response.message + ")");
|
|
259
|
-
return null;
|
|
260
|
-
}
|
|
227
|
+
async getGoodIdFromArticleNr(sku) {
|
|
228
|
+
const params = { artikelnr: sku };
|
|
229
|
+
const data = { ...this.createServiceRequestData(), parameterValues: params };
|
|
230
|
+
const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.GetGoodIdFromArticleNr, data)
|
|
231
|
+
.catch((e) => {
|
|
232
|
+
return Promise.reject(e);
|
|
261
233
|
});
|
|
234
|
+
const result = response.data;
|
|
235
|
+
if (result.validationResult && result.validationResult.success) {
|
|
236
|
+
return result.resultObject;
|
|
237
|
+
}
|
|
238
|
+
else {
|
|
239
|
+
console.error("Error retrieving article (" + response.message + ")");
|
|
240
|
+
return null;
|
|
241
|
+
}
|
|
262
242
|
}
|
|
263
|
-
getDecos() {
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
return Promise.reject(e);
|
|
270
|
-
});
|
|
271
|
-
const result = response.data;
|
|
272
|
-
if (result.validationResult && result.validationResult.success) {
|
|
273
|
-
if (!result.resultObject) {
|
|
274
|
-
return [];
|
|
275
|
-
}
|
|
276
|
-
return result.resultObject["oDeco"];
|
|
277
|
-
}
|
|
278
|
-
else {
|
|
279
|
-
console.error("Error getting decoNodes (" + response.message + ")");
|
|
280
|
-
return null;
|
|
281
|
-
}
|
|
243
|
+
async getDecos() {
|
|
244
|
+
const params = { instanceId: this._instanceId };
|
|
245
|
+
const data = { ...this.createServiceRequestData(), parameterValues: params };
|
|
246
|
+
const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.SelectorDecos, data)
|
|
247
|
+
.catch((e) => {
|
|
248
|
+
return Promise.reject(e);
|
|
282
249
|
});
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
const data = Object.assign(Object.assign({}, this.createServiceRequestData()), { parameterValues: params });
|
|
288
|
-
const response = yield this._sessionService.call(hd_service_method_1.HdServiceMethod.SelectorSelections, data)
|
|
289
|
-
.catch((e) => {
|
|
290
|
-
return Promise.reject(e);
|
|
291
|
-
});
|
|
292
|
-
const result = response.data;
|
|
293
|
-
if (result.validationResult && result.validationResult.success) {
|
|
294
|
-
if (!result.resultObject) {
|
|
295
|
-
return [];
|
|
296
|
-
}
|
|
297
|
-
return result.resultObject["selections"];
|
|
298
|
-
}
|
|
299
|
-
else {
|
|
300
|
-
console.error("Error getting selections (" + response.message + ")");
|
|
301
|
-
return null;
|
|
250
|
+
const result = response.data;
|
|
251
|
+
if (result.validationResult && result.validationResult.success) {
|
|
252
|
+
if (!result.resultObject) {
|
|
253
|
+
return [];
|
|
302
254
|
}
|
|
303
|
-
|
|
255
|
+
return result.resultObject["oDeco"];
|
|
256
|
+
}
|
|
257
|
+
else {
|
|
258
|
+
console.error("Error getting decoNodes (" + response.message + ")");
|
|
259
|
+
return null;
|
|
260
|
+
}
|
|
304
261
|
}
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
return Promise.reject(e);
|
|
312
|
-
});
|
|
313
|
-
const result = response.data;
|
|
314
|
-
if (result.validationResult && result.validationResult.success) {
|
|
315
|
-
const match = result.resultObject["matchTableActive"] === "T";
|
|
316
|
-
const activeNodes = result.resultObject['activeNodes'];
|
|
317
|
-
const question = activeNodes[0];
|
|
318
|
-
const isShowGrouped = question && question.showGrouped === "T";
|
|
319
|
-
if (isShowGrouped && this._useGroups) {
|
|
320
|
-
const data = yield this.getSelectorStructure();
|
|
321
|
-
return { match: match, data: [question, ...data.resultObject.structures] };
|
|
322
|
-
}
|
|
323
|
-
else {
|
|
324
|
-
return { match: match, data: activeNodes };
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
else {
|
|
328
|
-
return null;
|
|
329
|
-
}
|
|
262
|
+
async getSelections() {
|
|
263
|
+
const params = { instanceId: this._instanceId };
|
|
264
|
+
const data = { ...this.createServiceRequestData(), parameterValues: params };
|
|
265
|
+
const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.SelectorSelections, data)
|
|
266
|
+
.catch((e) => {
|
|
267
|
+
return Promise.reject(e);
|
|
330
268
|
});
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
const data = Object.assign(Object.assign({}, this.createServiceRequestData()), { parameterValues: params });
|
|
336
|
-
const response = yield this._sessionService.call(hd_service_method_1.HdServiceMethod.SelectorActiveNodesPr, data)
|
|
337
|
-
.catch((e) => {
|
|
338
|
-
return Promise.reject(e);
|
|
339
|
-
});
|
|
340
|
-
const result = response.data;
|
|
341
|
-
if (result.validationResult && result.validationResult.success) {
|
|
342
|
-
return result;
|
|
343
|
-
}
|
|
344
|
-
else {
|
|
345
|
-
console.error("Error getting selector action prices (" + response.message + ")");
|
|
346
|
-
return null;
|
|
269
|
+
const result = response.data;
|
|
270
|
+
if (result.validationResult && result.validationResult.success) {
|
|
271
|
+
if (!result.resultObject) {
|
|
272
|
+
return [];
|
|
347
273
|
}
|
|
348
|
-
|
|
274
|
+
return result.resultObject["selections"];
|
|
275
|
+
}
|
|
276
|
+
else {
|
|
277
|
+
console.error("Error getting selections (" + response.message + ")");
|
|
278
|
+
return null;
|
|
279
|
+
}
|
|
349
280
|
}
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
return Promise.reject(e);
|
|
357
|
-
});
|
|
358
|
-
const result = response.data;
|
|
359
|
-
if (result.validationResult && result.validationResult.success) {
|
|
360
|
-
return result;
|
|
361
|
-
}
|
|
362
|
-
else {
|
|
363
|
-
console.error("Error getting selector structure (" + response.message + ")");
|
|
364
|
-
return null;
|
|
365
|
-
}
|
|
281
|
+
async getSelectorActiveOptionValues() {
|
|
282
|
+
const params = { instanceId: this._instanceId };
|
|
283
|
+
const data = { ...this.createServiceRequestData(), parameterValues: params };
|
|
284
|
+
const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.SelectorActiveNodes, data)
|
|
285
|
+
.catch((e) => {
|
|
286
|
+
return Promise.reject(e);
|
|
366
287
|
});
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
const
|
|
371
|
-
const
|
|
372
|
-
const
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
const result = response.data;
|
|
377
|
-
if (result.validationResult && result.validationResult.success) {
|
|
378
|
-
return result.resultObject;
|
|
288
|
+
const result = response.data;
|
|
289
|
+
if (result.validationResult && result.validationResult.success) {
|
|
290
|
+
const match = result.resultObject["matchTableActive"] === "T";
|
|
291
|
+
const activeNodes = result.resultObject['activeNodes'];
|
|
292
|
+
const question = activeNodes[0];
|
|
293
|
+
const isShowGrouped = question && question.showGrouped === "T";
|
|
294
|
+
if (isShowGrouped && this._useGroups) {
|
|
295
|
+
const data = await this.getSelectorStructure();
|
|
296
|
+
return { match: match, data: [question, ...data.resultObject.structures] };
|
|
379
297
|
}
|
|
380
298
|
else {
|
|
381
|
-
|
|
382
|
-
return this.getDeliveryDate2(params, branchNr);
|
|
299
|
+
return { match: match, data: activeNodes };
|
|
383
300
|
}
|
|
384
|
-
}
|
|
301
|
+
}
|
|
302
|
+
else {
|
|
303
|
+
return null;
|
|
304
|
+
}
|
|
385
305
|
}
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
params.lineNr = null;
|
|
393
|
-
params.commCode = "1";
|
|
394
|
-
params.amount = 1;
|
|
395
|
-
params.transactionKind = "V";
|
|
396
|
-
params.purchasePlanDays = "T";
|
|
397
|
-
const data = Object.assign(Object.assign({}, this.createServiceRequestData()), { parameterValues: params });
|
|
398
|
-
const response = yield this._sessionService.call(hd_service_method_1.HdServiceMethod.GetDeliveryDate2, data)
|
|
399
|
-
.catch((e) => {
|
|
400
|
-
return Promise.reject(e);
|
|
401
|
-
});
|
|
402
|
-
const result = response.data;
|
|
403
|
-
if (result.validationResult && result.validationResult.success) {
|
|
404
|
-
return result.resultObject;
|
|
405
|
-
}
|
|
406
|
-
else {
|
|
407
|
-
console.error("Error getting delivery prognosis (" + response.message + ")");
|
|
408
|
-
return null;
|
|
409
|
-
}
|
|
306
|
+
async getSelectorActiveOptionValuesPrices() {
|
|
307
|
+
const params = { instanceId: this._instanceId };
|
|
308
|
+
const data = { ...this.createServiceRequestData(), parameterValues: params };
|
|
309
|
+
const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.SelectorActiveNodesPr, data)
|
|
310
|
+
.catch((e) => {
|
|
311
|
+
return Promise.reject(e);
|
|
410
312
|
});
|
|
313
|
+
const result = response.data;
|
|
314
|
+
if (result.validationResult && result.validationResult.success) {
|
|
315
|
+
return result;
|
|
316
|
+
}
|
|
317
|
+
else {
|
|
318
|
+
console.error("Error getting selector action prices (" + response.message + ")");
|
|
319
|
+
return null;
|
|
320
|
+
}
|
|
411
321
|
}
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
const data = Object.assign(Object.assign({}, this.createServiceRequestData()), { parameterValues: params });
|
|
419
|
-
const response = yield this._sessionService.call(hd_service_method_1.HdServiceMethod.GetStockForArtNode, data)
|
|
420
|
-
.catch((e) => {
|
|
421
|
-
return Promise.reject(e);
|
|
422
|
-
});
|
|
423
|
-
const result = response.data;
|
|
424
|
-
if (result.validationResult && result.validationResult.success) {
|
|
425
|
-
return result.resultObject;
|
|
426
|
-
}
|
|
427
|
-
else {
|
|
428
|
-
console.error("Error getting StockForArtNode (" + response.message + ")");
|
|
429
|
-
return null;
|
|
430
|
-
}
|
|
322
|
+
async getSelectorStructure() {
|
|
323
|
+
const params = { instanceId: this._instanceId };
|
|
324
|
+
const data = { ...this.createServiceRequestData(), parameterValues: params };
|
|
325
|
+
const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.SelectorStructure, data)
|
|
326
|
+
.catch((e) => {
|
|
327
|
+
return Promise.reject(e);
|
|
431
328
|
});
|
|
329
|
+
const result = response.data;
|
|
330
|
+
if (result.validationResult && result.validationResult.success) {
|
|
331
|
+
return result;
|
|
332
|
+
}
|
|
333
|
+
else {
|
|
334
|
+
console.error("Error getting selector structure (" + response.message + ")");
|
|
335
|
+
return null;
|
|
336
|
+
}
|
|
432
337
|
}
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
});
|
|
440
|
-
const result = response.data;
|
|
441
|
-
if (result.validationResult && result.validationResult.success) {
|
|
442
|
-
return this._boFactory.makeWithRawBackendData(article_full_object_1.ArticleFullObject, result.resultObject);
|
|
443
|
-
}
|
|
444
|
-
else {
|
|
445
|
-
console.error("Error retrieving article data (" + response.message + ")");
|
|
446
|
-
return null;
|
|
447
|
-
}
|
|
338
|
+
async getDeliveryPrognosis(goodId, branchNr) {
|
|
339
|
+
const params = { instanceId: this._instanceId };
|
|
340
|
+
const data = { ...this.createServiceRequestData(), parameterValues: params };
|
|
341
|
+
const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.GetSelectorDeliveryDate, data)
|
|
342
|
+
.catch((e) => {
|
|
343
|
+
return Promise.reject(e);
|
|
448
344
|
});
|
|
345
|
+
const result = response.data;
|
|
346
|
+
if (result.validationResult && result.validationResult.success) {
|
|
347
|
+
return result.resultObject;
|
|
348
|
+
}
|
|
349
|
+
else {
|
|
350
|
+
const params = { goodId: goodId };
|
|
351
|
+
return this.getDeliveryDate2(params, branchNr);
|
|
352
|
+
}
|
|
449
353
|
}
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
354
|
+
async getDeliveryDate2(params, branchNr) {
|
|
355
|
+
if (branchNr) {
|
|
356
|
+
params.branchNo = branchNr;
|
|
357
|
+
}
|
|
358
|
+
params.transId = null;
|
|
359
|
+
params.lineNr = null;
|
|
360
|
+
params.commCode = "1";
|
|
361
|
+
params.amount = 1;
|
|
362
|
+
params.transactionKind = "V";
|
|
363
|
+
params.purchasePlanDays = "T";
|
|
364
|
+
const data = { ...this.createServiceRequestData(), parameterValues: params };
|
|
365
|
+
const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.GetDeliveryDate2, data)
|
|
366
|
+
.catch((e) => {
|
|
367
|
+
return Promise.reject(e);
|
|
368
|
+
});
|
|
369
|
+
const result = response.data;
|
|
370
|
+
if (result.validationResult && result.validationResult.success) {
|
|
371
|
+
return result.resultObject;
|
|
372
|
+
}
|
|
373
|
+
else {
|
|
374
|
+
console.error("Error getting delivery prognosis (" + response.message + ")");
|
|
375
|
+
return null;
|
|
376
|
+
}
|
|
471
377
|
}
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
if (result.validationResult && result.validationResult.success) {
|
|
491
|
-
return this._boFactory.makeWithRawBackendData(article_price_1.ArticlePrice, result.resultObject);
|
|
492
|
-
}
|
|
493
|
-
else {
|
|
494
|
-
console.error("Error getting article price (" + response.message + ")");
|
|
495
|
-
return null;
|
|
496
|
-
}
|
|
497
|
-
});
|
|
378
|
+
async getStockForArtNode(branchNo, selNodeId) {
|
|
379
|
+
const params = {
|
|
380
|
+
instanceId: this._instanceId,
|
|
381
|
+
selectionId: selNodeId
|
|
382
|
+
};
|
|
383
|
+
const data = { ...this.createServiceRequestData(), parameterValues: params };
|
|
384
|
+
const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.GetStockForArtNode, data)
|
|
385
|
+
.catch((e) => {
|
|
386
|
+
return Promise.reject(e);
|
|
387
|
+
});
|
|
388
|
+
const result = response.data;
|
|
389
|
+
if (result.validationResult && result.validationResult.success) {
|
|
390
|
+
return result.resultObject;
|
|
391
|
+
}
|
|
392
|
+
else {
|
|
393
|
+
console.error("Error getting StockForArtNode (" + response.message + ")");
|
|
394
|
+
return null;
|
|
395
|
+
}
|
|
498
396
|
}
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
.catch((e) => {
|
|
505
|
-
return Promise.reject(e);
|
|
506
|
-
});
|
|
507
|
-
const result = response.data;
|
|
508
|
-
if (result.validationResult && result.validationResult.success) {
|
|
509
|
-
return this._boFactory.makeBOArrayFromRawBackendDataArray(article_category_1.ArticleCategory, result.resultObjects);
|
|
510
|
-
}
|
|
511
|
-
else {
|
|
512
|
-
console.error("Error getting article categories (" + response.message + ")");
|
|
513
|
-
return null;
|
|
514
|
-
}
|
|
397
|
+
async getArticleFullObject(goodId) {
|
|
398
|
+
const data = { ...this.createServiceRequestData(), objectId: goodId };
|
|
399
|
+
const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.GetArticleFullObject, data)
|
|
400
|
+
.catch((e) => {
|
|
401
|
+
return Promise.reject(e);
|
|
515
402
|
});
|
|
403
|
+
const result = response.data;
|
|
404
|
+
if (result.validationResult && result.validationResult.success) {
|
|
405
|
+
return this._boFactory.makeWithRawBackendData(article_full_object_1.ArticleFullObject, result.resultObject);
|
|
406
|
+
}
|
|
407
|
+
else {
|
|
408
|
+
console.error("Error retrieving article data (" + response.message + ")");
|
|
409
|
+
return null;
|
|
410
|
+
}
|
|
516
411
|
}
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
return
|
|
527
|
-
});
|
|
528
|
-
const result = response.data;
|
|
529
|
-
if (result.validationResult && result.validationResult.success) {
|
|
530
|
-
return this._boFactory.makeBOArrayFromRawBackendDataArray(turnover_group_image_1.TurnoverGroupImage, result.resultObjects);
|
|
412
|
+
async getArticlesForCatalog(params, paging) {
|
|
413
|
+
const data = { ...this.createServiceRequestData(), parameterValues: params, pagingParameters: paging };
|
|
414
|
+
const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.SearchArticles, data)
|
|
415
|
+
.catch((e) => {
|
|
416
|
+
return Promise.reject(e);
|
|
417
|
+
});
|
|
418
|
+
const result = response.data;
|
|
419
|
+
if (result.validationResult && result.validationResult.success) {
|
|
420
|
+
if (this._versionHigherThan249) {
|
|
421
|
+
return this._boFactory.makeBOArrayFromRawBackendDataArray(article_extended_dto_1.ArticleExtendedDto, result.resultObjects);
|
|
531
422
|
}
|
|
532
423
|
else {
|
|
533
|
-
|
|
534
|
-
return null;
|
|
424
|
+
return this._boFactory.makeBOArrayFromRawBackendDataArray(article_list_object_extended_1.ArticleListObjectExtended, result.resultObjects);
|
|
535
425
|
}
|
|
426
|
+
}
|
|
427
|
+
else {
|
|
428
|
+
console.error("Error getting articles (" + response.message + ")");
|
|
429
|
+
return null;
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
async getArticlePrice(goodId, branchNr, currencyId) {
|
|
433
|
+
const request = new get_article_price_request_1.GetArticlePriceRequest();
|
|
434
|
+
request.goodId = goodId;
|
|
435
|
+
if (branchNr) {
|
|
436
|
+
request.branch = branchNr;
|
|
437
|
+
}
|
|
438
|
+
if (currencyId) {
|
|
439
|
+
request.currency = currencyId;
|
|
440
|
+
}
|
|
441
|
+
request.number = 1;
|
|
442
|
+
request.type = transaction_kind_1.TransactionKind.SalesOrder;
|
|
443
|
+
const data = { ...this.createServiceRequestData(), parameterValues: request };
|
|
444
|
+
const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.GetArticlePrice, data)
|
|
445
|
+
.catch((e) => {
|
|
446
|
+
return Promise.reject(e);
|
|
447
|
+
});
|
|
448
|
+
const result = response.data;
|
|
449
|
+
if (result.validationResult && result.validationResult.success) {
|
|
450
|
+
return this._boFactory.makeWithRawBackendData(article_price_1.ArticlePrice, result.resultObject);
|
|
451
|
+
}
|
|
452
|
+
else {
|
|
453
|
+
console.error("Error getting article price (" + response.message + ")");
|
|
454
|
+
return null;
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
async getArticleCategories(publicationCode) {
|
|
458
|
+
const params = { publicationCode: publicationCode };
|
|
459
|
+
const data = { ...this.createServiceRequestData(), parameterValues: params };
|
|
460
|
+
const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.GetArticleCategories, data)
|
|
461
|
+
.catch((e) => {
|
|
462
|
+
return Promise.reject(e);
|
|
536
463
|
});
|
|
464
|
+
const result = response.data;
|
|
465
|
+
if (result.validationResult && result.validationResult.success) {
|
|
466
|
+
return this._boFactory.makeBOArrayFromRawBackendDataArray(article_category_1.ArticleCategory, result.resultObjects);
|
|
467
|
+
}
|
|
468
|
+
else {
|
|
469
|
+
console.error("Error getting article categories (" + response.message + ")");
|
|
470
|
+
return null;
|
|
471
|
+
}
|
|
537
472
|
}
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
473
|
+
async getTurnoverGroupImages(category) {
|
|
474
|
+
const params = {};
|
|
475
|
+
if (category) {
|
|
476
|
+
params.category = category;
|
|
477
|
+
}
|
|
478
|
+
const data = { ...this.createServiceRequestData(), parameterValues: params };
|
|
479
|
+
const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.GetTurnoverGroupImages, data)
|
|
480
|
+
.catch((e) => {
|
|
481
|
+
return Promise.reject(e);
|
|
482
|
+
});
|
|
483
|
+
const result = response.data;
|
|
484
|
+
if (result.validationResult && result.validationResult.success) {
|
|
485
|
+
return this._boFactory.makeBOArrayFromRawBackendDataArray(turnover_group_image_1.TurnoverGroupImage, result.resultObjects);
|
|
486
|
+
}
|
|
487
|
+
else {
|
|
488
|
+
console.error("Error getting turnover group images (" + response.message + ")");
|
|
489
|
+
return null;
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
async getAnswerTexts(params) {
|
|
493
|
+
const data = { ...this.createServiceRequestData(), parameterValues: params };
|
|
494
|
+
const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.GetAnswerTexts, data)
|
|
495
|
+
.catch((e) => {
|
|
496
|
+
return Promise.reject(e);
|
|
553
497
|
});
|
|
498
|
+
const result = response.data;
|
|
499
|
+
if (result.validationResult && result.validationResult.success) {
|
|
500
|
+
return result.resultObject;
|
|
501
|
+
}
|
|
502
|
+
else {
|
|
503
|
+
console.error("Error getting answer info (" + response.message + ")");
|
|
504
|
+
return null;
|
|
505
|
+
}
|
|
554
506
|
}
|
|
555
|
-
getDocumentContent(id, thumbnail = true) {
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
507
|
+
async getDocumentContent(id, thumbnail = true) {
|
|
508
|
+
const params = {
|
|
509
|
+
documentId: id,
|
|
510
|
+
thumbnail: thumbnail
|
|
511
|
+
};
|
|
512
|
+
const data = { ...this.createServiceRequestData(), parameterValues: params };
|
|
513
|
+
const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.GetDocumentContent, data)
|
|
514
|
+
.catch((e) => {
|
|
515
|
+
return Promise.reject(e);
|
|
516
|
+
});
|
|
517
|
+
const result = response.data;
|
|
518
|
+
if (result.validationResult && result.validationResult.success) {
|
|
519
|
+
return result.resultObject.documentContent;
|
|
520
|
+
}
|
|
521
|
+
else {
|
|
522
|
+
console.error("Error retrieving article data (" + response.message + ")");
|
|
523
|
+
return null;
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
async getCatalogDefinitions(showLoader = true) {
|
|
527
|
+
const data = { ...this.createServiceRequestData(), parameterValues: {} };
|
|
528
|
+
const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.GetDocumentContent, data, showLoader)
|
|
529
|
+
.catch((e) => {
|
|
530
|
+
return Promise.reject(e);
|
|
574
531
|
});
|
|
532
|
+
const result = response.data;
|
|
533
|
+
if (result.validationResult && result.validationResult.success) {
|
|
534
|
+
return result.resultObject;
|
|
535
|
+
}
|
|
536
|
+
else {
|
|
537
|
+
console.error("Error retrieving catalog definitions (" + response.message + ")");
|
|
538
|
+
return null;
|
|
539
|
+
}
|
|
575
540
|
}
|
|
576
|
-
getSingleImage(nodeId, publication = 4, includeMimetype = false, thumb = true, showLoader = true) {
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
if (result.
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
541
|
+
async getSingleImage(nodeId, publication = 4, includeMimetype = false, thumb = true, showLoader = true) {
|
|
542
|
+
if (!nodeId) {
|
|
543
|
+
return;
|
|
544
|
+
}
|
|
545
|
+
const params = {
|
|
546
|
+
table: "GOEDEREN",
|
|
547
|
+
key: nodeId.toString(),
|
|
548
|
+
includeBody: thumb === undefined || thumb === false,
|
|
549
|
+
includeThumbnail: thumb === true,
|
|
550
|
+
publication: publication
|
|
551
|
+
};
|
|
552
|
+
const data = { ...this.createServiceRequestData(), parameterValues: params };
|
|
553
|
+
const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.GetSingleImage, data, showLoader)
|
|
554
|
+
.catch((e) => {
|
|
555
|
+
return Promise.reject(e);
|
|
556
|
+
});
|
|
557
|
+
const result = response.data;
|
|
558
|
+
if (result.validationResult && result.validationResult.success) {
|
|
559
|
+
if (!result.resultObject) {
|
|
560
|
+
return "";
|
|
561
|
+
}
|
|
562
|
+
const image = result.resultObject;
|
|
563
|
+
if (image.filePath) {
|
|
564
|
+
return image_utils_1.ImageUtils.getFixedImageFilepathUrl(image.filePath);
|
|
565
|
+
}
|
|
566
|
+
else {
|
|
567
|
+
const documentBody = thumb ? image.thumbnailBody : image.documentBody;
|
|
568
|
+
if (includeMimetype) {
|
|
569
|
+
return image_utils_1.ImageUtils.getDocBodyWithMimeTypeDefinition(image.fileName, documentBody);
|
|
601
570
|
}
|
|
602
571
|
else {
|
|
603
|
-
|
|
604
|
-
if (includeMimetype) {
|
|
605
|
-
return image_utils_1.ImageUtils.getDocBodyWithMimeTypeDefinition(image.fileName, documentBody);
|
|
606
|
-
}
|
|
607
|
-
else {
|
|
608
|
-
return documentBody;
|
|
609
|
-
}
|
|
572
|
+
return documentBody;
|
|
610
573
|
}
|
|
611
574
|
}
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
}
|
|
575
|
+
}
|
|
576
|
+
else {
|
|
577
|
+
console.error("Error getting single image (" + response.message + ")");
|
|
578
|
+
return null;
|
|
579
|
+
}
|
|
617
580
|
}
|
|
618
|
-
getColors() {
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
return Promise.reject(e);
|
|
624
|
-
});
|
|
625
|
-
const result = response.data;
|
|
626
|
-
if (result.validationResult && result.validationResult.success) {
|
|
627
|
-
return this._boFactory.makeBOArrayFromRawBackendDataArray(color_1.Color, result.resultObjects);
|
|
628
|
-
}
|
|
629
|
-
else {
|
|
630
|
-
console.error("Error getting colors (" + response.message + ")");
|
|
631
|
-
return null;
|
|
632
|
-
}
|
|
581
|
+
async getColors() {
|
|
582
|
+
const data = { ...this.createServiceRequestData() };
|
|
583
|
+
const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.GetColors, data)
|
|
584
|
+
.catch((e) => {
|
|
585
|
+
return Promise.reject(e);
|
|
633
586
|
});
|
|
587
|
+
const result = response.data;
|
|
588
|
+
if (result.validationResult && result.validationResult.success) {
|
|
589
|
+
return this._boFactory.makeBOArrayFromRawBackendDataArray(color_1.Color, result.resultObjects);
|
|
590
|
+
}
|
|
591
|
+
else {
|
|
592
|
+
console.error("Error getting colors (" + response.message + ")");
|
|
593
|
+
return null;
|
|
594
|
+
}
|
|
634
595
|
}
|
|
635
|
-
getBrands() {
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
return Promise.reject(e);
|
|
641
|
-
});
|
|
642
|
-
const result = response.data;
|
|
643
|
-
if (result.validationResult && result.validationResult.success) {
|
|
644
|
-
return this._boFactory.makeBOArrayFromRawBackendDataArray(brand_1.Brand, result.resultObjects);
|
|
645
|
-
}
|
|
646
|
-
else {
|
|
647
|
-
console.error("Error getting brands (" + response.message + ")");
|
|
648
|
-
return null;
|
|
649
|
-
}
|
|
596
|
+
async getBrands() {
|
|
597
|
+
const data = { ...this.createServiceRequestData() };
|
|
598
|
+
const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.GetBrands, data)
|
|
599
|
+
.catch((e) => {
|
|
600
|
+
return Promise.reject(e);
|
|
650
601
|
});
|
|
602
|
+
const result = response.data;
|
|
603
|
+
if (result.validationResult && result.validationResult.success) {
|
|
604
|
+
return this._boFactory.makeBOArrayFromRawBackendDataArray(brand_1.Brand, result.resultObjects);
|
|
605
|
+
}
|
|
606
|
+
else {
|
|
607
|
+
console.error("Error getting brands (" + response.message + ")");
|
|
608
|
+
return null;
|
|
609
|
+
}
|
|
651
610
|
}
|
|
652
|
-
getDesigns() {
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
return Promise.reject(e);
|
|
658
|
-
});
|
|
659
|
-
const result = response.data;
|
|
660
|
-
if (result.validationResult && result.validationResult.success) {
|
|
661
|
-
return this._boFactory.makeBOArrayFromRawBackendDataArray(design_1.Design, result.resultObjects);
|
|
662
|
-
}
|
|
663
|
-
else {
|
|
664
|
-
console.error("Error getting designs (" + response.message + ")");
|
|
665
|
-
return null;
|
|
666
|
-
}
|
|
611
|
+
async getDesigns() {
|
|
612
|
+
const data = { ...this.createServiceRequestData() };
|
|
613
|
+
const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.GetDesigns, data)
|
|
614
|
+
.catch((e) => {
|
|
615
|
+
return Promise.reject(e);
|
|
667
616
|
});
|
|
617
|
+
const result = response.data;
|
|
618
|
+
if (result.validationResult && result.validationResult.success) {
|
|
619
|
+
return this._boFactory.makeBOArrayFromRawBackendDataArray(design_1.Design, result.resultObjects);
|
|
620
|
+
}
|
|
621
|
+
else {
|
|
622
|
+
console.error("Error getting designs (" + response.message + ")");
|
|
623
|
+
return null;
|
|
624
|
+
}
|
|
668
625
|
}
|
|
669
|
-
getConcepts() {
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
return Promise.reject(e);
|
|
675
|
-
});
|
|
676
|
-
const result = response.data;
|
|
677
|
-
if (result.validationResult && result.validationResult.success) {
|
|
678
|
-
return this._boFactory.makeBOArrayFromRawBackendDataArray(concept_1.Concept, result.resultObjects);
|
|
679
|
-
}
|
|
680
|
-
else {
|
|
681
|
-
console.error("Error getting concepts (" + response.message + ")");
|
|
682
|
-
return null;
|
|
683
|
-
}
|
|
626
|
+
async getConcepts() {
|
|
627
|
+
const data = { ...this.createServiceRequestData() };
|
|
628
|
+
const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.GetConcepts, data)
|
|
629
|
+
.catch((e) => {
|
|
630
|
+
return Promise.reject(e);
|
|
684
631
|
});
|
|
632
|
+
const result = response.data;
|
|
633
|
+
if (result.validationResult && result.validationResult.success) {
|
|
634
|
+
return this._boFactory.makeBOArrayFromRawBackendDataArray(concept_1.Concept, result.resultObjects);
|
|
635
|
+
}
|
|
636
|
+
else {
|
|
637
|
+
console.error("Error getting concepts (" + response.message + ")");
|
|
638
|
+
return null;
|
|
639
|
+
}
|
|
685
640
|
}
|
|
686
|
-
getMaterials() {
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
return Promise.reject(e);
|
|
692
|
-
});
|
|
693
|
-
const result = response.data;
|
|
694
|
-
if (result.validationResult && result.validationResult.success) {
|
|
695
|
-
return this._boFactory.makeBOArrayFromRawBackendDataArray(material_1.Material, result.resultObjects);
|
|
696
|
-
}
|
|
697
|
-
else {
|
|
698
|
-
console.error("Error getting materials (" + response.message + ")");
|
|
699
|
-
return null;
|
|
700
|
-
}
|
|
641
|
+
async getMaterials() {
|
|
642
|
+
const data = { ...this.createServiceRequestData() };
|
|
643
|
+
const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.GetMaterials, data)
|
|
644
|
+
.catch((e) => {
|
|
645
|
+
return Promise.reject(e);
|
|
701
646
|
});
|
|
647
|
+
const result = response.data;
|
|
648
|
+
if (result.validationResult && result.validationResult.success) {
|
|
649
|
+
return this._boFactory.makeBOArrayFromRawBackendDataArray(material_1.Material, result.resultObjects);
|
|
650
|
+
}
|
|
651
|
+
else {
|
|
652
|
+
console.error("Error getting materials (" + response.message + ")");
|
|
653
|
+
return null;
|
|
654
|
+
}
|
|
702
655
|
}
|
|
703
|
-
getAtmospheres() {
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
return Promise.reject(e);
|
|
709
|
-
});
|
|
710
|
-
const result = response.data;
|
|
711
|
-
if (result.validationResult && result.validationResult.success) {
|
|
712
|
-
return this._boFactory.makeBOArrayFromRawBackendDataArray(atmosphere_1.Atmosphere, result.resultObjects);
|
|
713
|
-
}
|
|
714
|
-
else {
|
|
715
|
-
console.error("Error getting atmospheres (" + response.message + ")");
|
|
716
|
-
return null;
|
|
717
|
-
}
|
|
656
|
+
async getAtmospheres() {
|
|
657
|
+
const data = { ...this.createServiceRequestData() };
|
|
658
|
+
const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.GetAtmospheres, data)
|
|
659
|
+
.catch((e) => {
|
|
660
|
+
return Promise.reject(e);
|
|
718
661
|
});
|
|
662
|
+
const result = response.data;
|
|
663
|
+
if (result.validationResult && result.validationResult.success) {
|
|
664
|
+
return this._boFactory.makeBOArrayFromRawBackendDataArray(atmosphere_1.Atmosphere, result.resultObjects);
|
|
665
|
+
}
|
|
666
|
+
else {
|
|
667
|
+
console.error("Error getting atmospheres (" + response.message + ")");
|
|
668
|
+
return null;
|
|
669
|
+
}
|
|
719
670
|
}
|
|
720
|
-
getArticleGroups() {
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
return Promise.reject(e);
|
|
726
|
-
});
|
|
727
|
-
const result = response.data;
|
|
728
|
-
if (result.validationResult && result.validationResult.success) {
|
|
729
|
-
return this._boFactory.makeBOArrayFromRawBackendDataArray(article_group_1.ArticleGroup, result.resultObjects);
|
|
730
|
-
}
|
|
731
|
-
else {
|
|
732
|
-
console.error("Error getting article groups (" + response.message + ")");
|
|
733
|
-
return null;
|
|
734
|
-
}
|
|
671
|
+
async getArticleGroups() {
|
|
672
|
+
const data = { ...this.createServiceRequestData() };
|
|
673
|
+
const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.GetArticleGroups, data)
|
|
674
|
+
.catch((e) => {
|
|
675
|
+
return Promise.reject(e);
|
|
735
676
|
});
|
|
677
|
+
const result = response.data;
|
|
678
|
+
if (result.validationResult && result.validationResult.success) {
|
|
679
|
+
return this._boFactory.makeBOArrayFromRawBackendDataArray(article_group_1.ArticleGroup, result.resultObjects);
|
|
680
|
+
}
|
|
681
|
+
else {
|
|
682
|
+
console.error("Error getting article groups (" + response.message + ")");
|
|
683
|
+
return null;
|
|
684
|
+
}
|
|
736
685
|
}
|
|
737
|
-
getInternalParameter(parameter) {
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
}
|
|
755
|
-
});
|
|
686
|
+
async getInternalParameter(parameter) {
|
|
687
|
+
const data = { ...this.createServiceRequestData() };
|
|
688
|
+
const params = {
|
|
689
|
+
parameter: parameter
|
|
690
|
+
};
|
|
691
|
+
data.parameterValues = params;
|
|
692
|
+
const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.GetPublicParamValue, data)
|
|
693
|
+
.catch((e) => {
|
|
694
|
+
return Promise.reject(e);
|
|
695
|
+
});
|
|
696
|
+
const result = response.data;
|
|
697
|
+
if (result.validationResult && result.validationResult.success) {
|
|
698
|
+
return result.resultObject;
|
|
699
|
+
}
|
|
700
|
+
else {
|
|
701
|
+
return null;
|
|
702
|
+
}
|
|
756
703
|
}
|
|
757
704
|
closeSession() {
|
|
758
705
|
return this._sessionService.closePublicSession();
|