@soma-vertical-web/multi-lib 0.0.31 → 0.0.33
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/__vite-browser-external-BYRIRx8p.mjs +8 -0
- package/__vite-browser-external-Cjz79hOw.js +1 -0
- package/data/api/cms/backup/index.d.ts +11 -0
- package/data/api/cms/content-type/index.d.ts +3 -0
- package/data/api/cms/index.d.ts +2 -0
- package/data/api/fetchVtex.d.ts +2 -1
- package/data/api/search/autoCompleteSuggestions/index.d.ts +11 -0
- package/data/api/search/crosseling/index.d.ts +95 -0
- package/data/api/search/facets/index.d.ts +4 -0
- package/data/api/search/index.d.ts +6 -0
- package/data/api/search/product/index.d.ts +3 -0
- package/data/api/search/searchFetch.d.ts +3 -0
- package/data/api/search/suggestedTerms/index.d.ts +12 -0
- package/data/api/search/topSearch/index.d.ts +3 -0
- package/data/helpers/cms/index.d.ts +11 -0
- package/data/helpers/search/facets.d.ts +48 -0
- package/data/helpers/search/index.d.ts +12 -0
- package/data/helpers/search/product/index.d.ts +279 -0
- package/data/helpers/search/product/utils/canonical.d.ts +1 -0
- package/data/helpers/search/product/utils/enhanceSku.d.ts +9 -0
- package/data/helpers/search/product/utils/images.d.ts +7 -0
- package/data/helpers/search/product/utils/index.d.ts +8 -0
- package/data/helpers/search/product/utils/productStock.d.ts +7 -0
- package/data/helpers/search/product/utils/propertyValue.d.ts +20 -0
- package/data/helpers/search/product/utils/sanitizeHtml.d.ts +18 -0
- package/data/helpers/search/product/utils/sku.d.ts +5 -0
- package/data/helpers/search/product/utils/slugify.d.ts +1 -0
- package/data/helpers/search/root.d.ts +11 -0
- package/data/helpers/search/search.d.ts +7 -0
- package/index.js +14 -14
- package/index.mjs +2122 -2129
- package/index2.js +1 -1
- package/index2.mjs +1005 -405
- package/package.json +1 -1
- package/server.d.ts +13 -0
- package/types/constants.d.ts +14 -0
- package/types/contexts/contexts/plp.d.ts +13 -0
- package/types/contexts/contexts/search.d.ts +2 -2
- package/types/data/api/cms/index.d.ts +5 -0
- package/types/data/api/index.d.ts +5 -2
- package/types/data/api/search/facets/index.d.ts +13 -13
- package/types/data/api/search/index.d.ts +25 -12
- package/types/data/api/search/product/index.d.ts +1 -8
- package/types/data/events/index.d.ts +0 -4
- package/types/data/helpers/index.d.ts +9 -1
- package/types/global/product/index.d.ts +5 -4
- package/types/data/api/search/autoCompleteSuggestions/index.d.ts +0 -7
- package/types/data/api/search/suggestedTerms/index.d.ts +0 -7
package/package.json
CHANGED
package/server.d.ts
CHANGED
|
@@ -2,12 +2,25 @@ import * as checkout from './data/api/checkout';
|
|
|
2
2
|
import * as catalog from './data/api/catalog';
|
|
3
3
|
import * as catalogHelpers from './data/helpers/catalog';
|
|
4
4
|
import * as cms from './data/api/cms';
|
|
5
|
+
import * as search from './data/api/search';
|
|
5
6
|
declare const serverAPIs: {
|
|
6
7
|
checkout: typeof checkout;
|
|
7
8
|
catalog: typeof catalog;
|
|
8
9
|
cms: typeof cms;
|
|
10
|
+
search: typeof search;
|
|
9
11
|
};
|
|
10
12
|
declare const serverHelpers: {
|
|
11
13
|
catalog: typeof catalogHelpers;
|
|
14
|
+
search: {
|
|
15
|
+
parseSearchState: ({ pathname, searchParams }: URL, facets: string[]) => import('./types/data/api/search').State;
|
|
16
|
+
convertSearchParams: (searchParams: {
|
|
17
|
+
[key: string]: string | string[] | undefined;
|
|
18
|
+
}) => URLSearchParams;
|
|
19
|
+
filterNonRootFacets: (selectedFacets: import('./types/data/api/search/facets').SelectedFacet[], base?: string | null) => {
|
|
20
|
+
value: string;
|
|
21
|
+
key: string;
|
|
22
|
+
}[];
|
|
23
|
+
filterNonCategorySelected: (facets: import('./types/data/api/search/facets').Facet[], base?: string | null) => import('./types/data/api/search/facets').Facet<import('./types/data/api/search/facets').FacetValueBoolean | import('./types/data/api/search/facets').FacetValueRange>[];
|
|
24
|
+
};
|
|
12
25
|
};
|
|
13
26
|
export { serverAPIs, serverHelpers };
|
package/types/constants.d.ts
CHANGED
|
@@ -3,6 +3,18 @@ import { EditorState } from 'draft-js';
|
|
|
3
3
|
import { CSSProperties } from 'react';
|
|
4
4
|
|
|
5
5
|
export declare const PDPShelfType: readonly ["whosawalsosaw", "whosawalsobought", "whoboughtalsobought", "accessories", "similars", "showtogether", "suggestions"];
|
|
6
|
+
export declare const FACET_CROSS_SELLING_MAP: {
|
|
7
|
+
readonly buy: "whoboughtalsobought";
|
|
8
|
+
readonly view: "whosawalsosaw";
|
|
9
|
+
readonly similars: "similars";
|
|
10
|
+
readonly viewAndBought: "whosawalsobought";
|
|
11
|
+
readonly accessories: "accessories";
|
|
12
|
+
readonly suggestions: "suggestions";
|
|
13
|
+
};
|
|
14
|
+
export interface CrossSellingFacet {
|
|
15
|
+
key: keyof typeof FACET_CROSS_SELLING_MAP;
|
|
16
|
+
value: string;
|
|
17
|
+
}
|
|
6
18
|
export declare const PLP_FILTERS_SORT: {
|
|
7
19
|
placeholder: string;
|
|
8
20
|
options: {
|
|
@@ -16,6 +28,7 @@ export declare const PLP_FILTERS_SORT: {
|
|
|
16
28
|
};
|
|
17
29
|
default_option: string;
|
|
18
30
|
};
|
|
31
|
+
export declare const SORT_OPTIONS: string[];
|
|
19
32
|
export declare const ObjectFitsDefault: readonly ["contain", "cover", "fill", "none"];
|
|
20
33
|
/**
|
|
21
34
|
* TODO: remove 'textarea-size' from InputSizes in core-compoennts
|
|
@@ -40,6 +53,7 @@ export type COMPONENT_LISTType = Record<string, string>;
|
|
|
40
53
|
export type CREATE_CONTENTType = (jsonData: string) => EditorState;
|
|
41
54
|
export type EXTENDED_BLOCK_RENDER_MAPType = Immutable.Map<any, any>;
|
|
42
55
|
export type ICONSType = Record<string, string>;
|
|
56
|
+
export type ITEMS_PER_PAGEType = number;
|
|
43
57
|
export type FREIGHT_CALCULATIONType = {
|
|
44
58
|
messages: {
|
|
45
59
|
[key: string]: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Dispatch, PropsWithChildren, SetStateAction } from 'react';
|
|
2
|
-
import { ProductSearchResultPage
|
|
2
|
+
import { ProductSearchResultPage } from '../../data/api/search/product';
|
|
3
3
|
import { BreadCrumbItemLinkProps } from '../../layout/team-components/PDCNavigation/intex';
|
|
4
|
-
import { State } from '../../data/api/search';
|
|
4
|
+
import { State, Suggestion } from '../../data/api/search';
|
|
5
5
|
import { Facet, SelectedFacet } from '../../data/api/search/facets';
|
|
6
6
|
import { PLPFilterOption } from '../../layout/team-components/Sort';
|
|
7
7
|
|
|
@@ -9,3 +9,8 @@ export interface GetContentTypeProps {
|
|
|
9
9
|
CMS_PROJECT_NAME: string;
|
|
10
10
|
storeId: string;
|
|
11
11
|
}
|
|
12
|
+
export interface GetCMSContentTypeProps extends Omit<GetContentTypeProps, 'NextCookies' | 'contentType'> {
|
|
13
|
+
contentType: string | null;
|
|
14
|
+
documentId?: string | null;
|
|
15
|
+
versionId?: string | null;
|
|
16
|
+
}
|
|
@@ -4,10 +4,13 @@ export interface FetchOptions {
|
|
|
4
4
|
headers?: Record<string, string>;
|
|
5
5
|
skipSanitize?: boolean;
|
|
6
6
|
priority?: 'low' | 'auto' | 'high';
|
|
7
|
+
cache?: 'no-store' | 'default' | 'force-cache' | 'only-if-cached';
|
|
8
|
+
abort?: boolean;
|
|
9
|
+
signal?: AbortSignal;
|
|
7
10
|
}
|
|
8
|
-
export interface FetchFunctionsProps<T> {
|
|
11
|
+
export interface FetchFunctionsProps<T, U = any> {
|
|
9
12
|
apiUrl: string;
|
|
10
13
|
fetchOptions?: FetchOptions;
|
|
11
|
-
extraData?:
|
|
14
|
+
extraData?: U;
|
|
12
15
|
body?: T;
|
|
13
16
|
}
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
type FilterType = 'PRICERANGE' | 'TEXT' | 'NUMBER' | 'CATEGORYTREE';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
interface Breadcrumb {
|
|
3
|
+
href: string;
|
|
4
|
+
name: string;
|
|
5
|
+
}
|
|
6
|
+
export interface FacetValueBoolean {
|
|
7
|
+
quantity: number;
|
|
8
|
+
name: string;
|
|
9
|
+
key: string;
|
|
10
|
+
value: string;
|
|
11
|
+
selected: boolean;
|
|
5
12
|
}
|
|
6
13
|
type FacetTypeName<T> = T extends FacetValueBoolean ? 'FacetBoolean' : 'FacetRange';
|
|
7
14
|
export interface Facet<T = FacetValueBoolean | FacetValueRange> {
|
|
@@ -13,12 +20,9 @@ export interface Facet<T = FacetValueBoolean | FacetValueRange> {
|
|
|
13
20
|
quantity?: number;
|
|
14
21
|
key: string;
|
|
15
22
|
}
|
|
16
|
-
export interface
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
key: string;
|
|
20
|
-
value: string;
|
|
21
|
-
selected: boolean;
|
|
23
|
+
export interface FacetSearchResult {
|
|
24
|
+
facets: Facet[];
|
|
25
|
+
breadcrumb: Breadcrumb[];
|
|
22
26
|
}
|
|
23
27
|
export interface FacetValueRange {
|
|
24
28
|
quantity: number;
|
|
@@ -28,10 +32,6 @@ export interface FacetValueRange {
|
|
|
28
32
|
to: number;
|
|
29
33
|
};
|
|
30
34
|
}
|
|
31
|
-
interface Breadcrumb {
|
|
32
|
-
href: string;
|
|
33
|
-
name: string;
|
|
34
|
-
}
|
|
35
35
|
export interface SelectedFacet {
|
|
36
36
|
key: string;
|
|
37
37
|
value: string;
|
|
@@ -1,5 +1,13 @@
|
|
|
1
|
+
import { FetchFunctionsProps } from '..';
|
|
1
2
|
import { SelectedFacet } from './facets';
|
|
2
3
|
|
|
4
|
+
export interface Search {
|
|
5
|
+
term: string;
|
|
6
|
+
count: number;
|
|
7
|
+
}
|
|
8
|
+
export interface Suggestion {
|
|
9
|
+
searches: Search[];
|
|
10
|
+
}
|
|
3
11
|
export interface Channel {
|
|
4
12
|
seller?: string;
|
|
5
13
|
regionId?: string;
|
|
@@ -34,26 +42,25 @@ export type StoreSelectedFacet = {
|
|
|
34
42
|
};
|
|
35
43
|
export type Sort = 'price:desc' | 'price:asc' | 'orders:desc' | 'name:desc' | 'name:asc' | 'release:desc' | 'discount:desc' | '';
|
|
36
44
|
export declare type SearchSort = 'price_desc' | 'price_asc' | 'orders_desc' | 'name_desc' | 'name_asc' | 'release_desc' | 'discount_desc' | 'score_desc' | '';
|
|
37
|
-
export interface SearchArgs {
|
|
38
|
-
query?: string;
|
|
39
|
-
page: number;
|
|
40
|
-
count: number;
|
|
41
|
-
type: 'product_search' | 'facets';
|
|
42
|
-
sort?: Sort;
|
|
43
|
-
facets?: SelectedFacet[];
|
|
44
|
-
fuzzy?: '0' | '1' | 'auto';
|
|
45
|
-
hideUnavailableItems?: boolean;
|
|
46
|
-
forceUpdate?: boolean;
|
|
47
|
-
}
|
|
48
45
|
export interface State {
|
|
49
46
|
sort: SearchSort;
|
|
50
47
|
facets: SelectedFacet[];
|
|
51
|
-
term
|
|
48
|
+
term?: string | null;
|
|
52
49
|
base: string;
|
|
53
50
|
page: number;
|
|
54
51
|
count?: number;
|
|
55
52
|
query?: string;
|
|
56
53
|
}
|
|
54
|
+
export interface SearchArgs extends Omit<State, 'sort'> {
|
|
55
|
+
type: 'product_search' | 'facets';
|
|
56
|
+
sort?: Sort;
|
|
57
|
+
fuzzy?: '0' | '1' | 'auto';
|
|
58
|
+
hideUnavailableItems?: boolean;
|
|
59
|
+
}
|
|
60
|
+
export interface SearchAPIBody extends SearchArgs {
|
|
61
|
+
locale?: string;
|
|
62
|
+
}
|
|
63
|
+
export type SearchAPIProps = FetchFunctionsProps<SearchAPIBody>;
|
|
57
64
|
/**
|
|
58
65
|
* TODO: Juntar com ProductType_PDC
|
|
59
66
|
*/
|
|
@@ -134,3 +141,9 @@ export interface SearchProduct {
|
|
|
134
141
|
};
|
|
135
142
|
};
|
|
136
143
|
}
|
|
144
|
+
export type GetSearchFacetsResponse = Promise<{
|
|
145
|
+
data: {
|
|
146
|
+
facets: any[];
|
|
147
|
+
[key: string]: any;
|
|
148
|
+
};
|
|
149
|
+
} | undefined>;
|
|
@@ -35,13 +35,6 @@ interface Page {
|
|
|
35
35
|
export interface First {
|
|
36
36
|
index: number;
|
|
37
37
|
}
|
|
38
|
-
export interface Suggestion {
|
|
39
|
-
searches: Search[];
|
|
40
|
-
}
|
|
41
|
-
export interface Search {
|
|
42
|
-
term: string;
|
|
43
|
-
count: number;
|
|
44
|
-
}
|
|
45
38
|
export interface Attachment {
|
|
46
39
|
name: string;
|
|
47
40
|
content: Record<string, string>;
|
|
@@ -72,6 +65,6 @@ export interface ProductSearchResultPage {
|
|
|
72
65
|
products: {
|
|
73
66
|
cursor: string;
|
|
74
67
|
node: ProductType_PDC;
|
|
75
|
-
}[]
|
|
68
|
+
}[];
|
|
76
69
|
}
|
|
77
70
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ItemType_PDP } from '../../global/product';
|
|
2
|
-
import { MAIN_IMAGEType, NAME_SPLIT_SYMBOLType, SECOND_IMAGEType } from '../../constants';
|
|
2
|
+
import { MAIN_IMAGEType, NAME_SPLIT_SYMBOLType, SECOND_IMAGEType, TEXTURE_IMAGEType } from '../../constants';
|
|
3
3
|
import { ProductCardProps } from '../../layout/team-components/ProductCard';
|
|
4
4
|
|
|
5
5
|
export type GetSkuInfosProps = {
|
|
@@ -18,3 +18,11 @@ export interface GetFirstImagesProps {
|
|
|
18
18
|
second: SECOND_IMAGEType;
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
|
+
export interface SearchCreateProduct {
|
|
22
|
+
MAIN_IMAGE: MAIN_IMAGEType;
|
|
23
|
+
TEXTURE_IMAGE: TEXTURE_IMAGEType;
|
|
24
|
+
}
|
|
25
|
+
export interface SearchCreatePages extends SearchCreateProduct {
|
|
26
|
+
page: number;
|
|
27
|
+
count: number;
|
|
28
|
+
}
|
|
@@ -81,6 +81,7 @@ export type CommertialOfferType = {
|
|
|
81
81
|
ItemMetadataAttachment: any[];
|
|
82
82
|
Price: number;
|
|
83
83
|
ListPrice: number;
|
|
84
|
+
spotPrice: number;
|
|
84
85
|
PriceWithoutDiscount: number;
|
|
85
86
|
FullSellingPrice: number;
|
|
86
87
|
RewardValue: number;
|
|
@@ -156,10 +157,7 @@ interface CommonItemType {
|
|
|
156
157
|
nameComplete: string;
|
|
157
158
|
complementName: string;
|
|
158
159
|
ean: string;
|
|
159
|
-
referenceId:
|
|
160
|
-
Key: string;
|
|
161
|
-
Value: string;
|
|
162
|
-
}>;
|
|
160
|
+
referenceId: ReferenceIdType[];
|
|
163
161
|
measurementUnit: string;
|
|
164
162
|
unitMultiplier: number;
|
|
165
163
|
modalType: any | null;
|
|
@@ -408,6 +406,9 @@ export interface ProductType_APISearch extends CommonProductType_PDP_APISearch {
|
|
|
408
406
|
value: string;
|
|
409
407
|
}>;
|
|
410
408
|
}
|
|
409
|
+
export type ProductType_APISearchNode = {
|
|
410
|
+
node: ProductType_APISearch;
|
|
411
|
+
};
|
|
411
412
|
export type EnhancedSku_APISearch = ItemType_APISearch & {
|
|
412
413
|
isVariantOf: ProductType_APISearch;
|
|
413
414
|
};
|