@esolve/ng-esolve-connect 0.16.0 → 0.16.1

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.
Files changed (24) hide show
  1. package/esm2020/lib/account/registration/esolve-registration-data.interface.mjs +1 -1
  2. package/esm2020/lib/news/esolve-news-article.model.mjs +2 -1
  3. package/esm2020/lib/shared/assets/esolve-asset-options.interface.mjs +1 -1
  4. package/esm2020/lib/shared/assets/esolve-asset-record.interface.mjs +1 -1
  5. package/esm2020/lib/shared/assets/esolve-asset.model.mjs +20 -1
  6. package/esm2020/lib/shared/assets/esolve-assets.service.mjs +13 -4
  7. package/esm2020/lib/stock/esolve-stock-base-record.interface.mjs +1 -1
  8. package/esm2020/lib/stock/esolve-stock-item-base.model.mjs +28 -1
  9. package/esm2020/lib/stock/esolve-stock-unit-of-measure.type.mjs +2 -0
  10. package/esm2020/lib/stock/index.mjs +2 -1
  11. package/fesm2015/esolve-ng-esolve-connect.mjs +72 -15
  12. package/fesm2015/esolve-ng-esolve-connect.mjs.map +1 -1
  13. package/fesm2020/esolve-ng-esolve-connect.mjs +60 -3
  14. package/fesm2020/esolve-ng-esolve-connect.mjs.map +1 -1
  15. package/lib/account/registration/esolve-registration-data.interface.d.ts +3 -0
  16. package/lib/shared/assets/esolve-asset-options.interface.d.ts +5 -2
  17. package/lib/shared/assets/esolve-asset-record.interface.d.ts +1 -0
  18. package/lib/shared/assets/esolve-asset.model.d.ts +11 -0
  19. package/lib/shared/assets/esolve-assets.service.d.ts +1 -1
  20. package/lib/stock/esolve-stock-base-record.interface.d.ts +6 -0
  21. package/lib/stock/esolve-stock-item-base.model.d.ts +21 -0
  22. package/lib/stock/esolve-stock-unit-of-measure.type.d.ts +1 -0
  23. package/lib/stock/index.d.ts +1 -0
  24. package/package.json +1 -1
@@ -1291,7 +1291,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
1291
1291
 
1292
1292
  class EsolveAsset {
1293
1293
  constructor(record) {
1294
- var _a, _b, _c, _d, _e, _f;
1294
+ var _a, _b, _c, _d, _e, _f, _g;
1295
1295
  this.id = 0;
1296
1296
  this.src = '';
1297
1297
  this.name = '';
@@ -1304,6 +1304,7 @@ class EsolveAsset {
1304
1304
  this.sort_priority = 0;
1305
1305
  this.topics = [];
1306
1306
  this.tags = [];
1307
+ this.image_name = '';
1307
1308
  this.id = +record.id;
1308
1309
  this.src = record.src;
1309
1310
  this.name = record.name;
@@ -1315,6 +1316,7 @@ class EsolveAsset {
1315
1316
  this.asset_category = (_d = record.asset_category) !== null && _d !== void 0 ? _d : '';
1316
1317
  this.asset_sub_category = (_e = record.asset_sub_category) !== null && _e !== void 0 ? _e : '';
1317
1318
  this.sort_priority = +((_f = record.sort_priority) !== null && _f !== void 0 ? _f : '');
1319
+ this.image_name = (_g = record.image_name) !== null && _g !== void 0 ? _g : '';
1318
1320
  if (record.created) {
1319
1321
  this.created = record.created;
1320
1322
  }
@@ -1341,6 +1343,23 @@ class EsolveAsset {
1341
1343
  }
1342
1344
  }
1343
1345
  }
1346
+ /**
1347
+ * Shortcut to `getImagePath()`
1348
+ */
1349
+ get image_src() {
1350
+ return this.getImagePath();
1351
+ }
1352
+ /**
1353
+ * Retrieve image path
1354
+ *
1355
+ * @returns Image path on CDN, else empty string if no image exists
1356
+ */
1357
+ getImagePath() {
1358
+ if (this.image_name !== '') {
1359
+ return `/images/documents/${this.image_name}`;
1360
+ }
1361
+ return '';
1362
+ }
1344
1363
  }
1345
1364
 
1346
1365
  class EsolveAssetsService {
@@ -1379,6 +1398,9 @@ class EsolveAssetsService {
1379
1398
  processAsset(record) {
1380
1399
  return new EsolveAsset(record);
1381
1400
  }
1401
+ getAssetRecords(params) {
1402
+ return this.http.get(`${this.config.api_url}/get-assets.php`, { params });
1403
+ }
1382
1404
  parseOptions(options) {
1383
1405
  let params = new HttpParams();
1384
1406
  if (!options) {
@@ -1411,11 +1433,17 @@ class EsolveAssetsService {
1411
1433
  if (options.asset_sub_category) {
1412
1434
  params = params.set('asset_sub_category', options.asset_sub_category);
1413
1435
  }
1436
+ if (options.document_number) {
1437
+ params = params.set('document_number', options.document_number);
1438
+ }
1439
+ if (options.document_type) {
1440
+ params = params.set('document_type', options.document_type);
1441
+ }
1442
+ if (options.area_of_application) {
1443
+ params = params.set('area_of_application', options.area_of_application);
1444
+ }
1414
1445
  return params;
1415
1446
  }
1416
- getAssetRecords(params) {
1417
- return this.http.get(`${this.config.api_url}/get-assets.php`, { params });
1418
- }
1419
1447
  }
1420
1448
  EsolveAssetsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: EsolveAssetsService, deps: [{ token: ESOLVE_CONNECT_CONFIG }, { token: i1$2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
1421
1449
  EsolveAssetsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: EsolveAssetsService, providedIn: 'root' });
@@ -2659,7 +2687,7 @@ class EsolveNewsArticleAuthor {
2659
2687
 
2660
2688
  class EsolveNewsArticle {
2661
2689
  constructor(record) {
2662
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
2690
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
2663
2691
  this.id = 0;
2664
2692
  this.title = '';
2665
2693
  this.sef_title = '';
@@ -2681,15 +2709,16 @@ class EsolveNewsArticle {
2681
2709
  this.article = (_d = record.article) !== null && _d !== void 0 ? _d : '';
2682
2710
  this.txdate = (_e = record.txdate) !== null && _e !== void 0 ? _e : '';
2683
2711
  this.image = (_f = record.image) !== null && _f !== void 0 ? _f : '';
2712
+ this.short_description = (_g = record.short_description) !== null && _g !== void 0 ? _g : '';
2684
2713
  if (record.active) {
2685
2714
  this.active = !!+record.active;
2686
2715
  }
2687
2716
  if (record.featured) {
2688
2717
  this.featured = !!+record.featured;
2689
2718
  }
2690
- seo_title = (_g = record.seo_page_title) !== null && _g !== void 0 ? _g : '';
2691
- seo_description = (_h = record.short_description) !== null && _h !== void 0 ? _h : '';
2692
- seo_keywords = (_j = record.seo_keywords) !== null && _j !== void 0 ? _j : '';
2719
+ seo_title = (_h = record.seo_page_title) !== null && _h !== void 0 ? _h : '';
2720
+ seo_description = (_j = record.short_description) !== null && _j !== void 0 ? _j : '';
2721
+ seo_keywords = (_k = record.seo_keywords) !== null && _k !== void 0 ? _k : '';
2693
2722
  if (record.news_group) {
2694
2723
  const group_record = record.news_group;
2695
2724
  this.group = new EsolveNewsGroup(+group_record.id, group_record.name, group_record.description, group_record.sef_name);
@@ -2912,7 +2941,7 @@ class EsolveStockLeadTimes {
2912
2941
 
2913
2942
  class EsolveStockItemBase {
2914
2943
  constructor(record = {}) {
2915
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
2944
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
2916
2945
  /**
2917
2946
  * eSolve Generated ID
2918
2947
  */
@@ -2945,6 +2974,26 @@ class EsolveStockItemBase {
2945
2974
  * Featured state
2946
2975
  */
2947
2976
  this.featured = false;
2977
+ /**
2978
+ * Height measured in meters (m)
2979
+ */
2980
+ this.height = 0;
2981
+ /**
2982
+ * Width measured in meters (m)
2983
+ */
2984
+ this.width = 0;
2985
+ /**
2986
+ * Length / depth measured in meters (m)
2987
+ */
2988
+ this.length = 0;
2989
+ /**
2990
+ * Weight measured in kilograms (kg)
2991
+ */
2992
+ this.weight = 0;
2993
+ /**
2994
+ * Units used to measure the quantity
2995
+ */
2996
+ this.unit_of_measure = 'unit';
2948
2997
  /**
2949
2998
  * ID of default category linked to the stock item
2950
2999
  *
@@ -3009,10 +3058,17 @@ class EsolveStockItemBase {
3009
3058
  this.ranges_id = +((_l = record.ranges_id) !== null && _l !== void 0 ? _l : 0);
3010
3059
  this.active = !!+((_m = record.is_active) !== null && _m !== void 0 ? _m : false);
3011
3060
  this.featured = !!+((_o = record.is_featured) !== null && _o !== void 0 ? _o : false);
3012
- base_price = +((_p = record.regular_sellprice) !== null && _p !== void 0 ? _p : 0);
3013
- base_price_with_tax = +((_q = record.regular_sellprice_inclusive) !== null && _q !== void 0 ? _q : 0);
3014
- sell_price = +((_r = record.sellprice) !== null && _r !== void 0 ? _r : 0);
3015
- sell_price_with_tax = +((_s = record.sellprice_inclusive) !== null && _s !== void 0 ? _s : 0);
3061
+ this.height = +((_p = record.height) !== null && _p !== void 0 ? _p : 0);
3062
+ this.width = +((_q = record.width) !== null && _q !== void 0 ? _q : 0);
3063
+ this.length = +((_r = record.length) !== null && _r !== void 0 ? _r : 0);
3064
+ this.weight = +((_s = record.weight) !== null && _s !== void 0 ? _s : 0);
3065
+ if (record.unit_of_measure) {
3066
+ this.unit_of_measure = record.unit_of_measure;
3067
+ }
3068
+ base_price = +((_t = record.regular_sellprice) !== null && _t !== void 0 ? _t : 0);
3069
+ base_price_with_tax = +((_u = record.regular_sellprice_inclusive) !== null && _u !== void 0 ? _u : 0);
3070
+ sell_price = +((_v = record.sellprice) !== null && _v !== void 0 ? _v : 0);
3071
+ sell_price_with_tax = +((_w = record.sellprice_inclusive) !== null && _w !== void 0 ? _w : 0);
3016
3072
  if ((record.tags) && (record.tags.length > 0)) {
3017
3073
  for (const tag of record.tags) {
3018
3074
  this.tags.push(new EsolveTag(tag));
@@ -3051,8 +3107,8 @@ class EsolveStockItemBase {
3051
3107
  if (record.custom_fields) {
3052
3108
  this.custom_fields = record.custom_fields;
3053
3109
  }
3054
- seo_title = (_t = record.seo_page_title) !== null && _t !== void 0 ? _t : '';
3055
- seo_keywords = (_u = record.seo_keywords) !== null && _u !== void 0 ? _u : '';
3110
+ seo_title = (_x = record.seo_page_title) !== null && _x !== void 0 ? _x : '';
3111
+ seo_keywords = (_y = record.seo_keywords) !== null && _y !== void 0 ? _y : '';
3056
3112
  }
3057
3113
  this.price = new EsolveStockPrice(base_price, base_price_with_tax, sell_price, sell_price_with_tax);
3058
3114
  if (seo_title.trim() === '') {
@@ -4447,3 +4503,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
4447
4503
  */
4448
4504
 
4449
4505
  export { EsolveAccountService, EsolveAdditionalStockImage, EsolveAddress, EsolveAddressResult, EsolveAsset, EsolveAssetsService, EsolveAuthService, EsolveBankingDetails, EsolveBanner, EsolveBannerImage, EsolveBannerImageHotspot, EsolveBannerService, EsolveCartItem, EsolveCartService, EsolveCartStockItem, EsolveCartTotals, EsolveCategoryTreeItem, EsolveCategoryTreeService, EsolveChangePasswordResult, EsolveCheckoutResult, EsolveColour, EsolveCookieService, EsolveEnquiryResult, EsolveEnquiryService, EsolveErrorHandlerService, EsolveGeocodeAddressResult, EsolveGeocodeCoordsResult, EsolveGeocodeResult, EsolveGeocoderService, EsolveHeading, EsolveHttpError, EsolveLinkedAsset, EsolveLinkedStockItem, EsolveList, EsolveLocation, EsolveLocationAddress, EsolveLocationContactInfo, EsolveLocationPOBoxAddress, EsolveLocationTradingDay, EsolveLocationTradingTimes, EsolveLocationsService, EsolveManufacturer, EsolveManufacturersService, EsolveMediaArticle, EsolveMediaService, EsolveMediaStockItem, EsolveMenuItem, EsolveMenuService, EsolveNewsArticle, EsolveNewsArticleAuthor, EsolveNewsArticleList, EsolveNewsGroup, EsolveNewsService, EsolvePaymentMethod, EsolvePaymentResult, EsolvePaymentService, EsolveRange, EsolveRangesService, EsolveRecipeStockItem, EsolveRegistrationResult, EsolveResetPasswordResult, EsolveResponseHandlerService, EsolveResponseResult, EsolveResult, EsolveSeoInfo, EsolveSeoService, EsolveSession, EsolveSessionService, EsolveShippingCost, EsolveShippingMethod, EsolveShippingService, EsolveShippingTotals, EsolveSpecial, EsolveSpecialImage, EsolveSpecialImageCollection, EsolveSpecialsService, EsolveStockBadge, EsolveStockGroup, EsolveStockGroupItem, EsolveStockImage, EsolveStockImageCollection, EsolveStockItem, EsolveStockItemBase, EsolveStockItemList, EsolveStockLeadTimes, EsolveStockPrice, EsolveStockService, EsolveTag, EsolveTagsService, EsolveTopic, EsolveTopicService, EsolveTransaction, EsolveTransactionAddress, EsolveTransactionClient, EsolveTransactionItem, EsolveTransactionItemPrice, EsolveTransactionList, EsolveTransactionLocation, EsolveTransactionPaymentMethod, EsolveTransactionShippingMethod, EsolveTransactionUser, EsolveUserAccount, EsolveUserAccountBusiness, EsolveUserAccountContact, EsolveUserAccountResult, EsolveVaultItem, EsolveVaultItemResult, NgEsolveConnectModule };
4506
+ //# sourceMappingURL=esolve-ng-esolve-connect.mjs.map