@veloceapps/api 7.0.2-41 → 7.0.2-43
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/esm2020/lib/services/catalog-admin-api.service.mjs +28 -1
- package/esm2020/lib/services/configuration-api.service.mjs +12 -7
- package/esm2020/lib/services/product-model-api.service.mjs +6 -1
- package/fesm2015/veloceapps-api.mjs +40 -7
- package/fesm2015/veloceapps-api.mjs.map +1 -1
- package/fesm2020/veloceapps-api.mjs +43 -7
- package/fesm2020/veloceapps-api.mjs.map +1 -1
- package/lib/services/catalog-admin-api.service.d.ts +5 -1
- package/lib/services/product-model-api.service.d.ts +5 -0
- package/package.json +1 -1
@@ -3,8 +3,8 @@ import { HttpParams, HttpErrorResponse, HttpClientModule } from '@angular/common
|
|
3
3
|
import * as i0 from '@angular/core';
|
4
4
|
import { Injectable, NgModule } from '@angular/core';
|
5
5
|
import * as i1 from '@veloceapps/core';
|
6
|
-
import { ModelTranslatorUtils, ConfigurationContextMode, isLegacyDocumentTemplate, DocxTemplater, QuoteDraft, StringUtils, Expression, Operator, ProductModelsContainer, ModelUtils, EntityUtil, RuleGroupTypes, parseJsonSafely, BaseHttpService, XrayService } from '@veloceapps/core';
|
7
|
-
import { throwError, of, zip, forkJoin, map as map$1,
|
6
|
+
import { uiDefinitionFromDTO, isLegacyUIDefinition, ModelTranslatorUtils, ConfigurationContextMode, isLegacyDocumentTemplate, DocxTemplater, QuoteDraft, StringUtils, Expression, Operator, ProductModelsContainer, ModelUtils, EntityUtil, RuleGroupTypes, parseJsonSafely, BaseHttpService, XrayService } from '@veloceapps/core';
|
7
|
+
import { noop, throwError, of, zip, forkJoin, map as map$1, catchError as catchError$1, switchMap as switchMap$1 } from 'rxjs';
|
8
8
|
import { map, catchError, tap, switchMap, defaultIfEmpty } from 'rxjs/operators';
|
9
9
|
import * as i2 from 'primeng/api';
|
10
10
|
import { CurrencyPipe } from '@angular/common';
|
@@ -240,6 +240,32 @@ class CatalogAdminApiService {
|
|
240
240
|
});
|
241
241
|
};
|
242
242
|
}
|
243
|
+
attachImage$(catalogId, categoryId, file) {
|
244
|
+
const data = new FormData();
|
245
|
+
data.append('image', file);
|
246
|
+
return this.baseHttpService.upload({
|
247
|
+
method: 'post',
|
248
|
+
url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/image`,
|
249
|
+
body: data,
|
250
|
+
});
|
251
|
+
}
|
252
|
+
removeImage$(catalogId, categoryId) {
|
253
|
+
return this.baseHttpService.api({
|
254
|
+
method: 'delete',
|
255
|
+
url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/image`,
|
256
|
+
});
|
257
|
+
}
|
258
|
+
fetchImage$(catalogId, categoryId) {
|
259
|
+
return this.baseHttpService.api({
|
260
|
+
url: this.getImageUrl(catalogId, categoryId),
|
261
|
+
method: 'get',
|
262
|
+
responseType: 'blob',
|
263
|
+
errorHandler: noop,
|
264
|
+
});
|
265
|
+
}
|
266
|
+
getImageUrl(catalogId, categoryId) {
|
267
|
+
return `${this.serviceUrl}/${catalogId}/categories/${categoryId}/image`;
|
268
|
+
}
|
243
269
|
}
|
244
270
|
CatalogAdminApiService.MAX_RESULTS = 60;
|
245
271
|
CatalogAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: CatalogAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
|
@@ -366,11 +392,16 @@ class ConfigurationApiService {
|
|
366
392
|
url: `${this.SERVICE_URL}/${productId}/model` + ((offeringId && `/${offeringId}`) || ''),
|
367
393
|
})
|
368
394
|
.pipe(map(runtimeData => {
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
395
|
+
return {
|
396
|
+
...runtimeData,
|
397
|
+
uiDefinitions: runtimeData.uiDefinitions.map(dto => {
|
398
|
+
const uiDefinitionContainer = uiDefinitionFromDTO(dto);
|
399
|
+
if (isLegacyUIDefinition(uiDefinitionContainer.source)) {
|
400
|
+
ModelTranslatorUtils.toLocalUIDefinition(uiDefinitionContainer.source);
|
401
|
+
}
|
402
|
+
return uiDefinitionContainer;
|
403
|
+
}),
|
404
|
+
};
|
374
405
|
}));
|
375
406
|
}
|
376
407
|
getRuntimeDataByModelId(modelId) {
|
@@ -1669,6 +1700,11 @@ class ProductModelApiService {
|
|
1669
1700
|
return linkedModels;
|
1670
1701
|
}));
|
1671
1702
|
}
|
1703
|
+
/**
|
1704
|
+
*
|
1705
|
+
* @deprecated
|
1706
|
+
* Will be removed in next major release
|
1707
|
+
*/
|
1672
1708
|
load(id, version) {
|
1673
1709
|
return forkJoin([this.getModel(id, version), this.getLinkedModels(id, version)]).pipe(map(([model, linkedModels]) => {
|
1674
1710
|
const container = new ProductModelsContainer(model, linkedModels ?? []);
|