@esolve/ng-esolve-connect 0.140.0 → 0.142.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.
|
@@ -36,6 +36,10 @@ class EsolveConfigService {
|
|
|
36
36
|
this.cdn = this.config.cdn;
|
|
37
37
|
this.ftg_cdn = this.config.ftg_cdn;
|
|
38
38
|
this.error_image_path = this.config.error_image_path;
|
|
39
|
+
// Search API settings
|
|
40
|
+
this.search_api_url = this.config.search_api_url ?? '';
|
|
41
|
+
this.search_api_signature = this.config.search_api_signature ?? '';
|
|
42
|
+
this.search_api_public_key = this.config.search_api_public_key ?? '';
|
|
39
43
|
if (this.api_url === '' || this.wsid === '') {
|
|
40
44
|
throw new Error('Invalid eSolve Eurus config');
|
|
41
45
|
}
|
|
@@ -1409,6 +1413,10 @@ class EsolveStockItemBase {
|
|
|
1409
1413
|
* Material id
|
|
1410
1414
|
*/
|
|
1411
1415
|
this.type_of_material_id = 0;
|
|
1416
|
+
/**
|
|
1417
|
+
* Item author
|
|
1418
|
+
*/
|
|
1419
|
+
this.author = '';
|
|
1412
1420
|
/**
|
|
1413
1421
|
* Image filename
|
|
1414
1422
|
*/
|
|
@@ -1439,6 +1447,7 @@ class EsolveStockItemBase {
|
|
|
1439
1447
|
this.extended_description = record.extended_description ?? '';
|
|
1440
1448
|
this.image_name = record.image_name ?? '';
|
|
1441
1449
|
this.image_last_modified = record.image_last_modified ?? '';
|
|
1450
|
+
this.author = record.author ?? '';
|
|
1442
1451
|
this.category_id = record.category_id ?? '';
|
|
1443
1452
|
this.subcategory_id = +(record.subcategory_id ?? 0);
|
|
1444
1453
|
this.manufacturers_id = +(record.manufacturers_id ?? 0);
|
|
@@ -2791,6 +2800,117 @@ class EsolveCartItem {
|
|
|
2791
2800
|
}
|
|
2792
2801
|
}
|
|
2793
2802
|
|
|
2803
|
+
/**
|
|
2804
|
+
* One item that makes up a promotion, with progress toward qualifying.
|
|
2805
|
+
*/
|
|
2806
|
+
class EsolveCartPromotionProgressQualifyingItem {
|
|
2807
|
+
constructor(record) {
|
|
2808
|
+
this.type = 'code';
|
|
2809
|
+
/**
|
|
2810
|
+
* The raw identifier: stock `code` (string), `subcategory_id` (int),
|
|
2811
|
+
* `category_id` (string), or `null` for `everything`.
|
|
2812
|
+
*/
|
|
2813
|
+
this.value = null;
|
|
2814
|
+
this.required = 0;
|
|
2815
|
+
this.qualifying = 0;
|
|
2816
|
+
this.remaining = 0;
|
|
2817
|
+
/**
|
|
2818
|
+
* `true` when this item's `remaining` is `0` (the cart has enough of it).
|
|
2819
|
+
*/
|
|
2820
|
+
this.completed = false;
|
|
2821
|
+
if (!record) {
|
|
2822
|
+
return;
|
|
2823
|
+
}
|
|
2824
|
+
this.type = record.type ?? 'code';
|
|
2825
|
+
this.value = record.value ?? null;
|
|
2826
|
+
this.required = +(record.required ?? 0);
|
|
2827
|
+
this.qualifying = +(record.qualifying ?? 0);
|
|
2828
|
+
this.remaining = +(record.remaining ?? 0);
|
|
2829
|
+
this.completed = record.completed ?? false;
|
|
2830
|
+
}
|
|
2831
|
+
}
|
|
2832
|
+
|
|
2833
|
+
/**
|
|
2834
|
+
* One active promotion the cart has not yet qualified for, with progress
|
|
2835
|
+
* toward qualifying (returned by `get-cart-promotion-progress`).
|
|
2836
|
+
*/
|
|
2837
|
+
class EsolveCartPromotionProgressItem {
|
|
2838
|
+
constructor(record) {
|
|
2839
|
+
/**
|
|
2840
|
+
* How the remaining items relate to completing the promotion.
|
|
2841
|
+
*/
|
|
2842
|
+
this.mode = 'qty';
|
|
2843
|
+
/**
|
|
2844
|
+
* Engine discount type the record originated from: `1` = code,
|
|
2845
|
+
* `2` = subcategory, `3` = everything, `4` = category, `5` = group/"any-of".
|
|
2846
|
+
*/
|
|
2847
|
+
this.type = 0;
|
|
2848
|
+
/**
|
|
2849
|
+
* Linked special ID (`0` if the discount is not tied to a special).
|
|
2850
|
+
*/
|
|
2851
|
+
this.specials_id = 0;
|
|
2852
|
+
/**
|
|
2853
|
+
* Discount ID (`0` for group promotions, which are tracked per special).
|
|
2854
|
+
*/
|
|
2855
|
+
this.discount_id = 0;
|
|
2856
|
+
/**
|
|
2857
|
+
* Headline quantity required.
|
|
2858
|
+
*/
|
|
2859
|
+
this.required = 0;
|
|
2860
|
+
/**
|
|
2861
|
+
* Headline quantity the cart already has toward `required`.
|
|
2862
|
+
*/
|
|
2863
|
+
this.qualifying = 0;
|
|
2864
|
+
/**
|
|
2865
|
+
* Headline quantity still needed (`required − qualifying`).
|
|
2866
|
+
*/
|
|
2867
|
+
this.remaining = 0;
|
|
2868
|
+
/**
|
|
2869
|
+
* Items that make up the promotion. Authoritative.
|
|
2870
|
+
*/
|
|
2871
|
+
this.qualifying_items = [];
|
|
2872
|
+
/**
|
|
2873
|
+
* Configured discount percentage that applies once qualified
|
|
2874
|
+
* (meaningful when `discount_type` is `"percentage"`).
|
|
2875
|
+
*/
|
|
2876
|
+
this.discount = 0;
|
|
2877
|
+
/**
|
|
2878
|
+
* Configured fixed discounted price (excluding tax) that applies once
|
|
2879
|
+
* qualified (meaningful when `discount_type` is `"price"`).
|
|
2880
|
+
*/
|
|
2881
|
+
this.discounted_price = 0;
|
|
2882
|
+
this.discount_type = 'none';
|
|
2883
|
+
/**
|
|
2884
|
+
* Default, ready-to-show reward text. Contains no currency symbol.
|
|
2885
|
+
*/
|
|
2886
|
+
this.offer = '';
|
|
2887
|
+
/**
|
|
2888
|
+
* Default, ready-to-show indicator text (the "what to add" nudge).
|
|
2889
|
+
*/
|
|
2890
|
+
this.message = '';
|
|
2891
|
+
if (!record) {
|
|
2892
|
+
return;
|
|
2893
|
+
}
|
|
2894
|
+
this.mode = record.mode ?? 'qty';
|
|
2895
|
+
this.type = +(record.type ?? 0);
|
|
2896
|
+
this.specials_id = +(record.specials_id ?? 0);
|
|
2897
|
+
this.discount_id = +(record.discount_id ?? 0);
|
|
2898
|
+
this.required = +(record.required ?? 0);
|
|
2899
|
+
this.qualifying = +(record.qualifying ?? 0);
|
|
2900
|
+
this.remaining = +(record.remaining ?? 0);
|
|
2901
|
+
this.discount = +(record.discount ?? 0);
|
|
2902
|
+
this.discounted_price = +(record.discounted_price ?? 0);
|
|
2903
|
+
this.discount_type = record.discount_type ?? 'none';
|
|
2904
|
+
this.offer = record.offer ?? '';
|
|
2905
|
+
this.message = record.message ?? '';
|
|
2906
|
+
if (record.qualifying_items) {
|
|
2907
|
+
for (const qualifying_item of record.qualifying_items) {
|
|
2908
|
+
this.qualifying_items.push(new EsolveCartPromotionProgressQualifyingItem(qualifying_item));
|
|
2909
|
+
}
|
|
2910
|
+
}
|
|
2911
|
+
}
|
|
2912
|
+
}
|
|
2913
|
+
|
|
2794
2914
|
class EsolveCartTaxBreakdown {
|
|
2795
2915
|
constructor() {
|
|
2796
2916
|
this.goods = 0;
|
|
@@ -3915,6 +4035,28 @@ class EsolveCartService {
|
|
|
3915
4035
|
return this.processCartAlternatives(response.records);
|
|
3916
4036
|
}));
|
|
3917
4037
|
}
|
|
4038
|
+
/**
|
|
4039
|
+
* Retrieves the active promotions the cart has not yet qualified for, with a
|
|
4040
|
+
* ready-to-display indicator message and the structured data behind it.
|
|
4041
|
+
*
|
|
4042
|
+
* The endpoint is read-only — it never applies discounts and never writes to
|
|
4043
|
+
* the cart. Call it whenever the cart changes (the same trigger used for
|
|
4044
|
+
* `getCart` / `getTotals`). A `no_records` soft-error (`records: []`) means
|
|
4045
|
+
* there is nothing to display — not a real failure — and resolves to an
|
|
4046
|
+
* empty array.
|
|
4047
|
+
*
|
|
4048
|
+
* @returns An `Observable` with an array of promotion progress entries
|
|
4049
|
+
*/
|
|
4050
|
+
getCartPromotionProgress() {
|
|
4051
|
+
return this.http
|
|
4052
|
+
.get(`${this.config.api_url}/get-cart-promotion-progress.php`)
|
|
4053
|
+
.pipe(map((response) => {
|
|
4054
|
+
if (response.records === undefined) {
|
|
4055
|
+
throw response;
|
|
4056
|
+
}
|
|
4057
|
+
return this.processCartPromotionProgress(response.records);
|
|
4058
|
+
}));
|
|
4059
|
+
}
|
|
3918
4060
|
/**
|
|
3919
4061
|
* Set an alternative stock item to current cart item
|
|
3920
4062
|
*
|
|
@@ -3994,6 +4136,21 @@ class EsolveCartService {
|
|
|
3994
4136
|
processCartTotals(record) {
|
|
3995
4137
|
return new EsolveCartTotals(record);
|
|
3996
4138
|
}
|
|
4139
|
+
/**
|
|
4140
|
+
* Processes the eSolve cart promotion progress records
|
|
4141
|
+
*
|
|
4142
|
+
* @param records Records to process
|
|
4143
|
+
* @returns An array of processed promotion progress entries
|
|
4144
|
+
*/
|
|
4145
|
+
processCartPromotionProgress(records) {
|
|
4146
|
+
const progress = [];
|
|
4147
|
+
if (records) {
|
|
4148
|
+
for (const record of records) {
|
|
4149
|
+
progress.push(new EsolveCartPromotionProgressItem(record));
|
|
4150
|
+
}
|
|
4151
|
+
}
|
|
4152
|
+
return progress;
|
|
4153
|
+
}
|
|
3997
4154
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: EsolveCartService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3998
4155
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: EsolveCartService, providedIn: 'root' }); }
|
|
3999
4156
|
}
|
|
@@ -5206,6 +5363,7 @@ class EsolveAsset {
|
|
|
5206
5363
|
this.sort_priority = 0;
|
|
5207
5364
|
this.topics = [];
|
|
5208
5365
|
this.tags = [];
|
|
5366
|
+
this.url = '';
|
|
5209
5367
|
this.image_name = '';
|
|
5210
5368
|
this.id = +record.id;
|
|
5211
5369
|
this.src = record.src;
|
|
@@ -5219,6 +5377,7 @@ class EsolveAsset {
|
|
|
5219
5377
|
this.asset_sub_category = record.asset_sub_category ?? '';
|
|
5220
5378
|
this.sort_priority = +(record.sort_priority ?? '');
|
|
5221
5379
|
this.image_name = record.image_name ?? '';
|
|
5380
|
+
this.url = record.url ?? '';
|
|
5222
5381
|
if (record.created) {
|
|
5223
5382
|
this.created = record.created;
|
|
5224
5383
|
}
|
|
@@ -7351,7 +7510,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
|
|
|
7351
7510
|
}], ctorParameters: () => [] });
|
|
7352
7511
|
|
|
7353
7512
|
class EsolveBanner {
|
|
7354
|
-
constructor(id, banner_display_container, identifier, type, title, sub_title, catch_phrase, background_colour, button_caption, article, sort_priority, link, images) {
|
|
7513
|
+
constructor(id, banner_display_container, identifier, type, title, sub_title, catch_phrase, background_colour, button_caption, article, sort_priority, link, images, videos = []) {
|
|
7355
7514
|
this.id = id;
|
|
7356
7515
|
this.banner_display_container = banner_display_container;
|
|
7357
7516
|
this.identifier = identifier;
|
|
@@ -7364,9 +7523,11 @@ class EsolveBanner {
|
|
|
7364
7523
|
this.article = article;
|
|
7365
7524
|
this.sort_priority = sort_priority;
|
|
7366
7525
|
this.link = link;
|
|
7526
|
+
this.videos = videos;
|
|
7367
7527
|
this.desktop_images = [];
|
|
7368
7528
|
this.mobile_images = [];
|
|
7369
7529
|
this.sub_images = [];
|
|
7530
|
+
this.video_posters = [];
|
|
7370
7531
|
if (images.desktop) {
|
|
7371
7532
|
this.desktop_images = images.desktop;
|
|
7372
7533
|
}
|
|
@@ -7376,6 +7537,9 @@ class EsolveBanner {
|
|
|
7376
7537
|
if (images.sub) {
|
|
7377
7538
|
this.sub_images = images.sub;
|
|
7378
7539
|
}
|
|
7540
|
+
if (images.video_poster) {
|
|
7541
|
+
this.video_posters = images.video_poster;
|
|
7542
|
+
}
|
|
7379
7543
|
}
|
|
7380
7544
|
}
|
|
7381
7545
|
|
|
@@ -7402,6 +7566,20 @@ class EsolveBannerImageHotspot {
|
|
|
7402
7566
|
}
|
|
7403
7567
|
}
|
|
7404
7568
|
|
|
7569
|
+
class EsolveBannerVideo {
|
|
7570
|
+
constructor(record) {
|
|
7571
|
+
this.id = 0;
|
|
7572
|
+
this.filename = '';
|
|
7573
|
+
if (record) {
|
|
7574
|
+
this.id = +record.id;
|
|
7575
|
+
this.filename = record.filename;
|
|
7576
|
+
}
|
|
7577
|
+
}
|
|
7578
|
+
get src() {
|
|
7579
|
+
return '/videos/banners/' + this.filename;
|
|
7580
|
+
}
|
|
7581
|
+
}
|
|
7582
|
+
|
|
7405
7583
|
class EsolveBannerService {
|
|
7406
7584
|
constructor() {
|
|
7407
7585
|
this.config = inject(EsolveConfigService);
|
|
@@ -7467,6 +7645,7 @@ class EsolveBannerService {
|
|
|
7467
7645
|
if (records && records.length > 0) {
|
|
7468
7646
|
for (const record of records) {
|
|
7469
7647
|
const image_sets = {};
|
|
7648
|
+
const videos = [];
|
|
7470
7649
|
if (record.images.desktop) {
|
|
7471
7650
|
image_sets.desktop = this.processBannerImages(record.images.desktop, record.type);
|
|
7472
7651
|
}
|
|
@@ -7476,10 +7655,18 @@ class EsolveBannerService {
|
|
|
7476
7655
|
if (record.images.sub) {
|
|
7477
7656
|
image_sets.sub = this.processBannerImages(record.images.sub, record.type);
|
|
7478
7657
|
}
|
|
7658
|
+
if (record.images.video_poster) {
|
|
7659
|
+
image_sets.video_poster = this.processBannerImages(record.images.video_poster, record.type);
|
|
7660
|
+
}
|
|
7661
|
+
if (record.images.video && record.images.video.length > 0) {
|
|
7662
|
+
for (const video of record.images.video) {
|
|
7663
|
+
videos.push(new EsolveBannerVideo(video));
|
|
7664
|
+
}
|
|
7665
|
+
}
|
|
7479
7666
|
const banner = new EsolveBanner(+record.id, record.banner_display_container, record.identifier, record.type, record.title, record.sub_title, record.catch_phrase, record.background_colour, record.button_caption, record.article, +record.sort_priority, {
|
|
7480
7667
|
url: record.link.url,
|
|
7481
7668
|
target: record.link.target,
|
|
7482
|
-
}, image_sets);
|
|
7669
|
+
}, image_sets, videos);
|
|
7483
7670
|
banners.push(banner);
|
|
7484
7671
|
}
|
|
7485
7672
|
}
|
|
@@ -10546,6 +10733,230 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
|
|
|
10546
10733
|
}]
|
|
10547
10734
|
}] });
|
|
10548
10735
|
|
|
10736
|
+
class EsolveSearchCleanResult {
|
|
10737
|
+
constructor(response) {
|
|
10738
|
+
this.original_query = response.original_query;
|
|
10739
|
+
this.cleaned_query = response.cleaned_query;
|
|
10740
|
+
}
|
|
10741
|
+
}
|
|
10742
|
+
|
|
10743
|
+
class EsolveSearchResultItem {
|
|
10744
|
+
constructor(record) {
|
|
10745
|
+
this.code = record.code;
|
|
10746
|
+
this.slug = record.slug;
|
|
10747
|
+
this.name = record.name;
|
|
10748
|
+
this.brand = record.brand;
|
|
10749
|
+
this.category = record.category;
|
|
10750
|
+
this.type = record.type;
|
|
10751
|
+
this.key_words = record.key_words;
|
|
10752
|
+
this.description = record.description;
|
|
10753
|
+
this.score = record.score;
|
|
10754
|
+
}
|
|
10755
|
+
}
|
|
10756
|
+
|
|
10757
|
+
class EsolveSearchResult {
|
|
10758
|
+
constructor(response) {
|
|
10759
|
+
this.original_query = response.original_query;
|
|
10760
|
+
this.cleaned_query = response.cleaned_query;
|
|
10761
|
+
this.text_response = response.text_response;
|
|
10762
|
+
// API returns results as an object/map, convert to array
|
|
10763
|
+
const resultsObj = response.results;
|
|
10764
|
+
if (resultsObj && typeof resultsObj === 'object') {
|
|
10765
|
+
this.results = Object.values(resultsObj).map((record) => new EsolveSearchResultItem(record));
|
|
10766
|
+
}
|
|
10767
|
+
else {
|
|
10768
|
+
this.results = [];
|
|
10769
|
+
}
|
|
10770
|
+
}
|
|
10771
|
+
}
|
|
10772
|
+
|
|
10773
|
+
class EsolveSearchVectorizeResult {
|
|
10774
|
+
constructor(response) {
|
|
10775
|
+
this.success = response.success;
|
|
10776
|
+
this.queue_id = response.queue_id;
|
|
10777
|
+
this.status = response.status;
|
|
10778
|
+
this.message = response.message;
|
|
10779
|
+
}
|
|
10780
|
+
}
|
|
10781
|
+
|
|
10782
|
+
class EsolveSearchService {
|
|
10783
|
+
constructor() {
|
|
10784
|
+
this.config = inject(EsolveConfigService);
|
|
10785
|
+
this.http = inject(HttpClient);
|
|
10786
|
+
// Authentication state
|
|
10787
|
+
this.auth_public_key = signal(this.config.search_api_public_key ?? '', ...(ngDevMode ? [{ debugName: "auth_public_key" }] : []));
|
|
10788
|
+
this.auth_signature = signal(this.config.search_api_signature ?? '', ...(ngDevMode ? [{ debugName: "auth_signature" }] : []));
|
|
10789
|
+
this.is_authenticating = signal(false, ...(ngDevMode ? [{ debugName: "is_authenticating" }] : []));
|
|
10790
|
+
}
|
|
10791
|
+
// Get search API URL from config or use default
|
|
10792
|
+
get searchApiUrl() {
|
|
10793
|
+
if ((this.config.search_api_url === undefined) || this.config.search_api_url === null) {
|
|
10794
|
+
throw new Error("Search API URL is required");
|
|
10795
|
+
}
|
|
10796
|
+
return this.config.search_api_url;
|
|
10797
|
+
}
|
|
10798
|
+
/**
|
|
10799
|
+
* Check current authentication status with the server using the signature and public_key
|
|
10800
|
+
*
|
|
10801
|
+
* @returns Observable with auth status, or null if not authenticated
|
|
10802
|
+
*/
|
|
10803
|
+
checkAuthStatus() {
|
|
10804
|
+
const token = this.auth_public_key();
|
|
10805
|
+
if (!token) {
|
|
10806
|
+
return of(null);
|
|
10807
|
+
}
|
|
10808
|
+
return this.http
|
|
10809
|
+
.get(`${this.searchApiUrl}/v1/auth/status`, {
|
|
10810
|
+
headers: new HttpHeaders({
|
|
10811
|
+
Authorization: `Bearer ${token}`,
|
|
10812
|
+
}),
|
|
10813
|
+
})
|
|
10814
|
+
.pipe(catchError$1(() => {
|
|
10815
|
+
// Token invalid, clear it
|
|
10816
|
+
this.auth_public_key.set('');
|
|
10817
|
+
return of(null);
|
|
10818
|
+
}));
|
|
10819
|
+
}
|
|
10820
|
+
/**
|
|
10821
|
+
* Clean and normalize a search query using the Search API
|
|
10822
|
+
*
|
|
10823
|
+
* @param query Raw user query string
|
|
10824
|
+
* @returns Observable with original and cleaned query
|
|
10825
|
+
*/
|
|
10826
|
+
cleanQuery(query) {
|
|
10827
|
+
const public_key = this.auth_public_key();
|
|
10828
|
+
const signature = this.auth_signature();
|
|
10829
|
+
if (!public_key || !signature) {
|
|
10830
|
+
return of(null);
|
|
10831
|
+
}
|
|
10832
|
+
const params = new HttpParams().set('query', query);
|
|
10833
|
+
return this.http.get(`${this.searchApiUrl}/v1/chat/clean`, {
|
|
10834
|
+
params,
|
|
10835
|
+
headers: new HttpHeaders({
|
|
10836
|
+
'Authorization': `Signature ${signature}`,
|
|
10837
|
+
'X-Public-Key': `${public_key}`,
|
|
10838
|
+
}),
|
|
10839
|
+
}).pipe(map$1((response) => new EsolveSearchCleanResult(response)));
|
|
10840
|
+
}
|
|
10841
|
+
/**
|
|
10842
|
+
* Perform semantic search using vector embeddings
|
|
10843
|
+
*
|
|
10844
|
+
* @param cleaned_query Cleaned/normalized query string
|
|
10845
|
+
* @param original_query Optional original query for reference
|
|
10846
|
+
* @param limit Maximum number of results to return (default: 10)
|
|
10847
|
+
* @param score_threshold Minimum relevance score threshold (default: 0.1)
|
|
10848
|
+
* @returns Observable with search results
|
|
10849
|
+
*/
|
|
10850
|
+
search(cleaned_query, original_query, limit = 10, score_threshold = 0.1) {
|
|
10851
|
+
const public_key = this.auth_public_key();
|
|
10852
|
+
const signature = this.auth_signature();
|
|
10853
|
+
if (!public_key || !signature) {
|
|
10854
|
+
return of(null);
|
|
10855
|
+
}
|
|
10856
|
+
const body = {
|
|
10857
|
+
cleaned_query,
|
|
10858
|
+
original_query,
|
|
10859
|
+
limit,
|
|
10860
|
+
score_threshold,
|
|
10861
|
+
};
|
|
10862
|
+
return this.http.post(`${this.searchApiUrl}/v1/data/search`, body, {
|
|
10863
|
+
headers: new HttpHeaders({
|
|
10864
|
+
'Content-Type': 'application/json',
|
|
10865
|
+
'Authorization': `Signature ${signature}`,
|
|
10866
|
+
'X-Public-Key': `${public_key}`,
|
|
10867
|
+
}),
|
|
10868
|
+
}).pipe(map$1((response) => {
|
|
10869
|
+
return new EsolveSearchResult(response);
|
|
10870
|
+
}));
|
|
10871
|
+
}
|
|
10872
|
+
/**
|
|
10873
|
+
* Queue items for vectorization (embedding generation)
|
|
10874
|
+
*
|
|
10875
|
+
* @param items Array of items to vectorize
|
|
10876
|
+
* @returns Observable with vectorization queue status
|
|
10877
|
+
*/
|
|
10878
|
+
vectorize() {
|
|
10879
|
+
const public_key = this.auth_public_key();
|
|
10880
|
+
const signature = this.auth_signature();
|
|
10881
|
+
if (!public_key || !signature) {
|
|
10882
|
+
return of(null);
|
|
10883
|
+
}
|
|
10884
|
+
const url = this.config.site_url;
|
|
10885
|
+
const body = { url };
|
|
10886
|
+
return this.http.post(`${this.searchApiUrl}/v1/data/vectorize`, body, {
|
|
10887
|
+
headers: new HttpHeaders({
|
|
10888
|
+
'Content-Type': 'application/json',
|
|
10889
|
+
'Authorization': `Signature ${signature}`,
|
|
10890
|
+
'X-Public-Key': `${public_key}`,
|
|
10891
|
+
}),
|
|
10892
|
+
}).pipe(map$1((response) => new EsolveSearchVectorizeResult(response)));
|
|
10893
|
+
}
|
|
10894
|
+
/**
|
|
10895
|
+
* Retrieve paginated list of vectorized items
|
|
10896
|
+
*
|
|
10897
|
+
* @param page Page number (0-indexed, default: 0)
|
|
10898
|
+
* @param limit Items per page (default: 20)
|
|
10899
|
+
* @param sort Field to sort by (default: 'vectorize_items_id')
|
|
10900
|
+
* @param order Sort order 'ASC' or 'DESC' (default: 'ASC')
|
|
10901
|
+
* @returns Observable with vectorized items
|
|
10902
|
+
*/
|
|
10903
|
+
getVectorizedItems(page = 0, limit = 20, sort = 'vectorize_items_id', order = 'ASC') {
|
|
10904
|
+
const public_key = this.auth_public_key();
|
|
10905
|
+
const signature = this.auth_signature();
|
|
10906
|
+
if (!public_key || !signature) {
|
|
10907
|
+
return of(null);
|
|
10908
|
+
}
|
|
10909
|
+
const params = new HttpParams()
|
|
10910
|
+
.set('page', page)
|
|
10911
|
+
.set('limit', limit)
|
|
10912
|
+
.set('sort', sort)
|
|
10913
|
+
.set('order', order);
|
|
10914
|
+
return this.http.get(`${this.searchApiUrl}/v1/data/get`, {
|
|
10915
|
+
params,
|
|
10916
|
+
headers: new HttpHeaders({
|
|
10917
|
+
'Authorization': `Signature ${signature}`,
|
|
10918
|
+
'X-Public-Key': `${public_key}`,
|
|
10919
|
+
}),
|
|
10920
|
+
});
|
|
10921
|
+
}
|
|
10922
|
+
/**
|
|
10923
|
+
* Retrieve billing totals grouped by event type
|
|
10924
|
+
*
|
|
10925
|
+
* @param start_date Start date (YYYY-MM-DD)
|
|
10926
|
+
* @param end_date End date (YYYY-MM-DD)
|
|
10927
|
+
* @param ws_id Optional workspace filter
|
|
10928
|
+
* @returns Observable with billing totals
|
|
10929
|
+
*/
|
|
10930
|
+
getBilling(start_date, end_date, ws_id) {
|
|
10931
|
+
const public_key = this.auth_public_key();
|
|
10932
|
+
const signature = this.auth_signature();
|
|
10933
|
+
if (!public_key || !signature) {
|
|
10934
|
+
return of(null);
|
|
10935
|
+
}
|
|
10936
|
+
let params = new HttpParams()
|
|
10937
|
+
.set('start_date', start_date)
|
|
10938
|
+
.set('end_date', end_date);
|
|
10939
|
+
if (ws_id) {
|
|
10940
|
+
params = params.set('ws_id', ws_id);
|
|
10941
|
+
}
|
|
10942
|
+
return this.http.get(`${this.searchApiUrl}/v1/billing`, {
|
|
10943
|
+
params,
|
|
10944
|
+
headers: new HttpHeaders({
|
|
10945
|
+
'Authorization': `Signature ${signature}`,
|
|
10946
|
+
'X-Public-Key': `${public_key}`,
|
|
10947
|
+
}),
|
|
10948
|
+
});
|
|
10949
|
+
}
|
|
10950
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: EsolveSearchService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
10951
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: EsolveSearchService, providedIn: 'root' }); }
|
|
10952
|
+
}
|
|
10953
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: EsolveSearchService, decorators: [{
|
|
10954
|
+
type: Injectable,
|
|
10955
|
+
args: [{
|
|
10956
|
+
providedIn: 'root',
|
|
10957
|
+
}]
|
|
10958
|
+
}] });
|
|
10959
|
+
|
|
10549
10960
|
class EsolveSettings {
|
|
10550
10961
|
constructor(record) {
|
|
10551
10962
|
this.site_url = '';
|
|
@@ -10596,5 +11007,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
|
|
|
10596
11007
|
* Generated bundle index. Do not edit.
|
|
10597
11008
|
*/
|
|
10598
11009
|
|
|
10599
|
-
export { ESOLVE_CONNECT_CONFIG, ESOLVE_EURUS_AUTO_LOGIN, EsolveAccountConfirmationResult, EsolveAccountPayment, EsolveAccountService, EsolveAdditionalStockImage, EsolveAddress, EsolveAddressResult, EsolveAffiliate, EsolveAffiliateCheckResult, EsolveAffiliateLinkResult, EsolveAffiliateService, EsolveAlbum, EsolveAlbumImage, EsolveAlbumImageList, EsolveAlbumList, EsolveAlbumsService, EsolveAsset, EsolveAssetsService, EsolveAuthService, EsolveBankingDetails, EsolveBanner, EsolveBannerImage, EsolveBannerImageHotspot, EsolveBannerService, EsolveCaptcha, EsolveCaptchaService, EsolveCareer, EsolveCareersService, EsolveCartAlternative, EsolveCartErrorHandlerService, EsolveCartItem, EsolveCartItemError, EsolveCartService, EsolveCartStockItem, EsolveCartTaxBreakdown, EsolveCartTotals, EsolveCategoryTreeItem, EsolveCategoryTreeService, EsolveCdnSrcDirective, EsolveChangePasswordResult, EsolveCheckoutResult, EsolveClientAsset, EsolveClientAssetList, EsolveColour, EsolveColoursService, EsolveCompetition, EsolveCompetitionDates, EsolveCompetitionEntryResult, EsolveCompetitionWinner, EsolveCompetitionsService, EsolveConfigService, EsolveCookieService, EsolveCountry, EsolveCountryService, EsolveCoupon, EsolveCouponsService, EsolveDeliveriesService, EsolveDelivery, EsolveDeliveryCategoryTotals, EsolveDeliveryList, EsolveDeliveryStatus, EsolveDependantItem, EsolveDeviceService, EsolveEmptyCartResult, EsolveEmptyWishlistResult, EsolveEnquiryResult, EsolveEnquiryService, EsolveErpDocumentRequest, EsolveErpDocumentsRequestResult, EsolveErrorHandlerService, EsolveEvent, EsolveEventTargetService, EsolveEventType, EsolveFilterFactory, EsolveGenericFilter, EsolveGeocodeAddressResult, EsolveGeocodeCoordsResult, EsolveGeocodeResult, EsolveGeocoderService, EsolveHttpError, EsolveLinkedAsset, EsolveLinkedStockItem, EsolveList, EsolveLocation, EsolveLocationAddress, EsolveLocationContactInfo, EsolveLocationGEO, EsolveLocationList, EsolveLocationPOBoxAddress, EsolveLocationTradingDay, EsolveLocationTradingTimes, EsolveLocationUpdateResult, EsolveLocationsService, EsolveManufacturer, EsolveManufacturersService, EsolveMaterial, EsolveMaterialsService, EsolveMediaStockItem, EsolveMenuItem, EsolveMenuService, EsolveMultipleSelectFilter, EsolveNewsArticle, EsolveNewsArticleAuthor, EsolveNewsArticleList, EsolveNewsGroup, EsolveNewsService, EsolveNewsletterResult, EsolveNotificationButtonAction, EsolveNotificationDates, EsolveNotificationsService, EsolveOtp, EsolveOtpService, EsolveOtpValidation, EsolvePaymentMethod, EsolvePaymentResult, EsolvePaymentService, EsolveRange, EsolveRangeFilter, EsolveRangesService, EsolveRecipeStockItem, EsolveRegistrationResult, EsolveResetPasswordResult, EsolveResponseHandlerService, EsolveResponseResult, EsolveResult, EsolveReview, EsolveReviewList, EsolveReviewResult, EsolveReviewsService, EsolveSeoInfo, EsolveSeoService, EsolveSessionAddressUpdateResult, EsolveSessionClientUpdateResult, EsolveSessionMetadataService, EsolveSessionService, EsolveSessionShippingUpdateResult, EsolveSetDeviceResult, EsolveSetNotifyResult, EsolveSettings, EsolveSettingsService, EsolveShippingCost, EsolveShippingCostItem, EsolveShippingMethod, EsolveShippingService, EsolveShippingTotals, EsolveSingleSelectFilter, EsolveSpecial, EsolveSpecialDates, EsolveSpecialImage, EsolveSpecialImageCollection, EsolveSpecialsService, EsolveStatement, EsolveStatementAgeing, EsolveStatementBalances, EsolveStatementTransaction, EsolveStockBadge, EsolveStockBarcode, EsolveStockGroup, EsolveStockGroupItem, EsolveStockImage, EsolveStockImageCollection, EsolveStockItem, EsolveStockItemBase, EsolveStockItemList, EsolveStockItemLocationLevel, EsolveStockLeadTimes, EsolveStockPrice, EsolveStockReviewsReport, EsolveStockService, EsolveStockTransactionSales, EsolveSuggestedStockItem, EsolveSupplier, EsolveSuppliersService, EsolveSystemNotification, EsolveSystemNotificationType, EsolveTag, EsolveTagsService, EsolveTimeSlot, EsolveTimeSlotConfig, EsolveTimeSlotDate, EsolveTimeSlotDays, EsolveTimeSlotTimes, EsolveToggleFilter, EsolveTopic, EsolveTopicService, EsolveTransaction, EsolveTransactionAddress, EsolveTransactionAnalyticsData, EsolveTransactionApprovalResult, EsolveTransactionClient, EsolveTransactionDelivery, EsolveTransactionItem, EsolveTransactionItemPrice, EsolveTransactionList, EsolveTransactionLocation, EsolveTransactionPaymentMethod, EsolveTransactionPick, EsolveTransactionShippingMethod, EsolveTransactionTimeSlot, EsolveTransactionUser, EsolveTransactionsService, EsolveUserAccount, EsolveUserAccountBusiness, EsolveUserAccountContact, EsolveUserAccountResult, EsolveUserClientAccount, EsolveUserClientAccountBalances, EsolveUserDevice, EsolveVaultItem, EsolveVaultItemResult, EsolveVoucher, EsolveVouchersService, EsolveWalletBalances, EsolveWalletService, EsolveWalletTransaction, EsolveWalletTransactionsList, EsolveWishlistItem, EsolveWishlistService, NgEsolveConnectModule, esolveAuthInterceptor, esolveHexHash, esolveUnauthorizedErrorInterceptor, isEsolveCdnPath, isFtgCdnPath, isLegacyEsolveCdnPath, processEsolveImageSrc, provideEsolveImageLoader, provideNgEsolveConnect };
|
|
11010
|
+
export { ESOLVE_CONNECT_CONFIG, ESOLVE_EURUS_AUTO_LOGIN, EsolveAccountConfirmationResult, EsolveAccountPayment, EsolveAccountService, EsolveAdditionalStockImage, EsolveAddress, EsolveAddressResult, EsolveAffiliate, EsolveAffiliateCheckResult, EsolveAffiliateLinkResult, EsolveAffiliateService, EsolveAlbum, EsolveAlbumImage, EsolveAlbumImageList, EsolveAlbumList, EsolveAlbumsService, EsolveAsset, EsolveAssetsService, EsolveAuthService, EsolveBankingDetails, EsolveBanner, EsolveBannerImage, EsolveBannerImageHotspot, EsolveBannerService, EsolveBannerVideo, EsolveCaptcha, EsolveCaptchaService, EsolveCareer, EsolveCareersService, EsolveCartAlternative, EsolveCartErrorHandlerService, EsolveCartItem, EsolveCartItemError, EsolveCartPromotionProgressItem, EsolveCartPromotionProgressQualifyingItem, EsolveCartService, EsolveCartStockItem, EsolveCartTaxBreakdown, EsolveCartTotals, EsolveCategoryTreeItem, EsolveCategoryTreeService, EsolveCdnSrcDirective, EsolveChangePasswordResult, EsolveCheckoutResult, EsolveClientAsset, EsolveClientAssetList, EsolveColour, EsolveColoursService, EsolveCompetition, EsolveCompetitionDates, EsolveCompetitionEntryResult, EsolveCompetitionWinner, EsolveCompetitionsService, EsolveConfigService, EsolveCookieService, EsolveCountry, EsolveCountryService, EsolveCoupon, EsolveCouponsService, EsolveDeliveriesService, EsolveDelivery, EsolveDeliveryCategoryTotals, EsolveDeliveryList, EsolveDeliveryStatus, EsolveDependantItem, EsolveDeviceService, EsolveEmptyCartResult, EsolveEmptyWishlistResult, EsolveEnquiryResult, EsolveEnquiryService, EsolveErpDocumentRequest, EsolveErpDocumentsRequestResult, EsolveErrorHandlerService, EsolveEvent, EsolveEventTargetService, EsolveEventType, EsolveFilterFactory, EsolveGenericFilter, EsolveGeocodeAddressResult, EsolveGeocodeCoordsResult, EsolveGeocodeResult, EsolveGeocoderService, EsolveHttpError, EsolveLinkedAsset, EsolveLinkedStockItem, EsolveList, EsolveLocation, EsolveLocationAddress, EsolveLocationContactInfo, EsolveLocationGEO, EsolveLocationList, EsolveLocationPOBoxAddress, EsolveLocationTradingDay, EsolveLocationTradingTimes, EsolveLocationUpdateResult, EsolveLocationsService, EsolveManufacturer, EsolveManufacturersService, EsolveMaterial, EsolveMaterialsService, EsolveMediaStockItem, EsolveMenuItem, EsolveMenuService, EsolveMultipleSelectFilter, EsolveNewsArticle, EsolveNewsArticleAuthor, EsolveNewsArticleList, EsolveNewsGroup, EsolveNewsService, EsolveNewsletterResult, EsolveNotificationButtonAction, EsolveNotificationDates, EsolveNotificationsService, EsolveOtp, EsolveOtpService, EsolveOtpValidation, EsolvePaymentMethod, EsolvePaymentResult, EsolvePaymentService, EsolveRange, EsolveRangeFilter, EsolveRangesService, EsolveRecipeStockItem, EsolveRegistrationResult, EsolveResetPasswordResult, EsolveResponseHandlerService, EsolveResponseResult, EsolveResult, EsolveReview, EsolveReviewList, EsolveReviewResult, EsolveReviewsService, EsolveSearchCleanResult, EsolveSearchResult, EsolveSearchResultItem, EsolveSearchService, EsolveSearchVectorizeResult, EsolveSeoInfo, EsolveSeoService, EsolveSessionAddressUpdateResult, EsolveSessionClientUpdateResult, EsolveSessionMetadataService, EsolveSessionService, EsolveSessionShippingUpdateResult, EsolveSetDeviceResult, EsolveSetNotifyResult, EsolveSettings, EsolveSettingsService, EsolveShippingCost, EsolveShippingCostItem, EsolveShippingMethod, EsolveShippingService, EsolveShippingTotals, EsolveSingleSelectFilter, EsolveSpecial, EsolveSpecialDates, EsolveSpecialImage, EsolveSpecialImageCollection, EsolveSpecialsService, EsolveStatement, EsolveStatementAgeing, EsolveStatementBalances, EsolveStatementTransaction, EsolveStockBadge, EsolveStockBarcode, EsolveStockGroup, EsolveStockGroupItem, EsolveStockImage, EsolveStockImageCollection, EsolveStockItem, EsolveStockItemBase, EsolveStockItemList, EsolveStockItemLocationLevel, EsolveStockLeadTimes, EsolveStockPrice, EsolveStockReviewsReport, EsolveStockService, EsolveStockTransactionSales, EsolveSuggestedStockItem, EsolveSupplier, EsolveSuppliersService, EsolveSystemNotification, EsolveSystemNotificationType, EsolveTag, EsolveTagsService, EsolveTimeSlot, EsolveTimeSlotConfig, EsolveTimeSlotDate, EsolveTimeSlotDays, EsolveTimeSlotTimes, EsolveToggleFilter, EsolveTopic, EsolveTopicService, EsolveTransaction, EsolveTransactionAddress, EsolveTransactionAnalyticsData, EsolveTransactionApprovalResult, EsolveTransactionClient, EsolveTransactionDelivery, EsolveTransactionItem, EsolveTransactionItemPrice, EsolveTransactionList, EsolveTransactionLocation, EsolveTransactionPaymentMethod, EsolveTransactionPick, EsolveTransactionShippingMethod, EsolveTransactionTimeSlot, EsolveTransactionUser, EsolveTransactionsService, EsolveUserAccount, EsolveUserAccountBusiness, EsolveUserAccountContact, EsolveUserAccountResult, EsolveUserClientAccount, EsolveUserClientAccountBalances, EsolveUserDevice, EsolveVaultItem, EsolveVaultItemResult, EsolveVoucher, EsolveVouchersService, EsolveWalletBalances, EsolveWalletService, EsolveWalletTransaction, EsolveWalletTransactionsList, EsolveWishlistItem, EsolveWishlistService, NgEsolveConnectModule, esolveAuthInterceptor, esolveHexHash, esolveUnauthorizedErrorInterceptor, isEsolveCdnPath, isFtgCdnPath, isLegacyEsolveCdnPath, processEsolveImageSrc, provideEsolveImageLoader, provideNgEsolveConnect };
|
|
10600
11011
|
//# sourceMappingURL=esolve-ng-esolve-connect.mjs.map
|