@colijnit/articleapi 256.1.1 → 256.1.2
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/articles.d.ts +6 -6
- package/build/articles.js +24 -7
- package/package.json +1 -1
package/build/articles.d.ts
CHANGED
|
@@ -16,12 +16,12 @@ import { GetArticlePriceRequest } from './model/get-article-price-request';
|
|
|
16
16
|
import { DataServiceResponseData } from '@colijnit/ioneconnector/build/model/data-service-response-data';
|
|
17
17
|
import { PagingParameters } from '@colijnit/ioneconnector/build/model/paging-parameters';
|
|
18
18
|
import { PrintPriceStickersRequest } from './model/print-price-stickers-request';
|
|
19
|
-
import { ExternalCatalogStartupInfoRequest } from
|
|
20
|
-
import { ArticleFlatTreeDTO } from
|
|
21
|
-
import { LoginResponse } from
|
|
22
|
-
import { ArticleStockSearchRequest } from
|
|
23
|
-
import { ArticleStockComparisonSearchRequest } from
|
|
24
|
-
import { ArticleStockTransferSearchRequest } from
|
|
19
|
+
import { ExternalCatalogStartupInfoRequest } from './model/external-catalog-startup-info-request';
|
|
20
|
+
import { ArticleFlatTreeDTO } from './model/article-flat-tree.bo';
|
|
21
|
+
import { LoginResponse } from '@colijnit/ioneconnector/build/model/login-response';
|
|
22
|
+
import { ArticleStockSearchRequest } from './model/article-stock-search-request';
|
|
23
|
+
import { ArticleStockComparisonSearchRequest } from './model/article-stock-comparison-search-request';
|
|
24
|
+
import { ArticleStockTransferSearchRequest } from './model/article-stock-transfer-search-request';
|
|
25
25
|
export declare class Articles {
|
|
26
26
|
readonly showLoader: Subject<boolean>;
|
|
27
27
|
readonly connectionAborted: Subject<void>;
|
package/build/articles.js
CHANGED
|
@@ -13,7 +13,7 @@ import { ArticlesPublic } from './articles-public';
|
|
|
13
13
|
import { Connector } from '@colijnit/ioneconnector/build/connector';
|
|
14
14
|
import { SelectorArticle } from './model/selector-article';
|
|
15
15
|
import { BusinessObjectFactory } from '@colijnit/ioneconnector/build/service/business-object-factory';
|
|
16
|
-
import { ArticleFlatTreeDTO } from
|
|
16
|
+
import { ArticleFlatTreeDTO } from './model/article-flat-tree.bo';
|
|
17
17
|
export class Articles {
|
|
18
18
|
constructor(options) {
|
|
19
19
|
this.showLoader = new Subject();
|
|
@@ -264,22 +264,31 @@ export class Articles {
|
|
|
264
264
|
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
|
265
265
|
const returnObject = { goodId: goodId, baseGoodId: goodId, selectorData: {}, quantity: quantity, articleTree: {} };
|
|
266
266
|
if (goodType === 'B') {
|
|
267
|
-
const frozenArt = yield this._getFrozenArticle(instanceId, configuratorStatistics, showLoader)
|
|
267
|
+
const frozenArt = yield this._getFrozenArticle(instanceId, configuratorStatistics, showLoader)
|
|
268
|
+
.catch((e) => {
|
|
269
|
+
return reject(e);
|
|
270
|
+
});
|
|
268
271
|
if (!frozenArt) {
|
|
269
|
-
reject(
|
|
272
|
+
reject('');
|
|
270
273
|
}
|
|
271
274
|
returnObject.goodId = (frozenArt.hasOwnProperty('compositionGoodId') &&
|
|
272
275
|
frozenArt['compositionGoodId'] !== undefined &&
|
|
273
276
|
frozenArt['compositionGoodId'] !== null) ? frozenArt['compositionGoodId'] : frozenArt.goodId;
|
|
274
277
|
returnObject.selectorData = frozenArt;
|
|
275
278
|
if (externalSource) {
|
|
276
|
-
returnObject.articleTree = yield this._getArticleFlatTree(returnObject.goodId, showLoader)
|
|
279
|
+
returnObject.articleTree = yield this._getArticleFlatTree(returnObject.goodId, showLoader)
|
|
280
|
+
.catch((e) => {
|
|
281
|
+
return reject(e);
|
|
282
|
+
});
|
|
277
283
|
}
|
|
278
284
|
}
|
|
279
285
|
else {
|
|
280
286
|
returnObject.goodId = goodId;
|
|
281
287
|
if (externalSource) {
|
|
282
|
-
returnObject.articleTree = yield this._getArticleFlatTree(returnObject.goodId, showLoader)
|
|
288
|
+
returnObject.articleTree = yield this._getArticleFlatTree(returnObject.goodId, showLoader)
|
|
289
|
+
.catch((e) => {
|
|
290
|
+
return reject(e);
|
|
291
|
+
});
|
|
283
292
|
}
|
|
284
293
|
}
|
|
285
294
|
resolve(JSON.stringify(returnObject));
|
|
@@ -305,8 +314,11 @@ export class Articles {
|
|
|
305
314
|
}
|
|
306
315
|
return frozenart;
|
|
307
316
|
}
|
|
317
|
+
else if (frozenArticleResponse) {
|
|
318
|
+
return Promise.reject(frozenArticleResponse.validationResult.messages);
|
|
319
|
+
}
|
|
308
320
|
else {
|
|
309
|
-
return null;
|
|
321
|
+
return Promise.reject(null);
|
|
310
322
|
}
|
|
311
323
|
});
|
|
312
324
|
}
|
|
@@ -318,7 +330,12 @@ export class Articles {
|
|
|
318
330
|
return this.boFactory.makeWithRawBackendData(ArticleFlatTreeDTO, articleFlatTreeResponse.resultObject);
|
|
319
331
|
}
|
|
320
332
|
}
|
|
321
|
-
|
|
333
|
+
else if (articleFlatTreeResponse) {
|
|
334
|
+
return Promise.reject(articleFlatTreeResponse.validationResult.messages);
|
|
335
|
+
}
|
|
336
|
+
else {
|
|
337
|
+
return Promise.reject(null);
|
|
338
|
+
}
|
|
322
339
|
});
|
|
323
340
|
}
|
|
324
341
|
_handleConnectionReset() {
|