@esolve/ng-esolve-connect 0.47.2 → 0.48.0

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 (30) hide show
  1. package/esm2022/lib/locations/classes/esolve-location.model.mjs +4 -1
  2. package/esm2022/lib/locations/esolve-locations.service.mjs +1 -1
  3. package/esm2022/lib/locations/interfaces/esolve-location-record.interface.mjs +1 -1
  4. package/esm2022/lib/shipping/esolve-shipping.service.mjs +4 -1
  5. package/esm2022/lib/shipping/interfaces/esolve-shipping-method-options.interface.mjs +1 -1
  6. package/esm2022/media/lib/classes/esolve-media-layout-section.model.mjs +1 -1
  7. package/esm2022/media/lib/interfaces/esolve-layout-config.interface.mjs +1 -1
  8. package/esm2022/media/lib/interfaces/esolve-media-layout-section-record.interface.mjs +1 -1
  9. package/esm2022/media/lib/interfaces/esolve-media-section-data-generic.interface.mjs +2 -0
  10. package/esm2022/media/lib/interfaces/esolve-media-stock-section-data.interface.mjs +2 -0
  11. package/esm2022/media/lib/interfaces/index.mjs +3 -1
  12. package/esm2022/media/lib/services/esolve-media-layout.service.mjs +7 -2
  13. package/esm2022/media/lib/types/esolve-media-layout-section-type.type.mjs +1 -1
  14. package/fesm2022/esolve-ng-esolve-connect-media.mjs +6 -1
  15. package/fesm2022/esolve-ng-esolve-connect-media.mjs.map +1 -1
  16. package/fesm2022/esolve-ng-esolve-connect.mjs +6 -0
  17. package/fesm2022/esolve-ng-esolve-connect.mjs.map +1 -1
  18. package/lib/locations/classes/esolve-location.model.d.ts +8 -3
  19. package/lib/locations/esolve-locations.service.d.ts +6 -5
  20. package/lib/locations/interfaces/esolve-location-record.interface.d.ts +3 -1
  21. package/lib/shipping/interfaces/esolve-shipping-method-options.interface.d.ts +2 -0
  22. package/media/lib/classes/esolve-media-layout-section.model.d.ts +2 -2
  23. package/media/lib/interfaces/esolve-layout-config.interface.d.ts +4 -0
  24. package/media/lib/interfaces/esolve-media-layout-section-record.interface.d.ts +2 -1
  25. package/media/lib/interfaces/esolve-media-section-data-generic.interface.d.ts +6 -0
  26. package/media/lib/interfaces/esolve-media-stock-section-data.interface.d.ts +3 -0
  27. package/media/lib/interfaces/index.d.ts +2 -0
  28. package/media/lib/services/esolve-media-layout.service.d.ts +2 -0
  29. package/media/lib/types/esolve-media-layout-section-type.type.d.ts +1 -1
  30. package/package.json +1 -1
@@ -1,10 +1,11 @@
1
- import { EsolveLocationRecord } from '../interfaces/esolve-location-record.interface';
1
+ import { EsolveLocationRecord } from '../interfaces';
2
2
  import { EsolveLocationAddress } from './esolve-location-address.model';
3
3
  import { EsolveLocationContactInfo } from './esolve-location-contact-info.model';
4
4
  import { EsolveLocationPOBoxAddress } from './esolve-location-pobox-address.model';
5
5
  import { EsolveLocationTradingTimes } from './esolve-location-trading-times.model';
6
6
  import { EsolveLocationGEO } from './esolve-location-geo.model';
7
- export declare class EsolveLocation {
7
+ import { EsolveCustomFields } from '../../shared/custom-fields';
8
+ export declare class EsolveLocation<T extends EsolveCustomFields = EsolveCustomFields> {
8
9
  id: number;
9
10
  identifier: string;
10
11
  description: string;
@@ -24,5 +25,9 @@ export declare class EsolveLocation {
24
25
  contact_info: EsolveLocationContactInfo;
25
26
  trading_times: EsolveLocationTradingTimes;
26
27
  geo?: EsolveLocationGEO;
27
- constructor(record: EsolveLocationRecord);
28
+ /**
29
+ * Location custom fields
30
+ */
31
+ custom_fields?: T;
32
+ constructor(record: EsolveLocationRecord<T>);
28
33
  }
@@ -1,7 +1,8 @@
1
1
  import { Observable } from 'rxjs';
2
+ import { EsolveCustomFields } from '../shared/custom-fields';
2
3
  import { EsolveLocation } from './classes/esolve-location.model';
3
4
  import * as i0 from "@angular/core";
4
- export declare class EsolveLocationsService {
5
+ export declare class EsolveLocationsService<T extends EsolveCustomFields = EsolveCustomFields> {
5
6
  private readonly config;
6
7
  private readonly http;
7
8
  /**
@@ -9,7 +10,7 @@ export declare class EsolveLocationsService {
9
10
  *
10
11
  * @returns An `Observable` with an array of stock locations
11
12
  */
12
- getStockLocations(): Observable<EsolveLocation[]>;
13
+ getStockLocations(): Observable<EsolveLocation<T>[]>;
13
14
  /**
14
15
  * Retrieves a list of stock locations using the address_id as parameter or the latitude and longitude.
15
16
  * Set the addresses_id to 0 and the gps coordinates in order to retrieve the locations list when the address isn't
@@ -21,7 +22,7 @@ export declare class EsolveLocationsService {
21
22
  *
22
23
  * @returns An `Observable` with an array of stock locations
23
24
  */
24
- getStockLocationsGeo(addresses_id?: number, latitude?: number, longitude?: number): Observable<EsolveLocation[]>;
25
+ getStockLocationsGeo(addresses_id?: number, latitude?: number, longitude?: number): Observable<EsolveLocation<T>[]>;
25
26
  /**
26
27
  * Processes the eSolve stock location records.
27
28
  *
@@ -29,6 +30,6 @@ export declare class EsolveLocationsService {
29
30
  * @returns An array of processed stock location records
30
31
  */
31
32
  private processStockLocations;
32
- static ɵfac: i0.ɵɵFactoryDeclaration<EsolveLocationsService, never>;
33
- static ɵprov: i0.ɵɵInjectableDeclaration<EsolveLocationsService>;
33
+ static ɵfac: i0.ɵɵFactoryDeclaration<EsolveLocationsService<any>, never>;
34
+ static ɵprov: i0.ɵɵInjectableDeclaration<EsolveLocationsService<any>>;
34
35
  }
@@ -1,4 +1,5 @@
1
- export interface EsolveLocationRecord {
1
+ import { EsolveCustomFields } from '../../shared/custom-fields';
2
+ export interface EsolveLocationRecord<T extends EsolveCustomFields = EsolveCustomFields> {
2
3
  id: number;
3
4
  identifier: string;
4
5
  head_office: boolean;
@@ -50,4 +51,5 @@ export interface EsolveLocationRecord {
50
51
  distance: number;
51
52
  range: number;
52
53
  target_description: string;
54
+ custom_fields?: T;
53
55
  }
@@ -1,4 +1,6 @@
1
+ import { EsolveTransactionType } from '../../transactions';
1
2
  export interface EsolveShippingMethodOptions {
2
3
  location_id?: number;
3
4
  addresses_id?: number;
5
+ type?: EsolveTransactionType;
4
6
  }
@@ -1,4 +1,4 @@
1
- import { EsolveMediaLayoutSectionRecord } from '../interfaces';
1
+ import { EsolveMediaLayoutSectionRecord, EsolveMediaSectionDataGeneric } from '../interfaces';
2
2
  import { EsolveMediaLayoutSectionType } from '../types';
3
3
  export declare class EsolveMediaLayoutSection {
4
4
  type: EsolveMediaLayoutSectionType;
@@ -6,5 +6,5 @@ export declare class EsolveMediaLayoutSection {
6
6
  identifier: string;
7
7
  private data?;
8
8
  constructor(record: EsolveMediaLayoutSectionRecord);
9
- getData<T>(): T | null;
9
+ getData<T = EsolveMediaSectionDataGeneric>(): T | null;
10
10
  }
@@ -5,5 +5,9 @@ export interface EsolveLayoutConfig {
5
5
  component: ComponentType<any>;
6
6
  sections?: {
7
7
  [key: string]: EsolveLayoutSectionConfig[];
8
+ /**
9
+ * Default sections to use for entire layout
10
+ */
11
+ __default: EsolveLayoutSectionConfig[];
8
12
  };
9
13
  }
@@ -1,7 +1,8 @@
1
1
  import { EsolveMediaLayoutSectionType } from '../types';
2
+ import { EsolveMediaSectionDataGeneric } from './esolve-media-section-data-generic.interface';
2
3
  export interface EsolveMediaLayoutSectionRecord {
3
4
  type: EsolveMediaLayoutSectionType;
4
5
  sub_type?: string;
5
6
  identifier: string;
6
- data?: any;
7
+ data?: EsolveMediaSectionDataGeneric | null;
7
8
  }
@@ -0,0 +1,6 @@
1
+ export interface EsolveMediaSectionDataGeneric {
2
+ [data_field: string]: string | number | boolean | (string | number)[] | {
3
+ min: number;
4
+ max: number;
5
+ };
6
+ }
@@ -0,0 +1,3 @@
1
+ export interface EsolveMediaStockSectionData {
2
+ tags: (string | number)[];
3
+ }
@@ -6,3 +6,5 @@ export * from './esolve-media-group-record.interface';
6
6
  export * from './esolve-media-layout-section-record.interface';
7
7
  export * from './esolve-media-link-record.interface';
8
8
  export * from './esolve-connect-media-config.interface';
9
+ export * from './esolve-media-section-data-generic.interface';
10
+ export * from './esolve-media-stock-section-data.interface';
@@ -3,6 +3,8 @@ import { EsolveMediaArticle, EsolveMediaLayoutSection } from '../classes';
3
3
  import * as i0 from "@angular/core";
4
4
  export declare class EsolveMediaLayoutService {
5
5
  private readonly section_key_delimiter;
6
+ private readonly default_section_group_key;
7
+ private readonly default_layout_key;
6
8
  private media?;
7
9
  private layout_map;
8
10
  private section_map;
@@ -1 +1 @@
1
- export type EsolveMediaLayoutSectionType = 'media' | 'banner' | 'linked_stock' | 'custom';
1
+ export type EsolveMediaLayoutSectionType = 'media' | 'banner' | 'linked_stock' | 'stock' | 'custom';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@esolve/ng-esolve-connect",
3
- "version": "0.47.2",
3
+ "version": "0.48.0",
4
4
  "homepage": "https://www.esolve.co.za/",
5
5
  "description": "An Angular library that speaks to an eSolve instance's API",
6
6
  "peerDependencies": {