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