@colijnit/articleapi 256.1.1 → 256.1.3
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-auth.d.ts
CHANGED
|
@@ -47,7 +47,7 @@ export declare class ArticlesAuth extends IoneApiArticles {
|
|
|
47
47
|
getBrandsFilter(request: ArticleExtendedRequest): Promise<DataServiceResponseData>;
|
|
48
48
|
getCatalogDefinitions(showLoader?: boolean): Promise<DataServiceResponseData>;
|
|
49
49
|
getExternalSource(externalSourceId: number, showLoader?: boolean): Promise<DataServiceResponseData>;
|
|
50
|
-
getArticleFullObject(id: number): Promise<DataServiceResponseData>;
|
|
50
|
+
getArticleFullObject(id: number, showLoader?: boolean): Promise<DataServiceResponseData>;
|
|
51
51
|
getArticleFlat(sku: string): Promise<DataServiceResponseData>;
|
|
52
52
|
getWarehouses(goodId: number): Promise<DataServiceResponseData>;
|
|
53
53
|
getFrozenArticle(configuratorStatistics: ConfiguratorStatisticsEnvironment, showLoader: boolean, instanceId: number): Promise<DataServiceResponseData>;
|
package/build/articles-auth.js
CHANGED
|
@@ -282,14 +282,14 @@ export class ArticlesAuth extends IoneApiArticles {
|
|
|
282
282
|
return this._call(DataServiceMethod.SelectSingleObject, data, BackendServiceName.DataService, showLoader);
|
|
283
283
|
});
|
|
284
284
|
}
|
|
285
|
-
getArticleFullObject(id) {
|
|
285
|
+
getArticleFullObject(id, showLoader = true) {
|
|
286
286
|
const data = {
|
|
287
287
|
moduleName: ModuleName.Articles,
|
|
288
288
|
objectName: ArticleObjectName.ArticleFullObject,
|
|
289
289
|
refCursorAsArray: true,
|
|
290
290
|
objectId: id
|
|
291
291
|
};
|
|
292
|
-
return this._call(DataServiceMethod.SelectSingleObject, data);
|
|
292
|
+
return this._call(DataServiceMethod.SelectSingleObject, data, BackendServiceName.DataService, showLoader);
|
|
293
293
|
}
|
|
294
294
|
getArticleFlat(sku) {
|
|
295
295
|
const data = {
|
|
@@ -48,7 +48,7 @@ export declare class ArticlesPublic extends IoneApiArticles {
|
|
|
48
48
|
getCatalogDefinitions(showLoader?: boolean): Promise<DataServiceResponseData>;
|
|
49
49
|
getExternalSource(externalSourceId: number, showLoader?: boolean): Promise<DataServiceResponseData>;
|
|
50
50
|
getGoodIdFromArticleNr(sku: string): Promise<DataServiceResponseData>;
|
|
51
|
-
getArticleFullObject(goodId: number): Promise<DataServiceResponseData>;
|
|
51
|
+
getArticleFullObject(goodId: number, showLoader?: boolean): Promise<DataServiceResponseData>;
|
|
52
52
|
getArticleFlat(sku: string): Promise<DataServiceResponseData>;
|
|
53
53
|
getWarehouses(goodId: number): Promise<DataServiceResponseData>;
|
|
54
54
|
getFrozenArticle(configuratorStatistics: ConfiguratorStatisticsEnvironment, showLoader: boolean, instanceId: number): Promise<DataServiceResponseData>;
|
package/build/articles-public.js
CHANGED
|
@@ -139,10 +139,10 @@ export class ArticlesPublic extends IoneApiArticles {
|
|
|
139
139
|
return this._call(PublicServiceMethod.GetGoodIdFromArticleNr, data);
|
|
140
140
|
});
|
|
141
141
|
}
|
|
142
|
-
getArticleFullObject(goodId) {
|
|
142
|
+
getArticleFullObject(goodId, showLoader = true) {
|
|
143
143
|
return __awaiter(this, void 0, void 0, function* () {
|
|
144
144
|
const data = Object.assign(Object.assign({}, this.createServiceRequestData()), { objectId: goodId });
|
|
145
|
-
return this._call(PublicServiceMethod.GetArticleFullObject, data);
|
|
145
|
+
return this._call(PublicServiceMethod.GetArticleFullObject, data, showLoader);
|
|
146
146
|
});
|
|
147
147
|
}
|
|
148
148
|
getArticleFlat(sku) {
|
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>;
|
|
@@ -67,7 +67,7 @@ export declare class Articles {
|
|
|
67
67
|
getBrandsFilter(request: ArticleExtendedRequest): Promise<DataServiceResponseData>;
|
|
68
68
|
getCatalogDefinitions(showLoader?: boolean): Promise<DataServiceResponseData>;
|
|
69
69
|
getExternalSource(externalSourceId: number, showLoader?: boolean): Promise<DataServiceResponseData>;
|
|
70
|
-
getArticleFullObject(id: number): Promise<DataServiceResponseData>;
|
|
70
|
+
getArticleFullObject(id: number, showLoader?: boolean): Promise<DataServiceResponseData>;
|
|
71
71
|
getArticleFlat(sku: string): Promise<DataServiceResponseData>;
|
|
72
72
|
getWarehouses(goodId: number): Promise<DataServiceResponseData>;
|
|
73
73
|
getTurnoverGroups(category?: string, showLoader?: boolean): Promise<DataServiceResponseData>;
|
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();
|
|
@@ -122,8 +122,8 @@ export class Articles {
|
|
|
122
122
|
getExternalSource(externalSourceId, showLoader = true) {
|
|
123
123
|
return this.articles.getExternalSource(externalSourceId, showLoader);
|
|
124
124
|
}
|
|
125
|
-
getArticleFullObject(id) {
|
|
126
|
-
return this.articles.getArticleFullObject(id);
|
|
125
|
+
getArticleFullObject(id, showLoader = true) {
|
|
126
|
+
return this.articles.getArticleFullObject(id, showLoader);
|
|
127
127
|
}
|
|
128
128
|
getArticleFlat(sku) {
|
|
129
129
|
return this.articles.getArticleFlat(sku);
|
|
@@ -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() {
|
|
@@ -53,7 +53,7 @@ export declare abstract class IoneApiArticles {
|
|
|
53
53
|
abstract getBrandsFilter(request: ArticleExtendedRequest): Promise<DataServiceResponseData>;
|
|
54
54
|
abstract getCatalogDefinitions(showLoader: boolean): Promise<DataServiceResponseData>;
|
|
55
55
|
abstract getExternalSource(externalSourceId: number, showLoader: boolean): Promise<DataServiceResponseData>;
|
|
56
|
-
abstract getArticleFullObject(id: number): Promise<DataServiceResponseData>;
|
|
56
|
+
abstract getArticleFullObject(id: number, showLoader: boolean): Promise<DataServiceResponseData>;
|
|
57
57
|
abstract getArticleFlat(sku: string): Promise<DataServiceResponseData>;
|
|
58
58
|
abstract getWarehouses(goodId: number): Promise<DataServiceResponseData>;
|
|
59
59
|
abstract getFrozenArticle(configuratorStatistics: ConfiguratorStatisticsEnvironment, showLoader: boolean, instanceId: number): Promise<DataServiceResponseData>;
|