@usereactify/search 5.0.0-beta.1 → 5.0.0-beta.4
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/CHANGELOG.md +16 -0
- package/dist/package.json +70 -0
- package/dist/src/components/Example/ExampleFilterList.d.ts +4 -0
- package/dist/src/components/Example/ExampleFilterList.js +20 -0
- package/dist/src/components/Example/ExampleFilterList.js.map +1 -0
- package/dist/src/components/Example/ExampleFilterRange.d.ts +4 -0
- package/dist/src/components/Example/ExampleFilterRange.js +22 -0
- package/dist/src/components/Example/ExampleFilterRange.js.map +1 -0
- package/dist/src/components/Example/ExampleFilterSlider.d.ts +4 -0
- package/dist/src/components/Example/ExampleFilterSlider.js +21 -0
- package/dist/src/components/Example/ExampleFilterSlider.js.map +1 -0
- package/dist/src/components/Example/ExampleFilterStack.d.ts +4 -0
- package/dist/src/components/Example/ExampleFilterStack.js +13 -0
- package/dist/src/components/Example/ExampleFilterStack.js.map +1 -0
- package/dist/src/components/Example/ExampleResultCardCallout.d.ts +4 -0
- package/dist/src/components/Example/ExampleResultCardCallout.js +22 -0
- package/dist/src/components/Example/ExampleResultCardCallout.js.map +1 -0
- package/dist/src/components/Example/ExampleResultCardProduct.d.ts +4 -0
- package/dist/src/components/Example/ExampleResultCardProduct.js +19 -0
- package/dist/src/components/Example/ExampleResultCardProduct.js.map +1 -0
- package/dist/src/components/Example/ExampleResultPaginationLoadMore.d.ts +4 -0
- package/dist/src/components/Example/ExampleResultPaginationLoadMore.js +12 -0
- package/dist/src/components/Example/ExampleResultPaginationLoadMore.js.map +1 -0
- package/dist/src/components/Example/ExampleResultPaginationNextPrev.d.ts +4 -0
- package/dist/src/components/Example/ExampleResultPaginationNextPrev.js +14 -0
- package/dist/src/components/Example/ExampleResultPaginationNextPrev.js.map +1 -0
- package/dist/src/components/Example/ExampleResultPaginationNumbered.d.ts +4 -0
- package/dist/src/components/Example/ExampleResultPaginationNumbered.js +27 -0
- package/dist/src/components/Example/ExampleResultPaginationNumbered.js.map +1 -0
- package/dist/src/components/Example/ExampleSortby.d.ts +4 -0
- package/dist/src/components/Example/ExampleSortby.js +13 -0
- package/dist/src/components/Example/ExampleSortby.js.map +1 -0
- package/dist/src/components/Example/index.d.ts +10 -0
- package/dist/src/components/Example/index.js +23 -0
- package/dist/src/components/Example/index.js.map +1 -0
- package/dist/src/components/Filter/Filter.d.ts +20 -0
- package/dist/src/components/Filter/Filter.js +90 -0
- package/dist/src/components/Filter/Filter.js.map +1 -0
- package/dist/src/components/Filter/FilterStack.d.ts +7 -0
- package/dist/src/components/Filter/FilterStack.js +17 -0
- package/dist/src/components/Filter/FilterStack.js.map +1 -0
- package/dist/src/components/Filter/index.d.ts +2 -0
- package/dist/src/components/Filter/index.js +15 -0
- package/dist/src/components/Filter/index.js.map +1 -0
- package/dist/src/components/ReactifySearchBase/ReactifySearchBase.d.ts +42 -0
- package/dist/src/components/ReactifySearchBase/ReactifySearchBase.js +143 -0
- package/dist/src/components/ReactifySearchBase/ReactifySearchBase.js.map +1 -0
- package/dist/src/components/ReactifySearchBase/index.d.ts +1 -0
- package/dist/src/components/ReactifySearchBase/index.js +14 -0
- package/dist/src/components/ReactifySearchBase/index.js.map +1 -0
- package/dist/src/components/Result/ResultCardCallout.d.ts +12 -0
- package/dist/src/components/Result/ResultCardCallout.js +47 -0
- package/dist/src/components/Result/ResultCardCallout.js.map +1 -0
- package/dist/src/components/Result/ResultCardProduct.d.ts +13 -0
- package/dist/src/components/Result/ResultCardProduct.js +64 -0
- package/dist/src/components/Result/ResultCardProduct.js.map +1 -0
- package/dist/src/components/Result/ResultPaginationLoadMore.d.ts +7 -0
- package/dist/src/components/Result/ResultPaginationLoadMore.js +17 -0
- package/dist/src/components/Result/ResultPaginationLoadMore.js.map +1 -0
- package/dist/src/components/Result/ResultPaginationNextPrev.d.ts +7 -0
- package/dist/src/components/Result/ResultPaginationNextPrev.js +17 -0
- package/dist/src/components/Result/ResultPaginationNextPrev.js.map +1 -0
- package/dist/src/components/Result/ResultPaginationNumbered.d.ts +7 -0
- package/dist/src/components/Result/ResultPaginationNumbered.js +20 -0
- package/dist/src/components/Result/ResultPaginationNumbered.js.map +1 -0
- package/dist/src/components/Result/ResultStack.d.ts +40 -0
- package/dist/src/components/Result/ResultStack.js +108 -0
- package/dist/src/components/Result/ResultStack.js.map +1 -0
- package/dist/src/components/Result/ResultStateProvider.d.ts +6 -0
- package/dist/src/components/Result/ResultStateProvider.js +11 -0
- package/dist/src/components/Result/ResultStateProvider.js.map +1 -0
- package/dist/src/components/Result/index.d.ts +7 -0
- package/dist/src/components/Result/index.js +20 -0
- package/dist/src/components/Result/index.js.map +1 -0
- package/dist/src/components/Search/SearchInput.d.ts +8 -0
- package/dist/src/components/Search/SearchInput.js +18 -0
- package/dist/src/components/Search/SearchInput.js.map +1 -0
- package/dist/src/components/Search/index.d.ts +1 -0
- package/dist/src/components/Search/index.js +14 -0
- package/dist/src/components/Search/index.js.map +1 -0
- package/dist/src/components/Sensor/SensorCollection.d.ts +2 -0
- package/dist/src/components/Sensor/SensorCollection.js +45 -0
- package/dist/src/components/Sensor/SensorCollection.js.map +1 -0
- package/dist/src/components/Sensor/SensorInventoryAvailable.d.ts +2 -0
- package/dist/src/components/Sensor/SensorInventoryAvailable.js +53 -0
- package/dist/src/components/Sensor/SensorInventoryAvailable.js.map +1 -0
- package/dist/src/components/Sensor/SensorPublished.d.ts +2 -0
- package/dist/src/components/Sensor/SensorPublished.js +17 -0
- package/dist/src/components/Sensor/SensorPublished.js.map +1 -0
- package/dist/src/components/Sensor/SensorSearch.d.ts +2 -0
- package/dist/src/components/Sensor/SensorSearch.js +83 -0
- package/dist/src/components/Sensor/SensorSearch.js.map +1 -0
- package/dist/src/components/Sensor/SensorSort.d.ts +2 -0
- package/dist/src/components/Sensor/SensorSort.js +205 -0
- package/dist/src/components/Sensor/SensorSort.js.map +1 -0
- package/dist/src/components/Sensor/SensorSortScore.d.ts +2 -0
- package/dist/src/components/Sensor/SensorSortScore.js +13 -0
- package/dist/src/components/Sensor/SensorSortScore.js.map +1 -0
- package/dist/src/components/Sensor/SensorStack.d.ts +3 -0
- package/dist/src/components/Sensor/SensorStack.js +32 -0
- package/dist/src/components/Sensor/SensorStack.js.map +1 -0
- package/dist/src/components/Sensor/index.d.ts +8 -0
- package/dist/src/components/Sensor/index.js +30 -0
- package/dist/src/components/Sensor/index.js.map +1 -0
- package/dist/src/components/Sortby/Sortby.d.ts +7 -0
- package/dist/src/components/Sortby/Sortby.js +17 -0
- package/dist/src/components/Sortby/Sortby.js.map +1 -0
- package/dist/src/components/Sortby/index.d.ts +1 -0
- package/dist/src/components/Sortby/index.js +14 -0
- package/dist/src/components/Sortby/index.js.map +1 -0
- package/dist/src/components/Utility/UtilityAuthenticatedReactiveBase.d.ts +2 -0
- package/dist/src/components/Utility/UtilityAuthenticatedReactiveBase.js +15 -0
- package/dist/src/components/Utility/UtilityAuthenticatedReactiveBase.js.map +1 -0
- package/dist/src/components/Utility/index.d.ts +1 -0
- package/dist/src/components/Utility/index.js +14 -0
- package/dist/src/components/Utility/index.js.map +1 -0
- package/dist/src/components/index.d.ts +8 -0
- package/dist/src/components/index.js +21 -0
- package/dist/src/components/index.js.map +1 -0
- package/dist/src/hooks/index.d.ts +14 -0
- package/dist/src/hooks/index.js +27 -0
- package/dist/src/hooks/index.js.map +1 -0
- package/dist/src/hooks/reactivesearch/index.d.ts +8 -0
- package/dist/src/hooks/reactivesearch/index.js +21 -0
- package/dist/src/hooks/reactivesearch/index.js.map +1 -0
- package/dist/src/hooks/reactivesearch/useReactiveBaseProps.d.ts +7 -0
- package/dist/src/hooks/reactivesearch/useReactiveBaseProps.js +44 -0
- package/dist/src/hooks/reactivesearch/useReactiveBaseProps.js.map +1 -0
- package/dist/src/hooks/reactivesearch/useReactiveDataSearchProps.d.ts +26 -0
- package/dist/src/hooks/reactivesearch/useReactiveDataSearchProps.js +71 -0
- package/dist/src/hooks/reactivesearch/useReactiveDataSearchProps.js.map +1 -0
- package/dist/src/hooks/reactivesearch/useReactiveFilterListProps.d.ts +73 -0
- package/dist/src/hooks/reactivesearch/useReactiveFilterListProps.js +22 -0
- package/dist/src/hooks/reactivesearch/useReactiveFilterListProps.js.map +1 -0
- package/dist/src/hooks/reactivesearch/useReactiveFilterRangeProps.d.ts +70 -0
- package/dist/src/hooks/reactivesearch/useReactiveFilterRangeProps.js +22 -0
- package/dist/src/hooks/reactivesearch/useReactiveFilterRangeProps.js.map +1 -0
- package/dist/src/hooks/reactivesearch/useReactiveFilterSharedProps.d.ts +67 -0
- package/dist/src/hooks/reactivesearch/useReactiveFilterSharedProps.js +106 -0
- package/dist/src/hooks/reactivesearch/useReactiveFilterSharedProps.js.map +1 -0
- package/dist/src/hooks/reactivesearch/useReactiveFilterSliderProps.d.ts +68 -0
- package/dist/src/hooks/reactivesearch/useReactiveFilterSliderProps.js +22 -0
- package/dist/src/hooks/reactivesearch/useReactiveFilterSliderProps.js.map +1 -0
- package/dist/src/hooks/reactivesearch/useReactiveReactProp.d.ts +3 -0
- package/dist/src/hooks/reactivesearch/useReactiveReactProp.js +26 -0
- package/dist/src/hooks/reactivesearch/useReactiveReactProp.js.map +1 -0
- package/dist/src/hooks/reactivesearch/useReactiveResultStackProps.d.ts +17 -0
- package/dist/src/hooks/reactivesearch/useReactiveResultStackProps.js +32 -0
- package/dist/src/hooks/reactivesearch/useReactiveResultStackProps.js.map +1 -0
- package/dist/src/hooks/useAnalytics.d.ts +95 -0
- package/dist/src/hooks/useAnalytics.js +111 -0
- package/dist/src/hooks/useAnalytics.js.map +1 -0
- package/dist/src/hooks/useConfig.d.ts +4 -0
- package/dist/src/hooks/useConfig.js +82 -0
- package/dist/src/hooks/useConfig.js.map +1 -0
- package/dist/src/hooks/useCuration.d.ts +2 -0
- package/dist/src/hooks/useCuration.js +53 -0
- package/dist/src/hooks/useCuration.js.map +1 -0
- package/dist/src/hooks/useFilterCollapsedState.d.ts +8 -0
- package/dist/src/hooks/useFilterCollapsedState.js +28 -0
- package/dist/src/hooks/useFilterCollapsedState.js.map +1 -0
- package/dist/src/hooks/useFilterListProps.d.ts +12 -0
- package/dist/src/hooks/useFilterListProps.js +36 -0
- package/dist/src/hooks/useFilterListProps.js.map +1 -0
- package/dist/src/hooks/useFilterStack.d.ts +2 -0
- package/dist/src/hooks/useFilterStack.js +47 -0
- package/dist/src/hooks/useFilterStack.js.map +1 -0
- package/dist/src/hooks/useFilters.d.ts +4 -0
- package/dist/src/hooks/useFilters.js +23 -0
- package/dist/src/hooks/useFilters.js.map +1 -0
- package/dist/src/hooks/usePagination.d.ts +14 -0
- package/dist/src/hooks/usePagination.js +98 -0
- package/dist/src/hooks/usePagination.js.map +1 -0
- package/dist/src/hooks/usePaginationLoadMore.d.ts +15 -0
- package/dist/src/hooks/usePaginationLoadMore.js +38 -0
- package/dist/src/hooks/usePaginationLoadMore.js.map +1 -0
- package/dist/src/hooks/useProductPrice.d.ts +10 -0
- package/dist/src/hooks/useProductPrice.js +64 -0
- package/dist/src/hooks/useProductPrice.js.map +1 -0
- package/dist/src/hooks/useReactifySearchContext.d.ts +78 -0
- package/dist/src/hooks/useReactifySearchContext.js +11 -0
- package/dist/src/hooks/useReactifySearchContext.js.map +1 -0
- package/dist/src/hooks/useSearch.d.ts +8 -0
- package/dist/src/hooks/useSearch.js +37 -0
- package/dist/src/hooks/useSearch.js.map +1 -0
- package/dist/src/hooks/useSortby.d.ts +6 -0
- package/dist/src/hooks/useSortby.js +42 -0
- package/dist/src/hooks/useSortby.js.map +1 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.js +19 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/types/config.d.ts +26 -0
- package/dist/src/types/config.js +3 -0
- package/dist/src/types/config.js.map +1 -0
- package/dist/src/types/elastic.d.ts +209 -0
- package/dist/src/types/elastic.js +19 -0
- package/dist/src/types/elastic.js.map +1 -0
- package/dist/src/types/firestore.d.ts +280 -0
- package/dist/src/types/firestore.js +19 -0
- package/dist/src/types/firestore.js.map +1 -0
- package/dist/src/types/graphql.d.ts +26545 -0
- package/dist/src/types/graphql.js +4688 -0
- package/dist/src/types/graphql.js.map +1 -0
- package/dist/src/types/index.d.ts +3 -0
- package/dist/src/types/index.js +16 -0
- package/dist/src/types/index.js.map +1 -0
- package/dist/src/types/reactivesearch.d.ts +73 -0
- package/dist/src/types/reactivesearch.js +3 -0
- package/dist/src/types/reactivesearch.js.map +1 -0
- package/dist/src/types/shopify.d.ts +21 -0
- package/dist/src/types/shopify.js +28 -0
- package/dist/src/types/shopify.js.map +1 -0
- package/package.json +8 -3
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.useSearch = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const hooks_1 = require("../hooks");
|
|
9
|
+
const useSearch = () => {
|
|
10
|
+
const { options, config, search } = (0, hooks_1.useReactifySearchContext)();
|
|
11
|
+
const handleSubmitSearch = react_1.default.useCallback((localSearchQuery) => {
|
|
12
|
+
const actualSearchQuery = localSearchQuery !== null && localSearchQuery !== void 0 ? localSearchQuery : search.searchQuery;
|
|
13
|
+
if (!actualSearchQuery)
|
|
14
|
+
return;
|
|
15
|
+
const redirect = config.redirects.find((redirect) => redirect.query.trim().toLowerCase() ===
|
|
16
|
+
actualSearchQuery.trim().toLowerCase());
|
|
17
|
+
search.setInstantSearchVisible(false);
|
|
18
|
+
if (options.onRedirect) {
|
|
19
|
+
options.onRedirect(redirect ? "redirect" : "search", redirect ? redirect.url : `/search?q=${actualSearchQuery}`);
|
|
20
|
+
}
|
|
21
|
+
else if (redirect) {
|
|
22
|
+
window.location.href = redirect.url;
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
window.location.href = `/search?q=${actualSearchQuery}`;
|
|
26
|
+
}
|
|
27
|
+
}, [search.searchQuery]);
|
|
28
|
+
return {
|
|
29
|
+
searchQuery: search.searchQuery,
|
|
30
|
+
setSearchQuery: search.setSearchQuery,
|
|
31
|
+
submitSearch: handleSubmitSearch,
|
|
32
|
+
showInstantSearchResults: !!search.instantSearchVisible && !!search.searchQuery,
|
|
33
|
+
setShowInstantSearchResults: search.setInstantSearchVisible,
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
exports.useSearch = useSearch;
|
|
37
|
+
//# sourceMappingURL=useSearch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSearch.js","sourceRoot":"","sources":["../../../src/hooks/useSearch.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,oCAAoD;AAE7C,MAAM,SAAS,GAAG,GAAG,EAAE;IAC5B,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,gCAAwB,GAAE,CAAC;IAE/D,MAAM,kBAAkB,GAAG,eAAK,CAAC,WAAW,CAAC,CAAC,gBAAyB,EAAE,EAAE;QACzE,MAAM,iBAAiB,GAAG,gBAAgB,aAAhB,gBAAgB,cAAhB,gBAAgB,GAAI,MAAM,CAAC,WAAW,CAAC;QACjE,IAAI,CAAC,iBAAiB;YAAE,OAAO;QAE/B,MAAM,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC,IAAI,CACpC,CAAC,QAAQ,EAAE,EAAE,CACX,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE;YACnC,iBAAiB,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CACzC,CAAC;QAEF,MAAM,CAAC,uBAAuB,CAAC,KAAK,CAAC,CAAC;QAEtC,IAAI,OAAO,CAAC,UAAU,EAAE;YACtB,OAAO,CAAC,UAAU,CAChB,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,EAChC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,aAAa,iBAAiB,EAAE,CAC3D,CAAC;SACH;aAAM,IAAI,QAAQ,EAAE;YACnB,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAC;SACrC;aAAM;YACL,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,aAAa,iBAAiB,EAAE,CAAC;SACzD;IACH,CAAC,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC;IAEzB,OAAO;QACL,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,cAAc,EAAE,MAAM,CAAC,cAAc;QACrC,YAAY,EAAE,kBAAkB;QAChC,wBAAwB,EAAE,CAAC,CAAC,MAAM,CAAC,oBAAoB,IAAI,CAAC,CAAC,MAAM,CAAC,WAAW;QAC/E,2BAA2B,EAAE,MAAM,CAAC,uBAAuB;KAC5D,CAAC;AACJ,CAAC,CAAC;AAlCW,QAAA,SAAS,aAkCpB"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.useSortby = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const hooks_1 = require("../hooks");
|
|
9
|
+
const useSortby = () => {
|
|
10
|
+
const { options, config, sortby } = (0, hooks_1.useReactifySearchContext)();
|
|
11
|
+
const { track } = (0, hooks_1.useAnalytics)();
|
|
12
|
+
const sortOptions = react_1.default.useMemo(() => {
|
|
13
|
+
return config.sort
|
|
14
|
+
.sort((a, b) => `${a.position}`.localeCompare(`${b.position}`))
|
|
15
|
+
.filter(({ visibility }) => ["all", options.mode].includes(visibility));
|
|
16
|
+
}, [options.mode, config]);
|
|
17
|
+
const sortOption = react_1.default.useMemo(() => sortOptions.find(({ handle }) => handle === sortby.sortOption) ||
|
|
18
|
+
sortOptions[0], [sortOptions, sortby.sortOption]);
|
|
19
|
+
const setSortOption = react_1.default.useCallback((sortOptionHandle, ignoreHistoryState = false) => {
|
|
20
|
+
sortby.setSortOption(sortOptionHandle);
|
|
21
|
+
if (!ignoreHistoryState) {
|
|
22
|
+
const url = new URL(window.location.href);
|
|
23
|
+
url.searchParams.has("sort")
|
|
24
|
+
? url.searchParams.set("sort", sortOptionHandle)
|
|
25
|
+
: url.searchParams.append("sort", sortOptionHandle);
|
|
26
|
+
window.history.pushState({}, "", url.toString());
|
|
27
|
+
}
|
|
28
|
+
track({
|
|
29
|
+
eventName: "sortChange",
|
|
30
|
+
payload: {
|
|
31
|
+
type: sortOptionHandle,
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
}, [window.location.href]);
|
|
35
|
+
return {
|
|
36
|
+
sortOptions,
|
|
37
|
+
sortOption,
|
|
38
|
+
setSortOption,
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
exports.useSortby = useSortby;
|
|
42
|
+
//# sourceMappingURL=useSortby.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSortby.js","sourceRoot":"","sources":["../../../src/hooks/useSortby.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAG1B,oCAAkE;AAE3D,MAAM,SAAS,GAAG,GAIvB,EAAE;IACF,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,gCAAwB,GAAE,CAAC;IAC/D,MAAM,EAAE,KAAK,EAAE,GAAG,IAAA,oBAAY,GAAE,CAAC;IAEjC,MAAM,WAAW,GAAG,eAAK,CAAC,OAAO,CAAC,GAAG,EAAE;QACrC,OAAO,MAAM,CAAC,IAAI;aACf,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;aAC9D,MAAM,CAAC,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC;IAC5E,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;IAE3B,MAAM,UAAU,GAAG,eAAK,CAAC,OAAO,CAC9B,GAAG,EAAE,CACH,WAAW,CAAC,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,MAAM,KAAK,MAAM,CAAC,UAAU,CAAC;QAC9D,WAAW,CAAC,CAAC,CAAC,EAChB,CAAC,WAAW,EAAE,MAAM,CAAC,UAAU,CAAC,CACjC,CAAC;IAEF,MAAM,aAAa,GAAG,eAAK,CAAC,WAAW,CACrC,CAAC,gBAAwB,EAAE,kBAAkB,GAAG,KAAK,EAAE,EAAE;QACvD,MAAM,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;QACvC,IAAI,CAAC,kBAAkB,EAAE;YACvB,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YAC1C,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC;gBAC1B,CAAC,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC;gBAChD,CAAC,CAAC,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;YACtD,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;SAClD;QAED,KAAK,CAAC;YACJ,SAAS,EAAE,YAAY;YACvB,OAAO,EAAE;gBACP,IAAI,EAAE,gBAAgB;aACvB;SACF,CAAC,CAAC;IACL,CAAC,EACD,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CACvB,CAAC;IAEF,OAAO;QACL,WAAW;QACX,UAAU;QACV,aAAa;KACd,CAAC;AACJ,CAAC,CAAC;AA/CW,QAAA,SAAS,aA+CpB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./components"), exports);
|
|
14
|
+
__exportStar(require("./hooks"), exports);
|
|
15
|
+
__exportStar(require("./types"), exports);
|
|
16
|
+
const package_json_1 = require("../package.json");
|
|
17
|
+
const debug = require("debug")("reactify-search:");
|
|
18
|
+
debug(`${package_json_1.name} v${package_json_1.version}`);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAA6B;AAC7B,0CAAwB;AACxB,0CAAwB;AAExB,kDAAgD;AAChD,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,kBAAkB,CAAC,CAAC;AAEnD,KAAK,CAAC,GAAG,mBAAI,KAAK,sBAAO,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Sort, Filter, FilterOption, Redirect, Field, Curation } from "./firestore";
|
|
2
|
+
export interface Config {
|
|
3
|
+
index: string;
|
|
4
|
+
sort: ConfigSort[];
|
|
5
|
+
fields: ConfigField[];
|
|
6
|
+
filters: ConfigFilter[];
|
|
7
|
+
redirects: ConfigRedirect[];
|
|
8
|
+
curations: ConfigCuration[];
|
|
9
|
+
}
|
|
10
|
+
export declare type ConfigSort = Omit<Sort, "enabled">;
|
|
11
|
+
export declare type ConfigField = Omit<Field, "enabled">;
|
|
12
|
+
export declare type ConfigRedirect = Omit<Redirect, "enabled" | "keywords">;
|
|
13
|
+
export declare type ConfigFilter = Omit<Filter, "enabled" | "keywords"> & {
|
|
14
|
+
options: Omit<FilterOption, "enabled">[];
|
|
15
|
+
};
|
|
16
|
+
export declare type ConfigFilterOption = Omit<FilterOption, "enabled">;
|
|
17
|
+
export declare type ConfigCuration = Omit<Curation, "keywords" | "boosting" | "longRunningTask" | "callouts"> & {
|
|
18
|
+
boosting: {
|
|
19
|
+
groupings: (NonNullable<NonNullable<Curation["boosting"]>["groupings"]>[0] & {
|
|
20
|
+
query: string;
|
|
21
|
+
})[];
|
|
22
|
+
sortings: (NonNullable<NonNullable<Curation["boosting"]>["sortings"]>[0] & {
|
|
23
|
+
query: string;
|
|
24
|
+
})[];
|
|
25
|
+
};
|
|
26
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/types/config.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { Callout } from "./firestore";
|
|
2
|
+
import { Maybe, ProductVariantInventoryPolicy, MetafieldValueType } from "./graphql";
|
|
3
|
+
export declare enum ElasticDocumentType {
|
|
4
|
+
Callout = "callout",
|
|
5
|
+
Product = "product"
|
|
6
|
+
}
|
|
7
|
+
export declare type ElasticDocument = ElasticCallout | ElasticProduct;
|
|
8
|
+
export interface ElasticCallout {
|
|
9
|
+
type: ElasticDocumentType.Callout;
|
|
10
|
+
key: string;
|
|
11
|
+
callout: Omit<Callout, "keywords">;
|
|
12
|
+
/** elastic callouts are always published */
|
|
13
|
+
published: true;
|
|
14
|
+
/** elastic callouts are always attached to one curation */
|
|
15
|
+
curations: [ElasticCuration];
|
|
16
|
+
}
|
|
17
|
+
export interface ElasticProduct {
|
|
18
|
+
type: ElasticDocumentType.Product;
|
|
19
|
+
/** the log id from which this product was last uploaded */
|
|
20
|
+
lastLogId: string;
|
|
21
|
+
/** legacy resource id */
|
|
22
|
+
id: number;
|
|
23
|
+
storefrontId: string;
|
|
24
|
+
title: string;
|
|
25
|
+
description: string;
|
|
26
|
+
vendor: string;
|
|
27
|
+
product_type: string;
|
|
28
|
+
handle: string;
|
|
29
|
+
url: string;
|
|
30
|
+
tags: string[];
|
|
31
|
+
collection_titles: string[];
|
|
32
|
+
/** tag prefixes defined in tagKeys are split to their own attributes */
|
|
33
|
+
[key: `tags_${string}`]: string[] | undefined;
|
|
34
|
+
/** decimal number e.g. 99.95 */
|
|
35
|
+
price_min: number;
|
|
36
|
+
/** decimal number e.g. 99.95 */
|
|
37
|
+
price_max: number;
|
|
38
|
+
/** array of option names e.g. ["Colour", "Size"] */
|
|
39
|
+
options: string[];
|
|
40
|
+
/** @todo it would be better to use ProductStatus directly, which has uppercase */
|
|
41
|
+
status: "active" | "archived" | "draft";
|
|
42
|
+
published: boolean;
|
|
43
|
+
/** ISO 8601 datetime */
|
|
44
|
+
published_at: Maybe<string>;
|
|
45
|
+
/** ISO 8601 datetime */
|
|
46
|
+
updated_at: string;
|
|
47
|
+
/** ISO 8601 datetime */
|
|
48
|
+
created_at: string;
|
|
49
|
+
tracks_inventory: boolean;
|
|
50
|
+
/** originalSrc URL for featured image */
|
|
51
|
+
image: Maybe<string>;
|
|
52
|
+
/** array of images (undefined if images are disabled in sync settings) */
|
|
53
|
+
images?: ElasticImage[];
|
|
54
|
+
/** array of variants attached to product (undefined if variants are disabled in sync settings) */
|
|
55
|
+
variants?: ElasticVariant[];
|
|
56
|
+
/** price ranges from presentment prices (undefined if presentment prices or variants are disabled in sync settings) */
|
|
57
|
+
presentment_price_ranges?: {
|
|
58
|
+
min_variant_price: ElasticPresentmentPrice[];
|
|
59
|
+
max_variant_price: ElasticPresentmentPrice[];
|
|
60
|
+
};
|
|
61
|
+
/** array of variant skus (undefined if variants are disabled in sync settings) */
|
|
62
|
+
variant_skus?: string[];
|
|
63
|
+
/** combined array of option values from all option types (undefined if variants are disabled in sync settings) */
|
|
64
|
+
variant_options?: string[];
|
|
65
|
+
/** array of collections which this product belongs to (undefined if collections are disabled in sync settings) */
|
|
66
|
+
collections?: ElasticCollection[];
|
|
67
|
+
/** array of whitelisted metafields (undefined if metafields are disabled in sync settings) */
|
|
68
|
+
metafields?: ElasticMetafield[];
|
|
69
|
+
/** decimal number e.g. 99.95 (undefined if variants are disabled in sync settings) */
|
|
70
|
+
discount_amount?: number;
|
|
71
|
+
/** combined inventory for all variants (undefined if variants are disabled in sync settings) */
|
|
72
|
+
inventory_total?: number;
|
|
73
|
+
/** number of days since published, null if unpublished */
|
|
74
|
+
published_days: Maybe<number>;
|
|
75
|
+
/** collection of curations that this product is attached to */
|
|
76
|
+
curations?: ElasticCuration[];
|
|
77
|
+
}
|
|
78
|
+
export interface ElasticVariant {
|
|
79
|
+
/** legacy resource id */
|
|
80
|
+
id: number;
|
|
81
|
+
storefrontId: string;
|
|
82
|
+
title: string;
|
|
83
|
+
sku: Maybe<string>;
|
|
84
|
+
barcode: Maybe<string>;
|
|
85
|
+
/** array of presentment prices (undefined if presentment prices are disabled in sync settings) */
|
|
86
|
+
presentment_prices?: {
|
|
87
|
+
price: ElasticPresentmentPrice;
|
|
88
|
+
compare_at_price: Maybe<ElasticPresentmentPrice>;
|
|
89
|
+
}[];
|
|
90
|
+
/** decimal number e.g. 99.95 */
|
|
91
|
+
price: number;
|
|
92
|
+
/** decimal number e.g. 99.95 */
|
|
93
|
+
compare_at_price: Maybe<number>;
|
|
94
|
+
/** value string for option 1 e.g. Blue */
|
|
95
|
+
option1: Maybe<string>;
|
|
96
|
+
/** value string for option 2 e.g. Medium */
|
|
97
|
+
option2: Maybe<string>;
|
|
98
|
+
/** value string for option 3 */
|
|
99
|
+
option3: Maybe<string>;
|
|
100
|
+
/** sort position within the product */
|
|
101
|
+
position: number;
|
|
102
|
+
inventory_policy: ProductVariantInventoryPolicy;
|
|
103
|
+
inventory_quantity: number;
|
|
104
|
+
available: boolean;
|
|
105
|
+
/** array of images (only available if this variant has been merged from another product and if images are enabled in sync settings) */
|
|
106
|
+
images?: ElasticImage[];
|
|
107
|
+
}
|
|
108
|
+
export interface ElasticCollection {
|
|
109
|
+
/** legacy resource id */
|
|
110
|
+
id: number;
|
|
111
|
+
storefrontId: string;
|
|
112
|
+
handle: string;
|
|
113
|
+
title: string;
|
|
114
|
+
position: number;
|
|
115
|
+
}
|
|
116
|
+
export interface ElasticMetafield {
|
|
117
|
+
key: string;
|
|
118
|
+
type: string;
|
|
119
|
+
value: string;
|
|
120
|
+
namespace: string;
|
|
121
|
+
/**
|
|
122
|
+
* Legacy valueType attribute which is no longer provided by Shopify. We still
|
|
123
|
+
* populate this field to prevent any frontends breaking which rely on it.
|
|
124
|
+
*
|
|
125
|
+
* @see https://shopify.dev/apps/metafields/definitions/types
|
|
126
|
+
*/
|
|
127
|
+
value_type: MetafieldValueType;
|
|
128
|
+
}
|
|
129
|
+
export interface ElasticPresentmentPrice {
|
|
130
|
+
/** decimal number e.g. 99.95 */
|
|
131
|
+
amount: number;
|
|
132
|
+
currency_code: string;
|
|
133
|
+
}
|
|
134
|
+
export interface ElasticImage {
|
|
135
|
+
/** originalSrc URL */
|
|
136
|
+
src: string;
|
|
137
|
+
/** alt text */
|
|
138
|
+
alt: Maybe<string>;
|
|
139
|
+
}
|
|
140
|
+
export interface ElasticCuration {
|
|
141
|
+
id: string;
|
|
142
|
+
hidden: boolean;
|
|
143
|
+
position?: number;
|
|
144
|
+
searchTerm?: string;
|
|
145
|
+
collectionHandle?: string;
|
|
146
|
+
}
|
|
147
|
+
export declare type ElasticBulkOperationUpdate = [
|
|
148
|
+
{
|
|
149
|
+
update: {
|
|
150
|
+
_index: string;
|
|
151
|
+
_id: string;
|
|
152
|
+
};
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
script?: {
|
|
156
|
+
lang: "painless";
|
|
157
|
+
source: string;
|
|
158
|
+
params?: Record<string, any>;
|
|
159
|
+
};
|
|
160
|
+
upsert?: Partial<ElasticProduct>;
|
|
161
|
+
scripted_upsert?: true;
|
|
162
|
+
doc?: Partial<ElasticProduct>;
|
|
163
|
+
doc_as_upsert?: true;
|
|
164
|
+
}
|
|
165
|
+
];
|
|
166
|
+
export declare type ElasticBulkOperationIndex = [
|
|
167
|
+
{
|
|
168
|
+
index: {
|
|
169
|
+
_index: string;
|
|
170
|
+
_id: string;
|
|
171
|
+
};
|
|
172
|
+
},
|
|
173
|
+
ElasticDocument
|
|
174
|
+
];
|
|
175
|
+
export declare type ElasticBulkOperation = ElasticBulkOperationUpdate | ElasticBulkOperationIndex;
|
|
176
|
+
export declare type ElasticSearchResult<T = ElasticDocument> = {
|
|
177
|
+
hits: {
|
|
178
|
+
hits: ElasticHit<T>[];
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
export declare type ElasticHit<T = ElasticDocument> = {
|
|
182
|
+
_id: string;
|
|
183
|
+
_source: T;
|
|
184
|
+
_score: number | null;
|
|
185
|
+
};
|
|
186
|
+
export declare enum ElasticDataType {
|
|
187
|
+
Text = "text",
|
|
188
|
+
Long = "long",
|
|
189
|
+
Date = "date",
|
|
190
|
+
Float = "float",
|
|
191
|
+
Nested = "nested",
|
|
192
|
+
Keyword = "keyword",
|
|
193
|
+
Boolean = "boolean"
|
|
194
|
+
}
|
|
195
|
+
export interface ElasticProperty {
|
|
196
|
+
analyzer?: string;
|
|
197
|
+
type: ElasticDataType;
|
|
198
|
+
ignore_above?: number;
|
|
199
|
+
fields?: {
|
|
200
|
+
[key: string]: ElasticField;
|
|
201
|
+
};
|
|
202
|
+
properties?: {
|
|
203
|
+
[key: string]: ElasticProperty;
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
export interface ElasticField {
|
|
207
|
+
type: ElasticDataType;
|
|
208
|
+
ignore_above?: number;
|
|
209
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ElasticDataType = exports.ElasticDocumentType = void 0;
|
|
4
|
+
var ElasticDocumentType;
|
|
5
|
+
(function (ElasticDocumentType) {
|
|
6
|
+
ElasticDocumentType["Callout"] = "callout";
|
|
7
|
+
ElasticDocumentType["Product"] = "product";
|
|
8
|
+
})(ElasticDocumentType = exports.ElasticDocumentType || (exports.ElasticDocumentType = {}));
|
|
9
|
+
var ElasticDataType;
|
|
10
|
+
(function (ElasticDataType) {
|
|
11
|
+
ElasticDataType["Text"] = "text";
|
|
12
|
+
ElasticDataType["Long"] = "long";
|
|
13
|
+
ElasticDataType["Date"] = "date";
|
|
14
|
+
ElasticDataType["Float"] = "float";
|
|
15
|
+
ElasticDataType["Nested"] = "nested";
|
|
16
|
+
ElasticDataType["Keyword"] = "keyword";
|
|
17
|
+
ElasticDataType["Boolean"] = "boolean";
|
|
18
|
+
})(ElasticDataType = exports.ElasticDataType || (exports.ElasticDataType = {}));
|
|
19
|
+
//# sourceMappingURL=elastic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elastic.js","sourceRoot":"","sources":["../../../src/types/elastic.ts"],"names":[],"mappings":";;;AAOA,IAAY,mBAGX;AAHD,WAAY,mBAAmB;IAC7B,0CAAmB,CAAA;IACnB,0CAAmB,CAAA;AACrB,CAAC,EAHW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAG9B;AA6LD,IAAY,eAQX;AARD,WAAY,eAAe;IACzB,gCAAa,CAAA;IACb,gCAAa,CAAA;IACb,gCAAa,CAAA;IACb,kCAAe,CAAA;IACf,oCAAiB,CAAA;IACjB,sCAAmB,CAAA;IACnB,sCAAmB,CAAA;AACrB,CAAC,EARW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAQ1B"}
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
declare type Timestamp = string;
|
|
2
|
+
import { ShopifyProduct } from "./shopify";
|
|
3
|
+
import { ElasticDataType } from "./elastic";
|
|
4
|
+
export interface Log {
|
|
5
|
+
id: string;
|
|
6
|
+
keywords: string[];
|
|
7
|
+
message: string;
|
|
8
|
+
platform: "reactify" | "shopify" | "elastic";
|
|
9
|
+
percentCompleted: number;
|
|
10
|
+
action?: {
|
|
11
|
+
type: "retry";
|
|
12
|
+
label: string;
|
|
13
|
+
task: Task["taskId"];
|
|
14
|
+
};
|
|
15
|
+
step: "download" | "transform" | "merge" | "upload" | "cleanup" | "complete" | "sync";
|
|
16
|
+
title: string;
|
|
17
|
+
type: "bulk";
|
|
18
|
+
data?: string;
|
|
19
|
+
progress: "new" | "error" | "complete" | "partiallyComplete";
|
|
20
|
+
status: "success" | "info" | "warning" | "critical";
|
|
21
|
+
createdAt: Timestamp;
|
|
22
|
+
updatedAt?: Timestamp;
|
|
23
|
+
finishedAt?: Timestamp;
|
|
24
|
+
}
|
|
25
|
+
export interface Task {
|
|
26
|
+
logId: string;
|
|
27
|
+
taskId: "download" | "transform" | "merge" | "upload" | "cleanup" | "refreshDefinedFields" | "install";
|
|
28
|
+
firstRun: boolean;
|
|
29
|
+
createdAt: Timestamp;
|
|
30
|
+
updatedAt?: Timestamp;
|
|
31
|
+
}
|
|
32
|
+
export interface TaskDownload extends Task {
|
|
33
|
+
taskId: "download";
|
|
34
|
+
type: "collection" | "product";
|
|
35
|
+
productUrl?: string;
|
|
36
|
+
collectionUrl?: string;
|
|
37
|
+
}
|
|
38
|
+
export interface TaskTransform extends Task {
|
|
39
|
+
taskId: "transform";
|
|
40
|
+
productUrl: string;
|
|
41
|
+
collectionUrl: string;
|
|
42
|
+
}
|
|
43
|
+
export interface TaskMerge extends Task {
|
|
44
|
+
taskId: "merge";
|
|
45
|
+
productCount: number;
|
|
46
|
+
collectionCount: number;
|
|
47
|
+
startAfterId?: string;
|
|
48
|
+
}
|
|
49
|
+
export interface TaskUpload extends Task {
|
|
50
|
+
taskId: "upload";
|
|
51
|
+
productCount: number;
|
|
52
|
+
collectionCount: number;
|
|
53
|
+
startAfterId?: string;
|
|
54
|
+
}
|
|
55
|
+
export interface TaskCleanup extends Task {
|
|
56
|
+
taskId: "cleanup";
|
|
57
|
+
}
|
|
58
|
+
export interface TaskRefreshDefinedFields extends Task {
|
|
59
|
+
taskId: "refreshDefinedFields";
|
|
60
|
+
}
|
|
61
|
+
export interface TaskInstall extends Task {
|
|
62
|
+
taskId: "install";
|
|
63
|
+
}
|
|
64
|
+
export interface Lock {
|
|
65
|
+
logId: string;
|
|
66
|
+
taskType: "sync";
|
|
67
|
+
createdAt: Timestamp;
|
|
68
|
+
}
|
|
69
|
+
export interface SettingsInstance {
|
|
70
|
+
index: string;
|
|
71
|
+
cloudId: string;
|
|
72
|
+
endpoint: string;
|
|
73
|
+
password: string;
|
|
74
|
+
username: string;
|
|
75
|
+
syncFrequency: string;
|
|
76
|
+
syncThreshold: number;
|
|
77
|
+
provider: "elastic" | "aws";
|
|
78
|
+
storefrontAccessToken: string;
|
|
79
|
+
customMappings: string;
|
|
80
|
+
}
|
|
81
|
+
export interface SettingsProduct {
|
|
82
|
+
tagChild?: string;
|
|
83
|
+
tagKeys?: string[];
|
|
84
|
+
tagParent?: string;
|
|
85
|
+
syncObjects: string[];
|
|
86
|
+
tagExclude?: string[];
|
|
87
|
+
tagSeparator?: string;
|
|
88
|
+
metafieldWhitelist?: string[];
|
|
89
|
+
}
|
|
90
|
+
export interface SettingsCurations {
|
|
91
|
+
moreInfo?: boolean;
|
|
92
|
+
pageSize?: number;
|
|
93
|
+
gridColumns?: number;
|
|
94
|
+
}
|
|
95
|
+
export interface Field {
|
|
96
|
+
id: string;
|
|
97
|
+
field: string;
|
|
98
|
+
enabled: boolean;
|
|
99
|
+
importance: number;
|
|
100
|
+
searchType: "always_search" | "search_page" | "instant_search";
|
|
101
|
+
}
|
|
102
|
+
export interface DefinedField {
|
|
103
|
+
label: string;
|
|
104
|
+
value: string;
|
|
105
|
+
type: ElasticDataType;
|
|
106
|
+
}
|
|
107
|
+
export interface Sort {
|
|
108
|
+
id: string;
|
|
109
|
+
name: string;
|
|
110
|
+
handle: string;
|
|
111
|
+
field: string;
|
|
112
|
+
position: number;
|
|
113
|
+
enabled: boolean;
|
|
114
|
+
direction: "desc" | "asc";
|
|
115
|
+
visibility: "all" | "search" | "collection";
|
|
116
|
+
}
|
|
117
|
+
export interface Filter {
|
|
118
|
+
id: string;
|
|
119
|
+
name: string;
|
|
120
|
+
handle: string;
|
|
121
|
+
enabled: boolean;
|
|
122
|
+
pageSize: number;
|
|
123
|
+
keywords: string[];
|
|
124
|
+
defaultSort: string;
|
|
125
|
+
collections: string[];
|
|
126
|
+
type: "search" | "collection";
|
|
127
|
+
paginationType: "pagination" | "load_more" | "next_prev" | "infinite_scroll";
|
|
128
|
+
inventoryVisibility: "show_all" | "hide_products" | "hide_variants" | "hide_all";
|
|
129
|
+
}
|
|
130
|
+
export interface FilterOption {
|
|
131
|
+
displaySize: string;
|
|
132
|
+
displaySliderInterval: string;
|
|
133
|
+
displaySliderStep: string;
|
|
134
|
+
displayType: "multi" | "single" | "range" | "slider";
|
|
135
|
+
displayView: "list" | "check" | "swatch" | "box";
|
|
136
|
+
enabled: boolean;
|
|
137
|
+
field: string;
|
|
138
|
+
id: string;
|
|
139
|
+
name: string;
|
|
140
|
+
handle: string;
|
|
141
|
+
position: number;
|
|
142
|
+
settingsCollapsedDesktop: boolean;
|
|
143
|
+
settingsCollapsedMobile: boolean;
|
|
144
|
+
settingsShowFilter: boolean;
|
|
145
|
+
settingsShowMore: boolean;
|
|
146
|
+
settingsShowSearch: boolean;
|
|
147
|
+
settingsUppercase: boolean;
|
|
148
|
+
settingsHideUnavailable: boolean;
|
|
149
|
+
valuesExclude: Array<string>;
|
|
150
|
+
valuesManual: Array<string>;
|
|
151
|
+
valuesShow: "all" | "manual";
|
|
152
|
+
}
|
|
153
|
+
export interface Redirect {
|
|
154
|
+
id: string;
|
|
155
|
+
url: string;
|
|
156
|
+
query: string;
|
|
157
|
+
enabled: boolean;
|
|
158
|
+
keywords: string[];
|
|
159
|
+
}
|
|
160
|
+
export interface Curation {
|
|
161
|
+
id: string;
|
|
162
|
+
title: string;
|
|
163
|
+
status: CurationStatus;
|
|
164
|
+
published: boolean;
|
|
165
|
+
keywords: string[];
|
|
166
|
+
searchTerm?: string;
|
|
167
|
+
longRunningTask?: boolean;
|
|
168
|
+
collectionHandle?: string;
|
|
169
|
+
type: "collection" | "search";
|
|
170
|
+
boosting?: {
|
|
171
|
+
groupings?: BoostGrouping[];
|
|
172
|
+
sortings?: BoostSorting[];
|
|
173
|
+
};
|
|
174
|
+
sort?: CurationSort;
|
|
175
|
+
}
|
|
176
|
+
export interface CurationSort {
|
|
177
|
+
sortTag?: string;
|
|
178
|
+
sortOption: string;
|
|
179
|
+
sortDirection: "asc" | "desc";
|
|
180
|
+
sortVariantOption?: "option1" | "option2" | "option3";
|
|
181
|
+
}
|
|
182
|
+
export declare enum CurationStatus {
|
|
183
|
+
Draft = "draft",
|
|
184
|
+
Publishing = "publishing",
|
|
185
|
+
Published = "published",
|
|
186
|
+
Unpublishing = "unpublishing",
|
|
187
|
+
Resetting = "resetting",
|
|
188
|
+
Pinning = "pinning",
|
|
189
|
+
Sorting = "sorting"
|
|
190
|
+
}
|
|
191
|
+
export interface CurationHiding {
|
|
192
|
+
productId: number;
|
|
193
|
+
productHandle: string;
|
|
194
|
+
}
|
|
195
|
+
export interface BoostGrouping {
|
|
196
|
+
key: string;
|
|
197
|
+
value: string;
|
|
198
|
+
field: string;
|
|
199
|
+
position: number;
|
|
200
|
+
operation: string;
|
|
201
|
+
}
|
|
202
|
+
export interface BoostSorting {
|
|
203
|
+
key: string;
|
|
204
|
+
field: string;
|
|
205
|
+
query?: string;
|
|
206
|
+
position: number;
|
|
207
|
+
direction: "asc" | "desc";
|
|
208
|
+
}
|
|
209
|
+
export declare type Pin = PinProduct | PinCallout;
|
|
210
|
+
export declare enum PinType {
|
|
211
|
+
Product = "product",
|
|
212
|
+
Callout = "callout"
|
|
213
|
+
}
|
|
214
|
+
export interface PinProduct {
|
|
215
|
+
key: string;
|
|
216
|
+
type: PinType.Product;
|
|
217
|
+
position: number;
|
|
218
|
+
productId: number;
|
|
219
|
+
productHandle: string;
|
|
220
|
+
}
|
|
221
|
+
export interface PinCallout {
|
|
222
|
+
key: string;
|
|
223
|
+
type: PinType.Callout;
|
|
224
|
+
position: number;
|
|
225
|
+
calloutId: string;
|
|
226
|
+
}
|
|
227
|
+
export interface Callout {
|
|
228
|
+
id: string;
|
|
229
|
+
link: string;
|
|
230
|
+
title: string;
|
|
231
|
+
content: string;
|
|
232
|
+
enabled: boolean;
|
|
233
|
+
textColor: string;
|
|
234
|
+
keywords: string[];
|
|
235
|
+
mobileImage: string;
|
|
236
|
+
mobileVideo: string;
|
|
237
|
+
desktopVideo: string;
|
|
238
|
+
desktopImage: string;
|
|
239
|
+
backgroundColor: string;
|
|
240
|
+
visibility: "desktop" | "mobile" | "all";
|
|
241
|
+
displayColumns: string;
|
|
242
|
+
displayRows: string;
|
|
243
|
+
selectedDates?: {
|
|
244
|
+
end: Timestamp;
|
|
245
|
+
start: Timestamp;
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
export interface Synonym {
|
|
249
|
+
id: string;
|
|
250
|
+
name: string;
|
|
251
|
+
enabled: boolean;
|
|
252
|
+
keywords: string[];
|
|
253
|
+
synonyms: string[];
|
|
254
|
+
type: "group" | "oneway";
|
|
255
|
+
}
|
|
256
|
+
export interface MergedValue {
|
|
257
|
+
id: string;
|
|
258
|
+
name: string;
|
|
259
|
+
field: string;
|
|
260
|
+
keywords: string[];
|
|
261
|
+
values: string[];
|
|
262
|
+
}
|
|
263
|
+
export interface Collection {
|
|
264
|
+
title: string;
|
|
265
|
+
handle: string;
|
|
266
|
+
shopifyId: string;
|
|
267
|
+
productIds: string[];
|
|
268
|
+
storefrontId: string;
|
|
269
|
+
legacyResourceId: number;
|
|
270
|
+
}
|
|
271
|
+
export declare type Product = Omit<ShopifyProduct, "variants" | "images" | "media" | "metafields"> & {
|
|
272
|
+
variants: (Omit<ShopifyProduct["variants"]["edges"][0]["node"], "presentmentPrices"> & {
|
|
273
|
+
images?: ShopifyProduct["images"]["edges"][0]["node"][];
|
|
274
|
+
presentmentPrices: ShopifyProduct["variants"]["edges"][0]["node"]["presentmentPrices"]["edges"][0]["node"][];
|
|
275
|
+
})[];
|
|
276
|
+
images: ShopifyProduct["images"]["edges"][0]["node"][];
|
|
277
|
+
media: ShopifyProduct["media"]["edges"][0]["node"][];
|
|
278
|
+
metafields: ShopifyProduct["metafields"]["edges"][0]["node"][];
|
|
279
|
+
};
|
|
280
|
+
export {};
|