/
configBuilder.tsx
114 lines (113 loc) · 3.4 KB
/
configBuilder.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
import type { Stream, TemplateConfig } from "@yext/pages";
import { dedupeStreamFields } from "src/common/helpers";
/**
* Required when Knowledge Graph data is used for a template.
*/
export const configBuilder: (
id?: string,
filter?: Stream["filter"]
) => TemplateConfig = (id?: string, filter?: Stream["filter"]) => ({
stream: {
$id: id || "locations",
// Specifies the exact data that each generated document will contain. This data is passed in
// directly as props to the default exported function.
fields: dedupeStreamFields([
"id",
"uid",
"logo",
"c_meta",
"name",
"address",
"mainPhone",
"tollFreePhone",
"emails",
"yextDisplayCoordinate",
"description",
"hours",
"googlePlaceId",
"photoGallery",
"ref_listings.listingUrl",
"ref_listings.publisher",
"additionalHoursText",
"services",
"dm_directoryParents_defaultdirectory.name",
"dm_directoryParents_defaultdirectory.slug",
"dm_baseEntityCount",
"slug",
// About Fields
"c_aboutSection",
"description",
// Banner Fields
"c_bannerSection",
// Core Fields
"address",
"mainPhone",
"googlePlaceId",
"tollFreePhone",
"emails",
"hours",
"additionalHoursText",
"services",
// Events Fields
// "c_eventsSection.title",
// "c_eventsSection.events.name",
// "c_eventsSection.events.time",
// "c_eventsSection.events.description",
// "c_eventsSection.events.c_primaryCTA",
// "c_eventsSection.events.photoGallery",
// FAQ Fields
// "c_faqSection.title",
// "c_faqSection.faqs.question",
// "c_faqSection.faqs.answerV2",
// Gallery Fields
"c_gallerySection",
"photoGallery",
// Hero Fields
"c_heroSection",
"name",
"address",
"hours",
// Insights Fields
"c_insightsSection.title",
"c_insightsSection.cta",
"c_insightsSection.insights.title",
"c_insightsSection.insights.category",
"c_insightsSection.insights.photo",
"c_insightsSection.insights.date",
"c_insightsSection.insights.descriptionLong",
"c_insightsSection.insights.descriptionShort",
"c_insightsSection.insights.cta",
// Nearby Fields
"c_nearbySection",
// Product Fields
// "c_featuredProductsSection.title",
// "c_featuredProductsSection.products.name",
// "c_featuredProductsSection.products.richTextDescriptionV2",
// "c_featuredProductsSection.products.primaryPhoto",
// "c_featuredProductsSection.products.c_primaryCTA",
// Promo Fields
"c_promoSection",
// Review Fields
"c_reviewsSection",
// Team Fields
// "c_teamSection.title",
// "c_teamSection.team.id",
// "c_teamSection.team.name",
// "c_teamSection.team.headshot",
// "c_teamSection.team.mainPhone",
// "c_teamSection.team.c_occupation",
// "c_teamSection.team.emails",
// "c_teamSection.team.websiteUrl",
]),
// Defines the scope of entities that qualify for this stream.
filter: filter || {
entityTypes: ["location"],
},
// The entity language profiles that documents will be generated for.
localization: {
locales: ["en"],
},
},
// Specifies the field to use for URL paths when serving locally
slugField: "slug",
});