@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e={},t=Object.freeze(Object.defineProperty({__proto__:null,default:e},Symbol.toStringTag,{value:"Module"}));exports.__viteBrowserExternal=t;exports.fs=e;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { GetContentTypeProps } from '../../../../types/data/api/cms';
|
|
2
|
+
|
|
3
|
+
export declare function cmsBackup(props: GetContentTypeProps): Promise<{
|
|
4
|
+
success: boolean;
|
|
5
|
+
fileName: string;
|
|
6
|
+
error?: undefined;
|
|
7
|
+
} | {
|
|
8
|
+
success: boolean;
|
|
9
|
+
error: {};
|
|
10
|
+
fileName?: undefined;
|
|
11
|
+
}>;
|
package/data/api/cms/index.d.ts
CHANGED
package/data/api/fetchVtex.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FetchOptions } from '../../types/data/api';
|
|
2
2
|
|
|
3
|
-
export declare const fetchVtexOrderForm: (url: string, options?: FetchOptions) => Promise<Record<string, any>>;
|
|
4
3
|
export declare const fetchVtex: (url: string, options?: FetchOptions) => Promise<any>;
|
|
4
|
+
export declare const fetchVtexOrderForm: (url: string, options?: FetchOptions) => Promise<Record<string, any>>;
|
|
5
|
+
export declare function fetchVtexWithAbortController<T>(url: string, options?: FetchOptions): Promise<T | undefined>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FetchFunctionsProps } from '../../../../types/data/api';
|
|
2
|
+
|
|
3
|
+
import * as yup from 'yup';
|
|
4
|
+
declare const schema: yup.ObjectSchema<{
|
|
5
|
+
query: string | undefined;
|
|
6
|
+
}, yup.AnyObject, {
|
|
7
|
+
query: undefined;
|
|
8
|
+
}, "">;
|
|
9
|
+
type SchemaType = yup.InferType<typeof schema>;
|
|
10
|
+
export declare function getSearchAutoCompleteSuggestions({ apiUrl, body, fetchOptions }: FetchFunctionsProps<SchemaType>): Promise<any>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { FetchFunctionsProps } from '../../../../types/data/api';
|
|
2
|
+
import * as yup from 'yup';
|
|
3
|
+
declare const schema: yup.ObjectSchema<{
|
|
4
|
+
facets: {
|
|
5
|
+
value: string;
|
|
6
|
+
key: string;
|
|
7
|
+
}[];
|
|
8
|
+
}, yup.AnyObject, {
|
|
9
|
+
facets: "";
|
|
10
|
+
}, "">;
|
|
11
|
+
type SchemaType = yup.InferType<typeof schema>;
|
|
12
|
+
export declare function getSearchCrossellingProducts({ apiUrl, body, fetchOptions }: FetchFunctionsProps<SchemaType>): Promise<{
|
|
13
|
+
node: {
|
|
14
|
+
sku: any;
|
|
15
|
+
gtin: any;
|
|
16
|
+
name: any;
|
|
17
|
+
description: any;
|
|
18
|
+
releaseDate: any;
|
|
19
|
+
slug: any;
|
|
20
|
+
video: any;
|
|
21
|
+
categories: any;
|
|
22
|
+
categoriesIds: any;
|
|
23
|
+
collection: any;
|
|
24
|
+
collectionId: any;
|
|
25
|
+
id: any;
|
|
26
|
+
brand: {
|
|
27
|
+
name: any;
|
|
28
|
+
brandName: any;
|
|
29
|
+
};
|
|
30
|
+
seo: {
|
|
31
|
+
description: any;
|
|
32
|
+
title: any;
|
|
33
|
+
canonical: string;
|
|
34
|
+
};
|
|
35
|
+
cluster: {
|
|
36
|
+
generals: any;
|
|
37
|
+
highlights: never[];
|
|
38
|
+
};
|
|
39
|
+
availability: {
|
|
40
|
+
status: boolean;
|
|
41
|
+
};
|
|
42
|
+
breadcrumbList: {
|
|
43
|
+
itemListElement: any[];
|
|
44
|
+
numberOfItems: any;
|
|
45
|
+
};
|
|
46
|
+
image: {
|
|
47
|
+
alternateName: string;
|
|
48
|
+
url: string;
|
|
49
|
+
keywords: string;
|
|
50
|
+
}[];
|
|
51
|
+
offers: {
|
|
52
|
+
lowPrice: number;
|
|
53
|
+
highPrice: number;
|
|
54
|
+
offers: {
|
|
55
|
+
availability: boolean;
|
|
56
|
+
listPrice: number;
|
|
57
|
+
price: number;
|
|
58
|
+
priceValidUntil: string;
|
|
59
|
+
priceCurrency: string;
|
|
60
|
+
installments: import('../../../../types/global/product').InstallmentType[];
|
|
61
|
+
lowPrice: number;
|
|
62
|
+
quantity: number;
|
|
63
|
+
seller: {
|
|
64
|
+
identifier: string;
|
|
65
|
+
};
|
|
66
|
+
}[];
|
|
67
|
+
};
|
|
68
|
+
additionalProperty: ({
|
|
69
|
+
name: string;
|
|
70
|
+
value: Record<string, string>;
|
|
71
|
+
valueReference: "ATTACHMENT";
|
|
72
|
+
} | {
|
|
73
|
+
propertyID: string;
|
|
74
|
+
name: string;
|
|
75
|
+
value: string;
|
|
76
|
+
valueReference: {
|
|
77
|
+
valueReference: "ATTRIBUTE";
|
|
78
|
+
visible: boolean;
|
|
79
|
+
};
|
|
80
|
+
} | {
|
|
81
|
+
name: string;
|
|
82
|
+
value: string;
|
|
83
|
+
valueReference: "SPECIFICATION";
|
|
84
|
+
})[];
|
|
85
|
+
isVariantOf: {
|
|
86
|
+
productGroupID: any;
|
|
87
|
+
hasVariant: any;
|
|
88
|
+
};
|
|
89
|
+
installments: {
|
|
90
|
+
count: number;
|
|
91
|
+
value: number;
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
}[] | undefined>;
|
|
95
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FetchFunctionsProps } from '../../../../types/data/api';
|
|
2
|
+
import * as yup from 'yup';
|
|
3
|
+
declare const schema: yup.ObjectSchema<{
|
|
4
|
+
query: string | undefined;
|
|
5
|
+
locale: string | undefined;
|
|
6
|
+
}, yup.AnyObject, {
|
|
7
|
+
query: undefined;
|
|
8
|
+
locale: undefined;
|
|
9
|
+
}, "">;
|
|
10
|
+
type SchemaType = yup.InferType<typeof schema>;
|
|
11
|
+
export declare function getSearchSuggestedTerms({ apiUrl, body, fetchOptions }: FetchFunctionsProps<SchemaType>): Promise<any>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { GetContentTypeProps } from '../../../types/data/api/cms';
|
|
2
|
+
|
|
3
|
+
export declare function backupContentType({ contentType, storeId, CMS_PROJECT_NAME, NextCookies }: GetContentTypeProps): Promise<{
|
|
4
|
+
success: boolean;
|
|
5
|
+
fileName: string;
|
|
6
|
+
error?: undefined;
|
|
7
|
+
} | {
|
|
8
|
+
success: boolean;
|
|
9
|
+
error: {};
|
|
10
|
+
fileName?: undefined;
|
|
11
|
+
}>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Facet, FacetSearchResult, FacetValueBoolean, FacetValueRange, FuzzyFacet, OperatorFacet, SelectedFacet } from '../../../types/data/api/search/facets';
|
|
2
|
+
import { Channel, StoreSelectedFacet } from '../../../types/data/api/search';
|
|
3
|
+
import { CrossSellingFacet } from '../../../types/constants';
|
|
4
|
+
|
|
5
|
+
export declare const isRootFacet: (facetKey: string, isDepartment: boolean) => boolean;
|
|
6
|
+
export declare const isOperatorFacet: (facet: SelectedFacet) => facet is OperatorFacet;
|
|
7
|
+
export declare const isFacetBoolean: (facet: Facet) => facet is Facet<FacetValueBoolean>;
|
|
8
|
+
export declare const isCrossSelling: (x: string) => x is CrossSellingFacet["key"];
|
|
9
|
+
export declare const findCrossSelling: (facets?: SelectedFacet[]) => CrossSellingFacet | null;
|
|
10
|
+
export declare const findSlug: (facets?: SelectedFacet[]) => string | null;
|
|
11
|
+
export declare const findSkuId: (facets?: SelectedFacet[]) => string | null;
|
|
12
|
+
export declare const findLocale: (facets?: SelectedFacet[]) => string | null;
|
|
13
|
+
export declare const findChannel: (facets?: SelectedFacet[]) => string | null;
|
|
14
|
+
export declare const isFuzzyFacet: (facet: SelectedFacet) => facet is FuzzyFacet;
|
|
15
|
+
export declare const facetBoolean: (item: Facet<FacetValueBoolean>) => {
|
|
16
|
+
__typename: string;
|
|
17
|
+
key: string;
|
|
18
|
+
label: string;
|
|
19
|
+
values: FacetValueBoolean[];
|
|
20
|
+
};
|
|
21
|
+
export declare const facetRange: ({ key, values }: Facet<FacetValueRange>) => {
|
|
22
|
+
__typename: string;
|
|
23
|
+
key: string;
|
|
24
|
+
values: FacetValueRange[];
|
|
25
|
+
};
|
|
26
|
+
export declare const formattedFacets: (data: FacetSearchResult, selectedFacets: SelectedFacet[], isCollectionPage?: any) => ({
|
|
27
|
+
__typename: string;
|
|
28
|
+
key: string;
|
|
29
|
+
label: string;
|
|
30
|
+
values: FacetValueBoolean[];
|
|
31
|
+
} | {
|
|
32
|
+
__typename: string;
|
|
33
|
+
key: string;
|
|
34
|
+
values: FacetValueRange[];
|
|
35
|
+
})[];
|
|
36
|
+
export declare const addSearchParamsFacets: (facets: SelectedFacet[], params: URLSearchParams) => void;
|
|
37
|
+
export declare const selectedFacets: (facets: string[]) => {
|
|
38
|
+
key: string;
|
|
39
|
+
value: string;
|
|
40
|
+
}[];
|
|
41
|
+
export declare const filterRootFacets: (selectedFacets: SelectedFacet[]) => SelectedFacet[];
|
|
42
|
+
export declare const filterNonRootFacets: (selectedFacets: SelectedFacet[], base?: string | null) => {
|
|
43
|
+
value: string;
|
|
44
|
+
key: string;
|
|
45
|
+
}[];
|
|
46
|
+
export declare const addDefaultFacets: (facets: SelectedFacet[], channel: Channel, policy?: string, region?: string) => SelectedFacet[];
|
|
47
|
+
export declare const getRegionFacet: (channel: Channel, region?: string) => StoreSelectedFacet | null;
|
|
48
|
+
export declare const getPolicyFacet: (channel: Channel, key?: string) => StoreSelectedFacet | null;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare const searchHelpers: {
|
|
2
|
+
parseSearchState: ({ pathname, searchParams }: URL, facets: string[]) => import('../../../types/data/api/search').State;
|
|
3
|
+
convertSearchParams: (searchParams: {
|
|
4
|
+
[key: string]: string | string[] | undefined;
|
|
5
|
+
}) => URLSearchParams;
|
|
6
|
+
filterNonRootFacets: (selectedFacets: import('../../../types/data/api/search/facets').SelectedFacet[], base?: string | null) => {
|
|
7
|
+
value: string;
|
|
8
|
+
key: string;
|
|
9
|
+
}[];
|
|
10
|
+
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>[];
|
|
11
|
+
};
|
|
12
|
+
export default searchHelpers;
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
import { SearchCreatePages, SearchCreateProduct } from '../../../../types/data/helpers';
|
|
2
|
+
import { ProductType_APISearch, EnhancedSku_APISearch, ProductNode_PDC } from '../../../../types/global/product';
|
|
3
|
+
import { Page } from '../../../../types/contexts/contexts/plp';
|
|
4
|
+
|
|
5
|
+
export declare const getInstallments: (installments: EnhancedSku_APISearch["sellers"][0]["commertialOffer"]["Installments"]) => {
|
|
6
|
+
count: number;
|
|
7
|
+
value: number;
|
|
8
|
+
};
|
|
9
|
+
export declare const getOffers: (sellers: EnhancedSku_APISearch["sellers"], product: ProductType_APISearch) => {
|
|
10
|
+
lowPrice: number;
|
|
11
|
+
highPrice: number;
|
|
12
|
+
offers: {
|
|
13
|
+
availability: boolean;
|
|
14
|
+
listPrice: number;
|
|
15
|
+
price: number;
|
|
16
|
+
priceValidUntil: string;
|
|
17
|
+
priceCurrency: string;
|
|
18
|
+
installments: import('../../../../types/global/product').InstallmentType[];
|
|
19
|
+
lowPrice: number;
|
|
20
|
+
quantity: number;
|
|
21
|
+
seller: {
|
|
22
|
+
identifier: string;
|
|
23
|
+
};
|
|
24
|
+
}[];
|
|
25
|
+
};
|
|
26
|
+
export declare const getHasVariant: (item: ProductType_APISearch["items"][0]) => {
|
|
27
|
+
additionalProperty: ({
|
|
28
|
+
name: string;
|
|
29
|
+
value: Record<string, string>;
|
|
30
|
+
valueReference: "ATTACHMENT";
|
|
31
|
+
} | {
|
|
32
|
+
propertyID: string;
|
|
33
|
+
name: string;
|
|
34
|
+
value: string;
|
|
35
|
+
valueReference: {
|
|
36
|
+
valueReference: "ATTRIBUTE";
|
|
37
|
+
visible: boolean;
|
|
38
|
+
};
|
|
39
|
+
} | {
|
|
40
|
+
name: string;
|
|
41
|
+
value: string;
|
|
42
|
+
valueReference: "SPECIFICATION";
|
|
43
|
+
})[];
|
|
44
|
+
name: string;
|
|
45
|
+
offers: {
|
|
46
|
+
offers: {
|
|
47
|
+
availability: string;
|
|
48
|
+
listPrice: number;
|
|
49
|
+
price: number;
|
|
50
|
+
quantity: number;
|
|
51
|
+
seller: {
|
|
52
|
+
identifier: string;
|
|
53
|
+
};
|
|
54
|
+
}[];
|
|
55
|
+
};
|
|
56
|
+
sku: string;
|
|
57
|
+
};
|
|
58
|
+
export declare const formattedProduct: (item: EnhancedSku_APISearch) => {
|
|
59
|
+
sku: string;
|
|
60
|
+
gtin: string;
|
|
61
|
+
name: string;
|
|
62
|
+
description: string;
|
|
63
|
+
releaseDate: string;
|
|
64
|
+
slug: string;
|
|
65
|
+
video: string;
|
|
66
|
+
categories: string[];
|
|
67
|
+
categoriesIds: string[];
|
|
68
|
+
id: string;
|
|
69
|
+
brand: {
|
|
70
|
+
name: string;
|
|
71
|
+
brandName: string;
|
|
72
|
+
};
|
|
73
|
+
seo: {
|
|
74
|
+
description: string;
|
|
75
|
+
title: string;
|
|
76
|
+
canonical: string;
|
|
77
|
+
};
|
|
78
|
+
cluster: {
|
|
79
|
+
generals: Record<string, string>;
|
|
80
|
+
highlights: Record<string, any>;
|
|
81
|
+
};
|
|
82
|
+
properties: {
|
|
83
|
+
name: string;
|
|
84
|
+
values: string[];
|
|
85
|
+
}[];
|
|
86
|
+
availability: {
|
|
87
|
+
status: boolean;
|
|
88
|
+
};
|
|
89
|
+
breadcrumbList: {
|
|
90
|
+
itemListElement: {
|
|
91
|
+
name: string;
|
|
92
|
+
item: string;
|
|
93
|
+
position: number;
|
|
94
|
+
}[];
|
|
95
|
+
numberOfItems: number;
|
|
96
|
+
};
|
|
97
|
+
image: {
|
|
98
|
+
alternateName: string;
|
|
99
|
+
url: string;
|
|
100
|
+
keywords: string;
|
|
101
|
+
}[];
|
|
102
|
+
offers: {
|
|
103
|
+
lowPrice: number;
|
|
104
|
+
highPrice: number;
|
|
105
|
+
offers: {
|
|
106
|
+
availability: boolean;
|
|
107
|
+
listPrice: number;
|
|
108
|
+
price: number;
|
|
109
|
+
priceValidUntil: string;
|
|
110
|
+
priceCurrency: string;
|
|
111
|
+
installments: import('../../../../types/global/product').InstallmentType[];
|
|
112
|
+
lowPrice: number;
|
|
113
|
+
quantity: number;
|
|
114
|
+
seller: {
|
|
115
|
+
identifier: string;
|
|
116
|
+
};
|
|
117
|
+
}[];
|
|
118
|
+
};
|
|
119
|
+
additionalProperty: ({
|
|
120
|
+
name: string;
|
|
121
|
+
value: Record<string, string>;
|
|
122
|
+
valueReference: "ATTACHMENT";
|
|
123
|
+
} | {
|
|
124
|
+
propertyID: string;
|
|
125
|
+
name: string;
|
|
126
|
+
value: string;
|
|
127
|
+
valueReference: {
|
|
128
|
+
valueReference: "ATTRIBUTE";
|
|
129
|
+
visible: boolean;
|
|
130
|
+
};
|
|
131
|
+
} | {
|
|
132
|
+
name: string;
|
|
133
|
+
value: string;
|
|
134
|
+
valueReference: "SPECIFICATION";
|
|
135
|
+
})[];
|
|
136
|
+
isVariantOf: {
|
|
137
|
+
productGroupID: string;
|
|
138
|
+
hasVariant: {
|
|
139
|
+
additionalProperty: ({
|
|
140
|
+
name: string;
|
|
141
|
+
value: Record<string, string>;
|
|
142
|
+
valueReference: "ATTACHMENT";
|
|
143
|
+
} | {
|
|
144
|
+
propertyID: string;
|
|
145
|
+
name: string;
|
|
146
|
+
value: string;
|
|
147
|
+
valueReference: {
|
|
148
|
+
valueReference: "ATTRIBUTE";
|
|
149
|
+
visible: boolean;
|
|
150
|
+
};
|
|
151
|
+
} | {
|
|
152
|
+
name: string;
|
|
153
|
+
value: string;
|
|
154
|
+
valueReference: "SPECIFICATION";
|
|
155
|
+
})[];
|
|
156
|
+
name: string;
|
|
157
|
+
offers: {
|
|
158
|
+
offers: {
|
|
159
|
+
availability: string;
|
|
160
|
+
listPrice: number;
|
|
161
|
+
price: number;
|
|
162
|
+
quantity: number;
|
|
163
|
+
seller: {
|
|
164
|
+
identifier: string;
|
|
165
|
+
};
|
|
166
|
+
}[];
|
|
167
|
+
};
|
|
168
|
+
sku: string;
|
|
169
|
+
}[];
|
|
170
|
+
};
|
|
171
|
+
installments: {
|
|
172
|
+
count: number;
|
|
173
|
+
value: number;
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
export declare const formattedRecommendationProduct: (item: any) => {
|
|
177
|
+
sku: any;
|
|
178
|
+
gtin: any;
|
|
179
|
+
name: any;
|
|
180
|
+
description: any;
|
|
181
|
+
releaseDate: any;
|
|
182
|
+
slug: any;
|
|
183
|
+
video: any;
|
|
184
|
+
categories: any;
|
|
185
|
+
categoriesIds: any;
|
|
186
|
+
collection: any;
|
|
187
|
+
collectionId: any;
|
|
188
|
+
id: any;
|
|
189
|
+
brand: {
|
|
190
|
+
name: any;
|
|
191
|
+
brandName: any;
|
|
192
|
+
};
|
|
193
|
+
seo: {
|
|
194
|
+
description: any;
|
|
195
|
+
title: any;
|
|
196
|
+
canonical: string;
|
|
197
|
+
};
|
|
198
|
+
cluster: {
|
|
199
|
+
generals: any;
|
|
200
|
+
highlights: never[];
|
|
201
|
+
};
|
|
202
|
+
availability: {
|
|
203
|
+
status: boolean;
|
|
204
|
+
};
|
|
205
|
+
breadcrumbList: {
|
|
206
|
+
itemListElement: any[];
|
|
207
|
+
numberOfItems: any;
|
|
208
|
+
};
|
|
209
|
+
image: {
|
|
210
|
+
alternateName: string;
|
|
211
|
+
url: string;
|
|
212
|
+
keywords: string;
|
|
213
|
+
}[];
|
|
214
|
+
offers: {
|
|
215
|
+
lowPrice: number;
|
|
216
|
+
highPrice: number;
|
|
217
|
+
offers: {
|
|
218
|
+
availability: boolean;
|
|
219
|
+
listPrice: number;
|
|
220
|
+
price: number;
|
|
221
|
+
priceValidUntil: string;
|
|
222
|
+
priceCurrency: string;
|
|
223
|
+
installments: import('../../../../types/global/product').InstallmentType[];
|
|
224
|
+
lowPrice: number;
|
|
225
|
+
quantity: number;
|
|
226
|
+
seller: {
|
|
227
|
+
identifier: string;
|
|
228
|
+
};
|
|
229
|
+
}[];
|
|
230
|
+
};
|
|
231
|
+
additionalProperty: ({
|
|
232
|
+
name: string;
|
|
233
|
+
value: Record<string, string>;
|
|
234
|
+
valueReference: "ATTACHMENT";
|
|
235
|
+
} | {
|
|
236
|
+
propertyID: string;
|
|
237
|
+
name: string;
|
|
238
|
+
value: string;
|
|
239
|
+
valueReference: {
|
|
240
|
+
valueReference: "ATTRIBUTE";
|
|
241
|
+
visible: boolean;
|
|
242
|
+
};
|
|
243
|
+
} | {
|
|
244
|
+
name: string;
|
|
245
|
+
value: string;
|
|
246
|
+
valueReference: "SPECIFICATION";
|
|
247
|
+
})[];
|
|
248
|
+
isVariantOf: {
|
|
249
|
+
productGroupID: any;
|
|
250
|
+
hasVariant: any;
|
|
251
|
+
};
|
|
252
|
+
installments: {
|
|
253
|
+
count: number;
|
|
254
|
+
value: number;
|
|
255
|
+
};
|
|
256
|
+
};
|
|
257
|
+
export declare const createProduct: ({ MAIN_IMAGE, TEXTURE_IMAGE }: SearchCreateProduct) => ProductNode_PDC;
|
|
258
|
+
export declare const createPages: ({ page, count, ...props }: SearchCreatePages) => {
|
|
259
|
+
loading: boolean;
|
|
260
|
+
page: number;
|
|
261
|
+
pagination: {
|
|
262
|
+
nextPage: boolean;
|
|
263
|
+
previousPage: boolean;
|
|
264
|
+
startCursor: string;
|
|
265
|
+
endCursor: string;
|
|
266
|
+
count: number;
|
|
267
|
+
total: number;
|
|
268
|
+
};
|
|
269
|
+
products: ProductNode_PDC[];
|
|
270
|
+
}[];
|
|
271
|
+
export declare const createPage: (pages: Page[], newPage: number) => Page[];
|
|
272
|
+
export declare const createPagination: () => {
|
|
273
|
+
nextPage: boolean;
|
|
274
|
+
previousPage: boolean;
|
|
275
|
+
startCursor: string;
|
|
276
|
+
endCursor: string;
|
|
277
|
+
count: number;
|
|
278
|
+
total: number;
|
|
279
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const canonicalPDPLink: (linkText: string) => string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CommertialOfferType, EnhancedCommercialOffer_APISearch, EnhancedSku_APISearch, ItemType_APISearch, ProductType_APISearch } from '../../../../../types/global/product';
|
|
2
|
+
|
|
3
|
+
export declare const sanitizeProduct: (product: ProductType_APISearch) => ProductType_APISearch;
|
|
4
|
+
export declare const enhanceCommercialOffer: <S, P>({ offer, seller, product, }: {
|
|
5
|
+
offer: CommertialOfferType;
|
|
6
|
+
seller: S;
|
|
7
|
+
product: P;
|
|
8
|
+
}) => EnhancedCommercialOffer_APISearch<S, P>;
|
|
9
|
+
export declare const enhanceSku: (item: ItemType_APISearch, product: ProductType_APISearch) => EnhancedSku_APISearch;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CommertialOfferType } from '../../../../../types/global/product';
|
|
2
|
+
|
|
3
|
+
export declare const availability: (available: boolean) => "https://schema.org/OutOfStock" | "https://schema.org/InStock";
|
|
4
|
+
export declare const inStock: (offer: Pick<CommertialOfferType, "AvailableQuantity">) => boolean;
|
|
5
|
+
export declare const price: (offer: Pick<CommertialOfferType, "spotPrice">) => number;
|
|
6
|
+
export declare const sellingPrice: (offer: CommertialOfferType) => number;
|
|
7
|
+
export declare const bestOfferFirst: (a: Pick<CommertialOfferType, "AvailableQuantity" | "spotPrice">, b: Pick<CommertialOfferType, "AvailableQuantity" | "spotPrice">) => number;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Attachment } from '../../../../../types/data/api/search/product';
|
|
2
|
+
import { ItemType_APISearch } from '../../../../../types/global/product';
|
|
3
|
+
|
|
4
|
+
export declare const additionalProperty: (variations: ItemType_APISearch["variations"], attributes: ItemType_APISearch["attributes"], attachments?: Attachment[]) => ({
|
|
5
|
+
name: string;
|
|
6
|
+
value: Record<string, string>;
|
|
7
|
+
valueReference: "ATTACHMENT";
|
|
8
|
+
} | {
|
|
9
|
+
propertyID: string;
|
|
10
|
+
name: string;
|
|
11
|
+
value: string;
|
|
12
|
+
valueReference: {
|
|
13
|
+
valueReference: "ATTRIBUTE";
|
|
14
|
+
visible: boolean;
|
|
15
|
+
};
|
|
16
|
+
} | {
|
|
17
|
+
name: string;
|
|
18
|
+
value: string;
|
|
19
|
+
valueReference: "SPECIFICATION";
|
|
20
|
+
})[];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { default as sanitizeHtmlLib } from 'sanitize-html';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* For now, we're using sanitize-html's default set
|
|
5
|
+
* of allowed tags and attributes, which don't even include img elements
|
|
6
|
+
*
|
|
7
|
+
* It is known many client depends on pontentially vulnerable tags, such as script tags
|
|
8
|
+
* We chose to be restrictive at first, and document those restrictions later.
|
|
9
|
+
*
|
|
10
|
+
* When expanding the set of allowed tags and attributes, please consider performance, privacy and security.
|
|
11
|
+
*
|
|
12
|
+
* This possibily breaks compatibility with Portal and Store Framework,
|
|
13
|
+
* which both allows an enormous amount of tags and attributes
|
|
14
|
+
*
|
|
15
|
+
* This was a thoughtful decision that can be reviewed in the future given
|
|
16
|
+
* research was made to back up those changes.
|
|
17
|
+
*/
|
|
18
|
+
export declare const sanitizeHtml: (dirty: Parameters<typeof sanitizeHtmlLib>[0], options?: Parameters<typeof sanitizeHtmlLib>[1]) => string;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ItemType_APISearch } from '../../../../../types/global/product';
|
|
2
|
+
|
|
3
|
+
export declare const min: <T>(array: T[], cmp: (a: T, b: T) => number) => T;
|
|
4
|
+
export declare const isValidSkuId: (skuId: string) => boolean;
|
|
5
|
+
export declare const pickBestSku: (skus: ItemType_APISearch[]) => ItemType_APISearch;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const slugify: (str: string) => string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Facet, FacetValueBoolean, SelectedFacet } from '../../../types/data/api/search/facets';
|
|
2
|
+
|
|
3
|
+
export declare const POLICY_KEY = "trade-policy";
|
|
4
|
+
export declare const REGION_KEY = "region-id";
|
|
5
|
+
export declare const FUZZY_KEY = "fuzzy";
|
|
6
|
+
export declare const OPERATOR_KEY = "operator";
|
|
7
|
+
export declare const EXTRA_FACETS_KEYS: Set<string>;
|
|
8
|
+
export declare const isCategoryBrand: (selectedFacets: SelectedFacet[]) => {
|
|
9
|
+
isDepartment: boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare const filterNonCategorySelected: (facets: Facet[], base?: string | null) => Facet<FacetValueBoolean | import('../../../types/data/api/search/facets').FacetValueRange>[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { State } from '../../../types/data/api/search';
|
|
2
|
+
|
|
3
|
+
export declare const parseSearchState: ({ pathname, searchParams }: URL, facets: string[]) => State;
|
|
4
|
+
export declare const createCategorySlug: (slug: string[] | string, facets: string[]) => string;
|
|
5
|
+
export declare const convertSearchParams: (searchParams: {
|
|
6
|
+
[key: string]: string | string[] | undefined;
|
|
7
|
+
}) => URLSearchParams;
|