@fast-simon/dashboard-utilities 1.0.56 → 1.0.58

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.
@@ -83,6 +83,7 @@ export interface smartCollectionsResults {
83
83
  turbolink?: string;
84
84
  hiddenProducts?: ServerProduct[];
85
85
  within_search_results_for?: string;
86
+ results_for?: string;
86
87
  }
87
88
  export type inventoryCallback = ({}: {
88
89
  action: "products inventory";
@@ -1 +1 @@
1
- {"version":3,"file":"categories.js","sourceRoot":"","sources":["../../src/@types/categories.ts"],"names":[],"mappings":"","sourcesContent":["import {SortBy} from \"./sortBy\";\r\nimport {Narrow, ServerNarrow} from \"./narrow\";\r\nimport { ServerProduct} from \"./product\";\r\nimport {ServerFacet} from \"./facets\";\r\n\r\n\r\nexport type AncestorCategory = [string, string, string] // category_id, category_name, category_url\r\nexport interface RelatedCategory {\r\n id: string\r\n l: string\r\n t: string\r\n u: string\r\n}\r\nexport type CategoryAncestor = [string, string, string]\r\nexport interface Category {\r\n d: string\r\n id: string\r\n l: string\r\n p_id: string\r\n t: string\r\n u: string\r\n parent_name?: string\r\n}\r\nexport interface FastCategory {\r\n d: string\r\n id: string\r\n l: string\r\n p_id: string\r\n t: string\r\n u: string\r\n parent_name?: string\r\n}\r\nexport interface smartCollectionsProps {\r\n storeID: number\r\n uuid: string\r\n cdn: number\r\n categoryID: string,\r\n userToken: string,\r\n sessionStart: number,\r\n page?: number\r\n productsPerPage?: number\r\n sortBy?: SortBy\r\n narrowBy?: ServerNarrow[]\r\n facetRequired?: FacetRequired\r\n withAttributes?: boolean\r\n recent?: string\r\n rec?: boolean\r\n searchWithinSearch?: string,\r\n segments?: string[],\r\n hasShopifyMarkets?: boolean,\r\n disable_turbolinks?:boolean\r\n disable_strategies?:boolean\r\n disable_merchandising?:boolean\r\n disable_semantics?:boolean\r\n disable_merchandising_rules?:boolean\r\n disable_antonyms?:boolean\r\n custom_sort_settings?:{personalization_rank: number, creation_date: number, popularity: number, inventory: number}\r\n}\r\nexport type FacetRequired = 0 | 1 | 2\r\nexport type smartCollectionsCallback = ({}: {\r\n action: \"products\" | \"facets and products\"\r\n payload: smartCollectionsResults\r\n}) => void\r\nexport interface smartCollectionsResults {\r\n ancestors: CategoryAncestor[]\r\n categoryID: string\r\n name: string\r\n category_name: string\r\n products: ServerProduct[]\r\n facets?: ServerFacet[]\r\n totalResults: number\r\n sortBy?: SortBy,\r\n narrow?: Narrow[],\r\n isNoResults?: boolean\r\n page?: number\r\n pageCount?: number\r\n avoidPrefixList?: string[]\r\n merch?: any\r\n bannerHTML?: string\r\n turbolink?:string\r\n hiddenProducts?:ServerProduct[]\r\n within_search_results_for?:string\r\n\r\n}\r\nexport type inventoryCallback = ({}: {\r\n action: \"products inventory\"\r\n payload: {productsInventory: productsInventoryResults[]}\r\n}) => void\r\nexport interface productsInventoryResults {\r\n id: string;\r\n totalInventory: number;\r\n}"]}
1
+ {"version":3,"file":"categories.js","sourceRoot":"","sources":["../../src/@types/categories.ts"],"names":[],"mappings":"","sourcesContent":["import {SortBy} from \"./sortBy\";\r\nimport {Narrow, ServerNarrow} from \"./narrow\";\r\nimport { ServerProduct} from \"./product\";\r\nimport {ServerFacet} from \"./facets\";\r\n\r\n\r\nexport type AncestorCategory = [string, string, string] // category_id, category_name, category_url\r\nexport interface RelatedCategory {\r\n id: string\r\n l: string\r\n t: string\r\n u: string\r\n}\r\nexport type CategoryAncestor = [string, string, string]\r\nexport interface Category {\r\n d: string\r\n id: string\r\n l: string\r\n p_id: string\r\n t: string\r\n u: string\r\n parent_name?: string\r\n}\r\nexport interface FastCategory {\r\n d: string\r\n id: string\r\n l: string\r\n p_id: string\r\n t: string\r\n u: string\r\n parent_name?: string\r\n}\r\nexport interface smartCollectionsProps {\r\n storeID: number\r\n uuid: string\r\n cdn: number\r\n categoryID: string,\r\n userToken: string,\r\n sessionStart: number,\r\n page?: number\r\n productsPerPage?: number\r\n sortBy?: SortBy\r\n narrowBy?: ServerNarrow[]\r\n facetRequired?: FacetRequired\r\n withAttributes?: boolean\r\n recent?: string\r\n rec?: boolean\r\n searchWithinSearch?: string,\r\n segments?: string[],\r\n hasShopifyMarkets?: boolean,\r\n disable_turbolinks?:boolean\r\n disable_strategies?:boolean\r\n disable_merchandising?:boolean\r\n disable_semantics?:boolean\r\n disable_merchandising_rules?:boolean\r\n disable_antonyms?:boolean\r\n custom_sort_settings?:{personalization_rank: number, creation_date: number, popularity: number, inventory: number}\r\n}\r\nexport type FacetRequired = 0 | 1 | 2\r\nexport type smartCollectionsCallback = ({}: {\r\n action: \"products\" | \"facets and products\"\r\n payload: smartCollectionsResults\r\n}) => void\r\nexport interface smartCollectionsResults {\r\n ancestors: CategoryAncestor[]\r\n categoryID: string\r\n name: string\r\n category_name: string\r\n products: ServerProduct[]\r\n facets?: ServerFacet[]\r\n totalResults: number\r\n sortBy?: SortBy,\r\n narrow?: Narrow[],\r\n isNoResults?: boolean\r\n page?: number\r\n pageCount?: number\r\n avoidPrefixList?: string[]\r\n merch?: any\r\n bannerHTML?: string\r\n turbolink?:string\r\n hiddenProducts?:ServerProduct[]\r\n within_search_results_for?:string\r\n results_for?: string\r\n\r\n}\r\nexport type inventoryCallback = ({}: {\r\n action: \"products inventory\"\r\n payload: {productsInventory: productsInventoryResults[]}\r\n}) => void\r\nexport interface productsInventoryResults {\r\n id: string;\r\n totalInventory: number;\r\n}"]}
@@ -96,6 +96,7 @@ export declare function fastStateReducer(state: FastStateProps, action: FastStat
96
96
  turbolink?: string | undefined;
97
97
  hiddenProducts?: import("../../@types/product").ServerProduct[] | undefined;
98
98
  within_search_results_for?: string | undefined;
99
+ results_for?: string | undefined;
99
100
  } | {
100
101
  products: import("../../@types/product").ServerProduct[];
101
102
  alternatives?: string[] | undefined;
@@ -145,6 +146,7 @@ export declare function fastStateReducer(state: FastStateProps, action: FastStat
145
146
  turbolink?: string | undefined;
146
147
  hiddenProducts?: import("../../@types/product").ServerProduct[] | undefined;
147
148
  within_search_results_for?: string | undefined;
149
+ results_for?: string | undefined;
148
150
  } | {
149
151
  products: import("../../@types/product").ServerProduct[];
150
152
  alternatives?: string[] | undefined;
@@ -200,6 +202,7 @@ export declare function fastStateReducer(state: FastStateProps, action: FastStat
200
202
  turbolink?: string | undefined;
201
203
  hiddenProducts?: import("../../@types/product").ServerProduct[] | undefined;
202
204
  within_search_results_for?: string | undefined;
205
+ results_for?: string | undefined;
203
206
  alternatives?: string[] | undefined;
204
207
  term: string;
205
208
  cms_number_found?: number | undefined;
@@ -207,7 +210,6 @@ export declare function fastStateReducer(state: FastStateProps, action: FastStat
207
210
  banner_html_mobile: string;
208
211
  personalized_products?: number[] | undefined;
209
212
  session_products?: number[] | undefined;
210
- results_for?: string | undefined;
211
213
  related_results?: boolean | undefined;
212
214
  ancestor_categories?: import("../../@types/categories").AncestorCategory[] | undefined;
213
215
  related_search?: string[] | undefined;
package/dist/index.d.ts CHANGED
@@ -34,5 +34,6 @@ import FastSimonApi from "./components/FastSimonApi/FastSimonApi";
34
34
  import MainTheme from "./components/FastSimonApi";
35
35
  import { FeaturedRanking } from "@fast-simon/utilities/lib/@types/product";
36
36
  import { Products } from "./services/products";
37
+ import { getLSVectorSearchDict, getLSVectorSearchOn } from "./utils/getLSVectorSearch";
37
38
  export type { MenuItemName, CustomClasses, SideMenuType, SideMenuItem, ProductLabelType, Banner, EditorProduct, IconProps, ServerProduct, FullTextServerResponseAll, smartCollectionsResults, FeaturedRanking };
38
- export { BackOfficeFiltersMenu, InStoreFiltersMenu, Droppable, DndContextWrapper, SortableItem, ProductGrid, RenderIfVisible, useDragToSelect, LandingPage, FullTextSearch, BackOfficeFiltersIcon, BannersIcon, HelpIcon, InStoreFiltersIcon, PromoteIcon, RestoreIcon, RemoveIcon, GeneralIcon, videoFormats, isEditorProduct, useFastState, useFastStateFunctions, FastSimonApi, MainTheme, Products, getFormatProducts, useProductsPerRow, ProductLabel, CustomTagsFilters, SelectCard };
39
+ export { BackOfficeFiltersMenu, InStoreFiltersMenu, Droppable, DndContextWrapper, SortableItem, ProductGrid, RenderIfVisible, useDragToSelect, LandingPage, FullTextSearch, BackOfficeFiltersIcon, BannersIcon, HelpIcon, InStoreFiltersIcon, PromoteIcon, RestoreIcon, RemoveIcon, GeneralIcon, videoFormats, isEditorProduct, useFastState, useFastStateFunctions, FastSimonApi, MainTheme, Products, getFormatProducts, useProductsPerRow, ProductLabel, CustomTagsFilters, SelectCard, getLSVectorSearchOn, getLSVectorSearchDict };
package/dist/index.js CHANGED
@@ -27,5 +27,6 @@ import { useFastState, useFastStateFunctions } from "./components/FastSimonApi";
27
27
  import FastSimonApi from "./components/FastSimonApi/FastSimonApi";
28
28
  import MainTheme from "./components/FastSimonApi";
29
29
  import { Products } from "./services/products";
30
- export { BackOfficeFiltersMenu, InStoreFiltersMenu, Droppable, DndContextWrapper, SortableItem, ProductGrid, RenderIfVisible, useDragToSelect, LandingPage, FullTextSearch, BackOfficeFiltersIcon, BannersIcon, HelpIcon, InStoreFiltersIcon, PromoteIcon, RestoreIcon, RemoveIcon, GeneralIcon, videoFormats, isEditorProduct, useFastState, useFastStateFunctions, FastSimonApi, MainTheme, Products, getFormatProducts, useProductsPerRow, ProductLabel, CustomTagsFilters, SelectCard };
30
+ import { getLSVectorSearchDict, getLSVectorSearchOn } from "./utils/getLSVectorSearch";
31
+ export { BackOfficeFiltersMenu, InStoreFiltersMenu, Droppable, DndContextWrapper, SortableItem, ProductGrid, RenderIfVisible, useDragToSelect, LandingPage, FullTextSearch, BackOfficeFiltersIcon, BannersIcon, HelpIcon, InStoreFiltersIcon, PromoteIcon, RestoreIcon, RemoveIcon, GeneralIcon, videoFormats, isEditorProduct, useFastState, useFastStateFunctions, FastSimonApi, MainTheme, Products, getFormatProducts, useProductsPerRow, ProductLabel, CustomTagsFilters, SelectCard, getLSVectorSearchOn, getLSVectorSearchDict };
31
32
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":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AAC;AACjE,OAAO,EAAC,YAAY,EAAE,qBAAqB,EAAC,MAAM,2BAA2B,CAAA;AAI7E,OAAO,YAAY,MAAM,wCAAwC,CAAA;AACjE,OAAO,SAAS,MAAM,2BAA2B,CAAA;AAEjD,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAkB9C,OAAO,EACH,qBAAqB,EAAE,kBAAkB,EAAE,SAAS,EAAE,iBAAiB,EAAE,YAAY,EAAE,WAAW,EAAE,eAAe,EACnH,eAAe,EAAE,WAAW,EAAE,cAAc,EAAE,qBAAqB,EAAE,WAAW,EAAE,QAAQ,EAAE,kBAAkB,EAAE,WAAW,EAC3H,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,eAAe,EAAC,YAAY,EAAE,qBAAqB,EAAC,YAAY,EAAC,SAAS,EAC9H,QAAQ,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,YAAY,EAAE,iBAAiB,EAAE,UAAU,EAC9F,CAAC","sourcesContent":["import {CustomClasses, SideMenuType, SideMenuItem, MenuItemName} from \"./@types/sideMenu\"\r\nimport {ProductLabelType} from \"./@types/productLabel\"\r\nimport {videoFormats, Banner} from \"./@types/banner\"\r\nimport {EditorProduct, isEditorProduct} from \"./@types/editorProduct\"\r\nimport {IconProps} from \"./@types/iconProps\"\r\n\r\nimport {BackOfficeFiltersIcon} from \"./icons/BackOfficeFiltersIcon\"\r\nimport {BannersIcon} from \"./icons/BannersIcon\"\r\nimport {HelpIcon} from \"./icons/HelpIcon\"\r\nimport {InStoreFiltersIcon} from \"./icons/InStoreFiltersIcon\"\r\nimport {PromoteIcon} from \"./icons/PromoteIcon\"\r\nimport {RemoveIcon} from \"./icons/RemoveIcon\"\r\nimport {RestoreIcon} from \"./icons/RestoreIcon\"\r\nimport {GeneralIcon} from \"./icons/GeneralIcon\"\r\nimport BackOfficeFiltersMenu from './components/BackOfficeFiltersMenu'\r\nimport InStoreFiltersMenu from './components/InStoreFiltersMenu'\r\nimport DndContextWrapper from './components/DragAndDrop/DndContextWrapper'\r\nimport Droppable from './components/DragAndDrop/Droppable'\r\nimport ProductLabel from './components/ProductLabel/ProductLabel'\r\nimport {SortableItem} from './components/DragAndDrop/SortableItem'\r\nimport ProductGrid from \"./components/productGrid/ProductGrid\";\r\nimport SelectCard from \"./components/SelectCard/SelectCard\";\r\nimport RenderIfVisible from \"./components/RenderIfVisible\";\r\nimport {useDragToSelect} from \"./utils/useDragToSelect\";\r\nimport {CustomTagsFilters} from \"./utils/customTagsFilters\";\r\nimport {useProductsPerRow} from \"./utils/useProductsPerRow\";\r\nimport { LandingPage } from \"./services/landingPage\";\r\nimport { FullTextSearch } from \"./services/search\";\r\nimport { getFormatProducts } from \"./services/getFormatProducts\";\r\nimport {useFastState, useFastStateFunctions} from \"./components/FastSimonApi\"\r\nimport { ServerProduct } from \"./@types/product\"\r\nimport { FullTextServerResponseAll } from \"./@types/results\"\r\nimport { smartCollectionsResults } from \"./@types/categories\"\r\nimport FastSimonApi from \"./components/FastSimonApi/FastSimonApi\"\r\nimport MainTheme from \"./components/FastSimonApi\"\r\nimport { FeaturedRanking } from \"@fast-simon/utilities/lib/@types/product\"\r\nimport { Products } from \"./services/products\"\r\n// export * from './components';\r\n\r\nexport type {\r\n MenuItemName,\r\n CustomClasses,\r\n SideMenuType,\r\n SideMenuItem,\r\n ProductLabelType,\r\n Banner,\r\n EditorProduct,\r\n IconProps,\r\n ServerProduct,\r\n FullTextServerResponseAll,\r\n smartCollectionsResults,\r\n FeaturedRanking\r\n};\r\n\r\nexport {\r\n BackOfficeFiltersMenu, InStoreFiltersMenu, Droppable, DndContextWrapper, SortableItem, ProductGrid, RenderIfVisible,\r\n useDragToSelect, LandingPage, FullTextSearch, BackOfficeFiltersIcon, BannersIcon, HelpIcon, InStoreFiltersIcon, PromoteIcon,\r\n RestoreIcon, RemoveIcon, GeneralIcon, videoFormats, isEditorProduct,useFastState, useFastStateFunctions,FastSimonApi,MainTheme,\r\n Products, getFormatProduc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cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAC,YAAY,EAAE,qBAAqB,EAAC,MAAM,2BAA2B,CAAA;AAI7E,OAAO,YAAY,MAAM,wCAAwC,CAAA;AACjE,OAAO,SAAS,MAAM,2BAA2B,CAAA;AAEjD,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAC9C,OAAO,EAAC,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAkBrF,OAAO,EACH,qBAAqB,EAAE,kBAAkB,EAAE,SAAS,EAAE,iBAAiB,EAAE,YAAY,EAAE,WAAW,EAAE,eAAe,EACnH,eAAe,EAAE,WAAW,EAAE,cAAc,EAAE,qBAAqB,EAAE,WAAW,EAAE,QAAQ,EAAE,kBAAkB,EAAE,WAAW,EAC3H,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,eAAe,EAAC,YAAY,EAAE,qBAAqB,EAAC,YAAY,EAAC,SAAS,EAC9H,QAAQ,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,YAAY,EAAE,iBAAiB,EAAE,UAAU,EAAE,mBAAmB,EAAC,qBAAqB,EACzI,CAAC","sourcesContent":["import {CustomClasses, SideMenuType, SideMenuItem, MenuItemName} from \"./@types/sideMenu\"\r\nimport {ProductLabelType} from \"./@types/productLabel\"\r\nimport {videoFormats, Banner} from \"./@types/banner\"\r\nimport {EditorProduct, isEditorProduct} from \"./@types/editorProduct\"\r\nimport {IconProps} from \"./@types/iconProps\"\r\n\r\nimport {BackOfficeFiltersIcon} from \"./icons/BackOfficeFiltersIcon\"\r\nimport {BannersIcon} from \"./icons/BannersIcon\"\r\nimport {HelpIcon} from \"./icons/HelpIcon\"\r\nimport {InStoreFiltersIcon} from \"./icons/InStoreFiltersIcon\"\r\nimport {PromoteIcon} from \"./icons/PromoteIcon\"\r\nimport {RemoveIcon} from \"./icons/RemoveIcon\"\r\nimport {RestoreIcon} from \"./icons/RestoreIcon\"\r\nimport {GeneralIcon} from \"./icons/GeneralIcon\"\r\nimport BackOfficeFiltersMenu from './components/BackOfficeFiltersMenu'\r\nimport InStoreFiltersMenu from './components/InStoreFiltersMenu'\r\nimport DndContextWrapper from './components/DragAndDrop/DndContextWrapper'\r\nimport Droppable from './components/DragAndDrop/Droppable'\r\nimport ProductLabel from './components/ProductLabel/ProductLabel'\r\nimport {SortableItem} from './components/DragAndDrop/SortableItem'\r\nimport ProductGrid from \"./components/productGrid/ProductGrid\";\r\nimport SelectCard from \"./components/SelectCard/SelectCard\";\r\nimport RenderIfVisible from \"./components/RenderIfVisible\";\r\nimport {useDragToSelect} from \"./utils/useDragToSelect\";\r\nimport {CustomTagsFilters} from \"./utils/customTagsFilters\";\r\nimport {useProductsPerRow} from \"./utils/useProductsPerRow\";\r\nimport { LandingPage } from \"./services/landingPage\";\r\nimport { FullTextSearch } from \"./services/search\";\r\nimport { getFormatProducts } from \"./services/getFormatProducts\";\r\nimport {useFastState, useFastStateFunctions} from \"./components/FastSimonApi\"\r\nimport { ServerProduct } from \"./@types/product\"\r\nimport { FullTextServerResponseAll } from \"./@types/results\"\r\nimport { smartCollectionsResults } from \"./@types/categories\"\r\nimport FastSimonApi from \"./components/FastSimonApi/FastSimonApi\"\r\nimport MainTheme from \"./components/FastSimonApi\"\r\nimport { FeaturedRanking } from \"@fast-simon/utilities/lib/@types/product\"\r\nimport { Products } from \"./services/products\"\r\nimport {getLSVectorSearchDict, getLSVectorSearchOn } from \"./utils/getLSVectorSearch\"\r\n// export * from './components';\r\n\r\nexport type {\r\n MenuItemName,\r\n CustomClasses,\r\n SideMenuType,\r\n SideMenuItem,\r\n ProductLabelType,\r\n Banner,\r\n EditorProduct,\r\n IconProps,\r\n ServerProduct,\r\n FullTextServerResponseAll,\r\n smartCollectionsResults,\r\n FeaturedRanking\r\n};\r\n\r\nexport {\r\n BackOfficeFiltersMenu, InStoreFiltersMenu, Droppable, DndContextWrapper, SortableItem, ProductGrid, RenderIfVisible,\r\n useDragToSelect, LandingPage, FullTextSearch, BackOfficeFiltersIcon, BannersIcon, HelpIcon, InStoreFiltersIcon, PromoteIcon,\r\n RestoreIcon, RemoveIcon, GeneralIcon, videoFormats, isEditorProduct,useFastState, useFastStateFunctions,FastSimonApi,MainTheme,\r\n Products, getFormatProducts, useProductsPerRow, ProductLabel, CustomTagsFilters, SelectCard ,getLSVectorSearchOn,getLSVectorSearchDict\r\n};"]}
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  };
10
10
  import { API, fastSimonGet } from "./API";
11
11
  import { FacetsParser } from "@fast-simon/utilities";
12
- import { getReasoningVectorSearch } from "../utils/getLSVectorSearch";
12
+ import { getLSVectorSearchDict, getLSVectorSearchOn } from "../utils/getLSVectorSearch";
13
13
  import { getInternalURL } from "../utils/getInternalURL";
14
14
  const BASE_URL = "https://internal-v3joil6oqa-uc.a.run.app";
15
15
  export const FullTextSearch = {
@@ -90,7 +90,9 @@ export const FullTextSearch = {
90
90
  disable_antonyms: disable_antonyms ? 1 : 0,
91
91
  custom_sort_settings: JSON.stringify(custom_sort_settings)
92
92
  };
93
- params["vector_search_reasoning"] = (_a = getReasoningVectorSearch()) !== null && _a !== void 0 ? _a : undefined;
93
+ if (getLSVectorSearchOn()) {
94
+ params["hybrid_search_settings"] = (_a = getLSVectorSearchDict()) !== null && _a !== void 0 ? _a : undefined;
95
+ }
94
96
  params["segments"] = JSON.stringify(segments) || undefined;
95
97
  return API.get({
96
98
  url: `${internal_url}/search/full_text_search_reasoning`,
@@ -1 +1 @@
1
- {"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/services/search.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAC,GAAG,EAAE,YAAY,EAAC,MAAM,OAAO,CAAC;AACxC,OAAO,EAAC,YAAY,EAAc,MAAM,uBAAuB,CAAA;AAE/D,OAAO,EAAC,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CAAA,CAAC;YACrC,oBAAoB,EAAC,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC;SAC5D,CAAC;QAGF,MAAM,CAAC,yBAAyB,CAAC,GAAG,MAAA,wBAAwB,EAAE,mCAAE,SAAS,CAAC;QAC1E,MAAM,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,SAAS,CAAC;QAC3D,OAAO,GAAG,CAAC,GAAG,CAA4B;YACtC,GAAG,EAAE,GAAG,YAAY,oCAAoC;YACxD,MAAM;SACT,CAAC,CAAC;IAEH,CAAC;CACJ,CACJ;AACD,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAgB,EAAE,gBAAyB,EAAE,EAAE,CAAC,IAAI,YAAY,EAAE,CAAC,WAAW,CAAC,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC","sourcesContent":["import {CategoryNavigationResponse} from \"../@types/categoriesNavigation\";\r\nimport {API, fastSimonGet} from \"./API\";\r\nimport {FacetsParser, ServerFacet} from \"@fast-simon/utilities\"\r\nimport {fullTextSearchProps, FullTextServerResponseAll} from \"../@types/results\";\r\nimport {getReasoningVectorSearch} from \"../utils/getLSVectorSearch\";\r\nimport {getInternalURL} from \"../utils/getInternalURL\";\r\n\r\n\r\nconst BASE_URL = \"https://internal-v3joil6oqa-uc.a.run.app\";\r\n\r\nexport const FullTextSearch = {\r\n getFullTextSearch: async ({\r\n uuid,\r\n storeID,\r\n facetRequired,\r\n narrow,\r\n page,\r\n productsPerPage,\r\n withAttributes,\r\n query,\r\n searchWithinSearch,\r\n visualMerchandising,\r\n lastProduct\r\n }: any) => {\r\n\r\n const params: Record<string, any> = {\r\n UUID: uuid,\r\n store_id: storeID,\r\n facets_required: 1,\r\n q: searchWithinSearch || query,\r\n page_num: page ?? 1,\r\n with_product_attributes: withAttributes,\r\n narrow: JSON.stringify(narrow),\r\n products_per_page: productsPerPage,\r\n visual_merchandising: !searchWithinSearch ? JSON.stringify(visualMerchandising).replaceAll('\"[', '[').replaceAll(']\"', ']') : undefined\r\n };\r\n if(lastProduct) {\r\n params['last_product'] = lastProduct\r\n }\r\n const res = await API.post<CategoryNavigationResponse>({url: BASE_URL+'/search/full_text_search_editor', data: params, config: {headers: {'content-type': 'text/plain'}}});\r\n return {\r\n data: res,\r\n getFacets: async () => (res?.facets_completed ? transformFacetsOnlyData(res.facets, res.avoid_tag_prefixes) : await FullTextSearch.fullTextFacetsOnly({ uuid,\r\n storeID,\r\n facetRequired,\r\n narrow,\r\n page,\r\n productsPerPage,\r\n withAttributes,\r\n searchWithinSearch,\r\n visualMerchandising,\r\n lastProduct,\r\n query})\r\n )\r\n };\r\n },\r\n fullTextFacetsOnly: async ({\r\n uuid,\r\n storeID,\r\n narrow,\r\n page,\r\n productsPerPage,\r\n withAttributes,\r\n collectionID,\r\n searchWithinSearch,\r\n visualMerchandising,\r\n query\r\n }: any) => {\r\n\r\n const params: Record<string, any> = {\r\n UUID: uuid,\r\n store_id: storeID,\r\n facets_required: 2,\r\n q: query,\r\n page_num: page ?? 1,\r\n with_product_attributes: withAttributes,\r\n narrow: JSON.stringify(narrow),\r\n products_per_page: productsPerPage,\r\n search_within_search: searchWithinSearch,\r\n visual_merchandising: JSON.stringify(visualMerchandising).replaceAll('\"[', '[').replaceAll(']\"', ']')\r\n };\r\n\r\n const res = await fastSimonGet<CategoryNavigationResponse>(BASE_URL, '/search/full_text_search_editor', params);\r\n\r\n return transformFacetsOnlyData(res.facets, res.avoid_tag_prefixes);\r\n },\r\n getReasoningFullTextSearch: ({\r\n uuid, storeID, cdn,\r\n facetRequired, narrowBy, page,\r\n productsPerPage, term, sortBy\r\n , withAttributes, recent, searchWithinSearch, segments,\r\n disable_semantics,disable_merchandising,disable_strategies,disable_turbolinks,disable_merchandising_rules,disable_antonyms,\r\n custom_sort_settings\r\n\r\n }: fullTextSearchProps) => {\r\n var internal_url=getInternalURL();\r\n if(internal_url==\"\")\r\n {\r\n internal_url=BASE_URL;\r\n }\r\n\r\n const params: Record<string, any> = {\r\n UUID: uuid,\r\n store_id: storeID,\r\n cdn_cache_key: cdn,\r\n facets_required: facetRequired,\r\n q: term,\r\n page_num: page,\r\n with_product_attributes: withAttributes,\r\n narrow: JSON.stringify(narrowBy),\r\n products_per_page: productsPerPage,\r\n sort_by: sortBy,\r\n sp: recent,\r\n m: 1,\r\n search_within_search: searchWithinSearch,\r\n disable_semantics:disable_semantics?1:0,\r\n disable_merchandising:disable_merchandising?1:0,\r\n disable_strategies:disable_strategies?1:0,\r\n disable_turbolinks:disable_turbolinks?1:0,\r\n disable_merchandising_rules:disable_merchandising_rules?1:0,\r\n disable_antonyms:disable_antonyms?1:0,\r\n custom_sort_settings:JSON.stringify(custom_sort_settings)\r\n };\r\n\r\n\r\n params[\"vector_search_reasoning\"] = getReasoningVectorSearch()??undefined;\r\n params[\"segments\"] = JSON.stringify(segments) || undefined;\r\n return API.get<FullTextServerResponseAll>({\r\n url: `${internal_url}/search/full_text_search_reasoning`,\r\n params,\r\n });\r\n\r\n },\r\n }\r\n;\r\nexport const transformFacetsOnlyData = (r: ServerFacet[], avoidTagPrefixes?: string) => new FacetsParser().parseFacets(r, avoidTagPrefixes ? avoidTagPrefixes.split(\",\") : []);"]}
1
+ {"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/services/search.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAC,GAAG,EAAE,YAAY,EAAC,MAAM,OAAO,CAAC;AACxC,OAAO,EAAC,YAAY,EAAc,MAAM,uBAAuB,CAAA;AAE/D,OAAO,EAAC,qBAAqB,EAAE,mBAAmB,EAAC,MAAM,4BAA4B,CAAC;AACtF,OAAO,EAAC,cAAc,EAAC,MAAM,yBAAyB,CAAC;AAGvD,MAAM,QAAQ,GAAG,0CAA0C,CAAC;AAE5D,MAAM,CAAC,MAAM,cAAc,GAAG;IACt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,EAAE,mCAAE,SAAS,CAAC;SACzE;QACD,MAAM,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,SAAS,CAAC;QAC3D,OAAO,GAAG,CAAC,GAAG,CAA4B;YACtC,GAAG,EAAE,GAAG,YAAY,oCAAoC;YACxD,MAAM;SACT,CAAC,CAAC;IAEH,CAAC;CACJ,CACJ;AACD,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAgB,EAAE,gBAAyB,EAAE,EAAE,CAAC,IAAI,YAAY,EAAE,CAAC,WAAW,CAAC,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC","sourcesContent":["import {CategoryNavigationResponse} from \"../@types/categoriesNavigation\";\r\nimport {API, fastSimonGet} from \"./API\";\r\nimport {FacetsParser, ServerFacet} from \"@fast-simon/utilities\"\r\nimport {fullTextSearchProps, FullTextServerResponseAll} from \"../@types/results\";\r\nimport {getLSVectorSearchDict, getLSVectorSearchOn} from \"../utils/getLSVectorSearch\";\r\nimport {getInternalURL} from \"../utils/getInternalURL\";\r\n\r\n\r\nconst BASE_URL = \"https://internal-v3joil6oqa-uc.a.run.app\";\r\n\r\nexport const FullTextSearch = {\r\n getFullTextSearch: async ({\r\n uuid,\r\n storeID,\r\n facetRequired,\r\n narrow,\r\n page,\r\n productsPerPage,\r\n withAttributes,\r\n query,\r\n searchWithinSearch,\r\n visualMerchandising,\r\n lastProduct\r\n }: any) => {\r\n\r\n const params: Record<string, any> = {\r\n UUID: uuid,\r\n store_id: storeID,\r\n facets_required: 1,\r\n q: searchWithinSearch || query,\r\n page_num: page ?? 1,\r\n with_product_attributes: withAttributes,\r\n narrow: JSON.stringify(narrow),\r\n products_per_page: productsPerPage,\r\n visual_merchandising: !searchWithinSearch ? JSON.stringify(visualMerchandising).replaceAll('\"[', '[').replaceAll(']\"', ']') : undefined\r\n };\r\n if(lastProduct) {\r\n params['last_product'] = lastProduct\r\n }\r\n const res = await API.post<CategoryNavigationResponse>({url: BASE_URL+'/search/full_text_search_editor', data: params, config: {headers: {'content-type': 'text/plain'}}});\r\n return {\r\n data: res,\r\n getFacets: async () => (res?.facets_completed ? transformFacetsOnlyData(res.facets, res.avoid_tag_prefixes) : await FullTextSearch.fullTextFacetsOnly({ uuid,\r\n storeID,\r\n facetRequired,\r\n narrow,\r\n page,\r\n productsPerPage,\r\n withAttributes,\r\n searchWithinSearch,\r\n visualMerchandising,\r\n lastProduct,\r\n query})\r\n )\r\n };\r\n },\r\n fullTextFacetsOnly: async ({\r\n uuid,\r\n storeID,\r\n narrow,\r\n page,\r\n productsPerPage,\r\n withAttributes,\r\n collectionID,\r\n searchWithinSearch,\r\n visualMerchandising,\r\n query\r\n }: any) => {\r\n\r\n const params: Record<string, any> = {\r\n UUID: uuid,\r\n store_id: storeID,\r\n facets_required: 2,\r\n q: query,\r\n page_num: page ?? 1,\r\n with_product_attributes: withAttributes,\r\n narrow: JSON.stringify(narrow),\r\n products_per_page: productsPerPage,\r\n search_within_search: searchWithinSearch,\r\n visual_merchandising: JSON.stringify(visualMerchandising).replaceAll('\"[', '[').replaceAll(']\"', ']')\r\n };\r\n\r\n const res = await fastSimonGet<CategoryNavigationResponse>(BASE_URL, '/search/full_text_search_editor', params);\r\n\r\n return transformFacetsOnlyData(res.facets, res.avoid_tag_prefixes);\r\n },\r\n getReasoningFullTextSearch: ({\r\n uuid, storeID, cdn,\r\n facetRequired, narrowBy, page,\r\n productsPerPage, term, sortBy\r\n , withAttributes, recent, searchWithinSearch, segments,\r\n disable_semantics,disable_merchandising,disable_strategies,disable_turbolinks,disable_merchandising_rules,disable_antonyms,\r\n custom_sort_settings\r\n\r\n }: fullTextSearchProps) => {\r\n var internal_url=getInternalURL();\r\n if(internal_url==\"\")\r\n {\r\n internal_url=BASE_URL;\r\n }\r\n\r\n const params: Record<string, any> = {\r\n UUID: uuid,\r\n store_id: storeID,\r\n cdn_cache_key: cdn,\r\n facets_required: facetRequired,\r\n q: term,\r\n page_num: page,\r\n with_product_attributes: withAttributes,\r\n narrow: JSON.stringify(narrowBy),\r\n products_per_page: productsPerPage,\r\n sort_by: sortBy,\r\n sp: recent,\r\n m: 1,\r\n search_within_search: searchWithinSearch,\r\n disable_semantics:disable_semantics?1:0,\r\n disable_merchandising:disable_merchandising?1:0,\r\n disable_strategies:disable_strategies?1:0,\r\n disable_turbolinks:disable_turbolinks?1:0,\r\n disable_merchandising_rules:disable_merchandising_rules?1:0,\r\n disable_antonyms:disable_antonyms?1:0,\r\n custom_sort_settings:JSON.stringify(custom_sort_settings)\r\n };\r\n\r\n\r\n if(getLSVectorSearchOn())\r\n {\r\n params[\"hybrid_search_settings\"] = getLSVectorSearchDict()??undefined;\r\n }\r\n params[\"segments\"] = JSON.stringify(segments) || undefined;\r\n return API.get<FullTextServerResponseAll>({\r\n url: `${internal_url}/search/full_text_search_reasoning`,\r\n params,\r\n });\r\n\r\n },\r\n }\r\n;\r\nexport const transformFacetsOnlyData = (r: ServerFacet[], avoidTagPrefixes?: string) => new FacetsParser().parseFacets(r, avoidTagPrefixes ? avoidTagPrefixes.split(\",\") : []);"]}
@@ -1 +1,4 @@
1
- export declare const getReasoningVectorSearch: () => boolean;
1
+ export declare const REASONING_VECTOR_SEARCH_LS_KEY = "reasoning_vector_search";
2
+ export declare const REASONING_VECTOR_SEARCH_LS_DICT = "reasoning_vector_search_dict";
3
+ export declare function getLSVectorSearchOn(): boolean;
4
+ export declare function getLSVectorSearchDict(): string | null;
@@ -1,4 +1,9 @@
1
- export const getReasoningVectorSearch = () => {
2
- return localStorage.getItem("reasoning_vector_search") === "true";
3
- };
1
+ export const REASONING_VECTOR_SEARCH_LS_KEY = "reasoning_vector_search";
2
+ export const REASONING_VECTOR_SEARCH_LS_DICT = "reasoning_vector_search_dict";
3
+ export function getLSVectorSearchOn() {
4
+ return localStorage.getItem(REASONING_VECTOR_SEARCH_LS_KEY) === "true";
5
+ }
6
+ export function getLSVectorSearchDict() {
7
+ return localStorage.getItem(REASONING_VECTOR_SEARCH_LS_DICT) != undefined ? localStorage.getItem(REASONING_VECTOR_SEARCH_LS_DICT) : null;
8
+ }
4
9
  //# sourceMappingURL=getLSVectorSearch.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getLSVectorSearch.js","sourceRoot":"","sources":["../../src/utils/getLSVectorSearch.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAY,EAAE;IAClD,OAAO,YAAY,CAAC,OAAO,CAAC,yBAAyB,CAAC,KAAK,MAAM,CAAC;AACtE,CAAC,CAAA","sourcesContent":["export const getReasoningVectorSearch = (): boolean => {\r\n return localStorage.getItem(\"reasoning_vector_search\") === \"true\";\r\n}"]}
1
+ {"version":3,"file":"getLSVectorSearch.js","sourceRoot":"","sources":["../../src/utils/getLSVectorSearch.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,8BAA8B,GAAG,yBAAyB,CAAC;AACxE,MAAM,CAAC,MAAM,+BAA+B,GAAG,8BAA8B,CAAC;AAE9E,MAAM,UAAU,mBAAmB;IAC/B,OAAO,YAAY,CAAC,OAAO,CAAC,8BAA8B,CAAC,KAAG,MAAM,CAAA;AACxE,CAAC;AACD,MAAM,UAAU,qBAAqB;IACjC,OAAO,YAAY,CAAC,OAAO,CAAC,+BAA+B,CAAC,IAAE,SAAS,CAAA,CAAC,CAAA,YAAY,CAAC,OAAO,CAAC,+BAA+B,CAAC,CAAA,CAAC,CAAA,IAAI,CAAA;AACtI,CAAC","sourcesContent":["export const REASONING_VECTOR_SEARCH_LS_KEY = \"reasoning_vector_search\";\r\nexport const REASONING_VECTOR_SEARCH_LS_DICT = \"reasoning_vector_search_dict\";\r\n\r\nexport function getLSVectorSearchOn() {\r\n return localStorage.getItem(REASONING_VECTOR_SEARCH_LS_KEY)===\"true\"\r\n}\r\nexport function getLSVectorSearchDict(){\r\n return localStorage.getItem(REASONING_VECTOR_SEARCH_LS_DICT)!=undefined?localStorage.getItem(REASONING_VECTOR_SEARCH_LS_DICT):null\r\n}"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fast-simon/dashboard-utilities",
3
- "version": "1.0.56",
3
+ "version": "1.0.58",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "preview": "vite preview",