@jeromefitz/notion 2.0.0-npm-dist.1 → 2.0.3
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/LICENSE +0 -0
- package/README.md +38 -9
- package/constants/index.cjs +0 -0
- package/constants/index.d.ts +0 -0
- package/constants/index.js +0 -0
- package/index.cjs +1 -1
- package/index.d.ts +70 -33
- package/index.js +1 -1
- package/package.json +12 -8
- package/queries/getBlocksByIdChildren/index.cjs +1 -1
- package/queries/getBlocksByIdChildren/index.d.ts +2 -1
- package/queries/getBlocksByIdChildren/index.js +1 -1
- package/queries/getDatabasesByIdQuery/index.cjs +1 -1
- package/queries/getDatabasesByIdQuery/index.d.ts +6 -3
- package/queries/getDatabasesByIdQuery/index.js +1 -1
- package/queries/getDeepFetchAllChildren/index.cjs +1 -1
- package/queries/getDeepFetchAllChildren/index.d.ts +2 -1
- package/queries/getDeepFetchAllChildren/index.js +1 -1
- package/queries/getInfoType/index.cjs +1 -1
- package/queries/getInfoType/index.d.ts +0 -0
- package/queries/getInfoType/index.js +1 -1
- package/queries/getNotionListing/index.cjs +1 -1
- package/queries/getNotionListing/index.d.ts +11 -1
- package/queries/getNotionListing/index.js +1 -1
- package/queries/getNotionListingByDate/index.cjs +1 -1
- package/queries/getNotionListingByDate/index.d.ts +1 -1
- package/queries/getNotionListingByDate/index.js +1 -1
- package/queries/getNotionSlug/index.cjs +1 -1
- package/queries/getNotionSlug/index.d.ts +8 -3
- package/queries/getNotionSlug/index.js +1 -1
- package/queries/getNotionSlugByRoute/index.cjs +1 -1
- package/queries/getNotionSlugByRoute/index.d.ts +6 -1
- package/queries/getNotionSlugByRoute/index.js +1 -1
- package/queries/getPagesById/index.cjs +1 -1
- package/queries/getPagesById/index.d.ts +2 -1
- package/queries/getPagesById/index.js +1 -1
- package/queries/getPathVariables/index.cjs +1 -1
- package/queries/getPathVariables/index.d.ts +0 -0
- package/queries/getPathVariables/index.js +1 -1
- package/queries/getQuery/index.cjs +1 -1
- package/queries/getQuery/index.d.ts +0 -0
- package/queries/getQuery/index.js +1 -1
- package/queries/index.cjs +1 -1
- package/queries/index.d.ts +0 -0
- package/queries/index.js +1 -1
- package/schema/index.cjs +1 -1
- package/schema/index.d.ts +15 -1
- package/schema/index.js +0 -0
- package/utils/addTime/index.cjs +0 -0
- package/utils/addTime/index.d.ts +0 -0
- package/utils/addTime/index.js +0 -0
- package/utils/dataNormalized/index.cjs +1 -1
- package/utils/dataNormalized/index.d.ts +5 -0
- package/utils/dataNormalized/index.js +1 -1
- package/utils/dataNormalizedResults/index.cjs +1 -1
- package/utils/dataNormalizedResults/index.d.ts +6 -0
- package/utils/dataNormalizedResults/index.js +1 -1
- package/utils/getDataType/index.cjs +1 -0
- package/utils/getDataType/index.d.ts +60 -0
- package/utils/getDataType/index.js +1 -0
- package/utils/getTitle/index.cjs +1 -1
- package/utils/getTitle/index.d.ts +4 -0
- package/utils/getTitle/index.js +1 -1
- package/utils/getTypes/_unsupported.cjs +1 -1
- package/utils/getTypes/_unsupported.d.ts +0 -0
- package/utils/getTypes/_unsupported.js +1 -1
- package/utils/getTypes/checkbox.cjs +0 -0
- package/utils/getTypes/checkbox.d.ts +0 -0
- package/utils/getTypes/checkbox.js +0 -0
- package/utils/getTypes/date.cjs +0 -0
- package/utils/getTypes/date.d.ts +0 -0
- package/utils/getTypes/date.js +0 -0
- package/utils/getTypes/email.cjs +0 -0
- package/utils/getTypes/email.d.ts +0 -0
- package/utils/getTypes/email.js +0 -0
- package/utils/getTypes/files.cjs +1 -1
- package/utils/getTypes/files.d.ts +0 -0
- package/utils/getTypes/files.js +1 -1
- package/utils/getTypes/index.cjs +1 -1
- package/utils/getTypes/index.d.ts +0 -0
- package/utils/getTypes/index.js +1 -1
- package/utils/getTypes/multi_select.cjs +0 -0
- package/utils/getTypes/multi_select.d.ts +0 -0
- package/utils/getTypes/multi_select.js +0 -0
- package/utils/getTypes/number.cjs +0 -0
- package/utils/getTypes/number.d.ts +0 -0
- package/utils/getTypes/number.js +0 -0
- package/utils/getTypes/people.cjs +0 -0
- package/utils/getTypes/people.d.ts +0 -0
- package/utils/getTypes/people.js +0 -0
- package/utils/getTypes/phone_number.cjs +0 -0
- package/utils/getTypes/phone_number.d.ts +0 -0
- package/utils/getTypes/phone_number.js +0 -0
- package/utils/getTypes/relation.cjs +1 -1
- package/utils/getTypes/relation.d.ts +0 -0
- package/utils/getTypes/relation.js +1 -1
- package/utils/getTypes/rich_text.cjs +0 -0
- package/utils/getTypes/rich_text.d.ts +0 -0
- package/utils/getTypes/rich_text.js +0 -0
- package/utils/getTypes/rollup.cjs +1 -1
- package/utils/getTypes/rollup.d.ts +0 -0
- package/utils/getTypes/rollup.js +1 -1
- package/utils/getTypes/select.cjs +0 -0
- package/utils/getTypes/select.d.ts +0 -0
- package/utils/getTypes/select.js +0 -0
- package/utils/getTypes/title.cjs +0 -0
- package/utils/getTypes/title.d.ts +0 -0
- package/utils/getTypes/title.js +0 -0
- package/utils/getTypes/url.cjs +0 -0
- package/utils/getTypes/url.d.ts +0 -0
- package/utils/getTypes/url.js +0 -0
- package/utils/index.cjs +1 -1
- package/utils/index.d.ts +2 -8
- package/utils/index.js +1 -1
- package/utils/avoidRateLimit/index.cjs +0 -1
- package/utils/avoidRateLimit/index.d.ts +0 -3
- package/utils/avoidRateLimit/index.js +0 -1
- package/utils/dataSorted/index.cjs +0 -1
- package/utils/dataSorted/index.d.ts +0 -5
- package/utils/dataSorted/index.js +0 -1
- package/utils/filterImages/index.cjs +0 -1
- package/utils/filterImages/index.d.ts +0 -3
- package/utils/filterImages/index.js +0 -1
- package/utils/getImages/index.cjs +0 -1
- package/utils/getImages/index.d.ts +0 -9
- package/utils/getImages/index.js +0 -1
- package/utils/isObjectEmpty/index.cjs +0 -1
- package/utils/isObjectEmpty/index.d.ts +0 -7
- package/utils/isObjectEmpty/index.js +0 -1
- package/utils/isUndefined/index.cjs +0 -1
- package/utils/isUndefined/index.d.ts +0 -3
- package/utils/isUndefined/index.js +0 -1
- package/utils/stringToUUID/index.cjs +0 -1
- package/utils/stringToUUID/index.d.ts +0 -3
- package/utils/stringToUUID/index.js +0 -1
package/LICENSE
CHANGED
|
File without changes
|
package/README.md
CHANGED
|
@@ -35,15 +35,34 @@ const notion = new Client({ auth: process.env.NOTION_API_KEY, config })
|
|
|
35
35
|
You need to pass `config` which informs the package of all the wonderful Notion stuff you have. Will fill this out as I go (I hope haha).
|
|
36
36
|
|
|
37
37
|
```tsx
|
|
38
|
-
(alias) const
|
|
38
|
+
(alias) const notionConfig: {
|
|
39
39
|
DATABASES: Databases;
|
|
40
40
|
NOTION: DatabaseInfo;
|
|
41
41
|
PAGES__HOMEPAGE: string;
|
|
42
42
|
PAGES: string[];
|
|
43
|
+
ROUTE_META: any[];
|
|
44
|
+
ROUTE_TYPES_BY_DATA_TYPES: Object;
|
|
43
45
|
ROUTE_TYPES: any[];
|
|
44
46
|
}
|
|
45
47
|
```
|
|
46
48
|
|
|
49
|
+
- `DATABASES`: 🔑️ is uppercase (usually gripped by `routeType`)
|
|
50
|
+
- `NOTION`: 🔑️ is uppercase; 🛠️ configuration for DB
|
|
51
|
+
- `active: boolean`
|
|
52
|
+
- `database_id: string`
|
|
53
|
+
- `dataTypes: DataTypes[]`
|
|
54
|
+
- `hasChild: string | null`
|
|
55
|
+
- `name: string`
|
|
56
|
+
- `page_id__seo: string`
|
|
57
|
+
- `routeMeta: boolean`
|
|
58
|
+
- `routeType: string`
|
|
59
|
+
- `slug: string`
|
|
60
|
+
- `PAGES__HOMEPAGE`: 🤕️ what `Pages => slug` is the homepage?
|
|
61
|
+
- `PAGES`: 🤕️ Only active `routeTypes` brought back
|
|
62
|
+
- `ROUTE_META`: 🤕️ up front share if we expect the route to have a meta (`BLOG|EVENTS|PODCASTS`)
|
|
63
|
+
- `ROUTE_TYPES_BY_DATA_TYPES`: For each `DATA_TYPE` determine which `routeType` are associated
|
|
64
|
+
- `ROUTE_TYPES`: 🤕️ Only active `routeTypes` brought back
|
|
65
|
+
|
|
47
66
|
### Next
|
|
48
67
|
|
|
49
68
|
Will add an `./examples/next/...` to show this with a public facing Notion at some point.
|
|
@@ -55,15 +74,25 @@ Custom setup to get `pathVariables` from `next`:
|
|
|
55
74
|
```tsx
|
|
56
75
|
export const getStaticProps = async ({ preview = false, ...props }) => {
|
|
57
76
|
const { catchAll } = props.params
|
|
58
|
-
//
|
|
59
|
-
// `./pages/api/...` cache = false
|
|
60
|
-
const cache = true
|
|
61
|
-
// @todo(next) should come from `catchAll`
|
|
77
|
+
// @todo(next)
|
|
62
78
|
const clear = false
|
|
63
|
-
const pathVariables = getPathVariables({
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
79
|
+
const pathVariables = notion.custom.getPathVariables({ catchAll })
|
|
80
|
+
/**
|
|
81
|
+
* @cache
|
|
82
|
+
* - pages = TRUE
|
|
83
|
+
* - pages/api = FALSE
|
|
84
|
+
*/
|
|
85
|
+
const cache = true
|
|
86
|
+
const data = await getDataReturn({
|
|
87
|
+
data: await getCatchAll({
|
|
88
|
+
cache,
|
|
89
|
+
catchAll,
|
|
90
|
+
clear,
|
|
91
|
+
pathVariables,
|
|
92
|
+
preview,
|
|
93
|
+
}),
|
|
94
|
+
pathVariables,
|
|
95
|
+
})
|
|
67
96
|
return {
|
|
68
97
|
props: { preview, ...data, ...pathVariables, ...props },
|
|
69
98
|
revalidate,
|
package/constants/index.cjs
CHANGED
|
File without changes
|
package/constants/index.d.ts
CHANGED
|
File without changes
|
package/constants/index.js
CHANGED
|
File without changes
|
package/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var Rt=Object.create;var z=Object.defineProperty,Ht=Object.defineProperties,Wt=Object.getOwnPropertyDescriptor,Ft=Object.getOwnPropertyDescriptors,Qt=Object.getOwnPropertyNames,we=Object.getOwnPropertySymbols,zt=Object.getPrototypeOf,be=Object.prototype.hasOwnProperty,$t=Object.prototype.propertyIsEnumerable;var Te=(e,t,n)=>t in e?z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,b=(e,t)=>{for(var n in t||(t={}))be.call(t,n)&&Te(e,n,t[n]);if(we)for(var n of we(t))$t.call(t,n)&&Te(e,n,t[n]);return e},k=(e,t)=>Ht(e,Ft(t)),ke=e=>z(e,"__esModule",{value:!0});var jt=(e,t)=>{for(var n in t)z(e,n,{get:t[n],enumerable:!0})},Ie=(e,t,n,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Qt(t))!be.call(e,r)&&(n||r!=="default")&&z(e,r,{get:()=>t[r],enumerable:!(l=Wt(t,r))||l.enumerable});return e},p=(e,t)=>Ie(ke(z(e!=null?Rt(zt(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),Yt=(e=>(t,n)=>e&&e.get(t)||(n=Ie(ke({}),t,1),e&&e.set(t,n),n))(typeof WeakMap!="undefined"?new WeakMap:0);var De=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var B=(e,t,n)=>(De(e,t,"read from private field"),n?n.call(e):t.get(e)),Ce=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},ve=(e,t,n,l)=>(De(e,t,"write to private field"),l?l.call(e,n):t.set(e,n),n);var Fo={};jt(Fo,{Client:()=>Vt});var Ut=p(require("@notionhq/client"),1);var N=p(require("lodash/filter.js"),1),xe=p(require("lodash/map.js"),1),L=({key:e,notion:t,type:n})=>({key:e,notion:t,type:n}),o={addressCity:{init:!0,key:"addressCity",notion:"Address.City",type:"rich_text"},addressLatitude:{init:!0,key:"addressLatitude",notion:"Address.Latitude",type:"number",format:"number"},addressLongitude:{init:!0,key:"addressLongitude",notion:"Address.Longitude",type:"number",format:"number"},addressNeighborhood:{init:!0,key:"addressNeighborhood",notion:"Address.Neighborhood",type:"rich_text"},addressState:{init:!0,key:"addressState",notion:"Address.State",type:"select"},addressStreet:{init:!0,key:"addressStreet",notion:"Address.Street",type:"rich_text"},addressZipCode:{init:!0,key:"addressZipCode",notion:"Address.ZipCode",type:"number",format:"number"},authors:{init:!0,key:"authors",notion:"Authors",type:"people"},categories:{init:!0,key:"categories",notion:"Categories",type:"multi_select"},dateCreated:{init:!1,key:"dateCreated",notion:"Date.Created",type:"created_time"},dateEdited:{init:!1,key:"dateEdited",notion:"Date.Edited",type:"last_edited_time"},dateEvent:{init:!0,key:"dateEvent",notion:"Date.Event",type:"date"},datePublished:{init:!0,key:"datePublished",notion:"Date.Published",type:"date"},dateRecorded:{init:!0,key:"dateRecorded",notion:"Date.Recorded",type:"date"},duration:{init:!0,key:"duration",notion:"Duration",type:"rich_text"},email:{init:!0,key:"email",notion:"Email",type:"rich_text"},episode:{init:!0,key:"episode",notion:"Episode",type:"number",format:"number"},explicit:{init:!0,key:"explicit",notion:"Explicit",type:"checkbox"},festivals:{init:!0,key:"festivals",notion:"Festival",type:"multi_select"},food:{init:!0,key:"food",notion:"Food",type:"rich_text"},isIndexed:{init:!0,key:"isIndexed",notion:"Is.Indexed",type:"checkbox"},isPublished:{init:!0,key:"isPublished",notion:"Is.Published",type:"checkbox"},mp3:{init:!0,key:"mp3",notion:"MP3",type:"files"},name:{init:!0,key:"name",notion:"Name",type:"rich_text"},nameFirst:{init:!0,key:"nameFirst",notion:"Name.First",type:"rich_text"},nameLast:{init:!0,key:"nameLast",notion:"Name.Last",type:"rich_text"},namePreferred:{init:!0,key:"namePreferred",notion:"Name.Preferred",type:"rich_text"},phoneNumber:{init:!0,key:"phoneNumber",notion:"Phone",type:"rich_text"},podcastAuthor:{init:!0,key:"podcastAuthor",notion:"Author",type:"rich_text"},podcastAuthorEmail:{init:!0,key:"podcastAuthorEmail",notion:"Author.Email",type:"rich_text"},relationEpisodes__Podcast:{init:!0,key:"relationEpisodes__Podcast",notion:"Podcasts",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Episodes"}},relationPodcasts__Episodes:{init:!1,key:"relationPodcasts__Episodes",notion:"Episodes",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Podcasts"}},relationEpisodes__People_Guest:{init:!0,key:"relationEpisodes__People_Guest",notion:"Guest",type:"relation",relation:{database_id:"People",synced_property_name:"Episodes.Guest"}},relationPeople__Episodes_Guest:{init:!1,key:"relationPeople__Episodes_Guest",notion:"Episodes.Guest",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Guest"}},relationEpisodes__People_Sound_Engineer:{init:!0,key:"relationEpisodes__People_Sound_Engineer",notion:"Sound.Engineer",type:"relation",relation:{database_id:"People",synced_property_name:"Episodes.Sound.Engineer"}},relationPeople__Episodes_Sound_Engineer:{init:!1,key:"relationPeople__Episodes_Sound_Engineer",notion:"Episodes.Sound.Engineer",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Sound.Engineer"}},relationEpisodes__People_Thanks:{init:!0,key:"relationEpisodes__People_Thanks",notion:"Thanks",type:"relation",relation:{database_id:"People",synced_property_name:"Episodes.Thanks"}},relationPeople__Episodes_Thanks:{init:!1,key:"relationPeople__Episodes_Thanks",notion:"Episodes.Thanks",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Thanks"}},relationEpisodes__Venues:{init:!0,key:"relationEpisodes__Venues",notion:"Venues",type:"relation",relation:{database_id:"Venues",synced_property_name:"Episodes"}},relationVenues__Episodes:{init:!1,key:"relationVenues__Episodes",notion:"Episodes",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Venues"}},relationEvents__Venues:{init:!0,key:"relationEvents__Venues",notion:"Venues",type:"relation",relation:{database_id:"Venues",synced_property_name:"Events"}},relationVenues__Events:{init:!1,key:"relationVenues__Events",notion:"Events",type:"relation",relation:{database_id:"Events",synced_property_name:"Venues"}},relationEvents__Shows:{init:!0,key:"relationEvents__Shows",notion:"Shows",type:"relation",relation:{database_id:"Shows",synced_property_name:"Events"}},relationShows__Events:{init:!1,key:"relationShows__Events",notion:"Events",type:"relation",relation:{database_id:"Events",synced_property_name:"Shows"}},relationEvents__Shows_Lineup:{init:!0,key:"relationEvents__Shows_Lineup",notion:"Shows.Lineup",type:"relation",relation:{database_id:"Shows",synced_property_name:"Events.Lineup"}},relationShows__Events_Lineup:{init:!1,key:"relationShows__Events_Lineup",notion:"Events.Lineup",type:"relation",relation:{database_id:"Events",synced_property_name:"Shows.Lineup"}},relationShows__People_Cast:{init:!0,key:"relationShows__People_Cast",notion:"Cast",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Cast"}},relationPeople__Shows_Cast:{init:!1,key:"relationPeople__Shows_Cast",notion:"Shows.Cast",type:"relation",relation:{database_id:"Shows",synced_property_name:"Cast"}},relationShows__People_Cast_Past:{init:!0,key:"relationShows__People_Cast_Past",notion:"Cast.Past",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Cast.Past"}},relationPeople__Shows_Cast_Past:{init:!1,key:"relationPeople__Shows_Cast_Past",notion:"Shows.Cast.Past",type:"relation",relation:{database_id:"Shows",synced_property_name:"Cast.Past"}},relationShows_People_Crew:{init:!0,key:"relationShows_People_Crew",notion:"Crew",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Crew"}},relationPeople__Shows_Crew:{init:!0,key:"relationPeople__Shows_Crew",notion:"Shows.Crew",type:"relation",relation:{database_id:"Shows",synced_property_name:"Crew"}},relationShows__People_Director:{init:!0,key:"relationShows__People_Director",notion:"Director",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Director"}},relationPeople__Shows_Director:{init:!1,key:"relationPeople__Shows_Director",notion:"Shows.Director",type:"relation",relation:{database_id:"Shows",synced_property_name:"Director"}},relationShows__People_Director_Musical:{init:!0,key:"relationShows__People_Director_Musical",notion:"Director.Musical",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Director.Musical"}},relationPeople__Shows_Director_Musical:{init:!1,key:"relationPeople__Shows_Director_Musical",notion:"Shows.Director.Musical",type:"relation",relation:{database_id:"Shows",synced_property_name:"Director.Musical"}},relationShows__People_Director_Technical:{init:!0,key:"relationShows__People_Director_Technical",notion:"Director.Technical",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Director.Technical"}},relationPeople__Shows_Director_Technical:{init:!1,key:"relationPeople__Shows_Director_Technical",notion:"Shows.Director.Technical",type:"relation",relation:{database_id:"Shows",synced_property_name:"Director.Technical"}},relationEvents__People_Guest:{init:!0,key:"relationEvents__People_Guest",notion:"Guest",type:"relation",relation:{database_id:"People",synced_property_name:"Events.Guest"}},relationPeople__Events_Guest:{init:!1,key:"relationEvents__People_Guest",notion:"Events.Guest",type:"relation",relation:{database_id:"Events",synced_property_name:"Guest"}},relationPodcasts__People_Host:{init:!0,key:"relationPodcasts__People_Host",notion:"Host",type:"relation",relation:{database_id:"People",synced_property_name:"Podcasts.Host"}},relationPeople__Podcasts_Host:{init:!1,key:"relationPeople__Podcasts_Host",notion:"Podcasts.Host",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Host"}},relationEvents__People_Host:{init:!0,key:"relationEvents__People_Host",notion:"Host",type:"relation",relation:{database_id:"People",synced_property_name:"Events.Host"}},relationPeople__Events_Host:{init:!1,key:"relationPeople__Events_Host",notion:"Events.Host",type:"relation",relation:{database_id:"Events",synced_property_name:"Host"}},relationShows__People_Producer:{init:!0,key:"relationShows__People_Producer",notion:"Producer",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Producer"}},relationPeople__Shows_Producer:{init:!1,key:"relationPeople__Shows_Producer",notion:"Shows.Producer",type:"relation",relation:{database_id:"Shows",synced_property_name:"Producer"}},relationEvents__People_Guest_Music:{init:!0,key:"relationEvents__People_Guest_Music",notion:"Guest.Music",type:"relation",relation:{database_id:"People",synced_property_name:"Events.Guest.Music"}},relationPeople__Events_Guest_Music:{init:!1,key:"relationPeople__Events_Guest_Music",notion:"Events.Guest.Music",type:"relation",relation:{database_id:"Events",synced_property_name:"Guest.Music"}},relationPodcasts__People_Sound_Engineer:{init:!0,key:"relationPodcasts__People_Sound_Engineer",notion:"Sound.Engineer",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Podcasts.Sound.Engineer"}},relationPeople__Podcasts_Sound_Engineer:{init:!1,key:"relationPeople__Podcasts_Sound_Engineer",notion:"Podcasts.Sound.Engineer",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Sound.Engineer"}},relationShows__People_Thanks:{init:!0,key:"relationShows__People_Thanks",notion:"Thanks",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Thanks"}},relationPeople__Shows_Thanks:{init:!1,key:"relationPeople__Shows_Thanks",notion:"Shows.Thanks",type:"relation",relation:{database_id:"Shows",synced_property_name:"Thanks"}},relationShows__People_Writer:{init:!0,key:"relationShows__People_Writer",notion:"Writer",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Writer"}},relationPeople__Shows_Writer:{init:!1,key:"relationPeople__Shows_Writer",notion:"Shows.Writer",type:"relation",relation:{database_id:"Shows",synced_property_name:"Writer"}},relationShows__Tags:{init:!0,key:"relationShows__Tags",notion:"Tags",type:"relation",relation:{database_id:"Tags",synced_property_name:"Shows"}},relationTags__Shows:{init:!1,key:"relationTags__Shows",notion:"Shows",type:"relation",relation:{database_id:"Shows",synced_property_name:"Tags"}},rollupShows__Tags:{init:!1,key:"rollupShows__Tags",notion:"Tags.Rollup",type:"rollup",rollup:{relation_property_name:"Tags",rollup_property_id:"Title",function:"show_original"}},rollupShows__People_Cast:{init:!1,key:"rollupShows__People_Cast",notion:"Cast.Rollup",type:"rollup",rollup:{relation_property_name:"Cast",rollup_property_id:"Title",function:"show_original"}},rollupShows__People_Cast_Slug:{init:!1,key:"rollupShows__People_Cast_Slug",notion:"Cast.Rollup.Slug",type:"rollup",rollup:{relation_property_name:"Cast",rollup_property_name:"Slug",function:"show_original"}},rollupShows__People_Cast_Past:{init:!1,key:"rollupShows__People_Cast_Past",notion:"Cast.Past.Rollup",type:"rollup",rollup:{relation_property_name:"Cast.Past",rollup_property_id:"Title",function:"show_original"}},rollupShows__People_Crew:{init:!1,key:"rollupShows__People_Crew",notion:"Crew.Rollup",type:"rollup",rollup:{relation_property_name:"Crew",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Director:{init:!1,key:"rollupShows__People_Director",notion:"Director.Rollup",type:"rollup",rollup:{relation_property_name:"Director",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Director_Musical:{init:!1,key:"rollupShows__People_Director_Musical",notion:"Director.Musical.Rollup",type:"rollup",rollup:{relation_property_name:"Director.Musical",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Director_Technical:{init:!1,key:"rollupShows__People_Director_Technical",notion:"Director.Technical.Rollup",type:"rollup",rollup:{relation_property_name:"Director.Technical",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Music:{init:!1,key:"rollupShows__People_Music",notion:"Music.Rollup",type:"rollup",rollup:{relation_property_name:"Music",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Producer:{init:!1,key:"rollupShows__People_Producer",notion:"Producer.Rollup",type:"rollup",rollup:{relation_property_name:"Producer",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Thanks:{init:!1,key:"rollupShows__People_Thanks",notion:"Thanks.Rollup",type:"rollup",rollup:{relation_property_name:"Thanks",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Writer:{init:!1,key:"rollupShows__People_Writer",notion:"Writer.Rollup",type:"rollup",rollup:{relation_property_name:"Writer",rollup_property_name:"Title",function:"show_original"}},rollupEvents__People_Cast:{init:!1,key:"rollupEvents__People_Cast",notion:"Cast.Rollup",type:"rollup",rollup:{relation_property_name:"Shows",rollup_property_id:"Cast",function:"show_original"}},rollupEvents__People_Guest:{init:!1,key:"rollupEvents__People_Guest",notion:"Guest.Rollup",type:"rollup",rollup:{relation_property_name:"Guest",rollup_property_id:"Title",function:"show_original"}},rollupEvents__People_Guest_Music:{init:!1,key:"rollupEvents__People_Guest_Music",notion:"Guest.Music.Rollup",type:"rollup",rollup:{relation_property_name:"Guest.Music",rollup_property_id:"Title",function:"show_original"}},rollupEvents__People_Host:{init:!1,key:"rollupEvents__People_Host",notion:"Host.Rollup",type:"rollup",rollup:{relation_property_name:"Host",rollup_property_id:"Title",function:"show_original"}},rollupEvents__Shows:{init:!1,key:"rollupEvents__Shows",notion:"Shows.Rollup",type:"rollup",rollup:{relation_property_name:"Shows",rollup_property_id:"Title",function:"show_original"}},rollupEvents__Shows_Lineup:{init:!1,key:"rollupEvents__Shows_Lineup",notion:"Shows.Lineup.Rollup",type:"rollup",rollup:{relation_property_name:"Shows.Lineup",rollup_property_id:"Title",function:"show_original"}},rollupEvents__Venues:{init:!1,key:"rollupEvents__Venues",notion:"Venues.Rollup",type:"rollup",rollup:{relation_property_name:"Venues",rollup_property_id:"Title",function:"show_original"}},season:{init:!0,key:"season",notion:"Season",type:"number",format:"number"},seoDescription:{init:!0,key:"seoDescription",notion:"SEO.Description",type:"rich_text"},seoImage:{init:!0,key:"seoImage",notion:"SEO.Image",type:"files"},seoImageDescription:{init:!0,key:"seoImageDescription",notion:"SEO.Image.Description",type:"rich_text"},slug:{init:!0,key:"slug",notion:"Slug",type:"rich_text"},socialFacebook:{init:!0,key:"socialFacebook",notion:"Social.Facebook",type:"url"},socialInstagram:{init:!0,key:"socialInstagram",notion:"Social.Instagram",type:"url"},socialTwitter:{init:!0,key:"socialTwitter",notion:"Social.Twitter",type:"url"},socialWebsite:{init:!0,key:"socialWebsite",notion:"Social.Website",type:"url"},socialSpotify:{init:!0,key:"socialSpotify",notion:"Social.Spotify",type:"url"},socialApple:{init:!0,key:"socialApple",notion:"Social.Apple",type:"url"},subtitle:{init:!0,key:"subtitle",notion:"Subitle",type:"rich_text"},ticketUrl:{init:!0,key:"ticketUrl",notion:"TicketUrl",type:"url"},title:{init:!0,key:"title",notion:"Title",type:"title"},type:{init:!0,key:"type",notion:"Type",type:"select"}},G=[o.authors,o.datePublished,o.isIndexed,o.isPublished,o.slug,o.seoDescription,o.seoImage,o.seoImageDescription,o.title],Oe=[...G],Ne=[...G,o.dateRecorded,o.duration,o.episode,o.mp3,o.season,o.relationEpisodes__People_Guest,o.relationEpisodes__People_Sound_Engineer,o.relationEpisodes__People_Thanks,o.relationEpisodes__Podcast,o.relationEpisodes__Venues,o.socialApple,o.socialSpotify,o.type],Le=[...G,o.dateEvent,o.relationEvents__People_Guest_Music,o.relationEvents__People_Guest,o.relationEvents__People_Host,o.relationEvents__Shows_Lineup,o.relationEvents__Shows,o.relationEvents__Venues,o.socialFacebook,o.socialWebsite,o.ticketUrl,o.rollupEvents__People_Cast,o.rollupEvents__People_Guest_Music,o.rollupEvents__People_Guest,o.rollupEvents__People_Host,o.rollupEvents__Shows_Lineup,o.rollupEvents__Shows,o.rollupEvents__Venues],Ge=[...G],Be=[...G,o.email,o.nameFirst,o.nameLast,o.namePreferred,o.relationPeople__Episodes_Guest,o.relationPeople__Episodes_Sound_Engineer,o.relationPeople__Episodes_Thanks,o.relationPeople__Events_Guest,o.relationPeople__Events_Guest_Music,o.relationPeople__Events_Host,o.relationPeople__Podcasts_Host,o.relationPeople__Podcasts_Sound_Engineer,o.relationPeople__Shows_Cast,o.relationPeople__Shows_Cast_Past,o.relationPeople__Shows_Director,o.relationPeople__Shows_Director_Musical,o.relationPeople__Shows_Director_Technical,o.relationPeople__Shows_Producer,o.relationPeople__Shows_Thanks,o.relationPeople__Shows_Writer],Ae=[...G,o.categories,o.explicit,o.podcastAuthor,o.podcastAuthorEmail,o.relationPodcasts__People_Host,o.relationPodcasts__People_Sound_Engineer,o.socialApple,o.socialSpotify,o.type,o.relationPodcasts__Episodes],Ue=[...G],Ve=[...G,o.relationShows__People_Cast,o.relationShows__People_Cast_Past,o.relationShows__People_Director,o.relationShows__People_Director_Musical,o.relationShows__People_Director_Technical,o.relationShows__People_Producer,o.relationShows__People_Thanks,o.relationShows__People_Writer,o.relationShows__Tags,o.socialFacebook,o.socialInstagram,o.socialTwitter,o.socialWebsite,o.relationShows__Events,o.relationShows__Events_Lineup,o.rollupShows__People_Cast,o.rollupShows__People_Cast_Slug,o.rollupShows__People_Cast_Past,o.rollupShows__People_Crew,o.rollupShows__People_Director,o.rollupShows__People_Director_Musical,o.rollupShows__People_Director_Technical,o.rollupShows__People_Music,o.rollupShows__People_Producer,o.rollupShows__People_Thanks,o.rollupShows__People_Writer,o.rollupShows__Tags],Me=[...G,o.addressCity,o.addressLatitude,o.addressLongitude,o.addressNeighborhood,o.addressState,o.addressStreet,o.addressZipCode,o.phoneNumber,o.socialFacebook,o.socialInstagram,o.socialTwitter,o.socialWebsite,o.relationVenues__Episodes,o.relationVenues__Events],zo={BLOG:(0,N.default)(Oe,{init:!0}),EPISODES:(0,N.default)(Ne,{init:!0}),EVENTS:(0,N.default)(Le,{init:!0}),PAGES:(0,N.default)(Ge,{init:!0}),PEOPLE:(0,N.default)(Be,{init:!0}),PODCASTS:(0,N.default)(Ae,{init:!0}),SEO:(0,N.default)(Ue,{init:!0}),SHOWS:(0,N.default)(Ve,{init:!0}),VENUES:(0,N.default)(Me,{init:!0})},Re={BLOG:Oe.map(e=>L(e)),EPISODES:Ne.map(e=>L(e)),EVENTS:Le.map(e=>L(e)),PAGES:Ge.map(e=>L(e)),PEOPLE:Be.map(e=>L(e)),PODCASTS:Ae.map(e=>L(e)),SEO:Ue.map(e=>L(e)),SHOWS:Ve.map(e=>L(e)),VENUES:Me.map(e=>L(e))},He=(0,xe.default)(o,e=>L(e)),We=new Date().toISOString(),U={dateBefore:{property:o.datePublished.notion,date:{before:We}},dateOnOrAfter:{property:o.datePublished.notion,date:{on_or_after:We}},published:{property:o.isPublished.notion,checkbox:{equals:!1}},slug:{property:o.slug.notion,text:{equals:""}}},qt="LISTING",Zt="LISTING_BY_DATE",Kt="SLUG",Jt="SLUG_BY_ROUTE",Xt=[qt,Zt,Kt,Jt],v=Object.assign({},...Xt.map(e=>({[e]:e})).flat(1));var re=p(require("date-fns/addDays/index.js"),1),Fe=p(require("date-fns/addMonths/index.js"),1),Qe=p(require("date-fns/addYears/index.js"),1),eo=(e,t)=>{switch(t){case"year":return(0,Qe.default)(e,1).toISOString();case"month":return(0,Fe.default)(e,1).toISOString();case"day":return(0,re.default)(e,2).toISOString()}return(0,re.default)(e,-1).toISOString()},C=eo;var to=250;async function oo(){await ro()}function ro(e=to){return new Promise(t=>setTimeout(t,e))}var V=oo;var ze=p(require("lodash/map.js"),1);var no=({config:e,data:t,pathVariables:n,pageId:l})=>{var m,c;let{NOTION:r}=e,i={};if(!(t==null?void 0:t.properties))return i;let{properties:a}=t,s;if(n){let{meta:h,routeType:f}=n;s=f===((m=r==null?void 0:r.PODCASTS)==null?void 0:m.routeType)&&h.length>1?(c=r==null?void 0:r.EPISODES)==null?void 0:c.routeType:f}let y=s?Re[s.toUpperCase()]:He;return(0,ze.default)(y,h=>{let f,u=a[h.notion];i[h.key]=null,u&&(f=M[h.type](u,l),i[h.key]=f||null)}),i},I=no;var $e=p(require("lodash/map.js"),1),je=p(require("lodash/omit.js"),1);var io=({config:e,results:t,routeType:n})=>{let l=[];return(0,$e.default)(t,r=>{let i=(0,je.default)(r,"properties");i.properties=D(I({config:e,data:r,pathVariables:n,pageId:r==null?void 0:r.id})),l.push(i)}),l},Ye=io;var qe=p(require("lodash/fromPairs.js"),1),Ze=p(require("lodash/sortBy.js"),1),Ke=p(require("lodash/toPairs.js"),1),so=e=>(0,qe.default)((0,Ze.default)((0,Ke.default)(e))),D=so;var Je=p(require("lodash/filter.js"),1),q=p(require("lodash/map.js"),1),ao=(e,t)=>{switch(t){case"info":let n=[];return(0,q.default)(e.seoImage,r=>!!(r==null?void 0:r.url)&&(r==null?void 0:r.type)==="external"&&n.push(r==null?void 0:r.url)),n;case"content":return!!e&&(0,Je.default)(e,{object:"block",type:"image"});case"items":let l=[];return(0,q.default)(e,r=>{var i;(0,q.default)((i=r==null?void 0:r.properties)==null?void 0:i.seoImage,a=>!!(a==null?void 0:a.url)&&(a==null?void 0:a.type)==="external"&&l.push(a==null?void 0:a.url))}),l;default:return[]}},W=ao;var Xe=p(require("github-slugger"),1),Z=p(require("lodash/map.js"),1),K=p(require("plaiceholder"),1);var lo=async({data:e,pathVariables:t})=>{var c,h,f,u,T,E,g;let n=new Xe.default,l={},r=((c=e.info)==null?void 0:c.object)==="page"?W((h=e.info)==null?void 0:h.properties,"info"):!!((f=e.info)==null?void 0:f.results)&&W((T=(u=e.info)==null?void 0:u.results[0])==null?void 0:T.properties,"info"),i=!!r&&r.map(async _=>{if(!_)return null;let w=!!_&&!!(_==null?void 0:_.url)?_==null?void 0:_.url:_;if(!w)return null;let{base64:S,img:P}=await(0,K.getPlaiceholder)(w),O=n.slug(w);return{base64:S,id:O,img:P,url:w}}),a=i?await Promise.all(i):[],s=!t.isIndex&&W(e==null?void 0:e.content,"content"),y=!!s&&s.map(async _=>{var A,H;if(!_)return null;let{type:w}=_,S=_[w],P=!!_&&!!((A=S==null?void 0:S.external)==null?void 0:A.url)?(H=S==null?void 0:S.external)==null?void 0:H.url:null;if(!P)return null;let{base64:O,img:F}=await(0,K.getPlaiceholder)(P),R=n.slug(P);return{base64:O,id:R,img:F,url:P}}),m=y?await Promise.all(y):[];if(e.items){let _=e.items.object==="page"?W((E=e.items)==null?void 0:E.data,"items"):W((g=e.items)==null?void 0:g.results,"items"),w=!!_&&_.map(async P=>{if(!P)return null;let O=!!P&&!!(P==null?void 0:P.url)?P==null?void 0:P.url:P;if(!O)return null;let{base64:F,img:R}=await(0,K.getPlaiceholder)(O),A=n.slug(O);return{base64:F,id:A,img:R,url:O}}),S=await Promise.all(w);!!S&&S[0]&&(0,Z.default)(S,P=>l[P.id]=P)}return!!a&&a[0]&&(0,Z.default)(a,_=>l[_.id]=_),!!m&&m[0]&&(0,Z.default)(m,_=>l[_.id]=_),l},$=lo;var po=e=>(console.dir("@notion(_unsupported)"),console.dir(e),e),J=po;var _o=e=>e.checkbox||!1,et=_o;var uo=e=>{let{type:t}=e;return e[t]},X=uo;var co=e=>e.email||null,tt=co;var rt=p(require("github-slugger"),1),nt=p(require("lodash/size.js"),1);var yo=e=>e.length!==32?e:e.substr(0,8)+"-"+e.substr(8,4)+"-"+e.substr(12,4)+"-"+e.substr(16,4)+"-"+e.substr(20),ot=yo;var mo="https://www.notion.so/image/{{FILENAME}}?table=block&id={{PAGE_ID}}&cache=v2&w1dth=600",ho=(e,t)=>mo.replace("{{FILENAME}}",encodeURIComponent(e)).replace("{{PAGE_ID}}",ot(t)),So=(e,t)=>{let n=new rt.default,l={};return(0,nt.default)(e.files)<=0||e.files.map(r=>{var i,a;if((r==null?void 0:r.type)==="file"){let s=(i=r==null?void 0:r.file)==null?void 0:i.url.split("?")[0],y=n.slug(s);l[y]={type:r==null?void 0:r.type,url:ho(s,t)}}if((r==null?void 0:r.type)==="external"){let s=(a=r==null?void 0:r.external)==null?void 0:a.url.split("?")[0],y=n.slug(s);l[y]={type:r==null?void 0:r.type,url:s}}}),l},ne=So;var it=p(require("github-slugger"),1),st=p(require("lodash/map.js"),1),Po=e=>{let t=new it.default,n={};return(0,st.default)(e.multi_select,l=>{let r=l;r.slug=t.slug(r.name),n[r.id]=r}),n},at=Po;var fo=e=>(e==null?void 0:e.number)||null,lt=fo;var pt=p(require("github-slugger"),1),Eo=e=>{let t=new pt.default;return e.people.map(n=>{let{avatar_url:l,id:r,name:i,person:a}=n,{email:s}=a;return{[t.slug(i)]:{avatar_url:l,email:s,id:r,name:i}}})[0]},_t=Eo;var go=e=>(e==null?void 0:e.phone_number)||null,ut=go;var ie=p(require("lodash/map.js"),1);var wo=e=>e.type==="rollup"?e.rollup.type==="array"&&(0,ie.default)(e.rollup.array,t=>M[t.type](t))[0]:(0,ie.default)(e.relation,t=>t.id),dt=wo;var bo=e=>{var t;return(e==null?void 0:e.rich_text)?(t=e==null?void 0:e.rich_text[0])==null?void 0:t.plain_text:null},ct=bo;var yt=p(require("lodash/map.js"),1),mt=p(require("lodash/sortBy.js"),1);var To=e=>{var t;return(0,mt.default)((0,yt.default)((t=e==null?void 0:e.rollup)==null?void 0:t.array,n=>M[n.type](n)))},ht=To;var St=p(require("github-slugger"),1),ko=e=>{let t=new St.default,n=e.select;return n?(n.slug=t.slug(e.select.name),{[n.id]:n}):null},Pt=ko;var Io=e=>{var t;return(e==null?void 0:e.title)?(t=e==null?void 0:e.title[0])==null?void 0:t.plain_text:null},ft=Io;var Do=e=>e.url||null,Et=Do;var Co={checkbox:et,created_by:J,created_time:X,date:X,email:tt,files:ne,formula:J,image:ne,last_edited_by:J,last_edited_time:X,multi_select:at,number:lt,people:_t,phone_number:ut,relation:dt,rich_text:ct,rollup:ht,select:Pt,title:ft,url:Et},M=Co;var vo=e=>Object.entries(e).length===0&&e.constructor===Object,se=vo;var xo=e=>e===void 0&&typeof e=="undefined",j=xo;var Oo=async(e,{block_id:t})=>j(t)?[]:(await V(),await e({block_id:t})),ae=Oo;var gt={sorts:[{property:o.slug.notion,direction:"ascending"}]},No=async(e,{database_id:t,sorts:n=gt.sorts,filter:l=gt.filter})=>t?await e({database_id:t,sorts:n,filter:l}):[],le=No;var wt=async(e,{blocks:t})=>{if(t==null)return t;let n=t.filter(r=>r.has_children).map(r=>({promise:e({block_id:r.id,page_size:100}),parent_block:r})),l=await Promise.all(n.map(r=>r.promise));for(let r=0;r<l.length;r++){let i=l[r].results;if(await wt(e,{blocks:i}),n[r]){let a=n[r].parent_block;a[a.type].children=i}}return t},pe=wt;var Lo=({config:e,item:t,routeType:n,meta:l})=>{var m,c,h,f,u;let{NOTION:r}=e,i="",a=(m=t.properties)==null?void 0:m.slug,s="",y="/[...catchAll]";switch(n){case r.BLOG.routeType:i=(h=(c=t.properties)==null?void 0:c.datePublished)==null?void 0:h.start.slice(0,10);let[T,E,g]=i==null?void 0:i.split("-");s=`/${n}/${T}/${E}/${g}/${a}`;break;case r.EVENTS.routeType:i=(u=(f=t.properties)==null?void 0:f.dateEvent)==null?void 0:u.start.slice(0,10);let[_,w,S]=i==null?void 0:i.split("-");s=`/${n}/${_}/${w}/${S}/${a}`;break;case r.PODCASTS.routeType:case r.EPISODES.routeType:s=`/${l==null?void 0:l.join("/")}/${a}`;break;case r.PEOPLE.routeType:case r.SHOWS.routeType:case r.VENUES.routeType:default:s=`/${n}/${a}`;break}return s=s.replace("//","/"),{as:s,date:i,href:y,slug:a}},_e=Lo;var bt=p(require("lodash/map.js"),1),ee=p(require("lodash/omit.js"),1);var Go=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,getPagesById:l,pathVariables:r,routeType:i})=>{let{NOTION:a}=e,s={},y={},m={},c=new Date().toISOString(),h=new Date("2020-01-01").toISOString(),f=a[i.toUpperCase()].page_id__seo,u=await l({page_id:f});if(!u)return{};(u==null?void 0:u.object)==="page"&&(y=(0,ee.default)(u,"properties"),y.properties=D(I({config:e,data:u,pathVariables:r,pageId:y.id}))),s=await t({block_id:y.id});let T=await n({database_id:a[i.toUpperCase()].database_id,filter:{and:[{property:i===a.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{on_or_after:i===a.EVENTS.routeType?c:h}}]}}),E=[];(0,bt.default)(T.results,S=>{let P=S;P=(0,ee.default)(P,"properties"),P.properties=D(I({config:e,data:S,pathVariables:r,pageId:S.id})),E.push(P)});let g=(0,ee.default)(T,"results");g.results=E,m=g;let _={info:y,content:s,items:m,images:{}},w=_?await $({data:_,pathVariables:r}):{};return _=k(b({},_),{images:w}),_},ue=Go;var Tt=p(require("lodash/map.js"),1),Y=p(require("lodash/omit.js"),1),kt=p(require("lodash/size.js"),1);var Bo=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,getPagesById:l,pathVariables:r,routeType:i,slug:a})=>{let{NOTION:s}=e,{meta:y}=r,m={},c={},h={},f=new Date().toISOString(),u=s[i.toUpperCase()].page_id__seo,T=await l({page_id:u});T.object==="page"&&(c=(0,Y.default)(T,"properties"),c.properties=D(I({config:e,data:T,pathVariables:r,pageId:c.id}))),m=await t({block_id:c.id});let E=(0,kt.default)(y),[g,_,w]=y,S=new Date(`${g||f.slice(0,4)}-${_||"01"}-${w||"01"}`),P,O=[{property:o.datePublished.notion,direction:"descending"}];switch(E){case 1:P={and:[{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{on_or_after:C(S,"")}},{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{before:C(S,"year")}}]};break;case 2:P={and:[{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{on_or_after:C(S,"")}},{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{before:C(S,"month")}}]};break;case 3:P={and:[{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{on_or_after:C(S,"")}},{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{before:C(S,"day")}}]};break;default:P={and:[{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{on_or_after:C(S,"")}},{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{before:C(S,"day")}},k(b({},U.slug),{text:{equals:a}})]};break}let F=s[i.toUpperCase()].database_id,R=await n({database_id:F,filter:P,sorts:O}),A=[];(0,Tt.default)(R.results,oe=>{let Q=oe;Q=(0,Y.default)(Q,"properties"),Q.properties=D(I({config:e,data:oe,pathVariables:r,pageId:oe.id})),!!Q&&A.push(Q)});let H=(0,Y.default)(R,"results");H.results=A,h=H,h=(0,Y.default)(H,"data");let te={info:c,content:m,items:h,images:{}},Mt={};return te=k(b({},te),{images:Mt}),te},de=Bo;var It=p(require("lodash/filter.js"),1),Dt=p(require("lodash/omit.js"),1);var Ao=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,getDeepFetchAllChildren:l,pathVariables:r,routeType:i,slug:a})=>{let{NOTION:s}=e,y={},m={},c={},h=i==null?void 0:i.toUpperCase();if(!Object.keys(s).includes(h))return{info:m,content:y,items:c,images:{}};let u=await n({database_id:s[h].database_id,filter:{and:[k(b({},U.slug),{text:{equals:a}})]}}),T=(u==null?void 0:u.object)==="list"&&u.results[0];if(!T)return{};m=(0,Dt.default)(T,"properties"),m.properties=D(I({config:e,data:T,pathVariables:r,pageId:m.id})),y=await t({block_id:m.id}),y=[...await l({blocks:y.results})],c&&(c.results=(0,It.default)(c.results,{properties:{isPublished:!0}}));let g={info:m,content:y,items:c,images:{}},_=g?await $({data:g,pathVariables:r}):{};return g=k(b({},g),{images:_}),g},ce=Ao;var ye=p(require("lodash/omit.js"),1),Ct=p(require("lodash/size.js"),1);var Uo=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,getQuery:l,pathVariables:r,routeType:i,slug:a})=>{let{NOTION:s}=e,{meta:y}=r,m={},c={},h={},f=new Date().toISOString();if(i===s.PODCASTS.routeType){let[E,g]=y,_=(0,Ct.default)(y)===2,w=await n({database_id:s[_?s.EPISODES.routeType.toUpperCase():i.toUpperCase()].database_id,filter:{and:[k(b({},U.slug),{text:{equals:_?g:E}})]}}),S=(w==null?void 0:w.object)==="list"&&w.results[0];if(!S)return{};c=(0,ye.default)(S,"properties"),c.properties=D(I({config:e,data:S,pathVariables:r,pageId:c.id})),m=await t({block_id:c.id}),_||i===s.PODCASTS.routeType&&(h=await l({config:e,reqQuery:{podcasts:c.id,databaseType:s.EPISODES.routeType.toUpperCase()}}))}if([s.BLOG.routeType,s.EVENTS.routeType].includes(i)){let[E,g,_]=y,w=new Date(`${E||f.slice(0,4)}-${g||"01"}-${_||"01"}`),S=await n({database_id:s[i.toUpperCase()].database_id,filter:{and:[{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{on_or_after:C(w,"")}},{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{before:C(w,"day")}},k(b({},U.slug),{text:{equals:a}})]}}),P=(S==null?void 0:S.object)==="list"&&S.results[0];P&&(c=(0,ye.default)(P,"properties"),c.properties=D(I({config:e,data:P,pathVariables:r,pageId:c.id})),m=await t({block_id:c.id}))}let u={info:c,content:m,items:h,images:{}},T={};return u=k(b({},u),{images:T}),u},me=Uo;var Vo=async(e,{page_id:t})=>j(t)?[]:(await V(),await e({page_id:t})),he=Vo;var Se=p(require("lodash/drop.js"),1),vt=p(require("lodash/dropRight.js"),1),xt=p(require("lodash/first.js"),1),Pe=p(require("lodash/includes.js"),1),Ot=p(require("lodash/isInteger.js"),1),Nt=p(require("lodash/join.js"),1),Lt=p(require("lodash/last.js"),1),fe=p(require("lodash/size.js"),1);var Mo=({config:e,catchAll:t})=>{let{NOTION:n,PAGES__HOMEPAGE:l,ROUTE_TYPES:r}=e,i=(0,fe.default)(t),a=(0,xt.default)(t),s=(0,Lt.default)(t),y=i>1&&(0,Pe.default)([n.BLOG.routeType,n.EVENTS.routeType,n.PODCASTS.routeType],a)?(0,Se.default)(t):(0,Se.default)((0,vt.default)(t)),m=a===s&&!(0,Pe.default)(r,a)?"pages":a,c=a!==s&&!(0,Ot.default)(parseInt(s))?s:a,h=m==="pages",f=c===a,u=!!y&&(0,fe.default)(y)!==0,T=h&&a===l?"":(0,Nt.default)(t,"/"),E=v.SLUG;return h?E=v.SLUG:f&&!u?E=v.LISTING:f&&u?E=v.LISTING_BY_DATE:u?E=v.SLUG_BY_ROUTE:E=v.SLUG,{dataType:E,hasMeta:u,isPage:h,isIndex:f,meta:y,routeType:m,slug:c,url:T}},Ee=Mo;var Gt=p(require("lodash/map.js"),1),Bt=p(require("lodash/omit.js"),1),At=p(require("lodash/size.js"),1);var Ro={ASCENDING:"ascending",DESCENDING:"descending"},Ho=[{property:o.slug.notion,direction:Ro.ASCENDING}],Wo=async({config:e,reqQuery:t,notionDatabasesQuery:n})=>{let{NOTION:l}=e,{databaseType:r}=t,i=r,a=!1,s=r.toUpperCase(),y=l[s].database_id;if(!y)return[];let m={},c={},h,f;if(r==="EPISODES"){f=Ho;let{podcasts:u}=t,T=[],E=[];!!u&&E.push(...u==null?void 0:u.split(",")),(0,At.default)(E)>0&&(0,Gt.default)(E,g=>T.push({property:o.relationEpisodes__Podcast.notion,relation:{contains:g}})),h={or:[...T]}}else a=!0;if(!a&&(!m||se(m))){await V();let u;h?((h==null?void 0:h.or.length)===0&&(h={and:[{property:o.slug.notion,rich_text:{equals:"@hack(notion)-do-not-return"}}]}),u=await n({database_id:y,filter:h,sorts:f}),m=u,c=Ye({config:e,results:u.results,routeType:i}),m=(0,Bt.default)(m,"results"),m.results=c):a=!0}return m},ge=Wo;var x,Vt=class extends Ut.Client{constructor(t){super(t);Ce(this,x,void 0);this.custom={getBlocksByIdChildren:async t=>await ae(this.blocks.children.list,b({},t)),getDatabasesByIdQuery:async t=>await le(this.databases.query,t),getDeepFetchAllChildren:async t=>await pe(this.blocks.children.list,b({},t)),getInfoType:t=>_e(k(b({},t),{config:B(this,x)})),getPagesById:async t=>await he(this.pages.retrieve,b({},t)),getPathVariables:t=>Ee(k(b({},t),{config:B(this,x)})),getQuery:async t=>await ge(k(b({},t),{config:B(this,x),notionDatabasesQuery:this.databases.query}))};this.dataTypes={[v.LISTING]:async t=>await ue(k(b({},t),{config:B(this,x),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getPagesById:this.custom.getPagesById})),[v.LISTING_BY_DATE]:async t=>await de(k(b({},t),{config:B(this,x),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getPagesById:this.custom.getPagesById})),[v.SLUG]:async t=>await ce(k(b({},t),{config:B(this,x),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getDeepFetchAllChildren:this.custom.getDeepFetchAllChildren})),[v.SLUG_BY_ROUTE]:async t=>await me(k(b({},t),{config:B(this,x),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getQuery:this.custom.getQuery}))};ve(this,x,t==null?void 0:t.config)}};x=new WeakMap;module.exports=Yt(Fo);0&&(module.exports={Client});
|
|
1
|
+
var ft=Object.create;var N=Object.defineProperty,Et=Object.defineProperties,wt=Object.getOwnPropertyDescriptor,Tt=Object.getOwnPropertyDescriptors,kt=Object.getOwnPropertyNames,ue=Object.getOwnPropertySymbols,bt=Object.getPrototypeOf,de=Object.prototype.hasOwnProperty,It=Object.prototype.propertyIsEnumerable;var ce=(e,t,n)=>t in e?N(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,g=(e,t)=>{for(var n in t||(t={}))de.call(t,n)&&ce(e,n,t[n]);if(ue)for(var n of ue(t))It.call(t,n)&&ce(e,n,t[n]);return e},f=(e,t)=>Et(e,Tt(t)),ye=e=>N(e,"__esModule",{value:!0});var Dt=(e,t)=>{for(var n in t)N(e,n,{get:t[n],enumerable:!0})},me=(e,t,n,p)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of kt(t))!de.call(e,r)&&(n||r!=="default")&&N(e,r,{get:()=>t[r],enumerable:!(p=wt(t,r))||p.enumerable});return e},l=(e,t)=>me(ye(N(e!=null?ft(bt(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),Ct=(e=>(t,n)=>e&&e.get(t)||(n=me(ye({}),t,1),e&&e.set(t,n),n))(typeof WeakMap!="undefined"?new WeakMap:0);var So={};Dt(So,{Client:()=>gt});var Pt=l(require("@notionhq/client"),1);var C=l(require("lodash/filter.js"),1),he=l(require("lodash/map.js"),1),O=({key:e,notion:t,type:n})=>({key:e,notion:t,type:n}),o={addressCity:{init:!0,key:"addressCity",notion:"Address.City",type:"rich_text"},addressLatitude:{init:!0,key:"addressLatitude",notion:"Address.Latitude",type:"number",format:"number"},addressLongitude:{init:!0,key:"addressLongitude",notion:"Address.Longitude",type:"number",format:"number"},addressNeighborhood:{init:!0,key:"addressNeighborhood",notion:"Address.Neighborhood",type:"rich_text"},addressState:{init:!0,key:"addressState",notion:"Address.State",type:"select"},addressStreet:{init:!0,key:"addressStreet",notion:"Address.Street",type:"rich_text"},addressZipCode:{init:!0,key:"addressZipCode",notion:"Address.ZipCode",type:"number",format:"number"},authors:{init:!0,key:"authors",notion:"Authors",type:"people"},categories:{init:!0,key:"categories",notion:"Categories",type:"multi_select"},dateCreated:{init:!1,key:"dateCreated",notion:"Date.Created",type:"created_time"},dateEdited:{init:!1,key:"dateEdited",notion:"Date.Edited",type:"last_edited_time"},dateEvent:{init:!0,key:"dateEvent",notion:"Date.Event",type:"date"},datePublished:{init:!0,key:"datePublished",notion:"Date.Published",type:"date"},dateRecorded:{init:!0,key:"dateRecorded",notion:"Date.Recorded",type:"date"},duration:{init:!0,key:"duration",notion:"Duration",type:"rich_text"},email:{init:!0,key:"email",notion:"Email",type:"rich_text"},episode:{init:!0,key:"episode",notion:"Episode",type:"number",format:"number"},explicit:{init:!0,key:"explicit",notion:"Explicit",type:"checkbox"},festivals:{init:!0,key:"festivals",notion:"Festival",type:"multi_select"},food:{init:!0,key:"food",notion:"Food",type:"rich_text"},isIndexed:{init:!0,key:"isIndexed",notion:"Is.Indexed",type:"checkbox"},isPublished:{init:!0,key:"isPublished",notion:"Is.Published",type:"checkbox"},mp3:{init:!0,key:"mp3",notion:"MP3",type:"files"},name:{init:!0,key:"name",notion:"Name",type:"rich_text"},nameFirst:{init:!0,key:"nameFirst",notion:"Name.First",type:"rich_text"},nameLast:{init:!0,key:"nameLast",notion:"Name.Last",type:"rich_text"},namePreferred:{init:!0,key:"namePreferred",notion:"Name.Preferred",type:"rich_text"},phoneNumber:{init:!0,key:"phoneNumber",notion:"Phone",type:"rich_text"},podcastAuthor:{init:!0,key:"podcastAuthor",notion:"Author",type:"rich_text"},podcastAuthorEmail:{init:!0,key:"podcastAuthorEmail",notion:"Author.Email",type:"rich_text"},relationEpisodes__Podcast:{init:!0,key:"relationEpisodes__Podcast",notion:"Podcasts",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Episodes"}},relationPodcasts__Episodes:{init:!1,key:"relationPodcasts__Episodes",notion:"Episodes",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Podcasts"}},relationEpisodes__People_Guest:{init:!0,key:"relationEpisodes__People_Guest",notion:"Guest",type:"relation",relation:{database_id:"People",synced_property_name:"Episodes.Guest"}},relationPeople__Episodes_Guest:{init:!1,key:"relationPeople__Episodes_Guest",notion:"Episodes.Guest",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Guest"}},relationEpisodes__People_Sound_Engineer:{init:!0,key:"relationEpisodes__People_Sound_Engineer",notion:"Sound.Engineer",type:"relation",relation:{database_id:"People",synced_property_name:"Episodes.Sound.Engineer"}},relationPeople__Episodes_Sound_Engineer:{init:!1,key:"relationPeople__Episodes_Sound_Engineer",notion:"Episodes.Sound.Engineer",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Sound.Engineer"}},relationEpisodes__People_Thanks:{init:!0,key:"relationEpisodes__People_Thanks",notion:"Thanks",type:"relation",relation:{database_id:"People",synced_property_name:"Episodes.Thanks"}},relationPeople__Episodes_Thanks:{init:!1,key:"relationPeople__Episodes_Thanks",notion:"Episodes.Thanks",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Thanks"}},relationEpisodes__Venues:{init:!0,key:"relationEpisodes__Venues",notion:"Venues",type:"relation",relation:{database_id:"Venues",synced_property_name:"Episodes"}},relationVenues__Episodes:{init:!1,key:"relationVenues__Episodes",notion:"Episodes",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Venues"}},relationEvents__Venues:{init:!0,key:"relationEvents__Venues",notion:"Venues",type:"relation",relation:{database_id:"Venues",synced_property_name:"Events"}},relationVenues__Events:{init:!1,key:"relationVenues__Events",notion:"Events",type:"relation",relation:{database_id:"Events",synced_property_name:"Venues"}},relationEvents__Shows:{init:!0,key:"relationEvents__Shows",notion:"Shows",type:"relation",relation:{database_id:"Shows",synced_property_name:"Events"}},relationShows__Events:{init:!1,key:"relationShows__Events",notion:"Events",type:"relation",relation:{database_id:"Events",synced_property_name:"Shows"}},relationEvents__Shows_Lineup:{init:!0,key:"relationEvents__Shows_Lineup",notion:"Shows.Lineup",type:"relation",relation:{database_id:"Shows",synced_property_name:"Events.Lineup"}},relationShows__Events_Lineup:{init:!1,key:"relationShows__Events_Lineup",notion:"Events.Lineup",type:"relation",relation:{database_id:"Events",synced_property_name:"Shows.Lineup"}},relationShows__People_Cast:{init:!0,key:"relationShows__People_Cast",notion:"Cast",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Cast"}},relationPeople__Shows_Cast:{init:!1,key:"relationPeople__Shows_Cast",notion:"Shows.Cast",type:"relation",relation:{database_id:"Shows",synced_property_name:"Cast"}},relationShows__People_Cast_Past:{init:!0,key:"relationShows__People_Cast_Past",notion:"Cast.Past",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Cast.Past"}},relationPeople__Shows_Cast_Past:{init:!1,key:"relationPeople__Shows_Cast_Past",notion:"Shows.Cast.Past",type:"relation",relation:{database_id:"Shows",synced_property_name:"Cast.Past"}},relationShows_People_Crew:{init:!0,key:"relationShows_People_Crew",notion:"Crew",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Crew"}},relationPeople__Shows_Crew:{init:!0,key:"relationPeople__Shows_Crew",notion:"Shows.Crew",type:"relation",relation:{database_id:"Shows",synced_property_name:"Crew"}},relationShows__People_Director:{init:!0,key:"relationShows__People_Director",notion:"Director",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Director"}},relationPeople__Shows_Director:{init:!1,key:"relationPeople__Shows_Director",notion:"Shows.Director",type:"relation",relation:{database_id:"Shows",synced_property_name:"Director"}},relationShows__People_Director_Musical:{init:!0,key:"relationShows__People_Director_Musical",notion:"Director.Musical",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Director.Musical"}},relationPeople__Shows_Director_Musical:{init:!1,key:"relationPeople__Shows_Director_Musical",notion:"Shows.Director.Musical",type:"relation",relation:{database_id:"Shows",synced_property_name:"Director.Musical"}},relationShows__People_Director_Technical:{init:!0,key:"relationShows__People_Director_Technical",notion:"Director.Technical",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Director.Technical"}},relationPeople__Shows_Director_Technical:{init:!1,key:"relationPeople__Shows_Director_Technical",notion:"Shows.Director.Technical",type:"relation",relation:{database_id:"Shows",synced_property_name:"Director.Technical"}},relationEvents__People_Guest:{init:!0,key:"relationEvents__People_Guest",notion:"Guest",type:"relation",relation:{database_id:"People",synced_property_name:"Events.Guest"}},relationPeople__Events_Guest:{init:!1,key:"relationEvents__People_Guest",notion:"Events.Guest",type:"relation",relation:{database_id:"Events",synced_property_name:"Guest"}},relationPodcasts__People_Host:{init:!0,key:"relationPodcasts__People_Host",notion:"Host",type:"relation",relation:{database_id:"People",synced_property_name:"Podcasts.Host"}},relationPeople__Podcasts_Host:{init:!1,key:"relationPeople__Podcasts_Host",notion:"Podcasts.Host",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Host"}},relationEvents__People_Host:{init:!0,key:"relationEvents__People_Host",notion:"Host",type:"relation",relation:{database_id:"People",synced_property_name:"Events.Host"}},relationPeople__Events_Host:{init:!1,key:"relationPeople__Events_Host",notion:"Events.Host",type:"relation",relation:{database_id:"Events",synced_property_name:"Host"}},relationShows__People_Producer:{init:!0,key:"relationShows__People_Producer",notion:"Producer",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Producer"}},relationPeople__Shows_Producer:{init:!1,key:"relationPeople__Shows_Producer",notion:"Shows.Producer",type:"relation",relation:{database_id:"Shows",synced_property_name:"Producer"}},relationEvents__People_Guest_Music:{init:!0,key:"relationEvents__People_Guest_Music",notion:"Guest.Music",type:"relation",relation:{database_id:"People",synced_property_name:"Events.Guest.Music"}},relationPeople__Events_Guest_Music:{init:!1,key:"relationPeople__Events_Guest_Music",notion:"Events.Guest.Music",type:"relation",relation:{database_id:"Events",synced_property_name:"Guest.Music"}},relationPodcasts__People_Sound_Engineer:{init:!0,key:"relationPodcasts__People_Sound_Engineer",notion:"Sound.Engineer",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Podcasts.Sound.Engineer"}},relationPeople__Podcasts_Sound_Engineer:{init:!1,key:"relationPeople__Podcasts_Sound_Engineer",notion:"Podcasts.Sound.Engineer",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Sound.Engineer"}},relationShows__People_Thanks:{init:!0,key:"relationShows__People_Thanks",notion:"Thanks",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Thanks"}},relationPeople__Shows_Thanks:{init:!1,key:"relationPeople__Shows_Thanks",notion:"Shows.Thanks",type:"relation",relation:{database_id:"Shows",synced_property_name:"Thanks"}},relationShows__People_Writer:{init:!0,key:"relationShows__People_Writer",notion:"Writer",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Writer"}},relationPeople__Shows_Writer:{init:!1,key:"relationPeople__Shows_Writer",notion:"Shows.Writer",type:"relation",relation:{database_id:"Shows",synced_property_name:"Writer"}},relationShows__Tags:{init:!0,key:"relationShows__Tags",notion:"Tags",type:"relation",relation:{database_id:"Tags",synced_property_name:"Shows"}},relationTags__Shows:{init:!1,key:"relationTags__Shows",notion:"Shows",type:"relation",relation:{database_id:"Shows",synced_property_name:"Tags"}},rollupShows__Tags:{init:!1,key:"rollupShows__Tags",notion:"Tags.Rollup",type:"rollup",rollup:{relation_property_name:"Tags",rollup_property_id:"Title",function:"show_original"}},rollupShows__People_Cast:{init:!1,key:"rollupShows__People_Cast",notion:"Cast.Rollup",type:"rollup",rollup:{relation_property_name:"Cast",rollup_property_id:"Title",function:"show_original"}},rollupShows__People_Cast_Slug:{init:!1,key:"rollupShows__People_Cast_Slug",notion:"Cast.Rollup.Slug",type:"rollup",rollup:{relation_property_name:"Cast",rollup_property_name:"Slug",function:"show_original"}},rollupShows__People_Cast_Past:{init:!1,key:"rollupShows__People_Cast_Past",notion:"Cast.Past.Rollup",type:"rollup",rollup:{relation_property_name:"Cast.Past",rollup_property_id:"Title",function:"show_original"}},rollupShows__People_Crew:{init:!1,key:"rollupShows__People_Crew",notion:"Crew.Rollup",type:"rollup",rollup:{relation_property_name:"Crew",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Director:{init:!1,key:"rollupShows__People_Director",notion:"Director.Rollup",type:"rollup",rollup:{relation_property_name:"Director",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Director_Musical:{init:!1,key:"rollupShows__People_Director_Musical",notion:"Director.Musical.Rollup",type:"rollup",rollup:{relation_property_name:"Director.Musical",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Director_Technical:{init:!1,key:"rollupShows__People_Director_Technical",notion:"Director.Technical.Rollup",type:"rollup",rollup:{relation_property_name:"Director.Technical",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Music:{init:!1,key:"rollupShows__People_Music",notion:"Music.Rollup",type:"rollup",rollup:{relation_property_name:"Music",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Producer:{init:!1,key:"rollupShows__People_Producer",notion:"Producer.Rollup",type:"rollup",rollup:{relation_property_name:"Producer",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Thanks:{init:!1,key:"rollupShows__People_Thanks",notion:"Thanks.Rollup",type:"rollup",rollup:{relation_property_name:"Thanks",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Writer:{init:!1,key:"rollupShows__People_Writer",notion:"Writer.Rollup",type:"rollup",rollup:{relation_property_name:"Writer",rollup_property_name:"Title",function:"show_original"}},rollupEvents__People_Cast:{init:!1,key:"rollupEvents__People_Cast",notion:"Cast.Rollup",type:"rollup",rollup:{relation_property_name:"Shows",rollup_property_id:"Cast",function:"show_original"}},rollupEvents__People_Guest:{init:!1,key:"rollupEvents__People_Guest",notion:"Guest.Rollup",type:"rollup",rollup:{relation_property_name:"Guest",rollup_property_id:"Title",function:"show_original"}},rollupEvents__People_Guest_Music:{init:!1,key:"rollupEvents__People_Guest_Music",notion:"Guest.Music.Rollup",type:"rollup",rollup:{relation_property_name:"Guest.Music",rollup_property_id:"Title",function:"show_original"}},rollupEvents__People_Host:{init:!1,key:"rollupEvents__People_Host",notion:"Host.Rollup",type:"rollup",rollup:{relation_property_name:"Host",rollup_property_id:"Title",function:"show_original"}},rollupEvents__Shows:{init:!1,key:"rollupEvents__Shows",notion:"Shows.Rollup",type:"rollup",rollup:{relation_property_name:"Shows",rollup_property_id:"Title",function:"show_original"}},rollupEvents__Shows_Lineup:{init:!1,key:"rollupEvents__Shows_Lineup",notion:"Shows.Lineup.Rollup",type:"rollup",rollup:{relation_property_name:"Shows.Lineup",rollup_property_id:"Title",function:"show_original"}},rollupEvents__Venues:{init:!1,key:"rollupEvents__Venues",notion:"Venues.Rollup",type:"rollup",rollup:{relation_property_name:"Venues",rollup_property_id:"Title",function:"show_original"}},season:{init:!0,key:"season",notion:"Season",type:"number",format:"number"},seoDescription:{init:!0,key:"seoDescription",notion:"SEO.Description",type:"rich_text"},seoImage:{init:!0,key:"seoImage",notion:"SEO.Image",type:"files"},seoImageDescription:{init:!0,key:"seoImageDescription",notion:"SEO.Image.Description",type:"rich_text"},slug:{init:!0,key:"slug",notion:"Slug",type:"rich_text"},socialFacebook:{init:!0,key:"socialFacebook",notion:"Social.Facebook",type:"url"},socialInstagram:{init:!0,key:"socialInstagram",notion:"Social.Instagram",type:"url"},socialTwitter:{init:!0,key:"socialTwitter",notion:"Social.Twitter",type:"url"},socialWebsite:{init:!0,key:"socialWebsite",notion:"Social.Website",type:"url"},socialSpotify:{init:!0,key:"socialSpotify",notion:"Social.Spotify",type:"url"},socialApple:{init:!0,key:"socialApple",notion:"Social.Apple",type:"url"},subtitle:{init:!0,key:"subtitle",notion:"Subitle",type:"rich_text"},ticketUrl:{init:!0,key:"ticketUrl",notion:"TicketUrl",type:"url"},title:{init:!0,key:"title",notion:"Title",type:"title"},type:{init:!0,key:"type",notion:"Type",type:"select"}},v=[o.authors,o.datePublished,o.isIndexed,o.isPublished,o.slug,o.seoDescription,o.seoImage,o.seoImageDescription,o.title],Se=[...v],Pe=[...v,o.dateRecorded,o.duration,o.episode,o.mp3,o.season,o.relationEpisodes__People_Guest,o.relationEpisodes__People_Sound_Engineer,o.relationEpisodes__People_Thanks,o.relationEpisodes__Podcast,o.relationEpisodes__Venues,o.socialApple,o.socialSpotify,o.type],ge=[...v,o.dateEvent,o.relationEvents__People_Guest_Music,o.relationEvents__People_Guest,o.relationEvents__People_Host,o.relationEvents__Shows_Lineup,o.relationEvents__Shows,o.relationEvents__Venues,o.socialFacebook,o.socialWebsite,o.ticketUrl,o.rollupEvents__People_Cast,o.rollupEvents__People_Guest_Music,o.rollupEvents__People_Guest,o.rollupEvents__People_Host,o.rollupEvents__Shows_Lineup,o.rollupEvents__Shows,o.rollupEvents__Venues],fe=[...v],Ee=[...v,o.email,o.nameFirst,o.nameLast,o.namePreferred,o.relationPeople__Episodes_Guest,o.relationPeople__Episodes_Sound_Engineer,o.relationPeople__Episodes_Thanks,o.relationPeople__Events_Guest,o.relationPeople__Events_Guest_Music,o.relationPeople__Events_Host,o.relationPeople__Podcasts_Host,o.relationPeople__Podcasts_Sound_Engineer,o.relationPeople__Shows_Cast,o.relationPeople__Shows_Cast_Past,o.relationPeople__Shows_Director,o.relationPeople__Shows_Director_Musical,o.relationPeople__Shows_Director_Technical,o.relationPeople__Shows_Producer,o.relationPeople__Shows_Thanks,o.relationPeople__Shows_Writer],we=[...v,o.categories,o.explicit,o.podcastAuthor,o.podcastAuthorEmail,o.relationPodcasts__People_Host,o.relationPodcasts__People_Sound_Engineer,o.socialApple,o.socialSpotify,o.type,o.relationPodcasts__Episodes],Te=[...v],ke=[...v,o.relationShows__People_Cast,o.relationShows__People_Cast_Past,o.relationShows__People_Director,o.relationShows__People_Director_Musical,o.relationShows__People_Director_Technical,o.relationShows__People_Producer,o.relationShows__People_Thanks,o.relationShows__People_Writer,o.relationShows__Tags,o.socialFacebook,o.socialInstagram,o.socialTwitter,o.socialWebsite,o.relationShows__Events,o.relationShows__Events_Lineup,o.rollupShows__People_Cast,o.rollupShows__People_Cast_Slug,o.rollupShows__People_Cast_Past,o.rollupShows__People_Crew,o.rollupShows__People_Director,o.rollupShows__People_Director_Musical,o.rollupShows__People_Director_Technical,o.rollupShows__People_Music,o.rollupShows__People_Producer,o.rollupShows__People_Thanks,o.rollupShows__People_Writer,o.rollupShows__Tags],be=[...v,o.addressCity,o.addressLatitude,o.addressLongitude,o.addressNeighborhood,o.addressState,o.addressStreet,o.addressZipCode,o.phoneNumber,o.socialFacebook,o.socialInstagram,o.socialTwitter,o.socialWebsite,o.relationVenues__Episodes,o.relationVenues__Events],go={BLOG:(0,C.default)(Se,{init:!0}),EPISODES:(0,C.default)(Pe,{init:!0}),EVENTS:(0,C.default)(ge,{init:!0}),PAGES:(0,C.default)(fe,{init:!0}),PEOPLE:(0,C.default)(Ee,{init:!0}),PODCASTS:(0,C.default)(we,{init:!0}),SEO:(0,C.default)(Te,{init:!0}),SHOWS:(0,C.default)(ke,{init:!0}),VENUES:(0,C.default)(be,{init:!0})},Ie={BLOG:Se.map(e=>O(e)),EPISODES:Pe.map(e=>O(e)),EVENTS:ge.map(e=>O(e)),PAGES:fe.map(e=>O(e)),PEOPLE:Ee.map(e=>O(e)),PODCASTS:we.map(e=>O(e)),SEO:Te.map(e=>O(e)),SHOWS:ke.map(e=>O(e)),VENUES:be.map(e=>O(e))},De=(0,he.default)(o,e=>O(e)),Ce=new Date().toISOString(),x={dateBefore:{property:o.datePublished.notion,date:{before:Ce}},dateOnOrAfter:{property:o.datePublished.notion,date:{on_or_after:Ce}},published:{property:o.isPublished.notion,checkbox:{equals:!1}},slug:{property:o.slug.notion,text:{equals:""}}},Ot="LISTING",vt="LISTING_BY_DATE",xt="SLUG",Lt="SLUG_BY_ROUTE",Bt=[Ot,vt,xt,Lt],b=Object.assign({},...Bt.map(e=>({[e]:e})).flat(1));var A=l(require("@jeromefitz/utils"),1),Nt=async({getBlocksChildrenList:e,block_id:t})=>(0,A.isUndefined)(t)?[]:(await(0,A.avoidRateLimit)(),await e({block_id:t})),F=Nt;var B={sorts:[{property:o.slug.notion,direction:"ascending"}]},Rt=async({database_id:e,filter:t=B==null?void 0:B.filter,getDatabasesQuery:n,sorts:p=B==null?void 0:B.sorts})=>e?await n({database_id:e,sorts:p,filter:t}):[],W=Rt;var Oe=async({getBlocksChildrenList:e,blocks:t})=>{if(t==null)return t;let n=t.filter(r=>r.has_children).map(r=>{let{id:i}=r;return{promise:e({block_id:i,page_size:100}),parent_block:r}}),p=await Promise.all(n.map(r=>r.promise));for(let r=0;r<p.length;r++){let i=p[r].results;if(await Oe({blocks:i,getBlocksChildrenList:e}),n[r]){let _=n[r].parent_block;_[_.type].children=i}}return t},Y=Oe;var Gt=({config:e,item:t,routeType:n,meta:p})=>{var c,h;let{NOTION:r}=e,i="",_=(c=t.properties)==null?void 0:c.slug,s="",m="/[...catchAll]";switch(n){case r.BLOG.routeType:case r.EVENTS.routeType:i=(h=t.properties[r[n.toUpperCase()].infoType.key])==null?void 0:h.start.slice(0,10);let[a,u,y]=i==null?void 0:i.split("-");s=`/${n}/${a}/${u}/${y}/${_}`;break;case r.PODCASTS.routeType:case r.EPISODES.routeType:s=`/${p==null?void 0:p.join("/")}/${_}`;break;default:s=`/${n}/${_}`;break}return s=s.replace("//","/"),{as:s,date:i,href:m,slug:_}},z=Gt;var K=l(require("@jeromefitz/utils"),1),nt=l(require("lodash/map.js"),1),V=l(require("lodash/omit.js"),1);var j=l(require("date-fns/addDays/index.js"),1),ve=l(require("date-fns/addMonths/index.js"),1),xe=l(require("date-fns/addYears/index.js"),1),At=(e,t)=>{switch(t){case"year":return(0,xe.default)(e,1).toISOString();case"month":return(0,ve.default)(e,1).toISOString();case"day":return(0,j.default)(e,2).toISOString()}return(0,j.default)(e,-1).toISOString()},I=At;var Le=l(require("lodash/map.js"),1);var Ut=({config:e,data:t,pathVariables:n,pageId:p})=>{var c,h;let{NOTION:r}=e,i={};if(!(t==null?void 0:t.properties))return i;let{properties:_}=t,s="";if(n){let{meta:a,routeType:u}=n;s=u===((c=r==null?void 0:r.PODCASTS)==null?void 0:c.routeType)&&a.length>1?(h=r==null?void 0:r.EPISODES)==null?void 0:h.routeType:u}let m=s?Ie[s.toUpperCase()]:De;return(0,Le.default)(m,a=>{let u,y=_[a.notion];i[a.key]=null,y&&(u=L[a.type](y,p),i[a.key]=u||null)}),i},w=Ut;var Be=l(require("@jeromefitz/utils"),1),Ne=l(require("lodash/map.js"),1),Re=l(require("lodash/omit.js"),1);var Mt=({config:e,results:t,routeType:n})=>{let p=[];return(0,Ne.default)(t,r=>{let i=(0,Re.default)(r,"properties");i.properties=(0,Be.sortObject)(w({config:e,data:r,pathVariables:n,pageId:r==null?void 0:r.id})),p.push(i)}),p},Ge=Mt;var Vt=({isPage:e,isIndex:t,hasMeta:n})=>e?b.SLUG:t&&!n?b.LISTING:t&&n?b.LISTING_BY_DATE:n?b.SLUG_BY_ROUTE:b.SLUG,$=Vt;var Ht=e=>(console.dir("@notion(_unsupported)"),e),U=Ht;var Qt=e=>e.checkbox||!1,Ae=Qt;var Ft=e=>{let{type:t}=e;return e[t]},M=Ft;var Wt=e=>e.email||null,Ue=Wt;var Me=l(require("@jeromefitz/utils"),1),Ve=l(require("github-slugger"),1),He=l(require("lodash/size.js"),1),Yt="https://www.notion.so/image/{{FILENAME}}?table=block&id={{PAGE_ID}}&cache=v2&w1dth=600",zt=(e,t)=>Yt.replace("{{FILENAME}}",encodeURIComponent(e)).replace("{{PAGE_ID}}",(0,Me.stringToUUID)(t)),jt=(e,t)=>{let n=new Ve.default,p={};return(0,He.default)(e.files)<=0||e.files.map(r=>{var i,_;if((r==null?void 0:r.type)==="file"){let s=(i=r==null?void 0:r.file)==null?void 0:i.url.split("?")[0],m=n.slug(s);p[m]={type:r==null?void 0:r.type,url:zt(s,t)}}if((r==null?void 0:r.type)==="external"){let s=(_=r==null?void 0:r.external)==null?void 0:_.url.split("?")[0],m=n.slug(s);p[m]={type:r==null?void 0:r.type,url:s}}}),p},q=jt;var Qe=l(require("github-slugger"),1),Fe=l(require("lodash/map.js"),1),$t=e=>{let t=new Qe.default,n={};return(0,Fe.default)(e.multi_select,p=>{let r=p;r.slug=t.slug(r.name),n[r.id]=r}),n},We=$t;var qt=e=>(e==null?void 0:e.number)||null,Ye=qt;var ze=l(require("github-slugger"),1),Zt=e=>{let t=new ze.default;return e.people.map(n=>{let{avatar_url:p,id:r,name:i,person:_}=n,{email:s}=_;return{[t.slug(i)]:{avatar_url:p,email:s,id:r,name:i}}})[0]},je=Zt;var Kt=e=>(e==null?void 0:e.phone_number)||null,$e=Kt;var Z=l(require("lodash/map.js"),1);var Jt=e=>e.type==="rollup"?e.rollup.type==="array"&&(0,Z.default)(e.rollup.array,t=>L[t.type](t))[0]:(0,Z.default)(e.relation,t=>t.id),qe=Jt;var Xt=e=>{var t;return(e==null?void 0:e.rich_text)?(t=e==null?void 0:e.rich_text[0])==null?void 0:t.plain_text:null},Ze=Xt;var Ke=l(require("lodash/map.js"),1),Je=l(require("lodash/sortBy.js"),1);var eo=e=>{var t;return(0,Je.default)((0,Ke.default)((t=e==null?void 0:e.rollup)==null?void 0:t.array,n=>L[n.type](n)))},Xe=eo;var et=l(require("github-slugger"),1),to=e=>{let t=new et.default,n=e.select;return n?(n.slug=t.slug(e.select.name),{[n.id]:n}):null},tt=to;var oo=e=>{var t;return(e==null?void 0:e.title)?(t=e==null?void 0:e.title[0])==null?void 0:t.plain_text:null},ot=oo;var ro=e=>e.url||null,rt=ro;var no={checkbox:Ae,created_by:U,created_time:M,date:M,email:Ue,files:q,formula:U,image:q,last_edited_by:U,last_edited_time:M,multi_select:We,number:Ye,people:je,phone_number:$e,relation:qe,rich_text:Ze,rollup:Xe,select:tt,title:ot,url:rt},L=no;var io=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,getPagesById:p,pathVariables:r,routeType:i})=>{let{NOTION:_}=e,s={},m=new Date().toISOString(),c=new Date("2020-01-01").toISOString(),h=_[i.toUpperCase()].page_id__seo,a=await p({page_id:h});if(!a)return{};(a==null?void 0:a.object)==="page"&&(s=(0,V.default)(a,"properties"),s.properties=(0,K.sortObject)(w({config:e,data:a,pathVariables:r,pageId:s.id})));let u=_.EVENTS.routeType===i,y=_[i.toUpperCase()].infoType.notion??o.datePublished.notion,P=await t({block_id:s.id}),S=await n({database_id:_[i.toUpperCase()].database_id,filter:{and:[{property:y,date:{on_or_after:u?m:c}}]}}),E=[];(0,nt.default)(S.results,k=>{let D=k;D=(0,V.default)(D,"properties"),D.properties=(0,K.sortObject)(w({config:e,data:k,pathVariables:r,pageId:k.id})),E.push(D)});let T=(0,V.default)(S,"results");return T.results=E,{info:s,content:P,items:T,images:{}}},J=io;var X=l(require("@jeromefitz/utils"),1),it=l(require("lodash/map.js"),1),R=l(require("lodash/omit.js"),1),st=l(require("lodash/size.js"),1);var so=({config:e,pathVariables:t,routeType:n,slug:p})=>{var y,P;let{NOTION:r}=e,{meta:i}=t,[_,s,m]=i,c=(0,st.default)(i),h=new Date().toISOString(),a=new Date(`${_||h.slice(0,4)}-${s||"01"}-${m||"01"}`),u=((P=(y=r[n.toUpperCase()])==null?void 0:y.infoType)==null?void 0:P.notion)??o.datePublished.notion;switch(c){case 1:return{and:[{property:u,date:{on_or_after:I(a,"")}},{property:u,date:{before:I(a,"year")}}]};case 2:return{and:[{property:u,date:{on_or_after:I(a,"")}},{property:u,date:{before:I(a,"month")}}]};case 3:return{and:[{property:u,date:{on_or_after:I(a,"")}},{property:u,date:{before:I(a,"day")}}]};default:return{and:[{property:u,date:{on_or_after:I(a,"")}},{property:u,date:{before:I(a,"day")}},f(g({},x.slug),{text:{equals:p}})]}}},ao=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,getPagesById:p,pathVariables:r,routeType:i,slug:_})=>{let{NOTION:s}=e,m={},c={},h=s[i.toUpperCase()].page_id__seo,a=await p({page_id:h});a.object==="page"&&(c=(0,R.default)(a,"properties"),c.properties=(0,X.sortObject)(w({config:e,data:a,pathVariables:r,pageId:a.id}))),m=await t({block_id:c.id});let u=[{property:o.datePublished.notion,direction:"descending"}],y=so({config:e,pathVariables:r,routeType:i,slug:_}),P=s[i.toUpperCase()].database_id,S=await n({database_id:P,filter:y,sorts:u}),E=[];(0,it.default)(S.results,D=>{let G=(0,R.default)(D,"properties");G.properties=(0,X.sortObject)(w({config:e,data:D,pathVariables:r,pageId:G.id})),!!G&&E.push(G)});let T=(0,R.default)(S,"results");T.results=E;let k=(0,R.default)(T,"data");return{info:c,content:m,items:k,images:{}}},ee=ao;var at=l(require("@jeromefitz/utils"),1),lt=l(require("lodash/omit.js"),1);var lo=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,getDeepFetchAllChildren:p,pathVariables:r,routeType:i,slug:_})=>{let{NOTION:s}=e,m=i==null?void 0:i.toUpperCase();if(!Object.keys(s).includes(m))return{info:{},content:{},items:{},images:{}};let h=await n({database_id:s[m].database_id,filter:{and:[f(g({},x.slug),{text:{equals:_}})]}}),a=(h==null?void 0:h.object)==="list"&&h.results[0];if(!a)return{};let u=(0,lt.default)(a,"properties");u.properties=(0,at.sortObject)(w({config:e,data:a,pathVariables:r,pageId:u.id}));let y=await t({block_id:u.id}),S=[...await p({blocks:y.results})];return{info:u,content:S,items:{},images:{}}},te=lo;var oe=l(require("@jeromefitz/utils"),1),re=l(require("lodash/omit.js"),1),pt=l(require("lodash/size.js"),1);var po=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,getQuery:p,pathVariables:r,routeType:i})=>{var k;let{NOTION:_}=e,{meta:s}=r,m=i.toUpperCase(),[c,h]=s,a=(0,pt.default)(s)===2,u=(k=_[m])==null?void 0:k.hasChild.toUpperCase(),y=await n({database_id:_[a?_[u].routeType.toUpperCase():m].database_id,filter:{and:[f(g({},x.slug),{text:{equals:a?h:c}})]}}),P=(y==null?void 0:y.object)==="list"&&y.results[0];if(!P)return{info:{},content:{},items:{},images:{}};let S=(0,re.default)(P,"properties");S.properties=(0,oe.sortObject)(w({config:e,data:P,pathVariables:r,pageId:S.id}));let E=await t({block_id:S.id}),T={};return a||(T=await p({config:e,reqQuery:{podcasts:S.id,databaseType:_[u].routeType.toUpperCase()}})),{info:S,content:E,items:T,images:{}}},_o=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,pathVariables:p,routeType:r,slug:i})=>{var k,D;let _=new Date().toISOString(),{NOTION:s}=e,{meta:m}=p,[c,h,a]=m,u=new Date(`${c||_.slice(0,4)}-${h||"01"}-${a||"01"}`),y=((D=(k=s[r.toUpperCase()])==null?void 0:k.infoType)==null?void 0:D.notion)??o.datePublished.notion,P=await n({database_id:s[r.toUpperCase()].database_id,filter:{and:[{property:y,date:{on_or_after:I(u,"")}},{property:y,date:{before:I(u,"day")}},f(g({},x.slug),{text:{equals:i}})]}}),S=(P==null?void 0:P.object)==="list"&&P.results[0];if(!S)return{info:{},content:{},items:{},images:{}};let E=(0,re.default)(S,"properties");E.properties=(0,oe.sortObject)(w({config:e,data:S,pathVariables:p,pageId:E.id}));let T=await t({block_id:E.id});return{info:E,content:T,items:{},images:{}}},uo=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,getQuery:p,pathVariables:r,routeType:i,slug:_})=>{let{NOTION:s,ROUTE_TYPES_BY_DATA_TYPES:m}=e;return s[i.toUpperCase()].hasChild?await po({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,getQuery:p,pathVariables:r,routeType:i}):m[b.LISTING_BY_DATE].includes(i.toUpperCase())?await _o({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,pathVariables:r,routeType:i,slug:_}):{info:{},content:{},items:{},images:{}}},ne=uo;var H=l(require("@jeromefitz/utils"),1),co=async({getPagesRetrieve:e,page_id:t})=>(0,H.isUndefined)(t)?[]:(await(0,H.avoidRateLimit)(),await e({page_id:t})),ie=co;var se=l(require("lodash/drop.js"),1),_t=l(require("lodash/dropRight.js"),1),ut=l(require("lodash/first.js"),1),ae=l(require("lodash/includes.js"),1),dt=l(require("lodash/isInteger.js"),1),ct=l(require("lodash/join.js"),1),yt=l(require("lodash/last.js"),1),le=l(require("lodash/size.js"),1);var yo=({config:e,catchAll:t})=>{let{NOTION:n,PAGES__HOMEPAGE:p,ROUTE_META:r,ROUTE_TYPES:i}=e,_=(0,le.default)(t),s=(0,ut.default)(t),m=s.toUpperCase(),c=(0,yt.default)(t),h=_>1&&(0,ae.default)(r,m)?(0,se.default)(t):(0,se.default)((0,_t.default)(t)),a=s===c&&!(0,ae.default)(i,m)?n.PAGES.routeType:s,u=s!==c&&!(0,dt.default)(parseInt(c))?c:s,y=a===n.PAGES.routeType.toLowerCase(),P=u===s,S=!!h&&(0,le.default)(h)!==0,E=y&&s===p?"":(0,ct.default)(t,"/"),T={hasMeta:S,isPage:y,isIndex:P,meta:h,routeType:a,slug:u,url:E},k=$(T);return f(g({},T),{dataType:k})},pe=yo;var Q=l(require("@jeromefitz/utils"),1),mt=l(require("lodash/map.js"),1),ht=l(require("lodash/omit.js"),1),St=l(require("lodash/size.js"),1);var mo=[{property:o.slug.notion,direction:"ascending"}],ho=async({config:e,reqQuery:t,notionDatabasesQuery:n})=>{let{NOTION:p}=e,{databaseType:r}=t,i=r,_=!1,s=r.toUpperCase(),m=p[s].database_id;if(!m)return[];let c={},h={},a,u;if(r==="EPISODES"){u=mo;let{podcasts:y}=t,P=[],S=[];!!y&&S.push(...y==null?void 0:y.split(",")),(0,St.default)(S)>0&&(0,mt.default)(S,E=>P.push({property:o.relationEpisodes__Podcast.notion,relation:{contains:E}})),a={or:[...P]}}else _=!0;if(!_&&(!c||(0,Q.isObjectEmpty)(c))){await(0,Q.avoidRateLimit)();let y;a?((a==null?void 0:a.or.length)===0&&(a={and:[{property:o.slug.notion,rich_text:{equals:"@hack(notion)-do-not-return"}}]}),y=await n({database_id:m,filter:a,sorts:u}),c=y,h=Ge({config:e,results:y.results,routeType:i}),c=(0,ht.default)(c,"results"),c.results=h):_=!0}return c},_e=ho;var gt=class extends Pt.Client{constructor(t){super(t);this.custom={getBlocksByIdChildren:async t=>await F(f(g({},t),{getBlocksChildrenList:this.blocks.children.list})),getDatabasesByIdQuery:async t=>await W(f(g({},t),{getDatabasesQuery:this.databases.query})),getDeepFetchAllChildren:async t=>await Y(f(g({},t),{getBlocksChildrenList:this.blocks.children.list})),getInfoType:t=>z(f(g({},t),{config:this.#e})),getPagesById:async t=>await ie(f(g({},t),{getPagesRetrieve:this.pages.retrieve})),getPathVariables:t=>pe(f(g({},t),{config:this.#e})),getQuery:async t=>await _e(f(g({},t),{config:this.#e,notionDatabasesQuery:this.databases.query}))};this.dataTypes={[b.LISTING]:async t=>await J(f(g({},t),{config:this.#e,getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getPagesById:this.custom.getPagesById})),[b.LISTING_BY_DATE]:async t=>await ee(f(g({},t),{config:this.#e,getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getPagesById:this.custom.getPagesById})),[b.SLUG]:async t=>await te(f(g({},t),{config:this.#e,getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getDeepFetchAllChildren:this.custom.getDeepFetchAllChildren})),[b.SLUG_BY_ROUTE]:async t=>await ne(f(g({},t),{config:this.#e,getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getQuery:this.custom.getQuery}))};this.#e=t==null?void 0:t.config}#e};module.exports=Ct(So);0&&(module.exports={Client});
|
package/index.d.ts
CHANGED
|
@@ -1,37 +1,44 @@
|
|
|
1
1
|
import { DataTypes } from './schema/index';
|
|
2
2
|
import { Client as Client$1 } from '@notionhq/client';
|
|
3
3
|
|
|
4
|
+
declare type CredentialProps = {
|
|
5
|
+
auth: string;
|
|
6
|
+
config: any;
|
|
7
|
+
};
|
|
8
|
+
declare type CustomProps = {
|
|
9
|
+
getBlocksByIdChildren: any;
|
|
10
|
+
getDatabasesByIdQuery: any;
|
|
11
|
+
getDeepFetchAllChildren: any;
|
|
12
|
+
getInfoType: any;
|
|
13
|
+
getPagesById: any;
|
|
14
|
+
getPathVariables: any;
|
|
15
|
+
getQuery: any;
|
|
16
|
+
};
|
|
17
|
+
declare type DataTypesProps = {
|
|
18
|
+
LISTING: any;
|
|
19
|
+
LISTING_BY_DATE: any;
|
|
20
|
+
SLUG: any;
|
|
21
|
+
SLUG_BY_ROUTE: any;
|
|
22
|
+
};
|
|
23
|
+
declare type ClientProps = {
|
|
24
|
+
custom: CustomProps;
|
|
25
|
+
dataTypes: DataTypesProps;
|
|
26
|
+
};
|
|
4
27
|
declare class Client extends Client$1 {
|
|
5
28
|
#private;
|
|
6
29
|
constructor(options?: any);
|
|
7
30
|
readonly custom: {
|
|
8
|
-
getBlocksByIdChildren: (props:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
database_id: any;
|
|
13
|
-
sorts?: any;
|
|
14
|
-
filter?: any;
|
|
15
|
-
}) => Promise<any>;
|
|
16
|
-
getDeepFetchAllChildren: (props: {
|
|
17
|
-
blocks: any;
|
|
18
|
-
}) => Promise<any[]>;
|
|
19
|
-
getInfoType: (props: {
|
|
20
|
-
config: any;
|
|
21
|
-
item: any;
|
|
22
|
-
routeType: any;
|
|
23
|
-
meta: any;
|
|
24
|
-
}) => {
|
|
31
|
+
getBlocksByIdChildren: (props: any) => Promise<any>;
|
|
32
|
+
getDatabasesByIdQuery: (props: any) => Promise<any>;
|
|
33
|
+
getDeepFetchAllChildren: (props: any) => Promise<any[]>;
|
|
34
|
+
getInfoType: (props: any) => {
|
|
25
35
|
as: string;
|
|
26
36
|
date: string;
|
|
27
37
|
href: string;
|
|
28
38
|
slug: any;
|
|
29
39
|
};
|
|
30
40
|
getPagesById: (props: any) => Promise<any>;
|
|
31
|
-
getPathVariables: (props: {
|
|
32
|
-
config: any;
|
|
33
|
-
catchAll: any;
|
|
34
|
-
}) => {
|
|
41
|
+
getPathVariables: (props: any) => {
|
|
35
42
|
dataType: DataTypes;
|
|
36
43
|
hasMeta: boolean;
|
|
37
44
|
isPage: boolean;
|
|
@@ -44,24 +51,54 @@ declare class Client extends Client$1 {
|
|
|
44
51
|
getQuery: (props: any) => Promise<any>;
|
|
45
52
|
};
|
|
46
53
|
/**
|
|
47
|
-
* @info
|
|
54
|
+
* @info details at: ../../utils/getDataType
|
|
48
55
|
*
|
|
49
|
-
* 1 = /about, /colophon, /contact
|
|
50
|
-
* 2 = /blog, /events, /podcasts
|
|
51
|
-
* 3 = /blog/2020, /blog/2020/05, /blog/2020/05/09
|
|
52
|
-
* /events/2020, /events/2020/05, /events/2020/05/09,
|
|
53
|
-
* 4 = /blog/2020/05/09/title, /events/2020/05/09/title,
|
|
54
|
-
* /podcasts/knockoffs/i-know-what-you-did-last-summer
|
|
55
|
-
* 5 = /shows/alex-o-jerome, /events/2020/05/09/jerome-and,
|
|
56
|
-
* /podcasts/knockoffs
|
|
57
56
|
*/
|
|
58
57
|
readonly dataTypes: {
|
|
59
|
-
[x: string]: (props: {
|
|
58
|
+
[x: string]: ((props: {
|
|
59
|
+
pathVariables: any;
|
|
60
|
+
routeType: any;
|
|
61
|
+
slug?: any;
|
|
62
|
+
}) => Promise<{
|
|
63
|
+
info?: undefined;
|
|
64
|
+
content?: undefined;
|
|
65
|
+
items?: undefined;
|
|
66
|
+
images?: undefined;
|
|
67
|
+
} | {
|
|
68
|
+
info: any;
|
|
69
|
+
content: any;
|
|
70
|
+
items: Pick<any, string | number | symbol>;
|
|
71
|
+
images: {};
|
|
72
|
+
}>) | ((props: {
|
|
73
|
+
pathVariables: any;
|
|
74
|
+
routeType: any;
|
|
75
|
+
slug: any;
|
|
76
|
+
}) => Promise<{
|
|
77
|
+
info: any;
|
|
78
|
+
content: any;
|
|
79
|
+
items: Pick<Pick<any, string | number | symbol>, string | number | symbol>;
|
|
80
|
+
images: {};
|
|
81
|
+
}>) | ((props: {
|
|
60
82
|
pathVariables: any;
|
|
61
83
|
routeType: any;
|
|
62
84
|
slug: any;
|
|
63
|
-
}) => Promise<{
|
|
85
|
+
}) => Promise<{
|
|
86
|
+
info: {};
|
|
87
|
+
content: {};
|
|
88
|
+
items: {};
|
|
89
|
+
images: {};
|
|
90
|
+
} | {
|
|
91
|
+
info?: undefined;
|
|
92
|
+
content?: undefined;
|
|
93
|
+
items?: undefined;
|
|
94
|
+
images?: undefined;
|
|
95
|
+
} | {
|
|
96
|
+
info: Pick<any, string | number | symbol>;
|
|
97
|
+
content: any[];
|
|
98
|
+
items: {};
|
|
99
|
+
images: {};
|
|
100
|
+
}>);
|
|
64
101
|
};
|
|
65
102
|
}
|
|
66
103
|
|
|
67
|
-
export { Client };
|
|
104
|
+
export { Client, ClientProps, CredentialProps };
|
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var tt=Object.defineProperty,ot=Object.defineProperties;var rt=Object.getOwnPropertyDescriptors;var me=Object.getOwnPropertySymbols;var nt=Object.prototype.hasOwnProperty,it=Object.prototype.propertyIsEnumerable;var he=(e,o,n)=>o in e?tt(e,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[o]=n,b=(e,o)=>{for(var n in o||(o={}))nt.call(o,n)&&he(e,n,o[n]);if(me)for(var n of me(o))it.call(o,n)&&he(e,n,o[n]);return e},k=(e,o)=>ot(e,rt(o));var Se=(e,o,n)=>{if(!o.has(e))throw TypeError("Cannot "+n)};var B=(e,o,n)=>(Se(e,o,"read from private field"),n?n.call(e):o.get(e)),Pe=(e,o,n)=>{if(o.has(e))throw TypeError("Cannot add the same private member more than once");o instanceof WeakSet?o.add(e):o.set(e,n)},fe=(e,o,n,l)=>(Se(e,o,"write to private field"),l?l.call(e,n):o.set(e,n),n);import{Client as Lo}from"@notionhq/client";import L from"lodash/filter.js";import st from"lodash/map.js";var N=({key:e,notion:o,type:n})=>({key:e,notion:o,type:n}),t={addressCity:{init:!0,key:"addressCity",notion:"Address.City",type:"rich_text"},addressLatitude:{init:!0,key:"addressLatitude",notion:"Address.Latitude",type:"number",format:"number"},addressLongitude:{init:!0,key:"addressLongitude",notion:"Address.Longitude",type:"number",format:"number"},addressNeighborhood:{init:!0,key:"addressNeighborhood",notion:"Address.Neighborhood",type:"rich_text"},addressState:{init:!0,key:"addressState",notion:"Address.State",type:"select"},addressStreet:{init:!0,key:"addressStreet",notion:"Address.Street",type:"rich_text"},addressZipCode:{init:!0,key:"addressZipCode",notion:"Address.ZipCode",type:"number",format:"number"},authors:{init:!0,key:"authors",notion:"Authors",type:"people"},categories:{init:!0,key:"categories",notion:"Categories",type:"multi_select"},dateCreated:{init:!1,key:"dateCreated",notion:"Date.Created",type:"created_time"},dateEdited:{init:!1,key:"dateEdited",notion:"Date.Edited",type:"last_edited_time"},dateEvent:{init:!0,key:"dateEvent",notion:"Date.Event",type:"date"},datePublished:{init:!0,key:"datePublished",notion:"Date.Published",type:"date"},dateRecorded:{init:!0,key:"dateRecorded",notion:"Date.Recorded",type:"date"},duration:{init:!0,key:"duration",notion:"Duration",type:"rich_text"},email:{init:!0,key:"email",notion:"Email",type:"rich_text"},episode:{init:!0,key:"episode",notion:"Episode",type:"number",format:"number"},explicit:{init:!0,key:"explicit",notion:"Explicit",type:"checkbox"},festivals:{init:!0,key:"festivals",notion:"Festival",type:"multi_select"},food:{init:!0,key:"food",notion:"Food",type:"rich_text"},isIndexed:{init:!0,key:"isIndexed",notion:"Is.Indexed",type:"checkbox"},isPublished:{init:!0,key:"isPublished",notion:"Is.Published",type:"checkbox"},mp3:{init:!0,key:"mp3",notion:"MP3",type:"files"},name:{init:!0,key:"name",notion:"Name",type:"rich_text"},nameFirst:{init:!0,key:"nameFirst",notion:"Name.First",type:"rich_text"},nameLast:{init:!0,key:"nameLast",notion:"Name.Last",type:"rich_text"},namePreferred:{init:!0,key:"namePreferred",notion:"Name.Preferred",type:"rich_text"},phoneNumber:{init:!0,key:"phoneNumber",notion:"Phone",type:"rich_text"},podcastAuthor:{init:!0,key:"podcastAuthor",notion:"Author",type:"rich_text"},podcastAuthorEmail:{init:!0,key:"podcastAuthorEmail",notion:"Author.Email",type:"rich_text"},relationEpisodes__Podcast:{init:!0,key:"relationEpisodes__Podcast",notion:"Podcasts",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Episodes"}},relationPodcasts__Episodes:{init:!1,key:"relationPodcasts__Episodes",notion:"Episodes",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Podcasts"}},relationEpisodes__People_Guest:{init:!0,key:"relationEpisodes__People_Guest",notion:"Guest",type:"relation",relation:{database_id:"People",synced_property_name:"Episodes.Guest"}},relationPeople__Episodes_Guest:{init:!1,key:"relationPeople__Episodes_Guest",notion:"Episodes.Guest",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Guest"}},relationEpisodes__People_Sound_Engineer:{init:!0,key:"relationEpisodes__People_Sound_Engineer",notion:"Sound.Engineer",type:"relation",relation:{database_id:"People",synced_property_name:"Episodes.Sound.Engineer"}},relationPeople__Episodes_Sound_Engineer:{init:!1,key:"relationPeople__Episodes_Sound_Engineer",notion:"Episodes.Sound.Engineer",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Sound.Engineer"}},relationEpisodes__People_Thanks:{init:!0,key:"relationEpisodes__People_Thanks",notion:"Thanks",type:"relation",relation:{database_id:"People",synced_property_name:"Episodes.Thanks"}},relationPeople__Episodes_Thanks:{init:!1,key:"relationPeople__Episodes_Thanks",notion:"Episodes.Thanks",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Thanks"}},relationEpisodes__Venues:{init:!0,key:"relationEpisodes__Venues",notion:"Venues",type:"relation",relation:{database_id:"Venues",synced_property_name:"Episodes"}},relationVenues__Episodes:{init:!1,key:"relationVenues__Episodes",notion:"Episodes",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Venues"}},relationEvents__Venues:{init:!0,key:"relationEvents__Venues",notion:"Venues",type:"relation",relation:{database_id:"Venues",synced_property_name:"Events"}},relationVenues__Events:{init:!1,key:"relationVenues__Events",notion:"Events",type:"relation",relation:{database_id:"Events",synced_property_name:"Venues"}},relationEvents__Shows:{init:!0,key:"relationEvents__Shows",notion:"Shows",type:"relation",relation:{database_id:"Shows",synced_property_name:"Events"}},relationShows__Events:{init:!1,key:"relationShows__Events",notion:"Events",type:"relation",relation:{database_id:"Events",synced_property_name:"Shows"}},relationEvents__Shows_Lineup:{init:!0,key:"relationEvents__Shows_Lineup",notion:"Shows.Lineup",type:"relation",relation:{database_id:"Shows",synced_property_name:"Events.Lineup"}},relationShows__Events_Lineup:{init:!1,key:"relationShows__Events_Lineup",notion:"Events.Lineup",type:"relation",relation:{database_id:"Events",synced_property_name:"Shows.Lineup"}},relationShows__People_Cast:{init:!0,key:"relationShows__People_Cast",notion:"Cast",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Cast"}},relationPeople__Shows_Cast:{init:!1,key:"relationPeople__Shows_Cast",notion:"Shows.Cast",type:"relation",relation:{database_id:"Shows",synced_property_name:"Cast"}},relationShows__People_Cast_Past:{init:!0,key:"relationShows__People_Cast_Past",notion:"Cast.Past",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Cast.Past"}},relationPeople__Shows_Cast_Past:{init:!1,key:"relationPeople__Shows_Cast_Past",notion:"Shows.Cast.Past",type:"relation",relation:{database_id:"Shows",synced_property_name:"Cast.Past"}},relationShows_People_Crew:{init:!0,key:"relationShows_People_Crew",notion:"Crew",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Crew"}},relationPeople__Shows_Crew:{init:!0,key:"relationPeople__Shows_Crew",notion:"Shows.Crew",type:"relation",relation:{database_id:"Shows",synced_property_name:"Crew"}},relationShows__People_Director:{init:!0,key:"relationShows__People_Director",notion:"Director",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Director"}},relationPeople__Shows_Director:{init:!1,key:"relationPeople__Shows_Director",notion:"Shows.Director",type:"relation",relation:{database_id:"Shows",synced_property_name:"Director"}},relationShows__People_Director_Musical:{init:!0,key:"relationShows__People_Director_Musical",notion:"Director.Musical",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Director.Musical"}},relationPeople__Shows_Director_Musical:{init:!1,key:"relationPeople__Shows_Director_Musical",notion:"Shows.Director.Musical",type:"relation",relation:{database_id:"Shows",synced_property_name:"Director.Musical"}},relationShows__People_Director_Technical:{init:!0,key:"relationShows__People_Director_Technical",notion:"Director.Technical",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Director.Technical"}},relationPeople__Shows_Director_Technical:{init:!1,key:"relationPeople__Shows_Director_Technical",notion:"Shows.Director.Technical",type:"relation",relation:{database_id:"Shows",synced_property_name:"Director.Technical"}},relationEvents__People_Guest:{init:!0,key:"relationEvents__People_Guest",notion:"Guest",type:"relation",relation:{database_id:"People",synced_property_name:"Events.Guest"}},relationPeople__Events_Guest:{init:!1,key:"relationEvents__People_Guest",notion:"Events.Guest",type:"relation",relation:{database_id:"Events",synced_property_name:"Guest"}},relationPodcasts__People_Host:{init:!0,key:"relationPodcasts__People_Host",notion:"Host",type:"relation",relation:{database_id:"People",synced_property_name:"Podcasts.Host"}},relationPeople__Podcasts_Host:{init:!1,key:"relationPeople__Podcasts_Host",notion:"Podcasts.Host",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Host"}},relationEvents__People_Host:{init:!0,key:"relationEvents__People_Host",notion:"Host",type:"relation",relation:{database_id:"People",synced_property_name:"Events.Host"}},relationPeople__Events_Host:{init:!1,key:"relationPeople__Events_Host",notion:"Events.Host",type:"relation",relation:{database_id:"Events",synced_property_name:"Host"}},relationShows__People_Producer:{init:!0,key:"relationShows__People_Producer",notion:"Producer",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Producer"}},relationPeople__Shows_Producer:{init:!1,key:"relationPeople__Shows_Producer",notion:"Shows.Producer",type:"relation",relation:{database_id:"Shows",synced_property_name:"Producer"}},relationEvents__People_Guest_Music:{init:!0,key:"relationEvents__People_Guest_Music",notion:"Guest.Music",type:"relation",relation:{database_id:"People",synced_property_name:"Events.Guest.Music"}},relationPeople__Events_Guest_Music:{init:!1,key:"relationPeople__Events_Guest_Music",notion:"Events.Guest.Music",type:"relation",relation:{database_id:"Events",synced_property_name:"Guest.Music"}},relationPodcasts__People_Sound_Engineer:{init:!0,key:"relationPodcasts__People_Sound_Engineer",notion:"Sound.Engineer",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Podcasts.Sound.Engineer"}},relationPeople__Podcasts_Sound_Engineer:{init:!1,key:"relationPeople__Podcasts_Sound_Engineer",notion:"Podcasts.Sound.Engineer",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Sound.Engineer"}},relationShows__People_Thanks:{init:!0,key:"relationShows__People_Thanks",notion:"Thanks",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Thanks"}},relationPeople__Shows_Thanks:{init:!1,key:"relationPeople__Shows_Thanks",notion:"Shows.Thanks",type:"relation",relation:{database_id:"Shows",synced_property_name:"Thanks"}},relationShows__People_Writer:{init:!0,key:"relationShows__People_Writer",notion:"Writer",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Writer"}},relationPeople__Shows_Writer:{init:!1,key:"relationPeople__Shows_Writer",notion:"Shows.Writer",type:"relation",relation:{database_id:"Shows",synced_property_name:"Writer"}},relationShows__Tags:{init:!0,key:"relationShows__Tags",notion:"Tags",type:"relation",relation:{database_id:"Tags",synced_property_name:"Shows"}},relationTags__Shows:{init:!1,key:"relationTags__Shows",notion:"Shows",type:"relation",relation:{database_id:"Shows",synced_property_name:"Tags"}},rollupShows__Tags:{init:!1,key:"rollupShows__Tags",notion:"Tags.Rollup",type:"rollup",rollup:{relation_property_name:"Tags",rollup_property_id:"Title",function:"show_original"}},rollupShows__People_Cast:{init:!1,key:"rollupShows__People_Cast",notion:"Cast.Rollup",type:"rollup",rollup:{relation_property_name:"Cast",rollup_property_id:"Title",function:"show_original"}},rollupShows__People_Cast_Slug:{init:!1,key:"rollupShows__People_Cast_Slug",notion:"Cast.Rollup.Slug",type:"rollup",rollup:{relation_property_name:"Cast",rollup_property_name:"Slug",function:"show_original"}},rollupShows__People_Cast_Past:{init:!1,key:"rollupShows__People_Cast_Past",notion:"Cast.Past.Rollup",type:"rollup",rollup:{relation_property_name:"Cast.Past",rollup_property_id:"Title",function:"show_original"}},rollupShows__People_Crew:{init:!1,key:"rollupShows__People_Crew",notion:"Crew.Rollup",type:"rollup",rollup:{relation_property_name:"Crew",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Director:{init:!1,key:"rollupShows__People_Director",notion:"Director.Rollup",type:"rollup",rollup:{relation_property_name:"Director",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Director_Musical:{init:!1,key:"rollupShows__People_Director_Musical",notion:"Director.Musical.Rollup",type:"rollup",rollup:{relation_property_name:"Director.Musical",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Director_Technical:{init:!1,key:"rollupShows__People_Director_Technical",notion:"Director.Technical.Rollup",type:"rollup",rollup:{relation_property_name:"Director.Technical",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Music:{init:!1,key:"rollupShows__People_Music",notion:"Music.Rollup",type:"rollup",rollup:{relation_property_name:"Music",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Producer:{init:!1,key:"rollupShows__People_Producer",notion:"Producer.Rollup",type:"rollup",rollup:{relation_property_name:"Producer",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Thanks:{init:!1,key:"rollupShows__People_Thanks",notion:"Thanks.Rollup",type:"rollup",rollup:{relation_property_name:"Thanks",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Writer:{init:!1,key:"rollupShows__People_Writer",notion:"Writer.Rollup",type:"rollup",rollup:{relation_property_name:"Writer",rollup_property_name:"Title",function:"show_original"}},rollupEvents__People_Cast:{init:!1,key:"rollupEvents__People_Cast",notion:"Cast.Rollup",type:"rollup",rollup:{relation_property_name:"Shows",rollup_property_id:"Cast",function:"show_original"}},rollupEvents__People_Guest:{init:!1,key:"rollupEvents__People_Guest",notion:"Guest.Rollup",type:"rollup",rollup:{relation_property_name:"Guest",rollup_property_id:"Title",function:"show_original"}},rollupEvents__People_Guest_Music:{init:!1,key:"rollupEvents__People_Guest_Music",notion:"Guest.Music.Rollup",type:"rollup",rollup:{relation_property_name:"Guest.Music",rollup_property_id:"Title",function:"show_original"}},rollupEvents__People_Host:{init:!1,key:"rollupEvents__People_Host",notion:"Host.Rollup",type:"rollup",rollup:{relation_property_name:"Host",rollup_property_id:"Title",function:"show_original"}},rollupEvents__Shows:{init:!1,key:"rollupEvents__Shows",notion:"Shows.Rollup",type:"rollup",rollup:{relation_property_name:"Shows",rollup_property_id:"Title",function:"show_original"}},rollupEvents__Shows_Lineup:{init:!1,key:"rollupEvents__Shows_Lineup",notion:"Shows.Lineup.Rollup",type:"rollup",rollup:{relation_property_name:"Shows.Lineup",rollup_property_id:"Title",function:"show_original"}},rollupEvents__Venues:{init:!1,key:"rollupEvents__Venues",notion:"Venues.Rollup",type:"rollup",rollup:{relation_property_name:"Venues",rollup_property_id:"Title",function:"show_original"}},season:{init:!0,key:"season",notion:"Season",type:"number",format:"number"},seoDescription:{init:!0,key:"seoDescription",notion:"SEO.Description",type:"rich_text"},seoImage:{init:!0,key:"seoImage",notion:"SEO.Image",type:"files"},seoImageDescription:{init:!0,key:"seoImageDescription",notion:"SEO.Image.Description",type:"rich_text"},slug:{init:!0,key:"slug",notion:"Slug",type:"rich_text"},socialFacebook:{init:!0,key:"socialFacebook",notion:"Social.Facebook",type:"url"},socialInstagram:{init:!0,key:"socialInstagram",notion:"Social.Instagram",type:"url"},socialTwitter:{init:!0,key:"socialTwitter",notion:"Social.Twitter",type:"url"},socialWebsite:{init:!0,key:"socialWebsite",notion:"Social.Website",type:"url"},socialSpotify:{init:!0,key:"socialSpotify",notion:"Social.Spotify",type:"url"},socialApple:{init:!0,key:"socialApple",notion:"Social.Apple",type:"url"},subtitle:{init:!0,key:"subtitle",notion:"Subitle",type:"rich_text"},ticketUrl:{init:!0,key:"ticketUrl",notion:"TicketUrl",type:"url"},title:{init:!0,key:"title",notion:"Title",type:"title"},type:{init:!0,key:"type",notion:"Type",type:"select"}},G=[t.authors,t.datePublished,t.isIndexed,t.isPublished,t.slug,t.seoDescription,t.seoImage,t.seoImageDescription,t.title],Ee=[...G],ge=[...G,t.dateRecorded,t.duration,t.episode,t.mp3,t.season,t.relationEpisodes__People_Guest,t.relationEpisodes__People_Sound_Engineer,t.relationEpisodes__People_Thanks,t.relationEpisodes__Podcast,t.relationEpisodes__Venues,t.socialApple,t.socialSpotify,t.type],we=[...G,t.dateEvent,t.relationEvents__People_Guest_Music,t.relationEvents__People_Guest,t.relationEvents__People_Host,t.relationEvents__Shows_Lineup,t.relationEvents__Shows,t.relationEvents__Venues,t.socialFacebook,t.socialWebsite,t.ticketUrl,t.rollupEvents__People_Cast,t.rollupEvents__People_Guest_Music,t.rollupEvents__People_Guest,t.rollupEvents__People_Host,t.rollupEvents__Shows_Lineup,t.rollupEvents__Shows,t.rollupEvents__Venues],be=[...G],Te=[...G,t.email,t.nameFirst,t.nameLast,t.namePreferred,t.relationPeople__Episodes_Guest,t.relationPeople__Episodes_Sound_Engineer,t.relationPeople__Episodes_Thanks,t.relationPeople__Events_Guest,t.relationPeople__Events_Guest_Music,t.relationPeople__Events_Host,t.relationPeople__Podcasts_Host,t.relationPeople__Podcasts_Sound_Engineer,t.relationPeople__Shows_Cast,t.relationPeople__Shows_Cast_Past,t.relationPeople__Shows_Director,t.relationPeople__Shows_Director_Musical,t.relationPeople__Shows_Director_Technical,t.relationPeople__Shows_Producer,t.relationPeople__Shows_Thanks,t.relationPeople__Shows_Writer],ke=[...G,t.categories,t.explicit,t.podcastAuthor,t.podcastAuthorEmail,t.relationPodcasts__People_Host,t.relationPodcasts__People_Sound_Engineer,t.socialApple,t.socialSpotify,t.type,t.relationPodcasts__Episodes],Ie=[...G],De=[...G,t.relationShows__People_Cast,t.relationShows__People_Cast_Past,t.relationShows__People_Director,t.relationShows__People_Director_Musical,t.relationShows__People_Director_Technical,t.relationShows__People_Producer,t.relationShows__People_Thanks,t.relationShows__People_Writer,t.relationShows__Tags,t.socialFacebook,t.socialInstagram,t.socialTwitter,t.socialWebsite,t.relationShows__Events,t.relationShows__Events_Lineup,t.rollupShows__People_Cast,t.rollupShows__People_Cast_Slug,t.rollupShows__People_Cast_Past,t.rollupShows__People_Crew,t.rollupShows__People_Director,t.rollupShows__People_Director_Musical,t.rollupShows__People_Director_Technical,t.rollupShows__People_Music,t.rollupShows__People_Producer,t.rollupShows__People_Thanks,t.rollupShows__People_Writer,t.rollupShows__Tags],Ce=[...G,t.addressCity,t.addressLatitude,t.addressLongitude,t.addressNeighborhood,t.addressState,t.addressStreet,t.addressZipCode,t.phoneNumber,t.socialFacebook,t.socialInstagram,t.socialTwitter,t.socialWebsite,t.relationVenues__Episodes,t.relationVenues__Events],Vo={BLOG:L(Ee,{init:!0}),EPISODES:L(ge,{init:!0}),EVENTS:L(we,{init:!0}),PAGES:L(be,{init:!0}),PEOPLE:L(Te,{init:!0}),PODCASTS:L(ke,{init:!0}),SEO:L(Ie,{init:!0}),SHOWS:L(De,{init:!0}),VENUES:L(Ce,{init:!0})},ve={BLOG:Ee.map(e=>N(e)),EPISODES:ge.map(e=>N(e)),EVENTS:we.map(e=>N(e)),PAGES:be.map(e=>N(e)),PEOPLE:Te.map(e=>N(e)),PODCASTS:ke.map(e=>N(e)),SEO:Ie.map(e=>N(e)),SHOWS:De.map(e=>N(e)),VENUES:Ce.map(e=>N(e))},xe=st(t,e=>N(e)),Oe=new Date().toISOString(),U={dateBefore:{property:t.datePublished.notion,date:{before:Oe}},dateOnOrAfter:{property:t.datePublished.notion,date:{on_or_after:Oe}},published:{property:t.isPublished.notion,checkbox:{equals:!1}},slug:{property:t.slug.notion,text:{equals:""}}},at="LISTING",lt="LISTING_BY_DATE",pt="SLUG",_t="SLUG_BY_ROUTE",ut=[at,lt,pt,_t],v=Object.assign({},...ut.map(e=>({[e]:e})).flat(1));import Ne from"date-fns/addDays/index.js";import dt from"date-fns/addMonths/index.js";import ct from"date-fns/addYears/index.js";var yt=(e,o)=>{switch(o){case"year":return ct(e,1).toISOString();case"month":return dt(e,1).toISOString();case"day":return Ne(e,2).toISOString()}return Ne(e,-1).toISOString()},C=yt;var mt=250;async function ht(){await St()}function St(e=mt){return new Promise(o=>setTimeout(o,e))}var V=ht;import Pt from"lodash/map.js";var ft=({config:e,data:o,pathVariables:n,pageId:l})=>{var m,c;let{NOTION:r}=e,i={};if(!(o==null?void 0:o.properties))return i;let{properties:a}=o,s;if(n){let{meta:h,routeType:f}=n;s=f===((m=r==null?void 0:r.PODCASTS)==null?void 0:m.routeType)&&h.length>1?(c=r==null?void 0:r.EPISODES)==null?void 0:c.routeType:f}let y=s?ve[s.toUpperCase()]:xe;return Pt(y,h=>{let f,_=a[h.notion];i[h.key]=null,_&&(f=M[h.type](_,l),i[h.key]=f||null)}),i},I=ft;import Et from"lodash/map.js";import gt from"lodash/omit.js";var wt=({config:e,results:o,routeType:n})=>{let l=[];return Et(o,r=>{let i=gt(r,"properties");i.properties=D(I({config:e,data:r,pathVariables:n,pageId:r==null?void 0:r.id})),l.push(i)}),l},Le=wt;import bt from"lodash/fromPairs.js";import Tt from"lodash/sortBy.js";import kt from"lodash/toPairs.js";var It=e=>bt(Tt(kt(e))),D=It;import Dt from"lodash/filter.js";import J from"lodash/map.js";var Ct=(e,o)=>{switch(o){case"info":let n=[];return J(e.seoImage,r=>!!(r==null?void 0:r.url)&&(r==null?void 0:r.type)==="external"&&n.push(r==null?void 0:r.url)),n;case"content":return!!e&&Dt(e,{object:"block",type:"image"});case"items":let l=[];return J(e,r=>{var i;J((i=r==null?void 0:r.properties)==null?void 0:i.seoImage,a=>!!(a==null?void 0:a.url)&&(a==null?void 0:a.type)==="external"&&l.push(a==null?void 0:a.url))}),l;default:return[]}},W=Ct;import vt from"github-slugger";import X from"lodash/map.js";import{getPlaiceholder as ee}from"plaiceholder";var xt=async({data:e,pathVariables:o})=>{var c,h,f,_,T,E,g;let n=new vt,l={},r=((c=e.info)==null?void 0:c.object)==="page"?W((h=e.info)==null?void 0:h.properties,"info"):!!((f=e.info)==null?void 0:f.results)&&W((T=(_=e.info)==null?void 0:_.results[0])==null?void 0:T.properties,"info"),i=!!r&&r.map(async p=>{if(!p)return null;let w=!!p&&!!(p==null?void 0:p.url)?p==null?void 0:p.url:p;if(!w)return null;let{base64:S,img:P}=await ee(w),O=n.slug(w);return{base64:S,id:O,img:P,url:w}}),a=i?await Promise.all(i):[],s=!o.isIndex&&W(e==null?void 0:e.content,"content"),y=!!s&&s.map(async p=>{var A,H;if(!p)return null;let{type:w}=p,S=p[w],P=!!p&&!!((A=S==null?void 0:S.external)==null?void 0:A.url)?(H=S==null?void 0:S.external)==null?void 0:H.url:null;if(!P)return null;let{base64:O,img:F}=await ee(P),R=n.slug(P);return{base64:O,id:R,img:F,url:P}}),m=y?await Promise.all(y):[];if(e.items){let p=e.items.object==="page"?W((E=e.items)==null?void 0:E.data,"items"):W((g=e.items)==null?void 0:g.results,"items"),w=!!p&&p.map(async P=>{if(!P)return null;let O=!!P&&!!(P==null?void 0:P.url)?P==null?void 0:P.url:P;if(!O)return null;let{base64:F,img:R}=await ee(O),A=n.slug(O);return{base64:F,id:A,img:R,url:O}}),S=await Promise.all(w);!!S&&S[0]&&X(S,P=>l[P.id]=P)}return!!a&&a[0]&&X(a,p=>l[p.id]=p),!!m&&m[0]&&X(m,p=>l[p.id]=p),l},z=xt;var Ot=e=>(console.dir("@notion(_unsupported)"),console.dir(e),e),j=Ot;var Nt=e=>e.checkbox||!1,Ge=Nt;var Lt=e=>{let{type:o}=e;return e[o]},Y=Lt;var Gt=e=>e.email||null,Be=Gt;import At from"github-slugger";import Ut from"lodash/size.js";var Bt=e=>e.length!==32?e:e.substr(0,8)+"-"+e.substr(8,4)+"-"+e.substr(12,4)+"-"+e.substr(16,4)+"-"+e.substr(20),Ae=Bt;var Vt="https://www.notion.so/image/{{FILENAME}}?table=block&id={{PAGE_ID}}&cache=v2&w1dth=600",Mt=(e,o)=>Vt.replace("{{FILENAME}}",encodeURIComponent(e)).replace("{{PAGE_ID}}",Ae(o)),Rt=(e,o)=>{let n=new At,l={};return Ut(e.files)<=0||e.files.map(r=>{var i,a;if((r==null?void 0:r.type)==="file"){let s=(i=r==null?void 0:r.file)==null?void 0:i.url.split("?")[0],y=n.slug(s);l[y]={type:r==null?void 0:r.type,url:Mt(s,o)}}if((r==null?void 0:r.type)==="external"){let s=(a=r==null?void 0:r.external)==null?void 0:a.url.split("?")[0],y=n.slug(s);l[y]={type:r==null?void 0:r.type,url:s}}}),l},te=Rt;import Ht from"github-slugger";import Wt from"lodash/map.js";var Ft=e=>{let o=new Ht,n={};return Wt(e.multi_select,l=>{let r=l;r.slug=o.slug(r.name),n[r.id]=r}),n},Ue=Ft;var Qt=e=>(e==null?void 0:e.number)||null,Ve=Qt;import zt from"github-slugger";var $t=e=>{let o=new zt;return e.people.map(n=>{let{avatar_url:l,id:r,name:i,person:a}=n,{email:s}=a;return{[o.slug(i)]:{avatar_url:l,email:s,id:r,name:i}}})[0]},Me=$t;var jt=e=>(e==null?void 0:e.phone_number)||null,Re=jt;import He from"lodash/map.js";var Yt=e=>e.type==="rollup"?e.rollup.type==="array"&&He(e.rollup.array,o=>M[o.type](o))[0]:He(e.relation,o=>o.id),We=Yt;var qt=e=>{var o;return(e==null?void 0:e.rich_text)?(o=e==null?void 0:e.rich_text[0])==null?void 0:o.plain_text:null},Fe=qt;import Zt from"lodash/map.js";import Kt from"lodash/sortBy.js";var Jt=e=>{var o;return Kt(Zt((o=e==null?void 0:e.rollup)==null?void 0:o.array,n=>M[n.type](n)))},Qe=Jt;import Xt from"github-slugger";var eo=e=>{let o=new Xt,n=e.select;return n?(n.slug=o.slug(e.select.name),{[n.id]:n}):null},ze=eo;var to=e=>{var o;return(e==null?void 0:e.title)?(o=e==null?void 0:e.title[0])==null?void 0:o.plain_text:null},$e=to;var oo=e=>e.url||null,je=oo;var ro={checkbox:Ge,created_by:j,created_time:Y,date:Y,email:Be,files:te,formula:j,image:te,last_edited_by:j,last_edited_time:Y,multi_select:Ue,number:Ve,people:Me,phone_number:Re,relation:We,rich_text:Fe,rollup:Qe,select:ze,title:$e,url:je},M=ro;var no=e=>Object.entries(e).length===0&&e.constructor===Object,oe=no;var io=e=>e===void 0&&typeof e=="undefined",$=io;var so=async(e,{block_id:o})=>$(o)?[]:(await V(),await e({block_id:o})),re=so;var Ye={sorts:[{property:t.slug.notion,direction:"ascending"}]},ao=async(e,{database_id:o,sorts:n=Ye.sorts,filter:l=Ye.filter})=>o?await e({database_id:o,sorts:n,filter:l}):[],ne=ao;var qe=async(e,{blocks:o})=>{if(o==null)return o;let n=o.filter(r=>r.has_children).map(r=>({promise:e({block_id:r.id,page_size:100}),parent_block:r})),l=await Promise.all(n.map(r=>r.promise));for(let r=0;r<l.length;r++){let i=l[r].results;if(await qe(e,{blocks:i}),n[r]){let a=n[r].parent_block;a[a.type].children=i}}return o},ie=qe;var lo=({config:e,item:o,routeType:n,meta:l})=>{var m,c,h,f,_;let{NOTION:r}=e,i="",a=(m=o.properties)==null?void 0:m.slug,s="",y="/[...catchAll]";switch(n){case r.BLOG.routeType:i=(h=(c=o.properties)==null?void 0:c.datePublished)==null?void 0:h.start.slice(0,10);let[T,E,g]=i==null?void 0:i.split("-");s=`/${n}/${T}/${E}/${g}/${a}`;break;case r.EVENTS.routeType:i=(_=(f=o.properties)==null?void 0:f.dateEvent)==null?void 0:_.start.slice(0,10);let[p,w,S]=i==null?void 0:i.split("-");s=`/${n}/${p}/${w}/${S}/${a}`;break;case r.PODCASTS.routeType:case r.EPISODES.routeType:s=`/${l==null?void 0:l.join("/")}/${a}`;break;case r.PEOPLE.routeType:case r.SHOWS.routeType:case r.VENUES.routeType:default:s=`/${n}/${a}`;break}return s=s.replace("//","/"),{as:s,date:i,href:y,slug:a}},se=lo;import po from"lodash/map.js";import ae from"lodash/omit.js";var _o=async({config:e,getBlocksByIdChildren:o,getDatabasesByIdQuery:n,getPagesById:l,pathVariables:r,routeType:i})=>{let{NOTION:a}=e,s={},y={},m={},c=new Date().toISOString(),h=new Date("2020-01-01").toISOString(),f=a[i.toUpperCase()].page_id__seo,_=await l({page_id:f});if(!_)return{};(_==null?void 0:_.object)==="page"&&(y=ae(_,"properties"),y.properties=D(I({config:e,data:_,pathVariables:r,pageId:y.id}))),s=await o({block_id:y.id});let T=await n({database_id:a[i.toUpperCase()].database_id,filter:{and:[{property:i===a.EVENTS.routeType?t.dateEvent.notion:t.datePublished.notion,date:{on_or_after:i===a.EVENTS.routeType?c:h}}]}}),E=[];po(T.results,S=>{let P=S;P=ae(P,"properties"),P.properties=D(I({config:e,data:S,pathVariables:r,pageId:S.id})),E.push(P)});let g=ae(T,"results");g.results=E,m=g;let p={info:y,content:s,items:m,images:{}},w=p?await z({data:p,pathVariables:r}):{};return p=k(b({},p),{images:w}),p},le=_o;import uo from"lodash/map.js";import q from"lodash/omit.js";import co from"lodash/size.js";var yo=async({config:e,getBlocksByIdChildren:o,getDatabasesByIdQuery:n,getPagesById:l,pathVariables:r,routeType:i,slug:a})=>{let{NOTION:s}=e,{meta:y}=r,m={},c={},h={},f=new Date().toISOString(),_=s[i.toUpperCase()].page_id__seo,T=await l({page_id:_});T.object==="page"&&(c=q(T,"properties"),c.properties=D(I({config:e,data:T,pathVariables:r,pageId:c.id}))),m=await o({block_id:c.id});let E=co(y),[g,p,w]=y,S=new Date(`${g||f.slice(0,4)}-${p||"01"}-${w||"01"}`),P,O=[{property:t.datePublished.notion,direction:"descending"}];switch(E){case 1:P={and:[{property:i===s.EVENTS.routeType?t.dateEvent.notion:t.datePublished.notion,date:{on_or_after:C(S,"")}},{property:i===s.EVENTS.routeType?t.dateEvent.notion:t.datePublished.notion,date:{before:C(S,"year")}}]};break;case 2:P={and:[{property:i===s.EVENTS.routeType?t.dateEvent.notion:t.datePublished.notion,date:{on_or_after:C(S,"")}},{property:i===s.EVENTS.routeType?t.dateEvent.notion:t.datePublished.notion,date:{before:C(S,"month")}}]};break;case 3:P={and:[{property:i===s.EVENTS.routeType?t.dateEvent.notion:t.datePublished.notion,date:{on_or_after:C(S,"")}},{property:i===s.EVENTS.routeType?t.dateEvent.notion:t.datePublished.notion,date:{before:C(S,"day")}}]};break;default:P={and:[{property:i===s.EVENTS.routeType?t.dateEvent.notion:t.datePublished.notion,date:{on_or_after:C(S,"")}},{property:i===s.EVENTS.routeType?t.dateEvent.notion:t.datePublished.notion,date:{before:C(S,"day")}},k(b({},U.slug),{text:{equals:a}})]};break}let F=s[i.toUpperCase()].database_id,R=await n({database_id:F,filter:P,sorts:O}),A=[];uo(R.results,K=>{let Q=K;Q=q(Q,"properties"),Q.properties=D(I({config:e,data:K,pathVariables:r,pageId:K.id})),!!Q&&A.push(Q)});let H=q(R,"results");H.results=A,h=H,h=q(H,"data");let Z={info:c,content:m,items:h,images:{}},et={};return Z=k(b({},Z),{images:et}),Z},pe=yo;import mo from"lodash/filter.js";import ho from"lodash/omit.js";var So=async({config:e,getBlocksByIdChildren:o,getDatabasesByIdQuery:n,getDeepFetchAllChildren:l,pathVariables:r,routeType:i,slug:a})=>{let{NOTION:s}=e,y={},m={},c={},h=i==null?void 0:i.toUpperCase();if(!Object.keys(s).includes(h))return{info:m,content:y,items:c,images:{}};let _=await n({database_id:s[h].database_id,filter:{and:[k(b({},U.slug),{text:{equals:a}})]}}),T=(_==null?void 0:_.object)==="list"&&_.results[0];if(!T)return{};m=ho(T,"properties"),m.properties=D(I({config:e,data:T,pathVariables:r,pageId:m.id})),y=await o({block_id:m.id}),y=[...await l({blocks:y.results})],c&&(c.results=mo(c.results,{properties:{isPublished:!0}}));let g={info:m,content:y,items:c,images:{}},p=g?await z({data:g,pathVariables:r}):{};return g=k(b({},g),{images:p}),g},_e=So;import Ze from"lodash/omit.js";import Po from"lodash/size.js";var fo=async({config:e,getBlocksByIdChildren:o,getDatabasesByIdQuery:n,getQuery:l,pathVariables:r,routeType:i,slug:a})=>{let{NOTION:s}=e,{meta:y}=r,m={},c={},h={},f=new Date().toISOString();if(i===s.PODCASTS.routeType){let[E,g]=y,p=Po(y)===2,w=await n({database_id:s[p?s.EPISODES.routeType.toUpperCase():i.toUpperCase()].database_id,filter:{and:[k(b({},U.slug),{text:{equals:p?g:E}})]}}),S=(w==null?void 0:w.object)==="list"&&w.results[0];if(!S)return{};c=Ze(S,"properties"),c.properties=D(I({config:e,data:S,pathVariables:r,pageId:c.id})),m=await o({block_id:c.id}),p||i===s.PODCASTS.routeType&&(h=await l({config:e,reqQuery:{podcasts:c.id,databaseType:s.EPISODES.routeType.toUpperCase()}}))}if([s.BLOG.routeType,s.EVENTS.routeType].includes(i)){let[E,g,p]=y,w=new Date(`${E||f.slice(0,4)}-${g||"01"}-${p||"01"}`),S=await n({database_id:s[i.toUpperCase()].database_id,filter:{and:[{property:i===s.EVENTS.routeType?t.dateEvent.notion:t.datePublished.notion,date:{on_or_after:C(w,"")}},{property:i===s.EVENTS.routeType?t.dateEvent.notion:t.datePublished.notion,date:{before:C(w,"day")}},k(b({},U.slug),{text:{equals:a}})]}}),P=(S==null?void 0:S.object)==="list"&&S.results[0];P&&(c=Ze(P,"properties"),c.properties=D(I({config:e,data:P,pathVariables:r,pageId:c.id})),m=await o({block_id:c.id}))}let _={info:c,content:m,items:h,images:{}},T={};return _=k(b({},_),{images:T}),_},ue=fo;var Eo=async(e,{page_id:o})=>$(o)?[]:(await V(),await e({page_id:o})),de=Eo;import Ke from"lodash/drop.js";import go from"lodash/dropRight.js";import wo from"lodash/first.js";import Je from"lodash/includes.js";import bo from"lodash/isInteger.js";import To from"lodash/join.js";import ko from"lodash/last.js";import Xe from"lodash/size.js";var Io=({config:e,catchAll:o})=>{let{NOTION:n,PAGES__HOMEPAGE:l,ROUTE_TYPES:r}=e,i=Xe(o),a=wo(o),s=ko(o),y=i>1&&Je([n.BLOG.routeType,n.EVENTS.routeType,n.PODCASTS.routeType],a)?Ke(o):Ke(go(o)),m=a===s&&!Je(r,a)?"pages":a,c=a!==s&&!bo(parseInt(s))?s:a,h=m==="pages",f=c===a,_=!!y&&Xe(y)!==0,T=h&&a===l?"":To(o,"/"),E=v.SLUG;return h?E=v.SLUG:f&&!_?E=v.LISTING:f&&_?E=v.LISTING_BY_DATE:_?E=v.SLUG_BY_ROUTE:E=v.SLUG,{dataType:E,hasMeta:_,isPage:h,isIndex:f,meta:y,routeType:m,slug:c,url:T}},ce=Io;import Do from"lodash/map.js";import Co from"lodash/omit.js";import vo from"lodash/size.js";var xo={ASCENDING:"ascending",DESCENDING:"descending"},Oo=[{property:t.slug.notion,direction:xo.ASCENDING}],No=async({config:e,reqQuery:o,notionDatabasesQuery:n})=>{let{NOTION:l}=e,{databaseType:r}=o,i=r,a=!1,s=r.toUpperCase(),y=l[s].database_id;if(!y)return[];let m={},c={},h,f;if(r==="EPISODES"){f=Oo;let{podcasts:_}=o,T=[],E=[];!!_&&E.push(..._==null?void 0:_.split(",")),vo(E)>0&&Do(E,g=>T.push({property:t.relationEpisodes__Podcast.notion,relation:{contains:g}})),h={or:[...T]}}else a=!0;if(!a&&(!m||oe(m))){await V();let _;h?((h==null?void 0:h.or.length)===0&&(h={and:[{property:t.slug.notion,rich_text:{equals:"@hack(notion)-do-not-return"}}]}),_=await n({database_id:y,filter:h,sorts:f}),m=_,c=Le({config:e,results:_.results,routeType:i}),m=Co(m,"results"),m.results=c):a=!0}return m},ye=No;var x,Go=class extends Lo{constructor(o){super(o);Pe(this,x,void 0);this.custom={getBlocksByIdChildren:async o=>await re(this.blocks.children.list,b({},o)),getDatabasesByIdQuery:async o=>await ne(this.databases.query,o),getDeepFetchAllChildren:async o=>await ie(this.blocks.children.list,b({},o)),getInfoType:o=>se(k(b({},o),{config:B(this,x)})),getPagesById:async o=>await de(this.pages.retrieve,b({},o)),getPathVariables:o=>ce(k(b({},o),{config:B(this,x)})),getQuery:async o=>await ye(k(b({},o),{config:B(this,x),notionDatabasesQuery:this.databases.query}))};this.dataTypes={[v.LISTING]:async o=>await le(k(b({},o),{config:B(this,x),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getPagesById:this.custom.getPagesById})),[v.LISTING_BY_DATE]:async o=>await pe(k(b({},o),{config:B(this,x),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getPagesById:this.custom.getPagesById})),[v.SLUG]:async o=>await _e(k(b({},o),{config:B(this,x),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getDeepFetchAllChildren:this.custom.getDeepFetchAllChildren})),[v.SLUG_BY_ROUTE]:async o=>await ue(k(b({},o),{config:B(this,x),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getQuery:this.custom.getQuery}))};fe(this,x,o==null?void 0:o.config)}};x=new WeakMap;export{Go as Client};
|
|
1
|
+
var Re=Object.defineProperty,Ge=Object.defineProperties;var Ae=Object.getOwnPropertyDescriptors;var J=Object.getOwnPropertySymbols;var Ue=Object.prototype.hasOwnProperty,Me=Object.prototype.propertyIsEnumerable;var X=(e,o,n)=>o in e?Re(e,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[o]=n,g=(e,o)=>{for(var n in o||(o={}))Ue.call(o,n)&&X(e,n,o[n]);if(J)for(var n of J(o))Me.call(o,n)&&X(e,n,o[n]);return e},f=(e,o)=>Ge(e,Ae(o));import{Client as po}from"@notionhq/client";import O from"lodash/filter.js";import Ve from"lodash/map.js";var C=({key:e,notion:o,type:n})=>({key:e,notion:o,type:n}),t={addressCity:{init:!0,key:"addressCity",notion:"Address.City",type:"rich_text"},addressLatitude:{init:!0,key:"addressLatitude",notion:"Address.Latitude",type:"number",format:"number"},addressLongitude:{init:!0,key:"addressLongitude",notion:"Address.Longitude",type:"number",format:"number"},addressNeighborhood:{init:!0,key:"addressNeighborhood",notion:"Address.Neighborhood",type:"rich_text"},addressState:{init:!0,key:"addressState",notion:"Address.State",type:"select"},addressStreet:{init:!0,key:"addressStreet",notion:"Address.Street",type:"rich_text"},addressZipCode:{init:!0,key:"addressZipCode",notion:"Address.ZipCode",type:"number",format:"number"},authors:{init:!0,key:"authors",notion:"Authors",type:"people"},categories:{init:!0,key:"categories",notion:"Categories",type:"multi_select"},dateCreated:{init:!1,key:"dateCreated",notion:"Date.Created",type:"created_time"},dateEdited:{init:!1,key:"dateEdited",notion:"Date.Edited",type:"last_edited_time"},dateEvent:{init:!0,key:"dateEvent",notion:"Date.Event",type:"date"},datePublished:{init:!0,key:"datePublished",notion:"Date.Published",type:"date"},dateRecorded:{init:!0,key:"dateRecorded",notion:"Date.Recorded",type:"date"},duration:{init:!0,key:"duration",notion:"Duration",type:"rich_text"},email:{init:!0,key:"email",notion:"Email",type:"rich_text"},episode:{init:!0,key:"episode",notion:"Episode",type:"number",format:"number"},explicit:{init:!0,key:"explicit",notion:"Explicit",type:"checkbox"},festivals:{init:!0,key:"festivals",notion:"Festival",type:"multi_select"},food:{init:!0,key:"food",notion:"Food",type:"rich_text"},isIndexed:{init:!0,key:"isIndexed",notion:"Is.Indexed",type:"checkbox"},isPublished:{init:!0,key:"isPublished",notion:"Is.Published",type:"checkbox"},mp3:{init:!0,key:"mp3",notion:"MP3",type:"files"},name:{init:!0,key:"name",notion:"Name",type:"rich_text"},nameFirst:{init:!0,key:"nameFirst",notion:"Name.First",type:"rich_text"},nameLast:{init:!0,key:"nameLast",notion:"Name.Last",type:"rich_text"},namePreferred:{init:!0,key:"namePreferred",notion:"Name.Preferred",type:"rich_text"},phoneNumber:{init:!0,key:"phoneNumber",notion:"Phone",type:"rich_text"},podcastAuthor:{init:!0,key:"podcastAuthor",notion:"Author",type:"rich_text"},podcastAuthorEmail:{init:!0,key:"podcastAuthorEmail",notion:"Author.Email",type:"rich_text"},relationEpisodes__Podcast:{init:!0,key:"relationEpisodes__Podcast",notion:"Podcasts",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Episodes"}},relationPodcasts__Episodes:{init:!1,key:"relationPodcasts__Episodes",notion:"Episodes",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Podcasts"}},relationEpisodes__People_Guest:{init:!0,key:"relationEpisodes__People_Guest",notion:"Guest",type:"relation",relation:{database_id:"People",synced_property_name:"Episodes.Guest"}},relationPeople__Episodes_Guest:{init:!1,key:"relationPeople__Episodes_Guest",notion:"Episodes.Guest",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Guest"}},relationEpisodes__People_Sound_Engineer:{init:!0,key:"relationEpisodes__People_Sound_Engineer",notion:"Sound.Engineer",type:"relation",relation:{database_id:"People",synced_property_name:"Episodes.Sound.Engineer"}},relationPeople__Episodes_Sound_Engineer:{init:!1,key:"relationPeople__Episodes_Sound_Engineer",notion:"Episodes.Sound.Engineer",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Sound.Engineer"}},relationEpisodes__People_Thanks:{init:!0,key:"relationEpisodes__People_Thanks",notion:"Thanks",type:"relation",relation:{database_id:"People",synced_property_name:"Episodes.Thanks"}},relationPeople__Episodes_Thanks:{init:!1,key:"relationPeople__Episodes_Thanks",notion:"Episodes.Thanks",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Thanks"}},relationEpisodes__Venues:{init:!0,key:"relationEpisodes__Venues",notion:"Venues",type:"relation",relation:{database_id:"Venues",synced_property_name:"Episodes"}},relationVenues__Episodes:{init:!1,key:"relationVenues__Episodes",notion:"Episodes",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Venues"}},relationEvents__Venues:{init:!0,key:"relationEvents__Venues",notion:"Venues",type:"relation",relation:{database_id:"Venues",synced_property_name:"Events"}},relationVenues__Events:{init:!1,key:"relationVenues__Events",notion:"Events",type:"relation",relation:{database_id:"Events",synced_property_name:"Venues"}},relationEvents__Shows:{init:!0,key:"relationEvents__Shows",notion:"Shows",type:"relation",relation:{database_id:"Shows",synced_property_name:"Events"}},relationShows__Events:{init:!1,key:"relationShows__Events",notion:"Events",type:"relation",relation:{database_id:"Events",synced_property_name:"Shows"}},relationEvents__Shows_Lineup:{init:!0,key:"relationEvents__Shows_Lineup",notion:"Shows.Lineup",type:"relation",relation:{database_id:"Shows",synced_property_name:"Events.Lineup"}},relationShows__Events_Lineup:{init:!1,key:"relationShows__Events_Lineup",notion:"Events.Lineup",type:"relation",relation:{database_id:"Events",synced_property_name:"Shows.Lineup"}},relationShows__People_Cast:{init:!0,key:"relationShows__People_Cast",notion:"Cast",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Cast"}},relationPeople__Shows_Cast:{init:!1,key:"relationPeople__Shows_Cast",notion:"Shows.Cast",type:"relation",relation:{database_id:"Shows",synced_property_name:"Cast"}},relationShows__People_Cast_Past:{init:!0,key:"relationShows__People_Cast_Past",notion:"Cast.Past",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Cast.Past"}},relationPeople__Shows_Cast_Past:{init:!1,key:"relationPeople__Shows_Cast_Past",notion:"Shows.Cast.Past",type:"relation",relation:{database_id:"Shows",synced_property_name:"Cast.Past"}},relationShows_People_Crew:{init:!0,key:"relationShows_People_Crew",notion:"Crew",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Crew"}},relationPeople__Shows_Crew:{init:!0,key:"relationPeople__Shows_Crew",notion:"Shows.Crew",type:"relation",relation:{database_id:"Shows",synced_property_name:"Crew"}},relationShows__People_Director:{init:!0,key:"relationShows__People_Director",notion:"Director",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Director"}},relationPeople__Shows_Director:{init:!1,key:"relationPeople__Shows_Director",notion:"Shows.Director",type:"relation",relation:{database_id:"Shows",synced_property_name:"Director"}},relationShows__People_Director_Musical:{init:!0,key:"relationShows__People_Director_Musical",notion:"Director.Musical",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Director.Musical"}},relationPeople__Shows_Director_Musical:{init:!1,key:"relationPeople__Shows_Director_Musical",notion:"Shows.Director.Musical",type:"relation",relation:{database_id:"Shows",synced_property_name:"Director.Musical"}},relationShows__People_Director_Technical:{init:!0,key:"relationShows__People_Director_Technical",notion:"Director.Technical",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Director.Technical"}},relationPeople__Shows_Director_Technical:{init:!1,key:"relationPeople__Shows_Director_Technical",notion:"Shows.Director.Technical",type:"relation",relation:{database_id:"Shows",synced_property_name:"Director.Technical"}},relationEvents__People_Guest:{init:!0,key:"relationEvents__People_Guest",notion:"Guest",type:"relation",relation:{database_id:"People",synced_property_name:"Events.Guest"}},relationPeople__Events_Guest:{init:!1,key:"relationEvents__People_Guest",notion:"Events.Guest",type:"relation",relation:{database_id:"Events",synced_property_name:"Guest"}},relationPodcasts__People_Host:{init:!0,key:"relationPodcasts__People_Host",notion:"Host",type:"relation",relation:{database_id:"People",synced_property_name:"Podcasts.Host"}},relationPeople__Podcasts_Host:{init:!1,key:"relationPeople__Podcasts_Host",notion:"Podcasts.Host",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Host"}},relationEvents__People_Host:{init:!0,key:"relationEvents__People_Host",notion:"Host",type:"relation",relation:{database_id:"People",synced_property_name:"Events.Host"}},relationPeople__Events_Host:{init:!1,key:"relationPeople__Events_Host",notion:"Events.Host",type:"relation",relation:{database_id:"Events",synced_property_name:"Host"}},relationShows__People_Producer:{init:!0,key:"relationShows__People_Producer",notion:"Producer",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Producer"}},relationPeople__Shows_Producer:{init:!1,key:"relationPeople__Shows_Producer",notion:"Shows.Producer",type:"relation",relation:{database_id:"Shows",synced_property_name:"Producer"}},relationEvents__People_Guest_Music:{init:!0,key:"relationEvents__People_Guest_Music",notion:"Guest.Music",type:"relation",relation:{database_id:"People",synced_property_name:"Events.Guest.Music"}},relationPeople__Events_Guest_Music:{init:!1,key:"relationPeople__Events_Guest_Music",notion:"Events.Guest.Music",type:"relation",relation:{database_id:"Events",synced_property_name:"Guest.Music"}},relationPodcasts__People_Sound_Engineer:{init:!0,key:"relationPodcasts__People_Sound_Engineer",notion:"Sound.Engineer",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Podcasts.Sound.Engineer"}},relationPeople__Podcasts_Sound_Engineer:{init:!1,key:"relationPeople__Podcasts_Sound_Engineer",notion:"Podcasts.Sound.Engineer",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Sound.Engineer"}},relationShows__People_Thanks:{init:!0,key:"relationShows__People_Thanks",notion:"Thanks",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Thanks"}},relationPeople__Shows_Thanks:{init:!1,key:"relationPeople__Shows_Thanks",notion:"Shows.Thanks",type:"relation",relation:{database_id:"Shows",synced_property_name:"Thanks"}},relationShows__People_Writer:{init:!0,key:"relationShows__People_Writer",notion:"Writer",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Writer"}},relationPeople__Shows_Writer:{init:!1,key:"relationPeople__Shows_Writer",notion:"Shows.Writer",type:"relation",relation:{database_id:"Shows",synced_property_name:"Writer"}},relationShows__Tags:{init:!0,key:"relationShows__Tags",notion:"Tags",type:"relation",relation:{database_id:"Tags",synced_property_name:"Shows"}},relationTags__Shows:{init:!1,key:"relationTags__Shows",notion:"Shows",type:"relation",relation:{database_id:"Shows",synced_property_name:"Tags"}},rollupShows__Tags:{init:!1,key:"rollupShows__Tags",notion:"Tags.Rollup",type:"rollup",rollup:{relation_property_name:"Tags",rollup_property_id:"Title",function:"show_original"}},rollupShows__People_Cast:{init:!1,key:"rollupShows__People_Cast",notion:"Cast.Rollup",type:"rollup",rollup:{relation_property_name:"Cast",rollup_property_id:"Title",function:"show_original"}},rollupShows__People_Cast_Slug:{init:!1,key:"rollupShows__People_Cast_Slug",notion:"Cast.Rollup.Slug",type:"rollup",rollup:{relation_property_name:"Cast",rollup_property_name:"Slug",function:"show_original"}},rollupShows__People_Cast_Past:{init:!1,key:"rollupShows__People_Cast_Past",notion:"Cast.Past.Rollup",type:"rollup",rollup:{relation_property_name:"Cast.Past",rollup_property_id:"Title",function:"show_original"}},rollupShows__People_Crew:{init:!1,key:"rollupShows__People_Crew",notion:"Crew.Rollup",type:"rollup",rollup:{relation_property_name:"Crew",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Director:{init:!1,key:"rollupShows__People_Director",notion:"Director.Rollup",type:"rollup",rollup:{relation_property_name:"Director",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Director_Musical:{init:!1,key:"rollupShows__People_Director_Musical",notion:"Director.Musical.Rollup",type:"rollup",rollup:{relation_property_name:"Director.Musical",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Director_Technical:{init:!1,key:"rollupShows__People_Director_Technical",notion:"Director.Technical.Rollup",type:"rollup",rollup:{relation_property_name:"Director.Technical",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Music:{init:!1,key:"rollupShows__People_Music",notion:"Music.Rollup",type:"rollup",rollup:{relation_property_name:"Music",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Producer:{init:!1,key:"rollupShows__People_Producer",notion:"Producer.Rollup",type:"rollup",rollup:{relation_property_name:"Producer",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Thanks:{init:!1,key:"rollupShows__People_Thanks",notion:"Thanks.Rollup",type:"rollup",rollup:{relation_property_name:"Thanks",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Writer:{init:!1,key:"rollupShows__People_Writer",notion:"Writer.Rollup",type:"rollup",rollup:{relation_property_name:"Writer",rollup_property_name:"Title",function:"show_original"}},rollupEvents__People_Cast:{init:!1,key:"rollupEvents__People_Cast",notion:"Cast.Rollup",type:"rollup",rollup:{relation_property_name:"Shows",rollup_property_id:"Cast",function:"show_original"}},rollupEvents__People_Guest:{init:!1,key:"rollupEvents__People_Guest",notion:"Guest.Rollup",type:"rollup",rollup:{relation_property_name:"Guest",rollup_property_id:"Title",function:"show_original"}},rollupEvents__People_Guest_Music:{init:!1,key:"rollupEvents__People_Guest_Music",notion:"Guest.Music.Rollup",type:"rollup",rollup:{relation_property_name:"Guest.Music",rollup_property_id:"Title",function:"show_original"}},rollupEvents__People_Host:{init:!1,key:"rollupEvents__People_Host",notion:"Host.Rollup",type:"rollup",rollup:{relation_property_name:"Host",rollup_property_id:"Title",function:"show_original"}},rollupEvents__Shows:{init:!1,key:"rollupEvents__Shows",notion:"Shows.Rollup",type:"rollup",rollup:{relation_property_name:"Shows",rollup_property_id:"Title",function:"show_original"}},rollupEvents__Shows_Lineup:{init:!1,key:"rollupEvents__Shows_Lineup",notion:"Shows.Lineup.Rollup",type:"rollup",rollup:{relation_property_name:"Shows.Lineup",rollup_property_id:"Title",function:"show_original"}},rollupEvents__Venues:{init:!1,key:"rollupEvents__Venues",notion:"Venues.Rollup",type:"rollup",rollup:{relation_property_name:"Venues",rollup_property_id:"Title",function:"show_original"}},season:{init:!0,key:"season",notion:"Season",type:"number",format:"number"},seoDescription:{init:!0,key:"seoDescription",notion:"SEO.Description",type:"rich_text"},seoImage:{init:!0,key:"seoImage",notion:"SEO.Image",type:"files"},seoImageDescription:{init:!0,key:"seoImageDescription",notion:"SEO.Image.Description",type:"rich_text"},slug:{init:!0,key:"slug",notion:"Slug",type:"rich_text"},socialFacebook:{init:!0,key:"socialFacebook",notion:"Social.Facebook",type:"url"},socialInstagram:{init:!0,key:"socialInstagram",notion:"Social.Instagram",type:"url"},socialTwitter:{init:!0,key:"socialTwitter",notion:"Social.Twitter",type:"url"},socialWebsite:{init:!0,key:"socialWebsite",notion:"Social.Website",type:"url"},socialSpotify:{init:!0,key:"socialSpotify",notion:"Social.Spotify",type:"url"},socialApple:{init:!0,key:"socialApple",notion:"Social.Apple",type:"url"},subtitle:{init:!0,key:"subtitle",notion:"Subitle",type:"rich_text"},ticketUrl:{init:!0,key:"ticketUrl",notion:"TicketUrl",type:"url"},title:{init:!0,key:"title",notion:"Title",type:"title"},type:{init:!0,key:"type",notion:"Type",type:"select"}},v=[t.authors,t.datePublished,t.isIndexed,t.isPublished,t.slug,t.seoDescription,t.seoImage,t.seoImageDescription,t.title],ee=[...v],te=[...v,t.dateRecorded,t.duration,t.episode,t.mp3,t.season,t.relationEpisodes__People_Guest,t.relationEpisodes__People_Sound_Engineer,t.relationEpisodes__People_Thanks,t.relationEpisodes__Podcast,t.relationEpisodes__Venues,t.socialApple,t.socialSpotify,t.type],oe=[...v,t.dateEvent,t.relationEvents__People_Guest_Music,t.relationEvents__People_Guest,t.relationEvents__People_Host,t.relationEvents__Shows_Lineup,t.relationEvents__Shows,t.relationEvents__Venues,t.socialFacebook,t.socialWebsite,t.ticketUrl,t.rollupEvents__People_Cast,t.rollupEvents__People_Guest_Music,t.rollupEvents__People_Guest,t.rollupEvents__People_Host,t.rollupEvents__Shows_Lineup,t.rollupEvents__Shows,t.rollupEvents__Venues],re=[...v],ne=[...v,t.email,t.nameFirst,t.nameLast,t.namePreferred,t.relationPeople__Episodes_Guest,t.relationPeople__Episodes_Sound_Engineer,t.relationPeople__Episodes_Thanks,t.relationPeople__Events_Guest,t.relationPeople__Events_Guest_Music,t.relationPeople__Events_Host,t.relationPeople__Podcasts_Host,t.relationPeople__Podcasts_Sound_Engineer,t.relationPeople__Shows_Cast,t.relationPeople__Shows_Cast_Past,t.relationPeople__Shows_Director,t.relationPeople__Shows_Director_Musical,t.relationPeople__Shows_Director_Technical,t.relationPeople__Shows_Producer,t.relationPeople__Shows_Thanks,t.relationPeople__Shows_Writer],ie=[...v,t.categories,t.explicit,t.podcastAuthor,t.podcastAuthorEmail,t.relationPodcasts__People_Host,t.relationPodcasts__People_Sound_Engineer,t.socialApple,t.socialSpotify,t.type,t.relationPodcasts__Episodes],se=[...v],ae=[...v,t.relationShows__People_Cast,t.relationShows__People_Cast_Past,t.relationShows__People_Director,t.relationShows__People_Director_Musical,t.relationShows__People_Director_Technical,t.relationShows__People_Producer,t.relationShows__People_Thanks,t.relationShows__People_Writer,t.relationShows__Tags,t.socialFacebook,t.socialInstagram,t.socialTwitter,t.socialWebsite,t.relationShows__Events,t.relationShows__Events_Lineup,t.rollupShows__People_Cast,t.rollupShows__People_Cast_Slug,t.rollupShows__People_Cast_Past,t.rollupShows__People_Crew,t.rollupShows__People_Director,t.rollupShows__People_Director_Musical,t.rollupShows__People_Director_Technical,t.rollupShows__People_Music,t.rollupShows__People_Producer,t.rollupShows__People_Thanks,t.rollupShows__People_Writer,t.rollupShows__Tags],le=[...v,t.addressCity,t.addressLatitude,t.addressLongitude,t.addressNeighborhood,t.addressState,t.addressStreet,t.addressZipCode,t.phoneNumber,t.socialFacebook,t.socialInstagram,t.socialTwitter,t.socialWebsite,t.relationVenues__Episodes,t.relationVenues__Events],mo={BLOG:O(ee,{init:!0}),EPISODES:O(te,{init:!0}),EVENTS:O(oe,{init:!0}),PAGES:O(re,{init:!0}),PEOPLE:O(ne,{init:!0}),PODCASTS:O(ie,{init:!0}),SEO:O(se,{init:!0}),SHOWS:O(ae,{init:!0}),VENUES:O(le,{init:!0})},pe={BLOG:ee.map(e=>C(e)),EPISODES:te.map(e=>C(e)),EVENTS:oe.map(e=>C(e)),PAGES:re.map(e=>C(e)),PEOPLE:ne.map(e=>C(e)),PODCASTS:ie.map(e=>C(e)),SEO:se.map(e=>C(e)),SHOWS:ae.map(e=>C(e)),VENUES:le.map(e=>C(e))},_e=Ve(t,e=>C(e)),ue=new Date().toISOString(),x={dateBefore:{property:t.datePublished.notion,date:{before:ue}},dateOnOrAfter:{property:t.datePublished.notion,date:{on_or_after:ue}},published:{property:t.isPublished.notion,checkbox:{equals:!1}},slug:{property:t.slug.notion,text:{equals:""}}},He="LISTING",Qe="LISTING_BY_DATE",Fe="SLUG",We="SLUG_BY_ROUTE",Ye=[He,Qe,Fe,We],b=Object.assign({},...Ye.map(e=>({[e]:e})).flat(1));import{avoidRateLimit as ze,isUndefined as je}from"@jeromefitz/utils";var $e=async({getBlocksChildrenList:e,block_id:o})=>je(o)?[]:(await ze(),await e({block_id:o})),U=$e;var B={sorts:[{property:t.slug.notion,direction:"ascending"}]},qe=async({database_id:e,filter:o=B==null?void 0:B.filter,getDatabasesQuery:n,sorts:l=B==null?void 0:B.sorts})=>e?await n({database_id:e,sorts:l,filter:o}):[],M=qe;var de=async({getBlocksChildrenList:e,blocks:o})=>{if(o==null)return o;let n=o.filter(r=>r.has_children).map(r=>{let{id:i}=r;return{promise:e({block_id:i,page_size:100}),parent_block:r}}),l=await Promise.all(n.map(r=>r.promise));for(let r=0;r<l.length;r++){let i=l[r].results;if(await de({blocks:i,getBlocksChildrenList:e}),n[r]){let p=n[r].parent_block;p[p.type].children=i}}return o},V=de;var Ze=({config:e,item:o,routeType:n,meta:l})=>{var c,h;let{NOTION:r}=e,i="",p=(c=o.properties)==null?void 0:c.slug,s="",m="/[...catchAll]";switch(n){case r.BLOG.routeType:case r.EVENTS.routeType:i=(h=o.properties[r[n.toUpperCase()].infoType.key])==null?void 0:h.start.slice(0,10);let[a,_,y]=i==null?void 0:i.split("-");s=`/${n}/${a}/${_}/${y}/${p}`;break;case r.PODCASTS.routeType:case r.EPISODES.routeType:s=`/${l==null?void 0:l.join("/")}/${p}`;break;default:s=`/${n}/${p}`;break}return s=s.replace("//","/"),{as:s,date:i,href:m,slug:p}},H=Ze;import{sortObject as Ce}from"@jeromefitz/utils";import Nt from"lodash/map.js";import W from"lodash/omit.js";import ce from"date-fns/addDays/index.js";import Ke from"date-fns/addMonths/index.js";import Je from"date-fns/addYears/index.js";var Xe=(e,o)=>{switch(o){case"year":return Je(e,1).toISOString();case"month":return Ke(e,1).toISOString();case"day":return ce(e,2).toISOString()}return ce(e,-1).toISOString()},I=Xe;import et from"lodash/map.js";var tt=({config:e,data:o,pathVariables:n,pageId:l})=>{var c,h;let{NOTION:r}=e,i={};if(!(o==null?void 0:o.properties))return i;let{properties:p}=o,s="";if(n){let{meta:a,routeType:_}=n;s=_===((c=r==null?void 0:r.PODCASTS)==null?void 0:c.routeType)&&a.length>1?(h=r==null?void 0:r.EPISODES)==null?void 0:h.routeType:_}let m=s?pe[s.toUpperCase()]:_e;return et(m,a=>{let _,y=p[a.notion];i[a.key]=null,y&&(_=L[a.type](y,l),i[a.key]=_||null)}),i},w=tt;import{sortObject as ot}from"@jeromefitz/utils";import rt from"lodash/map.js";import nt from"lodash/omit.js";var it=({config:e,results:o,routeType:n})=>{let l=[];return rt(o,r=>{let i=nt(r,"properties");i.properties=ot(w({config:e,data:r,pathVariables:n,pageId:r==null?void 0:r.id})),l.push(i)}),l},ye=it;var st=({isPage:e,isIndex:o,hasMeta:n})=>e?b.SLUG:o&&!n?b.LISTING:o&&n?b.LISTING_BY_DATE:n?b.SLUG_BY_ROUTE:b.SLUG,Q=st;var at=e=>(console.dir("@notion(_unsupported)"),e),R=at;var lt=e=>e.checkbox||!1,me=lt;var pt=e=>{let{type:o}=e;return e[o]},G=pt;var _t=e=>e.email||null,he=_t;import{stringToUUID as ut}from"@jeromefitz/utils";import dt from"github-slugger";import ct from"lodash/size.js";var yt="https://www.notion.so/image/{{FILENAME}}?table=block&id={{PAGE_ID}}&cache=v2&w1dth=600",mt=(e,o)=>yt.replace("{{FILENAME}}",encodeURIComponent(e)).replace("{{PAGE_ID}}",ut(o)),ht=(e,o)=>{let n=new dt,l={};return ct(e.files)<=0||e.files.map(r=>{var i,p;if((r==null?void 0:r.type)==="file"){let s=(i=r==null?void 0:r.file)==null?void 0:i.url.split("?")[0],m=n.slug(s);l[m]={type:r==null?void 0:r.type,url:mt(s,o)}}if((r==null?void 0:r.type)==="external"){let s=(p=r==null?void 0:r.external)==null?void 0:p.url.split("?")[0],m=n.slug(s);l[m]={type:r==null?void 0:r.type,url:s}}}),l},F=ht;import St from"github-slugger";import Pt from"lodash/map.js";var gt=e=>{let o=new St,n={};return Pt(e.multi_select,l=>{let r=l;r.slug=o.slug(r.name),n[r.id]=r}),n},Se=gt;var ft=e=>(e==null?void 0:e.number)||null,Pe=ft;import Et from"github-slugger";var wt=e=>{let o=new Et;return e.people.map(n=>{let{avatar_url:l,id:r,name:i,person:p}=n,{email:s}=p;return{[o.slug(i)]:{avatar_url:l,email:s,id:r,name:i}}})[0]},ge=wt;var Tt=e=>(e==null?void 0:e.phone_number)||null,fe=Tt;import Ee from"lodash/map.js";var kt=e=>e.type==="rollup"?e.rollup.type==="array"&&Ee(e.rollup.array,o=>L[o.type](o))[0]:Ee(e.relation,o=>o.id),we=kt;var bt=e=>{var o;return(e==null?void 0:e.rich_text)?(o=e==null?void 0:e.rich_text[0])==null?void 0:o.plain_text:null},Te=bt;import It from"lodash/map.js";import Dt from"lodash/sortBy.js";var Ct=e=>{var o;return Dt(It((o=e==null?void 0:e.rollup)==null?void 0:o.array,n=>L[n.type](n)))},ke=Ct;import Ot from"github-slugger";var vt=e=>{let o=new Ot,n=e.select;return n?(n.slug=o.slug(e.select.name),{[n.id]:n}):null},be=vt;var xt=e=>{var o;return(e==null?void 0:e.title)?(o=e==null?void 0:e.title[0])==null?void 0:o.plain_text:null},Ie=xt;var Lt=e=>e.url||null,De=Lt;var Bt={checkbox:me,created_by:R,created_time:G,date:G,email:he,files:F,formula:R,image:F,last_edited_by:R,last_edited_time:G,multi_select:Se,number:Pe,people:ge,phone_number:fe,relation:we,rich_text:Te,rollup:ke,select:be,title:Ie,url:De},L=Bt;var Rt=async({config:e,getBlocksByIdChildren:o,getDatabasesByIdQuery:n,getPagesById:l,pathVariables:r,routeType:i})=>{let{NOTION:p}=e,s={},m=new Date().toISOString(),c=new Date("2020-01-01").toISOString(),h=p[i.toUpperCase()].page_id__seo,a=await l({page_id:h});if(!a)return{};(a==null?void 0:a.object)==="page"&&(s=W(a,"properties"),s.properties=Ce(w({config:e,data:a,pathVariables:r,pageId:s.id})));let _=p.EVENTS.routeType===i,y=p[i.toUpperCase()].infoType.notion??t.datePublished.notion,P=await o({block_id:s.id}),S=await n({database_id:p[i.toUpperCase()].database_id,filter:{and:[{property:y,date:{on_or_after:_?m:c}}]}}),E=[];Nt(S.results,k=>{let D=k;D=W(D,"properties"),D.properties=Ce(w({config:e,data:k,pathVariables:r,pageId:k.id})),E.push(D)});let T=W(S,"results");return T.results=E,{info:s,content:P,items:T,images:{}}},Y=Rt;import{sortObject as Oe}from"@jeromefitz/utils";import Gt from"lodash/map.js";import A from"lodash/omit.js";import At from"lodash/size.js";var Ut=({config:e,pathVariables:o,routeType:n,slug:l})=>{var y,P;let{NOTION:r}=e,{meta:i}=o,[p,s,m]=i,c=At(i),h=new Date().toISOString(),a=new Date(`${p||h.slice(0,4)}-${s||"01"}-${m||"01"}`),_=((P=(y=r[n.toUpperCase()])==null?void 0:y.infoType)==null?void 0:P.notion)??t.datePublished.notion;switch(c){case 1:return{and:[{property:_,date:{on_or_after:I(a,"")}},{property:_,date:{before:I(a,"year")}}]};case 2:return{and:[{property:_,date:{on_or_after:I(a,"")}},{property:_,date:{before:I(a,"month")}}]};case 3:return{and:[{property:_,date:{on_or_after:I(a,"")}},{property:_,date:{before:I(a,"day")}}]};default:return{and:[{property:_,date:{on_or_after:I(a,"")}},{property:_,date:{before:I(a,"day")}},f(g({},x.slug),{text:{equals:l}})]}}},Mt=async({config:e,getBlocksByIdChildren:o,getDatabasesByIdQuery:n,getPagesById:l,pathVariables:r,routeType:i,slug:p})=>{let{NOTION:s}=e,m={},c={},h=s[i.toUpperCase()].page_id__seo,a=await l({page_id:h});a.object==="page"&&(c=A(a,"properties"),c.properties=Oe(w({config:e,data:a,pathVariables:r,pageId:a.id}))),m=await o({block_id:c.id});let _=[{property:t.datePublished.notion,direction:"descending"}],y=Ut({config:e,pathVariables:r,routeType:i,slug:p}),P=s[i.toUpperCase()].database_id,S=await n({database_id:P,filter:y,sorts:_}),E=[];Gt(S.results,D=>{let N=A(D,"properties");N.properties=Oe(w({config:e,data:D,pathVariables:r,pageId:N.id})),!!N&&E.push(N)});let T=A(S,"results");T.results=E;let k=A(T,"data");return{info:c,content:m,items:k,images:{}}},z=Mt;import{sortObject as Vt}from"@jeromefitz/utils";import Ht from"lodash/omit.js";var Qt=async({config:e,getBlocksByIdChildren:o,getDatabasesByIdQuery:n,getDeepFetchAllChildren:l,pathVariables:r,routeType:i,slug:p})=>{let{NOTION:s}=e,m=i==null?void 0:i.toUpperCase();if(!Object.keys(s).includes(m))return{info:{},content:{},items:{},images:{}};let h=await n({database_id:s[m].database_id,filter:{and:[f(g({},x.slug),{text:{equals:p}})]}}),a=(h==null?void 0:h.object)==="list"&&h.results[0];if(!a)return{};let _=Ht(a,"properties");_.properties=Vt(w({config:e,data:a,pathVariables:r,pageId:_.id}));let y=await o({block_id:_.id}),S=[...await l({blocks:y.results})];return{info:_,content:S,items:{},images:{}}},j=Qt;import{sortObject as ve}from"@jeromefitz/utils";import xe from"lodash/omit.js";import Ft from"lodash/size.js";var Wt=async({config:e,getBlocksByIdChildren:o,getDatabasesByIdQuery:n,getQuery:l,pathVariables:r,routeType:i})=>{var k;let{NOTION:p}=e,{meta:s}=r,m=i.toUpperCase(),[c,h]=s,a=Ft(s)===2,_=(k=p[m])==null?void 0:k.hasChild.toUpperCase(),y=await n({database_id:p[a?p[_].routeType.toUpperCase():m].database_id,filter:{and:[f(g({},x.slug),{text:{equals:a?h:c}})]}}),P=(y==null?void 0:y.object)==="list"&&y.results[0];if(!P)return{info:{},content:{},items:{},images:{}};let S=xe(P,"properties");S.properties=ve(w({config:e,data:P,pathVariables:r,pageId:S.id}));let E=await o({block_id:S.id}),T={};return a||(T=await l({config:e,reqQuery:{podcasts:S.id,databaseType:p[_].routeType.toUpperCase()}})),{info:S,content:E,items:T,images:{}}},Yt=async({config:e,getBlocksByIdChildren:o,getDatabasesByIdQuery:n,pathVariables:l,routeType:r,slug:i})=>{var k,D;let p=new Date().toISOString(),{NOTION:s}=e,{meta:m}=l,[c,h,a]=m,_=new Date(`${c||p.slice(0,4)}-${h||"01"}-${a||"01"}`),y=((D=(k=s[r.toUpperCase()])==null?void 0:k.infoType)==null?void 0:D.notion)??t.datePublished.notion,P=await n({database_id:s[r.toUpperCase()].database_id,filter:{and:[{property:y,date:{on_or_after:I(_,"")}},{property:y,date:{before:I(_,"day")}},f(g({},x.slug),{text:{equals:i}})]}}),S=(P==null?void 0:P.object)==="list"&&P.results[0];if(!S)return{info:{},content:{},items:{},images:{}};let E=xe(S,"properties");E.properties=ve(w({config:e,data:S,pathVariables:l,pageId:E.id}));let T=await o({block_id:E.id});return{info:E,content:T,items:{},images:{}}},zt=async({config:e,getBlocksByIdChildren:o,getDatabasesByIdQuery:n,getQuery:l,pathVariables:r,routeType:i,slug:p})=>{let{NOTION:s,ROUTE_TYPES_BY_DATA_TYPES:m}=e;return s[i.toUpperCase()].hasChild?await Wt({config:e,getBlocksByIdChildren:o,getDatabasesByIdQuery:n,getQuery:l,pathVariables:r,routeType:i}):m[b.LISTING_BY_DATE].includes(i.toUpperCase())?await Yt({config:e,getBlocksByIdChildren:o,getDatabasesByIdQuery:n,pathVariables:r,routeType:i,slug:p}):{info:{},content:{},items:{},images:{}}},$=zt;import{avoidRateLimit as jt,isUndefined as $t}from"@jeromefitz/utils";var qt=async({getPagesRetrieve:e,page_id:o})=>$t(o)?[]:(await jt(),await e({page_id:o})),q=qt;import Le from"lodash/drop.js";import Zt from"lodash/dropRight.js";import Kt from"lodash/first.js";import Be from"lodash/includes.js";import Jt from"lodash/isInteger.js";import Xt from"lodash/join.js";import eo from"lodash/last.js";import Ne from"lodash/size.js";var to=({config:e,catchAll:o})=>{let{NOTION:n,PAGES__HOMEPAGE:l,ROUTE_META:r,ROUTE_TYPES:i}=e,p=Ne(o),s=Kt(o),m=s.toUpperCase(),c=eo(o),h=p>1&&Be(r,m)?Le(o):Le(Zt(o)),a=s===c&&!Be(i,m)?n.PAGES.routeType:s,_=s!==c&&!Jt(parseInt(c))?c:s,y=a===n.PAGES.routeType.toLowerCase(),P=_===s,S=!!h&&Ne(h)!==0,E=y&&s===l?"":Xt(o,"/"),T={hasMeta:S,isPage:y,isIndex:P,meta:h,routeType:a,slug:_,url:E},k=Q(T);return f(g({},T),{dataType:k})},Z=to;import{avoidRateLimit as oo,isObjectEmpty as ro}from"@jeromefitz/utils";import no from"lodash/map.js";import io from"lodash/omit.js";import so from"lodash/size.js";var ao=[{property:t.slug.notion,direction:"ascending"}],lo=async({config:e,reqQuery:o,notionDatabasesQuery:n})=>{let{NOTION:l}=e,{databaseType:r}=o,i=r,p=!1,s=r.toUpperCase(),m=l[s].database_id;if(!m)return[];let c={},h={},a,_;if(r==="EPISODES"){_=ao;let{podcasts:y}=o,P=[],S=[];!!y&&S.push(...y==null?void 0:y.split(",")),so(S)>0&&no(S,E=>P.push({property:t.relationEpisodes__Podcast.notion,relation:{contains:E}})),a={or:[...P]}}else p=!0;if(!p&&(!c||ro(c))){await oo();let y;a?((a==null?void 0:a.or.length)===0&&(a={and:[{property:t.slug.notion,rich_text:{equals:"@hack(notion)-do-not-return"}}]}),y=await n({database_id:m,filter:a,sorts:_}),c=y,h=ye({config:e,results:y.results,routeType:i}),c=io(c,"results"),c.results=h):p=!0}return c},K=lo;var _o=class extends po{constructor(o){super(o);this.custom={getBlocksByIdChildren:async o=>await U(f(g({},o),{getBlocksChildrenList:this.blocks.children.list})),getDatabasesByIdQuery:async o=>await M(f(g({},o),{getDatabasesQuery:this.databases.query})),getDeepFetchAllChildren:async o=>await V(f(g({},o),{getBlocksChildrenList:this.blocks.children.list})),getInfoType:o=>H(f(g({},o),{config:this.#e})),getPagesById:async o=>await q(f(g({},o),{getPagesRetrieve:this.pages.retrieve})),getPathVariables:o=>Z(f(g({},o),{config:this.#e})),getQuery:async o=>await K(f(g({},o),{config:this.#e,notionDatabasesQuery:this.databases.query}))};this.dataTypes={[b.LISTING]:async o=>await Y(f(g({},o),{config:this.#e,getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getPagesById:this.custom.getPagesById})),[b.LISTING_BY_DATE]:async o=>await z(f(g({},o),{config:this.#e,getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getPagesById:this.custom.getPagesById})),[b.SLUG]:async o=>await j(f(g({},o),{config:this.#e,getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getDeepFetchAllChildren:this.custom.getDeepFetchAllChildren})),[b.SLUG_BY_ROUTE]:async o=>await $(f(g({},o),{config:this.#e,getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getQuery:this.custom.getQuery}))};this.#e=o==null?void 0:o.config}#e};export{_o as Client};
|