@esolve/ng-esolve-connect 0.20.9 → 0.21.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/esm2020/lib/account/esolve-account.service.mjs +4 -4
- package/esm2020/lib/cart/esolve-cart-additional-where.interface.mjs +1 -1
- package/esm2020/lib/cart/esolve-cart-empty-response.interface.mjs +1 -1
- package/esm2020/lib/cart/esolve-cart.service.mjs +2 -2
- package/esm2020/lib/cart/esolve-empty-cart-result.model.mjs +1 -1
- package/esm2020/lib/cart/index.mjs +3 -1
- package/esm2020/lib/category-tree/esolve-category-tree.service.mjs +22 -2
- package/esm2020/lib/locations/esolve-location-record.interface.mjs +1 -1
- package/esm2020/lib/locations/esolve-locations.service.mjs +3 -2
- package/esm2020/lib/shared/errors/esolve-error-handler.service.mjs +23 -22
- package/esm2020/lib/shared/errors/esolve-http-error.model.mjs +12 -5
- package/esm2020/lib/shared/filters/classes/esolve-multiple-select-filter.model.mjs +30 -0
- package/esm2020/lib/shared/filters/classes/esolve-range-filter.model.mjs +45 -0
- package/esm2020/lib/shared/filters/classes/esolve-single-select-filter.model.mjs +33 -0
- package/esm2020/lib/shared/filters/classes/index.mjs +5 -0
- package/esm2020/lib/shared/filters/esolve-filter-factory.mjs +60 -0
- package/esm2020/lib/shared/filters/index.mjs +5 -0
- package/esm2020/lib/shared/filters/interfaces/esolve-filter-definitions.interface.mjs +2 -0
- package/esm2020/lib/shared/filters/interfaces/esolve-filter-record.interface.mjs +2 -0
- package/esm2020/lib/shared/filters/interfaces/esolve-filter.interface.mjs +2 -0
- package/esm2020/lib/shared/filters/interfaces/esolve-range-filter-record.interface.mjs +2 -0
- package/esm2020/lib/shared/filters/interfaces/esolve-select-filter-record.interface.mjs +2 -0
- package/esm2020/lib/shared/filters/interfaces/esolve-select-filter.interface.mjs +2 -0
- package/esm2020/lib/shared/filters/interfaces/index.mjs +8 -0
- package/esm2020/lib/shared/filters/types/esolve-filter-list.type.mjs +2 -0
- package/esm2020/lib/shared/filters/types/esolve-filter-record-list.type.mjs +2 -0
- package/esm2020/lib/shared/filters/types/esolve-filter-type.type.mjs +2 -0
- package/esm2020/lib/shared/filters/types/esolve-range-filter-type.type.mjs +2 -0
- package/esm2020/lib/shared/filters/types/esolve-select-filter-type.type.mjs +2 -0
- package/esm2020/lib/shared/filters/types/index.mjs +7 -0
- package/esm2020/lib/shared/response/esolve-response-result.model.mjs +3 -3
- package/esm2020/lib/shipping/esolve-shipping.service.mjs +5 -3
- package/esm2020/lib/stock/classes/esolve-stock-item-base.model.mjs +2 -2
- package/esm2020/lib/stock/classes/esolve-stock-price.model.mjs +5 -2
- package/esm2020/lib/stock/esolve-stock.service.mjs +51 -12
- package/esm2020/lib/stock/interfaces/esolve-linked-stock-record.interface.mjs +1 -1
- package/esm2020/lib/stock/interfaces/esolve-recipe-item-record.interface.mjs +1 -1
- package/esm2020/lib/stock/interfaces/esolve-stock-filter-options.interface.mjs +2 -0
- package/esm2020/lib/stock/interfaces/esolve-stock-group-item-record.interface.mjs +1 -1
- package/esm2020/lib/stock/interfaces/esolve-stock-item-options.interface.mjs +1 -1
- package/esm2020/lib/stock/interfaces/index.mjs +2 -1
- package/esm2020/lib/tags/esolve-tags.service.mjs +4 -2
- package/esm2020/lib/topics/esolve-topic.service.mjs +4 -2
- package/esm2020/public-api.mjs +2 -1
- package/fesm2015/esolve-ng-esolve-connect.mjs +298 -51
- package/fesm2015/esolve-ng-esolve-connect.mjs.map +1 -1
- package/fesm2020/esolve-ng-esolve-connect.mjs +300 -51
- package/fesm2020/esolve-ng-esolve-connect.mjs.map +1 -1
- package/lib/cart/index.d.ts +2 -0
- package/lib/category-tree/esolve-category-tree.service.d.ts +9 -0
- package/lib/locations/esolve-locations.service.d.ts +2 -1
- package/lib/shared/errors/esolve-http-error.model.d.ts +3 -3
- package/lib/shared/filters/classes/esolve-multiple-select-filter.model.d.ts +14 -0
- package/lib/shared/filters/classes/esolve-range-filter.model.d.ts +18 -0
- package/lib/shared/filters/classes/esolve-single-select-filter.model.d.ts +15 -0
- package/lib/shared/filters/classes/index.d.ts +3 -0
- package/lib/shared/filters/esolve-filter-factory.d.ts +13 -0
- package/lib/shared/filters/index.d.ts +4 -0
- package/lib/shared/filters/interfaces/esolve-filter-definitions.interface.d.ts +6 -0
- package/lib/shared/filters/interfaces/esolve-filter-record.interface.d.ts +5 -0
- package/lib/shared/filters/interfaces/esolve-filter.interface.d.ts +10 -0
- package/lib/shared/filters/interfaces/esolve-range-filter-record.interface.d.ts +7 -0
- package/lib/shared/filters/interfaces/esolve-select-filter-record.interface.d.ts +6 -0
- package/lib/shared/filters/interfaces/esolve-select-filter.interface.d.ts +4 -0
- package/lib/shared/filters/interfaces/index.d.ts +6 -0
- package/lib/shared/filters/types/esolve-filter-list.type.d.ts +2 -0
- package/lib/shared/filters/types/esolve-filter-record-list.type.d.ts +2 -0
- package/lib/shared/filters/types/esolve-filter-type.type.d.ts +3 -0
- package/lib/shared/filters/types/esolve-range-filter-type.type.d.ts +1 -0
- package/lib/shared/filters/types/esolve-select-filter-type.type.d.ts +1 -0
- package/lib/shared/filters/types/index.d.ts +5 -0
- package/lib/stock/classes/esolve-stock-price.model.d.ts +4 -1
- package/lib/stock/esolve-stock.service.d.ts +3 -1
- package/lib/stock/interfaces/esolve-stock-filter-options.interface.d.ts +7 -0
- package/lib/stock/interfaces/esolve-stock-item-options.interface.d.ts +5 -0
- package/lib/stock/interfaces/index.d.ts +1 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
package/lib/cart/index.d.ts
CHANGED
|
@@ -13,3 +13,5 @@ export * from './esolve-cart-stock-item.model';
|
|
|
13
13
|
export * from './esolve-cart-totals.model';
|
|
14
14
|
export * from './esolve-cart-totals-record.interface';
|
|
15
15
|
export * from './esolve-cart.service';
|
|
16
|
+
export * from './esolve-cart-empty-response.interface';
|
|
17
|
+
export * from './esolve-empty-cart-result.model';
|
|
@@ -12,6 +12,15 @@ export declare class EsolveCategoryTreeService {
|
|
|
12
12
|
* Retrieves the category tree from eSolve instance and coverts it to the correct format.
|
|
13
13
|
*/
|
|
14
14
|
getCategoryTree(): Observable<EsolveCategoryTreeItem[]>;
|
|
15
|
+
/**
|
|
16
|
+
* Retrieve the special tree structure for a specific special from the eSolve
|
|
17
|
+
* instance and converts it into the correct format
|
|
18
|
+
*
|
|
19
|
+
* @param special_id Id of to special to get tree for
|
|
20
|
+
*
|
|
21
|
+
* @returns Observable containing special tree data
|
|
22
|
+
*/
|
|
23
|
+
getSpecialTree(special_id: number): Observable<EsolveCategoryTreeItem[]>;
|
|
15
24
|
/**
|
|
16
25
|
* Retrieve the details of a category tree item from the eSolve instance and
|
|
17
26
|
* converts it to the correct format.
|
|
@@ -18,9 +18,10 @@ export declare class EsolveLocationsService {
|
|
|
18
18
|
* Set the addresses_id to 0 and the gps coordinates in order to retrieve the locations list when the address isn't
|
|
19
19
|
* yet saved.
|
|
20
20
|
*
|
|
21
|
-
* @param addresses_id if supplied, the
|
|
21
|
+
* @param addresses_id if supplied, the latitude and longitude on the address will be used.
|
|
22
22
|
* @param latitude if supplied and address_id > 0, the value is ignored.
|
|
23
23
|
* @param longitude if supplied and address_id > 0, the value is ignored.
|
|
24
|
+
*
|
|
24
25
|
* @returns An `Observable` with an array of stock locations
|
|
25
26
|
*/
|
|
26
27
|
getStockLocationsGeo(addresses_id?: number, latitude?: number, longitude?: number): Observable<EsolveLocation[]>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export declare class EsolveHttpError {
|
|
1
|
+
export declare class EsolveHttpError extends Error {
|
|
2
|
+
readonly http_error = true;
|
|
2
3
|
type: 'error' | 'exception';
|
|
3
|
-
message: string;
|
|
4
4
|
error_code: string;
|
|
5
|
-
constructor(type: 'error' | 'exception', message: string,
|
|
5
|
+
constructor(type: 'error' | 'exception', code: string, message: string, ...params: any[]);
|
|
6
6
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { HttpParams } from '@angular/common/http';
|
|
2
|
+
import { EsolveSelectFilter } from '../interfaces';
|
|
3
|
+
export declare class EsolveMultipleSelectFilter implements EsolveSelectFilter {
|
|
4
|
+
field: string;
|
|
5
|
+
readonly type = "multiple";
|
|
6
|
+
options: (string | number)[];
|
|
7
|
+
private values?;
|
|
8
|
+
constructor(field: string, options?: (string | number)[]);
|
|
9
|
+
setValue(values: (string | number)[]): void;
|
|
10
|
+
toHttpParams(): {
|
|
11
|
+
[x: string]: string | (string | number)[];
|
|
12
|
+
};
|
|
13
|
+
toHttpParams(http_params: HttpParams): HttpParams;
|
|
14
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HttpParams } from '@angular/common/http';
|
|
2
|
+
import { EsolveFilter } from '../interfaces';
|
|
3
|
+
export declare class EsolveRangeFilter implements EsolveFilter {
|
|
4
|
+
field: string;
|
|
5
|
+
readonly type = "range";
|
|
6
|
+
min: number;
|
|
7
|
+
max: number;
|
|
8
|
+
options: {
|
|
9
|
+
min: number;
|
|
10
|
+
max: number;
|
|
11
|
+
};
|
|
12
|
+
constructor(field: string, min?: number, max?: number);
|
|
13
|
+
setValue(min: number, max: number): void;
|
|
14
|
+
toHttpParams(): {
|
|
15
|
+
[x: string]: string | number;
|
|
16
|
+
};
|
|
17
|
+
toHttpParams(http_params: HttpParams): HttpParams;
|
|
18
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { HttpParams } from '@angular/common/http';
|
|
2
|
+
import { EsolveSelectFilter } from '../interfaces';
|
|
3
|
+
export declare class EsolveSingleSelectFilter implements EsolveSelectFilter {
|
|
4
|
+
field: string;
|
|
5
|
+
readonly type = "single";
|
|
6
|
+
options: (string | number)[];
|
|
7
|
+
private value?;
|
|
8
|
+
constructor(field: string, options: (string | number)[]);
|
|
9
|
+
constructor(field: string, value: string | number);
|
|
10
|
+
setValue(value: string | number): void;
|
|
11
|
+
toHttpParams(): {
|
|
12
|
+
[x: string]: string | number;
|
|
13
|
+
};
|
|
14
|
+
toHttpParams(http_params: HttpParams): HttpParams;
|
|
15
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { HttpParams } from '@angular/common/http';
|
|
2
|
+
import { EsolveMultipleSelectFilter, EsolveRangeFilter, EsolveSingleSelectFilter } from './classes';
|
|
3
|
+
import { EsolveFilter, EsolveFilterDefinitions } from './interfaces';
|
|
4
|
+
export declare namespace EsolveFilterFactory {
|
|
5
|
+
function createRangeWithValue(field: string, min?: number, max?: number): EsolveRangeFilter;
|
|
6
|
+
function createSingleSelectWithValue(field: string, value: string | number): EsolveSingleSelectFilter;
|
|
7
|
+
function createMultipleSelectWithValue(field: string, value: (string | number)[]): EsolveMultipleSelectFilter;
|
|
8
|
+
function covertFromObj(obj: EsolveFilterDefinitions): EsolveFilter[];
|
|
9
|
+
function convertToHttpParams(filters: EsolveFilter[]): {
|
|
10
|
+
[x: string]: string | number | (string | number)[];
|
|
11
|
+
};
|
|
12
|
+
function convertToHttpParams(filters: EsolveFilter[], http_params: HttpParams): HttpParams;
|
|
13
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { HttpParams } from '@angular/common/http';
|
|
2
|
+
import { EsolveFilterType } from '../types';
|
|
3
|
+
export interface EsolveFilter {
|
|
4
|
+
field: string;
|
|
5
|
+
readonly type: EsolveFilterType;
|
|
6
|
+
toHttpParams(): {
|
|
7
|
+
[x: string]: string | number | (string | number)[];
|
|
8
|
+
};
|
|
9
|
+
toHttpParams(http_params: HttpParams): HttpParams;
|
|
10
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from './esolve-filter-definitions.interface';
|
|
2
|
+
export * from './esolve-filter-record.interface';
|
|
3
|
+
export * from './esolve-filter.interface';
|
|
4
|
+
export * from './esolve-range-filter-record.interface';
|
|
5
|
+
export * from './esolve-select-filter-record.interface';
|
|
6
|
+
export * from './esolve-select-filter.interface';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare type EsolveRangeFilterType = 'range';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare type EsolveSelectFilterType = 'single' | 'multiple';
|
|
@@ -18,12 +18,15 @@ export declare class EsolveStockPrice {
|
|
|
18
18
|
* Price with tax and with discounts applied if applicable
|
|
19
19
|
*/
|
|
20
20
|
sell_price_with_tax: number;
|
|
21
|
+
taxed: boolean;
|
|
21
22
|
/**
|
|
22
23
|
* Create stock price instance
|
|
24
|
+
*
|
|
23
25
|
* @param base_price Price without tax
|
|
24
26
|
* @param base_price_with_tax Price with tax
|
|
25
27
|
* @param sell_price Price without tax and with discounts applied if applicable
|
|
26
28
|
* @param sell_price_with_tax Price with tax and with discounts applied if applicable
|
|
29
|
+
* @param taxed Whether tax has been applied
|
|
27
30
|
*/
|
|
28
31
|
constructor(
|
|
29
32
|
/**
|
|
@@ -41,5 +44,5 @@ export declare class EsolveStockPrice {
|
|
|
41
44
|
/**
|
|
42
45
|
* Price with tax and with discounts applied if applicable
|
|
43
46
|
*/
|
|
44
|
-
sell_price_with_tax?: number);
|
|
47
|
+
sell_price_with_tax?: number, taxed?: boolean);
|
|
45
48
|
}
|
|
@@ -2,8 +2,9 @@ import { HttpClient } from '@angular/common/http';
|
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { EsolveConnectConfig } from '../esolve-connect.config';
|
|
4
4
|
import { EsolveCustomFields } from '../shared/custom-fields';
|
|
5
|
+
import { EsolveFilterList } from '../shared/filters';
|
|
5
6
|
import { EsolveMediaStockItemList } from './types';
|
|
6
|
-
import { EsolveStockItemOptions, EsolveRecipeStockOptions, EsolveMediaStockItemOptions } from './interfaces';
|
|
7
|
+
import { EsolveStockItemOptions, EsolveRecipeStockOptions, EsolveMediaStockItemOptions, EsolveStockFilterOptions } from './interfaces';
|
|
7
8
|
import { EsolveStockItem, EsolveStockItemList, EsolveRecipeStockItem, EsolveLinkedStockItem, EsolveStockImageCollection } from './classes';
|
|
8
9
|
import * as i0 from "@angular/core";
|
|
9
10
|
export declare class EsolveStockService<T extends EsolveCustomFields = EsolveCustomFields> {
|
|
@@ -52,6 +53,7 @@ export declare class EsolveStockService<T extends EsolveCustomFields = EsolveCus
|
|
|
52
53
|
* @param code Stock item code
|
|
53
54
|
*/
|
|
54
55
|
getStockImageCollection(code: string): Observable<EsolveStockImageCollection>;
|
|
56
|
+
getStockFilters(options: EsolveStockFilterOptions): Observable<EsolveFilterList>;
|
|
55
57
|
/**
|
|
56
58
|
* Processes the eSolve stock item record and converts it to an object.
|
|
57
59
|
*
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { EsolveFilter, EsolveFilterDefinitions } from '../../shared/filters';
|
|
1
2
|
import { EsolveSort } from '../../shared/sort';
|
|
2
3
|
import { EsolveStockSortField } from '../types';
|
|
3
4
|
export interface EsolveStockItemOptions {
|
|
@@ -14,4 +15,8 @@ export interface EsolveStockItemOptions {
|
|
|
14
15
|
search_phrase?: string;
|
|
15
16
|
specials_id?: number;
|
|
16
17
|
sort?: EsolveSort<EsolveStockSortField>;
|
|
18
|
+
/**
|
|
19
|
+
* Use an actual list of filter objects OR using a filter definition object
|
|
20
|
+
*/
|
|
21
|
+
filters?: EsolveFilter[] | EsolveFilterDefinitions;
|
|
17
22
|
}
|
|
@@ -4,6 +4,7 @@ export * from './esolve-stock-base-record.interface';
|
|
|
4
4
|
export * from './esolve-stock-item-options.interface';
|
|
5
5
|
export * from './esolve-stock-badge-record.interface';
|
|
6
6
|
export * from './esolve-recipe-item-record.interface';
|
|
7
|
+
export * from './esolve-stock-filter-options.interface';
|
|
7
8
|
export * from './esolve-recipe-stock-options.interface';
|
|
8
9
|
export * from './esolve-linked-stock-record.interface';
|
|
9
10
|
export * from './esolve-stock-group-item-record.interface';
|
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export * from './lib/shared/esolve-list.model';
|
|
|
5
5
|
export * from './lib/shared/esolve-result.model';
|
|
6
6
|
export * from './lib/shared/esolve-url-target.type';
|
|
7
7
|
export * from './lib/shared/custom-fields';
|
|
8
|
+
export * from './lib/shared/filters';
|
|
8
9
|
export * from './lib/shared/response';
|
|
9
10
|
export * from './lib/shared/errors';
|
|
10
11
|
export * from './lib/shared/cookie/esolve-cookie.service';
|