@jeromefitz/notion 2.0.1 → 2.0.2

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.
Files changed (68) hide show
  1. package/README.md +38 -9
  2. package/index.cjs +1 -1
  3. package/index.d.ts +70 -33
  4. package/index.js +1 -1
  5. package/package.json +2 -3
  6. package/queries/getBlocksByIdChildren/index.cjs +1 -1
  7. package/queries/getBlocksByIdChildren/index.d.ts +2 -1
  8. package/queries/getBlocksByIdChildren/index.js +1 -1
  9. package/queries/getDatabasesByIdQuery/index.cjs +1 -1
  10. package/queries/getDatabasesByIdQuery/index.d.ts +6 -3
  11. package/queries/getDatabasesByIdQuery/index.js +1 -1
  12. package/queries/getDeepFetchAllChildren/index.cjs +1 -1
  13. package/queries/getDeepFetchAllChildren/index.d.ts +2 -1
  14. package/queries/getDeepFetchAllChildren/index.js +1 -1
  15. package/queries/getInfoType/index.cjs +1 -1
  16. package/queries/getInfoType/index.js +1 -1
  17. package/queries/getNotionListing/index.cjs +1 -1
  18. package/queries/getNotionListing/index.d.ts +11 -1
  19. package/queries/getNotionListing/index.js +1 -1
  20. package/queries/getNotionListingByDate/index.cjs +1 -1
  21. package/queries/getNotionListingByDate/index.d.ts +1 -1
  22. package/queries/getNotionListingByDate/index.js +1 -1
  23. package/queries/getNotionSlug/index.cjs +1 -1
  24. package/queries/getNotionSlug/index.d.ts +8 -3
  25. package/queries/getNotionSlug/index.js +1 -1
  26. package/queries/getNotionSlugByRoute/index.cjs +1 -1
  27. package/queries/getNotionSlugByRoute/index.d.ts +6 -1
  28. package/queries/getNotionSlugByRoute/index.js +1 -1
  29. package/queries/getPagesById/index.cjs +1 -1
  30. package/queries/getPagesById/index.d.ts +2 -1
  31. package/queries/getPagesById/index.js +1 -1
  32. package/queries/getPathVariables/index.cjs +1 -1
  33. package/queries/getPathVariables/index.js +1 -1
  34. package/queries/getQuery/index.cjs +1 -1
  35. package/queries/getQuery/index.js +1 -1
  36. package/queries/index.cjs +1 -1
  37. package/queries/index.js +1 -1
  38. package/schema/index.cjs +1 -1
  39. package/schema/index.d.ts +12 -1
  40. package/utils/dataNormalized/index.cjs +1 -1
  41. package/utils/dataNormalized/index.d.ts +5 -0
  42. package/utils/dataNormalized/index.js +1 -1
  43. package/utils/dataNormalizedResults/index.cjs +1 -1
  44. package/utils/dataNormalizedResults/index.d.ts +6 -0
  45. package/utils/dataNormalizedResults/index.js +1 -1
  46. package/utils/getDataType/index.cjs +1 -0
  47. package/utils/getDataType/index.d.ts +60 -0
  48. package/utils/getDataType/index.js +1 -0
  49. package/utils/getTitle/index.cjs +1 -1
  50. package/utils/getTitle/index.d.ts +4 -0
  51. package/utils/getTitle/index.js +1 -1
  52. package/utils/getTypes/_unsupported.cjs +1 -1
  53. package/utils/getTypes/_unsupported.js +1 -1
  54. package/utils/getTypes/index.cjs +1 -1
  55. package/utils/getTypes/index.js +1 -1
  56. package/utils/getTypes/relation.cjs +1 -1
  57. package/utils/getTypes/relation.js +1 -1
  58. package/utils/getTypes/rollup.cjs +1 -1
  59. package/utils/getTypes/rollup.js +1 -1
  60. package/utils/index.cjs +1 -1
  61. package/utils/index.d.ts +2 -2
  62. package/utils/index.js +1 -1
  63. package/utils/filterImages/index.cjs +0 -1
  64. package/utils/filterImages/index.d.ts +0 -3
  65. package/utils/filterImages/index.js +0 -1
  66. package/utils/getImages/index.cjs +0 -1
  67. package/utils/getImages/index.d.ts +0 -9
  68. package/utils/getImages/index.js +0 -1
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 config: {
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
- // @todo(next) should come from `process.env...`
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({ config: notionConfig, catchAll })
64
-
65
- const data = await getCatchAll({ cache, catchAll, clear, pathVariables, preview })
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/index.cjs CHANGED
@@ -1 +1 @@
1
- var Ht=Object.create;var F=Object.defineProperty,Wt=Object.defineProperties,Ft=Object.getOwnPropertyDescriptor,Qt=Object.getOwnPropertyDescriptors,jt=Object.getOwnPropertyNames,Te=Object.getOwnPropertySymbols,zt=Object.getPrototypeOf,ke=Object.prototype.hasOwnProperty,$t=Object.prototype.propertyIsEnumerable;var Ie=(e,t,n)=>t in e?F(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,b=(e,t)=>{for(var n in t||(t={}))ke.call(t,n)&&Ie(e,n,t[n]);if(Te)for(var n of Te(t))$t.call(t,n)&&Ie(e,n,t[n]);return e},k=(e,t)=>Wt(e,Qt(t)),De=e=>F(e,"__esModule",{value:!0});var Yt=(e,t)=>{for(var n in t)F(e,n,{get:t[n],enumerable:!0})},Ce=(e,t,n,p)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of jt(t))!ke.call(e,r)&&(n||r!=="default")&&F(e,r,{get:()=>t[r],enumerable:!(p=Ft(t,r))||p.enumerable});return e},l=(e,t)=>Ce(De(F(e!=null?Ht(zt(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),qt=(e=>(t,n)=>e&&e.get(t)||(n=Ce(De({}),t,1),e&&e.set(t,n),n))(typeof WeakMap!="undefined"?new WeakMap:0);var ve=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var L=(e,t,n)=>(ve(e,t,"read from private field"),n?n.call(e):t.get(e)),xe=(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)},Oe=(e,t,n,p)=>(ve(e,t,"write to private field"),p?p.call(e,n):t.set(e,n),n);var Uo={};Yt(Uo,{Client:()=>Mt});var Vt=l(require("@notionhq/client"),1);var O=l(require("lodash/filter.js"),1),Ne=l(require("lodash/map.js"),1),N=({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],Ge=[...G],Le=[...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],Be=[...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],Ae=[...G],Ue=[...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],Ve=[...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],Me=[...G],Re=[...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],He=[...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],Mo={BLOG:(0,O.default)(Ge,{init:!0}),EPISODES:(0,O.default)(Le,{init:!0}),EVENTS:(0,O.default)(Be,{init:!0}),PAGES:(0,O.default)(Ae,{init:!0}),PEOPLE:(0,O.default)(Ue,{init:!0}),PODCASTS:(0,O.default)(Ve,{init:!0}),SEO:(0,O.default)(Me,{init:!0}),SHOWS:(0,O.default)(Re,{init:!0}),VENUES:(0,O.default)(He,{init:!0})},We={BLOG:Ge.map(e=>N(e)),EPISODES:Le.map(e=>N(e)),EVENTS:Be.map(e=>N(e)),PAGES:Ae.map(e=>N(e)),PEOPLE:Ue.map(e=>N(e)),PODCASTS:Ve.map(e=>N(e)),SEO:Me.map(e=>N(e)),SHOWS:Re.map(e=>N(e)),VENUES:He.map(e=>N(e))},Fe=(0,Ne.default)(o,e=>N(e)),Qe=new Date().toISOString(),A={dateBefore:{property:o.datePublished.notion,date:{before:Qe}},dateOnOrAfter:{property:o.datePublished.notion,date:{on_or_after:Qe}},published:{property:o.isPublished.notion,checkbox:{equals:!1}},slug:{property:o.slug.notion,text:{equals:""}}},Zt="LISTING",Kt="LISTING_BY_DATE",Jt="SLUG",Xt="SLUG_BY_ROUTE",eo=[Zt,Kt,Jt,Xt],C=Object.assign({},...eo.map(e=>({[e]:e})).flat(1));var z=l(require("@jeromefitz/utils"),1),to=async(e,{block_id:t})=>(0,z.isUndefined)(t)?[]:(await(0,z.avoidRateLimit)(),await e({block_id:t})),re=to;var je={sorts:[{property:o.slug.notion,direction:"ascending"}]},oo=async(e,{database_id:t,sorts:n=je.sorts,filter:p=je.filter})=>t?await e({database_id:t,sorts:n,filter:p}):[],ne=oo;var ze=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})),p=await Promise.all(n.map(r=>r.promise));for(let r=0;r<p.length;r++){let i=p[r].results;if(await ze(e,{blocks:i}),n[r]){let a=n[r].parent_block;a[a.type].children=i}}return t},ie=ze;var ro=({config:e,item:t,routeType:n,meta:p})=>{var y,d,m,f,u;let{NOTION:r}=e,i="",a=(y=t.properties)==null?void 0:y.slug,s="",c="/[...catchAll]";switch(n){case r.BLOG.routeType:i=(m=(d=t.properties)==null?void 0:d.datePublished)==null?void 0:m.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,h]=i==null?void 0:i.split("-");s=`/${n}/${_}/${w}/${h}/${a}`;break;case r.PODCASTS.routeType:case r.EPISODES.routeType:s=`/${p==null?void 0:p.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:c,slug:a}},se=ro;var _e=l(require("@jeromefitz/utils"),1),bt=l(require("lodash/map.js"),1),J=l(require("lodash/omit.js"),1);var ae=l(require("date-fns/addDays/index.js"),1),$e=l(require("date-fns/addMonths/index.js"),1),Ye=l(require("date-fns/addYears/index.js"),1),no=(e,t)=>{switch(t){case"year":return(0,Ye.default)(e,1).toISOString();case"month":return(0,$e.default)(e,1).toISOString();case"day":return(0,ae.default)(e,2).toISOString()}return(0,ae.default)(e,-1).toISOString()},D=no;var qe=l(require("lodash/map.js"),1);var io=({config:e,data:t,pathVariables:n,pageId:p})=>{var y,d;let{NOTION:r}=e,i={};if(!(t==null?void 0:t.properties))return i;let{properties:a}=t,s;if(n){let{meta:m,routeType:f}=n;s=f===((y=r==null?void 0:r.PODCASTS)==null?void 0:y.routeType)&&m.length>1?(d=r==null?void 0:r.EPISODES)==null?void 0:d.routeType:f}let c=s?We[s.toUpperCase()]:Fe;return(0,qe.default)(c,m=>{let f,u=a[m.notion];i[m.key]=null,u&&(f=U[m.type](u,p),i[m.key]=f||null)}),i},I=io;var Ze=l(require("@jeromefitz/utils"),1),Ke=l(require("lodash/map.js"),1),Je=l(require("lodash/omit.js"),1);var so=({config:e,results:t,routeType:n})=>{let p=[];return(0,Ke.default)(t,r=>{let i=(0,Je.default)(r,"properties");i.properties=(0,Ze.sortObject)(I({config:e,data:r,pathVariables:n,pageId:r==null?void 0:r.id})),p.push(i)}),p},Xe=so;var et=l(require("lodash/filter.js"),1),$=l(require("lodash/map.js"),1),ao=(e,t)=>{switch(t){case"info":let n=[];return(0,$.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,et.default)(e,{object:"block",type:"image"});case"items":let p=[];return(0,$.default)(e,r=>{var i;(0,$.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"&&p.push(a==null?void 0:a.url))}),p;default:return[]}},R=ao;var tt=l(require("github-slugger"),1),Y=l(require("lodash/map.js"),1),q=l(require("plaiceholder"),1);var lo=async({data:e,pathVariables:t})=>{var d,m,f,u,T,E,g;let n=new tt.default,p={},r=((d=e.info)==null?void 0:d.object)==="page"?R((m=e.info)==null?void 0:m.properties,"info"):!!((f=e.info)==null?void 0:f.results)&&R((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:h,img:P}=await(0,q.getPlaiceholder)(w),x=n.slug(w);return{base64:h,id:x,img:P,url:w}}),a=i?await Promise.all(i):[],s=!t.isIndex&&R(e==null?void 0:e.content,"content"),c=!!s&&s.map(async _=>{var B,M;if(!_)return null;let{type:w}=_,h=_[w],P=!!_&&!!((B=h==null?void 0:h.external)==null?void 0:B.url)?(M=h==null?void 0:h.external)==null?void 0:M.url:null;if(!P)return null;let{base64:x,img:H}=await(0,q.getPlaiceholder)(P),V=n.slug(P);return{base64:x,id:V,img:H,url:P}}),y=c?await Promise.all(c):[];if(e.items){let _=e.items.object==="page"?R((E=e.items)==null?void 0:E.data,"items"):R((g=e.items)==null?void 0:g.results,"items"),w=!!_&&_.map(async P=>{if(!P)return null;let x=!!P&&!!(P==null?void 0:P.url)?P==null?void 0:P.url:P;if(!x)return null;let{base64:H,img:V}=await(0,q.getPlaiceholder)(x),B=n.slug(x);return{base64:H,id:B,img:V,url:x}}),h=await Promise.all(w);!!h&&h[0]&&(0,Y.default)(h,P=>p[P.id]=P)}return!!a&&a[0]&&(0,Y.default)(a,_=>p[_.id]=_),!!y&&y[0]&&(0,Y.default)(y,_=>p[_.id]=_),p},Q=lo;var po=e=>(console.dir("@notion(_unsupported)"),console.dir(e),e),Z=po;var _o=e=>e.checkbox||!1,ot=_o;var uo=e=>{let{type:t}=e;return e[t]},K=uo;var co=e=>e.email||null,rt=co;var nt=l(require("@jeromefitz/utils"),1),it=l(require("github-slugger"),1),st=l(require("lodash/size.js"),1),yo="https://www.notion.so/image/{{FILENAME}}?table=block&id={{PAGE_ID}}&cache=v2&w1dth=600",mo=(e,t)=>yo.replace("{{FILENAME}}",encodeURIComponent(e)).replace("{{PAGE_ID}}",(0,nt.stringToUUID)(t)),ho=(e,t)=>{let n=new it.default,p={};return(0,st.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],c=n.slug(s);p[c]={type:r==null?void 0:r.type,url:mo(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],c=n.slug(s);p[c]={type:r==null?void 0:r.type,url:s}}}),p},le=ho;var at=l(require("github-slugger"),1),lt=l(require("lodash/map.js"),1),So=e=>{let t=new at.default,n={};return(0,lt.default)(e.multi_select,p=>{let r=p;r.slug=t.slug(r.name),n[r.id]=r}),n},pt=So;var Po=e=>(e==null?void 0:e.number)||null,_t=Po;var ut=l(require("github-slugger"),1),fo=e=>{let t=new ut.default;return e.people.map(n=>{let{avatar_url:p,id:r,name:i,person:a}=n,{email:s}=a;return{[t.slug(i)]:{avatar_url:p,email:s,id:r,name:i}}})[0]},dt=fo;var Eo=e=>(e==null?void 0:e.phone_number)||null,ct=Eo;var pe=l(require("lodash/map.js"),1);var go=e=>e.type==="rollup"?e.rollup.type==="array"&&(0,pe.default)(e.rollup.array,t=>U[t.type](t))[0]:(0,pe.default)(e.relation,t=>t.id),yt=go;var wo=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},mt=wo;var ht=l(require("lodash/map.js"),1),St=l(require("lodash/sortBy.js"),1);var bo=e=>{var t;return(0,St.default)((0,ht.default)((t=e==null?void 0:e.rollup)==null?void 0:t.array,n=>U[n.type](n)))},Pt=bo;var ft=l(require("github-slugger"),1),To=e=>{let t=new ft.default,n=e.select;return n?(n.slug=t.slug(e.select.name),{[n.id]:n}):null},Et=To;var ko=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},gt=ko;var Io=e=>e.url||null,wt=Io;var Do={checkbox:ot,created_by:Z,created_time:K,date:K,email:rt,files:le,formula:Z,image:le,last_edited_by:Z,last_edited_time:K,multi_select:pt,number:_t,people:dt,phone_number:ct,relation:yt,rich_text:mt,rollup:Pt,select:Et,title:gt,url:wt},U=Do;var Co=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,getPagesById:p,pathVariables:r,routeType:i})=>{let{NOTION:a}=e,s={},c={},y={},d=new Date().toISOString(),m=new Date("2020-01-01").toISOString(),f=a[i.toUpperCase()].page_id__seo,u=await p({page_id:f});if(!u)return{};(u==null?void 0:u.object)==="page"&&(c=(0,J.default)(u,"properties"),c.properties=(0,_e.sortObject)(I({config:e,data:u,pathVariables:r,pageId:c.id}))),s=await t({block_id:c.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?d:m}}]}}),E=[];(0,bt.default)(T.results,h=>{let P=h;P=(0,J.default)(P,"properties"),P.properties=(0,_e.sortObject)(I({config:e,data:h,pathVariables:r,pageId:h.id})),E.push(P)});let g=(0,J.default)(T,"results");g.results=E,y=g;let _={info:c,content:s,items:y,images:{}},w=_?await Q({data:_,pathVariables:r}):{};return _=k(b({},_),{images:w}),_},ue=Co;var de=l(require("@jeromefitz/utils"),1),Tt=l(require("lodash/map.js"),1),j=l(require("lodash/omit.js"),1),kt=l(require("lodash/size.js"),1);var vo=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,getPagesById:p,pathVariables:r,routeType:i,slug:a})=>{let{NOTION:s}=e,{meta:c}=r,y={},d={},m={},f=new Date().toISOString(),u=s[i.toUpperCase()].page_id__seo,T=await p({page_id:u});T.object==="page"&&(d=(0,j.default)(T,"properties"),d.properties=(0,de.sortObject)(I({config:e,data:T,pathVariables:r,pageId:d.id}))),y=await t({block_id:d.id});let E=(0,kt.default)(c),[g,_,w]=c,h=new Date(`${g||f.slice(0,4)}-${_||"01"}-${w||"01"}`),P,x=[{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:D(h,"")}},{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{before:D(h,"year")}}]};break;case 2:P={and:[{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{on_or_after:D(h,"")}},{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{before:D(h,"month")}}]};break;case 3:P={and:[{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{on_or_after:D(h,"")}},{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{before:D(h,"day")}}]};break;default:P={and:[{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{on_or_after:D(h,"")}},{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{before:D(h,"day")}},k(b({},A.slug),{text:{equals:a}})]};break}let H=s[i.toUpperCase()].database_id,V=await n({database_id:H,filter:P,sorts:x}),B=[];(0,Tt.default)(V.results,oe=>{let W=oe;W=(0,j.default)(W,"properties"),W.properties=(0,de.sortObject)(I({config:e,data:oe,pathVariables:r,pageId:oe.id})),!!W&&B.push(W)});let M=(0,j.default)(V,"results");M.results=B,m=M,m=(0,j.default)(M,"data");let te={info:d,content:y,items:m,images:{}},Rt={};return te=k(b({},te),{images:Rt}),te},ce=vo;var It=l(require("@jeromefitz/utils"),1),Dt=l(require("lodash/filter.js"),1),Ct=l(require("lodash/omit.js"),1);var xo=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,getDeepFetchAllChildren:p,pathVariables:r,routeType:i,slug:a})=>{let{NOTION:s}=e,c={},y={},d={},m=i==null?void 0:i.toUpperCase();if(!Object.keys(s).includes(m))return{info:y,content:c,items:d,images:{}};let u=await n({database_id:s[m].database_id,filter:{and:[k(b({},A.slug),{text:{equals:a}})]}}),T=(u==null?void 0:u.object)==="list"&&u.results[0];if(!T)return{};y=(0,Ct.default)(T,"properties"),y.properties=(0,It.sortObject)(I({config:e,data:T,pathVariables:r,pageId:y.id})),c=await t({block_id:y.id}),c=[...await p({blocks:c.results})],d&&(d.results=(0,Dt.default)(d.results,{properties:{isPublished:!0}}));let g={info:y,content:c,items:d,images:{}},_=g?await Q({data:g,pathVariables:r}):{};return g=k(b({},g),{images:_}),g},ye=xo;var me=l(require("@jeromefitz/utils"),1),he=l(require("lodash/omit.js"),1),vt=l(require("lodash/size.js"),1);var Oo=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,getQuery:p,pathVariables:r,routeType:i,slug:a})=>{let{NOTION:s}=e,{meta:c}=r,y={},d={},m={},f=new Date().toISOString();if(i===s.PODCASTS.routeType){let[E,g]=c,_=(0,vt.default)(c)===2,w=await n({database_id:s[_?s.EPISODES.routeType.toUpperCase():i.toUpperCase()].database_id,filter:{and:[k(b({},A.slug),{text:{equals:_?g:E}})]}}),h=(w==null?void 0:w.object)==="list"&&w.results[0];if(!h)return{};d=(0,he.default)(h,"properties"),d.properties=(0,me.sortObject)(I({config:e,data:h,pathVariables:r,pageId:d.id})),y=await t({block_id:d.id}),_||i===s.PODCASTS.routeType&&(m=await p({config:e,reqQuery:{podcasts:d.id,databaseType:s.EPISODES.routeType.toUpperCase()}}))}if([s.BLOG.routeType,s.EVENTS.routeType].includes(i)){let[E,g,_]=c,w=new Date(`${E||f.slice(0,4)}-${g||"01"}-${_||"01"}`),h=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:D(w,"")}},{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{before:D(w,"day")}},k(b({},A.slug),{text:{equals:a}})]}}),P=(h==null?void 0:h.object)==="list"&&h.results[0];P&&(d=(0,he.default)(P,"properties"),d.properties=(0,me.sortObject)(I({config:e,data:P,pathVariables:r,pageId:d.id})),y=await t({block_id:d.id}))}let u={info:d,content:y,items:m,images:{}},T={};return u=k(b({},u),{images:T}),u},Se=Oo;var X=l(require("@jeromefitz/utils"),1),No=async(e,{page_id:t})=>(0,X.isUndefined)(t)?[]:(await(0,X.avoidRateLimit)(),await e({page_id:t})),Pe=No;var fe=l(require("lodash/drop.js"),1),xt=l(require("lodash/dropRight.js"),1),Ot=l(require("lodash/first.js"),1),Ee=l(require("lodash/includes.js"),1),Nt=l(require("lodash/isInteger.js"),1),Gt=l(require("lodash/join.js"),1),Lt=l(require("lodash/last.js"),1),ge=l(require("lodash/size.js"),1);var Go=({config:e,catchAll:t})=>{let{NOTION:n,PAGES__HOMEPAGE:p,ROUTE_TYPES:r}=e,i=(0,ge.default)(t),a=(0,Ot.default)(t),s=(0,Lt.default)(t),c=i>1&&(0,Ee.default)([n.BLOG.routeType,n.EVENTS.routeType,n.PODCASTS.routeType],a)?(0,fe.default)(t):(0,fe.default)((0,xt.default)(t)),y=a===s&&!(0,Ee.default)(r,a)?"pages":a,d=a!==s&&!(0,Nt.default)(parseInt(s))?s:a,m=y==="pages",f=d===a,u=!!c&&(0,ge.default)(c)!==0,T=m&&a===p?"":(0,Gt.default)(t,"/"),E=C.SLUG;return m?E=C.SLUG:f&&!u?E=C.LISTING:f&&u?E=C.LISTING_BY_DATE:u?E=C.SLUG_BY_ROUTE:E=C.SLUG,{dataType:E,hasMeta:u,isPage:m,isIndex:f,meta:c,routeType:y,slug:d,url:T}},we=Go;var ee=l(require("@jeromefitz/utils"),1),Bt=l(require("lodash/map.js"),1),At=l(require("lodash/omit.js"),1),Ut=l(require("lodash/size.js"),1);var Lo={ASCENDING:"ascending",DESCENDING:"descending"},Bo=[{property:o.slug.notion,direction:Lo.ASCENDING}],Ao=async({config:e,reqQuery:t,notionDatabasesQuery:n})=>{let{NOTION:p}=e,{databaseType:r}=t,i=r,a=!1,s=r.toUpperCase(),c=p[s].database_id;if(!c)return[];let y={},d={},m,f;if(r==="EPISODES"){f=Bo;let{podcasts:u}=t,T=[],E=[];!!u&&E.push(...u==null?void 0:u.split(",")),(0,Ut.default)(E)>0&&(0,Bt.default)(E,g=>T.push({property:o.relationEpisodes__Podcast.notion,relation:{contains:g}})),m={or:[...T]}}else a=!0;if(!a&&(!y||(0,ee.isObjectEmpty)(y))){await(0,ee.avoidRateLimit)();let u;m?((m==null?void 0:m.or.length)===0&&(m={and:[{property:o.slug.notion,rich_text:{equals:"@hack(notion)-do-not-return"}}]}),u=await n({database_id:c,filter:m,sorts:f}),y=u,d=Xe({config:e,results:u.results,routeType:i}),y=(0,At.default)(y,"results"),y.results=d):a=!0}return y},be=Ao;var v,Mt=class extends Vt.Client{constructor(t){super(t);xe(this,v,void 0);this.custom={getBlocksByIdChildren:async t=>await re(this.blocks.children.list,b({},t)),getDatabasesByIdQuery:async t=>await ne(this.databases.query,t),getDeepFetchAllChildren:async t=>await ie(this.blocks.children.list,b({},t)),getInfoType:t=>se(k(b({},t),{config:L(this,v)})),getPagesById:async t=>await Pe(this.pages.retrieve,b({},t)),getPathVariables:t=>we(k(b({},t),{config:L(this,v)})),getQuery:async t=>await be(k(b({},t),{config:L(this,v),notionDatabasesQuery:this.databases.query}))};this.dataTypes={[C.LISTING]:async t=>await ue(k(b({},t),{config:L(this,v),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getPagesById:this.custom.getPagesById})),[C.LISTING_BY_DATE]:async t=>await ce(k(b({},t),{config:L(this,v),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getPagesById:this.custom.getPagesById})),[C.SLUG]:async t=>await ye(k(b({},t),{config:L(this,v),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getDeepFetchAllChildren:this.custom.getDeepFetchAllChildren})),[C.SLUG_BY_ROUTE]:async t=>await Se(k(b({},t),{config:L(this,v),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getQuery:this.custom.getQuery}))};Oe(this,v,t==null?void 0:t.config)}};v=new WeakMap;module.exports=qt(Uo);0&&(module.exports={Client});
1
+ var kt=Object.create;var R=Object.defineProperty,It=Object.defineProperties,Dt=Object.getOwnPropertyDescriptor,Ct=Object.getOwnPropertyDescriptors,vt=Object.getOwnPropertyNames,ce=Object.getOwnPropertySymbols,Ot=Object.getPrototypeOf,ye=Object.prototype.hasOwnProperty,xt=Object.prototype.propertyIsEnumerable;var me=(e,t,n)=>t in e?R(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,P=(e,t)=>{for(var n in t||(t={}))ye.call(t,n)&&me(e,n,t[n]);if(ce)for(var n of ce(t))xt.call(t,n)&&me(e,n,t[n]);return e},g=(e,t)=>It(e,Ct(t)),he=e=>R(e,"__esModule",{value:!0});var Bt=(e,t)=>{for(var n in t)R(e,n,{get:t[n],enumerable:!0})},Se=(e,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of vt(t))!ye.call(e,r)&&(n||r!=="default")&&R(e,r,{get:()=>t[r],enumerable:!(a=Dt(t,r))||a.enumerable});return e},p=(e,t)=>Se(he(R(e!=null?kt(Ot(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),Lt=(e=>(t,n)=>e&&e.get(t)||(n=Se(he({}),t,1),e&&e.set(t,n),n))(typeof WeakMap!="undefined"?new WeakMap:0);var Pe=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var x=(e,t,n)=>(Pe(e,t,"read from private field"),n?n.call(e):t.get(e)),ge=(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)},Ee=(e,t,n,a)=>(Pe(e,t,"write to private field"),a?a.call(e,n):t.set(e,n),n);var wo={};Bt(wo,{Client:()=>bt});var Tt=p(require("@notionhq/client"),1);var C=p(require("lodash/filter.js"),1),fe=p(require("lodash/map.js"),1),v=({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"}},O=[o.authors,o.datePublished,o.isIndexed,o.isPublished,o.slug,o.seoDescription,o.seoImage,o.seoImageDescription,o.title],we=[...O],Te=[...O,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],be=[...O,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],ke=[...O],Ie=[...O,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],De=[...O,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],Ce=[...O],ve=[...O,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],Oe=[...O,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],bo={BLOG:(0,C.default)(we,{init:!0}),EPISODES:(0,C.default)(Te,{init:!0}),EVENTS:(0,C.default)(be,{init:!0}),PAGES:(0,C.default)(ke,{init:!0}),PEOPLE:(0,C.default)(Ie,{init:!0}),PODCASTS:(0,C.default)(De,{init:!0}),SEO:(0,C.default)(Ce,{init:!0}),SHOWS:(0,C.default)(ve,{init:!0}),VENUES:(0,C.default)(Oe,{init:!0})},xe={BLOG:we.map(e=>v(e)),EPISODES:Te.map(e=>v(e)),EVENTS:be.map(e=>v(e)),PAGES:ke.map(e=>v(e)),PEOPLE:Ie.map(e=>v(e)),PODCASTS:De.map(e=>v(e)),SEO:Ce.map(e=>v(e)),SHOWS:ve.map(e=>v(e)),VENUES:Oe.map(e=>v(e))},Be=(0,fe.default)(o,e=>v(e)),Le=new Date().toISOString(),B={dateBefore:{property:o.datePublished.notion,date:{before:Le}},dateOnOrAfter:{property:o.datePublished.notion,date:{on_or_after:Le}},published:{property:o.isPublished.notion,checkbox:{equals:!1}},slug:{property:o.slug.notion,text:{equals:""}}},Nt="LISTING",Rt="LISTING_BY_DATE",Gt="SLUG",At="SLUG_BY_ROUTE",Ut=[Nt,Rt,Gt,At],k=Object.assign({},...Ut.map(e=>({[e]:e})).flat(1));var M=p(require("@jeromefitz/utils"),1),Mt=async({getBlocksChildrenList:e,block_id:t})=>(0,M.isUndefined)(t)?[]:(await(0,M.avoidRateLimit)(),await e({block_id:t})),Y=Mt;var N={sorts:[{property:o.slug.notion,direction:"ascending"}]},Vt=async({database_id:e,filter:t=N==null?void 0:N.filter,getDatabasesQuery:n,sorts:a=N==null?void 0:N.sorts})=>e?await n({database_id:e,sorts:a,filter:t}):[],z=Vt;var Ne=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}}),a=await Promise.all(n.map(r=>r.promise));for(let r=0;r<a.length;r++){let i=a[r].results;if(await Ne({blocks:i,getBlocksChildrenList:e}),n[r]){let u=n[r].parent_block;u[u.type].children=i}}return t},$=Ne;var Ht=({config:e,item:t,routeType:n,meta:a})=>{var y,h,l,_,m;let{NOTION:r}=e,i="",u=(y=t.properties)==null?void 0:y.slug,s="",d="/[...catchAll]";switch(n){case r.BLOG.routeType:i=(l=(h=t.properties)==null?void 0:h.datePublished)==null?void 0:l.start.slice(0,10);let[E,S,f]=i==null?void 0:i.split("-");s=`/${n}/${E}/${S}/${f}/${u}`;break;case r.EVENTS.routeType:i=(m=(_=t.properties)==null?void 0:_.dateEvent)==null?void 0:m.start.slice(0,10);let[w,b,A]=i==null?void 0:i.split("-");s=`/${n}/${w}/${b}/${A}/${u}`;break;case r.PODCASTS.routeType:case r.EPISODES.routeType:s=`/${a==null?void 0:a.join("/")}/${u}`;break;default:s=`/${n}/${u}`;break}return s=s.replace("//","/"),{as:s,date:i,href:d,slug:u}},j=Ht;var X=p(require("@jeromefitz/utils"),1),pt=p(require("lodash/map.js"),1),Q=p(require("lodash/omit.js"),1);var q=p(require("date-fns/addDays/index.js"),1),Re=p(require("date-fns/addMonths/index.js"),1),Ge=p(require("date-fns/addYears/index.js"),1),Qt=(e,t)=>{switch(t){case"year":return(0,Ge.default)(e,1).toISOString();case"month":return(0,Re.default)(e,1).toISOString();case"day":return(0,q.default)(e,2).toISOString()}return(0,q.default)(e,-1).toISOString()},I=Qt;var Ae=p(require("lodash/map.js"),1);var Ft=({config:e,data:t,pathVariables:n,pageId:a})=>{var y,h;let{NOTION:r}=e,i={};if(!(t==null?void 0:t.properties))return i;let{properties:u}=t,s;if(n){let{meta:l,routeType:_}=n;s=_===((y=r==null?void 0:r.PODCASTS)==null?void 0:y.routeType)&&l.length>1?(h=r==null?void 0:r.EPISODES)==null?void 0:h.routeType:_}let d=s?xe[s.toUpperCase()]:Be;return(0,Ae.default)(d,l=>{let _,m=u[l.notion];i[l.key]=null,m&&(_=L[l.type](m,a),i[l.key]=_||null)}),i},T=Ft;var Ue=p(require("@jeromefitz/utils"),1),Me=p(require("lodash/map.js"),1),Ve=p(require("lodash/omit.js"),1);var Wt=({config:e,results:t,routeType:n})=>{let a=[];return(0,Me.default)(t,r=>{let i=(0,Ve.default)(r,"properties");i.properties=(0,Ue.sortObject)(T({config:e,data:r,pathVariables:n,pageId:r==null?void 0:r.id})),a.push(i)}),a},He=Wt;var Yt=({isPage:e,isIndex:t,hasMeta:n})=>e?k.SLUG:t&&!n?k.LISTING:t&&n?k.LISTING_BY_DATE:n?k.SLUG_BY_ROUTE:k.SLUG,Z=Yt;var zt=e=>(console.dir("@notion(_unsupported)"),e),V=zt;var $t=e=>e.checkbox||!1,Qe=$t;var jt=e=>{let{type:t}=e;return e[t]},H=jt;var qt=e=>e.email||null,Fe=qt;var We=p(require("@jeromefitz/utils"),1),Ye=p(require("github-slugger"),1),ze=p(require("lodash/size.js"),1),Zt="https://www.notion.so/image/{{FILENAME}}?table=block&id={{PAGE_ID}}&cache=v2&w1dth=600",Kt=(e,t)=>Zt.replace("{{FILENAME}}",encodeURIComponent(e)).replace("{{PAGE_ID}}",(0,We.stringToUUID)(t)),Jt=(e,t)=>{let n=new Ye.default,a={};return(0,ze.default)(e.files)<=0||e.files.map(r=>{var i,u;if((r==null?void 0:r.type)==="file"){let s=(i=r==null?void 0:r.file)==null?void 0:i.url.split("?")[0],d=n.slug(s);a[d]={type:r==null?void 0:r.type,url:Kt(s,t)}}if((r==null?void 0:r.type)==="external"){let s=(u=r==null?void 0:r.external)==null?void 0:u.url.split("?")[0],d=n.slug(s);a[d]={type:r==null?void 0:r.type,url:s}}}),a},K=Jt;var $e=p(require("github-slugger"),1),je=p(require("lodash/map.js"),1),Xt=e=>{let t=new $e.default,n={};return(0,je.default)(e.multi_select,a=>{let r=a;r.slug=t.slug(r.name),n[r.id]=r}),n},qe=Xt;var eo=e=>(e==null?void 0:e.number)||null,Ze=eo;var Ke=p(require("github-slugger"),1),to=e=>{let t=new Ke.default;return e.people.map(n=>{let{avatar_url:a,id:r,name:i,person:u}=n,{email:s}=u;return{[t.slug(i)]:{avatar_url:a,email:s,id:r,name:i}}})[0]},Je=to;var oo=e=>(e==null?void 0:e.phone_number)||null,Xe=oo;var J=p(require("lodash/map.js"),1);var ro=e=>e.type==="rollup"?e.rollup.type==="array"&&(0,J.default)(e.rollup.array,t=>L[t.type](t))[0]:(0,J.default)(e.relation,t=>t.id),et=ro;var no=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},tt=no;var ot=p(require("lodash/map.js"),1),rt=p(require("lodash/sortBy.js"),1);var io=e=>{var t;return(0,rt.default)((0,ot.default)((t=e==null?void 0:e.rollup)==null?void 0:t.array,n=>L[n.type](n)))},nt=io;var it=p(require("github-slugger"),1),so=e=>{let t=new it.default,n=e.select;return n?(n.slug=t.slug(e.select.name),{[n.id]:n}):null},st=so;var ao=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},at=ao;var lo=e=>e.url||null,lt=lo;var po={checkbox:Qe,created_by:V,created_time:H,date:H,email:Fe,files:K,formula:V,image:K,last_edited_by:V,last_edited_time:H,multi_select:qe,number:Ze,people:Je,phone_number:Xe,relation:et,rich_text:tt,rollup:nt,select:st,title:at,url:lt},L=po;var _o=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,getPagesById:a,pathVariables:r,routeType:i})=>{let{NOTION:u}=e,s=u.EVENTS.routeType===i,d={},y=new Date().toISOString(),h=new Date("2020-01-01").toISOString(),l=u[i.toUpperCase()].page_id__seo,_=await a({page_id:l});if(!_)return{};(_==null?void 0:_.object)==="page"&&(d=(0,Q.default)(_,"properties"),d.properties=(0,X.sortObject)(T({config:e,data:_,pathVariables:r,pageId:d.id})));let m=await t({block_id:d.id}),E=await n({database_id:u[i.toUpperCase()].database_id,filter:{and:[{property:s?o.dateEvent.notion:o.datePublished.notion,date:{on_or_after:s?y:h}}]}}),S=[];(0,pt.default)(E.results,w=>{let b=w;b=(0,Q.default)(b,"properties"),b.properties=(0,X.sortObject)(T({config:e,data:w,pathVariables:r,pageId:w.id})),S.push(b)});let f=(0,Q.default)(E,"results");return f.results=S,{info:d,content:m,items:f,images:{}}},ee=_o;var te=p(require("@jeromefitz/utils"),1),_t=p(require("lodash/map.js"),1),G=p(require("lodash/omit.js"),1),ut=p(require("lodash/size.js"),1);var uo=({config:e,pathVariables:t,routeType:n,slug:a})=>{let{NOTION:r}=e,{meta:i}=t,[u,s,d]=i,y=(0,ut.default)(i),h=new Date().toISOString(),l=new Date(`${u||h.slice(0,4)}-${s||"01"}-${d||"01"}`),_=n===r.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion;switch(y){case 1:return{and:[{property:_,date:{on_or_after:I(l,"")}},{property:_,date:{before:I(l,"year")}}]};case 2:return{and:[{property:_,date:{on_or_after:I(l,"")}},{property:_,date:{before:I(l,"month")}}]};case 3:return{and:[{property:_,date:{on_or_after:I(l,"")}},{property:_,date:{before:I(l,"day")}}]};default:return{and:[{property:_,date:{on_or_after:I(l,"")}},{property:_,date:{before:I(l,"day")}},g(P({},B.slug),{text:{equals:a}})]}}},co=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,getPagesById:a,pathVariables:r,routeType:i,slug:u})=>{let{NOTION:s}=e,d={},y={},h=s[i.toUpperCase()].page_id__seo,l=await a({page_id:h});l.object==="page"&&(y=(0,G.default)(l,"properties"),y.properties=(0,te.sortObject)(T({config:e,data:l,pathVariables:r,pageId:l.id}))),d=await t({block_id:y.id});let _=[{property:o.datePublished.notion,direction:"descending"}],m=uo({config:e,pathVariables:r,routeType:i,slug:u}),E=s[i.toUpperCase()].database_id,S=await n({database_id:E,filter:m,sorts:_}),f=[];(0,_t.default)(S.results,A=>{let U=(0,G.default)(A,"properties");U.properties=(0,te.sortObject)(T({config:e,data:A,pathVariables:r,pageId:U.id})),!!U&&f.push(U)});let w=(0,G.default)(S,"results");w.results=f;let b=(0,G.default)(w,"data");return{info:y,content:d,items:b,images:{}}},oe=co;var dt=p(require("@jeromefitz/utils"),1),ct=p(require("lodash/omit.js"),1);var yo=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,getDeepFetchAllChildren:a,pathVariables:r,routeType:i,slug:u})=>{let{NOTION:s}=e,d=i==null?void 0:i.toUpperCase();if(!Object.keys(s).includes(d))return{info:{},content:{},items:{},images:{}};let h=await n({database_id:s[d].database_id,filter:{and:[g(P({},B.slug),{text:{equals:u}})]}}),l=(h==null?void 0:h.object)==="list"&&h.results[0];if(!l)return{};let _=(0,ct.default)(l,"properties");_.properties=(0,dt.sortObject)(T({config:e,data:l,pathVariables:r,pageId:_.id}));let m=await t({block_id:_.id}),S=[...await a({blocks:m.results})];return{info:_,content:S,items:{},images:{}}},re=yo;var ne=p(require("@jeromefitz/utils"),1),ie=p(require("lodash/omit.js"),1),yt=p(require("lodash/size.js"),1);var mo=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,getQuery:a,pathVariables:r,routeType:i})=>{var b;let{NOTION:u}=e,{meta:s}=r,d=i.toUpperCase(),[y,h]=s,l=(0,yt.default)(s)===2,_=(b=u[d])==null?void 0:b.hasChild.toUpperCase(),m=await n({database_id:u[l?u[_].routeType.toUpperCase():d].database_id,filter:{and:[g(P({},B.slug),{text:{equals:l?h:y}})]}}),E=(m==null?void 0:m.object)==="list"&&m.results[0];if(!E)return{info:{},content:{},items:{},images:{}};let S=(0,ie.default)(E,"properties");S.properties=(0,ne.sortObject)(T({config:e,data:E,pathVariables:r,pageId:S.id}));let f=await t({block_id:S.id}),w={};return l||(w=await a({config:e,reqQuery:{podcasts:S.id,databaseType:u[_].routeType.toUpperCase()}})),{info:S,content:f,items:w,images:{}}},ho=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,pathVariables:a,routeType:r,slug:i})=>{let u=new Date().toISOString(),{NOTION:s}=e,{meta:d}=a,[y,h,l]=d,_=new Date(`${y||u.slice(0,4)}-${h||"01"}-${l||"01"}`),m=await n({database_id:s[r.toUpperCase()].database_id,filter:{and:[{property:r===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{on_or_after:I(_,"")}},{property:r===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{before:I(_,"day")}},g(P({},B.slug),{text:{equals:i}})]}}),E=(m==null?void 0:m.object)==="list"&&m.results[0];if(!E)return{info:{},content:{},items:{},images:{}};let S=(0,ie.default)(E,"properties");S.properties=(0,ne.sortObject)(T({config:e,data:E,pathVariables:a,pageId:S.id}));let f=await t({block_id:S.id});return{info:S,content:f,items:{},images:{}}},So=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,getQuery:a,pathVariables:r,routeType:i,slug:u})=>{let{NOTION:s,ROUTE_TYPES_BY_DATA_TYPES:d}=e;return s[i.toUpperCase()].hasChild?await mo({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,getQuery:a,pathVariables:r,routeType:i}):d[k.LISTING_BY_DATE].includes(i.toUpperCase())?await ho({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,pathVariables:r,routeType:i,slug:u}):{info:{},content:{},items:{},images:{}}},se=So;var F=p(require("@jeromefitz/utils"),1),Po=async({getPagesRetrieve:e,page_id:t})=>(0,F.isUndefined)(t)?[]:(await(0,F.avoidRateLimit)(),await e({page_id:t})),ae=Po;var le=p(require("lodash/drop.js"),1),mt=p(require("lodash/dropRight.js"),1),ht=p(require("lodash/first.js"),1),pe=p(require("lodash/includes.js"),1),St=p(require("lodash/isInteger.js"),1),Pt=p(require("lodash/join.js"),1),gt=p(require("lodash/last.js"),1),_e=p(require("lodash/size.js"),1);var go=({config:e,catchAll:t})=>{let{NOTION:n,PAGES__HOMEPAGE:a,ROUTE_META:r,ROUTE_TYPES:i}=e,u=(0,_e.default)(t),s=(0,ht.default)(t),d=s.toUpperCase(),y=(0,gt.default)(t),h=u>1&&(0,pe.default)(r,d)?(0,le.default)(t):(0,le.default)((0,mt.default)(t)),l=s===y&&!(0,pe.default)(i,d)?n.PAGES.routeType:s,_=s!==y&&!(0,St.default)(parseInt(y))?y:s,m=l===n.PAGES.routeType.toLowerCase(),E=_===s,S=!!h&&(0,_e.default)(h)!==0,f=m&&s===a?"":(0,Pt.default)(t,"/"),w={hasMeta:S,isPage:m,isIndex:E,meta:h,routeType:l,slug:_,url:f},b=Z(w);return g(P({},w),{dataType:b})},ue=go;var W=p(require("@jeromefitz/utils"),1),Et=p(require("lodash/map.js"),1),ft=p(require("lodash/omit.js"),1),wt=p(require("lodash/size.js"),1);var Eo=[{property:o.slug.notion,direction:"ascending"}],fo=async({config:e,reqQuery:t,notionDatabasesQuery:n})=>{let{NOTION:a}=e,{databaseType:r}=t,i=r,u=!1,s=r.toUpperCase(),d=a[s].database_id;if(!d)return[];let y={},h={},l,_;if(r==="EPISODES"){_=Eo;let{podcasts:m}=t,E=[],S=[];!!m&&S.push(...m==null?void 0:m.split(",")),(0,wt.default)(S)>0&&(0,Et.default)(S,f=>E.push({property:o.relationEpisodes__Podcast.notion,relation:{contains:f}})),l={or:[...E]}}else u=!0;if(!u&&(!y||(0,W.isObjectEmpty)(y))){await(0,W.avoidRateLimit)();let m;l?((l==null?void 0:l.or.length)===0&&(l={and:[{property:o.slug.notion,rich_text:{equals:"@hack(notion)-do-not-return"}}]}),m=await n({database_id:d,filter:l,sorts:_}),y=m,h=He({config:e,results:m.results,routeType:i}),y=(0,ft.default)(y,"results"),y.results=h):u=!0}return y},de=fo;var D,bt=class extends Tt.Client{constructor(t){super(t);ge(this,D,void 0);this.custom={getBlocksByIdChildren:async t=>await Y(g(P({},t),{getBlocksChildrenList:this.blocks.children.list})),getDatabasesByIdQuery:async t=>await z(g(P({},t),{getDatabasesQuery:this.databases.query})),getDeepFetchAllChildren:async t=>await $(g(P({},t),{getBlocksChildrenList:this.blocks.children.list})),getInfoType:t=>j(g(P({},t),{config:x(this,D)})),getPagesById:async t=>await ae(g(P({},t),{getPagesRetrieve:this.pages.retrieve})),getPathVariables:t=>ue(g(P({},t),{config:x(this,D)})),getQuery:async t=>await de(g(P({},t),{config:x(this,D),notionDatabasesQuery:this.databases.query}))};this.dataTypes={[k.LISTING]:async t=>await ee(g(P({},t),{config:x(this,D),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getPagesById:this.custom.getPagesById})),[k.LISTING_BY_DATE]:async t=>await oe(g(P({},t),{config:x(this,D),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getPagesById:this.custom.getPagesById})),[k.SLUG]:async t=>await re(g(P({},t),{config:x(this,D),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getDeepFetchAllChildren:this.custom.getDeepFetchAllChildren})),[k.SLUG_BY_ROUTE]:async t=>await se(g(P({},t),{config:x(this,D),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getQuery:this.custom.getQuery}))};Ee(this,D,t==null?void 0:t.config)}};D=new WeakMap;module.exports=Lt(wo);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
- block_id: any;
10
- }) => Promise<any>;
11
- getDatabasesByIdQuery: (props: {
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 Xe=Object.defineProperty,et=Object.defineProperties;var tt=Object.getOwnPropertyDescriptors;var ue=Object.getOwnPropertySymbols;var ot=Object.prototype.hasOwnProperty,rt=Object.prototype.propertyIsEnumerable;var de=(e,o,n)=>o in e?Xe(e,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[o]=n,b=(e,o)=>{for(var n in o||(o={}))ot.call(o,n)&&de(e,n,o[n]);if(ue)for(var n of ue(o))rt.call(o,n)&&de(e,n,o[n]);return e},k=(e,o)=>et(e,tt(o));var ce=(e,o,n)=>{if(!o.has(e))throw TypeError("Cannot "+n)};var L=(e,o,n)=>(ce(e,o,"read from private field"),n?n.call(e):o.get(e)),ye=(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)},me=(e,o,n,l)=>(ce(e,o,"write to private field"),l?l.call(e,n):o.set(e,n),n);import{Client as xo}from"@notionhq/client";import N from"lodash/filter.js";import nt from"lodash/map.js";var O=({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],he=[...G],Se=[...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],Pe=[...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],fe=[...G],Ee=[...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],ge=[...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],we=[...G],be=[...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],Te=[...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],Bo={BLOG:N(he,{init:!0}),EPISODES:N(Se,{init:!0}),EVENTS:N(Pe,{init:!0}),PAGES:N(fe,{init:!0}),PEOPLE:N(Ee,{init:!0}),PODCASTS:N(ge,{init:!0}),SEO:N(we,{init:!0}),SHOWS:N(be,{init:!0}),VENUES:N(Te,{init:!0})},ke={BLOG:he.map(e=>O(e)),EPISODES:Se.map(e=>O(e)),EVENTS:Pe.map(e=>O(e)),PAGES:fe.map(e=>O(e)),PEOPLE:Ee.map(e=>O(e)),PODCASTS:ge.map(e=>O(e)),SEO:we.map(e=>O(e)),SHOWS:be.map(e=>O(e)),VENUES:Te.map(e=>O(e))},Ie=nt(t,e=>O(e)),De=new Date().toISOString(),A={dateBefore:{property:t.datePublished.notion,date:{before:De}},dateOnOrAfter:{property:t.datePublished.notion,date:{on_or_after:De}},published:{property:t.isPublished.notion,checkbox:{equals:!1}},slug:{property:t.slug.notion,text:{equals:""}}},it="LISTING",st="LISTING_BY_DATE",at="SLUG",lt="SLUG_BY_ROUTE",pt=[it,st,at,lt],C=Object.assign({},...pt.map(e=>({[e]:e})).flat(1));import{avoidRateLimit as _t,isUndefined as ut}from"@jeromefitz/utils";var dt=async(e,{block_id:o})=>ut(o)?[]:(await _t(),await e({block_id:o})),q=dt;var Ce={sorts:[{property:t.slug.notion,direction:"ascending"}]},ct=async(e,{database_id:o,sorts:n=Ce.sorts,filter:l=Ce.filter})=>o?await e({database_id:o,sorts:n,filter:l}):[],Z=ct;var ve=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 ve(e,{blocks:i}),n[r]){let a=n[r].parent_block;a[a.type].children=i}}return o},K=ve;var yt=({config:e,item:o,routeType:n,meta:l})=>{var c,u,y,f,_;let{NOTION:r}=e,i="",a=(c=o.properties)==null?void 0:c.slug,s="",d="/[...catchAll]";switch(n){case r.BLOG.routeType:i=(y=(u=o.properties)==null?void 0:u.datePublished)==null?void 0:y.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,m]=i==null?void 0:i.split("-");s=`/${n}/${p}/${w}/${m}/${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:d,slug:a}},J=yt;import{sortObject as je}from"@jeromefitz/utils";import to from"lodash/map.js";import re from"lodash/omit.js";import xe from"date-fns/addDays/index.js";import mt from"date-fns/addMonths/index.js";import ht from"date-fns/addYears/index.js";var St=(e,o)=>{switch(o){case"year":return ht(e,1).toISOString();case"month":return mt(e,1).toISOString();case"day":return xe(e,2).toISOString()}return xe(e,-1).toISOString()},D=St;import Pt from"lodash/map.js";var ft=({config:e,data:o,pathVariables:n,pageId:l})=>{var c,u;let{NOTION:r}=e,i={};if(!(o==null?void 0:o.properties))return i;let{properties:a}=o,s;if(n){let{meta:y,routeType:f}=n;s=f===((c=r==null?void 0:r.PODCASTS)==null?void 0:c.routeType)&&y.length>1?(u=r==null?void 0:r.EPISODES)==null?void 0:u.routeType:f}let d=s?ke[s.toUpperCase()]:Ie;return Pt(d,y=>{let f,_=a[y.notion];i[y.key]=null,_&&(f=U[y.type](_,l),i[y.key]=f||null)}),i},I=ft;import{sortObject as Et}from"@jeromefitz/utils";import gt from"lodash/map.js";import wt from"lodash/omit.js";var bt=({config:e,results:o,routeType:n})=>{let l=[];return gt(o,r=>{let i=wt(r,"properties");i.properties=Et(I({config:e,data:r,pathVariables:n,pageId:r==null?void 0:r.id})),l.push(i)}),l},Oe=bt;import Tt from"lodash/filter.js";import X from"lodash/map.js";var kt=(e,o)=>{switch(o){case"info":let n=[];return X(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&&Tt(e,{object:"block",type:"image"});case"items":let l=[];return X(e,r=>{var i;X((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[]}},R=kt;import It from"github-slugger";import ee from"lodash/map.js";import{getPlaiceholder as te}from"plaiceholder";var Dt=async({data:e,pathVariables:o})=>{var u,y,f,_,T,E,g;let n=new It,l={},r=((u=e.info)==null?void 0:u.object)==="page"?R((y=e.info)==null?void 0:y.properties,"info"):!!((f=e.info)==null?void 0:f.results)&&R((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:m,img:P}=await te(w),x=n.slug(w);return{base64:m,id:x,img:P,url:w}}),a=i?await Promise.all(i):[],s=!o.isIndex&&R(e==null?void 0:e.content,"content"),d=!!s&&s.map(async p=>{var B,M;if(!p)return null;let{type:w}=p,m=p[w],P=!!p&&!!((B=m==null?void 0:m.external)==null?void 0:B.url)?(M=m==null?void 0:m.external)==null?void 0:M.url:null;if(!P)return null;let{base64:x,img:H}=await te(P),V=n.slug(P);return{base64:x,id:V,img:H,url:P}}),c=d?await Promise.all(d):[];if(e.items){let p=e.items.object==="page"?R((E=e.items)==null?void 0:E.data,"items"):R((g=e.items)==null?void 0:g.results,"items"),w=!!p&&p.map(async P=>{if(!P)return null;let x=!!P&&!!(P==null?void 0:P.url)?P==null?void 0:P.url:P;if(!x)return null;let{base64:H,img:V}=await te(x),B=n.slug(x);return{base64:H,id:B,img:V,url:x}}),m=await Promise.all(w);!!m&&m[0]&&ee(m,P=>l[P.id]=P)}return!!a&&a[0]&&ee(a,p=>l[p.id]=p),!!c&&c[0]&&ee(c,p=>l[p.id]=p),l},F=Dt;var Ct=e=>(console.dir("@notion(_unsupported)"),console.dir(e),e),Q=Ct;var vt=e=>e.checkbox||!1,Ne=vt;var xt=e=>{let{type:o}=e;return e[o]},j=xt;var Ot=e=>e.email||null,Ge=Ot;import{stringToUUID as Nt}from"@jeromefitz/utils";import Gt from"github-slugger";import Lt from"lodash/size.js";var Bt="https://www.notion.so/image/{{FILENAME}}?table=block&id={{PAGE_ID}}&cache=v2&w1dth=600",At=(e,o)=>Bt.replace("{{FILENAME}}",encodeURIComponent(e)).replace("{{PAGE_ID}}",Nt(o)),Ut=(e,o)=>{let n=new Gt,l={};return Lt(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],d=n.slug(s);l[d]={type:r==null?void 0:r.type,url:At(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],d=n.slug(s);l[d]={type:r==null?void 0:r.type,url:s}}}),l},oe=Ut;import Vt from"github-slugger";import Mt from"lodash/map.js";var Rt=e=>{let o=new Vt,n={};return Mt(e.multi_select,l=>{let r=l;r.slug=o.slug(r.name),n[r.id]=r}),n},Le=Rt;var Ht=e=>(e==null?void 0:e.number)||null,Be=Ht;import Wt from"github-slugger";var Ft=e=>{let o=new Wt;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]},Ae=Ft;var Qt=e=>(e==null?void 0:e.phone_number)||null,Ue=Qt;import Ve from"lodash/map.js";var jt=e=>e.type==="rollup"?e.rollup.type==="array"&&Ve(e.rollup.array,o=>U[o.type](o))[0]:Ve(e.relation,o=>o.id),Me=jt;var zt=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},Re=zt;import $t from"lodash/map.js";import Yt from"lodash/sortBy.js";var qt=e=>{var o;return Yt($t((o=e==null?void 0:e.rollup)==null?void 0:o.array,n=>U[n.type](n)))},He=qt;import Zt from"github-slugger";var Kt=e=>{let o=new Zt,n=e.select;return n?(n.slug=o.slug(e.select.name),{[n.id]:n}):null},We=Kt;var Jt=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},Fe=Jt;var Xt=e=>e.url||null,Qe=Xt;var eo={checkbox:Ne,created_by:Q,created_time:j,date:j,email:Ge,files:oe,formula:Q,image:oe,last_edited_by:Q,last_edited_time:j,multi_select:Le,number:Be,people:Ae,phone_number:Ue,relation:Me,rich_text:Re,rollup:He,select:We,title:Fe,url:Qe},U=eo;var oo=async({config:e,getBlocksByIdChildren:o,getDatabasesByIdQuery:n,getPagesById:l,pathVariables:r,routeType:i})=>{let{NOTION:a}=e,s={},d={},c={},u=new Date().toISOString(),y=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"&&(d=re(_,"properties"),d.properties=je(I({config:e,data:_,pathVariables:r,pageId:d.id}))),s=await o({block_id:d.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?u:y}}]}}),E=[];to(T.results,m=>{let P=m;P=re(P,"properties"),P.properties=je(I({config:e,data:m,pathVariables:r,pageId:m.id})),E.push(P)});let g=re(T,"results");g.results=E,c=g;let p={info:d,content:s,items:c,images:{}},w=p?await F({data:p,pathVariables:r}):{};return p=k(b({},p),{images:w}),p},ne=oo;import{sortObject as ze}from"@jeromefitz/utils";import ro from"lodash/map.js";import z from"lodash/omit.js";import no from"lodash/size.js";var io=async({config:e,getBlocksByIdChildren:o,getDatabasesByIdQuery:n,getPagesById:l,pathVariables:r,routeType:i,slug:a})=>{let{NOTION:s}=e,{meta:d}=r,c={},u={},y={},f=new Date().toISOString(),_=s[i.toUpperCase()].page_id__seo,T=await l({page_id:_});T.object==="page"&&(u=z(T,"properties"),u.properties=ze(I({config:e,data:T,pathVariables:r,pageId:u.id}))),c=await o({block_id:u.id});let E=no(d),[g,p,w]=d,m=new Date(`${g||f.slice(0,4)}-${p||"01"}-${w||"01"}`),P,x=[{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:D(m,"")}},{property:i===s.EVENTS.routeType?t.dateEvent.notion:t.datePublished.notion,date:{before:D(m,"year")}}]};break;case 2:P={and:[{property:i===s.EVENTS.routeType?t.dateEvent.notion:t.datePublished.notion,date:{on_or_after:D(m,"")}},{property:i===s.EVENTS.routeType?t.dateEvent.notion:t.datePublished.notion,date:{before:D(m,"month")}}]};break;case 3:P={and:[{property:i===s.EVENTS.routeType?t.dateEvent.notion:t.datePublished.notion,date:{on_or_after:D(m,"")}},{property:i===s.EVENTS.routeType?t.dateEvent.notion:t.datePublished.notion,date:{before:D(m,"day")}}]};break;default:P={and:[{property:i===s.EVENTS.routeType?t.dateEvent.notion:t.datePublished.notion,date:{on_or_after:D(m,"")}},{property:i===s.EVENTS.routeType?t.dateEvent.notion:t.datePublished.notion,date:{before:D(m,"day")}},k(b({},A.slug),{text:{equals:a}})]};break}let H=s[i.toUpperCase()].database_id,V=await n({database_id:H,filter:P,sorts:x}),B=[];ro(V.results,Y=>{let W=Y;W=z(W,"properties"),W.properties=ze(I({config:e,data:Y,pathVariables:r,pageId:Y.id})),!!W&&B.push(W)});let M=z(V,"results");M.results=B,y=M,y=z(M,"data");let $={info:u,content:c,items:y,images:{}},Je={};return $=k(b({},$),{images:Je}),$},ie=io;import{sortObject as so}from"@jeromefitz/utils";import ao from"lodash/filter.js";import lo from"lodash/omit.js";var po=async({config:e,getBlocksByIdChildren:o,getDatabasesByIdQuery:n,getDeepFetchAllChildren:l,pathVariables:r,routeType:i,slug:a})=>{let{NOTION:s}=e,d={},c={},u={},y=i==null?void 0:i.toUpperCase();if(!Object.keys(s).includes(y))return{info:c,content:d,items:u,images:{}};let _=await n({database_id:s[y].database_id,filter:{and:[k(b({},A.slug),{text:{equals:a}})]}}),T=(_==null?void 0:_.object)==="list"&&_.results[0];if(!T)return{};c=lo(T,"properties"),c.properties=so(I({config:e,data:T,pathVariables:r,pageId:c.id})),d=await o({block_id:c.id}),d=[...await l({blocks:d.results})],u&&(u.results=ao(u.results,{properties:{isPublished:!0}}));let g={info:c,content:d,items:u,images:{}},p=g?await F({data:g,pathVariables:r}):{};return g=k(b({},g),{images:p}),g},se=po;import{sortObject as $e}from"@jeromefitz/utils";import Ye from"lodash/omit.js";import _o from"lodash/size.js";var uo=async({config:e,getBlocksByIdChildren:o,getDatabasesByIdQuery:n,getQuery:l,pathVariables:r,routeType:i,slug:a})=>{let{NOTION:s}=e,{meta:d}=r,c={},u={},y={},f=new Date().toISOString();if(i===s.PODCASTS.routeType){let[E,g]=d,p=_o(d)===2,w=await n({database_id:s[p?s.EPISODES.routeType.toUpperCase():i.toUpperCase()].database_id,filter:{and:[k(b({},A.slug),{text:{equals:p?g:E}})]}}),m=(w==null?void 0:w.object)==="list"&&w.results[0];if(!m)return{};u=Ye(m,"properties"),u.properties=$e(I({config:e,data:m,pathVariables:r,pageId:u.id})),c=await o({block_id:u.id}),p||i===s.PODCASTS.routeType&&(y=await l({config:e,reqQuery:{podcasts:u.id,databaseType:s.EPISODES.routeType.toUpperCase()}}))}if([s.BLOG.routeType,s.EVENTS.routeType].includes(i)){let[E,g,p]=d,w=new Date(`${E||f.slice(0,4)}-${g||"01"}-${p||"01"}`),m=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:D(w,"")}},{property:i===s.EVENTS.routeType?t.dateEvent.notion:t.datePublished.notion,date:{before:D(w,"day")}},k(b({},A.slug),{text:{equals:a}})]}}),P=(m==null?void 0:m.object)==="list"&&m.results[0];P&&(u=Ye(P,"properties"),u.properties=$e(I({config:e,data:P,pathVariables:r,pageId:u.id})),c=await o({block_id:u.id}))}let _={info:u,content:c,items:y,images:{}},T={};return _=k(b({},_),{images:T}),_},ae=uo;import{avoidRateLimit as co,isUndefined as yo}from"@jeromefitz/utils";var mo=async(e,{page_id:o})=>yo(o)?[]:(await co(),await e({page_id:o})),le=mo;import qe from"lodash/drop.js";import ho from"lodash/dropRight.js";import So from"lodash/first.js";import Ze from"lodash/includes.js";import Po from"lodash/isInteger.js";import fo from"lodash/join.js";import Eo from"lodash/last.js";import Ke from"lodash/size.js";var go=({config:e,catchAll:o})=>{let{NOTION:n,PAGES__HOMEPAGE:l,ROUTE_TYPES:r}=e,i=Ke(o),a=So(o),s=Eo(o),d=i>1&&Ze([n.BLOG.routeType,n.EVENTS.routeType,n.PODCASTS.routeType],a)?qe(o):qe(ho(o)),c=a===s&&!Ze(r,a)?"pages":a,u=a!==s&&!Po(parseInt(s))?s:a,y=c==="pages",f=u===a,_=!!d&&Ke(d)!==0,T=y&&a===l?"":fo(o,"/"),E=C.SLUG;return y?E=C.SLUG:f&&!_?E=C.LISTING:f&&_?E=C.LISTING_BY_DATE:_?E=C.SLUG_BY_ROUTE:E=C.SLUG,{dataType:E,hasMeta:_,isPage:y,isIndex:f,meta:d,routeType:c,slug:u,url:T}},pe=go;import{avoidRateLimit as wo,isObjectEmpty as bo}from"@jeromefitz/utils";import To from"lodash/map.js";import ko from"lodash/omit.js";import Io from"lodash/size.js";var Do={ASCENDING:"ascending",DESCENDING:"descending"},Co=[{property:t.slug.notion,direction:Do.ASCENDING}],vo=async({config:e,reqQuery:o,notionDatabasesQuery:n})=>{let{NOTION:l}=e,{databaseType:r}=o,i=r,a=!1,s=r.toUpperCase(),d=l[s].database_id;if(!d)return[];let c={},u={},y,f;if(r==="EPISODES"){f=Co;let{podcasts:_}=o,T=[],E=[];!!_&&E.push(..._==null?void 0:_.split(",")),Io(E)>0&&To(E,g=>T.push({property:t.relationEpisodes__Podcast.notion,relation:{contains:g}})),y={or:[...T]}}else a=!0;if(!a&&(!c||bo(c))){await wo();let _;y?((y==null?void 0:y.or.length)===0&&(y={and:[{property:t.slug.notion,rich_text:{equals:"@hack(notion)-do-not-return"}}]}),_=await n({database_id:d,filter:y,sorts:f}),c=_,u=Oe({config:e,results:_.results,routeType:i}),c=ko(c,"results"),c.results=u):a=!0}return c},_e=vo;var v,Oo=class extends xo{constructor(o){super(o);ye(this,v,void 0);this.custom={getBlocksByIdChildren:async o=>await q(this.blocks.children.list,b({},o)),getDatabasesByIdQuery:async o=>await Z(this.databases.query,o),getDeepFetchAllChildren:async o=>await K(this.blocks.children.list,b({},o)),getInfoType:o=>J(k(b({},o),{config:L(this,v)})),getPagesById:async o=>await le(this.pages.retrieve,b({},o)),getPathVariables:o=>pe(k(b({},o),{config:L(this,v)})),getQuery:async o=>await _e(k(b({},o),{config:L(this,v),notionDatabasesQuery:this.databases.query}))};this.dataTypes={[C.LISTING]:async o=>await ne(k(b({},o),{config:L(this,v),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getPagesById:this.custom.getPagesById})),[C.LISTING_BY_DATE]:async o=>await ie(k(b({},o),{config:L(this,v),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getPagesById:this.custom.getPagesById})),[C.SLUG]:async o=>await se(k(b({},o),{config:L(this,v),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getDeepFetchAllChildren:this.custom.getDeepFetchAllChildren})),[C.SLUG_BY_ROUTE]:async o=>await ae(k(b({},o),{config:L(this,v),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getQuery:this.custom.getQuery}))};me(this,v,o==null?void 0:o.config)}};v=new WeakMap;export{Oo as Client};
1
+ var Ve=Object.defineProperty,He=Object.defineProperties;var Qe=Object.getOwnPropertyDescriptors;var ee=Object.getOwnPropertySymbols;var Fe=Object.prototype.hasOwnProperty,We=Object.prototype.propertyIsEnumerable;var te=(e,t,n)=>t in e?Ve(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,P=(e,t)=>{for(var n in t||(t={}))Fe.call(t,n)&&te(e,n,t[n]);if(ee)for(var n of ee(t))We.call(t,n)&&te(e,n,t[n]);return e},g=(e,t)=>He(e,Qe(t));var oe=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var x=(e,t,n)=>(oe(e,t,"read from private field"),n?n.call(e):t.get(e)),re=(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)},ne=(e,t,n,l)=>(oe(e,t,"write to private field"),l?l.call(e,n):t.set(e,n),n);import{Client as mo}from"@notionhq/client";import v from"lodash/filter.js";import Ye from"lodash/map.js";var C=({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"}},O=[o.authors,o.datePublished,o.isIndexed,o.isPublished,o.slug,o.seoDescription,o.seoImage,o.seoImageDescription,o.title],ie=[...O],se=[...O,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],ae=[...O,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],le=[...O],pe=[...O,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],_e=[...O,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=[...O],de=[...O,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],ce=[...O,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],Eo={BLOG:v(ie,{init:!0}),EPISODES:v(se,{init:!0}),EVENTS:v(ae,{init:!0}),PAGES:v(le,{init:!0}),PEOPLE:v(pe,{init:!0}),PODCASTS:v(_e,{init:!0}),SEO:v(ue,{init:!0}),SHOWS:v(de,{init:!0}),VENUES:v(ce,{init:!0})},ye={BLOG:ie.map(e=>C(e)),EPISODES:se.map(e=>C(e)),EVENTS:ae.map(e=>C(e)),PAGES:le.map(e=>C(e)),PEOPLE:pe.map(e=>C(e)),PODCASTS:_e.map(e=>C(e)),SEO:ue.map(e=>C(e)),SHOWS:de.map(e=>C(e)),VENUES:ce.map(e=>C(e))},me=Ye(o,e=>C(e)),he=new Date().toISOString(),B={dateBefore:{property:o.datePublished.notion,date:{before:he}},dateOnOrAfter:{property:o.datePublished.notion,date:{on_or_after:he}},published:{property:o.isPublished.notion,checkbox:{equals:!1}},slug:{property:o.slug.notion,text:{equals:""}}},ze="LISTING",$e="LISTING_BY_DATE",je="SLUG",qe="SLUG_BY_ROUTE",Ze=[ze,$e,je,qe],k=Object.assign({},...Ze.map(e=>({[e]:e})).flat(1));import{avoidRateLimit as Ke,isUndefined as Je}from"@jeromefitz/utils";var Xe=async({getBlocksChildrenList:e,block_id:t})=>Je(t)?[]:(await Ke(),await e({block_id:t})),V=Xe;var N={sorts:[{property:o.slug.notion,direction:"ascending"}]},et=async({database_id:e,filter:t=N==null?void 0:N.filter,getDatabasesQuery:n,sorts:l=N==null?void 0:N.sorts})=>e?await n({database_id:e,sorts:l,filter:t}):[],H=et;var Se=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}}),l=await Promise.all(n.map(r=>r.promise));for(let r=0;r<l.length;r++){let i=l[r].results;if(await Se({blocks:i,getBlocksChildrenList:e}),n[r]){let _=n[r].parent_block;_[_.type].children=i}}return t},Q=Se;var tt=({config:e,item:t,routeType:n,meta:l})=>{var y,h,a,p,m;let{NOTION:r}=e,i="",_=(y=t.properties)==null?void 0:y.slug,s="",u="/[...catchAll]";switch(n){case r.BLOG.routeType:i=(a=(h=t.properties)==null?void 0:h.datePublished)==null?void 0:a.start.slice(0,10);let[E,S,f]=i==null?void 0:i.split("-");s=`/${n}/${E}/${S}/${f}/${_}`;break;case r.EVENTS.routeType:i=(m=(p=t.properties)==null?void 0:p.dateEvent)==null?void 0:m.start.slice(0,10);let[w,b,R]=i==null?void 0:i.split("-");s=`/${n}/${w}/${b}/${R}/${_}`;break;case r.PODCASTS.routeType:case r.EPISODES.routeType:s=`/${l==null?void 0:l.join("/")}/${_}`;break;default:s=`/${n}/${_}`;break}return s=s.replace("//","/"),{as:s,date:i,href:u,slug:_}},F=tt;import{sortObject as Le}from"@jeromefitz/utils";import Mt from"lodash/map.js";import z from"lodash/omit.js";import Pe from"date-fns/addDays/index.js";import ot from"date-fns/addMonths/index.js";import rt from"date-fns/addYears/index.js";var nt=(e,t)=>{switch(t){case"year":return rt(e,1).toISOString();case"month":return ot(e,1).toISOString();case"day":return Pe(e,2).toISOString()}return Pe(e,-1).toISOString()},I=nt;import it from"lodash/map.js";var st=({config:e,data:t,pathVariables:n,pageId:l})=>{var y,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:p}=n;s=p===((y=r==null?void 0:r.PODCASTS)==null?void 0:y.routeType)&&a.length>1?(h=r==null?void 0:r.EPISODES)==null?void 0:h.routeType:p}let u=s?ye[s.toUpperCase()]:me;return it(u,a=>{let p,m=_[a.notion];i[a.key]=null,m&&(p=L[a.type](m,l),i[a.key]=p||null)}),i},T=st;import{sortObject as at}from"@jeromefitz/utils";import lt from"lodash/map.js";import pt from"lodash/omit.js";var _t=({config:e,results:t,routeType:n})=>{let l=[];return lt(t,r=>{let i=pt(r,"properties");i.properties=at(T({config:e,data:r,pathVariables:n,pageId:r==null?void 0:r.id})),l.push(i)}),l},ge=_t;var ut=({isPage:e,isIndex:t,hasMeta:n})=>e?k.SLUG:t&&!n?k.LISTING:t&&n?k.LISTING_BY_DATE:n?k.SLUG_BY_ROUTE:k.SLUG,W=ut;var dt=e=>(console.dir("@notion(_unsupported)"),e),A=dt;var ct=e=>e.checkbox||!1,Ee=ct;var yt=e=>{let{type:t}=e;return e[t]},U=yt;var mt=e=>e.email||null,fe=mt;import{stringToUUID as ht}from"@jeromefitz/utils";import St from"github-slugger";import Pt from"lodash/size.js";var gt="https://www.notion.so/image/{{FILENAME}}?table=block&id={{PAGE_ID}}&cache=v2&w1dth=600",Et=(e,t)=>gt.replace("{{FILENAME}}",encodeURIComponent(e)).replace("{{PAGE_ID}}",ht(t)),ft=(e,t)=>{let n=new St,l={};return Pt(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],u=n.slug(s);l[u]={type:r==null?void 0:r.type,url:Et(s,t)}}if((r==null?void 0:r.type)==="external"){let s=(_=r==null?void 0:r.external)==null?void 0:_.url.split("?")[0],u=n.slug(s);l[u]={type:r==null?void 0:r.type,url:s}}}),l},Y=ft;import wt from"github-slugger";import Tt from"lodash/map.js";var bt=e=>{let t=new wt,n={};return Tt(e.multi_select,l=>{let r=l;r.slug=t.slug(r.name),n[r.id]=r}),n},we=bt;var kt=e=>(e==null?void 0:e.number)||null,Te=kt;import It from"github-slugger";var Dt=e=>{let t=new It;return e.people.map(n=>{let{avatar_url:l,id:r,name:i,person:_}=n,{email:s}=_;return{[t.slug(i)]:{avatar_url:l,email:s,id:r,name:i}}})[0]},be=Dt;var Ct=e=>(e==null?void 0:e.phone_number)||null,ke=Ct;import Ie from"lodash/map.js";var vt=e=>e.type==="rollup"?e.rollup.type==="array"&&Ie(e.rollup.array,t=>L[t.type](t))[0]:Ie(e.relation,t=>t.id),De=vt;var Ot=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},Ce=Ot;import xt from"lodash/map.js";import Bt from"lodash/sortBy.js";var Lt=e=>{var t;return Bt(xt((t=e==null?void 0:e.rollup)==null?void 0:t.array,n=>L[n.type](n)))},ve=Lt;import Nt from"github-slugger";var Rt=e=>{let t=new Nt,n=e.select;return n?(n.slug=t.slug(e.select.name),{[n.id]:n}):null},Oe=Rt;var Gt=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},xe=Gt;var At=e=>e.url||null,Be=At;var Ut={checkbox:Ee,created_by:A,created_time:U,date:U,email:fe,files:Y,formula:A,image:Y,last_edited_by:A,last_edited_time:U,multi_select:we,number:Te,people:be,phone_number:ke,relation:De,rich_text:Ce,rollup:ve,select:Oe,title:xe,url:Be},L=Ut;var Vt=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,getPagesById:l,pathVariables:r,routeType:i})=>{let{NOTION:_}=e,s=_.EVENTS.routeType===i,u={},y=new Date().toISOString(),h=new Date("2020-01-01").toISOString(),a=_[i.toUpperCase()].page_id__seo,p=await l({page_id:a});if(!p)return{};(p==null?void 0:p.object)==="page"&&(u=z(p,"properties"),u.properties=Le(T({config:e,data:p,pathVariables:r,pageId:u.id})));let m=await t({block_id:u.id}),E=await n({database_id:_[i.toUpperCase()].database_id,filter:{and:[{property:s?o.dateEvent.notion:o.datePublished.notion,date:{on_or_after:s?y:h}}]}}),S=[];Mt(E.results,w=>{let b=w;b=z(b,"properties"),b.properties=Le(T({config:e,data:w,pathVariables:r,pageId:w.id})),S.push(b)});let f=z(E,"results");return f.results=S,{info:u,content:m,items:f,images:{}}},$=Vt;import{sortObject as Ne}from"@jeromefitz/utils";import Ht from"lodash/map.js";import M from"lodash/omit.js";import Qt from"lodash/size.js";var Ft=({config:e,pathVariables:t,routeType:n,slug:l})=>{let{NOTION:r}=e,{meta:i}=t,[_,s,u]=i,y=Qt(i),h=new Date().toISOString(),a=new Date(`${_||h.slice(0,4)}-${s||"01"}-${u||"01"}`),p=n===r.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion;switch(y){case 1:return{and:[{property:p,date:{on_or_after:I(a,"")}},{property:p,date:{before:I(a,"year")}}]};case 2:return{and:[{property:p,date:{on_or_after:I(a,"")}},{property:p,date:{before:I(a,"month")}}]};case 3:return{and:[{property:p,date:{on_or_after:I(a,"")}},{property:p,date:{before:I(a,"day")}}]};default:return{and:[{property:p,date:{on_or_after:I(a,"")}},{property:p,date:{before:I(a,"day")}},g(P({},B.slug),{text:{equals:l}})]}}},Wt=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,getPagesById:l,pathVariables:r,routeType:i,slug:_})=>{let{NOTION:s}=e,u={},y={},h=s[i.toUpperCase()].page_id__seo,a=await l({page_id:h});a.object==="page"&&(y=M(a,"properties"),y.properties=Ne(T({config:e,data:a,pathVariables:r,pageId:a.id}))),u=await t({block_id:y.id});let p=[{property:o.datePublished.notion,direction:"descending"}],m=Ft({config:e,pathVariables:r,routeType:i,slug:_}),E=s[i.toUpperCase()].database_id,S=await n({database_id:E,filter:m,sorts:p}),f=[];Ht(S.results,R=>{let G=M(R,"properties");G.properties=Ne(T({config:e,data:R,pathVariables:r,pageId:G.id})),!!G&&f.push(G)});let w=M(S,"results");w.results=f;let b=M(w,"data");return{info:y,content:u,items:b,images:{}}},j=Wt;import{sortObject as Yt}from"@jeromefitz/utils";import zt from"lodash/omit.js";var $t=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,getDeepFetchAllChildren:l,pathVariables:r,routeType:i,slug:_})=>{let{NOTION:s}=e,u=i==null?void 0:i.toUpperCase();if(!Object.keys(s).includes(u))return{info:{},content:{},items:{},images:{}};let h=await n({database_id:s[u].database_id,filter:{and:[g(P({},B.slug),{text:{equals:_}})]}}),a=(h==null?void 0:h.object)==="list"&&h.results[0];if(!a)return{};let p=zt(a,"properties");p.properties=Yt(T({config:e,data:a,pathVariables:r,pageId:p.id}));let m=await t({block_id:p.id}),S=[...await l({blocks:m.results})];return{info:p,content:S,items:{},images:{}}},q=$t;import{sortObject as Re}from"@jeromefitz/utils";import Ge from"lodash/omit.js";import jt from"lodash/size.js";var qt=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,getQuery:l,pathVariables:r,routeType:i})=>{var b;let{NOTION:_}=e,{meta:s}=r,u=i.toUpperCase(),[y,h]=s,a=jt(s)===2,p=(b=_[u])==null?void 0:b.hasChild.toUpperCase(),m=await n({database_id:_[a?_[p].routeType.toUpperCase():u].database_id,filter:{and:[g(P({},B.slug),{text:{equals:a?h:y}})]}}),E=(m==null?void 0:m.object)==="list"&&m.results[0];if(!E)return{info:{},content:{},items:{},images:{}};let S=Ge(E,"properties");S.properties=Re(T({config:e,data:E,pathVariables:r,pageId:S.id}));let f=await t({block_id:S.id}),w={};return a||(w=await l({config:e,reqQuery:{podcasts:S.id,databaseType:_[p].routeType.toUpperCase()}})),{info:S,content:f,items:w,images:{}}},Zt=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,pathVariables:l,routeType:r,slug:i})=>{let _=new Date().toISOString(),{NOTION:s}=e,{meta:u}=l,[y,h,a]=u,p=new Date(`${y||_.slice(0,4)}-${h||"01"}-${a||"01"}`),m=await n({database_id:s[r.toUpperCase()].database_id,filter:{and:[{property:r===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{on_or_after:I(p,"")}},{property:r===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{before:I(p,"day")}},g(P({},B.slug),{text:{equals:i}})]}}),E=(m==null?void 0:m.object)==="list"&&m.results[0];if(!E)return{info:{},content:{},items:{},images:{}};let S=Ge(E,"properties");S.properties=Re(T({config:e,data:E,pathVariables:l,pageId:S.id}));let f=await t({block_id:S.id});return{info:S,content:f,items:{},images:{}}},Kt=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,getQuery:l,pathVariables:r,routeType:i,slug:_})=>{let{NOTION:s,ROUTE_TYPES_BY_DATA_TYPES:u}=e;return s[i.toUpperCase()].hasChild?await qt({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,getQuery:l,pathVariables:r,routeType:i}):u[k.LISTING_BY_DATE].includes(i.toUpperCase())?await Zt({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,pathVariables:r,routeType:i,slug:_}):{info:{},content:{},items:{},images:{}}},Z=Kt;import{avoidRateLimit as Jt,isUndefined as Xt}from"@jeromefitz/utils";var eo=async({getPagesRetrieve:e,page_id:t})=>Xt(t)?[]:(await Jt(),await e({page_id:t})),K=eo;import Ae from"lodash/drop.js";import to from"lodash/dropRight.js";import oo from"lodash/first.js";import Ue from"lodash/includes.js";import ro from"lodash/isInteger.js";import no from"lodash/join.js";import io from"lodash/last.js";import Me from"lodash/size.js";var so=({config:e,catchAll:t})=>{let{NOTION:n,PAGES__HOMEPAGE:l,ROUTE_META:r,ROUTE_TYPES:i}=e,_=Me(t),s=oo(t),u=s.toUpperCase(),y=io(t),h=_>1&&Ue(r,u)?Ae(t):Ae(to(t)),a=s===y&&!Ue(i,u)?n.PAGES.routeType:s,p=s!==y&&!ro(parseInt(y))?y:s,m=a===n.PAGES.routeType.toLowerCase(),E=p===s,S=!!h&&Me(h)!==0,f=m&&s===l?"":no(t,"/"),w={hasMeta:S,isPage:m,isIndex:E,meta:h,routeType:a,slug:p,url:f},b=W(w);return g(P({},w),{dataType:b})},J=so;import{avoidRateLimit as ao,isObjectEmpty as lo}from"@jeromefitz/utils";import po from"lodash/map.js";import _o from"lodash/omit.js";import uo from"lodash/size.js";var co=[{property:o.slug.notion,direction:"ascending"}],yo=async({config:e,reqQuery:t,notionDatabasesQuery:n})=>{let{NOTION:l}=e,{databaseType:r}=t,i=r,_=!1,s=r.toUpperCase(),u=l[s].database_id;if(!u)return[];let y={},h={},a,p;if(r==="EPISODES"){p=co;let{podcasts:m}=t,E=[],S=[];!!m&&S.push(...m==null?void 0:m.split(",")),uo(S)>0&&po(S,f=>E.push({property:o.relationEpisodes__Podcast.notion,relation:{contains:f}})),a={or:[...E]}}else _=!0;if(!_&&(!y||lo(y))){await ao();let m;a?((a==null?void 0:a.or.length)===0&&(a={and:[{property:o.slug.notion,rich_text:{equals:"@hack(notion)-do-not-return"}}]}),m=await n({database_id:u,filter:a,sorts:p}),y=m,h=ge({config:e,results:m.results,routeType:i}),y=_o(y,"results"),y.results=h):_=!0}return y},X=yo;var D,ho=class extends mo{constructor(t){super(t);re(this,D,void 0);this.custom={getBlocksByIdChildren:async t=>await V(g(P({},t),{getBlocksChildrenList:this.blocks.children.list})),getDatabasesByIdQuery:async t=>await H(g(P({},t),{getDatabasesQuery:this.databases.query})),getDeepFetchAllChildren:async t=>await Q(g(P({},t),{getBlocksChildrenList:this.blocks.children.list})),getInfoType:t=>F(g(P({},t),{config:x(this,D)})),getPagesById:async t=>await K(g(P({},t),{getPagesRetrieve:this.pages.retrieve})),getPathVariables:t=>J(g(P({},t),{config:x(this,D)})),getQuery:async t=>await X(g(P({},t),{config:x(this,D),notionDatabasesQuery:this.databases.query}))};this.dataTypes={[k.LISTING]:async t=>await $(g(P({},t),{config:x(this,D),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getPagesById:this.custom.getPagesById})),[k.LISTING_BY_DATE]:async t=>await j(g(P({},t),{config:x(this,D),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getPagesById:this.custom.getPagesById})),[k.SLUG]:async t=>await q(g(P({},t),{config:x(this,D),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getDeepFetchAllChildren:this.custom.getDeepFetchAllChildren})),[k.SLUG_BY_ROUTE]:async t=>await Z(g(P({},t),{config:x(this,D),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getQuery:this.custom.getQuery}))};ne(this,D,t==null?void 0:t.config)}};D=new WeakMap;export{ho as Client};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jeromefitz/notion",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "Notion: Custom Client for jeromefitzgerald.com",
5
5
  "author": {
6
6
  "name": "Jerome Fitzgerald",
@@ -41,8 +41,7 @@
41
41
  "date-fns": "2.28.0",
42
42
  "date-fns-tz": "1.2.2",
43
43
  "github-slugger": "1.4.0",
44
- "lodash": "4.17.21",
45
- "plaiceholder": "2.2.0"
44
+ "lodash": "4.17.21"
46
45
  },
47
46
  "devDependencies": {
48
47
  "@types/github-slugger": "1.3.0",